stitchkit 0.132.3 → 0.133.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -1
- package/README.md +4 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +12 -1
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +3 -1
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +9 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +3 -2
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-probe.d.ts +10 -1
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +11 -2
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +13 -10
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +6 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/record-router.d.ts +44 -0
- package/dist/agent-executor/claude/record-router.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +20 -2
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts +18 -0
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +8 -11
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-manager.d.ts +4 -2
- package/dist/agent-executor/claude-sdk/query-manager.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-options.d.ts +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/capabilities.d.ts +8 -0
- package/dist/agent-executor/codex/capabilities.d.ts.map +1 -0
- package/dist/agent-executor/codex/connect.d.ts +6 -1
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/driver.d.ts +10 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/event-routing.d.ts +23 -1
- package/dist/agent-executor/codex/event-routing.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +23 -3
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +17 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +23 -3
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-bind.d.ts +6 -1
- package/dist/agent-executor/codex/session-bind.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-types.d.ts +5 -1
- package/dist/agent-executor/codex/session-types.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-thread.d.ts +6 -8
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-open.d.ts +12 -3
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
- package/dist/agent-executor/engine-requests.d.ts +42 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
- package/dist/agent-executor/handoff.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +6 -5
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/profile.d.ts +3 -5
- package/dist/agent-executor/profile.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +64 -3
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts +5 -0
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts +11 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-support.d.ts +23 -0
- package/dist/agent-executor/testing/conformance-support.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +7 -2
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/consumer-stubs.d.ts +5 -3
- package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts +5 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +6 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-gate.d.ts +4 -1
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/operation-refusal.d.ts +10 -0
- package/dist/browser/operation-refusal.d.ts.map +1 -0
- package/dist/contract/client-types.d.ts +13 -4
- package/dist/contract/client-types.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +6 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors-factory.d.ts +8 -2
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +9 -0
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/fingerprint.d.ts +4 -1
- package/dist/contract/fingerprint.d.ts.map +1 -1
- package/dist/contract/operation-refusals.d.ts +51 -0
- package/dist/contract/operation-refusals.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +4 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +253 -210
- package/dist/entrypoints/agent-executor/claude-sdk.js +248 -173
- package/dist/entrypoints/agent-executor/claude.js +57 -109
- package/dist/entrypoints/agent-executor/codex.js +412 -335
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts +3 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +329 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +1 -2
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +413 -667
- package/dist/entrypoints/agent-executor.d.ts +1 -1
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +12 -12
- package/dist/entrypoints/agent-runtime/browser.js +2 -2
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/postgres.js +5 -5
- package/dist/entrypoints/agent-runtime/realtime.js +2 -2
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +26 -18
- package/dist/entrypoints/application/grammy.js +1 -1
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.d.ts +3 -2
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +6 -4
- package/dist/entrypoints/files/packaging.d.ts +4 -1
- package/dist/entrypoints/files/packaging.d.ts.map +1 -1
- package/dist/entrypoints/files/packaging.js +1008 -168
- package/dist/entrypoints/files.js +1 -1
- package/dist/entrypoints/handler.js +7 -7
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +10 -8
- package/dist/entrypoints/node.js +11 -11
- package/dist/entrypoints/observability.js +1 -1
- package/dist/entrypoints/process/bootstrap.d.ts +3 -0
- package/dist/entrypoints/process/bootstrap.d.ts.map +1 -0
- package/dist/entrypoints/process/bootstrap.js +16 -0
- package/dist/entrypoints/process.js +7 -7
- package/dist/entrypoints/realtime.js +3 -3
- package/dist/entrypoints/remote.js +8 -7
- package/dist/entrypoints/server.js +30 -14
- package/dist/entrypoints/service-host/macos.js +72 -206
- package/dist/entrypoints/service-host/work.d.ts +15 -0
- package/dist/entrypoints/service-host/work.d.ts.map +1 -0
- package/dist/entrypoints/service-host/work.js +676 -0
- package/dist/entrypoints/service-host.js +146 -536
- package/dist/entrypoints/telegram/screens.js +4 -4
- package/dist/entrypoints/telegram.js +4 -4
- package/dist/entrypoints/testing.d.ts +2 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +27 -8
- package/dist/entrypoints/tools/agent.js +6 -6
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +5 -5
- package/dist/entrypoints/tools/mcp.js +8 -6
- package/dist/entrypoints/tools/toolkit.js +11 -9
- package/dist/entrypoints/tools.js +19 -17
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +3 -3
- package/dist/files/client-artifact.d.ts +14 -42
- package/dist/files/client-artifact.d.ts.map +1 -1
- package/dist/files/client-build.d.ts +57 -0
- package/dist/files/client-build.d.ts.map +1 -0
- package/dist/files/client-declarations.d.ts +35 -0
- package/dist/files/client-declarations.d.ts.map +1 -0
- package/dist/files/client-package-bundle.d.ts +25 -0
- package/dist/files/client-package-bundle.d.ts.map +1 -0
- package/dist/files/client-package-contract.d.ts +183 -0
- package/dist/files/client-package-contract.d.ts.map +1 -0
- package/dist/files/client-package-proof.d.ts +40 -0
- package/dist/files/client-package-proof.d.ts.map +1 -0
- package/dist/files/client-package.d.ts +17 -0
- package/dist/files/client-package.d.ts.map +1 -0
- package/dist/files/declaration-specifiers.d.ts +30 -0
- package/dist/files/declaration-specifiers.d.ts.map +1 -0
- package/dist/{index-v759mzed.js → index-02r5sq9p.js} +36 -23
- package/dist/{index-0r15pkjq.js → index-0k1ba0ss.js} +1 -1
- package/dist/{index-znd1b57f.js → index-1dn2wjq6.js} +5 -4
- package/dist/{index-p06z7g7w.js → index-1p8q0yrt.js} +6 -5
- package/dist/{index-wa6h4tz6.js → index-1qwd54n3.js} +6 -5
- package/dist/index-2dzc7mv9.js +174 -0
- package/dist/index-2mz8hj58.js +155 -0
- package/dist/{index-17qgm6xe.js → index-34k82crg.js} +2 -2
- package/dist/index-3mcbr8sx.js +349 -0
- package/dist/{index-ybdq8kk2.js → index-3y2tzhr8.js} +3 -3
- package/dist/{index-fgahdc7s.js → index-5n3a8hd8.js} +5 -3
- package/dist/{index-jb4m241t.js → index-6918kxbf.js} +45 -1
- package/dist/{index-n3bm7zqq.js → index-6kmjcm81.js} +4 -4
- package/dist/{index-akf0xkrm.js → index-78da4g74.js} +1 -1
- package/dist/{index-9pv126eh.js → index-7fjbdga8.js} +7 -1
- package/dist/{index-zhshhxew.js → index-8jf4bt7v.js} +1 -1
- package/dist/{index-p16q492v.js → index-8t9dr41h.js} +18 -5
- package/dist/{index-xq4s9mka.js → index-8yt3rwe7.js} +1 -1
- package/dist/{index-39c2hj6h.js → index-9c76vfxf.js} +7 -3
- package/dist/index-9ft4n9j1.js +432 -0
- package/dist/{index-sd4e5x5j.js → index-9wdrwx3b.js} +8 -7
- package/dist/{index-z114ax5e.js → index-an7vcmwf.js} +49 -2
- package/dist/{index-pzhqydxb.js → index-d04w81fz.js} +1 -1
- package/dist/index-d2drhb9c.js +219 -0
- package/dist/{index-8gmmdz7k.js → index-dacxr7nf.js} +1 -1
- package/dist/{index-dnzxxf8a.js → index-dm6nxkn1.js} +1 -1
- package/dist/index-dxft2mnm.js +42 -0
- package/dist/{index-rxh3qy4x.js → index-fzd477xk.js} +1 -1
- package/dist/{index-xgae0bn7.js → index-g4gstmp1.js} +2 -2
- package/dist/{index-athc412x.js → index-g5fgeb6v.js} +1 -1
- package/dist/{index-z9d74jmb.js → index-gbhj370g.js} +3 -3
- package/dist/{index-3fym4j8n.js → index-gtaaxe9d.js} +1 -1
- package/dist/{index-v59pxmf1.js → index-jpecjm30.js} +2 -2
- package/dist/index-k9g061ma.js +164 -0
- package/dist/{index-669374qc.js → index-ma26mfnt.js} +84 -315
- package/dist/{index-ryxb427v.js → index-msxf2r8x.js} +16 -3
- package/dist/{index-rbd2rq3z.js → index-nr4fhfn4.js} +1 -1
- package/dist/{index-qa2jjb65.js → index-pbekeqzm.js} +1 -1
- package/dist/{index-mkfhpk11.js → index-pq6g1k9t.js} +2 -2
- package/dist/{index-gya4hwh3.js → index-pws5c3x6.js} +21 -1
- package/dist/{index-x2fb37t0.js → index-q427q23r.js} +3 -2
- package/dist/{index-jcrj0b8z.js → index-qggqqja2.js} +39 -2
- package/dist/{index-jxtg307y.js → index-rkjfzs0a.js} +1 -1
- package/dist/{index-5tdc0q43.js → index-rw8ze745.js} +5 -3
- package/dist/index-s43tr4my.js +129 -0
- package/dist/{index-f9p62ean.js → index-stpy56r3.js} +175 -249
- package/dist/index-t5g5rm9n.js +213 -0
- package/dist/{index-z20pdxeb.js → index-tmv3ez1h.js} +3 -3
- package/dist/{index-dcsxj68j.js → index-tqjamnax.js} +1 -1
- package/dist/{index-j15dhkda.js → index-wddcfbng.js} +1 -325
- package/dist/{index-9sfhje6y.js → index-wh70tmpd.js} +24 -234
- package/dist/index-wxjv4sqx.js +82 -0
- package/dist/{index-qhjmmsm2.js → index-x46y9z26.js} +2 -2
- package/dist/{index-nk0cy9g1.js → index-y53cqwke.js} +1 -1
- package/dist/{index-sv5svtq7.js → index-y68gavb5.js} +1 -1
- package/dist/{index-5y7j383h.js → index-yrhw10ef.js} +1 -1
- package/dist/process/bootstrap.d.ts +12 -0
- package/dist/process/bootstrap.d.ts.map +1 -0
- package/dist/process/owner-loss-guard.d.ts +2 -9
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/process/work-root.d.ts +20 -0
- package/dist/process/work-root.d.ts.map +1 -0
- package/dist/server/contract-identity.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +12 -0
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/service-host/host-adapter.d.ts +2 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -1
- package/dist/service-host/work/command.d.ts +72 -0
- package/dist/service-host/work/command.d.ts.map +1 -0
- package/dist/service-host/work/errors.d.ts +29 -0
- package/dist/service-host/work/errors.d.ts.map +1 -0
- package/dist/service-host/work/host.d.ts +38 -0
- package/dist/service-host/work/host.d.ts.map +1 -0
- package/dist/service-host/work/launch.d.ts +51 -0
- package/dist/service-host/work/launch.d.ts.map +1 -0
- package/dist/service-host/work/membership.d.ts +51 -0
- package/dist/service-host/work/membership.d.ts.map +1 -0
- package/dist/service-host/work/origin.d.ts +79 -0
- package/dist/service-host/work/origin.d.ts.map +1 -0
- package/dist/service-host/work/owner.d.ts +45 -0
- package/dist/service-host/work/owner.d.ts.map +1 -0
- package/dist/service-host/work/placement.d.ts +55 -0
- package/dist/service-host/work/placement.d.ts.map +1 -0
- package/dist/service-host/work/probe.d.ts +24 -0
- package/dist/service-host/work/probe.d.ts.map +1 -0
- package/dist/service-host/work/scope-command.d.ts +68 -0
- package/dist/service-host/work/scope-command.d.ts.map +1 -0
- package/dist/sync/session.d.ts +4 -1
- package/dist/sync/session.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +2 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +32 -3
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +2 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/internal/mcp-projection.d.ts +58 -0
- package/dist/tools/internal/mcp-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +3 -47
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -0
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +4 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +5 -2
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +2 -0
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts +8 -0
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +7 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +3 -3
- package/llms/agent-executor-claude-sdk.txt +1 -1
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +1 -1
- package/llms/agent-executor-testing-claude-sdk.txt +28 -0
- package/llms/agent-executor-testing.txt +7 -8
- package/llms/agent-executor.txt +27 -4
- package/llms/agent-runtime.txt +1 -1
- package/llms/contract.txt +8 -2
- package/llms/files-packaging.txt +11 -6
- package/llms/process-bootstrap.txt +18 -0
- package/llms/process.2.txt +248 -18
- package/llms/process.txt +130 -92
- package/llms/server.4.txt +49 -1
- package/llms/service-host-work.txt +34 -0
- package/llms/stitchkit.2.txt +31 -0
- package/llms/stitchkit.txt +78 -75
- package/llms/sync.txt +5 -2
- package/llms/testing.txt +1 -0
- package/llms/tools.2.txt +747 -775
- package/llms/tools.3.txt +846 -210
- package/llms/tools.4.txt +226 -0
- package/llms/tools.txt +3 -790
- package/llms/{upgrading-0.128.0-0.132.0.txt → upgrading-0.128.0-0.133.0.txt} +194 -6
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +779 -135
- package/llms.txt +18 -16
- package/package.json +12 -4
- package/dist/entrypoints/process/owner-loss.d.ts +0 -3
- package/dist/entrypoints/process/owner-loss.d.ts.map +0 -1
- package/dist/entrypoints/process/owner-loss.js +0 -7
- package/llms/process-owner-loss.txt +0 -18
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NativeCommandError2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-jpecjm30.js";
|
|
4
4
|
import {
|
|
5
5
|
CommandStopped,
|
|
6
6
|
startNativeCommand
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-pbekeqzm.js";
|
|
8
8
|
import {
|
|
9
9
|
ScanStopped,
|
|
10
10
|
ContainedScanBudget,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
forbidden2,
|
|
40
40
|
conflict2,
|
|
41
41
|
STITCH_ERROR_STATUS2
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-7fjbdga8.js";
|
|
43
43
|
import {
|
|
44
44
|
assertPositiveSafeInteger
|
|
45
45
|
} from "./index-gr0kxymw.js";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
toolErrorFromResult,
|
|
7
7
|
executeToolMethod
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-6kmjcm81.js";
|
|
9
9
|
import {
|
|
10
10
|
assertToolExtensionCompatible,
|
|
11
11
|
projectToolSurface
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-ma26mfnt.js";
|
|
13
13
|
import {
|
|
14
14
|
isRetryableStatus2
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-7fjbdga8.js";
|
|
16
16
|
|
|
17
17
|
// src/tools/mount.ts
|
|
18
18
|
import { z } from "zod";
|
|
@@ -40,6 +40,7 @@ function collectTools2(service, transport, config = {}) {
|
|
|
40
40
|
extend,
|
|
41
41
|
flattenUnionInput = false,
|
|
42
42
|
inputRecursionDepth,
|
|
43
|
+
inputNestingDepth,
|
|
43
44
|
assertNames = true
|
|
44
45
|
} = config;
|
|
45
46
|
const tools = [];
|
|
@@ -47,6 +48,7 @@ function collectTools2(service, transport, config = {}) {
|
|
|
47
48
|
extend,
|
|
48
49
|
flattenUnionInput,
|
|
49
50
|
inputRecursionDepth,
|
|
51
|
+
inputNestingDepth,
|
|
50
52
|
assertNames,
|
|
51
53
|
assertUniqueNames: false
|
|
52
54
|
})) {
|
|
@@ -5,6 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
resolveRouteParamsSchema
|
|
7
7
|
} from "./index-m38ej7e5.js";
|
|
8
|
+
import {
|
|
9
|
+
describeRefusals
|
|
10
|
+
} from "./index-dxft2mnm.js";
|
|
11
|
+
import {
|
|
12
|
+
AppError2,
|
|
13
|
+
isStitchErrorCode2
|
|
14
|
+
} from "./index-7fjbdga8.js";
|
|
8
15
|
|
|
9
16
|
// src/contract/runtime-context.ts
|
|
10
17
|
function mergeMeta(contractMeta, endpointMeta) {
|
|
@@ -28,6 +35,7 @@ function contractMethodFields(contract, key, endpoint) {
|
|
|
28
35
|
expose: endpoint.expose ?? (isHttpOnlyEndpoint(endpoint) ? HTTP_ONLY_EXPOSURE : undefined),
|
|
29
36
|
scope: endpoint.scope ?? groupScope,
|
|
30
37
|
effect: endpoint.effect,
|
|
38
|
+
refuses: describeRefusals(endpoint.refuses),
|
|
31
39
|
paramsSchema: resolveRouteParamsSchema(endpoint.path, endpoint.params),
|
|
32
40
|
inputSchema: endpoint.input,
|
|
33
41
|
outputSchema: endpoint.output,
|
|
@@ -40,6 +48,7 @@ function contractMethodFields(contract, key, endpoint) {
|
|
|
40
48
|
annotations: endpoint.tool?.annotations,
|
|
41
49
|
mcp: endpoint.tool?.mcp,
|
|
42
50
|
inputRecursionDepth: endpoint.tool?.inputRecursionDepth,
|
|
51
|
+
inputNestingDepth: endpoint.tool?.inputNestingDepth,
|
|
43
52
|
meta: mergeMeta(contract.meta.meta, endpoint.meta),
|
|
44
53
|
rawResponse: endpoint.rawResponse,
|
|
45
54
|
rawBody: endpoint.rawBody,
|
|
@@ -48,5 +57,40 @@ function contractMethodFields(contract, key, endpoint) {
|
|
|
48
57
|
contentType: "contentType" in endpoint ? endpoint.contentType : undefined
|
|
49
58
|
};
|
|
50
59
|
}
|
|
60
|
+
function isAsyncIterable(value) {
|
|
61
|
+
return typeof value === "object" && value !== null && Symbol.asyncIterator in value;
|
|
62
|
+
}
|
|
63
|
+
function withDeclaredRefusals(endpoint, label, handler) {
|
|
64
|
+
const declared = endpoint.refuses;
|
|
65
|
+
if (declared === undefined)
|
|
66
|
+
return handler;
|
|
67
|
+
const codes = new Set(declared.map((refusal) => refusal.code));
|
|
68
|
+
const held = (error) => {
|
|
69
|
+
if (!(error instanceof AppError2) || codes.has(error.code) || isStitchErrorCode2(error.code))
|
|
70
|
+
return error;
|
|
71
|
+
const refused = new AppError2("INTERNAL_SERVER_ERROR", {
|
|
72
|
+
message: `Operation ${label} failed with a code it does not declare`,
|
|
73
|
+
status: 500
|
|
74
|
+
});
|
|
75
|
+
refused.cause = error;
|
|
76
|
+
return refused;
|
|
77
|
+
};
|
|
78
|
+
async function* streamed(source) {
|
|
79
|
+
try {
|
|
80
|
+
yield* source;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
throw held(error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return async (ctx) => {
|
|
86
|
+
let result;
|
|
87
|
+
try {
|
|
88
|
+
result = await handler(ctx);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
throw held(error);
|
|
91
|
+
}
|
|
92
|
+
return "stream" in endpoint && isAsyncIterable(result) ? streamed(result) : result;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
51
95
|
|
|
52
|
-
export { contractMethodFields };
|
|
96
|
+
export { contractMethodFields, withDeclaredRefusals };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeError2,
|
|
3
3
|
validateDeclaredOutput
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-78da4g74.js";
|
|
5
5
|
import {
|
|
6
6
|
localVerdict
|
|
7
7
|
} from "./index-dsa676h8.js";
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
applyToolViewDefaults,
|
|
16
16
|
projectToolView
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-ma26mfnt.js";
|
|
18
18
|
import {
|
|
19
19
|
runWithRequestContext2,
|
|
20
20
|
getRequestContext2
|
|
21
21
|
} from "./index-x6sp5vpa.js";
|
|
22
22
|
import {
|
|
23
23
|
projectedToolError
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-dacxr7nf.js";
|
|
25
25
|
import {
|
|
26
26
|
isUnsafeKey
|
|
27
27
|
} from "./index-zsarb5xp.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
STITCH_ERROR_STATUS2,
|
|
34
34
|
isRetryableStatus2,
|
|
35
35
|
isStitchErrorCode2
|
|
36
|
-
} from "./index-
|
|
36
|
+
} from "./index-7fjbdga8.js";
|
|
37
37
|
import {
|
|
38
38
|
isRecord
|
|
39
39
|
} from "./index-ps3djm8d.js";
|
|
@@ -84,6 +84,7 @@ var STITCH_ERROR_STATUS2 = {
|
|
|
84
84
|
CONNECTION_TIMEOUT: 504,
|
|
85
85
|
CONNECTION_RESPONSE_TOO_LARGE: 413,
|
|
86
86
|
CONNECTION_REQUEST_FAILED: 502,
|
|
87
|
+
HTTP_ERROR: 502,
|
|
87
88
|
UPSTREAM_TOOL_ERROR: 502,
|
|
88
89
|
MCP_STRUCTURED_CONTENT_MISSING: 502,
|
|
89
90
|
OPERATION_NOT_SUCCEEDED: 409,
|
|
@@ -102,8 +103,13 @@ var STITCH_ERROR_STATUS2 = {
|
|
|
102
103
|
function isRetryableStatus2(status) {
|
|
103
104
|
return status === 408 || status === 429 || status === 502 || status === 503 || status === 504;
|
|
104
105
|
}
|
|
106
|
+
var CLIENT_ERROR_CODES2 = [
|
|
107
|
+
"UNKNOWN_ERROR",
|
|
108
|
+
"STREAM_TRUNCATED",
|
|
109
|
+
"STREAM_PROTOCOL_ERROR"
|
|
110
|
+
];
|
|
105
111
|
function isStitchErrorCode2(code) {
|
|
106
112
|
return Object.hasOwn(STITCH_ERROR_STATUS2, code);
|
|
107
113
|
}
|
|
108
114
|
|
|
109
|
-
export { AppError2, notFound2, badRequest2, unauthorized2, forbidden2, conflict2, rateLimited2, STITCH_ERROR_STATUS2, isRetryableStatus2, isStitchErrorCode2 };
|
|
115
|
+
export { AppError2, notFound2, badRequest2, unauthorized2, forbidden2, conflict2, rateLimited2, STITCH_ERROR_STATUS2, isRetryableStatus2, CLIENT_ERROR_CODES2, isStitchErrorCode2 };
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./index-yt1gg11x.js";
|
|
8
8
|
import {
|
|
9
9
|
defineContract2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-9c76vfxf.js";
|
|
11
11
|
import {
|
|
12
12
|
canonicalDigest
|
|
13
13
|
} from "./index-3dq8466w.js";
|
|
@@ -15,11 +15,14 @@ import {
|
|
|
15
15
|
bytesToBase64Url,
|
|
16
16
|
base64UrlToBytes
|
|
17
17
|
} from "./index-dwfv9a85.js";
|
|
18
|
+
import {
|
|
19
|
+
describeRefusals
|
|
20
|
+
} from "./index-dxft2mnm.js";
|
|
18
21
|
import {
|
|
19
22
|
AppError2,
|
|
20
23
|
STITCH_ERROR_STATUS2,
|
|
21
24
|
isStitchErrorCode2
|
|
22
|
-
} from "./index-
|
|
25
|
+
} from "./index-7fjbdga8.js";
|
|
23
26
|
import {
|
|
24
27
|
typedEntries,
|
|
25
28
|
isRecord,
|
|
@@ -52,6 +55,13 @@ function schemaIdentity(schema, io) {
|
|
|
52
55
|
return null;
|
|
53
56
|
return constraintsOf(z.toJSONSchema(schema, { io, unrepresentable: "any", cycles: "ref" }));
|
|
54
57
|
}
|
|
58
|
+
function refusalIdentity(refuses) {
|
|
59
|
+
return [...refuses].sort((left, right) => left.code < right.code ? -1 : left.code > right.code ? 1 : 0).map((refusal) => ({
|
|
60
|
+
code: refusal.code,
|
|
61
|
+
status: refusal.status,
|
|
62
|
+
details: schemaIdentity(refusal.details, "output")
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
55
65
|
function fingerprintOperations(operations) {
|
|
56
66
|
const digests = {};
|
|
57
67
|
for (const operation of operations) {
|
|
@@ -64,7 +74,8 @@ function fingerprintOperations(operations) {
|
|
|
64
74
|
params: schemaIdentity(operation.params, "input"),
|
|
65
75
|
input: schemaIdentity(operation.input, "input"),
|
|
66
76
|
output: schemaIdentity(operation.output, "output"),
|
|
67
|
-
item: schemaIdentity(operation.item, "output")
|
|
77
|
+
item: schemaIdentity(operation.item, "output"),
|
|
78
|
+
...operation.refuses && { refuses: refusalIdentity(operation.refuses) }
|
|
68
79
|
});
|
|
69
80
|
}
|
|
70
81
|
return { fingerprint: canonicalDigest(digests), operations: digests };
|
|
@@ -85,7 +96,8 @@ function contractOperations(contract) {
|
|
|
85
96
|
params: resolveRouteParamsSchema(endpoint.path, endpoint.params),
|
|
86
97
|
input: endpoint.input,
|
|
87
98
|
output: endpoint.output,
|
|
88
|
-
item: "stream" in endpoint ? endpoint.stream?.item : undefined
|
|
99
|
+
item: "stream" in endpoint ? endpoint.stream?.item : undefined,
|
|
100
|
+
refuses: describeRefusals(endpoint.refuses)
|
|
89
101
|
});
|
|
90
102
|
}
|
|
91
103
|
return operations;
|
|
@@ -126,7 +138,7 @@ function defineErrors2(source, mapping) {
|
|
|
126
138
|
Object.freeze(definitions);
|
|
127
139
|
const errors = mapObjectTypeBoundary(definitions, (code, definition) => {
|
|
128
140
|
const name = String(code);
|
|
129
|
-
|
|
141
|
+
const factory = (options = {}) => {
|
|
130
142
|
const message = options.message ?? definition.message;
|
|
131
143
|
if (definition.details === undefined) {
|
|
132
144
|
if ("details" in options) {
|
|
@@ -148,6 +160,7 @@ function defineErrors2(source, mapping) {
|
|
|
148
160
|
retryable: definition.retryable
|
|
149
161
|
});
|
|
150
162
|
};
|
|
163
|
+
return Object.freeze(Object.assign(factory, { code: name, definition }));
|
|
151
164
|
});
|
|
152
165
|
Object.freeze(errors);
|
|
153
166
|
const codes = mapObjectTypeBoundary(definitions, (code) => String(code));
|
|
@@ -9,17 +9,20 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
assertEndpointEffect
|
|
11
11
|
} from "./index-werjqesf.js";
|
|
12
|
+
import {
|
|
13
|
+
assertEndpointRefusals
|
|
14
|
+
} from "./index-dxft2mnm.js";
|
|
12
15
|
import {
|
|
13
16
|
assertMultipartEndpoint,
|
|
14
17
|
assertRawEndpoint,
|
|
15
18
|
assertStreamingResponseEndpoint,
|
|
16
19
|
assertNoUngroupedToolOptions,
|
|
17
|
-
|
|
20
|
+
assertToolDepthOptions,
|
|
18
21
|
assertHeadEndpoint,
|
|
19
22
|
assertRawBodyEndpoint,
|
|
20
23
|
assertSafelistedBodyEndpoint,
|
|
21
24
|
assertResponseMetaEndpoint
|
|
22
|
-
} from "./index-
|
|
25
|
+
} from "./index-msxf2r8x.js";
|
|
23
26
|
import {
|
|
24
27
|
assertPositiveSafeInteger
|
|
25
28
|
} from "./index-gr0kxymw.js";
|
|
@@ -103,6 +106,7 @@ function defineContract2(meta, endpoints) {
|
|
|
103
106
|
for (const [key, ep] of Object.entries(materializedEndpoints)) {
|
|
104
107
|
assertEndpointExposure(meta.prefix, key, ep);
|
|
105
108
|
assertEndpointEffect(meta.prefix, key, ep);
|
|
109
|
+
assertEndpointRefusals(`Contract "${meta.prefix}": endpoint "${key}"`, ep.refuses);
|
|
106
110
|
if (ep.desc.trim() === "") {
|
|
107
111
|
throw new Error(`Contract "${meta.prefix}": endpoint "${key}" has an empty desc`);
|
|
108
112
|
}
|
|
@@ -135,7 +139,7 @@ function defineContract2(meta, endpoints) {
|
|
|
135
139
|
}
|
|
136
140
|
if (tool.view !== undefined)
|
|
137
141
|
assertToolView(meta.prefix, key, ep);
|
|
138
|
-
|
|
142
|
+
assertToolDepthOptions(`Contract "${meta.prefix}": endpoint "${key}" tool`, tool);
|
|
139
143
|
if (!tool.name)
|
|
140
144
|
continue;
|
|
141
145
|
const existing = toolTransports.get(tool.name);
|