stitchkit 0.135.0 → 0.136.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 +117 -0
- package/README.md +25 -11
- package/dist/agent-executor/acp/v1-session-build.d.ts +51 -0
- package/dist/agent-executor/acp/v1-session-build.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-session.d.ts +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/classify.d.ts +1 -1
- package/dist/agent-executor/claude/classify.d.ts.map +1 -1
- package/dist/agent-executor/claude/events-wire.d.ts +13 -0
- package/dist/agent-executor/claude/events-wire.d.ts.map +1 -0
- package/dist/agent-executor/claude/events.d.ts +1 -11
- package/dist/agent-executor/claude/events.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +0 -143
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/server-requests.d.ts +150 -0
- package/dist/agent-executor/codex/server-requests.d.ts.map +1 -0
- package/dist/agent-executor/image-input.d.ts +10 -3
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
- package/dist/agent-runtime/browser/browser-control-contract.d.ts +4 -0
- package/dist/agent-runtime/browser/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-schema.d.ts +4 -0
- package/dist/agent-runtime/browser/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-view.d.ts.map +1 -1
- package/dist/agent-runtime/event-schema.d.ts +16 -3
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/loop/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/loop/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/loop/invocation-stream.d.ts +9 -1
- package/dist/agent-runtime/loop/invocation-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/provider-stream-parts.d.ts +6 -0
- package/dist/agent-runtime/loop/provider-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/loop/provider-stream-segments.d.ts +1 -1
- package/dist/agent-runtime/loop/provider-stream-segments.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-approval-signature.d.ts +34 -0
- package/dist/agent-runtime/loop/run-approval-signature.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-approval.d.ts +0 -28
- package/dist/agent-runtime/loop/run-approval.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete-port.d.ts +24 -0
- package/dist/agent-runtime/loop/run-complete-port.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-complete-stream.d.ts +7 -2
- package/dist/agent-runtime/loop/run-complete-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete-types.d.ts +14 -1
- package/dist/agent-runtime/loop/run-complete-types.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete.d.ts +2 -2
- package/dist/agent-runtime/loop/run-complete.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-execution-state.d.ts +8 -0
- package/dist/agent-runtime/loop/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-model-call.d.ts +44 -0
- package/dist/agent-runtime/loop/run-model-call.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-model-step.d.ts +25 -28
- package/dist/agent-runtime/loop/run-model-step.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-model-steps.d.ts +6 -0
- package/dist/agent-runtime/loop/run-model-steps.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-model-stream.d.ts +3 -1
- package/dist/agent-runtime/loop/run-model-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts +0 -2
- package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-step-loop.d.ts +19 -0
- package/dist/agent-runtime/loop/run-step-loop.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-step-port.d.ts +175 -0
- package/dist/agent-runtime/loop/run-step-port.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-stream-step-text.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts +2 -1
- package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-call-input.d.ts +39 -0
- package/dist/agent-runtime/loop/run-tool-call-input.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-tool-call.d.ts +2 -31
- package/dist/agent-runtime/loop/run-tool-call.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-errors.d.ts +5 -0
- package/dist/agent-runtime/loop/run-tool-errors.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-executor.d.ts +1 -1
- package/dist/agent-runtime/loop/run-tool-executor.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-slots.d.ts +2 -1
- package/dist/agent-runtime/loop/run-tool-slots.d.ts.map +1 -1
- package/dist/agent-runtime/loop/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/loop/runtime.d.ts +0 -5
- package/dist/agent-runtime/loop/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/providers/ai-sdk-convert.d.ts +1 -5
- package/dist/agent-runtime/providers/ai-sdk-convert.d.ts.map +1 -1
- package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts +11 -0
- package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts.map +1 -0
- package/dist/agent-runtime/providers/ai-sdk-tools.d.ts +11 -0
- package/dist/agent-runtime/providers/ai-sdk-tools.d.ts.map +1 -0
- package/dist/agent-runtime/providers/ai-sdk.d.ts +1 -9
- package/dist/agent-runtime/providers/ai-sdk.d.ts.map +1 -1
- package/dist/agent-runtime/providers/anthropic-sse.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-admission.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-audio.d.ts +164 -0
- package/dist/agent-runtime/providers/openrouter-audio.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-catalog-cache.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-catalog-query.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-catalog.d.ts +4 -2
- package/dist/agent-runtime/providers/openrouter-catalog.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-client.d.ts +37 -0
- package/dist/agent-runtime/providers/openrouter-client.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-http.d.ts +120 -0
- package/dist/agent-runtime/providers/openrouter-http.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-media.d.ts +174 -0
- package/dist/agent-runtime/providers/openrouter-media.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-models.d.ts +2 -23
- package/dist/agent-runtime/providers/openrouter-models.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-options.d.ts +4 -0
- package/dist/agent-runtime/providers/openrouter-options.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-request.d.ts +23 -0
- package/dist/agent-runtime/providers/openrouter-request.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-response.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-retrieval.d.ts +145 -0
- package/dist/agent-runtime/providers/openrouter-retrieval.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-speech.d.ts +90 -0
- package/dist/agent-runtime/providers/openrouter-speech.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-spend.d.ts +7 -3
- package/dist/agent-runtime/providers/openrouter-spend.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-stream.d.ts +29 -0
- package/dist/agent-runtime/providers/openrouter-stream.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-systemone.d.ts +137 -0
- package/dist/agent-runtime/providers/openrouter-systemone.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-url.d.ts +19 -0
- package/dist/agent-runtime/providers/openrouter-url.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-wire.d.ts +45 -0
- package/dist/agent-runtime/providers/openrouter-wire.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter.d.ts +5 -4
- package/dist/agent-runtime/providers/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-http.d.ts +29 -3
- package/dist/agent-runtime/providers/provider-http.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-json-schema-strip.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-json-schema.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-openai-chat-sse.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-openai-chat-state.d.ts +42 -0
- package/dist/agent-runtime/providers/provider-openai-chat-state.d.ts.map +1 -0
- package/dist/agent-runtime/providers/provider-usage.d.ts +9 -0
- package/dist/agent-runtime/providers/provider-usage.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts +9 -0
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts +6 -0
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-linux.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts +5 -1
- package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-wrapper.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/stores/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/agent-runtime/testing/fault-bench.d.ts +5 -1
- package/dist/agent-runtime/testing/fault-bench.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -7
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +17 -5
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +4 -2
- package/dist/entrypoints/agent-executor/claude-sdk.js +20 -20
- package/dist/entrypoints/agent-executor/claude.js +7 -7
- package/dist/entrypoints/agent-executor/codex.d.ts +2 -1
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +129 -35
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +2 -2
- package/dist/entrypoints/agent-executor/testing.js +17 -13
- package/dist/entrypoints/agent-executor.js +1 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts +2 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.js +10 -12
- package/dist/entrypoints/agent-runtime/anthropic.js +13 -10
- package/dist/entrypoints/agent-runtime/browser.js +8 -4
- package/dist/entrypoints/agent-runtime/harness.js +18 -19
- package/dist/entrypoints/agent-runtime/openai.js +5 -5
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +11 -2
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +1940 -496
- package/dist/entrypoints/agent-runtime/postgres.js +2 -2
- package/dist/entrypoints/agent-runtime/realtime.js +5 -5
- package/dist/entrypoints/agent-runtime/sandbox.js +167 -139
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.js +3 -3
- package/dist/entrypoints/agent-runtime.js +246 -360
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +36 -15
- package/dist/entrypoints/contract.js +12 -10
- package/dist/entrypoints/geo.js +1 -1
- package/dist/entrypoints/handler.js +5 -6
- package/dist/entrypoints/http.d.ts +2 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +16 -4
- package/dist/entrypoints/index.js +26 -35
- package/dist/entrypoints/live.js +3 -3
- package/dist/entrypoints/node.js +7 -7
- package/dist/entrypoints/observability.js +9 -7
- package/dist/entrypoints/process.js +3 -3
- package/dist/entrypoints/remote.js +5 -5
- package/dist/entrypoints/server.js +29 -16
- package/dist/entrypoints/telegram/grammy.d.ts +1 -1
- package/dist/entrypoints/telegram/grammy.d.ts.map +1 -1
- package/dist/entrypoints/telegram/grammy.js +39 -5
- package/dist/entrypoints/telegram/screens.js +3 -0
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +19 -6
- package/dist/entrypoints/testing.js +10 -11
- package/dist/entrypoints/tools/agent.js +8 -9
- package/dist/entrypoints/tools/connections.js +27 -57
- package/dist/entrypoints/tools/contract.js +4 -4
- package/dist/entrypoints/tools/invoker.js +7 -8
- package/dist/entrypoints/tools/mcp.js +9 -10
- package/dist/entrypoints/tools/toolkit.js +11 -12
- package/dist/entrypoints/tools.js +20 -20
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +1 -1
- package/dist/entrypoints/tracking.js +1 -1
- package/dist/{index-3czc3ykr.js → index-08a3qfr8.js} +1 -1
- package/dist/{index-grhhsrd5.js → index-1en7k3q5.js} +2 -1
- package/dist/{index-pdcbjd6a.js → index-1yky29qg.js} +6 -3
- package/dist/{index-b4c9dpzm.js → index-252den5a.js} +10 -11
- package/dist/{index-xtby8rj3.js → index-28kbdn63.js} +5 -47
- package/dist/{index-57sbckhv.js → index-36mtj8xm.js} +2 -2
- package/dist/{index-dm84tsd5.js → index-3kb8dw48.js} +1 -1
- package/dist/index-3tb82xr7.js +11 -0
- package/dist/{index-c24bj2r1.js → index-4243301z.js} +2 -2
- package/dist/{index-nr4fhfn4.js → index-4p2zx593.js} +2 -0
- package/dist/{index-q86qnzzf.js → index-54wp467c.js} +4 -4
- package/dist/{index-mcv7b2n0.js → index-63ctzjp4.js} +497 -495
- package/dist/{index-y0a4gt1s.js → index-65p8v81y.js} +3 -2
- package/dist/{index-z72vazf5.js → index-6y3eae97.js} +27 -83
- package/dist/{index-5awtbyns.js → index-9vj869rx.js} +1 -1
- package/dist/{index-5q0qpw3v.js → index-aqm7e864.js} +23 -8
- package/dist/{index-d4at0q09.js → index-b9mj31q7.js} +90 -88
- package/dist/{index-baba8ehy.js → index-bjrcbcn2.js} +2 -2
- package/dist/{index-fsw9wxk9.js → index-c9j8441q.js} +1 -103
- package/dist/{index-wdb5jhas.js → index-d1pdv8qc.js} +1 -1
- package/dist/{index-73wq9abg.js → index-df5xr2f9.js} +13 -59
- package/dist/{index-n9358ydy.js → index-dm50x3by.js} +1 -1
- package/dist/{index-zyyerdny.js → index-dmrx8xma.js} +3 -0
- package/dist/{index-78da4g74.js → index-dwq6a6sq.js} +17 -13
- package/dist/{index-9be3tf6r.js → index-e413q2cj.js} +49 -22
- package/dist/{index-g4gstmp1.js → index-ednf2cxs.js} +1 -1
- package/dist/{index-84tp547a.js → index-edpkm3k7.js} +29 -97
- package/dist/{index-gs0jw0hy.js → index-efbzm2se.js} +3 -3
- package/dist/{index-de7b0kvz.js → index-epwvp88y.js} +1 -1
- package/dist/{index-asnd4h2k.js → index-f0dzyskg.js} +27 -4
- package/dist/{index-xbb8ysmq.js → index-fatke81t.js} +2 -2
- package/dist/{index-6nzzj7qr.js → index-gq35s3bm.js} +1 -1
- package/dist/index-gvgtmt7a.js +102 -0
- package/dist/{index-m2b49tvc.js → index-h08xqfw9.js} +20 -21
- package/dist/{index-gk6dq9ay.js → index-ha1tv70k.js} +3 -26
- package/dist/{index-wsv11dhg.js → index-hberxns4.js} +1 -1
- package/dist/{index-rkphknhx.js → index-hpzhz1vm.js} +1 -1
- package/dist/{index-npfdymav.js → index-j5vzhj3d.js} +1 -1
- package/dist/{index-d3s070eh.js → index-jperyn0c.js} +1 -1
- package/dist/{index-yhwx4fwk.js → index-kzsetgh9.js} +1 -1
- package/dist/{index-x6sp5vpa.js → index-q4tr9vnf.js} +1 -1
- package/dist/{index-hce3hbdg.js → index-qj0sq69b.js} +6 -2
- package/dist/{index-v0j22shs.js → index-rg08syp1.js} +9 -6
- package/dist/{index-8vzh5wpv.js → index-rw1caff2.js} +14 -26
- package/dist/index-s8af9jqw.js +6 -0
- package/dist/{index-bgj9hbm3.js → index-sdppfbrh.js} +30 -16
- package/dist/{index-y0mwkgkf.js → index-shte29pg.js} +1086 -1055
- package/dist/{index-fec05c9k.js → index-ta0e2daw.js} +9 -7
- package/dist/{index-zfrysr1e.js → index-tb36xawm.js} +110 -75
- package/dist/{index-c0yym4a0.js → index-w7e402wx.js} +11 -105
- package/dist/{index-bvpevwt6.js → index-xnqab06h.js} +207 -202
- package/dist/index-xrbrvn15.js +147 -0
- package/dist/{index-ac3rfec5.js → index-y6wzzk2e.js} +21 -1
- package/dist/{index-3d2c45jn.js → index-yjx5jna7.js} +2 -2
- package/dist/internal/loopback-host.d.ts +8 -0
- package/dist/internal/loopback-host.d.ts.map +1 -0
- package/dist/internal/own-member.d.ts +7 -0
- package/dist/internal/own-member.d.ts.map +1 -0
- package/dist/internal/request.d.ts +17 -8
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/secret-shapes.d.ts +33 -4
- package/dist/internal/secret-shapes.d.ts.map +1 -1
- package/dist/json-schema/dialect.d.ts.map +1 -1
- package/dist/json-schema/keywords.d.ts +25 -6
- package/dist/json-schema/keywords.d.ts.map +1 -1
- package/dist/json-schema/string-format.d.ts.map +1 -1
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/observability/context.d.ts +4 -3
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/sanitize.d.ts.map +1 -1
- package/dist/observability/secret-values.d.ts +0 -9
- package/dist/observability/secret-values.d.ts.map +1 -1
- package/dist/server/context.d.ts +3 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +4 -3
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/event-bus.d.ts.map +1 -1
- package/dist/server/file.d.ts +11 -3
- package/dist/server/file.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +2 -2
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +12 -1
- package/dist/server/middleware/jwt.d.ts.map +1 -1
- package/dist/server/middleware/trust-fence.d.ts +4 -0
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart.d.ts +2 -3
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-body.d.ts +12 -1
- package/dist/server/request-body.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/types.d.ts +14 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts +4 -4
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts.map +1 -1
- package/dist/telegram/screens/test-chat.d.ts.map +1 -1
- package/dist/telegram/widget-api.d.ts +85 -13
- package/dist/telegram/widget-api.d.ts.map +1 -1
- package/dist/telegram/widget.d.ts +46 -2
- package/dist/telegram/widget.d.ts.map +1 -1
- package/dist/tools/cli/args-classify.d.ts +4 -74
- package/dist/tools/cli/args-classify.d.ts.map +1 -1
- package/dist/tools/cli/args-framework.d.ts +79 -0
- package/dist/tools/cli/args-framework.d.ts.map +1 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -1
- package/dist/tools/cli/args-tokens.d.ts.map +1 -1
- package/dist/tools/cli/checkpoint.d.ts +5 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/execute-handler.d.ts +24 -0
- package/dist/tools/execute-handler.d.ts.map +1 -0
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/mcp/round.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/flatten.d.ts.map +1 -1
- package/dist/tools/schema/inline-references.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -1
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tracking/privacy.d.ts.map +1 -1
- package/llms/agent-runtime-openrouter.txt +14 -5
- package/llms/agent-runtime-sandbox.txt +50 -11
- package/llms/agent-runtime-testing.txt +1 -1
- package/llms/agent-runtime.2.txt +342 -230
- package/llms/agent-runtime.3.txt +225 -380
- package/llms/agent-runtime.4.txt +387 -158
- package/llms/agent-runtime.5.txt +157 -152
- package/llms/agent-runtime.6.txt +164 -0
- package/llms/agent-runtime.txt +307 -362
- package/llms/application.txt +3 -1
- package/llms/http.txt +1 -1
- package/llms/live.txt +3 -1
- package/llms/observability.txt +16 -9
- package/llms/server.2.txt +13 -8
- package/llms/server.4.txt +23 -11
- package/llms/server.5.txt +5 -5
- package/llms/server.txt +54 -1
- package/llms/spend.txt +18 -1
- package/llms/stitchkit.2.txt +4 -2
- package/llms/stitchkit.txt +113 -93
- package/llms/telegram-grammy.txt +3 -2
- package/llms/telegram.2.txt +3 -1
- package/llms/telegram.txt +35 -10
- package/llms/upgrading-0.128.0-0.129.0.txt +175 -0
- package/llms/{upgrading-0.128.0-0.135.0.txt → upgrading-0.130.0-0.136.0.txt} +353 -169
- package/llms/upgrading.txt +2 -1
- package/llms-full.txt +1035 -208
- package/llms.txt +14 -13
- package/package.json +6 -6
- package/dist/agent-runtime/loop/deferred-tools-internal.d.ts +0 -19
- package/dist/agent-runtime/loop/deferred-tools-internal.d.ts.map +0 -1
- package/dist/agent-runtime/loop/run-complete-retry.d.ts +0 -24
- package/dist/agent-runtime/loop/run-complete-retry.d.ts.map +0 -1
- package/dist/agent-runtime/loop/run-model-attempts.d.ts +0 -6
- package/dist/agent-runtime/loop/run-model-attempts.d.ts.map +0 -1
- package/dist/index-sznqf8fx.js +0 -20
- /package/dist/{index-fthw8dwa.js → index-4gbybjg6.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
mapSubschemas
|
|
3
|
+
} from "./index-e413q2cj.js";
|
|
4
|
+
import {
|
|
5
|
+
setOwnMember
|
|
6
|
+
} from "./index-3tb82xr7.js";
|
|
6
7
|
import {
|
|
7
8
|
serializeCanonicalJson
|
|
8
9
|
} from "./index-fmzg39a8.js";
|
|
@@ -17,60 +18,16 @@ var DEFS_KEYWORD = "$defs";
|
|
|
17
18
|
function declaresDraft07(dialect) {
|
|
18
19
|
return typeof dialect === "string" && dialect.includes(DRAFT_07_MARKER);
|
|
19
20
|
}
|
|
20
|
-
function mapValues(value, rewrite) {
|
|
21
|
-
if (!isRecord(value))
|
|
22
|
-
return value;
|
|
23
|
-
const rewritten = {};
|
|
24
|
-
for (const [name, child] of Object.entries(value))
|
|
25
|
-
rewritten[name] = rewrite(child);
|
|
26
|
-
return rewritten;
|
|
27
|
-
}
|
|
28
|
-
function mapDependencies(value, rewrite) {
|
|
29
|
-
if (!isRecord(value))
|
|
30
|
-
return value;
|
|
31
|
-
const rewritten = {};
|
|
32
|
-
for (const [name, child] of Object.entries(value)) {
|
|
33
|
-
rewritten[name] = isRecord(child) ? rewrite(child) : child;
|
|
34
|
-
}
|
|
35
|
-
return rewritten;
|
|
36
|
-
}
|
|
37
21
|
function rewriteDefinitionPointers(schema) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (key === "$ref" && typeof child === "string" && child.startsWith(`#/${DRAFT_07_KEYWORD}/`)) {
|
|
43
|
-
rewritten[key] = `#/${DEFS_KEYWORD}/${child.slice(`#/${DRAFT_07_KEYWORD}/`.length)}`;
|
|
44
|
-
} else if (SCHEMA_KEYWORDS.includes(key)) {
|
|
45
|
-
rewritten[key] = Array.isArray(child) ? child.map(rewriteDefinitionPointers) : rewriteDefinitionPointers(child);
|
|
46
|
-
} else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
|
|
47
|
-
rewritten[key] = child.map(rewriteDefinitionPointers);
|
|
48
|
-
} else if (SCHEMA_MAP_KEYWORDS.includes(key)) {
|
|
49
|
-
rewritten[key] = mapValues(child, rewriteDefinitionPointers);
|
|
50
|
-
} else if (key === "dependencies") {
|
|
51
|
-
rewritten[key] = mapDependencies(child, rewriteDefinitionPointers);
|
|
52
|
-
} else {
|
|
53
|
-
rewritten[key] = child;
|
|
54
|
-
}
|
|
22
|
+
const rewritten = mapSubschemas(schema, { schema: rewriteDefinitionPointers });
|
|
23
|
+
const pointer = rewritten.$ref;
|
|
24
|
+
if (typeof pointer === "string" && pointer.startsWith(`#/${DRAFT_07_KEYWORD}/`)) {
|
|
25
|
+
rewritten.$ref = `#/${DEFS_KEYWORD}/${pointer.slice(`#/${DRAFT_07_KEYWORD}/`.length)}`;
|
|
55
26
|
}
|
|
56
27
|
return rewritten;
|
|
57
28
|
}
|
|
58
29
|
function withPositionalItems(schema) {
|
|
59
|
-
|
|
60
|
-
return schema;
|
|
61
|
-
const rewritten = {};
|
|
62
|
-
for (const [key, child] of Object.entries(schema)) {
|
|
63
|
-
if (SCHEMA_KEYWORDS.includes(key)) {
|
|
64
|
-
rewritten[key] = Array.isArray(child) ? child.map(withPositionalItems) : withPositionalItems(child);
|
|
65
|
-
} else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
|
|
66
|
-
rewritten[key] = child.map(withPositionalItems);
|
|
67
|
-
} else if (SCHEMA_MAP_KEYWORDS.includes(key)) {
|
|
68
|
-
rewritten[key] = mapValues(child, withPositionalItems);
|
|
69
|
-
} else if (key === "dependencies") {
|
|
70
|
-
rewritten[key] = mapDependencies(child, withPositionalItems);
|
|
71
|
-
} else
|
|
72
|
-
rewritten[key] = child;
|
|
73
|
-
}
|
|
30
|
+
const rewritten = mapSubschemas(schema, { schema: withPositionalItems });
|
|
74
31
|
const { items, additionalItems } = rewritten;
|
|
75
32
|
if (!Array.isArray(items))
|
|
76
33
|
return rewritten;
|
|
@@ -79,7 +36,7 @@ function withPositionalItems(schema) {
|
|
|
79
36
|
if (key === "items")
|
|
80
37
|
positional.prefixItems = items;
|
|
81
38
|
else if (key !== "additionalItems")
|
|
82
|
-
positional
|
|
39
|
+
setOwnMember(positional, key, child);
|
|
83
40
|
}
|
|
84
41
|
if (additionalItems !== undefined)
|
|
85
42
|
positional.items = additionalItems;
|
|
@@ -87,8 +44,6 @@ function withPositionalItems(schema) {
|
|
|
87
44
|
}
|
|
88
45
|
function withDraft2020Keywords(schema) {
|
|
89
46
|
const positional = withPositionalItems(schema);
|
|
90
|
-
if (!isRecord(positional))
|
|
91
|
-
return schema;
|
|
92
47
|
const definitions = positional[DRAFT_07_KEYWORD];
|
|
93
48
|
if (!isRecord(definitions) || DEFS_KEYWORD in positional)
|
|
94
49
|
return positional;
|
|
@@ -96,11 +51,10 @@ function withDraft2020Keywords(schema) {
|
|
|
96
51
|
for (const [key, value] of Object.entries(positional)) {
|
|
97
52
|
if (key === DRAFT_07_KEYWORD)
|
|
98
53
|
continue;
|
|
99
|
-
moved
|
|
54
|
+
setOwnMember(moved, key, value);
|
|
100
55
|
}
|
|
101
56
|
moved[DEFS_KEYWORD] = definitions;
|
|
102
|
-
|
|
103
|
-
return isRecord(rewritten) ? rewritten : moved;
|
|
57
|
+
return rewriteDefinitionPointers(moved);
|
|
104
58
|
}
|
|
105
59
|
|
|
106
60
|
// src/tools/schema/flatten-join.ts
|
|
@@ -107,6 +107,9 @@ function defineContract2(meta, endpoints) {
|
|
|
107
107
|
assertEndpointExposure(meta.prefix, key, ep);
|
|
108
108
|
assertEndpointEffect(meta.prefix, key, ep);
|
|
109
109
|
assertEndpointRefusals(`Contract "${meta.prefix}": endpoint "${key}"`, ep.refuses);
|
|
110
|
+
if (typeof ep.desc !== "string") {
|
|
111
|
+
throw new Error(`Contract "${meta.prefix}": endpoint "${key}" requires desc`);
|
|
112
|
+
}
|
|
110
113
|
if (ep.desc.trim() === "") {
|
|
111
114
|
throw new Error(`Contract "${meta.prefix}": endpoint "${key}" has an empty desc`);
|
|
112
115
|
}
|
|
@@ -10,15 +10,28 @@ import {
|
|
|
10
10
|
} from "./index-ps3djm8d.js";
|
|
11
11
|
|
|
12
12
|
// src/contract/normalize.ts
|
|
13
|
-
import { z } from "zod";
|
|
14
13
|
var MAX_DETAIL_ISSUES = 20;
|
|
15
14
|
function errorCode2(err) {
|
|
16
15
|
if (AppError2.is(err))
|
|
17
16
|
return err.code;
|
|
18
|
-
if (err instanceof z.ZodError)
|
|
19
|
-
return "VALIDATION_ERROR";
|
|
20
17
|
return;
|
|
21
18
|
}
|
|
19
|
+
function invalidInput(error) {
|
|
20
|
+
return new AppError2("VALIDATION_ERROR", {
|
|
21
|
+
message: formatZodError2(error),
|
|
22
|
+
status: 400,
|
|
23
|
+
details: {
|
|
24
|
+
issues: zodIssues2(error).slice(0, MAX_DETAIL_ISSUES)
|
|
25
|
+
},
|
|
26
|
+
cause: error
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function parseContractInput(schema, value) {
|
|
30
|
+
const parsed = schema.safeParse(value);
|
|
31
|
+
if (!parsed.success)
|
|
32
|
+
throw invalidInput(parsed.error);
|
|
33
|
+
return parsed.data;
|
|
34
|
+
}
|
|
22
35
|
function recordedErrorMessage(code, envelopeMessage, thrown) {
|
|
23
36
|
if ((code === "INTERNAL_SERVER_ERROR" || code === "REALTIME_CONTRACT_VIOLATION") && thrown !== undefined) {
|
|
24
37
|
if (thrown instanceof Error)
|
|
@@ -38,15 +51,6 @@ function normalizeError2(err, options = {}) {
|
|
|
38
51
|
}
|
|
39
52
|
return err;
|
|
40
53
|
}
|
|
41
|
-
if (err instanceof z.ZodError) {
|
|
42
|
-
return new AppError2("VALIDATION_ERROR", {
|
|
43
|
-
message: formatZodError2(err),
|
|
44
|
-
status: 400,
|
|
45
|
-
details: {
|
|
46
|
-
issues: zodIssues2(err).slice(0, MAX_DETAIL_ISSUES)
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
54
|
if (options.logUnexpected !== false)
|
|
51
55
|
console.error("[stitchkit] unhandled error:", err);
|
|
52
56
|
return new AppError2("INTERNAL_SERVER_ERROR", {
|
|
@@ -107,4 +111,4 @@ function validateDeclaredOutput(schema, data, onStripped) {
|
|
|
107
111
|
return validateHandlerOutput(schema, data, onStripped);
|
|
108
112
|
}
|
|
109
113
|
|
|
110
|
-
export { errorCode2, recordedErrorMessage, normalizeError2, validateDeclaredOutput };
|
|
114
|
+
export { errorCode2, parseContractInput, recordedErrorMessage, normalizeError2, validateDeclaredOutput };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setOwnMember
|
|
3
|
+
} from "./index-3tb82xr7.js";
|
|
1
4
|
import {
|
|
2
5
|
isRecord
|
|
3
6
|
} from "./index-ps3djm8d.js";
|
|
@@ -153,9 +156,6 @@ function lookupJsonSchemaKeyword(keyword) {
|
|
|
153
156
|
return KEYWORD_MAP.get(keyword) ?? (isSchemaExtensionKeyword(keyword) ? EXTENSION_ROW : undefined);
|
|
154
157
|
}
|
|
155
158
|
var entries = [...KEYWORD_MAP.entries()];
|
|
156
|
-
var SCHEMA_KEYWORDS = entries.filter(([, meta]) => meta.subschema === "single").map(([name]) => name);
|
|
157
|
-
var SCHEMA_LIST_KEYWORDS = entries.filter(([, meta]) => meta.subschema === "list").map(([name]) => name);
|
|
158
|
-
var SCHEMA_MAP_KEYWORDS = entries.filter(([, meta]) => meta.subschema === "map").map(([name]) => name);
|
|
159
159
|
var TYPE_DEFINING_KEYWORDS = entries.filter(([, meta]) => meta.typesValue === true).map(([name]) => name);
|
|
160
160
|
var HELP_SHOWN_KEYWORDS = new Set(entries.filter(([, meta]) => meta.help === "shown").map(([name]) => name));
|
|
161
161
|
var REMOTE_STRIPPED_KEYWORDS = new Set(entries.filter(([, meta]) => meta.stripLocally === true).map(([name]) => name));
|
|
@@ -171,26 +171,53 @@ function assertKnownJsonSchemaKeywords(schema, dialect) {
|
|
|
171
171
|
if (outcome === "refused") {
|
|
172
172
|
throw new Error(`JSON Schema keyword "${key}" is refused: ${meta.reason}`);
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
} else if (meta.subschema === "map" && isRecord(value)) {
|
|
185
|
-
for (const child of Object.values(value))
|
|
186
|
-
assertKnownJsonSchemaKeywords(child, dialect);
|
|
187
|
-
} else if (meta.subschema === "dependencies" && isRecord(value)) {
|
|
188
|
-
for (const child of Object.values(value)) {
|
|
189
|
-
if (isRecord(child))
|
|
190
|
-
assertKnownJsonSchemaKeywords(child, dialect);
|
|
191
|
-
}
|
|
174
|
+
for (const child of subschemasOf(key, value))
|
|
175
|
+
assertKnownJsonSchemaKeywords(child, dialect);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function subschemasOf(keyword, value) {
|
|
179
|
+
const found = [];
|
|
180
|
+
mapSubschemaValue(keyword, value, {
|
|
181
|
+
schema: (child) => {
|
|
182
|
+
found.push(child);
|
|
183
|
+
return child;
|
|
192
184
|
}
|
|
185
|
+
});
|
|
186
|
+
return found;
|
|
187
|
+
}
|
|
188
|
+
function eachSubschema(node, visit, omit) {
|
|
189
|
+
for (const [keyword, value] of Object.entries(node)) {
|
|
190
|
+
if (omit?.(keyword))
|
|
191
|
+
continue;
|
|
192
|
+
for (const child of subschemasOf(keyword, value))
|
|
193
|
+
visit(child);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
var asWritten = (value) => value;
|
|
197
|
+
function mapSubschemaValue(keyword, value, rewrite) {
|
|
198
|
+
const literal = rewrite.literal ?? asWritten;
|
|
199
|
+
const each = (child) => isRecord(child) ? rewrite.schema(child) : literal(child);
|
|
200
|
+
const shape = lookupJsonSchemaKeyword(keyword)?.subschema;
|
|
201
|
+
if (shape === "single")
|
|
202
|
+
return Array.isArray(value) ? value.map(each) : each(value);
|
|
203
|
+
if (shape === "list" && Array.isArray(value))
|
|
204
|
+
return value.map(each);
|
|
205
|
+
if ((shape === "map" || shape === "dependencies") && isRecord(value)) {
|
|
206
|
+
const mapped = {};
|
|
207
|
+
for (const [name, member] of Object.entries(value))
|
|
208
|
+
setOwnMember(mapped, name, each(member));
|
|
209
|
+
return mapped;
|
|
210
|
+
}
|
|
211
|
+
return literal(value);
|
|
212
|
+
}
|
|
213
|
+
function mapSubschemas(node, rewrite) {
|
|
214
|
+
const out = {};
|
|
215
|
+
for (const [keyword, value] of Object.entries(node)) {
|
|
216
|
+
if (rewrite.omit?.(keyword))
|
|
217
|
+
continue;
|
|
218
|
+
setOwnMember(out, keyword, mapSubschemaValue(keyword, value, rewrite));
|
|
193
219
|
}
|
|
220
|
+
return out;
|
|
194
221
|
}
|
|
195
222
|
|
|
196
|
-
export { JSON_SCHEMA_KEYWORDS,
|
|
223
|
+
export { JSON_SCHEMA_KEYWORDS, TYPE_DEFINING_KEYWORDS, HELP_SHOWN_KEYWORDS, REMOTE_STRIPPED_KEYWORDS, assertKnownJsonSchemaKeywords, eachSubschema, mapSubschemaValue, mapSubschemas };
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
validateDeclaredOutput
|
|
3
|
-
} from "./index-78da4g74.js";
|
|
4
1
|
import {
|
|
5
2
|
isHttpOnlyEndpoint
|
|
6
3
|
} from "./index-yt1gg11x.js";
|
|
7
4
|
import {
|
|
8
5
|
toJsonSchema
|
|
9
|
-
} from "./index-
|
|
6
|
+
} from "./index-d1pdv8qc.js";
|
|
10
7
|
import {
|
|
11
8
|
mergeSchemas
|
|
12
|
-
} from "./index-
|
|
9
|
+
} from "./index-dm50x3by.js";
|
|
10
|
+
import {
|
|
11
|
+
validateDeclaredOutput
|
|
12
|
+
} from "./index-dwq6a6sq.js";
|
|
13
13
|
import {
|
|
14
14
|
withDraft2020Keywords,
|
|
15
15
|
stringValues,
|
|
16
16
|
mergePropertySchemas
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-df5xr2f9.js";
|
|
18
18
|
import {
|
|
19
19
|
assertNoLegacyTransports
|
|
20
20
|
} from "./index-akfgymyr.js";
|
|
21
21
|
import {
|
|
22
22
|
JSON_SCHEMA_KEYWORDS,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from "./index-9be3tf6r.js";
|
|
23
|
+
eachSubschema,
|
|
24
|
+
mapSubschemas
|
|
25
|
+
} from "./index-e413q2cj.js";
|
|
27
26
|
import {
|
|
28
27
|
assertInputRecursionDepth,
|
|
29
28
|
assertInputNestingDepth
|
|
@@ -31,6 +30,9 @@ import {
|
|
|
31
30
|
import {
|
|
32
31
|
AppError2
|
|
33
32
|
} from "./index-7fjbdga8.js";
|
|
33
|
+
import {
|
|
34
|
+
setOwnMember
|
|
35
|
+
} from "./index-3tb82xr7.js";
|
|
34
36
|
import {
|
|
35
37
|
isRecord
|
|
36
38
|
} from "./index-ps3djm8d.js";
|
|
@@ -160,45 +162,8 @@ function assertUniqueToolName(name, taken, surface) {
|
|
|
160
162
|
import { z } from "zod";
|
|
161
163
|
|
|
162
164
|
// src/tools/schema/flatten.ts
|
|
163
|
-
var SINGLE_SUBSCHEMA_KEYWORDS = new Set(SCHEMA_KEYWORDS);
|
|
164
|
-
var LIST_SUBSCHEMA_KEYWORDS = new Set(SCHEMA_LIST_KEYWORDS);
|
|
165
|
-
var MAP_SUBSCHEMA_KEYWORDS = new Set(SCHEMA_MAP_KEYWORDS);
|
|
166
|
-
function cloneJsonValue(value) {
|
|
167
|
-
if (Array.isArray(value))
|
|
168
|
-
return value.map(cloneJsonValue);
|
|
169
|
-
if (!isRecord(value))
|
|
170
|
-
return value;
|
|
171
|
-
const copy = {};
|
|
172
|
-
for (const [key, entry] of Object.entries(value))
|
|
173
|
-
copy[key] = cloneJsonValue(entry);
|
|
174
|
-
return copy;
|
|
175
|
-
}
|
|
176
165
|
function rebuild(value) {
|
|
177
|
-
|
|
178
|
-
return cloneJsonValue(value);
|
|
179
|
-
const node = {};
|
|
180
|
-
for (const [key, child] of Object.entries(value)) {
|
|
181
|
-
if (SINGLE_SUBSCHEMA_KEYWORDS.has(key)) {
|
|
182
|
-
node[key] = Array.isArray(child) ? child.map(rebuild) : isRecord(child) ? rebuild(child) : cloneJsonValue(child);
|
|
183
|
-
} else if (LIST_SUBSCHEMA_KEYWORDS.has(key) && Array.isArray(child)) {
|
|
184
|
-
node[key] = child.map(rebuild);
|
|
185
|
-
} else if (MAP_SUBSCHEMA_KEYWORDS.has(key) && isRecord(child)) {
|
|
186
|
-
const map = {};
|
|
187
|
-
for (const [entryKey, entryValue] of Object.entries(child)) {
|
|
188
|
-
map[entryKey] = isRecord(entryValue) ? rebuild(entryValue) : cloneJsonValue(entryValue);
|
|
189
|
-
}
|
|
190
|
-
node[key] = map;
|
|
191
|
-
} else if (key === "dependencies" && isRecord(child)) {
|
|
192
|
-
const map = {};
|
|
193
|
-
for (const [depKey, depValue] of Object.entries(child)) {
|
|
194
|
-
map[depKey] = isRecord(depValue) ? rebuild(depValue) : cloneJsonValue(depValue);
|
|
195
|
-
}
|
|
196
|
-
node[key] = map;
|
|
197
|
-
} else {
|
|
198
|
-
node[key] = cloneJsonValue(child);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return flattenNode(node);
|
|
166
|
+
return flattenNode(mapSubschemas(value, { schema: rebuild, literal: structuredClone }));
|
|
202
167
|
}
|
|
203
168
|
function objectVariants(node) {
|
|
204
169
|
if (!Array.isArray(node.oneOf) || node.oneOf.length < 2)
|
|
@@ -311,12 +276,12 @@ function flattenNode(node) {
|
|
|
311
276
|
merged = appendHint(merged, `Required if ${discriminator.key} = ${[...new Set(requiredLabels)].join(" | ")}`);
|
|
312
277
|
}
|
|
313
278
|
}
|
|
314
|
-
properties
|
|
279
|
+
setOwnMember(properties, key, merged);
|
|
315
280
|
}
|
|
316
281
|
const result = {};
|
|
317
282
|
for (const [key, value] of Object.entries(node)) {
|
|
318
283
|
if (key !== "oneOf" && key !== "anyOf" && key !== "properties" && key !== "required") {
|
|
319
|
-
result
|
|
284
|
+
setOwnMember(result, key, value);
|
|
320
285
|
}
|
|
321
286
|
}
|
|
322
287
|
result.type = "object";
|
|
@@ -326,8 +291,7 @@ function flattenNode(node) {
|
|
|
326
291
|
return result;
|
|
327
292
|
}
|
|
328
293
|
function flattenToolJsonSchema2(schema) {
|
|
329
|
-
|
|
330
|
-
return isRecord(result) ? result : {};
|
|
294
|
+
return rebuild(schema);
|
|
331
295
|
}
|
|
332
296
|
function freezeToolJsonSchema(schema) {
|
|
333
297
|
for (const value of Object.values(schema))
|
|
@@ -357,7 +321,7 @@ function resolvePointer(root, pointer) {
|
|
|
357
321
|
for (const segment of pointer.slice(2).split("/").map(unescapePointerSegment)) {
|
|
358
322
|
if (Array.isArray(node))
|
|
359
323
|
node = node[Number(segment)];
|
|
360
|
-
else if (isRecord(node))
|
|
324
|
+
else if (isRecord(node) && Object.hasOwn(node, segment))
|
|
361
325
|
node = node[segment];
|
|
362
326
|
else
|
|
363
327
|
return;
|
|
@@ -373,45 +337,7 @@ function localReference(node) {
|
|
|
373
337
|
}
|
|
374
338
|
return reference;
|
|
375
339
|
}
|
|
376
|
-
|
|
377
|
-
for (const [key, child] of Object.entries(node)) {
|
|
378
|
-
if (DEFINITION_KEYWORDS.has(key))
|
|
379
|
-
continue;
|
|
380
|
-
if (SCHEMA_KEYWORDS.includes(key)) {
|
|
381
|
-
if (Array.isArray(child))
|
|
382
|
-
child.forEach(visit);
|
|
383
|
-
else
|
|
384
|
-
visit(child);
|
|
385
|
-
} else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
|
|
386
|
-
child.forEach(visit);
|
|
387
|
-
} else if ((SCHEMA_MAP_KEYWORDS.includes(key) || key === "dependencies") && isRecord(child)) {
|
|
388
|
-
for (const value of Object.values(child))
|
|
389
|
-
if (isRecord(value))
|
|
390
|
-
visit(value);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
function mapSubschemas(node, rewrite) {
|
|
395
|
-
const result = {};
|
|
396
|
-
for (const [key, child] of Object.entries(node)) {
|
|
397
|
-
if (DEFINITION_KEYWORDS.has(key))
|
|
398
|
-
continue;
|
|
399
|
-
if (SCHEMA_KEYWORDS.includes(key)) {
|
|
400
|
-
result[key] = Array.isArray(child) ? child.map(rewrite) : rewrite(child);
|
|
401
|
-
} else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
|
|
402
|
-
result[key] = child.map(rewrite);
|
|
403
|
-
} else if ((SCHEMA_MAP_KEYWORDS.includes(key) || key === "dependencies") && isRecord(child)) {
|
|
404
|
-
const map = {};
|
|
405
|
-
for (const [name, value] of Object.entries(child)) {
|
|
406
|
-
map[name] = isRecord(value) ? rewrite(value) : value;
|
|
407
|
-
}
|
|
408
|
-
result[key] = map;
|
|
409
|
-
} else {
|
|
410
|
-
result[key] = child;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
return result;
|
|
414
|
-
}
|
|
340
|
+
var isDefinitionMap = (keyword) => DEFINITION_KEYWORDS.has(keyword);
|
|
415
341
|
function referenceGraph(root) {
|
|
416
342
|
const graph = new Map;
|
|
417
343
|
const pending = ["#"];
|
|
@@ -429,7 +355,7 @@ function referenceGraph(root) {
|
|
|
429
355
|
edges.add(reference);
|
|
430
356
|
pending.push(reference);
|
|
431
357
|
}
|
|
432
|
-
eachSubschema(node, collect);
|
|
358
|
+
eachSubschema(node, collect, isDefinitionMap);
|
|
433
359
|
};
|
|
434
360
|
const target = resolvePointer(root, pointer);
|
|
435
361
|
if (!isRecord(target))
|
|
@@ -567,11 +493,17 @@ function inlineSchemaReferences(schema, depth) {
|
|
|
567
493
|
return node;
|
|
568
494
|
const reference = localReference(node);
|
|
569
495
|
if (reference === undefined) {
|
|
570
|
-
const rewritten = mapSubschemas(node,
|
|
496
|
+
const rewritten = mapSubschemas(node, {
|
|
497
|
+
schema: (child) => write(child, path),
|
|
498
|
+
omit: isDefinitionMap
|
|
499
|
+
});
|
|
571
500
|
return unwrapReferenceWrapper(node, rewritten);
|
|
572
501
|
}
|
|
573
502
|
const { $ref: _reference, ...rest } = node;
|
|
574
|
-
const siblings = mapSubschemas(rest,
|
|
503
|
+
const siblings = mapSubschemas(rest, {
|
|
504
|
+
schema: (child) => write(child, path),
|
|
505
|
+
omit: isDefinitionMap
|
|
506
|
+
});
|
|
575
507
|
const occurrences = path.filter((entry) => entry === reference).length;
|
|
576
508
|
if (recursive.has(reference) && occurrences >= depth) {
|
|
577
509
|
return withSiblings(terminal(schema, reference), siblings);
|
|
@@ -638,7 +570,7 @@ function limitInputNesting(schema, limit, onOpened) {
|
|
|
638
570
|
const properties = {};
|
|
639
571
|
for (const [name, child] of Object.entries(node.properties)) {
|
|
640
572
|
const cost = KEYWORD_PROPERTY_NAMES.has(name) ? 2 : 1;
|
|
641
|
-
properties
|
|
573
|
+
setOwnMember(properties, name, isRecord(child) ? visit(child, depth + cost, path === "" ? name : `${path}.${name}`) : child);
|
|
642
574
|
}
|
|
643
575
|
rewritten.properties = properties;
|
|
644
576
|
}
|
|
@@ -699,7 +631,7 @@ function rewriteLocalReferences(value, namespace, targets) {
|
|
|
699
631
|
return value;
|
|
700
632
|
const rewritten = {};
|
|
701
633
|
for (const [key, child] of Object.entries(value)) {
|
|
702
|
-
rewritten
|
|
634
|
+
setOwnMember(rewritten, key, key === "$ref" && typeof child === "string" && child.startsWith("#") ? rewriteReference(child, namespace, targets) : rewriteLocalReferences(child, namespace, targets));
|
|
703
635
|
}
|
|
704
636
|
return rewritten;
|
|
705
637
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toJsonSchema
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-d1pdv8qc.js";
|
|
4
4
|
import {
|
|
5
5
|
toolSurfaceOutputSchema,
|
|
6
6
|
assertUniqueToolName,
|
|
7
7
|
buildToolPresentationSchema,
|
|
8
8
|
isObjectPresentationSchema
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-edpkm3k7.js";
|
|
10
10
|
import {
|
|
11
11
|
findNonPortableFormats2,
|
|
12
12
|
findUntypedProperties2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-3kb8dw48.js";
|
|
14
14
|
|
|
15
15
|
// src/tools/mcp/round-policy.ts
|
|
16
16
|
function staticInputRounds(policy) {
|
|
@@ -101,6 +101,8 @@ function resolvePathPrefix(config, args) {
|
|
|
101
101
|
const missing = keys.find((key) => typeof args[key] !== "string");
|
|
102
102
|
throw refuseLocally(String(missing), `Missing path prefix key: ${missing}`);
|
|
103
103
|
}
|
|
104
|
+
for (const key of keys)
|
|
105
|
+
refuseRawPrefixValue(key, args[key]);
|
|
104
106
|
return config.pathPrefix(args);
|
|
105
107
|
}
|
|
106
108
|
function escapeRegex(value) {
|
|
@@ -169,14 +171,31 @@ function routeParamNames(path) {
|
|
|
169
171
|
names.push(wildcard.name);
|
|
170
172
|
return names;
|
|
171
173
|
}
|
|
174
|
+
function refuseDotSegment(name, segment) {
|
|
175
|
+
if (segment !== "." && segment !== "..")
|
|
176
|
+
return;
|
|
177
|
+
throw refuseLocally(name, `Path param "${name}" has a "${segment}" segment — it would move the request to ` + "another path, so it is refused before sending.");
|
|
178
|
+
}
|
|
179
|
+
function refuseRawPrefixValue(name, value) {
|
|
180
|
+
if (/[?#]/.test(value)) {
|
|
181
|
+
throw refuseLocally(name, `Path prefix key "${name}" contains "?" or "#" — it would end the path, so it is refused before sending.`);
|
|
182
|
+
}
|
|
183
|
+
for (const segment of value.split(/[/\\]/)) {
|
|
184
|
+
refuseDotSegment(name, segment.replace(/%2e/gi, "."));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function encodePathSegment(name, segment) {
|
|
188
|
+
refuseDotSegment(name, segment);
|
|
189
|
+
return encodeURIComponent(segment);
|
|
190
|
+
}
|
|
172
191
|
function fillPathParams(path, args) {
|
|
173
192
|
const wildcard = parseTrailingWildcard(path);
|
|
174
193
|
let filled = path.replace(/:(\w+)/g, (_, key) => {
|
|
175
194
|
const value = args[key];
|
|
176
195
|
if (value === undefined || value === null) {
|
|
177
|
-
throw refuseLocally(
|
|
196
|
+
throw refuseLocally(key, `Missing path param: ${key}`);
|
|
178
197
|
}
|
|
179
|
-
return
|
|
198
|
+
return encodePathSegment(key, String(value));
|
|
180
199
|
});
|
|
181
200
|
if (!wildcard)
|
|
182
201
|
return filled;
|
|
@@ -184,7 +203,7 @@ function fillPathParams(path, args) {
|
|
|
184
203
|
if (wildcardValue === undefined || wildcardValue === null) {
|
|
185
204
|
throw refuseLocally(wildcard.name, `Missing path param: ${wildcard.name}`);
|
|
186
205
|
}
|
|
187
|
-
const remainder = String(wildcardValue).split("/").map((segment) =>
|
|
206
|
+
const remainder = String(wildcardValue).split("/").map((segment) => encodePathSegment(wildcard.name, segment)).join("/");
|
|
188
207
|
filled = `${filled.slice(0, -(wildcard.name.length + 1))}${remainder}`;
|
|
189
208
|
return filled;
|
|
190
209
|
}
|
|
@@ -345,6 +364,9 @@ function isAbortSignal(value) {
|
|
|
345
364
|
return typeof value === "object" && value !== null && "aborted" in value && typeof value.aborted === "boolean" && "addEventListener" in value && typeof value.addEventListener === "function" && "removeEventListener" in value && typeof value.removeEventListener === "function";
|
|
346
365
|
}
|
|
347
366
|
|
|
367
|
+
// src/browser/client-executors.ts
|
|
368
|
+
import { z } from "zod";
|
|
369
|
+
|
|
348
370
|
// src/browser/client-multipart.ts
|
|
349
371
|
function isFileDescriptor(value) {
|
|
350
372
|
return typeof value === "object" && value !== null && !(value instanceof Blob) && "uri" in value && typeof value.uri === "string" && "name" in value && typeof value.name === "string" && "type" in value && typeof value.type === "string";
|
|
@@ -657,6 +679,7 @@ async function deliverWithReplay(deliver, url, init, replay, limit) {
|
|
|
657
679
|
}
|
|
658
680
|
}
|
|
659
681
|
}
|
|
682
|
+
var AdapterMethodSchema = z.enum(["get", "head", "post", "put", "patch", "delete"]);
|
|
660
683
|
function withOutput(endpoint, result, abortStream) {
|
|
661
684
|
if (endpoint.rawResponse)
|
|
662
685
|
return result;
|
|
@@ -682,7 +705,7 @@ function withOutput(endpoint, result, abortStream) {
|
|
|
682
705
|
});
|
|
683
706
|
}
|
|
684
707
|
function createHttpExecutor(endpoint, prefix, client, config) {
|
|
685
|
-
const httpMethod = endpoint.method.toLowerCase();
|
|
708
|
+
const httpMethod = AdapterMethodSchema.parse(endpoint.method.toLowerCase());
|
|
686
709
|
return (requestArgs, options) => {
|
|
687
710
|
const plan = planClientRequest(endpoint, prefix, requestArgs, config);
|
|
688
711
|
const streamAbort = "stream" in endpoint ? new AbortController : undefined;
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./index-yt1gg11x.js";
|
|
4
4
|
import {
|
|
5
5
|
projectToolSurface
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-edpkm3k7.js";
|
|
7
7
|
import {
|
|
8
8
|
contractOnlyService
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-gq35s3bm.js";
|
|
10
10
|
|
|
11
11
|
// src/tools/list-names.ts
|
|
12
12
|
function listToolNames2(surface) {
|