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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args-tokens.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/args-tokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"args-tokens.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/args-tokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAO5C,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAGf,MAAM,eAAe,CAAC;AAKvB,KAAK,iBAAiB,GAAG;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACvC,CAAC;AACF,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC;AAE7D,iEAAiE;AACjE,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,2EAA2E;IAC3E,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7B,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,oFAAoF;IACpF,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAC/C,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,iBAAiB,GACxB,SAAS,CAqJX"}
|
|
@@ -4,6 +4,11 @@ export interface CliCheckpointEntry {
|
|
|
4
4
|
answer: unknown;
|
|
5
5
|
}
|
|
6
6
|
export interface CliCheckpoint {
|
|
7
|
+
/**
|
|
8
|
+
* Keyed by the producer's free-form line id, which may name an
|
|
9
|
+
* `Object.prototype` member (`toString`, `__proto__`): read an entry only
|
|
10
|
+
* when `Object.hasOwn(entries, id)`.
|
|
11
|
+
*/
|
|
7
12
|
entries: Record<string, CliCheckpointEntry>;
|
|
8
13
|
digestOf(line: {
|
|
9
14
|
command: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/checkpoint.ts"],"names":[],"mappings":"AAoBA,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IAC3E,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3D;AAYD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/checkpoint.ts"],"names":[],"mappings":"AAoBA,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IAC3E,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3D;AAYD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAmB7D;AAED,yCAAyC;AACzC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,IAAI,CAIhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhE,6EAA6E;AAC7E,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhE,6EAA6E;AAC7E,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAsBD,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,OAAO,EAAE,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAClD;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;CACzC;AAED;;;;;;GAMG;AACH,wBAAuB,cAAc,CACnC,MAAM,GAAE,aAAa,CAAC,UAAU,GAAG,MAAM,CAAiB,GACzD,aAAa,CAAC,MAAM,CAAC,CAcvB;AAqCD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,EAC3C,KAAK,GAAE,cAAmB,GACzB,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,MAAM,CAAC,EAAE,CACP,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KACrD,eAAe,GAAG,SAAS,CAAC;IACjC,sEAAsE;IACtE,KAAK,CAAC,EAAE,CACN,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EACxD,OAAO,EAAE,mBAAmB,KACzB,IAAI,CAAC;CACX;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,yFAcpE;AAED,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;IACnE,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB;;mBA+ElE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-schema-join.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/foreign-schema-join.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"foreign-schema-join.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/foreign-schema-join.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,YACjC,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,eAAe,CACP,CAAC;AAuBX,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAExE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAI3E;AA8CD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE,OAAO,EACb,IAAI,cAAoB,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CASrC;AAaD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC/D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3B,CAoCA;AA+GD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAU,EACtC,IAAI,GAAE,WAAW,CAAC,MAAM,CAAa,GACpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyDzB;AA0CD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAU,EACtC,IAAI,GAAE,WAAW,CAAC,MAAM,CAAa,GACpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8EzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/openapi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/openapi.ts"],"names":[],"mappings":"AAKA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAahF,OAAO,EACL,KAAK,0BAA0B,EAKhC,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgBjD,8DAA8D;AAC9D,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,0BAA0B,GACpC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA6HlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAK,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAEL,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAK,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAgB7D,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,CAAC,EAAE,cAAc,KACrB,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAEtD,UAAU,cAAc;IACtB,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,MAAM,EAAE;IACN,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,EACD,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GAC9C,OAAO,CAAC,CAAC,CAAC,CAUZ;AAwGD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,OAAO,GAAE,oBAAyB,GACjC,SAAS,CAoBX;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,GAAE,oBAAyB,GACjC,SAAS,CAmBX;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,sEAAsE;AACtE,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAElF,6EAA6E;AAC7E,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAIhF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EACzC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACjC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,qBAAqB,EAC/C,SAAS,EAAE,0BAA0B,GACpC,qBAAqB,EAAE,CAczB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TransportSource } from '../contract/define.js';
|
|
2
|
+
import type { RuntimeContext } from '../contract/runtime-context.js';
|
|
3
|
+
import type { ToolArgumentExtension, ToolExecutionOptions, ToolOperation } from './execute.js';
|
|
4
|
+
import type { ToolCallContext } from './execute-hooks.js';
|
|
5
|
+
import type { ToolResult } from './execute-result.js';
|
|
6
|
+
/**
|
|
7
|
+
* The handler and everything that shapes its answer: the lifecycle gate, the
|
|
8
|
+
* declared-output check, the tool view, the transport's presenter. A throw is
|
|
9
|
+
* left to the caller, which owns the hooks that observe it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function invokeToolHandler(method: ToolOperation, ctx: RuntimeContext, input: unknown, source: TransportSource, { lifecycle, onOutputStrip, finalizeOutput, toolSurface, }: Pick<ToolExecutionOptions, 'lifecycle' | 'onOutputStrip' | 'finalizeOutput' | 'toolSurface'>): Promise<ToolResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Parse the extension's own arguments and resolve them into call context.
|
|
14
|
+
* The extension keys leave the arguments; transport-owned identity stays.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveToolExtension(extension: ToolArgumentExtension, keys: ReadonlySet<string>, rawArgs: Record<string, unknown>, context: ToolCallContext): Promise<{
|
|
17
|
+
args: Record<string, unknown>;
|
|
18
|
+
context: ToolCallContext;
|
|
19
|
+
} | {
|
|
20
|
+
invalid: string;
|
|
21
|
+
} | {
|
|
22
|
+
thrown: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=execute-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-handler.d.ts","sourceRoot":"","sources":["../../src/tools/execute-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,EACvB,EACE,SAAS,EACT,aAAa,EACb,cAAc,EACd,WAAW,GACZ,EAAE,IAAI,CACL,oBAAoB,EACpB,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa,CACjE,GACA,OAAO,CAAC,UAAU,CAAC,CAqErB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,eAAe,GACvB,OAAO,CACN;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,GAC3D;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CACtB,CA+BA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,kBAAkB,CAAC;AAGxE,MAAM,MAAM,0BAA0B,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAEzE,2FAA2F;AAC3F,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAE5C,YAAY,MAAM,EAAE,0BAA0B,EAI7C;CACF;AAaD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,yBAAyB,CAEpC;AAED,4FAA4F;AAC5F,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;;OAIG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1D;AAED,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC;IACpB,OAAO,EAAE,CACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjE;AAKD,wFAAwF;AACxF,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,kEAAkE;IAClE,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,+EAA+E;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,UAAU,CAAC,CAkBrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE;IACJ,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,EACD,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAuBZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/round.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAGxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/round.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAGxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAA4B,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAI/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAGL,KAAK,sBAAsB,EAG3B,KAAK,UAAU,EAEhB,MAAM,iBAAiB,CAAC;AAOzB,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,cAAc,GAAG,mBAAmB,CAAA;CAAE,CAAC;AAyIzE,qFAAqF;AACrF,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAC7C,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC;IACpB,aAAa,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,cAAc,CAAC;IACtD,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAqL9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/coerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"coerce.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/coerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4JxB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAuJ7D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE5F;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAG3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-references.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/inline-references.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inline-references.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/inline-references.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAgNxD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,MAAM,GACZ,sBAAsB,CAoCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting-limit.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/nesting-limit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nesting-limit.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/nesting-limit.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AA0CxD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAChC,sBAAsB,CAwCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAInB,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9C;AA6LD,+EAA+E;AAC/E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAwDxB;AAoCD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAElF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../src/tracking/privacy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../src/tracking/privacy.ts"],"names":[],"mappings":"AAyFA,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBxD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAKxF;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAY3D"}
|
|
@@ -24,7 +24,7 @@ Server-only, peer-free native OpenRouter provider over Web `fetch` and Chat Comp
|
|
|
24
24
|
|--------|------|---------|
|
|
25
25
|
| `openRouterProvider` / `OpenRouterProviderAccess` | function / _type_ | native peer-free `AgentModelDriverFactory` over OpenRouter Chat Completions SSE; the optional second argument shapes every request — `defaultPolicy`, `resolvePolicy(modelId)` from the application's own model table, and `sessionPerConversation` (`session_id` derived directly from `request.correlation.conversationId`, hashed when over 256 chars, without requiring `invocations`, yielding to explicit `provider.order`); a provider-level `extraBody` that would overwrite owned wire keys is refused |
|
|
26
26
|
| `OpenRouterProviderSettings` | _type_ | `{ apiKey, baseUrl?, headers?, appName?, appUrl?, providerApiKeys?, fetch?, extraBody? }` — camelCase settings sending `HTTP-Referer`, `X-OpenRouter-Title`, and `X-Provider-API-Keys` with `redirect: 'error'` |
|
|
27
|
-
| `OpenRouterRequestPolicySchema` / `OpenRouterRequestPolicy` / `OpenRouterProviderRoutingSchema` / `OpenRouterProviderRouting` / `OpenRouterMaxPriceSchema` / `OpenRouterMaxPrice` / `OpenRouterReasoningEffortSchema` / `OpenRouterReasoningEffort` | schemas / _types_ | one request's policy: `sessionId` or `provider.order` (never both; an empty order is refused), routing (`allowFallbacks`, `requireParameters`, `dataCollection`, `zdr`, `only`, `ignore`, `sort`, `quantizations`), `maxPrice` in USD per million tokens or per request/image, `reasoning.effort` up to `max`, `looseTools` (`strict: false` while preserving explicit per-tool `strict: true`), and optional portable `cacheControl` (`AgentCacheControl`) |
|
|
27
|
+
| `OpenRouterRequestPolicySchema` / `OpenRouterRequestPolicy` / `OpenRouterProviderRoutingSchema` / `OpenRouterProviderRouting` / `OpenRouterMaxPriceSchema` / `OpenRouterMaxPrice` / `OpenRouterReasoningEffortSchema` / `OpenRouterReasoningEffort` | schemas / _types_ | one request's policy: `sessionId` or `provider.order` (never both; an empty order is refused), routing (`allowFallbacks`, `requireParameters`, `dataCollection`, `zdr`, `only`, `ignore`, `sort`, `quantizations`) and provider-specific `options` keyed by provider slug (also accepted by every non-chat client's `provider`), `maxPrice` in USD per million tokens or per request/image, `reasoning.effort` up to `max`, `looseTools` (`strict: false` while preserving explicit per-tool `strict: true`), and optional portable `cacheControl` (`AgentCacheControl`) |
|
|
28
28
|
| `normalizeOpenRouterUsage` | function | provenance-aware normalization of raw OpenRouter `usage` payloads (including BYOK `cost_details.upstream_inference_cost` with `computed` cost provenance; missing counters stay `unavailable`) |
|
|
29
29
|
| `createOpenRouterRouteResolver` / `OpenRouterRouteResolver` / `createMemoryOpenRouterRouteStore` / `OpenRouterRouteStore` / `OpenRouterRoutePinSchema` / `OpenRouterRoutePin` | functions / _types_ / schema | keep a thread on one upstream outside the agent runtime: `session-sticky` (its `session_id`; a key over 256 characters is hashed) or `provider-order` (the upstream slug that answered first, from `record`, with `allowFallbacks: false` unless the base policy says otherwise); a pin replaces the base policy's route; the memory store is least-recently-used, bounded by `maxEntries` and `ttlMs` |
|
|
30
30
|
| `loadOpenRouterCatalogSnapshot` / `fetchOpenRouterModelEndpoints` / `OpenRouterSnapshotOptions` / `OpenRouterCatalogSnapshotSchema` / `OpenRouterCatalogSnapshot` / `OpenRouterSnapshotModelSchema` / `OpenRouterSnapshotModel` / `OpenRouterEndpointSchema` / `OpenRouterEndpoint` / `OpenRouterPricingTierSchema` / `OpenRouterPricingTier` / `OpenRouterModelAliasTargetSchema` / `OpenRouterModelAliasTarget` / `OpenRouterModelReasoningMetaSchema` / `OpenRouterModelReasoningMeta` | functions / _types_ / schemas | a timestamped snapshot of `/models` (supporting unauthenticated public reads or static/async `apiKey`, full model metadata including `canonicalSlug`, `description`, `createdAt`, `aliasTarget`, `inputModalities`, `outputModalities`, `tokenizer`, `topProviderContextLength`, `maxCompletionTokens`, `reasoning`, per-million/request/image/cache prices including `cacheWrite1hUsdPerMillion` and conditional `pricingTiers` — distinguishing omitted keys from explicit `null`/`-1` unknowns, never treating unknown as zero — rejecting paginated truncation and duplicate ids) and per-model endpoints (including `cacheWrite1hUsdPerMillion`, `latencyP50Ms`, `throughputP50`, `uptime1d`, `tag`); ids are checked as `author/slug` (or `~author/slug`) before the network, endpoint requests run 1–16 at once and stop at the first failure, bodies are bounded, redirects refused |
|
|
@@ -33,14 +33,15 @@ Server-only, peer-free native OpenRouter provider over Web `fetch` and Chat Comp
|
|
|
33
33
|
| `createOpenRouterCatalogCache` / `OpenRouterCatalogCache` / `OpenRouterCatalogCacheOptions` / `OpenRouterCatalogCacheReadResult` / `OpenRouterCatalogStore` | function / _types_ | Web Fetch-clean cached OpenRouter catalog reader with single-flight coalescing, per-caller `AbortSignal` isolation, `freshMs` TTL, `retryBackoffMs` stale fallback, optional pluggable persistence (`store`), and `read`/`refresh`/`getModel`/`listModels`; `OpenRouterCatalogCacheReadResult` is a discriminated union on `status` (`'current' \| 'stale' \| 'unavailable'`) narrowing `snapshot`, `observedAt`, `models`, and `lastError` without casts (use `read()` for admission/billing decisions; `getModel`/`listModels` map `'unavailable'` to `undefined`/`[]`) |
|
|
34
34
|
| `evaluateOpenRouterModelAdmission` / `OpenRouterAdmissionPolicySchema` / `OpenRouterAdmissionPolicy` / `OpenRouterModelAdmissionSchema` / `OpenRouterModelAdmission` / `OpenRouterAdmissionReasonSchema` / `OpenRouterAdmissionReason` | function / schemas / _types_ | decide one model from a stored snapshot: `admitted`, `unverified` (stale or future-dated snapshot, `'context-unknown'`, `'price-unknown'`, `'endpoints-unknown'`) or `rejected` with a reason (`requiredParameters`, `requiredInputModalities`, effective context `min(contextLength, topProviderContextLength)`, separated worst-case pricing ceilings `maxPromptUsdPerMillion` / `maxCompletionUsdPerMillion` / `maxCacheWriteUsdPerMillion` via `resolveOpenRouterModelCeiling`, live endpoint); `~`, `-latest`, `:batch`, `stealth/`, `openrouter/auto`, `aliasOf`, and `aliasTarget` models are always refused as `'floating-alias'`; the result is a schema, so a stored decision reads back |
|
|
35
35
|
| `openRouterSpendProvider` / `createOpenRouterSpendReconciler` | functions | OpenRouter for `stitchkit/spend`: the gateway provider (origin derived from optional `baseUrl` override, key read per call, chat + non-chat usage facts including `x-generation-id`, `input_tokens`/`output_tokens`, `generation_id`, and `usage.seconds` as `workUnit: 'seconds'`) and the reconciler that prices an attempt by its generation id (`GET /api/v1/generation`, optional `baseUrl` override; a 404 is "not yet"; `apiKey` may be a function of the record, since OpenRouter prices a generation only for the key that made it) |
|
|
36
|
-
| `OpenRouterHttpError` | class | a non-2xx answer from OpenRouter, with its `status` |
|
|
37
36
|
| `openRouterModelCatalog` | function | complete tool-capable text catalog (`sort=top-weekly`) plus independent weekly popularity and available benchmark observations (optional static or async `apiKey` and `baseUrl` override); a `timeoutMs` that is not an integer from 1 to 2147483647 ms (the timer range) is refused when the catalog is created (`RangeError`) |
|
|
38
|
-
| `OpenRouterModelCatalogOptions`
|
|
39
|
-
| `OPENROUTER_API_BASE_URL` / `OpenRouterFetch` | const / _type_ | canonical default OpenRouter API v1 base URL (`https://openrouter.ai/api/v1`) and Web Fetch-compatible transport type shared by `openRouterProvider
|
|
37
|
+
| `OpenRouterModelCatalogOptions` | _type_ | optional static/dynamic credential, `baseUrl` override, timeout, clock and injected `OpenRouterFetch` for catalog loading |
|
|
38
|
+
| `OPENROUTER_API_BASE_URL` / `OpenRouterFetch` | const / _type_ | canonical default OpenRouter API v1 base URL (`https://openrouter.ai/api/v1`) and the one Web Fetch-compatible transport type (it receives the resolved `URL`) shared by `openRouterProvider`, catalog, spend and non-chat endpoint helpers |
|
|
40
39
|
| `openRouterRequestJson` / `openRouterRequestStream` / `OpenRouterTransportOptions` / `OpenRouterRequestJsonOptions` / `OpenRouterRequestStreamOptions` / `OpenRouterJsonResponse` / `OpenRouterStreamResponse` / `OpenRouterHttpMethod` / `OpenRouterQueryParams` | functions / _types_ | peer-free, Web Fetch-clean transport for any OpenRouter API v1 JSON, multipart (`FormData`), or binary streaming endpoint: validates `baseUrl` and relative `path` against traversal or origin override, enforces `redirect: 'error'` plus defense-in-depth redirect refusal, bounds response/error bodies, throws redacted `AgentProviderError` on non-2xx or invalid JSON/schema, extracts `generationId`, `requestId`, and BYOK-aware `costUsd`, and disarms `openRouterRequestStream`'s open-phase `timeoutMs` once 2xx headers arrive while keeping caller `signal` linked to stream cancellation |
|
|
41
|
-
| `openRouterSystemOne` / `OpenRouterSystemOneInput` / `OpenRouterSystemOneQuestion` / `OpenRouterSystemOneResponseSchema` / `OpenRouterSystemOneResponse` / `OpenRouterSystemOneResult` | function / schema / _types_ | typed client for OpenRouter's `POST /systemone` decision endpoint (`noul`, `choice`, and `
|
|
42
|
-
| `openRouterAudioTranscription` / `OpenRouterAudioTranscriptionInput` / `OpenRouterAudioSource` / `OpenRouterAudioTranscriptionResponseSchema` / `OpenRouterAudioTranscriptionResponse` / `OpenRouterAudioTranscriptionResult` | function / schema / _types_ | typed client for OpenRouter's `POST /audio/transcriptions` speech-to-text endpoint supporting `base64` JSON (`input_audio`), remote `url` (`
|
|
43
|
-
| `
|
|
40
|
+
| `openRouterSystemOne` / `OpenRouterSystemOneInput` / `OpenRouterSystemOneQuestion` / `OpenRouterSystemOneResponseSchema` / `OpenRouterSystemOneResponse` / `OpenRouterSystemOneResult` | function / schema / _types_ | typed client for OpenRouter's `POST /systemone` decision endpoint (`noul`, `choice`, `score` and image `box` questions over a `state` string, JSON object or JSON array, image `assets`, `sessionId`, `user`, optional `provider` routing and `extraBody`; calibrated probability answers, `box` answers and per-question `refusal` plus `generationId` and `costUsd`) |
|
|
41
|
+
| `openRouterAudioTranscription` / `OpenRouterAudioTranscriptionInput` / `OpenRouterAudioSource` / `OpenRouterAudioTranscriptionResponseSchema` / `OpenRouterAudioTranscriptionResponse` / `OpenRouterAudioTranscriptionResult` / `OpenRouterTranscriptionSegment` / `OpenRouterTranscriptionWord` | function / schema / _types_ | typed client for OpenRouter's `POST /audio/transcriptions` speech-to-text endpoint supporting `base64` JSON (`input_audio: { data, format }`), remote `url` (`input_audio: { url, format? }`), and multipart `file` uploads (`Blob` / `Uint8Array` / `ArrayBuffer`), `verbose_json`, `timestampGranularities`, `diarize` (enforcing `verbose_json`; segments and words carry an integer `speaker` index and optional `speakerLabel`), `provider` routing, `generationId`, and `costUsd` |
|
|
42
|
+
| `OpenRouterUsageSchema` / `OpenRouterUsage` / `OpenRouterResponseMeta` | schema / _types_ | what the non-chat clients share: one `usage` schema (tokens, `seconds`, `cost`, `is_byok`) on every non-chat response schema, and the result metadata (`status`, `generationId`, `requestId`, `costUsd`, `headers`) every non-chat result extends; each client validates its request fields with Zod before any request |
|
|
43
|
+
| `createOpenRouterClient` / `OpenRouterClient` / `OpenRouterClientOptions` | function / _types_ | one client for the non-chat endpoints: transport settings (`apiKey`, `baseUrl`, `fetch`, `headers`, `appName`, `appUrl`, `providerApiKeys`, `timeoutMs`, `maxErrorBytes`) stated once; methods `audioTranscription`, `audioSpeech`, `systemOne`, `generateImages`, `submitVideo`, `getVideo`, `downloadVideo`, `embeddings`, `rerank`, `requestJson`, `requestStream` are the `openRouter*` functions of the same name with those settings under each call's own (`headers` and `providerApiKeys` merge key by key); an invalid `baseUrl` or static `apiKey` is refused at creation |
|
|
44
|
+
| `openRouterAudioSpeech` / `OpenRouterAudioSpeechInput` / `OpenRouterSpeechFormat` / `OpenRouterSpeechTurn` / `OpenRouterAudioSpeechResult` / `OpenRouterAudioSpeechUrlResult` / `OpenRouterSpeechUrlResponseSchema` / `OpenRouterSpeechUrlResponse` | function / schema / _types_ | text-to-speech client for OpenRouter's `POST /audio/speech` endpoint: `input` as text or multi-speaker turns (`{ text, voice?, instructions? }`), optional `voice`, request-wide `instructions`, `responseFormat` `mp3` / `pcm` / `wav`; by default resolves `{ delivery: 'stream' }` with binary audio `ReadableStream<Uint8Array>`, `contentType`, and `generationId`, and with `outputDelivery: 'url'` resolves `{ delivery: 'url', url, expiresAt, mediaType }` or the byte stream when zero-data-retention applies |
|
|
44
45
|
| `openRouterGenerateImages` / `OpenRouterImageGenerationInput` / `OpenRouterImageGenerationResponseSchema` / `OpenRouterImageGenerationResponse` / `OpenRouterImageGenerationResult` | function / schema / _types_ | typed client for OpenRouter's Unified Image API (`POST /images`) supporting `prompt`, `n`, `aspectRatio`, `resolution`, `responseFormat` (`'b64_json' \| 'url'`), `inputReferences`, `provider` routing, `generationId`, and `costUsd` |
|
|
45
|
-
| `openRouterSubmitVideo` / `openRouterGetVideo` / `openRouterDownloadVideo` / `OpenRouterVideoSubmitInput` / `OpenRouterVideoJobInput` / `OpenRouterVideoSubmitResponse` / `OpenRouterVideoSubmitResult` / `OpenRouterVideoStatusResponse` / `OpenRouterVideoStatusResult` | functions / _types_ | typed submit (`POST /videos`), status poll (`GET /videos/{jobId}`), and authenticated binary stream download (`GET /videos/{jobId}/content`) clients for OpenRouter's asynchronous Video Generation API with `jobId` path-segment validation, `frameImages`, `inputReferences`, `generateAudio`, `callbackUrl`, `generationId`, and `costUsd` |
|
|
46
|
-
| `openRouterEmbeddings` / `OpenRouterEmbeddingsInput` / `OpenRouterEmbeddingsResponse` / `OpenRouterEmbeddingsResult` / `openRouterRerank` / `OpenRouterRerankInput` / `OpenRouterRerankResponse` / `OpenRouterRerankResult` | functions / _types_ | typed clients for OpenRouter's `POST /embeddings` vector generation and `POST /rerank` document rescoring endpoints with `provider` routing, `generationId`, and `costUsd` |
|
|
46
|
+
| `openRouterSubmitVideo` / `openRouterGetVideo` / `openRouterDownloadVideo` / `OpenRouterVideoSubmitInput` / `OpenRouterVideoJobInput` / `OpenRouterVideoSubmitResponseSchema` / `OpenRouterVideoSubmitResponse` / `OpenRouterVideoSubmitResult` / `OpenRouterVideoStatusResponseSchema` / `OpenRouterVideoStatusResponse` / `OpenRouterVideoStatusResult` | functions / schemas / _types_ | typed submit (`POST /videos`), status poll (`GET /videos/{jobId}`), and authenticated binary stream download (`GET /videos/{jobId}/content`, optional zero-based output `index`) clients for OpenRouter's asynchronous Video Generation API with `jobId` path-segment validation, `frameImages`, `inputReferences`, `generateAudio`, `callbackUrl`, `generationId`, and `costUsd` |
|
|
47
|
+
| `openRouterEmbeddings` / `OpenRouterEmbeddingsInput` / `OpenRouterEmbeddingsResponseSchema` / `OpenRouterEmbeddingsResponse` / `OpenRouterEmbeddingsResult` / `openRouterRerank` / `OpenRouterRerankInput` / `OpenRouterRerankResponseSchema` / `OpenRouterRerankResponse` / `OpenRouterRerankResult` | functions / schemas / _types_ | typed clients for OpenRouter's `POST /embeddings` vector generation and `POST /rerank` document rescoring endpoints (string or `{ text?, image? }` documents, results echoing `text` and/or `image`) with `provider` routing, `generationId`, and `costUsd` |
|
|
@@ -95,7 +95,11 @@ reconnect, create the coding profile from the new handle; old tools remain stopp
|
|
|
95
95
|
host services. `{ allow: [{ origin, headers }] }` retains that isolation and
|
|
96
96
|
allows HTTP through a Unix-socket gateway only. Origins are exact HTTP(S) origins,
|
|
97
97
|
including scheme and port; no wildcard, redirect, arbitrary TCP or CONNECT tunnel
|
|
98
|
-
is allowed.
|
|
98
|
+
is allowed. An origin must be `https:`; plain `http:` is accepted only for a
|
|
99
|
+
loopback host (`localhost`, `127.0.0.0/8`, `[::1]`), because the gateway would
|
|
100
|
+
otherwise send the rule's headers and the guest's request in clear text. A policy
|
|
101
|
+
naming any other `http:` origin is refused when it is parsed. For HTTPS upstreams
|
|
102
|
+
the **host** establishes TLS. Guests speak HTTP
|
|
99
103
|
over the socket with the upstream host in `Host`, for example:
|
|
100
104
|
|
|
101
105
|
```ts
|
|
@@ -128,6 +132,17 @@ state storage and other host sockets are not mounted. Each command gets ephemera
|
|
|
128
132
|
directory belong to the trusted host. See the
|
|
129
133
|
[Bubblewrap security model](https://github.com/containers/bubblewrap#system-security).
|
|
130
134
|
|
|
135
|
+
Every Linux launch — this backend, `createProcessSandbox` and its probe — runs
|
|
136
|
+
Bubblewrap with `--unshare-user --disable-userns`: a sandboxed process cannot
|
|
137
|
+
create a nested user namespace (`unshare -U` fails with `ENOSPC`), so it cannot
|
|
138
|
+
regain capabilities there and remount its view of the filesystem. Software that
|
|
139
|
+
needs its own user namespace inside the sandbox — a nested `bwrap`, a browser's
|
|
140
|
+
namespace sandbox — does not run there. On a host where Bubblewrap cannot create
|
|
141
|
+
a user namespace, or with a setuid `bwrap`, which does not support
|
|
142
|
+
`--disable-userns`, `probeProcessSandbox` reports the sandbox unavailable
|
|
143
|
+
(`createProcessSandbox` refuses with `SANDBOX_UNAVAILABLE`) and backend commands
|
|
144
|
+
fail at launch; neither falls back to a sandbox without the lock.
|
|
145
|
+
|
|
131
146
|
This is namespace isolation over the host kernel, not a VM. It does not impose
|
|
132
147
|
memory, CPU, disk or process-count quotas. A host running mutually untrusted workloads
|
|
133
148
|
must supply those bounds outside the namespace (for example, a delegated cgroup and
|
|
@@ -177,19 +192,43 @@ const driver = createCodexDriver({ wrapCommand: sandbox.wrapCommand });
|
|
|
177
192
|
the platform is unsupported; there is no unsandboxed fallback.
|
|
178
193
|
- **Symlink-safe `workspace-readonly` and `denyPaths`:** `ProcessSandboxSpecSchema` resolves
|
|
179
194
|
symlinks via `realpathSync` so none of `writableDirs`, `privateTmpDir`, or `homeDir` can overlap
|
|
180
|
-
`workspace` through a symlink. Both Linux Bubblewrap and macOS Seatbelt resolve
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
195
|
+
`workspace` through a symlink. Both Linux Bubblewrap and macOS Seatbelt resolve every path the
|
|
196
|
+
same way: through symlinks, or — only for an entry that does not exist yet — through its deepest
|
|
197
|
+
existing ancestor. A path that exists but cannot be resolved — a dangling symlink, a symlink loop
|
|
198
|
+
(`ELOOP`), a path through a regular file (`ENOTDIR`) or an unreadable directory (`EACCES`) —
|
|
199
|
+
fails closed with `SandboxError('SANDBOX_UNAVAILABLE', ...)` naming the path and the error code
|
|
200
|
+
on both platforms, rather than being matched by its spelling. Linux then compares each resolved
|
|
201
|
+
`denyPaths` target with every host-backed mount, including symlinked mounts, while macOS emits
|
|
202
|
+
deny rules for both the lexical path and the resolved path. On Linux the mount sources resolve
|
|
203
|
+
the same way when `denyPaths` are planned, because Bubblewrap follows a source when it starts:
|
|
204
|
+
an explicit mount through a dangling symlink or a regular file is refused, and a default
|
|
205
|
+
optional system mount (`/lib64`, `/etc/ssl`, `/etc/resolv.conf`, ...) that is absent or a
|
|
206
|
+
dangling symlink at plan time is planned as the path it would bind, so a covering deny masks it
|
|
207
|
+
even if it appears before start.
|
|
208
|
+
- **What a Linux deny guarantees, and what it refuses:** a Bubblewrap mask is a mount, and a mount
|
|
209
|
+
sits on a directory entry. On a host directory that entry is replaced when the host renames a
|
|
210
|
+
file over it (the usual atomic update of a token or `.env`) and does not exist for a file created
|
|
211
|
+
after start, so a mask there would stop hiding the path while the sandboxed process keeps running.
|
|
212
|
+
Linux therefore accepts only denies it can hold for the process's whole lifetime:
|
|
213
|
+
- a deny that equals or contains a host-backed mount (`workspace`, `readOnlyPaths`,
|
|
214
|
+
`writableDirs`, `privateTmpDir`, a `unixSockets` entry, a system root) replaces that mount with
|
|
215
|
+
an empty `tmpfs` (directories) or `/dev/null` (files and sockets) — the host path is never
|
|
216
|
+
bound, so renames and new files under it stay invisible;
|
|
217
|
+
- a deny outside every mount needs no mask: nothing outside the mounts exists in the sandbox,
|
|
218
|
+
including files created there later;
|
|
219
|
+
- a deny strictly inside a mounted host directory — present at start or not — is refused with
|
|
220
|
+
`SANDBOX_UNAVAILABLE` naming the path and the mount. Keep such secrets out of mounted trees
|
|
221
|
+
(for example outside the workspace) or deny the whole mounted path.
|
|
222
|
+
|
|
223
|
+
macOS Seatbelt matches `denyPaths` by path on every access, so a path inside the workspace stays
|
|
224
|
+
denied across renames and later creation there; that placement is accepted on macOS and refused
|
|
225
|
+
on Linux.
|
|
186
226
|
- **Platform read/write and IPC models differ:**
|
|
187
227
|
- **Linux (`bwrap`):** mount-namespace allowlist — only mounted system roots, `workspace`,
|
|
188
228
|
`readOnlyPaths`, `writableDirs`, `privateTmpDir`, `homeDir`, and `unixSockets` exist inside the
|
|
189
|
-
sandbox; unmounted host paths are absent, and `denyPaths`
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
treated as host-backed. A `cwd` outside mounted roots (such as `driver.info()` /
|
|
229
|
+
sandbox; unmounted host paths are absent, and `denyPaths` equal to or above a host-backed
|
|
230
|
+
mount replace it as described above, while an isolated `tmpfs` `homeDir` is not treated as
|
|
231
|
+
host-backed. A `cwd` outside mounted roots (such as `driver.info()` /
|
|
193
232
|
`driver.status()`) falls back to `workspace`.
|
|
194
233
|
- **macOS (`sandbox-exec` Seatbelt, compiled by `buildSeatbeltProfile`):** default-deny writes
|
|
195
234
|
with default-allow reads — writes are denied globally except `privateTmpDir`, `workspace`
|
|
@@ -21,7 +21,7 @@ Peer-free, credential-free model drivers, provider fault servers, and concurrenc
|
|
|
21
21
|
|--------|------|---------|
|
|
22
22
|
| `createScriptedModelDriver` | function | deterministic peer-free `AgentModelDriver` for tests: replays scripted stream parts, records every `AgentModelRequest`, and supports per-step throws or async stream factories |
|
|
23
23
|
| `ScriptedModelDriver` / `ScriptedModelDriverOptions` / `ScriptedModelStep` | _types_ | scripted driver handle (exposing `requests`), driver options (`provider`, `modelId`, `steps`, `onRequest`), and one scripted turn (`AgentModelStreamPart[]`, `{ throw }`, or stream function) |
|
|
24
|
-
| `createFaultProviderServer` | function | start an OpenAI-compatible local SSE endpoint with deterministic pass, connection-refused, timeout, stream-cut, HTTP, malformed JSON, slow-stream and missing-usage steps |
|
|
24
|
+
| `createFaultProviderServer` | function | start an OpenAI-compatible local SSE endpoint with deterministic pass, connection-refused, timeout, stream-cut, HTTP, malformed JSON, slow-stream and missing-usage steps; its `url` is the API root (`…/v1`) a provider `baseUrl` takes |
|
|
25
25
|
| `AgentFaultStepSchema` / `AgentFaultStep` | schema / _type_ | strict fault-plan step vocabulary |
|
|
26
26
|
| `defineAgentFaultPlan` | function | validate a non-empty deterministic fault sequence |
|
|
27
27
|
| `createReplayAgentProvider` | function | serve a declared sequence of credential-free `AgentModelDriver` fixtures per model ID |
|
package/llms/agent-runtime.2.txt
CHANGED
|
@@ -483,12 +483,15 @@ event cannot be rewritten after the fact.
|
|
|
483
483
|
|
|
484
484
|
### Retried provider streams
|
|
485
485
|
|
|
486
|
-
With `loop.retry` set, a provider
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
486
|
+
With `loop.retry` set, a provider call that fails is repeated — the call of that
|
|
487
|
+
step, with the request it was prepared with; earlier steps and the tools they ran
|
|
488
|
+
stand, and `prepareStep` is not run again. A call whose stream already carried a
|
|
489
|
+
provider-executed tool call or a tool result is not repeated. Subscribers see
|
|
490
|
+
`attempt-reset` before the repeated call's first delta and drop what the failed
|
|
491
|
+
call streamed; the durable draft is checkpointed after that output is cut; an
|
|
492
|
+
input injected into the step stays in the repeated request; and the failed call's
|
|
493
|
+
reported usage stays in the run's spend. `completeText` / `streamComplete` /
|
|
494
|
+
`completeObject` repeat the same unit: both entries run one loop of model steps. Transient events —
|
|
492
495
|
deltas, reasoning, `attempt-reset` — are numbered from 1 per run, counting only
|
|
493
496
|
what was published, so a cursor sees no gap on an ordinary stream.
|
|
494
497
|
|
package/llms/agent-runtime.3.txt
CHANGED
|
@@ -118,8 +118,8 @@ conversation of the run it is given.
|
|
|
118
118
|
For credential-free failure tests, import `createFaultProviderServer` and
|
|
119
119
|
`createReplayAgentProvider` from `stitchkit/agent-runtime/testing`. Runtime
|
|
120
120
|
`loop.retry` applies an explicit `AgentRetryPolicy`: each decision is recorded
|
|
121
|
-
as `retry/scheduled`, each
|
|
122
|
-
|
|
121
|
+
as `retry/scheduled`, each repeated call as `retry/started`, and a tool that has
|
|
122
|
+
run is never automatically replayed. Its `maxAttempts` is a
|
|
123
123
|
positive safe integer, refused otherwise when the runtime is created and when
|
|
124
124
|
`recordAgentRetryDecision` is given the policy (`TypeError`): `Infinity` would
|
|
125
125
|
retry a paid failure without end, `NaN` or `0` would silently mean never. The
|
package/llms/agent-runtime.4.txt
CHANGED
|
@@ -20,8 +20,15 @@ Parts of this slice:
|
|
|
20
20
|
|
|
21
21
|
A subscriber that switches over `event.type` handles one transient event
|
|
22
22
|
beyond deltas and reasoning: `attempt-reset`, published when `loop.retry`
|
|
23
|
-
|
|
24
|
-
withdrawn
|
|
23
|
+
repeats a failed call, meaning what that call streamed is withdrawn. Its
|
|
24
|
+
`withdrawn: { text, reasoning }` counts the characters of transient text and
|
|
25
|
+
reasoning the cut call published — the tail of what the run streamed — so a
|
|
26
|
+
subscriber drops that many from the end and keeps the rest (earlier steps, which
|
|
27
|
+
stand). Counting from the end also holds for a subscriber that joined mid-run
|
|
28
|
+
and holds only part of the run's deltas; an event without `withdrawn`
|
|
29
|
+
withdraws everything the run streamed. It is published after the retry's
|
|
30
|
+
backoff, together with the durable `retry/started`, so a run stopped during the
|
|
31
|
+
pause records neither. `reduceAgentControlEvent` does that; a hand-written reducer must,
|
|
25
32
|
or it keeps the failed attempt's partial text on screen.
|
|
26
33
|
|
|
27
34
|
`publish` receives event classes with different guarantees:
|
|
@@ -146,9 +153,8 @@ replace the managed tool set or bypass its lifecycle fence.
|
|
|
146
153
|
|
|
147
154
|
Override lifetimes in `prepareStep` follow two explicit rules:
|
|
148
155
|
|
|
149
|
-
- **`instructions` is sticky across the remaining steps of the
|
|
150
|
-
|
|
151
|
-
attempt). Later steps receive the carried value in `instructions` alongside
|
|
156
|
+
- **`instructions` is sticky across the remaining steps of the run** (a provider
|
|
157
|
+
retry repeats the failed call with the instructions it was prepared with). Later steps receive the carried value in `instructions` alongside
|
|
152
158
|
the unchanged `initialInstructions`, so a step can explicitly revert with
|
|
153
159
|
`{ instructions: initialInstructions }`. One-shot `protocol.acceptTerminal`
|
|
154
160
|
continuation instructions apply only to that continuation step and do not
|
package/llms/agent-runtime.5.txt
CHANGED
|
@@ -58,7 +58,7 @@ Server-only, peer-free optional application runtime. Runs models exclusively thr
|
|
|
58
58
|
| `AgentConversationPurgeResultSchema` / `AgentConversationPurgeResult` | schema / _type_ | typed deletion/refusal outcomes; active refusal includes run IDs |
|
|
59
59
|
| `AgentConversationPurgedError` | class | runtime mutation rejected because its conversation ID is permanently purged |
|
|
60
60
|
| `AgentConversationPurgeDriver` | _type_ | optional `driver.conversations` capability: serialized tombstone read and atomic removal of all owned records |
|
|
61
|
-
| `projectAgentHistory` | function | asynchronously project canonical records and resolved multimodal files into provider-valid peer-free `AgentModelMessage[]` |
|
|
61
|
+
| `projectAgentHistory` | function | asynchronously project canonical records and resolved multimodal files into provider-valid peer-free `AgentModelMessage[]`; a `tool-result` part sends its recorded `modelOutput` (what the tool's `toModelOutput` showed the model in the live step) and calls `toModelOutput` only for a record without it; `resolveToolModelOutput` runs first |
|
|
62
62
|
| `defineModelRegistry` | function | typed language-model descriptors, capabilities and `AgentModelDriverFactory` construction |
|
|
63
63
|
| `AgentModelCatalogSchema` / `AgentModelCatalog` | schema / _type_ | provider-neutral complete/partial model catalog with separately sourced popularity, metrics, prices and observation time |
|
|
64
64
|
| `AgentModelCatalogEntrySchema` / `AgentModelCatalogEntry` | schema / _type_ | one canonical provider model descriptor with optional price, popularity and metric evidence |
|
|
@@ -150,7 +150,7 @@ the same native step execution without requiring a store. → ADR 0336.
|
|
|
150
150
|
| `AgentModelFinishReason` / `AgentModelResponseMetadata` / `AgentModelCostDetails` / `AgentStepTimings` / `AgentStepChunkIntervals` | _type_ | normalized step finish reason, response metadata (including server `modelId` and `timestamp`), optional provider-reported cost/BYOK breakdown (`promptCostUsd`, `outputCostUsd`, `isByok`), and measured step/response/tool/TTFT timings with optional inter-chunk interval percentiles (`min`, `p10`, `median`, `avg`, `p90`, `max`) |
|
|
151
151
|
| `wrapModelDriver` / `composeModelDrivers` | function | wrap one `AgentModelDriver` with one or an ordered outer-to-inner list of lifecycle decorators whose `onClose` runs once on finish, error, early stream cancellation, or abort |
|
|
152
152
|
| `AgentModelDriverDecorator` / `AgentModelDriverStreamOutcome` | _type_ | generic per-stream interceptor (`beforeStream`, `transformRequest`, `transformSignal`, `onPart`, `onClose`) and terminal stream outcome (`finished`, `errored`, `cancelled`) |
|
|
153
|
-
| `completeText` / `streamComplete` / `CompleteTextInput` / `CompleteTextOptions` / `CompletePromptInput` / `CompleteTextResult` / `CompleteTextStream` / `CompleteStreamPart` / `CompletePrepareStep` / `AgentCompleteStopPolicy` | functions / _types_ | peer-free single- or multi-step completion and standalone async-iterable streaming over any `AgentModelDriver` (no store required), with compile-time XOR on `prompt` vs `messages`, `retry`, `stopPolicies`, `idleTimeoutMs`, `onPart`, `headers`, tools, `prepareStep`, `repairToolCall`, timings and usage |
|
|
153
|
+
| `completeText` / `streamComplete` / `CompleteTextInput` / `StreamCompleteInput` / `CompleteTextOptions` / `CompletePromptInput` / `CompleteTextResult` / `CompleteTextStream` / `CompleteStreamPart` / `CompletePrepareStep` / `AgentCompleteStopPolicy` | functions / _types_ | peer-free single- or multi-step completion and standalone async-iterable streaming over any `AgentModelDriver` (no store required), with compile-time XOR on `prompt` vs `messages`, `retry`, `stopPolicies`, `idleTimeoutMs`, `onPart`, `headers`, tools, `prepareStep`, `repairToolCall`, timings and usage; `streamComplete` takes `parts: 'iterate'` (default, backpressured from the first part however late it is read) or `parts: 'ignore'` (result only, no buffer) |
|
|
154
154
|
| `completeObject` / `CompleteObjectInput` / `CompleteObjectResult` | function / _types_ | peer-free structured-output completion emitting strict JSON Schema (`draft-2020-12` via `toJsonSchema(..., 'input')`), stripping strict-mode optional `null`s prior to Zod validation, and supporting multi-step tool loops |
|
|
155
155
|
| `AgentStructuredOutputError` / `AgentStructuredOutputErrorReason` / `AgentStructuredOutputErrorDetails` | class / _types_ | typed error thrown by `completeObject` with `reason` (`'truncated' \| 'tool-calls' \| 'content-filter' \| 'provider-error' \| 'interrupted' \| 'empty' \| 'invalid-json' \| 'schema-mismatch'`), `finishReason`, `rawText`, `steps`, and `usage` |
|
|
156
156
|
| `AgentRetryExhaustedError` / `AgentRetryExhaustedErrorDetails` / `AgentRetryAttemptRecord` | class / _types_ | typed error thrown when stateless completion retries exhaust `retry.maxAttempts` or `maxRetryDurationMs`, carrying every failed attempt, `lastError`, and accumulated billable `usage` |
|