stitchkit 0.135.1 → 0.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/README.md +25 -11
- package/dist/agent-executor/acp/v1-session-build.d.ts +51 -0
- package/dist/agent-executor/acp/v1-session-build.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-session.d.ts +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/classify.d.ts +1 -1
- package/dist/agent-executor/claude/classify.d.ts.map +1 -1
- package/dist/agent-executor/claude/events-wire.d.ts +13 -0
- package/dist/agent-executor/claude/events-wire.d.ts.map +1 -0
- package/dist/agent-executor/claude/events.d.ts +1 -11
- package/dist/agent-executor/claude/events.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +0 -143
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/server-requests.d.ts +150 -0
- package/dist/agent-executor/codex/server-requests.d.ts.map +1 -0
- package/dist/agent-executor/image-input.d.ts +10 -3
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
- package/dist/agent-runtime/browser/browser-control-contract.d.ts +4 -0
- package/dist/agent-runtime/browser/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-schema.d.ts +4 -0
- package/dist/agent-runtime/browser/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-view.d.ts.map +1 -1
- package/dist/agent-runtime/event-schema.d.ts +16 -3
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/loop/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/loop/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/loop/invocation-stream.d.ts +9 -1
- package/dist/agent-runtime/loop/invocation-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/provider-stream-parts.d.ts +6 -0
- package/dist/agent-runtime/loop/provider-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/loop/provider-stream-segments.d.ts +1 -1
- package/dist/agent-runtime/loop/provider-stream-segments.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-approval-signature.d.ts +34 -0
- package/dist/agent-runtime/loop/run-approval-signature.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-approval.d.ts +0 -28
- package/dist/agent-runtime/loop/run-approval.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete-port.d.ts +24 -0
- package/dist/agent-runtime/loop/run-complete-port.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-complete-stream.d.ts +7 -2
- package/dist/agent-runtime/loop/run-complete-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete-types.d.ts +14 -1
- package/dist/agent-runtime/loop/run-complete-types.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete.d.ts +2 -2
- package/dist/agent-runtime/loop/run-complete.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-execution-state.d.ts +8 -0
- package/dist/agent-runtime/loop/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-model-call.d.ts +44 -0
- package/dist/agent-runtime/loop/run-model-call.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-model-step.d.ts +25 -28
- package/dist/agent-runtime/loop/run-model-step.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-model-steps.d.ts +6 -0
- package/dist/agent-runtime/loop/run-model-steps.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-model-stream.d.ts +3 -1
- package/dist/agent-runtime/loop/run-model-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts +0 -2
- package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-step-loop.d.ts +19 -0
- package/dist/agent-runtime/loop/run-step-loop.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-step-port.d.ts +175 -0
- package/dist/agent-runtime/loop/run-step-port.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-stream-step-text.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts +2 -1
- package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-call-input.d.ts +39 -0
- package/dist/agent-runtime/loop/run-tool-call-input.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-tool-call.d.ts +2 -31
- package/dist/agent-runtime/loop/run-tool-call.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-errors.d.ts +5 -0
- package/dist/agent-runtime/loop/run-tool-errors.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-executor.d.ts +1 -1
- package/dist/agent-runtime/loop/run-tool-executor.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-slots.d.ts +2 -1
- package/dist/agent-runtime/loop/run-tool-slots.d.ts.map +1 -1
- package/dist/agent-runtime/loop/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/loop/runtime.d.ts +0 -5
- package/dist/agent-runtime/loop/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/providers/ai-sdk-convert.d.ts +1 -5
- package/dist/agent-runtime/providers/ai-sdk-convert.d.ts.map +1 -1
- package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts +11 -0
- package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts.map +1 -0
- package/dist/agent-runtime/providers/ai-sdk-tools.d.ts +11 -0
- package/dist/agent-runtime/providers/ai-sdk-tools.d.ts.map +1 -0
- package/dist/agent-runtime/providers/ai-sdk.d.ts +1 -9
- package/dist/agent-runtime/providers/ai-sdk.d.ts.map +1 -1
- package/dist/agent-runtime/providers/anthropic-sse.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-admission.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-audio.d.ts +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/sandbox/sandbox-bubblewrap-args.d.ts +9 -0
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts +6 -0
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-linux.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts +5 -1
- package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-wrapper.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-observations.d.ts +42 -42
- package/dist/agent-runtime/stores/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/agent-runtime/testing/fault-bench.d.ts +5 -1
- package/dist/agent-runtime/testing/fault-bench.d.ts.map +1 -1
- package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/testing/store-conformance-support.d.ts +10 -10
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -7
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +17 -5
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +4 -2
- package/dist/entrypoints/agent-executor/claude-sdk.js +20 -20
- package/dist/entrypoints/agent-executor/claude.js +7 -7
- package/dist/entrypoints/agent-executor/codex.d.ts +2 -1
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +129 -35
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +2 -2
- package/dist/entrypoints/agent-executor/testing.js +17 -13
- package/dist/entrypoints/agent-executor.js +1 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts +2 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.js +10 -12
- package/dist/entrypoints/agent-runtime/anthropic.js +13 -10
- package/dist/entrypoints/agent-runtime/browser.js +8 -4
- package/dist/entrypoints/agent-runtime/harness.js +18 -19
- package/dist/entrypoints/agent-runtime/openai.js +5 -5
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +7 -5
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +1095 -854
- package/dist/entrypoints/agent-runtime/postgres.js +2 -2
- package/dist/entrypoints/agent-runtime/realtime.js +5 -5
- package/dist/entrypoints/agent-runtime/sandbox.js +167 -139
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.js +3 -3
- package/dist/entrypoints/agent-runtime.js +246 -360
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +36 -15
- package/dist/entrypoints/contract.js +12 -10
- package/dist/entrypoints/geo.js +1 -1
- package/dist/entrypoints/handler.js +5 -6
- package/dist/entrypoints/http.d.ts +2 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +16 -4
- package/dist/entrypoints/index.js +26 -35
- package/dist/entrypoints/live.js +3 -3
- package/dist/entrypoints/node.js +7 -7
- package/dist/entrypoints/observability.js +9 -7
- package/dist/entrypoints/process.js +3 -3
- package/dist/entrypoints/remote.js +5 -5
- package/dist/entrypoints/server.js +29 -16
- package/dist/entrypoints/telegram/grammy.d.ts +1 -1
- package/dist/entrypoints/telegram/grammy.d.ts.map +1 -1
- package/dist/entrypoints/telegram/grammy.js +39 -5
- package/dist/entrypoints/telegram/screens.js +3 -0
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +19 -6
- package/dist/entrypoints/testing.js +10 -11
- package/dist/entrypoints/tools/agent.js +8 -9
- package/dist/entrypoints/tools/connections.js +27 -57
- package/dist/entrypoints/tools/contract.js +4 -4
- package/dist/entrypoints/tools/invoker.js +7 -8
- package/dist/entrypoints/tools/mcp.js +9 -10
- package/dist/entrypoints/tools/toolkit.js +11 -12
- package/dist/entrypoints/tools.js +20 -20
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +1 -1
- package/dist/entrypoints/tracking.js +1 -1
- package/dist/{index-3czc3ykr.js → index-08a3qfr8.js} +1 -1
- package/dist/{index-grhhsrd5.js → index-1en7k3q5.js} +2 -1
- package/dist/{index-pdcbjd6a.js → index-1yky29qg.js} +6 -3
- package/dist/{index-b4c9dpzm.js → index-252den5a.js} +10 -11
- package/dist/{index-xtby8rj3.js → index-28kbdn63.js} +5 -47
- package/dist/{index-57sbckhv.js → index-36mtj8xm.js} +2 -2
- package/dist/{index-dm84tsd5.js → index-3kb8dw48.js} +1 -1
- package/dist/index-3tb82xr7.js +11 -0
- package/dist/{index-c24bj2r1.js → index-4243301z.js} +2 -2
- package/dist/{index-nr4fhfn4.js → index-4p2zx593.js} +2 -0
- package/dist/{index-q86qnzzf.js → index-54wp467c.js} +4 -4
- package/dist/{index-mcv7b2n0.js → index-63ctzjp4.js} +497 -495
- package/dist/{index-y0a4gt1s.js → index-65p8v81y.js} +3 -2
- package/dist/{index-z72vazf5.js → index-6y3eae97.js} +27 -83
- package/dist/{index-5awtbyns.js → index-9vj869rx.js} +1 -1
- package/dist/{index-5q0qpw3v.js → index-aqm7e864.js} +23 -8
- package/dist/{index-d4at0q09.js → index-b9mj31q7.js} +90 -88
- package/dist/{index-baba8ehy.js → index-bjrcbcn2.js} +2 -2
- package/dist/{index-fsw9wxk9.js → index-c9j8441q.js} +1 -103
- package/dist/{index-wdb5jhas.js → index-d1pdv8qc.js} +1 -1
- package/dist/{index-73wq9abg.js → index-df5xr2f9.js} +13 -59
- package/dist/{index-n9358ydy.js → index-dm50x3by.js} +1 -1
- package/dist/{index-zyyerdny.js → index-dmrx8xma.js} +3 -0
- package/dist/{index-78da4g74.js → index-dwq6a6sq.js} +17 -13
- package/dist/{index-9be3tf6r.js → index-e413q2cj.js} +49 -22
- package/dist/{index-g4gstmp1.js → index-ednf2cxs.js} +1 -1
- package/dist/{index-84tp547a.js → index-edpkm3k7.js} +29 -97
- package/dist/{index-gs0jw0hy.js → index-efbzm2se.js} +3 -3
- package/dist/{index-de7b0kvz.js → index-epwvp88y.js} +1 -1
- package/dist/{index-asnd4h2k.js → index-f0dzyskg.js} +27 -4
- package/dist/{index-xbb8ysmq.js → index-fatke81t.js} +2 -2
- package/dist/{index-6nzzj7qr.js → index-gq35s3bm.js} +1 -1
- package/dist/index-gvgtmt7a.js +102 -0
- package/dist/{index-m2b49tvc.js → index-h08xqfw9.js} +20 -21
- package/dist/{index-gk6dq9ay.js → index-ha1tv70k.js} +3 -26
- package/dist/{index-wsv11dhg.js → index-hberxns4.js} +1 -1
- package/dist/{index-rkphknhx.js → index-hpzhz1vm.js} +1 -1
- package/dist/{index-npfdymav.js → index-j5vzhj3d.js} +1 -1
- package/dist/{index-d3s070eh.js → index-jperyn0c.js} +1 -1
- package/dist/{index-yhwx4fwk.js → index-kzsetgh9.js} +1 -1
- package/dist/{index-x6sp5vpa.js → index-q4tr9vnf.js} +1 -1
- package/dist/{index-hce3hbdg.js → index-qj0sq69b.js} +6 -2
- package/dist/{index-v0j22shs.js → index-rg08syp1.js} +9 -6
- package/dist/{index-8vzh5wpv.js → index-rw1caff2.js} +14 -26
- package/dist/index-s8af9jqw.js +6 -0
- package/dist/{index-bgj9hbm3.js → index-sdppfbrh.js} +30 -16
- package/dist/{index-y0mwkgkf.js → index-shte29pg.js} +1086 -1055
- package/dist/{index-fec05c9k.js → index-ta0e2daw.js} +9 -7
- package/dist/{index-ht71v1ag.js → index-tb36xawm.js} +59 -44
- package/dist/{index-c0yym4a0.js → index-w7e402wx.js} +11 -105
- package/dist/{index-bvpevwt6.js → index-xnqab06h.js} +207 -202
- package/dist/index-xrbrvn15.js +147 -0
- package/dist/{index-ac3rfec5.js → index-y6wzzk2e.js} +21 -1
- package/dist/{index-3d2c45jn.js → index-yjx5jna7.js} +2 -2
- package/dist/internal/loopback-host.d.ts +8 -0
- package/dist/internal/loopback-host.d.ts.map +1 -0
- package/dist/internal/own-member.d.ts +7 -0
- package/dist/internal/own-member.d.ts.map +1 -0
- package/dist/internal/request.d.ts +17 -8
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/secret-shapes.d.ts +33 -4
- package/dist/internal/secret-shapes.d.ts.map +1 -1
- package/dist/json-schema/dialect.d.ts.map +1 -1
- package/dist/json-schema/keywords.d.ts +25 -6
- package/dist/json-schema/keywords.d.ts.map +1 -1
- package/dist/json-schema/string-format.d.ts.map +1 -1
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/observability/context.d.ts +4 -3
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/sanitize.d.ts.map +1 -1
- package/dist/observability/secret-values.d.ts +0 -9
- package/dist/observability/secret-values.d.ts.map +1 -1
- package/dist/server/context.d.ts +3 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +4 -3
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/event-bus.d.ts.map +1 -1
- package/dist/server/file.d.ts +11 -3
- package/dist/server/file.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +2 -2
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +12 -1
- package/dist/server/middleware/jwt.d.ts.map +1 -1
- package/dist/server/middleware/trust-fence.d.ts +4 -0
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart.d.ts +2 -3
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-body.d.ts +12 -1
- package/dist/server/request-body.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/types.d.ts +14 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts +4 -4
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts.map +1 -1
- package/dist/telegram/screens/test-chat.d.ts.map +1 -1
- package/dist/telegram/widget-api.d.ts +85 -13
- package/dist/telegram/widget-api.d.ts.map +1 -1
- package/dist/telegram/widget.d.ts +46 -2
- package/dist/telegram/widget.d.ts.map +1 -1
- package/dist/tools/cli/args-classify.d.ts +4 -74
- package/dist/tools/cli/args-classify.d.ts.map +1 -1
- package/dist/tools/cli/args-framework.d.ts +79 -0
- package/dist/tools/cli/args-framework.d.ts.map +1 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -1
- package/dist/tools/cli/args-tokens.d.ts.map +1 -1
- package/dist/tools/cli/checkpoint.d.ts +5 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/execute-handler.d.ts +24 -0
- package/dist/tools/execute-handler.d.ts.map +1 -0
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/mcp/round.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/flatten.d.ts.map +1 -1
- package/dist/tools/schema/inline-references.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -1
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tracking/privacy.d.ts.map +1 -1
- package/llms/agent-runtime-openrouter.txt +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 +1 -1
- package/llms/agent-runtime.txt +283 -36
- package/llms/application.txt +3 -1
- package/llms/http.txt +1 -1
- package/llms/live.txt +3 -1
- package/llms/observability.txt +16 -9
- package/llms/server.2.txt +13 -8
- package/llms/server.4.txt +23 -11
- package/llms/server.5.txt +5 -5
- package/llms/server.txt +54 -1
- package/llms/spend.txt +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 +994 -217
- package/llms.txt +13 -12
- 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,14 +1,348 @@
|
|
|
1
|
-
# Upgrading 0.
|
|
1
|
+
# Upgrading 0.130.0 → 0.136.0 — stitchkit docs slice
|
|
2
2
|
|
|
3
3
|
> Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
|
|
4
4
|
> `llms.txt` in this package.
|
|
5
5
|
|
|
6
|
-
Contains: Guide: Upgrading, 0.
|
|
6
|
+
Contains: Guide: Upgrading, 0.130.0 → 0.136.0 (docs/guide/upgrading.md)
|
|
7
7
|
|
|
8
8
|
==============================================================================
|
|
9
|
-
# Guide: Upgrading, 0.
|
|
9
|
+
# Guide: Upgrading, 0.130.0 → 0.136.0 (docs/guide/upgrading.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
+
## Released migration: 0.136.0
|
|
13
|
+
|
|
14
|
+
### trusted-proxy-chain
|
|
15
|
+
|
|
16
|
+
**Who must act:** applications passing `trustProxy` to `createServer`, `createHandler`, `serveNode`, `wrapInRequestContext`, `extractIp` or `getClientInfo`.
|
|
17
|
+
|
|
18
|
+
`trustProxy: true` believed the leftmost `x-forwarded-for` entry, which the client writes, so any visitor could claim `127.0.0.1` and pass a loopback rule. `trustProxy` now names the proxies you run; the client IP is read from the right, past every trusted proxy, and only when the socket peer is one of them:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// Before
|
|
22
|
+
createServer({ trustProxy: true, services })
|
|
23
|
+
|
|
24
|
+
// After — nginx on this host appends with $proxy_add_x_forwarded_for
|
|
25
|
+
import { isLoopbackAddress } from 'stitchkit/server'
|
|
26
|
+
createServer({ trustProxy: { trustedPeer: isLoopbackAddress }, services })
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For proxies on an internal network, pass a predicate over their addresses (`(address) => address.startsWith('10.0.')`, or a CIDR check). The proxy must append to `X-Forwarded-For`; `x-real-ip` is no longer read.
|
|
30
|
+
|
|
31
|
+
Inside a handler, read `ctx.ipAddress` — the framework already resolved it with the server's policy. Outside one, `extractIp` / `getClientInfo` need the real peer; without `socketIp` the header is ignored and the address is `''`:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
// Before
|
|
35
|
+
getClientInfo(req, { trustProxy: true })
|
|
36
|
+
|
|
37
|
+
// After
|
|
38
|
+
getClientInfo(req, { trustProxy: { trustedPeer: isLoopbackAddress }, socketIp: resolveSocketIp(req, server) })
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`wrapInRequestContext(fetch, { trustProxy: { trustedPeer } })` takes the same policy.
|
|
42
|
+
|
|
43
|
+
### json-body-default-limit
|
|
44
|
+
|
|
45
|
+
**Who must act:** applications whose endpoints accept JSON request bodies larger than 1 MiB without setting `maxJsonBodyBytes`.
|
|
46
|
+
|
|
47
|
+
An unset `maxJsonBodyBytes` used to mean "read the whole body", which let any client make the server buffer a body of its chosen size. It now means 1 MiB; a larger body is a `400 BAD_REQUEST` before the handler runs. Declare the size an endpoint really accepts:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// Before: no limit, any size accepted
|
|
51
|
+
importItems: { method: 'POST', path: '/import', desc: 'Import items', input: ImportSchema, output: ResultSchema }
|
|
52
|
+
|
|
53
|
+
// After: the endpoint names its ceiling (or set it once on createServer / createHandler)
|
|
54
|
+
importItems: { method: 'POST', path: '/import', desc: 'Import items', input: ImportSchema, output: ResultSchema, maxJsonBodyBytes: 8 * 1024 * 1024 }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
A route value wins over the handler value. Uploads belong in `multipart`, which has its own per-file limits.
|
|
58
|
+
|
|
59
|
+
### validation-error-is-input-only
|
|
60
|
+
|
|
61
|
+
**Who must act:** applications whose handlers throw a `ZodError` to refuse the caller's input, and applications whose own `onError` checks `instanceof ZodError`.
|
|
62
|
+
|
|
63
|
+
`VALIDATION_ERROR` 400 now comes only from the contract boundary — the endpoint's `params`, `input` and multipart fields. A `ZodError` thrown by handler code is answered as `INTERNAL_SERVER_ERROR` 500, because it is usually the server's own schema failing on an upstream answer or a stored row, and its paths are internal. To refuse the caller from inside a handler, say so:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// Before: a ZodError thrown here became a 400
|
|
67
|
+
const extra = ExtraSchema.parse(input.extra)
|
|
68
|
+
|
|
69
|
+
// After
|
|
70
|
+
const parsed = ExtraSchema.safeParse(input.extra)
|
|
71
|
+
if (!parsed.success) badRequest('extra is invalid', { issues: zodIssues(parsed.error) })
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A bespoke `onError` receives invalid input as an `AppError`, with the `ZodError` as `cause`:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
// Before
|
|
78
|
+
if (error instanceof ZodError) return validationFailed(zodIssues(error))
|
|
79
|
+
|
|
80
|
+
// After
|
|
81
|
+
if (AppError.is(error) && error.code === 'VALIDATION_ERROR') return validationFailed(error.details?.issues)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### safe-auth-defaults
|
|
85
|
+
|
|
86
|
+
**Who must act:** applications serving files whose names start with a dot through `staticRoute`, verifying JWTs that carry no `exp` with `verifyJwt`, or calling `verifyTelegramInitData` without `maxAgeSeconds` and accepting strings older than a day.
|
|
87
|
+
|
|
88
|
+
Three defaults stopped trusting what nobody bounded:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
// staticRoute: dot segments answer 404 — name the ones you publish
|
|
92
|
+
staticRoute('/', './public', { allowedDotNames: ['.well-known'] })
|
|
93
|
+
|
|
94
|
+
// verifyJwt: a token must carry exp — sign with a lifetime…
|
|
95
|
+
await signJwt(claims, secret, { expiresInSec: 3600 })
|
|
96
|
+
// …or accept a token whose lifetime you bound elsewhere
|
|
97
|
+
await verifyJwt(token, secret, { expiration: 'optional' })
|
|
98
|
+
|
|
99
|
+
// verifyTelegramInitData: one day unless you say otherwise
|
|
100
|
+
await verifyTelegramInitData({ initData, botToken, maxAgeSeconds: 7 * 86_400 })
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
There is no unbounded `maxAgeSeconds`: pass the longest lifetime your Mini App session needs.
|
|
104
|
+
|
|
105
|
+
### react-query-floor
|
|
106
|
+
|
|
107
|
+
**Who must act:** applications importing `stitchkit/react` with `@tanstack/react-query` older than 5.103.0.
|
|
108
|
+
|
|
109
|
+
`stitchkit/react` needs `environmentManager` (exported by `@tanstack/react-query` from 5.91.0) and `MutationCacheConfig` (from 5.103.0); the declared `>=5` admitted versions on which the entry did not load. Raise the dependency:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
bun add @tanstack/react-query@^5.103.0
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### openrouter-tts-formats
|
|
116
|
+
|
|
117
|
+
**Who must act:** applications passing `responseFormat: 'opus'`, `'aac'` or `'flac'` to `openRouterAudioSpeech` in `stitchkit/agent-runtime/openrouter`.
|
|
118
|
+
|
|
119
|
+
OpenRouter's `POST /audio/speech` accepts `mp3`, `pcm` (its default) and `wav` (Gemini TTS only); the other formats were typed but answered with a 400. `OpenRouterSpeechFormat` is now `'mp3' | 'pcm' | 'wav'`, and `openRouterAudioSpeech` refuses anything else before the request:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
// Before (typed, rejected by OpenRouter)
|
|
123
|
+
await openRouterAudioSpeech({ model, input, voice, responseFormat: 'flac' });
|
|
124
|
+
|
|
125
|
+
// After
|
|
126
|
+
await openRouterAudioSpeech({ model, input, voice, responseFormat: 'mp3' });
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### openrouter-stt-integer-speaker
|
|
130
|
+
|
|
131
|
+
**Who must act:** applications reading diarized `segments` / `words` from `openRouterAudioTranscription` in `stitchkit/agent-runtime/openrouter`.
|
|
132
|
+
|
|
133
|
+
OpenRouter returns a diarized speaker as a zero-based integer `speaker` plus an optional `speaker_label`. `openRouterAudioTranscription` now parses that shape and returns `segments` / `words` as typed projections (`OpenRouterTranscriptionSegment`, `OpenRouterTranscriptionWord`); the full wire objects stay on `raw`:
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
// Before (string speaker, wire objects with snake_case extras)
|
|
137
|
+
const who: string | undefined = result.words?.[0]?.speaker;
|
|
138
|
+
const logprob = result.segments?.[0]?.avg_logprob;
|
|
139
|
+
|
|
140
|
+
// After (integer index, provider label, wire extras on raw)
|
|
141
|
+
const who: number | undefined = result.words?.[0]?.speaker;
|
|
142
|
+
const label: string | undefined = result.words?.[0]?.speakerLabel;
|
|
143
|
+
const logprob = result.raw.segments?.[0]?.avg_logprob;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### openrouter-base-url-rule
|
|
147
|
+
|
|
148
|
+
**Who must act:** applications whose OpenRouter `baseUrl` uses plain `http:` to a non-loopback host, names the `/chat/completions` endpoint instead of the API root, or carries credentials, a query string or a fragment, in `stitchkit/agent-runtime/openrouter`; tests that derive a provider `baseUrl` from `createFaultProviderServer().url` in `stitchkit/agent-runtime/testing`.
|
|
149
|
+
|
|
150
|
+
Every OpenRouter path — `openRouterProvider`, the catalog and its cache, the spend helpers and the non-chat clients — now applies one rule: `https:`, or `http:` only to `localhost`, `127.0.0.0/8` or `[::1]`; no `user:pass@`, `?…` or `#…`. Move a gateway behind TLS (or onto loopback), and send what the query carried as a header:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
// Before (key in clear text to a remote host; the query rode along on every request)
|
|
154
|
+
openRouterProvider({ apiKey, baseUrl: 'http://gateway.internal/api/v1?team=a' });
|
|
155
|
+
|
|
156
|
+
// After
|
|
157
|
+
openRouterProvider({
|
|
158
|
+
apiKey,
|
|
159
|
+
baseUrl: 'https://gateway.internal/api/v1',
|
|
160
|
+
headers: { 'x-team': 'a' },
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`baseUrl` is the API root: every path appends its own endpoint (`/chat/completions`, `/models`, `/audio/speech`, …), so a `baseUrl` ending in `/chat/completions` is refused with a `TypeError` when the provider or client is created. Pass the root:
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
// Before
|
|
168
|
+
openRouterProvider({ apiKey, baseUrl: 'https://openrouter.ai/api/v1/chat/completions' });
|
|
169
|
+
|
|
170
|
+
// After
|
|
171
|
+
openRouterProvider({ apiKey, baseUrl: 'https://openrouter.ai/api/v1' });
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`createFaultProviderServer()` from `stitchkit/agent-runtime/testing` now answers `url` as that root (`http://127.0.0.1:<port>/v1`) instead of the `/v1/chat/completions` endpoint. Pass it to any provider as is; drop a path you derived from it:
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
// Before
|
|
178
|
+
anthropicProvider({ apiKey: 'test-key', baseUrl: new URL('/v1', server.url).toString() });
|
|
179
|
+
|
|
180
|
+
// After
|
|
181
|
+
anthropicProvider({ apiKey: 'test-key', baseUrl: server.url });
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### openrouter-one-transport
|
|
185
|
+
|
|
186
|
+
**Who must act:** applications that catch `OpenRouterHttpError`, type a fetch as `OpenRouterCatalogFetch`, read the request URL in a custom `OpenRouterFetch` as a string, catch the catalog's `RangeError` for an oversized body, or pass `fetcher` to `openRouterModelCatalog`, `loadOpenRouterCatalogSnapshot`, `fetchOpenRouterModelEndpoints`, `createOpenRouterCatalogCache` or `createOpenRouterSpendReconciler`, in `stitchkit/agent-runtime/openrouter`.
|
|
187
|
+
|
|
188
|
+
Chat, catalog, spend and non-chat clients share one transport and one error class. Check the status on `AgentProviderError`, use `OpenRouterFetch` everywhere, read its first argument as a `URL`, and pass it as `fetch` (the catalog, snapshot, cache and spend reconciler called it `fetcher`):
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
// Before
|
|
192
|
+
import { OpenRouterHttpError, type OpenRouterCatalogFetch } from 'stitchkit/agent-runtime/openrouter';
|
|
193
|
+
if (error instanceof OpenRouterHttpError && error.status === 404) return undefined;
|
|
194
|
+
const fetcher: OpenRouterCatalogFetch = (url) => fetch(url);
|
|
195
|
+
const custom: OpenRouterFetch = (input) => fetch((input as string).replace('/v1', '/v1beta'));
|
|
196
|
+
await loadOpenRouterCatalogSnapshot({ apiKey, fetcher });
|
|
197
|
+
|
|
198
|
+
// After
|
|
199
|
+
import { AgentProviderError } from 'stitchkit/agent-runtime';
|
|
200
|
+
import type { OpenRouterFetch } from 'stitchkit/agent-runtime/openrouter';
|
|
201
|
+
if (error instanceof AgentProviderError && error.statusCode === 404) return undefined;
|
|
202
|
+
const fetcher: OpenRouterFetch = (url) => fetch(url);
|
|
203
|
+
const custom: OpenRouterFetch = (url) => fetch(url.href.replace('/v1', '/v1beta'));
|
|
204
|
+
await loadOpenRouterCatalogSnapshot({ apiKey, fetch: fetcher });
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### deferred-tools-explicit-repair
|
|
208
|
+
|
|
209
|
+
**Who must act:** applications using `createDeferredAgentToolSurface` from `stitchkit/agent-runtime` that relied on inactive-call repair without passing `repairToolCall`.
|
|
210
|
+
|
|
211
|
+
The repair used to ride on the mounted tool set as a hidden property, which a spread of the search tool lost and which, across two merged mounts, always resolved to the first surface. It is now only the hook the controller returns; pass it where the loop takes `repairToolCall`. Without it, a call to a known but inactive tool fails like an unknown one instead of taking the `SEARCH_REQUIRED` round:
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
// Before (repair found on the mounted tools)
|
|
215
|
+
createAgentRuntime({
|
|
216
|
+
tools: (runContext) => deferred.mount(runContext, mountConfig),
|
|
217
|
+
loop: { prepareStep: deferred.prepareStep() },
|
|
218
|
+
});
|
|
219
|
+
await completeText({ driver, prompt, tools });
|
|
220
|
+
|
|
221
|
+
// After
|
|
222
|
+
createAgentRuntime({
|
|
223
|
+
tools: (runContext) => deferred.mount(runContext, mountConfig),
|
|
224
|
+
loop: { prepareStep: deferred.prepareStep(), repairToolCall: deferred.repairToolCall() },
|
|
225
|
+
});
|
|
226
|
+
await completeText({ driver, prompt, tools, repairToolCall: deferred.repairToolCall() });
|
|
227
|
+
|
|
228
|
+
// Two surfaces, the application's hook first
|
|
229
|
+
const repairToolCall = first.repairToolCall(second.repairToolCall(applicationRepairToolCall));
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### linux-deny-paths-inside-mounts
|
|
233
|
+
|
|
234
|
+
**Who must act:** Linux applications whose `createProcessSandbox` `denyPaths` name a path strictly inside a mounted directory (the workspace, `readOnlyPaths`, `writableDirs`, `privateTmpDir` or a system root such as `/usr`), in `stitchkit/agent-runtime/sandbox`.
|
|
235
|
+
|
|
236
|
+
Such a deny now fails `wrapCommand` with `SandboxError('SANDBOX_UNAVAILABLE')` naming the path and the mount: Bubblewrap could hide it only until the host renamed a file over it or created it after start. Move the secret out of every mounted tree, or deny a whole mounted path:
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
// Before (the mask was lost after an atomic rewrite of /srv/ws/.env on the host)
|
|
240
|
+
createProcessSandbox({ profile: 'workspace-strict', workspace: '/srv/ws', denyPaths: ['/srv/ws/.env'] });
|
|
241
|
+
|
|
242
|
+
// After: the secret lives outside the mounted workspace, where nothing is visible
|
|
243
|
+
createProcessSandbox({ profile: 'workspace-strict', workspace: '/srv/ws', denyPaths: ['/srv/secrets/.env'] });
|
|
244
|
+
|
|
245
|
+
// Or: deny the whole mounted directory, which is then replaced by an empty tmpfs
|
|
246
|
+
createProcessSandbox({
|
|
247
|
+
profile: 'workspace-strict',
|
|
248
|
+
workspace: '/srv/ws',
|
|
249
|
+
readOnlyPaths: ['/srv/shared'],
|
|
250
|
+
denyPaths: ['/srv/shared'],
|
|
251
|
+
});
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
macOS Seatbelt matches `denyPaths` by path and keeps accepting paths inside the workspace.
|
|
255
|
+
|
|
256
|
+
### sandbox-gateway-https-origins
|
|
257
|
+
|
|
258
|
+
**Who must act:** applications whose sandbox network policy (`createBubblewrapSandboxBackend` `create({ network })`, `setNetworkPolicy`, `createSandboxSession`) allows a plain-`http:` origin on a host other than `localhost`, `127.0.0.0/8` or `[::1]`, in `stitchkit/agent-runtime/sandbox`.
|
|
259
|
+
|
|
260
|
+
Such a policy is now refused when it is parsed (a `ZodError` at `allow[i].origin`): the gateway would send the rule's headers and the guest's request in clear text. Point the rule at the upstream's `https:` origin; guests keep speaking HTTP to the gateway socket, and the host establishes TLS:
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
// Before
|
|
264
|
+
await handle.session.setNetworkPolicy({
|
|
265
|
+
allow: [{ origin: 'http://api.internal', headers: { authorization: hostCredential } }],
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// After
|
|
269
|
+
await handle.session.setNetworkPolicy({
|
|
270
|
+
allow: [{ origin: 'https://api.internal', headers: { authorization: hostCredential } }],
|
|
271
|
+
});
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
An upstream without TLS stays reachable only through a loopback origin on the host (for example a local TLS-terminating proxy at `http://127.0.0.1:8080`).
|
|
275
|
+
|
|
276
|
+
### bubblewrap-no-nested-user-namespaces
|
|
277
|
+
|
|
278
|
+
**Who must act:** Linux applications in `stitchkit/agent-runtime/sandbox` (`createBubblewrapSandboxBackend`, `createProcessSandbox`) that run software needing its own user namespace inside the sandbox, or whose hosts run a setuid `bwrap` or cannot give Bubblewrap a user namespace.
|
|
279
|
+
|
|
280
|
+
Bubblewrap now starts with `--unshare-user --disable-userns`, so `unshare -U`, a nested `bwrap` or a browser's namespace sandbox fails inside the sandbox (`ENOSPC`). Run such software with its own namespace sandbox turned off, or outside the StitchKit sandbox. On a host where `probeProcessSandbox` now reports `available: false`, install the non-setuid `bwrap` and allow it unprivileged user namespaces (for example the distribution's AppArmor profile for `bwrap`); the sandbox has no mode without the lock. Check a host with:
|
|
281
|
+
|
|
282
|
+
```sh
|
|
283
|
+
bwrap --unshare-all --unshare-user --disable-userns --ro-bind /usr /usr --ro-bind /lib /lib --ro-bind-try /lib64 /lib64 -- /usr/bin/true && echo ok
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### stream-complete-parts-mode
|
|
287
|
+
|
|
288
|
+
**Who must act:** applications in `stitchkit/agent-runtime` that await `streamComplete(...).result` without iterating `parts`.
|
|
289
|
+
|
|
290
|
+
`streamComplete` no longer infers whether `parts` will be read from whether it was read before 64 parts had passed. By default it backpressures from the first part, so a late `for await` gets every part instead of an overflow error — and a run nobody reads pauses at the full buffer. Say result-only explicitly:
|
|
291
|
+
|
|
292
|
+
```ts
|
|
293
|
+
// Before (buffer dropped silently after 64 parts)
|
|
294
|
+
const { text } = await streamComplete({ driver, prompt, onPart }).result;
|
|
295
|
+
|
|
296
|
+
// After
|
|
297
|
+
const { text } = await streamComplete({ driver, prompt, onPart, parts: 'ignore' }).result;
|
|
298
|
+
// or, with no stream handle at all
|
|
299
|
+
const { text } = await completeText({ driver, prompt, onPart });
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### one-model-step-loop
|
|
303
|
+
|
|
304
|
+
**Who must act:** applications in `stitchkit/agent-runtime` that use `loop.retry` and expect a retry to start the run's model steps over (or `prepareStep` to run again for it), subscribers with a hand-written `attempt-reset` reducer, and standalone completions that rely on having no idle deadline.
|
|
305
|
+
|
|
306
|
+
The runtime and the standalone completions run one loop of model steps. A retry repeats the failed call of one step with the request already prepared; earlier steps and their tools stand. Code that counted `prepareStep` calls or reset state in `onAttemptDiscarded` for a fresh start sees one call per step instead:
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
// Before: a 503 in step 2 after a tool ran in step 1 ended the run as provider_failure;
|
|
310
|
+
// a 503 in step 0 re-ran prepareStep and every step from 0.
|
|
311
|
+
// After: the failed call of that step is resent as prepared; attempt counts that step's calls.
|
|
312
|
+
loop: {
|
|
313
|
+
retry: { maxAttempts: 3, delayMs: () => 500 },
|
|
314
|
+
onAttemptDiscarded: ({ attempt, reason }) => log.warn({ attempt, reason }),
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
A subscriber with its own reducer drops only what an `attempt-reset` withdraws — the failed call's tail — and keeps the earlier steps instead of clearing the run. Count from the end: a subscriber that joined mid-run holds less than the whole run.
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
// Before
|
|
322
|
+
case 'attempt-reset': return { text: '', reasoning: '' };
|
|
323
|
+
// After
|
|
324
|
+
case 'attempt-reset':
|
|
325
|
+
return event.withdrawn === undefined
|
|
326
|
+
? { text: '', reasoning: '' }
|
|
327
|
+
: {
|
|
328
|
+
text: view.text.slice(0, Math.max(0, view.text.length - event.withdrawn.text)),
|
|
329
|
+
reasoning: view.reasoning.slice(
|
|
330
|
+
0,
|
|
331
|
+
Math.max(0, view.reasoning.length - event.withdrawn.reasoning),
|
|
332
|
+
),
|
|
333
|
+
};
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Standalone completions now stop a silent provider after 60 000 ms, as the runtime does:
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
// Before (no deadline unless passed)
|
|
340
|
+
await completeText({ driver, prompt });
|
|
341
|
+
|
|
342
|
+
// After: same call, 60 s idle deadline; keep none explicitly
|
|
343
|
+
await completeText({ driver, prompt, idleTimeoutMs: null });
|
|
344
|
+
```
|
|
345
|
+
|
|
12
346
|
## Released migration: 0.135.0
|
|
13
347
|
|
|
14
348
|
### explicit-deadline-propagation
|
|
@@ -70,6 +404,21 @@ evaluateOpenRouterModelAdmission({
|
|
|
70
404
|
listOpenRouterModels(snapshot, { maxPromptUsdPerMillion: 6, maxCacheWriteUsdPerMillion: 6 });
|
|
71
405
|
```
|
|
72
406
|
|
|
407
|
+
### openrouter-strict-chat-stream-end
|
|
408
|
+
|
|
409
|
+
**Who must act:** applications pointing `openRouterProvider({ baseUrl })` from `stitchkit/agent-runtime/openrouter` at an OpenAI-compatible server whose Chat Completions stream ends after `finish_reason` with neither a usage chunk nor `data: [DONE]`. OpenRouter itself and servers that end with `data: [DONE]` need no change.
|
|
410
|
+
|
|
411
|
+
Since 0.135.0 such an ending is a stream cut: the step fails with a retryable `AgentProviderStreamCutError` (`classifyProviderFailure` → `reason: 'stream-cut'`) instead of finishing with the usage silently missing, so a retry policy retries it and a server that always ends that way fails every step. Make the server terminate its stream:
|
|
412
|
+
|
|
413
|
+
```text
|
|
414
|
+
// Before (accepted by 0.134.x, a stream cut since 0.135.0)
|
|
415
|
+
data: {"choices":[{"index":0,"delta":{"content":"Answer"},"finish_reason":"stop"}]}
|
|
416
|
+
|
|
417
|
+
// After (either ending completes the step)
|
|
418
|
+
data: {"choices":[{"index":0,"delta":{"content":"Answer"},"finish_reason":"stop"}]}
|
|
419
|
+
data: [DONE]
|
|
420
|
+
```
|
|
421
|
+
|
|
73
422
|
## Released migration: 0.134.0
|
|
74
423
|
|
|
75
424
|
### agent-runtime-native-model-port
|
|
@@ -81,7 +430,7 @@ listOpenRouterModels(snapshot, { maxPromptUsdPerMillion: 6, maxCacheWriteUsdPerM
|
|
|
81
430
|
#### Step 1 — Mechanical compatibility (keep existing AI SDK models and tools)
|
|
82
431
|
|
|
83
432
|
1. Rename `AgentLanguageModelProvider` to `AgentModelDriverFactory` and `AgentResolvedModel.model` to `AgentResolvedModel.driver`.
|
|
84
|
-
2. Wrap any AI SDK
|
|
433
|
+
2. Wrap any AI SDK `LanguageModel` (`ai@7`, specification `v4`) with `fromAiSdkModel` and any AI SDK `ToolSet` (including `mountAgent(...)`) with `fromAiSdkTools` from `stitchkit/agent-runtime/ai-sdk`.
|
|
85
434
|
3. Update `history.resolveFile` to return tagged `AgentModelFileData` (`{ type: 'data', data }`, `{ type: 'url', url }`, `{ type: 'reference', reference }`, or `{ type: 'text', text }`), and read `AgentGeneratedFile` (`file.mediaType`, `file.data`, `file.uint8Array`, `file.base64`, `file.url`) in `persistGeneratedFile`.
|
|
86
435
|
4. Update `prepareStep` and `stopPolicies` to read peer-free `AgentStepResult` / `AgentModelMessage` / `AgentInstructions`. `AgentRuntimeStopPolicy<CONTEXT>` now takes a single `<CONTEXT>` generic (removing the unused first generic), and all tool events in `AgentModelStreamPart` and `CompleteStreamPart` use unified `toolCallId`.
|
|
87
436
|
|
|
@@ -533,168 +882,3 @@ working. Until every executor is upgraded, the server sends `scope: 'session'`,
|
|
|
533
882
|
`0.131.0` added `plan` and `windows[].scope` to `planLimits` in `hello` the same way. The rule
|
|
534
883
|
and the table of every release are in the
|
|
535
884
|
[API reference](../api/reference.md#version-skew-between-an-executor-and-its-server) (ADR 0334).
|
|
536
|
-
|
|
537
|
-
## Released migration: 0.129.0
|
|
538
|
-
|
|
539
|
-
### codex-plan-window-keys
|
|
540
|
-
|
|
541
|
-
**Who must act:** every caller of `codexPlanWindows` or `createCodexDriver` (`status()`) from
|
|
542
|
-
`stitchkit/agent-executor/codex` that matches plan window names against `'primary'` or
|
|
543
|
-
`'secondary'`.
|
|
544
|
-
|
|
545
|
-
`codexPlanWindows` now unfolds the full `account/rateLimits/read` response envelope (including
|
|
546
|
-
per-model `rateLimitsByLimitId` buckets) as well as bare `RateLimitSnapshot` objects, keying each
|
|
547
|
-
window as `<limitId|limit>:<windowDurationMins>m` (falling back to `<limitId|limit>:<slot>` when
|
|
548
|
-
duration is absent, or `<limitId|limit>:<windowDurationMins>m:<slot>` when both slots share a
|
|
549
|
-
duration) and populating optional `windowDurationMins` and `label` on `PlanWindow`:
|
|
550
|
-
|
|
551
|
-
```ts
|
|
552
|
-
// before
|
|
553
|
-
const fiveHour = status.planLimits?.windows.find((w) => w.name === 'primary')
|
|
554
|
-
const weekly = status.planLimits?.windows.find((w) => w.name === 'secondary')
|
|
555
|
-
|
|
556
|
-
// after
|
|
557
|
-
const fiveHour = status.planLimits?.windows.find(
|
|
558
|
-
(w) => w.windowDurationMins === 300 || w.name === 'limit:primary',
|
|
559
|
-
)
|
|
560
|
-
const weekly = status.planLimits?.windows.find(
|
|
561
|
-
(w) => w.windowDurationMins === 10080 || w.name === 'limit:secondary',
|
|
562
|
-
)
|
|
563
|
-
```
|
|
564
|
-
|
|
565
|
-
## Released migration: 0.128.0
|
|
566
|
-
|
|
567
|
-
### invocation-payload-lifecycle
|
|
568
|
-
|
|
569
|
-
**Who must act:** every caller of `createModelInvocationLedger` from `stitchkit/agent-runtime`
|
|
570
|
-
that reads `readPayload`, reads `sent.artifactId` on `provider/request` or top-level `artifactId`
|
|
571
|
-
on `provider/response` (`ModelInvocationRecord`), passes `authorize` to `ModelInvocationConfig`,
|
|
572
|
-
or relies on `maxPayloadBytes` aborting the provider call.
|
|
573
|
-
|
|
574
|
-
1. **`readPayload` returns a discriminated status:** encrypted payloads redacted by
|
|
575
|
-
`purgePayloads` / `store.purgeExpiredPayloads` stay readable as `{ status: 'expired', expiredAt }`
|
|
576
|
-
while live payloads return `{ status: 'available', payload }`:
|
|
577
|
-
|
|
578
|
-
```ts
|
|
579
|
-
// before
|
|
580
|
-
const payload = await ledger.readPayload({ conversationId, artifactId }, ctx)
|
|
581
|
-
console.log(payload.payload)
|
|
582
|
-
|
|
583
|
-
// after
|
|
584
|
-
const result = await ledger.readPayload({ conversationId, artifactId }, ctx)
|
|
585
|
-
if (result.status === 'available') {
|
|
586
|
-
console.log(result.payload)
|
|
587
|
-
} else {
|
|
588
|
-
console.log('expired at', result.expiredAt)
|
|
589
|
-
}
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
2. **`sent.artifactId` (`provider/request`) and top-level `artifactId` (`provider/response`) are optional when oversized:** exceeding
|
|
593
|
-
`maxPayloadBytes` no longer aborts or prevents the provider call. Instead, the ledger omits the
|
|
594
|
-
encrypted body, records `payloadOmitted: 'max-payload-bytes'` (with `artifactId` absent and
|
|
595
|
-
`payloadSha256` preserved), and reports `InvocationPayloadTooLargeError` via `complete().receiptError`:
|
|
596
|
-
|
|
597
|
-
```ts
|
|
598
|
-
// before
|
|
599
|
-
const id: string = record.sent.artifactId
|
|
600
|
-
|
|
601
|
-
// after
|
|
602
|
-
if (record.sent.artifactId !== undefined) {
|
|
603
|
-
await ledger.readPayload({ conversationId, artifactId: record.sent.artifactId }, ctx)
|
|
604
|
-
} else if (record.sent.payloadOmitted === 'max-payload-bytes') {
|
|
605
|
-
// body was intentionally omitted past maxPayloadBytes
|
|
606
|
-
}
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
3. **`ModelInvocationConfig.authorize` handles `'purge-payloads'`:** if your `authorize` callback
|
|
610
|
-
switches exhaustively on `input.action`, handle the new `'purge-payloads'` variant alongside
|
|
611
|
-
`'complete'`, `'agent'`, `'read'`, and `'read-payload'` (single-argument `input: ModelInvocationAuthorizationInput` carrying `input.context`):
|
|
612
|
-
|
|
613
|
-
```ts
|
|
614
|
-
authorize: (input) => {
|
|
615
|
-
switch (input.action) {
|
|
616
|
-
case 'complete':
|
|
617
|
-
case 'agent':
|
|
618
|
-
case 'read':
|
|
619
|
-
case 'read-payload':
|
|
620
|
-
case 'purge-payloads':
|
|
621
|
-
return allow(input.context, input)
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
```
|
|
625
|
-
|
|
626
|
-
### cli-option-projections-error-field
|
|
627
|
-
|
|
628
|
-
**Who must act:** every caller of `extractCliGlobalOptions` or `scanCliInvocation` from
|
|
629
|
-
`stitchkit/cli` that caught a thrown `CliArgumentError` on call or on `.argv` access (→ ADR 0327).
|
|
630
|
-
|
|
631
|
-
Both projections now return malformed CLI syntax on an explicit `error?: CliArgumentError` field
|
|
632
|
-
with fail-closed empty routing fields (`argv: []` on `extractCliGlobalOptions`; `command: undefined`
|
|
633
|
-
and `commandTokens: []` on `scanCliInvocation`) instead of throwing on call or via a getter on `.argv`:
|
|
634
|
-
|
|
635
|
-
```ts
|
|
636
|
-
// before
|
|
637
|
-
let parsed
|
|
638
|
-
try {
|
|
639
|
-
parsed = extractCliGlobalOptions(argv, globals)
|
|
640
|
-
void parsed.argv
|
|
641
|
-
} catch (err) {
|
|
642
|
-
if (err instanceof CliArgumentError) {
|
|
643
|
-
parsed = { globals: {}, argv: [] }
|
|
644
|
-
} else {
|
|
645
|
-
throw err
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
// after
|
|
650
|
-
const parsed = extractCliGlobalOptions(argv, globals)
|
|
651
|
-
if (parsed.error) {
|
|
652
|
-
// handle parsed.error, or pass raw argv to createCli(...) for exit-code-2 reporting
|
|
653
|
-
}
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
### declaration-single-version
|
|
657
|
-
|
|
658
|
-
**Who must act:** every repository whose `project.json` is validated by `stitchkit/declaration`
|
|
659
|
-
and still carries `identity.version`, or whose server/CLI code reads `declaration.identity.version`.
|
|
660
|
-
|
|
661
|
-
The root `package.json` is the single source of truth for the repository version (whether SemVer or
|
|
662
|
-
CalVer). `ProjectIdentitySchema` no longer accepts `identity.version`:
|
|
663
|
-
|
|
664
|
-
```jsonc
|
|
665
|
-
// before (project.json)
|
|
666
|
-
{
|
|
667
|
-
"identity": {
|
|
668
|
-
"slug": "my-app",
|
|
669
|
-
"name": "My App",
|
|
670
|
-
"version": "0.1.0",
|
|
671
|
-
"description": { "en": "My App." }
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
// after (project.json)
|
|
676
|
-
{
|
|
677
|
-
"identity": {
|
|
678
|
-
"slug": "my-app",
|
|
679
|
-
"name": "My App",
|
|
680
|
-
"description": { "en": "My App." }
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
Read your application version from the root `package.json` for a single-version application — or
|
|
686
|
-
from the package's own `package.json` if that package is released independently — instead of
|
|
687
|
-
`identity.version` (for example, in OpenAPI `info.version`, MCP `serverInfo.version`, and
|
|
688
|
-
`createCli({ version })`).
|
|
689
|
-
|
|
690
|
-
### read-only-surface-inspection
|
|
691
|
-
|
|
692
|
-
**Who must act:** optional — hosts and test suites that currently mount a tool surface with
|
|
693
|
-
`access: { open: 'local-operator' }` solely for read-only surface inspection.
|
|
694
|
-
|
|
695
|
-
Pass `access: { inspect: true }` to `mountAgent`, `mountMcp`, `buildMcpServer`, `createToolInvoker`,
|
|
696
|
-
`createCli`, `createCliInvoker`, or `createDeferredAgentToolSurface().mount` whenever a caller only
|
|
697
|
-
needs catalogs, schemas, `--help`, `--schema`, or `commands`. Every tool execution fails closed with
|
|
698
|
-
`FORBIDDEN` before extensions, hooks, durability, multi-round resolvers, or auth run. Keep
|
|
699
|
-
`access: { gate }` for authenticated execution surfaces and `access: { open: 'local-operator' }` for
|
|
700
|
-
tests or local tools that genuinely execute handlers.
|
package/llms/upgrading.txt
CHANGED
|
@@ -11,7 +11,8 @@ Contains: Guide: Upgrading, general (docs/guide/upgrading.md)
|
|
|
11
11
|
|
|
12
12
|
Load this slice, then every range slice between your installed version and the target:
|
|
13
13
|
|
|
14
|
-
- 0.
|
|
14
|
+
- 0.130.0 → 0.136.0: `llms/upgrading-0.130.0-0.136.0.txt`
|
|
15
|
+
- 0.128.0 → 0.129.0: `llms/upgrading-0.128.0-0.129.0.txt`
|
|
15
16
|
- 0.127.0 → 0.127.0: `llms/upgrading-0.127.0.txt`
|
|
16
17
|
- 0.106.0 → 0.126.0: `llms/upgrading-0.106.0-0.126.0.txt`
|
|
17
18
|
- 0.96.0 → 0.105.0: `llms/upgrading-0.96.0-0.105.0.txt`
|