@smthrs/flow 0.0.0-stage → 1.0.0-rc.12
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 +135 -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 +413 -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 +908 -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 +135 -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 +798 -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 +1289 -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 +285 -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 +1007 -0
- package/src/Interpreter.ts +1620 -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,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lowering every declaration in this package shares: literal
|
|
3
|
+
* `capabilities`, `effects` and `modelInvocable` become entries in the
|
|
4
|
+
* annotation bag readers already consult.
|
|
5
|
+
*
|
|
6
|
+
* Both literals exist so a CATALOG can project them from source text without
|
|
7
|
+
* importing the module, so this is the only place either spelling is turned
|
|
8
|
+
* into a value. A flow or an action that declares `capabilities` and one that
|
|
9
|
+
* annotates {@link module:Flow/Annotations.Capabilities} are the same
|
|
10
|
+
* declaration to {@link module:Graph.build}, and the same holds for `effects`
|
|
11
|
+
* and {@link module:Flow/Annotations.EffectEnvelope}.
|
|
12
|
+
*
|
|
13
|
+
* It lives here, below both constructors, because a flow and an action lower
|
|
14
|
+
* the same two literals and a second copy would let one gain a field the other
|
|
15
|
+
* kept ignoring.
|
|
16
|
+
*
|
|
17
|
+
* @since 0.1.0
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import * as Effects from "@smthrs/plan/Effects"
|
|
22
|
+
import * as Context from "effect/Context"
|
|
23
|
+
import { Capabilities, EffectEnvelope, ModelInvocable } from "../Flow/Annotations.ts"
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Lowers the literal declarations a constructor call carries into the
|
|
27
|
+
* annotation bag, leaving every annotation the caller already supplied.
|
|
28
|
+
*
|
|
29
|
+
* @since 0.1.0
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
export const lowerDeclarations = (options: {
|
|
33
|
+
readonly capabilities?: ReadonlyArray<string> | undefined
|
|
34
|
+
readonly effects?: Effects.MakeOptions | undefined
|
|
35
|
+
readonly modelInvocable?: boolean | undefined
|
|
36
|
+
readonly annotations?: Context.Context<never> | undefined
|
|
37
|
+
}): Context.Context<never> => {
|
|
38
|
+
let annotations = options.annotations ?? Context.empty()
|
|
39
|
+
if (options.capabilities !== undefined) {
|
|
40
|
+
annotations = Context.add(annotations, Capabilities, options.capabilities)
|
|
41
|
+
}
|
|
42
|
+
if (options.effects !== undefined) {
|
|
43
|
+
annotations = Context.add(annotations, EffectEnvelope, Effects.make(options.effects))
|
|
44
|
+
}
|
|
45
|
+
if (options.modelInvocable !== undefined) {
|
|
46
|
+
annotations = Context.add(annotations, ModelInvocable, options.modelInvocable)
|
|
47
|
+
}
|
|
48
|
+
return annotations
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal interpreter seam for authoring combinators that retain execution
|
|
3
|
+
* scope state around the ordinary body. No graph or runtime decision lives here.
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as Context from "effect/Context"
|
|
9
|
+
import type * as Effect from "effect/Effect"
|
|
10
|
+
|
|
11
|
+
/** Internal execution wrapper.
|
|
12
|
+
* @private
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
*/
|
|
15
|
+
export interface ExecutionMiddleware {
|
|
16
|
+
readonly wrap: (
|
|
17
|
+
payload: unknown,
|
|
18
|
+
body: Effect.Effect<unknown, unknown, unknown>
|
|
19
|
+
) => Effect.Effect<unknown, unknown, unknown>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Flow-owned wrapper retained across interpreter registrations.
|
|
23
|
+
* @private
|
|
24
|
+
* @since 1.0.0
|
|
25
|
+
*/
|
|
26
|
+
export const ExecutionMiddleware = Context.Reference<ExecutionMiddleware | undefined>(
|
|
27
|
+
"@smthrs/flow/internal/ExecutionMiddleware",
|
|
28
|
+
{ defaultValue: () => undefined }
|
|
29
|
+
)
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded JSON Schema subset a human-task answer is checked against.
|
|
3
|
+
*
|
|
4
|
+
* `HumanTask` asks a person for a value and refuses one that does not fit the
|
|
5
|
+
* question. The fit for a `json` question is decided here: a schema is kept
|
|
6
|
+
* inside a deliberately small subset, an answer is checked against it under
|
|
7
|
+
* the same size bounds every human-task value is admitted under, and every
|
|
8
|
+
* rejection is rendered within one diagnostic budget. `HumanTask` re-exports
|
|
9
|
+
* the limits and the two public entry points; this file is the mechanism.
|
|
10
|
+
*
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import * as BoundedJson from "./BoundedJson.ts"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The deepest supported JSON Schema path, counting the root as depth zero.
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
* @since 1.0.0
|
|
21
|
+
*/
|
|
22
|
+
export const maxSchemaDepth = 32
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The most schema objects one human-task request may contain.
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
*/
|
|
30
|
+
export const maxSchemaNodes = 512
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The most JSON values embedded across schema keywords such as `enum`.
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
*/
|
|
38
|
+
export const maxSchemaValueNodes = 10_000
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The deepest JSON value embedded in a schema, including enum members.
|
|
42
|
+
*
|
|
43
|
+
* @private
|
|
44
|
+
* @since 1.0.0
|
|
45
|
+
*/
|
|
46
|
+
export const maxSchemaValueDepth = 64
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The most JSON values one answer validation may visit.
|
|
50
|
+
*
|
|
51
|
+
* @private
|
|
52
|
+
* @since 1.0.0
|
|
53
|
+
*/
|
|
54
|
+
export const maxAnswerNodes = 10_000
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The largest encoded JSON answer that can enter the durable store.
|
|
58
|
+
*
|
|
59
|
+
* @private
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
*/
|
|
62
|
+
export const maxAnswerBytes = 256 * 1024
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The largest encoded JSON Schema carried by one question.
|
|
66
|
+
*
|
|
67
|
+
* @private
|
|
68
|
+
* @since 1.0.0
|
|
69
|
+
*/
|
|
70
|
+
export const maxSchemaBytes = 256 * 1024
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The deepest admitted answer tree.
|
|
74
|
+
*
|
|
75
|
+
* @private
|
|
76
|
+
* @since 1.0.0
|
|
77
|
+
*/
|
|
78
|
+
export const maxAnswerDepth = 64
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The largest encoded string value admitted in a request or answer.
|
|
82
|
+
*
|
|
83
|
+
* @private
|
|
84
|
+
* @since 1.0.0
|
|
85
|
+
*/
|
|
86
|
+
export const maxJsonStringBytes = 128 * 1024
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The largest encoded object key admitted in a request or answer.
|
|
90
|
+
*
|
|
91
|
+
* @private
|
|
92
|
+
* @since 1.0.0
|
|
93
|
+
*/
|
|
94
|
+
export const maxJsonKeyBytes = 4 * 1024
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The most members admitted in one JSON array or object.
|
|
98
|
+
*
|
|
99
|
+
* @private
|
|
100
|
+
* @since 1.0.0
|
|
101
|
+
*/
|
|
102
|
+
export const maxJsonMembers = 10_000
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The most caller-supplied characters retained in one rendered diagnostic.
|
|
106
|
+
*
|
|
107
|
+
* @private
|
|
108
|
+
* @since 1.0.0
|
|
109
|
+
*/
|
|
110
|
+
export const maxDiagnosticChars = 512
|
|
111
|
+
|
|
112
|
+
/** The JSON Schema types the bounded subset understands. */
|
|
113
|
+
const supportedTypes = new Set(["object", "array", "string", "number", "integer", "boolean", "null"])
|
|
114
|
+
|
|
115
|
+
/** The JSON Schema keywords the bounded subset understands. */
|
|
116
|
+
const supportedKeywords = [
|
|
117
|
+
"type",
|
|
118
|
+
"enum",
|
|
119
|
+
"properties",
|
|
120
|
+
"required",
|
|
121
|
+
"items",
|
|
122
|
+
"nullable",
|
|
123
|
+
"description",
|
|
124
|
+
"title"
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
/** Truncates a caller-supplied diagnostic while stating exactly what was dropped.
|
|
128
|
+
* @private
|
|
129
|
+
* @since 1.0.0
|
|
130
|
+
*/
|
|
131
|
+
export const truncateDiagnostic = (rendered: string): string => {
|
|
132
|
+
const prefix = BoundedJson.scalarPrefix(rendered, maxDiagnosticChars)
|
|
133
|
+
return prefix.length === rendered.length
|
|
134
|
+
? prefix
|
|
135
|
+
: `${prefix} [${rendered.length - prefix.length} characters dropped]`
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Renders one JSON value for a bounded rejection message.
|
|
139
|
+
* @private
|
|
140
|
+
* @since 1.0.0
|
|
141
|
+
*/
|
|
142
|
+
export const renderDiagnostic = (value: unknown): string => BoundedJson.render(value, maxDiagnosticChars)
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Renders a value list in its comma-separated diagnostic shape.
|
|
146
|
+
*
|
|
147
|
+
* Every member renders to at least one character, so members past the
|
|
148
|
+
* diagnostic budget can never survive truncation and are not rendered at all.
|
|
149
|
+
*/
|
|
150
|
+
const renderDiagnosticList = (values: ReadonlyArray<unknown>): string =>
|
|
151
|
+
truncateDiagnostic(
|
|
152
|
+
values.slice(0, maxDiagnosticChars).map((value) => BoundedJson.render(value, maxDiagnosticChars)).join(", ")
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
/** Renders a JSON pointer-ish path for a rejection message. */
|
|
156
|
+
const at = (path: ReadonlyArray<string>): string =>
|
|
157
|
+
path.length === 0 ? "the answer" : `"${truncateDiagnostic(path.join("."))}"`
|
|
158
|
+
|
|
159
|
+
/** Whether a value is a plain JSON object rather than an array or a null. */
|
|
160
|
+
const isObject = (value: unknown): value is Record<string, unknown> =>
|
|
161
|
+
typeof value === "object" && value !== null && !Array.isArray(value)
|
|
162
|
+
|
|
163
|
+
/** Compares two JSON values structurally without depending on object key order. */
|
|
164
|
+
const jsonEquals = (left: unknown, right: unknown): boolean => {
|
|
165
|
+
const pending: Array<readonly [unknown, unknown]> = [[left, right]]
|
|
166
|
+
while (pending.length > 0) {
|
|
167
|
+
const [a, b] = pending.pop()!
|
|
168
|
+
if (a === b) continue
|
|
169
|
+
if (Array.isArray(a)) {
|
|
170
|
+
if (!Array.isArray(b) || a.length !== b.length) return false
|
|
171
|
+
for (let index = a.length - 1; index >= 0; index--) pending.push([a[index], b[index]])
|
|
172
|
+
continue
|
|
173
|
+
}
|
|
174
|
+
if (!isObject(a) || !isObject(b)) return false
|
|
175
|
+
const aKeys = Object.keys(a).sort()
|
|
176
|
+
const bKeys = Object.keys(b).sort()
|
|
177
|
+
if (aKeys.length !== bKeys.length) return false
|
|
178
|
+
for (let index = aKeys.length - 1; index >= 0; index--) {
|
|
179
|
+
const aKey = aKeys[index]!
|
|
180
|
+
const bKey = bKeys[index]!
|
|
181
|
+
if (aKey !== bKey) return false
|
|
182
|
+
pending.push([a[aKey], b[bKey]])
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return true
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** The bounds one answer is admitted under.
|
|
189
|
+
* @private
|
|
190
|
+
* @since 1.0.0
|
|
191
|
+
*/
|
|
192
|
+
export const answerLimits: BoundedJson.Limits = {
|
|
193
|
+
maxNodes: maxAnswerNodes,
|
|
194
|
+
maxDepth: maxAnswerDepth,
|
|
195
|
+
maxBytes: maxAnswerBytes,
|
|
196
|
+
maxStringBytes: maxJsonStringBytes,
|
|
197
|
+
maxKeyBytes: maxJsonKeyBytes,
|
|
198
|
+
maxMembers: maxJsonMembers
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** The bounds one schema is admitted under, enum members included.
|
|
202
|
+
* @private
|
|
203
|
+
* @since 1.0.0
|
|
204
|
+
*/
|
|
205
|
+
export const schemaLimits: BoundedJson.Limits = {
|
|
206
|
+
maxNodes: maxSchemaValueNodes,
|
|
207
|
+
maxDepth: maxSchemaValueDepth,
|
|
208
|
+
maxBytes: maxSchemaBytes,
|
|
209
|
+
maxStringBytes: maxJsonStringBytes,
|
|
210
|
+
maxKeyBytes: maxJsonKeyBytes,
|
|
211
|
+
maxMembers: maxJsonMembers
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Checks a value against the bounded JSON Schema subset, returning the first
|
|
216
|
+
* reason it does not fit.
|
|
217
|
+
*
|
|
218
|
+
* The subset is `type` (`object`, `array`, `string`, `number`, `integer`,
|
|
219
|
+
* `boolean`, `null`), `enum`, `properties`, `required`, `items`, and
|
|
220
|
+
* `nullable`. It is deliberately small: a human-task schema exists to say what
|
|
221
|
+
* shape an answer takes, and every keyword beyond these describes a constraint
|
|
222
|
+
* a person cannot be usefully re-asked about. A schema that reaches outside it
|
|
223
|
+
* is refused as `request_invalid` rather than silently ignored, because a
|
|
224
|
+
* quietly dropped constraint reads as a validation that passed.
|
|
225
|
+
*
|
|
226
|
+
* Presence is `Object.hasOwn`, never the `in` operator. An answer is a decoded
|
|
227
|
+
* JSON object, so every property it really has is its own; `in` also reports
|
|
228
|
+
* `Object.prototype`'s members, which would accept a missing required
|
|
229
|
+
* `toString` and check a `constructor` nobody answered against the schema for
|
|
230
|
+
* one.
|
|
231
|
+
*
|
|
232
|
+
* @private
|
|
233
|
+
*/
|
|
234
|
+
const checkAt = (
|
|
235
|
+
value: unknown,
|
|
236
|
+
schema: Record<string, unknown>,
|
|
237
|
+
path: ReadonlyArray<string>
|
|
238
|
+
): string | undefined => {
|
|
239
|
+
const nullable = schema["nullable"] === true
|
|
240
|
+
const enumeration = schema["enum"]
|
|
241
|
+
if (enumeration !== undefined) {
|
|
242
|
+
const matches = (enumeration as ReadonlyArray<unknown>).some((allowed) => jsonEquals(allowed, value))
|
|
243
|
+
if (!matches) return `${at(path)} must be one of ${renderDiagnosticList(enumeration as ReadonlyArray<unknown>)}.`
|
|
244
|
+
}
|
|
245
|
+
const type = schema["type"]
|
|
246
|
+
if (!(nullable && value === null) && type !== undefined) {
|
|
247
|
+
const typeComplaint = type === "object"
|
|
248
|
+
? isObject(value) ? undefined : `${at(path)} must be an object.`
|
|
249
|
+
: type === "array"
|
|
250
|
+
? Array.isArray(value) ? undefined : `${at(path)} must be an array.`
|
|
251
|
+
: type === "integer"
|
|
252
|
+
? Number.isInteger(value) ? undefined : `${at(path)} must be an integer.`
|
|
253
|
+
: type === "number"
|
|
254
|
+
// Bounded JSON admission already rejected every non-finite number.
|
|
255
|
+
? typeof value === "number" ? undefined : `${at(path)} must be a number.`
|
|
256
|
+
: type === "string"
|
|
257
|
+
? typeof value === "string" ? undefined : `${at(path)} must be a string.`
|
|
258
|
+
: type === "boolean"
|
|
259
|
+
? typeof value === "boolean" ? undefined : `${at(path)} must be a boolean.`
|
|
260
|
+
: value === null
|
|
261
|
+
? undefined
|
|
262
|
+
: `${at(path)} must be null.`
|
|
263
|
+
if (typeComplaint !== undefined) return typeComplaint
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Object and array keywords are independent constraints. JSON Schema does
|
|
267
|
+
// not require a sibling `type`; they apply whenever the instance has the
|
|
268
|
+
// relevant shape and are otherwise ignored.
|
|
269
|
+
if (isObject(value)) {
|
|
270
|
+
const required = schema["required"]
|
|
271
|
+
if (Array.isArray(required)) {
|
|
272
|
+
const missing = required.find((key) => !Object.hasOwn(value, key as string))
|
|
273
|
+
if (missing !== undefined) {
|
|
274
|
+
return `${at(path)} is missing the required property "${truncateDiagnostic(String(missing))}".`
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const properties = schema["properties"]
|
|
278
|
+
if (isObject(properties)) {
|
|
279
|
+
for (const [key, property] of Object.entries(properties)) {
|
|
280
|
+
if (!Object.hasOwn(value, key)) continue
|
|
281
|
+
const rejection = checkAt(value[key], property as Record<string, unknown>, [...path, key])
|
|
282
|
+
if (rejection !== undefined) return rejection
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (Array.isArray(value)) {
|
|
287
|
+
const items = schema["items"]
|
|
288
|
+
if (items !== undefined) {
|
|
289
|
+
for (const [index, element] of value.entries()) {
|
|
290
|
+
const rejection = checkAt(element, items as Record<string, unknown>, [...path, String(index)])
|
|
291
|
+
if (rejection !== undefined) return rejection
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return undefined
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** Checks schema validity and snapshots both inputs before walking them together.
|
|
299
|
+
* @private
|
|
300
|
+
* @since 1.0.0
|
|
301
|
+
*/
|
|
302
|
+
export const check = (value: unknown, schema: unknown): string | undefined => {
|
|
303
|
+
const admittedSchema = BoundedJson.admit(schema, schemaLimits)
|
|
304
|
+
if (!admittedSchema.ok) return admittedSchema.complaint
|
|
305
|
+
const schemaComplaint = validateSchemaAt(admittedSchema.value, [], 0, { visited: 0 })
|
|
306
|
+
if (schemaComplaint !== undefined) return schemaComplaint
|
|
307
|
+
const admittedAnswer = BoundedJson.admit(value, answerLimits)
|
|
308
|
+
if (!admittedAnswer.ok) return admittedAnswer.complaint
|
|
309
|
+
return checkAt(admittedAnswer.value, admittedSchema.value as Record<string, unknown>, [])
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
interface SchemaBudget {
|
|
313
|
+
visited: number
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Walks one schema node under a shared depth and node budget. */
|
|
317
|
+
const validateSchemaAt = (
|
|
318
|
+
schema: unknown,
|
|
319
|
+
path: ReadonlyArray<string>,
|
|
320
|
+
depth: number,
|
|
321
|
+
budget: SchemaBudget
|
|
322
|
+
): string | undefined => {
|
|
323
|
+
if (depth > maxSchemaDepth) {
|
|
324
|
+
return `${at(path)} exceeds the maximum JSON Schema depth of ${maxSchemaDepth}.`
|
|
325
|
+
}
|
|
326
|
+
budget.visited++
|
|
327
|
+
if (budget.visited > maxSchemaNodes) {
|
|
328
|
+
return `${at(path)} exceeds the maximum JSON Schema node count of ${maxSchemaNodes}.`
|
|
329
|
+
}
|
|
330
|
+
if (!isObject(schema)) return `${at(path)} is described by something that is not a JSON Schema object.`
|
|
331
|
+
const unsupported = Object.keys(schema).find((keyword) => !supportedKeywords.includes(keyword))
|
|
332
|
+
if (unsupported !== undefined) {
|
|
333
|
+
return `${at(path)} uses the unsupported JSON Schema keyword "${truncateDiagnostic(unsupported)}".`
|
|
334
|
+
}
|
|
335
|
+
const enumeration = schema["enum"]
|
|
336
|
+
if (enumeration !== undefined && !Array.isArray(enumeration)) {
|
|
337
|
+
return `${at(path)} declares an "enum" that is not an array.`
|
|
338
|
+
}
|
|
339
|
+
if (Array.isArray(enumeration) && enumeration.length === 0) {
|
|
340
|
+
return `${at(path)} declares an empty "enum".`
|
|
341
|
+
}
|
|
342
|
+
if (Object.hasOwn(schema, "required")) {
|
|
343
|
+
const required = schema["required"]
|
|
344
|
+
if (!Array.isArray(required)) return `${at([...path, "required"])} is not an array.`
|
|
345
|
+
const invalid = required.findIndex((key) => typeof key !== "string")
|
|
346
|
+
if (invalid !== -1) return `${at([...path, "required", String(invalid)])} is not a string.`
|
|
347
|
+
if (new Set(required).size !== required.length) {
|
|
348
|
+
return `${at([...path, "required"])} contains a duplicate property name.`
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (Object.hasOwn(schema, "nullable") && typeof schema["nullable"] !== "boolean") {
|
|
352
|
+
return `${at([...path, "nullable"])} is not a boolean.`
|
|
353
|
+
}
|
|
354
|
+
const type = schema["type"]
|
|
355
|
+
if (type !== undefined && (typeof type !== "string" || !supportedTypes.has(type))) {
|
|
356
|
+
return `${at(path)} declares the unsupported JSON Schema type ${renderDiagnostic(type)}.`
|
|
357
|
+
}
|
|
358
|
+
for (const keyword of ["description", "title"] as const) {
|
|
359
|
+
if (Object.hasOwn(schema, keyword) && typeof schema[keyword] !== "string") {
|
|
360
|
+
return `${at([...path, keyword])} is not a string.`
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const properties = schema["properties"]
|
|
364
|
+
if (properties !== undefined) {
|
|
365
|
+
if (!isObject(properties)) return `${at(path)} declares "properties" that is not an object.`
|
|
366
|
+
for (const [key, property] of Object.entries(properties)) {
|
|
367
|
+
const complaint = validateSchemaAt(property, [...path, key], depth + 1, budget)
|
|
368
|
+
if (complaint !== undefined) return complaint
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const items = schema["items"]
|
|
372
|
+
return items === undefined ? undefined : validateSchemaAt(items, [...path, "items"], depth + 1, budget)
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Checks that a JSON Schema stays inside the bounded subset, at every depth.
|
|
377
|
+
*
|
|
378
|
+
* Returns the first reason the schema is out of bounds, or `undefined` when the
|
|
379
|
+
* whole tree is inside it.
|
|
380
|
+
*
|
|
381
|
+
* @private
|
|
382
|
+
* @since 1.0.0
|
|
383
|
+
*/
|
|
384
|
+
export const validateSchema = (
|
|
385
|
+
schema: unknown,
|
|
386
|
+
path: ReadonlyArray<string>
|
|
387
|
+
): string | undefined => {
|
|
388
|
+
const admitted = BoundedJson.admit(schema, schemaLimits)
|
|
389
|
+
return admitted.ok
|
|
390
|
+
? validateSchemaAt(admitted.value, path, 0, { visited: 0 })
|
|
391
|
+
: admitted.complaint
|
|
392
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two markers that let `Flow.isOutcome` tell an authored `done`/`to`/`park`
|
|
3
|
+
* from ordinary data. `Flow/Outcome.ts` stamps the node marker, `Graph.build`
|
|
4
|
+
* and the interpreter stamp the value marker, and `isOutcome` reads it.
|
|
5
|
+
*
|
|
6
|
+
* @since 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Stamped on the AST of a node built by `done`/`to`/`park`.
|
|
10
|
+
* @private
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*/
|
|
13
|
+
export const OutcomeNodeTypeId: unique symbol = Symbol.for("@smthrs/flow/Flow/OutcomeNode")
|
|
14
|
+
|
|
15
|
+
/** Stamped on a resolved outcome value.
|
|
16
|
+
* @private
|
|
17
|
+
* @since 0.1.0
|
|
18
|
+
*/
|
|
19
|
+
export const OutcomeValueTypeId: unique symbol = Symbol.for("@smthrs/flow/Flow/OutcomeValue")
|