@nylorun/core 0.19.0-beta → 0.20.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 +115 -0
- package/dist/compatibility.d.ts +74 -32
- package/dist/compatibility.js +80 -33
- package/dist/contracts.d.ts +1496 -495
- package/dist/contracts.js +889 -374
- package/dist/define.d.ts +1 -0
- package/dist/define.js +1 -0
- package/dist/definition/approval.d.ts +16 -0
- package/dist/definition/approval.js +35 -0
- package/dist/definition/code-tools.d.ts +1 -1
- package/dist/definition/code-tools.js +1 -1
- package/dist/definition/flow/compile.js +0 -2
- package/dist/definition/http-tool.d.ts +7 -4
- package/dist/definition/http-tool.js +6 -10
- package/dist/definition/manifest.js +1 -0
- package/dist/definition/mcp.d.ts +4 -4
- package/dist/definition/mcp.js +15 -12
- package/dist/definition/removed.js +1 -1
- package/dist/definition/variant.d.ts +1 -1
- package/dist/definition/variant.js +6 -5
- package/dist/harness-api/entries.d.ts +241 -0
- package/dist/harness-api/entries.js +117 -0
- package/dist/harness-api/gates.d.ts +172 -0
- package/dist/harness-api/gates.js +119 -0
- package/dist/harness-api/harness-api.schema.json +5056 -0
- package/dist/harness-api/index.d.ts +19 -3
- package/dist/harness-api/index.js +16 -3
- package/dist/harness-api/json-schema.d.ts +12 -0
- package/dist/harness-api/json-schema.js +61 -0
- package/dist/harness-api/mcp.d.ts +61 -0
- package/dist/harness-api/mcp.js +41 -0
- package/dist/harness-api/messages.d.ts +12 -4
- package/dist/harness-api/messages.js +6 -2
- package/dist/harness-api/schema.d.ts +353 -31
- package/dist/harness-api/schema.js +138 -20
- package/dist/harness-api/transport.d.ts +55 -0
- package/dist/harness-api/transport.js +61 -0
- package/dist/types/manifest.d.ts +15 -9
- package/dist/types/observe.d.ts +3 -2
- package/dist/utils/harness-id.d.ts +9 -0
- package/dist/utils/harness-id.js +11 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,120 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.20.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e917bd6: **Bring your own harness: harness ids, harness-owned state, and who wrote each event (R4.1, R4.2, R4.4, R4.9).**
|
|
8
|
+
|
|
9
|
+
- **Harness ids and routing.** An Environment's `harness` takes any harness id (`^[a-z][a-z0-9-]{1,62}$`). It is no longer only `nylorun`.
|
|
10
|
+
- **The pin.** A session pins its harness when it opens: its Environment's harness, else `nylorun`. A flow always runs `nylorun`. `GET /v1/sessions/{id}` returns the pin as `harness`.
|
|
11
|
+
- **Routing.** Only a connection whose `hello.name` is that id takes the session's runs.
|
|
12
|
+
- **Our harness's name.** It now says `nylorun` in `hello`. A harness that says `@nylorun/harness` is refused with a message naming the new id, so an older harness image needs this Runtime's.
|
|
13
|
+
- **Placement.** It is keyed by the real harness id, and `"*": {hosts: []}` refuses any harness the map does not name.
|
|
14
|
+
- **Drift.** A turn on an Environment that now runs another harness is `409 harness_mismatch`; open a new session. For a pod Environment, a changed `harness` applies at the pod's next wake, like its image.
|
|
15
|
+
- **Per-harness tokens.** `nylorun-operate harness token put <id>` makes a custom harness container's own Harness API credential, bound to its id; `list` and `rm` manage them. `NYLORUN_HARNESS_TOKEN` stays ours, bound to `nylorun`.
|
|
16
|
+
- **A custom harness as a pod's image.** A pod Environment whose harness is not ours runs its `image` as the harness: the image's own entrypoint (`entrypoint: "image"` to the sandboxes service), with nothing copied in. It needs `image`.
|
|
17
|
+
- **Harness-owned state.** Core stores a harness's turn state as sent and never reads it. Our engine now aligns its state with the turn's manifest itself.
|
|
18
|
+
- **Limits for a custom harness.** Its state is at most 256 KiB, or its turn fails. It cannot pause for approvals in Harness API 2.
|
|
19
|
+
- **Native tools.** It may declare the tools it runs itself in `hello` (`capabilities.tools`). Their calls (capability `harness`) are journaled like built-ins, and the log records a real `tool.completed` instead of `tool.unavailable`.
|
|
20
|
+
- **Who wrote each event.** The writer sets an event's `source` and `evidence`; the event's type no longer decides them. Events written before this release still say `loop` or `api`.
|
|
21
|
+
- **`client`**: a command, with a new `principal` taken from its credential.
|
|
22
|
+
- **`harness`**: what a harness reported, with its harness id and `runId`. Evidence `claimed`.
|
|
23
|
+
- **`core`**: core's own logic. Evidence `observed`.
|
|
24
|
+
- **`effectId` on model calls.** `GET /v1/sessions/{id}/calls/model` returns each call's `effectId`, so a metered call joins the effect journal.
|
|
25
|
+
- **The published contract grows.** It adds `HarnessCheckpointSchema` (the checkpoint fields a harness reads), `NativeToolSchema`, the harness id helpers, `HARNESS_TOOLS_CAPABILITY`, `MAX_HARNESS_STATE_BYTES`, and the gate error codes `key_required` and `effect_not_journaled`. It also documents the effect context keys, the model request hash rule and how a turn's status maps to its output method.
|
|
26
|
+
|
|
27
|
+
- 5165451: **A pod's disk can start prepared, and every Environment's disk has versions (R2d steps 2 and 3).** Before, a new pod volume was empty and a disk could only be kept or reset. Now:
|
|
28
|
+
|
|
29
|
+
- **Setup and input files** (pods, Host feature `environment-setup`): `PUT /v1/environments/{id}` takes `files` (versions of Tenant-wide artifacts, copied in: a file at its `path`, a folder under it) and `setup` (commands run in order with `/bin/sh -c`, `cwd` default `/workspace`, `timeout` default 10m and at most 30m, at most 16 of each). They run once per new disk, after the pod's engine joins and before its first turn, with the Environment's variables, secrets (as the sentinel) and egress. A failed command fails the pod (`observed: failed`, reason `setup: command N …`, an `environment.failed` event with the exit code and the end of the output) and the turn waiting for it; the next turn start runs the setup again. A virtual Environment refuses both with a `400`.
|
|
30
|
+
- **Disk versions** (Host feature `environment-disk-versions`): `POST /v1/environments/{id}/snapshot` keeps a version of the disk between turns (`/workspace`, and a pod's `/harness` but the engine's own files) as a version of a folder artifact the Environment owns, with modes, modification times, links and empty directories (folder manifest `nylorun.folder.v2`); each file's bytes are stored once, and an unchanged disk makes no version. `POST .../restore` puts a version back: a virtual Environment at once, a pod on a new volume seeded before its next turn (`disk.operation` in the view meanwhile; turns wait). `PUT` with `from: { environment, version }` creates an Environment from another's version. `GET .../versions` and `DELETE .../versions/{n}` list and delete them; their trees, files, diffs and zips read through `/v1/artifacts`. A lost pod volume with a version is recovered from the latest one instead of refusing turns until a reset. Snapshot and restore during a turn are `409 environment_busy`. `EnvironmentView.disk` gives the latest version and the copy in progress. Migration `0021_disk_versions`.
|
|
31
|
+
- `@nylorun/agents`: `client.environments.snapshot`, `restore`, `versions` and `deleteVersion`; `put` takes `setup`, `files` and `from`.
|
|
32
|
+
|
|
33
|
+
- 35e29b7: **Environments replace sandboxes and vaults (protocol 11). This is a fresh start: upgrading deletes your sandboxes, their disks and every vault except the model's, and closes every open session (its history stays readable).** List what you have before upgrading; see "Environments replace sandboxes and vaults" in MIGRATION.md.
|
|
34
|
+
|
|
35
|
+
An Environment is where sessions run: one sandbox (kind `virtual`, `pod` or `none`) with a recipe that can change, and one vault of secrets for its shell, MCP servers and HTTP tools. The app decides who uses which Environment; the Runtime keeps it by id and holds its lifecycle.
|
|
36
|
+
|
|
37
|
+
- `@nylorun/core`: protocol 11 (the Host accepts 11 only; older clients get `426`), required feature `environments`. `PutEnvironmentRequestSchema`, `EnvironmentViewSchema` (`recipe`, `version`, `appliedVersion`, `ownerUserId`, `lastUsedAt`), `PutEnvironmentSecretRequestSchema`, `EnvironmentSecretViewSchema`, `ENVIRONMENT_EVENT_TYPES`, `TenantEnvironmentsConfigSchema`, `environmentGranted`. `PutSessionRequest.environment` replaces `sandbox`, `vaultIds` and `credentialSelections`; `SessionView.environment` replaces the session's sandbox and vault fields. Error codes `environment_busy`, `environment_unavailable`, `environment_lost`, `environment_not_granted`, `environment_owner_mismatch` and `session_closed` (the `sandbox_*` codes and `sandbox_expired` are gone); session events `environment.state`, `environment.exec` and `environment.attached`; scope `environments:write`. Credential coverage takes `environmentId` and answers `covered` or `missing`; the MCP preview takes `environmentId`. The vault Management schemas are removed.
|
|
38
|
+
- `@nylorun/runtime`: `/v1/environments/{id}` replaces `/v1/sandboxes/{id}`: `PUT` creates, finds or changes one (`kind` and `storage` fixed; a recipe change bumps `version`; a pod gets a new image or resources at its next start from stopped, a new allowlist within seconds), with list by label, events (`nylorun.environment-event/1`), stop, reset and delete. Each Environment owns one vault: `PUT|GET|DELETE /v1/environments/{id}/secrets/{name}` on the Runtime API, write-only, with a second credential for a host or URL refused at the write (`409 credential_conflict`). An optional owner guard (`ownerUserId`) is checked when a session opens and at every turn start. `lifecycle.deleteAfter` deletes an Environment unused that long; TTL and `onExpiry` are gone. Kind `none` holds secrets for MCP-only agents. `/v1/tenant/vaults`, user and installation vaults, the Tenant's default sandbox, inline sandboxes and `{ session }` sharing are removed. The Tenant setting is `environments.config` (`limits.environments`). Identity files grant `environments:` (an old `sandboxes:` key, or `sandboxes:write`, stops the Runtime with a message naming the new key). Migration `0020_environments`.
|
|
39
|
+
- `@nylorun/harness`: the Harness API claims `environment.state` and `environment.exec`, and its workspace fields name `environmentId`.
|
|
40
|
+
- `@nylorun/agents`: `client.environments` (`put`, `get`, `list`, `page`, `stop`, `reset`, `delete`, `events`, `secrets.put|list|get|delete`, `forSession`) replaces `client.sandboxes`; `createSession({ environment })`; `sessions.page({ environmentId })` filters by Environment. The AG-UI handler's session options take `environment`.
|
|
41
|
+
- `@nylorun/admin`: `admin.coverage({ agentId, environmentId })` replaces `admin.vaults`; `admin.mcp.preview({ url, environmentId })`.
|
|
42
|
+
- `@nylorun/studio`: Environments replace Sandboxes, with a create form, stop, reset, delete and their secrets; the Credentials forms write an Environment's secrets; New session picks an Environment and shows its coverage.
|
|
43
|
+
- `nylorun`: `nylorun sandbox ls|rm` list and delete Environments; `nylorun mcp inspect --environment <id>` replaces `--vault`; `nylo reset --environments` replaces `--sandboxes`; `nylo doctor sandbox` reports the Environment limits.
|
|
44
|
+
|
|
45
|
+
- e917bd6: **The Harness API is a published contract (R4.5).** Everything a harness sends or reads now has a schema in `@nylorun/core/harness-api`, and the Runtime validates with those same schemas:
|
|
46
|
+
- the transport and the pod join (`HARNESS_API_PATH`, `HARNESS_API_HEADER`, `HOST_JOIN_PATH`, `HostJoinRequestSchema`, `HostJoinAnswerSchema`);
|
|
47
|
+
- the Model and Tool Gate bodies (`ModelCallBodySchema`, `ToolCallBodySchema`, `HttpCallBodySchema`, the MCP bodies, `GATE_ERROR_CODES`);
|
|
48
|
+
- the MCP snapshot (`McpSnapshotSchema`);
|
|
49
|
+
- transcript entries (`TranscriptEntrySchema`);
|
|
50
|
+
- the effect id rule (`effectIdOf`, `isEffectIdOf`).
|
|
51
|
+
|
|
52
|
+
The build also writes them as one JSON Schema document, `@nylorun/core/harness-api/schema.json`, for harnesses written in other languages.
|
|
53
|
+
|
|
54
|
+
Other changes:
|
|
55
|
+
- `TurnStart` gains an optional `trace` (W3C `traceparent`) for the turn's trace context. Nothing fills it yet.
|
|
56
|
+
- Core refuses a `hello` whose `api` is not `2`.
|
|
57
|
+
- **The fixture model answers at the Model Gate (R4.3).** With a Tenant's `fixtureModel` seeded, the gate answers model calls itself and meters each one, like any model: a `model_usage` row with provider `fixture` and cost 0, readable at `GET /v1/sessions/{id}/calls/model`. Our harness no longer answers it locally.
|
|
58
|
+
- The fixture model also answers scripted markers: `fixture:text`, `fixture:tool <name> <json>`, `fixture:budget` and `fixture:slow <seconds>`.
|
|
59
|
+
- **The sandboxes service can run a harness image (R4.4, Go).** `PUT /v1/pods/{name}` accepts `entrypoint: "image"`: the workload image's own `ENTRYPOINT` and `CMD` run, with no engine copied in and no `harnessImage`. The default, `entrypoint: "engine"`, is unchanged. The Runtime starts sending it with the harness pin in a later change.
|
|
60
|
+
|
|
61
|
+
- 3013501: **Tool calls are delivered at least once, and every one is on the record (R5 step 1).** A gateway restart used to park the sessions it interrupted as `uncertain` until someone cancelled them, a harness could call tools with no record, and nothing listed a session's tool calls. Now every tool call ends in the log with its outcome, a crash sends it again with the same key, and the gateway runs only calls the effect journal recorded.
|
|
62
|
+
|
|
63
|
+
- **Every outcome in the log.** Each tool call ends in one `tool.completed` with `status` (`completed`: the tool answered; `failed`: the Runtime ended it, `tool.disabled`, `tool.unavailable` or `tool.interrupted`; `cancelled`), `kind` (`mcp`, `http`, `sandbox`, `platform`), `server`, `attempts` and `durationMs`. Refused and cancelled calls are in the log for the first time.
|
|
64
|
+
- **`GET /v1/sessions/{id}/calls/tool`** pages a session's tool calls from the effect journal, in the order they were first sent: tool, input, status, sends, error and timing. Same credentials and paging as `/calls/model`; `@nylorun/agents` adds `session.toolCalls()`. Host feature `tool-calls`.
|
|
65
|
+
- **At least once, with the same key.** An MCP or HTTP tool call that a crash, a shutdown or a lost gateway hop interrupted is sent again with its effect id as the key, up to 3 sends; then it fails to the model as `tool.interrupted` ("may have run") and the session continues. A gateway that restarts mid call runs the call again under its key instead of answering `uncertain`. HTTP tools get the key as `Idempotency-Key`, as before; MCP servers now get it in `_meta["nylorun/idempotency-key"]` on `tools/call`. A tool that honors the key acts once; `attempts` above 1 marks where one may have acted twice.
|
|
66
|
+
- **Sandbox commands are never run twice.** A sandbox or core-served call a crash interrupted has no key to dedupe on, so it fails to the model as `tool.interrupted` at once, and the model decides whether to run it again.
|
|
67
|
+
- **No tool call parks a session.** The `uncertain` state for tool calls, its cancel-only exit and R2b's read-only/idempotent `mcp.lost` exception are gone: a lost MCP answer is `mcp.lost` to the model for every tool. Model calls keep their own rules.
|
|
68
|
+
- **The gateway runs only journaled calls.** Under a run token, `/nylorun/v1/tool-calls` and `/nylorun/v1/http-calls` need the call's effect id as `Idempotency-Key` (`400 key_required`), and the effect journal must hold it running, for the run's turn, the same tool and the same input (`409 effect_not_journaled`). A harness that skips the journal gets nothing run.
|
|
69
|
+
- `@nylorun/harness`: `HarnessExecutors.resends(effect, error, run)` says a gate hop lost a call's answer; the harness then asks core again with the same intent and sends the call again.
|
|
70
|
+
- **Approval** stays in the manifest and our harness still asks for it. Only the Runtime's own harness asks: one built from the Harness API can skip it until tool policy moves to the gateway (R5 step 2).
|
|
71
|
+
|
|
72
|
+
- 6061a3a: **Tool approvals are the Tenant's tool policy (R5 step 2).** An agent's manifest used to say which tool calls wait for a person, and only the Runtime's own harness asked; a harness built from the Harness API could skip it. Now the operator sets one tool policy for every agent and every harness, and the Runtime enforces it before anything is sent.
|
|
73
|
+
|
|
74
|
+
- **`GET`/`PUT /v1/tenant/tool-policy`** (the Management API; `admin.toolPolicy.get()`/`.put({ rules })`): rules `{ effect: "allow" | "ask" | "deny", tool?, server?, kind?, agent?, when?, reason? }`. A rule matches a call when every selector it sets matches (`tool` and `server` take `*` globs; `when` tests input fields by dotted path with `equals`, `in`, `gt`, `gte`, `lt`, `lte` or `matches`). The strictest matching rule decides; a call no rule matches runs.
|
|
75
|
+
- **Enforced for every harness.** Core decides an MCP or HTTP tool call as it journals it. `deny` fails it to the model as `tool.denied`, unsent. `ask` holds the call (`held` at `/calls/tool`) and pauses the turn with one `approval` interaction per held call (`turn.paused`, with the tool, its input and the reason). `approve` sends that exact call, or fails it as `tool.denied`. The Tool Gate runs only calls the journal holds running, so a held or refused call cannot run. Nothing holds a process while it waits: an approval survives a restart. A flow's HTTP stages are decided the same way.
|
|
76
|
+
- **`approval` leaves the manifest.** `PUT /v1/agents/:id` and `saveAgent()` refuse a definition that sets `approval` on an HTTP tool, an MCP server or an MCP tool's settings; `http({ approval })` and `.mcp({ … approval })` throw; a turn manifest can no longer add one. The engine never asks for an HTTP or MCP tool's approval itself. A session pinned to a manifest saved with `approval: "always"` keeps it, as an ask.
|
|
77
|
+
- `@nylorun/studio`: a paused session shows an approval card for each held call, with its tool, why it is held and its input, and **Approve** / **Deny**.
|
|
78
|
+
- Migration: move each `approval: "always"` to an `ask` rule (see MIGRATION.md).
|
|
79
|
+
|
|
80
|
+
- 7d496e4: **Every connection a pod Environment makes to the internet is on the record (R7, egress events).** egress-gate used to keep only log lines, so a session's log could not say which hosts its turn reached or what the gate refused. Now each connection through egress-gate is one event, written by the gate itself.
|
|
81
|
+
|
|
82
|
+
- **`egress.connection`** in the session log of the turn that held the Environment when the connection opened, with that turn's id even if the turn has ended by the time it closes. Source `egress-gate`, evidence `observed`.
|
|
83
|
+
- **`environment.egress`**, the same payload, on the Environment's own stream (`GET /v1/environments/{id}/events`) for traffic while no turn holds the Environment.
|
|
84
|
+
- **The payload:** `environmentId`, `host`, `port`, `outcome` (`allowed` or `refused`), `reason` and `status` for a refusal, `mode` (`tunnel` or `credential`), `credentialBound`, `bytesUp` and `bytesDown`, `startedAt` (the gate's clock at CONNECT) and `durationMs`. A host a shell credential is bound to adds `requests` and the `credentialIds` the gate set. It never carries a header value, a URL path or a body.
|
|
85
|
+
- **One event per connection:** written when it closes, or at once when the gate refuses it (a host not in `network.allowedHosts`, a port other than 443 or 80, a private address, too many tunnels, a name that does not resolve). A refusal before the Environment is known (no token, an expired or stale one) stays a log line only.
|
|
86
|
+
- **Never in the way:** a write happens after the connection closes or is answered, and a failed write is logged as `egress_record_failed` without touching the tunnel. The gateway's `egress_refused` and `egress_terminated` log lines stay.
|
|
87
|
+
|
|
88
|
+
- 81c783e: **Every row that ends a call or a turn carries its own timing (R7.1).** The session log said what happened but not how long it took: a model call's outcome had no time at all, a tool call's only core's window, a flow's HTTP stage had no outcome row, and a turn's end had neither its duration nor its cost. Now each one is a span on its own, ready for the traces that follow, with no protocol change.
|
|
89
|
+
|
|
90
|
+
- **Model calls.** `message.assistant`, `model.failed` and `context.compacted` carry the call's `effectId` and `durationMs` (from the intent to the outcome). When the Model Gate metered the call they also carry the gate's own `gate: { startedAt, endedAt }`, `firstTokenMs` (to the provider's first stream event) and `meteredUsage` (`inputTokens`, `outputTokens`, `totalTokens`, and `cachedTokens` and `costUsd` when not zero), beside the `usage` the harness reported. The usage ledger keeps the gate's times (migration 0022: `model_usage.started_at`, `ended_at`, `first_token_ms`).
|
|
91
|
+
- **One row per model call.** A step that said nothing (no text, no tool calls, as a structured answer) now writes `message.assistant` with `text: ""`, and each partial summary of a long compaction writes `context.compacted` with `partial: true`. The AG-UI and A2A histories skip both; `isEmptyAssistantMessage` in `@nylorun/core/contracts` tells your own UI which steps said nothing.
|
|
92
|
+
- **Tool calls.** `tool.completed` carries the call's `effectId`, the Tool Gate's own `gate: { startedAt, endedAt }` for an MCP or HTTP call it ran (absent for sandbox and core-served tools), and `policy: { decision: "ask" | "deny", reason, approvedBy? }` when the Tenant's tool policy held or refused the call.
|
|
93
|
+
- **Flow HTTP stages.** A new event type, `node.completed` (`path`, `kind`, `key`, `iterations`, `effectId`, `status`, `durationMs`, `gate`), ends each HTTP stage and HTTP verifier that `node.started` began, and a tool stage the Runtime refused to run. Clients ignore event types they do not know.
|
|
94
|
+
- **Turns.** `turn.completed`, `turn.failed` and `turn.cancelled` carry `durationMs` (from the turn's start to its end, waits for a person included), `pausedMs` (how much of that it waited paused), `agentId` and `totals: { steps, tokens, costUsd }`, the same totals `GET /v1/tenant/usage?scope=turn` returns. A turn started before this release has no `durationMs`.
|
|
95
|
+
|
|
96
|
+
- 7800358: **Each turn is one OpenTelemetry trace, projected from the session log (R7).** An operator could not see what a turn did or where its time went without grepping container logs. Now every turn is a trace with a span for each model call, tool call and egress tunnel, exported over OTLP to any collector, readable per turn from the Runtime, and joined to the trace of the app that started it. No protocol change.
|
|
97
|
+
|
|
98
|
+
- **Traces from the log.** A turn's end is its root span, `invoke_agent <agent>`; each model call is a `chat <model>` span, each tool call and flow HTTP stage an `execute_tool <tool>` span, each egress-gate tunnel a `CONNECT <host>` span, and each pause and answer a marker. A model or gate tool span is the gate's own start and end; usage and cost are the gate's (`nylorun.usage.mismatch` when the harness reported other numbers). Attribute names follow the OTel GenAI conventions at one pinned commit, recorded as `nylorun.semconv.genai` on the resource. Ids are derived from the log under a key the Tenant keeps (setting `trace.key`), so every export and read of a turn gives the same ids.
|
|
99
|
+
- **OTLP export, off until you set an endpoint.** With `OTEL_EXPORTER_OTLP_ENDPOINT` (or `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) the Runtime posts OTLP/HTTP JSON from a replication slot of its own, `nylorun_trace_export`, in batches of up to 512 spans or every 2 s; `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES` work as usual. No turn waits for it. A collector that is down costs only its spans: after three retries a batch is dropped and logged as `trace_export_dropped`, and the slot moves on, so Postgres keeps no WAL for it. `nylorun start` passes these variables to the runtime container.
|
|
100
|
+
- **References by default.** Spans point at log events (`nylorun.event.cursor`) and carry no content unless you opt in per kind with `NYLORUN_TRACE_CONTENT` (`user`, `outputs`, `tool-results`, `errors`), or all of them with `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`, each cut at 8 KiB. A span never carries a credential value, a prompt, a person's id, an identity header or an idempotency key.
|
|
101
|
+
- **`GET /v1/sessions/{id}/turns/{turnId}/trace`** answers a turn's spans as OTLP JSON, the same spans the exporter posts: look at a turn without a collector, or post it to one to backfill. Application keys, as the `/calls` reads. Host feature `traces`; `@nylorun/agents` adds `session.trace(turnId)`, and `@nylorun/core/contracts` `TurnTraceSchema`.
|
|
102
|
+
- **Trace context in and out.** A `traceparent` (and `tracestate`) on `POST /v1/sessions/{id}/commands`, an AG-UI run or an A2A message puts the turn in the caller's trace; `command.message` records it as `trace`. The turn hands its context on: to the harness in `TurnStart.trace`, to HTTP tools as `traceparent` beside `Idempotency-Key`, to MCP servers as `traceparent` on the call's requests, and to sandbox commands as `TRACEPARENT`.
|
|
103
|
+
- **Harness API** (additive): the `effect.intent` answer `execute` may carry the tool call's `traceparent`. `@nylorun/harness`: `HarnessExecutors.tool` takes it as a fourth argument (`ToolCallContext`).
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- 17a97e9: **An artifact names the Environment whose disk it holds.** `ArtifactView` (and so `ArtifactListItem` in artifact pages) gains optional `environmentId`: set on the folder artifact that holds an Environment's disk versions (R2d step 3), absent on a session's or the Tenant's own artifacts. Before, such an artifact read as a Tenant-owned one with no way to tell whose disk it was.
|
|
108
|
+
- b6214d9: Add opt-in artifact metadata pagination to `GET /v1/artifacts?limit=…`, shared
|
|
109
|
+
`ArtifactListItem`/`ArtifactPage` contracts and SDK `artifacts.page()` (default 50,
|
|
110
|
+
maximum 200). Hosts advertise `artifact-reads`. Pages order by creation time and
|
|
111
|
+
ID descending, filter by session, kind and labels, bind cursors to the Tenant and
|
|
112
|
+
filters, and reapply ownership and agent grants on each read. Legacy unpaged
|
|
113
|
+
responses remain unchanged. A Drizzle migration adds the creation-order index;
|
|
114
|
+
pages reuse the existing bounded read-only pool. Studio and every other Runtime
|
|
115
|
+
client can consume this public API without database access.
|
|
116
|
+
- a0cbca1: **Clearer wording when a definition runs your code.** The refusal for a code tool or a flow's tool stage, the `hooks were removed` error and `nylo endpoints` now say that the Runtime runs agents from their manifests alone, instead of that it runs no code of yours during a session. Only the message text changed; anything matching the old wording (for example `runs no code of yours during a session`) needs the new text.
|
|
117
|
+
|
|
3
118
|
## 0.19.0-beta
|
|
4
119
|
|
|
5
120
|
### Minor Changes
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export { hashManifest } from "./utils/hash.js";
|
|
2
2
|
/**
|
|
3
|
+
* Protocol 11: Environments (R2d, D55, D56), a fresh start. `/v1/environments/{id}` replaces
|
|
4
|
+
* `/v1/sandboxes`: an Environment is one sandbox (kind `virtual`, `pod` or `none`) with a recipe
|
|
5
|
+
* that can change and one vault, written on the Runtime API
|
|
6
|
+
* (`PUT /v1/environments/{id}/secrets/{name}`). Sessions name an `environment` or nothing; the
|
|
7
|
+
* session fields `sandbox`, `vaultIds` and `credentialSelections`, the Tenant's default sandbox,
|
|
8
|
+
* user and installation vaults and `/v1/tenant/vaults` are gone. Error codes, event types, the
|
|
9
|
+
* scope (`environments:write`) and identity-file grants (`environments`) say Environment. The
|
|
10
|
+
* Host accepts protocol 11 only: an older client is answered `426`.
|
|
3
11
|
* Protocol 10: MCP credential custody leaves OSS (D49). The vault credential type `oauth`, the
|
|
4
12
|
* MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
|
|
5
13
|
* credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
|
|
@@ -22,7 +30,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
22
30
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
23
31
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
24
32
|
*/
|
|
25
|
-
export declare const PROTOCOL_VERSION =
|
|
33
|
+
export declare const PROTOCOL_VERSION = 11;
|
|
26
34
|
/** What a client of this protocol requires of a Host. */
|
|
27
35
|
export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts",
|
|
28
36
|
/**
|
|
@@ -36,7 +44,14 @@ export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts
|
|
|
36
44
|
* (`credential_required`, `credential_invalid`), and the Runtime serves its protected resource
|
|
37
45
|
* metadata at `/.well-known/oauth-protected-resource` when it has trusted issuers.
|
|
38
46
|
*/
|
|
39
|
-
"resource-server"
|
|
47
|
+
"resource-server",
|
|
48
|
+
/**
|
|
49
|
+
* Protocol 11: Environments (`/v1/environments/{id}`, kinds `virtual`, `pod` and `none`), each
|
|
50
|
+
* with one vault written on the Runtime API; sessions name an `environment`; token callers
|
|
51
|
+
* carry Environment grants checked at every turn start, and `environments:write` lets a
|
|
52
|
+
* subject create, change and delete the Environments it is granted.
|
|
53
|
+
*/
|
|
54
|
+
"environments"];
|
|
40
55
|
export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
41
56
|
/**
|
|
42
57
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -49,20 +64,36 @@ export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
|
49
64
|
* by subject headers. `a2a-endpoint`:
|
|
50
65
|
* `POST /v1/a2a/agents/:agent` answers A2A 1.0 JSON-RPC for a subject, and
|
|
51
66
|
* `GET /v1/a2a/agents/:agent/card` returns the agent's card without its interfaces.
|
|
52
|
-
* `
|
|
53
|
-
* with `
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* `sandbox-pods`: kind `pod` runs as an agent-sandbox pod on the Tenant's cluster (`nylorun
|
|
57
|
-
* sandbox enable`), with `POST /v1/sandboxes/{id}/stop` and `/reset`, a TTL
|
|
58
|
-
* (`lifecycle.ttl`), lifecycle events (`sandbox.running`, `.suspended`, `.expired`,
|
|
59
|
-
* `.relaunched`, `.lost`, `.reset`, `.failed`) and the Tenant's `placement`.
|
|
67
|
+
* `sandbox-pods`: Environments of kind `pod` run as agent-sandbox pods on the Tenant's cluster
|
|
68
|
+
* (`nylorun sandbox enable`), with `POST /v1/environments/{id}/stop` and `/reset`, lifecycle
|
|
69
|
+
* events (`environment.running`, `.suspended`, `.relaunched`, `.lost`, `.reset`, `.failed`) and
|
|
70
|
+
* the Tenant's `placement`.
|
|
60
71
|
* `trusted-issuers`: the Tenant API accepts JWTs from the issuers of the Host's identity file
|
|
61
72
|
* (`NYLORUN_IDENTITY_FILE`) as bearers, from servers and from browsers alike, with the
|
|
62
|
-
* issuer's subject, scopes (and the issuer-only `studio`), agents and
|
|
73
|
+
* issuer's subject, scopes (and the issuer-only `studio`), agents and Environment grants; `GET
|
|
63
74
|
* /v1/me` reports who any credential is.
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
* `environment-setup`: a pod Environment's recipe takes `setup` commands and input `files`, run
|
|
76
|
+
* and copied when its disk is made or reset, before any turn.
|
|
77
|
+
* `environment-disk-versions`: an Environment's disk has versions: `POST
|
|
78
|
+
* /v1/environments/{id}/snapshot` and `/restore`, `GET .../versions`, `DELETE .../versions/{n}`,
|
|
79
|
+
* and `from` on a `PUT` that creates one; a pod whose volume is lost starts again from the latest.
|
|
80
|
+
* `credential-coverage`: `POST /v1/tenant/credential-coverage` (the Management API) says which
|
|
81
|
+
* credential of an Environment's vault each of a saved agent's MCP servers and HTTP tools would
|
|
82
|
+
* get in a session that names that Environment.
|
|
83
|
+
* `tool-calls` (R5): `GET /v1/sessions/{id}/calls/tool` pages a session's tool calls from the
|
|
84
|
+
* effect journal, every `tool.completed` says how its call ended (`status`, `kind`, `server`,
|
|
85
|
+
* `attempts`, `durationMs`), and tool calls are delivered at least once with their effect id as
|
|
86
|
+
* the key (`Idempotency-Key` for HTTP tools, `_meta["nylorun/idempotency-key"]` for MCP tools).
|
|
87
|
+
* `tool-policy` (R5 step 2): `GET`/`PUT /v1/tenant/tool-policy` (the Management API) sets which
|
|
88
|
+
* MCP and HTTP tool calls run, wait for a person (`ask`: the turn pauses until `approve`) or are
|
|
89
|
+
* refused (`deny`: `tool.denied`), for every harness; a manifest that sets `approval` is refused.
|
|
90
|
+
* `traces` (R7): `GET /v1/sessions/{id}/turns/{turnId}/trace` answers a turn's spans as OTLP JSON,
|
|
91
|
+
* the spans the Runtime posts to an OTLP collector when one is configured; a command or an AG-UI
|
|
92
|
+
* or A2A request sent with a `traceparent` joins the caller's trace.
|
|
93
|
+
*/
|
|
94
|
+
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",
|
|
95
|
+
/** Opt-in artifact metadata pages (`GET /v1/artifacts?limit=…`). */
|
|
96
|
+
"artifact-reads"];
|
|
66
97
|
export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
|
|
67
98
|
export interface ProtocolRange {
|
|
68
99
|
min: number;
|
|
@@ -70,11 +101,9 @@ export interface ProtocolRange {
|
|
|
70
101
|
features: readonly string[];
|
|
71
102
|
}
|
|
72
103
|
/**
|
|
73
|
-
* What this Host serves
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* API itself is gone (protocol 8): `/v1/admin/*` is no route. `artifacts` (protocol 6 and
|
|
77
|
-
* 7, required by their clients): file artifacts, capability links and message `parts`.
|
|
104
|
+
* What this Host serves: protocol 11 only (R2d Q3). Protocol 11 removed routes and session fields
|
|
105
|
+
* older clients send, so an older client is answered `426` naming the protocol it needs rather
|
|
106
|
+
* than a `404` or a `400` on a removed field.
|
|
78
107
|
*/
|
|
79
108
|
export declare const HOST_PROTOCOL: ProtocolRange;
|
|
80
109
|
export declare const DEFINITION_SCHEMA_VERSION = 2;
|
|
@@ -112,18 +141,31 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
112
141
|
"invalid_request",
|
|
113
142
|
/** A route that acts for a person was called without one (`Nylorun-Subject`). */
|
|
114
143
|
"subject_required",
|
|
115
|
-
/** A token caller's
|
|
116
|
-
"
|
|
117
|
-
/** Another session's turn holds the
|
|
118
|
-
"
|
|
119
|
-
/** The
|
|
120
|
-
"
|
|
121
|
-
/** The Tenant's placement keeps this session's harness off the host its
|
|
144
|
+
/** A token caller's Environment grants do not reach the Environment. */
|
|
145
|
+
"environment_not_granted",
|
|
146
|
+
/** Another session's turn holds the Environment: turns are serial per Environment. */
|
|
147
|
+
"environment_busy",
|
|
148
|
+
/** The Environment is gone, or its kind cannot run on this Runtime. */
|
|
149
|
+
"environment_unavailable",
|
|
150
|
+
/** The Tenant's placement keeps this session's harness off the host its Environment needs. */
|
|
122
151
|
"placement_refused",
|
|
123
|
-
/** A pod
|
|
124
|
-
"
|
|
125
|
-
/**
|
|
126
|
-
|
|
152
|
+
/** A pod Environment's volume or node is gone: only `POST /v1/environments/{id}/reset` brings it back. */
|
|
153
|
+
"environment_lost",
|
|
154
|
+
/**
|
|
155
|
+
* The Environment names an owner (`ownerUserId`) other than the session's owner: `403` to an
|
|
156
|
+
* application key; a caller acting for a person gets the opaque `404`.
|
|
157
|
+
*/
|
|
158
|
+
"environment_owner_mismatch",
|
|
159
|
+
/**
|
|
160
|
+
* The session's Environment now runs another harness than the one the session pinned when it
|
|
161
|
+
* opened (track R4): open a new session to run on it.
|
|
162
|
+
*/
|
|
163
|
+
"harness_mismatch",
|
|
164
|
+
/**
|
|
165
|
+
* The session is closed: it was opened before protocol 11 (its history stays readable), so
|
|
166
|
+
* open a new session that names an Environment.
|
|
167
|
+
*/
|
|
168
|
+
"session_closed",
|
|
127
169
|
/**
|
|
128
170
|
* A trusted issuer's token names a key the Runtime has not seen, and the issuer's JWKS cannot
|
|
129
171
|
* be fetched now (Host feature `trusted-issuers`): retry later. Keys already fetched keep working.
|
|
@@ -147,9 +189,9 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
147
189
|
*/
|
|
148
190
|
"mcp_preview_failed",
|
|
149
191
|
/**
|
|
150
|
-
*
|
|
151
|
-
* `environment_secret`
|
|
152
|
-
*
|
|
192
|
+
* An Environment's credentials would be ambiguous (R2c, D56): `409` at the secret write. Two
|
|
193
|
+
* `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
|
|
194
|
+
* credentials to one URL.
|
|
153
195
|
*/
|
|
154
196
|
"credential_conflict", "internal_error"];
|
|
155
197
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
package/dist/compatibility.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export { hashManifest } from "./utils/hash.js";
|
|
2
2
|
/**
|
|
3
|
+
* Protocol 11: Environments (R2d, D55, D56), a fresh start. `/v1/environments/{id}` replaces
|
|
4
|
+
* `/v1/sandboxes`: an Environment is one sandbox (kind `virtual`, `pod` or `none`) with a recipe
|
|
5
|
+
* that can change and one vault, written on the Runtime API
|
|
6
|
+
* (`PUT /v1/environments/{id}/secrets/{name}`). Sessions name an `environment` or nothing; the
|
|
7
|
+
* session fields `sandbox`, `vaultIds` and `credentialSelections`, the Tenant's default sandbox,
|
|
8
|
+
* user and installation vaults and `/v1/tenant/vaults` are gone. Error codes, event types, the
|
|
9
|
+
* scope (`environments:write`) and identity-file grants (`environments`) say Environment. The
|
|
10
|
+
* Host accepts protocol 11 only: an older client is answered `426`.
|
|
3
11
|
* Protocol 10: MCP credential custody leaves OSS (D49). The vault credential type `oauth`, the
|
|
4
12
|
* MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
|
|
5
13
|
* credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
|
|
@@ -22,7 +30,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
22
30
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
23
31
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
24
32
|
*/
|
|
25
|
-
export const PROTOCOL_VERSION =
|
|
33
|
+
export const PROTOCOL_VERSION = 11;
|
|
26
34
|
/** What a client of this protocol requires of a Host. */
|
|
27
35
|
export const PROTOCOL_FEATURES = [
|
|
28
36
|
"studio-principal",
|
|
@@ -39,6 +47,13 @@ export const PROTOCOL_FEATURES = [
|
|
|
39
47
|
* metadata at `/.well-known/oauth-protected-resource` when it has trusted issuers.
|
|
40
48
|
*/
|
|
41
49
|
"resource-server",
|
|
50
|
+
/**
|
|
51
|
+
* Protocol 11: Environments (`/v1/environments/{id}`, kinds `virtual`, `pod` and `none`), each
|
|
52
|
+
* with one vault written on the Runtime API; sessions name an `environment`; token callers
|
|
53
|
+
* carry Environment grants checked at every turn start, and `environments:write` lets a
|
|
54
|
+
* subject create, change and delete the Environments it is granted.
|
|
55
|
+
*/
|
|
56
|
+
"environments",
|
|
42
57
|
];
|
|
43
58
|
/**
|
|
44
59
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -51,18 +66,32 @@ export const PROTOCOL_FEATURES = [
|
|
|
51
66
|
* by subject headers. `a2a-endpoint`:
|
|
52
67
|
* `POST /v1/a2a/agents/:agent` answers A2A 1.0 JSON-RPC for a subject, and
|
|
53
68
|
* `GET /v1/a2a/agents/:agent/card` returns the agent's card without its interfaces.
|
|
54
|
-
* `
|
|
55
|
-
* with `
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `sandbox-pods`: kind `pod` runs as an agent-sandbox pod on the Tenant's cluster (`nylorun
|
|
59
|
-
* sandbox enable`), with `POST /v1/sandboxes/{id}/stop` and `/reset`, a TTL
|
|
60
|
-
* (`lifecycle.ttl`), lifecycle events (`sandbox.running`, `.suspended`, `.expired`,
|
|
61
|
-
* `.relaunched`, `.lost`, `.reset`, `.failed`) and the Tenant's `placement`.
|
|
69
|
+
* `sandbox-pods`: Environments of kind `pod` run as agent-sandbox pods on the Tenant's cluster
|
|
70
|
+
* (`nylorun sandbox enable`), with `POST /v1/environments/{id}/stop` and `/reset`, lifecycle
|
|
71
|
+
* events (`environment.running`, `.suspended`, `.relaunched`, `.lost`, `.reset`, `.failed`) and
|
|
72
|
+
* the Tenant's `placement`.
|
|
62
73
|
* `trusted-issuers`: the Tenant API accepts JWTs from the issuers of the Host's identity file
|
|
63
74
|
* (`NYLORUN_IDENTITY_FILE`) as bearers, from servers and from browsers alike, with the
|
|
64
|
-
* issuer's subject, scopes (and the issuer-only `studio`), agents and
|
|
75
|
+
* issuer's subject, scopes (and the issuer-only `studio`), agents and Environment grants; `GET
|
|
65
76
|
* /v1/me` reports who any credential is.
|
|
77
|
+
* `environment-setup`: a pod Environment's recipe takes `setup` commands and input `files`, run
|
|
78
|
+
* and copied when its disk is made or reset, before any turn.
|
|
79
|
+
* `environment-disk-versions`: an Environment's disk has versions: `POST
|
|
80
|
+
* /v1/environments/{id}/snapshot` and `/restore`, `GET .../versions`, `DELETE .../versions/{n}`,
|
|
81
|
+
* and `from` on a `PUT` that creates one; a pod whose volume is lost starts again from the latest.
|
|
82
|
+
* `credential-coverage`: `POST /v1/tenant/credential-coverage` (the Management API) says which
|
|
83
|
+
* credential of an Environment's vault each of a saved agent's MCP servers and HTTP tools would
|
|
84
|
+
* get in a session that names that Environment.
|
|
85
|
+
* `tool-calls` (R5): `GET /v1/sessions/{id}/calls/tool` pages a session's tool calls from the
|
|
86
|
+
* effect journal, every `tool.completed` says how its call ended (`status`, `kind`, `server`,
|
|
87
|
+
* `attempts`, `durationMs`), and tool calls are delivered at least once with their effect id as
|
|
88
|
+
* the key (`Idempotency-Key` for HTTP tools, `_meta["nylorun/idempotency-key"]` for MCP tools).
|
|
89
|
+
* `tool-policy` (R5 step 2): `GET`/`PUT /v1/tenant/tool-policy` (the Management API) sets which
|
|
90
|
+
* MCP and HTTP tool calls run, wait for a person (`ask`: the turn pauses until `approve`) or are
|
|
91
|
+
* refused (`deny`: `tool.denied`), for every harness; a manifest that sets `approval` is refused.
|
|
92
|
+
* `traces` (R7): `GET /v1/sessions/{id}/turns/{turnId}/trace` answers a turn's spans as OTLP JSON,
|
|
93
|
+
* the spans the Runtime posts to an OTLP collector when one is configured; a command or an AG-UI
|
|
94
|
+
* or A2A request sent with a `traceparent` joins the caller's trace.
|
|
66
95
|
*/
|
|
67
96
|
export const OPTIONAL_HOST_FEATURES = [
|
|
68
97
|
"tenant-fixture-model",
|
|
@@ -70,23 +99,28 @@ export const OPTIONAL_HOST_FEATURES = [
|
|
|
70
99
|
"subject-headers",
|
|
71
100
|
"ag-ui-endpoint",
|
|
72
101
|
"a2a-endpoint",
|
|
73
|
-
"sandboxes",
|
|
74
102
|
"sandbox-pods",
|
|
75
103
|
"trusted-issuers",
|
|
76
104
|
"session-reads",
|
|
77
105
|
"calls-export",
|
|
106
|
+
"credential-coverage",
|
|
107
|
+
"tool-calls",
|
|
108
|
+
"environment-setup",
|
|
109
|
+
"environment-disk-versions",
|
|
110
|
+
"tool-policy",
|
|
111
|
+
"traces",
|
|
112
|
+
/** Opt-in artifact metadata pages (`GET /v1/artifacts?limit=…`). */
|
|
113
|
+
"artifact-reads",
|
|
78
114
|
];
|
|
79
115
|
/**
|
|
80
|
-
* What this Host serves
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* API itself is gone (protocol 8): `/v1/admin/*` is no route. `artifacts` (protocol 6 and
|
|
84
|
-
* 7, required by their clients): file artifacts, capability links and message `parts`.
|
|
116
|
+
* What this Host serves: protocol 11 only (R2d Q3). Protocol 11 removed routes and session fields
|
|
117
|
+
* older clients send, so an older client is answered `426` naming the protocol it needs rather
|
|
118
|
+
* than a `404` or a `400` on a removed field.
|
|
85
119
|
*/
|
|
86
120
|
export const HOST_PROTOCOL = {
|
|
87
|
-
min:
|
|
88
|
-
max:
|
|
89
|
-
features: [
|
|
121
|
+
min: 11,
|
|
122
|
+
max: 11,
|
|
123
|
+
features: [...PROTOCOL_FEATURES, ...OPTIONAL_HOST_FEATURES],
|
|
90
124
|
};
|
|
91
125
|
export const DEFINITION_SCHEMA_VERSION = 2;
|
|
92
126
|
/**
|
|
@@ -134,18 +168,31 @@ export const ERROR_CODES = [
|
|
|
134
168
|
"invalid_request",
|
|
135
169
|
/** A route that acts for a person was called without one (`Nylorun-Subject`). */
|
|
136
170
|
"subject_required",
|
|
137
|
-
/** A token caller's
|
|
138
|
-
"
|
|
139
|
-
/** Another session's turn holds the
|
|
140
|
-
"
|
|
141
|
-
/** The
|
|
142
|
-
"
|
|
143
|
-
/** The Tenant's placement keeps this session's harness off the host its
|
|
171
|
+
/** A token caller's Environment grants do not reach the Environment. */
|
|
172
|
+
"environment_not_granted",
|
|
173
|
+
/** Another session's turn holds the Environment: turns are serial per Environment. */
|
|
174
|
+
"environment_busy",
|
|
175
|
+
/** The Environment is gone, or its kind cannot run on this Runtime. */
|
|
176
|
+
"environment_unavailable",
|
|
177
|
+
/** The Tenant's placement keeps this session's harness off the host its Environment needs. */
|
|
144
178
|
"placement_refused",
|
|
145
|
-
/** A pod
|
|
146
|
-
"
|
|
147
|
-
/**
|
|
148
|
-
|
|
179
|
+
/** A pod Environment's volume or node is gone: only `POST /v1/environments/{id}/reset` brings it back. */
|
|
180
|
+
"environment_lost",
|
|
181
|
+
/**
|
|
182
|
+
* The Environment names an owner (`ownerUserId`) other than the session's owner: `403` to an
|
|
183
|
+
* application key; a caller acting for a person gets the opaque `404`.
|
|
184
|
+
*/
|
|
185
|
+
"environment_owner_mismatch",
|
|
186
|
+
/**
|
|
187
|
+
* The session's Environment now runs another harness than the one the session pinned when it
|
|
188
|
+
* opened (track R4): open a new session to run on it.
|
|
189
|
+
*/
|
|
190
|
+
"harness_mismatch",
|
|
191
|
+
/**
|
|
192
|
+
* The session is closed: it was opened before protocol 11 (its history stays readable), so
|
|
193
|
+
* open a new session that names an Environment.
|
|
194
|
+
*/
|
|
195
|
+
"session_closed",
|
|
149
196
|
/**
|
|
150
197
|
* A trusted issuer's token names a key the Runtime has not seen, and the issuer's JWKS cannot
|
|
151
198
|
* be fetched now (Host feature `trusted-issuers`): retry later. Keys already fetched keep working.
|
|
@@ -169,9 +216,9 @@ export const ERROR_CODES = [
|
|
|
169
216
|
*/
|
|
170
217
|
"mcp_preview_failed",
|
|
171
218
|
/**
|
|
172
|
-
*
|
|
173
|
-
* `environment_secret`
|
|
174
|
-
*
|
|
219
|
+
* An Environment's credentials would be ambiguous (R2c, D56): `409` at the secret write. Two
|
|
220
|
+
* `environment_secret` credentials would be bound to one host, or two `bearer` or `headers`
|
|
221
|
+
* credentials to one URL.
|
|
175
222
|
*/
|
|
176
223
|
"credential_conflict",
|
|
177
224
|
"internal_error",
|