DodoApp: Discriminate between Agent access endpoint and regular HTTPS

Change-Id: I063a33328b27004cf4e9c7020c2a93c1b52ffb73
diff --git a/core/installer/app_configs/app_global_env.cue b/core/installer/app_configs/app_global_env.cue
index 25211a8..6b0c1ec 100644
--- a/core/installer/app_configs/app_global_env.cue
+++ b/core/installer/app_configs/app_global_env.cue
@@ -32,8 +32,9 @@
 networks: #Networks
 
 #IngressAccess: #Access & {
-	type:    "https"
-	address: string
+	type:       "https"
+	address:    string
+	agentName?: string
 }
 
 #Ingress: #WithOut & {
@@ -48,9 +49,11 @@
 		name: string
 		port: int & >0
 	})
-	cluster?: #Cluster
-	_cluster: cluster
-	g?:       #Global
+	cluster?:   #Cluster
+	_cluster:   cluster
+	g?:         #Global
+	agentName?: string
+	_agentName: agentName
 
 	_name: name
 
@@ -61,6 +64,9 @@
 			name:    _name
 			type:    "https"
 			address: "https://\(subdomain).\(network.domain)"
+			if _agentName != _|_ {
+				agentName: _agentName
+			}
 		}]
 	}
 
diff --git a/core/installer/app_configs/dodo_app.cue b/core/installer/app_configs/dodo_app.cue
index 966b93e..439b419 100644
--- a/core/installer/app_configs/dodo_app.cue
+++ b/core/installer/app_configs/dodo_app.cue
@@ -152,6 +152,7 @@
 	name:      string | *"app"
 	type:      string
 	agentMode: bool | *false
+	agentPort: number | null | *null
 	ingress?: [...#AppIngress]
 	expose: [...#PortDomain] | *[]
 	rootDir: string
@@ -507,9 +508,10 @@
 		_geminiApiKey: input.geminiApiKey
 	}
 
+	agentPort: 2001
 	ports: [{
 		name:  "agent"
-		value: 2001
+		value: agentPort
 	}, {
 		name:  "p8080"
 		value: 8080
@@ -656,6 +658,9 @@
 					network:   networks[strings.ToLower(ingress.network)]
 					subdomain: ingress.subdomain
 					auth:      ingress.auth
+					if svc.agentPort == service.port {
+						agentName: svc.name
+					}
 					if _cc != null {
 						cluster: _cc
 					}
@@ -768,6 +773,9 @@
 					network:   networks[strings.ToLower(ingress.network)]
 					subdomain: ingress.subdomain
 					auth:      ingress.auth
+					if svc.agentPort == service.port {
+						agentName: svc.name
+					}
 					service: {
 						name: svc.name
 						if ingress.port.value != _|_ {
diff --git a/core/installer/dodo_app_test.go b/core/installer/dodo_app_test.go
index d4dc1a4..6ebf98e 100644
--- a/core/installer/dodo_app_test.go
+++ b/core/installer/dodo_app_test.go
@@ -650,6 +650,13 @@
       "type": "sketch:latest",
       "name": "dev",
       "geminiApiKey": "foo",
+      "ingress": [{
+        "network": "private",
+        "subdomain": "foo",
+        "port": {
+          "name": "agent"
+        }
+      }],
       "ports": [
         {
           "name": "agent",