stitchkit 0.104.1 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +381 -12
- 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 +196 -56
- 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 +104 -21
- 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-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-269zqj8m.js → index-2rc6jd9n.js} +28 -12
- 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-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-g2j7pnak.js → index-cmzvhhtd.js} +5 -2
- package/dist/index-cq59agna.js +51 -0
- package/dist/{index-ssmd41kh.js → index-d2h99n7d.js} +1 -1
- package/dist/{index-z94wht4y.js → index-dky0dcmf.js} +34 -5
- package/dist/{index-za6j7nwy.js → index-dsnjzb62.js} +104 -51
- package/dist/index-eemvahkc.js +21 -0
- package/dist/index-ef8gdaq0.js +105 -0
- package/dist/{index-fa4wg312.js → index-f199nfq5.js} +10 -6
- package/dist/{index-ck71tbcf.js → index-fsw1ybf3.js} +11 -15
- package/dist/{index-f330qqyg.js → index-g2vfg7ak.js} +217 -63
- package/dist/{index-fk18k56k.js → index-gr5g3xfw.js} +11 -18
- package/dist/{index-jn9g8xdt.js → index-hjvje0pf.js} +6 -4
- 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-ptn0g0gj.js → index-ma963wz7.js} +21 -20
- 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-szybbezc.js +455 -0
- package/dist/{index-2hyavjjj.js → index-wbhdzxar.js} +3 -3
- package/dist/{index-4e0ah203.js → index-wdy68sh6.js} +47 -24
- package/dist/{index-hbd32c6a.js → index-wqmvtnkp.js} +38 -89
- package/dist/{index-hp9d77wk.js → index-x7w1z6pf.js} +15 -4
- 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 +46 -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 +6 -1
- package/dist/process/cleanup.d.ts.map +1 -1
- package/dist/process/command-lifetime.d.ts +4 -0
- package/dist/process/command-lifetime.d.ts.map +1 -1
- 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 +67 -2
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/process/group.d.ts +40 -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 +39 -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 +22 -7
- 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 +305 -154
- 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 +1053 -405
- 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,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_TIMER_MS
|
|
3
|
+
} from "./index-eemvahkc.js";
|
|
4
|
+
import {
|
|
5
|
+
assertPositiveSafeInteger
|
|
6
|
+
} from "./index-0s4xebbg.js";
|
|
7
|
+
|
|
8
|
+
// src/internal/deadline.ts
|
|
9
|
+
async function withDeadline(value, timeoutMs) {
|
|
10
|
+
if (!(value instanceof Promise))
|
|
11
|
+
return { settled: true, value };
|
|
12
|
+
let timer;
|
|
13
|
+
const expiry = new Promise((resolve) => {
|
|
14
|
+
timer = setTimeout(() => resolve({ settled: false }), timeoutMs);
|
|
15
|
+
});
|
|
16
|
+
try {
|
|
17
|
+
return await Promise.race([
|
|
18
|
+
value.then((settledValue) => ({
|
|
19
|
+
settled: true,
|
|
20
|
+
value: settledValue
|
|
21
|
+
})),
|
|
22
|
+
expiry
|
|
23
|
+
]);
|
|
24
|
+
} finally {
|
|
25
|
+
if (timer !== undefined)
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function withSignalDeadline(timeoutMs, caller, makeReason, body) {
|
|
30
|
+
assertPositiveSafeInteger("Deadline timeoutMs", timeoutMs, RangeError);
|
|
31
|
+
if (timeoutMs > MAX_TIMER_MS)
|
|
32
|
+
throw new RangeError("Deadline timeoutMs exceeds the timer range");
|
|
33
|
+
caller?.throwIfAborted();
|
|
34
|
+
const deadline = new AbortController;
|
|
35
|
+
const timer = setTimeout(() => deadline.abort(makeReason()), timeoutMs);
|
|
36
|
+
const signal = caller ? AbortSignal.any([caller, deadline.signal]) : deadline.signal;
|
|
37
|
+
try {
|
|
38
|
+
return await body(signal);
|
|
39
|
+
} finally {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { withDeadline, withSignalDeadline };
|
|
@@ -87,8 +87,9 @@ var ProcessInstanceObservationSchema = z.discriminatedUnion("state", [
|
|
|
87
87
|
z.object({ state: z.literal("observed"), instance: ProcessInstanceSchema2 }),
|
|
88
88
|
z.object({ state: z.literal("unavailable"), cause: z.unknown() })
|
|
89
89
|
]);
|
|
90
|
+
var MAX_PID = 2 ** 31 - 1;
|
|
90
91
|
async function observeProcessInstance2(pid) {
|
|
91
|
-
z.number().int().positive().max(
|
|
92
|
+
z.number().int().positive().max(MAX_PID).parse(pid);
|
|
92
93
|
return observeProcessInstanceAt(pid, "/proc");
|
|
93
94
|
}
|
|
94
95
|
function linuxProcessStart(stat, pid) {
|
|
@@ -158,7 +159,7 @@ var ProcessOwnerEvidenceSchema = z.object({
|
|
|
158
159
|
cause: z.unknown().optional()
|
|
159
160
|
});
|
|
160
161
|
async function probeProcessOwner2(pid, recorded) {
|
|
161
|
-
z.number().int().positive().max(
|
|
162
|
+
z.number().int().positive().max(MAX_PID).parse(pid);
|
|
162
163
|
if (recorded != null)
|
|
163
164
|
ProcessInstanceSchema2.parse(recorded);
|
|
164
165
|
return probeProcessOwnerWith(pid, recorded, {
|
|
@@ -203,7 +204,7 @@ async function probeProcessOwnerWith(pid, recorded, probes = { read: readProcess
|
|
|
203
204
|
if (observation.state === "unavailable")
|
|
204
205
|
return unavailable(observation.cause);
|
|
205
206
|
const observed = observation.instance;
|
|
206
|
-
if (
|
|
207
|
+
if (observed.bootId !== current.bootId || observed.namespace !== current.namespace)
|
|
207
208
|
return unavailable(new Error("Observed boot or namespace changed during probe"));
|
|
208
209
|
if (recorded.startId !== observed.startId)
|
|
209
210
|
return { liveness: "gone", identity: "reused-pid" };
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
// src/internal/abort-race.ts
|
|
2
|
-
function raceAbort(operation, signal) {
|
|
2
|
+
function raceAbort(operation, signal, disposeLate) {
|
|
3
|
+
const dispose = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
disposeLate?.(value);
|
|
6
|
+
} catch {}
|
|
7
|
+
};
|
|
3
8
|
if (signal.aborted) {
|
|
4
|
-
operation.
|
|
9
|
+
operation.then(dispose, () => {
|
|
5
10
|
return;
|
|
6
11
|
});
|
|
7
12
|
return Promise.reject(signal.reason);
|
|
8
13
|
}
|
|
9
14
|
return new Promise((resolve, reject) => {
|
|
15
|
+
let released = false;
|
|
10
16
|
const abort = () => {
|
|
11
|
-
|
|
17
|
+
released = true;
|
|
12
18
|
reject(signal.reason);
|
|
13
19
|
};
|
|
14
20
|
signal.addEventListener("abort", abort, { once: true });
|
|
15
21
|
operation.then((value) => {
|
|
16
22
|
signal.removeEventListener("abort", abort);
|
|
17
|
-
|
|
23
|
+
if (released)
|
|
24
|
+
dispose(value);
|
|
25
|
+
else
|
|
26
|
+
resolve(value);
|
|
18
27
|
}, (error) => {
|
|
19
28
|
signal.removeEventListener("abort", abort);
|
|
20
|
-
|
|
29
|
+
if (!released)
|
|
30
|
+
reject(error);
|
|
21
31
|
});
|
|
22
32
|
});
|
|
23
33
|
}
|
|
@@ -46,6 +46,22 @@ var AgentControlRequestSchema2 = z.discriminatedUnion("operation", [
|
|
|
46
46
|
metadata: z.unknown().optional()
|
|
47
47
|
})
|
|
48
48
|
]);
|
|
49
|
+
var AgentControlErrorCodeSchema2 = z.enum([
|
|
50
|
+
"ATTACH_CANCELLED",
|
|
51
|
+
"ATTACH_IN_PROGRESS",
|
|
52
|
+
"ATTACHMENT_CAPACITY",
|
|
53
|
+
"CONNECTION_CLOSED",
|
|
54
|
+
"CONTROL_REQUEST_FAILED",
|
|
55
|
+
"EVENT_OVERFLOW",
|
|
56
|
+
"FORBIDDEN",
|
|
57
|
+
"LEASE_CONFLICT",
|
|
58
|
+
"LEASE_REQUIRED",
|
|
59
|
+
"NOT_ATTACHED",
|
|
60
|
+
"REQUEST_CANCELLED",
|
|
61
|
+
"REQUEST_CAPACITY",
|
|
62
|
+
"REQUEST_REJECTED",
|
|
63
|
+
"RESYNC_EXHAUSTED"
|
|
64
|
+
]);
|
|
49
65
|
var AgentControlResponseIdentitySchema = z.object({
|
|
50
66
|
schemaVersion: z.literal(1),
|
|
51
67
|
requestId: z.string().min(1)
|
|
@@ -58,7 +74,7 @@ var AgentControlResponseSchema2 = z.discriminatedUnion("outcome", [
|
|
|
58
74
|
}).strict(),
|
|
59
75
|
AgentControlResponseIdentitySchema.extend({
|
|
60
76
|
outcome: z.literal("error"),
|
|
61
|
-
error: z.object({ code:
|
|
77
|
+
error: z.object({ code: AgentControlErrorCodeSchema2, message: z.string().min(1) }).strict()
|
|
62
78
|
}).strict()
|
|
63
79
|
]);
|
|
64
80
|
var AgentControlDeliverySchema2 = z.discriminatedUnion("type", [
|
|
@@ -72,6 +88,11 @@ var AgentControlDeliverySchema2 = z.discriminatedUnion("type", [
|
|
|
72
88
|
type: z.literal("resync-required"),
|
|
73
89
|
conversationId: z.string().min(1),
|
|
74
90
|
reason: z.literal("overflow")
|
|
91
|
+
}).strict(),
|
|
92
|
+
z.object({
|
|
93
|
+
schemaVersion: z.literal(1),
|
|
94
|
+
type: z.literal("access-denied"),
|
|
95
|
+
conversationId: z.string().min(1)
|
|
75
96
|
}).strict()
|
|
76
97
|
]);
|
|
77
98
|
var AgentMultiSessionCursorSchema2 = z.object({
|
|
@@ -195,4 +216,4 @@ function reduceAgentControlEvent2(view, rawEvent) {
|
|
|
195
216
|
};
|
|
196
217
|
}
|
|
197
218
|
|
|
198
|
-
export { AgentControlRequestSchema2, AgentControlResponseSchema2, AgentControlDeliverySchema2, AgentMultiSessionCursorSchema2, advanceAgentMultiSessionCursor2, createAgentControlView2, reduceAgentControlSnapshot2, reduceAgentControlEvent2 };
|
|
219
|
+
export { AgentControlRequestSchema2, AgentControlErrorCodeSchema2, AgentControlResponseSchema2, AgentControlDeliverySchema2, AgentMultiSessionCursorSchema2, advanceAgentMultiSessionCursor2, createAgentControlView2, reduceAgentControlSnapshot2, reduceAgentControlEvent2 };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// src/internal/atomic-publication.ts
|
|
2
|
+
import { closeSync, fsyncSync, linkSync, openSync, renameSync, unlinkSync } from "node:fs";
|
|
3
|
+
import { link, open, rename, unlink } from "node:fs/promises";
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
|
+
|
|
6
|
+
// src/internal/close-after.ts
|
|
7
|
+
async function closeAfter(handle, run) {
|
|
8
|
+
let result;
|
|
9
|
+
try {
|
|
10
|
+
result = await run();
|
|
11
|
+
} catch (error) {
|
|
12
|
+
await handle.close().catch(() => {
|
|
13
|
+
return;
|
|
14
|
+
});
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
await handle.close();
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
function closeAfterSync(close, run) {
|
|
21
|
+
let result;
|
|
22
|
+
try {
|
|
23
|
+
result = run();
|
|
24
|
+
} catch (error) {
|
|
25
|
+
try {
|
|
26
|
+
close();
|
|
27
|
+
} catch {}
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
close();
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/internal/atomic-publication.ts
|
|
35
|
+
class AtomicFilePublicationError2 extends Error {
|
|
36
|
+
phase;
|
|
37
|
+
published = true;
|
|
38
|
+
constructor(phase, cause) {
|
|
39
|
+
super(`File published but ${phase} failed`, { cause });
|
|
40
|
+
this.phase = phase;
|
|
41
|
+
this.name = "AtomicFilePublicationError";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var native = { rename, link, unlink, open };
|
|
45
|
+
var nativeSync = {
|
|
46
|
+
rename: renameSync,
|
|
47
|
+
link: linkSync,
|
|
48
|
+
unlink: unlinkSync,
|
|
49
|
+
open(path, flags) {
|
|
50
|
+
const descriptor = openSync(path, flags);
|
|
51
|
+
return { sync: () => fsyncSync(descriptor), close: () => closeSync(descriptor) };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
function assertDirectoryDurability() {
|
|
55
|
+
if (process.platform === "win32")
|
|
56
|
+
throw new Error("Directory durability is unsupported on Windows");
|
|
57
|
+
}
|
|
58
|
+
async function syncDirectory(path, io = native) {
|
|
59
|
+
assertDirectoryDurability();
|
|
60
|
+
const directory = await io.open(path, "r");
|
|
61
|
+
await closeAfter(directory, () => directory.sync());
|
|
62
|
+
}
|
|
63
|
+
async function publishAtomicFile(staged, target, { replace, durability }, io = native) {
|
|
64
|
+
const directorySync = durability === "directory";
|
|
65
|
+
if (directorySync)
|
|
66
|
+
assertDirectoryDurability();
|
|
67
|
+
const directory = directorySync ? await io.open(dirname(target), "r") : undefined;
|
|
68
|
+
const publish = async () => {
|
|
69
|
+
if (replace)
|
|
70
|
+
await io.rename(staged, target);
|
|
71
|
+
else {
|
|
72
|
+
await io.link(staged, target);
|
|
73
|
+
try {
|
|
74
|
+
await io.unlink(staged);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
throw new AtomicFilePublicationError2("cleanup", error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
await directory?.sync();
|
|
81
|
+
} catch (error) {
|
|
82
|
+
throw new AtomicFilePublicationError2("directory-sync", error);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
if (directory === undefined)
|
|
86
|
+
return publish();
|
|
87
|
+
await closeAfter({
|
|
88
|
+
close: async () => {
|
|
89
|
+
try {
|
|
90
|
+
await directory.close();
|
|
91
|
+
} catch (error) {
|
|
92
|
+
throw new AtomicFilePublicationError2("directory-close", error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}, publish);
|
|
96
|
+
}
|
|
97
|
+
function publishAtomicFileSync(staged, target, { replace, durability }, io = nativeSync) {
|
|
98
|
+
const directorySync = durability === "directory";
|
|
99
|
+
if (directorySync)
|
|
100
|
+
assertDirectoryDurability();
|
|
101
|
+
const directory = directorySync ? io.open(dirname(target), "r") : undefined;
|
|
102
|
+
const publish = () => {
|
|
103
|
+
if (replace)
|
|
104
|
+
io.rename(staged, target);
|
|
105
|
+
else {
|
|
106
|
+
io.link(staged, target);
|
|
107
|
+
try {
|
|
108
|
+
io.unlink(staged);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
throw new AtomicFilePublicationError2("cleanup", error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
directory?.sync();
|
|
115
|
+
} catch (error) {
|
|
116
|
+
throw new AtomicFilePublicationError2("directory-sync", error);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
if (directory === undefined) {
|
|
120
|
+
publish();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
closeAfterSync(() => {
|
|
124
|
+
try {
|
|
125
|
+
directory.close();
|
|
126
|
+
} catch (error) {
|
|
127
|
+
throw new AtomicFilePublicationError2("directory-close", error);
|
|
128
|
+
}
|
|
129
|
+
}, publish);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { closeAfter, closeAfterSync, AtomicFilePublicationError2, assertDirectoryDurability, syncDirectory, publishAtomicFile, publishAtomicFileSync };
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
AgentRecoverableDescriptorSchema2,
|
|
6
6
|
AgentRecoverablePageSchema2,
|
|
7
7
|
canonicalAgentJson2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-0gs4ymfj.js";
|
|
9
9
|
import {
|
|
10
10
|
AgentMessageSchema2,
|
|
11
11
|
AgentRunSchema2
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
AgentHistoryMutationSchema2,
|
|
19
19
|
appendEventIn,
|
|
20
20
|
createAgentRuntimeStore2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-d2h99n7d.js";
|
|
22
22
|
import {
|
|
23
23
|
AgentConversationPageSchema2,
|
|
24
24
|
AgentConversationMessagePageSchema2
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
raceAbort
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-b0kddvzw.js";
|
|
4
4
|
import {
|
|
5
5
|
isJsonData
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-m6w6jtda.js";
|
|
7
|
+
import {
|
|
8
|
+
MAX_TIMER_MS
|
|
9
|
+
} from "./index-eemvahkc.js";
|
|
7
10
|
|
|
8
11
|
// src/durability/contract.ts
|
|
9
12
|
import { z } from "zod";
|
|
@@ -296,8 +299,8 @@ async function reconcile(context, name, handlers, timeoutMs, outerSignal) {
|
|
|
296
299
|
}
|
|
297
300
|
async function executeEffect(context, name, handlers, options) {
|
|
298
301
|
const timeoutMs = options?.reconcileTimeoutMs ?? DEFAULT_RECONCILE_TIMEOUT_MS;
|
|
299
|
-
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || timeoutMs >
|
|
300
|
-
throw new TypeError(`reconcileTimeoutMs must be a positive finite number at most
|
|
302
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || timeoutMs > MAX_TIMER_MS) {
|
|
303
|
+
throw new TypeError(`reconcileTimeoutMs must be a positive finite number at most ${MAX_TIMER_MS}, got ${timeoutMs}`);
|
|
301
304
|
}
|
|
302
305
|
const key = effectKey(context.conversationId, context.runId, name);
|
|
303
306
|
const recorded = (await context.readLedger()).effects.get(key);
|
|
@@ -326,7 +329,7 @@ async function executeEffect(context, name, handlers, options) {
|
|
|
326
329
|
var systemClock = {
|
|
327
330
|
now: () => Date.now(),
|
|
328
331
|
schedule(callback, delayMs) {
|
|
329
|
-
const timer = setTimeout(callback, Math.min(delayMs,
|
|
332
|
+
const timer = setTimeout(callback, Math.min(delayMs, MAX_TIMER_MS));
|
|
330
333
|
timer.unref();
|
|
331
334
|
return { cancel: () => clearTimeout(timer) };
|
|
332
335
|
}
|
|
@@ -617,4 +620,37 @@ function createLocalStepDurability2(options) {
|
|
|
617
620
|
};
|
|
618
621
|
}
|
|
619
622
|
|
|
620
|
-
|
|
623
|
+
// src/tools/agent-tool-error.ts
|
|
624
|
+
var AGENT_TOOL_ERROR_BRAND = Symbol.for("stitchkit.AgentToolError");
|
|
625
|
+
|
|
626
|
+
class AgentToolError2 extends Error {
|
|
627
|
+
output;
|
|
628
|
+
constructor(output, cause) {
|
|
629
|
+
let message = "Tool execution failed";
|
|
630
|
+
try {
|
|
631
|
+
message = JSON.stringify(output);
|
|
632
|
+
} catch {}
|
|
633
|
+
super(message, cause === undefined ? undefined : { cause });
|
|
634
|
+
this.name = "AgentToolError";
|
|
635
|
+
this.output = output;
|
|
636
|
+
Object.defineProperty(this, AGENT_TOOL_ERROR_BRAND, { value: true });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
function isAgentToolError2(value) {
|
|
640
|
+
return typeof value === "object" && value !== null && AGENT_TOOL_ERROR_BRAND in value;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// src/tools/durability-context.ts
|
|
644
|
+
var contexts = new WeakMap;
|
|
645
|
+
function createToolDurabilityContext(factory) {
|
|
646
|
+
const context = {};
|
|
647
|
+
contexts.set(context, factory);
|
|
648
|
+
return context;
|
|
649
|
+
}
|
|
650
|
+
function resolveToolDurability(context, callId, signal) {
|
|
651
|
+
if (typeof context !== "object" || context === null)
|
|
652
|
+
return;
|
|
653
|
+
return contexts.get(context)?.(callId, signal);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export { DURABILITY_STEP_EVENT_KIND2, StepResultDecodeError2, StepResultNotSerializableError2, StepAbortedError2, EffectUnresolvedError2, ParkRecordDecodeError2, ParkAbortedError2, createLocalStepDurability2, AgentToolError2, isAgentToolError2, createToolDurabilityContext, resolveToolDurability };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppError2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-j9gxbztg.js";
|
|
4
4
|
import {
|
|
5
5
|
contractMethodFields
|
|
6
6
|
} from "./index-1bx1xv1k.js";
|
|
@@ -68,7 +68,10 @@ function contractOnlyService(contract) {
|
|
|
68
68
|
}
|
|
69
69
|
function stubHandler(label) {
|
|
70
70
|
return () => {
|
|
71
|
-
throw new AppError2("NOT_IMPLEMENTED",
|
|
71
|
+
throw new AppError2("NOT_IMPLEMENTED", {
|
|
72
|
+
message: `[stitchkit] ${label} is declared by its contract and has no handler`,
|
|
73
|
+
status: 501
|
|
74
|
+
});
|
|
72
75
|
};
|
|
73
76
|
}
|
|
74
77
|
function bindContract(contract, handlers, options) {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertPositiveSafeInteger
|
|
3
|
+
} from "./index-0s4xebbg.js";
|
|
4
|
+
|
|
5
|
+
// src/internal/atomic-staging.ts
|
|
6
|
+
import { randomBytes } from "node:crypto";
|
|
7
|
+
import { lstat, readdir, unlink } from "node:fs/promises";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
var PREFIX = ".stitchkit-";
|
|
10
|
+
var SUFFIX = ".tmp";
|
|
11
|
+
var RANDOM_BYTES = 12;
|
|
12
|
+
var literal = (text) => text.replaceAll(".", "\\.");
|
|
13
|
+
var NAME = new RegExp(`^${literal(PREFIX)}[0-9a-f]{${RANDOM_BYTES * 2}}${literal(SUFFIX)}$`);
|
|
14
|
+
function stagingName() {
|
|
15
|
+
return `${PREFIX}${randomBytes(RANDOM_BYTES).toString("hex")}${SUFFIX}`;
|
|
16
|
+
}
|
|
17
|
+
function stagingPath(target) {
|
|
18
|
+
return join(dirname(target), stagingName());
|
|
19
|
+
}
|
|
20
|
+
function isAtomicStagingName2(name) {
|
|
21
|
+
return NAME.test(name);
|
|
22
|
+
}
|
|
23
|
+
function isMissing(error) {
|
|
24
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
25
|
+
}
|
|
26
|
+
async function sweepAtomicStaging2(options) {
|
|
27
|
+
const { directory, olderThanMs, signal } = options;
|
|
28
|
+
assertPositiveSafeInteger("olderThanMs", olderThanMs, RangeError);
|
|
29
|
+
signal?.throwIfAborted();
|
|
30
|
+
const cutoff = Date.now() - olderThanMs;
|
|
31
|
+
const removed = [];
|
|
32
|
+
for (const name of await readdir(directory)) {
|
|
33
|
+
signal?.throwIfAborted();
|
|
34
|
+
if (!isAtomicStagingName2(name))
|
|
35
|
+
continue;
|
|
36
|
+
const path = join(directory, name);
|
|
37
|
+
try {
|
|
38
|
+
const info = await lstat(path);
|
|
39
|
+
if (!info.isFile() || info.mtimeMs > cutoff)
|
|
40
|
+
continue;
|
|
41
|
+
await unlink(path);
|
|
42
|
+
removed.push(name);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (!isMissing(error))
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return removed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { stagingName, stagingPath, isAtomicStagingName2, sweepAtomicStaging2 };
|
|
@@ -43,20 +43,47 @@ function createDiagnosticJournalReadResultSchema2(eventSchema) {
|
|
|
43
43
|
z2.object({ type: z2.literal("anomaly"), anomaly: DiagnosticJournalAnomalySchema2 }).strict().readonly()
|
|
44
44
|
]);
|
|
45
45
|
}
|
|
46
|
+
var DiagnosticJournalStartupRefusalReasonSchema2 = z2.enum([
|
|
47
|
+
"torn-without-retention-slot",
|
|
48
|
+
"not-a-regular-file",
|
|
49
|
+
"unreadable"
|
|
50
|
+
]);
|
|
51
|
+
var DIAGNOSTIC_JOURNAL_LISTED_QUARANTINE_LIMIT = 32;
|
|
52
|
+
var QuarantinedFileSchema = z2.object({
|
|
53
|
+
file: z2.string(),
|
|
54
|
+
quarantinedAs: z2.string(),
|
|
55
|
+
reason: DiagnosticJournalStartupRefusalReasonSchema2.optional(),
|
|
56
|
+
code: z2.string().optional()
|
|
57
|
+
}).strict().readonly();
|
|
46
58
|
var DiagnosticJournalRecoveryStatusSchema2 = z2.object({
|
|
47
59
|
filesChecked: ByteCountSchema,
|
|
48
60
|
anomalies: ByteCountSchema,
|
|
49
61
|
skippedBytes: ByteCountSchema,
|
|
50
62
|
firstAnomaly: DiagnosticJournalAnomalySchema2.optional(),
|
|
51
|
-
lastAnomaly: DiagnosticJournalAnomalySchema2.optional()
|
|
63
|
+
lastAnomaly: DiagnosticJournalAnomalySchema2.optional(),
|
|
64
|
+
quarantined: z2.array(QuarantinedFileSchema).max(DIAGNOSTIC_JOURNAL_LISTED_QUARANTINE_LIMIT).readonly().optional(),
|
|
65
|
+
quarantinedUnlisted: z2.number().int().positive().optional()
|
|
52
66
|
}).strict().readonly();
|
|
67
|
+
var REFUSAL_MESSAGES = {
|
|
68
|
+
"torn-without-retention-slot": "Diagnostic journal tail recovery requires maxFiles >= 2; no data was removed",
|
|
69
|
+
"not-a-regular-file": "Diagnostic journal generations must be regular files",
|
|
70
|
+
unreadable: "Diagnostic journal could not read a retained file"
|
|
71
|
+
};
|
|
53
72
|
|
|
54
73
|
class DiagnosticJournalRecoveryError2 extends Error {
|
|
74
|
+
reason;
|
|
75
|
+
file;
|
|
55
76
|
recovery;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
77
|
+
quarantineFailed;
|
|
78
|
+
constructor(options) {
|
|
79
|
+
const quarantineFailed = options.quarantineFailed ?? false;
|
|
80
|
+
super(`${REFUSAL_MESSAGES[options.reason]}: ${options.file}${quarantineFailed ? " (moving it aside failed)" : ""}`, options.cause === undefined ? undefined : { cause: options.cause });
|
|
59
81
|
this.name = "DiagnosticJournalRecoveryError";
|
|
82
|
+
this.reason = options.reason;
|
|
83
|
+
this.file = options.file;
|
|
84
|
+
if (options.recovery)
|
|
85
|
+
this.recovery = options.recovery;
|
|
86
|
+
this.quarantineFailed = quarantineFailed;
|
|
60
87
|
}
|
|
61
88
|
}
|
|
62
89
|
|
|
@@ -72,6 +99,8 @@ var DiagnosticJournalLimitsSchema2 = z3.object({
|
|
|
72
99
|
maxFiles: PositiveSafeIntegerSchema
|
|
73
100
|
}).strict().readonly();
|
|
74
101
|
var DiagnosticJournalLockPolicySchema2 = z3.enum(["refuse", "reclaim-stale"]);
|
|
102
|
+
var DiagnosticJournalStartupScanSchema2 = z3.enum(["tails", "full"]);
|
|
103
|
+
var DiagnosticJournalStartupRefusalPolicySchema2 = z3.enum(["quarantine", "fail"]);
|
|
75
104
|
var DiagnosticJournalStateSchema2 = z3.enum(["open", "draining", "closed", "failed"]);
|
|
76
105
|
var DiagnosticJournalRefusalReasonSchema2 = z3.enum([
|
|
77
106
|
"closed",
|
|
@@ -153,4 +182,4 @@ function readDiagnosticJournalLockDiagnosis2(error) {
|
|
|
153
182
|
return isRecord(diagnosis) ? diagnosis : undefined;
|
|
154
183
|
}
|
|
155
184
|
|
|
156
|
-
export { DiagnosticJournalFrameSchema2, DiagnosticJournalAnomalySchema2, createDiagnosticJournalReadResultSchema2, DiagnosticJournalRecoveryStatusSchema2, DiagnosticJournalRecoveryError2, DiagnosticJournalLimitsSchema2, DiagnosticJournalLockPolicySchema2, DiagnosticJournalStateSchema2, DiagnosticJournalRefusalReasonSchema2, DiagnosticJournalFailurePhaseSchema2, DiagnosticJournalStatusSchema2, DiagnosticJournalSubmitResultSchema2, DiagnosticJournalWaitResultSchema2, DiagnosticJournalCloseResultSchema2, parseDiagnosticJournalMode, readDiagnosticJournalLockDiagnosis2 };
|
|
185
|
+
export { DiagnosticJournalFrameSchema2, DiagnosticJournalAnomalySchema2, createDiagnosticJournalReadResultSchema2, DiagnosticJournalStartupRefusalReasonSchema2, DIAGNOSTIC_JOURNAL_LISTED_QUARANTINE_LIMIT, DiagnosticJournalRecoveryStatusSchema2, DiagnosticJournalRecoveryError2, DiagnosticJournalLimitsSchema2, DiagnosticJournalLockPolicySchema2, DiagnosticJournalStartupScanSchema2, DiagnosticJournalStartupRefusalPolicySchema2, DiagnosticJournalStateSchema2, DiagnosticJournalRefusalReasonSchema2, DiagnosticJournalFailurePhaseSchema2, DiagnosticJournalStatusSchema2, DiagnosticJournalSubmitResultSchema2, DiagnosticJournalWaitResultSchema2, DiagnosticJournalCloseResultSchema2, parseDiagnosticJournalMode, readDiagnosticJournalLockDiagnosis2 };
|