@shipfox/api-workflows 13.0.0 → 14.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 +4 -4
- package/CHANGELOG.md +46 -0
- package/README.md +12 -5
- package/dist/core/checkout.d.ts +4 -2
- package/dist/core/checkout.d.ts.map +1 -1
- package/dist/core/checkout.js +7 -2
- package/dist/core/checkout.js.map +1 -1
- package/dist/core/entities/job.d.ts +1 -1
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +23 -4
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/errors.d.ts +9 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +5 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/job-execution.d.ts.map +1 -1
- package/dist/core/job-execution.js +12 -2
- package/dist/core/job-execution.js.map +1 -1
- package/dist/core/run-workflow.js +1 -1
- package/dist/core/run-workflow.js.map +1 -1
- package/dist/core/step-config/agent.d.ts.map +1 -1
- package/dist/core/step-config/agent.js +9 -1
- package/dist/core/step-config/agent.js.map +1 -1
- package/dist/db/db.d.ts +72 -0
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/schema/workflow-runs.d.ts +45 -1
- package/dist/db/schema/workflow-runs.d.ts.map +1 -1
- package/dist/db/schema/workflow-runs.js +42 -1
- package/dist/db/schema/workflow-runs.js.map +1 -1
- package/dist/db/workflow-runs/jobs.d.ts +3 -1
- package/dist/db/workflow-runs/jobs.d.ts.map +1 -1
- package/dist/db/workflow-runs/jobs.js +12 -3
- package/dist/db/workflow-runs/jobs.js.map +1 -1
- package/dist/db/workflow-runs/queries.d.ts +3 -2
- package/dist/db/workflow-runs/queries.d.ts.map +1 -1
- package/dist/db/workflow-runs/queries.js +3 -0
- package/dist/db/workflow-runs/queries.js.map +1 -1
- package/dist/presentation/dto/step.d.ts.map +1 -1
- package/dist/presentation/dto/step.js +14 -0
- package/dist/presentation/dto/step.js.map +1 -1
- package/dist/presentation/dto/workflow-run.d.ts.map +1 -1
- package/dist/presentation/dto/workflow-run.js +14 -0
- package/dist/presentation/dto/workflow-run.js.map +1 -1
- package/dist/presentation/routes/agent-runtime-config.d.ts.map +1 -1
- package/dist/presentation/routes/agent-runtime-config.js +22 -0
- package/dist/presentation/routes/agent-runtime-config.js.map +1 -1
- package/dist/presentation/routes/checkout-token.d.ts.map +1 -1
- package/dist/presentation/routes/checkout-token.js +2 -1
- package/dist/presentation/routes/checkout-token.js.map +1 -1
- package/dist/presentation/routes/get-run-aggregates.d.ts.map +1 -1
- package/dist/presentation/routes/get-run-aggregates.js +2 -1
- package/dist/presentation/routes/get-run-aggregates.js.map +1 -1
- package/dist/presentation/routes/leased-step.d.ts +3 -1
- package/dist/presentation/routes/leased-step.d.ts.map +1 -1
- package/dist/presentation/routes/leased-step.js +2 -1
- package/dist/presentation/routes/leased-step.js.map +1 -1
- package/dist/presentation/routes/list-runs.d.ts.map +1 -1
- package/dist/presentation/routes/list-runs.js +2 -1
- package/dist/presentation/routes/list-runs.js.map +1 -1
- package/dist/presentation/routes/project-access.d.ts +1 -0
- package/dist/presentation/routes/project-access.d.ts.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/drizzle/0004_dev_run_origin.sql +12 -0
- package/drizzle/meta/0004_snapshot.json +1773 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +10 -10
- package/src/core/checkout.test.ts +198 -1
- package/src/core/checkout.ts +18 -5
- package/src/core/entities/job.ts +1 -1
- package/src/core/entities/workflow-run.ts +22 -4
- package/src/core/errors.ts +17 -2
- package/src/core/job-execution.test.ts +54 -0
- package/src/core/job-execution.ts +6 -1
- package/src/core/job-transition/decide-job-activation.test.ts +2 -0
- package/src/core/run-workflow.test.ts +50 -1
- package/src/core/run-workflow.ts +1 -1
- package/src/core/step-config/agent.ts +8 -1
- package/src/core/step-config/complete-step-dispatch-config.test.ts +37 -0
- package/src/core/workflow-run-creation.test.ts +2 -0
- package/src/db/job-listeners.test.ts +17 -0
- package/src/db/schema/workflow-runs.ts +58 -0
- package/src/db/workflow-runs/jobs.ts +17 -3
- package/src/db/workflow-runs/queries.ts +6 -1
- package/src/db/workflow-runs/run-create.test.ts +39 -0
- package/src/presentation/dto/step.test.ts +8 -0
- package/src/presentation/dto/step.ts +9 -0
- package/src/presentation/dto/workflow-run.ts +23 -1
- package/src/presentation/routes/agent-runtime-config.test.ts +84 -2
- package/src/presentation/routes/agent-runtime-config.ts +24 -0
- package/src/presentation/routes/checkout-token.test.ts +45 -0
- package/src/presentation/routes/checkout-token.ts +2 -1
- package/src/presentation/routes/get-run-aggregates.test.ts +56 -0
- package/src/presentation/routes/get-run-aggregates.ts +2 -0
- package/src/presentation/routes/get-step-secrets.test.ts +1 -0
- package/src/presentation/routes/leased-step.ts +7 -1
- package/src/presentation/routes/list-runs.test.ts +152 -0
- package/src/presentation/routes/list-runs.ts +2 -0
- package/test/factories/workflow-run.ts +2 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$ shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js
|
|
2
|
-
Successfully compiled: 123 files with swc (
|
|
3
|
-
2026-08-
|
|
2
|
+
Successfully compiled: 123 files with swc (693.7ms)
|
|
3
|
+
2026-08-23T20:26:54.178Z [INFO] asset workflow-bundle-4d88ac6c229f6c77759a.js 3.31 MiB [emitted] [immutable] (name: main)
|
|
4
4
|
orphan modules 33.5 KiB [orphan] 21 modules
|
|
5
5
|
runtime modules 1.13 KiB 5 modules
|
|
6
6
|
modules by path ../../../node_modules/.pnpm/ 970 KiB 196 modules
|
|
@@ -16,6 +16,6 @@ optional modules 30 bytes [optional]
|
|
|
16
16
|
__temporal_custom_payload_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
17
17
|
__temporal_custom_failure_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
18
18
|
../../shared/node/temporal/dist/workflow-error-interceptor.js 1.21 KiB [built] [code generated]
|
|
19
|
-
webpack 5.107.2 compiled successfully in
|
|
20
|
-
2026-08-
|
|
19
|
+
webpack 5.107.2 compiled successfully in 6661 ms
|
|
20
|
+
2026-08-23T20:26:54.197Z [INFO] Workflow bundle created { size: '3.31MB' }
|
|
21
21
|
/home/runner/work/shipfox/shipfox/libs/api/workflows/dist/temporal/workflows/index.js: 3469609 bytes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @shipfox/api-workflows
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4f30864: Trigger `event` is now optional end to end. An omitted event subscribes to every event from its source. Explicit events continue to work unchanged. Built-in manual and scheduled triggers use `fire` and `tick`, respectively.
|
|
8
|
+
- b766ee3: Adds `origin` and `dev_source` to workflow runs, with an `origin` facet on the run list and aggregates endpoints. Existing runs read as `synced`. Dev runs check out their pinned source commit by default, while same-project replay event commits retain precedence.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 110e8dd: Numbers workflow runs by the workflow lineage id, so runs of one workflow file share a single numbering sequence across definition revisions.
|
|
13
|
+
- 5e87483: Validates workflow run provenance (origin and dev_source) at the API boundary; database constraints now only enforce the origin/source relationship.
|
|
14
|
+
- Updated dependencies [c0fc35b]
|
|
15
|
+
- Updated dependencies [f7b3db8]
|
|
16
|
+
- Updated dependencies [69a92c4]
|
|
17
|
+
- Updated dependencies [09924ca]
|
|
18
|
+
- Updated dependencies [4f30864]
|
|
19
|
+
- Updated dependencies [18e9bad]
|
|
20
|
+
- Updated dependencies [a4df8d9]
|
|
21
|
+
- Updated dependencies [aeaa0de]
|
|
22
|
+
- Updated dependencies [c44641f]
|
|
23
|
+
- Updated dependencies [1b71a66]
|
|
24
|
+
- Updated dependencies [b766ee3]
|
|
25
|
+
- @shipfox/api-definitions-dto@14.0.0
|
|
26
|
+
- @shipfox/api-runners-dto@14.0.0
|
|
27
|
+
- @shipfox/api-agent-dto@14.0.0
|
|
28
|
+
- @shipfox/workflow-document@3.1.0
|
|
29
|
+
- @shipfox/api-workflows-dto@14.0.0
|
|
30
|
+
- @shipfox/api-integration-core-dto@14.0.0
|
|
31
|
+
- @shipfox/api-projects-dto@14.0.0
|
|
32
|
+
- @shipfox/expression@2.2.1
|
|
33
|
+
|
|
34
|
+
## 13.1.0
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 0d3c2e3: Updates @shipfox/client-agent, @shipfox/client-onboarding, and @shipfox/client-workflows to show
|
|
39
|
+
managed inference providers without exposing workspace credential setup, keep workflow examples
|
|
40
|
+
limited to supported models, and explain managed-provider failures in workflow runs.
|
|
41
|
+
- ca91dc3: Adds managed-provider runtime credential resolution and lease-scoped wire fields for pi and Claude harnesses.
|
|
42
|
+
- Updated dependencies [0d3c2e3]
|
|
43
|
+
- Updated dependencies [5c100d6]
|
|
44
|
+
- Updated dependencies [ca91dc3]
|
|
45
|
+
- Updated dependencies [67aab38]
|
|
46
|
+
- @shipfox/api-agent-dto@13.1.0
|
|
47
|
+
- @shipfox/api-workflows-dto@13.1.0
|
|
48
|
+
|
|
3
49
|
## 13.0.0
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -65,11 +65,18 @@ display label and workflow expression value.
|
|
|
65
65
|
|
|
66
66
|
## Behavior Notes
|
|
67
67
|
|
|
68
|
-
Run numbers are sequential within one workflow
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
Run numbers are sequential within one workflow lineage, start at `1`, and are
|
|
69
|
+
unique for `(definition_id, number)`. `workflow_runs.definition_id` carries the
|
|
70
|
+
workflow lineage id: a stable identity per `(project_id, config_path)` shared by
|
|
71
|
+
every definition row of one workflow file. Pathless manual definitions share one
|
|
72
|
+
project-scoped lineage because they have no config path. Runs of a file keep one
|
|
73
|
+
numbering sequence before and after the file merges. The column keeps its v1 name;
|
|
74
|
+
a rename is a separate cleanup. Legacy definition rows are reconciled when read
|
|
75
|
+
or synchronized; the schema migration only adds nullable lineage storage. The
|
|
76
|
+
Workflows module allocates the number with a per-lineage counter inside the
|
|
77
|
+
run-creation transaction. It resolves trigger
|
|
78
|
+
idempotency before allocation, so a duplicate delivery returns the original run
|
|
79
|
+
without consuming another number.
|
|
73
80
|
|
|
74
81
|
Gaps are acceptable because the number is a label and monotonicity matters more
|
|
75
82
|
than density. Counter rows stay after a definition is removed, and reruns create
|
package/dist/core/checkout.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
|
|
2
2
|
import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
|
|
3
3
|
import type { Step } from '#core/entities/step.js';
|
|
4
|
-
import type { WorkflowRunTriggerReference } from '#core/entities/workflow-run.js';
|
|
5
|
-
export declare function createStepCheckoutSpec({ step, workspaceId, projectId, triggerReference, integrations, projects, }: {
|
|
4
|
+
import type { WorkflowRunOriginState, WorkflowRunTriggerReference } from '#core/entities/workflow-run.js';
|
|
5
|
+
export declare function createStepCheckoutSpec({ step, workspaceId, projectId, triggerReference, run, integrations, projects, }: {
|
|
6
6
|
step: Step;
|
|
7
7
|
workspaceId: string;
|
|
8
8
|
projectId: string;
|
|
9
9
|
triggerReference?: WorkflowRunTriggerReference | null | undefined;
|
|
10
|
+
/** The run's origin state; a dev run checks out its dev commit by default. */
|
|
11
|
+
run: WorkflowRunOriginState;
|
|
10
12
|
integrations: IntegrationsModuleClient;
|
|
11
13
|
projects: ProjectsModuleClient;
|
|
12
14
|
}): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/core/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAGjF,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/core/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAGjF,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,gCAAgC,CAAC;AA+BxC,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACJ,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,GAAG,EACH,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,2BAA2B,GAAG,IAAI,GAAG,SAAS,CAAC;IAClE,8EAA8E;IAC9E,GAAG,EAAE,sBAAsB,CAAC;IAC5B,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;CAChC,GAAG,OAAO,CAAC;IACV,IAAI,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC;QACtB,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,CAAC,EAAE;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,IAAI,CAAA;SAAC,CAAC;QACjE,SAAS,CAAC,EAAE;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC,CAAC;KAC3C,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC,CA2DD"}
|
package/dist/core/checkout.js
CHANGED
|
@@ -26,7 +26,7 @@ const checkoutConfigSchema = z.object({
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
export async function createStepCheckoutSpec({ step, workspaceId, projectId, triggerReference, integrations, projects }) {
|
|
29
|
+
export async function createStepCheckoutSpec({ step, workspaceId, projectId, triggerReference, run, integrations, projects }) {
|
|
30
30
|
const checkout = parseCheckoutConfig(step);
|
|
31
31
|
const { project: defaultProject } = await projects.getProjectById({
|
|
32
32
|
projectId
|
|
@@ -52,7 +52,12 @@ export async function createStepCheckoutSpec({ step, workspaceId, projectId, tri
|
|
|
52
52
|
},
|
|
53
53
|
target
|
|
54
54
|
});
|
|
55
|
-
|
|
55
|
+
// Explicit step refs win, followed by same-project event commits (including
|
|
56
|
+
// replays), then the pinned dev commit for the run's own project. Other targets
|
|
57
|
+
// intentionally use the provider default branch.
|
|
58
|
+
const triggerCommitRef = triggerReference?.project?.id === resolvedTarget.projectId ? triggerReference.commit ?? undefined : undefined;
|
|
59
|
+
const devCommitRef = run.origin === 'dev' && resolvedTarget.projectId === projectId ? run.devSource.commit : undefined;
|
|
60
|
+
const ref = checkout.ref ?? triggerCommitRef ?? devCommitRef;
|
|
56
61
|
const response = await integrations.createCheckoutSpec({
|
|
57
62
|
workspaceId,
|
|
58
63
|
connectionId: resolvedTarget.connectionId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/checkout.ts"],"sourcesContent":["import type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {checkoutTargetValidationIssues} from '@shipfox/workflow-document';\nimport {z} from 'zod';\nimport type {Step} from '#core/entities/step.js';\nimport type {WorkflowRunTriggerReference} from '#core/entities/workflow-run.js';\nimport {CheckoutConfigInvalidError, CheckoutIntentUnresolvedError} from './errors.js';\n\nconst checkoutConfigSchema = z\n .object({\n project: z.string().uuid().optional(),\n connection: z.string().min(1).optional(),\n repository: z.string().min(1).optional(),\n ref: z.string().min(1).optional(),\n fetch_depth: z.number().int().nonnegative().optional(),\n permissions: z.object({contents: z.enum(['read', 'write'])}).optional(),\n persist_credentials: z.boolean().optional(),\n })\n .superRefine((checkout, context) => {\n for (const validationIssue of checkoutTargetValidationIssues(checkout)) {\n const message =\n validationIssue.kind === 'project-with-connection'\n ? 'Checkout project cannot be combined with a connection.'\n : validationIssue.kind === 'project-with-repository'\n ? 'Checkout project cannot be combined with a repository.'\n : 'Checkout connection requires a repository.';\n context.addIssue({\n code: 'custom',\n path: [validationIssue.path],\n message,\n });\n }\n });\n\ntype CheckoutConfig = z.infer<typeof checkoutConfigSchema>;\n\nexport async function createStepCheckoutSpec({\n step,\n workspaceId,\n projectId,\n triggerReference,\n integrations,\n projects,\n}: {\n step: Step;\n workspaceId: string;\n projectId: string;\n triggerReference?: WorkflowRunTriggerReference | null | undefined;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n}): Promise<{\n spec: {\n repositoryUrl: string;\n ref: string;\n credentials?: {username: string; token: string; expiresAt: Date};\n gitAuthor?: {name: string; email: string};\n };\n fetchDepth: number;\n persistCredentials: boolean;\n}> {\n const checkout = parseCheckoutConfig(step);\n const {project: defaultProject} = await projects.getProjectById({projectId});\n if (defaultProject === null || defaultProject === undefined) {\n throw new CheckoutIntentUnresolvedError({kind: 'project', value: projectId});\n }\n\n const target = await checkoutTarget({\n checkout,\n defaultProjectId: projectId,\n defaultConnectionId: defaultProject.sourceConnectionId,\n integrations,\n workspaceId,\n });\n const resolvedTarget = await projects.resolveCheckoutTarget({\n workspaceId,\n defaults: {\n connectionId: defaultProject.sourceConnectionId,\n owner: defaultOwner(defaultProject.sourceRepositoryOwner, checkout.repository),\n },\n target,\n });\n const ref =\n checkout.ref ??\n (triggerReference?.project?.id === resolvedTarget.projectId\n ? (triggerReference.commit ?? undefined)\n : undefined);\n const response = await integrations.createCheckoutSpec({\n workspaceId,\n connectionId: resolvedTarget.connectionId,\n externalRepositoryId: resolvedTarget.externalRepositoryId,\n ...(ref === undefined ? {} : {ref}),\n permissions: checkout.permissions ?? {contents: 'read'},\n });\n\n return {\n spec: {\n repositoryUrl: response.repositoryUrl,\n ref: response.ref,\n ...(response.credentials\n ? {\n credentials: {\n ...response.credentials,\n expiresAt: new Date(response.credentials.expiresAt),\n },\n }\n : {}),\n ...(response.gitAuthor === undefined ? {} : {gitAuthor: response.gitAuthor}),\n },\n fetchDepth: checkout.fetch_depth ?? 1,\n persistCredentials: checkout.persist_credentials ?? true,\n };\n}\n\nfunction parseCheckoutConfig(step: Step): CheckoutConfig {\n const result = checkoutConfigSchema.safeParse(step.config.checkout);\n if (!result.success) {\n throw new CheckoutConfigInvalidError(step.id);\n }\n return result.data;\n}\n\nasync function checkoutTarget(params: {\n checkout: CheckoutConfig;\n defaultProjectId: string;\n defaultConnectionId: string;\n integrations: IntegrationsModuleClient;\n workspaceId: string;\n}) {\n const {checkout} = params;\n if (checkout.project !== undefined) return {project: checkout.project};\n if (checkout.repository !== undefined) {\n const connection =\n checkout.connection === undefined\n ? undefined\n : await resolveConnectionId({\n integrations: params.integrations,\n workspaceId: params.workspaceId,\n defaultConnectionId: params.defaultConnectionId,\n slug: checkout.connection,\n });\n return {\n ...(connection === undefined ? {} : {connection}),\n repository: checkout.repository,\n };\n }\n return {project: params.defaultProjectId};\n}\n\nasync function resolveConnectionId(params: {\n integrations: IntegrationsModuleClient;\n workspaceId: string;\n defaultConnectionId: string;\n slug: string;\n}): Promise<string> {\n const connection = await params.integrations.resolveConnection({\n workspaceId: params.workspaceId,\n slug: params.slug,\n });\n if (connection === null) {\n throw new CheckoutIntentUnresolvedError({kind: 'connection', value: params.slug});\n }\n return connection.id;\n}\n\nfunction defaultOwner(\n projectOwner: string | null | undefined,\n repository: string | undefined,\n): string {\n if (projectOwner) return projectOwner;\n const separator = repository?.indexOf('/') ?? -1;\n if (separator > 0 && repository !== undefined) return repository.slice(0, separator);\n return 'unknown';\n}\n"],"names":["checkoutTargetValidationIssues","z","CheckoutConfigInvalidError","CheckoutIntentUnresolvedError","checkoutConfigSchema","object","project","string","uuid","optional","connection","min","repository","ref","fetch_depth","number","int","nonnegative","permissions","contents","enum","persist_credentials","boolean","superRefine","checkout","context","validationIssue","message","kind","addIssue","code","path","createStepCheckoutSpec","step","workspaceId","projectId","triggerReference","integrations","projects","parseCheckoutConfig","defaultProject","getProjectById","undefined","value","target","checkoutTarget","defaultProjectId","defaultConnectionId","sourceConnectionId","resolvedTarget","resolveCheckoutTarget","defaults","connectionId","owner","defaultOwner","sourceRepositoryOwner","id","commit","response","createCheckoutSpec","externalRepositoryId","spec","repositoryUrl","credentials","expiresAt","Date","gitAuthor","fetchDepth","persistCredentials","result","safeParse","config","success","data","params","resolveConnectionId","slug","resolveConnection","projectOwner","separator","indexOf","slice"],"mappings":"AAEA,SAAQA,8BAA8B,QAAO,6BAA6B;AAC1E,SAAQC,CAAC,QAAO,MAAM;AAGtB,SAAQC,0BAA0B,EAAEC,6BAA6B,QAAO,cAAc;AAEtF,MAAMC,uBAAuBH,EAC1BI,MAAM,CAAC;IACNC,SAASL,EAAEM,MAAM,GAAGC,IAAI,GAAGC,QAAQ;IACnCC,YAAYT,EAAEM,MAAM,GAAGI,GAAG,CAAC,GAAGF,QAAQ;IACtCG,YAAYX,EAAEM,MAAM,GAAGI,GAAG,CAAC,GAAGF,QAAQ;IACtCI,KAAKZ,EAAEM,MAAM,GAAGI,GAAG,CAAC,GAAGF,QAAQ;IAC/BK,aAAab,EAAEc,MAAM,GAAGC,GAAG,GAAGC,WAAW,GAAGR,QAAQ;IACpDS,aAAajB,EAAEI,MAAM,CAAC;QA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A,eAAegC,YAAY,CAAC,IAAI;gBAAChC;YAAU,CAAC;YAChDE,YAAYY,SAASZ,UAAU;QACjC;IACF;IACA,OAAO;QAACN,SAASoE,OAAO5B,gBAAgB;IAAA;AAC1C;AAEA,eAAe6B,oBAAoBD,MAKlC;IACC,MAAMhE,aAAa,MAAMgE,OAAOrC,YAAY,CAACwC,iBAAiB,CAAC;QAC7D3C,aAAawC,OAAOxC,WAAW;QAC/B0C,MAAMF,OAAOE,IAAI;IACnB;IACA,IAAIlE,eAAe,MAAM;QACvB,MAAM,IAAIP,8BAA8B;YAACyB,MAAM;YAAce,OAAO+B,OAAOE,IAAI;QAAA;IACjF;IACA,OAAOlE,WAAW8C,EAAE;AACtB;AAEA,SAASF,aACPwB,YAAuC,EACvClE,UAA8B;IAE9B,IAAIkE,cAAc,OAAOA;IACzB,MAAMC,YAAYnE,YAAYoE,QAAQ,QAAQ,CAAC;IAC/C,IAAID,YAAY,KAAKnE,eAAe8B,WAAW,OAAO9B,WAAWqE,KAAK,CAAC,GAAGF;IAC1E,OAAO;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/checkout.ts"],"sourcesContent":["import type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {checkoutTargetValidationIssues} from '@shipfox/workflow-document';\nimport {z} from 'zod';\nimport type {Step} from '#core/entities/step.js';\nimport type {\n WorkflowRunOriginState,\n WorkflowRunTriggerReference,\n} from '#core/entities/workflow-run.js';\nimport {CheckoutConfigInvalidError, CheckoutIntentUnresolvedError} from './errors.js';\n\nconst checkoutConfigSchema = z\n .object({\n project: z.string().uuid().optional(),\n connection: z.string().min(1).optional(),\n repository: z.string().min(1).optional(),\n ref: z.string().min(1).optional(),\n fetch_depth: z.number().int().nonnegative().optional(),\n permissions: z.object({contents: z.enum(['read', 'write'])}).optional(),\n persist_credentials: z.boolean().optional(),\n })\n .superRefine((checkout, context) => {\n for (const validationIssue of checkoutTargetValidationIssues(checkout)) {\n const message =\n validationIssue.kind === 'project-with-connection'\n ? 'Checkout project cannot be combined with a connection.'\n : validationIssue.kind === 'project-with-repository'\n ? 'Checkout project cannot be combined with a repository.'\n : 'Checkout connection requires a repository.';\n context.addIssue({\n code: 'custom',\n path: [validationIssue.path],\n message,\n });\n }\n });\n\ntype CheckoutConfig = z.infer<typeof checkoutConfigSchema>;\n\nexport async function createStepCheckoutSpec({\n step,\n workspaceId,\n projectId,\n triggerReference,\n run,\n integrations,\n projects,\n}: {\n step: Step;\n workspaceId: string;\n projectId: string;\n triggerReference?: WorkflowRunTriggerReference | null | undefined;\n /** The run's origin state; a dev run checks out its dev commit by default. */\n run: WorkflowRunOriginState;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n}): Promise<{\n spec: {\n repositoryUrl: string;\n ref: string;\n credentials?: {username: string; token: string; expiresAt: Date};\n gitAuthor?: {name: string; email: string};\n };\n fetchDepth: number;\n persistCredentials: boolean;\n}> {\n const checkout = parseCheckoutConfig(step);\n const {project: defaultProject} = await projects.getProjectById({projectId});\n if (defaultProject === null || defaultProject === undefined) {\n throw new CheckoutIntentUnresolvedError({kind: 'project', value: projectId});\n }\n\n const target = await checkoutTarget({\n checkout,\n defaultProjectId: projectId,\n defaultConnectionId: defaultProject.sourceConnectionId,\n integrations,\n workspaceId,\n });\n const resolvedTarget = await projects.resolveCheckoutTarget({\n workspaceId,\n defaults: {\n connectionId: defaultProject.sourceConnectionId,\n owner: defaultOwner(defaultProject.sourceRepositoryOwner, checkout.repository),\n },\n target,\n });\n // Explicit step refs win, followed by same-project event commits (including\n // replays), then the pinned dev commit for the run's own project. Other targets\n // intentionally use the provider default branch.\n const triggerCommitRef =\n triggerReference?.project?.id === resolvedTarget.projectId\n ? (triggerReference.commit ?? undefined)\n : undefined;\n const devCommitRef =\n run.origin === 'dev' && resolvedTarget.projectId === projectId\n ? run.devSource.commit\n : undefined;\n const ref = checkout.ref ?? triggerCommitRef ?? devCommitRef;\n const response = await integrations.createCheckoutSpec({\n workspaceId,\n connectionId: resolvedTarget.connectionId,\n externalRepositoryId: resolvedTarget.externalRepositoryId,\n ...(ref === undefined ? {} : {ref}),\n permissions: checkout.permissions ?? {contents: 'read'},\n });\n\n return {\n spec: {\n repositoryUrl: response.repositoryUrl,\n ref: response.ref,\n ...(response.credentials\n ? {\n credentials: {\n ...response.credentials,\n expiresAt: new Date(response.credentials.expiresAt),\n },\n }\n : {}),\n ...(response.gitAuthor === undefined ? {} : {gitAuthor: response.gitAuthor}),\n },\n fetchDepth: checkout.fetch_depth ?? 1,\n persistCredentials: checkout.persist_credentials ?? true,\n };\n}\n\nfunction parseCheckoutConfig(step: Step): CheckoutConfig {\n const result = checkoutConfigSchema.safeParse(step.config.checkout);\n if (!result.success) {\n throw new CheckoutConfigInvalidError(step.id);\n }\n return result.data;\n}\n\nasync function checkoutTarget(params: {\n checkout: CheckoutConfig;\n defaultProjectId: string;\n defaultConnectionId: string;\n integrations: IntegrationsModuleClient;\n workspaceId: string;\n}) {\n const {checkout} = params;\n if (checkout.project !== undefined) return {project: checkout.project};\n if (checkout.repository !== undefined) {\n const connection =\n checkout.connection === undefined\n ? undefined\n : await resolveConnectionId({\n integrations: params.integrations,\n workspaceId: params.workspaceId,\n defaultConnectionId: params.defaultConnectionId,\n slug: checkout.connection,\n });\n return {\n ...(connection === undefined ? {} : {connection}),\n repository: checkout.repository,\n };\n }\n return {project: params.defaultProjectId};\n}\n\nasync function resolveConnectionId(params: {\n integrations: IntegrationsModuleClient;\n workspaceId: string;\n defaultConnectionId: string;\n slug: string;\n}): Promise<string> {\n const connection = await params.integrations.resolveConnection({\n workspaceId: params.workspaceId,\n slug: params.slug,\n });\n if (connection === null) {\n throw new CheckoutIntentUnresolvedError({kind: 'connection', value: params.slug});\n }\n return connection.id;\n}\n\nfunction defaultOwner(\n projectOwner: string | null | undefined,\n repository: string | undefined,\n): string {\n if (projectOwner) return projectOwner;\n const separator = repository?.indexOf('/') ?? -1;\n if (separator > 0 && repository !== undefined) return repository.slice(0, separator);\n return 'unknown';\n}\n"],"names":["checkoutTargetValidationIssues","z","CheckoutConfigInvalidError","CheckoutIntentUnresolvedError","checkoutConfigSchema","object","project","string","uuid","optional","connection","min","repository","ref","fetch_depth","number","int","nonnegative","permissions","contents","enum","persist_credentials","boolean","superRefine","checkout","context","validationIssue","message","kind","addIssue","code","path","createStepCheckoutSpec","step","workspaceId","projectId","triggerReference","run","integrations","projects","parseCheckoutConfig","defaultProject","getProjectById","undefined","value","target","checkoutTarget","defaultProjectId","defaultConnectionId","sourceConnectionId","resolvedTarget","resolveCheckoutTarget","defaults","connectionId","owner","defaultOwner","sourceRepositoryOwner","triggerCommitRef","id","commit","devCommitRef","origin","devSource","response","createCheckoutSpec","externalRepositoryId","spec","repositoryUrl","credentials","expiresAt","Date","gitAuthor","fetchDepth","persistCredentials","result","safeParse","config","success","data","params","resolveConnectionId","slug","resolveConnection","projectOwner","separator","indexOf","slice"],"mappings":"AAEA,SAAQA,8BAA8B,QAAO,6BAA6B;AAC1E,SAAQC,CAAC,QAAO,MAAM;AAMtB,SAAQC,0BAA0B,EAAEC,6BAA6B,QAAO,cAAc;AAEtF,MAAMC,uBAAuBH,EAC1BI,MAAM,CAAC;IACNC,SAASL,EAAEM,MAAM,GAAGC,IAAI,GAAGC,QAAQ;IACnCC,YAAYT,EAAEM,MAAM,GAAGI,GAAG,CAAC,GAAGF,QAAQ;IACtCG,YAAYX,EAAEM,MAAM,GAAGI,GAAG,CAAC,GAAGF,QAAQ;IACtCI,KAAKZ,EAAEM,MAAM,GAAGI,GAAG,CAAC,GAAGF,QAAQ;IAC/BK,aAAab,EAAEc,MAAM,GAAGC,GAAG,GAAGC,WAAW,GAAGR,QAAQ;IACpDS,aAAajB,EAAEI,MAAM,CAAC;QAACc,UAAUlB,EAAEmB,IAAI,CAAC;YAAC;YAAQ;SAAQ;IAAC,GAAGX,QAAQ;IACrEY,qBAAqBpB,EAAEqB,O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AM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,SAAS,EACT,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CACjD,CAAC;AAIF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,IAAI,iBAAiB,CAE5E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,GAAG,IAAI,CAK9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/job.ts"],"sourcesContent":["import type {PersistedEvaluationTraceEntry} from './step.js';\n\nexport type JobStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped';\n\nexport type JobMode = 'one_shot' | 'listening';\n\nexport type ListenerStatus = 'inactive' | 'listening' | 'resolved';\n\nexport type ResolutionReason = 'until' | 'timeout' | 'max_executions' | 'cancelled';\n\nexport interface JobCheckout {\n permissions: {\n contents: 'read' | 'write';\n };\n persistCredentials: boolean;\n}\n\nexport const JOB_STATUS_REASONS = [\n 'dependency_not_completed',\n 'condition_false',\n 'default_gate_rejected',\n 'condition_rejected',\n 'condition_errored',\n 'user_cancelled',\n 'run_cancelled',\n 'timed_out',\n 'runner_lost',\n 'output_too_large',\n 'step_failed',\n 'unknown',\n 'output_invalid',\n] as const;\n\nexport type JobStatusReason = (typeof JOB_STATUS_REASONS)[number];\n\nconst JOB_STATUS_REASON_SET = new Set<JobStatusReason>(JOB_STATUS_REASONS);\n\nexport interface Job {\n id: string;\n workflowRunAttemptId: string;\n key: string;\n mode: JobMode;\n name: string | null;\n status: JobStatus;\n statusReason: JobStatusReason | null;\n carriedOver: boolean;\n checkout: JobCheckout;\n success?: string | null;\n evaluationTrace?: readonly PersistedEvaluationTraceEntry[] | null;\n executionTimeoutMs?: number | null;\n listeningTimeoutMs: number | null;\n maxExecutions: number | null;\n onResolve: 'finish' | 'cancel' | null;\n batchDebounceMs: number | null;\n batchMaxSize: number | null;\n batchMaxWaitMs: number | null;\n listenerStatus: ListenerStatus;\n resolutionReason: ResolutionReason | null;\n listeningOn: JobListeningTrigger[] | null;\n listeningUntil: JobListeningTrigger[] | null;\n outputs: Record<string, unknown> | null;\n dependencies: string[];\n runner: string[] | null;\n position: number;\n version: number;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface JobListeningTrigger {\n readonly source: string;\n readonly event
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/job.ts"],"sourcesContent":["import type {PersistedEvaluationTraceEntry} from './step.js';\n\nexport type JobStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped';\n\nexport type JobMode = 'one_shot' | 'listening';\n\nexport type ListenerStatus = 'inactive' | 'listening' | 'resolved';\n\nexport type ResolutionReason = 'until' | 'timeout' | 'max_executions' | 'cancelled';\n\nexport interface JobCheckout {\n permissions: {\n contents: 'read' | 'write';\n };\n persistCredentials: boolean;\n}\n\nexport const JOB_STATUS_REASONS = [\n 'dependency_not_completed',\n 'condition_false',\n 'default_gate_rejected',\n 'condition_rejected',\n 'condition_errored',\n 'user_cancelled',\n 'run_cancelled',\n 'timed_out',\n 'runner_lost',\n 'output_too_large',\n 'step_failed',\n 'unknown',\n 'output_invalid',\n] as const;\n\nexport type JobStatusReason = (typeof JOB_STATUS_REASONS)[number];\n\nconst JOB_STATUS_REASON_SET = new Set<JobStatusReason>(JOB_STATUS_REASONS);\n\nexport interface Job {\n id: string;\n workflowRunAttemptId: string;\n key: string;\n mode: JobMode;\n name: string | null;\n status: JobStatus;\n statusReason: JobStatusReason | null;\n carriedOver: boolean;\n checkout: JobCheckout;\n success?: string | null;\n evaluationTrace?: readonly PersistedEvaluationTraceEntry[] | null;\n executionTimeoutMs?: number | null;\n listeningTimeoutMs: number | null;\n maxExecutions: number | null;\n onResolve: 'finish' | 'cancel' | null;\n batchDebounceMs: number | null;\n batchMaxSize: number | null;\n batchMaxWaitMs: number | null;\n listenerStatus: ListenerStatus;\n resolutionReason: ResolutionReason | null;\n listeningOn: JobListeningTrigger[] | null;\n listeningUntil: JobListeningTrigger[] | null;\n outputs: Record<string, unknown> | null;\n dependencies: string[];\n runner: string[] | null;\n position: number;\n version: number;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface JobListeningTrigger {\n readonly source: string;\n readonly event?: string;\n readonly inputs?: Readonly<Record<string, unknown>>;\n readonly filter?: string;\n}\n\nexport type TerminalJobStatus = Extract<\n JobStatus,\n 'succeeded' | 'failed' | 'cancelled' | 'skipped'\n>;\n\nconst TERMINAL_JOB_STATUSES = new Set<JobStatus>(['succeeded', 'failed', 'cancelled', 'skipped']);\n\nexport function isJobTerminal(status: JobStatus): status is TerminalJobStatus {\n return TERMINAL_JOB_STATUSES.has(status);\n}\n\nexport function toJobStatusReason(value: string | null): JobStatusReason | null {\n if (value === null) return null;\n return JOB_STATUS_REASON_SET.has(value as JobStatusReason)\n ? (value as JobStatusReason)\n : 'unknown';\n}\n"],"names":["JOB_STATUS_REASONS","JOB_STATUS_REASON_SET","Set","TERMINAL_JOB_STATUSES","isJobTerminal","status","has","toJobStatusReason","value"],"mappings":"AAiBA,OAAO,MAAMA,qBAAqB;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAIX,MAAMC,wBAAwB,IAAIC,IAAqBF;AA8CvD,MAAMG,wBAAwB,IAAID,IAAe;IAAC;IAAa;IAAU;IAAa;CAAU;AAEhG,OAAO,SAASE,cAAcC,MAAiB;IAC7C,OAAOF,sBAAsBG,GAAG,CAACD;AACnC;AAEA,OAAO,SAASE,kBAAkBC,KAAoB;IACpD,IAAIA,UAAU,MAAM,OAAO;IAC3B,OAAOP,sBAAsBK,GAAG,CAACE,SAC5BA,QACD;AACN"}
|
|
@@ -3,6 +3,25 @@ import type { JobExecution } from './job-execution.js';
|
|
|
3
3
|
import type { Step, StepAttempt } from './step.js';
|
|
4
4
|
import type { WorkflowRunAttempt } from './workflow-run-attempt.js';
|
|
5
5
|
export type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
6
|
+
export type WorkflowRunOrigin = 'synced' | 'dev';
|
|
7
|
+
/**
|
|
8
|
+
* Why a dev run was created: the ref and pinned commit the definition came from, the
|
|
9
|
+
* file that ran, the user who started it, and the journaled event it replays when any.
|
|
10
|
+
*/
|
|
11
|
+
export interface WorkflowRunDevSource {
|
|
12
|
+
ref: string;
|
|
13
|
+
commit: string;
|
|
14
|
+
configPath: string;
|
|
15
|
+
initiatedByUserId: string;
|
|
16
|
+
replayOfEventId: string | null;
|
|
17
|
+
}
|
|
18
|
+
export type WorkflowRunOriginState = {
|
|
19
|
+
origin: 'synced';
|
|
20
|
+
devSource: null;
|
|
21
|
+
} | {
|
|
22
|
+
origin: 'dev';
|
|
23
|
+
devSource: WorkflowRunDevSource;
|
|
24
|
+
};
|
|
6
25
|
export type TerminalWorkflowRunStatus = Extract<WorkflowRunStatus, 'succeeded' | 'failed' | 'cancelled'>;
|
|
7
26
|
export declare function isWorkflowRunTerminal(status: WorkflowRunStatus): status is TerminalWorkflowRunStatus;
|
|
8
27
|
export interface WorkflowRunTriggerReference {
|
|
@@ -36,7 +55,7 @@ export type TriggerPayload = {
|
|
|
36
55
|
deliveryId: string;
|
|
37
56
|
data: unknown;
|
|
38
57
|
};
|
|
39
|
-
export
|
|
58
|
+
export type WorkflowRun = WorkflowRunOriginState & {
|
|
40
59
|
id: string;
|
|
41
60
|
workspaceId: string;
|
|
42
61
|
projectId: string;
|
|
@@ -65,7 +84,7 @@ export interface WorkflowRun {
|
|
|
65
84
|
updatedAt: Date;
|
|
66
85
|
startedAt: Date | null;
|
|
67
86
|
finishedAt: Date | null;
|
|
68
|
-
}
|
|
87
|
+
};
|
|
69
88
|
export interface StepDetail extends Step {
|
|
70
89
|
attempts: StepAttempt[];
|
|
71
90
|
}
|
|
@@ -75,12 +94,12 @@ export interface JobExecutionDetail extends JobExecution {
|
|
|
75
94
|
export interface WorkflowJobDetail extends Job {
|
|
76
95
|
jobExecutions: JobExecutionDetail[];
|
|
77
96
|
}
|
|
78
|
-
export
|
|
97
|
+
export type WorkflowRunDetail = WorkflowRun & {
|
|
79
98
|
runAttempt: WorkflowRunAttempt;
|
|
80
99
|
latestAttempt: number;
|
|
81
100
|
jobs: WorkflowJobDetail[];
|
|
82
101
|
/** Whether any job execution of this attempt reached its runner, decided here so the detail
|
|
83
102
|
* and the list cannot answer it differently. */
|
|
84
103
|
hasStartedJobExecution: boolean;
|
|
85
|
-
}
|
|
104
|
+
};
|
|
86
105
|
//# sourceMappingURL=workflow-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAC,IAAI,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SA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BAA2B,GAAG,IAAI,GAAG,SAAS,CAAC;IAClE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,IAAI;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,GAAG;IAC5C,aAAa,EAAE,kBAAkB,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,UAAU,EAAE,kBAAkB,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B;oDACgD;IAChD,sBAAsB,EAAE,OAAO,CAAC;CACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import type {Job} from './job.js';\nimport type {JobExecution} from './job-execution.js';\nimport type {Step, StepAttempt} from './step.js';\nimport type {WorkflowRunAttempt} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\n\nexport type TerminalWorkflowRunStatus = Extract<\n WorkflowRunStatus,\n 'succeeded' | 'failed' | 'cancelled'\n>;\n\nconst TERMINAL_WORKFLOW_RUN_STATUSES = new Set<WorkflowRunStatus>([\n 'succeeded',\n 'failed',\n 'cancelled',\n]);\n\nexport function isWorkflowRunTerminal(\n status: WorkflowRunStatus,\n): status is TerminalWorkflowRunStatus {\n return TERMINAL_WORKFLOW_RUN_STATUSES.has(status);\n}\n\nexport interface WorkflowRunTriggerReference {\n project: {id: string} | null;\n repository: string | null;\n ref: string | null;\n commit: string | null;\n actor: string | null;\n}\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\nexport type TriggerPayload =\n | {\n source: 'manual';\n provider?: 'manual' | undefined;\n event: 'fire';\n subscriptionId: string;\n userId: string;\n }\n | {\n source: 'cron';\n provider?: 'cron' | undefined;\n event: 'tick';\n scheduleId: string;\n }\n // Integration sources (github, gitlab, sentry, …) flow through opaquely: the\n // run records what fired it and carries the raw event payload, without the\n // triggers module having to know each source's shape.\n | {\n source: string;\n provider?: string | undefined;\n event: string;\n deliveryId: string;\n data: unknown;\n };\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import type {Job} from './job.js';\nimport type {JobExecution} from './job-execution.js';\nimport type {Step, StepAttempt} from './step.js';\nimport type {WorkflowRunAttempt} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\n\nexport type WorkflowRunOrigin = 'synced' | 'dev';\n\n/**\n * Why a dev run was created: the ref and pinned commit the definition came from, the\n * file that ran, the user who started it, and the journaled event it replays when any.\n */\nexport interface WorkflowRunDevSource {\n ref: string;\n commit: string;\n configPath: string;\n initiatedByUserId: string;\n replayOfEventId: string | null;\n}\n\nexport type WorkflowRunOriginState =\n | {origin: 'synced'; devSource: null}\n | {origin: 'dev'; devSource: WorkflowRunDevSource};\n\nexport type TerminalWorkflowRunStatus = Extract<\n WorkflowRunStatus,\n 'succeeded' | 'failed' | 'cancelled'\n>;\n\nconst TERMINAL_WORKFLOW_RUN_STATUSES = new Set<WorkflowRunStatus>([\n 'succeeded',\n 'failed',\n 'cancelled',\n]);\n\nexport function isWorkflowRunTerminal(\n status: WorkflowRunStatus,\n): status is TerminalWorkflowRunStatus {\n return TERMINAL_WORKFLOW_RUN_STATUSES.has(status);\n}\n\nexport interface WorkflowRunTriggerReference {\n project: {id: string} | null;\n repository: string | null;\n ref: string | null;\n commit: string | null;\n actor: string | null;\n}\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\nexport type TriggerPayload =\n | {\n source: 'manual';\n provider?: 'manual' | undefined;\n event: 'fire';\n subscriptionId: string;\n userId: string;\n }\n | {\n source: 'cron';\n provider?: 'cron' | undefined;\n event: 'tick';\n scheduleId: string;\n }\n // Integration sources (github, gitlab, sentry, …) flow through opaquely: the\n // run records what fired it and carries the raw event payload, without the\n // triggers module having to know each source's shape.\n | {\n source: string;\n provider?: string | undefined;\n event: string;\n deliveryId: string;\n data: unknown;\n };\n\nexport type WorkflowRun = WorkflowRunOriginState & {\n id: string;\n workspaceId: string;\n projectId: string;\n definitionId: string;\n number: number;\n /** Effective runtime name: the resolved override, or workflowName when absent. */\n name: string;\n /** Static workflow-name snapshot preserved from the definition at creation. */\n workflowName: string;\n /** Nullable resolved override retained for rerun fidelity. */\n nameOverride: string | null;\n status: WorkflowRunStatus;\n currentAttempt: number;\n triggerProvider: string | null;\n triggerSource: string;\n triggerEvent: string;\n triggerPayload: TriggerPayload;\n /** Provider-neutral trigger facts captured at run creation, when available. */\n triggerReference?: WorkflowRunTriggerReference | null | undefined;\n inputs: Record<string, unknown> | null;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n triggerIdempotencyKey: string | null;\n timeoutMs: number;\n version: number;\n createdAt: Date;\n updatedAt: Date;\n startedAt: Date | null;\n finishedAt: Date | null;\n};\n\nexport interface StepDetail extends Step {\n attempts: StepAttempt[];\n}\n\nexport interface JobExecutionDetail extends JobExecution {\n steps: StepDetail[];\n}\n\nexport interface WorkflowJobDetail extends Job {\n jobExecutions: JobExecutionDetail[];\n}\n\nexport type WorkflowRunDetail = WorkflowRun & {\n runAttempt: WorkflowRunAttempt;\n latestAttempt: number;\n jobs: WorkflowJobDetail[];\n /** Whether any job execution of this attempt reached its runner, decided here so the detail\n * and the list cannot answer it differently. */\n hasStartedJobExecution: boolean;\n};\n"],"names":["TERMINAL_WORKFLOW_RUN_STATUSES","Set","isWorkflowRunTerminal","status","has"],"mappings":"AA8BA,MAAMA,iCAAiC,IAAIC,IAAuB;IAChE;IACA;IACA;CACD;AAED,OAAO,SAASC,sBACdC,MAAyB;IAEzB,OAAOH,+BAA+BI,GAAG,CAACD;AAC5C"}
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -18,9 +18,17 @@ export declare class WorkspaceNotFoundError extends Error {
|
|
|
18
18
|
readonly workspaceId: string;
|
|
19
19
|
constructor(workspaceId: string);
|
|
20
20
|
}
|
|
21
|
+
export interface AgentConfigUnresolvableErrorOptions {
|
|
22
|
+
readonly cause?: unknown;
|
|
23
|
+
readonly message?: string;
|
|
24
|
+
readonly code?: string;
|
|
25
|
+
readonly managedProviderId?: string;
|
|
26
|
+
}
|
|
21
27
|
export declare class AgentConfigUnresolvableError extends Error {
|
|
22
28
|
readonly definitionId: string;
|
|
23
|
-
|
|
29
|
+
readonly code?: string | undefined;
|
|
30
|
+
readonly managedProviderId?: string | undefined;
|
|
31
|
+
constructor(definitionId: string, options?: AgentConfigUnresolvableErrorOptions | undefined);
|
|
24
32
|
}
|
|
25
33
|
export declare class AgentIntegrationMaterializationError extends Error {
|
|
26
34
|
constructor(message: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAElE,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAY,YA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AAE,MAAM;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM;IAJjC,YACW,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EAMhC;CACF"}
|
package/dist/core/errors.js
CHANGED
|
@@ -30,8 +30,12 @@ export class WorkspaceNotFoundError extends Error {
|
|
|
30
30
|
}
|
|
31
31
|
export class AgentConfigUnresolvableError extends Error {
|
|
32
32
|
constructor(definitionId, options){
|
|
33
|
-
super(`Agent configuration cannot be resolved for definition ${definitionId}`, options
|
|
33
|
+
super(options?.message ?? `Agent configuration cannot be resolved for definition ${definitionId}`, options?.cause === undefined ? undefined : {
|
|
34
|
+
cause: options.cause
|
|
35
|
+
}), this.definitionId = definitionId;
|
|
34
36
|
this.name = 'AgentConfigUnresolvableError';
|
|
37
|
+
this.code = options?.code;
|
|
38
|
+
this.managedProviderId = options?.managedProviderId;
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
41
|
export class AgentIntegrationMaterializationError extends Error {
|
package/dist/core/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/errors.ts"],"sourcesContent":["import type {JobStatus} from './entities/job.js';\nimport type {WorkflowRunStatus} from './entities/workflow-run.js';\n\nexport class DefinitionNotFoundError extends Error {\n constructor(definitionId: string) {\n super(`Definition not found: ${definitionId}`);\n this.name = 'DefinitionNotFoundError';\n }\n}\n\nexport class ProjectMismatchError extends Error {\n constructor(definitionProjectId: string, requestProjectId: string) {\n super(\n `Definition belongs to project ${definitionProjectId}, but request targets project ${requestProjectId}`,\n );\n this.name = 'ProjectMismatchError';\n }\n}\n\nexport class WorkspaceSuspendedError extends Error {\n constructor(readonly workspaceId: string) {\n super(`Workspace is suspended: ${workspaceId}`);\n this.name = 'WorkspaceSuspendedError';\n }\n}\n\nexport class WorkspaceDeletedError extends Error {\n constructor(readonly workspaceId: string) {\n super(`Workspace is deleted: ${workspaceId}`);\n this.name = 'WorkspaceDeletedError';\n }\n}\n\nexport class WorkspaceNotFoundError extends Error {\n constructor(readonly workspaceId: string) {\n super(`Workspace not found: ${workspaceId}`);\n this.name = 'WorkspaceNotFoundError';\n }\n}\n\nexport class AgentConfigUnresolvableError extends Error {\n constructor(\n readonly definitionId: string,\n options?: ErrorOptions | undefined,\n ) {\n super(`Agent configuration cannot be resolved for definition ${definitionId}`, options);\n this.name = 'AgentConfigUnresolvableError';\n }\n}\n\nexport class AgentIntegrationMaterializationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'AgentIntegrationMaterializationError';\n }\n}\n\nexport type InterpolationUnresolvableField =\n | 'run'\n | 'env'\n | 'agent.prompt'\n | 'agent.model'\n | 'agent.provider'\n | 'agent.thinking'\n | 'job.runner'\n | 'job.outputs'\n | 'job.execution_name'\n | 'workflow.run_name'\n | 'step.name'\n | 'step.working_directory'\n | 'step.feedback'\n | 'checkout.project'\n | 'checkout.connection'\n | 'checkout.repository'\n | 'checkout.ref'\n | 'checkout.path';\n\nexport class InterpolationUnresolvableError extends Error {\n readonly field: InterpolationUnresolvableField;\n readonly source: string;\n readonly envKey?: string;\n\n constructor(\n readonly definitionId: string,\n params: {\n readonly field: InterpolationUnresolvableField;\n readonly source: string;\n readonly envKey?: string;\n readonly cause?: unknown;\n },\n ) {\n super(interpolationUnresolvableMessage(definitionId, params), {cause: params.cause});\n this.name = 'InterpolationUnresolvableError';\n this.field = params.field;\n this.source = params.source;\n if (params.envKey !== undefined) this.envKey = params.envKey;\n }\n}\n\nfunction interpolationUnresolvableMessage(\n definitionId: string,\n params: {\n readonly field: InterpolationUnresolvableField;\n readonly source: string;\n readonly envKey?: string;\n },\n): string {\n const envSuffix = params.envKey === undefined ? '' : ` (${params.envKey})`;\n return `Workflow interpolation cannot be resolved for definition ${definitionId}: ${params.field}${envSuffix} uses \\`${params.source}\\`. Use has(x) ? x : '' for optional references.`;\n}\n\n/**\n * True when a `runWorkflow` failure can never succeed on retry: the definition is gone or\n * the subscription points at the wrong project. Callers (e.g. the trigger dispatcher) use this\n * to skip a permanently-broken target instead of retrying it forever. Every other failure is\n * treated as transient so at-least-once delivery can converge.\n */\nexport function isPermanentRunWorkflowError(error: unknown): boolean {\n return (\n error instanceof DefinitionNotFoundError ||\n error instanceof ProjectMismatchError ||\n error instanceof AgentConfigUnresolvableError ||\n error instanceof AgentIntegrationMaterializationError ||\n error instanceof InterpolationUnresolvableError ||\n error instanceof InvalidJobRunnerLabelsError\n );\n}\n\nexport class JobNotFoundError extends Error {\n constructor(jobId: string) {\n super(`Job not found or has no steps: ${jobId}`);\n this.name = 'JobNotFoundError';\n }\n}\n\nexport class InvalidJobRunnerLabelsError extends Error {\n constructor(\n readonly labels: readonly string[],\n readonly requestedLabels: readonly string[] = labels,\n ) {\n const requestedSuffix =\n requestedLabels.join(', ') === labels.join(', ')\n ? ''\n : ` (requested: ${requestedLabels.join(', ')})`;\n super(`Job runner labels are invalid: ${labels.join(', ')}${requestedSuffix}`);\n this.name = 'InvalidJobRunnerLabelsError';\n }\n}\n\nexport class JobOutputTooLargeError extends Error {\n readonly overshootBytes: number;\n\n constructor(\n readonly outputKey: string,\n readonly limitBytes: number,\n readonly measuredBytes: number,\n readonly scope: 'value' | 'total',\n ) {\n const overshootBytes = measuredBytes - limitBytes;\n super(\n scope === 'total'\n ? `Job outputs exceed the total size limit of ${limitBytes} bytes at \"${outputKey}\" ` +\n `(measured ${measuredBytes} bytes; overshoot ${overshootBytes} bytes).`\n : `Job output \"${outputKey}\" exceeds the per-value size limit of ${limitBytes} bytes ` +\n `(measured ${measuredBytes} bytes; overshoot ${overshootBytes} bytes).`,\n );\n this.name = 'JobOutputTooLargeError';\n this.overshootBytes = overshootBytes;\n }\n}\n\nexport class JobOutputTooManyEntriesError extends Error {\n constructor(\n readonly entryCount: number,\n readonly limitEntries: number,\n ) {\n super(`Job outputs cannot define more than ${limitEntries} entries (found ${entryCount})`);\n this.name = 'JobOutputTooManyEntriesError';\n }\n}\n\nexport class JobOutputNotJsonSafeError extends Error {\n constructor(\n readonly outputKey: string,\n readonly reason: string,\n ) {\n super(`Job output \"${outputKey}\" cannot be persisted as JSON: ${reason}`);\n this.name = 'JobOutputNotJsonSafeError';\n }\n}\n\n// The job named by a lease is terminal, so it must not exchange its lease for\n// fresh checkout credentials. Server state is the final gate, not the token.\nexport class JobNotActiveError extends Error {\n constructor(\n readonly jobId: string,\n readonly status: JobStatus,\n ) {\n super(`Job ${jobId} is ${status} and cannot mint checkout credentials`);\n this.name = 'JobNotActiveError';\n }\n}\n\nexport class WorkflowRunNotFoundError extends Error {\n constructor(workflowRunId: string) {\n super(`Workflow run not found: ${workflowRunId}`);\n this.name = 'WorkflowRunNotFoundError';\n }\n}\n\nexport class WorkflowRunNotCancellableError extends Error {\n constructor(\n readonly workflowRunId: string,\n readonly status: WorkflowRunStatus,\n ) {\n super(`Workflow run ${workflowRunId} is ${status} and cannot be cancelled`);\n this.name = 'WorkflowRunNotCancellableError';\n }\n}\n\nexport class SourceRunNotFoundError extends Error {\n constructor(workflowRunId: string) {\n super(`Source workflow run not found: ${workflowRunId}`);\n this.name = 'SourceRunNotFoundError';\n }\n}\n\nexport class RunNotTerminalError extends Error {\n constructor(workflowRunId: string) {\n super(`Workflow run is not terminal: ${workflowRunId}`);\n this.name = 'RunNotTerminalError';\n }\n}\n\nexport class NoFailedJobsError extends Error {\n constructor(workflowRunId: string) {\n super(`Workflow run has no failed or cancelled jobs to re-run: ${workflowRunId}`);\n this.name = 'NoFailedJobsError';\n }\n}\n\n// The checkout target cannot be resolved, so there is nothing to check out.\nexport class CheckoutIntentUnresolvedError extends Error {\n constructor(target: {kind: 'project' | 'connection'; value: string}) {\n super(`Checkout intent unresolved: ${target.kind} ${target.value} not found`);\n this.name = 'CheckoutIntentUnresolvedError';\n }\n}\n\nexport class CheckoutConfigInvalidError extends Error {\n constructor(readonly stepId: string) {\n super(`Checkout config is invalid for step ${stepId}`);\n this.name = 'CheckoutConfigInvalidError';\n }\n}\n\nexport class StepNotFoundError extends Error {\n constructor(stepId: string, jobId: string) {\n super(`Step ${stepId} not found in job ${jobId}`);\n this.name = 'StepNotFoundError';\n }\n}\n\nexport class StepNotRunningError extends Error {\n constructor(stepId: string, jobId: string) {\n super(`Step ${stepId} in job ${jobId} is not running and cannot accept a result`);\n this.name = 'StepNotRunningError';\n }\n}\n\n// A report whose attempt is ahead of the step's current attempt. The host\n// allocates attempt numbers, so a runner can never report one it was not\n// dispatched: this is a protocol error, not an idempotent no-op.\nexport class StepAttemptAheadError extends Error {\n constructor(\n readonly stepId: string,\n readonly jobId: string,\n readonly reportedAttempt: number,\n readonly currentAttempt: number,\n ) {\n super(\n `Step ${stepId} in job ${jobId} reported attempt ${reportedAttempt} ahead of current attempt ${currentAttempt}`,\n );\n this.name = 'StepAttemptAheadError';\n }\n}\n"],"names":["DefinitionNotFoundError","Error","definitionId","name","ProjectMismatchError","definitionProjectId","requestProjectId","WorkspaceSuspendedError","workspaceId","WorkspaceDeletedError","WorkspaceNotFoundError","AgentConfigUnresolvableError","options","AgentIntegrationMaterializationError","message","InterpolationUnresolvableError","params","interpolationUnresolvableMessage","cause","field","source","envKey","undefined","envSuffix","isPermanentRunWorkflowError","error","InvalidJobRunnerLabelsError","JobNotFoundError","jobId","labels","requestedLabels","requestedSuffix","join","JobOutputTooLargeError","outputKey","limitBytes","measuredBytes","scope","overshootBytes","JobOutputTooManyEntriesError","entryCount","limitEntries","JobOutputNotJsonSafeError","reason","JobNotActiveError","status","WorkflowRunNotFoundError","workflowRunId","WorkflowRunNotCancellableError","SourceRunNotFoundError","RunNotTerminalError","NoFailedJobsError","CheckoutIntentUnresolvedError","target","kind","value","CheckoutConfigInvalidError","stepId","StepNotFoundError","StepNotRunningError","StepAttemptAheadError","reportedAttempt","currentAttempt"],"mappings":"AAGA,OAAO,MAAMA,gCAAgCC;IAC3C,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,sBAAsB,EAAEA,cAAc;QAC7C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KAAK,CAAC,CAAC,KAAK,EAAE6B,OAAO,kBAAkB,EAAE7B,OAAO;QAChD,IAAI,CAACzB,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMwD,4BAA4B1D;IACvC,YAAYwD,MAAc,EAAE7B,KAAa,CAAE;QACzC,KAAK,CAAC,CAAC,KAAK,EAAE6B,OAAO,QAAQ,EAAE7B,MAAM,0CAA0C,CAAC;QAChF,IAAI,CAACzB,IAAI,GAAG;IACd;AACF;AAEA,0EAA0E;AAC1E,yEAAyE;AACzE,iEAAiE;AACjE,OAAO,MAAMyD,8BAA8B3D;IACzC,YACE,AAASwD,MAAc,EACvB,AAAS7B,KAAa,EACtB,AAASiC,eAAuB,EAChC,AAASC,cAAsB,CAC/B;QACA,KAAK,CACH,CAAC,KAAK,EAAEL,OAAO,QAAQ,EAAE7B,MAAM,kBAAkB,EAAEiC,gBAAgB,0BAA0B,EAAEC,gBAAgB,QANxGL,SAAAA,aACA7B,QAAAA,YACAiC,kBAAAA,sBACAC,iBAAAA;QAKT,IAAI,CAAC3D,IAAI,GAAG;IACd;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/errors.ts"],"sourcesContent":["import type {JobStatus} from './entities/job.js';\nimport type {WorkflowRunStatus} from './entities/workflow-run.js';\n\nexport class DefinitionNotFoundError extends Error {\n constructor(definitionId: string) {\n super(`Definition not found: ${definitionId}`);\n this.name = 'DefinitionNotFoundError';\n }\n}\n\nexport class ProjectMismatchError extends Error {\n constructor(definitionProjectId: string, requestProjectId: string) {\n super(\n `Definition belongs to project ${definitionProjectId}, but request targets project ${requestProjectId}`,\n );\n this.name = 'ProjectMismatchError';\n }\n}\n\nexport class WorkspaceSuspendedError extends Error {\n constructor(readonly workspaceId: string) {\n super(`Workspace is suspended: ${workspaceId}`);\n this.name = 'WorkspaceSuspendedError';\n }\n}\n\nexport class WorkspaceDeletedError extends Error {\n constructor(readonly workspaceId: string) {\n super(`Workspace is deleted: ${workspaceId}`);\n this.name = 'WorkspaceDeletedError';\n }\n}\n\nexport class WorkspaceNotFoundError extends Error {\n constructor(readonly workspaceId: string) {\n super(`Workspace not found: ${workspaceId}`);\n this.name = 'WorkspaceNotFoundError';\n }\n}\n\nexport interface AgentConfigUnresolvableErrorOptions {\n readonly cause?: unknown;\n readonly message?: string;\n readonly code?: string;\n readonly managedProviderId?: string;\n}\n\nexport class AgentConfigUnresolvableError extends Error {\n readonly code?: string | undefined;\n readonly managedProviderId?: string | undefined;\n\n constructor(\n readonly definitionId: string,\n options?: AgentConfigUnresolvableErrorOptions | undefined,\n ) {\n super(\n options?.message ?? `Agent configuration cannot be resolved for definition ${definitionId}`,\n options?.cause === undefined ? undefined : {cause: options.cause},\n );\n this.name = 'AgentConfigUnresolvableError';\n this.code = options?.code;\n this.managedProviderId = options?.managedProviderId;\n }\n}\n\nexport class AgentIntegrationMaterializationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'AgentIntegrationMaterializationError';\n }\n}\n\nexport type InterpolationUnresolvableField =\n | 'run'\n | 'env'\n | 'agent.prompt'\n | 'agent.model'\n | 'agent.provider'\n | 'agent.thinking'\n | 'job.runner'\n | 'job.outputs'\n | 'job.execution_name'\n | 'workflow.run_name'\n | 'step.name'\n | 'step.working_directory'\n | 'step.feedback'\n | 'checkout.project'\n | 'checkout.connection'\n | 'checkout.repository'\n | 'checkout.ref'\n | 'checkout.path';\n\nexport class InterpolationUnresolvableError extends Error {\n readonly field: InterpolationUnresolvableField;\n readonly source: string;\n readonly envKey?: string;\n\n constructor(\n readonly definitionId: string,\n params: {\n readonly field: InterpolationUnresolvableField;\n readonly source: string;\n readonly envKey?: string;\n readonly cause?: unknown;\n },\n ) {\n super(interpolationUnresolvableMessage(definitionId, params), {cause: params.cause});\n this.name = 'InterpolationUnresolvableError';\n this.field = params.field;\n this.source = params.source;\n if (params.envKey !== undefined) this.envKey = params.envKey;\n }\n}\n\nfunction interpolationUnresolvableMessage(\n definitionId: string,\n params: {\n readonly field: InterpolationUnresolvableField;\n readonly source: string;\n readonly envKey?: string;\n },\n): string {\n const envSuffix = params.envKey === undefined ? '' : ` (${params.envKey})`;\n return `Workflow interpolation cannot be resolved for definition ${definitionId}: ${params.field}${envSuffix} uses \\`${params.source}\\`. Use has(x) ? x : '' for optional references.`;\n}\n\n/**\n * True when a `runWorkflow` failure can never succeed on retry: the definition is gone or\n * the subscription points at the wrong project. Callers (e.g. the trigger dispatcher) use this\n * to skip a permanently-broken target instead of retrying it forever. Every other failure is\n * treated as transient so at-least-once delivery can converge.\n */\nexport function isPermanentRunWorkflowError(error: unknown): boolean {\n return (\n error instanceof DefinitionNotFoundError ||\n error instanceof ProjectMismatchError ||\n error instanceof AgentConfigUnresolvableError ||\n error instanceof AgentIntegrationMaterializationError ||\n error instanceof InterpolationUnresolvableError ||\n error instanceof InvalidJobRunnerLabelsError\n );\n}\n\nexport class JobNotFoundError extends Error {\n constructor(jobId: string) {\n super(`Job not found or has no steps: ${jobId}`);\n this.name = 'JobNotFoundError';\n }\n}\n\nexport class InvalidJobRunnerLabelsError extends Error {\n constructor(\n readonly labels: readonly string[],\n readonly requestedLabels: readonly string[] = labels,\n ) {\n const requestedSuffix =\n requestedLabels.join(', ') === labels.join(', ')\n ? ''\n : ` (requested: ${requestedLabels.join(', ')})`;\n super(`Job runner labels are invalid: ${labels.join(', ')}${requestedSuffix}`);\n this.name = 'InvalidJobRunnerLabelsError';\n }\n}\n\nexport class JobOutputTooLargeError extends Error {\n readonly overshootBytes: number;\n\n constructor(\n readonly outputKey: string,\n readonly limitBytes: number,\n readonly measuredBytes: number,\n readonly scope: 'value' | 'total',\n ) {\n const overshootBytes = measuredBytes - limitBytes;\n super(\n scope === 'total'\n ? `Job outputs exceed the total size limit of ${limitBytes} bytes at \"${outputKey}\" ` +\n `(measured ${measuredBytes} bytes; overshoot ${overshootBytes} bytes).`\n : `Job output \"${outputKey}\" exceeds the per-value size limit of ${limitBytes} bytes ` +\n `(measured ${measuredBytes} bytes; overshoot ${overshootBytes} bytes).`,\n );\n this.name = 'JobOutputTooLargeError';\n this.overshootBytes = overshootBytes;\n }\n}\n\nexport class JobOutputTooManyEntriesError extends Error {\n constructor(\n readonly entryCount: number,\n readonly limitEntries: number,\n ) {\n super(`Job outputs cannot define more than ${limitEntries} entries (found ${entryCount})`);\n this.name = 'JobOutputTooManyEntriesError';\n }\n}\n\nexport class JobOutputNotJsonSafeError extends Error {\n constructor(\n readonly outputKey: string,\n readonly reason: string,\n ) {\n super(`Job output \"${outputKey}\" cannot be persisted as JSON: ${reason}`);\n this.name = 'JobOutputNotJsonSafeError';\n }\n}\n\n// The job named by a lease is terminal, so it must not exchange its lease for\n// fresh checkout credentials. Server state is the final gate, not the token.\nexport class JobNotActiveError extends Error {\n constructor(\n readonly jobId: string,\n readonly status: JobStatus,\n ) {\n super(`Job ${jobId} is ${status} and cannot mint checkout credentials`);\n this.name = 'JobNotActiveError';\n }\n}\n\nexport class WorkflowRunNotFoundError extends Error {\n constructor(workflowRunId: string) {\n super(`Workflow run not found: ${workflowRunId}`);\n this.name = 'WorkflowRunNotFoundError';\n }\n}\n\nexport class WorkflowRunNotCancellableError extends Error {\n constructor(\n readonly workflowRunId: string,\n readonly status: WorkflowRunStatus,\n ) {\n super(`Workflow run ${workflowRunId} is ${status} and cannot be cancelled`);\n this.name = 'WorkflowRunNotCancellableError';\n }\n}\n\nexport class SourceRunNotFoundError extends Error {\n constructor(workflowRunId: string) {\n super(`Source workflow run not found: ${workflowRunId}`);\n this.name = 'SourceRunNotFoundError';\n }\n}\n\nexport class RunNotTerminalError extends Error {\n constructor(workflowRunId: string) {\n super(`Workflow run is not terminal: ${workflowRunId}`);\n this.name = 'RunNotTerminalError';\n }\n}\n\nexport class NoFailedJobsError extends Error {\n constructor(workflowRunId: string) {\n super(`Workflow run has no failed or cancelled jobs to re-run: ${workflowRunId}`);\n this.name = 'NoFailedJobsError';\n }\n}\n\n// The checkout target cannot be resolved, so there is nothing to check out.\nexport class CheckoutIntentUnresolvedError extends Error {\n constructor(target: {kind: 'project' | 'connection'; value: string}) {\n super(`Checkout intent unresolved: ${target.kind} ${target.value} not found`);\n this.name = 'CheckoutIntentUnresolvedError';\n }\n}\n\nexport class CheckoutConfigInvalidError extends Error {\n constructor(readonly stepId: string) {\n super(`Checkout config is invalid for step ${stepId}`);\n this.name = 'CheckoutConfigInvalidError';\n }\n}\n\nexport class StepNotFoundError extends Error {\n constructor(stepId: string, jobId: string) {\n super(`Step ${stepId} not found in job ${jobId}`);\n this.name = 'StepNotFoundError';\n }\n}\n\nexport class StepNotRunningError extends Error {\n constructor(stepId: string, jobId: string) {\n super(`Step ${stepId} in job ${jobId} is not running and cannot accept a result`);\n this.name = 'StepNotRunningError';\n }\n}\n\n// A report whose attempt is ahead of the step's current attempt. The host\n// allocates attempt numbers, so a runner can never report one it was not\n// dispatched: this is a protocol error, not an idempotent no-op.\nexport class StepAttemptAheadError extends Error {\n constructor(\n readonly stepId: string,\n readonly jobId: string,\n readonly reportedAttempt: number,\n readonly currentAttempt: number,\n ) {\n super(\n `Step ${stepId} in job ${jobId} reported attempt ${reportedAttempt} ahead of current attempt ${currentAttempt}`,\n );\n this.name = 'StepAttemptAheadError';\n }\n}\n"],"names":["DefinitionNotFoundError","Error","definitionId","name","ProjectMismatchError","definitionProjectId","requestProjectId","WorkspaceSuspendedError","workspaceId","WorkspaceDeletedError","WorkspaceNotFoundError","AgentConfigUnresolvableError","options","message","cause","undefined","code","managedProviderId","AgentIntegrationMaterializationError","InterpolationUnresolvableError","params","interpolationUnresolvableMessage","field","source","envKey","envSuffix","isPermanentRunWorkflowError","error","InvalidJobRunnerLabelsError","JobNotFoundError","jobId","labels","requestedLabels","requestedSuffix","join","JobOutputTooLargeError","outputKey","limitBytes","measuredBytes","scope","overshootBytes","JobOutputTooManyEntriesError","entryCount","limitEntries","JobOutputNotJsonSafeError","reason","JobNotActiveError","status","WorkflowRunNotFoundError","workflowRunId","WorkflowRunNotCancellableError","SourceRunNotFoundError","RunNotTerminalError","NoFailedJobsError","CheckoutIntentUnresolvedError","target","kind","value","CheckoutConfigInvalidError","stepId","StepNotFoundError","StepNotRunningError","StepAttemptAheadError","reportedAttempt","currentAttempt"],"mappings":"AAGA,OAAO,MAAMA,gCAAgCC;IAC3C,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,sBAAsB,EAAEA,cAAc;QAC7C,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMC,6BAA6BH;IACxC,YAAYI,mBAA2B,EAAEC,gBAAwB,CAAE;QACjE,KAAK,CACH,CAAC,8BAA8B,EAAED,oBAAoB,8BAA8B,EAAEC,kBAAkB;QAEzG,IAAI,CAACH,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMI,gCAAgCN;IAC3C,YAAY,AAASO,WAAmB,CAAE;QACxC,KAAK,CAAC,CAAC,wBAAwB,EAAEA,aAAa,QAD3BA,cAAAA;QAEnB,IAAI,CAACL,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMM,8BAA8BR;IACzC,YAAY,AAASO,WAAmB,CAAE;QACxC,KAAK,CAAC,CAAC,sBAAsB,EAAEA,aAAa,QADzBA,cAAAA;QAEnB,IAAI,CAACL,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMO,+BAA+BT;IAC1C,YAAY,AAASO,WAAmB,CAAE;QACxC,KAAK,CAAC,CAAC,qBAAqB,EAAEA,aAAa,QADxBA,cAAAA;QAEnB,IAAI,CAACL,IAAI,GAAG;IACd;AACF;AASA,OAAO,MAAMQ,qCAAqCV;IAIhD,YACE,AAASC,YAAoB,EAC7BU,OAAyD,CACzD;QACA,KAAK,CACHA,SAASC,WAAW,CAAC,sDAAsD,EAAEX,cAAc,EAC3FU,SAASE,UAAUC,YAAYA,YAAY;YAACD,OAAOF,QAAQE,KAAK;QAAA,SALzDZ,eAAAA;QAOT,IAAI,CAACC,IAAI,GAAG;QACZ,IAAI,CAACa,IAAI,GAAGJ,SAASI;QACrB,IAAI,CAACC,i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;CAC5C;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,mCAAmC,GAC1C,OAAO,CAAC,QAAQ,CAAC,CAInB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,sBAAsB,GAAG,SAAS,GACzC,OAAO,CAAC,QAAQ,CAAC,CAOnB;AAED,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAGvC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAa7D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CAQlC;AA6GD,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;AAEpE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,IAAI,EACZ,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,MAAM,GACZ,0BAA0B,CAU5B"}
|
|
@@ -229,11 +229,21 @@ function dispatchConfigError(error) {
|
|
|
229
229
|
source: error.source
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
+
const isManagedProviderPolicyFailure = error.code === 'workspace-providers-disabled' && error.managedProviderId !== undefined;
|
|
232
233
|
return {
|
|
233
234
|
message: error.message,
|
|
234
|
-
reason: 'config_unresolvable',
|
|
235
|
+
reason: isManagedProviderPolicyFailure ? 'agent_config_invalid' : 'config_unresolvable',
|
|
235
236
|
field: 'agent',
|
|
236
|
-
source: 'agent'
|
|
237
|
+
source: 'agent',
|
|
238
|
+
...error.code === undefined ? {} : {
|
|
239
|
+
code: error.code
|
|
240
|
+
},
|
|
241
|
+
...error.managedProviderId === undefined ? {} : {
|
|
242
|
+
managedProviderId: error.managedProviderId
|
|
243
|
+
},
|
|
244
|
+
...isManagedProviderPolicyFailure ? {
|
|
245
|
+
agentConfigIssue: 'provider_unsupported'
|
|
246
|
+
} : {}
|
|
237
247
|
};
|
|
238
248
|
}
|
|
239
249
|
export function nextStepForLeasedJobExecution(params) {
|