@nylorun/core 0.23.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 (67) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/compatibility.d.ts +127 -59
  3. package/dist/compatibility.js +128 -60
  4. package/dist/contracts.d.ts +2413 -893
  5. package/dist/contracts.js +1144 -491
  6. package/dist/define.d.ts +1 -0
  7. package/dist/define.js +1 -0
  8. package/dist/definition/approval.d.ts +1 -1
  9. package/dist/definition/bound.d.ts +2 -0
  10. package/dist/definition/builder.d.ts +2 -2
  11. package/dist/definition/builder.js +1 -1
  12. package/dist/definition/code-tools.d.ts +1 -1
  13. package/dist/definition/declaration.js +3 -0
  14. package/dist/definition/delegate.d.ts +1 -1
  15. package/dist/definition/delegate.js +1 -1
  16. package/dist/definition/from.d.ts +2 -2
  17. package/dist/definition/from.js +1 -1
  18. package/dist/definition/http-tool.d.ts +3 -3
  19. package/dist/definition/mcp.d.ts +4 -4
  20. package/dist/definition/mcp.js +3 -3
  21. package/dist/definition/removed.d.ts +7 -0
  22. package/dist/definition/removed.js +21 -1
  23. package/dist/definition/sections.d.ts +64 -0
  24. package/dist/definition/sections.js +227 -0
  25. package/dist/definition/variant.d.ts +1 -1
  26. package/dist/definition/variant.js +4 -4
  27. package/dist/harness-api/entries.d.ts +1 -1
  28. package/dist/harness-api/entries.js +1 -1
  29. package/dist/harness-api/gates.d.ts +1 -1
  30. package/dist/harness-api/gates.js +1 -1
  31. package/dist/harness-api/harness-api.schema.json +182 -6
  32. package/dist/harness-api/index.d.ts +3 -3
  33. package/dist/harness-api/index.js +3 -3
  34. package/dist/harness-api/json-schema.d.ts +1 -1
  35. package/dist/harness-api/json-schema.js +3 -3
  36. package/dist/harness-api/mcp.js +1 -1
  37. package/dist/harness-api/messages.d.ts +10 -8
  38. package/dist/harness-api/messages.js +1 -1
  39. package/dist/harness-api/schema.d.ts +82 -13
  40. package/dist/harness-api/schema.js +63 -19
  41. package/dist/harness-api/transcript.d.ts +1 -1
  42. package/dist/harness-api/transport.d.ts +1 -1
  43. package/dist/harness-api/transport.js +1 -1
  44. package/dist/manifest-schemas.d.ts +9 -5
  45. package/dist/manifest-schemas.js +24 -27
  46. package/dist/schemas/agent-manifest.schema.json +1534 -250
  47. package/dist/schemas/harness-manifest.schema.json +1273 -0
  48. package/dist/schemas/{environment-manifest.schema.json → runtime-manifest.schema.json} +109 -68
  49. package/dist/types/manifest.d.ts +87 -15
  50. package/dist/types/manifest.js +4 -0
  51. package/dist/types/model.d.ts +5 -0
  52. package/dist/types/observe.d.ts +1 -1
  53. package/dist/types/part.d.ts +5 -0
  54. package/dist/types/tool.d.ts +4 -4
  55. package/dist/utils/definition-files.d.ts +3 -2
  56. package/dist/utils/definition-files.js +4 -3
  57. package/dist/utils/file-systems.d.ts +1 -1
  58. package/dist/utils/file-systems.js +1 -1
  59. package/dist/utils/harness-id.d.ts +1 -1
  60. package/dist/utils/harness-id.js +1 -1
  61. package/dist/utils/memory.d.ts +64 -0
  62. package/dist/utils/memory.js +139 -0
  63. package/dist/utils/runtime-limits.d.ts +55 -4
  64. package/dist/utils/runtime-limits.js +106 -3
  65. package/dist/utils/runtime-tools.d.ts +3 -3
  66. package/dist/utils/runtime-tools.js +3 -3
  67. package/package.json +6 -5
@@ -1,5 +1,41 @@
1
1
  export { hashManifest } from "./utils/hash.js";
2
2
  /**
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,
9
+ * or while it waits on an approval, an answer or an uncertain call, is queued
10
+ * (`{status: "queued", queuedMessageId, position}`, `message.queued`) instead of refused, unless
11
+ * it asks `delivery: "reject"`; the refusal now has a code, `409 session_busy`. When the turn ends
12
+ * (completed, failed or cancelled), every queued message starts one turn, in order, each its own
13
+ * user message (`queue.taken`); our engine's turn input for more than one is
14
+ * `{kind: "messages", messages}` (Harness API 5, additive). Past the Runtime limit
15
+ * `sessionQueuedMessages` a message is `429 queue_full`. Session reads count `queuedMessages`. The
16
+ * Host serves protocol 16 and 17: a message from a protocol 16 client is `reject` unless it says
17
+ * otherwise, so its sessions answer `409` as before.
18
+ * Protocol 16: Agents from one manifest, a fresh start. An agent manifest (v8) is one
19
+ * versioned document at `/v1/agent-manifests/{name}` with a `harness` section (what runs inside
20
+ * the loop, including the harness's id) and a `runtime` section (what an environment manifest
21
+ * said); the Runtime checks the two against each other when it is saved
22
+ * (`422 manifest_inconsistent`), so `requires` and `409 environment_unsuitable` are gone, and so
23
+ * are agent definitions (`PUT /v1/agents/:id` with a v7 manifest) and environment manifests.
24
+ * Environments are Agents: `/v1/agents/{id}` (with `.../events`, `stop`, `reset`, `snapshot`,
25
+ * `restore`, `versions`, `fork` and `secrets`) is made from a saved manifest only, records it as
26
+ * tracking (`name`) or pinned (`name@n`) into `resolvedVersion`, the version it runs. An Agent
27
+ * evolves: a `PUT` naming another version of its manifest moves it (`dryRun`
28
+ * answers the plan), a save moves every Agent that tracks the manifest, and each turn takes the
29
+ * version its Agent runs when it starts; a runtime change waits for a pod's next start, and its
30
+ * kind, harness and storage are fixed (`409 agent_fixed_field`). Reads add `state`
31
+ * (`working`, `sleeping`, `input_required`, `failing`, `paused`) and `attention`, and the
32
+ * compute's state moves to `compute.state`. Every session belongs to one Agent:
33
+ * `PUT /v1/sessions/{id}` takes `{ agent, ownerUserId, info }` and pins the manifest version its
34
+ * Agent runs; no session is special. Error codes, event types (`agent.*`), the scopes
35
+ * (`agents:write`, `agent-manifests:write`) and identity-file grants (`agents`) say Agent. Model
36
+ * budget scope `agent` is `manifest`. Harness API 5: `turn.start.agent` replaces
37
+ * `turn.start.environment`. Sessions opened before protocol 16 are closed (`protocol_16`) and
38
+ * stay readable; Environments, their disks and vaults are gone. The Host serves protocol 16 only.
3
39
  * Protocol 15: the harness boundary, a fresh start. Model-facing work belongs to the harness. Our
4
40
  * engine's `read_artifact` and `save_artifact` run in our harness, over the Harness API's new
5
41
  * artifact seam (`artifact.read`, `artifact.write`; Harness API 4), so a session's pinned
@@ -16,7 +52,7 @@ export { hashManifest } from "./utils/hash.js";
16
52
  * key on (a policy rule with `__` in its `tool` refuses every call). The record refuses an
17
53
  * outcome past `limits.recordEntryBytes`. Sessions pinned before protocol 15 must be recreated.
18
54
  * The Host serves protocol 15 only.
19
- * Protocol 14: environment manifests (D63 to D65). `/v1/environment-manifests/{name}` holds
55
+ * Protocol 14: environment manifests. `/v1/environment-manifests/{name}` holds
20
56
  * named, versioned definitions of a kind of Environment, saved like agents (with `If-Match` and
21
57
  * `?dryRun=true`), and `PUT /v1/environments/{id}` takes `manifest: "name"` or `"name@n"`. An
22
58
  * Environment never changes what it runs after creation: a `PUT` on an existing one may change
@@ -24,10 +60,10 @@ export { hashManifest } from "./utils/hash.js";
24
60
  * `manifest`. A manifest's `secrets` declares slots: a write sends only the value, and a name it
25
61
  * does not declare is `409 secret_not_in_manifest`. An agent manifest's `requires` is checked
26
62
  * when a session opens (`409 environment_unsuitable`). Sessions on one Environment run their
27
- * 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
28
64
  * session's turn runs, and every egress connection is an `environment.egress` event on the
29
65
  * Environment's stream naming the turns that were running; `egress.connection` is gone from
30
- * session logs and traces (D67). The Host serves protocol 14 only.
66
+ * session logs and traces. The Host serves protocol 14 only.
31
67
  * Protocol 13: the flat agent manifest (v7), a fresh start. A manifest has no capabilities: its
32
68
  * instructions, tools, skills and MCP servers are top-level, and a skill or server from an Agent
33
69
  * Plugin carries a `plugin` label. A session's pinned manifest carries the Runtime's `runtime`
@@ -41,7 +77,7 @@ export { hashManifest } from "./utils/hash.js";
41
77
  * accept (`422 attachment_unsupported`), with no turn. After its turn a file is a reference line
42
78
  * the model reads again with `read_artifact`, which every agent now has. The Host accepts
43
79
  * protocol 11 and 12: the change is additive.
44
- * Protocol 11: Environments (R2d, D55, D56), a fresh start. `/v1/environments/{id}` replaces
80
+ * Protocol 11: Environments, a fresh start. `/v1/environments/{id}` replaces
45
81
  * `/v1/sandboxes`: an Environment is one sandbox (kind `virtual`, `pod` or `none`) with a recipe
46
82
  * that can change and one vault, written on the Runtime API
47
83
  * (`PUT /v1/environments/{id}/secrets/{name}`). Sessions name an `environment` or nothing; the
@@ -49,7 +85,7 @@ export { hashManifest } from "./utils/hash.js";
49
85
  * user and installation vaults and `/v1/tenant/vaults` are gone. Error codes, event types, the
50
86
  * scope (`environments:write`) and identity-file grants (`environments`) say Environment. An
51
87
  * older client is answered `426`.
52
- * 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
53
89
  * MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
54
90
  * credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
55
91
  * through its attached vaults only.
@@ -58,12 +94,12 @@ export { hashManifest } from "./utils/hash.js";
58
94
  * `WWW-Authenticate: Bearer` challenge instead of the opaque 404, a token missing a scope gets
59
95
  * `error="insufficient_scope"`, and `GET /.well-known/oauth-protected-resource` names the trusted
60
96
  * issuers. Identity files lose `maxLifetime`: the issuer sets its tokens' lifetimes.
61
- * Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents
62
- * (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
63
99
  * only, and no Action endpoints (`/v1/endpoints` and `/v1/actions/*` answer 404, delivery
64
100
  * tokens are gone): an agent's tools are HTTP tools, remote MCP servers, agents and the
65
101
  * Runtime's built-ins.
66
- * 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,
67
103
  * revocations, browser keys (`Nylorun-Key`), the Runtime's own CORS and derived principals are gone; their
68
104
  * routes answer 404. Browsers and apps present a trusted issuer's token, servers an operator key.
69
105
  * Protocol 6: file artifacts (`/v1/artifacts/**`, Runtime-signed capability links) and user
@@ -71,7 +107,7 @@ export { hashManifest } from "./utils/hash.js";
71
107
  * it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
72
108
  * that remains; a client that requires `action-endpoints` is refused by the feature check.
73
109
  */
74
- export const PROTOCOL_VERSION = 15;
110
+ export const PROTOCOL_VERSION = 18;
75
111
  /** What a client of this protocol requires of a Host. */
76
112
  export const PROTOCOL_FEATURES = [
77
113
  "studio-principal",
@@ -88,13 +124,6 @@ export const PROTOCOL_FEATURES = [
88
124
  * metadata at `/.well-known/oauth-protected-resource` when it has trusted issuers.
89
125
  */
90
126
  "resource-server",
91
- /**
92
- * Protocol 11: Environments (`/v1/environments/{id}`, kinds `virtual`, `pod` and `none`), each
93
- * with one vault written on the Runtime API; sessions name an `environment`; token callers
94
- * carry Environment grants checked at every turn start, and `environments:write` lets a
95
- * subject create, change and delete the Environments it is granted.
96
- */
97
- "environments",
98
127
  /** Protocol 12: the model catalog and provider list say which inputs each model reads. */
99
128
  "model-inputs",
100
129
  /**
@@ -103,12 +132,6 @@ export const PROTOCOL_FEATURES = [
103
132
  * block, and tool calls, MCP servers and HTTP calls are named without capability ids.
104
133
  */
105
134
  "flat-manifest",
106
- /**
107
- * Protocol 14: environment manifests (`/v1/environment-manifests/{name}`), Environments made
108
- * from one version and never changed after creation, secret slots, and an agent manifest's
109
- * `requires`, checked when a session opens.
110
- */
111
- "environment-manifests",
112
135
  /**
113
136
  * Protocol 15: the harness boundary. `read_artifact` and `save_artifact` are our harness's
114
137
  * tools, not the Runtime's: a session's pinned `runtime` block no longer carries them, and an
@@ -116,6 +139,25 @@ export const PROTOCOL_FEATURES = [
116
139
  * `{server, tool}`: tool policy rules and approvals name them so.
117
140
  */
118
141
  "harness-boundary",
142
+ /**
143
+ * Protocol 16: agent manifests (`/v1/agent-manifests/{name}`, v8, with a harness and a runtime
144
+ * section checked against each other at save) and Agents (`/v1/agents/{id}`, kinds `virtual`,
145
+ * `pod` and `none`, each with one vault), made from one manifest version, with a derived
146
+ * `state`; every session runs on an Agent; token callers carry Agent grants checked at every
147
+ * turn start, and `agents:write` lets a subject create, change and delete the Agents it is
148
+ * granted.
149
+ */
150
+ "agents",
151
+ /**
152
+ * Protocol 17: a queue per session. A message to a busy session is queued unless it asks
153
+ * `delivery: "reject"`, and the busy refusal is `409 session_busy`.
154
+ */
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",
119
161
  ];
120
162
  /**
121
163
  * Host features no client requires: a client that uses one checks the Host's `/health`
@@ -144,14 +186,14 @@ export const PROTOCOL_FEATURES = [
144
186
  * `credential-coverage`: `POST /v1/tenant/credential-coverage` (the Management API) says which
145
187
  * credential of an Environment's vault each of a saved agent's MCP servers and HTTP tools would
146
188
  * get in a session that names that Environment.
147
- * `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
148
190
  * effect journal, every `tool.completed` says how its call ended (`status`, `kind`, `server`,
149
191
  * `attempts`, `durationMs`), and tool calls are delivered at least once with their effect id as
150
192
  * the key (`Idempotency-Key` for HTTP tools, `_meta["nylorun/idempotency-key"]` for MCP tools).
151
- * `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
152
194
  * MCP and HTTP tool calls run, wait for a person (`ask`: the turn pauses until `approve`) or are
153
195
  * refused (`deny`: `tool.denied`), for every harness; a manifest that sets `approval` is refused.
154
- * `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,
155
197
  * the spans the Runtime posts to an OTLP collector when one is configured; a command or an AG-UI
156
198
  * or A2A request sent with a `traceparent` joins the caller's trace.
157
199
  */
@@ -175,13 +217,15 @@ export const OPTIONAL_HOST_FEATURES = [
175
217
  "artifact-reads",
176
218
  ];
177
219
  /**
178
- * What this Host serves: protocol 15. Protocol 15 changed what a session's pinned manifest
179
- * carries and which tool names are reserved, so an older client is answered `426` naming the
180
- * protocol it needs rather than a turn it cannot read.
220
+ * What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
221
+ * Environments with agent manifests and Agents, so an older client is answered `426` naming the
222
+ * protocol it needs rather than routes it cannot use. Protocol 17 is additive: a protocol 16
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.
181
225
  */
182
226
  export const HOST_PROTOCOL = {
183
- min: 15,
184
- max: 15,
227
+ min: 16,
228
+ max: 18,
185
229
  features: [...PROTOCOL_FEATURES, ...OPTIONAL_HOST_FEATURES],
186
230
  };
187
231
  export const DEFINITION_SCHEMA_VERSION = 2;
@@ -230,25 +274,48 @@ export const ERROR_CODES = [
230
274
  "invalid_request",
231
275
  /** A route that acts for a person was called without one (`Nylorun-Subject`). */
232
276
  "subject_required",
233
- /** A token caller's Environment grants do not reach the Environment. */
234
- "environment_not_granted",
277
+ /** A token caller's Agent grants do not reach the Agent. */
278
+ "agent_not_granted",
279
+ /**
280
+ * A message to a session whose turn runs, or that waits on an approval, an answer or an
281
+ * uncertain call, sent with `delivery: "reject"` (protocol 17): `409`. Without it the message is
282
+ * queued.
283
+ */
284
+ "session_busy",
285
+ /**
286
+ * The session already holds the Runtime limit `sessionQueuedMessages` queued messages
287
+ * (protocol 17): `429`. They start a turn when the running one ends.
288
+ */
289
+ "queue_full",
290
+ /**
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.
293
+ */
294
+ "trigger_expired",
295
+ /** A signed delivery to a paused webhook trigger: `409`; nothing runs. */
296
+ "trigger_paused",
297
+ /**
298
+ * A memory write whose `content_sha256` precondition no longer holds, or a path a folder or
299
+ * another memory already holds: `409`. Read the memory again and write on top.
300
+ */
301
+ "memory_conflict",
235
302
  /** Disk work (snapshot, restore, stop, reset) while a turn runs, or a turn while a disk copy runs. */
236
- "environment_busy",
237
- /** The Environment is gone, or its kind cannot run on this Runtime. */
238
- "environment_unavailable",
239
- /** The Tenant's placement keeps this session's harness off the host its Environment needs. */
303
+ "agent_busy",
304
+ /** The Agent is gone, or its kind cannot run on this Runtime. */
305
+ "agent_unavailable",
306
+ /** The Tenant's placement keeps this session's harness off the host its Agent needs. */
240
307
  "placement_refused",
241
- /** A pod Environment's volume or node is gone: only `POST /v1/environments/{id}/reset` brings it back. */
242
- "environment_lost",
308
+ /** A pod Agent's volume or node is gone: only `POST /v1/agents/{id}/reset` brings it back. */
309
+ "agent_lost",
243
310
  /**
244
- * The Environment names an owner (`ownerUserId`) other than the session's owner: `403` to an
311
+ * The Agent names an owner (`owner`) other than the session's owner: `403` to an
245
312
  * application key; a caller acting for a person gets the opaque `404`.
246
313
  */
247
- "environment_owner_mismatch",
314
+ "agent_owner_mismatch",
248
315
  /**
249
- * The session's Environment runs another harness than the one the session pinned when it
250
- * opened (track R4): its id was deleted and made again with another harness, or an
251
- * 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.
252
319
  */
253
320
  "harness_mismatch",
254
321
  /**
@@ -262,50 +329,51 @@ export const ERROR_CODES = [
262
329
  */
263
330
  "issuer_unavailable",
264
331
  /**
265
- * 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
266
333
  * with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
267
334
  */
268
335
  "definition_files_missing",
269
336
  /**
270
337
  * Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
271
- * 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.
272
339
  */
273
340
  "credential_rejected",
274
341
  /**
275
- * `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
276
343
  * `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
277
344
  * address the Host refuses, a connection that failed or a server silent past 15 s;
278
345
  * `mcp.forbidden`, `mcp.status`, `mcp.error`).
279
346
  */
280
347
  "mcp_preview_failed",
281
348
  /**
282
- * 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
283
350
  * `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
284
351
  * credentials to one URL.
285
352
  */
286
353
  "credential_conflict",
287
354
  /**
288
- * A `PUT /v1/environments/{id}` asked an existing Environment to run something else
289
- * (protocol 14, D63): only its labels and owner guard may change. Fork it into a new
290
- * Environment (`POST /v1/environments/{id}/fork`). `details.fields` names what differed.
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
357
+ * `details.fields`. Fork it into a new Agent (`POST /v1/agents/{id}/fork`) instead.
291
358
  */
292
- "environment_immutable",
359
+ "agent_fixed_field",
293
360
  /**
294
- * A secret write named a secret the Environment's manifest does not declare (D64): `409`.
295
- * Add the slot to the manifest and make or fork an Environment from the new version.
361
+ * A secret write named a secret the Agent's manifest does not declare: `409`. Add the
362
+ * slot to the manifest's runtime section and move the Agent to the new version.
296
363
  */
297
364
  "secret_not_in_manifest",
298
365
  /**
299
- * A session's agent requires what its Environment lacks (D65): `409` when the session opens.
300
- * `details.missing` lists each gap (`sandbox`, `pod`, or `secret:<name>`).
366
+ * An agent manifest whose harness and runtime sections do not fit each other (protocol 16):
367
+ * `422` when it is saved. `details.gaps` names each gap: a custom harness off a pod, a
368
+ * credential that is no declared slot of the right type, a sandbox the runtime does not give.
301
369
  */
302
- "environment_unsuitable",
303
- /** No environment manifest has this name, or no version with this number. */
370
+ "manifest_inconsistent",
371
+ /** No agent manifest has this name, or no version with this number. */
304
372
  "manifest_not_found",
305
- /** An environment manifest some Environment was made from cannot be deleted: `409`. */
373
+ /** An agent manifest some Agent was made from cannot be deleted: `409`. */
306
374
  "manifest_in_use",
307
375
  /**
308
- * `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
309
377
  * again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
310
378
  */
311
379
  "manifest_changed",
@@ -322,7 +390,7 @@ export const ARTIFACT_ID_PATTERN = /^af_[0-9a-hjkmnp-tv-z]{26}$/;
322
390
  /**
323
391
  * An application key's id: an operator key's name, which names its client (e.g. `backend`).
324
392
  * `studio` is reserved for the key Studio derives from the admin key.
325
- * 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
326
394
  * and means the same in every installation, so its length is a constant of protocol 15, not a
327
395
  * setting.
328
396
  */