@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,296 @@
|
|
|
1
|
+
import { getProjectById } from '@shipfox/api-projects';
|
|
2
|
+
import { AgentIntegrationMaterializationError } from './errors.js';
|
|
3
|
+
let services;
|
|
4
|
+
export function setAgentToolMaterializationServices(nextServices) {
|
|
5
|
+
services = nextServices;
|
|
6
|
+
}
|
|
7
|
+
export function clearAgentToolMaterializationServices() {
|
|
8
|
+
services = undefined;
|
|
9
|
+
}
|
|
10
|
+
export async function loadAgentToolMaterializationContext(params) {
|
|
11
|
+
if (!modelHasAgentStepIntegrations(params.model, params.jobs)) return undefined;
|
|
12
|
+
if (services === undefined) {
|
|
13
|
+
throw new AgentIntegrationMaterializationError('Agent tool materialization is not configured');
|
|
14
|
+
}
|
|
15
|
+
const project = await getProjectById(params.projectId);
|
|
16
|
+
if (project === undefined) {
|
|
17
|
+
throw new AgentIntegrationMaterializationError(`Project ${params.projectId} was not found while materializing agent integrations`);
|
|
18
|
+
}
|
|
19
|
+
const [workspaceConnectionSnapshot, defaultConnection] = await Promise.all([
|
|
20
|
+
services.loadWorkspaceConnectionSnapshot(params.workspaceId),
|
|
21
|
+
services.getIntegrationConnectionById(project.sourceConnectionId)
|
|
22
|
+
]);
|
|
23
|
+
if (defaultConnection === undefined) {
|
|
24
|
+
throw new AgentIntegrationMaterializationError(`Source connection ${project.sourceConnectionId} was not found while materializing agent integrations`);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
catalogs: services.catalogs,
|
|
28
|
+
workspaceConnectionSnapshot,
|
|
29
|
+
defaultConnection: {
|
|
30
|
+
id: defaultConnection.id,
|
|
31
|
+
slug: defaultConnection.slug,
|
|
32
|
+
provider: defaultConnection.provider
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function materializeAgentIntegrations(params) {
|
|
37
|
+
const snapshot = findSnapshotStep(params);
|
|
38
|
+
if (snapshot !== undefined) return snapshot.integrations.map(copyMaterializedIntegration);
|
|
39
|
+
if (params.integrations === undefined) return undefined;
|
|
40
|
+
if (params.context === undefined) {
|
|
41
|
+
throw new AgentIntegrationMaterializationError('Agent integrations require materialization context');
|
|
42
|
+
}
|
|
43
|
+
const { context } = params;
|
|
44
|
+
return params.integrations.map((integration)=>materializeAgentIntegration({
|
|
45
|
+
integration,
|
|
46
|
+
context
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
export function createAgentToolMaterializationSnapshot(params) {
|
|
50
|
+
if (params.context === undefined) return null;
|
|
51
|
+
const steps = params.model.jobs.flatMap((job)=>job.steps.flatMap((step)=>{
|
|
52
|
+
if (step.kind !== 'agent' || step.integrations === undefined) return [];
|
|
53
|
+
const integrations = materializeAgentIntegrations({
|
|
54
|
+
jobKey: job.key,
|
|
55
|
+
stepId: step.id,
|
|
56
|
+
integrations: step.integrations,
|
|
57
|
+
context: params.context
|
|
58
|
+
});
|
|
59
|
+
if (integrations === undefined) return [];
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
jobKey: job.key,
|
|
63
|
+
stepId: step.id,
|
|
64
|
+
integrations
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
}));
|
|
68
|
+
return steps.length === 0 ? null : {
|
|
69
|
+
steps
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function findSnapshotStep(params) {
|
|
73
|
+
return params.snapshot?.steps.find((step)=>step.jobKey === params.jobKey && step.stepId === params.stepId);
|
|
74
|
+
}
|
|
75
|
+
function materializeAgentIntegration(params) {
|
|
76
|
+
const connection = resolveConnection(params);
|
|
77
|
+
const catalog = params.context.catalogs.get(connection.provider);
|
|
78
|
+
if (catalog === undefined) {
|
|
79
|
+
throw new AgentIntegrationMaterializationError(`Integration provider ${connection.provider} has no agent tool catalog`);
|
|
80
|
+
}
|
|
81
|
+
const tools = selectTools({
|
|
82
|
+
catalog,
|
|
83
|
+
include: params.integration.include,
|
|
84
|
+
exclude: params.integration.exclude ?? []
|
|
85
|
+
});
|
|
86
|
+
const requiredScope = mergeRequiredScopes(tools.map((tool)=>tool.requiredScope));
|
|
87
|
+
return {
|
|
88
|
+
connectionId: connection.id,
|
|
89
|
+
connectionSlug: connection.slug,
|
|
90
|
+
provider: connection.provider,
|
|
91
|
+
requiredScope,
|
|
92
|
+
tools
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function copyMaterializedIntegration(integration) {
|
|
96
|
+
return {
|
|
97
|
+
...integration,
|
|
98
|
+
requiredScope: [
|
|
99
|
+
...integration.requiredScope
|
|
100
|
+
],
|
|
101
|
+
tools: integration.tools.map((tool)=>({
|
|
102
|
+
...tool,
|
|
103
|
+
requiredScope: [
|
|
104
|
+
...tool.requiredScope
|
|
105
|
+
],
|
|
106
|
+
...tool.methods === undefined ? {} : {
|
|
107
|
+
methods: tool.methods.map((method)=>({
|
|
108
|
+
...method,
|
|
109
|
+
requiredScope: [
|
|
110
|
+
...method.requiredScope
|
|
111
|
+
]
|
|
112
|
+
}))
|
|
113
|
+
}
|
|
114
|
+
}))
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function resolveConnection(params) {
|
|
118
|
+
if (params.integration.connection === undefined) return params.context.defaultConnection;
|
|
119
|
+
const connection = params.context.workspaceConnectionSnapshot.get(params.integration.connection);
|
|
120
|
+
if (connection === undefined) {
|
|
121
|
+
throw new AgentIntegrationMaterializationError(`Integration connection ${params.integration.connection} was not found while materializing agent integrations`);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
id: connection.id,
|
|
125
|
+
slug: params.integration.connection,
|
|
126
|
+
provider: connection.provider
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function selectTools(params) {
|
|
130
|
+
const selected = new Map();
|
|
131
|
+
for (const token of params.include){
|
|
132
|
+
applySelection({
|
|
133
|
+
catalog: params.catalog,
|
|
134
|
+
selected,
|
|
135
|
+
token,
|
|
136
|
+
mode: 'include'
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
for (const token of params.exclude){
|
|
140
|
+
applySelection({
|
|
141
|
+
catalog: params.catalog,
|
|
142
|
+
selected,
|
|
143
|
+
token,
|
|
144
|
+
mode: 'exclude'
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const tools = params.catalog.flatMap((entry)=>{
|
|
148
|
+
const state = selected.get(entry.id);
|
|
149
|
+
if (state === undefined) return [];
|
|
150
|
+
return [
|
|
151
|
+
materializedTool(state)
|
|
152
|
+
];
|
|
153
|
+
});
|
|
154
|
+
if (tools.length === 0) {
|
|
155
|
+
throw new AgentIntegrationMaterializationError('Agent integration selection resolved to no tools');
|
|
156
|
+
}
|
|
157
|
+
return tools;
|
|
158
|
+
}
|
|
159
|
+
function applySelection(params) {
|
|
160
|
+
if (params.token === '*') {
|
|
161
|
+
for (const entry of params.catalog)applyEntrySelection(params, entry);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const match = findCatalogSelection(params.catalog, params.token);
|
|
165
|
+
if (match === undefined) {
|
|
166
|
+
throw new AgentIntegrationMaterializationError(`Unknown integration tool: ${params.token}`);
|
|
167
|
+
}
|
|
168
|
+
applyEntrySelection(params, match.entry, match.method);
|
|
169
|
+
}
|
|
170
|
+
function applyEntrySelection(params, entry, method) {
|
|
171
|
+
if (params.mode === 'exclude') {
|
|
172
|
+
excludeEntrySelection(params.selected, entry, method);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const state = params.selected.get(entry.id) ?? {
|
|
176
|
+
entry,
|
|
177
|
+
methods: new Map(),
|
|
178
|
+
selectedStandalone: false
|
|
179
|
+
};
|
|
180
|
+
if (entry.methods === undefined) {
|
|
181
|
+
state.selectedStandalone = true;
|
|
182
|
+
} else if (method === undefined) {
|
|
183
|
+
for (const candidate of entry.methods)state.methods.set(candidate.id, candidate);
|
|
184
|
+
} else {
|
|
185
|
+
state.methods.set(method.id, method);
|
|
186
|
+
}
|
|
187
|
+
params.selected.set(entry.id, state);
|
|
188
|
+
}
|
|
189
|
+
function excludeEntrySelection(selected, entry, method) {
|
|
190
|
+
if (method === undefined) {
|
|
191
|
+
selected.delete(entry.id);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const state = selected.get(entry.id);
|
|
195
|
+
if (state === undefined) return;
|
|
196
|
+
state.methods.delete(method.id);
|
|
197
|
+
if (!state.selectedStandalone && state.methods.size === 0) selected.delete(entry.id);
|
|
198
|
+
}
|
|
199
|
+
function findCatalogSelection(catalog, token) {
|
|
200
|
+
const entry = catalog.find((candidate)=>candidate.id === token);
|
|
201
|
+
if (entry !== undefined) return {
|
|
202
|
+
entry
|
|
203
|
+
};
|
|
204
|
+
const wildcardSuffix = '.*';
|
|
205
|
+
if (token.endsWith(wildcardSuffix)) {
|
|
206
|
+
const family = token.slice(0, -wildcardSuffix.length);
|
|
207
|
+
const familyEntry = catalog.find((candidate)=>candidate.id === family);
|
|
208
|
+
return familyEntry === undefined ? undefined : {
|
|
209
|
+
entry: familyEntry
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
const dotIndex = token.indexOf('.');
|
|
213
|
+
if (dotIndex < 1) return undefined;
|
|
214
|
+
const family = token.slice(0, dotIndex);
|
|
215
|
+
const methodId = token.slice(dotIndex + 1);
|
|
216
|
+
const familyEntry = catalog.find((candidate)=>candidate.id === family);
|
|
217
|
+
const method = familyEntry?.methods?.find((candidate)=>candidate.id === methodId);
|
|
218
|
+
if (familyEntry === undefined || method === undefined) return undefined;
|
|
219
|
+
return {
|
|
220
|
+
entry: familyEntry,
|
|
221
|
+
method
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function materializedTool(state) {
|
|
225
|
+
if (state.entry.methods === undefined) {
|
|
226
|
+
return {
|
|
227
|
+
id: state.entry.id,
|
|
228
|
+
sensitivity: state.entry.sensitivity,
|
|
229
|
+
sensitive: state.entry.sensitive,
|
|
230
|
+
requiredScope: normalizeRequiredScope(state.entry.requiredScope),
|
|
231
|
+
inputSchema: state.entry.inputSchema,
|
|
232
|
+
...state.entry.outputSchema === undefined ? {} : {
|
|
233
|
+
outputSchema: state.entry.outputSchema
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
const methods = state.entry.methods.filter((method)=>state.methods.has(method.id)).map((method)=>({
|
|
238
|
+
id: method.id,
|
|
239
|
+
token: `${state.entry.id}.${method.id}`,
|
|
240
|
+
description: method.description,
|
|
241
|
+
sensitivity: method.sensitivity,
|
|
242
|
+
sensitive: method.sensitive,
|
|
243
|
+
requiredScope: normalizeRequiredScope(method.requiredScope)
|
|
244
|
+
}));
|
|
245
|
+
return {
|
|
246
|
+
id: state.entry.id,
|
|
247
|
+
sensitivity: methods.some((method)=>method.sensitivity === 'write') ? 'write' : 'read',
|
|
248
|
+
sensitive: methods.some((method)=>method.sensitive),
|
|
249
|
+
requiredScope: mergeRequiredScopes(methods.map((method)=>method.requiredScope)),
|
|
250
|
+
inputSchema: state.entry.inputSchema,
|
|
251
|
+
...state.entry.outputSchema === undefined ? {} : {
|
|
252
|
+
outputSchema: state.entry.outputSchema
|
|
253
|
+
},
|
|
254
|
+
methods
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function mergeRequiredScopes(scopes) {
|
|
258
|
+
const items = scopes.flatMap(normalizeRequiredScope);
|
|
259
|
+
if (items.every(isPermissionScope)) {
|
|
260
|
+
const byPermission = new Map();
|
|
261
|
+
for (const item of items){
|
|
262
|
+
const existing = byPermission.get(item.permission);
|
|
263
|
+
if (existing === 'write') continue;
|
|
264
|
+
byPermission.set(item.permission, item.access);
|
|
265
|
+
}
|
|
266
|
+
return [
|
|
267
|
+
...byPermission.entries()
|
|
268
|
+
].map(([permission, access])=>({
|
|
269
|
+
permission,
|
|
270
|
+
access
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
const deduped = new Map();
|
|
274
|
+
for (const item of items)deduped.set(JSON.stringify(item), item);
|
|
275
|
+
return [
|
|
276
|
+
...deduped.values()
|
|
277
|
+
];
|
|
278
|
+
}
|
|
279
|
+
function normalizeRequiredScope(scope) {
|
|
280
|
+
return Array.isArray(scope) ? [
|
|
281
|
+
...scope
|
|
282
|
+
] : [
|
|
283
|
+
scope
|
|
284
|
+
];
|
|
285
|
+
}
|
|
286
|
+
function isPermissionScope(value) {
|
|
287
|
+
if (typeof value !== 'object' || value === null) return false;
|
|
288
|
+
const candidate = value;
|
|
289
|
+
return typeof candidate.permission === 'string' && (candidate.access === 'read' || candidate.access === 'write');
|
|
290
|
+
}
|
|
291
|
+
function modelHasAgentStepIntegrations(model, jobs) {
|
|
292
|
+
if (model === null) return false;
|
|
293
|
+
return (jobs ?? model.jobs).some((job)=>job.steps.some((step)=>step.kind === 'agent' && step.integrations !== undefined));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
//# sourceMappingURL=agent-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/agent-tools.ts"],"sourcesContent":["import type {\n MaterializedAgentIntegrationConfigDto,\n MaterializedAgentIntegrationToolConfigDto,\n} from '@shipfox/api-agent-dto';\nimport type {WorkflowModel} from '@shipfox/api-definitions';\nimport type {\n AgentToolCatalogEntry,\n AgentToolCatalogMethod,\n AgentToolCatalogs,\n GetIntegrationConnectionByIdFn,\n IntegrationProviderKind,\n LoadWorkspaceConnectionSnapshot,\n WorkspaceConnectionSnapshot,\n} from '@shipfox/api-integration-core';\nimport {getProjectById} from '@shipfox/api-projects';\nimport {AgentIntegrationMaterializationError} from './errors.js';\n\ntype WorkflowModelJob = WorkflowModel['jobs'][number];\ntype WorkflowModelAgentStep = Extract<WorkflowModelJob['steps'][number], {kind: 'agent'}>;\ntype WorkflowModelStepIntegration = NonNullable<WorkflowModelAgentStep['integrations']>[number];\n\ninterface AgentToolMaterializationServices {\n readonly catalogs: AgentToolCatalogs;\n readonly loadWorkspaceConnectionSnapshot: LoadWorkspaceConnectionSnapshot;\n readonly getIntegrationConnectionById: GetIntegrationConnectionByIdFn;\n}\n\nexport interface AgentToolMaterializationContext {\n readonly catalogs: AgentToolCatalogs;\n readonly workspaceConnectionSnapshot: WorkspaceConnectionSnapshot;\n readonly defaultConnection: {\n readonly id: string;\n readonly slug: string;\n readonly provider: IntegrationProviderKind;\n };\n}\n\nexport interface AgentToolMaterializationSnapshot {\n readonly steps: readonly AgentToolMaterializationSnapshotStep[];\n}\n\nexport interface AgentToolMaterializationSnapshotStep {\n readonly jobKey: string;\n readonly stepId: string;\n readonly integrations: readonly MaterializedAgentIntegrationConfigDto[];\n}\n\ninterface SelectedToolState {\n readonly entry: AgentToolCatalogEntry;\n readonly methods: Map<string, AgentToolCatalogMethod>;\n selectedStandalone: boolean;\n}\n\nlet services: AgentToolMaterializationServices | undefined;\n\nexport function setAgentToolMaterializationServices(\n nextServices: AgentToolMaterializationServices,\n): void {\n services = nextServices;\n}\n\nexport function clearAgentToolMaterializationServices(): void {\n services = undefined;\n}\n\nexport async function loadAgentToolMaterializationContext(params: {\n readonly model: WorkflowModel | null;\n readonly workspaceId: string;\n readonly projectId: string;\n readonly jobs?: readonly WorkflowModelJob[] | undefined;\n}): Promise<AgentToolMaterializationContext | undefined> {\n if (!modelHasAgentStepIntegrations(params.model, params.jobs)) return undefined;\n if (services === undefined) {\n throw new AgentIntegrationMaterializationError('Agent tool materialization is not configured');\n }\n\n const project = await getProjectById(params.projectId);\n if (project === undefined) {\n throw new AgentIntegrationMaterializationError(\n `Project ${params.projectId} was not found while materializing agent integrations`,\n );\n }\n\n const [workspaceConnectionSnapshot, defaultConnection] = await Promise.all([\n services.loadWorkspaceConnectionSnapshot(params.workspaceId),\n services.getIntegrationConnectionById(project.sourceConnectionId),\n ]);\n if (defaultConnection === undefined) {\n throw new AgentIntegrationMaterializationError(\n `Source connection ${project.sourceConnectionId} was not found while materializing agent integrations`,\n );\n }\n\n return {\n catalogs: services.catalogs,\n workspaceConnectionSnapshot,\n defaultConnection: {\n id: defaultConnection.id,\n slug: defaultConnection.slug,\n provider: defaultConnection.provider,\n },\n };\n}\n\nexport function materializeAgentIntegrations(params: {\n readonly jobKey: string;\n readonly stepId: string;\n readonly integrations: readonly WorkflowModelStepIntegration[] | undefined;\n readonly context: AgentToolMaterializationContext | undefined;\n readonly snapshot?: AgentToolMaterializationSnapshot | null | undefined;\n}): MaterializedAgentIntegrationConfigDto[] | undefined {\n const snapshot = findSnapshotStep(params);\n if (snapshot !== undefined) return snapshot.integrations.map(copyMaterializedIntegration);\n if (params.integrations === undefined) return undefined;\n if (params.context === undefined) {\n throw new AgentIntegrationMaterializationError(\n 'Agent integrations require materialization context',\n );\n }\n const {context} = params;\n\n return params.integrations.map((integration) =>\n materializeAgentIntegration({integration, context}),\n );\n}\n\nexport function createAgentToolMaterializationSnapshot(params: {\n readonly model: WorkflowModel;\n readonly context: AgentToolMaterializationContext | undefined;\n}): AgentToolMaterializationSnapshot | null {\n if (params.context === undefined) return null;\n\n const steps = params.model.jobs.flatMap((job) =>\n job.steps.flatMap((step) => {\n if (step.kind !== 'agent' || step.integrations === undefined) return [];\n const integrations = materializeAgentIntegrations({\n jobKey: job.key,\n stepId: step.id,\n integrations: step.integrations,\n context: params.context,\n });\n if (integrations === undefined) return [];\n return [\n {\n jobKey: job.key,\n stepId: step.id,\n integrations,\n },\n ];\n }),\n );\n\n return steps.length === 0 ? null : {steps};\n}\n\nfunction findSnapshotStep(params: {\n readonly jobKey: string;\n readonly stepId: string;\n readonly snapshot?: AgentToolMaterializationSnapshot | null | undefined;\n}): AgentToolMaterializationSnapshotStep | undefined {\n return params.snapshot?.steps.find(\n (step) => step.jobKey === params.jobKey && step.stepId === params.stepId,\n );\n}\n\nfunction materializeAgentIntegration(params: {\n readonly integration: WorkflowModelStepIntegration;\n readonly context: AgentToolMaterializationContext;\n}): MaterializedAgentIntegrationConfigDto {\n const connection = resolveConnection(params);\n const catalog = params.context.catalogs.get(connection.provider);\n if (catalog === undefined) {\n throw new AgentIntegrationMaterializationError(\n `Integration provider ${connection.provider} has no agent tool catalog`,\n );\n }\n\n const tools = selectTools({\n catalog,\n include: params.integration.include,\n exclude: params.integration.exclude ?? [],\n });\n const requiredScope = mergeRequiredScopes(tools.map((tool) => tool.requiredScope));\n\n return {\n connectionId: connection.id,\n connectionSlug: connection.slug,\n provider: connection.provider,\n requiredScope,\n tools,\n };\n}\n\nfunction copyMaterializedIntegration(\n integration: MaterializedAgentIntegrationConfigDto,\n): MaterializedAgentIntegrationConfigDto {\n return {\n ...integration,\n requiredScope: [...integration.requiredScope],\n tools: integration.tools.map((tool) => ({\n ...tool,\n requiredScope: [...tool.requiredScope],\n ...(tool.methods === undefined\n ? {}\n : {\n methods: tool.methods.map((method) => ({\n ...method,\n requiredScope: [...method.requiredScope],\n })),\n }),\n })),\n };\n}\n\nfunction resolveConnection(params: {\n readonly integration: WorkflowModelStepIntegration;\n readonly context: AgentToolMaterializationContext;\n}): AgentToolMaterializationContext['defaultConnection'] {\n if (params.integration.connection === undefined) return params.context.defaultConnection;\n\n const connection = params.context.workspaceConnectionSnapshot.get(params.integration.connection);\n if (connection === undefined) {\n throw new AgentIntegrationMaterializationError(\n `Integration connection ${params.integration.connection} was not found while materializing agent integrations`,\n );\n }\n return {\n id: connection.id,\n slug: params.integration.connection,\n provider: connection.provider,\n };\n}\n\nfunction selectTools(params: {\n readonly catalog: readonly AgentToolCatalogEntry[];\n readonly include: readonly string[];\n readonly exclude: readonly string[];\n}): MaterializedAgentIntegrationToolConfigDto[] {\n const selected = new Map<string, SelectedToolState>();\n\n for (const token of params.include) {\n applySelection({catalog: params.catalog, selected, token, mode: 'include'});\n }\n for (const token of params.exclude) {\n applySelection({catalog: params.catalog, selected, token, mode: 'exclude'});\n }\n\n const tools = params.catalog.flatMap((entry) => {\n const state = selected.get(entry.id);\n if (state === undefined) return [];\n return [materializedTool(state)];\n });\n if (tools.length === 0) {\n throw new AgentIntegrationMaterializationError(\n 'Agent integration selection resolved to no tools',\n );\n }\n return tools;\n}\n\nfunction applySelection(params: {\n readonly catalog: readonly AgentToolCatalogEntry[];\n readonly selected: Map<string, SelectedToolState>;\n readonly token: string;\n readonly mode: 'include' | 'exclude';\n}): void {\n if (params.token === '*') {\n for (const entry of params.catalog) applyEntrySelection(params, entry);\n return;\n }\n\n const match = findCatalogSelection(params.catalog, params.token);\n if (match === undefined) {\n throw new AgentIntegrationMaterializationError(`Unknown integration tool: ${params.token}`);\n }\n applyEntrySelection(params, match.entry, match.method);\n}\n\nfunction applyEntrySelection(\n params: {\n readonly selected: Map<string, SelectedToolState>;\n readonly token: string;\n readonly mode: 'include' | 'exclude';\n },\n entry: AgentToolCatalogEntry,\n method?: AgentToolCatalogMethod | undefined,\n): void {\n if (params.mode === 'exclude') {\n excludeEntrySelection(params.selected, entry, method);\n return;\n }\n\n const state =\n params.selected.get(entry.id) ??\n ({entry, methods: new Map(), selectedStandalone: false} satisfies SelectedToolState);\n if (entry.methods === undefined) {\n state.selectedStandalone = true;\n } else if (method === undefined) {\n for (const candidate of entry.methods) state.methods.set(candidate.id, candidate);\n } else {\n state.methods.set(method.id, method);\n }\n params.selected.set(entry.id, state);\n}\n\nfunction excludeEntrySelection(\n selected: Map<string, SelectedToolState>,\n entry: AgentToolCatalogEntry,\n method?: AgentToolCatalogMethod | undefined,\n): void {\n if (method === undefined) {\n selected.delete(entry.id);\n return;\n }\n\n const state = selected.get(entry.id);\n if (state === undefined) return;\n state.methods.delete(method.id);\n if (!state.selectedStandalone && state.methods.size === 0) selected.delete(entry.id);\n}\n\nfunction findCatalogSelection(\n catalog: readonly AgentToolCatalogEntry[],\n token: string,\n):\n | {readonly entry: AgentToolCatalogEntry; readonly method?: AgentToolCatalogMethod | undefined}\n | undefined {\n const entry = catalog.find((candidate) => candidate.id === token);\n if (entry !== undefined) return {entry};\n\n const wildcardSuffix = '.*';\n if (token.endsWith(wildcardSuffix)) {\n const family = token.slice(0, -wildcardSuffix.length);\n const familyEntry = catalog.find((candidate) => candidate.id === family);\n return familyEntry === undefined ? undefined : {entry: familyEntry};\n }\n\n const dotIndex = token.indexOf('.');\n if (dotIndex < 1) return undefined;\n const family = token.slice(0, dotIndex);\n const methodId = token.slice(dotIndex + 1);\n const familyEntry = catalog.find((candidate) => candidate.id === family);\n const method = familyEntry?.methods?.find((candidate) => candidate.id === methodId);\n if (familyEntry === undefined || method === undefined) return undefined;\n return {entry: familyEntry, method};\n}\n\nfunction materializedTool(state: SelectedToolState): MaterializedAgentIntegrationToolConfigDto {\n if (state.entry.methods === undefined) {\n return {\n id: state.entry.id,\n sensitivity: state.entry.sensitivity,\n sensitive: state.entry.sensitive,\n requiredScope: normalizeRequiredScope(state.entry.requiredScope),\n inputSchema: state.entry.inputSchema,\n ...(state.entry.outputSchema === undefined ? {} : {outputSchema: state.entry.outputSchema}),\n };\n }\n\n const methods = state.entry.methods\n .filter((method) => state.methods.has(method.id))\n .map((method) => ({\n id: method.id,\n token: `${state.entry.id}.${method.id}`,\n description: method.description,\n sensitivity: method.sensitivity,\n sensitive: method.sensitive,\n requiredScope: normalizeRequiredScope(method.requiredScope),\n }));\n\n return {\n id: state.entry.id,\n sensitivity: methods.some((method) => method.sensitivity === 'write') ? 'write' : 'read',\n sensitive: methods.some((method) => method.sensitive),\n requiredScope: mergeRequiredScopes(methods.map((method) => method.requiredScope)),\n inputSchema: state.entry.inputSchema,\n ...(state.entry.outputSchema === undefined ? {} : {outputSchema: state.entry.outputSchema}),\n methods,\n };\n}\n\nfunction mergeRequiredScopes(scopes: readonly unknown[]): unknown[] {\n const items = scopes.flatMap(normalizeRequiredScope);\n if (items.every(isPermissionScope)) {\n const byPermission = new Map<string, 'read' | 'write'>();\n for (const item of items) {\n const existing = byPermission.get(item.permission);\n if (existing === 'write') continue;\n byPermission.set(item.permission, item.access);\n }\n return [...byPermission.entries()].map(([permission, access]) => ({permission, access}));\n }\n\n const deduped = new Map<string, unknown>();\n for (const item of items) deduped.set(JSON.stringify(item), item);\n return [...deduped.values()];\n}\n\nfunction normalizeRequiredScope(scope: unknown): unknown[] {\n return Array.isArray(scope) ? [...scope] : [scope];\n}\n\nfunction isPermissionScope(\n value: unknown,\n): value is {permission: string; access: 'read' | 'write'} {\n if (typeof value !== 'object' || value === null) return false;\n const candidate = value as {permission?: unknown; access?: unknown};\n return (\n typeof candidate.permission === 'string' &&\n (candidate.access === 'read' || candidate.access === 'write')\n );\n}\n\nfunction modelHasAgentStepIntegrations(\n model: WorkflowModel | null,\n jobs: readonly WorkflowModelJob[] | undefined,\n): boolean {\n if (model === null) return false;\n return (jobs ?? model.jobs).some((job) =>\n job.steps.some((step) => step.kind === 'agent' && step.integrations !== undefined),\n );\n}\n"],"names":["getProjectById","AgentIntegrationMaterializationError","services","setAgentToolMaterializationServices","nextServices","clearAgentToolMaterializationServices","undefined","loadAgentToolMaterializationContext","params","modelHasAgentStepIntegrations","model","jobs","project","projectId","workspaceConnectionSnapshot","defaultConnection","Promise","all","loadWorkspaceConnectionSnapshot","workspaceId","getIntegrationConnectionById","sourceConnectionId","catalogs","id","slug","provider","materializeAgentIntegrations","snapshot","findSnapshotStep","integrations","map","copyMaterializedIntegration","context","integration","materializeAgentIntegration","createAgentToolMaterializationSnapshot","steps","flatMap","job","step","kind","jobKey","key","stepId","length","find","connection","resolveConnection","catalog","get","tools","selectTools","include","exclude","requiredScope","mergeRequiredScopes","tool","connectionId","connectionSlug","methods","method","selected","Map","token","applySelection","mode","entry","state","materializedTool","applyEntrySelection","match","findCatalogSelection","excludeEntrySelection","selectedStandalone","candidate","set","delete","size","wildcardSuffix","endsWith","family","slice","familyEntry","dotIndex","indexOf","methodId","sensitivity","sensitive","normalizeRequiredScope","inputSchema","outputSchema","filter","has","description","some","scopes","items","every","isPermissionScope","byPermission","item","existing","permission","access","entries","deduped","JSON","stringify","values","scope","Array","isArray","value"],"mappings":"AAcA,SAAQA,cAAc,QAAO,wBAAwB;AACrD,SAAQC,oCAAoC,QAAO,cAAc;AAsCjE,IAAIC;AAEJ,OAAO,SAASC,oCACdC,YAA8C;IAE9CF,WAAWE;AACb;AAEA,OAAO,SAASC;IACdH,WAAWI;AACb;AAEA,OAAO,eAAeC,oCAAoCC,MAKzD;IACC,IAAI,CAACC,8BAA8BD,OAAOE,KAAK,EAAEF,OAAOG,IAAI,GAAG,OAAOL;IACtE,IAAIJ,aAAaI,WAAW;QAC1B,MAAM,IAAIL,qCAAqC;IACjD;IAEA,MAAMW,UAAU,MAAMZ,eAAeQ,OAAOK,SAAS;IACrD,IAAID,YAAYN,WAAW;QACzB,MAAM,IAAIL,qCACR,CAAC,QAAQ,EAAEO,OAAOK,SAAS,CAAC,qDAAqD,CAAC;IAEtF;IAEA,MAAM,CAACC,6BAA6BC,kBAAkB,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACzEf,SAASgB,+BAA+B,CAACV,OAAOW,WAAW;QAC3DjB,SAASkB,4BAA4B,CAACR,QAAQS,kBAAkB;KACjE;IACD,IAAIN,sBAAsBT,WAAW;QACnC,MAAM,IAAIL,qCACR,CAAC,kBAAkB,EAAEW,QAAQS,kBAAkB,CAAC,qDAAqD,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ACzB,KAAK,MAAMsC,QAAQJ,MAAO;YACxB,MAAMK,WAAWF,aAAalD,GAAG,CAACmD,KAAKE,UAAU;YACjD,IAAID,aAAa,SAAS;YAC1BF,aAAaxB,GAAG,CAACyB,KAAKE,UAAU,EAAEF,KAAKG,MAAM;QAC/C;QACA,OAAO;eAAIJ,aAAaK,OAAO;SAAG,CAAC1E,GAAG,CAAC,CAAC,CAACwE,YAAYC,OAAO,GAAM,CAAA;gBAACD;gBAAYC;YAAM,CAAA;IACvF;IAEA,MAAME,UAAU,IAAI3C;IACpB,KAAK,MAAMsC,QAAQJ,MAAOS,QAAQ9B,GAAG,CAAC+B,KAAKC,SAAS,CAACP,OAAOA;IAC5D,OAAO;WAAIK,QAAQG,MAAM;KAAG;AAC9B;AAEA,SAASpB,uBAAuBqB,KAAc;IAC5C,OAAOC,MAAMC,OAAO,CAACF,SAAS;WAAIA;KAAM,GAAG;QAACA;KAAM;AACpD;AAEA,SAASX,kBACPc,KAAc;IAEd,IAAI,OAAOA,UAAU,YAAYA,UAAU,MAAM,OAAO;IACxD,MAAMtC,YAAYsC;IAClB,OACE,OAAOtC,UAAU4B,UAAU,KAAK,YAC/B5B,CAAAA,UAAU6B,MAAM,KAAK,UAAU7B,UAAU6B,MAAM,KAAK,OAAM;AAE/D;AAEA,SAAS9F,8BACPC,KAA2B,EAC3BC,IAA6C;IAE7C,IAAID,UAAU,MAAM,OAAO;IAC3B,OAAO,AAACC,CAAAA,QAAQD,MAAMC,IAAI,AAAD,EAAGmF,IAAI,CAAC,CAACxD,MAChCA,IAAIF,KAAK,CAAC0D,IAAI,CAAC,CAACvD,OAASA,KAAKC,IAAI,KAAK,WAAWD,KAAKV,YAAY,KAAKvB;AAE5E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CheckoutSpec, IntegrationSourceControlService } from '@shipfox/api-integration-core';
|
|
2
|
+
export interface CheckoutIntent {
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
connectionId: string;
|
|
5
|
+
externalRepositoryId: string;
|
|
6
|
+
persistCredentials: boolean;
|
|
7
|
+
permissions: {
|
|
8
|
+
contents: 'read' | 'write';
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolves what to check out for a job, keyed off the authoritative `jobId`
|
|
13
|
+
* (`workflowRunId`/`workflowRunAttemptId`/`workspaceId` in the lease claim are informational).
|
|
14
|
+
* Chain: job → attempt → run → project source metadata. Credential-free.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveCheckoutIntent(jobId: string): Promise<CheckoutIntent>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the job's checkout intent and exchanges it for a short-lived,
|
|
19
|
+
* scoped checkout spec. `ref` is left undefined so the provider defaults to the
|
|
20
|
+
* repository's default branch.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createJobCheckoutSpec({ jobId, sourceControl, }: {
|
|
23
|
+
jobId: string;
|
|
24
|
+
sourceControl: IntegrationSourceControlService;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
spec: CheckoutSpec;
|
|
27
|
+
persistCredentials: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=checkout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/core/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,+BAA+B,EAAC,MAAM,+BAA+B,CAAC;AASjG,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE;QAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;CAC3C;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAiBlF;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,KAAK,EACL,aAAa,GACd,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,+BAA+B,CAAC;CAChD,GAAG,OAAO,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,kBAAkB,EAAE,OAAO,CAAA;CAAC,CAAC,CAU7D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getProjectById } from '@shipfox/api-projects';
|
|
2
|
+
import { getJobById, getWorkflowRunByAttemptId } from '#db/workflow-runs.js';
|
|
3
|
+
import { CheckoutIntentUnresolvedError, JobNotFoundError, WorkflowRunNotFoundError } from './errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resolves what to check out for a job, keyed off the authoritative `jobId`
|
|
6
|
+
* (`workflowRunId`/`workflowRunAttemptId`/`workspaceId` in the lease claim are informational).
|
|
7
|
+
* Chain: job → attempt → run → project source metadata. Credential-free.
|
|
8
|
+
*/ export async function resolveCheckoutIntent(jobId) {
|
|
9
|
+
const job = await getJobById(jobId);
|
|
10
|
+
if (!job) throw new JobNotFoundError(jobId);
|
|
11
|
+
const run = await getWorkflowRunByAttemptId(job.workflowRunAttemptId);
|
|
12
|
+
if (!run) throw new WorkflowRunNotFoundError(job.workflowRunAttemptId);
|
|
13
|
+
const project = await getProjectById(run.projectId);
|
|
14
|
+
if (!project) throw new CheckoutIntentUnresolvedError(run.projectId);
|
|
15
|
+
return {
|
|
16
|
+
workspaceId: project.workspaceId,
|
|
17
|
+
connectionId: project.sourceConnectionId,
|
|
18
|
+
externalRepositoryId: project.sourceExternalRepositoryId,
|
|
19
|
+
persistCredentials: job.checkout.persistCredentials,
|
|
20
|
+
permissions: job.checkout.permissions
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the job's checkout intent and exchanges it for a short-lived,
|
|
25
|
+
* scoped checkout spec. `ref` is left undefined so the provider defaults to the
|
|
26
|
+
* repository's default branch.
|
|
27
|
+
*/ export async function createJobCheckoutSpec({ jobId, sourceControl }) {
|
|
28
|
+
const intent = await resolveCheckoutIntent(jobId);
|
|
29
|
+
const spec = await sourceControl.createCheckoutSpec({
|
|
30
|
+
workspaceId: intent.workspaceId,
|
|
31
|
+
connectionId: intent.connectionId,
|
|
32
|
+
externalRepositoryId: intent.externalRepositoryId,
|
|
33
|
+
ref: undefined,
|
|
34
|
+
permissions: intent.permissions
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
spec,
|
|
38
|
+
persistCredentials: intent.persistCredentials
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=checkout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/checkout.ts"],"sourcesContent":["import type {CheckoutSpec, IntegrationSourceControlService} from '@shipfox/api-integration-core';\nimport {getProjectById} from '@shipfox/api-projects';\nimport {getJobById, getWorkflowRunByAttemptId} from '#db/workflow-runs.js';\nimport {\n CheckoutIntentUnresolvedError,\n JobNotFoundError,\n WorkflowRunNotFoundError,\n} from './errors.js';\n\nexport interface CheckoutIntent {\n workspaceId: string;\n connectionId: string;\n externalRepositoryId: string;\n persistCredentials: boolean;\n permissions: {contents: 'read' | 'write'};\n}\n\n/**\n * Resolves what to check out for a job, keyed off the authoritative `jobId`\n * (`workflowRunId`/`workflowRunAttemptId`/`workspaceId` in the lease claim are informational).\n * Chain: job → attempt → run → project source metadata. Credential-free.\n */\nexport async function resolveCheckoutIntent(jobId: string): Promise<CheckoutIntent> {\n const job = await getJobById(jobId);\n if (!job) throw new JobNotFoundError(jobId);\n\n const run = await getWorkflowRunByAttemptId(job.workflowRunAttemptId);\n if (!run) throw new WorkflowRunNotFoundError(job.workflowRunAttemptId);\n\n const project = await getProjectById(run.projectId);\n if (!project) throw new CheckoutIntentUnresolvedError(run.projectId);\n\n return {\n workspaceId: project.workspaceId,\n connectionId: project.sourceConnectionId,\n externalRepositoryId: project.sourceExternalRepositoryId,\n persistCredentials: job.checkout.persistCredentials,\n permissions: job.checkout.permissions,\n };\n}\n\n/**\n * Resolves the job's checkout intent and exchanges it for a short-lived,\n * scoped checkout spec. `ref` is left undefined so the provider defaults to the\n * repository's default branch.\n */\nexport async function createJobCheckoutSpec({\n jobId,\n sourceControl,\n}: {\n jobId: string;\n sourceControl: IntegrationSourceControlService;\n}): Promise<{spec: CheckoutSpec; persistCredentials: boolean}> {\n const intent = await resolveCheckoutIntent(jobId);\n const spec = await sourceControl.createCheckoutSpec({\n workspaceId: intent.workspaceId,\n connectionId: intent.connectionId,\n externalRepositoryId: intent.externalRepositoryId,\n ref: undefined,\n permissions: intent.permissions,\n });\n return {spec, persistCredentials: intent.persistCredentials};\n}\n"],"names":["getProjectById","getJobById","getWorkflowRunByAttemptId","CheckoutIntentUnresolvedError","JobNotFoundError","WorkflowRunNotFoundError","resolveCheckoutIntent","jobId","job","run","workflowRunAttemptId","project","projectId","workspaceId","connectionId","sourceConnectionId","externalRepositoryId","sourceExternalRepositoryId","persistCredentials","checkout","permissions","createJobCheckoutSpec","sourceControl","intent","spec","createCheckoutSpec","ref","undefined"],"mappings":"AACA,SAAQA,cAAc,QAAO,wBAAwB;AACrD,SAAQC,UAAU,EAAEC,yBAAyB,QAAO,uBAAuB;AAC3E,SACEC,6BAA6B,EAC7BC,gBAAgB,EAChBC,wBAAwB,QACnB,cAAc;AAUrB;;;;CAIC,GACD,OAAO,eAAeC,sBAAsBC,KAAa;IACvD,MAAMC,MAAM,MAAMP,WAAWM;IAC7B,IAAI,CAACC,KAAK,MAAM,IAAIJ,iBAAiBG;IAErC,MAAME,MAAM,MAAMP,0BAA0BM,IAAIE,oBAAoB;IACpE,IAAI,CAACD,KAAK,MAAM,IAAIJ,yBAAyBG,IAAIE,oBAAoB;IAErE,MAAMC,UAAU,MAAMX,eAAeS,IAAIG,SAAS;IAClD,IAAI,CAACD,SAAS,MAAM,IAAIR,8BAA8BM,IAAIG,SAAS;IAEnE,OAAO;QACLC,aAAaF,QAAQE,WAAW;QAChCC,cAAcH,QAAQI,kBAAkB;QACxCC,sBAAsBL,QAAQM,0BAA0B;QACxDC,oBAAoBV,IAAIW,QAAQ,CAACD,kBAAkB;QACnDE,aAAaZ,IAAIW,QAAQ,CAACC,WAAW;IACvC;AACF;AAEA;;;;CAIC,GACD,OAAO,eAAeC,sBAAsB,EAC1Cd,KAAK,EACLe,aAAa,EAId;IACC,MAAMC,SAAS,MAAMjB,sBAAsBC;IAC3C,MAAMiB,OAAO,MAAMF,cAAcG,kBAAkB,CAAC;QAClDZ,aAAaU,OAAOV,WAAW;QAC/BC,cAAcS,OAAOT,YAAY;QACjCE,sBAAsBO,OAAOP,oBAAoB;QACjDU,KAAKC;QACLP,aAAaG,OAAOH,WAAW;IACjC;IACA,OAAO;QAACI;QAAMN,oBAAoBK,OAAOL,kBAAkB;IAAA;AAC7D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AvailabilitySite, type RoutedExpression, type WorkflowExpression } from '@shipfox/expression';
|
|
2
|
+
import type { PersistedEvaluationTraceEntry } from './entities/step.js';
|
|
3
|
+
export declare function explicitConditionTrace(params: {
|
|
4
|
+
readonly expression: WorkflowExpression;
|
|
5
|
+
readonly field: 'job.if' | 'step.if';
|
|
6
|
+
readonly route: RoutedExpression;
|
|
7
|
+
readonly site: AvailabilitySite;
|
|
8
|
+
readonly value: boolean;
|
|
9
|
+
readonly degraded: boolean;
|
|
10
|
+
}): readonly PersistedEvaluationTraceEntry[];
|
|
11
|
+
export declare function defaultJobConditionTrace(): readonly PersistedEvaluationTraceEntry[];
|
|
12
|
+
export declare function defaultStepConditionTrace(): readonly PersistedEvaluationTraceEntry[];
|
|
13
|
+
//# sourceMappingURL=condition-trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition-trace.d.ts","sourceRoot":"","sources":["../../src/core/condition-trace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAIrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,oBAAoB,CAAC;AAKtE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B,GAAG,SAAS,6BAA6B,EAAE,CAa3C;AAED,wBAAgB,wBAAwB,IAAI,SAAS,6BAA6B,EAAE,CAanF;AAED,wBAAgB,yBAAyB,IAAI,SAAS,6BAA6B,EAAE,CAapF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { capTraceEntries, evaluationTraceEntry, predicateTraceEntry } from '@shipfox/expression';
|
|
2
|
+
const DEFAULT_JOB_CONDITION_SOURCE = 'needs.all(n, n.status == "succeeded")';
|
|
3
|
+
const DEFAULT_STEP_CONDITION_SOURCE = '!execution.failed';
|
|
4
|
+
export function explicitConditionTrace(params) {
|
|
5
|
+
return capTraceEntries([
|
|
6
|
+
{
|
|
7
|
+
...predicateTraceEntry({
|
|
8
|
+
expression: params.expression.source,
|
|
9
|
+
route: params.route,
|
|
10
|
+
site: params.site,
|
|
11
|
+
value: params.value,
|
|
12
|
+
degraded: params.degraded
|
|
13
|
+
}),
|
|
14
|
+
field: params.field
|
|
15
|
+
}
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
export function defaultJobConditionTrace() {
|
|
19
|
+
return capTraceEntries([
|
|
20
|
+
{
|
|
21
|
+
...evaluationTraceEntry({
|
|
22
|
+
expression: DEFAULT_JOB_CONDITION_SOURCE,
|
|
23
|
+
roots: [
|
|
24
|
+
'needs'
|
|
25
|
+
],
|
|
26
|
+
fillTarget: 'job-activation',
|
|
27
|
+
evaluatedAt: 'job-activation',
|
|
28
|
+
value: 'false'
|
|
29
|
+
}),
|
|
30
|
+
field: 'job.default_gate'
|
|
31
|
+
}
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
export function defaultStepConditionTrace() {
|
|
35
|
+
return capTraceEntries([
|
|
36
|
+
{
|
|
37
|
+
...evaluationTraceEntry({
|
|
38
|
+
expression: DEFAULT_STEP_CONDITION_SOURCE,
|
|
39
|
+
roots: [
|
|
40
|
+
'execution'
|
|
41
|
+
],
|
|
42
|
+
fillTarget: 'step-dispatch',
|
|
43
|
+
evaluatedAt: 'step-dispatch',
|
|
44
|
+
value: 'false'
|
|
45
|
+
}),
|
|
46
|
+
field: 'step.default_gate'
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=condition-trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/condition-trace.ts"],"sourcesContent":["import {\n type AvailabilitySite,\n capTraceEntries,\n evaluationTraceEntry,\n predicateTraceEntry,\n type RoutedExpression,\n type WorkflowExpression,\n} from '@shipfox/expression';\nimport type {PersistedEvaluationTraceEntry} from './entities/step.js';\n\nconst DEFAULT_JOB_CONDITION_SOURCE = 'needs.all(n, n.status == \"succeeded\")';\nconst DEFAULT_STEP_CONDITION_SOURCE = '!execution.failed';\n\nexport function explicitConditionTrace(params: {\n readonly expression: WorkflowExpression;\n readonly field: 'job.if' | 'step.if';\n readonly route: RoutedExpression;\n readonly site: AvailabilitySite;\n readonly value: boolean;\n readonly degraded: boolean;\n}): readonly PersistedEvaluationTraceEntry[] {\n return capTraceEntries([\n {\n ...predicateTraceEntry({\n expression: params.expression.source,\n route: params.route,\n site: params.site,\n value: params.value,\n degraded: params.degraded,\n }),\n field: params.field,\n },\n ]);\n}\n\nexport function defaultJobConditionTrace(): readonly PersistedEvaluationTraceEntry[] {\n return capTraceEntries([\n {\n ...evaluationTraceEntry({\n expression: DEFAULT_JOB_CONDITION_SOURCE,\n roots: ['needs'],\n fillTarget: 'job-activation',\n evaluatedAt: 'job-activation',\n value: 'false',\n }),\n field: 'job.default_gate',\n },\n ]);\n}\n\nexport function defaultStepConditionTrace(): readonly PersistedEvaluationTraceEntry[] {\n return capTraceEntries([\n {\n ...evaluationTraceEntry({\n expression: DEFAULT_STEP_CONDITION_SOURCE,\n roots: ['execution'],\n fillTarget: 'step-dispatch',\n evaluatedAt: 'step-dispatch',\n value: 'false',\n }),\n field: 'step.default_gate',\n },\n ]);\n}\n"],"names":["capTraceEntries","evaluationTraceEntry","predicateTraceEntry","DEFAULT_JOB_CONDITION_SOURCE","DEFAULT_STEP_CONDITION_SOURCE","explicitConditionTrace","params","expression","source","route","site","value","degraded","field","defaultJobConditionTrace","roots","fillTarget","evaluatedAt","defaultStepConditionTrace"],"mappings":"AAAA,SAEEA,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,QAGd,sBAAsB;AAG7B,MAAMC,+BAA+B;AACrC,MAAMC,gCAAgC;AAEtC,OAAO,SAASC,uBAAuBC,MAOtC;IACC,OAAON,gBAAgB;QACrB;YACE,GAAGE,oBAAoB;gBACrBK,YAAYD,OAAOC,UAAU,CAACC,MAAM;gBACpCC,OAAOH,OAAOG,KAAK;gBACnBC,MAAMJ,OAAOI,IAAI;gBACjBC,OAAOL,OAAOK,KAAK;gBACnBC,UAAUN,OAAOM,QAAQ;YAC3B,EAAE;YACFC,OAAOP,OAAOO,KAAK;QACrB;KACD;AACH;AAEA,OAAO,SAASC;IACd,OAAOd,gBAAgB;QACrB;YACE,GAAGC,qBAAqB;gBACtBM,YAAYJ;gBACZY,OAAO;oBAAC;iBAAQ;gBAChBC,YAAY;gBACZC,aAAa;gBACbN,OAAO;YACT,EAAE;YACFE,OAAO;QACT;KACD;AACH;AAEA,OAAO,SAASK;IACd,OAAOlB,gBAAgB;QACrB;YACE,GAAGC,qBAAqB;gBACtBM,YAAYH;gBACZW,OAAO;oBAAC;iBAAY;gBACpBC,YAAY;gBACZC,aAAa;gBACbN,OAAO;YACT,EAAE;YACFE,OAAO;QACT;KACD;AACH"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { Job, JobCheckout, JobStatus } from './job.js';
|
|
2
|
+
export type { Step, StepStatus } from './step.js';
|
|
3
|
+
export type { TriggerPayload, WorkflowRun, WorkflowRunStatus, WorkflowSourceSnapshot, } from './workflow-run.js';
|
|
4
|
+
export type { RerunMode, WorkflowRunAttempt } from './workflow-run-attempt.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/entities/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAC1D,YAAY,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAChD,YAAY,EACV,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/index.ts"],"sourcesContent":["export type {Job, JobCheckout, JobStatus} from './job.js';\nexport type {Step, StepStatus} from './step.js';\nexport type {\n TriggerPayload,\n WorkflowRun,\n WorkflowRunStatus,\n WorkflowSourceSnapshot,\n} from './workflow-run.js';\nexport type {RerunMode, WorkflowRunAttempt} from './workflow-run-attempt.js';\n"],"names":[],"mappings":"AAQA,WAA6E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JobStatus, JobStatusReason } from './job.js';
|
|
2
|
+
import type { PersistedEvaluationTraceEntry } from './step.js';
|
|
3
|
+
export type JobExecutionStatus = Exclude<JobStatus, 'skipped'>;
|
|
4
|
+
export interface WorkflowExecutionEvent {
|
|
5
|
+
source: string;
|
|
6
|
+
event: string;
|
|
7
|
+
delivery_id: string;
|
|
8
|
+
received_at: string;
|
|
9
|
+
data: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface JobExecution {
|
|
12
|
+
id: string;
|
|
13
|
+
jobId: string;
|
|
14
|
+
sequence: number;
|
|
15
|
+
name: string;
|
|
16
|
+
runner: string[] | null;
|
|
17
|
+
status: JobExecutionStatus;
|
|
18
|
+
statusReason: JobStatusReason | null;
|
|
19
|
+
triggerEvents: WorkflowExecutionEvent[];
|
|
20
|
+
outputs: Record<string, unknown> | null;
|
|
21
|
+
evaluationTrace?: readonly PersistedEvaluationTraceEntry[] | null;
|
|
22
|
+
version: number;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
queuedAt: Date | null;
|
|
26
|
+
startedAt: Date | null;
|
|
27
|
+
finishedAt: Date | null;
|
|
28
|
+
timedOutAt: Date | null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=job-execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-execution.d.ts","sourceRoot":"","sources":["../../../src/core/entities/job-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,WAAW,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAE/D,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,SAAS,6BAA6B,EAAE,GAAG,IAAI,CAAC;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/job-execution.ts"],"sourcesContent":["import type {JobStatus, JobStatusReason} from './job.js';\nimport type {PersistedEvaluationTraceEntry} from './step.js';\n\nexport type JobExecutionStatus = Exclude<JobStatus, 'skipped'>;\n\nexport interface WorkflowExecutionEvent {\n source: string;\n event: string;\n delivery_id: string;\n received_at: string;\n data: unknown;\n}\n\nexport interface JobExecution {\n id: string;\n jobId: string;\n sequence: number;\n name: string;\n runner: string[] | null;\n status: JobExecutionStatus;\n statusReason: JobStatusReason | null;\n triggerEvents: WorkflowExecutionEvent[];\n outputs: Record<string, unknown> | null;\n evaluationTrace?: readonly PersistedEvaluationTraceEntry[] | null;\n version: number;\n createdAt: Date;\n updatedAt: Date;\n queuedAt: Date | null;\n startedAt: Date | null;\n finishedAt: Date | null;\n timedOutAt: Date | null;\n}\n"],"names":[],"mappings":"AAaA,WAkBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type JobListenerEventDisposition = 'fire' | 'resolve';
|
|
2
|
+
export interface JobListenerEvent {
|
|
3
|
+
id: string;
|
|
4
|
+
jobId: string;
|
|
5
|
+
disposition: JobListenerEventDisposition;
|
|
6
|
+
eventRef: string;
|
|
7
|
+
deliveryId: string;
|
|
8
|
+
source: string;
|
|
9
|
+
event: string;
|
|
10
|
+
payload: unknown;
|
|
11
|
+
receivedAt: Date;
|
|
12
|
+
consumedByExecutionId: string | null;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=job-listener-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-listener-event.d.ts","sourceRoot":"","sources":["../../../src/core/entities/job-listener-event.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,2BAA2B,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/job-listener-event.ts"],"sourcesContent":["export type JobListenerEventDisposition = 'fire' | 'resolve';\n\nexport interface JobListenerEvent {\n id: string;\n jobId: string;\n disposition: JobListenerEventDisposition;\n eventRef: string;\n deliveryId: string;\n source: string;\n event: string;\n payload: unknown;\n receivedAt: Date;\n consumedByExecutionId: string | null;\n createdAt: Date;\n}\n"],"names":[],"mappings":"AAEA,WAYC"}
|