stitchkit 0.132.3 → 0.133.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -1
- package/README.md +4 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +12 -1
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +3 -1
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +9 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +3 -2
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-probe.d.ts +10 -1
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +11 -2
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +13 -10
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +6 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/record-router.d.ts +44 -0
- package/dist/agent-executor/claude/record-router.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +20 -2
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts +18 -0
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +8 -11
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-manager.d.ts +4 -2
- package/dist/agent-executor/claude-sdk/query-manager.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-options.d.ts +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/capabilities.d.ts +8 -0
- package/dist/agent-executor/codex/capabilities.d.ts.map +1 -0
- package/dist/agent-executor/codex/connect.d.ts +6 -1
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/driver.d.ts +10 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/event-routing.d.ts +23 -1
- package/dist/agent-executor/codex/event-routing.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +23 -3
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +17 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +23 -3
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-bind.d.ts +6 -1
- package/dist/agent-executor/codex/session-bind.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-types.d.ts +5 -1
- package/dist/agent-executor/codex/session-types.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-thread.d.ts +6 -8
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-open.d.ts +12 -3
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
- package/dist/agent-executor/engine-requests.d.ts +42 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
- package/dist/agent-executor/handoff.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +6 -5
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/profile.d.ts +3 -5
- package/dist/agent-executor/profile.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +64 -3
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts +5 -0
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts +11 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-support.d.ts +23 -0
- package/dist/agent-executor/testing/conformance-support.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +7 -2
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/consumer-stubs.d.ts +5 -3
- package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts +5 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +6 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-gate.d.ts +4 -1
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/operation-refusal.d.ts +10 -0
- package/dist/browser/operation-refusal.d.ts.map +1 -0
- package/dist/contract/client-types.d.ts +13 -4
- package/dist/contract/client-types.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +6 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors-factory.d.ts +8 -2
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +9 -0
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/fingerprint.d.ts +4 -1
- package/dist/contract/fingerprint.d.ts.map +1 -1
- package/dist/contract/operation-refusals.d.ts +51 -0
- package/dist/contract/operation-refusals.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +4 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +253 -210
- package/dist/entrypoints/agent-executor/claude-sdk.js +248 -173
- package/dist/entrypoints/agent-executor/claude.js +57 -109
- package/dist/entrypoints/agent-executor/codex.js +412 -335
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts +3 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +329 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +1 -2
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +413 -667
- package/dist/entrypoints/agent-executor.d.ts +1 -1
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +12 -12
- package/dist/entrypoints/agent-runtime/browser.js +2 -2
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/postgres.js +5 -5
- package/dist/entrypoints/agent-runtime/realtime.js +2 -2
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +26 -18
- package/dist/entrypoints/application/grammy.js +1 -1
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.d.ts +3 -2
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +6 -4
- package/dist/entrypoints/files/packaging.d.ts +4 -1
- package/dist/entrypoints/files/packaging.d.ts.map +1 -1
- package/dist/entrypoints/files/packaging.js +1008 -168
- package/dist/entrypoints/files.js +1 -1
- package/dist/entrypoints/handler.js +7 -7
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +10 -8
- package/dist/entrypoints/node.js +11 -11
- package/dist/entrypoints/observability.js +1 -1
- package/dist/entrypoints/process/bootstrap.d.ts +3 -0
- package/dist/entrypoints/process/bootstrap.d.ts.map +1 -0
- package/dist/entrypoints/process/bootstrap.js +16 -0
- package/dist/entrypoints/process.js +7 -7
- package/dist/entrypoints/realtime.js +3 -3
- package/dist/entrypoints/remote.js +8 -7
- package/dist/entrypoints/server.js +30 -14
- package/dist/entrypoints/service-host/macos.js +72 -206
- package/dist/entrypoints/service-host/work.d.ts +15 -0
- package/dist/entrypoints/service-host/work.d.ts.map +1 -0
- package/dist/entrypoints/service-host/work.js +676 -0
- package/dist/entrypoints/service-host.js +146 -536
- package/dist/entrypoints/telegram/screens.js +4 -4
- package/dist/entrypoints/telegram.js +4 -4
- package/dist/entrypoints/testing.d.ts +2 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +27 -8
- package/dist/entrypoints/tools/agent.js +6 -6
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +5 -5
- package/dist/entrypoints/tools/mcp.js +8 -6
- package/dist/entrypoints/tools/toolkit.js +11 -9
- package/dist/entrypoints/tools.js +19 -17
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +3 -3
- package/dist/files/client-artifact.d.ts +14 -42
- package/dist/files/client-artifact.d.ts.map +1 -1
- package/dist/files/client-build.d.ts +57 -0
- package/dist/files/client-build.d.ts.map +1 -0
- package/dist/files/client-declarations.d.ts +35 -0
- package/dist/files/client-declarations.d.ts.map +1 -0
- package/dist/files/client-package-bundle.d.ts +25 -0
- package/dist/files/client-package-bundle.d.ts.map +1 -0
- package/dist/files/client-package-contract.d.ts +183 -0
- package/dist/files/client-package-contract.d.ts.map +1 -0
- package/dist/files/client-package-proof.d.ts +40 -0
- package/dist/files/client-package-proof.d.ts.map +1 -0
- package/dist/files/client-package.d.ts +17 -0
- package/dist/files/client-package.d.ts.map +1 -0
- package/dist/files/declaration-specifiers.d.ts +30 -0
- package/dist/files/declaration-specifiers.d.ts.map +1 -0
- package/dist/{index-v759mzed.js → index-02r5sq9p.js} +36 -23
- package/dist/{index-0r15pkjq.js → index-0k1ba0ss.js} +1 -1
- package/dist/{index-znd1b57f.js → index-1dn2wjq6.js} +5 -4
- package/dist/{index-p06z7g7w.js → index-1p8q0yrt.js} +6 -5
- package/dist/{index-wa6h4tz6.js → index-1qwd54n3.js} +6 -5
- package/dist/index-2dzc7mv9.js +174 -0
- package/dist/index-2mz8hj58.js +155 -0
- package/dist/{index-17qgm6xe.js → index-34k82crg.js} +2 -2
- package/dist/index-3mcbr8sx.js +349 -0
- package/dist/{index-ybdq8kk2.js → index-3y2tzhr8.js} +3 -3
- package/dist/{index-fgahdc7s.js → index-5n3a8hd8.js} +5 -3
- package/dist/{index-jb4m241t.js → index-6918kxbf.js} +45 -1
- package/dist/{index-n3bm7zqq.js → index-6kmjcm81.js} +4 -4
- package/dist/{index-akf0xkrm.js → index-78da4g74.js} +1 -1
- package/dist/{index-9pv126eh.js → index-7fjbdga8.js} +7 -1
- package/dist/{index-zhshhxew.js → index-8jf4bt7v.js} +1 -1
- package/dist/{index-p16q492v.js → index-8t9dr41h.js} +18 -5
- package/dist/{index-xq4s9mka.js → index-8yt3rwe7.js} +1 -1
- package/dist/{index-39c2hj6h.js → index-9c76vfxf.js} +7 -3
- package/dist/index-9ft4n9j1.js +432 -0
- package/dist/{index-sd4e5x5j.js → index-9wdrwx3b.js} +8 -7
- package/dist/{index-z114ax5e.js → index-an7vcmwf.js} +49 -2
- package/dist/{index-pzhqydxb.js → index-d04w81fz.js} +1 -1
- package/dist/index-d2drhb9c.js +219 -0
- package/dist/{index-8gmmdz7k.js → index-dacxr7nf.js} +1 -1
- package/dist/{index-dnzxxf8a.js → index-dm6nxkn1.js} +1 -1
- package/dist/index-dxft2mnm.js +42 -0
- package/dist/{index-rxh3qy4x.js → index-fzd477xk.js} +1 -1
- package/dist/{index-xgae0bn7.js → index-g4gstmp1.js} +2 -2
- package/dist/{index-athc412x.js → index-g5fgeb6v.js} +1 -1
- package/dist/{index-z9d74jmb.js → index-gbhj370g.js} +3 -3
- package/dist/{index-3fym4j8n.js → index-gtaaxe9d.js} +1 -1
- package/dist/{index-v59pxmf1.js → index-jpecjm30.js} +2 -2
- package/dist/index-k9g061ma.js +164 -0
- package/dist/{index-669374qc.js → index-ma26mfnt.js} +84 -315
- package/dist/{index-ryxb427v.js → index-msxf2r8x.js} +16 -3
- package/dist/{index-rbd2rq3z.js → index-nr4fhfn4.js} +1 -1
- package/dist/{index-qa2jjb65.js → index-pbekeqzm.js} +1 -1
- package/dist/{index-mkfhpk11.js → index-pq6g1k9t.js} +2 -2
- package/dist/{index-gya4hwh3.js → index-pws5c3x6.js} +21 -1
- package/dist/{index-x2fb37t0.js → index-q427q23r.js} +3 -2
- package/dist/{index-jcrj0b8z.js → index-qggqqja2.js} +39 -2
- package/dist/{index-jxtg307y.js → index-rkjfzs0a.js} +1 -1
- package/dist/{index-5tdc0q43.js → index-rw8ze745.js} +5 -3
- package/dist/index-s43tr4my.js +129 -0
- package/dist/{index-f9p62ean.js → index-stpy56r3.js} +175 -249
- package/dist/index-t5g5rm9n.js +213 -0
- package/dist/{index-z20pdxeb.js → index-tmv3ez1h.js} +3 -3
- package/dist/{index-dcsxj68j.js → index-tqjamnax.js} +1 -1
- package/dist/{index-j15dhkda.js → index-wddcfbng.js} +1 -325
- package/dist/{index-9sfhje6y.js → index-wh70tmpd.js} +24 -234
- package/dist/index-wxjv4sqx.js +82 -0
- package/dist/{index-qhjmmsm2.js → index-x46y9z26.js} +2 -2
- package/dist/{index-nk0cy9g1.js → index-y53cqwke.js} +1 -1
- package/dist/{index-sv5svtq7.js → index-y68gavb5.js} +1 -1
- package/dist/{index-5y7j383h.js → index-yrhw10ef.js} +1 -1
- package/dist/process/bootstrap.d.ts +12 -0
- package/dist/process/bootstrap.d.ts.map +1 -0
- package/dist/process/owner-loss-guard.d.ts +2 -9
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/process/work-root.d.ts +20 -0
- package/dist/process/work-root.d.ts.map +1 -0
- package/dist/server/contract-identity.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +12 -0
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/service-host/host-adapter.d.ts +2 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -1
- package/dist/service-host/work/command.d.ts +72 -0
- package/dist/service-host/work/command.d.ts.map +1 -0
- package/dist/service-host/work/errors.d.ts +29 -0
- package/dist/service-host/work/errors.d.ts.map +1 -0
- package/dist/service-host/work/host.d.ts +38 -0
- package/dist/service-host/work/host.d.ts.map +1 -0
- package/dist/service-host/work/launch.d.ts +51 -0
- package/dist/service-host/work/launch.d.ts.map +1 -0
- package/dist/service-host/work/membership.d.ts +51 -0
- package/dist/service-host/work/membership.d.ts.map +1 -0
- package/dist/service-host/work/origin.d.ts +79 -0
- package/dist/service-host/work/origin.d.ts.map +1 -0
- package/dist/service-host/work/owner.d.ts +45 -0
- package/dist/service-host/work/owner.d.ts.map +1 -0
- package/dist/service-host/work/placement.d.ts +55 -0
- package/dist/service-host/work/placement.d.ts.map +1 -0
- package/dist/service-host/work/probe.d.ts +24 -0
- package/dist/service-host/work/probe.d.ts.map +1 -0
- package/dist/service-host/work/scope-command.d.ts +68 -0
- package/dist/service-host/work/scope-command.d.ts.map +1 -0
- package/dist/sync/session.d.ts +4 -1
- package/dist/sync/session.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +2 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +32 -3
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +2 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/internal/mcp-projection.d.ts +58 -0
- package/dist/tools/internal/mcp-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +3 -47
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -0
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +4 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +5 -2
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +2 -0
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts +8 -0
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +7 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +3 -3
- package/llms/agent-executor-claude-sdk.txt +1 -1
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +1 -1
- package/llms/agent-executor-testing-claude-sdk.txt +28 -0
- package/llms/agent-executor-testing.txt +7 -8
- package/llms/agent-executor.txt +27 -4
- package/llms/agent-runtime.txt +1 -1
- package/llms/contract.txt +8 -2
- package/llms/files-packaging.txt +11 -6
- package/llms/process-bootstrap.txt +18 -0
- package/llms/process.2.txt +248 -18
- package/llms/process.txt +130 -92
- package/llms/server.4.txt +49 -1
- package/llms/service-host-work.txt +34 -0
- package/llms/stitchkit.2.txt +31 -0
- package/llms/stitchkit.txt +78 -75
- package/llms/sync.txt +5 -2
- package/llms/testing.txt +1 -0
- package/llms/tools.2.txt +747 -775
- package/llms/tools.3.txt +846 -210
- package/llms/tools.4.txt +226 -0
- package/llms/tools.txt +3 -790
- package/llms/{upgrading-0.128.0-0.132.0.txt → upgrading-0.128.0-0.133.0.txt} +194 -6
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +779 -135
- package/llms.txt +18 -16
- package/package.json +12 -4
- package/dist/entrypoints/process/owner-loss.d.ts +0 -3
- package/dist/entrypoints/process/owner-loss.d.ts.map +0 -1
- package/dist/entrypoints/process/owner-loss.js +0 -7
- package/llms/process-owner-loss.txt +0 -18
package/llms-full.txt
CHANGED
|
@@ -47,81 +47,83 @@ own, recorded as an ADR.
|
|
|
47
47
|
|
|
48
48
|
| Import | Use in | Maturity | Holds |
|
|
49
49
|
|--------|--------|----------|-------|
|
|
50
|
-
| `stitchkit` | browser **and** server | stable<br>_redefined in 5 of the
|
|
51
|
-
| `stitchkit/http` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 2 of the
|
|
52
|
-
| `stitchkit/realtime` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 1 of the
|
|
53
|
-
| `stitchkit/contract` | browser **and** server | stable<br>_redefined in 5 of the
|
|
54
|
-
| `stitchkit/live` | browser **and** server | evolving<br>_redefined in 2 of the
|
|
55
|
-
| `stitchkit/primitives` | browser **and** server | evolving<br>_redefined in 0 of the
|
|
56
|
-
| `stitchkit/handler` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 0 of the
|
|
57
|
-
| `stitchkit/server` | server (Bun) | stable<br>_redefined in 5 of the
|
|
58
|
-
| `stitchkit/node` | server (Node ≥ 22.3) | stable<br>_redefined in 2 of the
|
|
59
|
-
| `stitchkit/tools` | server | stable<br>_redefined in 10 of the
|
|
60
|
-
| `stitchkit/tools/mcp` | server (Bun or Node) | evolving<br>_redefined in 3 of the
|
|
61
|
-
| `stitchkit/tools/agent` | server (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
62
|
-
| `stitchkit/tools/toolkit` | server (Bun or Node) | evolving<br>_redefined in 1 of the
|
|
63
|
-
| `stitchkit/tools/contract` | browser + server | evolving<br>_redefined in 2 of the
|
|
64
|
-
| `stitchkit/tools/invoker` | server | stable<br>_redefined in 3 of the
|
|
65
|
-
| `stitchkit/tools/connections` | server (Bun or Node) | evolving<br>_redefined in 3 of the
|
|
66
|
-
| `stitchkit/cli` | server | stable<br>_redefined in 12 of the
|
|
67
|
-
| `stitchkit/cli/publish` | build and release tooling (Bun or Node, POSIX) | evolving<br>_redefined in 0 of the
|
|
68
|
-
| `stitchkit/remote` | browser **and** server | stable<br>_redefined in 1 of the
|
|
69
|
-
| `stitchkit/process` | server (Bun or Node, POSIX) | evolving<br>_redefined in
|
|
70
|
-
| `stitchkit/process/
|
|
71
|
-
| `stitchkit/files/packaging` | build time (Bun or Node) | evolving<br>_redefined in
|
|
72
|
-
| `stitchkit/files` | server (Bun or Node) | stable<br>_redefined in
|
|
73
|
-
| `stitchkit/spend` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
74
|
-
| `stitchkit/spend/testing` | tests on Bun or Node | evolving<br>_redefined in 0 of the
|
|
75
|
-
| `stitchkit/service-host` | server (Bun or Node) | evolving<br>_redefined in 0 of the
|
|
76
|
-
| `stitchkit/service-host/macos` | server (Bun or Node, macOS) | evolving<br>_redefined in 0 of the
|
|
77
|
-
| `stitchkit/
|
|
78
|
-
| `stitchkit/telegram
|
|
79
|
-
| `stitchkit/telegram/
|
|
80
|
-
| `stitchkit/telegram/
|
|
81
|
-
| `stitchkit/telegram/
|
|
82
|
-
| `stitchkit/
|
|
83
|
-
| `stitchkit/tracking
|
|
84
|
-
| `stitchkit/tracking/
|
|
85
|
-
| `stitchkit/tracking/
|
|
86
|
-
| `stitchkit/
|
|
87
|
-
| `stitchkit/
|
|
88
|
-
| `stitchkit/
|
|
89
|
-
| `stitchkit/sync
|
|
90
|
-
| `stitchkit/
|
|
91
|
-
| `stitchkit/geo
|
|
92
|
-
| `stitchkit/
|
|
93
|
-
| `stitchkit/
|
|
94
|
-
| `stitchkit/
|
|
95
|
-
| `stitchkit/
|
|
96
|
-
| `stitchkit/
|
|
97
|
-
| `stitchkit/
|
|
98
|
-
| `stitchkit/
|
|
99
|
-
| `stitchkit/react
|
|
100
|
-
| `stitchkit/react/keyboard
|
|
101
|
-
| `stitchkit/
|
|
102
|
-
| `stitchkit/agent-runtime
|
|
103
|
-
| `stitchkit/agent-runtime/
|
|
104
|
-
| `stitchkit/agent-runtime/
|
|
105
|
-
| `stitchkit/agent-runtime/
|
|
106
|
-
| `stitchkit/agent-runtime/
|
|
107
|
-
| `stitchkit/agent-runtime/
|
|
108
|
-
| `stitchkit/agent-runtime/
|
|
109
|
-
| `stitchkit/agent-runtime/
|
|
110
|
-
| `stitchkit/agent-
|
|
111
|
-
| `stitchkit/agent-executor
|
|
112
|
-
| `stitchkit/agent-executor/claude
|
|
113
|
-
| `stitchkit/agent-executor/
|
|
114
|
-
| `stitchkit/agent-executor/
|
|
115
|
-
| `stitchkit/agent-executor/
|
|
116
|
-
| `stitchkit/agent-
|
|
117
|
-
| `stitchkit/agent-
|
|
118
|
-
| `stitchkit/agent-runtime/
|
|
50
|
+
| `stitchkit` | browser **and** server | stable<br>_redefined in 5 of the 40 minors since 0.94.0, most recently 0.127.0_ | `defineContract`, `createClient`, `createHttpClient`, `createSocketIOClient`, `parseSSE`, the error model |
|
|
51
|
+
| `stitchkit/http` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | typed HTTP client factories and `ApiError`, without optional realtime peers |
|
|
52
|
+
| `stitchkit/realtime` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | typed realtime clients, binding to an existing socket and retained topics with a required explicit Socket.IO peer loader |
|
|
53
|
+
| `stitchkit/contract` | browser **and** server | stable<br>_redefined in 5 of the 40 minors since 0.94.0, most recently 0.127.0_ | the contract layer alone — `defineContract`, errors, pagination |
|
|
54
|
+
| `stitchkit/live` | browser **and** server | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | `defineEvents` — topic declarations beside the operation contract — and watched reads: `createWatchClient`, the value/difference frame and its reassembly |
|
|
55
|
+
| `stitchkit/primitives` | browser **and** server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | generic values and declarations for lifecycle, access, audit, delivery and exports, exact money and rounding tables |
|
|
56
|
+
| `stitchkit/handler` | browser, React Native/Hermes **and** server | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | portable `createHandler`, `implement`, errors and `serveBridge` over a string `postMessage` port, with no Node built-ins |
|
|
57
|
+
| `stitchkit/server` | server (Bun) | stable<br>_redefined in 5 of the 40 minors since 0.94.0, most recently 0.127.0_ | `createServer`, `implement`, hooks, auth, Socket.IO server, server primitives |
|
|
58
|
+
| `stitchkit/node` | server (Node ≥ 22.3) | stable<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | `serveNode` + the runtime-agnostic core — the Node mirror of `/server` |
|
|
59
|
+
| `stitchkit/tools` | server | stable<br>_redefined in 10 of the 40 minors since 0.94.0, most recently 0.127.0_ | the transport-neutral tool layer — registry, tool names and manifest, runtime tools, native tools, the OAuth provider, the durability engine; loads no optional peer at runtime |
|
|
60
|
+
| `stitchkit/tools/mcp` | server (Bun or Node) | evolving<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | the canonical MCP HTTP/stdio server, schemas and typed MCP presenters; only Zod and the MCP server SDK peers |
|
|
61
|
+
| `stitchkit/tools/agent` | server (Bun or Node) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | `mountAgent` — a contract's operations as AI SDK tools; only Zod and the `ai` peer |
|
|
62
|
+
| `stitchkit/tools/toolkit` | server (Bun or Node) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | `createToolkit` — one tool set served over MCP and to an AI SDK agent; the MCP server SDK and `ai` peers |
|
|
63
|
+
| `stitchkit/tools/contract` | browser + server | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.124.0_ | the shapes a tool surface speaks — async-operation contract, snapshot and cancel schemas, view-file input/output — without the runtime that serves them |
|
|
64
|
+
| `stitchkit/tools/invoker` | server | stable<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | peer-free `createToolInvoker` over the canonical contract tool runner |
|
|
65
|
+
| `stitchkit/tools/connections` | server (Bun or Node) | evolving<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | consume external MCP servers and a bounded OpenAPI subset — typed reauthorization, a per-request host fence and per-call credentials |
|
|
66
|
+
| `stitchkit/cli` | server | stable<br>_redefined in 12 of the 40 minors since 0.94.0, most recently 0.128.0_ | `createCli` / `createCliInvoker` — runtime and strict NodeNext declarations without MCP SDK / `ai` |
|
|
67
|
+
| `stitchkit/cli/publish` | build and release tooling (Bun or Node, POSIX) | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | `publishCli` — commit a verified CLI distribution and move its public manifest last; see [CLI guide](cli.md#publishing-a-complete-version) |
|
|
68
|
+
| `stitchkit/remote` | browser **and** server | stable<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.104.0_ | peer-free `implementRemote` for thin HTTP proxy processes |
|
|
69
|
+
| `stitchkit/process` | server (Bun or Node, POSIX) | evolving<br>_redefined in 4 of the 40 minors since 0.94.0, most recently 0.133.0_ | finite native commands, byte sinks, bounded capture, process-group cancellation and opt-in Linux/Darwin owner-loss cleanup; contract operations executed in one-call child processes |
|
|
70
|
+
| `stitchkit/process/bootstrap` | bundled server entry (Bun, POSIX) | evolving<br>_redefined in 0 of the 1 minor since 0.133.0_ | narrow bootstrap that keeps the process runner lazy while carrying the package's own invocations — the owner-loss guard and the process root of launched work — in a single-file bundle |
|
|
71
|
+
| `stitchkit/files/packaging` | build time (Bun or Node) | evolving<br>_redefined in 4 of the 40 minors since 0.94.0, most recently 0.133.0_ | installed native asset graph, integrity, Bun packaging plugin and the artifact loader check; a client bundled into one self-contained, hashed file; a typed client built into a proven npm package with several entries, declarations and external peers; no runtime install policy |
|
|
72
|
+
| `stitchkit/files` | server (Bun or Node) | stable<br>_redefined in 5 of the 40 minors since 0.94.0, most recently 0.133.0_ | peer-free managed local-file boundary |
|
|
73
|
+
| `stitchkit/spend` | server (Bun or Node) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | peer-free spend gateway for paid model APIs: the attempt recorded before the call and closed on every outcome, credentials only for the provider's origin, a spooled ledger, rank-merged receipts and a reconciler |
|
|
74
|
+
| `stitchkit/spend/testing` | tests on Bun or Node | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | the coverage guard: red on a model SDK import, a provider key or a provider host outside the gateway files |
|
|
75
|
+
| `stitchkit/service-host` | server (Bun or Node) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | peer-free host service supervision — verified versioned artifact activation, Linux `systemd` and macOS `launchd` units (`plutil`, `bootout`/`bootstrap`, rollback), live process/Unix-socket identity verification, and an in-process config-watched reloader |
|
|
76
|
+
| `stitchkit/service-host/macos` | server (Bun or Node, macOS) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | peer-free macOS daemon bundle toolkit — fail-closed Developer ID `codesign`, strict C11 launcher `.app` bundles with atomic `RENAME_SWAP` install/rollback, Apple 824×824 squircle `AppIcon.icns`, streaming `lsregister` maintenance, and TCC responsibility inspection |
|
|
77
|
+
| `stitchkit/service-host/work` | server (Bun or Node; Linux with systemd ≥ 254, or a process root on Linux and macOS) | evolving<br>_redefined in 0 of the 1 minor since 0.133.0_ | peer-free launch of work in its own boundary with a declared owner — a transient systemd scope or a recorded process root, the typed owner record, the one inherited variable that names the boundary, and the membership check that asks the boundary; see [native I/O](native-io.md#work-in-its-own-boundary) |
|
|
78
|
+
| `stitchkit/telegram` | server (Bun or Node) | evolving<br>_redefined in 8 of the 40 minors since 0.94.0, most recently 0.127.0_ | peer-free Telegram platform primitives — Mini App `initData` verification, widget limits and the `widget_query` and widget message schemas, send-failure classification, one outbound budget per bot token with weighted albums and per-chat 429 pauses, resumable broadcasts, the operator channel with dedupe, a Bot API transport that separates a request that never left from an unknown outcome, local Bot API files, the waveform of a voice message read from its PCM, webhook ownership and durable webhook update intake |
|
|
79
|
+
| `stitchkit/telegram/grammy` | server (Bun or Node) | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the token's outbound budget as one grammY client transformer — a 429 that comes back as a response pauses its chat, and a cancelled wait is a request that never left; the widget methods over the same client |
|
|
80
|
+
| `stitchkit/telegram/html` | browser and server | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | Telegram's HTML as a tree — compile GFM Markdown to Telegram HTML with fence-aware splitting, clean any markup to what Telegram accepts, cut long text into valid parts by what the reader sees, check markup before it is sent |
|
|
81
|
+
| `stitchkit/telegram/voice` | browser and server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the waveform of a voice message as one format — packed for `sendVoice` the way Telegram Desktop scales it, unpacked to draw it, a `getMe` read of whether the server takes it |
|
|
82
|
+
| `stitchkit/telegram/screens` | server (Bun or Node) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | a bot's menus as declared screens over grammY — typed paths, actions and input, message reconciliation, state in any `StorageAdapter`, a test chat |
|
|
83
|
+
| `stitchkit/tracking` | browser **and** server | evolving<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | visitor-tracking mechanics — `createTrackingClient`, the tab-shared outbox, the page-leave beacon, attribution, the contract factory; no event vocabulary, no React |
|
|
84
|
+
| `stitchkit/tracking/contract` | browser **and** server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the wire shapes — the contract factory, event and visit schemas, the performance sample and its trust threshold; brings `zod` |
|
|
85
|
+
| `stitchkit/tracking/performance` | browser **and** server | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | Web Vitals from real visitors, collected after load through the optional peer `web-vitals`; no `zod` |
|
|
86
|
+
| `stitchkit/tracking/server` | server (Bun or Node) | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the decisions a tracking backend makes — dispositions, visit lease over an application-owned store, active intervals, presence; no database |
|
|
87
|
+
| `stitchkit/release` | browser **and** server | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | a page follows the release it was built for — `createReleaseMarker` on the server, `createReleaseWatcher` in the browser, the `X-Build-Id` header and a socket event between them |
|
|
88
|
+
| `stitchkit/voice` | browser **and** server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the mechanics of a live voice reply — `SentenceCutter`, `speakableText`, a `SpeechQueue` that synthesises ahead and stops on interruption, the conversation phases |
|
|
89
|
+
| `stitchkit/sync` | browser **and** server | evolving<br>_redefined in 1 of the 7 minors since 0.127.0, most recently 0.132.0_ | the client half of an offline-first sync — which outbox rows leave next, pending edits on top of remote rows, deletes that win until acknowledged, the cursor session, the push and page wire with an open outcome vocabulary; no driver, runs in Hermes |
|
|
90
|
+
| `stitchkit/sync/postgres` | server (Bun or Node) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | the server half — versions that commit in order, a ledger that runs each change once, a feed of what changed, inside the app's own transaction; a memory store and `checkSyncStore` |
|
|
91
|
+
| `stitchkit/geo` | server (Bun or Node) | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
|
|
92
|
+
| `stitchkit/geo/contract` | browser **and** server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the place snapshot schema, for a shared contract that stores or sends `GeoAttribution`; brings `zod` |
|
|
93
|
+
| `stitchkit/xlsx` | browser **and** server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | a workbook from rows and typed columns, with no dependency; text never runs as a formula |
|
|
94
|
+
| `stitchkit/oauth` | browser **and** server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
|
|
95
|
+
| `stitchkit/google` | server (Bun or Node) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | optional Google code exchange and verified OIDC identity adapter |
|
|
96
|
+
| `stitchkit/observability` | server | stable<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
|
|
97
|
+
| `stitchkit/testing` | tests on Bun or Node | stable<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | in-process generated clients over a real Fetch handler, the managed-resource conformance kit and manual time for schedules and retries |
|
|
98
|
+
| `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.128.0_ | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
|
|
99
|
+
| `stitchkit/react` | browser + server rendering | stable<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
|
|
100
|
+
| `stitchkit/react/keyboard` | browser | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.115.0_ | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
|
|
101
|
+
| `stitchkit/react/keyboard/testing` | server (Bun or Node) | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the keyboard layers and zones without a DOM — fakes for the window, elements and key events beside the two engines, to test the order of layers, `scope`/`inert` and the edges of a zone in milliseconds |
|
|
102
|
+
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 9 of the 40 minors since 0.94.0, most recently 0.128.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
|
|
103
|
+
| `stitchkit/agent-runtime/sandbox` | server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | optional Linux Bubblewrap sessions, host sandbox capability probes, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
|
|
104
|
+
| `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
|
|
105
|
+
| `stitchkit/agent-runtime/harness` | server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
|
|
106
|
+
| `stitchkit/agent-runtime/coding-tools` | server (Bun or Node) | evolving<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | bounded host-authorized direct file and shell tools; a root boundary, not an OS sandbox |
|
|
107
|
+
| `stitchkit/agent-runtime/openrouter` | server | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | isolated OpenRouter language-model adapter |
|
|
108
|
+
| `stitchkit/agent-runtime/browser` | browser + server | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | canonical agent records, events, reconnect cursor and optional conversation controller |
|
|
109
|
+
| `stitchkit/agent-runtime/react` | browser + server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | React subscription to an application-owned agent controller |
|
|
110
|
+
| `stitchkit/agent-runtime/realtime` | server (Bun or Node) | evolving<br>_redefined in 2 of the 40 minors since 0.94.0, most recently 0.127.0_ | authorized agent control over the existing Socket.IO server |
|
|
111
|
+
| `stitchkit/agent-executor` | server (Bun or Node) | evolving<br>_redefined in 4 of the 7 minors since 0.127.0, most recently 0.133.0_ | the executor ↔ server contract for external coding agents (Claude Code, Codex, ACP): delta vocabulary over the shared message parts, thread leases with a fence, turn phases and their reports |
|
|
112
|
+
| `stitchkit/agent-executor/claude` | server (Bun or Node) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | the Claude Code driver: the unmodified CLI over `stream-json`, permission requests answered by the host, reconcile by the input's id in the profile's transcript |
|
|
113
|
+
| `stitchkit/agent-executor/claude-sdk` | server (Bun or Node) | evolving<br>_redefined in 1 of the 7 minors since 0.127.0, most recently 0.131.0_ | Claude through the Agent SDK: the application's `query` (optional peer `@anthropic-ai/claude-agent-sdk`), the CLI's classifier, `canUseTool` asked of the host |
|
|
114
|
+
| `stitchkit/agent-executor/acp` | server (Bun or Node) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | an Agent Client Protocol v1 agent over stdio: settings by category, images, MCP servers, `session/resume`/`load`/`list`, `session/cancel`; no reconcile |
|
|
115
|
+
| `stitchkit/agent-executor/codex` | server (Bun or Node) | evolving<br>_redefined in 3 of the 7 minors since 0.127.0, most recently 0.133.0_ | the Codex driver: `codex app-server` over stdio or Unix-socket WebSocket (`unix-listen` / `unix-connect`), thread policy and live controls, approval and input requests answered by the host, unknown server requests refused, reconcile by the client id in `thread/turns/list` |
|
|
116
|
+
| `stitchkit/agent-executor/testing` | server (Bun or Node) | evolving<br>_redefined in 1 of the 7 minors since 0.127.0, most recently 0.133.0_ | the engine conformance kit, deterministic replay driver, portable fake Codex app-server, fail-loud consumer stub factories, and schema-validated test fixtures; no optional peer |
|
|
117
|
+
| `stitchkit/agent-executor/testing/claude-sdk` | server (Bun or Node) | evolving<br>_redefined in 0 of the 1 minor since 0.133.0_ | the multi-turn fake Claude SDK query harness and the Claude SDK session stub, typed by the optional peer `@anthropic-ai/claude-agent-sdk` |
|
|
118
|
+
| `stitchkit/agent-runtime/postgres` | server (Bun or Node) | evolving<br>_redefined in 0 of the 7 minors since 0.127.0_ | the agent store, conversation reader and companion host on Postgres, over the application's own client (Bun SQL, Prisma, `pg`) |
|
|
119
|
+
| `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | durable built-in SQLite store for the agent runtime |
|
|
120
|
+
| `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving<br>_redefined in 1 of the 40 minors since 0.94.0, most recently 0.127.0_ | durable built-in SQLite store for the agent runtime |
|
|
119
121
|
| `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
|
|
120
|
-
| `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the
|
|
121
|
-
| `stitchkit/application/grammy` | server | evolving<br>_redefined in 0 of the
|
|
122
|
-
| `stitchkit/application/opentelemetry` | server | evolving<br>_redefined in 0 of the
|
|
123
|
-
| `stitchkit/application/diagnostic-journal` | server | evolving<br>_redefined in 3 of the
|
|
124
|
-
| `stitchkit/application/directory-inbox` | server | evolving<br>_redefined in 0 of the
|
|
122
|
+
| `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the 40 minors since 0.94.0, most recently 0.127.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
|
|
123
|
+
| `stitchkit/application/grammy` | server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
|
|
124
|
+
| `stitchkit/application/opentelemetry` | server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | maps application snapshots onto an injected OpenTelemetry `Meter` |
|
|
125
|
+
| `stitchkit/application/diagnostic-journal` | server | evolving<br>_redefined in 3 of the 40 minors since 0.94.0, most recently 0.127.0_ | the local diagnostic journal — an exclusive bounded writer and snapshot reader with explicit anomalies |
|
|
126
|
+
| `stitchkit/application/directory-inbox` | server | evolving<br>_redefined in 0 of the 40 minors since 0.94.0_ | the directory inbox — entries another program drops into a directory, delivered to the application at least once |
|
|
125
127
|
|
|
126
128
|
Rule of thumb: browser code imports `stitchkit` and `stitchkit/react`; server
|
|
127
129
|
code adds `stitchkit/server` (or `stitchkit/node` on Node) and opts into
|
|
@@ -230,7 +232,8 @@ map — feature → packages:
|
|
|
230
232
|
| Postgres agent store (`stitchkit/agent-runtime/postgres`) | — (the application's own Postgres client) |
|
|
231
233
|
| SQLite agent store (`stitchkit/agent-runtime/sqlite/bun` or `/node`) | — (runtime built-in) |
|
|
232
234
|
| Agent executor — Claude Agent SDK leaf (`stitchkit/agent-executor/claude-sdk`) | `@anthropic-ai/claude-agent-sdk` |
|
|
233
|
-
| Agent executor — consumer testing kit (`stitchkit/agent-executor/testing`) |
|
|
235
|
+
| Agent executor — consumer testing kit (`stitchkit/agent-executor/testing`) | — |
|
|
236
|
+
| Agent executor — Claude SDK testing kit (`stitchkit/agent-executor/testing/claude-sdk`) | `@anthropic-ai/claude-agent-sdk` (types only; runtime peer-free) |
|
|
234
237
|
| MCP host/client tests | `@modelcontextprotocol/client` |
|
|
235
238
|
| MCP Apps UI widgets | `@modelcontextprotocol/ext-apps` |
|
|
236
239
|
| React data layer (`stitchkit/react`) | `@tanstack/react-query` `react-query-kit` |
|
|
@@ -3834,6 +3837,37 @@ seventh constructor argument remains `ErrorOptions`, including `cause`; the opti
|
|
|
3834
3837
|
retryability argument is eighth. Closed error/frame schemas must accept the new optional
|
|
3835
3838
|
field before their producer declares it.
|
|
3836
3839
|
|
|
3840
|
+
### Read a refusal the operation declared
|
|
3841
|
+
|
|
3842
|
+
When an endpoint declares `refuses` ([Auth & errors](./auth-and-errors.md#the-codes-an-operation-refuses-with)),
|
|
3843
|
+
every client method carries `refusal(error)`. It returns the rejection as one of
|
|
3844
|
+
that operation's refusals — `code` narrowed to the declared codes plus the
|
|
3845
|
+
framework codes (`STITCH_ERROR_STATUS`) and the client's own (`CLIENT_ERROR_CODES`),
|
|
3846
|
+
`details` typed by the declared code's schema — or `undefined` for anything else:
|
|
3847
|
+
|
|
3848
|
+
```ts
|
|
3849
|
+
try {
|
|
3850
|
+
await api.sleep({ id })
|
|
3851
|
+
} catch (error) {
|
|
3852
|
+
const refusal = api.sleep.refusal(error)
|
|
3853
|
+
switch (refusal?.code) {
|
|
3854
|
+
case 'NOT_IDLE':
|
|
3855
|
+
return showBusy()
|
|
3856
|
+
case 'MIN_AWAKE':
|
|
3857
|
+
return showMinimum(refusal.details.minimum) // number, from the schema
|
|
3858
|
+
case 'REQUEST_TIMEOUT':
|
|
3859
|
+
return retryLater()
|
|
3860
|
+
}
|
|
3861
|
+
throw error
|
|
3862
|
+
}
|
|
3863
|
+
```
|
|
3864
|
+
|
|
3865
|
+
`undefined` covers an error that is no `ApiError`, a code the operation did not
|
|
3866
|
+
declare (a newer server, another vocabulary) and details its schema refuses — the
|
|
3867
|
+
client never hands back a type the value does not have. Comparing with a code the
|
|
3868
|
+
operation did not declare does not type-check. An endpoint without `refuses` still
|
|
3869
|
+
reads the framework and client codes.
|
|
3870
|
+
|
|
3837
3871
|
## Which contract does the server speak
|
|
3838
3872
|
|
|
3839
3873
|
A client is built from one version of a contract and a server from another
|
|
@@ -4601,6 +4635,7 @@ await mcp.close()
|
|
|
4601
4635
|
| `coerceJsonArgs` | coerce JSON-stringified object/array arguments (default `true`) |
|
|
4602
4636
|
| `flattenUnionInput` | advertise discriminated unions as one object (default `false`) |
|
|
4603
4637
|
| `inputRecursionDepth` | advertise inputs with no `$ref`, recursion unrolled this many levels (default: references stay) |
|
|
4638
|
+
| `inputNestingDepth` | keep every advertised input within this many nesting levels, as a provider counts them (default: no limit) |
|
|
4604
4639
|
| `errorHint` | add a project-owned hint to failed tool results |
|
|
4605
4640
|
| `onOutputStrip` | observe output keys removed by contract validation |
|
|
4606
4641
|
| `protectedResource` | RFC 9728 metadata used by HTTP `401` responses |
|
|
@@ -5142,8 +5177,8 @@ createStdioMcpServer({
|
|
|
5142
5177
|
```
|
|
5143
5178
|
|
|
5144
5179
|
- **Opt-in only.** Omitting `discovery` keeps the default full `tools/list` surface untouched. In `'lazy'` mode `initialTools` is required (pass `[]` to hide every contract tool initially).
|
|
5145
|
-
- **Session-isolated reveal.** Every contract tool outside `initialTools` starts disabled on that `McpServer` instance. Calling `tool_search` ranks hidden tools by name and description (exact/phrase matches first, then deduplicated word matches), enables up to `maxResults`
|
|
5146
|
-
- **Identical access
|
|
5180
|
+
- **Session-isolated reveal.** Every contract tool outside `initialTools` starts disabled on that `McpServer` instance. Calling `tool_search` ranks the still-hidden tools by name and description (exact/phrase matches first, then deduplicated word matches), enables up to `maxResults` of them on that session's `McpServer` — tools already enabled never take a slot, so repeating a search reaches the matches past the first `maxResults`; they are listed after the new ones with `newlyEnabled: false` — and emits a single `notifications/tools/list_changed` when at least one new tool is revealed. Enabling tools in one session never mutates another session or the shared prepared surface.
|
|
5181
|
+
- **Identical access, no catalog stamp.** `tool_search` and every revealed tool enforce the exact same `access` policy (`gate` / `inspect` / `open`) and hooks. A surface with discovery sends no `stitchkit/catalog` stamp: each session lists its own subset, which no digest of the whole surface describes, so a connection's catalog store lists afresh instead of keeping one session's view. Unknown names in `initialTools`, `searchToolName` collisions with real tools, and out-of-range `maxResults` throw synchronously at mount time.
|
|
5147
5182
|
- **Stateful mounts only.** `createMcpHandler` creates a fresh stateless `McpServer` per HTTP request and therefore refuses `discovery` synchronously with `TypeError`; use `discovery` on stateful mounts (`createStdioMcpServer`, `buildMcpServer`, `mountMcp`).
|
|
5148
5183
|
|
|
5149
5184
|
### MCP schema validation profile
|
|
@@ -5316,6 +5351,34 @@ The depth is a number, not a size: a provider may limit nesting from above, and
|
|
|
5316
5351
|
model forced to call the tool may need more levels from below. Measure the cost
|
|
5317
5352
|
with `describeToolCatalog({ …, maxSchemaBytes })`. → [ADR 0319](../decisions/0319-a-tool-input-can-be-advertised-without-references.md).
|
|
5318
5353
|
|
|
5354
|
+
### A provider's nesting limit — `inputNestingDepth`
|
|
5355
|
+
|
|
5356
|
+
Some providers refuse the whole tool set when one input document is nested deeper than a fixed
|
|
5357
|
+
number of levels. `inputNestingDepth` keeps every advertised input within such a limit, counting
|
|
5358
|
+
as such a provider counts: a level per step `properties → property` or `items`; `anyOf`, `oneOf`,
|
|
5359
|
+
`allOf` and `additionalProperties` cost nothing; a property named `items` or `properties` costs two.
|
|
5360
|
+
|
|
5361
|
+
```ts
|
|
5362
|
+
const projection = { flattenUnionInput: true, inputRecursionDepth: 1, inputNestingDepth: 10 } as const
|
|
5363
|
+
mountAgent(services, { access, runtimeTools, ...projection })
|
|
5364
|
+
|
|
5365
|
+
// one tool may say its own, as with inputRecursionDepth
|
|
5366
|
+
put: { method: 'POST', path: '/put', input, tool: { name: 'lesson_put', inputNestingDepth: 10 } }
|
|
5367
|
+
```
|
|
5368
|
+
|
|
5369
|
+
- A document at or under the limit is unchanged. Deeper, the node whose next step would cross the
|
|
5370
|
+
limit becomes an open node `{}` (its `description` kept), as deep as the limit allows: the rest
|
|
5371
|
+
of the structure stays visible to the model.
|
|
5372
|
+
- The open node accepts every value — the document widens, it never narrows — and the handler still
|
|
5373
|
+
parses the contract's own schema. An array whose `items` would cross the limit is opened itself,
|
|
5374
|
+
so no array is left without `items`.
|
|
5375
|
+
- The limit applies last, to the document as it is advertised: after `inputRecursionDepth` writes
|
|
5376
|
+
references out (so it also bounds the unrolled recursion), `flattenUnionInput` and tool defaults.
|
|
5377
|
+
With references kept, a `$ref` counts as a leaf.
|
|
5378
|
+
- `schemaValidation.requireTypedProperties` accepts the open nodes: the limit declared them.
|
|
5379
|
+
- `tool.inputNestingDepth` wins over the surface's value, as `tool.inputRecursionDepth` does; runtime
|
|
5380
|
+
tools and the deferred tool surface take the surface's value.
|
|
5381
|
+
|
|
5319
5382
|
## `mountMcp`
|
|
5320
5383
|
|
|
5321
5384
|
If you already run an `McpServer` from the SDK, `mountMcp` adds contract tools
|
|
@@ -6455,7 +6518,7 @@ the field is ignored and the query is ranked as usual.
|
|
|
6455
6518
|
|
|
6456
6519
|
Every ceiling is required. `maxSchemaBytes` measures UTF-8 bytes over canonical
|
|
6457
6520
|
name, description and presentation schema. The options that shape how inputs are
|
|
6458
|
-
advertised — `extend`, `flattenUnionInput`, `inputRecursionDepth` — are set on
|
|
6521
|
+
advertised — `extend`, `flattenUnionInput`, `inputRecursionDepth`, `inputNestingDepth` — are set on
|
|
6459
6522
|
`createDeferredAgentToolSurface`, not on `mount`, so the manifest the selector
|
|
6460
6523
|
ranks and the ceilings measure is the one the model receives; a `mount` that
|
|
6461
6524
|
names one is refused. It is useful for before/after
|
|
@@ -10142,20 +10205,21 @@ exit status, deadlines, cancellation and `onLeaderSettled` retain the requested
|
|
|
10142
10205
|
|
|
10143
10206
|
An unbundled application already launches the package's own guard module. A single-file bundle
|
|
10144
10207
|
whose application entry also owns argv routing must load the narrow bootstrap before its dispatcher
|
|
10145
|
-
and skip dispatch when it claims
|
|
10208
|
+
and skip dispatch when it claims a private package invocation. This is especially relevant when the
|
|
10146
10209
|
full command runner stays behind a dynamic import:
|
|
10147
10210
|
|
|
10148
10211
|
```ts
|
|
10149
|
-
import {
|
|
10212
|
+
import { bootstrapPackageProcess } from 'stitchkit/process/bootstrap'
|
|
10150
10213
|
|
|
10151
|
-
if (!
|
|
10214
|
+
if (!bootstrapPackageProcess()) {
|
|
10152
10215
|
await dispatch(process.argv.slice(2)) // may lazy-import `stitchkit/process`
|
|
10153
10216
|
}
|
|
10154
10217
|
```
|
|
10155
10218
|
|
|
10156
|
-
The bootstrap carries the package-owned
|
|
10157
|
-
|
|
10158
|
-
|
|
10219
|
+
The bootstrap carries the package-owned invocations into the bundle: the owner-loss guard, and the
|
|
10220
|
+
process root of [work launched in its own boundary](#work-in-its-own-boundary). It returns `false`
|
|
10221
|
+
for application argv and `true` only for a private invocation the package serves, so the
|
|
10222
|
+
application does not read a flag or filename. The built file is self-contained; no installed `node_modules`
|
|
10159
10223
|
is needed beside it.
|
|
10160
10224
|
|
|
10161
10225
|
### Stopping a command: the `stop` policy
|
|
@@ -10250,6 +10314,129 @@ refused there and nothing is stopped after its leader exits. A command whose gro
|
|
|
10250
10314
|
launcher supplied by a host) has no group to stop, and `descendants` has nothing to act on there.
|
|
10251
10315
|
|
|
10252
10316
|
|
|
10317
|
+
## Work in its own boundary
|
|
10318
|
+
|
|
10319
|
+
A machine that runs many launchers ends up with one service holding a hundred processes and no
|
|
10320
|
+
answer to "who started this one". `stitchkit/service-host/work` launches a command in a boundary
|
|
10321
|
+
of its own and declares who owns it:
|
|
10322
|
+
|
|
10323
|
+
```ts
|
|
10324
|
+
import { inheritedWork, launchWork } from 'stitchkit/service-host/work'
|
|
10325
|
+
|
|
10326
|
+
const launch = await launchWork({
|
|
10327
|
+
owner: {
|
|
10328
|
+
launcher: 'session-host', // your launcher's own name
|
|
10329
|
+
id: session.id, // unique among your live work on this machine
|
|
10330
|
+
label: session.title,
|
|
10331
|
+
project: session.project, // or null
|
|
10332
|
+
agent: session.agent, // { harness, model, address } or null
|
|
10333
|
+
parent: await inheritedWork(), // the work this process itself runs in, or null
|
|
10334
|
+
},
|
|
10335
|
+
placement: { kind: 'transient-scope', manager: 'system', slice: 'caller' },
|
|
10336
|
+
command: { executable, args, env, stdio: 'inherit', signal: shutdown.signal },
|
|
10337
|
+
})
|
|
10338
|
+
|
|
10339
|
+
launch.unit // { manager: 'system', name: 'session-host-<id>.scope' }
|
|
10340
|
+
launch.root // { pid, instance } — the process the work started as
|
|
10341
|
+
await launch.stop() // ends the whole boundary
|
|
10342
|
+
```
|
|
10343
|
+
|
|
10344
|
+
The owner record is yours to keep and to serve to whoever asks; the package gives its schema
|
|
10345
|
+
(`WorkOwnerSchema`), the launch and the check. Every field of the record is answered: `project`,
|
|
10346
|
+
`agent` and `parent` take `null` as a declared "none", and a missing field is refused.
|
|
10347
|
+
|
|
10348
|
+
### The variable names, the boundary proves
|
|
10349
|
+
|
|
10350
|
+
The launched command and everything it starts inherit one variable, `STITCHKIT_WORK_ORIGIN`: a
|
|
10351
|
+
small JSON value with the work's reference (`launcher`, `id`) and its boundary. A process that
|
|
10352
|
+
leaves the boundary keeps the variable, and anyone can set it, so it is only a claim.
|
|
10353
|
+
`checkWorkMembership({ pid, boundary })` asks the boundary itself:
|
|
10354
|
+
|
|
10355
|
+
| answer | meaning |
|
|
10356
|
+
|---|---|
|
|
10357
|
+
| `{ state: 'member', via }` | the process is in the boundary; `via` names the evidence (`cgroup`, `root`, `process-group`, `ancestry`) |
|
|
10358
|
+
| `{ state: 'outside', observed }` | it is not, with the control group or the group and parent chain that was seen instead |
|
|
10359
|
+
| `{ state: 'gone' }` | there is no such process |
|
|
10360
|
+
| `{ state: 'unavailable', reason, cause }` | the boundary could not be asked; never read this as `outside` |
|
|
10361
|
+
|
|
10362
|
+
`readWorkOrigin()` parses the variable of the current process (`null` when absent; a value that
|
|
10363
|
+
does not parse throws `WorkLaunchError` with reason `origin-unreadable`). `inheritedWork()` returns
|
|
10364
|
+
the reference only when the current process is proven to be inside the boundary the variable
|
|
10365
|
+
names — that is what a nested launcher declares as `parent`.
|
|
10366
|
+
|
|
10367
|
+
To find the owner of an arbitrary process on Linux, read its control group, take the `*.scope`
|
|
10368
|
+
component and compare it with `workUnitName(record)` of each launcher's records. The unit name is
|
|
10369
|
+
`<launcher>-<id>.scope`; it is computed one way and never parsed back, because two different
|
|
10370
|
+
owners can spell the same name.
|
|
10371
|
+
|
|
10372
|
+
### Placement
|
|
10373
|
+
|
|
10374
|
+
Placement is always written out; a host that cannot make the boundary you asked for throws
|
|
10375
|
+
`WorkLaunchError` with a `reason`, and nothing is started as a plain child instead.
|
|
10376
|
+
|
|
10377
|
+
| placement | boundary | holds |
|
|
10378
|
+
|---|---|---|
|
|
10379
|
+
| `{ kind: 'transient-scope', manager, slice, limits? }` | a transient systemd scope (Linux, systemd 254 or newer, cgroup v2) | every descendant, including one that called `setsid` |
|
|
10380
|
+
| `{ kind: 'process-root' }` | a recorded root process (Linux and macOS) | the root, the process group it leads, and processes whose parent chain reaches the live root |
|
|
10381
|
+
|
|
10382
|
+
For a scope:
|
|
10383
|
+
|
|
10384
|
+
- `manager` is `'system'` or `'user'`. The user manager is reached through `XDG_RUNTIME_DIR`, or
|
|
10385
|
+
through `/run/user/<uid>` when that directory is the caller's own; otherwise the launch refuses
|
|
10386
|
+
with `user-manager-unreachable`. The system manager takes scopes from root only: a non-root
|
|
10387
|
+
caller is refused with `manager-unauthorized` before anything starts, because the system
|
|
10388
|
+
manager may let it start a unit and then deny stopping it (polkit asks for interactive
|
|
10389
|
+
authentication), which would leave work its launcher cannot end. Such a caller uses `'user'`.
|
|
10390
|
+
- `slice: 'caller'` keeps the caller's own slice, and so the resource limits that slice carries; a
|
|
10391
|
+
caller with no slice under that manager is refused with `slice-unresolvable`. Any other value
|
|
10392
|
+
names a slice in full (`'build.slice'`).
|
|
10393
|
+
- `limits` become properties of the unit: `memoryMaxMb`, `memorySwapMaxMb`, `cpuQuotaPercent`,
|
|
10394
|
+
`cpuWeight` and `runtimeMaxSeconds`.
|
|
10395
|
+
- The command's arguments arrive as written. `systemd-run` would otherwise expand `${VAR}` and `$$`
|
|
10396
|
+
in them, so the scope is started with `--expand-environment=no`, an option systemd has since
|
|
10397
|
+
version 254; an older systemd is refused with `systemd-too-old`.
|
|
10398
|
+
- A launcher id that is still running refuses a second launch with `unit-exists`. The name is free
|
|
10399
|
+
again once the scope has emptied and the manager has collected it.
|
|
10400
|
+
- A scope is not part of its launcher's service: restarting the launcher's service leaves its
|
|
10401
|
+
scopes running. Stop them with `launch.stop()` — or `systemctl stop <unit>` — when they must not
|
|
10402
|
+
outlive it.
|
|
10403
|
+
|
|
10404
|
+
`probeWorkBoundary(placement)` answers `{ state: 'available' }` or `{ state: 'unavailable',
|
|
10405
|
+
reason, cause }` without launching anything.
|
|
10406
|
+
|
|
10407
|
+
A process root has one stated limit: a descendant that left the group with `setsid` **and** lost
|
|
10408
|
+
its parent is `outside`. A scope would still hold it. Use a process root where there is no
|
|
10409
|
+
transient scope — macOS, or a Linux host without systemd — and name it yourself: the package never
|
|
10410
|
+
substitutes one boundary for the other. The root is a package-owned entry that measures its own
|
|
10411
|
+
process instance, writes it into the variable and replaces itself with your command through
|
|
10412
|
+
`process.execve`, so the root pid is your command's pid; the runtime must provide `process.execve`.
|
|
10413
|
+
A single-file bundle carries that entry through
|
|
10414
|
+
[`bootstrapPackageProcess()`](#commands).
|
|
10415
|
+
|
|
10416
|
+
### When another program does the spawning
|
|
10417
|
+
|
|
10418
|
+
A terminal multiplexer, a remote shell or another supervisor starts the command itself. Hand it
|
|
10419
|
+
the wrapped command instead:
|
|
10420
|
+
|
|
10421
|
+
```ts
|
|
10422
|
+
import { workCommand } from 'stitchkit/service-host/work'
|
|
10423
|
+
|
|
10424
|
+
const placed = await workCommand({ owner, placement, executable, args, env })
|
|
10425
|
+
// placed.executable, placed.args, placed.env — run exactly these
|
|
10426
|
+
```
|
|
10427
|
+
|
|
10428
|
+
`env` is written out (`{}` for none): the result extends it with `STITCHKIT_WORK_ORIGIN`, and for
|
|
10429
|
+
the user manager with `XDG_RUNTIME_DIR`. A bare executable name is found on the `PATH` the command
|
|
10430
|
+
is given.
|
|
10431
|
+
|
|
10432
|
+
### What the launch's own signal stops
|
|
10433
|
+
|
|
10434
|
+
`command` takes the options of `runNativeCommand` except `group`, `ownerLoss` and
|
|
10435
|
+
`onLeaderStarted`. Its `signal`, `timeoutMs` and `stop` policy act on the root's process group, as
|
|
10436
|
+
they do for any command; `launch.stop()` ends the whole boundary — for a scope, through the
|
|
10437
|
+
manager, which also ends processes that left the group. `launch.result` settles like
|
|
10438
|
+
`runNativeCommand`.
|
|
10439
|
+
|
|
10253
10440
|
## A contract operation in a process of its own
|
|
10254
10441
|
|
|
10255
10442
|
A handler that reads gigabytes holds the server's event loop while it reads, and every cheap
|
|
@@ -10675,8 +10862,7 @@ The plugin does not parse consumer JS or establish a second runtime native imple
|
|
|
10675
10862
|
|
|
10676
10863
|
A package that owns a server usually ships a typed client for it, and the client's consumers
|
|
10677
10864
|
must not inherit the server's dependencies. `buildClientArtifact` (`stitchkit/files/packaging`)
|
|
10678
|
-
bundles one entry module into a single file
|
|
10679
|
-
npm archive of it:
|
|
10865
|
+
bundles one entry module into a single file and publishes its SHA-256 beside it:
|
|
10680
10866
|
|
|
10681
10867
|
```ts
|
|
10682
10868
|
import { buildClientArtifact } from 'stitchkit/files/packaging'
|
|
@@ -10685,30 +10871,175 @@ const artifact = await buildClientArtifact({
|
|
|
10685
10871
|
entry: 'src/api-client.ts',
|
|
10686
10872
|
outFile: 'dist/api-client.js', // + dist/api-client.js.sha256
|
|
10687
10873
|
forbiddenModules: ['chalk', '@acme/terminal-ui', 'src/terminal/', /providers\//],
|
|
10688
|
-
package: {
|
|
10689
|
-
name: '@acme/api-client', version: '1.4.0', outDir: 'dist',
|
|
10690
|
-
exports: ['createApiClient'],
|
|
10691
|
-
},
|
|
10692
10874
|
})
|
|
10693
|
-
// artifact.file, artifact.sha256, artifact.bytes, artifact.modules
|
|
10875
|
+
// artifact.file, artifact.sha256, artifact.bytes, artifact.modules
|
|
10694
10876
|
```
|
|
10695
10877
|
|
|
10696
10878
|
- **`forbiddenModules`** refuses a bundle whose module graph reaches a listed module with a
|
|
10697
10879
|
`ForbiddenModuleError` naming the module and what imports it. A bare or scoped name
|
|
10698
|
-
(`'chalk'`, `'@scope/pkg'`) is a package
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
package's `node_modules` fails there, before it reaches a consumer; a failed proof removes the
|
|
10705
|
-
file and its hash again.
|
|
10880
|
+
(`'chalk'`, `'@scope/pkg'`, `'node:child_process'`) is a package or a platform module: it is
|
|
10881
|
+
matched by the specifier that imports it, so a linked or workspace package is caught wherever
|
|
10882
|
+
it really lives and a platform module is caught although it is never bundled, and by its
|
|
10883
|
+
installed path. A string with a slash matches a fragment of the project's own source path; a
|
|
10884
|
+
`RegExp` is tested against each bundled module's absolute path. Nothing is left at `outFile`
|
|
10885
|
+
when the build is refused.
|
|
10706
10886
|
- **`runtime`** is the platform the file is built for — `node` by default, which Bun also runs,
|
|
10707
10887
|
or `bun` or `browser`; a module the platform does not have fails the build.
|
|
10708
10888
|
|
|
10709
|
-
The build
|
|
10710
|
-
|
|
10711
|
-
|
|
10889
|
+
The build runs Bun as a bounded command: `timeoutMs` (default 120 s) is its deadline, `signal`
|
|
10890
|
+
cancels, and `executables.bun` names the Bun binary when it is not `bun` on `PATH`.
|
|
10891
|
+
|
|
10892
|
+
The file is for a consumer that copies it. A client published to a registry — with types,
|
|
10893
|
+
several entries and peers the consumer already has — is the next section.
|
|
10894
|
+
|
|
10895
|
+
## A typed client as an npm package
|
|
10896
|
+
|
|
10897
|
+
`buildClientPackage` (`stitchkit/files/packaging`) builds a typed client into an npm archive and
|
|
10898
|
+
returns it only after the archive was installed and used the way a consumer uses it:
|
|
10899
|
+
|
|
10900
|
+
```ts
|
|
10901
|
+
import { buildClientPackage } from 'stitchkit/files/packaging'
|
|
10902
|
+
|
|
10903
|
+
const client = await buildClientPackage({
|
|
10904
|
+
name: '@acme/api-client',
|
|
10905
|
+
version: '1.4.0',
|
|
10906
|
+
entries: { '.': 'src/client/index.ts', './monitoring': 'src/client/monitoring.ts' },
|
|
10907
|
+
tsconfig: 'tsconfig.json',
|
|
10908
|
+
peerDependencies: { stitchkit: '^0.133.0', zod: '^4.6.0' },
|
|
10909
|
+
outDir: 'dist', // dist/acme-api-client-1.4.0.tgz
|
|
10910
|
+
})
|
|
10911
|
+
// client.tarball, client.sha256, client.files, client.exports, client.sharedExports, client.proof
|
|
10912
|
+
```
|
|
10913
|
+
|
|
10914
|
+
Publishing the archive, and its provenance, stay with your release.
|
|
10915
|
+
|
|
10916
|
+
### One module graph for every entry
|
|
10917
|
+
|
|
10918
|
+
All `entries` are built in one pass, so a module two of them import is emitted once, as a shared
|
|
10919
|
+
chunk. A schema or an error class exported from `.` and from `./monitoring` is then one object:
|
|
10920
|
+
`===` and `instanceof` hold across the entries, in Node and in Bun. Two separate builds of the
|
|
10921
|
+
same entries give two copies, and both comparisons are false.
|
|
10922
|
+
|
|
10923
|
+
The proof checks it on the installed package: every name more than one subpath exports must be
|
|
10924
|
+
the same value in all of them, and `client.sharedExports` lists the names proven. A name two
|
|
10925
|
+
entries export as different values on purpose goes into `proof.distinctExports`; any other is
|
|
10926
|
+
refused as `shared-export-split`, with the names in `details.names`.
|
|
10927
|
+
|
|
10928
|
+
### Peers and dependencies stay outside
|
|
10929
|
+
|
|
10930
|
+
Each package in `peerDependencies` and `dependencies` is left out of the output and written to
|
|
10931
|
+
the archive's `package.json` under the same key. Both must be installed where the client is
|
|
10932
|
+
built: the proof installs them from there, and refuses with `peer-range` when an installed
|
|
10933
|
+
version is outside the range you declared.
|
|
10934
|
+
|
|
10935
|
+
- An import that reaches into a peer's directory by path — a workspace neighbour imported as
|
|
10936
|
+
`../../packages/kit/index.js` — would bundle it all the same, and is refused as
|
|
10937
|
+
`bundled-peer`. Import the package by its name.
|
|
10938
|
+
- `forbiddenModules` takes the rules of `buildClientArtifact` and also reads imports left
|
|
10939
|
+
outside: `'stitchkit/server'` refuses a client that imports that subpath of a peer, while
|
|
10940
|
+
`stitchkit/contract` stays allowed.
|
|
10941
|
+
|
|
10942
|
+
### Declarations for Bundler and NodeNext
|
|
10943
|
+
|
|
10944
|
+
Declarations are emitted with `tsconfig`, for the entries and what they import — nothing else of
|
|
10945
|
+
the project is typechecked or shipped. The tsconfig's directory is the root: every entry lies
|
|
10946
|
+
under it, and `dist/` in the archive mirrors it. A `typescript` package must be installed in the
|
|
10947
|
+
project; the build runs its compiler with the runtime that runs the build (Bun or Node), and
|
|
10948
|
+
writes a temporary `.client-package-*.tsconfig.json` beside your tsconfig for the length of the
|
|
10949
|
+
emit.
|
|
10950
|
+
|
|
10951
|
+
The compiler leaves relative specifiers in a declaration as the source wrote them, and a
|
|
10952
|
+
consumer under `moduleResolution: NodeNext` cannot resolve an extensionless one. The build
|
|
10953
|
+
rewrites every relative specifier to the `.js` file it stands for, whether the source wrote
|
|
10954
|
+
`'./schema'` or `'./schema.ts'`. What a consumer could not resolve is refused:
|
|
10955
|
+
|
|
10956
|
+
| `reason` | The declaration names | What to do |
|
|
10957
|
+
|---|---|---|
|
|
10958
|
+
| `declaration-unresolved` | a relative module with no declaration in the package — a hand-written `.d.ts` beside the sources, or a `/// <reference path>` | move the types into a `.ts` module |
|
|
10959
|
+
| `declaration-dependency` | a package that is neither a peer nor a dependency — including a tsconfig path alias such as `@/schema` | declare the package, or keep its types out of the public surface; import own modules relatively |
|
|
10960
|
+
|
|
10961
|
+
### Files imported by subpath, and modules built from other contents
|
|
10962
|
+
|
|
10963
|
+
`exportedFiles` puts files a consumer imports by name into `exports`, beside the entries:
|
|
10964
|
+
`'./package.json'` is the archive's own manifest — a consumer reads the client's version from it —
|
|
10965
|
+
and any other names a path in `files`:
|
|
10966
|
+
|
|
10967
|
+
```ts
|
|
10968
|
+
files: { 'native-stream.json': 'config/native-stream.json' },
|
|
10969
|
+
exportedFiles: ['./package.json', './native-stream.json'],
|
|
10970
|
+
// consumer: import pkg from '@acme/api-client/package.json' with { type: 'json' }
|
|
10971
|
+
```
|
|
10972
|
+
|
|
10973
|
+
The proof resolves each by the package name to its packed file in every runtime it imports the
|
|
10974
|
+
entries in, imports a `.json` file as JSON (`client.exports` lists its `default`), and the strict
|
|
10975
|
+
consumer imports it with `with { type: 'json' }` under both resolutions. A file that is in `files`
|
|
10976
|
+
but not in `exportedFiles` is packed and not importable by name.
|
|
10977
|
+
|
|
10978
|
+
`replaceModules` builds a module from contents you give instead of its file. The key is a path,
|
|
10979
|
+
resolved like an entry; the contents are in that file's own format (`.json`, `.ts`, `.tsx`, `.js`,
|
|
10980
|
+
`.jsx`), and every import that reaches the file gets them. A client that imports the project's
|
|
10981
|
+
`package.json` for its version otherwise ships the whole manifest, `scripts` and
|
|
10982
|
+
`devDependencies` included:
|
|
10983
|
+
|
|
10984
|
+
```ts
|
|
10985
|
+
replaceModules: { 'package.json': JSON.stringify({ version }) },
|
|
10986
|
+
```
|
|
10987
|
+
|
|
10988
|
+
A replacement no bundled module imports is refused as `replacement-unused`: it would say the
|
|
10989
|
+
package was built from something it was not. Declarations are still emitted from the files
|
|
10990
|
+
themselves, so a replacement keeps the shape the types describe.
|
|
10991
|
+
|
|
10992
|
+
### What the proof runs
|
|
10993
|
+
|
|
10994
|
+
The archive is installed into an empty directory beside its peers. There the build:
|
|
10995
|
+
|
|
10996
|
+
1. compares every installed file with the one it built;
|
|
10997
|
+
2. imports every subpath by the package name — in Node and Bun for `runtime: 'node'` (the
|
|
10998
|
+
default), in Bun for `'bun'` and `'browser'` — and checks `proof.exports` and shared names,
|
|
10999
|
+
and resolves every exported file;
|
|
11000
|
+
3. typechecks a strict consumer (`strict`, `skipLibCheck: false`) that re-exports every subpath,
|
|
11001
|
+
under `moduleResolution: bundler` and under `NodeNext`.
|
|
11002
|
+
|
|
11003
|
+
```ts
|
|
11004
|
+
proof: {
|
|
11005
|
+
typecheck: ['src/client/consumer-proof.ts'], // your own consumer source, both resolutions
|
|
11006
|
+
exports: { '.': ['createApiClient'], './monitoring': ['readSessions'] },
|
|
11007
|
+
types: ['@types/node'], // type packages the declarations need
|
|
11008
|
+
}
|
|
11009
|
+
```
|
|
11010
|
+
|
|
11011
|
+
A `proof.typecheck` file imports the package by name and nothing relative. Give it a negative
|
|
11012
|
+
assertion — a `// @ts-expect-error` over a value the types must reject — so a type that silently
|
|
11013
|
+
became `any` fails the proof. The consumer typecheck loads the `ES2023` and `DOM` libraries and
|
|
11014
|
+
only the type packages in `proof.types`, installed from the project.
|
|
11015
|
+
|
|
11016
|
+
Peers are installed from the project's own `node_modules`; what they depend on in turn comes
|
|
11017
|
+
from the package manager's cache or registry.
|
|
11018
|
+
|
|
11019
|
+
### Refusals
|
|
11020
|
+
|
|
11021
|
+
A refusal is a `ClientPackageError`: switch on `reason`, read `details`. A forbidden module is a
|
|
11022
|
+
`ForbiddenModuleError`, as for the file. No archive is left in `outDir` after either.
|
|
11023
|
+
|
|
11024
|
+
| `reason` | When | `details` |
|
|
11025
|
+
|---|---|---|
|
|
11026
|
+
| `build` | the bundler failed | `output` |
|
|
11027
|
+
| `replacement-unused` | a module in `replaceModules` is imported by no bundled module | `module` |
|
|
11028
|
+
| `declarations` | the compiler reported an error in the client's graph | `output` |
|
|
11029
|
+
| `declaration-unresolved`, `declaration-dependency` | see above | `file`, `specifier`, `package` |
|
|
11030
|
+
| `bundled-peer` | code of a peer or dependency is in the package | `package`, `module` |
|
|
11031
|
+
| `manifest-owned-field` | `manifest` sets a field the build writes | `field` |
|
|
11032
|
+
| `install` | a peer is not installed for the build, or packing, installing or importing the archive failed | `package` or `output`, `runtime` |
|
|
11033
|
+
| `peer-range` | an installed peer or dependency is outside its declared range | `package`, `range`, `installed` |
|
|
11034
|
+
| `missing-export` | a subpath lacks a name from `proof.exports`, or an exported file does not resolve to its packed path | `subpath`, `names`, `runtime` |
|
|
11035
|
+
| `shared-export-split` | several subpaths export one name as different values | `names`, `runtime` |
|
|
11036
|
+
| `typecheck` | the strict consumer did not typecheck | `resolution`, `output` |
|
|
11037
|
+
|
|
11038
|
+
`manifest` adds descriptive `package.json` fields (`description`, `license`, `repository`, …);
|
|
11039
|
+
`name`, `version`, `type`, `exports`, `files` and the dependency maps come from the build and are
|
|
11040
|
+
refused there. `files` maps a path inside the package to a source file, for a README or a
|
|
11041
|
+
licence. Each tool runs as a bounded command under `timeoutMs` (default 120 s per step) and
|
|
11042
|
+
`signal`; `executables` names `bun`, `node` or `tsc` when the default is not the one to use.
|
|
10712
11043
|
|
|
10713
11044
|
## Qualification boundaries
|
|
10714
11045
|
|
|
@@ -15189,7 +15520,7 @@ core never models them (ADR 0002). But stitchkit itself emits a set of its own:
|
|
|
15189
15520
|
`WAIT_TIMEOUT`,
|
|
15190
15521
|
`WAIT_FAILED`, `CLI_COMMAND_UNAVAILABLE`, `CLI_PRESENTATION_FAILED`, `DOWNLOAD_NOT_FOUND`, `VIEW_HTTP_ERROR`,
|
|
15191
15522
|
`CONNECTION_TIMEOUT`, `CONNECTION_RESPONSE_TOO_LARGE`,
|
|
15192
|
-
`CONNECTION_REQUEST_FAILED`, `UPSTREAM_TOOL_ERROR`, `MCP_STRUCTURED_CONTENT_MISSING`,
|
|
15523
|
+
`CONNECTION_REQUEST_FAILED`, `HTTP_ERROR`, `UPSTREAM_TOOL_ERROR`, `MCP_STRUCTURED_CONTENT_MISSING`,
|
|
15193
15524
|
`OPERATION_NOT_SUCCEEDED`, `OPERATION_BUSY`, `OPERATION_RESPONSE_TOO_LARGE`,
|
|
15194
15525
|
`OPERATION_PROCESS_FAILED`, `STREAM_ITEM_INVALID`, `STREAM_FRAME_TOO_LARGE`,
|
|
15195
15526
|
`STREAM_TERMINAL_MISSING`, `STREAM_LIFETIME_EXCEEDED`,
|
|
@@ -15334,6 +15665,54 @@ their established model-facing projection (code/details/hint, without HTTP
|
|
|
15334
15665
|
status), while `invokeOrThrow` recovers the exact normalized `AppError`. The
|
|
15335
15666
|
codes and schemas remain application-owned; Stitchkit stays domain-free.
|
|
15336
15667
|
|
|
15668
|
+
### The codes an operation refuses with
|
|
15669
|
+
|
|
15670
|
+
An endpoint names the domain codes it can refuse with in `refuses`, by listing the
|
|
15671
|
+
factories `defineErrors` returned. Every factory carries its `code` and
|
|
15672
|
+
`definition`, so the list is the declaration — no second string list to drift:
|
|
15673
|
+
|
|
15674
|
+
```ts
|
|
15675
|
+
const { errors } = defineErrors({
|
|
15676
|
+
NOT_IDLE: { status: 409, message: 'Session is busy' },
|
|
15677
|
+
MIN_AWAKE: { status: 409, details: z.object({ profile: z.string(), minimum: z.number().int() }) },
|
|
15678
|
+
PROFILE_UNAVAILABLE: { status: 503 },
|
|
15679
|
+
})
|
|
15680
|
+
|
|
15681
|
+
export const sessions = defineContract({ prefix: 'session' }, {
|
|
15682
|
+
sleep: {
|
|
15683
|
+
method: 'POST', path: '/sleep', desc: 'Put a session to sleep',
|
|
15684
|
+
input: z.object({ id: z.string() }),
|
|
15685
|
+
output: z.object({ ok: z.boolean() }),
|
|
15686
|
+
refuses: [errors.NOT_IDLE, errors.MIN_AWAKE],
|
|
15687
|
+
},
|
|
15688
|
+
})
|
|
15689
|
+
```
|
|
15690
|
+
|
|
15691
|
+
One declaration, three readers:
|
|
15692
|
+
|
|
15693
|
+
- **The server holds the handler to it.** An `AppError` whose code the operation
|
|
15694
|
+
did not declare — and that is no framework code (`NOT_FOUND`, `FORBIDDEN`, …) —
|
|
15695
|
+
leaves as `INTERNAL_SERVER_ERROR` (500) with the message `Operation session.sleep
|
|
15696
|
+
failed with a code it does not declare`, on HTTP, MCP, the agent surface, the CLI
|
|
15697
|
+
and mid-stream alike, exactly as an output that breaks its schema does. The
|
|
15698
|
+
original error stays on `cause`, so `onError` and the logs still see it; the
|
|
15699
|
+
caller does not. An `implementRemote` proxy is held to the same list even when its
|
|
15700
|
+
origin is not. A failure that is no `AppError` keeps its usual handling, and an
|
|
15701
|
+
operation without `refuses` runs unchanged.
|
|
15702
|
+
- **The typed client reads it.** [`client.sleep.refusal(error)`](client.md#read-a-refusal-the-operation-declared)
|
|
15703
|
+
narrows `code` to the declared codes plus the framework and client codes, and
|
|
15704
|
+
types `details` by the code's schema.
|
|
15705
|
+
- **The descriptor carries it** for a reader without types: `MethodDef.refuses`
|
|
15706
|
+
(code, status, retryability, message, details schema), `x-stitchkit-refusals`
|
|
15707
|
+
with one response per declared status in OpenAPI, `refusals` in the surface
|
|
15708
|
+
manifest, and the contract fingerprint. Each changes only for an operation that
|
|
15709
|
+
declares `refuses`.
|
|
15710
|
+
|
|
15711
|
+
`defineContract` refuses an entry that is not a factory from `defineErrors` (a bare
|
|
15712
|
+
code string) and a code listed twice, naming the endpoint and the index.
|
|
15713
|
+
Declaring is opt-in per operation: start with the operations whose callers branch
|
|
15714
|
+
on a code. → ADR 0330
|
|
15715
|
+
|
|
15337
15716
|
## `createErrorHook`
|
|
15338
15717
|
|
|
15339
15718
|
`createErrorHook` is the code-map above, packaged — you supply a `codeMap` and
|
|
@@ -18089,7 +18468,7 @@ import { createSyncSession } from 'stitchkit/sync';
|
|
|
18089
18468
|
const session = createSyncSession({
|
|
18090
18469
|
isConnected: () => socket.connected,
|
|
18091
18470
|
readCursor: () => db.cursor(), // null starts a snapshot; a saved version, including 0, starts the feed
|
|
18092
|
-
beginFullSync: () => db.resetCursor(), //
|
|
18471
|
+
beginFullSync: () => db.resetCursor(), // resets the saved cursor to null, never to 0; keeps the projection
|
|
18093
18472
|
send: (request) => socket.emit('sync_request', toWire(request)),
|
|
18094
18473
|
apply: (page, context) => db.applyPage(page, context), // { current, snapshot }: see above
|
|
18095
18474
|
saveCursor: (version) => db.saveCursor(version),
|
|
@@ -18128,7 +18507,10 @@ page the cursor is the version it began at, and the feed catches up from there.
|
|
|
18128
18507
|
|
|
18129
18508
|
A cursor older than the feed the server keeps is refused with `stale_cursor` (`SYNC_STALE_CURSOR`,
|
|
18130
18509
|
passed to `handleError`): the session begins a full snapshot at once, without a pause. Inside a
|
|
18131
|
-
snapshot the same refusal starts it over after a pause. `beginFullSync`
|
|
18510
|
+
snapshot the same refusal starts it over after a pause. `beginFullSync` resets the saved cursor to
|
|
18511
|
+
`null` — the value `readCursor` returns for a replica that holds no completed snapshot. A reset to `0`
|
|
18512
|
+
is a saved version: a session restarted before the snapshot's first page was saved would read the feed
|
|
18513
|
+
after version zero instead of starting the snapshot again. `beginFullSync` keeps the outbox, and after
|
|
18132
18514
|
the last page of any full snapshot — asked for, forced by the server or after `stale_cursor` —
|
|
18133
18515
|
`rebasePending` merges pending local changes onto what it brought, before its cursor is saved; a
|
|
18134
18516
|
refusal there is `rebase_failed` and the session retries. Ids come from `crypto.randomUUID`, falling back to
|
|
@@ -19727,19 +20109,189 @@ charts, no merged cells and no streaming: an application that needs them takes a
|
|
|
19727
20109
|
|
|
19728
20110
|
# Upgrading stitchkit
|
|
19729
20111
|
|
|
20112
|
+
## Released migration: 0.133.0
|
|
20113
|
+
|
|
20114
|
+
### executor-testing-claude-sdk-subpath
|
|
20115
|
+
|
|
20116
|
+
**Who must act:** tests that import `createFakeClaudeSdkQuery`, `createStubClaudeSdkSession` or a `FakeClaudeSdk*` type from `stitchkit/agent-executor/testing`.
|
|
20117
|
+
|
|
20118
|
+
Import them from `stitchkit/agent-executor/testing/claude-sdk`. Nothing else changes: the functions, their options and `StubOverrides` (still exported by `stitchkit/agent-executor/testing`) are the same.
|
|
20119
|
+
|
|
20120
|
+
```ts
|
|
20121
|
+
// Before
|
|
20122
|
+
import { createFakeClaudeSdkQuery, createStubClaudeSdkSession } from 'stitchkit/agent-executor/testing';
|
|
20123
|
+
// After
|
|
20124
|
+
import { createFakeClaudeSdkQuery, createStubClaudeSdkSession } from 'stitchkit/agent-executor/testing/claude-sdk';
|
|
20125
|
+
```
|
|
20126
|
+
|
|
20127
|
+
`stitchkit/agent-executor/testing` no longer names the types of `@anthropic-ai/claude-agent-sdk`, so a project that tests a Codex or ACP driver needs neither the SDK nor `skipLibCheck`.
|
|
20128
|
+
|
|
20129
|
+
### executor-profile-env-sanitizer
|
|
20130
|
+
|
|
20131
|
+
**Who must act:** callers of `sanitizeProfileEnv` from `stitchkit/agent-executor`.
|
|
20132
|
+
|
|
20133
|
+
The function is removed: it dropped a variable whose name the profile schema refuses, so one bad name had two outcomes. Pass the variables to the profile and let `ExecutorProfileConfigSchema` refuse a bad name, or filter in the application where dropping is a decision:
|
|
20134
|
+
|
|
20135
|
+
```ts
|
|
20136
|
+
// Before
|
|
20137
|
+
const env = sanitizeProfileEnv(untrusted);
|
|
20138
|
+
// After
|
|
20139
|
+
const env = Object.fromEntries(
|
|
20140
|
+
Object.entries(untrusted).filter(
|
|
20141
|
+
(entry): entry is [string, string] =>
|
|
20142
|
+
typeof entry[1] === 'string' && EXECUTOR_ENV_KEY_PATTERN.test(entry[0]),
|
|
20143
|
+
),
|
|
20144
|
+
);
|
|
20145
|
+
```
|
|
20146
|
+
|
|
20147
|
+
### executor-conformance-lifecycle
|
|
20148
|
+
|
|
20149
|
+
**Who must act:** tests that run `runAgentEngineConformance` (`stitchkit/agent-executor/testing`) on a driver written outside this package.
|
|
20150
|
+
|
|
20151
|
+
The kit now proves what a driver does when its session stops, and fails by the name of the rule a driver breaks. The drivers of this package and the replay driver pass. For your own driver, make each of these true:
|
|
20152
|
+
|
|
20153
|
+
- `open({ signal })` rejects with `signal.reason` when the signal is already aborted, and when it aborts while `open` runs — the kit aborts it from `onStartupPhase`. A driver that reports no startup phase is not asked the second.
|
|
20154
|
+
- An abort while a turn runs fails that turn's `deltas` with `signal.reason`; afterwards `turn.respond()` and `session.startTurn()` reject with the same reason.
|
|
20155
|
+
- `turn.interrupt()` resolves, without an error, once the turn ended, the signal aborted or the session closed.
|
|
20156
|
+
- `session.close()` during a turn fails the turn's `deltas` instead of leaving them open, resolves when called twice at once and again later, and `onStartupPhase` is not called after it.
|
|
20157
|
+
- `(await driver.info()).capabilities` equals `driver.capabilities` — both absent, or the same object by value.
|
|
20158
|
+
|
|
20159
|
+
```ts
|
|
20160
|
+
// Before: nothing followed the caller's signal, and the kit did not ask.
|
|
20161
|
+
async open(input) {
|
|
20162
|
+
return openSession(input.profile, input.cwd);
|
|
20163
|
+
}
|
|
20164
|
+
// After
|
|
20165
|
+
async open(input) {
|
|
20166
|
+
input.signal?.throwIfAborted();
|
|
20167
|
+
const session = await openSession(input.profile, input.cwd);
|
|
20168
|
+
input.signal?.addEventListener('abort', () => session.fail(input.signal?.reason), { once: true });
|
|
20169
|
+
return session;
|
|
20170
|
+
}
|
|
20171
|
+
```
|
|
20172
|
+
|
|
20173
|
+
Each wait in these checks is bounded at 10 s and a hang fails as `… did not settle within 10000 ms`; give the conformance test a timeout above that (the tests of this package use 30–60 s), or the runner's own timeout reports the hang without the name.
|
|
20174
|
+
|
|
20175
|
+
### codex-owned-thread-unsubscribe
|
|
20176
|
+
|
|
20177
|
+
**Who must act:** callers of `stitchkit/agent-executor/codex` that call `unsubscribeThread` on a thread their own driver opened.
|
|
20178
|
+
|
|
20179
|
+
`CodexSession.unsubscribeThread()` without a `threadId`, with the session's own id, or with the id of any thread open on the same shared server now rejects with `TypeError`. Close the session instead: `close()` interrupts the thread's turn, answers what it still holds and unsubscribes it, and a shared server frees its slot.
|
|
20180
|
+
|
|
20181
|
+
```ts
|
|
20182
|
+
// Before: detached the thread behind the driver; a shared server kept counting it.
|
|
20183
|
+
await session.unsubscribeThread();
|
|
20184
|
+
await server.unsubscribeThread({ threadId: session.nativeThreadId });
|
|
20185
|
+
// After: one way to detach a thread the driver opened.
|
|
20186
|
+
await session.close();
|
|
20187
|
+
```
|
|
20188
|
+
|
|
20189
|
+
A thread the driver did not open — an external TUI thread, a sibling client's thread — is still unsubscribed with one raw `thread/unsubscribe`.
|
|
20190
|
+
|
|
20191
|
+
### process-bootstrap-rename
|
|
20192
|
+
|
|
20193
|
+
**Who must act:** single-file applications (a `bun build` output that routes its own argv) that import `stitchkit/process/owner-loss`.
|
|
20194
|
+
|
|
20195
|
+
The narrow bootstrap entry now carries every invocation the package starts for itself — the owner-loss guard of `runNativeCommand` and the process root of `stitchkit/service-host/work` — so both the subpath and the function are renamed. Nothing else changes: call it once before your argv dispatcher and skip the dispatcher when it returns `true`.
|
|
20196
|
+
|
|
20197
|
+
```ts
|
|
20198
|
+
// Before
|
|
20199
|
+
import { bootstrapNativeCommandOwnerLoss } from 'stitchkit/process/owner-loss';
|
|
20200
|
+
if (!bootstrapNativeCommandOwnerLoss()) await main();
|
|
20201
|
+
// After
|
|
20202
|
+
import { bootstrapPackageProcess } from 'stitchkit/process/bootstrap';
|
|
20203
|
+
if (!bootstrapPackageProcess()) await main();
|
|
20204
|
+
```
|
|
20205
|
+
|
|
20206
|
+
The rename is mechanical; these two commands find every site:
|
|
20207
|
+
|
|
20208
|
+
```bash
|
|
20209
|
+
rg "stitchkit/process/owner-loss" .
|
|
20210
|
+
rg "bootstrapNativeCommandOwnerLoss" .
|
|
20211
|
+
```
|
|
20212
|
+
|
|
20213
|
+
An application that does not bundle itself into one file, or that never imported the old subpath, has nothing to do.
|
|
20214
|
+
|
|
20215
|
+
### client-artifact-package-option
|
|
20216
|
+
|
|
20217
|
+
**Who must act:** builds that call `buildClientArtifact` (`stitchkit/files/packaging`) with `package` or `executable`, or read `artifact.package`.
|
|
20218
|
+
|
|
20219
|
+
`buildClientArtifact` now builds the self-contained file and its hash, nothing else. Find the calls:
|
|
20220
|
+
|
|
20221
|
+
```bash
|
|
20222
|
+
rg "buildClientArtifact" .
|
|
20223
|
+
```
|
|
20224
|
+
|
|
20225
|
+
1. A call with `executable` and no `package`: rename the option.
|
|
20226
|
+
|
|
20227
|
+
```ts
|
|
20228
|
+
// Before
|
|
20229
|
+
await buildClientArtifact({ entry, outFile, executable: '/opt/bun/bin/bun' });
|
|
20230
|
+
// After
|
|
20231
|
+
await buildClientArtifact({ entry, outFile, executables: { bun: '/opt/bun/bin/bun' } });
|
|
20232
|
+
```
|
|
20233
|
+
|
|
20234
|
+
2. A call with `package`: the npm archive is built by `buildClientPackage`. It builds from the
|
|
20235
|
+
entry itself, not from the bundled file, so keep the `buildClientArtifact` call only if you
|
|
20236
|
+
still ship the single file.
|
|
20237
|
+
|
|
20238
|
+
```ts
|
|
20239
|
+
// Before
|
|
20240
|
+
const artifact = await buildClientArtifact({
|
|
20241
|
+
entry: 'src/api-client.ts',
|
|
20242
|
+
outFile: 'dist/api-client.js',
|
|
20243
|
+
forbiddenModules: ['src/terminal/'],
|
|
20244
|
+
package: { name: '@acme/api-client', version: '1.4.0', outDir: 'dist', exports: ['createApiClient'] },
|
|
20245
|
+
});
|
|
20246
|
+
publish(artifact.package.tarball);
|
|
20247
|
+
// After
|
|
20248
|
+
const client = await buildClientPackage({
|
|
20249
|
+
name: '@acme/api-client',
|
|
20250
|
+
version: '1.4.0',
|
|
20251
|
+
entries: { '.': 'src/api-client.ts' },
|
|
20252
|
+
tsconfig: 'tsconfig.json',
|
|
20253
|
+
peerDependencies: { zod: '^4.6.0' },
|
|
20254
|
+
forbiddenModules: ['src/terminal/'],
|
|
20255
|
+
outDir: 'dist',
|
|
20256
|
+
proof: { exports: { '.': ['createApiClient'] } },
|
|
20257
|
+
});
|
|
20258
|
+
publish(client.tarball);
|
|
20259
|
+
```
|
|
20260
|
+
|
|
20261
|
+
What differs from the old archive, and may refuse a client the old one packed:
|
|
20262
|
+
|
|
20263
|
+
- The entry is a `.ts` or `.tsx` module under the directory of `tsconfig`, and a `typescript`
|
|
20264
|
+
package is installed in the project: the archive now carries declarations.
|
|
20265
|
+
- A package the client imports is bundled unless you list it in `peerDependencies` or
|
|
20266
|
+
`dependencies`. A public type that names a package you did not list is refused as
|
|
20267
|
+
`declaration-dependency` — list it, usually as a peer.
|
|
20268
|
+
- The main module moves from `index.js` to `dist/<path under the tsconfig directory>.js`, behind
|
|
20269
|
+
`exports`. A consumer that imports the package by name is unaffected; one that reached for
|
|
20270
|
+
`<package>/index.js` imports the package name instead.
|
|
20271
|
+
- A failure is a `ClientPackageError` with a `reason` (`missing-export` for a name in
|
|
20272
|
+
`proof.exports`), not an `Error` to match by message.
|
|
20273
|
+
|
|
20274
|
+
[The guide](native-io.md#a-typed-client-as-an-npm-package) describes the options and every refusal.
|
|
20275
|
+
|
|
19730
20276
|
## Released migration: 0.132.0
|
|
19731
20277
|
|
|
19732
20278
|
### saved-sync-cursor-zero
|
|
19733
20279
|
|
|
19734
|
-
**Who must act:** users of `stitchkit/sync` whose cursor reader returns zero for an uninitialized replica.
|
|
20280
|
+
**Who must act:** users of `stitchkit/sync` whose cursor reader returns zero for an uninitialized replica, or whose `beginFullSync` resets the saved cursor to zero.
|
|
19735
20281
|
|
|
19736
20282
|
Return `null` until the first snapshot completes. A saved `0` requests the incremental feed after version zero.
|
|
20283
|
+
`beginFullSync` follows the same rule: reset the saved cursor to `null`, not to `0`, or a session
|
|
20284
|
+
restarted before the snapshot's first page was saved reads the feed instead of starting the snapshot again.
|
|
19737
20285
|
|
|
19738
20286
|
```ts
|
|
19739
20287
|
// Before: a missing row and a completed snapshot at zero shared the same marker.
|
|
19740
20288
|
readCursor: () => row?.version ?? 0
|
|
19741
20289
|
// After: preserve every published server version.
|
|
19742
20290
|
readCursor: () => row?.version ?? null
|
|
20291
|
+
// Before: the reset wrote the same marker a completed snapshot at zero has.
|
|
20292
|
+
beginFullSync: () => db.run('UPDATE sync_state SET version = 0')
|
|
20293
|
+
// After: the reset is "no completed snapshot".
|
|
20294
|
+
beginFullSync: () => db.run('UPDATE sync_state SET version = NULL')
|
|
19743
20295
|
```
|
|
19744
20296
|
|
|
19745
20297
|
If an old store persisted zero for both states and has no completion marker, perform one full
|
|
@@ -19804,9 +20356,9 @@ const shouldPoll =
|
|
|
19804
20356
|
|
|
19805
20357
|
### executor-status-delta
|
|
19806
20358
|
|
|
19807
|
-
**Who must act:** every caller of `stitchkit/agent-executor` that switches exhaustively on `ExecutorDelta['type']
|
|
20359
|
+
**Who must act:** every caller of `stitchkit/agent-executor` that switches exhaustively on `ExecutorDelta['type']`, and every operator who runs an executor and its server on different releases across `0.130.0`.
|
|
19808
20360
|
|
|
19809
|
-
`ExecutorDeltaSchema` / `ExecutorDelta` now includes `ExecutorStatusDeltaSchema` (`{ type: 'status', phase
|
|
20361
|
+
`ExecutorDeltaSchema` / `ExecutorDelta` now includes `ExecutorStatusDeltaSchema` (`{ type: 'status', phase, ... }`) for structured startup lifecycle deltas. `phase` is an open label of 1–64 trimmed characters: the drivers emit `spawning`, `initializing` and `verifying`, and a reader treats any other label as a phase it does not know rather than refusing it. `projectExecutorDeltas` ignores `status` deltas automatically; add a `case 'status':` branch to any custom exhaustive `switch (delta.type)`:
|
|
19810
20362
|
|
|
19811
20363
|
```ts
|
|
19812
20364
|
// before
|
|
@@ -19827,6 +20379,24 @@ switch (delta.type) {
|
|
|
19827
20379
|
}
|
|
19828
20380
|
```
|
|
19829
20381
|
|
|
20382
|
+
**The wire changed in both directions, not only by the `status` delta.** Every object of the
|
|
20383
|
+
executor ↔ server contract is strict, so a reader on `0.129.x` refuses a whole message that carries
|
|
20384
|
+
a key `0.130.0` added:
|
|
20385
|
+
|
|
20386
|
+
| Travels | Message | A `0.129.x` reader refuses |
|
|
20387
|
+
|---------|---------|----------------------------|
|
|
20388
|
+
| executor → server | `hello` | `engines[].capabilities` — written by every driver, so the handshake itself fails |
|
|
20389
|
+
| executor → server | `report` | a `status` delta; `threadDisposition` on `turn-end` and on `failure`; `cacheCreationInputTokens`, `thinkingTokens`, `totalTokens`, `total` and `modelUsage` on a `usage` delta |
|
|
20390
|
+
| server → executor | `reply` | `scope` and `updatedInput` on `approve`; `interrupt` on `deny` |
|
|
20391
|
+
|
|
20392
|
+
Upgrade the server before any executor: an older executor writes none of these keys and keeps
|
|
20393
|
+
working. Until every executor is upgraded, the server sends `scope: 'session'`, `updatedInput` and
|
|
20394
|
+
`interrupt` only to an executor whose `hello` declared `sessionApproval`, `updatedToolInput` and
|
|
20395
|
+
`interruptOnDeny` for the engine — an engine announced without `capabilities` is on `0.129.x`.
|
|
20396
|
+
`0.131.0` added `plan` and `windows[].scope` to `planLimits` in `hello` the same way. The rule
|
|
20397
|
+
and the table of every release are in the
|
|
20398
|
+
[API reference](../api/reference.md#version-skew-between-an-executor-and-its-server) (ADR 0334).
|
|
20399
|
+
|
|
19830
20400
|
## Released migration: 0.129.0
|
|
19831
20401
|
|
|
19832
20402
|
### codex-plan-window-keys
|
|
@@ -26743,7 +27313,8 @@ from the root `stitchkit`.
|
|
|
26743
27313
|
| `OperationEffect` / `OperationEffectSchema` | _type_ / schema | closed `'read' \| 'write'` side-effect classification declared on contract endpoints |
|
|
26744
27314
|
| `contractOperationEffects` / `requireContractOperationEffects` | function | project declared endpoint `effect` tags from a contract; `requireContractOperationEffects` fails closed and lists every operation missing `effect` |
|
|
26745
27315
|
| `withToolView` | function | declare an endpoint's call and answer on the tool surface (MCP, AGENT, CLI): input `defaults`, and optionally a view `output` and a `project`, typed against the endpoint's own schemas; HTTP keeps the full answer — [guide](../guide/mcp-and-agents.md#a-different-answer-for-tools--withtoolview) |
|
|
26746
|
-
| `EndpointToolOptions` | _type_ | an endpoint's `tool` group — `name`, `view`, `ui`, `annotations`, `mcp`, `inputRecursionDepth`: what the tool surfaces read that HTTP does not |
|
|
27316
|
+
| `EndpointToolOptions` | _type_ | an endpoint's `tool` group — `name`, `view`, `ui`, `annotations`, `mcp`, `inputRecursionDepth`, `inputNestingDepth`: what the tool surfaces read that HTTP does not |
|
|
27317
|
+
| `OperationToolOption` | _type_ | the `tool` options an operation's identity carries to every tool transport — `ui`, `annotations`, `mcp`, `inputRecursionDepth`, `inputNestingDepth` |
|
|
26747
27318
|
| `EndpointToolView` | _type_ | the stored shape of a tool view (`MethodDef.toolView`) |
|
|
26748
27319
|
| `DeclaredToolView` | _type_ | a tool view as `withToolView` produces it — the only form `tool.view` accepts |
|
|
26749
27320
|
| `WithToolView` | _type_ | the endpoint `withToolView` returns: its own tool options plus the declared view in `tool.view` — name it when a helper returns such an endpoint |
|
|
@@ -26809,7 +27380,12 @@ from the root `stitchkit`.
|
|
|
26809
27380
|
| `ErrorDetailsSchema` | _type_ | required or optional Zod object accepted for structured details |
|
|
26810
27381
|
| `ErrorDetailsOutput` | _type_ | parsed details inferred from one definition |
|
|
26811
27382
|
| `ErrorFactoryArguments` | _type_ | options tuple with forbidden/required/optional details inferred per code |
|
|
26812
|
-
| `ErrorFactory` | _type_ | one typed `AppError` constructor |
|
|
27383
|
+
| `ErrorFactory` | _type_ | one typed `AppError` constructor; it carries its `code` and `definition`, so an endpoint can list it in `refuses` |
|
|
27384
|
+
| `RefusalDeclaration` | _type_ | one entry of an endpoint's `refuses` — an `ErrorFactory` (`{ code, definition }`) — [guide](../guide/auth-and-errors.md#the-codes-an-operation-refuses-with) |
|
|
27385
|
+
| `DescribedRefusal` | _type_ | a declared refusal resolved for a reader without types — `{ code, status, retryable, message?, details? }`, on `MethodDef.refuses` |
|
|
27386
|
+
| `OperationRefusal` | _type_ | every refusal a call of one endpoint can end with — its declared codes with typed `details`, plus framework and client codes; what `client.op.refusal(error)` returns |
|
|
27387
|
+
| `DeclaredRefusal` | _type_ | the `ApiError` shape `OperationRefusal` narrows — `{ code, status, details, message, hint?, traceId?, retryable? }` |
|
|
27388
|
+
| `CLIENT_ERROR_CODES` / `ClientErrorCode` | const / _type_ | codes only the typed client raises, with no server status — `UNKNOWN_ERROR`, `STREAM_TRUNCATED`, `STREAM_PROTOCOL_ERROR` |
|
|
26813
27389
|
| `ErrorFactories` | _type_ | mapped constructor registry derived from all definitions |
|
|
26814
27390
|
| `FrozenErrorDefinitions` | _type_ | read-only definition registry returned to consumers |
|
|
26815
27391
|
| `STITCH_ERROR_STATUS` | const | `code → HTTP status` map for stitchkit's own error codes — [guide](../guide/auth-and-errors.md#stitch-codes-vs-your-codes) |
|
|
@@ -28028,14 +28604,14 @@ leaves of their own; this entrypoint knows no vendor. Evolving.
|
|
|
28028
28604
|
| `PlanLimitsSchema` / `PlanLimits` / `PlanWindowSchema` / `PlanWindow` | schemas / _types_ | a subscription's limits: `known`, `no-plan-limit` or `unpublished`, with optional `plan` and the last read's error beside the last answer; each window carries `name`, `usedPercent`, and optional `resetsAt`, `windowDurationMins`, `label`, and `scope` |
|
|
28029
28605
|
| `ThreadClaimSchema` / `ThreadClaim` / `ThreadLeaseSchema` / `ThreadLease` / `ThreadRenewSchema` / `ThreadReleaseSchema` | schemas / _types_ | thread leases pinned to an executor and profile, under a fence |
|
|
28030
28606
|
| `TurnOfferSchema` / `TurnOffer` / `TurnPhaseSchema` / `TurnPhase` / `TurnReportSchema` / `TurnReport` / `TurnReportAckSchema` / `TurnFailureKindSchema` / `TurnInterruptSchema` / `InteractionReplySchema` / `InteractionReply` / `EXECUTOR_ERRORS` | schemas / _types_ / constant | a turn offered under its thread's `turnOrdinal`, its phases and reports applied once by `executorSeq` (acknowledged `applied`, `duplicate` or `not-retained`), interrupts, answers to an engine's requests (`approve` with optional `scope: 'once' \| 'session'` and `updatedInput`, `deny` with optional `interrupt: boolean`), and the refusal codes |
|
|
28031
|
-
| `ExecutorDeltaSchema` / `ExecutorDelta` / `ExecutorStatusDeltaSchema` / `ExecutorStartupPhaseSchema` / `ExecutorStartupPhase` / `ExecutorThreadDispositionSchema` / `ExecutorThreadDisposition` / `ExecutorErrorKindSchema` / `ExecutorErrorKind` / `ExecutorRawSchema` / `ExecutorTokenUsageSchema` / `ExecutorTokenUsage` / `ExecutorModelUsageSchema` / `ExecutorModelUsage` | schemas / _types_ | what an engine said: `agent-parts` blocks with `turnId`, `itemId` and `raw`, plus requests, usage (including optional `cacheCreationInputTokens`, `thinkingTokens`, `totalTokens`, cumulative `total`, and per-model `modelUsage`), the context gauge (`context-usage`), lifecycle `status` deltas (`ExecutorStartupPhase
|
|
28607
|
+
| `ExecutorDeltaSchema` / `ExecutorDelta` / `ExecutorStatusDeltaSchema` / `ExecutorStartupPhaseSchema` / `ExecutorStartupPhase` / `ExecutorThreadDispositionSchema` / `ExecutorThreadDisposition` / `ExecutorErrorKindSchema` / `ExecutorErrorKind` / `ExecutorRawSchema` / `ExecutorTokenUsageSchema` / `ExecutorTokenUsage` / `ExecutorModelUsageSchema` / `ExecutorModelUsage` | schemas / _types_ | what an engine said: `agent-parts` blocks with `turnId`, `itemId` and `raw`, plus requests, usage (including optional `cacheCreationInputTokens`, `thinkingTokens`, `totalTokens`, cumulative `total`, and per-model `modelUsage`), the context gauge (`context-usage`), lifecycle `status` deltas (`ExecutorStartupPhase` is an open label of 1–64 trimmed characters; the drivers emit `spawning`, `initializing` and `verifying`, and a reader treats any other label as a phase it does not know), the end of the turn (with optional `threadDisposition`: `'reusable' \| 'broken'`, also carried on `TurnReportSchema.failure`), errors by kind and window resets |
|
|
28032
28608
|
| `projectExecutorDeltas` | function | fold a turn's deltas into the message parts the agent runtime stores (ignoring lifecycle `status` deltas) |
|
|
28033
|
-
| `buildContextHandoff` / `withInlineHandoffContext` / `InlineHandoffComposition` / `ContextHandoffInputSchema` / `ContextHandoffInput` / `ContextHandoffEntrySchema` / `ContextHandoffEntry` / `ContextHandoffMessageEntrySchema` / `ContextHandoffClearEntrySchema` / `ContextHandoffBudgetSchema` / `ContextHandoffStrategySchema` / `ContextHandoffResultSchema` / `ContextHandoffResult` / `ContextHandoffSelectedItemSchema` / `ContextHandoffSelectedItem` / `ContextHandoffStructuredItemSchema` / `ContextHandoffStructuredItem` | functions / schemas / _types_ | pure portable context-handoff builder for cross-engine or cross-session transitions: supports `full` and `delta` (`afterItemId` or `afterTurnId`, fail-closed `missingAnchor: 'error'` or `'full'`) strategies respecting the latest `clear` barrier, keeps intact items by fixed priority (`last user → last assistant → first user → newest..oldest`) under strict `maxTokens` / `maxBytes` / `maxOmittedIds` (and optional `contextWindowTokens` / `usedTokens` / `workReserveTokens`) ceilings while dropping non-text/binary/reasoning/provider parts, emits deterministic `inlineText` and Responses API `structuredItems`, and composes inline context ahead of a user prompt via `withInlineHandoffContext` (deferring on leading `/slash` commands) |
|
|
28034
|
-
| `AgentEngineDriver` / `AgentEngineSession` / `AgentEngineTurn` / `ExecutorEngineInfo` | _types_ | one vendor's engine behind one interface: info, declarative `capabilities`, login status, a session per connection (accepting `onStartupPhase` on `open`), turns with `interrupt` and `respond`, `findInput` for a `client-id` engine |
|
|
28609
|
+
| `buildContextHandoff` / `withInlineHandoffContext` / `InlineHandoffComposition` / `ContextHandoffInputSchema` / `ContextHandoffInput` / `ContextHandoffEntrySchema` / `ContextHandoffEntry` / `ContextHandoffMessageEntrySchema` / `ContextHandoffClearEntrySchema` / `ContextHandoffBudgetSchema` / `ContextHandoffStrategySchema` / `ContextHandoffResultSchema` / `ContextHandoffResult` / `ContextHandoffSelectedItemSchema` / `ContextHandoffSelectedItem` / `ContextHandoffStructuredItemSchema` / `ContextHandoffStructuredItem` | functions / schemas / _types_ | pure portable context-handoff builder for cross-engine or cross-session transitions: supports `full` and `delta` (`afterItemId` or `afterTurnId`, fail-closed `missingAnchor: 'error'` or `'full'`) strategies respecting the latest `clear` barrier, keeps intact items by fixed priority (`last user → last assistant → first user → newest..oldest`) under strict `maxTokens` / `maxBytes` / `maxOmittedIds` (and optional `contextWindowTokens` / `usedTokens` / `workReserveTokens`; an omitted `usedTokens` counts as `0` — the caller's statement that the receiving thread is new, so a caller that does not know the fill of a thread in use omits `contextWindowTokens` too) ceilings while dropping non-text/binary/reasoning/provider parts, emits deterministic `inlineText` and Responses API `structuredItems`, and composes inline context ahead of a user prompt via `withInlineHandoffContext` (deferring on leading `/slash` commands) |
|
|
28610
|
+
| `AgentEngineDriver` / `AgentEngineSession` / `AgentEngineTurn` / `ExecutorEngineInfo` | _types_ | one vendor's engine behind one interface: info, declarative `capabilities`, login status, a session per connection (accepting `onStartupPhase` on `open`), turns with `interrupt` and `respond`, `findInput` for a `client-id` engine. A session stops for one reason, asked in one order — its `close()`, the loss of its engine, the caller's `signal`, its own abort: `open` given an aborted signal rejects with the signal's reason; an abort in a turn fails its stream with that reason, and `respond` and `startTurn` then reject with it; `respond` on a turn that failed rejects with that failure; `interrupt` on an ended turn or a stopped session resolves and tells the engine nothing; `close()` may be called again |
|
|
28035
28611
|
| `dispatchTurn` / `DispatchOutcome` | function / _type_ | send a turn's input at most once through `LocalStepDurability.effect`: `sent`, `delivered` after a reconcile, or `unknown_after_restart` — never resent |
|
|
28036
28612
|
| `spawnEngineProcess` / `EngineProcess` | function / _type_ | an engine process talked to by lines over `stitchkit/process`: declared environment, owner-loss termination, optional leader `pid` / `pidReady`, `stdoutMode` (`'lines'` default or `'drain'` for socket-serving engines), bounded lines (`maxLineBytes`), stderr, queued stdin (`maxPendingStdinBytes`) and stdin written over the connection's life (`maxStdinBytes`, a refused `send()` that leaves the engine running); every option checked before the spawn |
|
|
28037
28613
|
| `createExecutorLeases` / `memoryExecutorLeaseStore` / `ExecutorLeaseStateStore` / `ExecutorLeaseState` / `ExecutorLeaseStateSchema` / `ExecutorLeaseRefusal` | functions / _types_ / class | the server's thread leases and turn receipts over one atomically updated value, bounded by threads: each thread keeps the receipts of its last `retainedTurns` turns (default 64, at most 1024) and the highest `turnOrdinal` it let go, a report of a turn at or below it is `not-retained`, and `resume(resumable)` answers a hello the same way; a `StateStore` of `stitchkit/application` fits; a refusal is an `ExecutorLeaseRefusal` — an `AppError` with status 409 and a code of `EXECUTOR_ERRORS` — so an operation returning the service's promise answers `409 { error: { code } }` |
|
|
28038
|
-
| `ExecutorProfileConfigSchema` / `ExecutorProfileConfig` / `EXECUTOR_ENV_KEY_PATTERN` / `
|
|
28614
|
+
| `ExecutorProfileConfigSchema` / `ExecutorProfileConfig` / `EXECUTOR_ENV_KEY_PATTERN` / `engineEnvironment` / `ownCredentials` / `helloProfile` / `CREDENTIAL_VARIABLES` | schema / _type_ / constants / functions | a profile on the executor's machine, the one rule for a declared variable's name (`EXECUTOR_ENV_KEY_PATTERN`: the schema refuses a profile whose `env` holds any other name, on every path a profile takes), the engine's allowlisted environment with an explicit profile's `home` as `CLAUDE_CONFIG_DIR`, `CODEX_HOME` or (ACP) `HOME` plus explicit `profile.env` pass-through for host-specific overrides (such as `TMPDIR`, `SSH_CONNECTION`, or agent-specific `AGY_*` variables), and `helloProfile({ profile, status, ambient })` carrying no path and no value; a driver refuses a profile whose `engine` is not its own with a `TypeError`, before it reads a file or starts the engine |
|
|
28039
28615
|
| `mergeRateLimitEvent` / `planLimitsReadFailed` / `planLimitsDue` / `planWindowExpired` / `planWindowDurationMins` | functions | plan limits kept as three answers (`mergeRateLimitEvent` preserving `plan`, `planLimitsReadFailed`, `planLimitsDue` treating clean `no-plan-limit`/`unpublished` as not due, `planWindowExpired`, and `planWindowDurationMins` deriving durations in minutes) |
|
|
28040
28616
|
| `canAdvanceTurnPhase` / `isTerminalTurnPhase` | functions | the turn phase machine: a terminal phase is never left |
|
|
28041
28617
|
| `advanceExecutorConnection` / `canAcceptTurn` / `INITIAL_EXECUTOR_CONNECTION` / `ExecutorConnectionState` / `ExecutorConnectionEvent` | functions / constant / _types_ | the executor's connection as a pure machine with generations: an answer of an earlier connection never acts on a later one |
|
|
@@ -28043,6 +28619,29 @@ leaves of their own; this entrypoint knows no vendor. Evolving.
|
|
|
28043
28619
|
|
|
28044
28620
|
---
|
|
28045
28621
|
|
|
28622
|
+
### Version skew between an executor and its server
|
|
28623
|
+
|
|
28624
|
+
Every object of the contract is strict: a message with a key its reader does not declare is
|
|
28625
|
+
refused whole, and `protocol: 1` negotiates nothing. An executor and a server on different
|
|
28626
|
+
releases therefore agree only on what the older one declares (ADR 0334):
|
|
28627
|
+
|
|
28628
|
+
- **Upgrade the server first.** It reads `hello` and `report`; a driver writes `capabilities` on
|
|
28629
|
+
every engine it announces, so an executor newer than its server has its handshake refused. An
|
|
28630
|
+
older executor keeps working against a newer server: every added key is optional.
|
|
28631
|
+
- **A server writes an added reply key only to an executor that can read it.** `scope: 'session'`
|
|
28632
|
+
needs the engine's `sessionApproval`, `updatedInput` its `updatedToolInput`, `interrupt` its
|
|
28633
|
+
`interruptOnDeny`, as that executor's `hello` declared them; an engine announced without
|
|
28634
|
+
`capabilities` is sent none of the three.
|
|
28635
|
+
|
|
28636
|
+
What a release added to the wire, and so what a reader older than it refuses:
|
|
28637
|
+
|
|
28638
|
+
| Added in | Travels | Message | A reader older than the release refuses |
|
|
28639
|
+
|----------|---------|---------|------------------------------------------|
|
|
28640
|
+
| 0.130.0 | executor → server | `hello` | `engines[].capabilities` |
|
|
28641
|
+
| 0.130.0 | executor → server | `report` | `deltas[].type = 'status'`, `turn-end.threadDisposition`, `usage.cacheCreationInputTokens`, `usage.thinkingTokens`, `usage.totalTokens`, `usage.total`, `usage.modelUsage`, `failure.threadDisposition` |
|
|
28642
|
+
| 0.130.0 | server → executor | `reply` | `approve.scope`, `approve.updatedInput`, `deny.interrupt` |
|
|
28643
|
+
| 0.131.0 | executor → server | `hello` | `profiles[].planLimits.plan`, `profiles[].planLimits.windows[].scope` |
|
|
28644
|
+
|
|
28046
28645
|
For a Claude CLI or SDK profile that should use the user's native sign-in, pass
|
|
28047
28646
|
`{ profileId: 'personal', engine: 'claude-sdk', home: join(homedir(), '.claude'), claudeConfigDir: 'default' }`.
|
|
28048
28647
|
The child uses its native configuration and the executor still reads transcripts from `home`.
|
|
@@ -28058,7 +28657,7 @@ Evolving.
|
|
|
28058
28657
|
|
|
28059
28658
|
| Export | Kind | Purpose |
|
|
28060
28659
|
|--------|------|---------|
|
|
28061
|
-
| `createClaudeCliDriver` / `ClaudeCliDriverConfig` | function / _type_ | the driver; `permissionMode` defaults to `default`, so the server decides every tool the profile does not already allow; optional `resolveFile` and `maxImageBytes` (default 5 MiB) enable ordered turn-input image attachments |
|
|
28660
|
+
| `createClaudeCliDriver` / `ClaudeCliDriverConfig` | function / _type_ | the driver; `permissionMode` defaults to `default`, so the server decides every tool the profile does not already allow; optional `resolveFile` and `maxImageBytes` (default 5 MiB) enable ordered turn-input image attachments; `onObserverError(error, hook)` receives every failure of a host callback the driver contained, with the name of the option that failed; without it such a failure is contained and dropped. |
|
|
28062
28661
|
| `claudeFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted engine |
|
|
28063
28662
|
| `claudeTranscriptPath` / `claudeTranscriptHasUuid` / `findTranscriptInput` | functions | offline Claude transcript path resolution (resolving `realpath` of `cwd` or its nearest existing ancestor) and bounded streaming UUID lookup / reconciliation without instantiating a driver |
|
|
28064
28663
|
| `claudePlanWindows` / `claudeUsagePlanLimits` | functions | Claude's `rate_limit_event` windows and open-bucket usage / `/api/oauth/usage` `PlanLimits` mapping preserving `plan` and the reported model name as `scope` and `label` on model-scoped windows |
|
|
@@ -28079,7 +28678,7 @@ profile's transcript. Evolving.
|
|
|
28079
28678
|
|
|
28080
28679
|
| Export | Kind | Purpose |
|
|
28081
28680
|
|--------|------|---------|
|
|
28082
|
-
| `createClaudeSdkDriver` / `ClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function / _types_ | the driver: `query` and `sdkVersion` required; optional `forkSession`, `model`, `permissionMode` (default `default`), `allowDangerouslySkipPermissions`, `pathToClaudeCodeExecutable`, `systemPrompt`, `settingSources`, `enableFileCheckpointing`, `supportedDialogKinds` / `onUserDialog`, `hooks`, `tools`, `allowedTools`, `disallowedTools`, `mcpServers`, `mcpServersDelivery`, `strictMcpConfig`, `plugins`, `agents`, `extraArgs`, `stderr`, `spawnClaudeCodeProcess`, `onProviderPid`, `onQueryExit`, `onElicitation`, `onPermissionRequest`, `onEvent`, `onTurnUsage`, `verifyDelegation`, `resolveFile`, `maxImageBytes` (default 5 MiB), and `
|
|
28681
|
+
| `createClaudeSdkDriver` / `ClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function / _types_ | the driver: `query` and `sdkVersion` required; optional `forkSession`, `model`, `permissionMode` (default `default`), `allowDangerouslySkipPermissions`, `pathToClaudeCodeExecutable`, `systemPrompt`, `settingSources`, `enableFileCheckpointing`, `supportedDialogKinds` / `onUserDialog`, `hooks`, `tools`, `allowedTools`, `disallowedTools`, `mcpServers`, `mcpServersDelivery`, `strictMcpConfig`, `plugins`, `agents`, `extraArgs`, `stderr`, `spawnClaudeCodeProcess`, `onProviderPid`, `onQueryExit`, `onElicitation`, `onPermissionRequest`, `onEvent`, `onTurnUsage`, `verifyDelegation`, `resolveFile`, `maxImageBytes` (default 5 MiB), `ambient`, and `onObserverError`. `onObserverError(error, hook)` receives every failure of a host callback the driver contained, with the name of the option that failed; without it such a failure is contained and dropped. Exposes `probeCapabilities(input)` for isolated never-yielding capability probes, `status` over passive `rate_limit_event` or active `readUsage()`, and `forkSession(sessionId, options?)` |
|
|
28083
28682
|
| `ClaudeSdkSession` / `ClaudeSdkOpenInput` / `ClaudeSdkUsageRead` / `ClaudeSdkQueryExitContext` / `ClaudeSdkPermissionRequestMeta` / `ClaudeSdkFlagSettings` | _types_ | extended session returned by `open(ClaudeSdkOpenInput)` (supporting `resumeSessionAt`, `resumeDropsTurn`, and `onStartupPhase`): exposes `providerPid`, `readUsage(opts?)`, `setModel`, `setPermissionMode` (returning `SDKControlSetPermissionModeResponse \| undefined`), `applyFlagSettings(ClaudeSdkFlagSettings)`, `initializationResult`, `supportedModels`, `supportedCommands`, `accountInfo`, `getContextUsage`, `mcpServerStatus`, `toggleMcpServer`, `reconnectMcpServer`, `setMcpServers`, `stopTask`, `backgroundTasks`, and `rewindFiles`; supports `approve` with `updatedInput` for `AskUserQuestion` and emits `ClaudeSdkPermissionRequestMeta` (`input: Readonly<Record<string, JsonRpcValue>>`) to `onPermissionRequest` |
|
|
28084
28683
|
| `ClaudeRuntimeEventSchema` / `ClaudeRuntimeEvent` / `ClaudeTaskUsageSchema` / `ClaudeTaskUsage` / `ClaudeSdkTurnUsageSchema` / `ClaudeSdkTurnUsage` / `ClaudeSdkTokenPairSchema` / `ClaudeSdkTokenPair` | schemas / _types_ | structured runtime events delivered to `onEvent` during and after turns (`task_started`, `task_updated`, `task_progress`, `task_notification`, `background_tasks_changed`, `tool_progress`, `api_retry`, `elicitation_complete`) alongside `compact_boundary` → `window { reset: 'context' }`, plus per-turn additive `modelUsage` deltas and `otherUsage` delivered to `onTurnUsage` |
|
|
28085
28684
|
| `ClaudeSdkProbeCapabilitiesInput` / `ClaudeSdkCapabilitiesProbe` | _types_ | input and result shapes for `driver.probeCapabilities(input)`: runs an isolated never-yielding SDK query to inspect models, commands, account info, and optional usage, always closing the query in `finally` |
|
|
@@ -28109,9 +28708,9 @@ approvals for unprompted tool calls. Explicit `approve` supports `scope: 'once'`
|
|
|
28109
28708
|
|
|
28110
28709
|
| Export | Kind | Purpose |
|
|
28111
28710
|
|--------|------|---------|
|
|
28112
|
-
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; optional `clientInfo`, `sessionMeta`, `stdoutLineFilter`, `probeMode` (`'ephemeral-session' \| 'initialize-only' \| 'passive'`) / `passiveVersion`, `model` / `thoughtLevel` / `mode` (also overridable per open via `AcpOpenInput`, falling back to `session/set_model`), `mcpServers`, `transformUpdate`, post-settle `onUpdate` / `onPermissionRequest`, `permissionRequestDelivery` (`'external-only' \| 'all'`), `onProviderPid` (fired during `open()`), `onDisconnect`, `watchPromptOutcome`, `usageInputIncludesCachedRead`, `steerMode` (`'none' \| 'prompt'`), `resolveFile`, `maxImageBytes` (5 MiB), `maxFrameBytes` (8 MiB), `ambient`, and `requestTimeoutMs` (60 s, capping `session/close` / `session/delete` to at most 5 s); exposes `probeCapabilities(AcpProbeCapabilitiesInput)` for non-inference capability probing |
|
|
28113
|
-
| `AcpSession` / `AcpOpenInput` / `AcpSteerTurnInput` / `AcpConfigOption` / `AcpConfigOptionChoice` / `acpOptionChoices` / `acpOptionValues` / `AcpApprovalEnforcement` | _types_ / functions | a session's `providerPid`, settings, title and commands, `approvalEnforcement` (`'agent-initiated'`), `setConfigOption(category or id, value)`, `respond(interactionId, reply)` for pending permissions, `steerTurn(input)` when `steerMode: 'prompt'`, per-open overrides on `AcpOpenInput`, and flat/grouped config-option flattening helpers (`acpOptionChoices`, `acpOptionValues`) |
|
|
28114
|
-
| `AcpProbeCapabilitiesInput` / `AcpCapabilitiesProbe` / `AcpProbeMode` / `AcpSteerMode` / `AcpSessionMetaInput` / `AcpWatchPromptOutcome` / `AcpPromptOutcomeOverride` | _types_ | non-inference capability probe input/result (running regardless of `probeMode` and
|
|
28711
|
+
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; optional `clientInfo`, `sessionMeta`, `stdoutLineFilter`, `probeMode` (`'ephemeral-session' \| 'initialize-only' \| 'passive'`) / `passiveVersion`, `model` / `thoughtLevel` / `mode` (also overridable per open via `AcpOpenInput`, falling back to `session/set_model`), `mcpServers`, `transformUpdate`, post-settle `onUpdate` / `onPermissionRequest`, `permissionRequestDelivery` (`'external-only' \| 'all'`), `onProviderPid` (fired during `open()`), `onDisconnect`, `onObserverError` (every failure of a host callback the driver contained, with the name of the option that failed; a `JsonRpcError` thrown by `onPermissionRequest` outside a turn is its refusal and is not reported), `watchPromptOutcome`, `usageInputIncludesCachedRead`, `steerMode` (`'none' \| 'prompt'`), `resolveFile`, `maxImageBytes` (5 MiB), `maxFrameBytes` (8 MiB), `ambient`, and `requestTimeoutMs` (60 s, capping `session/close` / `session/delete` to at most 5 s; a request the agent sends while `close()` waits for `session/close` is refused — `session/request_permission` with the `cancelled` outcome, any other method with `-32601` — and after an abort or a lost connection nothing is written); exposes `probeCapabilities(AcpProbeCapabilitiesInput)` for non-inference capability probing |
|
|
28712
|
+
| `AcpSession` / `AcpOpenInput` / `AcpSteerTurnInput` / `AcpConfigOption` / `AcpConfigOptionChoice` / `acpOptionChoices` / `acpOptionValues` / `AcpApprovalEnforcement` | _types_ / functions | a session's `providerPid`, its agent's `initialize` answer (`initialized`, with `agentCapabilities.promptCapabilities`), settings, title and commands, `approvalEnforcement` (`'agent-initiated'`), `setConfigOption(category or id, value)`, `respond(interactionId, reply)` for pending permissions, `steerTurn(input)` when `steerMode: 'prompt'`, per-open overrides on `AcpOpenInput`, and flat/grouped config-option flattening helpers (`acpOptionChoices`, `acpOptionValues`) |
|
|
28713
|
+
| `AcpProbeCapabilitiesInput` / `AcpCapabilitiesProbe` / `AcpProbeMode` / `AcpSteerMode` / `AcpSessionMetaInput` / `AcpWatchPromptOutcome` / `AcpPromptOutcomeOverride` | _types_ | non-inference capability probe input/result (running regardless of `probeMode`; `eachModel: true` also selects each `model` value in the ephemeral session and returns `optionsByModel`; once `session/new` answered, `session/close` and `session/delete` run even after an abort or timeout), probe strategy, steer mode, static or `initialize`-derived `_meta` attachment on session open, and prompt-outcome verification hook reclassifying masked `end_turn` failures with `errorKind` and `threadDisposition` |
|
|
28115
28714
|
| `AcpTransformUpdate` / `AcpUpdateEvent` / `AcpPermissionRequestEvent` | _types_ | update normalizer (`transformUpdate`), live/post-settle `session/update` observer payload (`onUpdate`), and permission request payload with `duringActiveTurn`, full typed `request.options`, and shared single-shot `respond()` (`onPermissionRequest`) |
|
|
28116
28715
|
| `AcpClientInfoSchema` / `AcpClientInfo` / `AcpInitializeResultSchema` / `AcpInitializeResult` / `AcpConfigOptionSchema` / `AcpSessionUpdateSchema` / `AcpSessionUpdate` / `AcpPromptResult` / `AcpPromptUsage` / `AcpPermissionRequestSchema` / `AcpPermissionRequest` / `AcpPermissionOptionSchema` / `AcpPermissionOption` | schemas / _types_ | loose Zod schemas and typed ACP v1 wire payloads exposed to `sessionMeta`, `transformUpdate`, `onUpdate`, `onPermissionRequest`, and `watchPromptOutcome` |
|
|
28117
28716
|
| `AcpSessionSummary` | _type_ | a session the agent keeps: id, working directory, title, last update |
|
|
@@ -28138,7 +28737,7 @@ WebSocket-over-Unix-socket (`unix-listen` / `unix-connect`). Evolving.
|
|
|
28138
28737
|
|
|
28139
28738
|
| Export | Kind | Purpose |
|
|
28140
28739
|
|--------|------|---------|
|
|
28141
|
-
| `createCodexDriver` / `CodexDriver` / `CodexDriverConfig` | function / _types_ | the driver: `transport` (`stdio`, `unix-listen`, `unix-connect`), `serverArgs`, thread policy (`model`, `modelProvider`, `approvalPolicy`, `sandbox`, `developerInstructions`, `runtimeWorkspaceRoots`, `config`), `prepareThread` / `verifyThread` lifecycle hooks, observers (`onNotification`, `onServerRequest`, `serverRequestDelivery` `'external-only' \| 'all'`, `onDisconnect`), `maxFrameBytes` (WebSocket/stdio frame ceiling), optional `resolveFile` and `maxImageBytes` (default 5 MiB) for turn-input images, `connectControl(input)` for threadless connections, opt-in `openSharedServer(input)` for headless `stdio` multi-thread multiplexing (ADR 0329), approvals and input asked of the host, and multi-bucket limits from `account/rateLimits/read
|
|
28740
|
+
| `createCodexDriver` / `CodexDriver` / `CodexDriverConfig` | function / _types_ | the driver: `transport` (`stdio`, `unix-listen`, `unix-connect`), `serverArgs`, thread policy (`model`, `modelProvider`, `approvalPolicy`, `sandbox`, `developerInstructions`, `runtimeWorkspaceRoots`, `config`), `prepareThread` / `verifyThread` lifecycle hooks, observers (`onNotification`, `onServerRequest`, `serverRequestDelivery` `'external-only' \| 'all'`, `onDisconnect`, and `onObserverError`, which receives every failure of a host callback the driver contained with the name of the option that failed, or `driver:notification` for a failure inside a shared server's own handling), `maxFrameBytes` (WebSocket/stdio frame ceiling), optional `resolveFile` and `maxImageBytes` (default 5 MiB) for turn-input images, `connectControl(input)` for threadless connections, opt-in `openSharedServer(input)` for headless `stdio` multi-thread multiplexing (ADR 0329), approvals and input asked of the host, and multi-bucket limits from `account/rateLimits/read`. Closing a session, a control connection or a shared server on a stdio app-server answers every server request it still holds, and any that arrives while the process stops, as stopped; after an abort or a lost connection nothing is written, and on a Unix-socket transport such a request is left for the TUI |
|
|
28142
28741
|
| `CodexTransportConfig` | _type_ | transport selector: `{ kind: 'stdio' }`, `{ kind: 'unix-listen', socketPath, listenTimeoutMs? }`, or `{ kind: 'unix-connect', socketPath, expectedOwnerUid? }` (resolving symlink chains on parent directories safely across Linux and Darwin) |
|
|
28143
28742
|
| `CodexSession` / `CodexControlClient` / `CodexControlConnection` / `CodexControlConnectInput` / `CodexRpcCallOptions` | _types_ | extended session returned by `open()` and threadless connection returned by `connectControl()`: expose `providerPid`, `userAgent` (from `initialize`), `respond`, `readConfig`, `readThread`, `resumeThread`, `startThreadTurn` (threadless `turn/start` without occupying a local session turn slot), `interruptTurn`, `steerTurn`, `compactThread`, `listThreads`, `listLoadedThreads`, `listCollaborationModes`, `listTurns`, `listItems`, `archiveThread`, `unarchiveThread`, `unsubscribeThread`, `setThreadName`, `updateThreadMetadata`, `revertThread`, `injectItems`, `listMcpServerStatus`, `listSkills`, `listModels`, `readAccount`, and `readRateLimits`, each accepting optional per-call `CodexRpcCallOptions` (`{ timeoutMs?, signal? }`); `CodexSession` also exposes `threadContext`, `startTurn` (returning `CodexTurn`), and non-mutating `forkThread` |
|
|
28144
28743
|
| `CodexSharedServer` / `CodexSharedServerOpenInput` / `CodexSharedServerThreadInput` | _types_ | opt-in headless `stdio` multi-thread server returned by `driver.openSharedServer()` exposing `userAgent` and multiplexing up to `maxThreads` (default `32`, hard cap `256`) independent `CodexSession` instances with per-thread routing and `thread/unsubscribe` cleanup on thread close (refuses `unix-listen` / `unix-connect` fail-closed) |
|
|
@@ -28160,18 +28759,32 @@ WebSocket-over-Unix-socket (`unix-listen` / `unix-connect`). Evolving.
|
|
|
28160
28759
|
|
|
28161
28760
|
| Export | Kind | Purpose |
|
|
28162
28761
|
|--------|------|---------|
|
|
28163
|
-
| `runAgentEngineConformance` / `AgentEngineConformanceConfig` / `AgentEngineDialectScenarios` | function / _types_ | prove a driver against its dialect's scripted engine: capabilities
|
|
28164
|
-
| `createReplayExecutorDriver` / `ReplayExecutorDriver` / `ReplayExecutorDriverConfig` | function / _types_ | in-process, zero-subprocess, deterministic replay `AgentEngineDriver` over validated NDJSON transcripts for local dev and e2e tests; emulates any existing `ExecutorEngine` without widening `ExecutorEngineSchema` and provides `inputsFor`, `wasAnswered`, and `assertComplete` |
|
|
28165
|
-
| `createReplayGate` / `ReplayGate` | function / _type_ | deterministic label-based synchronization gate pausing `{ kind: 'gate', label }` steps until `waitForReached` / `release` without timers |
|
|
28762
|
+
| `runAgentEngineConformance` / `AgentEngineConformanceConfig` / `AgentEngineDialectScenarios` | function / _types_ | prove a driver against its dialect's scripted engine: capabilities (what the driver declares is what `info()` reports, declared or not; a declared set matches the schema), text and reconcile, approvals, failures by kind, interrupts (including `interruptDuringApproval`, whose request must close with `request-resolved`, and `requestAfterInterrupt`, which the driver must refuse rather than offer), a request still held when the turn ends (`requestAtTurnEnd`, closed with `request-resolved` before the end) or when the engine dies (`requestThenCrash`), neither left open to the consumer's answer, a dead or garbled engine, unknown records, a dispatch never sent twice, and the session's life: `open` given an aborted signal, or one aborted from `onStartupPhase`, rejects with the signal's reason; an abort in a turn fails its stream with that reason and `respond` and `startTurn` reject with it; `interrupt` after the turn's end, an abort or a close resolves; `close()` in a turn fails the turn, resolves however often it is called and leaves `onStartupPhase` silent. Each of these waits at most 10 s, so a driver that hangs fails by the name of its check — give the test a longer timeout to read it |
|
|
28763
|
+
| `createReplayExecutorDriver` / `ReplayExecutorDriver` / `ReplayExecutorDriverConfig` | function / _types_ | in-process, zero-subprocess, deterministic replay `AgentEngineDriver` over validated NDJSON transcripts for local dev and e2e tests; emulates any existing `ExecutorEngine` without widening `ExecutorEngineSchema` and provides `inputsFor`, `wasAnswered`, and `assertComplete`; `onObserverError(error, hook)` receives a throwing `onStartupPhase`, as the real drivers' option does |
|
|
28764
|
+
| `createReplayGate` / `ReplayGate` | function / _type_ | deterministic label-based synchronization gate pausing `{ kind: 'gate', label }` steps until `waitForReached` / `release` without timers; a label is compared without its surrounding whitespace on every call |
|
|
28166
28765
|
| `ExecutorReplayTranscriptSchema` / `ExecutorReplayTranscript` / `ExecutorReplayStepSchema` / `ExecutorReplayStep` / `parseReplayTranscript` / `ParseReplayTranscriptOptions` / `formatReplayTranscript` | schemas / functions / _types_ | strict Zod-validated NDJSON transcript format (bounded by `maxBytes` and `maxSteps`, substituting `<workspace>` placeholders) and round-trip parser/formatter |
|
|
28167
28766
|
| `REPLAY_SCENARIOS` / `unpackReplayScenario` / `replayDialectScenarios` | constant / functions | built-in deterministic scenario presets (`'text-stream'`, `'approval'`, `'user-input'`, `'tool-calls'`, `'rate-limit'`, `'multi-turn'`, `'crash-mid-turn'`) and conformance dialect adapter |
|
|
28168
|
-
| `createFakeCodexAppServer` / `FakeCodexAppServer` / `FakeCodexAppServerConfig` / `FakeCodexRpcHandler` / `FakeCodexRpcHandlerOutcome` / `FakeCodexRpcErrorOutcome` / `RecordedJsonRpcRequest` | function / _types_ | portable (Bun and Node.js) real Unix-socket WebSocket JSON-RPC fake Codex app-server for integration tests with `createCodexDriver({ transport: { kind: 'unix-connect' } })`: automatic `initialize` handshake, `'hang'` / DTO / RPC error handlers, `requests` recording, `sendNotification`, `sendRequest`, `sendRaw`, `disconnect()`, and idempotent `close()` |
|
|
28169
|
-
| `
|
|
28170
|
-
| `createStubCodexControlClient` / `createStubCodexControlConnection` / `createStubCodexSession` / `createStubCodexSharedServer` / `createStubCodexTurn` / `createStubAgentEngineTurn` / `createStubClaudeSdkSession` / `createStubAcpSession` / `StubOverrides` / `StubAgentEngineTurnOverrides` / `StubCodexTurnOverrides` | functions / _types_ | fail-loud typed consumer stub factories (`exactOptionalPropertyTypes: true`-safe `StubOverrides<T>`, no-op `close()`, unexpected-call throws on unset methods) |
|
|
28767
|
+
| `createFakeCodexAppServer` / `FakeCodexAppServer` / `FakeCodexAppServerConfig` / `FakeCodexRpcHandler` / `FakeCodexRpcHandlerOutcome` / `FakeCodexRpcErrorOutcome` / `RecordedJsonRpcRequest` | function / _types_ | portable (Bun and Node.js) real Unix-socket WebSocket JSON-RPC fake Codex app-server for integration tests with `createCodexDriver({ transport: { kind: 'unix-connect' } })`: automatic `initialize` handshake, `'hang'` / DTO / RPC error handlers, `requests` recording, `sendNotification`, `sendRequest`, `sendRaw`, `disconnect()`, and idempotent `close()`; a server `error` after startup drops the connected clients, rejects their pending `sendRequest` calls and makes every later send throw with that error as `cause` |
|
|
28768
|
+
| `createStubCodexControlClient` / `createStubCodexControlConnection` / `createStubCodexSession` / `createStubCodexSharedServer` / `createStubCodexTurn` / `createStubAgentEngineTurn` / `createStubAcpSession` / `StubOverrides` / `StubAgentEngineTurnOverrides` / `StubCodexTurnOverrides` | functions / _types_ | fail-loud typed consumer stub factories (`exactOptionalPropertyTypes: true`-safe `StubOverrides<T>`, no-op `close()`, unexpected-call throws on unset methods); `createStubCodexSharedServer` declares the capabilities `createCodexDriver()` declares on its shared server |
|
|
28171
28769
|
| `makeExecutorDelta` / `ExecutorDeltaInput` / `makeCodexNotificationEvent` / `CodexNotificationEventOverrides` / `makeCodexThreadFixture` | functions / _types_ | schema-validated fixture factories for `ExecutorDelta`, `CodexNotificationEvent`, and `CodexThread` |
|
|
28172
28770
|
| `FakeEngineScenarioSchema` / `FakeEngineScenario` / `FakeEngineStepSchema` / `FakeEngineStep` | schemas / _types_ | a scripted engine turn in any dialect: expect, emit, delay, crash, exit |
|
|
28173
28771
|
| `runFakeClaudeEngine` | function | play a scenario as Claude Code does on `stream-json` — the engine side of a Claude-dialect conformance test |
|
|
28174
28772
|
|
|
28773
|
+
This entrypoint declares no optional peer: a Codex or ACP driver's tests import it without
|
|
28774
|
+
`@anthropic-ai/claude-agent-sdk` installed, with `skipLibCheck: false`.
|
|
28775
|
+
|
|
28776
|
+
---
|
|
28777
|
+
|
|
28778
|
+
## `stitchkit/agent-executor/testing/claude-sdk`
|
|
28779
|
+
|
|
28780
|
+
The testing kit's Claude Agent SDK half. Its declarations name the types of the optional peer
|
|
28781
|
+
`@anthropic-ai/claude-agent-sdk`; it runs without the SDK. Evolving.
|
|
28782
|
+
|
|
28783
|
+
| Export | Kind | Purpose |
|
|
28784
|
+
|--------|------|---------|
|
|
28785
|
+
| `createFakeClaudeSdkQuery` / `FakeClaudeSdkQueryConfig` / `FakeClaudeSdkQueryHarness` / `FakeClaudeSdkRunController` / `FakeClaudeSdkScriptedTurn` / `FakeClaudeSdkRecordedCall` | function / _types_ | scripted multi-turn in-process `ClaudeSdkQuery` harness over real `createClaudeSdkDriver` supporting `canUseTool` via `askPermission`, live control call recording, optional experimental usage attachment, and non-inference `probeCapabilities` |
|
|
28786
|
+
| `createStubClaudeSdkSession` | function | fail-loud typed `ClaudeSdkSession` stub taking `StubOverrides<ClaudeSdkSession>` from `stitchkit/agent-executor/testing`: no-op `close()`, unexpected-call throws on unset methods |
|
|
28787
|
+
|
|
28175
28788
|
---
|
|
28176
28789
|
|
|
28177
28790
|
|
|
@@ -28830,6 +29443,7 @@ handler pipeline without opening a TCP port.
|
|
|
28830
29443
|
| `SurfaceManifestOperation` / `SurfaceManifestOperationSchema` | _type_ / schema | one contract or runtime operation row |
|
|
28831
29444
|
| `SurfaceManifestOperationMcp` / `SurfaceManifestOperationMcpSchema` | _type_ / schema | the rounds an operation declares before it runs: a fixed list, `'resolved-per-call'`, or `null` for no MCP policy |
|
|
28832
29445
|
| `SurfaceManifestOperationToolView` / `SurfaceManifestOperationToolViewSchema` | _type_ / schema | an operation's declared tool view — digests of its defaults and output, and whether it projects; present only where a view is declared |
|
|
29446
|
+
| `SurfaceManifestOperationRefusal` / `SurfaceManifestOperationRefusalSchema` | _type_ / schema | one declared refusal of an operation — `{ code, status, details }` with the details schema digest; `refusals` is present only where an operation declares `refuses` |
|
|
28833
29447
|
| `SURFACE_MANIFEST_VERSION` | const | the format version this build writes; a committed snapshot on an older one is refused by name |
|
|
28834
29448
|
| `SurfaceManifestTool` / `SurfaceManifestToolSchema` | _type_ / schema | one mounted tool row with advertised input digest |
|
|
28835
29449
|
| `SurfaceManifestToolSurface` / `SurfaceManifestToolSurfaceSchema` | _type_ / schema | one static transport projection, optionally keyed for a finite MCP surface |
|
|
@@ -29020,6 +29634,31 @@ Peer-free server-only evolving entrypoint for macOS signed `.app` launcher bundl
|
|
|
29020
29634
|
| `CLANG_PATH` / `CODESIGN_PATH` / `ICONUTIL_PATH` / `PS_PATH` / `QLMANAGE_PATH` / `SECURITY_PATH` / `SIPS_PATH` / `canonicalizeMacosPath` / `normalizeMacosSyntheticPath` / `isPathWithinDirectory` / `createDefaultMacosCommandRunner` / `MacosCommandOptions` / `MacosCommandResult` / `MacosCommandRunner` | const / function / _types_ | absolute macOS utility paths, synthetic `/var`/`/tmp` path helpers and injectable command runner; the default runner passes a declared environment only (fixed `PATH`; `HOME`, `TMPDIR`, `DEVELOPER_DIR`, `SDKROOT`, `TOOLCHAINS` when set; the call's `env` on top) |
|
|
29021
29635
|
|
|
29022
29636
|
|
|
29637
|
+
## `stitchkit/service-host/work`
|
|
29638
|
+
|
|
29639
|
+
Work launched in its own boundary with a declared owner. Guide: [Work in its own boundary](../guide/native-io.md#work-in-its-own-boundary). → ADR 0332
|
|
29640
|
+
|
|
29641
|
+
| Export | Kind | Summary |
|
|
29642
|
+
|--------|------|---------|
|
|
29643
|
+
| `launchWork` | function | launches a command in its boundary through the one native-command owner and resolves once its root is observed there; throws `WorkLaunchError` and starts nothing outside the asked boundary |
|
|
29644
|
+
| `WorkLaunchInput` / `WorkLaunchCommand` | type | `{ owner, placement, command }`; `command` is `NativeCommandOptions` without `group`, `ownerLoss` and `onLeaderStarted` |
|
|
29645
|
+
| `WorkLaunch` | type | `origin` (what the variable holds), `unit` (`{ manager, name }` or `null`), `root` (`{ pid, instance }`), `result` (settles like `runNativeCommand`) and `stop()` (ends the whole boundary) |
|
|
29646
|
+
| `workCommand` | function | the same placement as argv and environment for any spawner; a scope gets `STITCHKIT_WORK_ORIGIN` in `env`, a process root writes it itself |
|
|
29647
|
+
| `WorkCommandInput` / `WorkCommand` | type | `{ owner, placement, executable, args?, env }` → `{ executable, args, env, work, unit }` |
|
|
29648
|
+
| `probeWorkBoundary` / `WorkBoundaryAvailability` | function / type | whether this host can make a placement, without launching: `available`, or `unavailable` with `reason` and `cause` |
|
|
29649
|
+
| `checkWorkMembership` / `WorkMembership` / `WorkMembershipUnavailableReason` | function / type / type | asks the boundary whether a pid belongs to it: `member` (`via` `cgroup`, `root`, `process-group` or `ancestry`), `outside` with what was observed, `gone`, or `unavailable` (`platform-unsupported`, `proc-unreadable`, `cgroup-v2-required`, `root-unobservable`, `process-table-failed`) |
|
|
29650
|
+
| `inheritedWork` | function | the `WorkRef` the current process is proven to run in, or `null`; throws when the variable is unreadable or the boundary cannot be asked |
|
|
29651
|
+
| `readWorkOrigin` / `WORK_ORIGIN_ENV` | function / const | parses `STITCHKIT_WORK_ORIGIN` from an environment: `null` when absent, `WorkLaunchError('origin-unreadable')` when it does not parse or is of another version |
|
|
29652
|
+
| `WorkOriginSchema` / `WorkOrigin` | schema / type | `{ v: 1, work, boundary }` — the value of the variable |
|
|
29653
|
+
| `WorkBoundarySchema` / `WorkBoundary` | schema / type | `{ kind: 'transient-scope', manager, unit }` or `{ kind: 'process-root', root: { pid, instance } }` |
|
|
29654
|
+
| `WorkOwnerSchema` / `WorkOwner` | schema / type | the owner record: `launcher`, `id`, `label`, and `project`, `agent`, `parent` as a value or `null`; no optional field |
|
|
29655
|
+
| `WorkRefSchema` / `WorkRef` | schema / type | `{ launcher, id }` — a pointer to one owner record |
|
|
29656
|
+
| `WorkAgentSchema` / `WorkAgent` | schema / type | `{ harness, model, address }` of the agent that asked for the work |
|
|
29657
|
+
| `WorkPlacement` / `WorkScopePlacement` / `WorkScopeLimits` | type | `{ kind: 'transient-scope', manager: 'system' \| 'user', slice: 'caller' \| '<name>.slice', limits? }` or `{ kind: 'process-root' }`; limits `memoryMaxMb`, `memorySwapMaxMb`, `cpuQuotaPercent`, `cpuWeight`, `runtimeMaxSeconds` become unit properties |
|
|
29658
|
+
| `workUnitName` | function | `<launcher>-<id>.scope` for a `WorkRef`; one way only |
|
|
29659
|
+
| `WorkLaunchError` / `WorkLaunchErrorReason` | class / type | `reason` is `origin-unreadable`, `platform-unsupported`, `systemd-unavailable`, `systemd-too-old` (older than 254), `manager-unreachable`, `manager-unauthorized` (the system manager for a non-root caller), `user-manager-unreachable`, `slice-unresolvable`, `unit-exists`, `scope-refused`, `root-unobservable`, `root-unobserved`, `membership-unavailable` or `stop-failed`; `cause` holds what the host answered |
|
|
29660
|
+
|
|
29661
|
+
|
|
29023
29662
|
## `stitchkit/telegram`
|
|
29024
29663
|
|
|
29025
29664
|
Peer-free server-only Telegram platform primitives — the Bot API's own
|
|
@@ -29756,13 +30395,13 @@ Native POSIX Bun/Node one-shot command execution. See [native IO](../guide/nativ
|
|
|
29756
30395
|
| `ProcessInstanceSchema` / `ProcessInstance` | schema / type | platform, boot ID, namespace and process start identity from the shared native reader |
|
|
29757
30396
|
| `probeProcessOwner` / `ProcessOwnerEvidence` | function / type | compare lifetimes on one caller-established machine; matched, boot change, reused PID, gone, legacy or unavailable with cause |
|
|
29758
30397
|
|
|
29759
|
-
## `stitchkit/process/
|
|
30398
|
+
## `stitchkit/process/bootstrap`
|
|
29760
30399
|
|
|
29761
|
-
Narrow startup entry for single-file applications that lazy-import `stitchkit/process`.
|
|
30400
|
+
Narrow startup entry for single-file applications that lazy-import `stitchkit/process` or `stitchkit/service-host/work`.
|
|
29762
30401
|
|
|
29763
30402
|
| Export | Kind | Purpose |
|
|
29764
30403
|
|---|---|---|
|
|
29765
|
-
| `
|
|
30404
|
+
| `bootstrapPackageProcess` | function | call before application argv routing; returns `true` only when the package owns this invocation — the owner-loss guard of `runNativeCommand`, or a process root of `stitchkit/service-host/work` that could not become its command — so the application skips its dispatcher while preserving a lazy import of the full runner |
|
|
29766
30405
|
|
|
29767
30406
|
## `stitchkit/files/packaging`
|
|
29768
30407
|
|
|
@@ -29802,15 +30441,20 @@ without splitting, preserve every output, and write each asset's `bytes` to its
|
|
|
29802
30441
|
This evolving entrypoint is a build dependency; runtime imports do not reach it.
|
|
29803
30442
|
The detailed recipe is in [native IO](../guide/native-io.md#public-native-packaging).
|
|
29804
30443
|
|
|
29805
|
-
It also owns the
|
|
30444
|
+
It also owns the two builds of a client — one self-contained file, and a typed npm package:
|
|
29806
30445
|
|
|
29807
30446
|
| Export | Kind | Summary |
|
|
29808
30447
|
|--------|------|---------|
|
|
29809
|
-
| `buildClientArtifact` | function | bundle a client entry into one self-contained file with its SHA-256
|
|
29810
|
-
| `ClientArtifactOptions` | _type_ | entry, output file, runtime, forbidden modules
|
|
29811
|
-
| `ClientArtifact` | _type_ | the built file, its SHA-256 and size, the bundled modules
|
|
29812
|
-
| `
|
|
29813
|
-
| `
|
|
30448
|
+
| `buildClientArtifact` | function | bundle a client entry into one self-contained file with its SHA-256 and refuse forbidden modules in the graph — [guide](../guide/native-io.md#a-client-as-one-self-contained-file) |
|
|
30449
|
+
| `ClientArtifactOptions` | _type_ | entry, output file, runtime, forbidden modules, `executables.bun`, deadline and signal |
|
|
30450
|
+
| `ClientArtifact` | _type_ | the built file, its SHA-256 and size, and the bundled modules |
|
|
30451
|
+
| `buildClientPackage` | function | build several entries of a typed client into one npm archive over one module graph, with peers and dependencies outside and declarations that resolve under Bundler and NodeNext, and return it only after the archive was installed, imported in Node and Bun and typechecked by a strict consumer — [guide](../guide/native-io.md#a-typed-client-as-an-npm-package), [ADR 0331](../decisions/0331-a-client-package-is-one-module-graph-proven-installed.md) |
|
|
30452
|
+
| `ClientPackageOptions` | _type_ | name, version, `entries` by subpath, `tsconfig`, peers and dependencies, forbidden modules, runtime, output directory, `manifest`, extra `files`, `exportedFiles` (`./package.json` and packed files a consumer imports by subpath), `replaceModules` (a module built from given contents), `proof` (consumer sources, required and distinct exports, type packages), `executables`, deadline and signal |
|
|
30453
|
+
| `ClientPackageManifest` | _type_ | descriptive `package.json` fields of the package; a field the build writes itself is refused |
|
|
30454
|
+
| `ClientPackage` | _type_ | the archive with its SHA-256 and size, every packed file with its digest, the bundled modules, exports per subpath, the names proven shared across subpaths, and what the proof ran, the exported files it resolved included |
|
|
30455
|
+
| `ClientPackageError` | class | the refusal of a client package: a closed `reason` and `details` naming the file, specifier, package or names |
|
|
30456
|
+
| `ForbiddenModule` | _type_ | a package name or subpath, a source path fragment or a `RegExp` over module paths |
|
|
30457
|
+
| `ForbiddenModuleError` | class | the refusal of a client that reaches a forbidden module, bundled or left external: `module` and `importedBy` |
|
|
29814
30458
|
|
|
29815
30459
|
## `stitchkit/handler`
|
|
29816
30460
|
|