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
package/llms/server.4.txt
CHANGED
|
@@ -311,7 +311,11 @@ Use it as `createMcpHandler`'s `auth`, or inside `createAuthHook`'s `resolve`.
|
|
|
311
311
|
|
|
312
312
|
`verifyJwt(token, secret)` verifies an HS256 JWT and returns its payload, or
|
|
313
313
|
throws `unauthorized`. It pins the algorithm (the token's own `alg` can never
|
|
314
|
-
pick the scheme),
|
|
314
|
+
pick the scheme), checks `exp` and `nbf`, and **requires `exp`**: a token
|
|
315
|
+
without one would stay valid for as long as the secret does. Pass
|
|
316
|
+
`expiration: 'optional'` only for tokens whose lifetime you bound elsewhere (a
|
|
317
|
+
session row, a revocation list); a present `exp` is still enforced. Sign with
|
|
318
|
+
`signJwt(payload, secret, { expiresInSec })`.
|
|
315
319
|
|
|
316
320
|
```ts
|
|
317
321
|
import { verifyJwt, extractToken } from 'stitchkit/server'
|
|
@@ -378,7 +382,7 @@ import { env } from './env'
|
|
|
378
382
|
const result = await verifyTelegramInitData({
|
|
379
383
|
initData,
|
|
380
384
|
botToken: env.BOT_TOKEN,
|
|
381
|
-
maxAgeSeconds: 3600, //
|
|
385
|
+
maxAgeSeconds: 3600, // default: one day
|
|
382
386
|
})
|
|
383
387
|
if (!result.valid) {
|
|
384
388
|
// 'missing-hash' | 'signature-mismatch' | 'malformed' | 'expired'
|
|
@@ -401,9 +405,10 @@ A bot meets the same person as grammY's `ctx.from`, in Telegram's `snake_case`;
|
|
|
401
405
|
`parseTelegramUser(ctx.from)` gives the same `TelegramUser`, so one
|
|
402
406
|
`ensureAccount(user)` serves the Mini App and the chat.
|
|
403
407
|
|
|
404
|
-
`maxAgeSeconds`
|
|
405
|
-
|
|
406
|
-
|
|
408
|
+
`maxAgeSeconds` defaults to one day (`86400`): a signed string is otherwise a
|
|
409
|
+
credential that never expires, so there is no unbounded mode. Set the lifetime
|
|
410
|
+
your session is worth — shorter for a sign-in exchange, longer for a Mini App
|
|
411
|
+
kept open for days.
|
|
407
412
|
|
|
408
413
|
The module is server-only and pulls in no bot library — the token never belongs
|
|
409
414
|
in a browser bundle. `stitchkit/application/grammy` remains the lifecycle
|
|
@@ -866,21 +871,28 @@ const onError = createErrorHook({
|
|
|
866
871
|
Synchronous callbacks and renderers that declare fewer parameters continue to
|
|
867
872
|
work normally.
|
|
868
873
|
|
|
869
|
-
|
|
870
|
-
|
|
874
|
+
Input that fails the contract's `params` / `input` schema reaches `render` as
|
|
875
|
+
`VALIDATION_ERROR` 400 — a client fault is an honest 400, not a 500 — and the
|
|
871
876
|
offending fields arrive as structured `info.details.issues`, so your `render`
|
|
872
877
|
can surface them to a machine client without parsing the message.
|
|
873
878
|
|
|
879
|
+
Only the contract boundary produces `VALIDATION_ERROR`. A `ZodError` your
|
|
880
|
+
handler throws — parsing an upstream answer, a database row, a config value —
|
|
881
|
+
is the server's own schema failing: it is answered as `INTERNAL_SERVER_ERROR`
|
|
882
|
+
500 with the generic message, and the `ZodError` text goes to the log and the
|
|
883
|
+
audit row, never to the caller. To refuse the caller's input from inside a
|
|
884
|
+
handler, throw `badRequest(message, details)` (or an `AppError`) yourself.
|
|
885
|
+
|
|
874
886
|
If you write a **bespoke** `onError` instead of using `createErrorHook`, run the
|
|
875
|
-
thrown value through the exported `normalizeError` to get the same classification
|
|
876
|
-
|
|
877
|
-
|
|
887
|
+
thrown value through the exported `normalizeError` to get the same classification.
|
|
888
|
+
Invalid input reaches your hook as an `AppError` with code `VALIDATION_ERROR`,
|
|
889
|
+
its `details.issues` and the `ZodError` as `cause`:
|
|
878
890
|
|
|
879
891
|
```ts
|
|
880
892
|
import { normalizeError } from 'stitchkit/server'
|
|
881
893
|
|
|
882
894
|
onError: (ctx, err) => {
|
|
883
|
-
const e = normalizeError(err) //
|
|
895
|
+
const e = normalizeError(err) // AppError as is (VALIDATION_ERROR 400 for input), else generic 500
|
|
884
896
|
return jsonError(e.code, e.status, e.message)
|
|
885
897
|
}
|
|
886
898
|
```
|
package/llms/server.5.txt
CHANGED
|
@@ -52,7 +52,7 @@ Also re-exports the error helpers from `stitchkit/contract`.
|
|
|
52
52
|
| `RegistryHandlers` | _type_ | exact backend handler registry inferred from a contract registry |
|
|
53
53
|
| `ExactRegistryHandlers` | _type_ | fail-first handler shape that rejects extra registry and endpoint keys |
|
|
54
54
|
| `staticRoute` | function | a raw route that serves a contained directory through `serveFile` (`Range` / `304` / validators) |
|
|
55
|
-
| `StaticRouteOptions` | _type_ | `{ cacheControl }` — what `staticRoute` adds to every file it serves |
|
|
55
|
+
| `StaticRouteOptions` | _type_ | `{ cacheControl, allowedDotNames }` — what `staticRoute` adds to every file it serves, and which dot-segment names it serves (none by default) |
|
|
56
56
|
| `serveFile` | function | serve a file with `Range` / `304` / `HEAD` — [guide](../guide/server.md#serving-files--range-requests) |
|
|
57
57
|
| `parseByteRange` | function | parse a single `Range` header → range / `unsatisfiable` / `null` |
|
|
58
58
|
| `isWithinDir` | function | path containment — `(root, resolvedTarget) => boolean`; call it before `serveFile` on any URL-derived path |
|
|
@@ -61,7 +61,7 @@ Also re-exports the error helpers from `stitchkit/contract`.
|
|
|
61
61
|
| `ByteRange` | _type_ | an inclusive `{ start, end }` byte range |
|
|
62
62
|
| `respondJson` | function | a raw route's JSON response (`204` for null/undefined) |
|
|
63
63
|
| `errorResponse` | function | any thrown value → the framework error envelope + `x-request-id` |
|
|
64
|
-
| `normalizeError` | function | any thrown value → an `AppError` (`
|
|
64
|
+
| `normalizeError` | function | any thrown value → an `AppError` (an `AppError` as is — contract input failures arrive as `VALIDATION_ERROR` 400 with structured `details.issues`; anything else, a `ZodError` from handler code included, generic 500) — the framework's canonical classification, for a bespoke `onError` |
|
|
65
65
|
| `NormalizeErrorOptions` | _type_ | `logUnexpected` defaults to logging the raw server-side cause; tool adapters disable process dumps while their existing observers retain that cause |
|
|
66
66
|
| `errorCode` | function | the stable error code for a thrown value (side-effect-free — for log attribution) |
|
|
67
67
|
| `formatZodError` | function | a `ZodError` → a readable, field-summarised string |
|
|
@@ -110,7 +110,7 @@ Also re-exports the error helpers from `stitchkit/contract`.
|
|
|
110
110
|
| `ResolvedError` | _type_ | the normalised error handed to `createErrorHook`'s `render` |
|
|
111
111
|
| `createBearerResolver` | function | a bearer-token identity resolver |
|
|
112
112
|
| `signJwt` | function | sign an HS256 JWT |
|
|
113
|
-
| `VerifyJwtOptions` | _type_ | options for `verifyJwt` |
|
|
113
|
+
| `VerifyJwtOptions` | _type_ | options for `verifyJwt` — `leewaySeconds`, `issuer`, `audience`, `expiration` (`'required'` by default) |
|
|
114
114
|
| `verifyJwt` | function | verify an HS256 JWT |
|
|
115
115
|
| `signLink` / `SignLinkOptions` | function / _type_ | a short-lived link for a request that cannot carry a header (`<audio src>`, `<img src>`): appends `expires` and an HMAC-SHA-256 `signature` over the method, path and every query parameter — [guide](../guide/auth-and-errors.md#signed-links) |
|
|
116
116
|
| `verifySignedLink` / `VerifySignedLinkOptions` | function / _type_ | check a request against its link (signature compared with a constant-time comparison, then expiry); call it from `createAuthHook`'s `resolve` or a raw route |
|
|
@@ -221,11 +221,11 @@ Also re-exports the error helpers from `stitchkit/contract`.
|
|
|
221
221
|
| `resolveTraceId` | function | the default per-request trace-id resolver |
|
|
222
222
|
| `extractIp` | function | the caller IP from a request |
|
|
223
223
|
| `isPublicIp` | function | whether an address belongs to the public internet; anything unparseable is not |
|
|
224
|
-
| `resolveSocketIp` | function | the
|
|
224
|
+
| `resolveSocketIp` | function | the real socket peer IP from the runtime (`server.requestIP` on Bun, `req.ip` under `srvx`); headers are not read |
|
|
225
225
|
| `getClientInfo` | function | caller IP + user-agent |
|
|
226
226
|
| `EventBus` | _type_ | the `createEventBus` handle |
|
|
227
227
|
| `RateLimitConfig` | _type_ | config for `createRateLimiter` |
|
|
228
|
-
| `ClientIpOptions` | _type_ | trusted-proxy config for `extractIp` / `
|
|
228
|
+
| `ClientIpOptions` | _type_ | socket peer and trusted-proxy config for `extractIp` / `getClientInfo` |
|
|
229
229
|
| `StreamingRouteOptions` | _type_ | options for `streamingRoute` / `ndjsonRoute` / `sseRoute` |
|
|
230
230
|
| `StreamingSourceContext` | _type_ | what a streaming source is given, including the cancellation `signal` |
|
|
231
231
|
| `StreamingFormat` | _type_ | `'ndjson' \| 'sse'` |
|
package/llms/server.txt
CHANGED
|
@@ -151,8 +151,10 @@ To type `ctx` with your app's extras (the user an auth hook injects), fix the
|
|
|
151
151
|
context type once:
|
|
152
152
|
|
|
153
153
|
```ts
|
|
154
|
+
import type { RuntimeContext } from 'stitchkit'
|
|
154
155
|
import { createImplement } from 'stitchkit/server'
|
|
155
156
|
|
|
157
|
+
interface User { id: string; name: string }
|
|
156
158
|
interface AppContext extends RuntimeContext { user: User | null }
|
|
157
159
|
|
|
158
160
|
export const implement = createImplement<AppContext>()
|
|
@@ -168,7 +170,20 @@ there. `createScopedImplement` types each handler by its endpoint's **effective*
|
|
|
168
170
|
scope instead — the endpoint's own `scope`, else the contract's:
|
|
169
171
|
|
|
170
172
|
```ts
|
|
173
|
+
import { defineContract } from 'stitchkit'
|
|
171
174
|
import { createScopedImplement } from 'stitchkit/server'
|
|
175
|
+
import { z } from 'zod'
|
|
176
|
+
|
|
177
|
+
const Post = z.object({ id: z.string(), title: z.string() })
|
|
178
|
+
|
|
179
|
+
const postsContract = defineContract({ prefix: 'posts', scope: 'user' }, {
|
|
180
|
+
list: { method: 'GET', path: '/', desc: 'List my posts', output: z.array(Post) },
|
|
181
|
+
purge: { method: 'DELETE', path: '/', desc: 'Purge all posts', scope: 'admin', output: z.array(Post) },
|
|
182
|
+
ping: { method: 'GET', path: '/ping', desc: 'Health check', scope: 'public', output: z.object({ ok: z.boolean() }) },
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
declare function listPosts(userId: string): Array<z.infer<typeof Post>>
|
|
186
|
+
declare function purge(): Array<z.infer<typeof Post>>
|
|
172
187
|
|
|
173
188
|
export const implementFor = createScopedImplement<{
|
|
174
189
|
public: object // no extra fields
|
|
@@ -344,7 +359,7 @@ server. See [Testing & deployment](./testing-and-deployment.md).
|
|
|
344
359
|
| `groups` | route groups — a shared path prefix and hooks (see below) |
|
|
345
360
|
| `scopePrefixes` | `scope → path prefix` map — mount `services` by `service.scope` (see below) |
|
|
346
361
|
| `rawRoutes` | non-contract routes (see below) |
|
|
347
|
-
| `maxJsonBodyBytes` |
|
|
362
|
+
| `maxJsonBodyBytes` | JSON body cap in bytes, **1 MiB by default**; a per-route value overrides it; a larger body is refused with `400 BAD_REQUEST` before it is buffered or parsed |
|
|
348
363
|
| `port` / `hostname` | listen address — port defaults to `3000` |
|
|
349
364
|
| `unix` | listen on a unix domain socket instead of TCP — `'/run/app.sock'` or `{ path, mode }` (see below) |
|
|
350
365
|
| `cors` | CORS policy — `{ origin, credentials, methods, headers, exposeHeaders }`. `origin` is **required** when `cors` is present: pass an explicit origin (or list), or `'*'` to deliberately allow every origin — an origin-less config is a construction error, never a silent wildcard. `origin` may also be a function that answers each request origin with or without credentials ([below](#cors-decided-per-request)). Omit `cors` entirely to emit no CORS headers. |
|
|
@@ -352,6 +367,7 @@ server. See [Testing & deployment](./testing-and-deployment.md).
|
|
|
352
367
|
| `logging` | `true` for built-in request logs, or a `LoggingConfig` (see below) |
|
|
353
368
|
| `traceId` | override per-request trace-id resolution — may return `undefined` to fall back |
|
|
354
369
|
| `wrapFetch` | compose wrappers around the finished handler (request context, audit) |
|
|
370
|
+
| `trustProxy` | client IP behind proxies you run: `{ trustedPeer(address) }`; `x-forwarded-for` is read right to left from a trusted socket peer ([below](#client-ip-behind-a-proxy)); unset, `ctx.ipAddress` is the socket peer |
|
|
355
371
|
| `proxyOrigin` | Bun TCP ingress policy: `{ trustedPeer(socketIp) }` restores the external scheme before all composition; independent of client-IP `trustProxy` |
|
|
356
372
|
| `socket` | full StitchKit Socket.IO handle; route, default WebSocket handler and shutdown are mounted once |
|
|
357
373
|
| `websocket` | custom Bun WebSocket handler; with `socket`, this is the explicit composed handler |
|
|
@@ -402,6 +418,43 @@ createServer({
|
|
|
402
418
|
- A `safelistedBody` endpoint reads a `text/plain` body only from an origin
|
|
403
419
|
granted with credentials ([below](#safelisted-request-bodies-beacons)).
|
|
404
420
|
|
|
421
|
+
### Client IP behind a proxy
|
|
422
|
+
|
|
423
|
+
Without `trustProxy`, `ctx.ipAddress` is the real socket peer and no header can
|
|
424
|
+
change it. Behind a reverse proxy that peer is the proxy, so name the proxies you
|
|
425
|
+
run:
|
|
426
|
+
|
|
427
|
+
```ts
|
|
428
|
+
import { createServer, isLoopbackAddress } from 'stitchkit/server'
|
|
429
|
+
|
|
430
|
+
const server = createServer({
|
|
431
|
+
hostname: '127.0.0.1',
|
|
432
|
+
trustProxy: { trustedPeer: isLoopbackAddress }, // nginx on this host
|
|
433
|
+
services,
|
|
434
|
+
})
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
`x-forwarded-for` is read only when the socket peer is a trusted proxy, and then
|
|
438
|
+
from the **right**: each proxy appends the address it received the request from,
|
|
439
|
+
so the rightmost entries are written by your proxies and the leftmost by the
|
|
440
|
+
client. The first address `trustedPeer` does not accept is the client; when every
|
|
441
|
+
hop is trusted, the leftmost one is. A hop that is not an IP address makes the
|
|
442
|
+
client unknown (`ctx.ipAddress` is `undefined`), never a guess. `x-real-ip` is
|
|
443
|
+
not read — it carries no chain to check.
|
|
444
|
+
|
|
445
|
+
The proxy must **append** (nginx: `proxy_set_header X-Forwarded-For
|
|
446
|
+
$proxy_add_x_forwarded_for;`). For a chain of proxies, `trustedPeer` accepts each
|
|
447
|
+
of them — a CIDR check for an internal network, for example. The same option
|
|
448
|
+
exists on `wrapInRequestContext` and on `extractIp` / `getClientInfo`, which also
|
|
449
|
+
need the real peer: pass `socketIp: resolveSocketIp(req, server)`; without it the
|
|
450
|
+
header is ignored and the answer is `''`.
|
|
451
|
+
|
|
452
|
+
⚠️ **A proxy on the same host makes every request loopback.** Without
|
|
453
|
+
`trustProxy`, a server behind nginx on `127.0.0.1` sees `127.0.0.1` as the peer of
|
|
454
|
+
every visitor, so a rule like `isLoopbackAddress(ctx.ipAddress)` admits the whole
|
|
455
|
+
internet. Either configure `trustProxy` so the visitor's address is resolved, or
|
|
456
|
+
listen where the proxy cannot forward the privileged operation.
|
|
457
|
+
|
|
405
458
|
### External origin behind a trusted proxy
|
|
406
459
|
|
|
407
460
|
An HTTPS ingress often forwards plain HTTP to Bun. `trustProxy` trusts client-IP
|
package/llms/spend.txt
CHANGED
|
@@ -142,6 +142,7 @@ test('every model call goes through the spend gateway', async () => {
|
|
|
142
142
|
module: 'stitchkit/agent-runtime/openrouter',
|
|
143
143
|
symbols: [
|
|
144
144
|
'openRouterProvider',
|
|
145
|
+
'createOpenRouterClient',
|
|
145
146
|
'openRouterRequestJson',
|
|
146
147
|
'openRouterRequestStream',
|
|
147
148
|
'openRouterSystemOne',
|
package/llms/stitchkit.2.txt
CHANGED
|
@@ -712,7 +712,7 @@ call, over HTTP or a Unix socket alike:
|
|
|
712
712
|
import { withContractIdentity } from 'stitchkit/server'
|
|
713
713
|
createServer({ services: withContractIdentity(services) })
|
|
714
714
|
|
|
715
|
-
// client
|
|
715
|
+
// client (`stitchkit/http` exports the same function for React Native/Hermes)
|
|
716
716
|
import { readContractIdentity } from 'stitchkit'
|
|
717
717
|
const { client, server } = await readContractIdentity(contracts, config)
|
|
718
718
|
if (server === undefined) {
|
|
@@ -1049,7 +1049,9 @@ character split across chunks is never torn. A line that crosses `maxLineBytes`
|
|
|
1049
1049
|
retains at most the limit, however long the line. With `finalLine: 'require-newline'`, a source
|
|
1050
1050
|
that ends inside a line throws `StreamTruncatedLineError` (`lineBytes`) instead of yielding the
|
|
1051
1051
|
fragment as a value — the right policy for a socket or a child process, where a missing newline
|
|
1052
|
-
means the writer died. Both errors extend the `RangeError` / `SyntaxError` they replace
|
|
1052
|
+
means the writer died. Both errors extend the `RangeError` / `SyntaxError` they replace, and
|
|
1053
|
+
both are exported from `stitchkit` and `stitchkit/http`, so a React Native client checks a contract
|
|
1054
|
+
stream's failure without importing the root entry.
|
|
1053
1055
|
|
|
1054
1056
|
## Reading a body up to a byte limit
|
|
1055
1057
|
|
package/llms/stitchkit.txt
CHANGED
|
@@ -56,87 +56,87 @@ own, recorded as an ADR.
|
|
|
56
56
|
|
|
57
57
|
| Import | Use in | Maturity | Holds |
|
|
58
58
|
|--------|--------|----------|-------|
|
|
59
|
-
| `stitchkit` | browser **and** server | stable<br>_redefined in 6 of the
|
|
60
|
-
| `stitchkit/http` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 3 of the
|
|
61
|
-
| `stitchkit/realtime` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 1 of the
|
|
62
|
-
| `stitchkit/device-relay` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 0 of the
|
|
63
|
-
| `stitchkit/contract` | browser **and** server | stable<br>_redefined in
|
|
64
|
-
| `stitchkit/live` | browser **and** server | evolving<br>_redefined in 2 of the
|
|
65
|
-
| `stitchkit/primitives` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
66
|
-
| `stitchkit/handler` | browser, React Native/Hermes **and** server | evolving<br>_redefined in
|
|
67
|
-
| `stitchkit/server` | server (Bun) | stable<br>_redefined in
|
|
68
|
-
| `stitchkit/node` | server (Node ≥ 22.3) | stable<br>_redefined in
|
|
69
|
-
| `stitchkit/tools` | server | stable<br>_redefined in
|
|
70
|
-
| `stitchkit/tools/mcp` | server (Bun or Node) | evolving<br>_redefined in 3 of the
|
|
71
|
-
| `stitchkit/tools/agent` | server (Bun or Node) | evolving<br>_redefined in 2 of the
|
|
72
|
-
| `stitchkit/tools/toolkit` | server (Bun or Node) | evolving<br>_redefined in 2 of the
|
|
73
|
-
| `stitchkit/tools/contract` | browser + server | evolving<br>_redefined in 2 of the
|
|
74
|
-
| `stitchkit/tools/invoker` | server | stable<br>_redefined in 3 of the
|
|
75
|
-
| `stitchkit/tools/connections` | server (Bun or Node) | evolving<br>_redefined in 3 of the
|
|
76
|
-
| `stitchkit/cli` | server | stable<br>_redefined in 12 of the
|
|
77
|
-
| `stitchkit/cli/publish` | build and release tooling (Bun or Node, POSIX) | evolving<br>_redefined in 0 of the
|
|
78
|
-
| `stitchkit/remote` | browser **and** server | stable<br>_redefined in 1 of the
|
|
79
|
-
| `stitchkit/process` | server (Bun or Node, POSIX) | evolving<br>_redefined in 4 of the
|
|
80
|
-
| `stitchkit/process/bootstrap` | bundled server entry (Bun, POSIX) | evolving<br>_redefined in 0 of the
|
|
81
|
-
| `stitchkit/files/packaging` | build time (Bun or Node) | evolving<br>_redefined in 4 of the
|
|
82
|
-
| `stitchkit/files` | server (Bun or Node) | stable<br>_redefined in 5 of the
|
|
83
|
-
| `stitchkit/spend` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
84
|
-
| `stitchkit/spend/testing` | tests on Bun or Node | evolving<br>_redefined in 0 of the
|
|
85
|
-
| `stitchkit/service-host` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
86
|
-
| `stitchkit/service-host/macos` | server (Bun or Node, macOS) | evolving<br>_redefined in 0 of the
|
|
87
|
-
| `stitchkit/service-host/work` | server (Bun or Node; Linux with systemd ≥ 254, or a process root on Linux and macOS) | evolving<br>_redefined in 0 of the
|
|
88
|
-
| `stitchkit/telegram` | server (Bun or Node) | evolving<br>_redefined in
|
|
89
|
-
| `stitchkit/telegram/grammy` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
90
|
-
| `stitchkit/telegram/html` | browser and server | evolving<br>_redefined in 1 of the
|
|
91
|
-
| `stitchkit/telegram/voice` | browser and server | evolving<br>_redefined in 0 of the
|
|
92
|
-
| `stitchkit/telegram/screens` | server (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
93
|
-
| `stitchkit/tracking` | browser **and** server | evolving<br>_redefined in 3 of the
|
|
94
|
-
| `stitchkit/tracking/contract` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
95
|
-
| `stitchkit/tracking/performance` | browser **and** server | evolving<br>_redefined in 1 of the
|
|
96
|
-
| `stitchkit/tracking/server` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
97
|
-
| `stitchkit/release` | browser **and** server | evolving<br>_redefined in 1 of the
|
|
98
|
-
| `stitchkit/voice` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
99
|
-
| `stitchkit/sync` | browser **and** server | evolving<br>_redefined in 1 of the
|
|
100
|
-
| `stitchkit/sync/postgres` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
101
|
-
| `stitchkit/geo` | server (Bun or Node) | evolving<br>_redefined in 2 of the
|
|
102
|
-
| `stitchkit/geo/contract` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
103
|
-
| `stitchkit/xlsx` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
104
|
-
| `stitchkit/oauth` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
105
|
-
| `stitchkit/google` | server (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
106
|
-
| `stitchkit/observability` | server | stable<br>_redefined in
|
|
107
|
-
| `stitchkit/testing` | tests on Bun or Node | stable<br>_redefined in 3 of the
|
|
108
|
-
| `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
109
|
-
| `stitchkit/react` | browser + server rendering | stable<br>_redefined in
|
|
110
|
-
| `stitchkit/react/keyboard` | browser | evolving<br>_redefined in 1 of the
|
|
111
|
-
| `stitchkit/react/keyboard/testing` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
112
|
-
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in
|
|
113
|
-
| `stitchkit/agent-runtime/sandbox` | server | evolving<br>_redefined in
|
|
114
|
-
| `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving<br>_redefined in
|
|
115
|
-
| `stitchkit/agent-runtime/harness` | server | evolving<br>_redefined in 1 of the
|
|
116
|
-
| `stitchkit/agent-runtime/coding-tools` | server (Bun or Node) | evolving<br>_redefined in 3 of the
|
|
117
|
-
| `stitchkit/agent-runtime/openrouter` | server | evolving<br>_redefined in
|
|
118
|
-
| `stitchkit/agent-runtime/openai` | server | evolving<br>_redefined in 0 of the
|
|
119
|
-
| `stitchkit/agent-runtime/anthropic` | server | evolving<br>_redefined in 0 of the
|
|
120
|
-
| `stitchkit/agent-runtime/ai-sdk` | server | evolving<br>_redefined in 0 of the
|
|
121
|
-
| `stitchkit/agent-runtime/browser` | browser + server | evolving<br>_redefined in 2 of the
|
|
122
|
-
| `stitchkit/agent-runtime/react` | browser + server | evolving<br>_redefined in 0 of the
|
|
123
|
-
| `stitchkit/agent-runtime/realtime` | server (Bun or Node) | evolving<br>_redefined in 2 of the
|
|
124
|
-
| `stitchkit/agent-executor` | server (Bun or Node) | evolving<br>_redefined in 4 of the
|
|
125
|
-
| `stitchkit/agent-executor/claude` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
126
|
-
| `stitchkit/agent-executor/claude-sdk` | server (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
127
|
-
| `stitchkit/agent-executor/acp` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
128
|
-
| `stitchkit/agent-executor/codex` | server (Bun or Node) | evolving<br>_redefined in 3 of the
|
|
129
|
-
| `stitchkit/agent-executor/testing` | server (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
130
|
-
| `stitchkit/agent-executor/testing/claude-sdk` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
131
|
-
| `stitchkit/agent-runtime/postgres` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
132
|
-
| `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving<br>_redefined in 1 of the
|
|
133
|
-
| `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving<br>_redefined in 1 of the
|
|
59
|
+
| `stitchkit` | browser **and** server | stable<br>_redefined in 6 of the 43 minors since 0.94.0, most recently 0.135.0_ | `defineContract`, `createClient`, `createHttpClient`, `createSocketIOClient`, `parseSSE`, the error model |
|
|
60
|
+
| `stitchkit/http` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.135.0_ | typed HTTP client factories, `ApiError`, `readContractIdentity` and the stream line errors, without optional realtime peers |
|
|
61
|
+
| `stitchkit/realtime` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | typed realtime clients, binding to an existing socket and retained topics with a required explicit Socket.IO peer loader |
|
|
62
|
+
| `stitchkit/device-relay` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 0 of the 3 minors since 0.134.0_ | peer-free User Device Relay over realtime — `createDeviceRelayHub`, `createDeviceRelayAgent`, `createMemoryRelayBroker`, `deviceRelayRealtimeContract`, Fetch-compatible unary RPC and credit-paced cursor streams |
|
|
63
|
+
| `stitchkit/contract` | browser **and** server | stable<br>_redefined in 6 of the 43 minors since 0.94.0, most recently 0.136.0_ | the contract layer alone — `defineContract`, errors, pagination |
|
|
64
|
+
| `stitchkit/live` | browser **and** server | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.127.0_ | `defineEvents` — topic declarations beside the operation contract — and watched reads: `createWatchClient`, the value/difference frame and its reassembly |
|
|
65
|
+
| `stitchkit/primitives` | browser **and** server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | generic values and declarations for lifecycle, access, audit, delivery and exports, exact money and rounding tables |
|
|
66
|
+
| `stitchkit/handler` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 1 of the 10 minors since 0.127.0, most recently 0.136.0_ | portable `createHandler`, `implement`, errors and `serveBridge` over a string `postMessage` port, with no Node built-ins |
|
|
67
|
+
| `stitchkit/server` | server (Bun) | stable<br>_redefined in 6 of the 43 minors since 0.94.0, most recently 0.136.0_ | `createServer`, `implement`, hooks, auth, Socket.IO server, server primitives |
|
|
68
|
+
| `stitchkit/node` | server (Node ≥ 22.3) | stable<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.136.0_ | `serveNode` + the runtime-agnostic core — the Node mirror of `/server` |
|
|
69
|
+
| `stitchkit/tools` | server | stable<br>_redefined in 13 of the 43 minors since 0.94.0, most recently 0.136.0_ | the transport-neutral tool layer — `mountAgentTools`, `defineAgentTool`, registry, tool names and manifest, runtime tools, native tools, the OAuth provider, the durability engine; loads no optional peer at runtime |
|
|
70
|
+
| `stitchkit/tools/mcp` | server (Bun or Node) | evolving<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | the canonical MCP HTTP/stdio server, schemas and typed MCP presenters; only Zod and the MCP server SDK peers |
|
|
71
|
+
| `stitchkit/tools/agent` | server (Bun or Node) | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.134.0_ | `mountAgent` — thin AI SDK `ToolSet` adapter over `mountAgentTools` for apps driving their own SDK loop; only Zod and the `ai` peer |
|
|
72
|
+
| `stitchkit/tools/toolkit` | server (Bun or Node) | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.135.0_ | `createToolkit` — context-pinned MCP, peer-free agent (`mountAgentTools`), and CLI mounts; only the MCP server SDK peer (no `ai` peer) |
|
|
73
|
+
| `stitchkit/tools/contract` | browser + server | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.124.0_ | the shapes a tool surface speaks — async-operation contract, snapshot and cancel schemas, view-file input/output — without the runtime that serves them |
|
|
74
|
+
| `stitchkit/tools/invoker` | server | stable<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | peer-free `createToolInvoker` over the canonical contract tool runner |
|
|
75
|
+
| `stitchkit/tools/connections` | server (Bun or Node) | evolving<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | consume external MCP servers and a bounded OpenAPI subset — typed reauthorization, a per-request host fence and per-call credentials |
|
|
76
|
+
| `stitchkit/cli` | server | stable<br>_redefined in 12 of the 43 minors since 0.94.0, most recently 0.128.0_ | `createCli` / `createCliInvoker` — runtime and strict NodeNext declarations without MCP SDK / `ai` |
|
|
77
|
+
| `stitchkit/cli/publish` | build and release tooling (Bun or Node, POSIX) | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | `publishCli` — commit a verified CLI distribution and move its public manifest last; see [CLI guide](cli.md#publishing-a-complete-version) |
|
|
78
|
+
| `stitchkit/remote` | browser **and** server | stable<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.104.0_ | peer-free `implementRemote` for thin HTTP proxy processes |
|
|
79
|
+
| `stitchkit/process` | server (Bun or Node, POSIX) | evolving<br>_redefined in 4 of the 43 minors since 0.94.0, most recently 0.133.0_ | finite native commands, byte sinks, bounded capture, process-group cancellation and opt-in Linux/Darwin owner-loss cleanup; contract operations executed in one-call child processes |
|
|
80
|
+
| `stitchkit/process/bootstrap` | bundled server entry (Bun, POSIX) | evolving<br>_redefined in 0 of the 4 minors since 0.133.0_ | narrow bootstrap that keeps the process runner lazy while carrying the package's own invocations — the owner-loss guard and the process root of launched work — in a single-file bundle |
|
|
81
|
+
| `stitchkit/files/packaging` | build time (Bun or Node) | evolving<br>_redefined in 4 of the 43 minors since 0.94.0, most recently 0.133.0_ | installed native asset graph, integrity, Bun packaging plugin and the artifact loader check; a client bundled into one self-contained, hashed file; a typed client built into a proven npm package with several entries, declarations and external peers; no runtime install policy |
|
|
82
|
+
| `stitchkit/files` | server (Bun or Node) | stable<br>_redefined in 5 of the 43 minors since 0.94.0, most recently 0.133.0_ | peer-free managed local-file boundary |
|
|
83
|
+
| `stitchkit/spend` | server (Bun or Node) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | peer-free spend gateway for paid model APIs: the attempt recorded before the call and closed on every outcome, credentials only for the provider's origin, a spooled ledger, rank-merged receipts and a reconciler |
|
|
84
|
+
| `stitchkit/spend/testing` | tests on Bun or Node | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | the coverage guard: red on a model SDK import, a provider key or a provider host outside the gateway files |
|
|
85
|
+
| `stitchkit/service-host` | server (Bun or Node) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | peer-free host service supervision — verified versioned artifact activation, Linux `systemd` and macOS `launchd` units (`plutil`, `bootout`/`bootstrap`, rollback), live process/Unix-socket identity verification, and an in-process config-watched reloader |
|
|
86
|
+
| `stitchkit/service-host/macos` | server (Bun or Node, macOS) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | peer-free macOS daemon bundle toolkit — fail-closed Developer ID `codesign`, strict C11 launcher `.app` bundles with atomic `RENAME_SWAP` install/rollback, Apple 824×824 squircle `AppIcon.icns`, streaming `lsregister` maintenance, and TCC responsibility inspection |
|
|
87
|
+
| `stitchkit/service-host/work` | server (Bun or Node; Linux with systemd ≥ 254, or a process root on Linux and macOS) | evolving<br>_redefined in 0 of the 4 minors since 0.133.0_ | peer-free launch of work in its own boundary with a declared owner — a transient systemd scope or a recorded process root, the typed owner record, the one inherited variable that names the boundary, and the membership check that asks the boundary; see [native I/O](native-io.md#work-in-its-own-boundary) |
|
|
88
|
+
| `stitchkit/telegram` | server (Bun or Node) | evolving<br>_redefined in 9 of the 43 minors since 0.94.0, most recently 0.136.0_ | peer-free Telegram platform primitives — Mini App `initData` verification, widget limits and the `widget_query`, `shared_widget_query` and widget message schemas, send-failure classification, one outbound budget per bot token with weighted albums and per-chat 429 pauses, resumable broadcasts, the operator channel with dedupe, a Bot API transport that separates a request that never left from an unknown outcome, local Bot API files, the waveform of a voice message read from its PCM, webhook ownership and durable webhook update intake |
|
|
89
|
+
| `stitchkit/telegram/grammy` | server (Bun or Node) | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the token's outbound budget as one grammY client transformer — a 429 that comes back as a response pauses its chat, and a cancelled wait is a request that never left; the widget methods over the same client |
|
|
90
|
+
| `stitchkit/telegram/html` | browser and server | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | Telegram's HTML as a tree — compile GFM Markdown to Telegram HTML with fence-aware splitting, clean any markup to what Telegram accepts, cut long text into valid parts by what the reader sees, check markup before it is sent |
|
|
91
|
+
| `stitchkit/telegram/voice` | browser and server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the waveform of a voice message as one format — packed for `sendVoice` the way Telegram Desktop scales it, unpacked to draw it, a `getMe` read of whether the server takes it |
|
|
92
|
+
| `stitchkit/telegram/screens` | server (Bun or Node) | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | a bot's menus as declared screens over grammY — typed paths, actions and input, message reconciliation, state in any `StorageAdapter`, a test chat |
|
|
93
|
+
| `stitchkit/tracking` | browser **and** server | evolving<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | visitor-tracking mechanics — `createTrackingClient`, the tab-shared outbox, the page-leave beacon, attribution, the contract factory; no event vocabulary, no React |
|
|
94
|
+
| `stitchkit/tracking/contract` | browser **and** server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the wire shapes — the contract factory, event and visit schemas, the performance sample and its trust threshold; brings `zod` |
|
|
95
|
+
| `stitchkit/tracking/performance` | browser **and** server | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | Web Vitals from real visitors, collected after load through the optional peer `web-vitals`; no `zod` |
|
|
96
|
+
| `stitchkit/tracking/server` | server (Bun or Node) | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the decisions a tracking backend makes — dispositions, visit lease over an application-owned store, active intervals, presence; no database |
|
|
97
|
+
| `stitchkit/release` | browser **and** server | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | a page follows the release it was built for — `createReleaseMarker` on the server, `createReleaseWatcher` in the browser, the `X-Build-Id` header and a socket event between them |
|
|
98
|
+
| `stitchkit/voice` | browser **and** server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the mechanics of a live voice reply — `SentenceCutter`, `speakableText`, a `SpeechQueue` that synthesises ahead and stops on interruption, the conversation phases |
|
|
99
|
+
| `stitchkit/sync` | browser **and** server | evolving<br>_redefined in 1 of the 10 minors since 0.127.0, most recently 0.132.0_ | the client half of an offline-first sync — which outbox rows leave next, pending edits on top of remote rows, deletes that win until acknowledged, the cursor session, the push and page wire with an open outcome vocabulary; no driver, runs in Hermes |
|
|
100
|
+
| `stitchkit/sync/postgres` | server (Bun or Node) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | the server half — versions that commit in order, a ledger that runs each change once, a feed of what changed, inside the app's own transaction; a memory store and `checkSyncStore` |
|
|
101
|
+
| `stitchkit/geo` | server (Bun or Node) | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.127.0_ | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
|
|
102
|
+
| `stitchkit/geo/contract` | browser **and** server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the place snapshot schema, for a shared contract that stores or sends `GeoAttribution`; brings `zod` |
|
|
103
|
+
| `stitchkit/xlsx` | browser **and** server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | a workbook from rows and typed columns, with no dependency; text never runs as a formula |
|
|
104
|
+
| `stitchkit/oauth` | browser **and** server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
|
|
105
|
+
| `stitchkit/google` | server (Bun or Node) | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | optional Google code exchange and verified OIDC identity adapter |
|
|
106
|
+
| `stitchkit/observability` | server | stable<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.136.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
|
|
107
|
+
| `stitchkit/testing` | tests on Bun or Node | stable<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | in-process generated clients over a real Fetch handler, the managed-resource conformance kit and manual time for schedules and retries |
|
|
108
|
+
| `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.128.0_ | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
|
|
109
|
+
| `stitchkit/react` | browser + server rendering | stable<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.136.0_ | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
|
|
110
|
+
| `stitchkit/react/keyboard` | browser | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.115.0_ | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
|
|
111
|
+
| `stitchkit/react/keyboard/testing` | server (Bun or Node) | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the keyboard layers and zones without a DOM — fakes for the window, elements and key events beside the two engines, to test the order of layers, `scope`/`inert` and the edges of a zone in milliseconds |
|
|
112
|
+
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 12 of the 43 minors since 0.94.0, most recently 0.136.0_ | peer-free durable conversation/run loop over `AgentModelDriver`, stateless `completeText`/`completeObject`, driver composition, history, models, prompts, fencing and events |
|
|
113
|
+
| `stitchkit/agent-runtime/sandbox` | server | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.136.0_ | optional Linux Bubblewrap sessions, long-lived OS process sandboxes (`createProcessSandbox`, `probeProcessSandbox`, `buildSeatbeltProfile`), durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
|
|
114
|
+
| `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving<br>_redefined in 4 of the 43 minors since 0.94.0, most recently 0.136.0_ | peer-free `createScriptedModelDriver`, credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
|
|
115
|
+
| `stitchkit/agent-runtime/harness` | server | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.134.0_ | peer-free resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
|
|
116
|
+
| `stitchkit/agent-runtime/coding-tools` | server (Bun or Node) | evolving<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | bounded host-authorized direct file and shell tools; a root boundary, not an OS sandbox |
|
|
117
|
+
| `stitchkit/agent-runtime/openrouter` | server | evolving<br>_redefined in 4 of the 43 minors since 0.94.0, most recently 0.136.0_ | peer-free native OpenRouter Chat Completions SSE driver, catalog, admission, route pinning and spend reconciliation, plus typed non-chat clients (speech-to-text, text-to-speech, images, video, embeddings, rerank, System One, any endpoint through `openRouterRequestJson`) bound once by `createOpenRouterClient`; see [agent runtime guide](agent-runtime.md#openrouter-non-chat-endpoints-and-shared-transport) |
|
|
118
|
+
| `stitchkit/agent-runtime/openai` | server | evolving<br>_redefined in 0 of the 3 minors since 0.134.0_ | peer-free native OpenAI Responses API (`POST /v1/responses`) driver, policy schemas and provenance-aware usage normalization |
|
|
119
|
+
| `stitchkit/agent-runtime/anthropic` | server | evolving<br>_redefined in 0 of the 3 minors since 0.134.0_ | peer-free native Anthropic Messages API (`POST /v1/messages`) driver, thinking/cache policy schemas and provenance-aware usage normalization |
|
|
120
|
+
| `stitchkit/agent-runtime/ai-sdk` | server | evolving<br>_redefined in 0 of the 3 minors since 0.134.0_ | thin optional-peer adapter (`fromAiSdkModel`, `fromAiSdkTools`) bridging AI SDK (`LanguageModelV4` from `ai@7`) models and `ToolSet`s onto `AgentModelDriver` and `AgentToolSet`; requires `ai` |
|
|
121
|
+
| `stitchkit/agent-runtime/browser` | browser + server | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.127.0_ | canonical agent records, events, reconnect cursor, interactive approval/input/permission-mode/host-status state (`deriveAgentConversationActivity`, `deriveAgentConversationState`, `delivery: 'unknown'` reconciliation) and optional conversation controller |
|
|
122
|
+
| `stitchkit/agent-runtime/react` | browser + server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | React subscription to an application-owned agent controller |
|
|
123
|
+
| `stitchkit/agent-runtime/realtime` | server (Bun or Node) | evolving<br>_redefined in 2 of the 43 minors since 0.94.0, most recently 0.127.0_ | authorized agent control over the existing Socket.IO server |
|
|
124
|
+
| `stitchkit/agent-executor` | server (Bun or Node) | evolving<br>_redefined in 4 of the 10 minors since 0.127.0, most recently 0.133.0_ | the executor ↔ server contract for external coding agents (Claude Code, Codex, ACP): delta vocabulary (including `ExecutorPlanDelta`) over the shared message parts, thread leases with a fence, turn phases and their reports |
|
|
125
|
+
| `stitchkit/agent-executor/claude` | server (Bun or Node) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | the Claude Code driver: the unmodified CLI over `stream-json`, permission requests answered by the host, reconcile by the input's id in the profile's transcript |
|
|
126
|
+
| `stitchkit/agent-executor/claude-sdk` | server (Bun or Node) | evolving<br>_redefined in 1 of the 10 minors since 0.127.0, most recently 0.131.0_ | Claude through the Agent SDK: the application's `query` (optional peer `@anthropic-ai/claude-agent-sdk`), the CLI's classifier, `canUseTool` asked of the host |
|
|
127
|
+
| `stitchkit/agent-executor/acp` | server (Bun or Node) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | an Agent Client Protocol v1 agent over stdio: settings by category, images, MCP servers, tool metadata (`title`/`kind`/`locations`), meaningful `tool_call_update` progress updates, typed `plan` deltas, `session/resume`/`load`/`list`, `session/cancel`; no reconcile |
|
|
128
|
+
| `stitchkit/agent-executor/codex` | server (Bun or Node) | evolving<br>_redefined in 3 of the 10 minors since 0.127.0, most recently 0.133.0_ | the Codex driver: `codex app-server` over stdio or Unix-socket WebSocket (`unix-listen` / `unix-connect`), thread policy and live controls, approval and input requests answered by the host, unknown server requests refused, reconcile by the client id in `thread/turns/list` |
|
|
129
|
+
| `stitchkit/agent-executor/testing` | server (Bun or Node) | evolving<br>_redefined in 1 of the 10 minors since 0.127.0, most recently 0.133.0_ | the engine conformance kit, deterministic replay driver, portable fake Codex app-server, fail-loud consumer stub factories, and schema-validated test fixtures; no optional peer |
|
|
130
|
+
| `stitchkit/agent-executor/testing/claude-sdk` | server (Bun or Node) | evolving<br>_redefined in 0 of the 4 minors since 0.133.0_ | the multi-turn fake Claude SDK query harness and the Claude SDK session stub, typed by the optional peer `@anthropic-ai/claude-agent-sdk` |
|
|
131
|
+
| `stitchkit/agent-runtime/postgres` | server (Bun or Node) | evolving<br>_redefined in 0 of the 10 minors since 0.127.0_ | the agent store, conversation reader and companion host on Postgres, over the application's own client (Bun SQL, Prisma, `pg`) |
|
|
132
|
+
| `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | durable built-in SQLite store for the agent runtime |
|
|
133
|
+
| `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving<br>_redefined in 1 of the 43 minors since 0.94.0, most recently 0.127.0_ | durable built-in SQLite store for the agent runtime |
|
|
134
134
|
| `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
|
|
135
|
-
| `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the
|
|
136
|
-
| `stitchkit/application/grammy` | server | evolving<br>_redefined in 0 of the
|
|
137
|
-
| `stitchkit/application/opentelemetry` | server | evolving<br>_redefined in 0 of the
|
|
138
|
-
| `stitchkit/application/diagnostic-journal` | server | evolving<br>_redefined in 3 of the
|
|
139
|
-
| `stitchkit/application/directory-inbox` | server | evolving<br>_redefined in 0 of the
|
|
135
|
+
| `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the 43 minors since 0.94.0, most recently 0.127.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
|
|
136
|
+
| `stitchkit/application/grammy` | server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
|
|
137
|
+
| `stitchkit/application/opentelemetry` | server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | maps application snapshots onto an injected OpenTelemetry `Meter` |
|
|
138
|
+
| `stitchkit/application/diagnostic-journal` | server | evolving<br>_redefined in 3 of the 43 minors since 0.94.0, most recently 0.127.0_ | the local diagnostic journal — an exclusive bounded writer and snapshot reader with explicit anomalies |
|
|
139
|
+
| `stitchkit/application/directory-inbox` | server | evolving<br>_redefined in 0 of the 43 minors since 0.94.0_ | the directory inbox — entries another program drops into a directory, delivered to the application at least once |
|
|
140
140
|
|
|
141
141
|
Rule of thumb: browser code imports `stitchkit` and `stitchkit/react`; server
|
|
142
142
|
code adds `stitchkit/server` (or `stitchkit/node` on Node) and opts into
|
|
@@ -176,18 +176,28 @@ export const notes = defineContract({ prefix: 'notes' }, {
|
|
|
176
176
|
|
|
177
177
|
```ts
|
|
178
178
|
// src/server/index.ts
|
|
179
|
-
import { implement,
|
|
179
|
+
import { createServer, implement, notFound } from 'stitchkit/server'
|
|
180
180
|
import { notes } from '../shared/contracts'
|
|
181
181
|
|
|
182
|
+
const db = new Map<string, { id: string; text: string }>() // your database here
|
|
183
|
+
|
|
182
184
|
const service = implement(notes, {
|
|
183
|
-
list: () => db.
|
|
184
|
-
create: (ctx) =>
|
|
185
|
-
|
|
185
|
+
list: () => [...db.values()],
|
|
186
|
+
create: (ctx) => { // ctx.input is typed
|
|
187
|
+
const note = { id: String(db.size + 1), text: ctx.input.text }
|
|
188
|
+
db.set(note.id, note)
|
|
189
|
+
return note
|
|
190
|
+
},
|
|
191
|
+
get: (ctx) => db.get(ctx.params.id) ?? notFound(), // ctx.params is typed
|
|
186
192
|
})
|
|
187
193
|
|
|
188
|
-
createServer({ services: [service], port: 3000 })
|
|
194
|
+
const server = createServer({ services: [service], port: 3000 })
|
|
195
|
+
console.log(`Listening on ${server.url}`)
|
|
189
196
|
```
|
|
190
197
|
|
|
198
|
+
Each contract is served under its prefix: `notes` answers at `/notes` and
|
|
199
|
+
`/notes/:id`, with no other path in front.
|
|
200
|
+
|
|
191
201
|
### 3. Call it, typed
|
|
192
202
|
|
|
193
203
|
```ts
|
|
@@ -195,16 +205,19 @@ createServer({ services: [service], port: 3000 })
|
|
|
195
205
|
import { createClient, createHttpClient } from 'stitchkit'
|
|
196
206
|
import { notes } from '../shared/contracts'
|
|
197
207
|
|
|
198
|
-
export const api = createClient(notes, createHttpClient({ baseUrl: '
|
|
208
|
+
export const api = createClient(notes, createHttpClient({ baseUrl: 'http://localhost:3000' }))
|
|
199
209
|
|
|
200
|
-
await api.
|
|
201
|
-
await api.
|
|
202
|
-
await api.get({ id: '1' }) // GET /notes/1
|
|
210
|
+
console.log(await api.create({ text: 'hi' })) // POST http://localhost:3000/notes → Note
|
|
211
|
+
console.log(await api.list()) // GET http://localhost:3000/notes → Note[]
|
|
212
|
+
console.log(await api.get({ id: '1' })) // GET http://localhost:3000/notes/1 → Note
|
|
203
213
|
```
|
|
204
214
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
215
|
+
Start the server with `bun run src/server/index.ts`, then run the client in a
|
|
216
|
+
second terminal with `bun run src/client/api.ts`. `baseUrl` is where the server
|
|
217
|
+
listens; a browser app served from the same origin can pass its own origin, or
|
|
218
|
+
mount the services under a prefix (`groups: [{ pathPrefix: '/api', services: [service] }]`)
|
|
219
|
+
and call `baseUrl: '/api'`. The contract is the single source of truth — change it
|
|
220
|
+
and both the handler and the client are re-typed at once.
|
|
208
221
|
|
|
209
222
|
#### On Node
|
|
210
223
|
|
|
@@ -277,7 +290,7 @@ bun add socket.io @socket.io/bun-engine # e.g. the Socket.IO server on Bun
|
|
|
277
290
|
Dynamic optional-peer adapters fail with an actionable error naming the package
|
|
278
291
|
and install command. Static entrypoints such as `stitchkit/tools/mcp` fail during
|
|
279
292
|
ESM resolution by naming the exact missing package; the feature-to-peer matrix
|
|
280
|
-
|
|
293
|
+
above is the canonical install command.
|
|
281
294
|
|
|
282
295
|
`stitchkit/tools` itself loads no optional peer, and `stitchkit/tools/toolkit`
|
|
283
296
|
stays free of `ai` (ADR 0338). Install only the peer of the adapter you import:
|
|
@@ -319,6 +332,13 @@ durable SQLite history, lazy skills, direct coding tools, approval continuations
|
|
|
319
332
|
and recovery stay framework-owned primitives, while model choice, permissions,
|
|
320
333
|
executables and OS isolation remain application policy.
|
|
321
334
|
|
|
335
|
+
For a long-polling Telegram bot, run
|
|
336
|
+
`bun create stitchkit my-bot --template telegram-bot`, copy `.env.example` to
|
|
337
|
+
`.env`, set `BOT_TOKEN`, then run `bun run dev`. The bot is a managed
|
|
338
|
+
application (`stitchkit/application` with `stitchkit/application/grammy`): its
|
|
339
|
+
handlers live in `src/handlers.ts`, and the entry point turns signals and a
|
|
340
|
+
poller that ended on its own into a bounded shutdown.
|
|
341
|
+
|
|
322
342
|
==============================================================================
|
|
323
343
|
# Guide: Typed client (docs/guide/client.md)
|
|
324
344
|
==============================================================================
|
package/llms/telegram-grammy.txt
CHANGED
|
@@ -22,8 +22,9 @@ declarations and is never imported at run time — the bot brings it. → ADR 02
|
|
|
22
22
|
| Export | Kind | Summary |
|
|
23
23
|
|--------|------|---------|
|
|
24
24
|
| `telegramBudgetTransformer` | function | `bot.api.config.use(telegramBudgetTransformer(budget))`: every Bot API call runs under the token's `telegramOutboundBudget`; a 429 that comes back as a response pauses the token, a cancellation before the request was handed on throws `TelegramNotDispatchedError`, a cancellation in flight stays the client's own error; it never retries |
|
|
25
|
-
| `telegramWidgetApi` / `TelegramWidgetApi` | function / _type_ | `telegramWidgetApi(bot.api)`: `sendWidget`, `editMessageWidgetData` and `answerWidgetQuery` through the client's `api.raw`, so its transformers — the outbound budget among them — run each call; input over a limit throws `ZodError` before any request, an already aborted signal throws `TelegramNotDispatchedError`, a request is handed on once and never repeated, `message is not modified` is success, and an unexpected successful answer is an error whose outcome is unknown |
|
|
26
|
-
| `TelegramSendWidgetParams` / `TelegramEditMessageWidgetDataParams` / `TelegramAnswerWidgetQueryParams` | _type_ | the methods' Bot API parameters by their Bot API names; an edit names `chat_id` with `message_id` or `inline_message_id`, and `chat_data` or `public_data` (`''` removes it, an omitted field keeps it) |
|
|
25
|
+
| `telegramWidgetApi` / `TelegramWidgetApi` | function / _type_ | `telegramWidgetApi(bot.api)`: `sendWidget`, `sendSharedWidget`, `editMessageWidgetData`, `editSharedWidgetData` and `answerWidgetQuery` through the client's `api.raw`, so its transformers — the outbound budget among them — run each call; input over a limit throws `ZodError` before any request, an already aborted signal throws `TelegramNotDispatchedError`, a request is handed on once and never repeated, `message is not modified` is success, and an unexpected successful answer is an error whose outcome is unknown |
|
|
26
|
+
| `TelegramSendWidgetParams` / `TelegramEditMessageWidgetDataParams` / `TelegramAnswerWidgetQueryParams` | _type_ | the methods' Bot API parameters by their Bot API names; `is_shared: true` creates a shared widget, whose message must carry `widget.id`; an edit names `chat_id` with `message_id` or `inline_message_id`, and `chat_data` or `public_data` (`''` removes it, an omitted field keeps it) |
|
|
27
|
+
| `TelegramSendSharedWidgetParams` / `TelegramEditSharedWidgetDataParams` | _type_ | `sendSharedWidget` sends an existing shared widget by `widget_id` again, costs one message, and its message must carry that id; `editSharedWidgetData` changes `public_data` (`''` removes it) of every message with the widget, with an optional `cache_time` of 5–3600 s, and costs no message |
|
|
27
28
|
| `TelegramWidgetCallOptions` | _type_ | `signal` for one call: aborted before the request leaves, the call is not dispatched |
|
|
28
29
|
|
|
29
30
|
---
|
package/llms/telegram.2.txt
CHANGED
|
@@ -71,6 +71,8 @@ injected grammY bot. → ADR 0143, ADR 0201, ADR 0274 — [guide](../guide/teleg
|
|
|
71
71
|
| `TelegramWidgetHtmlSchema` / `TelegramWidgetDataSchema` | schema | widget HTML (1–32768 bytes, at most 4096 compressed) and widget data (0–1024 bytes), counted in UTF-8 bytes; NUL and an unpaired surrogate are refused, an empty data string is a value |
|
|
72
72
|
| `TelegramWidgetMessageSchema` / `TelegramWidgetMessage` | schema / _type_ | the message `sendWidget` returns — `message_id`, `chat`, `widget` with `html` and its data; parsed loosely, so fields Telegram adds pass through |
|
|
73
73
|
| `TelegramWidgetQuerySchema` / `TelegramWidgetQuery` | schema / _type_ | `Update.widget_query`: `id`, `from`, `chat` with `message_id` or `inline_message_id`, `chat_instance`, `type` (`data` / `sign_data` / `sent_transaction`), `data` of 1–64 bytes, `widget_id` |
|
|
74
|
-
| `parseTelegramWidgetQuery` / `TelegramWidgetQueryParse` | function / _type_ | read `update.widget_query`: `{ query }`, or `{ id, error }` for a query that does not parse — its id is enough to answer it with a refusal — or `undefined` without an id |
|
|
74
|
+
| `parseTelegramWidgetQuery` / `TelegramWidgetQueryParse` | function / _type_ | read `update.widget_query`: `{ query }`, or `{ id, error }` for a query that does not parse — its id is enough to answer it with a refusal — or `undefined` without an id; `TelegramWidgetQueryParse<Query>` is the same result for another query type |
|
|
75
|
+
| `TelegramSharedWidgetQuerySchema` / `TelegramSharedWidgetQuery` | schema / _type_ | `Update.shared_widget_query`, a query from a forwarded shared widget: `id`, `from`, `type`, `data` of 1–64 bytes and the shared widget's `widget_id` — no chat and no message |
|
|
76
|
+
| `parseTelegramSharedWidgetQuery` | function | read `update.shared_widget_query` as `parseTelegramWidgetQuery` reads `update.widget_query`: `{ query }`, `{ id, error }` or `undefined` |
|
|
75
77
|
|
|
76
78
|
---
|