stitchkit 0.126.0 → 0.127.0
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 +1636 -0
- package/README.md +12 -4
- package/dist/agent-executor/acp/scenarios.d.ts +4 -0
- package/dist/agent-executor/acp/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +89 -0
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-driver.d.ts +31 -0
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-map.d.ts +41 -0
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +270 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-session.d.ts +22 -0
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-turn.d.ts +25 -0
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -0
- package/dist/agent-executor/claude/classify.d.ts +54 -0
- package/dist/agent-executor/claude/classify.d.ts.map +1 -0
- package/dist/agent-executor/claude/cli-driver.d.ts +27 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -0
- package/dist/agent-executor/claude/limits.d.ts +8 -0
- package/dist/agent-executor/claude/limits.d.ts.map +1 -0
- package/dist/agent-executor/claude/protocol.d.ts +188 -0
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -0
- package/dist/agent-executor/claude/scenarios.d.ts +4 -0
- package/dist/agent-executor/claude/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +22 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -0
- package/dist/agent-executor/claude/transcript.d.ts +33 -0
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts +31 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/session.d.ts +10 -0
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -0
- package/dist/agent-executor/codex/classify.d.ts +28 -0
- package/dist/agent-executor/codex/classify.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +23 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts +4 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -0
- package/dist/agent-executor/codex/protocol.d.ts +152 -0
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -0
- package/dist/agent-executor/codex/scenarios.d.ts +4 -0
- package/dist/agent-executor/codex/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +41 -0
- package/dist/agent-executor/codex/session.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +454 -0
- package/dist/agent-executor/contract.d.ts.map +1 -0
- package/dist/agent-executor/dispatch.d.ts +41 -0
- package/dist/agent-executor/dispatch.d.ts.map +1 -0
- package/dist/agent-executor/engine-process.d.ts +45 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -0
- package/dist/agent-executor/engine-requests.d.ts +63 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -0
- package/dist/agent-executor/engine.d.ts +64 -0
- package/dist/agent-executor/engine.d.ts.map +1 -0
- package/dist/agent-executor/executor-contract.d.ts +387 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -0
- package/dist/agent-executor/executor-machine.d.ts +50 -0
- package/dist/agent-executor/executor-machine.d.ts.map +1 -0
- package/dist/agent-executor/hello.d.ts +235 -0
- package/dist/agent-executor/hello.d.ts.map +1 -0
- package/dist/agent-executor/json-rpc-peer.d.ts +48 -0
- package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -0
- package/dist/agent-executor/leases.d.ts +159 -0
- package/dist/agent-executor/leases.d.ts.map +1 -0
- package/dist/agent-executor/plan-limits.d.ts +25 -0
- package/dist/agent-executor/plan-limits.d.ts.map +1 -0
- package/dist/agent-executor/profile.d.ts +52 -0
- package/dist/agent-executor/profile.d.ts.map +1 -0
- package/dist/agent-executor/projection.d.ts +14 -0
- package/dist/agent-executor/projection.d.ts.map +1 -0
- package/dist/agent-executor/session-primitives.d.ts +72 -0
- package/dist/agent-executor/session-primitives.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +55 -0
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-claude-engine.d.ts +18 -0
- package/dist/agent-executor/testing/fake-claude-engine.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-engine.d.ts +52 -0
- package/dist/agent-executor/testing/fake-engine.d.ts.map +1 -0
- package/dist/agent-executor/turn-phases.d.ts +10 -0
- package/dist/agent-executor/turn-phases.d.ts.map +1 -0
- package/dist/agent-executor/vocabulary.d.ts +353 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -0
- package/dist/agent-parts/parts.d.ts +160 -0
- package/dist/agent-parts/parts.d.ts.map +1 -0
- package/dist/agent-runtime/agent-tool.d.ts +1 -1
- package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
- package/dist/agent-runtime/archive-projection.d.ts +5 -0
- package/dist/agent-runtime/archive-projection.d.ts.map +1 -1
- package/dist/agent-runtime/branch-contract.d.ts +59 -2
- package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
- package/dist/agent-runtime/branch-events.d.ts +7 -0
- package/dist/agent-runtime/branch-events.d.ts.map +1 -1
- package/dist/agent-runtime/branch-identities.d.ts +40 -6
- package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
- package/dist/agent-runtime/branch-messages.d.ts +11 -29
- package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +138 -28
- package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
- package/dist/agent-runtime/branch-provider.d.ts +32 -51
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
- package/dist/agent-runtime/branch-refusal.d.ts +60 -0
- package/dist/agent-runtime/branch-refusal.d.ts.map +1 -0
- package/dist/agent-runtime/branch-runtime-tools.d.ts +14 -0
- package/dist/agent-runtime/branch-runtime-tools.d.ts.map +1 -0
- package/dist/agent-runtime/branch-source.d.ts +7 -2
- package/dist/agent-runtime/branch-source.d.ts.map +1 -1
- package/dist/agent-runtime/branch-transitions.d.ts.map +1 -1
- package/dist/agent-runtime/browser-control-contract.d.ts +2 -2
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
- package/dist/agent-runtime/child-blocking.d.ts +17 -6
- package/dist/agent-runtime/child-blocking.d.ts.map +1 -1
- package/dist/agent-runtime/child-budget-policy.d.ts +4 -9
- package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -1
- package/dist/agent-runtime/child-tools.d.ts +19 -8
- package/dist/agent-runtime/child-tools.d.ts.map +1 -1
- package/dist/agent-runtime/children-contract.d.ts +84 -3
- package/dist/agent-runtime/children-contract.d.ts.map +1 -1
- package/dist/agent-runtime/children-control.d.ts +23 -2
- package/dist/agent-runtime/children-control.d.ts.map +1 -1
- package/dist/agent-runtime/children-spawn.d.ts +9 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -1
- package/dist/agent-runtime/children-state.d.ts +121 -19
- package/dist/agent-runtime/children-state.d.ts.map +1 -1
- package/dist/agent-runtime/children-usage.d.ts +10 -1
- package/dist/agent-runtime/children-usage.d.ts.map +1 -1
- package/dist/agent-runtime/children.d.ts +3 -3
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/{sandbox-coding.d.ts → coding-sandbox.d.ts} +2 -9
- package/dist/agent-runtime/coding-sandbox.d.ts.map +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts +2 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +32 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tools.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/companion-host.d.ts +38 -0
- package/dist/agent-runtime/companion-host.d.ts.map +1 -0
- package/dist/agent-runtime/context-issue.d.ts +5 -0
- package/dist/agent-runtime/context-issue.d.ts.map +1 -0
- package/dist/agent-runtime/control-schema.d.ts +2 -2
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/conversations.d.ts.map +1 -1
- package/dist/agent-runtime/coordinator.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +17 -5
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools-internal.d.ts +2 -0
- package/dist/agent-runtime/deferred-tools-internal.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-durability.d.ts +8 -0
- package/dist/agent-runtime/event-durability.d.ts.map +1 -0
- package/dist/agent-runtime/event-schema.d.ts +13 -5
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/event-search-postgres.d.ts +38 -0
- package/dist/agent-runtime/event-search-postgres.d.ts.map +1 -0
- package/dist/agent-runtime/event-search-terms.d.ts +37 -0
- package/dist/agent-runtime/event-search-terms.d.ts.map +1 -0
- package/dist/agent-runtime/event-search-tools.d.ts +64 -4
- package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-search.d.ts +16 -3
- package/dist/agent-runtime/event-search.d.ts.map +1 -1
- package/dist/agent-runtime/fault-bench.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +8 -0
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts +0 -2
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-schema.d.ts +23 -0
- package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-spend.d.ts +9 -0
- package/dist/agent-runtime/invocation-spend.d.ts.map +1 -0
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +2 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +42 -4
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-admission.d.ts +81 -0
- package/dist/agent-runtime/openrouter-admission.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts +83 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-models.d.ts +66 -0
- package/dist/agent-runtime/openrouter-models.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-options.d.ts +106 -0
- package/dist/agent-runtime/openrouter-options.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-route.d.ts +50 -0
- package/dist/agent-runtime/openrouter-route.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-spend.d.ts +24 -0
- package/dist/agent-runtime/openrouter-spend.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter.d.ts +23 -2
- package/dist/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/owned-provider-stream.d.ts.map +1 -1
- package/dist/agent-runtime/postgres-schema.d.ts +34 -0
- package/dist/agent-runtime/postgres-schema.d.ts.map +1 -0
- package/dist/agent-runtime/postgres-transactions.d.ts +54 -0
- package/dist/agent-runtime/postgres-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/postgres.d.ts +72 -0
- package/dist/agent-runtime/postgres.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +57 -17
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/provider-journal.d.ts +57 -0
- package/dist/agent-runtime/provider-journal.d.ts.map +1 -1
- package/dist/agent-runtime/purge.d.ts.map +1 -1
- package/dist/agent-runtime/retry-policy.d.ts +6 -0
- package/dist/agent-runtime/retry-policy.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution-state.d.ts +26 -2
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts.map +1 -1
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
- package/dist/agent-runtime/run-provider-ledger.d.ts +2 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -1
- package/dist/agent-runtime/run-step-barriers.d.ts +72 -0
- package/dist/agent-runtime/run-step-barriers.d.ts.map +1 -0
- package/dist/agent-runtime/run-step-spend.d.ts +319 -0
- package/dist/agent-runtime/run-step-spend.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +2 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/{tool-progress.d.ts → run-tool-progress.d.ts} +1 -1
- package/dist/agent-runtime/run-tool-progress.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +3 -1
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-admission-gate.d.ts +0 -14
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +6 -0
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +31 -2
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-binding.d.ts +10 -0
- package/dist/agent-runtime/sandbox-binding.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +5 -0
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-contract.d.ts +3 -2
- package/dist/agent-runtime/schedule-contract.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-dispatch.d.ts +3 -2
- package/dist/agent-runtime/schedule-dispatch.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +6 -6
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-tools.d.ts +19 -8
- package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
- package/dist/agent-runtime/schedules.d.ts +13 -3
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-message.d.ts +118 -0
- package/dist/agent-runtime/schemas-message.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-provider.d.ts +8 -0
- package/dist/agent-runtime/schemas-provider.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-records.d.ts +5 -0
- package/dist/agent-runtime/schemas-records.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-run.d.ts +487 -0
- package/dist/agent-runtime/schemas-run.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-usage.d.ts +129 -0
- package/dist/agent-runtime/schemas-usage.d.ts.map +1 -0
- package/dist/agent-runtime/schemas.d.ts +11 -886
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/spill.d.ts +9 -7
- package/dist/agent-runtime/spill.d.ts.map +1 -1
- package/dist/agent-runtime/sql-events.d.ts +6 -0
- package/dist/agent-runtime/sql-events.d.ts.map +1 -0
- package/dist/agent-runtime/sql-history.d.ts +8 -0
- package/dist/agent-runtime/sql-history.d.ts.map +1 -0
- package/dist/agent-runtime/sql-ledger.d.ts +5 -0
- package/dist/agent-runtime/sql-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/sql-purge.d.ts +13 -0
- package/dist/agent-runtime/sql-purge.d.ts.map +1 -0
- package/dist/agent-runtime/sql-reads.d.ts +16 -0
- package/dist/agent-runtime/sql-reads.d.ts.map +1 -0
- package/dist/agent-runtime/{sqlite-rows.d.ts → sql-rows.d.ts} +24 -10
- package/dist/agent-runtime/sql-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sql-session.d.ts +71 -0
- package/dist/agent-runtime/sql-session.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-bun.d.ts +1 -1
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-node.d.ts +1 -1
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-purge.d.ts +2 -3
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-schema.d.ts +1 -1
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-transactions.d.ts +10 -6
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite.d.ts +10 -29
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/state-tools.d.ts +8 -4
- package/dist/agent-runtime/state-tools.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-branch.d.ts +6 -1
- package/dist/agent-runtime/store-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-capabilities.d.ts +42 -0
- package/dist/agent-runtime/store-capabilities.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-branch.d.ts +5 -2
- package/dist/agent-runtime/store-conformance-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-capabilities.d.ts +6 -0
- package/dist/agent-runtime/store-conformance-capabilities.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-event-once.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-event-once.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-seed.d.ts +8 -0
- package/dist/agent-runtime/store-conformance-seed.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +31 -8
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
- package/dist/agent-runtime/store-create.d.ts +1 -1
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +15 -8
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-event-once.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +114 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory-archive.d.ts +2 -0
- package/dist/agent-runtime/store-memory-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +2 -2
- package/dist/agent-runtime/store-memory.d.ts.map +1 -1
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts +2 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -1
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -1
- package/dist/agent-runtime/store-replay.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +15 -2
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/application/admission-run.d.ts.map +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/change-subscription.d.ts.map +1 -1
- package/dist/application/decisions.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock-format.d.ts +9 -0
- package/dist/application/diagnostic-journal-lock-format.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
- package/dist/application/grammy-update-admission.d.ts.map +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts.map +1 -1
- package/dist/application/kernel-contract.d.ts.map +1 -1
- package/dist/application/kernel-restart.d.ts.map +1 -1
- package/dist/application/kernel-rollback.d.ts.map +1 -1
- package/dist/application/kernel-shutdown.d.ts.map +1 -1
- package/dist/application/kernel-state.d.ts.map +1 -1
- package/dist/application/notification-outbox-state.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/revision-signal.d.ts.map +1 -1
- package/dist/application/schedule-run.d.ts.map +1 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/sqlite-migrations.d.ts +104 -0
- package/dist/application/sqlite-migrations.d.ts.map +1 -0
- package/dist/application/watch-hub-core.d.ts.map +1 -1
- package/dist/browser/bridge-errors.d.ts +24 -0
- package/dist/browser/bridge-errors.d.ts.map +1 -0
- package/dist/browser/bridge-fetch.d.ts +30 -0
- package/dist/browser/bridge-fetch.d.ts.map +1 -0
- package/dist/browser/bridge-inbound.d.ts +28 -0
- package/dist/browser/bridge-inbound.d.ts.map +1 -0
- package/dist/browser/cancellation.d.ts +10 -2
- package/dist/browser/cancellation.d.ts.map +1 -1
- package/dist/browser/chunked-upload.d.ts +1 -1
- package/dist/browser/chunked-upload.d.ts.map +1 -1
- package/dist/browser/client-call-arguments.d.ts +31 -0
- package/dist/browser/client-call-arguments.d.ts.map +1 -0
- package/dist/browser/client-executors.d.ts +6 -0
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client.d.ts +9 -0
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/http.d.ts +17 -2
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +0 -5
- package/dist/browser/realtime-client.d.ts.map +1 -1
- package/dist/browser/session-credentials-storage.d.ts +48 -0
- package/dist/browser/session-credentials-storage.d.ts.map +1 -0
- package/dist/browser/session-credentials.d.ts +26 -5
- package/dist/browser/session-credentials.d.ts.map +1 -1
- package/dist/browser/session-refresh-policy.d.ts +124 -0
- package/dist/browser/session-refresh-policy.d.ts.map +1 -0
- package/dist/browser/session-refresh-timer.d.ts +30 -0
- package/dist/browser/session-refresh-timer.d.ts.map +1 -0
- package/dist/browser/session.d.ts.map +1 -1
- package/dist/browser/socket-io-connection.d.ts.map +1 -1
- package/dist/browser/socket-io-explicit-peer.d.ts +0 -1
- package/dist/browser/socket-io-explicit-peer.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +1 -1
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/browser/upload-progress.d.ts +3 -0
- package/dist/browser/upload-progress.d.ts.map +1 -1
- package/dist/contract/bridge-envelope.d.ts +155 -0
- package/dist/contract/bridge-envelope.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +2 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +4 -4
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +3 -1
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/contract/operation-effect.d.ts +29 -0
- package/dist/contract/operation-effect.d.ts.map +1 -0
- package/dist/contract/runtime-context.d.ts +2 -0
- package/dist/contract/runtime-context.d.ts.map +1 -1
- package/dist/contract/tool-options.d.ts +7 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/declaration/command.d.ts +26 -0
- package/dist/declaration/command.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts +4 -22
- package/dist/declaration/declaration.d.ts.map +1 -1
- package/dist/declaration/machine-names.d.ts +11 -0
- package/dist/declaration/machine-names.d.ts.map +1 -0
- package/dist/durability/effect.d.ts.map +1 -1
- package/dist/durability/engine.d.ts.map +1 -1
- package/dist/durability/events.d.ts +5 -8
- package/dist/durability/events.d.ts.map +1 -1
- package/dist/durability/parks.d.ts +0 -5
- package/dist/durability/parks.d.ts.map +1 -1
- package/dist/durability/scheduler.d.ts +5 -0
- package/dist/durability/scheduler.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts +4 -0
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/acp.js +910 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +2 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/claude-sdk.js +309 -0
- package/dist/entrypoints/agent-executor/claude.d.ts +5 -0
- package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/claude.js +403 -0
- package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/codex.js +798 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing.js +375 -0
- package/dist/entrypoints/agent-executor.d.ts +15 -0
- package/dist/entrypoints/agent-executor.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor.js +455 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +60 -30
- package/dist/entrypoints/agent-runtime/coding-tools.js +9 -12
- package/dist/entrypoints/agent-runtime/harness.js +35 -22
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +6 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +675 -45
- package/dist/entrypoints/agent-runtime/postgres.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/postgres.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/postgres.js +330 -0
- package/dist/entrypoints/agent-runtime/realtime.js +46 -49
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +3 -1
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/sandbox.js +74 -67
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +18 -18
- package/dist/entrypoints/agent-runtime/sqlite/node.js +18 -18
- package/dist/entrypoints/agent-runtime/testing.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/testing.js +394 -95
- package/dist/entrypoints/agent-runtime.d.ts +21 -13
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +1280 -1086
- package/dist/entrypoints/application/diagnostic-journal.js +16 -11
- package/dist/entrypoints/application/directory-inbox.js +20 -14
- package/dist/entrypoints/application/grammy.js +11 -8
- package/dist/entrypoints/application/opentelemetry.js +3 -3
- package/dist/entrypoints/application.d.ts +4 -2
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +409 -108
- package/dist/entrypoints/bin/upgrade-cli.d.ts +0 -12
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
- package/dist/entrypoints/bin/upgrade-cli.js +11 -7
- package/dist/entrypoints/cli/publish.js +10 -9
- package/dist/entrypoints/cli.d.ts +10 -3
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +91 -29
- package/dist/entrypoints/contract.d.ts +2 -1
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +13 -7
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -1
- package/dist/entrypoints/declaration.js +55 -44
- package/dist/entrypoints/files/packaging.js +8 -5
- package/dist/entrypoints/files.d.ts +5 -0
- package/dist/entrypoints/files.d.ts.map +1 -1
- package/dist/entrypoints/files.js +236 -47
- package/dist/entrypoints/geo.js +9 -4
- package/dist/entrypoints/google.js +14 -13
- package/dist/entrypoints/handler.d.ts +12 -0
- package/dist/entrypoints/handler.d.ts.map +1 -0
- package/dist/entrypoints/handler.js +350 -0
- package/dist/entrypoints/http.d.ts +4 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +411 -5
- package/dist/entrypoints/index.d.ts +2 -0
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +664 -91
- package/dist/entrypoints/live.js +22 -12
- package/dist/entrypoints/node.d.ts +2 -1
- package/dist/entrypoints/node.d.ts.map +1 -1
- package/dist/entrypoints/node.js +34 -25
- package/dist/entrypoints/observability.d.ts +2 -0
- package/dist/entrypoints/observability.d.ts.map +1 -1
- package/dist/entrypoints/observability.js +205 -131
- package/dist/entrypoints/primitives.js +152 -14
- package/dist/entrypoints/process/owner-loss.js +2 -2
- package/dist/entrypoints/process.js +18 -92
- package/dist/entrypoints/react.js +6 -5
- package/dist/entrypoints/realtime.d.ts +1 -0
- package/dist/entrypoints/realtime.d.ts.map +1 -1
- package/dist/entrypoints/realtime.js +6 -3
- package/dist/entrypoints/release.js +4 -0
- package/dist/entrypoints/remote.js +7 -6
- package/dist/entrypoints/server.d.ts +3 -1
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +295 -194
- package/dist/entrypoints/service-host/macos.d.ts +16 -0
- package/dist/entrypoints/service-host/macos.d.ts.map +1 -0
- package/dist/entrypoints/service-host/macos.js +1998 -0
- package/dist/entrypoints/service-host.d.ts +23 -0
- package/dist/entrypoints/service-host.d.ts.map +1 -0
- package/dist/entrypoints/service-host.js +2544 -0
- package/dist/entrypoints/spend/testing.d.ts +2 -0
- package/dist/entrypoints/spend/testing.d.ts.map +1 -0
- package/dist/entrypoints/spend/testing.js +442 -0
- package/dist/entrypoints/spend.d.ts +8 -0
- package/dist/entrypoints/spend.d.ts.map +1 -0
- package/dist/entrypoints/spend.js +593 -0
- package/dist/entrypoints/sync/postgres.d.ts +12 -0
- package/dist/entrypoints/sync/postgres.d.ts.map +1 -0
- package/dist/entrypoints/sync/postgres.js +737 -0
- package/dist/entrypoints/sync.d.ts +12 -0
- package/dist/entrypoints/sync.d.ts.map +1 -0
- package/dist/entrypoints/sync.js +782 -0
- package/dist/entrypoints/telegram/grammy.js +5 -5
- package/dist/entrypoints/telegram/html.d.ts +2 -0
- package/dist/entrypoints/telegram/html.d.ts.map +1 -1
- package/dist/entrypoints/telegram/html.js +839 -2
- package/dist/entrypoints/telegram/screens.js +13 -15
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +286 -76
- package/dist/entrypoints/testing.js +33 -41
- package/dist/entrypoints/tools/agent.js +12 -9
- package/dist/entrypoints/tools/connections.js +664 -63
- package/dist/entrypoints/tools/contract.d.ts +2 -2
- package/dist/entrypoints/tools/contract.js +4 -1
- package/dist/entrypoints/tools/invoker.js +9 -7
- package/dist/entrypoints/tools/mcp.js +16 -13
- package/dist/entrypoints/tools/toolkit.js +21 -18
- package/dist/entrypoints/tools.d.ts +3 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +105 -92
- package/dist/entrypoints/tracking/contract.js +2 -1
- package/dist/entrypoints/tracking/performance.js +4 -0
- package/dist/entrypoints/tracking.js +6 -1
- package/dist/entrypoints/voice.js +3 -3
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/chunk-spool.d.ts +27 -0
- package/dist/files/chunk-spool.d.ts.map +1 -1
- package/dist/files/directory-appearance.d.ts +44 -0
- package/dist/files/directory-appearance.d.ts.map +1 -0
- package/dist/files/file-io.d.ts.map +1 -1
- package/dist/files/file-stamp.d.ts +35 -0
- package/dist/files/file-stamp.d.ts.map +1 -0
- package/dist/files/json-file-reading.d.ts +37 -0
- package/dist/files/json-file-reading.d.ts.map +1 -0
- package/dist/files/native-packaging.d.ts.map +1 -1
- package/dist/files/polled-json.d.ts +121 -0
- package/dist/files/polled-json.d.ts.map +1 -0
- package/dist/files/regular-file.d.ts +125 -0
- package/dist/files/regular-file.d.ts.map +1 -0
- package/dist/geo/index.d.ts +2 -1
- package/dist/geo/index.d.ts.map +1 -1
- package/dist/geo/resolver.d.ts.map +1 -1
- package/dist/geo/types.d.ts +0 -1
- package/dist/geo/types.d.ts.map +1 -1
- package/dist/google/google.d.ts +6 -0
- package/dist/google/google.d.ts.map +1 -1
- package/dist/{index-w0eqdhyd.js → index-09f7w2qq.js} +6 -1
- package/dist/index-0djnptn8.js +501 -0
- package/dist/index-0hdm5sx6.js +1457 -0
- package/dist/{index-t05a2ry4.js → index-0p0s5hrj.js} +8 -14
- package/dist/{index-1c945ten.js → index-0r15pkjq.js} +1 -1
- package/dist/{index-v1swr26p.js → index-0tyt97nk.js} +2 -2
- package/dist/{index-332d0m9g.js → index-0x4mnwg5.js} +4 -0
- package/dist/index-118aebbg.js +48 -0
- package/dist/index-1q0n6zek.js +184 -0
- package/dist/index-27hck3z2.js +307 -0
- package/dist/index-2rf33y2h.js +77 -0
- package/dist/index-360j58vb.js +63 -0
- package/dist/{index-tt30h7mr.js → index-39n02e0q.js} +1 -1
- package/dist/index-3agqmmrg.js +42 -0
- package/dist/{index-n6hvd1r2.js → index-3b31z0pc.js} +22 -15
- package/dist/index-3djgv3ch.js +472 -0
- package/dist/{index-mfntvj58.js → index-3dq8466w.js} +1 -1
- package/dist/index-3gwp8ez6.js +200 -0
- package/dist/{index-x2d51zay.js → index-3ypvpkwr.js} +309 -345
- package/dist/index-4gk6k3zc.js +248 -0
- package/dist/index-4qvyhn23.js +40 -0
- package/dist/index-4s2w4g37.js +647 -0
- package/dist/index-4ynw5ktx.js +78 -0
- package/dist/index-5awtbyns.js +19 -0
- package/dist/{index-kxff9e9w.js → index-5e0zsbf7.js} +5 -4
- package/dist/{index-nz06qw5a.js → index-5jyjb4s0.js} +1 -1
- package/dist/{index-7zksb1ty.js → index-5ptwb6ka.js} +1 -1
- package/dist/{index-w3nv6kr8.js → index-5q0qpw3v.js} +54 -9
- package/dist/{index-mm89hd8v.js → index-5t4fpdct.js} +1 -1
- package/dist/{index-0v9xb8pz.js → index-5y7j383h.js} +5 -5
- package/dist/index-5zwac8ft.js +221 -0
- package/dist/{index-v62cpkx3.js → index-6g85s734.js} +1 -1
- package/dist/{index-sqc6ezrb.js → index-6kec3b14.js} +17 -4
- package/dist/{index-kqnd6a85.js → index-7416mhyh.js} +1 -1
- package/dist/{index-m0wsfmrc.js → index-7csn6pva.js} +37 -24
- package/dist/{index-dqpesdck.js → index-7grgs8cx.js} +25 -5
- package/dist/{index-jjvr9f15.js → index-7kfcb576.js} +129 -39
- package/dist/{index-cvjddnvd.js → index-7xp05h20.js} +19 -10
- package/dist/{index-48acz7z0.js → index-83n766x4.js} +91 -50
- package/dist/{index-ss67fxhj.js → index-877e9y8r.js} +7 -7
- package/dist/{index-aw6kx2e6.js → index-8gmmdz7k.js} +1 -1
- package/dist/{index-wt6rw7rf.js → index-8xr2eq99.js} +29 -21
- package/dist/{index-rz3z13e9.js → index-97q9kykw.js} +1 -1
- package/dist/index-97rp94ff.js +8 -0
- package/dist/{index-0w0hxp7n.js → index-9pv126eh.js} +3 -9
- package/dist/{index-x2rvpbtj.js → index-9wh98cpa.js} +110 -16
- package/dist/{index-egg0yp2j.js → index-9xr44d2g.js} +86 -210
- package/dist/{index-b2sey031.js → index-9y0afd5f.js} +24 -23
- package/dist/index-a725ayvz.js +405 -0
- package/dist/{index-nmaqxdx7.js → index-ac5rj3d4.js} +203 -90
- package/dist/{index-wqzw3qg9.js → index-agy5fqgf.js} +32 -13
- package/dist/index-ajmtxsky.js +193 -0
- package/dist/{index-ndjzbt2v.js → index-akf0xkrm.js} +4 -3
- package/dist/index-akfgymyr.js +8 -0
- package/dist/index-apv5xfef.js +13 -0
- package/dist/index-ax3wns1a.js +93 -0
- package/dist/{index-ft2wvst5.js → index-bbzvrq66.js} +1603 -342
- package/dist/index-bh4pmtr9.js +317 -0
- package/dist/{index-fa53vygr.js → index-bmaz3jzy.js} +3 -3
- package/dist/{index-8kzct1d6.js → index-bn2baakz.js} +143 -143
- package/dist/{index-m8ddk770.js → index-brhhaygm.js} +1 -1
- package/dist/index-caywx1c0.js +199 -0
- package/dist/index-cbhxhma2.js +90 -0
- package/dist/index-cfnmvcq8.js +11 -0
- package/dist/index-cv9b7fz2.js +42 -0
- package/dist/index-d4svrknj.js +156 -0
- package/dist/{index-a3z56mtn.js → index-d96c1n1q.js} +5 -3
- package/dist/{index-3ymcmpa9.js → index-dvd1qdwa.js} +33 -163
- package/dist/{index-v7rbjatr.js → index-dwa6pskj.js} +1837 -1151
- package/dist/{index-ne4j9998.js → index-e06z0tkb.js} +123 -94
- package/dist/{index-99nnsz39.js → index-en8e5zsj.js} +15 -135
- package/dist/index-fcw255hd.js +929 -0
- package/dist/{index-20hn8pbh.js → index-fmzg39a8.js} +1 -1
- package/dist/{index-fvd6pvw3.js → index-g1q7fwn9.js} +2 -2
- package/dist/index-g56ht6qf.js +98 -0
- package/dist/{index-f56ct5gb.js → index-gj1rjf78.js} +4 -3
- package/dist/{index-g6a3na27.js → index-gnjgkecx.js} +7 -3
- package/dist/index-hy4653g4.js +345 -0
- package/dist/index-j13gzgdv.js +403 -0
- package/dist/{index-pa9bhefy.js → index-j516jaaz.js} +37 -11
- package/dist/{index-t8jz0e20.js → index-j903yhp4.js} +30 -38
- package/dist/{index-9ypczvpj.js → index-jb4m241t.js} +2 -0
- package/dist/index-jrka9029.js +177 -0
- package/dist/{index-cjzaj7ev.js → index-jxtg307y.js} +23 -21
- package/dist/index-kmbpej2y.js +1152 -0
- package/dist/{index-bz9cmnqq.js → index-kt6dh1n6.js} +4 -4
- package/dist/index-ky3ardqn.js +80 -0
- package/dist/index-kyejf658.js +14 -0
- package/dist/{index-zyc64nbh.js → index-kynwa08q.js} +52 -47
- package/dist/index-kzavdze2.js +15 -0
- package/dist/{index-m200b8hs.js → index-mbd92r1w.js} +5 -3
- package/dist/index-mxt0wfjy.js +58 -0
- package/dist/{index-9cxxfkhb.js → index-n20tybgk.js} +14 -9
- package/dist/index-nbv44x0x.js +250 -0
- package/dist/index-ngwf1s3c.js +51 -0
- package/dist/{index-zfncctjp.js → index-nk0cy9g1.js} +5 -4
- package/dist/index-p1m9djt6.js +108 -0
- package/dist/{index-hs76yzt7.js → index-paff5y0r.js} +17 -11
- package/dist/{index-qaet40b2.js → index-prf6ayhf.js} +5 -7
- package/dist/{index-hkxgennw.js → index-ps3djm8d.js} +7 -1
- package/dist/{index-1v3k5zgx.js → index-qnzhmk2s.js} +528 -1129
- package/dist/{index-3bzk2645.js → index-r9kq5ark.js} +1 -1
- package/dist/{index-hkw233vx.js → index-rbd2rq3z.js} +2 -2
- package/dist/{index-r0xr7y4m.js → index-rhb33thr.js} +138 -33
- package/dist/{index-kffm4r8w.js → index-rj32hkkp.js} +2 -2
- package/dist/index-rptj3qnc.js +96 -0
- package/dist/{index-hqsbtvta.js → index-rpyn7geq.js} +11 -3
- package/dist/{index-m9hb9wnk.js → index-sfzfd2m2.js} +2 -2
- package/dist/{index-sqkttz7z.js → index-sv5svtq7.js} +1 -1
- package/dist/{index-srs8hj9c.js → index-sx3g49y2.js} +5 -1
- package/dist/{index-9mjrnqxs.js → index-t1a2jrg7.js} +21 -91
- package/dist/{index-a6w6mwda.js → index-tazm4dxf.js} +1 -1
- package/dist/{index-b51tzcgh.js → index-tf70nm22.js} +2 -2
- package/dist/index-ttexdtjj.js +28 -0
- package/dist/{index-103dp7fz.js → index-v37b2cd6.js} +1956 -3151
- package/dist/{index-0ndz5r8z.js → index-v59pxmf1.js} +17 -9
- package/dist/{index-rfkh44ss.js → index-vgytj9wp.js} +1 -1
- package/dist/{index-tnnmekgb.js → index-wa6h4tz6.js} +3 -3
- package/dist/{index-4efxzrht.js → index-wavv538x.js} +211 -196
- package/dist/{index-1szhrfsf.js → index-wbnpa8z6.js} +7 -5
- package/dist/index-werjqesf.js +43 -0
- package/dist/{index-7qyv50r4.js → index-wv8dqy7q.js} +2 -2
- package/dist/index-wz392jyz.js +10 -0
- package/dist/{index-1d7s7da0.js → index-x6sp5vpa.js} +36 -5
- package/dist/{index-bqzgaj57.js → index-x90w78yz.js} +183 -61
- package/dist/index-xgae0bn7.js +37 -0
- package/dist/index-xmr47znh.js +160 -0
- package/dist/{index-ftk3838x.js → index-xq4s9mka.js} +7 -2
- package/dist/{index-ww3gss55.js → index-xrgn784x.js} +1 -1
- package/dist/{index-fpwbskp2.js → index-xtby8rj3.js} +1 -1
- package/dist/index-xtkw9866.js +107 -0
- package/dist/{index-btjwc7xr.js → index-xypxnzhp.js} +15 -14
- package/dist/{index-yex7eg1v.js → index-y7sy1xdp.js} +6 -2
- package/dist/index-z4k0hqp9.js +476 -0
- package/dist/{index-a7ebd769.js → index-zwgwyvdt.js} +3 -3
- package/dist/internal/abort-error.d.ts +9 -0
- package/dist/internal/abort-error.d.ts.map +1 -0
- package/dist/internal/abort-race.d.ts +47 -4
- package/dist/internal/abort-race.d.ts.map +1 -1
- package/dist/internal/atomic-file.d.ts +19 -0
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/backoff.d.ts.map +1 -1
- package/dist/internal/bounded-body.d.ts +37 -1
- package/dist/internal/bounded-body.d.ts.map +1 -1
- package/dist/internal/bounded-file-read.d.ts +31 -15
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/bun-command.d.ts +11 -0
- package/dist/internal/bun-command.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -1
- package/dist/internal/darwin-binding-error.d.ts.map +1 -1
- package/dist/internal/darwin-binding.d.ts +10 -0
- package/dist/internal/darwin-binding.d.ts.map +1 -1
- package/dist/internal/deadline.d.ts +22 -2
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-owner.d.ts +20 -1
- package/dist/internal/exclusive-lock-owner.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-read.d.ts +2 -0
- package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts +26 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +49 -0
- package/dist/internal/file-observation.d.ts.map +1 -1
- package/dist/internal/json-response.d.ts +10 -0
- package/dist/internal/json-response.d.ts.map +1 -0
- package/dist/internal/open-descriptors.d.ts +5 -0
- package/dist/internal/open-descriptors.d.ts.map +1 -1
- package/dist/internal/optional-peer.d.ts.map +1 -1
- package/dist/internal/pinned-http.d.ts.map +1 -1
- package/dist/internal/positive-integer.d.ts +14 -6
- package/dist/internal/positive-integer.d.ts.map +1 -1
- package/dist/internal/postgres-query.d.ts +16 -0
- package/dist/internal/postgres-query.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +21 -1
- package/dist/internal/process-identity.d.ts.map +1 -1
- package/dist/internal/process-instance.d.ts +6 -0
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/request.d.ts +4 -0
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/secret-equal.d.ts +11 -0
- package/dist/internal/secret-equal.d.ts.map +1 -0
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/sqlite.d.ts +8 -0
- package/dist/internal/sqlite.d.ts.map +1 -1
- package/dist/internal/timers.d.ts +20 -0
- package/dist/internal/timers.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +11 -0
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/unix-client-error.d.ts +21 -0
- package/dist/internal/unix-client-error.d.ts.map +1 -0
- package/dist/internal/unix-socket-lock.d.ts +23 -0
- package/dist/internal/unix-socket-lock.d.ts.map +1 -0
- package/dist/internal/unix-socket.d.ts +60 -0
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/internal/upgrade-affects.d.ts +3 -3
- package/dist/internal/upgrade-affects.d.ts.map +1 -1
- package/dist/internal/upgrade-plan.d.ts.map +1 -1
- package/dist/json-schema/dialect.d.ts +0 -6
- package/dist/json-schema/dialect.d.ts.map +1 -1
- package/dist/json-schema/keywords.d.ts +116 -0
- package/dist/json-schema/keywords.d.ts.map +1 -0
- package/dist/json-schema/string-format.d.ts.map +1 -1
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +3 -0
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts.map +1 -1
- package/dist/observability/context.d.ts +12 -2
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event-loop-delay.d.ts +62 -0
- package/dist/observability/event-loop-delay.d.ts.map +1 -0
- package/dist/observability/json-logger.d.ts.map +1 -1
- package/dist/observability/log-repeat.d.ts +44 -0
- package/dist/observability/log-repeat.d.ts.map +1 -0
- package/dist/observability/spool-core.d.ts +95 -0
- package/dist/observability/spool-core.d.ts.map +1 -0
- package/dist/observability/spool-file.d.ts +46 -0
- package/dist/observability/spool-file.d.ts.map +1 -0
- package/dist/observability/spool.d.ts +14 -8
- package/dist/observability/spool.d.ts.map +1 -1
- package/dist/observability/trace.d.ts.map +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/order-key.d.ts +37 -0
- package/dist/primitives/order-key.d.ts.map +1 -0
- package/dist/process/bun-child.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/contract.d.ts +4 -3
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/process/group-presence.d.ts.map +1 -1
- package/dist/process/group.d.ts +5 -1
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +5 -3
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/react/cache-bridge.d.ts.map +1 -1
- package/dist/release/watcher.d.ts.map +1 -1
- package/dist/server/bridge-host.d.ts +51 -0
- package/dist/server/bridge-host.d.ts.map +1 -0
- package/dist/server/bun.d.ts +4 -4
- package/dist/server/bun.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/create.d.ts +1 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts.map +1 -1
- package/dist/server/endpoint-response.d.ts.map +1 -1
- package/dist/server/error-dispatch.d.ts +2 -0
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -0
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +13 -2
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/implement.d.ts +1 -0
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/local-host.d.ts +47 -0
- package/dist/server/local-host.d.ts.map +1 -0
- package/dist/server/logger.d.ts +20 -3
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/logging.d.ts +2 -1
- package/dist/server/logging.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +1 -0
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/signed-link.d.ts +42 -0
- package/dist/server/middleware/signed-link.d.ts.map +1 -0
- package/dist/server/multipart-reader.d.ts +3 -1
- package/dist/server/multipart-reader.d.ts.map +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts.map +1 -1
- package/dist/server/oauth/endpoints.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/protocol-outcome.d.ts +17 -0
- package/dist/server/protocol-outcome.d.ts.map +1 -0
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +3 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/shutdown.d.ts.map +1 -1
- package/dist/server/socket-io-config.d.ts +1 -1
- package/dist/server/socket-io-config.d.ts.map +1 -1
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +13 -10
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-body.d.ts +4 -1
- package/dist/server/unix-client-body.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +1 -1
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/service-host/artifact-activation.d.ts +58 -0
- package/dist/service-host/artifact-activation.d.ts.map +1 -0
- package/dist/service-host/artifact-manifest.d.ts +68 -0
- package/dist/service-host/artifact-manifest.d.ts.map +1 -0
- package/dist/service-host/artifact.d.ts +43 -0
- package/dist/service-host/artifact.d.ts.map +1 -0
- package/dist/service-host/config-reloader-contract.d.ts +66 -0
- package/dist/service-host/config-reloader-contract.d.ts.map +1 -0
- package/dist/service-host/config-reloader-helpers.d.ts +32 -0
- package/dist/service-host/config-reloader-helpers.d.ts.map +1 -0
- package/dist/service-host/config-reloader-source.d.ts +47 -0
- package/dist/service-host/config-reloader-source.d.ts.map +1 -0
- package/dist/service-host/config-reloader.d.ts +6 -0
- package/dist/service-host/config-reloader.d.ts.map +1 -0
- package/dist/service-host/host-adapter.d.ts +72 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -0
- package/dist/service-host/identity-unix-socket.d.ts +101 -0
- package/dist/service-host/identity-unix-socket.d.ts.map +1 -0
- package/dist/service-host/identity.d.ts +117 -0
- package/dist/service-host/identity.d.ts.map +1 -0
- package/dist/service-host/launchd-plist.d.ts +77 -0
- package/dist/service-host/launchd-plist.d.ts.map +1 -0
- package/dist/service-host/launchd-render.d.ts +91 -0
- package/dist/service-host/launchd-render.d.ts.map +1 -0
- package/dist/service-host/launchd.d.ts +82 -0
- package/dist/service-host/launchd.d.ts.map +1 -0
- package/dist/service-host/macos/bundle-plist.d.ts +50 -0
- package/dist/service-host/macos/bundle-plist.d.ts.map +1 -0
- package/dist/service-host/macos/bundle.d.ts +66 -0
- package/dist/service-host/macos/bundle.d.ts.map +1 -0
- package/dist/service-host/macos/codesign.d.ts +95 -0
- package/dist/service-host/macos/codesign.d.ts.map +1 -0
- package/dist/service-host/macos/icon.d.ts +93 -0
- package/dist/service-host/macos/icon.d.ts.map +1 -0
- package/dist/service-host/macos/launch-services.d.ts +88 -0
- package/dist/service-host/macos/launch-services.d.ts.map +1 -0
- package/dist/service-host/macos/launcher.d.ts +59 -0
- package/dist/service-host/macos/launcher.d.ts.map +1 -0
- package/dist/service-host/macos/responsibility.d.ts +90 -0
- package/dist/service-host/macos/responsibility.d.ts.map +1 -0
- package/dist/service-host/macos/runner.d.ts +69 -0
- package/dist/service-host/macos/runner.d.ts.map +1 -0
- package/dist/service-host/plist-xml.d.ts +48 -0
- package/dist/service-host/plist-xml.d.ts.map +1 -0
- package/dist/service-host/process-evidence.d.ts +17 -0
- package/dist/service-host/process-evidence.d.ts.map +1 -0
- package/dist/service-host/systemd-inspect.d.ts +126 -0
- package/dist/service-host/systemd-inspect.d.ts.map +1 -0
- package/dist/service-host/systemd-links.d.ts +23 -0
- package/dist/service-host/systemd-links.d.ts.map +1 -0
- package/dist/service-host/systemd-render.d.ts +93 -0
- package/dist/service-host/systemd-render.d.ts.map +1 -0
- package/dist/service-host/systemd.d.ts +50 -0
- package/dist/service-host/systemd.d.ts.map +1 -0
- package/dist/spend/attribution.d.ts +17 -0
- package/dist/spend/attribution.d.ts.map +1 -0
- package/dist/spend/coverage-guard.d.ts +60 -0
- package/dist/spend/coverage-guard.d.ts.map +1 -0
- package/dist/spend/coverage-lexer.d.ts +20 -0
- package/dist/spend/coverage-lexer.d.ts.map +1 -0
- package/dist/spend/facts.d.ts +23 -0
- package/dist/spend/facts.d.ts.map +1 -0
- package/dist/spend/gateway-stream.d.ts +25 -0
- package/dist/spend/gateway-stream.d.ts.map +1 -0
- package/dist/spend/gateway.d.ts +64 -0
- package/dist/spend/gateway.d.ts.map +1 -0
- package/dist/spend/receipt-merge.d.ts +13 -0
- package/dist/spend/receipt-merge.d.ts.map +1 -0
- package/dist/spend/receipt-spool.d.ts +35 -0
- package/dist/spend/receipt-spool.d.ts.map +1 -0
- package/dist/spend/reconcile.d.ts +45 -0
- package/dist/spend/reconcile.d.ts.map +1 -0
- package/dist/spend/schemas.d.ts +249 -0
- package/dist/spend/schemas.d.ts.map +1 -0
- package/dist/sync/outbox.d.ts +131 -0
- package/dist/sync/outbox.d.ts.map +1 -0
- package/dist/sync/overlay.d.ts +59 -0
- package/dist/sync/overlay.d.ts.map +1 -0
- package/dist/sync/protocol.d.ts +132 -0
- package/dist/sync/protocol.d.ts.map +1 -0
- package/dist/sync/server-store-check.d.ts +10 -0
- package/dist/sync/server-store-check.d.ts.map +1 -0
- package/dist/sync/server-store-memory.d.ts +14 -0
- package/dist/sync/server-store-memory.d.ts.map +1 -0
- package/dist/sync/server-store-postgres.d.ts +25 -0
- package/dist/sync/server-store-postgres.d.ts.map +1 -0
- package/dist/sync/server-store.d.ts +139 -0
- package/dist/sync/server-store.d.ts.map +1 -0
- package/dist/sync/session-machine.d.ts +79 -0
- package/dist/sync/session-machine.d.ts.map +1 -0
- package/dist/sync/session-snapshot.d.ts +19 -0
- package/dist/sync/session-snapshot.d.ts.map +1 -0
- package/dist/sync/session-steps.d.ts +15 -0
- package/dist/sync/session-steps.d.ts.map +1 -0
- package/dist/sync/session.d.ts +142 -0
- package/dist/sync/session.d.ts.map +1 -0
- package/dist/sync/tombstones.d.ts +53 -0
- package/dist/sync/tombstones.d.ts.map +1 -0
- package/dist/telegram/bot-api.d.ts.map +1 -1
- package/dist/telegram/broadcast-failure.d.ts.map +1 -1
- package/dist/telegram/budget-transformer.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts +2 -10
- package/dist/telegram/crypto.d.ts.map +1 -1
- package/dist/telegram/html/markdown-inline.d.ts +19 -0
- package/dist/telegram/html/markdown-inline.d.ts.map +1 -0
- package/dist/telegram/html/markdown-lines.d.ts +51 -0
- package/dist/telegram/html/markdown-lines.d.ts.map +1 -0
- package/dist/telegram/html/markdown-split.d.ts +49 -0
- package/dist/telegram/html/markdown-split.d.ts.map +1 -0
- package/dist/telegram/html/markdown.d.ts +14 -0
- package/dist/telegram/html/markdown.d.ts.map +1 -0
- package/dist/telegram/html/nodes.d.ts +26 -4
- package/dist/telegram/html/nodes.d.ts.map +1 -1
- package/dist/telegram/html/parse.d.ts.map +1 -1
- package/dist/telegram/html/render.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/local-files.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts +15 -2
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/outbound-budget.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts +9 -1
- package/dist/telegram/outbound-cost.d.ts.map +1 -1
- package/dist/telegram/outbound-queue.d.ts +2 -1
- package/dist/telegram/outbound-queue.d.ts.map +1 -1
- package/dist/telegram/screens/outcome.d.ts.map +1 -1
- package/dist/telegram/send-failure.d.ts.map +1 -1
- package/dist/telegram/transport-connect.d.ts.map +1 -1
- package/dist/telegram/transport.d.ts.map +1 -1
- package/dist/telegram/update-intake.d.ts.map +1 -1
- package/dist/telegram/update-store-postgres.d.ts +2 -2
- package/dist/telegram/update-store-postgres.d.ts.map +1 -1
- package/dist/telegram/webhook.d.ts.map +1 -1
- package/dist/testing/managed-resource-conformance.d.ts.map +1 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +2 -0
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/access.d.ts +34 -0
- package/dist/tools/access.d.ts.map +1 -0
- package/dist/tools/agent.d.ts +14 -6
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-classify.d.ts +154 -0
- package/dist/tools/cli/args-classify.d.ts.map +1 -0
- package/dist/tools/cli/args-fields.d.ts +14 -7
- package/dist/tools/cli/args-fields.d.ts.map +1 -1
- package/dist/tools/cli/args-json.d.ts +1 -1
- package/dist/tools/cli/args-json.d.ts.map +1 -1
- package/dist/tools/cli/args-route.d.ts +4 -48
- package/dist/tools/cli/args-route.d.ts.map +1 -1
- package/dist/tools/cli/args-scan.d.ts +70 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -0
- package/dist/tools/cli/args-tokens.d.ts +2 -1
- package/dist/tools/cli/args-tokens.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +31 -19
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/command-shape.d.ts +5 -0
- package/dist/tools/cli/command-shape.d.ts.map +1 -1
- package/dist/tools/cli/command.d.ts +57 -2
- package/dist/tools/cli/command.d.ts.map +1 -1
- package/dist/tools/cli/config.d.ts +15 -58
- package/dist/tools/cli/config.d.ts.map +1 -1
- package/dist/tools/cli/create-cli.d.ts +7 -3
- package/dist/tools/cli/create-cli.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +70 -20
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/io.d.ts.map +1 -1
- package/dist/tools/cli/managed-surface.d.ts.map +1 -1
- package/dist/tools/cli/notices.d.ts.map +1 -1
- package/dist/tools/cli/policy.d.ts +66 -10
- package/dist/tools/cli/policy.d.ts.map +1 -1
- package/dist/tools/cli/prepare.d.ts +5 -4
- package/dist/tools/cli/prepare.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/run-native.d.ts.map +1 -1
- package/dist/tools/cli/run-stream.d.ts.map +1 -1
- package/dist/tools/cli/runner.d.ts +28 -0
- package/dist/tools/cli/runner.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +12 -6
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/cli/unavailable.d.ts +2 -0
- package/dist/tools/cli/unavailable.d.ts.map +1 -1
- package/dist/tools/cli/unix-outcome.d.ts +8 -0
- package/dist/tools/cli/unix-outcome.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/cli/view-columns.d.ts +18 -0
- package/dist/tools/cli/view-columns.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts.map +1 -1
- package/dist/tools/connections/define.d.ts.map +1 -1
- package/dist/tools/connections/foreign-schema-join.d.ts +28 -0
- package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -0
- package/dist/tools/connections/foreign-schema.d.ts +9 -0
- package/dist/tools/connections/foreign-schema.d.ts.map +1 -0
- package/dist/tools/connections/limits.d.ts +1 -1
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts +18 -6
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +12 -2
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/expose.d.ts +6 -0
- package/dist/tools/internal/expose.d.ts.map +1 -0
- package/dist/tools/internal/json-projection.d.ts +17 -0
- package/dist/tools/internal/json-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +18 -4
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +9 -2
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +8 -2
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +1 -1
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +26 -14
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +2 -0
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mcp/stdio.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +7 -2
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +1 -1
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -2
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
- package/dist/tools/operations/mount-wait.d.ts.map +1 -1
- package/dist/tools/operations/wait-core.d.ts.map +1 -1
- package/dist/tools/read-operation.d.ts +6 -4
- package/dist/tools/read-operation.d.ts.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/runtime-tool-declaration.d.ts +4 -1
- package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +6 -1
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/inline-references.d.ts +7 -0
- package/dist/tools/schema/inline-references.d.ts.map +1 -0
- package/dist/tools/schema/json-schema-origin.d.ts +1 -1
- package/dist/tools/schema/json-schema-origin.d.ts.map +1 -1
- package/dist/tools/schema/presentation.d.ts +6 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/schema/schema.d.ts +2 -0
- package/dist/tools/schema/schema.d.ts.map +1 -1
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +6 -3
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts +2 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
- package/dist/tools/transfer/mount-download.d.ts.map +1 -1
- package/dist/tools/transfer/view-file-contract.d.ts +2 -2
- package/dist/tools/transfer/view-file.d.ts +1 -2
- package/dist/tools/transfer/view-file.d.ts.map +1 -1
- package/dist/tracking/client.d.ts +0 -13
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/delivery.d.ts.map +1 -1
- package/dist/tracking/performance/collector.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +51 -0
- package/llms/agent-executor-claude-sdk.txt +31 -0
- package/llms/agent-executor-claude.txt +29 -0
- package/llms/agent-executor-codex.txt +25 -0
- package/llms/agent-executor-testing.txt +26 -0
- package/llms/agent-executor.txt +40 -0
- package/llms/agent-runtime-harness.txt +68 -5
- package/llms/agent-runtime-openrouter.txt +8 -2
- package/llms/agent-runtime-postgres.txt +30 -0
- package/llms/agent-runtime-react.txt +1 -1
- package/llms/agent-runtime-realtime.txt +1 -1
- package/llms/agent-runtime-sandbox.txt +5 -2
- package/llms/agent-runtime-sqlite-bun.txt +2 -2
- package/llms/agent-runtime-sqlite-node.txt +2 -2
- package/llms/agent-runtime-testing.txt +2 -1
- package/llms/agent-runtime.2.txt +450 -501
- package/llms/agent-runtime.3.txt +229 -267
- package/llms/agent-runtime.4.txt +23 -242
- package/llms/agent-runtime.5.txt +1 -1
- package/llms/agent-runtime.txt +551 -2
- package/llms/application-diagnostic-journal.txt +2 -0
- package/llms/application.2.txt +3 -0
- package/llms/application.3.txt +21 -4
- package/llms/application.txt +4 -1
- package/llms/cli.2.txt +259 -99
- package/llms/cli.3.txt +90 -0
- package/llms/cli.txt +95 -184
- package/llms/contract.txt +7 -6
- package/llms/declaration.txt +1 -1
- package/llms/files.txt +11 -0
- package/llms/handler.txt +25 -0
- package/llms/http.txt +18 -1
- package/llms/node.txt +3 -2
- package/llms/observability.2.txt +105 -0
- package/llms/observability.txt +14 -90
- package/llms/primitives.txt +27 -0
- package/llms/process.2.txt +2 -2
- package/llms/process.txt +10 -9
- package/llms/realtime.txt +11 -0
- package/llms/server.2.txt +355 -0
- package/llms/server.4.txt +45 -6
- package/llms/server.5.txt +6 -1
- package/llms/server.txt +143 -256
- package/llms/service-host-macos.txt +53 -0
- package/llms/service-host.txt +69 -0
- package/llms/spend-testing.txt +21 -0
- package/llms/spend.txt +173 -0
- package/llms/stitchkit.2.txt +368 -42
- package/llms/stitchkit.3.txt +164 -13
- package/llms/stitchkit.txt +95 -417
- package/llms/sync-postgres.txt +31 -0
- package/llms/sync.txt +396 -0
- package/llms/telegram-html.txt +4 -1
- package/llms/telegram.2.txt +4 -4
- package/llms/telegram.txt +105 -14
- package/llms/testing.txt +4 -3
- package/llms/tools-connections.txt +4 -4
- package/llms/tools.2.txt +78 -17
- package/llms/tools.3.txt +12 -8
- package/llms/tools.txt +85 -78
- package/llms/upgrading-0.127.0.txt +1059 -0
- package/llms/upgrading.txt +1 -0
- package/llms-full.txt +3557 -531
- package/llms.txt +43 -27
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/native-assets.json +4 -4
- package/package.json +67 -9
- package/dist/agent-runtime/sandbox-coding.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-events.d.ts +0 -5
- package/dist/agent-runtime/sqlite-events.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-history.d.ts +0 -7
- package/dist/agent-runtime/sqlite-history.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-ledger.d.ts +0 -7
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-reads.d.ts +0 -14
- package/dist/agent-runtime/sqlite-reads.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-rows.d.ts.map +0 -1
- package/dist/agent-runtime/tool-progress.d.ts.map +0 -1
- package/dist/entrypoints/application/schemas.d.ts +0 -15
- package/dist/entrypoints/application/schemas.d.ts.map +0 -1
- package/dist/entrypoints/application/schemas.js +0 -27
- package/dist/index-0s4xebbg.js +0 -8
- package/dist/index-57ppvpw0.js +0 -1150
- package/dist/index-5dmk54h9.js +0 -256
- package/dist/index-7cn66qdk.js +0 -92
- package/dist/index-8x0q6yfb.js +0 -247
- package/dist/index-a5qr2rj6.js +0 -26
- package/dist/index-b0kddvzw.js +0 -35
- package/dist/index-drcjjhy1.js +0 -40
- package/dist/index-eemvahkc.js +0 -21
- package/dist/index-gfk7nrht.js +0 -0
- package/dist/index-jp2qd9jb.js +0 -108
- package/dist/index-nx6eazt0.js +0 -160
- package/dist/index-wxadzdb7.js +0 -55
- package/dist/internal/until-aborted.d.ts +0 -9
- package/dist/internal/until-aborted.d.ts.map +0 -1
- package/dist/server/unix-client-error.d.ts +0 -9
- package/dist/server/unix-client-error.d.ts.map +0 -1
- package/llms/application-schemas.txt +0 -42
package/llms/agent-runtime.2.txt
CHANGED
|
@@ -8,484 +8,13 @@ Parts of this slice:
|
|
|
8
8
|
- `llms/agent-runtime.txt`: Guide: Agent application runtime (docs/guide/agent-runtime.md)
|
|
9
9
|
- `llms/agent-runtime.2.txt`: Guide: Agent application runtime (docs/guide/agent-runtime.md)
|
|
10
10
|
- `llms/agent-runtime.3.txt`: Guide: Agent application runtime (docs/guide/agent-runtime.md)
|
|
11
|
-
- `llms/agent-runtime.4.txt`:
|
|
11
|
+
- `llms/agent-runtime.4.txt`: API reference: `stitchkit/agent-runtime` (docs/api/reference.md)
|
|
12
12
|
- `llms/agent-runtime.5.txt`: API reference: `stitchkit-tui` (docs/api/reference.md)
|
|
13
13
|
|
|
14
14
|
==============================================================================
|
|
15
15
|
# Guide: Agent application runtime (docs/guide/agent-runtime.md) (continued)
|
|
16
16
|
==============================================================================
|
|
17
17
|
|
|
18
|
-
## Bounded deferred tool catalogs
|
|
19
|
-
|
|
20
|
-
Use `createDeferredAgentToolSurface` when a measured large catalog makes
|
|
21
|
-
sending every schema on every provider step expensive. The controller mounts
|
|
22
|
-
the complete executable surface in process, but initially advertises only its
|
|
23
|
-
search tool, explicit `alwaysOn` tools and bounded policy pins:
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
import { createDeferredAgentToolSurface } from 'stitchkit/agent-runtime'
|
|
27
|
-
import { composeToolLifecycle } from 'stitchkit/tools'
|
|
28
|
-
|
|
29
|
-
const deferred = createDeferredAgentToolSurface({
|
|
30
|
-
surfaces: {
|
|
31
|
-
member: { services: memberServices, runtimeTools, alwaysOn: ['ask_user'] },
|
|
32
|
-
broadcast: { services: broadcastServices, runtimeTools },
|
|
33
|
-
},
|
|
34
|
-
selectSurface: ({ context }) => context.mode,
|
|
35
|
-
pins: ({ context }) => context.skillTools,
|
|
36
|
-
search: {
|
|
37
|
-
name: 'tool_search',
|
|
38
|
-
maxQueryBytes: 1_024,
|
|
39
|
-
maxResults: 8,
|
|
40
|
-
maxResultBytes: 8_192,
|
|
41
|
-
select: ({ query, manifest }) => rankCatalog(query, manifest),
|
|
42
|
-
},
|
|
43
|
-
activation: {
|
|
44
|
-
maxSelectedTools: 8,
|
|
45
|
-
maxActiveTools: 16,
|
|
46
|
-
maxSchemaBytes: 32_768,
|
|
47
|
-
},
|
|
48
|
-
observe: event => recordDeferredToolEvidence(event),
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
const runtime = createAgentRuntime({
|
|
52
|
-
// protocol, store, models and prompt...
|
|
53
|
-
tools: runContext => deferred.mount(runContext, {
|
|
54
|
-
context: runContext.context,
|
|
55
|
-
lifecycle: composeToolLifecycle(authLifecycle, runContext.toolFenceLifecycle),
|
|
56
|
-
}),
|
|
57
|
-
loop: { prepareStep: deferred.prepareStep(applicationPrepareStep) },
|
|
58
|
-
})
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
The built-in selector deterministically ranks exact name, prefix/token and
|
|
62
|
-
description matches. A custom async selector returns names only; unknown and
|
|
63
|
-
duplicate output is removed against the local canonical manifest. Search never
|
|
64
|
-
executes the selected operation and never returns its schema. A later provider
|
|
65
|
-
step receives the real selected tools by name, so their direct lifecycle,
|
|
66
|
-
fencing, hooks, errors and `present.agent` output remain unchanged.
|
|
67
|
-
|
|
68
|
-
Selection is a versioned receipt in the ordinary durable tool-result history.
|
|
69
|
-
The latest valid same-run search replaces the earlier selection; parallel
|
|
70
|
-
searches in one step merge in call order. Recovery reconstructs it, while a
|
|
71
|
-
different run or finite surface cannot inherit it. Known inactive calls take a
|
|
72
|
-
recoverable `SEARCH_REQUIRED` search round; unknown names still fail. The
|
|
73
|
-
runtime marks that round with `reason: 'inactive_call'` beside the exact tool
|
|
74
|
-
name. The field is the runtime's to write; a model that sets it anyway gets
|
|
75
|
-
the same `SEARCH_REQUIRED` answer with an exact name, and with a query in words
|
|
76
|
-
the field is ignored and the query is ranked as usual.
|
|
77
|
-
|
|
78
|
-
Every ceiling is required. `maxSchemaBytes` measures UTF-8 bytes over canonical
|
|
79
|
-
name, description and presentation schema. It is useful for before/after
|
|
80
|
-
comparison, but provider serialization and tokenization differ: use existing
|
|
81
|
-
provider-reported input usage and cost to decide whether the extra search round
|
|
82
|
-
is beneficial. Controller evidence intentionally omits query text, prompts,
|
|
83
|
-
arguments and application context. → ADR 0129.
|
|
84
|
-
|
|
85
|
-
### Published headless harness and structured runner
|
|
86
|
-
|
|
87
|
-
`stitchkit/agent-runtime/harness` publishes the resource-aware composition over
|
|
88
|
-
`createAgentRuntime`. `createHeadlessAgentHarness` accepts the existing protocol and store,
|
|
89
|
-
caller-provided model resolution, bounded instruction/skill/resource loading, direct tools and a
|
|
90
|
-
prompt-budget callback. Resource names are unique; count, UTF-8 bytes and diagnostics are bounded.
|
|
91
|
-
Invalid resources fail before a provider request. Diagnostics are evidence for the caller: their
|
|
92
|
-
observer is isolated, and the loader decides whether a reported condition is fatal.
|
|
93
|
-
|
|
94
|
-
`createAgentHarnessFileResources` is the optional filesystem implementation. It reads only
|
|
95
|
-
caller-declared absolute roots, refuses symlinks and reports provenance as
|
|
96
|
-
`rootId:relative/path`. Instructions enter the prompt immediately. Skills and ordinary resources
|
|
97
|
-
enter as bounded name/description summaries; `read_resource` loads one exact body later as
|
|
98
|
-
a normal direct typed tool. Custom loaders remain supported unchanged.
|
|
99
|
-
|
|
100
|
-
Each run may resolve a different provider adapter without changing the harness. The
|
|
101
|
-
`profile-applied` observation records the actual `AgentModelDescriptor`, resource kind/name/
|
|
102
|
-
provenance and sorted direct tool names; it intentionally contains no resource text, prompts,
|
|
103
|
-
arguments or credentials. Observer failure never changes the canonical run outcome.
|
|
104
|
-
|
|
105
|
-
[`packages/core/examples/agent-runtime/headless-agent-runner.ts`](../../packages/core/examples/agent-runtime/headless-agent-runner.ts)
|
|
106
|
-
is a reference structured control loop for `submit`, `interrupt`, `snapshot` and bounded `close`.
|
|
107
|
-
It starts no process and chooses no framing, authentication or transport. Importing either example
|
|
108
|
-
has no side effect; an external supervisor owns process placement and restart.
|
|
109
|
-
|
|
110
|
-
| Concern | Public Stitchkit composition | Boundary |
|
|
111
|
-
| --- | --- | --- |
|
|
112
|
-
| execution loop | `createAgentRuntime` | already available; do not copy a second loop |
|
|
113
|
-
| model choice | `defineModelRegistry` and `models.resolve` | provider credentials/discovery stay application-owned |
|
|
114
|
-
| resources | `createHeadlessAgentHarness` → `composeAgentPrompt` | paths, trust, precedence and watching stay application-owned |
|
|
115
|
-
| tools | `mountAgent` + `createAgentToolFenceLifecycle` | auth and domain effects stay application-owned |
|
|
116
|
-
| follow-up | `runs.inputPolicy: 'queue'` | durable FIFO after the current run |
|
|
117
|
-
| interrupt | `interrupt` or `interrupt-next` | `interrupt-next` terminates the active run and gives the new durable admission next priority |
|
|
118
|
-
| recovery | `runtime.recover` + `scanRecoverable` | replay safety and context reconstruction are explicit callbacks |
|
|
119
|
-
| reconnect | canonical snapshot + `advanceAgentMultiSessionCursor` | conversation/run-scoped gaps require resync |
|
|
120
|
-
| persistence | memory reference, public driver, or SQLite leaf | product rows/outbox remain outside the runtime store |
|
|
121
|
-
| executable lifecycle | structured runner example | framing, auth, process placement, restart and OS isolation stay host-owned |
|
|
122
|
-
|
|
123
|
-
`createAgentHarnessControlServer` adds transport-neutral correlated requests, shared observers and
|
|
124
|
-
one exclusive controller lease per conversation. `close()` on a connection detaches only that
|
|
125
|
-
client; it never closes the harness. Normal `event` delivery stays serialized. A bounded slow
|
|
126
|
-
consumer is detached and receives `resync-required` through the required synchronous
|
|
127
|
-
`onOverflow` callback; that callback closes/aborts the underlying transport, which then reconnects
|
|
128
|
-
and requests a fresh snapshot. It never writes a second frame concurrently with a blocked
|
|
129
|
-
`deliver`. Browser code uses `createAgentControlView`,
|
|
130
|
-
`reduceAgentControlSnapshot` and `reduceAgentControlEvent`; the reducer owns no renderer and marks a
|
|
131
|
-
conversation `resyncRequired` after a transient sequence gap.
|
|
132
|
-
|
|
133
|
-
Configure `loop.toolApproval` to use the installed AI SDK approval policy and
|
|
134
|
-
`loop.toolApprovalSecret` to sign exact requests. A request is stored on the terminal assistant
|
|
135
|
-
before any effect. `pendingApprovals()` derives unresolved requests from canonical messages;
|
|
136
|
-
`respondToApproval()` writes one tool-role approval response and queues a successor. The SDK
|
|
137
|
-
revalidates the signature/tool call/input before the original direct tool reaches its existing
|
|
138
|
-
fence. Reconnect and SQLite reopen require no promise registry. Remembered policy and a stronger
|
|
139
|
-
cross-crash exactly-once guarantee remain application concerns.
|
|
140
|
-
|
|
141
|
-
Approval requests suspend a call; they do not settle its result. History carries exact call and
|
|
142
|
-
approval identity across assistant/tool records, so an approved result can precede the next signed
|
|
143
|
-
request in a successor run. Automatic decisions follow the same chronology. Unknown/duplicate
|
|
144
|
-
responses and results with a different call or tool name are invalid; dropping an invalid active
|
|
145
|
-
approval input fails the run with a private diagnostic rather than starting a fresh model turn.
|
|
146
|
-
|
|
147
|
-
`stitchkit/agent-runtime/coding-tools` returns ordinary direct runtime tools named `read_file`,
|
|
148
|
-
`write_file`, `edit_file`, `list_directory`, `glob`, `search_files`, `run_command` and optional
|
|
149
|
-
`read_output`. Every call passes a required host authorization callback. An optional async/sync
|
|
150
|
-
`authorizePath({ path })` is the one operation-independent policy for direct file access and
|
|
151
|
-
discovery: direct read/write/edit refuses a denied path, while listing, glob and search omit it.
|
|
152
|
-
Denial is recursive on every surface — direct access asks about each named ancestor and the file,
|
|
153
|
-
outermost first, stopping at the first refusal; discovery rooted at `.` also asks about `.`.
|
|
154
|
-
Thus denying `credentials` denies everything
|
|
155
|
-
under it. The comparison is segment-wise, so it does not deny `credentials-backup`, and a path of
|
|
156
|
-
depth N costs N questions for direct access. Directory decisions happen before descent; file decisions and
|
|
157
|
-
`search_files.include` happen before opening content. Incompatible glob directory prefixes are
|
|
158
|
-
pruned before policy or directory opens. Requested paths use `/`: a backslash is
|
|
159
|
-
refused rather than normalised, because the workspace walk reads it as a separator and every
|
|
160
|
-
authorization callback would otherwise be asked about a different decomposition than the one opened. File paths are relative, bounded and contained after
|
|
161
|
-
descriptor-relative resolution: each ancestor is opened without following symlinks. Reads and edits
|
|
162
|
-
stay pinned through authorization; `write_file` plans before it and opens the parent after, because
|
|
163
|
-
the parent it creates does not exist yet. Reads revalidate the pinned file identity;
|
|
164
|
-
writes and patches revalidate the pinned parent identity; search and resource discovery descend
|
|
165
|
-
only through opened directories. Every filesystem tool selects its root capability before operation or path authorization and retains
|
|
166
|
-
that identity if a callback replaces the root path or configured alias. On Linux the ordinary
|
|
167
|
-
command launcher spawns the command with the pinned directory's `/proc` descriptor link as its cwd;
|
|
168
|
-
on macOS it inherits the pinned cwd through an isolated guard — one short-lived guard process per
|
|
169
|
-
command, tens of milliseconds, outside `shellTimeoutMs`, which counts from the command's start. The
|
|
170
|
-
application process never changes cwd. Where
|
|
171
|
-
contained descriptors are unavailable (Windows), `run_command` accepts a cwd whose realpath is
|
|
172
|
-
that same name under the root — a symlink segment refuses there too — and checks the directory's
|
|
173
|
-
identity again immediately before launch, after every host decision.
|
|
174
|
-
A custom sandbox launcher owns atomic cwd capture at its pathname handoff; the SDK refuses a
|
|
175
|
-
changed identity after policy/prepare and immediately before that handoff. A path that changed
|
|
176
|
-
during direct-access authorization refuses with `CONFLICT`.
|
|
177
|
-
A path spelled differently from the name stored on disk refuses before any policy reads it, so on a
|
|
178
|
-
case-insensitive volume a rule on `credentials` cannot be passed by asking for `CREDENTIALS`.
|
|
179
|
-
NUL bytes are refused before either host policy sees a path.
|
|
180
|
-
Reads and edits open file candidates without blocking on special files, then require a regular
|
|
181
|
-
file. A writerless FIFO therefore refuses instead of occupying a filesystem worker. `write_file`
|
|
182
|
-
supplies the exact missing-directory plan as `createsDirectories` to host authorization; the
|
|
183
|
-
descriptor walk may create only those entries. An ancestor that disappears after approval refuses
|
|
184
|
-
with `CONFLICT`, without expanding that plan. Linux traverses `/proc/self/fd`; macOS uses the package's
|
|
185
|
-
architecture-specific Node-API `openat` backend. Unsupported platforms, including FreeBSD until a
|
|
186
|
-
real backend is qualified, fail closed. The package needs no install-time compiler or script.
|
|
187
|
-
Other platforms fail these filesystem operations closed because Node exposes no equivalent
|
|
188
|
-
portable directory-handle-relative API. Writes/edits reject symlink targets, content is strict
|
|
189
|
-
UTF-8 and retained bytes are finite. Shell accepts a finite alias mapped by the host to an absolute executable plus an
|
|
190
|
-
argument array — never a shell command string — and uses only the explicitly supplied environment.
|
|
191
|
-
Arguments, output and time are bounded, while cancellation terminates the child. The configured
|
|
192
|
-
root and cwd are path boundaries, not a security sandbox: isolate the process when an executable
|
|
193
|
-
must not access the rest of the machine. Path admission does not constrain `run_command`; an
|
|
194
|
-
executable requires process isolation for that guarantee. → ADR 0172
|
|
195
|
-
|
|
196
|
-
An absolute path is still refused. When it is inside the canonical workspace root, the refusal
|
|
197
|
-
includes the exact workspace-relative `recoveryPath`; an absolute path outside the root has no
|
|
198
|
-
suggested replacement. Applying the suggestion still passes the same descriptor-relative
|
|
199
|
-
containment and symlink checks.
|
|
200
|
-
|
|
201
|
-
`edit_file` replaces one exact snippet. It inserts `newText` literally in both single and
|
|
202
|
-
`replaceAll` modes, including JavaScript replacement tokens such as `$$`, `$&`, `` $` `` and `$'`.
|
|
203
|
-
`oldText` is itself the freshness guard for the region it changes, so the digest is the optional `expectedSha256` and an edit is one call; pass the digest
|
|
204
|
-
`read_file` returned when you want the whole-file guarantee, and read the `sha256` it returns to
|
|
205
|
-
chain the next edit without re-reading. The read, the occurrence count and the construction of the
|
|
206
|
-
new content all happen inside one per-target lock, so two concurrent edits of different snippets in
|
|
207
|
-
one file cannot each build a file from the same base and have the second erase the first — the lock
|
|
208
|
-
is process-local, which covers many agents in one process and not two processes over one workspace.
|
|
209
|
-
It authorizes the exact replacement count, result digest and byte size, and deliberately does not
|
|
210
|
-
claim multi-file atomicity.
|
|
211
|
-
|
|
212
|
-
`write_file` creates missing parent directories inside the root and names them in
|
|
213
|
-
`createdDirectories`; the walk that finds them runs before authorization and reports them in the
|
|
214
|
-
authorization payload, so no directory is created before a host approves it.
|
|
215
|
-
|
|
216
|
-
**Every ordinary outcome is a refusal a model can act on** — a missing file is `NOT_FOUND`, an
|
|
217
|
-
existing file without `overwrite` is `CONFLICT`, an ambiguous snippet is `CONFLICT` carrying its
|
|
218
|
-
occurrence count, a path outside the root is `FORBIDDEN`, an unknown spilled-output reference is
|
|
219
|
-
`SPILL_REFERENCE_UNKNOWN` — each with a `hint` naming the next move.
|
|
220
|
-
Host-level causes stay scrubbed to `INTERNAL_SERVER_ERROR` and name nothing outside the workspace.
|
|
221
|
-
Every refusal code is a member of `STITCH_ERROR_STATUS`, so its status survives an envelope that
|
|
222
|
-
crosses a process boundary and is rebuilt from the wire.
|
|
223
|
-
→ ADR 0139
|
|
224
|
-
|
|
225
|
-
`list_directory` marks excluded directories rather than hiding them, and `glob` reports
|
|
226
|
-
`skippedDirectories` beside its matches: an empty result from a tree whose files all live under an
|
|
227
|
-
excluded directory is not "no files", and a model told only "nothing found" concludes the wrong
|
|
228
|
-
thing. `search_files` takes `regex`, `context` lines and an anchored `include` pattern matched
|
|
229
|
-
against the whole workspace-relative path. `*` does not cross `/`, so files in subdirectories need
|
|
230
|
-
`**/`; `scannedFiles` counts files admitted by both that filter and host authorization that reached
|
|
231
|
-
comparison. One finite glob automaton matches files and prunes incompatible directory prefixes;
|
|
232
|
-
`glob` also confines its walk to the requested path. A `hint` can explain include filtering or
|
|
233
|
-
pruning, without counting files below unopened directories.
|
|
234
|
-
|
|
235
|
-
Search processes one file at a time. List, glob and search share directory, entry, serialized-output,
|
|
236
|
-
timeout and cancellation budgets, including canonical spelling checks before path authorization.
|
|
237
|
-
`list_directory` caps raw enumeration at the smaller of `maxListEntries` and `maxSearchEntries`;
|
|
238
|
-
its coverage scope lists symlinks while glob/search skip them. Glob patterns are limited to 4,096
|
|
239
|
-
UTF-16 units. A scoped glob measures depth from its requested base directory. In addition to `maxSearchFiles` (10,000), `maxSearchDepth`
|
|
240
|
-
(32), `maxSearchResults` (100) and `maxReadBytes` (262,144), hosts can configure
|
|
241
|
-
`maxSearchDirectories` (1,000 directory-open attempts, root included), `maxSearchEntries`
|
|
242
|
-
(20,000 entries observed by bounded readers), `maxSearchBytes` (16,777,216 aggregate content
|
|
243
|
-
bytes, including rejected UTF-8), `maxSearchOutputBytes` (65,536 bytes for the entire serialized
|
|
244
|
-
UTF-8 JSON, minimum 1,024) and `searchTimeoutMs` (5,000). An input whose minimum coverage
|
|
245
|
-
envelope cannot fit the output ceiling refuses before filesystem access. Directory readers cap
|
|
246
|
-
enumeration before materialization and sorting; reaching an entry or result ceiling is
|
|
247
|
-
conservatively partial, without reading a lookahead entry or match.
|
|
248
|
-
|
|
249
|
-
`list_directory`, `glob` and `search_files` return `coverage.complete` and `coverage.reasons`
|
|
250
|
-
to distinguish full empty results from partial work. Glob `resultTruncated` conservatively marks
|
|
251
|
-
the result ceiling even when no extra match was read.
|
|
252
|
-
Coverage names the include/exclusion/symlink scope, directory and entry counters, actual content
|
|
253
|
-
bytes and elapsed milliseconds. Limits, cancellation, denial, unreadable files and oversized
|
|
254
|
-
lines are explicit reasons. `errors` names only a workspace-relative path, operation and safe code;
|
|
255
|
-
`errorsTruncated` and `deniedTruncated` report shortened diagnostics. Excluded directories and
|
|
256
|
-
symlinks are outside the declared search scope. The caller's signal and deadline reach host
|
|
257
|
-
authorization, file reads and traversal; CPU checkpoints and asynchronous races stop further work.
|
|
258
|
-
Late opened handles are closed, while already-running kernel calls may finish later. Directory
|
|
259
|
-
enumeration and glob matching have internal checkpoints; cancellation stops their producer loops.
|
|
260
|
-
Host policy and visitor exceptions propagate to error hooks with their original cause, rather
|
|
261
|
-
than becoming filesystem diagnostics. Diagnostic byte admission is linear and checks the deadline
|
|
262
|
-
even for an empty result.
|
|
263
|
-
|
|
264
|
-
Regex searches use JavaScript `RegExp` syntax without flags — groups, alternation, classes,
|
|
265
|
-
anchors, `\b`, quantifiers and `(?ims-ims:…)` modifiers — with bounded cost per line. A line
|
|
266
|
-
whose backtracking work (paths × longest path × line length × (number of groups + 1), every
|
|
267
|
-
repetition capped at the line length beyond the iterations it requires) stays within 2^24 steps runs on the native engine, so ordinary `.*` searches over code
|
|
268
|
-
lines keep native speed and the deadline is observed between lines; any other line runs on a
|
|
269
|
-
cached linear automaton, so `(a+)+$` on a long line costs the same as `a+` and the deadline is
|
|
270
|
-
observed inside the line. Backreferences and
|
|
271
|
-
lookaround refuse before I/O; lines over 8,192 UTF-8 bytes are skipped with incomplete coverage.
|
|
272
|
-
Literal queries allow up to 8,192 UTF-16 units and include patterns up to 4,096.
|
|
273
|
-
|
|
274
|
-
With an optional `AgentCodingArtifactStore`, shell output beyond the inline
|
|
275
|
-
preview continues into an opaque bounded artifact and `read_output` reads slices without
|
|
276
|
-
exposing a host path. Without a store, the previous finite output-limit behavior is unchanged.
|
|
277
|
-
|
|
278
|
-
`run_command` treats every invocation as finite. `shellTimeoutMs` bounds normal execution and
|
|
279
|
-
`shellTerminationGraceMs` bounds settlement after timeout, caller cancellation, output overflow or
|
|
280
|
-
parent exit. POSIX hosts launch a dedicated process group and kill every descendant remaining in
|
|
281
|
-
that group; a process that deliberately escapes the group is outside the guarantee. Node's
|
|
282
|
-
portable Windows child-process API cannot kill a complete descendant tree without invoking a
|
|
283
|
-
second host executable, so Windows kills the direct child, destroys retained pipes at the grace
|
|
284
|
-
deadline and makes no descendant-cleanup claim. A signal already aborted before execution returns
|
|
285
|
-
`cancelled` without spawning.
|
|
286
|
-
|
|
287
|
-
Coding commands compose the shared native execution owner. Artifact retention and UTF-8
|
|
288
|
-
previews remain coding-tool policy; normal leader exit still forcibly stops remaining POSIX
|
|
289
|
-
group members before draining. A structural sandbox launcher uses the same settlement owner
|
|
290
|
-
with a finite output queue. Sandbox shutdown waits for actual owned completion and surfaces
|
|
291
|
-
cleanup refusal rather than treating it as successful teardown.
|
|
292
|
-
|
|
293
|
-
One `createAgentHarnessFileResources` instance represents one immutable discovery generation:
|
|
294
|
-
concurrent and repeated `load()` calls share it, so a direct resource read cannot cross into a
|
|
295
|
-
new catalog unexpectedly. Discovery uses the same descriptor-anchored traversal as coding search;
|
|
296
|
-
construct a new loader to refresh after filesystem changes.
|
|
297
|
-
|
|
298
|
-
Runtime events preserve reasoning/text/tool lifecycle order. Durable admission,
|
|
299
|
-
checkpoint, run-state and terminal events carry stable identities; transient
|
|
300
|
-
deltas carry one runtime epoch and monotonic sequence. On a transient gap,
|
|
301
|
-
reload the canonical snapshot and resume from the durable record instead of
|
|
302
|
-
persisting deltas as a second history.
|
|
303
|
-
|
|
304
|
-
Prompt `contextWindow` budgeting is a pre-request decision over the assembled
|
|
305
|
-
context. `AgentRun.usage` is cumulative measured/provider-reported execution
|
|
306
|
-
evidence across attempts and compaction. They answer different questions and
|
|
307
|
-
must not be substituted for each other. TTFT and throughput require timestamps
|
|
308
|
-
from the actual provider stream plus a provider-reported or tokenizer-measured
|
|
309
|
-
token count; character counts cannot produce exact token or throughput figures.
|
|
310
|
-
|
|
311
|
-
`recordIds` is optional. Supply stable application record IDs when an accepted-response transport must
|
|
312
|
-
return durable placeholders before the run finishes. `ticket.admission` resolves after the store
|
|
313
|
-
acceptance CAS and reports the canonical committed `input`, assigned `run`, a typed `pending`
|
|
314
|
-
assistant projection, compatibility IDs and snapshot version.
|
|
315
|
-
Those assigned IDs can differ from the proposal when an input coalesces into an existing queued
|
|
316
|
-
successor. Reuse the same `inputMessageId` for retries carrying the same idempotency key; input
|
|
317
|
-
identity is caller-stable, while the receipt reports the run/assistant identities that assignment
|
|
318
|
-
may change. Await `admission` first on the immediate accepted-response path. `ticket.accepted`
|
|
319
|
-
remains the signal-only compatibility surface and additionally waits for admission publication.
|
|
320
|
-
|
|
321
|
-
The in-memory store is a reference adapter and has process-local durability
|
|
322
|
-
only. Production applications normally call `createAgentRuntimeStore()` and
|
|
323
|
-
provide one database transaction driver. Its `transaction` owns the retry of a
|
|
324
|
-
serialization conflict, wherever the database reports it: on a statement or on
|
|
325
|
-
`COMMIT`, which some clients surface in a different shape. Pass
|
|
326
|
-
`armCommitConflict` to `runAgentStoreConformance` to prove it:
|
|
327
|
-
|
|
328
|
-
```ts
|
|
329
|
-
const store = createAgentRuntimeStore({
|
|
330
|
-
transaction: (work, options) =>
|
|
331
|
-
options?.access === 'read'
|
|
332
|
-
? db.readTransaction(tx => work(tx))
|
|
333
|
-
: db.writeTransaction(tx => work(tx)),
|
|
334
|
-
head: {
|
|
335
|
-
load: (tx, conversationId) => loadRuntimeHead(tx, conversationId),
|
|
336
|
-
compareAndSwap: (tx, operation) => casRuntimeHead(tx, operation),
|
|
337
|
-
},
|
|
338
|
-
runs: {
|
|
339
|
-
load: (tx, identity) => loadRun(tx, identity),
|
|
340
|
-
loadByAssistantMessageId: (tx, identity) => loadRunByAssistant(tx, identity),
|
|
341
|
-
loadMany: (tx, identities) => loadRuns(tx, identities),
|
|
342
|
-
listActive: (tx, conversationId) => listActiveRuns(tx, conversationId),
|
|
343
|
-
save: (tx, record) => saveRun(tx, record),
|
|
344
|
-
},
|
|
345
|
-
admissions: {
|
|
346
|
-
load: (tx, identity) => loadAdmission(tx, identity),
|
|
347
|
-
loadByInputMessageId: (tx, identity) => loadAdmissionByInput(tx, identity),
|
|
348
|
-
create: (tx, receipt) => createAdmission(tx, receipt),
|
|
349
|
-
},
|
|
350
|
-
history: {
|
|
351
|
-
load: (tx, conversationId) => loadCanonicalMessages(tx, conversationId),
|
|
352
|
-
apply: (tx, mutation) => applyCanonicalHistoryMutation(tx, mutation),
|
|
353
|
-
},
|
|
354
|
-
scanRecoverable: page => scanRecoverableRuns(page),
|
|
355
|
-
})
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
Prompt budgeting keeps reservation deficits signed. If instructions,
|
|
359
|
-
`reservedOutput`, tool schemas, attachments and provider overhead already exceed
|
|
360
|
-
`contextWindow`, `composeAgentPrompt` returns `contextDecision: 'oversized'`
|
|
361
|
-
and a negative `availableHistoryTokens` even when history is empty. A `compact`
|
|
362
|
-
policy is returned only when removing history could actually make the prompt
|
|
363
|
-
fit. Exact equality (including a zero window with zero reservations/history)
|
|
364
|
-
fits; any unavailable component keeps the decision `unavailable`.
|
|
365
|
-
|
|
366
|
-
The same opaque `tx` reaches head, run, admission and history callbacks. The adapter maps rows
|
|
367
|
-
and supplies atomicity; Stitchkit owns transition validation and revision
|
|
368
|
-
arithmetic. The executable reference is
|
|
369
|
-
[`examples/agent-store-prisma/adapter.ts`](../../examples/agent-store-prisma/adapter.ts).
|
|
370
|
-
`compareAndSwap` returns either `{ outcome: 'applied' }` or
|
|
371
|
-
`{ outcome: 'conflict', actualVersion }`. Decide that outcome by reading the
|
|
372
|
-
version, comparing it and then writing unconditionally — inside the transaction
|
|
373
|
-
the adapter supplies, that is atomic. A conditional upsert is the shorter thing
|
|
374
|
-
to write and it is wrong twice: `ON CONFLICT ... WHERE` guards the update branch
|
|
375
|
-
only, so the first write to a conversation applies whatever `expectedVersion` it
|
|
376
|
-
was given, and the affected-row count that would report the outcome is the
|
|
377
|
-
driver's, which need not be the rows the statement moved. The head contains only
|
|
378
|
-
schema version, conversation identity and monotonic version. Runs and admission receipts are normalized records;
|
|
379
|
-
recovery queries active run states directly instead of maintaining a second projection.
|
|
380
|
-
An admission receipt retains its canonical input, and a terminal run retains its canonical
|
|
381
|
-
assistant, so physical product-history compaction cannot break idempotent retries.
|
|
382
|
-
|
|
383
|
-
### Built-in SQLite persistence
|
|
384
|
-
|
|
385
|
-
Use the runtime-specific leaf; the neutral agent runtime never imports either
|
|
386
|
-
SQLite built-in:
|
|
387
|
-
|
|
388
|
-
```ts
|
|
389
|
-
// Bun
|
|
390
|
-
import { createBunSqliteAgentRuntimeStore } from 'stitchkit/agent-runtime/sqlite/bun'
|
|
391
|
-
|
|
392
|
-
const sqlite = createBunSqliteAgentRuntimeStore({ filename: './agent-runtime.sqlite' })
|
|
393
|
-
const runtime = createAgentRuntime({ ...config, store: sqlite.store })
|
|
394
|
-
|
|
395
|
-
await runtime.close()
|
|
396
|
-
await sqlite.close()
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
```ts
|
|
400
|
-
// Node 22.5+
|
|
401
|
-
import { createNodeSqliteAgentRuntimeStore } from 'stitchkit/agent-runtime/sqlite/node'
|
|
402
|
-
|
|
403
|
-
const sqlite = createNodeSqliteAgentRuntimeStore({ filename: './agent-runtime.sqlite' })
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
Initialization creates only `stitchkit_agent_runtime_*` tables and records
|
|
407
|
-
schema version 2 in `stitchkit_agent_runtime_meta`; it does not use
|
|
408
|
-
`PRAGMA user_version` or mutate application tables. An unknown schema version or
|
|
409
|
-
unversioned partial Stitchkit schema is refused. The connection is owned by the
|
|
410
|
-
returned handle and closes only after accepted operations drain.
|
|
411
|
-
|
|
412
|
-
Each handle serializes its transactions. Separate connections use
|
|
413
|
-
`busy_timeout = 0`: a competing synchronous writer fails promptly with
|
|
414
|
-
SQLite's lock error, so an awaited transaction can resume and commit or roll
|
|
415
|
-
back. Retry that explicit error with an application-owned bounded policy; do
|
|
416
|
-
not configure a blocking busy timeout on the same JavaScript thread.
|
|
417
|
-
|
|
418
|
-
Aggregate reads and catalog pages use `BEGIN`, so a WAL writer may remain active
|
|
419
|
-
while the reader sees one committed snapshot. Mutations and purge use
|
|
420
|
-
`BEGIN IMMEDIATE`: they reserve the writer slot before reading state for CAS and
|
|
421
|
-
never attempt a deferred read-to-write upgrade. A custom driver may inspect the
|
|
422
|
-
additive `transaction` option `{ access: 'read' }`; ignoring it preserves the
|
|
423
|
-
previous write-safe behavior.
|
|
424
|
-
|
|
425
|
-
The adapter proves canonical durability across reopen and process restart. It
|
|
426
|
-
does not make external tool effects exactly once, join application projections
|
|
427
|
-
atomically or replace an application outbox. If a product row must commit with
|
|
428
|
-
an agent transition, implement `AgentRuntimeStoreDriver` over the application's
|
|
429
|
-
own transaction boundary instead.
|
|
430
|
-
|
|
431
|
-
Opening a version 1 store migrates it in one transaction, forward only — back
|
|
432
|
-
the file up first, a 0.85.x package refuses a migrated file. Existing
|
|
433
|
-
normalized state becomes one `runtime/baseline` event per conversation, dated
|
|
434
|
-
when the migration ran and carrying `asOf` for the last message it describes;
|
|
435
|
-
search and projections address that pre-migration history as one snapshot at
|
|
436
|
-
`seq 1`. New transitions continue the monotonic conversation sequence. Version
|
|
437
|
-
2 requires SQLite FTS5 because event search is an advertised capability, so a
|
|
438
|
-
build without FTS5 is a startup error (`requires FTS5 support`) rather than an
|
|
439
|
-
empty search result; check with
|
|
440
|
-
`SELECT sqlite_compileoption_used('ENABLE_FTS5')`.
|
|
441
|
-
|
|
442
|
-
The handle returned by `createBunSqliteAgentRuntimeStore` /
|
|
443
|
-
`createNodeSqliteAgentRuntimeStore` is `{ store, conversations, database,
|
|
444
|
-
transaction, close }`. `database` is the shared connection and `transaction`
|
|
445
|
-
is one write transaction in the store's own serialization: the SQLite
|
|
446
|
-
companions — `createSqliteAgentProjectionStore`, `createSqliteAgentSpillStore`,
|
|
447
|
-
`createSqliteAgentChildManager`, `createAgentScheduleService` — take `{ sqlite }`
|
|
448
|
-
and write their rows and events through it, so a row and its event land
|
|
449
|
-
together or not at all.
|
|
450
|
-
|
|
451
|
-
`conversations.messages` pages the model's history: what compaction removed is
|
|
452
|
-
not in it, which is the point of compaction. A person reading back their own
|
|
453
|
-
conversation needs the other view, and asks for it explicitly:
|
|
454
|
-
|
|
455
|
-
```ts
|
|
456
|
-
const page = await conversations.messages({
|
|
457
|
-
conversationId,
|
|
458
|
-
limit: 50,
|
|
459
|
-
direction: 'after',
|
|
460
|
-
includeCompacted: true,
|
|
461
|
-
})
|
|
462
|
-
const removed = new Set(page.compacted)
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
`items` stays one sequence in the order it happened, and `compacted` names the
|
|
466
|
-
ids inside it that the model no longer sees — the boundary is a mark on the
|
|
467
|
-
conversation, not a second list. A compaction summary sits at the position of
|
|
468
|
-
the last message it replaced, so the block reads through and the summary
|
|
469
|
-
arrives after it, where it was written; in the model's history, where every
|
|
470
|
-
replaced message is gone, it occupies the block's place either way. Without
|
|
471
|
-
the flag the page is exactly what it was, `compacted`
|
|
472
|
-
empty. The v1 → v2 migration baseline records the same thing: the whole
|
|
473
|
-
sequence, with `compacted` naming what had been folded away. A file migrated
|
|
474
|
-
by 0.86.0 has a baseline built from the active history only — the messages
|
|
475
|
-
themselves are still in the store and this read reaches them, but that one
|
|
476
|
-
event cannot be rewritten after the fact.
|
|
477
|
-
|
|
478
|
-
### Retried provider streams
|
|
479
|
-
|
|
480
|
-
With `loop.retry` set, a provider stream that fails before any tool call in the
|
|
481
|
-
attempt is retried at the step boundary. Subscribers see `attempt-reset` for the
|
|
482
|
-
run before the next attempt's first delta and drop what the failed attempt
|
|
483
|
-
streamed; the durable draft is checkpointed after that output is discarded; an
|
|
484
|
-
input injected into the failed attempt is taken again by the retry; and the
|
|
485
|
-
failed attempt's reported usage stays in the run's spend. Transient events —
|
|
486
|
-
deltas, reasoning, `attempt-reset` — are numbered from 1 per run, counting only
|
|
487
|
-
what was published, so a cursor sees no gap on an ordinary stream.
|
|
488
|
-
|
|
489
18
|
### Branch or restore with a new identity
|
|
490
19
|
|
|
491
20
|
Use `store.branchConversation()` to create an independent conversation. `importConversation()`
|
|
@@ -505,6 +34,8 @@ const copy = await sqlite.store.branchConversation({
|
|
|
505
34
|
applicationFiles: [
|
|
506
35
|
{ reference: 'uploads/original/photo.png', destinationReference: 'uploads/new-conversation/photo.png' },
|
|
507
36
|
],
|
|
37
|
+
// Your own data under names the runtime reads as references; `retain` keeps a record of the past.
|
|
38
|
+
applicationKeys: [{ key: 'messageId' }, { key: 'runId', sourceIdentity: 'retain' }],
|
|
508
39
|
})
|
|
509
40
|
|
|
510
41
|
const restored = await sqlite.store.branchConversation({
|
|
@@ -535,7 +66,7 @@ lives in your store, where the runtime can neither copy it nor grant access to i
|
|
|
535
66
|
destination conversation access in your store first, then declare each pair in `applicationFiles`:
|
|
536
67
|
the branch writes your `destinationReference` and never the source address. A file part neither
|
|
537
68
|
spilled nor declared refuses the whole branch with `Branch contains a foreign or missing file
|
|
538
|
-
reference
|
|
69
|
+
reference` (code `application-file-undeclared`), as does a declared reference that is also a spill or a repeated `reference` or
|
|
539
70
|
`destinationReference`. Declare every attachment of the supplied history, including turns after
|
|
540
71
|
`throughRunId`: the complete archive is validated before the prefix is chosen. The declaration is
|
|
541
72
|
part of the request fingerprint, so a retry with the same pairs returns the receipt and different
|
|
@@ -545,10 +76,77 @@ Message metadata, the input and output of your own tools and provider options ar
|
|
|
545
76
|
the branch does not rewrite them. A key in them named like a runtime reference — `reference`,
|
|
546
77
|
`conversationId`, `runId`, `messageId`, `callId`, `toolCallId`, `approvalId`, `operationId`,
|
|
547
78
|
`artifactId` — refuses the branch, because a runtime reference there could be neither rekeyed nor
|
|
548
|
-
safely carried. When such a name is
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
`
|
|
79
|
+
safely carried. When such a name is your data, declare it once in `applicationKeys`, and say what
|
|
80
|
+
a value naming the source conversation means:
|
|
81
|
+
|
|
82
|
+
- `{ key: 'messageId' }` — `sourceIdentity: 'refuse'`, the default. The value is data that never
|
|
83
|
+
names the source, such as a Telegram `messageId` or a CRM `reference`; one that names the source
|
|
84
|
+
conversation, anything it defines or a declared application file refuses the branch.
|
|
85
|
+
- `{ key: 'runId', sourceIdentity: 'retain' }` — the value may be a record of the past: the run
|
|
86
|
+
that took an input, the IDs a read of your own data returned. It crosses byte for byte — the
|
|
87
|
+
provider journal shows the model the same string — and never becomes a reference of the
|
|
88
|
+
destination. Only the source conversation, its runs and its messages may be named so; a value
|
|
89
|
+
naming a spill, an application file, a tool call or any other runtime identity still refuses,
|
|
90
|
+
because what it grants crosses by its own contract.
|
|
91
|
+
|
|
92
|
+
A refusal names the key's path inside the payload (`at intake.runId`), never its value. A key is
|
|
93
|
+
one of the names above, declared once; the order of `applicationKeys` and `applicationFiles` is not
|
|
94
|
+
part of the request. A retained ID is visible to the destination's model: a tool of yours that
|
|
95
|
+
accepts such an ID checks it against the conversation calling the tool, as the runtime's own
|
|
96
|
+
tools do by taking the conversation from the run that calls them.
|
|
97
|
+
|
|
98
|
+
#### Every refusal at once, and a plan before the call
|
|
99
|
+
|
|
100
|
+
A branch reads the whole source before it answers. Everything a declaration or an authorization
|
|
101
|
+
lifts — an undeclared key, a source identity under a key, an undeclared attachment, spills without
|
|
102
|
+
`artifactAuthorization`, an event kind this runtime does not know — is collected, and the branch
|
|
103
|
+
refuses once with `AgentConversationBranchRefusedError`, a `TypeError` whose `refusals` lists them
|
|
104
|
+
all (up to 100; `omittedRefusals` counts the rest). Each refusal has a `code` and its address in
|
|
105
|
+
the source: the event `seq` and `eventKind`, the `messageId`, the `toolName` and the key's `path`,
|
|
106
|
+
never a value; an attachment refusal names the `reference` to declare. A source the branch cannot
|
|
107
|
+
read as what it claims to be stops it at once as one more refusal with code `integrity`, after
|
|
108
|
+
what was collected before it.
|
|
109
|
+
|
|
110
|
+
`store.planConversationBranch(input)` takes the same input, writes nothing and returns
|
|
111
|
+
`{ ready, refusals, omittedRefusals, applicationFiles, undeclaredKeys, fingerprint,
|
|
112
|
+
sourceArchiveDigest }`: the same list the branch would throw, every attachment reference of the
|
|
113
|
+
source that is not a spill — the access to grant before the call — and the keys to declare. Plan,
|
|
114
|
+
grant, declare, then branch; `sourceArchiveDigest` tells you whether the source you planned is the
|
|
115
|
+
one you branch.
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
const plan = await sqlite.store.planConversationBranch(request)
|
|
119
|
+
if (!plan.ready) {
|
|
120
|
+
for (const refusal of plan.refusals)
|
|
121
|
+
log(refusal.code, refusal.seq, refusal.eventKind, refusal.toolName, refusal.path ?? refusal.reference)
|
|
122
|
+
}
|
|
123
|
+
await grantAccess(plan.applicationFiles, request.destinationConversationId)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Identities are all defined before any value is judged, so a value naming a schedule, a child or
|
|
127
|
+
an idempotency key refuses the same whether the source recorded the identity before or after it.
|
|
128
|
+
|
|
129
|
+
Those declarations are for your data only. What the runtime's own capabilities wrote into the
|
|
130
|
+
conversation crosses by its type, with nothing to declare:
|
|
131
|
+
|
|
132
|
+
- **Model invocation ledger** (`invocations`). Its records cross as inert receipts: they keep naming
|
|
133
|
+
the conversation and run that made the call, with who called, the trace, the executing process
|
|
134
|
+
(host name and pid), models, usage and hashes. No ledger reader counts them as invocations of the
|
|
135
|
+
branch. The encrypted payload body is not copied; the receipt keeps the artifact's id, size and
|
|
136
|
+
hash, so `readPayload` on the source conversation still finds it. A branch cut at a run with
|
|
137
|
+
`throughRunId` can hold that run's started record without its finished one: the ledger finishes an
|
|
138
|
+
agent invocation after the run's terminal.
|
|
139
|
+
- **Deferred tool search.** A selection receipt follows the run it was written in, whatever you
|
|
140
|
+
named the search tool. One that names no run of this conversation is your data.
|
|
141
|
+
- **Event search tools.** What `session_search`, `session_trace` and `session_event` were asked and
|
|
142
|
+
answered is a record of what the model read and crosses as it was, including a call the tool
|
|
143
|
+
refused, except that encrypted invocation payload bodies in it are removed. Addresses in it keep
|
|
144
|
+
naming the source; the runtime reads spills, invocation payloads and events only through the
|
|
145
|
+
conversation asking, so in the branch they resolve to nothing. A tool of yours that accepts such
|
|
146
|
+
an address checks it against the conversation calling the tool.
|
|
147
|
+
|
|
148
|
+
A value that only resembles one of these — a receipt with a field of your own, another shape under
|
|
149
|
+
the same tool name — is your data and is judged by `applicationKeys`.
|
|
552
150
|
|
|
553
151
|
The provider journal is the record of what a model was actually sent, and a branch copies it as
|
|
554
152
|
evidence, unrewritten. File bytes are recorded by hash; an address your `resolveFile` returned —
|
|
@@ -577,7 +175,7 @@ schedule row or child relation is cloned. Ordinary companion projections in the
|
|
|
577
175
|
unique names and checkpoints within the supplied journal, then discards their values. They are
|
|
578
176
|
derived application caches, including ones containing source references; their values are never
|
|
579
177
|
replayed as state or copied as authority. Rebuild destination projections with
|
|
580
|
-
`
|
|
178
|
+
`createAgentProjectionStore().advance(...)` over the destination ledger. An exact earlier
|
|
581
179
|
boundary never inherits a later cache value.
|
|
582
180
|
|
|
583
181
|
The store validates the complete archive before writing: contiguous events, a matching runtime
|
|
@@ -608,7 +206,7 @@ observations, not executable checkpoint inputs. `AgentStoreTransitionSchema` des
|
|
|
608
206
|
store mutations. Shape inspection does not replace branch's complete replay/reference validation.
|
|
609
207
|
Schema v4 archives written by 0.109.4 use the same journal representation.
|
|
610
208
|
|
|
611
|
-
Use `defineAgentProjection` with `
|
|
209
|
+
Use `defineAgentProjection` with `createAgentProjectionStore` for a
|
|
612
210
|
deterministic versioned fold. Every value reports `uptoSeq`, so a caller can
|
|
613
211
|
distinguish current data from a projection that still has events to consume.
|
|
614
212
|
Changing the projection version folds from sequence one.
|
|
@@ -637,31 +235,69 @@ await slots.set({
|
|
|
637
235
|
const runtime = createAgentRuntime({ ...config, store: sqlite.store, stateSlots: [goal] })
|
|
638
236
|
```
|
|
639
237
|
|
|
640
|
-
|
|
641
|
-
|
|
238
|
+
Every built-in tool factory below takes the run context `tools()` receives and acts
|
|
239
|
+
for that run's conversation; a context no runtime issued is refused, so the tools
|
|
240
|
+
are built per run:
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
createAgentRuntime({
|
|
244
|
+
...config,
|
|
245
|
+
tools: (run) =>
|
|
246
|
+
mountAgent([], {
|
|
247
|
+
access: { gate: run.toolFenceLifecycle },
|
|
248
|
+
runtimeTools: createAgentStateTools({ state, run }),
|
|
249
|
+
}),
|
|
250
|
+
})
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`createAgentStateTools({ state, run })` binds `create_goal`, `update_goal`,
|
|
254
|
+
`get_goal` and `todo_write` to the conversation of the run it is given. Human changes call the same slot store with
|
|
642
255
|
`actor: 'human'`; they remain structured `state/set` facts rather than forged
|
|
643
256
|
chat messages.
|
|
644
257
|
|
|
645
|
-
`
|
|
646
|
-
its locator, hash and
|
|
258
|
+
`createAgentSpillStore` persists oversized output separately and records
|
|
259
|
+
its locator, hash, lifecycle and the tool call whose output it holds in the ledger. `read_output` and
|
|
647
260
|
`search_output` re-run both locator authorization and the originating tool
|
|
648
261
|
authorization before reading bytes. A reference the store does not hold is a
|
|
649
262
|
refusal like any other — `SPILL_REFERENCE_UNKNOWN` / 404, naming the reference
|
|
650
263
|
and pointing at the one the spilling command returned. The lookup is scoped by
|
|
651
264
|
conversation, so a reference belonging to another conversation is absent rather
|
|
652
|
-
than forbidden, and the refusal cannot tell a model that it exists elsewhere. `
|
|
265
|
+
than forbidden, and the refusal cannot tell a model that it exists elsewhere. The store's `conversationId`
|
|
266
|
+
and `runId` are the host's to name, as `root` is for the coding tools: the store also serves work outside a
|
|
267
|
+
run (retention `cleanup`, reading a branched copy), and the model never names a conversation, only a
|
|
268
|
+
reference. Inside a runtime, create it in `tools()` from the run context it receives —
|
|
269
|
+
`conversationId: runContext.run.conversationId, runId: runContext.run.id`. `createAgentEventSearch` returns the
|
|
653
270
|
exact conversation and event sequence; cross-conversation results are denied
|
|
654
271
|
unless `authorizeConversation` approves each target.
|
|
655
|
-
|
|
656
|
-
|
|
272
|
+
On the Postgres store the search keeps a `tsvector` (`simple`) per event in a
|
|
273
|
+
table of its own and indexes new events when a search needs them, never inside
|
|
274
|
+
`appendEvent`, so an event of any size is stored. It matches as SQLite does —
|
|
275
|
+
every word, in any order; a hyphenated word is found by its parts on both —
|
|
276
|
+
with two differences named in ADR 0315: diacritics are kept unless
|
|
277
|
+
`postgres: { diacritics: 'unaccent' }` (FTS5 removes them; `unaccent` needs the
|
|
278
|
+
extension and refuses without it), and the ranking and snippets come from
|
|
279
|
+
`ts_rank_cd` and `ts_headline` rather than `bm25` and `snippet`. `maxIndexedChars` (65 536) bounds the text indexed per
|
|
280
|
+
event; `maxSyncEvents` (10 000) bounds the indexing one search does — a search
|
|
281
|
+
further behind indexes that many and refuses with how far, and the next
|
|
282
|
+
continues.
|
|
283
|
+
`createAgentEventSearchTools({ run, search, store })` supplies `session_search`,
|
|
284
|
+
`session_trace` and `session_event` over the same bounded APIs, for the
|
|
285
|
+
conversation of the run it is given.
|
|
657
286
|
|
|
658
287
|
For credential-free failure tests, import `createFaultProviderServer` and
|
|
659
288
|
`createReplayAgentProvider` from `stitchkit/agent-runtime/testing`. Runtime
|
|
660
289
|
`loop.retry` applies an explicit `AgentRetryPolicy`: each decision is recorded
|
|
661
290
|
as `retry/scheduled`, each new attempt as `retry/started`, and an attempt that
|
|
662
|
-
has invoked a tool is never automatically replayed.
|
|
663
|
-
|
|
664
|
-
`
|
|
291
|
+
has invoked a tool is never automatically replayed. Its `maxAttempts` is a
|
|
292
|
+
positive safe integer, refused otherwise when the runtime is created and when
|
|
293
|
+
`recordAgentRetryDecision` is given the policy (`TypeError`): `Infinity` would
|
|
294
|
+
retry a paid failure without end, `NaN` or `0` would silently mean never. The
|
|
295
|
+
Postgres store's `maxAttempts` follows the same rule.
|
|
296
|
+
|
|
297
|
+
`createAgentScheduleService` persists `at`, `after` and `every` input. It
|
|
298
|
+
requires `maxActivePerConversation` — the schedules one conversation may hold at
|
|
299
|
+
once, counted in the transaction that inserts — and `minIntervalMs`, the shortest
|
|
300
|
+
repeat; a request past either refuses with the limit in the message. Repeating
|
|
665
301
|
schedules require an explicit IANA time zone. Dispatch uses a stable
|
|
666
302
|
`schedule:<id>:<occurrence>` idempotency key, and restart lateness is recorded.
|
|
667
303
|
Resolve after durable admission; return `{ status: 'retry', reason }` for a
|
|
@@ -686,20 +322,69 @@ can delay newly due work by at most its deadline. The service keeps one nearest-
|
|
|
686
322
|
timer plus per-attempt deadline timers. Storage failures use a bounded recovery timer;
|
|
687
323
|
idle ticks do not write. SQLite v4 migration preserves due times and claims; stop older
|
|
688
324
|
scheduler processes before migration. See [ADR 0202](../decisions/0202-schedule-retries-preserve-occurrence-identity.md).
|
|
689
|
-
`createAgentScheduleTools` exposes the exact `schedule_after`,
|
|
690
|
-
`schedule_every`, `schedule_list` and `schedule_cancel` surface
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
325
|
+
`createAgentScheduleTools({ service, run })` exposes the exact `schedule_after`,
|
|
326
|
+
`schedule_at`, `schedule_every`, `schedule_list` and `schedule_cancel` surface, bound to the
|
|
327
|
+
conversation of the run it is given: the model's input carries no conversation address, and
|
|
328
|
+
the service's limits are the only ones.
|
|
329
|
+
|
|
330
|
+
`createAgentChildManager` seeds a child from the parent's ledger through
|
|
331
|
+
an exact sequence, stores the graph, clamps requested limits to the parent
|
|
332
|
+
remainder `remainingBudget` returns (required; a dimension the model leaves out
|
|
333
|
+
takes it, a budget that names no limit or a spent dimension refuses), refuses a
|
|
334
|
+
child past `maxActiveChildren` (required; counted by the managing process, so two processes managing
|
|
335
|
+
one store each hold their own count) and stops budget overruns at the next step boundary as
|
|
695
336
|
`policy_stop`. That enforcement runs inside the child's own runtime: the host that spawns it gives the child
|
|
696
337
|
`loop.stopPolicies: [agentChildBudgetStopPolicy({ manager, childConversationId })]`, which
|
|
697
|
-
calls `recordStepUsage` at every step boundary; `recordStepUsage` alone measures and decides,
|
|
698
|
-
and reports `enforced: false` when the deciding process holds no handle to stop
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
338
|
+
calls `recordStepUsage` at every step boundary using the resolved model's own `normalizeUsage` hook (the same path as `onStepSpend`, with no separate `cost` callback); `recordStepUsage` alone measures and decides,
|
|
339
|
+
and reports `enforced: false` when the deciding process holds no handle to stop; a budget stop the
|
|
340
|
+
host confirms records the child `stopped`, so it no longer holds a place under `maxActiveChildren`. Given to `createAgentRuntime` as `children`, the manager stops the parent's children after the parent's terminal is durable — interrupted, cancelled, timed out or shut down; a successful, policy-stopped, superseded or failed parent leaves them to the conversation (ADR 0175 carries the table); without `children` nothing cascades; an unreachable child is recorded
|
|
341
|
+
as `lost`, not misreported as a provider failure. Every stop — the cascade, `interruptChild`, the
|
|
342
|
+
cleanup of a spawn whose record failed — is asked of the host within one bound, and stops that meet on
|
|
343
|
+
one child while its host is answering share that one request; a stop it does not
|
|
344
|
+
confirm records `lost` with its `reason` (`stop-timeout`, `stop-failed`, `unreachable`). A spawn is
|
|
345
|
+
visible to the parent's stop from its first line: stopped before the host is asked to start the child,
|
|
346
|
+
`spawnChild` rejects and no child exists; stopped after, the child is stopped as soon as its handle is
|
|
347
|
+
held, and `spawnChild` returns the state that stop recorded. `waitChild` — and so the `subagent` tool —
|
|
348
|
+
resolves once a stop has recorded how the child ended, without waiting for a host that never reports. An
|
|
349
|
+
answer or a message that outlived the bound may still reach the host: until it settles, a second one is
|
|
350
|
+
refused rather than delivered twice, and one the host takes late is recorded when it lands. A message and a blocking answer are asked of
|
|
351
|
+
the host within the same bound: one it does not answer rejects, a blocking request stays pending to
|
|
352
|
+
answer again, and each parent's blocking requests queue on their own, so a silent host holds no other
|
|
353
|
+
parent's. A child
|
|
354
|
+
that finished while being stopped keeps `finished` and its result: a child leaves `spawned` or
|
|
355
|
+
`running` once, and each conversation journals one terminal state for it. `listChildBlocking`
|
|
356
|
+
returns `{ pending, unavailable }`: a live child that does not say in time what it has pending, or
|
|
357
|
+
whose answer fails, is listed in `unavailable`, not read as having nothing pending.
|
|
358
|
+
`createAgentChildTools({ manager, run })` adds `subagent`, `subagent_fork`,
|
|
359
|
+
`list_agents`, `send_message` and `interrupt_agent` for the parent conversation of the run it is given;
|
|
360
|
+
the model's input names no parent, and a child of another parent is refused. Final output stays
|
|
361
|
+
behind its bounded result locator.
|
|
362
|
+
|
|
363
|
+
### Per-step spend hook
|
|
364
|
+
|
|
365
|
+
`createAgentRuntime({ onStepSpend, onStepSpendError, stepSpendTimeoutMs })` delivers one validated
|
|
366
|
+
`AgentStepSpend & AgentRuntimeRunContext<CONTEXT>` fact for every billed model step
|
|
367
|
+
(`phase: 'step'`), billed retried attempt (`phase: 'abandoned-attempt'`), and compaction call
|
|
368
|
+
(`phase: 'compaction'`), after the `provider/response` ledger entry (which now persists `usage` in
|
|
369
|
+
the non-audited ledger too) is written. The same fact feeds `observe` `step-finished` events and run
|
|
370
|
+
totals.
|
|
371
|
+
|
|
372
|
+
`onStepSpend` is awaited up to `stepSpendTimeoutMs` (default `5_000` ms): the run does not start its
|
|
373
|
+
next step, or retry a discarded attempt, until the hook settles, so a slow hook adds its time to
|
|
374
|
+
every step. Because the provider call is already billed, a throw or timeout never fails the run; it
|
|
375
|
+
is isolated and reported to `onStepSpendError` and on the corresponding `step-finished`
|
|
376
|
+
observability event (`spendHookError: { code: 'hook_error' | 'hook_timeout', cause? }`, with `cause`
|
|
377
|
+
redacted unless `includeInternalCause: true`). `onStepSpendError` is awaited up to the same
|
|
378
|
+
`stepSpendTimeoutMs`; if it throws or times out as well, the event carries `reportFailed: true`:
|
|
379
|
+
it is then the only report of the failure.
|
|
380
|
+
|
|
381
|
+
The core intentionally carries no domain billing enum (`payment` / `subscription` / `key`)
|
|
382
|
+
([ADR 0002](../decisions/0002-generic-core.md),
|
|
383
|
+
[ADR 0110](../decisions/0110-a-reconciled-cost-belongs-to-the-application.md)): each
|
|
384
|
+
fact reports `provider: { key, upstream? }`, `usage.cost.provenance` (`provider-reported` vs
|
|
385
|
+
`unavailable`, never fabricated as `0`), and scope via `context` and `trace?.project`, so
|
|
386
|
+
applications attach their own workspace or payment-method rules to provider keys inside
|
|
387
|
+
`onStepSpend`.
|
|
703
388
|
|
|
704
389
|
## Durable order
|
|
705
390
|
|
|
@@ -717,3 +402,267 @@ a successor input into the run already in flight.
|
|
|
717
402
|
```text
|
|
718
403
|
input + queued run → running → execution settled → terminal CAS → successor
|
|
719
404
|
```
|
|
405
|
+
|
|
406
|
+
## What happens to a run when new input arrives
|
|
407
|
+
|
|
408
|
+
`runs.inputPolicy` decides. It takes five values, or a function returning one:
|
|
409
|
+
|
|
410
|
+
| policy | the run in flight | what it already produced |
|
|
411
|
+
|--------|-------------------|--------------------------|
|
|
412
|
+
| `queue` (default) | finishes first | kept |
|
|
413
|
+
| `inject` | continues, and answers the new input too | kept, and built on |
|
|
414
|
+
| `interrupt` | ends | kept, and marked as cut off |
|
|
415
|
+
| `interrupt-next` | ends; this input runs before ordinary queued work | kept, and marked as cut off |
|
|
416
|
+
| `supersede` | ends | discarded from the prompt, kept in the record |
|
|
417
|
+
|
|
418
|
+
`interrupt-next` is the explicit priority path for an urgent input. If A is
|
|
419
|
+
running, ordinary B is queued, and urgent C arrives, the coordinator aborts A,
|
|
420
|
+
waits for A to settle and then runs C before B. B keeps its durable identity and
|
|
421
|
+
eventually runs. Urgent inputs remain FIFO among themselves. They do not
|
|
422
|
+
coalesce into an ordinary pending run: that would erase the priority boundary.
|
|
423
|
+
|
|
424
|
+
`interrupt` and `supersede` differ in exactly one thing, and the question that
|
|
425
|
+
picks between them is **not** "was the run interrupted" but **"did anyone see
|
|
426
|
+
what it produced"**:
|
|
427
|
+
|
|
428
|
+
- The user pressed **stop**. The partial answer was streamed to their screen and
|
|
429
|
+
they read it. It belongs in the conversation — dropping it makes the history
|
|
430
|
+
lie to the model about what the human has seen. That is `interrupt`.
|
|
431
|
+
- A newer message **superseded** the run. Whether the partial reached anyone
|
|
432
|
+
depends on the delivery surface: a token stream shows it as it is produced, a
|
|
433
|
+
surface that sends nothing until the run is done never showed it at all. When
|
|
434
|
+
it reached nobody, it is not part of the conversation. That is `supersede`.
|
|
435
|
+
|
|
436
|
+
**Stitchkit cannot answer that question for you** — delivery belongs to the
|
|
437
|
+
transport, and the runtime sees an abort, not a screen. Hence a declared policy
|
|
438
|
+
(→ ADR 0108), and hence `inputPolicy` accepting a function, so one application
|
|
439
|
+
can hold two surfaces with different rules without the core learning which is
|
|
440
|
+
which:
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
runs: {
|
|
444
|
+
inputPolicy: (input) =>
|
|
445
|
+
protocol.parseContext(input.context).surface === 'operator' ? 'queue' : 'supersede',
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
`input.context` is the **raw** context here — admission runs before the runtime
|
|
450
|
+
parses it, so the callback narrows it itself with the protocol it already has.
|
|
451
|
+
|
|
452
|
+
A superseded run ends with `terminalReason: 'superseded'`, run state
|
|
453
|
+
`'superseded'` and an assistant message of status `'superseded'`. **The record
|
|
454
|
+
is kept** — excluded from the projection, not deleted — so an operator can see
|
|
455
|
+
what was thrown away, and run identity, admission receipts and the terminal CAS
|
|
456
|
+
keep the row they depend on. Compaction leaves it alone for the same reason: a
|
|
457
|
+
turn whose answer is never spoken is not a turn that may be summarised into one,
|
|
458
|
+
because that would both feed the discarded text to the summariser and drop the
|
|
459
|
+
record in `replacedMessageIds`.
|
|
460
|
+
|
|
461
|
+
It is also outside the token budget. `selectAgentHistory` removes it with reason
|
|
462
|
+
`'superseded'` and does not count it, so an abandoned fragment cannot push a
|
|
463
|
+
real turn out of a context it never occupies.
|
|
464
|
+
|
|
465
|
+
### How an interrupted turn reaches the model
|
|
466
|
+
|
|
467
|
+
An interrupted turn is projected, and says so:
|
|
468
|
+
|
|
469
|
+
```text
|
|
470
|
+
{ role: 'assistant', content: [
|
|
471
|
+
{ type: 'text', text: 'We are the team, where would you like' },
|
|
472
|
+
{ type: 'text', text: '[interrupted: this turn was cut off before it finished]' },
|
|
473
|
+
]}
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
`history.interruptedAssistant` chooses the form, and the difference between the
|
|
477
|
+
first two is structural rather than cosmetic. **An assistant turn in provider
|
|
478
|
+
history is a commitment**: the model reads its own previous turn as something it
|
|
479
|
+
said and stays consistent with it. A system line is context.
|
|
480
|
+
|
|
481
|
+
| value | form | right when |
|
|
482
|
+
|-------|------|-----------|
|
|
483
|
+
| `assistant-marked` (default) | assistant turn plus a marker | the human read the text |
|
|
484
|
+
| `system-note` | `[interrupted] partial response: …` as a system line | the fragment reached nobody |
|
|
485
|
+
| `omit` | not projected at all | you want it gone from the request |
|
|
486
|
+
|
|
487
|
+
There is deliberately no value that reproduces what the projection used to do,
|
|
488
|
+
which was to send the partial as an ordinary assistant turn and drop its
|
|
489
|
+
`control` marker on the way. That was the defect, not a behaviour to stay
|
|
490
|
+
compatible with.
|
|
491
|
+
|
|
492
|
+
`projectAgentHistoryDetailed` reports what reached the provider, including part
|
|
493
|
+
types that no projected content stands for:
|
|
494
|
+
|
|
495
|
+
```ts
|
|
496
|
+
const { decisions } = await projectAgentHistoryDetailed(snapshot.messages)
|
|
497
|
+
// → { messageId: 'assistant-2', action: 'projected', reason: 'projected',
|
|
498
|
+
// omittedParts: ['source', 'provider'] }
|
|
499
|
+
// → { messageId: 'assistant-1', action: 'omitted', reason: 'superseded' }
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
`runtime.stop(key, 'supersede')` is the same decision taken by hand: the
|
|
503
|
+
process-local escape hatch chooses the reason, so a caller that knows the answer
|
|
504
|
+
was never delivered can discard it without a newer input arriving.
|
|
505
|
+
|
|
506
|
+
### An input that joins a run in flight
|
|
507
|
+
|
|
508
|
+
`inject` is right when the new input **refines** rather than redirects, and the
|
|
509
|
+
steps already taken are still worth something: *"summarise this thread… actually,
|
|
510
|
+
in bullet points"* should not throw away the reading the first message paid for.
|
|
511
|
+
|
|
512
|
+
What happens:
|
|
513
|
+
|
|
514
|
+
1. The input is admitted exactly like any other — a committed user message and a
|
|
515
|
+
**queued run**, durable before anything else happens.
|
|
516
|
+
2. At the running loop's next step boundary, that input joins its prompt. Only
|
|
517
|
+
that input: an unrelated queued submission is never carried in.
|
|
518
|
+
3. When the run finishes, its terminal commit — **one transaction** — records
|
|
519
|
+
the input as one the run answered and settles the queued successor with
|
|
520
|
+
`terminalReason: 'absorbed'` and `absorbedIntoRunId` naming the run that
|
|
521
|
+
answered it. Every ticket for that successor resolves to the same answer.
|
|
522
|
+
|
|
523
|
+
Nothing durable happens between 1 and 3, and that is the design (→ ADR 0113).
|
|
524
|
+
A run that crashes, is closed, or is interrupted after taking an input on
|
|
525
|
+
commits no absorption at all, so what is left behind is an ordinary queued
|
|
526
|
+
successor — the state every other policy already produces and recovery already
|
|
527
|
+
handles. **There is no ordering in which an accepted input becomes
|
|
528
|
+
unanswerable.** Only a run that *completes* may absorb; an interrupted one took
|
|
529
|
+
the input into its prompt and then stopped, and does not get to say it answered
|
|
530
|
+
it.
|
|
531
|
+
|
|
532
|
+
An absorbed run has **no assistant message of its own** — it produced none, and
|
|
533
|
+
writing an empty one would be a record claiming otherwise. Its answer is
|
|
534
|
+
reachable through `absorbedIntoRunId`, and the store follows that pointer itself
|
|
535
|
+
when a submission arrives on the absorbed run's idempotency key, so a retry
|
|
536
|
+
after a restart returns the answer rather than an empty terminal record.
|
|
537
|
+
|
|
538
|
+
It does publish one more `run-state` event, carrying `'superseded'`. It never
|
|
539
|
+
enters the run executor, so that event is the only thing that tells a delivery
|
|
540
|
+
surface following its `runId` that it is no longer queued.
|
|
541
|
+
|
|
542
|
+
With `coalescePending`, one successor can carry several inputs, and an
|
|
543
|
+
absorption covers a successor **whole or not at all** — a partial one would
|
|
544
|
+
leave a terminal run with inputs nobody answered. Inputs that coalesce before
|
|
545
|
+
the absorbing run's last step boundary join the same absorption. One that
|
|
546
|
+
arrives after it cancels the absorption: the successor then answers all of its
|
|
547
|
+
inputs itself, and the absorbing run has answered one of them too. A duplicate
|
|
548
|
+
answer, never a missing one.
|
|
549
|
+
|
|
550
|
+
(0.63.0 shipped a version of this that committed the absorption at the step
|
|
551
|
+
boundary, before the answer existed, and it was withdrawn in 0.65.0. ADR 0113
|
|
552
|
+
records what that ordering broke.)
|
|
553
|
+
|
|
554
|
+
With `runs.coalescePending: true`, an active lane has at most one queued
|
|
555
|
+
successor. Every later accepted input is atomically appended to that successor;
|
|
556
|
+
its `AgentRun.inputMessageIds` records the whole batch and every input ticket
|
|
557
|
+
resolves to the same terminal run. Coalescing never mutates the active run.
|
|
558
|
+
|
|
559
|
+
`AbortSignal.aborted` is only a cooperation request. A successor does not begin
|
|
560
|
+
while the predecessor still owns managed callbacks. A hung predecessor blocks
|
|
561
|
+
the lane in the first version.
|
|
562
|
+
|
|
563
|
+
Shutdown is two-phase, and both budgets carry the names they carry everywhere
|
|
564
|
+
else in Stitchkit:
|
|
565
|
+
|
|
566
|
+
```ts
|
|
567
|
+
const closed = await runtime.close({ gracePeriodMs: 30_000, forceTimeoutMs: 5_000 })
|
|
568
|
+
if (!closed.settled) {
|
|
569
|
+
console.warn(`exiting with ${closed.remaining} run(s) still in flight`)
|
|
570
|
+
}
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
`close` first rejects new process-local admissions and gives active runs
|
|
574
|
+
`gracePeriodMs` to finish on their own. Only after that budget expires does it
|
|
575
|
+
abort them with reason `shutdown`; `forceTimeoutMs` then bounds the settlement
|
|
576
|
+
wait for a non-cooperative model or tool, measured from the abort — the two
|
|
577
|
+
budgets add up rather than overlapping.
|
|
578
|
+
|
|
579
|
+
**`close()` reports what it achieved rather than promising an outcome it cannot
|
|
580
|
+
reach.** The result is `{ settled, timedOut, remaining }`: `settled` when every
|
|
581
|
+
in-flight run finished, `timedOut` with a `remaining` count when the force
|
|
582
|
+
budget expired first. There is no combination of budgets that is both bounded
|
|
583
|
+
and guaranteed to leave nothing in flight — that is the trade the budgets exist
|
|
584
|
+
to make, and the result is where you read which side of it you got:
|
|
585
|
+
|
|
586
|
+
| budgets | behaviour | can return with a run in flight |
|
|
587
|
+
|---------|-----------|---------------------------------|
|
|
588
|
+
| neither | aborts immediately, waits for settlement | no — unbounded wait |
|
|
589
|
+
| `gracePeriodMs` only | waits, aborts, then waits for settlement | no — unbounded wait |
|
|
590
|
+
| `forceTimeoutMs` only | aborts immediately, waits at most that long | **yes** — `timedOut` |
|
|
591
|
+
| both | waits, aborts, waits at most that long | **yes** — `timedOut` |
|
|
592
|
+
|
|
593
|
+
A caller that wants the old shape still writes `await runtime.close(…)` and
|
|
594
|
+
ignores the result. A caller deciding whether to exit the process reads it.
|
|
595
|
+
Durably queued records rejected from the local queue remain recoverable through
|
|
596
|
+
`scanRecoverable`; close never marks them terminal on its own.
|
|
597
|
+
|
|
598
|
+
Use `await runtime.interrupt({ conversationId, runId })` when the interruption
|
|
599
|
+
must be durable: it first commits `interrupt_requested`, then aborts the local
|
|
600
|
+
coordinator signal. If provider completion races that revision change, the terminal path reloads
|
|
601
|
+
the canonical snapshot. An already-terminal winner settles the ticket directly; a still-owned
|
|
602
|
+
`interrupt_requested` run is committed as `interrupted`, and unrelated aggregate-head conflicts
|
|
603
|
+
remain retriable while the run is active with the same owner and fencing token. A stale owner or
|
|
604
|
+
fencing token remains a conflict. Only the execution that applies the terminal mutation publishes the
|
|
605
|
+
**delivery** `terminal` event — a loser settles from canonical state without republishing the turn,
|
|
606
|
+
and its `AgentRuntimeResult.metrics` is `undefined`. The **operator** `run-terminal` event is not
|
|
607
|
+
gated that way: a losing execution still ran, and still spent whatever it spent, so it reports its
|
|
608
|
+
own usage. The two channels answer to different readers — delivering a turn twice is a user's
|
|
609
|
+
problem, and omitting a run's cost is an operator's.
|
|
610
|
+
`runtime.stop(key)` is the process-local signal-only escape hatch.
|
|
611
|
+
|
|
612
|
+
When an operator has positive evidence that another process owning one known
|
|
613
|
+
run is gone, close that run through the runtime boundary rather than updating
|
|
614
|
+
an adapter table or JSON payload directly:
|
|
615
|
+
|
|
616
|
+
```ts
|
|
617
|
+
await runtime.abandon({
|
|
618
|
+
conversationId,
|
|
619
|
+
runId,
|
|
620
|
+
expectedRevision: run.revision,
|
|
621
|
+
staleOwner: true,
|
|
622
|
+
})
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
The revision protects against stale operator evidence. The mutation updates the
|
|
626
|
+
canonical run and failed assistant atomically, removes the run from recovery
|
|
627
|
+
indexes, and publishes the resulting `run-state`. A run that moved since it was
|
|
628
|
+
read returns a conflict; `staleOwner: true` is mandatory evidence, not a default.
|
|
629
|
+
|
|
630
|
+
The same evidence holds inside one process when a store failure outlives the
|
|
631
|
+
run's own handling. A store call around execution that throws is retried for
|
|
632
|
+
about half a second, then decided by where the run stood. Retries bound a call
|
|
633
|
+
that fails, not one that hangs, so give the store its own timeouts:
|
|
634
|
+
|
|
635
|
+
| Failure | Outcome of `result` |
|
|
636
|
+
|---|---|
|
|
637
|
+
| reading or acquiring the run, retries spent, or a lost reply to the acquisition | resolves with reason `abandoned`, the cause on the operator's `run-terminal` |
|
|
638
|
+
| the first assistant draft | resolves with reason `runtime_failure`, like a checkpoint later in the turn |
|
|
639
|
+
| a conflict on a run another executor holds | rejects with the conflict; the record stays that executor's |
|
|
640
|
+
| a conflict on a run still queued, behind another run | rejects with `AgentRunUnsettledError`; `recover()` or `resume` picks it up |
|
|
641
|
+
| the terminal commit, or closing the run, retries spent | rejects with `AgentRunUnsettledError` |
|
|
642
|
+
|
|
643
|
+
`AgentRunUnsettledError.run` is the record as last read, and the store may be ahead
|
|
644
|
+
of it. Nothing in this process executes that run, and later turns of its
|
|
645
|
+
conversation wait behind it. `recover()` skips a `running` run with a live owner, so
|
|
646
|
+
a long-running process closes it itself once the store answers. Read the record
|
|
647
|
+
first: with no owner or with `error.ownerId` it is this runtime's, and any other
|
|
648
|
+
owner is executing it.
|
|
649
|
+
|
|
650
|
+
```ts
|
|
651
|
+
const settled = await ticket.result.catch(async (error) => {
|
|
652
|
+
if (!(error instanceof AgentRunUnsettledError)) throw error
|
|
653
|
+
const { conversationId, id: runId } = error.run
|
|
654
|
+
const current = await store.loadRun({ conversationId, runId })
|
|
655
|
+
if (current && [undefined, error.ownerId].includes(current.run.ownerId)) {
|
|
656
|
+
await runtime.abandon({
|
|
657
|
+
conversationId,
|
|
658
|
+
runId,
|
|
659
|
+
expectedRevision: current.run.revision,
|
|
660
|
+
staleOwner: true,
|
|
661
|
+
})
|
|
662
|
+
}
|
|
663
|
+
throw error
|
|
664
|
+
})
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
A `queued` run lost to a run ahead of it, and `runtime.resume()` can run it instead
|
|
668
|
+
once that one ends.
|