@shipfox/api-workflows 2.0.0
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/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-type$colon$emit.log +1 -0
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +311 -0
- package/LICENSE +21 -0
- package/dist/core/agent-tool-capability-warning.d.ts +7 -0
- package/dist/core/agent-tool-capability-warning.d.ts.map +1 -0
- package/dist/core/agent-tool-capability-warning.js +149 -0
- package/dist/core/agent-tool-capability-warning.js.map +1 -0
- package/dist/core/agent-tools.d.ts +51 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-tools.js +296 -0
- package/dist/core/agent-tools.js.map +1 -0
- package/dist/core/checkout.d.ts +29 -0
- package/dist/core/checkout.d.ts.map +1 -0
- package/dist/core/checkout.js +42 -0
- package/dist/core/checkout.js.map +1 -0
- package/dist/core/condition-trace.d.ts +13 -0
- package/dist/core/condition-trace.d.ts.map +1 -0
- package/dist/core/condition-trace.js +51 -0
- package/dist/core/condition-trace.js.map +1 -0
- package/dist/core/entities/index.d.ts +5 -0
- package/dist/core/entities/index.d.ts.map +1 -0
- package/dist/core/entities/index.js +3 -0
- package/dist/core/entities/index.js.map +1 -0
- package/dist/core/entities/job-execution.d.ts +30 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -0
- package/dist/core/entities/job-execution.js +3 -0
- package/dist/core/entities/job-execution.js.map +1 -0
- package/dist/core/entities/job-listener-event.d.ts +15 -0
- package/dist/core/entities/job-listener-event.d.ts.map +1 -0
- package/dist/core/entities/job-listener-event.js +3 -0
- package/dist/core/entities/job-listener-event.js.map +1 -0
- package/dist/core/entities/job.d.ts +54 -0
- package/dist/core/entities/job.d.ts.map +1 -0
- package/dist/core/entities/job.js +29 -0
- package/dist/core/entities/job.js.map +1 -0
- package/dist/core/entities/step.d.ts +86 -0
- package/dist/core/entities/step.d.ts.map +1 -0
- package/dist/core/entities/step.js +12 -0
- package/dist/core/entities/step.js.map +1 -0
- package/dist/core/entities/workflow-run-attempt.d.ts +20 -0
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -0
- package/dist/core/entities/workflow-run-attempt.js +3 -0
- package/dist/core/entities/workflow-run-attempt.js.map +1 -0
- package/dist/core/entities/workflow-run.d.ts +66 -0
- package/dist/core/entities/workflow-run.d.ts.map +1 -0
- package/dist/core/entities/workflow-run.js +10 -0
- package/dist/core/entities/workflow-run.js.map +1 -0
- package/dist/core/errors.d.ts +85 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +134 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/job-execution-outcome.d.ts +29 -0
- package/dist/core/job-execution-outcome.d.ts.map +1 -0
- package/dist/core/job-execution-outcome.js +31 -0
- package/dist/core/job-execution-outcome.js.map +1 -0
- package/dist/core/job-execution.d.ts +37 -0
- package/dist/core/job-execution.d.ts.map +1 -0
- package/dist/core/job-execution.js +425 -0
- package/dist/core/job-execution.js.map +1 -0
- package/dist/core/job-transition/decide-job-activation.d.ts +29 -0
- package/dist/core/job-transition/decide-job-activation.d.ts.map +1 -0
- package/dist/core/job-transition/decide-job-activation.js +51 -0
- package/dist/core/job-transition/decide-job-activation.js.map +1 -0
- package/dist/core/job-transition/derive-job-execution-outputs.d.ts +18 -0
- package/dist/core/job-transition/derive-job-execution-outputs.d.ts.map +1 -0
- package/dist/core/job-transition/derive-job-execution-outputs.js +23 -0
- package/dist/core/job-transition/derive-job-execution-outputs.js.map +1 -0
- package/dist/core/job-transition/derive-job-success.d.ts +16 -0
- package/dist/core/job-transition/derive-job-success.d.ts.map +1 -0
- package/dist/core/job-transition/derive-job-success.js +47 -0
- package/dist/core/job-transition/derive-job-success.js.map +1 -0
- package/dist/core/job-transition/index.d.ts +5 -0
- package/dist/core/job-transition/index.d.ts.map +1 -0
- package/dist/core/job-transition/index.js +6 -0
- package/dist/core/job-transition/index.js.map +1 -0
- package/dist/core/job-transition/runtime-completion-status-for-job.d.ts +4 -0
- package/dist/core/job-transition/runtime-completion-status-for-job.d.ts.map +1 -0
- package/dist/core/job-transition/runtime-completion-status-for-job.js +8 -0
- package/dist/core/job-transition/runtime-completion-status-for-job.js.map +1 -0
- package/dist/core/listener-execution-materialization.d.ts +30 -0
- package/dist/core/listener-execution-materialization.d.ts.map +1 -0
- package/dist/core/listener-execution-materialization.js +87 -0
- package/dist/core/listener-execution-materialization.js.map +1 -0
- package/dist/core/run-workflow.d.ts +11 -0
- package/dist/core/run-workflow.d.ts.map +1 -0
- package/dist/core/run-workflow.js +28 -0
- package/dist/core/run-workflow.js.map +1 -0
- package/dist/core/source-control.d.ts +5 -0
- package/dist/core/source-control.d.ts.map +1 -0
- package/dist/core/source-control.js +19 -0
- package/dist/core/source-control.js.map +1 -0
- package/dist/core/step-config/agent.d.ts +49 -0
- package/dist/core/step-config/agent.d.ts.map +1 -0
- package/dist/core/step-config/agent.js +337 -0
- package/dist/core/step-config/agent.js.map +1 -0
- package/dist/core/step-config/assemble-run-context.d.ts +94 -0
- package/dist/core/step-config/assemble-run-context.d.ts.map +1 -0
- package/dist/core/step-config/assemble-run-context.js +393 -0
- package/dist/core/step-config/assemble-run-context.js.map +1 -0
- package/dist/core/step-config/complete-step-dispatch-config.d.ts +13 -0
- package/dist/core/step-config/complete-step-dispatch-config.d.ts.map +1 -0
- package/dist/core/step-config/complete-step-dispatch-config.js +38 -0
- package/dist/core/step-config/complete-step-dispatch-config.js.map +1 -0
- package/dist/core/step-config/fields.d.ts +38 -0
- package/dist/core/step-config/fields.d.ts.map +1 -0
- package/dist/core/step-config/fields.js +72 -0
- package/dist/core/step-config/fields.js.map +1 -0
- package/dist/core/step-config/index.d.ts +8 -0
- package/dist/core/step-config/index.d.ts.map +1 -0
- package/dist/core/step-config/index.js +7 -0
- package/dist/core/step-config/index.js.map +1 -0
- package/dist/core/step-config/materialize-job-execution-steps.d.ts +35 -0
- package/dist/core/step-config/materialize-job-execution-steps.d.ts.map +1 -0
- package/dist/core/step-config/materialize-job-execution-steps.js +92 -0
- package/dist/core/step-config/materialize-job-execution-steps.js.map +1 -0
- package/dist/core/step-config/materialize-workflow-model.d.ts +42 -0
- package/dist/core/step-config/materialize-workflow-model.d.ts.map +1 -0
- package/dist/core/step-config/materialize-workflow-model.js +96 -0
- package/dist/core/step-config/materialize-workflow-model.js.map +1 -0
- package/dist/core/step-config/resolve-job-execution-name.d.ts +18 -0
- package/dist/core/step-config/resolve-job-execution-name.d.ts.map +1 -0
- package/dist/core/step-config/resolve-job-execution-name.js +36 -0
- package/dist/core/step-config/resolve-job-execution-name.js.map +1 -0
- package/dist/core/step-config/resolve-step-config.d.ts +33 -0
- package/dist/core/step-config/resolve-step-config.d.ts.map +1 -0
- package/dist/core/step-config/resolve-step-config.js +164 -0
- package/dist/core/step-config/resolve-step-config.js.map +1 -0
- package/dist/core/step-config/run.d.ts +39 -0
- package/dist/core/step-config/run.d.ts.map +1 -0
- package/dist/core/step-config/run.js +360 -0
- package/dist/core/step-config/run.js.map +1 -0
- package/dist/core/step-config/workflow-evaluation-context.d.ts +6 -0
- package/dist/core/step-config/workflow-evaluation-context.d.ts.map +1 -0
- package/dist/core/step-config/workflow-evaluation-context.js +3 -0
- package/dist/core/step-config/workflow-evaluation-context.js.map +1 -0
- package/dist/core/step-transition/apply-step-transition.d.ts +26 -0
- package/dist/core/step-transition/apply-step-transition.d.ts.map +1 -0
- package/dist/core/step-transition/apply-step-transition.js +141 -0
- package/dist/core/step-transition/apply-step-transition.js.map +1 -0
- package/dist/core/step-transition/decide-step-transition.d.ts +71 -0
- package/dist/core/step-transition/decide-step-transition.d.ts.map +1 -0
- package/dist/core/step-transition/decide-step-transition.js +110 -0
- package/dist/core/step-transition/decide-step-transition.js.map +1 -0
- package/dist/core/step-transition/evaluate-gate.d.ts +28 -0
- package/dist/core/step-transition/evaluate-gate.d.ts.map +1 -0
- package/dist/core/step-transition/evaluate-gate.js +159 -0
- package/dist/core/step-transition/evaluate-gate.js.map +1 -0
- package/dist/core/step-transition/read-step-outputs.d.ts +3 -0
- package/dist/core/step-transition/read-step-outputs.d.ts.map +1 -0
- package/dist/core/step-transition/read-step-outputs.js +24 -0
- package/dist/core/step-transition/read-step-outputs.js.map +1 -0
- package/dist/core/workflow-run-creation.d.ts +43 -0
- package/dist/core/workflow-run-creation.d.ts.map +1 -0
- package/dist/core/workflow-run-creation.js +80 -0
- package/dist/core/workflow-run-creation.js.map +1 -0
- package/dist/core/workflow-scheduling/index.d.ts +5 -0
- package/dist/core/workflow-scheduling/index.d.ts.map +1 -0
- package/dist/core/workflow-scheduling/index.js +4 -0
- package/dist/core/workflow-scheduling/index.js.map +1 -0
- package/dist/core/workflow-scheduling/run-progress.d.ts +20 -0
- package/dist/core/workflow-scheduling/run-progress.d.ts.map +1 -0
- package/dist/core/workflow-scheduling/run-progress.js +40 -0
- package/dist/core/workflow-scheduling/run-progress.js.map +1 -0
- package/dist/core/workflow-scheduling/runtime-dag.d.ts +10 -0
- package/dist/core/workflow-scheduling/runtime-dag.d.ts.map +1 -0
- package/dist/core/workflow-scheduling/runtime-dag.js +3 -0
- package/dist/core/workflow-scheduling/runtime-dag.js.map +1 -0
- package/dist/core/workflow-scheduling/runtime-scheduling-command.d.ts +16 -0
- package/dist/core/workflow-scheduling/runtime-scheduling-command.d.ts.map +1 -0
- package/dist/core/workflow-scheduling/runtime-scheduling-command.js +3 -0
- package/dist/core/workflow-scheduling/runtime-scheduling-command.js.map +1 -0
- package/dist/core/workflow-scheduling/schedule-runtime-dag.d.ts +9 -0
- package/dist/core/workflow-scheduling/schedule-runtime-dag.d.ts.map +1 -0
- package/dist/core/workflow-scheduling/schedule-runtime-dag.js +72 -0
- package/dist/core/workflow-scheduling/schedule-runtime-dag.js.map +1 -0
- package/dist/db/db.d.ts +4959 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +37 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/index.d.ts +9 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +10 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/job-listener-events.d.ts +18 -0
- package/dist/db/job-listener-events.d.ts.map +1 -0
- package/dist/db/job-listener-events.js +59 -0
- package/dist/db/job-listener-events.js.map +1 -0
- package/dist/db/job-listeners.d.ts +55 -0
- package/dist/db/job-listeners.d.ts.map +1 -0
- package/dist/db/job-listeners.js +358 -0
- package/dist/db/job-listeners.js.map +1 -0
- package/dist/db/outbox-writes.d.ts +12 -0
- package/dist/db/outbox-writes.d.ts.map +1 -0
- package/dist/db/outbox-writes.js +20 -0
- package/dist/db/outbox-writes.js.map +1 -0
- package/dist/db/runner-lease-table.d.ts +469 -0
- package/dist/db/runner-lease-table.d.ts.map +1 -0
- package/dist/db/runner-lease-table.js +42 -0
- package/dist/db/runner-lease-table.js.map +1 -0
- package/dist/db/schema/common.d.ts +2 -0
- package/dist/db/schema/common.d.ts.map +1 -0
- package/dist/db/schema/common.js +4 -0
- package/dist/db/schema/common.js.map +1 -0
- package/dist/db/schema/job-executions.d.ts +311 -0
- package/dist/db/schema/job-executions.d.ts.map +1 -0
- package/dist/db/schema/job-executions.js +76 -0
- package/dist/db/schema/job-executions.js.map +1 -0
- package/dist/db/schema/job-listener-events.d.ts +200 -0
- package/dist/db/schema/job-listener-events.d.ts.map +1 -0
- package/dist/db/schema/job-listener-events.js +50 -0
- package/dist/db/schema/job-listener-events.js.map +1 -0
- package/dist/db/schema/jobs.d.ts +542 -0
- package/dist/db/schema/jobs.d.ts.map +1 -0
- package/dist/db/schema/jobs.js +121 -0
- package/dist/db/schema/jobs.js.map +1 -0
- package/dist/db/schema/outbox.d.ts +195 -0
- package/dist/db/schema/outbox.d.ts.map +1 -0
- package/dist/db/schema/outbox.js +5 -0
- package/dist/db/schema/outbox.js.map +1 -0
- package/dist/db/schema/step-attempts.d.ts +330 -0
- package/dist/db/schema/step-attempts.d.ts.map +1 -0
- package/dist/db/schema/step-attempts.js +80 -0
- package/dist/db/schema/step-attempts.js.map +1 -0
- package/dist/db/schema/steps.d.ts +352 -0
- package/dist/db/schema/steps.d.ts.map +1 -0
- package/dist/db/schema/steps.js +80 -0
- package/dist/db/schema/steps.js.map +1 -0
- package/dist/db/schema/workflow-run-attempts.d.ts +239 -0
- package/dist/db/schema/workflow-run-attempts.d.ts.map +1 -0
- package/dist/db/schema/workflow-run-attempts.js +53 -0
- package/dist/db/schema/workflow-run-attempts.js.map +1 -0
- package/dist/db/schema/workflow-runs.d.ts +360 -0
- package/dist/db/schema/workflow-runs.d.ts.map +1 -0
- package/dist/db/schema/workflow-runs.js +85 -0
- package/dist/db/schema/workflow-runs.js.map +1 -0
- package/dist/db/workflow-runs/job-executions.d.ts +49 -0
- package/dist/db/workflow-runs/job-executions.d.ts.map +1 -0
- package/dist/db/workflow-runs/job-executions.js +271 -0
- package/dist/db/workflow-runs/job-executions.js.map +1 -0
- package/dist/db/workflow-runs/jobs.d.ts +60 -0
- package/dist/db/workflow-runs/jobs.d.ts.map +1 -0
- package/dist/db/workflow-runs/jobs.js +288 -0
- package/dist/db/workflow-runs/jobs.js.map +1 -0
- package/dist/db/workflow-runs/outbox.d.ts +20 -0
- package/dist/db/workflow-runs/outbox.d.ts.map +1 -0
- package/dist/db/workflow-runs/outbox.js +68 -0
- package/dist/db/workflow-runs/outbox.js.map +1 -0
- package/dist/db/workflow-runs/queries.d.ts +71 -0
- package/dist/db/workflow-runs/queries.d.ts.map +1 -0
- package/dist/db/workflow-runs/queries.js +253 -0
- package/dist/db/workflow-runs/queries.js.map +1 -0
- package/dist/db/workflow-runs/run-create.d.ts +32 -0
- package/dist/db/workflow-runs/run-create.d.ts.map +1 -0
- package/dist/db/workflow-runs/run-create.js +288 -0
- package/dist/db/workflow-runs/run-create.js.map +1 -0
- package/dist/db/workflow-runs/run-graph.d.ts +27 -0
- package/dist/db/workflow-runs/run-graph.d.ts.map +1 -0
- package/dist/db/workflow-runs/run-graph.js +63 -0
- package/dist/db/workflow-runs/run-graph.js.map +1 -0
- package/dist/db/workflow-runs/run-rerun.d.ts +8 -0
- package/dist/db/workflow-runs/run-rerun.d.ts.map +1 -0
- package/dist/db/workflow-runs/run-rerun.js +207 -0
- package/dist/db/workflow-runs/run-rerun.js.map +1 -0
- package/dist/db/workflow-runs/run-status.d.ts +24 -0
- package/dist/db/workflow-runs/run-status.d.ts.map +1 -0
- package/dist/db/workflow-runs/run-status.js +249 -0
- package/dist/db/workflow-runs/run-status.js.map +1 -0
- package/dist/db/workflow-runs/runs.d.ts +7 -0
- package/dist/db/workflow-runs/runs.d.ts.map +1 -0
- package/dist/db/workflow-runs/runs.js +5 -0
- package/dist/db/workflow-runs/runs.js.map +1 -0
- package/dist/db/workflow-runs/shared.d.ts +24 -0
- package/dist/db/workflow-runs/shared.d.ts.map +1 -0
- package/dist/db/workflow-runs/shared.js +50 -0
- package/dist/db/workflow-runs/shared.js.map +1 -0
- package/dist/db/workflow-runs/steps.d.ts +83 -0
- package/dist/db/workflow-runs/steps.d.ts.map +1 -0
- package/dist/db/workflow-runs/steps.js +246 -0
- package/dist/db/workflow-runs/steps.js.map +1 -0
- package/dist/db/workflow-runs.d.ts +12 -0
- package/dist/db/workflow-runs.d.ts.map +1 -0
- package/dist/db/workflow-runs.js +8 -0
- package/dist/db/workflow-runs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/metrics/index.d.ts +2 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +3 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/instance.d.ts +20 -0
- package/dist/metrics/instance.d.ts.map +1 -0
- package/dist/metrics/instance.js +127 -0
- package/dist/metrics/instance.js.map +1 -0
- package/dist/metrics/service.d.ts +2 -0
- package/dist/metrics/service.d.ts.map +1 -0
- package/dist/metrics/service.js +30 -0
- package/dist/metrics/service.js.map +1 -0
- package/dist/presentation/dto/checkout-token.d.ts +6 -0
- package/dist/presentation/dto/checkout-token.d.ts.map +1 -0
- package/dist/presentation/dto/checkout-token.js +74 -0
- package/dist/presentation/dto/checkout-token.js.map +1 -0
- package/dist/presentation/dto/index.d.ts +4 -0
- package/dist/presentation/dto/index.d.ts.map +1 -0
- package/dist/presentation/dto/index.js +5 -0
- package/dist/presentation/dto/index.js.map +1 -0
- package/dist/presentation/dto/job.d.ts +6 -0
- package/dist/presentation/dto/job.d.ts.map +1 -0
- package/dist/presentation/dto/job.js +59 -0
- package/dist/presentation/dto/job.js.map +1 -0
- package/dist/presentation/dto/step.d.ts +6 -0
- package/dist/presentation/dto/step.d.ts.map +1 -0
- package/dist/presentation/dto/step.js +162 -0
- package/dist/presentation/dto/step.js.map +1 -0
- package/dist/presentation/dto/workflow-run.d.ts +6 -0
- package/dist/presentation/dto/workflow-run.d.ts.map +1 -0
- package/dist/presentation/dto/workflow-run.js +35 -0
- package/dist/presentation/dto/workflow-run.js.map +1 -0
- package/dist/presentation/index.d.ts +3 -0
- package/dist/presentation/index.d.ts.map +1 -0
- package/dist/presentation/index.js +4 -0
- package/dist/presentation/index.js.map +1 -0
- package/dist/presentation/routes/agent-runtime-config.d.ts +2 -0
- package/dist/presentation/routes/agent-runtime-config.d.ts.map +1 -0
- package/dist/presentation/routes/agent-runtime-config.js +71 -0
- package/dist/presentation/routes/agent-runtime-config.js.map +1 -0
- package/dist/presentation/routes/cancel-run.d.ts +2 -0
- package/dist/presentation/routes/cancel-run.d.ts.map +1 -0
- package/dist/presentation/routes/cancel-run.js +46 -0
- package/dist/presentation/routes/cancel-run.js.map +1 -0
- package/dist/presentation/routes/checkout-token.d.ts +2 -0
- package/dist/presentation/routes/checkout-token.d.ts.map +1 -0
- package/dist/presentation/routes/checkout-token.js +64 -0
- package/dist/presentation/routes/checkout-token.js.map +1 -0
- package/dist/presentation/routes/get-run-aggregates.d.ts +2 -0
- package/dist/presentation/routes/get-run-aggregates.d.ts.map +1 -0
- package/dist/presentation/routes/get-run-aggregates.js +60 -0
- package/dist/presentation/routes/get-run-aggregates.js.map +1 -0
- package/dist/presentation/routes/get-run.d.ts +2 -0
- package/dist/presentation/routes/get-run.d.ts.map +1 -0
- package/dist/presentation/routes/get-run.js +60 -0
- package/dist/presentation/routes/get-run.js.map +1 -0
- package/dist/presentation/routes/get-step-secrets.d.ts +2 -0
- package/dist/presentation/routes/get-step-secrets.d.ts.map +1 -0
- package/dist/presentation/routes/get-step-secrets.js +115 -0
- package/dist/presentation/routes/get-step-secrets.js.map +1 -0
- package/dist/presentation/routes/index.d.ts +4 -0
- package/dist/presentation/routes/index.d.ts.map +1 -0
- package/dist/presentation/routes/index.js +41 -0
- package/dist/presentation/routes/index.js.map +1 -0
- package/dist/presentation/routes/leased-step.d.ts +14 -0
- package/dist/presentation/routes/leased-step.d.ts.map +1 -0
- package/dist/presentation/routes/leased-step.js +50 -0
- package/dist/presentation/routes/leased-step.js.map +1 -0
- package/dist/presentation/routes/list-run-attempts.d.ts +2 -0
- package/dist/presentation/routes/list-run-attempts.d.ts.map +1 -0
- package/dist/presentation/routes/list-run-attempts.js +35 -0
- package/dist/presentation/routes/list-run-attempts.js.map +1 -0
- package/dist/presentation/routes/list-runs.d.ts +2 -0
- package/dist/presentation/routes/list-runs.d.ts.map +1 -0
- package/dist/presentation/routes/list-runs.js +70 -0
- package/dist/presentation/routes/list-runs.js.map +1 -0
- package/dist/presentation/routes/next-step.d.ts +2 -0
- package/dist/presentation/routes/next-step.d.ts.map +1 -0
- package/dist/presentation/routes/next-step.js +65 -0
- package/dist/presentation/routes/next-step.js.map +1 -0
- package/dist/presentation/routes/report-step.d.ts +2 -0
- package/dist/presentation/routes/report-step.d.ts.map +1 -0
- package/dist/presentation/routes/report-step.js +73 -0
- package/dist/presentation/routes/report-step.js.map +1 -0
- package/dist/presentation/routes/require-accessible-run.d.ts +7 -0
- package/dist/presentation/routes/require-accessible-run.d.ts.map +1 -0
- package/dist/presentation/routes/require-accessible-run.js +25 -0
- package/dist/presentation/routes/require-accessible-run.js.map +1 -0
- package/dist/presentation/routes/rerun-run.d.ts +2 -0
- package/dist/presentation/routes/rerun-run.d.ts.map +1 -0
- package/dist/presentation/routes/rerun-run.js +56 -0
- package/dist/presentation/routes/rerun-run.js.map +1 -0
- package/dist/presentation/subscribers/index.d.ts +8 -0
- package/dist/presentation/subscribers/index.d.ts.map +1 -0
- package/dist/presentation/subscribers/index.js +9 -0
- package/dist/presentation/subscribers/index.js.map +1 -0
- package/dist/presentation/subscribers/on-job-event-delivered.d.ts +3 -0
- package/dist/presentation/subscribers/on-job-event-delivered.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-job-event-delivered.js +24 -0
- package/dist/presentation/subscribers/on-job-event-delivered.js.map +1 -0
- package/dist/presentation/subscribers/on-job-steps-settled.d.ts +3 -0
- package/dist/presentation/subscribers/on-job-steps-settled.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-job-steps-settled.js +36 -0
- package/dist/presentation/subscribers/on-job-steps-settled.js.map +1 -0
- package/dist/presentation/subscribers/on-runner-job-claimed.d.ts +3 -0
- package/dist/presentation/subscribers/on-runner-job-claimed.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-runner-job-claimed.js +20 -0
- package/dist/presentation/subscribers/on-runner-job-claimed.js.map +1 -0
- package/dist/presentation/subscribers/on-runner-job-lease-expired.d.ts +3 -0
- package/dist/presentation/subscribers/on-runner-job-lease-expired.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-runner-job-lease-expired.js +35 -0
- package/dist/presentation/subscribers/on-runner-job-lease-expired.js.map +1 -0
- package/dist/presentation/subscribers/on-runner-job-queued.d.ts +3 -0
- package/dist/presentation/subscribers/on-runner-job-queued.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-runner-job-queued.js +20 -0
- package/dist/presentation/subscribers/on-runner-job-queued.js.map +1 -0
- package/dist/presentation/subscribers/on-workflow-run-attempt-created.d.ts +3 -0
- package/dist/presentation/subscribers/on-workflow-run-attempt-created.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-workflow-run-attempt-created.js +35 -0
- package/dist/presentation/subscribers/on-workflow-run-attempt-created.js.map +1 -0
- package/dist/presentation/subscribers/on-workflow-run-cancelled.d.ts +3 -0
- package/dist/presentation/subscribers/on-workflow-run-cancelled.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-workflow-run-cancelled.js +25 -0
- package/dist/presentation/subscribers/on-workflow-run-cancelled.js.map +1 -0
- package/dist/temporal/activities/index.d.ts +23 -0
- package/dist/temporal/activities/index.d.ts.map +1 -0
- package/dist/temporal/activities/index.js +26 -0
- package/dist/temporal/activities/index.js.map +1 -0
- package/dist/temporal/activities/orchestration-activities.d.ts +130 -0
- package/dist/temporal/activities/orchestration-activities.d.ts.map +1 -0
- package/dist/temporal/activities/orchestration-activities.js +188 -0
- package/dist/temporal/activities/orchestration-activities.js.map +1 -0
- package/dist/temporal/constants.d.ts +7 -0
- package/dist/temporal/constants.d.ts.map +1 -0
- package/dist/temporal/constants.js +8 -0
- package/dist/temporal/constants.js.map +1 -0
- package/dist/temporal/index.d.ts +3 -0
- package/dist/temporal/index.d.ts.map +1 -0
- package/dist/temporal/index.js +4 -0
- package/dist/temporal/index.js.map +1 -0
- package/dist/temporal/workflow-not-found.d.ts +2 -0
- package/dist/temporal/workflow-not-found.d.ts.map +1 -0
- package/dist/temporal/workflow-not-found.js +10 -0
- package/dist/temporal/workflow-not-found.js.map +1 -0
- package/dist/temporal/workflows/deadline.d.ts +3 -0
- package/dist/temporal/workflows/deadline.d.ts.map +1 -0
- package/dist/temporal/workflows/deadline.js +8 -0
- package/dist/temporal/workflows/deadline.js.map +1 -0
- package/dist/temporal/workflows/index.d.ts +4 -0
- package/dist/temporal/workflows/index.d.ts.map +1 -0
- package/dist/temporal/workflows/index.js +5 -0
- package/dist/temporal/workflows/index.js.map +1 -0
- package/dist/temporal/workflows/job-execution-orchestration.d.ts +27 -0
- package/dist/temporal/workflows/job-execution-orchestration.d.ts.map +1 -0
- package/dist/temporal/workflows/job-execution-orchestration.js +265 -0
- package/dist/temporal/workflows/job-execution-orchestration.js.map +1 -0
- package/dist/temporal/workflows/job-listener-orchestration.d.ts +40 -0
- package/dist/temporal/workflows/job-listener-orchestration.d.ts.map +1 -0
- package/dist/temporal/workflows/job-listener-orchestration.js +332 -0
- package/dist/temporal/workflows/job-listener-orchestration.js.map +1 -0
- package/dist/temporal/workflows/run-orchestration.d.ts +8 -0
- package/dist/temporal/workflows/run-orchestration.d.ts.map +1 -0
- package/dist/temporal/workflows/run-orchestration.js +243 -0
- package/dist/temporal/workflows/run-orchestration.js.map +1 -0
- package/dist/temporal/workflows/test-env.d.ts +114 -0
- package/dist/temporal/workflows/test-env.d.ts.map +1 -0
- package/dist/temporal/workflows/test-env.js +323 -0
- package/dist/temporal/workflows/test-env.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/drizzle/0000_initial.sql +211 -0
- package/drizzle/0001_agent_tool_materialization.sql +1 -0
- package/drizzle/meta/0000_snapshot.json +1613 -0
- package/drizzle/meta/_journal.json +20 -0
- package/drizzle.config.ts +7 -0
- package/package.json +91 -0
- package/src/core/README.md +79 -0
- package/src/core/agent-tool-capability-warning.test.ts +280 -0
- package/src/core/agent-tool-capability-warning.ts +200 -0
- package/src/core/agent-tools.ts +422 -0
- package/src/core/checkout.test.ts +112 -0
- package/src/core/checkout.ts +63 -0
- package/src/core/condition-trace.ts +64 -0
- package/src/core/entities/index.ts +9 -0
- package/src/core/entities/job-execution.ts +32 -0
- package/src/core/entities/job-listener-event.ts +15 -0
- package/src/core/entities/job.ts +91 -0
- package/src/core/entities/step.ts +126 -0
- package/src/core/entities/workflow-run-attempt.ts +21 -0
- package/src/core/entities/workflow-run.ts +94 -0
- package/src/core/errors.test.ts +45 -0
- package/src/core/errors.ts +209 -0
- package/src/core/index.ts +54 -0
- package/src/core/job-execution-outcome.ts +64 -0
- package/src/core/job-execution.test.ts +1560 -0
- package/src/core/job-execution.ts +581 -0
- package/src/core/job-transition/decide-job-activation.test.ts +196 -0
- package/src/core/job-transition/decide-job-activation.ts +79 -0
- package/src/core/job-transition/derive-job-execution-outputs.ts +41 -0
- package/src/core/job-transition/derive-job-success.test.ts +133 -0
- package/src/core/job-transition/derive-job-success.ts +67 -0
- package/src/core/job-transition/index.ts +11 -0
- package/src/core/job-transition/runtime-completion-status-for-job.ts +14 -0
- package/src/core/listener-execution-materialization.test.ts +49 -0
- package/src/core/listener-execution-materialization.ts +162 -0
- package/src/core/run-workflow.test.ts +229 -0
- package/src/core/run-workflow.ts +41 -0
- package/src/core/source-control.test.ts +17 -0
- package/src/core/source-control.ts +22 -0
- package/src/core/step-config/agent.ts +459 -0
- package/src/core/step-config/assemble-run-context.test.ts +1021 -0
- package/src/core/step-config/assemble-run-context.ts +535 -0
- package/src/core/step-config/complete-step-dispatch-config.test.ts +354 -0
- package/src/core/step-config/complete-step-dispatch-config.ts +40 -0
- package/src/core/step-config/fields.ts +111 -0
- package/src/core/step-config/index.ts +41 -0
- package/src/core/step-config/materialize-job-execution-steps.test.ts +494 -0
- package/src/core/step-config/materialize-job-execution-steps.ts +136 -0
- package/src/core/step-config/materialize-workflow-model.test.ts +1214 -0
- package/src/core/step-config/materialize-workflow-model.ts +140 -0
- package/src/core/step-config/resolve-job-execution-name.test.ts +94 -0
- package/src/core/step-config/resolve-job-execution-name.ts +51 -0
- package/src/core/step-config/resolve-step-config.ts +199 -0
- package/src/core/step-config/run.ts +467 -0
- package/src/core/step-config/workflow-evaluation-context.ts +6 -0
- package/src/core/step-transition/apply-step-transition.ts +163 -0
- package/src/core/step-transition/decide-step-transition.test.ts +307 -0
- package/src/core/step-transition/decide-step-transition.ts +200 -0
- package/src/core/step-transition/evaluate-gate.test.ts +317 -0
- package/src/core/step-transition/evaluate-gate.ts +168 -0
- package/src/core/step-transition/read-step-outputs.ts +27 -0
- package/src/core/workflow-run-creation.test.ts +155 -0
- package/src/core/workflow-run-creation.ts +131 -0
- package/src/core/workflow-scheduling/index.ts +15 -0
- package/src/core/workflow-scheduling/run-progress.test.ts +46 -0
- package/src/core/workflow-scheduling/run-progress.ts +68 -0
- package/src/core/workflow-scheduling/runtime-dag.ts +10 -0
- package/src/core/workflow-scheduling/runtime-scheduling-command.ts +20 -0
- package/src/core/workflow-scheduling/schedule-runtime-dag.test.ts +197 -0
- package/src/core/workflow-scheduling/schedule-runtime-dag.ts +115 -0
- package/src/db/db.ts +40 -0
- package/src/db/index.ts +86 -0
- package/src/db/job-listener-events.test.ts +113 -0
- package/src/db/job-listener-events.ts +73 -0
- package/src/db/job-listeners.test.ts +865 -0
- package/src/db/job-listeners.ts +564 -0
- package/src/db/outbox-writes.ts +40 -0
- package/src/db/rerun-listener.test.ts +64 -0
- package/src/db/run-timeout.test.ts +102 -0
- package/src/db/runner-lease-table.ts +39 -0
- package/src/db/schema/common.ts +3 -0
- package/src/db/schema/job-executions.ts +85 -0
- package/src/db/schema/job-listener-events.ts +58 -0
- package/src/db/schema/jobs.ts +136 -0
- package/src/db/schema/outbox.ts +4 -0
- package/src/db/schema/step-attempts.ts +99 -0
- package/src/db/schema/steps.ts +99 -0
- package/src/db/schema/workflow-run-attempts.ts +59 -0
- package/src/db/schema/workflow-runs.ts +112 -0
- package/src/db/workflow-runs/job-executions.test.ts +99 -0
- package/src/db/workflow-runs/job-executions.ts +421 -0
- package/src/db/workflow-runs/job-status.test.ts +532 -0
- package/src/db/workflow-runs/jobs.test.ts +194 -0
- package/src/db/workflow-runs/jobs.ts +418 -0
- package/src/db/workflow-runs/outbox.ts +109 -0
- package/src/db/workflow-runs/queries.test.ts +256 -0
- package/src/db/workflow-runs/queries.ts +437 -0
- package/src/db/workflow-runs/run-create.test.ts +1281 -0
- package/src/db/workflow-runs/run-create.ts +373 -0
- package/src/db/workflow-runs/run-graph.ts +95 -0
- package/src/db/workflow-runs/run-rerun.test.ts +625 -0
- package/src/db/workflow-runs/run-rerun.ts +266 -0
- package/src/db/workflow-runs/run-status.test.ts +425 -0
- package/src/db/workflow-runs/run-status.ts +391 -0
- package/src/db/workflow-runs/runs.ts +17 -0
- package/src/db/workflow-runs/shared.ts +84 -0
- package/src/db/workflow-runs/steps.test.ts +191 -0
- package/src/db/workflow-runs/steps.ts +476 -0
- package/src/db/workflow-runs.ts +111 -0
- package/src/index.ts +99 -0
- package/src/metrics/index.ts +1 -0
- package/src/metrics/instance.ts +160 -0
- package/src/metrics/service.ts +30 -0
- package/src/presentation/dto/checkout-token.test.ts +107 -0
- package/src/presentation/dto/checkout-token.ts +85 -0
- package/src/presentation/dto/index.ts +3 -0
- package/src/presentation/dto/job.test.ts +108 -0
- package/src/presentation/dto/job.ts +64 -0
- package/src/presentation/dto/step.test.ts +307 -0
- package/src/presentation/dto/step.ts +145 -0
- package/src/presentation/dto/workflow-run.ts +38 -0
- package/src/presentation/index.ts +10 -0
- package/src/presentation/routes/agent-runtime-config.test.ts +478 -0
- package/src/presentation/routes/agent-runtime-config.ts +81 -0
- package/src/presentation/routes/cancel-run.test.ts +156 -0
- package/src/presentation/routes/cancel-run.ts +37 -0
- package/src/presentation/routes/checkout-token.test.ts +366 -0
- package/src/presentation/routes/checkout-token.ts +61 -0
- package/src/presentation/routes/get-run-aggregates.test.ts +114 -0
- package/src/presentation/routes/get-run-aggregates.ts +69 -0
- package/src/presentation/routes/get-run.test.ts +604 -0
- package/src/presentation/routes/get-run.ts +66 -0
- package/src/presentation/routes/get-step-secrets.test.ts +260 -0
- package/src/presentation/routes/get-step-secrets.ts +117 -0
- package/src/presentation/routes/index.test.ts +71 -0
- package/src/presentation/routes/index.ts +42 -0
- package/src/presentation/routes/leased-step.ts +54 -0
- package/src/presentation/routes/list-run-attempts.test.ts +163 -0
- package/src/presentation/routes/list-run-attempts.ts +27 -0
- package/src/presentation/routes/list-runs.test.ts +244 -0
- package/src/presentation/routes/list-runs.ts +83 -0
- package/src/presentation/routes/next-step.test.ts +366 -0
- package/src/presentation/routes/next-step.ts +62 -0
- package/src/presentation/routes/report-step.test.ts +374 -0
- package/src/presentation/routes/report-step.ts +61 -0
- package/src/presentation/routes/require-accessible-run.ts +27 -0
- package/src/presentation/routes/rerun-run.test.ts +202 -0
- package/src/presentation/routes/rerun-run.ts +48 -0
- package/src/presentation/subscribers/index.ts +7 -0
- package/src/presentation/subscribers/on-job-event-delivered.test.ts +71 -0
- package/src/presentation/subscribers/on-job-event-delivered.ts +30 -0
- package/src/presentation/subscribers/on-job-steps-settled.test.ts +75 -0
- package/src/presentation/subscribers/on-job-steps-settled.ts +42 -0
- package/src/presentation/subscribers/on-runner-job-claimed.test.ts +57 -0
- package/src/presentation/subscribers/on-runner-job-claimed.ts +23 -0
- package/src/presentation/subscribers/on-runner-job-lease-expired.test.ts +73 -0
- package/src/presentation/subscribers/on-runner-job-lease-expired.ts +36 -0
- package/src/presentation/subscribers/on-runner-job-queued.test.ts +57 -0
- package/src/presentation/subscribers/on-runner-job-queued.ts +23 -0
- package/src/presentation/subscribers/on-workflow-run-attempt-created.test.ts +69 -0
- package/src/presentation/subscribers/on-workflow-run-attempt-created.ts +40 -0
- package/src/presentation/subscribers/on-workflow-run-cancelled.test.ts +59 -0
- package/src/presentation/subscribers/on-workflow-run-cancelled.ts +29 -0
- package/src/temporal/activities/index.ts +45 -0
- package/src/temporal/activities/orchestration-activities.test.ts +115 -0
- package/src/temporal/activities/orchestration-activities.ts +305 -0
- package/src/temporal/constants.ts +6 -0
- package/src/temporal/index.ts +6 -0
- package/src/temporal/workflow-not-found.ts +9 -0
- package/src/temporal/workflows/deadline.ts +7 -0
- package/src/temporal/workflows/index.ts +11 -0
- package/src/temporal/workflows/job-execution-orchestration-timeout.test.ts +165 -0
- package/src/temporal/workflows/job-execution-orchestration.test.ts +311 -0
- package/src/temporal/workflows/job-execution-orchestration.ts +314 -0
- package/src/temporal/workflows/job-listener-orchestration-continuation.test.ts +93 -0
- package/src/temporal/workflows/job-listener-orchestration.test.ts +406 -0
- package/src/temporal/workflows/job-listener-orchestration.ts +490 -0
- package/src/temporal/workflows/run-orchestration.test.ts +409 -0
- package/src/temporal/workflows/run-orchestration.ts +283 -0
- package/src/temporal/workflows/test-env.ts +409 -0
- package/test/env.ts +11 -0
- package/test/factories/job.ts +83 -0
- package/test/factories/project.ts +16 -0
- package/test/factories/workflow-model.test.ts +26 -0
- package/test/factories/workflow-model.ts +268 -0
- package/test/factories/workflow-run.ts +58 -0
- package/test/fixtures/active-lease-token.ts +85 -0
- package/test/fixtures/job-with-steps.ts +42 -0
- package/test/fixtures/lease-token.ts +44 -0
- package/test/fixtures/strip-setup-step.ts +23 -0
- package/test/globalSetup.ts +54 -0
- package/test/helpers/workflow-runs.ts +210 -0
- package/test/index.ts +3 -0
- package/test/setup.ts +17 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vitest.config.ts +12 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type JobListenerEventDisposition = 'fire' | 'resolve';
|
|
2
|
+
|
|
3
|
+
export interface JobListenerEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
jobId: string;
|
|
6
|
+
disposition: JobListenerEventDisposition;
|
|
7
|
+
eventRef: string;
|
|
8
|
+
deliveryId: string;
|
|
9
|
+
source: string;
|
|
10
|
+
event: string;
|
|
11
|
+
payload: unknown;
|
|
12
|
+
receivedAt: Date;
|
|
13
|
+
consumedByExecutionId: string | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type {PersistedEvaluationTraceEntry} from './step.js';
|
|
2
|
+
|
|
3
|
+
export type JobStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped';
|
|
4
|
+
|
|
5
|
+
export type JobMode = 'one_shot' | 'listening';
|
|
6
|
+
|
|
7
|
+
export type ListenerStatus = 'inactive' | 'listening' | 'resolved';
|
|
8
|
+
|
|
9
|
+
export type ResolutionReason = 'until' | 'timeout' | 'max_executions' | 'cancelled';
|
|
10
|
+
|
|
11
|
+
export interface JobCheckout {
|
|
12
|
+
permissions: {
|
|
13
|
+
contents: 'read' | 'write';
|
|
14
|
+
};
|
|
15
|
+
persistCredentials: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const JOB_STATUS_REASONS = [
|
|
19
|
+
'dependency_not_completed',
|
|
20
|
+
'condition_false',
|
|
21
|
+
'default_gate_rejected',
|
|
22
|
+
'condition_rejected',
|
|
23
|
+
'condition_errored',
|
|
24
|
+
'user_cancelled',
|
|
25
|
+
'run_cancelled',
|
|
26
|
+
'timed_out',
|
|
27
|
+
'runner_lost',
|
|
28
|
+
'step_failed',
|
|
29
|
+
'unknown',
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
export type JobStatusReason = (typeof JOB_STATUS_REASONS)[number];
|
|
33
|
+
|
|
34
|
+
const JOB_STATUS_REASON_SET = new Set<JobStatusReason>(JOB_STATUS_REASONS);
|
|
35
|
+
|
|
36
|
+
export interface Job {
|
|
37
|
+
id: string;
|
|
38
|
+
workflowRunAttemptId: string;
|
|
39
|
+
key: string;
|
|
40
|
+
mode: JobMode;
|
|
41
|
+
name: string | null;
|
|
42
|
+
status: JobStatus;
|
|
43
|
+
statusReason: JobStatusReason | null;
|
|
44
|
+
carriedOver: boolean;
|
|
45
|
+
checkout: JobCheckout;
|
|
46
|
+
success?: string | null;
|
|
47
|
+
evaluationTrace?: readonly PersistedEvaluationTraceEntry[] | null;
|
|
48
|
+
executionTimeoutMs?: number | null;
|
|
49
|
+
listeningTimeoutMs: number | null;
|
|
50
|
+
maxExecutions: number | null;
|
|
51
|
+
onResolve: 'finish' | 'cancel' | null;
|
|
52
|
+
batchDebounceMs: number | null;
|
|
53
|
+
batchMaxSize: number | null;
|
|
54
|
+
batchMaxWaitMs: number | null;
|
|
55
|
+
listenerStatus: ListenerStatus;
|
|
56
|
+
resolutionReason: ResolutionReason | null;
|
|
57
|
+
listeningOn: JobListeningTrigger[] | null;
|
|
58
|
+
listeningUntil: JobListeningTrigger[] | null;
|
|
59
|
+
outputs: Record<string, unknown> | null;
|
|
60
|
+
dependencies: string[];
|
|
61
|
+
runner: string[] | null;
|
|
62
|
+
position: number;
|
|
63
|
+
version: number;
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
updatedAt: Date;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface JobListeningTrigger {
|
|
69
|
+
readonly source: string;
|
|
70
|
+
readonly event: string;
|
|
71
|
+
readonly inputs?: Readonly<Record<string, unknown>>;
|
|
72
|
+
readonly filter?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type TerminalJobStatus = Extract<
|
|
76
|
+
JobStatus,
|
|
77
|
+
'succeeded' | 'failed' | 'cancelled' | 'skipped'
|
|
78
|
+
>;
|
|
79
|
+
|
|
80
|
+
const TERMINAL_JOB_STATUSES = new Set<JobStatus>(['succeeded', 'failed', 'cancelled', 'skipped']);
|
|
81
|
+
|
|
82
|
+
export function isJobTerminal(status: JobStatus): status is TerminalJobStatus {
|
|
83
|
+
return TERMINAL_JOB_STATUSES.has(status);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function toJobStatusReason(value: string | null): JobStatusReason | null {
|
|
87
|
+
if (value === null) return null;
|
|
88
|
+
return JOB_STATUS_REASON_SET.has(value as JobStatusReason)
|
|
89
|
+
? (value as JobStatusReason)
|
|
90
|
+
: 'unknown';
|
|
91
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AgentIntegrationMcpServerConfigDto,
|
|
3
|
+
AgentThinking,
|
|
4
|
+
Harness,
|
|
5
|
+
MaterializedAgentIntegrationConfigDto,
|
|
6
|
+
} from '@shipfox/api-agent-dto';
|
|
7
|
+
import type {
|
|
8
|
+
EvaluationTraceEntry,
|
|
9
|
+
EvaluationTraceLimitEntry,
|
|
10
|
+
ResolvedField,
|
|
11
|
+
WorkflowExpression,
|
|
12
|
+
} from '@shipfox/expression';
|
|
13
|
+
import type {InterpolationUnresolvableField} from '../errors.js';
|
|
14
|
+
|
|
15
|
+
export type StepStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped';
|
|
16
|
+
|
|
17
|
+
export const STEP_STATUS_REASONS = [
|
|
18
|
+
'default_gate_rejected',
|
|
19
|
+
'condition_rejected',
|
|
20
|
+
'condition_errored',
|
|
21
|
+
] as const;
|
|
22
|
+
|
|
23
|
+
export type StepStatusReason = (typeof STEP_STATUS_REASONS)[number];
|
|
24
|
+
|
|
25
|
+
const STEP_STATUS_REASON_SET = new Set<StepStatusReason>(STEP_STATUS_REASONS);
|
|
26
|
+
|
|
27
|
+
export function toStepStatusReason(value: string | null): StepStatusReason | null {
|
|
28
|
+
if (value === null) return null;
|
|
29
|
+
return STEP_STATUS_REASON_SET.has(value as StepStatusReason) ? (value as StepStatusReason) : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type StepAttemptLogOutcome = 'drained' | 'abandoned';
|
|
33
|
+
|
|
34
|
+
// A step_attempts row exists only once an attempt is dispatched, so it is never
|
|
35
|
+
// 'pending' or 'skipped'.
|
|
36
|
+
export type StepAttemptStatus = Exclude<StepStatus, 'pending' | 'skipped'>;
|
|
37
|
+
|
|
38
|
+
export interface StepSourceLocation {
|
|
39
|
+
startLine: number;
|
|
40
|
+
endLine: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Trace entry after a resolver-local expression trace is attached to workflow
|
|
45
|
+
* storage.
|
|
46
|
+
*
|
|
47
|
+
* Step config traces are stored on step attempts with the resolved attempt
|
|
48
|
+
* config; job-level traces are stored on the job or job-execution row whose
|
|
49
|
+
* value/status they explain. Keep `field` as the authored field path that
|
|
50
|
+
* produced the trace, not as a step-only enum.
|
|
51
|
+
*/
|
|
52
|
+
export type PersistedEvaluationTraceEntry =
|
|
53
|
+
| (EvaluationTraceEntry & {
|
|
54
|
+
readonly field: string;
|
|
55
|
+
readonly envKey?: string;
|
|
56
|
+
})
|
|
57
|
+
| EvaluationTraceLimitEntry;
|
|
58
|
+
|
|
59
|
+
export interface StepConfigEvaluationTraceEntry extends EvaluationTraceEntry {
|
|
60
|
+
readonly field: InterpolationUnresolvableField;
|
|
61
|
+
readonly envKey?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface StepConfigDispatchPlan {
|
|
65
|
+
run?: ResolvedField;
|
|
66
|
+
env?: Readonly<Record<string, ResolvedField>>;
|
|
67
|
+
agent?: {
|
|
68
|
+
prompt?: ResolvedField;
|
|
69
|
+
model?: ResolvedField;
|
|
70
|
+
provider?: ResolvedField;
|
|
71
|
+
harness?: Harness;
|
|
72
|
+
thinking?: AgentThinking;
|
|
73
|
+
tools?: readonly string[];
|
|
74
|
+
integrations?: readonly MaterializedAgentIntegrationConfigDto[];
|
|
75
|
+
mcpServers?: readonly AgentIntegrationMcpServerConfigDto[];
|
|
76
|
+
};
|
|
77
|
+
trace?: readonly (StepConfigEvaluationTraceEntry | EvaluationTraceLimitEntry)[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface Step {
|
|
81
|
+
id: string;
|
|
82
|
+
jobExecutionId: string;
|
|
83
|
+
key: string | null;
|
|
84
|
+
name: string;
|
|
85
|
+
sourceLocation: StepSourceLocation | null;
|
|
86
|
+
status: StepStatus;
|
|
87
|
+
statusReason: StepStatusReason | null;
|
|
88
|
+
evaluationTrace: readonly PersistedEvaluationTraceEntry[] | null;
|
|
89
|
+
type: string;
|
|
90
|
+
config: Record<string, unknown>;
|
|
91
|
+
condition: WorkflowExpression | null;
|
|
92
|
+
configPlan: StepConfigDispatchPlan | null;
|
|
93
|
+
authoredConfig: Record<string, unknown> | null;
|
|
94
|
+
error: Record<string, unknown> | null;
|
|
95
|
+
position: number;
|
|
96
|
+
version: number;
|
|
97
|
+
// Execution-attempt identity for the current projection: which attempt the
|
|
98
|
+
// status/output/error above reflect. Distinct from `version` (the optimistic
|
|
99
|
+
// row counter). Starts at 1 and is bumped when a step is rewound.
|
|
100
|
+
currentAttempt: number;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Append-only execution history: one row per dispatched attempt of a step. The
|
|
106
|
+
// current projection lives on `Step`; this is the audit trail and the
|
|
107
|
+
// idempotency anchor (unique on (stepId, attempt)).
|
|
108
|
+
export interface StepAttempt {
|
|
109
|
+
id: string;
|
|
110
|
+
stepId: string;
|
|
111
|
+
attempt: number;
|
|
112
|
+
executionOrder: number;
|
|
113
|
+
status: StepAttemptStatus;
|
|
114
|
+
config: Record<string, unknown> | null;
|
|
115
|
+
evaluationTrace: readonly PersistedEvaluationTraceEntry[] | null;
|
|
116
|
+
output: Record<string, unknown> | null;
|
|
117
|
+
response: string | null;
|
|
118
|
+
error: Record<string, unknown> | null;
|
|
119
|
+
exitCode: number | null;
|
|
120
|
+
gateResult: Record<string, unknown> | null;
|
|
121
|
+
restartFeedback: string | null;
|
|
122
|
+
logOutcome: StepAttemptLogOutcome | null;
|
|
123
|
+
startedAt: Date;
|
|
124
|
+
finishedAt: Date | null;
|
|
125
|
+
createdAt: Date;
|
|
126
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {WorkflowModel} from '@shipfox/api-definitions';
|
|
2
|
+
import type {AgentToolMaterializationSnapshot} from '#core/agent-tools.js';
|
|
3
|
+
import type {WorkflowRunStatus} from './workflow-run.js';
|
|
4
|
+
|
|
5
|
+
export type RerunMode = 'all' | 'failed';
|
|
6
|
+
|
|
7
|
+
export interface WorkflowRunAttempt {
|
|
8
|
+
id: string;
|
|
9
|
+
workflowRunId: string;
|
|
10
|
+
attempt: number;
|
|
11
|
+
status: WorkflowRunStatus;
|
|
12
|
+
rerunMode: RerunMode | null;
|
|
13
|
+
rerunByUserId: string | null;
|
|
14
|
+
model: WorkflowModel | null;
|
|
15
|
+
agentToolMaterialization: AgentToolMaterializationSnapshot | null;
|
|
16
|
+
version: number;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
startedAt: Date | null;
|
|
20
|
+
finishedAt: Date | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type {Job} from './job.js';
|
|
2
|
+
import type {JobExecution} from './job-execution.js';
|
|
3
|
+
import type {Step, StepAttempt} from './step.js';
|
|
4
|
+
import type {WorkflowRunAttempt} from './workflow-run-attempt.js';
|
|
5
|
+
|
|
6
|
+
export type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
7
|
+
|
|
8
|
+
export type TerminalWorkflowRunStatus = Extract<
|
|
9
|
+
WorkflowRunStatus,
|
|
10
|
+
'succeeded' | 'failed' | 'cancelled'
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
const TERMINAL_WORKFLOW_RUN_STATUSES = new Set<WorkflowRunStatus>([
|
|
14
|
+
'succeeded',
|
|
15
|
+
'failed',
|
|
16
|
+
'cancelled',
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
export function isWorkflowRunTerminal(
|
|
20
|
+
status: WorkflowRunStatus,
|
|
21
|
+
): status is TerminalWorkflowRunStatus {
|
|
22
|
+
return TERMINAL_WORKFLOW_RUN_STATUSES.has(status);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface WorkflowSourceSnapshot {
|
|
26
|
+
content: string;
|
|
27
|
+
format: 'yaml';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type TriggerPayload =
|
|
31
|
+
| {
|
|
32
|
+
source: 'manual';
|
|
33
|
+
provider?: 'manual' | undefined;
|
|
34
|
+
event: 'fire';
|
|
35
|
+
subscriptionId: string;
|
|
36
|
+
userId: string;
|
|
37
|
+
}
|
|
38
|
+
| {
|
|
39
|
+
source: 'cron';
|
|
40
|
+
provider?: 'cron' | undefined;
|
|
41
|
+
event: 'tick';
|
|
42
|
+
scheduleId: string;
|
|
43
|
+
}
|
|
44
|
+
// Integration sources (github, gitlab, sentry, …) flow through opaquely: the
|
|
45
|
+
// run records what fired it and carries the raw event payload, without the
|
|
46
|
+
// triggers module having to know each source's shape.
|
|
47
|
+
| {
|
|
48
|
+
source: string;
|
|
49
|
+
provider?: string | undefined;
|
|
50
|
+
event: string;
|
|
51
|
+
deliveryId: string;
|
|
52
|
+
data: unknown;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export interface WorkflowRun {
|
|
56
|
+
id: string;
|
|
57
|
+
workspaceId: string;
|
|
58
|
+
projectId: string;
|
|
59
|
+
definitionId: string;
|
|
60
|
+
name: string;
|
|
61
|
+
status: WorkflowRunStatus;
|
|
62
|
+
currentAttempt: number;
|
|
63
|
+
triggerProvider: string | null;
|
|
64
|
+
triggerSource: string;
|
|
65
|
+
triggerEvent: string;
|
|
66
|
+
triggerPayload: TriggerPayload;
|
|
67
|
+
inputs: Record<string, unknown> | null;
|
|
68
|
+
sourceSnapshot: WorkflowSourceSnapshot | null;
|
|
69
|
+
triggerIdempotencyKey: string | null;
|
|
70
|
+
timeoutMs: number;
|
|
71
|
+
version: number;
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
updatedAt: Date;
|
|
74
|
+
startedAt: Date | null;
|
|
75
|
+
finishedAt: Date | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface StepDetail extends Step {
|
|
79
|
+
attempts: StepAttempt[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface JobExecutionDetail extends JobExecution {
|
|
83
|
+
steps: StepDetail[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface WorkflowJobDetail extends Job {
|
|
87
|
+
jobExecutions: JobExecutionDetail[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface WorkflowRunDetail extends WorkflowRun {
|
|
91
|
+
runAttempt: WorkflowRunAttempt;
|
|
92
|
+
latestAttempt: number;
|
|
93
|
+
jobs: WorkflowJobDetail[];
|
|
94
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentConfigUnresolvableError,
|
|
3
|
+
DefinitionNotFoundError,
|
|
4
|
+
InvalidJobRunnerLabelsError,
|
|
5
|
+
isPermanentRunWorkflowError,
|
|
6
|
+
ProjectMismatchError,
|
|
7
|
+
} from './errors.js';
|
|
8
|
+
|
|
9
|
+
describe('isPermanentRunWorkflowError', () => {
|
|
10
|
+
test('is true for a deleted definition', () => {
|
|
11
|
+
const result = isPermanentRunWorkflowError(new DefinitionNotFoundError('def-1'));
|
|
12
|
+
|
|
13
|
+
expect(result).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('is true for a project mismatch', () => {
|
|
17
|
+
const result = isPermanentRunWorkflowError(new ProjectMismatchError('proj-a', 'proj-b'));
|
|
18
|
+
|
|
19
|
+
expect(result).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('is true for unresolvable agent configuration', () => {
|
|
23
|
+
const result = isPermanentRunWorkflowError(new AgentConfigUnresolvableError('def-1'));
|
|
24
|
+
|
|
25
|
+
expect(result).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('is true for invalid job runner labels', () => {
|
|
29
|
+
const result = isPermanentRunWorkflowError(new InvalidJobRunnerLabelsError(['has space']));
|
|
30
|
+
|
|
31
|
+
expect(result).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('is false for a plain error treated as transient', () => {
|
|
35
|
+
const result = isPermanentRunWorkflowError(new Error('database unavailable'));
|
|
36
|
+
|
|
37
|
+
expect(result).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('is false for a non-error thrown value', () => {
|
|
41
|
+
const result = isPermanentRunWorkflowError('boom');
|
|
42
|
+
|
|
43
|
+
expect(result).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import type {JobStatus} from './entities/job.js';
|
|
2
|
+
import type {WorkflowRunStatus} from './entities/workflow-run.js';
|
|
3
|
+
|
|
4
|
+
export class DefinitionNotFoundError extends Error {
|
|
5
|
+
constructor(definitionId: string) {
|
|
6
|
+
super(`Definition not found: ${definitionId}`);
|
|
7
|
+
this.name = 'DefinitionNotFoundError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class ProjectMismatchError extends Error {
|
|
12
|
+
constructor(definitionProjectId: string, requestProjectId: string) {
|
|
13
|
+
super(
|
|
14
|
+
`Definition belongs to project ${definitionProjectId}, but request targets project ${requestProjectId}`,
|
|
15
|
+
);
|
|
16
|
+
this.name = 'ProjectMismatchError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class AgentConfigUnresolvableError extends Error {
|
|
21
|
+
constructor(
|
|
22
|
+
readonly definitionId: string,
|
|
23
|
+
options?: ErrorOptions | undefined,
|
|
24
|
+
) {
|
|
25
|
+
super(`Agent configuration cannot be resolved for definition ${definitionId}`, options);
|
|
26
|
+
this.name = 'AgentConfigUnresolvableError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class AgentIntegrationMaterializationError extends Error {
|
|
31
|
+
constructor(message: string) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = 'AgentIntegrationMaterializationError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type InterpolationUnresolvableField =
|
|
38
|
+
| 'run'
|
|
39
|
+
| 'env'
|
|
40
|
+
| 'agent.prompt'
|
|
41
|
+
| 'agent.model'
|
|
42
|
+
| 'agent.provider'
|
|
43
|
+
| 'job.runner'
|
|
44
|
+
| 'job.outputs'
|
|
45
|
+
| 'job.name'
|
|
46
|
+
| 'step.name'
|
|
47
|
+
| 'step.feedback';
|
|
48
|
+
|
|
49
|
+
export class InterpolationUnresolvableError extends Error {
|
|
50
|
+
readonly field: InterpolationUnresolvableField;
|
|
51
|
+
readonly source: string;
|
|
52
|
+
readonly envKey?: string;
|
|
53
|
+
|
|
54
|
+
constructor(
|
|
55
|
+
readonly definitionId: string,
|
|
56
|
+
params: {
|
|
57
|
+
readonly field: InterpolationUnresolvableField;
|
|
58
|
+
readonly source: string;
|
|
59
|
+
readonly envKey?: string;
|
|
60
|
+
readonly cause?: unknown;
|
|
61
|
+
},
|
|
62
|
+
) {
|
|
63
|
+
super(interpolationUnresolvableMessage(definitionId, params), {cause: params.cause});
|
|
64
|
+
this.name = 'InterpolationUnresolvableError';
|
|
65
|
+
this.field = params.field;
|
|
66
|
+
this.source = params.source;
|
|
67
|
+
if (params.envKey !== undefined) this.envKey = params.envKey;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function interpolationUnresolvableMessage(
|
|
72
|
+
definitionId: string,
|
|
73
|
+
params: {
|
|
74
|
+
readonly field: InterpolationUnresolvableField;
|
|
75
|
+
readonly source: string;
|
|
76
|
+
readonly envKey?: string;
|
|
77
|
+
},
|
|
78
|
+
): string {
|
|
79
|
+
const envSuffix = params.envKey === undefined ? '' : ` (${params.envKey})`;
|
|
80
|
+
return `Workflow interpolation cannot be resolved for definition ${definitionId}: ${params.field}${envSuffix} uses \`${params.source}\`. Use has(x) ? x : '' for optional references.`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* True when a `runWorkflow` failure can never succeed on retry: the definition is gone or
|
|
85
|
+
* the subscription points at the wrong project. Callers (e.g. the trigger dispatcher) use this
|
|
86
|
+
* to skip a permanently-broken target instead of retrying it forever. Every other failure is
|
|
87
|
+
* treated as transient so at-least-once delivery can converge.
|
|
88
|
+
*/
|
|
89
|
+
export function isPermanentRunWorkflowError(error: unknown): boolean {
|
|
90
|
+
return (
|
|
91
|
+
error instanceof DefinitionNotFoundError ||
|
|
92
|
+
error instanceof ProjectMismatchError ||
|
|
93
|
+
error instanceof AgentConfigUnresolvableError ||
|
|
94
|
+
error instanceof AgentIntegrationMaterializationError ||
|
|
95
|
+
error instanceof InterpolationUnresolvableError ||
|
|
96
|
+
error instanceof InvalidJobRunnerLabelsError
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export class JobNotFoundError extends Error {
|
|
101
|
+
constructor(jobId: string) {
|
|
102
|
+
super(`Job not found or has no steps: ${jobId}`);
|
|
103
|
+
this.name = 'JobNotFoundError';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export class JobLeaseNotActiveError extends Error {
|
|
108
|
+
constructor(readonly jobExecutionId: string) {
|
|
109
|
+
super(`Job lease is no longer active: ${jobExecutionId}`);
|
|
110
|
+
this.name = 'JobLeaseNotActiveError';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export class InvalidJobRunnerLabelsError extends Error {
|
|
115
|
+
constructor(readonly labels: readonly string[]) {
|
|
116
|
+
super(`Job runner labels are invalid: ${labels.join(', ')}`);
|
|
117
|
+
this.name = 'InvalidJobRunnerLabelsError';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// The job named by a lease is terminal, so it must not exchange its lease for
|
|
122
|
+
// fresh checkout credentials. Server state is the final gate, not the token.
|
|
123
|
+
export class JobNotActiveError extends Error {
|
|
124
|
+
constructor(
|
|
125
|
+
readonly jobId: string,
|
|
126
|
+
readonly status: JobStatus,
|
|
127
|
+
) {
|
|
128
|
+
super(`Job ${jobId} is ${status} and cannot mint checkout credentials`);
|
|
129
|
+
this.name = 'JobNotActiveError';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export class WorkflowRunNotFoundError extends Error {
|
|
134
|
+
constructor(workflowRunId: string) {
|
|
135
|
+
super(`Workflow run not found: ${workflowRunId}`);
|
|
136
|
+
this.name = 'WorkflowRunNotFoundError';
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export class WorkflowRunNotCancellableError extends Error {
|
|
141
|
+
constructor(
|
|
142
|
+
readonly workflowRunId: string,
|
|
143
|
+
readonly status: WorkflowRunStatus,
|
|
144
|
+
) {
|
|
145
|
+
super(`Workflow run ${workflowRunId} is ${status} and cannot be cancelled`);
|
|
146
|
+
this.name = 'WorkflowRunNotCancellableError';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export class SourceRunNotFoundError extends Error {
|
|
151
|
+
constructor(workflowRunId: string) {
|
|
152
|
+
super(`Source workflow run not found: ${workflowRunId}`);
|
|
153
|
+
this.name = 'SourceRunNotFoundError';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export class RunNotTerminalError extends Error {
|
|
158
|
+
constructor(workflowRunId: string) {
|
|
159
|
+
super(`Workflow run is not terminal: ${workflowRunId}`);
|
|
160
|
+
this.name = 'RunNotTerminalError';
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export class NoFailedJobsError extends Error {
|
|
165
|
+
constructor(workflowRunId: string) {
|
|
166
|
+
super(`Workflow run has no failed or cancelled jobs to re-run: ${workflowRunId}`);
|
|
167
|
+
this.name = 'NoFailedJobsError';
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// The run's project (and therefore its source repository) cannot be resolved, so
|
|
172
|
+
// there is nothing to check out.
|
|
173
|
+
export class CheckoutIntentUnresolvedError extends Error {
|
|
174
|
+
constructor(projectId: string) {
|
|
175
|
+
super(`Checkout intent unresolved: project ${projectId} not found`);
|
|
176
|
+
this.name = 'CheckoutIntentUnresolvedError';
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export class StepNotFoundError extends Error {
|
|
181
|
+
constructor(stepId: string, jobId: string) {
|
|
182
|
+
super(`Step ${stepId} not found in job ${jobId}`);
|
|
183
|
+
this.name = 'StepNotFoundError';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export class StepNotRunningError extends Error {
|
|
188
|
+
constructor(stepId: string, jobId: string) {
|
|
189
|
+
super(`Step ${stepId} in job ${jobId} is not running and cannot accept a result`);
|
|
190
|
+
this.name = 'StepNotRunningError';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// A report whose attempt is ahead of the step's current attempt. The host
|
|
195
|
+
// allocates attempt numbers, so a runner can never report one it was not
|
|
196
|
+
// dispatched — this is a protocol error, not an idempotent no-op.
|
|
197
|
+
export class StepAttemptAheadError extends Error {
|
|
198
|
+
constructor(
|
|
199
|
+
readonly stepId: string,
|
|
200
|
+
readonly jobId: string,
|
|
201
|
+
readonly reportedAttempt: number,
|
|
202
|
+
readonly currentAttempt: number,
|
|
203
|
+
) {
|
|
204
|
+
super(
|
|
205
|
+
`Step ${stepId} in job ${jobId} reported attempt ${reportedAttempt} ahead of current attempt ${currentAttempt}`,
|
|
206
|
+
);
|
|
207
|
+
this.name = 'StepAttemptAheadError';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type {Job, JobStatus} from './entities/job.js';
|
|
2
|
+
export type {
|
|
3
|
+
JobListenerEvent,
|
|
4
|
+
JobListenerEventDisposition,
|
|
5
|
+
} from './entities/job-listener-event.js';
|
|
6
|
+
export type {Step, StepStatus} from './entities/step.js';
|
|
7
|
+
export type {
|
|
8
|
+
TriggerPayload,
|
|
9
|
+
WorkflowRun,
|
|
10
|
+
WorkflowRunStatus,
|
|
11
|
+
WorkflowSourceSnapshot,
|
|
12
|
+
} from './entities/workflow-run.js';
|
|
13
|
+
export {
|
|
14
|
+
AgentConfigUnresolvableError,
|
|
15
|
+
AgentIntegrationMaterializationError,
|
|
16
|
+
DefinitionNotFoundError,
|
|
17
|
+
InterpolationUnresolvableError,
|
|
18
|
+
isPermanentRunWorkflowError,
|
|
19
|
+
JobNotFoundError,
|
|
20
|
+
NoFailedJobsError,
|
|
21
|
+
ProjectMismatchError,
|
|
22
|
+
RunNotTerminalError,
|
|
23
|
+
SourceRunNotFoundError,
|
|
24
|
+
StepNotFoundError,
|
|
25
|
+
StepNotRunningError,
|
|
26
|
+
WorkflowRunNotCancellableError,
|
|
27
|
+
} from './errors.js';
|
|
28
|
+
export type {NextStep, RecordStepResultOutcome, RecordStepResultParams} from './job-execution.js';
|
|
29
|
+
export {nextStepForJob, recordStepResult} from './job-execution.js';
|
|
30
|
+
export {
|
|
31
|
+
type DecideJobActivationInput,
|
|
32
|
+
type DeriveJobSuccessResult,
|
|
33
|
+
decideJobActivation,
|
|
34
|
+
deriveJobExecutionOutputs,
|
|
35
|
+
deriveJobSuccess,
|
|
36
|
+
type JobActivationDecision,
|
|
37
|
+
} from './job-transition/index.js';
|
|
38
|
+
export type {RunWorkflowParams} from './run-workflow.js';
|
|
39
|
+
export {runWorkflow} from './run-workflow.js';
|
|
40
|
+
export {
|
|
41
|
+
type MaterializedWorkflowJob,
|
|
42
|
+
type MaterializedWorkflowStep,
|
|
43
|
+
materializeWorkflowModel,
|
|
44
|
+
modelHasAgentStep,
|
|
45
|
+
} from './step-config/index.js';
|
|
46
|
+
export {
|
|
47
|
+
deriveInitialJobExecutionPlan,
|
|
48
|
+
deriveJobExecutionRunner,
|
|
49
|
+
materializeWorkflowRunJobs,
|
|
50
|
+
} from './workflow-run-creation.js';
|
|
51
|
+
export {
|
|
52
|
+
type ScheduleRuntimeDagInput,
|
|
53
|
+
scheduleRuntimeDag,
|
|
54
|
+
} from './workflow-scheduling/index.js';
|