@claudexor/daemon 3.25.1 → 4.0.1
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/dist/account-resets.d.ts +2 -2
- package/dist/account-resets.d.ts.map +1 -1
- package/dist/account-resets.js +15 -0
- package/dist/account-resets.js.map +1 -1
- package/dist/client.d.ts +25 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +55 -51
- package/dist/client.js.map +1 -1
- package/dist/command-authority.d.ts +11 -8
- package/dist/command-authority.d.ts.map +1 -1
- package/dist/command-authority.js +5 -6
- package/dist/command-authority.js.map +1 -1
- package/dist/command-list-projection.d.ts +0 -1
- package/dist/command-list-projection.d.ts.map +1 -1
- package/dist/command-list-projection.js +0 -6
- package/dist/command-list-projection.js.map +1 -1
- package/dist/command-list-select.d.ts +0 -4
- package/dist/command-list-select.d.ts.map +1 -1
- package/dist/command-list-select.js +1 -115
- package/dist/command-list-select.js.map +1 -1
- package/dist/command-retention.d.ts +7 -19
- package/dist/command-retention.d.ts.map +1 -1
- package/dist/command-retention.js +1 -120
- package/dist/command-retention.js.map +1 -1
- package/dist/command-rpc.d.ts +4 -1
- package/dist/command-rpc.d.ts.map +1 -1
- package/dist/command-rpc.js +12 -1
- package/dist/command-rpc.js.map +1 -1
- package/dist/command-store.d.ts +15 -52
- package/dist/command-store.d.ts.map +1 -1
- package/dist/command-store.js +5 -493
- package/dist/command-store.js.map +1 -1
- package/dist/daemon-health.d.ts +56 -8
- package/dist/daemon-health.d.ts.map +1 -1
- package/dist/daemon-health.js +44 -9
- package/dist/daemon-health.js.map +1 -1
- package/dist/daemon-local-client.d.ts +28 -0
- package/dist/daemon-local-client.d.ts.map +1 -0
- package/dist/daemon-local-client.js +55 -0
- package/dist/daemon-local-client.js.map +1 -0
- package/dist/delivery-command.d.ts +4 -4
- package/dist/delivery-command.d.ts.map +1 -1
- package/dist/delivery-command.js.map +1 -1
- package/dist/index.d.ts +23 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/dist/interactions.d.ts +12 -28
- package/dist/interactions.d.ts.map +1 -1
- package/dist/interactions.js +22 -123
- package/dist/interactions.js.map +1 -1
- package/dist/job-admission.d.ts +26 -0
- package/dist/job-admission.d.ts.map +1 -0
- package/dist/job-admission.js +67 -0
- package/dist/job-admission.js.map +1 -0
- package/dist/journal-fold-policy.d.ts +1 -1
- package/dist/journal-fold-policy.d.ts.map +1 -1
- package/dist/journal-recovery-files.d.ts +1 -41
- package/dist/journal-recovery-files.d.ts.map +1 -1
- package/dist/journal-recovery-files.js +2 -340
- package/dist/journal-recovery-files.js.map +1 -1
- package/dist/loop-facts.d.ts +28 -0
- package/dist/loop-facts.d.ts.map +1 -0
- package/dist/loop-facts.js +97 -0
- package/dist/loop-facts.js.map +1 -0
- package/dist/memory-facts.d.ts +2 -0
- package/dist/memory-facts.d.ts.map +1 -1
- package/dist/memory-facts.js +5 -0
- package/dist/memory-facts.js.map +1 -1
- package/dist/model-operations.d.ts +11 -4
- package/dist/model-operations.d.ts.map +1 -1
- package/dist/model-operations.js +68 -38
- package/dist/model-operations.js.map +1 -1
- package/dist/operator-decisions.d.ts +15 -25
- package/dist/operator-decisions.d.ts.map +1 -1
- package/dist/operator-decisions.js +5 -84
- package/dist/operator-decisions.js.map +1 -1
- package/dist/projects.d.ts +42 -41
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js +46 -184
- package/dist/projects.js.map +1 -1
- package/dist/quota-registry-replay.d.ts +2 -2
- package/dist/quota-registry-replay.d.ts.map +1 -1
- package/dist/quota-registry-replay.js.map +1 -1
- package/dist/quota-registry-support.d.ts +4 -1
- package/dist/quota-registry-support.d.ts.map +1 -1
- package/dist/quota-registry-support.js +15 -2
- package/dist/quota-registry-support.js.map +1 -1
- package/dist/quota-registry.d.ts +64 -2
- package/dist/quota-registry.d.ts.map +1 -1
- package/dist/quota-registry.js +10 -3
- package/dist/quota-registry.js.map +1 -1
- package/dist/quota-resources.d.ts +6 -3
- package/dist/quota-resources.d.ts.map +1 -1
- package/dist/quota-resources.js +25 -8
- package/dist/quota-resources.js.map +1 -1
- package/dist/runless-turn-recovery.d.ts +2 -9
- package/dist/runless-turn-recovery.d.ts.map +1 -1
- package/dist/runless-turn-recovery.js +0 -14
- package/dist/runless-turn-recovery.js.map +1 -1
- package/dist/server.d.ts +23 -22
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +74 -84
- package/dist/server.js.map +1 -1
- package/dist/store/blob-files.d.ts +71 -0
- package/dist/store/blob-files.d.ts.map +1 -0
- package/dist/store/blob-files.js +160 -0
- package/dist/store/blob-files.js.map +1 -0
- package/dist/store/command-prune.d.ts +37 -0
- package/dist/store/command-prune.d.ts.map +1 -0
- package/dist/store/command-prune.js +123 -0
- package/dist/store/command-prune.js.map +1 -0
- package/dist/store/command-queries.d.ts +41 -0
- package/dist/store/command-queries.d.ts.map +1 -0
- package/dist/store/command-queries.js +186 -0
- package/dist/store/command-queries.js.map +1 -0
- package/dist/store/command-rows.d.ts +66 -0
- package/dist/store/command-rows.d.ts.map +1 -0
- package/dist/store/command-rows.js +141 -0
- package/dist/store/command-rows.js.map +1 -0
- package/dist/store/commands.d.ts +49 -0
- package/dist/store/commands.d.ts.map +1 -0
- package/dist/store/commands.js +247 -0
- package/dist/store/commands.js.map +1 -0
- package/dist/store/cursors.d.ts +33 -0
- package/dist/store/cursors.d.ts.map +1 -0
- package/dist/store/cursors.js +82 -0
- package/dist/store/cursors.js.map +1 -0
- package/dist/store/engine-recovery-files.d.ts +14 -0
- package/dist/store/engine-recovery-files.d.ts.map +1 -0
- package/dist/store/engine-recovery-files.js +53 -0
- package/dist/store/engine-recovery-files.js.map +1 -0
- package/dist/store/engine-state-recovery.d.ts +71 -0
- package/dist/store/engine-state-recovery.d.ts.map +1 -0
- package/dist/store/engine-state-recovery.js +318 -0
- package/dist/store/engine-state-recovery.js.map +1 -0
- package/dist/store/errors.d.ts +80 -0
- package/dist/store/errors.d.ts.map +1 -0
- package/dist/store/errors.js +130 -0
- package/dist/store/errors.js.map +1 -0
- package/dist/store/event-store.d.ts +52 -0
- package/dist/store/event-store.d.ts.map +1 -0
- package/dist/store/event-store.js +117 -0
- package/dist/store/event-store.js.map +1 -0
- package/dist/store/external-files.d.ts +40 -0
- package/dist/store/external-files.d.ts.map +1 -0
- package/dist/store/external-files.js +90 -0
- package/dist/store/external-files.js.map +1 -0
- package/dist/store/flusher-protocol.d.ts +82 -0
- package/dist/store/flusher-protocol.d.ts.map +1 -0
- package/dist/store/flusher-protocol.js +23 -0
- package/dist/store/flusher-protocol.js.map +1 -0
- package/dist/store/flusher-worker.d.ts +24 -0
- package/dist/store/flusher-worker.d.ts.map +1 -0
- package/dist/store/flusher-worker.js +185 -0
- package/dist/store/flusher-worker.js.map +1 -0
- package/dist/store/flusher.d.ts +87 -0
- package/dist/store/flusher.d.ts.map +1 -0
- package/dist/store/flusher.js +264 -0
- package/dist/store/flusher.js.map +1 -0
- package/dist/store/generations.d.ts +43 -0
- package/dist/store/generations.d.ts.map +1 -0
- package/dist/store/generations.js +143 -0
- package/dist/store/generations.js.map +1 -0
- package/dist/store/idempotency.d.ts +25 -0
- package/dist/store/idempotency.d.ts.map +1 -0
- package/dist/store/idempotency.js +53 -0
- package/dist/store/idempotency.js.map +1 -0
- package/dist/store/import-context.d.ts +22 -0
- package/dist/store/import-context.d.ts.map +1 -0
- package/dist/store/import-context.js +87 -0
- package/dist/store/import-context.js.map +1 -0
- package/dist/store/import-discovery.d.ts +6 -0
- package/dist/store/import-discovery.d.ts.map +1 -0
- package/dist/store/import-discovery.js +66 -0
- package/dist/store/import-discovery.js.map +1 -0
- package/dist/store/import-records.d.ts +6 -0
- package/dist/store/import-records.d.ts.map +1 -0
- package/dist/store/import-records.js +191 -0
- package/dist/store/import-records.js.map +1 -0
- package/dist/store/import-resources.d.ts +14 -0
- package/dist/store/import-resources.d.ts.map +1 -0
- package/dist/store/import-resources.js +197 -0
- package/dist/store/import-resources.js.map +1 -0
- package/dist/store/import-source.d.ts +24 -0
- package/dist/store/import-source.d.ts.map +1 -0
- package/dist/store/import-source.js +65 -0
- package/dist/store/import-source.js.map +1 -0
- package/dist/store/import-verify.d.ts +6 -0
- package/dist/store/import-verify.d.ts.map +1 -0
- package/dist/store/import-verify.js +97 -0
- package/dist/store/import-verify.js.map +1 -0
- package/dist/store/import-worker.d.ts +18 -0
- package/dist/store/import-worker.d.ts.map +1 -0
- package/dist/store/import-worker.js +69 -0
- package/dist/store/import-worker.js.map +1 -0
- package/dist/store/importer.d.ts +42 -0
- package/dist/store/importer.d.ts.map +1 -0
- package/dist/store/importer.js +239 -0
- package/dist/store/importer.js.map +1 -0
- package/dist/store/interactions.d.ts +22 -0
- package/dist/store/interactions.d.ts.map +1 -0
- package/dist/store/interactions.js +82 -0
- package/dist/store/interactions.js.map +1 -0
- package/dist/store/legacy-journal/frame-codec.d.ts +94 -0
- package/dist/store/legacy-journal/frame-codec.d.ts.map +1 -0
- package/dist/store/legacy-journal/frame-codec.js +352 -0
- package/dist/store/legacy-journal/frame-codec.js.map +1 -0
- package/dist/store/legacy-journal/frame-reader.d.ts +30 -0
- package/dist/store/legacy-journal/frame-reader.d.ts.map +1 -0
- package/dist/store/legacy-journal/frame-reader.js +97 -0
- package/dist/store/legacy-journal/frame-reader.js.map +1 -0
- package/dist/store/legacy-journal/journal-fold.d.ts +47 -0
- package/dist/store/legacy-journal/journal-fold.d.ts.map +1 -0
- package/dist/store/legacy-journal/journal-fold.js +81 -0
- package/dist/store/legacy-journal/journal-fold.js.map +1 -0
- package/dist/store/legacy-journal/journal-partition.d.ts +2 -0
- package/dist/store/legacy-journal/journal-partition.d.ts.map +1 -0
- package/dist/store/legacy-journal/journal-partition.js +10 -0
- package/dist/store/legacy-journal/journal-partition.js.map +1 -0
- package/dist/store/legacy-journal/read-only-preparation.d.ts +48 -0
- package/dist/store/legacy-journal/read-only-preparation.d.ts.map +1 -0
- package/dist/store/legacy-journal/read-only-preparation.js +430 -0
- package/dist/store/legacy-journal/read-only-preparation.js.map +1 -0
- package/dist/store/maintenance-worker.d.ts +5 -0
- package/dist/store/maintenance-worker.d.ts.map +1 -0
- package/dist/store/maintenance-worker.js +175 -0
- package/dist/store/maintenance-worker.js.map +1 -0
- package/dist/store/maintenance.d.ts +124 -0
- package/dist/store/maintenance.d.ts.map +1 -0
- package/dist/store/maintenance.js +197 -0
- package/dist/store/maintenance.js.map +1 -0
- package/dist/store/mutation.d.ts +34 -0
- package/dist/store/mutation.d.ts.map +1 -0
- package/dist/store/mutation.js +85 -0
- package/dist/store/mutation.js.map +1 -0
- package/dist/store/obligations.d.ts +101 -0
- package/dist/store/obligations.d.ts.map +1 -0
- package/dist/store/obligations.js +226 -0
- package/dist/store/obligations.js.map +1 -0
- package/dist/store/operator-decisions.d.ts +23 -0
- package/dist/store/operator-decisions.d.ts.map +1 -0
- package/dist/store/operator-decisions.js +68 -0
- package/dist/store/operator-decisions.js.map +1 -0
- package/dist/store/owner-generations.d.ts +33 -0
- package/dist/store/owner-generations.d.ts.map +1 -0
- package/dist/store/owner-generations.js +63 -0
- package/dist/store/owner-generations.js.map +1 -0
- package/dist/store/partitions.d.ts +37 -0
- package/dist/store/partitions.d.ts.map +1 -0
- package/dist/store/partitions.js +68 -0
- package/dist/store/partitions.js.map +1 -0
- package/dist/store/pragmas.d.ts +32 -0
- package/dist/store/pragmas.d.ts.map +1 -0
- package/dist/store/pragmas.js +65 -0
- package/dist/store/pragmas.js.map +1 -0
- package/dist/store/project-router.d.ts +325 -0
- package/dist/store/project-router.d.ts.map +1 -0
- package/dist/store/project-router.js +298 -0
- package/dist/store/project-router.js.map +1 -0
- package/dist/store/projects.d.ts +36 -0
- package/dist/store/projects.d.ts.map +1 -0
- package/dist/store/projects.js +238 -0
- package/dist/store/projects.js.map +1 -0
- package/dist/store/publish-blob.d.ts +20 -0
- package/dist/store/publish-blob.d.ts.map +1 -0
- package/dist/store/publish-blob.js +158 -0
- package/dist/store/publish-blob.js.map +1 -0
- package/dist/store/purge-files.d.ts +30 -0
- package/dist/store/purge-files.d.ts.map +1 -0
- package/dist/store/purge-files.js +79 -0
- package/dist/store/purge-files.js.map +1 -0
- package/dist/store/resource-rows.d.ts +40 -0
- package/dist/store/resource-rows.d.ts.map +1 -0
- package/dist/store/resource-rows.js +103 -0
- package/dist/store/resource-rows.js.map +1 -0
- package/dist/store/resources.d.ts +67 -0
- package/dist/store/resources.d.ts.map +1 -0
- package/dist/store/resources.js +147 -0
- package/dist/store/resources.js.map +1 -0
- package/dist/store/retention.d.ts +95 -0
- package/dist/store/retention.d.ts.map +1 -0
- package/dist/store/retention.js +173 -0
- package/dist/store/retention.js.map +1 -0
- package/dist/store/run-events.d.ts +14 -0
- package/dist/store/run-events.d.ts.map +1 -0
- package/dist/store/run-events.js +35 -0
- package/dist/store/run-events.js.map +1 -0
- package/dist/store/runtime.d.ts +24 -0
- package/dist/store/runtime.d.ts.map +1 -0
- package/dist/store/runtime.js +67 -0
- package/dist/store/runtime.js.map +1 -0
- package/dist/store/schema.d.ts +33 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +187 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/setup-bindings.d.ts +20 -0
- package/dist/store/setup-bindings.d.ts.map +1 -0
- package/dist/store/setup-bindings.js +52 -0
- package/dist/store/setup-bindings.js.map +1 -0
- package/dist/store/sql-command-router.d.ts +79 -0
- package/dist/store/sql-command-router.d.ts.map +1 -0
- package/dist/store/sql-command-router.js +92 -0
- package/dist/store/sql-command-router.js.map +1 -0
- package/dist/store/sql-daemon-services.d.ts +61 -0
- package/dist/store/sql-daemon-services.d.ts.map +1 -0
- package/dist/store/sql-daemon-services.js +124 -0
- package/dist/store/sql-daemon-services.js.map +1 -0
- package/dist/store/sql-recovery-export.d.ts +8 -0
- package/dist/store/sql-recovery-export.d.ts.map +1 -0
- package/dist/store/sql-recovery-export.js +110 -0
- package/dist/store/sql-recovery-export.js.map +1 -0
- package/dist/store/sql-recovery-inspection.d.ts +22 -0
- package/dist/store/sql-recovery-inspection.d.ts.map +1 -0
- package/dist/store/sql-recovery-inspection.js +88 -0
- package/dist/store/sql-recovery-inspection.js.map +1 -0
- package/dist/store/sql-recovery.d.ts +69 -0
- package/dist/store/sql-recovery.d.ts.map +1 -0
- package/dist/store/sql-recovery.js +169 -0
- package/dist/store/sql-recovery.js.map +1 -0
- package/dist/store/sql-validation.d.ts +9 -0
- package/dist/store/sql-validation.d.ts.map +1 -0
- package/dist/store/sql-validation.js +103 -0
- package/dist/store/sql-validation.js.map +1 -0
- package/dist/store/statement-observer.d.ts +7 -0
- package/dist/store/statement-observer.d.ts.map +1 -0
- package/dist/store/statement-observer.js +44 -0
- package/dist/store/statement-observer.js.map +1 -0
- package/dist/store/store.d.ts +110 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +296 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/terminal-files.d.ts +21 -0
- package/dist/store/terminal-files.d.ts.map +1 -0
- package/dist/store/terminal-files.js +115 -0
- package/dist/store/terminal-files.js.map +1 -0
- package/dist/store/thread-replay.d.ts +12 -0
- package/dist/store/thread-replay.d.ts.map +1 -0
- package/dist/store/thread-replay.js +49 -0
- package/dist/store/thread-replay.js.map +1 -0
- package/dist/store/thread-rows.d.ts +25 -0
- package/dist/store/thread-rows.d.ts.map +1 -0
- package/dist/store/thread-rows.js +141 -0
- package/dist/store/thread-rows.js.map +1 -0
- package/dist/store/threads.d.ts +105 -0
- package/dist/store/threads.d.ts.map +1 -0
- package/dist/store/threads.js +423 -0
- package/dist/store/threads.js.map +1 -0
- package/dist/store/upload-binding-retention.d.ts +26 -0
- package/dist/store/upload-binding-retention.d.ts.map +1 -0
- package/dist/store/upload-binding-retention.js +142 -0
- package/dist/store/upload-binding-retention.js.map +1 -0
- package/dist/store/uploads.d.ts +30 -0
- package/dist/store/uploads.d.ts.map +1 -0
- package/dist/store/uploads.js +238 -0
- package/dist/store/uploads.js.map +1 -0
- package/dist/store-contracts.d.ts +181 -0
- package/dist/store-contracts.d.ts.map +1 -0
- package/dist/store-contracts.js +2 -0
- package/dist/store-contracts.js.map +1 -0
- package/dist/terminal-authority.d.ts +9 -0
- package/dist/terminal-authority.d.ts.map +1 -1
- package/dist/terminal-authority.js +103 -1
- package/dist/terminal-authority.js.map +1 -1
- package/dist/thread-lane-checkpoints.d.ts +0 -2
- package/dist/thread-lane-checkpoints.d.ts.map +1 -1
- package/dist/thread-lane-checkpoints.js +0 -4
- package/dist/thread-lane-checkpoints.js.map +1 -1
- package/dist/thread-store-support.d.ts +1 -27
- package/dist/thread-store-support.d.ts.map +1 -1
- package/dist/thread-store-support.js +0 -63
- package/dist/thread-store-support.js.map +1 -1
- package/dist/threads.d.ts +1 -113
- package/dist/threads.d.ts.map +1 -1
- package/dist/threads.js +1 -379
- package/dist/threads.js.map +1 -1
- package/package.json +9 -7
- package/dist/command-activity.d.ts +0 -14
- package/dist/command-activity.d.ts.map +0 -1
- package/dist/command-activity.js +0 -16
- package/dist/command-activity.js.map +0 -1
- package/dist/journal-events.d.ts +0 -4
- package/dist/journal-events.d.ts.map +0 -1
- package/dist/journal-events.js +0 -23
- package/dist/journal-events.js.map +0 -1
- package/dist/journal-maintenance.d.ts +0 -50
- package/dist/journal-maintenance.d.ts.map +0 -1
- package/dist/journal-maintenance.js +0 -162
- package/dist/journal-maintenance.js.map +0 -1
- package/dist/journal-manager-journal.d.ts +0 -18
- package/dist/journal-manager-journal.d.ts.map +0 -1
- package/dist/journal-manager-journal.js +0 -25
- package/dist/journal-manager-journal.js.map +0 -1
- package/dist/journal-manager-lifecycle.d.ts +0 -11
- package/dist/journal-manager-lifecycle.d.ts.map +0 -1
- package/dist/journal-manager-lifecycle.js +0 -2
- package/dist/journal-manager-lifecycle.js.map +0 -1
- package/dist/journal-manager.d.ts +0 -99
- package/dist/journal-manager.d.ts.map +0 -1
- package/dist/journal-manager.js +0 -559
- package/dist/journal-manager.js.map +0 -1
- package/dist/journal-prepared-operation.d.ts +0 -53
- package/dist/journal-prepared-operation.d.ts.map +0 -1
- package/dist/journal-prepared-operation.js +0 -158
- package/dist/journal-prepared-operation.js.map +0 -1
- package/dist/journal-projection-slot.d.ts +0 -28
- package/dist/journal-projection-slot.d.ts.map +0 -1
- package/dist/journal-projection-slot.js +0 -71
- package/dist/journal-projection-slot.js.map +0 -1
- package/dist/journal-projection.d.ts +0 -13
- package/dist/journal-projection.d.ts.map +0 -1
- package/dist/journal-projection.js +0 -2
- package/dist/journal-projection.js.map +0 -1
- package/dist/partition-accounts.d.ts +0 -27
- package/dist/partition-accounts.d.ts.map +0 -1
- package/dist/partition-accounts.js +0 -21
- package/dist/partition-accounts.js.map +0 -1
- package/dist/project-partition-preparation.d.ts +0 -87
- package/dist/project-partition-preparation.d.ts.map +0 -1
- package/dist/project-partition-preparation.js +0 -273
- package/dist/project-partition-preparation.js.map +0 -1
- package/dist/project-partitions.d.ts +0 -214
- package/dist/project-partitions.d.ts.map +0 -1
- package/dist/project-partitions.js +0 -486
- package/dist/project-partitions.js.map +0 -1
- package/dist/project-remove.d.ts +0 -11
- package/dist/project-remove.d.ts.map +0 -1
- package/dist/project-remove.js +0 -65
- package/dist/project-remove.js.map +0 -1
- package/dist/project-thread-listing.d.ts +0 -14
- package/dist/project-thread-listing.d.ts.map +0 -1
- package/dist/project-thread-listing.js +0 -37
- package/dist/project-thread-listing.js.map +0 -1
- package/dist/quota-projection.d.ts +0 -11
- package/dist/quota-projection.d.ts.map +0 -1
- package/dist/quota-projection.js +0 -10
- package/dist/quota-projection.js.map +0 -1
- package/dist/resource-store.d.ts +0 -39
- package/dist/resource-store.d.ts.map +0 -1
- package/dist/resource-store.js +0 -464
- package/dist/resource-store.js.map +0 -1
- package/dist/run-event-terminal-index.d.ts +0 -13
- package/dist/run-event-terminal-index.d.ts.map +0 -1
- package/dist/run-event-terminal-index.js +0 -38
- package/dist/run-event-terminal-index.js.map +0 -1
- package/dist/run-events.d.ts +0 -17
- package/dist/run-events.d.ts.map +0 -1
- package/dist/run-events.js +0 -31
- package/dist/run-events.js.map +0 -1
- package/dist/thread-head-ping.d.ts +0 -35
- package/dist/thread-head-ping.d.ts.map +0 -1
- package/dist/thread-head-ping.js +0 -67
- package/dist/thread-head-ping.js.map +0 -1
package/dist/journal-manager.js
DELETED
|
@@ -1,559 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { existsSync, realpathSync, renameSync } from "node:fs";
|
|
3
|
-
import { basename, dirname, join } from "node:path";
|
|
4
|
-
import { DurableJournal, JournalRecoveryRequiredError, journalPartitionDirectory, } from "@claudexor/journal";
|
|
5
|
-
import { ensureCanonicalPrivateDirectory, fsyncDirectory } from "@claudexor/util";
|
|
6
|
-
import { exportJournalRecovery, fingerprintPartition, cloneRecovery, recoveryAt, recoveryFrom, safeMessage, sha256, writeAtomicPrivateJson, } from "./journal-recovery-files.js";
|
|
7
|
-
import { conflict, matchingReceipt, quarantineRequestDigest, readOperation, typedError, validateRequest, } from "./journal-recovery-operation.js";
|
|
8
|
-
import { journalEvents } from "./journal-events.js";
|
|
9
|
-
import { daemonJournalOptions } from "./journal-manager-journal.js";
|
|
10
|
-
import { applyPreparedOperation, completePreparedReceipt, inspectPreparedOperation, preparationFingerprint, reconcilePreparedOperationOnStart, revalidatePreparedState, } from "./journal-prepared-operation.js";
|
|
11
|
-
import { prepareProjectionSlots, ProjectionSlot, } from "./journal-projection-slot.js";
|
|
12
|
-
export class JournalManager {
|
|
13
|
-
options;
|
|
14
|
-
rootDir;
|
|
15
|
-
partition;
|
|
16
|
-
journalRoot;
|
|
17
|
-
partitionDir;
|
|
18
|
-
operationsDir;
|
|
19
|
-
quarantineDir;
|
|
20
|
-
artifactPrefix;
|
|
21
|
-
now;
|
|
22
|
-
faults;
|
|
23
|
-
registrations = new Map();
|
|
24
|
-
journalOptions;
|
|
25
|
-
journal = null;
|
|
26
|
-
recovery = { status: "ready", discardedTailBytes: 0 };
|
|
27
|
-
generationValue = 0;
|
|
28
|
-
preparedOperation = null;
|
|
29
|
-
preparationResult = null;
|
|
30
|
-
lifecycle = "idle";
|
|
31
|
-
constructor(rootDir, options = {}) {
|
|
32
|
-
this.options = options;
|
|
33
|
-
this.partition = options.partition?.trim() || "global";
|
|
34
|
-
this.now = options.now ?? (() => new Date());
|
|
35
|
-
this.faults = options.faults ?? {};
|
|
36
|
-
this.rootDir = realpathSync(rootDir);
|
|
37
|
-
this.journalRoot = join(this.rootDir, "journal");
|
|
38
|
-
this.partitionDir = journalPartitionDirectory(this.journalRoot, this.partition);
|
|
39
|
-
this.artifactPrefix = basename(this.partitionDir);
|
|
40
|
-
this.operationsDir = join(this.rootDir, "recovery-operations", basename(this.partitionDir));
|
|
41
|
-
this.quarantineDir = join(this.rootDir, "journal-quarantine");
|
|
42
|
-
this.journalOptions = daemonJournalOptions({
|
|
43
|
-
rootDir: this.journalRoot,
|
|
44
|
-
partition: this.partition,
|
|
45
|
-
now: this.now,
|
|
46
|
-
requestMaintenance: options.requestMaintenance,
|
|
47
|
-
current: () => this.journal,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
registerProjection(descriptor) {
|
|
51
|
-
this.assertOpen();
|
|
52
|
-
if (this.lifecycle !== "idle")
|
|
53
|
-
throw new Error("journal projection registration is closed");
|
|
54
|
-
if (!/^[A-Za-z0-9._-]+$/.test(descriptor.name) || this.registrations.has(descriptor.name)) {
|
|
55
|
-
throw new Error(`invalid or duplicate journal projection '${descriptor.name}'`);
|
|
56
|
-
}
|
|
57
|
-
const slot = new ProjectionSlot(() => this.recovery);
|
|
58
|
-
this.registrations.set(descriptor.name, { descriptor, slot });
|
|
59
|
-
return slot;
|
|
60
|
-
}
|
|
61
|
-
start() {
|
|
62
|
-
this.assertOpen();
|
|
63
|
-
if (this.lifecycle !== "idle")
|
|
64
|
-
return this.inspect();
|
|
65
|
-
if (this.registrations.size === 0)
|
|
66
|
-
throw new Error("journal partition requires a projection");
|
|
67
|
-
ensureCanonicalPrivateDirectory(this.rootDir);
|
|
68
|
-
ensureCanonicalPrivateDirectory(this.journalRoot);
|
|
69
|
-
if (!this.reconcilePrepared())
|
|
70
|
-
this.openGeneration();
|
|
71
|
-
return this.inspect();
|
|
72
|
-
}
|
|
73
|
-
prepare() {
|
|
74
|
-
this.assertOpen();
|
|
75
|
-
if (this.preparationResult &&
|
|
76
|
-
(this.lifecycle === "prepared" || this.lifecycle === "recovery_required")) {
|
|
77
|
-
return structuredClone(this.preparationResult);
|
|
78
|
-
}
|
|
79
|
-
if (this.lifecycle !== "idle")
|
|
80
|
-
throw new Error("journal manager is already running");
|
|
81
|
-
if (this.registrations.size === 0)
|
|
82
|
-
throw new Error("journal partition requires a projection");
|
|
83
|
-
this.generationValue += 1;
|
|
84
|
-
const projectionStatus = [];
|
|
85
|
-
try {
|
|
86
|
-
this.journal = DurableJournal.prepare(this.journalOptions);
|
|
87
|
-
this.recovery = this.journal.state();
|
|
88
|
-
this.preparedOperation = inspectPreparedOperation({
|
|
89
|
-
rootDir: this.rootDir,
|
|
90
|
-
operationsDir: this.operationsDir,
|
|
91
|
-
quarantineDir: this.quarantineDir,
|
|
92
|
-
partitionDir: this.partitionDir,
|
|
93
|
-
partition: this.partition,
|
|
94
|
-
artifactPrefix: this.artifactPrefix,
|
|
95
|
-
journal: this.journal,
|
|
96
|
-
});
|
|
97
|
-
if (this.recovery.status === "ready") {
|
|
98
|
-
const prepared = prepareProjectionSlots(this.registrations.values(), this.journal);
|
|
99
|
-
projectionStatus.push(...prepared.status);
|
|
100
|
-
if (prepared.recovery)
|
|
101
|
-
this.enterRecovery(prepared.recovery);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
this.enterRecovery(recoveryFrom(error, `${this.partition} journal could not be prepared`));
|
|
106
|
-
}
|
|
107
|
-
const partitionFingerprint = this.observeFingerprint(this.partitionDir, "journal partition");
|
|
108
|
-
const operationsFingerprint = this.observeFingerprint(this.operationsDir, "journal recovery operations");
|
|
109
|
-
const preparedFingerprint = preparationFingerprint(this.journal?.preparation().preparationIdentity ?? partitionFingerprint.preparationIdentity, this.preparedOperation?.fingerprint ?? operationsFingerprint.preparationIdentity);
|
|
110
|
-
const inspection = this.inspection(partitionFingerprint.fingerprint);
|
|
111
|
-
this.preparationResult = {
|
|
112
|
-
partition: this.partition,
|
|
113
|
-
coverage: "complete",
|
|
114
|
-
inspection,
|
|
115
|
-
validation: { ...inspection, projectionStatus },
|
|
116
|
-
preparationFingerprint: preparedFingerprint,
|
|
117
|
-
virtual: this.journal?.preparation().virtual ?? !partitionFingerprint.exists,
|
|
118
|
-
};
|
|
119
|
-
if (this.recovery.status === "ready")
|
|
120
|
-
this.lifecycle = "prepared";
|
|
121
|
-
else
|
|
122
|
-
this.enterRecovery(this.recovery);
|
|
123
|
-
return structuredClone(this.preparationResult);
|
|
124
|
-
}
|
|
125
|
-
revalidatePreparation() {
|
|
126
|
-
this.assertStarted();
|
|
127
|
-
if (this.lifecycle === "recovery_required") {
|
|
128
|
-
throw new JournalRecoveryRequiredError(this.recovery);
|
|
129
|
-
}
|
|
130
|
-
if (this.lifecycle !== "prepared")
|
|
131
|
-
throw new Error("journal manager is not prepared");
|
|
132
|
-
if (!this.preparationResult || !this.journal)
|
|
133
|
-
throw new Error("journal is not prepared");
|
|
134
|
-
try {
|
|
135
|
-
this.preparedOperation = revalidatePreparedState({
|
|
136
|
-
rootDir: this.rootDir,
|
|
137
|
-
operationsDir: this.operationsDir,
|
|
138
|
-
quarantineDir: this.quarantineDir,
|
|
139
|
-
partitionDir: this.partitionDir,
|
|
140
|
-
partition: this.partition,
|
|
141
|
-
artifactPrefix: this.artifactPrefix,
|
|
142
|
-
journal: this.journal,
|
|
143
|
-
expectedFingerprint: this.preparationResult.preparationFingerprint,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
const recovery = recoveryFrom(error, `${this.partition} preparation revalidation failed`);
|
|
148
|
-
this.enterRecovery(recovery);
|
|
149
|
-
throw new JournalRecoveryRequiredError(recovery);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
activatePrepared() {
|
|
153
|
-
this.assertStarted();
|
|
154
|
-
if (this.lifecycle === "active")
|
|
155
|
-
return;
|
|
156
|
-
if (this.lifecycle === "recovery_required") {
|
|
157
|
-
throw new JournalRecoveryRequiredError(this.recovery);
|
|
158
|
-
}
|
|
159
|
-
if (this.lifecycle !== "prepared")
|
|
160
|
-
throw new Error("journal manager is not prepared");
|
|
161
|
-
if (!this.preparationResult || !this.journal)
|
|
162
|
-
throw new Error("journal is not prepared");
|
|
163
|
-
try {
|
|
164
|
-
this.revalidatePreparation();
|
|
165
|
-
this.journal.activatePrepared();
|
|
166
|
-
if (!this.preparedOperation)
|
|
167
|
-
throw new Error("journal recovery operation is not prepared");
|
|
168
|
-
applyPreparedOperation({
|
|
169
|
-
rootDir: this.rootDir,
|
|
170
|
-
plan: this.preparedOperation,
|
|
171
|
-
journal: this.journal,
|
|
172
|
-
partition: this.partition,
|
|
173
|
-
artifactPrefix: this.artifactPrefix,
|
|
174
|
-
now: this.now,
|
|
175
|
-
afterReceipt: this.faults.afterQuarantineReceipt,
|
|
176
|
-
});
|
|
177
|
-
const activatedRecovery = this.journal.state();
|
|
178
|
-
if (activatedRecovery.status === "recovery_required") {
|
|
179
|
-
throw new JournalRecoveryRequiredError(activatedRecovery);
|
|
180
|
-
}
|
|
181
|
-
for (const registration of this.registrations.values()) {
|
|
182
|
-
this.faults.beforeProjectionActivation?.();
|
|
183
|
-
registration.slot.activate(this.generationValue);
|
|
184
|
-
}
|
|
185
|
-
this.recovery = activatedRecovery;
|
|
186
|
-
this.lifecycle = "active";
|
|
187
|
-
}
|
|
188
|
-
catch (error) {
|
|
189
|
-
const recovery = recoveryFrom(error, `${this.partition} prepared activation failed`);
|
|
190
|
-
this.journal?.close();
|
|
191
|
-
this.journal = null;
|
|
192
|
-
this.enterRecovery(recovery);
|
|
193
|
-
throw new JournalRecoveryRequiredError(recovery);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
recoverAfterStartup() {
|
|
197
|
-
this.assertStarted();
|
|
198
|
-
if (this.lifecycle !== "active")
|
|
199
|
-
throw new Error("journal manager is not active");
|
|
200
|
-
try {
|
|
201
|
-
for (const registration of this.registrations.values()) {
|
|
202
|
-
registration.descriptor.recover?.(registration.slot.current());
|
|
203
|
-
}
|
|
204
|
-
if (this.journal)
|
|
205
|
-
this.options.requestMaintenance?.(this.journal);
|
|
206
|
-
}
|
|
207
|
-
catch (error) {
|
|
208
|
-
const recovery = recoveryFrom(error, `${this.partition} projection recovery failed`);
|
|
209
|
-
this.enterRecovery(recovery);
|
|
210
|
-
throw new JournalRecoveryRequiredError(recovery);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
inspect() {
|
|
214
|
-
this.assertStarted();
|
|
215
|
-
if (this.journal && this.recovery.status === "ready") {
|
|
216
|
-
const state = this.journal.state();
|
|
217
|
-
if (state.status === "recovery_required")
|
|
218
|
-
this.enterRecovery(state);
|
|
219
|
-
}
|
|
220
|
-
return this.inspection(this.observeFingerprint(this.partitionDir, "journal partition").fingerprint);
|
|
221
|
-
}
|
|
222
|
-
ready() {
|
|
223
|
-
this.assertStarted();
|
|
224
|
-
if (this.journal && this.recovery.status === "ready") {
|
|
225
|
-
const state = this.journal.state();
|
|
226
|
-
if (state.status === "recovery_required")
|
|
227
|
-
this.enterRecovery(state);
|
|
228
|
-
}
|
|
229
|
-
return this.lifecycle === "active" && this.recovery.status === "ready";
|
|
230
|
-
}
|
|
231
|
-
validate() {
|
|
232
|
-
this.assertStarted();
|
|
233
|
-
if (this.lifecycle === "prepared") {
|
|
234
|
-
try {
|
|
235
|
-
this.revalidatePreparation();
|
|
236
|
-
}
|
|
237
|
-
catch { }
|
|
238
|
-
}
|
|
239
|
-
const before = this.observeFingerprint(this.partitionDir, "journal validation input");
|
|
240
|
-
const projectionStatus = [];
|
|
241
|
-
for (const registration of this.registrations.values()) {
|
|
242
|
-
try {
|
|
243
|
-
const projection = registration.slot.prepared();
|
|
244
|
-
registration.descriptor.validate(projection);
|
|
245
|
-
projectionStatus.push({
|
|
246
|
-
name: registration.descriptor.name,
|
|
247
|
-
status: "valid",
|
|
248
|
-
detail: null,
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
catch (error) {
|
|
252
|
-
this.enterRecovery(recoveryFrom(error, `projection '${registration.descriptor.name}' failed`));
|
|
253
|
-
projectionStatus.push({
|
|
254
|
-
name: registration.descriptor.name,
|
|
255
|
-
status: "invalid",
|
|
256
|
-
detail: safeMessage(error),
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const after = this.observeFingerprint(this.partitionDir, "journal validation input");
|
|
261
|
-
if (before.fingerprint !== after.fingerprint) {
|
|
262
|
-
this.enterRecovery(recoveryAt(0, "journal changed during validation"));
|
|
263
|
-
}
|
|
264
|
-
return { ...this.inspection(after.fingerprint), projectionStatus };
|
|
265
|
-
}
|
|
266
|
-
events(afterCursor) {
|
|
267
|
-
this.assertStarted();
|
|
268
|
-
return journalEvents(this.journal, this.recovery, afterCursor);
|
|
269
|
-
}
|
|
270
|
-
exportRecovery() {
|
|
271
|
-
this.assertStarted();
|
|
272
|
-
return exportJournalRecovery({
|
|
273
|
-
rootDir: this.rootDir,
|
|
274
|
-
partitionDir: this.partitionDir,
|
|
275
|
-
partition: this.partition,
|
|
276
|
-
recovery: this.recovery,
|
|
277
|
-
now: this.now,
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
preflightQuarantine(input) {
|
|
281
|
-
this.assertStarted();
|
|
282
|
-
validateRequest(input);
|
|
283
|
-
const keyDigest = sha256(Buffer.from(input.idempotencyKey));
|
|
284
|
-
const path = join(this.operationsDir, `${keyDigest}.json`);
|
|
285
|
-
const existing = readOperation(path, this.quarantineDir, this.partition, this.artifactPrefix);
|
|
286
|
-
const requestDigest = quarantineRequestDigest(this.partition, input);
|
|
287
|
-
if (existing) {
|
|
288
|
-
if (existing.requestDigest !== requestDigest)
|
|
289
|
-
throw conflict("idempotency_conflict");
|
|
290
|
-
if (existing.status === "completed") {
|
|
291
|
-
return {
|
|
292
|
-
disposition: "completed",
|
|
293
|
-
receipt: matchingReceipt(existing, undefined, this.partition, this.artifactPrefix),
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
return { disposition: "prepared", receipt: null };
|
|
297
|
-
}
|
|
298
|
-
if (this.recovery.status !== "recovery_required") {
|
|
299
|
-
throw typedError("journal_partition_ready", 409, "only a corrupt partition can be quarantined");
|
|
300
|
-
}
|
|
301
|
-
if (this.stableFingerprint(this.partitionDir, "journal recovery source").fingerprint !==
|
|
302
|
-
input.expectedFingerprint) {
|
|
303
|
-
throw conflict("recovery_fingerprint_mismatch");
|
|
304
|
-
}
|
|
305
|
-
return { disposition: "new", receipt: null };
|
|
306
|
-
}
|
|
307
|
-
quarantineAndStartFresh(input) {
|
|
308
|
-
const preflight = this.preflightQuarantine(input);
|
|
309
|
-
if (preflight.disposition === "completed")
|
|
310
|
-
return preflight.receipt;
|
|
311
|
-
ensureCanonicalPrivateDirectory(dirname(this.operationsDir));
|
|
312
|
-
ensureCanonicalPrivateDirectory(this.operationsDir);
|
|
313
|
-
ensureCanonicalPrivateDirectory(this.quarantineDir);
|
|
314
|
-
const keyDigest = sha256(Buffer.from(input.idempotencyKey));
|
|
315
|
-
const operationPath = join(this.operationsDir, `${keyDigest}.json`);
|
|
316
|
-
let operation = readOperation(operationPath, this.quarantineDir, this.partition, this.artifactPrefix);
|
|
317
|
-
if (!operation) {
|
|
318
|
-
const operationId = randomUUID();
|
|
319
|
-
operation = {
|
|
320
|
-
schemaVersion: 1,
|
|
321
|
-
operationId,
|
|
322
|
-
keyDigest,
|
|
323
|
-
requestDigest: quarantineRequestDigest(this.partition, input),
|
|
324
|
-
expectedFingerprint: input.expectedFingerprint,
|
|
325
|
-
quarantinePath: join(this.quarantineDir, `${this.artifactPrefix}-${operationId}`),
|
|
326
|
-
status: "prepared",
|
|
327
|
-
receipt: null,
|
|
328
|
-
};
|
|
329
|
-
writeAtomicPrivateJson(operationPath, operation, true);
|
|
330
|
-
}
|
|
331
|
-
return this.resume(operation, operationPath);
|
|
332
|
-
}
|
|
333
|
-
close() {
|
|
334
|
-
if (this.lifecycle === "closed")
|
|
335
|
-
return;
|
|
336
|
-
this.lifecycle = "closed";
|
|
337
|
-
this.clearSlots();
|
|
338
|
-
this.journal?.close();
|
|
339
|
-
this.journal = null;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Close the partition's generation and rename it into journal-archived/, never
|
|
343
|
-
* delete history. Missing source returns an existing archive path or null;
|
|
344
|
-
* a pre-existing archive for a re-registered id is preserved under a suffix.
|
|
345
|
-
*/
|
|
346
|
-
archivePartition() {
|
|
347
|
-
const archiveDir = join(this.rootDir, "journal-archived");
|
|
348
|
-
const target = join(archiveDir, this.artifactPrefix);
|
|
349
|
-
if (!existsSync(this.partitionDir)) {
|
|
350
|
-
// Nothing to move: close permanently and return the idempotent answer.
|
|
351
|
-
this.close();
|
|
352
|
-
return existsSync(target) ? target : null;
|
|
353
|
-
}
|
|
354
|
-
ensureCanonicalPrivateDirectory(archiveDir);
|
|
355
|
-
const dest = existsSync(target)
|
|
356
|
-
? join(archiveDir, `${this.artifactPrefix}-${randomUUID()}`)
|
|
357
|
-
: target;
|
|
358
|
-
// Revoke this generation before the move, but close the manager permanently
|
|
359
|
-
// only after rename succeeds; failure reopens a fresh usable generation.
|
|
360
|
-
this.clearSlots();
|
|
361
|
-
this.journal?.close();
|
|
362
|
-
this.journal = null;
|
|
363
|
-
try {
|
|
364
|
-
this.faults.beforeArchiveRename?.();
|
|
365
|
-
renameSync(this.partitionDir, dest);
|
|
366
|
-
}
|
|
367
|
-
catch (error) {
|
|
368
|
-
this.openGeneration();
|
|
369
|
-
throw error;
|
|
370
|
-
}
|
|
371
|
-
this.lifecycle = "closed";
|
|
372
|
-
fsyncDirectory(this.journalRoot);
|
|
373
|
-
fsyncDirectory(archiveDir);
|
|
374
|
-
return dest;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Roll a just-archived partition back into the active journal tree — the
|
|
378
|
-
* removeProject rollback when the durable registry `unregister` fails AFTER a
|
|
379
|
-
* successful archive (Ф2 finding 4). Moves `archivedPath` back to
|
|
380
|
-
* `partitionDir` and reopens a fresh generation so the partition is usable
|
|
381
|
-
* again. Throws (leaving the archive in place) when the active slot is already
|
|
382
|
-
* occupied, so the caller can disclose the unrecoverable partial state.
|
|
383
|
-
*/
|
|
384
|
-
restoreArchivedPartition(archivedPath) {
|
|
385
|
-
if (existsSync(this.partitionDir)) {
|
|
386
|
-
throw new Error(`cannot restore archived partition: ${this.partitionDir} already exists in the active tree`);
|
|
387
|
-
}
|
|
388
|
-
if (!existsSync(archivedPath)) {
|
|
389
|
-
throw new Error(`cannot restore archived partition: ${archivedPath} is missing`);
|
|
390
|
-
}
|
|
391
|
-
renameSync(archivedPath, this.partitionDir);
|
|
392
|
-
fsyncDirectory(this.journalRoot);
|
|
393
|
-
this.lifecycle = "idle";
|
|
394
|
-
this.openGeneration();
|
|
395
|
-
}
|
|
396
|
-
openGeneration() {
|
|
397
|
-
this.assertOpen();
|
|
398
|
-
this.journal?.close();
|
|
399
|
-
this.journal = null;
|
|
400
|
-
this.clearSlots();
|
|
401
|
-
this.generationValue += 1;
|
|
402
|
-
try {
|
|
403
|
-
this.journal = new DurableJournal(this.journalOptions);
|
|
404
|
-
this.recovery = this.journal.state();
|
|
405
|
-
if (this.recovery.status === "recovery_required") {
|
|
406
|
-
this.enterRecovery(this.recovery);
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
for (const registration of this.registrations.values()) {
|
|
410
|
-
const projection = registration.descriptor.create(this.journal);
|
|
411
|
-
registration.descriptor.validate(projection);
|
|
412
|
-
registration.slot.bind(projection, this.generationValue);
|
|
413
|
-
}
|
|
414
|
-
this.lifecycle = "active";
|
|
415
|
-
this.recoverAfterStartup();
|
|
416
|
-
}
|
|
417
|
-
catch (error) {
|
|
418
|
-
const failed = this.journal;
|
|
419
|
-
this.journal = null;
|
|
420
|
-
try {
|
|
421
|
-
failed?.close();
|
|
422
|
-
}
|
|
423
|
-
catch {
|
|
424
|
-
/* preserve the projection/open failure */
|
|
425
|
-
}
|
|
426
|
-
this.enterRecovery(recoveryFrom(error, `${this.partition} journal could not be opened`));
|
|
427
|
-
}
|
|
428
|
-
if (this.recovery.status === "recovery_required")
|
|
429
|
-
this.clearSlots();
|
|
430
|
-
}
|
|
431
|
-
resume(operation, operationPath) {
|
|
432
|
-
const source = this.stableFingerprint(this.partitionDir, "journal recovery source");
|
|
433
|
-
const target = this.stableFingerprint(operation.quarantinePath, "journal quarantine target");
|
|
434
|
-
const sourceExists = source.exists;
|
|
435
|
-
const targetExists = target.exists;
|
|
436
|
-
if (sourceExists && targetExists)
|
|
437
|
-
return this.completeFromReceipt(operation, operationPath);
|
|
438
|
-
if (sourceExists) {
|
|
439
|
-
if (source.fingerprint !== operation.expectedFingerprint) {
|
|
440
|
-
throw conflict("recovery_fingerprint_mismatch");
|
|
441
|
-
}
|
|
442
|
-
this.clearSlots();
|
|
443
|
-
this.journal?.close();
|
|
444
|
-
this.journal = null;
|
|
445
|
-
renameSync(this.partitionDir, operation.quarantinePath);
|
|
446
|
-
fsyncDirectory(this.journalRoot);
|
|
447
|
-
fsyncDirectory(dirname(operation.quarantinePath));
|
|
448
|
-
if (this.stableFingerprint(operation.quarantinePath, "journal quarantine target")
|
|
449
|
-
.fingerprint !== operation.expectedFingerprint) {
|
|
450
|
-
throw typedError("recovery_quarantine_mismatch", 503, "quarantined bytes changed");
|
|
451
|
-
}
|
|
452
|
-
this.faults.afterQuarantineRename?.();
|
|
453
|
-
}
|
|
454
|
-
else if (!targetExists) {
|
|
455
|
-
throw typedError("recovery_operation_missing", 503, "recovery source and target are missing");
|
|
456
|
-
}
|
|
457
|
-
else if (target.fingerprint !== operation.expectedFingerprint) {
|
|
458
|
-
throw typedError("recovery_quarantine_mismatch", 503, "quarantined bytes changed");
|
|
459
|
-
}
|
|
460
|
-
this.openGeneration();
|
|
461
|
-
if (!this.journal || this.recovery.status === "recovery_required") {
|
|
462
|
-
throw new JournalRecoveryRequiredError(this.recovery.status === "recovery_required"
|
|
463
|
-
? this.recovery
|
|
464
|
-
: recoveryAt(0, "fresh journal failed to initialize"));
|
|
465
|
-
}
|
|
466
|
-
if (this.journal.records().length !== 0) {
|
|
467
|
-
throw typedError("recovery_operation_ambiguous", 503, "fresh journal is not empty");
|
|
468
|
-
}
|
|
469
|
-
const receipt = {
|
|
470
|
-
schemaVersion: 1,
|
|
471
|
-
operationId: operation.operationId,
|
|
472
|
-
partition: this.partition,
|
|
473
|
-
previousFingerprint: operation.expectedFingerprint,
|
|
474
|
-
quarantineArtifactId: `${this.artifactPrefix}-${operation.operationId}`,
|
|
475
|
-
quarantinePath: operation.quarantinePath,
|
|
476
|
-
newEpoch: this.journal.currentEpoch(),
|
|
477
|
-
completedAt: this.now().toISOString(),
|
|
478
|
-
};
|
|
479
|
-
this.journal.append("journal.partition_quarantined", receipt);
|
|
480
|
-
this.faults.afterQuarantineReceipt?.();
|
|
481
|
-
writeAtomicPrivateJson(operationPath, { ...operation, status: "completed", receipt }, false);
|
|
482
|
-
return receipt;
|
|
483
|
-
}
|
|
484
|
-
completeFromReceipt(operation, operationPath) {
|
|
485
|
-
if (!this.journal)
|
|
486
|
-
this.openGeneration();
|
|
487
|
-
if (!this.journal || this.recovery.status === "recovery_required") {
|
|
488
|
-
throw typedError("recovery_operation_ambiguous", 503, "fresh journal is unreadable");
|
|
489
|
-
}
|
|
490
|
-
return completePreparedReceipt({
|
|
491
|
-
rootDir: this.rootDir,
|
|
492
|
-
operation,
|
|
493
|
-
operationPath,
|
|
494
|
-
journal: this.journal,
|
|
495
|
-
partition: this.partition,
|
|
496
|
-
artifactPrefix: this.artifactPrefix,
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
reconcilePrepared() {
|
|
500
|
-
return reconcilePreparedOperationOnStart({
|
|
501
|
-
operationsDir: this.operationsDir,
|
|
502
|
-
quarantineDir: this.quarantineDir,
|
|
503
|
-
partitionDir: this.partitionDir,
|
|
504
|
-
partition: this.partition,
|
|
505
|
-
artifactPrefix: this.artifactPrefix,
|
|
506
|
-
openGeneration: () => this.openGeneration(),
|
|
507
|
-
resume: (operation, path) => void this.resume(operation, path),
|
|
508
|
-
failed: (error) => this.enterRecovery(recoveryFrom(error, "prepared quarantine reconciliation failed")),
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
inspection(fingerprint) {
|
|
512
|
-
return {
|
|
513
|
-
schemaVersion: 1,
|
|
514
|
-
partition: this.partition,
|
|
515
|
-
generation: this.generationValue,
|
|
516
|
-
status: this.recovery.status,
|
|
517
|
-
recovery: cloneRecovery(this.recovery),
|
|
518
|
-
fingerprint,
|
|
519
|
-
observedAt: this.now().toISOString(),
|
|
520
|
-
evidenceRefs: [`recovery:${this.partition}:${fingerprint}`],
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
enterRecovery(state) {
|
|
524
|
-
const closeWriter = this.lifecycle === "active";
|
|
525
|
-
this.recovery = cloneRecovery(state);
|
|
526
|
-
this.lifecycle = "recovery_required";
|
|
527
|
-
this.clearSlots();
|
|
528
|
-
if (closeWriter) {
|
|
529
|
-
this.journal?.close();
|
|
530
|
-
this.journal = null;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
observeFingerprint(path, context) {
|
|
534
|
-
const observed = fingerprintPartition(path, this.rootDir);
|
|
535
|
-
if (observed.problem)
|
|
536
|
-
this.enterRecovery(recoveryAt(0, `${context}: ${observed.problem}`));
|
|
537
|
-
return observed;
|
|
538
|
-
}
|
|
539
|
-
stableFingerprint(path, context) {
|
|
540
|
-
const observed = this.observeFingerprint(path, context);
|
|
541
|
-
if (observed.problem)
|
|
542
|
-
throw new JournalRecoveryRequiredError(this.recovery);
|
|
543
|
-
return observed;
|
|
544
|
-
}
|
|
545
|
-
clearSlots() {
|
|
546
|
-
for (const registration of this.registrations.values())
|
|
547
|
-
registration.slot.clear();
|
|
548
|
-
}
|
|
549
|
-
assertStarted() {
|
|
550
|
-
this.assertOpen();
|
|
551
|
-
if (this.lifecycle === "idle")
|
|
552
|
-
throw new Error("journal manager is not running");
|
|
553
|
-
}
|
|
554
|
-
assertOpen() {
|
|
555
|
-
if (this.lifecycle === "closed")
|
|
556
|
-
throw new Error("journal manager is closed");
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
//# sourceMappingURL=journal-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"journal-manager.js","sourceRoot":"","sources":["../src/journal-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,GAG1B,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAAE,+BAA+B,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,MAAM,EACN,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,eAAe,GAGhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,sBAAsB,EACtB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AC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;IAEO,kBAAkB,CAAC,IAAY,EAAE,OAAe;QACtD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,QAAQ,CAAC,OAAO;YAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,OAAO,KAAK,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC3F,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,iBAAiB,CAAC,IAAY,EAAE,OAAe;QACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,QAAQ,CAAC,OAAO;YAAE,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,QAAiB,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,UAAU;QAChB,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YAAE,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpF,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,SAAS,KAAK,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnF,CAAC;IAEO,UAAU;QAChB,IAAI,IAAI,CAAC,SAAS,KAAK,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAChF,CAAC;CACF"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { DurableJournal } from "@claudexor/journal";
|
|
2
|
-
import type { ControlJournalQuarantineReceipt } from "@claudexor/schema";
|
|
3
|
-
import { type QuarantineOperation } from "./journal-recovery-operation.js";
|
|
4
|
-
export type PreparedOperationPlan = {
|
|
5
|
-
kind: "none";
|
|
6
|
-
fingerprint: string;
|
|
7
|
-
} | {
|
|
8
|
-
kind: "source_intact" | "resume_after_activation" | "complete_after_activation";
|
|
9
|
-
fingerprint: string;
|
|
10
|
-
path: string;
|
|
11
|
-
operation: QuarantineOperation;
|
|
12
|
-
};
|
|
13
|
-
export declare function inspectPreparedOperation(input: {
|
|
14
|
-
rootDir: string;
|
|
15
|
-
operationsDir: string;
|
|
16
|
-
quarantineDir: string;
|
|
17
|
-
partitionDir: string;
|
|
18
|
-
partition: string;
|
|
19
|
-
artifactPrefix: string;
|
|
20
|
-
journal: DurableJournal | null;
|
|
21
|
-
}): PreparedOperationPlan;
|
|
22
|
-
export declare function preparationFingerprint(journalFingerprint: string, operationFingerprint: string): string;
|
|
23
|
-
export declare function revalidatePreparedState(input: Parameters<typeof inspectPreparedOperation>[0] & {
|
|
24
|
-
expectedFingerprint: string;
|
|
25
|
-
}): PreparedOperationPlan;
|
|
26
|
-
export declare function applyPreparedOperation(input: {
|
|
27
|
-
rootDir: string;
|
|
28
|
-
plan: PreparedOperationPlan;
|
|
29
|
-
journal: DurableJournal;
|
|
30
|
-
partition: string;
|
|
31
|
-
artifactPrefix: string;
|
|
32
|
-
now: () => Date;
|
|
33
|
-
afterReceipt?: () => void;
|
|
34
|
-
}): void;
|
|
35
|
-
export declare function completePreparedReceipt(input: {
|
|
36
|
-
rootDir: string;
|
|
37
|
-
operation: QuarantineOperation;
|
|
38
|
-
operationPath: string;
|
|
39
|
-
journal: DurableJournal;
|
|
40
|
-
partition: string;
|
|
41
|
-
artifactPrefix: string;
|
|
42
|
-
}): ControlJournalQuarantineReceipt;
|
|
43
|
-
export declare function reconcilePreparedOperationOnStart(input: {
|
|
44
|
-
operationsDir: string;
|
|
45
|
-
quarantineDir: string;
|
|
46
|
-
partitionDir: string;
|
|
47
|
-
partition: string;
|
|
48
|
-
artifactPrefix: string;
|
|
49
|
-
openGeneration(): void;
|
|
50
|
-
resume(operation: QuarantineOperation, path: string): void;
|
|
51
|
-
failed(error: unknown): void;
|
|
52
|
-
}): boolean;
|
|
53
|
-
//# sourceMappingURL=journal-prepared-operation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"journal-prepared-operation.d.ts","sourceRoot":"","sources":["../src/journal-prepared-operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAOzE,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACrC;IACE,IAAI,EAAE,eAAe,GAAG,yBAAyB,GAAG,2BAA2B,CAAC;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAEN,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC,GAAG,qBAAqB,CA2DxB;AAED,wBAAgB,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,UAI9F;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACtF,qBAAqB,CAYvB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,OAAO,EA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