@nylorun/harness 0.22.1-beta → 0.23.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/HOST_CONTRACT.md +17 -19
  3. package/README.md +5 -30
  4. package/dist/api/executors.d.ts +5 -4
  5. package/dist/api/harness.d.ts +0 -10
  6. package/dist/api/harness.js +1 -52
  7. package/dist/api/host.d.ts +2 -8
  8. package/dist/api/host.js +3 -15
  9. package/dist/api/run.d.ts +0 -11
  10. package/dist/api/run.js +1 -11
  11. package/dist/compatibility.d.ts +4 -12
  12. package/dist/compatibility.js +3 -11
  13. package/dist/definition/agent-definition.d.ts +0 -3
  14. package/dist/definition/agent-definition.js +0 -2
  15. package/dist/flow/checkpoint.d.ts +16 -0
  16. package/dist/flow/checkpoint.js +6 -2
  17. package/dist/flow/context.d.ts +19 -10
  18. package/dist/flow/context.js +36 -20
  19. package/dist/flow/engine.d.ts +25 -7
  20. package/dist/flow/engine.js +304 -38
  21. package/dist/flow/index.d.ts +3 -5
  22. package/dist/flow/index.js +3 -5
  23. package/dist/flow/paths.d.ts +1 -8
  24. package/dist/flow/paths.js +1 -12
  25. package/dist/flow/tool.d.ts +14 -0
  26. package/dist/flow/tool.js +67 -0
  27. package/dist/flow/types.d.ts +30 -3
  28. package/dist/flow/types.js +14 -1
  29. package/dist/loop/run.js +5 -134
  30. package/dist/loop/state.js +2 -22
  31. package/dist/loop/step/run.d.ts +1 -10
  32. package/dist/loop/step/run.js +2 -101
  33. package/dist/loop/step/runtime.d.ts +0 -17
  34. package/dist/run/durable.d.ts +7 -11
  35. package/dist/run/durable.js +14 -33
  36. package/dist/run/index.d.ts +3 -4
  37. package/dist/run/index.js +1 -2
  38. package/dist/types/execution.d.ts +5 -18
  39. package/package.json +2 -2
  40. package/dist/flow/chain.d.ts +0 -8
  41. package/dist/flow/chain.js +0 -27
  42. package/dist/flow/loop.d.ts +0 -35
  43. package/dist/flow/loop.js +0 -238
  44. package/dist/flow/map.d.ts +0 -7
  45. package/dist/flow/map.js +0 -64
  46. package/dist/flow/node.d.ts +0 -31
  47. package/dist/flow/node.js +0 -113
  48. package/dist/flow/parallel.d.ts +0 -7
  49. package/dist/flow/parallel.js +0 -47
  50. package/dist/flow/switch.d.ts +0 -8
  51. package/dist/flow/switch.js +0 -35
  52. package/dist/flow/v2.d.ts +0 -12
  53. package/dist/flow/v2.js +0 -370
  54. package/dist/loop/step/hooks.d.ts +0 -56
  55. package/dist/loop/step/hooks.js +0 -191
package/CHANGELOG.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.23.0-beta
4
+
5
+ ### Major Changes
6
+
7
+ - 4bd2a0b: **Flows run no code: workflow manifest v3 (manifest-only agents, step M2).** A flow agent is data: each stage gets the previous stage's output, a switch reads it, a map runs over it and a loop asks a verifier agent. See MIGRATION.md for what replaces each function.
8
+
9
+ - **Breaking (`@nylorun/core`, `@nylorun/agents`):** stage `input` functions, `switch` `on`, loop `verify` functions and `decide` are removed; a builder option that names one is refused with what replaces it. `.loop()` takes a verifier agent and a required `max`. New `.pipe(...children)` adds one stage per child; `.step()` is a deprecated alias (`NYLORUN_DEP_STEP`). `Chain`, `Switch`, `Parallel`, `Map`, `Loop`, `withInstructions`, `withoutTools`, `isSlot`, `functionKey` and the `StageArgs`, `LoopVerifyFn`, `LoopDecideArgs`, `LoopChoice` and v1 workflow types are removed. `Agent.from` for a flow takes tool nodes only.
10
+ - **Breaking (`@nylorun/core`):** workflow manifests are `workflowSchemaVersion: 3`; no node carries `input`, a switch has no `on`, a loop's `verify` is an agent and `max` is required. A v1 or v2 manifest is refused with a message naming the change. The `fn` and `verify` Actions and effect kinds, and the `loop.decided` event, are removed. `WorkflowManifestV2` / `WorkflowNodeV2` / `isWorkflowManifestV2` are now `WorkflowManifest` / `WorkflowNode` / `isWorkflowManifest`.
11
+ - **Breaking (`@nylorun/harness`):** the flow engine is `flow-3` and runs only v3 manifests; v1 and v2 engines, `agentTurnValue` and the `fn` / `verify` effect kinds are removed. A switch picks the case named by the previous output or its `route` field, a map runs over an array or an `items` array, and a loop retries with its verifier's feedback until `max`. An `agent` effect carries the flow's input as `flowInput` when the stage's input differs.
12
+ - **Breaking (`@nylorun/runtime`):** no `fn` or `verify` Actions are offered or delivered. An agent stage's message shows the flow's input as the original request before its own input, and each verifier verdict is recorded as `loop.verified`.
13
+ - `@nylorun/studio`: the workflow tree draws v3 manifests (a loop shows its verifier agent and `max`); the loop timeline drops decide outcomes, and `loop.verified` shows the feedback.
14
+
15
+ - 40b7648: **HTTP tools and static approval (manifest-only agents, M3).** A tool can be one HTTP request the Runtime makes through its Tool Gate, with no Action endpoint; code tools keep working.
16
+
17
+ - `@nylorun/core`: `ToolManifest` gains `http` (`url`, `method` `POST`/`PUT`/`PATCH`, `credential`, `timeoutMs` up to 300000) and `approval` (`never`/`always`, HTTP tools only); a tool is never both an agent and an HTTP request, and `fn` and `command` are refused ("Functions are not available yet"). Remote MCP servers take `approval`. `http()` builds an HTTP tool, `httpToolOf()` reads one; `SESSION_ID_HEADER`, `TURN_ID_HEADER` and `AGENT_ID_HEADER` name the headers it sends. `Agent.from` rebuilds HTTP tools without an implementation; an HTTP tool is refused as a flow stage.
18
+ - `@nylorun/harness`: hosted HTTP tools keep their target, and `approval: "always"` (an HTTP tool's, or `DurableSessionTool.approval` for a remote MCP server's tools) pauses each call for approval. **Breaking:** `HarnessExecutors.recovers.remoteMcp` is renamed `recovers.tool`.
19
+ - `@nylorun/agents`: exports `http` and the identity header constants.
20
+ - `@nylorun/runtime`: the Tool Gate runs HTTP tool calls (`POST /nylorun/v1/http-calls` at the gates service, or in process): the input as JSON under the Host's address policy, the session's vault credential bound to the URL, `Nylorun-Session-Id`/`-Turn-Id`/`-Agent-Id` and the effect id as `Idempotency-Key`. A keyed call runs once (`tool_crossings`), so a re-send after a takeover joins it and one lost with the gateway is `uncertain`. Non-2xx answers, timeouts, refused addresses, missing credentials and output mismatches are tool errors the model sees. The credential resolver is asked with `target.kind: "http"` and the tool's `credential` name.
21
+ - `@nylorun/studio`: the Agent Manifest tab lists HTTP tools with their method and URL, and marks tools and MCP servers that wait for approval.
22
+
23
+ - c135267: **Action endpoints are removed (manifest-only agents, M6).** The Runtime runs no code of yours during a session: an agent's tools are HTTP tools, remote MCP servers, agents used as tools and the Runtime's built-ins. Protocol stays 8; the `action-endpoints` feature is gone, so a client that requires it is refused. See MIGRATION.md, "Action endpoints are removed".
24
+
25
+ - **Breaking (`@nylorun/core`):** the `Action`, endpoint (`PutEndpointsRequest`, `Endpoint`, `EndpointHealth`, …) and delivery schemas, `SIGNATURE_HEADER`, `OUTCOME_HEADER`, `DELIVERY_TOKEN_TYPE` and the `action.*` events (`action.pending`, `.delivered`, `.delivery_failed`, `.completed`, `.uncertain`) are removed, and `ToolDefinition.background` with them. `ActionOutcome` is renamed `EffectOutcome`. Tenant status loses `checks.endpoints`, `agents[].registered` and `agents[].endpoint`, and `counts.pendingActions`; the session view loses `actions`. A `turn.paused` interaction carries the tool call's `callId`. New `codeToolsOf` and `codeToolRefusal` name a definition's tools that would run your code. The Harness API is v2 (`HARNESS_API_VERSION = 2`): `TurnStart.options.holdMs` and `effect.resolved` are removed.
26
+ - **Breaking (`@nylorun/harness`):** held runs are gone: `createHarness` loses `holdMs`, and `apiHost` its `hold` option.
27
+ - **Breaking (`@nylorun/agents`):** `createActionHandler`, `executeAction`, `createActionSandbox`, `definitionDeclaresSandbox`, `isActionSandboxTool` and the `Action`, `ActionOutcome`, `ActionHandler`, `ActionHandlerOptions`, `RegisterOptions`, `ExecuteActionOptions` and `ExecutableDefinition` types are removed. `saveAgent` refuses a code tool (`tool({ run })`) or a flow tool stage before sending; its `implementationVersion` is optional (`NYLORUN_IMPLEMENTATION_VERSION`, else `dev`).
28
+ - **Breaking (`@nylorun/runtime`):** `/v1/endpoints` and `/v1/actions/*` answer `404`; delivery tokens, the deliverer, background tools, held runs (`TenantConfig.actionHoldMs`), `DurableExecution.deliver`, the Restate `NylorunAction` object, the `action_result` wake and the gates service's `/nylorun/v1/deliveries` are removed, and a migration drops the `actions` and `endpoints` tables. `PUT /v1/agents/:id` refuses a definition with a code tool or a flow tool stage (`400`); a tool the Runtime cannot run fails with `tool.unavailable`. The fixture model answers in text when the agent offers no `lookup_order` tool.
29
+ - **Breaking (`@nylorun/cli`):** `nylo endpoints` is removed (a usage error that says why); `nylo status` shows uncertain effects instead of pending Actions.
30
+ - **Breaking (`@nylorun/create-agent`):** the starter saves its agent with `saveAgent` and runs no server: no Action endpoint, `PORT` or `NYLORUN_ACTIONS_URL`. Its assistant has no tools, with a commented `http()` tool to start from.
31
+ - `nylorun`: the local stack's comments speak of MCP servers and HTTP tools on this machine, not Action endpoints.
32
+ - `@nylorun/studio`: the `action.*` event views and delivery status are removed; the chat shows `tool.completed`, and the Agent Manifest tab lists tools without a target as code tools.
33
+
34
+ - d36f0d9: **Hooks are removed; manifests are v5 (manifest-only agents, step M1).** The Runtime no longer calls the developer's code before or after a turn or a model call. See MIGRATION.md for what replaces each use.
35
+
36
+ - **Breaking (`@nylorun/core`, `@nylorun/agents`):** `.beforeTurn()`, `.beforeModel()`, `.afterModel()`, `.afterTurn()`, the deprecated `.before()` / `.after()`, a capability's `before` / `after`, and the `Patch`, `Decision`, `TurnDecision`, `BeforeHook`, `AfterHook`, `HookScope` types and `runHookPoint` / `hooksFrom` helpers are removed. A capability that still passes `before` or `after` is refused with `hooks were removed: …`.
37
+ - **Breaking (`@nylorun/core`):** `manifestSchemaVersion` is 5. `capabilities[].hooks` is gone; a manifest that names it, or a v3/v4 manifest, is refused with a message naming the change. The `hook` Action and the `hook` effect kind of the Harness API are removed.
38
+ - **Breaking (`@nylorun/harness`):** the turn loop runs no hooks; the turn state a checkpoint carries is `{ turnId }`, and the engine version is `hosted-4`, so checkpoints of earlier engines are refused.
39
+ - `@nylorun/runtime`: no `hook` Actions are offered or delivered.
40
+ - `@nylorun/studio`: the Agent Manifest tab drops the Hooks count and the turn lifecycle.
41
+
42
+ ### Minor Changes
43
+
44
+ - a64aaca: **HTTP in flows (manifest-only agents, after M2 and M3).** An `http()` tool is a flow stage, and `http({ url })` is a Loop's HTTP verifier; the Runtime makes both requests through its Tool Gate, with no Action endpoint.
45
+
46
+ - `@nylorun/core`: an HTTP tool may be a stage in `.pipe()`, a switch case, a Map item or a Loop body; its tool node carries its `http` target and binds nothing. The build refuses an HTTP stage whose input is known to be the wrong type (`flow.input-mismatch`, e.g. after an agent with no `.output()`) and `approval: "always"` on one (`flow.approval-unsupported`). `http()` without a name and an input returns an `HttpTarget`, an HTTP verifier: `.loop(body, { verify: http({ url, method?, credential?, timeoutMs? }), max })`, in the manifest `loop.verify: { http }`. `fn` and `command` verify targets are refused ("Functions are not available yet"). New `flowHttpTarget()` finds an HTTP stage or verifier by stage key; `isHttpTarget()`, `WorkflowHttpVerify` and `WorkflowLoopVerify` are exported.
47
+ - `@nylorun/harness`: the flow engine checks an HTTP stage's input against its schema (`tool.invalid-input`), runs it as a `tool` effect and fails the stage on a failed outcome (`http.status`, `http.timeout`, `tool.invalid-output`, …). An HTTP verifier is a `tool` effect with `{ input, output, iteration }` and `context.role: "verify-http"`; a non-verdict or a failed request is `loop.verify-failed`. A Loop body that starts with an HTTP stage is retried with the Loop's input.
48
+ - `@nylorun/agents`: `http()` builds HTTP verifiers too.
49
+ - `@nylorun/runtime`: a flow's HTTP stages and verifiers are executed like an agent's HTTP tool: address policy, the flow session's vault credential, `Nylorun-Session-Id`/`-Turn-Id`/`-Agent-Id` (the flow agent's id) and the flow effect id as `Idempotency-Key`, run once at the gates service (`POST /nylorun/v1/http-calls` takes `tool: { sessionId?, stage }`) and `uncertain` when the answer is lost. An HTTP verifier's verdict is recorded as `loop.verified`.
50
+ - `@nylorun/studio`: the workflow tree shows HTTP stages and HTTP verifiers with their method and URL.
51
+
52
+ ### Patch Changes
53
+
54
+ - 107b07d: **Skills are files the Runtime holds and serves itself (track R2 M4).** Breaking: a skill's manifest names every file of its folder, and the skill tools no longer run in the developer's process. The protocol stays at 8 until the track ships.
55
+
56
+ - `@nylorun/core`: `SkillManifest` gains `files`, each path of the skill's folder (`SKILL.md` required, `/`-separated, no `..`, at most 500 files) mapped to `sha256:<hex>`, so the manifest hash pins them. `skillRecords` and `SkillRecord` are gone; a declaration's `skillFiles` holds the bytes to upload (`SkillFileSource`). `load_skill` and `read_skill_resource` keep their names and input schemas but fail with `skills.runtime-only` outside a Runtime. New `DefinitionFileViewSchema`, error code `definition_files_missing`, Harness API request `definition.file`, and `definitionFilesOf`, `isSkillTool` and the definition-file limits. A top-level `functions` key is reserved and refused ("Functions are not available yet").
57
+ - `@nylorun/runtime`: `PUT /v1/files/sha256:<hex>` stores a definition file (application key; at most 10 MiB; a body of another hash is `400`; `201` stored, `200` held already) in the Object store at `definitions/sha256/<hex>`, and `HEAD` says whether the Tenant holds one. New tables `definition_files` and `definition_file_uses` (migration `0013_definition_files`). `PUT /v1/agents/{id}` refuses a definition, nested agents and flow agents included, that names a file the Tenant lacks (`400 definition_files_missing`). Core serves `load_skill` (the `SKILL.md` body, the other files' paths, and `sandboxPath` with a sandbox) and `read_skill_resource` (text files only) from those files, with no Action. A session's sandbox gets each skill's files read-only under `/skills/<name>/` before the first call that opens it, and the sandbox's instructions name them; pod sandboxes mount an `emptyDir` at `/skills`. Unused files are not deleted yet.
58
+ - `@nylorun/agents`: `.skills()`, `skills()` and `.plugin()` read every file of a skill's folder, binary included (not `.git/`, `node_modules/`, OS files or `.env` files), and hash it; a file over 10 MiB or more than 500 files fail the build. `saveAgent` uploads the files the Runtime lacks before the definition; `client.files` (`has`, `upload`, `ensure`) does it by hand.
59
+ - `@nylorun/harness`: tests only.
60
+ - `@nylorun/studio`: the agent's manifest lists each skill's files.
61
+
62
+ - Pin core to the tested release.
63
+ - Updated dependencies [4bd2a0b]
64
+ - Updated dependencies [a64aaca]
65
+ - Updated dependencies [40b7648]
66
+ - Updated dependencies [713e676]
67
+ - Updated dependencies [c135267]
68
+ - Updated dependencies [d36f0d9]
69
+ - Updated dependencies [107b07d]
70
+ - @nylorun/core@0.15.0-beta
71
+
72
+ ## 0.22.2-beta
73
+
74
+ ### Patch Changes
75
+
76
+ - b387620: **A flow agent's tool step that asks now pauses the flow.** A tool step calling `ctx.approve(...)` or `ctx.ask(...)` used to settle its `interaction-required` outcome as the step's output, so the flow moved on and `turn.completed` carried that object, resume token and all. Now the flow session pauses with `turn.paused` and a wait (with the tool node's `path` and `toolName`); `session.approve(...)` or `session.respond(...)` on the flow's own session runs the tool again with the answer and its resume token, and the steps before it replay from the journal. A rejected approval settles the step `denied` without running the tool again, as in an agent's turn, so the turn fails with `tool.denied`. A flow's resume stays in its checkpoint segment (`FlowCheckpoint.resumes`), so its wake is keyed by the interaction. Waits a workflow copied from its linked sessions are no longer read back as its own.
77
+ - Pin core to the tested release.
78
+ - Updated dependencies [3b3bdc6]
79
+ - Updated dependencies [6576e12]
80
+ - Updated dependencies [b28bdd7]
81
+ - Updated dependencies [cc107b1]
82
+ - Updated dependencies [7f763c3]
83
+ - Updated dependencies [98b0d37]
84
+ - Updated dependencies [c66d8ed]
85
+ - @nylorun/core@0.14.0-beta
86
+
3
87
  ## 0.22.1-beta
4
88
 
5
89
  ### Patch Changes
package/HOST_CONTRACT.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Durable execution and session protocol — beta freeze
2
2
 
3
- Artifact: `@nylorun/harness@0.14.0-beta.3`. Package version is separate from protocol 1, definition schema 4, durable checkpoint 1 / engine `hosted-3`, and inner execution checkpoint 1. Public execution API and shared contracts are the compatibility boundary. Cloud installs published npm packages and does not import the OSS Runtime.
3
+ Artifact: `@nylorun/harness@0.14.0-beta.3`. Package version is separate from protocol 1, definition schema 5, durable checkpoint 1 / engine `hosted-4`, and inner execution checkpoint 1. Public execution API and shared contracts are the compatibility boundary. Cloud installs published npm packages and does not import the OSS Runtime.
4
4
 
5
5
  ## HTTP (both hosts)
6
6
 
7
- Bearer application credentials: `PUT /v1/agents/:agentId` (`PutAgentRequest`: requestId, complete manifest, implementationVersion, optional pluginRoots); `PUT /v1/sessions/:sessionId` (`PutSessionRequest`: requestId, agentId, trusted ownerUserId, optional info, optional vaultIds, optional credentialSelections, optional `sandbox` — `false`, `{ session }` to share another session's sandbox (same owner), or an inline `{ image?, network?: { allow }, resources? }` checked against the Tenant's limits; omitted means the Tenant default; fixed for the session's life); `GET /v1/sessions/:sessionId`; `POST /v1/sessions/:sessionId/commands`; `GET /v1/sessions/:sessionId/items?cursor=...`; `GET /v1/sessions/:sessionId/events?cursor=...` (SSE, Last-Event-ID also accepted); vault administration `POST/GET/DELETE /v1/vaults` and `/v1/vaults/:vaultId/credentials` (application principals acting for no one; subjects and token callers are refused, protocol 7). Commands use `SessionCommandSchema`. A `message` command is exactly one of `{ content: string }` or `{ data: JsonValue }`, plus optional `manifest` (turn-only agent variant; see Turn manifests below). Application principals may call `POST /v1/sessions/:id/sandbox/:tool` for session-scoped sandbox built-ins when the session has a sandbox and no active agent turn. Vault creates and credential rotations use `idempotencyKey`; requestId is excluded from comparison; the same key and body replay the stored metadata response; a changed body is 409. Credential responses omit secret values. `GET /v1/vaults?ownerUserId=` lists that user's vaults. A session attaches only vaults with the same ownerUserId. User vaults cannot see or attach the host vault. `GET /v1/tenant/model` returns `{configured:false}` or the active provider, model, authType, and optional baseUrl, never the secret. `PUT /v1/tenant/model` upserts a host-scope provider credential and makes it active (idempotencyKey, requestId excluded from comparison). `PUT /v1/tenant/model/selection` switches the active provider/model among configured credentials without a new secret. `GET /v1/tenant/providers` lists configured providers with name, model, authType, lastUpdated, and active. `GET /v1/tenant/models` returns the public provider catalog. A later session PUT may replace vaultIds and credentialSelections; agentId, ownerUserId, and info stay the creation identity. GET session returns id, agentId, ownerUserId, status, activeTurnId, vaultIds, credentialSelections, mcpSnapshot, mcpDiagnostics, plus inspectable waits/uncertainty as available. mcpSnapshot is null until the first turn discovers MCP tools; it is then pinned for the session and contains no secrets. pluginRoots are stored beside the agent definition and are not part of the manifest hash. History returns `{items: LiveEvent[], cursor: string|null}`; empty history cursor is null. `PUT /v1/endpoints` (`PutEndpointsRequest`: endpoints of agentId, url, implementationVersion, optional manifestHash, timeoutMs and maxConcurrent) registers the Action endpoint that runs each agent's Actions and returns them with their health; `GET /v1/endpoints` lists them, `DELETE /v1/endpoints/:agentId` removes one, and `POST /v1/endpoints/:agentId/ping` sends a signed ping through it. Registering an endpoint delivers the agent's pending Actions. Only application principals, never subjects, manage endpoints.
7
+ Bearer application credentials: `PUT /v1/agents/:agentId` (`PutAgentRequest`: requestId, complete manifest, implementationVersion); `PUT /v1/sessions/:sessionId` (`PutSessionRequest`: requestId, agentId, trusted ownerUserId, optional info, optional vaultIds, optional credentialSelections, optional `sandbox` — `false`, `{ session }` to share another session's sandbox (same owner), or an inline `{ image?, network?: { allow }, resources? }` checked against the Tenant's limits; omitted means the Tenant default; fixed for the session's life); `GET /v1/sessions/:sessionId`; `POST /v1/sessions/:sessionId/commands`; `GET /v1/sessions/:sessionId/items?cursor=...`; `GET /v1/sessions/:sessionId/events?cursor=...` (SSE, Last-Event-ID also accepted). Bearer management keys (the Management API, protocol 8; an application key there is `403 key_role_mismatch`): vault administration `POST/GET/DELETE /v1/tenant/vaults` and `/v1/tenant/vaults/:vaultId/credentials`, and the `/v1/tenant/*` model routes below. Commands use `SessionCommandSchema`. A `message` command is exactly one of `{ content: string }` or `{ data: JsonValue }`, plus optional `manifest` (turn-only agent variant; see Turn manifests below). Application principals may call `POST /v1/sessions/:id/sandbox/:tool` for session-scoped sandbox built-ins when the session has a sandbox and no active agent turn. Vault creates and credential rotations use `idempotencyKey`; requestId is excluded from comparison; the same key and body replay the stored metadata response; a changed body is 409. Credential responses omit secret values. `GET /v1/tenant/vaults?ownerUserId=` also lists that user's vaults. A session attaches only vaults with the same ownerUserId. User vaults cannot see or attach the host vault. `GET /v1/tenant/model` returns `{configured:false}` or the active provider, model, authType, and optional baseUrl, never the secret. `PUT /v1/tenant/model` upserts a host-scope provider credential and makes it active (idempotencyKey, requestId excluded from comparison). `PUT /v1/tenant/model/selection` switches the active provider/model among configured credentials without a new secret. `GET /v1/tenant/providers` lists configured providers with name, model, authType, lastUpdated, and active. `GET /v1/tenant/models` returns the public provider catalog. A later session PUT may replace vaultIds and credentialSelections; agentId, ownerUserId, and info stay the creation identity. GET session returns id, agentId, ownerUserId, status, activeTurnId, vaultIds, credentialSelections, mcpSnapshot, mcpDiagnostics, plus inspectable waits/uncertainty as available. mcpSnapshot is null until the first turn discovers MCP tools; it is then pinned for the session and contains no secrets. History returns `{items: LiveEvent[], cursor: string|null}`; empty history cursor is null.
8
8
 
9
- **Action endpoints (protocol 3).** The Runtime POSTs each Action to its agent's endpoint as `ActionDelivery` `{type: "action", action, sandbox}` (or `{type: "ping"}`), signed with a delivery token in `Nylorun-Signature`: an ES256 JWT (`typ` `nylorun-delivery+jwt`, `kid` from the Tenant's public JWKS at `GET /v1/access/jwks`, readable without a credential) whose `aud` is the registered URL, `sub` the Action id (or `ping`), `gen` the delivery generation, `bdy` the base64url SHA-256 of the body, and `exp` at most 900 s ahead. Before sending, the Action becomes `delivering` with a new `generation` and a `deadlineAt`, and `action.delivered` is published. The endpoint answers `200` with the tool value (with `Nylorun-Outcome: 1`, a tagged outcome), `202` to finish in the background, `409` when it serves a different manifest (retried), `429`/`503` to be retried later, or another `4xx` to fail the Action (`endpoint.rejected`). A background delivery keeps its deadline with `POST /v1/actions/:id/heartbeat` (delivery token; returns `{token, deadlineAt}`, `409` once the Action was cancelled, lost or delivered again) and settles with `POST /v1/actions/:id/result` `{value}`, whose receipt is idempotent. The delivery token authorizes only those routes and `POST /v1/actions/:id/sandbox/:tool` for its own Action and generation, and is refused from browsers. A delivery that may have been received but was never answered is lost: a `tool` becomes `uncertain`; a `hook`, `fn` or `verify` returns to pending and is delivered again, and the new generation fences the earlier one. An endpoint that cannot be reached is retried with backoff and `action.delivery_failed`. Cancelling a turn aborts its deliveries. Action rows may use `kind` `tool` | `hook` | `fn` | `verify`; workflow code carries `path` and `key` instead of `capabilityId` / `toolName`.
9
+ **Manifest-only agents (protocol 8, track R2).** The Runtime runs the whole agent from its manifest and its definition files, and never calls the developer's code during a session: Action endpoints, delivery tokens, background tools and held runs are gone (`/v1/endpoints` and `/v1/actions/*` answer `404`). An agent's tools are HTTP tools (`http`), remote MCP servers, agents used as tools and the Runtime's built-ins. `PUT /v1/agents/:agentId` refuses (`400`) a definition with a tool that has no `http` and no `agent` and is not a built-in, and a flow agent with a `tool` stage (`codeToolRefusal` in `/define`); a tool effect the Runtime cannot run fails with `tool.unavailable`. `tool({ run })` runs only in the local engine (`/run`).
10
10
 
11
11
  **Tenant and protocol headers.** A Host serves the one Tenant of its
12
12
  installation, and nothing in a request selects it (protocol 5). Every Tenant
@@ -17,8 +17,8 @@ authentication. For one release the Host also serves protocol 4 clients, which
17
17
  send `Nylorun-Tenant`: a header naming the Host's Tenant is accepted, one naming
18
18
  another Tenant (or a malformed one) is the opaque `404`. A Tenant id in the query string or body is ignored. A Tenant
19
19
  that could not be opened, an unknown Tenant and a rejected credential share the
20
- opaque `404` body. Admin routes use the Host admin key and never accept a
21
- Tenant bearer; there are no Admin Tenant routes. Vocabulary:
20
+ opaque `404` body. The Admin API is gone (protocol 8): `/v1/admin/*` answers
21
+ `404`, and the admin key is no request's credential. Vocabulary:
22
22
  [runtime/src/CONTEXT.md](../runtime/src/CONTEXT.md).
23
23
 
24
24
  Unauthenticated `GET /health` returns status, `service: "nylorun-runtime"`,
@@ -27,39 +27,37 @@ version, `hostId`, pid, and `protocol: { min, max, features }` (plus diagnostic
27
27
  still works. `GET /ready` is `200` only after the listener is up and the Host's
28
28
  Tenant is open; a Tenant that cannot be opened fails it with its cause
29
29
  (`schema-too-new`, `kek-missing`, `database-layout-old`, …), also reported in
30
- `/v1/admin/status`.
30
+ `nylorun-operate status` inside the runtime container (`nylorun status` on a local Tenant).
31
31
 
32
- All command idempotency keys bind to canonical request content within a session; requestId is transport metadata and is excluded from content comparison; exact semantic duplicates return the stored original response; changed content conflicts (409). A background result posted again for the same delivery returns its original receipt; a different outcome, or a result for a lost, cancelled or redelivered generation, is rejected (`409`). Heartbeat cannot resurrect a lost delivery. Lost tool work is uncertain, not automatically delivered again. A lost `hook` action returns to pending and is delivered again, because hooks are pure by contract. Results after cancellation cannot resume a turn. Only a delivery token can submit an action result. No hardcoded production credentials.
32
+ All command idempotency keys bind to canonical request content within a session; requestId is transport metadata and is excluded from content comparison; exact semantic duplicates return the stored original response; changed content conflicts (409). Lost tool work is uncertain, not automatically run again. Results after cancellation cannot resume a turn. No hardcoded production credentials.
33
33
 
34
34
  ## Engine host
35
35
 
36
- `createDurableCheckpoint({manifest,sessionId,turnId,input,state?,info?,segment?})`, `runDurable({manifest,checkpoint,host,signal?,sessionTools?})` from `/run`. `DurableHost.resolveEffect(HostEffect)` atomically creates or reads an individually identified effect and returns `{status:'completed',outcome:{value,statePatch?}}` or `{status:'pending'|'uncertain'}`. Model effect `input` is the complete ModelCall (instructions/history/tools/output schema); context contains invocationId and, for a call that summarizes history, `compaction: {trigger, tokensBefore, keptTokens}` (its invocationId starts with `compaction-`). When history no longer fits the model's window, the engine replaces the older transcript entries with one `compaction` entry and keeps the rest; hosts publish `context.compacted` for such a call instead of `message.assistant`. Its completed value is a ModelCandidate, a string, or a failure outcome `{kind:'failed', code, message, retryable, retryAfterMs?}` for a provider failure the Runtime classified (codes in `MODEL_FAILURE_CODES`); the engine fails the step with `model.<code>`. A classified failure is a known outcome, not a lost one, so it is never `uncertain`. Runtime provider code owns credentials and invocation. Tool effects have capabilityId, toolName, serialized input and context. Tool result value is a ToolOutcome or a plain tool output; statePatch contains changed session keys. A `hook` effect runs one hook point for every capability that registered it: `hook` is `{at: "before"|"after", scope: "turn"|"step", capabilityIds}` in manifest order, and its effect id ends in a stable name (`before-turn`, `before-step:<stepId>`, `after-step:<stepId>`, `after-turn:<stepId>`). Its completed value is `{results: {[capabilityId]: Patch | Decision | TurnDecision}}`. `before-turn` is issued only in a turn's first segment. Tool context includes invocationId, resume, state, info and stable idempotencyKey. Customer implementationVersion is pinned by the runtime outside durable checkpoints.
36
+ `createDurableCheckpoint({manifest,sessionId,turnId,input,state?,info?,segment?})`, `runDurable({manifest,checkpoint,host,signal?,sessionTools?})` from `/run`. `DurableHost.resolveEffect(HostEffect)` atomically creates or reads an individually identified effect and returns `{status:'completed',outcome:{value,statePatch?}}` or `{status:'pending'|'uncertain'}`. Model effect `input` is the complete ModelCall (instructions/history/tools/output schema); context contains invocationId and, for a call that summarizes history, `compaction: {trigger, tokensBefore, keptTokens}` (its invocationId starts with `compaction-`). When history no longer fits the model's window, the engine replaces the older transcript entries with one `compaction` entry and keeps the rest; hosts publish `context.compacted` for such a call instead of `message.assistant`. Its completed value is a ModelCandidate, a string, or a failure outcome `{kind:'failed', code, message, retryable, retryAfterMs?}` for a provider failure the Runtime classified (codes in `MODEL_FAILURE_CODES`); the engine fails the step with `model.<code>`. A classified failure is a known outcome, not a lost one, so it is never `uncertain`. Runtime provider code owns credentials and invocation. Tool effects have capabilityId, toolName, serialized input and context. Tool result value is a ToolOutcome or a plain tool output; statePatch contains changed session keys. Tool context includes invocationId, resume, state, info and stable idempotencyKey. Customer implementationVersion is pinned by the runtime outside durable checkpoints.
37
37
 
38
- Persist checkpoint BEFORE scheduling, effect intent BEFORE provider invocation or notification, and outcome BEFORE resumption. Journaling an entire runDurable call as one replayable operation is forbidden. The durable path deterministically reconstructs a segment from its immutable starting checkpoint and individually cached effect outcomes. A waiting result returns that starting checkpoint: do not replace it with an intermediate preview. The journal is required continuation data and must be retained with the checkpoint. Stable IDs include turn/segment and deterministic invocation identity. There is no live continuation or request-held promise while waiting, except that a Harness API run may hold its lease for a pending Action's outcome (below). Runtimes serialize work per session, check cancellation before effects and before settlement, and fence ownership. Lost provider acknowledgement becomes uncertain; do not repeat it merely because a worker restarts.
38
+ Persist checkpoint BEFORE scheduling, effect intent BEFORE provider invocation or notification, and outcome BEFORE resumption. Journaling an entire runDurable call as one replayable operation is forbidden. The durable path deterministically reconstructs a segment from its immutable starting checkpoint and individually cached effect outcomes. A waiting result returns that starting checkpoint: do not replace it with an intermediate preview. The journal is required continuation data and must be retained with the checkpoint. Stable IDs include turn/segment and deterministic invocation identity. There is no live continuation or request-held promise while waiting. Runtimes serialize work per session, check cancellation before effects and before settlement, and fence ownership. Lost provider acknowledgement becomes uncertain; do not repeat it merely because a worker restarts.
39
39
 
40
40
  A terminal/paused result includes `result.state`. Save it. A new message uses a new turnId with prior completed state. Approval/response resumes paused state via a new checkpoint, same turnId, `segment + 1`, with `{kind:'approve',interactionId,approved}` or `{kind:'respond',interactionId,value}`. An action result simply reruns the SAME suspended checkpoint/segment after recording the outcome. `runDurable({yieldAfter: {steps, ms}})` lets a long turn end a segment at a step boundary with status `yielded` (Model Calls §10): the result state is mid-turn (status `active`, `turn` kept); save it, write a new checkpoint for the same turnId at `segment + 1` with input `{kind:'continue'}`, and schedule it. A yielded segment emits no `turn.*` event, and its effects are never read again. Paused plan records pending interactions/deferred calls; waiting on remote action is distinct from a human wait. Cancellation is host-owned and must fence both running and pending work. Runtime supplies canonical events; execution observations are not wire events and reconstruction must not republish duplicate history.
41
41
 
42
- Host resolveEffect must bind the effect ID to the original request and reject drift. Intent/outcome, action transitions, checkpoint settlement and canonical event/outbox writes must use runtime transactions. Restate journals individual effect boundaries, not the loop. Scheduling, storage, publication, delivery policy and reconciliation remain runtime-owned.
42
+ Host resolveEffect must bind the effect ID to the original request and reject drift. Intent/outcome, checkpoint settlement and canonical event/outbox writes must use runtime transactions. Restate journals individual effect boundaries, not the loop. Scheduling, storage, publication, delivery policy and reconciliation remain runtime-owned.
43
43
 
44
- Agents used as tools: a manifest tool with an `agent` body (the child manifest inlined; name equals the child id, description equals the child description, input is the standard `{task}` schema, no outputSchema, no nested agent tools, identical sandbox specs across the tree — in a session opened with a sandbox the Runtime adds the same `nylorun.sandbox` capability to the root and each inlined child) is run by the engine inside the parent's `runDurable`, never delivered to an endpoint. Its model, tool and hook effects carry `agent: {id, path, delegationId}` (`delegationId` is the parent tool call's invocationId), keep the root `agentId` and `manifestHash`, and use identity `<delegationId>/<inner identity>`; tool context `idempotencyKey` is prefixed the same way. Hosts resolve child effects against the child manifest (`delegateManifest`) for pinned tool schemas, sandbox and MCP routing, copy `agent` onto the Action, and include it in action event payloads. A `delegation` effect (identity `<delegationId>:started` or `<delegationId>:settled`, input `{task}` or `{status, outcome}`) must be recorded completed immediately with value null and publish `delegation.started` / `delegation.completed` exactly once; the journal makes replays silent. `DurableSessionTool.agentId` attaches discovered MCP tools to a child; MCP snapshot records and diagnostics carry `agentId`, and child plugin roots are keyed `<childId>/<capabilityId>`. Children share the session sandbox. `GET /v1/sessions/:id/items?agent=` filters history by `payload.agent.delegationId` or `payload.agent.path`. Existing checkpoints are unaffected; engine version stays `hosted-2`. A tool whose `agent` body is a flow agent (workflow manifest v2) is not run in-process: the engine issues one `agent` effect (identity `<delegationId>:flow`, input `{agentId, input: task, path}`, context `{role: "delegate", delegationId}`, `agent` ref set) between the `delegation` start and settle points. The host starts a linked flow session from the pinned parent manifest's inlined flow (session id `derive(parentSessionId, path, "delegate", delegationId)`, plugin roots under `<flowId>/`), sends the task as its message, and completes the effect with the flow's output, or `{kind: "failed", code, message}`, when its turn ends. Cancelling the parent cascades to linked sessions.
44
+ Agents used as tools: a manifest tool with an `agent` body (the child manifest inlined; name equals the child id, description equals the child description, input is the standard `{task}` schema, no outputSchema, no nested agent tools, identical sandbox specs across the tree — in a session opened with a sandbox the Runtime adds the same `nylorun.sandbox` capability to the root and each inlined child) is run by the engine inside the parent's `runDurable`. Its model and tool effects carry `agent: {id, path, delegationId}` (`delegationId` is the parent tool call's invocationId), keep the root `agentId` and `manifestHash`, and use identity `<delegationId>/<inner identity>`; tool context `idempotencyKey` is prefixed the same way. Hosts resolve child effects against the child manifest (`delegateManifest`) for pinned tool schemas, sandbox and MCP routing, and include `agent` in `tool.completed` payloads. A `delegation` effect (identity `<delegationId>:started` or `<delegationId>:settled`, input `{task}` or `{status, outcome}`) must be recorded completed immediately with value null and publish `delegation.started` / `delegation.completed` exactly once; the journal makes replays silent. `DurableSessionTool.agentId` attaches discovered MCP tools to a child; MCP snapshot records and diagnostics carry `agentId`. Children share the session sandbox. `GET /v1/sessions/:id/items?agent=` filters history by `payload.agent.delegationId` or `payload.agent.path`. Existing checkpoints are unaffected; engine version stays `hosted-2`. A tool whose `agent` body is a flow agent (workflow manifest v3) is not run in-process: the engine issues one `agent` effect (identity `<delegationId>:flow`, input `{agentId, input: task, path}`, context `{role: "delegate", delegationId}`, `agent` ref set) between the `delegation` start and settle points. The host starts a linked flow session from the pinned parent manifest's inlined flow (session id `derive(parentSessionId, path, "delegate", delegationId)`), sends the task as its message, and completes the effect with the flow's output, or `{kind: "failed", code, message}`, when its turn ends. Cancelling the parent cascades to linked sessions.
45
45
 
46
- **Workflows (flow engine).** Definitions with `kind: "workflow"` run through `createFlowCheckpoint` / `runFlowDurable` from `/run` (same `DurableResult` shape as `runDurable`). The turn loop in `harness/src/loop/` is unchanged. Flow effects extend `HostEffect.kind` with `agent`, `tool` (workflow tool node), `fn`, and `verify`. Each carries `path` (node address), `key` (path without Map indices), and `iterations` (enclosing Loop vector as a dotted string, or `"-"` outside Loops). Effect ids are `${turnId}:${segment}:flow:${path}:${kind}:${iterations}`. On workflow manifest v2 (engine `flow-2`), an `agent` or `tool` effect's `path` is the leaf path (the leaf's id, `[i]` per Map item, nested flow agent ids in front) and its `key` drops the indices; an `fn` or `verify` effect's `key` is the stage key plus `:input`, `:on`, `:verify` or `:decide`, and its `path` is the stage's site plus the same suffix. v2 `agent` effect input adds `flow` (nested flow agent ids, outermost first); the host resolves the leaf from the workflow manifest's embedded `agents` (`embeddedAgent`) and gives the linked session the leaf's manifest, its hash, and the workflow's plugin roots under `<agentId>/`. Checkpoints pin the engine: v1 manifests run on `flow-1`, v2 on `flow-2`. An Action endpoint answers `409` to v2 flow actions whose `manifestHash` is not the manifest it serves, and the Runtime delivers them again later. The host resolves `agent` effects only through the public session contract (create linked session, message with derived idempotency key, settle on linked `turn.completed` / failed / cancelled). `tool`, `fn`, and `verify` become Actions delivered to the workflow's endpoint; Actions use `path` + `key` instead of `capabilityId` + `toolName`. `fn` and `verify` are pure or repeat-safe: a lost delivery returns them to pending and they are delivered again; tool nodes become `uncertain` and are never re-run automatically. Parallelism comes from pending effects returned together; the Runtime caps concurrency with `RuntimeOptions.flow` / env (`maxConcurrency`, `maxMapItems`, `maxLoopIterations`).
46
+ **Workflows (flow engine).** Definitions with `kind: "workflow"` (workflow manifest v3) run through `createFlowCheckpoint` / `runFlowDurable` from `/run` (same `DurableResult` shape as `runDurable`) on engine `flow-3`; checkpoints pin it, and v1/v2 manifests are refused. The turn loop in `harness/src/loop/` is unchanged. A flow runs no developer code: its effects are `agent` (a leaf agent's turn) and `tool` (a workflow tool node). Each carries `path` (the leaf path: the leaf's id, `[i]` per Map item, nested flow agent ids in front), `key` (the path without Map indices) and `iterations` (enclosing Loop vector as a dotted string, or `"-"` outside Loops). Effect ids are `${turnId}:${segment}:flow:${path}:${kind}:${iterations}`. The first stage gets the flow's input and each later stage the previous output; a Switch reads it (a string, or its `route` field), a Map runs over it (an array, or its `items`), and a Loop asks a verifier (an agent, or an HTTP verifier) for a verdict (`{ pass, feedback? }`) and retries the body with the feedback, up to `max`. `agent` effect input is `{ agentId, input, path, flow?, flowInput? }`: `flow` names the nested flow agents, outermost first; `flowInput` is the flow agent's input, sent when the stage's input differs, and the host puts it in the linked message as the original request before the stage's input. Effect `context` carries `loopPath` and `n` for a Loop's turns, and `role: "verify-agent"` for its verifier, which gets a fresh session per attempt and whose verdict the host records as `loop.verified`. The host resolves the leaf from the workflow manifest's embedded `agents` (`embeddedAgent`) and gives the linked session the leaf's manifest and its hash, only through the public session contract (create linked session, message with derived idempotency key, settle on linked `turn.completed` / failed / cancelled). A `tool` effect carries `path` + `key` instead of `capabilityId` + `toolName`. A code tool node (no `http`) runs only in the local engine: the Runtime refuses a flow with one at save and fails such an effect with `tool.unavailable`. The `tool` effects of an HTTP stage (a tool node with `http`, input checked against its schema first) and of an HTTP verifier (`loop.verify: { http }`, input `{ input, output, iteration }`, `context.role: "verify-http"`, at the verify position's key) are requests the host makes through its Tool Gate as for an agent's HTTP tool, the effect id as `Idempotency-Key`, the HTTP outcome (`{ kind: "completed", output }` or `{ kind: "failed", code, message }`) as the value, and an HTTP verifier's verdict recorded as `loop.verified`; a Loop body that starts with an HTTP stage is retried with the Loop's input. A lost HTTP stage becomes `uncertain` and is never re-run automatically. Parallelism comes from pending effects returned together; the Runtime caps concurrency with `RuntimeOptions.flow` / env (`maxConcurrency`, `maxMapItems`, `maxLoopIterations`).
47
47
 
48
- **Turn manifests.** A `message` command may include optional `manifest`. Any app may use it (not only Loops). When present, the Runtime parses it with `AgentManifestSchema`, requires it to be a **variant** of the session's pinned manifest (id fixed; tools/skills/delegates may only shrink; hooks, MCP, and sandbox must not change), hashes and stores it by hash for that turn only (it does not latch — a later message without `manifest` uses the pin), and rebases `state.manifestHash` at turn start when the prior state hash and the turn hash are both the pin or validated variants of it. Invalid variants fail closed (`loop.invalid-agent` when a Loop decide supplies one).
48
+ **Turn manifests.** A `message` command may include optional `manifest`. Any app may use it (not only Loops). When present, the Runtime parses it with `AgentManifestSchema`, requires it to be a **variant** of the session's pinned manifest (id fixed; tools/skills/delegates may only shrink; MCP and sandbox must not change), hashes and stores it by hash for that turn only (it does not latch — a later message without `manifest` uses the pin), and rebases `state.manifestHash` at turn start when the prior state hash and the turn hash are both the pin or validated variants of it. Invalid variants fail closed.
49
49
 
50
- **Shared sandbox.** Definitions declare no sandbox; a session is opened with one (`PutSessionRequest.sandbox`), resolved against the Tenant's limits and pinned on the session. An agent session's pinned manifest is its definition plus capability `nylorun.sandbox` (the six built-ins, the sandbox instructions and the resolved spec), so its hash differs from the definition's; a workflow session's manifest is unchanged and its sandbox is stored beside it. A tree has one sandbox, keyed by the owning session id. `sandbox: { session }` attaches another session's sandbox (same `ownerUserId`, same Tenant); a session whose definition declares none inherits the owner's spec and tools. Linked agent sessions created for agent nodes attach with `sandbox: { session: workflowSessionId }` and inherit the same way. Application principals call `POST /v1/sessions/:id/sandbox/:tool` (`bash` | `read` | `write` | `edit` | `grep` | `glob`); refused while that session has an active agent turn. Action endpoints call `POST /v1/actions/:id/sandbox/:tool` with the delivery token, while that generation is being delivered; the SDK exposes this as `ctx.sandbox` on tool / fn / verify actions (undefined when the session has no sandbox). `session.sandbox` on the application client mirrors the session endpoint. Registration refuses a definition that declares a sandbox; definitions stored before Sandboxes v3 keep theirs.
50
+ **Shared sandbox.** Definitions declare no sandbox; a session is opened with one (`PutSessionRequest.sandbox`), resolved against the Tenant's limits and pinned on the session. An agent session's pinned manifest is its definition plus capability `nylorun.sandbox` (the six built-ins, the sandbox instructions and the resolved spec), so its hash differs from the definition's; a workflow session's manifest is unchanged and its sandbox is stored beside it. A tree has one sandbox, keyed by the owning session id. `sandbox: { session }` attaches another session's sandbox (same `ownerUserId`, same Tenant); a session whose definition declares none inherits the owner's spec and tools. Linked agent sessions created for agent nodes attach with `sandbox: { session: workflowSessionId }` and inherit the same way. Application principals call `POST /v1/sessions/:id/sandbox/:tool` (`bash` | `read` | `write` | `edit` | `grep` | `glob`); refused while that session has an active agent turn. `session.sandbox` on the application client mirrors the session endpoint. Registration refuses a definition that declares a sandbox; definitions stored before Sandboxes v3 keep theirs.
51
51
 
52
52
  ## Harness API v1
53
53
 
54
- The Runtime runs every segment through the Harness API (blueprint D37–D42): core keeps scheduling, the record, settle and takeover; a harness runs the engine. Protocol types, schemas, the request hash, transcript edits and the RPC channel are `@nylorun/core/harness-api` (`HARNESS_API_VERSION = 1`); the harness client is `@nylorun/harness/api` (`createHarness({channel, executors})`). A Tenant runs one harness in its own process over a memory channel, or (F6.2, `NYLORUN_HARNESS=remote`) harnesses connect to core's Harness API listener over WebSocket (`/nylorun/harness/v1`, the harness credential): `--service harness` runs one with its own MCP pool and sandboxes and no store, and serves the Tenant's workspaces (`workspace.*`). Protocol 5, durable checkpoint 1, engine `hosted-3` and the Action wire are unchanged.
55
-
56
- Held runs (F6.2): when core answers an effect intent of an Action (a tool, hook, `fn` or `verify` an Action endpoint runs) with `pending`, the run may wait in its lease for the outcome (`effect.resolved`), at most `TurnStart.options.holdMs` (default 5 minutes) and never past the segment's yield budget, renewing as usual. The outcome resolves the effect locally and the segment goes on; past the hold the segment ends as waiting and the outcome resumes it by replay, as before. The journal is unchanged either way: the outcome is recorded before it is sent.
54
+ The Runtime runs every segment through the Harness API (blueprint D37–D42): core keeps scheduling, the record, settle and takeover; a harness runs the engine. Protocol types, schemas, the request hash, transcript edits and the RPC channel are `@nylorun/core/harness-api` (`HARNESS_API_VERSION = 2`: v2 removed held runs, `TurnStart.options.holdMs` and `effect.resolved`, with track R2); the harness client is `@nylorun/harness/api` (`createHarness({channel, executors})`). A Tenant runs one harness in its own process over a memory channel, or (F6.2, `NYLORUN_HARNESS=remote`) harnesses connect to core's Harness API listener over WebSocket (`/nylorun/harness/v1`, the harness credential): `--service harness` runs one with its own MCP pool and sandboxes and no store, and serves the Tenant's workspaces (`workspace.*`). Durable checkpoint 1 is unchanged.
57
55
 
58
56
  Frames: `{t:"req",id,m,p}`, `{t:"res",id,ok,r|e:{code,message}}`, `{t:"msg",m,p}`, `{t:"abort",id}`, `{t:"ping"}`. Error codes: `run_not_held`, `turn_cancelled`, `ownership_lost`, `effect_drift`, `invalid`, `unavailable`, `internal`; the message is today's (`Turn cancelled`, `Effect identity request drift`, …).
59
57
 
60
58
  - **Work.** `hello` → `{api, sandbox:{backend}, renewEveryMs}`. A harness keeps one `lease` waiting; an advance that took a session's lease offers its segment, and the answer is `{run: {runId, sessionId, turnId, epoch, token?, tokenExpiresAt?}, input: TurnStart}`. A run is bound to the connection that leased it. `lease.renew` every `renewEveryMs` renews the session's ownership lease (`{ok:false}`: lost, abort with `ownership.lost`); `lease.release{reason}` gives the run back (`shutdown`, `ownership.lost`; a lost connection counts as `connection.lost`).
61
59
  - **Input.** `TurnStart` (`type` `turn.start`, or `approval.answer` for approve/respond): `engine` (`agent` | `flow`), the turn's `manifest`, the segment's `checkpoint` with an empty transcript, `sessionTools`, the segment's completed `outcomes` (`{effectId, requestHash, outcome}`), `transcript.cursor`, `options` (`yieldAfter`, `flowLimits`, `fixtureModel`) and `routing` (root manifest, plugin roots, MCP snapshot, sandbox owner). Core aborts a run with `cancel{runId, reason, message}`, `reason` one of `cancel`, `shutdown`, `deadline`, `ownership.lost`.
62
- - **Record.** `requestHash = sha256(canonical(requestIdentity(effect)))` (canonical JSON: keys by code unit, `undefined` dropped; a delegation's identity leaves out `context`). An effect in `outcomes` with the same hash resolves in the harness; another hash is drift. Any other effect is an `effect.intent{effect, requestHash}`: a model intent carries no `input`, so a prompt never crosses twice. Core journals the row with `requestHash` (a model row without `input`) and answers `completed`, `pending`, `uncertain`, or `execute` (`rejoin` for a call its gate recovers, P1.2/F4.1). The harness executes model, MCP and sandbox calls and reports `effect.outcome{value}` or `{error}` (uncertain); after a `shutdown` a recoverable call reports nothing and stays `invoking`. Core runs Actions, hooks, `fn`, `verify`, flow tool nodes, linked sessions and delegation journaling. Rows written before carry their full request and are hashed on read.
60
+ - **Record.** `requestHash = sha256(canonical(requestIdentity(effect)))` (canonical JSON: keys by code unit, `undefined` dropped; a delegation's identity leaves out `context`). An effect in `outcomes` with the same hash resolves in the harness; another hash is drift. Any other effect is an `effect.intent{effect, requestHash}`: a model intent carries no `input`, so a prompt never crosses twice. Core journals the row with `requestHash` (a model row without `input`) and answers `completed`, `pending`, `uncertain`, or `execute` (`rejoin` for a call its gate recovers, P1.2/F4.1). The harness executes model, MCP, HTTP and sandbox calls and reports `effect.outcome{value}` or `{error}` (uncertain); after a `shutdown` a recoverable call reports nothing and stays `invoking`. Core runs flow work, linked sessions, delegation journaling and its built-in tools, and fails a tool that would run the developer's code (`tool.unavailable`). Rows written before carry their full request and are hashed on read.
63
61
  - **Transcript.** The cursor is the record seq of the last `transcript.updated`, `turn.cancelled` or `turn.failed`. A harness resumes from its cached transcript at that cursor, else reads it once (`transcript.read`). Outputs carry the agent's state without its transcript plus the `TranscriptUpdate[]` from the transcript the segment started with; core records them and answers with the new cursor.
64
62
  - **Output.** `turn.completed`, `turn.paused`, `turn.waiting{status, effectIds}`, `turn.failed{status, error}` or `{thrown}`, and `checkpoint` for a yielded segment; answered `{cursor?}` once core settled it, idempotent per run and type. Core settles them exactly as the engine's own results, classifying aborts from its own signal.
65
63
 
@@ -67,6 +65,6 @@ A Runtime below F6.1 compares journal rows by their full request: downgrading on
67
65
 
68
66
  ## Definitions, validation, compatibility
69
67
 
70
- `/define` is execution-free and browser-bundleable; Agent has no `.run()`. Explicit local execution uses `/run` run + bindingFromAgent(agent.build()). `/contracts` never imports checkpoint internals. Tools and before/after hooks are supported remotely. Arbitrary legacy middleware closures are rejected for durable definitions because they cannot be reconstructed from manifests. JSON schemas are reconstructed through Zod's JSON Schema importer; unsupported schemas fail closed. The original manifest document must survive reconstruction. Runtime is the only hasher: it hashes the accepted manifest and pins that digest on the session and on each action. Agents do not hash. Model configuration is host-owned. Actions are delivered to the endpoint registered for their agent id. Runtime checks a successful tool result against the output schema copied onto the action and stores a schema mismatch as a failed outcome on a completed action.
68
+ `/define` is execution-free and browser-bundleable; Agent has no `.run()`. Explicit local execution uses `/run` run + bindingFromAgent(agent.build()). `/contracts` never imports checkpoint internals. Tools are supported remotely. Arbitrary legacy middleware closures are rejected for durable definitions because they cannot be reconstructed from manifests. JSON schemas are reconstructed through Zod's JSON Schema importer; unsupported schemas fail closed. The original manifest document must survive reconstruction. Runtime is the only hasher: it hashes the accepted manifest and pins that digest on the session. Agents do not hash. Model configuration is host-owned. The Runtime refuses a definition whose tools would run the developer's code. It checks an HTTP tool's answer against the tool's output schema and records a mismatch as the failed outcome `tool.invalid-output`.
71
69
 
72
70
  No session migration, arbitrary checkpoint migration, broad model-support, or conformance claims follow from compiling this interface. Studio and conformance tooling remain outside production harness.
package/README.md CHANGED
@@ -33,9 +33,7 @@ export const supportAgent = Agent({
33
33
  name: "Support",
34
34
  instructions: "You help customers with orders. Be brief.",
35
35
  tools: [lookup],
36
- })
37
- .use(capability({ id: "policy", after: { step: ({ text }) => ({}) } }))
38
- .before("turn", ({ info }) => ({ instructions: [`Tenant ${info?.tenantId}`] }));
36
+ }).capability(capability({ id: "policy" }).instructions("Never promise a refund."));
39
37
 
40
38
  // Optional: .build() is a no-op facade
41
39
  const agent = supportAgent.build();
@@ -62,7 +60,7 @@ const result = await run({
62
60
  });
63
61
  ```
64
62
 
65
- This is a breaking beta: `agent.run()` has been removed. Application execution uses SDK sessions. Durable execution uses `createDurableCheckpoint` and `runDurable` with individually persisted model/tool/hook effects; a suspended checkpoint requires its effect journal.
63
+ This is a breaking beta: `agent.run()` has been removed. Application execution uses SDK sessions. Durable execution uses `createDurableCheckpoint` and `runDurable` with individually persisted model and tool effects; a suspended checkpoint requires its effect journal.
66
64
 
67
65
  ## Tools
68
66
 
@@ -75,31 +73,8 @@ Prefer `input` / `output` / `run`. Legacy `inputSchema` / `execute` and tagged `
75
73
 
76
74
  Definitions must not import `@nylorun/runtime`.
77
75
 
78
- ## Hooks
79
-
80
- Register a hook with `before(scope, fn)` / `after(scope, fn)` on the agent, or
81
- `before: { turn, step }` / `after: { step, turn }` on a capability. The scope says how
82
- often your code runs:
83
-
84
- | Hook | Runs | Returns |
85
- | ---------------- | -------------------------------------------- | -------------------------------------------------- |
86
- | `before("turn")` | Once per turn, before the first model call | `Patch`, applied to every model call in the turn |
87
- | `before("step")` | Before every model call | `Patch` for that call, layered over the turn patch |
88
- | `after("step")` | After every model response, before tools run | `Decision` (text/deny/approve/retry/block) |
89
- | `after("turn")` | Once, on the final answer | `TurnDecision` (text or output/retry/block) |
90
-
91
- `Patch` is capabilities/tools/instructions/state/block, with no `model`. Registered
92
- hooks are listed in the manifest (`capabilities[].hooks`). In a Runtime each hook point
93
- is one delivery to your Action endpoint per turn or per model call, whatever the
94
- number of capabilities using it, so prefer `"turn"` when a decision does not change
95
- within a turn.
96
-
97
- Hooks may run more than once when a delivery is retried, so keep side effects in
98
- tools. `retry` is never capped by the engine: every `after` hook receives `attempt`,
99
- so bound it yourself, for example
100
- `attempt < 2 ? { retry: "Be specific" } : { block: "No usable answer" }`.
101
-
102
- Local explicit engine execution retains middleware. Durable manifests reject arbitrary middleware closures; use hooks.
76
+ Local explicit engine execution retains middleware. Durable manifests reject middleware
77
+ closures: a hosted agent is its manifest, and the Runtime never calls your code during a session.
103
78
 
104
79
  ## Checkpoint / durability
105
80
 
@@ -107,4 +82,4 @@ Local explicit engine execution retains middleware. Durable manifests reject arb
107
82
 
108
83
  ## Client types
109
84
 
110
- The authoritative session/action wire schemas live in `/contracts` and do not import durable checkpoint types. Use `@nylorun/agents` for the session client and the Action endpoint (`createActionHandler`). Historical root client types remain for deferred local tooling; they are not the new wire contract.
85
+ The authoritative session/action wire schemas live in `/contracts` and do not import durable checkpoint types. Use `@nylorun/agents` for the session client and to save agents (`saveAgent`); the Runtime runs no code of yours during a session, so a tool there is an `http()` tool or a remote MCP server's. Historical root client types remain for deferred local tooling; they are not the new wire contract.
@@ -9,13 +9,13 @@ export interface HarnessRun {
9
9
  readonly signal: AbortSignal;
10
10
  }
11
11
  /**
12
- * What runs the effects the harness executes: model calls, MCP tools and sandbox tools. Core
13
- * runs everything else (Actions, hooks, flow work, linked sessions).
12
+ * What runs the effects the harness executes: model calls, MCP, HTTP and sandbox tools. Core
13
+ * runs everything else (flow work, linked sessions, its own built-in tools).
14
14
  */
15
15
  export interface HarnessExecutors {
16
16
  /** A model call. A provider failure is a failure outcome; only an abort throws. */
17
17
  model(effect: HostEffect, signal: AbortSignal, run: HarnessRun): Promise<unknown>;
18
- /** An MCP or sandbox tool call, routed by `run.start.routing`. */
18
+ /** An MCP, HTTP or sandbox tool call, routed by `run.start.routing`. */
19
19
  tool(effect: HostEffect, signal: AbortSignal, run: HarnessRun): Promise<unknown>;
20
20
  /**
21
21
  * Calls that outlive this process at their gate: a shutdown leaves them running there, and
@@ -23,7 +23,8 @@ export interface HarnessExecutors {
23
23
  */
24
24
  readonly recovers: {
25
25
  readonly model: boolean;
26
- remoteMcp(effect: HostEffect, run: HarnessRun): boolean;
26
+ /** True for a tool call at a gate that outlives this process (remote MCP, HTTP tools). */
27
+ tool(effect: HostEffect, run: HarnessRun): boolean;
27
28
  };
28
29
  /** Stops a recoverable tool call at its gate after a user cancel. Never rejects. */
29
30
  cancelAtGate?(effect: HostEffect, run: HarnessRun): Promise<void>;
@@ -4,10 +4,6 @@
4
4
  * own abort controller: core's `cancel` aborts it with core's reason, a renewal core refuses
5
5
  * with `ownership.lost`, and `stop()` with `shutdown`. While a run is live it renews its lease
6
6
  * every `renewEveryMs`; renewing stops once the run is aborted.
7
- *
8
- * A run whose Action is pending is held (F6.2): it waits up to `holdMs` for core's
9
- * `effect.resolved` and goes on in the same lease, instead of ending the segment and being
10
- * replayed by the next one.
11
7
  */
12
8
  import { type HarnessChannel, type ResultOf, type RunGrant } from "@nylorun/core/harness-api";
13
9
  import type { HarnessExecutors } from "./executors.js";
@@ -32,12 +28,6 @@ export interface HarnessOptions {
32
28
  onHello?(answer: ResultOf<"hello">): void;
33
29
  /** Sees every grant a run gets: when it is leased, and each renewal with a new run token. */
34
30
  onGrant?(grant: RunGrant): void;
35
- /**
36
- * The longest a run waits for a pending Action's outcome before its segment ends as waiting:
37
- * core says how long each run may (`TurnStart.options.holdMs`), never past the segment's
38
- * yield budget. Default: as long as core says.
39
- */
40
- readonly holdMs?: number;
41
31
  }
42
32
  export interface Harness {
43
33
  /** Says `hello` and starts leasing. Resolves once `hello` is answered. */
@@ -4,10 +4,6 @@
4
4
  * own abort controller: core's `cancel` aborts it with core's reason, a renewal core refuses
5
5
  * with `ownership.lost`, and `stop()` with `shutdown`. While a run is live it renews its lease
6
6
  * every `renewEveryMs`; renewing stops once the run is aborted.
7
- *
8
- * A run whose Action is pending is held (F6.2): it waits up to `holdMs` for core's
9
- * `effect.resolved` and goes on in the same lease, instead of ending the segment and being
10
- * replayed by the next one.
11
7
  */
12
8
  import { HARNESS_API_VERSION, } from "@nylorun/core/harness-api";
13
9
  import { ABORT_MESSAGES, RunAbort } from "./abort.js";
@@ -28,18 +24,6 @@ export function createHarness(options) {
28
24
  run.controller.abort(new RunAbort(kind, message ?? ABORT_MESSAGES[kind]));
29
25
  };
30
26
  channel.listen((method, params) => {
31
- if (method === "effect.resolved") {
32
- const { runId, effectId, outcome } = params;
33
- const run = live.get(runId);
34
- if (!run)
35
- return;
36
- const waiter = run.waiting.get(effectId);
37
- if (waiter)
38
- waiter(outcome);
39
- else
40
- run.resolved.set(effectId, outcome);
41
- return;
42
- }
43
27
  if (method !== "cancel")
44
28
  return;
45
29
  const { runId, reason, message } = params;
@@ -47,33 +31,6 @@ export function createHarness(options) {
47
31
  if (run)
48
32
  abort(run, reason, message);
49
33
  });
50
- /** Waits for core's outcome of a pending Action of `run`, at most `ms`, or until it aborts. */
51
- const hold = (held, effectId, ms) => {
52
- const run = live.get(held.runId);
53
- // Core may stop the run while it asks about the Action (a cancel, or a shutdown on close):
54
- // its abort fired already, so a listener added now would never run, and the run would
55
- // keep its lease for the whole hold.
56
- if (!run || ms <= 0 || run.signal.aborted)
57
- return Promise.resolve(undefined);
58
- const known = run.resolved.get(effectId);
59
- if (known) {
60
- run.resolved.delete(effectId);
61
- return Promise.resolve(known);
62
- }
63
- return new Promise((resolve) => {
64
- const done = (outcome) => {
65
- clearTimeout(timer);
66
- run.waiting.delete(effectId);
67
- run.signal.removeEventListener("abort", aborted);
68
- resolve(outcome);
69
- };
70
- const aborted = () => done(undefined);
71
- const timer = setTimeout(() => done(undefined), ms);
72
- timer.unref?.();
73
- run.waiting.set(effectId, done);
74
- run.signal.addEventListener("abort", aborted, { once: true });
75
- });
76
- };
77
34
  channel.onClose(() => {
78
35
  for (const run of live.values())
79
36
  abort(run, "shutdown", "The Harness API connection closed");
@@ -112,19 +69,11 @@ export function createHarness(options) {
112
69
  start,
113
70
  controller,
114
71
  signal: controller.signal,
115
- resolved: new Map(),
116
- waiting: new Map(),
117
72
  };
118
73
  live.set(run.runId, run);
119
74
  options.onGrant?.(grant);
120
75
  const stopRenewing = renew(run);
121
- const done = runTurn({
122
- channel,
123
- executors,
124
- cache,
125
- hold,
126
- ...(options.holdMs === undefined ? {} : { holdMs: options.holdMs }),
127
- }, run)
76
+ const done = runTurn({ channel, executors, cache }, run)
128
77
  .catch((error) => options.logger?.warn("harness run failed", {
129
78
  runId: run.runId,
130
79
  message: error instanceof Error ? error.message : String(error),
@@ -2,15 +2,9 @@
2
2
  * The engine's `DurableHost` over the Harness API. An effect whose outcome came with the run
3
3
  * (same id, same request hash) resolves here; any other becomes an `effect.intent`. A model
4
4
  * intent carries no prompt: core stores its hash. When core answers `execute`, the harness runs
5
- * the call and reports its outcome. When it answers `pending` for an Action (a tool, hook, `fn`
6
- * or `verify` an Action endpoint runs), the run may hold for its outcome (`options.hold`).
5
+ * the call and reports its outcome.
7
6
  */
8
7
  import { type HarnessChannel } from "@nylorun/core/harness-api";
9
- import type { ActionOutcome } from "@nylorun/core/contracts";
10
8
  import type { DurableHost } from "../run/durable.js";
11
9
  import type { HarnessExecutors, HarnessRun } from "./executors.js";
12
- export interface ApiHostOptions {
13
- /** Waits for core's outcome of a pending Action; undefined when none came in time. */
14
- readonly hold?: (effectId: string) => Promise<ActionOutcome | undefined>;
15
- }
16
- export declare function apiHost(channel: HarnessChannel, executors: HarnessExecutors, run: HarnessRun, options?: ApiHostOptions): DurableHost;
10
+ export declare function apiHost(channel: HarnessChannel, executors: HarnessExecutors, run: HarnessRun): DurableHost;
package/dist/api/host.js CHANGED
@@ -2,14 +2,11 @@
2
2
  * The engine's `DurableHost` over the Harness API. An effect whose outcome came with the run
3
3
  * (same id, same request hash) resolves here; any other becomes an `effect.intent`. A model
4
4
  * intent carries no prompt: core stores its hash. When core answers `execute`, the harness runs
5
- * the call and reports its outcome. When it answers `pending` for an Action (a tool, hook, `fn`
6
- * or `verify` an Action endpoint runs), the run may hold for its outcome (`options.hold`).
5
+ * the call and reports its outcome.
7
6
  */
8
7
  import { HarnessApiError, effectRequestHash, } from "@nylorun/core/harness-api";
9
8
  import { runAbortKind } from "./abort.js";
10
- /** Effects whose `pending` is an Action endpoint's work, which a run may hold for. */
11
- const HELD_KINDS = new Set(["tool", "hook", "fn", "verify"]);
12
- export function apiHost(channel, executors, run, options = {}) {
9
+ export function apiHost(channel, executors, run) {
13
10
  const recorded = new Map(run.start.outcomes.map((outcome) => [outcome.effectId, outcome]));
14
11
  const { signal, runId } = run;
15
12
  const ask = async (method, params) => {
@@ -35,9 +32,7 @@ export function apiHost(channel, executors, run, options = {}) {
35
32
  // Another owner decides what the effect became.
36
33
  if (error instanceof HarnessApiError && error.code === "ownership_lost")
37
34
  throw error;
38
- const recoverable = model
39
- ? executors.recovers.model
40
- : executors.recovers.remoteMcp(effect, run);
35
+ const recoverable = model ? executors.recovers.model : executors.recovers.tool(effect, run);
41
36
  const kind = runAbortKind(signal);
42
37
  // The call goes on at its gate: the next run re-sends it and collects its outcome.
43
38
  if (recoverable && kind === "shutdown")
@@ -65,13 +60,6 @@ export function apiHost(channel, executors, run, options = {}) {
65
60
  const answer = await ask("effect.intent", { runId, effect: intentOf(effect), requestHash });
66
61
  if (answer.status === "execute")
67
62
  return execute(effect);
68
- if (answer.status === "pending" && options.hold && HELD_KINDS.has(effect.kind)) {
69
- const outcome = await options.hold(effect.effectId);
70
- if (signal.aborted)
71
- throw signal.reason;
72
- if (outcome)
73
- return { status: "completed", outcome };
74
- }
75
63
  return answer;
76
64
  },
77
65
  };
package/dist/api/run.d.ts CHANGED
@@ -7,22 +7,11 @@
7
7
  * settles nothing for it, as it never did for an advance it stopped.
8
8
  */
9
9
  import { type HarnessChannel } from "@nylorun/core/harness-api";
10
- import type { ActionOutcome } from "@nylorun/core/contracts";
11
10
  import type { HarnessExecutors, HarnessRun } from "./executors.js";
12
11
  import type { TranscriptCache } from "./transcript-cache.js";
13
12
  export interface RunContext {
14
13
  readonly channel: HarnessChannel;
15
14
  readonly executors: HarnessExecutors;
16
15
  readonly cache: TranscriptCache;
17
- /**
18
- * Waits up to `ms` for core's outcome of a pending Action of the run (`effect.resolved`).
19
- * Absent: a pending Action ends the segment.
20
- */
21
- readonly hold?: (run: HarnessRun, effectId: string, ms: number) => Promise<ActionOutcome | undefined>;
22
- /**
23
- * The longest this harness holds a run for a pending Action; core says how long each run
24
- * may (`TurnStart.options.holdMs`), and never past its yield budget.
25
- */
26
- readonly holdMs?: number;
27
16
  }
28
17
  export declare function runTurn(ctx: RunContext, run: HarnessRun): Promise<void>;
package/dist/api/run.js CHANGED
@@ -25,7 +25,6 @@ export async function runTurn(ctx, run) {
25
25
  let { start } = run;
26
26
  const sessionId = run.grant.sessionId;
27
27
  const cursor = start.transcript.cursor;
28
- const startedAt = Date.now();
29
28
  let transcript = [];
30
29
  let output;
31
30
  let after;
@@ -50,16 +49,7 @@ export async function runTurn(ctx, run) {
50
49
  transcript = ctx.cache.get(sessionId, cursor) ?? (await read(ctx, run));
51
50
  checkpoint = { ...checkpoint, state: withTranscript(checkpoint.state, transcript) };
52
51
  }
53
- const budget = start.options.yieldAfter?.ms;
54
- const holdMs = Math.min(start.options.holdMs ?? 0, ctx.holdMs ?? Infinity);
55
- const host = apiHost(ctx.channel, ctx.executors, run, {
56
- ...(ctx.hold && holdMs > 0
57
- ? {
58
- // Never past the segment's yield budget: the turn rolls over there anyway.
59
- hold: (effectId) => ctx.hold(run, effectId, Math.min(holdMs, budget === undefined ? Infinity : budget - (Date.now() - startedAt))),
60
- }
61
- : {}),
62
- });
52
+ const host = apiHost(ctx.channel, ctx.executors, run);
63
53
  const result = start.engine === "flow"
64
54
  ? await runFlowDurable({
65
55
  manifest: start.manifest,
@@ -1,14 +1,6 @@
1
1
  export { checkCompatibility } from "./definition/compatibility.js";
2
2
  export declare const CHECKPOINT_VERSION = 1;
3
- export declare const ENGINE_VERSION = "hosted-3";
4
- /**
5
- * Flow engine version pinned on workflow checkpoints. Workflow manifest v2 runs on
6
- * `flow-2`; v1 manifests keep running on `flow-1`, so in-flight v1 runs finish as they began.
7
- */
8
- export declare const FLOW_ENGINE_VERSION = "flow-2";
9
- export declare const FLOW_ENGINE_VERSION_V1 = "flow-1";
10
- export type FlowEngineVersion = typeof FLOW_ENGINE_VERSION | typeof FLOW_ENGINE_VERSION_V1;
11
- /** The engine a workflow manifest runs on. */
12
- export declare function flowEngineVersionOf(manifest: {
13
- readonly workflowSchemaVersion: number;
14
- }): FlowEngineVersion;
3
+ export declare const ENGINE_VERSION = "hosted-4";
4
+ /** Flow engine version pinned on workflow checkpoints: workflow manifest v3 runs on `flow-3`. */
5
+ export declare const FLOW_ENGINE_VERSION = "flow-3";
6
+ export type FlowEngineVersion = typeof FLOW_ENGINE_VERSION;