@nylorun/core 0.24.0-beta → 0.25.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/dist/compatibility.d.ts +47 -36
  3. package/dist/compatibility.js +47 -36
  4. package/dist/contracts.d.ts +133 -87
  5. package/dist/contracts.js +185 -135
  6. package/dist/definition/approval.d.ts +1 -1
  7. package/dist/definition/bound.d.ts +2 -0
  8. package/dist/definition/builder.d.ts +2 -2
  9. package/dist/definition/builder.js +1 -1
  10. package/dist/definition/code-tools.d.ts +1 -1
  11. package/dist/definition/declaration.js +3 -0
  12. package/dist/definition/delegate.d.ts +1 -1
  13. package/dist/definition/delegate.js +1 -1
  14. package/dist/definition/from.d.ts +2 -2
  15. package/dist/definition/from.js +1 -1
  16. package/dist/definition/http-tool.d.ts +3 -3
  17. package/dist/definition/mcp.d.ts +4 -4
  18. package/dist/definition/mcp.js +3 -3
  19. package/dist/definition/sections.d.ts +5 -4
  20. package/dist/definition/sections.js +30 -7
  21. package/dist/definition/variant.d.ts +1 -1
  22. package/dist/definition/variant.js +4 -4
  23. package/dist/harness-api/entries.d.ts +1 -1
  24. package/dist/harness-api/entries.js +1 -1
  25. package/dist/harness-api/gates.d.ts +1 -1
  26. package/dist/harness-api/gates.js +1 -1
  27. package/dist/harness-api/json-schema.d.ts +1 -1
  28. package/dist/harness-api/json-schema.js +1 -1
  29. package/dist/harness-api/mcp.js +1 -1
  30. package/dist/harness-api/messages.d.ts +6 -6
  31. package/dist/harness-api/schema.d.ts +7 -7
  32. package/dist/harness-api/schema.js +16 -16
  33. package/dist/harness-api/transcript.d.ts +1 -1
  34. package/dist/harness-api/transport.d.ts +1 -1
  35. package/dist/harness-api/transport.js +1 -1
  36. package/dist/manifest-schemas.js +2 -1
  37. package/dist/schemas/agent-manifest.schema.json +3 -3
  38. package/dist/schemas/harness-manifest.schema.json +1 -1
  39. package/dist/schemas/runtime-manifest.schema.json +2 -2
  40. package/dist/types/manifest.d.ts +21 -17
  41. package/dist/types/model.d.ts +1 -1
  42. package/dist/types/observe.d.ts +1 -1
  43. package/dist/types/part.d.ts +5 -0
  44. package/dist/types/tool.d.ts +4 -4
  45. package/dist/utils/definition-files.d.ts +3 -2
  46. package/dist/utils/definition-files.js +4 -3
  47. package/dist/utils/file-systems.d.ts +1 -1
  48. package/dist/utils/file-systems.js +1 -1
  49. package/dist/utils/harness-id.d.ts +1 -1
  50. package/dist/utils/harness-id.js +1 -1
  51. package/dist/utils/memory.d.ts +2 -2
  52. package/dist/utils/memory.js +2 -2
  53. package/dist/utils/runtime-limits.d.ts +5 -5
  54. package/dist/utils/runtime-limits.js +5 -5
  55. package/dist/utils/runtime-tools.d.ts +3 -3
  56. package/dist/utils/runtime-tools.js +3 -3
  57. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @nylorun/core
2
2
 
3
+ ## 0.25.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+
9
+ ### Patch Changes
10
+
11
+ - 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.
12
+ - 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`.
13
+ - 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.
14
+ - 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.
15
+
3
16
  ## 0.24.0-beta
4
17
 
5
18
  ### Minor Changes
@@ -17,7 +30,7 @@
17
30
  - 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
31
  - 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
32
  - 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 KB) 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.
33
+ - 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
34
  - 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
35
  - 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
36
  - 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.
@@ -1,6 +1,11 @@
1
1
  export { hashManifest } from "./utils/hash.js";
2
2
  /**
3
- * Protocol 17: a queue per session (track T4, D76). A message sent while the session's turn runs,
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 (track T2), a fresh start. An agent manifest (v8) is one
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 (track T3, D73): a `PUT` naming another version of its manifest moves it (`dryRun`
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 (D71). Error codes, event types (`agent.*`), the scopes
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 (D63 to D65). `/v1/environment-manifests/{name}` holds
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 (D66), so a turn start is no longer `environment_busy` because another
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 (D67). The Host serves protocol 14 only.
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 (R2d, D55, D56), a fresh start. `/v1/environments/{id}` replaces
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 (D49). The vault credential type `oauth`, the
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
- * (track R2): manifest v5 and workflow manifest v3, no hooks or flow functions, remote MCP
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 (F9 I3). Subject tokens (`POST /v1/tokens`), the access policy,
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 = 17;
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 (D76). A message to a busy session is queued unless it asks
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,14 +184,14 @@ 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` (R5): `GET /v1/sessions/{id}/calls/tool` pages a session's tool calls from the
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` (R5 step 2): `GET`/`PUT /v1/tenant/tool-policy` (the Management API) sets which
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` (R7): `GET /v1/sessions/{id}/turns/{turnId}/trace` answers a turn's spans as OTLP JSON,
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.
187
197
  */
@@ -195,10 +205,11 @@ export interface ProtocolRange {
195
205
  features: readonly string[];
196
206
  }
197
207
  /**
198
- * What this Host serves: protocol 16 and 17. Protocol 16 replaced agent definitions and
208
+ * What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
199
209
  * Environments with agent manifests and Agents, so an older client is answered `426` naming the
200
210
  * protocol it needs rather than routes it cannot use. Protocol 17 is additive: a protocol 16
201
- * client's messages default to `delivery: "reject"`.
211
+ * client's messages default to `delivery: "reject"`. Protocol 18 is additive: a protocol 16 or 17
212
+ * client's usage reads leave out the fields it added.
202
213
  */
203
214
  export declare const HOST_PROTOCOL: ProtocolRange;
204
215
  export declare const DEFINITION_SCHEMA_VERSION = 2;
@@ -250,15 +261,15 @@ export declare const ERROR_CODES: readonly ["not_found",
250
261
  */
251
262
  "queue_full",
252
263
  /**
253
- * `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed
254
- * (track T4): `409`. Save a manifest version with a new time.
264
+ * `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed:
265
+ * `409`. Save a manifest version with a new time.
255
266
  */
256
267
  "trigger_expired",
257
- /** A signed delivery to a paused webhook trigger (D75): `409`; nothing runs. */
268
+ /** A signed delivery to a paused webhook trigger: `409`; nothing runs. */
258
269
  "trigger_paused",
259
270
  /**
260
271
  * A memory write whose `content_sha256` precondition no longer holds, or a path a folder or
261
- * another memory already holds (track T5, D72): `409`. Read the memory again and write on top.
272
+ * another memory already holds: `409`. Read the memory again and write on top.
262
273
  */
263
274
  "memory_conflict",
264
275
  /** Disk work (snapshot, restore, stop, reset) while a turn runs, or a turn while a disk copy runs. */
@@ -275,9 +286,9 @@ export declare const ERROR_CODES: readonly ["not_found",
275
286
  */
276
287
  "agent_owner_mismatch",
277
288
  /**
278
- * The session's Environment runs another harness than the one the session pinned when it
279
- * opened (track R4): its id was deleted and made again with another harness, or an
280
- * Environment changed in place before protocol 14 applied that change. Open a new session.
289
+ * The session's Agent runs another harness than the one the session pinned when it opened: an
290
+ * Agent's harness is fixed for its life, so its id was deleted and made again from a manifest
291
+ * with another harness. Open a new session.
281
292
  */
282
293
  "harness_mismatch",
283
294
  /**
@@ -291,36 +302,36 @@ export declare const ERROR_CODES: readonly ["not_found",
291
302
  */
292
303
  "issuer_unavailable",
293
304
  /**
294
- * A definition names definition files the Runtime does not hold (track R2 M4): upload each
305
+ * A definition names definition files the Runtime does not hold: upload each
295
306
  * with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
296
307
  */
297
308
  "definition_files_missing",
298
309
  /**
299
310
  * Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
300
- * answered `401` (R2b C1). The vault's credential (or none) was rejected; the call is not retried.
311
+ * answered `401`. The vault's credential (or none) was rejected; the call is not retried.
301
312
  */
302
313
  "credential_rejected",
303
314
  /**
304
- * `POST /v1/tenant/mcp/preview` could not list the server's tools (R2b C12): `502`, with
315
+ * `POST /v1/tenant/mcp/preview` could not list the server's tools: `502`, with
305
316
  * `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
306
317
  * address the Host refuses, a connection that failed or a server silent past 15 s;
307
318
  * `mcp.forbidden`, `mcp.status`, `mcp.error`).
308
319
  */
309
320
  "mcp_preview_failed",
310
321
  /**
311
- * An Environment's credentials would be ambiguous (R2c, D56): `409` at the secret write. Two
322
+ * An Environment's credentials would be ambiguous: `409` at the secret write. Two
312
323
  * `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
313
324
  * credentials to one URL.
314
325
  */
315
326
  "credential_conflict",
316
327
  /**
317
- * A move of an existing Agent (`PUT /v1/agents/{id}`, track T3) would change what is fixed for
318
- * its life: its manifest's name, its kind, its harness or its storage (D73). `409`, with each in
328
+ * A move of an existing Agent (`PUT /v1/agents/{id}`) would change what is fixed for
329
+ * its life: its manifest's name, its kind, its harness or its storage. `409`, with each in
319
330
  * `details.fields`. Fork it into a new Agent (`POST /v1/agents/{id}/fork`) instead.
320
331
  */
321
332
  "agent_fixed_field",
322
333
  /**
323
- * A secret write named a secret the Agent's manifest does not declare (D64): `409`. Add the
334
+ * A secret write named a secret the Agent's manifest does not declare: `409`. Add the
324
335
  * slot to the manifest's runtime section and move the Agent to the new version.
325
336
  */
326
337
  "secret_not_in_manifest",
@@ -335,7 +346,7 @@ export declare const ERROR_CODES: readonly ["not_found",
335
346
  /** An agent manifest some Agent was made from cannot be deleted: `409`. */
336
347
  "manifest_in_use",
337
348
  /**
338
- * `If-Match` named a version that is no longer the latest (D63): `412`. Read the manifest
349
+ * `If-Match` named a version that is no longer the latest: `412`. Read the manifest
339
350
  * again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
340
351
  */
341
352
  "manifest_changed", "internal_error"];
@@ -349,7 +360,7 @@ export declare const ARTIFACT_ID_PATTERN: RegExp;
349
360
  /**
350
361
  * An application key's id: an operator key's name, which names its client (e.g. `backend`).
351
362
  * `studio` is reserved for the key Studio derives from the admin key.
352
- * An identifier's grammar is the protocol's (B15): it crosses the Runtime API, tokens and grants
363
+ * An identifier's grammar is the protocol's: it crosses the Runtime API, tokens and grants
353
364
  * and means the same in every installation, so its length is a constant of protocol 15, not a
354
365
  * setting.
355
366
  */
@@ -1,6 +1,11 @@
1
1
  export { hashManifest } from "./utils/hash.js";
2
2
  /**
3
- * Protocol 17: a queue per session (track T4, D76). A message sent while the session's turn runs,
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 (track T2), a fresh start. An agent manifest (v8) is one
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 (track T3, D73): a `PUT` naming another version of its manifest moves it (`dryRun`
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 (D71). Error codes, event types (`agent.*`), the scopes
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 (D63 to D65). `/v1/environment-manifests/{name}` holds
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 (D66), so a turn start is no longer `environment_busy` because another
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 (D67). The Host serves protocol 14 only.
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 (R2d, D55, D56), a fresh start. `/v1/environments/{id}` replaces
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 (D49). The vault credential type `oauth`, the
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
- * (track R2): manifest v5 and workflow manifest v3, no hooks or flow functions, remote MCP
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 (F9 I3). Subject tokens (`POST /v1/tokens`), the access policy,
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 = 17;
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 (D76). A message to a busy session is queued unless it asks
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,14 +186,14 @@ 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` (R5): `GET /v1/sessions/{id}/calls/tool` pages a session's tool calls from the
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` (R5 step 2): `GET`/`PUT /v1/tenant/tool-policy` (the Management API) sets which
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` (R7): `GET /v1/sessions/{id}/turns/{turnId}/trace` answers a turn's spans as OTLP JSON,
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.
189
199
  */
@@ -207,14 +217,15 @@ export const OPTIONAL_HOST_FEATURES = [
207
217
  "artifact-reads",
208
218
  ];
209
219
  /**
210
- * What this Host serves: protocol 16 and 17. Protocol 16 replaced agent definitions and
220
+ * What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
211
221
  * Environments with agent manifests and Agents, so an older client is answered `426` naming the
212
222
  * protocol it needs rather than routes it cannot use. Protocol 17 is additive: a protocol 16
213
- * client's messages default to `delivery: "reject"`.
223
+ * client's messages default to `delivery: "reject"`. Protocol 18 is additive: a protocol 16 or 17
224
+ * client's usage reads leave out the fields it added.
214
225
  */
215
226
  export const HOST_PROTOCOL = {
216
227
  min: 16,
217
- max: 17,
228
+ max: 18,
218
229
  features: [...PROTOCOL_FEATURES, ...OPTIONAL_HOST_FEATURES],
219
230
  };
220
231
  export const DEFINITION_SCHEMA_VERSION = 2;
@@ -277,15 +288,15 @@ export const ERROR_CODES = [
277
288
  */
278
289
  "queue_full",
279
290
  /**
280
- * `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed
281
- * (track T4): `409`. Save a manifest version with a new time.
291
+ * `POST /v1/agents/{id}/triggers/{triggerId}/resume` on an `at` trigger whose time has passed:
292
+ * `409`. Save a manifest version with a new time.
282
293
  */
283
294
  "trigger_expired",
284
- /** A signed delivery to a paused webhook trigger (D75): `409`; nothing runs. */
295
+ /** A signed delivery to a paused webhook trigger: `409`; nothing runs. */
285
296
  "trigger_paused",
286
297
  /**
287
298
  * A memory write whose `content_sha256` precondition no longer holds, or a path a folder or
288
- * another memory already holds (track T5, D72): `409`. Read the memory again and write on top.
299
+ * another memory already holds: `409`. Read the memory again and write on top.
289
300
  */
290
301
  "memory_conflict",
291
302
  /** Disk work (snapshot, restore, stop, reset) while a turn runs, or a turn while a disk copy runs. */
@@ -302,9 +313,9 @@ export const ERROR_CODES = [
302
313
  */
303
314
  "agent_owner_mismatch",
304
315
  /**
305
- * The session's Environment runs another harness than the one the session pinned when it
306
- * opened (track R4): its id was deleted and made again with another harness, or an
307
- * Environment changed in place before protocol 14 applied that change. Open a new session.
316
+ * The session's Agent runs another harness than the one the session pinned when it opened: an
317
+ * Agent's harness is fixed for its life, so its id was deleted and made again from a manifest
318
+ * with another harness. Open a new session.
308
319
  */
309
320
  "harness_mismatch",
310
321
  /**
@@ -318,36 +329,36 @@ export const ERROR_CODES = [
318
329
  */
319
330
  "issuer_unavailable",
320
331
  /**
321
- * A definition names definition files the Runtime does not hold (track R2 M4): upload each
332
+ * A definition names definition files the Runtime does not hold: upload each
322
333
  * with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
323
334
  */
324
335
  "definition_files_missing",
325
336
  /**
326
337
  * Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
327
- * answered `401` (R2b C1). The vault's credential (or none) was rejected; the call is not retried.
338
+ * answered `401`. The vault's credential (or none) was rejected; the call is not retried.
328
339
  */
329
340
  "credential_rejected",
330
341
  /**
331
- * `POST /v1/tenant/mcp/preview` could not list the server's tools (R2b C12): `502`, with
342
+ * `POST /v1/tenant/mcp/preview` could not list the server's tools: `502`, with
332
343
  * `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
333
344
  * address the Host refuses, a connection that failed or a server silent past 15 s;
334
345
  * `mcp.forbidden`, `mcp.status`, `mcp.error`).
335
346
  */
336
347
  "mcp_preview_failed",
337
348
  /**
338
- * An Environment's credentials would be ambiguous (R2c, D56): `409` at the secret write. Two
349
+ * An Environment's credentials would be ambiguous: `409` at the secret write. Two
339
350
  * `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
340
351
  * credentials to one URL.
341
352
  */
342
353
  "credential_conflict",
343
354
  /**
344
- * A move of an existing Agent (`PUT /v1/agents/{id}`, track T3) would change what is fixed for
345
- * its life: its manifest's name, its kind, its harness or its storage (D73). `409`, with each in
355
+ * A move of an existing Agent (`PUT /v1/agents/{id}`) would change what is fixed for
356
+ * its life: its manifest's name, its kind, its harness or its storage. `409`, with each in
346
357
  * `details.fields`. Fork it into a new Agent (`POST /v1/agents/{id}/fork`) instead.
347
358
  */
348
359
  "agent_fixed_field",
349
360
  /**
350
- * A secret write named a secret the Agent's manifest does not declare (D64): `409`. Add the
361
+ * A secret write named a secret the Agent's manifest does not declare: `409`. Add the
351
362
  * slot to the manifest's runtime section and move the Agent to the new version.
352
363
  */
353
364
  "secret_not_in_manifest",
@@ -362,7 +373,7 @@ export const ERROR_CODES = [
362
373
  /** An agent manifest some Agent was made from cannot be deleted: `409`. */
363
374
  "manifest_in_use",
364
375
  /**
365
- * `If-Match` named a version that is no longer the latest (D63): `412`. Read the manifest
376
+ * `If-Match` named a version that is no longer the latest: `412`. Read the manifest
366
377
  * again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
367
378
  */
368
379
  "manifest_changed",
@@ -379,7 +390,7 @@ export const ARTIFACT_ID_PATTERN = /^af_[0-9a-hjkmnp-tv-z]{26}$/;
379
390
  /**
380
391
  * An application key's id: an operator key's name, which names its client (e.g. `backend`).
381
392
  * `studio` is reserved for the key Studio derives from the admin key.
382
- * An identifier's grammar is the protocol's (B15): it crosses the Runtime API, tokens and grants
393
+ * An identifier's grammar is the protocol's: it crosses the Runtime API, tokens and grants
383
394
  * and means the same in every installation, so its length is a constant of protocol 15, not a
384
395
  * setting.
385
396
  */