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,606 @@
|
|
|
1
|
+
# stitchkit/contract — stitchkit docs slice
|
|
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
|
+
|
|
6
|
+
Contains: Guide: Contracts (docs/guide/contracts.md) · API reference: `stitchkit/contract` (docs/api/reference.md)
|
|
7
|
+
|
|
8
|
+
Also read:
|
|
9
|
+
- see `llms/server.txt` for the Auth & errors guide
|
|
10
|
+
|
|
11
|
+
==============================================================================
|
|
12
|
+
# Guide: Contracts (docs/guide/contracts.md)
|
|
13
|
+
==============================================================================
|
|
14
|
+
|
|
15
|
+
# Contracts
|
|
16
|
+
|
|
17
|
+
A **contract** describes a set of operations once — method, path, schemas,
|
|
18
|
+
scope, which transports each is exposed on. From it stitchkit derives the HTTP
|
|
19
|
+
route, the MCP tool, the agent tool and the typed client. One declaration; the
|
|
20
|
+
surfaces cannot drift.
|
|
21
|
+
|
|
22
|
+
## `defineContract`
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { defineContract } from 'stitchkit'
|
|
26
|
+
|
|
27
|
+
const contract = defineContract(meta, endpoints)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- **`meta`** — `{ prefix: string }`, or `{ prefix: string, scope: string }` to
|
|
31
|
+
give every endpoint a default scope.
|
|
32
|
+
- **`endpoints`** — a map of `key → endpoint definition`. The key becomes the
|
|
33
|
+
client method name and the handler name.
|
|
34
|
+
|
|
35
|
+
`defineContract` throws at definition time if two endpoints declare the same
|
|
36
|
+
`tool.name` on the same transport — a tool-name clash is a bug, caught early.
|
|
37
|
+
|
|
38
|
+
## An endpoint
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
export const users = defineContract({ prefix: 'users' }, {
|
|
42
|
+
list: {
|
|
43
|
+
method: 'GET',
|
|
44
|
+
path: '/',
|
|
45
|
+
desc: 'List all users',
|
|
46
|
+
output: z.array(UserSchema),
|
|
47
|
+
},
|
|
48
|
+
create: {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
path: '/',
|
|
51
|
+
desc: 'Create a user',
|
|
52
|
+
input: CreateUserSchema,
|
|
53
|
+
output: UserSchema,
|
|
54
|
+
},
|
|
55
|
+
get: {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
path: '/:id',
|
|
58
|
+
desc: 'Get a user by id',
|
|
59
|
+
params: z.object({ id: z.string() }),
|
|
60
|
+
output: UserSchema,
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Fields
|
|
66
|
+
|
|
67
|
+
| Field | Required | Purpose |
|
|
68
|
+
|-------|----------|---------|
|
|
69
|
+
| `method` | yes | `GET` · `HEAD` · `POST` · `PUT` · `PATCH` · `DELETE` |
|
|
70
|
+
| `path` | yes | route path under the contract `prefix`; `:name` marks a path param and a named terminal `/*filePath` captures the remaining path |
|
|
71
|
+
| `desc` | yes | human description — also the MCP / agent tool description |
|
|
72
|
+
| `params` | no | Zod schema for **path params** (`:id`, …) |
|
|
73
|
+
| `input` | no | Zod schema for the **request body** (or query, for GET/DELETE) |
|
|
74
|
+
| `output` | no | Zod schema for the **response body**; its presence declares a JSON result (`null` is data, `undefined` is not) |
|
|
75
|
+
| `scope` | no | access scope for this endpoint — see [Auth & errors](./auth-and-errors.md) |
|
|
76
|
+
| `expose` | no | which transports carry this endpoint — see [below](#transports) |
|
|
77
|
+
| `tool` | no | what the tool surfaces (MCP / agent / CLI) read that HTTP does not — see [below](#tool-options-tool) |
|
|
78
|
+
| `multipart` | no | typed file fields, cardinality, delivery and upload policy — see [below](#file-uploads) |
|
|
79
|
+
| `maxJsonBodyBytes` | no | per-route JSON body ceiling; overrides the server default |
|
|
80
|
+
| `timeout` | no | per-endpoint client timeout in ms, for slow endpoints |
|
|
81
|
+
| `idempotent` | no | safe to call twice with the same input (like `PUT`/`DELETE`); a retrying transport reads it — see [Realtime](./realtime.md#bring-your-own-transport) |
|
|
82
|
+
| `meta` | no | opaque app metadata — read in hooks / on tool mounts, never in OpenAPI ([below](#endpoint-metadata-meta)) |
|
|
83
|
+
| `rawResponse` | no | the handler returns the `Response` itself — a download, a file, an SSE stream. HTTP-only, never a tool, no `output`. See [Raw-response endpoints](./server.md#raw-response-endpoints) |
|
|
84
|
+
| `rawBody` | no | retain original JSON text for a signed HTTP webhook. See [Signed JSON webhooks](./server.md#signed-json-webhooks) |
|
|
85
|
+
| `responseMeta` | no | make a typed-data endpoint HTTP-only, optionally declare its success status and expose `ctx.response.headers` — [Typed JSON response metadata](./server.md#typed-json-response-metadata) |
|
|
86
|
+
| `contentType` | no | documented response media type of a `rawResponse` endpoint (OpenAPI only) |
|
|
87
|
+
|
|
88
|
+
`HEAD` is an explicit HTTP-only operation, never an automatic alias for `GET`.
|
|
89
|
+
It must declare `rawResponse: true`; request body, `input`, multipart, `rawBody`,
|
|
90
|
+
typed `output` and tool exposure are rejected. The handler owns status and
|
|
91
|
+
headers, while Stitchkit guarantees an empty wire body even if the returned
|
|
92
|
+
`Response` accidentally contains one.
|
|
93
|
+
|
|
94
|
+
## `params` vs `input` vs `output`
|
|
95
|
+
|
|
96
|
+
`output` owns response presence across HTTP and tool transports. With a schema,
|
|
97
|
+
the handler must return a value that validates and can be represented as JSON;
|
|
98
|
+
a nullable schema may return `null`, but `undefined` is always a contract
|
|
99
|
+
violation. Without `output`, the handler is empty (`undefined`/`null`) and may
|
|
100
|
+
not return undeclared data. On HTTP this means a default `200` JSON response
|
|
101
|
+
with output and a default bodyless `204` without it.
|
|
102
|
+
|
|
103
|
+
The three schemas are distinct on purpose:
|
|
104
|
+
|
|
105
|
+
- **`params`** — values in the URL path. `path: '/:id'` infers
|
|
106
|
+
`{ id: string }` and materializes the same Zod string schema for HTTP, OpenAPI,
|
|
107
|
+
MCP, Agent and CLI. Declare `params: z.object({ id: z.uuid() })` only when the
|
|
108
|
+
path value needs validation or coercion; an explicit schema must cover every
|
|
109
|
+
name in the path. The client takes params from the call argument and
|
|
110
|
+
substitutes them into the URL. A terminal wildcard is explicitly named:
|
|
111
|
+
`path: '/:slug/*filePath'` matches both
|
|
112
|
+
`/foo/page` and `/foo/a/b`; the handler reads `ctx.params.filePath` as
|
|
113
|
+
`'page'` or `'a/b'`. Bare `/*`, invalid/duplicate names and a wildcard before
|
|
114
|
+
the final segment fail at contract definition.
|
|
115
|
+
- **`input`** — the request payload. For `POST` / `PUT` / `PATCH` it is the JSON
|
|
116
|
+
body; for `GET` / `DELETE` it is the query string. The handler reads it as
|
|
117
|
+
`ctx.input`.
|
|
118
|
+
- **`output`** — the response shape. When set, the client parses the response
|
|
119
|
+
through it; the handler's return value is type-checked against it.
|
|
120
|
+
|
|
121
|
+
The typed client merges `params` and `input` into one argument object — the
|
|
122
|
+
caller passes a single flat object, the client routes each field to the path or
|
|
123
|
+
the body.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
// path: '/:id' infers params: { id: string }; input: { text }
|
|
127
|
+
await api.update({ id: '1', text: 'new' }) // PUT /users/1 body: { text: 'new' }
|
|
128
|
+
|
|
129
|
+
// path: '/:slug/*filePath', params: { slug, filePath }
|
|
130
|
+
await api.app({ slug: 'foo', filePath: 'a/b' }) // GET /apps/foo/a/b
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Input vs. output types
|
|
134
|
+
|
|
135
|
+
For the client, an endpoint's argument type is the schema's **input** type
|
|
136
|
+
(pre-parse). A field with `.default()` is therefore optional for the caller but
|
|
137
|
+
present (required) in the handler's parsed `ctx.input`. The contract handles the
|
|
138
|
+
two type views; you do not.
|
|
139
|
+
|
|
140
|
+
### Query input (`GET` / `DELETE`)
|
|
141
|
+
|
|
142
|
+
`GET` and `DELETE` carry their input as the **query string**, and a query
|
|
143
|
+
string can only encode flat values. An input field on these verbs must be a
|
|
144
|
+
`string`, `number`, `boolean`, or an array of `string` / `number` (repeated
|
|
145
|
+
query keys). A **nested object has no canonical query encoding** — the typed
|
|
146
|
+
client throws on one instead of sending a silently incomplete request:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
// input: z.object({ q: z.string(), filter: z.object({ … }) }) on a GET
|
|
150
|
+
await api.search({ q: 'x', filter: { status: 'active' } })
|
|
151
|
+
// ✗ throws: GET /: input field "filter" is a nested object — it cannot travel
|
|
152
|
+
// as a query parameter
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Flatten the field (`status: 'active'`) or move the operation to a body verb
|
|
156
|
+
(`POST`). Remember the server parses query values from **strings** — use
|
|
157
|
+
`z.coerce.number()` for numbers and `z.stringbool()` for booleans in a
|
|
158
|
+
query-input schema (not `z.coerce.boolean()`, which is `Boolean(str)`, so
|
|
159
|
+
`'false'` would become `true`).
|
|
160
|
+
|
|
161
|
+
## Transports
|
|
162
|
+
|
|
163
|
+
By default an endpoint is exposed on **every** surface — HTTP, MCP and agent
|
|
164
|
+
tools. Narrow it with `expose`:
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
{
|
|
168
|
+
method: 'POST', path: '/', desc: 'Internal sync',
|
|
169
|
+
expose: ['HTTP'], // HTTP only — not an MCP or agent tool
|
|
170
|
+
}
|
|
171
|
+
{
|
|
172
|
+
method: 'GET', path: '/search', desc: 'Search the catalog',
|
|
173
|
+
expose: ['HTTP', 'MCP', 'AGENT'], // explicit — all three
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
- `expose: ['HTTP']` — HTTP only. The endpoint never becomes a tool.
|
|
178
|
+
- `expose: ['MCP', 'AGENT']` — a tool only; no HTTP route.
|
|
179
|
+
- omit `expose` — all transports.
|
|
180
|
+
|
|
181
|
+
For a curated or security-sensitive tool surface, opt into explicit tool
|
|
182
|
+
exposure at the scoped factory:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
const { defineContract } = createContractFactory<AppScope>({
|
|
186
|
+
toolExposure: 'explicit',
|
|
187
|
+
})
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
With this policy, omitting `expose` materializes `['HTTP']` on the returned
|
|
191
|
+
endpoint. MCP, Agent and CLI then require an explicit endpoint array. The plain
|
|
192
|
+
factory and `defineContract` keep the default-on behaviour above.
|
|
193
|
+
|
|
194
|
+
Consequently, `expose: ['HTTP']` is redundant inside a factory configured with
|
|
195
|
+
`toolExposure: 'explicit'`: omit it unless the explicit spelling is useful to a
|
|
196
|
+
local reader. Add `MCP`, `AGENT` or `CLI` only on endpoints that intentionally
|
|
197
|
+
join those surfaces.
|
|
198
|
+
|
|
199
|
+
Tool transports (`MCP`, `AGENT`) skip four kinds of endpoint automatically:
|
|
200
|
+
`multipart` (a file upload is not a tool call),
|
|
201
|
+
[`rawResponse`](./server.md#raw-response-endpoints) (its answer is bytes, which
|
|
202
|
+
a tool result cannot carry — it would serialize to `{}`),
|
|
203
|
+
[`responseMeta`](./server.md#typed-json-response-metadata) (outbound HTTP
|
|
204
|
+
headers have no meaning on a tool call) and `rawBody` (HTTP-only by
|
|
205
|
+
construction).
|
|
206
|
+
|
|
207
|
+
## Tool options (`tool`)
|
|
208
|
+
|
|
209
|
+
Everything a tool surface reads that HTTP does not lives in one group, so an
|
|
210
|
+
endpoint that can never be a tool (a raw response, a stream, `responseMeta`,
|
|
211
|
+
`rawBody`, `HEAD`) refuses all of it with one key:
|
|
212
|
+
|
|
213
|
+
| `tool.` | Purpose |
|
|
214
|
+
|---------|---------|
|
|
215
|
+
| `name` | explicit tool name (default: a verb-aware derivation, below) |
|
|
216
|
+
| `view` | a different call or answer on MCP / agent / CLI — input defaults alone, or with a projected, separately validated output; declared only with `withToolView` — see [MCP & agents](./mcp-and-agents.md#a-different-answer-for-tools--withtoolview) |
|
|
217
|
+
| `ui` | MCP Apps widget for the tool's results — see [MCP & agents](./mcp-and-agents.md) |
|
|
218
|
+
| `annotations` | MCP behavioural hints (`readOnlyHint`, `destructiveHint`, `title`, …) |
|
|
219
|
+
| `mcp` | elicitation rounds asked before the handler runs (`inputRequired`) |
|
|
220
|
+
|
|
221
|
+
`expose` stays outside the group: it chooses transports, HTTP included.
|
|
222
|
+
Setting `tool` on an endpoint with no tool transport — `expose: ['HTTP']`, or an
|
|
223
|
+
omitted `expose` under a factory with `toolExposure: 'explicit'` — throws at
|
|
224
|
+
definition time. The pre-0.94 top-level keys (`toolName`, `toolView`, `ui`,
|
|
225
|
+
`annotations`, `mcp`) are refused by name, with where each one went.
|
|
226
|
+
|
|
227
|
+
### `tool.name`
|
|
228
|
+
|
|
229
|
+
When an endpoint is exposed as a tool, its name defaults to a verb-aware
|
|
230
|
+
derivation from the method key + prefix (`users` + `create` ⇒ `create_user`,
|
|
231
|
+
`users` + `list` ⇒ `list_users`). Set `tool.name` for an explicit, stable name:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
{ method: 'POST', path: '/', desc: 'Create a user', tool: { name: 'create_user' }, /* … */ }
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Every tool name — derived or explicit — must match `[a-zA-Z0-9_-]` and be at
|
|
238
|
+
most 64 characters**, the character class every major provider accepts.
|
|
239
|
+
|
|
240
|
+
Derivation normalises **per half**, and the halves differ (→ ADR 0035). The
|
|
241
|
+
*service* half collapses everything outside `[a-zA-Z0-9_]` to `_`, hyphen
|
|
242
|
+
included: `bot-status` + `get` ⇒ `get_bot_status`, `admin/analytics` + `get` ⇒
|
|
243
|
+
`get_admin_analytics`. The *method* half keeps its hyphen and normalises only
|
|
244
|
+
what no provider accepts (`[^a-zA-Z0-9_-]`), because a hyphenated method key has
|
|
245
|
+
always shipped a legal name that a client config may already pin: `notes` +
|
|
246
|
+
`get-user` ⇒ `get-user_notes`. An explicit `tool.name` is taken verbatim.
|
|
247
|
+
|
|
248
|
+
A prefix with *no* usable character at all (`'///'`, `'_'`, a fully non-ASCII
|
|
249
|
+
prefix) and any explicit `tool.name` outside the accepted class **throw at
|
|
250
|
+
mount**. An unusable prefix is rescued by setting an explicit `tool.name` — the
|
|
251
|
+
prefix then never enters the name. An over-long name is fixed by a shorter
|
|
252
|
+
explicit `tool.name` (or a shorter prefix / method key). Nothing downstream checks this: the provider rejects the whole
|
|
253
|
+
request, so one bad name takes every tool of that mount down with it.
|
|
254
|
+
→ [ADR 0035](../decisions/0035-tool-name-derivation-and-validation.md).
|
|
255
|
+
|
|
256
|
+
## Endpoint metadata (`meta`)
|
|
257
|
+
|
|
258
|
+
A contract can declare a **default** `meta` that every endpoint inherits, and an
|
|
259
|
+
endpoint's own keys are **shallow-merged over** it:
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
defineContract({ prefix: 'admin', meta: { public: true } }, {
|
|
263
|
+
list: { method: 'GET', path: '/', desc: 'List', /* meta → { public: true } */ },
|
|
264
|
+
purge: { method: 'POST', path: '/purge', desc: 'Purge', meta: { rateTier: 2 } },
|
|
265
|
+
// meta → { public: true, rateTier: 2 }
|
|
266
|
+
})
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
One level deep — no deep merge. To **opt an endpoint out** of an inherited key,
|
|
270
|
+
declare it with an explicit `undefined`:
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
defineContract({ prefix: 'leads', meta: { page: 'LEADS' } }, {
|
|
274
|
+
// Public website form inside an otherwise admin-gated contract:
|
|
275
|
+
submit: { method: 'POST', path: '/', desc: 'Submit', meta: { page: undefined } },
|
|
276
|
+
// meta → { page: undefined } — gate off
|
|
277
|
+
list: { method: 'GET', path: '/list', desc: 'List' }, // meta → { page: 'LEADS' }
|
|
278
|
+
})
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The key stays *present* with value `undefined`, so read `meta` by **value**
|
|
282
|
+
(`method.meta?.page`), never by key membership. `expose` deliberately has **no**
|
|
283
|
+
contract-level equivalent
|
|
284
|
+
(→ [ADR 0036](../decisions/0036-contract-level-meta.md)).
|
|
285
|
+
|
|
286
|
+
`meta` is an **opaque, app-defined** bag the core attaches no meaning to — the
|
|
287
|
+
same escape-hatch spirit as `scope` being a free string ([ADR 0002](../decisions/0002-generic-core.md) /
|
|
288
|
+
[ADR 0021](../decisions/0021-endpoint-meta-passthrough.md)). Declare app concerns
|
|
289
|
+
the generic core does not model — a feature gate, a rate tier, a cache hint, a
|
|
290
|
+
doc/owner tag — right next to the endpoint:
|
|
291
|
+
|
|
292
|
+
```ts
|
|
293
|
+
broadcast: {
|
|
294
|
+
method: 'POST', path: '/broadcast', desc: 'Send a broadcast',
|
|
295
|
+
input: BroadcastInput, output: Broadcast,
|
|
296
|
+
meta: { requiredFeature: 'broadcasts' }, // opaque to the core
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
It rides through to `MethodDef.meta`, readable in lifecycle hooks (the second
|
|
301
|
+
argument is the endpoint) and on tool mounts. The consumer narrows the type when
|
|
302
|
+
reading:
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
beforeHandle: (ctx, endpoint) => {
|
|
306
|
+
const feature = endpoint.meta?.requiredFeature
|
|
307
|
+
if (typeof feature === 'string' && !ctx.user?.features?.includes(feature)) {
|
|
308
|
+
throw forbidden('feature not enabled')
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
`meta` is **app-private** — it is never serialized into the OpenAPI document. It
|
|
314
|
+
can still *drive* generation: `generateOpenApiDocument`'s `includeMethod` reads
|
|
315
|
+
it to curate a public spec (e.g. `meta: { public: true }`), without ever emitting
|
|
316
|
+
`meta` itself — see [Curating the spec](./server.md#curating-the-spec--includemethod).
|
|
317
|
+
|
|
318
|
+
> **Declare a meta type as a `type`, an inline literal, or with `satisfies` — not
|
|
319
|
+
> an `interface`.** A TS `interface` has no implicit index signature (it can be
|
|
320
|
+
> augmented by declaration merging), so it is not assignable to `meta`'s
|
|
321
|
+
> `Record<string, unknown>` — and on the overloaded `defineContract` the error
|
|
322
|
+
> misleadingly surfaces as a `scope` mismatch. Use
|
|
323
|
+
> `type EndpointMeta = { requiredFeature?: PlanFeature }`, or
|
|
324
|
+
> `meta: { requiredFeature: 'x' } satisfies EndpointMeta`. The read side is
|
|
325
|
+
> unchanged — `endpoint.meta?.x` is `unknown`, narrow it in the hook.
|
|
326
|
+
|
|
327
|
+
## File uploads
|
|
328
|
+
|
|
329
|
+
`multipart` is the single source of truth for file fields, cardinality and
|
|
330
|
+
transport-level upload policy. Buffered delivery (the default) gives the
|
|
331
|
+
handler a typed `ctx.files` map:
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
uploadAttachments: {
|
|
335
|
+
method: 'POST',
|
|
336
|
+
path: '/:answerId/attachments',
|
|
337
|
+
desc: 'Upload attachments',
|
|
338
|
+
params: AnswerIdParamsSchema,
|
|
339
|
+
input: UploadMetadataSchema,
|
|
340
|
+
output: UploadedAttachmentsSchema,
|
|
341
|
+
multipart: {
|
|
342
|
+
maxRequestBytes: 120 * 1024 * 1024,
|
|
343
|
+
maxFieldBytes: 64 * 1024,
|
|
344
|
+
files: {
|
|
345
|
+
cover: {
|
|
346
|
+
required: false,
|
|
347
|
+
maxBytes: 10 * 1024 * 1024,
|
|
348
|
+
contentTypes: ['image/*'],
|
|
349
|
+
},
|
|
350
|
+
attachments: {
|
|
351
|
+
multiple: true,
|
|
352
|
+
maxFiles: 8,
|
|
353
|
+
maxBytes: 20 * 1024 * 1024,
|
|
354
|
+
contentTypes: ['image/*', 'application/pdf'],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
```ts
|
|
362
|
+
uploadAttachments: ({ params, input, files }) => {
|
|
363
|
+
files.cover // File | undefined
|
|
364
|
+
files.attachments // File[] in multipart order
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
`required` defaults to `true`; `multiple` defaults to `false`. `maxFiles` is
|
|
369
|
+
valid only for a multiple field. `contentTypes` accepts exact media types and
|
|
370
|
+
validated type wildcards such as `image/*`; it checks the declared multipart
|
|
371
|
+
header, not file contents. Content sniffing, antivirus and storage policy stay
|
|
372
|
+
in the application.
|
|
373
|
+
|
|
374
|
+
The typed client accepts a web `Blob`/`File` or React Native
|
|
375
|
+
`{ uri, name, type }` descriptor for each single value, and arrays for multiple
|
|
376
|
+
fields. It appends repeated multipart field names in stable order. Undeclared
|
|
377
|
+
file fields, duplicate single fields, missing required fields and wrong part
|
|
378
|
+
kinds fail before the handler. Multipart endpoints are HTTP-only.
|
|
379
|
+
|
|
380
|
+
Set `delivery: 'stream'` when files must go directly to consumer-owned storage
|
|
381
|
+
without becoming `File` objects in framework memory. The contract descriptor
|
|
382
|
+
stays the same; the implementation supplies receivers with Web streams. See
|
|
383
|
+
[HTTP server → multipart](./server.md#multipart).
|
|
384
|
+
|
|
385
|
+
### Multipart text fields
|
|
386
|
+
|
|
387
|
+
Any non-file fields sent alongside the file are validated by the endpoint's
|
|
388
|
+
`input` schema. A multipart text field is **always a string** (per the spec) —
|
|
389
|
+
the schema owns its type, exactly as with [query input](#query-input-get--delete):
|
|
390
|
+
|
|
391
|
+
```ts
|
|
392
|
+
input: z.object({
|
|
393
|
+
id: z.string(), // an id like '33111715' stays a string
|
|
394
|
+
count: z.coerce.number(), // '5' → 5
|
|
395
|
+
active: z.stringbool(), // 'true' → true, 'false' → false
|
|
396
|
+
meta: z.preprocess((v) => JSON.parse(String(v)), MetaSchema), // opt a field into JSON
|
|
397
|
+
})
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
The content is never sniffed to guess a type — a field is a string until the
|
|
401
|
+
schema coerces it. Send a JSON blob as a stringified field and parse it with
|
|
402
|
+
`z.preprocess`; do not rely on the framework to auto-decode it.
|
|
403
|
+
|
|
404
|
+
## Pagination
|
|
405
|
+
|
|
406
|
+
Every list endpoint should return the cursor envelope — one shape, one infinite-
|
|
407
|
+
query helper:
|
|
408
|
+
|
|
409
|
+
```ts
|
|
410
|
+
import { paginatedSchema } from 'stitchkit'
|
|
411
|
+
|
|
412
|
+
feed: {
|
|
413
|
+
method: 'GET',
|
|
414
|
+
path: '/',
|
|
415
|
+
desc: 'Paginated feed',
|
|
416
|
+
input: z.object({ limit: z.coerce.number().default(20) }),
|
|
417
|
+
output: paginatedSchema(PostSchema), // { items: Post[], nextCursor: string | null }
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
`paginatedSchema(itemSchema)` produces `{ items, nextCursor }`. The page size
|
|
422
|
+
default lives in the contract (`limit`'s `.default()`), never on the client —
|
|
423
|
+
the two cannot diverge. The client side is [`createCursorQuery`](./client.md#cursor-pagination).
|
|
424
|
+
|
|
425
|
+
The **format** of `nextCursor` is the server's choice — keep it opaque. For the
|
|
426
|
+
usual keyset cursor (resume after the last row's `(sortValue, id)`), encode it
|
|
427
|
+
with **`encodeCursor`** and read it back with **`decodeCursor`** (Zod-validated;
|
|
428
|
+
a missing or garbage cursor decodes to `null`, i.e. "start from the top"):
|
|
429
|
+
|
|
430
|
+
```ts
|
|
431
|
+
import { encodeCursor, decodeCursor } from 'stitchkit'
|
|
432
|
+
|
|
433
|
+
const Cursor = z.object({ v: z.string(), id: z.string() }) // your keyset shape
|
|
434
|
+
|
|
435
|
+
const after = decodeCursor(ctx.input.cursor, Cursor) // { v, id } | null
|
|
436
|
+
const rows = await db.list({ after, take: limit + 1 }) // your keyset WHERE
|
|
437
|
+
const nextCursor =
|
|
438
|
+
rows.length > limit ? encodeCursor({ v: last.createdAt, id: last.id }) : null
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
The codec is base64url over UTF-8 (`btoa`/`atob`, not Node `Buffer`) — server,
|
|
442
|
+
client and browser safe, and a non-ASCII sort value round-trips. The keyset
|
|
443
|
+
WHERE clause is yours (it's ORM-specific); stitchkit only carries the string.
|
|
444
|
+
|
|
445
|
+
## Scope
|
|
446
|
+
|
|
447
|
+
An endpoint may carry a `scope` string; the contract `meta.scope` is the default
|
|
448
|
+
for every endpoint that declares none. Scopes are free strings — the framework
|
|
449
|
+
attaches no meaning, your auth hook does. See
|
|
450
|
+
[Auth & errors](./auth-and-errors.md).
|
|
451
|
+
|
|
452
|
+
A plain `defineContract` defaults a missing `scope` to `'public'` — forget it and
|
|
453
|
+
the endpoint is public (fail-open). If every contract in your app must be scoped,
|
|
454
|
+
`createContractFactory` binds your scope vocabulary once and makes `scope`
|
|
455
|
+
**required and typed** — a missing or mistyped scope is a compile error:
|
|
456
|
+
|
|
457
|
+
```ts
|
|
458
|
+
// app: one line, once
|
|
459
|
+
export const { defineContract } = createContractFactory<'public' | 'user' | 'admin'>()
|
|
460
|
+
|
|
461
|
+
// scope is mandatory, checked against the union and retained as the 'user' literal
|
|
462
|
+
export const users = defineContract({ prefix: 'users', scope: 'user' }, { … })
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
The vocabulary is yours; each returned `ScopedContractDef` retains its concrete
|
|
466
|
+
scope literal as a required `meta.scope` field, so scope-aware registries select
|
|
467
|
+
the exact config without `NonNullable` or another wrapper. Plain `ContractDef`
|
|
468
|
+
keeps optional scope because ordinary `defineContract` still supports its
|
|
469
|
+
default-public overload.
|
|
470
|
+
|
|
471
|
+
The union covers **per-endpoint overrides too**, not just the contract's scope —
|
|
472
|
+
that is where typos are densest, and one there used to compile and then fail
|
|
473
|
+
closed at request time (`[stitchkit] auth: no rule for scope "…"`):
|
|
474
|
+
|
|
475
|
+
```ts
|
|
476
|
+
defineContract({ prefix: 'posts', scope: 'user' }, {
|
|
477
|
+
drop: { method: 'DELETE', path: '/:id', desc: 'Drop', scope: 'admn', … },
|
|
478
|
+
// ^ compile error, and TypeScript
|
|
479
|
+
// suggests 'admin'
|
|
480
|
+
})
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
Contracts built with plain `defineContract` are unaffected — their endpoint
|
|
484
|
+
`scope` stays a free string.
|
|
485
|
+
|
|
486
|
+
## One source of truth
|
|
487
|
+
|
|
488
|
+
A contract is plain data — no classes, no decorators, no codegen. It is imported
|
|
489
|
+
by the server (to `implement`), by the client (to `createClient`) and by the
|
|
490
|
+
tool layer (to `mountMcp` / `mountAgent`). Change an endpoint and every surface
|
|
491
|
+
is re-typed by the compiler at once.
|
|
492
|
+
|
|
493
|
+
==============================================================================
|
|
494
|
+
# API reference: `stitchkit/contract` (docs/api/reference.md)
|
|
495
|
+
==============================================================================
|
|
496
|
+
|
|
497
|
+
## `stitchkit/contract`
|
|
498
|
+
|
|
499
|
+
The contract layer alone — browser-and-server safe. All of this is also exported
|
|
500
|
+
from the root `stitchkit`.
|
|
501
|
+
|
|
502
|
+
### Contract
|
|
503
|
+
|
|
504
|
+
| Export | Kind | Summary |
|
|
505
|
+
|--------|------|---------|
|
|
506
|
+
| `defineContract` | function | declare a contract — [guide](../guide/contracts.md#definecontract) |
|
|
507
|
+
| `createContractFactory` | function | a `defineContract` whose scope — on the contract **and** on any endpoint override — is required and held to your union, retaining each concrete literal — [guide](../guide/contracts.md#scope) |
|
|
508
|
+
| `ContractFactoryConfig` | _type_ | optional scoped-factory policy, including explicit tool exposure |
|
|
509
|
+
| `ContractFactoryToolExposure` | _type_ | `'explicit'` — omitted endpoint exposure materializes as HTTP-only |
|
|
510
|
+
| `ExplicitScopedDefineContract` | _type_ | scoped factory authoring with explicit tool opt-in |
|
|
511
|
+
| `ExplicitToolExposureEndpoints` | _type_ | endpoint map after missing exposure is materialized as `['HTTP']` |
|
|
512
|
+
| `FactoryScopedEndpoint` | _type_ | an endpoint authored through the factory — its own `scope` override is held to the same union |
|
|
513
|
+
| `ScopedContractDef` | _type_ | a factory-defined contract whose `meta.scope` is the required concrete literal |
|
|
514
|
+
| `ScopedDefineContract` | _type_ | the `defineContract` `createContractFactory` returns — endpoint `scope` overrides join the union |
|
|
515
|
+
| `ALL_TRANSPORTS` | constant | `['HTTP', 'MCP', 'AGENT', 'CLI']` |
|
|
516
|
+
| `TOOL_TRANSPORTS` / `ToolTransport` | constant / _type_ | `['MCP', 'AGENT', 'CLI']` — the transports a model or tool client reads; the one name for a tool surface everywhere (runtime-tool `transports`, invoker, collector, connections) |
|
|
517
|
+
| `ContractDef` | _type_ | a defined contract |
|
|
518
|
+
| `PathParams` | _type_ | infer named `:segments` and a terminal `*wildcard` from a path literal as string params |
|
|
519
|
+
| `ContractMeta` | _type_ | a contract's `prefix` + optional `scope` and `meta` (a default every endpoint shallow-merges over) |
|
|
520
|
+
| `EndpointDef` | _type_ | a single endpoint definition; `output` declares JSON response presence (`null` is data, `undefined` is invalid); `safelistedBody: true` admits the JSON body as `text/plain` from an allow-listed `Origin` — [guide](../guide/server.md#safelisted-request-bodies-beacons) |
|
|
521
|
+
| `withToolView` | function | declare an endpoint's call and answer on the tool surface (MCP, AGENT, CLI): input `defaults`, and optionally a view `output` and a `project`, typed against the endpoint's own schemas; HTTP keeps the full answer — [guide](../guide/mcp-and-agents.md#a-different-answer-for-tools--withtoolview) |
|
|
522
|
+
| `EndpointToolOptions` | _type_ | an endpoint's `tool` group — `name`, `view`, `ui`, `annotations`, `mcp`: what the tool surfaces read that HTTP does not |
|
|
523
|
+
| `EndpointToolView` | _type_ | the stored shape of a tool view (`MethodDef.toolView`) |
|
|
524
|
+
| `DeclaredToolView` | _type_ | a tool view as `withToolView` produces it — the only form `tool.view` accepts |
|
|
525
|
+
| `WithToolView` | _type_ | the endpoint `withToolView` returns: its own tool options plus the declared view in `tool.view` — name it when a helper returns such an endpoint |
|
|
526
|
+
| `DefaultsOnlyToolView` / `ProjectedToolView` / `ReshapedToolView` / `SlicedToolView` | _type_ | the four forms `withToolView` accepts: input `defaults` alone with the full answer, own schema + `project`, `project` inside the full schema, a slice by `output` |
|
|
527
|
+
| `ToolViewCall` | _type_ | what `project` is told besides the full result: the parsed `input` and the `source` |
|
|
528
|
+
| `ToolViewSliceMismatch` | _type_ | the compile-time refusal of a slice whose schema does not accept the full output |
|
|
529
|
+
| `ToolViewNeedsToolTransport` | _type_ | the compile-time refusal of a view on an `expose: ['HTTP']` endpoint |
|
|
530
|
+
| `EndpointStreamDescriptor` | _type_ | HTTP-only schema-derived stream declaration: item schema, envelope/item framing, stream-end/terminal completion, NDJSON/SSE encoding and frame/lifetime/heartbeat/idle bounds — [guide](../guide/server.md#contract-first-streams) |
|
|
531
|
+
| `HeadEndpointDef` | _type_ | explicit HTTP-only, bodyless `HEAD` endpoint definition |
|
|
532
|
+
| `EndpointResponseMeta` | _type_ | static success metadata declared by an HTTP-only typed-data endpoint |
|
|
533
|
+
| `ResponseMetadata` | _type_ | per-request outbound collector exposed as `ctx.response` only for a `responseMeta` endpoint |
|
|
534
|
+
| `HttpSuccessStatus` | _type_ | supported declared 2xx success statuses |
|
|
535
|
+
| `BodyHttpSuccessStatus` | _type_ | supported 2xx statuses excluding bodyless 204/205 |
|
|
536
|
+
| `HttpMethod` | _type_ | `GET \| HEAD \| POST \| PUT \| PATCH \| DELETE` |
|
|
537
|
+
| `Transport` | _type_ | `HTTP \| MCP \| AGENT \| CLI` |
|
|
538
|
+
| `TransportSource` | _type_ | `http \| mcp \| agent \| cli` — the value of `ctx.source` |
|
|
539
|
+
| `RuntimeContext` | _type_ | the loose context seen by transport and hooks, including optional typed `mcp` metadata |
|
|
540
|
+
| `HandlerContext` | _type_ | the typed context seen by a handler, including optional typed `mcp` metadata |
|
|
541
|
+
| `McpCallContext` | _type_ | validated metadata for the active managed MCP call (`era`, method, tool, client and multi-round fields) |
|
|
542
|
+
| `McpClientInfo` | _type_ | self-reported MCP host name/version; attribution only, never application identity |
|
|
543
|
+
| `McpInputRequiredCall` | _type_ | the parsed `params` / `input` an elicitation resolver chooses its questions from |
|
|
544
|
+
| `McpInputRequiredResolver` | _type_ | `mcp.inputRequired` as a function of the parsed arguments — returns the rounds for this call, or none |
|
|
545
|
+
| `McpProgressUpdate` | _type_ | one mid-call progress update — `message`, and `progress`/`total` when the operation knows a scale |
|
|
546
|
+
| `McpReportProgress` | _type_ | `ctx.reportProgress` — sends one update to the host that asked for progress; a no-op when none did, and never throws |
|
|
547
|
+
| `McpRoundOutcome` | _type_ | managed multi-round attempt outcome |
|
|
548
|
+
| `EndpointHandlerContext` | _type_ | one endpoint handler's fully inferred params, input, files and runtime context |
|
|
549
|
+
| `EndpointFn` | _type_ | the call signature of one client method |
|
|
550
|
+
| `TypedClient` | _type_ | the full typed client for a contract |
|
|
551
|
+
| `TypedHttpClient` | _type_ | the typed client, HTTP endpoints only (`= ScopedHttpClient<C, unknown>`) |
|
|
552
|
+
| `ScopedHttpClient` | _type_ | a client whose `stripPrefixKeys` become required args ([guide](../guide/multi-tenant.md)) |
|
|
553
|
+
| `ScopedEndpointFn` | _type_ | one method's signature with the consumed keys folded in |
|
|
554
|
+
| `TypedUrlBuilder` | _type_ | one contract's HTTP endpoints as synchronous, method-aware URL functions |
|
|
555
|
+
| `ScopedUrlBuilder` | _type_ | a URL builder whose scoped-prefix keys are required method arguments |
|
|
556
|
+
| `ScopedUrlFn` | _type_ | one URL method's signature with scoped-prefix keys folded in |
|
|
557
|
+
| `MultipartFile` | _type_ | a `multipart` file field — `Blob \| FileDescriptor` |
|
|
558
|
+
| `FileDescriptor` | _type_ | a React Native / Expo file — `{ uri, name, type }` |
|
|
559
|
+
| `MultipartDescriptor` | _type_ | file fields, cardinality, delivery and request/text limits |
|
|
560
|
+
| `MultipartFilePolicy` | _type_ | required/multiple, per-file bytes/count and declared MIME policy |
|
|
561
|
+
| `MultipartBufferedFiles` | _type_ | `File` map inferred from a multipart descriptor |
|
|
562
|
+
| `EndpointToolAnnotations` | _type_ | MCP behavioural hints on an endpoint (`readOnlyHint` / `destructiveHint` / `title`) |
|
|
563
|
+
| `EndpointUiMeta` | _type_ | MCP Apps widget metadata on an endpoint |
|
|
564
|
+
| `EndpointMcpInputRequired` | _type_ | typed MCP multi-round input request (`key`, message and Zod object schema) |
|
|
565
|
+
| `EndpointMcpPolicy` | _type_ | MCP-only endpoint policy containing `inputRequired` |
|
|
566
|
+
|
|
567
|
+
### Errors
|
|
568
|
+
|
|
569
|
+
| `ErrorVocabularyCode` / `ErrorVocabularyMapping` / `VocabularyCodeMap` | _type_ | application-code union, partial/exhaustive framework mapping input and resolved wire map returned by `defineErrors` |
|
|
570
|
+
| Export | Kind | Summary |
|
|
571
|
+
|--------|------|---------|
|
|
572
|
+
| `AppError` | class | the framework error — `code` / `status` / `details` / `hint` |
|
|
573
|
+
| `ErrorEnvelope` | _type_ | the JSON shape of an error response |
|
|
574
|
+
| `notFound` | function | throw `404 NOT_FOUND` — [guide](../guide/auth-and-errors.md#throwing-errors) |
|
|
575
|
+
| `badRequest` | function | throw `400 BAD_REQUEST` |
|
|
576
|
+
| `unauthorized` | function | throw `401 UNAUTHORIZED` |
|
|
577
|
+
| `forbidden` | function | throw `403 FORBIDDEN` |
|
|
578
|
+
| `conflict` | function | throw `409 CONFLICT` |
|
|
579
|
+
| `rateLimited` | function | throw `429 RATE_LIMITED` |
|
|
580
|
+
| `appError` | function | throw an `AppError` for any code |
|
|
581
|
+
| `defineErrors` | function | declare immutable domain error definitions → typed `AppError` constructors, codes and schemas — [guide](../guide/auth-and-errors.md#domain-errors--defineerrors) |
|
|
582
|
+
| `DefinedErrors` | _type_ | the `{ errors, codes, definitions, isCode, codeMap }` handle `defineErrors` returns |
|
|
583
|
+
| `DefinedAppError` | _type_ | literal-code error instance with schema-refined details |
|
|
584
|
+
| `ErrorDefinition` | _type_ | `{ status, message?, details? }` definition for one domain code |
|
|
585
|
+
| `ErrorDefinitions` | _type_ | string-keyed domain error definition registry |
|
|
586
|
+
| `ErrorDetailsSchema` | _type_ | required or optional Zod object accepted for structured details |
|
|
587
|
+
| `ErrorDetailsOutput` | _type_ | parsed details inferred from one definition |
|
|
588
|
+
| `ErrorFactoryArguments` | _type_ | options tuple with forbidden/required/optional details inferred per code |
|
|
589
|
+
| `ErrorFactory` | _type_ | one typed `AppError` constructor |
|
|
590
|
+
| `ErrorFactories` | _type_ | mapped constructor registry derived from all definitions |
|
|
591
|
+
| `FrozenErrorDefinitions` | _type_ | read-only definition registry returned to consumers |
|
|
592
|
+
| `STITCH_ERROR_STATUS` | const | `code → HTTP status` map for stitchkit's own error codes — [guide](../guide/auth-and-errors.md#stitch-codes-vs-your-codes) |
|
|
593
|
+
| `StitchErrorCode` | _type_ | a code stitchkit itself emits (`keyof STITCH_ERROR_STATUS`) |
|
|
594
|
+
| `isStitchErrorCode` | function | type guard — is a code one of stitchkit's own? |
|
|
595
|
+
| `isRetryableStatus` | function | whether a status class means "the same call could work later" — `408`, `429`, `502`, `503`, `504`, and deliberately not every `5xx` |
|
|
596
|
+
|
|
597
|
+
### Pagination
|
|
598
|
+
|
|
599
|
+
| Export | Kind | Summary |
|
|
600
|
+
|--------|------|---------|
|
|
601
|
+
| `paginatedSchema` | function | the `{ items, nextCursor }` Zod schema — [guide](../guide/contracts.md#pagination) |
|
|
602
|
+
| `Paginated` | _type_ | the cursor-pagination envelope |
|
|
603
|
+
| `encodeCursor` | function | encode a keyset value into an opaque `nextCursor` string (base64url, UTF-8-safe) |
|
|
604
|
+
| `decodeCursor` | function | decode + Zod-validate a cursor back to its value (`null` if missing/invalid) |
|
|
605
|
+
|
|
606
|
+
---
|