stitchkit 0.104.2 → 0.105.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 +401 -13
- package/darwin-native.cjs +4 -2
- package/dist/agent-runtime/browser-control-contract.d.ts +32 -2
- package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser-controller.d.ts +21 -3
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-refusals.d.ts +1 -0
- package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/contained-write.d.ts.map +1 -1
- package/dist/agent-runtime/control-schema.d.ts +48 -1
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-search.d.ts +3 -2
- package/dist/agent-runtime/deferred-tool-search.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts +34 -4
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-process-owner.d.ts +9 -1
- package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +32 -1
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +9 -4
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/testing.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-contract.d.ts +50 -0
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-generations.d.ts +24 -0
- package/dist/application/diagnostic-journal-generations.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-open.d.ts +10 -0
- package/dist/application/diagnostic-journal-open.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-quarantine.d.ts +28 -0
- package/dist/application/diagnostic-journal-quarantine.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-read-contract.d.ts +73 -3
- package/dist/application/diagnostic-journal-read-contract.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-reader.d.ts +17 -2
- package/dist/application/diagnostic-journal-reader.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-recovery.d.ts +18 -2
- package/dist/application/diagnostic-journal-recovery.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts +6 -2
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-tail.d.ts +12 -0
- package/dist/application/diagnostic-journal-tail.d.ts.map +1 -0
- package/dist/application/diagnostic-journal.d.ts +3 -0
- package/dist/application/diagnostic-journal.d.ts.map +1 -1
- package/dist/application/directory-inbox-accept.d.ts +3 -3
- package/dist/application/directory-inbox-accept.d.ts.map +1 -1
- package/dist/application/directory-inbox-contract.d.ts +38 -10
- package/dist/application/directory-inbox-contract.d.ts.map +1 -1
- package/dist/application/directory-inbox-delivery.d.ts +3 -3
- package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
- package/dist/application/directory-inbox-files.d.ts +17 -2
- package/dist/application/directory-inbox-files.d.ts.map +1 -1
- package/dist/application/directory-inbox-state.d.ts +1 -1
- package/dist/application/directory-inbox-state.d.ts.map +1 -1
- package/dist/application/directory-inbox.d.ts +1 -1
- package/dist/application/directory-inbox.d.ts.map +1 -1
- package/dist/application/file-state-store.d.ts +21 -1
- package/dist/application/file-state-store.d.ts.map +1 -1
- package/dist/application/grammy.d.ts.map +1 -1
- package/dist/application/kernel-contract.d.ts.map +1 -1
- package/dist/application/revision-signal.d.ts.map +1 -1
- package/dist/application/state-store.d.ts +3 -0
- package/dist/application/state-store.d.ts.map +1 -1
- package/dist/browser/api-error.d.ts +38 -0
- package/dist/browser/api-error.d.ts.map +1 -0
- package/dist/browser/chunked-upload.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http.d.ts +0 -25
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/resumable.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +0 -1
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +15 -18
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/durability/effect.d.ts.map +1 -1
- package/dist/durability/scheduler.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +29 -18
- package/dist/entrypoints/agent-runtime/coding-tools.js +8 -7
- package/dist/entrypoints/agent-runtime/harness.js +15 -14
- package/dist/entrypoints/agent-runtime/realtime.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/realtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/realtime.js +119 -54
- package/dist/entrypoints/agent-runtime/sandbox.js +23 -17
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +4 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +4 -3
- package/dist/entrypoints/agent-runtime/testing.js +8 -6
- package/dist/entrypoints/agent-runtime.js +37 -38
- package/dist/entrypoints/application/diagnostic-journal.js +305 -111
- package/dist/entrypoints/application/directory-inbox.js +174 -77
- package/dist/entrypoints/application/grammy.js +5 -2
- package/dist/entrypoints/application/opentelemetry.js +2 -2
- package/dist/entrypoints/application.d.ts +2 -2
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +17 -8
- package/dist/entrypoints/cli/publish.d.ts +16 -0
- package/dist/entrypoints/cli/publish.d.ts.map +1 -0
- package/dist/entrypoints/cli/publish.js +527 -0
- package/dist/entrypoints/cli.d.ts +1 -2
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +59 -966
- package/dist/entrypoints/contract.js +3 -3
- package/dist/entrypoints/files/packaging.js +161 -66
- package/dist/entrypoints/files.d.ts +1 -0
- package/dist/entrypoints/files.d.ts.map +1 -1
- package/dist/entrypoints/files.js +17 -10
- package/dist/entrypoints/index.d.ts +2 -1
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +31 -60
- package/dist/entrypoints/node.js +8 -8
- package/dist/entrypoints/observability.js +3 -3
- package/dist/entrypoints/primitives.js +67 -83
- package/dist/entrypoints/process.d.ts +1 -1
- package/dist/entrypoints/process.d.ts.map +1 -1
- package/dist/entrypoints/process.js +2 -2
- package/dist/entrypoints/react.js +4 -2
- package/dist/entrypoints/remote.js +37 -13
- package/dist/entrypoints/server.js +18 -16
- package/dist/entrypoints/telegram/screens.js +5 -3
- package/dist/entrypoints/telegram.js +31 -46
- package/dist/entrypoints/testing.d.ts +1 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +444 -448
- package/dist/entrypoints/tools/connections.js +268 -105
- package/dist/entrypoints/tools/contract.js +2 -2
- package/dist/entrypoints/tools/invoker.js +8 -7
- package/dist/entrypoints/tools/mcp.d.ts +2 -2
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
- package/dist/entrypoints/tools/mcp.js +10 -9
- package/dist/entrypoints/tools.d.ts +0 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +118 -53
- package/dist/entrypoints/tracking.js +2 -3
- package/dist/files/boundary.d.ts +2 -2
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/chunk-spool.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +2 -2
- package/dist/files/file-io.d.ts.map +1 -1
- package/dist/files/native-packaging-layout.d.ts +50 -4
- package/dist/files/native-packaging-layout.d.ts.map +1 -1
- package/dist/files/native-packaging.d.ts +78 -17
- package/dist/files/native-packaging.d.ts.map +1 -1
- package/dist/{index-r5hsgkz5.js → index-0gs4ymfj.js} +6 -3
- package/dist/{index-zax7resm.js → index-0gxvns6s.js} +1 -13
- package/dist/index-0s4xebbg.js +8 -0
- package/dist/{index-r4r70zmh.js → index-12zsej7b.js} +5 -2
- package/dist/{index-269zqj8m.js → index-1ptj98e0.js} +28 -12
- package/dist/{index-kemm0ej5.js → index-1pwwan01.js} +65 -22
- package/dist/{index-vgkbcnkc.js → index-299sm5tr.js} +1 -1
- package/dist/{index-2vnh05w4.js → index-2k91mewf.js} +31 -74
- package/dist/{index-wh0ecvyk.js → index-37asdw3a.js} +1 -1
- package/dist/index-3h0ztg0z.js +285 -0
- package/dist/{index-g95fk660.js → index-4vsby8n8.js} +8 -15
- package/dist/index-556g5hsh.js +17 -0
- package/dist/{index-f330qqyg.js → index-5c26631f.js} +244 -67
- package/dist/{index-adhgd4pe.js → index-5p55xreg.js} +2 -2
- package/dist/index-5w6t91ze.js +47 -0
- package/dist/{index-9pw0a51a.js → index-6yxhe58g.js} +40 -7
- package/dist/{index-6d9xaxw1.js → index-8ks9b85e.js} +33 -5
- package/dist/{index-bhb950qs.js → index-916yh4e2.js} +25 -12
- package/dist/index-9tqbxv5p.js +44 -0
- package/dist/{index-5csmzesf.js → index-azx12jgv.js} +4 -3
- package/dist/{index-mbnnw3f2.js → index-b0kddvzw.js} +15 -5
- package/dist/{index-n5yqxd3d.js → index-b0w7rbpt.js} +23 -2
- package/dist/index-b56nnscm.js +132 -0
- package/dist/{index-0ndk4555.js → index-c0hffcmj.js} +2 -2
- package/dist/{index-pptyv13k.js → index-c17xcx4k.js} +42 -6
- package/dist/index-cazts87s.js +105 -0
- package/dist/{index-g2j7pnak.js → index-cmzvhhtd.js} +5 -2
- package/dist/{index-ssmd41kh.js → index-d2h99n7d.js} +1 -1
- package/dist/{index-z94wht4y.js → index-dky0dcmf.js} +34 -5
- package/dist/index-drs41arz.js +455 -0
- package/dist/{index-za6j7nwy.js → index-dsnjzb62.js} +104 -51
- package/dist/index-eemvahkc.js +21 -0
- package/dist/{index-fa4wg312.js → index-f199nfq5.js} +10 -6
- package/dist/{index-ck71tbcf.js → index-fsw1ybf3.js} +11 -15
- package/dist/{index-fk18k56k.js → index-gr5g3xfw.js} +11 -18
- package/dist/{index-jn9g8xdt.js → index-hjvje0pf.js} +6 -4
- package/dist/index-j4zh647a.js +59 -0
- package/dist/{index-x928baz2.js → index-j9gxbztg.js} +18 -14
- package/dist/index-kfjkb396.js +37 -0
- package/dist/{index-6drst9sg.js → index-ksfagmyz.js} +45 -345
- package/dist/index-m616f0yz.js +120 -0
- package/dist/{index-fm1c1a08.js → index-m6w6jtda.js} +40 -21
- package/dist/{index-bakgedh8.js → index-msfpyy2f.js} +2 -4
- package/dist/{index-ywppsaby.js → index-n1nszyk0.js} +23 -34
- package/dist/{index-v14qqmys.js → index-n4689krb.js} +1 -1
- package/dist/{index-a0zzh8ak.js → index-pz3y6b6g.js} +3 -3
- package/dist/{index-43p08g7t.js → index-pzb63z66.js} +12 -8
- package/dist/{index-h97tqqp1.js → index-qaet40b2.js} +5 -3
- package/dist/{index-t1sr4aks.js → index-qaqbdm7s.js} +52 -6
- package/dist/{index-77nxk6ay.js → index-r393tnfp.js} +16 -10
- package/dist/{index-kb8styz3.js → index-rpzewktb.js} +15 -5
- package/dist/{index-27a2pj09.js → index-sj28htvf.js} +1 -1
- package/dist/{index-hbd32c6a.js → index-w8etpm8j.js} +38 -89
- package/dist/{index-2hyavjjj.js → index-wbhdzxar.js} +3 -3
- package/dist/{index-4e0ah203.js → index-wdy68sh6.js} +47 -24
- package/dist/{index-hp9d77wk.js → index-x7w1z6pf.js} +15 -4
- package/dist/{index-ptn0g0gj.js → index-y7k2cdgv.js} +21 -20
- package/dist/{index-20yvtn9a.js → index-yt7gyg5x.js} +1 -1
- package/dist/{index-cvda079a.js → index-yvfk3y36.js} +12 -2
- package/dist/{index-5z6jn897.js → index-z23rfxhj.js} +1 -1
- package/dist/internal/abort-race.d.ts +8 -2
- package/dist/internal/abort-race.d.ts.map +1 -1
- package/dist/internal/atomic-file.d.ts +55 -9
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/atomic-publication.d.ts +39 -4
- package/dist/internal/atomic-publication.d.ts.map +1 -1
- package/dist/internal/atomic-staging.d.ts +47 -0
- package/dist/internal/atomic-staging.d.ts.map +1 -0
- package/dist/internal/bounded-file-read.d.ts +19 -11
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/bounded-lines.d.ts.map +1 -1
- package/dist/internal/close-after.d.ts +11 -0
- package/dist/internal/close-after.d.ts.map +1 -0
- package/dist/internal/deadline.d.ts +10 -0
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-read.d.ts +10 -12
- package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts +2 -2
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +14 -0
- package/dist/internal/file-observation.d.ts.map +1 -0
- package/dist/internal/json-data.d.ts +22 -5
- package/dist/internal/json-data.d.ts.map +1 -1
- package/dist/internal/positive-integer.d.ts +9 -0
- package/dist/internal/positive-integer.d.ts.map +1 -0
- package/dist/internal/process-instance.d.ts +35 -5
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/timers.d.ts +11 -0
- package/dist/internal/timers.d.ts.map +1 -0
- package/dist/internal/with-exclusive-lock.d.ts +5 -4
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts.map +1 -1
- package/dist/primitives/canonical-json.d.ts +23 -2
- package/dist/primitives/canonical-json.d.ts.map +1 -1
- package/dist/primitives/delivery.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/money.d.ts.map +1 -1
- package/dist/process/cleanup.d.ts +7 -2
- package/dist/process/cleanup.d.ts.map +1 -1
- package/dist/process/command-lifetime.d.ts +6 -1
- package/dist/process/command-lifetime.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts +1 -0
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/command.d.ts +4 -0
- package/dist/process/command.d.ts.map +1 -1
- package/dist/process/contract.d.ts +68 -2
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/process/group.d.ts +42 -3
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +12 -1
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/terminate.d.ts +40 -0
- package/dist/process/terminate.d.ts.map +1 -0
- package/dist/react/query-client.d.ts.map +1 -1
- package/dist/realtime/rejection.d.ts.map +1 -1
- package/dist/server/contract-stream.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/request-body.d.ts +0 -1
- package/dist/server/request-body.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/telegram/broadcast-delivery.d.ts.map +1 -1
- package/dist/telegram/broadcast-failure.d.ts +10 -2
- package/dist/telegram/broadcast-failure.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/screens/outcome.d.ts.map +1 -1
- package/dist/testing/surface-conformance.d.ts +1 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +0 -6
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +1 -1
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +2 -2
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/profile.d.ts.map +1 -1
- package/dist/tools/cli/publication-assets.d.ts.map +1 -1
- package/dist/tools/cli/publication-contract.d.ts +8 -0
- package/dist/tools/cli/publication-contract.d.ts.map +1 -1
- package/dist/tools/cli/publication-control.d.ts.map +1 -1
- package/dist/tools/cli/publication-storage.d.ts +23 -2
- package/dist/tools/cli/publication-storage.d.ts.map +1 -1
- package/dist/tools/cli/publication.d.ts +8 -1
- package/dist/tools/cli/publication.d.ts.map +1 -1
- package/dist/tools/connections/errors.d.ts +18 -6
- package/dist/tools/connections/errors.d.ts.map +1 -1
- package/dist/tools/connections/limits.d.ts +8 -2
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp-envelope.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/schema-budget.d.ts +1 -1
- package/dist/tools/connections/schema-budget.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts.map +1 -1
- package/dist/tools/execute-result.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +17 -3
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/internal/tool-error-projection.d.ts +16 -0
- package/dist/tools/internal/tool-error-projection.d.ts.map +1 -0
- package/dist/tools/internal/tool-view.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +3 -2
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +3 -2
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts +7 -0
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +18 -2
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +3 -3
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mcp/stdio-signals.d.ts +14 -0
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -1
- package/dist/tools/mcp/stdio.d.ts +7 -0
- package/dist/tools/mcp/stdio.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts +3 -3
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
- package/dist/tools/operations/wait-core.d.ts +0 -6
- package/dist/tools/operations/wait-core.d.ts.map +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/{runtime-tool-execution.d.ts → runtime-tool-declaration.d.ts} +32 -9
- package/dist/tools/runtime-tool-declaration.d.ts.map +1 -0
- package/dist/tools/runtime-tool-mcp.d.ts +6 -15
- package/dist/tools/runtime-tool-mcp.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +14 -12
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts +4 -0
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/flatten-join.d.ts.map +1 -1
- package/dist/tools/surface.d.ts +7 -11
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -1
- package/dist/tools/transfer/view-file-contract.d.ts.map +1 -1
- package/dist/tools/transfer/view-file.d.ts +1 -1
- package/dist/tools/transfer/view-file.d.ts.map +1 -1
- package/dist/tools/transports.d.ts +3 -2
- package/dist/tools/transports.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +10 -4
- package/llms/agent-runtime-harness.txt +32 -31
- package/llms/agent-runtime-react.txt +1 -1
- package/llms/agent-runtime-realtime.txt +14 -5
- package/llms/agent-runtime-sandbox.txt +3 -11
- package/llms/agent-runtime.3.txt +2 -2
- package/llms/agent-runtime.txt +0 -9
- package/llms/application.2.txt +3 -12
- package/llms/application.3.txt +7 -4
- package/llms/application.txt +44 -15
- package/llms/cli-publish.txt +29 -0
- package/llms/cli.2.txt +9 -11
- package/llms/cli.txt +26 -14
- package/llms/declaration.txt +0 -9
- package/llms/files-packaging.txt +18 -8
- package/llms/files.txt +4 -2
- package/llms/geo.txt +0 -9
- package/llms/live.txt +4 -13
- package/llms/observability.txt +31 -5
- package/llms/primitives.txt +38 -20
- package/llms/process.txt +324 -160
- package/llms/react-keyboard.txt +0 -9
- package/llms/react.txt +0 -18
- package/llms/server.4.txt +1 -1
- package/llms/server.5.txt +1 -1
- package/llms/server.txt +1 -1
- package/llms/stitchkit.txt +6 -7
- package/llms/telegram-screens.txt +2 -2
- package/llms/testing.txt +0 -1
- package/llms/tools-mcp.txt +2 -3
- package/llms/tools.2.txt +12 -0
- package/llms/tools.3.txt +5 -6
- package/llms/tools.txt +6 -4
- package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
- package/llms/{upgrading-0.44.0-0.61.0.txt → upgrading-0.53.0-0.67.0.txt} +576 -506
- package/llms/{upgrading-0.62.0-0.80.0.txt → upgrading-0.68.0-0.94.0.txt} +562 -576
- package/llms/{upgrading-0.81.0-0.104.0.txt → upgrading-0.95.0-0.105.0.txt} +452 -567
- package/llms/upgrading.txt +4 -4
- package/llms-full.txt +1068 -412
- package/llms.txt +24 -24
- package/native-assets.json +11 -3
- package/package.json +6 -6
- package/dist/agent-runtime/harness-tools.d.ts +0 -11
- package/dist/agent-runtime/harness-tools.d.ts.map +0 -1
- package/dist/entrypoints/agent-runtime/harness-tools.d.ts +0 -2
- package/dist/entrypoints/agent-runtime/harness-tools.d.ts.map +0 -1
- package/dist/entrypoints/agent-runtime/harness-tools.js +0 -32
- package/dist/index-1a6jtnd9.js +0 -88
- package/dist/index-8a9ksm91.js +0 -95
- package/dist/index-a3wma1hk.js +0 -48
- package/dist/index-jd470k6q.js +0 -109
- package/dist/index-n1dqr7gf.js +0 -20
- package/dist/index-nggfa2yn.js +0 -34
- package/dist/index-s4evrmp5.js +0 -98
- package/dist/index-ze1eph1k.js +0 -20
- package/dist/tools/connections/error-projection.d.ts +0 -4
- package/dist/tools/connections/error-projection.d.ts.map +0 -1
- package/dist/tools/runtime-tool-execution.d.ts.map +0 -1
- package/llms/agent-runtime-harness-tools.txt +0 -25
- package/llms/upgrading-0.37.0-0.44.0.txt +0 -444
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# stitchkit/cli/publish — stitchkit docs slice
|
|
2
|
+
|
|
3
|
+
> Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
|
|
4
|
+
> `llms.txt` in this package.
|
|
5
|
+
|
|
6
|
+
Contains: API reference: `stitchkit/cli/publish` (docs/api/reference.md)
|
|
7
|
+
|
|
8
|
+
Also read:
|
|
9
|
+
- see `llms/cli.txt` for the CLI guide
|
|
10
|
+
|
|
11
|
+
==============================================================================
|
|
12
|
+
# API reference: `stitchkit/cli/publish` (docs/api/reference.md)
|
|
13
|
+
==============================================================================
|
|
14
|
+
|
|
15
|
+
## `stitchkit/cli/publish`
|
|
16
|
+
|
|
17
|
+
Build and release tooling, evolving. Publishes a CLI distribution into a local
|
|
18
|
+
application-owned directory; the manifest, signatures, installer and updater it
|
|
19
|
+
writes for stay in `stitchkit/cli` — [guide](../guide/cli.md#publishing-a-complete-version),
|
|
20
|
+
[ADR 0245](../decisions/0245-cli-publication-is-an-evolving-leaf.md).
|
|
21
|
+
|
|
22
|
+
| Export | Kind | Summary |
|
|
23
|
+
|--------|------|---------|
|
|
24
|
+
| `publishCli` | function | optional bounded builder/admission over one immutable name/version/commit stamp; commit verified assets before the manifest pointer, recover exact completed versions, retain verified history |
|
|
25
|
+
| `CliPublicationOptions` | _type_ | identity, storage root, base URL, targets, limits, retention, the `admit` and `build` callbacks, optional signing and trust |
|
|
26
|
+
| `CliPublicationPhase` | _type_ | the step `admit` is asked about — `prepare`, `build`, `commit` or `promote` |
|
|
27
|
+
| `CliPublicationResult` | _type_ | `published` or `existing`, with the manifest ready to serve |
|
|
28
|
+
|
|
29
|
+
---
|
package/llms/cli.2.txt
CHANGED
|
@@ -38,7 +38,7 @@ await createCli({ name: 'myapp', version, runtimeTools: discovered, commands: [.
|
|
|
38
38
|
commands, and a connection without it still contributes nothing to the CLI —
|
|
39
39
|
exposure stays explicit, as it is everywhere else in the framework.
|
|
40
40
|
|
|
41
|
-
One unconvertible schema
|
|
41
|
+
One unconvertible schema does not take the connection down. The tool
|
|
42
42
|
is skipped and **named** (`onSkippedTool`, or a stderr line by default), so a
|
|
43
43
|
surface of two hundred tools is not lost to one.
|
|
44
44
|
|
|
@@ -71,13 +71,12 @@ credential, body, identity and stack stay with the original in-process cause in
|
|
|
71
71
|
Unknown throws remain `INTERNAL_SERVER_ERROR`. A timeout is not proof that a
|
|
72
72
|
write did not happen: verify the remote outcome before repeating an operation.
|
|
73
73
|
|
|
74
|
-
**A remote refusal keeps its code.** A failed `tools/call`
|
|
75
|
-
|
|
76
|
-
the
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
A structured `{ error, details }` body is now relayed as the contract error it
|
|
74
|
+
**A remote refusal keeps its code.** A failed `tools/call` must keep three things:
|
|
75
|
+
the code (so `exitCodes` can map it instead of every remote failure exiting `1`),
|
|
76
|
+
the message the operator needs, and the error's own class — a plain `Error` is
|
|
77
|
+
an *unexpected* error to the runner, which would print a code frame of the framework
|
|
78
|
+
bundle before the JSON failure and scrub it to `INTERNAL_SERVER_ERROR`.
|
|
79
|
+
A structured `{ error, details }` body is relayed as the contract error it
|
|
81
80
|
is, on every transport; anything else fails as `UPSTREAM_TOOL_ERROR` carrying
|
|
82
81
|
what the server did send. Not `INTERNAL_SERVER_ERROR`, because nothing of ours
|
|
83
82
|
broke.
|
|
@@ -172,7 +171,6 @@ SDK nor the `ai` peer.
|
|
|
172
171
|
| `checkCliUpdate` | function | bounded, interval-limited, never-throwing check for a newer published build |
|
|
173
172
|
| `applyCliUpdate` | function | download, verify the decompressed digest and replace the binary by rename |
|
|
174
173
|
| `assertCliPublishable` | function | refuse republishing one version from a different commit — takes one manifest or every manifest already published, because the promise a version makes does not stop at a channel boundary |
|
|
175
|
-
| `publishCli` / `CliPublicationOptions` / `CliPublicationPhase` / `CliPublicationResult` | function / _type_ | optional bounded builder/admission over one immutable name/version/commit stamp; commit verified assets before the manifest pointer, recover exact completed versions, retain verified history; existing signatures/installer/updater own the wire contract |
|
|
176
174
|
| `rollbackCliUpdate` / `CliRollbackConfig` / `RolledBackCliUpdate` | function / _types_ | put the kept previous build back, digest-checked first and written by the same atomic rename the update uses |
|
|
177
175
|
| `signCliManifest` / `verifyCliManifest` / `cliManifestSigningPayload` | function | Ed25519 over `{name, version, commit, builtAt, assets[]}` — every asset's digest included, so the chain closes on the file that executes |
|
|
178
176
|
| `cliSignatureAccepted` / `CliSignatureVerdict` | function / _type_ | `valid` \| `unenforced` \| `missing` \| `unknown-key` \| `invalid`; `unenforced` keeps an unpinned build updating while making the absence of a check visible |
|
|
@@ -204,8 +202,8 @@ SDK nor the `ai` peer.
|
|
|
204
202
|
| `CliConfig` | _type_ | config for `createCli`; `defaultCommand`, `globalOptions`, `optionAliases` and `positionals` define the shared command presentation policy |
|
|
205
203
|
| `CliPresentationPolicyConfig` | _type_ | shared command presentation-policy subset of `CliConfig` |
|
|
206
204
|
| `CliSurfaceSource` | _type_ | static service/runtime array or identity-dependent factory |
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
205
|
+
| `RuntimeToolDefinition` | _type_ | neutral heterogeneous runtime-tool registration; an inline handler is contextually typed, and handlers execute through the schema-validating managed runner |
|
|
206
|
+
| `RuntimeToolDefinitionWithOutput` | _type_ | strict neutral managed definition with schema-derived handler input/output, the same declaration `stitchkit/tools` constructs with presenters |
|
|
209
207
|
| `RuntimeToolDefinitionWithoutOutput` | _type_ | strict neutral managed void definition without an output contract or transport presenters |
|
|
210
208
|
| `CliCommandDefinition` | _type_ | native command definition union |
|
|
211
209
|
| `CliCommandDefinitionBase` | _type_ | native command name, description and input schema |
|
package/llms/cli.txt
CHANGED
|
@@ -33,9 +33,10 @@ declarations do not require `ai`, the MCP SDK or Bun globals. Node consumers can
|
|
|
33
33
|
use strict `NodeNext` resolution with `skipLibCheck: false` and ordinary Node
|
|
34
34
|
types; the package keeps its required dependencies separate from optional SDKs.
|
|
35
35
|
|
|
36
|
-
CLI runtime tools use the
|
|
37
|
-
schemas, handler, and explicit CLI exposure. SDK presenters
|
|
38
|
-
|
|
36
|
+
CLI runtime tools use the one runtime-tool declaration: identity, input and output
|
|
37
|
+
schemas, handler, and explicit CLI exposure. SDK presenters are the adapter's extension
|
|
38
|
+
of that declaration (the fourth type argument of `RuntimeToolDefinitionWithOutput`, or
|
|
39
|
+
`defineRuntimeTool` in `stitchkit/tools`), which requires the corresponding peers. A typed
|
|
39
40
|
definition returned by `defineRuntimeTool` or `createRuntimeToolFactory` can be
|
|
40
41
|
passed directly to both CLI and SDK mounts.
|
|
41
42
|
|
|
@@ -49,7 +50,7 @@ For a CLI-only managed tool, use the neutral generic construction contract to
|
|
|
49
50
|
infer the handler from its schemas:
|
|
50
51
|
|
|
51
52
|
```ts
|
|
52
|
-
import type {
|
|
53
|
+
import type { RuntimeToolDefinitionWithOutput } from 'stitchkit/cli'
|
|
53
54
|
import { z } from 'zod'
|
|
54
55
|
|
|
55
56
|
const input = z.object({ text: z.string() })
|
|
@@ -59,12 +60,14 @@ const measure = {
|
|
|
59
60
|
identity: { serviceName: 'text', action: 'measure', method: 'POST' },
|
|
60
61
|
transports: ['CLI'], input, output,
|
|
61
62
|
handler: ({ input }) => ({ size: input.text.length }),
|
|
62
|
-
} satisfies
|
|
63
|
+
} satisfies RuntimeToolDefinitionWithOutput<typeof input, typeof output>
|
|
63
64
|
```
|
|
64
65
|
|
|
65
|
-
Pass `measure` to `runtimeTools`.
|
|
66
|
-
|
|
67
|
-
`
|
|
66
|
+
Pass `measure` to `runtimeTools`. `RuntimeToolDefinition`, the heterogeneous
|
|
67
|
+
registration type, accepts it unchanged, and types an inline handler written directly
|
|
68
|
+
in `runtimeTools` by the parsed object (use the construction type above to type the
|
|
69
|
+
input from the schema). Execute it through `createCli` or `createCliInvoker` so
|
|
70
|
+
validation remains on the canonical path.
|
|
68
71
|
|
|
69
72
|
## Exposure is opt-in
|
|
70
73
|
|
|
@@ -254,7 +257,9 @@ the values agree. Duplicates are refused before command execution. Array
|
|
|
254
257
|
options accumulate across long and short forms; unknown non-dotted passthrough
|
|
255
258
|
options retain their raw-list grammar. Tokens after `--` are literal data.
|
|
256
259
|
Command `--help` and `-h` keep their diagnostic precedence over malformed
|
|
257
|
-
operation arguments; application globals are validated before routing.
|
|
260
|
+
operation arguments; application globals are validated before routing. Help is a
|
|
261
|
+
request, not a setting, so repeating it in any spelling (`-h -h`, `-h --help`) asks once
|
|
262
|
+
and never errors.
|
|
258
263
|
|
|
259
264
|
Without presentation configuration, positional arguments fill non-boolean
|
|
260
265
|
fields in declaration order, so `myapp generate "a fox"` is
|
|
@@ -481,8 +486,10 @@ Declared aliases render beside their canonical options, for example
|
|
|
481
486
|
The argument table and `Application options:` show bounds from their JSON Schema,
|
|
482
487
|
for example `<integer> [>=1, <=50]`, `<string> [length >=1, length <=12]`, and
|
|
483
488
|
`<value…> [items >=2, items <=4]`. Numeric `>` and `<` are exclusive, while `>=`
|
|
484
|
-
and `<=` include the endpoint; a zero limit is displayed too.
|
|
485
|
-
|
|
489
|
+
and `<=` include the endpoint; a zero limit is displayed too. Only limits the
|
|
490
|
+
schema declares are shown: the safe-integer range every `z.int()` carries is the
|
|
491
|
+
type, not a bound, so a bare integer prints `<integer>`, `.min(1)` prints `>=1` and
|
|
492
|
+
`.positive()` prints `>0`. Unbounded fields keep just their type and description. Bounds on an array's items are not bounds
|
|
486
493
|
on the array itself.
|
|
487
494
|
|
|
488
495
|
Composed schemas retain their meaning: `any of:` and `one of:` separate
|
|
@@ -710,11 +717,16 @@ exists to distrust.
|
|
|
710
717
|
|
|
711
718
|
`publishCli` is an opt-in publisher for a local application-owned distribution
|
|
712
719
|
directory. It commits every target and its version manifest before atomically
|
|
713
|
-
replacing the public `manifest.json`.
|
|
714
|
-
|
|
720
|
+
replacing the public `manifest.json`. It ships from its own evolving entrypoint,
|
|
721
|
+
`stitchkit/cli/publish`: release infrastructure follows how distributions are
|
|
722
|
+
published, so it is not held to the stable promise of `stitchkit/cli`
|
|
723
|
+
([ADR 0245](../decisions/0245-cli-publication-is-an-evolving-leaf.md)). The
|
|
724
|
+
manifest, signatures, installer and updater it writes for stay in
|
|
725
|
+
`stitchkit/cli`. Your application selects the CLI source identity and admits
|
|
726
|
+
that snapshot at each phase:
|
|
715
727
|
|
|
716
728
|
```ts
|
|
717
|
-
import { publishCli } from 'stitchkit/cli'
|
|
729
|
+
import { publishCli } from 'stitchkit/cli/publish'
|
|
718
730
|
|
|
719
731
|
const result = await publishCli({
|
|
720
732
|
storageRoot: '/srv/myapp/cli',
|
package/llms/declaration.txt
CHANGED
|
@@ -9,15 +9,6 @@ Contains: Guide: Project declaration (docs/guide/declaration.md) · API referen
|
|
|
9
9
|
# Guide: Project declaration (docs/guide/declaration.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
-
---
|
|
13
|
-
title: Project declaration
|
|
14
|
-
description: One machine-readable statement a repository makes about itself — identity, roles, build, requirements, release steps and the names of the values a deployment supplies.
|
|
15
|
-
type: architecture
|
|
16
|
-
status: active
|
|
17
|
-
created: 2026-08-25
|
|
18
|
-
updated: 2026-08-30
|
|
19
|
-
---
|
|
20
|
-
|
|
21
12
|
# Project declaration
|
|
22
13
|
|
|
23
14
|
> **Maturity: evolving.** This surface is still finding its shape and may be
|
package/llms/files-packaging.txt
CHANGED
|
@@ -16,19 +16,29 @@ Also read:
|
|
|
16
16
|
|
|
17
17
|
`stitchkit/files/packaging` owns `createNativePackaging` and the types
|
|
18
18
|
`NativePackagingOptions`, `NativePackagingAsset`, `NativePackagingPlugin`, `NativePackagingResult`.
|
|
19
|
-
It resolves the installed package's target/version
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
It resolves the installed package's target/version, reads each selected addon once and checks it
|
|
20
|
+
against the `size` and `sha256` published in the package's `native-assets.json` (`formatVersion: 2`,
|
|
21
|
+
written when Stitchkit is built). Call it once per build and reuse the result.
|
|
22
|
+
`platform`, `architecture`, `delivery`, `entryPath` and `assetPath` are explicit public inputs;
|
|
23
|
+
`assetPath` accepts one template, `[hash]`, replaced by the first 16 hex digits of the addon's
|
|
24
|
+
published SHA256;
|
|
25
|
+
`platform` is the closed set `'darwin'`, and another name is a type error and a schema refusal.
|
|
26
|
+
The result is `ready` with verified assets and a structural Bun plugin, or `unsupported` /
|
|
27
|
+
`missing` / `mismatch` with the safe code `NATIVE_TARGET_UNSUPPORTED`, `NATIVE_ASSET_MISSING` or
|
|
28
|
+
`NATIVE_ASSET_DIGEST_MISMATCH`. A `mismatch` names the first differing `architecture` with
|
|
29
|
+
`expected` (published) and `actual` (installed) `{ size, sha256 }`.
|
|
30
|
+
Malformed options, a manifest of another `formatVersion` and other filesystem errors throw rather
|
|
31
|
+
than masquerade as missing.
|
|
23
32
|
Companion accepts a single `architecture` string with an `assetPath` string, or an architecture
|
|
24
33
|
array with an exact per-architecture `assetPath` map. `NativePackagingOptions<true>` and
|
|
25
34
|
`NativePackagingResult<true>` describe the array form; default types preserve single-target signatures.
|
|
26
35
|
A ready array-form result carries the architecture array; `NativePackagingAsset<true>` identifies
|
|
27
|
-
each asset architecture.
|
|
36
|
+
each asset architecture. A single-target asset has four fields: `outputPath`, the verified `bytes`,
|
|
37
|
+
and the published `size` and `sha256`.
|
|
28
38
|
Targets must be unique; entry and all asset paths must be disjoint. One lazy loader chooses only
|
|
29
39
|
the actual runtime architecture, with no fallback.
|
|
30
|
-
Companion mode places external addons relative to the emitted entry; embedded mode
|
|
31
|
-
Bun compile
|
|
32
|
-
and
|
|
40
|
+
Companion mode places external addons relative to the emitted entry; embedded mode gives
|
|
41
|
+
Bun compile the verified bytes of the matching addon. Keep JS builds without splitting, preserve
|
|
42
|
+
every output, and write each asset's `bytes` to its `outputPath`.
|
|
33
43
|
This evolving entrypoint is a build dependency; runtime imports do not reach it.
|
|
34
44
|
The detailed recipe is in [native IO](../guide/native-io.md#public-native-packaging).
|
package/llms/files.txt
CHANGED
|
@@ -29,8 +29,10 @@ available from `stitchkit/contract`.
|
|
|
29
29
|
| `ManagedFileError` / `ManagedFileErrorCode` | class / _type_ | stable boundary failures; registered `FILE_*` mistakes are caller-safe while `FILE_IO_ERROR` remains internal |
|
|
30
30
|
| `ManagedFileInspector` | _type_ | bounded-prefix read/write inspection callback with a finite cancellation signal that cannot own path or size |
|
|
31
31
|
| `ManagedFileInspectionInput` / `ManagedFileInspection` | _type_ | inspector prefix/name/declared media/signal input and validated metadata-only result |
|
|
32
|
-
| `writeFileAtomic` / `writeFileAtomicSync` / `WriteFileAtomicOptions` | function / _type_ | replace a file atomically: a random staging name created exclusively (never through a planted link), the mode set on the descriptor before the file is visible (default `0o600`, not masked by the umask), `fsync`, rename; a failure leaves the target and no staging file. The asynchronous form keeps the event loop running |
|
|
33
|
-
| `
|
|
32
|
+
| `writeFileAtomic` / `writeFileAtomicSync` / `WriteFileAtomicOptions` | function / _type_ | replace a file atomically: a random staging name created exclusively (never through a planted link), the mode set on the descriptor before the file is visible (default `0o600`, not masked by the umask), `fsync`, rename; a failure leaves the target and no staging file. The asynchronous form keeps the event loop running. A process killed before publication leaves its staging file; sweeping it is the caller's job |
|
|
33
|
+
| `isAtomicStagingName` | function | true for a staging file name of an atomic write of this library (`.stitchkit-<24 lowercase hex>.tmp`, also used by the managed writer and the chunk spool); the form is a stable contract, and changing it is a breaking change ([ADR 0242](../decisions/0242-atomic-staging-name-is-a-public-contract.md)) |
|
|
34
|
+
| `sweepAtomicStaging` / `SweepAtomicStagingOptions` | function / _type_ | remove abandoned staging files from one `directory`: only regular files matching `isAtomicStagingName` and older than the required `olderThanMs`, never following a symlink or entering a subdirectory; stops on `signal`; returns the removed names, `[]` for a `directory` that does not exist |
|
|
35
|
+
| `withExclusiveLock` / `ExclusiveLockOptions` / `ExclusiveLock` / `ExclusiveLockOwner` | function / _type_ | run work under an exclusive lock between processes — a file recording its owner (pid, host, machine identity, time and nullable kernel process identity); waits up to `timeoutMs` (default 10 s) and stops on `signal`; a dead owner on this machine is taken over, a live, slow or foreign one never is; the lock is published with its owner already recorded (temporary file plus hard link), so a stalled holder is never displaced; a legacy empty lock file is taken by age only when `ownerlessGraceMs` is a number (default `null`: never; an abandoned empty reclaim guard is taken after 5 000 ms unless a value is set); exact `mode` is independent of umask; shared readers need a common group and traversable directories |
|
|
34
36
|
| `ExclusiveLockError` | class | `LOCK_TIMEOUT` naming the resource and its holder, or `LOCK_ABORTED` with the signal's reason |
|
|
35
37
|
| `createChunkSpool` | function | the server half of a chunked upload: parts on disk under `owner` + client-minted `uploadId`, each with a size+sha256 receipt; idempotent `open` and `put`, the first writer of a part wins across processes, `assemble` in order once every part is in, `sweep` of untouched uploads — [guide](../guide/client.md#chunked-uploads) |
|
|
36
38
|
| `ChunkSpool` / `ChunkSpoolConfig` / `ChunkSpoolKey` / `ChunkSpoolOpen` / `ChunkSpoolPart` / `ChunkSpoolAssembly` | _type_ | the spool, its directory, part size, file limit, meta schema and age; an upload's key; its declaration; one part; the assembled parts with a concatenating `stream()` |
|
package/llms/geo.txt
CHANGED
|
@@ -9,15 +9,6 @@ Contains: Guide: GeoIP (docs/guide/geo.md) · API reference: `stitchkit/geo` (
|
|
|
9
9
|
# Guide: GeoIP (docs/guide/geo.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
-
---
|
|
13
|
-
title: GeoIP
|
|
14
|
-
description: A server-only managed GeoIP reader with three observable states and last-known-good generation reloads.
|
|
15
|
-
type: guide
|
|
16
|
-
status: active
|
|
17
|
-
created: 2026-09-06
|
|
18
|
-
updated: 2026-09-06
|
|
19
|
-
---
|
|
20
|
-
|
|
21
12
|
# GeoIP
|
|
22
13
|
|
|
23
14
|
`stitchkit/geo` is a server-only, evolving entrypoint for reading local GeoIP
|
package/llms/live.txt
CHANGED
|
@@ -9,15 +9,6 @@ Contains: Guide: Live data (docs/guide/live.md) · API reference: `stitchkit/li
|
|
|
9
9
|
# Guide: Live data (docs/guide/live.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
-
---
|
|
13
|
-
title: Live data — announcements, watched reads, keyspaces and the trust fence
|
|
14
|
-
description: How to declare events beside the operation contract, share one server-side read between every browser asking the same question, keep authoritative memory in front of a durable backend, and refuse a request whose authority you never agreed to answer on.
|
|
15
|
-
type: guide
|
|
16
|
-
status: active
|
|
17
|
-
created: 2026-09-02
|
|
18
|
-
updated: 2026-09-02
|
|
19
|
-
---
|
|
20
|
-
|
|
21
12
|
# Live data
|
|
22
13
|
|
|
23
14
|
Four things an application builds by hand the second time it needs them.
|
|
@@ -429,11 +420,11 @@ Every refusal answers the same bare 403. A response that said *which* rule
|
|
|
429
420
|
refused would let a caller learn your trusted list one guess at a time; the
|
|
430
421
|
reason goes to `onRefused` and the log, where you are.
|
|
431
422
|
|
|
432
|
-
###
|
|
423
|
+
### Group hooks
|
|
433
424
|
|
|
434
|
-
A route group
|
|
435
|
-
|
|
436
|
-
|
|
425
|
+
A route group cannot declare `onRequest`: the framework dispatches only the
|
|
426
|
+
server-level hook, and a group hook would need group prefixes matched a second
|
|
427
|
+
time, ahead of the real router. Use the
|
|
437
428
|
server-level `hooks.onRequest` to refuse before dispatch, or the group's
|
|
438
429
|
`authorize` to gate once the endpoint is known.
|
|
439
430
|
|
package/llms/observability.txt
CHANGED
|
@@ -303,6 +303,32 @@ Without an `observability` the work still runs inside a context, so trace ids,
|
|
|
303
303
|
decision from having a context. `traceparent` continues the trace of whatever
|
|
304
304
|
scheduled the work, instead of starting an unrelated one.
|
|
305
305
|
|
|
306
|
+
### CPU is not attributed to work
|
|
307
|
+
|
|
308
|
+
Request rows, `runUnitOfWork` rows and schedule status carry durations and
|
|
309
|
+
counts, never CPU. One JavaScript thread interleaves every operation, so a
|
|
310
|
+
`process.cpuUsage()` delta across an operation's start and end measures
|
|
311
|
+
everything the process ran in that time — a long wait reads as the CPU of the
|
|
312
|
+
timers that fired during it. The correct basis is the synchronous segment, and
|
|
313
|
+
Bun gives no callback when a continuation is entered or left
|
|
314
|
+
([ADR 0244](../decisions/0244-cpu-is-not-attributed-to-operations.md)).
|
|
315
|
+
|
|
316
|
+
Process CPU per window is the number you can observe:
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
let last = process.cpuUsage()
|
|
320
|
+
setInterval(() => {
|
|
321
|
+
const now = process.cpuUsage() // cumulative { user, system } in µs
|
|
322
|
+
logger.info('cpu', { cpuUserUs: now.user - last.user, cpuSystemUs: now.system - last.system })
|
|
323
|
+
last = now
|
|
324
|
+
}, 60_000)
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
If you build attribution yourself: credit an operation only the CPU of the
|
|
328
|
+
synchronous segments it ran, never its waiting time; put everything outside those
|
|
329
|
+
segments into `unattributed`; never credit a window to the one operation in
|
|
330
|
+
flight — that operation is usually the one waiting.
|
|
331
|
+
|
|
306
332
|
### Write the calls that changed something
|
|
307
333
|
|
|
308
334
|
`auditChanges` is the filter most projects end up writing, shipped so they do not
|
|
@@ -377,8 +403,8 @@ needed:
|
|
|
377
403
|
createServer({ services, logging, observability: observability.request })
|
|
378
404
|
```
|
|
379
405
|
|
|
380
|
-
`wrapInRequestContext`
|
|
381
|
-
|
|
406
|
+
`wrapInRequestContext` serves a custom fetch pipeline that does not use
|
|
407
|
+
`createHandler`; built-in HTTP audit wiring does not use it:
|
|
382
408
|
|
|
383
409
|
```ts
|
|
384
410
|
Bun.serve({ fetch: wrapInRequestContext(customFetch) })
|
|
@@ -715,9 +741,9 @@ which the built-in **tool** row does not read: a tool event takes
|
|
|
715
741
|
`errorCode` / `errorMessage` / `errorDetail` from the `ToolResult`, and only
|
|
716
742
|
identity and `dimensions` from the context. Calling it in `onToolError` would
|
|
717
743
|
leave the tool row exactly as scrubbed as before. It is right for the **HTTP**
|
|
718
|
-
path, where the request *is* the record. (
|
|
719
|
-
|
|
720
|
-
|
|
744
|
+
path, where the request *is* the record. (A tool call runs in its own context, ADR 0045,
|
|
745
|
+
so it cannot write into the enclosing `/mcp` request's row either — the call is
|
|
746
|
+
simply not where that helper belongs.)
|
|
721
747
|
|
|
722
748
|
### One row that names the cause
|
|
723
749
|
|
package/llms/primitives.txt
CHANGED
|
@@ -9,15 +9,6 @@ Contains: Guide: Generic application primitives (docs/guide/primitives.md) · A
|
|
|
9
9
|
# Guide: Generic application primitives (docs/guide/primitives.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
-
---
|
|
13
|
-
title: Generic application primitives
|
|
14
|
-
description: Declare lifecycle, access, exact values, audit, delivery and exports without moving application infrastructure into Stitchkit.
|
|
15
|
-
type: guide
|
|
16
|
-
status: active
|
|
17
|
-
created: 2026-09-01
|
|
18
|
-
updated: 2026-10-01 21:03 +07:00
|
|
19
|
-
---
|
|
20
|
-
|
|
21
12
|
# Generic application primitives
|
|
22
13
|
|
|
23
14
|
`stitchkit/primitives` is an optional browser-safe leaf. It declares values and policies; it does
|
|
@@ -120,18 +111,44 @@ const bytes = canonicalJson({ '2': 'two', '10': 'ten', optional: undefined, nest
|
|
|
120
111
|
// Native crypto or browser WebCrypto hashes these same UTF-8 bytes.
|
|
121
112
|
```
|
|
122
113
|
|
|
123
|
-
`canonicalJson`
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
negative zero, cycles, user prototypes, accessors
|
|
127
|
-
|
|
114
|
+
`canonicalJson` is the one serializer behind the digests: object keys sort by UTF-16 code unit,
|
|
115
|
+
integer-like keys included; array order is kept; object members that are `undefined` are omitted.
|
|
116
|
+
It refuses, before serializing, a top-level or array `undefined`, sparse arrays, functions, symbols,
|
|
117
|
+
BigInt, non-finite numbers, negative zero, cycles, user prototypes, accessors and non-enumerable or
|
|
118
|
+
symbol members. Validate your own schema first; the canonical boundary does not replace it.
|
|
119
|
+
|
|
120
|
+
Defaults: depth 100 (the maximum), nodes 100 000, UTF-8 bytes 1 MiB. Invalid options throw a Zod
|
|
121
|
+
validation error. A refused value throws `CanonicalJsonError`, a `TypeError` whose `reason` is a
|
|
122
|
+
`CanonicalJsonRefusal`; branch on the reason, never on the message:
|
|
123
|
+
|
|
124
|
+
| `reason` | Meaning |
|
|
125
|
+
|---|---|
|
|
126
|
+
| `depth` | The value is nested deeper than `maxDepth`. |
|
|
127
|
+
| `nodes` | The value has more nodes than `maxNodes`. |
|
|
128
|
+
| `bytes` | The output is longer than `maxBytes` in UTF-8. |
|
|
129
|
+
| `cycle` | The value contains a cycle. |
|
|
130
|
+
| `negative-zero` | The value contains `-0`, which JSON cannot carry. |
|
|
131
|
+
| `not-json` | The value is not bounded plain JSON: sparse arrays, non-finite numbers, non-plain objects, accessors. |
|
|
132
|
+
|
|
133
|
+
`depth`, `nodes` and `bytes` are the caller's limits being exceeded; the other three say the value is
|
|
134
|
+
not JSON data at all.
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { CanonicalJsonError, canonicalJson } from 'stitchkit/primitives'
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
canonicalJson(payload, { maxBytes: 4096 })
|
|
141
|
+
} catch (error) {
|
|
142
|
+
if (error instanceof CanonicalJsonError && error.reason === 'bytes') {
|
|
143
|
+
// too large: reject the request
|
|
144
|
+
} else throw error
|
|
145
|
+
}
|
|
146
|
+
```
|
|
128
147
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
verification boundary. Существующие внутренние historical normalization/digest fixtures не меняются;
|
|
134
|
-
новый public boundary сознательно отказывает неоднозначным values вместо фиктивной совместимости.
|
|
148
|
+
The leaf is browser-safe: no Node, Bun or crypto, no `agent-runtime/testing`, no optional peers. Native
|
|
149
|
+
and browser code run the same algorithm; hashing stays a platform adapter. A consumer that needs the
|
|
150
|
+
same bytes moves only the serializer recursion and keeps its own proof schemas and verification
|
|
151
|
+
boundary.
|
|
135
152
|
|
|
136
153
|
==============================================================================
|
|
137
154
|
# API reference: `stitchkit/primitives` (docs/api/reference.md)
|
|
@@ -186,3 +203,4 @@ schedules, transports and file generation remain application-owned.
|
|
|
186
203
|
|---|---|---|
|
|
187
204
|
| `canonicalJson` | function | bounded plain JSON, UTF-16 key sort, optional object members omitted |
|
|
188
205
|
| `CanonicalJsonOptions` | type | inferred depth/node/UTF-8 bytes limits |
|
|
206
|
+
| `CanonicalJsonError` / `CanonicalJsonRefusal` | class / _type_ | the `TypeError` of a refusal and its `reason`: `cycle`, `negative-zero`, `depth`, `nodes`, `bytes` or `not-json` |
|