@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,63 @@
|
|
|
1
|
+
import { type FingerprintClock, type FingerprintOptions } from "./apply-fingerprint.js";
|
|
2
|
+
import { type Remainder } from "./apply-kept.js";
|
|
3
|
+
import type { ContentStamp } from "./content-clock.js";
|
|
4
|
+
import type { GroundRow } from "./ground-row.js";
|
|
5
|
+
export interface DisplacedTreeManifest {
|
|
6
|
+
readonly contract: "amalgm.apply-displaced-tree@2";
|
|
7
|
+
/** The clock the fingerprint was taken under. */
|
|
8
|
+
readonly clock: FingerprintClock | null;
|
|
9
|
+
/** Every name beneath the directory but `aside` (apply-fingerprint.ts). */
|
|
10
|
+
readonly digest: string;
|
|
11
|
+
/** What a matching Verify keeps rather than lets go: the topmost local
|
|
12
|
+
* remainder and each computer-only directory, with the shared container
|
|
13
|
+
* it belongs to. */
|
|
14
|
+
readonly aside: readonly Remainder[];
|
|
15
|
+
}
|
|
16
|
+
export type DisplacedTreeProof = {
|
|
17
|
+
readonly kind: "proved";
|
|
18
|
+
readonly manifest: DisplacedTreeManifest;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: "differs";
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
};
|
|
23
|
+
type Reads = Pick<FingerprintOptions, "onRead" | "onBytes">;
|
|
24
|
+
/**
|
|
25
|
+
* Proves the directory at `source`, O's `owner`, holds exactly O's `rows`
|
|
26
|
+
* beneath it, and takes its manifest under `stamp`, the clock stamped before
|
|
27
|
+
* the walk. `aside` is its topmost local remainder; `shows` reads whether a
|
|
28
|
+
* leaf, link, reference or repository stands as its O row says.
|
|
29
|
+
*/
|
|
30
|
+
export declare function proveDisplacedTree(input: {
|
|
31
|
+
readonly source: string;
|
|
32
|
+
readonly owner: string;
|
|
33
|
+
readonly rows: readonly GroundRow[];
|
|
34
|
+
readonly aside: readonly Remainder[];
|
|
35
|
+
readonly stamp: ContentStamp;
|
|
36
|
+
readonly shows: (row: GroundRow, path: string) => Promise<boolean>;
|
|
37
|
+
} & Reads): Promise<DisplacedTreeProof>;
|
|
38
|
+
/** Whether the copy at `displaced`, taken from `source`, still holds every
|
|
39
|
+
* name its manifest signed, read under the clock it was signed under, whose
|
|
40
|
+
* qualification the caller proves still stands. Nothing displaced has
|
|
41
|
+
* nothing to lose. */
|
|
42
|
+
export declare function displacedTreeShows(displaced: string, source: string, manifest: DisplacedTreeManifest, reads?: Reads): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Brings a source its member set aside home: to `home` when nothing stands
|
|
45
|
+
* there and `homeFree` holds, since the member's own reveal no longer holds
|
|
46
|
+
* it. Otherwise a person's object holds its home, and each name beneath a
|
|
47
|
+
* directory is kept for `owner`, the container it was (apply-kept.ts); a
|
|
48
|
+
* file or link set aside is O, which its final guard proved, and goes with
|
|
49
|
+
* the window. Names the directories owed a flush, and whether anything was
|
|
50
|
+
* kept; nothing displaced has nothing to bring.
|
|
51
|
+
*/
|
|
52
|
+
export declare function bringDisplacedHome(input: {
|
|
53
|
+
readonly displaced: string;
|
|
54
|
+
readonly home: string;
|
|
55
|
+
readonly homeFree: boolean;
|
|
56
|
+
readonly root: string;
|
|
57
|
+
readonly owner: string;
|
|
58
|
+
readonly attemptId: string;
|
|
59
|
+
}): {
|
|
60
|
+
readonly flush: readonly string[];
|
|
61
|
+
readonly kept: boolean;
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** The directory a received result displaces whole: a Leave's container, or
|
|
2
|
+
* a container a leaf, link or reference replaces. It moves aside into its
|
|
3
|
+
* window's control tree and goes only at the durability point, so Apply
|
|
4
|
+
* deletes nothing beneath it that a person wrote.
|
|
5
|
+
*
|
|
6
|
+
* - The final guard stamps its root's content clock, then walks every name
|
|
7
|
+
* beneath it by Detect's walk law (src/detection/root-examination.ts) and
|
|
8
|
+
* proves each is O: a name O does not hold, a row O holds that stands
|
|
9
|
+
* nowhere, a parent, type or object that differs, or a leaf, link,
|
|
10
|
+
* reference or repository whose ground shows another result is a person's
|
|
11
|
+
* change, which Detect records before Apply looks again.
|
|
12
|
+
* - The same walk takes the tree's fingerprint (apply-fingerprint.ts), which
|
|
13
|
+
* the receipt binds before any effect. Each name joins it before its
|
|
14
|
+
* ground is read, so a write after that read differs from it.
|
|
15
|
+
* - The reveal only takes the directory aside. Its member's Verify takes the
|
|
16
|
+
* copy's fingerprint again before it judges anything else, and the copy
|
|
17
|
+
* goes only when that member's Verify matches. Every other answer brings
|
|
18
|
+
* it home first (bringDisplacedHome), so Verify's next read finds the
|
|
19
|
+
* person's version, which Detect records as the newest result.
|
|
20
|
+
* - Local remainder (apply-kept.ts) and each computer-only `.amalgm` or
|
|
21
|
+
* `.private` beneath it are set aside: the walk neither compares nor
|
|
22
|
+
* digests them, and only a matching Verify keeps them.
|
|
23
|
+
*
|
|
24
|
+
* Residuals: a writer holding a file open, or a shell whose working
|
|
25
|
+
* directory is inside the copy, can still write after Verify's read and
|
|
26
|
+
* before the durability point. A root that leaves between the reveal and
|
|
27
|
+
* Verify keeps the copy in its own control tree, which nothing reads until
|
|
28
|
+
* the root returns. */
|
|
29
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
30
|
+
import { isLocalOnlyPath } from "@amalgm/core/identity";
|
|
31
|
+
import { classifyDirectory, CONTAINERS, isRepositoryMetadataEntry } from "@amalgm/live";
|
|
32
|
+
import { clockBoundary, fingerprintClock, fingerprintTree } from "./apply-fingerprint.js";
|
|
33
|
+
import { keepAside } from "./apply-kept.js";
|
|
34
|
+
import { moveWithoutReplacing } from "./apply-spelling.js";
|
|
35
|
+
import { listAgain, railChanged } from "./detection/walk-law.js";
|
|
36
|
+
import { marksRepository, observeGitMarker } from "./git/marker.js";
|
|
37
|
+
import { optionalLstat } from "./physical-path-witness.js";
|
|
38
|
+
import { physicalKey } from "./source-signature.js";
|
|
39
|
+
/**
|
|
40
|
+
* Proves the directory at `source`, O's `owner`, holds exactly O's `rows`
|
|
41
|
+
* beneath it, and takes its manifest under `stamp`, the clock stamped before
|
|
42
|
+
* the walk. `aside` is its topmost local remainder; `shows` reads whether a
|
|
43
|
+
* leaf, link, reference or repository stands as its O row says.
|
|
44
|
+
*/
|
|
45
|
+
export async function proveDisplacedTree(input) {
|
|
46
|
+
const aside = [...input.aside];
|
|
47
|
+
const skipped = new Set(aside.map(({ path }) => relative(input.source, path)));
|
|
48
|
+
const byPath = new Map(input.rows.map(row => [row.absolutePath, row]));
|
|
49
|
+
const reached = new Set();
|
|
50
|
+
// The O container each walked directory is; Git's own storage beneath a
|
|
51
|
+
// repository is digested but never compared.
|
|
52
|
+
const owners = new Map([[input.source, input.owner]]);
|
|
53
|
+
const skips = (relativePath, parent) => {
|
|
54
|
+
if (skipped.has(relativePath))
|
|
55
|
+
return true;
|
|
56
|
+
const owner = owners.get(parent);
|
|
57
|
+
if (!owner || !isLocalOnlyPath(basename(relativePath)))
|
|
58
|
+
return false;
|
|
59
|
+
aside.push({ owner, path: join(input.source, relativePath) });
|
|
60
|
+
skipped.add(relativePath);
|
|
61
|
+
return true;
|
|
62
|
+
};
|
|
63
|
+
const clock = fingerprintClock(input.stamp);
|
|
64
|
+
const walked = await fingerprintTree(input.source, { clock: clockBoundary(clock), skips, onRead: input.onRead,
|
|
65
|
+
onBytes: input.onBytes, visit: async ({ path, parent, stats }) => {
|
|
66
|
+
const owner = owners.get(parent);
|
|
67
|
+
if (!owner || isRepositoryMetadataEntry(basename(path))) {
|
|
68
|
+
if (stats.isDirectory())
|
|
69
|
+
owners.set(path, null);
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const supported = stats.isDirectory() || stats.isFile() || stats.isSymbolicLink();
|
|
73
|
+
const row = byPath.get(path);
|
|
74
|
+
if (!row)
|
|
75
|
+
return supported ? `${path} is a name O does not hold` : null;
|
|
76
|
+
if (row.parentUUID !== owner)
|
|
77
|
+
return `${path} stands under another parent`;
|
|
78
|
+
if (!supported)
|
|
79
|
+
return `${path} is no longer a file, folder or link`;
|
|
80
|
+
const type = stats.isDirectory() ? classifyDirectory({ repository: marksRepository(observeGitMarker(path)) }) : row.type;
|
|
81
|
+
if (railChanged(row.type, type))
|
|
82
|
+
return `${path} changed type`;
|
|
83
|
+
reached.add(row.uuid);
|
|
84
|
+
if (stats.isDirectory() && CONTAINERS.has(row.type)) {
|
|
85
|
+
if (physicalKey(stats) !== row.physicalKey)
|
|
86
|
+
return `${path} is another directory`;
|
|
87
|
+
if (row.type === "repo.git" && !await input.shows(row, path))
|
|
88
|
+
return `${path} shows another repository state`;
|
|
89
|
+
owners.set(path, row.uuid);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return await input.shows(row, path) ? null : `${path} shows another result`;
|
|
93
|
+
} });
|
|
94
|
+
if ("differs" in walked)
|
|
95
|
+
return { kind: "differs", reason: walked.differs };
|
|
96
|
+
const kept = (path) => {
|
|
97
|
+
for (let at = relative(input.source, path); at !== "." && at !== ""; at = dirname(at))
|
|
98
|
+
if (skipped.has(at))
|
|
99
|
+
return true;
|
|
100
|
+
return false;
|
|
101
|
+
};
|
|
102
|
+
const absent = input.rows.find(row => !reached.has(row.uuid) && !kept(row.absolutePath));
|
|
103
|
+
if (absent)
|
|
104
|
+
return { kind: "differs", reason: `${absent.absolutePath} is gone` };
|
|
105
|
+
return { kind: "proved", manifest: { contract: "amalgm.apply-displaced-tree@2", clock, digest: walked.digest, aside } };
|
|
106
|
+
}
|
|
107
|
+
/** Whether the copy at `displaced`, taken from `source`, still holds every
|
|
108
|
+
* name its manifest signed, read under the clock it was signed under, whose
|
|
109
|
+
* qualification the caller proves still stands. Nothing displaced has
|
|
110
|
+
* nothing to lose. */
|
|
111
|
+
export async function displacedTreeShows(displaced, source, manifest, reads = {}) {
|
|
112
|
+
// A manifest of another contract proves nothing.
|
|
113
|
+
if (manifest.contract !== "amalgm.apply-displaced-tree@2")
|
|
114
|
+
return false;
|
|
115
|
+
if (!optionalLstat(displaced)?.isDirectory())
|
|
116
|
+
return true;
|
|
117
|
+
const skipped = new Set(manifest.aside.map(({ path }) => relative(source, path)));
|
|
118
|
+
const walked = await fingerprintTree(displaced, { clock: clockBoundary(manifest.clock),
|
|
119
|
+
skips: relativePath => skipped.has(relativePath), ...reads });
|
|
120
|
+
return "digest" in walked && walked.digest === manifest.digest;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Brings a source its member set aside home: to `home` when nothing stands
|
|
124
|
+
* there and `homeFree` holds, since the member's own reveal no longer holds
|
|
125
|
+
* it. Otherwise a person's object holds its home, and each name beneath a
|
|
126
|
+
* directory is kept for `owner`, the container it was (apply-kept.ts); a
|
|
127
|
+
* file or link set aside is O, which its final guard proved, and goes with
|
|
128
|
+
* the window. Names the directories owed a flush, and whether anything was
|
|
129
|
+
* kept; nothing displaced has nothing to bring.
|
|
130
|
+
*/
|
|
131
|
+
export function bringDisplacedHome(input) {
|
|
132
|
+
const stats = optionalLstat(input.displaced);
|
|
133
|
+
if (!stats)
|
|
134
|
+
return { flush: [], kept: false };
|
|
135
|
+
if (input.homeFree && moveWithoutReplacing(input.displaced, input.home)) {
|
|
136
|
+
return { flush: [dirname(input.displaced), dirname(input.home)], kept: false };
|
|
137
|
+
}
|
|
138
|
+
if (!stats.isDirectory())
|
|
139
|
+
return { flush: [], kept: false };
|
|
140
|
+
const flush = new Set();
|
|
141
|
+
for (const name of listAgain(input.displaced) ?? []) {
|
|
142
|
+
for (const directory of keepAside({ root: input.root, attemptId: input.attemptId, owner: input.owner,
|
|
143
|
+
from: join(input.displaced, name), name }))
|
|
144
|
+
flush.add(directory);
|
|
145
|
+
}
|
|
146
|
+
return { flush: [...flush], kept: true };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=apply-displaced-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-displaced-tree.js","sourceRoot":"","sources":["../src/apply-displaced-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA2BuB;AACvB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAC9B,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAoBpD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAOhC;IACP,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC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QAAQ,IAAI,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACxE,OAAO,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACjF,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;QACpD,KAAK,MAAM,SAAS,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK;YAClG,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type TrashStep } from "./apply-trash-keep.js";
|
|
2
|
+
/** The members one point may owe before it runs early. */
|
|
3
|
+
export declare const DURABILITY_CAP: {
|
|
4
|
+
readonly members: 4096;
|
|
5
|
+
};
|
|
6
|
+
/** What one ended window owes the point. */
|
|
7
|
+
export interface OwedWindow {
|
|
8
|
+
readonly attemptId: string;
|
|
9
|
+
readonly files: readonly string[];
|
|
10
|
+
readonly directories: readonly string[];
|
|
11
|
+
/** Control trees the window may let go once durable. */
|
|
12
|
+
readonly controls: readonly string[];
|
|
13
|
+
/** What its Trash keeps take from those trees, or release, first. */
|
|
14
|
+
readonly trash: readonly TrashStep[];
|
|
15
|
+
readonly members: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ApplyDurabilityOptions {
|
|
18
|
+
readonly databaseFile: string;
|
|
19
|
+
readonly onError?: (error: Error) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare class ApplyDurability {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(options: ApplyDurabilityOptions);
|
|
24
|
+
/** How many windows wait for the point. */
|
|
25
|
+
get owed(): number;
|
|
26
|
+
/** An ended window joins the next point; at the cap the point runs now. */
|
|
27
|
+
owe(window: OwedWindow): void;
|
|
28
|
+
/** The point: every owed object persists, then one strict save. A failed
|
|
29
|
+
* flush leaves its windows owed for the next point and reports. */
|
|
30
|
+
point(): Promise<void>;
|
|
31
|
+
/** Resolves once no point runs. */
|
|
32
|
+
idle(): Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** The window's durability point. A window's end is an ordered commit: it
|
|
2
|
+
* answers before the drive holds where its members placed their results.
|
|
3
|
+
* Their bytes persisted before their receipts bound (apply-window-store.ts
|
|
4
|
+
* bindWindow), so the point owes placement only. At idle or at the cap,
|
|
5
|
+
* for every window ended since the last point, each touched directory and
|
|
6
|
+
* revealed file is flushed, in parallel, and then one strict save marks
|
|
7
|
+
* those windows durable, which also lets their control trees go, once their
|
|
8
|
+
* Trash keeps have taken what they keep (apply-trash-keep.ts). The hot
|
|
9
|
+
* path per window owes no placement flush. */
|
|
10
|
+
import { rm } from "node:fs/promises";
|
|
11
|
+
import { parallelForEach } from "@amalgm/live";
|
|
12
|
+
import { settleTrash } from "./apply-trash-keep.js";
|
|
13
|
+
import { flushEach } from "./flush.js";
|
|
14
|
+
import { save } from "./ground-saver.js";
|
|
15
|
+
/** The members one point may owe before it runs early. */
|
|
16
|
+
export const DURABILITY_CAP = { members: 4096 };
|
|
17
|
+
export class ApplyDurability {
|
|
18
|
+
#file;
|
|
19
|
+
#onError;
|
|
20
|
+
#owed = [];
|
|
21
|
+
#members = 0;
|
|
22
|
+
#running = null;
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this.#file = options.databaseFile;
|
|
25
|
+
this.#onError = options.onError ?? (() => undefined);
|
|
26
|
+
}
|
|
27
|
+
/** How many windows wait for the point. */
|
|
28
|
+
get owed() {
|
|
29
|
+
return this.#owed.length;
|
|
30
|
+
}
|
|
31
|
+
/** An ended window joins the next point; at the cap the point runs now. */
|
|
32
|
+
owe(window) {
|
|
33
|
+
this.#owed.push(window);
|
|
34
|
+
this.#members += window.members;
|
|
35
|
+
if (this.#members >= DURABILITY_CAP.members)
|
|
36
|
+
void this.point();
|
|
37
|
+
}
|
|
38
|
+
/** The point: every owed object persists, then one strict save. A failed
|
|
39
|
+
* flush leaves its windows owed for the next point and reports. */
|
|
40
|
+
point() {
|
|
41
|
+
if (this.#running)
|
|
42
|
+
return this.#running;
|
|
43
|
+
if (this.#owed.length === 0)
|
|
44
|
+
return Promise.resolve();
|
|
45
|
+
const run = this.#run().catch(error => { this.#onError(error instanceof Error ? error : new Error(String(error))); })
|
|
46
|
+
.finally(() => { this.#running = null; });
|
|
47
|
+
this.#running = run;
|
|
48
|
+
return run;
|
|
49
|
+
}
|
|
50
|
+
/** Resolves once no point runs. */
|
|
51
|
+
idle() {
|
|
52
|
+
return this.#running ?? Promise.resolve();
|
|
53
|
+
}
|
|
54
|
+
async #run() {
|
|
55
|
+
const windows = this.#owed;
|
|
56
|
+
this.#owed = [];
|
|
57
|
+
this.#members = 0;
|
|
58
|
+
try {
|
|
59
|
+
await flushEach(windows.flatMap(window => window.files), windows.flatMap(window => window.directories));
|
|
60
|
+
await save(this.#file, "apply.durable", { attemptIds: windows.map(window => window.attemptId) });
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
this.#owed.unshift(...windows);
|
|
64
|
+
for (const window of windows)
|
|
65
|
+
this.#members += window.members;
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
await settleTrash(windows.flatMap(window => window.trash));
|
|
69
|
+
await parallelForEach(windows.flatMap(window => window.controls), 16, control => rm(control, { recursive: true, force: true }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=apply-durability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-durability.js","sourceRoot":"","sources":["../src/apply-durability.ts"],"names":[],"mappings":"AAAA;;;;;;;;8CAQ8C;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAkB,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,IAAI,EAAW,CAAC;AAmBzD,MAAM,OAAO,eAAe;IACjB,KAAK,CAAS;IACd,QAAQ,CAAyB;IAC1C,KAAK,GAAiB,EAAE,CAAC;IACzB,QAAQ,GAAG,CAAC,CAAC;IACb,QAAQ,GAAyB,IAAI,CAAC;IAEtC,YAAY,OAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,2CAA2C;IAC3C,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,2EAA2E;IAC3E,GAAG,CAAC,MAAkB;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAA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CAAC,WAAW,CAAC,CAAC,CAAC;YACxG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACnG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;YAC/B,KAAK,MAAM,MAAM,IAAI,OAAO;gBAAE,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC;YAC9D,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3D,MAAM,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,EAClE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { CloudEntityRecord, TransferArtifact } from "@amalgm/live";
|
|
2
|
+
import type { GitLine } from "./materialized-graph.js";
|
|
3
|
+
import type { EnterClosure } from "./apply-enter-plan.js";
|
|
4
|
+
import type { ContentBoundary } from "./content-clock.js";
|
|
5
|
+
import type { GitOwners } from "./git/home.js";
|
|
6
|
+
import { type GitLines, type LocalArtifactFile } from "./materialize-records.js";
|
|
7
|
+
import type { AddStagingRouting } from "./workspace-add-staging.js";
|
|
8
|
+
declare const CONTRACT = "amalgm.apply-enter@3";
|
|
9
|
+
/** One row the landing saves, addressed relative to the tree. The target's
|
|
10
|
+
* own row has the empty path. */
|
|
11
|
+
export interface SealedEnterRow {
|
|
12
|
+
readonly record: CloudEntityRecord;
|
|
13
|
+
readonly relativePath: string;
|
|
14
|
+
readonly physicalKey: string;
|
|
15
|
+
readonly sourceSignature: string | null;
|
|
16
|
+
readonly filesystemMode: number;
|
|
17
|
+
}
|
|
18
|
+
export interface EnterSeal {
|
|
19
|
+
readonly contract: typeof CONTRACT;
|
|
20
|
+
/** The accepted target version the tree shows. */
|
|
21
|
+
readonly targetVersion: string;
|
|
22
|
+
/** The delivery position the closure was read at. */
|
|
23
|
+
readonly position: number;
|
|
24
|
+
/** Members left out, sorted: what this computer shows, and what a later
|
|
25
|
+
* row places. */
|
|
26
|
+
readonly leftOut: readonly string[];
|
|
27
|
+
/** The tree root's physical key: the object the landing moves. */
|
|
28
|
+
readonly root: string;
|
|
29
|
+
/** Where the tree lands. Reference link text was computed from it. */
|
|
30
|
+
readonly targetPath: string;
|
|
31
|
+
readonly rows: readonly SealedEnterRow[];
|
|
32
|
+
/** Each repository the build played onto its line, with that line
|
|
33
|
+
* (git-install-lines.ts). */
|
|
34
|
+
readonly lines?: readonly {
|
|
35
|
+
readonly uuid: string;
|
|
36
|
+
readonly line: GitLine;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
export interface PreparedEnter {
|
|
40
|
+
readonly tree: string;
|
|
41
|
+
readonly seal: EnterSeal;
|
|
42
|
+
/** Content proofs by UUID, taken by this process's build. */
|
|
43
|
+
readonly proofs: ReadonlyMap<string, string>;
|
|
44
|
+
readonly contentBoundary: ContentBoundary | null;
|
|
45
|
+
}
|
|
46
|
+
/** What a build must show; an existing seal is adopted only when it agrees. */
|
|
47
|
+
export interface EnterExpectation {
|
|
48
|
+
readonly target: CloudEntityRecord;
|
|
49
|
+
readonly position: number;
|
|
50
|
+
readonly leftOut: readonly string[];
|
|
51
|
+
readonly targetPath: string;
|
|
52
|
+
}
|
|
53
|
+
/** One Enter's staging directory inside its window's control directory.
|
|
54
|
+
* Every member of a window shares that directory, so each Enter takes its own
|
|
55
|
+
* slot, numbered in the order its window first builds it. The slot is the
|
|
56
|
+
* shortest name that keeps two Enters apart: Git for Windows refuses a
|
|
57
|
+
* repository past about 259 characters, and Git builds every repository
|
|
58
|
+
* entering beneath this slot, however deep it will stand (git/rail.ts
|
|
59
|
+
* GitClone.buildIn). */
|
|
60
|
+
export declare const enterStaging: (control: string, slot: number) => string;
|
|
61
|
+
/** Whether a seal shows exactly what the expectation asks for. */
|
|
62
|
+
export declare const sealShows: (seal: EnterSeal, expected: EnterExpectation) => boolean;
|
|
63
|
+
/** The seal an intent's staging holds, or null when it was never sealed. */
|
|
64
|
+
export declare function readEnterSeal(staging: string): EnterSeal | null;
|
|
65
|
+
/** The seal a bound Enter depends on, found beside the tree its receipt
|
|
66
|
+
* names. The tree may already have landed, so only the seal is read. */
|
|
67
|
+
export declare function boundEnter(tree: string): PreparedEnter;
|
|
68
|
+
/**
|
|
69
|
+
* Build, or adopt, the tree an unbound Enter lands. A sealed tree this attempt
|
|
70
|
+
* built that still stands and shows what is expected is adopted. Anything
|
|
71
|
+
* else in the staging directory was never exposed, so it is deleted and the
|
|
72
|
+
* closure is built again.
|
|
73
|
+
*/
|
|
74
|
+
export declare function prepareEnter(input: {
|
|
75
|
+
readonly control: string;
|
|
76
|
+
/** This Enter's slot in its window (enterStaging). */
|
|
77
|
+
readonly slot: number;
|
|
78
|
+
readonly closure: EnterClosure;
|
|
79
|
+
readonly expected: EnterExpectation;
|
|
80
|
+
/** The binding root whose content clock qualifies the rows. */
|
|
81
|
+
readonly clockRoot: string;
|
|
82
|
+
readonly databaseFile: string;
|
|
83
|
+
readonly bindingDir: string;
|
|
84
|
+
/** The repositories this computer already holds, where a worktree or
|
|
85
|
+
* submodule entering finds its home. */
|
|
86
|
+
readonly held: GitOwners;
|
|
87
|
+
/** Each repository's line (materialize-records.ts `GitLines`). */
|
|
88
|
+
readonly gitLines?: GitLines;
|
|
89
|
+
readContent(artifacts: readonly TransferArtifact[], staged?: AddStagingRouting): Promise<ReadonlyMap<string, LocalArtifactFile>>;
|
|
90
|
+
}): Promise<PreparedEnter>;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container Enter's staged install (docs/entity-apply.md, Container Enter).
|
|
3
|
+
*
|
|
4
|
+
* The closure is built off to one side, inside its intent's control
|
|
5
|
+
* directory, as Add builds its hidden staging: each cold file downloads once,
|
|
6
|
+
* straight to its place in the tree, and is handed to the tree's barrier
|
|
7
|
+
* (workspace-add-staging.ts). Then its seal is written beside it, and that
|
|
8
|
+
* one durability barrier makes the tree and the seal's bytes persist
|
|
9
|
+
* together, since nothing names either yet. A tree
|
|
10
|
+
* is complete only once its sealed `install.json` exists. A tree without a
|
|
11
|
+
* seal is scrap and is built again. Within one running attempt a sealed tree
|
|
12
|
+
* is adopted; a crash before the bind leaves only private work, which the
|
|
13
|
+
* next start sweeps away (src/apply-window-host.ts, recoverStart).
|
|
14
|
+
*
|
|
15
|
+
* The seal is what keeps Apply's result apart from a person's later work
|
|
16
|
+
* across a crash. It holds every row the landing will save, relative to the
|
|
17
|
+
* tree, with the fingerprints the build took. After the landing, a person's
|
|
18
|
+
* edit to a member changes that member's fingerprint against its sealed row,
|
|
19
|
+
* so Detect records it; nothing is re-read to make the row.
|
|
20
|
+
*
|
|
21
|
+
* Content proofs (`sighting`) are process facts. They stay in memory
|
|
22
|
+
* with the clock epoch they were taken in, and an adopted seal has none.
|
|
23
|
+
*/
|
|
24
|
+
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
25
|
+
import { rm } from "node:fs/promises";
|
|
26
|
+
import { dirname, join } from "node:path";
|
|
27
|
+
import { flushEach } from "./flush.js";
|
|
28
|
+
import { ensureApplyPrivate } from "./apply-control.js";
|
|
29
|
+
import { holds, standing } from "./apply-spelling.js";
|
|
30
|
+
import { durabilityBarrier } from "./durability-barrier.js";
|
|
31
|
+
import { materializeRecords } from "./materialize-records.js";
|
|
32
|
+
import { isPhysicalKey, physicalKey } from "./source-signature.js";
|
|
33
|
+
const CONTRACT = "amalgm.apply-enter@3";
|
|
34
|
+
/** One Enter's staging directory inside its window's control directory.
|
|
35
|
+
* Every member of a window shares that directory, so each Enter takes its own
|
|
36
|
+
* slot, numbered in the order its window first builds it. The slot is the
|
|
37
|
+
* shortest name that keeps two Enters apart: Git for Windows refuses a
|
|
38
|
+
* repository past about 259 characters, and Git builds every repository
|
|
39
|
+
* entering beneath this slot, however deep it will stand (git/rail.ts
|
|
40
|
+
* GitClone.buildIn). */
|
|
41
|
+
export const enterStaging = (control, slot) => join(control, "enter", String(slot));
|
|
42
|
+
const treeOf = (staging) => join(staging, "tree");
|
|
43
|
+
const sealOf = (staging) => join(staging, "install.json");
|
|
44
|
+
const sameList = (left, right) => left.length === right.length && left.every((value, index) => value === right[index]);
|
|
45
|
+
/** Whether a seal shows exactly what the expectation asks for. */
|
|
46
|
+
export const sealShows = (seal, expected) => seal.targetVersion === expected.target.version && seal.position === expected.position
|
|
47
|
+
&& seal.targetPath === expected.targetPath && sameList(seal.leftOut, expected.leftOut);
|
|
48
|
+
/** The seal an intent's staging holds, or null when it was never sealed. */
|
|
49
|
+
export function readEnterSeal(staging) {
|
|
50
|
+
let encoded;
|
|
51
|
+
try {
|
|
52
|
+
encoded = readFileSync(sealOf(staging), "utf8");
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error.code === "ENOENT")
|
|
56
|
+
return null;
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
const seal = JSON.parse(encoded);
|
|
60
|
+
if (seal.contract !== CONTRACT)
|
|
61
|
+
throw new Error(`Apply Enter seal contract ${String(seal.contract)} is superseded`);
|
|
62
|
+
if (typeof seal.targetVersion !== "string" || !Number.isSafeInteger(seal.position)
|
|
63
|
+
|| !Array.isArray(seal.leftOut) || !isPhysicalKey(seal.root)
|
|
64
|
+
|| typeof seal.targetPath !== "string" || !Array.isArray(seal.rows)
|
|
65
|
+
|| seal.rows.filter(row => row.relativePath === "").length !== 1) {
|
|
66
|
+
throw new Error("Apply Enter seal is malformed");
|
|
67
|
+
}
|
|
68
|
+
return seal;
|
|
69
|
+
}
|
|
70
|
+
/** An adopted seal: the rows stand, and no process proof survives. */
|
|
71
|
+
const adopted = (staging, seal) => ({ tree: treeOf(staging), seal, proofs: new Map(), contentBoundary: null });
|
|
72
|
+
/** The seal a bound Enter depends on, found beside the tree its receipt
|
|
73
|
+
* names. The tree may already have landed, so only the seal is read. */
|
|
74
|
+
export function boundEnter(tree) {
|
|
75
|
+
const staging = dirname(tree);
|
|
76
|
+
const seal = readEnterSeal(staging);
|
|
77
|
+
if (!seal)
|
|
78
|
+
throw new Error(`bound Apply Enter has no sealed install at ${staging}`);
|
|
79
|
+
return adopted(staging, seal);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Build, or adopt, the tree an unbound Enter lands. A sealed tree this attempt
|
|
83
|
+
* built that still stands and shows what is expected is adopted. Anything
|
|
84
|
+
* else in the staging directory was never exposed, so it is deleted and the
|
|
85
|
+
* closure is built again.
|
|
86
|
+
*/
|
|
87
|
+
export async function prepareEnter(input) {
|
|
88
|
+
const { expected } = input;
|
|
89
|
+
const staging = enterStaging(input.control, input.slot), tree = treeOf(staging);
|
|
90
|
+
const existing = readEnterSeal(staging);
|
|
91
|
+
if (existing && sealShows(existing, expected) && holds(tree, existing.root))
|
|
92
|
+
return adopted(staging, existing);
|
|
93
|
+
await rm(staging, { recursive: true, force: true });
|
|
94
|
+
ensureApplyPrivate(input.control, staging);
|
|
95
|
+
const built = await materializeRecords({
|
|
96
|
+
records: input.closure.records,
|
|
97
|
+
rootPath: tree,
|
|
98
|
+
database: input.databaseFile,
|
|
99
|
+
boundaryUUID: expected.target.uuid,
|
|
100
|
+
bindingDir: input.bindingDir,
|
|
101
|
+
clockRoot: input.clockRoot,
|
|
102
|
+
revealedAt: expected.targetPath,
|
|
103
|
+
leftOut: new Set(expected.leftOut),
|
|
104
|
+
held: input.held,
|
|
105
|
+
gitStorage: input.held.storage,
|
|
106
|
+
...(input.gitLines ? { gitLines: input.gitLines } : {}),
|
|
107
|
+
staged: true,
|
|
108
|
+
readContent: (artifacts, staged) => input.readContent(artifacts, staged),
|
|
109
|
+
});
|
|
110
|
+
const { rows } = built;
|
|
111
|
+
const root = standing(tree);
|
|
112
|
+
if (!root?.isDirectory())
|
|
113
|
+
throw new Error(`Apply Enter tree did not stand at ${tree}`);
|
|
114
|
+
const seal = {
|
|
115
|
+
contract: CONTRACT,
|
|
116
|
+
targetVersion: expected.target.version,
|
|
117
|
+
position: expected.position,
|
|
118
|
+
leftOut: [...expected.leftOut],
|
|
119
|
+
root: physicalKey(root),
|
|
120
|
+
targetPath: expected.targetPath,
|
|
121
|
+
rows: rows.map(row => ({
|
|
122
|
+
record: row.record, relativePath: row.relativePath, physicalKey: row.physicalKey,
|
|
123
|
+
sourceSignature: row.sourceSignature, filesystemMode: row.filesystemMode,
|
|
124
|
+
})),
|
|
125
|
+
...rows.some(row => row.gitLine) ? { lines: rows.flatMap(({ record, gitLine }) => gitLine ? [{ uuid: record.uuid, line: gitLine }] : []) } : {},
|
|
126
|
+
};
|
|
127
|
+
await writeSeal(staging, seal, (await built.durable).files);
|
|
128
|
+
return {
|
|
129
|
+
tree,
|
|
130
|
+
seal,
|
|
131
|
+
proofs: new Map(rows.flatMap(row => row.sighting === null ? [] : [[row.record.uuid, row.sighting]])),
|
|
132
|
+
contentBoundary: built.contentBoundary,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** The seal makes the tree complete, so it lands whole or not at all. Its
|
|
136
|
+
* bytes persist with the tree's before the rename that names it, and that
|
|
137
|
+
* name before the build is answered: a bound window reads its seal. */
|
|
138
|
+
async function writeSeal(staging, seal, durable) {
|
|
139
|
+
const file = sealOf(staging), pending = `${file}.pending`;
|
|
140
|
+
writeFileSync(pending, `${JSON.stringify(seal)}\n`, { mode: 0o600 });
|
|
141
|
+
await Promise.all([durabilityBarrier(treeOf(staging), durable), flushEach([pending], [])]);
|
|
142
|
+
renameSync(pending, file);
|
|
143
|
+
await flushEach([], [staging]);
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=apply-enter-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-enter-build.js","sourceRoot":"","sources":["../src/apply-enter-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAI1C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAoB,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAyC,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGnE,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AA+CxC;;;;;;wBAMwB;AACxB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAE5G,MAAM,MAAM,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAE1E,M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