@shipfox/api-workflows 9.2.0 → 9.3.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.
Files changed (39) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +21 -0
  3. package/dist/core/errors.d.ts +12 -0
  4. package/dist/core/errors.d.ts.map +1 -1
  5. package/dist/core/errors.js +18 -0
  6. package/dist/core/errors.js.map +1 -1
  7. package/dist/core/workspace-admission.d.ts +3 -0
  8. package/dist/core/workspace-admission.d.ts.map +1 -0
  9. package/dist/core/workspace-admission.js +32 -0
  10. package/dist/core/workspace-admission.js.map +1 -0
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +5 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/presentation/inter-module.d.ts +2 -0
  16. package/dist/presentation/inter-module.d.ts.map +1 -1
  17. package/dist/presentation/inter-module.js +40 -5
  18. package/dist/presentation/inter-module.js.map +1 -1
  19. package/dist/presentation/routes/index.d.ts +4 -1
  20. package/dist/presentation/routes/index.d.ts.map +1 -1
  21. package/dist/presentation/routes/index.js +1 -1
  22. package/dist/presentation/routes/index.js.map +1 -1
  23. package/dist/presentation/routes/rerun-run.d.ts +2 -1
  24. package/dist/presentation/routes/rerun-run.d.ts.map +1 -1
  25. package/dist/presentation/routes/rerun-run.js +22 -2
  26. package/dist/presentation/routes/rerun-run.js.map +1 -1
  27. package/dist/tsconfig.test.tsbuildinfo +1 -1
  28. package/package.json +9 -8
  29. package/src/core/errors.ts +21 -0
  30. package/src/core/workspace-admission.test.ts +64 -0
  31. package/src/core/workspace-admission.ts +43 -0
  32. package/src/index.ts +5 -0
  33. package/src/presentation/inter-module.test.ts +198 -1
  34. package/src/presentation/inter-module.ts +55 -3
  35. package/src/presentation/routes/index.test.ts +1 -0
  36. package/src/presentation/routes/index.ts +6 -2
  37. package/src/presentation/routes/rerun-run.test.ts +58 -1
  38. package/src/presentation/routes/rerun-run.ts +34 -2
  39. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1,6 +1,6 @@
1
1
  $ shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js
2
- Successfully compiled: 115 files with swc (670.24ms)
3
- 2026-07-26T13:33:28.369Z [INFO] asset workflow-bundle-21a9ae8beb3cb55dabc1.js 3.31 MiB [emitted] [immutable] (name: main)
2
+ Successfully compiled: 116 files with swc (580.86ms)
3
+ 2026-07-26T20:59:43.642Z [INFO] asset workflow-bundle-21a9ae8beb3cb55dabc1.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 5418 ms
20
- 2026-07-26T13:33:28.380Z [INFO] Workflow bundle created { size: '3.31MB' }
19
+ webpack 5.107.2 compiled successfully in 7493 ms
20
+ 2026-07-26T20:59:43.658Z [INFO] Workflow bundle created { size: '3.31MB' }
21
21
  /home/runner/work/shipfox/shipfox/libs/api/workflows/dist/temporal/workflows/index.js: 3470576 bytes
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @shipfox/api-workflows
2
2
 
3
+ ## 9.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6017e56: Reject new workflow work for suspended or deleted workspaces with stable non-retryable results.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [10cf63c]
12
+ - Updated dependencies [4425c6d]
13
+ - Updated dependencies [6017e56]
14
+ - Updated dependencies [7b6a409]
15
+ - @shipfox/api-auth-dto@9.3.0
16
+ - @shipfox/node-opentelemetry@0.6.3
17
+ - @shipfox/api-workflows-dto@9.3.0
18
+ - @shipfox/api-workspaces-dto@9.3.0
19
+ - @shipfox/api-auth-context@9.3.0
20
+ - @shipfox/node-fastify@0.3.4
21
+ - @shipfox/node-module@1.0.3
22
+ - @shipfox/node-temporal@0.4.4
23
+
3
24
  ## 9.2.0
4
25
 
5
26
  ### Patch Changes
@@ -6,6 +6,18 @@ export declare class DefinitionNotFoundError extends Error {
6
6
  export declare class ProjectMismatchError extends Error {
7
7
  constructor(definitionProjectId: string, requestProjectId: string);
8
8
  }
9
+ export declare class WorkspaceSuspendedError extends Error {
10
+ readonly workspaceId: string;
11
+ constructor(workspaceId: string);
12
+ }
13
+ export declare class WorkspaceDeletedError extends Error {
14
+ readonly workspaceId: string;
15
+ constructor(workspaceId: string);
16
+ }
17
+ export declare class WorkspaceNotFoundError extends Error {
18
+ readonly workspaceId: string;
19
+ constructor(workspaceId: string);
20
+ }
9
21
  export declare class AgentConfigUnresolvableError extends Error {
10
22
  readonly definitionId: string;
11
23
  constructor(definitionId: string, options?: ErrorOptions | undefined);
@@ -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;gBACpC,YAAY,EAAE,MAAM;CAIjC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM;CAMlE;AAED,qBAAa,4BAA6B,SAAQ,KAAK;IAEnD,QAAQ,CAAC,YAAY,EAAE,MAAM;gBAApB,YAAY,EAAE,MAAM,EAC7B,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS;CAKrC;AAED,qBAAa,oCAAqC,SAA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,MAAM,EACvB,cAAc,EAAE,MAAM;CAOlC"}
@@ -10,6 +10,24 @@ export class ProjectMismatchError extends Error {
10
10
  this.name = 'ProjectMismatchError';
11
11
  }
12
12
  }
13
+ export class WorkspaceSuspendedError extends Error {
14
+ constructor(workspaceId){
15
+ super(`Workspace is suspended: ${workspaceId}`), this.workspaceId = workspaceId;
16
+ this.name = 'WorkspaceSuspendedError';
17
+ }
18
+ }
19
+ export class WorkspaceDeletedError extends Error {
20
+ constructor(workspaceId){
21
+ super(`Workspace is deleted: ${workspaceId}`), this.workspaceId = workspaceId;
22
+ this.name = 'WorkspaceDeletedError';
23
+ }
24
+ }
25
+ export class WorkspaceNotFoundError extends Error {
26
+ constructor(workspaceId){
27
+ super(`Workspace not found: ${workspaceId}`), this.workspaceId = workspaceId;
28
+ this.name = 'WorkspaceNotFoundError';
29
+ }
30
+ }
13
31
  export class AgentConfigUnresolvableError extends Error {
14
32
  constructor(definitionId, options){
15
33
  super(`Agent configuration cannot be resolved for definition ${definitionId}`, options), this.definitionId = definitionId;
@@ -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 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 | 'job.runner'\n | 'job.outputs'\n | 'job.name'\n | 'step.name'\n | 'step.feedback';\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(readonly labels: readonly string[]) {\n super(`Job runner labels are invalid: ${labels.join(', ')}`);\n this.name = 'InvalidJobRunnerLabelsError';\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 run's project (and therefore its source repository) cannot be resolved, so\n// there is nothing to check out.\nexport class CheckoutIntentUnresolvedError extends Error {\n constructor(projectId: string) {\n super(`Checkout intent unresolved: project ${projectId} not found`);\n this.name = 'CheckoutIntentUnresolvedError';\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","AgentConfigUnresolvableError","options","AgentIntegrationMaterializationError","message","InterpolationUnresolvableError","params","interpolationUnresolvableMessage","cause","field","source","envKey","undefined","envSuffix","isPermanentRunWorkflowError","error","InvalidJobRunnerLabelsError","JobNotFoundError","jobId","labels","join","JobNotActiveError","status","WorkflowRunNotFoundError","workflowRunId","WorkflowRunNotCancellableError","SourceRunNotFoundError","RunNotTerminalError","NoFailedJobsError","CheckoutIntentUnresolvedError","projectId","StepNotFoundError","stepId","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,qCAAqCN;IAChD,YACE,AAASC,YAAoB,EAC7BM,OAAkC,CAClC;QACA,KAAK,CAAC,CAAC,sDAAsD,EAAEN,cAAc,EAAEM,eAHtEN,eAAAA;QAIT,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMM,6CAA6CR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CAAC;QAClE,IAAI,CAACjC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMkC,0BAA0BpC;IACrC,YAAYqC,MAAc,EAAEd,KAAa,CAAE;QACzC,KAAK,CAAC,CAAC,KAAK,EAAEc,OAAO,kBAAkB,EAAEd,OAAO;QAChD,IAAI,CAACrB,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMoC,4BAA4BtC;IACvC,YAAYqC,MAAc,EAAEd,KAAa,CAAE;QACzC,KAAK,CAAC,CAAC,KAAK,EAAEc,OAAO,QAAQ,EAAEd,MAAM,0CAA0C,CAAC;QAChF,IAAI,CAACrB,IAAI,GAAG;IACd;AACF;AAEA,0EAA0E;AAC1E,yEAAyE;AACzE,kEAAkE;AAClE,OAAO,MAAMqC,8BAA8BvC;IACzC,YACE,AAASqC,MAAc,EACvB,AAASd,KAAa,EACtB,AAASiB,eAAuB,EAChC,AAASC,cAAsB,CAC/B;QACA,KAAK,CACH,CAAC,KAAK,EAAEJ,OAAO,QAAQ,EAAEd,MAAM,kBAAkB,EAAEiB,gBAAgB,0BAA0B,EAAEC,gBAAgB,QANxGJ,SAAAA,aACAd,QAAAA,YACAiB,kBAAAA,sBACAC,iBAAAA;QAKT,IAAI,CAACvC,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 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 | 'job.runner'\n | 'job.outputs'\n | 'job.name'\n | 'step.name'\n | 'step.feedback';\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(readonly labels: readonly string[]) {\n super(`Job runner labels are invalid: ${labels.join(', ')}`);\n this.name = 'InvalidJobRunnerLabelsError';\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 run's project (and therefore its source repository) cannot be resolved, so\n// there is nothing to check out.\nexport class CheckoutIntentUnresolvedError extends Error {\n constructor(projectId: string) {\n super(`Checkout intent unresolved: project ${projectId} not found`);\n this.name = 'CheckoutIntentUnresolvedError';\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","join","JobNotActiveError","status","WorkflowRunNotFoundError","workflowRunId","WorkflowRunNotCancellableError","SourceRunNotFoundError","RunNotTerminalError","NoFailedJobsError","CheckoutIntentUnresolvedError","projectId","StepNotFoundError","stepId","StepNotRunningError","StepAttemptAheadError","reportedAttempt","currentAttempt"],"mappings":"AAGA,OAAO,MAAMA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ACF;AAEA,OAAO,MAAMwC,4BAA4B1C;IACvC,YAAYyC,MAAc,EAAEd,KAAa,CAAE;QACzC,KAAK,CAAC,CAAC,KAAK,EAAEc,OAAO,QAAQ,EAAEd,MAAM,0CAA0C,CAAC;QAChF,IAAI,CAACzB,IAAI,GAAG;IACd;AACF;AAEA,0EAA0E;AAC1E,yEAAyE;AACzE,kEAAkE;AAClE,OAAO,MAAMyC,8BAA8B3C;IACzC,YACE,AAASyC,MAAc,EACvB,AAASd,KAAa,EACtB,AAASiB,eAAuB,EAChC,AAASC,cAAsB,CAC/B;QACA,KAAK,CACH,CAAC,KAAK,EAAEJ,OAAO,QAAQ,EAAEd,MAAM,kBAAkB,EAAEiB,gBAAgB,0BAA0B,EAAEC,gBAAgB,QANxGJ,SAAAA,aACAd,QAAAA,YACAiB,kBAAAA,sBACAC,iBAAAA;QAKT,IAAI,CAAC3C,IAAI,GAAG;IACd;AACF"}
@@ -0,0 +1,3 @@
1
+ import { type WorkspacesInterModuleClient } from '@shipfox/api-workspaces-dto/inter-module';
2
+ export declare function assertWorkspaceAdmitsNewJobs(workspaces: Pick<WorkspacesInterModuleClient, 'getWorkspaceOperatingState'>, workspaceId: string): Promise<void>;
3
+ //# sourceMappingURL=workspace-admission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-admission.d.ts","sourceRoot":"","sources":["../../src/core/workspace-admission.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,0CAA0C,CAAC;AAIlD,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,IAAI,CAAC,2BAA2B,EAAE,4BAA4B,CAAC,EAC3E,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
@@ -0,0 +1,32 @@
1
+ import { workspacesInterModuleContract } from '@shipfox/api-workspaces-dto/inter-module';
2
+ import { isInterModuleKnownError } from '@shipfox/inter-module';
3
+ import { WorkspaceDeletedError, WorkspaceNotFoundError, WorkspaceSuspendedError } from './errors.js';
4
+ export async function assertWorkspaceAdmitsNewJobs(workspaces, workspaceId) {
5
+ let state;
6
+ try {
7
+ state = await workspaces.getWorkspaceOperatingState({
8
+ workspaceId
9
+ });
10
+ } catch (error) {
11
+ if (isInterModuleKnownError(workspacesInterModuleContract.methods.getWorkspaceOperatingState, error) && error.code === 'workspace-not-found') {
12
+ throw new WorkspaceNotFoundError(error.details.workspaceId);
13
+ }
14
+ throw error;
15
+ }
16
+ const { status } = state;
17
+ switch(status){
18
+ case 'active':
19
+ return;
20
+ case 'suspended':
21
+ throw new WorkspaceSuspendedError(workspaceId);
22
+ case 'deleted':
23
+ throw new WorkspaceDeletedError(workspaceId);
24
+ default:
25
+ return assertNever(status);
26
+ }
27
+ }
28
+ function assertNever(value) {
29
+ throw new Error(`Unhandled workspace status: ${JSON.stringify(value)}`);
30
+ }
31
+
32
+ //# sourceMappingURL=workspace-admission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/workspace-admission.ts"],"sourcesContent":["import {\n type WorkspacesInterModuleClient,\n workspacesInterModuleContract,\n} from '@shipfox/api-workspaces-dto/inter-module';\nimport {isInterModuleKnownError} from '@shipfox/inter-module';\nimport {WorkspaceDeletedError, WorkspaceNotFoundError, WorkspaceSuspendedError} from './errors.js';\n\nexport async function assertWorkspaceAdmitsNewJobs(\n workspaces: Pick<WorkspacesInterModuleClient, 'getWorkspaceOperatingState'>,\n workspaceId: string,\n): Promise<void> {\n let state: Awaited<ReturnType<WorkspacesInterModuleClient['getWorkspaceOperatingState']>>;\n try {\n state = await workspaces.getWorkspaceOperatingState({workspaceId});\n } catch (error) {\n if (\n isInterModuleKnownError(\n workspacesInterModuleContract.methods.getWorkspaceOperatingState,\n error,\n ) &&\n error.code === 'workspace-not-found'\n ) {\n throw new WorkspaceNotFoundError(error.details.workspaceId);\n }\n throw error;\n }\n\n const {status} = state;\n switch (status) {\n case 'active':\n return;\n case 'suspended':\n throw new WorkspaceSuspendedError(workspaceId);\n case 'deleted':\n throw new WorkspaceDeletedError(workspaceId);\n default:\n return assertNever(status);\n }\n}\n\nfunction assertNever(value: never): never {\n throw new Error(`Unhandled workspace status: ${JSON.stringify(value)}`);\n}\n"],"names":["workspacesInterModuleContract","isInterModuleKnownError","WorkspaceDeletedError","WorkspaceNotFoundError","WorkspaceSuspendedError","assertWorkspaceAdmitsNewJobs","workspaces","workspaceId","state","getWorkspaceOperatingState","error","methods","code","details","status","assertNever","value","Error","JSON","stringify"],"mappings":"AAAA,SAEEA,6BAA6B,QACxB,2CAA2C;AAClD,SAAQC,uBAAuB,QAAO,wBAAwB;AAC9D,SAAQC,qBAAqB,EAAEC,sBAAsB,EAAEC,uBAAuB,QAAO,cAAc;AAEnG,OAAO,eAAeC,6BACpBC,UAA2E,EAC3EC,WAAmB;IAEnB,IAAIC;IACJ,IAAI;QACFA,QAAQ,MAAMF,WAAWG,0BAA0B,CAAC;YAACF;QAAW;IAClE,EAAE,OAAOG,OAAO;QACd,IACET,wBACED,8BAA8BW,OAAO,CAACF,0BAA0B,EAChEC,UAEFA,MAAME,IAAI,KAAK,uBACf;YACA,MAAM,IAAIT,uBAAuBO,MAAMG,OAAO,CAACN,WAAW;QAC5D;QACA,MAAMG;IACR;IAEA,MAAM,EAACI,MAAM,EAAC,GAAGN;IACjB,OAAQM;QACN,KAAK;YACH;QACF,KAAK;YACH,MAAM,IAAIV,wBAAwBG;QACpC,KAAK;YACH,MAAM,IAAIL,sBAAsBK;QAClC;YACE,OAAOQ,YAAYD;IACvB;AACF;AAEA,SAASC,YAAYC,KAAY;IAC/B,MAAM,IAAIC,MAAM,CAAC,4BAA4B,EAAEC,KAAKC,SAAS,CAACH,QAAQ;AACxE"}
package/dist/index.d.ts CHANGED
@@ -6,12 +6,13 @@ import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto
6
6
  import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
7
7
  import type { RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
8
8
  import type { SecretsInterModuleClient } from '@shipfox/api-secrets-dto/inter-module';
9
+ import type { WorkspacesInterModuleClient } from '@shipfox/api-workspaces-dto/inter-module';
9
10
  import { type ShipfoxModule } from '@shipfox/node-module';
10
11
  export type { Job, JobListenerEvent, JobListenerEventDisposition, RunWorkflowParams, Step, TriggerPayload, WorkflowRun, WorkflowSourceSnapshot, } from '#core/index.js';
11
12
  export { DefinitionNotFoundError, InterpolationUnresolvableError, isPermanentRunWorkflowError, ProjectMismatchError, runWorkflow, WorkflowRunNotCancellableError, } from '#core/index.js';
12
13
  export { closeDb, type DeliverEventToListenerParams, type DeliverEventToListenerResult, db, deliverEventToListener, getStepById, getStepByIdForJobExecution, migrationsPath, workflowsOutbox, } from '#db/index.js';
13
14
  export { loadRunningLeasedStep } from '#presentation/routes/leased-step.js';
14
- export declare function createWorkflowsModule({ agent, definitions, annotations, auth, integrations, projects, runners, secrets, }: {
15
+ export declare function createWorkflowsModule({ agent, definitions, annotations, auth, integrations, projects, runners, secrets, workspaces, }: {
15
16
  agent: AgentInterModuleClient;
16
17
  definitions: DefinitionsInterModuleClient;
17
18
  annotations: AnnotationsInterModuleClient;
@@ -20,5 +21,6 @@ export declare function createWorkflowsModule({ agent, definitions, annotations,
20
21
  projects: ProjectsModuleClient;
21
22
  runners: RunnersInterModuleClient;
22
23
  secrets: SecretsInterModuleClient;
24
+ workspaces: WorkspacesInterModuleClient;
23
25
  }): ShipfoxModule;
24
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAC,4BAA4B,E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QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,GACX,EAAE;IACD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,WAAW,EAAE,4BAA4B,CAAC;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAClC,UAAU,EAAE,2BAA2B,CAAC;CACzC,GAAG,aAAa,CAgDhB"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ export { loadRunningLeasedStep } from '#presentation/routes/leased-step.js';
14
14
  const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
15
15
  const workflowsPath = resolve(packageRoot, 'dist/temporal/workflows/index.js');
16
16
  const subscriber = subscriberFactory();
17
- export function createWorkflowsModule({ agent, definitions, annotations, auth, integrations, projects, runners, secrets }) {
17
+ export function createWorkflowsModule({ agent, definitions, annotations, auth, integrations, projects, runners, secrets, workspaces }) {
18
18
  return {
19
19
  name: 'workflows',
20
20
  database: {
@@ -29,7 +29,8 @@ export function createWorkflowsModule({ agent, definitions, annotations, auth, i
29
29
  integrations,
30
30
  projects,
31
31
  runners,
32
- secrets
32
+ secrets,
33
+ workspaces
33
34
  }),
34
35
  metrics: registerWorkflowsServiceMetrics,
35
36
  publishers: [
@@ -70,7 +71,8 @@ export function createWorkflowsModule({ agent, definitions, annotations, auth, i
70
71
  integrations,
71
72
  projects,
72
73
  runners,
73
- secrets
74
+ secrets,
75
+ workspaces
74
76
  })
75
77
  ]
76
78
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {dirname, resolve} from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {DefinitionsInterModuleClient} from '@shipfox/api-definitions-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {\n RUNNER_JOB_CLAIMED,\n RUNNER_JOB_LEASE_EXPIRED,\n RUNNER_JOB_QUEUED,\n type RunnersEventMap,\n} from '@shipfox/api-runners-dto';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport {\n WORKFLOWS_JOB_EVENT_DELIVERED,\n WORKFLOWS_JOB_STEPS_SETTLED,\n WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED,\n WORKFLOWS_WORKFLOW_RUN_CANCELLED,\n type WorkflowsEventMapDto,\n workflowsEventSchemas,\n} from '@shipfox/api-workflows-dto';\nimport {type ShipfoxModule, subscriberFactory} from '@shipfox/node-module';\nimport {db, migrationsPath, workflowsOutbox} from '#db/index.js';\nimport {registerWorkflowsServiceMetrics} from '#metrics/index.js';\nimport {\n createWorkflowRoutes,\n onJobEventDelivered,\n onJobStepsSettled,\n onRunnerJobClaimed,\n onRunnerJobLeaseExpired,\n onRunnerJobQueued,\n onWorkflowRunAttemptCreated,\n onWorkflowRunCancelled,\n} from '#presentation/index.js';\nimport {createWorkflowsInterModulePresentation} from '#presentation/inter-module.js';\nimport {createOrchestrationActivities, WORKFLOWS_TASK_QUEUE} from '#temporal/index.js';\n\nexport type {\n Job,\n JobListenerEvent,\n JobListenerEventDisposition,\n RunWorkflowParams,\n Step,\n TriggerPayload,\n WorkflowRun,\n WorkflowSourceSnapshot,\n} from '#core/index.js';\nexport {\n DefinitionNotFoundError,\n InterpolationUnresolvableError,\n isPermanentRunWorkflowError,\n ProjectMismatchError,\n runWorkflow,\n WorkflowRunNotCancellableError,\n} from '#core/index.js';\nexport {\n closeDb,\n type DeliverEventToListenerParams,\n type DeliverEventToListenerResult,\n db,\n deliverEventToListener,\n getStepById,\n getStepByIdForJobExecution,\n migrationsPath,\n workflowsOutbox,\n} from '#db/index.js';\nexport {loadRunningLeasedStep} from '#presentation/routes/leased-step.js';\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');\nconst workflowsPath = resolve(packageRoot, 'dist/temporal/workflows/index.js');\n\nconst subscriber = subscriberFactory<WorkflowsEventMapDto & RunnersEventMap>();\n\nexport function createWorkflowsModule({\n agent,\n definitions,\n annotations,\n auth,\n integrations,\n projects,\n runners,\n secrets,\n}: {\n agent: AgentInterModuleClient;\n definitions: DefinitionsInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: SecretsInterModuleClient;\n}): ShipfoxModule {\n return {\n name: 'workflows',\n database: {db, migrationsPath, databaseNamespace: 'workflows'},\n routes: createWorkflowRoutes({\n agent,\n annotations,\n auth,\n integrations,\n projects,\n runners,\n secrets,\n }),\n metrics: registerWorkflowsServiceMetrics,\n publishers: [\n {name: 'workflows', table: workflowsOutbox, db, eventSchemas: workflowsEventSchemas},\n ],\n subscribers: [\n subscriber(WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED, onWorkflowRunAttemptCreated),\n subscriber(WORKFLOWS_WORKFLOW_RUN_CANCELLED, onWorkflowRunCancelled),\n subscriber(WORKFLOWS_JOB_EVENT_DELIVERED, onJobEventDelivered),\n subscriber(WORKFLOWS_JOB_STEPS_SETTLED, onJobStepsSettled),\n subscriber(RUNNER_JOB_LEASE_EXPIRED, onRunnerJobLeaseExpired),\n subscriber(RUNNER_JOB_QUEUED, onRunnerJobQueued),\n subscriber(RUNNER_JOB_CLAIMED, onRunnerJobClaimed),\n ],\n workers: [\n {\n taskQueue: WORKFLOWS_TASK_QUEUE,\n workflowsPath,\n activities: () =>\n createOrchestrationActivities({agent, integrations, projects, runners, secrets}),\n workflows: [],\n },\n ],\n interModulePresentations: [\n createWorkflowsInterModulePresentation({\n agent,\n definitions,\n integrations,\n projects,\n runners,\n secrets,\n }),\n ],\n };\n}\n"],"names":["dirname","resolve","fileURLToPath","RUNNER_JOB_CLAIMED","RUNNER_JOB_LEASE_EXPIRED","RUNNER_JOB_QUEUED","WORKFLOWS_JOB_EVENT_DELIVERED","WORKFLOWS_JOB_STEPS_SETTLED","WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED","WORKFLOWS_WORKFLOW_RUN_CANCELLED","workflowsEventSchemas","subscriberFactory","db","migrationsPath","workflowsOutbox","registerWorkflowsServiceMetrics","createWorkflowRoutes","onJobEventDelivered","onJobStepsSettled","onRunnerJobClaimed","onRunnerJobLeaseExpired","onRunnerJobQueued","onWorkflowRunAttemptCreated","onWorkflowRunCancelled","createWorkflowsInterModulePresentation","createOrchestrationActivities","WORKFLOWS_TASK_QUEUE","DefinitionNotFoundError","InterpolationUnresolvableError","isPermanentRunWorkflowError","ProjectMismatchError","runWorkflow","WorkflowRunNotCancellableError","closeDb","deliverEventToListener","getStepById","getStepByIdForJobExecution","loadRunningLeasedStep","packageRoot","url","workflowsPath","subscriber","createWorkflowsModule","agent","definitions","annotations","auth","integrations","projects","runners","secrets","name","database","databaseNamespace","routes","metrics","publishers","table","eventSchemas","subscribers","workers","taskQueue","activities","workflows","interModulePresentations"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,OAAO,QAAO,YAAY;AAC3C,SAAQC,aAAa,QAAO,WAAW;AAOvC,SACEC,kBAAkB,EAClBC,wBAAwB,EACxBC,iBAAiB,QAEZ,2BAA2B;AAGlC,SACEC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,sCAAsC,EACtCC,gCAAgC,EAEhCC,qBAAqB,QAChB,6BAA6B;AACpC,SAA4BC,iBAAiB,QAAO,uBAAuB;AAC3E,SAAQ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A0BgB;YACrCqB,WAAWpC,mBAAmBgB;YAC9BoB,WAAWtC,oBAAoBgB;SAChC;QACDyC,SAAS;YACP;gBACEC,WAAWnC;gBACXc;gBACAsB,YAAY,IACVrC,8BAA8B;wBAACkB;wBAAOI;wBAAcC;wBAAUC;wBAASC;oBAAO;gBAChFa,WAAW,EAAE;YACf;SACD;QACDC,0BAA0B;YACxBxC,uCAAuC;gBACrCmB;gBACAC;gBACAG;gBACAC;gBACAC;gBACAC;YACF;SACD;IACH;AACF"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {dirname, resolve} from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {DefinitionsInterModuleClient} from '@shipfox/api-definitions-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {\n RUNNER_JOB_CLAIMED,\n RUNNER_JOB_LEASE_EXPIRED,\n RUNNER_JOB_QUEUED,\n type RunnersEventMap,\n} from '@shipfox/api-runners-dto';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport {\n WORKFLOWS_JOB_EVENT_DELIVERED,\n WORKFLOWS_JOB_STEPS_SETTLED,\n WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED,\n WORKFLOWS_WORKFLOW_RUN_CANCELLED,\n type WorkflowsEventMapDto,\n workflowsEventSchemas,\n} from '@shipfox/api-workflows-dto';\nimport type {WorkspacesInterModuleClient} from '@shipfox/api-workspaces-dto/inter-module';\nimport {type ShipfoxModule, subscriberFactory} from '@shipfox/node-module';\nimport {db, migrationsPath, workflowsOutbox} from '#db/index.js';\nimport {registerWorkflowsServiceMetrics} from '#metrics/index.js';\nimport {\n createWorkflowRoutes,\n onJobEventDelivered,\n onJobStepsSettled,\n onRunnerJobClaimed,\n onRunnerJobLeaseExpired,\n onRunnerJobQueued,\n onWorkflowRunAttemptCreated,\n onWorkflowRunCancelled,\n} from '#presentation/index.js';\nimport {createWorkflowsInterModulePresentation} from '#presentation/inter-module.js';\nimport {createOrchestrationActivities, WORKFLOWS_TASK_QUEUE} from '#temporal/index.js';\n\nexport type {\n Job,\n JobListenerEvent,\n JobListenerEventDisposition,\n RunWorkflowParams,\n Step,\n TriggerPayload,\n WorkflowRun,\n WorkflowSourceSnapshot,\n} from '#core/index.js';\nexport {\n DefinitionNotFoundError,\n InterpolationUnresolvableError,\n isPermanentRunWorkflowError,\n ProjectMismatchError,\n runWorkflow,\n WorkflowRunNotCancellableError,\n} from '#core/index.js';\nexport {\n closeDb,\n type DeliverEventToListenerParams,\n type DeliverEventToListenerResult,\n db,\n deliverEventToListener,\n getStepById,\n getStepByIdForJobExecution,\n migrationsPath,\n workflowsOutbox,\n} from '#db/index.js';\nexport {loadRunningLeasedStep} from '#presentation/routes/leased-step.js';\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');\nconst workflowsPath = resolve(packageRoot, 'dist/temporal/workflows/index.js');\n\nconst subscriber = subscriberFactory<WorkflowsEventMapDto & RunnersEventMap>();\n\nexport function createWorkflowsModule({\n agent,\n definitions,\n annotations,\n auth,\n integrations,\n projects,\n runners,\n secrets,\n workspaces,\n}: {\n agent: AgentInterModuleClient;\n definitions: DefinitionsInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: SecretsInterModuleClient;\n workspaces: WorkspacesInterModuleClient;\n}): ShipfoxModule {\n return {\n name: 'workflows',\n database: {db, migrationsPath, databaseNamespace: 'workflows'},\n routes: createWorkflowRoutes({\n agent,\n annotations,\n auth,\n integrations,\n projects,\n runners,\n secrets,\n workspaces,\n }),\n metrics: registerWorkflowsServiceMetrics,\n publishers: [\n {name: 'workflows', table: workflowsOutbox, db, eventSchemas: workflowsEventSchemas},\n ],\n subscribers: [\n subscriber(WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED, onWorkflowRunAttemptCreated),\n subscriber(WORKFLOWS_WORKFLOW_RUN_CANCELLED, onWorkflowRunCancelled),\n subscriber(WORKFLOWS_JOB_EVENT_DELIVERED, onJobEventDelivered),\n subscriber(WORKFLOWS_JOB_STEPS_SETTLED, onJobStepsSettled),\n subscriber(RUNNER_JOB_LEASE_EXPIRED, onRunnerJobLeaseExpired),\n subscriber(RUNNER_JOB_QUEUED, onRunnerJobQueued),\n subscriber(RUNNER_JOB_CLAIMED, onRunnerJobClaimed),\n ],\n workers: [\n {\n taskQueue: WORKFLOWS_TASK_QUEUE,\n workflowsPath,\n activities: () =>\n createOrchestrationActivities({agent, integrations, projects, runners, secrets}),\n workflows: [],\n },\n ],\n interModulePresentations: [\n createWorkflowsInterModulePresentation({\n agent,\n definitions,\n integrations,\n projects,\n runners,\n secrets,\n workspaces,\n }),\n ],\n };\n}\n"],"names":["dirname","resolve","fileURLToPath","RUNNER_JOB_CLAIMED","RUNNER_JOB_LEASE_EXPIRED","RUNNER_JOB_QUEUED","WORKFLOWS_JOB_EVENT_DELIVERED","WORKFLOWS_JOB_STEPS_SETTLED","WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED","WORKFLOWS_WORKFLOW_RUN_CANCELLED","workflowsEventSchemas","subscriberFactory","db","migrationsPath","workflowsOutbox","registerWorkflowsServiceMetrics","createWorkflowRoutes","onJobEventDelivered","onJobStepsSettled","onRunnerJobClaimed","onRunnerJobLeaseExpired","onRunnerJobQueued","onWorkflowRunAttemptCreated","onWorkflowRunCancelled","createWorkflowsInterModulePresentation","createOrchestrationActivities","WORKFLOWS_TASK_QUEUE","DefinitionNotFoundError","InterpolationUnresolvableError","isPermanentRunWorkflowError","ProjectMismatchError","runWorkflow","WorkflowRunNotCancellableError","closeDb","deliverEventToListener","getStepById","getStepByIdForJobExecution","loadRunningLeasedStep","packageRoot","url","workflowsPath","subscriber","createWorkflowsModule","agent","definitions","annotations","auth","integrations","projects","runners","secrets","workspaces","name","database","databaseNamespace","routes","metrics","publishers","table","eventSchemas","subscribers","workers","taskQueue","activities","workflows","interModulePresentations"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,OAAO,QAAO,YAAY;AAC3C,SAAQC,aAAa,QAAO,WAAW;AAOvC,SACEC,kBAAkB,EAClBC,wBAAwB,EACxBC,iBAAiB,QAEZ,2BAA2B;AAGlC,SACEC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,sCAAsC,EACtCC,gCAAgC,EAEhCC,qBAAqB,QAChB,6BAA6B;AAEpC,SAA4BC,iBAAiB,QAAO,uBAAuB;AAC3E,SAAQC,EAAE,EAAEC,cAAc,EAAEC,eAAe,QAAO,eAAe;AACjE,SAAQC,+BAA+B,QAAO,oBAAoB;AAClE,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,EACvBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,sBAAsB,QACjB,yBAAyB;AAChC,SAAQC,sCAAsC,QAAO,gCAAgC;AACrF,SAAQC,6BAA6B,EAAEC,oBAAoB,QAAO,qBAAqB;AAYvF,SACEC,uBAAuB,EACvBC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,oBAAoB,EACpBC,WAAW,EACXC,8BAA8B,QACzB,iBAAiB;AACxB,SACEC,OAAO,EAGPrB,EAAE,EACFsB,sBAAsB,EACtBC,WAAW,EACXC,0BAA0B,EAC1BvB,cAAc,EACdC,eAAe,QACV,eAAe;AACtB,SAAQuB,qBAAqB,QAAO,sCAAsC;AAE1E,MAAMC,cAAcrC,QAAQD,QAAQE,cAAc,YAAYqC,GAAG,IAAI;AACrE,MAAMC,gBAAgBvC,QAAQqC,aAAa;AAE3C,MAAMG,aAAa9B;AAEnB,OAAO,SAAS+B,sBAAsB,EACpCC,KAAK,EACLC,WAAW,EACXC,WAAW,EACXC,IAAI,EACJC,YAAY,EACZC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,UAAU,EAWX;IACC,OAAO;QACLC,MAAM;QACNC,UAAU;YAACzC;YAAIC;YAAgByC,mBAAmB;QAAW;QAC7DC,QAAQvC,qBAAqB;YAC3B2B;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;QACAK,SAASzC;QACT0C,YAAY;YACV;gBAACL,MAAM;gBAAaM,OAAO5C;gBAAiBF;gBAAI+C,cAAcjD;YAAqB;SACpF;QACDkD,aAAa;YACXnB,WAAWjC,wCAAwCc;YACnDmB,WAAWhC,kCAAkCc;YAC7CkB,WAAWnC,+BAA+BW;YAC1CwB,WAAWlC,6BAA6BW;YACxCuB,WAAWrC,0BAA0BgB;YACrCqB,WAAWpC,mBAAmBgB;YAC9BoB,WAAWtC,oBAAoBgB;SAChC;QACD0C,SAAS;YACP;gBACEC,WAAWpC;gBACXc;gBACAuB,YAAY,IACVtC,8BAA8B;wBAACkB;wBAAOI;wBAAcC;wBAAUC;wBAASC;oBAAO;gBAChFc,WAAW,EAAE;YACf;SACD;QACDC,0BAA0B;YACxBzC,uCAAuC;gBACrCmB;gBACAC;gBACAG;gBACAC;gBACAC;gBACAC;gBACAC;YACF;SACD;IACH;AACF"}
@@ -5,10 +5,12 @@ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-modul
5
5
  import type { RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
6
6
  import type { SecretsInterModuleClient } from '@shipfox/api-secrets-dto/inter-module';
7
7
  import { workflowsInterModuleContract } from '@shipfox/api-workflows-dto/inter-module';
8
+ import type { WorkspacesInterModuleClient } from '@shipfox/api-workspaces-dto/inter-module';
8
9
  import { type InterModulePresentation } from '@shipfox/inter-module';
9
10
  export declare function createWorkflowsInterModulePresentation(params: {
10
11
  agent: AgentInterModuleClient;
11
12
  definitions: DefinitionsInterModuleClient;
13
+ workspaces: WorkspacesInterModuleClient;
12
14
  secrets: Pick<SecretsInterModuleClient, 'getVariablesByNamespace'>;
13
15
  runners: RunnersInterModuleClient;
14
16
  integrations: IntegrationsModuleClient;
@@ -1 +1 @@
1
- {"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,2CAA2C,CAAC;AAC5F,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAC,4BAA4B,EAAC,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAc/B,wBAAgB,sCAAsC,CAAC,MAAM,EAAE;IAC7D,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAC;IACnE,OAAO,EAAE,wBAAwB,CAAC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;CAChC,GAAG,uBAAuB,CAAC,OAAO,4BAA4B,CAAC,CA+D/D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CA8BlF"}
1
+ {"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,2CAA2C,CAAC;AAC5F,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAC,4BAA4B,EAAC,MAAM,yCAAyC,CAAC;AACrF,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAwB/B,wBAAgB,sCAAsC,CAAC,MAAM,EAAE;IAC7D,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,UAAU,EAAE,2BAA2B,CAAC;IACxC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAC;IACnE,OAAO,EAAE,wBAAwB,CAAC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;CAChC,GAAG,uBAAuB,CAAC,OAAO,4BAA4B,CAAC,CA4E/D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAgClF"}
@@ -2,14 +2,16 @@ import { materializedAgentStepConfigSchema } from '@shipfox/api-agent-dto';
2
2
  import { workflowsInterModuleContract } from '@shipfox/api-workflows-dto/inter-module';
3
3
  import { createInterModuleKnownError, defineInterModulePresentation } from '@shipfox/inter-module';
4
4
  import { DEFAULT_HARNESS, harnessSchema } from '@shipfox/workflow-document';
5
- import { InvalidJobRunnerLabelsError } from '#core/errors.js';
5
+ import { InvalidJobRunnerLabelsError, WorkspaceDeletedError, WorkspaceNotFoundError, WorkspaceSuspendedError } from '#core/errors.js';
6
6
  import { AgentConfigUnresolvableError, AgentIntegrationMaterializationError, DefinitionNotFoundError, InterpolationUnresolvableError, ProjectMismatchError, runWorkflow } from '#core/index.js';
7
+ import { assertWorkspaceAdmitsNewJobs } from '#core/workspace-admission.js';
7
8
  import { getJobScope, getStepById, getStepByIdForJobExecution } from '#db/index.js';
8
9
  import { deliverEventToListener } from '#db/job-listener-events.js';
9
10
  export function createWorkflowsInterModulePresentation(params) {
10
11
  return defineInterModulePresentation(workflowsInterModuleContract, {
11
12
  startRunFromTrigger: async (input)=>{
12
13
  try {
14
+ await assertWorkspaceAdmitsNewJobs(params.workspaces, input.workspaceId);
13
15
  const run = await runWorkflow(params.definitions, {
14
16
  agent: params.agent,
15
17
  workspaceId: input.workspaceId,
@@ -31,10 +33,23 @@ export function createWorkflowsInterModulePresentation(params) {
31
33
  throw toStartRunKnownError(error, input.definitionId);
32
34
  }
33
35
  },
34
- deliverEventToJobListener: async (input)=>await deliverEventToListener({
35
- ...input,
36
- receivedAt: new Date(input.receivedAt)
37
- }),
36
+ deliverEventToJobListener: async (input)=>{
37
+ const method = workflowsInterModuleContract.methods.deliverEventToJobListener;
38
+ try {
39
+ if (input.disposition === 'fire') {
40
+ const scope = await getJobScope(input.jobId);
41
+ if (scope) await assertWorkspaceAdmitsNewJobs(params.workspaces, scope.workspaceId);
42
+ }
43
+ return await deliverEventToListener({
44
+ ...input,
45
+ receivedAt: new Date(input.receivedAt)
46
+ });
47
+ } catch (error) {
48
+ const workspaceError = toWorkspaceAdmissionKnownError(method, error);
49
+ if (workspaceError !== undefined) throw workspaceError;
50
+ throw error;
51
+ }
52
+ },
38
53
  getStepLogContext: async ({ stepId })=>{
39
54
  const step = await getStepById(stepId);
40
55
  const parsed = harnessSchema.safeParse(step?.config.harness);
@@ -75,6 +90,8 @@ export function createWorkflowsInterModulePresentation(params) {
75
90
  }
76
91
  export function toStartRunKnownError(error, definitionId) {
77
92
  const method = workflowsInterModuleContract.methods.startRunFromTrigger;
93
+ const workspaceError = toWorkspaceAdmissionKnownError(method, error);
94
+ if (workspaceError !== undefined) return workspaceError;
78
95
  if (error instanceof DefinitionNotFoundError) {
79
96
  return createInterModuleKnownError(method, 'definition-not-found', {
80
97
  definitionId
@@ -110,5 +127,23 @@ export function toStartRunKnownError(error, definitionId) {
110
127
  }
111
128
  return error;
112
129
  }
130
+ function toWorkspaceAdmissionKnownError(method, error) {
131
+ if (error instanceof WorkspaceSuspendedError) {
132
+ return createInterModuleKnownError(method, 'workspace-suspended', {
133
+ workspaceId: error.workspaceId
134
+ });
135
+ }
136
+ if (error instanceof WorkspaceDeletedError) {
137
+ return createInterModuleKnownError(method, 'workspace-deleted', {
138
+ workspaceId: error.workspaceId
139
+ });
140
+ }
141
+ if (error instanceof WorkspaceNotFoundError) {
142
+ return createInterModuleKnownError(method, 'workspace-not-found', {
143
+ workspaceId: error.workspaceId
144
+ });
145
+ }
146
+ return undefined;
147
+ }
113
148
 
114
149
  //# sourceMappingURL=inter-module.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/presentation/inter-module.ts"],"sourcesContent":["import {materializedAgentStepConfigSchema} from '@shipfox/api-agent-dto';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport type {DefinitionsInterModuleClient} from '@shipfox/api-definitions-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport {workflowsInterModuleContract} from '@shipfox/api-workflows-dto/inter-module';\nimport {\n createInterModuleKnownError,\n defineInterModulePresentation,\n type InterModulePresentation,\n} from '@shipfox/inter-module';\nimport {DEFAULT_HARNESS, harnessSchema} from '@shipfox/workflow-document';\nimport {InvalidJobRunnerLabelsError} from '#core/errors.js';\nimport {\n AgentConfigUnresolvableError,\n AgentIntegrationMaterializationError,\n DefinitionNotFoundError,\n InterpolationUnresolvableError,\n ProjectMismatchError,\n runWorkflow,\n} from '#core/index.js';\nimport {getJobScope, getStepById, getStepByIdForJobExecution} from '#db/index.js';\nimport {deliverEventToListener} from '#db/job-listener-events.js';\n\nexport function createWorkflowsInterModulePresentation(params: {\n agent: AgentInterModuleClient;\n definitions: DefinitionsInterModuleClient;\n secrets: Pick<SecretsInterModuleClient, 'getVariablesByNamespace'>;\n runners: RunnersInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n}): InterModulePresentation<typeof workflowsInterModuleContract> {\n return defineInterModulePresentation(workflowsInterModuleContract, {\n startRunFromTrigger: async (input) => {\n try {\n const run = await runWorkflow(\n params.definitions,\n {\n agent: params.agent,\n workspaceId: input.workspaceId,\n projectId: input.projectId,\n definitionId: input.definitionId,\n triggerPayload: input.triggerPayload,\n inputs: input.inputs,\n triggerIdempotencyKey: input.idempotencyKey,\n integrations: params.integrations,\n projects: params.projects,\n },\n {secrets: params.secrets},\n );\n return {id: run.id, name: run.name};\n } catch (error) {\n throw toStartRunKnownError(error, input.definitionId);\n }\n },\n deliverEventToJobListener: async (input) =>\n await deliverEventToListener({...input, receivedAt: new Date(input.receivedAt)}),\n getStepLogContext: async ({stepId}) => {\n const step = await getStepById(stepId);\n const parsed = harnessSchema.safeParse(step?.config.harness);\n return {harness: parsed.success ? parsed.data : DEFAULT_HARNESS};\n },\n getLeasedAgentToolContext: async (input) => {\n const method = workflowsInterModuleContract.methods.getLeasedAgentToolContext;\n const {active: leaseIsActive} = await params.runners.getLeaseState({\n jobId: input.jobId,\n jobExecutionId: input.jobExecutionId,\n runnerSessionId: input.runnerSessionId,\n });\n if (!leaseIsActive) throw createInterModuleKnownError(method, 'lease-not-active', {});\n\n const step = await getStepByIdForJobExecution({\n stepId: input.stepId,\n jobExecutionId: input.jobExecutionId,\n });\n if (!step) throw createInterModuleKnownError(method, 'step-not-found', {});\n\n const scope = await getJobScope(input.jobId);\n if (!scope) throw createInterModuleKnownError(method, 'job-not-found', {});\n if (step.currentAttempt !== input.attempt) {\n throw createInterModuleKnownError(method, 'step-attempt-mismatch', {});\n }\n if (step.status !== 'running')\n throw createInterModuleKnownError(method, 'step-not-running', {});\n if (step.type !== 'agent')\n throw createInterModuleKnownError(method, 'leased-step-not-agent', {});\n\n const config = materializedAgentStepConfigSchema.safeParse(step.config);\n if (!config.success) {\n throw createInterModuleKnownError(method, 'agent-step-config-invalid', {});\n }\n return {workspaceId: scope.workspaceId, integrations: config.data.integrations ?? []};\n },\n });\n}\n\nexport function toStartRunKnownError(error: unknown, definitionId: string): unknown {\n const method = workflowsInterModuleContract.methods.startRunFromTrigger;\n if (error instanceof DefinitionNotFoundError) {\n return createInterModuleKnownError(method, 'definition-not-found', {definitionId});\n }\n if (error instanceof ProjectMismatchError) {\n return createInterModuleKnownError(method, 'project-mismatch', {});\n }\n if (error instanceof AgentConfigUnresolvableError) {\n return createInterModuleKnownError(method, 'agent-config-unresolvable', {\n definitionId: error.definitionId,\n });\n }\n if (error instanceof AgentIntegrationMaterializationError) {\n return createInterModuleKnownError(method, 'agent-integration-materialization-failed', {});\n }\n if (error instanceof InterpolationUnresolvableError) {\n return createInterModuleKnownError(method, 'interpolation-unresolvable', {\n definitionId: error.definitionId,\n field: error.field,\n source: error.source,\n ...(error.envKey === undefined ? {} : {envKey: error.envKey}),\n });\n }\n if (error instanceof InvalidJobRunnerLabelsError) {\n return createInterModuleKnownError(method, 'invalid-job-runner-labels', {\n labels: [...error.labels],\n });\n }\n return error;\n}\n"],"names":["materializedAgentStepConfigSchema","workflowsInterModuleContract","createInterModuleKnownError","defineInterModulePresentation","DEFAULT_HARNESS","harnessSchema","InvalidJobRunnerLabelsError","AgentConfigUnresolvableError","AgentIntegrationMaterializationError","DefinitionNotFoundError","InterpolationUnresolvableError","ProjectMismatchError","runWorkflow","getJobScope","getStepById","getStepByIdForJobExecution","deliverEventToListener","createWorkflowsInterModulePresentation","params","startRunFromTrigger","input","run","definitions","agent","workspaceId","projectId","definitionId","triggerPayload","inputs","triggerIdempotencyKey","idempotencyKey","integrations","projects","secrets","id","name","error","toStartRunKnownError","deliverEventToJobListener","receivedAt","Date","getStepLogContext","stepId","step","parsed","safeParse","config","harness","success","data","getLeasedAgentToolContext","method","methods","active","leaseIsActive","runners","getLeaseState","jobId","jobExecutionId","runnerSessionId","scope","currentAttempt","attempt","status","type","field","source","envKey","undefined","labels"],"mappings":"AAAA,SAAQA,iCAAiC,QAAO,yBAAyB;AAOzE,SAAQC,4BAA4B,QAAO,0CAA0C;AACrF,SACEC,2BAA2B,EAC3BC,6BAA6B,QAExB,wBAAwB;AAC/B,SAAQC,eAAe,EAAEC,aAAa,QAAO,6BAA6B;AAC1E,SAAQC,2BAA2B,QAAO,kBAAkB;AAC5D,SACEC,4BAA4B,EAC5BC,oCAAoC,EACpCC,uBAAuB,EACvBC,8BAA8B,EAC9BC,oBAAoB,EACpBC,WAAW,QACN,iBAAiB;AACxB,SAAQC,WAAW,EAAEC,WAAW,EAAEC,0BAA0B,QAAO,eAAe;AAClF,SAAQC,sBAAsB,QAAO,6BAA6B;AAElE,OAAO,SAASC,uCAAuCC,MAOtD;IACC,OAAOf,8BAA8BF,8BAA8B;QACjEkB,qBAAqB,OAAOC;YAC1B,IAAI;gBACF,MAAMC,MAAM,MAAMT,YAChBM,OAAOI,WAAW,EAClB;oBACEC,OAAOL,OAAOK,KAAK;oBACnBC,aAAaJ,MAAMI,WAAW;oBAC9BC,WAAWL,MAAMK,SAAS;oBAC1BC,cAAcN,MAAMM,YAAY;oBAChCC,gBAAgBP,MAAMO,cAAc;oBACpCC,QAAQR,MAAMQ,MAAM;oBACpBC,uBAAuBT,MAAMU,cAAc;oBAC3CC,cAAcb,OAAOa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AC;QAC9D;IACF;IACA,IAAI/B,iBAAiB9B,6BAA6B;QAChD,OAAOJ,4BAA4BiD,QAAQ,6BAA6B;YACtEkB,QAAQ;mBAAIjC,MAAMiC,MAAM;aAAC;QAC3B;IACF;IACA,OAAOjC;AACT"}
1
+ {"version":3,"sources":["../../src/presentation/inter-module.ts"],"sourcesContent":["import {materializedAgentStepConfigSchema} from '@shipfox/api-agent-dto';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport type {DefinitionsInterModuleClient} from '@shipfox/api-definitions-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport {workflowsInterModuleContract} from '@shipfox/api-workflows-dto/inter-module';\nimport type {WorkspacesInterModuleClient} from '@shipfox/api-workspaces-dto/inter-module';\nimport {\n createInterModuleKnownError,\n defineInterModulePresentation,\n type InterModuleKnownErrorFor,\n type InterModulePresentation,\n} from '@shipfox/inter-module';\nimport {DEFAULT_HARNESS, harnessSchema} from '@shipfox/workflow-document';\nimport {\n InvalidJobRunnerLabelsError,\n WorkspaceDeletedError,\n WorkspaceNotFoundError,\n WorkspaceSuspendedError,\n} from '#core/errors.js';\nimport {\n AgentConfigUnresolvableError,\n AgentIntegrationMaterializationError,\n DefinitionNotFoundError,\n InterpolationUnresolvableError,\n ProjectMismatchError,\n runWorkflow,\n} from '#core/index.js';\nimport {assertWorkspaceAdmitsNewJobs} from '#core/workspace-admission.js';\nimport {getJobScope, getStepById, getStepByIdForJobExecution} from '#db/index.js';\nimport {deliverEventToListener} from '#db/job-listener-events.js';\n\ntype WorkspaceAdmissionKnownError = InterModuleKnownErrorFor<\n typeof workflowsInterModuleContract.methods.deliverEventToJobListener\n>;\n\nexport function createWorkflowsInterModulePresentation(params: {\n agent: AgentInterModuleClient;\n definitions: DefinitionsInterModuleClient;\n workspaces: WorkspacesInterModuleClient;\n secrets: Pick<SecretsInterModuleClient, 'getVariablesByNamespace'>;\n runners: RunnersInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n}): InterModulePresentation<typeof workflowsInterModuleContract> {\n return defineInterModulePresentation(workflowsInterModuleContract, {\n startRunFromTrigger: async (input) => {\n try {\n await assertWorkspaceAdmitsNewJobs(params.workspaces, input.workspaceId);\n const run = await runWorkflow(\n params.definitions,\n {\n agent: params.agent,\n workspaceId: input.workspaceId,\n projectId: input.projectId,\n definitionId: input.definitionId,\n triggerPayload: input.triggerPayload,\n inputs: input.inputs,\n triggerIdempotencyKey: input.idempotencyKey,\n integrations: params.integrations,\n projects: params.projects,\n },\n {secrets: params.secrets},\n );\n return {id: run.id, name: run.name};\n } catch (error) {\n throw toStartRunKnownError(error, input.definitionId);\n }\n },\n deliverEventToJobListener: async (input) => {\n const method = workflowsInterModuleContract.methods.deliverEventToJobListener;\n try {\n if (input.disposition === 'fire') {\n const scope = await getJobScope(input.jobId);\n if (scope) await assertWorkspaceAdmitsNewJobs(params.workspaces, scope.workspaceId);\n }\n return await deliverEventToListener({...input, receivedAt: new Date(input.receivedAt)});\n } catch (error) {\n const workspaceError = toWorkspaceAdmissionKnownError(method, error);\n if (workspaceError !== undefined) throw workspaceError;\n throw error;\n }\n },\n getStepLogContext: async ({stepId}) => {\n const step = await getStepById(stepId);\n const parsed = harnessSchema.safeParse(step?.config.harness);\n return {harness: parsed.success ? parsed.data : DEFAULT_HARNESS};\n },\n getLeasedAgentToolContext: async (input) => {\n const method = workflowsInterModuleContract.methods.getLeasedAgentToolContext;\n const {active: leaseIsActive} = await params.runners.getLeaseState({\n jobId: input.jobId,\n jobExecutionId: input.jobExecutionId,\n runnerSessionId: input.runnerSessionId,\n });\n if (!leaseIsActive) throw createInterModuleKnownError(method, 'lease-not-active', {});\n\n const step = await getStepByIdForJobExecution({\n stepId: input.stepId,\n jobExecutionId: input.jobExecutionId,\n });\n if (!step) throw createInterModuleKnownError(method, 'step-not-found', {});\n\n const scope = await getJobScope(input.jobId);\n if (!scope) throw createInterModuleKnownError(method, 'job-not-found', {});\n if (step.currentAttempt !== input.attempt) {\n throw createInterModuleKnownError(method, 'step-attempt-mismatch', {});\n }\n if (step.status !== 'running')\n throw createInterModuleKnownError(method, 'step-not-running', {});\n if (step.type !== 'agent')\n throw createInterModuleKnownError(method, 'leased-step-not-agent', {});\n\n const config = materializedAgentStepConfigSchema.safeParse(step.config);\n if (!config.success) {\n throw createInterModuleKnownError(method, 'agent-step-config-invalid', {});\n }\n return {workspaceId: scope.workspaceId, integrations: config.data.integrations ?? []};\n },\n });\n}\n\nexport function toStartRunKnownError(error: unknown, definitionId: string): unknown {\n const method = workflowsInterModuleContract.methods.startRunFromTrigger;\n const workspaceError = toWorkspaceAdmissionKnownError(method, error);\n if (workspaceError !== undefined) return workspaceError;\n if (error instanceof DefinitionNotFoundError) {\n return createInterModuleKnownError(method, 'definition-not-found', {definitionId});\n }\n if (error instanceof ProjectMismatchError) {\n return createInterModuleKnownError(method, 'project-mismatch', {});\n }\n if (error instanceof AgentConfigUnresolvableError) {\n return createInterModuleKnownError(method, 'agent-config-unresolvable', {\n definitionId: error.definitionId,\n });\n }\n if (error instanceof AgentIntegrationMaterializationError) {\n return createInterModuleKnownError(method, 'agent-integration-materialization-failed', {});\n }\n if (error instanceof InterpolationUnresolvableError) {\n return createInterModuleKnownError(method, 'interpolation-unresolvable', {\n definitionId: error.definitionId,\n field: error.field,\n source: error.source,\n ...(error.envKey === undefined ? {} : {envKey: error.envKey}),\n });\n }\n if (error instanceof InvalidJobRunnerLabelsError) {\n return createInterModuleKnownError(method, 'invalid-job-runner-labels', {\n labels: [...error.labels],\n });\n }\n return error;\n}\n\nfunction toWorkspaceAdmissionKnownError(\n method:\n | typeof workflowsInterModuleContract.methods.startRunFromTrigger\n | typeof workflowsInterModuleContract.methods.deliverEventToJobListener,\n error: unknown,\n): WorkspaceAdmissionKnownError | undefined {\n if (error instanceof WorkspaceSuspendedError) {\n return createInterModuleKnownError(method, 'workspace-suspended', {\n workspaceId: error.workspaceId,\n });\n }\n if (error instanceof WorkspaceDeletedError) {\n return createInterModuleKnownError(method, 'workspace-deleted', {\n workspaceId: error.workspaceId,\n });\n }\n if (error instanceof WorkspaceNotFoundError) {\n return createInterModuleKnownError(method, 'workspace-not-found', {\n workspaceId: error.workspaceId,\n });\n }\n return undefined;\n}\n"],"names":["materializedAgentStepConfigSchema","workflowsInterModuleContract","createInterModuleKnownError","defineInterModulePresentation","DEFAULT_HARNESS","harnessSchema","InvalidJobRunnerLabelsError","WorkspaceDeletedError","WorkspaceNotFoundError","WorkspaceSuspendedError","AgentConfigUnresolvableError","AgentIntegrationMaterializationError","DefinitionNotFoundError","InterpolationUnresolvableError","ProjectMismatchError","runWorkflow","assertWorkspaceAdmitsNewJobs","getJobScope","getStepById","getStepByIdForJobExecution","deliverEventToListener","createWorkflowsInterModulePresentation","params","startRunFromTrigger","input","workspaces","workspaceId","run","definitions","agent","projectId","definitionId","triggerPayload","inputs","triggerIdempotencyKey","idempotencyKey","integrations","projects","secrets","id","name","error","toStartRunKnownError","deliverEventToJobListener","method","methods","disposition","scope","jobId","receivedAt","Date","workspaceError","toWorkspaceAdmissionKnownError","undefined","getStepLogContext","stepId","step","parsed","safeParse","config","harness","success","data","getLeasedAgentToolContext","active","leaseIsActive","runners","getLeaseState","jobExecutionId","runnerSessionId","currentAttempt","attempt","status","type","field","source","envKey","labels"],"mappings":"AAAA,SAAQA,iCAAiC,QAAO,yBAAyB;AAOzE,SAAQC,4BAA4B,QAAO,0CAA0C;AAErF,SACEC,2BAA2B,EAC3BC,6BAA6B,QAGxB,wBAAwB;AAC/B,SAAQC,eAAe,EAAEC,aAAa,QAAO,6BAA6B;AAC1E,SACEC,2BAA2B,EAC3BC,qBAAqB,EACrBC,sBAAsB,EACtBC,uBAAuB,QAClB,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C,QAAQ,6BAA6B;YACtEiC,QAAQ;mBAAIpC,MAAMoC,MAAM;aAAC;QAC3B;IACF;IACA,OAAOpC;AACT;AAEA,SAASW,+BACPR,MAEyE,EACzEH,KAAc;IAEd,IAAIA,iBAAiBhC,yBAAyB;QAC5C,OAAOP,4BAA4B0C,QAAQ,uBAAuB;YAChElB,aAAae,MAAMf,WAAW;QAChC;IACF;IACA,IAAIe,iBAAiBlC,uBAAuB;QAC1C,OAAOL,4BAA4B0C,QAAQ,qBAAqB;YAC9DlB,aAAae,MAAMf,WAAW;QAChC;IACF;IACA,IAAIe,iBAAiBjC,wBAAwB;QAC3C,OAAON,4BAA4B0C,QAAQ,uBAAuB;YAChElB,aAAae,MAAMf,WAAW;QAChC;IACF;IACA,OAAO2B;AACT"}
@@ -5,6 +5,7 @@ import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto
5
5
  import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
6
6
  import type { RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
7
7
  import type { SecretsInterModuleClient } from '@shipfox/api-secrets-dto/inter-module';
8
+ import type { WorkspacesInterModuleClient } from '@shipfox/api-workspaces-dto/inter-module';
8
9
  import type { RouteGroup } from '@shipfox/node-fastify';
9
10
  type WorkflowRouteClients = {
10
11
  agent: AgentInterModuleClient;
@@ -14,8 +15,10 @@ type WorkflowRouteClients = {
14
15
  projects: ProjectsModuleClient;
15
16
  runners: RunnersInterModuleClient;
16
17
  secrets: SecretsInterModuleClient;
18
+ workspaces: WorkspacesInterModuleClient;
17
19
  };
18
- export declare function createLeaseTokenRouteGroup(params: WorkflowRouteClients): RouteGroup;
20
+ type LeaseTokenRouteClients = Omit<WorkflowRouteClients, 'workspaces'>;
21
+ export declare function createLeaseTokenRouteGroup(params: LeaseTokenRouteClients): RouteGroup;
19
22
  export declare function createWorkflowRoutes(params: WorkflowRouteClients): RouteGroup[];
20
23
  export {};
21
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAatD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;CACnC,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CAiBnF;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,EAAE,CAgB/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAatD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAClC,UAAU,EAAE,2BAA2B,CAAC;CACzC,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;AAEvE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG,UAAU,CAiBrF;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,EAAE,CAgB/E"}
@@ -39,7 +39,7 @@ export function createWorkflowRoutes(params) {
39
39
  listRunAttemptsRoute(params.projects),
40
40
  getRunRoute(params.projects),
41
41
  cancelRunRoute(params.projects),
42
- rerunRunRoute(params.projects)
42
+ rerunRunRoute(params.projects, params.workspaces)
43
43
  ]
44
44
  },
45
45
  createLeaseTokenRouteGroup(params)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport {AUTH_LEASED_JOB, AUTH_USER} from '@shipfox/api-auth-context';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {createAgentRuntimeConfigRoute} from './agent-runtime-config.js';\nimport {cancelRunRoute} from './cancel-run.js';\nimport {createCheckoutTokenRoute} from './checkout-token.js';\nimport {getRunRoute} from './get-run.js';\nimport {getRunAggregatesRoute} from './get-run-aggregates.js';\nimport {createGetStepSecretsRoute} from './get-step-secrets.js';\nimport {listRunAttemptsRoute} from './list-run-attempts.js';\nimport {listRunsRoute} from './list-runs.js';\nimport {createNextStepRoute} from './next-step.js';\nimport {createReportStepRoute} from './report-step.js';\nimport {rerunRunRoute} from './rerun-run.js';\n\ntype WorkflowRouteClients = {\n agent: AgentInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: SecretsInterModuleClient;\n};\n\nexport function createLeaseTokenRouteGroup(params: WorkflowRouteClients): RouteGroup {\n return {\n // The lease token names the job, so the path carries no job id (\"current\").\n prefix: '/runs/jobs/current',\n auth: AUTH_LEASED_JOB,\n routes: [\n createNextStepRoute(params),\n createReportStepRoute(params.runners),\n createCheckoutTokenRoute({\n integrations: params.integrations,\n projects: params.projects,\n runners: params.runners,\n }),\n createAgentRuntimeConfigRoute(params),\n createGetStepSecretsRoute(params.runners, params.secrets),\n ],\n };\n}\n\nexport function createWorkflowRoutes(params: WorkflowRouteClients): RouteGroup[] {\n return [\n {\n prefix: '/workflows/runs',\n auth: AUTH_USER,\n routes: [\n listRunsRoute(params.projects),\n getRunAggregatesRoute(params.projects),\n listRunAttemptsRoute(params.projects),\n getRunRoute(params.projects),\n cancelRunRoute(params.projects),\n rerunRunRoute(params.projects),\n ],\n },\n createLeaseTokenRouteGroup(params),\n ];\n}\n"],"names":["AUTH_LEASED_JOB","AUTH_USER","createAgentRuntimeConfigRoute","cancelRunRoute","createCheckoutTokenRoute","getRunRoute","getRunAggregatesRoute","createGetStepSecretsRoute","listRunAttemptsRoute","listRunsRoute","createNextStepRoute","createReportStepRoute","rerunRunRoute","createLeaseTokenRouteGroup","params","prefix","auth","routes","runners","integrations","projects","secrets","createWorkflowRoutes"],"mappings":"AAEA,SAAQA,eAAe,EAAEC,SAAS,QAAO,4BAA4B;AAOrE,SAAQC,6BAA6B,QAAO,4BAA4B;AACxE,SAAQC,cAAc,QAAO,kBAAkB;AAC/C,SAAQC,wBAAwB,QAAO,sBAAsB;AAC7D,SAAQC,WAAW,QAAO,eAAe;AACzC,SAAQC,qBAAqB,QAAO,0BAA0B;AAC9D,SAAQC,yBAAyB,QAAO,wBAAwB;AAChE,SAAQC,oBAAoB,QAAO,yBAAyB;AAC5D,SAAQC,aAAa,QAAO,iBAAiB;AAC7C,SAAQC,mBAAmB,QAAO,iBAAiB;AACnD,SAAQC,qBAAqB,QAAO,mBAAmB;AACvD,SAAQC,aAAa,QAAO,iBAAiB;AAY7C,OAAO,SAASC,2BAA2BC,MAA4B;IACrE,OAAO;QACL,4EAA4E;QAC5EC,QAAQ;QACRC,MAAMhB;QACNiB,QAAQ;YACNP,oBAAoBI;YACpBH,sBAAsBG,OAAOI,OAAO;YACpCd,yBAAyB;gBACvBe,cAAcL,OAAOK,YAAY;gBACjCC,UAAUN,OAAOM,QAAQ;gBACzBF,SAASJ,OAAOI,OAAO;YACzB;YACAhB,8BAA8BY;YAC9BP,0BAA0BO,OAAOI,OAAO,EAAEJ,OAAOO,OAAO;SACzD;IACH;AACF;AAEA,OAAO,SAASC,qBAAqBR,MAA4B;IAC/D,OAAO;QACL;YACEC,QAAQ;YACRC,MAAMf;YACNgB,QAAQ;gBACNR,cAAcK,OAAOM,QAAQ;gBAC7Bd,sBAAsBQ,OAAOM,QAAQ;gBACrCZ,qBAAqBM,OAAOM,QAAQ;gBACpCf,YAAYS,OAAOM,QAAQ;gBAC3BjB,eAAeW,OAAOM,QAAQ;gBAC9BR,cAAcE,OAAOM,QAAQ;aAC9B;QACH;QACAP,2BAA2BC;KAC5B;AACH"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport {AUTH_LEASED_JOB, AUTH_USER} from '@shipfox/api-auth-context';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport type {WorkspacesInterModuleClient} from '@shipfox/api-workspaces-dto/inter-module';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {createAgentRuntimeConfigRoute} from './agent-runtime-config.js';\nimport {cancelRunRoute} from './cancel-run.js';\nimport {createCheckoutTokenRoute} from './checkout-token.js';\nimport {getRunRoute} from './get-run.js';\nimport {getRunAggregatesRoute} from './get-run-aggregates.js';\nimport {createGetStepSecretsRoute} from './get-step-secrets.js';\nimport {listRunAttemptsRoute} from './list-run-attempts.js';\nimport {listRunsRoute} from './list-runs.js';\nimport {createNextStepRoute} from './next-step.js';\nimport {createReportStepRoute} from './report-step.js';\nimport {rerunRunRoute} from './rerun-run.js';\n\ntype WorkflowRouteClients = {\n agent: AgentInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: SecretsInterModuleClient;\n workspaces: WorkspacesInterModuleClient;\n};\n\ntype LeaseTokenRouteClients = Omit<WorkflowRouteClients, 'workspaces'>;\n\nexport function createLeaseTokenRouteGroup(params: LeaseTokenRouteClients): RouteGroup {\n return {\n // The lease token names the job, so the path carries no job id (\"current\").\n prefix: '/runs/jobs/current',\n auth: AUTH_LEASED_JOB,\n routes: [\n createNextStepRoute(params),\n createReportStepRoute(params.runners),\n createCheckoutTokenRoute({\n integrations: params.integrations,\n projects: params.projects,\n runners: params.runners,\n }),\n createAgentRuntimeConfigRoute(params),\n createGetStepSecretsRoute(params.runners, params.secrets),\n ],\n };\n}\n\nexport function createWorkflowRoutes(params: WorkflowRouteClients): RouteGroup[] {\n return [\n {\n prefix: '/workflows/runs',\n auth: AUTH_USER,\n routes: [\n listRunsRoute(params.projects),\n getRunAggregatesRoute(params.projects),\n listRunAttemptsRoute(params.projects),\n getRunRoute(params.projects),\n cancelRunRoute(params.projects),\n rerunRunRoute(params.projects, params.workspaces),\n ],\n },\n createLeaseTokenRouteGroup(params),\n ];\n}\n"],"names":["AUTH_LEASED_JOB","AUTH_USER","createAgentRuntimeConfigRoute","cancelRunRoute","createCheckoutTokenRoute","getRunRoute","getRunAggregatesRoute","createGetStepSecretsRoute","listRunAttemptsRoute","listRunsRoute","createNextStepRoute","createReportStepRoute","rerunRunRoute","createLeaseTokenRouteGroup","params","prefix","auth","routes","runners","integrations","projects","secrets","createWorkflowRoutes","workspaces"],"mappings":"AAEA,SAAQA,eAAe,EAAEC,SAAS,QAAO,4BAA4B;AAQrE,SAAQC,6BAA6B,QAAO,4BAA4B;AACxE,SAAQC,cAAc,QAAO,kBAAkB;AAC/C,SAAQC,wBAAwB,QAAO,sBAAsB;AAC7D,SAAQC,WAAW,QAAO,eAAe;AACzC,SAAQC,qBAAqB,QAAO,0BAA0B;AAC9D,SAAQC,yBAAyB,QAAO,wBAAwB;AAChE,SAAQC,oBAAoB,QAAO,yBAAyB;AAC5D,SAAQC,aAAa,QAAO,iBAAiB;AAC7C,SAAQC,mBAAmB,QAAO,iBAAiB;AACnD,SAAQC,qBAAqB,QAAO,mBAAmB;AACvD,SAAQC,aAAa,QAAO,iBAAiB;AAe7C,OAAO,SAASC,2BAA2BC,MAA8B;IACvE,OAAO;QACL,4EAA4E;QAC5EC,QAAQ;QACRC,MAAMhB;QACNiB,QAAQ;YACNP,oBAAoBI;YACpBH,sBAAsBG,OAAOI,OAAO;YACpCd,yBAAyB;gBACvBe,cAAcL,OAAOK,YAAY;gBACjCC,UAAUN,OAAOM,QAAQ;gBACzBF,SAASJ,OAAOI,OAAO;YACzB;YACAhB,8BAA8BY;YAC9BP,0BAA0BO,OAAOI,OAAO,EAAEJ,OAAOO,OAAO;SACzD;IACH;AACF;AAEA,OAAO,SAASC,qBAAqBR,MAA4B;IAC/D,OAAO;QACL;YACEC,QAAQ;YACRC,MAAMf;YACNgB,QAAQ;gBACNR,cAAcK,OAAOM,QAAQ;gBAC7Bd,sBAAsBQ,OAAOM,QAAQ;gBACrCZ,qBAAqBM,OAAOM,QAAQ;gBACpCf,YAAYS,OAAOM,QAAQ;gBAC3BjB,eAAeW,OAAOM,QAAQ;gBAC9BR,cAAcE,OAAOM,QAAQ,EAAEN,OAAOS,UAAU;aACjD;QACH;QACAV,2BAA2BC;KAC5B;AACH"}
@@ -1,3 +1,4 @@
1
1
  import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
- export declare function rerunRunRoute(projects: ProjectsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
2
+ import type { WorkspacesInterModuleClient } from '@shipfox/api-workspaces-dto/inter-module';
3
+ export declare function rerunRunRoute(projects: ProjectsModuleClient, workspaces: WorkspacesInterModuleClient): import("@shipfox/node-fastify").RouteDefinition;
3
4
  //# sourceMappingURL=rerun-run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rerun-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/rerun-run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AASjF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,oBAAoB,mDAwC3D"}
1
+ {"version":3,"file":"rerun-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/rerun-run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAEjF,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAC;AAgB1F,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,oBAAoB,EAC9B,UAAU,EAAE,2BAA2B,mDA6DxC"}