@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,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container Enter's closure and how it divides against this computer's
|
|
3
|
+
* ground (docs/entity-apply.md, Container Enter).
|
|
4
|
+
*
|
|
5
|
+
* An Enter shows an entity E that was not shown here, and with it
|
|
6
|
+
* everything the authority's line shows beneath E at E's own delivery
|
|
7
|
+
* position: the active, container-connected closure Add installs, read from
|
|
8
|
+
* the received state (received-state.ts) with E at its accepted target: a
|
|
9
|
+
* prefix the line really had.
|
|
10
|
+
*
|
|
11
|
+
* A member whose own row comes later on the line no longer stands where that
|
|
12
|
+
* prefix shows it. A line's Enter leaves it out with its subtree, and its own
|
|
13
|
+
* rows place it: a file that moved out of a folder as the folder returned
|
|
14
|
+
* stands once, at its new place. The Enter's end takes any earlier row of it
|
|
15
|
+
* that B kept hidden beneath the container out of B (apply-window-saves.ts,
|
|
16
|
+
* unshownBeneath), so Detect never reads its absence as a removal. A fetch
|
|
17
|
+
* lane reads what this computer shows at its cutoff: each member at its newest
|
|
18
|
+
* row within it, with this computer's own newer results over and beneath it
|
|
19
|
+
* (own-results.ts), so nothing it shows is older than the lane and another
|
|
20
|
+
* computer's work never comes before it is received.
|
|
21
|
+
*
|
|
22
|
+
* Beneath a root on demand an Enter shows one unit (Live unitOf): the
|
|
23
|
+
* members whose nearest repository is the target's, read through the closure
|
|
24
|
+
* where it answers and through what this computer shows above it. A
|
|
25
|
+
* repository places with every member short of a nested repository, a new
|
|
26
|
+
* folder inside a placed repository places with its contents, and an entity
|
|
27
|
+
* outside every repository places alone. A root places some members
|
|
28
|
+
* whatever their unit (Live placedInRoot): the home what login places,
|
|
29
|
+
* everything in the runtime's own entries and the projects folder without
|
|
30
|
+
* its projects; any other root nothing. Everything else
|
|
31
|
+
* stays listed. A fetch lane entering through the plain folders missing above
|
|
32
|
+
* its unit (apply-window-lane.ts) shows, with its entry, the folders between
|
|
33
|
+
* and the unit's own members: one staged tree.
|
|
34
|
+
*
|
|
35
|
+
* What this computer already shows stays where it is. A closure member that
|
|
36
|
+
* O holds an active row for, in any root, including a frozen row in an
|
|
37
|
+
* unavailable root, is protected local ground, not a copy for the Enter to
|
|
38
|
+
* create. It is left out with its subtree; its own records move it.
|
|
39
|
+
*/
|
|
40
|
+
import { type CloudEntityRecord, type EntityApplyIntent, type EntityApplyPlan } from "@amalgm/live";
|
|
41
|
+
import type Database from "better-sqlite3";
|
|
42
|
+
import type { ShownGround } from "./apply-showing.js";
|
|
43
|
+
import { type HeldHeads } from "./received-state.js";
|
|
44
|
+
/** Whether this plan shows a container that was not shown here. */
|
|
45
|
+
export declare const entersContainer: (plan: EntityApplyPlan) => boolean;
|
|
46
|
+
export interface EnterClosure {
|
|
47
|
+
/** The target record's delivery position on its authority's line. */
|
|
48
|
+
readonly position: number;
|
|
49
|
+
/** Every record the Enter shows, rooted at the target, which stands at its
|
|
50
|
+
* accepted result. */
|
|
51
|
+
readonly records: readonly CloudEntityRecord[];
|
|
52
|
+
/** Members a later row on a line places; a lane's are none. */
|
|
53
|
+
readonly newer: ReadonlySet<string>;
|
|
54
|
+
}
|
|
55
|
+
/** The closure an Enter installs, read at its target's delivery position,
|
|
56
|
+
* or at a fetch lane's cutoff, where each member stands at its newest row
|
|
57
|
+
* within it (Live lane.ts) or at this computer's own newer result: one unit's
|
|
58
|
+
* when `unit` is the ground of a root on demand. A missing kept head throws
|
|
59
|
+
* ReceivedStateUnavailableError. */
|
|
60
|
+
export declare function readEnterClosure(input: {
|
|
61
|
+
readonly database: Database.Database;
|
|
62
|
+
readonly intent: EntityApplyIntent;
|
|
63
|
+
readonly target: CloudEntityRecord;
|
|
64
|
+
readonly heads: HeldHeads;
|
|
65
|
+
readonly unit: Pick<ShownGround, "place"> | null;
|
|
66
|
+
}): Promise<EnterClosure>;
|
|
67
|
+
/** The closure's members that place with the target, which roots it: its
|
|
68
|
+
* unit's, and those its root places. A lane whose unit `laneUnit` lies
|
|
69
|
+
* beneath the target, its entry, also places the folders between and that
|
|
70
|
+
* unit's members. */
|
|
71
|
+
export declare function unitMembers(closure: readonly CloudEntityRecord[], target: CloudEntityRecord, shown: Pick<ShownGround, "place">, laneUnit?: string | null): readonly CloudEntityRecord[];
|
|
72
|
+
export interface EnterDivision {
|
|
73
|
+
/** Members the Enter leaves out, each with its subtree, outermost only,
|
|
74
|
+
* sorted: what this computer shows, and what a later row places. */
|
|
75
|
+
readonly leftOut: readonly string[];
|
|
76
|
+
}
|
|
77
|
+
/** The closure's division: `excluded` answers whether a member stays out of
|
|
78
|
+
* the tree, because O holds an active row for it or a later row places it. */
|
|
79
|
+
export declare function divideEnter(closure: readonly CloudEntityRecord[], rootUuid: string, excluded: (uuid: string) => boolean): Promise<EnterDivision>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container Enter's closure and how it divides against this computer's
|
|
3
|
+
* ground (docs/entity-apply.md, Container Enter).
|
|
4
|
+
*
|
|
5
|
+
* An Enter shows an entity E that was not shown here, and with it
|
|
6
|
+
* everything the authority's line shows beneath E at E's own delivery
|
|
7
|
+
* position: the active, container-connected closure Add installs, read from
|
|
8
|
+
* the received state (received-state.ts) with E at its accepted target: a
|
|
9
|
+
* prefix the line really had.
|
|
10
|
+
*
|
|
11
|
+
* A member whose own row comes later on the line no longer stands where that
|
|
12
|
+
* prefix shows it. A line's Enter leaves it out with its subtree, and its own
|
|
13
|
+
* rows place it: a file that moved out of a folder as the folder returned
|
|
14
|
+
* stands once, at its new place. The Enter's end takes any earlier row of it
|
|
15
|
+
* that B kept hidden beneath the container out of B (apply-window-saves.ts,
|
|
16
|
+
* unshownBeneath), so Detect never reads its absence as a removal. A fetch
|
|
17
|
+
* lane reads what this computer shows at its cutoff: each member at its newest
|
|
18
|
+
* row within it, with this computer's own newer results over and beneath it
|
|
19
|
+
* (own-results.ts), so nothing it shows is older than the lane and another
|
|
20
|
+
* computer's work never comes before it is received.
|
|
21
|
+
*
|
|
22
|
+
* Beneath a root on demand an Enter shows one unit (Live unitOf): the
|
|
23
|
+
* members whose nearest repository is the target's, read through the closure
|
|
24
|
+
* where it answers and through what this computer shows above it. A
|
|
25
|
+
* repository places with every member short of a nested repository, a new
|
|
26
|
+
* folder inside a placed repository places with its contents, and an entity
|
|
27
|
+
* outside every repository places alone. A root places some members
|
|
28
|
+
* whatever their unit (Live placedInRoot): the home what login places,
|
|
29
|
+
* everything in the runtime's own entries and the projects folder without
|
|
30
|
+
* its projects; any other root nothing. Everything else
|
|
31
|
+
* stays listed. A fetch lane entering through the plain folders missing above
|
|
32
|
+
* its unit (apply-window-lane.ts) shows, with its entry, the folders between
|
|
33
|
+
* and the unit's own members: one staged tree.
|
|
34
|
+
*
|
|
35
|
+
* What this computer already shows stays where it is. A closure member that
|
|
36
|
+
* O holds an active row for, in any root, including a frozen row in an
|
|
37
|
+
* unavailable root, is protected local ground, not a copy for the Enter to
|
|
38
|
+
* create. It is left out with its subtree; its own records move it.
|
|
39
|
+
*/
|
|
40
|
+
import { CONTAINERS, eachStep, materializableRecordsSteps, placedInRoot, shownUnits, unitOf, } from "@amalgm/live";
|
|
41
|
+
import { readOwnStanding } from "./own-results.js";
|
|
42
|
+
import { readReceivedState } from "./received-state.js";
|
|
43
|
+
import { cachedStatement } from "./sqlite.js";
|
|
44
|
+
import { finishStepsInTurns } from "./turns.js";
|
|
45
|
+
/** Whether this plan shows a container that was not shown here. */
|
|
46
|
+
export const entersContainer = (plan) => plan.play === "enter" && CONTAINERS.has(plan.target.type);
|
|
47
|
+
/** The closure an Enter installs, read at its target's delivery position,
|
|
48
|
+
* or at a fetch lane's cutoff, where each member stands at its newest row
|
|
49
|
+
* within it (Live lane.ts) or at this computer's own newer result: one unit's
|
|
50
|
+
* when `unit` is the ground of a root on demand. A missing kept head throws
|
|
51
|
+
* ReceivedStateUnavailableError. */
|
|
52
|
+
export async function readEnterClosure(input) {
|
|
53
|
+
const { database, intent, target } = input;
|
|
54
|
+
const position = intent.cutoff ?? cachedStatement(database, `SELECT delivery_sequence FROM record_inbox
|
|
55
|
+
WHERE authority_id = ? AND entity_id = ? AND global_sequence = ?`).pluck()
|
|
56
|
+
.get(intent.authorityId, intent.entityId, intent.throughSequence);
|
|
57
|
+
if (position === undefined) {
|
|
58
|
+
throw new Error(`Enter target ${intent.entityId} at ${intent.throughSequence} has no received delivery position`);
|
|
59
|
+
}
|
|
60
|
+
const state = await readReceivedState({
|
|
61
|
+
database, authorityId: intent.authorityId, position, boundaryId: target.uuid, heads: input.heads,
|
|
62
|
+
});
|
|
63
|
+
if (!state.records.some(record => record.uuid === target.uuid)) {
|
|
64
|
+
throw new Error(`received state at delivery ${position} does not hold Enter target ${target.uuid}`);
|
|
65
|
+
}
|
|
66
|
+
const shown = intent.cutoff === null ? state.records
|
|
67
|
+
: withOwnResults(state.records, readOwnStanding(database, intent.authorityId, position));
|
|
68
|
+
const records = shown.map(record => record.uuid === target.uuid ? target : record);
|
|
69
|
+
const closure = await finishStepsInTurns(materializableRecordsSteps(records, target.uuid));
|
|
70
|
+
const members = input.unit ? unitMembers(closure, target, input.unit, intent.unit) : closure;
|
|
71
|
+
return { position, records: members,
|
|
72
|
+
newer: intent.cutoff === null ? placedLater(database, intent.authorityId, position, members, target.uuid) : new Set() };
|
|
73
|
+
}
|
|
74
|
+
/** The received records with this computer's own newer results over them,
|
|
75
|
+
* and those it places beneath them: what a lane shows at its cutoff. A
|
|
76
|
+
* result that moves a member out leaves it unreached by the closure. */
|
|
77
|
+
function withOwnResults(received, own) {
|
|
78
|
+
const shown = new Map(received.map(record => [record.uuid, own.get(record.uuid) ?? record]));
|
|
79
|
+
for (const uuid of shown.keys()) {
|
|
80
|
+
for (const child of own.children(uuid))
|
|
81
|
+
if (!shown.has(child.uuid))
|
|
82
|
+
shown.set(child.uuid, child);
|
|
83
|
+
}
|
|
84
|
+
return [...shown.values()];
|
|
85
|
+
}
|
|
86
|
+
/** The members, short of the root, whose newest received row on the
|
|
87
|
+
* authority's line comes after `position`. One index seek per member: the
|
|
88
|
+
* members lead, and INDEXED BY refuses an Inbox scan. */
|
|
89
|
+
function placedLater(database, authorityId, position, members, rootUuid) {
|
|
90
|
+
const uuids = members.flatMap(record => record.uuid === rootUuid ? [] : [record.uuid]);
|
|
91
|
+
if (uuids.length === 0)
|
|
92
|
+
return new Set();
|
|
93
|
+
return new Set(cachedStatement(database, `SELECT member.value FROM json_each(?) AS member
|
|
94
|
+
WHERE (SELECT delivery_sequence FROM record_inbox INDEXED BY record_inbox_apply
|
|
95
|
+
WHERE authority_id = ? AND entity_id = member.value ORDER BY global_sequence DESC LIMIT 1) > ?`)
|
|
96
|
+
.pluck().all(JSON.stringify(uuids), authorityId, position));
|
|
97
|
+
}
|
|
98
|
+
/** The closure's members that place with the target, which roots it: its
|
|
99
|
+
* unit's, and those its root places. A lane whose unit `laneUnit` lies
|
|
100
|
+
* beneath the target, its entry, also places the folders between and that
|
|
101
|
+
* unit's members. */
|
|
102
|
+
export function unitMembers(closure, target, shown, laneUnit = null) {
|
|
103
|
+
const byUuid = new Map(closure.map(record => [record.uuid, record]));
|
|
104
|
+
const place = shownUnits(uuid => byUuid.get(uuid), uuid => shown.place(uuid));
|
|
105
|
+
const units = new Map();
|
|
106
|
+
const tops = new Map();
|
|
107
|
+
const entered = new Set([unitOf(target.uuid, place, units)]);
|
|
108
|
+
const beneath = laneUnit === null || laneUnit === target.uuid ? undefined : byUuid.get(laneUnit);
|
|
109
|
+
if (beneath !== undefined) {
|
|
110
|
+
entered.add(unitOf(beneath.uuid, place, units));
|
|
111
|
+
for (let id = beneath.parentUUID; id !== null && id !== target.uuid; id = byUuid.get(id)?.parentUUID ?? null) {
|
|
112
|
+
entered.add(id);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return closure.filter(record => entered.has(unitOf(record.uuid, place, units)) || placedInRoot(record.uuid, place, tops));
|
|
116
|
+
}
|
|
117
|
+
/** The closure's division: `excluded` answers whether a member stays out of
|
|
118
|
+
* the tree, because O holds an active row for it or a later row places it. */
|
|
119
|
+
export function divideEnter(closure, rootUuid, excluded) {
|
|
120
|
+
return finishStepsInTurns(divideEnterSteps(closure, rootUuid, excluded));
|
|
121
|
+
}
|
|
122
|
+
function* divideEnterSteps(closure, rootUuid, excluded) {
|
|
123
|
+
const byUuid = new Map(closure.map(record => [record.uuid, record]));
|
|
124
|
+
/** Whether a record lies beneath a left-out member, itself included. */
|
|
125
|
+
const out = new Map();
|
|
126
|
+
const leftOut = [];
|
|
127
|
+
const pass = (record) => {
|
|
128
|
+
const known = out.get(record.uuid);
|
|
129
|
+
if (known !== undefined)
|
|
130
|
+
return known;
|
|
131
|
+
let result = false;
|
|
132
|
+
if (record.uuid !== rootUuid) {
|
|
133
|
+
const parent = byUuid.get(record.parentUUID);
|
|
134
|
+
if (!parent)
|
|
135
|
+
throw new Error(`Enter closure member ${record.uuid} has no parent in its closure`);
|
|
136
|
+
result = pass(parent);
|
|
137
|
+
if (!result && excluded(record.uuid)) {
|
|
138
|
+
leftOut.push(record.uuid);
|
|
139
|
+
result = true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
out.set(record.uuid, result);
|
|
143
|
+
return result;
|
|
144
|
+
};
|
|
145
|
+
yield* eachStep(closure, pass);
|
|
146
|
+
return { leftOut: leftOut.sort() };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=apply-enter-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-enter-plan.js","sourceRoot":"","sources":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CAAC;YACtB,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC1B,MAAM,GAAG,IAAI,CAAC;YAChB,CAAC;QACH,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACF,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type BigIntStats } from "node:fs";
|
|
2
|
+
import { type ContentBoundary, type ContentStamp } from "./content-clock.js";
|
|
3
|
+
export interface TreeEntry {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly parent: string;
|
|
6
|
+
readonly stats: BigIntStats;
|
|
7
|
+
}
|
|
8
|
+
export interface FingerprintOptions {
|
|
9
|
+
/** The clock stamped before the first walk; null proves no leaf. */
|
|
10
|
+
readonly clock: ContentBoundary | null;
|
|
11
|
+
/** Names neither digested nor descended into. */
|
|
12
|
+
readonly skips?: (relativePath: string, parent: string) => boolean;
|
|
13
|
+
/** Read after an entry joins the digest; the first difference it names
|
|
14
|
+
* ends the walk. */
|
|
15
|
+
readonly visit?: (entry: TreeEntry) => Promise<string | null>;
|
|
16
|
+
/** Hears each leaf read for its content. */
|
|
17
|
+
readonly onRead?: () => void;
|
|
18
|
+
/** Hears each piece of a file read for its content. */
|
|
19
|
+
readonly onBytes?: (bytes: number) => void;
|
|
20
|
+
}
|
|
21
|
+
export type Fingerprint = {
|
|
22
|
+
readonly digest: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly differs: string;
|
|
25
|
+
};
|
|
26
|
+
/** The stamp a fingerprint was first taken under, as a receipt holds it:
|
|
27
|
+
* null when it proved no leaf. Taking it again under a qualification that no
|
|
28
|
+
* longer stands proves nothing (content-clock.ts qualificationStands). */
|
|
29
|
+
export interface FingerprintClock {
|
|
30
|
+
readonly ns: string;
|
|
31
|
+
readonly dev: string;
|
|
32
|
+
readonly qualification: string;
|
|
33
|
+
readonly roots: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
export declare const fingerprintClock: ({ boundary, roots }: ContentStamp) => FingerprintClock | null;
|
|
36
|
+
export declare const clockBoundary: (clock: FingerprintClock | null) => ContentBoundary | null;
|
|
37
|
+
/** Walks every name beneath `top` that `skips` leaves alone, in one fixed
|
|
38
|
+
* order, and digests it. */
|
|
39
|
+
export declare function fingerprintTree(top: string, options: FingerprintOptions): Promise<Fingerprint>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** The fingerprint of a tree Apply sets aside: one digest over every name
|
|
2
|
+
* beneath it, taken by one walk, compared by taking it again
|
|
3
|
+
* (apply-displaced-tree.ts, apply-git-storage.ts).
|
|
4
|
+
*
|
|
5
|
+
* - Each name joins the digest by its full source signature; a directory by
|
|
6
|
+
* its object alone, since moving a name in or out restamps its times, and
|
|
7
|
+
* the names beneath it answer for its membership.
|
|
8
|
+
* - The content clock is stamped before the walk (content-clock.ts). A leaf
|
|
9
|
+
* whose signature the clock proves keeps its content while its signature
|
|
10
|
+
* stays equal, so it is never read. Any other leaf, one written too
|
|
11
|
+
* recently for its change time to prove anything, joins by its content as
|
|
12
|
+
* well: a file by the hash of its bytes, a link by its target.
|
|
13
|
+
* - Taking the fingerprint again under the same clock reads the same leaves,
|
|
14
|
+
* so equal digests mean equal names, objects and contents, with no wait.
|
|
15
|
+
*
|
|
16
|
+
* The walk lists every directory itself, sorted, and never follows a link. */
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
import { join, relative, sep } from "node:path";
|
|
19
|
+
import { sightingUnder } from "./content-clock.js";
|
|
20
|
+
import { hashContentFile } from "./content-cache-host.js";
|
|
21
|
+
import { listAgain, WALK_TURN_ENTRIES } from "./detection/walk-law.js";
|
|
22
|
+
import { readLinkTarget } from "./link-target.js";
|
|
23
|
+
import { optionalLstat } from "./physical-path-witness.js";
|
|
24
|
+
import { contentProven, physicalKey, sourceSignature } from "./source-signature.js";
|
|
25
|
+
import { sha256Hex } from "./sha256.js";
|
|
26
|
+
import { turnBoundary } from "./turns.js";
|
|
27
|
+
export const fingerprintClock = ({ boundary, roots }) => boundary === null ? null : { ns: boundary.ns, dev: boundary.dev.toString(), qualification: boundary.qualification, roots };
|
|
28
|
+
export const clockBoundary = (clock) => clock === null ? null : { ns: clock.ns, dev: BigInt(clock.dev), qualification: clock.qualification };
|
|
29
|
+
/** The content an unproven leaf joins with, or null when it no longer reads
|
|
30
|
+
* as the object its signature named. */
|
|
31
|
+
async function contentOf(entry, options) {
|
|
32
|
+
const { path, stats } = entry;
|
|
33
|
+
if (!stats.isFile() && !stats.isSymbolicLink())
|
|
34
|
+
return "";
|
|
35
|
+
if (contentProven(sourceSignature(stats), sightingUnder(options.clock, stats)))
|
|
36
|
+
return "";
|
|
37
|
+
options.onRead?.();
|
|
38
|
+
try {
|
|
39
|
+
return stats.isSymbolicLink() ? `l:${sha256Hex(Buffer.from(readLinkTarget(path), "utf8"))}`
|
|
40
|
+
: `c:${await hashContentFile(path, options.onBytes)}`;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (["ENOENT", "ENOTDIR", "EACCES", "EPERM", "EISDIR", "EINVAL"].includes(error.code ?? ""))
|
|
44
|
+
return null;
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Walks every name beneath `top` that `skips` leaves alone, in one fixed
|
|
49
|
+
* order, and digests it. */
|
|
50
|
+
export async function fingerprintTree(top, options) {
|
|
51
|
+
const digest = createHash("sha256");
|
|
52
|
+
const pending = [top];
|
|
53
|
+
let entries = 0;
|
|
54
|
+
while (pending.length > 0) {
|
|
55
|
+
const directory = pending.pop();
|
|
56
|
+
const names = listAgain(directory);
|
|
57
|
+
if (names === null)
|
|
58
|
+
return { differs: `${directory} can no longer be listed` };
|
|
59
|
+
for (const name of names) {
|
|
60
|
+
const path = join(directory, name);
|
|
61
|
+
const relativePath = relative(top, path);
|
|
62
|
+
if (options.skips?.(relativePath, directory))
|
|
63
|
+
continue;
|
|
64
|
+
const stats = optionalLstat(path);
|
|
65
|
+
if (!stats)
|
|
66
|
+
return { differs: `${path} left as Apply read it` };
|
|
67
|
+
const entry = { path, parent: directory, stats };
|
|
68
|
+
const content = await contentOf(entry, options);
|
|
69
|
+
if (content === null)
|
|
70
|
+
return { differs: `${path} can no longer be read` };
|
|
71
|
+
digest.update(`${relativePath.split(sep).join("/")}\0${stats.isDirectory() ? `d:${physicalKey(stats)}` : sourceSignature(stats)}`
|
|
72
|
+
+ `\0${content}\n`);
|
|
73
|
+
const difference = await options.visit?.(entry);
|
|
74
|
+
if (difference)
|
|
75
|
+
return { differs: difference };
|
|
76
|
+
if (stats.isDirectory())
|
|
77
|
+
pending.push(path);
|
|
78
|
+
if (++entries % WALK_TURN_ENTRIES === 0)
|
|
79
|
+
await turnBoundary();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { digest: digest.digest("hex") };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=apply-fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-fingerprint.js","sourceRoot":"","sources":["../src/apply-fingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;8EAe8E;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAA2C,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;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 +1,29 @@
|
|
|
1
|
+
import { type CargoWant } from "@amalgm/live";
|
|
2
|
+
import { type WindowGround } from "./apply-window-ground.js";
|
|
3
|
+
/** One want this computer places inside a repository: its path there. */
|
|
4
|
+
export interface Placed {
|
|
5
|
+
readonly want: CargoWant;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
}
|
|
8
|
+
export interface HeldBlob {
|
|
9
|
+
readonly want: CargoWant;
|
|
10
|
+
readonly bytes: Buffer;
|
|
11
|
+
}
|
|
12
|
+
export declare class GitHeld {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(ground: WindowGround, report: (error: Error) => void);
|
|
15
|
+
/** What the repository's Apply here just left behind (GitApplied.left),
|
|
16
|
+
* before what earlier ones did: two records of a repository may land
|
|
17
|
+
* before the file record that steps back. */
|
|
18
|
+
left(repository: string, commits: readonly string[]): void;
|
|
19
|
+
/** The wants whose file stands inside a repository here, by repository
|
|
20
|
+
* UUID, and the rest. From rows only: nothing is read from disk or Git. */
|
|
21
|
+
place(wants: readonly CargoWant[]): {
|
|
22
|
+
readonly near: ReadonlyMap<string, readonly Placed[]>;
|
|
23
|
+
readonly away: readonly CargoWant[];
|
|
24
|
+
};
|
|
25
|
+
/** The blobs each repository holds for its wants, as they are read. A
|
|
26
|
+
* repository Git cannot read holds nothing; any fault but Git's refusal, a
|
|
27
|
+
* checkout gone among them, is reported. */
|
|
28
|
+
read(near: ReadonlyMap<string, readonly Placed[]>): AsyncGenerator<HeldBlob>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/** A repository's file result from the Git this computer already holds. When
|
|
2
|
+
* a person steps a repository to a branch, tag or stash this computer's Git
|
|
3
|
+
* already has, the file's result is a blob there, so Apply reads it from Git
|
|
4
|
+
* and nothing comes over the wire for it. Only commits the repository names,
|
|
5
|
+
* or named until a recent Apply here, are asked, each at the file's place in
|
|
6
|
+
* it: HEAD, ORIG_HEAD, the stash's newest entry with its index and untracked
|
|
7
|
+
* sides, its most recent refs, and what the names those Applies rewrote named
|
|
8
|
+
* before (src/git/rail.ts), so a file whose record follows its repository's
|
|
9
|
+
* finds the stash that record popped. That memory is this process's alone: a
|
|
10
|
+
* restart between the two records leaves the wire to bring the file. A
|
|
11
|
+
* blob is the result only when its bytes hash to the record's content hash,
|
|
12
|
+
* so a filter, a line-ending conversion, or a commit reached only through
|
|
13
|
+
* history leaves the wire to bring it. Git only reads objects and refs here,
|
|
14
|
+
* in two processes started together outside the checkout, with its Git
|
|
15
|
+
* directory named: no command reads the index, which a reader may refresh,
|
|
16
|
+
* looks above the repository for another, or holds the checkout a person may
|
|
17
|
+
* be renaming. */
|
|
18
|
+
import { join, relative, sep } from "node:path";
|
|
19
|
+
import { CHUNK_BYTES } from "@amalgm/live";
|
|
20
|
+
import { pathInside } from "./apply-window-ground.js";
|
|
21
|
+
import { CatFile } from "./git-cat-file.js";
|
|
22
|
+
import { GitRefused, runGit } from "./git-command.js";
|
|
23
|
+
import { sha256Hex } from "./sha256.js";
|
|
24
|
+
/** Refs asked, most recently made first: a step lands on a state its
|
|
25
|
+
* repository named lately, and the question stays the same size however
|
|
26
|
+
* many refs a repository keeps. */
|
|
27
|
+
const HELD_REFS = 64;
|
|
28
|
+
/** Commits recent Applies left behind that are asked, newest first, each
|
|
29
|
+
* with its two sides. */
|
|
30
|
+
const HELD_LEFT = 16;
|
|
31
|
+
/** Bytes one read of blobs holds in memory: one download's bound. A larger
|
|
32
|
+
* blob comes over the wire, which streams it. */
|
|
33
|
+
const HELD_READ_BYTES = 2 * CHUNK_BYTES;
|
|
34
|
+
const lines = (answer) => answer.toString("utf8").split("\n").filter(line => line !== "");
|
|
35
|
+
/** Commits asked by name: where a step back most often lands. The stash's
|
|
36
|
+
* newest entry is asked with its index and untracked sides, as is each
|
|
37
|
+
* commit an Apply left behind; an older entry pops from the wire. */
|
|
38
|
+
const NAMED = ["HEAD", "ORIG_HEAD", "refs/stash", "refs/stash^2", "refs/stash^3"];
|
|
39
|
+
export class GitHeld {
|
|
40
|
+
#ground;
|
|
41
|
+
#report;
|
|
42
|
+
/** By repository UUID: what its recent Applies here left behind. */
|
|
43
|
+
#left = new Map();
|
|
44
|
+
constructor(ground, report) {
|
|
45
|
+
this.#ground = ground;
|
|
46
|
+
this.#report = report;
|
|
47
|
+
}
|
|
48
|
+
/** What the repository's Apply here just left behind (GitApplied.left),
|
|
49
|
+
* before what earlier ones did: two records of a repository may land
|
|
50
|
+
* before the file record that steps back. */
|
|
51
|
+
left(repository, commits) {
|
|
52
|
+
if (commits.length === 0)
|
|
53
|
+
return;
|
|
54
|
+
const recent = new Set([...commits, ...this.#left.get(repository) ?? []]);
|
|
55
|
+
this.#left.set(repository, [...recent].slice(0, HELD_LEFT));
|
|
56
|
+
}
|
|
57
|
+
/** The wants whose file stands inside a repository here, by repository
|
|
58
|
+
* UUID, and the rest. From rows only: nothing is read from disk or Git. */
|
|
59
|
+
place(wants) {
|
|
60
|
+
const near = new Map(), away = [];
|
|
61
|
+
for (const want of wants) {
|
|
62
|
+
const placed = this.#placeOne(want);
|
|
63
|
+
if (placed === null)
|
|
64
|
+
away.push(want);
|
|
65
|
+
else {
|
|
66
|
+
const here = near.get(placed.repository);
|
|
67
|
+
if (here)
|
|
68
|
+
here.push({ want, path: placed.path });
|
|
69
|
+
else
|
|
70
|
+
near.set(placed.repository, [{ want, path: placed.path }]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { near, away };
|
|
74
|
+
}
|
|
75
|
+
/** The blobs each repository holds for its wants, as they are read. A
|
|
76
|
+
* repository Git cannot read holds nothing; any fault but Git's refusal, a
|
|
77
|
+
* checkout gone among them, is reported. */
|
|
78
|
+
async *read(near) {
|
|
79
|
+
for (const [repository, placed] of near) {
|
|
80
|
+
const checkout = this.#ground.current(repository)?.absolutePath;
|
|
81
|
+
if (checkout === undefined)
|
|
82
|
+
continue;
|
|
83
|
+
try {
|
|
84
|
+
yield* this.#readRepository(checkout, placed, this.#left.get(repository) ?? []);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (!(error instanceof GitRefused))
|
|
88
|
+
this.#report(error);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** A file's nearest repository and its path there, `/`-separated as Git
|
|
93
|
+
* names it; null for anything else. Its last row places it, even in Trash:
|
|
94
|
+
* a step back may return a file this computer no longer shows. */
|
|
95
|
+
#placeOne(want) {
|
|
96
|
+
if (want.artifact.kind !== "file")
|
|
97
|
+
return null;
|
|
98
|
+
const row = this.#ground.observed(want.artifact.entityId);
|
|
99
|
+
if (!row)
|
|
100
|
+
return null;
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
for (let at = row; at.uuid !== at.rootUUID && at.parentUUID !== null && !seen.has(at.uuid);) {
|
|
103
|
+
seen.add(at.uuid);
|
|
104
|
+
const parent = this.#ground.current(at.parentUUID);
|
|
105
|
+
if (!parent)
|
|
106
|
+
return null;
|
|
107
|
+
if (parent.type === "repo.git") {
|
|
108
|
+
const path = relative(parent.absolutePath, row.absolutePath);
|
|
109
|
+
if (path === "" || !pathInside(parent.absolutePath, row.absolutePath))
|
|
110
|
+
return null;
|
|
111
|
+
const named = path.split(sep).join("/");
|
|
112
|
+
return named.includes("\n") ? null : { repository: parent.uuid, path: named };
|
|
113
|
+
}
|
|
114
|
+
at = parent;
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
async *#readRepository(checkout, placed, left) {
|
|
119
|
+
const invocation = { purpose: "apply", profile: { GIT_DIR: join(checkout, ".git"), GIT_WORK_TREE: checkout } };
|
|
120
|
+
const objects = new CatFile(checkout, invocation);
|
|
121
|
+
try {
|
|
122
|
+
// The states named outright are asked while Git lists the recent refs.
|
|
123
|
+
const at = (states) => placed.flatMap(entry => states.map(state => ({ entry, name: `${state}:${entry.path}` })));
|
|
124
|
+
const named = at([...NAMED, ...left.flatMap(commit => [commit, `${commit}^2`, `${commit}^3`])]);
|
|
125
|
+
const [early, refs] = await Promise.all([
|
|
126
|
+
objects.info(named.map(({ name }) => name)),
|
|
127
|
+
runGit(checkout, ["for-each-ref", "--sort=-creatordate", `--count=${HELD_REFS}`, "--format=%(objectname)"], invocation),
|
|
128
|
+
]);
|
|
129
|
+
const recent = at([...new Set(lines(refs))]);
|
|
130
|
+
const late = await objects.info(recent.map(({ name }) => name));
|
|
131
|
+
// Each blob once, with the wants it may be: a binary's manifest names its size.
|
|
132
|
+
const candidates = new Map();
|
|
133
|
+
const answers = [...early, ...late];
|
|
134
|
+
[...named, ...recent].forEach(({ entry }, index) => {
|
|
135
|
+
const found = answers[index];
|
|
136
|
+
if (!found || found.type !== "blob" || found.size > HELD_READ_BYTES)
|
|
137
|
+
return;
|
|
138
|
+
if (entry.want.manifest && entry.want.manifest.bytes !== found.size)
|
|
139
|
+
return;
|
|
140
|
+
const candidate = candidates.get(found.oid) ?? { size: found.size, wants: new Set() };
|
|
141
|
+
candidate.wants.add(entry);
|
|
142
|
+
candidates.set(found.oid, candidate);
|
|
143
|
+
});
|
|
144
|
+
// Git stops once every result asked for is found.
|
|
145
|
+
const wanted = new Set(placed.map(({ want }) => want.artifact.contentHash));
|
|
146
|
+
const found = new Set();
|
|
147
|
+
for (const group of groups(candidates)) {
|
|
148
|
+
for await (const { oid, bytes } of objects.contents(group)) {
|
|
149
|
+
const hash = sha256Hex(bytes);
|
|
150
|
+
for (const entry of candidates.get(oid)?.wants ?? []) {
|
|
151
|
+
if (entry.want.artifact.contentHash !== hash || found.has(hash))
|
|
152
|
+
continue;
|
|
153
|
+
found.add(hash);
|
|
154
|
+
yield { want: entry.want, bytes };
|
|
155
|
+
}
|
|
156
|
+
if (found.size === wanted.size)
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
await objects.close();
|
|
161
|
+
}
|
|
162
|
+
finally {
|
|
163
|
+
objects.stop();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** Blob names in reads whose sizes together stay within the bound. */
|
|
168
|
+
function groups(candidates) {
|
|
169
|
+
const all = [];
|
|
170
|
+
let group = [], bytes = 0;
|
|
171
|
+
for (const [oid, { size }] of candidates) {
|
|
172
|
+
if (group.length > 0 && bytes + size > HELD_READ_BYTES) {
|
|
173
|
+
all.push(group);
|
|
174
|
+
group = [];
|
|
175
|
+
bytes = 0;
|
|
176
|
+
}
|
|
177
|
+
group.push(oid);
|
|
178
|
+
bytes += size;
|
|
179
|
+
}
|
|
180
|
+
if (group.length > 0)
|
|
181
|
+
all.push(group);
|
|
182
|
+
return all;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=apply-git-held.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-git-held.js","sourceRoot":"","sources":["../src/apply-git-held.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;kBAgBkB;AAClB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAkB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,UAAU,EAA2C,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAsB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;mCAEmC;AACnC,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB;yBACyB;AACzB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB;iDACiD;AACjD,MAAM,eAAe,GAAG,CAAC,GAAG,WAAW,CAAC;AAaxC,MAAM,KAAK,GAAG,CAAC,MAAc,EAAY,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KA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AAC,KAAK,CAAC,CAAC;IACtC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type FingerprintClock, type FingerprintOptions } from "./apply-fingerprint.js";
|
|
2
|
+
import type { ContentStamp } from "./content-clock.js";
|
|
3
|
+
/** The displaced marker's name in its intent's control tree. */
|
|
4
|
+
export declare const DISPLACED_GIT = "displaced-git";
|
|
5
|
+
export interface GitStorageManifest {
|
|
6
|
+
readonly contract: "amalgm.apply-git-storage@2";
|
|
7
|
+
/** The marker's own object. A rename may restamp the moved object's times,
|
|
8
|
+
* so only its device and inode are compared; a gitfile keeps its text. */
|
|
9
|
+
readonly marker: {
|
|
10
|
+
readonly object: string;
|
|
11
|
+
readonly gitfile: string | null;
|
|
12
|
+
};
|
|
13
|
+
/** The storage directory: the marker itself, or the one a gitfile names. */
|
|
14
|
+
readonly storage: {
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly object: string;
|
|
17
|
+
};
|
|
18
|
+
/** The clock the fingerprint was taken under. */
|
|
19
|
+
readonly clock: FingerprintClock | null;
|
|
20
|
+
/** Every name beneath the storage directory (apply-fingerprint.ts). */
|
|
21
|
+
readonly digest: string;
|
|
22
|
+
}
|
|
23
|
+
type Reads = Pick<FingerprintOptions, "onRead" | "onBytes">;
|
|
24
|
+
/** The manifest of `worktree`'s Git storage as it stands now, under `stamp`. */
|
|
25
|
+
export declare function captureGitStorage(worktree: string, stamp: ContentStamp, reads?: Reads): Promise<GitStorageManifest | null>;
|
|
26
|
+
/** Moves the worktree's marker into control while it is the manifest's own
|
|
27
|
+
* object. Storage already displaced, or removed by a person, leaves nothing
|
|
28
|
+
* to move; any other marker is ground the bound read must judge first. */
|
|
29
|
+
export declare function displaceGitStorage(control: string, worktree: string, manifest: GitStorageManifest): void;
|
|
30
|
+
/** Whether the storage displaced into `control` is still the manifest's O.
|
|
31
|
+
* Storage that never left, because a person removed it first, has nothing to
|
|
32
|
+
* lose. */
|
|
33
|
+
export declare function keptStorageIsO(control: string, manifest: GitStorageManifest, reads?: Reads): Promise<boolean>;
|
|
34
|
+
/** Returns storage displaced into `control` to `worktree`, durably. False
|
|
35
|
+
* when another `.git` stands there, so the caller keeps it rather than lets
|
|
36
|
+
* the durability point take it. */
|
|
37
|
+
export declare function returnGitStorage(control: string, worktree: string): boolean;
|
|
38
|
+
export {};
|