@smthrs/flow 0.0.0-stage → 1.0.0-rc.13
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 +161 -0
- package/LICENSE +21 -0
- package/README.md +212 -2
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/cjs/Action/Action.d.ts +250 -0
- package/dist/cjs/Action/Action.d.ts.map +1 -0
- package/dist/cjs/Action/Action.js +42 -0
- package/dist/cjs/Action/Action.js.map +7 -0
- package/dist/cjs/Action/AttemptTimedOut.d.ts +33 -0
- package/dist/cjs/Action/AttemptTimedOut.d.ts.map +1 -0
- package/dist/cjs/Action/AttemptTimedOut.js +51 -0
- package/dist/cjs/Action/AttemptTimedOut.js.map +7 -0
- package/dist/cjs/Action/BoundaryMode.d.ts +29 -0
- package/dist/cjs/Action/BoundaryMode.d.ts.map +1 -0
- package/dist/cjs/Action/BoundaryMode.js +36 -0
- package/dist/cjs/Action/BoundaryMode.js.map +7 -0
- package/dist/cjs/Action/CacheEnvironment.d.ts +158 -0
- package/dist/cjs/Action/CacheEnvironment.d.ts.map +1 -0
- package/dist/cjs/Action/CacheEnvironment.js +57 -0
- package/dist/cjs/Action/CacheEnvironment.js.map +7 -0
- package/dist/cjs/Action/ConcurrentKeylessDispatch.d.ts +34 -0
- package/dist/cjs/Action/ConcurrentKeylessDispatch.d.ts.map +1 -0
- package/dist/cjs/Action/ConcurrentKeylessDispatch.js +46 -0
- package/dist/cjs/Action/ConcurrentKeylessDispatch.js.map +7 -0
- package/dist/cjs/Action/Context.d.ts +131 -0
- package/dist/cjs/Action/Context.d.ts.map +1 -0
- package/dist/cjs/Action/Context.js +68 -0
- package/dist/cjs/Action/Context.js.map +7 -0
- package/dist/cjs/Action/DuplicateImplementation.d.ts +20 -0
- package/dist/cjs/Action/DuplicateImplementation.d.ts.map +1 -0
- package/dist/cjs/Action/DuplicateImplementation.js +46 -0
- package/dist/cjs/Action/DuplicateImplementation.js.map +7 -0
- package/dist/cjs/Action/FileBoundary.d.ts +59 -0
- package/dist/cjs/Action/FileBoundary.d.ts.map +1 -0
- package/dist/cjs/Action/FileBoundary.js +81 -0
- package/dist/cjs/Action/FileBoundary.js.map +7 -0
- package/dist/cjs/Action/FileInput.d.ts +28 -0
- package/dist/cjs/Action/FileInput.d.ts.map +1 -0
- package/dist/cjs/Action/FileInput.js +42 -0
- package/dist/cjs/Action/FileInput.js.map +7 -0
- package/dist/cjs/Action/Filegroup.d.ts +16 -0
- package/dist/cjs/Action/Filegroup.d.ts.map +1 -0
- package/dist/cjs/Action/Filegroup.js +27 -0
- package/dist/cjs/Action/Filegroup.js.map +7 -0
- package/dist/cjs/Action/Glob.d.ts +8 -0
- package/dist/cjs/Action/Glob.d.ts.map +1 -0
- package/dist/cjs/Action/Glob.js +28 -0
- package/dist/cjs/Action/Glob.js.map +7 -0
- package/dist/cjs/Action/ImplementationVersionMismatch.d.ts +26 -0
- package/dist/cjs/Action/ImplementationVersionMismatch.d.ts.map +1 -0
- package/dist/cjs/Action/ImplementationVersionMismatch.js +45 -0
- package/dist/cjs/Action/ImplementationVersionMismatch.js.map +7 -0
- package/dist/cjs/Action/Implementations.d.ts +114 -0
- package/dist/cjs/Action/Implementations.d.ts.map +1 -0
- package/dist/cjs/Action/Implementations.js +65 -0
- package/dist/cjs/Action/Implementations.js.map +7 -0
- package/dist/cjs/Action/InfraInterrupt.d.ts +26 -0
- package/dist/cjs/Action/InfraInterrupt.d.ts.map +1 -0
- package/dist/cjs/Action/InfraInterrupt.js +46 -0
- package/dist/cjs/Action/InfraInterrupt.js.map +7 -0
- package/dist/cjs/Action/InfraInterruptRetriesExhausted.d.ts +33 -0
- package/dist/cjs/Action/InfraInterruptRetriesExhausted.d.ts.map +1 -0
- package/dist/cjs/Action/InfraInterruptRetriesExhausted.js +54 -0
- package/dist/cjs/Action/InfraInterruptRetriesExhausted.js.map +7 -0
- package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts +26 -0
- package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts.map +1 -0
- package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.js +47 -0
- package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.js.map +7 -0
- package/dist/cjs/Action/StepIdentity.d.ts +153 -0
- package/dist/cjs/Action/StepIdentity.d.ts.map +1 -0
- package/dist/cjs/Action/StepIdentity.js +75 -0
- package/dist/cjs/Action/StepIdentity.js.map +7 -0
- package/dist/cjs/Action/TreeArtifact.d.ts +8 -0
- package/dist/cjs/Action/TreeArtifact.d.ts.map +1 -0
- package/dist/cjs/Action/TreeArtifact.js +25 -0
- package/dist/cjs/Action/TreeArtifact.js.map +7 -0
- package/dist/cjs/Action/TypeId.d.ts +8 -0
- package/dist/cjs/Action/TypeId.d.ts.map +1 -0
- package/dist/cjs/Action/TypeId.js +25 -0
- package/dist/cjs/Action/TypeId.js.map +7 -0
- package/dist/cjs/Action/UncanonicalIdempotencyKey.d.ts +32 -0
- package/dist/cjs/Action/UncanonicalIdempotencyKey.d.ts.map +1 -0
- package/dist/cjs/Action/UncanonicalIdempotencyKey.js +51 -0
- package/dist/cjs/Action/UncanonicalIdempotencyKey.js.map +7 -0
- package/dist/cjs/Action/idempotencyKey.d.ts +21 -0
- package/dist/cjs/Action/idempotencyKey.d.ts.map +1 -0
- package/dist/cjs/Action/idempotencyKey.js +59 -0
- package/dist/cjs/Action/idempotencyKey.js.map +7 -0
- package/dist/cjs/Action/index.d.ts +29 -0
- package/dist/cjs/Action/index.d.ts.map +1 -0
- package/dist/cjs/Action/index.js +60 -0
- package/dist/cjs/Action/index.js.map +7 -0
- package/dist/cjs/Action/make.d.ts +128 -0
- package/dist/cjs/Action/make.d.ts.map +1 -0
- package/dist/cjs/Action/make.js +387 -0
- package/dist/cjs/Action/make.js.map +7 -0
- package/dist/cjs/Action/raceAll.d.ts +21 -0
- package/dist/cjs/Action/raceAll.d.ts.map +1 -0
- package/dist/cjs/Action/raceAll.js +46 -0
- package/dist/cjs/Action/raceAll.js.map +7 -0
- package/dist/cjs/Action/retry.d.ts +19 -0
- package/dist/cjs/Action/retry.d.ts.map +1 -0
- package/dist/cjs/Action/retry.js +75 -0
- package/dist/cjs/Action/retry.js.map +7 -0
- package/dist/cjs/Deadline.d.ts +110 -0
- package/dist/cjs/Deadline.d.ts.map +1 -0
- package/dist/cjs/Deadline.js +112 -0
- package/dist/cjs/Deadline.js.map +7 -0
- package/dist/cjs/DurableClock.d.ts +60 -0
- package/dist/cjs/DurableClock.d.ts.map +1 -0
- package/dist/cjs/DurableClock.js +107 -0
- package/dist/cjs/DurableClock.js.map +7 -0
- package/dist/cjs/DurableDeferred.d.ts +311 -0
- package/dist/cjs/DurableDeferred.d.ts.map +1 -0
- package/dist/cjs/DurableDeferred.js +322 -0
- package/dist/cjs/DurableDeferred.js.map +7 -0
- package/dist/cjs/DurableQueue.d.ts +160 -0
- package/dist/cjs/DurableQueue.d.ts.map +1 -0
- package/dist/cjs/DurableQueue.js +229 -0
- package/dist/cjs/DurableQueue.js.map +7 -0
- package/dist/cjs/ExternalJob.d.ts +179 -0
- package/dist/cjs/ExternalJob.d.ts.map +1 -0
- package/dist/cjs/ExternalJob.js +339 -0
- package/dist/cjs/ExternalJob.js.map +7 -0
- package/dist/cjs/Fault.d.ts +131 -0
- package/dist/cjs/Fault.d.ts.map +1 -0
- package/dist/cjs/Fault.js +157 -0
- package/dist/cjs/Fault.js.map +7 -0
- package/dist/cjs/Flow/Annotations.d.ts +245 -0
- package/dist/cjs/Flow/Annotations.d.ts.map +1 -0
- package/dist/cjs/Flow/Annotations.js +72 -0
- package/dist/cjs/Flow/Annotations.js.map +7 -0
- package/dist/cjs/Flow/CapabilityCeiling.d.ts +21 -0
- package/dist/cjs/Flow/CapabilityCeiling.d.ts.map +1 -0
- package/dist/cjs/Flow/CapabilityCeiling.js +49 -0
- package/dist/cjs/Flow/CapabilityCeiling.js.map +7 -0
- package/dist/cjs/Flow/DeadlineExceeded.d.ts +33 -0
- package/dist/cjs/Flow/DeadlineExceeded.d.ts.map +1 -0
- package/dist/cjs/Flow/DeadlineExceeded.js +52 -0
- package/dist/cjs/Flow/DeadlineExceeded.js.map +7 -0
- package/dist/cjs/Flow/ExecutionIdRequired.d.ts +25 -0
- package/dist/cjs/Flow/ExecutionIdRequired.d.ts.map +1 -0
- package/dist/cjs/Flow/ExecutionIdRequired.js +46 -0
- package/dist/cjs/Flow/ExecutionIdRequired.js.map +7 -0
- package/dist/cjs/Flow/ExecutionIds.d.ts +80 -0
- package/dist/cjs/Flow/ExecutionIds.d.ts.map +1 -0
- package/dist/cjs/Flow/ExecutionIds.js +66 -0
- package/dist/cjs/Flow/ExecutionIds.js.map +7 -0
- package/dist/cjs/Flow/Flow.d.ts +422 -0
- package/dist/cjs/Flow/Flow.d.ts.map +1 -0
- package/dist/cjs/Flow/Flow.js +17 -0
- package/dist/cjs/Flow/Flow.js.map +7 -0
- package/dist/cjs/Flow/MaxRoundsExceeded.d.ts +35 -0
- package/dist/cjs/Flow/MaxRoundsExceeded.d.ts.map +1 -0
- package/dist/cjs/Flow/MaxRoundsExceeded.js +50 -0
- package/dist/cjs/Flow/MaxRoundsExceeded.js.map +7 -0
- package/dist/cjs/Flow/Outcome.d.ts +162 -0
- package/dist/cjs/Flow/Outcome.d.ts.map +1 -0
- package/dist/cjs/Flow/Outcome.js +80 -0
- package/dist/cjs/Flow/Outcome.js.map +7 -0
- package/dist/cjs/Flow/Result.d.ts +186 -0
- package/dist/cjs/Flow/Result.d.ts.map +1 -0
- package/dist/cjs/Flow/Result.js +159 -0
- package/dist/cjs/Flow/Result.js.map +7 -0
- package/dist/cjs/Flow/Runtime.d.ts +98 -0
- package/dist/cjs/Flow/Runtime.d.ts.map +1 -0
- package/dist/cjs/Flow/Runtime.js +186 -0
- package/dist/cjs/Flow/Runtime.js.map +7 -0
- package/dist/cjs/Flow/TypeId.d.ts +8 -0
- package/dist/cjs/Flow/TypeId.d.ts.map +1 -0
- package/dist/cjs/Flow/TypeId.js +25 -0
- package/dist/cjs/Flow/TypeId.js.map +7 -0
- package/dist/cjs/Flow/index.d.ts +17 -0
- package/dist/cjs/Flow/index.d.ts.map +1 -0
- package/dist/cjs/Flow/index.js +29 -0
- package/dist/cjs/Flow/index.js.map +7 -0
- package/dist/cjs/Flow/internal.d.ts +34 -0
- package/dist/cjs/Flow/internal.d.ts.map +1 -0
- package/dist/cjs/Flow/internal.js +187 -0
- package/dist/cjs/Flow/internal.js.map +7 -0
- package/dist/cjs/Flow/make.d.ts +149 -0
- package/dist/cjs/Flow/make.d.ts.map +1 -0
- package/dist/cjs/Flow/make.js +107 -0
- package/dist/cjs/Flow/make.js.map +7 -0
- package/dist/cjs/FlowRuntime/CancelRequestFailed.d.ts +55 -0
- package/dist/cjs/FlowRuntime/CancelRequestFailed.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/CancelRequestFailed.js +51 -0
- package/dist/cjs/FlowRuntime/CancelRequestFailed.js.map +7 -0
- package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.d.ts +23 -0
- package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.js +55 -0
- package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.js.map +7 -0
- package/dist/cjs/FlowRuntime/FlowCycleDetected.d.ts +28 -0
- package/dist/cjs/FlowRuntime/FlowCycleDetected.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/FlowCycleDetected.js +49 -0
- package/dist/cjs/FlowRuntime/FlowCycleDetected.js.map +7 -0
- package/dist/cjs/FlowRuntime/FlowExecutionNotFound.d.ts +38 -0
- package/dist/cjs/FlowRuntime/FlowExecutionNotFound.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/FlowExecutionNotFound.js +53 -0
- package/dist/cjs/FlowRuntime/FlowExecutionNotFound.js.map +7 -0
- package/dist/cjs/FlowRuntime/FlowInstance.d.ts +115 -0
- package/dist/cjs/FlowRuntime/FlowInstance.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/FlowInstance.js +37 -0
- package/dist/cjs/FlowRuntime/FlowInstance.js.map +7 -0
- package/dist/cjs/FlowRuntime/FlowRuntime.d.ts +204 -0
- package/dist/cjs/FlowRuntime/FlowRuntime.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/FlowRuntime.js +37 -0
- package/dist/cjs/FlowRuntime/FlowRuntime.js.map +7 -0
- package/dist/cjs/FlowRuntime/NodeRecord.d.ts +177 -0
- package/dist/cjs/FlowRuntime/NodeRecord.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/NodeRecord.js +17 -0
- package/dist/cjs/FlowRuntime/NodeRecord.js.map +7 -0
- package/dist/cjs/FlowRuntime/WaitingAnnotation.d.ts +69 -0
- package/dist/cjs/FlowRuntime/WaitingAnnotation.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/WaitingAnnotation.js +53 -0
- package/dist/cjs/FlowRuntime/WaitingAnnotation.js.map +7 -0
- package/dist/cjs/FlowRuntime/index.d.ts +14 -0
- package/dist/cjs/FlowRuntime/index.d.ts.map +1 -0
- package/dist/cjs/FlowRuntime/index.js +26 -0
- package/dist/cjs/FlowRuntime/index.js.map +7 -0
- package/dist/cjs/Graph.d.ts +325 -0
- package/dist/cjs/Graph.d.ts.map +1 -0
- package/dist/cjs/Graph.js +1020 -0
- package/dist/cjs/Graph.js.map +7 -0
- package/dist/cjs/HumanTask.d.ts +442 -0
- package/dist/cjs/HumanTask.d.ts.map +1 -0
- package/dist/cjs/HumanTask.js +422 -0
- package/dist/cjs/HumanTask.js.map +7 -0
- package/dist/cjs/Interpreter.d.ts +223 -0
- package/dist/cjs/Interpreter.d.ts.map +1 -0
- package/dist/cjs/Interpreter.js +919 -0
- package/dist/cjs/Interpreter.js.map +7 -0
- package/dist/cjs/Poll.d.ts +240 -0
- package/dist/cjs/Poll.d.ts.map +1 -0
- package/dist/cjs/Poll.js +154 -0
- package/dist/cjs/Poll.js.map +7 -0
- package/dist/cjs/RetryPolicy.d.ts +273 -0
- package/dist/cjs/RetryPolicy.d.ts.map +1 -0
- package/dist/cjs/RetryPolicy.js +251 -0
- package/dist/cjs/RetryPolicy.js.map +7 -0
- package/dist/cjs/Sleep.d.ts +98 -0
- package/dist/cjs/Sleep.d.ts.map +1 -0
- package/dist/cjs/Sleep.js +141 -0
- package/dist/cjs/Sleep.js.map +7 -0
- package/dist/cjs/Stall.d.ts +173 -0
- package/dist/cjs/Stall.d.ts.map +1 -0
- package/dist/cjs/Stall.js +92 -0
- package/dist/cjs/Stall.js.map +7 -0
- package/dist/cjs/WaitFor.d.ts +109 -0
- package/dist/cjs/WaitFor.d.ts.map +1 -0
- package/dist/cjs/WaitFor.js +117 -0
- package/dist/cjs/WaitFor.js.map +7 -0
- package/dist/cjs/index.d.ts +107 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +69 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/BoundedJson.d.ts +48 -0
- package/dist/cjs/internal/BoundedJson.d.ts.map +1 -0
- package/dist/cjs/internal/BoundedJson.js +96 -0
- package/dist/cjs/internal/BoundedJson.js.map +7 -0
- package/dist/cjs/internal/DeclarationSite.d.ts +135 -0
- package/dist/cjs/internal/DeclarationSite.d.ts.map +1 -0
- package/dist/cjs/internal/DeclarationSite.js +89 -0
- package/dist/cjs/internal/DeclarationSite.js.map +7 -0
- package/dist/cjs/internal/Declarations.d.ts +35 -0
- package/dist/cjs/internal/Declarations.d.ts.map +1 -0
- package/dist/cjs/internal/Declarations.js +50 -0
- package/dist/cjs/internal/Declarations.js.map +7 -0
- package/dist/cjs/internal/ExecutionMiddleware.d.ts +21 -0
- package/dist/cjs/internal/ExecutionMiddleware.d.ts.map +1 -0
- package/dist/cjs/internal/ExecutionMiddleware.js +39 -0
- package/dist/cjs/internal/ExecutionMiddleware.js.map +7 -0
- package/dist/cjs/internal/JsonSchemaSubset.d.ts +133 -0
- package/dist/cjs/internal/JsonSchemaSubset.d.ts.map +1 -0
- package/dist/cjs/internal/JsonSchemaSubset.js +229 -0
- package/dist/cjs/internal/JsonSchemaSubset.js.map +7 -0
- package/dist/cjs/internal/OutcomeMarker.d.ts +18 -0
- package/dist/cjs/internal/OutcomeMarker.d.ts.map +1 -0
- package/dist/cjs/internal/OutcomeMarker.js +27 -0
- package/dist/cjs/internal/OutcomeMarker.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/Action/Action.d.ts +250 -0
- package/dist/esm/Action/Action.d.ts.map +1 -0
- package/dist/esm/Action/Action.js +30 -0
- package/dist/esm/Action/Action.js.map +1 -0
- package/dist/esm/Action/AttemptTimedOut.d.ts +33 -0
- package/dist/esm/Action/AttemptTimedOut.d.ts.map +1 -0
- package/dist/esm/Action/AttemptTimedOut.js +32 -0
- package/dist/esm/Action/AttemptTimedOut.js.map +1 -0
- package/dist/esm/Action/BoundaryMode.d.ts +29 -0
- package/dist/esm/Action/BoundaryMode.d.ts.map +1 -0
- package/dist/esm/Action/BoundaryMode.js +23 -0
- package/dist/esm/Action/BoundaryMode.js.map +1 -0
- package/dist/esm/Action/CacheEnvironment.d.ts +158 -0
- package/dist/esm/Action/CacheEnvironment.d.ts.map +1 -0
- package/dist/esm/Action/CacheEnvironment.js +130 -0
- package/dist/esm/Action/CacheEnvironment.js.map +1 -0
- package/dist/esm/Action/ConcurrentKeylessDispatch.d.ts +34 -0
- package/dist/esm/Action/ConcurrentKeylessDispatch.d.ts.map +1 -0
- package/dist/esm/Action/ConcurrentKeylessDispatch.js +33 -0
- package/dist/esm/Action/ConcurrentKeylessDispatch.js.map +1 -0
- package/dist/esm/Action/Context.d.ts +131 -0
- package/dist/esm/Action/Context.d.ts.map +1 -0
- package/dist/esm/Action/Context.js +99 -0
- package/dist/esm/Action/Context.js.map +1 -0
- package/dist/esm/Action/DuplicateImplementation.d.ts +20 -0
- package/dist/esm/Action/DuplicateImplementation.d.ts.map +1 -0
- package/dist/esm/Action/DuplicateImplementation.js +20 -0
- package/dist/esm/Action/DuplicateImplementation.js.map +1 -0
- package/dist/esm/Action/FileBoundary.d.ts +59 -0
- package/dist/esm/Action/FileBoundary.d.ts.map +1 -0
- package/dist/esm/Action/FileBoundary.js +60 -0
- package/dist/esm/Action/FileBoundary.js.map +1 -0
- package/dist/esm/Action/FileInput.d.ts +28 -0
- package/dist/esm/Action/FileInput.d.ts.map +1 -0
- package/dist/esm/Action/FileInput.js +32 -0
- package/dist/esm/Action/FileInput.js.map +1 -0
- package/dist/esm/Action/Filegroup.d.ts +16 -0
- package/dist/esm/Action/Filegroup.d.ts.map +1 -0
- package/dist/esm/Action/Filegroup.js +15 -0
- package/dist/esm/Action/Filegroup.js.map +1 -0
- package/dist/esm/Action/Glob.d.ts +8 -0
- package/dist/esm/Action/Glob.d.ts.map +1 -0
- package/dist/esm/Action/Glob.js +7 -0
- package/dist/esm/Action/Glob.js.map +1 -0
- package/dist/esm/Action/ImplementationVersionMismatch.d.ts +26 -0
- package/dist/esm/Action/ImplementationVersionMismatch.d.ts.map +1 -0
- package/dist/esm/Action/ImplementationVersionMismatch.js +24 -0
- package/dist/esm/Action/ImplementationVersionMismatch.js.map +1 -0
- package/dist/esm/Action/Implementations.d.ts +114 -0
- package/dist/esm/Action/Implementations.d.ts.map +1 -0
- package/dist/esm/Action/Implementations.js +94 -0
- package/dist/esm/Action/Implementations.js.map +1 -0
- package/dist/esm/Action/InfraInterrupt.d.ts +26 -0
- package/dist/esm/Action/InfraInterrupt.d.ts.map +1 -0
- package/dist/esm/Action/InfraInterrupt.js +25 -0
- package/dist/esm/Action/InfraInterrupt.js.map +1 -0
- package/dist/esm/Action/InfraInterruptRetriesExhausted.d.ts +33 -0
- package/dist/esm/Action/InfraInterruptRetriesExhausted.d.ts.map +1 -0
- package/dist/esm/Action/InfraInterruptRetriesExhausted.js +32 -0
- package/dist/esm/Action/InfraInterruptRetriesExhausted.js.map +1 -0
- package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts +26 -0
- package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts.map +1 -0
- package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.js +25 -0
- package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.js.map +1 -0
- package/dist/esm/Action/StepIdentity.d.ts +153 -0
- package/dist/esm/Action/StepIdentity.d.ts.map +1 -0
- package/dist/esm/Action/StepIdentity.js +139 -0
- package/dist/esm/Action/StepIdentity.js.map +1 -0
- package/dist/esm/Action/TreeArtifact.d.ts +8 -0
- package/dist/esm/Action/TreeArtifact.d.ts.map +1 -0
- package/dist/esm/Action/TreeArtifact.js +7 -0
- package/dist/esm/Action/TreeArtifact.js.map +1 -0
- package/dist/esm/Action/TypeId.d.ts +8 -0
- package/dist/esm/Action/TypeId.d.ts.map +1 -0
- package/dist/esm/Action/TypeId.js +9 -0
- package/dist/esm/Action/TypeId.js.map +1 -0
- package/dist/esm/Action/UncanonicalIdempotencyKey.d.ts +32 -0
- package/dist/esm/Action/UncanonicalIdempotencyKey.d.ts.map +1 -0
- package/dist/esm/Action/UncanonicalIdempotencyKey.js +31 -0
- package/dist/esm/Action/UncanonicalIdempotencyKey.js.map +1 -0
- package/dist/esm/Action/idempotencyKey.d.ts +21 -0
- package/dist/esm/Action/idempotencyKey.d.ts.map +1 -0
- package/dist/esm/Action/idempotencyKey.js +50 -0
- package/dist/esm/Action/idempotencyKey.js.map +1 -0
- package/dist/esm/Action/index.d.ts +29 -0
- package/dist/esm/Action/index.d.ts.map +1 -0
- package/dist/esm/Action/index.js +30 -0
- package/dist/esm/Action/index.js.map +1 -0
- package/dist/esm/Action/make.d.ts +128 -0
- package/dist/esm/Action/make.d.ts.map +1 -0
- package/dist/esm/Action/make.js +413 -0
- package/dist/esm/Action/make.js.map +1 -0
- package/dist/esm/Action/raceAll.d.ts +21 -0
- package/dist/esm/Action/raceAll.d.ts.map +1 -0
- package/dist/esm/Action/raceAll.js +20 -0
- package/dist/esm/Action/raceAll.js.map +1 -0
- package/dist/esm/Action/retry.d.ts +19 -0
- package/dist/esm/Action/retry.d.ts.map +1 -0
- package/dist/esm/Action/retry.js +72 -0
- package/dist/esm/Action/retry.js.map +1 -0
- package/dist/esm/Deadline.d.ts +110 -0
- package/dist/esm/Deadline.d.ts.map +1 -0
- package/dist/esm/Deadline.js +164 -0
- package/dist/esm/Deadline.js.map +1 -0
- package/dist/esm/DurableClock.d.ts +60 -0
- package/dist/esm/DurableClock.d.ts.map +1 -0
- package/dist/esm/DurableClock.js +122 -0
- package/dist/esm/DurableClock.js.map +1 -0
- package/dist/esm/DurableDeferred.d.ts +311 -0
- package/dist/esm/DurableDeferred.d.ts.map +1 -0
- package/dist/esm/DurableDeferred.js +357 -0
- package/dist/esm/DurableDeferred.js.map +1 -0
- package/dist/esm/DurableQueue.d.ts +160 -0
- package/dist/esm/DurableQueue.d.ts.map +1 -0
- package/dist/esm/DurableQueue.js +303 -0
- package/dist/esm/DurableQueue.js.map +1 -0
- package/dist/esm/ExternalJob.d.ts +179 -0
- package/dist/esm/ExternalJob.d.ts.map +1 -0
- package/dist/esm/ExternalJob.js +296 -0
- package/dist/esm/ExternalJob.js.map +1 -0
- package/dist/esm/Fault.d.ts +131 -0
- package/dist/esm/Fault.d.ts.map +1 -0
- package/dist/esm/Fault.js +198 -0
- package/dist/esm/Fault.js.map +1 -0
- package/dist/esm/Flow/Annotations.d.ts +245 -0
- package/dist/esm/Flow/Annotations.d.ts.map +1 -0
- package/dist/esm/Flow/Annotations.js +110 -0
- package/dist/esm/Flow/Annotations.js.map +1 -0
- package/dist/esm/Flow/CapabilityCeiling.d.ts +21 -0
- package/dist/esm/Flow/CapabilityCeiling.d.ts.map +1 -0
- package/dist/esm/Flow/CapabilityCeiling.js +27 -0
- package/dist/esm/Flow/CapabilityCeiling.js.map +1 -0
- package/dist/esm/Flow/DeadlineExceeded.d.ts +33 -0
- package/dist/esm/Flow/DeadlineExceeded.d.ts.map +1 -0
- package/dist/esm/Flow/DeadlineExceeded.js +34 -0
- package/dist/esm/Flow/DeadlineExceeded.js.map +1 -0
- package/dist/esm/Flow/ExecutionIdRequired.d.ts +25 -0
- package/dist/esm/Flow/ExecutionIdRequired.d.ts.map +1 -0
- package/dist/esm/Flow/ExecutionIdRequired.js +30 -0
- package/dist/esm/Flow/ExecutionIdRequired.js.map +1 -0
- package/dist/esm/Flow/ExecutionIds.d.ts +80 -0
- package/dist/esm/Flow/ExecutionIds.d.ts.map +1 -0
- package/dist/esm/Flow/ExecutionIds.js +91 -0
- package/dist/esm/Flow/ExecutionIds.js.map +1 -0
- package/dist/esm/Flow/Flow.d.ts +422 -0
- package/dist/esm/Flow/Flow.d.ts.map +1 -0
- package/dist/esm/Flow/Flow.js +3 -0
- package/dist/esm/Flow/Flow.js.map +1 -0
- package/dist/esm/Flow/MaxRoundsExceeded.d.ts +35 -0
- package/dist/esm/Flow/MaxRoundsExceeded.d.ts.map +1 -0
- package/dist/esm/Flow/MaxRoundsExceeded.js +34 -0
- package/dist/esm/Flow/MaxRoundsExceeded.js.map +1 -0
- package/dist/esm/Flow/Outcome.d.ts +162 -0
- package/dist/esm/Flow/Outcome.d.ts.map +1 -0
- package/dist/esm/Flow/Outcome.js +115 -0
- package/dist/esm/Flow/Outcome.js.map +1 -0
- package/dist/esm/Flow/Result.d.ts +186 -0
- package/dist/esm/Flow/Result.d.ts.map +1 -0
- package/dist/esm/Flow/Result.js +171 -0
- package/dist/esm/Flow/Result.js.map +1 -0
- package/dist/esm/Flow/Runtime.d.ts +98 -0
- package/dist/esm/Flow/Runtime.d.ts.map +1 -0
- package/dist/esm/Flow/Runtime.js +252 -0
- package/dist/esm/Flow/Runtime.js.map +1 -0
- package/dist/esm/Flow/TypeId.d.ts +8 -0
- package/dist/esm/Flow/TypeId.d.ts.map +1 -0
- package/dist/esm/Flow/TypeId.js +9 -0
- package/dist/esm/Flow/TypeId.js.map +1 -0
- package/dist/esm/Flow/index.d.ts +17 -0
- package/dist/esm/Flow/index.d.ts.map +1 -0
- package/dist/esm/Flow/index.js +18 -0
- package/dist/esm/Flow/index.js.map +1 -0
- package/dist/esm/Flow/internal.d.ts +34 -0
- package/dist/esm/Flow/internal.d.ts.map +1 -0
- package/dist/esm/Flow/internal.js +149 -0
- package/dist/esm/Flow/internal.js.map +1 -0
- package/dist/esm/Flow/make.d.ts +149 -0
- package/dist/esm/Flow/make.d.ts.map +1 -0
- package/dist/esm/Flow/make.js +111 -0
- package/dist/esm/Flow/make.js.map +1 -0
- package/dist/esm/FlowRuntime/CancelRequestFailed.d.ts +55 -0
- package/dist/esm/FlowRuntime/CancelRequestFailed.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/CancelRequestFailed.js +53 -0
- package/dist/esm/FlowRuntime/CancelRequestFailed.js.map +1 -0
- package/dist/esm/FlowRuntime/ExecutionIdentityConflict.d.ts +23 -0
- package/dist/esm/FlowRuntime/ExecutionIdentityConflict.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/ExecutionIdentityConflict.js +24 -0
- package/dist/esm/FlowRuntime/ExecutionIdentityConflict.js.map +1 -0
- package/dist/esm/FlowRuntime/FlowCycleDetected.d.ts +28 -0
- package/dist/esm/FlowRuntime/FlowCycleDetected.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/FlowCycleDetected.js +35 -0
- package/dist/esm/FlowRuntime/FlowCycleDetected.js.map +1 -0
- package/dist/esm/FlowRuntime/FlowExecutionNotFound.d.ts +38 -0
- package/dist/esm/FlowRuntime/FlowExecutionNotFound.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/FlowExecutionNotFound.js +40 -0
- package/dist/esm/FlowRuntime/FlowExecutionNotFound.js.map +1 -0
- package/dist/esm/FlowRuntime/FlowInstance.d.ts +115 -0
- package/dist/esm/FlowRuntime/FlowInstance.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/FlowInstance.js +24 -0
- package/dist/esm/FlowRuntime/FlowInstance.js.map +1 -0
- package/dist/esm/FlowRuntime/FlowRuntime.d.ts +204 -0
- package/dist/esm/FlowRuntime/FlowRuntime.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/FlowRuntime.js +34 -0
- package/dist/esm/FlowRuntime/FlowRuntime.js.map +1 -0
- package/dist/esm/FlowRuntime/NodeRecord.d.ts +177 -0
- package/dist/esm/FlowRuntime/NodeRecord.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/NodeRecord.js +21 -0
- package/dist/esm/FlowRuntime/NodeRecord.js.map +1 -0
- package/dist/esm/FlowRuntime/WaitingAnnotation.d.ts +69 -0
- package/dist/esm/FlowRuntime/WaitingAnnotation.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/WaitingAnnotation.js +53 -0
- package/dist/esm/FlowRuntime/WaitingAnnotation.js.map +1 -0
- package/dist/esm/FlowRuntime/index.d.ts +14 -0
- package/dist/esm/FlowRuntime/index.d.ts.map +1 -0
- package/dist/esm/FlowRuntime/index.js +15 -0
- package/dist/esm/FlowRuntime/index.js.map +1 -0
- package/dist/esm/Graph.d.ts +325 -0
- package/dist/esm/Graph.d.ts.map +1 -0
- package/dist/esm/Graph.js +1485 -0
- package/dist/esm/Graph.js.map +1 -0
- package/dist/esm/HumanTask.d.ts +442 -0
- package/dist/esm/HumanTask.d.ts.map +1 -0
- package/dist/esm/HumanTask.js +810 -0
- package/dist/esm/HumanTask.js.map +1 -0
- package/dist/esm/Interpreter.d.ts +223 -0
- package/dist/esm/Interpreter.d.ts.map +1 -0
- package/dist/esm/Interpreter.js +1301 -0
- package/dist/esm/Interpreter.js.map +1 -0
- package/dist/esm/Poll.d.ts +240 -0
- package/dist/esm/Poll.d.ts.map +1 -0
- package/dist/esm/Poll.js +289 -0
- package/dist/esm/Poll.js.map +1 -0
- package/dist/esm/RetryPolicy.d.ts +273 -0
- package/dist/esm/RetryPolicy.d.ts.map +1 -0
- package/dist/esm/RetryPolicy.js +429 -0
- package/dist/esm/RetryPolicy.js.map +1 -0
- package/dist/esm/Sleep.d.ts +98 -0
- package/dist/esm/Sleep.d.ts.map +1 -0
- package/dist/esm/Sleep.js +256 -0
- package/dist/esm/Sleep.js.map +1 -0
- package/dist/esm/Stall.d.ts +173 -0
- package/dist/esm/Stall.d.ts.map +1 -0
- package/dist/esm/Stall.js +138 -0
- package/dist/esm/Stall.js.map +1 -0
- package/dist/esm/WaitFor.d.ts +109 -0
- package/dist/esm/WaitFor.d.ts.map +1 -0
- package/dist/esm/WaitFor.js +184 -0
- package/dist/esm/WaitFor.js.map +1 -0
- package/dist/esm/index.d.ts +107 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +108 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/BoundedJson.d.ts +48 -0
- package/dist/esm/internal/BoundedJson.d.ts.map +1 -0
- package/dist/esm/internal/BoundedJson.js +107 -0
- package/dist/esm/internal/BoundedJson.js.map +1 -0
- package/dist/esm/internal/DeclarationSite.d.ts +135 -0
- package/dist/esm/internal/DeclarationSite.d.ts.map +1 -0
- package/dist/esm/internal/DeclarationSite.js +196 -0
- package/dist/esm/internal/DeclarationSite.js.map +1 -0
- package/dist/esm/internal/Declarations.d.ts +35 -0
- package/dist/esm/internal/Declarations.d.ts.map +1 -0
- package/dist/esm/internal/Declarations.js +43 -0
- package/dist/esm/internal/Declarations.js.map +1 -0
- package/dist/esm/internal/ExecutionMiddleware.d.ts +21 -0
- package/dist/esm/internal/ExecutionMiddleware.d.ts.map +1 -0
- package/dist/esm/internal/ExecutionMiddleware.js +13 -0
- package/dist/esm/internal/ExecutionMiddleware.js.map +1 -0
- package/dist/esm/internal/JsonSchemaSubset.d.ts +133 -0
- package/dist/esm/internal/JsonSchemaSubset.d.ts.map +1 -0
- package/dist/esm/internal/JsonSchemaSubset.js +363 -0
- package/dist/esm/internal/JsonSchemaSubset.js.map +1 -0
- package/dist/esm/internal/OutcomeMarker.d.ts +18 -0
- package/dist/esm/internal/OutcomeMarker.d.ts.map +1 -0
- package/dist/esm/internal/OutcomeMarker.js +18 -0
- package/dist/esm/internal/OutcomeMarker.js.map +1 -0
- package/docs/README.md +152 -0
- package/docs/api.md +440 -0
- package/docs/concepts/bodies-and-plans.md +167 -0
- package/docs/concepts/execution-identity.md +142 -0
- package/docs/concepts/flows-and-actions.md +129 -0
- package/docs/concepts/suspension-and-replay.md +130 -0
- package/docs/concepts/the-runtime-port.md +110 -0
- package/docs/concepts/trampoline-rounds.md +151 -0
- package/docs/guides/ask-a-person.md +184 -0
- package/docs/guides/build-a-body.md +164 -0
- package/docs/guides/cancel-and-roll-back.md +112 -0
- package/docs/guides/implement-an-action.md +155 -0
- package/docs/guides/inspect-the-plan.md +235 -0
- package/docs/guides/poll-until-ready.md +169 -0
- package/docs/guides/queue-work-to-a-worker.md +122 -0
- package/docs/guides/retry-a-failing-action.md +243 -0
- package/docs/guides/reuse-a-recorded-result.md +129 -0
- package/docs/guides/run-a-child-flow.md +108 -0
- package/docs/guides/run-an-external-job.md +86 -0
- package/docs/guides/use-a-prompt.md +38 -0
- package/docs/guides/wait-for-a-deadline.md +141 -0
- package/docs/guides/wait-for-an-external-signal.md +151 -0
- package/docs/installation.md +87 -0
- package/docs/quickstart.md +164 -0
- package/docs/reference/flow.md +1835 -0
- package/docs/testing.md +157 -0
- package/docs/troubleshooting.md +286 -0
- package/package.json +327 -3
- package/src/Action/Action.ts +333 -0
- package/src/Action/AttemptTimedOut.ts +37 -0
- package/src/Action/BoundaryMode.ts +33 -0
- package/src/Action/CacheEnvironment.ts +170 -0
- package/src/Action/ConcurrentKeylessDispatch.ts +38 -0
- package/src/Action/Context.ts +156 -0
- package/src/Action/DuplicateImplementation.ts +24 -0
- package/src/Action/FileBoundary.ts +77 -0
- package/src/Action/FileInput.ts +42 -0
- package/src/Action/Filegroup.ts +16 -0
- package/src/Action/Glob.ts +8 -0
- package/src/Action/ImplementationVersionMismatch.ts +27 -0
- package/src/Action/Implementations.ts +149 -0
- package/src/Action/InfraInterrupt.ts +30 -0
- package/src/Action/InfraInterruptRetriesExhausted.ts +37 -0
- package/src/Action/IrreversibleRetryRequiresIdempotencyKey.ts +32 -0
- package/src/Action/StepIdentity.ts +219 -0
- package/src/Action/TreeArtifact.ts +8 -0
- package/src/Action/TypeId.ts +9 -0
- package/src/Action/UncanonicalIdempotencyKey.ts +36 -0
- package/src/Action/idempotencyKey.ts +67 -0
- package/src/Action/index.ts +31 -0
- package/src/Action/make.ts +671 -0
- package/src/Action/raceAll.ts +48 -0
- package/src/Action/retry.ts +92 -0
- package/src/Deadline.ts +201 -0
- package/src/DurableClock.ts +176 -0
- package/src/DurableDeferred.ts +753 -0
- package/src/DurableQueue.ts +519 -0
- package/src/ExternalJob.ts +437 -0
- package/src/Fault.ts +279 -0
- package/src/Flow/Annotations.ts +151 -0
- package/src/Flow/CapabilityCeiling.ts +37 -0
- package/src/Flow/DeadlineExceeded.ts +40 -0
- package/src/Flow/ExecutionIdRequired.ts +36 -0
- package/src/Flow/ExecutionIds.ts +133 -0
- package/src/Flow/Flow.ts +576 -0
- package/src/Flow/MaxRoundsExceeded.ts +39 -0
- package/src/Flow/Outcome.ts +179 -0
- package/src/Flow/Result.ts +284 -0
- package/src/Flow/Runtime.ts +339 -0
- package/src/Flow/TypeId.ts +9 -0
- package/src/Flow/index.ts +19 -0
- package/src/Flow/internal.ts +237 -0
- package/src/Flow/make.ts +299 -0
- package/src/FlowRuntime/CancelRequestFailed.ts +56 -0
- package/src/FlowRuntime/ExecutionIdentityConflict.ts +32 -0
- package/src/FlowRuntime/FlowCycleDetected.ts +41 -0
- package/src/FlowRuntime/FlowExecutionNotFound.ts +46 -0
- package/src/FlowRuntime/FlowInstance.ts +128 -0
- package/src/FlowRuntime/FlowRuntime.ts +339 -0
- package/src/FlowRuntime/NodeRecord.ts +185 -0
- package/src/FlowRuntime/WaitingAnnotation.ts +85 -0
- package/src/FlowRuntime/index.ts +17 -0
- package/src/Graph.ts +1865 -0
- package/src/HumanTask.ts +1021 -0
- package/src/Interpreter.ts +1635 -0
- package/src/Poll.ts +420 -0
- package/src/RetryPolicy.ts +550 -0
- package/src/Sleep.ts +296 -0
- package/src/Stall.ts +217 -0
- package/src/WaitFor.ts +228 -0
- package/src/index.ts +125 -0
- package/src/internal/BoundedJson.ts +109 -0
- package/src/internal/DeclarationSite.ts +214 -0
- package/src/internal/Declarations.ts +49 -0
- package/src/internal/ExecutionMiddleware.ts +29 -0
- package/src/internal/JsonSchemaSubset.ts +392 -0
- package/src/internal/OutcomeMarker.ts +19 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stall breaker: end a round loop that has stopped making progress.
|
|
3
|
+
*
|
|
4
|
+
* A round bound is only a budget. A loop whose rounds change nothing spends
|
|
5
|
+
* the whole budget anyway: an agent that rewrites the same tree, a check that
|
|
6
|
+
* fails the same way after every repair, a reviser that hands back the same
|
|
7
|
+
* draft. This module counts consecutive rounds whose signal did not move and
|
|
8
|
+
* reports a {@link Stalled} verdict once one signal has held for
|
|
9
|
+
* `rounds` rounds in a row.
|
|
10
|
+
*
|
|
11
|
+
* Three signals are read, each optional per round:
|
|
12
|
+
*
|
|
13
|
+
* - `tree`: a fingerprint of the files the round left behind, such as a JJ
|
|
14
|
+
* tree id or a `TreeFingerprint` checksum.
|
|
15
|
+
* - `checks`: the ids of the checks that failed. Order does not matter, and
|
|
16
|
+
* an empty list is not compared.
|
|
17
|
+
* - `output`: the round's value, compared by the SHA-256 of its RFC 8785
|
|
18
|
+
* canonical JSON. A value with no canonical form is not compared.
|
|
19
|
+
*
|
|
20
|
+
* Everything here is data. The {@link State} a round carries forward is a
|
|
21
|
+
* plain record, so a durable trampoline keeps it in its payload and a replay
|
|
22
|
+
* reads the same verdict. The loop decides what `on` means: `stop` settles
|
|
23
|
+
* with the stalled value, `park` settles the same way tagged for a caller
|
|
24
|
+
* that hands it to a person (the coding correction reports it `blocked`),
|
|
25
|
+
* and `escalate` fails.
|
|
26
|
+
*
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
*/
|
|
29
|
+
import * as Schema from "effect/Schema";
|
|
30
|
+
/**
|
|
31
|
+
* What a loop does once it has stalled.
|
|
32
|
+
*
|
|
33
|
+
* @category models
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
export declare const On: Schema.Literals<readonly ["stop", "park", "escalate"]>;
|
|
37
|
+
/**
|
|
38
|
+
* The `on` values as a type.
|
|
39
|
+
*
|
|
40
|
+
* @category models
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
*/
|
|
43
|
+
export type On = typeof On.Type;
|
|
44
|
+
/**
|
|
45
|
+
* The signal that held still.
|
|
46
|
+
*
|
|
47
|
+
* @category models
|
|
48
|
+
* @since 1.0.0
|
|
49
|
+
*/
|
|
50
|
+
export declare const Signal: Schema.Literals<readonly ["tree", "checks", "output"]>;
|
|
51
|
+
/**
|
|
52
|
+
* The signal names as a type.
|
|
53
|
+
*
|
|
54
|
+
* @category models
|
|
55
|
+
* @since 1.0.0
|
|
56
|
+
*/
|
|
57
|
+
export type Signal = typeof Signal.Type;
|
|
58
|
+
/**
|
|
59
|
+
* A resolved stall policy: `rounds` identical rounds in a row, at least two,
|
|
60
|
+
* trigger `on`.
|
|
61
|
+
*
|
|
62
|
+
* @category models
|
|
63
|
+
* @since 1.0.0
|
|
64
|
+
*/
|
|
65
|
+
export declare const Policy: Schema.Struct<{
|
|
66
|
+
readonly rounds: Schema.Int;
|
|
67
|
+
readonly on: Schema.Literals<readonly ["stop", "park", "escalate"]>;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* A resolved policy as a type.
|
|
71
|
+
*
|
|
72
|
+
* @category models
|
|
73
|
+
* @since 1.0.0
|
|
74
|
+
*/
|
|
75
|
+
export type Policy = typeof Policy.Type;
|
|
76
|
+
/**
|
|
77
|
+
* The authoring form of a {@link Policy}; `on` defaults to `"stop"`.
|
|
78
|
+
*
|
|
79
|
+
* @category models
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
*/
|
|
82
|
+
export interface Options {
|
|
83
|
+
readonly rounds: number;
|
|
84
|
+
readonly on?: On | undefined;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* What one round reports. An absent signal is not compared and resets its
|
|
88
|
+
* streak.
|
|
89
|
+
*
|
|
90
|
+
* @category models
|
|
91
|
+
* @since 1.0.0
|
|
92
|
+
*/
|
|
93
|
+
export interface Observation {
|
|
94
|
+
readonly tree?: string | undefined;
|
|
95
|
+
readonly checks?: ReadonlyArray<string> | undefined;
|
|
96
|
+
readonly output?: unknown;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The streak of every signal, carried from one round to the next.
|
|
100
|
+
*
|
|
101
|
+
* @category models
|
|
102
|
+
* @since 1.0.0
|
|
103
|
+
*/
|
|
104
|
+
export declare const State: Schema.Struct<{
|
|
105
|
+
readonly tree: Schema.NullOr<Schema.Struct<{
|
|
106
|
+
readonly key: Schema.String;
|
|
107
|
+
readonly rounds: Schema.Int;
|
|
108
|
+
}>>;
|
|
109
|
+
readonly checks: Schema.NullOr<Schema.Struct<{
|
|
110
|
+
readonly key: Schema.String;
|
|
111
|
+
readonly rounds: Schema.Int;
|
|
112
|
+
}>>;
|
|
113
|
+
readonly output: Schema.NullOr<Schema.Struct<{
|
|
114
|
+
readonly key: Schema.String;
|
|
115
|
+
readonly rounds: Schema.Int;
|
|
116
|
+
}>>;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* The carried streaks as a type.
|
|
120
|
+
*
|
|
121
|
+
* @category models
|
|
122
|
+
* @since 1.0.0
|
|
123
|
+
*/
|
|
124
|
+
export type State = typeof State.Type;
|
|
125
|
+
/**
|
|
126
|
+
* The state before the first round.
|
|
127
|
+
*
|
|
128
|
+
* @category constructors
|
|
129
|
+
* @since 1.0.0
|
|
130
|
+
*/
|
|
131
|
+
export declare const initial: State;
|
|
132
|
+
/**
|
|
133
|
+
* The typed verdict: which signal held, for how many rounds, and what the
|
|
134
|
+
* policy says to do.
|
|
135
|
+
*
|
|
136
|
+
* @category models
|
|
137
|
+
* @since 1.0.0
|
|
138
|
+
*/
|
|
139
|
+
export declare const Stalled: Schema.Struct<{
|
|
140
|
+
readonly _tag: Schema.Literal<"Stalled">;
|
|
141
|
+
readonly signal: Schema.Literals<readonly ["tree", "checks", "output"]>;
|
|
142
|
+
readonly rounds: Schema.Int;
|
|
143
|
+
readonly on: Schema.Literals<readonly ["stop", "park", "escalate"]>;
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* The verdict as a type.
|
|
147
|
+
*
|
|
148
|
+
* @category models
|
|
149
|
+
* @since 1.0.0
|
|
150
|
+
*/
|
|
151
|
+
export type Stalled = typeof Stalled.Type;
|
|
152
|
+
/**
|
|
153
|
+
* Validates authoring options into a {@link Policy}. Throws a `RangeError`
|
|
154
|
+
* for fewer than two rounds, since one round cannot repeat anything.
|
|
155
|
+
*
|
|
156
|
+
* @category constructors
|
|
157
|
+
* @since 1.0.0
|
|
158
|
+
*/
|
|
159
|
+
export declare const policy: (options: Options) => Policy;
|
|
160
|
+
/**
|
|
161
|
+
* Folds one round into the state and reports whether the loop has stalled.
|
|
162
|
+
*
|
|
163
|
+
* Signals are judged in the order `tree`, `checks`, `output`; the first that
|
|
164
|
+
* reached `policy.rounds` names the verdict.
|
|
165
|
+
*
|
|
166
|
+
* @category combinators
|
|
167
|
+
* @since 1.0.0
|
|
168
|
+
*/
|
|
169
|
+
export declare const observe: (policy: Policy, state: State, observation: Observation) => {
|
|
170
|
+
readonly state: State;
|
|
171
|
+
readonly stalled: Stalled | undefined;
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=Stall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stall.d.ts","sourceRoot":"","sources":["../../src/Stall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,EAAE,wDAAgD,CAAA;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAA;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,MAAM,wDAAgD,CAAA;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;;;EAGjB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,SAAS,CAAA;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAC1B;AAID;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;EAAkE,CAAA;AAEpF;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAAkD,CAAA;AAExE;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;;;;;EAKlB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,KAAG,MAKzC,CAAA;AAsBD;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAClB,QAAQ,MAAM,EACd,OAAO,KAAK,EACZ,aAAa,WAAW,KACvB;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;CAYhE,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
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 Stall_exports = {};
|
|
30
|
+
__export(Stall_exports, {
|
|
31
|
+
On: () => On,
|
|
32
|
+
Policy: () => Policy,
|
|
33
|
+
Signal: () => Signal,
|
|
34
|
+
Stalled: () => Stalled,
|
|
35
|
+
State: () => State,
|
|
36
|
+
initial: () => initial,
|
|
37
|
+
observe: () => observe,
|
|
38
|
+
policy: () => policy
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(Stall_exports);
|
|
41
|
+
var import_canonical = require("@smthrs/canonical");
|
|
42
|
+
var import_crypto = require("@smthrs/crypto");
|
|
43
|
+
var Schema = __toESM(require("effect/Schema"), 1);
|
|
44
|
+
const On = Schema.Literals(["stop", "park", "escalate"]);
|
|
45
|
+
const Signal = Schema.Literals(["tree", "checks", "output"]);
|
|
46
|
+
const Policy = Schema.Struct({
|
|
47
|
+
rounds: Schema.Int.check(Schema.isGreaterThanOrEqualTo(2)),
|
|
48
|
+
on: On
|
|
49
|
+
});
|
|
50
|
+
const Streak = Schema.NullOr(Schema.Struct({ key: Schema.String, rounds: Schema.Int }));
|
|
51
|
+
const State = Schema.Struct({ tree: Streak, checks: Streak, output: Streak });
|
|
52
|
+
const initial = { tree: null, checks: null, output: null };
|
|
53
|
+
const Stalled = Schema.Struct({
|
|
54
|
+
_tag: Schema.Literal("Stalled"),
|
|
55
|
+
signal: Signal,
|
|
56
|
+
rounds: Schema.Int,
|
|
57
|
+
on: On
|
|
58
|
+
});
|
|
59
|
+
const policy = (options) => {
|
|
60
|
+
if (!Number.isSafeInteger(options.rounds) || options.rounds < 2) {
|
|
61
|
+
throw new RangeError("Stall rounds must be a safe integer of at least 2");
|
|
62
|
+
}
|
|
63
|
+
return { rounds: options.rounds, on: options.on ?? "stop" };
|
|
64
|
+
};
|
|
65
|
+
const hash = (value) => {
|
|
66
|
+
try {
|
|
67
|
+
return (0, import_crypto.digestSync)((0, import_canonical.canonicalize)(value ?? null));
|
|
68
|
+
} catch {
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const keys = (observation) => ({
|
|
73
|
+
tree: observation.tree,
|
|
74
|
+
// No failing check is not a repeated failure.
|
|
75
|
+
checks: observation.checks === void 0 || observation.checks.length === 0 ? void 0 : JSON.stringify([...new Set(observation.checks)].sort()),
|
|
76
|
+
output: "output" in observation ? hash(observation.output) : void 0
|
|
77
|
+
});
|
|
78
|
+
const signals = ["tree", "checks", "output"];
|
|
79
|
+
const observe = (policy2, state, observation) => {
|
|
80
|
+
const current = keys(observation);
|
|
81
|
+
const next = Object.fromEntries(signals.map((signal2) => {
|
|
82
|
+
const key = current[signal2];
|
|
83
|
+
const prior = state[signal2];
|
|
84
|
+
return [signal2, key === void 0 ? null : { key, rounds: prior?.key === key ? prior.rounds + 1 : 1 }];
|
|
85
|
+
}));
|
|
86
|
+
const signal = signals.find((signal2) => (next[signal2]?.rounds ?? 0) >= policy2.rounds);
|
|
87
|
+
return {
|
|
88
|
+
state: next,
|
|
89
|
+
stalled: signal === void 0 ? void 0 : { _tag: "Stalled", signal, rounds: next[signal].rounds, on: policy2.on }
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=Stall.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Stall.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The stall breaker: end a round loop that has stopped making progress.\n *\n * A round bound is only a budget. A loop whose rounds change nothing spends\n * the whole budget anyway: an agent that rewrites the same tree, a check that\n * fails the same way after every repair, a reviser that hands back the same\n * draft. This module counts consecutive rounds whose signal did not move and\n * reports a {@link Stalled} verdict once one signal has held for\n * `rounds` rounds in a row.\n *\n * Three signals are read, each optional per round:\n *\n * - `tree`: a fingerprint of the files the round left behind, such as a JJ\n * tree id or a `TreeFingerprint` checksum.\n * - `checks`: the ids of the checks that failed. Order does not matter, and\n * an empty list is not compared.\n * - `output`: the round's value, compared by the SHA-256 of its RFC 8785\n * canonical JSON. A value with no canonical form is not compared.\n *\n * Everything here is data. The {@link State} a round carries forward is a\n * plain record, so a durable trampoline keeps it in its payload and a replay\n * reads the same verdict. The loop decides what `on` means: `stop` settles\n * with the stalled value, `park` settles the same way tagged for a caller\n * that hands it to a person (the coding correction reports it `blocked`),\n * and `escalate` fails.\n *\n * @since 1.0.0\n */\n\nimport { canonicalize } from \"@smthrs/canonical\"\nimport { digestSync } from \"@smthrs/crypto\"\nimport * as Schema from \"effect/Schema\"\n\n/**\n * What a loop does once it has stalled.\n *\n * @category models\n * @since 1.0.0\n */\nexport const On = Schema.Literals([\"stop\", \"park\", \"escalate\"])\n\n/**\n * The `on` values as a type.\n *\n * @category models\n * @since 1.0.0\n */\nexport type On = typeof On.Type\n\n/**\n * The signal that held still.\n *\n * @category models\n * @since 1.0.0\n */\nexport const Signal = Schema.Literals([\"tree\", \"checks\", \"output\"])\n\n/**\n * The signal names as a type.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Signal = typeof Signal.Type\n\n/**\n * A resolved stall policy: `rounds` identical rounds in a row, at least two,\n * trigger `on`.\n *\n * @category models\n * @since 1.0.0\n */\nexport const Policy = Schema.Struct({\n rounds: Schema.Int.check(Schema.isGreaterThanOrEqualTo(2)),\n on: On\n})\n\n/**\n * A resolved policy as a type.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Policy = typeof Policy.Type\n\n/**\n * The authoring form of a {@link Policy}; `on` defaults to `\"stop\"`.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Options {\n readonly rounds: number\n readonly on?: On | undefined\n}\n\n/**\n * What one round reports. An absent signal is not compared and resets its\n * streak.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Observation {\n readonly tree?: string | undefined\n readonly checks?: ReadonlyArray<string> | undefined\n readonly output?: unknown\n}\n\nconst Streak = Schema.NullOr(Schema.Struct({ key: Schema.String, rounds: Schema.Int }))\n\n/**\n * The streak of every signal, carried from one round to the next.\n *\n * @category models\n * @since 1.0.0\n */\nexport const State = Schema.Struct({ tree: Streak, checks: Streak, output: Streak })\n\n/**\n * The carried streaks as a type.\n *\n * @category models\n * @since 1.0.0\n */\nexport type State = typeof State.Type\n\n/**\n * The state before the first round.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const initial: State = { tree: null, checks: null, output: null }\n\n/**\n * The typed verdict: which signal held, for how many rounds, and what the\n * policy says to do.\n *\n * @category models\n * @since 1.0.0\n */\nexport const Stalled = Schema.Struct({\n _tag: Schema.Literal(\"Stalled\"),\n signal: Signal,\n rounds: Schema.Int,\n on: On\n})\n\n/**\n * The verdict as a type.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Stalled = typeof Stalled.Type\n\n/**\n * Validates authoring options into a {@link Policy}. Throws a `RangeError`\n * for fewer than two rounds, since one round cannot repeat anything.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const policy = (options: Options): Policy => {\n if (!Number.isSafeInteger(options.rounds) || options.rounds < 2) {\n throw new RangeError(\"Stall rounds must be a safe integer of at least 2\")\n }\n return { rounds: options.rounds, on: options.on ?? \"stop\" }\n}\n\n// A value with no canonical form (an `Error`, a `bigint`) is not compared.\nconst hash = (value: unknown): string | undefined => {\n try {\n return digestSync(canonicalize(value ?? null))\n } catch {\n return undefined\n }\n}\n\nconst keys = (observation: Observation): Record<Signal, string | undefined> => ({\n tree: observation.tree,\n // No failing check is not a repeated failure.\n checks: observation.checks === undefined || observation.checks.length === 0\n ? undefined\n : JSON.stringify([...new Set(observation.checks)].sort()),\n output: \"output\" in observation ? hash(observation.output) : undefined\n})\n\nconst signals: ReadonlyArray<Signal> = [\"tree\", \"checks\", \"output\"]\n\n/**\n * Folds one round into the state and reports whether the loop has stalled.\n *\n * Signals are judged in the order `tree`, `checks`, `output`; the first that\n * reached `policy.rounds` names the verdict.\n *\n * @category combinators\n * @since 1.0.0\n */\nexport const observe = (\n policy: Policy,\n state: State,\n observation: Observation\n): { readonly state: State; readonly stalled: Stalled | undefined } => {\n const current = keys(observation)\n const next = Object.fromEntries(signals.map((signal) => {\n const key = current[signal]\n const prior = state[signal]\n return [signal, key === undefined ? null : { key, rounds: prior?.key === key ? prior.rounds + 1 : 1 }]\n })) as unknown as State\n const signal = signals.find((signal) => (next[signal]?.rounds ?? 0) >= policy.rounds)\n return {\n state: next,\n stalled: signal === undefined ? undefined : { _tag: \"Stalled\", signal, rounds: next[signal]!.rounds, on: policy.on }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BA,uBAA6B;AAC7B,oBAA2B;AAC3B,aAAwB;AAQjB,MAAM,KAAK,OAAO,SAAS,CAAC,QAAQ,QAAQ,UAAU,CAAC;AAgBvD,MAAM,SAAS,OAAO,SAAS,CAAC,QAAQ,UAAU,QAAQ,CAAC;AAiB3D,MAAM,SAAS,OAAO,OAAO;AAAA,EAClC,QAAQ,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAAA,EACzD,IAAI;AACN,CAAC;AAkCD,MAAM,SAAS,OAAO,OAAO,OAAO,OAAO,EAAE,KAAK,OAAO,QAAQ,QAAQ,OAAO,IAAI,CAAC,CAAC;AAQ/E,MAAM,QAAQ,OAAO,OAAO,EAAE,MAAM,QAAQ,QAAQ,QAAQ,QAAQ,OAAO,CAAC;AAgB5E,MAAM,UAAiB,EAAE,MAAM,MAAM,QAAQ,MAAM,QAAQ,KAAK;AAShE,MAAM,UAAU,OAAO,OAAO;AAAA,EACnC,MAAM,OAAO,QAAQ,SAAS;AAAA,EAC9B,QAAQ;AAAA,EACR,QAAQ,OAAO;AAAA,EACf,IAAI;AACN,CAAC;AAiBM,MAAM,SAAS,CAAC,YAA6B;AAClD,MAAI,CAAC,OAAO,cAAc,QAAQ,MAAM,KAAK,QAAQ,SAAS,GAAG;AAC/D,UAAM,IAAI,WAAW,mDAAmD;AAAA,EAC1E;AACA,SAAO,EAAE,QAAQ,QAAQ,QAAQ,IAAI,QAAQ,MAAM,OAAO;AAC5D;AAGA,MAAM,OAAO,CAAC,UAAuC;AACnD,MAAI;AACF,eAAO,8BAAW,+BAAa,SAAS,IAAI,CAAC;AAAA,EAC/C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,MAAM,OAAO,CAAC,iBAAkE;AAAA,EAC9E,MAAM,YAAY;AAAA;AAAA,EAElB,QAAQ,YAAY,WAAW,UAAa,YAAY,OAAO,WAAW,IACtE,SACA,KAAK,UAAU,CAAC,GAAG,IAAI,IAAI,YAAY,MAAM,CAAC,EAAE,KAAK,CAAC;AAAA,EAC1D,QAAQ,YAAY,cAAc,KAAK,YAAY,MAAM,IAAI;AAC/D;AAEA,MAAM,UAAiC,CAAC,QAAQ,UAAU,QAAQ;AAW3D,MAAM,UAAU,CACrBA,SACA,OACA,gBACqE;AACrE,QAAM,UAAU,KAAK,WAAW;AAChC,QAAM,OAAO,OAAO,YAAY,QAAQ,IAAI,CAACC,YAAW;AACtD,UAAM,MAAM,QAAQA,OAAM;AAC1B,UAAM,QAAQ,MAAMA,OAAM;AAC1B,WAAO,CAACA,SAAQ,QAAQ,SAAY,OAAO,EAAE,KAAK,QAAQ,OAAO,QAAQ,MAAM,MAAM,SAAS,IAAI,EAAE,CAAC;AAAA,EACvG,CAAC,CAAC;AACF,QAAM,SAAS,QAAQ,KAAK,CAACA,aAAY,KAAKA,OAAM,GAAG,UAAU,MAAMD,QAAO,MAAM;AACpF,SAAO;AAAA,IACL,OAAO;AAAA,IACP,SAAS,WAAW,SAAY,SAAY,EAAE,MAAM,WAAW,QAAQ,QAAQ,KAAK,MAAM,EAAG,QAAQ,IAAIA,QAAO,GAAG;AAAA,EACrH;AACF;",
|
|
6
|
+
"names": ["policy", "signal"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system wait point, as an ordinary declared action.
|
|
3
|
+
*
|
|
4
|
+
* `docs/concepts/flows-and-actions.md` names wait-for-event the
|
|
5
|
+
* other half of the timer gap and says how to close it: ship it over the
|
|
6
|
+
* existing `DurableDeferred`, so an external signal is a visible, keyed plan
|
|
7
|
+
* node. That is this module. {@link action} is a plain `Action.make`
|
|
8
|
+
* declaration — catalogable, `.call()`-able, one node in the built plan — and
|
|
9
|
+
* {@link layer} is the implementation.
|
|
10
|
+
*
|
|
11
|
+
* Nothing about resolution is new. The wait is a `DurableDeferred`, so whoever
|
|
12
|
+
* satisfies it completes it the way every other durable deferred is completed:
|
|
13
|
+
* a token, and `DurableDeferred.succeed`, `fail`, `failCause`, or `done`.
|
|
14
|
+
* {@link deferred} is how a resolver names the same wait point the action
|
|
15
|
+
* awaits. The park is declared through the ordinary waiting vocabulary
|
|
16
|
+
* ({@link module:WaitingAnnotation.annotateWaiting}) under `event`, carrying
|
|
17
|
+
* that token as the compare-and-swap material a wake handler matches. Replay is
|
|
18
|
+
* the deferred's: once a result is recorded, a re-driven round reads it and
|
|
19
|
+
* runs through instead of parking again.
|
|
20
|
+
*
|
|
21
|
+
* @since 0.1.0
|
|
22
|
+
*/
|
|
23
|
+
import type * as Crypto from "effect/Crypto";
|
|
24
|
+
import type * as Layer from "effect/Layer";
|
|
25
|
+
import * as Schema from "effect/Schema";
|
|
26
|
+
import * as Action from "./Action/index.ts";
|
|
27
|
+
import * as DurableDeferred from "./DurableDeferred.ts";
|
|
28
|
+
import type { FlowRuntime } from "./FlowRuntime/FlowRuntime.ts";
|
|
29
|
+
declare const WaitForRequestInvalid_base: Schema.Class<WaitForRequestInvalid, Schema.TaggedStruct<"@smthrs/flow/WaitForRequestInvalid", {
|
|
30
|
+
readonly code: Schema.Literals<readonly ["missing_target", "ambiguous_target", "malformed_token", "foreign_execution"]>;
|
|
31
|
+
readonly message: Schema.String;
|
|
32
|
+
}>, import("effect/Cause").YieldableError>;
|
|
33
|
+
/**
|
|
34
|
+
* A wait whose payload does not name exactly one reachable wait point.
|
|
35
|
+
*
|
|
36
|
+
* A payload names the wait point by `name`, relative to the running execution,
|
|
37
|
+
* or by an absolute `token`. Naming both, or neither, leaves nothing to await;
|
|
38
|
+
* a token that does not parse names nothing either; and a token addressed to a
|
|
39
|
+
* different flow or a different execution names a wait point this execution
|
|
40
|
+
* cannot observe, because a durable deferred result is recorded against the
|
|
41
|
+
* flow and execution that own it.
|
|
42
|
+
*
|
|
43
|
+
* @category errors
|
|
44
|
+
* @since 0.1.0
|
|
45
|
+
*/
|
|
46
|
+
export declare class WaitForRequestInvalid extends WaitForRequestInvalid_base {
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The tag the wait declaration is catalogued and resolved under.
|
|
50
|
+
*
|
|
51
|
+
* @category constructors
|
|
52
|
+
* @since 0.1.0
|
|
53
|
+
*/
|
|
54
|
+
export declare const tag = "system/wait-for";
|
|
55
|
+
/**
|
|
56
|
+
* The durable deferred a named wait point resolves through.
|
|
57
|
+
*
|
|
58
|
+
* This is the resolver's half of {@link action}: the value to hand
|
|
59
|
+
* `DurableDeferred.tokenFromExecutionId` and `DurableDeferred.succeed`, so a
|
|
60
|
+
* wait that a body declared by name is completed through the existing deferred
|
|
61
|
+
* completion path rather than a second one.
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* const gate = WaitFor.deferred("approval")
|
|
65
|
+
* const token = DurableDeferred.tokenFromExecutionId(gate, { flow, executionId })
|
|
66
|
+
* yield* DurableDeferred.succeed(gate, { token, value: { approved: true } })
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @category constructors
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
*/
|
|
72
|
+
export declare const deferred: (name: string) => DurableDeferred.DurableDeferred<typeof Schema.Json>;
|
|
73
|
+
/**
|
|
74
|
+
* The declared wait action: a wait point named by `name` or by `token`.
|
|
75
|
+
*
|
|
76
|
+
* **When to use**
|
|
77
|
+
*
|
|
78
|
+
* Use it in a body wherever a round has to wait for something outside the run —
|
|
79
|
+
* an approval, a webhook, a human — `WaitFor.action.call({ name: "approval"
|
|
80
|
+
* })`. The node settles with whatever value resolved the wait, so downstream
|
|
81
|
+
* steps read it the way they read any other step result.
|
|
82
|
+
*
|
|
83
|
+
* @category constructors
|
|
84
|
+
* @since 0.1.0
|
|
85
|
+
*/
|
|
86
|
+
export declare const action: Action.Declared<typeof tag, Schema.Struct<{
|
|
87
|
+
readonly token: Schema.optional<Schema.String>;
|
|
88
|
+
readonly name: Schema.optional<Schema.String>;
|
|
89
|
+
}>, typeof Schema.Json, typeof WaitForRequestInvalid, never>;
|
|
90
|
+
/**
|
|
91
|
+
* The wait implementation: park under `event` with the wake token, and settle
|
|
92
|
+
* with the value that resolved the wait.
|
|
93
|
+
*
|
|
94
|
+
* Provide it beside the other action implementation layers a body calls, over
|
|
95
|
+
* the {@link module:Implementations.layerImplementations} table they file
|
|
96
|
+
* themselves in:
|
|
97
|
+
*
|
|
98
|
+
* ```ts
|
|
99
|
+
* Layer.mergeAll(WaitFor.layer, Interpreter.layer(Pipeline)).pipe(
|
|
100
|
+
* Layer.provideMerge(Action.layerImplementations)
|
|
101
|
+
* )
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @category layers
|
|
105
|
+
* @since 0.1.0
|
|
106
|
+
*/
|
|
107
|
+
export declare const layer: Layer.Layer<never, never, Crypto.Crypto | FlowRuntime>;
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=WaitFor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitFor.d.ts","sourceRoot":"","sources":["../../src/WaitFor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;;;;;AAG/D;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,SAAQ,0BAW1C;CAAG;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,GAAG,oBAAoB,CAAA;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,eAAe,CAAC,eAAe,CAAC,OAAO,MAAM,CAAC,IAAI,CACvB,CAAA;AAEnE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,QAAQ,CAClC,OAAO,GAAG,EACV,MAAM,CAAC,MAAM,CAAC;IACZ,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;CAC9C,CAAC,EACF,OAAO,MAAM,CAAC,IAAI,EAClB,OAAO,qBAAqB,EAC5B,KAAK,CASL,CAAA;AAkFF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,WAAW,CAWxE,CAAA"}
|
|
@@ -0,0 +1,117 @@
|
|
|
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 = (target2, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target2, 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, target2) => (target2 = 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(target2, "default", { value: mod, enumerable: true }) : target2,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var WaitFor_exports = {};
|
|
30
|
+
__export(WaitFor_exports, {
|
|
31
|
+
WaitForRequestInvalid: () => WaitForRequestInvalid,
|
|
32
|
+
action: () => action,
|
|
33
|
+
deferred: () => deferred,
|
|
34
|
+
layer: () => layer,
|
|
35
|
+
tag: () => tag
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(WaitFor_exports);
|
|
38
|
+
var Effect = __toESM(require("effect/Effect"), 1);
|
|
39
|
+
var Schema = __toESM(require("effect/Schema"), 1);
|
|
40
|
+
var Action = __toESM(require("./Action/index.js"), 1);
|
|
41
|
+
var DurableDeferred = __toESM(require("./DurableDeferred.js"), 1);
|
|
42
|
+
var import_FlowInstance = require("./FlowRuntime/FlowInstance.js");
|
|
43
|
+
var import_WaitingAnnotation = require("./FlowRuntime/WaitingAnnotation.js");
|
|
44
|
+
class WaitForRequestInvalid extends Schema.TaggedError()(
|
|
45
|
+
"@smthrs/flow/WaitForRequestInvalid",
|
|
46
|
+
{
|
|
47
|
+
code: Schema.Literals([
|
|
48
|
+
"missing_target",
|
|
49
|
+
"ambiguous_target",
|
|
50
|
+
"malformed_token",
|
|
51
|
+
"foreign_execution"
|
|
52
|
+
]),
|
|
53
|
+
message: Schema.String
|
|
54
|
+
}
|
|
55
|
+
) {
|
|
56
|
+
}
|
|
57
|
+
const tag = "system/wait-for";
|
|
58
|
+
const deferred = (name) => DurableDeferred.make(`WaitFor/${name}`, { success: Schema.Json });
|
|
59
|
+
const action = Action.makeSystem(tag, {
|
|
60
|
+
payload: {
|
|
61
|
+
token: Schema.optional(Schema.String),
|
|
62
|
+
name: Schema.optional(Schema.String)
|
|
63
|
+
},
|
|
64
|
+
success: Schema.Json,
|
|
65
|
+
error: WaitForRequestInvalid,
|
|
66
|
+
tier: "sealed"
|
|
67
|
+
});
|
|
68
|
+
const parseToken = (token) => Effect.mapError(
|
|
69
|
+
DurableDeferred.TokenParsed.parse(token),
|
|
70
|
+
(error) => new WaitForRequestInvalid({
|
|
71
|
+
code: "malformed_token",
|
|
72
|
+
message: `${tag} was called with a token that is not a durable deferred token. ${error.message}`
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
const target = (payload, flowName, executionId) => {
|
|
76
|
+
if (payload.token !== void 0 && payload.name !== void 0) {
|
|
77
|
+
return Effect.fail(
|
|
78
|
+
new WaitForRequestInvalid({
|
|
79
|
+
code: "ambiguous_target",
|
|
80
|
+
message: `${tag} was called with both "token" and "name". A wait names one wait point: a name relative to this execution, or an absolute token.`
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (payload.name !== void 0) return Effect.succeed(deferred(payload.name));
|
|
85
|
+
if (payload.token !== void 0) {
|
|
86
|
+
return Effect.flatMap(
|
|
87
|
+
parseToken(payload.token),
|
|
88
|
+
(parsed) => parsed.flowName !== flowName || parsed.executionId !== executionId ? Effect.fail(
|
|
89
|
+
new WaitForRequestInvalid({
|
|
90
|
+
code: "foreign_execution",
|
|
91
|
+
message: `${tag} was called with a token addressed to flow "${parsed.flowName}" in execution "${parsed.executionId}", but it is running as flow "${flowName}" in execution "${executionId}". A durable deferred result is recorded against the execution that owns it, so only that execution can await it.`
|
|
92
|
+
})
|
|
93
|
+
) : Effect.succeed(
|
|
94
|
+
DurableDeferred.make(parsed.deferredName, { success: Schema.Json })
|
|
95
|
+
)
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return Effect.fail(
|
|
99
|
+
new WaitForRequestInvalid({
|
|
100
|
+
code: "missing_target",
|
|
101
|
+
message: `${tag} was called with neither "token" nor "name", so there is no wait point to await.`
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
const layer = action.toLayer(
|
|
106
|
+
(payload) => Effect.gen(function* () {
|
|
107
|
+
const instance = yield* import_FlowInstance.FlowInstance;
|
|
108
|
+
const waitPoint = yield* target(payload, instance.flow._tag, instance.executionId);
|
|
109
|
+
const token = DurableDeferred.tokenFromExecutionId(waitPoint, {
|
|
110
|
+
flow: instance.flow,
|
|
111
|
+
executionId: instance.executionId
|
|
112
|
+
});
|
|
113
|
+
yield* (0, import_WaitingAnnotation.annotateWaiting)({ reason: "event", token });
|
|
114
|
+
return yield* DurableDeferred.await(waitPoint);
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
//# sourceMappingURL=WaitFor.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/WaitFor.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The system wait point, as an ordinary declared action.\n *\n * `docs/concepts/flows-and-actions.md` names wait-for-event the\n * other half of the timer gap and says how to close it: ship it over the\n * existing `DurableDeferred`, so an external signal is a visible, keyed plan\n * node. That is this module. {@link action} is a plain `Action.make`\n * declaration \u2014 catalogable, `.call()`-able, one node in the built plan \u2014 and\n * {@link layer} is the implementation.\n *\n * Nothing about resolution is new. The wait is a `DurableDeferred`, so whoever\n * satisfies it completes it the way every other durable deferred is completed:\n * a token, and `DurableDeferred.succeed`, `fail`, `failCause`, or `done`.\n * {@link deferred} is how a resolver names the same wait point the action\n * awaits. The park is declared through the ordinary waiting vocabulary\n * ({@link module:WaitingAnnotation.annotateWaiting}) under `event`, carrying\n * that token as the compare-and-swap material a wake handler matches. Replay is\n * the deferred's: once a result is recorded, a re-driven round reads it and\n * runs through instead of parking again.\n *\n * @since 0.1.0\n */\n\nimport type * as Crypto from \"effect/Crypto\"\nimport * as Effect from \"effect/Effect\"\nimport type * as Layer from \"effect/Layer\"\nimport * as Schema from \"effect/Schema\"\nimport * as Action from \"./Action/index.ts\"\nimport * as DurableDeferred from \"./DurableDeferred.ts\"\nimport { FlowInstance } from \"./FlowRuntime/FlowInstance.ts\"\nimport type { FlowRuntime } from \"./FlowRuntime/FlowRuntime.ts\"\nimport { annotateWaiting } from \"./FlowRuntime/WaitingAnnotation.ts\"\n\n/**\n * A wait whose payload does not name exactly one reachable wait point.\n *\n * A payload names the wait point by `name`, relative to the running execution,\n * or by an absolute `token`. Naming both, or neither, leaves nothing to await;\n * a token that does not parse names nothing either; and a token addressed to a\n * different flow or a different execution names a wait point this execution\n * cannot observe, because a durable deferred result is recorded against the\n * flow and execution that own it.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class WaitForRequestInvalid extends Schema.TaggedError<WaitForRequestInvalid>()(\n \"@smthrs/flow/WaitForRequestInvalid\",\n {\n code: Schema.Literals([\n \"missing_target\",\n \"ambiguous_target\",\n \"malformed_token\",\n \"foreign_execution\"\n ]),\n message: Schema.String\n }\n) {}\n\n/**\n * The tag the wait declaration is catalogued and resolved under.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const tag = \"system/wait-for\"\n\n/**\n * The durable deferred a named wait point resolves through.\n *\n * This is the resolver's half of {@link action}: the value to hand\n * `DurableDeferred.tokenFromExecutionId` and `DurableDeferred.succeed`, so a\n * wait that a body declared by name is completed through the existing deferred\n * completion path rather than a second one.\n *\n * ```ts\n * const gate = WaitFor.deferred(\"approval\")\n * const token = DurableDeferred.tokenFromExecutionId(gate, { flow, executionId })\n * yield* DurableDeferred.succeed(gate, { token, value: { approved: true } })\n * ```\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const deferred = (name: string): DurableDeferred.DurableDeferred<typeof Schema.Json> =>\n DurableDeferred.make(`WaitFor/${name}`, { success: Schema.Json })\n\n/**\n * The declared wait action: a wait point named by `name` or by `token`.\n *\n * **When to use**\n *\n * Use it in a body wherever a round has to wait for something outside the run \u2014\n * an approval, a webhook, a human \u2014 `WaitFor.action.call({ name: \"approval\"\n * })`. The node settles with whatever value resolved the wait, so downstream\n * steps read it the way they read any other step result.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const action: Action.Declared<\n typeof tag,\n Schema.Struct<{\n readonly token: Schema.optional<Schema.String>\n readonly name: Schema.optional<Schema.String>\n }>,\n typeof Schema.Json,\n typeof WaitForRequestInvalid,\n never\n> = Action.makeSystem(tag, {\n payload: {\n token: Schema.optional(Schema.String),\n name: Schema.optional(Schema.String)\n },\n success: Schema.Json,\n error: WaitForRequestInvalid,\n tier: \"sealed\"\n})\n\n/**\n * The deferred name a token addresses, refused when the token does not parse.\n *\n * @private\n */\nconst parseToken = (token: string): Effect.Effect<DurableDeferred.TokenParsed, WaitForRequestInvalid> =>\n Effect.mapError(\n DurableDeferred.TokenParsed.parse(token),\n (error) =>\n new WaitForRequestInvalid({\n code: \"malformed_token\",\n message: `${tag} was called with a token that is not a durable deferred token. ${error.message}`\n })\n )\n\n/**\n * The wait point a payload names, resolved against the running execution.\n *\n * DECIDED: a payload names EXACTLY one of `name`\n * and `token`, and a token must address the execution that is waiting. A\n * deferred result is recorded against (flow name, execution id, deferred name)\n * and read back the same way, so awaiting a foreign token would park forever\n * while the value it names was recorded elsewhere; refusing it names the\n * mistake instead. BOTH halves of the owning execution's identity are compared:\n * a token carries its own flow name, so a same-execution token minted for\n * another flow completes under that flow while this one reads under its own,\n * which is the same permanent park by a different route.\n *\n * DECIDED: a wait point is addressed by the\n * PAYLOAD, and the per-dispatch identity {@link module:Sleep} derives its clock\n * from is deliberately NOT applied here. A wait is a rendezvous with something\n * outside the run, and a resolver has to name the same wait point to complete\n * it, so the name is the author's and two calls naming one wait point await one\n * fact \u2014 which is the intended reading, not an aliasing bug. A sleep has no\n * counterpart to agree with, which is why it takes its identity from the node.\n *\n * @private\n */\nconst target = (\n payload: { readonly token?: string | undefined; readonly name?: string | undefined },\n flowName: string,\n executionId: string\n): Effect.Effect<DurableDeferred.DurableDeferred<typeof Schema.Json>, WaitForRequestInvalid> => {\n if (payload.token !== undefined && payload.name !== undefined) {\n return Effect.fail(\n new WaitForRequestInvalid({\n code: \"ambiguous_target\",\n message: `${tag} was called with both \"token\" and \"name\". A wait names one wait point: ` +\n \"a name relative to this execution, or an absolute token.\"\n })\n )\n }\n if (payload.name !== undefined) return Effect.succeed(deferred(payload.name))\n if (payload.token !== undefined) {\n return Effect.flatMap(\n parseToken(payload.token),\n (parsed) =>\n parsed.flowName !== flowName || parsed.executionId !== executionId\n ? Effect.fail(\n new WaitForRequestInvalid({\n code: \"foreign_execution\",\n message: `${tag} was called with a token addressed to flow \"${parsed.flowName}\" in execution ` +\n `\"${parsed.executionId}\", but it is running as flow \"${flowName}\" in execution ` +\n `\"${executionId}\". A durable deferred result is recorded against the execution that owns it, ` +\n \"so only that execution can await it.\"\n })\n )\n : Effect.succeed(\n DurableDeferred.make(parsed.deferredName, { success: Schema.Json })\n )\n )\n }\n return Effect.fail(\n new WaitForRequestInvalid({\n code: \"missing_target\",\n message: `${tag} was called with neither \"token\" nor \"name\", so there is no wait point to await.`\n })\n )\n}\n\n/**\n * The wait implementation: park under `event` with the wake token, and settle\n * with the value that resolved the wait.\n *\n * Provide it beside the other action implementation layers a body calls, over\n * the {@link module:Implementations.layerImplementations} table they file\n * themselves in:\n *\n * ```ts\n * Layer.mergeAll(WaitFor.layer, Interpreter.layer(Pipeline)).pipe(\n * Layer.provideMerge(Action.layerImplementations)\n * )\n * ```\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layer: Layer.Layer<never, never, Crypto.Crypto | FlowRuntime> = action.toLayer((payload) =>\n Effect.gen(function*() {\n const instance = yield* FlowInstance\n const waitPoint = yield* target(payload, instance.flow._tag, instance.executionId)\n const token = DurableDeferred.tokenFromExecutionId(waitPoint, {\n flow: instance.flow,\n executionId: instance.executionId\n })\n yield* annotateWaiting({ reason: \"event\", token })\n return yield* DurableDeferred.await(waitPoint)\n })\n)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,aAAwB;AAExB,aAAwB;AACxB,aAAwB;AACxB,sBAAiC;AACjC,0BAA6B;AAE7B,+BAAgC;AAezB,MAAM,8BAA8B,OAAO,YAAmC;AAAA,EACnF;AAAA,EACA;AAAA,IACE,MAAM,OAAO,SAAS;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EAClB;AACF,EAAE;AAAC;AAQI,MAAM,MAAM;AAmBZ,MAAM,WAAW,CAAC,SACvB,gBAAgB,KAAK,WAAW,IAAI,IAAI,EAAE,SAAS,OAAO,KAAK,CAAC;AAe3D,MAAM,SAST,OAAO,WAAW,KAAK;AAAA,EACzB,SAAS;AAAA,IACP,OAAO,OAAO,SAAS,OAAO,MAAM;AAAA,IACpC,MAAM,OAAO,SAAS,OAAO,MAAM;AAAA,EACrC;AAAA,EACA,SAAS,OAAO;AAAA,EAChB,OAAO;AAAA,EACP,MAAM;AACR,CAAC;AAOD,MAAM,aAAa,CAAC,UAClB,OAAO;AAAA,EACL,gBAAgB,YAAY,MAAM,KAAK;AAAA,EACvC,CAAC,UACC,IAAI,sBAAsB;AAAA,IACxB,MAAM;AAAA,IACN,SAAS,GAAG,GAAG,kEAAkE,MAAM,OAAO;AAAA,EAChG,CAAC;AACL;AAyBF,MAAM,SAAS,CACb,SACA,UACA,gBAC8F;AAC9F,MAAI,QAAQ,UAAU,UAAa,QAAQ,SAAS,QAAW;AAC7D,WAAO,OAAO;AAAA,MACZ,IAAI,sBAAsB;AAAA,QACxB,MAAM;AAAA,QACN,SAAS,GAAG,GAAG;AAAA,MAEjB,CAAC;AAAA,IACH;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,OAAW,QAAO,OAAO,QAAQ,SAAS,QAAQ,IAAI,CAAC;AAC5E,MAAI,QAAQ,UAAU,QAAW;AAC/B,WAAO,OAAO;AAAA,MACZ,WAAW,QAAQ,KAAK;AAAA,MACxB,CAAC,WACC,OAAO,aAAa,YAAY,OAAO,gBAAgB,cACnD,OAAO;AAAA,QACP,IAAI,sBAAsB;AAAA,UACxB,MAAM;AAAA,UACN,SAAS,GAAG,GAAG,+CAA+C,OAAO,QAAQ,mBACvE,OAAO,WAAW,iCAAiC,QAAQ,mBAC3D,WAAW;AAAA,QAEnB,CAAC;AAAA,MACH,IACE,OAAO;AAAA,QACP,gBAAgB,KAAK,OAAO,cAAc,EAAE,SAAS,OAAO,KAAK,CAAC;AAAA,MACpE;AAAA,IACN;AAAA,EACF;AACA,SAAO,OAAO;AAAA,IACZ,IAAI,sBAAsB;AAAA,MACxB,MAAM;AAAA,MACN,SAAS,GAAG,GAAG;AAAA,IACjB,CAAC;AAAA,EACH;AACF;AAmBO,MAAM,QAAgE,OAAO;AAAA,EAAQ,CAAC,YAC3F,OAAO,IAAI,aAAY;AACrB,UAAM,WAAW,OAAO;AACxB,UAAM,YAAY,OAAO,OAAO,SAAS,SAAS,KAAK,MAAM,SAAS,WAAW;AACjF,UAAM,QAAQ,gBAAgB,qBAAqB,WAAW;AAAA,MAC5D,MAAM,SAAS;AAAA,MACf,aAAa,SAAS;AAAA,IACxB,CAAC;AACD,eAAO,0CAAgB,EAAE,QAAQ,SAAS,MAAM,CAAC;AACjD,WAAO,OAAO,gBAAgB,MAAM,SAAS;AAAA,EAC/C,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 0.1.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Durable action definitions and combinators.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
export * as Action from "./Action/index.ts";
|
|
10
|
+
/**
|
|
11
|
+
* Durable clock and timer services.
|
|
12
|
+
*
|
|
13
|
+
* @since 0.1.0
|
|
14
|
+
*/
|
|
15
|
+
export * as Deadline from "./Deadline.ts";
|
|
16
|
+
export * as DurableClock from "./DurableClock.ts";
|
|
17
|
+
/**
|
|
18
|
+
* Durable deferred values.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
*/
|
|
22
|
+
export * as DurableDeferred from "./DurableDeferred.ts";
|
|
23
|
+
/**
|
|
24
|
+
* Durable queues.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
*/
|
|
28
|
+
export * as DurableQueue from "./DurableQueue.ts";
|
|
29
|
+
/**
|
|
30
|
+
* Durable flow definitions.
|
|
31
|
+
*
|
|
32
|
+
* @since 0.1.0
|
|
33
|
+
*/
|
|
34
|
+
export * as Flow from "./Flow/index.ts";
|
|
35
|
+
/**
|
|
36
|
+
* The execution contract flow authoring APIs are written against.
|
|
37
|
+
*
|
|
38
|
+
* @since 0.1.0
|
|
39
|
+
*/
|
|
40
|
+
export * as FlowRuntime from "./FlowRuntime/index.ts";
|
|
41
|
+
/**
|
|
42
|
+
* One typed fault for every failure, and the response table that reads it.
|
|
43
|
+
*
|
|
44
|
+
* @since 1.0.0
|
|
45
|
+
*/
|
|
46
|
+
export * as Fault from "./Fault.ts";
|
|
47
|
+
/**
|
|
48
|
+
* External workers observed through durable actions and timers.
|
|
49
|
+
*
|
|
50
|
+
* @since 1.0.0
|
|
51
|
+
*/
|
|
52
|
+
export * as ExternalJob from "./ExternalJob.ts";
|
|
53
|
+
/**
|
|
54
|
+
* Plan-time graph building from flow declarations.
|
|
55
|
+
*
|
|
56
|
+
* @since 0.1.0
|
|
57
|
+
*/
|
|
58
|
+
export * as Graph from "./Graph.ts";
|
|
59
|
+
/**
|
|
60
|
+
* Asking a person something: typed answers, re-asking, and a deadline.
|
|
61
|
+
*
|
|
62
|
+
* @since 0.1.0
|
|
63
|
+
*/
|
|
64
|
+
export * as HumanTask from "./HumanTask.ts";
|
|
65
|
+
/**
|
|
66
|
+
* Execution of a flow body, and the layer that registers it.
|
|
67
|
+
*
|
|
68
|
+
* @since 0.1.0
|
|
69
|
+
*/
|
|
70
|
+
export * as Interpreter from "./Interpreter.ts";
|
|
71
|
+
/**
|
|
72
|
+
* The durable poller: attempts as rounds, waits as durable timers.
|
|
73
|
+
*
|
|
74
|
+
* @since 0.1.0
|
|
75
|
+
*/
|
|
76
|
+
export * as Poll from "./Poll.ts";
|
|
77
|
+
/**
|
|
78
|
+
* The stall breaker: rounds whose tree, failing checks, or output held still.
|
|
79
|
+
*
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
*/
|
|
82
|
+
export * as Stall from "./Stall.ts";
|
|
83
|
+
/**
|
|
84
|
+
* Retry policy models and constructors.
|
|
85
|
+
*
|
|
86
|
+
* @since 0.1.0
|
|
87
|
+
*/
|
|
88
|
+
export * as RetryPolicy from "./RetryPolicy.ts";
|
|
89
|
+
/**
|
|
90
|
+
* The system timer action and its implementation layer.
|
|
91
|
+
*
|
|
92
|
+
* @since 0.1.0
|
|
93
|
+
*/
|
|
94
|
+
export * as Sleep from "./Sleep.ts";
|
|
95
|
+
/**
|
|
96
|
+
* Stable step identity construction.
|
|
97
|
+
*
|
|
98
|
+
* @since 0.1.0
|
|
99
|
+
*/
|
|
100
|
+
export * as StepIdentity from "./Action/StepIdentity.ts";
|
|
101
|
+
/**
|
|
102
|
+
* The system wait-point action and its implementation layer.
|
|
103
|
+
*
|
|
104
|
+
* @since 0.1.0
|
|
105
|
+
*/
|
|
106
|
+
export * as WaitFor from "./WaitFor.ts";
|
|
107
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAE3C;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;GAIG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;;;GAIG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AAEvC;;;;GAIG;AACH,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAA;AAErD;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC;;;;GAIG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC;;;;GAIG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;;GAIG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC;;;;GAIG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC;;;;GAIG;AACH,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAA;AAExD;;;;GAIG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
|