stitchkit 0.93.0 → 0.94.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 +134 -0
- package/README.md +5 -2
- package/dist/agent-runtime/children-control.d.ts +6 -0
- package/dist/agent-runtime/children-control.d.ts.map +1 -0
- package/dist/agent-runtime/children-spawn.d.ts +6 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -0
- package/dist/agent-runtime/children-state.d.ts +46 -0
- package/dist/agent-runtime/children-state.d.ts.map +1 -0
- package/dist/agent-runtime/children-usage.d.ts +8 -0
- package/dist/agent-runtime/children-usage.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +11 -14
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +2 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -2
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/events.d.ts +1 -1
- package/dist/agent-runtime/events.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +1 -1
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +1 -1
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/{agent-runtime-openrouter.d.ts → agent-runtime/openrouter.d.ts} +3 -3
- package/dist/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +1 -1
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts +17 -0
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution-state.d.ts +133 -0
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts +17 -33
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts +18 -0
- package/dist/agent-runtime/run-failure.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-attempts.d.ts +6 -0
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -0
- package/dist/agent-runtime/run-prompt-history.d.ts +58 -0
- package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts +26 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +17 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -0
- package/dist/agent-runtime/run-terminal.d.ts +11 -0
- package/dist/agent-runtime/run-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +22 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts +29 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-control.d.ts +9 -0
- package/dist/agent-runtime/runtime-control.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-recovery.d.ts +10 -0
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-state.d.ts +36 -0
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-submit.d.ts +5 -0
- package/dist/agent-runtime/runtime-submit.d.ts.map +1 -0
- package/dist/agent-runtime/runtime.d.ts +9 -4
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/{agent-runtime-sqlite-bun.d.ts → agent-runtime/sqlite-bun.d.ts} +5 -4
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-events.d.ts +5 -0
- package/dist/agent-runtime/sqlite-events.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-history.d.ts +7 -0
- package/dist/agent-runtime/sqlite-history.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts +7 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +1 -0
- package/dist/{agent-runtime-sqlite-node.d.ts → agent-runtime/sqlite-node.d.ts} +5 -4
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-reads.d.ts +14 -0
- package/dist/agent-runtime/sqlite-reads.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-rows.d.ts +178 -0
- package/dist/agent-runtime/sqlite-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-schema.d.ts +7 -0
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts +25 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite.d.ts +10 -6
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts +16 -0
- package/dist/agent-runtime/store-archive.d.ts.map +1 -0
- package/dist/{testing/agent-store-conformance.d.ts → agent-runtime/store-conformance.d.ts} +2 -2
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -0
- package/dist/agent-runtime/store-create.d.ts +11 -0
- package/dist/agent-runtime/store-create.d.ts.map +1 -0
- package/dist/agent-runtime/{store-driver.d.ts → store-driver-contract.d.ts} +7 -7
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -0
- package/dist/agent-runtime/store-events.d.ts +7 -89
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +4 -0
- package/dist/agent-runtime/store-memory.d.ts.map +1 -0
- package/dist/agent-runtime/store-mutate.d.ts +13 -0
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -0
- package/dist/agent-runtime/store-purge.d.ts +1 -1
- package/dist/agent-runtime/store-purge.d.ts.map +1 -1
- package/dist/agent-runtime/store-reads.d.ts +29 -0
- package/dist/agent-runtime/store-reads.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-history.d.ts +10 -0
- package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-run.d.ts +14 -0
- package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts +76 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts +6 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-reducer.d.ts +24 -0
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -0
- package/dist/agent-runtime/store-snapshot.d.ts +19 -0
- package/dist/agent-runtime/store-snapshot.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +1 -1
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/application/admission.d.ts +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/events.d.ts +1 -1
- package/dist/application/events.d.ts.map +1 -1
- package/dist/{server → application}/file-state-store.d.ts +1 -1
- package/dist/application/file-state-store.d.ts.map +1 -0
- package/dist/application/health.d.ts +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts +8 -0
- package/dist/application/kernel-admission.d.ts.map +1 -0
- package/dist/application/kernel-contract.d.ts +142 -0
- package/dist/application/kernel-contract.d.ts.map +1 -0
- package/dist/application/kernel-resource-context.d.ts +24 -0
- package/dist/application/kernel-resource-context.d.ts.map +1 -0
- package/dist/application/kernel-restart.d.ts +5 -0
- package/dist/application/kernel-restart.d.ts.map +1 -0
- package/dist/application/kernel-rollback.d.ts +4 -0
- package/dist/application/kernel-rollback.d.ts.map +1 -0
- package/dist/application/kernel-shutdown.d.ts +6 -0
- package/dist/application/kernel-shutdown.d.ts.map +1 -0
- package/dist/application/kernel-start.d.ts +20 -0
- package/dist/application/kernel-start.d.ts.map +1 -0
- package/dist/application/kernel-state.d.ts +116 -0
- package/dist/application/kernel-state.d.ts.map +1 -0
- package/dist/application/kernel.d.ts +9 -140
- package/dist/application/kernel.d.ts.map +1 -1
- package/dist/application/latest-sink.d.ts +1 -1
- package/dist/application/latest-sink.d.ts.map +1 -1
- package/dist/application/opentelemetry.d.ts +1 -1
- package/dist/application/opentelemetry.d.ts.map +1 -1
- package/dist/application/watch-hub.d.ts +2 -2
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-multipart.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/client.d.ts +1 -1
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http.d.ts +1 -1
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/resumable.d.ts +1 -28
- package/dist/browser/resumable.d.ts.map +1 -1
- package/dist/browser/retained.d.ts.map +1 -0
- package/dist/browser/socket-io.d.ts +23 -1
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +14 -2
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/contract/define.d.ts +72 -65
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/{internal/errors.d.ts → contract/normalize.d.ts} +3 -39
- package/dist/contract/normalize.d.ts.map +1 -0
- package/dist/contract/tool-view.d.ts +135 -0
- package/dist/contract/tool-view.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-contract.d.ts → durability/contract.d.ts} +2 -2
- package/dist/durability/contract.d.ts.map +1 -0
- package/dist/{agent-runtime/durability.d.ts → durability/engine.d.ts} +4 -4
- package/dist/durability/engine.d.ts.map +1 -0
- package/dist/durability/events.d.ts +101 -0
- package/dist/durability/events.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-json.d.ts → durability/json.d.ts} +1 -1
- package/dist/durability/json.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-ledger.d.ts → durability/ledger.d.ts} +2 -2
- package/dist/durability/ledger.d.ts.map +1 -0
- package/dist/{agent-runtime/durability-scheduler.d.ts → durability/scheduler.d.ts} +2 -2
- package/dist/durability/scheduler.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -0
- package/dist/{agent-runtime-browser.js → entrypoints/agent-runtime/browser.js} +3 -3
- package/dist/{agent-runtime-coding-tools.d.ts → entrypoints/agent-runtime/coding-tools.d.ts} +2 -2
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
- package/dist/{agent-runtime-harness.d.ts → entrypoints/agent-runtime/harness.d.ts} +2 -2
- package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
- package/dist/{agent-runtime-harness.js → entrypoints/agent-runtime/harness.js} +24 -25
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/{agent-runtime-openrouter.js → entrypoints/agent-runtime/openrouter.js} +3 -3
- package/dist/{agent-runtime-sandbox.d.ts → entrypoints/agent-runtime/sandbox.d.ts} +5 -5
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
- package/dist/{agent-runtime-sandbox.js → entrypoints/agent-runtime/sandbox.js} +11 -12
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts.map +1 -0
- package/dist/{agent-runtime-sqlite-bun.js → entrypoints/agent-runtime/sqlite/bun.js} +8 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts.map +1 -0
- package/dist/{agent-runtime-sqlite-node.js → entrypoints/agent-runtime/sqlite/node.js} +8 -6
- package/dist/entrypoints/agent-runtime/testing.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/testing.js +1084 -0
- package/dist/{agent-runtime.d.ts → entrypoints/agent-runtime.d.ts} +41 -37
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
- package/dist/{agent-runtime.js → entrypoints/agent-runtime.js} +408 -366
- package/dist/{application-diagnostic-journal.d.ts → entrypoints/application/diagnostic-journal.d.ts} +2 -2
- package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
- package/dist/{application-diagnostic-journal.js → entrypoints/application/diagnostic-journal.js} +3 -3
- package/dist/{application-grammy.d.ts → entrypoints/application/grammy.d.ts} +2 -2
- package/dist/entrypoints/application/grammy.d.ts.map +1 -0
- package/dist/{application-grammy.js → entrypoints/application/grammy.js} +2 -2
- package/dist/{application-opentelemetry.d.ts → entrypoints/application/opentelemetry.d.ts} +2 -2
- package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
- package/dist/{application-opentelemetry.js → entrypoints/application/opentelemetry.js} +4 -4
- package/dist/{application-schemas.d.ts → entrypoints/application/schemas.d.ts} +2 -2
- package/dist/entrypoints/application/schemas.d.ts.map +1 -0
- package/dist/{application-schemas.js → entrypoints/application/schemas.js} +2 -2
- package/dist/{application.d.ts → entrypoints/application.d.ts} +22 -21
- package/dist/entrypoints/application.d.ts.map +1 -0
- package/dist/{application.js → entrypoints/application.js} +24 -22
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
- package/dist/{upgrade-cli.js → entrypoints/bin/upgrade-cli.js} +3 -3
- package/dist/{cli.d.ts → entrypoints/cli.d.ts} +15 -15
- package/dist/entrypoints/cli.d.ts.map +1 -0
- package/dist/{cli.js → entrypoints/cli.js} +30 -32
- package/dist/entrypoints/contract.d.ts +9 -0
- package/dist/entrypoints/contract.d.ts.map +1 -0
- package/dist/{contract/index.js → entrypoints/contract.js} +14 -6
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -0
- package/dist/{declaration.js → entrypoints/declaration.js} +1 -1
- package/dist/{files.d.ts → entrypoints/files.d.ts} +2 -2
- package/dist/entrypoints/files.d.ts.map +1 -0
- package/dist/{files.js → entrypoints/files.js} +3 -3
- package/dist/{geo.d.ts → entrypoints/geo.d.ts} +1 -1
- package/dist/entrypoints/geo.d.ts.map +1 -0
- package/dist/{geo.js → entrypoints/geo.js} +4 -4
- package/dist/entrypoints/google.d.ts +2 -0
- package/dist/entrypoints/google.d.ts.map +1 -0
- package/dist/{google.js → entrypoints/google.js} +1 -1
- package/dist/{index.d.ts → entrypoints/index.d.ts} +14 -13
- package/dist/entrypoints/index.d.ts.map +1 -0
- package/dist/{index.js → entrypoints/index.js} +99 -33
- package/dist/{live.d.ts → entrypoints/live.d.ts} +4 -4
- package/dist/entrypoints/live.d.ts.map +1 -0
- package/dist/{live.js → entrypoints/live.js} +6 -4
- package/dist/{node.d.ts → entrypoints/node.d.ts} +11 -11
- package/dist/entrypoints/node.d.ts.map +1 -0
- package/dist/{node.js → entrypoints/node.js} +20 -16
- package/dist/entrypoints/oauth.d.ts +2 -0
- package/dist/entrypoints/oauth.d.ts.map +1 -0
- package/dist/{oauth.js → entrypoints/oauth.js} +3 -3
- package/dist/{observability/index.d.ts → entrypoints/observability.d.ts} +11 -11
- package/dist/entrypoints/observability.d.ts.map +1 -0
- package/dist/{observability/index.js → entrypoints/observability.js} +9 -11
- package/dist/entrypoints/primitives.d.ts +3 -0
- package/dist/entrypoints/primitives.d.ts.map +1 -0
- package/dist/{primitives.js → entrypoints/primitives.js} +1 -6
- package/dist/{react.d.ts → entrypoints/react.d.ts} +4 -4
- package/dist/entrypoints/react.d.ts.map +1 -0
- package/dist/{react.js → entrypoints/react.js} +3 -3
- package/dist/{release.d.ts → entrypoints/release.d.ts} +4 -4
- package/dist/entrypoints/release.d.ts.map +1 -0
- package/dist/{release.js → entrypoints/release.js} +1 -1
- package/dist/{remote.d.ts → entrypoints/remote.d.ts} +1 -1
- package/dist/entrypoints/remote.d.ts.map +1 -0
- package/dist/entrypoints/remote.js +66 -0
- package/dist/{server/index.d.ts → entrypoints/server.d.ts} +35 -34
- package/dist/entrypoints/server.d.ts.map +1 -0
- package/dist/{server/index.js → entrypoints/server.js} +294 -244
- package/dist/{telegram.d.ts → entrypoints/telegram.d.ts} +2 -2
- package/dist/entrypoints/telegram.d.ts.map +1 -0
- package/dist/{telegram.js → entrypoints/telegram.js} +1 -1
- package/dist/entrypoints/testing.d.ts +9 -0
- package/dist/entrypoints/testing.d.ts.map +1 -0
- package/dist/{testing.js → entrypoints/testing.js} +80 -919
- package/dist/{tools/connections/index.d.ts → entrypoints/tools/connections.d.ts} +6 -7
- package/dist/entrypoints/tools/connections.d.ts.map +1 -0
- package/dist/{tools/connections/index.js → entrypoints/tools/connections.js} +7 -4
- package/dist/{tools-contract.d.ts → entrypoints/tools/contract.d.ts} +5 -5
- package/dist/entrypoints/tools/contract.d.ts.map +1 -0
- package/dist/{tools-contract.js → entrypoints/tools/contract.js} +4 -4
- package/dist/{tool-invoker.d.ts → entrypoints/tools/invoker.d.ts} +2 -2
- package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
- package/dist/entrypoints/tools/invoker.js +20 -0
- package/dist/entrypoints/tools.d.ts +51 -0
- package/dist/entrypoints/tools.d.ts.map +1 -0
- package/dist/{tools.js → entrypoints/tools.js} +1787 -1751
- package/dist/{tracking-server.d.ts → entrypoints/tracking/server.d.ts} +8 -8
- package/dist/entrypoints/tracking/server.d.ts.map +1 -0
- package/dist/{tracking.d.ts → entrypoints/tracking.d.ts} +15 -15
- package/dist/entrypoints/tracking.d.ts.map +1 -0
- package/dist/{tracking.js → entrypoints/tracking.js} +5 -8
- package/dist/google/google.d.ts.map +1 -0
- package/dist/{index-a916km3r.js → index-0b1ess5e.js} +6 -13
- package/dist/{index-zwkgfq1s.js → index-1nd48tm9.js} +113 -118
- package/dist/{index-7zbps32p.js → index-1zbbzgfh.js} +2 -2
- package/dist/{index-mzvgxp0n.js → index-2cr1cqhn.js} +16 -4
- package/dist/{index-f9mb610r.js → index-35mh5bhj.js} +2 -2
- package/dist/index-48ffdxgk.js +6 -0
- package/dist/index-58k4fp34.js +1023 -0
- package/dist/{index-p13mwz16.js → index-83bdg97s.js} +1 -1
- package/dist/index-97ac4gph.js +3618 -0
- package/dist/{index-kw9t5ayn.js → index-cq4qfycf.js} +5 -5
- package/dist/{index-7gnkny4z.js → index-d9pk3td4.js} +1 -1
- package/dist/{index-e42wzzz5.js → index-dcpdvjsc.js} +7 -7
- package/dist/{index-h9etkkyk.js → index-dydjcp8z.js} +102 -25
- package/dist/{index-sr93cwf9.js → index-e2z3ahw9.js} +2 -2
- package/dist/{index-yewwh1w4.js → index-e87kakm4.js} +96 -11
- package/dist/{index-cby4ar3v.js → index-eqqvgdb3.js} +1 -1
- package/dist/index-fdp6hdxn.js +942 -0
- package/dist/{index-0a349c33.js → index-gyr48nzg.js} +125 -198
- package/dist/{index-wnfk50r0.js → index-h6eeys1v.js} +1 -1
- package/dist/{index-77fekveh.js → index-hffjpmq9.js} +1 -15
- package/dist/{index-yn8remb1.js → index-j05z5gn4.js} +50 -14
- package/dist/index-k5hsfc3j.js +31 -0
- package/dist/{index-fq77yfzc.js → index-kj2wbeta.js} +1 -1
- package/dist/index-kvj7f4hq.js +39 -0
- package/dist/{index-4fpa9dy2.js → index-m9zn6cpq.js} +2 -2
- package/dist/{index-2na0qrfn.js → index-mdzh02yc.js} +7 -7
- package/dist/{index-ywd0y6m1.js → index-mkm15s49.js} +1 -1
- package/dist/index-mp5sn43f.js +1084 -0
- package/dist/{index-3bmnp41g.js → index-n6hxg8as.js} +507 -419
- package/dist/index-ngfhvfpd.js +30 -0
- package/dist/{index-e0znv5gn.js → index-p5r7qpdd.js} +2 -93
- package/dist/{index-n0f51dfn.js → index-p81267c2.js} +608 -549
- package/dist/{index-wc4x00bn.js → index-qwhynv6x.js} +1 -1
- package/dist/index-r7nmqpsg.js +154 -0
- package/dist/{index-bx75zwt7.js → index-rewkc2hj.js} +5 -4
- package/dist/{index-9f8ztey6.js → index-sees8yf8.js} +2 -2
- package/dist/{index-vjpvjqpn.js → index-v38qyerb.js} +16 -2
- package/dist/{index-2c2bjw3s.js → index-vcvkq30w.js} +3 -3
- package/dist/index-wqgjfstn.js +18 -0
- package/dist/{index-f477k430.js → index-x4799c19.js} +1 -1
- package/dist/{index-cxqhvq21.js → index-xnj9bgxe.js} +142 -129
- package/dist/index-xsqjkha9.js +281 -0
- package/dist/{index-6kyksz9y.js → index-yw4fzmdz.js} +1 -1
- package/dist/{index-3xwxfj4z.js → index-zeemqhqx.js} +1 -1
- package/dist/{index-tmwcrptx.js → index-zfrhfn82.js} +1 -1
- package/dist/index-znfs20ss.js +98 -0
- package/dist/internal/backoff.d.ts +29 -0
- package/dist/internal/backoff.d.ts.map +1 -0
- package/dist/internal/canonical-json.d.ts +21 -11
- package/dist/internal/canonical-json.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -0
- package/dist/internal/logger.d.ts.map +1 -0
- package/dist/internal/request.d.ts.map +1 -0
- package/dist/internal/stable-digest.d.ts +0 -43
- package/dist/internal/stable-digest.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +0 -8
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/zod-issues.d.ts +38 -0
- package/dist/internal/zod-issues.d.ts.map +1 -0
- package/dist/{tools/json-schema-dialect.d.ts → json-schema/dialect.d.ts} +1 -1
- package/dist/json-schema/dialect.d.ts.map +1 -0
- package/dist/json-schema/json-schema.d.ts.map +1 -0
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/{oauth.d.ts → oauth/authorization-code.d.ts} +1 -1
- package/dist/oauth/authorization-code.d.ts.map +1 -0
- package/dist/observability/audit.d.ts +2 -2
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +1 -1
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/{internal/observability-sink.d.ts → observability/bounded-sink.d.ts} +2 -2
- package/dist/observability/bounded-sink.d.ts.map +1 -0
- package/dist/observability/context.d.ts +1 -1
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event.d.ts +1 -1
- package/dist/observability/event.d.ts.map +1 -1
- package/dist/observability/work.d.ts +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/audit.d.ts +1 -1
- package/dist/primitives/audit.d.ts.map +1 -1
- package/dist/primitives/export-operation.d.ts +4 -2
- package/dist/primitives/export-operation.d.ts.map +1 -1
- package/dist/realtime/socket.d.ts +1 -1
- package/dist/realtime/socket.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/context.d.ts +2 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +15 -0
- package/dist/server/contract-method.d.ts.map +1 -0
- package/dist/server/contract-stream.d.ts +1 -1
- package/dist/server/contract-stream.d.ts.map +1 -1
- package/dist/server/create.d.ts +8 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts +10 -0
- package/dist/server/endpoint-dispatch.d.ts.map +1 -0
- package/dist/server/endpoint-response.d.ts +18 -0
- package/dist/server/endpoint-response.d.ts.map +1 -0
- package/dist/server/error-dispatch.d.ts +17 -1
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -2
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +44 -0
- package/dist/server/handler-state.d.ts.map +1 -0
- package/dist/server/implement.d.ts +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/middleware/auth.d.ts +1 -1
- package/dist/server/middleware/auth.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +17 -0
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/trust-fence.d.ts +1 -1
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart.d.ts +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/{tools/oauth-metadata.d.ts → server/oauth/metadata.d.ts} +2 -2
- package/dist/server/oauth/metadata.d.ts.map +1 -0
- package/dist/{tools/oauth-provider.d.ts → server/oauth/provider.d.ts} +2 -2
- package/dist/server/oauth/provider.d.ts.map +1 -0
- package/dist/server/realtime.d.ts +1 -1
- package/dist/server/realtime.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +16 -0
- package/dist/server/request-completion.d.ts.map +1 -0
- package/dist/server/response-metadata.d.ts +1 -1
- package/dist/server/response-metadata.d.ts.map +1 -1
- package/dist/server/route-table.d.ts +9 -0
- package/dist/server/route-table.d.ts.map +1 -0
- package/dist/server/stream.d.ts +0 -13
- package/dist/server/stream.d.ts.map +1 -1
- package/dist/server/types.d.ts +7 -4
- package/dist/server/types.d.ts.map +1 -1
- package/dist/testing/handler-clients.d.ts +31 -0
- package/dist/testing/handler-clients.d.ts.map +1 -0
- package/dist/testing/managed-resource-conformance-scenarios.d.ts.map +1 -1
- package/dist/testing/surface-conformance.d.ts +2 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +30 -4
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/{cli-args.d.ts → cli/args.d.ts} +1 -1
- package/dist/tools/cli/args.d.ts.map +1 -0
- package/dist/tools/{cli-checkpoint.d.ts → cli/checkpoint.d.ts} +1 -1
- package/dist/tools/cli/checkpoint.d.ts.map +1 -0
- package/dist/tools/{cli-command.d.ts → cli/command.d.ts} +4 -4
- package/dist/tools/cli/command.d.ts.map +1 -0
- package/dist/tools/{cli.d.ts → cli/config.d.ts} +5 -9
- package/dist/tools/cli/config.d.ts.map +1 -0
- package/dist/tools/cli/create-cli.d.ts +36 -0
- package/dist/tools/cli/create-cli.d.ts.map +1 -0
- package/dist/tools/cli/download.d.ts +8 -0
- package/dist/tools/cli/download.d.ts.map +1 -0
- package/dist/tools/{cli-format.d.ts → cli/format.d.ts} +2 -2
- package/dist/tools/cli/format.d.ts.map +1 -0
- package/dist/tools/cli/help.d.ts +24 -0
- package/dist/tools/cli/help.d.ts.map +1 -0
- package/dist/tools/{cli-installer.d.ts → cli/installer.d.ts} +2 -2
- package/dist/tools/cli/installer.d.ts.map +1 -0
- package/dist/tools/{cli-invoke.d.ts → cli/invoke.d.ts} +8 -8
- package/dist/tools/cli/invoke.d.ts.map +1 -0
- package/dist/tools/cli/io.d.ts +10 -0
- package/dist/tools/cli/io.d.ts.map +1 -0
- package/dist/tools/cli/managed-surface.d.ts +30 -0
- package/dist/tools/cli/managed-surface.d.ts.map +1 -0
- package/dist/tools/{cli-manifest.d.ts → cli/manifest.d.ts} +1 -1
- package/dist/tools/cli/manifest.d.ts.map +1 -0
- package/dist/tools/{cli-policy.d.ts → cli/policy.d.ts} +2 -2
- package/dist/tools/cli/policy.d.ts.map +1 -0
- package/dist/tools/cli/prepare.d.ts +14 -0
- package/dist/tools/cli/prepare.d.ts.map +1 -0
- package/dist/tools/{cli-profile.d.ts → cli/profile.d.ts} +2 -2
- package/dist/tools/cli/profile.d.ts.map +1 -0
- package/dist/tools/cli/run-managed.d.ts +5 -0
- package/dist/tools/cli/run-managed.d.ts.map +1 -0
- package/dist/tools/cli/run-native.d.ts +9 -0
- package/dist/tools/cli/run-native.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +40 -0
- package/dist/tools/cli/session.d.ts.map +1 -0
- package/dist/tools/{cli-signature.d.ts → cli/signature.d.ts} +2 -2
- package/dist/tools/cli/signature.d.ts.map +1 -0
- package/dist/tools/{cli-stream.d.ts → cli/stream.d.ts} +4 -4
- package/dist/tools/cli/stream.d.ts.map +1 -0
- package/dist/tools/{cli-update.d.ts → cli/update.d.ts} +3 -3
- package/dist/tools/cli/update.d.ts.map +1 -0
- package/dist/tools/{cli-view.d.ts → cli/view.d.ts} +2 -2
- package/dist/tools/cli/view.d.ts.map +1 -0
- package/dist/tools/{cli-wait.d.ts → cli/wait.d.ts} +2 -2
- package/dist/tools/cli/wait.d.ts.map +1 -0
- package/dist/tools/connections/runtime.d.ts +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +3 -3
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/durability-context.d.ts +1 -1
- package/dist/tools/durability-context.d.ts.map +1 -1
- package/dist/tools/execute.d.ts +30 -3
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +8 -6
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/internal/tool-view.d.ts +41 -0
- package/dist/tools/internal/tool-view.d.ts.map +1 -0
- package/dist/tools/invoker.d.ts +11 -3
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +3 -3
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -2
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/{mcp-app.d.ts → mcp/app.d.ts} +1 -1
- package/dist/tools/mcp/app.d.ts.map +1 -0
- package/dist/tools/{mcp-catalog.d.ts → mcp/catalog.d.ts} +2 -2
- package/dist/tools/mcp/catalog.d.ts.map +1 -0
- package/dist/tools/{mcp-handler.d.ts → mcp/handler.d.ts} +5 -5
- package/dist/tools/mcp/handler.d.ts.map +1 -0
- package/dist/tools/{mcp.d.ts → mcp/mount.d.ts} +9 -9
- package/dist/tools/mcp/mount.d.ts.map +1 -0
- package/dist/tools/{mcp-prepare.d.ts → mcp/prepare.d.ts} +9 -9
- package/dist/tools/mcp/prepare.d.ts.map +1 -0
- package/dist/tools/{mcp-progress.d.ts → mcp/progress.d.ts} +2 -2
- package/dist/tools/mcp/progress.d.ts.map +1 -0
- package/dist/tools/mcp/register.d.ts +35 -0
- package/dist/tools/mcp/register.d.ts.map +1 -0
- package/dist/tools/{mcp-round-policy.d.ts → mcp/round-policy.d.ts} +2 -2
- package/dist/tools/mcp/round-policy.d.ts.map +1 -0
- package/dist/tools/{mcp-round.d.ts → mcp/round.d.ts} +4 -4
- package/dist/tools/mcp/round.d.ts.map +1 -0
- package/dist/tools/mcp/runtime-tools.d.ts +24 -0
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
- package/dist/tools/{mcp-stdio-signals.d.ts → mcp/stdio-signals.d.ts} +3 -3
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
- package/dist/tools/{mcp-stdio.d.ts → mcp/stdio.d.ts} +4 -4
- package/dist/tools/mcp/stdio.d.ts.map +1 -0
- package/dist/tools/{mcp-trace.d.ts → mcp/trace.d.ts} +1 -1
- package/dist/tools/mcp/trace.d.ts.map +1 -0
- package/dist/tools/mount.d.ts +12 -7
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +3 -3
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-binding-types.d.ts +127 -0
- package/dist/tools/operations/async-operation-binding-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-binding.d.ts +28 -0
- package/dist/tools/operations/async-operation-binding.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts +110 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical.d.ts +7 -0
- package/dist/tools/operations/async-operation-canonical.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-contract.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-id.d.ts +23 -0
- package/dist/tools/operations/async-operation-id.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +40 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts +68 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime.d.ts +5 -0
- package/dist/tools/operations/async-operation-runtime.d.ts.map +1 -0
- package/dist/tools/{define-wait-tool.d.ts → operations/define-wait-tool.d.ts} +2 -2
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -0
- package/dist/tools/operations/mount-wait.d.ts.map +1 -0
- package/dist/tools/operations/wait-core.d.ts.map +1 -0
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +11 -4
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -0
- package/dist/tools/schema/flatten-join.d.ts.map +1 -0
- package/dist/tools/schema/flatten.d.ts.map +1 -0
- package/dist/tools/schema/portable-formats.d.ts.map +1 -0
- package/dist/tools/{presentation.d.ts → schema/presentation.d.ts} +2 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -0
- package/dist/tools/schema/schema.d.ts.map +1 -0
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -0
- package/dist/tools/surface.d.ts +2 -3
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +4 -4
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/{define-download-tool.d.ts → transfer/define-download-tool.d.ts} +4 -4
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
- package/dist/tools/{define-upload-tool.d.ts → transfer/define-upload-tool.d.ts} +3 -3
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
- package/dist/tools/{define-view-file-tool.d.ts → transfer/define-view-file-tool.d.ts} +2 -2
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
- package/dist/tools/{download-core.d.ts → transfer/download-core.d.ts} +2 -2
- package/dist/tools/transfer/download-core.d.ts.map +1 -0
- package/dist/tools/{managed-file-error.d.ts → transfer/managed-file-error.d.ts} +1 -1
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
- package/dist/tools/{mount-download.d.ts → transfer/mount-download.d.ts} +1 -1
- package/dist/tools/transfer/mount-download.d.ts.map +1 -0
- package/dist/tools/{mount-upload.d.ts → transfer/mount-upload.d.ts} +1 -1
- package/dist/tools/transfer/mount-upload.d.ts.map +1 -0
- package/dist/tools/transfer/native-result.d.ts.map +1 -0
- package/dist/tools/{upload-core.d.ts → transfer/upload-core.d.ts} +1 -1
- package/dist/tools/transfer/upload-core.d.ts.map +1 -0
- package/dist/tools/transfer/view-file-contract.d.ts.map +1 -0
- package/dist/tools/{view-file.d.ts → transfer/view-file.d.ts} +1 -1
- package/dist/tools/transfer/view-file.d.ts.map +1 -0
- package/dist/tools/transports.d.ts +1 -1
- package/dist/tools/transports.d.ts.map +1 -1
- package/dist/tracking/contract.d.ts +1 -1
- package/dist/tracking/contract.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +33 -0
- package/llms/agent-runtime-coding-tools.txt +58 -0
- package/llms/agent-runtime-harness.txt +45 -0
- package/llms/agent-runtime-openrouter.txt +22 -0
- package/llms/agent-runtime-sandbox.txt +159 -0
- package/llms/agent-runtime-sqlite-bun.txt +29 -0
- package/llms/agent-runtime-sqlite-node.txt +26 -0
- package/llms/agent-runtime-testing.txt +30 -0
- package/llms/agent-runtime.2.txt +550 -0
- package/llms/agent-runtime.3.txt +311 -0
- package/llms/agent-runtime.txt +893 -0
- package/llms/application-diagnostic-journal.txt +30 -0
- package/llms/application-grammy.txt +27 -0
- package/llms/application-opentelemetry.txt +27 -0
- package/llms/application-schemas.txt +42 -0
- package/llms/application.2.txt +223 -0
- package/llms/application.txt +1144 -0
- package/llms/cli.txt +977 -0
- package/llms/contract.txt +606 -0
- package/llms/declaration.txt +286 -0
- package/llms/files.txt +30 -0
- package/llms/geo.txt +114 -0
- package/llms/google.txt +27 -0
- package/llms/live.txt +471 -0
- package/llms/node.txt +43 -0
- package/llms/oauth.txt +136 -0
- package/llms/observability.txt +893 -0
- package/llms/primitives.txt +158 -0
- package/llms/react.txt +184 -0
- package/llms/release.txt +176 -0
- package/llms/remote.txt +25 -0
- package/llms/server.2.txt +361 -0
- package/llms/server.3.txt +1031 -0
- package/llms/server.4.txt +905 -0
- package/llms/server.5.txt +250 -0
- package/llms/server.txt +996 -0
- package/llms/stitchkit.2.txt +836 -0
- package/llms/stitchkit.3.txt +147 -0
- package/llms/stitchkit.txt +260 -0
- package/llms/telegram.txt +30 -0
- package/llms/testing.txt +676 -0
- package/llms/tools-connections.txt +45 -0
- package/llms/tools-contract.txt +9 -0
- package/llms/tools-invoker.txt +9 -0
- package/llms/tools.2.txt +838 -0
- package/llms/tools.txt +1004 -0
- package/llms/tracking-server.txt +32 -0
- package/llms/tracking.txt +263 -0
- package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
- package/llms/upgrading-0.53.0-0.67.0.txt +1174 -0
- package/llms/upgrading-0.68.0-0.94.0.txt +1159 -0
- package/llms/upgrading.txt +215 -0
- package/llms-full.txt +214 -75
- package/llms.txt +54 -5
- package/package.json +84 -83
- package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
- package/dist/agent-runtime/durability-json.d.ts.map +0 -1
- package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
- package/dist/agent-runtime/durability.d.ts.map +0 -1
- package/dist/agent-runtime/store-driver.d.ts.map +0 -1
- package/dist/agent-runtime-browser.d.ts +0 -5
- package/dist/agent-runtime-browser.d.ts.map +0 -1
- package/dist/agent-runtime-coding-tools.d.ts.map +0 -1
- package/dist/agent-runtime-coding-tools.js +0 -23
- package/dist/agent-runtime-harness.d.ts.map +0 -1
- package/dist/agent-runtime-openrouter.d.ts.map +0 -1
- package/dist/agent-runtime-sandbox.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
- package/dist/agent-runtime-testing.d.ts +0 -3
- package/dist/agent-runtime-testing.d.ts.map +0 -1
- package/dist/agent-runtime-testing.js +0 -156
- package/dist/agent-runtime.d.ts.map +0 -1
- package/dist/application/channel.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.d.ts.map +0 -1
- package/dist/application-grammy.d.ts.map +0 -1
- package/dist/application-opentelemetry.d.ts.map +0 -1
- package/dist/application-schemas.d.ts.map +0 -1
- package/dist/application.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/contract/index.d.ts +0 -8
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/declaration.d.ts.map +0 -1
- package/dist/files.d.ts.map +0 -1
- package/dist/geo.d.ts.map +0 -1
- package/dist/google.d.ts.map +0 -1
- package/dist/index-0j3vcp5m.js +0 -28
- package/dist/index-a11g2kry.js +0 -866
- package/dist/index-cnyk6te3.js +0 -77
- package/dist/index-fadnxwna.js +0 -1046
- package/dist/index-hrbajay7.js +0 -1196
- package/dist/index-s8cnx02s.js +0 -90
- package/dist/index-v5573g1k.js +0 -142
- package/dist/index-vk3kq9sb.js +0 -3344
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/errors.d.ts.map +0 -1
- package/dist/internal/observability-sink.d.ts.map +0 -1
- package/dist/live.d.ts.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/node.d.ts.map +0 -1
- package/dist/oauth.d.ts.map +0 -1
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/primitives.d.ts +0 -3
- package/dist/primitives.d.ts.map +0 -1
- package/dist/react.d.ts.map +0 -1
- package/dist/release.d.ts.map +0 -1
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -88
- package/dist/retained.d.ts.map +0 -1
- package/dist/server/file-state-store.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/request.d.ts.map +0 -1
- package/dist/telegram.d.ts.map +0 -1
- package/dist/testing/agent-store-conformance.d.ts.map +0 -1
- package/dist/testing.d.ts +0 -39
- package/dist/testing.d.ts.map +0 -1
- package/dist/tool-invoker.d.ts.map +0 -1
- package/dist/tool-invoker.js +0 -21
- package/dist/tools/async-operation-contract.d.ts.map +0 -1
- package/dist/tools/async-operation.d.ts +0 -332
- package/dist/tools/async-operation.d.ts.map +0 -1
- package/dist/tools/cli-args.d.ts.map +0 -1
- package/dist/tools/cli-checkpoint.d.ts.map +0 -1
- package/dist/tools/cli-command.d.ts.map +0 -1
- package/dist/tools/cli-format.d.ts.map +0 -1
- package/dist/tools/cli-installer.d.ts.map +0 -1
- package/dist/tools/cli-invoke.d.ts.map +0 -1
- package/dist/tools/cli-manifest.d.ts.map +0 -1
- package/dist/tools/cli-policy.d.ts.map +0 -1
- package/dist/tools/cli-profile.d.ts.map +0 -1
- package/dist/tools/cli-signature.d.ts.map +0 -1
- package/dist/tools/cli-stream.d.ts.map +0 -1
- package/dist/tools/cli-update.d.ts.map +0 -1
- package/dist/tools/cli-view.d.ts.map +0 -1
- package/dist/tools/cli-wait.d.ts.map +0 -1
- package/dist/tools/cli.d.ts.map +0 -1
- package/dist/tools/coerce.d.ts.map +0 -1
- package/dist/tools/connections/index.d.ts.map +0 -1
- package/dist/tools/define-download-tool.d.ts.map +0 -1
- package/dist/tools/define-upload-tool.d.ts.map +0 -1
- package/dist/tools/define-view-file-tool.d.ts.map +0 -1
- package/dist/tools/define-wait-tool.d.ts.map +0 -1
- package/dist/tools/download-core.d.ts.map +0 -1
- package/dist/tools/flatten-join.d.ts.map +0 -1
- package/dist/tools/flatten.d.ts.map +0 -1
- package/dist/tools/json-schema-dialect.d.ts.map +0 -1
- package/dist/tools/json-schema.d.ts.map +0 -1
- package/dist/tools/managed-file-error.d.ts.map +0 -1
- package/dist/tools/mcp-app.d.ts.map +0 -1
- package/dist/tools/mcp-catalog.d.ts.map +0 -1
- package/dist/tools/mcp-handler.d.ts.map +0 -1
- package/dist/tools/mcp-prepare.d.ts.map +0 -1
- package/dist/tools/mcp-progress.d.ts.map +0 -1
- package/dist/tools/mcp-round-policy.d.ts.map +0 -1
- package/dist/tools/mcp-round.d.ts.map +0 -1
- package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
- package/dist/tools/mcp-stdio.d.ts.map +0 -1
- package/dist/tools/mcp-trace.d.ts.map +0 -1
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mount-download.d.ts.map +0 -1
- package/dist/tools/mount-upload.d.ts.map +0 -1
- package/dist/tools/mount-wait.d.ts.map +0 -1
- package/dist/tools/native-mcp.d.ts +0 -20
- package/dist/tools/native-mcp.d.ts.map +0 -1
- package/dist/tools/native-result.d.ts.map +0 -1
- package/dist/tools/oauth-metadata.d.ts.map +0 -1
- package/dist/tools/oauth-provider.d.ts.map +0 -1
- package/dist/tools/portable-formats.d.ts.map +0 -1
- package/dist/tools/presentation.d.ts.map +0 -1
- package/dist/tools/schema.d.ts.map +0 -1
- package/dist/tools/untyped-properties.d.ts.map +0 -1
- package/dist/tools/upload-core.d.ts.map +0 -1
- package/dist/tools/view-file-contract.d.ts.map +0 -1
- package/dist/tools/view-file.d.ts.map +0 -1
- package/dist/tools/wait-core.d.ts.map +0 -1
- package/dist/tools-contract.d.ts.map +0 -1
- package/dist/tools.d.ts +0 -50
- package/dist/tools.d.ts.map +0 -1
- package/dist/tracking-server.d.ts.map +0 -1
- package/dist/tracking.d.ts.map +0 -1
- package/dist/upgrade-cli.d.ts.map +0 -1
- package/dist/{retained.d.ts → browser/retained.d.ts} +0 -0
- package/dist/{declaration.d.ts → declaration/declaration.d.ts} +0 -0
- package/dist/{upgrade-cli.d.ts → entrypoints/bin/upgrade-cli.d.ts} +0 -0
- package/dist/{tracking-server.js → entrypoints/tracking/server.js} +0 -0
- package/dist/{google.d.ts → google/google.d.ts} +0 -0
- package/dist/{index-pq95qkbf.js → index-5jm36zv1.js} +0 -0
- package/dist/{index-actkayzn.js → index-70yj2ebz.js} +3 -3
- /package/dist/{application → internal}/channel.d.ts +0 -0
- /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
- /package/dist/{server → internal}/request.d.ts +0 -0
- /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
- /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
- /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
- /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
- /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
- /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
- /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
- /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
- /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
- /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
- /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
- /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
|
@@ -0,0 +1,1174 @@
|
|
|
1
|
+
# Upgrading 0.53.0 → 0.67.0 — stitchkit docs slice
|
|
2
|
+
|
|
3
|
+
> Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
|
|
4
|
+
> `llms.txt` in this package.
|
|
5
|
+
|
|
6
|
+
Contains: Guide: Upgrading, 0.53.0 → 0.67.0 (docs/guide/upgrading.md)
|
|
7
|
+
|
|
8
|
+
==============================================================================
|
|
9
|
+
# Guide: Upgrading, 0.53.0 → 0.67.0 (docs/guide/upgrading.md)
|
|
10
|
+
==============================================================================
|
|
11
|
+
|
|
12
|
+
## Released migration: 0.67.0
|
|
13
|
+
|
|
14
|
+
Three application-kernel changes. Two of them fix silent failures, so the most
|
|
15
|
+
important part of this migration is not what the compiler points at — it is the
|
|
16
|
+
two things that change with no compile error at all: **when your server is
|
|
17
|
+
created**, and **which shutdown budget a signal spends**.
|
|
18
|
+
|
|
19
|
+
### If you gave `managedServerResource` a thunk
|
|
20
|
+
|
|
21
|
+
It is now called during `start`, after the resource's dependencies are ready —
|
|
22
|
+
the reading the type always suggested. Before, it was called on the way *down*,
|
|
23
|
+
so `app.start()` resolved, the snapshot said `healthy` and `ready`, and nothing
|
|
24
|
+
was bound to the port.
|
|
25
|
+
|
|
26
|
+
If your application looked like this, it was never listening:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// before — resolves clean, listens on nothing
|
|
30
|
+
managedServerResource({ id: 'http', dependsOn: ['database'], server: () => createServer(config) })
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Nothing to change: the same code now binds the port. Check your startup logs for
|
|
34
|
+
a healthy report you never actually verified with a request.
|
|
35
|
+
|
|
36
|
+
If you used the spread workaround — this resource's phases over your own
|
|
37
|
+
`start` — it keeps working, and you can now delete it:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// before
|
|
41
|
+
let handle: ManagedServerHandle<T> | null = null
|
|
42
|
+
const shutdown = managedServerResource({ id: 'http', server: () => handle! })
|
|
43
|
+
const http = defineManagedResource({
|
|
44
|
+
...shutdown,
|
|
45
|
+
dependsOn: ['database', 'socket-io'],
|
|
46
|
+
start: () => { handle = createServer(config) },
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
// after
|
|
50
|
+
const http = managedServerResource({
|
|
51
|
+
id: 'http',
|
|
52
|
+
dependsOn: [database, socketIo],
|
|
53
|
+
server: () => createServer(config),
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
An already-created handle is adopted exactly as before.
|
|
58
|
+
|
|
59
|
+
### If you passed `shutdown` to `bindProcessSignals`
|
|
60
|
+
|
|
61
|
+
`bindProcessSignals` used to fill in the schema's defaults for every budget you
|
|
62
|
+
omitted, which made `createApplication({ shutdown })` unreachable on the signal
|
|
63
|
+
path — the one path production stops through. An application declaring five
|
|
64
|
+
seconds took thirty-five.
|
|
65
|
+
|
|
66
|
+
Declare the budget once, on the application, and delete the repetition:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
// before — the same two numbers in two places, and only one of them applied
|
|
70
|
+
const app = createApplication({ id: 'svc', resources, shutdown: SHUTDOWN_BUDGET })
|
|
71
|
+
bindProcessSignals(app, { shutdown: SHUTDOWN_BUDGET })
|
|
72
|
+
|
|
73
|
+
// after
|
|
74
|
+
const app = createApplication({ id: 'svc', resources, shutdown: SHUTDOWN_BUDGET })
|
|
75
|
+
bindProcessSignals(app)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Check this even if you change nothing.** If you declared a budget on the
|
|
79
|
+
application and did not repeat it on the binding, your process has been stopping
|
|
80
|
+
on 30 s / 5 s and will now stop on what you declared. Compare it against the
|
|
81
|
+
supervisor timeout that watches it — `kill_timeout`, `TimeoutStopSec` — because
|
|
82
|
+
that number was probably calculated from the declaration.
|
|
83
|
+
|
|
84
|
+
Passing `shutdown` to the binding still works and still wins, key by key: one
|
|
85
|
+
key overrides that key alone and leaves the other at the declaration.
|
|
86
|
+
|
|
87
|
+
### If you read `resource.dependsOn`
|
|
88
|
+
|
|
89
|
+
Its type widened from `readonly string[]` to `readonly ManagedResourceDependency[]`
|
|
90
|
+
— `string | ManagedResource` — so a dependency can be declared as the resource
|
|
91
|
+
itself. Declaring stays compatible; reading needs one call:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
// before
|
|
95
|
+
const ids: readonly string[] = resource.dependsOn ?? []
|
|
96
|
+
|
|
97
|
+
// after
|
|
98
|
+
import { managedResourceDependencyId } from 'stitchkit/application'
|
|
99
|
+
const ids = (resource.dependsOn ?? []).map(managedResourceDependencyId)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### If you thread a handle through a module-local
|
|
103
|
+
|
|
104
|
+
This is the pattern the change exists to remove, and it is opt-in — nothing
|
|
105
|
+
breaks if you keep yours:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
// before
|
|
109
|
+
let socket: SocketHandle | null = null
|
|
110
|
+
const socketIo = defineManagedResource({
|
|
111
|
+
id: 'socket-io',
|
|
112
|
+
start: async () => { socket = await createSocketServer(config) },
|
|
113
|
+
})
|
|
114
|
+
const http = defineManagedResource({
|
|
115
|
+
id: 'http',
|
|
116
|
+
dependsOn: ['socket-io'],
|
|
117
|
+
start: () => {
|
|
118
|
+
if (!socket) throw new Error('socket is not initialized') // unreachable
|
|
119
|
+
server = createServer({ socket })
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
// after
|
|
124
|
+
const socketIo = defineManagedResource({
|
|
125
|
+
id: 'socket-io',
|
|
126
|
+
start: async () => ({ value: await createSocketServer(config) }),
|
|
127
|
+
})
|
|
128
|
+
const http = defineManagedResource({
|
|
129
|
+
id: 'http',
|
|
130
|
+
dependsOn: [socketIo],
|
|
131
|
+
start: (context) => {
|
|
132
|
+
server = createServer({ socket: context.use(socketIo) }) // SocketHandle
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Declare the dependency with the **resource** when you intend to read from it —
|
|
138
|
+
that is the form `use` can type. `use` refuses a resource missing from
|
|
139
|
+
`dependsOn`, and refuses one that published no value; the second refusal is a
|
|
140
|
+
compile error too.
|
|
141
|
+
|
|
142
|
+
## Released migration: 0.66.0
|
|
143
|
+
|
|
144
|
+
Three changes, and only one of them is a feature. The other two are shapes that
|
|
145
|
+
would have had to break later: a vocabulary that described one fact with two
|
|
146
|
+
words, and a store whose only read was the whole conversation.
|
|
147
|
+
|
|
148
|
+
The compiler points at most of it. Two things change with no compile error —
|
|
149
|
+
what a **total** says about its own provenance, and the fact that token counts
|
|
150
|
+
are now validated where they were not.
|
|
151
|
+
|
|
152
|
+
### An input that joins a run in flight
|
|
153
|
+
|
|
154
|
+
#### If you matched exhaustively on `AgentTerminalReason`
|
|
155
|
+
|
|
156
|
+
`'absorbed'` is new. A run ends this way when a run already in flight took its
|
|
157
|
+
input on and answered it; its state is `'superseded'`, and `absorbedIntoRunId`
|
|
158
|
+
names the run that has the answer.
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
// after
|
|
162
|
+
switch (run.terminalReason) {
|
|
163
|
+
// …
|
|
164
|
+
case 'absorbed':
|
|
165
|
+
// no assistant message of its own — follow run.absorbedIntoRunId
|
|
166
|
+
break
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
A run record with `terminalReason: 'absorbed'` and no `absorbedIntoRunId` is
|
|
171
|
+
refused at parse time, and so is `absorbedIntoRunId` on any other reason.
|
|
172
|
+
|
|
173
|
+
#### If you render or export runs
|
|
174
|
+
|
|
175
|
+
An absorbed run has **no assistant message**. Anything that assumes "every
|
|
176
|
+
terminal run has one" needs the `absorbed` case — the answer is on the run
|
|
177
|
+
`absorbedIntoRunId` names, and `store.loadRun` resolves it.
|
|
178
|
+
|
|
179
|
+
#### If you want the policy
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
// after
|
|
183
|
+
runs: { inputPolicy: 'inject' }
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
It was withdrawn in 0.65.0 and is back with the ordering corrected: the
|
|
187
|
+
absorption commits with the terminal record, not at the step boundary. Read
|
|
188
|
+
*An input that joins a run in flight* in the agent-runtime guide before turning
|
|
189
|
+
it on — in particular what happens when the absorbing run does not complete, and
|
|
190
|
+
how it composes with `coalescePending`.
|
|
191
|
+
|
|
192
|
+
#### If you implement a store driver
|
|
193
|
+
|
|
194
|
+
Nothing to do, but know what changed underneath: one terminal commit can now
|
|
195
|
+
save **two** run records, and they must land in the same transaction. A driver
|
|
196
|
+
that persists one of the pair fails `runAgentStoreConformance`.
|
|
197
|
+
|
|
198
|
+
### A run read without its conversation
|
|
199
|
+
|
|
200
|
+
#### If you implement `AgentRuntimeStore` by hand
|
|
201
|
+
|
|
202
|
+
Two members to add. **If your adapter is an `AgentRuntimeStoreDriver` passed to
|
|
203
|
+
`createAgentRuntimeStore`, there is nothing to do** — the driver already had
|
|
204
|
+
everything both need.
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
// after
|
|
208
|
+
loadRun(input: { conversationId: string; runId: string }): Promise<AgentRunView | undefined>
|
|
209
|
+
listActiveRuns(conversationId: string): Promise<readonly AgentRun[]>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`AgentRunView` is `{ snapshotVersion, run, assistant? }`. `assistant` is the
|
|
213
|
+
retained terminal answer, so it is present exactly when the run has ended and
|
|
214
|
+
absent while it is live — a store that returns a live run's draft here lets the
|
|
215
|
+
terminal path resolve a run that has not finished. `listActiveRuns` orders by
|
|
216
|
+
`createdAt` then `id`, and must not report a run that has ended.
|
|
217
|
+
`runAgentStoreConformance` covers both, including the boundary cases.
|
|
218
|
+
|
|
219
|
+
#### If you have a store **double** in your tests
|
|
220
|
+
|
|
221
|
+
The runtime now reads `loadRun` where it used to read `loadSnapshot`. A double
|
|
222
|
+
that simulates a condition — a run drifting to another owner, a stale fencing
|
|
223
|
+
token — must apply it to both reads, or the code under test will not see it.
|
|
224
|
+
This is not hypothetical: it turned one of this repository's own fixtures into
|
|
225
|
+
an infinite retry loop, which is how the bounded retry below was found.
|
|
226
|
+
|
|
227
|
+
#### Nothing else changes
|
|
228
|
+
|
|
229
|
+
`loadSnapshot` behaves exactly as before, and still returns the whole
|
|
230
|
+
conversation — as does every mutation result. What it costs, and what bounds it,
|
|
231
|
+
is now written down in *Reading a conversation* in the agent-runtime guide.
|
|
232
|
+
|
|
233
|
+
### One provenance vocabulary, and integral tokens
|
|
234
|
+
|
|
235
|
+
#### If you match on `'measured'`
|
|
236
|
+
|
|
237
|
+
A **total** now says `computed`, because it is a sum this code performed rather
|
|
238
|
+
than a count it took — the same rule `AgentUsage` has always applied to a run's
|
|
239
|
+
spend. Two values change with no compile error:
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
// before
|
|
243
|
+
if (result.totalTokens.provenance === 'measured') { /* exact */ }
|
|
244
|
+
// after
|
|
245
|
+
if (result.totalTokens.provenance === 'computed') { /* exact, and derived */ }
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
It affects `AgentHistoryBudgetResult.totalTokens` and
|
|
249
|
+
`ComposedAgentPrompt.instructionTokens`. A per-message or per-section count is
|
|
250
|
+
still `measured` — only the totals moved. When any part was estimated the total
|
|
251
|
+
is still `estimated`: an estimate survives arithmetic, and that is the weaker
|
|
252
|
+
claim, so it wins.
|
|
253
|
+
|
|
254
|
+
#### If you produce token counts
|
|
255
|
+
|
|
256
|
+
They are validated now, in the places they were not. A fractional count throws
|
|
257
|
+
where it used to flow into the context-window arithmetic:
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
// refused from this release on
|
|
261
|
+
estimateTokens: (text) => ({ value: text.length / 4, provenance: 'estimated' })
|
|
262
|
+
// after
|
|
263
|
+
estimateTokens: (text) => ({ value: Math.ceil(text.length / 4), provenance: 'estimated' })
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
The same applies to `ComposeAgentPromptOptions.estimateFallback` and
|
|
267
|
+
`.historyTokens`, to `AgentPromptBudget.toolSchemas` / `.attachments` /
|
|
268
|
+
`.providerOverhead`, and to `AgentPromptBudget.contextWindow` /
|
|
269
|
+
`.reservedOutput`, which must now be non-negative safe integers.
|
|
270
|
+
|
|
271
|
+
`AgentUsageValue.value` is `z.int()` too, which matters if you build usage
|
|
272
|
+
records by hand or in a store double. A figure arriving from a **provider** is
|
|
273
|
+
not thrown — `normalizeSdkUsage` and the OpenRouter adapter turn a non-integer
|
|
274
|
+
into `{ provenance: 'unavailable' }`, so a run that already answered is not
|
|
275
|
+
failed over its own bookkeeping.
|
|
276
|
+
|
|
277
|
+
#### The new export
|
|
278
|
+
|
|
279
|
+
`AgentProvenanceSchema` / `AgentProvenance` is the whole vocabulary:
|
|
280
|
+
`provider-reported`, `measured`, `computed`, `estimated`, `unavailable`. Each
|
|
281
|
+
surface declares its subset, so nothing widened — `AgentUsageValue` still refuses
|
|
282
|
+
`measured` and `AgentTokenCount` still refuses `provider-reported`. Use it when
|
|
283
|
+
you want one switch over the question instead of two.
|
|
284
|
+
|
|
285
|
+
## Released migration: 0.65.0
|
|
286
|
+
|
|
287
|
+
The largest migration of the pre-1.0 line, and most of it is the compiler
|
|
288
|
+
pointing at things. One item is a feature withdrawal and two change behaviour
|
|
289
|
+
with no compile error at all.
|
|
290
|
+
|
|
291
|
+
### A projection a provider accepts, and a policy withdrawn
|
|
292
|
+
|
|
293
|
+
### If you compact, or use `system-note`, you were broken and now are not
|
|
294
|
+
|
|
295
|
+
No code change to adopt the fix — but **check your own code if you call
|
|
296
|
+
`projectAgentHistory` yourself.** System and summary records no longer appear in
|
|
297
|
+
`messages`; they come back in `system` and belong in the provider's instructions
|
|
298
|
+
channel, which is the only place `ai` accepts them:
|
|
299
|
+
|
|
300
|
+
```ts
|
|
301
|
+
// before — the provider refuses this outright
|
|
302
|
+
const messages = await projectAgentHistory(snapshot.messages)
|
|
303
|
+
streamText({ model, messages })
|
|
304
|
+
|
|
305
|
+
// after
|
|
306
|
+
const { messages, system } = await projectAgentHistoryDetailed(snapshot.messages)
|
|
307
|
+
streamText({
|
|
308
|
+
model,
|
|
309
|
+
instructions: system.map((content) => ({ role: 'system', content })),
|
|
310
|
+
messages,
|
|
311
|
+
})
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
If you use `createAgentRuntime`, this is handled for you.
|
|
315
|
+
|
|
316
|
+
### `inputPolicy: 'inject'` is withdrawn
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
// before
|
|
320
|
+
runs: { inputPolicy: 'inject' }
|
|
321
|
+
// after
|
|
322
|
+
runs: { inputPolicy: 'queue' }
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`'absorbed'`, `AgentRun.absorbedIntoRunId` and `AgentRuntimeStore.absorbQueuedRun`
|
|
326
|
+
go with it. A driver built on `AgentRuntimeStoreDriver` needs no change.
|
|
327
|
+
|
|
328
|
+
### Records must agree with themselves
|
|
329
|
+
|
|
330
|
+
If you construct `AgentRun` values — a store double, a fixture, a migration —
|
|
331
|
+
derive the state instead of setting it:
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
// after
|
|
335
|
+
import { runStateForTerminalReason } from 'stitchkit/agent-runtime'
|
|
336
|
+
AgentRunSchema.parse({ …run, terminalReason: reason, state: runStateForTerminalReason(reason) })
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
A terminal state with no reason, a queued run carrying one, and `policy_stop`
|
|
340
|
+
without a `terminalPolicyName` are now all refused at parse time.
|
|
341
|
+
|
|
342
|
+
### Enum and field changes the compiler will point at
|
|
343
|
+
|
|
344
|
+
- `AgentTerminalReason`: `'tool_failure'` removed (never produced),
|
|
345
|
+
`'context_overflow'` added — this runtime's own refusal when the prompt does
|
|
346
|
+
not fit, which used to report `provider_failure`.
|
|
347
|
+
- `AgentRunState`: `'absorbed'` removed.
|
|
348
|
+
- `AgentRunMetrics.usage` is required.
|
|
349
|
+
- `AgentHistoryBudgetDecision['reason']`: `'superseded'` → `'unspeakable'`.
|
|
350
|
+
|
|
351
|
+
### Two behaviour changes with no compile error
|
|
352
|
+
|
|
353
|
+
- **`loop.idleTimeoutMs` now defaults to 60 000.** A run whose provider stream
|
|
354
|
+
goes quiet for a minute ends as `timeout` instead of holding the lane forever.
|
|
355
|
+
Pass `null` for the old behaviour, and think about why you want it.
|
|
356
|
+
- **`advanceAgentRuntimeEventCursor` stops returning `gap` for durable events.**
|
|
357
|
+
If you reload a conversation on `gap`, you were reloading after essentially
|
|
358
|
+
every run. Transient events still report it, and there it is real.
|
|
359
|
+
|
|
360
|
+
## Released migration: 0.64.0
|
|
361
|
+
|
|
362
|
+
Two changes, and only one of them can break a build. Nothing was removed.
|
|
363
|
+
|
|
364
|
+
### An event that says which kind it is
|
|
365
|
+
|
|
366
|
+
### Narrow `AgentRunEvent` on `type`
|
|
367
|
+
|
|
368
|
+
```ts
|
|
369
|
+
// before
|
|
370
|
+
for (const event of events) record(event.usage?.cost?.value ?? 0)
|
|
371
|
+
|
|
372
|
+
// after — and the compiler will point at every site
|
|
373
|
+
for (const event of events) {
|
|
374
|
+
if (event.type !== 'run-terminal') continue
|
|
375
|
+
record(event.usage.cost.value ?? null) // `usage` is present; unknown says so
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
`step` is now required on `step-finished`, `terminalReason` on `run-terminal`,
|
|
380
|
+
and `usage` on both. `queueWaitMs` exists only on `run-started`. Nothing was
|
|
381
|
+
removed — the fields that were optional because a *different* kind of event
|
|
382
|
+
lacked them are now simply on the kinds that have them.
|
|
383
|
+
|
|
384
|
+
Import `AgentRunTerminalEventSchema` (or the sibling schemas) if you construct
|
|
385
|
+
events in tests.
|
|
386
|
+
|
|
387
|
+
### If you implement `AgentRuntimeStore` directly, move to the driver
|
|
388
|
+
|
|
389
|
+
Not urgent and nothing breaks today — but the aggregate is no longer the
|
|
390
|
+
supported target, so its future growth will not be announced as breaking
|
|
391
|
+
(→ ADR 0111). The supported shape is one line:
|
|
392
|
+
|
|
393
|
+
```ts
|
|
394
|
+
const driver: AgentRuntimeStoreDriver<TransactionClient> = { /* six primitives */ }
|
|
395
|
+
export const store = createAgentRuntimeStore(driver)
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
Run `runAgentStoreConformance` against your adapter before and after any bump —
|
|
399
|
+
see *Before you bump, if you implement an agent store* above.
|
|
400
|
+
|
|
401
|
+
## Released migration: 0.63.0
|
|
402
|
+
|
|
403
|
+
Four changes to what a running system reports and how an input reaches a run
|
|
404
|
+
in flight. Nothing moves an export except one added store member, and only an
|
|
405
|
+
application implementing `AgentRuntimeStore` directly has to touch code.
|
|
406
|
+
|
|
407
|
+
### A spend figure that survives, and an input that joins
|
|
408
|
+
|
|
409
|
+
### `AgentRuntimeStore` has a ninth member
|
|
410
|
+
|
|
411
|
+
Only if you implement the aggregate interface directly — an adapter built on
|
|
412
|
+
`AgentRuntimeStoreDriver` needs no change, and the public conformance kit covers
|
|
413
|
+
the new operation.
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
// after
|
|
417
|
+
absorbQueuedRun(input: AbsorbQueuedRun): Promise<AgentStoreMutationResult>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
It moves a queued successor's inputs into the run already answering, in one
|
|
421
|
+
mutation, and marks the successor `absorbed`. Two run records change in one
|
|
422
|
+
transaction — if your driver persists them one at a time, persist both.
|
|
423
|
+
|
|
424
|
+
### A provider failure says so
|
|
425
|
+
|
|
426
|
+
```ts
|
|
427
|
+
// before — an upstream error arrived as a policy stop with no policy
|
|
428
|
+
if (terminal.reason === 'policy_stop') retryLater()
|
|
429
|
+
|
|
430
|
+
// after
|
|
431
|
+
if (terminal.reason === 'provider_failure') retryLater()
|
|
432
|
+
if (terminal.reason === 'provider_stop') { /* a length cap or content filter */ }
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
`policy_stop` now always carries the `policyName` that caused it. If you switch
|
|
436
|
+
exhaustively on `AgentTerminalReason` or `AgentRunState`, add `'provider_stop'`
|
|
437
|
+
and `'absorbed'`.
|
|
438
|
+
|
|
439
|
+
### `partial` changed meaning
|
|
440
|
+
|
|
441
|
+
It used to tell you which event kind you were holding. It now tells you whether
|
|
442
|
+
the figure beside it is a confirmed total:
|
|
443
|
+
|
|
444
|
+
```ts
|
|
445
|
+
// after — true when the provider never reported the run finished
|
|
446
|
+
if (metrics.partial) treatAsFloor(metrics.usage)
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
Terminal events for runs that were superseded, interrupted, timed out or failed
|
|
450
|
+
before the provider finished now report `partial: true` where they reported
|
|
451
|
+
`false`.
|
|
452
|
+
|
|
453
|
+
### Checkpoint metrics are a running total
|
|
454
|
+
|
|
455
|
+
```ts
|
|
456
|
+
// wrong, and now wrong by more than it used to be
|
|
457
|
+
const spent = checkpoints.reduce((total, c) => total + (c.metrics.usage?.cost?.value ?? 0), 0)
|
|
458
|
+
// right
|
|
459
|
+
const spent = checkpoints.at(-1)?.metrics.usage?.cost?.value
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### You can read a run's spend back from the store
|
|
463
|
+
|
|
464
|
+
`AgentRun.usage` is written at every checkpoint and with the terminal record, so
|
|
465
|
+
a dropped observability event no longer loses the number, and a process that dies
|
|
466
|
+
mid-stream leaves behind what it had already spent.
|
|
467
|
+
|
|
468
|
+
## Released migration: 0.62.0
|
|
469
|
+
|
|
470
|
+
Two groups of behaviour changes. Nothing moves an export — the surface is
|
|
471
|
+
strictly additive — and every item changes what a running system reports or
|
|
472
|
+
sends, which is what this heading is for. One of them changes a number you may
|
|
473
|
+
already be billing against.
|
|
474
|
+
|
|
475
|
+
### A run reports what it spent
|
|
476
|
+
|
|
477
|
+
Three changes to what the runtime says about cost and tokens. Nothing moves an
|
|
478
|
+
export; all three change numbers a running system reports, and one of them
|
|
479
|
+
changes a number you may already be billing against.
|
|
480
|
+
|
|
481
|
+
#### Multi-step cost was under-reported and is now summed
|
|
482
|
+
|
|
483
|
+
No code change is needed to get the fix — but check any predicate that reads
|
|
484
|
+
`provenance`:
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
// before — accepted a number that was one step's cost, not the run's
|
|
488
|
+
if (usage.cost?.provenance === 'provider-reported') bill(usage.cost.value)
|
|
489
|
+
|
|
490
|
+
// after — a sum stitchkit performed says so
|
|
491
|
+
if (usage.cost && usage.cost.provenance !== 'unavailable') bill(usage.cost.value)
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
`'computed'` means stitchkit added up provider-reported parts. It is not a guess
|
|
495
|
+
— `'estimated'` is the word for that — but it is deliberately not
|
|
496
|
+
`'provider-reported'`, because that label is what a caller filters on when it
|
|
497
|
+
wants a figure it can bill against unchanged, and a sum is not one.
|
|
498
|
+
|
|
499
|
+
Token totals moved with it. The AI SDK's `totalUsage` is a sum *it* performed
|
|
500
|
+
over per-step provider figures — not a run total any provider handed over — so
|
|
501
|
+
labelling it `provider-reported` was the same overstatement. **A run total on a
|
|
502
|
+
terminal event is always `computed`.** If you want a figure with the provider's
|
|
503
|
+
own word on it, read `step-finished`: each step carries what that call reported.
|
|
504
|
+
|
|
505
|
+
#### `usage` is always present on a terminal event
|
|
506
|
+
|
|
507
|
+
```ts
|
|
508
|
+
// before — absent when the run ended before the provider's `finish`
|
|
509
|
+
const spent = event.usage?.cost?.value ?? 0 // silently 0 for a real spend
|
|
510
|
+
|
|
511
|
+
// after — present, and it says what it does not know
|
|
512
|
+
event.usage?.cost?.provenance === 'unavailable' // we spent, and cannot say how much
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
Keep the optional chaining: one `AgentRunEvent` shape covers `run-started`,
|
|
516
|
+
`step-finished` and `run-terminal`, so `usage` stays optional on the type. The
|
|
517
|
+
guarantee is about terminal events, and a schema shared with `run-started`
|
|
518
|
+
cannot express it.
|
|
519
|
+
|
|
520
|
+
**Do not read `unavailable` as zero.** A run aborted mid-stream has spent real
|
|
521
|
+
money that nobody has counted; a run that never reached the provider has not.
|
|
522
|
+
Both used to look the same and now do not.
|
|
523
|
+
|
|
524
|
+
#### A losing executor reports its own spend
|
|
525
|
+
|
|
526
|
+
An execution that loses the terminal compare-and-swap now emits an operator
|
|
527
|
+
`run-terminal` event, because it ran and it spent. If a sink treated those events
|
|
528
|
+
as "runs this process committed", that is no longer true — `AgentRuntimeResult.metrics`
|
|
529
|
+
is still `undefined` for a losing executor and remains the way to tell.
|
|
530
|
+
|
|
531
|
+
The *delivery* `terminal` event is unchanged and still fires only for the winner,
|
|
532
|
+
so nothing delivers a turn twice.
|
|
533
|
+
|
|
534
|
+
### An interrupted answer stops passing as a finished one
|
|
535
|
+
|
|
536
|
+
Two behaviour changes, one shared cause: a run ended by a newer input used to
|
|
537
|
+
leave its half-written answer in the conversation with no sign that it was cut
|
|
538
|
+
off, and the next request to the provider carried it as an ordinary assistant
|
|
539
|
+
turn.
|
|
540
|
+
|
|
541
|
+
#### The projection marks an interrupted turn
|
|
542
|
+
|
|
543
|
+
Nothing to change to adopt the fix — the default is the fixed behaviour. What to
|
|
544
|
+
check is whether the marker is the *right* form for your surface, and the
|
|
545
|
+
question that decides it is not "was the run interrupted" but **"did anyone see
|
|
546
|
+
what it produced"**.
|
|
547
|
+
|
|
548
|
+
```ts
|
|
549
|
+
// after — pick the form; the default is 'assistant-marked'
|
|
550
|
+
createAgentRuntime({ history: { interruptedAssistant: 'system-note' } })
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
- **The user pressed stop and the text was on their screen** — keep
|
|
554
|
+
`'assistant-marked'`. The assistant turn is the truthful record of what the
|
|
555
|
+
human read, and the model should stay consistent with it.
|
|
556
|
+
- **The partial never reached anyone** — a surface that sends nothing until the
|
|
557
|
+
run is done — prefer `'system-note'`. An assistant turn in provider history is
|
|
558
|
+
a commitment the model stays consistent with; a system line is context.
|
|
559
|
+
|
|
560
|
+
If you pass `history.project` you own the projection outright and none of this
|
|
561
|
+
applies — but the same question does.
|
|
562
|
+
|
|
563
|
+
#### A run ended by a newer input can now say so
|
|
564
|
+
|
|
565
|
+
```ts
|
|
566
|
+
// before
|
|
567
|
+
runs: { inputPolicy: 'interrupt' } // ends the run, keeps its partial answer
|
|
568
|
+
|
|
569
|
+
// after — for a surface where a follow-up message invalidates the answer
|
|
570
|
+
// in flight rather than merely stopping it
|
|
571
|
+
runs: { inputPolicy: 'supersede' } // ends the run, discards its partial answer
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
`inputPolicy` also accepts `(input) => policy`, which is how one application
|
|
575
|
+
gives two conversation surfaces different rules without the runtime learning
|
|
576
|
+
which is which.
|
|
577
|
+
|
|
578
|
+
A superseded run terminates with `terminalReason: 'superseded'`, state
|
|
579
|
+
`'superseded'` and an assistant message of status `'superseded'`. **If you switch
|
|
580
|
+
exhaustively on any of those enums, add the arm** — that is the part of this
|
|
581
|
+
release that can break a build rather than a behaviour. The record itself is
|
|
582
|
+
kept: it is excluded from the projection, not deleted, so an operator can still
|
|
583
|
+
see what was thrown away.
|
|
584
|
+
|
|
585
|
+
## Released migration: 0.61.0
|
|
586
|
+
|
|
587
|
+
Three behaviour changes between versions. None moves an export — the surface is
|
|
588
|
+
strictly additive — and all three change what a running system does, which is
|
|
589
|
+
what this heading is for.
|
|
590
|
+
|
|
591
|
+
### A failed `start()` now drains before it rejects
|
|
592
|
+
|
|
593
|
+
The rollback of a failed startup used to close every resource with a zero
|
|
594
|
+
budget: it returned almost at once, by severing requests the server had already
|
|
595
|
+
accepted. It now spends the application's shutdown budget, so a request already
|
|
596
|
+
in flight is answered rather than killed.
|
|
597
|
+
|
|
598
|
+
**What to check.** Nothing, if a failed startup has nothing in flight — the
|
|
599
|
+
rollback still returns immediately. The case to think about is a request that
|
|
600
|
+
never finishes: a hung upstream, a client ignoring a close frame, a streaming
|
|
601
|
+
subscription. Under the default 30s grace and 5s force, a `start()` that used to
|
|
602
|
+
reject in milliseconds can now take 35 seconds to reject.
|
|
603
|
+
|
|
604
|
+
If a fast failure matters more than draining — a supervisor waiting to restart,
|
|
605
|
+
a boot check in CI — declare a smaller budget. The same field is the default for
|
|
606
|
+
`shutdown()` with no options, so this is one decision, not two:
|
|
607
|
+
|
|
608
|
+
```ts
|
|
609
|
+
// before
|
|
610
|
+
createApplication({ id: 'app', resources })
|
|
611
|
+
|
|
612
|
+
// after
|
|
613
|
+
createApplication({
|
|
614
|
+
id: 'app',
|
|
615
|
+
resources,
|
|
616
|
+
shutdown: { gracePeriodMs: 5_000, forceTimeoutMs: 1_000 },
|
|
617
|
+
})
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
The budget is a real bound: a `close` that never returns is abandoned when it
|
|
621
|
+
runs out and reported as a `close` failure, and the startup error remains the
|
|
622
|
+
`cause` of the `AggregateError` `start()` rejects with. → ADR 0107
|
|
623
|
+
|
|
624
|
+
### A refused realtime frame now answers its sender
|
|
625
|
+
|
|
626
|
+
A frame that fails the receiver's `args` schema used to be dropped where it
|
|
627
|
+
landed. If the event carries an acknowledgement, the receiver now answers it
|
|
628
|
+
with a reserved envelope and the sender's `request()` rejects at once with
|
|
629
|
+
`RealtimeRequestRejectedError`. → ADR 0106
|
|
630
|
+
|
|
631
|
+
**What to check before you upgrade one half of a distributed pair.** Look at the
|
|
632
|
+
`ack` schemas on the OLDER peer:
|
|
633
|
+
|
|
634
|
+
```ts
|
|
635
|
+
// safe: a contract-first acknowledgement refuses the envelope, so the older
|
|
636
|
+
// peer raises RealtimeRequestInvalidAcknowledgementError at once instead of
|
|
637
|
+
// waiting out its deadline. Different error, still an error, and sooner.
|
|
638
|
+
ack: z.object({ stored: z.boolean() })
|
|
639
|
+
|
|
640
|
+
// NOT safe: a schema that validates nothing accepts the refusal AS A VALUE.
|
|
641
|
+
// The older peer reads a refusal as a successful acknowledgement — silently.
|
|
642
|
+
ack: z.unknown()
|
|
643
|
+
ack: z.looseObject({})
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
If any acknowledgement on the older side is permissive, tighten it before the
|
|
647
|
+
rollout, or upgrade both halves together.
|
|
648
|
+
|
|
649
|
+
Also: the receiver now invokes the peer's raw acknowledgement callback for a
|
|
650
|
+
refused frame, including when the peer is a plain Socket.IO client. That
|
|
651
|
+
callback previously could not run on a refused frame and now can.
|
|
652
|
+
|
|
653
|
+
`RealtimeRejectedEvent['reason']` gained `'rejected-by-peer'`. If you `switch`
|
|
654
|
+
over it exhaustively with an `assertNever` default, that stops compiling — add
|
|
655
|
+
the case.
|
|
656
|
+
|
|
657
|
+
### Two smaller behaviour changes, easy to miss
|
|
658
|
+
|
|
659
|
+
**`streamSSE`'s `cancel` no longer awaits the generator.** Teardown is now
|
|
660
|
+
unordered relative to request completion. If your generator releases a resource
|
|
661
|
+
in `return()`/`finally` — a temp file, a pooled connection — and anything
|
|
662
|
+
downstream assumed that had finished by the time the response settled, it no
|
|
663
|
+
longer has. Release in the generator's own `finally` and do not depend on the
|
|
664
|
+
ordering.
|
|
665
|
+
|
|
666
|
+
**A `socket.io-client` peer that cannot load no longer kills the process.** With
|
|
667
|
+
`onConnectError` configured, the failure is delivered there with
|
|
668
|
+
`terminal: true` instead of crashing. If your handler logs and moves on, you now
|
|
669
|
+
have a live process whose client will never connect, where a supervisor used to
|
|
670
|
+
restart it. Treat `terminal: true` as fatal if that is what you want.
|
|
671
|
+
|
|
672
|
+
### `reportHealth` inside `start` is no longer discarded
|
|
673
|
+
|
|
674
|
+
Becoming ready assigned `healthy` unconditionally, throwing away whatever a
|
|
675
|
+
resource reported during `start`. It is now kept, and only a resource that
|
|
676
|
+
reported nothing is assumed healthy.
|
|
677
|
+
|
|
678
|
+
**How to find what this touches:** grep your `start` bodies for **every**
|
|
679
|
+
`reportHealth` call, not only the ones reporting `degraded`. The old
|
|
680
|
+
unconditional assignment was also a repair — a resource that reported
|
|
681
|
+
`'unhealthy'` early in `start` and never corrected itself was quietly fixed up
|
|
682
|
+
on the way to ready.
|
|
683
|
+
|
|
684
|
+
Two cases, and they need opposite fixes.
|
|
685
|
+
|
|
686
|
+
**1. A resource that is genuinely expected to start degraded** — up, but still
|
|
687
|
+
dialling something external. `required` defaults to **`true`**, and readiness
|
|
688
|
+
requires every required resource to be healthy, so such a resource now refuses
|
|
689
|
+
the whole startup where before its report vanished. That is the invariant
|
|
690
|
+
working as intended; what changed is that it can be reached. Say what it is:
|
|
691
|
+
|
|
692
|
+
```ts
|
|
693
|
+
// before: started, and its report was discarded
|
|
694
|
+
defineManagedResource({ id: 'dialling', start: ({ reportHealth }) => reportHealth('degraded') })
|
|
695
|
+
|
|
696
|
+
// after: says what it is, and does not gate the application
|
|
697
|
+
defineManagedResource({ id: 'dialling', required: false, start: ({ reportHealth }) => reportHealth('degraded') })
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
**2. A resource that reported `'unhealthy'` early and became healthy later** —
|
|
701
|
+
a pessimistic report before a connection settled. Here `required: false` is the
|
|
702
|
+
**wrong** fix: it would hide a real failure. Report the recovery instead:
|
|
703
|
+
|
|
704
|
+
```ts
|
|
705
|
+
start: async ({ reportHealth }) => {
|
|
706
|
+
reportHealth('unhealthy')
|
|
707
|
+
await connect()
|
|
708
|
+
reportHealth('healthy') // ← previously unnecessary; now it is the fix
|
|
709
|
+
}
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
**Also check your health endpoint.** An **optional** resource reporting
|
|
713
|
+
non-healthy during `start` now moves the application aggregate to `degraded`,
|
|
714
|
+
where before it stayed `healthy`. A readiness probe that maps `degraded` to a
|
|
715
|
+
non-200 will flip on upgrade — and a supervisor that restarts on that will loop.
|
|
716
|
+
|
|
717
|
+
The refusals now say which of the two happened: a resource that was never
|
|
718
|
+
healthy is told it "is not healthy" and pointed at `required: false`; one that
|
|
719
|
+
was healthy and stopped is told it "lost readiness" and pointed at
|
|
720
|
+
`onResourceFailure`.
|
|
721
|
+
|
|
722
|
+
## Released migration: 0.60.0
|
|
723
|
+
|
|
724
|
+
### close() says what it achieved
|
|
725
|
+
|
|
726
|
+
`AgentRuntime.close()` returned `Promise<void>` and its contract promised three
|
|
727
|
+
things that cannot hold together. It now returns
|
|
728
|
+
`{ settled, timedOut, remaining }`.
|
|
729
|
+
|
|
730
|
+
Nothing breaks if you ignore the value:
|
|
731
|
+
|
|
732
|
+
```ts
|
|
733
|
+
await runtime.close({ gracePeriodMs: 30_000, forceTimeoutMs: 5_000 })
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
What DOES change is any code that relied on the old sentence "`close()` never
|
|
737
|
+
returns while a run is still in flight" while naming a `forceTimeoutMs`. That
|
|
738
|
+
was never true — the force budget exists precisely to stop waiting — so if your
|
|
739
|
+
process exits straight after `close()`, read the result:
|
|
740
|
+
|
|
741
|
+
```ts
|
|
742
|
+
const closed = await runtime.close({ gracePeriodMs: 30_000, forceTimeoutMs: 5_000 })
|
|
743
|
+
if (!closed.settled) {
|
|
744
|
+
// `closed.remaining` runs were still in flight. They stay recoverable
|
|
745
|
+
// through `scanRecoverable`; close never marks them terminal on its own.
|
|
746
|
+
logger.warn({ remaining: closed.remaining }, 'exiting with runs in flight')
|
|
747
|
+
}
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
If you want the old guarantee, omit `forceTimeoutMs`: that is the one
|
|
751
|
+
combination in which `close()` cannot return with a run in flight — and its wait
|
|
752
|
+
is unbounded, which is the trade.
|
|
753
|
+
|
|
754
|
+
A TypeScript consumer that wrote `const done: void = await runtime.close()` is
|
|
755
|
+
the only shape that stops compiling.
|
|
756
|
+
|
|
757
|
+
### one name per concept
|
|
758
|
+
|
|
759
|
+
`AgentModelDeclaration` was a bare alias of `AgentModelDescriptor`, so the same
|
|
760
|
+
type reached consumers under two exported names:
|
|
761
|
+
|
|
762
|
+
```ts
|
|
763
|
+
// before
|
|
764
|
+
defineModelRegistry<Record<string, AgentModelDeclaration>>({ … })
|
|
765
|
+
// after
|
|
766
|
+
defineModelRegistry<Record<string, AgentModelDescriptor>>({ … })
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
A find-and-replace covers it; there is no behavioural change. Kept name is
|
|
770
|
+
`AgentModelDescriptor`, the one paired with `AgentModelDescriptorSchema` and
|
|
771
|
+
returned by `registry.descriptor()`.
|
|
772
|
+
|
|
773
|
+
Two names that look like the same case and are **not** being merged:
|
|
774
|
+
`SocketEventMap` aliases Socket.IO's `EventsMap` so a vendor's name stays out of
|
|
775
|
+
our signatures, and `AgentRun.ownerId` holds the same value a runtime publishes
|
|
776
|
+
as `runtimeEpoch` on its events. The latter is one identity in two roles — "who
|
|
777
|
+
owns this run" and "which runtime emitted this event" — and both declarations
|
|
778
|
+
now say so. Renaming either would make the fencing comparison read worse.
|
|
779
|
+
|
|
780
|
+
### a reachable public surface
|
|
781
|
+
|
|
782
|
+
Three exports that the public API required and did not provide, plus one option
|
|
783
|
+
it accepted and ignored.
|
|
784
|
+
|
|
785
|
+
```ts
|
|
786
|
+
// before — identified by string, because the class was exported nowhere
|
|
787
|
+
if (error instanceof Error && error.name === 'AgentRuntimeConflictError') …
|
|
788
|
+
// after
|
|
789
|
+
import { AgentRuntimeConflictError } from 'stitchkit/agent-runtime'
|
|
790
|
+
if (error instanceof AgentRuntimeConflictError) …
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
`ActivityTokenBrand` is exported, so `ActivityProjection` can be implemented by
|
|
794
|
+
a test double. `STITCH_ERROR_STATUS` gained `APPLICATION_NOT_ACCEPTING` (503) —
|
|
795
|
+
only an exhaustive `satisfies Record<StitchErrorCode, …>` map stops compiling,
|
|
796
|
+
and the fix is one line. (`GRAMMY_WEBHOOK_NOT_ACCEPTING` joined it in 0.60.1,
|
|
797
|
+
under the same rule — see ADR 0105. This section briefly said the opposite: that
|
|
798
|
+
an adapter's code stays out of the registry. It does not, and leaving it out was
|
|
799
|
+
the worse of the two, because `isStitchErrorCode` then answered `false` and the
|
|
800
|
+
code reached the wire spelled stitchkit's way, past both `codeMap` and
|
|
801
|
+
`unmappedCode`.)
|
|
802
|
+
|
|
803
|
+
`application.shutdown()` no longer accepts `retryAfterSeconds`. Delete it from
|
|
804
|
+
the call — the kernel never read it. If you meant the HTTP `Retry-After` a
|
|
805
|
+
draining server sends, that lives on `managedServerResource({ retryAfterSeconds })`,
|
|
806
|
+
where it always did the work.
|
|
807
|
+
|
|
808
|
+
### one shutdown vocabulary
|
|
809
|
+
|
|
810
|
+
```ts
|
|
811
|
+
// before
|
|
812
|
+
await runtime.close({ drainTimeoutMs: 30_000, forceTimeoutMs: 5_000 })
|
|
813
|
+
// after
|
|
814
|
+
await runtime.close({ gracePeriodMs: 30_000, forceTimeoutMs: 5_000 })
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
The rename is mechanical. The behaviour change under it is not, and it is the
|
|
818
|
+
reason the rename waited: two combinations were traps.
|
|
819
|
+
`close({ drainTimeoutMs })` with no force budget aborted the runs and returned
|
|
820
|
+
**without waiting for them to settle** — so naming a budget gave a weaker
|
|
821
|
+
guarantee than naming none — and `close({ forceTimeoutMs })` with no drain
|
|
822
|
+
budget never read the force budget, leaving an unbounded wait. Both now behave
|
|
823
|
+
as their names say.
|
|
824
|
+
|
|
825
|
+
> **Superseded.** This section once ended "and `close()` never returns while a
|
|
826
|
+
> run is in flight". That was never true with a force budget — the budget exists
|
|
827
|
+
> to stop waiting — and `close()` now returns `{ settled, timedOut, remaining }`
|
|
828
|
+
> instead of promising it. See *Released migration: 0.60.0 → close() says what
|
|
829
|
+
> it achieved*, above.
|
|
830
|
+
|
|
831
|
+
If your shutdown path measured how long `close()` took, expect it to take
|
|
832
|
+
longer in exactly the case where it used to return early — that is the fix, not
|
|
833
|
+
a regression. Defaults stay per-surface: `ShutdownOptions.gracePeriodMs`
|
|
834
|
+
defaults to 30 seconds, and the runtime's omitted budget still means "abort
|
|
835
|
+
immediately", the behaviour `close()` has always had.
|
|
836
|
+
|
|
837
|
+
### unresolved attachments are omitted
|
|
838
|
+
|
|
839
|
+
`history.unresolvedFile` defaulted to `text`, and the placeholder it produced
|
|
840
|
+
carried the storage reference:
|
|
841
|
+
|
|
842
|
+
```ts
|
|
843
|
+
// before — the provider received your object key
|
|
844
|
+
// "[attachment: s3://bucket/tenants/42/invoice.pdf]"
|
|
845
|
+
history: {}
|
|
846
|
+
// after — omitted entirely by default; ask for a placeholder explicitly
|
|
847
|
+
history: { unresolvedFile: 'text' } // "[attachment: invoice.pdf]"
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
Two things to check. If a prompt relied on the model seeing *something* where an
|
|
851
|
+
unresolved file was, set `unresolvedFile: 'text'` — behaviour otherwise changes
|
|
852
|
+
silently, since an omitted part produces no error. And if any stored transcript
|
|
853
|
+
or provider log contains the old placeholder, it contains your storage layout;
|
|
854
|
+
treat those as disclosed. The `error` policy still names the reference, because
|
|
855
|
+
it is thrown into your process rather than sent upstream.
|
|
856
|
+
|
|
857
|
+
### one bounded recoverable scan
|
|
858
|
+
|
|
859
|
+
`AgentRuntimeStore` had two scans: a mandatory unbounded one and an optional
|
|
860
|
+
paged one. The runtime only ever called the optional one, so implementing the
|
|
861
|
+
interface as written produced a store that threw on its first `recover()`:
|
|
862
|
+
|
|
863
|
+
```ts
|
|
864
|
+
// before — the mandatory member was dead, the needed one was optional
|
|
865
|
+
{
|
|
866
|
+
scanRecoverable: () => loadEveryRecoverableSnapshot(),
|
|
867
|
+
scanRecoverablePage: ({ cursor, limit }) => page(cursor, limit),
|
|
868
|
+
}
|
|
869
|
+
// after — one member, the bounded signature the driver already used
|
|
870
|
+
{ scanRecoverable: ({ cursor, limit }) => page(cursor, limit) }
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
Delete the unbounded implementation rather than porting it: loading every
|
|
874
|
+
recoverable conversation to start is the shape 0.59.0 and ADR 0101 moved away
|
|
875
|
+
from, and nothing calls it now. If you built on `createAgentRuntimeStore()` you
|
|
876
|
+
have nothing to do **if you only pass it to the runtime** — it implements the
|
|
877
|
+
bounded page for you from the same driver member. If you CALL it yourself, the
|
|
878
|
+
member changed shape: `scanRecoverable()` took no argument and returned
|
|
879
|
+
snapshots; it now takes `{ cursor?, limit }` — `limit` is required — and returns
|
|
880
|
+
one page of descriptors.
|
|
881
|
+
```ts
|
|
882
|
+
// before: const stale = await store.scanRecoverable()
|
|
883
|
+
// after: const { items, nextCursor } = await store.scanRecoverable({ limit: 100 })
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
### published application status
|
|
887
|
+
|
|
888
|
+
`createApplicationHealthHandler` and `createApplicationOperationalHandlers` no
|
|
889
|
+
longer serialise the whole `ApplicationSnapshot`. They publish
|
|
890
|
+
`ApplicationStatusProjection` — the verdict plus resource counts:
|
|
891
|
+
|
|
892
|
+
```ts
|
|
893
|
+
// before — the response named every resource and its dependency edges
|
|
894
|
+
const { resources } = await fetch('/status').then((r) => r.json())
|
|
895
|
+
resources[0].dependsOn
|
|
896
|
+
// after — the topology is read in-process, where it always belonged
|
|
897
|
+
app.getSnapshot().resources[0].dependsOn
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
The consequence to check is not compilation — it is whatever already consumes
|
|
901
|
+
these routes. A dashboard that drew the dependency graph from `/status`, or an
|
|
902
|
+
alert keyed on `admission.pending`, goes blank rather than red: the fields are
|
|
903
|
+
absent, not zero. Both are available from `getSnapshot()`, so the fix is to read
|
|
904
|
+
them in the process that owns the application and publish them on a channel you
|
|
905
|
+
control. If a route was reachable from outside your network, treat the previous
|
|
906
|
+
payload as disclosed and rotate nothing but assume the topology is known.
|
|
907
|
+
|
|
908
|
+
## Released migration: 0.59.0
|
|
909
|
+
|
|
910
|
+
### Normalized agent runtime persistence
|
|
911
|
+
|
|
912
|
+
`AgentRuntimeStoreDriver` no longer reads and rewrites a lifetime `AgentStoredState` JSON
|
|
913
|
+
aggregate. Migrate that row and its recoverable/archive projections once:
|
|
914
|
+
|
|
915
|
+
1. Copy `conversationId` and `version` into the bounded runtime head.
|
|
916
|
+
2. Write every `AgentStoredState.runs[]` entry as one normalized run record.
|
|
917
|
+
3. Write every `AgentStoredState.admissions[]` entry as one admission receipt and copy its
|
|
918
|
+
canonical input into that receipt.
|
|
919
|
+
4. For terminal runs, retain the canonical assistant on the run record before deleting any old
|
|
920
|
+
history/archive rows.
|
|
921
|
+
5. Replace the recoverable projection with an index over normalized run `state`.
|
|
922
|
+
6. Cut the adapter over atomically; there is no compatibility driver or dual-write mode.
|
|
923
|
+
|
|
924
|
+
```ts
|
|
925
|
+
// before
|
|
926
|
+
createAgentRuntimeStore({
|
|
927
|
+
state: { load, compareAndSwap },
|
|
928
|
+
history: { load, loadById, apply },
|
|
929
|
+
scanRecoverable,
|
|
930
|
+
})
|
|
931
|
+
|
|
932
|
+
// after
|
|
933
|
+
createAgentRuntimeStore({
|
|
934
|
+
head: { load, compareAndSwap },
|
|
935
|
+
runs: { load, loadByAssistantMessageId, loadMany, listActive, save },
|
|
936
|
+
admissions: { load, loadByInputMessageId, create },
|
|
937
|
+
history: { load, apply },
|
|
938
|
+
scanRecoverable,
|
|
939
|
+
})
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
`AgentRuntimeHeadSchema`, `AgentStoredRunSchema` and `AgentAdmissionReceiptSchema` replace
|
|
943
|
+
`AgentStoredStateSchema` and `AgentAdmissionIdentitySchema`. Run
|
|
944
|
+
`runAgentStoreConformance()` against the migrated adapter before switching production traffic.
|
|
945
|
+
If an application implements `AgentRuntimeStore` directly, its duplicate result must also include
|
|
946
|
+
the canonical `run` and the retained `assistant` for a terminal run.
|
|
947
|
+
|
|
948
|
+
## Released migration: 0.58.0
|
|
949
|
+
|
|
950
|
+
### The default history projection rejects invalid chronology
|
|
951
|
+
|
|
952
|
+
`projectAgentHistory` no longer forwards records a provider contract cannot
|
|
953
|
+
accept. A completed assistant record before the first user message, and an
|
|
954
|
+
assistant record whose tool calls have no matching results, are omitted with an
|
|
955
|
+
inspectable decision instead of being sent upstream:
|
|
956
|
+
|
|
957
|
+
```ts
|
|
958
|
+
// before — a leading assistant record was forwarded as-is
|
|
959
|
+
projectAgentHistory(messages)
|
|
960
|
+
// after — opt in explicitly, and only where the provider contract permits it
|
|
961
|
+
projectAgentHistory(messages, { leadingAssistant: 'allow' })
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
Two consequences the changelog does not spell out. First, the projection can now
|
|
965
|
+
return **fewer** messages than the history holds, so any assertion or metric
|
|
966
|
+
that compared projected length against stored length will move; read the
|
|
967
|
+
detailed projection instead — it reports what was omitted and why, which is the
|
|
968
|
+
supported way to see the difference. Second, the omission is silent to the
|
|
969
|
+
provider but not to you: if a conversation suddenly loses its leading context,
|
|
970
|
+
the decision record is where that shows up, not the transcript.
|
|
971
|
+
|
|
972
|
+
### Operator events redact `internalCause` by default
|
|
973
|
+
|
|
974
|
+
Raw provider and tool failures no longer travel in operator events unless the
|
|
975
|
+
sink asks for them:
|
|
976
|
+
|
|
977
|
+
```ts
|
|
978
|
+
// before — internalCause was present
|
|
979
|
+
createAgentObservability({ write })
|
|
980
|
+
// after — an explicit operator-only opt-in
|
|
981
|
+
createAgentObservability({ write, includeInternalCause: true })
|
|
982
|
+
```
|
|
983
|
+
|
|
984
|
+
The consequence to check before upgrading: any dashboard, alert or log
|
|
985
|
+
processor keyed on `internalCause` goes blind the moment you upgrade, and it
|
|
986
|
+
goes blind quietly — the field is absent, not empty. Set the flag on the
|
|
987
|
+
operator sink you own. Product delivery stays redacted regardless of the flag;
|
|
988
|
+
this option cannot widen what reaches a user.
|
|
989
|
+
|
|
990
|
+
## Released migration: 0.57.0
|
|
991
|
+
|
|
992
|
+
### Duplicate admission results carry the complete identity
|
|
993
|
+
|
|
994
|
+
Custom `AgentRuntimeStore` adapters must persist and return the input and
|
|
995
|
+
assistant identities associated with an idempotency key:
|
|
996
|
+
|
|
997
|
+
```ts
|
|
998
|
+
// before
|
|
999
|
+
return { outcome: 'duplicate', runId, snapshot }
|
|
1000
|
+
|
|
1001
|
+
// after
|
|
1002
|
+
return { outcome: 'duplicate', input, inputMessageId, runId, assistantMessageId, snapshot }
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
Prefer replacing the custom aggregate reducer with `createAgentRuntimeStore()`;
|
|
1006
|
+
its admission record and transaction driver implement this contract
|
|
1007
|
+
automatically. Historical note: 0.59.0 reshaped this driver again, so an adapter
|
|
1008
|
+
crossing both versions should read that section first and migrate once.
|
|
1009
|
+
|
|
1010
|
+
### `AgentRuntimeEvent` adds a post-commit `admission` variant
|
|
1011
|
+
|
|
1012
|
+
Add it to any exhaustive publisher switch. Its `assistant` is either the pending
|
|
1013
|
+
placeholder for a new assignment or the canonical persisted assistant for a
|
|
1014
|
+
duplicate:
|
|
1015
|
+
|
|
1016
|
+
```ts
|
|
1017
|
+
case 'admission':
|
|
1018
|
+
await persistProductProjection(event.input, event.run, event.assistant)
|
|
1019
|
+
break
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
The consequence for an exhaustive switch written without a `default` branch is a
|
|
1023
|
+
compile error, which is the point. The consequence for a switch that *has* a
|
|
1024
|
+
`default` is worse and silent: post-commit admissions fall into it and are
|
|
1025
|
+
projected as an unknown event. Grep for publisher switches before upgrading.
|
|
1026
|
+
|
|
1027
|
+
## Released migration: 0.56.0
|
|
1028
|
+
|
|
1029
|
+
### Surface manifests are version 2
|
|
1030
|
+
|
|
1031
|
+
`operation.tools` could not describe a role-selected MCP surface, a different
|
|
1032
|
+
Agent or CLI selection, or an advertised `extend` schema, so projections moved
|
|
1033
|
+
out of the canonical operation:
|
|
1034
|
+
|
|
1035
|
+
```ts
|
|
1036
|
+
// before
|
|
1037
|
+
manifest.operations[0].tools.MCP
|
|
1038
|
+
// after
|
|
1039
|
+
manifest.toolSurfaces.find((s) => s.transport === 'MCP' && s.surface === null)?.tools
|
|
1040
|
+
|
|
1041
|
+
// before
|
|
1042
|
+
buildSurfaceManifest({ mcpSurfaces: { admin: { services, extend } } })
|
|
1043
|
+
// after
|
|
1044
|
+
buildSurfaceManifest({ mcpSurfaces: { admin: { services } }, mcpPreparation: { extend } })
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
A committed snapshot is regenerated once, deliberately: `manifestVersion` is
|
|
1048
|
+
`2`, and `ConformanceTransport` gained `REALTIME`, so any exhaustive
|
|
1049
|
+
`Record<ConformanceTransport, …>` must handle it.
|
|
1050
|
+
|
|
1051
|
+
### `FILE_*` codes joined the error registry
|
|
1052
|
+
|
|
1053
|
+
`StitchErrorCode` gained `FILE_INVALID_PATH`, `FILE_OUTSIDE_ROOT`,
|
|
1054
|
+
`FILE_NOT_FOUND`, `FILE_NOT_REGULAR`, `FILE_INSPECTION_REJECTED`,
|
|
1055
|
+
`FILE_TOO_LARGE` and `FILE_EXISTS`. Only exhaustive maps break:
|
|
1056
|
+
|
|
1057
|
+
```ts
|
|
1058
|
+
// before — compiled while the registry had no file codes
|
|
1059
|
+
const copy: Record<StitchErrorCode, string> = { …, RATE_LIMITED: '…' }
|
|
1060
|
+
// after — add the seven managed-file codes (or use Partial<Record<…>>)
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
Unexpected IO stays scrubbed as `INTERNAL_SERVER_ERROR`: the new codes are the
|
|
1064
|
+
caller-safe ones only.
|
|
1065
|
+
|
|
1066
|
+
### `ScopedAuthHook` is nominal
|
|
1067
|
+
|
|
1068
|
+
A hand-written function shaped like an auth hook is no longer assignable —
|
|
1069
|
+
identity now comes from the factory, so scope ownership and the inferred
|
|
1070
|
+
context cannot drift apart:
|
|
1071
|
+
|
|
1072
|
+
```ts
|
|
1073
|
+
// before — a structural stand-in
|
|
1074
|
+
const auth: ScopedAuthHook<Scopes> = async (ctx, endpoint) => { … }
|
|
1075
|
+
// after — create it, then compose domains
|
|
1076
|
+
const auth = createAuthHook({ resolve, rules })
|
|
1077
|
+
const composed = composeAuthHooks({ hooks: [auth, billingAuth], defaultScope: 'public' })
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
### Managed-file inspectors also run on reads
|
|
1081
|
+
|
|
1082
|
+
An inspector is no longer write-only, and it has a finite default deadline
|
|
1083
|
+
(15 s). Make it read-aware and idempotent — a read carries no
|
|
1084
|
+
`declaredMediaType`:
|
|
1085
|
+
|
|
1086
|
+
```ts
|
|
1087
|
+
// before
|
|
1088
|
+
inspect: ({ declaredMediaType }) => inspectDeclaredType(declaredMediaType!)
|
|
1089
|
+
// after
|
|
1090
|
+
inspect: ({ prefix, declaredMediaType, signal }) =>
|
|
1091
|
+
inspectBytes(prefix, { declaredMediaType, signal })
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
Set `inspectionTimeoutMs` explicitly when 15 seconds is the wrong budget.
|
|
1095
|
+
|
|
1096
|
+
### Direct async-operation binding needs a wire-stable ID
|
|
1097
|
+
|
|
1098
|
+
A direct binding reuses the start output as the follow-up wire input, so the ID
|
|
1099
|
+
schema must parse to itself (`z.input` equals `z.output`, no transform,
|
|
1100
|
+
coercion, default or overwrite). Anything else is parsed twice:
|
|
1101
|
+
|
|
1102
|
+
```ts
|
|
1103
|
+
// before — a transform silently ran on start and again on every follow-up
|
|
1104
|
+
defineAsyncOperationContract({ binding: 'direct', id: z.string().transform(Number) })
|
|
1105
|
+
// after — keep the wire shape, adapt explicitly
|
|
1106
|
+
defineAsyncOperationContract({
|
|
1107
|
+
binding: 'adapted',
|
|
1108
|
+
id,
|
|
1109
|
+
adapters: { idFromStart, inputFor },
|
|
1110
|
+
})
|
|
1111
|
+
```
|
|
1112
|
+
|
|
1113
|
+
## Released migration: 0.55.0
|
|
1114
|
+
|
|
1115
|
+
### Peer-free `implementRemote`
|
|
1116
|
+
|
|
1117
|
+
`implementRemote` now has one canonical, optional-peer-free owner. This keeps
|
|
1118
|
+
MCP SDK and AI SDK modules out of CLI bundles that only proxy HTTP calls:
|
|
1119
|
+
|
|
1120
|
+
```ts
|
|
1121
|
+
// before
|
|
1122
|
+
import { implementRemote } from 'stitchkit/tools'
|
|
1123
|
+
// after
|
|
1124
|
+
import { implementRemote } from 'stitchkit/remote'
|
|
1125
|
+
```
|
|
1126
|
+
|
|
1127
|
+
### Managed file boundary and strict auth returns
|
|
1128
|
+
|
|
1129
|
+
Create one boundary during application bootstrap and pass the capability, never
|
|
1130
|
+
a per-call directory or host path:
|
|
1131
|
+
|
|
1132
|
+
```ts
|
|
1133
|
+
import { createManagedFileBoundary } from 'stitchkit/files'
|
|
1134
|
+
|
|
1135
|
+
const files = await createManagedFileBoundary({ root: '/srv/app-files' })
|
|
1136
|
+
|
|
1137
|
+
// before
|
|
1138
|
+
defineDownloadTool({ defaultDir: '/srv/app-files', resolveUrl, ...common })
|
|
1139
|
+
defineUploadTool({ upload: (path) => provider.uploadFile(path), ...common })
|
|
1140
|
+
defineViewFileTool({ baseDir: '/srv/app-files', ...common })
|
|
1141
|
+
|
|
1142
|
+
// after
|
|
1143
|
+
defineDownloadTool({ files, resolveUrl, ...common })
|
|
1144
|
+
defineUploadTool({ files, upload: ({ bytes }) => provider.upload(bytes), ...common })
|
|
1145
|
+
defineViewFileTool({ files, ...common })
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
Downloaded `path` is now relative to the boundary and MIME metadata is named
|
|
1149
|
+
`mediaType`. Update raw `mountDownload`/`mountUpload`/`mountViewFile` configs the
|
|
1150
|
+
same way. Auth predicates must explicitly return `true`, `false`, or a plain
|
|
1151
|
+
object of context fields; replace accidental `undefined` fallthroughs with the
|
|
1152
|
+
intended boolean.
|
|
1153
|
+
|
|
1154
|
+
## Released migration: 0.53.0
|
|
1155
|
+
|
|
1156
|
+
### Realtime `emit` returns `boolean` instead of `void`
|
|
1157
|
+
|
|
1158
|
+
Every **call site** compiles and behaves exactly as before — the return value
|
|
1159
|
+
is new information (`true` = accepted by the transport, `false` = dropped
|
|
1160
|
+
while the browser client was disconnected), not a behavior change. What breaks
|
|
1161
|
+
is **implementing** the interfaces: a test mock or app-side adapter of
|
|
1162
|
+
`SocketIOClient` / `RealtimeClient` / `ValidatedRealtimeSocket` /
|
|
1163
|
+
`RealtimeServer` whose `emit` returns `void` no longer typechecks.
|
|
1164
|
+
|
|
1165
|
+
```ts
|
|
1166
|
+
// before — a void mock satisfied the interface
|
|
1167
|
+
const mock: Pick<RealtimeClient<S, C>, 'emit'> = { emit: () => {} }
|
|
1168
|
+
// after — report acceptance (true is what a live server-side emit reports)
|
|
1169
|
+
const mock: Pick<RealtimeClient<S, C>, 'emit'> = { emit: () => true }
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
While migrating, consider replacing hand-rolled `if (client.connected)` guards
|
|
1173
|
+
with the new honest surface: check `client.emit(...) === false`, or observe
|
|
1174
|
+
drops centrally with `onDroppedEmit`.
|