@smthrs/engine-store 0.0.0-stage → 1.0.0-rc.3
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/CHANGELOG.md +247 -0
- package/LICENSE +21 -0
- package/README.md +146 -2
- package/dist/cjs/ArtifactGc.d.ts +235 -0
- package/dist/cjs/ArtifactGc.d.ts.map +1 -0
- package/dist/cjs/ArtifactGc.js +183 -0
- package/dist/cjs/ArtifactGc.js.map +7 -0
- package/dist/cjs/ArtifactSync.d.ts +164 -0
- package/dist/cjs/ArtifactSync.d.ts.map +1 -0
- package/dist/cjs/ArtifactSync.js +144 -0
- package/dist/cjs/ArtifactSync.js.map +7 -0
- package/dist/cjs/CacheSync.d.ts +112 -0
- package/dist/cjs/CacheSync.d.ts.map +1 -0
- package/dist/cjs/CacheSync.js +64 -0
- package/dist/cjs/CacheSync.js.map +7 -0
- package/dist/cjs/DeferredClockFold.d.ts +354 -0
- package/dist/cjs/DeferredClockFold.d.ts.map +1 -0
- package/dist/cjs/DeferredClockFold.js +335 -0
- package/dist/cjs/DeferredClockFold.js.map +7 -0
- package/dist/cjs/DisasterRecovery.d.ts +431 -0
- package/dist/cjs/DisasterRecovery.d.ts.map +1 -0
- package/dist/cjs/DisasterRecovery.js +453 -0
- package/dist/cjs/DisasterRecovery.js.map +7 -0
- package/dist/cjs/DurableEngineState.d.ts +776 -0
- package/dist/cjs/DurableEngineState.d.ts.map +1 -0
- package/dist/cjs/DurableEngineState.js +1536 -0
- package/dist/cjs/DurableEngineState.js.map +7 -0
- package/dist/cjs/EngineStore.d.ts +158 -0
- package/dist/cjs/EngineStore.d.ts.map +1 -0
- package/dist/cjs/EngineStore.js +398 -0
- package/dist/cjs/EngineStore.js.map +7 -0
- package/dist/cjs/EngineStoreMetrics.d.ts +276 -0
- package/dist/cjs/EngineStoreMetrics.d.ts.map +1 -0
- package/dist/cjs/EngineStoreMetrics.js +135 -0
- package/dist/cjs/EngineStoreMetrics.js.map +7 -0
- package/dist/cjs/Errors.d.ts +22 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +39 -0
- package/dist/cjs/Errors.js.map +7 -0
- package/dist/cjs/EventTypes.d.ts +27 -0
- package/dist/cjs/EventTypes.d.ts.map +1 -0
- package/dist/cjs/EventTypes.js +37 -0
- package/dist/cjs/EventTypes.js.map +7 -0
- package/dist/cjs/ExecutionFacts.d.ts +59 -0
- package/dist/cjs/ExecutionFacts.d.ts.map +1 -0
- package/dist/cjs/ExecutionFacts.js +123 -0
- package/dist/cjs/ExecutionFacts.js.map +7 -0
- package/dist/cjs/ExecutionSnapshot.d.ts +117 -0
- package/dist/cjs/ExecutionSnapshot.d.ts.map +1 -0
- package/dist/cjs/ExecutionSnapshot.js +111 -0
- package/dist/cjs/ExecutionSnapshot.js.map +7 -0
- package/dist/cjs/Inconsistency.d.ts +154 -0
- package/dist/cjs/Inconsistency.d.ts.map +1 -0
- package/dist/cjs/Inconsistency.js +135 -0
- package/dist/cjs/Inconsistency.js.map +7 -0
- package/dist/cjs/Migrations.d.ts +56 -0
- package/dist/cjs/Migrations.d.ts.map +1 -0
- package/dist/cjs/Migrations.js +78 -0
- package/dist/cjs/Migrations.js.map +7 -0
- package/dist/cjs/OwnerIdentity.d.ts +91 -0
- package/dist/cjs/OwnerIdentity.d.ts.map +1 -0
- package/dist/cjs/OwnerIdentity.js +65 -0
- package/dist/cjs/OwnerIdentity.js.map +7 -0
- package/dist/cjs/PlanInputStore.d.ts +110 -0
- package/dist/cjs/PlanInputStore.d.ts.map +1 -0
- package/dist/cjs/PlanInputStore.js +224 -0
- package/dist/cjs/PlanInputStore.js.map +7 -0
- package/dist/cjs/PlanMergeStore.d.ts +113 -0
- package/dist/cjs/PlanMergeStore.d.ts.map +1 -0
- package/dist/cjs/PlanMergeStore.js +255 -0
- package/dist/cjs/PlanMergeStore.js.map +7 -0
- package/dist/cjs/PlanScheduler.d.ts +363 -0
- package/dist/cjs/PlanScheduler.d.ts.map +1 -0
- package/dist/cjs/PlanScheduler.js +1090 -0
- package/dist/cjs/PlanScheduler.js.map +7 -0
- package/dist/cjs/Reconciliation.d.ts +175 -0
- package/dist/cjs/Reconciliation.d.ts.map +1 -0
- package/dist/cjs/Reconciliation.js +119 -0
- package/dist/cjs/Reconciliation.js.map +7 -0
- package/dist/cjs/ReplayOnly.d.ts +91 -0
- package/dist/cjs/ReplayOnly.d.ts.map +1 -0
- package/dist/cjs/ReplayOnly.js +52 -0
- package/dist/cjs/ReplayOnly.js.map +7 -0
- package/dist/cjs/Retention.d.ts +113 -0
- package/dist/cjs/Retention.d.ts.map +1 -0
- package/dist/cjs/Retention.js +99 -0
- package/dist/cjs/Retention.js.map +7 -0
- package/dist/cjs/RunCatalogRead.d.ts +17 -0
- package/dist/cjs/RunCatalogRead.d.ts.map +1 -0
- package/dist/cjs/RunCatalogRead.js +33 -0
- package/dist/cjs/RunCatalogRead.js.map +7 -0
- package/dist/cjs/RunChangeFeed.d.ts +75 -0
- package/dist/cjs/RunChangeFeed.d.ts.map +1 -0
- package/dist/cjs/RunChangeFeed.js +96 -0
- package/dist/cjs/RunChangeFeed.js.map +7 -0
- package/dist/cjs/RunState.d.ts +116 -0
- package/dist/cjs/RunState.d.ts.map +1 -0
- package/dist/cjs/RunState.js +76 -0
- package/dist/cjs/RunState.js.map +7 -0
- package/dist/cjs/Selection.d.ts +495 -0
- package/dist/cjs/Selection.d.ts.map +1 -0
- package/dist/cjs/Selection.js +288 -0
- package/dist/cjs/Selection.js.map +7 -0
- package/dist/cjs/SelectionStore.d.ts +141 -0
- package/dist/cjs/SelectionStore.d.ts.map +1 -0
- package/dist/cjs/SelectionStore.js +229 -0
- package/dist/cjs/SelectionStore.js.map +7 -0
- package/dist/cjs/StepBoundary.d.ts +501 -0
- package/dist/cjs/StepBoundary.d.ts.map +1 -0
- package/dist/cjs/StepBoundary.js +619 -0
- package/dist/cjs/StepBoundary.js.map +7 -0
- package/dist/cjs/StepCacheFold.d.ts +148 -0
- package/dist/cjs/StepCacheFold.d.ts.map +1 -0
- package/dist/cjs/StepCacheFold.js +131 -0
- package/dist/cjs/StepCacheFold.js.map +7 -0
- package/dist/cjs/StepSandbox.d.ts +78 -0
- package/dist/cjs/StepSandbox.d.ts.map +1 -0
- package/dist/cjs/StepSandbox.js +75 -0
- package/dist/cjs/StepSandbox.js.map +7 -0
- package/dist/cjs/WakeBus.d.ts +116 -0
- package/dist/cjs/WakeBus.d.ts.map +1 -0
- package/dist/cjs/WakeBus.js +89 -0
- package/dist/cjs/WakeBus.js.map +7 -0
- package/dist/cjs/WorkspaceSandbox.d.ts +619 -0
- package/dist/cjs/WorkspaceSandbox.d.ts.map +1 -0
- package/dist/cjs/WorkspaceSandbox.js +711 -0
- package/dist/cjs/WorkspaceSandbox.js.map +7 -0
- package/dist/cjs/index.d.ts +157 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +95 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/ActionPersistence.d.ts +276 -0
- package/dist/cjs/internal/ActionPersistence.d.ts.map +1 -0
- package/dist/cjs/internal/ActionPersistence.js +1395 -0
- package/dist/cjs/internal/ActionPersistence.js.map +7 -0
- package/dist/cjs/internal/ArtifactRoots.d.ts +38 -0
- package/dist/cjs/internal/ArtifactRoots.d.ts.map +1 -0
- package/dist/cjs/internal/ArtifactRoots.js +89 -0
- package/dist/cjs/internal/ArtifactRoots.js.map +7 -0
- package/dist/cjs/internal/AttemptAdmission.d.ts +53 -0
- package/dist/cjs/internal/AttemptAdmission.d.ts.map +1 -0
- package/dist/cjs/internal/AttemptAdmission.js +52 -0
- package/dist/cjs/internal/AttemptAdmission.js.map +7 -0
- package/dist/cjs/internal/AttemptLifecycle.d.ts +245 -0
- package/dist/cjs/internal/AttemptLifecycle.d.ts.map +1 -0
- package/dist/cjs/internal/AttemptLifecycle.js +112 -0
- package/dist/cjs/internal/AttemptLifecycle.js.map +7 -0
- package/dist/cjs/internal/AttemptProbe.d.ts +53 -0
- package/dist/cjs/internal/AttemptProbe.d.ts.map +1 -0
- package/dist/cjs/internal/AttemptProbe.js +66 -0
- package/dist/cjs/internal/AttemptProbe.js.map +7 -0
- package/dist/cjs/internal/CacheAdmission.d.ts +79 -0
- package/dist/cjs/internal/CacheAdmission.d.ts.map +1 -0
- package/dist/cjs/internal/CacheAdmission.js +71 -0
- package/dist/cjs/internal/CacheAdmission.js.map +7 -0
- package/dist/cjs/internal/CacheAgeHistory.d.ts +27 -0
- package/dist/cjs/internal/CacheAgeHistory.d.ts.map +1 -0
- package/dist/cjs/internal/CacheAgeHistory.js +61 -0
- package/dist/cjs/internal/CacheAgeHistory.js.map +7 -0
- package/dist/cjs/internal/CacheAgeVerdicts.d.ts +15 -0
- package/dist/cjs/internal/CacheAgeVerdicts.d.ts.map +1 -0
- package/dist/cjs/internal/CacheAgeVerdicts.js +73 -0
- package/dist/cjs/internal/CacheAgeVerdicts.js.map +7 -0
- package/dist/cjs/internal/CacheOutputPolicy.d.ts +24 -0
- package/dist/cjs/internal/CacheOutputPolicy.d.ts.map +1 -0
- package/dist/cjs/internal/CacheOutputPolicy.js +75 -0
- package/dist/cjs/internal/CacheOutputPolicy.js.map +7 -0
- package/dist/cjs/internal/CachePublication.d.ts +97 -0
- package/dist/cjs/internal/CachePublication.d.ts.map +1 -0
- package/dist/cjs/internal/CachePublication.js +80 -0
- package/dist/cjs/internal/CachePublication.js.map +7 -0
- package/dist/cjs/internal/CallFacts.d.ts +15 -0
- package/dist/cjs/internal/CallFacts.d.ts.map +1 -0
- package/dist/cjs/internal/CallFacts.js +97 -0
- package/dist/cjs/internal/CallFacts.js.map +7 -0
- package/dist/cjs/internal/CopiedRecord.d.ts +61 -0
- package/dist/cjs/internal/CopiedRecord.d.ts.map +1 -0
- package/dist/cjs/internal/CopiedRecord.js +134 -0
- package/dist/cjs/internal/CopiedRecord.js.map +7 -0
- package/dist/cjs/internal/DeferredPersistence.d.ts +108 -0
- package/dist/cjs/internal/DeferredPersistence.d.ts.map +1 -0
- package/dist/cjs/internal/DeferredPersistence.js +270 -0
- package/dist/cjs/internal/DeferredPersistence.js.map +7 -0
- package/dist/cjs/internal/EffectRecords.d.ts +92 -0
- package/dist/cjs/internal/EffectRecords.d.ts.map +1 -0
- package/dist/cjs/internal/EffectRecords.js +63 -0
- package/dist/cjs/internal/EffectRecords.js.map +7 -0
- package/dist/cjs/internal/EngineJj.d.ts +30 -0
- package/dist/cjs/internal/EngineJj.d.ts.map +1 -0
- package/dist/cjs/internal/EngineJj.js +42 -0
- package/dist/cjs/internal/EngineJj.js.map +7 -0
- package/dist/cjs/internal/EngineStateSchema.d.ts +68 -0
- package/dist/cjs/internal/EngineStateSchema.d.ts.map +1 -0
- package/dist/cjs/internal/EngineStateSchema.js +58 -0
- package/dist/cjs/internal/EngineStateSchema.js.map +7 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.d.ts +162 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.d.ts.map +1 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.js +199 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.js.map +7 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.d.ts +39 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.d.ts.map +1 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.js +105 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.js.map +7 -0
- package/dist/cjs/internal/ExitEncoding.d.ts +180 -0
- package/dist/cjs/internal/ExitEncoding.d.ts.map +1 -0
- package/dist/cjs/internal/ExitEncoding.js +236 -0
- package/dist/cjs/internal/ExitEncoding.js.map +7 -0
- package/dist/cjs/internal/FileBoundarySnapshot.d.ts +14 -0
- package/dist/cjs/internal/FileBoundarySnapshot.d.ts.map +1 -0
- package/dist/cjs/internal/FileBoundarySnapshot.js +51 -0
- package/dist/cjs/internal/FileBoundarySnapshot.js.map +7 -0
- package/dist/cjs/internal/FileEnumeration.d.ts +127 -0
- package/dist/cjs/internal/FileEnumeration.d.ts.map +1 -0
- package/dist/cjs/internal/FileEnumeration.js +194 -0
- package/dist/cjs/internal/FileEnumeration.js.map +7 -0
- package/dist/cjs/internal/HostReflection.d.ts +80 -0
- package/dist/cjs/internal/HostReflection.d.ts.map +1 -0
- package/dist/cjs/internal/HostReflection.js +43 -0
- package/dist/cjs/internal/HostReflection.js.map +7 -0
- package/dist/cjs/internal/JournalRecords.d.ts +325 -0
- package/dist/cjs/internal/JournalRecords.d.ts.map +1 -0
- package/dist/cjs/internal/JournalRecords.js +122 -0
- package/dist/cjs/internal/JournalRecords.js.map +7 -0
- package/dist/cjs/internal/NodeJournal.d.ts +157 -0
- package/dist/cjs/internal/NodeJournal.d.ts.map +1 -0
- package/dist/cjs/internal/NodeJournal.js +192 -0
- package/dist/cjs/internal/NodeJournal.js.map +7 -0
- package/dist/cjs/internal/Ordering.d.ts +14 -0
- package/dist/cjs/internal/Ordering.d.ts.map +1 -0
- package/dist/cjs/internal/Ordering.js +25 -0
- package/dist/cjs/internal/Ordering.js.map +7 -0
- package/dist/cjs/internal/PlanInputs.d.ts +14 -0
- package/dist/cjs/internal/PlanInputs.d.ts.map +1 -0
- package/dist/cjs/internal/PlanInputs.js +78 -0
- package/dist/cjs/internal/PlanInputs.js.map +7 -0
- package/dist/cjs/internal/PlanMerges.d.ts +178 -0
- package/dist/cjs/internal/PlanMerges.d.ts.map +1 -0
- package/dist/cjs/internal/PlanMerges.js +125 -0
- package/dist/cjs/internal/PlanMerges.js.map +7 -0
- package/dist/cjs/internal/ProvenanceSlot.d.ts +30 -0
- package/dist/cjs/internal/ProvenanceSlot.d.ts.map +1 -0
- package/dist/cjs/internal/ProvenanceSlot.js +53 -0
- package/dist/cjs/internal/ProvenanceSlot.js.map +7 -0
- package/dist/cjs/internal/ResultEnvelope.d.ts +88 -0
- package/dist/cjs/internal/ResultEnvelope.d.ts.map +1 -0
- package/dist/cjs/internal/ResultEnvelope.js +90 -0
- package/dist/cjs/internal/ResultEnvelope.js.map +7 -0
- package/dist/cjs/internal/RetentionOps.d.ts +414 -0
- package/dist/cjs/internal/RetentionOps.d.ts.map +1 -0
- package/dist/cjs/internal/RetentionOps.js +354 -0
- package/dist/cjs/internal/RetentionOps.js.map +7 -0
- package/dist/cjs/internal/RunCatalogOps.d.ts +118 -0
- package/dist/cjs/internal/RunCatalogOps.d.ts.map +1 -0
- package/dist/cjs/internal/RunCatalogOps.js +85 -0
- package/dist/cjs/internal/RunCatalogOps.js.map +7 -0
- package/dist/cjs/internal/RunCoordinator.d.ts +78 -0
- package/dist/cjs/internal/RunCoordinator.d.ts.map +1 -0
- package/dist/cjs/internal/RunCoordinator.js +123 -0
- package/dist/cjs/internal/RunCoordinator.js.map +7 -0
- package/dist/cjs/internal/RunDriver.d.ts +192 -0
- package/dist/cjs/internal/RunDriver.d.ts.map +1 -0
- package/dist/cjs/internal/RunDriver.js +1584 -0
- package/dist/cjs/internal/RunDriver.js.map +7 -0
- package/dist/cjs/internal/RunLifecycle.d.ts +22 -0
- package/dist/cjs/internal/RunLifecycle.d.ts.map +1 -0
- package/dist/cjs/internal/RunLifecycle.js +63 -0
- package/dist/cjs/internal/RunLifecycle.js.map +7 -0
- package/dist/cjs/internal/RunListing.d.ts +78 -0
- package/dist/cjs/internal/RunListing.d.ts.map +1 -0
- package/dist/cjs/internal/RunListing.js +171 -0
- package/dist/cjs/internal/RunListing.js.map +7 -0
- package/dist/cjs/internal/RunListingError.d.ts +35 -0
- package/dist/cjs/internal/RunListingError.d.ts.map +1 -0
- package/dist/cjs/internal/RunListingError.js +47 -0
- package/dist/cjs/internal/RunListingError.js.map +7 -0
- package/dist/cjs/internal/RuntimeGraph.d.ts +73 -0
- package/dist/cjs/internal/RuntimeGraph.d.ts.map +1 -0
- package/dist/cjs/internal/RuntimeGraph.js +180 -0
- package/dist/cjs/internal/RuntimeGraph.js.map +7 -0
- package/dist/cjs/internal/SandboxedExecution.d.ts +80 -0
- package/dist/cjs/internal/SandboxedExecution.d.ts.map +1 -0
- package/dist/cjs/internal/SandboxedExecution.js +104 -0
- package/dist/cjs/internal/SandboxedExecution.js.map +7 -0
- package/dist/cjs/internal/StateTransaction.d.ts +44 -0
- package/dist/cjs/internal/StateTransaction.d.ts.map +1 -0
- package/dist/cjs/internal/StateTransaction.js +52 -0
- package/dist/cjs/internal/StateTransaction.js.map +7 -0
- package/dist/cjs/internal/StepFacts.d.ts +14 -0
- package/dist/cjs/internal/StepFacts.d.ts.map +1 -0
- package/dist/cjs/internal/StepFacts.js +58 -0
- package/dist/cjs/internal/StepFacts.js.map +7 -0
- package/dist/cjs/internal/TypedEvents.d.ts +14 -0
- package/dist/cjs/internal/TypedEvents.d.ts.map +1 -0
- package/dist/cjs/internal/TypedEvents.js +37 -0
- package/dist/cjs/internal/TypedEvents.js.map +7 -0
- package/dist/cjs/migrations/0001_initial.d.ts +17 -0
- package/dist/cjs/migrations/0001_initial.d.ts.map +1 -0
- package/dist/cjs/migrations/0001_initial.js +61 -0
- package/dist/cjs/migrations/0001_initial.js.map +7 -0
- package/dist/cjs/migrations/0002_selection_store.d.ts +15 -0
- package/dist/cjs/migrations/0002_selection_store.d.ts.map +1 -0
- package/dist/cjs/migrations/0002_selection_store.js +56 -0
- package/dist/cjs/migrations/0002_selection_store.js.map +7 -0
- package/dist/cjs/migrations/0003_plan_inputs.d.ts +13 -0
- package/dist/cjs/migrations/0003_plan_inputs.d.ts.map +1 -0
- package/dist/cjs/migrations/0003_plan_inputs.js +90 -0
- package/dist/cjs/migrations/0003_plan_inputs.js.map +7 -0
- package/dist/cjs/migrations/0004_plan_environment.d.ts +14 -0
- package/dist/cjs/migrations/0004_plan_environment.d.ts.map +1 -0
- package/dist/cjs/migrations/0004_plan_environment.js +56 -0
- package/dist/cjs/migrations/0004_plan_environment.js.map +7 -0
- package/dist/cjs/migrations/0005_plan_merges.d.ts +14 -0
- package/dist/cjs/migrations/0005_plan_merges.d.ts.map +1 -0
- package/dist/cjs/migrations/0005_plan_merges.js +82 -0
- package/dist/cjs/migrations/0005_plan_merges.js.map +7 -0
- package/dist/cjs/migrations/0006_execution_listing.d.ts +15 -0
- package/dist/cjs/migrations/0006_execution_listing.d.ts.map +1 -0
- package/dist/cjs/migrations/0006_execution_listing.js +101 -0
- package/dist/cjs/migrations/0006_execution_listing.js.map +7 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.d.ts +15 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.d.ts.map +1 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.js +40 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.js.map +7 -0
- package/dist/cjs/migrations/0008_deferred_consumption.d.ts +16 -0
- package/dist/cjs/migrations/0008_deferred_consumption.d.ts.map +1 -0
- package/dist/cjs/migrations/0008_deferred_consumption.js +45 -0
- package/dist/cjs/migrations/0008_deferred_consumption.js.map +7 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.d.ts +24 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.d.ts.map +1 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.js +141 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.js.map +7 -0
- package/dist/cjs/migrations/0010_pending_cancellation.d.ts +15 -0
- package/dist/cjs/migrations/0010_pending_cancellation.d.ts.map +1 -0
- package/dist/cjs/migrations/0010_pending_cancellation.js +41 -0
- package/dist/cjs/migrations/0010_pending_cancellation.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/test/TestStores.d.ts +89 -0
- package/dist/cjs/test/TestStores.d.ts.map +1 -0
- package/dist/cjs/test/TestStores.js +98 -0
- package/dist/cjs/test/TestStores.js.map +7 -0
- package/dist/esm/ArtifactGc.d.ts +235 -0
- package/dist/esm/ArtifactGc.d.ts.map +1 -0
- package/dist/esm/ArtifactGc.js +268 -0
- package/dist/esm/ArtifactGc.js.map +1 -0
- package/dist/esm/ArtifactSync.d.ts +164 -0
- package/dist/esm/ArtifactSync.d.ts.map +1 -0
- package/dist/esm/ArtifactSync.js +176 -0
- package/dist/esm/ArtifactSync.js.map +1 -0
- package/dist/esm/CacheSync.d.ts +112 -0
- package/dist/esm/CacheSync.d.ts.map +1 -0
- package/dist/esm/CacheSync.js +94 -0
- package/dist/esm/CacheSync.js.map +1 -0
- package/dist/esm/DeferredClockFold.d.ts +354 -0
- package/dist/esm/DeferredClockFold.d.ts.map +1 -0
- package/dist/esm/DeferredClockFold.js +472 -0
- package/dist/esm/DeferredClockFold.js.map +1 -0
- package/dist/esm/DisasterRecovery.d.ts +431 -0
- package/dist/esm/DisasterRecovery.d.ts.map +1 -0
- package/dist/esm/DisasterRecovery.js +523 -0
- package/dist/esm/DisasterRecovery.js.map +1 -0
- package/dist/esm/DurableEngineState.d.ts +776 -0
- package/dist/esm/DurableEngineState.d.ts.map +1 -0
- package/dist/esm/DurableEngineState.js +1648 -0
- package/dist/esm/DurableEngineState.js.map +1 -0
- package/dist/esm/EngineStore.d.ts +158 -0
- package/dist/esm/EngineStore.d.ts.map +1 -0
- package/dist/esm/EngineStore.js +403 -0
- package/dist/esm/EngineStore.js.map +1 -0
- package/dist/esm/EngineStoreMetrics.d.ts +276 -0
- package/dist/esm/EngineStoreMetrics.d.ts.map +1 -0
- package/dist/esm/EngineStoreMetrics.js +260 -0
- package/dist/esm/EngineStoreMetrics.js.map +1 -0
- package/dist/esm/Errors.d.ts +22 -0
- package/dist/esm/Errors.d.ts.map +1 -0
- package/dist/esm/Errors.js +22 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/EventTypes.d.ts +27 -0
- package/dist/esm/EventTypes.d.ts.map +1 -0
- package/dist/esm/EventTypes.js +27 -0
- package/dist/esm/EventTypes.js.map +1 -0
- package/dist/esm/ExecutionFacts.d.ts +59 -0
- package/dist/esm/ExecutionFacts.d.ts.map +1 -0
- package/dist/esm/ExecutionFacts.js +96 -0
- package/dist/esm/ExecutionFacts.js.map +1 -0
- package/dist/esm/ExecutionSnapshot.d.ts +117 -0
- package/dist/esm/ExecutionSnapshot.d.ts.map +1 -0
- package/dist/esm/ExecutionSnapshot.js +95 -0
- package/dist/esm/ExecutionSnapshot.js.map +1 -0
- package/dist/esm/Inconsistency.d.ts +154 -0
- package/dist/esm/Inconsistency.d.ts.map +1 -0
- package/dist/esm/Inconsistency.js +133 -0
- package/dist/esm/Inconsistency.js.map +1 -0
- package/dist/esm/Migrations.d.ts +56 -0
- package/dist/esm/Migrations.d.ts.map +1 -0
- package/dist/esm/Migrations.js +91 -0
- package/dist/esm/Migrations.js.map +1 -0
- package/dist/esm/OwnerIdentity.d.ts +91 -0
- package/dist/esm/OwnerIdentity.d.ts.map +1 -0
- package/dist/esm/OwnerIdentity.js +99 -0
- package/dist/esm/OwnerIdentity.js.map +1 -0
- package/dist/esm/PlanInputStore.d.ts +110 -0
- package/dist/esm/PlanInputStore.d.ts.map +1 -0
- package/dist/esm/PlanInputStore.js +207 -0
- package/dist/esm/PlanInputStore.js.map +1 -0
- package/dist/esm/PlanMergeStore.d.ts +113 -0
- package/dist/esm/PlanMergeStore.d.ts.map +1 -0
- package/dist/esm/PlanMergeStore.js +244 -0
- package/dist/esm/PlanMergeStore.js.map +1 -0
- package/dist/esm/PlanScheduler.d.ts +363 -0
- package/dist/esm/PlanScheduler.d.ts.map +1 -0
- package/dist/esm/PlanScheduler.js +1321 -0
- package/dist/esm/PlanScheduler.js.map +1 -0
- package/dist/esm/Reconciliation.d.ts +175 -0
- package/dist/esm/Reconciliation.d.ts.map +1 -0
- package/dist/esm/Reconciliation.js +175 -0
- package/dist/esm/Reconciliation.js.map +1 -0
- package/dist/esm/ReplayOnly.d.ts +91 -0
- package/dist/esm/ReplayOnly.d.ts.map +1 -0
- package/dist/esm/ReplayOnly.js +59 -0
- package/dist/esm/ReplayOnly.js.map +1 -0
- package/dist/esm/Retention.d.ts +113 -0
- package/dist/esm/Retention.d.ts.map +1 -0
- package/dist/esm/Retention.js +139 -0
- package/dist/esm/Retention.js.map +1 -0
- package/dist/esm/RunCatalogRead.d.ts +17 -0
- package/dist/esm/RunCatalogRead.d.ts.map +1 -0
- package/dist/esm/RunCatalogRead.js +17 -0
- package/dist/esm/RunCatalogRead.js.map +1 -0
- package/dist/esm/RunChangeFeed.d.ts +75 -0
- package/dist/esm/RunChangeFeed.d.ts.map +1 -0
- package/dist/esm/RunChangeFeed.js +81 -0
- package/dist/esm/RunChangeFeed.js.map +1 -0
- package/dist/esm/RunState.d.ts +116 -0
- package/dist/esm/RunState.d.ts.map +1 -0
- package/dist/esm/RunState.js +109 -0
- package/dist/esm/RunState.js.map +1 -0
- package/dist/esm/Selection.d.ts +495 -0
- package/dist/esm/Selection.d.ts.map +1 -0
- package/dist/esm/Selection.js +482 -0
- package/dist/esm/Selection.js.map +1 -0
- package/dist/esm/SelectionStore.d.ts +141 -0
- package/dist/esm/SelectionStore.d.ts.map +1 -0
- package/dist/esm/SelectionStore.js +215 -0
- package/dist/esm/SelectionStore.js.map +1 -0
- package/dist/esm/StepBoundary.d.ts +501 -0
- package/dist/esm/StepBoundary.d.ts.map +1 -0
- package/dist/esm/StepBoundary.js +919 -0
- package/dist/esm/StepBoundary.js.map +1 -0
- package/dist/esm/StepCacheFold.d.ts +148 -0
- package/dist/esm/StepCacheFold.d.ts.map +1 -0
- package/dist/esm/StepCacheFold.js +201 -0
- package/dist/esm/StepCacheFold.js.map +1 -0
- package/dist/esm/StepSandbox.d.ts +78 -0
- package/dist/esm/StepSandbox.d.ts.map +1 -0
- package/dist/esm/StepSandbox.js +70 -0
- package/dist/esm/StepSandbox.js.map +1 -0
- package/dist/esm/WakeBus.d.ts +116 -0
- package/dist/esm/WakeBus.d.ts.map +1 -0
- package/dist/esm/WakeBus.js +121 -0
- package/dist/esm/WakeBus.js.map +1 -0
- package/dist/esm/WorkspaceSandbox.d.ts +619 -0
- package/dist/esm/WorkspaceSandbox.d.ts.map +1 -0
- package/dist/esm/WorkspaceSandbox.js +985 -0
- package/dist/esm/WorkspaceSandbox.js.map +1 -0
- package/dist/esm/index.d.ts +157 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +157 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/ActionPersistence.d.ts +276 -0
- package/dist/esm/internal/ActionPersistence.d.ts.map +1 -0
- package/dist/esm/internal/ActionPersistence.js +2306 -0
- package/dist/esm/internal/ActionPersistence.js.map +1 -0
- package/dist/esm/internal/ArtifactRoots.d.ts +38 -0
- package/dist/esm/internal/ArtifactRoots.d.ts.map +1 -0
- package/dist/esm/internal/ArtifactRoots.js +76 -0
- package/dist/esm/internal/ArtifactRoots.js.map +1 -0
- package/dist/esm/internal/AttemptAdmission.d.ts +53 -0
- package/dist/esm/internal/AttemptAdmission.d.ts.map +1 -0
- package/dist/esm/internal/AttemptAdmission.js +52 -0
- package/dist/esm/internal/AttemptAdmission.js.map +1 -0
- package/dist/esm/internal/AttemptLifecycle.d.ts +245 -0
- package/dist/esm/internal/AttemptLifecycle.d.ts.map +1 -0
- package/dist/esm/internal/AttemptLifecycle.js +104 -0
- package/dist/esm/internal/AttemptLifecycle.js.map +1 -0
- package/dist/esm/internal/AttemptProbe.d.ts +53 -0
- package/dist/esm/internal/AttemptProbe.d.ts.map +1 -0
- package/dist/esm/internal/AttemptProbe.js +83 -0
- package/dist/esm/internal/AttemptProbe.js.map +1 -0
- package/dist/esm/internal/CacheAdmission.d.ts +79 -0
- package/dist/esm/internal/CacheAdmission.d.ts.map +1 -0
- package/dist/esm/internal/CacheAdmission.js +72 -0
- package/dist/esm/internal/CacheAdmission.js.map +1 -0
- package/dist/esm/internal/CacheAgeHistory.d.ts +27 -0
- package/dist/esm/internal/CacheAgeHistory.d.ts.map +1 -0
- package/dist/esm/internal/CacheAgeHistory.js +49 -0
- package/dist/esm/internal/CacheAgeHistory.js.map +1 -0
- package/dist/esm/internal/CacheAgeVerdicts.d.ts +15 -0
- package/dist/esm/internal/CacheAgeVerdicts.d.ts.map +1 -0
- package/dist/esm/internal/CacheAgeVerdicts.js +54 -0
- package/dist/esm/internal/CacheAgeVerdicts.js.map +1 -0
- package/dist/esm/internal/CacheOutputPolicy.d.ts +24 -0
- package/dist/esm/internal/CacheOutputPolicy.d.ts.map +1 -0
- package/dist/esm/internal/CacheOutputPolicy.js +73 -0
- package/dist/esm/internal/CacheOutputPolicy.js.map +1 -0
- package/dist/esm/internal/CachePublication.d.ts +97 -0
- package/dist/esm/internal/CachePublication.d.ts.map +1 -0
- package/dist/esm/internal/CachePublication.js +116 -0
- package/dist/esm/internal/CachePublication.js.map +1 -0
- package/dist/esm/internal/CallFacts.d.ts +15 -0
- package/dist/esm/internal/CallFacts.d.ts.map +1 -0
- package/dist/esm/internal/CallFacts.js +83 -0
- package/dist/esm/internal/CallFacts.js.map +1 -0
- package/dist/esm/internal/CopiedRecord.d.ts +61 -0
- package/dist/esm/internal/CopiedRecord.d.ts.map +1 -0
- package/dist/esm/internal/CopiedRecord.js +165 -0
- package/dist/esm/internal/CopiedRecord.js.map +1 -0
- package/dist/esm/internal/DeferredPersistence.d.ts +108 -0
- package/dist/esm/internal/DeferredPersistence.d.ts.map +1 -0
- package/dist/esm/internal/DeferredPersistence.js +240 -0
- package/dist/esm/internal/DeferredPersistence.js.map +1 -0
- package/dist/esm/internal/EffectRecords.d.ts +92 -0
- package/dist/esm/internal/EffectRecords.d.ts.map +1 -0
- package/dist/esm/internal/EffectRecords.js +94 -0
- package/dist/esm/internal/EffectRecords.js.map +1 -0
- package/dist/esm/internal/EngineJj.d.ts +30 -0
- package/dist/esm/internal/EngineJj.d.ts.map +1 -0
- package/dist/esm/internal/EngineJj.js +29 -0
- package/dist/esm/internal/EngineJj.js.map +1 -0
- package/dist/esm/internal/EngineStateSchema.d.ts +68 -0
- package/dist/esm/internal/EngineStateSchema.d.ts.map +1 -0
- package/dist/esm/internal/EngineStateSchema.js +53 -0
- package/dist/esm/internal/EngineStateSchema.js.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRead.d.ts +162 -0
- package/dist/esm/internal/ExecutionSnapshotRead.d.ts.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRead.js +218 -0
- package/dist/esm/internal/ExecutionSnapshotRead.js.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.d.ts +39 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.d.ts.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.js +81 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.js.map +1 -0
- package/dist/esm/internal/ExitEncoding.d.ts +180 -0
- package/dist/esm/internal/ExitEncoding.d.ts.map +1 -0
- package/dist/esm/internal/ExitEncoding.js +361 -0
- package/dist/esm/internal/ExitEncoding.js.map +1 -0
- package/dist/esm/internal/FileBoundarySnapshot.d.ts +14 -0
- package/dist/esm/internal/FileBoundarySnapshot.d.ts.map +1 -0
- package/dist/esm/internal/FileBoundarySnapshot.js +29 -0
- package/dist/esm/internal/FileBoundarySnapshot.js.map +1 -0
- package/dist/esm/internal/FileEnumeration.d.ts +127 -0
- package/dist/esm/internal/FileEnumeration.d.ts.map +1 -0
- package/dist/esm/internal/FileEnumeration.js +236 -0
- package/dist/esm/internal/FileEnumeration.js.map +1 -0
- package/dist/esm/internal/HostReflection.d.ts +80 -0
- package/dist/esm/internal/HostReflection.d.ts.map +1 -0
- package/dist/esm/internal/HostReflection.js +98 -0
- package/dist/esm/internal/HostReflection.js.map +1 -0
- package/dist/esm/internal/JournalRecords.d.ts +325 -0
- package/dist/esm/internal/JournalRecords.d.ts.map +1 -0
- package/dist/esm/internal/JournalRecords.js +306 -0
- package/dist/esm/internal/JournalRecords.js.map +1 -0
- package/dist/esm/internal/NodeJournal.d.ts +157 -0
- package/dist/esm/internal/NodeJournal.d.ts.map +1 -0
- package/dist/esm/internal/NodeJournal.js +298 -0
- package/dist/esm/internal/NodeJournal.js.map +1 -0
- package/dist/esm/internal/Ordering.d.ts +14 -0
- package/dist/esm/internal/Ordering.d.ts.map +1 -0
- package/dist/esm/internal/Ordering.js +14 -0
- package/dist/esm/internal/Ordering.js.map +1 -0
- package/dist/esm/internal/PlanInputs.d.ts +14 -0
- package/dist/esm/internal/PlanInputs.d.ts.map +1 -0
- package/dist/esm/internal/PlanInputs.js +57 -0
- package/dist/esm/internal/PlanInputs.js.map +1 -0
- package/dist/esm/internal/PlanMerges.d.ts +178 -0
- package/dist/esm/internal/PlanMerges.d.ts.map +1 -0
- package/dist/esm/internal/PlanMerges.js +113 -0
- package/dist/esm/internal/PlanMerges.js.map +1 -0
- package/dist/esm/internal/ProvenanceSlot.d.ts +30 -0
- package/dist/esm/internal/ProvenanceSlot.d.ts.map +1 -0
- package/dist/esm/internal/ProvenanceSlot.js +39 -0
- package/dist/esm/internal/ProvenanceSlot.js.map +1 -0
- package/dist/esm/internal/ResultEnvelope.d.ts +88 -0
- package/dist/esm/internal/ResultEnvelope.d.ts.map +1 -0
- package/dist/esm/internal/ResultEnvelope.js +83 -0
- package/dist/esm/internal/ResultEnvelope.js.map +1 -0
- package/dist/esm/internal/RetentionOps.d.ts +414 -0
- package/dist/esm/internal/RetentionOps.d.ts.map +1 -0
- package/dist/esm/internal/RetentionOps.js +576 -0
- package/dist/esm/internal/RetentionOps.js.map +1 -0
- package/dist/esm/internal/RunCatalogOps.d.ts +118 -0
- package/dist/esm/internal/RunCatalogOps.d.ts.map +1 -0
- package/dist/esm/internal/RunCatalogOps.js +120 -0
- package/dist/esm/internal/RunCatalogOps.js.map +1 -0
- package/dist/esm/internal/RunCoordinator.d.ts +78 -0
- package/dist/esm/internal/RunCoordinator.d.ts.map +1 -0
- package/dist/esm/internal/RunCoordinator.js +115 -0
- package/dist/esm/internal/RunCoordinator.js.map +1 -0
- package/dist/esm/internal/RunDriver.d.ts +192 -0
- package/dist/esm/internal/RunDriver.d.ts.map +1 -0
- package/dist/esm/internal/RunDriver.js +2334 -0
- package/dist/esm/internal/RunDriver.js.map +1 -0
- package/dist/esm/internal/RunLifecycle.d.ts +22 -0
- package/dist/esm/internal/RunLifecycle.d.ts.map +1 -0
- package/dist/esm/internal/RunLifecycle.js +49 -0
- package/dist/esm/internal/RunLifecycle.js.map +1 -0
- package/dist/esm/internal/RunListing.d.ts +78 -0
- package/dist/esm/internal/RunListing.d.ts.map +1 -0
- package/dist/esm/internal/RunListing.js +146 -0
- package/dist/esm/internal/RunListing.js.map +1 -0
- package/dist/esm/internal/RunListingError.d.ts +35 -0
- package/dist/esm/internal/RunListingError.d.ts.map +1 -0
- package/dist/esm/internal/RunListingError.js +27 -0
- package/dist/esm/internal/RunListingError.js.map +1 -0
- package/dist/esm/internal/RuntimeGraph.d.ts +73 -0
- package/dist/esm/internal/RuntimeGraph.d.ts.map +1 -0
- package/dist/esm/internal/RuntimeGraph.js +182 -0
- package/dist/esm/internal/RuntimeGraph.js.map +1 -0
- package/dist/esm/internal/SandboxedExecution.d.ts +80 -0
- package/dist/esm/internal/SandboxedExecution.d.ts.map +1 -0
- package/dist/esm/internal/SandboxedExecution.js +107 -0
- package/dist/esm/internal/SandboxedExecution.js.map +1 -0
- package/dist/esm/internal/StateTransaction.d.ts +44 -0
- package/dist/esm/internal/StateTransaction.d.ts.map +1 -0
- package/dist/esm/internal/StateTransaction.js +54 -0
- package/dist/esm/internal/StateTransaction.js.map +1 -0
- package/dist/esm/internal/StepFacts.d.ts +14 -0
- package/dist/esm/internal/StepFacts.d.ts.map +1 -0
- package/dist/esm/internal/StepFacts.js +35 -0
- package/dist/esm/internal/StepFacts.js.map +1 -0
- package/dist/esm/internal/TypedEvents.d.ts +14 -0
- package/dist/esm/internal/TypedEvents.d.ts.map +1 -0
- package/dist/esm/internal/TypedEvents.js +14 -0
- package/dist/esm/internal/TypedEvents.js.map +1 -0
- package/dist/esm/migrations/0001_initial.d.ts +17 -0
- package/dist/esm/migrations/0001_initial.d.ts.map +1 -0
- package/dist/esm/migrations/0001_initial.js +41 -0
- package/dist/esm/migrations/0001_initial.js.map +1 -0
- package/dist/esm/migrations/0002_selection_store.d.ts +15 -0
- package/dist/esm/migrations/0002_selection_store.d.ts.map +1 -0
- package/dist/esm/migrations/0002_selection_store.js +34 -0
- package/dist/esm/migrations/0002_selection_store.js.map +1 -0
- package/dist/esm/migrations/0003_plan_inputs.d.ts +13 -0
- package/dist/esm/migrations/0003_plan_inputs.d.ts.map +1 -0
- package/dist/esm/migrations/0003_plan_inputs.js +70 -0
- package/dist/esm/migrations/0003_plan_inputs.js.map +1 -0
- package/dist/esm/migrations/0004_plan_environment.d.ts +14 -0
- package/dist/esm/migrations/0004_plan_environment.d.ts.map +1 -0
- package/dist/esm/migrations/0004_plan_environment.js +33 -0
- package/dist/esm/migrations/0004_plan_environment.js.map +1 -0
- package/dist/esm/migrations/0005_plan_merges.d.ts +14 -0
- package/dist/esm/migrations/0005_plan_merges.d.ts.map +1 -0
- package/dist/esm/migrations/0005_plan_merges.js +59 -0
- package/dist/esm/migrations/0005_plan_merges.js.map +1 -0
- package/dist/esm/migrations/0006_execution_listing.d.ts +15 -0
- package/dist/esm/migrations/0006_execution_listing.d.ts.map +1 -0
- package/dist/esm/migrations/0006_execution_listing.js +81 -0
- package/dist/esm/migrations/0006_execution_listing.js.map +1 -0
- package/dist/esm/migrations/0007_run_parent_sequence.d.ts +15 -0
- package/dist/esm/migrations/0007_run_parent_sequence.d.ts.map +1 -0
- package/dist/esm/migrations/0007_run_parent_sequence.js +18 -0
- package/dist/esm/migrations/0007_run_parent_sequence.js.map +1 -0
- package/dist/esm/migrations/0008_deferred_consumption.d.ts +16 -0
- package/dist/esm/migrations/0008_deferred_consumption.d.ts.map +1 -0
- package/dist/esm/migrations/0008_deferred_consumption.js +24 -0
- package/dist/esm/migrations/0008_deferred_consumption.js.map +1 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.d.ts +24 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.d.ts.map +1 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.js +127 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.js.map +1 -0
- package/dist/esm/migrations/0010_pending_cancellation.d.ts +15 -0
- package/dist/esm/migrations/0010_pending_cancellation.d.ts.map +1 -0
- package/dist/esm/migrations/0010_pending_cancellation.js +19 -0
- package/dist/esm/migrations/0010_pending_cancellation.js.map +1 -0
- package/dist/esm/test/TestStores.d.ts +89 -0
- package/dist/esm/test/TestStores.d.ts.map +1 -0
- package/dist/esm/test/TestStores.js +103 -0
- package/dist/esm/test/TestStores.js.map +1 -0
- package/docs/README.md +113 -0
- package/docs/api.md +1494 -0
- package/docs/concepts/attempts-and-replay.md +149 -0
- package/docs/concepts/cache-admission.md +265 -0
- package/docs/concepts/call-facts.md +86 -0
- package/docs/concepts/durable-waits.md +175 -0
- package/docs/concepts/execution-facts.md +90 -0
- package/docs/concepts/ownership-and-fencing.md +128 -0
- package/docs/concepts/step-boundaries.md +148 -0
- package/docs/concepts/workspace-transactions.md +199 -0
- package/docs/event-types.md +14 -0
- package/docs/guides/back-up-and-restore.md +164 -0
- package/docs/guides/collect-unreferenced-artifacts.md +128 -0
- package/docs/guides/compose-a-durable-engine.md +146 -0
- package/docs/guides/coordinate-two-processes.md +120 -0
- package/docs/guides/defer-work-with-selection.md +171 -0
- package/docs/guides/delete-old-run-history.md +154 -0
- package/docs/guides/drive-a-plan.md +314 -0
- package/docs/guides/observe-engine-metrics.md +98 -0
- package/docs/guides/observe-executions.md +187 -0
- package/docs/guides/reclaim-runs-from-a-dead-host.md +133 -0
- package/docs/guides/share-a-cache-across-machines.md +134 -0
- package/docs/guides/testing.md +123 -0
- package/docs/installation.md +102 -0
- package/docs/quickstart.md +215 -0
- package/docs/troubleshooting.md +347 -0
- package/package.json +438 -3
- package/src/ArtifactGc.ts +408 -0
- package/src/ArtifactSync.ts +278 -0
- package/src/CacheSync.ts +131 -0
- package/src/DeferredClockFold.ts +586 -0
- package/src/DisasterRecovery.ts +888 -0
- package/src/DurableEngineState.ts +2656 -0
- package/src/EngineStore.ts +656 -0
- package/src/EngineStoreMetrics.ts +331 -0
- package/src/Errors.ts +28 -0
- package/src/EventTypes.ts +27 -0
- package/src/ExecutionFacts.ts +125 -0
- package/src/ExecutionSnapshot.ts +186 -0
- package/src/Inconsistency.ts +253 -0
- package/src/Migrations.ts +95 -0
- package/src/OwnerIdentity.ts +125 -0
- package/src/PlanInputStore.ts +292 -0
- package/src/PlanMergeStore.ts +330 -0
- package/src/PlanScheduler.ts +1806 -0
- package/src/Reconciliation.ts +224 -0
- package/src/ReplayOnly.ts +95 -0
- package/src/Retention.ts +214 -0
- package/src/RunCatalogRead.ts +27 -0
- package/src/RunChangeFeed.ts +125 -0
- package/src/RunState.ts +137 -0
- package/src/Selection.ts +683 -0
- package/src/SelectionStore.ts +353 -0
- package/src/StepBoundary.ts +1165 -0
- package/src/StepCacheFold.ts +244 -0
- package/src/StepSandbox.ts +110 -0
- package/src/WakeBus.ts +167 -0
- package/src/WorkspaceSandbox.ts +1604 -0
- package/src/index.ts +185 -0
- package/src/internal/ActionPersistence.ts +2687 -0
- package/src/internal/ArtifactRoots.ts +92 -0
- package/src/internal/AttemptAdmission.ts +76 -0
- package/src/internal/AttemptLifecycle.ts +163 -0
- package/src/internal/AttemptProbe.ts +90 -0
- package/src/internal/CacheAdmission.ts +133 -0
- package/src/internal/CacheAgeHistory.ts +58 -0
- package/src/internal/CacheAgeVerdicts.ts +61 -0
- package/src/internal/CacheOutputPolicy.ts +82 -0
- package/src/internal/CachePublication.ts +153 -0
- package/src/internal/CallFacts.ts +87 -0
- package/src/internal/CopiedRecord.ts +201 -0
- package/src/internal/DeferredPersistence.ts +459 -0
- package/src/internal/EffectRecords.ts +136 -0
- package/src/internal/EngineJj.ts +30 -0
- package/src/internal/EngineStateSchema.ts +92 -0
- package/src/internal/ExecutionSnapshotRead.ts +298 -0
- package/src/internal/ExecutionSnapshotRelations.ts +121 -0
- package/src/internal/ExitEncoding.ts +453 -0
- package/src/internal/FileBoundarySnapshot.ts +39 -0
- package/src/internal/FileEnumeration.ts +334 -0
- package/src/internal/HostReflection.ts +128 -0
- package/src/internal/JournalRecords.ts +396 -0
- package/src/internal/NodeJournal.ts +340 -0
- package/src/internal/Ordering.ts +14 -0
- package/src/internal/PlanInputs.ts +62 -0
- package/src/internal/PlanMerges.ts +123 -0
- package/src/internal/ProvenanceSlot.ts +52 -0
- package/src/internal/ResultEnvelope.ts +118 -0
- package/src/internal/RetentionOps.ts +865 -0
- package/src/internal/RunCatalogOps.ts +174 -0
- package/src/internal/RunCoordinator.ts +215 -0
- package/src/internal/RunDriver.ts +3152 -0
- package/src/internal/RunLifecycle.ts +53 -0
- package/src/internal/RunListing.ts +210 -0
- package/src/internal/RunListingError.ts +37 -0
- package/src/internal/RuntimeGraph.ts +253 -0
- package/src/internal/SandboxedExecution.ts +165 -0
- package/src/internal/StateTransaction.ts +71 -0
- package/src/internal/StepFacts.ts +36 -0
- package/src/internal/TypedEvents.ts +29 -0
- package/src/migrations/0001_initial.ts +51 -0
- package/src/migrations/0002_selection_store.ts +38 -0
- package/src/migrations/0003_plan_inputs.ts +75 -0
- package/src/migrations/0004_plan_environment.ts +34 -0
- package/src/migrations/0005_plan_merges.ts +60 -0
- package/src/migrations/0006_execution_listing.ts +86 -0
- package/src/migrations/0007_run_parent_sequence.ts +19 -0
- package/src/migrations/0008_deferred_consumption.ts +27 -0
- package/src/migrations/0009_deferred_clock_facts.ts +163 -0
- package/src/migrations/0010_pending_cancellation.ts +20 -0
- package/src/test/TestStores.ts +145 -0
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable deferred-completion and clock-deadline state used by the flow
|
|
3
|
+
* engine adapter.
|
|
4
|
+
*
|
|
5
|
+
* A parked run keeps the `suspended` status the run store admits; there is
|
|
6
|
+
* no `waiting` status. The waiting taxonomy lives beside it on the run row
|
|
7
|
+
* in the `waiting_reason`, `waiting_wake_at_ms`, `waiting_token`, and
|
|
8
|
+
* `waiting_request` columns, written by `park` and cleared by `wake`. See
|
|
9
|
+
* `docs/concepts/durable-waits.md`.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*/
|
|
13
|
+
import { DurableWriter } from "@smthrs/database/DurableWriter";
|
|
14
|
+
import type { OwnerId } from "@smthrs/run-store/Ownership";
|
|
15
|
+
import * as Cause from "effect/Cause";
|
|
16
|
+
import * as Context from "effect/Context";
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Layer from "effect/Layer";
|
|
19
|
+
import * as Option from "effect/Option";
|
|
20
|
+
import * as Schema from "effect/Schema";
|
|
21
|
+
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
|
22
|
+
import type { OnParentExit } from "./RunState.ts";
|
|
23
|
+
/**
|
|
24
|
+
* A position in pending admission creation order.
|
|
25
|
+
*
|
|
26
|
+
* @since 1.0.0
|
|
27
|
+
* @category models
|
|
28
|
+
*/
|
|
29
|
+
export interface PendingRunCursor {
|
|
30
|
+
readonly runId: string;
|
|
31
|
+
readonly createdAtMs: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The durable address of a deferred result.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
* @category models
|
|
38
|
+
*/
|
|
39
|
+
export declare const DeferredAddress: Schema.Struct<{
|
|
40
|
+
readonly flowName: Schema.NonEmptyString;
|
|
41
|
+
readonly executionId: Schema.NonEmptyString;
|
|
42
|
+
readonly deferredName: Schema.NonEmptyString;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* The durable address of a deferred result.
|
|
46
|
+
*
|
|
47
|
+
* @category models
|
|
48
|
+
* @since 0.1.0
|
|
49
|
+
*/
|
|
50
|
+
export type DeferredAddress = typeof DeferredAddress.Type;
|
|
51
|
+
/**
|
|
52
|
+
* The first durable completion recorded for a deferred.
|
|
53
|
+
*
|
|
54
|
+
* Correlation data remains opaque at this boundary. A future external-event
|
|
55
|
+
* layer owns its schema and authorization policy.
|
|
56
|
+
*
|
|
57
|
+
* @since 0.1.0
|
|
58
|
+
* @category models
|
|
59
|
+
*/
|
|
60
|
+
export declare const DeferredRow: Schema.Struct<{
|
|
61
|
+
readonly exit: Schema.Unknown;
|
|
62
|
+
readonly metadata: Schema.optionalKey<Schema.Unknown>;
|
|
63
|
+
readonly completedAtMs: Schema.Int;
|
|
64
|
+
readonly flowName: Schema.NonEmptyString;
|
|
65
|
+
readonly executionId: Schema.NonEmptyString;
|
|
66
|
+
readonly deferredName: Schema.NonEmptyString;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* The first durable completion recorded for a deferred.
|
|
70
|
+
*
|
|
71
|
+
* @category models
|
|
72
|
+
* @since 0.1.0
|
|
73
|
+
*/
|
|
74
|
+
export type DeferredRow = typeof DeferredRow.Type;
|
|
75
|
+
/**
|
|
76
|
+
* Result of a first-writer-wins deferred completion.
|
|
77
|
+
*
|
|
78
|
+
* @since 0.1.0
|
|
79
|
+
* @category models
|
|
80
|
+
*/
|
|
81
|
+
export type CompleteDeferredOutcome = {
|
|
82
|
+
readonly _tag: "Completed";
|
|
83
|
+
readonly row: DeferredRow;
|
|
84
|
+
readonly digest: DeferredDigest;
|
|
85
|
+
} | {
|
|
86
|
+
readonly _tag: "Existing";
|
|
87
|
+
readonly row: DeferredRow;
|
|
88
|
+
readonly digest: DeferredDigest;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The `JournalEvent.contentDigest` of a stored completion's encoded `exit`
|
|
92
|
+
* and `metadata` text. The journal fact that announces a completion carries
|
|
93
|
+
* these digests instead of the values, which stay in the row.
|
|
94
|
+
*
|
|
95
|
+
* @since 1.0.0
|
|
96
|
+
* @category models
|
|
97
|
+
*/
|
|
98
|
+
export interface DeferredDigest {
|
|
99
|
+
readonly exit: string;
|
|
100
|
+
readonly metadata: string | null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The durable address of a clock.
|
|
104
|
+
*
|
|
105
|
+
* @since 0.1.0
|
|
106
|
+
* @category models
|
|
107
|
+
*/
|
|
108
|
+
export declare const ClockAddress: Schema.Struct<{
|
|
109
|
+
readonly flowName: Schema.NonEmptyString;
|
|
110
|
+
readonly executionId: Schema.NonEmptyString;
|
|
111
|
+
readonly clockName: Schema.NonEmptyString;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* The durable address of a clock.
|
|
115
|
+
*
|
|
116
|
+
* @category models
|
|
117
|
+
* @since 0.1.0
|
|
118
|
+
*/
|
|
119
|
+
export type ClockAddress = typeof ClockAddress.Type;
|
|
120
|
+
/**
|
|
121
|
+
* A durable absolute clock deadline.
|
|
122
|
+
*
|
|
123
|
+
* @since 0.1.0
|
|
124
|
+
* @category models
|
|
125
|
+
*/
|
|
126
|
+
export declare const ClockRow: Schema.Struct<{
|
|
127
|
+
readonly deferredName: Schema.NonEmptyString;
|
|
128
|
+
readonly dueAtMs: Schema.Int;
|
|
129
|
+
readonly completedAtMs: Schema.NullOr<Schema.Int>;
|
|
130
|
+
readonly flowName: Schema.NonEmptyString;
|
|
131
|
+
readonly executionId: Schema.NonEmptyString;
|
|
132
|
+
readonly clockName: Schema.NonEmptyString;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* A durable absolute clock deadline.
|
|
136
|
+
*
|
|
137
|
+
* @category models
|
|
138
|
+
* @since 0.1.0
|
|
139
|
+
*/
|
|
140
|
+
export type ClockRow = typeof ClockRow.Type;
|
|
141
|
+
/**
|
|
142
|
+
* Result of scheduling a durable clock.
|
|
143
|
+
*
|
|
144
|
+
* @since 0.1.0
|
|
145
|
+
* @category models
|
|
146
|
+
*/
|
|
147
|
+
export type ScheduleClockOutcome = {
|
|
148
|
+
readonly _tag: "Scheduled";
|
|
149
|
+
readonly row: ClockRow;
|
|
150
|
+
} | {
|
|
151
|
+
readonly _tag: "Existing";
|
|
152
|
+
readonly row: ClockRow;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Result of completing a durable clock.
|
|
156
|
+
*
|
|
157
|
+
* @since 0.1.0
|
|
158
|
+
* @category models
|
|
159
|
+
*/
|
|
160
|
+
export type CompleteClockOutcome = {
|
|
161
|
+
readonly _tag: "Completed";
|
|
162
|
+
readonly row: ClockRow;
|
|
163
|
+
} | {
|
|
164
|
+
readonly _tag: "AlreadyCompleted";
|
|
165
|
+
readonly row: ClockRow;
|
|
166
|
+
} | {
|
|
167
|
+
readonly _tag: "NotFound";
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* The core wait-reason vocabulary a supervisor understands for wake policy.
|
|
171
|
+
*
|
|
172
|
+
* - `approval` — parked until a human (or policy) approves; woken by token.
|
|
173
|
+
* - `event` — parked on an external event / deferred completion.
|
|
174
|
+
* - `timer` — parked until `wakeAt`; woken by the durable clock sweep.
|
|
175
|
+
* - `quota` — parked on provider quota; woken at `wakeAt` when known.
|
|
176
|
+
* - `released` — the owning process released the run without settling it
|
|
177
|
+
* (shutdown, heartbeat self-interrupt; issue #39). A released row has no
|
|
178
|
+
* held lease and no `wakeAt`: any supervisor/sweeper MUST scan for this
|
|
179
|
+
* reason explicitly and re-drive the run through the claim path, or
|
|
180
|
+
* released runs are stranded forever (issue #67).
|
|
181
|
+
* - `quarantine` — parked because a SUCCEEDED attempt row's recorded
|
|
182
|
+
* evidence measured corrupt under the strict verdict (issue #171). The
|
|
183
|
+
* row cannot be evicted/re-executed like a cache row (its side effects
|
|
184
|
+
* already ran), so the corrupt boundary evidence is quarantined off the
|
|
185
|
+
* row while its durable outcome stays intact. No sweeper auto-wakes this
|
|
186
|
+
* reason: the strict integrity verdict remains visible until an explicit
|
|
187
|
+
* resume, which completes from the recorded outcome without re-execution.
|
|
188
|
+
*
|
|
189
|
+
* Left open (`string & {}`) so a plugin can park on a reason the core
|
|
190
|
+
* taxonomy has not named yet — the store persists whatever it is given
|
|
191
|
+
* rather than rejecting unknown reasons.
|
|
192
|
+
*
|
|
193
|
+
* @since 0.1.0
|
|
194
|
+
* @category models
|
|
195
|
+
*/
|
|
196
|
+
export declare const WaitingReason: Schema.NonEmptyString;
|
|
197
|
+
/**
|
|
198
|
+
* The open wait-reason vocabulary.
|
|
199
|
+
*
|
|
200
|
+
* @category models
|
|
201
|
+
* @since 0.1.0
|
|
202
|
+
*/
|
|
203
|
+
export type WaitingReason = typeof WaitingReason.Type;
|
|
204
|
+
/**
|
|
205
|
+
* The payload recorded when a run parks.
|
|
206
|
+
*
|
|
207
|
+
* `reason` and `wakeAt` earn columns because a supervisor sweeper queries
|
|
208
|
+
* them (`WHERE waiting_reason = 'quota' AND waiting_wake_at_ms <= ?`);
|
|
209
|
+
* `token` is compare-and-swap/lookup material a wake handler matches
|
|
210
|
+
* against.
|
|
211
|
+
*
|
|
212
|
+
* @since 0.1.0
|
|
213
|
+
* @category models
|
|
214
|
+
*/
|
|
215
|
+
export declare const Waiting: Schema.Struct<{
|
|
216
|
+
readonly reason: Schema.NonEmptyString;
|
|
217
|
+
readonly wakeAt: Schema.optional<Schema.Int>;
|
|
218
|
+
readonly token: Schema.optional<Schema.NonEmptyString>;
|
|
219
|
+
/**
|
|
220
|
+
* What the wait declared about itself: for a `HumanTask` park, the kind of
|
|
221
|
+
* answer it wants, the prompt, and the attempt budget.
|
|
222
|
+
*
|
|
223
|
+
* `reason` and `token` say that a person owes the run an answer and which
|
|
224
|
+
* wait point holds it. Neither says what was asked, and the question lives
|
|
225
|
+
* in an action payload of an execution that has released its owner, so a
|
|
226
|
+
* reader had nothing to render but the wait's own name. This is the question
|
|
227
|
+
* itself, as the JSON TEXT the declaring flow wrote, stored and cleared with
|
|
228
|
+
* the other waiting columns.
|
|
229
|
+
*/
|
|
230
|
+
readonly request: Schema.optional<Schema.String>;
|
|
231
|
+
}>;
|
|
232
|
+
/**
|
|
233
|
+
* The payload recorded when a run parks.
|
|
234
|
+
*
|
|
235
|
+
* @category models
|
|
236
|
+
* @since 0.1.0
|
|
237
|
+
*/
|
|
238
|
+
export type Waiting = typeof Waiting.Type;
|
|
239
|
+
/**
|
|
240
|
+
* A decoded waiting row for a parked run.
|
|
241
|
+
*
|
|
242
|
+
* @since 0.1.0
|
|
243
|
+
* @category models
|
|
244
|
+
*/
|
|
245
|
+
export declare const WaitingRow: Schema.Struct<{
|
|
246
|
+
readonly runId: Schema.NonEmptyString;
|
|
247
|
+
readonly reason: Schema.NonEmptyString;
|
|
248
|
+
readonly wakeAt: Schema.NullOr<Schema.Int>;
|
|
249
|
+
readonly token: Schema.NullOr<Schema.NonEmptyString>;
|
|
250
|
+
/** The question {@link Waiting} declared, absent on a park that declared none. */
|
|
251
|
+
readonly request: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
252
|
+
}>;
|
|
253
|
+
/**
|
|
254
|
+
* A decoded waiting row for a parked run.
|
|
255
|
+
*
|
|
256
|
+
* @category models
|
|
257
|
+
* @since 0.1.0
|
|
258
|
+
*/
|
|
259
|
+
export type WaitingRow = typeof WaitingRow.Type;
|
|
260
|
+
/**
|
|
261
|
+
* A `running` row whose owner stopped heartbeating, and the lease it froze on.
|
|
262
|
+
*
|
|
263
|
+
* The heartbeat identifies the lease: a sweep that remembers a refusal against
|
|
264
|
+
* one heartbeat must not apply it to a later stall of the same run.
|
|
265
|
+
*
|
|
266
|
+
* @category models
|
|
267
|
+
* @since 1.0.0
|
|
268
|
+
*/
|
|
269
|
+
export interface StaleRunningRow {
|
|
270
|
+
readonly runId: string;
|
|
271
|
+
readonly heartbeatAtMs: number;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* A predicate over `waitingRuns` — omitted fields are unconstrained.
|
|
275
|
+
*
|
|
276
|
+
* @since 0.1.0
|
|
277
|
+
* @category models
|
|
278
|
+
*/
|
|
279
|
+
export interface WaitingRunsFilter {
|
|
280
|
+
readonly reason?: string;
|
|
281
|
+
readonly dueBeforeMs?: number;
|
|
282
|
+
/**
|
|
283
|
+
* When `true`, only parked runs whose cancellation was durably requested
|
|
284
|
+
* (`flows_runs.cancel_requested_at_ms IS NOT NULL`). Lets the parked-run
|
|
285
|
+
* sweep fetch actionable rows instead of scanning every parked run and
|
|
286
|
+
* probing each with a `store.get` (issue #68). The in-memory
|
|
287
|
+
* implementation reads the flag from the `runs` view
|
|
288
|
+
* (`MemoryRunView.cancelRequestedAtMs`); without a view it stays
|
|
289
|
+
* permissive and the sweeper's own per-row guard decides.
|
|
290
|
+
*/
|
|
291
|
+
readonly cancelRequested?: boolean;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Result of recording that a run parked on a waiting reason.
|
|
295
|
+
*
|
|
296
|
+
* @since 0.1.0
|
|
297
|
+
* @category models
|
|
298
|
+
*/
|
|
299
|
+
export type ParkOutcome = {
|
|
300
|
+
readonly _tag: "Parked";
|
|
301
|
+
readonly row: WaitingRow;
|
|
302
|
+
} | {
|
|
303
|
+
readonly _tag: "NotFound";
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Result of clearing a run's waiting payload on wake.
|
|
307
|
+
*
|
|
308
|
+
* @since 0.1.0
|
|
309
|
+
* @category models
|
|
310
|
+
*/
|
|
311
|
+
export type WakeOutcome = {
|
|
312
|
+
readonly _tag: "Woken";
|
|
313
|
+
readonly row: WaitingRow;
|
|
314
|
+
} | {
|
|
315
|
+
readonly _tag: "NotWaiting";
|
|
316
|
+
} | {
|
|
317
|
+
readonly _tag: "NotFound";
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* A durable parent edge in the run DAG.
|
|
321
|
+
*
|
|
322
|
+
* The run row's `state_json` carries only the first (creating) parent; a
|
|
323
|
+
* diamond gives a run a second parent the row cannot express. Cycle
|
|
324
|
+
* detection must see every edge from every owner process and across
|
|
325
|
+
* restarts (issues #40/#41), so edges are persisted here. `seq` is a
|
|
326
|
+
* store-global insertion order used only to list a run's parents oldest
|
|
327
|
+
* first (and to make the cycle walk deterministic); it no longer arbitrates
|
|
328
|
+
* anything, so duplicate values would be harmless (issues #54/#66).
|
|
329
|
+
*
|
|
330
|
+
* @since 0.1.0
|
|
331
|
+
* @category models
|
|
332
|
+
*/
|
|
333
|
+
export declare const RunParentEdge: Schema.Struct<{
|
|
334
|
+
readonly childId: Schema.NonEmptyString;
|
|
335
|
+
readonly parentId: Schema.NonEmptyString;
|
|
336
|
+
readonly seq: Schema.Int;
|
|
337
|
+
}>;
|
|
338
|
+
/**
|
|
339
|
+
* A durable parent edge in the run DAG.
|
|
340
|
+
*
|
|
341
|
+
* @category models
|
|
342
|
+
* @since 0.1.0
|
|
343
|
+
*/
|
|
344
|
+
export type RunParentEdge = typeof RunParentEdge.Type;
|
|
345
|
+
/**
|
|
346
|
+
* The surviving attempt rows of one action key: the earliest surviving
|
|
347
|
+
* row's start time and the highest attempt number contiguous from it.
|
|
348
|
+
*
|
|
349
|
+
* @since 0.1.0
|
|
350
|
+
* @category models
|
|
351
|
+
*/
|
|
352
|
+
export declare const AttemptSurvivors: Schema.Struct<{
|
|
353
|
+
/**
|
|
354
|
+
* The lowest surviving attempt number. Anything above 1 means the prune
|
|
355
|
+
* job removed a leading run of attempts; the engine store applies the
|
|
356
|
+
* pruned-prefix tolerance to it so both survivor paths agree (issue #96).
|
|
357
|
+
*/
|
|
358
|
+
readonly earliestAttempt: Schema.Int;
|
|
359
|
+
readonly earliestStartedAtMs: Schema.Int;
|
|
360
|
+
readonly latest: Schema.Int;
|
|
361
|
+
}>;
|
|
362
|
+
/**
|
|
363
|
+
* The surviving attempt range of one action key.
|
|
364
|
+
*
|
|
365
|
+
* @category models
|
|
366
|
+
* @since 0.1.0
|
|
367
|
+
*/
|
|
368
|
+
export type AttemptSurvivors = typeof AttemptSurvivors.Type;
|
|
369
|
+
declare const RunParentCycleError_base: Schema.Class<RunParentCycleError, Schema.TaggedStruct<"@smthrs/engine-store/RunParentCycleError", {
|
|
370
|
+
readonly path: Schema.$Array<Schema.String>;
|
|
371
|
+
}>, Cause.YieldableError>;
|
|
372
|
+
/**
|
|
373
|
+
* Recording a parent edge would close a cycle in the run DAG.
|
|
374
|
+
*
|
|
375
|
+
* Raised from inside the same transaction that inserted the edge, which is
|
|
376
|
+
* rolled back: a rejected edge leaves no durable trace anywhere (issues
|
|
377
|
+
* #54/#55/#56). `path` lists execution ids from the child back to itself
|
|
378
|
+
* through its would-be ancestors, matching the engine's
|
|
379
|
+
* `FlowCycleDetected.path` shape.
|
|
380
|
+
*
|
|
381
|
+
* @since 0.1.0
|
|
382
|
+
* @category errors
|
|
383
|
+
*/
|
|
384
|
+
export declare class RunParentCycleError extends RunParentCycleError_base {
|
|
385
|
+
}
|
|
386
|
+
declare const EngineStateFault_base: Schema.Class<EngineStateFault, Schema.TaggedStruct<"@smthrs/engine-store/EngineStateFault", {
|
|
387
|
+
readonly reason: Schema.Literals<readonly ["value_not_serializable", "value_not_decodable", "deferred_completion_missing", "run_parent_edge_missing"]>;
|
|
388
|
+
readonly field: Schema.optional<Schema.String>;
|
|
389
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
390
|
+
}>, Cause.YieldableError>;
|
|
391
|
+
/**
|
|
392
|
+
* A durable engine-state invariant broke: a defect (a bug), never a typed
|
|
393
|
+
* failure.
|
|
394
|
+
*
|
|
395
|
+
* `value_not_serializable` and `value_not_decodable` name the JSON column
|
|
396
|
+
* (`field`) whose value could not be written or read back.
|
|
397
|
+
* `deferred_completion_missing` and `run_parent_edge_missing` mean a row a
|
|
398
|
+
* first-writer transaction just lost to was gone when read.
|
|
399
|
+
*
|
|
400
|
+
* @since 1.0.0
|
|
401
|
+
* @category errors
|
|
402
|
+
*/
|
|
403
|
+
export declare class EngineStateFault extends EngineStateFault_base {
|
|
404
|
+
get message(): string;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Result of recording a durable parent edge (idempotent).
|
|
408
|
+
*
|
|
409
|
+
* @since 0.1.0
|
|
410
|
+
* @category models
|
|
411
|
+
*/
|
|
412
|
+
export type RecordRunParentOutcome = {
|
|
413
|
+
readonly _tag: "Recorded";
|
|
414
|
+
readonly edge: RunParentEdge;
|
|
415
|
+
} | {
|
|
416
|
+
readonly _tag: "Existing";
|
|
417
|
+
readonly edge: RunParentEdge;
|
|
418
|
+
};
|
|
419
|
+
/**
|
|
420
|
+
* Minimal durable state missing from the current `@smthrs/journal` contract.
|
|
421
|
+
*
|
|
422
|
+
* A successful mutation means the row is durable. Callers may therefore
|
|
423
|
+
* journal and schedule a wake only after the mutation returns. Deferred and
|
|
424
|
+
* clock state belong to this package for 1.0.
|
|
425
|
+
*
|
|
426
|
+
* @since 0.1.0
|
|
427
|
+
* @category models
|
|
428
|
+
*/
|
|
429
|
+
export interface Service {
|
|
430
|
+
readonly deferred: (address: DeferredAddress) => Effect.Effect<Option.Option<DeferredRow>>;
|
|
431
|
+
/**
|
|
432
|
+
* Marks an existing result observed without removing its replay evidence.
|
|
433
|
+
* Returns whether this call consumed it: false when there is no result or
|
|
434
|
+
* it was already consumed.
|
|
435
|
+
*/
|
|
436
|
+
readonly consumeDeferred: (address: DeferredAddress, consumedAtMs: number) => Effect.Effect<boolean>;
|
|
437
|
+
readonly completeDeferred: (row: DeferredRow) => Effect.Effect<CompleteDeferredOutcome>;
|
|
438
|
+
readonly clock: (address: ClockAddress) => Effect.Effect<Option.Option<ClockRow>>;
|
|
439
|
+
/**
|
|
440
|
+
* Schedules a clock while the execution is running under the supplied owner.
|
|
441
|
+
* An existing clock wins unchanged, even after ownership is lost. If no
|
|
442
|
+
* clock exists and the ownership fence fails, the effect self-interrupts.
|
|
443
|
+
*/
|
|
444
|
+
readonly scheduleClock: (row: ClockRow, owner: OwnerId) => Effect.Effect<ScheduleClockOutcome>;
|
|
445
|
+
readonly completeClock: (address: ClockAddress, completedAtMs: number) => Effect.Effect<CompleteClockOutcome>;
|
|
446
|
+
readonly dueClocks: (nowMs: number) => Effect.Effect<ReadonlyArray<ClockRow>>;
|
|
447
|
+
/**
|
|
448
|
+
* Completes every uncompleted clock row of one run in a single statement.
|
|
449
|
+
*
|
|
450
|
+
* A run that settled has no future: a timer that fires against it can only
|
|
451
|
+
* schedule a resume nothing will drive. Terminal transitions call this in
|
|
452
|
+
* their own transaction, so the rows stop being pending with the run rather
|
|
453
|
+
* than lingering as durable work no sweep will ever finish.
|
|
454
|
+
*
|
|
455
|
+
* It takes the run id rather than a clock address because the caller is
|
|
456
|
+
* closing a RUN, and it does not read the run row, so it composes with a
|
|
457
|
+
* terminal transition in either order.
|
|
458
|
+
*/
|
|
459
|
+
readonly completeRunClocks: (executionId: string, completedAtMs: number) => Effect.Effect<ReadonlyArray<ClockRow>>;
|
|
460
|
+
/**
|
|
461
|
+
* Lists uncompleted clock rows scoped to an execution or flow, with no
|
|
462
|
+
* due-time bound. Suspension-reason derivation and registration-time
|
|
463
|
+
* recovery use this instead of abusing `dueClocks` as an all-clocks
|
|
464
|
+
* listing (issue #35): `dueClocks` is a due-timer sweeper query and may
|
|
465
|
+
* grow a result cap without affecting park correctness.
|
|
466
|
+
*
|
|
467
|
+
* Rows belonging to a settled run are never listed. Registration sweeps
|
|
468
|
+
* this to re-arm timers, so without the run-status join every restart armed
|
|
469
|
+
* one timer per clock row a flow ever wrote, for runs that ended long ago.
|
|
470
|
+
*/
|
|
471
|
+
readonly pendingClocks: (scope: {
|
|
472
|
+
readonly executionId?: string;
|
|
473
|
+
readonly flowName?: string;
|
|
474
|
+
}) => Effect.Effect<ReadonlyArray<ClockRow>>;
|
|
475
|
+
/**
|
|
476
|
+
* Lists unconsumed completed deferred addresses for registration-time wake recovery.
|
|
477
|
+
* Observed results remain readable through `deferred` but cannot re-drive a
|
|
478
|
+
* run that has moved on to a later wait.
|
|
479
|
+
*
|
|
480
|
+
* Rows belonging to a settled run are never listed, for the reason
|
|
481
|
+
* {@link Service.pendingClocks} gives: this is swept on every registration,
|
|
482
|
+
* and one resume per completion in a flow's whole history is unbounded work
|
|
483
|
+
* that can wake nothing.
|
|
484
|
+
*/
|
|
485
|
+
readonly completedDeferreds: (flowName: string) => Effect.Effect<ReadonlyArray<DeferredAddress>>;
|
|
486
|
+
/**
|
|
487
|
+
* Records the waiting-reason payload for a parked run, fenced to the
|
|
488
|
+
* current owner so a stale process cannot park a run it no longer runs.
|
|
489
|
+
*/
|
|
490
|
+
readonly park: (runId: string, waiting: Waiting, owner: OwnerId) => Effect.Effect<ParkOutcome>;
|
|
491
|
+
/**
|
|
492
|
+
* Clears a run's waiting payload on wake or resume. Idempotent: waking a
|
|
493
|
+
* run that is not waiting reports `NotWaiting` rather than failing.
|
|
494
|
+
*/
|
|
495
|
+
readonly wake: (runId: string) => Effect.Effect<WakeOutcome>;
|
|
496
|
+
/**
|
|
497
|
+
* Reads the current waiting payload for a run, if any.
|
|
498
|
+
*/
|
|
499
|
+
readonly waiting: (runId: string) => Effect.Effect<Option.Option<WaitingRow>>;
|
|
500
|
+
/**
|
|
501
|
+
* Reads the waiting payloads of a run AND of every execution beneath it.
|
|
502
|
+
*
|
|
503
|
+
* A flow that calls another flow parks the CHILD execution, not the run an
|
|
504
|
+
* operator named: `coding/request` sat at `waiting_reason = 'event'` while
|
|
505
|
+
* the `HumanTask` a person actually had to answer was three executions down,
|
|
506
|
+
* on `coding/PreparePlan`. Reading one row therefore answered "nothing is
|
|
507
|
+
* waiting on you" about a run tree that was waiting on a person, which is
|
|
508
|
+
* how run-3 parked forever with an empty approvals inbox.
|
|
509
|
+
*
|
|
510
|
+
* The walk follows every `flows_run_parents` spawn edge and `parent_run_id`
|
|
511
|
+
* link, so it sees shared children, forks, and trampoline rounds alike.
|
|
512
|
+
* Each run appears once, ordered by minimum depth, creation time, then run
|
|
513
|
+
* ID; the named run comes first. Rows of a settled execution are never
|
|
514
|
+
* listed — a wait a finished execution left behind is not one a person
|
|
515
|
+
* can answer.
|
|
516
|
+
*
|
|
517
|
+
* A DETACHED child and everything under it are skipped. `onParentExit:
|
|
518
|
+
* "detach"` is a fire-and-forget spawn whose whole point is to outlive the
|
|
519
|
+
* run that started it, so its question is not one the run that started it is
|
|
520
|
+
* waiting on, and reporting it here would tell a reader that a run which can
|
|
521
|
+
* proceed cannot. Every other edge is attached: the run is waiting for that
|
|
522
|
+
* child's value, whether its own row has flipped to `suspended` yet or not.
|
|
523
|
+
* Trampoline links continue the same run, so an inherited detach policy
|
|
524
|
+
* does not hide later rounds from that run's own tree.
|
|
525
|
+
*
|
|
526
|
+
* `{ detached: "include" }` walks detached subtrees too, for a caller asking
|
|
527
|
+
* what an explicit resume of the run would restart rather than what the run
|
|
528
|
+
* itself waits on.
|
|
529
|
+
*/
|
|
530
|
+
readonly waitingTree: (runId: string, options?: WaitingTreeOptions | undefined) => Effect.Effect<ReadonlyArray<WaitingRow>>;
|
|
531
|
+
/**
|
|
532
|
+
* Lists parked runs matching an optional reason/due-before filter, ordered
|
|
533
|
+
* for sweeper consumption (earliest wake first, untimed waits last, then
|
|
534
|
+
* run id to break ties).
|
|
535
|
+
*/
|
|
536
|
+
readonly waitingRuns: (filter?: WaitingRunsFilter) => Effect.Effect<ReadonlyArray<WaitingRow>>;
|
|
537
|
+
/** Pending admissions ordered by creation, strictly after and through optional cursors. */
|
|
538
|
+
readonly pendingRuns: (flowName: string, limit?: number | undefined, after?: PendingRunCursor | undefined, through?: PendingRunCursor | undefined, eligibleBeforeMs?: number | undefined) => Effect.Effect<ReadonlyArray<PendingRunCursor>>;
|
|
539
|
+
/** Latest pending admission, bounding one finite recovery scan cycle. */
|
|
540
|
+
readonly pendingRunTail: (flowName: string, eligibleBeforeMs?: number | undefined) => Effect.Effect<Option.Option<PendingRunCursor>>;
|
|
541
|
+
/** Pending cancellation requests in bounded creation order; limit is zero or a positive safe integer. */
|
|
542
|
+
readonly pendingCancellationRuns: (limit: number, after?: PendingRunCursor | undefined, through?: PendingRunCursor | undefined) => Effect.Effect<ReadonlyArray<PendingRunCursor>>;
|
|
543
|
+
/** Latest pending cancellation, bounding one finite cleanup scan cycle. */
|
|
544
|
+
readonly pendingCancellationTail: () => Effect.Effect<Option.Option<PendingRunCursor>>;
|
|
545
|
+
/**
|
|
546
|
+
* Lists the runs whose row is `running` with a heartbeat strictly older
|
|
547
|
+
* than `staleBeforeMs`, each with that heartbeat — an owner that stopped heartbeating without
|
|
548
|
+
* releasing the run (SIGKILL, OOM, power loss). Nothing else ever
|
|
549
|
+
* revisits such a run: it has no waiting row for the parked-run sweep,
|
|
550
|
+
* no pending clock, and no future deferred completion. A periodic
|
|
551
|
+
* sweeper re-drives these through the ordinary claim/steal path — the
|
|
552
|
+
* analog of Temporal's task-timeout re-dispatch (issue #53).
|
|
553
|
+
*
|
|
554
|
+
* `limit` caps one enumeration (issue #79): the rows come back oldest
|
|
555
|
+
* heartbeat first, so a capped sweep drains a mass owner death across
|
|
556
|
+
* ticks instead of waking every stale run in every driver every tick.
|
|
557
|
+
*/
|
|
558
|
+
readonly staleRunningRuns: (staleBeforeMs: number, limit?: number | undefined) => Effect.Effect<ReadonlyArray<StaleRunningRow>>;
|
|
559
|
+
/**
|
|
560
|
+
* The surviving attempt rows for an action key, in one range read: the
|
|
561
|
+
* earliest surviving row's start time (the durable retry origin when
|
|
562
|
+
* attempt 1 itself was pruned, issue #69) and the highest attempt number
|
|
563
|
+
* contiguous from it (the resumed attempt counter, issue #59).
|
|
564
|
+
* `Option.none()` means no attempt row survives.
|
|
565
|
+
*
|
|
566
|
+
* Optional because only storage that can range-scan `flows_attempts`
|
|
567
|
+
* implements it; when absent the engine store falls back to per-attempt
|
|
568
|
+
* point reads against `AttemptStore` (issue #77).
|
|
569
|
+
*/
|
|
570
|
+
readonly attemptSurvivors?: ((runId: string, stepKeyDigest: string) => Effect.Effect<Option.Option<AttemptSurvivors>>) | undefined;
|
|
571
|
+
/**
|
|
572
|
+
* Durably records a parent edge in the run DAG, first-writer-wins per
|
|
573
|
+
* `(child, parent)` pair.
|
|
574
|
+
*
|
|
575
|
+
* The cycle check happens inside the same transaction as the insert: the
|
|
576
|
+
* edge is inserted, the child's ancestor chain is walked over the durable
|
|
577
|
+
* edges, and on a hit the transaction rolls back and the call fails with
|
|
578
|
+
* `RunParentCycleError`. There is no window between insert and check, no
|
|
579
|
+
* arbitration, and no withdrawal protocol — concurrent writers that
|
|
580
|
+
* jointly close a cycle serialize on the write transaction and exactly
|
|
581
|
+
* one of them fails (issues #29/#40/#54/#55/#56).
|
|
582
|
+
*/
|
|
583
|
+
readonly recordRunParent: (childId: string, parentId: string) => Effect.Effect<RecordRunParentOutcome, RunParentCycleError>;
|
|
584
|
+
/**
|
|
585
|
+
* Removes every parent edge touching a run — both the edges naming it as
|
|
586
|
+
* child and the edges naming it as parent. The cleanup half of run
|
|
587
|
+
* deletion (issue #66): a lane that deletes run rows (time-travel,
|
|
588
|
+
* retention) must call this so `runParents` and the cycle walk stop
|
|
589
|
+
* seeing edges of runs that no longer exist.
|
|
590
|
+
*/
|
|
591
|
+
readonly removeRunParentsForRun: (runId: string) => Effect.Effect<void>;
|
|
592
|
+
/**
|
|
593
|
+
* Lists the durably recorded parent edges of a run, oldest first.
|
|
594
|
+
*/
|
|
595
|
+
readonly runParents: (childId: string) => Effect.Effect<ReadonlyArray<RunParentEdge>>;
|
|
596
|
+
/**
|
|
597
|
+
* Lists the durably recorded child edges of a run, oldest first.
|
|
598
|
+
*
|
|
599
|
+
* The reverse direction of `runParents`, and the only instance-independent
|
|
600
|
+
* way to find the runs a cancelled parent linked to itself. Cancellation
|
|
601
|
+
* cascade reads it rather than an in-process instance map, so a
|
|
602
|
+
* cross-process cancel observed by a driver that never spawned the children
|
|
603
|
+
* still reaches them (`docs/concepts/durable-waits.md`, "The run DAG").
|
|
604
|
+
* Served by the
|
|
605
|
+
* `flows_run_parents_parent_idx` index.
|
|
606
|
+
*/
|
|
607
|
+
readonly runChildren: (parentId: string) => Effect.Effect<ReadonlyArray<RunParentEdge>>;
|
|
608
|
+
/**
|
|
609
|
+
* Runs `effect` inside one storage write transaction, so a caller can make
|
|
610
|
+
* several store operations atomic — the run driver wraps the parent-edge
|
|
611
|
+
* record and the run-row creation it guards, closing the crash window that
|
|
612
|
+
* left a durable orphan edge for a run that was never created (issue #80).
|
|
613
|
+
* Nested store writes become savepoints of this transaction. Storage
|
|
614
|
+
* failures are defects, matching the store methods' own posture.
|
|
615
|
+
*
|
|
616
|
+
* The in-memory twin honors the same contract: it serializes every store
|
|
617
|
+
* operation behind one permit, snapshots its state maps on entry, restores
|
|
618
|
+
* them when the effect fails or dies, and treats a nested call on the same
|
|
619
|
+
* fiber as a savepoint of the outer one. What it cannot offer is
|
|
620
|
+
* durability: a process crash mid-transaction loses the whole state, not
|
|
621
|
+
* only the uncommitted part.
|
|
622
|
+
*
|
|
623
|
+
* **Lock order.** A caller that needs this transaction AND the journal's
|
|
624
|
+
* write transaction opens this one OUTSIDE. The SQL implementation cannot
|
|
625
|
+
* tell the difference, because both are the same `DurableWriter`
|
|
626
|
+
* transaction and either nests as a savepoint of the other; the memory twin
|
|
627
|
+
* has a permit of its own, and a fiber that holds the journal's writer
|
|
628
|
+
* while waiting for that permit deadlocks against a fiber doing the
|
|
629
|
+
* opposite. Interruption is not a way out of that cycle: both boundaries
|
|
630
|
+
* are acquired at the caller's own interruptibility, so a settlement that
|
|
631
|
+
* masked interruption to finish its write keeps waiting. The same
|
|
632
|
+
* rule applies to every single operation above, each of which takes the
|
|
633
|
+
* permit for itself: inside an open journal transaction, call them only
|
|
634
|
+
* under an enclosing `transaction` on the same fiber.
|
|
635
|
+
*/
|
|
636
|
+
readonly transaction: <A, E, R>(effect: Effect.Effect<A, E, R>, options?: {
|
|
637
|
+
/**
|
|
638
|
+
* Receives an idempotent memory commit effect. A coordinating durable
|
|
639
|
+
* transaction may run it after COMMIT, before publishing or capturing
|
|
640
|
+
* state. This accepts the snapshot and releases its gate; subsequent
|
|
641
|
+
* publication failures cannot restore the old snapshot. Without an
|
|
642
|
+
* external boundary, returning successfully commits as usual. SQL owns
|
|
643
|
+
* its commit boundary and does not need this callback.
|
|
644
|
+
*/
|
|
645
|
+
readonly onCommit: (commit: Effect.Effect<void>) => void;
|
|
646
|
+
}) => Effect.Effect<A, E, R>;
|
|
647
|
+
}
|
|
648
|
+
declare const DurableEngineState_base: Context.ServiceClass<DurableEngineState, "@smthrs/engine-store/DurableEngineState", Service>;
|
|
649
|
+
/**
|
|
650
|
+
* Service tag for durable deferred completions and absolute clock deadlines.
|
|
651
|
+
*
|
|
652
|
+
* @since 0.1.0
|
|
653
|
+
* @category services
|
|
654
|
+
*/
|
|
655
|
+
export declare class DurableEngineState extends DurableEngineState_base {
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* How far {@link Service.waitingTree} walks: detached subtrees are skipped
|
|
659
|
+
* unless `detached` is `"include"`.
|
|
660
|
+
*
|
|
661
|
+
* @since 1.0.0
|
|
662
|
+
* @category models
|
|
663
|
+
*/
|
|
664
|
+
export interface WaitingTreeOptions {
|
|
665
|
+
readonly detached?: "skip" | "include" | undefined;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* The deepest nesting {@link Service.waitingTree} walks.
|
|
669
|
+
*
|
|
670
|
+
* A run tree is authored, not generated: `agent/run` → `coding/request` →
|
|
671
|
+
* `coding/Request` → `coding/PrepareWithWiki` → `coding/PreparePlan` is five,
|
|
672
|
+
* and the deepest composition in this repository is well inside this. The cap
|
|
673
|
+
* exists so a tree whose edges were corrupted outside the engine costs a
|
|
674
|
+
* bounded read rather than the whole table.
|
|
675
|
+
*
|
|
676
|
+
* @since 1.0.0
|
|
677
|
+
* @category constants
|
|
678
|
+
*/
|
|
679
|
+
export declare const waitingTreeMaxDepth = 64;
|
|
680
|
+
/**
|
|
681
|
+
* Constructs the database-backed durable-state implementation.
|
|
682
|
+
*
|
|
683
|
+
* Clock creation is fenced against the current run owner. Deferred completion
|
|
684
|
+
* and clock firing are external trigger admissions protected by first-writer
|
|
685
|
+
* and compare-and-set semantics; execution remains claim-gated by `RunStore`.
|
|
686
|
+
*
|
|
687
|
+
* @since 0.1.0
|
|
688
|
+
* @category constructors
|
|
689
|
+
*/
|
|
690
|
+
export declare const make: Effect.Effect<Service, never, DurableWriter | SqlClient.SqlClient>;
|
|
691
|
+
/**
|
|
692
|
+
* Provides database-backed durable engine state.
|
|
693
|
+
*
|
|
694
|
+
* @since 0.1.0
|
|
695
|
+
* @category layers
|
|
696
|
+
*/
|
|
697
|
+
export declare const layer: Layer.Layer<DurableEngineState, never, DurableWriter | SqlClient.SqlClient>;
|
|
698
|
+
/**
|
|
699
|
+
* A run's ownership view as the in-memory implementation needs it for the
|
|
700
|
+
* same fences the SQL implementation reads from `flows_runs`.
|
|
701
|
+
*
|
|
702
|
+
* @since 0.1.0
|
|
703
|
+
* @category models
|
|
704
|
+
*/
|
|
705
|
+
export interface MemoryRunView {
|
|
706
|
+
readonly flowName?: string | undefined;
|
|
707
|
+
readonly createdAtMs?: number | undefined;
|
|
708
|
+
readonly status: "pending" | "running" | "suspended" | "completed" | "failed" | "cancelled";
|
|
709
|
+
readonly owner: OwnerId | null;
|
|
710
|
+
/**
|
|
711
|
+
* The run's last heartbeat instant, mirroring `flows_runs.heartbeat_at_ms`.
|
|
712
|
+
* `undefined` means unknown — such a run never surfaces from
|
|
713
|
+
* `staleRunningRuns` (issue #53).
|
|
714
|
+
*/
|
|
715
|
+
readonly heartbeatAtMs?: number | null | undefined;
|
|
716
|
+
/**
|
|
717
|
+
* The run's durable cancel request, mirroring
|
|
718
|
+
* `flows_runs.cancel_requested_at_ms`. `undefined`/`null` means not
|
|
719
|
+
* requested — such a run never surfaces from a
|
|
720
|
+
* `waitingRuns({ cancelRequested: true })` query (issue #68).
|
|
721
|
+
*/
|
|
722
|
+
readonly cancelRequestedAtMs?: number | null | undefined;
|
|
723
|
+
/**
|
|
724
|
+
* What this run does when the run that spawned it ends, mirroring
|
|
725
|
+
* `RunState.onParentExit`. `undefined` reads as `cancel`, the default and
|
|
726
|
+
* the shape a `.child()` boundary takes, so a view that does not record it
|
|
727
|
+
* describes an attached child.
|
|
728
|
+
*/
|
|
729
|
+
readonly onParentExit?: OnParentExit | undefined;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Options for the in-memory durable-state implementation.
|
|
733
|
+
*
|
|
734
|
+
* @since 0.1.0
|
|
735
|
+
* @category models
|
|
736
|
+
*/
|
|
737
|
+
export interface MemoryOptions {
|
|
738
|
+
/**
|
|
739
|
+
* Resolves a run's existence, status, and owner — the in-memory analogue
|
|
740
|
+
* of the `flows_runs` lookups the SQL implementation performs for its
|
|
741
|
+
* `park`/`wake`/`scheduleClock` fences. `Option.none()` means the run does
|
|
742
|
+
* not exist. When omitted, every run is treated as running and owned by
|
|
743
|
+
* whichever owner is presented (a deliberately permissive default for tests
|
|
744
|
+
* that exercise only deferred/clock state without a run table).
|
|
745
|
+
*/
|
|
746
|
+
readonly runs?: (runId: string) => Option.Option<MemoryRunView>;
|
|
747
|
+
/**
|
|
748
|
+
* Enumerates every known run — the in-memory analogue of scanning
|
|
749
|
+
* `flows_runs`, which `staleRunningRuns` needs (the `runs` lookup alone
|
|
750
|
+
* cannot enumerate). When omitted, `staleRunningRuns` reports no stale
|
|
751
|
+
* rows.
|
|
752
|
+
*/
|
|
753
|
+
readonly listRuns?: () => Iterable<readonly [string, MemoryRunView]>;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Constructs a deterministic in-memory durable-state implementation.
|
|
757
|
+
*
|
|
758
|
+
* The returned service can be shared by multiple fresh engine instances in a
|
|
759
|
+
* test to model process restart over the same storage. With `runs` supplied
|
|
760
|
+
* it enforces the same ownership fences as the SQL implementation and is
|
|
761
|
+
* held to the same contract suite
|
|
762
|
+
* (`test/contract/DurableEngineStateContract.ts`).
|
|
763
|
+
*
|
|
764
|
+
* @since 0.1.0
|
|
765
|
+
* @category constructors
|
|
766
|
+
*/
|
|
767
|
+
export declare const makeMemory: (options?: MemoryOptions) => Service;
|
|
768
|
+
/**
|
|
769
|
+
* Provides deterministic in-memory durable engine state.
|
|
770
|
+
*
|
|
771
|
+
* @since 0.1.0
|
|
772
|
+
* @category layers
|
|
773
|
+
*/
|
|
774
|
+
export declare const layerMemory: Layer.Layer<DurableEngineState>;
|
|
775
|
+
export {};
|
|
776
|
+
//# sourceMappingURL=DurableEngineState.d.ts.map
|