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
package/llms/tools.2.txt
ADDED
|
@@ -0,0 +1,647 @@
|
|
|
1
|
+
# stitchkit/tools — stitchkit docs slice, part 2 of 3
|
|
2
|
+
|
|
3
|
+
> Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
|
|
4
|
+
> `llms.txt` in this package.
|
|
5
|
+
> Continues in `llms/tools.3.txt`.
|
|
6
|
+
|
|
7
|
+
Parts of this slice:
|
|
8
|
+
- `llms/tools.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
|
|
9
|
+
- `llms/tools.2.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
|
|
10
|
+
- `llms/tools.3.txt`: API reference: `stitchkit/tools` (docs/api/reference.md)
|
|
11
|
+
|
|
12
|
+
==============================================================================
|
|
13
|
+
# Guide: MCP & agents (docs/guide/mcp-and-agents.md) (continued)
|
|
14
|
+
==============================================================================
|
|
15
|
+
|
|
16
|
+
## A different answer for tools — `withToolView`
|
|
17
|
+
|
|
18
|
+
An admin page wants the full record; a model wants a card. Every byte of a
|
|
19
|
+
tool result enters the model's context and stays in its history, and personal
|
|
20
|
+
fields a task does not need are better never shown to it. Two endpoints on one
|
|
21
|
+
path (one `expose: ['HTTP']`, one for the tools) duplicate the description, the
|
|
22
|
+
schemas and the handler; branching on `ctx.source` teaches every handler about
|
|
23
|
+
transports and still advertises the full output schema.
|
|
24
|
+
|
|
25
|
+
A **tool view** declares the difference on the endpoint instead. Most often the
|
|
26
|
+
difference is only the call — a model needs a lighter one, and the answer keeps
|
|
27
|
+
its one shape:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { defineContract, withToolView } from 'stitchkit';
|
|
31
|
+
|
|
32
|
+
export const items = defineContract({ prefix: 'items' }, {
|
|
33
|
+
list: withToolView(
|
|
34
|
+
{
|
|
35
|
+
method: 'GET', path: '/:slug/items', desc: 'List items', tool: { name: 'db_items' },
|
|
36
|
+
input: ItemsQuery, // include: z.array(...).default(['relations'])
|
|
37
|
+
output: ItemsResponse, // one answer on HTTP and on the tools
|
|
38
|
+
},
|
|
39
|
+
{ defaults: { include: [] } }, // what a tool call gets when it passes nothing
|
|
40
|
+
),
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
When the answer itself differs, the view carries its own schema too:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { defineContract, withToolView } from 'stitchkit';
|
|
48
|
+
|
|
49
|
+
export const users = defineContract({ prefix: 'users' }, {
|
|
50
|
+
list: withToolView(
|
|
51
|
+
{
|
|
52
|
+
method: 'GET', path: '/', desc: 'List users', tool: { name: 'user_list' },
|
|
53
|
+
input: UserListQuery, // include: z.array(...).default(['profile', 'stats'])
|
|
54
|
+
output: UserListResponse, // HTTP, OpenAPI and the typed client — unchanged
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
defaults: { include: [] }, // what a tool call gets when it passes nothing
|
|
58
|
+
output: UserCardList, // the tool answer and its schema
|
|
59
|
+
project: (full, { input }) => ({ items: full.items.map(toCard) }), // optional: without it, `output` slices
|
|
60
|
+
},
|
|
61
|
+
),
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- **One handler, one parser.** `defaults` joins the tool call's arguments
|
|
66
|
+
*before* the endpoint's own `input` parses them, so the handler receives an
|
|
67
|
+
ordinary `input` — `include: []` from a tool, the HTTP default from HTTP — and
|
|
68
|
+
loads only what was asked for. An explicit argument wins over the default.
|
|
69
|
+
- **The answer is derived, then checked.** The handler's result is validated
|
|
70
|
+
against the full `output` first, as always; then `project` (a pure,
|
|
71
|
+
synchronous function of the full result and the parsed input) or a slice by
|
|
72
|
+
the view's `output`, then validation against the view's schema. A projection
|
|
73
|
+
that throws, returns a Promise or breaks its schema is `INTERNAL_SERVER_ERROR`
|
|
74
|
+
— a server fault, like any output mismatch.
|
|
75
|
+
- **Where it applies.** The MCP, agent and CLI mounts answer with the view;
|
|
76
|
+
`outputSchema`, `structuredContent`, the advertised input `default`, the
|
|
77
|
+
catalog stamp and the surface snapshot follow it. HTTP, OpenAPI, the typed
|
|
78
|
+
client and the in-process [`createToolInvoker`](#in-process-calls--createtoolinvoker)
|
|
79
|
+
keep the full answer — code, not a model, is calling there.
|
|
80
|
+
- **Four forms, one helper.** With `defaults` alone the call changes and the
|
|
81
|
+
answer is the full `output`, validated by it and advertised as it. With
|
|
82
|
+
`output` and `project` the answer has its own schema. With `project` alone it
|
|
83
|
+
reshapes values inside the full schema. With `output` alone it is a slice, and
|
|
84
|
+
the full result must fit that schema — `withToolView` refuses the endpoint at
|
|
85
|
+
compile time when it does not.
|
|
86
|
+
- **Exposure.** A view needs a tool transport. With `createContractFactory({
|
|
87
|
+
toolExposure: 'explicit' })` an endpoint without `expose` is HTTP-only, so an
|
|
88
|
+
endpoint with a view names its tool transports in `expose`.
|
|
89
|
+
- **What it refuses.** `defineContract` rejects a view on an endpoint with no
|
|
90
|
+
tool transport or no full `output`, on a raw, `rawBody`, multipart,
|
|
91
|
+
`responseMeta` or streaming endpoint, a view that declares no `defaults`,
|
|
92
|
+
`output` or `project` — it would change nothing — and a default for a key the input does not have, for a path
|
|
93
|
+
param, or with a value the input would reject.
|
|
94
|
+
|
|
95
|
+
A projection adds nothing the full result does not carry: a field the tool
|
|
96
|
+
answer needs belongs in the full answer, loaded by the handler. Keys a
|
|
97
|
+
projection returns beyond its schema are reported by `onOutputStrip`; a slice
|
|
98
|
+
removes keys on purpose and is not reported. → [ADR 0196](../decisions/0196-a-tool-answer-is-a-declared-view.md)
|
|
99
|
+
|
|
100
|
+
## AI agents — `mountAgent`
|
|
101
|
+
|
|
102
|
+
`mountAgent` remains the low-level path when the application owns its own model
|
|
103
|
+
loop and conversation state. For the optional Stitchkit-owned run/history loop,
|
|
104
|
+
see [Agent application runtime](./agent-runtime.md).
|
|
105
|
+
|
|
106
|
+
`mountAgent` turns a service into a Vercel AI SDK `ToolSet`, ready for
|
|
107
|
+
`generateText` / `streamText`:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { mountAgent } from 'stitchkit/tools'
|
|
111
|
+
import { generateText } from 'ai'
|
|
112
|
+
|
|
113
|
+
const tools = mountAgent(usersService, { context: { userId: 'agent-1' } })
|
|
114
|
+
|
|
115
|
+
const result = await generateText({
|
|
116
|
+
model,
|
|
117
|
+
tools,
|
|
118
|
+
prompt: 'Create a user named Max',
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Each contract endpoint exposed on `AGENT` becomes a tool whose input schema is
|
|
123
|
+
the merged `params` + `input`. `context` is merged into every tool handler's
|
|
124
|
+
`ctx`, alongside `source: 'agent'`.
|
|
125
|
+
|
|
126
|
+
### `AgentMountConfig`
|
|
127
|
+
|
|
128
|
+
| Field | Purpose |
|
|
129
|
+
|-------|---------|
|
|
130
|
+
| `context` | values merged into every tool handler's `ctx` |
|
|
131
|
+
| `lifecycle` | `beforeHandle` / `afterHandle` — the tool-side auth gate (see [Guarding tools](#guarding-tools--lifecycle)) |
|
|
132
|
+
| `hooks` | tool-call observability hooks — `afterToolCall` fires on every result |
|
|
133
|
+
| `extend` | add extra args resolved before the handler runs (see below) |
|
|
134
|
+
| `runtimeTools` | framework-managed pathless operations from `defineRuntimeTool` |
|
|
135
|
+
|
|
136
|
+
`lifecycle` works the same as on the MCP server — without it an agent tool call
|
|
137
|
+
bypasses the HTTP `authorize` gate. Pass your `createAuthHook` result.
|
|
138
|
+
|
|
139
|
+
### Adding tool-only args — `extend`
|
|
140
|
+
|
|
141
|
+
`extend` adds **tool-only** arguments — fields the model fills that are resolved
|
|
142
|
+
into context, then stripped before the contract handler sees them. Use it when a
|
|
143
|
+
tool needs an argument the HTTP endpoint does not — the classic case being a
|
|
144
|
+
**multi-tenant** server reached by one API key, where the model passes `tenantId`
|
|
145
|
+
on every call. It is the same `ToolExtend` shape on `mountMcp`, `createMcpHandler`
|
|
146
|
+
and `mountAgent`:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
interface ToolExtend {
|
|
150
|
+
/** Extra Zod fields added to every matching tool's input schema. */
|
|
151
|
+
schema: Record<string, z.ZodType>
|
|
152
|
+
/** Turn the extra args into context merged into the handler's ctx. */
|
|
153
|
+
resolve: (args: Record<string, unknown>) => Partial<Ctx> | Promise<Partial<Ctx>>
|
|
154
|
+
/** Limit the extension to specific methods — default: every method. */
|
|
155
|
+
filter?: (service: ServiceDef, method: MethodDef) => boolean
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
On the MCP server — add `tenantId` to each tool, validate access in `resolve`,
|
|
160
|
+
inject the resolved tenant into `ctx`, and `filter` to the tenant-scoped tools:
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
createMcpHandler({
|
|
164
|
+
serverInfo, auth,
|
|
165
|
+
services: [widgetsService],
|
|
166
|
+
extend: {
|
|
167
|
+
schema: { tenantId: z.string().describe('Tenant to act on') },
|
|
168
|
+
resolve: async ({ tenantId }) => {
|
|
169
|
+
const id = String(tenantId)
|
|
170
|
+
if (!(await tenantExists(id))) throw new Error(`unknown tenant ${id}`)
|
|
171
|
+
return { tenantId: id } // merged into ctx → ctx.tenantId
|
|
172
|
+
},
|
|
173
|
+
filter: (_service, method) => method.scope === 'tenant',
|
|
174
|
+
},
|
|
175
|
+
})
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The model calls `widgets_list({ tenantId: 't_123' })`; `resolve` checks access and
|
|
179
|
+
puts `tenantId` on `ctx`; the contract handler reads `ctx.tenantId` (same place
|
|
180
|
+
as the HTTP prefix param — see
|
|
181
|
+
[Route groups → param prefixes](./server.md#param-prefixes-resource-scoped-paths)),
|
|
182
|
+
so one handler serves both surfaces. Pair `extend` with `lifecycle` (your
|
|
183
|
+
`createAuthHook`) so the tool call is still scope-gated.
|
|
184
|
+
|
|
185
|
+
## Pathless runtime tools and multimodal results
|
|
186
|
+
|
|
187
|
+
Use `defineRuntimeTool` for an operation that has no HTTP path but still needs
|
|
188
|
+
the same validation, isolated per-call context, lifecycle/RBAC and hooks as a
|
|
189
|
+
contract tool. The handler returns one transport-neutral, schema-validated
|
|
190
|
+
result. Optional presentation callbacks map that result to MCP content and AI
|
|
191
|
+
SDK model output without coupling the handler to either SDK:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { createMcpHandler, defineRuntimeTool, mountAgent } from 'stitchkit/tools'
|
|
195
|
+
import { z } from 'zod'
|
|
196
|
+
|
|
197
|
+
const renderPreview = defineRuntimeTool({
|
|
198
|
+
name: 'render_preview',
|
|
199
|
+
description: 'Render and inspect a preview',
|
|
200
|
+
identity: {
|
|
201
|
+
serviceName: 'mediaTools',
|
|
202
|
+
action: 'renderPreview',
|
|
203
|
+
scope: 'admin',
|
|
204
|
+
method: 'POST',
|
|
205
|
+
},
|
|
206
|
+
input: z.object({ prompt: z.string() }),
|
|
207
|
+
output: z.object({ assetId: z.string(), imageBase64: z.string() }),
|
|
208
|
+
handler: async ({ input }) => renderAndSave(input.prompt),
|
|
209
|
+
present: {
|
|
210
|
+
mcp: (output) => ({
|
|
211
|
+
content: [
|
|
212
|
+
{ type: 'image', data: output.imageBase64, mimeType: 'image/png' },
|
|
213
|
+
{ type: 'text', text: output.assetId },
|
|
214
|
+
],
|
|
215
|
+
}),
|
|
216
|
+
agent: (output) => ({
|
|
217
|
+
type: 'content',
|
|
218
|
+
value: [{
|
|
219
|
+
type: 'file',
|
|
220
|
+
data: { type: 'data', data: output.imageBase64 },
|
|
221
|
+
mediaType: 'image/png',
|
|
222
|
+
filename: `${output.assetId}.png`,
|
|
223
|
+
}],
|
|
224
|
+
}),
|
|
225
|
+
},
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
const handleMcp = createMcpHandler({
|
|
229
|
+
serverInfo: { name: 'my-app', version: '1.0.0' },
|
|
230
|
+
auth,
|
|
231
|
+
services: [service],
|
|
232
|
+
runtimeTools: [renderPreview],
|
|
233
|
+
lifecycle: { beforeHandle: authHook },
|
|
234
|
+
hooks: audit.toolCall,
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
const agentTools = mountAgent([service], {
|
|
238
|
+
runtimeTools: [renderPreview],
|
|
239
|
+
lifecycle: { beforeHandle: authHook },
|
|
240
|
+
hooks: audit.toolCall,
|
|
241
|
+
})
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
When several runtime tools share application context and identity, bind both
|
|
245
|
+
once with `createRuntimeToolFactory`. Its Zod context schema is parsed once per
|
|
246
|
+
call inside the same runner; the authored handler receives validated context and
|
|
247
|
+
parsed `input`, while lifecycle, hooks, output validation and presenters remain
|
|
248
|
+
unchanged:
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
const knowledgeTools = createRuntimeToolFactory({
|
|
252
|
+
serviceName: 'agentKnowledge',
|
|
253
|
+
scope: 'user',
|
|
254
|
+
context: z.object({ userId: z.string(), tz: z.string() }),
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
const countRecords = knowledgeTools.define({
|
|
258
|
+
name: 'count_records',
|
|
259
|
+
action: 'countRecords',
|
|
260
|
+
method: 'GET',
|
|
261
|
+
description: 'Count records',
|
|
262
|
+
input: z.object({ kind: z.string() }),
|
|
263
|
+
output: z.object({ count: z.number() }),
|
|
264
|
+
handler: async ({ userId, tz, input }) => countFor(userId, tz, input.kind),
|
|
265
|
+
})
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
`serviceName` and `scope` cannot be overridden by one definition. Use standalone
|
|
269
|
+
`defineRuntimeTool` when tools do not share a context schema or identity.
|
|
270
|
+
|
|
271
|
+
`transports` defaults to `['MCP', 'AGENT']`; set an explicit subset when an
|
|
272
|
+
operation belongs on only one surface. Include `'CLI'` explicitly to reuse the
|
|
273
|
+
definition through `createCli({ runtimeTools })`; adding CLI support never
|
|
274
|
+
widens existing definitions silently. The configured identity becomes the
|
|
275
|
+
hook/lifecycle `OperationIdentity` and the tool `RequestEvent`
|
|
276
|
+
(`serviceName`, `action`, `httpMethod`). A runtime operation has no HTTP route,
|
|
277
|
+
so no fake `path` is added.
|
|
278
|
+
|
|
279
|
+
When `output` is declared, Stitchkit validates the neutral handler result after
|
|
280
|
+
`afterHandle`. MCP owns `structuredContent` and `isError`: a presenter supplies
|
|
281
|
+
only rich `content`/metadata, while the framework inserts the validated
|
|
282
|
+
structured result and normalises failures. The Agent adapter uses the AI SDK's
|
|
283
|
+
official `toModelOutput` callback, so `execute` and application UI keep the
|
|
284
|
+
neutral output while the model receives text/file content. Presentation
|
|
285
|
+
callbacks require an output schema.
|
|
286
|
+
|
|
287
|
+
The MCP registration uses an identity carrier: the SDK advertises the compiled
|
|
288
|
+
JSON Schema but forwards the raw object into Stitchkit. Input failures therefore
|
|
289
|
+
use the same validation, lifecycle and hook path as contract tools.
|
|
290
|
+
|
|
291
|
+
### Managed wait, download, upload and view-file
|
|
292
|
+
|
|
293
|
+
The common imperative shapes have typed definition factories. They produce
|
|
294
|
+
ordinary runtime-tool definitions, so one value can enter `runtimeTools` on MCP
|
|
295
|
+
and Agent and receives the same lifecycle, hooks, context, cancellation,
|
|
296
|
+
collision checks and introspection as any `defineRuntimeTool` operation:
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
import {
|
|
300
|
+
defineDownloadTool,
|
|
301
|
+
defineUploadTool,
|
|
302
|
+
defineViewFileTool,
|
|
303
|
+
defineWaitTool,
|
|
304
|
+
} from 'stitchkit/tools'
|
|
305
|
+
import { createManagedFileBoundary } from 'stitchkit/files'
|
|
306
|
+
import { z } from 'zod'
|
|
307
|
+
|
|
308
|
+
const files = await createManagedFileBoundary({
|
|
309
|
+
root: '/srv/job-media',
|
|
310
|
+
createRoot: true, // creates only this final directory; /srv must already be trusted
|
|
311
|
+
inspectionTimeoutMs: 15_000,
|
|
312
|
+
inspect: ({ prefix, name, declaredMediaType, signal }) =>
|
|
313
|
+
inspectFile(prefix, { name, declaredMediaType, signal }),
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
const waitForJob = defineWaitTool({
|
|
317
|
+
name: 'wait_for_job',
|
|
318
|
+
description: 'Wait for a job to finish',
|
|
319
|
+
identity: { serviceName: 'jobs', action: 'waitForJob', scope: 'user' },
|
|
320
|
+
input: z.object({ id: z.string() }),
|
|
321
|
+
state: z.object({ id: z.string(), status: z.enum(['RUNNING', 'DONE']) }),
|
|
322
|
+
poll: ({ id }, context) => getJob(id, context.signal),
|
|
323
|
+
done: (state) => state.status === 'DONE',
|
|
324
|
+
backoff: [2, 3, 5],
|
|
325
|
+
defaultTimeout: 120,
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
const downloadResult = defineDownloadTool({
|
|
329
|
+
name: 'download_result',
|
|
330
|
+
description: 'Download a completed result',
|
|
331
|
+
identity: { serviceName: 'jobs', action: 'downloadResult', scope: 'user' },
|
|
332
|
+
input: z.object({ id: z.string() }),
|
|
333
|
+
resolveUrl: ({ id }) => resolveResultUrl(id),
|
|
334
|
+
files,
|
|
335
|
+
pathFromInput: ({ id }) => `results/${id}.bin`,
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
const uploadInput = defineUploadTool({
|
|
339
|
+
name: 'upload_input',
|
|
340
|
+
description: 'Upload a local input file',
|
|
341
|
+
identity: { serviceName: 'jobs', action: 'uploadInput', scope: 'user' },
|
|
342
|
+
output: z.object({ url: z.url() }),
|
|
343
|
+
files,
|
|
344
|
+
upload: (source, context) => uploadBytes(source.bytes, context.signal),
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
const viewResult = defineViewFileTool({
|
|
348
|
+
name: 'view_result',
|
|
349
|
+
description: 'Inspect generated media',
|
|
350
|
+
identity: { serviceName: 'jobs', action: 'viewResult', scope: 'user' },
|
|
351
|
+
// Local files are disabled when files is omitted. URL fetches retain SSRF
|
|
352
|
+
// protection; use allowPrivateHosts only for an explicitly trusted network.
|
|
353
|
+
files,
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
const runtimeTools = [waitForJob, downloadResult, uploadInput, viewResult]
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Managed factories return neutral validated data. Expected failures go through
|
|
360
|
+
the standard failed `ToolResult` path rather than masquerading as a successful
|
|
361
|
+
payload with `isError`. Wait sleep is abort-aware, guarded downloads receive the
|
|
362
|
+
active signal, and upload implementations receive it on their typed context.
|
|
363
|
+
Managed view-file accepts one or several paths/URLs, retains successful
|
|
364
|
+
multimodal content beside structured per-item `errors`, and charges every item
|
|
365
|
+
to one total 20 MB batch budget. Its MCP and Agent presenters are built in;
|
|
366
|
+
remote fetch cancellation follows the active call signal.
|
|
367
|
+
|
|
368
|
+
The older `mountWait`, `mountDownload`, `mountUpload` and `mountViewFile`
|
|
369
|
+
functions remain
|
|
370
|
+
intentional raw MCP adapters with their text-envelope behavior. Use them under
|
|
371
|
+
`rawTools` only when opting out of managed policy is deliberate; they share the
|
|
372
|
+
same neutral mechanics but do not gain lifecycle or hooks. The raw view-file
|
|
373
|
+
adapter preserves its content-only MCP envelope while using the same bounded
|
|
374
|
+
batch operation.
|
|
375
|
+
|
|
376
|
+
### Async-operation protocol
|
|
377
|
+
|
|
378
|
+
For a complete long-running operation, define the linked runtime-only surface
|
|
379
|
+
once. Stitchkit owns transport names, validation and wait mechanics; the
|
|
380
|
+
application still owns storage, execution, retries and domain states:
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
import {
|
|
384
|
+
createAsyncOperationSnapshotSchema,
|
|
385
|
+
defineAsyncOperation,
|
|
386
|
+
} from 'stitchkit/tools'
|
|
387
|
+
|
|
388
|
+
const id = z.object({ id: z.string() })
|
|
389
|
+
const state = z.object({
|
|
390
|
+
phase: z.enum(['pending', 'running', 'succeeded']),
|
|
391
|
+
value: z.string().optional(),
|
|
392
|
+
})
|
|
393
|
+
const snapshot = createAsyncOperationSnapshotSchema({
|
|
394
|
+
failure: z.object({ code: z.string() }),
|
|
395
|
+
progress: z.object({ current: z.number(), total: z.number() }),
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
const exportOperation = defineAsyncOperation({
|
|
399
|
+
mode: 'runtime-only',
|
|
400
|
+
name: 'export',
|
|
401
|
+
description: 'Export project data',
|
|
402
|
+
identity: { serviceName: 'exports', action: 'export', scope: 'user' },
|
|
403
|
+
startInput: z.object({ projectId: z.string() }),
|
|
404
|
+
id,
|
|
405
|
+
state,
|
|
406
|
+
snapshot,
|
|
407
|
+
start: ({ projectId }) => enqueueExport(projectId),
|
|
408
|
+
authorize: ({ id }, capability, ctx) => authorizeExport(id, capability, ctx),
|
|
409
|
+
inspect: ({ id }, ctx) => readExport(id, ctx.signal),
|
|
410
|
+
classify: (job) => ({ phase: job.phase }),
|
|
411
|
+
result: {
|
|
412
|
+
output: z.object({ value: z.string() }),
|
|
413
|
+
handler: (job) => ({ value: job.value ?? '' }),
|
|
414
|
+
},
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
const runtimeTools = exportOperation.runtimeTools
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
#### Durable application-owned execution
|
|
421
|
+
|
|
422
|
+
The executable reference
|
|
423
|
+
[`durable-async-operation-harness.ts`](../../packages/core/examples/tools/durable-async-operation-harness.ts)
|
|
424
|
+
shows the complete boundary behind that surface. It composes
|
|
425
|
+
`defineAsyncOperationContract`, `defineAsyncOperation`, `createApplication`,
|
|
426
|
+
`createBoundedAdmission`, managed shutdown and `createAgentToolFenceLifecycle`
|
|
427
|
+
around an injected store and provider.
|
|
428
|
+
|
|
429
|
+
The store transactionally owns the idempotency key **and normalized request
|
|
430
|
+
hash**. Reusing both returns the existing operation; reusing the key with a
|
|
431
|
+
different hash conflicts. Every mutation is an expected-revision CAS. Before an
|
|
432
|
+
external call, the application persists a unique attempt/effect key and marks
|
|
433
|
+
the dispatch `possibly-dispatched`; a lost response is therefore reconciled by
|
|
434
|
+
that key after restart and is never treated as permission to submit the effect
|
|
435
|
+
again. Provider acknowledgement, progress, cancellation intent, result and
|
|
436
|
+
artifact references remain durable application state.
|
|
437
|
+
|
|
438
|
+
Agent tool fencing and operation idempotency are separate guarantees. The fence
|
|
439
|
+
prevents a stale run owner from crossing an effect boundary; the transactional
|
|
440
|
+
idempotency record makes a repeated current call converge on one operation.
|
|
441
|
+
Neither replaces the other.
|
|
442
|
+
|
|
443
|
+
Stitchkit deliberately does **not** own the durable queue, operation database,
|
|
444
|
+
lease renewal, provider retry/reconciliation protocol, asset catalog or domain
|
|
445
|
+
states. The process-local application resource stops admission and drains
|
|
446
|
+
accepted work; unresolved durable records survive shutdown for the next
|
|
447
|
+
recovery pass. The packed consumer lane executes this composition from the
|
|
448
|
+
published package on Bun and Node.
|
|
449
|
+
|
|
450
|
+
Every follow-up repeats `authorize`; an opaque id is never authority. Aborting
|
|
451
|
+
`wait` only stops waiting and never calls optional domain `cancel`.
|
|
452
|
+
|
|
453
|
+
For a new HTTP surface, derive the canonical capability contract once. The
|
|
454
|
+
factory defines schemas and routes only; the application still supplies normal
|
|
455
|
+
handlers to `implement` and owns the job:
|
|
456
|
+
|
|
457
|
+
```ts
|
|
458
|
+
import { defineAsyncOperationContract } from 'stitchkit/tools'
|
|
459
|
+
import { z } from 'zod'
|
|
460
|
+
|
|
461
|
+
const operationId = z.object({ id: z.string() })
|
|
462
|
+
const operationSnapshot = z.object({
|
|
463
|
+
phase: z.enum(['pending', 'running', 'succeeded', 'failed', 'cancelled']),
|
|
464
|
+
})
|
|
465
|
+
|
|
466
|
+
const operations = defineAsyncOperationContract({
|
|
467
|
+
prefix: 'exports',
|
|
468
|
+
scope: 'user',
|
|
469
|
+
description: 'Export project data',
|
|
470
|
+
startInput: z.object({ projectId: z.string() }),
|
|
471
|
+
id: operationId,
|
|
472
|
+
snapshot: operationSnapshot,
|
|
473
|
+
cancel: true,
|
|
474
|
+
result: z.object({ downloadUrl: z.url() }),
|
|
475
|
+
})
|
|
476
|
+
|
|
477
|
+
// Pass operations.contract and ordinary handlers to implement(...).
|
|
478
|
+
// operations.capabilities/schemas/adapters are the canonical protocol metadata.
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
If an existing dedicated contract has a different wire shape — for example
|
|
482
|
+
`start` returns a snapshot while follow-ups accept separate envelopes — bind it
|
|
483
|
+
without casts or duplicate endpoints. Inline callbacks are contextually typed;
|
|
484
|
+
every returned id/input is parsed by the destination schema:
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
import { defineContract } from 'stitchkit/contract'
|
|
488
|
+
import { bindContractAsyncOperation } from 'stitchkit/tools'
|
|
489
|
+
|
|
490
|
+
const startOutput = z.object({ operation: operationId, acceptedAt: z.string() })
|
|
491
|
+
const statusInput = z.object({ operationId: z.string() })
|
|
492
|
+
const waitInput = z.object({ lookup: operationId })
|
|
493
|
+
|
|
494
|
+
const existing = defineContract({ prefix: 'exports' }, {
|
|
495
|
+
start: {
|
|
496
|
+
method: 'POST', path: '/', desc: 'Start export',
|
|
497
|
+
input: z.object({ projectId: z.string() }), output: startOutput,
|
|
498
|
+
},
|
|
499
|
+
status: {
|
|
500
|
+
method: 'POST', path: '/status', desc: 'Read export status',
|
|
501
|
+
input: statusInput, output: operationSnapshot,
|
|
502
|
+
},
|
|
503
|
+
wait: {
|
|
504
|
+
method: 'POST', path: '/wait', desc: 'Wait for export',
|
|
505
|
+
input: waitInput, output: operationSnapshot,
|
|
506
|
+
},
|
|
507
|
+
})
|
|
508
|
+
|
|
509
|
+
const operationHandlers = {
|
|
510
|
+
start: () => ({ operation: { id: 'example' }, acceptedAt: new Date().toISOString() }),
|
|
511
|
+
status: (): z.output<typeof operationSnapshot> => ({ phase: 'pending' }),
|
|
512
|
+
wait: (): z.output<typeof operationSnapshot> => ({ phase: 'succeeded' }),
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const bound = bindContractAsyncOperation({
|
|
516
|
+
mode: 'contract-backed',
|
|
517
|
+
binding: 'adapted',
|
|
518
|
+
contract: existing,
|
|
519
|
+
id: operationId,
|
|
520
|
+
capabilities: { start: 'start', status: 'status', wait: 'wait' },
|
|
521
|
+
adapters: {
|
|
522
|
+
idFromStart: (output) => output.operation,
|
|
523
|
+
inputFor: {
|
|
524
|
+
status: (id) => ({ operationId: id.id }),
|
|
525
|
+
wait: (id) => ({ lookup: id }),
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
handlers: operationHandlers,
|
|
529
|
+
})
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Direct binding remains the short form when start already returns the id and
|
|
533
|
+
every follow-up reuses that exact schema instance. Its ID schema must be
|
|
534
|
+
wire-stable: input and output types match and parsing has no transform,
|
|
535
|
+
coercion, default or overwrite. This also excludes same-type transforms because
|
|
536
|
+
the direct adapters would parse an already parsed ID again. Use adapted binding
|
|
537
|
+
and explicitly project the parsed ID back into each follow-up input. In both
|
|
538
|
+
modes the binder creates no router;
|
|
539
|
+
it returns the existing contract, handlers and protocol metadata for
|
|
540
|
+
application composition.
|
|
541
|
+
|
|
542
|
+
### Explicit raw SDK registration
|
|
543
|
+
|
|
544
|
+
`rawTools` is deliberately named as an escape hatch. A tool registered there
|
|
545
|
+
does **not** receive stitchkit schema policy, lifecycle, per-call context or
|
|
546
|
+
hooks. The built-in `mountViewFile`, `mountWait`, `mountDownload` and
|
|
547
|
+
`mountUpload` helpers remain raw for callers that choose that boundary; the
|
|
548
|
+
media helper fetches with SSRF and path-traversal defenses:
|
|
549
|
+
|
|
550
|
+
```ts
|
|
551
|
+
import { createMcpHandler, mountViewFile } from 'stitchkit/tools'
|
|
552
|
+
|
|
553
|
+
const handleMcp = createMcpHandler({
|
|
554
|
+
serverInfo: { name: 'my-app', version: '1.0.0' },
|
|
555
|
+
auth,
|
|
556
|
+
services: [service],
|
|
557
|
+
rawTools: (server) => mountViewFile(server, { files }),
|
|
558
|
+
})
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
Use raw registration only when opting out is intentional. For a protected
|
|
562
|
+
`view_file`, use `defineViewFileTool` in `runtimeTools`; it supplies the
|
|
563
|
+
canonical schemas, shared batch budget, structured partial failures and both
|
|
564
|
+
multimodal presenters. `resolveMedia` remains the single-item core for custom
|
|
565
|
+
operations whose contract intentionally differs.
|
|
566
|
+
|
|
567
|
+
## Introspecting the complete tool surface
|
|
568
|
+
|
|
569
|
+
Deferred tool search, name snapshots and boot diagnostics accept the same
|
|
570
|
+
object-shaped surface as the mounts. Contract operations are followed by
|
|
571
|
+
runtime definitions, matching mount order; exposure filters and collisions are
|
|
572
|
+
resolved by Stitchkit rather than by consumer code:
|
|
573
|
+
|
|
574
|
+
```ts
|
|
575
|
+
import {
|
|
576
|
+
buildToolManifest,
|
|
577
|
+
listToolNames,
|
|
578
|
+
summarizeTransports,
|
|
579
|
+
} from 'stitchkit/tools'
|
|
580
|
+
|
|
581
|
+
const surface = { services, runtimeTools: [renderPreview] }
|
|
582
|
+
|
|
583
|
+
const manifest = buildToolManifest({
|
|
584
|
+
...surface,
|
|
585
|
+
transport: 'AGENT',
|
|
586
|
+
flattenUnionInput: true,
|
|
587
|
+
})
|
|
588
|
+
|
|
589
|
+
const names = listToolNames(surface)
|
|
590
|
+
const summary = summarizeTransports(surface)
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
`buildToolManifest` returns the exact immutable presentation schema shown to
|
|
594
|
+
the selected MCP or Agent transport. It does not execute validation effects and
|
|
595
|
+
fails first on duplicate contract/runtime names. There is no runtime-only
|
|
596
|
+
manifest helper or public mount adapter: the framework owns merging and schema
|
|
597
|
+
projection.
|
|
598
|
+
|
|
599
|
+
Applications using Stitchkit's durable runtime can compose this manifest with
|
|
600
|
+
bounded per-run activation through `createDeferredAgentToolSurface` from
|
|
601
|
+
`stitchkit/agent-runtime`. It keeps selected calls as direct `mountAgent` tools
|
|
602
|
+
rather than routing them through a generic executor. Search receipts live in
|
|
603
|
+
ordinary durable tool-result history, so recovery restores activation and a
|
|
604
|
+
queued successor cannot inherit it. See
|
|
605
|
+
[Bounded deferred tool catalogs](./agent-runtime.md#bounded-deferred-tool-catalogs)
|
|
606
|
+
and ADR 0129. Raw `mountAgent`, `mountMcp` and `buildToolManifest` behavior is
|
|
607
|
+
unchanged.
|
|
608
|
+
|
|
609
|
+
`listToolNames` remains diagnostic and reports `kind: 'contract' | 'runtime'`
|
|
610
|
+
for every identity. `summarizeTransports` returns `contractServices`,
|
|
611
|
+
`runtimeTools`, aggregate `totals`, and a `sources` breakdown. Runtime tools
|
|
612
|
+
contribute only to MCP/Agent according to their `transports`; they never inflate
|
|
613
|
+
HTTP or CLI counts.
|
|
614
|
+
|
|
615
|
+
## Logging tool calls — `createToolLogger`
|
|
616
|
+
|
|
617
|
+
Every tool mount fires an `afterToolCall` hook. `createToolLogger` is a ready
|
|
618
|
+
preset for it — one line logs each call (ok / failed, duration, which endpoint,
|
|
619
|
+
keyed by the endpoint's stable `serviceName` / `key` identity):
|
|
620
|
+
|
|
621
|
+
```ts
|
|
622
|
+
import { createToolLogger } from 'stitchkit/tools'
|
|
623
|
+
|
|
624
|
+
mountMcp(server, services, { hooks: createToolLogger() })
|
|
625
|
+
// [tool] ok list_widgets (widgets.list) 12ms
|
|
626
|
+
// [tool] warn get_widget (widgets.get) NOT_FOUND 4ms
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
By default the line goes to `console.error` — **stderr, never stdout**. That is
|
|
630
|
+
deliberate: in a stdio-MCP server stdout is the JSON-RPC protocol channel, and a
|
|
631
|
+
log line written there corrupts the stream. If you pass your own `log`, keep it
|
|
632
|
+
off stdout for any stdio deployment.
|
|
633
|
+
|
|
634
|
+
Pass `log` to redirect the line, or `onRecord` to feed a metrics sink the
|
|
635
|
+
structured `ToolCallRecord`. That record carries `traceId` whenever an
|
|
636
|
+
observability context is active, so a tool call made inside an HTTP request
|
|
637
|
+
joins that request's log line on one key — see
|
|
638
|
+
[Observability](./observability.md). For a boot-time picture of what is exposed
|
|
639
|
+
where, `summarizeTransports({ services, runtimeTools })` returns the mixed
|
|
640
|
+
per-transport counts for you to log.
|
|
641
|
+
|
|
642
|
+
## One handler, three callers
|
|
643
|
+
|
|
644
|
+
A contract handler runs the same for an HTTP request, an MCP tool call and an
|
|
645
|
+
agent tool call. `ctx.source` (`'http'` · `'mcp'` · `'agent'`) tells it which —
|
|
646
|
+
the rest of the context (`params`, `input`, anything `context` injects) is
|
|
647
|
+
identical. Write the handler once; it serves every surface.
|