@claudexor/daemon 3.24.0 → 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 +39 -0
- package/dist/account-resets.d.ts.map +1 -0
- package/dist/account-resets.js +174 -0
- package/dist/account-resets.js.map +1 -0
- 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 -117
- 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 +24 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -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/job-record.d.ts.map +1 -1
- package/dist/job-record.js +5 -1
- package/dist/job-record.js.map +1 -1
- package/dist/journal-fold-policy.d.ts +1 -1
- package/dist/journal-fold-policy.d.ts.map +1 -1
- package/dist/journal-fold-policy.js +26 -2
- package/dist/journal-fold-policy.js.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-poll-lanes.d.ts +5 -3
- package/dist/quota-poll-lanes.d.ts.map +1 -1
- package/dist/quota-poll-lanes.js +16 -6
- package/dist/quota-poll-lanes.js.map +1 -1
- package/dist/quota-refresh-batches.d.ts +26 -0
- package/dist/quota-refresh-batches.d.ts.map +1 -0
- package/dist/quota-refresh-batches.js +83 -0
- package/dist/quota-refresh-batches.js.map +1 -0
- package/dist/quota-registry-replay.d.ts +19 -0
- package/dist/quota-registry-replay.d.ts.map +1 -0
- package/dist/quota-registry-replay.js +106 -0
- package/dist/quota-registry-replay.js.map +1 -0
- 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 +381 -7
- package/dist/quota-registry.d.ts.map +1 -1
- package/dist/quota-registry.js +111 -149
- package/dist/quota-registry.js.map +1 -1
- package/dist/quota-resources.d.ts +105 -0
- package/dist/quota-resources.d.ts.map +1 -0
- package/dist/quota-resources.js +153 -0
- package/dist/quota-resources.js.map +1 -0
- 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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { RESOURCES_OBSERVED } from "./quota-registry-replay.js";
|
|
2
|
+
import { sha256 } from "@claudexor/util";
|
|
3
|
+
import { activeQuotaSnapshots, activeQuotaSnapshotsWithConstraintFreshness, } from "./quota-registry-support.js";
|
|
4
|
+
import { ACCOUNT_RESOURCE_FACETS, AccountResourceSnapshot, ControlQuotaFreshnessResponse, emptyResourceFacet, } from "@claudexor/schema";
|
|
5
|
+
export const resourceKey = (target) => JSON.stringify([target.harness, target.profile_id]);
|
|
6
|
+
export function emptyResources(target) {
|
|
7
|
+
return {
|
|
8
|
+
target,
|
|
9
|
+
balances: emptyResourceFacet(),
|
|
10
|
+
spending: emptyResourceFacet(),
|
|
11
|
+
resets: emptyResourceFacet(),
|
|
12
|
+
diagnostics: emptyResourceFacet(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Merge independently observed facets. A failed read preserves the successful
|
|
16
|
+
* observation, including its original source and clock. */
|
|
17
|
+
export function mergeResources(prior, update) {
|
|
18
|
+
const result = structuredClone(prior ?? emptyResources(update.target));
|
|
19
|
+
for (const key of ACCOUNT_RESOURCE_FACETS) {
|
|
20
|
+
const next = update[key];
|
|
21
|
+
if (!next)
|
|
22
|
+
continue;
|
|
23
|
+
const old = result[key];
|
|
24
|
+
if (next.last_attempt_at && old.last_attempt_at && next.last_attempt_at < old.last_attempt_at)
|
|
25
|
+
continue;
|
|
26
|
+
if (key === "resets" && update.resets?.value && result.resets.value) {
|
|
27
|
+
const reported = new Set(update.resets.value.map((offer) => offer.id));
|
|
28
|
+
const resolved = new Set(update.resets_resolved_ids ?? []);
|
|
29
|
+
const retained = result.resets.value.filter((offer) => !reported.has(offer.id) && !resolved.has(offer.id));
|
|
30
|
+
if (retained.length) {
|
|
31
|
+
result.resets = {
|
|
32
|
+
...update.resets,
|
|
33
|
+
value: [...update.resets.value, ...retained],
|
|
34
|
+
freshness: "stale",
|
|
35
|
+
observed_at: result.resets.observed_at,
|
|
36
|
+
};
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
Object.assign(result, {
|
|
41
|
+
[key]: next.value === null
|
|
42
|
+
? {
|
|
43
|
+
...old,
|
|
44
|
+
last_attempt_at: next.last_attempt_at,
|
|
45
|
+
last_error: next.last_error,
|
|
46
|
+
freshness: old.value === null ? "unknown" : "stale",
|
|
47
|
+
}
|
|
48
|
+
: next,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
export function ageResources(snapshot, now) {
|
|
54
|
+
const result = structuredClone(snapshot);
|
|
55
|
+
for (const key of ACCOUNT_RESOURCE_FACETS) {
|
|
56
|
+
const facet = result[key];
|
|
57
|
+
if (facet.value === null)
|
|
58
|
+
facet.freshness = "unknown";
|
|
59
|
+
else if (facet.last_error !== null ||
|
|
60
|
+
facet.observed_at === null ||
|
|
61
|
+
now - Date.parse(facet.observed_at) >= 300_000)
|
|
62
|
+
facet.freshness = "stale";
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
export function resourceSnapshots(values, cutoffs, now) {
|
|
67
|
+
return [...values].map((value) => {
|
|
68
|
+
const row = ageResources(value, now);
|
|
69
|
+
const cutoff = cutoffs.get(resourceKey(row.target));
|
|
70
|
+
if (cutoff)
|
|
71
|
+
for (const facet of ACCOUNT_RESOURCE_FACETS) {
|
|
72
|
+
if (row[facet].value !== null &&
|
|
73
|
+
(!row[facet].observed_at || row[facet].observed_at < cutoff))
|
|
74
|
+
row[facet].freshness = "stale";
|
|
75
|
+
}
|
|
76
|
+
return row;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function beforeResourceCutoff(snapshot, cutoffs) {
|
|
80
|
+
const subject = snapshot.subject;
|
|
81
|
+
const cutoff = subject.subject_id === null
|
|
82
|
+
? undefined
|
|
83
|
+
: cutoffs.get(resourceKey({ harness: subject.harness, profile_id: subject.subject_id }));
|
|
84
|
+
return Boolean(cutoff && snapshot.observed_at < cutoff);
|
|
85
|
+
}
|
|
86
|
+
export function resourceQuotaSnapshots(values, cutoffs, now) {
|
|
87
|
+
return activeQuotaSnapshots([...values], now).map((snapshot) => beforeResourceCutoff(snapshot, cutoffs) ? { ...snapshot, freshness: "stale" } : snapshot);
|
|
88
|
+
}
|
|
89
|
+
/** The opt-in display read: evidence observed before an account reset is
|
|
90
|
+
* historical for every window, exactly as for the aggregate snapshot. */
|
|
91
|
+
export function quotaFreshnessRead(values, cutoffs, absences, now) {
|
|
92
|
+
const snapshots = activeQuotaSnapshotsWithConstraintFreshness([...values.values()], now);
|
|
93
|
+
return ControlQuotaFreshnessResponse.parse({
|
|
94
|
+
snapshots: snapshots.map((snapshot) => beforeResourceCutoff(snapshot, cutoffs)
|
|
95
|
+
? {
|
|
96
|
+
...snapshot,
|
|
97
|
+
freshness: "stale",
|
|
98
|
+
constraints: snapshot.constraints.map((item) => ({ ...item, freshness: "stale" })),
|
|
99
|
+
}
|
|
100
|
+
: snapshot),
|
|
101
|
+
absences,
|
|
102
|
+
refreshed_at: null,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export function quotaProjectionSignature(response, resources) {
|
|
106
|
+
// refreshed_at is request metadata, not projection identity. Snapshot
|
|
107
|
+
// freshness and absence coverage are logical facts and remain included.
|
|
108
|
+
// The marker carries the digest, never the projection: consumers only
|
|
109
|
+
// compare signatures for equality (a legacy JSON-string marker simply
|
|
110
|
+
// differs once, publishing one extra clock-transition marker).
|
|
111
|
+
return sha256(JSON.stringify({
|
|
112
|
+
snapshots: response.snapshots,
|
|
113
|
+
absences: response.absences,
|
|
114
|
+
...(resources.length ? { resources } : {}),
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
/** The journal order disambiguates observations sharing a millisecond with
|
|
118
|
+
* reset. Existing facts become historical; a later successful read may renew
|
|
119
|
+
* them at the same clock tick. The timestamp floor also covers late old polls. */
|
|
120
|
+
export function retireAccountResourceEvidence(target, at, cutoffs, snapshots, resources) {
|
|
121
|
+
const key = resourceKey(target);
|
|
122
|
+
cutoffs.set(key, at);
|
|
123
|
+
for (const [id, snapshot] of snapshots) {
|
|
124
|
+
if (snapshot.subject.harness === target.harness &&
|
|
125
|
+
snapshot.subject.subject_id === target.profile_id)
|
|
126
|
+
snapshots.set(id, { ...snapshot, freshness: "stale" });
|
|
127
|
+
}
|
|
128
|
+
const row = resources.get(key);
|
|
129
|
+
if (row) {
|
|
130
|
+
const retired = structuredClone(row);
|
|
131
|
+
for (const facet of ACCOUNT_RESOURCE_FACETS)
|
|
132
|
+
if (retired[facet].value !== null)
|
|
133
|
+
retired[facet].freshness = "stale";
|
|
134
|
+
resources.set(key, retired);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export function applyResourceObservation(resources, observation) {
|
|
138
|
+
const key = resourceKey(observation.target);
|
|
139
|
+
// Journal writes contain the completed merge. Re-merging a full snapshot
|
|
140
|
+
// would resurrect resolved-absent offers in an unfolded journal. Legacy
|
|
141
|
+
// partial payloads remain deltas; complete rows install exactly as written.
|
|
142
|
+
const snapshot = AccountResourceSnapshot.safeParse(observation);
|
|
143
|
+
resources.set(key, snapshot.success ? snapshot.data : mergeResources(resources.get(key), observation));
|
|
144
|
+
}
|
|
145
|
+
/** The existing quota journal stores a complete resource row so its fold slot
|
|
146
|
+
* cannot lose an older independently observed facet. */
|
|
147
|
+
export function recordAccountResourceObservation(journal, resources, observation) {
|
|
148
|
+
const key = resourceKey(observation.target);
|
|
149
|
+
const snapshot = mergeResources(resources.get(key), observation);
|
|
150
|
+
journal.append(RESOURCES_OBSERVED, { version: 1, observation: snapshot });
|
|
151
|
+
resources.set(key, snapshot);
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=quota-resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quota-resources.js","sourceRoot":"","sources":["../src/quota-resources.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,2CAA2C,GAC5C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,kBAAkB,GAKnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAqB,EAAE,EAAE,CACnD,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AACtD,MAAM,UAAU,cAAc,CAAC,MAAqB;IAClD,OAAO;QACL,MAAM;QACN,QAAQ,EAAE,kBAAkB,EAAE;QAC9B,QAAQ,EAAE,kBAAkB,EAAE;QAC9B,MAAM,EAAE,kBAAkB,EAAE;QAC5B,WAAW,EAAE,kBAAkB,EAAE;KAClC,CAAC;AACJ,CAAC;AACD;2DAC2D;A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F,CAAC;AACJ,CAAC;AACD;wDACwD;AACxD,MAAM,UAAU,gCAAgC,CAC9C,OAAoB,EACpB,SAA+C,EAC/C,WAAuC;IAEvC,MAAM,GAAG,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;IACjE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1E,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* command params are the replay source. A bound turn, or one that already
|
|
11
11
|
* carries a refusal, is never touched, so the pass is idempotent across starts.
|
|
12
12
|
*/
|
|
13
|
-
import type {
|
|
14
|
-
import type { ThreadStore } from "./threads.js";
|
|
13
|
+
import type { ProjectThreadPort } from "./store-contracts.js";
|
|
15
14
|
interface CommandRecordView {
|
|
16
15
|
state: string;
|
|
17
16
|
runId?: string;
|
|
@@ -19,12 +18,6 @@ interface CommandRecordView {
|
|
|
19
18
|
params?: unknown;
|
|
20
19
|
}
|
|
21
20
|
export declare const RESTARTED_BEFORE_START = "daemon_restarted_before_start";
|
|
22
|
-
export declare function recordInterruptedRunlessTurns(store: Pick<
|
|
23
|
-
/**
|
|
24
|
-
* Compose the recovery into a partition's thread projection. Registered after
|
|
25
|
-
* the command projection in the same journal manager, so its recovery runs
|
|
26
|
-
* after the commands were interrupted.
|
|
27
|
-
*/
|
|
28
|
-
export declare function withRunlessTurnRecovery(descriptor: JournalProjectionDescriptor<ThreadStore>, commandRecords: () => Iterable<CommandRecordView>): JournalProjectionDescriptor<ThreadStore>;
|
|
21
|
+
export declare function recordInterruptedRunlessTurns(store: Pick<ProjectThreadPort, "getTurn" | "setTurnEnqueueError">, records: Iterable<CommandRecordView>): number;
|
|
29
22
|
export {};
|
|
30
23
|
//# sourceMappingURL=runless-turn-recovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runless-turn-recovery.d.ts","sourceRoot":"","sources":["../src/runless-turn-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"runless-turn-recovery.d.ts","sourceRoot":"","sources":["../src/runless-turn-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,qBAAqB,CAAC,EACjE,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GACnC,MAAM,CAkBR"}
|
|
@@ -21,18 +21,4 @@ export function recordInterruptedRunlessTurns(store, records) {
|
|
|
21
21
|
}
|
|
22
22
|
return recorded;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Compose the recovery into a partition's thread projection. Registered after
|
|
26
|
-
* the command projection in the same journal manager, so its recovery runs
|
|
27
|
-
* after the commands were interrupted.
|
|
28
|
-
*/
|
|
29
|
-
export function withRunlessTurnRecovery(descriptor, commandRecords) {
|
|
30
|
-
return {
|
|
31
|
-
...descriptor,
|
|
32
|
-
recover: (store) => {
|
|
33
|
-
descriptor.recover?.(store);
|
|
34
|
-
recordInterruptedRunlessTurns(store, commandRecords());
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
24
|
//# sourceMappingURL=runless-turn-recovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runless-turn-recovery.js","sourceRoot":"","sources":["../src/runless-turn-recovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runless-turn-recovery.js","sourceRoot":"","sources":["../src/runless-turn-recovery.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,sBAAsB,GAAG,+BAA+B,CAAC;AAEtE,MAAM,UAAU,6BAA6B,CAC3C,KAAiE,EACjE,OAAoC;IAEpC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,KAAK,KAAK,aAAa,IAAI,MAAM,CAAC,KAAK;YAAE,SAAS;QAC7D,MAAM,MAAM,GAAI,MAAM,CAAC,MAA2C,EAAE,MAAM,CAAC;QAC3E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM;YAAE,SAAS;QACpD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa;YAAE,SAAS;QACzD,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE;YAChC,OAAO,EAAE,MAAM,CAAC,KAAK,IAAI,oEAAoE;YAC7F,IAAI,EAAE,sBAAsB;YAC5B,SAAS,EAAE,IAAI;YACf,gBAAgB,EAAE,CAAC,6DAA6D,CAAC;YACjF,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QACH,QAAQ,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type TurnEnqueueProblem as TurnEnqueueProblemValue, type CancelReasonCode, type RuntimeConcurrencyCaps } from "@claudexor/schema";
|
|
2
|
-
import { type
|
|
1
|
+
import { type TurnEnqueueProblem as TurnEnqueueProblemValue, type CancelReasonCode, type RuntimeConcurrencyCaps, type DaemonStoreFacts, type ConcurrencyLimit, type JobAdmission } from "@claudexor/schema";
|
|
2
|
+
import { type CommandBackend } from "./command-authority.js";
|
|
3
3
|
import { type DelegationAdmissionAuthority } from "./delegation-admission.js";
|
|
4
|
-
import {
|
|
4
|
+
import { jobStateFromResult, type JobRecord } from "./job-record.js";
|
|
5
5
|
import { type DaemonServingModeSnapshot } from "./serving-admission.js";
|
|
6
6
|
import { socketAlive } from "./socket-probe.js";
|
|
7
7
|
import { type RuntimeReplacementAuthority } from "./daemon-shutdown-rpc.js";
|
|
8
|
-
export {
|
|
8
|
+
export { jobStateFromResult, socketAlive, type JobRecord };
|
|
9
9
|
export interface RunContext {
|
|
10
10
|
jobId: string;
|
|
11
11
|
signal: AbortSignal;
|
|
@@ -20,10 +20,11 @@ export interface DaemonOptions extends RuntimeReplacementAuthority {
|
|
|
20
20
|
socketPath: string;
|
|
21
21
|
token: string;
|
|
22
22
|
runner: RunnerFn;
|
|
23
|
-
maxConcurrent?:
|
|
24
|
-
/** Startup-frozen strategy caps;
|
|
23
|
+
maxConcurrent?: ConcurrencyLimit;
|
|
24
|
+
/** Startup-frozen admission and strategy caps; omission has no finite admission ceiling. */
|
|
25
25
|
runtimeConcurrencyCaps?: RuntimeConcurrencyCaps;
|
|
26
|
-
|
|
26
|
+
storeFacts?: () => DaemonStoreFacts;
|
|
27
|
+
commands: CommandBackend;
|
|
27
28
|
delegationAuthority?: DelegationAdmissionAuthority;
|
|
28
29
|
maxHistory?: number;
|
|
29
30
|
idempotencyRetentionMs?: number;
|
|
@@ -54,11 +55,13 @@ export declare class DaemonServer {
|
|
|
54
55
|
private server?;
|
|
55
56
|
private readonly followers;
|
|
56
57
|
private readonly queue;
|
|
58
|
+
private readonly activeJobs;
|
|
57
59
|
private readonly cancelled;
|
|
58
60
|
private readonly controllers;
|
|
59
61
|
private readonly activeTasks;
|
|
60
62
|
private readonly taskFailures;
|
|
61
|
-
private
|
|
63
|
+
private readonly commands;
|
|
64
|
+
private get active();
|
|
62
65
|
private readonly startedAt;
|
|
63
66
|
private stopping;
|
|
64
67
|
private startPromise?;
|
|
@@ -69,14 +72,22 @@ export declare class DaemonServer {
|
|
|
69
72
|
start(): Promise<void>;
|
|
70
73
|
private startOnce;
|
|
71
74
|
stop(): Promise<void>;
|
|
75
|
+
/** Physical store recovery may settle storage-only terminal failures once
|
|
76
|
+
* every runner has exited; process/runner failures still refuse replacement. */
|
|
77
|
+
stopForStoreRecovery(): Promise<void>;
|
|
72
78
|
private stopOnce;
|
|
73
79
|
/** Resolves when the daemon is shut down via RPC. */
|
|
74
80
|
waitForShutdown(): Promise<void>;
|
|
75
81
|
private onConnection;
|
|
76
82
|
private send;
|
|
77
83
|
private handle;
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
/** The one RPC dispatcher: the token-checked socket handler and the daemon's
|
|
85
|
+
* in-process `DaemonLocalClient` both enter here with JSON wire values. */
|
|
86
|
+
dispatch(method: string, params: any): Promise<unknown>;
|
|
87
|
+
private readonly concurrency;
|
|
88
|
+
/** One synchronous observation for the exact operation; never inferred by a
|
|
89
|
+
* client from aggregate health. Missing means this scheduler owns no live job. */
|
|
90
|
+
admission(id: string): JobAdmission | null;
|
|
80
91
|
/** Daemon-owned cancellation primitive used by RPC and the Delegate drain
|
|
81
92
|
* barrier. It is safe to repeat and preserves queued-admission cleanup. */
|
|
82
93
|
cancelJob(jid: string, reasonCode?: CancelReasonCode): {
|
|
@@ -87,21 +98,11 @@ export declare class DaemonServer {
|
|
|
87
98
|
/** Age/cap and params-byte command retention: at normal admission and after every terminal. */
|
|
88
99
|
pruneHistory(): void;
|
|
89
100
|
private acceptCommand;
|
|
90
|
-
private allRecords;
|
|
91
101
|
private getRecord;
|
|
92
102
|
private updateRecord;
|
|
93
103
|
private threadIdOf;
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* single Delegate-child overflow lane documented below.
|
|
97
|
-
*
|
|
98
|
-
* One active run per thread: a thread is a linear conversation and an in-place
|
|
99
|
-
* turn mutates the live tree, so two concurrent turns on the same thread would
|
|
100
|
-
* race the same files. We pick the first queued job whose thread is idle rather
|
|
101
|
-
* than always taking the head; thread-less jobs (CLI/MCP) keep running in
|
|
102
|
-
* parallel as before. drain() re-runs on every completion, so a thread's next
|
|
103
|
-
* turn starts as soon as its previous one settles.
|
|
104
|
-
*/
|
|
104
|
+
/** Admit eligible jobs with one runner per thread and the existing single
|
|
105
|
+
* Delegate overflow. Completion retries admission without head-of-line blocking. */
|
|
105
106
|
private drain;
|
|
106
107
|
private runJob;
|
|
107
108
|
}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,kBAAkB,IAAI,uBAAuB,EAKlD,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,kBAAkB,IAAI,uBAAuB,EAKlD,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAShC,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,kBAAkB,EAIlB,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;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