@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,711 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var WorkspaceSandbox_exports = {};
|
|
30
|
+
__export(WorkspaceSandbox_exports, {
|
|
31
|
+
EffectDispatcher: () => EffectDispatcher,
|
|
32
|
+
MaterializationConflict: () => MaterializationConflict,
|
|
33
|
+
Workspace: () => Workspace,
|
|
34
|
+
WorkspaceError: () => WorkspaceError,
|
|
35
|
+
WorkspaceErrorCode: () => WorkspaceErrorCode,
|
|
36
|
+
WorkspaceSandbox: () => WorkspaceSandbox,
|
|
37
|
+
isMaterializationConflict: () => isMaterializationConflict,
|
|
38
|
+
layer: () => layer,
|
|
39
|
+
layerDispatcher: () => layerDispatcher,
|
|
40
|
+
layerFileSystem: () => layerFileSystem,
|
|
41
|
+
make: () => make,
|
|
42
|
+
makeFileSystem: () => makeFileSystem,
|
|
43
|
+
makeHosted: () => makeHosted,
|
|
44
|
+
makeMemory: () => makeMemory,
|
|
45
|
+
violations: () => violations
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(WorkspaceSandbox_exports);
|
|
48
|
+
var ArtifactStore = __toESM(require("@smthrs/artifacts/ArtifactStore"), 1);
|
|
49
|
+
var FileLease = __toESM(require("@smthrs/artifacts/FileLease"), 1);
|
|
50
|
+
var import_crypto = require("@smthrs/crypto");
|
|
51
|
+
var KernelFileSystem = __toESM(require("@smthrs/kernel/FileSystem"), 1);
|
|
52
|
+
var import_Workspace = require("@smthrs/kernel/Workspace");
|
|
53
|
+
var import_keys = require("@smthrs/keys");
|
|
54
|
+
var FileSet = __toESM(require("@smthrs/plan/FileSet"), 1);
|
|
55
|
+
var Cause = __toESM(require("effect/Cause"), 1);
|
|
56
|
+
var Context = __toESM(require("effect/Context"), 1);
|
|
57
|
+
var Effect = __toESM(require("effect/Effect"), 1);
|
|
58
|
+
var Exit = __toESM(require("effect/Exit"), 1);
|
|
59
|
+
var FileSystem = __toESM(require("effect/FileSystem"), 1);
|
|
60
|
+
var Layer = __toESM(require("effect/Layer"), 1);
|
|
61
|
+
var Metric = __toESM(require("effect/Metric"), 1);
|
|
62
|
+
var Path = __toESM(require("effect/Path"), 1);
|
|
63
|
+
var PlatformError = __toESM(require("effect/PlatformError"), 1);
|
|
64
|
+
var RcMap = __toESM(require("effect/RcMap"), 1);
|
|
65
|
+
var Ref = __toESM(require("effect/Ref"), 1);
|
|
66
|
+
var Result = __toESM(require("effect/Result"), 1);
|
|
67
|
+
var Schema = __toESM(require("effect/Schema"), 1);
|
|
68
|
+
var Scope = __toESM(require("effect/Scope"), 1);
|
|
69
|
+
var Semaphore = __toESM(require("effect/Semaphore"), 1);
|
|
70
|
+
var EngineStoreMetrics = __toESM(require("./EngineStoreMetrics.js"), 1);
|
|
71
|
+
var FileBoundarySnapshot = __toESM(require("./internal/FileBoundarySnapshot.js"), 1);
|
|
72
|
+
var FileEnumeration = __toESM(require("./internal/FileEnumeration.js"), 1);
|
|
73
|
+
var import_Ordering = require("./internal/Ordering.js");
|
|
74
|
+
const Workspace = Context.Service(
|
|
75
|
+
"@smthrs/engine-store/WorkspaceSandbox/Workspace"
|
|
76
|
+
);
|
|
77
|
+
const WorkspaceErrorCode = Schema.Literals([
|
|
78
|
+
"invalid_path",
|
|
79
|
+
"not_found",
|
|
80
|
+
"host_unavailable",
|
|
81
|
+
"path_escapes_workspace",
|
|
82
|
+
"commit_lock_timeout"
|
|
83
|
+
]);
|
|
84
|
+
class WorkspaceError extends Schema.TaggedError()(
|
|
85
|
+
"@smthrs/engine-store/WorkspaceError",
|
|
86
|
+
{
|
|
87
|
+
code: WorkspaceErrorCode,
|
|
88
|
+
message: Schema.String,
|
|
89
|
+
cause: Schema.optional(Schema.Defect())
|
|
90
|
+
}
|
|
91
|
+
) {
|
|
92
|
+
}
|
|
93
|
+
class MaterializationConflict extends Schema.TaggedError()(
|
|
94
|
+
"@smthrs/engine-store/MaterializationConflict",
|
|
95
|
+
{
|
|
96
|
+
paths: Schema.Array(
|
|
97
|
+
Schema.NonEmptyString.check(Schema.isMaxLength(4096))
|
|
98
|
+
).check(Schema.isMaxLength(1024)),
|
|
99
|
+
message: Schema.NonEmptyString.check(Schema.isMaxLength(16384))
|
|
100
|
+
}
|
|
101
|
+
) {
|
|
102
|
+
}
|
|
103
|
+
const isMaterializationConflict = (error) => {
|
|
104
|
+
if (typeof error !== "object" || error === null) return false;
|
|
105
|
+
try {
|
|
106
|
+
if (error instanceof MaterializationConflict) return true;
|
|
107
|
+
const own = (name) => {
|
|
108
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, name);
|
|
109
|
+
return descriptor !== void 0 && descriptor.enumerable && "value" in descriptor ? descriptor.value : void 0;
|
|
110
|
+
};
|
|
111
|
+
const paths = own("paths");
|
|
112
|
+
const message = own("message");
|
|
113
|
+
if (own("_tag") !== MaterializationConflict.identifier || typeof message !== "string" || message.length === 0 || message.length > 16384 || !Array.isArray(paths) || Object.getPrototypeOf(paths) !== Array.prototype || paths.length > 1024) return false;
|
|
114
|
+
for (let index = 0; index < paths.length; index++) {
|
|
115
|
+
const descriptor = Object.getOwnPropertyDescriptor(paths, String(index));
|
|
116
|
+
if (descriptor === void 0 || !("value" in descriptor) || !descriptor.enumerable || typeof descriptor.value !== "string" || descriptor.value.length === 0 || descriptor.value.length > 4096) return false;
|
|
117
|
+
}
|
|
118
|
+
if (Reflect.ownKeys(paths).some(
|
|
119
|
+
(key) => key !== "length" && (typeof key !== "string" || !/^(0|[1-9][0-9]*)$/.test(key) || Number(key) >= paths.length)
|
|
120
|
+
)) return false;
|
|
121
|
+
return Reflect.ownKeys(error).every((key) => key === "_tag" || key === "paths" || key === "message");
|
|
122
|
+
} catch {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const WorkspaceSandbox = Context.Service(
|
|
127
|
+
"@smthrs/engine-store/WorkspaceSandbox"
|
|
128
|
+
);
|
|
129
|
+
const make = (service) => WorkspaceSandbox.of(service);
|
|
130
|
+
const layer = (service) => Layer.succeed(WorkspaceSandbox, make(service));
|
|
131
|
+
const EffectDispatcher = Context.Service(
|
|
132
|
+
"@smthrs/engine-store/WorkspaceSandbox/EffectDispatcher"
|
|
133
|
+
);
|
|
134
|
+
const layerDispatcher = (dispatcher) => Layer.succeed(EffectDispatcher, EffectDispatcher.of(dispatcher));
|
|
135
|
+
const decoder = new TextDecoder();
|
|
136
|
+
const encoder = new TextEncoder();
|
|
137
|
+
const invalidPath = (path) => new WorkspaceError({
|
|
138
|
+
code: "invalid_path",
|
|
139
|
+
message: `Workspace paths must be relative paths inside the workspace without '..': ${path}`
|
|
140
|
+
});
|
|
141
|
+
const normalizePath = (root, path, allowRoot = false) => {
|
|
142
|
+
const slashed = path.replaceAll("\\", "/");
|
|
143
|
+
const slashedRoot = root.replaceAll("\\", "/");
|
|
144
|
+
const rooted = slashed === slashedRoot ? "" : slashedRoot !== "" && slashed.startsWith(`${slashedRoot}/`) ? slashed.slice(slashedRoot.length + 1) : slashed;
|
|
145
|
+
const parts = rooted.split("/");
|
|
146
|
+
if (rooted.startsWith("/") || parts.some((part) => part === "..")) return Result.fail(invalidPath(path));
|
|
147
|
+
const compact = parts.filter((part) => part !== "" && part !== ".").join("/");
|
|
148
|
+
return compact === "" && !allowRoot ? Result.fail(invalidPath(path)) : Result.succeed(compact);
|
|
149
|
+
};
|
|
150
|
+
const covers = (entry, path) => typeof entry === "string" ? entry === path : entry._tag === "TreeArtifact" ? path === entry.path || path.startsWith(`${entry.path}/`) : FileSet.matchesGlob(entry, path);
|
|
151
|
+
const resource = (path) => ({ kind: "file", id: path });
|
|
152
|
+
const workspaceRelative = (root, descriptor) => {
|
|
153
|
+
const relative = (path) => {
|
|
154
|
+
const normalized = normalizePath(root, path);
|
|
155
|
+
return Result.isFailure(normalized) ? path : normalized.success;
|
|
156
|
+
};
|
|
157
|
+
return {
|
|
158
|
+
readSet: descriptor.readSet.map(
|
|
159
|
+
(entry) => FileSet.isGlob(entry) ? {
|
|
160
|
+
...entry,
|
|
161
|
+
include: [relative(entry.include[0]), ...entry.include.slice(1).map(relative)],
|
|
162
|
+
...entry.exclude === void 0 ? {} : { exclude: entry.exclude.map(relative) }
|
|
163
|
+
} : { ...entry, path: relative(entry.path) }
|
|
164
|
+
),
|
|
165
|
+
writeSet: descriptor.writeSet.map(
|
|
166
|
+
(entry) => typeof entry === "string" ? relative(entry) : entry._tag === "TreeArtifact" ? { ...entry, path: relative(entry.path) } : {
|
|
167
|
+
...entry,
|
|
168
|
+
include: [relative(entry.include[0]), ...entry.include.slice(1).map(relative)],
|
|
169
|
+
...entry.exclude === void 0 ? {} : { exclude: entry.exclude.map(relative) }
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
...descriptor.removes === void 0 ? {} : { removes: descriptor.removes.map(relative) },
|
|
173
|
+
boundaryMode: descriptor.boundaryMode
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
const digestOf = (bytes) => Schema.decodeUnknownEffect(import_crypto.Sha256)(bytes).pipe(Effect.orDie);
|
|
177
|
+
const parentDirectory = (path) => {
|
|
178
|
+
const index = path.lastIndexOf("/");
|
|
179
|
+
return index <= 0 ? void 0 : path.slice(0, index);
|
|
180
|
+
};
|
|
181
|
+
const notFound = (path) => new WorkspaceError({ code: "not_found", message: `Workspace file does not exist: ${path}` });
|
|
182
|
+
const transaction = (base, trace, root) => {
|
|
183
|
+
const files = new Map(base);
|
|
184
|
+
const produced = /* @__PURE__ */ new Set();
|
|
185
|
+
const resolvePath = (path, allowRoot = false) => {
|
|
186
|
+
const normalized = normalizePath(root, path, allowRoot);
|
|
187
|
+
return Result.isFailure(normalized) ? Effect.fail(normalized.failure) : Effect.succeed(normalized.success);
|
|
188
|
+
};
|
|
189
|
+
const readBytes = Effect.fn("WorkspaceSandbox.read")(function* (path) {
|
|
190
|
+
const key = yield* resolvePath(path);
|
|
191
|
+
trace.attemptedReads.push({ path: key, produced: produced.has(key) });
|
|
192
|
+
const content = files.get(key);
|
|
193
|
+
if (content === void 0) return yield* Effect.fail(notFound(key));
|
|
194
|
+
trace.inputs.push({ path: key, content });
|
|
195
|
+
return content.slice();
|
|
196
|
+
});
|
|
197
|
+
const writeBytes = Effect.fn("WorkspaceSandbox.write")(function* (path, content) {
|
|
198
|
+
const key = yield* resolvePath(path);
|
|
199
|
+
produced.add(key);
|
|
200
|
+
files.set(key, content.slice());
|
|
201
|
+
});
|
|
202
|
+
const removePath = Effect.fn("WorkspaceSandbox.remove")(function* (path) {
|
|
203
|
+
const key = yield* resolvePath(path);
|
|
204
|
+
produced.add(key);
|
|
205
|
+
files.delete(key);
|
|
206
|
+
});
|
|
207
|
+
const workspace = Workspace.of({
|
|
208
|
+
readFile: (path) => readBytes(path),
|
|
209
|
+
writeFile: (path, content) => writeBytes(path, content),
|
|
210
|
+
removeFile: (path) => removePath(path),
|
|
211
|
+
queueEffect: (effect) => Effect.sync(() => trace.effects.push(effect))
|
|
212
|
+
});
|
|
213
|
+
const refuse = (method, path) => (error) => error.code === "not_found" ? PlatformError.systemError({
|
|
214
|
+
_tag: "NotFound",
|
|
215
|
+
module: "FileSystem",
|
|
216
|
+
method,
|
|
217
|
+
description: error.message,
|
|
218
|
+
pathOrDescriptor: path
|
|
219
|
+
}) : PlatformError.badArgument({ module: "FileSystem", method, description: error.message });
|
|
220
|
+
const fileSystem = FileSystem.makeNoop({
|
|
221
|
+
// `exists` and `readDirectory` trace every PRESENCE they reveal: under a
|
|
222
|
+
// whole-tree-seeding host the map holds undeclared world state, and a
|
|
223
|
+
// probe that observes it is a read the key never folded. Absence stays
|
|
224
|
+
// untraced — under the declared-set host an undeclared path is absent by
|
|
225
|
+
// construction, the Bazel forest's own deterministic answer.
|
|
226
|
+
exists: (path) => resolvePath(path, true).pipe(
|
|
227
|
+
Effect.map((key) => {
|
|
228
|
+
if (key === "") return true;
|
|
229
|
+
if (files.has(key)) {
|
|
230
|
+
trace.attemptedReads.push({ path: key, produced: produced.has(key) });
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
const prefix = `${key}/`;
|
|
234
|
+
let present = false;
|
|
235
|
+
for (const candidate of files.keys()) {
|
|
236
|
+
if (!candidate.startsWith(prefix)) continue;
|
|
237
|
+
trace.attemptedReads.push({ path: candidate, produced: produced.has(candidate) });
|
|
238
|
+
present = true;
|
|
239
|
+
}
|
|
240
|
+
return present;
|
|
241
|
+
}),
|
|
242
|
+
// A path the transaction cannot even name does not exist in it; that
|
|
243
|
+
// is an answer, not a host failure.
|
|
244
|
+
Effect.catch(() => Effect.succeed(false))
|
|
245
|
+
),
|
|
246
|
+
readFile: (path) => readBytes(path).pipe(Effect.mapError(refuse("readFile", path))),
|
|
247
|
+
readFileString: (path) => readBytes(path).pipe(
|
|
248
|
+
Effect.map((bytes) => decoder.decode(bytes)),
|
|
249
|
+
Effect.mapError(refuse("readFileString", path))
|
|
250
|
+
),
|
|
251
|
+
writeFile: (path, data) => writeBytes(path, data).pipe(Effect.mapError(refuse("writeFile", path))),
|
|
252
|
+
writeFileString: (path, data) => writeBytes(path, encoder.encode(data)).pipe(Effect.mapError(refuse("writeFileString", path))),
|
|
253
|
+
remove: (path) => removePath(path).pipe(Effect.mapError(refuse("remove", path))),
|
|
254
|
+
// Directories are implicit in a path-keyed map: creating one is a
|
|
255
|
+
// successful no-op so a body that mirrors ordinary filesystem discipline
|
|
256
|
+
// works unchanged, and listing one is a prefix scan.
|
|
257
|
+
makeDirectory: () => Effect.void,
|
|
258
|
+
readDirectory: (path) => resolvePath(path, true).pipe(
|
|
259
|
+
Effect.map((key) => {
|
|
260
|
+
const prefix = key === "" ? "" : `${key}/`;
|
|
261
|
+
const entries = /* @__PURE__ */ new Set();
|
|
262
|
+
for (const candidate of files.keys()) {
|
|
263
|
+
if (!candidate.startsWith(prefix)) continue;
|
|
264
|
+
trace.attemptedReads.push({ path: candidate, produced: produced.has(candidate) });
|
|
265
|
+
entries.add(candidate.slice(prefix.length).split("/")[0]);
|
|
266
|
+
}
|
|
267
|
+
return [...entries].sort(import_Ordering.compareText);
|
|
268
|
+
}),
|
|
269
|
+
Effect.mapError(refuse("readDirectory", path))
|
|
270
|
+
)
|
|
271
|
+
});
|
|
272
|
+
return { files, workspace, fileSystem };
|
|
273
|
+
};
|
|
274
|
+
const changes = Effect.fn("WorkspaceSandbox.changes")(function* (base, current, host) {
|
|
275
|
+
const paths = [.../* @__PURE__ */ new Set([...base.keys(), ...current.keys()])].sort(import_Ordering.compareText);
|
|
276
|
+
const result = [];
|
|
277
|
+
for (const path of paths) {
|
|
278
|
+
const before = base.get(path);
|
|
279
|
+
const after = current.get(path);
|
|
280
|
+
const beforeDigest = before === void 0 ? yield* host.baseline(path) : yield* digestOf(before);
|
|
281
|
+
const afterDigest = after === void 0 ? void 0 : yield* digestOf(after);
|
|
282
|
+
if (beforeDigest === afterDigest) continue;
|
|
283
|
+
result.push({
|
|
284
|
+
path,
|
|
285
|
+
beforeDigest,
|
|
286
|
+
afterDigest,
|
|
287
|
+
...after === void 0 ? {} : { after: yield* host.retain(after) }
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
return result;
|
|
291
|
+
});
|
|
292
|
+
const preflight = Effect.fn("WorkspaceSandbox.preflight")(function* (changes2, current) {
|
|
293
|
+
const conflicting = [];
|
|
294
|
+
const before = /* @__PURE__ */ new Map();
|
|
295
|
+
for (const change of changes2) {
|
|
296
|
+
const content = yield* current(change.path);
|
|
297
|
+
before.set(change.path, content);
|
|
298
|
+
const digest = content === void 0 ? void 0 : yield* digestOf(content);
|
|
299
|
+
conflicting.push(...digest === change.beforeDigest ? [] : [change.path]);
|
|
300
|
+
}
|
|
301
|
+
const conflict = conflicting.length === 0 ? void 0 : new MaterializationConflict({
|
|
302
|
+
paths: conflicting,
|
|
303
|
+
message: "Workspace state changed after the transaction's base snapshot was taken"
|
|
304
|
+
});
|
|
305
|
+
return { conflict, before };
|
|
306
|
+
});
|
|
307
|
+
const revisionOf = Effect.fn("WorkspaceSandbox.revision")(function* (base) {
|
|
308
|
+
const entries = [];
|
|
309
|
+
for (const [path, content] of [...base].sort((left, right) => (0, import_Ordering.compareText)(left[0], right[0]))) {
|
|
310
|
+
entries.push({ path, digest: yield* digestOf(content) });
|
|
311
|
+
}
|
|
312
|
+
return yield* Schema.decodeUnknownEffect(import_keys.DerivedKey)({ kind: "workspace-revision", entries }).pipe(Effect.orDie);
|
|
313
|
+
});
|
|
314
|
+
const violations = (descriptor, base, provenance) => {
|
|
315
|
+
const declaredReads = descriptor.readSet;
|
|
316
|
+
const observed = [
|
|
317
|
+
...provenance.inputs.filter(
|
|
318
|
+
(input) => base.has(input.resource.id) && !declaredReads.some(
|
|
319
|
+
(entry) => FileSet.isGlob(entry) ? FileSet.matchesGlob(entry, input.resource.id) : entry.path === input.resource.id
|
|
320
|
+
)
|
|
321
|
+
).map((input) => ({ kind: "undeclared-read", resource: input.resource })),
|
|
322
|
+
...provenance.outputs.filter(
|
|
323
|
+
(output) => ![...descriptor.writeSet, ...descriptor.removes ?? []].some((entry) => covers(entry, output.resource.id))
|
|
324
|
+
).map((output) => ({ kind: "undeclared-write", resource: output.resource }))
|
|
325
|
+
];
|
|
326
|
+
return [
|
|
327
|
+
...new Map(observed.map((violation) => [`${violation.kind}:${violation.resource.id}`, violation])).values()
|
|
328
|
+
];
|
|
329
|
+
};
|
|
330
|
+
const makeHosted = (host) => {
|
|
331
|
+
const memo = /* @__PURE__ */ new Map();
|
|
332
|
+
const executeBody = Effect.fnUntraced(function* (execution) {
|
|
333
|
+
const boundary = FileBoundarySnapshot.make(execution.descriptor);
|
|
334
|
+
const key = execution.cacheKey;
|
|
335
|
+
if (key !== void 0) {
|
|
336
|
+
const hit = memo.get(key);
|
|
337
|
+
if (hit !== void 0) {
|
|
338
|
+
return {
|
|
339
|
+
_tag: "Accepted",
|
|
340
|
+
result: hit.result,
|
|
341
|
+
violations: hit.violations,
|
|
342
|
+
cache: { status: "hit", key }
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const captured = yield* host.snapshot(boundary);
|
|
347
|
+
const base = new Map([...captured].map(([path, content]) => [path, content.slice()]));
|
|
348
|
+
const trace = { inputs: [], attemptedReads: [], effects: [] };
|
|
349
|
+
const isolated = transaction(base, trace, host.root);
|
|
350
|
+
const outcome = yield* execution.workflow.pipe(
|
|
351
|
+
Effect.provideService(Workspace, isolated.workspace),
|
|
352
|
+
Effect.provideService(FileSystem.FileSystem, isolated.fileSystem),
|
|
353
|
+
Effect.exit
|
|
354
|
+
);
|
|
355
|
+
const inputs = [];
|
|
356
|
+
for (const input of trace.inputs) {
|
|
357
|
+
inputs.push({ resource: resource(input.path), digest: yield* digestOf(input.content) });
|
|
358
|
+
}
|
|
359
|
+
const descriptor = workspaceRelative(host.root, boundary);
|
|
360
|
+
const undeclaredReads = trace.attemptedReads.filter(
|
|
361
|
+
(attempt) => !attempt.produced && !descriptor.readSet.some(
|
|
362
|
+
(entry) => FileSet.isGlob(entry) ? FileSet.matchesGlob(entry, attempt.path) : entry.path === attempt.path
|
|
363
|
+
)
|
|
364
|
+
);
|
|
365
|
+
if (Exit.isFailure(outcome)) {
|
|
366
|
+
if (undeclaredReads.length > 0 && boundary.boundaryMode === "hard") {
|
|
367
|
+
return {
|
|
368
|
+
_tag: "Invalidated",
|
|
369
|
+
provenance: {
|
|
370
|
+
baseRevision: yield* revisionOf(base),
|
|
371
|
+
inputs,
|
|
372
|
+
outputs: []
|
|
373
|
+
},
|
|
374
|
+
violations: [
|
|
375
|
+
...new Map(undeclaredReads.map((attempt) => [attempt.path, {
|
|
376
|
+
kind: "undeclared-read",
|
|
377
|
+
resource: resource(attempt.path)
|
|
378
|
+
}])).values()
|
|
379
|
+
]
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return yield* Effect.failCause(outcome.cause);
|
|
383
|
+
}
|
|
384
|
+
const output = outcome.value;
|
|
385
|
+
const files = yield* changes(base, isolated.files, host);
|
|
386
|
+
const provenance = {
|
|
387
|
+
baseRevision: yield* revisionOf(base),
|
|
388
|
+
inputs,
|
|
389
|
+
outputs: files.map((change) => ({
|
|
390
|
+
resource: resource(change.path),
|
|
391
|
+
operation: change.afterDigest === void 0 ? "remove" : "write",
|
|
392
|
+
digest: change.afterDigest
|
|
393
|
+
}))
|
|
394
|
+
};
|
|
395
|
+
const invalid = [
|
|
396
|
+
...new Map([
|
|
397
|
+
...violations(descriptor, base, provenance),
|
|
398
|
+
...undeclaredReads.map((attempt) => ({
|
|
399
|
+
kind: "undeclared-read",
|
|
400
|
+
resource: resource(attempt.path)
|
|
401
|
+
}))
|
|
402
|
+
].map((violation) => [`${violation.kind}:${violation.resource.id}`, violation])).values()
|
|
403
|
+
];
|
|
404
|
+
if (invalid.length > 0 && boundary.boundaryMode === "hard") {
|
|
405
|
+
return { _tag: "Invalidated", provenance, violations: invalid };
|
|
406
|
+
}
|
|
407
|
+
const result = { output, files, provenance, effects: trace.effects };
|
|
408
|
+
if (key !== void 0) {
|
|
409
|
+
memo.set(key, { result, violations: invalid });
|
|
410
|
+
}
|
|
411
|
+
return {
|
|
412
|
+
_tag: "Accepted",
|
|
413
|
+
result,
|
|
414
|
+
violations: invalid,
|
|
415
|
+
cache: key === void 0 ? { status: "disabled" } : { status: "miss", key }
|
|
416
|
+
};
|
|
417
|
+
});
|
|
418
|
+
return make({
|
|
419
|
+
execute: Effect.fn("WorkspaceSandbox.execute")(
|
|
420
|
+
function* (execution) {
|
|
421
|
+
yield* Effect.annotateCurrentSpan({ boundaryMode: execution.descriptor.boundaryMode });
|
|
422
|
+
return yield* executeBody(execution);
|
|
423
|
+
},
|
|
424
|
+
(effect) => EngineStoreMetrics.observe({
|
|
425
|
+
timer: EngineStoreMetrics.sandboxExecutionDuration,
|
|
426
|
+
counter: EngineStoreMetrics.sandboxExecution
|
|
427
|
+
})(effect)
|
|
428
|
+
),
|
|
429
|
+
materialize: Effect.fn("WorkspaceSandbox.materialize")(
|
|
430
|
+
function* (accepted) {
|
|
431
|
+
yield* Effect.annotateCurrentSpan({ changes: accepted.result.files.length });
|
|
432
|
+
if (accepted.result.files.length === 0) return;
|
|
433
|
+
yield* host.commit(accepted.result.files);
|
|
434
|
+
},
|
|
435
|
+
(effect) => EngineStoreMetrics.observe({
|
|
436
|
+
timer: EngineStoreMetrics.materializationDuration,
|
|
437
|
+
counter: EngineStoreMetrics.materialization
|
|
438
|
+
})(effect)
|
|
439
|
+
)
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
const makeMemory = (initialFiles = {}) => Effect.gen(function* () {
|
|
443
|
+
const entries = [];
|
|
444
|
+
for (const [path, content] of Object.entries(initialFiles)) {
|
|
445
|
+
const normalized = normalizePath("", path);
|
|
446
|
+
if (Result.isFailure(normalized)) return yield* Effect.fail(normalized.failure);
|
|
447
|
+
entries.push([normalized.success, typeof content === "string" ? encoder.encode(content) : content.slice()]);
|
|
448
|
+
}
|
|
449
|
+
const host = yield* Ref.make(new Map(entries));
|
|
450
|
+
const service = makeHosted({
|
|
451
|
+
root: "",
|
|
452
|
+
snapshot: () => Ref.get(host),
|
|
453
|
+
// This host seeds the transaction with the WHOLE tree, so a path the
|
|
454
|
+
// transaction did not observe is one the host genuinely did not hold:
|
|
455
|
+
// `undefined` is the honest snapshot-time answer, and a file that
|
|
456
|
+
// appeared underneath the transaction is caught by copy-back's
|
|
457
|
+
// compare-and-set rather than clobbered.
|
|
458
|
+
baseline: () => Effect.succeed(void 0),
|
|
459
|
+
retain: (bytes) => Effect.succeed(bytes.slice()),
|
|
460
|
+
commit: Effect.fn("WorkspaceSandbox.commit")(function* (changes2) {
|
|
461
|
+
yield* Effect.annotateCurrentSpan({ changes: changes2.length });
|
|
462
|
+
const current = yield* Ref.get(host);
|
|
463
|
+
const { conflict } = yield* preflight(changes2, (path) => Effect.succeed(current.get(path)));
|
|
464
|
+
if (conflict !== void 0) {
|
|
465
|
+
yield* Metric.update(EngineStoreMetrics.materializationConflicts, 1);
|
|
466
|
+
return yield* Effect.fail(conflict);
|
|
467
|
+
}
|
|
468
|
+
const next = new Map(current);
|
|
469
|
+
for (const change of changes2) {
|
|
470
|
+
if (change.afterDigest === void 0) next.delete(change.path);
|
|
471
|
+
else next.set(change.path, change.after.slice());
|
|
472
|
+
}
|
|
473
|
+
yield* Ref.set(host, next);
|
|
474
|
+
})
|
|
475
|
+
});
|
|
476
|
+
return {
|
|
477
|
+
service,
|
|
478
|
+
files: Ref.get(host).pipe(
|
|
479
|
+
Effect.map(
|
|
480
|
+
(current) => [...current].map(([path, content]) => ({ path, content })).sort((left, right) => (0, import_Ordering.compareText)(left.path, right.path))
|
|
481
|
+
)
|
|
482
|
+
)
|
|
483
|
+
};
|
|
484
|
+
});
|
|
485
|
+
const CommitLocks = Context.Service(
|
|
486
|
+
"@smthrs/engine-store/WorkspaceSandbox/CommitLocks"
|
|
487
|
+
);
|
|
488
|
+
const locksLayer = Layer.effect(CommitLocks, RcMap.make({ lookup: (_root) => Semaphore.make(1) }));
|
|
489
|
+
const lockOwners = Layer.makeMemoMapUnsafe();
|
|
490
|
+
const coordinateCommit = (root, write) => Effect.scoped(Effect.gen(function* () {
|
|
491
|
+
const services = yield* Layer.buildWithMemoMap(locksLayer, lockOwners, yield* Scope.Scope);
|
|
492
|
+
const lock = yield* RcMap.get(Context.get(services, CommitLocks), root);
|
|
493
|
+
return yield* lock.withPermit(write);
|
|
494
|
+
}));
|
|
495
|
+
const commitLockName = ".smithers-workspace-lock";
|
|
496
|
+
const engineStateName = ".flows";
|
|
497
|
+
const defaultMaxInlineBytes = 1024 * 1024;
|
|
498
|
+
const hostFailure = (cause) => new WorkspaceError({
|
|
499
|
+
code: "host_unavailable",
|
|
500
|
+
message: "the host filesystem could not serve the workspace transaction",
|
|
501
|
+
cause
|
|
502
|
+
});
|
|
503
|
+
const artifactFailure = (cause) => new WorkspaceError({
|
|
504
|
+
code: "host_unavailable",
|
|
505
|
+
message: `the artifact store could not serve the workspace transaction: ${cause.message}`,
|
|
506
|
+
cause
|
|
507
|
+
});
|
|
508
|
+
const confinementCodes = /* @__PURE__ */ new Set(["ELOOP", "ENOTDIR", "EPERM"]);
|
|
509
|
+
const refusedByConfinement = (error) => error.reason._tag !== "BadArgument" && typeof error.reason.cause === "object" && error.reason.cause !== null && confinementCodes.has(error.reason.cause.code);
|
|
510
|
+
const copyBackFailure = (path) => (error) => refusedByConfinement(error) ? new WorkspaceError({
|
|
511
|
+
code: "path_escapes_workspace",
|
|
512
|
+
message: `materializing ${path} was refused: it does not name a workspace entry reachable without following a link (${error.message})`,
|
|
513
|
+
cause: error
|
|
514
|
+
}) : hostFailure(error);
|
|
515
|
+
const lockFailure = (cause) => Cause.isTimeoutError(cause) ? new WorkspaceError({
|
|
516
|
+
code: "commit_lock_timeout",
|
|
517
|
+
message: `another writer held ${commitLockName} for the whole acquisition deadline; a lock whose owner stopped is reclaimed once its heartbeat is ${FileLease.defaultStaleAfterMs} ms old`,
|
|
518
|
+
cause
|
|
519
|
+
}) : copyBackFailure(commitLockName)(cause);
|
|
520
|
+
const foldPath = (path) => path.normalize("NFKC").toUpperCase().toLowerCase().normalize("NFKC");
|
|
521
|
+
const shortNameAlias = /^[^.~]{0,7}~\d{1,7}(\.[^.]{0,3})?$/u;
|
|
522
|
+
const isShortNameAlias = (segment) => {
|
|
523
|
+
const base = segment.split(".")[0];
|
|
524
|
+
return base.length <= 8 && shortNameAlias.test(segment);
|
|
525
|
+
};
|
|
526
|
+
const makeFileSystem = (fs, platformPath, artifacts, workspaceRoot, options = {}) => {
|
|
527
|
+
const maxInlineBytes = options.maxInlineBytes ?? defaultMaxInlineBytes;
|
|
528
|
+
const root = workspaceRoot.replaceAll(/\/+$/g, "");
|
|
529
|
+
const reserved = [
|
|
530
|
+
commitLockName,
|
|
531
|
+
engineStateName,
|
|
532
|
+
...(options.reservedPaths ?? []).map((path) => path.replace(/^(\.\/)+/, "").replaceAll(/\/+$/g, ""))
|
|
533
|
+
].filter((path) => path !== "" && path !== ".").map((name) => ({ name, segments: foldPath(name).split("/") }));
|
|
534
|
+
const reservedAt = (path) => {
|
|
535
|
+
const segments = foldPath(path).split("/");
|
|
536
|
+
const within = reserved.filter((entry) => entry.segments.length <= segments.length);
|
|
537
|
+
const exact = within.find((entry) => entry.segments.every((segment, index) => segments[index] === segment));
|
|
538
|
+
if (exact !== void 0) return `the workspace path ${exact.name} is reserved`;
|
|
539
|
+
const alias = within.find(
|
|
540
|
+
(entry) => (
|
|
541
|
+
// `within` holds only entries no longer than the path, so every index is present.
|
|
542
|
+
entry.segments.every((segment, index) => segments[index] === segment || isShortNameAlias(segments[index]))
|
|
543
|
+
)
|
|
544
|
+
);
|
|
545
|
+
if (alias === void 0) return void 0;
|
|
546
|
+
const spelling = path.split("/").slice(0, alias.segments.length).join("/");
|
|
547
|
+
return `the workspace path ${spelling} may be a short-name alias of a reserved path`;
|
|
548
|
+
};
|
|
549
|
+
const hostPath = (path) => root === "" ? path : `${root}/${path}`;
|
|
550
|
+
const readFrom = (host, path, onError) => host.readFile(path).pipe(
|
|
551
|
+
Effect.catchReason("PlatformError", "NotFound", () => Effect.succeed(void 0)),
|
|
552
|
+
Effect.mapError(onError)
|
|
553
|
+
);
|
|
554
|
+
const readIfPresent = Effect.fn("WorkspaceSandbox.readIfPresent")(function* (path) {
|
|
555
|
+
return yield* readFrom(fs, path, hostFailure);
|
|
556
|
+
});
|
|
557
|
+
const canonicalRoot = fs.realPath(root === "" ? "." : root).pipe(
|
|
558
|
+
Effect.catchReason("PlatformError", "NotFound", () => Effect.succeed(void 0)),
|
|
559
|
+
Effect.mapError(hostFailure)
|
|
560
|
+
);
|
|
561
|
+
const withCommitLock = (changes2, effect) => Effect.gen(function* () {
|
|
562
|
+
for (const change of changes2) {
|
|
563
|
+
const hit = reservedAt(change.path);
|
|
564
|
+
if (hit !== void 0) return yield* Effect.fail(hostFailure(hit));
|
|
565
|
+
}
|
|
566
|
+
yield* fs.makeDirectory(root === "" ? "." : root, { recursive: true }).pipe(Effect.mapError(hostFailure));
|
|
567
|
+
const host = yield* KernelFileSystem.confined(fs, root).pipe(
|
|
568
|
+
Effect.provideService(Path.Path, platformPath),
|
|
569
|
+
Effect.mapError(hostFailure)
|
|
570
|
+
);
|
|
571
|
+
const canonical = yield* canonicalRoot;
|
|
572
|
+
const leaseHost = { ...host, utimes: fs.utimes };
|
|
573
|
+
return yield* coordinateCommit(
|
|
574
|
+
canonical ?? root,
|
|
575
|
+
FileLease.withLease(leaseHost, hostPath(commitLockName), effect(host), lockFailure, {
|
|
576
|
+
label: "Workspace commit lock",
|
|
577
|
+
annotations: { root: canonical ?? root }
|
|
578
|
+
})
|
|
579
|
+
);
|
|
580
|
+
});
|
|
581
|
+
const commitWith = Effect.fn("WorkspaceSandbox.commit")(function* (host, changes2) {
|
|
582
|
+
yield* Effect.annotateCurrentSpan({ changes: changes2.length });
|
|
583
|
+
const { before, conflict } = yield* preflight(
|
|
584
|
+
changes2,
|
|
585
|
+
(path) => readFrom(host, hostPath(path), copyBackFailure(path))
|
|
586
|
+
);
|
|
587
|
+
if (conflict !== void 0) {
|
|
588
|
+
yield* Metric.update(EngineStoreMetrics.materializationConflicts, 1);
|
|
589
|
+
return yield* Effect.fail(conflict);
|
|
590
|
+
}
|
|
591
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
592
|
+
for (const change of changes2) {
|
|
593
|
+
if (change.afterDigest === void 0) continue;
|
|
594
|
+
const bytes = change.after ?? (yield* artifacts.get(`${change.afterDigest}`).pipe(
|
|
595
|
+
Effect.mapError(
|
|
596
|
+
(error) => error._tag === "@smthrs/artifacts/ArtifactStoreError" ? artifactFailure(error) : new WorkspaceError({
|
|
597
|
+
code: "not_found",
|
|
598
|
+
message: `the retained bytes for ${change.path} are unavailable: ${error.message}`,
|
|
599
|
+
cause: error
|
|
600
|
+
})
|
|
601
|
+
)
|
|
602
|
+
));
|
|
603
|
+
resolved.set(change.path, bytes);
|
|
604
|
+
}
|
|
605
|
+
const applied = [];
|
|
606
|
+
const apply = Effect.gen(function* () {
|
|
607
|
+
for (const change of changes2) {
|
|
608
|
+
applied.push(change);
|
|
609
|
+
const target = hostPath(change.path);
|
|
610
|
+
if (change.afterDigest === void 0) {
|
|
611
|
+
yield* host.remove(target).pipe(Effect.mapError(copyBackFailure(change.path)));
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
const parent = parentDirectory(target);
|
|
615
|
+
if (parent !== void 0) {
|
|
616
|
+
yield* host.makeDirectory(parent, { recursive: true }).pipe(
|
|
617
|
+
Effect.mapError(copyBackFailure(change.path))
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
yield* host.writeFile(target, resolved.get(change.path)).pipe(
|
|
621
|
+
Effect.mapError(copyBackFailure(change.path))
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
const rollback = Effect.gen(function* () {
|
|
626
|
+
for (const change of [...applied].reverse()) {
|
|
627
|
+
const target = hostPath(change.path);
|
|
628
|
+
const previous = before.get(change.path);
|
|
629
|
+
if (previous === void 0) {
|
|
630
|
+
yield* host.remove(target, { force: true }).pipe(Effect.mapError(copyBackFailure(change.path)));
|
|
631
|
+
} else {
|
|
632
|
+
yield* host.writeFile(target, previous).pipe(Effect.mapError(copyBackFailure(change.path)));
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
yield* apply.pipe(
|
|
637
|
+
Effect.catchCause(
|
|
638
|
+
(cause) => Effect.gen(function* () {
|
|
639
|
+
const restored = yield* Effect.exit(rollback);
|
|
640
|
+
if (Exit.isSuccess(restored)) return yield* Effect.failCause(cause);
|
|
641
|
+
const reasons = restored.cause.reasons.filter(Cause.isFailReason).map((reason) => reason.error.message);
|
|
642
|
+
return yield* Effect.failCause(
|
|
643
|
+
Cause.combine(
|
|
644
|
+
cause,
|
|
645
|
+
Cause.fail(
|
|
646
|
+
new WorkspaceError({
|
|
647
|
+
code: "host_unavailable",
|
|
648
|
+
message: `copy-back failed mid-apply and rollback could not restore the workspace: ${reasons.join("; ")}`,
|
|
649
|
+
cause: restored.cause
|
|
650
|
+
})
|
|
651
|
+
)
|
|
652
|
+
)
|
|
653
|
+
);
|
|
654
|
+
})
|
|
655
|
+
),
|
|
656
|
+
// Interruption inside the apply window is a mid-sequence abort the
|
|
657
|
+
// journal exists to prevent; the window is bounded local work, so it
|
|
658
|
+
// closes before the fiber answers the interrupt.
|
|
659
|
+
Effect.uninterruptible
|
|
660
|
+
);
|
|
661
|
+
});
|
|
662
|
+
return makeHosted({
|
|
663
|
+
root,
|
|
664
|
+
snapshot: Effect.fn("WorkspaceSandbox.snapshot")(function* (descriptor) {
|
|
665
|
+
yield* Effect.annotateCurrentSpan({
|
|
666
|
+
reads: descriptor.readSet.length,
|
|
667
|
+
boundaryMode: descriptor.boundaryMode
|
|
668
|
+
});
|
|
669
|
+
const base = /* @__PURE__ */ new Map();
|
|
670
|
+
for (const entry of descriptor.readSet) {
|
|
671
|
+
const paths = FileSet.isGlob(entry) ? yield* FileEnumeration.expandGlob(fs, entry, {
|
|
672
|
+
resolve: (path) => path === "" ? root === "" ? "." : root : hostPath(path)
|
|
673
|
+
}).pipe(Effect.mapError(hostFailure)) : [entry.path];
|
|
674
|
+
for (const path of paths) {
|
|
675
|
+
const normalized = normalizePath(root, path);
|
|
676
|
+
if (Result.isFailure(normalized)) return yield* Effect.fail(normalized.failure);
|
|
677
|
+
const content = yield* readIfPresent(hostPath(normalized.success));
|
|
678
|
+
if (content !== void 0) base.set(normalized.success, content);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
for (const path of descriptor.removes ?? []) {
|
|
682
|
+
const normalized = normalizePath(root, path);
|
|
683
|
+
if (Result.isFailure(normalized)) return yield* Effect.fail(normalized.failure);
|
|
684
|
+
const content = yield* readIfPresent(hostPath(normalized.success));
|
|
685
|
+
if (content !== void 0) base.set(normalized.success, content);
|
|
686
|
+
}
|
|
687
|
+
return base;
|
|
688
|
+
}),
|
|
689
|
+
baseline: Effect.fn("WorkspaceSandbox.baseline")(function* (path) {
|
|
690
|
+
const content = yield* readIfPresent(hostPath(path));
|
|
691
|
+
return content === void 0 ? void 0 : yield* digestOf(content);
|
|
692
|
+
}),
|
|
693
|
+
// The bytes now live at the change's `afterDigest`; the change itself
|
|
694
|
+
// carries only the reference, exactly as oversized `StepBoundary`
|
|
695
|
+
// evidence does.
|
|
696
|
+
retain: (bytes) => bytes.length <= maxInlineBytes ? Effect.succeed(bytes) : artifacts.put(bytes).pipe(Effect.mapError(artifactFailure), Effect.as(void 0)),
|
|
697
|
+
commit: (changes2) => withCommitLock(changes2, (host) => commitWith(host, changes2))
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
const layerFileSystem = (options = {}) => Layer.effect(
|
|
701
|
+
WorkspaceSandbox,
|
|
702
|
+
Effect.gen(function* () {
|
|
703
|
+
const fs = yield* FileSystem.FileSystem;
|
|
704
|
+
const platformPath = yield* Path.Path;
|
|
705
|
+
const artifacts = yield* ArtifactStore.ArtifactStore;
|
|
706
|
+
const workspace = yield* import_Workspace.Workspace;
|
|
707
|
+
yield* KernelFileSystem.requireConfinable(fs, workspace.root).pipe(Effect.mapError(hostFailure));
|
|
708
|
+
return makeFileSystem(fs, platformPath, artifacts, workspace.root, options);
|
|
709
|
+
})
|
|
710
|
+
);
|
|
711
|
+
//# sourceMappingURL=WorkspaceSandbox.js.map
|