@shipfox/api-definitions 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 +215 -0
- package/LICENSE +21 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +35 -0
- package/dist/config.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 +6 -0
- package/dist/core/entities/index.js.map +1 -0
- package/dist/core/entities/integration-context.d.ts +11 -0
- package/dist/core/entities/integration-context.d.ts.map +1 -0
- package/dist/core/entities/integration-context.js +3 -0
- package/dist/core/entities/integration-context.js.map +1 -0
- package/dist/core/entities/sync-state.d.ts +19 -0
- package/dist/core/entities/sync-state.d.ts.map +1 -0
- package/dist/core/entities/sync-state.js +20 -0
- package/dist/core/entities/sync-state.js.map +1 -0
- package/dist/core/entities/workflow-definition.d.ts +35 -0
- package/dist/core/entities/workflow-definition.d.ts.map +1 -0
- package/dist/core/entities/workflow-definition.js +3 -0
- package/dist/core/entities/workflow-definition.js.map +1 -0
- package/dist/core/entities/workflow-model.d.ts +138 -0
- package/dist/core/entities/workflow-model.d.ts.map +1 -0
- package/dist/core/entities/workflow-model.js +3 -0
- package/dist/core/entities/workflow-model.js.map +1 -0
- package/dist/core/errors.d.ts +10 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +14 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/has-agent-step-integrations.d.ts +3 -0
- package/dist/core/has-agent-step-integrations.d.ts.map +1 -0
- package/dist/core/has-agent-step-integrations.js +5 -0
- package/dist/core/has-agent-step-integrations.js.map +1 -0
- package/dist/core/index.d.ts +9 -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/parse-definition.d.ts +9 -0
- package/dist/core/parse-definition.d.ts.map +1 -0
- package/dist/core/parse-definition.js +17 -0
- package/dist/core/parse-definition.js.map +1 -0
- package/dist/core/sync-definitions.d.ts +44 -0
- package/dist/core/sync-definitions.d.ts.map +1 -0
- package/dist/core/sync-definitions.js +140 -0
- package/dist/core/sync-definitions.js.map +1 -0
- package/dist/core/validate-definition.d.ts +20 -0
- package/dist/core/validate-definition.d.ts.map +1 -0
- package/dist/core/validate-definition.js +61 -0
- package/dist/core/validate-definition.js.map +1 -0
- package/dist/core/workflow-model/constants.d.ts +2 -0
- package/dist/core/workflow-model/constants.d.ts.map +1 -0
- package/dist/core/workflow-model/constants.js +3 -0
- package/dist/core/workflow-model/constants.js.map +1 -0
- package/dist/core/workflow-model/cron-trigger.d.ts +16 -0
- package/dist/core/workflow-model/cron-trigger.d.ts.map +1 -0
- package/dist/core/workflow-model/cron-trigger.js +85 -0
- package/dist/core/workflow-model/cron-trigger.js.map +1 -0
- package/dist/core/workflow-model/index.d.ts +4 -0
- package/dist/core/workflow-model/index.d.ts.map +1 -0
- package/dist/core/workflow-model/index.js +5 -0
- package/dist/core/workflow-model/index.js.map +1 -0
- package/dist/core/workflow-model/invalid-workflow-model-error.d.ts +15 -0
- package/dist/core/workflow-model/invalid-workflow-model-error.d.ts.map +1 -0
- package/dist/core/workflow-model/invalid-workflow-model-error.js +9 -0
- package/dist/core/workflow-model/invalid-workflow-model-error.js.map +1 -0
- package/dist/core/workflow-model/map-job-ids.d.ts +4 -0
- package/dist/core/workflow-model/map-job-ids.d.ts.map +1 -0
- package/dist/core/workflow-model/map-job-ids.js +33 -0
- package/dist/core/workflow-model/map-job-ids.js.map +1 -0
- package/dist/core/workflow-model/normalize-agent-integrations.d.ts +12 -0
- package/dist/core/workflow-model/normalize-agent-integrations.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-agent-integrations.js +157 -0
- package/dist/core/workflow-model/normalize-agent-integrations.js.map +1 -0
- package/dist/core/workflow-model/normalize-dependencies.d.ts +6 -0
- package/dist/core/workflow-model/normalize-dependencies.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-dependencies.js +119 -0
- package/dist/core/workflow-model/normalize-dependencies.js.map +1 -0
- package/dist/core/workflow-model/normalize-env.d.ts +17 -0
- package/dist/core/workflow-model/normalize-env.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-env.js +40 -0
- package/dist/core/workflow-model/normalize-env.js.map +1 -0
- package/dist/core/workflow-model/normalize-if-condition.d.ts +14 -0
- package/dist/core/workflow-model/normalize-if-condition.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-if-condition.js +75 -0
- package/dist/core/workflow-model/normalize-if-condition.js.map +1 -0
- package/dist/core/workflow-model/normalize-job-checkout.d.ts +5 -0
- package/dist/core/workflow-model/normalize-job-checkout.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-job-checkout.js +16 -0
- package/dist/core/workflow-model/normalize-job-checkout.js.map +1 -0
- package/dist/core/workflow-model/normalize-job-listening.d.ts +10 -0
- package/dist/core/workflow-model/normalize-job-listening.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-job-listening.js +125 -0
- package/dist/core/workflow-model/normalize-job-listening.js.map +1 -0
- package/dist/core/workflow-model/normalize-job-success.d.ts +11 -0
- package/dist/core/workflow-model/normalize-job-success.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-job-success.js +23 -0
- package/dist/core/workflow-model/normalize-job-success.js.map +1 -0
- package/dist/core/workflow-model/normalize-jobs.d.ts +12 -0
- package/dist/core/workflow-model/normalize-jobs.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-jobs.js +935 -0
- package/dist/core/workflow-model/normalize-jobs.js.map +1 -0
- package/dist/core/workflow-model/normalize-needs.d.ts +2 -0
- package/dist/core/workflow-model/normalize-needs.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-needs.js +16 -0
- package/dist/core/workflow-model/normalize-needs.js.map +1 -0
- package/dist/core/workflow-model/normalize-step-gate.d.ts +15 -0
- package/dist/core/workflow-model/normalize-step-gate.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-step-gate.js +89 -0
- package/dist/core/workflow-model/normalize-step-gate.js.map +1 -0
- package/dist/core/workflow-model/normalize-step-outputs.d.ts +10 -0
- package/dist/core/workflow-model/normalize-step-outputs.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-step-outputs.js +32 -0
- package/dist/core/workflow-model/normalize-step-outputs.js.map +1 -0
- package/dist/core/workflow-model/normalize-triggers.d.ts +11 -0
- package/dist/core/workflow-model/normalize-triggers.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-triggers.js +128 -0
- package/dist/core/workflow-model/normalize-triggers.js.map +1 -0
- package/dist/core/workflow-model/normalize-workflow-document.d.ts +11 -0
- package/dist/core/workflow-model/normalize-workflow-document.d.ts.map +1 -0
- package/dist/core/workflow-model/normalize-workflow-document.js +43 -0
- package/dist/core/workflow-model/normalize-workflow-document.js.map +1 -0
- package/dist/core/workflow-model/parse-duration-ms.d.ts +11 -0
- package/dist/core/workflow-model/parse-duration-ms.d.ts.map +1 -0
- package/dist/core/workflow-model/parse-duration-ms.js +47 -0
- package/dist/core/workflow-model/parse-duration-ms.js.map +1 -0
- package/dist/core/workflow-model/parse-interpolation-field.d.ts +14 -0
- package/dist/core/workflow-model/parse-interpolation-field.d.ts.map +1 -0
- package/dist/core/workflow-model/parse-interpolation-field.js +377 -0
- package/dist/core/workflow-model/parse-interpolation-field.js.map +1 -0
- package/dist/core/workflow-model/stable-id.d.ts +2 -0
- package/dist/core/workflow-model/stable-id.d.ts.map +1 -0
- package/dist/core/workflow-model/stable-id.js +8 -0
- package/dist/core/workflow-model/stable-id.js.map +1 -0
- package/dist/core/workflow-model/validate-job-references.d.ts +10 -0
- package/dist/core/workflow-model/validate-job-references.d.ts.map +1 -0
- package/dist/core/workflow-model/validate-job-references.js +42 -0
- package/dist/core/workflow-model/validate-job-references.js.map +1 -0
- package/dist/core/workflow-model/validate-predicate-expression.d.ts +14 -0
- package/dist/core/workflow-model/validate-predicate-expression.d.ts.map +1 -0
- package/dist/core/workflow-model/validate-predicate-expression.js +273 -0
- package/dist/core/workflow-model/validate-predicate-expression.js.map +1 -0
- package/dist/core/workflow-model/validation-issue.d.ts +8 -0
- package/dist/core/workflow-model/validation-issue.d.ts.map +1 -0
- package/dist/core/workflow-model/validation-issue.js +17 -0
- package/dist/core/workflow-model/validation-issue.js.map +1 -0
- package/dist/core/workflow-model/workflow-field-label.d.ts +3 -0
- package/dist/core/workflow-model/workflow-field-label.d.ts.map +1 -0
- package/dist/core/workflow-model/workflow-field-label.js +47 -0
- package/dist/core/workflow-model/workflow-field-label.js.map +1 -0
- package/dist/core/workflow-yaml/index.d.ts +3 -0
- package/dist/core/workflow-yaml/index.d.ts.map +1 -0
- package/dist/core/workflow-yaml/index.js +4 -0
- package/dist/core/workflow-yaml/index.js.map +1 -0
- package/dist/core/workflow-yaml/invalid-workflow-yaml-error.d.ts +16 -0
- package/dist/core/workflow-yaml/invalid-workflow-yaml-error.d.ts.map +1 -0
- package/dist/core/workflow-yaml/invalid-workflow-yaml-error.js +12 -0
- package/dist/core/workflow-yaml/invalid-workflow-yaml-error.js.map +1 -0
- package/dist/core/workflow-yaml/parse-workflow-yaml.d.ts +9 -0
- package/dist/core/workflow-yaml/parse-workflow-yaml.d.ts.map +1 -0
- package/dist/core/workflow-yaml/parse-workflow-yaml.js +52 -0
- package/dist/core/workflow-yaml/parse-workflow-yaml.js.map +1 -0
- package/dist/core/workflow-yaml/source-locations.d.ts +3 -0
- package/dist/core/workflow-yaml/source-locations.d.ts.map +1 -0
- package/dist/core/workflow-yaml/source-locations.js +48 -0
- package/dist/core/workflow-yaml/source-locations.js.map +1 -0
- package/dist/db/db.d.ts +1277 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +22 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/definition-triggers.d.ts +4 -0
- package/dist/db/definition-triggers.d.ts.map +1 -0
- package/dist/db/definition-triggers.js +17 -0
- package/dist/db/definition-triggers.js.map +1 -0
- package/dist/db/definitions.d.ts +63 -0
- package/dist/db/definitions.d.ts.map +1 -0
- package/dist/db/definitions.js +208 -0
- package/dist/db/definitions.js.map +1 -0
- package/dist/db/index.d.ts +8 -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/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/definitions.d.ts +237 -0
- package/dist/db/schema/definitions.d.ts.map +1 -0
- package/dist/db/schema/definitions.js +63 -0
- package/dist/db/schema/definitions.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/sync-states.d.ts +218 -0
- package/dist/db/schema/sync-states.d.ts.map +1 -0
- package/dist/db/schema/sync-states.js +68 -0
- package/dist/db/schema/sync-states.js.map +1 -0
- package/dist/db/sync-states.d.ts +21 -0
- package/dist/db/sync-states.d.ts.map +1 -0
- package/dist/db/sync-states.js +47 -0
- package/dist/db/sync-states.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/presentation/dto/definition.d.ts +6 -0
- package/dist/presentation/dto/definition.d.ts.map +1 -0
- package/dist/presentation/dto/definition.js +35 -0
- package/dist/presentation/dto/definition.js.map +1 -0
- package/dist/presentation/dto/index.d.ts +2 -0
- package/dist/presentation/dto/index.d.ts.map +1 -0
- package/dist/presentation/dto/index.js +3 -0
- package/dist/presentation/dto/index.js.map +1 -0
- package/dist/presentation/index.d.ts +2 -0
- package/dist/presentation/index.d.ts.map +1 -0
- package/dist/presentation/index.js +3 -0
- package/dist/presentation/index.js.map +1 -0
- package/dist/presentation/routes/create-definition.d.ts +9 -0
- package/dist/presentation/routes/create-definition.d.ts.map +1 -0
- package/dist/presentation/routes/create-definition.js +76 -0
- package/dist/presentation/routes/create-definition.js.map +1 -0
- package/dist/presentation/routes/get-definition.d.ts +2 -0
- package/dist/presentation/routes/get-definition.d.ts.map +1 -0
- package/dist/presentation/routes/get-definition.js +43 -0
- package/dist/presentation/routes/get-definition.js.map +1 -0
- package/dist/presentation/routes/index.d.ts +7 -0
- package/dist/presentation/routes/index.d.ts.map +1 -0
- package/dist/presentation/routes/index.js +22 -0
- package/dist/presentation/routes/index.js.map +1 -0
- package/dist/presentation/routes/list-definitions.d.ts +2 -0
- package/dist/presentation/routes/list-definitions.d.ts.map +1 -0
- package/dist/presentation/routes/list-definitions.js +56 -0
- package/dist/presentation/routes/list-definitions.js.map +1 -0
- package/dist/presentation/routes/validate-definition.d.ts +2 -0
- package/dist/presentation/routes/validate-definition.d.ts.map +1 -0
- package/dist/presentation/routes/validate-definition.js +43 -0
- package/dist/presentation/routes/validate-definition.js.map +1 -0
- package/dist/presentation/subscribers/index.d.ts +3 -0
- package/dist/presentation/subscribers/index.d.ts.map +1 -0
- package/dist/presentation/subscribers/index.js +4 -0
- package/dist/presentation/subscribers/index.js.map +1 -0
- package/dist/presentation/subscribers/on-project-source-bound.d.ts +3 -0
- package/dist/presentation/subscribers/on-project-source-bound.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-project-source-bound.js +11 -0
- package/dist/presentation/subscribers/on-project-source-bound.js.map +1 -0
- package/dist/presentation/subscribers/on-project-source-commit-observed.d.ts +3 -0
- package/dist/presentation/subscribers/on-project-source-commit-observed.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-project-source-commit-observed.js +13 -0
- package/dist/presentation/subscribers/on-project-source-commit-observed.js.map +1 -0
- package/dist/presentation/subscribers/start-definition-sync.d.ts +10 -0
- package/dist/presentation/subscribers/start-definition-sync.d.ts.map +1 -0
- package/dist/presentation/subscribers/start-definition-sync.js +26 -0
- package/dist/presentation/subscribers/start-definition-sync.js.map +1 -0
- package/dist/temporal/activities/index.d.ts +3 -0
- package/dist/temporal/activities/index.d.ts.map +1 -0
- package/dist/temporal/activities/index.js +3 -0
- package/dist/temporal/activities/index.js.map +1 -0
- package/dist/temporal/activities/sync-activities.d.ts +47 -0
- package/dist/temporal/activities/sync-activities.d.ts.map +1 -0
- package/dist/temporal/activities/sync-activities.js +128 -0
- package/dist/temporal/activities/sync-activities.js.map +1 -0
- package/dist/temporal/constants.d.ts +3 -0
- package/dist/temporal/constants.d.ts.map +1 -0
- package/dist/temporal/constants.js +4 -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/workflows/definition-sync.d.ts +20 -0
- package/dist/temporal/workflows/definition-sync.d.ts.map +1 -0
- package/dist/temporal/workflows/definition-sync.js +95 -0
- package/dist/temporal/workflows/definition-sync.js.map +1 -0
- package/dist/temporal/workflows/index.d.ts +2 -0
- package/dist/temporal/workflows/index.d.ts.map +1 -0
- package/dist/temporal/workflows/index.js +3 -0
- package/dist/temporal/workflows/index.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/drizzle/0000_initial.sql +64 -0
- package/drizzle/0001_definition_list_pagination.sql +1 -0
- package/drizzle/meta/0000_snapshot.json +527 -0
- package/drizzle/meta/_journal.json +20 -0
- package/drizzle.config.ts +11 -0
- package/package.json +89 -0
- package/src/config.test.ts +23 -0
- package/src/config.ts +50 -0
- package/src/core/entities/index.ts +4 -0
- package/src/core/entities/integration-context.ts +21 -0
- package/src/core/entities/sync-state.ts +40 -0
- package/src/core/entities/workflow-definition.ts +38 -0
- package/src/core/entities/workflow-model.ts +162 -0
- package/src/core/errors.ts +21 -0
- package/src/core/has-agent-step-integrations.ts +7 -0
- package/src/core/index.ts +23 -0
- package/src/core/parse-definition.test.ts +200 -0
- package/src/core/parse-definition.ts +28 -0
- package/src/core/sync-definitions.test.ts +390 -0
- package/src/core/sync-definitions.ts +216 -0
- package/src/core/validate-definition.test.ts +152 -0
- package/src/core/validate-definition.ts +72 -0
- package/src/core/workflow-model/README.md +129 -0
- package/src/core/workflow-model/constants.ts +1 -0
- package/src/core/workflow-model/cron-trigger.test.ts +29 -0
- package/src/core/workflow-model/cron-trigger.ts +83 -0
- package/src/core/workflow-model/index.ts +9 -0
- package/src/core/workflow-model/invalid-workflow-model-error.ts +71 -0
- package/src/core/workflow-model/map-job-ids.ts +33 -0
- package/src/core/workflow-model/normalize-agent-integrations.ts +208 -0
- package/src/core/workflow-model/normalize-dependencies.ts +139 -0
- package/src/core/workflow-model/normalize-env.ts +48 -0
- package/src/core/workflow-model/normalize-if-condition.ts +126 -0
- package/src/core/workflow-model/normalize-job-checkout.ts +19 -0
- package/src/core/workflow-model/normalize-job-listening.ts +121 -0
- package/src/core/workflow-model/normalize-job-success.ts +28 -0
- package/src/core/workflow-model/normalize-jobs.ts +1010 -0
- package/src/core/workflow-model/normalize-needs.ts +12 -0
- package/src/core/workflow-model/normalize-step-gate.ts +90 -0
- package/src/core/workflow-model/normalize-step-outputs.ts +36 -0
- package/src/core/workflow-model/normalize-triggers.ts +130 -0
- package/src/core/workflow-model/normalize-workflow-document.test.ts +4463 -0
- package/src/core/workflow-model/normalize-workflow-document.ts +63 -0
- package/src/core/workflow-model/parse-duration-ms.ts +58 -0
- package/src/core/workflow-model/parse-interpolation-field.ts +566 -0
- package/src/core/workflow-model/stable-id.ts +12 -0
- package/src/core/workflow-model/validate-job-references.ts +54 -0
- package/src/core/workflow-model/validate-predicate-expression.test.ts +161 -0
- package/src/core/workflow-model/validate-predicate-expression.ts +406 -0
- package/src/core/workflow-model/validation-issue.ts +27 -0
- package/src/core/workflow-model/workflow-field-label.ts +50 -0
- package/src/core/workflow-yaml/README.md +77 -0
- package/src/core/workflow-yaml/index.ts +11 -0
- package/src/core/workflow-yaml/invalid-workflow-yaml-error.ts +23 -0
- package/src/core/workflow-yaml/parse-workflow-yaml.test.ts +71 -0
- package/src/core/workflow-yaml/parse-workflow-yaml.ts +74 -0
- package/src/core/workflow-yaml/source-locations.ts +62 -0
- package/src/db/db.ts +18 -0
- package/src/db/definition-triggers.test.ts +95 -0
- package/src/db/definition-triggers.ts +17 -0
- package/src/db/definitions.test.ts +1309 -0
- package/src/db/definitions.ts +357 -0
- package/src/db/index.ts +31 -0
- package/src/db/schema/common.ts +3 -0
- package/src/db/schema/definitions.test.ts +36 -0
- package/src/db/schema/definitions.ts +76 -0
- package/src/db/schema/outbox.ts +4 -0
- package/src/db/schema/sync-states.ts +79 -0
- package/src/db/sync-states.test.ts +90 -0
- package/src/db/sync-states.ts +86 -0
- package/src/index.ts +104 -0
- package/src/presentation/dto/definition.test.ts +59 -0
- package/src/presentation/dto/definition.ts +41 -0
- package/src/presentation/dto/index.ts +1 -0
- package/src/presentation/index.ts +1 -0
- package/src/presentation/routes/create-definition.test.ts +356 -0
- package/src/presentation/routes/create-definition.ts +101 -0
- package/src/presentation/routes/get-definition.test.ts +79 -0
- package/src/presentation/routes/get-definition.ts +37 -0
- package/src/presentation/routes/index.test.ts +41 -0
- package/src/presentation/routes/index.ts +28 -0
- package/src/presentation/routes/list-definitions.test.ts +195 -0
- package/src/presentation/routes/list-definitions.ts +49 -0
- package/src/presentation/routes/validate-definition.test.ts +63 -0
- package/src/presentation/routes/validate-definition.ts +46 -0
- package/src/presentation/subscribers/index.ts +2 -0
- package/src/presentation/subscribers/on-project-source-bound.test.ts +65 -0
- package/src/presentation/subscribers/on-project-source-bound.ts +11 -0
- package/src/presentation/subscribers/on-project-source-commit-observed.test.ts +56 -0
- package/src/presentation/subscribers/on-project-source-commit-observed.ts +15 -0
- package/src/presentation/subscribers/start-definition-sync.ts +38 -0
- package/src/temporal/activities/index.ts +10 -0
- package/src/temporal/activities/sync-activities.test.ts +337 -0
- package/src/temporal/activities/sync-activities.ts +206 -0
- package/src/temporal/constants.ts +2 -0
- package/src/temporal/index.ts +2 -0
- package/src/temporal/workflows/definition-sync.test.ts +59 -0
- package/src/temporal/workflows/definition-sync.ts +116 -0
- package/src/temporal/workflows/index.ts +1 -0
- package/test/env.ts +7 -0
- package/test/factories/definition.ts +66 -0
- package/test/fixtures/invalid-cycle.yml +13 -0
- package/test/fixtures/invalid-missing-name.yml +4 -0
- package/test/fixtures/invalid-yaml-syntax.yml +6 -0
- package/test/fixtures/valid-dag.yml +25 -0
- package/test/fixtures/valid-listening-job.yml +21 -0
- package/test/fixtures/valid-simple.yml +18 -0
- package/test/fixtures/workflow-yaml/invalid/invalid-yaml-syntax.yaml +6 -0
- package/test/fixtures/workflow-yaml/invalid/missing-step-run.yaml +5 -0
- package/test/fixtures/workflow-yaml/valid/simple-build.document.json +26 -0
- package/test/fixtures/workflow-yaml/valid/simple-build.yaml +14 -0
- package/test/globalSetup.ts +25 -0
- package/test/index.ts +1 -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 +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ shipfox-tsc-emit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ shipfox-tsc-check
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# @shipfox/api-definitions
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1b0d344: Publishes the complete API runtime closure with packed-consumer-safe internal imports and records its exact package set in application releases.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [0cd6dd4]
|
|
12
|
+
- Updated dependencies [a68458a]
|
|
13
|
+
- Updated dependencies [6eba800]
|
|
14
|
+
- Updated dependencies [1b0d344]
|
|
15
|
+
- Updated dependencies [521e006]
|
|
16
|
+
- @shipfox/node-module@0.2.0
|
|
17
|
+
- @shipfox/api-integration-core@2.0.0
|
|
18
|
+
- @shipfox/node-temporal@0.2.0
|
|
19
|
+
- @shipfox/api-agent-dto@2.0.0
|
|
20
|
+
- @shipfox/api-auth-context@2.0.0
|
|
21
|
+
- @shipfox/api-definitions-dto@2.0.0
|
|
22
|
+
- @shipfox/api-integration-core-dto@2.0.0
|
|
23
|
+
- @shipfox/api-projects@2.0.0
|
|
24
|
+
- @shipfox/api-projects-dto@2.0.0
|
|
25
|
+
- @shipfox/api-secrets-dto@2.0.0
|
|
26
|
+
- @shipfox/runner-labels@0.1.0
|
|
27
|
+
- @shipfox/config@1.2.1
|
|
28
|
+
- @shipfox/expression@1.1.1
|
|
29
|
+
- @shipfox/node-drizzle@0.2.1
|
|
30
|
+
- @shipfox/node-fastify@0.2.1
|
|
31
|
+
- @shipfox/node-opentelemetry@0.5.0
|
|
32
|
+
- @shipfox/node-outbox@0.2.1
|
|
33
|
+
- @shipfox/node-postgres@0.4.1
|
|
34
|
+
- @shipfox/workflow-document@2.0.1
|
|
35
|
+
|
|
36
|
+
## 0.1.2
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [705dd43]
|
|
41
|
+
- @shipfox/node-outbox@0.2.0
|
|
42
|
+
- @shipfox/api-integration-core@0.1.2
|
|
43
|
+
- @shipfox/api-projects@0.1.2
|
|
44
|
+
- @shipfox/node-module@0.1.2
|
|
45
|
+
|
|
46
|
+
## 0.1.1
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [ec75cd5]
|
|
51
|
+
- Updated dependencies [6a1fb54]
|
|
52
|
+
- @shipfox/node-drizzle@0.2.0
|
|
53
|
+
- @shipfox/node-postgres@0.4.0
|
|
54
|
+
- @shipfox/api-integration-core@0.1.1
|
|
55
|
+
- @shipfox/api-projects@0.1.1
|
|
56
|
+
- @shipfox/node-module@0.1.1
|
|
57
|
+
- @shipfox/node-outbox@0.1.1
|
|
58
|
+
|
|
59
|
+
## 0.1.0
|
|
60
|
+
|
|
61
|
+
### Minor Changes
|
|
62
|
+
|
|
63
|
+
- 3afb7e3: Adds job execution success expressions and execution timeouts to workflow documents.
|
|
64
|
+
Renames job execution IDs in auth, runner, workflow, and timeout event contracts to the explicit `jobExecutionId` / `job_execution_id` shape.
|
|
65
|
+
- d635979: Routes workflow materialization and predicate evaluation through persisted planner segments, replacing resolver exports with planned freeze APIs.
|
|
66
|
+
- 69d02e5: Adds job-level checkout permissions and persist-credentials fields to workflow documents.
|
|
67
|
+
- b74f635: Adds workflow run interpolation context resolution while preserving authored step configuration for reruns and diagnostics.
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- eb40964: Add an inline `agent` workflow step that the runner runs with the pi harness. A step is an agent step when it carries `model` + `prompt` and no `run`; it takes a free-text `model`, a single `prompt`, and an optional `thinking` level (default `high`). The step runs to process-success (the agent ran to completion) and reports through the existing step protocol with no runner/backend protocol change, so change quality is judged by a downstream `run` + `gate` step. v1 does not persist the agent's work (no diff, commit, or PR).
|
|
72
|
+
- 59ba68b: Integrates workflow definitions with accepted workflow documents and normalized workflow models.
|
|
73
|
+
- ce062a9: Validates authored agent step integrations against provider tool catalogs and workspace connection capabilities.
|
|
74
|
+
- 857879a: Add a definitions-owned workflow model normalizer for accepted workflow documents.
|
|
75
|
+
- ae7a63c: Adds daily dispatched outbox row retention with bounded cleanup batches and retention indexes on module outbox tables.
|
|
76
|
+
- b525dcd: Let an agent workflow step pick its pi provider with an optional free-text `provider` field (default `anthropic`), threaded to the runner's pi model lookup, and split agent-step failures into a user-fixable `agent_config_invalid` reason (unknown provider, missing runner credentials, wrong provider/model pair) versus `agent_invocation_failed` for genuine provider/API errors.
|
|
77
|
+
- 7fa8f0b: Fix VCS sync failing when a manual definition shares a config_path. The
|
|
78
|
+
`definitions_wd_project_id_config_path_unique` index was source-agnostic, so a
|
|
79
|
+
manual (or validated) definition and a ref/sha-keyed VCS definition at the same
|
|
80
|
+
`config_path` collided on an index that was not the VCS upsert's `ON CONFLICT`
|
|
81
|
+
arbiter, raising an unhandled unique violation and breaking sync. The index (and
|
|
82
|
+
the manual upsert predicate) is now scoped to manual rows so the two coexist.
|
|
83
|
+
|
|
84
|
+
A CHECK constraint and request validation now bind `source` to its git
|
|
85
|
+
coordinates (vcs rows carry a ref or sha; manual rows carry neither), so the
|
|
86
|
+
index predicate's correctness is enforced rather than incidental.
|
|
87
|
+
|
|
88
|
+
- f47cff8: Add a definitions-owned workflow YAML parser that returns a shared `WorkflowDocument`.
|
|
89
|
+
- 795f440: Adds the listener orchestration loop for long-lived listening jobs: durable event draining, one execution per buffered event, resolution on until, listening deadline, or max executions, and a run-timeout backstop that resolves active listeners.
|
|
90
|
+
- 3bea87f: Adds a typed `subscriberFactory` that binds each outbox event name to its payload type at construction, so subscriber handlers receive a typed `(payload, event)` and the per-handler `event.payload as X` casts are gone; a private brand makes the factory the only way to build a module subscriber.
|
|
91
|
+
- fa67aa3: Reject workflow definitions whose step run/env/agent/name interpolation references a context root not yet available at that field's fill site, with a message naming when the root becomes available.
|
|
92
|
+
- 9a5aac4: Adds cron trigger schedule and timezone fields with source-specific document validation.
|
|
93
|
+
- ef1e917: Adds listening-job authoring fields and trusted execution context validation for listening jobs.
|
|
94
|
+
Separates workflow identifiers so internal rows use UUID `id`, authored workflow/job/step
|
|
95
|
+
references use `key`, and UI labels use `name`.
|
|
96
|
+
- 61de795: Adds canonical runner label validation and default runner label fallback for workflow definition parsing.
|
|
97
|
+
- 2933c33: Adds drain-boundary Zod validation for current outbox publisher event payloads.
|
|
98
|
+
- e1d4972: Evaluate the step gate `success_if` over the `step` self-root (`step.exit_code`, `step.status`) and job `success` over the full typed executions context, both validated against the shared context registry; authored gate expressions move from `exit_code` to `step.exit_code` and job-success now fails closed on a runtime evaluation error.
|
|
99
|
+
- Updated dependencies [eb40964]
|
|
100
|
+
- Updated dependencies [7bc7498]
|
|
101
|
+
- Updated dependencies [067a260]
|
|
102
|
+
- Updated dependencies [26fea4b]
|
|
103
|
+
- Updated dependencies [0cf66c4]
|
|
104
|
+
- Updated dependencies [0948b67]
|
|
105
|
+
- Updated dependencies [34ba284]
|
|
106
|
+
- Updated dependencies [8f51daf]
|
|
107
|
+
- Updated dependencies [3b45d86]
|
|
108
|
+
- Updated dependencies [5707d6d]
|
|
109
|
+
- Updated dependencies [e689abf]
|
|
110
|
+
- Updated dependencies [59ba68b]
|
|
111
|
+
- Updated dependencies [ce3e5ca]
|
|
112
|
+
- Updated dependencies [b9c3f32]
|
|
113
|
+
- Updated dependencies [a81b68c]
|
|
114
|
+
- Updated dependencies [115655e]
|
|
115
|
+
- Updated dependencies [c0a883c]
|
|
116
|
+
- Updated dependencies [72ce351]
|
|
117
|
+
- Updated dependencies [cdf8989]
|
|
118
|
+
- Updated dependencies [e47f8da]
|
|
119
|
+
- Updated dependencies [a68ed61]
|
|
120
|
+
- Updated dependencies [1127ba2]
|
|
121
|
+
- Updated dependencies [36f871d]
|
|
122
|
+
- Updated dependencies [e7b01dd]
|
|
123
|
+
- Updated dependencies [de54da2]
|
|
124
|
+
- Updated dependencies [d546b88]
|
|
125
|
+
- Updated dependencies [58c05ed]
|
|
126
|
+
- Updated dependencies [ce062a9]
|
|
127
|
+
- Updated dependencies [9086e65]
|
|
128
|
+
- Updated dependencies [7b175f5]
|
|
129
|
+
- Updated dependencies [7ca4c65]
|
|
130
|
+
- Updated dependencies [e9056c7]
|
|
131
|
+
- Updated dependencies [5bcdbf4]
|
|
132
|
+
- Updated dependencies [8e9c6cb]
|
|
133
|
+
- Updated dependencies [f3614ae]
|
|
134
|
+
- Updated dependencies [f98c2be]
|
|
135
|
+
- Updated dependencies [ae7a63c]
|
|
136
|
+
- Updated dependencies [5729548]
|
|
137
|
+
- Updated dependencies [d245be8]
|
|
138
|
+
- Updated dependencies [f92122b]
|
|
139
|
+
- Updated dependencies [b525dcd]
|
|
140
|
+
- Updated dependencies [f8f339a]
|
|
141
|
+
- Updated dependencies [58f51bd]
|
|
142
|
+
- Updated dependencies [570ac69]
|
|
143
|
+
- Updated dependencies [857fd73]
|
|
144
|
+
- Updated dependencies [aca162b]
|
|
145
|
+
- Updated dependencies [7fa8f0b]
|
|
146
|
+
- Updated dependencies [998eba3]
|
|
147
|
+
- Updated dependencies [3afb7e3]
|
|
148
|
+
- Updated dependencies [444ac89]
|
|
149
|
+
- Updated dependencies [eb7d5e8]
|
|
150
|
+
- Updated dependencies [5d53ed4]
|
|
151
|
+
- Updated dependencies [75520ff]
|
|
152
|
+
- Updated dependencies [e87731a]
|
|
153
|
+
- Updated dependencies [f66f606]
|
|
154
|
+
- Updated dependencies [e51d464]
|
|
155
|
+
- Updated dependencies [b8e49ff]
|
|
156
|
+
- Updated dependencies [5b8ed32]
|
|
157
|
+
- Updated dependencies [417f128]
|
|
158
|
+
- Updated dependencies [d6d4862]
|
|
159
|
+
- Updated dependencies [c0a883c]
|
|
160
|
+
- Updated dependencies [6077301]
|
|
161
|
+
- Updated dependencies [f85b223]
|
|
162
|
+
- Updated dependencies [f0afdf8]
|
|
163
|
+
- Updated dependencies [9d3b43a]
|
|
164
|
+
- Updated dependencies [d635979]
|
|
165
|
+
- Updated dependencies [3bea87f]
|
|
166
|
+
- Updated dependencies [82d22e4]
|
|
167
|
+
- Updated dependencies [69d02e5]
|
|
168
|
+
- Updated dependencies [01be723]
|
|
169
|
+
- Updated dependencies [f63c6b0]
|
|
170
|
+
- Updated dependencies [e0fee57]
|
|
171
|
+
- Updated dependencies [fa67aa3]
|
|
172
|
+
- Updated dependencies [9a5aac4]
|
|
173
|
+
- Updated dependencies [30d1c82]
|
|
174
|
+
- Updated dependencies [ef1e917]
|
|
175
|
+
- Updated dependencies [51eb38a]
|
|
176
|
+
- Updated dependencies [61de795]
|
|
177
|
+
- Updated dependencies [e2fbef8]
|
|
178
|
+
- Updated dependencies [8ecba0f]
|
|
179
|
+
- Updated dependencies [27770eb]
|
|
180
|
+
- Updated dependencies [2933c33]
|
|
181
|
+
- Updated dependencies [2ad300c]
|
|
182
|
+
- Updated dependencies [a314b05]
|
|
183
|
+
- Updated dependencies [43fd0c1]
|
|
184
|
+
- Updated dependencies [950ebef]
|
|
185
|
+
- Updated dependencies [6181819]
|
|
186
|
+
- Updated dependencies [3ddde91]
|
|
187
|
+
- Updated dependencies [1ea2f6a]
|
|
188
|
+
- Updated dependencies [ad6056b]
|
|
189
|
+
- Updated dependencies [8b9c3e0]
|
|
190
|
+
- Updated dependencies [282e66a]
|
|
191
|
+
- Updated dependencies [9c149d1]
|
|
192
|
+
- Updated dependencies [f88aac9]
|
|
193
|
+
- Updated dependencies [e1d4972]
|
|
194
|
+
- Updated dependencies [a856155]
|
|
195
|
+
- Updated dependencies [78527ce]
|
|
196
|
+
- Updated dependencies [b8919da]
|
|
197
|
+
- @shipfox/workflow-document@2.0.0
|
|
198
|
+
- @shipfox/expression@1.1.0
|
|
199
|
+
- @shipfox/api-agent-dto@0.1.0
|
|
200
|
+
- @shipfox/api-integration-core@0.1.0
|
|
201
|
+
- @shipfox/node-fastify@0.2.0
|
|
202
|
+
- @shipfox/api-secrets-dto@0.1.0
|
|
203
|
+
- @shipfox/node-drizzle@0.1.0
|
|
204
|
+
- @shipfox/api-definitions-dto@0.0.1
|
|
205
|
+
- @shipfox/api-auth-context@0.1.0
|
|
206
|
+
- @shipfox/api-integration-core-dto@0.1.0
|
|
207
|
+
- @shipfox/api-projects@0.1.0
|
|
208
|
+
- @shipfox/node-opentelemetry@0.4.2
|
|
209
|
+
- @shipfox/node-postgres@0.3.2
|
|
210
|
+
- @shipfox/node-temporal@0.1.1
|
|
211
|
+
- @shipfox/node-module@0.1.0
|
|
212
|
+
- @shipfox/node-outbox@0.1.0
|
|
213
|
+
- @shipfox/runner-labels@0.0.1
|
|
214
|
+
- @shipfox/api-projects-dto@0.1.0
|
|
215
|
+
- @shipfox/config@1.2.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shipfox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HarnessToolDeploymentConfig } from '@shipfox/api-agent-dto';
|
|
2
|
+
export declare const config: Readonly<{
|
|
3
|
+
DEFINITION_DEFAULT_RUNNER_LABEL: string;
|
|
4
|
+
AGENT_PI_ENABLED_TOOL_PACKAGES: string;
|
|
5
|
+
AGENT_PI_WEB_SEARCH_ENABLED: boolean;
|
|
6
|
+
} & import("@shipfox/config").CleanedEnvAccessors>;
|
|
7
|
+
export declare function parseDefinitionDefaultRunnerLabels(value: string): readonly string[];
|
|
8
|
+
export declare const definitionDefaultRunnerLabels: readonly string[];
|
|
9
|
+
export declare const definitionHarnessToolDeploymentConfig: HarnessToolDeploymentConfig;
|
|
10
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,MAAM;;;;kDAajB,CAAC;AAEH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAiBnF;AAED,eAAO,MAAM,6BAA6B,mBAEzC,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,2BAIhD,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { buildHarnessToolDeploymentConfig } from '@shipfox/api-agent-dto';
|
|
2
|
+
import { bool, createConfig, str } from '@shipfox/config';
|
|
3
|
+
import { findInvalidLabels, MAX_RUNNER_LABELS, parseLabelList } from '@shipfox/runner-labels';
|
|
4
|
+
export const config = createConfig({
|
|
5
|
+
DEFINITION_DEFAULT_RUNNER_LABEL: str({
|
|
6
|
+
desc: 'Default runner label(s) applied to workflow jobs that do not declare a "runner" at the job or workflow level. Set it to a comma-separated list, for example ubuntu-latest or ubuntu-latest,node-22. Leave it empty to require every workflow job to declare runner labels explicitly; with no value set, a job without a runner fails definition validation.',
|
|
7
|
+
default: ''
|
|
8
|
+
}),
|
|
9
|
+
AGENT_PI_ENABLED_TOOL_PACKAGES: str({
|
|
10
|
+
desc: 'Comma-separated optional Pi tool packages enabled for this deployment. Defaults to pi-web-access so Pi web access is available. Set it to an empty value to enable only Pi built-in tools. Accepted values: pi-web-access.',
|
|
11
|
+
default: 'pi-web-access'
|
|
12
|
+
}),
|
|
13
|
+
AGENT_PI_WEB_SEARCH_ENABLED: bool({
|
|
14
|
+
desc: 'Enables Pi web search tools when pi-web-access is enabled. Set it to false to disable web_search and get_search_content while keeping fetch_content available.',
|
|
15
|
+
default: true
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
export function parseDefinitionDefaultRunnerLabels(value) {
|
|
19
|
+
const labels = parseLabelList(value);
|
|
20
|
+
const invalid = findInvalidLabels(labels);
|
|
21
|
+
if (invalid.length > 0) {
|
|
22
|
+
throw new Error(`DEFINITION_DEFAULT_RUNNER_LABEL contains invalid runner label(s): ${invalid.join(', ')}`);
|
|
23
|
+
}
|
|
24
|
+
if (labels.length > MAX_RUNNER_LABELS) {
|
|
25
|
+
throw new Error(`DEFINITION_DEFAULT_RUNNER_LABEL contains ${labels.length} runner labels; the maximum is ${MAX_RUNNER_LABELS}`);
|
|
26
|
+
}
|
|
27
|
+
return labels;
|
|
28
|
+
}
|
|
29
|
+
export const definitionDefaultRunnerLabels = parseDefinitionDefaultRunnerLabels(config.DEFINITION_DEFAULT_RUNNER_LABEL);
|
|
30
|
+
export const definitionHarnessToolDeploymentConfig = buildHarnessToolDeploymentConfig({
|
|
31
|
+
piEnabledToolPackages: config.AGENT_PI_ENABLED_TOOL_PACKAGES,
|
|
32
|
+
piWebSearchEnabled: config.AGENT_PI_WEB_SEARCH_ENABLED
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"sourcesContent":["import {\n buildHarnessToolDeploymentConfig,\n type HarnessToolDeploymentConfig,\n} from '@shipfox/api-agent-dto';\nimport {bool, createConfig, str} from '@shipfox/config';\nimport {findInvalidLabels, MAX_RUNNER_LABELS, parseLabelList} from '@shipfox/runner-labels';\n\nexport const config = createConfig({\n DEFINITION_DEFAULT_RUNNER_LABEL: str({\n desc: 'Default runner label(s) applied to workflow jobs that do not declare a \"runner\" at the job or workflow level. Set it to a comma-separated list, for example ubuntu-latest or ubuntu-latest,node-22. Leave it empty to require every workflow job to declare runner labels explicitly; with no value set, a job without a runner fails definition validation.',\n default: '',\n }),\n AGENT_PI_ENABLED_TOOL_PACKAGES: str({\n desc: 'Comma-separated optional Pi tool packages enabled for this deployment. Defaults to pi-web-access so Pi web access is available. Set it to an empty value to enable only Pi built-in tools. Accepted values: pi-web-access.',\n default: 'pi-web-access',\n }),\n AGENT_PI_WEB_SEARCH_ENABLED: bool({\n desc: 'Enables Pi web search tools when pi-web-access is enabled. Set it to false to disable web_search and get_search_content while keeping fetch_content available.',\n default: true,\n }),\n});\n\nexport function parseDefinitionDefaultRunnerLabels(value: string): readonly string[] {\n const labels = parseLabelList(value);\n const invalid = findInvalidLabels(labels);\n\n if (invalid.length > 0) {\n throw new Error(\n `DEFINITION_DEFAULT_RUNNER_LABEL contains invalid runner label(s): ${invalid.join(', ')}`,\n );\n }\n\n if (labels.length > MAX_RUNNER_LABELS) {\n throw new Error(\n `DEFINITION_DEFAULT_RUNNER_LABEL contains ${labels.length} runner labels; the maximum is ${MAX_RUNNER_LABELS}`,\n );\n }\n\n return labels;\n}\n\nexport const definitionDefaultRunnerLabels = parseDefinitionDefaultRunnerLabels(\n config.DEFINITION_DEFAULT_RUNNER_LABEL,\n);\n\nexport const definitionHarnessToolDeploymentConfig: HarnessToolDeploymentConfig =\n buildHarnessToolDeploymentConfig({\n piEnabledToolPackages: config.AGENT_PI_ENABLED_TOOL_PACKAGES,\n piWebSearchEnabled: config.AGENT_PI_WEB_SEARCH_ENABLED,\n });\n"],"names":["buildHarnessToolDeploymentConfig","bool","createConfig","str","findInvalidLabels","MAX_RUNNER_LABELS","parseLabelList","config","DEFINITION_DEFAULT_RUNNER_LABEL","desc","default","AGENT_PI_ENABLED_TOOL_PACKAGES","AGENT_PI_WEB_SEARCH_ENABLED","parseDefinitionDefaultRunnerLabels","value","labels","invalid","length","Error","join","definitionDefaultRunnerLabels","definitionHarnessToolDeploymentConfig","piEnabledToolPackages","piWebSearchEnabled"],"mappings":"AAAA,SACEA,gCAAgC,QAE3B,yBAAyB;AAChC,SAAQC,IAAI,EAAEC,YAAY,EAAEC,GAAG,QAAO,kBAAkB;AACxD,SAAQC,iBAAiB,EAAEC,iBAAiB,EAAEC,cAAc,QAAO,yBAAyB;AAE5F,OAAO,MAAMC,SAASL,aAAa;IACjCM,iCAAiCL,IAAI;QACnCM,MAAM;QACNC,SAAS;IACX;IACAC,gCAAgCR,IAAI;QAClCM,MAAM;QACNC,SAAS;IACX;IACAE,6BAA6BX,KAAK;QAChCQ,MAAM;QACNC,SAAS;IACX;AACF,GAAG;AAEH,OAAO,SAASG,mCAAmCC,KAAa;IAC9D,MAAMC,SAAST,eAAeQ;IAC9B,MAAME,UAAUZ,kBAAkBW;IAElC,IAAIC,QAAQC,MAAM,GAAG,GAAG;QACtB,MAAM,IAAIC,MACR,CAAC,kEAAkE,EAAEF,QAAQG,IAAI,CAAC,OAAO;IAE7F;IAEA,IAAIJ,OAAOE,MAAM,GAAGZ,mBAAmB;QACrC,MAAM,IAAIa,MACR,CAAC,yCAAyC,EAAEH,OAAOE,MAAM,CAAC,+BAA+B,EAAEZ,mBAAmB;IAElH;IAEA,OAAOU;AACT;AAEA,OAAO,MAAMK,gCAAgCP,mCAC3CN,OAAOC,+BAA+B,EACtC;AAEF,OAAO,MAAMa,wCACXrB,iCAAiC;IAC/BsB,uBAAuBf,OAAOI,8BAA8B;IAC5DY,oBAAoBhB,OAAOK,2BAA2B;AACxD,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/index.ts"],"sourcesContent":["export * from './integration-context.js';\nexport * from './sync-state.js';\nexport * from './workflow-definition.js';\nexport * from './workflow-model.js';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,kBAAkB;AAChC,cAAc,2BAA2B;AACzC,cAAc,sBAAsB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentToolSelectionCatalog, IntegrationCapability, IntegrationProviderKind } from '@shipfox/api-integration-core-dto';
|
|
2
|
+
export interface IntegrationValidationContext {
|
|
3
|
+
readonly agentToolSelectionCatalogs: ReadonlyMap<IntegrationProviderKind, AgentToolSelectionCatalog>;
|
|
4
|
+
readonly workspaceConnectionSnapshot: ReadonlyMap<string, {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly provider: IntegrationProviderKind;
|
|
7
|
+
readonly capabilities: readonly IntegrationCapability[];
|
|
8
|
+
}>;
|
|
9
|
+
readonly defaultConnectionSlug?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=integration-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-context.d.ts","sourceRoot":"","sources":["../../../src/core/entities/integration-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAC9C,uBAAuB,EACvB,yBAAyB,CAC1B,CAAC;IACF,QAAQ,CAAC,2BAA2B,EAAE,WAAW,CAC/C,MAAM,EACN;QACE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;QAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;KACzD,CACF,CAAC;IACF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/integration-context.ts"],"sourcesContent":["import type {\n AgentToolSelectionCatalog,\n IntegrationCapability,\n IntegrationProviderKind,\n} from '@shipfox/api-integration-core-dto';\n\nexport interface IntegrationValidationContext {\n readonly agentToolSelectionCatalogs: ReadonlyMap<\n IntegrationProviderKind,\n AgentToolSelectionCatalog\n >;\n readonly workspaceConnectionSnapshot: ReadonlyMap<\n string,\n {\n readonly id: string;\n readonly provider: IntegrationProviderKind;\n readonly capabilities: readonly IntegrationCapability[];\n }\n >;\n readonly defaultConnectionSlug?: string | undefined;\n}\n"],"names":[],"mappings":"AAMA,WAcC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type DefinitionSyncStatus = 'pending' | 'syncing' | 'succeeded' | 'failed';
|
|
2
|
+
export declare const DEFINITION_SYNC_ERROR_CODES: readonly ["no-workflow-files", "invalid-definition", "provider-repository-not-found", "provider-file-not-found", "provider-access-denied", "provider-rate-limited", "provider-timeout", "provider-unavailable", "provider-malformed-response", "content-too-large", "too-many-files", "connection-unavailable", "unknown"];
|
|
3
|
+
export type DefinitionSyncErrorCode = (typeof DEFINITION_SYNC_ERROR_CODES)[number];
|
|
4
|
+
export declare function isDefinitionSyncErrorCode(value: unknown): value is DefinitionSyncErrorCode;
|
|
5
|
+
export interface DefinitionSyncState {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
sourceConnectionId: string;
|
|
9
|
+
sourceExternalRepositoryId: string;
|
|
10
|
+
ref: string;
|
|
11
|
+
status: DefinitionSyncStatus;
|
|
12
|
+
lastErrorCode: DefinitionSyncErrorCode | null;
|
|
13
|
+
lastErrorMessage: string | null;
|
|
14
|
+
startedAt: Date | null;
|
|
15
|
+
finishedAt: Date | null;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=sync-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-state.d.ts","sourceRoot":"","sources":["../../../src/core/entities/sync-state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElF,eAAO,MAAM,2BAA2B,4TAc9B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAI1F;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,oBAAoB,CAAC;IAC7B,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC9C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const DEFINITION_SYNC_ERROR_CODES = [
|
|
2
|
+
'no-workflow-files',
|
|
3
|
+
'invalid-definition',
|
|
4
|
+
'provider-repository-not-found',
|
|
5
|
+
'provider-file-not-found',
|
|
6
|
+
'provider-access-denied',
|
|
7
|
+
'provider-rate-limited',
|
|
8
|
+
'provider-timeout',
|
|
9
|
+
'provider-unavailable',
|
|
10
|
+
'provider-malformed-response',
|
|
11
|
+
'content-too-large',
|
|
12
|
+
'too-many-files',
|
|
13
|
+
'connection-unavailable',
|
|
14
|
+
'unknown'
|
|
15
|
+
];
|
|
16
|
+
export function isDefinitionSyncErrorCode(value) {
|
|
17
|
+
return typeof value === 'string' && DEFINITION_SYNC_ERROR_CODES.includes(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=sync-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/sync-state.ts"],"sourcesContent":["export type DefinitionSyncStatus = 'pending' | 'syncing' | 'succeeded' | 'failed';\n\nexport const DEFINITION_SYNC_ERROR_CODES = [\n 'no-workflow-files',\n 'invalid-definition',\n 'provider-repository-not-found',\n 'provider-file-not-found',\n 'provider-access-denied',\n 'provider-rate-limited',\n 'provider-timeout',\n 'provider-unavailable',\n 'provider-malformed-response',\n 'content-too-large',\n 'too-many-files',\n 'connection-unavailable',\n 'unknown',\n] as const;\n\nexport type DefinitionSyncErrorCode = (typeof DEFINITION_SYNC_ERROR_CODES)[number];\n\nexport function isDefinitionSyncErrorCode(value: unknown): value is DefinitionSyncErrorCode {\n return (\n typeof value === 'string' && (DEFINITION_SYNC_ERROR_CODES as readonly string[]).includes(value)\n );\n}\n\nexport interface DefinitionSyncState {\n id: string;\n projectId: string;\n sourceConnectionId: string;\n sourceExternalRepositoryId: string;\n ref: string;\n status: DefinitionSyncStatus;\n lastErrorCode: DefinitionSyncErrorCode | null;\n lastErrorMessage: string | null;\n startedAt: Date | null;\n finishedAt: Date | null;\n createdAt: Date;\n updatedAt: Date;\n}\n"],"names":["DEFINITION_SYNC_ERROR_CODES","isDefinitionSyncErrorCode","value","includes"],"mappings":"AAEA,OAAO,MAAMA,8BAA8B;IACzC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAIX,OAAO,SAASC,0BAA0BC,KAAc;IACtD,OACE,OAAOA,UAAU,YAAY,AAACF,4BAAkDG,QAAQ,CAACD;AAE7F"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { WorkflowDocument } from '@shipfox/workflow-document';
|
|
2
|
+
import type { WorkflowModel } from './workflow-model.js';
|
|
3
|
+
export type WorkflowSpec = WorkflowDocument;
|
|
4
|
+
export interface WorkflowSourceSnapshot {
|
|
5
|
+
content: string;
|
|
6
|
+
format: 'yaml';
|
|
7
|
+
}
|
|
8
|
+
export interface WorkflowDefinitionPayload {
|
|
9
|
+
document: WorkflowDocument;
|
|
10
|
+
model: WorkflowModel;
|
|
11
|
+
sourceSnapshot?: WorkflowSourceSnapshot | null;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowDefinition {
|
|
14
|
+
id: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
configPath: string | null;
|
|
17
|
+
source: 'manual' | 'vcs';
|
|
18
|
+
sha: string | null;
|
|
19
|
+
ref: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Compatibility alias for packages that still consume the authoring document
|
|
23
|
+
* before they migrate to `document`/`model`.
|
|
24
|
+
*/
|
|
25
|
+
definition: WorkflowSpec;
|
|
26
|
+
document: WorkflowDocument;
|
|
27
|
+
model: WorkflowModel;
|
|
28
|
+
sourceSnapshot: WorkflowSourceSnapshot | null;
|
|
29
|
+
contentHash: string | null;
|
|
30
|
+
fetchedAt: Date;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
updatedAt: Date;
|
|
33
|
+
deletedAt: Date | null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=workflow-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-definition.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-definition.ts"],"sourcesContent":["import type {WorkflowDocument} from '@shipfox/workflow-document';\nimport type {WorkflowModel} from './workflow-model.js';\n\nexport type WorkflowSpec = WorkflowDocument;\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\nexport interface WorkflowDefinitionPayload {\n document: WorkflowDocument;\n model: WorkflowModel;\n sourceSnapshot?: WorkflowSourceSnapshot | null;\n}\n\nexport interface WorkflowDefinition {\n id: string;\n projectId: string;\n configPath: string | null;\n source: 'manual' | 'vcs';\n sha: string | null;\n ref: string | null;\n name: string;\n /**\n * Compatibility alias for packages that still consume the authoring document\n * before they migrate to `document`/`model`.\n */\n definition: WorkflowSpec;\n document: WorkflowDocument;\n model: WorkflowModel;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n contentHash: string | null;\n fetchedAt: Date;\n createdAt: Date;\n updatedAt: Date;\n deletedAt: Date | null;\n}\n"],"names":[],"mappings":"AAgBA,WAqBC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { ExpressionType, OutputDeclarations, ResolvedFieldSegment, WorkflowExpression } from '@shipfox/expression';
|
|
2
|
+
import type { AgentThinking, Harness } from '@shipfox/workflow-document';
|
|
3
|
+
export type WorkflowFieldTemplate = readonly ResolvedFieldSegment[];
|
|
4
|
+
export type WorkflowEnvTemplates = Readonly<Record<string, WorkflowFieldTemplate>>;
|
|
5
|
+
export type WorkflowOutputTemplates = Readonly<Record<string, WorkflowFieldTemplate>>;
|
|
6
|
+
export interface WorkflowModel {
|
|
7
|
+
readonly kind: 'workflow';
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
10
|
+
readonly templates?: {
|
|
11
|
+
readonly env?: WorkflowEnvTemplates;
|
|
12
|
+
};
|
|
13
|
+
readonly triggers: readonly WorkflowModelTrigger[];
|
|
14
|
+
readonly jobs: readonly WorkflowModelJob[];
|
|
15
|
+
readonly dependencies: readonly WorkflowModelDependency[];
|
|
16
|
+
}
|
|
17
|
+
export interface WorkflowModelTrigger {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly key: string;
|
|
20
|
+
readonly source: string;
|
|
21
|
+
readonly event: string;
|
|
22
|
+
readonly inputs?: Readonly<Record<string, unknown>>;
|
|
23
|
+
readonly filter?: string;
|
|
24
|
+
readonly config?: Readonly<Record<string, unknown>>;
|
|
25
|
+
}
|
|
26
|
+
export interface WorkflowModelJob {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly key: string;
|
|
29
|
+
readonly mode: WorkflowModelJobMode;
|
|
30
|
+
readonly runner: readonly string[];
|
|
31
|
+
readonly runnerTemplates?: readonly WorkflowFieldTemplate[];
|
|
32
|
+
readonly checkout: WorkflowModelJobCheckout;
|
|
33
|
+
readonly if?: WorkflowExpression;
|
|
34
|
+
readonly success?: string;
|
|
35
|
+
readonly outputs?: WorkflowOutputTemplates;
|
|
36
|
+
readonly outputTypes?: Readonly<Record<string, ExpressionType>>;
|
|
37
|
+
readonly executionTimeoutMs?: number;
|
|
38
|
+
readonly listening?: WorkflowModelJobListening;
|
|
39
|
+
readonly name?: WorkflowFieldTemplate;
|
|
40
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
41
|
+
readonly templates?: {
|
|
42
|
+
readonly env?: WorkflowEnvTemplates;
|
|
43
|
+
};
|
|
44
|
+
readonly dependencies: readonly string[];
|
|
45
|
+
readonly steps: readonly WorkflowModelStep[];
|
|
46
|
+
}
|
|
47
|
+
export type WorkflowModelJobMode = 'one_shot' | 'listening';
|
|
48
|
+
export interface WorkflowModelJobListening {
|
|
49
|
+
readonly on: readonly WorkflowModelListeningTrigger[];
|
|
50
|
+
readonly until?: readonly WorkflowModelListeningTrigger[];
|
|
51
|
+
readonly timeoutMs?: number;
|
|
52
|
+
readonly maxExecutions?: number;
|
|
53
|
+
readonly batch?: WorkflowModelListeningBatch;
|
|
54
|
+
readonly onResolve: 'finish' | 'cancel';
|
|
55
|
+
}
|
|
56
|
+
export interface WorkflowModelListeningTrigger {
|
|
57
|
+
readonly source: string;
|
|
58
|
+
readonly event: string;
|
|
59
|
+
readonly inputs?: Readonly<Record<string, unknown>>;
|
|
60
|
+
readonly filter?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface WorkflowModelListeningBatch {
|
|
63
|
+
readonly debounceMs?: number;
|
|
64
|
+
readonly maxSize?: number;
|
|
65
|
+
readonly maxWaitMs?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface WorkflowModelJobCheckout {
|
|
68
|
+
readonly permissions: {
|
|
69
|
+
readonly contents: 'read' | 'write';
|
|
70
|
+
};
|
|
71
|
+
readonly persistCredentials: boolean;
|
|
72
|
+
}
|
|
73
|
+
export type WorkflowModelStep = WorkflowModelRunStep | WorkflowModelAgentStep;
|
|
74
|
+
interface WorkflowModelStepBase {
|
|
75
|
+
readonly id: string;
|
|
76
|
+
readonly key?: string;
|
|
77
|
+
readonly if?: WorkflowExpression;
|
|
78
|
+
readonly name?: string;
|
|
79
|
+
readonly outputs?: OutputDeclarations;
|
|
80
|
+
readonly gate?: WorkflowModelStepGate;
|
|
81
|
+
readonly sourceLocation?: WorkflowSourceLocation;
|
|
82
|
+
}
|
|
83
|
+
export interface WorkflowModelRunStep extends WorkflowModelStepBase {
|
|
84
|
+
readonly kind: 'run';
|
|
85
|
+
readonly command: WorkflowModelRunCommand;
|
|
86
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
87
|
+
readonly templates?: {
|
|
88
|
+
readonly command?: WorkflowFieldTemplate;
|
|
89
|
+
readonly name?: WorkflowFieldTemplate;
|
|
90
|
+
readonly env?: WorkflowEnvTemplates;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface WorkflowModelAgentStep extends WorkflowModelStepBase {
|
|
94
|
+
readonly kind: 'agent';
|
|
95
|
+
readonly harness?: Harness;
|
|
96
|
+
readonly model?: string;
|
|
97
|
+
readonly provider?: string;
|
|
98
|
+
readonly thinking?: AgentThinking;
|
|
99
|
+
readonly tools?: readonly string[];
|
|
100
|
+
readonly integrations?: readonly WorkflowModelStepIntegration[];
|
|
101
|
+
readonly prompt: string;
|
|
102
|
+
readonly templates?: {
|
|
103
|
+
readonly prompt?: WorkflowFieldTemplate;
|
|
104
|
+
readonly model?: WorkflowFieldTemplate;
|
|
105
|
+
readonly provider?: WorkflowFieldTemplate;
|
|
106
|
+
readonly name?: WorkflowFieldTemplate;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface WorkflowModelStepIntegration {
|
|
110
|
+
readonly connection?: string;
|
|
111
|
+
readonly include: readonly string[];
|
|
112
|
+
readonly exclude?: readonly string[];
|
|
113
|
+
readonly allowWrite: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface WorkflowSourceLocation {
|
|
116
|
+
readonly startLine: number;
|
|
117
|
+
readonly endLine: number;
|
|
118
|
+
}
|
|
119
|
+
export type WorkflowStepSourceLocationMap = ReadonlyMap<string, ReadonlyMap<number, WorkflowSourceLocation>>;
|
|
120
|
+
export interface WorkflowModelRunCommand {
|
|
121
|
+
readonly kind: 'shell';
|
|
122
|
+
readonly value: string;
|
|
123
|
+
}
|
|
124
|
+
export interface WorkflowModelStepGate {
|
|
125
|
+
readonly success?: WorkflowExpression;
|
|
126
|
+
readonly onFailure?: WorkflowModelStepFailureAction;
|
|
127
|
+
}
|
|
128
|
+
export interface WorkflowModelStepFailureAction {
|
|
129
|
+
readonly restartFrom: string;
|
|
130
|
+
readonly feedback?: string;
|
|
131
|
+
readonly feedbackTemplate?: WorkflowFieldTemplate;
|
|
132
|
+
}
|
|
133
|
+
export interface WorkflowModelDependency {
|
|
134
|
+
readonly from: string;
|
|
135
|
+
readonly to: string;
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=workflow-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-model.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,aAAa,EAAE,OAAO,EAAC,MAAM,4BAA4B,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,SAAS,oBAAoB,EAAE,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,C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,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,CACrD,MAAM,EACN,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAC5C,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,8BAA8B,CAAC;CACrD;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CACnD;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-model.ts"],"sourcesContent":["import type {\n ExpressionType,\n OutputDeclarations,\n ResolvedFieldSegment,\n WorkflowExpression,\n} from '@shipfox/expression';\nimport type {AgentThinking, Harness} from '@shipfox/workflow-document';\n\nexport type WorkflowFieldTemplate = readonly ResolvedFieldSegment[];\nexport type WorkflowEnvTemplates = Readonly<Record<string, WorkflowFieldTemplate>>;\nexport type WorkflowOutputTemplates = Readonly<Record<string, WorkflowFieldTemplate>>;\n\nexport interface WorkflowModel {\n readonly kind: 'workflow';\n readonly name: string;\n readonly env?: Readonly<Record<string, string>>;\n readonly templates?: {\n readonly env?: WorkflowEnvTemplates;\n };\n readonly triggers: readonly WorkflowModelTrigger[];\n readonly jobs: readonly WorkflowModelJob[];\n readonly dependencies: readonly WorkflowModelDependency[];\n}\n\nexport interface WorkflowModelTrigger {\n readonly id: string;\n readonly key: string;\n readonly source: string;\n readonly event: string;\n readonly inputs?: Readonly<Record<string, unknown>>;\n readonly filter?: string;\n readonly config?: Readonly<Record<string, unknown>>;\n}\n\nexport interface WorkflowModelJob {\n readonly id: string;\n readonly key: string;\n readonly mode: WorkflowModelJobMode;\n readonly runner: readonly string[];\n readonly runnerTemplates?: readonly WorkflowFieldTemplate[];\n readonly checkout: WorkflowModelJobCheckout;\n readonly if?: WorkflowExpression;\n readonly success?: string;\n readonly outputs?: WorkflowOutputTemplates;\n readonly outputTypes?: Readonly<Record<string, ExpressionType>>;\n readonly executionTimeoutMs?: number;\n readonly listening?: WorkflowModelJobListening;\n readonly name?: WorkflowFieldTemplate;\n readonly env?: Readonly<Record<string, string>>;\n readonly templates?: {\n readonly env?: WorkflowEnvTemplates;\n };\n readonly dependencies: readonly string[];\n readonly steps: readonly WorkflowModelStep[];\n}\n\nexport type WorkflowModelJobMode = 'one_shot' | 'listening';\n\nexport interface WorkflowModelJobListening {\n readonly on: readonly WorkflowModelListeningTrigger[];\n readonly until?: readonly WorkflowModelListeningTrigger[];\n readonly timeoutMs?: number;\n readonly maxExecutions?: number;\n readonly batch?: WorkflowModelListeningBatch;\n readonly onResolve: 'finish' | 'cancel';\n}\n\nexport interface WorkflowModelListeningTrigger {\n readonly source: string;\n readonly event: string;\n readonly inputs?: Readonly<Record<string, unknown>>;\n readonly filter?: string;\n}\n\nexport interface WorkflowModelListeningBatch {\n readonly debounceMs?: number;\n readonly maxSize?: number;\n readonly maxWaitMs?: number;\n}\n\nexport interface WorkflowModelJobCheckout {\n readonly permissions: {readonly contents: 'read' | 'write'};\n readonly persistCredentials: boolean;\n}\n\nexport type WorkflowModelStep = WorkflowModelRunStep | WorkflowModelAgentStep;\n\ninterface WorkflowModelStepBase {\n readonly id: string;\n readonly key?: string;\n readonly if?: WorkflowExpression;\n readonly name?: string;\n readonly outputs?: OutputDeclarations;\n readonly gate?: WorkflowModelStepGate;\n readonly sourceLocation?: WorkflowSourceLocation;\n}\n\nexport interface WorkflowModelRunStep extends WorkflowModelStepBase {\n readonly kind: 'run';\n readonly command: WorkflowModelRunCommand;\n readonly env?: Readonly<Record<string, string>>;\n readonly templates?: {\n readonly command?: WorkflowFieldTemplate;\n readonly name?: WorkflowFieldTemplate;\n readonly env?: WorkflowEnvTemplates;\n };\n}\n\nexport interface WorkflowModelAgentStep extends WorkflowModelStepBase {\n readonly kind: 'agent';\n readonly harness?: Harness;\n readonly model?: string;\n readonly provider?: string;\n readonly thinking?: AgentThinking;\n readonly tools?: readonly string[];\n readonly integrations?: readonly WorkflowModelStepIntegration[];\n readonly prompt: string;\n readonly templates?: {\n readonly prompt?: WorkflowFieldTemplate;\n readonly model?: WorkflowFieldTemplate;\n readonly provider?: WorkflowFieldTemplate;\n readonly name?: WorkflowFieldTemplate;\n };\n}\n\nexport interface WorkflowModelStepIntegration {\n readonly connection?: string;\n readonly include: readonly string[];\n readonly exclude?: readonly string[];\n readonly allowWrite: boolean;\n}\n\nexport interface WorkflowSourceLocation {\n readonly startLine: number;\n readonly endLine: number;\n}\n\nexport type WorkflowStepSourceLocationMap = ReadonlyMap<\n string,\n ReadonlyMap<number, WorkflowSourceLocation>\n>;\n\nexport interface WorkflowModelRunCommand {\n readonly kind: 'shell';\n readonly value: string;\n}\n\nexport interface WorkflowModelStepGate {\n readonly success?: WorkflowExpression;\n readonly onFailure?: WorkflowModelStepFailureAction;\n}\n\nexport interface WorkflowModelStepFailureAction {\n readonly restartFrom: string;\n readonly feedback?: string;\n readonly feedbackTemplate?: WorkflowFieldTemplate;\n}\n\nexport interface WorkflowModelDependency {\n readonly from: string;\n readonly to: string;\n}\n"],"names":[],"mappings":"AA8JA,WAGC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DefinitionSyncErrorCode } from './entities/sync-state.js';
|
|
2
|
+
export declare class DefinitionParseError extends Error {
|
|
3
|
+
details?: unknown | undefined;
|
|
4
|
+
constructor(message: string, details?: unknown | undefined);
|
|
5
|
+
}
|
|
6
|
+
export declare class DefinitionSyncPermanentError extends Error {
|
|
7
|
+
readonly code: DefinitionSyncErrorCode;
|
|
8
|
+
constructor(code: DefinitionSyncErrorCode, message: string);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=errors.d.ts.map
|