@smthrs/engine-store 0.0.0-stage → 1.0.0-rc.4
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 +201 -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 +1586 -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 +300 -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 +3154 -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,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encoding a round's settlement so a terminal transition can never be lost.
|
|
3
|
+
*
|
|
4
|
+
* A run row leaves `running` only when the driver has bytes to write into
|
|
5
|
+
* `state_json`, and those bytes come from the flow's OWN codec:
|
|
6
|
+
* `Flow.Result({ success: flow.successSchema, error: flow.errorSchema })`.
|
|
7
|
+
* A flow that declares `Schema.Unknown` for either channel — which is what
|
|
8
|
+
* `@smthrs/agent`'s `agent/run` declares, because an agent run carries
|
|
9
|
+
* whatever its body failed with — encodes that channel through `Schema.Json`,
|
|
10
|
+
* and `Schema.Json` rejects every class instance: `SchemaAST.isJson` walks the
|
|
11
|
+
* prototype chain and refuses anything that is not a plain object or an array.
|
|
12
|
+
* Every `Data.TaggedError` in this repository is therefore unencodable through
|
|
13
|
+
* such a flow, `HarnessError` and `ModelError` included.
|
|
14
|
+
*
|
|
15
|
+
* Guarding the terminal transition with `Effect.orDie` around that encode made
|
|
16
|
+
* an unencodable failure fatal for the drain instead of terminal for the run.
|
|
17
|
+
* The release validation caught the whole chain: `engine-store: coordinated
|
|
18
|
+
* drain failed for run-1 SchemaError: Expected JSON value at
|
|
19
|
+
* ["exit"]["cause"][0]["error"]`, `engine.db` `flows_runs` left at `running`
|
|
20
|
+
* with a dead owner pid while `control.db` said `failed`, and 86 seconds later
|
|
21
|
+
* the next process's stale-running sweep stole the row, opened a second turn,
|
|
22
|
+
* and billed the provider seat again for a run the control plane had closed.
|
|
23
|
+
*
|
|
24
|
+
* So the encode fails CLOSED here rather than open. The ordinary path is the
|
|
25
|
+
* flow's own codec, unchanged. When that codec rejects the value, the result
|
|
26
|
+
* is still written — as a JSON projection of what could not be encoded (tag,
|
|
27
|
+
* code, message, a stack summary, and nested causes) inside a `Die` reason —
|
|
28
|
+
* and the caller is told, through {@link EncodedResult.note}, that it must
|
|
29
|
+
* settle the run `failed`. A settled run is never re-executed, which is the
|
|
30
|
+
* durability promise the release policy states as one terminal write.
|
|
31
|
+
*
|
|
32
|
+
* The projection is built as plain JSON rather than re-encoded through a
|
|
33
|
+
* schema, so nothing in this module can raise. Its top-level object carries no
|
|
34
|
+
* `message` key on purpose: `Schema.Defect` revives any JSON object that has a
|
|
35
|
+
* string `message` as an `Error`, and a projection has to come back out of the
|
|
36
|
+
* row as the structured record it went in as.
|
|
37
|
+
*
|
|
38
|
+
* @since 0.1.0
|
|
39
|
+
*/
|
|
40
|
+
import { Flow } from "@smthrs/flow";
|
|
41
|
+
import { Redaction } from "@smthrs/journal";
|
|
42
|
+
import * as Effect from "effect/Effect";
|
|
43
|
+
import * as Exit from "effect/Exit";
|
|
44
|
+
import * as Schema from "effect/Schema";
|
|
45
|
+
import * as HostReflection from "./HostReflection.js";
|
|
46
|
+
/**
|
|
47
|
+
* Proxy and native-error detection, taken from the host that can answer them.
|
|
48
|
+
*
|
|
49
|
+
* `./HostReflection.ts` states why these are host predicates rather than a
|
|
50
|
+
* `node:util/types` import: the module has to bundle for a browser, and only
|
|
51
|
+
* some hosts can name a proxy at all.
|
|
52
|
+
*/
|
|
53
|
+
const { isNativeError, isProxy } = HostReflection.host;
|
|
54
|
+
/**
|
|
55
|
+
* The `_tag` every projection carries, so a reader of `state_json` can tell a
|
|
56
|
+
* projected settlement from an encoded one without guessing.
|
|
57
|
+
*
|
|
58
|
+
* @since 0.1.0
|
|
59
|
+
* @category constants
|
|
60
|
+
*/
|
|
61
|
+
export const projectionTag = "flows/engine-store/UnencodableResult";
|
|
62
|
+
/**
|
|
63
|
+
* How many `cause` links a value projection follows before it stops.
|
|
64
|
+
*
|
|
65
|
+
* A provider failure nests two or three deep (`HarnessError` over
|
|
66
|
+
* `ModelError` over the transport error); the bound exists so a self-linking
|
|
67
|
+
* cause chain cannot make the projection unbounded.
|
|
68
|
+
*
|
|
69
|
+
* @since 0.1.0
|
|
70
|
+
* @category constants
|
|
71
|
+
*/
|
|
72
|
+
export const maxCauseDepth = 4;
|
|
73
|
+
/**
|
|
74
|
+
* How many leading stack lines a value projection keeps.
|
|
75
|
+
*
|
|
76
|
+
* @since 0.1.0
|
|
77
|
+
* @category constants
|
|
78
|
+
*/
|
|
79
|
+
export const maxStackLines = 4;
|
|
80
|
+
/**
|
|
81
|
+
* How many characters any single projected string keeps.
|
|
82
|
+
*
|
|
83
|
+
* @since 0.1.0
|
|
84
|
+
* @category constants
|
|
85
|
+
*/
|
|
86
|
+
export const maxTextLength = 1024;
|
|
87
|
+
/**
|
|
88
|
+
* Maximum cause reasons retained by the terminal fallback.
|
|
89
|
+
*
|
|
90
|
+
* @category constants
|
|
91
|
+
* @since 1.0.0
|
|
92
|
+
*/
|
|
93
|
+
export const maxReasonCount = 32;
|
|
94
|
+
/**
|
|
95
|
+
* Maximum serialized bytes retained by one fallback projection.
|
|
96
|
+
*
|
|
97
|
+
* @category constants
|
|
98
|
+
* @since 1.0.0
|
|
99
|
+
*/
|
|
100
|
+
export const maxProjectionBytes = 64 * 1024;
|
|
101
|
+
const truncate = (value, limit) => value.length <= limit ? value : `${value.slice(0, limit)}…`;
|
|
102
|
+
/**
|
|
103
|
+
* Bounds one projected message or stack after the journal's redaction rules.
|
|
104
|
+
*
|
|
105
|
+
* The projection is observability text in `flows_runs.state_json`, and a git or
|
|
106
|
+
* HTTP failure message embeds its remote URL, credentials included. Redaction
|
|
107
|
+
* runs before truncation so a cut cannot leave half a credential the rules no
|
|
108
|
+
* longer match.
|
|
109
|
+
*/
|
|
110
|
+
const redactedText = (value) => truncate(Redaction.redact(value), maxTextLength);
|
|
111
|
+
/**
|
|
112
|
+
* Renders any value as a bounded string without raising.
|
|
113
|
+
*
|
|
114
|
+
* `JSON.stringify` answers `undefined` for a function, a symbol, and
|
|
115
|
+
* `undefined` itself, and throws on a circular structure; both are answered
|
|
116
|
+
* with a shape marker rather than propagated, because this module runs on the
|
|
117
|
+
* path that must never fail.
|
|
118
|
+
*/
|
|
119
|
+
const text = (value) => {
|
|
120
|
+
switch (typeof value) {
|
|
121
|
+
case "string":
|
|
122
|
+
return JSON.stringify(value);
|
|
123
|
+
case "number":
|
|
124
|
+
return Number.isFinite(value) ? `${value}` : `[number]`;
|
|
125
|
+
case "boolean":
|
|
126
|
+
return value ? "true" : "false";
|
|
127
|
+
case "bigint":
|
|
128
|
+
return `[bigint]`;
|
|
129
|
+
case "undefined":
|
|
130
|
+
case "symbol":
|
|
131
|
+
case "function":
|
|
132
|
+
return `[${typeof value}]`;
|
|
133
|
+
case "object":
|
|
134
|
+
return value === null ? "null" : Array.isArray(value) ? "[array]" : "[object]";
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const minimalValue = () => ({ type: "object", message: "[unrepresentable]" });
|
|
138
|
+
/** Reads only an own data property; accessors are deliberately inert. */
|
|
139
|
+
const ownData = (value, name) => {
|
|
140
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, name);
|
|
141
|
+
return descriptor !== undefined && "value" in descriptor ? descriptor.value : undefined;
|
|
142
|
+
};
|
|
143
|
+
// Effect exits store their value/cause in one own data slot. Pinning the two
|
|
144
|
+
// library prototypes lets projection read that slot without invoking the
|
|
145
|
+
// public `value` / `cause` accessors or trusting a lookalike object.
|
|
146
|
+
const successExitPrototype = Object.getPrototypeOf(Exit.succeed(undefined));
|
|
147
|
+
const failureExitPrototype = Object.getPrototypeOf(Exit.fail(undefined));
|
|
148
|
+
const exitArguments = "~effect/Effect/args";
|
|
149
|
+
/**
|
|
150
|
+
* Projects one value — a typed error, a defect, a success value, a handoff
|
|
151
|
+
* payload — into JSON.
|
|
152
|
+
*
|
|
153
|
+
* @since 0.1.0
|
|
154
|
+
* @category conversions
|
|
155
|
+
*/
|
|
156
|
+
export const projectValue = (value, depth = 0, seen = new WeakSet()) => {
|
|
157
|
+
if (value === null || typeof value !== "object") {
|
|
158
|
+
return {
|
|
159
|
+
type: value === null ? "null" : typeof value,
|
|
160
|
+
message: redactedText(text(value))
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
// Generic Proxy introspection is observable user code. A host that can name
|
|
164
|
+
// a proxy from its internal slot rejects it without invoking a trap.
|
|
165
|
+
if (isProxy(value) || seen.has(value))
|
|
166
|
+
return minimalValue();
|
|
167
|
+
seen.add(value);
|
|
168
|
+
try {
|
|
169
|
+
const message = ownData(value, "message");
|
|
170
|
+
const tag = ownData(value, "_tag");
|
|
171
|
+
const code = ownData(value, "code");
|
|
172
|
+
const stack = ownData(value, "stack");
|
|
173
|
+
const cause = ownData(value, "cause");
|
|
174
|
+
const projection = {
|
|
175
|
+
type: typeof tag === "string" && tag.length > 0
|
|
176
|
+
? truncate(tag, maxTextLength)
|
|
177
|
+
: isNativeError(value)
|
|
178
|
+
? "Error"
|
|
179
|
+
: Array.isArray(value)
|
|
180
|
+
? "Array"
|
|
181
|
+
: "object",
|
|
182
|
+
message: redactedText(typeof message === "string" ? message : text(value))
|
|
183
|
+
};
|
|
184
|
+
if (typeof tag === "string")
|
|
185
|
+
projection.tag = truncate(tag, maxTextLength);
|
|
186
|
+
if (typeof code === "string")
|
|
187
|
+
projection.code = truncate(code, maxTextLength);
|
|
188
|
+
// Native Error stacks are commonly accessors. They remain deliberately
|
|
189
|
+
// unread; only an already-materialized own data string is retained.
|
|
190
|
+
if (typeof stack === "string") {
|
|
191
|
+
projection.stack = redactedText(stack.split("\n").slice(0, maxStackLines).join("\n"));
|
|
192
|
+
}
|
|
193
|
+
if (cause !== undefined && depth < maxCauseDepth) {
|
|
194
|
+
projection.cause = projectValue(cause, depth + 1, seen);
|
|
195
|
+
}
|
|
196
|
+
return projection;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return minimalValue();
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
const projectReason = (reason) => {
|
|
203
|
+
if (isProxy(reason))
|
|
204
|
+
return { _tag: "Die", error: minimalValue() };
|
|
205
|
+
try {
|
|
206
|
+
const tag = ownData(reason, "_tag");
|
|
207
|
+
if (tag === "Fail")
|
|
208
|
+
return { _tag: "Fail", error: projectValue(ownData(reason, "error")) };
|
|
209
|
+
if (tag === "Die")
|
|
210
|
+
return { _tag: "Die", error: projectValue(ownData(reason, "defect")) };
|
|
211
|
+
const fiberId = ownData(reason, "fiberId");
|
|
212
|
+
return typeof fiberId === "number" ? { _tag: "Interrupt", fiberId } : { _tag: "Interrupt" };
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
return { _tag: "Die", error: minimalValue() };
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Projects every reason of a cause, in order. An absent cause — a
|
|
220
|
+
* `Flow.Suspended` that carries none — projects to no reasons.
|
|
221
|
+
*
|
|
222
|
+
* @since 0.1.0
|
|
223
|
+
* @category conversions
|
|
224
|
+
*/
|
|
225
|
+
export const projectCause = (cause) => {
|
|
226
|
+
if (cause === undefined)
|
|
227
|
+
return [];
|
|
228
|
+
if (isProxy(cause))
|
|
229
|
+
return [{ _tag: "Die", error: minimalValue() }];
|
|
230
|
+
try {
|
|
231
|
+
const reasons = ownData(cause, "reasons");
|
|
232
|
+
if (!Array.isArray(reasons) || isProxy(reasons)) {
|
|
233
|
+
return [{ _tag: "Die", error: minimalValue() }];
|
|
234
|
+
}
|
|
235
|
+
const projected = reasons.slice(0, maxReasonCount).map(projectReason);
|
|
236
|
+
if (reasons.length > maxReasonCount) {
|
|
237
|
+
projected.push({
|
|
238
|
+
_tag: "Die",
|
|
239
|
+
error: { type: "truncated", message: `[${reasons.length - maxReasonCount} reasons omitted]` }
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return projected;
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return [{ _tag: "Die", error: minimalValue() }];
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const minimalResult = (note) => ({
|
|
249
|
+
_tag: projectionTag,
|
|
250
|
+
result: "Complete",
|
|
251
|
+
note,
|
|
252
|
+
reasons: [{ _tag: "Die", error: minimalValue() }],
|
|
253
|
+
value: null
|
|
254
|
+
});
|
|
255
|
+
const withinBudget = (projection) => {
|
|
256
|
+
try {
|
|
257
|
+
return new TextEncoder().encode(JSON.stringify(projection)).length <= maxProjectionBytes
|
|
258
|
+
? projection
|
|
259
|
+
: minimalResult("the rejected settlement exceeded the diagnostic projection bound");
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
return minimalResult("the rejected settlement could not be projected");
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Projects a settlement the flow's codec rejected.
|
|
267
|
+
*
|
|
268
|
+
* @since 0.1.0
|
|
269
|
+
* @category conversions
|
|
270
|
+
*/
|
|
271
|
+
export const projectResult = (result, note) => {
|
|
272
|
+
note = truncate(note, maxTextLength);
|
|
273
|
+
if (isProxy(result))
|
|
274
|
+
return minimalResult(note);
|
|
275
|
+
try {
|
|
276
|
+
const tag = ownData(result, "_tag");
|
|
277
|
+
if (tag === "Suspended") {
|
|
278
|
+
return withinBudget({
|
|
279
|
+
_tag: projectionTag,
|
|
280
|
+
result: "Suspended",
|
|
281
|
+
note,
|
|
282
|
+
reasons: projectCause(ownData(result, "cause")),
|
|
283
|
+
value: null
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
if (tag === "Handoff") {
|
|
287
|
+
return withinBudget({
|
|
288
|
+
_tag: projectionTag,
|
|
289
|
+
result: "Handoff",
|
|
290
|
+
note,
|
|
291
|
+
reasons: [],
|
|
292
|
+
value: projectValue(ownData(result, "payload"))
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
const exit = ownData(result, "exit");
|
|
296
|
+
if (typeof exit !== "object" || exit === null || isProxy(exit))
|
|
297
|
+
return minimalResult(note);
|
|
298
|
+
const prototype = Object.getPrototypeOf(exit);
|
|
299
|
+
const argument = ownData(exit, exitArguments);
|
|
300
|
+
if (prototype !== successExitPrototype && prototype !== failureExitPrototype)
|
|
301
|
+
return minimalResult(note);
|
|
302
|
+
return withinBudget(prototype === successExitPrototype
|
|
303
|
+
? {
|
|
304
|
+
_tag: projectionTag,
|
|
305
|
+
result: "Complete",
|
|
306
|
+
note,
|
|
307
|
+
reasons: [],
|
|
308
|
+
value: projectValue(argument)
|
|
309
|
+
}
|
|
310
|
+
: {
|
|
311
|
+
_tag: projectionTag,
|
|
312
|
+
result: "Complete",
|
|
313
|
+
note,
|
|
314
|
+
reasons: projectCause(argument),
|
|
315
|
+
value: null
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
return minimalResult(note);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* The encoded settlement written in place of one the codec rejected.
|
|
324
|
+
*
|
|
325
|
+
* A `Handoff` keeps its own shape, because its round settles `completed` with
|
|
326
|
+
* a successor already created and the lineage has to stay readable. Everything
|
|
327
|
+
* else becomes a failed `Complete`: a settlement whose bytes the codec refuses
|
|
328
|
+
* is not resumable and not answerable, so the only honest durable record is
|
|
329
|
+
* that the round failed, with the projection as its defect.
|
|
330
|
+
*/
|
|
331
|
+
const degrade = (result, projection) => {
|
|
332
|
+
try {
|
|
333
|
+
if (!isProxy(result) && ownData(result, "_tag") === "Handoff") {
|
|
334
|
+
const flow = ownData(result, "flow");
|
|
335
|
+
if (typeof flow === "string")
|
|
336
|
+
return { _tag: "Handoff", flow, payload: projection, capabilityCeilings: [[]] };
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
// The terminal Complete below is the fail-closed representation.
|
|
341
|
+
}
|
|
342
|
+
return { _tag: "Complete", exit: { _tag: "Failure", cause: [{ _tag: "Die", defect: projection }] } };
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* Encodes a round's settlement through the flow's own codec, and — when that
|
|
346
|
+
* codec rejects it — through a JSON projection instead.
|
|
347
|
+
*
|
|
348
|
+
* The returned effect has no error channel and dies for nothing: a caller on
|
|
349
|
+
* the terminal-transition path can always write the row it holds.
|
|
350
|
+
*
|
|
351
|
+
* @since 0.1.0
|
|
352
|
+
* @category conversions
|
|
353
|
+
*/
|
|
354
|
+
export const encode = (flow, result) => Schema.encodeEffect(Schema.toCodecJson(Flow.Result({
|
|
355
|
+
success: flow.successSchema,
|
|
356
|
+
error: flow.errorSchema
|
|
357
|
+
})))(result).pipe(Effect.map((encoded) => ({ encoded, note: undefined })), Effect.catchCause((_cause) => {
|
|
358
|
+
const note = "the flow result codec rejected the settlement";
|
|
359
|
+
return Effect.as(Effect.logWarning(`engine-store: the settlement of ${flow._tag} could not be encoded through its own codec; persisting a JSON projection so the run still settles`), { encoded: degrade(result, projectResult(result, note)), note });
|
|
360
|
+
}));
|
|
361
|
+
//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EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,CAAA;AACtG,CAAC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,IAAc,EACd,MAAqC,EACP,EAAE,CAChC,MAAM,CAAC,YAAY,CACjB,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,IAAI,CAAC,aAAa;IAC3B,KAAK,EAAE,IAAI,CAAC,WAAW;CACxB,CAAC,CAAC,CACJ,CAAC,MAAM,CAAC,CAAC,IAAI,CACZ,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EACtE,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,EAAE;IAC3B,MAAM,IAAI,GAAG,+CAA+C,CAAA;IAC5D,OAAO,MAAM,CAAC,EAAE,CACd,MAAM,CAAC,UAAU,CACf,mCAAmC,IAAI,CAAC,IAAI,oGAAoG,CACjJ,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,EAA0B,CACxF,CAAA;AACH,CAAC,CAAC,CAC6B,CAAA","sourcesContent":["/**\n * Encoding a round's settlement so a terminal transition can never be lost.\n *\n * A run row leaves `running` only when the driver has bytes to write into\n * `state_json`, and those bytes come from the flow's OWN codec:\n * `Flow.Result({ success: flow.successSchema, error: flow.errorSchema })`.\n * A flow that declares `Schema.Unknown` for either channel — which is what\n * `@smthrs/agent`'s `agent/run` declares, because an agent run carries\n * whatever its body failed with — encodes that channel through `Schema.Json`,\n * and `Schema.Json` rejects every class instance: `SchemaAST.isJson` walks the\n * prototype chain and refuses anything that is not a plain object or an array.\n * Every `Data.TaggedError` in this repository is therefore unencodable through\n * such a flow, `HarnessError` and `ModelError` included.\n *\n * Guarding the terminal transition with `Effect.orDie` around that encode made\n * an unencodable failure fatal for the drain instead of terminal for the run.\n * The release validation caught the whole chain: `engine-store: coordinated\n * drain failed for run-1 SchemaError: Expected JSON value at\n * [\"exit\"][\"cause\"][0][\"error\"]`, `engine.db` `flows_runs` left at `running`\n * with a dead owner pid while `control.db` said `failed`, and 86 seconds later\n * the next process's stale-running sweep stole the row, opened a second turn,\n * and billed the provider seat again for a run the control plane had closed.\n *\n * So the encode fails CLOSED here rather than open. The ordinary path is the\n * flow's own codec, unchanged. When that codec rejects the value, the result\n * is still written — as a JSON projection of what could not be encoded (tag,\n * code, message, a stack summary, and nested causes) inside a `Die` reason —\n * and the caller is told, through {@link EncodedResult.note}, that it must\n * settle the run `failed`. A settled run is never re-executed, which is the\n * durability promise the release policy states as one terminal write.\n *\n * The projection is built as plain JSON rather than re-encoded through a\n * schema, so nothing in this module can raise. Its top-level object carries no\n * `message` key on purpose: `Schema.Defect` revives any JSON object that has a\n * string `message` as an `Error`, and a projection has to come back out of the\n * row as the structured record it went in as.\n *\n * @since 0.1.0\n */\n\nimport { Flow } from \"@smthrs/flow\"\nimport { Redaction } from \"@smthrs/journal\"\nimport type * as Cause from \"effect/Cause\"\nimport * as Effect from \"effect/Effect\"\nimport * as Exit from \"effect/Exit\"\nimport * as Schema from \"effect/Schema\"\nimport * as HostReflection from \"./HostReflection.ts\"\n\n/**\n * Proxy and native-error detection, taken from the host that can answer them.\n *\n * `./HostReflection.ts` states why these are host predicates rather than a\n * `node:util/types` import: the module has to bundle for a browser, and only\n * some hosts can name a proxy at all.\n */\nconst { isNativeError, isProxy } = HostReflection.host\n\n/**\n * The `_tag` every projection carries, so a reader of `state_json` can tell a\n * projected settlement from an encoded one without guessing.\n *\n * @since 0.1.0\n * @category constants\n */\nexport const projectionTag = \"flows/engine-store/UnencodableResult\"\n\n/**\n * How many `cause` links a value projection follows before it stops.\n *\n * A provider failure nests two or three deep (`HarnessError` over\n * `ModelError` over the transport error); the bound exists so a self-linking\n * cause chain cannot make the projection unbounded.\n *\n * @since 0.1.0\n * @category constants\n */\nexport const maxCauseDepth = 4\n\n/**\n * How many leading stack lines a value projection keeps.\n *\n * @since 0.1.0\n * @category constants\n */\nexport const maxStackLines = 4\n\n/**\n * How many characters any single projected string keeps.\n *\n * @since 0.1.0\n * @category constants\n */\nexport const maxTextLength = 1024\n\n/**\n * Maximum cause reasons retained by the terminal fallback.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const maxReasonCount = 32\n\n/**\n * Maximum serialized bytes retained by one fallback projection.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const maxProjectionBytes = 64 * 1024\n\n/**\n * A JSON-safe summary of one unencodable value.\n *\n * `type` is the constructor name for an object and the `typeof` for anything\n * else, so `ModelError` and `\"boom\"` are distinguishable in the row.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface ValueProjection {\n readonly type: string\n readonly message: string\n readonly tag?: string\n readonly code?: string\n readonly stack?: string\n readonly cause?: ValueProjection\n}\n\n/**\n * A JSON-safe summary of one `Cause` reason.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface ReasonProjection {\n readonly _tag: \"Fail\" | \"Die\" | \"Interrupt\"\n readonly error?: ValueProjection\n readonly fiberId?: number\n}\n\n/**\n * The record written in place of a settlement the flow's codec rejected.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface ResultProjection {\n readonly _tag: typeof projectionTag\n readonly result: \"Complete\" | \"Suspended\" | \"Handoff\"\n readonly note: string\n readonly reasons: ReadonlyArray<ReasonProjection>\n readonly value: ValueProjection | null\n}\n\n/**\n * What {@link encode} produces: the bytes to persist, and — only when the\n * flow's codec rejected the settlement — the note describing why.\n *\n * A present `note` is an instruction to the caller, not decoration: the run\n * must reach a terminal `failed` row, because the alternative is the row this\n * lane exists to abolish, a `running` row whose owner is gone.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface EncodedResult {\n readonly encoded: unknown\n readonly note: string | undefined\n}\n\nconst truncate = (value: string, limit: number): string => value.length <= limit ? value : `${value.slice(0, limit)}…`\n\n/**\n * Bounds one projected message or stack after the journal's redaction rules.\n *\n * The projection is observability text in `flows_runs.state_json`, and a git or\n * HTTP failure message embeds its remote URL, credentials included. Redaction\n * runs before truncation so a cut cannot leave half a credential the rules no\n * longer match.\n */\nconst redactedText = (value: string): string => truncate(Redaction.redact(value) as string, maxTextLength)\n\n/**\n * Renders any value as a bounded string without raising.\n *\n * `JSON.stringify` answers `undefined` for a function, a symbol, and\n * `undefined` itself, and throws on a circular structure; both are answered\n * with a shape marker rather than propagated, because this module runs on the\n * path that must never fail.\n */\nconst text = (value: unknown): string => {\n switch (typeof value) {\n case \"string\":\n return JSON.stringify(value)\n case \"number\":\n return Number.isFinite(value) ? `${value}` : `[number]`\n case \"boolean\":\n return value ? \"true\" : \"false\"\n case \"bigint\":\n return `[bigint]`\n case \"undefined\":\n case \"symbol\":\n case \"function\":\n return `[${typeof value}]`\n case \"object\":\n return value === null ? \"null\" : Array.isArray(value) ? \"[array]\" : \"[object]\"\n }\n}\n\nconst minimalValue = (): ValueProjection => ({ type: \"object\", message: \"[unrepresentable]\" })\n\n/** Reads only an own data property; accessors are deliberately inert. */\nconst ownData = (value: object, name: PropertyKey): unknown => {\n const descriptor = Object.getOwnPropertyDescriptor(value, name)\n return descriptor !== undefined && \"value\" in descriptor ? descriptor.value : undefined\n}\n\n// Effect exits store their value/cause in one own data slot. Pinning the two\n// library prototypes lets projection read that slot without invoking the\n// public `value` / `cause` accessors or trusting a lookalike object.\nconst successExitPrototype = Object.getPrototypeOf(Exit.succeed(undefined))\nconst failureExitPrototype = Object.getPrototypeOf(Exit.fail(undefined))\nconst exitArguments = \"~effect/Effect/args\"\n\n/**\n * Projects one value — a typed error, a defect, a success value, a handoff\n * payload — into JSON.\n *\n * @since 0.1.0\n * @category conversions\n */\nexport const projectValue = (value: unknown, depth = 0, seen = new WeakSet<object>()): ValueProjection => {\n if (value === null || typeof value !== \"object\") {\n return {\n type: value === null ? \"null\" : typeof value,\n message: redactedText(text(value))\n }\n }\n // Generic Proxy introspection is observable user code. A host that can name\n // a proxy from its internal slot rejects it without invoking a trap.\n if (isProxy(value) || seen.has(value)) return minimalValue()\n seen.add(value)\n try {\n const message = ownData(value, \"message\")\n const tag = ownData(value, \"_tag\")\n const code = ownData(value, \"code\")\n const stack = ownData(value, \"stack\")\n const cause = ownData(value, \"cause\")\n const projection: {\n type: string\n message: string\n tag?: string\n code?: string\n stack?: string\n cause?: ValueProjection\n } = {\n type: typeof tag === \"string\" && tag.length > 0\n ? truncate(tag, maxTextLength)\n : isNativeError(value)\n ? \"Error\"\n : Array.isArray(value)\n ? \"Array\"\n : \"object\",\n message: redactedText(typeof message === \"string\" ? message : text(value))\n }\n if (typeof tag === \"string\") projection.tag = truncate(tag, maxTextLength)\n if (typeof code === \"string\") projection.code = truncate(code, maxTextLength)\n // Native Error stacks are commonly accessors. They remain deliberately\n // unread; only an already-materialized own data string is retained.\n if (typeof stack === \"string\") {\n projection.stack = redactedText(stack.split(\"\\n\").slice(0, maxStackLines).join(\"\\n\"))\n }\n if (cause !== undefined && depth < maxCauseDepth) {\n projection.cause = projectValue(cause, depth + 1, seen)\n }\n return projection\n } catch {\n return minimalValue()\n }\n}\n\nconst projectReason = (reason: Cause.Reason<unknown>): ReasonProjection => {\n if (isProxy(reason)) return { _tag: \"Die\", error: minimalValue() }\n try {\n const tag = ownData(reason, \"_tag\")\n if (tag === \"Fail\") return { _tag: \"Fail\", error: projectValue(ownData(reason, \"error\")) }\n if (tag === \"Die\") return { _tag: \"Die\", error: projectValue(ownData(reason, \"defect\")) }\n const fiberId = ownData(reason, \"fiberId\")\n return typeof fiberId === \"number\" ? { _tag: \"Interrupt\", fiberId } : { _tag: \"Interrupt\" }\n } catch {\n return { _tag: \"Die\", error: minimalValue() }\n }\n}\n\n/**\n * Projects every reason of a cause, in order. An absent cause — a\n * `Flow.Suspended` that carries none — projects to no reasons.\n *\n * @since 0.1.0\n * @category conversions\n */\nexport const projectCause = (\n cause: Cause.Cause<unknown> | undefined\n): ReadonlyArray<ReasonProjection> => {\n if (cause === undefined) return []\n if (isProxy(cause)) return [{ _tag: \"Die\", error: minimalValue() }]\n try {\n const reasons = ownData(cause, \"reasons\")\n if (!Array.isArray(reasons) || isProxy(reasons)) {\n return [{ _tag: \"Die\", error: minimalValue() }]\n }\n const projected = reasons.slice(0, maxReasonCount).map(projectReason)\n if (reasons.length > maxReasonCount) {\n projected.push({\n _tag: \"Die\",\n error: { type: \"truncated\", message: `[${reasons.length - maxReasonCount} reasons omitted]` }\n })\n }\n return projected\n } catch {\n return [{ _tag: \"Die\", error: minimalValue() }]\n }\n}\n\nconst minimalResult = (note: string): ResultProjection => ({\n _tag: projectionTag,\n result: \"Complete\",\n note,\n reasons: [{ _tag: \"Die\", error: minimalValue() }],\n value: null\n})\n\nconst withinBudget = (projection: ResultProjection): ResultProjection => {\n try {\n return new TextEncoder().encode(JSON.stringify(projection)).length <= maxProjectionBytes\n ? projection\n : minimalResult(\"the rejected settlement exceeded the diagnostic projection bound\")\n } catch {\n return minimalResult(\"the rejected settlement could not be projected\")\n }\n}\n\n/**\n * Projects a settlement the flow's codec rejected.\n *\n * @since 0.1.0\n * @category conversions\n */\nexport const projectResult = (\n result: Flow.Result<unknown, unknown>,\n note: string\n): ResultProjection => {\n note = truncate(note, maxTextLength)\n if (isProxy(result)) return minimalResult(note)\n try {\n const tag = ownData(result, \"_tag\")\n if (tag === \"Suspended\") {\n return withinBudget({\n _tag: projectionTag,\n result: \"Suspended\",\n note,\n reasons: projectCause(ownData(result, \"cause\") as Cause.Cause<unknown> | undefined),\n value: null\n })\n }\n if (tag === \"Handoff\") {\n return withinBudget({\n _tag: projectionTag,\n result: \"Handoff\",\n note,\n reasons: [],\n value: projectValue(ownData(result, \"payload\"))\n })\n }\n const exit = ownData(result, \"exit\")\n if (typeof exit !== \"object\" || exit === null || isProxy(exit)) return minimalResult(note)\n const prototype = Object.getPrototypeOf(exit)\n const argument = ownData(exit, exitArguments)\n if (prototype !== successExitPrototype && prototype !== failureExitPrototype) return minimalResult(note)\n return withinBudget(\n prototype === successExitPrototype\n ? {\n _tag: projectionTag,\n result: \"Complete\",\n note,\n reasons: [],\n value: projectValue(argument)\n }\n : {\n _tag: projectionTag,\n result: \"Complete\",\n note,\n reasons: projectCause(argument as Cause.Cause<unknown> | undefined),\n value: null\n }\n )\n } catch {\n return minimalResult(note)\n }\n}\n\n/**\n * The encoded settlement written in place of one the codec rejected.\n *\n * A `Handoff` keeps its own shape, because its round settles `completed` with\n * a successor already created and the lineage has to stay readable. Everything\n * else becomes a failed `Complete`: a settlement whose bytes the codec refuses\n * is not resumable and not answerable, so the only honest durable record is\n * that the round failed, with the projection as its defect.\n */\nconst degrade = (result: Flow.Result<unknown, unknown>, projection: ResultProjection): unknown => {\n try {\n if (!isProxy(result) && ownData(result, \"_tag\") === \"Handoff\") {\n const flow = ownData(result, \"flow\")\n if (typeof flow === \"string\") return { _tag: \"Handoff\", flow, payload: projection, capabilityCeilings: [[]] }\n }\n } catch {\n // The terminal Complete below is the fail-closed representation.\n }\n return { _tag: \"Complete\", exit: { _tag: \"Failure\", cause: [{ _tag: \"Die\", defect: projection }] } }\n}\n\n/**\n * Encodes a round's settlement through the flow's own codec, and — when that\n * codec rejects it — through a JSON projection instead.\n *\n * The returned effect has no error channel and dies for nothing: a caller on\n * the terminal-transition path can always write the row it holds.\n *\n * @since 0.1.0\n * @category conversions\n */\nexport const encode = (\n flow: Flow.Any,\n result: Flow.Result<unknown, unknown>\n): Effect.Effect<EncodedResult> =>\n Schema.encodeEffect(\n Schema.toCodecJson(Flow.Result({\n success: flow.successSchema,\n error: flow.errorSchema\n }))\n )(result).pipe(\n Effect.map((encoded): EncodedResult => ({ encoded, note: undefined })),\n Effect.catchCause((_cause) => {\n const note = \"the flow result codec rejected the settlement\"\n return Effect.as(\n Effect.logWarning(\n `engine-store: the settlement of ${flow._tag} could not be encoded through its own codec; persisting a JSON projection so the run still settles`\n ),\n { encoded: degrade(result, projectResult(result, note)), note } satisfies EncodedResult\n )\n })\n ) as Effect.Effect<EncodedResult>\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immutable snapshots of filesystem declarations crossing an async boundary.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
import type { FileBoundary } from "@smthrs/flow/FileBoundary";
|
|
7
|
+
/**
|
|
8
|
+
* Copies and freezes every mutable member of a boundary declaration.
|
|
9
|
+
*
|
|
10
|
+
* @category constructors
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
export declare const make: (boundary: FileBoundary) => FileBoundary;
|
|
14
|
+
//# sourceMappingURL=FileBoundarySnapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileBoundarySnapshot.d.ts","sourceRoot":"","sources":["../../../src/internal/FileBoundarySnapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAY7D;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAU,YAAY,KAAG,YAc1C,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immutable snapshots of filesystem declarations crossing an async boundary.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
import * as FileSet from "@smthrs/plan/FileSet";
|
|
7
|
+
const freeze = (values) => Object.freeze([...values]);
|
|
8
|
+
const glob = (entry) => Object.freeze({
|
|
9
|
+
_tag: "Glob",
|
|
10
|
+
include: freeze(entry.include),
|
|
11
|
+
...(entry.exclude === undefined ? {} : { exclude: freeze(entry.exclude) })
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Copies and freezes every mutable member of a boundary declaration.
|
|
15
|
+
*
|
|
16
|
+
* @category constructors
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export const make = (boundary) => Object.freeze({
|
|
20
|
+
readSet: freeze(boundary.readSet.map((entry) => FileSet.isGlob(entry) ? glob(entry) : Object.freeze({ path: entry.path, digest: entry.digest }))),
|
|
21
|
+
writeSet: freeze(boundary.writeSet.map((entry) => typeof entry === "string"
|
|
22
|
+
? entry
|
|
23
|
+
: FileSet.isGlob(entry)
|
|
24
|
+
? glob(entry)
|
|
25
|
+
: Object.freeze({ _tag: "TreeArtifact", path: entry.path }))),
|
|
26
|
+
...(boundary.removes === undefined ? {} : { removes: freeze(boundary.removes) }),
|
|
27
|
+
boundaryMode: boundary.boundaryMode
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=FileBoundarySnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileBoundarySnapshot.js","sourceRoot":"","sources":["../../../src/internal/FileBoundarySnapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAE/C,MAAM,MAAM,GAAG,CAAI,MAAwB,EAAoB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAA;AAE5F,MAAM,IAAI,GAAG,CAAC,KAAmB,EAAgB,EAAE,CACjD,MAAM,CAAC,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAA4B;IACzD,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3E,CAAC,CAAA;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,QAAsB,EAAgB,EAAE,CAC3D,MAAM,CAAC,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAChG,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC/C,OAAO,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;YACvB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACb,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAuB,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CACvE,CAAC;IACF,GAAG,CAAC,QAAQ,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;IAChF,YAAY,EAAE,QAAQ,CAAC,YAAY;CACpC,CAAC,CAAA","sourcesContent":["/**\n * Immutable snapshots of filesystem declarations crossing an async boundary.\n *\n * @since 1.0.0\n */\n\nimport type { FileBoundary } from \"@smthrs/flow/FileBoundary\"\nimport * as FileSet from \"@smthrs/plan/FileSet\"\n\nconst freeze = <A>(values: ReadonlyArray<A>): ReadonlyArray<A> => Object.freeze([...values])\n\nconst glob = (entry: FileSet.Glob): FileSet.Glob =>\n Object.freeze({\n _tag: \"Glob\",\n include: freeze(entry.include) as FileSet.Glob[\"include\"],\n ...(entry.exclude === undefined ? {} : { exclude: freeze(entry.exclude) })\n })\n\n/**\n * Copies and freezes every mutable member of a boundary declaration.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const make = (boundary: FileBoundary): FileBoundary =>\n Object.freeze({\n readSet: freeze(boundary.readSet.map((entry) =>\n FileSet.isGlob(entry) ? glob(entry) : Object.freeze({ path: entry.path, digest: entry.digest })\n )),\n writeSet: freeze(boundary.writeSet.map((entry) =>\n typeof entry === \"string\"\n ? entry\n : FileSet.isGlob(entry)\n ? glob(entry)\n : Object.freeze({ _tag: \"TreeArtifact\" as const, path: entry.path })\n )),\n ...(boundary.removes === undefined ? {} : { removes: freeze(boundary.removes) }),\n boundaryMode: boundary.boundaryMode\n })\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-relative file enumeration for glob and tree-artifact expansion.
|
|
3
|
+
*
|
|
4
|
+
* The host `glob` is deliberately not consulted. Two divergences make it the
|
|
5
|
+
* wrong oracle for a declared pattern: the kernel `FileSystem` absolutizes
|
|
6
|
+
* patterns against the workspace root and returns absolute paths, so a
|
|
7
|
+
* workspace-relative matcher filters every result out; and Node's matcher
|
|
8
|
+
* skips dotfiles, which `FileSet.matchesPattern` — and Bazel's glob — cover.
|
|
9
|
+
* Walking `readDirectory` and filtering through `FileSet` keeps every
|
|
10
|
+
* expansion byte-identical to the matcher the plan's overlap passes use, in
|
|
11
|
+
* the one coordinate system declarations are written in.
|
|
12
|
+
*
|
|
13
|
+
* @since 0.1.0
|
|
14
|
+
*/
|
|
15
|
+
import * as FileSet from "@smthrs/plan/FileSet";
|
|
16
|
+
import * as Effect from "effect/Effect";
|
|
17
|
+
import type * as FileSystem from "effect/FileSystem";
|
|
18
|
+
import type * as PlatformError from "effect/PlatformError";
|
|
19
|
+
import * as Schema from "effect/Schema";
|
|
20
|
+
/**
|
|
21
|
+
* The default maximum number of directory entries visited by one expansion.
|
|
22
|
+
*
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category constants
|
|
25
|
+
*/
|
|
26
|
+
export declare const defaultMaxEntries = 100000;
|
|
27
|
+
/**
|
|
28
|
+
* The stable error code returned when enumeration exceeds its safety bound.
|
|
29
|
+
*
|
|
30
|
+
* @since 1.0.0
|
|
31
|
+
* @category errors
|
|
32
|
+
*/
|
|
33
|
+
export declare const FileEnumerationErrorCode: Schema.Literal<"entry_limit_exceeded">;
|
|
34
|
+
/**
|
|
35
|
+
* The stable error code returned when enumeration exceeds its safety bound.
|
|
36
|
+
*
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
* @category errors
|
|
39
|
+
*/
|
|
40
|
+
export type FileEnumerationErrorCode = typeof FileEnumerationErrorCode.Type;
|
|
41
|
+
declare const FileEnumerationError_base: Schema.Class<FileEnumerationError, Schema.TaggedStruct<"@smthrs/engine-store/FileEnumerationError", {
|
|
42
|
+
readonly code: Schema.Literal<"entry_limit_exceeded">;
|
|
43
|
+
readonly message: Schema.String;
|
|
44
|
+
readonly pattern: Schema.String;
|
|
45
|
+
readonly limit: Schema.Number;
|
|
46
|
+
readonly cause: Schema.Unknown;
|
|
47
|
+
}>, import("effect/Cause").YieldableError>;
|
|
48
|
+
/**
|
|
49
|
+
* A workspace enumeration exceeded its configured entry limit.
|
|
50
|
+
*
|
|
51
|
+
* @since 1.0.0
|
|
52
|
+
* @category errors
|
|
53
|
+
*/
|
|
54
|
+
export declare class FileEnumerationError extends FileEnumerationError_base {
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* How an enumeration talks to a FileSystem that does not speak
|
|
58
|
+
* workspace-relative paths.
|
|
59
|
+
*
|
|
60
|
+
* @since 0.1.0
|
|
61
|
+
* @category models
|
|
62
|
+
*/
|
|
63
|
+
export interface EnumerationOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Maps a workspace-relative path (`""` names the workspace root) to the
|
|
66
|
+
* coordinate the FileSystem expects. Defaults to the identity, with `""`
|
|
67
|
+
* spelled `"."`.
|
|
68
|
+
*/
|
|
69
|
+
readonly resolve?: (path: string) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Maximum number of directory entries one expansion may visit. Defaults to
|
|
72
|
+
* {@link defaultMaxEntries}. Enumeration fails instead of returning a
|
|
73
|
+
* partial result when the walk exceeds this bound.
|
|
74
|
+
*/
|
|
75
|
+
readonly maxEntries?: number | undefined;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Every file under `dir` (workspace-relative; `""` for the workspace root),
|
|
79
|
+
* as sorted workspace-relative paths. A missing directory enumerates to
|
|
80
|
+
* nothing — a zero-match expansion is legal, so absence is a fact rather than
|
|
81
|
+
* a failure. This declared-tree walk does not prune `.git`, `.jj`, or
|
|
82
|
+
* `node_modules`. Those names are part of the tree identity and must be
|
|
83
|
+
* captured and restored exactly.
|
|
84
|
+
*
|
|
85
|
+
* @since 0.1.0
|
|
86
|
+
* @category accessors
|
|
87
|
+
*/
|
|
88
|
+
export declare const filesUnder: (fs: FileSystem.FileSystem, dir: string, options?: EnumerationOptions) => Effect.Effect<ReadonlyArray<string>, PlatformError.PlatformError | FileEnumerationError>;
|
|
89
|
+
/**
|
|
90
|
+
* Every file and every directory under `dir` (workspace-relative, non-empty),
|
|
91
|
+
* as sorted workspace-relative paths. The directory list includes `dir`
|
|
92
|
+
* itself, so a tree replay can audit exactly the scaffolding it may have to
|
|
93
|
+
* prune. A missing directory enumerates to nothing — a tree that matched
|
|
94
|
+
* nothing is legal, so absence is a fact rather than a failure. This
|
|
95
|
+
* declared-tree walk does not prune `.git`, `.jj`, or `node_modules` because
|
|
96
|
+
* replay needs every directory and file that contributes to the tree.
|
|
97
|
+
*
|
|
98
|
+
* @since 0.1.0
|
|
99
|
+
* @category accessors
|
|
100
|
+
*/
|
|
101
|
+
export declare const entriesUnder: (fs: FileSystem.FileSystem, dir: string, options?: EnumerationOptions) => Effect.Effect<{
|
|
102
|
+
readonly files: ReadonlyArray<string>;
|
|
103
|
+
readonly directories: ReadonlyArray<string>;
|
|
104
|
+
}, PlatformError.PlatformError | FileEnumerationError>;
|
|
105
|
+
/**
|
|
106
|
+
* The longest directory prefix of a pattern that contains no wildcard — the
|
|
107
|
+
* subtree a walk has to visit. `src/**` walks `src`; `*.txt` walks the root.
|
|
108
|
+
*
|
|
109
|
+
* @since 0.1.0
|
|
110
|
+
* @category accessors
|
|
111
|
+
*/
|
|
112
|
+
export declare const staticPrefix: (pattern: string) => string;
|
|
113
|
+
/**
|
|
114
|
+
* Expands one glob against the workspace: walk each include's static prefix,
|
|
115
|
+
* keep the files `FileSet.matchesGlob` covers. Sorted and deduplicated, so
|
|
116
|
+
* expansion is deterministic. A glob walk prunes `.git`, `.jj`, and
|
|
117
|
+
* `node_modules` unless an include sharing that walk prefix names the
|
|
118
|
+
* directory as a path segment. This keeps a root glob from traversing
|
|
119
|
+
* repository metadata and dependency trees while preserving an explicitly
|
|
120
|
+
* declared match after either a fixed or wildcard segment.
|
|
121
|
+
*
|
|
122
|
+
* @since 0.1.0
|
|
123
|
+
* @category accessors
|
|
124
|
+
*/
|
|
125
|
+
export declare const expandGlob: (fs: FileSystem.FileSystem, glob: FileSet.Glob, options?: EnumerationOptions) => Effect.Effect<ReadonlyArray<string>, PlatformError.PlatformError | FileEnumerationError>;
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=FileEnumeration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileEnumeration.d.ts","sourceRoot":"","sources":["../../../src/internal/FileEnumeration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,UAAU,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,KAAK,aAAa,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAiCvC;;;;;GAKG;AAC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