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
|
@@ -1,23 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
base64UrlToBytes,
|
|
3
|
-
bytesToBase64Url
|
|
4
|
-
} from "./index-rxfy4cq7.js";
|
|
5
|
-
import {
|
|
6
|
-
AppError,
|
|
7
|
-
STITCH_ERROR_STATUS,
|
|
8
|
-
isStitchErrorCode
|
|
9
|
-
} from "./index-2vtcmrj9.js";
|
|
10
1
|
import {
|
|
11
2
|
isUnsafeKey
|
|
12
3
|
} from "./index-kzfs85xp.js";
|
|
13
4
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
typedEntries
|
|
17
|
-
} from "./index-77fekveh.js";
|
|
5
|
+
isRecord
|
|
6
|
+
} from "./index-hffjpmq9.js";
|
|
18
7
|
|
|
19
|
-
// src/
|
|
8
|
+
// src/contract/tool-view.ts
|
|
20
9
|
import { z } from "zod";
|
|
10
|
+
var DECLARED_TOOL_VIEW = Symbol.for("stitchkit.toolView");
|
|
11
|
+
function withToolView(endpoint, view) {
|
|
12
|
+
const declared = { ...view, [DECLARED_TOOL_VIEW]: true };
|
|
13
|
+
return { ...endpoint, tool: { ...endpoint.tool, view: declared } };
|
|
14
|
+
}
|
|
15
|
+
function objectKeys(schema) {
|
|
16
|
+
return schema instanceof z.ZodObject ? new Set(Object.keys(schema.shape)) : new Set;
|
|
17
|
+
}
|
|
18
|
+
function assertToolView(prefix, key, ep) {
|
|
19
|
+
const where = `Contract "${prefix}": endpoint "${key}" tool.view`;
|
|
20
|
+
const tool = Reflect.get(ep, "tool");
|
|
21
|
+
const view = isRecord(tool) ? tool.view : undefined;
|
|
22
|
+
if (!isRecord(view))
|
|
23
|
+
throw new Error(`${where} must be an object`);
|
|
24
|
+
if (Reflect.get(view, DECLARED_TOOL_VIEW) !== true) {
|
|
25
|
+
throw new Error(`${where} must be declared with withToolView, which types its project`);
|
|
26
|
+
}
|
|
27
|
+
if (ep.rawResponse || ep.rawBody || ep.multipart || "responseMeta" in ep || "stream" in ep) {
|
|
28
|
+
throw new Error(`${where} is only for a JSON tool endpoint — this one is HTTP-only by kind`);
|
|
29
|
+
}
|
|
30
|
+
if (!ep.output) {
|
|
31
|
+
throw new Error(`${where} needs the endpoint's full output — the view is derived from it`);
|
|
32
|
+
}
|
|
33
|
+
const output = view.output;
|
|
34
|
+
const project = view.project;
|
|
35
|
+
if (output !== undefined && !(output instanceof z.ZodType)) {
|
|
36
|
+
throw new Error(`${where}.output must be a Zod schema`);
|
|
37
|
+
}
|
|
38
|
+
if (project !== undefined && typeof project !== "function") {
|
|
39
|
+
throw new Error(`${where}.project must be a function`);
|
|
40
|
+
}
|
|
41
|
+
if (output === undefined && project === undefined) {
|
|
42
|
+
throw new Error(`${where} declares neither output nor project — it would change nothing`);
|
|
43
|
+
}
|
|
44
|
+
const defaults = view.defaults;
|
|
45
|
+
if (defaults === undefined)
|
|
46
|
+
return;
|
|
47
|
+
if (!isRecord(defaults))
|
|
48
|
+
throw new Error(`${where}.defaults must be an object`);
|
|
49
|
+
const entries = Object.entries(defaults);
|
|
50
|
+
if (entries.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
if (!(ep.input instanceof z.ZodObject)) {
|
|
53
|
+
throw new Error(`${where}.defaults needs an object input schema to name keys of`);
|
|
54
|
+
}
|
|
55
|
+
const inputKeys = objectKeys(ep.input);
|
|
56
|
+
const paramKeys = objectKeys(ep.params);
|
|
57
|
+
for (const [name, value] of entries) {
|
|
58
|
+
if (paramKeys.has(name)) {
|
|
59
|
+
throw new Error(`${where}.defaults.${name} is a path param — a route segment has no default`);
|
|
60
|
+
}
|
|
61
|
+
if (!inputKeys.has(name)) {
|
|
62
|
+
throw new Error(`${where}.defaults.${name} is not a key of the endpoint's input`);
|
|
63
|
+
}
|
|
64
|
+
const field = ep.input.shape[name];
|
|
65
|
+
if (field === undefined || !z.safeParse(field, value).success) {
|
|
66
|
+
throw new Error(`${where}.defaults.${name} is not a valid value for that input key`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/internal/route-pattern.ts
|
|
72
|
+
import { z as z2 } from "zod";
|
|
21
73
|
var PARAM_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
22
74
|
function joinRoutePath(...parts) {
|
|
23
75
|
const joined = parts.filter((part) => Boolean(part)).map((part) => part.replace(/^\/+|\/+$/g, "")).filter(Boolean).join("/");
|
|
@@ -65,10 +117,10 @@ function resolveRouteParamsSchema(path, schema) {
|
|
|
65
117
|
if (!schema) {
|
|
66
118
|
const shape = {};
|
|
67
119
|
for (const parameter of parameters)
|
|
68
|
-
shape[parameter.name] =
|
|
69
|
-
return
|
|
120
|
+
shape[parameter.name] = z2.string();
|
|
121
|
+
return z2.object(shape);
|
|
70
122
|
}
|
|
71
|
-
const jsonSchema =
|
|
123
|
+
const jsonSchema = z2.toJSONSchema(schema, { io: "input", unrepresentable: "any" });
|
|
72
124
|
const properties = jsonSchema.properties;
|
|
73
125
|
if (!properties) {
|
|
74
126
|
throw new Error(`Route params schema for path "${path}" must be an object schema with a property per path field`);
|
|
@@ -95,6 +147,7 @@ function parseTrailingWildcard(path) {
|
|
|
95
147
|
|
|
96
148
|
// src/contract/define.ts
|
|
97
149
|
var ALL_TRANSPORTS = ["HTTP", "MCP", "AGENT", "CLI"];
|
|
150
|
+
var TOOL_TRANSPORTS = ["MCP", "AGENT", "CLI"];
|
|
98
151
|
function defineContract(meta, endpoints) {
|
|
99
152
|
const materializedEndpoints = {};
|
|
100
153
|
for (const [key, endpoint] of Object.entries(endpoints)) {
|
|
@@ -123,22 +176,31 @@ function defineContract(meta, endpoints) {
|
|
|
123
176
|
assertSafelistedBodyEndpoint(meta.prefix, key, ep);
|
|
124
177
|
if ("responseMeta" in ep)
|
|
125
178
|
assertResponseMetaEndpoint(meta.prefix, key, ep);
|
|
126
|
-
|
|
179
|
+
assertNoUngroupedToolOptions(meta.prefix, key, ep);
|
|
180
|
+
const tool = "tool" in ep ? ep.tool : undefined;
|
|
181
|
+
if (tool === undefined)
|
|
127
182
|
continue;
|
|
183
|
+
if (typeof tool !== "object" || tool === null) {
|
|
184
|
+
throw new Error(`Contract "${meta.prefix}": endpoint "${key}" tool must be an object`);
|
|
185
|
+
}
|
|
128
186
|
const transports = new Set(ep.expose ? ep.expose.filter((t) => t !== "HTTP") : ["MCP", "AGENT"]);
|
|
129
187
|
if (transports.size === 0) {
|
|
130
|
-
throw new Error(`Contract "${meta.prefix}": endpoint "${key}" sets
|
|
188
|
+
throw new Error(`Contract "${meta.prefix}": endpoint "${key}" sets tool options but is not exposed on any tool transport (${TOOL_TRANSPORTS.join(" / ")}) — a contract factory with toolExposure 'explicit' makes an omitted expose HTTP-only`);
|
|
131
189
|
}
|
|
132
|
-
|
|
190
|
+
if (tool.view !== undefined)
|
|
191
|
+
assertToolView(meta.prefix, key, ep);
|
|
192
|
+
if (!tool.name)
|
|
193
|
+
continue;
|
|
194
|
+
const existing = toolTransports.get(tool.name);
|
|
133
195
|
if (existing) {
|
|
134
196
|
for (const t of transports) {
|
|
135
197
|
if (existing.transports.has(t)) {
|
|
136
|
-
throw new Error(`Contract "${meta.prefix}": duplicate
|
|
198
|
+
throw new Error(`Contract "${meta.prefix}": duplicate tool name "${tool.name}" on transport "${t}" (endpoints: "${existing.key}" and "${key}")`);
|
|
137
199
|
}
|
|
138
200
|
existing.transports.add(t);
|
|
139
201
|
}
|
|
140
202
|
} else {
|
|
141
|
-
toolTransports.set(
|
|
203
|
+
toolTransports.set(tool.name, { key, transports });
|
|
142
204
|
}
|
|
143
205
|
}
|
|
144
206
|
return { meta, endpoints: materializedEndpoints };
|
|
@@ -186,13 +248,7 @@ function assertRawEndpoint(prefix, key, ep) {
|
|
|
186
248
|
const where = `Contract "${prefix}": raw endpoint "${key}"`;
|
|
187
249
|
if (ep.output)
|
|
188
250
|
throw new Error(`${where} cannot declare an output schema`);
|
|
189
|
-
|
|
190
|
-
throw new Error(`${where} cannot set a toolName`);
|
|
191
|
-
if ("ui" in ep && ep.ui)
|
|
192
|
-
throw new Error(`${where} cannot set MCP ui metadata`);
|
|
193
|
-
if ("annotations" in ep && ep.annotations) {
|
|
194
|
-
throw new Error(`${where} cannot set MCP annotations`);
|
|
195
|
-
}
|
|
251
|
+
assertNoToolOptions(where, ep);
|
|
196
252
|
const nonHttp = (ep.expose ?? []).filter((t) => t !== "HTTP");
|
|
197
253
|
if (nonHttp.length > 0) {
|
|
198
254
|
throw new Error(`${where} is HTTP-only — remove ${nonHttp.join(", ")} from expose`);
|
|
@@ -232,13 +288,47 @@ function assertStreamingResponseEndpoint(prefix, key, ep) {
|
|
|
232
288
|
throw new Error(`${where} cannot also be rawResponse`);
|
|
233
289
|
if (ep.multipart)
|
|
234
290
|
throw new Error(`${where} cannot be multipart`);
|
|
235
|
-
|
|
236
|
-
throw new Error(`${where} cannot set a toolName`);
|
|
291
|
+
assertNoToolOptions(where, ep);
|
|
237
292
|
const nonHttp = (ep.expose ?? []).filter((transport) => transport !== "HTTP");
|
|
238
293
|
if (nonHttp.length > 0) {
|
|
239
294
|
throw new Error(`${where} is HTTP-only — remove ${nonHttp.join(", ")} from expose`);
|
|
240
295
|
}
|
|
241
296
|
}
|
|
297
|
+
var UNGROUPED_TOOL_OPTIONS = {
|
|
298
|
+
toolName: "tool.name",
|
|
299
|
+
toolView: "tool.view (declared with withToolView)",
|
|
300
|
+
ui: "tool.ui",
|
|
301
|
+
annotations: "tool.annotations",
|
|
302
|
+
mcp: "tool.mcp"
|
|
303
|
+
};
|
|
304
|
+
var TOOL_OPTION_KEYS = {
|
|
305
|
+
name: true,
|
|
306
|
+
view: true,
|
|
307
|
+
ui: true,
|
|
308
|
+
annotations: true,
|
|
309
|
+
mcp: true
|
|
310
|
+
};
|
|
311
|
+
function assertNoUngroupedToolOptions(prefix, key, ep) {
|
|
312
|
+
const where = `Contract "${prefix}": endpoint "${key}"`;
|
|
313
|
+
for (const [name, moved] of Object.entries(UNGROUPED_TOOL_OPTIONS)) {
|
|
314
|
+
if (Object.hasOwn(ep, name)) {
|
|
315
|
+
throw new Error(`${where} sets \`${name}\` — tool options live in \`tool\` since 0.94.0: use ${moved}`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
const group = "tool" in ep ? ep.tool : undefined;
|
|
319
|
+
if (group === undefined)
|
|
320
|
+
return;
|
|
321
|
+
for (const name of Object.keys(group)) {
|
|
322
|
+
if (!Object.hasOwn(TOOL_OPTION_KEYS, name)) {
|
|
323
|
+
throw new Error(`${where} sets \`tool.${name}\`, which is not a tool option — \`tool\` accepts ${Object.keys(TOOL_OPTION_KEYS).join(", ")}`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function assertNoToolOptions(where, ep) {
|
|
328
|
+
if ("tool" in ep && ep.tool !== undefined) {
|
|
329
|
+
throw new Error(`${where} cannot set tool options — it never reaches a tool transport`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
242
332
|
function assertHeadEndpoint(prefix, key, ep) {
|
|
243
333
|
const where = `Contract "${prefix}": HEAD endpoint "${key}"`;
|
|
244
334
|
if (!ep.rawResponse)
|
|
@@ -259,13 +349,7 @@ function assertRawBodyEndpoint(prefix, key, ep) {
|
|
|
259
349
|
if (ep.method !== "POST" && ep.method !== "PUT" && ep.method !== "PATCH") {
|
|
260
350
|
throw new Error(`${where} must use POST, PUT or PATCH`);
|
|
261
351
|
}
|
|
262
|
-
|
|
263
|
-
throw new Error(`${where} cannot set a toolName`);
|
|
264
|
-
if ("ui" in ep && ep.ui)
|
|
265
|
-
throw new Error(`${where} cannot set MCP ui metadata`);
|
|
266
|
-
if ("annotations" in ep && ep.annotations) {
|
|
267
|
-
throw new Error(`${where} cannot set MCP annotations`);
|
|
268
|
-
}
|
|
352
|
+
assertNoToolOptions(where, ep);
|
|
269
353
|
const nonHttp = (ep.expose ?? []).filter((transport) => transport !== "HTTP");
|
|
270
354
|
if (nonHttp.length > 0) {
|
|
271
355
|
throw new Error(`${where} is HTTP-only — remove ${nonHttp.join(", ")} from expose`);
|
|
@@ -296,13 +380,7 @@ function assertResponseMetaEndpoint(prefix, key, ep) {
|
|
|
296
380
|
}
|
|
297
381
|
if (ep.rawResponse)
|
|
298
382
|
throw new Error(`${where} cannot also be a rawResponse endpoint`);
|
|
299
|
-
|
|
300
|
-
throw new Error(`${where} cannot set a toolName`);
|
|
301
|
-
if ("ui" in ep && ep.ui)
|
|
302
|
-
throw new Error(`${where} cannot set MCP ui metadata`);
|
|
303
|
-
if ("annotations" in ep && ep.annotations) {
|
|
304
|
-
throw new Error(`${where} cannot set MCP annotations`);
|
|
305
|
-
}
|
|
383
|
+
assertNoToolOptions(where, ep);
|
|
306
384
|
const nonHttp = (ep.expose ?? []).filter((transport) => transport !== "HTTP");
|
|
307
385
|
if (nonHttp.length > 0) {
|
|
308
386
|
throw new Error(`${where} is HTTP-only — remove ${nonHttp.join(", ")} from expose`);
|
|
@@ -315,156 +393,5 @@ function mergeMeta(contractMeta, endpointMeta) {
|
|
|
315
393
|
return { ...contractMeta };
|
|
316
394
|
return { ...contractMeta, ...endpointMeta };
|
|
317
395
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
function isErrorDetailsSchema(value) {
|
|
321
|
-
return value instanceof z2.ZodObject || value instanceof z2.ZodOptional && value.unwrap() instanceof z2.ZodObject;
|
|
322
|
-
}
|
|
323
|
-
function validateDefinition(code, definition) {
|
|
324
|
-
if (!Number.isInteger(definition.status) || definition.status < 400 || definition.status > 599) {
|
|
325
|
-
throw new Error(`[stitchkit] Error "${code}" must declare an integer HTTP status from 400 to 599`);
|
|
326
|
-
}
|
|
327
|
-
if (definition.details !== undefined && !isErrorDetailsSchema(definition.details)) {
|
|
328
|
-
throw new Error(`[stitchkit] Error "${code}" details must be a Zod object or optional Zod object`);
|
|
329
|
-
}
|
|
330
|
-
if (definition.message !== undefined && (typeof definition.message !== "string" || definition.message.trim() === "")) {
|
|
331
|
-
throw new Error(`[stitchkit] Error "${code}" message must be a non-empty string`);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
function defineErrors(source, mapping) {
|
|
335
|
-
const definitions = mapObjectTypeBoundary(source, (code, definition) => {
|
|
336
|
-
const name = String(code);
|
|
337
|
-
validateDefinition(name, definition);
|
|
338
|
-
return Object.freeze({ ...definition });
|
|
339
|
-
});
|
|
340
|
-
Object.freeze(definitions);
|
|
341
|
-
const errors = mapObjectTypeBoundary(definitions, (code, definition) => {
|
|
342
|
-
const name = String(code);
|
|
343
|
-
return (options = {}) => {
|
|
344
|
-
const message = options.message ?? definition.message;
|
|
345
|
-
if (definition.details === undefined) {
|
|
346
|
-
if ("details" in options) {
|
|
347
|
-
throw new Error(`[stitchkit] Error "${name}" does not declare details`);
|
|
348
|
-
}
|
|
349
|
-
return new AppError(name, message, definition.status, undefined, options.hint, undefined, definition.retryable);
|
|
350
|
-
}
|
|
351
|
-
const details = definition.details.parse(options.details);
|
|
352
|
-
return new AppError(name, message, definition.status, details, options.hint, undefined, definition.retryable);
|
|
353
|
-
};
|
|
354
|
-
});
|
|
355
|
-
Object.freeze(errors);
|
|
356
|
-
const codes = mapObjectTypeBoundary(definitions, (code) => String(code));
|
|
357
|
-
Object.freeze(codes);
|
|
358
|
-
const known = new Set(Object.keys(definitions));
|
|
359
|
-
for (const [code, target] of Object.entries(mapping?.map ?? {})) {
|
|
360
|
-
if (!isStitchErrorCode(code)) {
|
|
361
|
-
throw new Error(`[stitchkit] Error vocabulary contains unknown framework code "${code}"`);
|
|
362
|
-
}
|
|
363
|
-
if (typeof target !== "string" || !known.has(target)) {
|
|
364
|
-
throw new Error(`[stitchkit] Error vocabulary maps "${code}" to undeclared code "${String(target)}"`);
|
|
365
|
-
}
|
|
366
|
-
const status = STITCH_ERROR_STATUS[code];
|
|
367
|
-
if (definitions[target]?.status !== status) {
|
|
368
|
-
throw new Error(`[stitchkit] Error vocabulary maps "${code}" (${status}) to "${target}", declared with status ${String(definitions[target]?.status)}`);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
for (const [statusText, target] of Object.entries(mapping?.fallback ?? {})) {
|
|
372
|
-
const status = Number(statusText);
|
|
373
|
-
if (!Number.isInteger(status) || status < 400 || status > 599) {
|
|
374
|
-
throw new Error(`[stitchkit] Error vocabulary fallback status "${statusText}" must be an integer from 400 to 599`);
|
|
375
|
-
}
|
|
376
|
-
if (typeof target !== "string" || !known.has(target)) {
|
|
377
|
-
throw new Error(`[stitchkit] Error vocabulary fallback ${status} names undeclared code "${String(target)}"`);
|
|
378
|
-
}
|
|
379
|
-
if (definitions[target]?.status !== status) {
|
|
380
|
-
throw new Error(`[stitchkit] Error vocabulary fallback ${status} must name a code with status ${status}`);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
if (mapping?.exhaustive === true) {
|
|
384
|
-
for (const code of Object.keys(STITCH_ERROR_STATUS)) {
|
|
385
|
-
if (!Object.hasOwn(mapping.map, code)) {
|
|
386
|
-
throw new Error(`[stitchkit] Exhaustive error vocabulary is missing "${code}"`);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
const codeMap = {};
|
|
391
|
-
for (const [stitchCode, status] of typedEntries(STITCH_ERROR_STATUS)) {
|
|
392
|
-
const code = mapping?.map?.[stitchCode] ?? mapping?.fallback?.[status];
|
|
393
|
-
if (code === undefined)
|
|
394
|
-
continue;
|
|
395
|
-
if (!known.has(code)) {
|
|
396
|
-
throw new Error(`[stitchkit] Error vocabulary maps "${stitchCode}" to undeclared code "${code}"`);
|
|
397
|
-
}
|
|
398
|
-
codeMap[stitchCode] = code;
|
|
399
|
-
}
|
|
400
|
-
Object.freeze(codeMap);
|
|
401
|
-
const vocabularyCodeMap = transportResult(codeMap);
|
|
402
|
-
return Object.freeze({
|
|
403
|
-
errors,
|
|
404
|
-
codes,
|
|
405
|
-
definitions,
|
|
406
|
-
isCode: (code) => known.has(code),
|
|
407
|
-
codeMap: vocabularyCodeMap
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
// src/contract/factory.ts
|
|
411
|
-
function createContractFactory(config) {
|
|
412
|
-
const scoped = (meta, endpoints) => {
|
|
413
|
-
const validated = defineContract({ prefix: meta.prefix }, endpoints);
|
|
414
|
-
return {
|
|
415
|
-
endpoints: validated.endpoints,
|
|
416
|
-
meta: { ...meta, prefix: meta.prefix, scope: meta.scope }
|
|
417
|
-
};
|
|
418
|
-
};
|
|
419
|
-
if (config?.toolExposure !== "explicit")
|
|
420
|
-
return { defineContract: scoped };
|
|
421
|
-
const explicit = (meta, endpoints) => {
|
|
422
|
-
const materialized = mapObjectTypeBoundary(endpoints, (_key, endpoint) => endpoint.expose ? endpoint : { ...endpoint, expose: ["HTTP"] });
|
|
423
|
-
return scoped(meta, materialized);
|
|
424
|
-
};
|
|
425
|
-
return { defineContract: explicit };
|
|
426
|
-
}
|
|
427
|
-
// src/contract/pagination.ts
|
|
428
|
-
import { z as z3 } from "zod";
|
|
429
|
-
function paginatedSchema(itemSchema) {
|
|
430
|
-
return z3.object({
|
|
431
|
-
items: z3.array(itemSchema),
|
|
432
|
-
nextCursor: z3.string().nullable()
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
function toBase64Url(str) {
|
|
436
|
-
return bytesToBase64Url(new TextEncoder().encode(str));
|
|
437
|
-
}
|
|
438
|
-
function fromBase64Url(value) {
|
|
439
|
-
return new TextDecoder().decode(base64UrlToBytes(value));
|
|
440
|
-
}
|
|
441
|
-
function encodeCursor(value) {
|
|
442
|
-
return toBase64Url(JSON.stringify(value));
|
|
443
|
-
}
|
|
444
|
-
function decodeCursor(cursor, schema) {
|
|
445
|
-
if (!cursor)
|
|
446
|
-
return null;
|
|
447
|
-
try {
|
|
448
|
-
const parsed = schema.safeParse(JSON.parse(fromBase64Url(cursor)));
|
|
449
|
-
return parsed.success ? parsed.data : null;
|
|
450
|
-
} catch {
|
|
451
|
-
return null;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
// src/contract/stream.ts
|
|
455
|
-
import { z as z4 } from "zod";
|
|
456
|
-
var DEFAULT_CONTRACT_STREAM_FRAME_BYTES = 256 * 1024;
|
|
457
|
-
var ContractStreamFrameSchema = z4.discriminatedUnion("type", [
|
|
458
|
-
z4.object({ type: z4.literal("data"), data: z4.unknown() }).strict(),
|
|
459
|
-
z4.object({
|
|
460
|
-
type: z4.literal("error"),
|
|
461
|
-
error: z4.object({
|
|
462
|
-
code: z4.string(),
|
|
463
|
-
message: z4.string().optional(),
|
|
464
|
-
details: z4.unknown().optional(),
|
|
465
|
-
hint: z4.string().optional()
|
|
466
|
-
}).strict()
|
|
467
|
-
}).strict(),
|
|
468
|
-
z4.object({ type: z4.literal("end") }).strict()
|
|
469
|
-
]);
|
|
470
|
-
export { joinRoutePath, resolveRouteParamsSchema, parseTrailingWildcard, ALL_TRANSPORTS, defineContract, mergeMeta, defineErrors, createContractFactory, paginatedSchema, encodeCursor, decodeCursor, DEFAULT_CONTRACT_STREAM_FRAME_BYTES, ContractStreamFrameSchema };
|
|
396
|
+
|
|
397
|
+
export { joinRoutePath, resolveRouteParamsSchema, parseTrailingWildcard, withToolView, ALL_TRANSPORTS, TOOL_TRANSPORTS, defineContract, mergeMeta };
|
|
@@ -56,7 +56,7 @@ function aggregateObservabilityStatus(surfaces, closed) {
|
|
|
56
56
|
return ObservabilitySinkStatusSchema.parse({ ...totals, closed });
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// src/
|
|
59
|
+
// src/observability/bounded-sink.ts
|
|
60
60
|
function assertDrainBound(bound) {
|
|
61
61
|
const timeoutMs = bound?.timeoutMs;
|
|
62
62
|
if (timeoutMs === undefined)
|
|
@@ -11,20 +11,6 @@ function callRuntimeHandler(handler, context) {
|
|
|
11
11
|
}
|
|
12
12
|
return Reflect.apply(handler, undefined, [context]);
|
|
13
13
|
}
|
|
14
|
-
function executableAgentRuntimeTools(tools) {
|
|
15
|
-
for (const tool of tools) {
|
|
16
|
-
if (typeof tool.handler !== "function") {
|
|
17
|
-
throw new TypeError(`Runtime tool "${tool.name}" must provide a handler`);
|
|
18
|
-
}
|
|
19
|
-
if (tool.present?.agent !== undefined && typeof tool.present.agent !== "function") {
|
|
20
|
-
throw new TypeError(`Runtime tool "${tool.name}" Agent presenter must be a function`);
|
|
21
|
-
}
|
|
22
|
-
if (tool.present?.agent !== undefined && tool.output === undefined) {
|
|
23
|
-
throw new TypeError(`Runtime tool "${tool.name}" Agent presenter requires an output schema`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return tools;
|
|
27
|
-
}
|
|
28
14
|
function transportResult(value) {
|
|
29
15
|
return value;
|
|
30
16
|
}
|
|
@@ -41,4 +27,4 @@ function mapObjectTypeBoundary(source, mapper) {
|
|
|
41
27
|
return mapObject(source, (key, value) => mapper(key, value));
|
|
42
28
|
}
|
|
43
29
|
|
|
44
|
-
export { typedEntries, isRecord, callRuntimeHandler,
|
|
30
|
+
export { typedEntries, isRecord, callRuntimeHandler, transportResult, mapObject, mapObjectTypeBoundary };
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRequestContext,
|
|
3
3
|
runWithRequestContext
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-zfrhfn82.js";
|
|
5
|
+
import {
|
|
6
|
+
coerceJsonArgs
|
|
7
|
+
} from "./index-1zbbzgfh.js";
|
|
8
|
+
import {
|
|
9
|
+
applyToolViewDefaults,
|
|
10
|
+
objectShapeKeys,
|
|
11
|
+
projectToolView
|
|
12
|
+
} from "./index-dydjcp8z.js";
|
|
5
13
|
import {
|
|
6
|
-
formatZodError,
|
|
7
14
|
normalizeError,
|
|
8
15
|
validateDeclaredOutput
|
|
9
|
-
} from "./index-
|
|
10
|
-
import {
|
|
11
|
-
coerceJsonArgs
|
|
12
|
-
} from "./index-7zbps32p.js";
|
|
16
|
+
} from "./index-znfs20ss.js";
|
|
13
17
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./index-
|
|
18
|
+
formatZodError
|
|
19
|
+
} from "./index-p5r7qpdd.js";
|
|
16
20
|
import {
|
|
17
21
|
AppError,
|
|
18
22
|
STITCH_ERROR_STATUS,
|
|
@@ -24,7 +28,7 @@ import {
|
|
|
24
28
|
} from "./index-kzfs85xp.js";
|
|
25
29
|
import {
|
|
26
30
|
isRecord
|
|
27
|
-
} from "./index-
|
|
31
|
+
} from "./index-hffjpmq9.js";
|
|
28
32
|
|
|
29
33
|
// src/tools/execute.ts
|
|
30
34
|
class ToolExecutionControlError extends Error {
|
|
@@ -45,7 +49,10 @@ function isToolExecutionControlError(value) {
|
|
|
45
49
|
return value instanceof ToolExecutionControlError;
|
|
46
50
|
}
|
|
47
51
|
var normalizedToolErrors = new WeakMap;
|
|
48
|
-
function parseToolCallArguments(method, callArgs,
|
|
52
|
+
function parseToolCallArguments(method, callArgs, {
|
|
53
|
+
coerceJson = false,
|
|
54
|
+
toolSurface = false
|
|
55
|
+
} = {}) {
|
|
49
56
|
const paramKeys = new Set(objectShapeKeys(method.paramsSchema));
|
|
50
57
|
let paramArgs = {};
|
|
51
58
|
let inputArgs = {};
|
|
@@ -61,6 +68,8 @@ function parseToolCallArguments(method, callArgs, coerceJson) {
|
|
|
61
68
|
paramArgs = coerceJsonArgs(paramArgs, method.paramsSchema);
|
|
62
69
|
inputArgs = coerceJsonArgs(inputArgs, method.inputSchema);
|
|
63
70
|
}
|
|
71
|
+
if (toolSurface)
|
|
72
|
+
inputArgs = applyToolViewDefaults(inputArgs, method.toolView?.defaults);
|
|
64
73
|
let params;
|
|
65
74
|
if (method.paramsSchema) {
|
|
66
75
|
let result;
|
|
@@ -116,8 +125,9 @@ function toolErrorFromResult(result) {
|
|
|
116
125
|
function toolCauseFromResult(result) {
|
|
117
126
|
return normalizedToolErrors.get(result)?.cause;
|
|
118
127
|
}
|
|
119
|
-
async function executeToolMethod(method,
|
|
120
|
-
|
|
128
|
+
async function executeToolMethod(method, call, options = {}) {
|
|
129
|
+
const { toolName, context } = call;
|
|
130
|
+
return inToolCallContext({ source: context.source, toolName, method }, () => runToolMethod(method, call, options));
|
|
121
131
|
}
|
|
122
132
|
function inToolCallContext(call, body) {
|
|
123
133
|
const parent = getRequestContext();
|
|
@@ -135,7 +145,15 @@ function inToolCallContext(call, body) {
|
|
|
135
145
|
action: call.method.key
|
|
136
146
|
}, body);
|
|
137
147
|
}
|
|
138
|
-
async function runToolMethod(method, toolName, rawArgs, context
|
|
148
|
+
async function runToolMethod(method, { toolName, rawArgs, context }, {
|
|
149
|
+
hooks,
|
|
150
|
+
lifecycle,
|
|
151
|
+
coerceJson = false,
|
|
152
|
+
onOutputStrip,
|
|
153
|
+
extension,
|
|
154
|
+
finalizeOutput,
|
|
155
|
+
toolSurface = false
|
|
156
|
+
}) {
|
|
139
157
|
const startedAt = Date.now();
|
|
140
158
|
let hookContext = context;
|
|
141
159
|
const finish = async (result, thrown) => {
|
|
@@ -245,7 +263,7 @@ async function runToolMethod(method, toolName, rawArgs, context, hooks, lifecycl
|
|
|
245
263
|
callArgs = extensionKeys ? Object.fromEntries(Object.entries(rewrittenArgs).filter(([key]) => !extensionKeys.has(key))) : rewrittenArgs;
|
|
246
264
|
rewrittenArgsApplied = true;
|
|
247
265
|
}
|
|
248
|
-
const parsed = parseToolCallArguments(method, callArgs, coerceJson);
|
|
266
|
+
const parsed = parseToolCallArguments(method, callArgs, { coerceJson, toolSurface });
|
|
249
267
|
if (!parsed.ok) {
|
|
250
268
|
return parsed.thrown !== undefined ? finishThrown(parsed.thrown) : finish({ ok: false, code: "VALIDATION_ERROR", details: { message: parsed.message } });
|
|
251
269
|
}
|
|
@@ -276,6 +294,24 @@ async function runToolMethod(method, toolName, rawArgs, context, hooks, lifecycl
|
|
|
276
294
|
});
|
|
277
295
|
}
|
|
278
296
|
data = checked.data;
|
|
297
|
+
if (toolSurface && method.toolView && method.outputSchema) {
|
|
298
|
+
const viewed = projectToolView({
|
|
299
|
+
view: method.toolView,
|
|
300
|
+
fullSchema: method.outputSchema,
|
|
301
|
+
full: data,
|
|
302
|
+
call: { input, source: context.source },
|
|
303
|
+
operation: `${method.serviceName}.${method.key}`,
|
|
304
|
+
onStripped: onOutputStrip
|
|
305
|
+
});
|
|
306
|
+
if (!viewed.ok) {
|
|
307
|
+
return finish({
|
|
308
|
+
ok: false,
|
|
309
|
+
code: "INTERNAL_SERVER_ERROR",
|
|
310
|
+
details: { message: viewed.message }
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
data = viewed.data;
|
|
314
|
+
}
|
|
279
315
|
if (finalizeOutput)
|
|
280
316
|
data = await finalizeOutput(data);
|
|
281
317
|
const output = (data === undefined || data === null) && !method.outputSchema ? { status: "ok" } : data;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRecord
|
|
3
|
+
} from "./index-hffjpmq9.js";
|
|
4
|
+
|
|
5
|
+
// src/internal/canonical-json.ts
|
|
6
|
+
function compareCodeUnits(left, right) {
|
|
7
|
+
if (left < right)
|
|
8
|
+
return -1;
|
|
9
|
+
if (left > right)
|
|
10
|
+
return 1;
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
function canonicalText(value) {
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
return `[${Array.from(value, (item) => canonicalText(item) ?? "null").join(",")}]`;
|
|
16
|
+
}
|
|
17
|
+
if (!isRecord(value))
|
|
18
|
+
return JSON.stringify(value);
|
|
19
|
+
const members = [];
|
|
20
|
+
for (const key of Object.keys(value).sort(compareCodeUnits)) {
|
|
21
|
+
const text = canonicalText(value[key]);
|
|
22
|
+
if (text !== undefined)
|
|
23
|
+
members.push(`${JSON.stringify(key)}:${text}`);
|
|
24
|
+
}
|
|
25
|
+
return `{${members.join(",")}}`;
|
|
26
|
+
}
|
|
27
|
+
function serializeCanonicalJson(value) {
|
|
28
|
+
return canonicalText(value) ?? "undefined";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { compareCodeUnits, serializeCanonicalJson };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mergeMeta,
|
|
3
|
+
resolveRouteParamsSchema
|
|
4
|
+
} from "./index-gyr48nzg.js";
|
|
5
|
+
|
|
6
|
+
// src/server/contract-method.ts
|
|
7
|
+
var HTTP_ONLY = Object.freeze(["HTTP"]);
|
|
8
|
+
function contractMethodFields(contract, key, endpoint) {
|
|
9
|
+
const groupScope = contract.meta.scope ?? "public";
|
|
10
|
+
return {
|
|
11
|
+
method: endpoint.method,
|
|
12
|
+
path: endpoint.path,
|
|
13
|
+
desc: endpoint.desc,
|
|
14
|
+
serviceName: contract.meta.prefix,
|
|
15
|
+
key,
|
|
16
|
+
toolName: endpoint.tool?.name,
|
|
17
|
+
expose: endpoint.rawResponse || endpoint.rawBody || endpoint.responseMeta || "stream" in endpoint && endpoint.stream ? HTTP_ONLY : endpoint.expose,
|
|
18
|
+
scope: endpoint.scope ?? groupScope,
|
|
19
|
+
paramsSchema: resolveRouteParamsSchema(endpoint.path, endpoint.params),
|
|
20
|
+
inputSchema: endpoint.input,
|
|
21
|
+
outputSchema: endpoint.output,
|
|
22
|
+
toolView: endpoint.tool?.view,
|
|
23
|
+
stream: "stream" in endpoint ? endpoint.stream : undefined,
|
|
24
|
+
multipart: endpoint.multipart,
|
|
25
|
+
maxJsonBodyBytes: endpoint.maxJsonBodyBytes,
|
|
26
|
+
idempotent: endpoint.idempotent,
|
|
27
|
+
ui: endpoint.tool?.ui,
|
|
28
|
+
annotations: endpoint.tool?.annotations,
|
|
29
|
+
mcp: endpoint.tool?.mcp,
|
|
30
|
+
meta: mergeMeta(contract.meta.meta, endpoint.meta),
|
|
31
|
+
rawResponse: endpoint.rawResponse,
|
|
32
|
+
rawBody: endpoint.rawBody,
|
|
33
|
+
safelistedBody: endpoint.safelistedBody,
|
|
34
|
+
responseMeta: endpoint.responseMeta,
|
|
35
|
+
contentType: "contentType" in endpoint ? endpoint.contentType : undefined
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { contractMethodFields };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/tools/async-operation-contract.ts
|
|
1
|
+
// src/tools/operations/async-operation-contract.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
var AsyncOperationCancelResultSchema = z.discriminatedUnion("outcome", [
|
|
4
4
|
z.object({ outcome: z.literal("accepted") }),
|
|
@@ -15,7 +15,7 @@ function createAsyncOperationSnapshotSchema(config) {
|
|
|
15
15
|
z.object({ phase: z.literal("cancelled"), ...progress })
|
|
16
16
|
]);
|
|
17
17
|
}
|
|
18
|
-
// src/tools/view-file-contract.ts
|
|
18
|
+
// src/tools/transfer/view-file-contract.ts
|
|
19
19
|
import { z as z2 } from "zod";
|
|
20
20
|
var MAX_VIEW_FILES = 20;
|
|
21
21
|
var McpAnnotationsSchema = z2.object({
|