Save an agent manifest
Saves the manifest as its next version, or answers the latest unchanged when nothing differs. Every Agent that tracks the manifest moves to the new version: at once, at its pod's next start for a runtime change a pod applies only when it starts, or once a required secret the version adds is set; a pinned one stays, and so does one whose kind, harness or storage the version changes (agents_behind). The Runtime checks the harness and runtime sections against each other: a custom harness needs a pod with an image, every credential the harness names is a declared slot of the right type, and the runtime's kind gives the loop the sandbox it needs; every gap is named in one 422 manifest_inconsistent (details.gaps). If-Match: <version> refuses the save with 412 manifest_changed when the latest version is no longer the one you read (0 for a manifest that does not exist yet). With ?dryRun=true the answer is the plan: the changes by section, every reason a save would be refused (errors, the gaps first), warnings, the Agents it would move (moves) and how many stay on older versions (behind); nothing is saved. Clients compose the authoring files and drop their $schema before they send one document. With Content-Type: application/vnd.nylorun.folder+json the body is an agent folder by hash instead (feature agent-folders): every file uploaded first with PUT /v1/files/sha256:<hex>, the Runtime compiles it with @nylorun/core/folder, a folder that does not compile is 422 folder_invalid (details.diagnostics, each with its file, line and column), and the version keeps the folder as its source; the plan adds the compiled manifest, the compiler's diagnostics and compiler.
applicationKeyAuthorizationBearer <token>An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).
name*stringThe agent manifest's name, such as triage
dryRun?stringtrue: answer the plan and save nothing
"true""false"Nylorun-Protocol*stringThe protocol version, 18
Nylorun-Subject?stringThe person an application key acts for
Nylorun-Scopes?stringThe subject's space-separated scopes; required with a subject
- body
manifestSchemaVersion*88name*stringAn agent manifest's name, such as triage
description?stringmetadata?harness*|runtime?requestId?string1 <= lengthThe version saved, or the plan with dryRun
application/json- response
manifest*unchanged*booleanwarnings*array<>diagnostics?array<>import { createClient } from "@nylorun/agents";const client = await createClient();const { manifest } = await client.agentManifests.save( { agent: assistant, // its harness section; or an agent manifest v8 document runtime: { kind: "virtual", network: { allowedHosts: ["api.linear.app"] }, secrets: { linear: { type: "bearer", url: "https://mcp.linear.app/mcp" }, }, }, }, { ifMatch: 3 }, // the version you read; a newer one is 412 manifest_changed);// plan(...) sends ?dryRun=true and saves nothing; a manifest's files are saveFolder(await packFolder(dir)){ "manifest": { "name": "string", "version": 1, "hash": "string", "manifest": { "manifestSchemaVersion": 8, "name": "string", "description": "string", "metadata": { "property1": null, "property2": null }, "harness": { "kind": "workflow", "id": "string", "inputSchema": { "property1": null, "property2": null }, "outputSchema": { "property1": null, "property2": null }, "root": { "agent": "string", "id": "string" }, "agents": { "property1": { "kind": "workflow", "workflowSchemaVersion": 3, "id": "string", "name": "string", "description": "string", "metadata": { "property1": null, "property2": null }, "inputSchema": { "property1": null, "property2": null }, "outputSchema": { "property1": null, "property2": null }, "sandbox": { "image": "string", "network": { "preset": "none", "allow": [ "string" ] }, "resources": { "cpus": 1, "memory": "string" }, "idle": "string" }, "root": { "agent": "string", "id": "string" }, "agents": { "property1": {}, "property2": {} } }, "property2": { "kind": "workflow", "workflowSchemaVersion": 3, "id": "string", "name": "string", "description": "string", "metadata": { "property1": null, "property2": null }, "inputSchema": { "property1": null, "property2": null }, "outputSchema": { "property1": null, "property2": null }, "sandbox": { "image": "string", "network": { "preset": "none", "allow": [ "string" ] }, "resources": { "cpus": 1, "memory": "string" }, "idle": "string" }, "root": { "agent": "string", "id": "string" }, "agents": { "property1": {}, "property2": {} } } }, "plugins": [ { "name": "string", "version": "string" } ], "loop": { "property1": null, "property2": null } }, "runtime": { "kind": "virtual", "image": "string", "resources": { "cpus": 1, "memory": "string" }, "storage": "string", "network": { "allowedHosts": [ "string" ] }, "lifecycle": { "idle": "string", "deleteAfter": "string" }, "setup": [ { "command": "string", "cwd": "string", "timeout": "string" } ], "files": [ { "artifactId": "string", "version": 1, "path": "string" } ], "limits": { "artifacts": { "fileBytes": 1, "totalBytes": 1 }, "skills": { "totalBytes": 1 }, "disk": { "versionBytes": 1, "versionEntries": 1 } }, "secrets": { "property1": { "type": "environment_secret", "allowedHosts": [ "string" ], "inject": { "header": "string", "format": "string" }, "required": true, "description": "string" }, "property2": { "type": "environment_secret", "allowedHosts": [ "string" ], "inject": { "header": "string", "format": "string" }, "required": true, "description": "string" } }, "triggers": { "property1": { "schedule": "string", "timezone": "string", "at": "2019-08-24T14:15:22Z", "webhook": "standard-webhooks", "session": "string", "prompt": "string" }, "property2": { "schedule": "string", "timezone": "string", "at": "2019-08-24T14:15:22Z", "webhook": "standard-webhooks", "session": "string", "prompt": "string" } }, "selfWake": true } }, "savedBy": { "actor": "string" }, "createdAt": "string", "agents": 0, "source": { "compiler": "string", "files": 0, "bytes": 0 } }, "unchanged": true, "warnings": [ { "code": "string", "message": "string" } ], "diagnostics": [ { "severity": "error", "code": "string", "message": "string", "file": "string", "line": 1, "column": 1, "pointer": "string", "fix": { "kind": "rename_key", "file": "string", "line": 1, "column": 1, "from": "string", "to": "string" } } ]}Fork an Agent POST
Copies the Agent into a new one, which is how an Agent changes what is fixed for its life: a new Agent `id`, made from `manifest` (default the source's manifest name, tracking, at its latest version), its disk started from a version of this one's (`disk`: `latest`, the default, takes a snapshot first; a version number; or `empty`) and its secrets copied inside the Runtime (`secrets`: `copy`, the default, copies those the new manifest declares; `none`). On a fork onto other setup the new manifest's setup runs on the copied disk before its first turn. This Agent keeps what it runs, its disk and its sessions. `dryRun` answers the plan and makes nothing. To move an Agent to another version of the same manifest, with the same kind, harness and storage, `PUT` it instead.
Get an agent manifest GET
Its latest version.