@nylorun/core 0.24.0-beta → 0.26.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/dist/compatibility.d.ts +51 -37
- package/dist/compatibility.js +51 -36
- package/dist/contracts.d.ts +262 -93
- package/dist/contracts.js +262 -141
- package/dist/definition/approval.d.ts +1 -1
- package/dist/definition/bound.d.ts +2 -0
- package/dist/definition/builder.d.ts +2 -2
- package/dist/definition/builder.js +1 -1
- package/dist/definition/code-tools.d.ts +1 -1
- package/dist/definition/declaration.js +3 -0
- package/dist/definition/delegate.d.ts +1 -1
- package/dist/definition/delegate.js +1 -1
- package/dist/definition/from.d.ts +2 -2
- package/dist/definition/from.js +1 -1
- package/dist/definition/http-tool.d.ts +3 -3
- package/dist/definition/mcp.d.ts +4 -4
- package/dist/definition/mcp.js +3 -3
- package/dist/definition/sections.d.ts +5 -4
- package/dist/definition/sections.js +30 -7
- package/dist/definition/variant.d.ts +1 -1
- package/dist/definition/variant.js +4 -4
- package/dist/harness-api/entries.d.ts +1 -1
- package/dist/harness-api/entries.js +1 -1
- package/dist/harness-api/gates.d.ts +1 -1
- package/dist/harness-api/gates.js +1 -1
- package/dist/harness-api/json-schema.d.ts +1 -1
- package/dist/harness-api/json-schema.js +1 -1
- package/dist/harness-api/mcp.js +1 -1
- package/dist/harness-api/messages.d.ts +6 -6
- package/dist/harness-api/schema.d.ts +7 -7
- package/dist/harness-api/schema.js +16 -16
- package/dist/harness-api/transcript.d.ts +1 -1
- package/dist/harness-api/transport.d.ts +1 -1
- package/dist/harness-api/transport.js +1 -1
- package/dist/manifest-schemas.js +2 -1
- package/dist/schemas/agent-manifest.schema.json +3 -3
- package/dist/schemas/harness-manifest.schema.json +1 -1
- package/dist/schemas/runtime-manifest.schema.json +2 -2
- package/dist/types/manifest.d.ts +21 -17
- package/dist/types/model.d.ts +1 -1
- package/dist/types/observe.d.ts +1 -1
- package/dist/types/part.d.ts +5 -0
- package/dist/types/tool.d.ts +4 -4
- package/dist/utils/definition-files.d.ts +3 -2
- package/dist/utils/definition-files.js +4 -3
- package/dist/utils/file-systems.d.ts +1 -1
- package/dist/utils/file-systems.js +1 -1
- package/dist/utils/harness-id.d.ts +1 -1
- package/dist/utils/harness-id.js +1 -1
- package/dist/utils/memory.d.ts +2 -2
- package/dist/utils/memory.js +2 -2
- package/dist/utils/runtime-limits.d.ts +5 -5
- package/dist/utils/runtime-limits.js +5 -5
- package/dist/utils/runtime-tools.d.ts +3 -3
- package/dist/utils/runtime-tools.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.26.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fce0c9b: Headers for a custom model endpoint (#493). A custom endpoint's `settings` (`PUT /v1/tenant/model`) take `headers`, sent on every call, and `callHeaders`, whose values the Runtime resolves per call from the calling Agent: one of its labels (`{ from: "agent.label", key: "org" }`), its id (`agent.id`) or the session's owner when it is a person (`session.owner`). A source with no value sends no header. A Runtime that serves several orgs' Agents can then send each call's org (`x-nylorun-org` from the `org` label), so a model gateway attributes and budgets it while the call is made, in process and through the gates service alike. They are settings, read back by `GET /v1/tenant/model`: neither map may set `authorization`, a hop-by-hop or transport header, or `Nylorun-*`, and a name appears once across both. Studio keeps them when it saves the model.
|
|
8
|
+
- ab7c08a: A gateway's tool prefix (#494, Host feature `gateway-credentials`). A `bearer` or `headers` credential with `via`, written to an Agent's vault, may add `toolPrefix`: what the gateway at `via` puts before each tool name it lists, such as LiteLLM's `github-`. The Runtime lists the server's tools without it, so tool names (`github__create_issue`), a manifest's `tools` settings and tool policy rules name the server's own tools whether or not a gateway is in between, and calls each tool by the name the gateway listed. A listed tool that lacks the prefix keeps its name, and the server's `mcp.discovered` message names it. `toolPrefix` needs `via`, and secret views carry it. It is the installation's routing, never a manifest's: a manifest's secret slot cannot name it, and a slot's value write (`{ headers, toolPrefix }`) adds it. A fork keeps it while the new slot keeps `via`. No protocol change.
|
|
9
|
+
- 4a563e7: The workload token (#496). A Runtime given `NYLORUN_WORKLOAD_TOKEN_FILE`, a token a platform rotates through a file, reads it at each use and keeps nothing, so a rotation applies to the next request with no restart; a missing, unreadable or empty file fails the request, naming the variable, and nothing is sent without it. A custom model with `auth: { type: "workload" }` sends it as the endpoint's bearer. A new credential type, `workload` (`{ url, via, identity?, toolPrefix? }`, no value), sends `Authorization: Bearer <token>` to its `via` only, and only when `via`'s origin is in `NYLORUN_WORKLOAD_TOKEN_ORIGINS`, since an Agent's writer chooses `via`. A gateway's `401` is `credential_rejected` with `gateway`, its origin. The token stays in the process that makes the call: never in a sandbox, the model, an event or a log. Studio shows the credential and the model's auth.
|
|
10
|
+
|
|
11
|
+
## 0.25.0-beta
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- eeb6294: Session usage as one ledger (protocol 18). The usage ledger keeps each model call's cost by token kind (uncached input, cache read, cache write, output) at the prices the adapter applied (migration 0037). For a protocol 18 client, `GET /v1/sessions/{id}/calls/model` returns each call's `startedAt`, `endedAt` and `usage.costSplit` (null for a call recorded before), and `GET /v1/sessions/{id}/usage` adds `costSplit` with `splitCalls`, and the calls' durations added up as `modelTimeMs` with `timedCalls`. A protocol 16 or 17 client reads usage as before. Studio's Usage tab is rebuilt on them: a Session card with one tokens bar and a ledger of tokens and cost by kind adding up to a total row, then the model calls grouped by turn with the same columns (cached, uncached, output, total, time, cost), and a row menu whose View event opens the call's event in the Events tab.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- ed08ba8: `agentManifests.save({ agent, runtime, memory })` turns on a built agent's memory (`harness.memory`, `{ access?, instructions? }`), and a skill folder's `SKILL.md` may list the secret slots its scripts read in its frontmatter (`secrets: [GH_TOKEN]`): `.skills()`, `.plugin()` and `composeManifest` make them the skill's `secrets` in the harness section, which the Runtime checks against `runtime.secrets` at save. A `secrets` that is not a list of environment variable names skips the skill with a warning.
|
|
20
|
+
- ed08ba8: A flow's HTTP stage or HTTP verifier, and an HTTP tool of an agent the harness section embeds (a flow's `agents`, or an agent used as a tool), now has its `credential` checked when the manifest is saved, as an agent's own HTTP tool has: it must name a `bearer` or `headers` slot of `runtime.secrets` bound to its URL, or the save is `422 manifest_inconsistent` naming it (`harness.root stage "refund" http.credential "checks" is not a secret slot in runtime.secrets`). Before, such a manifest saved and each call failed at run time with `http.credential`.
|
|
21
|
+
- ed08ba8: Public text names no internal roadmap codes: the OpenAPI documents' descriptions, the type comments of `@nylorun/core`, `@nylorun/agents` and `@nylorun/admin`, and the CLI's help, README and generated compose file. A Runtime test fails when either OpenAPI document names one.
|
|
22
|
+
- ed08ba8: The tool policy's documentation matches how rules match: `tool` is the tool's identity (an MCP tool's own name on its `server`, or an HTTP tool's declared name), never the model-facing `server__tool`, which is refused; `agent` is the agent manifest's name, or the id of an agent used as a tool or of a flow's agent. `PUT /v1/tenant/tool-policy` describes each selector, and `GET` documents its `409` for a stored rule it cannot apply.
|
|
23
|
+
|
|
3
24
|
## 0.24.0-beta
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -17,7 +38,7 @@
|
|
|
17
38
|
- 1ded443: Track T3, Agents that evolve: an Agent moves between versions of its manifest in place, with its id, disk, vault and sessions. `PUT /v1/agents/{id}` with another version moves it (`?dryRun=true` answers the plan, `AgentMovePlan`), and saving a manifest moves every Agent that tracks it. A harness-only change applies at once; a runtime change a pod applies only when it starts (image, resources, network, setup, files) leaves the Agent outdated (`targetVersion`, `waitingFor: "start"`) until its pod's next start, on the same volume; a version that adds a required secret waits for its value (`waitingFor: "secrets"`, state `input_required`). Its manifest's name, kind, harness and storage are fixed: `409 agent_fixed_field` replaces `409 agent_upgrade_unavailable`. Only secrets that fill a slot of the running version are used; others stay in the vault, dormant. New events `agent.outdated` and `agent.version_changed`, `GET /v1/agents?outdated=true`, and the save plan's `moves` and `agents_move` warning. Migration 0033 adds the Agent's target and failed versions and its start check.
|
|
18
39
|
- 76dcd11: Track T3, the next start and its check: a pod Agent's start on a new version is checked until the new pod's harness joins (`startCheck` on the Agent). A failed setup, a failed pod, or a start slower than the Host's `tenant.upgradeStartMs` (10 minutes) takes the Agent back to the version it ran, its definition and not its disk, records `agent.start_failed`, and names the version `failedVersion` (state `failing`), which a tracking Agent does not move to again. A new version's setup runs on the same volume when its commands or files changed (`setupHash` in the setup plan and the volume's marker). While a pod waits to start on a new version it idles at most `tenant.upgradeIdleMs` (1 minute). `POST /v1/agents/{id}/restart` applies a pending version now; `retry: true` tries the failed version again.
|
|
19
40
|
- bf942ed: Our engine offers the `memory` tool (track T5, D72). An agent whose version sets `harness.memory` gets one `memory` tool with Anthropic's memory tool schema (`view`, `create`, `str_replace`, `insert`, `delete`, `rename`; `view` only for a `read_only` agent and an agent used as a tool), our memory rules followed by the agent's `instructions`, and its memory index pinned after the instructions as user-role context: kept for the session so the prompt prefix stays cacheable (`ExecutionState.pinned`), and re-pinned after a compaction. Each command's parameters are checked before a call is sent (`checkMemoryCall` in `@nylorun/core/contracts`, which the Runtime also uses), and a call named `memory.<command>` or `memory/<command>` runs as `memory` with that command (`memoryAliasOf`). `ModelRequest.pinned` carries the pinned text; `memoryTool` and `memoryIndexBlock` are exported for your own harness.
|
|
20
|
-
- 4fa160d: Agent memory, storage and API (track T5, D72). An agent manifest's `harness.memory` (`access`: `read_write` or `read_only`; `instructions`, at most 4,096 characters) turns on the Agent's memory: Markdown files under `/memories` it keeps across sessions, wakes and upgrades. The Runtime keeps them in Postgres (`memories`, `memory_versions`, migration 0036) with a version per change and who made it. `GET /v1/agents/{id}/memories` lists them (`pathPrefix`), `GET`, `PUT` (whole content, with an optional `contentSha256` precondition: `409 memory_conflict`) and `DELETE /v1/agents/{id}/memories/{path}` read, write and delete one (or a folder), and `GET /v1/agents/{id}/memory_versions` and `.../memory_versions/{versionId}` page the versions. A fork copies the memories (the fork plan adds `memories`); a delete removes them. `@nylorun/core` adds `memoryPathOf`, `memoryDescriptionOf` and the memory contracts; new Runtime limits `memoryBytes` (100
|
|
41
|
+
- 4fa160d: Agent memory, storage and API (track T5, D72). An agent manifest's `harness.memory` (`access`: `read_write` or `read_only`; `instructions`, at most 4,096 characters) turns on the Agent's memory: Markdown files under `/memories` it keeps across sessions, wakes and upgrades. The Runtime keeps them in Postgres (`memories`, `memory_versions`, migration 0036) with a version per change and who made it. `GET /v1/agents/{id}/memories` lists them (`pathPrefix`), `GET`, `PUT` (whole content, with an optional `contentSha256` precondition: `409 memory_conflict`) and `DELETE /v1/agents/{id}/memories/{path}` read, write and delete one (or a folder), and `GET /v1/agents/{id}/memory_versions` and `.../memory_versions/{versionId}` page the versions. A fork copies the memories (the fork plan adds `memories`); a delete removes them. `@nylorun/core` adds `memoryPathOf`, `memoryDescriptionOf` and the memory contracts; new Runtime limits `memoryBytes` (100 KiB) and `memoriesPerAgent` (10,000); new error code `memory_conflict`. The SDK adds `client.agents.memories`; the CLI adds `nylorun agents memories ls|cat|put|rm|versions`. The model's `memory` tool arrives in the next steps of T5.
|
|
21
42
|
- 9fed948: The `memory` tool's calls (track T5, D72). A new effect target, `{kind: "runtime", operation: "memory"}` (additive on Harness API 5), carries Anthropic's memory tool input (`command`: `view`, `create`, `str_replace`, `insert`, `delete`, `rename`, and its parameters); core serves it in the intent's own transaction, so a replayed turn applies a write once. A malformed call fails with text for the model and changes nothing; a write from a `read_only` agent or a sub-agent is `memory.forbidden`. Each write is a memory version naming the turn's manifest version, session, turn and the trigger run that started the turn, with a new session event `memory.updated` and Agent event `agent.memory_updated`. `turn.start.memory` (`TurnMemorySchema`) carries the Agent's memory access, instructions and the index a harness pins, newest first, within the new Runtime limits `memoryIndexLines` (200) and `memoryIndexBytes` (25 KiB).
|
|
22
43
|
- ffeb3bb: `schedule_wake` (track T4, D77). An agent manifest's `runtime.selfWake: true` offers the agent `schedule_wake`: `{in | at, note}` books its session's next turn, replacing the booking before, and `{cancel: true}` removes it. The Runtime serves the call in its own transaction (a new effect target, `{kind: "runtime", operation: "schedule_wake"}`, additive on Harness API 5; `turn.start.agent.selfWake` tells a harness to offer it), so a replayed turn books once. The booking fires as a trigger run of kind `wake`, its note the turn's message with `cause.kind: "self"`. New session events `wake.booked` and `wake.cancelled`, tool call kind `runtime`, and Runtime limits `wakeMaxAheadMs` and `wakeNoteChars`.
|
|
23
44
|
- 9e60e40: Protocol 17, a queue per session (track T4, D76). A message sent while the session's turn runs or waits is queued (`{status: "queued", queuedMessageId, position}`, `message.queued`) and starts the next turn when this one ends, with every queued message, each its own user message (`queue.taken`); a cancel ends the turn, not the queue. `delivery: "reject"` keeps the refusal, now `409 session_busy`, and a protocol 16 client's messages default to it, so the Host serves protocol 16 and 17. The queue holds at most the Runtime limit `sessionQueuedMessages` (`429 queue_full`), and session reads count `queuedMessages`. Our engine takes `{kind: "messages", messages}` as a turn's input. The SDK's `input` and `inputParts` take `delivery`, and the CLI's `sessions send` takes `--reject-if-busy`. See MIGRATION.md.
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export { hashManifest } from "./utils/hash.js";
|
|
2
2
|
/**
|
|
3
|
-
* Protocol
|
|
3
|
+
* Protocol 18: session usage by token kind. A model call read (`/v1/sessions/{id}/calls/model`,
|
|
4
|
+
* `/v1/tenant/calls/model`) carries the gate's timing (`startedAt`, `endedAt`) and its cost by
|
|
5
|
+
* token kind (`usage.costSplit`), and a session's usage (`/v1/sessions/{id}/usage`) adds
|
|
6
|
+
* `costSplit`, `splitCalls`, `modelTimeMs` and `timedCalls`. The Host serves protocol 16, 17 and 18:
|
|
7
|
+
* an older client, whose SDK parses these reads strictly, gets them without the new fields.
|
|
8
|
+
* Protocol 17: a queue per session. A message sent while the session's turn runs,
|
|
4
9
|
* or while it waits on an approval, an answer or an uncertain call, is queued
|
|
5
10
|
* (`{status: "queued", queuedMessageId, position}`, `message.queued`) instead of refused, unless
|
|
6
11
|
* it asks `delivery: "reject"`; the refusal now has a code, `409 session_busy`. When the turn ends
|
|
@@ -10,7 +15,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
10
15
|
* `sessionQueuedMessages` a message is `429 queue_full`. Session reads count `queuedMessages`. The
|
|
11
16
|
* Host serves protocol 16 and 17: a message from a protocol 16 client is `reject` unless it says
|
|
12
17
|
* otherwise, so its sessions answer `409` as before.
|
|
13
|
-
* Protocol 16: Agents from one manifest
|
|
18
|
+
* Protocol 16: Agents from one manifest, a fresh start. An agent manifest (v8) is one
|
|
14
19
|
* versioned document at `/v1/agent-manifests/{name}` with a `harness` section (what runs inside
|
|
15
20
|
* the loop, including the harness's id) and a `runtime` section (what an environment manifest
|
|
16
21
|
* said); the Runtime checks the two against each other when it is saved
|
|
@@ -19,14 +24,14 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
19
24
|
* Environments are Agents: `/v1/agents/{id}` (with `.../events`, `stop`, `reset`, `snapshot`,
|
|
20
25
|
* `restore`, `versions`, `fork` and `secrets`) is made from a saved manifest only, records it as
|
|
21
26
|
* tracking (`name`) or pinned (`name@n`) into `resolvedVersion`, the version it runs. An Agent
|
|
22
|
-
* evolves
|
|
27
|
+
* evolves: a `PUT` naming another version of its manifest moves it (`dryRun`
|
|
23
28
|
* answers the plan), a save moves every Agent that tracks the manifest, and each turn takes the
|
|
24
29
|
* version its Agent runs when it starts; a runtime change waits for a pod's next start, and its
|
|
25
30
|
* kind, harness and storage are fixed (`409 agent_fixed_field`). Reads add `state`
|
|
26
31
|
* (`working`, `sleeping`, `input_required`, `failing`, `paused`) and `attention`, and the
|
|
27
32
|
* compute's state moves to `compute.state`. Every session belongs to one Agent:
|
|
28
33
|
* `PUT /v1/sessions/{id}` takes `{ agent, ownerUserId, info }` and pins the manifest version its
|
|
29
|
-
* Agent runs; no session is special
|
|
34
|
+
* Agent runs; no session is special. Error codes, event types (`agent.*`), the scopes
|
|
30
35
|
* (`agents:write`, `agent-manifests:write`) and identity-file grants (`agents`) say Agent. Model
|
|
31
36
|
* budget scope `agent` is `manifest`. Harness API 5: `turn.start.agent` replaces
|
|
32
37
|
* `turn.start.environment`. Sessions opened before protocol 16 are closed (`protocol_16`) and
|
|
@@ -47,7 +52,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
47
52
|
* key on (a policy rule with `__` in its `tool` refuses every call). The record refuses an
|
|
48
53
|
* outcome past `limits.recordEntryBytes`. Sessions pinned before protocol 15 must be recreated.
|
|
49
54
|
* The Host serves protocol 15 only.
|
|
50
|
-
* Protocol 14: environment manifests
|
|
55
|
+
* Protocol 14: environment manifests. `/v1/environment-manifests/{name}` holds
|
|
51
56
|
* named, versioned definitions of a kind of Environment, saved like agents (with `If-Match` and
|
|
52
57
|
* `?dryRun=true`), and `PUT /v1/environments/{id}` takes `manifest: "name"` or `"name@n"`. An
|
|
53
58
|
* Environment never changes what it runs after creation: a `PUT` on an existing one may change
|
|
@@ -55,10 +60,10 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
55
60
|
* `manifest`. A manifest's `secrets` declares slots: a write sends only the value, and a name it
|
|
56
61
|
* does not declare is `409 secret_not_in_manifest`. An agent manifest's `requires` is checked
|
|
57
62
|
* when a session opens (`409 environment_unsuitable`). Sessions on one Environment run their
|
|
58
|
-
* turns in parallel
|
|
63
|
+
* turns in parallel, so a turn start is no longer `environment_busy` because another
|
|
59
64
|
* session's turn runs, and every egress connection is an `environment.egress` event on the
|
|
60
65
|
* Environment's stream naming the turns that were running; `egress.connection` is gone from
|
|
61
|
-
* session logs and traces
|
|
66
|
+
* session logs and traces. The Host serves protocol 14 only.
|
|
62
67
|
* Protocol 13: the flat agent manifest (v7), a fresh start. A manifest has no capabilities: its
|
|
63
68
|
* instructions, tools, skills and MCP servers are top-level, and a skill or server from an Agent
|
|
64
69
|
* Plugin carries a `plugin` label. A session's pinned manifest carries the Runtime's `runtime`
|
|
@@ -72,7 +77,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
72
77
|
* accept (`422 attachment_unsupported`), with no turn. After its turn a file is a reference line
|
|
73
78
|
* the model reads again with `read_artifact`, which every agent now has. The Host accepts
|
|
74
79
|
* protocol 11 and 12: the change is additive.
|
|
75
|
-
* Protocol 11: Environments
|
|
80
|
+
* Protocol 11: Environments, a fresh start. `/v1/environments/{id}` replaces
|
|
76
81
|
* `/v1/sandboxes`: an Environment is one sandbox (kind `virtual`, `pod` or `none`) with a recipe
|
|
77
82
|
* that can change and one vault, written on the Runtime API
|
|
78
83
|
* (`PUT /v1/environments/{id}/secrets/{name}`). Sessions name an `environment` or nothing; the
|
|
@@ -80,7 +85,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
80
85
|
* user and installation vaults and `/v1/tenant/vaults` are gone. Error codes, event types, the
|
|
81
86
|
* scope (`environments:write`) and identity-file grants (`environments`) say Environment. An
|
|
82
87
|
* older client is answered `426`.
|
|
83
|
-
* Protocol 10: MCP credential custody leaves OSS
|
|
88
|
+
* Protocol 10: MCP credential custody leaves OSS. The vault credential type `oauth`, the
|
|
84
89
|
* MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
|
|
85
90
|
* credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
|
|
86
91
|
* through its attached vaults only.
|
|
@@ -89,12 +94,12 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
89
94
|
* `WWW-Authenticate: Bearer` challenge instead of the opaque 404, a token missing a scope gets
|
|
90
95
|
* `error="insufficient_scope"`, and `GET /.well-known/oauth-protected-resource` names the trusted
|
|
91
96
|
* issuers. Identity files lose `maxLifetime`: the issuer sets its tokens' lifetimes.
|
|
92
|
-
* Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents
|
|
93
|
-
*
|
|
97
|
+
* Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents:
|
|
98
|
+
* manifest v5 and workflow manifest v3, no hooks or flow functions, remote MCP
|
|
94
99
|
* only, and no Action endpoints (`/v1/endpoints` and `/v1/actions/*` answer 404, delivery
|
|
95
100
|
* tokens are gone): an agent's tools are HTTP tools, remote MCP servers, agents and the
|
|
96
101
|
* Runtime's built-ins.
|
|
97
|
-
* Protocol 7: open-source auth
|
|
102
|
+
* Protocol 7: open-source auth. Subject tokens (`POST /v1/tokens`), the access policy,
|
|
98
103
|
* revocations, browser keys (`Nylorun-Key`), the Runtime's own CORS and derived principals are gone; their
|
|
99
104
|
* routes answer 404. Browsers and apps present a trusted issuer's token, servers an operator key.
|
|
100
105
|
* Protocol 6: file artifacts (`/v1/artifacts/**`, Runtime-signed capability links) and user
|
|
@@ -102,7 +107,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
102
107
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
103
108
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
104
109
|
*/
|
|
105
|
-
export declare const PROTOCOL_VERSION =
|
|
110
|
+
export declare const PROTOCOL_VERSION = 18;
|
|
106
111
|
/** What a client of this protocol requires of a Host. */
|
|
107
112
|
export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts",
|
|
108
113
|
/**
|
|
@@ -142,10 +147,15 @@ export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts
|
|
|
142
147
|
*/
|
|
143
148
|
"agents",
|
|
144
149
|
/**
|
|
145
|
-
* Protocol 17: a queue per session
|
|
150
|
+
* Protocol 17: a queue per session. A message to a busy session is queued unless it asks
|
|
146
151
|
* `delivery: "reject"`, and the busy refusal is `409 session_busy`.
|
|
147
152
|
*/
|
|
148
|
-
"session-queue"
|
|
153
|
+
"session-queue",
|
|
154
|
+
/**
|
|
155
|
+
* Protocol 18: model call reads carry their timing and their cost by token kind, and a
|
|
156
|
+
* session's usage the cost by kind and the model time.
|
|
157
|
+
*/
|
|
158
|
+
"usage-by-kind"];
|
|
149
159
|
export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
150
160
|
/**
|
|
151
161
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -174,20 +184,23 @@ export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
|
174
184
|
* `credential-coverage`: `POST /v1/tenant/credential-coverage` (the Management API) says which
|
|
175
185
|
* credential of an Environment's vault each of a saved agent's MCP servers and HTTP tools would
|
|
176
186
|
* get in a session that names that Environment.
|
|
177
|
-
* `tool-calls
|
|
187
|
+
* `tool-calls`: `GET /v1/sessions/{id}/calls/tool` pages a session's tool calls from the
|
|
178
188
|
* effect journal, every `tool.completed` says how its call ended (`status`, `kind`, `server`,
|
|
179
189
|
* `attempts`, `durationMs`), and tool calls are delivered at least once with their effect id as
|
|
180
190
|
* the key (`Idempotency-Key` for HTTP tools, `_meta["nylorun/idempotency-key"]` for MCP tools).
|
|
181
|
-
* `tool-policy
|
|
191
|
+
* `tool-policy`: `GET`/`PUT /v1/tenant/tool-policy` (the Management API) sets which
|
|
182
192
|
* MCP and HTTP tool calls run, wait for a person (`ask`: the turn pauses until `approve`) or are
|
|
183
193
|
* refused (`deny`: `tool.denied`), for every harness; a manifest that sets `approval` is refused.
|
|
184
|
-
* `traces
|
|
194
|
+
* `traces`: `GET /v1/sessions/{id}/turns/{turnId}/trace` answers a turn's spans as OTLP JSON,
|
|
185
195
|
* the spans the Runtime posts to an OTLP collector when one is configured; a command or an AG-UI
|
|
186
196
|
* or A2A request sent with a `traceparent` joins the caller's trace.
|
|
197
|
+
* `gateway-credentials`: a `bearer` or `headers` credential with `via`, written to an Agent's vault,
|
|
198
|
+
* may name the gateway's tool prefix (`toolPrefix`), which the Runtime takes off the tools it lists
|
|
199
|
+
* and puts back on each call.
|
|
187
200
|
*/
|
|
188
201
|
export declare const OPTIONAL_HOST_FEATURES: readonly ["tenant-fixture-model", "transcript-events", "subject-headers", "ag-ui-endpoint", "a2a-endpoint", "sandbox-pods", "trusted-issuers", "session-reads", "calls-export", "credential-coverage", "tool-calls", "environment-setup", "environment-disk-versions", "tool-policy", "traces",
|
|
189
202
|
/** Opt-in artifact metadata pages (`GET /v1/artifacts?limit=…`). */
|
|
190
|
-
"artifact-reads"];
|
|
203
|
+
"artifact-reads", "gateway-credentials"];
|
|
191
204
|
export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
|
|
192
205
|
export interface ProtocolRange {
|
|
193
206
|
min: number;
|
|
@@ -195,10 +208,11 @@ export interface ProtocolRange {
|
|
|
195
208
|
features: readonly string[];
|
|
196
209
|
}
|
|
197
210
|
/**
|
|
198
|
-
* What this Host serves: protocol 16 and
|
|
211
|
+
* What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
|
|
199
212
|
* Environments with agent manifests and Agents, so an older client is answered `426` naming the
|
|
200
213
|
* protocol it needs rather than routes it cannot use. Protocol 17 is additive: a protocol 16
|
|
201
|
-
* client's messages default to `delivery: "reject"`.
|
|
214
|
+
* client's messages default to `delivery: "reject"`. Protocol 18 is additive: a protocol 16 or 17
|
|
215
|
+
* client's usage reads leave out the fields it added.
|
|
202
216
|
*/
|
|
203
217
|
export declare const HOST_PROTOCOL: ProtocolRange;
|
|
204
218
|
export declare const DEFINITION_SCHEMA_VERSION = 2;
|
|
@@ -250,15 +264,15 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
250
264
|
*/
|
|
251
265
|
"queue_full",
|
|
252
266
|
/**
|
|
253
|
-
* `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed
|
|
254
|
-
*
|
|
267
|
+
* `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed:
|
|
268
|
+
* `409`. Save a manifest version with a new time.
|
|
255
269
|
*/
|
|
256
270
|
"trigger_expired",
|
|
257
|
-
/** A signed delivery to a paused webhook trigger
|
|
271
|
+
/** A signed delivery to a paused webhook trigger: `409`; nothing runs. */
|
|
258
272
|
"trigger_paused",
|
|
259
273
|
/**
|
|
260
274
|
* A memory write whose `content_sha256` precondition no longer holds, or a path a folder or
|
|
261
|
-
* another memory already holds
|
|
275
|
+
* another memory already holds: `409`. Read the memory again and write on top.
|
|
262
276
|
*/
|
|
263
277
|
"memory_conflict",
|
|
264
278
|
/** Disk work (snapshot, restore, stop, reset) while a turn runs, or a turn while a disk copy runs. */
|
|
@@ -275,9 +289,9 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
275
289
|
*/
|
|
276
290
|
"agent_owner_mismatch",
|
|
277
291
|
/**
|
|
278
|
-
* The session's
|
|
279
|
-
*
|
|
280
|
-
*
|
|
292
|
+
* The session's Agent runs another harness than the one the session pinned when it opened: an
|
|
293
|
+
* Agent's harness is fixed for its life, so its id was deleted and made again from a manifest
|
|
294
|
+
* with another harness. Open a new session.
|
|
281
295
|
*/
|
|
282
296
|
"harness_mismatch",
|
|
283
297
|
/**
|
|
@@ -291,36 +305,36 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
291
305
|
*/
|
|
292
306
|
"issuer_unavailable",
|
|
293
307
|
/**
|
|
294
|
-
* A definition names definition files the Runtime does not hold
|
|
308
|
+
* A definition names definition files the Runtime does not hold: upload each
|
|
295
309
|
* with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
|
|
296
310
|
*/
|
|
297
311
|
"definition_files_missing",
|
|
298
312
|
/**
|
|
299
313
|
* Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
|
|
300
|
-
* answered `401
|
|
314
|
+
* answered `401`. The vault's credential (or none) was rejected; the call is not retried.
|
|
301
315
|
*/
|
|
302
316
|
"credential_rejected",
|
|
303
317
|
/**
|
|
304
|
-
* `POST /v1/tenant/mcp/preview` could not list the server's tools
|
|
318
|
+
* `POST /v1/tenant/mcp/preview` could not list the server's tools: `502`, with
|
|
305
319
|
* `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
|
|
306
320
|
* address the Host refuses, a connection that failed or a server silent past 15 s;
|
|
307
321
|
* `mcp.forbidden`, `mcp.status`, `mcp.error`).
|
|
308
322
|
*/
|
|
309
323
|
"mcp_preview_failed",
|
|
310
324
|
/**
|
|
311
|
-
* An Environment's credentials would be ambiguous
|
|
325
|
+
* An Environment's credentials would be ambiguous: `409` at the secret write. Two
|
|
312
326
|
* `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
|
|
313
327
|
* credentials to one URL.
|
|
314
328
|
*/
|
|
315
329
|
"credential_conflict",
|
|
316
330
|
/**
|
|
317
|
-
* A move of an existing Agent (`PUT /v1/agents/{id}
|
|
318
|
-
* its life: its manifest's name, its kind, its harness or its storage
|
|
331
|
+
* A move of an existing Agent (`PUT /v1/agents/{id}`) would change what is fixed for
|
|
332
|
+
* its life: its manifest's name, its kind, its harness or its storage. `409`, with each in
|
|
319
333
|
* `details.fields`. Fork it into a new Agent (`POST /v1/agents/{id}/fork`) instead.
|
|
320
334
|
*/
|
|
321
335
|
"agent_fixed_field",
|
|
322
336
|
/**
|
|
323
|
-
* A secret write named a secret the Agent's manifest does not declare
|
|
337
|
+
* A secret write named a secret the Agent's manifest does not declare: `409`. Add the
|
|
324
338
|
* slot to the manifest's runtime section and move the Agent to the new version.
|
|
325
339
|
*/
|
|
326
340
|
"secret_not_in_manifest",
|
|
@@ -335,7 +349,7 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
335
349
|
/** An agent manifest some Agent was made from cannot be deleted: `409`. */
|
|
336
350
|
"manifest_in_use",
|
|
337
351
|
/**
|
|
338
|
-
* `If-Match` named a version that is no longer the latest
|
|
352
|
+
* `If-Match` named a version that is no longer the latest: `412`. Read the manifest
|
|
339
353
|
* again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
|
|
340
354
|
*/
|
|
341
355
|
"manifest_changed", "internal_error"];
|
|
@@ -349,7 +363,7 @@ export declare const ARTIFACT_ID_PATTERN: RegExp;
|
|
|
349
363
|
/**
|
|
350
364
|
* An application key's id: an operator key's name, which names its client (e.g. `backend`).
|
|
351
365
|
* `studio` is reserved for the key Studio derives from the admin key.
|
|
352
|
-
* An identifier's grammar is the protocol's
|
|
366
|
+
* An identifier's grammar is the protocol's: it crosses the Runtime API, tokens and grants
|
|
353
367
|
* and means the same in every installation, so its length is a constant of protocol 15, not a
|
|
354
368
|
* setting.
|
|
355
369
|
*/
|
package/dist/compatibility.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export { hashManifest } from "./utils/hash.js";
|
|
2
2
|
/**
|
|
3
|
-
* Protocol
|
|
3
|
+
* Protocol 18: session usage by token kind. A model call read (`/v1/sessions/{id}/calls/model`,
|
|
4
|
+
* `/v1/tenant/calls/model`) carries the gate's timing (`startedAt`, `endedAt`) and its cost by
|
|
5
|
+
* token kind (`usage.costSplit`), and a session's usage (`/v1/sessions/{id}/usage`) adds
|
|
6
|
+
* `costSplit`, `splitCalls`, `modelTimeMs` and `timedCalls`. The Host serves protocol 16, 17 and 18:
|
|
7
|
+
* an older client, whose SDK parses these reads strictly, gets them without the new fields.
|
|
8
|
+
* Protocol 17: a queue per session. A message sent while the session's turn runs,
|
|
4
9
|
* or while it waits on an approval, an answer or an uncertain call, is queued
|
|
5
10
|
* (`{status: "queued", queuedMessageId, position}`, `message.queued`) instead of refused, unless
|
|
6
11
|
* it asks `delivery: "reject"`; the refusal now has a code, `409 session_busy`. When the turn ends
|
|
@@ -10,7 +15,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
10
15
|
* `sessionQueuedMessages` a message is `429 queue_full`. Session reads count `queuedMessages`. The
|
|
11
16
|
* Host serves protocol 16 and 17: a message from a protocol 16 client is `reject` unless it says
|
|
12
17
|
* otherwise, so its sessions answer `409` as before.
|
|
13
|
-
* Protocol 16: Agents from one manifest
|
|
18
|
+
* Protocol 16: Agents from one manifest, a fresh start. An agent manifest (v8) is one
|
|
14
19
|
* versioned document at `/v1/agent-manifests/{name}` with a `harness` section (what runs inside
|
|
15
20
|
* the loop, including the harness's id) and a `runtime` section (what an environment manifest
|
|
16
21
|
* said); the Runtime checks the two against each other when it is saved
|
|
@@ -19,14 +24,14 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
19
24
|
* Environments are Agents: `/v1/agents/{id}` (with `.../events`, `stop`, `reset`, `snapshot`,
|
|
20
25
|
* `restore`, `versions`, `fork` and `secrets`) is made from a saved manifest only, records it as
|
|
21
26
|
* tracking (`name`) or pinned (`name@n`) into `resolvedVersion`, the version it runs. An Agent
|
|
22
|
-
* evolves
|
|
27
|
+
* evolves: a `PUT` naming another version of its manifest moves it (`dryRun`
|
|
23
28
|
* answers the plan), a save moves every Agent that tracks the manifest, and each turn takes the
|
|
24
29
|
* version its Agent runs when it starts; a runtime change waits for a pod's next start, and its
|
|
25
30
|
* kind, harness and storage are fixed (`409 agent_fixed_field`). Reads add `state`
|
|
26
31
|
* (`working`, `sleeping`, `input_required`, `failing`, `paused`) and `attention`, and the
|
|
27
32
|
* compute's state moves to `compute.state`. Every session belongs to one Agent:
|
|
28
33
|
* `PUT /v1/sessions/{id}` takes `{ agent, ownerUserId, info }` and pins the manifest version its
|
|
29
|
-
* Agent runs; no session is special
|
|
34
|
+
* Agent runs; no session is special. Error codes, event types (`agent.*`), the scopes
|
|
30
35
|
* (`agents:write`, `agent-manifests:write`) and identity-file grants (`agents`) say Agent. Model
|
|
31
36
|
* budget scope `agent` is `manifest`. Harness API 5: `turn.start.agent` replaces
|
|
32
37
|
* `turn.start.environment`. Sessions opened before protocol 16 are closed (`protocol_16`) and
|
|
@@ -47,7 +52,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
47
52
|
* key on (a policy rule with `__` in its `tool` refuses every call). The record refuses an
|
|
48
53
|
* outcome past `limits.recordEntryBytes`. Sessions pinned before protocol 15 must be recreated.
|
|
49
54
|
* The Host serves protocol 15 only.
|
|
50
|
-
* Protocol 14: environment manifests
|
|
55
|
+
* Protocol 14: environment manifests. `/v1/environment-manifests/{name}` holds
|
|
51
56
|
* named, versioned definitions of a kind of Environment, saved like agents (with `If-Match` and
|
|
52
57
|
* `?dryRun=true`), and `PUT /v1/environments/{id}` takes `manifest: "name"` or `"name@n"`. An
|
|
53
58
|
* Environment never changes what it runs after creation: a `PUT` on an existing one may change
|
|
@@ -55,10 +60,10 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
55
60
|
* `manifest`. A manifest's `secrets` declares slots: a write sends only the value, and a name it
|
|
56
61
|
* does not declare is `409 secret_not_in_manifest`. An agent manifest's `requires` is checked
|
|
57
62
|
* when a session opens (`409 environment_unsuitable`). Sessions on one Environment run their
|
|
58
|
-
* turns in parallel
|
|
63
|
+
* turns in parallel, so a turn start is no longer `environment_busy` because another
|
|
59
64
|
* session's turn runs, and every egress connection is an `environment.egress` event on the
|
|
60
65
|
* Environment's stream naming the turns that were running; `egress.connection` is gone from
|
|
61
|
-
* session logs and traces
|
|
66
|
+
* session logs and traces. The Host serves protocol 14 only.
|
|
62
67
|
* Protocol 13: the flat agent manifest (v7), a fresh start. A manifest has no capabilities: its
|
|
63
68
|
* instructions, tools, skills and MCP servers are top-level, and a skill or server from an Agent
|
|
64
69
|
* Plugin carries a `plugin` label. A session's pinned manifest carries the Runtime's `runtime`
|
|
@@ -72,7 +77,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
72
77
|
* accept (`422 attachment_unsupported`), with no turn. After its turn a file is a reference line
|
|
73
78
|
* the model reads again with `read_artifact`, which every agent now has. The Host accepts
|
|
74
79
|
* protocol 11 and 12: the change is additive.
|
|
75
|
-
* Protocol 11: Environments
|
|
80
|
+
* Protocol 11: Environments, a fresh start. `/v1/environments/{id}` replaces
|
|
76
81
|
* `/v1/sandboxes`: an Environment is one sandbox (kind `virtual`, `pod` or `none`) with a recipe
|
|
77
82
|
* that can change and one vault, written on the Runtime API
|
|
78
83
|
* (`PUT /v1/environments/{id}/secrets/{name}`). Sessions name an `environment` or nothing; the
|
|
@@ -80,7 +85,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
80
85
|
* user and installation vaults and `/v1/tenant/vaults` are gone. Error codes, event types, the
|
|
81
86
|
* scope (`environments:write`) and identity-file grants (`environments`) say Environment. An
|
|
82
87
|
* older client is answered `426`.
|
|
83
|
-
* Protocol 10: MCP credential custody leaves OSS
|
|
88
|
+
* Protocol 10: MCP credential custody leaves OSS. The vault credential type `oauth`, the
|
|
84
89
|
* MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
|
|
85
90
|
* credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
|
|
86
91
|
* through its attached vaults only.
|
|
@@ -89,12 +94,12 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
89
94
|
* `WWW-Authenticate: Bearer` challenge instead of the opaque 404, a token missing a scope gets
|
|
90
95
|
* `error="insufficient_scope"`, and `GET /.well-known/oauth-protected-resource` names the trusted
|
|
91
96
|
* issuers. Identity files lose `maxLifetime`: the issuer sets its tokens' lifetimes.
|
|
92
|
-
* Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents
|
|
93
|
-
*
|
|
97
|
+
* Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents:
|
|
98
|
+
* manifest v5 and workflow manifest v3, no hooks or flow functions, remote MCP
|
|
94
99
|
* only, and no Action endpoints (`/v1/endpoints` and `/v1/actions/*` answer 404, delivery
|
|
95
100
|
* tokens are gone): an agent's tools are HTTP tools, remote MCP servers, agents and the
|
|
96
101
|
* Runtime's built-ins.
|
|
97
|
-
* Protocol 7: open-source auth
|
|
102
|
+
* Protocol 7: open-source auth. Subject tokens (`POST /v1/tokens`), the access policy,
|
|
98
103
|
* revocations, browser keys (`Nylorun-Key`), the Runtime's own CORS and derived principals are gone; their
|
|
99
104
|
* routes answer 404. Browsers and apps present a trusted issuer's token, servers an operator key.
|
|
100
105
|
* Protocol 6: file artifacts (`/v1/artifacts/**`, Runtime-signed capability links) and user
|
|
@@ -102,7 +107,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
102
107
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
103
108
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
104
109
|
*/
|
|
105
|
-
export const PROTOCOL_VERSION =
|
|
110
|
+
export const PROTOCOL_VERSION = 18;
|
|
106
111
|
/** What a client of this protocol requires of a Host. */
|
|
107
112
|
export const PROTOCOL_FEATURES = [
|
|
108
113
|
"studio-principal",
|
|
@@ -144,10 +149,15 @@ export const PROTOCOL_FEATURES = [
|
|
|
144
149
|
*/
|
|
145
150
|
"agents",
|
|
146
151
|
/**
|
|
147
|
-
* Protocol 17: a queue per session
|
|
152
|
+
* Protocol 17: a queue per session. A message to a busy session is queued unless it asks
|
|
148
153
|
* `delivery: "reject"`, and the busy refusal is `409 session_busy`.
|
|
149
154
|
*/
|
|
150
155
|
"session-queue",
|
|
156
|
+
/**
|
|
157
|
+
* Protocol 18: model call reads carry their timing and their cost by token kind, and a
|
|
158
|
+
* session's usage the cost by kind and the model time.
|
|
159
|
+
*/
|
|
160
|
+
"usage-by-kind",
|
|
151
161
|
];
|
|
152
162
|
/**
|
|
153
163
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -176,16 +186,19 @@ export const PROTOCOL_FEATURES = [
|
|
|
176
186
|
* `credential-coverage`: `POST /v1/tenant/credential-coverage` (the Management API) says which
|
|
177
187
|
* credential of an Environment's vault each of a saved agent's MCP servers and HTTP tools would
|
|
178
188
|
* get in a session that names that Environment.
|
|
179
|
-
* `tool-calls
|
|
189
|
+
* `tool-calls`: `GET /v1/sessions/{id}/calls/tool` pages a session's tool calls from the
|
|
180
190
|
* effect journal, every `tool.completed` says how its call ended (`status`, `kind`, `server`,
|
|
181
191
|
* `attempts`, `durationMs`), and tool calls are delivered at least once with their effect id as
|
|
182
192
|
* the key (`Idempotency-Key` for HTTP tools, `_meta["nylorun/idempotency-key"]` for MCP tools).
|
|
183
|
-
* `tool-policy
|
|
193
|
+
* `tool-policy`: `GET`/`PUT /v1/tenant/tool-policy` (the Management API) sets which
|
|
184
194
|
* MCP and HTTP tool calls run, wait for a person (`ask`: the turn pauses until `approve`) or are
|
|
185
195
|
* refused (`deny`: `tool.denied`), for every harness; a manifest that sets `approval` is refused.
|
|
186
|
-
* `traces
|
|
196
|
+
* `traces`: `GET /v1/sessions/{id}/turns/{turnId}/trace` answers a turn's spans as OTLP JSON,
|
|
187
197
|
* the spans the Runtime posts to an OTLP collector when one is configured; a command or an AG-UI
|
|
188
198
|
* or A2A request sent with a `traceparent` joins the caller's trace.
|
|
199
|
+
* `gateway-credentials`: a `bearer` or `headers` credential with `via`, written to an Agent's vault,
|
|
200
|
+
* may name the gateway's tool prefix (`toolPrefix`), which the Runtime takes off the tools it lists
|
|
201
|
+
* and puts back on each call.
|
|
189
202
|
*/
|
|
190
203
|
export const OPTIONAL_HOST_FEATURES = [
|
|
191
204
|
"tenant-fixture-model",
|
|
@@ -205,16 +218,18 @@ export const OPTIONAL_HOST_FEATURES = [
|
|
|
205
218
|
"traces",
|
|
206
219
|
/** Opt-in artifact metadata pages (`GET /v1/artifacts?limit=…`). */
|
|
207
220
|
"artifact-reads",
|
|
221
|
+
"gateway-credentials",
|
|
208
222
|
];
|
|
209
223
|
/**
|
|
210
|
-
* What this Host serves: protocol 16 and
|
|
224
|
+
* What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
|
|
211
225
|
* Environments with agent manifests and Agents, so an older client is answered `426` naming the
|
|
212
226
|
* protocol it needs rather than routes it cannot use. Protocol 17 is additive: a protocol 16
|
|
213
|
-
* client's messages default to `delivery: "reject"`.
|
|
227
|
+
* client's messages default to `delivery: "reject"`. Protocol 18 is additive: a protocol 16 or 17
|
|
228
|
+
* client's usage reads leave out the fields it added.
|
|
214
229
|
*/
|
|
215
230
|
export const HOST_PROTOCOL = {
|
|
216
231
|
min: 16,
|
|
217
|
-
max:
|
|
232
|
+
max: 18,
|
|
218
233
|
features: [...PROTOCOL_FEATURES, ...OPTIONAL_HOST_FEATURES],
|
|
219
234
|
};
|
|
220
235
|
export const DEFINITION_SCHEMA_VERSION = 2;
|
|
@@ -277,15 +292,15 @@ export const ERROR_CODES = [
|
|
|
277
292
|
*/
|
|
278
293
|
"queue_full",
|
|
279
294
|
/**
|
|
280
|
-
* `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed
|
|
281
|
-
*
|
|
295
|
+
* `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed:
|
|
296
|
+
* `409`. Save a manifest version with a new time.
|
|
282
297
|
*/
|
|
283
298
|
"trigger_expired",
|
|
284
|
-
/** A signed delivery to a paused webhook trigger
|
|
299
|
+
/** A signed delivery to a paused webhook trigger: `409`; nothing runs. */
|
|
285
300
|
"trigger_paused",
|
|
286
301
|
/**
|
|
287
302
|
* A memory write whose `content_sha256` precondition no longer holds, or a path a folder or
|
|
288
|
-
* another memory already holds
|
|
303
|
+
* another memory already holds: `409`. Read the memory again and write on top.
|
|
289
304
|
*/
|
|
290
305
|
"memory_conflict",
|
|
291
306
|
/** Disk work (snapshot, restore, stop, reset) while a turn runs, or a turn while a disk copy runs. */
|
|
@@ -302,9 +317,9 @@ export const ERROR_CODES = [
|
|
|
302
317
|
*/
|
|
303
318
|
"agent_owner_mismatch",
|
|
304
319
|
/**
|
|
305
|
-
* The session's
|
|
306
|
-
*
|
|
307
|
-
*
|
|
320
|
+
* The session's Agent runs another harness than the one the session pinned when it opened: an
|
|
321
|
+
* Agent's harness is fixed for its life, so its id was deleted and made again from a manifest
|
|
322
|
+
* with another harness. Open a new session.
|
|
308
323
|
*/
|
|
309
324
|
"harness_mismatch",
|
|
310
325
|
/**
|
|
@@ -318,36 +333,36 @@ export const ERROR_CODES = [
|
|
|
318
333
|
*/
|
|
319
334
|
"issuer_unavailable",
|
|
320
335
|
/**
|
|
321
|
-
* A definition names definition files the Runtime does not hold
|
|
336
|
+
* A definition names definition files the Runtime does not hold: upload each
|
|
322
337
|
* with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
|
|
323
338
|
*/
|
|
324
339
|
"definition_files_missing",
|
|
325
340
|
/**
|
|
326
341
|
* Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
|
|
327
|
-
* answered `401
|
|
342
|
+
* answered `401`. The vault's credential (or none) was rejected; the call is not retried.
|
|
328
343
|
*/
|
|
329
344
|
"credential_rejected",
|
|
330
345
|
/**
|
|
331
|
-
* `POST /v1/tenant/mcp/preview` could not list the server's tools
|
|
346
|
+
* `POST /v1/tenant/mcp/preview` could not list the server's tools: `502`, with
|
|
332
347
|
* `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
|
|
333
348
|
* address the Host refuses, a connection that failed or a server silent past 15 s;
|
|
334
349
|
* `mcp.forbidden`, `mcp.status`, `mcp.error`).
|
|
335
350
|
*/
|
|
336
351
|
"mcp_preview_failed",
|
|
337
352
|
/**
|
|
338
|
-
* An Environment's credentials would be ambiguous
|
|
353
|
+
* An Environment's credentials would be ambiguous: `409` at the secret write. Two
|
|
339
354
|
* `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
|
|
340
355
|
* credentials to one URL.
|
|
341
356
|
*/
|
|
342
357
|
"credential_conflict",
|
|
343
358
|
/**
|
|
344
|
-
* A move of an existing Agent (`PUT /v1/agents/{id}
|
|
345
|
-
* its life: its manifest's name, its kind, its harness or its storage
|
|
359
|
+
* A move of an existing Agent (`PUT /v1/agents/{id}`) would change what is fixed for
|
|
360
|
+
* its life: its manifest's name, its kind, its harness or its storage. `409`, with each in
|
|
346
361
|
* `details.fields`. Fork it into a new Agent (`POST /v1/agents/{id}/fork`) instead.
|
|
347
362
|
*/
|
|
348
363
|
"agent_fixed_field",
|
|
349
364
|
/**
|
|
350
|
-
* A secret write named a secret the Agent's manifest does not declare
|
|
365
|
+
* A secret write named a secret the Agent's manifest does not declare: `409`. Add the
|
|
351
366
|
* slot to the manifest's runtime section and move the Agent to the new version.
|
|
352
367
|
*/
|
|
353
368
|
"secret_not_in_manifest",
|
|
@@ -362,7 +377,7 @@ export const ERROR_CODES = [
|
|
|
362
377
|
/** An agent manifest some Agent was made from cannot be deleted: `409`. */
|
|
363
378
|
"manifest_in_use",
|
|
364
379
|
/**
|
|
365
|
-
* `If-Match` named a version that is no longer the latest
|
|
380
|
+
* `If-Match` named a version that is no longer the latest: `412`. Read the manifest
|
|
366
381
|
* again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
|
|
367
382
|
*/
|
|
368
383
|
"manifest_changed",
|
|
@@ -379,7 +394,7 @@ export const ARTIFACT_ID_PATTERN = /^af_[0-9a-hjkmnp-tv-z]{26}$/;
|
|
|
379
394
|
/**
|
|
380
395
|
* An application key's id: an operator key's name, which names its client (e.g. `backend`).
|
|
381
396
|
* `studio` is reserved for the key Studio derives from the admin key.
|
|
382
|
-
* An identifier's grammar is the protocol's
|
|
397
|
+
* An identifier's grammar is the protocol's: it crosses the Runtime API, tokens and grants
|
|
383
398
|
* and means the same in every installation, so its length is a constant of protocol 15, not a
|
|
384
399
|
* setting.
|
|
385
400
|
*/
|