@claudexor/daemon 3.25.1 → 4.0.0
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 +91 -0
- package/dist/store/retention.d.ts.map +1 -0
- package/dist/store/retention.js +169 -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
|
@@ -1,78 +1,5 @@
|
|
|
1
1
|
import { hashJson } from "@claudexor/util";
|
|
2
|
-
|
|
3
|
-
/** Journal authority for the human decision that may unblock one exact run patch. */
|
|
4
|
-
export class OperatorDecisionStore {
|
|
5
|
-
journal;
|
|
6
|
-
byRun = new Map();
|
|
7
|
-
byKey = new Map();
|
|
8
|
-
constructor(journal) {
|
|
9
|
-
this.journal = journal;
|
|
10
|
-
for (const entry of journal.records(0, [RECORDED])) {
|
|
11
|
-
if (entry.type !== RECORDED)
|
|
12
|
-
continue;
|
|
13
|
-
const mutation = parseMutation(entry.payload);
|
|
14
|
-
this.apply(mutation);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
get(runId) {
|
|
18
|
-
const decision = this.byRun.get(runId);
|
|
19
|
-
return decision ? structuredClone(decision) : null;
|
|
20
|
-
}
|
|
21
|
-
findByIdempotency(runId, idempotency) {
|
|
22
|
-
const binding = decisionBinding(this.journal.options.partition, runId, idempotency);
|
|
23
|
-
if (!binding)
|
|
24
|
-
return null;
|
|
25
|
-
const prior = this.byKey.get(binding.keyDigest);
|
|
26
|
-
if (!prior)
|
|
27
|
-
return null;
|
|
28
|
-
if (prior.requestDigest !== binding.requestDigest)
|
|
29
|
-
throw conflict();
|
|
30
|
-
const existing = this.byRun.get(prior.runId);
|
|
31
|
-
if (!existing)
|
|
32
|
-
throw new Error("operator decision idempotency index is dangling");
|
|
33
|
-
return structuredClone(existing);
|
|
34
|
-
}
|
|
35
|
-
record(input, idempotency) {
|
|
36
|
-
const decision = parseDecision(input);
|
|
37
|
-
const binding = decisionBinding(this.journal.options.partition, decision.runId, idempotency);
|
|
38
|
-
if (binding) {
|
|
39
|
-
const existing = this.findByIdempotency(decision.runId, idempotency);
|
|
40
|
-
if (existing)
|
|
41
|
-
return { record: existing, reused: true };
|
|
42
|
-
}
|
|
43
|
-
const mutation = { decision, ...(binding ? { idempotency: binding } : {}) };
|
|
44
|
-
this.journal.append(RECORDED, mutation);
|
|
45
|
-
this.apply(mutation);
|
|
46
|
-
return { record: structuredClone(decision), reused: false };
|
|
47
|
-
}
|
|
48
|
-
validateProjection() {
|
|
49
|
-
for (const decision of this.byRun.values())
|
|
50
|
-
parseDecision(decision);
|
|
51
|
-
for (const binding of this.byKey.values()) {
|
|
52
|
-
if (!this.byRun.has(binding.runId))
|
|
53
|
-
throw new Error("operator decision idempotency index is dangling");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
apply(mutation) {
|
|
57
|
-
this.byRun.set(mutation.decision.runId, structuredClone(mutation.decision));
|
|
58
|
-
if (mutation.idempotency) {
|
|
59
|
-
const { keyDigest, requestDigest, runId } = mutation.idempotency;
|
|
60
|
-
const prior = this.byKey.get(keyDigest);
|
|
61
|
-
if (prior && (prior.requestDigest !== requestDigest || prior.runId !== runId)) {
|
|
62
|
-
throw new Error("conflicting operator decision idempotency history");
|
|
63
|
-
}
|
|
64
|
-
this.byKey.set(keyDigest, { requestDigest, runId });
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
export function operatorDecisionProjection() {
|
|
69
|
-
return {
|
|
70
|
-
name: "operator-decisions",
|
|
71
|
-
create: (journal) => new OperatorDecisionStore(journal),
|
|
72
|
-
validate: (store) => store.validateProjection(),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function parseDecision(value) {
|
|
2
|
+
export function parseOperatorDecision(value) {
|
|
76
3
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
77
4
|
throw new Error("invalid operator decision record");
|
|
78
5
|
}
|
|
@@ -90,14 +17,14 @@ function parseDecision(value) {
|
|
|
90
17
|
}
|
|
91
18
|
return structuredClone(input);
|
|
92
19
|
}
|
|
93
|
-
function
|
|
20
|
+
export function parseDecisionMutation(value) {
|
|
94
21
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
95
22
|
throw new Error("invalid operator decision mutation");
|
|
96
23
|
}
|
|
97
24
|
const input = value;
|
|
98
25
|
// Accept the pre-idempotency v2 record shape while the release candidate is local-only.
|
|
99
26
|
if (!("decision" in input))
|
|
100
|
-
return { decision:
|
|
27
|
+
return { decision: parseOperatorDecision(value) };
|
|
101
28
|
const idempotency = input["idempotency"];
|
|
102
29
|
if (idempotency !== undefined &&
|
|
103
30
|
(!idempotency ||
|
|
@@ -109,11 +36,11 @@ function parseMutation(value) {
|
|
|
109
36
|
throw new Error("invalid operator decision idempotency binding");
|
|
110
37
|
}
|
|
111
38
|
return {
|
|
112
|
-
decision:
|
|
39
|
+
decision: parseOperatorDecision(input["decision"]),
|
|
113
40
|
...(idempotency ? { idempotency: { ...idempotency } } : {}),
|
|
114
41
|
};
|
|
115
42
|
}
|
|
116
|
-
function
|
|
43
|
+
export function operatorDecisionBinding(partition, runId, input) {
|
|
117
44
|
if (!input)
|
|
118
45
|
return undefined;
|
|
119
46
|
if (!input.key || input.key.length > 256) {
|
|
@@ -133,12 +60,6 @@ function decisionBinding(partition, runId, input) {
|
|
|
133
60
|
runId,
|
|
134
61
|
};
|
|
135
62
|
}
|
|
136
|
-
function conflict() {
|
|
137
|
-
return Object.assign(new Error("idempotency key was already used with a different request"), {
|
|
138
|
-
code: "idempotency_conflict",
|
|
139
|
-
status: 409,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
63
|
function stringArray(value) {
|
|
143
64
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
144
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator-decisions.js","sourceRoot":"","sources":["../src/operator-decisions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operator-decisions.js","sourceRoot":"","sources":["../src/operator-decisions.ts"],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;QACtC,KAAK;KACN,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/projects.d.ts
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private readonly projects;
|
|
7
|
-
private readonly projectIdByRoot;
|
|
8
|
-
private readonly registrationByKey;
|
|
9
|
-
constructor(journal: DurableJournal);
|
|
10
|
-
list(): Project[];
|
|
11
|
-
get(id: string): Project | undefined;
|
|
12
|
-
findByRoot(root: string): Project | undefined;
|
|
13
|
-
/** F3 nested-project disclosure: every registered project whose
|
|
14
|
-
* root overlaps `id`'s root — `inside` when `id` lives under it, `contains`
|
|
15
|
-
* when it lives under `id`. Pure projection over current roots (recomputed as
|
|
16
|
-
* the registry changes), never a refusal — legit monorepos nest. */
|
|
17
|
-
nestingFor(id: string): Array<{
|
|
18
|
-
relation: "inside" | "contains";
|
|
19
|
-
root: string;
|
|
20
|
-
projectId: string;
|
|
21
|
-
}>;
|
|
22
|
-
register(input: {
|
|
23
|
-
root: string;
|
|
24
|
-
idempotencyKey: string;
|
|
25
|
-
clientId: string;
|
|
26
|
-
}): Project;
|
|
27
|
-
relink(id: string, rootInput: string): Project;
|
|
28
|
-
/** F2 ghost-cleanup: retire a registered project — used by the
|
|
29
|
-
* daemon sweep to unregister ghosts whose root is inside the Claudexor
|
|
30
|
-
* runtime tree or permanently gone. Removes the registry entry, its root
|
|
31
|
-
* index, and any idempotency bindings pointing at it, in ONE locked write. */
|
|
32
|
-
unregister(id: string): Project | undefined;
|
|
33
|
-
validateProjection(): void;
|
|
34
|
-
private replay;
|
|
35
|
-
private commit;
|
|
36
|
-
private apply;
|
|
1
|
+
import { type Project, type ProjectNesting } from "@claudexor/schema";
|
|
2
|
+
interface RegistrationBinding {
|
|
3
|
+
keyDigest: string;
|
|
4
|
+
requestDigest: string;
|
|
5
|
+
projectId: string;
|
|
37
6
|
}
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
7
|
+
export interface ProjectMutation {
|
|
8
|
+
project: Project;
|
|
9
|
+
registration?: RegistrationBinding;
|
|
10
|
+
}
|
|
11
|
+
/** A registration's answer: the project, and whether THIS registration created
|
|
12
|
+
* it. Derived from journal order on replay, so a key replay after a restart
|
|
13
|
+
* still repeats its original answer. */
|
|
14
|
+
export interface RegisterProject {
|
|
15
|
+
root: string;
|
|
16
|
+
idempotencyKey: string;
|
|
17
|
+
clientId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ProjectRegistration {
|
|
20
|
+
project: Project;
|
|
21
|
+
created: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function canonicalRoot(input: string): string;
|
|
24
|
+
/** F2 ghost-project guard: a project root inside the Claudexor
|
|
25
|
+
* runtime tree (`~/.claudexor`, esp. the `projects/<digest>/workspaces/`
|
|
26
|
+
* envelope worktrees) is daemon runtime state, never a user project — refuse it at
|
|
27
|
+
* registration/relink with a typed error so an envelope cwd can never become a
|
|
28
|
+
* durable ghost whose root later vanishes. */
|
|
29
|
+
export declare function assertNotClaudexorOwned(root: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Every project's nesting relations in one pass. A root can only lie inside
|
|
32
|
+
* its own ancestors, so each root looks up just its ancestor chain in an index
|
|
33
|
+
* of resolved roots (the same normalization `relative` applies, case-folded
|
|
34
|
+
* where the platform's paths are) instead of testing every other project:
|
|
35
|
+
* O(projects × path depth) predicate tests plus sorting each project's relations
|
|
36
|
+
* (Σ Kᵢ log Kᵢ); only a deep chain of nested roots makes the OUTPUT itself quadratic.
|
|
37
|
+
* Each candidate pair is still decided by `pathStrictlyInside` (`inside`), and
|
|
38
|
+
* ties keep the iteration order, so the answer equals per-project `nestingFor`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function projectNesting(projects: readonly Project[], inside?: (child: string, parent: string) => boolean): Map<string, ProjectNesting[]>;
|
|
41
|
+
export declare function parseMutation(value: unknown): ProjectMutation;
|
|
42
|
+
export declare function validateKey(key: string): void;
|
|
43
|
+
export {};
|
|
43
44
|
//# sourceMappingURL=projects.d.ts.map
|
package/dist/projects.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGhG,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED;;wCAEwC;AACxC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAanD;AAED;;;;8CAI8C;AAC9C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAS1D;AASD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,MAAM,GAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAA4B,GACtE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CA6B/B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAmB7D;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAO7C"}
|
package/dist/projects.js
CHANGED
|
@@ -1,179 +1,8 @@
|
|
|
1
1
|
import { lstatSync, realpathSync } from "node:fs";
|
|
2
|
-
import { isAbsolute, relative } from "node:path";
|
|
3
|
-
import { Project as ProjectSchema
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const RELINKED = "project.relinked";
|
|
7
|
-
const UNREGISTERED = "project.unregistered";
|
|
8
|
-
/** Global-journal authority for the deliberately empty v2 project registry. */
|
|
9
|
-
export class ProjectStore {
|
|
10
|
-
journal;
|
|
11
|
-
projects = new Map();
|
|
12
|
-
projectIdByRoot = new Map();
|
|
13
|
-
registrationByKey = new Map();
|
|
14
|
-
constructor(journal) {
|
|
15
|
-
this.journal = journal;
|
|
16
|
-
this.replay();
|
|
17
|
-
}
|
|
18
|
-
list() {
|
|
19
|
-
return [...this.projects.values()].sort((a, b) => a.created_at.localeCompare(b.created_at));
|
|
20
|
-
}
|
|
21
|
-
get(id) {
|
|
22
|
-
return this.projects.get(id);
|
|
23
|
-
}
|
|
24
|
-
findByRoot(root) {
|
|
25
|
-
const id = this.projectIdByRoot.get(canonicalRoot(root));
|
|
26
|
-
return id ? this.projects.get(id) : undefined;
|
|
27
|
-
}
|
|
28
|
-
/** F3 nested-project disclosure: every registered project whose
|
|
29
|
-
* root overlaps `id`'s root — `inside` when `id` lives under it, `contains`
|
|
30
|
-
* when it lives under `id`. Pure projection over current roots (recomputed as
|
|
31
|
-
* the registry changes), never a refusal — legit monorepos nest. */
|
|
32
|
-
nestingFor(id) {
|
|
33
|
-
const self = this.projects.get(id);
|
|
34
|
-
if (!self)
|
|
35
|
-
return [];
|
|
36
|
-
const relations = [];
|
|
37
|
-
for (const other of this.projects.values()) {
|
|
38
|
-
if (other.id === id)
|
|
39
|
-
continue;
|
|
40
|
-
if (pathStrictlyInside(self.root, other.root))
|
|
41
|
-
relations.push({ relation: "inside", root: other.root, projectId: other.id });
|
|
42
|
-
else if (pathStrictlyInside(other.root, self.root))
|
|
43
|
-
relations.push({ relation: "contains", root: other.root, projectId: other.id });
|
|
44
|
-
}
|
|
45
|
-
return relations.sort((a, b) => a.root.localeCompare(b.root));
|
|
46
|
-
}
|
|
47
|
-
register(input) {
|
|
48
|
-
validateKey(input.idempotencyKey);
|
|
49
|
-
const root = canonicalRoot(input.root);
|
|
50
|
-
assertNotClaudexorOwned(root);
|
|
51
|
-
const keyDigest = hashJson({
|
|
52
|
-
client: input.clientId,
|
|
53
|
-
partition: "global",
|
|
54
|
-
operation: "project.register",
|
|
55
|
-
key: input.idempotencyKey,
|
|
56
|
-
});
|
|
57
|
-
const requestDigest = hashJson({ root });
|
|
58
|
-
const prior = this.registrationByKey.get(keyDigest);
|
|
59
|
-
if (prior) {
|
|
60
|
-
if (prior.requestDigest !== requestDigest)
|
|
61
|
-
throw conflict();
|
|
62
|
-
const project = this.projects.get(prior.projectId);
|
|
63
|
-
if (!project)
|
|
64
|
-
throw new Error("project registration points to a missing project");
|
|
65
|
-
return project;
|
|
66
|
-
}
|
|
67
|
-
const existingId = this.projectIdByRoot.get(root);
|
|
68
|
-
const existing = existingId ? this.projects.get(existingId) : undefined;
|
|
69
|
-
const now = nowIso();
|
|
70
|
-
const project = existing ??
|
|
71
|
-
ProjectSchema.parse({
|
|
72
|
-
schema_version: SCHEMA_VERSION,
|
|
73
|
-
id: newId("prj"),
|
|
74
|
-
root,
|
|
75
|
-
created_at: now,
|
|
76
|
-
updated_at: now,
|
|
77
|
-
});
|
|
78
|
-
this.commit(REGISTERED, {
|
|
79
|
-
project,
|
|
80
|
-
registration: { keyDigest, requestDigest, projectId: project.id },
|
|
81
|
-
});
|
|
82
|
-
return project;
|
|
83
|
-
}
|
|
84
|
-
relink(id, rootInput) {
|
|
85
|
-
const current = this.projects.get(id);
|
|
86
|
-
if (!current)
|
|
87
|
-
throw Object.assign(new Error(`no such project: ${id}`), { status: 404 });
|
|
88
|
-
const root = canonicalRoot(rootInput);
|
|
89
|
-
assertNotClaudexorOwned(root);
|
|
90
|
-
const owner = this.projectIdByRoot.get(root);
|
|
91
|
-
if (owner && owner !== id) {
|
|
92
|
-
throw Object.assign(new Error(`project root is already registered to ${owner}`), {
|
|
93
|
-
code: "project_root_conflict",
|
|
94
|
-
status: 409,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
if (root === current.root)
|
|
98
|
-
return current;
|
|
99
|
-
const project = ProjectSchema.parse({ ...current, root, updated_at: nowIso() });
|
|
100
|
-
this.commit(RELINKED, { project });
|
|
101
|
-
return project;
|
|
102
|
-
}
|
|
103
|
-
/** F2 ghost-cleanup: retire a registered project — used by the
|
|
104
|
-
* daemon sweep to unregister ghosts whose root is inside the Claudexor
|
|
105
|
-
* runtime tree or permanently gone. Removes the registry entry, its root
|
|
106
|
-
* index, and any idempotency bindings pointing at it, in ONE locked write. */
|
|
107
|
-
unregister(id) {
|
|
108
|
-
const project = this.projects.get(id);
|
|
109
|
-
if (!project)
|
|
110
|
-
return undefined;
|
|
111
|
-
this.commit(UNREGISTERED, { project });
|
|
112
|
-
return project;
|
|
113
|
-
}
|
|
114
|
-
validateProjection() {
|
|
115
|
-
for (const project of this.projects.values())
|
|
116
|
-
ProjectSchema.parse(project);
|
|
117
|
-
if (this.projectIdByRoot.size !== this.projects.size) {
|
|
118
|
-
throw new Error("project registry contains duplicate roots");
|
|
119
|
-
}
|
|
120
|
-
for (const binding of this.registrationByKey.values()) {
|
|
121
|
-
if (!this.projects.has(binding.projectId)) {
|
|
122
|
-
throw new Error("project registration idempotency index is dangling");
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
replay() {
|
|
127
|
-
for (const record of this.journal.records(0, [REGISTERED, RELINKED, UNREGISTERED])) {
|
|
128
|
-
if (record.type !== REGISTERED && record.type !== RELINKED && record.type !== UNREGISTERED)
|
|
129
|
-
continue;
|
|
130
|
-
this.apply(record.type, parseMutation(record.payload));
|
|
131
|
-
}
|
|
132
|
-
this.validateProjection();
|
|
133
|
-
}
|
|
134
|
-
commit(type, mutation) {
|
|
135
|
-
const parsed = parseMutation(mutation);
|
|
136
|
-
this.journal.append(type, parsed);
|
|
137
|
-
this.apply(type, parsed);
|
|
138
|
-
}
|
|
139
|
-
apply(type, mutation) {
|
|
140
|
-
if (type === UNREGISTERED) {
|
|
141
|
-
this.projects.delete(mutation.project.id);
|
|
142
|
-
if (this.projectIdByRoot.get(mutation.project.root) === mutation.project.id)
|
|
143
|
-
this.projectIdByRoot.delete(mutation.project.root);
|
|
144
|
-
for (const [keyDigest, binding] of this.registrationByKey) {
|
|
145
|
-
if (binding.projectId === mutation.project.id)
|
|
146
|
-
this.registrationByKey.delete(keyDigest);
|
|
147
|
-
}
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const previous = this.projects.get(mutation.project.id);
|
|
151
|
-
if (previous && previous.root !== mutation.project.root)
|
|
152
|
-
this.projectIdByRoot.delete(previous.root);
|
|
153
|
-
const rootOwner = this.projectIdByRoot.get(mutation.project.root);
|
|
154
|
-
if (rootOwner && rootOwner !== mutation.project.id) {
|
|
155
|
-
throw new Error("conflicting project root history");
|
|
156
|
-
}
|
|
157
|
-
this.projects.set(mutation.project.id, mutation.project);
|
|
158
|
-
this.projectIdByRoot.set(mutation.project.root, mutation.project.id);
|
|
159
|
-
if (mutation.registration) {
|
|
160
|
-
const { keyDigest, requestDigest, projectId } = mutation.registration;
|
|
161
|
-
const prior = this.registrationByKey.get(keyDigest);
|
|
162
|
-
if (prior && (prior.requestDigest !== requestDigest || prior.projectId !== projectId)) {
|
|
163
|
-
throw new Error("conflicting project registration history");
|
|
164
|
-
}
|
|
165
|
-
this.registrationByKey.set(keyDigest, { requestDigest, projectId });
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
export function projectProjection() {
|
|
170
|
-
return {
|
|
171
|
-
name: "projects",
|
|
172
|
-
create: (journal) => new ProjectStore(journal),
|
|
173
|
-
validate: (store) => store.validateProjection(),
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function canonicalRoot(input) {
|
|
2
|
+
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
3
|
+
import { Project as ProjectSchema } from "@claudexor/schema";
|
|
4
|
+
import { isClaudexorOwnedRuntimePath } from "@claudexor/util";
|
|
5
|
+
export function canonicalRoot(input) {
|
|
177
6
|
if (!isAbsolute(input))
|
|
178
7
|
throw Object.assign(new Error("project root must be absolute"), { status: 400 });
|
|
179
8
|
let root;
|
|
@@ -193,7 +22,7 @@ function canonicalRoot(input) {
|
|
|
193
22
|
* envelope worktrees) is daemon runtime state, never a user project — refuse it at
|
|
194
23
|
* registration/relink with a typed error so an envelope cwd can never become a
|
|
195
24
|
* durable ghost whose root later vanishes. */
|
|
196
|
-
function assertNotClaudexorOwned(root) {
|
|
25
|
+
export function assertNotClaudexorOwned(root) {
|
|
197
26
|
if (isClaudexorOwnedRuntimePath(root)) {
|
|
198
27
|
throw Object.assign(new Error(`project root is inside the Claudexor runtime tree and cannot be registered as a project: ${root}`), { code: "claudexor_owned_root", status: 400 });
|
|
199
28
|
}
|
|
@@ -204,7 +33,46 @@ function pathStrictlyInside(child, parent) {
|
|
|
204
33
|
const rel = relative(parent, child);
|
|
205
34
|
return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
|
|
206
35
|
}
|
|
207
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Every project's nesting relations in one pass. A root can only lie inside
|
|
38
|
+
* its own ancestors, so each root looks up just its ancestor chain in an index
|
|
39
|
+
* of resolved roots (the same normalization `relative` applies, case-folded
|
|
40
|
+
* where the platform's paths are) instead of testing every other project:
|
|
41
|
+
* O(projects × path depth) predicate tests plus sorting each project's relations
|
|
42
|
+
* (Σ Kᵢ log Kᵢ); only a deep chain of nested roots makes the OUTPUT itself quadratic.
|
|
43
|
+
* Each candidate pair is still decided by `pathStrictlyInside` (`inside`), and
|
|
44
|
+
* ties keep the iteration order, so the answer equals per-project `nestingFor`.
|
|
45
|
+
*/
|
|
46
|
+
export function projectNesting(projects, inside = pathStrictlyInside) {
|
|
47
|
+
const key = (root) => process.platform === "win32" ? resolve(root).toLowerCase() : resolve(root);
|
|
48
|
+
const order = new Map(projects.map((project, index) => [project.id, index]));
|
|
49
|
+
const byRoot = new Map();
|
|
50
|
+
for (const project of projects) {
|
|
51
|
+
const owners = byRoot.get(key(project.root));
|
|
52
|
+
if (owners)
|
|
53
|
+
owners.push(project);
|
|
54
|
+
else
|
|
55
|
+
byRoot.set(key(project.root), [project]);
|
|
56
|
+
}
|
|
57
|
+
const relations = new Map(projects.map((project) => [project.id, []]));
|
|
58
|
+
const add = (to, relation, other) => relations.get(to.id).push({ relation, root: other.root, projectId: other.id });
|
|
59
|
+
for (const child of projects) {
|
|
60
|
+
let dir = resolve(child.root);
|
|
61
|
+
for (let parent = dirname(dir); parent !== dir; dir = parent, parent = dirname(dir)) {
|
|
62
|
+
for (const owner of byRoot.get(key(parent)) ?? []) {
|
|
63
|
+
if (owner.id === child.id || !inside(child.root, owner.root))
|
|
64
|
+
continue;
|
|
65
|
+
add(child, "inside", owner);
|
|
66
|
+
add(owner, "contains", child);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
for (const list of relations.values()) {
|
|
71
|
+
list.sort((a, b) => a.root.localeCompare(b.root) || order.get(a.projectId) - order.get(b.projectId));
|
|
72
|
+
}
|
|
73
|
+
return relations;
|
|
74
|
+
}
|
|
75
|
+
export function parseMutation(value) {
|
|
208
76
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
209
77
|
throw new Error("invalid project mutation");
|
|
210
78
|
}
|
|
@@ -222,7 +90,7 @@ function parseMutation(value) {
|
|
|
222
90
|
...(registration ? { registration: { ...registration } } : {}),
|
|
223
91
|
};
|
|
224
92
|
}
|
|
225
|
-
function validateKey(key) {
|
|
93
|
+
export function validateKey(key) {
|
|
226
94
|
if (!key || key.length > 256) {
|
|
227
95
|
throw Object.assign(new Error("Idempotency-Key must contain 1-256 characters"), {
|
|
228
96
|
code: "invalid_idempotency_key",
|
|
@@ -230,10 +98,4 @@ function validateKey(key) {
|
|
|
230
98
|
});
|
|
231
99
|
}
|
|
232
100
|
}
|
|
233
|
-
function conflict() {
|
|
234
|
-
return Object.assign(new Error("idempotency key was already used with a different request"), {
|
|
235
|
-
code: "idempotency_conflict",
|
|
236
|
-
status: 409,
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
101
|
//# sourceMappingURL=projects.js.map
|
package/dist/projects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAqC,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AA2B9D,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACpB,MAAM,MA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,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACxC,IACE,YAAY,KAAK,SAAS;QAC1B,CAAC,CAAC,YAAY;YACZ,OAAO,YAAY,CAAC,SAAS,KAAK,QAAQ;YAC1C,OAAO,YAAY,CAAC,aAAa,KAAK,QAAQ;YAC9C,OAAO,YAAY,CAAC,SAAS,KAAK,QAAQ,CAAC,EAC7C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO;QACL,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAC3C,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,GAAG,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QAC7B,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,EAAE;YAC9E,IAAI,EAAE,yBAAyB;YAC/B,MAAM,EAAE,GAAG;SACZ,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EventLedger } from "./store-contracts.js";
|
|
2
2
|
import { QuotaWindowSupersession, type QuotaSnapshot, type AccountResourceObservation, type AccountTarget } from "@claudexor/schema";
|
|
3
3
|
export declare const RESOURCES_INVALIDATED = "quota.resources.invalidated";
|
|
4
4
|
export declare const RESOURCES_OBSERVED = "quota.resources.observed";
|
|
@@ -6,7 +6,7 @@ export declare const WINDOW_SUPERSEDED = "quota.window.superseded";
|
|
|
6
6
|
export declare const REMOVED = "quota.subject.removed";
|
|
7
7
|
export declare const PROJECTION_UPDATED = "quota.projection.updated";
|
|
8
8
|
/** Replay is part of QuotaRegistry's existing journal projection, not another store. */
|
|
9
|
-
export declare function replayQuotaJournal(journal:
|
|
9
|
+
export declare function replayQuotaJournal(journal: EventLedger, owner: {
|
|
10
10
|
apply: (snapshot: QuotaSnapshot) => void;
|
|
11
11
|
applyWindowSupersession: (value: QuotaWindowSupersession) => void;
|
|
12
12
|
applyResources: (value: AccountResourceObservation) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-registry-replay.d.ts","sourceRoot":"","sources":["../src/quota-registry-replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"quota-registry-replay.d.ts","sourceRoot":"","sources":["../src/quota-registry-replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAKL,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AACnE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAG7D,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAE3D,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAC/C,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAY7D,wFAAwF;AACxF,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE;IACL,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,uBAAuB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAClE,cAAc,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC5D,mBAAmB,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1E;;;EA8FF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-registry-replay.js","sourceRoot":"","sources":["../src/quota-registry-replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,aAAa,IAAI,mBAAmB,EACpC,sBAAsB,EACtB,uBAAuB,GAIxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,6BAA6B,CAAC;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAC7D,MAAM,QAAQ,GAAG,yBAAyB,CAAC;AAC3C,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAC3D,MAAM,eAAe,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,uBAAuB,CAAC;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAC7D,MAAM,YAAY,GAAG;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,eAAe;IACf,QAAQ;IACR,eAAe;IACf,iBAAiB;IACjB,OAAO;IACP,kBAAkB;CACnB,CAAC;AAEF,wFAAwF;AACxF,MAAM,UAAU,kBAAkB,CAChC,
|
|
1
|
+
{"version":3,"file":"quota-registry-replay.js","sourceRoot":"","sources":["../src/quota-registry-replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,aAAa,IAAI,mBAAmB,EACpC,sBAAsB,EACtB,uBAAu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YACD,sBAAsB,GAAG,IAAI,CAAC;QAChC,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACvC,MAAM,OAAO,GAAG,MAAM,CAAC,OAA6C,CAAC;YACrE,mBAAmB;gBACjB,OAAO,OAAO,CAAC,oBAAoB,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC;YACzF,sBAAsB,GAAG,KAAK,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* keying, freshness aging, and expired scoped-cooldown pruning. No registry
|
|
5
5
|
* state lives here.
|
|
6
6
|
*/
|
|
7
|
-
import { type CredentialRoute, type HarnessEvent, type QuotaConstraint, type QuotaSnapshot, type QuotaSource } from "@claudexor/schema";
|
|
7
|
+
import { type CredentialRoute, type HarnessEvent, type QuotaConstraint, type ControlQuotaFreshnessSnapshot, type QuotaSnapshot, type QuotaSource } from "@claudexor/schema";
|
|
8
8
|
/** The reactive vendor-limit cooldown snapshot for a harness event: the
|
|
9
9
|
* existing subject's constraints minus the superseded/expired cooldown, plus
|
|
10
10
|
* the new bounded cooldown window. Pure: the registry finds `existing`. */
|
|
@@ -20,6 +20,9 @@ export declare function reactiveCooldownSnapshot(input: {
|
|
|
20
20
|
* weekly cooldown/reset seen once) is kept and stale-marked: pruning it
|
|
21
21
|
* would hide a live cap from both the footer and the router's ledger. */
|
|
22
22
|
export declare function activeQuotaSnapshots(snapshots: readonly QuotaSnapshot[], now: number): QuotaSnapshot[];
|
|
23
|
+
/** Passive display projection. Apply the SAME aging rule to each singleton
|
|
24
|
+
* window using raw freshness, before aggregate aging can erase that evidence. */
|
|
25
|
+
export declare function activeQuotaSnapshotsWithConstraintFreshness(snapshots: readonly QuotaSnapshot[], now: number): ControlQuotaFreshnessSnapshot[];
|
|
23
26
|
export declare const QUOTA_FRESHNESS_TTL_MS: number;
|
|
24
27
|
/** Same quota EVIDENCE: everything but the observation time (a freshness flip
|
|
25
28
|
* is evidence). A poll that only re-observed unchanged evidence keeps the fresh
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-registry-support.d.ts","sourceRoot":"","sources":["../src/quota-registry-support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EASL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAG3B;;2EAE2E;AAC3E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;CACrC,EACD,GAAG,EAAE,IAAI,GACR,aAAa,CAyCf;AAMD;;;yEAGyE;AACzE,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,aAAa,EAAE,EACnC,GAAG,EAAE,MAAM,GACV,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"quota-registry-support.d.ts","sourceRoot":"","sources":["../src/quota-registry-support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EASL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAG3B;;2EAE2E;AAC3E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,aAA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