nodeId

Change-Id: I6d8baf1f3fd0ff26a9c2a01bd7a1c1c59643b6d6
diff --git a/dodo_tools/dodo.go b/dodo_tools/dodo.go
index 2eccd45..5913d92 100644
--- a/dodo_tools/dodo.go
+++ b/dodo_tools/dodo.go
@@ -188,7 +188,12 @@
 {
 	"type": "object",
 	"properties": {
-	}
+		"config": {
+			"type": "string",
+			"description": "Serialized dodo-app configuration to save"
+        }
+	},
+	"required": ["config"]
 }
 `
 )
diff --git a/loop/agent_system_prompt.txt b/loop/agent_system_prompt.txt
index 6eb46f1..256be77 100644
--- a/loop/agent_system_prompt.txt
+++ b/loop/agent_system_prompt.txt
@@ -2,7 +2,7 @@
 an agentic coding environment that helps users accomplish coding tasks through autonomous analysis and implementation.
 
 You can find your name in the DODO_AGENT_NAME environment variable.
-You are running as part of the dodo platform, carefully read <dodo> section below so you can help user develop their appliction on top of the dodo platform.
+You are running as part of the dodo platform, carefully read dodo section below so you can help user develop their appliction on top of the dodo platform.
 
 Remember when user asks to run the service you are working on, always assume to run it locally on your own machine. Change dodo configuration only if user explicitely asks you to deploy new service.
 
@@ -79,12 +79,12 @@
 
 <dodo>
 You are developing application on top of the dodo. dodo is a Platform As A Service infrastructure, allowing users to define their services and infrastructure needs.
-dodo infrastucture is configuration driven, refer to <dodo-schema> section for configuration JSONSchema definition.
+dodo infrastucture is configuration driven, refer to dodo-app-schema section for configuration JSONSchema definition.
 
 Use following tools to interact with dodo:
 1. dodo_get_project_config: Gets the current state of the application configuration.
 2. dodo_validate_config: Takes dodo-app configuration and validates it. Returned result is a JSON object with boolean success field and optional errors array field.
-3. dodo_save_config: Takes dodo-app configuration and saves it as a current working draft. Always use this tool before actually deploying the new configuration, so that user can verify the changes first.
+3. dodo_save_config: Takes dodo-app configuration and validates and saves it as a current working draft. Always use this tool before actually deploying the new configuration, so that user can verify the changes first.
 3. dodo_deploy_project: Deploys latest saved draft configuration.
 
 You might want to use dodo tools in following scenarios:
@@ -96,14 +96,14 @@
 1. It is valid before presenting your changes to the user.
 2. Carefully inspect validation result and fix all the errors.
 3. Make sure to save the new configuration before deploying it.
-4. You do not need user consent to validate or save new draft configuration.
-5. Deploy project only when user explicitly asks for it.
+4. **You do not need user consent to validate or save new draft configuration**.
+5. **Deploy project only when user explicitly asks for it**.
 6. Use the todo_read and todo_write tools to organize and track your dodo-app configuration changes.
 
 Always pretty print dodo-app config before presenting it to the user.
 </dodo>
 
-<dodo-schema>
+<dodo-app-schema>
 {
     "$schema": "http://json-schema.org/draft-07/schema#",
     "title": "dodo-app configuration",
@@ -116,6 +116,12 @@
                 "$ref": "#/definitions/Service"
             }
         },
+        "agent": {
+            "type": "array",
+            "items": {
+                "$ref": "#/definitions/Agent"
+            }
+        },
         "volume": {
             "type": "array",
             "items": {
@@ -212,6 +218,10 @@
                     "properties": {
                         "port": {
                             "$ref": "#/definitions/PortValue"
+                        },
+                        "nodeId": {
+                            "type": "string",
+                            "description": "Identifier of the node this resource is assigned to. Generated by server."
                         }
                     },
                     "required": ["port"]
@@ -300,6 +310,10 @@
                 },
                 "auth": {
                     "$ref": "#/definitions/Auth"
+                },
+                "nodeId": {
+                    "type": "string",
+                    "description": "Identifier of the node this resource is assigned to. Generated by server."
                 }
             },
             "required": ["network", "subdomain", "port", "auth"]
@@ -431,10 +445,150 @@
                         }
                     },
                     "required": ["enabled"]
+                },
+                "nodeId": {
+                    "type": "string",
+                    "description": "Identifier of the node this resource is assigned to. Generated by server."
                 }
             },
             "required": ["type", "name", "source"]
         },
+        "Agent": {
+            "type": "object",
+            "description": "AI Agent definition, which user can communicate with to implement new service or add new features to already existing one.",
+            "properties": {
+                "name": {
+                    "type": "string",
+                    "description": "Name of the AI Agent."
+                },
+                "geminiApiKey": {
+                    "type": "string",
+                    "description": "Gemini API Key"
+                },
+                "source": {
+                    "type": "object",
+                    "description": "If provided, defines where to pull the source code from.",
+                    "properties": {
+                        "repository": {
+                            "type": "string",
+                            "format": "uri",
+                            "description": "SSH URL of the Git repository."
+                        },
+                        "branch": {
+                            "type": "string",
+                            "description": "Branch to deploy from."
+                        },
+                        "rootDir": {
+                            "type": "string",
+                            "description": "Root directory within the repository for this service."
+                        }
+                    },
+                    "required": ["repository", "branch", "rootDir"]
+                },
+                "ports": {
+                    "type": "array",
+                    "description": "List of ports this service exposes when started.",
+                    "items": {
+                        "type": "object",
+                        "properties": {
+                            "name": {
+                                "type": "string",
+                                "description": "Name of the port (e.g., 'http', 'grpc'). Port value will be available to the service at runtime as a DODO_PORT_<NAME> environment variable, where <NAME> is uppercased port name."
+                            },
+                            "value": {
+                                "type": "number",
+                                "description": "Port number."
+                            },
+                            "protocol": {
+                                "type": "string",
+                                "enum": ["TCP", "UDP"]
+                            }
+                        },
+                        "required": ["name", "value", "protocol"]
+                    }
+                },
+                "env": {
+                    "type": "array",
+                    "description": "List of environment variables.",
+                    "items": {
+                        "type": "object",
+                        "properties": {
+                            "name": {
+                                "type": "string",
+                                "description": "Name of the environment variable as used by the service."
+                            },
+                            "alias": {
+                                "type": "string",
+                                "description": "Original name of the environment variable if aliased."
+                            }
+                        },
+                        "required": ["name"]
+                    }
+                },
+                "ingress": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/Ingress"
+                    },
+                    "description": "HTTPS ingress definitions for this service."
+                },
+                "expose": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/PortDomain"
+                    },
+                    "description": "TCP/UDP exposure definitions for this service."
+                },
+                "volume": {
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    },
+                    "description": "Names of volumes to be mounted to this service."
+                },
+                "preBuildCommands": {
+                    "type": "array",
+                    "items": {
+                        "type": "object",
+                        "properties": {
+                            "bin": {
+                                "type": "string",
+                                "description": "A command to run before building/starting the service."
+                            }
+                        },
+                        "required": ["bin"]
+                    }
+                },
+                "dev": {
+                    "type": "object",
+                    "description": "Describes to run this service in development mode or not.",
+                    "properties": {
+                        "enabled": {
+                            "type": "boolean",
+                            "description": "Whether development mode is enabled for this service."
+                        },
+                        "username": {
+                            "type": "string",
+                            "description": "Username for SSH/Code-server access in dev mode."
+                        },
+                        "ssh": {
+                            "$ref": "#/definitions/Domain",
+                            "description": "Network exposure for SSH in dev mode."
+                        },
+                        "codeServer": {
+                            "$ref": "#/definitions/Domain",
+                            "description": "Network exposure for Code-server in dev mode."
+                        }
+                    },
+                    "required": ["enabled"]
+                },
+                "nodeId": {
+                    "type": "string",
+                    "description": "Identifier of the node this resource is assigned to. Generated by server."
+                }
+            },
+            "required": ["name"]
+        },
         "Volume": {
             "type": "object",
             "description": "Volume definition which can be mounted to services and other infrastructure components. When mounted to the service, it's mount location is exposed as DODO_VOLUME_<NAME> env variable where <NAME> represents name of the volume (name is upper cased).",
@@ -450,6 +604,10 @@
                     "type": "string",
                     "pattern": "^[0-9]+(Gi|Mi|Ti)$",
                     "description": "Size of the volume (e.g., '1Gi', '500Mi')."
+                },
+                "nodeId": {
+                    "type": "string",
+                    "description": "Identifier of the node this resource is assigned to. Generated by server."
                 }
             },
             "required": ["name", "accessMode", "size"]
@@ -473,6 +631,10 @@
                         "$ref": "#/definitions/PortDomain"
                     },
                     "description": "Network exposure definitions for this PostgreSQL instance."
+                },
+                "nodeId": {
+                    "type": "string",
+                    "description": "Identifier of the node this resource is assigned to. Generated by server."
                 }
             },
             "required": ["name", "size"]
@@ -496,13 +658,17 @@
                         "$ref": "#/definitions/PortDomain"
                     },
                     "description": "Network exposure definitions for this MongoDB instance."
+                },
+                "nodeId": {
+                    "type": "string",
+                    "description": "Identifier of the node this resource is assigned to. Generated by server."
                 }
             },
             "required": ["name", "size"]
         }
     }
 }
-</dodo-schema>
+</dodo-app-schema>
 
 <guidance>
 {{ $contents := .InjectFileContents }}