@amalgm/shell 0.1.164-preview.41762776698 → 0.1.164-preview.44386772850
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/PURPOSE.md +359 -235
- package/README.md +18 -0
- package/dist/accepted-fold.d.ts +51 -0
- package/dist/accepted-fold.js +106 -0
- package/dist/accepted-fold.js.map +1 -0
- package/dist/accepted-tail.d.ts +19 -9
- package/dist/accepted-tail.js +28 -11
- package/dist/accepted-tail.js.map +1 -1
- package/dist/accepted-view.d.ts +27 -0
- package/dist/accepted-view.js +8 -0
- package/dist/accepted-view.js.map +1 -0
- package/dist/apply-attempt-memory.d.ts +13 -0
- package/dist/apply-attempt-memory.js +26 -0
- package/dist/apply-attempt-memory.js.map +1 -0
- package/dist/apply-control.d.ts +85 -0
- package/dist/apply-control.js +131 -0
- package/dist/apply-control.js.map +1 -0
- package/dist/apply-displaced-tree.d.ts +63 -0
- package/dist/apply-displaced-tree.js +148 -0
- package/dist/apply-displaced-tree.js.map +1 -0
- package/dist/apply-durability.d.ts +33 -0
- package/dist/apply-durability.js +72 -0
- package/dist/apply-durability.js.map +1 -0
- package/dist/apply-enter-build.d.ts +91 -0
- package/dist/apply-enter-build.js +145 -0
- package/dist/apply-enter-build.js.map +1 -0
- package/dist/apply-enter-plan.d.ts +79 -0
- package/dist/apply-enter-plan.js +148 -0
- package/dist/apply-enter-plan.js.map +1 -0
- package/dist/apply-fingerprint.d.ts +39 -0
- package/dist/apply-fingerprint.js +84 -0
- package/dist/apply-fingerprint.js.map +1 -0
- package/dist/apply-git-held.d.ts +29 -0
- package/dist/apply-git-held.js +184 -0
- package/dist/apply-git-held.js.map +1 -0
- package/dist/apply-git-storage.d.ts +38 -0
- package/dist/apply-git-storage.js +110 -0
- package/dist/apply-git-storage.js.map +1 -0
- package/dist/apply-kept.d.ts +42 -0
- package/dist/apply-kept.js +135 -0
- package/dist/apply-kept.js.map +1 -0
- package/dist/apply-local-work.d.ts +41 -0
- package/dist/apply-local-work.js +72 -0
- package/dist/apply-local-work.js.map +1 -0
- package/dist/apply-map.d.ts +116 -0
- package/dist/apply-map.js +383 -0
- package/dist/apply-map.js.map +1 -0
- package/dist/apply-showing.d.ts +104 -0
- package/dist/apply-showing.js +236 -0
- package/dist/apply-showing.js.map +1 -0
- package/dist/apply-shown-again.d.ts +28 -0
- package/dist/apply-shown-again.js +81 -0
- package/dist/apply-shown-again.js.map +1 -0
- package/dist/apply-spelling.d.ts +35 -0
- package/dist/apply-spelling.js +79 -0
- package/dist/apply-spelling.js.map +1 -0
- package/dist/apply-trash-keep.d.ts +96 -0
- package/dist/apply-trash-keep.js +194 -0
- package/dist/apply-trash-keep.js.map +1 -0
- package/dist/apply-window-cargo.d.ts +54 -0
- package/dist/apply-window-cargo.js +219 -0
- package/dist/apply-window-cargo.js.map +1 -0
- package/dist/apply-window-ground.d.ts +130 -0
- package/dist/apply-window-ground.js +324 -0
- package/dist/apply-window-ground.js.map +1 -0
- package/dist/apply-window-host.d.ts +136 -0
- package/dist/apply-window-host.js +1842 -0
- package/dist/apply-window-host.js.map +1 -0
- package/dist/apply-window-lane.d.ts +30 -0
- package/dist/apply-window-lane.js +311 -0
- package/dist/apply-window-lane.js.map +1 -0
- package/dist/apply-window-line.d.ts +31 -0
- package/dist/apply-window-line.js +150 -0
- package/dist/apply-window-line.js.map +1 -0
- package/dist/apply-window-recovery.d.ts +5 -0
- package/dist/apply-window-recovery.js +72 -0
- package/dist/apply-window-recovery.js.map +1 -0
- package/dist/apply-window-reveal.d.ts +22 -0
- package/dist/apply-window-reveal.js +98 -0
- package/dist/apply-window-reveal.js.map +1 -0
- package/dist/apply-window-rows.d.ts +144 -0
- package/dist/apply-window-rows.js +178 -0
- package/dist/apply-window-rows.js.map +1 -0
- package/dist/apply-window-saves.d.ts +224 -0
- package/dist/apply-window-saves.js +674 -0
- package/dist/apply-window-saves.js.map +1 -0
- package/dist/apply-window-store.d.ts +126 -0
- package/dist/apply-window-store.js +312 -0
- package/dist/apply-window-store.js.map +1 -0
- package/dist/apply-window-verify.d.ts +65 -0
- package/dist/apply-window-verify.js +195 -0
- package/dist/apply-window-verify.js.map +1 -0
- package/dist/authority-binding.d.ts +1 -24
- package/dist/authority-binding.js +44 -9
- package/dist/authority-binding.js.map +1 -1
- package/dist/background-error.d.ts +4 -0
- package/dist/background-error.js +15 -0
- package/dist/background-error.js.map +1 -0
- package/dist/baseline-content.d.ts +12 -0
- package/dist/baseline-content.js +12 -0
- package/dist/baseline-content.js.map +1 -0
- package/dist/billing/cli.d.ts +18 -0
- package/dist/billing/cli.js +276 -0
- package/dist/billing/cli.js.map +1 -0
- package/dist/billing/mount.d.ts +12 -0
- package/dist/billing/mount.js +34 -0
- package/dist/billing/mount.js.map +1 -0
- package/dist/billing/tools.d.ts +57 -0
- package/dist/billing/tools.js +141 -0
- package/dist/billing/tools.js.map +1 -0
- package/dist/boot-identity.d.ts +1 -0
- package/dist/boot-identity.js +39 -0
- package/dist/boot-identity.js.map +1 -0
- package/dist/browser-host.d.ts +4 -3
- package/dist/browser-host.js +29 -14
- package/dist/browser-host.js.map +1 -1
- package/dist/captured-rows.d.ts +33 -0
- package/dist/captured-rows.js +45 -0
- package/dist/captured-rows.js.map +1 -0
- package/dist/cargo-group.d.ts +31 -17
- package/dist/cargo-group.js +78 -29
- package/dist/cargo-group.js.map +1 -1
- package/dist/cargo-journal.d.ts +45 -0
- package/dist/cargo-journal.js +130 -0
- package/dist/cargo-journal.js.map +1 -0
- package/dist/chat-composition.d.ts +4 -1
- package/dist/chat-composition.js +4 -1
- package/dist/chat-composition.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +129 -55
- package/dist/cli.js.map +1 -1
- package/dist/construct-apply-host.d.ts +8 -7
- package/dist/construct-apply-host.js +20 -8
- package/dist/construct-apply-host.js.map +1 -1
- package/dist/construct-door.d.ts +2 -0
- package/dist/construct-door.js +4 -3
- package/dist/construct-door.js.map +1 -1
- package/dist/construct-ledger.d.ts +2 -0
- package/dist/construct-ledger.js +13 -1
- package/dist/construct-ledger.js.map +1 -1
- package/dist/content-cache-collection.d.ts +11 -4
- package/dist/content-cache-collection.js +74 -62
- package/dist/content-cache-collection.js.map +1 -1
- package/dist/content-cache-fences.d.ts +27 -0
- package/dist/content-cache-fences.js +116 -0
- package/dist/content-cache-fences.js.map +1 -0
- package/dist/content-cache-host.d.ts +163 -91
- package/dist/content-cache-host.js +531 -354
- package/dist/content-cache-host.js.map +1 -1
- package/dist/content-cache-index.d.ts +36 -7
- package/dist/content-cache-index.js +79 -32
- package/dist/content-cache-index.js.map +1 -1
- package/dist/content-cache-namespace.d.ts +28 -34
- package/dist/content-cache-namespace.js +85 -99
- package/dist/content-cache-namespace.js.map +1 -1
- package/dist/content-cache-partials.d.ts +37 -0
- package/dist/content-cache-partials.js +79 -0
- package/dist/content-cache-partials.js.map +1 -0
- package/dist/content-cache-retention.d.ts +27 -12
- package/dist/content-cache-retention.js +143 -132
- package/dist/content-cache-retention.js.map +1 -1
- package/dist/content-capture-pool.d.ts +70 -83
- package/dist/content-capture-pool.js +112 -82
- package/dist/content-capture-pool.js.map +1 -1
- package/dist/content-capture-worker.d.ts +3 -4
- package/dist/content-capture-worker.js +28 -35
- package/dist/content-capture-worker.js.map +1 -1
- package/dist/content-clock.d.ts +54 -28
- package/dist/content-clock.js +345 -102
- package/dist/content-clock.js.map +1 -1
- package/dist/content-direct.d.ts +0 -2
- package/dist/content-direct.js +53 -31
- package/dist/content-direct.js.map +1 -1
- package/dist/content-qualification.d.ts +72 -0
- package/dist/content-qualification.js +129 -0
- package/dist/content-qualification.js.map +1 -0
- package/dist/credentials-host.js +3 -2
- package/dist/credentials-host.js.map +1 -1
- package/dist/derived-relocation.d.ts +31 -0
- package/dist/derived-relocation.js +71 -0
- package/dist/derived-relocation.js.map +1 -0
- package/dist/detection/accepted-result.js +3 -3
- package/dist/detection/accepted-result.js.map +1 -1
- package/dist/detection/admission-save.d.ts +25 -14
- package/dist/detection/admission-save.js +34 -22
- package/dist/detection/admission-save.js.map +1 -1
- package/dist/detection/admission-units.d.ts +32 -20
- package/dist/detection/admission-units.js +230 -97
- package/dist/detection/admission-units.js.map +1 -1
- package/dist/detection/alias-examination.d.ts +5 -2
- package/dist/detection/alias-examination.js +15 -3
- package/dist/detection/alias-examination.js.map +1 -1
- package/dist/detection/apply-ownership.d.ts +70 -44
- package/dist/detection/apply-ownership.js +140 -132
- package/dist/detection/apply-ownership.js.map +1 -1
- package/dist/detection/basis-advanced.d.ts +4 -0
- package/dist/detection/basis-advanced.js +9 -0
- package/dist/detection/basis-advanced.js.map +1 -1
- package/dist/detection/cached-replay.d.ts +38 -0
- package/dist/detection/cached-replay.js +66 -0
- package/dist/detection/cached-replay.js.map +1 -0
- package/dist/detection/capture-outcome.js +33 -36
- package/dist/detection/capture-outcome.js.map +1 -1
- package/dist/detection/container-membership.d.ts +13 -25
- package/dist/detection/container-membership.js +24 -28
- package/dist/detection/container-membership.js.map +1 -1
- package/dist/detection/directory-proof.js +1 -1
- package/dist/detection/directory-proof.js.map +1 -1
- package/dist/detection/dispositions.d.ts +10 -33
- package/dist/detection/dispositions.js +27 -91
- package/dist/detection/dispositions.js.map +1 -1
- package/dist/detection/examinations.d.ts +33 -0
- package/dist/detection/examinations.js +50 -0
- package/dist/detection/examinations.js.map +1 -0
- package/dist/detection/ground-proof.d.ts +35 -11
- package/dist/detection/ground-proof.js +111 -52
- package/dist/detection/ground-proof.js.map +1 -1
- package/dist/detection/ground-reader.d.ts +10 -10
- package/dist/detection/ground-reader.js +19 -42
- package/dist/detection/ground-reader.js.map +1 -1
- package/dist/detection/identity-discovery.d.ts +1 -1
- package/dist/detection/identity-discovery.js +27 -35
- package/dist/detection/identity-discovery.js.map +1 -1
- package/dist/detection/maintenance-sweep.d.ts +5 -2
- package/dist/detection/maintenance-sweep.js +15 -5
- package/dist/detection/maintenance-sweep.js.map +1 -1
- package/dist/detection/notebook-basis.d.ts +6 -3
- package/dist/detection/notebook-basis.js +8 -5
- package/dist/detection/notebook-basis.js.map +1 -1
- package/dist/detection/owed-examinations.d.ts +22 -0
- package/dist/detection/owed-examinations.js +54 -0
- package/dist/detection/owed-examinations.js.map +1 -0
- package/dist/detection/owed-selection.d.ts +23 -20
- package/dist/detection/owed-selection.js +56 -43
- package/dist/detection/owed-selection.js.map +1 -1
- package/dist/detection/policy-owed.d.ts +17 -0
- package/dist/detection/policy-owed.js +33 -0
- package/dist/detection/policy-owed.js.map +1 -0
- package/dist/detection/repository-state.d.ts +44 -0
- package/dist/detection/repository-state.js +95 -0
- package/dist/detection/repository-state.js.map +1 -0
- package/dist/detection/reveal-save.d.ts +17 -0
- package/dist/detection/reveal-save.js +15 -0
- package/dist/detection/reveal-save.js.map +1 -0
- package/dist/detection/root-examination.d.ts +25 -13
- package/dist/detection/root-examination.js +273 -220
- package/dist/detection/root-examination.js.map +1 -1
- package/dist/detection/root-walk.d.ts +191 -0
- package/dist/detection/root-walk.js +1383 -0
- package/dist/detection/root-walk.js.map +1 -0
- package/dist/detection/runtime.d.ts +41 -53
- package/dist/detection/runtime.js +285 -345
- package/dist/detection/runtime.js.map +1 -1
- package/dist/detection/scope-frame.d.ts +82 -0
- package/dist/detection/scope-frame.js +183 -0
- package/dist/detection/scope-frame.js.map +1 -0
- package/dist/detection/scoped-identity-port.d.ts +11 -10
- package/dist/detection/scoped-identity-port.js +18 -25
- package/dist/detection/scoped-identity-port.js.map +1 -1
- package/dist/detection/sharing-policy.d.ts +14 -6
- package/dist/detection/sharing-policy.js +13 -7
- package/dist/detection/sharing-policy.js.map +1 -1
- package/dist/detection/spelled-lookup.d.ts +20 -0
- package/dist/detection/spelled-lookup.js +83 -0
- package/dist/detection/spelled-lookup.js.map +1 -0
- package/dist/detection/unread-content.d.ts +20 -0
- package/dist/detection/unread-content.js +33 -0
- package/dist/detection/unread-content.js.map +1 -0
- package/dist/detection/walk-law.d.ts +11 -21
- package/dist/detection/walk-law.js +14 -22
- package/dist/detection/walk-law.js.map +1 -1
- package/dist/detection/walked-roots.d.ts +17 -0
- package/dist/detection/walked-roots.js +27 -0
- package/dist/detection/walked-roots.js.map +1 -0
- package/dist/detection/withheld.d.ts +100 -0
- package/dist/detection/withheld.js +118 -0
- package/dist/detection/withheld.js.map +1 -0
- package/dist/development/profile.js +1 -1
- package/dist/development/profile.js.map +1 -1
- package/dist/drive/cloud-files/asks.d.ts +7 -0
- package/dist/drive/cloud-files/asks.js +181 -0
- package/dist/drive/cloud-files/asks.js.map +1 -0
- package/dist/drive/cloud-files/binding.d.ts +111 -0
- package/dist/drive/cloud-files/binding.js +31 -0
- package/dist/drive/cloud-files/binding.js.map +1 -0
- package/dist/drive/cloud-files/contents.d.ts +82 -0
- package/dist/drive/cloud-files/contents.js +204 -0
- package/dist/drive/cloud-files/contents.js.map +1 -0
- package/dist/drive/cloud-files/door.d.ts +11 -0
- package/dist/drive/cloud-files/door.js +118 -0
- package/dist/drive/cloud-files/door.js.map +1 -0
- package/dist/drive/cloud-files/paths.d.ts +42 -0
- package/dist/drive/cloud-files/paths.js +93 -0
- package/dist/drive/cloud-files/paths.js.map +1 -0
- package/dist/drive/cloud-files/populated.d.ts +15 -0
- package/dist/drive/cloud-files/populated.js +38 -0
- package/dist/drive/cloud-files/populated.js.map +1 -0
- package/dist/drive/cloud-files/reconcile.d.ts +17 -0
- package/dist/drive/cloud-files/reconcile.js +478 -0
- package/dist/drive/cloud-files/reconcile.js.map +1 -0
- package/dist/drive/cloud-files/sync-root.d.ts +34 -0
- package/dist/drive/cloud-files/sync-root.js +68 -0
- package/dist/drive/cloud-files/sync-root.js.map +1 -0
- package/dist/drive/cloud-files/turns.d.ts +9 -0
- package/dist/drive/cloud-files/turns.js +58 -0
- package/dist/drive/cloud-files/turns.js.map +1 -0
- package/dist/drive/cloud-files/writes.d.ts +27 -0
- package/dist/drive/cloud-files/writes.js +436 -0
- package/dist/drive/cloud-files/writes.js.map +1 -0
- package/dist/drive/computer.d.ts +19 -0
- package/dist/drive/computer.js +61 -0
- package/dist/drive/computer.js.map +1 -0
- package/dist/drive/fuse-opens.d.ts +32 -0
- package/dist/drive/fuse-opens.js +110 -0
- package/dist/drive/fuse-opens.js.map +1 -0
- package/dist/drive/fuse.d.ts +36 -0
- package/dist/drive/fuse.js +102 -0
- package/dist/drive/fuse.js.map +1 -0
- package/dist/drive/kept.d.ts +78 -0
- package/dist/drive/kept.js +263 -0
- package/dist/drive/kept.js.map +1 -0
- package/dist/drive/kernel.d.ts +17 -0
- package/dist/drive/kernel.js +36 -0
- package/dist/drive/kernel.js.map +1 -0
- package/dist/drive/layout.d.ts +18 -0
- package/dist/drive/layout.js +39 -0
- package/dist/drive/layout.js.map +1 -0
- package/dist/drive/mount.d.ts +107 -0
- package/dist/drive/mount.js +259 -0
- package/dist/drive/mount.js.map +1 -0
- package/dist/drive/mountpoint.d.ts +14 -0
- package/dist/drive/mountpoint.js +51 -0
- package/dist/drive/mountpoint.js.map +1 -0
- package/dist/drive/nfs/apple-double.d.ts +6 -0
- package/dist/drive/nfs/apple-double.js +140 -0
- package/dist/drive/nfs/apple-double.js.map +1 -0
- package/dist/drive/nfs/attributes.d.ts +64 -0
- package/dist/drive/nfs/attributes.js +97 -0
- package/dist/drive/nfs/attributes.js.map +1 -0
- package/dist/drive/nfs/handles.d.ts +44 -0
- package/dist/drive/nfs/handles.js +209 -0
- package/dist/drive/nfs/handles.js.map +1 -0
- package/dist/drive/nfs/mount3.d.ts +16 -0
- package/dist/drive/nfs/mount3.js +38 -0
- package/dist/drive/nfs/mount3.js.map +1 -0
- package/dist/drive/nfs/nfs3.d.ts +27 -0
- package/dist/drive/nfs/nfs3.js +516 -0
- package/dist/drive/nfs/nfs3.js.map +1 -0
- package/dist/drive/nfs/rpc.d.ts +66 -0
- package/dist/drive/nfs/rpc.js +122 -0
- package/dist/drive/nfs/rpc.js.map +1 -0
- package/dist/drive/nfs/server.d.ts +30 -0
- package/dist/drive/nfs/server.js +109 -0
- package/dist/drive/nfs/server.js.map +1 -0
- package/dist/drive/nfs/xdr.d.ts +44 -0
- package/dist/drive/nfs/xdr.js +111 -0
- package/dist/drive/nfs/xdr.js.map +1 -0
- package/dist/drive/nfs.d.ts +58 -0
- package/dist/drive/nfs.js +193 -0
- package/dist/drive/nfs.js.map +1 -0
- package/dist/drive/operations.d.ts +180 -0
- package/dist/drive/operations.js +358 -0
- package/dist/drive/operations.js.map +1 -0
- package/dist/drive/shelf.d.ts +9 -0
- package/dist/drive/shelf.js +41 -0
- package/dist/drive/shelf.js.map +1 -0
- package/dist/durability-barrier.d.ts +39 -11
- package/dist/durability-barrier.js +106 -41
- package/dist/durability-barrier.js.map +1 -1
- package/dist/entity-access-wire.d.ts +3 -2
- package/dist/entity-access-wire.js +9 -25
- package/dist/entity-access-wire.js.map +1 -1
- package/dist/entity-channel-holdings.d.ts +7 -7
- package/dist/entity-channel-holdings.js +49 -8
- package/dist/entity-channel-holdings.js.map +1 -1
- package/dist/entity-grant-watch.d.ts +9 -0
- package/dist/entity-grant-watch.js +29 -0
- package/dist/entity-grant-watch.js.map +1 -0
- package/dist/entity-record-observability.d.ts +1 -1
- package/dist/entity-record-observability.js +34 -29
- package/dist/entity-record-observability.js.map +1 -1
- package/dist/entity-record-saves.d.ts +34 -7
- package/dist/entity-record-saves.js +72 -20
- package/dist/entity-record-saves.js.map +1 -1
- package/dist/entity-record-store.d.ts +43 -15
- package/dist/entity-record-store.js +160 -55
- package/dist/entity-record-store.js.map +1 -1
- package/dist/error-facts.d.ts +24 -0
- package/dist/error-facts.js +35 -0
- package/dist/error-facts.js.map +1 -0
- package/dist/faults/drain.d.ts +27 -0
- package/dist/faults/drain.js +211 -0
- package/dist/faults/drain.js.map +1 -0
- package/dist/faults/queue.d.ts +46 -0
- package/dist/faults/queue.js +100 -0
- package/dist/faults/queue.js.map +1 -0
- package/dist/faults/show.d.ts +7 -0
- package/dist/faults/show.js +32 -0
- package/dist/faults/show.js.map +1 -0
- package/dist/files-mcp-host.d.ts +58 -0
- package/dist/files-mcp-host.js +63 -0
- package/dist/files-mcp-host.js.map +1 -0
- package/dist/files-observability.d.ts +5 -2
- package/dist/files-observability.js.map +1 -1
- package/dist/files-program/client.d.ts +136 -0
- package/dist/files-program/client.js +442 -0
- package/dist/files-program/client.js.map +1 -0
- package/dist/files-program/journeys.d.ts +15 -0
- package/dist/files-program/journeys.js +79 -0
- package/dist/files-program/journeys.js.map +1 -0
- package/dist/files-program/program.d.ts +1 -0
- package/dist/files-program/program.js +344 -0
- package/dist/files-program/program.js.map +1 -0
- package/dist/files-program/protocol.d.ts +180 -0
- package/dist/files-program/protocol.js +7 -0
- package/dist/files-program/protocol.js.map +1 -0
- package/dist/files-register-host.d.ts +18 -21
- package/dist/files-register-host.js +104 -94
- package/dist/files-register-host.js.map +1 -1
- package/dist/files-trace.d.ts +29 -9
- package/dist/files-trace.js +58 -14
- package/dist/files-trace.js.map +1 -1
- package/dist/filesystem.d.ts +27 -9
- package/dist/filesystem.js +94 -56
- package/dist/filesystem.js.map +1 -1
- package/dist/flush.d.ts +19 -0
- package/dist/flush.js +84 -0
- package/dist/flush.js.map +1 -0
- package/dist/gateway.js +5 -2
- package/dist/gateway.js.map +1 -1
- package/dist/git/ground-owners.d.ts +15 -0
- package/dist/git/ground-owners.js +67 -0
- package/dist/git/ground-owners.js.map +1 -0
- package/dist/git/held-package.d.ts +67 -0
- package/dist/git/held-package.js +95 -0
- package/dist/git/held-package.js.map +1 -0
- package/dist/git/home.d.ts +59 -0
- package/dist/git/home.js +132 -0
- package/dist/git/home.js.map +1 -0
- package/dist/git/marker.d.ts +21 -0
- package/dist/git/marker.js +30 -0
- package/dist/git/marker.js.map +1 -0
- package/dist/git/named-objects.d.ts +24 -0
- package/dist/git/named-objects.js +176 -0
- package/dist/git/named-objects.js.map +1 -0
- package/dist/git/objects.d.ts +30 -0
- package/dist/git/objects.js +88 -0
- package/dist/git/objects.js.map +1 -0
- package/dist/git/play.d.ts +30 -0
- package/dist/git/play.js +305 -0
- package/dist/git/play.js.map +1 -0
- package/dist/git/quarantine.d.ts +48 -0
- package/dist/git/quarantine.js +150 -0
- package/dist/git/quarantine.js.map +1 -0
- package/dist/git/rail.d.ts +206 -0
- package/dist/git/rail.js +885 -0
- package/dist/git/rail.js.map +1 -0
- package/dist/git/read-state.d.ts +49 -0
- package/dist/git/read-state.js +238 -0
- package/dist/git/read-state.js.map +1 -0
- package/dist/git/repository.d.ts +62 -0
- package/dist/git/repository.js +130 -0
- package/dist/git/repository.js.map +1 -0
- package/dist/git/write-files.d.ts +29 -0
- package/dist/git/write-files.js +215 -0
- package/dist/git/write-files.js.map +1 -0
- package/dist/git-binding.d.ts +37 -49
- package/dist/git-binding.js +262 -134
- package/dist/git-binding.js.map +1 -1
- package/dist/git-cat-file.d.ts +28 -0
- package/dist/git-cat-file.js +125 -0
- package/dist/git-cat-file.js.map +1 -0
- package/dist/git-command.d.ts +45 -10
- package/dist/git-command.js +197 -89
- package/dist/git-command.js.map +1 -1
- package/dist/git-index-entries.d.ts +10 -8
- package/dist/git-index-entries.js +21 -39
- package/dist/git-index-entries.js.map +1 -1
- package/dist/git-index-format.d.ts +35 -18
- package/dist/git-index-format.js +210 -53
- package/dist/git-index-format.js.map +1 -1
- package/dist/git-install-lines.d.ts +12 -0
- package/dist/git-install-lines.js +22 -0
- package/dist/git-install-lines.js.map +1 -0
- package/dist/git-launcher-process.d.ts +1 -0
- package/dist/git-launcher-process.js +81 -0
- package/dist/git-launcher-process.js.map +1 -0
- package/dist/git-launcher.d.ts +70 -0
- package/dist/git-launcher.js +178 -0
- package/dist/git-launcher.js.map +1 -0
- package/dist/graph-heads.d.ts +71 -0
- package/dist/graph-heads.js +90 -0
- package/dist/graph-heads.js.map +1 -0
- package/dist/ground-basis.d.ts +141 -105
- package/dist/ground-basis.js +367 -460
- package/dist/ground-basis.js.map +1 -1
- package/dist/ground-checkpoint-worker.js +26 -25
- package/dist/ground-checkpoint-worker.js.map +1 -1
- package/dist/ground-checkpoints.d.ts +1 -1
- package/dist/ground-checkpoints.js +6 -6
- package/dist/ground-contract.d.ts +11 -0
- package/dist/ground-contract.js +115 -0
- package/dist/ground-contract.js.map +1 -0
- package/dist/ground-coordination.d.ts +30 -20
- package/dist/ground-coordination.js +96 -51
- package/dist/ground-coordination.js.map +1 -1
- package/dist/ground-database.d.ts +11 -13
- package/dist/ground-database.js +283 -97
- package/dist/ground-database.js.map +1 -1
- package/dist/ground-differences.d.ts +19 -18
- package/dist/ground-differences.js +20 -42
- package/dist/ground-differences.js.map +1 -1
- package/dist/ground-initialization.d.ts +3 -0
- package/dist/ground-initialization.js.map +1 -1
- package/dist/ground-install-saves.d.ts +61 -20
- package/dist/ground-install-saves.js +56 -52
- package/dist/ground-install-saves.js.map +1 -1
- package/dist/ground-inventory-schema.d.ts +42 -2
- package/dist/ground-inventory-schema.js +244 -31
- package/dist/ground-inventory-schema.js.map +1 -1
- package/dist/ground-marks.d.ts +49 -0
- package/dist/ground-marks.js +105 -0
- package/dist/ground-marks.js.map +1 -0
- package/dist/ground-profile.d.ts +7 -0
- package/dist/ground-profile.js +85 -16
- package/dist/ground-profile.js.map +1 -1
- package/dist/ground-reads.d.ts +86 -0
- package/dist/ground-reads.js +256 -0
- package/dist/ground-reads.js.map +1 -0
- package/dist/ground-relations.d.ts +57 -0
- package/dist/ground-relations.js +206 -0
- package/dist/ground-relations.js.map +1 -0
- package/dist/ground-root-index.d.ts +3 -2
- package/dist/ground-root-index.js +4 -3
- package/dist/ground-root-index.js.map +1 -1
- package/dist/ground-row.d.ts +23 -7
- package/dist/ground-row.js +27 -11
- package/dist/ground-row.js.map +1 -1
- package/dist/ground-save-ops.d.ts +42 -26
- package/dist/ground-save-ops.js +46 -26
- package/dist/ground-save-ops.js.map +1 -1
- package/dist/ground-saver-worker.js +171 -44
- package/dist/ground-saver-worker.js.map +1 -1
- package/dist/ground-saver.d.ts +35 -7
- package/dist/ground-saver.js +52 -25
- package/dist/ground-saver.js.map +1 -1
- package/dist/ground-store.d.ts +51 -10
- package/dist/ground-store.js +439 -89
- package/dist/ground-store.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/initial-publication.d.ts +42 -0
- package/dist/initial-publication.js +42 -0
- package/dist/initial-publication.js.map +1 -0
- package/dist/installation/environment.d.ts +4 -0
- package/dist/installation/environment.js +13 -0
- package/dist/installation/environment.js.map +1 -1
- package/dist/keychain/cli-io.d.ts +8 -0
- package/dist/keychain/cli-io.js +55 -0
- package/dist/keychain/cli-io.js.map +1 -0
- package/dist/keychain/cli.d.ts +12 -0
- package/dist/keychain/cli.js +48 -0
- package/dist/keychain/cli.js.map +1 -0
- package/dist/keychain/host.d.ts +28 -0
- package/dist/keychain/host.js +43 -0
- package/dist/keychain/host.js.map +1 -0
- package/dist/keychain/http-mount.d.ts +16 -0
- package/dist/keychain/http-mount.js +74 -0
- package/dist/keychain/http-mount.js.map +1 -0
- package/dist/keychain/key-wire.d.ts +12 -0
- package/dist/keychain/key-wire.js +45 -0
- package/dist/keychain/key-wire.js.map +1 -0
- package/dist/keychain/presence-mac.d.ts +8 -0
- package/dist/keychain/presence-mac.js +26 -0
- package/dist/keychain/presence-mac.js.map +1 -0
- package/dist/keychain/presence.d.ts +9 -0
- package/dist/keychain/presence.js +24 -0
- package/dist/keychain/presence.js.map +1 -0
- package/dist/keychain/rail.d.ts +19 -0
- package/dist/keychain/rail.js +20 -0
- package/dist/keychain/rail.js.map +1 -0
- package/dist/keychain/secret-apply.d.ts +22 -0
- package/dist/keychain/secret-apply.js +46 -0
- package/dist/keychain/secret-apply.js.map +1 -0
- package/dist/keychain/shelf-from-ledger.d.ts +15 -0
- package/dist/keychain/shelf-from-ledger.js +18 -0
- package/dist/keychain/shelf-from-ledger.js.map +1 -0
- package/dist/keychain/use-log.d.ts +7 -0
- package/dist/keychain/use-log.js +15 -0
- package/dist/keychain/use-log.js.map +1 -0
- package/dist/keychain/vault-file.d.ts +12 -0
- package/dist/keychain/vault-file.js +19 -0
- package/dist/keychain/vault-file.js.map +1 -0
- package/dist/line-judge.d.ts +39 -0
- package/dist/line-judge.js +177 -0
- package/dist/line-judge.js.map +1 -0
- package/dist/line-loops.d.ts +22 -0
- package/dist/line-loops.js +19 -0
- package/dist/line-loops.js.map +1 -0
- package/dist/link-target.d.ts +16 -0
- package/dist/link-target.js +81 -0
- package/dist/link-target.js.map +1 -0
- package/dist/loop-watch.d.ts +17 -0
- package/dist/loop-watch.js +44 -0
- package/dist/loop-watch.js.map +1 -0
- package/dist/machine-host.d.ts +93 -23
- package/dist/machine-host.js +344 -179
- package/dist/machine-host.js.map +1 -1
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/dist/materialize-records.d.ts +98 -0
- package/dist/materialize-records.js +446 -0
- package/dist/materialize-records.js.map +1 -0
- package/dist/materialized-graph.d.ts +14 -21
- package/dist/materialized-graph.js +1 -135
- package/dist/materialized-graph.js.map +1 -1
- package/dist/mount.d.ts +13 -0
- package/dist/mount.js +33 -0
- package/dist/mount.js.map +1 -0
- package/dist/native/cloud-files.node +0 -0
- package/dist/native/fsevents-stream.node +0 -0
- package/dist/native/inotify.node +0 -0
- package/dist/native/windows-fs.node +0 -0
- package/dist/on-demand-roots.d.ts +31 -0
- package/dist/on-demand-roots.js +18 -0
- package/dist/on-demand-roots.js.map +1 -0
- package/dist/open-standing.d.ts +8 -0
- package/dist/open-standing.js +109 -0
- package/dist/open-standing.js.map +1 -0
- package/dist/own-results.d.ts +37 -0
- package/dist/own-results.js +98 -0
- package/dist/own-results.js.map +1 -0
- package/dist/package-pages.d.ts +41 -0
- package/dist/package-pages.js +76 -0
- package/dist/package-pages.js.map +1 -0
- package/dist/patient-flush.d.ts +24 -0
- package/dist/patient-flush.js +37 -0
- package/dist/patient-flush.js.map +1 -0
- package/dist/physical-path-witness.d.ts +2 -11
- package/dist/physical-path-witness.js +19 -43
- package/dist/physical-path-witness.js.map +1 -1
- package/dist/placement-owed.d.ts +28 -0
- package/dist/placement-owed.js +32 -0
- package/dist/placement-owed.js.map +1 -0
- package/dist/placement-tidy.d.ts +57 -0
- package/dist/placement-tidy.js +313 -0
- package/dist/placement-tidy.js.map +1 -0
- package/dist/platform-product-host.d.ts +12 -0
- package/dist/platform-product-host.js +23 -1
- package/dist/platform-product-host.js.map +1 -1
- package/dist/platform-tools.d.ts +1 -0
- package/dist/platform-tools.js +11 -1
- package/dist/platform-tools.js.map +1 -1
- package/dist/process-lifecycle.d.ts +7 -0
- package/dist/process-lifecycle.js +13 -0
- package/dist/process-lifecycle.js.map +1 -1
- package/dist/pty-host.d.ts +2 -0
- package/dist/pty-host.js +1 -0
- package/dist/pty-host.js.map +1 -1
- package/dist/received-state.d.ts +90 -0
- package/dist/received-state.js +167 -0
- package/dist/received-state.js.map +1 -0
- package/dist/reference-placement.d.ts +26 -0
- package/dist/reference-placement.js +121 -0
- package/dist/reference-placement.js.map +1 -0
- package/dist/registry-graph.d.ts +63 -55
- package/dist/registry-graph.js +291 -170
- package/dist/registry-graph.js.map +1 -1
- package/dist/registry-page-cache.d.ts +2 -4
- package/dist/registry-page-cache.js.map +1 -1
- package/dist/root-install.d.ts +72 -0
- package/dist/root-install.js +178 -0
- package/dist/root-install.js.map +1 -0
- package/dist/runtime-activity.d.ts +20 -0
- package/dist/runtime-activity.js +86 -0
- package/dist/runtime-activity.js.map +1 -0
- package/dist/runtime-argv.d.ts +8 -0
- package/dist/runtime-argv.js +37 -0
- package/dist/runtime-argv.js.map +1 -0
- package/dist/runtime-command-host.d.ts +9 -3
- package/dist/runtime-command-host.js +27 -7
- package/dist/runtime-command-host.js.map +1 -1
- package/dist/runtime-node-flags.d.ts +6 -6
- package/dist/runtime-node-flags.js +6 -6
- package/dist/runtime-wire-host.d.ts +4 -1
- package/dist/runtime-wire-host.js +11 -6
- package/dist/runtime-wire-host.js.map +1 -1
- package/dist/sha256.d.ts +1 -0
- package/dist/sha256.js +4 -0
- package/dist/sha256.js.map +1 -0
- package/dist/sharing-admission.d.ts +9 -4
- package/dist/sharing-admission.js +57 -98
- package/dist/sharing-admission.js.map +1 -1
- package/dist/sharing-host.d.ts +6 -11
- package/dist/sharing-host.js +6 -10
- package/dist/sharing-host.js.map +1 -1
- package/dist/snapshot-delivery-baseline.d.ts +23 -13
- package/dist/snapshot-delivery-baseline.js +37 -40
- package/dist/snapshot-delivery-baseline.js.map +1 -1
- package/dist/socket-marking.d.ts +9 -0
- package/dist/socket-marking.js +26 -0
- package/dist/socket-marking.js.map +1 -0
- package/dist/source-proof.d.ts +2 -15
- package/dist/source-proof.js +9 -4
- package/dist/source-proof.js.map +1 -1
- package/dist/source-signature.d.ts +122 -21
- package/dist/source-signature.js +139 -28
- package/dist/source-signature.js.map +1 -1
- package/dist/source-witness.d.ts +2 -8
- package/dist/source-witness.js +1 -14
- package/dist/source-witness.js.map +1 -1
- package/dist/sqlite-durability.d.ts +1 -0
- package/dist/sqlite-durability.js +2 -0
- package/dist/sqlite-durability.js.map +1 -1
- package/dist/sqlite.js +8 -8
- package/dist/sqlite.js.map +1 -1
- package/dist/sync-address.d.ts +0 -3
- package/dist/sync-address.js +1 -23
- package/dist/sync-address.js.map +1 -1
- package/dist/sync-cli.d.ts +6 -2
- package/dist/sync-cli.js +19 -4
- package/dist/sync-cli.js.map +1 -1
- package/dist/sync-setting.d.ts +16 -1
- package/dist/sync-setting.js +6 -0
- package/dist/sync-setting.js.map +1 -1
- package/dist/transfer-instrumentation.d.ts +3 -3
- package/dist/transfer-instrumentation.js +7 -5
- package/dist/transfer-instrumentation.js.map +1 -1
- package/dist/turns.d.ts +4 -2
- package/dist/turns.js +17 -15
- package/dist/turns.js.map +1 -1
- package/dist/updates/artifacts.d.ts +9 -4
- package/dist/updates/artifacts.js +132 -9
- package/dist/updates/artifacts.js.map +1 -1
- package/dist/updates/controller.js +4 -3
- package/dist/updates/controller.js.map +1 -1
- package/dist/updates/locked-packages.d.ts +4 -0
- package/dist/updates/locked-packages.js +26 -0
- package/dist/updates/locked-packages.js.map +1 -0
- package/dist/updates/store.d.ts +5 -4
- package/dist/updates/store.js +5 -4
- package/dist/updates/store.js.map +1 -1
- package/dist/user-ground-host.d.ts +534 -179
- package/dist/user-ground-host.js +3293 -5218
- package/dist/user-ground-host.js.map +1 -1
- package/dist/watching/fsevents.d.ts +22 -6
- package/dist/watching/fsevents.js +29 -7
- package/dist/watching/fsevents.js.map +1 -1
- package/dist/watching/git-storage.d.ts +22 -0
- package/dist/watching/git-storage.js +125 -0
- package/dist/watching/git-storage.js.map +1 -0
- package/dist/watching/host.d.ts +149 -23
- package/dist/watching/host.js +706 -206
- package/dist/watching/host.js.map +1 -1
- package/dist/watching/index.d.ts +3 -2
- package/dist/watching/index.js +2 -1
- package/dist/watching/index.js.map +1 -1
- package/dist/watching/inotify.d.ts +81 -0
- package/dist/watching/inotify.js +184 -0
- package/dist/watching/inotify.js.map +1 -0
- package/dist/windows-fs.d.ts +12 -0
- package/dist/windows-fs.js +19 -0
- package/dist/windows-fs.js.map +1 -0
- package/dist/windows-owner-only.d.ts +6 -0
- package/dist/windows-owner-only.js +84 -0
- package/dist/windows-owner-only.js.map +1 -0
- package/dist/wire-client.d.ts +13 -11
- package/dist/wire-client.js +51 -78
- package/dist/wire-client.js.map +1 -1
- package/dist/wire-join.d.ts +19 -0
- package/dist/wire-join.js +54 -0
- package/dist/wire-join.js.map +1 -0
- package/dist/wire-outbox.d.ts +3 -0
- package/dist/wire-outbox.js +6 -1
- package/dist/wire-outbox.js.map +1 -1
- package/dist/wire-request-scope.d.ts +2 -1
- package/dist/wire-request-scope.js +2 -1
- package/dist/wire-request-scope.js.map +1 -1
- package/dist/workspace-add-intent.d.ts +41 -0
- package/dist/workspace-add-intent.js +107 -0
- package/dist/workspace-add-intent.js.map +1 -0
- package/dist/workspace-add-staging.d.ts +78 -74
- package/dist/workspace-add-staging.js +131 -179
- package/dist/workspace-add-staging.js.map +1 -1
- package/dist/workspace-host.d.ts +17 -0
- package/dist/workspace-host.js +17 -21
- package/dist/workspace-host.js.map +1 -1
- package/examinations/fixtures/private-wire-authority.js +534 -499
- package/examinations/native-service.mjs +29 -4
- package/examinations/runtime-upgrade.native-test.mjs +16 -1
- package/npm-shrinkwrap.json +253 -464
- package/package.json +29 -33
- package/dist/apply-cleanup.d.ts +0 -28
- package/dist/apply-cleanup.js +0 -166
- package/dist/apply-cleanup.js.map +0 -1
- package/dist/apply-recovery.d.ts +0 -47
- package/dist/apply-recovery.js +0 -100
- package/dist/apply-recovery.js.map +0 -1
- package/dist/apply-rows.d.ts +0 -72
- package/dist/apply-rows.js +0 -150
- package/dist/apply-rows.js.map +0 -1
- package/dist/apply-saves.d.ts +0 -85
- package/dist/apply-saves.js +0 -238
- package/dist/apply-saves.js.map +0 -1
- package/dist/bounded-for-each.d.ts +0 -3
- package/dist/bounded-for-each.js +0 -26
- package/dist/bounded-for-each.js.map +0 -1
- package/dist/content-cache-ownership.d.ts +0 -13
- package/dist/content-cache-ownership.js +0 -75
- package/dist/content-cache-ownership.js.map +0 -1
- package/dist/content-stream-thread.d.ts +0 -60
- package/dist/content-stream-thread.js +0 -95
- package/dist/content-stream-thread.js.map +0 -1
- package/dist/content-stream-worker.d.ts +0 -7
- package/dist/content-stream-worker.js +0 -52
- package/dist/content-stream-worker.js.map +0 -1
- package/dist/declaration-absorption.d.ts +0 -37
- package/dist/declaration-absorption.js +0 -119
- package/dist/declaration-absorption.js.map +0 -1
- package/dist/declaration-chain.d.ts +0 -36
- package/dist/declaration-chain.js +0 -96
- package/dist/declaration-chain.js.map +0 -1
- package/dist/declaration-commit.d.ts +0 -31
- package/dist/declaration-commit.js +0 -49
- package/dist/declaration-commit.js.map +0 -1
- package/dist/declaration-hold.d.ts +0 -22
- package/dist/declaration-hold.js +0 -24
- package/dist/declaration-hold.js.map +0 -1
- package/dist/declaration-journal.d.ts +0 -62
- package/dist/declaration-journal.js +0 -99
- package/dist/declaration-journal.js.map +0 -1
- package/dist/declaration-save.d.ts +0 -31
- package/dist/declaration-save.js +0 -134
- package/dist/declaration-save.js.map +0 -1
- package/dist/detection/disposition-rows.d.ts +0 -18
- package/dist/detection/disposition-rows.js +0 -29
- package/dist/detection/disposition-rows.js.map +0 -1
- package/dist/detection/git-notice.d.ts +0 -88
- package/dist/detection/git-notice.js +0 -444
- package/dist/detection/git-notice.js.map +0 -1
- package/dist/detection/held-territory.d.ts +0 -51
- package/dist/detection/held-territory.js +0 -205
- package/dist/detection/held-territory.js.map +0 -1
- package/dist/detection/name-reach.d.ts +0 -12
- package/dist/detection/name-reach.js +0 -28
- package/dist/detection/name-reach.js.map +0 -1
- package/dist/detection/portable.d.ts +0 -66
- package/dist/detection/portable.js +0 -137
- package/dist/detection/portable.js.map +0 -1
- package/dist/detection/repository-publication.d.ts +0 -20
- package/dist/detection/repository-publication.js +0 -79
- package/dist/detection/repository-publication.js.map +0 -1
- package/dist/detection/repository-routes.d.ts +0 -43
- package/dist/detection/repository-routes.js +0 -98
- package/dist/detection/repository-routes.js.map +0 -1
- package/dist/detection/seal-law.d.ts +0 -66
- package/dist/detection/seal-law.js +0 -116
- package/dist/detection/seal-law.js.map +0 -1
- package/dist/detection/verified-content.d.ts +0 -6
- package/dist/detection/verified-content.js +0 -12
- package/dist/detection/verified-content.js.map +0 -1
- package/dist/entity-apply-host.d.ts +0 -80
- package/dist/entity-apply-host.js +0 -2316
- package/dist/entity-apply-host.js.map +0 -1
- package/dist/entity-apply-store.d.ts +0 -105
- package/dist/entity-apply-store.js +0 -290
- package/dist/entity-apply-store.js.map +0 -1
- package/dist/git-capture.d.ts +0 -36
- package/dist/git-capture.js +0 -91
- package/dist/git-capture.js.map +0 -1
- package/dist/git-card.d.ts +0 -17
- package/dist/git-card.js +0 -133
- package/dist/git-card.js.map +0 -1
- package/dist/git-checkpoint-construction.d.ts +0 -40
- package/dist/git-checkpoint-construction.js +0 -102
- package/dist/git-checkpoint-construction.js.map +0 -1
- package/dist/git-checkpoint-preparation.d.ts +0 -37
- package/dist/git-checkpoint-preparation.js +0 -145
- package/dist/git-checkpoint-preparation.js.map +0 -1
- package/dist/git-configuration.d.ts +0 -40
- package/dist/git-configuration.js +0 -217
- package/dist/git-configuration.js.map +0 -1
- package/dist/git-evidence.d.ts +0 -61
- package/dist/git-evidence.js +0 -181
- package/dist/git-evidence.js.map +0 -1
- package/dist/git-index-witness.d.ts +0 -33
- package/dist/git-index-witness.js +0 -69
- package/dist/git-index-witness.js.map +0 -1
- package/dist/git-literal-host.d.ts +0 -82
- package/dist/git-literal-host.js +0 -173
- package/dist/git-literal-host.js.map +0 -1
- package/dist/git-literal-read.d.ts +0 -88
- package/dist/git-literal-read.js +0 -170
- package/dist/git-literal-read.js.map +0 -1
- package/dist/git-literal-replay.d.ts +0 -33
- package/dist/git-literal-replay.js +0 -269
- package/dist/git-literal-replay.js.map +0 -1
- package/dist/git-native-file.d.ts +0 -42
- package/dist/git-native-file.js +0 -145
- package/dist/git-native-file.js.map +0 -1
- package/dist/git-native-index.d.ts +0 -21
- package/dist/git-native-index.js +0 -44
- package/dist/git-native-index.js.map +0 -1
- package/dist/git-operation-host.d.ts +0 -48
- package/dist/git-operation-host.js +0 -127
- package/dist/git-operation-host.js.map +0 -1
- package/dist/git-private-index.d.ts +0 -11
- package/dist/git-private-index.js +0 -42
- package/dist/git-private-index.js.map +0 -1
- package/dist/git-private-repository.d.ts +0 -4
- package/dist/git-private-repository.js +0 -69
- package/dist/git-private-repository.js.map +0 -1
- package/dist/git-private-view.d.ts +0 -57
- package/dist/git-private-view.js +0 -240
- package/dist/git-private-view.js.map +0 -1
- package/dist/git-ref-store.d.ts +0 -12
- package/dist/git-ref-store.js +0 -68
- package/dist/git-ref-store.js.map +0 -1
- package/dist/git-registration-host.d.ts +0 -38
- package/dist/git-registration-host.js +0 -96
- package/dist/git-registration-host.js.map +0 -1
- package/dist/git-repository-host.d.ts +0 -191
- package/dist/git-repository-host.js +0 -917
- package/dist/git-repository-host.js.map +0 -1
- package/dist/git-worktree-host.d.ts +0 -2
- package/dist/git-worktree-host.js +0 -16
- package/dist/git-worktree-host.js.map +0 -1
- package/dist/graph-publication.d.ts +0 -75
- package/dist/graph-publication.js +0 -203
- package/dist/graph-publication.js.map +0 -1
- package/dist/ground-territory.d.ts +0 -130
- package/dist/ground-territory.js +0 -511
- package/dist/ground-territory.js.map +0 -1
- package/dist/register-upload-fusion.d.ts +0 -84
- package/dist/register-upload-fusion.js +0 -172
- package/dist/register-upload-fusion.js.map +0 -1
- package/dist/repository-identity-steps.d.ts +0 -5
- package/dist/repository-identity-steps.js +0 -33
- package/dist/repository-identity-steps.js.map +0 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { createReadStream, constants, lstatSync, readdirSync, renameSync } from "node:fs";
|
|
2
|
+
import { copyFile, open, rm } from "node:fs/promises";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { LOCAL_DIR_NAME } from "@amalgm/core/identity";
|
|
6
|
+
import { CONTAINERS, parallelForEach } from "@amalgm/live";
|
|
7
|
+
import { displacedPath } from "./apply-control.js";
|
|
8
|
+
import { moveWithoutReplacing, standing } from "./apply-spelling.js";
|
|
9
|
+
import { ensureDirBeneath } from "./filesystem.js";
|
|
10
|
+
import { contentProven, sourceUnchanged } from "./source-signature.js";
|
|
11
|
+
import { cachedStatement } from "./sqlite.js";
|
|
12
|
+
/** Where one UUID's trashed ground is kept in a binding root. */
|
|
13
|
+
export const trashKeepOf = (root, uuid) => join(root, LOCAL_DIR_NAME, "trash", uuid);
|
|
14
|
+
/** What a window's receipts owe the Trash keeps, in member order: a trashed
|
|
15
|
+
* container Leave keeps what it took, and a container Enter releases its
|
|
16
|
+
* UUID's keep. */
|
|
17
|
+
export function trashSteps(receipts) {
|
|
18
|
+
return receipts.flatMap((receipt) => {
|
|
19
|
+
const root = receipt.root.path, uuid = receipt.intent.entityId;
|
|
20
|
+
if (receipt.kind === "leave" && receipt.target.status === "trashed" && receipt.displaced !== null) {
|
|
21
|
+
return [{ kind: "keep", root, from: displacedPath(receipt.control, uuid),
|
|
22
|
+
into: join(trashKeepOf(root, uuid), receipt.intent.attemptId) }];
|
|
23
|
+
}
|
|
24
|
+
return receipt.kind === "enter" ? [{ kind: "release", keep: trashKeepOf(root, uuid) }] : [];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Runs the steps in order, before the control trees go. A copy that no
|
|
28
|
+
* longer stands was brought home, or kept by an earlier run. */
|
|
29
|
+
export async function settleTrash(steps) {
|
|
30
|
+
for (const step of steps) {
|
|
31
|
+
if (step.kind === "release") {
|
|
32
|
+
await rm(step.keep, { recursive: true, force: true });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (!standing(step.from))
|
|
36
|
+
continue;
|
|
37
|
+
ensureDirBeneath(step.root, dirname(step.into), 0o700);
|
|
38
|
+
moveWithoutReplacing(step.from, step.into);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Notes, at a Leave's end, before its rows leave O, the proof of each file
|
|
42
|
+
* beneath a container whose result is trashed: `top` is its O row and
|
|
43
|
+
* `rows` every O row beneath it. Anything else notes nothing. */
|
|
44
|
+
export function noteKeptProofs(database, input) {
|
|
45
|
+
const { result, top } = input;
|
|
46
|
+
if (result.status !== "trashed" || !CONTAINERS.has(result.type))
|
|
47
|
+
return;
|
|
48
|
+
const note = cachedStatement(database, `INSERT OR REPLACE INTO trash_kept_proofs(uuid, attempt_id, relative_path,
|
|
49
|
+
root_uuid, payload_version, source_signature, sighting) VALUES (?, ?, ?, ?, ?, ?, ?)`);
|
|
50
|
+
const from = top.relativePath === "" ? 0 : top.relativePath.length + 1;
|
|
51
|
+
for (const row of input.rows) {
|
|
52
|
+
if (row.type !== "file.text" && row.type !== "file.binary" || row.rootUUID !== top.rootUUID
|
|
53
|
+
|| !row.payloadVersion || !row.sourceSignature || !row.sighting)
|
|
54
|
+
continue;
|
|
55
|
+
note.run(result.uuid, input.attemptId, row.relativePath.slice(from), row.rootUUID, row.payloadVersion, row.sourceSignature, row.sighting);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Lets a UUID's notes go once it enters again. */
|
|
59
|
+
export const releaseKeptProofs = (database, uuid) => {
|
|
60
|
+
cachedStatement(database, "DELETE FROM trash_kept_proofs WHERE uuid = ?").run(uuid);
|
|
61
|
+
};
|
|
62
|
+
/** Each noted proof of a UUID whose root still stands under the
|
|
63
|
+
* qualification it was sighted under, by where its file lies in `keep`. */
|
|
64
|
+
export function keptProofs(database, keep, uuid) {
|
|
65
|
+
const rows = cachedStatement(database, `SELECT p.attempt_id AS attemptId, p.relative_path AS relativePath,
|
|
66
|
+
p.payload_version AS payloadVersion, p.source_signature AS sourceSignature, p.sighting AS sighting
|
|
67
|
+
FROM trash_kept_proofs p JOIN ground_roots r ON r.root_uuid = p.root_uuid
|
|
68
|
+
WHERE p.uuid = ? AND r.qualification IS NOT NULL
|
|
69
|
+
AND substr(p.sighting, 1, length(r.qualification) + 1) = r.qualification || ':'`)
|
|
70
|
+
.all(uuid);
|
|
71
|
+
return new Map(rows.map(({ attemptId, relativePath, payloadVersion, sourceSignature, sighting }) => [join(keep, attemptId, relativePath), { payloadVersion, sourceSignature, sighting }]));
|
|
72
|
+
}
|
|
73
|
+
/** How many kept files are hashed or placed at once. */
|
|
74
|
+
const PLACING = 8;
|
|
75
|
+
/** Takes every staged file the keep proves into its staged destinations and
|
|
76
|
+
* answers it as downloaded: first each file its noted proof still proves,
|
|
77
|
+
* unread, then, while anything is still wanted, each other file by its hash.
|
|
78
|
+
* A keep that does not stand answers nothing. */
|
|
79
|
+
export async function takeTrashed(input) {
|
|
80
|
+
const wanted = new Set(input.artifacts.map(artifact => artifact.contentHash)
|
|
81
|
+
.filter(hash => (input.staged.destinations.get(hash)?.length ?? 0) > 0));
|
|
82
|
+
const taken = new Map();
|
|
83
|
+
if (wanted.size === 0)
|
|
84
|
+
return taken;
|
|
85
|
+
const take = async (file, hash) => {
|
|
86
|
+
if (!wanted.delete(hash))
|
|
87
|
+
return;
|
|
88
|
+
const destinations = input.staged.destinations.get(hash);
|
|
89
|
+
const placed = await place(file, destinations, input.staged);
|
|
90
|
+
if (placed)
|
|
91
|
+
taken.set(hash, { file: destinations[0].path, bytes: Number(file.stats.size), contentHash: hash });
|
|
92
|
+
else
|
|
93
|
+
wanted.add(hash);
|
|
94
|
+
};
|
|
95
|
+
const proven = [], unproven = [];
|
|
96
|
+
for (const file of keptFiles(input.keep)) {
|
|
97
|
+
const proof = input.proofs.get(file.path);
|
|
98
|
+
if (proof && sourceUnchanged(proof.sourceSignature, file.stats) && contentProven(proof.sourceSignature, proof.sighting)) {
|
|
99
|
+
proven.push([file, proof.payloadVersion]);
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
unproven.push(file);
|
|
103
|
+
}
|
|
104
|
+
await parallelForEach(proven, PLACING, ([file, hash]) => take(file, hash));
|
|
105
|
+
await parallelForEach(unproven, PLACING, async (file) => {
|
|
106
|
+
if (wanted.size > 0)
|
|
107
|
+
await take(file, await hashFile(file.path));
|
|
108
|
+
});
|
|
109
|
+
return taken;
|
|
110
|
+
}
|
|
111
|
+
/** Every regular file beneath the keep. Git's own storage is never a staged
|
|
112
|
+
* file, so its directories are not walked. */
|
|
113
|
+
function keptFiles(keep) {
|
|
114
|
+
const found = [];
|
|
115
|
+
const walk = (directory) => {
|
|
116
|
+
let names;
|
|
117
|
+
try {
|
|
118
|
+
names = readdirSync(directory);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (["ENOENT", "ENOTDIR"].includes(error.code ?? ""))
|
|
122
|
+
return;
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
for (const name of names) {
|
|
126
|
+
const path = join(directory, name);
|
|
127
|
+
const stats = lstatSync(path, { bigint: true });
|
|
128
|
+
if (stats.isDirectory()) {
|
|
129
|
+
if (name !== ".git")
|
|
130
|
+
walk(path);
|
|
131
|
+
}
|
|
132
|
+
else if (stats.isFile())
|
|
133
|
+
found.push({ path, stats });
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
walk(keep);
|
|
137
|
+
return found;
|
|
138
|
+
}
|
|
139
|
+
async function hashFile(file) {
|
|
140
|
+
const hash = createHash("sha256");
|
|
141
|
+
for await (const chunk of createReadStream(file))
|
|
142
|
+
hash.update(chunk);
|
|
143
|
+
return hash.digest("hex");
|
|
144
|
+
}
|
|
145
|
+
/** The object the hash read still stands at its kept name, unchanged. */
|
|
146
|
+
const unchanged = (file) => {
|
|
147
|
+
let now;
|
|
148
|
+
try {
|
|
149
|
+
now = lstatSync(file.path, { bigint: true });
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
return now.isFile() && now.dev === file.stats.dev && now.ino === file.stats.ino
|
|
155
|
+
&& now.size === file.stats.size && now.mtimeNs === file.stats.mtimeNs;
|
|
156
|
+
};
|
|
157
|
+
/** Renames the proven file into its first destination and clones it to the
|
|
158
|
+
* rest, each with its portable mode; false when it moved or changed since
|
|
159
|
+
* its hash, or lies on another device, and the wire supplies it. */
|
|
160
|
+
async function place(file, destinations, staged) {
|
|
161
|
+
const [primary, ...duplicates] = destinations;
|
|
162
|
+
await rm(primary.path, { force: true });
|
|
163
|
+
if (!unchanged(file))
|
|
164
|
+
return false;
|
|
165
|
+
try {
|
|
166
|
+
renameSync(file.path, primary.path);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
if (error.code === "EXDEV")
|
|
170
|
+
return false;
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
await setMode(primary);
|
|
174
|
+
staged.installments.closed(primary.path);
|
|
175
|
+
for (const duplicate of duplicates) {
|
|
176
|
+
await rm(duplicate.path, { force: true });
|
|
177
|
+
await copyFile(primary.path, duplicate.path, constants.COPYFILE_EXCL | constants.COPYFILE_FICLONE);
|
|
178
|
+
await setMode(duplicate);
|
|
179
|
+
staged.installments.closed(duplicate.path);
|
|
180
|
+
staged.installments.wrote(Number(file.stats.size));
|
|
181
|
+
}
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
/** Sets a staged file's portable mode through a no-follow handle. */
|
|
185
|
+
async function setMode(destination) {
|
|
186
|
+
const handle = await open(destination.path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
187
|
+
try {
|
|
188
|
+
await handle.chmod(destination.fileMode);
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
await handle.close();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=apply-trash-keep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-trash-keep.js","sourceRoot":"","sources":["../src/apply-trash-keep.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAoB,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAiD,MAAM,cAAc,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,iEAAiE;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,IAAY,EAAU,E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}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type BinaryApplyPlan, type Recoveries, type CargoWant, type ContentIndex, type LinkApplyPlan, type TextApplyPlan, type TextSplice, type TransferArtifact } from "@amalgm/live";
|
|
2
|
+
import type { GitHeld } from "./apply-git-held.js";
|
|
3
|
+
import type { AddStagingRouting } from "./workspace-add-staging.js";
|
|
4
|
+
export interface LocalApplyArtifact {
|
|
5
|
+
readonly file: string;
|
|
6
|
+
readonly bytes: number;
|
|
7
|
+
readonly contentHash: string;
|
|
8
|
+
}
|
|
9
|
+
/** Seal a set; `onBytes` hears each verified piece of it as it lands and
|
|
10
|
+
* each piece its seal reads to prove it, and `lane` says a fetch lane asked
|
|
11
|
+
* for it. `staged` lands cold ordinary files at an Enter's staged
|
|
12
|
+
* destinations instead (workspace-add-staging.ts). */
|
|
13
|
+
export type ReadContent = (wants: readonly CargoWant[], onBytes: (bytes: number) => void, lane: boolean, staged?: AddStagingRouting) => Promise<ReadonlyMap<string, LocalApplyArtifact>>;
|
|
14
|
+
/** Who hears a read's bytes move: the lane placing its window, if any. A
|
|
15
|
+
* read with a listener is a lane's read. */
|
|
16
|
+
export type OnBytes = ((bytes: number) => void) | undefined;
|
|
17
|
+
export declare class WindowCargo {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(cacheDir: string, download: ReadContent, held?: GitHeld, recoveries?: Recoveries);
|
|
20
|
+
/** The accepted record names its complete result. Prepare it from what
|
|
21
|
+
* this machine holds, `shown` included: the file it shows at the splice's
|
|
22
|
+
* base. It reaches for the wire only when local truth cannot produce the
|
|
23
|
+
* exact bytes. Every path ends at the same immutable cache seal, so a hash
|
|
24
|
+
* mismatch can never be staged. */
|
|
25
|
+
prepare(plan: TextApplyPlan | BinaryApplyPlan | LinkApplyPlan, onBytes?: OnBytes, shown?: string): Promise<LocalApplyArtifact>;
|
|
26
|
+
/** Seal a set of artifacts into the cache, or land them where `staged`
|
|
27
|
+
* places them. An artifact already in flight, fetched ahead or by another
|
|
28
|
+
* member, is joined rather than asked for again, and its reader hears its
|
|
29
|
+
* bytes too; if that flight fails, this read fetches it itself. */
|
|
30
|
+
read(wants: readonly CargoWant[], onBytes?: OnBytes, staged?: AddStagingRouting): Promise<ReadonlyMap<string, LocalApplyArtifact>>;
|
|
31
|
+
/** Fetching ahead: `read`, asking only for what the cache does not
|
|
32
|
+
* already name, this computer's own records' cargo among it. The member
|
|
33
|
+
* that uses a cached name proves it again (`sealed`), so a name is enough
|
|
34
|
+
* here. */
|
|
35
|
+
ahead(wants: readonly CargoWant[]): Promise<void>;
|
|
36
|
+
fly(wants: readonly CargoWant[], onBytes?: OnBytes, staged?: AddStagingRouting): Promise<ReadonlyMap<string, LocalApplyArtifact>>;
|
|
37
|
+
/** A member's own read: `read`, except that an artifact the cloud holds
|
|
38
|
+
* none of goes to recover(). A set names which one only on that failure,
|
|
39
|
+
* by asking for each of its artifacts alone. */
|
|
40
|
+
need(wants: readonly CargoWant[], onBytes?: OnBytes, staged?: AddStagingRouting): Promise<ReadonlyMap<string, LocalApplyArtifact>>;
|
|
41
|
+
readOne(artifact: TransferArtifact, manifest?: ContentIndex, onBytes?: OnBytes): Promise<LocalApplyArtifact>;
|
|
42
|
+
/** The sealed cache's copy, or null; `onBytes` hears the read that proves
|
|
43
|
+
* it. The cache names an artifact only once its journal commits: an absent
|
|
44
|
+
* name is no fault (docs/entity-apply.md). */
|
|
45
|
+
sealed(contentHash: string, onBytes?: OnBytes): Promise<LocalApplyArtifact | null>;
|
|
46
|
+
/** Live's one splice on the exact base, sealed: the cached base, else the
|
|
47
|
+
* file at `shown`, whose bytes may have moved on since they were read
|
|
48
|
+
* there. Null when neither is that base: only a result that is the
|
|
49
|
+
* artifact is sealed. */
|
|
50
|
+
splice(artifact: TransferArtifact, strategy: {
|
|
51
|
+
readonly basePayloadVersion: string;
|
|
52
|
+
readonly delta: TextSplice;
|
|
53
|
+
}, shown?: string): Promise<LocalApplyArtifact | null>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/** The window's cargo: each member's immutable result sealed into the
|
|
2
|
+
* content cache, from what this machine holds or from the wire, joined with
|
|
3
|
+
* the fetch-ahead flights already carrying it. An Enter's cold ordinary
|
|
4
|
+
* files land instead where its staged tree places them, proven as they
|
|
5
|
+
* stream (workspace-add-staging.ts). Every path ends in bytes proven
|
|
6
|
+
* against their hash, so a mismatch can never be staged.
|
|
7
|
+
*
|
|
8
|
+
* One set in flight holds at most its download's byte bound in memory. The
|
|
9
|
+
* lines and their fetching ahead are few and fixed; the fetch lanes are
|
|
10
|
+
* not, so a lane's read says it is one, and every lane's download shares
|
|
11
|
+
* one byte bound, each batch holding its bytes there until it lands. Many
|
|
12
|
+
* lanes cost no more memory than that bound, and a small first open waits
|
|
13
|
+
* for at most one batch, never for a whole large set. A lane joining a
|
|
14
|
+
* flight already in the air adds nothing. A staged read lands inside one
|
|
15
|
+
* Enter's private tree, so it joins any flight but none joins it.
|
|
16
|
+
*
|
|
17
|
+
* A file inside a repository may be a blob that repository's own Git holds:
|
|
18
|
+
* a step back to a branch or stash it keeps. Such a set asks that Git first
|
|
19
|
+
* and the wire only for the rest (apply-git-held.ts); every other file goes
|
|
20
|
+
* to the wire at once.
|
|
21
|
+
*
|
|
22
|
+
* A member's own read that the cloud answers it holds none of names the lost
|
|
23
|
+
* artifact to recover() (Live recover.ts): counted once, and the member then
|
|
24
|
+
* waits on what this computer holds. Fetching ahead only fetches; the member
|
|
25
|
+
* that needs the bytes is the one that counts. */
|
|
26
|
+
import { readFileSync } from "node:fs";
|
|
27
|
+
import { join } from "node:path";
|
|
28
|
+
import { spliceText } from "@amalgm/live";
|
|
29
|
+
import { fence } from "./content-cache-fences.js";
|
|
30
|
+
import { tryLstat } from "./apply-window-ground.js";
|
|
31
|
+
import { hashContentFile } from "./content-cache-host.js";
|
|
32
|
+
import { sealContent } from "./content-capture-pool.js";
|
|
33
|
+
import { sha256Hex } from "./sha256.js";
|
|
34
|
+
import { WireRequestError } from "./wire-client.js";
|
|
35
|
+
export class WindowCargo {
|
|
36
|
+
#cacheDir;
|
|
37
|
+
#download;
|
|
38
|
+
#held;
|
|
39
|
+
#recoveries;
|
|
40
|
+
/** Each artifact being fetched now, by content hash, and the set fetching it. */
|
|
41
|
+
#flights = new Map();
|
|
42
|
+
constructor(cacheDir, download, held, recoveries) {
|
|
43
|
+
this.#cacheDir = cacheDir;
|
|
44
|
+
this.#download = download;
|
|
45
|
+
this.#held = held;
|
|
46
|
+
this.#recoveries = recoveries;
|
|
47
|
+
}
|
|
48
|
+
/** The accepted record names its complete result. Prepare it from what
|
|
49
|
+
* this machine holds, `shown` included: the file it shows at the splice's
|
|
50
|
+
* base. It reaches for the wire only when local truth cannot produce the
|
|
51
|
+
* exact bytes. Every path ends at the same immutable cache seal, so a hash
|
|
52
|
+
* mismatch can never be staged. */
|
|
53
|
+
async prepare(plan, onBytes, shown) {
|
|
54
|
+
const sealed = await this.sealed(plan.artifact.contentHash, onBytes);
|
|
55
|
+
if (sealed)
|
|
56
|
+
return sealed;
|
|
57
|
+
if (plan.kind === "link") {
|
|
58
|
+
await sealContent(this.#cacheDir, plan.artifact, Buffer.from(plan.targetText, "utf8"), "apply");
|
|
59
|
+
const literal = await this.sealed(plan.artifact.contentHash);
|
|
60
|
+
if (literal)
|
|
61
|
+
return literal;
|
|
62
|
+
throw new Error("link Apply could not seal its literal target text");
|
|
63
|
+
}
|
|
64
|
+
if (plan.kind === "file.text" && plan.strategy.kind === "delta") {
|
|
65
|
+
const spliced = await this.splice(plan.artifact, plan.strategy, shown);
|
|
66
|
+
if (spliced)
|
|
67
|
+
return spliced;
|
|
68
|
+
}
|
|
69
|
+
return this.readOne(plan.artifact, plan.kind === "file.binary" ? plan.manifest : undefined, onBytes);
|
|
70
|
+
}
|
|
71
|
+
/** Seal a set of artifacts into the cache, or land them where `staged`
|
|
72
|
+
* places them. An artifact already in flight, fetched ahead or by another
|
|
73
|
+
* member, is joined rather than asked for again, and its reader hears its
|
|
74
|
+
* bytes too; if that flight fails, this read fetches it itself. */
|
|
75
|
+
async read(wants, onBytes, staged) {
|
|
76
|
+
const joined = wants.flatMap(want => {
|
|
77
|
+
const flight = this.#flights.get(want.artifact.contentHash);
|
|
78
|
+
if (flight && onBytes)
|
|
79
|
+
flight.listeners.add(onBytes);
|
|
80
|
+
return flight ? [{ want, flight }] : [];
|
|
81
|
+
});
|
|
82
|
+
const own = wants.filter(want => !this.#flights.has(want.artifact.contentHash));
|
|
83
|
+
const found = new Map(own.length > 0 ? await this.fly(own, onBytes, staged) : []);
|
|
84
|
+
const missed = [];
|
|
85
|
+
for (const { want, flight } of joined) {
|
|
86
|
+
const local = await flight.landing.then(set => set.get(want.artifact.contentHash), () => undefined);
|
|
87
|
+
if (local)
|
|
88
|
+
found.set(want.artifact.contentHash, local);
|
|
89
|
+
else
|
|
90
|
+
missed.push(want);
|
|
91
|
+
}
|
|
92
|
+
if (missed.length > 0)
|
|
93
|
+
for (const [hash, local] of await this.fly(missed, onBytes, staged))
|
|
94
|
+
found.set(hash, local);
|
|
95
|
+
return found;
|
|
96
|
+
}
|
|
97
|
+
/** Fetching ahead: `read`, asking only for what the cache does not
|
|
98
|
+
* already name, this computer's own records' cargo among it. The member
|
|
99
|
+
* that uses a cached name proves it again (`sealed`), so a name is enough
|
|
100
|
+
* here. */
|
|
101
|
+
async ahead(wants) {
|
|
102
|
+
const lacking = wants.filter(want => !tryLstat(join(this.#cacheDir, `${want.artifact.contentHash}.bin`))?.isFile());
|
|
103
|
+
if (lacking.length > 0)
|
|
104
|
+
await this.read(lacking);
|
|
105
|
+
}
|
|
106
|
+
fly(wants, onBytes, staged) {
|
|
107
|
+
const listeners = new Set(onBytes ? [onBytes] : []);
|
|
108
|
+
const hear = (bytes) => {
|
|
109
|
+
for (const listener of listeners)
|
|
110
|
+
listener(bytes);
|
|
111
|
+
};
|
|
112
|
+
const lane = onBytes !== undefined;
|
|
113
|
+
const flight = { listeners,
|
|
114
|
+
landing: staged ? this.#download(wants, hear, lane, staged) : this.#land(wants, hear, lane) };
|
|
115
|
+
if (staged)
|
|
116
|
+
return flight.landing;
|
|
117
|
+
const hashes = wants.map(want => want.artifact.contentHash);
|
|
118
|
+
for (const hash of hashes)
|
|
119
|
+
this.#flights.set(hash, flight);
|
|
120
|
+
const land = () => {
|
|
121
|
+
for (const hash of hashes)
|
|
122
|
+
if (this.#flights.get(hash) === flight)
|
|
123
|
+
this.#flights.delete(hash);
|
|
124
|
+
};
|
|
125
|
+
flight.landing.then(land, land);
|
|
126
|
+
return flight.landing;
|
|
127
|
+
}
|
|
128
|
+
/** A set sealed from its repositories' own Git where they hold it, the
|
|
129
|
+
* rest from the wire. Files away from every repository leave at once. */
|
|
130
|
+
async #land(wants, hear, lane) {
|
|
131
|
+
const placed = this.#held?.place(wants);
|
|
132
|
+
if (!placed || placed.near.size === 0)
|
|
133
|
+
return this.#download(wants, hear, lane);
|
|
134
|
+
const away = placed.away.length > 0 ? this.#download(placed.away, hear, lane) : undefined;
|
|
135
|
+
// Awaited below; until then its failure must not go unheard.
|
|
136
|
+
away?.catch(() => { });
|
|
137
|
+
const found = new Map();
|
|
138
|
+
for await (const { want, bytes } of this.#held.read(placed.near)) {
|
|
139
|
+
if (found.has(want.artifact.contentHash))
|
|
140
|
+
continue;
|
|
141
|
+
await sealContent(this.#cacheDir, want.artifact, bytes, "apply");
|
|
142
|
+
const sealed = await this.sealed(want.artifact.contentHash, hear);
|
|
143
|
+
if (sealed)
|
|
144
|
+
found.set(want.artifact.contentHash, sealed);
|
|
145
|
+
}
|
|
146
|
+
const rest = [...placed.near.values()].flat().map(({ want }) => want)
|
|
147
|
+
.filter(want => !found.has(want.artifact.contentHash));
|
|
148
|
+
const [wire, far] = await Promise.all([rest.length > 0 ? this.#download(rest, hear, lane) : undefined, away]);
|
|
149
|
+
return new Map([...found, ...wire ?? [], ...far ?? []]);
|
|
150
|
+
}
|
|
151
|
+
/** A member's own read: `read`, except that an artifact the cloud holds
|
|
152
|
+
* none of goes to recover(). A set names which one only on that failure,
|
|
153
|
+
* by asking for each of its artifacts alone. */
|
|
154
|
+
async need(wants, onBytes, staged) {
|
|
155
|
+
try {
|
|
156
|
+
return await this.read(wants, onBytes, staged);
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
const [sole] = wants;
|
|
160
|
+
if (!this.#recoveries || !lost(error) || sole === undefined)
|
|
161
|
+
throw error;
|
|
162
|
+
if (wants.length === 1) {
|
|
163
|
+
const { entityId, entityType, contentHash } = sole.artifact;
|
|
164
|
+
throw this.#recoveries.recover({ law: "cargo-missing", trigger: "not-found", subject: { id: entityId, type: entityType }, lost: contentHash });
|
|
165
|
+
}
|
|
166
|
+
const found = new Map();
|
|
167
|
+
for (const want of wants)
|
|
168
|
+
for (const [hash, local] of await this.need([want], onBytes, staged))
|
|
169
|
+
found.set(hash, local);
|
|
170
|
+
return found;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async readOne(artifact, manifest, onBytes) {
|
|
174
|
+
const local = (await this.need([{ artifact, ...(manifest ? { manifest } : {}) }], onBytes)).get(artifact.contentHash);
|
|
175
|
+
if (!local)
|
|
176
|
+
throw new Error(`Apply download set did not seal ${artifact.contentHash}`);
|
|
177
|
+
return local;
|
|
178
|
+
}
|
|
179
|
+
/** The sealed cache's copy, or null; `onBytes` hears the read that proves
|
|
180
|
+
* it. The cache names an artifact only once its journal commits: an absent
|
|
181
|
+
* name is no fault (docs/entity-apply.md). */
|
|
182
|
+
async sealed(contentHash, onBytes) {
|
|
183
|
+
const file = join(this.#cacheDir, `${contentHash}.bin`);
|
|
184
|
+
// The window will carry this name, so it fences it before the look.
|
|
185
|
+
fence(this.#cacheDir, contentHash);
|
|
186
|
+
const stat = tryLstat(file);
|
|
187
|
+
if (!stat?.isFile())
|
|
188
|
+
return null;
|
|
189
|
+
if (await hashContentFile(file, onBytes) !== contentHash)
|
|
190
|
+
return null;
|
|
191
|
+
return { file, bytes: Number(stat.size), contentHash };
|
|
192
|
+
}
|
|
193
|
+
/** Live's one splice on the exact base, sealed: the cached base, else the
|
|
194
|
+
* file at `shown`, whose bytes may have moved on since they were read
|
|
195
|
+
* there. Null when neither is that base: only a result that is the
|
|
196
|
+
* artifact is sealed. */
|
|
197
|
+
async splice(artifact, strategy, shown) {
|
|
198
|
+
for (const file of [join(this.#cacheDir, `${strategy.basePayloadVersion}.bin`), shown]) {
|
|
199
|
+
if (file === undefined)
|
|
200
|
+
continue;
|
|
201
|
+
let base;
|
|
202
|
+
try {
|
|
203
|
+
base = readFileSync(file);
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
const result = spliceText(base, strategy, artifact.contentHash, sha256Hex);
|
|
209
|
+
if (result === null)
|
|
210
|
+
continue;
|
|
211
|
+
await sealContent(this.#cacheDir, artifact, result, "apply");
|
|
212
|
+
return this.sealed(artifact.contentHash);
|
|
213
|
+
}
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/** The cloud answered that it holds none of an object the read named. */
|
|
218
|
+
const lost = (error) => error instanceof WireRequestError && error.code === "entity_content_not_found";
|
|
219
|
+
//# sourceMappingURL=apply-window-cargo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-window-cargo.js","sourceRoot":"","sources":["../src/apply-window-cargo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;kDAwBkD;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EACuB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE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AC,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QACtE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC;IACzD,CAAC;IACD;;;6BAGyB;IACzB,KAAK,CAAC,MAAM,CACV,QAA0B,EAC1B,QAA6E,EAC7E,KAAc;QAEd,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,kBAAkB,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;YACvF,IAAI,IAAI,KAAK,SAAS;gBAAE,SAAS;YACjC,IAAI,IAAY,CAAC;YACjB,IAAI,CAAC;gBACH,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;YACD,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAC3E,IAAI,MAAM,KAAK,IAAI;gBAAE,SAAS;YAC9B,MAAM,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,yEAAyE;AACzE,MAAM,IAAI,GAAG,CAAC,KAAc,EAAW,EAAE,CAAC,KAAK,YAAY,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/** What this computer's rows say about a member's ground: where it stands,
|
|
2
|
+
* where its target goes, the siblings in its way, and whether its root and
|
|
3
|
+
* the directories on its path still stand as this computer last observed
|
|
4
|
+
* them. One reader over the two inventories, O (`entities`, what stands
|
|
5
|
+
* here) and B (`detection_notebook`, what sharing admitted). Reads only;
|
|
6
|
+
* every write is a save. */
|
|
7
|
+
import { type BigIntStats } from "node:fs";
|
|
8
|
+
import { type ApplyGuard, type CloudEntityRecord, type SlotChild, type SlotGroupPort } from "@amalgm/live";
|
|
9
|
+
import type Database from "better-sqlite3";
|
|
10
|
+
import { type GroundRow as StoredGroundRow } from "./ground-row.js";
|
|
11
|
+
export type { StoredGroundRow };
|
|
12
|
+
/** One sibling standing in its target's way: it moves from where it stands
|
|
13
|
+
* to the address its parent's group derives for it. A return moves an
|
|
14
|
+
* entity this computer's own move put inside the target back under the
|
|
15
|
+
* parent the line holds it in (Live `lineReturns`): its destination's folder
|
|
16
|
+
* is that parent, so a move whose folder changes is a return. */
|
|
17
|
+
export interface RoomMove {
|
|
18
|
+
readonly row: StoredGroundRow;
|
|
19
|
+
readonly source: string;
|
|
20
|
+
readonly destination: string;
|
|
21
|
+
}
|
|
22
|
+
/** Where one member's target stands and goes. */
|
|
23
|
+
export interface ApplyAddressContext {
|
|
24
|
+
readonly current: StoredGroundRow | null;
|
|
25
|
+
readonly parent: StoredGroundRow | null;
|
|
26
|
+
readonly targetPath: string;
|
|
27
|
+
readonly targetName: string;
|
|
28
|
+
}
|
|
29
|
+
/** A member's addresses and the room chain: the sibling moves that free its
|
|
30
|
+
* target's derived address. */
|
|
31
|
+
export interface ApplyPathContext extends ApplyAddressContext {
|
|
32
|
+
readonly room: readonly RoomMove[];
|
|
33
|
+
}
|
|
34
|
+
export declare const tryLstat: (path: string) => BigIntStats | null;
|
|
35
|
+
/** A root's binding places it. Add keeps a selected nested folder's or
|
|
36
|
+
* repository's portable parentUUID, so only root_uuid says it is a root. */
|
|
37
|
+
export declare const placedByBinding: (row: StoredGroundRow | null) => row is StoredGroundRow;
|
|
38
|
+
export declare const pathInside: (root: string, candidate: string) => boolean;
|
|
39
|
+
/** What stands at an address or at its nearest ancestor: one lookup per
|
|
40
|
+
* ancestor, never a scan of every path held. */
|
|
41
|
+
export declare const nearestAt: <T>(byPath: ReadonlyMap<string, T>, address: string) => T | undefined;
|
|
42
|
+
/** Held ground covers an address when the address or an ancestor is held. */
|
|
43
|
+
export declare const heldCovers: (held: Iterable<string>) => (address: string) => boolean;
|
|
44
|
+
/** Whether any of these paths may have changed an entity's own ground
|
|
45
|
+
* (Live law B): its address or anything holding it, and beneath it only what
|
|
46
|
+
* its truth reads. A repository's truth is its Git directory, never its
|
|
47
|
+
* checkout, whose files are entities of their own; beneath any other entity
|
|
48
|
+
* every path counts. Each path's ancestors are listed once, so a question is
|
|
49
|
+
* a lookup. */
|
|
50
|
+
export declare const meetsGround: (paths: readonly string[]) => (row: Pick<StoredGroundRow, "type" | "absolutePath">) => boolean;
|
|
51
|
+
export declare class WindowGround {
|
|
52
|
+
#private;
|
|
53
|
+
readonly database: Database.Database;
|
|
54
|
+
constructor(database: Database.Database);
|
|
55
|
+
/** O's active row for an entity, or null. */
|
|
56
|
+
current(entityId: string): StoredGroundRow | null;
|
|
57
|
+
/** O's row for an entity, any status. */
|
|
58
|
+
observed(entityId: string): StoredGroundRow | undefined;
|
|
59
|
+
/** B's row for an entity, any status. */
|
|
60
|
+
shared(entityId: string): StoredGroundRow | undefined;
|
|
61
|
+
/** O's active row at an absolute path. */
|
|
62
|
+
atPath(path: string): StoredGroundRow | undefined;
|
|
63
|
+
/** O's active rows at these addresses, by address, in one statement. */
|
|
64
|
+
atPaths(paths: readonly string[]): ReadonlyMap<string, StoredGroundRow>;
|
|
65
|
+
/** O's active rows of these entities standing outside both addresses and
|
|
66
|
+
* everything beneath them, in one statement: an entity standing inside
|
|
67
|
+
* costs no row. */
|
|
68
|
+
standingOutside(entityIds: readonly string[], first: string, second: string): readonly StoredGroundRow[];
|
|
69
|
+
rowsUnder(inventory: "entities" | "detection_notebook", rootUUID: string, relativePath: string): readonly StoredGroundRow[];
|
|
70
|
+
/** The containers O holds at `path` and beneath it whose `.git` sharing
|
|
71
|
+
* never held: one naming no repository, or one O does not record as a
|
|
72
|
+
* repository yet. It has no copy anywhere else. */
|
|
73
|
+
unsharedGitWithin(path: string): readonly string[];
|
|
74
|
+
/** The entities beneath `container` whose local result has no authority
|
|
75
|
+
* sequence yet. */
|
|
76
|
+
pendingWithin(authorityId: string, container: StoredGroundRow): readonly string[];
|
|
77
|
+
/** Every root this computer binds, as its own row stands. */
|
|
78
|
+
bindingRoots(): readonly {
|
|
79
|
+
readonly absolutePath: string;
|
|
80
|
+
readonly physicalKey: string;
|
|
81
|
+
}[];
|
|
82
|
+
root(current: StoredGroundRow): StoredGroundRow;
|
|
83
|
+
placedParent(row: StoredGroundRow): StoredGroundRow;
|
|
84
|
+
/** Every address a member touches lies in its binding: the root its
|
|
85
|
+
* placed row, or else its parent, is materialized in. */
|
|
86
|
+
bindingRoot(context: ApplyAddressContext): string;
|
|
87
|
+
samePhysicalDirectory(row: StoredGroundRow): boolean;
|
|
88
|
+
/** Whether the row and every container above it, to its root, stand as O
|
|
89
|
+
* last observed them. `proved` keeps the rows whose chains one guard has
|
|
90
|
+
* already read, so the guard asks for each directory on its paths once. */
|
|
91
|
+
directoryAncestorsMatch(row: StoredGroundRow, proved?: Map<string, StoredGroundRow>): boolean;
|
|
92
|
+
/** Whether every directory a guard proved still stands: the guard keeps
|
|
93
|
+
* the rows it read and reads only the disk again as it closes, after its
|
|
94
|
+
* last wait, so the check that authorizes the effect stays the latest. */
|
|
95
|
+
directoriesStand(proved: ReadonlyMap<string, StoredGroundRow>): boolean;
|
|
96
|
+
/** Byte equality cannot adopt a replaced populated directory. Leaves may
|
|
97
|
+
* have a new inode after an ordinary atomic save; containers retain their
|
|
98
|
+
* proven physical identity until Detect or Apply accounts for a move. */
|
|
99
|
+
physicalDirectoriesMatch(row: StoredGroundRow, proved?: Map<string, StoredGroundRow>): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* A member's addresses and the sibling moves that make room for its
|
|
102
|
+
* target, derived from current rows. A shown result takes its derived
|
|
103
|
+
* address beneath its parent, or a root its machine binding. A Leave is
|
|
104
|
+
* placed by the ground it leaves. Apply moves only the siblings standing in
|
|
105
|
+
* its target's way, each to its own derived address, until an address no
|
|
106
|
+
* sibling holds; each derived name in one group is distinct, so the chain
|
|
107
|
+
* is finite. Null when current rows cannot place the member: the showing
|
|
108
|
+
* law judges these same rows, so the guard then finds the play changed. A
|
|
109
|
+
* row beneath a folder in Trash shows nothing, so it places nothing: a
|
|
110
|
+
* result that leaves that folder enters where it lands.
|
|
111
|
+
*
|
|
112
|
+
* `returns` (Live `lineReturns`) are the entities this computer's own
|
|
113
|
+
* move put inside the target, each with the line parent it goes back to
|
|
114
|
+
* first. Every address is derived from current rows, then read at where
|
|
115
|
+
* it stands once the returns have moved.
|
|
116
|
+
*/
|
|
117
|
+
context(target: CloudEntityRecord, leaving: boolean, returns?: ReadonlyMap<string, string>): ApplyPathContext | null;
|
|
118
|
+
/** The parent's children with the target at its result. B determines
|
|
119
|
+
* admitted portable slots; the whole group is read at most once, and only
|
|
120
|
+
* when a shared name needs it. */
|
|
121
|
+
slotGroup(parentUUID: string, target: SlotChild): SlotGroupPort;
|
|
122
|
+
/** The parent's active child in B, other than the target, whose ground O
|
|
123
|
+
* records at this address. */
|
|
124
|
+
siblingAt(parentUUID: string, path: string, targetUUID: string): StoredGroundRow | null;
|
|
125
|
+
/** A root that does not stand as this computer last observed it holds the
|
|
126
|
+
* line until Detect observes it again and its capability returns. */
|
|
127
|
+
unavailableRoot(target: CloudEntityRecord): Extract<ApplyGuard, {
|
|
128
|
+
kind: "dependency";
|
|
129
|
+
}> | null;
|
|
130
|
+
}
|