@amalgm/shell 0.1.164-preview.36072132286 → 0.1.164-preview.36809057014
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 +642 -128
- package/README.md +10 -8
- package/dist/accepted-tail.d.ts +26 -0
- package/dist/accepted-tail.js +37 -0
- package/dist/accepted-tail.js.map +1 -0
- package/dist/agent-execution.d.ts +16 -1
- package/dist/agent-execution.js +13 -5
- package/dist/agent-execution.js.map +1 -1
- package/dist/apply-cleanup.d.ts +28 -0
- package/dist/apply-cleanup.js +166 -0
- package/dist/apply-cleanup.js.map +1 -0
- package/dist/apply-recovery.d.ts +47 -0
- package/dist/apply-recovery.js +99 -0
- package/dist/apply-recovery.js.map +1 -0
- package/dist/apply-rows.d.ts +72 -0
- package/dist/apply-rows.js +150 -0
- package/dist/apply-rows.js.map +1 -0
- package/dist/apply-saves.d.ts +85 -0
- package/dist/apply-saves.js +238 -0
- package/dist/apply-saves.js.map +1 -0
- package/dist/boot.js +2 -1
- package/dist/boot.js.map +1 -1
- package/dist/capture-work.d.ts +8 -0
- package/dist/capture-work.js +67 -0
- package/dist/capture-work.js.map +1 -0
- package/dist/cargo-group.d.ts +45 -0
- package/dist/cargo-group.js +88 -0
- package/dist/cargo-group.js.map +1 -0
- package/dist/channel-session.d.ts +4 -2
- package/dist/channel-session.js +4 -3
- package/dist/channel-session.js.map +1 -1
- package/dist/chat-composition.d.ts +2 -0
- package/dist/chat-composition.js +1 -0
- package/dist/chat-composition.js.map +1 -1
- package/dist/cli.js +20 -1
- package/dist/cli.js.map +1 -1
- package/dist/construct-apply-host.d.ts +4 -2
- package/dist/construct-apply-host.js +8 -3
- package/dist/construct-apply-host.js.map +1 -1
- package/dist/construct-door.js +1 -1
- package/dist/construct-door.js.map +1 -1
- package/dist/construct-ledger.d.ts +6 -1
- package/dist/construct-ledger.js +21 -33
- package/dist/construct-ledger.js.map +1 -1
- package/dist/content-cache-collection.d.ts +18 -0
- package/dist/content-cache-collection.js +99 -0
- package/dist/content-cache-collection.js.map +1 -0
- package/dist/content-cache-host.d.ts +83 -17
- package/dist/content-cache-host.js +335 -95
- package/dist/content-cache-host.js.map +1 -1
- package/dist/content-cache-namespace.d.ts +59 -0
- package/dist/content-cache-namespace.js +210 -0
- package/dist/content-cache-namespace.js.map +1 -0
- package/dist/content-cache-ownership.d.ts +13 -0
- package/dist/content-cache-ownership.js +75 -0
- package/dist/content-cache-ownership.js.map +1 -0
- package/dist/content-cache-retention.d.ts +23 -0
- package/dist/content-cache-retention.js +195 -0
- package/dist/content-cache-retention.js.map +1 -0
- package/dist/content-capture-pool.d.ts +287 -0
- package/dist/content-capture-pool.js +461 -0
- package/dist/content-capture-pool.js.map +1 -0
- package/dist/content-capture-worker.d.ts +8 -0
- package/dist/content-capture-worker.js +109 -0
- package/dist/content-capture-worker.js.map +1 -0
- package/dist/content-clock.d.ts +42 -0
- package/dist/content-clock.js +166 -0
- package/dist/content-clock.js.map +1 -0
- package/dist/content-direct.d.ts +2 -0
- package/dist/content-direct.js +12 -0
- package/dist/content-direct.js.map +1 -1
- package/dist/content-failure.d.ts +18 -0
- package/dist/content-failure.js +38 -0
- package/dist/content-failure.js.map +1 -0
- package/dist/content-stream-thread.d.ts +60 -0
- package/dist/content-stream-thread.js +95 -0
- package/dist/content-stream-thread.js.map +1 -0
- package/dist/content-stream-worker.d.ts +7 -0
- package/dist/content-stream-worker.js +52 -0
- package/dist/content-stream-worker.js.map +1 -0
- package/dist/declaration-absorption.d.ts +37 -0
- package/dist/declaration-absorption.js +119 -0
- package/dist/declaration-absorption.js.map +1 -0
- package/dist/declaration-chain.d.ts +36 -0
- package/dist/declaration-chain.js +96 -0
- package/dist/declaration-chain.js.map +1 -0
- package/dist/declaration-commit.d.ts +31 -0
- package/dist/declaration-commit.js +49 -0
- package/dist/declaration-commit.js.map +1 -0
- package/dist/declaration-hold.d.ts +22 -0
- package/dist/declaration-hold.js +24 -0
- package/dist/declaration-hold.js.map +1 -0
- package/dist/declaration-journal.d.ts +62 -0
- package/dist/declaration-journal.js +99 -0
- package/dist/declaration-journal.js.map +1 -0
- package/dist/declaration-save.d.ts +31 -0
- package/dist/declaration-save.js +134 -0
- package/dist/declaration-save.js.map +1 -0
- package/dist/detection/accepted-result.d.ts +19 -1
- package/dist/detection/accepted-result.js +36 -5
- package/dist/detection/accepted-result.js.map +1 -1
- package/dist/detection/admission-save.d.ts +55 -0
- package/dist/detection/admission-save.js +48 -0
- package/dist/detection/admission-save.js.map +1 -0
- package/dist/detection/admission-units.d.ts +66 -0
- package/dist/detection/admission-units.js +322 -0
- package/dist/detection/admission-units.js.map +1 -0
- package/dist/detection/alias-discovery.d.ts +12 -0
- package/dist/detection/alias-discovery.js +80 -0
- package/dist/detection/alias-discovery.js.map +1 -0
- package/dist/detection/alias-examination.d.ts +30 -0
- package/dist/detection/alias-examination.js +49 -0
- package/dist/detection/alias-examination.js.map +1 -0
- package/dist/detection/apply-ownership.d.ts +81 -0
- package/dist/detection/apply-ownership.js +232 -0
- package/dist/detection/apply-ownership.js.map +1 -0
- package/dist/detection/basis-advanced.d.ts +11 -0
- package/dist/detection/basis-advanced.js +26 -0
- package/dist/detection/basis-advanced.js.map +1 -0
- package/dist/detection/capture-outcome.d.ts +16 -0
- package/dist/detection/capture-outcome.js +92 -0
- package/dist/detection/capture-outcome.js.map +1 -0
- package/dist/detection/container-membership.d.ts +32 -0
- package/dist/detection/container-membership.js +49 -0
- package/dist/detection/container-membership.js.map +1 -0
- package/dist/detection/detect-cancelled.d.ts +6 -0
- package/dist/detection/detect-cancelled.js +10 -0
- package/dist/detection/detect-cancelled.js.map +1 -0
- package/dist/detection/directory-proof.d.ts +47 -0
- package/dist/detection/directory-proof.js +77 -0
- package/dist/detection/directory-proof.js.map +1 -0
- package/dist/detection/disposition-rows.d.ts +18 -0
- package/dist/detection/disposition-rows.js +29 -0
- package/dist/detection/disposition-rows.js.map +1 -0
- package/dist/detection/dispositions.d.ts +130 -0
- package/dist/detection/dispositions.js +248 -0
- package/dist/detection/dispositions.js.map +1 -0
- package/dist/detection/git-notice.d.ts +88 -0
- package/dist/detection/git-notice.js +444 -0
- package/dist/detection/git-notice.js.map +1 -0
- package/dist/detection/ground-proof.d.ts +130 -0
- package/dist/detection/ground-proof.js +274 -0
- package/dist/detection/ground-proof.js.map +1 -0
- package/dist/detection/ground-reader.d.ts +29 -0
- package/dist/detection/ground-reader.js +102 -0
- package/dist/detection/ground-reader.js.map +1 -0
- package/dist/detection/held-territory.d.ts +51 -0
- package/dist/detection/held-territory.js +205 -0
- package/dist/detection/held-territory.js.map +1 -0
- package/dist/detection/identity-discovery.d.ts +45 -0
- package/dist/detection/identity-discovery.js +287 -0
- package/dist/detection/identity-discovery.js.map +1 -0
- package/dist/detection/maintenance-sweep.d.ts +108 -0
- package/dist/detection/maintenance-sweep.js +325 -0
- package/dist/detection/maintenance-sweep.js.map +1 -0
- package/dist/detection/name-reach.d.ts +12 -0
- package/dist/detection/name-reach.js +28 -0
- package/dist/detection/name-reach.js.map +1 -0
- package/dist/detection/notebook-basis.d.ts +5 -7
- package/dist/detection/notebook-basis.js +6 -7
- package/dist/detection/notebook-basis.js.map +1 -1
- package/dist/detection/owed-selection.d.ts +51 -0
- package/dist/detection/owed-selection.js +169 -0
- package/dist/detection/owed-selection.js.map +1 -0
- package/dist/detection/portable.d.ts +34 -34
- package/dist/detection/portable.js +67 -93
- package/dist/detection/portable.js.map +1 -1
- package/dist/detection/reconciliation-coverage.d.ts +7 -0
- package/dist/detection/reconciliation-coverage.js +16 -0
- package/dist/detection/reconciliation-coverage.js.map +1 -0
- package/dist/detection/repository-publication.d.ts +20 -0
- package/dist/detection/repository-publication.js +79 -0
- package/dist/detection/repository-publication.js.map +1 -0
- package/dist/detection/repository-routes.d.ts +43 -0
- package/dist/detection/repository-routes.js +97 -0
- package/dist/detection/repository-routes.js.map +1 -0
- package/dist/detection/root-examination.d.ts +94 -0
- package/dist/detection/root-examination.js +523 -0
- package/dist/detection/root-examination.js.map +1 -0
- package/dist/detection/runtime.d.ts +131 -64
- package/dist/detection/runtime.js +808 -1103
- package/dist/detection/runtime.js.map +1 -1
- package/dist/detection/scoped-identity-port.d.ts +34 -0
- package/dist/detection/scoped-identity-port.js +81 -0
- package/dist/detection/scoped-identity-port.js.map +1 -0
- package/dist/detection/seal-law.d.ts +66 -0
- package/dist/detection/seal-law.js +116 -0
- package/dist/detection/seal-law.js.map +1 -0
- package/dist/detection/sharing-policy.d.ts +11 -0
- package/dist/detection/sharing-policy.js +32 -0
- package/dist/detection/sharing-policy.js.map +1 -0
- package/dist/detection/thread-database.d.ts +4 -0
- package/dist/detection/thread-database.js +30 -0
- package/dist/detection/thread-database.js.map +1 -0
- package/dist/detection/unreadable.d.ts +11 -0
- package/dist/detection/unreadable.js +9 -0
- package/dist/detection/unreadable.js.map +1 -0
- package/dist/detection/verified-content.d.ts +6 -0
- package/dist/detection/verified-content.js +12 -0
- package/dist/detection/verified-content.js.map +1 -0
- package/dist/detection/walk-law.d.ts +34 -0
- package/dist/detection/walk-law.js +55 -0
- package/dist/detection/walk-law.js.map +1 -0
- package/dist/development/fly-guest.js +2 -1
- package/dist/development/fly-guest.js.map +1 -1
- package/dist/entity-apply-host.d.ts +29 -13
- package/dist/entity-apply-host.js +1426 -461
- package/dist/entity-apply-host.js.map +1 -1
- package/dist/entity-apply-store.d.ts +77 -30
- package/dist/entity-apply-store.js +221 -516
- package/dist/entity-apply-store.js.map +1 -1
- package/dist/entity-record-observability.js +2 -0
- package/dist/entity-record-observability.js.map +1 -1
- package/dist/entity-record-saves.d.ts +20 -0
- package/dist/entity-record-saves.js +91 -0
- package/dist/entity-record-saves.js.map +1 -0
- package/dist/entity-record-store.d.ts +15 -7
- package/dist/entity-record-store.js +57 -117
- package/dist/entity-record-store.js.map +1 -1
- package/dist/files-register-host.d.ts +22 -3
- package/dist/files-register-host.js +70 -31
- package/dist/files-register-host.js.map +1 -1
- package/dist/filesystem.js +3 -2
- package/dist/filesystem.js.map +1 -1
- package/dist/git-binding.d.ts +65 -0
- package/dist/git-binding.js +220 -0
- package/dist/git-binding.js.map +1 -0
- package/dist/git-capture.d.ts +39 -0
- package/dist/git-capture.js +86 -0
- package/dist/git-capture.js.map +1 -0
- package/dist/git-card.d.ts +12 -0
- package/dist/git-card.js +123 -0
- package/dist/git-card.js.map +1 -0
- package/dist/git-checkpoint-construction.d.ts +41 -0
- package/dist/git-checkpoint-construction.js +96 -0
- package/dist/git-checkpoint-construction.js.map +1 -0
- package/dist/git-checkpoint-preparation.d.ts +37 -0
- package/dist/git-checkpoint-preparation.js +145 -0
- package/dist/git-checkpoint-preparation.js.map +1 -0
- package/dist/git-command.d.ts +61 -8
- package/dist/git-command.js +217 -63
- package/dist/git-command.js.map +1 -1
- package/dist/git-configuration.d.ts +40 -0
- package/dist/git-configuration.js +217 -0
- package/dist/git-configuration.js.map +1 -0
- package/dist/git-evidence.d.ts +61 -0
- package/dist/git-evidence.js +181 -0
- package/dist/git-evidence.js.map +1 -0
- package/dist/git-index-entries.d.ts +15 -0
- package/dist/git-index-entries.js +44 -0
- package/dist/git-index-entries.js.map +1 -0
- package/dist/git-index-format.d.ts +35 -0
- package/dist/git-index-format.js +293 -0
- package/dist/git-index-format.js.map +1 -0
- package/dist/git-index-witness.d.ts +33 -0
- package/dist/git-index-witness.js +69 -0
- package/dist/git-index-witness.js.map +1 -0
- package/dist/git-literal-host.d.ts +82 -0
- package/dist/git-literal-host.js +172 -0
- package/dist/git-literal-host.js.map +1 -0
- package/dist/git-literal-read.d.ts +88 -0
- package/dist/git-literal-read.js +170 -0
- package/dist/git-literal-read.js.map +1 -0
- package/dist/git-literal-replay.d.ts +33 -0
- package/dist/git-literal-replay.js +268 -0
- package/dist/git-literal-replay.js.map +1 -0
- package/dist/git-native-file.d.ts +42 -0
- package/dist/git-native-file.js +145 -0
- package/dist/git-native-file.js.map +1 -0
- package/dist/git-native-index.d.ts +21 -0
- package/dist/git-native-index.js +44 -0
- package/dist/git-native-index.js.map +1 -0
- package/dist/git-operation-host.d.ts +48 -0
- package/dist/git-operation-host.js +127 -0
- package/dist/git-operation-host.js.map +1 -0
- package/dist/git-private-index.d.ts +11 -0
- package/dist/git-private-index.js +42 -0
- package/dist/git-private-index.js.map +1 -0
- package/dist/git-private-repository.d.ts +4 -0
- package/dist/git-private-repository.js +69 -0
- package/dist/git-private-repository.js.map +1 -0
- package/dist/git-private-view.d.ts +39 -0
- package/dist/git-private-view.js +162 -0
- package/dist/git-private-view.js.map +1 -0
- package/dist/git-ref-store.d.ts +12 -0
- package/dist/git-ref-store.js +68 -0
- package/dist/git-ref-store.js.map +1 -0
- package/dist/git-registration-host.d.ts +20 -30
- package/dist/git-registration-host.js +86 -249
- package/dist/git-registration-host.js.map +1 -1
- package/dist/git-repository-host.d.ts +148 -22
- package/dist/git-repository-host.js +633 -650
- package/dist/git-repository-host.js.map +1 -1
- package/dist/git-worktree-host.d.ts +2 -0
- package/dist/git-worktree-host.js +16 -0
- package/dist/git-worktree-host.js.map +1 -0
- package/dist/graph-publication.d.ts +75 -0
- package/dist/graph-publication.js +203 -0
- package/dist/graph-publication.js.map +1 -0
- package/dist/ground-basis.d.ts +242 -0
- package/dist/ground-basis.js +1023 -0
- package/dist/ground-basis.js.map +1 -0
- package/dist/ground-checkpoint-worker.d.ts +1 -0
- package/dist/ground-checkpoint-worker.js +84 -0
- package/dist/ground-checkpoint-worker.js.map +1 -0
- package/dist/ground-checkpoints.d.ts +16 -0
- package/dist/ground-checkpoints.js +45 -0
- package/dist/ground-checkpoints.js.map +1 -0
- package/dist/ground-coordination.d.ts +107 -3
- package/dist/ground-coordination.js +249 -24
- package/dist/ground-coordination.js.map +1 -1
- package/dist/ground-database.d.ts +42 -0
- package/dist/ground-database.js +290 -0
- package/dist/ground-database.js.map +1 -0
- package/dist/ground-differences.d.ts +23 -0
- package/dist/ground-differences.js +47 -0
- package/dist/ground-differences.js.map +1 -0
- package/dist/ground-holders.d.ts +4 -0
- package/dist/ground-holders.js +15 -0
- package/dist/ground-holders.js.map +1 -0
- package/dist/ground-initialization-worker.d.ts +1 -0
- package/dist/ground-initialization-worker.js +20 -0
- package/dist/ground-initialization-worker.js.map +1 -0
- package/dist/ground-initialization.d.ts +35 -0
- package/dist/ground-initialization.js +102 -0
- package/dist/ground-initialization.js.map +1 -0
- package/dist/ground-install-saves.d.ts +63 -0
- package/dist/ground-install-saves.js +139 -0
- package/dist/ground-install-saves.js.map +1 -0
- package/dist/ground-inventory-schema.d.ts +18 -0
- package/dist/ground-inventory-schema.js +168 -0
- package/dist/ground-inventory-schema.js.map +1 -0
- package/dist/ground-profile.d.ts +7 -0
- package/dist/ground-profile.js +52 -0
- package/dist/ground-profile.js.map +1 -0
- package/dist/ground-root-index.d.ts +2 -1
- package/dist/ground-root-index.js +16 -14
- package/dist/ground-root-index.js.map +1 -1
- package/dist/ground-row.d.ts +62 -0
- package/dist/ground-row.js +70 -0
- package/dist/ground-row.js.map +1 -0
- package/dist/ground-save-ops.d.ts +44 -0
- package/dist/ground-save-ops.js +41 -0
- package/dist/ground-save-ops.js.map +1 -0
- package/dist/ground-saver-worker.d.ts +1 -0
- package/dist/ground-saver-worker.js +156 -0
- package/dist/ground-saver-worker.js.map +1 -0
- package/dist/ground-saver.d.ts +75 -0
- package/dist/ground-saver.js +216 -0
- package/dist/ground-saver.js.map +1 -0
- package/dist/ground-store.d.ts +84 -0
- package/dist/ground-store.js +473 -0
- package/dist/ground-store.js.map +1 -0
- package/dist/ground-territory.d.ts +130 -0
- package/dist/ground-territory.js +511 -0
- package/dist/ground-territory.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/installation/ownership.d.ts +0 -2
- package/dist/installation/ownership.js +3 -15
- package/dist/installation/ownership.js.map +1 -1
- package/dist/machine-host.d.ts +3 -2
- package/dist/machine-host.js +28 -16
- package/dist/machine-host.js.map +1 -1
- package/dist/materialized-graph.d.ts +7 -7
- package/dist/materialized-graph.js +11 -23
- package/dist/materialized-graph.js.map +1 -1
- package/dist/module-thread.d.ts +9 -0
- package/dist/module-thread.js +10 -0
- package/dist/module-thread.js.map +1 -0
- package/dist/native/fsevents-stream.node +0 -0
- package/dist/physical-path-witness.d.ts +64 -0
- package/dist/physical-path-witness.js +168 -0
- package/dist/physical-path-witness.js.map +1 -0
- package/dist/register-upload-fusion.d.ts +5 -4
- package/dist/register-upload-fusion.js +9 -6
- package/dist/register-upload-fusion.js.map +1 -1
- package/dist/registry-graph.d.ts +3 -2
- package/dist/registry-graph.js +9 -6
- package/dist/registry-graph.js.map +1 -1
- package/dist/registry-page-cache.d.ts +5 -2
- package/dist/registry-page-cache.js.map +1 -1
- package/dist/repository-identity-steps.d.ts +5 -0
- package/dist/repository-identity-steps.js +33 -0
- package/dist/repository-identity-steps.js.map +1 -0
- package/dist/runtime-node-flags.d.ts +10 -0
- package/dist/runtime-node-flags.js +11 -0
- package/dist/runtime-node-flags.js.map +1 -0
- package/dist/service/adapter.d.ts +1 -1
- package/dist/service/adapter.js +1 -1
- package/dist/service/adapter.js.map +1 -1
- package/dist/service/cli.js +16 -20
- package/dist/service/cli.js.map +1 -1
- package/dist/service/control.d.ts +2 -2
- package/dist/service/keepalive.d.ts +4 -11
- package/dist/service/keepalive.js +65 -118
- package/dist/service/keepalive.js.map +1 -1
- package/dist/service/policy.d.ts +36 -0
- package/dist/service/policy.js +25 -0
- package/dist/service/policy.js.map +1 -0
- package/dist/service/portable.d.ts +1 -1
- package/dist/service/portable.js +1 -1
- package/dist/service/portable.js.map +1 -1
- package/dist/service/recovery.d.ts +10 -9
- package/dist/service/recovery.js +29 -19
- package/dist/service/recovery.js.map +1 -1
- package/dist/service/windows-action.d.ts +5 -3
- package/dist/service/windows-action.js +6 -9
- package/dist/service/windows-action.js.map +1 -1
- package/dist/service/windows-task.js +5 -5
- package/dist/service/windows-task.js.map +1 -1
- package/dist/sharing-admission.d.ts +17 -0
- package/dist/sharing-admission.js +128 -0
- package/dist/sharing-admission.js.map +1 -0
- package/dist/snapshot-delivery-baseline.d.ts +12 -3
- package/dist/snapshot-delivery-baseline.js +41 -42
- package/dist/snapshot-delivery-baseline.js.map +1 -1
- package/dist/source-proof.d.ts +36 -0
- package/dist/source-proof.js +70 -0
- package/dist/source-proof.js.map +1 -0
- package/dist/source-signature.d.ts +56 -0
- package/dist/source-signature.js +56 -0
- package/dist/source-signature.js.map +1 -0
- package/dist/source-witness.d.ts +15 -0
- package/dist/source-witness.js +29 -0
- package/dist/source-witness.js.map +1 -0
- package/dist/sqlite-durability.d.ts +31 -0
- package/dist/sqlite-durability.js +28 -0
- package/dist/sqlite-durability.js.map +1 -0
- package/dist/sqlite.d.ts +8 -2
- package/dist/sqlite.js +27 -4
- package/dist/sqlite.js.map +1 -1
- package/dist/sync-address.d.ts +19 -0
- package/dist/sync-address.js +52 -0
- package/dist/sync-address.js.map +1 -0
- package/dist/sync-setting.d.ts +15 -0
- package/dist/sync-setting.js +13 -0
- package/dist/sync-setting.js.map +1 -1
- package/dist/turns.d.ts +42 -0
- package/dist/turns.js +112 -0
- package/dist/turns.js.map +1 -0
- package/dist/updates/bootstrap.d.ts +53 -7
- package/dist/updates/bootstrap.js +224 -137
- package/dist/updates/bootstrap.js.map +1 -1
- package/dist/updates/controller.d.ts +8 -0
- package/dist/updates/controller.js +27 -3
- package/dist/updates/controller.js.map +1 -1
- package/dist/updates/store.d.ts +3 -0
- package/dist/updates/store.js +12 -0
- package/dist/updates/store.js.map +1 -1
- package/dist/user-ground-host.d.ts +364 -69
- package/dist/user-ground-host.js +5231 -3366
- package/dist/user-ground-host.js.map +1 -1
- package/dist/watching/fsevents.d.ts +52 -1
- package/dist/watching/fsevents.js +60 -25
- package/dist/watching/fsevents.js.map +1 -1
- package/dist/watching/host.d.ts +129 -5
- package/dist/watching/host.js +433 -80
- package/dist/watching/host.js.map +1 -1
- package/dist/watching/index.d.ts +1 -1
- package/dist/wire-binary.d.ts +3 -2
- package/dist/wire-binary.js +10 -8
- package/dist/wire-binary.js.map +1 -1
- package/dist/wire-client.d.ts +3 -4
- package/dist/wire-client.js +18 -44
- package/dist/wire-client.js.map +1 -1
- package/dist/wire-outbox.d.ts +34 -0
- package/dist/wire-outbox.js +127 -0
- package/dist/wire-outbox.js.map +1 -0
- package/dist/workspace-host.d.ts +4 -0
- package/dist/workspace-host.js +12 -1
- package/dist/workspace-host.js.map +1 -1
- package/examinations/fixtures/private-wire-authority.js +133 -10
- package/npm-shrinkwrap.json +43 -56
- package/package.json +26 -13
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/** Literal worktree observations and Checkpoint construction from one native index.
|
|
2
|
+
* Git's status, attributes and index stat hints never prove physical bytes.
|
|
3
|
+
* Every byte is read and hashed on a content thread (git-literal-read), or
|
|
4
|
+
* stands on our own proof of the unchanged object; this thread batches
|
|
5
|
+
* requests and joins the witnesses they return. */
|
|
6
|
+
import { constants } from "node:fs";
|
|
7
|
+
import { finishSteps, ITEMS_PER_BOUNDARY } from "@amalgm/live";
|
|
8
|
+
import { readLiteral } from "./content-capture-pool.js";
|
|
9
|
+
import { withinGitBoundary } from "./git-index-entries.js";
|
|
10
|
+
import { leafDigest, } from "./git-literal-read.js";
|
|
11
|
+
import { pathComponents, PhysicalPathWitnesses } from "./physical-path-witness.js";
|
|
12
|
+
import { PrivateGitView } from "./git-private-view.js";
|
|
13
|
+
import { checkpointReads, constructLiteralCheckpoint, } from "./git-checkpoint-construction.js";
|
|
14
|
+
import { repositoryIdentityMapSteps } from "./repository-identity-steps.js";
|
|
15
|
+
import { sourceProofs, witnessProof } from "./source-proof.js";
|
|
16
|
+
import { eachInTurns, finishStepsInTurns } from "./turns.js";
|
|
17
|
+
/** A content thread's component evidence with the Stats predicates callers use. */
|
|
18
|
+
export class LiteralStats {
|
|
19
|
+
dev;
|
|
20
|
+
ino;
|
|
21
|
+
nlink;
|
|
22
|
+
mode;
|
|
23
|
+
size;
|
|
24
|
+
mtimeNs;
|
|
25
|
+
ctimeNs;
|
|
26
|
+
directory;
|
|
27
|
+
constructor(witness) {
|
|
28
|
+
({ dev: this.dev, ino: this.ino, nlink: this.nlink, mode: this.mode, size: this.size,
|
|
29
|
+
mtimeNs: this.mtimeNs, ctimeNs: this.ctimeNs, directory: this.directory } = witness);
|
|
30
|
+
}
|
|
31
|
+
isFile() { return (this.mode & BigInt(constants.S_IFMT)) === BigInt(constants.S_IFREG); }
|
|
32
|
+
isDirectory() { return this.directory; }
|
|
33
|
+
isSymbolicLink() { return (this.mode & BigInt(constants.S_IFMT)) === BigInt(constants.S_IFLNK); }
|
|
34
|
+
}
|
|
35
|
+
/** Requests per batch: siblings share a batch and their ancestor reads. */
|
|
36
|
+
const BATCH_REQUESTS = 512;
|
|
37
|
+
const ABSENT = Object.freeze({ kind: "absent" });
|
|
38
|
+
const need = (content) => content === "none" ? 0 : content === "all" ? 2 : 1;
|
|
39
|
+
/** Two requests for one path read once, with the larger byte need. */
|
|
40
|
+
function joined(a, b) {
|
|
41
|
+
const content = need(a.content) !== need(b.content) ? (need(a.content) > need(b.content) ? a.content : b.content)
|
|
42
|
+
: typeof a.content === "object" && typeof b.content === "object" && a.content.unless !== b.content.unless
|
|
43
|
+
? "all" : a.content;
|
|
44
|
+
const proven = a.proven ?? b.proven;
|
|
45
|
+
return { path: a.path, content, marker: a.marker === true || b.marker === true, ...proven ? { proven } : {} };
|
|
46
|
+
}
|
|
47
|
+
function revive(answer) {
|
|
48
|
+
if (answer.kind === "absent")
|
|
49
|
+
return ABSENT;
|
|
50
|
+
if (answer.kind === "directory")
|
|
51
|
+
return { kind: "directory", stats: new LiteralStats(answer.stats), marker: answer.marker };
|
|
52
|
+
const { content, stats, ...leaf } = answer.leaf;
|
|
53
|
+
return { kind: "leaf", leaf: { ...leaf, stats: new LiteralStats(stats),
|
|
54
|
+
content: content ? Buffer.from(content.buffer, content.byteOffset, content.byteLength) : null } };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Read many working paths of one repository on content threads. Every
|
|
58
|
+
* batch's components join `witnesses`, so contradictory evidence across
|
|
59
|
+
* batches fails exactly as it does within one. The call returns only after
|
|
60
|
+
* every batch has settled: a failed observation leaves no read running.
|
|
61
|
+
*/
|
|
62
|
+
export async function observeLiteralPaths(repository, format, requests, witnesses, lane) {
|
|
63
|
+
const merged = new Map();
|
|
64
|
+
await eachInTurns(requests, request => {
|
|
65
|
+
const prior = merged.get(request.path);
|
|
66
|
+
merged.set(request.path, prior ? joined(prior, request) : request);
|
|
67
|
+
});
|
|
68
|
+
const ordered = [...merged.values()].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
69
|
+
const observations = new Map();
|
|
70
|
+
const run = async (batch) => {
|
|
71
|
+
const result = await readLiteral(repository, format, batch, lane);
|
|
72
|
+
for (const [path, witness] of pathComponents(result.witness))
|
|
73
|
+
witnesses.adopt(path, witness);
|
|
74
|
+
for (const answer of result.answers)
|
|
75
|
+
observations.set(answer.path, revive(answer));
|
|
76
|
+
if (result.rest.length)
|
|
77
|
+
await run(result.rest);
|
|
78
|
+
};
|
|
79
|
+
const batches = [];
|
|
80
|
+
for (let start = 0; start < ordered.length; start += BATCH_REQUESTS) {
|
|
81
|
+
batches.push(run(ordered.slice(start, start + BATCH_REQUESTS)));
|
|
82
|
+
}
|
|
83
|
+
const failed = (await Promise.allSettled(batches)).find(outcome => outcome.status === "rejected");
|
|
84
|
+
if (failed)
|
|
85
|
+
throw failed.reason;
|
|
86
|
+
return observations;
|
|
87
|
+
}
|
|
88
|
+
/** One path with its own witnesses, for a claim that retains its proof. The
|
|
89
|
+
* witness holds only components, never the leaf's bytes. */
|
|
90
|
+
export async function observeLiteralPath(repository, path, format, lane) {
|
|
91
|
+
const witnesses = new PhysicalPathWitnesses();
|
|
92
|
+
const observed = await observeLiteralPaths(repository, format, [{ path, content: "none" }], witnesses, lane);
|
|
93
|
+
return { observation: observed.get(path), witness: witnesses.seal() };
|
|
94
|
+
}
|
|
95
|
+
/** The request, carrying its member's proof when the caller holds one. */
|
|
96
|
+
export function withProof(request, proven) {
|
|
97
|
+
const leaf = proven?.(request.path);
|
|
98
|
+
return leaf ? { ...request, proven: leaf } : request;
|
|
99
|
+
}
|
|
100
|
+
/** Unclosed collection for the repository operation to finish. Its public
|
|
101
|
+
* boundary closes this proof after all Card, identity and package work.
|
|
102
|
+
* Construction reads exactly the paths it requested, all in one pooled pass;
|
|
103
|
+
* a clean member whose proof still holds is stated, never reopened. Nested
|
|
104
|
+
* repositories' files are theirs, never this Checkpoint's. */
|
|
105
|
+
export async function collectLiteralRepositoryView(capture, commit, boundaries, lane, proven) {
|
|
106
|
+
const repository = capture.repository;
|
|
107
|
+
const binding = (await capture.binding()).binding;
|
|
108
|
+
const inventory = await capture.inventory(null);
|
|
109
|
+
const { index } = inventory;
|
|
110
|
+
const privateGit = await PrivateGitView.open(binding);
|
|
111
|
+
const witnesses = new PhysicalPathWitnesses();
|
|
112
|
+
try {
|
|
113
|
+
const names = [];
|
|
114
|
+
await eachInTurns(inventory.untracked, path => { if (!withinGitBoundary(path, boundaries))
|
|
115
|
+
names.push(path); });
|
|
116
|
+
names.sort();
|
|
117
|
+
const reads = [];
|
|
118
|
+
await eachInTurns(await checkpointReads(index, boundaries, names), read => reads.push(withProof(read, proven)));
|
|
119
|
+
const observed = await observeLiteralPaths(repository, privateGit.format, reads, witnesses, lane);
|
|
120
|
+
const leaves = new Map();
|
|
121
|
+
await eachInTurns(reads, ({ path }) => {
|
|
122
|
+
const observation = observed.get(path);
|
|
123
|
+
if (observation.kind === "leaf") {
|
|
124
|
+
const { content: _content, ...evidence } = observation.leaf;
|
|
125
|
+
leaves.set(path, evidence);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
const checkpoint = await constructLiteralCheckpoint({
|
|
129
|
+
view: privateGit, index, commit, boundaries, additionalPaths: names,
|
|
130
|
+
read: path => {
|
|
131
|
+
const observation = observed.get(path);
|
|
132
|
+
if (!observation)
|
|
133
|
+
throw new Error(`checkpoint construction read an unrequested path: ${path}`);
|
|
134
|
+
return observation.kind === "leaf" ? observation.leaf : null;
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
// Witness lifetime excludes the construction view, patches and leaf buffers.
|
|
138
|
+
const proof = sourceProofs([inventory.proof, witnessProof([await finishStepsInTurns(witnesses.sealSteps())])]);
|
|
139
|
+
return { leaves, index, format: privateGit.format, sourceBinding: binding, ...checkpoint, proof,
|
|
140
|
+
physical: () => witnesses.present() };
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
await privateGit.close();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Each identity entry as the view reads it: a leaf takes its type and
|
|
147
|
+
* payload from the view, every other entry stands as recorded. */
|
|
148
|
+
export function* literalRepositoryIdentitySteps(identity, view) {
|
|
149
|
+
const indexed = new Map();
|
|
150
|
+
let visited = 0;
|
|
151
|
+
for (const entry of view.index) {
|
|
152
|
+
if (entry.stage === 0)
|
|
153
|
+
indexed.set(entry.path, entry);
|
|
154
|
+
if (++visited % ITEMS_PER_BOUNDARY === 0)
|
|
155
|
+
yield;
|
|
156
|
+
}
|
|
157
|
+
const literal = [];
|
|
158
|
+
for (const entry of identity) {
|
|
159
|
+
const leaf = view.leaves.get(entry.path);
|
|
160
|
+
literal.push(leaf ? { ...entry, type: leaf.type, payloadVersion: indexed.get(entry.path)?.objectId === leaf.objectId
|
|
161
|
+
? `git:${view.format}:${leaf.objectId}` : leafDigest(leaf) } : entry);
|
|
162
|
+
if (++visited % ITEMS_PER_BOUNDARY === 0)
|
|
163
|
+
yield;
|
|
164
|
+
}
|
|
165
|
+
return literal;
|
|
166
|
+
}
|
|
167
|
+
export const literalRepositoryIdentity = (identity, view) => finishSteps(literalRepositoryIdentitySteps(identity, view));
|
|
168
|
+
/** The view's literal identity map, sorted and hashed. */
|
|
169
|
+
export function* literalRepositoryIdentityMapSteps(identity, view) {
|
|
170
|
+
return yield* repositoryIdentityMapSteps(yield* literalRepositoryIdentitySteps(identity, view));
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=git-literal-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-literal-host.js","sourceRoot":"","sources":["../src/git-literal-host.ts"],"names":[],"mappings":"AAAA;;;;mDAImD;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAA4D,MAAM,cAAc,CAAC;AACzH,OAAO,EAAE,WAAW,EAAoB,MAAM,2BAA2B,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAsB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EACL,UAAU,GAEX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAA+C,MAAM,4BAA4B,CAAC;AAEhI,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,eAAe,EAAE,0BAA0B,GAC5C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE7D,mFAAmF;AACnF,MAAM,OAAO,YAAY;IACd,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,KAAK,CAAS;IACd,IAAI,CAAS;IACb,IAAI,CAAS;IACb,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,SAAS,CAAU;IAC5B,YAAY,OAA4B;QACtC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI;YAClF,OAAO,EAAE,IAAI,CAAC,OAAO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,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAsC,EAAE,IAA2B,EACtF,EAAE,CAAC,WAAW,CAAC,8BAA8B,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtF,0DAA0D;AAC1D,MAAM,SAAS,CAAC,CAAC,iCAAiC,CAChD,QAAsC,EAAE,IAA2B;IAEnE,OAAO,KAAK,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,8BAA8B,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type EntityType } from "@amalgm/live";
|
|
2
|
+
import { type PathsWitness, type RetainedPathWitness } from "./physical-path-witness.js";
|
|
3
|
+
/** What our own earlier literal read proved about one leaf, under the one
|
|
4
|
+
* rule every leaf row follows: while a fresh stat still equals `signature`
|
|
5
|
+
* and both of its times precede `boundary`, the leaf's bytes are still Git
|
|
6
|
+
* object `objectId` in `format`, classified as `type`. */
|
|
7
|
+
export interface ProvenLeaf {
|
|
8
|
+
readonly signature: string;
|
|
9
|
+
readonly boundary: string;
|
|
10
|
+
readonly format: string;
|
|
11
|
+
readonly objectId: string;
|
|
12
|
+
readonly type: Extract<EntityType, "file.text" | "file.binary" | "link">;
|
|
13
|
+
}
|
|
14
|
+
/** A leaf row's proof of the Git object its bytes are, when it states one. */
|
|
15
|
+
export declare function provenLeaf(row: {
|
|
16
|
+
readonly type: EntityType;
|
|
17
|
+
readonly payloadVersion: string | null;
|
|
18
|
+
readonly sourceSignature: string | null;
|
|
19
|
+
readonly contentVerifiedNs: string | null;
|
|
20
|
+
}): ProvenLeaf | undefined;
|
|
21
|
+
export interface LiteralRequest {
|
|
22
|
+
readonly path: string;
|
|
23
|
+
/** The bytes an answer carries: none, all, or all unless they are exactly
|
|
24
|
+
* this Git object, which the caller already names. */
|
|
25
|
+
readonly content: "none" | "all" | {
|
|
26
|
+
readonly unless: string;
|
|
27
|
+
};
|
|
28
|
+
/** A directory answer also reports its own `.git` ownership marker. */
|
|
29
|
+
readonly marker?: boolean;
|
|
30
|
+
/** Answers without opening the leaf when it still holds and the request
|
|
31
|
+
* needs none of its bytes. */
|
|
32
|
+
readonly proven?: ProvenLeaf;
|
|
33
|
+
}
|
|
34
|
+
/** A `.git` entry makes its directory an independent repository boundary. */
|
|
35
|
+
export interface LiteralMarker {
|
|
36
|
+
readonly independent: boolean;
|
|
37
|
+
readonly identity: string;
|
|
38
|
+
}
|
|
39
|
+
export interface LiteralLeafAnswer {
|
|
40
|
+
readonly type: Extract<EntityType, "file.text" | "file.binary" | "link">;
|
|
41
|
+
readonly mode: "100644" | "100755" | "120000";
|
|
42
|
+
/** Null only for a proven answer, whose payload is its Git object. */
|
|
43
|
+
readonly sha256: string | null;
|
|
44
|
+
readonly objectId: string;
|
|
45
|
+
readonly stats: RetainedPathWitness;
|
|
46
|
+
readonly content: Uint8Array | null;
|
|
47
|
+
}
|
|
48
|
+
/** A content row names its leaf by one codec: a repository member by its Git
|
|
49
|
+
* object in that repository's format, every other leaf by its SHA-256. */
|
|
50
|
+
export declare const payloadFormat: (payloadVersion: string) => string;
|
|
51
|
+
export declare const leafPayload: (payloadVersion: string | null | undefined, format: string, leaf: Pick<LiteralLeafAnswer, "sha256" | "objectId">) => string;
|
|
52
|
+
/** A leaf's SHA-256, which only a read of its bytes states. */
|
|
53
|
+
export declare function leafDigest(leaf: Pick<LiteralLeafAnswer, "sha256" | "objectId">): string;
|
|
54
|
+
export type LiteralAnswer = {
|
|
55
|
+
readonly path: string;
|
|
56
|
+
readonly kind: "absent";
|
|
57
|
+
} | {
|
|
58
|
+
readonly path: string;
|
|
59
|
+
readonly kind: "directory";
|
|
60
|
+
readonly stats: RetainedPathWitness;
|
|
61
|
+
readonly marker: LiteralMarker | null;
|
|
62
|
+
} | {
|
|
63
|
+
readonly path: string;
|
|
64
|
+
readonly kind: "leaf";
|
|
65
|
+
readonly leaf: LiteralLeafAnswer;
|
|
66
|
+
};
|
|
67
|
+
export interface LiteralBatch {
|
|
68
|
+
readonly answers: readonly LiteralAnswer[];
|
|
69
|
+
/** Every component read, absent ones included, prefixes first. */
|
|
70
|
+
readonly witness: PathsWitness;
|
|
71
|
+
/** Requests left for another batch once this one reached its byte bound. */
|
|
72
|
+
readonly rest: readonly LiteralRequest[];
|
|
73
|
+
}
|
|
74
|
+
/** Bytes one reply may carry; a larger single leaf travels alone. */
|
|
75
|
+
export declare const LITERAL_BATCH_BYTES: number;
|
|
76
|
+
export declare function readLiteralMarker(directory: string): LiteralMarker | null;
|
|
77
|
+
/** A directory's repository marker as one read saw it: an ownership boundary. */
|
|
78
|
+
export interface GitMarkerWitness {
|
|
79
|
+
readonly kind: "git-marker";
|
|
80
|
+
readonly directory: string;
|
|
81
|
+
readonly marker: string;
|
|
82
|
+
}
|
|
83
|
+
export declare const gitMarkerWitness: (directory: string, marker: LiteralMarker | null) => GitMarkerWitness;
|
|
84
|
+
export declare function judgeGitMarker(witness: GitMarkerWitness): void;
|
|
85
|
+
/** Each answer's components join the batch's witnesses. An observed ancestor
|
|
86
|
+
* link obstructs a descendant; a persistent replacement during the batch
|
|
87
|
+
* invalidates it. Full-path syscalls do not promise atomic no-follow ancestry. */
|
|
88
|
+
export declare function readLiteralBatch(repository: string, format: string, requests: readonly LiteralRequest[]): LiteralBatch;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** Literal worktree reads for one repository, run on a content thread.
|
|
2
|
+
* Git's status, attributes and index stat hints never prove physical bytes:
|
|
3
|
+
* every answer comes from the bytes and components read here, or from our
|
|
4
|
+
* own earlier read of the same unchanged object (see ProvenLeaf). A batch
|
|
5
|
+
* reads each path component once and validates every component after its
|
|
6
|
+
* last read, so shared ancestors cost one stat per batch, not one per leaf. */
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { closeSync, constants, fstatSync, lstatSync, openSync, readSync, readlinkSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { classifyFile } from "@amalgm/live";
|
|
11
|
+
import { CaptureSourceChangedError } from "./content-cache-host.js";
|
|
12
|
+
import { assertGitPath } from "./git-index-entries.js";
|
|
13
|
+
import { optionalLstat, PhysicalPathWitnesses, retainedWitness } from "./physical-path-witness.js";
|
|
14
|
+
import { contentProven, sameSource, sourceSignature } from "./source-signature.js";
|
|
15
|
+
/** A leaf row's proof of the Git object its bytes are, when it states one. */
|
|
16
|
+
export function provenLeaf(row) {
|
|
17
|
+
if (row.type !== "file.text" && row.type !== "file.binary" && row.type !== "link")
|
|
18
|
+
return undefined;
|
|
19
|
+
if (!row.payloadVersion?.startsWith("git:") || row.sourceSignature === null || row.contentVerifiedNs === null)
|
|
20
|
+
return undefined;
|
|
21
|
+
const [, format, objectId] = row.payloadVersion.split(":");
|
|
22
|
+
return { signature: row.sourceSignature, boundary: row.contentVerifiedNs, format: format, objectId: objectId, type: row.type };
|
|
23
|
+
}
|
|
24
|
+
/** A content row names its leaf by one codec: a repository member by its Git
|
|
25
|
+
* object in that repository's format, every other leaf by its SHA-256. */
|
|
26
|
+
export const payloadFormat = (payloadVersion) => payloadVersion.startsWith("git:") ? payloadVersion.split(":")[1] : "sha1";
|
|
27
|
+
export const leafPayload = (payloadVersion, format, leaf) => payloadVersion?.startsWith("git:") ? `git:${format}:${leaf.objectId}` : leafDigest(leaf);
|
|
28
|
+
/** A leaf's SHA-256, which only a read of its bytes states. */
|
|
29
|
+
export function leafDigest(leaf) {
|
|
30
|
+
if (leaf.sha256 === null)
|
|
31
|
+
throw new Error(`a proven leaf states only its Git object: ${leaf.objectId}`);
|
|
32
|
+
return leaf.sha256;
|
|
33
|
+
}
|
|
34
|
+
/** Bytes one reply may carry; a larger single leaf travels alone. */
|
|
35
|
+
export const LITERAL_BATCH_BYTES = 16 * 1024 * 1024;
|
|
36
|
+
const READ_CHUNK = 256 * 1024;
|
|
37
|
+
export function readLiteralMarker(directory) {
|
|
38
|
+
try {
|
|
39
|
+
const stat = lstatSync(join(directory, ".git"), { bigint: true });
|
|
40
|
+
return { independent: stat.isDirectory() || stat.isFile(), identity: [stat.dev, stat.ino, stat.mode].join(":") };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error.code === "ENOENT")
|
|
44
|
+
return null;
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export const gitMarkerWitness = (directory, marker) => Object.freeze({ kind: "git-marker", directory, marker: JSON.stringify(marker) });
|
|
49
|
+
export function judgeGitMarker(witness) {
|
|
50
|
+
if (JSON.stringify(readLiteralMarker(witness.directory)) !== witness.marker) {
|
|
51
|
+
throw new CaptureSourceChangedError("repository ownership boundary changed during inspection");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const gitMode = (stats) => stats.isSymbolicLink() ? "120000" : stats.mode & 73n ? "100755" : "100644";
|
|
55
|
+
/** The earlier proof answers only a request that needs no bytes of it. */
|
|
56
|
+
function provenAnswer(request, before, format) {
|
|
57
|
+
const { proven, content } = request;
|
|
58
|
+
if (!proven || proven.format !== format || (content !== "none"
|
|
59
|
+
&& (typeof content !== "object" || content.unless !== proven.objectId)))
|
|
60
|
+
return null;
|
|
61
|
+
if (sourceSignature(before) !== proven.signature || !contentProven(proven.signature, proven.boundary)
|
|
62
|
+
|| (proven.type === "link") !== before.isSymbolicLink())
|
|
63
|
+
return null;
|
|
64
|
+
return { type: proven.type, mode: gitMode(before), sha256: null, objectId: proven.objectId,
|
|
65
|
+
stats: retainedWitness(before), content: null };
|
|
66
|
+
}
|
|
67
|
+
/** Kept bytes own their buffer so the reply can transfer it. */
|
|
68
|
+
function readLeaf(file, path, before, format, keep) {
|
|
69
|
+
const hash = createHash("sha256"), object = createHash(format);
|
|
70
|
+
let content = null, binary = false;
|
|
71
|
+
const consume = (chunk) => { hash.update(chunk); object.update(chunk); binary ||= chunk.includes(0); };
|
|
72
|
+
if (before.isSymbolicLink()) {
|
|
73
|
+
const target = Buffer.from(readlinkSync(file), "utf8");
|
|
74
|
+
object.update(`blob ${target.length}\0`);
|
|
75
|
+
consume(target);
|
|
76
|
+
if (keep) {
|
|
77
|
+
content = Buffer.allocUnsafeSlow(target.length);
|
|
78
|
+
target.copy(content);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
if (!before.isFile())
|
|
83
|
+
throw new Error(`unsupported repository leaf: ${path}`);
|
|
84
|
+
const fd = openSync(file, constants.O_RDONLY | constants.O_NONBLOCK | (constants.O_NOFOLLOW ?? 0));
|
|
85
|
+
try {
|
|
86
|
+
if (!sameSource(before, fstatSync(fd, { bigint: true })))
|
|
87
|
+
throw new CaptureSourceChangedError(`repository leaf changed: ${path}`);
|
|
88
|
+
const size = Number(before.size);
|
|
89
|
+
object.update(`blob ${size}\0`);
|
|
90
|
+
if (keep)
|
|
91
|
+
content = Buffer.allocUnsafeSlow(size);
|
|
92
|
+
const buffer = content ?? Buffer.allocUnsafe(Math.min(READ_CHUNK, size));
|
|
93
|
+
for (let offset = 0; offset < size;) {
|
|
94
|
+
const at = content ? offset : 0;
|
|
95
|
+
const count = readSync(fd, buffer, at, Math.min(READ_CHUNK, size - offset), offset);
|
|
96
|
+
if (count === 0)
|
|
97
|
+
throw new CaptureSourceChangedError(`repository leaf shortened during capture: ${path}`);
|
|
98
|
+
consume(buffer.subarray(at, at + count));
|
|
99
|
+
offset += count;
|
|
100
|
+
}
|
|
101
|
+
if (!sameSource(before, fstatSync(fd, { bigint: true }))) {
|
|
102
|
+
throw new CaptureSourceChangedError(`repository leaf changed during capture: ${path}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
closeSync(fd);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
type: before.isSymbolicLink() ? "link" : classifyFile({ binary }),
|
|
111
|
+
mode: gitMode(before),
|
|
112
|
+
sha256: hash.digest("hex"), objectId: object.digest("hex"), stats: retainedWitness(before), content,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Each answer's components join the batch's witnesses. An observed ancestor
|
|
116
|
+
* link obstructs a descendant; a persistent replacement during the batch
|
|
117
|
+
* invalidates it. Full-path syscalls do not promise atomic no-follow ancestry. */
|
|
118
|
+
export function readLiteralBatch(repository, format, requests) {
|
|
119
|
+
const witnesses = new PhysicalPathWitnesses();
|
|
120
|
+
const observe = (file) => {
|
|
121
|
+
const stats = optionalLstat(file);
|
|
122
|
+
witnesses.remember(file, stats);
|
|
123
|
+
return stats;
|
|
124
|
+
};
|
|
125
|
+
const directory = (file) => {
|
|
126
|
+
const known = witnesses.known(file);
|
|
127
|
+
return known === undefined ? observe(file)?.isDirectory() === true : known?.directory === true;
|
|
128
|
+
};
|
|
129
|
+
if (!observe(repository)?.isDirectory())
|
|
130
|
+
throw new CaptureSourceChangedError("repository root is unavailable");
|
|
131
|
+
const answers = [];
|
|
132
|
+
let bytes = 0, next = 0;
|
|
133
|
+
for (; next < requests.length; next += 1) {
|
|
134
|
+
const request = requests[next];
|
|
135
|
+
const { path } = request;
|
|
136
|
+
assertGitPath(path);
|
|
137
|
+
const parts = path.split("/");
|
|
138
|
+
let parentsPresent = true;
|
|
139
|
+
for (let end = 1; end < parts.length && parentsPresent; end += 1) {
|
|
140
|
+
parentsPresent = directory(join(repository, ...parts.slice(0, end)));
|
|
141
|
+
}
|
|
142
|
+
const file = join(repository, path);
|
|
143
|
+
const before = parentsPresent ? observe(file) : null;
|
|
144
|
+
if (before === null) {
|
|
145
|
+
answers.push({ path, kind: "absent" });
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (before.isDirectory()) {
|
|
149
|
+
answers.push({ path, kind: "directory", stats: retainedWitness(before),
|
|
150
|
+
marker: request.marker ? readLiteralMarker(file) : null });
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const proven = provenAnswer(request, before, format);
|
|
154
|
+
if (proven) {
|
|
155
|
+
answers.push({ path, kind: "leaf", leaf: proven });
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const keep = request.content !== "none";
|
|
159
|
+
if (keep && answers.length > 0 && bytes + Number(before.size) > LITERAL_BATCH_BYTES)
|
|
160
|
+
break;
|
|
161
|
+
let leaf = readLeaf(file, path, before, format, keep);
|
|
162
|
+
if (typeof request.content === "object" && request.content.unless === leaf.objectId)
|
|
163
|
+
leaf = { ...leaf, content: null };
|
|
164
|
+
bytes += leaf.content?.byteLength ?? 0;
|
|
165
|
+
answers.push({ path, kind: "leaf", leaf });
|
|
166
|
+
}
|
|
167
|
+
witnesses.validate();
|
|
168
|
+
return { answers, witness: witnesses.seal(), rest: requests.slice(next) };
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=git-literal-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-literal-read.js","sourceRoot":"","sources":["../src/git-literal-read.ts"],"names":[],"mappings":"AAAA;;;;;+EAK+E;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAoB,MAAM,SAAS,CAAC;AACzH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAA+C,MAAM,4BAA4B,CAAC;AAChJ,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAcnF,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,GAC2D;IACpF,IA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SAAS;QAAC,CAAC;QAC7E,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC;QACxC,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,mBAAmB;YAAE,MAAM;QAC3F,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,QAAQ;YAAE,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACvH,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,SAAS,CAAC,QAAQ,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RepoIdentityEntry } from "@amalgm/live";
|
|
2
|
+
import { type LiteralCheckpointSource } from "./git-checkpoint-preparation.js";
|
|
3
|
+
/** Removals one working reveal may perform, planned before any effect. */
|
|
4
|
+
export interface RevealRemovals {
|
|
5
|
+
readonly leaves: readonly string[];
|
|
6
|
+
/** Deepest first. */
|
|
7
|
+
readonly directories: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
/** What a reveal may remove besides installing the accepted result. */
|
|
10
|
+
export type RevealGround =
|
|
11
|
+
/** Ground this install alone created (private Add staging, or core ground
|
|
12
|
+
* login just cleared): nothing but the result has value there. */
|
|
13
|
+
{
|
|
14
|
+
readonly kind: "owned";
|
|
15
|
+
}
|
|
16
|
+
/** Working ground: only planned removals, and the accounted remainder
|
|
17
|
+
* policy keeps unshared stays in place. */
|
|
18
|
+
| {
|
|
19
|
+
readonly kind: "working";
|
|
20
|
+
readonly removals: RevealRemovals;
|
|
21
|
+
readonly remainder: ReadonlySet<string>;
|
|
22
|
+
};
|
|
23
|
+
export declare class RepositoryGroundObstructed extends Error {
|
|
24
|
+
readonly paths: readonly string[];
|
|
25
|
+
constructor(paths: readonly string[]);
|
|
26
|
+
}
|
|
27
|
+
/** Removal is sharing's decision, never an occupant's: only members the
|
|
28
|
+
* shared identity held and the accepted identity drops are removed. A
|
|
29
|
+
* remainder in a slot the result needs, a dropped directory still holding
|
|
30
|
+
* kept ground, or anything neither identity nor the remainder accounts for
|
|
31
|
+
* obstructs before any effect, naming its paths. */
|
|
32
|
+
export declare function planWorkingReveal(repository: string, target: readonly RepoIdentityEntry[], shared: readonly RepoIdentityEntry[], remainder: ReadonlySet<string>): RevealRemovals;
|
|
33
|
+
export declare function installLiteralCheckpoint(repository: string, checkpoint: LiteralCheckpointSource, identity: readonly RepoIdentityEntry[], ground: RevealGround, installMetadata: () => Promise<void>): Promise<void>;
|