@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,70 @@
|
|
|
1
|
+
/** A retained observation closes in two phases. The semantic phase re-asks a
|
|
2
|
+
* slower owner such as Git and may await. The physical phase compares the
|
|
3
|
+
* original native witnesses and never awaits. Neither renews its baseline;
|
|
4
|
+
* together they belong to one observation, and neither alone admits it.
|
|
5
|
+
* Admission awaits every semantic phase first, then closes every physical
|
|
6
|
+
* phase with its commit, so final closure checks the original observation
|
|
7
|
+
* against its retained dependencies after all intervening semantic work. A
|
|
8
|
+
* change no witness holds belongs to a later Watch generation.
|
|
9
|
+
*
|
|
10
|
+
* The physical phase is data where it can be: witnesses any thread samples
|
|
11
|
+
* and judges. What only the admitting thread can answer — host authority
|
|
12
|
+
* such as the content clock, or a check over live objects — is an admission
|
|
13
|
+
* that runs there, synchronously, after the witnesses are judged. */
|
|
14
|
+
import { judgeWitnesses } from "./source-witness.js";
|
|
15
|
+
const settled = Promise.resolve();
|
|
16
|
+
const none = Object.freeze([]);
|
|
17
|
+
export const witnessProof = (witnesses) => ({ semantic: () => settled, witnesses: Object.freeze([...witnesses]) });
|
|
18
|
+
export const admissionProof = (admission) => ({ semantic: () => settled, witnesses: none, admission });
|
|
19
|
+
export const semanticProof = (semantic) => ({ semantic, witnesses: none });
|
|
20
|
+
/** The admission half alone, for a caller whose witnesses were judged elsewhere.
|
|
21
|
+
* A void-typed boundary accepts a value-returning function; a Promise that
|
|
22
|
+
* slipped through must fail here rather than pass as a completed check. */
|
|
23
|
+
export function admitPhysically(proof) {
|
|
24
|
+
const result = proof.admission?.();
|
|
25
|
+
if (typeof result?.then === "function") {
|
|
26
|
+
throw new TypeError("a physical proof must complete synchronously");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function closePhysically(proof) {
|
|
30
|
+
judgeWitnesses(proof.witnesses);
|
|
31
|
+
admitPhysically(proof);
|
|
32
|
+
}
|
|
33
|
+
/** A composite is its flat leaves, so a fact several consumers retained
|
|
34
|
+
* closes once however deeply they nested it. */
|
|
35
|
+
const leavesOf = new WeakMap();
|
|
36
|
+
export const proofLeaves = (proof) => leavesOf.get(proof) ?? [proof];
|
|
37
|
+
/** Each original proof closes once, at its last requested position, so no
|
|
38
|
+
* duplicate can close before a later dependency's work. Identity is
|
|
39
|
+
* ownership: equal paths or answers never merge proofs. Semantic phases run
|
|
40
|
+
* one at a time, so several repositories never multiply concurrent Git
|
|
41
|
+
* processes. */
|
|
42
|
+
export function sourceProofs(proofs) {
|
|
43
|
+
const flat = proofs.flatMap(proofLeaves);
|
|
44
|
+
const seen = new Set();
|
|
45
|
+
const unique = [];
|
|
46
|
+
for (let index = flat.length - 1; index >= 0; index -= 1) {
|
|
47
|
+
const proof = flat[index];
|
|
48
|
+
if (!seen.has(proof)) {
|
|
49
|
+
seen.add(proof);
|
|
50
|
+
unique.push(proof);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
unique.reverse();
|
|
54
|
+
const admitted = unique.filter(proof => proof.admission);
|
|
55
|
+
const composite = {
|
|
56
|
+
semantic: async () => { for (const proof of unique)
|
|
57
|
+
await proof.semantic(); },
|
|
58
|
+
witnesses: Object.freeze(unique.flatMap(proof => proof.witnesses)),
|
|
59
|
+
...admitted.length > 0 ? { admission: () => { for (const proof of admitted)
|
|
60
|
+
admitPhysically(proof); } } : {},
|
|
61
|
+
};
|
|
62
|
+
leavesOf.set(composite, unique);
|
|
63
|
+
return composite;
|
|
64
|
+
}
|
|
65
|
+
/** A standalone close: the semantic answer, then the original witnesses. */
|
|
66
|
+
export async function closeSource(proof) {
|
|
67
|
+
await proof.semantic();
|
|
68
|
+
closePhysically(proof);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=source-proof.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-proof.js","sourceRoot":"","sources":["../src/source-proof.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;qEAYqE;AACrE,OAAO,EAAE,cAAc,EAAsB,MAAM,qBAAqB,CAAC;AAQzE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AAClC,MAAM,IAAI,GAA6B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAmC,EAAe,EAAE,CAC/E,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAqB,EAAe,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AAChI,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAA6B,EAAe,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAE7G;;2EAE2E;AAC3E,MAAM,UAAU,eAAe,CAAC,KAAkB;IAChD,MAAM,MAAM,GAAY,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC;IAC5C,IAAI,OAAQ,MAA2C,EAAE,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7E,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAkB;IAChD,cAAc,CA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AC,KAAK,CAAC,SAAS,CAAC,CAAC;QAClE,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,MAAM,KAAK,IAAI,QAAQ;gBAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KAC7G,CAAC;IACF,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAkB;IAClD,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;IACvB,eAAe,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** The one owner of Detect's source signature: what one stat said about a
|
|
2
|
+
* filesystem object, in exact decimal integers, and when an equal signature
|
|
3
|
+
* still proves that object's content. A number stat cannot state a 64-bit
|
|
4
|
+
* identity or a nanosecond time, so every caller stats with `bigint: true`
|
|
5
|
+
* and every stored-vs-fresh comparison is a comparison made here. */
|
|
6
|
+
import type { BigIntStats } from "node:fs";
|
|
7
|
+
import type { EntityType } from "@amalgm/live";
|
|
8
|
+
/** The stat fields a signature states. BigIntStats satisfies it, and a plain
|
|
9
|
+
* copy crosses a worker thread by structured clone. */
|
|
10
|
+
export type SourceStat = Pick<BigIntStats, "dev" | "ino" | "mode" | "nlink" | "size" | "mtimeNs" | "ctimeNs">;
|
|
11
|
+
/** One object's exact physical identity, `device:inode` in decimal. */
|
|
12
|
+
export declare const physicalKey: (stat: Pick<SourceStat, "dev" | "ino">) => string;
|
|
13
|
+
/** dev, ino, kind, size, mtimeNs, ctimeNs, mode and nlink, in that order. */
|
|
14
|
+
export declare const sourceSignature: (stat: SourceStat) => string;
|
|
15
|
+
/** The stat a signature states, for a judge that compares it elsewhere:
|
|
16
|
+
* `sourceSignature(signedStat(signature)) === signature`. */
|
|
17
|
+
export declare const signedStat: (signature: string) => SourceStat;
|
|
18
|
+
/** A stored signature still names this stat; an absent one never does. */
|
|
19
|
+
export declare const sourceUnchanged: (signature: string | null, stat: SourceStat) => boolean;
|
|
20
|
+
/** Two stats of one address name the same unchanged object. */
|
|
21
|
+
export declare const sameSource: (left: SourceStat, right: SourceStat) => boolean;
|
|
22
|
+
export interface SourceFingerprint {
|
|
23
|
+
physicalKey: string;
|
|
24
|
+
sourceSignature: string;
|
|
25
|
+
/** Beyond the signature, the mode is the object's kind and the file's
|
|
26
|
+
* executable posture; every bit fits a number exactly. */
|
|
27
|
+
filesystemMode: number;
|
|
28
|
+
}
|
|
29
|
+
/** How many names the signed object had when signed; unknown without one. */
|
|
30
|
+
export declare const signedLinks: (signature: string | null) => bigint | null;
|
|
31
|
+
/** A rename advances only its object's ctime. Every other signed fact is
|
|
32
|
+
* kept, so any difference beyond the rename still reads as changed. */
|
|
33
|
+
export declare const renamedSignature: (signature: string | null, stat: Pick<SourceStat, "ctimeNs">) => string | null;
|
|
34
|
+
/** The row facts one stat establishes. */
|
|
35
|
+
export declare const sourceFingerprint: (stat: SourceStat) => SourceFingerprint;
|
|
36
|
+
/** A time precedes a boundary when every instant it may stand for does. A
|
|
37
|
+
* time with no subsecond part may be a whole-second inode's truncation of any
|
|
38
|
+
* instant in its second, so the whole second must precede the boundary. The
|
|
39
|
+
* boundary already sits the profile's margin below its stamp (see
|
|
40
|
+
* content-clock.ts). Content proofs and listing closure share this one rule. */
|
|
41
|
+
export declare const timePrecedes: (time: bigint, boundary: bigint) => boolean;
|
|
42
|
+
/** How far a boundary must advance before time precedes it; zero once it does. */
|
|
43
|
+
export declare function precedenceWaitNs(time: bigint, boundary: bigint): bigint;
|
|
44
|
+
/** An equal signature proves a leaf's content only when both times it names
|
|
45
|
+
* precede the content-clock boundary of the read that verified that content.
|
|
46
|
+
* A writer can set mtime back; it cannot set ctime back, so a ctime inside
|
|
47
|
+
* the racy interval could repeat on a later same-tick write whose mtime was
|
|
48
|
+
* restored, and the leaf stays racy until read again. */
|
|
49
|
+
export declare function contentProven(signature: string, boundary: string | null): boolean;
|
|
50
|
+
/** A container's truth is its membership, walked anyway, so an equal
|
|
51
|
+
* signature reuses it. A leaf's content must also be proven, or be reread. */
|
|
52
|
+
export declare function sourceReusable(row: {
|
|
53
|
+
readonly type: EntityType;
|
|
54
|
+
readonly sourceSignature: string | null;
|
|
55
|
+
readonly contentVerifiedNs: string | null;
|
|
56
|
+
}, stat: SourceStat): boolean;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const KIND_BITS = 61440n;
|
|
2
|
+
/** One object's exact physical identity, `device:inode` in decimal. */
|
|
3
|
+
export const physicalKey = (stat) => `${stat.dev}:${stat.ino}`;
|
|
4
|
+
/** dev, ino, kind, size, mtimeNs, ctimeNs, mode and nlink, in that order. */
|
|
5
|
+
export const sourceSignature = (stat) => `${stat.dev}:${stat.ino}:${stat.mode & KIND_BITS}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}:${stat.mode}:${stat.nlink}`;
|
|
6
|
+
/** The stat a signature states, for a judge that compares it elsewhere:
|
|
7
|
+
* `sourceSignature(signedStat(signature)) === signature`. */
|
|
8
|
+
export const signedStat = (signature) => {
|
|
9
|
+
const [dev, ino, , size, mtimeNs, ctimeNs, mode, nlink] = signature.split(":").map(BigInt);
|
|
10
|
+
return { dev: dev, ino: ino, size: size, mtimeNs: mtimeNs, ctimeNs: ctimeNs, mode: mode, nlink: nlink };
|
|
11
|
+
};
|
|
12
|
+
/** A stored signature still names this stat; an absent one never does. */
|
|
13
|
+
export const sourceUnchanged = (signature, stat) => signature !== null && signature === sourceSignature(stat);
|
|
14
|
+
/** Two stats of one address name the same unchanged object. */
|
|
15
|
+
export const sameSource = (left, right) => sourceSignature(left) === sourceSignature(right);
|
|
16
|
+
/** How many names the signed object had when signed; unknown without one. */
|
|
17
|
+
export const signedLinks = (signature) => signature === null ? null : BigInt(signature.slice(signature.lastIndexOf(":") + 1));
|
|
18
|
+
/** A rename advances only its object's ctime. Every other signed fact is
|
|
19
|
+
* kept, so any difference beyond the rename still reads as changed. */
|
|
20
|
+
export const renamedSignature = (signature, stat) => signature === null ? null : signature.split(":").map((field, index) => index === 5 ? `${stat.ctimeNs}` : field).join(":");
|
|
21
|
+
/** The row facts one stat establishes. */
|
|
22
|
+
export const sourceFingerprint = (stat) => ({
|
|
23
|
+
physicalKey: physicalKey(stat), sourceSignature: sourceSignature(stat), filesystemMode: Number(stat.mode),
|
|
24
|
+
});
|
|
25
|
+
const SECOND_NS = 1000000000n;
|
|
26
|
+
/** A time precedes a boundary when every instant it may stand for does. A
|
|
27
|
+
* time with no subsecond part may be a whole-second inode's truncation of any
|
|
28
|
+
* instant in its second, so the whole second must precede the boundary. The
|
|
29
|
+
* boundary already sits the profile's margin below its stamp (see
|
|
30
|
+
* content-clock.ts). Content proofs and listing closure share this one rule. */
|
|
31
|
+
export const timePrecedes = (time, boundary) => time % SECOND_NS === 0n ? time + SECOND_NS <= boundary : time < boundary;
|
|
32
|
+
/** How far a boundary must advance before time precedes it; zero once it does. */
|
|
33
|
+
export function precedenceWaitNs(time, boundary) {
|
|
34
|
+
const wait = (time % SECOND_NS === 0n ? time + SECOND_NS : time + 1n) - boundary;
|
|
35
|
+
return wait > 0n ? wait : 0n;
|
|
36
|
+
}
|
|
37
|
+
/** An equal signature proves a leaf's content only when both times it names
|
|
38
|
+
* precede the content-clock boundary of the read that verified that content.
|
|
39
|
+
* A writer can set mtime back; it cannot set ctime back, so a ctime inside
|
|
40
|
+
* the racy interval could repeat on a later same-tick write whose mtime was
|
|
41
|
+
* restored, and the leaf stays racy until read again. */
|
|
42
|
+
export function contentProven(signature, boundary) {
|
|
43
|
+
if (boundary === null)
|
|
44
|
+
return false;
|
|
45
|
+
const fields = signature.split(":"), before = BigInt(boundary);
|
|
46
|
+
return timePrecedes(BigInt(fields[4]), before) && timePrecedes(BigInt(fields[5]), before);
|
|
47
|
+
}
|
|
48
|
+
/** A container's truth is its membership, walked anyway, so an equal
|
|
49
|
+
* signature reuses it. A leaf's content must also be proven, or be reread. */
|
|
50
|
+
export function sourceReusable(row, stat) {
|
|
51
|
+
if (!sourceUnchanged(row.sourceSignature, stat))
|
|
52
|
+
return false;
|
|
53
|
+
return row.type === "workspace" || row.type === "folder" || row.type === "repo.git"
|
|
54
|
+
|| contentProven(row.sourceSignature, row.contentVerifiedNs);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=source-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-signature.js","sourceRoot":"","sources":["../src/source-signature.ts"],"names":[],"mappings":"AAYA,MAAM,SAAS,GAAG,MAAS,CAAC;AAE5B,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAqC,EAAU,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AAExG,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAgB,EAAU,EAAE,CAC1D,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AAE7H;6DAC6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAc,EAAE;IAC1D,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,AAAD,EAAG,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3F,OAAO,EAAE,GAAG,EAAE,GAAI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eAAe,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU;WAC9E,aAAa,CAAC,GAAG,CAAC,eAAgB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What a native read saw, as plain data. Any thread samples a witness again
|
|
2
|
+
* and judges it; a judgment throws the capture's own change or churn error,
|
|
3
|
+
* which crosses threads with its code. Judges re-read and compare only, so
|
|
4
|
+
* this module never reaches a proof, a pool or the admitting thread. */
|
|
5
|
+
import { type GitRouteWitness } from "./git-binding.js";
|
|
6
|
+
import { type GitConfigurationWitness } from "./git-configuration.js";
|
|
7
|
+
import { type GitIndexWitness } from "./git-index-witness.js";
|
|
8
|
+
import { type GitMarkerWitness } from "./git-literal-read.js";
|
|
9
|
+
import { type NativeFileWitness } from "./git-native-file.js";
|
|
10
|
+
import { type GitOperationWitness } from "./git-operation-host.js";
|
|
11
|
+
import { type NamespaceWitness, type PathsWitness } from "./physical-path-witness.js";
|
|
12
|
+
export type SourceWitness = PathsWitness | NamespaceWitness | NativeFileWitness | GitRouteWitness | GitConfigurationWitness | GitIndexWitness | GitOperationWitness | GitMarkerWitness;
|
|
13
|
+
export declare function judgeWitness(witness: SourceWitness): void;
|
|
14
|
+
/** In order: a witness sampled later may depend on an earlier one's ground. */
|
|
15
|
+
export declare function judgeWitnesses(witnesses: readonly SourceWitness[]): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** What a native read saw, as plain data. Any thread samples a witness again
|
|
2
|
+
* and judges it; a judgment throws the capture's own change or churn error,
|
|
3
|
+
* which crosses threads with its code. Judges re-read and compare only, so
|
|
4
|
+
* this module never reaches a proof, a pool or the admitting thread. */
|
|
5
|
+
import { judgeGitRoute } from "./git-binding.js";
|
|
6
|
+
import { judgeGitConfiguration } from "./git-configuration.js";
|
|
7
|
+
import { judgeGitIndex } from "./git-index-witness.js";
|
|
8
|
+
import { judgeGitMarker } from "./git-literal-read.js";
|
|
9
|
+
import { judgeNativeFile } from "./git-native-file.js";
|
|
10
|
+
import { judgeGitOperation } from "./git-operation-host.js";
|
|
11
|
+
import { judgeNamespace, judgePaths } from "./physical-path-witness.js";
|
|
12
|
+
export function judgeWitness(witness) {
|
|
13
|
+
switch (witness.kind) {
|
|
14
|
+
case "paths": return judgePaths(witness);
|
|
15
|
+
case "namespace": return judgeNamespace(witness);
|
|
16
|
+
case "native-file": return judgeNativeFile(witness);
|
|
17
|
+
case "git-route": return judgeGitRoute(witness);
|
|
18
|
+
case "git-configuration": return judgeGitConfiguration(witness);
|
|
19
|
+
case "git-index": return judgeGitIndex(witness);
|
|
20
|
+
case "git-operation": return judgeGitOperation(witness);
|
|
21
|
+
case "git-marker": return judgeGitMarker(witness);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** In order: a witness sampled later may depend on an earlier one's ground. */
|
|
25
|
+
export function judgeWitnesses(witnesses) {
|
|
26
|
+
for (const witness of witnesses)
|
|
27
|
+
judgeWitness(witness);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=source-witness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-witness.js","sourceRoot":"","sources":["../src/source-witness.ts"],"names":[],"mappings":"AAAA;;;wEAGwE;AACxE,OAAO,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAgC,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAA0B,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAA4B,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,UAAU,EAA4C,MAAM,4BAA4B,CAAC;AAMlH,MAAM,UAAU,YAAY,CAAC,OAAsB;IACjD,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,OAAO,CAAC,CAAC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;QACzC,KAAK,WAAW,CAAC,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;QACjD,KAAK,aAAa,CAAC,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;QACpD,KAAK,WAAW,CAAC,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;QAChD,KAAK,mBAAmB,CAAC,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAChE,KAAK,WAAW,CAAC,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;QAChD,KAAK,eAAe,CAAC,CAAC,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACxD,KAAK,YAAY,CAAC,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,cAAc,CAAC,SAAmC;IAChE,KAAK,MAAM,OAAO,IAAI,SAAS;QAAE,YAAY,CAAC,OAAO,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one durability policy for persistent SQLite files, whichever driver
|
|
3
|
+
* opens them. Each synchronization a connection performs requests F_FULLFSYNC
|
|
4
|
+
* where the platform has it: an ordinary macOS fsync may leave committed pages
|
|
5
|
+
* in the drive's cache, so it would not make a commit durable. The policy owns
|
|
6
|
+
* only that flush strength; each store keeps its own journal mode and
|
|
7
|
+
* synchronous level, which must still make its commits durable.
|
|
8
|
+
*
|
|
9
|
+
* Both better-sqlite3 and node:sqlite connections satisfy the small SQL
|
|
10
|
+
* surface below, so neither driver is forced through the other's opener.
|
|
11
|
+
*/
|
|
12
|
+
export interface SqlConnection {
|
|
13
|
+
exec(sql: string): unknown;
|
|
14
|
+
prepare(sql: string): {
|
|
15
|
+
get(): unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function applyDurability(connection: SqlConnection): void;
|
|
19
|
+
/** The settings a durable commit actually ran under, read back from the
|
|
20
|
+
* connection rather than assumed, for run metadata. */
|
|
21
|
+
export interface DurabilityProfile {
|
|
22
|
+
readonly journalMode: string;
|
|
23
|
+
readonly synchronous: number;
|
|
24
|
+
readonly fullfsync: number;
|
|
25
|
+
readonly walAutocheckpoint: number;
|
|
26
|
+
readonly sqlite: string;
|
|
27
|
+
readonly node: string;
|
|
28
|
+
readonly libuv: string;
|
|
29
|
+
readonly platform: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function durabilityProfile(connection: SqlConnection): DurabilityProfile;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one durability policy for persistent SQLite files, whichever driver
|
|
3
|
+
* opens them. Each synchronization a connection performs requests F_FULLFSYNC
|
|
4
|
+
* where the platform has it: an ordinary macOS fsync may leave committed pages
|
|
5
|
+
* in the drive's cache, so it would not make a commit durable. The policy owns
|
|
6
|
+
* only that flush strength; each store keeps its own journal mode and
|
|
7
|
+
* synchronous level, which must still make its commits durable.
|
|
8
|
+
*
|
|
9
|
+
* Both better-sqlite3 and node:sqlite connections satisfy the small SQL
|
|
10
|
+
* surface below, so neither driver is forced through the other's opener.
|
|
11
|
+
*/
|
|
12
|
+
export function applyDurability(connection) {
|
|
13
|
+
connection.exec("PRAGMA fullfsync = ON");
|
|
14
|
+
}
|
|
15
|
+
export function durabilityProfile(connection) {
|
|
16
|
+
const read = (sql) => Object.values(connection.prepare(sql).get())[0];
|
|
17
|
+
return {
|
|
18
|
+
journalMode: String(read("PRAGMA journal_mode")),
|
|
19
|
+
synchronous: Number(read("PRAGMA synchronous")),
|
|
20
|
+
fullfsync: Number(read("PRAGMA fullfsync")),
|
|
21
|
+
walAutocheckpoint: Number(read("PRAGMA wal_autocheckpoint")),
|
|
22
|
+
sqlite: String(read("SELECT sqlite_version()")),
|
|
23
|
+
node: process.versions.node,
|
|
24
|
+
libuv: process.versions.uv,
|
|
25
|
+
platform: process.platform,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=sqlite-durability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-durability.js","sourceRoot":"","sources":["../src/sqlite-durability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,MAAM,UAAU,eAAe,CAAC,UAAyB;IACvD,UAAU,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAC3C,CAAC;AAeD,MAAM,UAAU,iBAAiB,CAAC,UAAyB;IACzD,MAAM,IAAI,GAAG,CAAC,GAAW,EAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAChD,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC/C,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC3C,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC5D,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC/C,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;QAC3B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC"}
|
package/dist/sqlite.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import Database from 'better-sqlite3';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
2
|
+
/** A database file's one name: the one its connection reports as
|
|
3
|
+
* `database.name`, so every registry keyed by a file agrees with every
|
|
4
|
+
* connection to it. The Windows namespace prefix bypasses legacy Win32
|
|
5
|
+
* MAX_PATH interpretation; elsewhere it is the resolved path. Idempotent. */
|
|
6
|
+
export declare const databaseFileName: (file: string) => string;
|
|
7
|
+
/** Every persistent better-sqlite3 handle names the same OS file as Node's
|
|
8
|
+
* filesystem and runs under the shared durability policy. */
|
|
4
9
|
export declare function openFileDatabase(file: string, options?: Database.Options): Database.Database;
|
|
10
|
+
export declare function cachedStatement(database: Database.Database, sql: string, safeIntegers?: boolean): Database.Statement;
|
package/dist/sqlite.js
CHANGED
|
@@ -1,16 +1,39 @@
|
|
|
1
1
|
import Database from 'better-sqlite3';
|
|
2
2
|
import { resolve, toNamespacedPath } from 'node:path';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { applyDurability } from './sqlite-durability.js';
|
|
4
|
+
/** A database file's one name: the one its connection reports as
|
|
5
|
+
* `database.name`, so every registry keyed by a file agrees with every
|
|
6
|
+
* connection to it. The Windows namespace prefix bypasses legacy Win32
|
|
7
|
+
* MAX_PATH interpretation; elsewhere it is the resolved path. Idempotent. */
|
|
8
|
+
export const databaseFileName = (file) => toNamespacedPath(resolve(file));
|
|
9
|
+
/** Every persistent better-sqlite3 handle names the same OS file as Node's
|
|
10
|
+
* filesystem and runs under the shared durability policy. */
|
|
5
11
|
export function openFileDatabase(file, options) {
|
|
6
|
-
const filename =
|
|
12
|
+
const filename = databaseFileName(file);
|
|
13
|
+
let database;
|
|
7
14
|
try {
|
|
8
|
-
|
|
15
|
+
database = new Database(filename, options);
|
|
9
16
|
}
|
|
10
17
|
catch (error) {
|
|
11
18
|
if (error instanceof Error)
|
|
12
19
|
error.message = `SQLite ${JSON.stringify(file)}: ${error.message}`;
|
|
13
20
|
throw error;
|
|
14
21
|
}
|
|
22
|
+
applyDurability(database);
|
|
23
|
+
return database;
|
|
24
|
+
}
|
|
25
|
+
/** One compiled statement per connection, SQL text and integer mode. It lives
|
|
26
|
+
* exactly as long as the handle that compiled it and is never shared with
|
|
27
|
+
* another. */
|
|
28
|
+
const compiled = new WeakMap();
|
|
29
|
+
export function cachedStatement(database, sql, safeIntegers = false) {
|
|
30
|
+
let statements = compiled.get(database);
|
|
31
|
+
if (!statements)
|
|
32
|
+
compiled.set(database, statements = new Map());
|
|
33
|
+
const key = `${safeIntegers ? "safe" : "number"}:${sql}`;
|
|
34
|
+
let value = statements.get(key);
|
|
35
|
+
if (!value)
|
|
36
|
+
statements.set(key, value = database.prepare(sql).safeIntegers(safeIntegers));
|
|
37
|
+
return value;
|
|
15
38
|
}
|
|
16
39
|
//# sourceMappingURL=sqlite.js.map
|
package/dist/sqlite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../src/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../src/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;6EAG6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1F;6DAC6D;AAC7D,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAA0B;IACvE,MAAM,QAAQ,G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|
+
* Cone overlap is a string comparison, so two spellings of one physical
|
|
5
|
+
* route (`/var/...` and `/private/var/...`) must never reach it. Bound roots
|
|
6
|
+
* are resolved here once and ordinary children are derived from them; a
|
|
7
|
+
* dependency reached some other way is resolved here too. Readers and
|
|
8
|
+
* writers keep their lexical paths: Git interprets includes against the path
|
|
9
|
+
* it was given, and an effect replacing a link replaces the link itself.
|
|
10
|
+
*
|
|
11
|
+
* Resolution names routes, not files: hard links stay distinct and case is
|
|
12
|
+
* not folded. Bind mounts and firmlinks are outside the supported profile.
|
|
13
|
+
*/
|
|
14
|
+
/** The existing ancestor's resolved route plus the part not yet created, so
|
|
15
|
+
* a missing destination keeps its dependency instead of vanishing. */
|
|
16
|
+
export declare function physicalPath(requestedPath: string): string;
|
|
17
|
+
/** A read through `path` depends on the slot of every symbolic link along
|
|
18
|
+
* its route, on its own slot, and on whatever that entry resolves to. */
|
|
19
|
+
export declare function readThroughAddresses(path: string): string[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synchronization addresses: the one spelling ground coordination compares.
|
|
3
|
+
*
|
|
4
|
+
* Cone overlap is a string comparison, so two spellings of one physical
|
|
5
|
+
* route (`/var/...` and `/private/var/...`) must never reach it. Bound roots
|
|
6
|
+
* are resolved here once and ordinary children are derived from them; a
|
|
7
|
+
* dependency reached some other way is resolved here too. Readers and
|
|
8
|
+
* writers keep their lexical paths: Git interprets includes against the path
|
|
9
|
+
* it was given, and an effect replacing a link replaces the link itself.
|
|
10
|
+
*
|
|
11
|
+
* Resolution names routes, not files: hard links stay distinct and case is
|
|
12
|
+
* not folded. Bind mounts and firmlinks are outside the supported profile.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, lstatSync, realpathSync } from "node:fs";
|
|
15
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
16
|
+
/** The existing ancestor's resolved route plus the part not yet created, so
|
|
17
|
+
* a missing destination keeps its dependency instead of vanishing. */
|
|
18
|
+
export function physicalPath(requestedPath) {
|
|
19
|
+
let ancestor = resolve(requestedPath);
|
|
20
|
+
const absent = [];
|
|
21
|
+
while (!existsSync(ancestor)) {
|
|
22
|
+
const parent = dirname(ancestor);
|
|
23
|
+
if (parent === ancestor)
|
|
24
|
+
throw new Error(`Cannot resolve physical root ${requestedPath}`);
|
|
25
|
+
absent.unshift(basename(ancestor));
|
|
26
|
+
ancestor = parent;
|
|
27
|
+
}
|
|
28
|
+
return join(realpathSync.native(ancestor), ...absent);
|
|
29
|
+
}
|
|
30
|
+
/** The slot of one route component: its resolved parent route plus the
|
|
31
|
+
* unfollowed entry name. Replacing that entry redirects every read below it. */
|
|
32
|
+
const slotAddress = (path) => join(physicalPath(dirname(path)), basename(path));
|
|
33
|
+
/** A read through `path` depends on the slot of every symbolic link along
|
|
34
|
+
* its route, on its own slot, and on whatever that entry resolves to. */
|
|
35
|
+
export function readThroughAddresses(path) {
|
|
36
|
+
const route = resolve(path);
|
|
37
|
+
const addresses = [];
|
|
38
|
+
for (let prefix = dirname(route); prefix !== dirname(prefix); prefix = dirname(prefix)) {
|
|
39
|
+
let link = false;
|
|
40
|
+
try {
|
|
41
|
+
link = lstatSync(prefix).isSymbolicLink();
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error.code !== "ENOENT")
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
if (link)
|
|
48
|
+
addresses.push(slotAddress(prefix));
|
|
49
|
+
}
|
|
50
|
+
return [...new Set([...addresses, slotAddress(route), physicalPath(route)])];
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=sync-address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-address.js","sourceRoot":"","sources":["../src/sync-address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAA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,EAAE,CAAC;YAChE,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;gBAAE,MAAM,KAAK,CAAC;QACtE,CAAC;QACD,IAAI,IAAI;YAAE,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC"}
|
package/dist/sync-setting.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
import type { ApplyBlocker, ApplyWait } from '@amalgm/live';
|
|
1
2
|
export type SyncMode = 'paused' | 'enabled';
|
|
2
3
|
export interface SyncStatus {
|
|
3
4
|
readonly configured: SyncMode;
|
|
4
5
|
readonly state: 'paused' | 'pausing' | 'starting' | 'enabled' | 'failed' | 'stopped' | 'unavailable';
|
|
5
6
|
readonly error?: string;
|
|
7
|
+
/** Present only while a Files lifetime runs; absent means nothing was examined. */
|
|
8
|
+
readonly blocked?: readonly SyncBlocked[];
|
|
6
9
|
}
|
|
10
|
+
/** An accepted incoming result held back because applying it would destroy local ground. */
|
|
11
|
+
export interface SyncBlocked {
|
|
12
|
+
readonly entityId: string;
|
|
13
|
+
readonly throughSequence: number;
|
|
14
|
+
readonly code: ApplyBlocker['code'];
|
|
15
|
+
readonly effect: ApplyBlocker['effect'];
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
readonly waitingOn: readonly string[];
|
|
18
|
+
readonly waitingOnCount: number;
|
|
19
|
+
}
|
|
20
|
+
/** Current blockers come from the running Apply rail, never from old stage logs. */
|
|
21
|
+
export declare function syncBlocked(waits: readonly ApplyWait[]): SyncBlocked[];
|
|
7
22
|
/** Machine state, outside package generations and portable Files ground. */
|
|
8
23
|
export declare function readSyncMode(file: string): SyncMode;
|
|
9
24
|
export declare function writeSyncMode(file: string, mode: SyncMode): void;
|
package/dist/sync-setting.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { closeSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { dirname } from 'node:path';
|
|
4
|
+
const BLOCKED_NAMES = 20;
|
|
5
|
+
/** Current blockers come from the running Apply rail, never from old stage logs. */
|
|
6
|
+
export function syncBlocked(waits) {
|
|
7
|
+
return waits.flatMap(wait => wait.blocker ? [{
|
|
8
|
+
entityId: wait.entityId,
|
|
9
|
+
throughSequence: wait.throughSequence,
|
|
10
|
+
code: wait.blocker.code,
|
|
11
|
+
effect: wait.blocker.effect,
|
|
12
|
+
reason: wait.reason,
|
|
13
|
+
waitingOn: wait.prerequisite.entityIds.slice(0, BLOCKED_NAMES),
|
|
14
|
+
waitingOnCount: wait.prerequisite.entityIds.length,
|
|
15
|
+
}] : []);
|
|
16
|
+
}
|
|
4
17
|
/** Machine state, outside package generations and portable Files ground. */
|
|
5
18
|
export function readSyncMode(file) {
|
|
6
19
|
let text;
|
package/dist/sync-setting.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-setting.js","sourceRoot":"","sources":["../src/sync-setting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-setting.js","sourceRoot":"","sources":["../src/sync-setting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SA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AAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mEAAmE,CAAC,EAAE;QACnG,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG;KACjC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/turns.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One main-thread dispatcher for the rails' ready continuations: Detect,
|
|
3
|
+
* Send, Receive, Apply and cache maintenance. Each activation runs the oldest
|
|
4
|
+
* queued chunk, then returns to the event loop before the next, so ready work
|
|
5
|
+
* from several rails never runs back to back in one check phase. Asynchronous
|
|
6
|
+
* work never occupies it: a chunk that needs I/O starts that I/O and ends, and
|
|
7
|
+
* the completion queues the next chunk.
|
|
8
|
+
*
|
|
9
|
+
* It orders only these continuations. I/O callbacks, native completions,
|
|
10
|
+
* promise continuations, garbage collection and unrelated callbacks still run
|
|
11
|
+
* around it, and a chunk is only as short as the work its owner put in it.
|
|
12
|
+
*/
|
|
13
|
+
import { type Steps } from "@amalgm/live";
|
|
14
|
+
/** Run `chunk` in a later dispatcher activation; never inline. */
|
|
15
|
+
export declare function queueTurn(chunk: () => void): void;
|
|
16
|
+
/** Resume the caller in its own activation: pending I/O, timers and wire
|
|
17
|
+
* frames run first. */
|
|
18
|
+
export declare function awaitTurn(): Promise<void>;
|
|
19
|
+
/** An already-valid boundary in a long preparation: continue while this
|
|
20
|
+
* activation is within its budget, else resume in a later one. Work resumed
|
|
21
|
+
* outside the dispatcher counts from the last activation, so it joins the
|
|
22
|
+
* dispatcher at its first boundary. */
|
|
23
|
+
export declare function turnBoundary(): Promise<void>;
|
|
24
|
+
/** Visit every item of a long synchronous pass in order, taking a later
|
|
25
|
+
* activation once this one has spent its budget. */
|
|
26
|
+
export declare function eachInTurns<T>(items: Iterable<T>, visit: (item: T) => void): Promise<void>;
|
|
27
|
+
/** Every item's image, in order, as eachInTurns visits them. */
|
|
28
|
+
export declare function mapInTurns<T, R>(items: Iterable<T>, image: (item: T) => R): Promise<R[]>;
|
|
29
|
+
/** Start each item's effect in order, taking a later activation once this
|
|
30
|
+
* one has spent its budget, and answer every result in order once every
|
|
31
|
+
* started effect has settled; the first failure in order fails the whole.
|
|
32
|
+
* An effect's synchronous preparation counts against the activation that
|
|
33
|
+
* starts it, so no number of items starts in one. */
|
|
34
|
+
export declare function settleInTurns<T, R>(items: Iterable<T>, start: (item: T) => Promise<R>): Promise<R[]>;
|
|
35
|
+
/** The parts joined in order into one buffer, one part copied per step. */
|
|
36
|
+
export declare function concatInTurns(parts: readonly Uint8Array[]): Promise<Buffer>;
|
|
37
|
+
/** Live's steps on the main thread, taking a later activation at a boundary
|
|
38
|
+
* once this one has spent its budget. */
|
|
39
|
+
export declare function finishStepsInTurns<R>(steps: Steps<R>): Promise<R>;
|
|
40
|
+
/** A host effect a rail awaits. Its answer or failure reaches the rail in a
|
|
41
|
+
* dispatcher activation, never inline in the callback that completed the I/O. */
|
|
42
|
+
export declare function resumeInTurn<A extends unknown[], R>(effect: (...args: A) => Promise<R>): (...args: A) => Promise<R>;
|