stitchkit 0.135.1 → 0.136.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 +122 -0
- package/README.md +37 -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/executor-contract.d.ts.map +1 -1
- 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-executor/vocabulary.d.ts +80 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -1
- package/dist/agent-parts/model.d.ts +94 -0
- package/dist/agent-parts/model.d.ts.map +1 -1
- package/dist/agent-parts/parts.d.ts +176 -0
- package/dist/agent-parts/parts.d.ts.map +1 -1
- package/dist/agent-runtime/browser/browser-control-contract.d.ts +444 -0
- package/dist/agent-runtime/browser/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-schema.d.ts +532 -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 +720 -3
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/history/run-history-parts.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 -3
- 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 +38 -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-loop-events.d.ts +6 -1
- package/dist/agent-runtime/loop/run-loop-events.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-recorded.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 +13 -34
- 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 +15 -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 +123 -81
- package/dist/agent-runtime/providers/openrouter-audio.d.ts.map +1 -1
- 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 +2 -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 +26 -6
- package/dist/agent-runtime/providers/openrouter-http.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-media.d.ts +91 -77
- package/dist/agent-runtime/providers/openrouter-media.d.ts.map +1 -1
- 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 +2 -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-retrieval.d.ts +86 -55
- package/dist/agent-runtime/providers/openrouter-retrieval.d.ts.map +1 -1
- 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 +2 -2
- package/dist/agent-runtime/providers/openrouter-spend.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-stream.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-systemone.d.ts +87 -32
- package/dist/agent-runtime/providers/openrouter-systemone.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-url.d.ts +7 -1
- package/dist/agent-runtime/providers/openrouter-url.d.ts.map +1 -1
- 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 +1 -3
- package/dist/agent-runtime/providers/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-http.d.ts +14 -2
- 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/runtime-internals.d.ts +1 -3
- package/dist/agent-runtime/runtime-internals.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/schemas-json-projection.d.ts +29 -0
- package/dist/agent-runtime/schemas-json-projection.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-message.d.ts +88 -0
- package/dist/agent-runtime/schemas-message.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-run.d.ts +88 -0
- package/dist/agent-runtime/schemas-run.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-observations.d.ts +42 -42
- package/dist/agent-runtime/stores/branch-replay.d.ts +264 -0
- package/dist/agent-runtime/stores/branch-replay.d.ts.map +1 -1
- package/dist/agent-runtime/stores/conversations.d.ts +88 -0
- package/dist/agent-runtime/stores/conversations.d.ts.map +1 -1
- package/dist/agent-runtime/stores/sql-rows.d.ts +74 -10
- package/dist/agent-runtime/stores/sql-rows.d.ts.map +1 -1
- package/dist/agent-runtime/stores/store-driver-contract.d.ts +616 -0
- package/dist/agent-runtime/stores/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/stores/store-events.d.ts +1056 -0
- package/dist/agent-runtime/stores/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/stores/store.d.ts +1232 -0
- package/dist/agent-runtime/stores/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +74 -10
- package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
- 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/agent-runtime/testing/store-conformance-lifecycle.d.ts +158 -30
- package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/testing/store-conformance-support.d.ts +79 -15
- package/dist/agent-runtime/testing/store-conformance-support.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-manager.d.ts +1 -1
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/notification-delivery.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 +9 -6
- package/dist/entrypoints/agent-executor/claude-sdk.js +26 -25
- package/dist/entrypoints/agent-executor/claude.js +13 -12
- 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 +135 -40
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +5 -4
- package/dist/entrypoints/agent-executor/testing.js +23 -18
- package/dist/entrypoints/agent-executor.js +8 -8
- 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 +34 -30
- package/dist/entrypoints/agent-runtime/anthropic.js +15 -12
- package/dist/entrypoints/agent-runtime/browser.js +13 -8
- package/dist/entrypoints/agent-runtime/harness.js +26 -27
- package/dist/entrypoints/agent-runtime/openai.js +7 -7
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +7 -5
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +1097 -856
- package/dist/entrypoints/agent-runtime/postgres.js +9 -9
- package/dist/entrypoints/agent-runtime/realtime.js +9 -8
- package/dist/entrypoints/agent-runtime/sandbox.js +167 -139
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +10 -10
- package/dist/entrypoints/agent-runtime/sqlite/node.js +10 -10
- package/dist/entrypoints/agent-runtime/testing.js +9 -9
- package/dist/entrypoints/agent-runtime.js +261 -375
- package/dist/entrypoints/application/diagnostic-journal.js +14 -10
- package/dist/entrypoints/application.js +18 -6
- 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 +9 -10
- 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 +24 -22
- 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-1psbyyhj.js +21 -0
- package/dist/{index-pdcbjd6a.js → index-1yky29qg.js} +6 -3
- package/dist/{index-b4c9dpzm.js → index-252den5a.js} +10 -11
- package/dist/{index-yhwx4fwk.js → index-26v8hjqm.js} +4 -4
- package/dist/{index-xtby8rj3.js → index-28kbdn63.js} +5 -47
- package/dist/{index-c24bj2r1.js → index-2wm9b9vs.js} +5 -5
- package/dist/{index-ht71v1ag.js → index-32ew02z1.js} +60 -45
- package/dist/{index-dm84tsd5.js → index-3kb8dw48.js} +1 -1
- package/dist/index-3tb82xr7.js +11 -0
- package/dist/{index-nr4fhfn4.js → index-4p2zx593.js} +2 -0
- package/dist/{index-grhhsrd5.js → index-4q9tmzea.js} +5 -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-y0mwkgkf.js → index-8cnfgwg8.js} +1212 -1139
- package/dist/{index-mkmep637.js → index-9m1m92rg.js} +1 -1
- package/dist/{index-5awtbyns.js → index-9vj869rx.js} +1 -1
- package/dist/index-a1rjr381.js +114 -0
- package/dist/{index-6kwdfb9m.js → index-akesakvj.js} +23 -4
- 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-v0j22shs.js → index-d5mhgx72.js} +16 -11
- 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-57sbckhv.js → index-e4w0sfm1.js} +2 -2
- 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-asnd4h2k.js → index-f0dzyskg.js} +27 -4
- package/dist/{index-xbb8ysmq.js → index-fatke81t.js} +2 -2
- package/dist/{index-d3s070eh.js → index-gj4wdts6.js} +1 -1
- package/dist/{index-6nzzj7qr.js → index-gq35s3bm.js} +1 -1
- package/dist/index-gvgtmt7a.js +102 -0
- package/dist/{index-pd9e8rz4.js → index-gvv7y0s4.js} +1 -1
- package/dist/{index-m2b49tvc.js → index-h08xqfw9.js} +20 -21
- package/dist/{index-gk6dq9ay.js → index-ha1tv70k.js} +3 -26
- package/dist/{index-vebzvse6.js → index-jy907kcs.js} +24 -1
- package/dist/{index-q86qnzzf.js → index-k5azb3v3.js} +8 -25
- package/dist/{index-qcy8et93.js → index-kaq9nb7h.js} +6 -6
- package/dist/{index-vse7x1qt.js → index-knqye3gv.js} +1 -1
- package/dist/{index-tav72wz5.js → index-ks4rhtcc.js} +5 -0
- package/dist/{index-bvpevwt6.js → index-mtpcax6d.js} +210 -205
- package/dist/{index-7qza24g1.js → index-px9r6wv1.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-de7b0kvz.js → index-r9w7wfgn.js} +2 -2
- 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-aacwkve4.js → index-sjq4akrx.js} +3 -5
- package/dist/{index-fec05c9k.js → index-ta0e2daw.js} +9 -7
- package/dist/{index-5dxgx3yj.js → index-tcv71frn.js} +1 -1
- package/dist/{index-1zy31r3b.js → index-v92djygb.js} +1 -1
- package/dist/{index-c0yym4a0.js → index-w7e402wx.js} +11 -105
- package/dist/{index-9f60gnfn.js → index-xaa3603f.js} +4 -11
- 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/{index-j3r7r1mh.js → index-yv7d6tav.js} +1 -1
- package/dist/{index-wsv11dhg.js → index-zagc12j1.js} +5 -5
- package/dist/{index-npfdymav.js → index-zqc64g69.js} +3 -3
- package/dist/{index-rkphknhx.js → index-zthekmrt.js} +2 -2
- package/dist/internal/json-stringify.d.ts +37 -0
- package/dist/internal/json-stringify.d.ts.map +1 -0
- 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 +10 -9
- package/llms/agent-runtime-sandbox.txt +50 -11
- package/llms/agent-runtime-testing.txt +1 -1
- package/llms/agent-runtime.2.txt +9 -6
- package/llms/agent-runtime.3.txt +2 -2
- package/llms/agent-runtime.4.txt +11 -5
- package/llms/agent-runtime.5.txt +2 -2
- package/llms/agent-runtime.txt +297 -36
- package/llms/application.2.txt +6 -3
- package/llms/application.3.txt +2 -1
- package/llms/application.txt +7 -2
- 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 +1 -0
- 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 +1021 -223
- 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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveRouteParamsSchema
|
|
3
|
+
} from "./index-m38ej7e5.js";
|
|
4
|
+
import {
|
|
5
|
+
defineContract2
|
|
6
|
+
} from "./index-dmrx8xma.js";
|
|
7
|
+
import {
|
|
8
|
+
describeRefusals
|
|
9
|
+
} from "./index-dxft2mnm.js";
|
|
10
|
+
import {
|
|
11
|
+
canonicalDigest
|
|
12
|
+
} from "./index-3dq8466w.js";
|
|
13
|
+
import {
|
|
14
|
+
typedEntries,
|
|
15
|
+
isRecord
|
|
16
|
+
} from "./index-ps3djm8d.js";
|
|
17
|
+
|
|
18
|
+
// src/contract/fingerprint.ts
|
|
19
|
+
import { z } from "zod";
|
|
20
|
+
var ContractFingerprintSchema2 = z.strictObject({
|
|
21
|
+
fingerprint: z.string(),
|
|
22
|
+
operations: z.record(z.string(), z.string())
|
|
23
|
+
});
|
|
24
|
+
var ANNOTATIONS = new Set(["description", "title", "examples", "deprecated", "$comment"]);
|
|
25
|
+
function constraintsOf(schema) {
|
|
26
|
+
if (Array.isArray(schema))
|
|
27
|
+
return schema.map(constraintsOf);
|
|
28
|
+
if (!isRecord(schema))
|
|
29
|
+
return schema;
|
|
30
|
+
const constraints = {};
|
|
31
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
32
|
+
if (ANNOTATIONS.has(key))
|
|
33
|
+
continue;
|
|
34
|
+
constraints[key] = key === "required" && Array.isArray(value) ? [...value].sort() : key === "properties" && isRecord(value) ? Object.fromEntries(Object.entries(value).map(([name, property]) => [name, constraintsOf(property)])) : constraintsOf(value);
|
|
35
|
+
}
|
|
36
|
+
return constraints;
|
|
37
|
+
}
|
|
38
|
+
function schemaIdentity(schema, io) {
|
|
39
|
+
if (schema === undefined)
|
|
40
|
+
return null;
|
|
41
|
+
return constraintsOf(z.toJSONSchema(schema, { io, unrepresentable: "any", cycles: "ref" }));
|
|
42
|
+
}
|
|
43
|
+
function refusalIdentity(refuses) {
|
|
44
|
+
return [...refuses].sort((left, right) => left.code < right.code ? -1 : left.code > right.code ? 1 : 0).map((refusal) => ({
|
|
45
|
+
code: refusal.code,
|
|
46
|
+
status: refusal.status,
|
|
47
|
+
details: schemaIdentity(refusal.details, "output")
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
function fingerprintOperations(operations) {
|
|
51
|
+
const digests = {};
|
|
52
|
+
for (const operation of operations) {
|
|
53
|
+
if (Object.hasOwn(digests, operation.name)) {
|
|
54
|
+
throw new Error(`[stitchkit] contract fingerprint: duplicate operation "${operation.name}"`);
|
|
55
|
+
}
|
|
56
|
+
digests[operation.name] = canonicalDigest({
|
|
57
|
+
method: operation.method,
|
|
58
|
+
path: operation.path,
|
|
59
|
+
params: schemaIdentity(operation.params, "input"),
|
|
60
|
+
input: schemaIdentity(operation.input, "input"),
|
|
61
|
+
output: schemaIdentity(operation.output, "output"),
|
|
62
|
+
item: schemaIdentity(operation.item, "output"),
|
|
63
|
+
...operation.refuses && { refuses: refusalIdentity(operation.refuses) }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return { fingerprint: canonicalDigest(digests), operations: digests };
|
|
67
|
+
}
|
|
68
|
+
function contractFingerprint2(contracts) {
|
|
69
|
+
const list = Array.isArray(contracts) ? contracts : [contracts];
|
|
70
|
+
return fingerprintOperations(list.flatMap(contractOperations));
|
|
71
|
+
}
|
|
72
|
+
function contractOperations(contract) {
|
|
73
|
+
const operations = [];
|
|
74
|
+
for (const [key, endpoint] of typedEntries(contract.endpoints)) {
|
|
75
|
+
if (endpoint.expose && !endpoint.expose.includes("HTTP"))
|
|
76
|
+
continue;
|
|
77
|
+
operations.push({
|
|
78
|
+
name: `${contract.meta.prefix}.${key}`,
|
|
79
|
+
method: endpoint.method,
|
|
80
|
+
path: endpoint.path,
|
|
81
|
+
params: resolveRouteParamsSchema(endpoint.path, endpoint.params),
|
|
82
|
+
input: endpoint.input,
|
|
83
|
+
output: endpoint.output,
|
|
84
|
+
item: "stream" in endpoint ? endpoint.stream?.item : undefined,
|
|
85
|
+
refuses: describeRefusals(endpoint.refuses)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return operations;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/contract/identity.ts
|
|
92
|
+
var contractIdentityContract2 = defineContract2({ prefix: "contract-identity", scope: "public" }, {
|
|
93
|
+
read: {
|
|
94
|
+
method: "GET",
|
|
95
|
+
path: "/",
|
|
96
|
+
desc: "The fingerprint of the contract operations this server answers",
|
|
97
|
+
expose: ["HTTP"],
|
|
98
|
+
output: ContractFingerprintSchema2
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export { ContractFingerprintSchema2, fingerprintOperations, contractFingerprint2, contractIdentityContract2 };
|
|
@@ -9,12 +9,6 @@ import {
|
|
|
9
9
|
joinRoutePath,
|
|
10
10
|
parseTrailingWildcard
|
|
11
11
|
} from "./index-m38ej7e5.js";
|
|
12
|
-
import {
|
|
13
|
-
errorCode2,
|
|
14
|
-
recordedErrorMessage,
|
|
15
|
-
normalizeError2,
|
|
16
|
-
validateDeclaredOutput
|
|
17
|
-
} from "./index-78da4g74.js";
|
|
18
12
|
import {
|
|
19
13
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
|
|
20
14
|
readContractStreamItems,
|
|
@@ -38,7 +32,7 @@ import {
|
|
|
38
32
|
runWithRequestContext2,
|
|
39
33
|
getRequestContext2,
|
|
40
34
|
setRequestEndpoint2
|
|
41
|
-
} from "./index-
|
|
35
|
+
} from "./index-q4tr9vnf.js";
|
|
42
36
|
import {
|
|
43
37
|
resolveTraceId2,
|
|
44
38
|
resolveSocketIp2,
|
|
@@ -46,7 +40,14 @@ import {
|
|
|
46
40
|
getClientInfo2,
|
|
47
41
|
MalformedQueryError,
|
|
48
42
|
parseQueryParams
|
|
49
|
-
} from "./index-
|
|
43
|
+
} from "./index-aqm7e864.js";
|
|
44
|
+
import {
|
|
45
|
+
errorCode2,
|
|
46
|
+
parseContractInput,
|
|
47
|
+
recordedErrorMessage,
|
|
48
|
+
normalizeError2,
|
|
49
|
+
validateDeclaredOutput
|
|
50
|
+
} from "./index-dwq6a6sq.js";
|
|
50
51
|
import {
|
|
51
52
|
mediaTypeEssence
|
|
52
53
|
} from "./index-zs8cze4j.js";
|
|
@@ -1091,7 +1092,7 @@ async function parseMultipart2(req, descriptor, fieldsSchema, receivers) {
|
|
|
1091
1092
|
}
|
|
1092
1093
|
return {
|
|
1093
1094
|
files,
|
|
1094
|
-
fields: fieldsSchema ? fieldsSchema
|
|
1095
|
+
fields: fieldsSchema ? parseContractInput(fieldsSchema, fields) : fields,
|
|
1095
1096
|
rollback
|
|
1096
1097
|
};
|
|
1097
1098
|
} catch (error) {
|
|
@@ -1104,11 +1105,10 @@ async function parseMultipart2(req, descriptor, fieldsSchema, receivers) {
|
|
|
1104
1105
|
}
|
|
1105
1106
|
|
|
1106
1107
|
// src/server/request-body.ts
|
|
1107
|
-
|
|
1108
|
+
var DEFAULT_REQUEST_BODY_BYTES = 1024 * 1024;
|
|
1109
|
+
async function readRequestText(req, maxBytes = DEFAULT_REQUEST_BODY_BYTES) {
|
|
1108
1110
|
if (req.signal.aborted)
|
|
1109
1111
|
throw abortReason(req.signal);
|
|
1110
|
-
if (maxBytes === undefined)
|
|
1111
|
-
return req.text();
|
|
1112
1112
|
assertPositiveSafeInteger("maxJsonBodyBytes", maxBytes, Error);
|
|
1113
1113
|
const result = await readBoundedText(req, { maxBytes, signal: req.signal });
|
|
1114
1114
|
if (result.kind === "over-limit")
|
|
@@ -1162,7 +1162,7 @@ function buildBaseContext(req, url, pathParams, traceId, clientIp) {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
function parsePathParamsInto(ctx, method) {
|
|
1164
1164
|
if (method.paramsSchema) {
|
|
1165
|
-
ctx.params = method.paramsSchema
|
|
1165
|
+
ctx.params = parseContractInput(method.paramsSchema, ctx.params);
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
async function parseRequestPayloadInto(ctx, req, url, method, maxJsonBodyBytes, cors) {
|
|
@@ -1174,21 +1174,21 @@ async function parseRequestPayloadInto(ctx, req, url, method, maxJsonBodyBytes,
|
|
|
1174
1174
|
}
|
|
1175
1175
|
if (method.inputSchema) {
|
|
1176
1176
|
if (req.method === "GET") {
|
|
1177
|
-
ctx.input = method.inputSchema
|
|
1177
|
+
ctx.input = parseContractInput(method.inputSchema, parseQueryParams(url));
|
|
1178
1178
|
} else if (req.method === "DELETE") {
|
|
1179
1179
|
if (mediaTypeEssence(req.headers.get("content-type")) === "application/json") {
|
|
1180
1180
|
const text = await readRequestText(req, method.maxJsonBodyBytes ?? maxJsonBodyBytes);
|
|
1181
1181
|
if (method.rawBody)
|
|
1182
1182
|
ctx.rawBody = text;
|
|
1183
|
-
ctx.input = method.inputSchema
|
|
1183
|
+
ctx.input = parseContractInput(method.inputSchema, parseJsonBody(req, text, method, cors));
|
|
1184
1184
|
} else {
|
|
1185
|
-
ctx.input = method.inputSchema
|
|
1185
|
+
ctx.input = parseContractInput(method.inputSchema, parseQueryParams(url));
|
|
1186
1186
|
}
|
|
1187
1187
|
} else {
|
|
1188
1188
|
const text = await readRequestText(req, method.maxJsonBodyBytes ?? maxJsonBodyBytes);
|
|
1189
1189
|
if (method.rawBody)
|
|
1190
1190
|
ctx.rawBody = text;
|
|
1191
|
-
ctx.input = method.inputSchema
|
|
1191
|
+
ctx.input = parseContractInput(method.inputSchema, parseJsonBody(req, text, method, cors));
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
1194
|
return;
|
|
@@ -2067,7 +2067,6 @@ function logOutgoing(entry) {
|
|
|
2067
2067
|
|
|
2068
2068
|
// src/server/request-completion.ts
|
|
2069
2069
|
var BODY_METHODS = new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
2070
|
-
var DEFAULT_PAYLOAD_LOG_BYTES = 1024 * 1024;
|
|
2071
2070
|
async function readPayload(clone, maxBytes) {
|
|
2072
2071
|
try {
|
|
2073
2072
|
const result = await readBoundedText(clone, { maxBytes, signal: clone.signal });
|
|
@@ -2082,7 +2081,7 @@ function openRequestCompletion(state, window) {
|
|
|
2082
2081
|
const { logConfig, customLogger, useDefaultLog, observability } = state;
|
|
2083
2082
|
const { req, url, traceId, startedAt, ipAddress } = window;
|
|
2084
2083
|
const shouldLogRequest = logConfig !== null && shouldLog(url.pathname, req.method) && !shouldSkipLog(logConfig, req, url);
|
|
2085
|
-
const payloadRead = observability?.includePayload && BODY_METHODS.has(req.method) ? readPayload(req.clone(), observability.payloadMaxBytes ?? state.config.maxJsonBodyBytes ??
|
|
2084
|
+
const payloadRead = observability?.includePayload && BODY_METHODS.has(req.method) ? readPayload(req.clone(), observability.payloadMaxBytes ?? state.config.maxJsonBodyBytes ?? DEFAULT_REQUEST_BODY_BYTES) : undefined;
|
|
2086
2085
|
const logFormat = resolveLogFormat(logConfig?.format);
|
|
2087
2086
|
let reqLog;
|
|
2088
2087
|
if (shouldLogRequest && useDefaultLog) {
|
|
@@ -2183,7 +2182,7 @@ function writeCompletionLine(state, logConfig, window, line) {
|
|
|
2183
2182
|
|
|
2184
2183
|
// src/server/create.ts
|
|
2185
2184
|
function createHandler2(config) {
|
|
2186
|
-
const { trustProxy
|
|
2185
|
+
const { trustProxy, observability } = config;
|
|
2187
2186
|
const state = createHandlerState(config);
|
|
2188
2187
|
const handler = async (req, server) => {
|
|
2189
2188
|
const url = new URL(req.url, "http://localhost");
|
|
@@ -2340,4 +2339,4 @@ async function dispatch(state, req, url, traceId, server, clientIp, startedAt, c
|
|
|
2340
2339
|
return dispatchEndpoint(state, request, match);
|
|
2341
2340
|
}
|
|
2342
2341
|
|
|
2343
|
-
export { isTrustProxyHandler, contextContributionDelta, prepareContextContribution, mergeContextContribution, parseMultipart2, DEFAULT_STREAM_HEARTBEAT_MS2, streamingRoute2, ndjsonRoute2, sseRoute2, createHandler2 };
|
|
2342
|
+
export { isTrustProxyHandler, contextContributionDelta, prepareContextContribution, mergeContextContribution, parseMultipart2, DEFAULT_REQUEST_BODY_BYTES, DEFAULT_STREAM_HEARTBEAT_MS2, streamingRoute2, ndjsonRoute2, sseRoute2, createHandler2 };
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
SCHEMA_MAP_KEYWORDS
|
|
5
|
-
} from "./index-9be3tf6r.js";
|
|
6
|
-
import {
|
|
7
|
-
isRecord
|
|
8
|
-
} from "./index-ps3djm8d.js";
|
|
2
|
+
mapSubschemas
|
|
3
|
+
} from "./index-e413q2cj.js";
|
|
9
4
|
|
|
10
5
|
// src/json-schema/string-format.ts
|
|
11
6
|
import { z } from "zod";
|
|
@@ -32,29 +27,11 @@ var STANDARD_STRING_FORMATS = new Set([
|
|
|
32
27
|
]);
|
|
33
28
|
var SERVED_FORMAT = "x-stitchkit-served-format";
|
|
34
29
|
function withServedFormats(schema) {
|
|
35
|
-
const carried = {};
|
|
36
|
-
for (const [key, child] of Object.entries(schema)) {
|
|
37
|
-
if (SCHEMA_KEYWORDS.includes(key)) {
|
|
38
|
-
carried[key] = Array.isArray(child) ? child.map(carriedSchema) : carriedSchema(child);
|
|
39
|
-
} else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
|
|
40
|
-
carried[key] = child.map(carriedSchema);
|
|
41
|
-
} else if (SCHEMA_MAP_KEYWORDS.includes(key) && isRecord(child)) {
|
|
42
|
-
carried[key] = Object.fromEntries(Object.entries(child).map(([name, member]) => [name, carriedSchema(member)]));
|
|
43
|
-
} else if (key === "dependencies" && isRecord(child)) {
|
|
44
|
-
carried[key] = Object.fromEntries(Object.entries(child).map(([name, member]) => [
|
|
45
|
-
name,
|
|
46
|
-
isRecord(member) ? carriedSchema(member) : member
|
|
47
|
-
]));
|
|
48
|
-
} else
|
|
49
|
-
carried[key] = child;
|
|
50
|
-
}
|
|
30
|
+
const carried = mapSubschemas(schema, { schema: withServedFormats });
|
|
51
31
|
if (typeof schema.format === "string")
|
|
52
32
|
carried[SERVED_FORMAT] = schema.format;
|
|
53
33
|
return carried;
|
|
54
34
|
}
|
|
55
|
-
function carriedSchema(schema) {
|
|
56
|
-
return isRecord(schema) ? withServedFormats(schema) : schema;
|
|
57
|
-
}
|
|
58
35
|
var readerExpressions = new Map;
|
|
59
36
|
function readerExpression(format) {
|
|
60
37
|
if (!readerExpressions.has(format)) {
|
|
@@ -76,6 +76,29 @@ var AgentToolModelOutputSchema2 = z.discriminatedUnion("type", [
|
|
|
76
76
|
...ProviderOptionsField
|
|
77
77
|
})
|
|
78
78
|
]);
|
|
79
|
+
var RecordedOptionsField = {
|
|
80
|
+
providerOptions: z.record(z.string(), z.record(z.string(), z.json())).optional(),
|
|
81
|
+
cacheControl: AgentCacheControlSchema2.optional()
|
|
82
|
+
};
|
|
83
|
+
var AgentRecordedToolModelOutputSchema = z.discriminatedUnion("type", [
|
|
84
|
+
z.object({ type: z.literal("text"), value: z.string(), ...RecordedOptionsField }),
|
|
85
|
+
z.object({ type: z.literal("error-text"), value: z.string(), ...RecordedOptionsField }),
|
|
86
|
+
z.object({ type: z.literal("json"), value: z.json(), ...RecordedOptionsField }),
|
|
87
|
+
z.object({ type: z.literal("error-json"), value: z.json(), ...RecordedOptionsField }),
|
|
88
|
+
z.object({
|
|
89
|
+
type: z.literal("execution-denied"),
|
|
90
|
+
reason: z.string().optional(),
|
|
91
|
+
...RecordedOptionsField
|
|
92
|
+
}),
|
|
93
|
+
z.object({
|
|
94
|
+
type: z.literal("content"),
|
|
95
|
+
value: z.array(z.discriminatedUnion("type", [
|
|
96
|
+
z.object({ type: z.literal("text"), text: z.string(), ...RecordedOptionsField }),
|
|
97
|
+
z.object({ type: z.literal("custom"), ...RecordedOptionsField })
|
|
98
|
+
])),
|
|
99
|
+
...RecordedOptionsField
|
|
100
|
+
})
|
|
101
|
+
]);
|
|
79
102
|
var AgentModelSystemMessageSchema2 = z.object({
|
|
80
103
|
role: z.literal("system"),
|
|
81
104
|
content: z.string(),
|
|
@@ -227,4 +250,4 @@ function createAgentGeneratedFile(mediaType, payload, providerMetadata, filename
|
|
|
227
250
|
};
|
|
228
251
|
}
|
|
229
252
|
|
|
230
|
-
export { AgentModelProviderOptionsSchema2, AgentCacheControlSchema2, AgentModelResponseFormatSchema2, AgentModelFileDataSchema2, AgentToolModelOutputSchema2, AgentModelSystemMessageSchema2, normalizeAgentInstructions, AgentModelUserContentPartSchema2, AgentModelAssistantContentPartSchema2, AgentModelToolContentPartSchema2, AgentModelUserMessageSchema2, AgentModelAssistantMessageSchema2, AgentModelToolMessageSchema2, AgentModelMessageSchema2, createAgentGeneratedFile };
|
|
253
|
+
export { AgentModelProviderOptionsSchema2, AgentCacheControlSchema2, AgentModelResponseFormatSchema2, AgentModelFileDataSchema2, AgentToolModelOutputSchema2, AgentRecordedToolModelOutputSchema, AgentModelSystemMessageSchema2, normalizeAgentInstructions, AgentModelUserContentPartSchema2, AgentModelAssistantContentPartSchema2, AgentModelToolContentPartSchema2, AgentModelUserMessageSchema2, AgentModelAssistantMessageSchema2, AgentModelToolMessageSchema2, AgentModelMessageSchema2, createAgentGeneratedFile };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toJsonSchema
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-d1pdv8qc.js";
|
|
4
4
|
import {
|
|
5
5
|
localVerdict
|
|
6
6
|
} from "./index-dsa676h8.js";
|
|
@@ -12,13 +12,16 @@ import {
|
|
|
12
12
|
isToolExecutionControlError2,
|
|
13
13
|
createToolRunner,
|
|
14
14
|
formatToolError
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-b9mj31q7.js";
|
|
16
16
|
import {
|
|
17
17
|
flattenToolJsonSchema2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-edpkm3k7.js";
|
|
19
|
+
import {
|
|
20
|
+
AgentToolError2
|
|
21
|
+
} from "./index-1psbyyhj.js";
|
|
19
22
|
import {
|
|
20
23
|
collectToolSurface
|
|
21
|
-
} from "./index-
|
|
24
|
+
} from "./index-bjrcbcn2.js";
|
|
22
25
|
import {
|
|
23
26
|
agentPresenterOf
|
|
24
27
|
} from "./index-7csn6pva.js";
|
|
@@ -27,26 +30,6 @@ import {
|
|
|
27
30
|
isAsyncIterable
|
|
28
31
|
} from "./index-ps3djm8d.js";
|
|
29
32
|
|
|
30
|
-
// src/tools/agent-tool-error.ts
|
|
31
|
-
var AGENT_TOOL_ERROR_BRAND = Symbol.for("stitchkit.AgentToolError");
|
|
32
|
-
|
|
33
|
-
class AgentToolError2 extends Error {
|
|
34
|
-
output;
|
|
35
|
-
constructor(output, cause) {
|
|
36
|
-
let message = "Tool execution failed";
|
|
37
|
-
try {
|
|
38
|
-
message = JSON.stringify(output);
|
|
39
|
-
} catch {}
|
|
40
|
-
super(message, cause === undefined ? undefined : { cause });
|
|
41
|
-
this.name = "AgentToolError";
|
|
42
|
-
this.output = output;
|
|
43
|
-
Object.defineProperty(this, AGENT_TOOL_ERROR_BRAND, { value: true });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function isAgentToolError2(value) {
|
|
47
|
-
return typeof value === "object" && value !== null && AGENT_TOOL_ERROR_BRAND in value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
33
|
// src/tools/agent-tools.ts
|
|
51
34
|
var SELF_VALIDATED_NON_ITERABLE_EXECUTORS = new WeakSet;
|
|
52
35
|
function validateToolOutput(schema, value) {
|
|
@@ -228,4 +211,4 @@ function mountAgentTools2(servicesOrConfig, maybeConfig) {
|
|
|
228
211
|
return buildAgentTools(servicesOrConfig, maybeConfig, "mountAgentTools");
|
|
229
212
|
}
|
|
230
213
|
|
|
231
|
-
export {
|
|
214
|
+
export { finalizeAgentToolOutput, zodToAgentInputJsonSchema, defineAgentTool2, buildAgentTools, mountAgentTools2 };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentCacheControlSchema2
|
|
3
|
+
} from "./index-jy907kcs.js";
|
|
1
4
|
import {
|
|
2
5
|
AgentRecordIdSchema2,
|
|
3
6
|
AgentStoreEventKindSchema2,
|
|
@@ -7,19 +10,16 @@ import {
|
|
|
7
10
|
AgentTimestampSchema2,
|
|
8
11
|
AgentMessageSchema2,
|
|
9
12
|
AgentUsageSchema2
|
|
10
|
-
} from "./index-
|
|
13
|
+
} from "./index-yv7d6tav.js";
|
|
11
14
|
import {
|
|
12
15
|
AgentProviderResponseSchema2
|
|
13
|
-
} from "./index-
|
|
16
|
+
} from "./index-px9r6wv1.js";
|
|
14
17
|
import {
|
|
15
18
|
AgentRunOperationSchema2,
|
|
16
19
|
AgentTerminalReasonSchema2,
|
|
17
20
|
AgentRunSchema2,
|
|
18
21
|
AgentSnapshotSchema2
|
|
19
|
-
} from "./index-
|
|
20
|
-
import {
|
|
21
|
-
AgentCacheControlSchema2
|
|
22
|
-
} from "./index-vebzvse6.js";
|
|
22
|
+
} from "./index-gvv7y0s4.js";
|
|
23
23
|
import {
|
|
24
24
|
canonicalZodJson
|
|
25
25
|
} from "./index-brhhaygm.js";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentRecordedToolModelOutputSchema
|
|
3
|
+
} from "./index-jy907kcs.js";
|
|
4
|
+
|
|
1
5
|
// src/agent-parts/parts.ts
|
|
2
6
|
import { z } from "zod";
|
|
3
7
|
var AgentProviderEnvelopeSchema2 = z.object({
|
|
@@ -40,6 +44,7 @@ var AgentToolResultPartSchema2 = z.object({
|
|
|
40
44
|
toolName: z.string().min(1),
|
|
41
45
|
outcome: z.enum(["success", "error", "interrupted"]),
|
|
42
46
|
output: z.json().optional(),
|
|
47
|
+
modelOutput: AgentRecordedToolModelOutputSchema.optional(),
|
|
43
48
|
provider: AgentProviderEnvelopeSchema2.optional()
|
|
44
49
|
});
|
|
45
50
|
var AgentToolApprovalRequestPartSchema2 = z.object({
|