stitchkit 0.93.0 → 0.94.1
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 +198 -0
- package/README.md +5 -2
- package/dist/agent-runtime/children-control.d.ts +6 -0
- package/dist/agent-runtime/children-control.d.ts.map +1 -0
- package/dist/agent-runtime/children-spawn.d.ts +6 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -0
- package/dist/agent-runtime/children-state.d.ts +46 -0
- package/dist/agent-runtime/children-state.d.ts.map +1 -0
- package/dist/agent-runtime/children-usage.d.ts +8 -0
- package/dist/agent-runtime/children-usage.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +11 -14
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +2 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/contained-darwin.d.ts +38 -0
- package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
- package/dist/agent-runtime/contained-files.d.ts +11 -26
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/contained-scan.d.ts +21 -0
- package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
- package/dist/agent-runtime/contained-write.d.ts +9 -0
- package/dist/agent-runtime/contained-write.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts +4 -3
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/events.d.ts +1 -1
- package/dist/agent-runtime/events.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +0 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +0 -5
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +3 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +1 -1
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter.d.ts +29 -0
- package/dist/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +1 -1
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts +17 -0
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution-state.d.ts +133 -0
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts +17 -33
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts +18 -0
- package/dist/agent-runtime/run-failure.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-attempts.d.ts +6 -0
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -0
- package/dist/agent-runtime/run-prompt-history.d.ts +58 -0
- package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts +26 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +17 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -0
- package/dist/agent-runtime/run-terminal.d.ts +11 -0
- package/dist/agent-runtime/run-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +22 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts +29 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-control.d.ts +9 -0
- package/dist/agent-runtime/runtime-control.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-recovery.d.ts +10 -0
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-state.d.ts +36 -0
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-submit.d.ts +5 -0
- package/dist/agent-runtime/runtime-submit.d.ts.map +1 -0
- package/dist/agent-runtime/runtime.d.ts +10 -5
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +34 -0
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
- package/dist/agent-runtime/schedules.d.ts +34 -0
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-bun.d.ts +12 -0
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-events.d.ts +5 -0
- package/dist/agent-runtime/sqlite-events.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-history.d.ts +7 -0
- package/dist/agent-runtime/sqlite-history.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts +7 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-node.d.ts +12 -0
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-reads.d.ts +14 -0
- package/dist/agent-runtime/sqlite-reads.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-rows.d.ts +178 -0
- package/dist/agent-runtime/sqlite-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-schema.d.ts +7 -0
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts +25 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite.d.ts +10 -6
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts +16 -0
- package/dist/agent-runtime/store-archive.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
- package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +40 -0
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -0
- package/dist/agent-runtime/store-create.d.ts +11 -0
- package/dist/agent-runtime/store-create.d.ts.map +1 -0
- package/dist/agent-runtime/store-driver-contract.d.ts +814 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -0
- package/dist/agent-runtime/store-events.d.ts +7 -89
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +4 -0
- package/dist/agent-runtime/store-memory.d.ts.map +1 -0
- package/dist/agent-runtime/store-mutate.d.ts +13 -0
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -0
- package/dist/agent-runtime/store-purge.d.ts +1 -1
- package/dist/agent-runtime/store-purge.d.ts.map +1 -1
- package/dist/agent-runtime/store-reads.d.ts +29 -0
- package/dist/agent-runtime/store-reads.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-history.d.ts +10 -0
- package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-run.d.ts +14 -0
- package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts +76 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts +6 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-reducer.d.ts +24 -0
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -0
- package/dist/agent-runtime/store-snapshot.d.ts +19 -0
- package/dist/agent-runtime/store-snapshot.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +1 -1
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/application/admission-rate.d.ts +21 -0
- package/dist/application/admission-rate.d.ts.map +1 -0
- package/dist/application/admission-run.d.ts +8 -0
- package/dist/application/admission-run.d.ts.map +1 -0
- package/dist/application/admission.d.ts +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock.d.ts +9 -34
- package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/events.d.ts +1 -1
- package/dist/application/events.d.ts.map +1 -1
- package/dist/application/file-state-store.d.ts +23 -0
- package/dist/application/file-state-store.d.ts.map +1 -0
- package/dist/application/health.d.ts +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts +8 -0
- package/dist/application/kernel-admission.d.ts.map +1 -0
- package/dist/application/kernel-contract.d.ts +142 -0
- package/dist/application/kernel-contract.d.ts.map +1 -0
- package/dist/application/kernel-resource-context.d.ts +24 -0
- package/dist/application/kernel-resource-context.d.ts.map +1 -0
- package/dist/application/kernel-restart.d.ts +5 -0
- package/dist/application/kernel-restart.d.ts.map +1 -0
- package/dist/application/kernel-rollback.d.ts +4 -0
- package/dist/application/kernel-rollback.d.ts.map +1 -0
- package/dist/application/kernel-shutdown.d.ts +6 -0
- package/dist/application/kernel-shutdown.d.ts.map +1 -0
- package/dist/application/kernel-start.d.ts +20 -0
- package/dist/application/kernel-start.d.ts.map +1 -0
- package/dist/application/kernel-state.d.ts +116 -0
- package/dist/application/kernel-state.d.ts.map +1 -0
- package/dist/application/kernel.d.ts +9 -140
- package/dist/application/kernel.d.ts.map +1 -1
- package/dist/application/latest-sink.d.ts +1 -1
- package/dist/application/latest-sink.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/opentelemetry.d.ts +1 -1
- package/dist/application/opentelemetry.d.ts.map +1 -1
- package/dist/application/schedule.d.ts +0 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/watch-hub-core.d.ts +122 -0
- package/dist/application/watch-hub-core.d.ts.map +1 -0
- package/dist/application/watch-hub.d.ts +3 -3
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts +14 -0
- package/dist/browser/client-executors.d.ts.map +1 -0
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-multipart.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/client.d.ts +3 -2
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http-fetch.d.ts +22 -0
- package/dist/browser/http-fetch.d.ts.map +1 -0
- package/dist/browser/http.d.ts +2 -4
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/live-state-core.d.ts +63 -0
- package/dist/browser/live-state-core.d.ts.map +1 -0
- package/dist/browser/live-state.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +26 -0
- package/dist/browser/realtime-client.d.ts.map +1 -0
- package/dist/browser/resumable.d.ts +1 -28
- package/dist/browser/resumable.d.ts.map +1 -1
- package/dist/browser/retained.d.ts.map +1 -0
- package/dist/browser/socket-io-connection.d.ts +82 -0
- package/dist/browser/socket-io-connection.d.ts.map +1 -0
- package/dist/browser/socket-io-peer.d.ts +20 -0
- package/dist/browser/socket-io-peer.d.ts.map +1 -0
- package/dist/browser/socket-io-trace.d.ts +31 -0
- package/dist/browser/socket-io-trace.d.ts.map +1 -0
- package/dist/browser/socket-io.d.ts +24 -18
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +14 -2
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/contract/client-types.d.ts +134 -0
- package/dist/contract/client-types.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +30 -0
- package/dist/contract/define-validation.d.ts.map +1 -0
- package/dist/contract/define.d.ts +47 -394
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +56 -0
- package/dist/contract/normalize.d.ts.map +1 -0
- package/dist/contract/runtime-context.d.ts +131 -0
- package/dist/contract/runtime-context.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +105 -0
- package/dist/contract/tool-options.d.ts.map +1 -0
- package/dist/contract/tool-view.d.ts +148 -0
- package/dist/contract/tool-view.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts.map +1 -0
- package/dist/durability/contract.d.ts +259 -0
- package/dist/durability/contract.d.ts.map +1 -0
- package/dist/durability/effect.d.ts +24 -0
- package/dist/durability/effect.d.ts.map +1 -0
- package/dist/durability/engine.d.ts +14 -0
- package/dist/durability/engine.d.ts.map +1 -0
- package/dist/durability/events.d.ts +103 -0
- package/dist/durability/events.d.ts.map +1 -0
- package/dist/durability/json.d.ts +3 -0
- package/dist/durability/json.d.ts.map +1 -0
- package/dist/durability/ledger.d.ts +27 -0
- package/dist/durability/ledger.d.ts.map +1 -0
- package/dist/durability/parks.d.ts +22 -0
- package/dist/durability/parks.d.ts.map +1 -0
- package/dist/durability/scheduler.d.ts +30 -0
- package/dist/durability/scheduler.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.js +124 -0
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
- package/dist/entrypoints/agent-runtime/harness.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/harness.js +739 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/openrouter.js +270 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sandbox.js +797 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +44 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.js +46 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/testing.js +1116 -0
- package/dist/entrypoints/agent-runtime.d.ts +42 -0
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime.js +2670 -0
- package/dist/entrypoints/application/diagnostic-journal.d.ts +21 -0
- package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
- package/dist/entrypoints/application/diagnostic-journal.js +492 -0
- package/dist/entrypoints/application/grammy.d.ts +2 -0
- package/dist/entrypoints/application/grammy.d.ts.map +1 -0
- package/dist/entrypoints/application/grammy.js +169 -0
- package/dist/entrypoints/application/opentelemetry.d.ts +2 -0
- package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
- package/dist/entrypoints/application/opentelemetry.js +250 -0
- package/dist/entrypoints/application/schemas.d.ts +15 -0
- package/dist/entrypoints/application/schemas.d.ts.map +1 -0
- package/dist/entrypoints/application/schemas.js +27 -0
- package/dist/entrypoints/application.d.ts +23 -0
- package/dist/entrypoints/application.d.ts.map +1 -0
- package/dist/entrypoints/application.js +2016 -0
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
- package/dist/entrypoints/bin/upgrade-cli.js +177 -0
- package/dist/entrypoints/cli.d.ts +44 -0
- package/dist/entrypoints/cli.d.ts.map +1 -0
- package/dist/entrypoints/cli.js +773 -0
- package/dist/entrypoints/contract.d.ts +12 -0
- package/dist/entrypoints/contract.d.ts.map +1 -0
- package/dist/entrypoints/contract.js +64 -0
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -0
- package/dist/entrypoints/declaration.js +183 -0
- package/dist/entrypoints/files.d.ts +5 -0
- package/dist/entrypoints/files.d.ts.map +1 -0
- package/dist/entrypoints/files.js +111 -0
- package/dist/entrypoints/geo.d.ts +3 -0
- package/dist/entrypoints/geo.d.ts.map +1 -0
- package/dist/entrypoints/geo.js +245 -0
- package/dist/entrypoints/google.d.ts +2 -0
- package/dist/entrypoints/google.d.ts.map +1 -0
- package/dist/entrypoints/google.js +175 -0
- package/dist/entrypoints/index.d.ts +17 -0
- package/dist/entrypoints/index.d.ts.map +1 -0
- package/dist/entrypoints/index.js +764 -0
- package/dist/entrypoints/live.d.ts +19 -0
- package/dist/entrypoints/live.d.ts.map +1 -0
- package/dist/entrypoints/live.js +302 -0
- package/dist/entrypoints/node.d.ts +19 -0
- package/dist/entrypoints/node.d.ts.map +1 -0
- package/dist/entrypoints/node.js +308 -0
- package/dist/entrypoints/oauth.d.ts +2 -0
- package/dist/entrypoints/oauth.d.ts.map +1 -0
- package/dist/entrypoints/oauth.js +170 -0
- package/dist/entrypoints/observability.d.ts +19 -0
- package/dist/entrypoints/observability.d.ts.map +1 -0
- package/dist/entrypoints/observability.js +567 -0
- package/dist/entrypoints/primitives.d.ts +3 -0
- package/dist/entrypoints/primitives.d.ts.map +1 -0
- package/dist/entrypoints/primitives.js +749 -0
- package/dist/entrypoints/react.d.ts +5 -0
- package/dist/entrypoints/react.d.ts.map +1 -0
- package/dist/entrypoints/react.js +403 -0
- package/dist/entrypoints/release.d.ts +15 -0
- package/dist/entrypoints/release.d.ts.map +1 -0
- package/dist/entrypoints/release.js +196 -0
- package/dist/entrypoints/remote.d.ts +9 -0
- package/dist/entrypoints/remote.d.ts.map +1 -0
- package/dist/entrypoints/remote.js +66 -0
- package/dist/entrypoints/server.d.ts +39 -0
- package/dist/entrypoints/server.d.ts.map +1 -0
- package/dist/entrypoints/server.js +2009 -0
- package/dist/entrypoints/telegram.d.ts +3 -0
- package/dist/entrypoints/telegram.d.ts.map +1 -0
- package/dist/entrypoints/telegram.js +224 -0
- package/dist/entrypoints/testing.d.ts +10 -0
- package/dist/entrypoints/testing.d.ts.map +1 -0
- package/dist/entrypoints/testing.js +1377 -0
- package/dist/entrypoints/tools/connections.d.ts +19 -0
- package/dist/entrypoints/tools/connections.d.ts.map +1 -0
- package/dist/entrypoints/tools/connections.js +1110 -0
- package/dist/entrypoints/tools/contract.d.ts +29 -0
- package/dist/entrypoints/tools/contract.d.ts.map +1 -0
- package/dist/entrypoints/tools/contract.js +24 -0
- package/dist/entrypoints/tools/invoker.d.ts +9 -0
- package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
- package/dist/entrypoints/tools/invoker.js +20 -0
- package/dist/entrypoints/tools.d.ts +54 -0
- package/dist/entrypoints/tools.d.ts.map +1 -0
- package/dist/entrypoints/tools.js +3009 -0
- package/dist/entrypoints/tracking/server.d.ts +15 -0
- package/dist/entrypoints/tracking/server.d.ts.map +1 -0
- package/dist/entrypoints/tracking.d.ts +24 -0
- package/dist/entrypoints/tracking.d.ts.map +1 -0
- package/dist/entrypoints/tracking.js +1140 -0
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +14 -0
- package/dist/files/file-io.d.ts.map +1 -0
- package/dist/google/google.d.ts.map +1 -0
- package/dist/index-0b1ess5e.js +38 -0
- package/dist/index-1j8pm5t0.js +412 -0
- package/dist/index-1zbbzgfh.js +89 -0
- package/dist/index-2bxbyab0.js +47 -0
- package/dist/index-2gxzjvyr.js +266 -0
- package/dist/index-35mh5bhj.js +177 -0
- package/dist/index-48ffdxgk.js +6 -0
- package/dist/index-4gcnakhx.js +82 -0
- package/dist/index-55hkhm67.js +343 -0
- package/dist/index-79z7m7dt.js +675 -0
- package/dist/index-7f68ghdn.js +3618 -0
- package/dist/index-7p1f0vp2.js +154 -0
- package/dist/index-83bdg97s.js +16 -0
- package/dist/index-863ea9jb.js +154 -0
- package/dist/index-8p52kd5p.js +242 -0
- package/dist/index-d9pk3td4.js +326 -0
- package/dist/index-dce5wxcq.js +63 -0
- package/dist/index-e01r054k.js +105 -0
- package/dist/index-ensd0r74.js +595 -0
- package/dist/index-eqqvgdb3.js +46 -0
- package/dist/index-gxrt5h6v.js +341 -0
- package/dist/index-h6eeys1v.js +211 -0
- package/dist/index-ham5sz8m.js +734 -0
- package/dist/index-het2he5g.js +1387 -0
- package/dist/index-hffjpmq9.js +30 -0
- package/dist/index-hmp4800j.js +51 -0
- package/dist/index-k30h66yd.js +317 -0
- package/dist/index-k5hsfc3j.js +31 -0
- package/dist/index-khtgb21r.js +92 -0
- package/dist/index-m9zn6cpq.js +51 -0
- package/dist/index-ndddxtyx.js +324 -0
- package/dist/index-ngfhvfpd.js +30 -0
- package/dist/index-np4m8hd3.js +1205 -0
- package/dist/index-p3vsv1fb.js +3493 -0
- package/dist/index-p5r7qpdd.js +85 -0
- package/dist/index-p9e0w8hs.js +1084 -0
- package/dist/index-p9sh0xx4.js +64 -0
- package/dist/index-paz6sgdp.js +371 -0
- package/dist/index-px2gm2jp.js +448 -0
- package/dist/index-qwhynv6x.js +103 -0
- package/dist/index-s812ycat.js +65 -0
- package/dist/index-sp1tzwnb.js +281 -0
- package/dist/index-t9rhjr9f.js +2306 -0
- package/dist/index-v260df89.js +342 -0
- package/dist/index-w906953s.js +946 -0
- package/dist/index-wdkt63w3.js +214 -0
- package/dist/index-wqgjfstn.js +18 -0
- package/dist/index-wsm5w4ee.js +1023 -0
- package/dist/index-xw3s75nj.js +100 -0
- package/dist/index-yw4fzmdz.js +268 -0
- package/dist/index-zfrhfn82.js +85 -0
- package/dist/index-znfs20ss.js +98 -0
- package/dist/internal/atomic-file.d.ts +23 -2
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/backoff.d.ts +29 -0
- package/dist/internal/backoff.d.ts.map +1 -0
- package/dist/internal/canonical-json.d.ts +21 -11
- package/dist/internal/canonical-json.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -0
- package/dist/internal/exclusive-lock.d.ts +51 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -0
- package/dist/internal/logger.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +47 -0
- package/dist/internal/process-identity.d.ts.map +1 -0
- package/dist/internal/request.d.ts.map +1 -0
- package/dist/internal/stable-digest.d.ts +0 -43
- package/dist/internal/stable-digest.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +0 -8
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/with-exclusive-lock.d.ts +67 -0
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
- package/dist/internal/zod-issues.d.ts +38 -0
- package/dist/internal/zod-issues.d.ts.map +1 -0
- package/dist/json-schema/dialect.d.ts +17 -0
- package/dist/json-schema/dialect.d.ts.map +1 -0
- package/dist/json-schema/json-schema.d.ts.map +1 -0
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/oauth/authorization-code.d.ts +57 -0
- package/dist/oauth/authorization-code.d.ts.map +1 -0
- package/dist/observability/audit.d.ts +3 -3
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +1 -1
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts +81 -0
- package/dist/observability/bounded-sink.d.ts.map +1 -0
- package/dist/observability/context.d.ts +1 -1
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event.d.ts +2 -1
- package/dist/observability/event.d.ts.map +1 -1
- package/dist/observability/work.d.ts +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/audit.d.ts +1 -1
- package/dist/primitives/audit.d.ts.map +1 -1
- package/dist/primitives/export-operation.d.ts +4 -2
- package/dist/primitives/export-operation.d.ts.map +1 -1
- package/dist/realtime/registry.d.ts +0 -5
- package/dist/realtime/registry.d.ts.map +1 -1
- package/dist/realtime/socket.d.ts +1 -1
- package/dist/realtime/socket.d.ts.map +1 -1
- package/dist/server/bun.d.ts +0 -1
- package/dist/server/bun.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/context.d.ts +2 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +15 -0
- package/dist/server/contract-method.d.ts.map +1 -0
- package/dist/server/contract-stream.d.ts +1 -1
- package/dist/server/contract-stream.d.ts.map +1 -1
- package/dist/server/create.d.ts +8 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts +10 -0
- package/dist/server/endpoint-dispatch.d.ts.map +1 -0
- package/dist/server/endpoint-response.d.ts +19 -0
- package/dist/server/endpoint-response.d.ts.map +1 -0
- package/dist/server/error-dispatch.d.ts +17 -1
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -2
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +44 -0
- package/dist/server/handler-state.d.ts.map +1 -0
- package/dist/server/implement-registry.d.ts +54 -0
- package/dist/server/implement-registry.d.ts.map +1 -0
- package/dist/server/implement.d.ts +9 -55
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/middleware/auth.d.ts +1 -31
- package/dist/server/middleware/auth.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +17 -0
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +31 -0
- package/dist/server/middleware/jwt.d.ts.map +1 -0
- package/dist/server/middleware/trust-fence.d.ts +1 -1
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart-reader.d.ts +22 -0
- package/dist/server/multipart-reader.d.ts.map +1 -0
- package/dist/server/multipart.d.ts +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts +88 -0
- package/dist/server/oauth/cimd.d.ts.map +1 -0
- package/dist/server/oauth/endpoints.d.ts +39 -0
- package/dist/server/oauth/endpoints.d.ts.map +1 -0
- package/dist/server/oauth/metadata.d.ts +28 -0
- package/dist/server/oauth/metadata.d.ts.map +1 -0
- package/dist/server/oauth/provider.d.ts +117 -0
- package/dist/server/oauth/provider.d.ts.map +1 -0
- package/dist/server/realtime.d.ts +1 -1
- package/dist/server/realtime.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +16 -0
- package/dist/server/request-completion.d.ts.map +1 -0
- package/dist/server/response-metadata.d.ts +1 -1
- package/dist/server/response-metadata.d.ts.map +1 -1
- package/dist/server/route-table.d.ts +9 -0
- package/dist/server/route-table.d.ts.map +1 -0
- package/dist/server/stream.d.ts +0 -13
- package/dist/server/stream.d.ts.map +1 -1
- package/dist/server/streaming-pump.d.ts +66 -0
- package/dist/server/streaming-pump.d.ts.map +1 -0
- package/dist/server/streaming-route.d.ts +12 -5
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -4
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client-http1.d.ts +76 -0
- package/dist/server/unix-client-http1.d.ts.map +1 -0
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/testing/handler-clients.d.ts +32 -0
- package/dist/testing/handler-clients.d.ts.map +1 -0
- package/dist/testing/managed-resource-conformance-scenarios.d.ts.map +1 -1
- package/dist/testing/realtime-probe.d.ts +33 -0
- package/dist/testing/realtime-probe.d.ts.map +1 -0
- package/dist/testing/surface-conformance.d.ts +2 -32
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +44 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
- package/dist/testing/surface-manifest.d.ts +30 -4
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-fields.d.ts +31 -0
- package/dist/tools/cli/args-fields.d.ts.map +1 -0
- package/dist/tools/cli/args-route.d.ts +42 -0
- package/dist/tools/cli/args-route.d.ts.map +1 -0
- package/dist/tools/cli/args-view.d.ts +32 -0
- package/dist/tools/cli/args-view.d.ts.map +1 -0
- package/dist/tools/cli/args.d.ts +80 -0
- package/dist/tools/cli/args.d.ts.map +1 -0
- package/dist/tools/cli/argument-error.d.ts +5 -0
- package/dist/tools/cli/argument-error.d.ts.map +1 -0
- package/dist/tools/cli/checkpoint.d.ts +24 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -0
- package/dist/tools/cli/command.d.ts +70 -0
- package/dist/tools/cli/command.d.ts.map +1 -0
- package/dist/tools/cli/config.d.ts +90 -0
- package/dist/tools/cli/config.d.ts.map +1 -0
- package/dist/tools/cli/create-cli.d.ts +36 -0
- package/dist/tools/cli/create-cli.d.ts.map +1 -0
- package/dist/tools/cli/download.d.ts +8 -0
- package/dist/tools/cli/download.d.ts.map +1 -0
- package/dist/tools/cli/format.d.ts +50 -0
- package/dist/tools/cli/format.d.ts.map +1 -0
- package/dist/tools/cli/help.d.ts +24 -0
- package/dist/tools/cli/help.d.ts.map +1 -0
- package/dist/tools/cli/installer.d.ts +34 -0
- package/dist/tools/cli/installer.d.ts.map +1 -0
- package/dist/tools/cli/invoke.d.ts +144 -0
- package/dist/tools/cli/invoke.d.ts.map +1 -0
- package/dist/tools/cli/io.d.ts +10 -0
- package/dist/tools/cli/io.d.ts.map +1 -0
- package/dist/tools/cli/managed-surface.d.ts +30 -0
- package/dist/tools/cli/managed-surface.d.ts.map +1 -0
- package/dist/tools/cli/manifest.d.ts +80 -0
- package/dist/tools/cli/manifest.d.ts.map +1 -0
- package/dist/tools/cli/policy.d.ts +27 -0
- package/dist/tools/cli/policy.d.ts.map +1 -0
- package/dist/tools/cli/prepare.d.ts +14 -0
- package/dist/tools/cli/prepare.d.ts.map +1 -0
- package/dist/tools/cli/profile.d.ts +40 -0
- package/dist/tools/cli/profile.d.ts.map +1 -0
- package/dist/tools/cli/run-managed.d.ts +5 -0
- package/dist/tools/cli/run-managed.d.ts.map +1 -0
- package/dist/tools/cli/run-native.d.ts +9 -0
- package/dist/tools/cli/run-native.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +40 -0
- package/dist/tools/cli/session.d.ts.map +1 -0
- package/dist/tools/cli/signature.d.ts +81 -0
- package/dist/tools/cli/signature.d.ts.map +1 -0
- package/dist/tools/cli/stream.d.ts +93 -0
- package/dist/tools/cli/stream.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts +145 -0
- package/dist/tools/cli/update.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts +12 -0
- package/dist/tools/cli/view.d.ts.map +1 -0
- package/dist/tools/cli/wait.d.ts +54 -0
- package/dist/tools/cli/wait.d.ts.map +1 -0
- package/dist/tools/connections/runtime.d.ts +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +3 -3
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/durability-context.d.ts +1 -1
- package/dist/tools/durability-context.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts +23 -0
- package/dist/tools/execute-args.d.ts.map +1 -0
- package/dist/tools/execute-hooks.d.ts +146 -0
- package/dist/tools/execute-hooks.d.ts.map +1 -0
- package/dist/tools/execute-result.d.ts +40 -0
- package/dist/tools/execute-result.d.ts.map +1 -0
- package/dist/tools/execute.d.ts +31 -193
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +9 -6
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/internal/tool-view.d.ts +41 -0
- package/dist/tools/internal/tool-view.d.ts.map +1 -0
- package/dist/tools/invoker.d.ts +13 -4
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +1 -1
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +3 -3
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -2
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/app.d.ts +62 -0
- package/dist/tools/mcp/app.d.ts.map +1 -0
- package/dist/tools/mcp/catalog.d.ts +68 -0
- package/dist/tools/mcp/catalog.d.ts.map +1 -0
- package/dist/tools/mcp/handler.d.ts +46 -0
- package/dist/tools/mcp/handler.d.ts.map +1 -0
- package/dist/tools/mcp/mount.d.ts +152 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -0
- package/dist/tools/mcp/prepare.d.ts +76 -0
- package/dist/tools/mcp/prepare.d.ts.map +1 -0
- package/dist/tools/mcp/progress.d.ts +46 -0
- package/dist/tools/mcp/progress.d.ts.map +1 -0
- package/dist/tools/mcp/register.d.ts +36 -0
- package/dist/tools/mcp/register.d.ts.map +1 -0
- package/dist/tools/mcp/round-context.d.ts +38 -0
- package/dist/tools/mcp/round-context.d.ts.map +1 -0
- package/dist/tools/mcp/round-policy.d.ts +33 -0
- package/dist/tools/mcp/round-policy.d.ts.map +1 -0
- package/dist/tools/mcp/round.d.ts +53 -0
- package/dist/tools/mcp/round.d.ts.map +1 -0
- package/dist/tools/mcp/runtime-tools.d.ts +25 -0
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
- package/dist/tools/mcp/stdio-signals.d.ts +33 -0
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
- package/dist/tools/mcp/stdio.d.ts +20 -0
- package/dist/tools/mcp/stdio.d.ts.map +1 -0
- package/dist/tools/mcp/trace.d.ts +12 -0
- package/dist/tools/mcp/trace.d.ts.map +1 -0
- package/dist/tools/mount.d.ts +14 -7
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +4 -3
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-binding-types.d.ts +127 -0
- package/dist/tools/operations/async-operation-binding-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-binding.d.ts +28 -0
- package/dist/tools/operations/async-operation-binding.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts +110 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical.d.ts +7 -0
- package/dist/tools/operations/async-operation-canonical.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-contract.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-id.d.ts +23 -0
- package/dist/tools/operations/async-operation-id.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +41 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts +69 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime.d.ts +5 -0
- package/dist/tools/operations/async-operation-runtime.d.ts.map +1 -0
- package/dist/tools/operations/define-wait-tool.d.ts +22 -0
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -0
- package/dist/tools/operations/mount-wait.d.ts.map +1 -0
- package/dist/tools/operations/wait-core.d.ts.map +1 -0
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +13 -4
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -0
- package/dist/tools/schema/flatten-join.d.ts.map +1 -0
- package/dist/tools/schema/flatten.d.ts.map +1 -0
- package/dist/tools/schema/portable-formats.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +24 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -0
- package/dist/tools/schema/schema.d.ts.map +1 -0
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -0
- package/dist/tools/surface.d.ts +2 -3
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/tool-logger.d.ts +1 -1
- package/dist/tools/tool-logger.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +4 -4
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts +18 -0
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
- package/dist/tools/transfer/define-upload-tool.d.ts +16 -0
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
- package/dist/tools/transfer/define-view-file-tool.d.ts +10 -0
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
- package/dist/tools/transfer/download-core.d.ts +20 -0
- package/dist/tools/transfer/download-core.d.ts.map +1 -0
- package/dist/tools/transfer/managed-file-error.d.ts +6 -0
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
- package/dist/tools/transfer/mount-download.d.ts +41 -0
- package/dist/tools/transfer/mount-download.d.ts.map +1 -0
- package/dist/tools/transfer/mount-upload.d.ts +21 -0
- package/dist/tools/transfer/mount-upload.d.ts.map +1 -0
- package/dist/tools/transfer/native-result.d.ts.map +1 -0
- package/dist/tools/transfer/upload-core.d.ts +4 -0
- package/dist/tools/transfer/upload-core.d.ts.map +1 -0
- package/dist/tools/transfer/view-file-contract.d.ts.map +1 -0
- package/dist/tools/transfer/view-file.d.ts +62 -0
- package/dist/tools/transfer/view-file.d.ts.map +1 -0
- package/dist/tools/transports.d.ts +1 -1
- package/dist/tools/transports.d.ts.map +1 -1
- package/dist/tracking/client-listeners.d.ts +30 -0
- package/dist/tracking/client-listeners.d.ts.map +1 -0
- package/dist/tracking/client-visit.d.ts +61 -0
- package/dist/tracking/client-visit.d.ts.map +1 -0
- package/dist/tracking/client.d.ts +3 -2
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/contract.d.ts +1 -1
- package/dist/tracking/contract.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +33 -0
- package/llms/agent-runtime-coding-tools.txt +58 -0
- package/llms/agent-runtime-harness.txt +45 -0
- package/llms/agent-runtime-openrouter.txt +22 -0
- package/llms/agent-runtime-sandbox.txt +159 -0
- package/llms/agent-runtime-sqlite-bun.txt +29 -0
- package/llms/agent-runtime-sqlite-node.txt +26 -0
- package/llms/agent-runtime-testing.txt +30 -0
- package/llms/agent-runtime.2.txt +550 -0
- package/llms/agent-runtime.3.txt +311 -0
- package/llms/agent-runtime.txt +893 -0
- package/llms/application-diagnostic-journal.txt +30 -0
- package/llms/application-grammy.txt +27 -0
- package/llms/application-opentelemetry.txt +27 -0
- package/llms/application-schemas.txt +42 -0
- package/llms/application.2.txt +487 -0
- package/llms/application.txt +886 -0
- package/llms/cli.2.txt +80 -0
- package/llms/cli.txt +948 -0
- package/llms/contract.txt +606 -0
- package/llms/declaration.txt +286 -0
- package/llms/files.txt +33 -0
- package/llms/geo.txt +114 -0
- package/llms/google.txt +27 -0
- package/llms/live.txt +471 -0
- package/llms/node.txt +43 -0
- package/llms/oauth.txt +136 -0
- package/llms/observability.txt +893 -0
- package/llms/primitives.txt +158 -0
- package/llms/react.txt +184 -0
- package/llms/release.txt +176 -0
- package/llms/remote.txt +25 -0
- package/llms/server.2.txt +361 -0
- package/llms/server.3.txt +1031 -0
- package/llms/server.4.txt +905 -0
- package/llms/server.5.txt +250 -0
- package/llms/server.txt +996 -0
- package/llms/stitchkit.2.txt +836 -0
- package/llms/stitchkit.3.txt +147 -0
- package/llms/stitchkit.txt +260 -0
- package/llms/telegram.txt +30 -0
- package/llms/testing.txt +676 -0
- package/llms/tools-connections.txt +45 -0
- package/llms/tools-contract.txt +9 -0
- package/llms/tools-invoker.txt +9 -0
- package/llms/tools.2.txt +647 -0
- package/llms/tools.3.txt +288 -0
- package/llms/tools.txt +966 -0
- package/llms/tracking-server.txt +32 -0
- package/llms/tracking.txt +263 -0
- package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
- package/llms/upgrading-0.53.0-0.67.0.txt +1174 -0
- package/llms/upgrading-0.68.0-0.94.0.txt +1159 -0
- package/llms/upgrading.txt +215 -0
- package/llms-full.txt +312 -77
- package/llms.txt +54 -5
- package/package.json +84 -83
- package/dist/agent-runtime/durability-contract.d.ts +0 -176
- package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
- package/dist/agent-runtime/durability-json.d.ts +0 -3
- package/dist/agent-runtime/durability-json.d.ts.map +0 -1
- package/dist/agent-runtime/durability-ledger.d.ts +0 -16
- package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/durability-scheduler.d.ts +0 -29
- package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
- package/dist/agent-runtime/durability.d.ts +0 -14
- package/dist/agent-runtime/durability.d.ts.map +0 -1
- package/dist/agent-runtime/store-driver.d.ts +0 -814
- package/dist/agent-runtime/store-driver.d.ts.map +0 -1
- package/dist/agent-runtime-browser.d.ts +0 -5
- package/dist/agent-runtime-browser.d.ts.map +0 -1
- package/dist/agent-runtime-browser.js +0 -124
- package/dist/agent-runtime-coding-tools.d.ts +0 -2
- package/dist/agent-runtime-coding-tools.d.ts.map +0 -1
- package/dist/agent-runtime-coding-tools.js +0 -23
- package/dist/agent-runtime-harness.d.ts +0 -2
- package/dist/agent-runtime-harness.d.ts.map +0 -1
- package/dist/agent-runtime-harness.js +0 -729
- package/dist/agent-runtime-openrouter.d.ts +0 -29
- package/dist/agent-runtime-openrouter.d.ts.map +0 -1
- package/dist/agent-runtime-openrouter.js +0 -270
- package/dist/agent-runtime-sandbox.d.ts +0 -5
- package/dist/agent-runtime-sandbox.d.ts.map +0 -1
- package/dist/agent-runtime-sandbox.js +0 -798
- package/dist/agent-runtime-sqlite-bun.d.ts +0 -11
- package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-bun.js +0 -42
- package/dist/agent-runtime-sqlite-node.d.ts +0 -11
- package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-node.js +0 -44
- package/dist/agent-runtime-testing.d.ts +0 -3
- package/dist/agent-runtime-testing.d.ts.map +0 -1
- package/dist/agent-runtime-testing.js +0 -156
- package/dist/agent-runtime.d.ts +0 -38
- package/dist/agent-runtime.d.ts.map +0 -1
- package/dist/agent-runtime.js +0 -2607
- package/dist/application/channel.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.d.ts +0 -21
- package/dist/application-diagnostic-journal.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.js +0 -632
- package/dist/application-grammy.d.ts +0 -2
- package/dist/application-grammy.d.ts.map +0 -1
- package/dist/application-grammy.js +0 -169
- package/dist/application-opentelemetry.d.ts +0 -2
- package/dist/application-opentelemetry.d.ts.map +0 -1
- package/dist/application-opentelemetry.js +0 -250
- package/dist/application-schemas.d.ts +0 -15
- package/dist/application-schemas.d.ts.map +0 -1
- package/dist/application-schemas.js +0 -27
- package/dist/application.d.ts +0 -22
- package/dist/application.d.ts.map +0 -1
- package/dist/application.js +0 -1977
- package/dist/cli.d.ts +0 -41
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -753
- package/dist/contract/index.d.ts +0 -8
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/contract/index.js +0 -55
- package/dist/declaration.d.ts.map +0 -1
- package/dist/declaration.js +0 -183
- package/dist/files.d.ts +0 -3
- package/dist/files.d.ts.map +0 -1
- package/dist/files.js +0 -15
- package/dist/geo.d.ts +0 -3
- package/dist/geo.d.ts.map +0 -1
- package/dist/geo.js +0 -245
- package/dist/google.d.ts.map +0 -1
- package/dist/google.js +0 -175
- package/dist/index-0a349c33.js +0 -470
- package/dist/index-0j3vcp5m.js +0 -28
- package/dist/index-2c2bjw3s.js +0 -51
- package/dist/index-2na0qrfn.js +0 -214
- package/dist/index-2qzskm8h.js +0 -63
- package/dist/index-3bmnp41g.js +0 -2169
- package/dist/index-3xwxfj4z.js +0 -334
- package/dist/index-4fpa9dy2.js +0 -51
- package/dist/index-6kyksz9y.js +0 -268
- package/dist/index-77fekveh.js +0 -44
- package/dist/index-7gnkny4z.js +0 -326
- package/dist/index-7zbps32p.js +0 -89
- package/dist/index-9f8ztey6.js +0 -588
- package/dist/index-a11g2kry.js +0 -866
- package/dist/index-a916km3r.js +0 -45
- package/dist/index-actkayzn.js +0 -367
- package/dist/index-bn2cjajt.js +0 -524
- package/dist/index-bx75zwt7.js +0 -63
- package/dist/index-cby4ar3v.js +0 -46
- package/dist/index-cnyk6te3.js +0 -77
- package/dist/index-cxqhvq21.js +0 -413
- package/dist/index-e0znv5gn.js +0 -176
- package/dist/index-e42wzzz5.js +0 -154
- package/dist/index-f477k430.js +0 -324
- package/dist/index-f9mb610r.js +0 -177
- package/dist/index-fadnxwna.js +0 -1046
- package/dist/index-fq77yfzc.js +0 -1303
- package/dist/index-h9etkkyk.js +0 -1126
- package/dist/index-hrbajay7.js +0 -1196
- package/dist/index-kw9t5ayn.js +0 -507
- package/dist/index-mzvgxp0n.js +0 -80
- package/dist/index-n0f51dfn.js +0 -3170
- package/dist/index-p13mwz16.js +0 -16
- package/dist/index-s8cnx02s.js +0 -90
- package/dist/index-sr93cwf9.js +0 -325
- package/dist/index-tmwcrptx.js +0 -85
- package/dist/index-v5573g1k.js +0 -142
- package/dist/index-vjpvjqpn.js +0 -86
- package/dist/index-vk3kq9sb.js +0 -3344
- package/dist/index-wc4x00bn.js +0 -103
- package/dist/index-wnfk50r0.js +0 -211
- package/dist/index-yewwh1w4.js +0 -647
- package/dist/index-yn8remb1.js +0 -290
- package/dist/index-ywd0y6m1.js +0 -394
- package/dist/index-zwkgfq1s.js +0 -345
- package/dist/index.d.ts +0 -14
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -632
- package/dist/internal/errors.d.ts +0 -92
- package/dist/internal/errors.d.ts.map +0 -1
- package/dist/internal/observability-sink.d.ts +0 -81
- package/dist/internal/observability-sink.d.ts.map +0 -1
- package/dist/live.d.ts +0 -19
- package/dist/live.d.ts.map +0 -1
- package/dist/live.js +0 -282
- package/dist/logger.d.ts.map +0 -1
- package/dist/node.d.ts +0 -18
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -303
- package/dist/oauth.d.ts +0 -57
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -170
- package/dist/observability/index.d.ts +0 -19
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/observability/index.js +0 -569
- package/dist/primitives.d.ts +0 -3
- package/dist/primitives.d.ts.map +0 -1
- package/dist/primitives.js +0 -754
- package/dist/react.d.ts +0 -5
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -403
- package/dist/release.d.ts +0 -15
- package/dist/release.d.ts.map +0 -1
- package/dist/release.js +0 -196
- package/dist/remote.d.ts +0 -9
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -88
- package/dist/retained.d.ts.map +0 -1
- package/dist/server/file-state-store.d.ts +0 -23
- package/dist/server/file-state-store.d.ts.map +0 -1
- package/dist/server/index.d.ts +0 -36
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -1745
- package/dist/server/request.d.ts.map +0 -1
- package/dist/telegram.d.ts +0 -3
- package/dist/telegram.d.ts.map +0 -1
- package/dist/telegram.js +0 -224
- package/dist/testing/agent-store-conformance.d.ts +0 -40
- package/dist/testing/agent-store-conformance.d.ts.map +0 -1
- package/dist/testing.d.ts +0 -39
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -2209
- package/dist/tool-invoker.d.ts +0 -9
- package/dist/tool-invoker.d.ts.map +0 -1
- package/dist/tool-invoker.js +0 -21
- package/dist/tools/async-operation-contract.d.ts.map +0 -1
- package/dist/tools/async-operation.d.ts +0 -332
- package/dist/tools/async-operation.d.ts.map +0 -1
- package/dist/tools/cli-args.d.ts +0 -143
- package/dist/tools/cli-args.d.ts.map +0 -1
- package/dist/tools/cli-checkpoint.d.ts +0 -24
- package/dist/tools/cli-checkpoint.d.ts.map +0 -1
- package/dist/tools/cli-command.d.ts +0 -70
- package/dist/tools/cli-command.d.ts.map +0 -1
- package/dist/tools/cli-format.d.ts +0 -49
- package/dist/tools/cli-format.d.ts.map +0 -1
- package/dist/tools/cli-installer.d.ts +0 -34
- package/dist/tools/cli-installer.d.ts.map +0 -1
- package/dist/tools/cli-invoke.d.ts +0 -143
- package/dist/tools/cli-invoke.d.ts.map +0 -1
- package/dist/tools/cli-manifest.d.ts +0 -80
- package/dist/tools/cli-manifest.d.ts.map +0 -1
- package/dist/tools/cli-policy.d.ts +0 -27
- package/dist/tools/cli-policy.d.ts.map +0 -1
- package/dist/tools/cli-profile.d.ts +0 -40
- package/dist/tools/cli-profile.d.ts.map +0 -1
- package/dist/tools/cli-signature.d.ts +0 -81
- package/dist/tools/cli-signature.d.ts.map +0 -1
- package/dist/tools/cli-stream.d.ts +0 -93
- package/dist/tools/cli-stream.d.ts.map +0 -1
- package/dist/tools/cli-update.d.ts +0 -126
- package/dist/tools/cli-update.d.ts.map +0 -1
- package/dist/tools/cli-view.d.ts +0 -12
- package/dist/tools/cli-view.d.ts.map +0 -1
- package/dist/tools/cli-wait.d.ts +0 -54
- package/dist/tools/cli-wait.d.ts.map +0 -1
- package/dist/tools/cli.d.ts +0 -94
- package/dist/tools/cli.d.ts.map +0 -1
- package/dist/tools/coerce.d.ts.map +0 -1
- package/dist/tools/connections/index.d.ts +0 -20
- package/dist/tools/connections/index.d.ts.map +0 -1
- package/dist/tools/connections/index.js +0 -1107
- package/dist/tools/define-download-tool.d.ts +0 -18
- package/dist/tools/define-download-tool.d.ts.map +0 -1
- package/dist/tools/define-upload-tool.d.ts +0 -16
- package/dist/tools/define-upload-tool.d.ts.map +0 -1
- package/dist/tools/define-view-file-tool.d.ts +0 -10
- package/dist/tools/define-view-file-tool.d.ts.map +0 -1
- package/dist/tools/define-wait-tool.d.ts +0 -22
- package/dist/tools/define-wait-tool.d.ts.map +0 -1
- package/dist/tools/download-core.d.ts +0 -20
- package/dist/tools/download-core.d.ts.map +0 -1
- package/dist/tools/flatten-join.d.ts.map +0 -1
- package/dist/tools/flatten.d.ts.map +0 -1
- package/dist/tools/json-schema-dialect.d.ts +0 -17
- package/dist/tools/json-schema-dialect.d.ts.map +0 -1
- package/dist/tools/json-schema.d.ts.map +0 -1
- package/dist/tools/managed-file-error.d.ts +0 -6
- package/dist/tools/managed-file-error.d.ts.map +0 -1
- package/dist/tools/mcp-app.d.ts +0 -62
- package/dist/tools/mcp-app.d.ts.map +0 -1
- package/dist/tools/mcp-catalog.d.ts +0 -68
- package/dist/tools/mcp-catalog.d.ts.map +0 -1
- package/dist/tools/mcp-handler.d.ts +0 -46
- package/dist/tools/mcp-handler.d.ts.map +0 -1
- package/dist/tools/mcp-prepare.d.ts +0 -75
- package/dist/tools/mcp-prepare.d.ts.map +0 -1
- package/dist/tools/mcp-progress.d.ts +0 -46
- package/dist/tools/mcp-progress.d.ts.map +0 -1
- package/dist/tools/mcp-round-policy.d.ts +0 -33
- package/dist/tools/mcp-round-policy.d.ts.map +0 -1
- package/dist/tools/mcp-round.d.ts +0 -61
- package/dist/tools/mcp-round.d.ts.map +0 -1
- package/dist/tools/mcp-stdio-signals.d.ts +0 -33
- package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
- package/dist/tools/mcp-stdio.d.ts +0 -20
- package/dist/tools/mcp-stdio.d.ts.map +0 -1
- package/dist/tools/mcp-trace.d.ts +0 -12
- package/dist/tools/mcp-trace.d.ts.map +0 -1
- package/dist/tools/mcp.d.ts +0 -152
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mount-download.d.ts +0 -41
- package/dist/tools/mount-download.d.ts.map +0 -1
- package/dist/tools/mount-upload.d.ts +0 -21
- package/dist/tools/mount-upload.d.ts.map +0 -1
- package/dist/tools/mount-wait.d.ts.map +0 -1
- package/dist/tools/native-mcp.d.ts +0 -20
- package/dist/tools/native-mcp.d.ts.map +0 -1
- package/dist/tools/native-result.d.ts.map +0 -1
- package/dist/tools/oauth-metadata.d.ts +0 -28
- package/dist/tools/oauth-metadata.d.ts.map +0 -1
- package/dist/tools/oauth-provider.d.ts +0 -184
- package/dist/tools/oauth-provider.d.ts.map +0 -1
- package/dist/tools/portable-formats.d.ts.map +0 -1
- package/dist/tools/presentation.d.ts +0 -22
- package/dist/tools/presentation.d.ts.map +0 -1
- package/dist/tools/schema.d.ts.map +0 -1
- package/dist/tools/untyped-properties.d.ts.map +0 -1
- package/dist/tools/upload-core.d.ts +0 -4
- package/dist/tools/upload-core.d.ts.map +0 -1
- package/dist/tools/view-file-contract.d.ts.map +0 -1
- package/dist/tools/view-file.d.ts +0 -62
- package/dist/tools/view-file.d.ts.map +0 -1
- package/dist/tools/wait-core.d.ts.map +0 -1
- package/dist/tools-contract.d.ts +0 -29
- package/dist/tools-contract.d.ts.map +0 -1
- package/dist/tools-contract.js +0 -24
- package/dist/tools.d.ts +0 -50
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -2930
- package/dist/tracking-server.d.ts +0 -15
- package/dist/tracking-server.d.ts.map +0 -1
- package/dist/tracking.d.ts +0 -24
- package/dist/tracking.d.ts.map +0 -1
- package/dist/tracking.js +0 -1092
- package/dist/upgrade-cli.d.ts.map +0 -1
- package/dist/upgrade-cli.js +0 -177
- /package/dist/{retained.d.ts → browser/retained.d.ts} +0 -0
- /package/dist/{declaration.d.ts → declaration/declaration.d.ts} +0 -0
- /package/dist/{upgrade-cli.d.ts → entrypoints/bin/upgrade-cli.d.ts} +0 -0
- /package/dist/{tracking-server.js → entrypoints/tracking/server.js} +0 -0
- /package/dist/{google.d.ts → google/google.d.ts} +0 -0
- /package/dist/{index-pq95qkbf.js → index-5jm36zv1.js} +0 -0
- /package/dist/{application → internal}/channel.d.ts +0 -0
- /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
- /package/dist/{server → internal}/request.d.ts +0 -0
- /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
- /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
- /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
- /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
- /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
- /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
- /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
- /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
- /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
- /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
- /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
- /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { TransportSource } from './define.js';
|
|
2
|
+
/**
|
|
3
|
+
* Shallow-merge a contract-wide `meta` default with an endpoint's own — endpoint
|
|
4
|
+
* keys win. Returns `undefined` when neither side declares anything, because
|
|
5
|
+
* readers test `method.meta?.x` and an empty object would read as "declared".
|
|
6
|
+
* One level deep by design: a deep merge invites "how do I unset an inherited
|
|
7
|
+
* key", which has no answer without a sentinel. → ADR 0036.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mergeMeta(contractMeta: Record<string, unknown> | undefined, endpointMeta: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
10
|
+
/** Self-reported MCP host identity. Attribution only — never an auth principal. */
|
|
11
|
+
export interface McpClientInfo {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
/** Outcome of one opt-in MCP multi-round input attempt. */
|
|
16
|
+
export type McpRoundOutcome = 'input_required' | 'declined' | 'cancelled' | 'invalid' | 'complete';
|
|
17
|
+
/**
|
|
18
|
+
* Validated metadata for the active managed MCP tool call.
|
|
19
|
+
*
|
|
20
|
+
* `clientInfo` is supplied by the MCP host. It is useful for display and
|
|
21
|
+
* operational attribution, but MUST NOT be used for authentication,
|
|
22
|
+
* authorization, tenant selection or rate limiting.
|
|
23
|
+
*/
|
|
24
|
+
export interface McpCallContext {
|
|
25
|
+
era: 'modern' | 'legacy';
|
|
26
|
+
method: string;
|
|
27
|
+
toolName: string;
|
|
28
|
+
protocolVersion?: string;
|
|
29
|
+
clientInfo?: McpClientInfo;
|
|
30
|
+
outcome?: McpRoundOutcome;
|
|
31
|
+
round?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The host's progress token for this call, when it asked for progress.
|
|
34
|
+
*
|
|
35
|
+
* Declarative, like everything else on this type: it says the host is
|
|
36
|
+
* listening. Reporting is `ctx.reportProgress`, which is a function and
|
|
37
|
+
* therefore deliberately NOT here — this type is also the type of
|
|
38
|
+
* `RequestEvent.mcp`, and an audit row's shape must not claim to carry
|
|
39
|
+
* behaviour.
|
|
40
|
+
*/
|
|
41
|
+
progressToken?: string | number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One progress update a tool handler sends to the host mid-call.
|
|
45
|
+
*
|
|
46
|
+
* `progress` is a number the protocol requires. It is optional here because a
|
|
47
|
+
* handler often has a stage to name and no scale to name it on — "uploading",
|
|
48
|
+
* "rendering frame 12" — and the honest answer to "how far along" is then the
|
|
49
|
+
* ordinal of the update itself, which is what gets sent. That is a fact about
|
|
50
|
+
* what happened, not a percentage nobody measured; `total` stays absent, so a
|
|
51
|
+
* host renders it as an unbounded counter rather than a bar at 3%.
|
|
52
|
+
*/
|
|
53
|
+
export interface McpProgressUpdate {
|
|
54
|
+
/** Human-facing stage, shown by the host while the call is still running. */
|
|
55
|
+
message?: string;
|
|
56
|
+
/** How far along, on whatever scale `total` implies. */
|
|
57
|
+
progress?: number;
|
|
58
|
+
/** The scale, when the operation knows it. */
|
|
59
|
+
total?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Send one progress update for the call in flight.
|
|
63
|
+
*
|
|
64
|
+
* Present on every tool call and a no-op unless the host asked for progress by
|
|
65
|
+
* sending a token, so a handler never branches on transport. It never throws
|
|
66
|
+
* and never rejects: a message about work must not be able to kill the work it
|
|
67
|
+
* describes. Fire-and-forget — the returned promise settles when the
|
|
68
|
+
* notification has been handed to the transport, and ignoring it is correct.
|
|
69
|
+
*/
|
|
70
|
+
export type McpReportProgress = (update: McpProgressUpdate) => Promise<void>;
|
|
71
|
+
export interface RuntimeContext {
|
|
72
|
+
params: unknown;
|
|
73
|
+
input: unknown;
|
|
74
|
+
files?: Record<string, unknown>;
|
|
75
|
+
/** Original decoded JSON request text when the endpoint declares `rawBody: true`. */
|
|
76
|
+
rawBody?: string;
|
|
77
|
+
source: TransportSource;
|
|
78
|
+
/**
|
|
79
|
+
* The raw Web `Request`, its parsed `URL` and `Headers` — set on the HTTP
|
|
80
|
+
* transport (and reachable in every lifecycle hook, including `onError` on a
|
|
81
|
+
* validation failure). Absent on the non-HTTP transports (MCP / agent / CLI /
|
|
82
|
+
* a bring-your-own lane), which carry no `Request`, so they are optional and a
|
|
83
|
+
* reader narrows them. Web Fetch types only — the core stays Fetch-clean
|
|
84
|
+
* (→ ADR 0013).
|
|
85
|
+
*/
|
|
86
|
+
req?: Request;
|
|
87
|
+
url?: URL;
|
|
88
|
+
headers?: Headers;
|
|
89
|
+
traceId?: string;
|
|
90
|
+
spanId?: string;
|
|
91
|
+
ipAddress?: string;
|
|
92
|
+
userAgent?: string;
|
|
93
|
+
/** Transport cancellation for the active call (MCP and future cancellable lanes). */
|
|
94
|
+
signal?: AbortSignal;
|
|
95
|
+
/** Validated metadata for an MCP call; absent on every other transport. */
|
|
96
|
+
mcp?: McpCallContext;
|
|
97
|
+
/**
|
|
98
|
+
* Report progress on the call in flight.
|
|
99
|
+
*
|
|
100
|
+
* Present on every TOOL call — MCP, agent and CLI — and a no-op wherever
|
|
101
|
+
* nobody is listening, so a handler never branches on transport to say what
|
|
102
|
+
* it is doing. Absent on the HTTP transport, which has no channel for it;
|
|
103
|
+
* that is why the field is optional and a handler that also serves HTTP
|
|
104
|
+
* writes `ctx.reportProgress?.(…)`.
|
|
105
|
+
*/
|
|
106
|
+
reportProgress?: McpReportProgress;
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
109
|
+
export interface HandlerContext<TParams = undefined, TInput = undefined> {
|
|
110
|
+
params: TParams;
|
|
111
|
+
input: TInput;
|
|
112
|
+
files?: Record<string, unknown>;
|
|
113
|
+
/** Original decoded JSON request text when the endpoint declares `rawBody: true`. */
|
|
114
|
+
rawBody?: string;
|
|
115
|
+
source: TransportSource;
|
|
116
|
+
/** Raw Web `Request` / `URL` / `Headers` — set on the HTTP transport, absent
|
|
117
|
+
* on the tool transports (see {@link RuntimeContext}). */
|
|
118
|
+
req?: Request;
|
|
119
|
+
url?: URL;
|
|
120
|
+
headers?: Headers;
|
|
121
|
+
traceId?: string;
|
|
122
|
+
spanId?: string;
|
|
123
|
+
ipAddress?: string;
|
|
124
|
+
userAgent?: string;
|
|
125
|
+
/** Validated metadata for an MCP call; absent on every other transport. */
|
|
126
|
+
mcp?: McpCallContext;
|
|
127
|
+
/** Report progress on the call in flight — a no-op when none was asked for. */
|
|
128
|
+
reportProgress?: McpReportProgress;
|
|
129
|
+
[key: string]: unknown;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=runtime-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-context.d.ts","sourceRoot":"","sources":["../../src/contract/runtime-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD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E,iBAAiB,CAAC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an endpoint may declare for its tool surfaces: the UI resource, the annotations, and the MCP input rounds with their resolver.
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from 'zod';
|
|
5
|
+
import type { DeclaredToolView } from './tool-view.js';
|
|
6
|
+
/**
|
|
7
|
+
* MCP Apps UI metadata for a tool (SEP-1865). When set, the tool's MCP
|
|
8
|
+
* registration carries `_meta.ui`, so a host renders the named `ui://` resource
|
|
9
|
+
* as an interactive widget for this tool's results. The resource itself is
|
|
10
|
+
* served separately (see `McpServerBuildConfig.resources`).
|
|
11
|
+
*/
|
|
12
|
+
export interface EndpointUiMeta {
|
|
13
|
+
/** `ui://…` resource the host renders for this tool's results. */
|
|
14
|
+
resourceUri: string;
|
|
15
|
+
/** Who sees the tool — `'model'` (in the tool list) and/or `'app'` (widget-only). */
|
|
16
|
+
visibility?: readonly ('model' | 'app')[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* MCP `ToolAnnotations` — behavioural hints a host reads to group tools and pick
|
|
20
|
+
* permission defaults (read-only auto-allow, destructive needs approval) and to
|
|
21
|
+
* show a human label. Hints only — never a security boundary.
|
|
22
|
+
*/
|
|
23
|
+
export interface EndpointToolAnnotations {
|
|
24
|
+
/** Human-friendly display name (e.g. "Explore Models" instead of `list_models`). */
|
|
25
|
+
title?: string;
|
|
26
|
+
/** Tool does not mutate state — hosts may auto-allow and group as read-only. */
|
|
27
|
+
readOnlyHint?: boolean;
|
|
28
|
+
/** Tool may perform destructive updates (ignored when `readOnlyHint` is true). */
|
|
29
|
+
destructiveHint?: boolean;
|
|
30
|
+
/** Repeated calls with the same args have no additional effect. */
|
|
31
|
+
idempotentHint?: boolean;
|
|
32
|
+
/** Tool interacts with an open/external world (not a closed set). */
|
|
33
|
+
openWorldHint?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** One typed form elicitation required before an MCP tool handler may execute. */
|
|
36
|
+
export interface EndpointMcpInputRequired<TKey extends string = string, TSchema extends z.ZodObject = z.ZodObject> {
|
|
37
|
+
/** Stable response key carried across MRTR rounds. */
|
|
38
|
+
key: TKey;
|
|
39
|
+
/** Human-facing prompt shown by the MCP host. */
|
|
40
|
+
message: string;
|
|
41
|
+
/** Flat primitive object schema accepted from the host. */
|
|
42
|
+
schema: TSchema;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What the tool call looks like when the questions are chosen — the same
|
|
46
|
+
* `params` / `input` the handler would receive, parsed by the contract's own
|
|
47
|
+
* schemas.
|
|
48
|
+
*/
|
|
49
|
+
export interface McpInputRequiredCall {
|
|
50
|
+
params: unknown;
|
|
51
|
+
input: unknown;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Choose this call's elicitation rounds from its arguments.
|
|
55
|
+
*
|
|
56
|
+
* The static list is declared before any call exists, which is enough when the
|
|
57
|
+
* questions are a property of the operation. It is not enough when they are a
|
|
58
|
+
* property of the ARGUMENTS — one model takes `aspect_ratio`, another takes
|
|
59
|
+
* `duration`, a third needs an input image — and there the declared list can
|
|
60
|
+
* only be empty, so the tool description ends up teaching the model to work
|
|
61
|
+
* around a mechanism the protocol already has.
|
|
62
|
+
*
|
|
63
|
+
* Returning an empty list is a legitimate answer: this call needs nothing, run
|
|
64
|
+
* it. Everything else about the mechanism is unchanged — the state is still
|
|
65
|
+
* signed, still bound to the principal, the operation and the argument digest,
|
|
66
|
+
* and still counted against `maxRounds`.
|
|
67
|
+
*
|
|
68
|
+
* The resolved list is fingerprinted into the signed state and re-checked on
|
|
69
|
+
* every round, so a resolver that answers differently mid-conversation is
|
|
70
|
+
* refused rather than silently asking round 2's question under round 1's key.
|
|
71
|
+
*/
|
|
72
|
+
export type McpInputRequiredResolver<TRequests extends readonly EndpointMcpInputRequired[] = readonly EndpointMcpInputRequired[]> = (call: McpInputRequiredCall) => TRequests | Promise<TRequests>;
|
|
73
|
+
/** MCP-only execution policy attached to a contract or runtime tool. */
|
|
74
|
+
export interface EndpointMcpPolicy<TRequests extends readonly EndpointMcpInputRequired[] = readonly EndpointMcpInputRequired[]> {
|
|
75
|
+
/**
|
|
76
|
+
* Ordered elicitation rounds — a fixed list, or a function of the parsed
|
|
77
|
+
* arguments. Every key must be unique, in either form.
|
|
78
|
+
*/
|
|
79
|
+
inputRequired: TRequests | McpInputRequiredResolver<TRequests>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Everything a tool surface — MCP, AGENT, CLI — reads from an endpoint that
|
|
83
|
+
* HTTP does not: the name a model calls, the view it is answered with, the MCP
|
|
84
|
+
* widget, host hints and elicitation rounds. One group, so an endpoint that can
|
|
85
|
+
* never be a tool refuses all of it with one key, and a new tool option is
|
|
86
|
+
* added in one place. `expose` is not in it: it chooses transports, HTTP
|
|
87
|
+
* included. → ADR 0196.
|
|
88
|
+
*/
|
|
89
|
+
export interface EndpointToolOptions {
|
|
90
|
+
/** The tool name on MCP / AGENT / CLI; unique per transport within a contract. */
|
|
91
|
+
name?: string;
|
|
92
|
+
/**
|
|
93
|
+
* The answer on the tool surface when it is not the HTTP answer: input
|
|
94
|
+
* defaults, a narrower output, a projection. Declared only by `withToolView`,
|
|
95
|
+
* which types `project` against the endpoint's schemas.
|
|
96
|
+
*/
|
|
97
|
+
view?: DeclaredToolView;
|
|
98
|
+
/** MCP Apps widget for this tool's results (MCP transport only). */
|
|
99
|
+
ui?: EndpointUiMeta;
|
|
100
|
+
/** MCP behavioural hints (read-only / destructive / title) for hosts. */
|
|
101
|
+
annotations?: EndpointToolAnnotations;
|
|
102
|
+
/** Opt-in multi-round input gate; ignored by HTTP, Agent and CLI. */
|
|
103
|
+
mcp?: EndpointMcpPolicy;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=tool-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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,SAAS,CAAC,CAAC;AAEnE,wEAAwE;AACxE,MAAM,WAAW,iBAAiB,CAChC,SAAS,SAAS,SAAS,wBAAwB,EAAE,GAAG,SAAS,wBAAwB,EAAE;IAE3F;;;OAGG;IACH,aAAa,EAAE,SAAS,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;CAChE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,oEAAoE;IACpE,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,yEAAyE;IACzE,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,qEAAqE;IACrE,GAAG,CAAC,EAAE,iBAAiB,CAAC;CACzB"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { type ZodType, z } from 'zod';
|
|
2
|
+
import type { EndpointDef, ToolEndpointDef, TransportSource } from './define.js';
|
|
3
|
+
/** What a tool view's `project` is told about the call besides the full result. */
|
|
4
|
+
export interface ToolViewCall<TInput = unknown> {
|
|
5
|
+
/** The parsed input — the value the handler received, tool defaults applied. */
|
|
6
|
+
input: TInput;
|
|
7
|
+
/** Which tool transport the call entered on. */
|
|
8
|
+
source: TransportSource;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* How an endpoint answers on the tool surface — MCP, AGENT and CLI — when that
|
|
12
|
+
* answer is not its HTTP answer. HTTP, OpenAPI and the typed client keep the
|
|
13
|
+
* full `input` / `output`; the handler stays one function that never learns
|
|
14
|
+
* which surface called it. → ADR 0196.
|
|
15
|
+
*
|
|
16
|
+
* Declare it with {@link withToolView}: this runtime shape is deliberately
|
|
17
|
+
* loose, and only the helper types `project` against the endpoint's schemas.
|
|
18
|
+
*/
|
|
19
|
+
export interface EndpointToolView {
|
|
20
|
+
/**
|
|
21
|
+
* Input values a tool call gets when it does not pass the key — applied
|
|
22
|
+
* before the one parse by the endpoint's own `input`, so a model that asks
|
|
23
|
+
* for nothing is not handed the full record's cost. Keys must be keys of
|
|
24
|
+
* `input`, and never path params.
|
|
25
|
+
*/
|
|
26
|
+
defaults?: Readonly<Record<string, unknown>>;
|
|
27
|
+
/**
|
|
28
|
+
* The schema of the tool answer. Without `project` the full result is sliced
|
|
29
|
+
* by it; with `project` the projection is validated against it. Omitted, the
|
|
30
|
+
* tool answer keeps the full `output` schema and `project` is required.
|
|
31
|
+
*/
|
|
32
|
+
output?: ZodType<unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* A pure, synchronous full → tool-answer function. It adds nothing the full
|
|
35
|
+
* result does not carry: data the tool needs belongs in the full answer.
|
|
36
|
+
*/
|
|
37
|
+
project?: (full: never, call: ToolViewCall<never>) => unknown;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Marks a view as declared by {@link withToolView}. A view written as a bare
|
|
41
|
+
* object would type `project` against nothing and let a slice that cannot hold
|
|
42
|
+
* the full answer through; the mark makes the helper the one way to declare it.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DECLARED_TOOL_VIEW: unique symbol;
|
|
45
|
+
/** A tool view as `withToolView` produces it — the only form `tool.view` accepts. */
|
|
46
|
+
export interface DeclaredToolView extends EndpointToolView {
|
|
47
|
+
readonly [DECLARED_TOOL_VIEW]: true;
|
|
48
|
+
}
|
|
49
|
+
type EndpointInputOutput<E> = E extends {
|
|
50
|
+
input: infer I extends ZodType;
|
|
51
|
+
} ? z.output<I> : undefined;
|
|
52
|
+
type EndpointInputDefaults<E> = E extends {
|
|
53
|
+
input: infer I extends ZodType;
|
|
54
|
+
} ? Partial<z.input<I>> : never;
|
|
55
|
+
type EndpointFullOutput<E> = E extends {
|
|
56
|
+
output: infer O extends ZodType;
|
|
57
|
+
} ? z.output<O> : never;
|
|
58
|
+
type EndpointFullOutputInput<E> = E extends {
|
|
59
|
+
output: infer O extends ZodType;
|
|
60
|
+
} ? z.input<O> : never;
|
|
61
|
+
type ToolViewProject<E, TResult> = (full: EndpointFullOutput<E>, call: ToolViewCall<EndpointInputOutput<E>>) => TResult;
|
|
62
|
+
/** A tool view whose answer has its own schema, reached by `project`. */
|
|
63
|
+
export interface ProjectedToolView<E, V extends ZodType> {
|
|
64
|
+
defaults?: EndpointInputDefaults<E>;
|
|
65
|
+
output: V;
|
|
66
|
+
project: ToolViewProject<E, z.input<V>>;
|
|
67
|
+
}
|
|
68
|
+
/** A tool view that keeps the full schema and reshapes values within it. */
|
|
69
|
+
export interface ReshapedToolView<E> {
|
|
70
|
+
defaults?: EndpointInputDefaults<E>;
|
|
71
|
+
output?: undefined;
|
|
72
|
+
project: ToolViewProject<E, EndpointFullOutputInput<E>>;
|
|
73
|
+
}
|
|
74
|
+
/** A tool view that slices the full result by a narrower schema. */
|
|
75
|
+
export interface SlicedToolView<E, V extends ZodType> {
|
|
76
|
+
defaults?: EndpointInputDefaults<E>;
|
|
77
|
+
output: V;
|
|
78
|
+
project?: undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A tool view that changes only what a tool call is given: the answer is the
|
|
82
|
+
* endpoint's full `output`, exactly as HTTP answers. The most common view — a
|
|
83
|
+
* model needs a lighter call, not a different answer.
|
|
84
|
+
*/
|
|
85
|
+
export interface DefaultsOnlyToolView<E> {
|
|
86
|
+
defaults: EndpointInputDefaults<E>;
|
|
87
|
+
output?: undefined;
|
|
88
|
+
project?: undefined;
|
|
89
|
+
}
|
|
90
|
+
/** The type error a slice produces when the full result does not fit its schema. */
|
|
91
|
+
export interface ToolViewSliceMismatch {
|
|
92
|
+
'toolView.output must accept the full output — add a project, or narrow the schema': never;
|
|
93
|
+
}
|
|
94
|
+
type ToolViewEndpoint = ToolEndpointDef & {
|
|
95
|
+
output: ZodType<unknown>;
|
|
96
|
+
};
|
|
97
|
+
/** The type error an HTTP-only endpoint produces: a view is an answer for tools. */
|
|
98
|
+
export interface ToolViewNeedsToolTransport {
|
|
99
|
+
'toolView needs a tool transport — add MCP, AGENT or CLI to expose': never;
|
|
100
|
+
}
|
|
101
|
+
type ToolTransportEndpoint<E> = E extends {
|
|
102
|
+
expose: readonly ['HTTP'];
|
|
103
|
+
} ? ToolViewNeedsToolTransport : E;
|
|
104
|
+
/** The endpoint with its view in `tool.view`, next to any tool options it already had. */
|
|
105
|
+
export type WithToolView<E> = Omit<E, 'tool'> & {
|
|
106
|
+
tool: (E extends {
|
|
107
|
+
tool: infer T extends object;
|
|
108
|
+
} ? T : unknown) & {
|
|
109
|
+
view: DeclaredToolView;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Declare an endpoint's tool-surface view with `project` typed against the
|
|
114
|
+
* endpoint's own `input` and `output`.
|
|
115
|
+
*
|
|
116
|
+
* ```ts
|
|
117
|
+
* list: withToolView(
|
|
118
|
+
* {
|
|
119
|
+
* method: 'GET', path: '/', desc: 'List users', input: ListQuery, output: UserList,
|
|
120
|
+
* tool: { name: 'user_list' },
|
|
121
|
+
* },
|
|
122
|
+
* {
|
|
123
|
+
* defaults: { include: [] },
|
|
124
|
+
* output: UserCardList,
|
|
125
|
+
* project: (full, { input }) => ({ items: full.items.map(toCard) }),
|
|
126
|
+
* },
|
|
127
|
+
* ),
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* A view without `project` slices the full result by `output`; the full
|
|
131
|
+
* result must then fit that schema, which the return type checks. A view of
|
|
132
|
+
* `defaults` alone changes only the tool call's input — the answer is the full
|
|
133
|
+
* `output`, as on HTTP. The view lands in `tool.view`, beside the endpoint's
|
|
134
|
+
* other tool options.
|
|
135
|
+
*/
|
|
136
|
+
export declare function withToolView<const E extends ToolViewEndpoint>(endpoint: E & ToolTransportEndpoint<E>, view: DefaultsOnlyToolView<E>): WithToolView<E>;
|
|
137
|
+
export declare function withToolView<const E extends ToolViewEndpoint, V extends ZodType>(endpoint: E & ToolTransportEndpoint<E>, view: ProjectedToolView<E, V>): WithToolView<E>;
|
|
138
|
+
export declare function withToolView<const E extends ToolViewEndpoint>(endpoint: E & ToolTransportEndpoint<E>, view: ReshapedToolView<E>): WithToolView<E>;
|
|
139
|
+
export declare function withToolView<const E extends ToolViewEndpoint, V extends ZodType>(endpoint: E & ToolTransportEndpoint<E>, view: SlicedToolView<E, V>): [EndpointFullOutput<E>] extends [z.input<V>] ? WithToolView<E> : ToolViewSliceMismatch;
|
|
140
|
+
/**
|
|
141
|
+
* The declaration-time half of the view rule, for a contract assembled past the
|
|
142
|
+
* types as much as for one written through `withToolView`: a view only exists
|
|
143
|
+
* where a tool surface does, and it can only change what a tool call is given
|
|
144
|
+
* and shown — never which keys the endpoint accepts.
|
|
145
|
+
*/
|
|
146
|
+
export declare function assertToolView(prefix: string, key: string, ep: EndpointDef): void;
|
|
147
|
+
export {};
|
|
148
|
+
//# sourceMappingURL=tool-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-view.d.ts","sourceRoot":"","sources":["../../src/contract/tool-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E,mFAAmF;AACnF,MAAM,WAAW,YAAY,CAAC,MAAM,GAAG,OAAO;IAC5C,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,KAA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E,kBAAkB,EAC/B,IAAI,EAAE,MAAM,GACX,WAAW,GAAG,SAAS,CAEzB"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AgentStoreEventEnvelope, AgentStoreEventPage, AppendAgentStoreEvent, ReadAgentStoreEvents } from './events.js';
|
|
3
|
+
/**
|
|
4
|
+
* The durable ledger a local step implementation needs.
|
|
5
|
+
*
|
|
6
|
+
* Narrower than `AgentRuntimeStore` on purpose: durability owns no records of
|
|
7
|
+
* its own, it reads and appends the conversation's canonical event log, so a
|
|
8
|
+
* store that already satisfies this slice can back it without the rest of the
|
|
9
|
+
* runtime.
|
|
10
|
+
*
|
|
11
|
+
* A park (`sleep`/`waitFor`) is recorded the same way a step result is: as an
|
|
12
|
+
* ordinary event in this ledger. The local scheduler waits in-process, and a
|
|
13
|
+
* reconstruction resumes from the records that survived a restart.
|
|
14
|
+
*/
|
|
15
|
+
export interface StepDurabilityLedger {
|
|
16
|
+
appendEvent(input: AppendAgentStoreEvent): Promise<AgentStoreEventEnvelope>;
|
|
17
|
+
readEvents(input: ReadAgentStoreEvents): Promise<AgentStoreEventPage>;
|
|
18
|
+
}
|
|
19
|
+
/** Event kind carrying one recorded step result in the canonical ledger. */
|
|
20
|
+
export declare const DURABILITY_STEP_EVENT_KIND = "durability/step";
|
|
21
|
+
/** Event kind recording that a run parked on time or on an external event. */
|
|
22
|
+
export declare const DURABILITY_PARK_EVENT_KIND = "durability/park";
|
|
23
|
+
/** Event kind recording an external event delivered to a parked wait. */
|
|
24
|
+
export declare const DURABILITY_EVENT_EVENT_KIND = "durability/event";
|
|
25
|
+
/** Event kind recording one phase of an at-most-once effect: intent, accepted or uncertain. */
|
|
26
|
+
export declare const DURABILITY_EFFECT_EVENT_KIND = "durability/effect";
|
|
27
|
+
export declare const StepEventPayloadSchema: z.ZodObject<{
|
|
28
|
+
runId: z.ZodString;
|
|
29
|
+
stepName: z.ZodString;
|
|
30
|
+
encoded: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const ParkEventPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
runId: z.ZodString;
|
|
34
|
+
kind: z.ZodLiteral<"sleep">;
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
deadline: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
runId: z.ZodString;
|
|
39
|
+
kind: z.ZodLiteral<"wait">;
|
|
40
|
+
event: z.ZodString;
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
}, z.core.$strip>], "kind">;
|
|
43
|
+
export declare const DeliveredEventPayloadSchema: z.ZodObject<{
|
|
44
|
+
runId: z.ZodString;
|
|
45
|
+
event: z.ZodString;
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
encoded: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const EffectEventPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
+
runId: z.ZodString;
|
|
51
|
+
effectName: z.ZodString;
|
|
52
|
+
phase: z.ZodLiteral<"intent">;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
runId: z.ZodString;
|
|
55
|
+
effectName: z.ZodString;
|
|
56
|
+
phase: z.ZodLiteral<"accepted">;
|
|
57
|
+
encoded: z.ZodString;
|
|
58
|
+
via: z.ZodEnum<{
|
|
59
|
+
reconcile: "reconcile";
|
|
60
|
+
run: "run";
|
|
61
|
+
}>;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
runId: z.ZodString;
|
|
64
|
+
effectName: z.ZodString;
|
|
65
|
+
phase: z.ZodLiteral<"uncertain">;
|
|
66
|
+
}, z.core.$strip>], "phase">;
|
|
67
|
+
export type EffectEventPayload = z.infer<typeof EffectEventPayloadSchema>;
|
|
68
|
+
export type ParkEventPayload = z.infer<typeof ParkEventPayloadSchema>;
|
|
69
|
+
export type StepEventPayload = z.infer<typeof StepEventPayloadSchema>;
|
|
70
|
+
/**
|
|
71
|
+
* The time source a park uses.
|
|
72
|
+
*
|
|
73
|
+
* `now` is the wall clock the durable sleep deadline is stamped from and
|
|
74
|
+
* re-evaluated against, so a reconstructed park resumes from the recorded
|
|
75
|
+
* value. A test replaces the pair with a manual clock to advance time without
|
|
76
|
+
* waiting in real time.
|
|
77
|
+
*/
|
|
78
|
+
export interface DurabilityClock {
|
|
79
|
+
now(): number;
|
|
80
|
+
schedule(callback: () => void, delayMs: number): {
|
|
81
|
+
cancel(): void;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface LocalStepDurabilityOptions {
|
|
85
|
+
store: StepDurabilityLedger;
|
|
86
|
+
conversationId: string;
|
|
87
|
+
runId: string;
|
|
88
|
+
signal?: AbortSignal;
|
|
89
|
+
/** Host-owned notification for ledger writes made by another process. */
|
|
90
|
+
subscribe?(wake: () => void): () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Injectable time source for `sleep`. Defaults to the wall clock and
|
|
93
|
+
* `setTimeout`; a test passes a manual clock so advancing time
|
|
94
|
+
* deterministically resumes a park without waiting in real time.
|
|
95
|
+
*/
|
|
96
|
+
clock?: {
|
|
97
|
+
now(): number;
|
|
98
|
+
schedule(callback: () => void, delayMs: number): {
|
|
99
|
+
cancel(): void;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface StepRunOptions {
|
|
104
|
+
/** Aborting refuses to *start* a body and releases a park; it never removes a record already written. */
|
|
105
|
+
signal?: AbortSignal;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* What an effect ended as. `uncertain` is a third answer, not a failure to
|
|
109
|
+
* produce one: the effect may have happened, the recipient has no record of it,
|
|
110
|
+
* and nothing here will try it again.
|
|
111
|
+
*/
|
|
112
|
+
export type EffectOutcome<P> = {
|
|
113
|
+
readonly outcome: 'accepted';
|
|
114
|
+
readonly proof: P;
|
|
115
|
+
} | {
|
|
116
|
+
readonly outcome: 'uncertain';
|
|
117
|
+
};
|
|
118
|
+
/** The two halves of an effect in another system. */
|
|
119
|
+
export interface EffectHandlers<P> {
|
|
120
|
+
/**
|
|
121
|
+
* Perform the effect, once, and return what the recipient named it — a
|
|
122
|
+
* message id, a turn id. Called at most once per name, across every process
|
|
123
|
+
* that shares the ledger.
|
|
124
|
+
*/
|
|
125
|
+
run(): P | Promise<P>;
|
|
126
|
+
/**
|
|
127
|
+
* Find the effect at the recipient by the caller's own identity for it, and
|
|
128
|
+
* return the same proof — or `null` when the recipient has no record. Called
|
|
129
|
+
* only when an intent was recorded and no outcome was: the process that ran
|
|
130
|
+
* the effect stopped before it could say how it ended.
|
|
131
|
+
*/
|
|
132
|
+
reconcile(signal: AbortSignal): P | null | Promise<P | null>;
|
|
133
|
+
}
|
|
134
|
+
export interface EffectRunOptions extends StepRunOptions {
|
|
135
|
+
/** How long `reconcile` may take, in milliseconds; its `signal` aborts at the deadline. Default 30 000. */
|
|
136
|
+
reconcileTimeoutMs?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface LocalStepDurability {
|
|
139
|
+
/**
|
|
140
|
+
* Run `name` once and durably record its JSON result.
|
|
141
|
+
*
|
|
142
|
+
* The first execution runs `body` and appends the result to the ledger. A
|
|
143
|
+
* replay — a fresh process, or a second durability object built over the same
|
|
144
|
+
* store — decodes the record and returns it without calling `body` again.
|
|
145
|
+
*/
|
|
146
|
+
step<T extends z.infer<ReturnType<typeof z.json>>>(name: string, body: () => T | Promise<T>, options?: StepRunOptions): Promise<T>;
|
|
147
|
+
/** The decoded result of an already-recorded step, or `undefined` if none. */
|
|
148
|
+
readRecordedStep(name: string): Promise<unknown | undefined>;
|
|
149
|
+
/** Whether `name` has a recorded result. */
|
|
150
|
+
hasRecordedStep(name: string): Promise<boolean>;
|
|
151
|
+
/**
|
|
152
|
+
* Wait on a lightweight local timer for `seconds`, retaining a durable deadline.
|
|
153
|
+
*
|
|
154
|
+
* The first call records a park with an absolute deadline; a replay whose
|
|
155
|
+
* deadline has passed returns immediately, one before it waits out the
|
|
156
|
+
* remainder. `name` is the park's identity within the run and must be stable
|
|
157
|
+
* across replays. It defaults to the duration, so a caller that parks twice
|
|
158
|
+
* for the same length must pass distinct names.
|
|
159
|
+
*/
|
|
160
|
+
sleep(input: {
|
|
161
|
+
seconds: number;
|
|
162
|
+
name?: string;
|
|
163
|
+
}, options?: StepRunOptions): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Park the run until an external event `{ event, id }` is delivered.
|
|
166
|
+
*
|
|
167
|
+
* Resolves with the delivered payload. A waiter that starts after delivery
|
|
168
|
+
* returns immediately, as does a reconstruction that finds the delivery in
|
|
169
|
+
* the ledger.
|
|
170
|
+
*/
|
|
171
|
+
waitFor<T = unknown>(input: {
|
|
172
|
+
event: string;
|
|
173
|
+
id: string;
|
|
174
|
+
}, options?: StepRunOptions): Promise<T>;
|
|
175
|
+
/**
|
|
176
|
+
* Durably record an external event and wake any waiter for it.
|
|
177
|
+
*
|
|
178
|
+
* The record is append-only and survives a restart: reconstruction finds it
|
|
179
|
+
* and a `waitFor` for the same key resolves without a second delivery.
|
|
180
|
+
*/
|
|
181
|
+
deliver(input: {
|
|
182
|
+
event: string;
|
|
183
|
+
id: string;
|
|
184
|
+
payload?: unknown;
|
|
185
|
+
}): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Perform an effect in another system at most once.
|
|
188
|
+
*
|
|
189
|
+
* `step` records its result AFTER the body, so a body cut short by a crash
|
|
190
|
+
* runs again — right for a computation, wrong for sending a message, where a
|
|
191
|
+
* repeat is worse than a loss. Here the intent is recorded BEFORE `run`, and
|
|
192
|
+
* its outcome after. A later call that finds the intent without an outcome
|
|
193
|
+
* calls `reconcile`, never `run`: found is `accepted` with the proof, not
|
|
194
|
+
* found is `uncertain`, and both are recorded, so neither is asked again.
|
|
195
|
+
*
|
|
196
|
+
* A `run` that throws leaves the intent standing — whether the effect
|
|
197
|
+
* happened is exactly what is not known — and the call rejects with
|
|
198
|
+
* `EffectUnresolvedError`; the next call reconciles. The proof is JSON of at
|
|
199
|
+
* most 64 KiB: an identity, not a payload.
|
|
200
|
+
*/
|
|
201
|
+
effect<P extends z.infer<ReturnType<typeof z.json>>>(name: string, handlers: EffectHandlers<P>, options?: EffectRunOptions): Promise<EffectOutcome<P>>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The record for `name` cannot be trusted.
|
|
205
|
+
*
|
|
206
|
+
* Thrown instead of re-running `body`: a body is arbitrary and often effectful,
|
|
207
|
+
* and a record that cannot be decoded is evidence the ledger is not what this
|
|
208
|
+
* run wrote, never evidence the step never ran.
|
|
209
|
+
*/
|
|
210
|
+
export declare class StepResultDecodeError extends Error {
|
|
211
|
+
constructor(message: string, options?: {
|
|
212
|
+
cause?: unknown;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/** A step body returned a value that cannot be represented as JSON. */
|
|
216
|
+
export declare class StepResultNotSerializableError extends Error {
|
|
217
|
+
constructor(stepName: string, cause: unknown);
|
|
218
|
+
}
|
|
219
|
+
/** The caller aborted before the step body was started. No record was written. */
|
|
220
|
+
export declare class StepAbortedError extends Error {
|
|
221
|
+
constructor(stepName: string);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* An effect whose outcome could not be settled by this call.
|
|
225
|
+
*
|
|
226
|
+
* Its intent is recorded and stays recorded, so `run` is never called for this
|
|
227
|
+
* name again; the next call reconciles instead. `reason` says which step did
|
|
228
|
+
* not finish: `run` threw, `reconcile` threw or overran its deadline, or the
|
|
229
|
+
* proof could not be recorded.
|
|
230
|
+
*/
|
|
231
|
+
export declare class EffectUnresolvedError extends Error {
|
|
232
|
+
readonly effectName: string;
|
|
233
|
+
readonly reason: 'run-failed' | 'reconcile-failed' | 'reconcile-timeout' | 'proof-rejected';
|
|
234
|
+
constructor(effectName: string, reason: 'run-failed' | 'reconcile-failed' | 'reconcile-timeout' | 'proof-rejected', options?: {
|
|
235
|
+
cause?: unknown;
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* A park or delivered-event record cannot be trusted.
|
|
240
|
+
*
|
|
241
|
+
* Thrown instead of parking on a record whose shape is not ours: an
|
|
242
|
+
* undecodable park is evidence the ledger is not what this run wrote, never
|
|
243
|
+
* evidence the park never happened.
|
|
244
|
+
*/
|
|
245
|
+
export declare class ParkRecordDecodeError extends Error {
|
|
246
|
+
constructor(message: string, options?: {
|
|
247
|
+
cause?: unknown;
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* A sleeping or waiting park was aborted before it was satisfied.
|
|
252
|
+
*
|
|
253
|
+
* No record is removed: the park stays in the ledger, so a later replay
|
|
254
|
+
* resumes from the same durable state instead of starting a new park.
|
|
255
|
+
*/
|
|
256
|
+
export declare class ParkAbortedError extends Error {
|
|
257
|
+
constructor(park: string);
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=contract.d.ts.map
|