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
|
@@ -2,22 +2,29 @@ import {
|
|
|
2
2
|
ManagedFilePathSchema2,
|
|
3
3
|
ManagedFileRefSchema2
|
|
4
4
|
} from "./index-xqhede6x.js";
|
|
5
|
+
import {
|
|
6
|
+
raceAbort
|
|
7
|
+
} from "./index-b0kddvzw.js";
|
|
5
8
|
import {
|
|
6
9
|
BoundedFileReadError,
|
|
7
10
|
readBoundedFile
|
|
8
|
-
} from "./index-
|
|
11
|
+
} from "./index-m616f0yz.js";
|
|
9
12
|
import {
|
|
10
13
|
isWithinDir2
|
|
11
14
|
} from "./index-5cc6r990.js";
|
|
12
15
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "./index-
|
|
16
|
+
writeAllBytes,
|
|
17
|
+
writeAtomicFileStaged
|
|
18
|
+
} from "./index-ef8gdaq0.js";
|
|
19
|
+
import {
|
|
20
|
+
AtomicFilePublicationError2
|
|
21
|
+
} from "./index-b56nnscm.js";
|
|
22
|
+
import {
|
|
23
|
+
assertPositiveSafeInteger
|
|
24
|
+
} from "./index-0s4xebbg.js";
|
|
16
25
|
|
|
17
26
|
// src/files/boundary.ts
|
|
18
|
-
import {
|
|
19
|
-
import { constants } from "node:fs";
|
|
20
|
-
import { mkdir, open as open2, realpath, stat, unlink } from "node:fs/promises";
|
|
27
|
+
import { mkdir, realpath, stat } from "node:fs/promises";
|
|
21
28
|
import { basename as basename2, dirname, resolve } from "node:path";
|
|
22
29
|
|
|
23
30
|
// src/files/file-io.ts
|
|
@@ -25,27 +32,6 @@ var ManagedFileInspectionSchema = ManagedFileRefSchema2.pick({
|
|
|
25
32
|
mediaType: true,
|
|
26
33
|
name: true
|
|
27
34
|
});
|
|
28
|
-
function abortReason(signal) {
|
|
29
|
-
return signal.reason ?? new DOMException("The operation was aborted", "AbortError");
|
|
30
|
-
}
|
|
31
|
-
function raceWithSignal(operation, signal) {
|
|
32
|
-
signal.throwIfAborted();
|
|
33
|
-
return new Promise((resolvePromise, rejectPromise) => {
|
|
34
|
-
let settled = false;
|
|
35
|
-
const settle = (complete) => {
|
|
36
|
-
if (settled)
|
|
37
|
-
return;
|
|
38
|
-
settled = true;
|
|
39
|
-
signal.removeEventListener("abort", onAbort);
|
|
40
|
-
complete();
|
|
41
|
-
};
|
|
42
|
-
const onAbort = () => settle(() => rejectPromise(abortReason(signal)));
|
|
43
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
44
|
-
if (signal.aborted)
|
|
45
|
-
onAbort();
|
|
46
|
-
operation.then((value) => settle(() => resolvePromise(value)), (error) => settle(() => rejectPromise(error)));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
35
|
async function inspectFile(inspector, input, timeoutMs, outerSignal) {
|
|
50
36
|
if (!inspector)
|
|
51
37
|
return {};
|
|
@@ -53,11 +39,11 @@ async function inspectFile(inspector, input, timeoutMs, outerSignal) {
|
|
|
53
39
|
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
54
40
|
const signal = outerSignal ? AbortSignal.any([outerSignal, timeoutSignal]) : timeoutSignal;
|
|
55
41
|
try {
|
|
56
|
-
const inspected = await
|
|
42
|
+
const inspected = await raceAbort(Promise.resolve().then(() => inspector({ ...input, signal })), signal);
|
|
57
43
|
return ManagedFileInspectionSchema.parse(inspected);
|
|
58
44
|
} catch (error) {
|
|
59
45
|
if (outerSignal?.aborted)
|
|
60
|
-
throw
|
|
46
|
+
throw outerSignal.reason;
|
|
61
47
|
throw new ManagedFileError2("FILE_INSPECTION_REJECTED", "managed file rejected by inspection", { cause: error });
|
|
62
48
|
}
|
|
63
49
|
}
|
|
@@ -75,16 +61,7 @@ function inspectedRef(path, size, inspection, fallback = {}) {
|
|
|
75
61
|
}
|
|
76
62
|
return parsed.data;
|
|
77
63
|
}
|
|
78
|
-
async function
|
|
79
|
-
let offset = 0;
|
|
80
|
-
while (offset < chunk.byteLength) {
|
|
81
|
-
const { bytesWritten } = await handle.write(chunk, offset, chunk.byteLength - offset);
|
|
82
|
-
if (bytesWritten === 0)
|
|
83
|
-
throw new Error("zero-byte managed-file write");
|
|
84
|
-
offset += bytesWritten;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function writeSource(handle, source, maxBytes, inspectionBytes, signal) {
|
|
64
|
+
async function writeSource(file, source, maxBytes, inspectionBytes, signal) {
|
|
88
65
|
let size = 0;
|
|
89
66
|
const prefixChunks = [];
|
|
90
67
|
let prefixSize = 0;
|
|
@@ -99,7 +76,7 @@ async function writeSource(handle, source, maxBytes, inspectionBytes, signal) {
|
|
|
99
76
|
prefixChunks.push(kept);
|
|
100
77
|
prefixSize += kept.byteLength;
|
|
101
78
|
}
|
|
102
|
-
await
|
|
79
|
+
await writeAllBytes(file, chunk);
|
|
103
80
|
};
|
|
104
81
|
if (source instanceof Uint8Array) {
|
|
105
82
|
await consume(source);
|
|
@@ -157,11 +134,6 @@ async function readManagedDescriptor(target, path, maxBytes, options, inspection
|
|
|
157
134
|
var DEFAULT_MAX_BYTES = 100 * 1024 * 1024;
|
|
158
135
|
var DEFAULT_INSPECTION_BYTES = 64 * 1024;
|
|
159
136
|
var DEFAULT_INSPECTION_TIMEOUT_MS = 15000;
|
|
160
|
-
var nofollowFlag;
|
|
161
|
-
var noFollow = () => {
|
|
162
|
-
nofollowFlag ??= constants.O_NOFOLLOW ?? 0;
|
|
163
|
-
return nofollowFlag;
|
|
164
|
-
};
|
|
165
137
|
|
|
166
138
|
class ManagedFileError2 extends Error {
|
|
167
139
|
code;
|
|
@@ -173,9 +145,7 @@ class ManagedFileError2 extends Error {
|
|
|
173
145
|
}
|
|
174
146
|
function positiveLimit(value, fallback, name) {
|
|
175
147
|
const resolved = value ?? fallback;
|
|
176
|
-
|
|
177
|
-
throw new TypeError(`${name} must be a positive safe integer`);
|
|
178
|
-
}
|
|
148
|
+
assertPositiveSafeInteger(name, resolved);
|
|
179
149
|
return resolved;
|
|
180
150
|
}
|
|
181
151
|
function filePath(path) {
|
|
@@ -311,37 +281,24 @@ async function createManagedFileBoundary2(config) {
|
|
|
311
281
|
const resolved = targetFor(path);
|
|
312
282
|
const parent = await existingParent(root, resolved.target);
|
|
313
283
|
const maxBytes = positiveLimit(options.maxBytes, maxWriteBytes, "maxBytes");
|
|
314
|
-
const temporary = resolve(parent, `.stitchkit-${randomUUID()}.tmp`);
|
|
315
|
-
let handle;
|
|
316
|
-
let committed = false;
|
|
317
|
-
let size = 0;
|
|
318
284
|
try {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (error instanceof AtomicFilePublicationError2) {
|
|
337
|
-
committed = true;
|
|
338
|
-
throw error;
|
|
339
|
-
}
|
|
340
|
-
if (errorCode(error) === "EEXIST")
|
|
341
|
-
throw new ManagedFileError2("FILE_EXISTS", "managed file already exists");
|
|
342
|
-
throw error;
|
|
343
|
-
}
|
|
344
|
-
return inspectedRef(resolved.path, size, inspection, {
|
|
285
|
+
const staged = await writeAtomicFileStaged(resolve(parent, basename2(resolved.target)), {
|
|
286
|
+
async fill(file) {
|
|
287
|
+
const written = await writeSource(file, source, maxBytes, inspectionBytes, options.signal);
|
|
288
|
+
const inspection = await inspectFile(config.inspect, {
|
|
289
|
+
prefix: written.prefix,
|
|
290
|
+
...options.mediaType ? { declaredMediaType: options.mediaType } : {},
|
|
291
|
+
name: options.name ?? basename2(resolved.path)
|
|
292
|
+
}, inspectionTimeoutMs, options.signal);
|
|
293
|
+
options.signal?.throwIfAborted();
|
|
294
|
+
return { size: written.size, inspection };
|
|
295
|
+
},
|
|
296
|
+
onCleanupError: config.onCleanupError
|
|
297
|
+
}, {
|
|
298
|
+
replace: options.replace ?? false,
|
|
299
|
+
durability: options.durable ? "directory" : "none"
|
|
300
|
+
});
|
|
301
|
+
return inspectedRef(resolved.path, staged.size, staged.inspection, {
|
|
345
302
|
mediaType: options.mediaType,
|
|
346
303
|
name: options.name
|
|
347
304
|
});
|
|
@@ -350,17 +307,9 @@ async function createManagedFileBoundary2(config) {
|
|
|
350
307
|
throw error;
|
|
351
308
|
if (options.signal?.aborted && error === options.signal.reason)
|
|
352
309
|
throw error;
|
|
310
|
+
if (errorCode(error) === "EEXIST")
|
|
311
|
+
throw new ManagedFileError2("FILE_EXISTS", "managed file already exists");
|
|
353
312
|
throw ioError("failed to write managed file", error);
|
|
354
|
-
} finally {
|
|
355
|
-
await handle?.close().catch(() => {
|
|
356
|
-
return;
|
|
357
|
-
});
|
|
358
|
-
if (!options.replace || !committed) {
|
|
359
|
-
await unlink(temporary).catch((error) => {
|
|
360
|
-
if (errorCode(error) !== "ENOENT")
|
|
361
|
-
config.onCleanupError?.(error);
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
313
|
}
|
|
365
314
|
}
|
|
366
315
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineContract2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-fsw1ybf3.js";
|
|
4
4
|
import {
|
|
5
5
|
AppError2,
|
|
6
6
|
STITCH_ERROR_STATUS2,
|
|
7
7
|
isStitchErrorCode2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-j9gxbztg.js";
|
|
9
9
|
import {
|
|
10
10
|
bytesToBase64Url,
|
|
11
11
|
base64UrlToBytes
|
|
@@ -46,10 +46,21 @@ function defineErrors2(source, mapping) {
|
|
|
46
46
|
if ("details" in options) {
|
|
47
47
|
throw new Error(`[stitchkit] Error "${name}" does not declare details`);
|
|
48
48
|
}
|
|
49
|
-
return new AppError2(name,
|
|
49
|
+
return new AppError2(name, {
|
|
50
|
+
message,
|
|
51
|
+
status: definition.status,
|
|
52
|
+
hint: options.hint,
|
|
53
|
+
retryable: definition.retryable
|
|
54
|
+
});
|
|
50
55
|
}
|
|
51
56
|
const details = definition.details.parse(options.details);
|
|
52
|
-
return new AppError2(name,
|
|
57
|
+
return new AppError2(name, {
|
|
58
|
+
message,
|
|
59
|
+
status: definition.status,
|
|
60
|
+
details,
|
|
61
|
+
hint: options.hint,
|
|
62
|
+
retryable: definition.retryable
|
|
63
|
+
});
|
|
53
64
|
};
|
|
54
65
|
});
|
|
55
66
|
Object.freeze(errors);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectRuntimeTool
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-r393tnfp.js";
|
|
4
|
+
import {
|
|
5
|
+
isRecord
|
|
6
|
+
} from "./index-9jfdm5tg.js";
|
|
4
7
|
|
|
5
8
|
// src/tools/runtime-tool.ts
|
|
6
9
|
function defineRuntimeTool2(definition) {
|
|
@@ -52,6 +55,13 @@ function createRuntimeToolFactory2(config) {
|
|
|
52
55
|
}
|
|
53
56
|
return { define };
|
|
54
57
|
}
|
|
58
|
+
function isAgentPresenter(value) {
|
|
59
|
+
return typeof value === "function";
|
|
60
|
+
}
|
|
61
|
+
function agentPresenterOf(definition) {
|
|
62
|
+
const { present } = definition;
|
|
63
|
+
return isRecord(present) && isAgentPresenter(present.agent) ? present.agent : undefined;
|
|
64
|
+
}
|
|
55
65
|
function runtimeToolIdentity(definition) {
|
|
56
66
|
return {
|
|
57
67
|
method: definition.identity.method,
|
|
@@ -97,4 +107,4 @@ function executableAgentRuntimeTools(tools) {
|
|
|
97
107
|
return tools;
|
|
98
108
|
}
|
|
99
109
|
|
|
100
|
-
export { defineRuntimeTool2, createRuntimeToolFactory2, runtimeToolMountable, executableAgentRuntimeTools };
|
|
110
|
+
export { defineRuntimeTool2, createRuntimeToolFactory2, agentPresenterOf, runtimeToolMountable, executableAgentRuntimeTools };
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Releases an await on cancellation without assuming a callback cooperates with its signal.
|
|
3
|
+
*
|
|
4
|
+
* When the signal wins and the operation settles later, a fulfilled value is handed to
|
|
5
|
+
* `disposeLate` so an owner can release what it would otherwise leak (a stream, a
|
|
6
|
+
* handle); a late rejection is swallowed because the caller already has the reason.
|
|
7
|
+
*/
|
|
8
|
+
export declare function raceAbort<T>(operation: Promise<T>, signal: AbortSignal, disposeLate?: (value: T) => void): Promise<T>;
|
|
3
9
|
//# sourceMappingURL=abort-race.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abort-race.d.ts","sourceRoot":"","sources":["../../src/internal/abort-race.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"abort-race.d.ts","sourceRoot":"","sources":["../../src/internal/abort-race.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EACrB,MAAM,EAAE,WAAW,EACnB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAC/B,OAAO,CAAC,CAAC,CAAC,CA+BZ"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* synchronous `rename` on a loaded machine was measured holding a consumer's
|
|
21
21
|
* main thread for ~15 s — every timer and request of a daemon stood still.
|
|
22
22
|
*/
|
|
23
|
+
import { type AtomicPublishOptions } from './atomic-publication.js';
|
|
23
24
|
/** Options of {@link writeFileAtomic} and {@link writeFileAtomicSync}. */
|
|
24
25
|
export interface WriteFileAtomicOptions {
|
|
25
26
|
/**
|
|
@@ -31,29 +32,74 @@ export interface WriteFileAtomicOptions {
|
|
|
31
32
|
mode?: number;
|
|
32
33
|
/** Replace by default; false atomically refuses any existing file or link. */
|
|
33
34
|
replace?: boolean;
|
|
34
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* `'file'` (the default) fsyncs the bytes before publication; `'directory'`
|
|
37
|
+
* also fsyncs the parent after it; `'none'` does neither.
|
|
38
|
+
*/
|
|
35
39
|
durability?: 'none' | 'file' | 'directory';
|
|
36
40
|
}
|
|
41
|
+
/** The staged file as a writer sees it; a `FileHandle` satisfies it. */
|
|
42
|
+
export interface StagedFile {
|
|
43
|
+
write(bytes: Uint8Array, offset: number, length: number): Promise<{
|
|
44
|
+
bytesWritten: number;
|
|
45
|
+
}>;
|
|
46
|
+
chmod(mode: number): Promise<void>;
|
|
47
|
+
sync(): Promise<void>;
|
|
48
|
+
close(): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
/** Write every byte of `bytes`; a short write continues and a write of zero bytes is an error. */
|
|
51
|
+
export declare function writeAllBytes(file: StagedFile, bytes: Uint8Array): Promise<void>;
|
|
37
52
|
/**
|
|
38
53
|
* Write `data` to `target` atomically: a reader sees the old contents or the
|
|
39
54
|
* new ones, never part of either, and the new file has `mode` from its first
|
|
40
55
|
* visible moment. A failure before publication leaves the target untouched. Directory-sync or
|
|
41
56
|
* staging-link cleanup failure after publication throws AtomicFilePublicationError
|
|
42
57
|
* with published=true; do not blindly repeat an external action.
|
|
58
|
+
*
|
|
59
|
+
* The bytes are staged in the target's directory under a name {@link isAtomicStagingName}
|
|
60
|
+
* recognises (`.stitchkit-<24 hex>.tmp`, a stable public contract). A process killed before
|
|
61
|
+
* publication leaves that file behind and no later write removes it: recognising and sweeping
|
|
62
|
+
* abandoned staging ({@link sweepAtomicStaging}) is the caller's responsibility.
|
|
43
63
|
*/
|
|
44
64
|
export declare function writeFileAtomic(target: string, data: Uint8Array | string, options?: WriteFileAtomicOptions): Promise<void>;
|
|
45
65
|
interface AtomicFileWriteIO {
|
|
46
|
-
open(path: string, flags: 'wx', mode: number): Promise<
|
|
47
|
-
writeFile(bytes: Uint8Array): Promise<void>;
|
|
48
|
-
chmod(mode: number): Promise<void>;
|
|
49
|
-
sync(): Promise<void>;
|
|
50
|
-
close(): Promise<void>;
|
|
51
|
-
}>;
|
|
66
|
+
open(path: string, flags: 'wx', mode: number): Promise<StagedFile>;
|
|
52
67
|
unlink(path: string): Promise<void>;
|
|
53
|
-
publish(staged: string, target: string,
|
|
68
|
+
publish(staged: string, target: string, options: AtomicPublishOptions): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
/** How the staged bytes of one atomic write are produced and vetted. */
|
|
71
|
+
export interface AtomicFileStage<T> {
|
|
72
|
+
/** Fills the staged file; a throw discards the staging, and the result is what the write returns once published. */
|
|
73
|
+
fill(file: StagedFile): Promise<T>;
|
|
74
|
+
/** Receives a failure to remove the staging file after a failed write. */
|
|
75
|
+
onCleanupError?(error: unknown): void;
|
|
54
76
|
}
|
|
55
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* The one staging sequence behind every asynchronous atomic write: exclusive
|
|
79
|
+
* create, fill, chmod, fsync, publication, and removal of the
|
|
80
|
+
* staging file on any failure. Also the internal syscall seam for
|
|
81
|
+
* publication-order and precommit fault controls.
|
|
82
|
+
*/
|
|
83
|
+
export declare function writeAtomicFileStaged<T>(target: string, stage: AtomicFileStage<T>, options: WriteFileAtomicOptions, io?: AtomicFileWriteIO): Promise<T>;
|
|
84
|
+
/** {@link writeAtomicFileStaged} for bytes already in memory. */
|
|
56
85
|
export declare function writeAtomicFileData(target: string, data: Uint8Array | string, options: WriteFileAtomicOptions, io?: AtomicFileWriteIO): Promise<void>;
|
|
86
|
+
/** The staged file of the synchronous form. */
|
|
87
|
+
interface StagedFileSync {
|
|
88
|
+
write(bytes: Uint8Array, offset: number, length: number): number;
|
|
89
|
+
chmod(mode: number): void;
|
|
90
|
+
sync(): void;
|
|
91
|
+
close(): void;
|
|
92
|
+
}
|
|
93
|
+
interface AtomicFileWriteSyncIO {
|
|
94
|
+
open(path: string, flags: 'wx', mode: number): StagedFileSync;
|
|
95
|
+
unlink(path: string): void;
|
|
96
|
+
publish(staged: string, target: string, options: AtomicPublishOptions): void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The synchronous form of {@link writeFileAtomic}, with the same guarantees in
|
|
100
|
+
* the same order, and the same internal syscall seam.
|
|
101
|
+
*/
|
|
102
|
+
export declare function writeAtomicFileDataSync(target: string, data: Uint8Array | string, options: WriteFileAtomicOptions, io?: AtomicFileWriteSyncIO): void;
|
|
57
103
|
/** The synchronous form of {@link writeFileAtomic}, with the same guarantees in the same order. */
|
|
58
104
|
export declare function writeFileAtomicSync(target: string, data: Uint8Array | string, options?: WriteFileAtomicOptions): void;
|
|
59
105
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-file.d.ts","sourceRoot":"","sources":["../../src/internal/atomic-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"atomic-file.d.ts","sourceRoot":"","sources":["../../src/internal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E,oBAAoB,GAAG,IAAI,CAAC;CAC9E;AAgBD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,GAAE,qBAAkC,GACrC,IAAI,CAmCN;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,OAAO,GAAE,sBAA2B,GACnC,IAAI,CAEN"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the new file is already in place but a follow-up step (`phase`) failed; the
|
|
3
|
+
* content is published, so do not treat this as a failed write.
|
|
4
|
+
*/
|
|
2
5
|
export declare class AtomicFilePublicationError extends Error {
|
|
3
6
|
readonly phase: 'cleanup' | 'directory-sync' | 'directory-close';
|
|
4
7
|
readonly published = true;
|
|
5
8
|
constructor(phase: 'cleanup' | 'directory-sync' | 'directory-close', cause: unknown);
|
|
6
9
|
}
|
|
7
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Native publication syscalls; injectable only at this internal IO boundary for fault
|
|
12
|
+
* controls.
|
|
13
|
+
*/
|
|
8
14
|
export interface PublicationIO {
|
|
9
15
|
rename(from: string, to: string): Promise<void>;
|
|
10
16
|
link(from: string, to: string): Promise<void>;
|
|
@@ -14,6 +20,35 @@ export interface PublicationIO {
|
|
|
14
20
|
close(): Promise<void>;
|
|
15
21
|
}>;
|
|
16
22
|
}
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The synchronous counterpart of {@link PublicationIO}, with the same fault-control role.
|
|
25
|
+
*/
|
|
26
|
+
export interface PublicationSyncIO {
|
|
27
|
+
rename(from: string, to: string): void;
|
|
28
|
+
link(from: string, to: string): void;
|
|
29
|
+
unlink(path: string): void;
|
|
30
|
+
open(path: string, flags: 'r'): {
|
|
31
|
+
sync(): void;
|
|
32
|
+
close(): void;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Directory fsync needs a directory descriptor, which Windows does not provide. */
|
|
36
|
+
export declare function assertDirectoryDurability(): void;
|
|
37
|
+
/** Make a rename, link or unlink inside `path` durable: the one directory fsync. */
|
|
38
|
+
export declare function syncDirectory(path: string, io?: PublicationIO): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* How far an atomic write is made durable: `'none'` neither syncs the bytes nor the parent,
|
|
41
|
+
* `'file'` syncs the staged bytes before publication, `'directory'` also syncs the parent after it.
|
|
42
|
+
*/
|
|
43
|
+
export type AtomicDurability = 'none' | 'file' | 'directory';
|
|
44
|
+
/**
|
|
45
|
+
* How one staged file becomes the target: `replace` overwrites, otherwise an existing target
|
|
46
|
+
* is refused.
|
|
47
|
+
*/
|
|
48
|
+
export interface AtomicPublishOptions {
|
|
49
|
+
readonly replace: boolean;
|
|
50
|
+
readonly durability: AtomicDurability;
|
|
51
|
+
}
|
|
52
|
+
export declare function publishAtomicFile(staged: string, target: string, { replace, durability }: AtomicPublishOptions, io?: PublicationIO): Promise<void>;
|
|
53
|
+
export declare function publishAtomicFileSync(staged: string, target: string, { replace, durability }: AtomicPublishOptions, io?: PublicationSyncIO): void;
|
|
19
54
|
//# sourceMappingURL=atomic-publication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-publication.d.ts","sourceRoot":"","sources":["../../src/internal/atomic-publication.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atomic-publication.d.ts","sourceRoot":"","sources":["../../src/internal/atomic-publication.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;aAGjC,KAAK,EAAE,SAAS,GAAG,gBAAgB,GAAG,iBAAiB;IAFzE,QAAQ,CAAC,SAAS,QAAQ;IAC1B,YACkB,KAAK,EAAE,SAAS,GAAG,gBAAgB,GAAG,i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AAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;CACvC;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,oBAAoB,EAC7C,EAAE,GAAE,aAAsB,GACzB,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,oBAAoB,EAC7C,EAAE,GAAE,iBAA8B,GACjC,IAAI,CA+BN"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one name every staged file of an atomic write carries, and the means to
|
|
3
|
+
* recognise and remove the ones a killed process left behind.
|
|
4
|
+
*
|
|
5
|
+
* A staging file lives in the target's own directory until it is renamed or
|
|
6
|
+
* linked onto the target. A process killed between the exclusive create and
|
|
7
|
+
* the publication (SIGKILL, OOM, power loss) leaves it there, and no later
|
|
8
|
+
* write of this library touches it: its name is random, so nothing could tell
|
|
9
|
+
* an abandoned one from a write in flight except its age. That judgement is the
|
|
10
|
+
* caller's, so the caller is given the predicate and an age-bounded sweep.
|
|
11
|
+
*
|
|
12
|
+
* The name form is a public contract: `.stitchkit-` + 24 lowercase hex digits +
|
|
13
|
+
* `.tmp`. The writer and the predicate are built from the constants below, so
|
|
14
|
+
* they cannot disagree; changing the form is a breaking change of
|
|
15
|
+
* `stitchkit/files`.
|
|
16
|
+
*/
|
|
17
|
+
/** A fresh staging file name; fixed length, so a long target name cannot push it past NAME_MAX. */
|
|
18
|
+
export declare function stagingName(): string;
|
|
19
|
+
/** A fresh staging path beside `target`: the rename onto it must not cross a filesystem. */
|
|
20
|
+
export declare function stagingPath(target: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* True when `name` (a directory entry, not a path) is the staging file of an atomic write
|
|
23
|
+
* of this library. The form is a stable public contract; changing it is a breaking change.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isAtomicStagingName(name: string): boolean;
|
|
26
|
+
/** Options of {@link sweepAtomicStaging}. */
|
|
27
|
+
export interface SweepAtomicStagingOptions {
|
|
28
|
+
/** The directory to sweep; its subdirectories are never entered. */
|
|
29
|
+
directory: string;
|
|
30
|
+
/**
|
|
31
|
+
* Only a staging file whose last modification is older than this many milliseconds is
|
|
32
|
+
* removed. Required and positive: it must exceed the longest write in flight, or the
|
|
33
|
+
* sweep removes the staging of a write that is still running.
|
|
34
|
+
*/
|
|
35
|
+
olderThanMs: number;
|
|
36
|
+
/** Stops the sweep between entries; files already removed stay removed. */
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Remove the abandoned staging files of atomic writes from one directory and return their
|
|
41
|
+
* names. Only regular files matching {@link isAtomicStagingName} and older than `olderThanMs`
|
|
42
|
+
* are removed; a symlink, a directory or any other entry is left alone, and nothing is
|
|
43
|
+
* followed or recursed into.
|
|
44
|
+
*/
|
|
45
|
+
export declare function sweepAtomicStaging(options: SweepAtomicStagingOptions): Promise<string[]>;
|
|
46
|
+
//# sourceMappingURL=atomic-staging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-staging.d.ts","sourceRoot":"","sources":["../../src/internal/atomic-staging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAaH,mGAAmG;AACnG,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,6CAA6C;AAC7C,MAAM,WAAW,yBAAyB;IACxC,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAQD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,MAAM,EAAE,CAAC,CAsBnB"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ino: number;
|
|
4
|
-
size: number;
|
|
5
|
-
nlink: number;
|
|
6
|
-
mtimeMs: number;
|
|
7
|
-
ctimeMs: number;
|
|
8
|
-
}
|
|
1
|
+
import { type FileHandle } from 'node:fs/promises';
|
|
2
|
+
import type { FileObservation } from './file-observation.js';
|
|
9
3
|
interface FileReadStat extends FileObservation {
|
|
10
4
|
isFile(): boolean;
|
|
11
5
|
}
|
|
@@ -19,15 +13,29 @@ interface FileReadDescriptor {
|
|
|
19
13
|
export declare class BoundedFileReadError extends Error {
|
|
20
14
|
readonly code: 'FILE_UNSUPPORTED' | 'FILE_NOT_REGULAR' | 'FILE_UNSAFE_LINK' | 'FILE_TOO_LARGE' | 'FILE_CHANGED';
|
|
21
15
|
readonly observation?: FileObservation | undefined;
|
|
22
|
-
constructor(code: 'FILE_UNSUPPORTED' | 'FILE_NOT_REGULAR' | 'FILE_UNSAFE_LINK' | 'FILE_TOO_LARGE' | 'FILE_CHANGED', message: string, observation?: FileObservation | undefined);
|
|
16
|
+
constructor(code: 'FILE_UNSUPPORTED' | 'FILE_NOT_REGULAR' | 'FILE_UNSAFE_LINK' | 'FILE_TOO_LARGE' | 'FILE_CHANGED', message: string, observation?: FileObservation | undefined, options?: ErrorOptions);
|
|
23
17
|
}
|
|
24
|
-
export interface
|
|
18
|
+
export interface FileOpenOptions {
|
|
19
|
+
/** Refuse a symlink at the leaf: the open itself does not follow it. Without it a symlink is followed. */
|
|
25
20
|
rejectSymlinks?: boolean;
|
|
21
|
+
/** Require descriptor nlink===1; transient publication links are also refused. */
|
|
26
22
|
singleLink?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface BoundedFileReadOptions extends FileOpenOptions {
|
|
27
25
|
stable?: boolean;
|
|
28
26
|
signal?: AbortSignal;
|
|
29
27
|
}
|
|
30
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Open a regular file by descriptor for a caller that streams it; the caller closes the
|
|
30
|
+
* handle.
|
|
31
|
+
*/
|
|
32
|
+
export declare function openRegularFile(target: string, options?: FileOpenOptions): Promise<{
|
|
33
|
+
handle: FileHandle;
|
|
34
|
+
before: FileObservation;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* The descriptor decides kind/link/stability; bytes are capped before allocation grows.
|
|
38
|
+
*/
|
|
31
39
|
export declare function readBoundedFile(target: string, maxBytes: number, options?: BoundedFileReadOptions, openDescriptor?: (path: string, flags: number) => Promise<FileReadDescriptor>): Promise<{
|
|
32
40
|
bytes: Uint8Array;
|
|
33
41
|
observation: FileObservation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-file-read.d.ts","sourceRoot":"","sources":["../../src/internal/bounded-file-read.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bounded-file-read.d.ts","sourceRoot":"","sources":["../../src/internal/bounded-file-read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,kBAAkB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,UAAU,YAAa,SAAQ,eAAe;IAC5C,MAAM,IAAI,OAAO,CAAC;CACnB;AAED,UAAU,kBAAkB;IAC1B,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC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MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1F,EACD,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAgCrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-lines.d.ts","sourceRoot":"","sources":["../../src/internal/bounded-lines.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bounded-lines.d.ts","sourceRoot":"","sources":["../../src/internal/bounded-lines.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,yBAAyB,QAAc,CAAC;AAgBrD,yEAAyE;AACzE,wBAAuB,oBAAoB,CACzC,QAAQ,EAAE,QAAQ,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,mBAAmB,UAAQ,GAC1B,cAAc,CAAC,MAAM,CAAC,CAqCxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run `run` with a handle that is closed afterwards on every path. A failure of
|
|
3
|
+
* `run` is the one reported; a close failure is reported only when `run`
|
|
4
|
+
* succeeded, because the first cause is the one a caller can act on.
|
|
5
|
+
*/
|
|
6
|
+
export declare function closeAfter<T>(handle: {
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
}, run: () => Promise<T>): Promise<T>;
|
|
9
|
+
/** The synchronous form of {@link closeAfter}, with the same error order. */
|
|
10
|
+
export declare function closeAfterSync<T>(close: () => void, run: () => T): T;
|
|
11
|
+
//# sourceMappingURL=close-after.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close-after.d.ts","sourceRoot":"","sources":["../../src/internal/close-after.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,MAAM,EAAE;IAAE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAClC,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACpB,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAcpE"}
|
|
@@ -14,4 +14,14 @@ export declare function withDeadline(value: unknown, timeoutMs: number): Promise
|
|
|
14
14
|
} | {
|
|
15
15
|
settled: false;
|
|
16
16
|
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Run `body` under the caller's signal and a deadline.
|
|
19
|
+
*
|
|
20
|
+
* One implementation of "caller signal plus timer": the signal handed to `body` aborts
|
|
21
|
+
* with the caller's own reason, or with `makeReason()` when `timeoutMs` passes. `body` owns its own cleanup, so the returned promise settles only when `body` does; a
|
|
22
|
+
* body that may ignore its signal wraps the wait it cannot trust in `raceAbort`. The caller's
|
|
23
|
+
* signal is only read, never changed. The timer is cleared on every outcome and is a normal
|
|
24
|
+
* (referenced) timer, so a pending wait keeps the process alive until its deadline.
|
|
25
|
+
*/
|
|
26
|
+
export declare function withSignalDeadline<T>(timeoutMs: number, caller: AbortSignal | undefined, makeReason: () => unknown, body: (signal: AbortSignal) => Promise<T>): Promise<T>;
|
|
17
27
|
//# sourceMappingURL=deadline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../src/internal/deadline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../src/internal/deadline.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC,CAiBjE;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,UAAU,EAAE,MAAM,OAAO,EACzB,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC,CAaZ"}
|