@shipfox/api-workflows-dto 12.0.0 → 12.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"working-directory.d.ts","sourceRoot":"","sources":["../src/working-directory.ts"],"names":[],"mappings":"AAGA,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,KAAK,EAAE,OAAO;CAM3B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAW9E"}
1
+ {"version":3,"file":"working-directory.d.ts","sourceRoot":"","sources":["../src/working-directory.ts"],"names":[],"mappings":"AAGA,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,YAAY,KAAK,EAAE,OAAO,EAKzB;CACF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAW9E"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/api-workflows-dto",
3
3
  "license": "MIT",
4
- "version": "12.0.0",
4
+ "version": "12.2.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "zod": "^4.4.3",
26
- "@shipfox/api-agent-dto": "12.0.0",
26
+ "@shipfox/api-agent-dto": "12.2.0",
27
27
  "@shipfox/inter-module": "0.2.3"
28
28
  },
29
29
  "imports": {
@@ -226,6 +226,7 @@ describe('workflowsJobActivatedSchema', () => {
226
226
  event: 'pull_request_review',
227
227
  filter: 'jobs.build.outputs.pr_number == event.pull_request.number',
228
228
  filter_snapshot: {jobs: {build: {outputs: {pr_number: 42}}}},
229
+ filter_output_types: {build: {pr_number: 'int'}},
229
230
  },
230
231
  ],
231
232
  until: [
@@ -234,6 +235,7 @@ describe('workflowsJobActivatedSchema', () => {
234
235
  event: 'pull_request',
235
236
  filter: 'jobs.build.outputs.pr_number == event.pull_request.number',
236
237
  filter_snapshot: {jobs: {build: {outputs: {pr_number: 42}}}},
238
+ filter_output_types: {build: {pr_number: 'int'}},
237
239
  },
238
240
  ],
239
241
  };
package/src/events.ts CHANGED
@@ -80,8 +80,39 @@ const workflowsJobActivatedBaseSchema = z.object({
80
80
  workspaceId: nonEmptyStringSchema,
81
81
  });
82
82
 
83
+ // Keep this passive DTO schema local so the transport package does not depend on expression runtime code.
84
+ export type ListenerFilterExpressionType =
85
+ | 'string'
86
+ | 'int'
87
+ | 'double'
88
+ | 'bool'
89
+ | 'null'
90
+ | 'timestamp'
91
+ | {kind: 'object'; fields: Record<string, ListenerFilterExpressionType>}
92
+ | {kind: 'map'}
93
+ | {kind: 'list'; element: ListenerFilterExpressionType};
94
+
95
+ const listenerFilterExpressionTypeSchema: z.ZodType<ListenerFilterExpressionType> = z.lazy(() =>
96
+ z.union([
97
+ z.enum(['string', 'int', 'double', 'bool', 'null', 'timestamp']),
98
+ z.object({
99
+ kind: z.literal('object'),
100
+ fields: z.record(z.string(), listenerFilterExpressionTypeSchema),
101
+ }),
102
+ z.object({kind: z.literal('map')}),
103
+ z.object({kind: z.literal('list'), element: listenerFilterExpressionTypeSchema}),
104
+ ]),
105
+ );
106
+
107
+ export const listenerFilterOutputTypesSchema = z.record(
108
+ z.string(),
109
+ z.record(z.string(), listenerFilterExpressionTypeSchema),
110
+ );
111
+ export type ListenerFilterOutputTypes = z.infer<typeof listenerFilterOutputTypesSchema>;
112
+
83
113
  const resolvedListeningTriggerSchema = listeningTriggerSchema.extend({
84
114
  filter_snapshot: z.record(z.string(), z.unknown()).optional(),
115
+ filter_output_types: listenerFilterOutputTypesSchema.optional(),
85
116
  });
86
117
 
87
118
  export const workflowsJobActivatedSchema = z.discriminatedUnion('mode', [
package/src/index.ts CHANGED
@@ -108,6 +108,9 @@ export {
108
108
  } from '#schemas/workflow-run.js';
109
109
  export {
110
110
  jobTerminalStatusSchema,
111
+ type ListenerFilterExpressionType,
112
+ type ListenerFilterOutputTypes,
113
+ listenerFilterOutputTypesSchema,
111
114
  terminalStatusSchema,
112
115
  WORKFLOWS_JOB_ACTIVATED,
113
116
  WORKFLOWS_JOB_EVENT_DELIVERED,
@@ -61,6 +61,18 @@ describe('stepErrorDtoSchema', () => {
61
61
  });
62
62
  });
63
63
 
64
+ it.each([
65
+ 'checkout_path_invalid',
66
+ 'checkout_destination_occupied',
67
+ ] as const)('accepts the runner checkout destination reason %s', (reason) => {
68
+ const result = stepErrorDtoSchema.parse({
69
+ message: 'Checkout destination policy rejected the step.',
70
+ reason,
71
+ });
72
+
73
+ expect(result?.reason).toBe(reason);
74
+ });
75
+
64
76
  it('rejects unknown agent config issues', () => {
65
77
  const result = stepErrorDtoSchema.safeParse({
66
78
  message: 'Model provider credentials are not configured',
@@ -2,7 +2,7 @@ import {z} from 'zod';
2
2
 
3
3
  // Machine-readable cause of a step failure, for DB troubleshooting. The runner
4
4
  // reports it and the server stores it as-is. The `checkout_*`, `git_unavailable`,
5
- // `workspace_prep_failed`, and `setup_aborted` values cover setup-phase failures.
5
+ // `workspace_prep_failed`, and `setup_aborted` values cover checkout/setup failures.
6
6
  // For agent steps the cause is split three ways: `agent_config_invalid` is a user-fixable
7
7
  // configuration error and carries an `agent_config_issue`; `agent_invocation_failed`
8
8
  // covers a provider/API failure once the configuration is valid; and
@@ -13,6 +13,8 @@ export const stepErrorReasonSchema = z.enum([
13
13
  'checkout_failed',
14
14
  'checkout_auth_failed',
15
15
  'checkout_unavailable',
16
+ 'checkout_path_invalid',
17
+ 'checkout_destination_occupied',
16
18
  'git_unavailable',
17
19
  'workspace_prep_failed',
18
20
  'setup_aborted',