@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
package/dist/construct-ledger.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* The product owns what it runs; this ledger owns what the rails said. They
|
|
11
11
|
* are different questions, and Apply asks the product, never this table.
|
|
12
12
|
*/
|
|
13
|
+
import { save } from "./ground-saver.js";
|
|
14
|
+
import { cachedStatement } from "./sqlite.js";
|
|
13
15
|
const record = (row) => Object.freeze({
|
|
14
16
|
uuid: row.uuid,
|
|
15
17
|
type: row.type,
|
|
@@ -23,37 +25,31 @@ const record = (row) => Object.freeze({
|
|
|
23
25
|
fileMode: null,
|
|
24
26
|
transportVersion: null,
|
|
25
27
|
});
|
|
28
|
+
/** The ledger's one write, run only by the ground file's saver thread. */
|
|
29
|
+
export function rememberConstruct(database, input) {
|
|
30
|
+
const { entity } = input;
|
|
31
|
+
cachedStatement(database, `
|
|
32
|
+
INSERT INTO constructs(uuid, type, name, status, version, payload_version, updated_at_ms)
|
|
33
|
+
VALUES(?, ?, ?, ?, ?, ?, ?)
|
|
34
|
+
ON CONFLICT(uuid) DO UPDATE SET
|
|
35
|
+
type = excluded.type,
|
|
36
|
+
name = excluded.name,
|
|
37
|
+
status = excluded.status,
|
|
38
|
+
version = excluded.version,
|
|
39
|
+
payload_version = excluded.payload_version,
|
|
40
|
+
updated_at_ms = excluded.updated_at_ms
|
|
41
|
+
`).run(entity.uuid, entity.type, entity.name, entity.status, entity.version, entity.payloadVersion, input.updatedAtMs);
|
|
42
|
+
}
|
|
26
43
|
export class ConstructLedger {
|
|
44
|
+
#file;
|
|
27
45
|
#read;
|
|
28
|
-
#write;
|
|
29
46
|
#now;
|
|
30
47
|
constructor(database, now = Date.now) {
|
|
31
|
-
database.
|
|
32
|
-
CREATE TABLE IF NOT EXISTS constructs (
|
|
33
|
-
uuid TEXT PRIMARY KEY,
|
|
34
|
-
type TEXT NOT NULL,
|
|
35
|
-
name TEXT NOT NULL,
|
|
36
|
-
status TEXT NOT NULL,
|
|
37
|
-
version TEXT NOT NULL,
|
|
38
|
-
payload_version TEXT,
|
|
39
|
-
updated_at_ms INTEGER NOT NULL
|
|
40
|
-
)
|
|
41
|
-
`);
|
|
48
|
+
this.#file = database.name;
|
|
42
49
|
this.#read = database.prepare(`
|
|
43
50
|
SELECT uuid, type, name, status, version, payload_version
|
|
44
51
|
FROM constructs
|
|
45
52
|
WHERE uuid = ?
|
|
46
|
-
`);
|
|
47
|
-
this.#write = database.prepare(`
|
|
48
|
-
INSERT INTO constructs(uuid, type, name, status, version, payload_version, updated_at_ms)
|
|
49
|
-
VALUES(@uuid, @type, @name, @status, @version, @payloadVersion, @updatedAtMs)
|
|
50
|
-
ON CONFLICT(uuid) DO UPDATE SET
|
|
51
|
-
type = excluded.type,
|
|
52
|
-
name = excluded.name,
|
|
53
|
-
status = excluded.status,
|
|
54
|
-
version = excluded.version,
|
|
55
|
-
payload_version = excluded.payload_version,
|
|
56
|
-
updated_at_ms = excluded.updated_at_ms
|
|
57
53
|
`);
|
|
58
54
|
this.#now = now;
|
|
59
55
|
}
|
|
@@ -71,16 +67,8 @@ export class ConstructLedger {
|
|
|
71
67
|
return this.record(uuid)?.status === "active";
|
|
72
68
|
}
|
|
73
69
|
/** Remember one record, whether this computer recorded it or received it. */
|
|
74
|
-
remember(entity) {
|
|
75
|
-
this.#
|
|
76
|
-
uuid: entity.uuid,
|
|
77
|
-
type: entity.type,
|
|
78
|
-
name: entity.name,
|
|
79
|
-
status: entity.status,
|
|
80
|
-
version: entity.version,
|
|
81
|
-
payloadVersion: entity.payloadVersion,
|
|
82
|
-
updatedAtMs: this.#now(),
|
|
83
|
-
});
|
|
70
|
+
async remember(entity) {
|
|
71
|
+
await save(this.#file, "constructs.remember", { entity, updatedAtMs: this.#now() });
|
|
84
72
|
}
|
|
85
73
|
}
|
|
86
74
|
//# sourceMappingURL=construct-ledger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"construct-ledger.js","sourceRoot":"","sources":["../src/construct-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"construct-ledger.js","sourceRoot":"","sources":["../src/construct-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAW9C,MAAM,MAAM,GAAG,CAAC,GAAiB,EAAqB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;IACrE,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,IAAI,EAAE,GAAG,CAAC,IAAiC;IAC3C,0EAA0E;IAC1E,+CAA+C;IAC/C,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,MAAM,EAAE,GAAG,CAAC,MAAqC;IACjD,OAAO,EAAE,GAAG,CAAC,OAAO;IACpB,cAAc,EAAE,GAAG,CAAC,eAAe;IACnC,QAAQ,EAAE,IAAI;IACd,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,CAAC,QAA2B,EAAE,KAG9D;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,eAAe,CAAC,QAAQ,EAAE;;;;;;;;;;GAUzB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,E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
readonly deleted: number;
|
|
5
|
+
readonly ms: number;
|
|
6
|
+
readonly error?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CollectionOptions {
|
|
9
|
+
readonly cacheDir: string;
|
|
10
|
+
/** Which cached objects no durable owner retains; null defers. */
|
|
11
|
+
readonly unowned: (current: () => boolean) => Promise<{
|
|
12
|
+
readonly examined: number;
|
|
13
|
+
readonly unowned: readonly string[];
|
|
14
|
+
} | null>;
|
|
15
|
+
readonly report: (report: CollectionReport) => void;
|
|
16
|
+
}
|
|
17
|
+
/** Start collecting one cache; the returned stop waits out a running attempt. */
|
|
18
|
+
export declare function collectContentCache({ cacheDir, unowned, report }: CollectionOptions): () => Promise<void>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When the content cache collects what no durable owner retains.
|
|
3
|
+
*
|
|
4
|
+
* Prior art is `git gc --auto`: collection is due once enough new objects
|
|
5
|
+
* have arrived, or once a period has passed; nothing collects per commit, so
|
|
6
|
+
* an acknowledgment never starts one. A cache whose objects are all retained
|
|
7
|
+
* stays quiet until more arrive, however large it is. A proof that a recovery
|
|
8
|
+
* owner defers, or that a new cache user invalidates, retries after a
|
|
9
|
+
* doubling delay, never on every idle edge. Collection waits for a quiet
|
|
10
|
+
* cache and yields between its bounded chunks and deletion steps.
|
|
11
|
+
*/
|
|
12
|
+
import { performance } from "node:perf_hooks";
|
|
13
|
+
import { pruneUnownedContentCache } from "./content-cache-host.js";
|
|
14
|
+
import { cacheNamespace } from "./content-cache-namespace.js";
|
|
15
|
+
import { contentCacheOwnership } from "./content-cache-ownership.js";
|
|
16
|
+
/** Names created since the last attempt that make collection due. */
|
|
17
|
+
const PRESSURE = 1024;
|
|
18
|
+
const PERIOD_MS = 60 * 60 * 1000;
|
|
19
|
+
/** Cache uses arrive in bursts; a quiet quarter second lets one finish. */
|
|
20
|
+
const QUIET_MS = 250;
|
|
21
|
+
const FIRST_RETRY_MS = 1000;
|
|
22
|
+
/** Hashes whose evidence one synchronous deletion step removes. */
|
|
23
|
+
const STEP = 64;
|
|
24
|
+
/** Start collecting one cache; the returned stop waits out a running attempt. */
|
|
25
|
+
export function collectContentCache({ cacheDir, unowned, report }) {
|
|
26
|
+
const owner = contentCacheOwnership(cacheDir);
|
|
27
|
+
const namespace = cacheNamespace(cacheDir);
|
|
28
|
+
let due = true;
|
|
29
|
+
let createdAtAttempt = namespace.created;
|
|
30
|
+
let retryMs = FIRST_RETRY_MS;
|
|
31
|
+
let retryAt = 0;
|
|
32
|
+
let timer = null;
|
|
33
|
+
let running = null;
|
|
34
|
+
let stopped = false;
|
|
35
|
+
const consider = () => {
|
|
36
|
+
if (stopped || timer || running)
|
|
37
|
+
return;
|
|
38
|
+
if (!due && namespace.created - createdAtAttempt >= PRESSURE)
|
|
39
|
+
due = true;
|
|
40
|
+
if (!due || !owner.unused)
|
|
41
|
+
return;
|
|
42
|
+
timer = setTimeout(attempt, Math.max(QUIET_MS, retryAt - performance.now()));
|
|
43
|
+
timer.unref();
|
|
44
|
+
};
|
|
45
|
+
const attempt = () => {
|
|
46
|
+
timer = null;
|
|
47
|
+
if (stopped || !owner.unused)
|
|
48
|
+
return; // the next idle edge reconsiders
|
|
49
|
+
createdAtAttempt = namespace.created;
|
|
50
|
+
const started = performance.now();
|
|
51
|
+
let examined = 0;
|
|
52
|
+
let deleted = 0;
|
|
53
|
+
running = owner.maintain(async (current) => {
|
|
54
|
+
const proof = await unowned(current);
|
|
55
|
+
if (proof === null)
|
|
56
|
+
return null;
|
|
57
|
+
examined = proof.examined;
|
|
58
|
+
const steps = [];
|
|
59
|
+
for (let start = 0; start === 0 || start < proof.unowned.length; start += STEP) {
|
|
60
|
+
const batch = proof.unowned.slice(start, start + STEP);
|
|
61
|
+
steps.push(() => { pruneUnownedContentCache(cacheDir, batch); deleted += batch.length; });
|
|
62
|
+
}
|
|
63
|
+
return steps;
|
|
64
|
+
}).then(outcome => {
|
|
65
|
+
if (outcome === "committed") {
|
|
66
|
+
due = false;
|
|
67
|
+
retryMs = FIRST_RETRY_MS;
|
|
68
|
+
retryAt = 0;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
retryAt = performance.now() + retryMs;
|
|
72
|
+
retryMs = Math.min(retryMs * 2, PERIOD_MS);
|
|
73
|
+
}
|
|
74
|
+
if (outcome !== "busy")
|
|
75
|
+
report({ outcome, examined, deleted, ms: performance.now() - started });
|
|
76
|
+
}, error => {
|
|
77
|
+
due = false;
|
|
78
|
+
report({ outcome: "failed", examined, deleted, ms: performance.now() - started,
|
|
79
|
+
error: error instanceof Error ? error.message : String(error) });
|
|
80
|
+
}).finally(() => { running = null; consider(); });
|
|
81
|
+
};
|
|
82
|
+
const period = setInterval(() => { due = true; consider(); }, PERIOD_MS);
|
|
83
|
+
period.unref();
|
|
84
|
+
owner.onIdle(consider);
|
|
85
|
+
consider();
|
|
86
|
+
return async () => {
|
|
87
|
+
stopped = true;
|
|
88
|
+
owner.onIdle(null);
|
|
89
|
+
clearInterval(period);
|
|
90
|
+
if (timer)
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
timer = null;
|
|
93
|
+
// A new use invalidates any proof or deletion step still to run.
|
|
94
|
+
const release = owner.use();
|
|
95
|
+
release();
|
|
96
|
+
await running;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=content-cache-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-cache-collection.js","sourceRoot":"","sources":["../src/content-cache-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,qEAAqE;AACrE,MAAM,QAAQ,GAAG,IAAI,C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,GAAG,EAAE,CAAC;QAAC,OAAO,EAAE,CAAC;QACvC,MAAM,OAAO,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* files. The portable transfer law remains in @amalgm/live; this module owns
|
|
8
8
|
* only Node filesystem effects.
|
|
9
9
|
*/
|
|
10
|
-
import { type Stats } from "node:fs";
|
|
11
10
|
import { type ContentChunk, type ContentManifest, type TransferArtifact } from "@amalgm/live";
|
|
12
11
|
import { ContentCacheIndex } from "./content-cache-index.js";
|
|
12
|
+
import { type SourceStat } from "./source-signature.js";
|
|
13
13
|
export interface SealedContentFile {
|
|
14
14
|
readonly file: string;
|
|
15
15
|
readonly bytes: number;
|
|
@@ -21,6 +21,20 @@ export interface CapturedFileContent {
|
|
|
21
21
|
readonly manifest: ContentManifest;
|
|
22
22
|
readonly binary: boolean;
|
|
23
23
|
}
|
|
24
|
+
/** What a content-thread cargo writer leaves the main thread to publish: a
|
|
25
|
+
* qualified name it found standing, or bytes it staged written through,
|
|
26
|
+
* which receive their name only after a barrier makes them durable. */
|
|
27
|
+
export type CacheStage = {
|
|
28
|
+
readonly kind: "reused";
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: "staged";
|
|
31
|
+
readonly temporary: string;
|
|
32
|
+
};
|
|
33
|
+
/** A content-thread capture also says what it left for the cache name, so
|
|
34
|
+
* the main thread publishes it and accounts for its directory durability. */
|
|
35
|
+
export interface CacheCapture extends CapturedFileContent {
|
|
36
|
+
readonly cache: CacheStage | null;
|
|
37
|
+
}
|
|
24
38
|
export interface ContentBlockSource {
|
|
25
39
|
readonly bytes: number;
|
|
26
40
|
read(offset: number, bytes: number): Promise<Uint8Array>;
|
|
@@ -34,38 +48,90 @@ export interface ContentBlockSink {
|
|
|
34
48
|
export declare class CaptureSourceChangedError extends Error {
|
|
35
49
|
readonly code = "CAPTURE_SOURCE_CHANGED";
|
|
36
50
|
}
|
|
51
|
+
/** Where the cache keeps one artifact's sealed bytes. */
|
|
52
|
+
export declare const contentFile: (cacheDir: string, contentHash: string) => string;
|
|
53
|
+
/** Every content hash the cache holds any sealed evidence for. */
|
|
54
|
+
export declare function listCachedContent(cacheDir: string): Promise<ReadonlySet<string>>;
|
|
37
55
|
/**
|
|
38
|
-
* Remove sealed cache evidence
|
|
39
|
-
* retains.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
56
|
+
* Remove the sealed cache evidence of exactly these hashes, which the caller
|
|
57
|
+
* proved no durable owner retains. A name the proof never examined is never
|
|
58
|
+
* removed. Callers must hold the cache's final maintenance fence: a capture can
|
|
59
|
+
* already occupy its final filename before Record owns it. Every staging
|
|
60
|
+
* temporary goes too: each writer holds a cache use until its attempt settles,
|
|
61
|
+
* so under the fence none belongs to a live attempt. Resumable download
|
|
62
|
+
* partials remain outside this deletion surface.
|
|
42
63
|
*/
|
|
43
|
-
export declare function
|
|
64
|
+
export declare function pruneUnownedContentCache(cacheDir: string, unowned: readonly string[]): void;
|
|
65
|
+
/** Remove a cached artifact whose bytes no longer prove its hash, with its
|
|
66
|
+
* hint. The name is forgotten, so if it reappears it is a new publication. */
|
|
67
|
+
export declare function discardCachedArtifact(cacheDir: string, contentHash: string): void;
|
|
44
68
|
/** True when the machine cache already holds this artifact sealed whole.
|
|
45
69
|
* Cold Add routes such artifacts through the cache rail so a warm re-Add
|
|
46
70
|
* stays a local clone instead of a fresh download. */
|
|
47
71
|
export declare function hasSealedContent(cacheDir: string, contentHash: string, bytes: number): boolean;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Publish what a content thread left for one cargo name, on the main thread:
|
|
74
|
+
* a staged file receives its name once content-cache-namespace's group
|
|
75
|
+
* barrier made it durable; a reused name is adopted. Either way the namespace
|
|
76
|
+
* learns the name, so a Record requiring it knows whether its directory entry
|
|
77
|
+
* still needs a flush. A staged file that cannot be named is removed.
|
|
78
|
+
*/
|
|
79
|
+
export declare function publishCargo(cacheDir: string, contentHash: string, stage: CacheStage): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* A hint is reconstructible evidence, not cargo: no record commits to it, and
|
|
82
|
+
* its exact bytes follow from retained immutable content. So a hint is written
|
|
83
|
+
* without any flush and may be lost or torn by a crash; every reader validates
|
|
84
|
+
* it and otherwise derives it again. A failure to write one loses only the
|
|
85
|
+
* hint. Manifests and repository identity frontiers are hints.
|
|
86
|
+
*/
|
|
87
|
+
export declare function writeCacheHint(cacheDir: string, file: string, text: Uint8Array): Promise<void>;
|
|
88
|
+
/** A cached manifest hint, or null unless it is exactly the manifest this
|
|
89
|
+
* artifact's current contract and layout commit to. The read never runs on
|
|
90
|
+
* the main thread: a slow page-in stalls only this reader. */
|
|
91
|
+
export declare function readManifestHint(cacheDir: string, artifact: TransferArtifact): Promise<ContentManifest | null>;
|
|
92
|
+
/** Every valid hint this cache holds for one set, keyed by content hash. A
|
|
93
|
+
* missing or invalid hint is simply absent; its reader re-derives or fetches
|
|
94
|
+
* the manifest exactly as before. */
|
|
95
|
+
export declare function readManifestHints(cacheDir: string, artifacts: readonly TransferArtifact[]): Promise<ReadonlyMap<string, ContentManifest>>;
|
|
96
|
+
/** Derive a manifest again from the retained immutable bytes, never from the
|
|
97
|
+
* user's filesystem, in the layout the artifact commits to, and restore the
|
|
98
|
+
* hint. Only a content thread runs this; callers reach it through
|
|
99
|
+
* content-capture-pool's `contentManifest`. */
|
|
100
|
+
export declare function deriveCachedManifest(cacheDir: string, artifact: TransferArtifact): Promise<ContentManifest>;
|
|
101
|
+
/** Seal bytes once in the machine content cache: verify them against the
|
|
102
|
+
* artifact, derive the manifest, stage the bytes for publication under the
|
|
103
|
+
* one law and leave the manifest as a hint. Only a content thread runs this;
|
|
104
|
+
* the main thread reaches it through content-capture-pool's `sealContent`,
|
|
105
|
+
* which publishes what it staged. */
|
|
106
|
+
export declare function sealCapturedArtifact(cacheDir: string, artifact: TransferArtifact, bytes: Uint8Array): Promise<CacheStage>;
|
|
107
|
+
/** Every cargo name appears only over durable bytes. Before Record promises
|
|
108
|
+
* cached content, its names' directory entries must be durable too; the
|
|
109
|
+
* namespace flushes the cache directory only when some required name is not
|
|
110
|
+
* yet known durable. The flush runs off the event loop, before admission. */
|
|
111
|
+
export declare function makeRecordContentDurable(cacheDir: string, artifacts: readonly TransferArtifact[]): Promise<void>;
|
|
51
112
|
/**
|
|
52
113
|
* Capture an ordinary file in bounded blocks. The same bytes feed whole-file
|
|
53
114
|
* identity, block identity, text/binary evidence, and the optional immutable
|
|
54
115
|
* cache sink. No caller may need a complete-file Buffer.
|
|
55
116
|
*/
|
|
56
117
|
export declare function captureContentBlocks(source: ContentBlockSource, sink: ContentBlockSink | null): Promise<CapturedFileContent>;
|
|
57
|
-
|
|
118
|
+
/** One capture is pinned to one unchanged regular file. The expected stat is
|
|
119
|
+
* plain data, so a capture thread receives exactly what its caller observed. */
|
|
120
|
+
export declare const sameCaptureSource: (left: SourceStat, right: SourceStat) => boolean;
|
|
58
121
|
/**
|
|
59
|
-
* Stream one stable filesystem file
|
|
60
|
-
*
|
|
61
|
-
*
|
|
122
|
+
* Stream one stable filesystem file, optionally staging it for the immutable
|
|
123
|
+
* cache during that read; the main thread publishes what it staged. Only a
|
|
124
|
+
* capture thread runs this; every caller goes through content-capture-pool
|
|
125
|
+
* so no read or hash occupies the main thread. An
|
|
62
126
|
* optional collect sink receives the same blocks during the one read, valid
|
|
63
127
|
* only when capture succeeds — a churned capture throws and its blocks are
|
|
64
|
-
* discarded with it.
|
|
128
|
+
* discarded with it. Observation can omit the sink; a later selected content
|
|
129
|
+
* promise must seal and prove its bytes before Record.
|
|
65
130
|
*/
|
|
66
|
-
export declare function captureContentFile(sourceFile: string, expected:
|
|
131
|
+
export declare function captureContentFile(sourceFile: string, expected: SourceStat, cacheDir: string | null, collect?: ContentBlockSink | null): Promise<CacheCapture>;
|
|
67
132
|
/** Collect a capture's blocks into one contiguous Buffer, so a fused caller
|
|
68
|
-
* owns the exact bytes the capture read without reading the file again.
|
|
133
|
+
* owns the exact bytes the capture read without reading the file again. The
|
|
134
|
+
* Buffer owns its whole ArrayBuffer, so a capture thread can transfer it. */
|
|
69
135
|
export declare function contentBlockCollector(bytes: number): ContentBlockSink & {
|
|
70
136
|
readonly collected: Buffer;
|
|
71
137
|
};
|
|
@@ -83,7 +149,7 @@ export interface CaptureStreamTransport {
|
|
|
83
149
|
* the authority, never a sealed identity, and surfaces as the walk's
|
|
84
150
|
* ordinary CaptureSourceChangedError.
|
|
85
151
|
*/
|
|
86
|
-
export declare function captureContentFileStream(sourceFile: string, expected:
|
|
152
|
+
export declare function captureContentFileStream(sourceFile: string, expected: SourceStat, transport: CaptureStreamTransport): Promise<CapturedFileContent>;
|
|
87
153
|
/** One artifact download. Calls may write different block indexes in
|
|
88
154
|
* parallel; sealing is legal only after the portable download operation has
|
|
89
155
|
* awaited them all. Targets retain metadata, never OS handles or chunk bytes. */
|