@nylorun/core 0.22.0-beta → 0.24.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 +126 -0
- package/README.md +1 -1
- package/dist/compatibility.d.ts +120 -47
- package/dist/compatibility.js +122 -49
- package/dist/contracts.d.ts +2824 -907
- package/dist/contracts.js +1286 -585
- package/dist/define.d.ts +9 -12
- package/dist/define.js +8 -11
- package/dist/definition/assemble.d.ts +1 -3
- package/dist/definition/assemble.js +4 -8
- package/dist/definition/bound.d.ts +1 -1
- package/dist/definition/delegate.d.ts +5 -0
- package/dist/definition/delegate.js +6 -1
- package/dist/definition/from.d.ts +4 -2
- package/dist/definition/from.js +11 -29
- package/dist/definition/http-tool.d.ts +5 -3
- package/dist/definition/http-tool.js +8 -5
- package/dist/definition/manifest.d.ts +7 -6
- package/dist/definition/manifest.js +7 -6
- package/dist/definition/mcp.d.ts +1 -1
- package/dist/definition/media-reference.d.ts +2 -11
- package/dist/definition/media-reference.js +0 -12
- package/dist/definition/model-failure.js +1 -0
- package/dist/definition/removed.d.ts +7 -0
- package/dist/definition/removed.js +21 -0
- package/dist/definition/sections.d.ts +63 -0
- package/dist/definition/sections.js +204 -0
- package/dist/definition/trace.d.ts +0 -7
- package/dist/definition/trace.js +0 -34
- package/dist/definition/variant.d.ts +1 -1
- package/dist/definition/variant.js +1 -3
- package/dist/harness-api/artifacts.d.ts +84 -0
- package/dist/harness-api/artifacts.js +128 -0
- package/dist/harness-api/gates.d.ts +0 -4
- package/dist/harness-api/gates.js +0 -4
- package/dist/harness-api/harness-api.schema.json +2798 -1124
- package/dist/harness-api/index.d.ts +9 -6
- package/dist/harness-api/index.js +9 -6
- package/dist/harness-api/json-schema.js +5 -2
- package/dist/harness-api/mcp.d.ts +77 -30
- package/dist/harness-api/mcp.js +42 -25
- package/dist/harness-api/messages.d.ts +47 -17
- package/dist/harness-api/messages.js +20 -5
- package/dist/harness-api/schema.d.ts +609 -200
- package/dist/harness-api/schema.js +345 -62
- package/dist/harness-api/transcript.d.ts +8 -10
- package/dist/harness-api/transcript.js +27 -11
- package/dist/harness-api/transport.d.ts +7 -1
- package/dist/harness-api/transport.js +10 -7
- package/dist/manifest-schemas.d.ts +9 -5
- package/dist/manifest-schemas.js +23 -27
- package/dist/schemas/agent-manifest.schema.json +1508 -365
- package/dist/schemas/harness-manifest.schema.json +1273 -0
- package/dist/schemas/{environment-manifest.schema.json → runtime-manifest.schema.json} +165 -84
- package/dist/types/manifest.d.ts +72 -14
- package/dist/types/manifest.js +4 -0
- package/dist/types/model.d.ts +15 -5
- package/dist/utils/definition-files.d.ts +20 -6
- package/dist/utils/definition-files.js +31 -17
- package/dist/utils/file-systems.d.ts +20 -0
- package/dist/utils/file-systems.js +20 -0
- package/dist/utils/harness-id.d.ts +4 -1
- package/dist/utils/harness-id.js +4 -1
- package/dist/utils/media-types.d.ts +30 -0
- package/dist/utils/media-types.js +128 -0
- package/dist/utils/memory.d.ts +64 -0
- package/dist/utils/memory.js +139 -0
- package/dist/utils/runtime-limits.d.ts +280 -0
- package/dist/utils/runtime-limits.js +585 -0
- package/dist/utils/runtime-tools.d.ts +8 -16
- package/dist/utils/runtime-tools.js +8 -27
- package/dist/utils/sandbox.d.ts +4 -1
- package/dist/utils/sandbox.js +4 -1
- package/package.json +6 -5
- package/dist/definition/deferred-tools.d.ts +0 -27
- package/dist/definition/deferred-tools.js +0 -82
- package/dist/definition/runtime-manifest.d.ts +0 -30
- package/dist/definition/runtime-manifest.js +0 -132
- package/dist/definition/sandbox-tools.d.ts +0 -5
- package/dist/definition/sandbox-tools.js +0 -109
- package/dist/definition/skill-tools.d.ts +0 -23
- package/dist/definition/skill-tools.js +0 -76
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.24.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 218b078: Agent manifest v8, the schema of protocol 16 (track T2), ahead of the Runtime that saves it: `AgentManifestV8Schema`, with a `harness` section (what runs inside the loop: the harness id, instructions, tools, skills with the secret slots they read, MCP servers with the slot they authenticate with, plugins, `loop`) or a flow's, and a `runtime` section (environment manifest v1's fields; `kind` required, `harness` moved to `harness.id`, `triggers` reserved). The authoring files `nylorun apply` will read have their own schemas: `AgentManifestFileSchema`, `HarnessManifestFileSchema` and `RuntimeManifestFileSchema`, published as `@nylorun/core/schemas/agent-manifest-v8.json`, `harness-manifest.json` and `runtime-manifest.json`.
|
|
8
|
+
|
|
9
|
+
`sectionGaps(manifest)` (from `@nylorun/core/define`) checks the two sections against each other, as the Runtime will when a manifest is saved: a custom harness needs a pod with an image; every credential the harness names is a declared slot of the right type (an MCP server's or HTTP tool's a `bearer` or `headers` slot bound to its URL, a skill's `secrets` an `environment_secret` or `environment_variable` slot); and the runtime's kind gives the loop the sandbox it needs (`sandboxNeedOf`). `loopManifestOf` and `harnessSectionOf` convert between a version's harness section and the loop manifest the engine runs. Nothing calls them yet.
|
|
10
|
+
|
|
11
|
+
- 22c61ce: Protocol 16, Agents from one manifest (track T2), a fresh start. An agent manifest (v8) is one versioned document at `/v1/agent-manifests/{name}` with a `harness` section (what runs inside the loop, including the harness's id) and a `runtime` section (what an environment manifest said). The Runtime checks the two against each other when it is saved (`422 manifest_inconsistent` with `details.gaps`), in place of `requires` at session open. Agent definitions and environment manifests are gone.
|
|
12
|
+
|
|
13
|
+
Environments are Agents: `/v1/agents/{id}` and its sub-routes, made from a saved manifest only (`manifest: "name"` tracks it, `"name@n"` pins a version; either resolves once, into `resolvedVersion`), with a derived `state` (`working`, `sleeping`, `input_required`, `failing`, `paused`) and `attention`. Every session runs on one Agent (`PUT /v1/sessions/{id} { agent, ownerUserId }`) and pins its manifest version. No session is special (D71). Error codes, events (`agent.*`), scopes (`agents:write`, `agent-manifests:write`) and identity-file grants (`agents`) say Agent; model budget scope `agent` is `manifest`. Harness API 5: `turn.start.agent` replaces `turn.start.environment`, with `definition` and `loop`. Migration 0032 closes older sessions (`protocol_16`) and drops Environments with their disks and vaults.
|
|
14
|
+
|
|
15
|
+
The SDK has `client.agentManifests`, `client.agents` and `composeManifest(dir)` for three-file authoring; the CLI has `nylorun apply`, `nylorun agent-manifests`, `nylorun agents` and `nylorun migrate v8`; Studio has an Agents screen, an Agent page and an Agent manifests screen. See MIGRATION.md.
|
|
16
|
+
|
|
17
|
+
- 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
|
+
- 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
|
+
- 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.
|
|
21
|
+
- 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
|
+
- 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
|
+
- 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.
|
|
24
|
+
- f85483d: Triggers (track T4, D74). An agent manifest's `runtime.triggers` declares `schedule` (cron with an IANA `timezone`) and `at` triggers, each with the session its runs go to (a session id, opened on the first run, or `new` for a session per run) and its prompt. They start active with a new Agent, fire on a durable timer per trigger with Postgres as the truth (one late fire after downtime, never a backfill, a fixed jitter per trigger), and each fire is a run (`started`, `queued`, `skipped` or `failed`, with a reason) at `GET /v1/agents/{id}/runs`. A schedule adds at most one queued message to a busy session. `GET /v1/agents/{id}/triggers` and `POST .../triggers/{triggerId}/pause`, `/resume` and `/run` (with an `Idempotency-Key`); Agent reads add `nextWakeAt`, and the Agent's stream adds `agent.run`, `agent.trigger_paused` and `agent.trigger_resumed`. New Runtime limits: `triggersPerAgent`, `triggerMinIntervalMs` and `triggerRunRetentionMs` (with floors), `triggerRunsPerHour`, `triggerJitterPercent`, `triggerJitterMaxMs`, `triggerPromptChars`; Host tuning `triggers.lateGraceMs` and `triggers.intervalCheckFires`. The SDK's `client.agents` adds `triggers`, `pauseTrigger`, `resumeTrigger`, `runTrigger` and `runs`; the CLI adds `nylorun agents triggers` and `nylorun agents runs`.
|
|
25
|
+
- ae54de7: Webhook triggers (track T4, D75). A `webhook: "standard-webhooks"` trigger has an endpoint, `POST /v1/webhooks/{endpointId}`, an anonymous, unversioned route that takes any body up to the new Runtime limit `webhookBodyBytes` and verifies Standard Webhooks (`webhook-id`, `webhook-timestamp` within the Host's `triggers.webhookToleranceMs`, `webhook-signature`) in the keys service, which alone opens the trigger's sealed secret; anything else is `401` and writes nothing. A delivery runs the trigger once per `webhook-id` (`202 {runId, status}`); a paused trigger answers a signed one `409 trigger_paused`. `POST /v1/agents/{id}/triggers/{triggerId}/secret` makes or replaces the `whsec_` secret, shown once (`agent.trigger_secret_rotated`); trigger reads show `webhookUrl` and `secretSet`. The payload reaches the model under the trigger's prompt in a labelled `<trigger-payload>` block. The SDK adds `agents.rotateWebhookSecret`, and the CLI `nylorun agents triggers new-secret`.
|
|
26
|
+
|
|
27
|
+
## 0.23.0-beta
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- 0a2fbc5: **Artifacts reach the harness through the Harness API; `read_artifact` and `save_artifact` run in the harness (protocol 15, Harness API 4).** The first step of the harness boundary: model-facing work belongs to the harness, and the Runtime offers primitives and holds limits and access. A fresh start for agent sessions: the Runtime speaks protocol 15 only. See MIGRATION.md.
|
|
32
|
+
|
|
33
|
+
- **The artifact seam.** A harness reads and writes the artifacts of the run it holds: `artifact.read {artifactId, version?, offset?, length?}` answers the version's metadata (`ArtifactMetaSchema`) and its bytes from `offset`, at most `turn.start.limits.chunkBytes`; `artifact.write` (`begin`, `chunk`, `commit`, `abort`) makes a file artifact of the session or a new version of one of its own, streamed with backpressure into the Object store and committed in Postgres within the Tenant's and the Environment's artifact limits. The scope is always the run's session: its own artifacts, and the Tenant-wide ones its messages named; anything else is the new error code `not_found`, alike. A write's `key` makes it idempotent within the session (`artifact_versions.write_key`, migration 0028), and its `effectId` links the artifact to a tool call of the turn, whose call id `artifact.created` carries. An upload the run leaves open commits nothing. Client helpers: `readArtifact`, `openArtifactWrite`, `writeArtifactBytes`, `toBase64` and `fromBase64` in `@nylorun/core/harness-api`.
|
|
34
|
+
- **Our harness runs the artifact tools.** `read_artifact` (every agent) and `save_artifact` (with a sandbox) are our engine's tools, defined in `@nylorun/harness` (`artifactToolsFor`, `runArtifactTool`) and run over the seam and the run's sandbox files (`HarnessExecutors.files`, `SandboxManager.writeBytes`); their calls are kind `harness`. `save_artifact` keys its write by its effect id. `read_artifact` takes `path` with a sandbox, which copies the whole artifact into it, and hands a file of any other type to the model as a file of the result (the Model Gate writes the note for one the model does not read; `artifact.unsupported` is gone). Its page is harness configuration, `createHarness({ artifactPageBytes })` (32 KiB by default), and now always ends on a whole character. `runDurable` takes `engineTools`; `apiHost` takes the engine's configuration.
|
|
35
|
+
- **The Runtime pins no artifact tools.** `runtimeManifestFor` has no `save` or `read`; `RUNTIME_TOOL_NAMES` no longer holds the two names, so an author tool may take one (our harness then refuses the turn). A session without a sandbox or skills pins its definition unchanged. Core no longer runs either tool (`tenant/artifact-tool.ts` is gone). Migration 0029 closes every agent session that pinned them (`closedReason: "protocol_15"`, `409 session_closed`); workflow sessions carry over.
|
|
36
|
+
- **Media types are core's.** `contentTypeFor`, `essence`, `normalizeContentType`, `isText`, `isModelImage`, `modelInputOf`, `inputLabel`, `extensionFor`, `unreadableReason`, `MODEL_IMAGE_TYPES` and `DEFAULT_CONTENT_TYPE` are exported from `@nylorun/core/contracts`, for the Runtime and harnesses alike.
|
|
37
|
+
- `PROTOCOL_VERSION` 15 with required feature `harness-boundary`; `HARNESS_API_VERSION` 4. The SDKs and the CLI send protocol 15.
|
|
38
|
+
|
|
39
|
+
- ebe7348: **The harness decides how files reach the model; the Model Gate only fetches and translates (protocol 15).** The second step of the harness boundary, still protocol 15 and Harness API 4. See MIGRATION.md.
|
|
40
|
+
|
|
41
|
+
- **Any file may be sent.** A message naming a file the model does not read is accepted: `422 attachment_unsupported` and its error code are gone, and AG-UI and A2A accept such files too. Files are still held to the artifact size limits at upload.
|
|
42
|
+
- **`turn.start.model`** is the model descriptor (`ModelDescriptorSchema`): the provider, id, inputs, context window and output limit of the model the turn's calls use, absent for flows and without a model. One resolution (`model/descriptor.ts`) serves it, the catalog's inputs and the gate.
|
|
43
|
+
- **Our engine shows each file.** An image or document the model reads goes as its artifact reference, a text file is read over the artifact seam and inlined as a `<file>` block, and anything else (past `modelFileBytes`, a kind the model does not read) is a note it writes. `fileView`, `representFiles`, `fileBlock`, `fileNote` and `mediaReferenceLine` (moved from `@nylorun/core/define`) are exported from `@nylorun/harness`. A budget from the descriptor bounds the prompt before the first answer, and compaction counts files as the model gets them.
|
|
44
|
+
- **The Model Gate refuses instead of writing notes.** A text file as a media part, or a kind the model or its API does not read, fails the call with the new model failure code `unsupported_input`; a reference it cannot fetch fails `invalid_request`. Nothing is sent, and neither is retried.
|
|
45
|
+
- **Structured answers are the engine's.** `ModelCall.outputSchema` is removed: our engine writes the JSON instruction and parses the answer (fenced, with control characters repaired; `parseJsonWithRepair` ported from pi-ai). `message.assistant` for a structured answer now carries its JSON text.
|
|
46
|
+
- **`read_artifact`** refuses a file the turn's model does not read (`artifact.unsupported`, with the reason).
|
|
47
|
+
- `unreadableReason` is removed; `isOffice` joins the media type helpers in `@nylorun/core/contracts`.
|
|
48
|
+
- Studio's file picker accepts every file, and the refusal chips are gone.
|
|
49
|
+
|
|
50
|
+
- ff6470e: **The harness writes the model's instructions and defines the sandbox and skill tools; no `runtime` block (protocol 15).** The third step of the harness boundary, still protocol 15 and Harness API 4. See MIGRATION.md.
|
|
51
|
+
|
|
52
|
+
- **No `runtime` block.** The Runtime no longer pins model-facing text or tools on a session's manifest: a session pins its definition as registered (`manifestHash` equals `definitionHash`) and keeps its sandbox spec on the session. The manifest schema refuses `runtime` with what replaces it (`REMOVED_MANIFEST_FIELDS`). `runtimeManifestFor`, `runtimeToolOf`, `RuntimeManifest`, `RUNTIME_TOOL_NAMES`, `isRuntimeToolName`, `createSandboxTools`, `SANDBOX_INSTRUCTIONS`, the skill tool names, `isSkillTool`, `SKILLS_USAGE`, `formatSkillCatalog` and `skillOfToolCall` leave `@nylorun/core/define`; `RUNTIME_PART_ID` is `SESSION_PART_ID` (`"session"`), and `agentFrom` takes `sessionInstructions`. `@nylorun/agents` no longer re-exports the skill catalog helpers. Migration 0030 closes the agent sessions that still pinned a `runtime` block (`closedReason: "protocol_15"`).
|
|
53
|
+
- **`turn.start` states facts.** `environment` (`TurnEnvironmentSchema`: `{id, kind, sandbox?: {workspace}}`) and `routing.sandbox.spec` (the pinned spec) join the agent's `skills`.
|
|
54
|
+
- **Our engine words them.** `@nylorun/harness` writes the skill catalog, the sandbox note and the skills' folder note, and defines the six sandbox tools, `load_skill` and `read_skill_resource`, in the order and bytes the `runtime` block had, so the prompt's prefix is unchanged (`engineToolsFor`, `sandboxTools`, `sandboxInstructions`, `skillCatalogText`, `skillFolderNote`, `skillTools`, all exported for a harness of your own). The skill tools run in the harness over `definition.file` (`runSkillTool`), and core no longer runs them (`tenant/skill-tool.ts` is gone). The sandbox tools' limits are harness configuration (`createHarness({ sandboxTools })`, `harnessExecutors({ sandboxTools })`, `DEFAULT_SANDBOX_TOOL_LIMITS`), as is the most a skill read takes into the context (`createHarness({ skillReadBytes })`, 10 MiB by default), held to the run's `limits.recordEntryBytes`.
|
|
55
|
+
- **Effects name their target.** A tool effect carries `target: {kind: "mcp" | "http" | "sandbox" | "harness" | "platform"}` (`EffectTargetSchema`) and may carry `skill`; the record routes by the kind, never by the tool's name, and a call without a target or one the session lacks is `tool.unavailable`. `hello.features.tools` and `NativeToolSchema` are removed, no tool name is reserved, and the record keeps the skill the intent names when the agent has it. A skill tool's `tool.completed` is `kind: "harness"` (it was `platform`).
|
|
56
|
+
- **Studio** drops the manifest panel's Runtime section: it shows the sandbox tools when the session's Environment has a sandbox.
|
|
57
|
+
|
|
58
|
+
- f443475: **The harness builds the MCP tool list and shapes tool results; tools are identified by server and tool (protocol 15).** The fourth step of the harness boundary, still protocol 15 and Harness API 4. See MIGRATION.md.
|
|
59
|
+
|
|
60
|
+
- **Tools have an identity.** An MCP tool call's target is `{kind: "mcp", server, tool}` (the server's own name for the tool) and an HTTP tool call's `{kind: "http", tool}` (its declared name); `platform` is gone. `toolName` is the model's name, for display. The record checks an MCP call against the session's discovery (`tool.unknown`) and the turn's tool settings (`tool.disabled`), and `tool.completed`, tool-call rows (`tool`), approvals (`Approve server / tool?`, `interaction.tool`) and traces (`nylorun.tool.identity`) carry the identity. The Tool Gate matches a call to its journaled target.
|
|
61
|
+
- **Tool policy keys on identity.** A rule's `tool` is the tool's identity, never the model's name. A rule whose `tool` has `__` in it is refused at `PUT /v1/tenant/tool-policy`; a stored one makes the policy unreadable, so every call is denied (and `GET` answers `409`) until the policy names the tool by `server` and `tool`.
|
|
62
|
+
- **`turn.start.mcp` states facts.** The session pins what its servers listed, raw (`McpSnapshot` v2: servers, scrubbed instructions, tools as named); each turn gets `mcp` (`McpFactsSchema`: every tool with `enabled` and the manifest's `deferred` hint) in place of `sessionTools` and `routing.mcpSnapshot`, and `session.mcp` answers `{mcp}`. `mcp.discovered` has no `renamed` or `deferred`. Migration 0031 closes the sessions that pinned the former snapshot (`closedReason: "protocol_15"`).
|
|
63
|
+
- **Our engine names, defers and searches.** `@nylorun/harness` names MCP tools (`mcpToolName`, `mcpToolNames`, within the 64-character provider ceiling), defers them by the manifest's setting or the model's window and pins that layout in its state (`mcpToolSet`, `McpLayout`), and runs `tool_search` (BM25) itself; core's `tool_search`, `deferredToolsTools`, `TOOL_SEARCH_TOOL` and `TOOL_CALL_TOOL` leave `@nylorun/core/define`, and `runDurable` takes `mcp` instead of `sessionTools`.
|
|
64
|
+
- **Our engine shapes tool results.** Core no longer stores large or binary tool results: the record refuses an outcome past `limits.recordEntryBytes` (`limit_exceeded`). Our engine spills them with `artifact.write`, keyed by the call and its bytes (`spillKey`), with a preview, an image as a file for a model that reads images, and one budget per step (`shapeToolOutcome`, `StepBudget`, exported for a harness of your own). The Tool Gate still scrubs credentials and refuses answers past `limits.toolAnswerBytes`.
|
|
65
|
+
- **Harness configuration.** `createHarness({ mcpTools, toolResults })` sets the deferral share, characters per token, fallback window, the note's instruction length, `tool_search`'s limits, the inline cap, preview head and tail, step budget, stub, small size and entry envelope (`DEFAULT_MCP_TOOL_CONFIG`, `DEFAULT_TOOL_RESULT_CONFIG`).
|
|
66
|
+
- **The MCP preview** names tools as Nylorun's engine would (`modelName`, `renamed`) and shows a server's instructions uncut.
|
|
67
|
+
- **Studio** shows an MCP tool as `server / tool` in tool and approval cards, with the model's name, and links the artifacts a tool's result was stored in.
|
|
68
|
+
- **`examples/harness-minimal`** spills a large `bash` output with `artifact.write` and keeps a preview; its README shows how a harness of your own offers MCP tools.
|
|
69
|
+
|
|
70
|
+
- cf425c6: **The harness mounts skills and saves outputs; the in-process harness uses the gates; compaction is a transcript edit (protocol 15).** The fifth step of the harness boundary, still protocol 15 and Harness API 4. See MIGRATION.md.
|
|
71
|
+
|
|
72
|
+
- **Skill folders are our engine's.** Before each sandbox call our engine mounts each skill version of the turn's tree at `/skills/<name>@<hash>/` with `executors.files.mount`, reading the bytes over `definition.file`; the SandboxManager only writes them (`mountFolder`), once per open sandbox (`present` after). `SandboxManager.mountSkills`, its `definitionFile` port and `SandboxSessionRef.manifest` are gone, and the operator sandbox route mounts nothing.
|
|
73
|
+
- **The outputs folder is our engine's (Q5).** At a completed turn's end in a sandbox our engine saves `/workspace/outputs` as the session's `outputs` folder before `turn.completed`, over the new folder mode of `artifact.write` (`kind: "folder"`, `file`, chunks named by hash, `unchanged`, `refused`). Core takes every byte, checks each file's hash before content is stored under it, dedupes, and keeps the content epoch and quotas. Versions say `source: "engine"`; `artifact.export.skipped` and `artifact.export.failed` are harness claims. Core's export (`artifacts/export.ts`, the `WorkspaceReader`, `workspace.read` listing and bytes calls) is removed.
|
|
74
|
+
- **No limit literals.** The new Runtime limit `folderEntries` (10,000; a count, its ceiling from the manifest's one string) replaces `EXPORT_MAX_FILES`, and `createHarness({ outputs: { dir, maxBytes } })` (`/workspace/outputs`, 1 GiB) replaces `EXPORT_MAX_BYTES`. `RUNTIME_LIMIT_CEILINGS` entries are `{value, unit, why}`.
|
|
75
|
+
- **In-process parity.** Every model call goes through the Model Gate: a scripted model is served by `providerModelGate`, metered like any. The MCP pool opens every server through the Tool Gate (`openRemote` is required; the in-process gate's `openMcp` finds the server in the session's pinned manifest and authorizes it with the vault). `ModelRoute` is `{tenantId, modelGate}`; `TenantContext.modelProvider`, `useVaultModel` and `workspaces` are gone.
|
|
76
|
+
- **Compaction is a transcript edit (Q4).** Summary calls say `purpose: "summary"` (no `message.assistant`), and the segment's edit that replaced the history says `kind: "compaction"` with its facts and summary calls (`CompactionFactsSchema`, `transcriptUpdates(..., compaction)`). Core checks the calls and writes one `context.compacted`, which loses `partial`.
|
|
77
|
+
|
|
78
|
+
- 23774c4: **The last hard-coded limits are configuration (harness boundary B15c).** Still protocol 15 and Harness API 4. Every default is the value before. See MIGRATION.md, and DEPLOYMENT.md's Runtime limits and Host tuning.
|
|
79
|
+
|
|
80
|
+
- **21 more Runtime limits** (`GET`/`PUT /v1/tenant/limits`): a message's parts (`messageParts`), page sizes (`pageItems`, `exportPageItems`, `environmentEventItems`; a page asked larger holds that many), labels (`artifactLabels`, `labelKeyChars`, `labelValueChars`), a manifest's setup command, descriptions and secret hosts (`setupCommandChars`, `manifestDescriptionChars`, `secretDescriptionChars`, `secretHosts`), a failed pod's reason (`setupReasonChars`, `setupCommandExcerptChars`), secret values (`secretValueChars`), the tool policy and budgets (`toolRules`, `toolRuleFieldChars`, `toolRuleTextChars`, `modelBudgets`) and flows (`flowConcurrency`, `flowMapItems`, `flowLoopIterations`, replacing the `NYLORUN_FLOW_*` variables no Host read). Request schemas lose these maxima; the Runtime checks the Tenant's.
|
|
81
|
+
- **More Host tuning** (`NYLORUN_TUNING`): token lifetimes and clock tolerance (`keys.*`), the advance deadline and grace (`execution.*`), `nylorun-operate`'s waits, the credential store's lock, sweep arming, Postgres batches and the replication pool, a basin repair's log cadence, egress sockets, the engine poll and sandbox memory floor, MCP listing pages and diagnostics, sandbox helper commands, the scrub threshold, exec event and local stream sizes; and in the engine, `flowValueChars` and `toolResults.minPreviewBytes`.
|
|
82
|
+
- **The CLI's own waits are `NYLORUN_CLI_TUNING`**: `nylorun start`'s waits and polls, the Compose healthchecks and WAL cap, and `nylorun local sandbox`'s waits.
|
|
83
|
+
- **Studio follows the Runtime's limits**: no upload cap of its own, the Tenant's `requestBodyBytes` read for a write it parses past the default (`@nylorun/agents` exports `RUNTIME_LIMIT_DEFAULTS`), no CPU cap in its form.
|
|
84
|
+
- **Kept, each justified where it is defined**: Linux's `MAX_ARG_STRLEN` (a setup command's ceiling) and `PATH_MAX` (a link target), a model-facing tool name's 64 characters, RFC 6838's media type length, Postgres's 65,535 bind parameters, a tmpfs page, and identifier grammars (the protocol's).
|
|
85
|
+
|
|
86
|
+
- b1e815d: **Runtime limits are a Tenant setting, and harnesses get them in `turn.start.limits`.**
|
|
87
|
+
|
|
88
|
+
- What one record entry, model call, model file, tool answer, custom harness state and Harness API chunk may hold is the new Management API setting `GET`/`PUT /v1/tenant/limits` (`{ limits: { recordEntryBytes, modelCallBytes, modelFileBytes, toolAnswerBytes, harnessStateBytes, chunkBytes } }`), also `admin.settings.limits` and `nylorun tenant settings limits [get | put <file|->]`.
|
|
89
|
+
- The defaults are today's sizes (`RUNTIME_LIMIT_DEFAULTS`): 960 KiB, 32 MiB, 8 MiB, 8 MiB, 256 KiB and 16 MiB. A limit left out of a `PUT` takes its default.
|
|
90
|
+
- Each limit has a ceiling a dependency sets (`RUNTIME_LIMIT_CEILINGS`): S2's 1 MiB record less 64 KiB for the event's envelope, the 64 MiB Harness API frame, the longest JavaScript string. A limit above its ceiling is `400`, naming the ceiling.
|
|
91
|
+
- Each is read from the Tenant's database where it is checked; nothing keeps it.
|
|
92
|
+
- **The record holds every write to `recordEntryBytes`.** An event whose payload, or an effect outcome whose value, is larger, whoever wrote it, is refused with `limit_exceeded`: `413` (`details.limit: "recordEntryBytes"`) to an API client, the new Harness API error code `limit_exceeded` to a harness. A harness's claimed event past it is refused rather than dropped. Before, such an event reached a record S2 could not take.
|
|
93
|
+
- **The gates read the setting.** The Model Gate refuses a body past `modelCallBytes` and a file past `modelFileBytes`; the Tool Gate keeps no MCP or HTTP answer past `toolAnswerBytes` (`mcp.too-large`, `http.too-large`) and reads no tool body past it. A custom harness's state past `harnessStateBytes` fails its turn with `limit_exceeded` (it was `invalid`), and a `definition.file` range longer than `chunkBytes` is `limit_exceeded`. Core's step budget for tool results is unchanged (256 KiB), or half `recordEntryBytes` when that is less.
|
|
94
|
+
- **`turn.start` carries `limits`** (`RuntimeLimitsSchema`), the limits in force when the segment started. Harness API 3 and protocol 14 are unchanged, but `TurnStartSchema` is strict: a harness built against an older `@nylorun/core` refuses a `turn.start` with `limits`, so upgrade a custom harness with the Runtime. Our harness asks for skill files `limits.chunkBytes` at a time, and holds MCP answers on its own connections to `limits.toolAnswerBytes`. `createHarness` takes `onStart(grant, start)`.
|
|
95
|
+
- **Removed exports:** `MAX_MODEL_CALL_BYTES`, `MAX_TOOL_BODY_BYTES`, `MAX_HARNESS_STATE_BYTES` and `DEFINITION_FILE_CHUNK_BYTES` from `@nylorun/core`. Added: `RuntimeLimitsSchema`, `RUNTIME_LIMIT_DEFAULTS`, `RUNTIME_LIMIT_CEILINGS`, `runtimeLimitsOf`, `runtimeLimitIssues`, `limitExceededMessage`, `S2_RECORD_MAX_BYTES`, `RECORD_ENVELOPE_RESERVE_BYTES`, `JS_STRING_MAX_LENGTH` and the `TenantLimits*` schemas.
|
|
96
|
+
|
|
97
|
+
- f2e9b0a: **Skill and artifact limits are set per Tenant and per Environment manifest; a skill holds up to 2 GiB by default, with no limit per file or on the number of files.**
|
|
98
|
+
|
|
99
|
+
- The 10 MiB limit per skill file and the 500-file limit are gone. A skill's files may hold up to the Tenant's skill limit together: 2 GiB by default (`SKILL_TOTAL_BYTES_DEFAULT`). A file at two paths counts twice, since a sandbox holds both copies. `SKILL_FILES_MAX` and `DEFINITION_FILE_MAX_BYTES` are no longer exported.
|
|
100
|
+
- The Tenant's skill limit is the new Management API setting `GET`/`PUT /v1/tenant/skills` (`{ limits: { totalBytes } }`), also available as `admin.settings.skills` and `nylorun tenant settings skills [get | put <file|->]`.
|
|
101
|
+
- `PUT /v1/files/sha256:<hex>` takes a file up to that limit.
|
|
102
|
+
- `PUT /v1/agents/{id}` refuses a skill over it, an agent used as a tool included: `413 limit_exceeded`, with `details.skills` listing each skill and its size.
|
|
103
|
+
- An environment manifest, or the inline fields of `PUT /v1/environments/{id}`, may set `limits`: `artifacts.fileBytes`, `artifacts.totalBytes` and `skills.totalBytes`. Like the manifest's other fields, they are fixed for the Environment's life.
|
|
104
|
+
- Each limit must be at most the Tenant's. A higher one is refused with `400` when the Environment is made or the manifest is saved.
|
|
105
|
+
- A limit left out is the Tenant's at the time it is checked. A Tenant that lowers a limit lowers it for every Environment.
|
|
106
|
+
- The Environment view's new `limits` field gives the limits in force.
|
|
107
|
+
- An Environment's artifacts are its sessions' artifacts and its disk versions. Uploads, `save_artifact`, turn-end exports and disk snapshots hold them to the Environment's per-file limit and to its own total, as well as to the Tenant's total. A turn-end export past the Environment's total is skipped with the new reason `environment_total`, and a disk snapshot past it is `413` with `details.limit: "environment_total"`.
|
|
108
|
+
- A session opens on an Environment only when its agent's skills fit the Environment's skill limit; otherwise it is `409 environment_unsuitable`, with `details.skills`.
|
|
109
|
+
- `PUT /v1/files` streams the body to the Object store instead of holding it in memory. Only bytes that match the named hash reach the file's key. Environment files named by hash are held to the same per-file maximum.
|
|
110
|
+
- `@nylorun/agents`: loading a skills folder no longer checks a size, since the limit is the Tenant's; the Runtime refuses an oversized skill. The `skills.file-too-large` and `skills.too-many-files` errors are gone. Files are hashed and read a chunk at a time.
|
|
111
|
+
- Sandboxes get skill files as a stream. A harness fetches them from core 16 MiB at a time: `definition.file` takes optional `offset` and `length` (at most the Runtime limit `chunkBytes`).
|
|
112
|
+
- `load_skill` and `read_skill_resource` read files of up to 10 MiB into the model's context. A larger file fails with `skill.resource_too_large`, and the error names the file's path in the sandbox when there is one.
|
|
113
|
+
|
|
114
|
+
- 6772612: **The remaining request, upload, token and sandbox limits are Tenant settings (harness boundary B15).** Still protocol 15 and Harness API 4. See MIGRATION.md and DEPLOYMENT.md's Runtime limits.
|
|
115
|
+
|
|
116
|
+
- **27 more Runtime limits** in `GET`/`PUT /v1/tenant/limits`, each with today's value as its default and a ceiling from a dependency (a JavaScript string or timer, a request read as one string, a Harness API frame, a JavaScript number): request bodies and inline files (`requestBodyBytes`, `inlineFileBytes`), `a2aWaitMs`, `errorExcerptChars`, `traceContentBytes`, an Environment's labels, setup and input files (`environmentLabels`, `environmentSetupCommands`, `environmentFiles`, `environmentFilesPerEntry`, `environmentSecretSlots`, `setupCommandMs`, `setupOutputChars`), disk versions (`diskVersionEntries`, `diskVersionBytes`, `diskLeaseMs`, `diskPodWaitMs`; an Environment's manifest may lower the first two with `limits.disk`), model calls (`modelRequestMs`, `modelIdleMs`, `modelAttempts`, `modelRetryDelayMs`, `modelProviderRetries`, `modelRetryDelayMaxMs`, read by the gates for each call) and tools (`toolAttempts`, `httpToolTimeoutMs`, `mcpPreviewMs`, `mcpMetadataBytes`, and the new `mcpSnapshotBytes`: what a session pins of its MCP servers' tools and instructions, past which a server is left out with a diagnostic).
|
|
117
|
+
- **Schema maxima are checked against the Tenant's limits**: an Environment's labels, setup commands, input files, files per entry, secret slots and setup timeout, and an HTTP tool's `timeoutMs` (at deploy and at each call). `limits.environments` and `lifecycle.stopGrace` lose their arbitrary caps; an identity file's issuer takes any number of grants and `jwksFetch` settings.
|
|
118
|
+
- **`turn.start.limits` carries only a harness's limits** (`HarnessLimitsSchema`, `harnessLimitsOf`), and a harness drops one it does not know. `transcriptUpdates` takes `recordEntryBytes` and fills each event up to it; `CHUNK_BYTES` is gone.
|
|
119
|
+
- **Constants a dependency or a standard fixes stay, named for it**: a token is read up to Node's `http.maxHeaderSize`; artifact names and folder paths keep `FILE_NAME_MAX` (255) and `FILE_PATH_MAX` (1,024); a skill file's path is what `FILE_PATH_MAX` leaves under its mount folder; `tracestate` keeps W3C's 512.
|
|
120
|
+
- **Removed**: `ENVIRONMENT_LABELS_MAX`, `ENVIRONMENT_SETUP_MAX`, `ENVIRONMENT_SETUP_TIMEOUT_MAX_MS` (now `ENVIRONMENT_SETUP_TIMEOUT_DEFAULT`), `ENVIRONMENT_FILES_MAX`, `ENVIRONMENT_SECRET_SLOTS_MAX`, `TOKEN_ENVIRONMENT_GRANTS_MAX`, `HTTP_TOOL_MAX_TIMEOUT_MS`, `READ_ARTIFACT_MAX_BYTES` and `CHUNK_BYTES` from `@nylorun/core`; the image checks (`decodeImageBase64`, `validateImageBytes`, `IMAGE_MEDIA_TYPES`, `MAX_IMAGE_BYTES`), the Tenant configuration's `modelCall` and `TrustedIssuersOptions`' `refetchMs`/`maxAgeMs` from `@nylorun/runtime`. Studio's Environment form no longer caps setup commands and input files at 16: the Runtime checks the Tenant's limit.
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- 2459430: **An `environment_secret` reads `nylorun_managed` in the sandbox instead of `nylorun-managed`, so CLIs that check a token's format send their requests.**
|
|
125
|
+
|
|
126
|
+
- The Vercel CLI refuses a `VERCEL_TOKEN` with any character outside letters, digits and `_` (`Must not contain: "-"`) and exits before egress-gate can set the header. `ENVIRONMENT_SECRET_SENTINEL` is now `nylorun_managed`.
|
|
127
|
+
- egress-gate never compares the value: it replaces the credential's header whatever the CLI sent, so nothing else changes. A script that checks for the literal `nylorun-managed` should check for `nylorun_managed`.
|
|
128
|
+
|
|
3
129
|
## 0.22.0-beta
|
|
4
130
|
|
|
5
131
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Shared portable agent definitions and runtime protocol contracts. No engine,
|
|
4
4
|
HTTP client, Node host or SDK dependencies.
|
|
5
5
|
|
|
6
|
-
- `/define`: `Agent`, `tool`, the manifest
|
|
6
|
+
- `/define`: `Agent`, `tool`, the manifest, schemas and explicit local bindings.
|
|
7
7
|
- `/contracts`: runtime request, event, action and response schemas.
|
|
8
8
|
- `/compatibility`: protocol/definition versions and canonical manifest hashing.
|
|
9
9
|
- `/transport`: what every Runtime client does on the wire: the `/health`
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
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,
|
|
4
|
+
* or while it waits on an approval, an answer or an uncertain call, is queued
|
|
5
|
+
* (`{status: "queued", queuedMessageId, position}`, `message.queued`) instead of refused, unless
|
|
6
|
+
* it asks `delivery: "reject"`; the refusal now has a code, `409 session_busy`. When the turn ends
|
|
7
|
+
* (completed, failed or cancelled), every queued message starts one turn, in order, each its own
|
|
8
|
+
* user message (`queue.taken`); our engine's turn input for more than one is
|
|
9
|
+
* `{kind: "messages", messages}` (Harness API 5, additive). Past the Runtime limit
|
|
10
|
+
* `sessionQueuedMessages` a message is `429 queue_full`. Session reads count `queuedMessages`. The
|
|
11
|
+
* Host serves protocol 16 and 17: a message from a protocol 16 client is `reject` unless it says
|
|
12
|
+
* 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
|
|
14
|
+
* versioned document at `/v1/agent-manifests/{name}` with a `harness` section (what runs inside
|
|
15
|
+
* the loop, including the harness's id) and a `runtime` section (what an environment manifest
|
|
16
|
+
* said); the Runtime checks the two against each other when it is saved
|
|
17
|
+
* (`422 manifest_inconsistent`), so `requires` and `409 environment_unsuitable` are gone, and so
|
|
18
|
+
* are agent definitions (`PUT /v1/agents/:id` with a v7 manifest) and environment manifests.
|
|
19
|
+
* Environments are Agents: `/v1/agents/{id}` (with `.../events`, `stop`, `reset`, `snapshot`,
|
|
20
|
+
* `restore`, `versions`, `fork` and `secrets`) is made from a saved manifest only, records it as
|
|
21
|
+
* 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`
|
|
23
|
+
* answers the plan), a save moves every Agent that tracks the manifest, and each turn takes the
|
|
24
|
+
* version its Agent runs when it starts; a runtime change waits for a pod's next start, and its
|
|
25
|
+
* kind, harness and storage are fixed (`409 agent_fixed_field`). Reads add `state`
|
|
26
|
+
* (`working`, `sleeping`, `input_required`, `failing`, `paused`) and `attention`, and the
|
|
27
|
+
* compute's state moves to `compute.state`. Every session belongs to one Agent:
|
|
28
|
+
* `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
|
|
30
|
+
* (`agents:write`, `agent-manifests:write`) and identity-file grants (`agents`) say Agent. Model
|
|
31
|
+
* budget scope `agent` is `manifest`. Harness API 5: `turn.start.agent` replaces
|
|
32
|
+
* `turn.start.environment`. Sessions opened before protocol 16 are closed (`protocol_16`) and
|
|
33
|
+
* stay readable; Environments, their disks and vaults are gone. The Host serves protocol 16 only.
|
|
34
|
+
* Protocol 15: the harness boundary, a fresh start. Model-facing work belongs to the harness. Our
|
|
35
|
+
* engine's `read_artifact` and `save_artifact` run in our harness, over the Harness API's new
|
|
36
|
+
* artifact seam (`artifact.read`, `artifact.write`; Harness API 4), so a session's pinned
|
|
37
|
+
* `runtime` block no longer carries them, and those names are no longer reserved: an author tool
|
|
38
|
+
* may take one, though our harness then refuses the turn. A `tool.completed` of either says kind
|
|
39
|
+
* `harness`. Files reach the model by the harness's decision: a message may name any file
|
|
40
|
+
* within the artifact size limits (no more `422 attachment_unsupported`), `turn.start.model`
|
|
41
|
+
* describes the model the turn uses (what it reads, its window), and the Model Gate only fetches
|
|
42
|
+
* the artifacts a call names and translates the call, refusing a part the provider cannot take
|
|
43
|
+
* (`unsupported_input`). A `ModelCall` has no `outputSchema`: a harness writes its own JSON
|
|
44
|
+
* instruction and parses the answer. The harness names a session's MCP tools, defers them and
|
|
45
|
+
* shapes tool results: `turn.start.mcp` states what the servers listed, raw, and every MCP tool
|
|
46
|
+
* call names its identity (`target: {kind: "mcp", server, tool}`), which tool policy and approval
|
|
47
|
+
* key on (a policy rule with `__` in its `tool` refuses every call). The record refuses an
|
|
48
|
+
* outcome past `limits.recordEntryBytes`. Sessions pinned before protocol 15 must be recreated.
|
|
49
|
+
* The Host serves protocol 15 only.
|
|
3
50
|
* Protocol 14: environment manifests (D63 to D65). `/v1/environment-manifests/{name}` holds
|
|
4
51
|
* named, versioned definitions of a kind of Environment, saved like agents (with `If-Match` and
|
|
5
52
|
* `?dryRun=true`), and `PUT /v1/environments/{id}` takes `manifest: "name"` or `"name@n"`. An
|
|
@@ -55,7 +102,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
55
102
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
56
103
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
57
104
|
*/
|
|
58
|
-
export declare const PROTOCOL_VERSION =
|
|
105
|
+
export declare const PROTOCOL_VERSION = 17;
|
|
59
106
|
/** What a client of this protocol requires of a Host. */
|
|
60
107
|
export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts",
|
|
61
108
|
/**
|
|
@@ -70,18 +117,7 @@ export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts
|
|
|
70
117
|
* metadata at `/.well-known/oauth-protected-resource` when it has trusted issuers.
|
|
71
118
|
*/
|
|
72
119
|
"resource-server",
|
|
73
|
-
/**
|
|
74
|
-
* Protocol 11: Environments (`/v1/environments/{id}`, kinds `virtual`, `pod` and `none`), each
|
|
75
|
-
* with one vault written on the Runtime API; sessions name an `environment`; token callers
|
|
76
|
-
* carry Environment grants checked at every turn start, and `environments:write` lets a
|
|
77
|
-
* subject create, change and delete the Environments it is granted.
|
|
78
|
-
*/
|
|
79
|
-
"environments",
|
|
80
|
-
/**
|
|
81
|
-
* Protocol 12: the model catalog and provider list say which inputs each model reads, and a
|
|
82
|
-
* message naming a file the Tenant's model does not read is refused with
|
|
83
|
-
* `422 attachment_unsupported`.
|
|
84
|
-
*/
|
|
120
|
+
/** Protocol 12: the model catalog and provider list say which inputs each model reads. */
|
|
85
121
|
"model-inputs",
|
|
86
122
|
/**
|
|
87
123
|
* Protocol 13: agent manifest v7 has no capabilities (its instructions, tools, skills and
|
|
@@ -90,11 +126,26 @@ export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts
|
|
|
90
126
|
*/
|
|
91
127
|
"flat-manifest",
|
|
92
128
|
/**
|
|
93
|
-
* Protocol
|
|
94
|
-
*
|
|
95
|
-
*
|
|
129
|
+
* Protocol 15: the harness boundary. `read_artifact` and `save_artifact` are our harness's
|
|
130
|
+
* tools, not the Runtime's: a session's pinned `runtime` block no longer carries them, and an
|
|
131
|
+
* author tool may take their names. MCP tools are named by the harness and identified by
|
|
132
|
+
* `{server, tool}`: tool policy rules and approvals name them so.
|
|
96
133
|
*/
|
|
97
|
-
"
|
|
134
|
+
"harness-boundary",
|
|
135
|
+
/**
|
|
136
|
+
* Protocol 16: agent manifests (`/v1/agent-manifests/{name}`, v8, with a harness and a runtime
|
|
137
|
+
* section checked against each other at save) and Agents (`/v1/agents/{id}`, kinds `virtual`,
|
|
138
|
+
* `pod` and `none`, each with one vault), made from one manifest version, with a derived
|
|
139
|
+
* `state`; every session runs on an Agent; token callers carry Agent grants checked at every
|
|
140
|
+
* turn start, and `agents:write` lets a subject create, change and delete the Agents it is
|
|
141
|
+
* granted.
|
|
142
|
+
*/
|
|
143
|
+
"agents",
|
|
144
|
+
/**
|
|
145
|
+
* Protocol 17: a queue per session (D76). A message to a busy session is queued unless it asks
|
|
146
|
+
* `delivery: "reject"`, and the busy refusal is `409 session_busy`.
|
|
147
|
+
*/
|
|
148
|
+
"session-queue"];
|
|
98
149
|
export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
99
150
|
/**
|
|
100
151
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -144,9 +195,10 @@ export interface ProtocolRange {
|
|
|
144
195
|
features: readonly string[];
|
|
145
196
|
}
|
|
146
197
|
/**
|
|
147
|
-
* What this Host serves: protocol
|
|
148
|
-
*
|
|
149
|
-
*
|
|
198
|
+
* What this Host serves: protocol 16 and 17. Protocol 16 replaced agent definitions and
|
|
199
|
+
* Environments with agent manifests and Agents, so an older client is answered `426` naming the
|
|
200
|
+
* protocol it needs rather than routes it cannot use. Protocol 17 is additive: a protocol 16
|
|
201
|
+
* client's messages default to `delivery: "reject"`.
|
|
150
202
|
*/
|
|
151
203
|
export declare const HOST_PROTOCOL: ProtocolRange;
|
|
152
204
|
export declare const DEFINITION_SCHEMA_VERSION = 2;
|
|
@@ -184,21 +236,44 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
184
236
|
"invalid_request",
|
|
185
237
|
/** A route that acts for a person was called without one (`Nylorun-Subject`). */
|
|
186
238
|
"subject_required",
|
|
187
|
-
/** A token caller's
|
|
188
|
-
"
|
|
239
|
+
/** A token caller's Agent grants do not reach the Agent. */
|
|
240
|
+
"agent_not_granted",
|
|
241
|
+
/**
|
|
242
|
+
* A message to a session whose turn runs, or that waits on an approval, an answer or an
|
|
243
|
+
* uncertain call, sent with `delivery: "reject"` (protocol 17): `409`. Without it the message is
|
|
244
|
+
* queued.
|
|
245
|
+
*/
|
|
246
|
+
"session_busy",
|
|
247
|
+
/**
|
|
248
|
+
* The session already holds the Runtime limit `sessionQueuedMessages` queued messages
|
|
249
|
+
* (protocol 17): `429`. They start a turn when the running one ends.
|
|
250
|
+
*/
|
|
251
|
+
"queue_full",
|
|
252
|
+
/**
|
|
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.
|
|
255
|
+
*/
|
|
256
|
+
"trigger_expired",
|
|
257
|
+
/** A signed delivery to a paused webhook trigger (D75): `409`; nothing runs. */
|
|
258
|
+
"trigger_paused",
|
|
259
|
+
/**
|
|
260
|
+
* 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.
|
|
262
|
+
*/
|
|
263
|
+
"memory_conflict",
|
|
189
264
|
/** Disk work (snapshot, restore, stop, reset) while a turn runs, or a turn while a disk copy runs. */
|
|
190
|
-
"
|
|
191
|
-
/** The
|
|
192
|
-
"
|
|
193
|
-
/** The Tenant's placement keeps this session's harness off the host its
|
|
265
|
+
"agent_busy",
|
|
266
|
+
/** The Agent is gone, or its kind cannot run on this Runtime. */
|
|
267
|
+
"agent_unavailable",
|
|
268
|
+
/** The Tenant's placement keeps this session's harness off the host its Agent needs. */
|
|
194
269
|
"placement_refused",
|
|
195
|
-
/** A pod
|
|
196
|
-
"
|
|
270
|
+
/** A pod Agent's volume or node is gone: only `POST /v1/agents/{id}/reset` brings it back. */
|
|
271
|
+
"agent_lost",
|
|
197
272
|
/**
|
|
198
|
-
* The
|
|
273
|
+
* The Agent names an owner (`owner`) other than the session's owner: `403` to an
|
|
199
274
|
* application key; a caller acting for a person gets the opaque `404`.
|
|
200
275
|
*/
|
|
201
|
-
"
|
|
276
|
+
"agent_owner_mismatch",
|
|
202
277
|
/**
|
|
203
278
|
* The session's Environment runs another harness than the one the session pinned when it
|
|
204
279
|
* opened (track R4): its id was deleted and made again with another harness, or an
|
|
@@ -239,30 +314,25 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
239
314
|
*/
|
|
240
315
|
"credential_conflict",
|
|
241
316
|
/**
|
|
242
|
-
* A
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*/
|
|
246
|
-
"attachment_unsupported",
|
|
247
|
-
/**
|
|
248
|
-
* A `PUT /v1/environments/{id}` asked an existing Environment to run something else
|
|
249
|
-
* (protocol 14, D63): only its labels and owner guard may change. Fork it into a new
|
|
250
|
-
* Environment (`POST /v1/environments/{id}/fork`). `details.fields` names what differed.
|
|
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
|
|
319
|
+
* `details.fields`. Fork it into a new Agent (`POST /v1/agents/{id}/fork`) instead.
|
|
251
320
|
*/
|
|
252
|
-
"
|
|
321
|
+
"agent_fixed_field",
|
|
253
322
|
/**
|
|
254
|
-
* A secret write named a secret the
|
|
255
|
-
*
|
|
323
|
+
* A secret write named a secret the Agent's manifest does not declare (D64): `409`. Add the
|
|
324
|
+
* slot to the manifest's runtime section and move the Agent to the new version.
|
|
256
325
|
*/
|
|
257
326
|
"secret_not_in_manifest",
|
|
258
327
|
/**
|
|
259
|
-
*
|
|
260
|
-
* `details.
|
|
328
|
+
* An agent manifest whose harness and runtime sections do not fit each other (protocol 16):
|
|
329
|
+
* `422` when it is saved. `details.gaps` names each gap: a custom harness off a pod, a
|
|
330
|
+
* credential that is no declared slot of the right type, a sandbox the runtime does not give.
|
|
261
331
|
*/
|
|
262
|
-
"
|
|
263
|
-
/** No
|
|
332
|
+
"manifest_inconsistent",
|
|
333
|
+
/** No agent manifest has this name, or no version with this number. */
|
|
264
334
|
"manifest_not_found",
|
|
265
|
-
/** An
|
|
335
|
+
/** An agent manifest some Agent was made from cannot be deleted: `409`. */
|
|
266
336
|
"manifest_in_use",
|
|
267
337
|
/**
|
|
268
338
|
* `If-Match` named a version that is no longer the latest (D63): `412`. Read the manifest
|
|
@@ -279,6 +349,9 @@ export declare const ARTIFACT_ID_PATTERN: RegExp;
|
|
|
279
349
|
/**
|
|
280
350
|
* An application key's id: an operator key's name, which names its client (e.g. `backend`).
|
|
281
351
|
* `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
|
|
353
|
+
* and means the same in every installation, so its length is a constant of protocol 15, not a
|
|
354
|
+
* setting.
|
|
282
355
|
*/
|
|
283
356
|
export declare const APPLICATION_KEY_ID_PATTERN: RegExp;
|
|
284
357
|
/**
|