stitchkit 0.93.0 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +134 -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-tool-contract.d.ts +2 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -2
- 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/managed-tools.d.ts +1 -1
- 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 → agent-runtime/openrouter.d.ts} +3 -3
- 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 +9 -4
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/{agent-runtime-sqlite-bun.d.ts → agent-runtime/sqlite-bun.d.ts} +5 -4
- 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 → agent-runtime/sqlite-node.d.ts} +5 -4
- 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/{testing/agent-store-conformance.d.ts → agent-runtime/store-conformance.d.ts} +2 -2
- 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.d.ts → store-driver-contract.d.ts} +7 -7
- 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.d.ts +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/events.d.ts +1 -1
- package/dist/application/events.d.ts.map +1 -1
- package/dist/{server → application}/file-state-store.d.ts +1 -1
- 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/opentelemetry.d.ts +1 -1
- package/dist/application/opentelemetry.d.ts.map +1 -1
- package/dist/application/watch-hub.d.ts +2 -2
- package/dist/application/watch-hub.d.ts.map +1 -1
- 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 +1 -1
- 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.d.ts +1 -1
- package/dist/browser/http.d.ts.map +1 -1
- 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.d.ts +23 -1
- 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/define.d.ts +72 -65
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/{internal/errors.d.ts → contract/normalize.d.ts} +3 -39
- package/dist/contract/normalize.d.ts.map +1 -0
- package/dist/contract/tool-view.d.ts +135 -0
- package/dist/contract/tool-view.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-contract.d.ts → durability/contract.d.ts} +2 -2
- package/dist/durability/contract.d.ts.map +1 -0
- package/dist/{agent-runtime/durability.d.ts → durability/engine.d.ts} +4 -4
- package/dist/durability/engine.d.ts.map +1 -0
- package/dist/durability/events.d.ts +101 -0
- package/dist/durability/events.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-json.d.ts → durability/json.d.ts} +1 -1
- package/dist/durability/json.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-ledger.d.ts → durability/ledger.d.ts} +2 -2
- package/dist/durability/ledger.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-scheduler.d.ts → durability/scheduler.d.ts} +2 -2
- 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/{agent-runtime-browser.js → entrypoints/agent-runtime/browser.js} +3 -3
- package/dist/{agent-runtime-coding-tools.d.ts → entrypoints/agent-runtime/coding-tools.d.ts} +2 -2
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
- package/dist/{agent-runtime-harness.d.ts → entrypoints/agent-runtime/harness.d.ts} +2 -2
- package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
- package/dist/{agent-runtime-harness.js → entrypoints/agent-runtime/harness.js} +24 -25
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/{agent-runtime-openrouter.js → entrypoints/agent-runtime/openrouter.js} +3 -3
- package/dist/{agent-runtime-sandbox.d.ts → entrypoints/agent-runtime/sandbox.d.ts} +5 -5
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
- package/dist/{agent-runtime-sandbox.js → entrypoints/agent-runtime/sandbox.js} +11 -12
- 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/{agent-runtime-sqlite-bun.js → entrypoints/agent-runtime/sqlite/bun.js} +8 -6
- 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/{agent-runtime-sqlite-node.js → entrypoints/agent-runtime/sqlite/node.js} +8 -6
- 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 +1084 -0
- package/dist/{agent-runtime.d.ts → entrypoints/agent-runtime.d.ts} +41 -37
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
- package/dist/{agent-runtime.js → entrypoints/agent-runtime.js} +408 -366
- package/dist/{application-diagnostic-journal.d.ts → entrypoints/application/diagnostic-journal.d.ts} +2 -2
- package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
- package/dist/{application-diagnostic-journal.js → entrypoints/application/diagnostic-journal.js} +3 -3
- package/dist/{application-grammy.d.ts → entrypoints/application/grammy.d.ts} +2 -2
- package/dist/entrypoints/application/grammy.d.ts.map +1 -0
- package/dist/{application-grammy.js → entrypoints/application/grammy.js} +2 -2
- package/dist/{application-opentelemetry.d.ts → entrypoints/application/opentelemetry.d.ts} +2 -2
- package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
- package/dist/{application-opentelemetry.js → entrypoints/application/opentelemetry.js} +4 -4
- package/dist/{application-schemas.d.ts → entrypoints/application/schemas.d.ts} +2 -2
- package/dist/entrypoints/application/schemas.d.ts.map +1 -0
- package/dist/{application-schemas.js → entrypoints/application/schemas.js} +2 -2
- package/dist/{application.d.ts → entrypoints/application.d.ts} +22 -21
- package/dist/entrypoints/application.d.ts.map +1 -0
- package/dist/{application.js → entrypoints/application.js} +24 -22
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
- package/dist/{upgrade-cli.js → entrypoints/bin/upgrade-cli.js} +3 -3
- package/dist/{cli.d.ts → entrypoints/cli.d.ts} +15 -15
- package/dist/entrypoints/cli.d.ts.map +1 -0
- package/dist/{cli.js → entrypoints/cli.js} +30 -32
- package/dist/entrypoints/contract.d.ts +9 -0
- package/dist/entrypoints/contract.d.ts.map +1 -0
- package/dist/{contract/index.js → entrypoints/contract.js} +14 -6
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -0
- package/dist/{declaration.js → entrypoints/declaration.js} +1 -1
- package/dist/{files.d.ts → entrypoints/files.d.ts} +2 -2
- package/dist/entrypoints/files.d.ts.map +1 -0
- package/dist/{files.js → entrypoints/files.js} +3 -3
- package/dist/{geo.d.ts → entrypoints/geo.d.ts} +1 -1
- package/dist/entrypoints/geo.d.ts.map +1 -0
- package/dist/{geo.js → entrypoints/geo.js} +4 -4
- package/dist/entrypoints/google.d.ts +2 -0
- package/dist/entrypoints/google.d.ts.map +1 -0
- package/dist/{google.js → entrypoints/google.js} +1 -1
- package/dist/{index.d.ts → entrypoints/index.d.ts} +14 -13
- package/dist/entrypoints/index.d.ts.map +1 -0
- package/dist/{index.js → entrypoints/index.js} +99 -33
- package/dist/{live.d.ts → entrypoints/live.d.ts} +4 -4
- package/dist/entrypoints/live.d.ts.map +1 -0
- package/dist/{live.js → entrypoints/live.js} +6 -4
- package/dist/{node.d.ts → entrypoints/node.d.ts} +11 -11
- package/dist/entrypoints/node.d.ts.map +1 -0
- package/dist/{node.js → entrypoints/node.js} +20 -16
- package/dist/entrypoints/oauth.d.ts +2 -0
- package/dist/entrypoints/oauth.d.ts.map +1 -0
- package/dist/{oauth.js → entrypoints/oauth.js} +3 -3
- package/dist/{observability/index.d.ts → entrypoints/observability.d.ts} +11 -11
- package/dist/entrypoints/observability.d.ts.map +1 -0
- package/dist/{observability/index.js → entrypoints/observability.js} +9 -11
- package/dist/entrypoints/primitives.d.ts +3 -0
- package/dist/entrypoints/primitives.d.ts.map +1 -0
- package/dist/{primitives.js → entrypoints/primitives.js} +1 -6
- package/dist/{react.d.ts → entrypoints/react.d.ts} +4 -4
- package/dist/entrypoints/react.d.ts.map +1 -0
- package/dist/{react.js → entrypoints/react.js} +3 -3
- package/dist/{release.d.ts → entrypoints/release.d.ts} +4 -4
- package/dist/entrypoints/release.d.ts.map +1 -0
- package/dist/{release.js → entrypoints/release.js} +1 -1
- package/dist/{remote.d.ts → entrypoints/remote.d.ts} +1 -1
- package/dist/entrypoints/remote.d.ts.map +1 -0
- package/dist/entrypoints/remote.js +66 -0
- package/dist/{server/index.d.ts → entrypoints/server.d.ts} +35 -34
- package/dist/entrypoints/server.d.ts.map +1 -0
- package/dist/{server/index.js → entrypoints/server.js} +294 -244
- package/dist/{telegram.d.ts → entrypoints/telegram.d.ts} +2 -2
- package/dist/entrypoints/telegram.d.ts.map +1 -0
- package/dist/{telegram.js → entrypoints/telegram.js} +1 -1
- package/dist/entrypoints/testing.d.ts +9 -0
- package/dist/entrypoints/testing.d.ts.map +1 -0
- package/dist/{testing.js → entrypoints/testing.js} +80 -919
- package/dist/{tools/connections/index.d.ts → entrypoints/tools/connections.d.ts} +6 -7
- package/dist/entrypoints/tools/connections.d.ts.map +1 -0
- package/dist/{tools/connections/index.js → entrypoints/tools/connections.js} +7 -4
- package/dist/{tools-contract.d.ts → entrypoints/tools/contract.d.ts} +5 -5
- package/dist/entrypoints/tools/contract.d.ts.map +1 -0
- package/dist/{tools-contract.js → entrypoints/tools/contract.js} +4 -4
- package/dist/{tool-invoker.d.ts → entrypoints/tools/invoker.d.ts} +2 -2
- package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
- package/dist/entrypoints/tools/invoker.js +20 -0
- package/dist/entrypoints/tools.d.ts +51 -0
- package/dist/entrypoints/tools.d.ts.map +1 -0
- package/dist/{tools.js → entrypoints/tools.js} +1787 -1751
- package/dist/{tracking-server.d.ts → entrypoints/tracking/server.d.ts} +8 -8
- package/dist/entrypoints/tracking/server.d.ts.map +1 -0
- package/dist/{tracking.d.ts → entrypoints/tracking.d.ts} +15 -15
- package/dist/entrypoints/tracking.d.ts.map +1 -0
- package/dist/{tracking.js → entrypoints/tracking.js} +5 -8
- package/dist/google/google.d.ts.map +1 -0
- package/dist/{index-a916km3r.js → index-0b1ess5e.js} +6 -13
- package/dist/{index-zwkgfq1s.js → index-1nd48tm9.js} +113 -118
- package/dist/{index-7zbps32p.js → index-1zbbzgfh.js} +2 -2
- package/dist/{index-mzvgxp0n.js → index-2cr1cqhn.js} +16 -4
- package/dist/{index-f9mb610r.js → index-35mh5bhj.js} +2 -2
- package/dist/index-48ffdxgk.js +6 -0
- package/dist/index-58k4fp34.js +1023 -0
- package/dist/{index-p13mwz16.js → index-83bdg97s.js} +1 -1
- package/dist/index-97ac4gph.js +3618 -0
- package/dist/{index-kw9t5ayn.js → index-cq4qfycf.js} +5 -5
- package/dist/{index-7gnkny4z.js → index-d9pk3td4.js} +1 -1
- package/dist/{index-e42wzzz5.js → index-dcpdvjsc.js} +7 -7
- package/dist/{index-h9etkkyk.js → index-dydjcp8z.js} +102 -25
- package/dist/{index-sr93cwf9.js → index-e2z3ahw9.js} +2 -2
- package/dist/{index-yewwh1w4.js → index-e87kakm4.js} +96 -11
- package/dist/{index-cby4ar3v.js → index-eqqvgdb3.js} +1 -1
- package/dist/index-fdp6hdxn.js +942 -0
- package/dist/{index-0a349c33.js → index-gyr48nzg.js} +125 -198
- package/dist/{index-wnfk50r0.js → index-h6eeys1v.js} +1 -1
- package/dist/{index-77fekveh.js → index-hffjpmq9.js} +1 -15
- package/dist/{index-yn8remb1.js → index-j05z5gn4.js} +50 -14
- package/dist/index-k5hsfc3j.js +31 -0
- package/dist/{index-fq77yfzc.js → index-kj2wbeta.js} +1 -1
- package/dist/index-kvj7f4hq.js +39 -0
- package/dist/{index-4fpa9dy2.js → index-m9zn6cpq.js} +2 -2
- package/dist/{index-2na0qrfn.js → index-mdzh02yc.js} +7 -7
- package/dist/{index-ywd0y6m1.js → index-mkm15s49.js} +1 -1
- package/dist/index-mp5sn43f.js +1084 -0
- package/dist/{index-3bmnp41g.js → index-n6hxg8as.js} +507 -419
- package/dist/index-ngfhvfpd.js +30 -0
- package/dist/{index-e0znv5gn.js → index-p5r7qpdd.js} +2 -93
- package/dist/{index-n0f51dfn.js → index-p81267c2.js} +608 -549
- package/dist/{index-wc4x00bn.js → index-qwhynv6x.js} +1 -1
- package/dist/index-r7nmqpsg.js +154 -0
- package/dist/{index-bx75zwt7.js → index-rewkc2hj.js} +5 -4
- package/dist/{index-9f8ztey6.js → index-sees8yf8.js} +2 -2
- package/dist/{index-vjpvjqpn.js → index-v38qyerb.js} +16 -2
- package/dist/{index-2c2bjw3s.js → index-vcvkq30w.js} +3 -3
- package/dist/index-wqgjfstn.js +18 -0
- package/dist/{index-f477k430.js → index-x4799c19.js} +1 -1
- package/dist/{index-cxqhvq21.js → index-xnj9bgxe.js} +142 -129
- package/dist/index-xsqjkha9.js +281 -0
- package/dist/{index-6kyksz9y.js → index-yw4fzmdz.js} +1 -1
- package/dist/{index-3xwxfj4z.js → index-zeemqhqx.js} +1 -1
- package/dist/{index-tmwcrptx.js → index-zfrhfn82.js} +1 -1
- package/dist/index-znfs20ss.js +98 -0
- 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/logger.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/zod-issues.d.ts +38 -0
- package/dist/internal/zod-issues.d.ts.map +1 -0
- package/dist/{tools/json-schema-dialect.d.ts → json-schema/dialect.d.ts} +1 -1
- 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-delta.d.ts.map +1 -1
- package/dist/{oauth.d.ts → oauth/authorization-code.d.ts} +1 -1
- package/dist/oauth/authorization-code.d.ts.map +1 -0
- package/dist/observability/audit.d.ts +2 -2
- 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/{internal/observability-sink.d.ts → observability/bounded-sink.d.ts} +2 -2
- 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 +1 -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/socket.d.ts +1 -1
- package/dist/realtime/socket.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 +18 -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.d.ts +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/middleware/auth.d.ts +1 -1
- 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/trust-fence.d.ts +1 -1
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart.d.ts +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/{tools/oauth-metadata.d.ts → server/oauth/metadata.d.ts} +2 -2
- package/dist/server/oauth/metadata.d.ts.map +1 -0
- package/dist/{tools/oauth-provider.d.ts → server/oauth/provider.d.ts} +2 -2
- 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/types.d.ts +7 -4
- package/dist/server/types.d.ts.map +1 -1
- package/dist/testing/handler-clients.d.ts +31 -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/surface-conformance.d.ts +2 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +30 -4
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/{cli-args.d.ts → cli/args.d.ts} +1 -1
- package/dist/tools/cli/args.d.ts.map +1 -0
- package/dist/tools/{cli-checkpoint.d.ts → cli/checkpoint.d.ts} +1 -1
- package/dist/tools/cli/checkpoint.d.ts.map +1 -0
- package/dist/tools/{cli-command.d.ts → cli/command.d.ts} +4 -4
- package/dist/tools/cli/command.d.ts.map +1 -0
- package/dist/tools/{cli.d.ts → cli/config.d.ts} +5 -9
- 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 → cli/format.d.ts} +2 -2
- 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 → cli/installer.d.ts} +2 -2
- package/dist/tools/cli/installer.d.ts.map +1 -0
- package/dist/tools/{cli-invoke.d.ts → cli/invoke.d.ts} +8 -8
- 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 → cli/manifest.d.ts} +1 -1
- package/dist/tools/cli/manifest.d.ts.map +1 -0
- package/dist/tools/{cli-policy.d.ts → cli/policy.d.ts} +2 -2
- 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 → cli/profile.d.ts} +2 -2
- 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 → cli/signature.d.ts} +2 -2
- package/dist/tools/cli/signature.d.ts.map +1 -0
- package/dist/tools/{cli-stream.d.ts → cli/stream.d.ts} +4 -4
- package/dist/tools/cli/stream.d.ts.map +1 -0
- package/dist/tools/{cli-update.d.ts → cli/update.d.ts} +3 -3
- package/dist/tools/cli/update.d.ts.map +1 -0
- package/dist/tools/{cli-view.d.ts → cli/view.d.ts} +2 -2
- package/dist/tools/cli/view.d.ts.map +1 -0
- package/dist/tools/{cli-wait.d.ts → cli/wait.d.ts} +2 -2
- 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.d.ts +30 -3
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +8 -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 +11 -3
- package/dist/tools/invoker.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 → mcp/app.d.ts} +1 -1
- package/dist/tools/mcp/app.d.ts.map +1 -0
- package/dist/tools/{mcp-catalog.d.ts → mcp/catalog.d.ts} +2 -2
- package/dist/tools/mcp/catalog.d.ts.map +1 -0
- package/dist/tools/{mcp-handler.d.ts → mcp/handler.d.ts} +5 -5
- package/dist/tools/mcp/handler.d.ts.map +1 -0
- package/dist/tools/{mcp.d.ts → mcp/mount.d.ts} +9 -9
- package/dist/tools/mcp/mount.d.ts.map +1 -0
- package/dist/tools/{mcp-prepare.d.ts → mcp/prepare.d.ts} +9 -9
- package/dist/tools/mcp/prepare.d.ts.map +1 -0
- package/dist/tools/{mcp-progress.d.ts → mcp/progress.d.ts} +2 -2
- package/dist/tools/mcp/progress.d.ts.map +1 -0
- package/dist/tools/mcp/register.d.ts +35 -0
- package/dist/tools/mcp/register.d.ts.map +1 -0
- package/dist/tools/{mcp-round-policy.d.ts → mcp/round-policy.d.ts} +2 -2
- package/dist/tools/mcp/round-policy.d.ts.map +1 -0
- package/dist/tools/{mcp-round.d.ts → mcp/round.d.ts} +4 -4
- package/dist/tools/mcp/round.d.ts.map +1 -0
- package/dist/tools/mcp/runtime-tools.d.ts +24 -0
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
- package/dist/tools/{mcp-stdio-signals.d.ts → mcp/stdio-signals.d.ts} +3 -3
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
- package/dist/tools/{mcp-stdio.d.ts → mcp/stdio.d.ts} +4 -4
- package/dist/tools/mcp/stdio.d.ts.map +1 -0
- package/dist/tools/{mcp-trace.d.ts → mcp/trace.d.ts} +1 -1
- package/dist/tools/mcp/trace.d.ts.map +1 -0
- package/dist/tools/mount.d.ts +12 -7
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +3 -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 +40 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts +68 -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/{define-wait-tool.d.ts → operations/define-wait-tool.d.ts} +2 -2
- 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 +11 -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/{presentation.d.ts → schema/presentation.d.ts} +2 -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/toolkit.d.ts +4 -4
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/{define-download-tool.d.ts → transfer/define-download-tool.d.ts} +4 -4
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
- package/dist/tools/{define-upload-tool.d.ts → transfer/define-upload-tool.d.ts} +3 -3
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
- package/dist/tools/{define-view-file-tool.d.ts → transfer/define-view-file-tool.d.ts} +2 -2
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
- package/dist/tools/{download-core.d.ts → transfer/download-core.d.ts} +2 -2
- package/dist/tools/transfer/download-core.d.ts.map +1 -0
- package/dist/tools/{managed-file-error.d.ts → transfer/managed-file-error.d.ts} +1 -1
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
- package/dist/tools/{mount-download.d.ts → transfer/mount-download.d.ts} +1 -1
- package/dist/tools/transfer/mount-download.d.ts.map +1 -0
- package/dist/tools/{mount-upload.d.ts → transfer/mount-upload.d.ts} +1 -1
- 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/{upload-core.d.ts → transfer/upload-core.d.ts} +1 -1
- 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/{view-file.d.ts → transfer/view-file.d.ts} +1 -1
- 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/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 +223 -0
- package/llms/application.txt +1144 -0
- package/llms/cli.txt +977 -0
- package/llms/contract.txt +606 -0
- package/llms/declaration.txt +286 -0
- package/llms/files.txt +30 -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 +838 -0
- package/llms/tools.txt +1004 -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 +214 -75
- package/llms.txt +54 -5
- package/package.json +84 -83
- package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
- package/dist/agent-runtime/durability-json.d.ts.map +0 -1
- package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
- package/dist/agent-runtime/durability.d.ts.map +0 -1
- 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-coding-tools.d.ts.map +0 -1
- package/dist/agent-runtime-coding-tools.js +0 -23
- package/dist/agent-runtime-harness.d.ts.map +0 -1
- package/dist/agent-runtime-openrouter.d.ts.map +0 -1
- package/dist/agent-runtime-sandbox.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/application/channel.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.d.ts.map +0 -1
- package/dist/application-grammy.d.ts.map +0 -1
- package/dist/application-opentelemetry.d.ts.map +0 -1
- package/dist/application-schemas.d.ts.map +0 -1
- package/dist/application.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/contract/index.d.ts +0 -8
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/declaration.d.ts.map +0 -1
- package/dist/files.d.ts.map +0 -1
- package/dist/geo.d.ts.map +0 -1
- package/dist/google.d.ts.map +0 -1
- package/dist/index-0j3vcp5m.js +0 -28
- package/dist/index-a11g2kry.js +0 -866
- package/dist/index-cnyk6te3.js +0 -77
- package/dist/index-fadnxwna.js +0 -1046
- package/dist/index-hrbajay7.js +0 -1196
- package/dist/index-s8cnx02s.js +0 -90
- package/dist/index-v5573g1k.js +0 -142
- package/dist/index-vk3kq9sb.js +0 -3344
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/errors.d.ts.map +0 -1
- package/dist/internal/observability-sink.d.ts.map +0 -1
- package/dist/live.d.ts.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/node.d.ts.map +0 -1
- package/dist/oauth.d.ts.map +0 -1
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/primitives.d.ts +0 -3
- package/dist/primitives.d.ts.map +0 -1
- package/dist/react.d.ts.map +0 -1
- package/dist/release.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/request.d.ts.map +0 -1
- package/dist/telegram.d.ts.map +0 -1
- 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/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.map +0 -1
- package/dist/tools/cli-checkpoint.d.ts.map +0 -1
- package/dist/tools/cli-command.d.ts.map +0 -1
- package/dist/tools/cli-format.d.ts.map +0 -1
- package/dist/tools/cli-installer.d.ts.map +0 -1
- package/dist/tools/cli-invoke.d.ts.map +0 -1
- package/dist/tools/cli-manifest.d.ts.map +0 -1
- package/dist/tools/cli-policy.d.ts.map +0 -1
- package/dist/tools/cli-profile.d.ts.map +0 -1
- package/dist/tools/cli-signature.d.ts.map +0 -1
- package/dist/tools/cli-stream.d.ts.map +0 -1
- package/dist/tools/cli-update.d.ts.map +0 -1
- package/dist/tools/cli-view.d.ts.map +0 -1
- package/dist/tools/cli-wait.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/tools/define-download-tool.d.ts.map +0 -1
- package/dist/tools/define-upload-tool.d.ts.map +0 -1
- package/dist/tools/define-view-file-tool.d.ts.map +0 -1
- package/dist/tools/define-wait-tool.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/tools/json-schema.d.ts.map +0 -1
- package/dist/tools/managed-file-error.d.ts.map +0 -1
- package/dist/tools/mcp-app.d.ts.map +0 -1
- package/dist/tools/mcp-catalog.d.ts.map +0 -1
- package/dist/tools/mcp-handler.d.ts.map +0 -1
- package/dist/tools/mcp-prepare.d.ts.map +0 -1
- package/dist/tools/mcp-progress.d.ts.map +0 -1
- package/dist/tools/mcp-round-policy.d.ts.map +0 -1
- package/dist/tools/mcp-round.d.ts.map +0 -1
- package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
- package/dist/tools/mcp-stdio.d.ts.map +0 -1
- package/dist/tools/mcp-trace.d.ts.map +0 -1
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mount-download.d.ts.map +0 -1
- 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.map +0 -1
- 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.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.map +0 -1
- package/dist/tools/view-file-contract.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/tools.d.ts +0 -50
- package/dist/tools.d.ts.map +0 -1
- package/dist/tracking-server.d.ts.map +0 -1
- package/dist/tracking.d.ts.map +0 -1
- package/dist/upgrade-cli.d.ts.map +0 -1
- 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/{index-actkayzn.js → index-70yj2ebz.js} +3 -3
- /package/dist/{application → internal}/channel.d.ts +0 -0
- /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
- /package/dist/{server → internal}/request.d.ts +0 -0
- /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
- /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
- /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
- /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
- /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
- /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
- /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
- /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
- /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
- /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
- /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
- /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
package/llms/tools.2.txt
ADDED
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
# stitchkit/tools — stitchkit docs slice, part 2 of 2
|
|
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
|
+
Parts of this slice:
|
|
7
|
+
- `llms/tools.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
|
|
8
|
+
- `llms/tools.2.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md) · API reference: `stitchkit/tools` (docs/api/reference.md)
|
|
9
|
+
|
|
10
|
+
==============================================================================
|
|
11
|
+
# Guide: MCP & agents (docs/guide/mcp-and-agents.md) (continued)
|
|
12
|
+
==============================================================================
|
|
13
|
+
|
|
14
|
+
## AI agents — `mountAgent`
|
|
15
|
+
|
|
16
|
+
`mountAgent` remains the low-level path when the application owns its own model
|
|
17
|
+
loop and conversation state. For the optional Stitchkit-owned run/history loop,
|
|
18
|
+
see [Agent application runtime](./agent-runtime.md).
|
|
19
|
+
|
|
20
|
+
`mountAgent` turns a service into a Vercel AI SDK `ToolSet`, ready for
|
|
21
|
+
`generateText` / `streamText`:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { mountAgent } from 'stitchkit/tools'
|
|
25
|
+
import { generateText } from 'ai'
|
|
26
|
+
|
|
27
|
+
const tools = mountAgent(usersService, { context: { userId: 'agent-1' } })
|
|
28
|
+
|
|
29
|
+
const result = await generateText({
|
|
30
|
+
model,
|
|
31
|
+
tools,
|
|
32
|
+
prompt: 'Create a user named Max',
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each contract endpoint exposed on `AGENT` becomes a tool whose input schema is
|
|
37
|
+
the merged `params` + `input`. `context` is merged into every tool handler's
|
|
38
|
+
`ctx`, alongside `source: 'agent'`.
|
|
39
|
+
|
|
40
|
+
### `AgentMountConfig`
|
|
41
|
+
|
|
42
|
+
| Field | Purpose |
|
|
43
|
+
|-------|---------|
|
|
44
|
+
| `context` | values merged into every tool handler's `ctx` |
|
|
45
|
+
| `lifecycle` | `beforeHandle` / `afterHandle` — the tool-side auth gate (see [Guarding tools](#guarding-tools--lifecycle)) |
|
|
46
|
+
| `hooks` | tool-call observability hooks — `afterToolCall` fires on every result |
|
|
47
|
+
| `extend` | add extra args resolved before the handler runs (see below) |
|
|
48
|
+
| `runtimeTools` | framework-managed pathless operations from `defineRuntimeTool` |
|
|
49
|
+
|
|
50
|
+
`lifecycle` works the same as on the MCP server — without it an agent tool call
|
|
51
|
+
bypasses the HTTP `authorize` gate. Pass your `createAuthHook` result.
|
|
52
|
+
|
|
53
|
+
### Adding tool-only args — `extend`
|
|
54
|
+
|
|
55
|
+
`extend` adds **tool-only** arguments — fields the model fills that are resolved
|
|
56
|
+
into context, then stripped before the contract handler sees them. Use it when a
|
|
57
|
+
tool needs an argument the HTTP endpoint does not — the classic case being a
|
|
58
|
+
**multi-tenant** server reached by one API key, where the model passes `tenantId`
|
|
59
|
+
on every call. It is the same `ToolExtend` shape on `mountMcp`, `createMcpHandler`
|
|
60
|
+
and `mountAgent`:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
interface ToolExtend {
|
|
64
|
+
/** Extra Zod fields added to every matching tool's input schema. */
|
|
65
|
+
schema: Record<string, z.ZodType>
|
|
66
|
+
/** Turn the extra args into context merged into the handler's ctx. */
|
|
67
|
+
resolve: (args: Record<string, unknown>) => Partial<Ctx> | Promise<Partial<Ctx>>
|
|
68
|
+
/** Limit the extension to specific methods — default: every method. */
|
|
69
|
+
filter?: (service: ServiceDef, method: MethodDef) => boolean
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
On the MCP server — add `tenantId` to each tool, validate access in `resolve`,
|
|
74
|
+
inject the resolved tenant into `ctx`, and `filter` to the tenant-scoped tools:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
createMcpHandler({
|
|
78
|
+
serverInfo, auth,
|
|
79
|
+
services: [widgetsService],
|
|
80
|
+
extend: {
|
|
81
|
+
schema: { tenantId: z.string().describe('Tenant to act on') },
|
|
82
|
+
resolve: async ({ tenantId }) => {
|
|
83
|
+
const id = String(tenantId)
|
|
84
|
+
if (!(await tenantExists(id))) throw new Error(`unknown tenant ${id}`)
|
|
85
|
+
return { tenantId: id } // merged into ctx → ctx.tenantId
|
|
86
|
+
},
|
|
87
|
+
filter: (_service, method) => method.scope === 'tenant',
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The model calls `widgets_list({ tenantId: 't_123' })`; `resolve` checks access and
|
|
93
|
+
puts `tenantId` on `ctx`; the contract handler reads `ctx.tenantId` (same place
|
|
94
|
+
as the HTTP prefix param — see
|
|
95
|
+
[Route groups → param prefixes](./server.md#param-prefixes-resource-scoped-paths)),
|
|
96
|
+
so one handler serves both surfaces. Pair `extend` with `lifecycle` (your
|
|
97
|
+
`createAuthHook`) so the tool call is still scope-gated.
|
|
98
|
+
|
|
99
|
+
## Pathless runtime tools and multimodal results
|
|
100
|
+
|
|
101
|
+
Use `defineRuntimeTool` for an operation that has no HTTP path but still needs
|
|
102
|
+
the same validation, isolated per-call context, lifecycle/RBAC and hooks as a
|
|
103
|
+
contract tool. The handler returns one transport-neutral, schema-validated
|
|
104
|
+
result. Optional presentation callbacks map that result to MCP content and AI
|
|
105
|
+
SDK model output without coupling the handler to either SDK:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { createMcpHandler, defineRuntimeTool, mountAgent } from 'stitchkit/tools'
|
|
109
|
+
import { z } from 'zod'
|
|
110
|
+
|
|
111
|
+
const renderPreview = defineRuntimeTool({
|
|
112
|
+
name: 'render_preview',
|
|
113
|
+
description: 'Render and inspect a preview',
|
|
114
|
+
identity: {
|
|
115
|
+
serviceName: 'mediaTools',
|
|
116
|
+
action: 'renderPreview',
|
|
117
|
+
scope: 'admin',
|
|
118
|
+
method: 'POST',
|
|
119
|
+
},
|
|
120
|
+
input: z.object({ prompt: z.string() }),
|
|
121
|
+
output: z.object({ assetId: z.string(), imageBase64: z.string() }),
|
|
122
|
+
handler: async ({ input }) => renderAndSave(input.prompt),
|
|
123
|
+
present: {
|
|
124
|
+
mcp: (output) => ({
|
|
125
|
+
content: [
|
|
126
|
+
{ type: 'image', data: output.imageBase64, mimeType: 'image/png' },
|
|
127
|
+
{ type: 'text', text: output.assetId },
|
|
128
|
+
],
|
|
129
|
+
}),
|
|
130
|
+
agent: (output) => ({
|
|
131
|
+
type: 'content',
|
|
132
|
+
value: [{
|
|
133
|
+
type: 'file',
|
|
134
|
+
data: { type: 'data', data: output.imageBase64 },
|
|
135
|
+
mediaType: 'image/png',
|
|
136
|
+
filename: `${output.assetId}.png`,
|
|
137
|
+
}],
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
const handleMcp = createMcpHandler({
|
|
143
|
+
serverInfo: { name: 'my-app', version: '1.0.0' },
|
|
144
|
+
auth,
|
|
145
|
+
services: [service],
|
|
146
|
+
runtimeTools: [renderPreview],
|
|
147
|
+
lifecycle: { beforeHandle: authHook },
|
|
148
|
+
hooks: audit.toolCall,
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
const agentTools = mountAgent([service], {
|
|
152
|
+
runtimeTools: [renderPreview],
|
|
153
|
+
lifecycle: { beforeHandle: authHook },
|
|
154
|
+
hooks: audit.toolCall,
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
When several runtime tools share application context and identity, bind both
|
|
159
|
+
once with `createRuntimeToolFactory`. Its Zod context schema is parsed once per
|
|
160
|
+
call inside the same runner; the authored handler receives validated context and
|
|
161
|
+
parsed `input`, while lifecycle, hooks, output validation and presenters remain
|
|
162
|
+
unchanged:
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
const knowledgeTools = createRuntimeToolFactory({
|
|
166
|
+
serviceName: 'agentKnowledge',
|
|
167
|
+
scope: 'user',
|
|
168
|
+
context: z.object({ userId: z.string(), tz: z.string() }),
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
const countRecords = knowledgeTools.define({
|
|
172
|
+
name: 'count_records',
|
|
173
|
+
action: 'countRecords',
|
|
174
|
+
method: 'GET',
|
|
175
|
+
description: 'Count records',
|
|
176
|
+
input: z.object({ kind: z.string() }),
|
|
177
|
+
output: z.object({ count: z.number() }),
|
|
178
|
+
handler: async ({ userId, tz, input }) => countFor(userId, tz, input.kind),
|
|
179
|
+
})
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`serviceName` and `scope` cannot be overridden by one definition. Use standalone
|
|
183
|
+
`defineRuntimeTool` when tools do not share a context schema or identity.
|
|
184
|
+
|
|
185
|
+
`transports` defaults to `['MCP', 'AGENT']`; set an explicit subset when an
|
|
186
|
+
operation belongs on only one surface. Include `'CLI'` explicitly to reuse the
|
|
187
|
+
definition through `createCli({ runtimeTools })`; adding CLI support never
|
|
188
|
+
widens existing definitions silently. The configured identity becomes the
|
|
189
|
+
hook/lifecycle `OperationIdentity` and the tool `RequestEvent`
|
|
190
|
+
(`serviceName`, `action`, `httpMethod`). A runtime operation has no HTTP route,
|
|
191
|
+
so no fake `path` is added.
|
|
192
|
+
|
|
193
|
+
When `output` is declared, Stitchkit validates the neutral handler result after
|
|
194
|
+
`afterHandle`. MCP owns `structuredContent` and `isError`: a presenter supplies
|
|
195
|
+
only rich `content`/metadata, while the framework inserts the validated
|
|
196
|
+
structured result and normalises failures. The Agent adapter uses the AI SDK's
|
|
197
|
+
official `toModelOutput` callback, so `execute` and application UI keep the
|
|
198
|
+
neutral output while the model receives text/file content. Presentation
|
|
199
|
+
callbacks require an output schema.
|
|
200
|
+
|
|
201
|
+
The MCP registration uses an identity carrier: the SDK advertises the compiled
|
|
202
|
+
JSON Schema but forwards the raw object into Stitchkit. Input failures therefore
|
|
203
|
+
use the same validation, lifecycle and hook path as contract tools.
|
|
204
|
+
|
|
205
|
+
### Managed wait, download, upload and view-file
|
|
206
|
+
|
|
207
|
+
The common imperative shapes have typed definition factories. They produce
|
|
208
|
+
ordinary runtime-tool definitions, so one value can enter `runtimeTools` on MCP
|
|
209
|
+
and Agent and receives the same lifecycle, hooks, context, cancellation,
|
|
210
|
+
collision checks and introspection as any `defineRuntimeTool` operation:
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
import {
|
|
214
|
+
defineDownloadTool,
|
|
215
|
+
defineUploadTool,
|
|
216
|
+
defineViewFileTool,
|
|
217
|
+
defineWaitTool,
|
|
218
|
+
} from 'stitchkit/tools'
|
|
219
|
+
import { createManagedFileBoundary } from 'stitchkit/files'
|
|
220
|
+
import { z } from 'zod'
|
|
221
|
+
|
|
222
|
+
const files = await createManagedFileBoundary({
|
|
223
|
+
root: '/srv/job-media',
|
|
224
|
+
createRoot: true, // creates only this final directory; /srv must already be trusted
|
|
225
|
+
inspectionTimeoutMs: 15_000,
|
|
226
|
+
inspect: ({ prefix, name, declaredMediaType, signal }) =>
|
|
227
|
+
inspectFile(prefix, { name, declaredMediaType, signal }),
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
const waitForJob = defineWaitTool({
|
|
231
|
+
name: 'wait_for_job',
|
|
232
|
+
description: 'Wait for a job to finish',
|
|
233
|
+
identity: { serviceName: 'jobs', action: 'waitForJob', scope: 'user' },
|
|
234
|
+
input: z.object({ id: z.string() }),
|
|
235
|
+
state: z.object({ id: z.string(), status: z.enum(['RUNNING', 'DONE']) }),
|
|
236
|
+
poll: ({ id }, context) => getJob(id, context.signal),
|
|
237
|
+
done: (state) => state.status === 'DONE',
|
|
238
|
+
backoff: [2, 3, 5],
|
|
239
|
+
defaultTimeout: 120,
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
const downloadResult = defineDownloadTool({
|
|
243
|
+
name: 'download_result',
|
|
244
|
+
description: 'Download a completed result',
|
|
245
|
+
identity: { serviceName: 'jobs', action: 'downloadResult', scope: 'user' },
|
|
246
|
+
input: z.object({ id: z.string() }),
|
|
247
|
+
resolveUrl: ({ id }) => resolveResultUrl(id),
|
|
248
|
+
files,
|
|
249
|
+
pathFromInput: ({ id }) => `results/${id}.bin`,
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
const uploadInput = defineUploadTool({
|
|
253
|
+
name: 'upload_input',
|
|
254
|
+
description: 'Upload a local input file',
|
|
255
|
+
identity: { serviceName: 'jobs', action: 'uploadInput', scope: 'user' },
|
|
256
|
+
output: z.object({ url: z.url() }),
|
|
257
|
+
files,
|
|
258
|
+
upload: (source, context) => uploadBytes(source.bytes, context.signal),
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
const viewResult = defineViewFileTool({
|
|
262
|
+
name: 'view_result',
|
|
263
|
+
description: 'Inspect generated media',
|
|
264
|
+
identity: { serviceName: 'jobs', action: 'viewResult', scope: 'user' },
|
|
265
|
+
// Local files are disabled when files is omitted. URL fetches retain SSRF
|
|
266
|
+
// protection; use allowPrivateHosts only for an explicitly trusted network.
|
|
267
|
+
files,
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
const runtimeTools = [waitForJob, downloadResult, uploadInput, viewResult]
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Managed factories return neutral validated data. Expected failures go through
|
|
274
|
+
the standard failed `ToolResult` path rather than masquerading as a successful
|
|
275
|
+
payload with `isError`. Wait sleep is abort-aware, guarded downloads receive the
|
|
276
|
+
active signal, and upload implementations receive it on their typed context.
|
|
277
|
+
Managed view-file accepts one or several paths/URLs, retains successful
|
|
278
|
+
multimodal content beside structured per-item `errors`, and charges every item
|
|
279
|
+
to one total 20 MB batch budget. Its MCP and Agent presenters are built in;
|
|
280
|
+
remote fetch cancellation follows the active call signal.
|
|
281
|
+
|
|
282
|
+
The older `mountWait`, `mountDownload`, `mountUpload` and `mountViewFile`
|
|
283
|
+
functions remain
|
|
284
|
+
intentional raw MCP adapters with their text-envelope behavior. Use them under
|
|
285
|
+
`rawTools` only when opting out of managed policy is deliberate; they share the
|
|
286
|
+
same neutral mechanics but do not gain lifecycle or hooks. The raw view-file
|
|
287
|
+
adapter preserves its content-only MCP envelope while using the same bounded
|
|
288
|
+
batch operation.
|
|
289
|
+
|
|
290
|
+
### Async-operation protocol
|
|
291
|
+
|
|
292
|
+
For a complete long-running operation, define the linked runtime-only surface
|
|
293
|
+
once. Stitchkit owns transport names, validation and wait mechanics; the
|
|
294
|
+
application still owns storage, execution, retries and domain states:
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
import {
|
|
298
|
+
createAsyncOperationSnapshotSchema,
|
|
299
|
+
defineAsyncOperation,
|
|
300
|
+
} from 'stitchkit/tools'
|
|
301
|
+
|
|
302
|
+
const id = z.object({ id: z.string() })
|
|
303
|
+
const state = z.object({
|
|
304
|
+
phase: z.enum(['pending', 'running', 'succeeded']),
|
|
305
|
+
value: z.string().optional(),
|
|
306
|
+
})
|
|
307
|
+
const snapshot = createAsyncOperationSnapshotSchema({
|
|
308
|
+
failure: z.object({ code: z.string() }),
|
|
309
|
+
progress: z.object({ current: z.number(), total: z.number() }),
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
const exportOperation = defineAsyncOperation({
|
|
313
|
+
mode: 'runtime-only',
|
|
314
|
+
name: 'export',
|
|
315
|
+
description: 'Export project data',
|
|
316
|
+
identity: { serviceName: 'exports', action: 'export', scope: 'user' },
|
|
317
|
+
startInput: z.object({ projectId: z.string() }),
|
|
318
|
+
id,
|
|
319
|
+
state,
|
|
320
|
+
snapshot,
|
|
321
|
+
start: ({ projectId }) => enqueueExport(projectId),
|
|
322
|
+
authorize: ({ id }, capability, ctx) => authorizeExport(id, capability, ctx),
|
|
323
|
+
inspect: ({ id }, ctx) => readExport(id, ctx.signal),
|
|
324
|
+
classify: (job) => ({ phase: job.phase }),
|
|
325
|
+
result: {
|
|
326
|
+
output: z.object({ value: z.string() }),
|
|
327
|
+
handler: (job) => ({ value: job.value ?? '' }),
|
|
328
|
+
},
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
const runtimeTools = exportOperation.runtimeTools
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### Durable application-owned execution
|
|
335
|
+
|
|
336
|
+
The executable reference
|
|
337
|
+
[`durable-async-operation-harness.ts`](../../packages/core/examples/tools/durable-async-operation-harness.ts)
|
|
338
|
+
shows the complete boundary behind that surface. It composes
|
|
339
|
+
`defineAsyncOperationContract`, `defineAsyncOperation`, `createApplication`,
|
|
340
|
+
`createBoundedAdmission`, managed shutdown and `createAgentToolFenceLifecycle`
|
|
341
|
+
around an injected store and provider.
|
|
342
|
+
|
|
343
|
+
The store transactionally owns the idempotency key **and normalized request
|
|
344
|
+
hash**. Reusing both returns the existing operation; reusing the key with a
|
|
345
|
+
different hash conflicts. Every mutation is an expected-revision CAS. Before an
|
|
346
|
+
external call, the application persists a unique attempt/effect key and marks
|
|
347
|
+
the dispatch `possibly-dispatched`; a lost response is therefore reconciled by
|
|
348
|
+
that key after restart and is never treated as permission to submit the effect
|
|
349
|
+
again. Provider acknowledgement, progress, cancellation intent, result and
|
|
350
|
+
artifact references remain durable application state.
|
|
351
|
+
|
|
352
|
+
Agent tool fencing and operation idempotency are separate guarantees. The fence
|
|
353
|
+
prevents a stale run owner from crossing an effect boundary; the transactional
|
|
354
|
+
idempotency record makes a repeated current call converge on one operation.
|
|
355
|
+
Neither replaces the other.
|
|
356
|
+
|
|
357
|
+
Stitchkit deliberately does **not** own the durable queue, operation database,
|
|
358
|
+
lease renewal, provider retry/reconciliation protocol, asset catalog or domain
|
|
359
|
+
states. The process-local application resource stops admission and drains
|
|
360
|
+
accepted work; unresolved durable records survive shutdown for the next
|
|
361
|
+
recovery pass. The packed consumer lane executes this composition from the
|
|
362
|
+
published package on Bun and Node.
|
|
363
|
+
|
|
364
|
+
Every follow-up repeats `authorize`; an opaque id is never authority. Aborting
|
|
365
|
+
`wait` only stops waiting and never calls optional domain `cancel`.
|
|
366
|
+
|
|
367
|
+
For a new HTTP surface, derive the canonical capability contract once. The
|
|
368
|
+
factory defines schemas and routes only; the application still supplies normal
|
|
369
|
+
handlers to `implement` and owns the job:
|
|
370
|
+
|
|
371
|
+
```ts
|
|
372
|
+
import { defineAsyncOperationContract } from 'stitchkit/tools'
|
|
373
|
+
import { z } from 'zod'
|
|
374
|
+
|
|
375
|
+
const operationId = z.object({ id: z.string() })
|
|
376
|
+
const operationSnapshot = z.object({
|
|
377
|
+
phase: z.enum(['pending', 'running', 'succeeded', 'failed', 'cancelled']),
|
|
378
|
+
})
|
|
379
|
+
|
|
380
|
+
const operations = defineAsyncOperationContract({
|
|
381
|
+
prefix: 'exports',
|
|
382
|
+
scope: 'user',
|
|
383
|
+
description: 'Export project data',
|
|
384
|
+
startInput: z.object({ projectId: z.string() }),
|
|
385
|
+
id: operationId,
|
|
386
|
+
snapshot: operationSnapshot,
|
|
387
|
+
cancel: true,
|
|
388
|
+
result: z.object({ downloadUrl: z.url() }),
|
|
389
|
+
})
|
|
390
|
+
|
|
391
|
+
// Pass operations.contract and ordinary handlers to implement(...).
|
|
392
|
+
// operations.capabilities/schemas/adapters are the canonical protocol metadata.
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
If an existing dedicated contract has a different wire shape — for example
|
|
396
|
+
`start` returns a snapshot while follow-ups accept separate envelopes — bind it
|
|
397
|
+
without casts or duplicate endpoints. Inline callbacks are contextually typed;
|
|
398
|
+
every returned id/input is parsed by the destination schema:
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
import { defineContract } from 'stitchkit/contract'
|
|
402
|
+
import { bindContractAsyncOperation } from 'stitchkit/tools'
|
|
403
|
+
|
|
404
|
+
const startOutput = z.object({ operation: operationId, acceptedAt: z.string() })
|
|
405
|
+
const statusInput = z.object({ operationId: z.string() })
|
|
406
|
+
const waitInput = z.object({ lookup: operationId })
|
|
407
|
+
|
|
408
|
+
const existing = defineContract({ prefix: 'exports' }, {
|
|
409
|
+
start: {
|
|
410
|
+
method: 'POST', path: '/', desc: 'Start export',
|
|
411
|
+
input: z.object({ projectId: z.string() }), output: startOutput,
|
|
412
|
+
},
|
|
413
|
+
status: {
|
|
414
|
+
method: 'POST', path: '/status', desc: 'Read export status',
|
|
415
|
+
input: statusInput, output: operationSnapshot,
|
|
416
|
+
},
|
|
417
|
+
wait: {
|
|
418
|
+
method: 'POST', path: '/wait', desc: 'Wait for export',
|
|
419
|
+
input: waitInput, output: operationSnapshot,
|
|
420
|
+
},
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
const operationHandlers = {
|
|
424
|
+
start: () => ({ operation: { id: 'example' }, acceptedAt: new Date().toISOString() }),
|
|
425
|
+
status: (): z.output<typeof operationSnapshot> => ({ phase: 'pending' }),
|
|
426
|
+
wait: (): z.output<typeof operationSnapshot> => ({ phase: 'succeeded' }),
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const bound = bindContractAsyncOperation({
|
|
430
|
+
mode: 'contract-backed',
|
|
431
|
+
binding: 'adapted',
|
|
432
|
+
contract: existing,
|
|
433
|
+
id: operationId,
|
|
434
|
+
capabilities: { start: 'start', status: 'status', wait: 'wait' },
|
|
435
|
+
adapters: {
|
|
436
|
+
idFromStart: (output) => output.operation,
|
|
437
|
+
inputFor: {
|
|
438
|
+
status: (id) => ({ operationId: id.id }),
|
|
439
|
+
wait: (id) => ({ lookup: id }),
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
handlers: operationHandlers,
|
|
443
|
+
})
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
Direct binding remains the short form when start already returns the id and
|
|
447
|
+
every follow-up reuses that exact schema instance. Its ID schema must be
|
|
448
|
+
wire-stable: input and output types match and parsing has no transform,
|
|
449
|
+
coercion, default or overwrite. This also excludes same-type transforms because
|
|
450
|
+
the direct adapters would parse an already parsed ID again. Use adapted binding
|
|
451
|
+
and explicitly project the parsed ID back into each follow-up input. In both
|
|
452
|
+
modes the binder creates no router;
|
|
453
|
+
it returns the existing contract, handlers and protocol metadata for
|
|
454
|
+
application composition.
|
|
455
|
+
|
|
456
|
+
### Explicit raw SDK registration
|
|
457
|
+
|
|
458
|
+
`rawTools` is deliberately named as an escape hatch. A tool registered there
|
|
459
|
+
does **not** receive stitchkit schema policy, lifecycle, per-call context or
|
|
460
|
+
hooks. The built-in `mountViewFile`, `mountWait`, `mountDownload` and
|
|
461
|
+
`mountUpload` helpers remain raw for callers that choose that boundary; the
|
|
462
|
+
media helper fetches with SSRF and path-traversal defenses:
|
|
463
|
+
|
|
464
|
+
```ts
|
|
465
|
+
import { createMcpHandler, mountViewFile } from 'stitchkit/tools'
|
|
466
|
+
|
|
467
|
+
const handleMcp = createMcpHandler({
|
|
468
|
+
serverInfo: { name: 'my-app', version: '1.0.0' },
|
|
469
|
+
auth,
|
|
470
|
+
services: [service],
|
|
471
|
+
rawTools: (server) => mountViewFile(server, { files }),
|
|
472
|
+
})
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
Use raw registration only when opting out is intentional. For a protected
|
|
476
|
+
`view_file`, use `defineViewFileTool` in `runtimeTools`; it supplies the
|
|
477
|
+
canonical schemas, shared batch budget, structured partial failures and both
|
|
478
|
+
multimodal presenters. `resolveMedia` remains the single-item core for custom
|
|
479
|
+
operations whose contract intentionally differs.
|
|
480
|
+
|
|
481
|
+
## Introspecting the complete tool surface
|
|
482
|
+
|
|
483
|
+
Deferred tool search, name snapshots and boot diagnostics accept the same
|
|
484
|
+
object-shaped surface as the mounts. Contract operations are followed by
|
|
485
|
+
runtime definitions, matching mount order; exposure filters and collisions are
|
|
486
|
+
resolved by Stitchkit rather than by consumer code:
|
|
487
|
+
|
|
488
|
+
```ts
|
|
489
|
+
import {
|
|
490
|
+
buildToolManifest,
|
|
491
|
+
listToolNames,
|
|
492
|
+
summarizeTransports,
|
|
493
|
+
} from 'stitchkit/tools'
|
|
494
|
+
|
|
495
|
+
const surface = { services, runtimeTools: [renderPreview] }
|
|
496
|
+
|
|
497
|
+
const manifest = buildToolManifest({
|
|
498
|
+
...surface,
|
|
499
|
+
transport: 'AGENT',
|
|
500
|
+
flattenUnionInput: true,
|
|
501
|
+
})
|
|
502
|
+
|
|
503
|
+
const names = listToolNames(surface)
|
|
504
|
+
const summary = summarizeTransports(surface)
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
`buildToolManifest` returns the exact immutable presentation schema shown to
|
|
508
|
+
the selected MCP or Agent transport. It does not execute validation effects and
|
|
509
|
+
fails first on duplicate contract/runtime names. There is no runtime-only
|
|
510
|
+
manifest helper or public mount adapter: the framework owns merging and schema
|
|
511
|
+
projection.
|
|
512
|
+
|
|
513
|
+
Applications using Stitchkit's durable runtime can compose this manifest with
|
|
514
|
+
bounded per-run activation through `createDeferredAgentToolSurface` from
|
|
515
|
+
`stitchkit/agent-runtime`. It keeps selected calls as direct `mountAgent` tools
|
|
516
|
+
rather than routing them through a generic executor. Search receipts live in
|
|
517
|
+
ordinary durable tool-result history, so recovery restores activation and a
|
|
518
|
+
queued successor cannot inherit it. See
|
|
519
|
+
[Bounded deferred tool catalogs](./agent-runtime.md#bounded-deferred-tool-catalogs)
|
|
520
|
+
and ADR 0129. Raw `mountAgent`, `mountMcp` and `buildToolManifest` behavior is
|
|
521
|
+
unchanged.
|
|
522
|
+
|
|
523
|
+
`listToolNames` remains diagnostic and reports `kind: 'contract' | 'runtime'`
|
|
524
|
+
for every identity. `summarizeTransports` returns `contractServices`,
|
|
525
|
+
`runtimeTools`, aggregate `totals`, and a `sources` breakdown. Runtime tools
|
|
526
|
+
contribute only to MCP/Agent according to their `transports`; they never inflate
|
|
527
|
+
HTTP or CLI counts.
|
|
528
|
+
|
|
529
|
+
## Logging tool calls — `createToolLogger`
|
|
530
|
+
|
|
531
|
+
Every tool mount fires an `afterToolCall` hook. `createToolLogger` is a ready
|
|
532
|
+
preset for it — one line logs each call (ok / failed, duration, which endpoint,
|
|
533
|
+
keyed by the endpoint's stable `serviceName` / `key` identity):
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
import { createToolLogger } from 'stitchkit/tools'
|
|
537
|
+
|
|
538
|
+
mountMcp(server, services, { hooks: createToolLogger() })
|
|
539
|
+
// [tool] ok list_widgets (widgets.list) 12ms
|
|
540
|
+
// [tool] warn get_widget (widgets.get) NOT_FOUND 4ms
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
By default the line goes to `console.error` — **stderr, never stdout**. That is
|
|
544
|
+
deliberate: in a stdio-MCP server stdout is the JSON-RPC protocol channel, and a
|
|
545
|
+
log line written there corrupts the stream. If you pass your own `log`, keep it
|
|
546
|
+
off stdout for any stdio deployment.
|
|
547
|
+
|
|
548
|
+
Pass `log` to redirect the line, or `onRecord` to feed a metrics sink the
|
|
549
|
+
structured `ToolCallRecord`. That record carries `traceId` whenever an
|
|
550
|
+
observability context is active, so a tool call made inside an HTTP request
|
|
551
|
+
joins that request's log line on one key — see
|
|
552
|
+
[Observability](./observability.md). For a boot-time picture of what is exposed
|
|
553
|
+
where, `summarizeTransports({ services, runtimeTools })` returns the mixed
|
|
554
|
+
per-transport counts for you to log.
|
|
555
|
+
|
|
556
|
+
## One handler, three callers
|
|
557
|
+
|
|
558
|
+
A contract handler runs the same for an HTTP request, an MCP tool call and an
|
|
559
|
+
agent tool call. `ctx.source` (`'http'` · `'mcp'` · `'agent'`) tells it which —
|
|
560
|
+
the rest of the context (`params`, `input`, anything `context` injects) is
|
|
561
|
+
identical. Write the handler once; it serves every surface.
|
|
562
|
+
|
|
563
|
+
==============================================================================
|
|
564
|
+
# API reference: `stitchkit/tools` (docs/api/reference.md)
|
|
565
|
+
==============================================================================
|
|
566
|
+
|
|
567
|
+
## `stitchkit/tools`
|
|
568
|
+
|
|
569
|
+
Server-only. Turns contracts into MCP and AI-agent tools. MCP server surfaces
|
|
570
|
+
need the `@modelcontextprotocol/server` v2 peer; MCP hosts/tests use the separate
|
|
571
|
+
`@modelcontextprotocol/client` package. Agent surfaces need the `ai` peer.
|
|
572
|
+
|
|
573
|
+
Framework-owned MCP tools advertise the exact declared output schema and return
|
|
574
|
+
the validated value unchanged as `structuredContent`, including arrays, scalars
|
|
575
|
+
and `null`. Tools without an output contract advertise and return no structured
|
|
576
|
+
payload.
|
|
577
|
+
|
|
578
|
+
| Export | Kind | Summary |
|
|
579
|
+
|--------|------|---------|
|
|
580
|
+
| `createMcpHandler` | function | a stateless dual-era Streamable-HTTP MCP handler — [guide](../guide/mcp-and-agents.md#mcp--createmcphandler) |
|
|
581
|
+
| `createMcpHttpRoute` | function | framework-owned `RawRoute` adapter for an MCP HTTP handler |
|
|
582
|
+
| `createStdioMcpServer` | function | a complete stdio MCP server — [guide](../guide/mcp-and-agents.md#mcp-over-stdio--createstdiomcpserver) |
|
|
583
|
+
| `bindStdioProcessSignals` | function | explicitly bind OS signals to one close-only stdio handle — [guide](../guide/testing-and-deployment.md#stdio-process-signals) |
|
|
584
|
+
| `buildMcpServer` | function | build an `McpServer` from contract/runtime surfaces; no-auth configs omit the second argument |
|
|
585
|
+
| `mountMcp` | function | add contract tools to an existing `McpServer` — [guide](../guide/mcp-and-agents.md#mountmcp) |
|
|
586
|
+
| `mountAgent` | function | a Vercel AI SDK `ToolSet` from a service; failed executions reject through the SDK tool-error channel with a safe typed envelope, while successful output is never classified by field name — [guide](../guide/mcp-and-agents.md#ai-agents--mountagent) |
|
|
587
|
+
| `defineRuntimeTool` | function | define one validated pathless operation for explicit MCP, Agent and/or CLI surfaces — [guide](../guide/mcp-and-agents.md#pathless-runtime-tools-and-multimodal-results) |
|
|
588
|
+
| `createRuntimeToolFactory` | function | bind shared identity and Zod-validated per-call context for runtime tools — [guide](../guide/mcp-and-agents.md#pathless-runtime-tools-and-multimodal-results) |
|
|
589
|
+
| `createToolInvoker` | function | compile an exposure-aware in-process dispatcher over the canonical tool runner; use peer-free `stitchkit/tools/invoker`, or the full `stitchkit/tools` adapter barrel — [guide](../guide/mcp-and-agents.md#in-process-calls--createtoolinvoker) |
|
|
590
|
+
| `createToolkit` | function | context-typed tool mounts — [guide](../guide/cli.md#typed-context) |
|
|
591
|
+
| `mountViewFile` | function | a native multimodal "view file" MCP tool |
|
|
592
|
+
| `resolveMedia` | function | resolve a media reference for a tool result |
|
|
593
|
+
| `validateMcpSchemas` | function | object-shaped assertion over the exact advertised schema surface — compatibility, typed properties and portable formats ([guide](../guide/mcp-and-agents.md#mcp-schema-validation-profile)) |
|
|
594
|
+
| `listToolNames` | function | every contract/runtime tool name with origin, identity and transports — for stable snapshots — [guide](../guide/mcp-and-agents.md#pinning-tool-names--listtoolnames) |
|
|
595
|
+
| `listContractToolNames` | function | the same listing straight from contracts — no handlers or stub services needed |
|
|
596
|
+
| `describeToolCatalog` | function | inspect the exact model-facing names, source identities, schema byte sizes and deferred state; an explicit total byte budget fails closed |
|
|
597
|
+
| `ToolCatalogConfig` / `ToolCatalogEntry` | _type_ | catalog source, transport, optional explicit schema budget and one inspectable result row |
|
|
598
|
+
| `McpHandlerConfig` | _type_ | server surface plus stateless HTTP transport config |
|
|
599
|
+
| `McpHttpConfig` | _type_ | HTTP auth, protected-resource, legacy-era and security options |
|
|
600
|
+
| `McpHttpHandler` | _type_ | framework-owned `{ fetch(request), close() }` lifecycle |
|
|
601
|
+
| `McpHttpSecurityConfig` | _type_ | Fetch-boundary Host and Origin allowlists |
|
|
602
|
+
| `McpLegacyPolicy` | _type_ | `'serve' \| 'reject'` protocol-era compatibility policy |
|
|
603
|
+
| `McpStdioHandle` | _type_ | closeable official stdio transport handle |
|
|
604
|
+
| `StdioMcpServerConfig` | _type_ | config for `createStdioMcpServer` |
|
|
605
|
+
| `StdioCloseTarget` | _type_ | minimal close-only target accepted by `bindStdioProcessSignals` |
|
|
606
|
+
| `StdioProcessSignalsOptions` | _type_ | signal source, close callbacks and phased error reporting |
|
|
607
|
+
| `StdioProcessSignalsBinding` | _type_ | close-only signal binding with observed `promise` and listener `close()` |
|
|
608
|
+
| `StdioProcessSignalsErrorPhase` | _type_ | `'prepare' \| 'close' \| 'complete'` reporting phase |
|
|
609
|
+
| `McpServerBuildConfig` | _type_ | shared config for `buildMcpServer` |
|
|
610
|
+
| `McpServerSharedConfig` | _type_ | transport-neutral options shared by direct and finite surface configs |
|
|
611
|
+
| `McpServer` | _type_ | official split-SDK server instance accepted by raw extension points |
|
|
612
|
+
| `DirectMcpSurfaceConfig` | _type_ | static or identity-dynamic `services` / `runtimeTools` source |
|
|
613
|
+
| `FiniteMcpSurfaceConfig` | _type_ | bounded `surfaces` registry plus typed selector |
|
|
614
|
+
| `McpSurfaceDefinition` | _type_ | one immutable `{ services, runtimeTools }` MCP surface |
|
|
615
|
+
| `McpSurfaceRegistry` | _type_ | finite keyed surface registry for eager preparation |
|
|
616
|
+
| `StdioAuthConfig` | _type_ | startup identity composed into `StdioMcpServerConfig` |
|
|
617
|
+
| `McpMountConfig` | _type_ | config for `mountMcp` |
|
|
618
|
+
| `McpSchemaValidationConfig` | _type_ | shared `{ policy, requireTypedProperties, allowUntyped, requirePortableFormats, allowFormats }` profile |
|
|
619
|
+
| `ValidateMcpSchemasConfig` | _type_ | standalone validation profile plus `services`, `extend`, flattening and logger |
|
|
620
|
+
| `RuntimeToolDefinition` | _type_ | transport-neutral pathless operation with identity, schemas, handler and optional presenters |
|
|
621
|
+
| `RuntimeToolDefinitionBase` | _type_ | common name, identity, input, exposure and MCP metadata fields |
|
|
622
|
+
| `RuntimeToolDefinitionWithOutput` | _type_ | runtime definition whose handler and presenters share a validated output type |
|
|
623
|
+
| `RuntimeToolDefinitionWithoutOutput` | _type_ | runtime definition with a void handler and no presentation callbacks |
|
|
624
|
+
| `RuntimeToolFactory` | _type_ | identity/context-bound runtime-tool definition factory |
|
|
625
|
+
| `RuntimeToolFactoryConfig` | _type_ | factory service identity and context schema |
|
|
626
|
+
| `RuntimeToolFactoryDefinitionWithOutput` | _type_ | factory-authored runtime tool with a validated output schema |
|
|
627
|
+
| `RuntimeToolFactoryDefinitionWithoutOutput` | _type_ | factory-authored void runtime tool without presenters |
|
|
628
|
+
| `RuntimeToolFactoryHandlerContext` | _type_ | parsed factory context plus parsed tool input |
|
|
629
|
+
| `RuntimeToolFactoryIdentityFields` | _type_ | per-tool action, semantic method and optional identity metadata |
|
|
630
|
+
| `RuntimeToolIdentity` | _type_ | `{ serviceName, action, scope?, method, meta? }` for runtime lifecycle/audit |
|
|
631
|
+
| `RuntimeToolHandlerContext` | _type_ | runtime context with the definition's parsed input |
|
|
632
|
+
| `RuntimeToolOutput` | _type_ | output inferred from a runtime tool's optional Zod schema |
|
|
633
|
+
| `RuntimeToolPresenters` | _type_ | optional MCP and AI SDK `toModelOutput` presentation callbacks |
|
|
634
|
+
| `RuntimeMcpPresentation` | _type_ | MCP content/metadata result without framework-owned `structuredContent` or `isError` |
|
|
635
|
+
| `RuntimeMcpInput` | _type_ | typed accepted multi-round input for an opted-in runtime tool |
|
|
636
|
+
| `OAuthClientRegistrationConfig` | _type_ | deterministic pre-registered → CIMD → explicit-DCR client resolution |
|
|
637
|
+
| `CimdClientMetadata` | _type_ | validated Client ID Metadata Document |
|
|
638
|
+
| `CimdClientMetadataFetcher` | _type_ | injectable secure network boundary for metadata loading |
|
|
639
|
+
| `CimdFetchResponse` | _type_ | bounded metadata fetch result passed across the injectable network boundary |
|
|
640
|
+
| `CimdFetchPolicy` | _type_ | CIMD timeout, redirect and size limits |
|
|
641
|
+
| `CimdCachePolicy` | _type_ | bounded HTTP-aware cache policy: separate positive/negative pools (`maxEntries`), per-client and server-wide resolution rate limits (`maxResolutionsPerClient` / `maxResolutions` per `resolutionWindowMs`) |
|
|
642
|
+
| `CimdCacheEvent` | _type_ | observable CIMD cache hit, miss, revalidation and eviction event |
|
|
643
|
+
| `createSecureClientMetadataFetcher` | function | production HTTPS, DNS/IP-pinned CIMD fetcher |
|
|
644
|
+
| `RuntimeAgentModelOutput` | _type_ | AI SDK model-facing text/JSON/content output returned by `present.agent` |
|
|
645
|
+
| `AgentMountConfig` | _type_ | config for `mountAgent` |
|
|
646
|
+
| `AgentToolRegistry` / `AgentToolRegistryBuilder` / `AgentToolRegistryInput` | _type_ | the composed runtime surface and its builder: declared defaults, `replace`/`disable` by name, and the exact `{ tools, names }` a mount receives |
|
|
647
|
+
| `defineToolRegistry` | function | compose runtime tools over one declared default set; an unknown `replace`/`disable` name is refused instead of silently leaving the default in place |
|
|
648
|
+
| `AgentContext` | _type_ | the context merged into agent tool handlers |
|
|
649
|
+
| `Toolkit` | _type_ | the context-pinned tool surface from `createToolkit` |
|
|
650
|
+
| `ToolExtend` | _type_ | extra-args extension for `mountMcp` / `mountAgent` |
|
|
651
|
+
| `ToolLifecycle` | _type_ | `beforeHandle` / `afterHandle` gate for tool calls — [guide](../guide/mcp-and-agents.md#guarding-tools--lifecycle) |
|
|
652
|
+
| `ToolExecutionControlReason` | _type_ | internal managed-execution stop reason: stale run or requested interruption |
|
|
653
|
+
| `ToolExecutionControlError` | class | control-flow error used to unwind a superseded managed tool call without presenting it as a model-facing tool failure |
|
|
654
|
+
| `isToolExecutionControlError` | function | narrow an unknown thrown value to the managed execution control error |
|
|
655
|
+
| `ToolOperation` | _type_ | executable path-free operation shape shared by contract and framework-native runners |
|
|
656
|
+
| `ToolCallHooks` | _type_ | object-shaped `beforeToolCall` / `afterToolCall` / `onToolError` observability hooks; the raw thrown value reaches the last two as `error` ([guide](../guide/observability.md#the-cause-behind-a-failed-tool-call)) |
|
|
657
|
+
| `BeforeToolCallOptions` | _type_ | `{ toolName, args, context, endpoint }` passed before execution |
|
|
658
|
+
| `AfterToolCallOptions` | _type_ | completed call options plus `{ result, durationMs, error? }` |
|
|
659
|
+
| `ToolErrorOptions` | _type_ | `{ toolName, error, context, endpoint }` for a thrown handler-path value |
|
|
660
|
+
| `ErrorHintFn` | _type_ | `(toolName, errorCode) => string \| null` — a per-tool recovery hint, shared by every mount |
|
|
661
|
+
| `ToolResult` | _type_ | the result of one tool call |
|
|
662
|
+
| `ToolInvoker` | _type_ | immutable compiled dispatcher (`names`, envelope `invoke`, throwing `invokeOrThrow`) |
|
|
663
|
+
| `ToolInvokerConfig` | _type_ | compile-time exposure, extension and presentation options |
|
|
664
|
+
| `ToolInvocationOptions` | _type_ | per-call source, context, lifecycle, hooks and output-strip reporter |
|
|
665
|
+
| `ToolCallContext` | _type_ | the context every tool hook receives — `{ source, mcp? }` plus whatever the mount's `context` added |
|
|
666
|
+
| `ViewFileOptions` | _type_ | shared URL/managed-file-boundary policy for `defineViewFileTool`, `mountViewFile` and `resolveMedia` |
|
|
667
|
+
| `ViewFileOutput` | _type_ | neutral managed batch result with multimodal `content` and per-item `errors` |
|
|
668
|
+
| `ViewFileInputSchema` | constant | fixed one-or-many media path/URL input schema |
|
|
669
|
+
| `ViewFileOutputSchema` | constant | Zod schema for the neutral managed view-file batch result |
|
|
670
|
+
| `ViewFileErrorSchema` | constant | Zod schema for one structured per-item view failure |
|
|
671
|
+
| `McpAnnotations` | _type_ | MCP annotations on a media result |
|
|
672
|
+
| `McpAnnotationsSchema` | constant | Zod schema for MCP media annotations |
|
|
673
|
+
| `McpMediaContentSchema` | constant | Zod schema for text/image/audio media content |
|
|
674
|
+
| `CollectToolsConfig` | _type_ | options for `collectTools` |
|
|
675
|
+
| `findUntypedProperties` | function | every property in a JSON Schema with no `type`/`enum`/`$ref` — what a model is shown and cannot obey ([guide](../guide/mcp-and-agents.md)) |
|
|
676
|
+
| `UntypedProperty` | _type_ | one such property — `{ path, description? }` |
|
|
677
|
+
| `findNonPortableFormats` | function | deep finder for formats outside the portable MCP/AJV baseline |
|
|
678
|
+
| `NonPortableFormat` | _type_ | one `{ path, format }` portability finding |
|
|
679
|
+
| `PORTABLE_JSON_SCHEMA_FORMATS` | constant | portable-format baseline used by MCP validation |
|
|
680
|
+
| `ToolNameEntry` | _type_ | one `listToolNames` row — `{ kind, name, service, method, transports }` |
|
|
681
|
+
| `IncompatibleSchemaPolicy` | _type_ | `'throw' \| 'skip' \| 'warn'` |
|
|
682
|
+
| `McpMediaContent` | _type_ | a multimodal MCP content item |
|
|
683
|
+
|
|
684
|
+
### Native tools
|
|
685
|
+
|
|
686
|
+
Generic host-supplied operations — managed definitions for the canonical
|
|
687
|
+
runtime-tool runner, plus deliberate raw MCP adapters over the same mechanics.
|
|
688
|
+
|
|
689
|
+
| Export | Kind | Summary |
|
|
690
|
+
|--------|------|---------|
|
|
691
|
+
| `defineDownloadTool` | function | define a guarded, size-capped managed download for MCP/Agent `runtimeTools` |
|
|
692
|
+
| `defineUploadTool` | function | define a typed managed local-file upload for MCP/Agent `runtimeTools` |
|
|
693
|
+
| `defineWaitTool` | function | define a typed, cancellable managed polling operation for MCP/Agent `runtimeTools` |
|
|
694
|
+
| `defineViewFileTool` | function | define a guarded, batch-capped managed multimodal operation for MCP/Agent `runtimeTools` |
|
|
695
|
+
| `DefineDownloadToolConfig` | _type_ | Zod input, stable identity, URL resolver, storage policy and presenters for `defineDownloadTool` |
|
|
696
|
+
| `DefineUploadToolConfig` | _type_ | stable identity, typed output, upload callback and presenters for `defineUploadTool` |
|
|
697
|
+
| `DefineWaitToolConfig` | _type_ | Zod input/state, identity, poll/done/timeout policy and presenters for `defineWaitTool` |
|
|
698
|
+
| `DefineViewFileToolConfig` | _type_ | identity, media security policy and optional presenters for `defineViewFileTool` |
|
|
699
|
+
| `ManagedNativeToolConfig` | _type_ | shared name, description, identity, exposure and annotations for managed native factories |
|
|
700
|
+
| `NativeToolIdentity` | _type_ | pathless service/action/scope/meta identity; semantic method is factory-owned |
|
|
701
|
+
| `ManagedWaitRender` | _type_ | optional managed wait terminal text and failure classification |
|
|
702
|
+
| `UploadToolInputSchema` | constant | fixed `{ path: string }` input schema for `defineUploadTool` |
|
|
703
|
+
| `defineAsyncOperation` | function | runtime-only start/status/wait plus configured cancel/result/artifacts definitions; see the [durable application-owned recipe](../guide/mcp-and-agents.md#durable-application-owned-execution) |
|
|
704
|
+
| `defineAsyncOperationContract` | function | define one canonical Zod-first HTTP contract for start/status/wait plus optional capabilities; execution and recovery remain application-owned |
|
|
705
|
+
| `bindContractAsyncOperation` | function | bind literal methods from an existing contract without creating another HTTP surface |
|
|
706
|
+
| `createAsyncOperationSnapshotSchema` | function | canonical pending/running/succeeded/failed/cancelled Zod snapshot |
|
|
707
|
+
| `AsyncOperationSnapshotSchema` | _type_ | the snapshot union `createAsyncOperationSnapshotSchema` returns when no `progress` schema is configured |
|
|
708
|
+
| `AsyncOperationSnapshotSchemaWithProgress` | _type_ | the same union with the configured `progress` schema optional on every phase |
|
|
709
|
+
| `AsyncOperationCancelResultSchema` | constant | validated accepted/already_terminal/rejected cancellation result |
|
|
710
|
+
| `AsyncOperationCancelResult` | _type_ | validated cancel capability result |
|
|
711
|
+
| `AsyncOperationCancelCapability` | _type_ | optional typed domain cancellation callback |
|
|
712
|
+
| `AsyncOperationCapability` | _type_ | generated capability-name union |
|
|
713
|
+
| `AsyncOperationStartDefinition` / `AsyncOperationFollowDefinition` | _type_ | generated runtime definition types |
|
|
714
|
+
| `AsyncOperationIdentity` | _type_ | shared service/action/scope/meta identity for an operation |
|
|
715
|
+
| `AsyncOperationOutputCapability` | _type_ | optional result/artifact schema plus handler |
|
|
716
|
+
| `RuntimeAsyncOperationConfig` | _type_ | runtime-only descriptor configuration |
|
|
717
|
+
| `RuntimeAsyncOperation` | _type_ | inferred generated definitions and schemas |
|
|
718
|
+
| `AsyncOperationContractConfig` | _type_ | canonical contract config where start returns the operation id; optional `expose` names the transports per capability, because this contract is built inside the framework and never passes through a consumer's `toolExposure: 'explicit'` factory |
|
|
719
|
+
| `AsyncOperationContractWithStartOutputConfig` | _type_ | canonical contract config with an application start envelope and typed id extractor |
|
|
720
|
+
| `DefinedAsyncOperationContract` | _type_ | generated contract, capability keys, schemas and parsed adapters |
|
|
721
|
+
| `ContractAsyncOperationConfig` | _type_ | literal contract method binding and handlers |
|
|
722
|
+
| `AdaptedContractAsyncOperationConfig` | _type_ | existing-contract binding with explicit id and per-capability input adapters |
|
|
723
|
+
| `BoundAdaptedContractAsyncOperation` | _type_ | inferred adapted binding with parsed id/input projectors |
|
|
724
|
+
| `AdaptedContractAsyncOperationStartKey` | _type_ | existing-contract keys with a declared start output |
|
|
725
|
+
| `AdaptedContractAsyncOperationFollowKey` | _type_ | existing-contract keys with both input and output schemas |
|
|
726
|
+
| `AdaptedContractAsyncOperationWaitKey` | _type_ | adapted follow-up keys whose output matches the selected status snapshot |
|
|
727
|
+
| `ContractAsyncOperationInputAdapters` | _type_ | guaranteed direct-binding status/wait input adapters plus configured optional capabilities |
|
|
728
|
+
| `ContractAsyncOperationKeys` | _type_ | literal method-key union of a bound contract |
|
|
729
|
+
| `ContractAsyncOperationStartKey` | _type_ | direct-binding start keys whose declared ID schema has stable input/output |
|
|
730
|
+
| `ContractAsyncOperationFollowKey` | _type_ | contract keys whose input schema type matches the selected start output |
|
|
731
|
+
| `ContractAsyncOperationWaitKey` | _type_ | follow-up keys whose output schema type also matches the selected status output |
|
|
732
|
+
| `composeToolLifecycle` | function | ordered composition of tool before/after phases |
|
|
733
|
+
| `mountDownload` | function | raw MCP "download a URL to disk" adapter (SSRF-guarded, size-capped) |
|
|
734
|
+
| `mountUpload` | function | raw MCP "upload a local file" adapter |
|
|
735
|
+
| `mountWait` | function | raw MCP generic `--wait`-style polling adapter |
|
|
736
|
+
| `DownloadToolConfig` | _type_ | config for `mountDownload` |
|
|
737
|
+
| `UploadToolConfig` | _type_ | config for `mountUpload` |
|
|
738
|
+
| `WaitToolConfig` | _type_ | config for `mountWait` |
|
|
739
|
+
|
|
740
|
+
### OAuth 2.1 provider
|
|
741
|
+
|
|
742
|
+
A native remote-connector auth surface for MCP — [guide](../guide/mcp-and-agents.md#oauth-21--a-native-remote-connector).
|
|
743
|
+
|
|
744
|
+
| Export | Kind | Summary |
|
|
745
|
+
|--------|------|---------|
|
|
746
|
+
| `mountOAuthProvider` | function | the OAuth 2.1 provider routes (DCR, PKCE, token) |
|
|
747
|
+
| `oauthProtectedResourceRoute` | function | the RFC 9728 protected-resource-metadata route |
|
|
748
|
+
| `protectedResourceMetadataUrl` | function | build the metadata URL for a resource |
|
|
749
|
+
| `wwwAuthenticateHeader` | function | build the `WWW-Authenticate` challenge header |
|
|
750
|
+
| `PROTECTED_RESOURCE_PATH` | const | the well-known metadata path |
|
|
751
|
+
| `OAuthProviderConfig` | _type_ | config for `mountOAuthProvider` |
|
|
752
|
+
| `ProtectedResourceConfig` | _type_ | config for `oauthProtectedResourceRoute` |
|
|
753
|
+
| `ApplicationType` | _type_ | DCR `application_type` — `'native'` (loopback allowed) \| `'web'` (https only) |
|
|
754
|
+
| `AuthCodeData` | _type_ | a stored authorization-code record |
|
|
755
|
+
| `AuthRequest` | _type_ | a parsed authorization request |
|
|
756
|
+
| `ClientMetadata` | _type_ | dynamic-client-registration metadata |
|
|
757
|
+
| `RefreshData` | _type_ | a stored refresh-token record |
|
|
758
|
+
| `RegisteredClient` | _type_ | a registered OAuth client |
|
|
759
|
+
|
|
760
|
+
### Durable tool bodies
|
|
761
|
+
|
|
762
|
+
A mounted tool body can be made restartable without adopting `agent-runtime`: declare a
|
|
763
|
+
factory and `step` / `sleep` / `waitFor` appear in the handler context, backed by whatever
|
|
764
|
+
ledger the application already has.
|
|
765
|
+
|
|
766
|
+
```ts
|
|
767
|
+
mountAgent(services, { durability: (toolCallId) => myLedgerFor(toolCallId) });
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
| Export | Kind | Summary |
|
|
771
|
+
|--------|------|---------|
|
|
772
|
+
| `ToolDurability` | _type_ | the port a tool body needs: `step`, `sleep`, `waitFor` |
|
|
773
|
+
| `ToolDurabilityFactory` | _type_ | `(toolCallId, signal) => ToolDurability`, called once per call |
|
|
774
|
+
| `DurableJsonValue` | _type_ | what a durable step result may hold — a record is read back in another process, so it must be JSON |
|
|
775
|
+
| `createLocalStepDurability` | function | the durability engine — replay, absolute deadlines, park/deliver — over a two-method ledger the application owns |
|
|
776
|
+
| `StepDurabilityLedger` | _type_ | the two methods an engine needs: `appendEvent`, `readEvents` |
|
|
777
|
+
| `LocalStepDurability` | _type_ | what the engine returns; satisfies `ToolDurability` and adds `deliver` and record introspection for the ledger's owner |
|
|
778
|
+
| `LocalStepDurabilityOptions` | _type_ | `{ store, conversationId, runId, signal?, subscribe?, clock? }` |
|
|
779
|
+
| `AppendAgentStoreEvent` / `ReadAgentStoreEvents` / `AgentStoreEventEnvelope` / `AgentStoreEventPage` | _type_ | the ledger's row shapes, re-exported so a ledger is typed from the entrypoint that consumes it |
|
|
780
|
+
| `AgentToolError` | class | the model-safe envelope a failed agent tool throws |
|
|
781
|
+
| `isAgentToolError` | function | brand check for it — a consumer running its own loop no longer parses the message |
|
|
782
|
+
|
|
783
|
+
### Catalog stamp
|
|
784
|
+
|
|
785
|
+
Every advertised tool and every tool result carries the fingerprint of the catalog it came
|
|
786
|
+
from, so a long-lived consumer can see that its own copy is stale **without making a
|
|
787
|
+
request for it**. `createMcpHandler` is stateless by construction and therefore has no
|
|
788
|
+
retained session to push `notifications/tools/list_changed` down; the stamp needs none.
|
|
789
|
+
|
|
790
|
+
Store the stamp beside the tools when you list them, compare it against the one on every
|
|
791
|
+
result, and re-list when they differ — including on a refusal, which is exactly when a
|
|
792
|
+
stale catalog is the likeliest explanation and the least visible one. The server side
|
|
793
|
+
needs no wiring: every mount stamps what it advertises.
|
|
794
|
+
|
|
795
|
+
| Export | Kind | Summary |
|
|
796
|
+
|--------|------|---------|
|
|
797
|
+
| `readMcpCatalogStamp` | function | read a peer's stamp out of `_meta`, or `null` when there is none |
|
|
798
|
+
| `mcpCatalogMeta` | function | the `_meta` fragment a stamped tool or result carries |
|
|
799
|
+
| `MCP_CATALOG_META_KEY` | const | the namespaced `_meta` key (`stitchkit/catalog`) |
|
|
800
|
+
| `McpCatalogStamp` | _type_ | `{ digest, tools }` — the catalog fingerprint and its tool count |
|
|
801
|
+
|
|
802
|
+
### MCP Apps (widgets)
|
|
803
|
+
|
|
804
|
+
Interactive MCP resources — [ADR 0019](../decisions/0019-generic-native-tools.md).
|
|
805
|
+
|
|
806
|
+
| Export | Kind | Summary |
|
|
807
|
+
|--------|------|---------|
|
|
808
|
+
| `mountMcpResource` | function | mount an MCP Apps widget resource |
|
|
809
|
+
| `inlineMcpAppBundle` | function | inline a built widget bundle into a resource |
|
|
810
|
+
| `EXT_APPS_BUNDLE_PLACEHOLDER` | const | the placeholder token `inlineMcpAppBundle` replaces |
|
|
811
|
+
| `RESOURCE_MIME_TYPE` | const | the MCP Apps resource MIME type |
|
|
812
|
+
| `McpResourceDef` | _type_ | an MCP Apps resource definition |
|
|
813
|
+
| `McpAppResourceMeta` | _type_ | resource `_meta` for an MCP App |
|
|
814
|
+
| `McpAppCsp` | _type_ | the widget content-security policy |
|
|
815
|
+
|
|
816
|
+
### Introspection & internals
|
|
817
|
+
|
|
818
|
+
Advanced building blocks — the shared machinery the mounts are built on.
|
|
819
|
+
|
|
820
|
+
| Export | Kind | Summary |
|
|
821
|
+
|--------|------|---------|
|
|
822
|
+
| `collectTools` | function | resolve a service's methods to mountable tools (the shared resolver) |
|
|
823
|
+
| `createToolLogger` | function | a ready `afterToolCall` that logs every tool call — [guide](../guide/mcp-and-agents.md#logging-tool-calls--createtoollogger) |
|
|
824
|
+
| `summarizeTransports` | function | mixed contract/runtime operation counts and per-source breakdown for a boot-time summary |
|
|
825
|
+
| `buildToolManifest` | function | transport-aware searchable `{ name, description, inputSchema }` rows from a mixed surface |
|
|
826
|
+
| `ToolLoggerConfig` | _type_ | config for `createToolLogger` |
|
|
827
|
+
| `ToolCallRecord` | _type_ | the structured record `createToolLogger` passes to `onRecord` |
|
|
828
|
+
| `TransportSummary` | _type_ | `{ contractServices, runtimeTools, totals, sources }` from `summarizeTransports` |
|
|
829
|
+
| `TransportCounts` | _type_ | per-transport counts (`{ HTTP, MCP, AGENT, CLI }`) |
|
|
830
|
+
| `ToolSurfaceDefinition` | _type_ | shared object-shaped `{ services?, runtimeTools? }` introspection surface |
|
|
831
|
+
| `ToolManifestConfig` | _type_ | mixed surface plus required model-facing `transport` and presentation options |
|
|
832
|
+
| `coerceJsonArgs` | function | coerce JSON-stringified array/object tool arguments |
|
|
833
|
+
| `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins; divergent fields retain every provable base kind in a deterministic `type` array, and the projection never executes validation |
|
|
834
|
+
| `ToolPresentationSchema` | _type_ | immutable model-facing JSON Schema document shared by tool transports |
|
|
835
|
+
| `MountableTool` | _type_ | one operation with separate executable CLI argument schema and model-facing presentation schema |
|
|
836
|
+
| `ToolManifestEntry` | _type_ | one `buildToolManifest` row |
|
|
837
|
+
|
|
838
|
+
---
|