@shipfox/api-workflows-dto 12.1.0 → 12.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 (53) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/dist/events.d.ts +64 -33
  4. package/dist/events.d.ts.map +1 -1
  5. package/dist/events.js +31 -1
  6. package/dist/events.js.map +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/inter-module.d.ts +50 -50
  12. package/dist/inter-module.d.ts.map +1 -1
  13. package/dist/schemas/evaluation-trace.d.ts +36 -0
  14. package/dist/schemas/evaluation-trace.d.ts.map +1 -0
  15. package/dist/schemas/evaluation-trace.js +25 -0
  16. package/dist/schemas/evaluation-trace.js.map +1 -0
  17. package/dist/schemas/index.d.ts +3 -2
  18. package/dist/schemas/index.d.ts.map +1 -1
  19. package/dist/schemas/index.js +3 -2
  20. package/dist/schemas/index.js.map +1 -1
  21. package/dist/schemas/job-execution.d.ts +48 -27
  22. package/dist/schemas/job-execution.d.ts.map +1 -1
  23. package/dist/schemas/job-listening.d.ts +6 -6
  24. package/dist/schemas/job.d.ts +40 -22
  25. package/dist/schemas/job.d.ts.map +1 -1
  26. package/dist/schemas/job.js +4 -0
  27. package/dist/schemas/job.js.map +1 -1
  28. package/dist/schemas/log-outcome.d.ts +1 -1
  29. package/dist/schemas/step.d.ts +125 -36
  30. package/dist/schemas/step.d.ts.map +1 -1
  31. package/dist/schemas/step.js +13 -0
  32. package/dist/schemas/step.js.map +1 -1
  33. package/dist/schemas/workflow-run-detail.d.ts +295 -84
  34. package/dist/schemas/workflow-run-detail.d.ts.map +1 -1
  35. package/dist/schemas/workflow-run-detail.js +11 -1
  36. package/dist/schemas/workflow-run-detail.js.map +1 -1
  37. package/dist/schemas/workflow-run.d.ts +27 -27
  38. package/dist/tsconfig.test.tsbuildinfo +1 -1
  39. package/dist/working-directory.d.ts.map +1 -1
  40. package/package.json +2 -2
  41. package/src/events.test.ts +3 -0
  42. package/src/events.ts +38 -0
  43. package/src/index.ts +14 -0
  44. package/src/schemas/evaluation-trace.test.ts +40 -0
  45. package/src/schemas/evaluation-trace.ts +30 -0
  46. package/src/schemas/index.ts +13 -0
  47. package/src/schemas/job.test.ts +3 -0
  48. package/src/schemas/job.ts +4 -0
  49. package/src/schemas/step-source-location.test.ts +2 -0
  50. package/src/schemas/step.test.ts +17 -1
  51. package/src/schemas/step.ts +20 -0
  52. package/src/schemas/workflow-run-detail.ts +14 -1
  53. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1,24 +1,24 @@
1
1
  import { z } from 'zod';
2
2
  export declare const jobStatusSchema: z.ZodEnum<{
3
3
  cancelled: "cancelled";
4
+ failed: "failed";
4
5
  pending: "pending";
5
6
  running: "running";
6
- succeeded: "succeeded";
7
- failed: "failed";
8
7
  skipped: "skipped";
8
+ succeeded: "succeeded";
9
9
  }>;
10
10
  export declare const jobStatusReasonSchema: z.ZodEnum<{
11
- unknown: "unknown";
12
- dependency_not_completed: "dependency_not_completed";
11
+ condition_errored: "condition_errored";
13
12
  condition_false: "condition_false";
14
- default_gate_rejected: "default_gate_rejected";
15
13
  condition_rejected: "condition_rejected";
16
- condition_errored: "condition_errored";
17
- user_cancelled: "user_cancelled";
14
+ default_gate_rejected: "default_gate_rejected";
15
+ dependency_not_completed: "dependency_not_completed";
18
16
  run_cancelled: "run_cancelled";
19
- timed_out: "timed_out";
20
17
  runner_lost: "runner_lost";
21
18
  step_failed: "step_failed";
19
+ timed_out: "timed_out";
20
+ unknown: "unknown";
21
+ user_cancelled: "user_cancelled";
22
22
  }>;
23
23
  export declare const jobDtoSchema: z.ZodObject<{
24
24
  id: z.ZodString;
@@ -26,31 +26,49 @@ export declare const jobDtoSchema: z.ZodObject<{
26
26
  key: z.ZodString;
27
27
  name: z.ZodNullable<z.ZodString>;
28
28
  mode: z.ZodEnum<{
29
- one_shot: "one_shot";
30
29
  listening: "listening";
30
+ one_shot: "one_shot";
31
31
  }>;
32
32
  status: z.ZodEnum<{
33
33
  cancelled: "cancelled";
34
+ failed: "failed";
34
35
  pending: "pending";
35
36
  running: "running";
36
- succeeded: "succeeded";
37
- failed: "failed";
38
37
  skipped: "skipped";
38
+ succeeded: "succeeded";
39
39
  }>;
40
40
  status_reason: z.ZodNullable<z.ZodEnum<{
41
- unknown: "unknown";
42
- dependency_not_completed: "dependency_not_completed";
41
+ condition_errored: "condition_errored";
43
42
  condition_false: "condition_false";
44
- default_gate_rejected: "default_gate_rejected";
45
43
  condition_rejected: "condition_rejected";
46
- condition_errored: "condition_errored";
47
- user_cancelled: "user_cancelled";
44
+ default_gate_rejected: "default_gate_rejected";
45
+ dependency_not_completed: "dependency_not_completed";
48
46
  run_cancelled: "run_cancelled";
49
- timed_out: "timed_out";
50
47
  runner_lost: "runner_lost";
51
48
  step_failed: "step_failed";
49
+ timed_out: "timed_out";
50
+ unknown: "unknown";
51
+ user_cancelled: "user_cancelled";
52
52
  }>>;
53
53
  carried_over: z.ZodBoolean;
54
+ success: z.ZodNullable<z.ZodString>;
55
+ runner: z.ZodNullable<z.ZodArray<z.ZodString>>;
56
+ evaluation_trace: z.ZodNullable<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
57
+ expression: z.ZodString;
58
+ roots: z.ZodArray<z.ZodString>;
59
+ fill_target: z.ZodString;
60
+ evaluated_at: z.ZodString;
61
+ field: z.ZodString;
62
+ value: z.ZodOptional<z.ZodString>;
63
+ truncated: z.ZodOptional<z.ZodBoolean>;
64
+ expr_truncated: z.ZodOptional<z.ZodBoolean>;
65
+ reference: z.ZodOptional<z.ZodBoolean>;
66
+ degraded: z.ZodOptional<z.ZodBoolean>;
67
+ env_key: z.ZodOptional<z.ZodString>;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ truncated: z.ZodLiteral<true>;
70
+ dropped: z.ZodNumber;
71
+ }, z.core.$strip>]>>>;
54
72
  listening: z.ZodNullable<z.ZodObject<{
55
73
  on: z.ZodArray<z.ZodObject<{
56
74
  source: z.ZodString;
@@ -72,22 +90,22 @@ export declare const jobDtoSchema: z.ZodObject<{
72
90
  max_wait_ms: z.ZodOptional<z.ZodNumber>;
73
91
  }, z.core.$strip>>;
74
92
  on_resolve: z.ZodEnum<{
75
- finish: "finish";
76
93
  cancel: "cancel";
94
+ finish: "finish";
77
95
  }>;
78
96
  execution_timeout_ms: z.ZodNullable<z.ZodNumber>;
79
97
  name: z.ZodNullable<z.ZodString>;
80
98
  }, z.core.$strip>>;
81
99
  listener_status: z.ZodEnum<{
82
- listening: "listening";
83
100
  inactive: "inactive";
101
+ listening: "listening";
84
102
  resolved: "resolved";
85
103
  }>;
86
104
  resolution_reason: z.ZodNullable<z.ZodEnum<{
87
- until: "until";
88
- timeout: "timeout";
89
- max_executions: "max_executions";
90
105
  cancelled: "cancelled";
106
+ max_executions: "max_executions";
107
+ timeout: "timeout";
108
+ until: "until";
91
109
  }>>;
92
110
  outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
93
111
  dependencies: z.ZodArray<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/schemas/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAQtB,eAAO,MAAM,eAAe;;;;;;;EAO1B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAYhC,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC3D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/schemas/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAStB,eAAO,MAAM,eAAe;;;;;;;EAO1B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAYhC,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC3D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { evaluationTraceSchema } from './evaluation-trace.js';
2
3
  import { jobListeningSchema, jobModeSchema, listenerStatusSchema, resolutionReasonSchema } from './job-listening.js';
3
4
  export const jobStatusSchema = z.enum([
4
5
  'pending',
@@ -30,6 +31,9 @@ export const jobDtoSchema = z.object({
30
31
  status: jobStatusSchema,
31
32
  status_reason: jobStatusReasonSchema.nullable(),
32
33
  carried_over: z.boolean(),
34
+ success: z.string().nullable(),
35
+ runner: z.array(z.string()).nullable(),
36
+ evaluation_trace: evaluationTraceSchema.nullable(),
33
37
  listening: jobListeningSchema.nullable(),
34
38
  listener_status: listenerStatusSchema,
35
39
  resolution_reason: resolutionReasonSchema.nullable(),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/job.ts"],"sourcesContent":["import {z} from 'zod';\nimport {\n jobListeningSchema,\n jobModeSchema,\n listenerStatusSchema,\n resolutionReasonSchema,\n} from './job-listening.js';\n\nexport const jobStatusSchema = z.enum([\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n 'skipped',\n]);\n\nexport const jobStatusReasonSchema = z.enum([\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 'step_failed',\n 'unknown',\n]);\n\nexport const jobDtoSchema = z.object({\n id: z.string().uuid(),\n run_attempt_id: z.string().uuid(),\n key: z.string(),\n name: z.string().nullable(),\n mode: jobModeSchema,\n status: jobStatusSchema,\n status_reason: jobStatusReasonSchema.nullable(),\n carried_over: z.boolean(),\n listening: jobListeningSchema.nullable(),\n listener_status: listenerStatusSchema,\n resolution_reason: resolutionReasonSchema.nullable(),\n outputs: z.record(z.string(), z.unknown()).nullable(),\n dependencies: z.array(z.string()),\n position: z.number(),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport type JobDto = z.infer<typeof jobDtoSchema>;\nexport type JobStatusDto = z.infer<typeof jobStatusSchema>;\nexport type JobStatusReasonDto = z.infer<typeof jobStatusReasonSchema>;\n"],"names":["z","jobListeningSchema","jobModeSchema","listenerStatusSchema","resolutionReasonSchema","jobStatusSchema","enum","jobStatusReasonSchema","jobDtoSchema","object","id","string","uuid","run_attempt_id","key","name","nullable","mode","status","status_reason","carried_over","boolean","listening","listener_status","resolution_reason","outputs","record","unknown","dependencies","array","position","number","created_at","updated_at"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SACEC,kBAAkB,EAClBC,aAAa,EACbC,oBAAoB,EACpBC,sBAAsB,QACjB,qBAAqB;AAE5B,OAAO,MAAMC,kBAAkBL,EAAEM,IAAI,CAAC;IACpC;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AAEH,OAAO,MAAMC,wBAAwBP,EAAEM,IAAI,CAAC;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AAEH,OAAO,MAAME,eAAeR,EAAES,MAAM,CAAC;IACnCC,IAAIV,EAAEW,MAAM,GAAGC,IAAI;IACnBC,gBAAgBb,EAAEW,MAAM,GAAGC,IAAI;IAC/BE,KAAKd,EAAEW,MAAM;IACbI,MAAMf,EAAEW,MAAM,GAAGK,QAAQ;IACzBC,MAAMf;IACNgB,QAAQb;IACRc,eAAeZ,sBAAsBS,QAAQ;IAC7CI,cAAcpB,EAAEqB,OAAO;IACvBC,WAAWrB,mBAAmBe,QAAQ;IACtCO,iBAAiBpB;IACjBqB,mBAAmBpB,uBAAuBY,QAAQ;IAClDS,SAASzB,EAAE0B,MAAM,CAAC1B,EAAEW,MAAM,IAAIX,EAAE2B,OAAO,IAAIX,QAAQ;IACnDY,cAAc5B,EAAE6B,KAAK,CAAC7B,EAAEW,MAAM;IAC9BmB,UAAU9B,EAAE+B,MAAM;IAClBC,YAAYhC,EAAEW,MAAM;IACpBsB,YAAYjC,EAAEW,MAAM;AACtB,GAAG"}
1
+ {"version":3,"sources":["../../src/schemas/job.ts"],"sourcesContent":["import {z} from 'zod';\nimport {evaluationTraceSchema} from './evaluation-trace.js';\nimport {\n jobListeningSchema,\n jobModeSchema,\n listenerStatusSchema,\n resolutionReasonSchema,\n} from './job-listening.js';\n\nexport const jobStatusSchema = z.enum([\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n 'skipped',\n]);\n\nexport const jobStatusReasonSchema = z.enum([\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 'step_failed',\n 'unknown',\n]);\n\nexport const jobDtoSchema = z.object({\n id: z.string().uuid(),\n run_attempt_id: z.string().uuid(),\n key: z.string(),\n name: z.string().nullable(),\n mode: jobModeSchema,\n status: jobStatusSchema,\n status_reason: jobStatusReasonSchema.nullable(),\n carried_over: z.boolean(),\n success: z.string().nullable(),\n runner: z.array(z.string()).nullable(),\n evaluation_trace: evaluationTraceSchema.nullable(),\n listening: jobListeningSchema.nullable(),\n listener_status: listenerStatusSchema,\n resolution_reason: resolutionReasonSchema.nullable(),\n outputs: z.record(z.string(), z.unknown()).nullable(),\n dependencies: z.array(z.string()),\n position: z.number(),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport type JobDto = z.infer<typeof jobDtoSchema>;\nexport type JobStatusDto = z.infer<typeof jobStatusSchema>;\nexport type JobStatusReasonDto = z.infer<typeof jobStatusReasonSchema>;\n"],"names":["z","evaluationTraceSchema","jobListeningSchema","jobModeSchema","listenerStatusSchema","resolutionReasonSchema","jobStatusSchema","enum","jobStatusReasonSchema","jobDtoSchema","object","id","string","uuid","run_attempt_id","key","name","nullable","mode","status","status_reason","carried_over","boolean","success","runner","array","evaluation_trace","listening","listener_status","resolution_reason","outputs","record","unknown","dependencies","position","number","created_at","updated_at"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,qBAAqB,QAAO,wBAAwB;AAC5D,SACEC,kBAAkB,EAClBC,aAAa,EACbC,oBAAoB,EACpBC,sBAAsB,QACjB,qBAAqB;AAE5B,OAAO,MAAMC,kBAAkBN,EAAEO,IAAI,CAAC;IACpC;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AAEH,OAAO,MAAMC,wBAAwBR,EAAEO,IAAI,CAAC;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AAEH,OAAO,MAAME,eAAeT,EAAEU,MAAM,CAAC;IACnCC,IAAIX,EAAEY,MAAM,GAAGC,IAAI;IACnBC,gBAAgBd,EAAEY,MAAM,GAAGC,IAAI;IAC/BE,KAAKf,EAAEY,MAAM;IACbI,MAAMhB,EAAEY,MAAM,GAAGK,QAAQ;IACzBC,MAAMf;IACNgB,QAAQb;IACRc,eAAeZ,sBAAsBS,QAAQ;IAC7CI,cAAcrB,EAAEsB,OAAO;IACvBC,SAASvB,EAAEY,MAAM,GAAGK,QAAQ;IAC5BO,QAAQxB,EAAEyB,KAAK,CAACzB,EAAEY,MAAM,IAAIK,QAAQ;IACpCS,kBAAkBzB,sBAAsBgB,QAAQ;IAChDU,WAAWzB,mBAAmBe,QAAQ;IACtCW,iBAAiBxB;IACjByB,mBAAmBxB,uBAAuBY,QAAQ;IAClDa,SAAS9B,EAAE+B,MAAM,CAAC/B,EAAEY,MAAM,IAAIZ,EAAEgC,OAAO,IAAIf,QAAQ;IACnDgB,cAAcjC,EAAEyB,KAAK,CAACzB,EAAEY,MAAM;IAC9BsB,UAAUlC,EAAEmC,MAAM;IAClBC,YAAYpC,EAAEY,MAAM;IACpByB,YAAYrC,EAAEY,MAAM;AACtB,GAAG"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const logOutcomeSchema: z.ZodEnum<{
3
- drained: "drained";
4
3
  abandoned: "abandoned";
4
+ drained: "drained";
5
5
  }>;
6
6
  export type LogOutcomeDto = z.infer<typeof logOutcomeSchema>;
7
7
  //# sourceMappingURL=log-outcome.d.ts.map
@@ -1,26 +1,33 @@
1
1
  import { z } from 'zod';
2
+ export declare const STEP_STATUS_REASONS: readonly ['default_gate_rejected', 'condition_rejected', 'condition_errored'];
3
+ export declare const stepStatusReasonSchema: z.ZodEnum<{
4
+ condition_errored: "condition_errored";
5
+ condition_rejected: "condition_rejected";
6
+ default_gate_rejected: "default_gate_rejected";
7
+ }>;
8
+ export type StepStatusReasonDto = z.infer<typeof stepStatusReasonSchema>;
2
9
  export declare const stepErrorReasonSchema: z.ZodEnum<{
3
- checkout_failed: "checkout_failed";
10
+ agent_config_invalid: "agent_config_invalid";
11
+ agent_harness_unavailable: "agent_harness_unavailable";
12
+ agent_invocation_failed: "agent_invocation_failed";
4
13
  checkout_auth_failed: "checkout_auth_failed";
5
- checkout_unavailable: "checkout_unavailable";
6
- checkout_path_invalid: "checkout_path_invalid";
7
14
  checkout_destination_occupied: "checkout_destination_occupied";
8
- git_unavailable: "git_unavailable";
9
- workspace_prep_failed: "workspace_prep_failed";
10
- setup_aborted: "setup_aborted";
15
+ checkout_failed: "checkout_failed";
16
+ checkout_path_invalid: "checkout_path_invalid";
17
+ checkout_unavailable: "checkout_unavailable";
11
18
  config_unresolvable: "config_unresolvable";
19
+ git_unavailable: "git_unavailable";
12
20
  output_invalid: "output_invalid";
13
- agent_config_invalid: "agent_config_invalid";
14
- agent_invocation_failed: "agent_invocation_failed";
15
- agent_harness_unavailable: "agent_harness_unavailable";
21
+ setup_aborted: "setup_aborted";
22
+ workspace_prep_failed: "workspace_prep_failed";
16
23
  }>;
17
24
  export type StepErrorReasonDto = z.infer<typeof stepErrorReasonSchema>;
18
25
  export declare const agentConfigIssueSchema: z.ZodEnum<{
19
- step_config_invalid: "step_config_invalid";
26
+ credentials_invalid: "credentials_invalid";
27
+ model_unavailable: "model_unavailable";
20
28
  provider_not_configured: "provider_not_configured";
21
29
  provider_unsupported: "provider_unsupported";
22
- model_unavailable: "model_unavailable";
23
- credentials_invalid: "credentials_invalid";
30
+ step_config_invalid: "step_config_invalid";
24
31
  }>;
25
32
  export type AgentConfigIssueDto = z.infer<typeof agentConfigIssueSchema>;
26
33
  export declare const stepErrorCategorySchema: z.ZodEnum<{
@@ -34,28 +41,28 @@ export declare const stepErrorDtoSchema: z.ZodNullable<z.ZodObject<{
34
41
  exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
35
42
  signal: z.ZodOptional<z.ZodString>;
36
43
  reason: z.ZodOptional<z.ZodEnum<{
37
- checkout_failed: "checkout_failed";
44
+ agent_config_invalid: "agent_config_invalid";
45
+ agent_harness_unavailable: "agent_harness_unavailable";
46
+ agent_invocation_failed: "agent_invocation_failed";
38
47
  checkout_auth_failed: "checkout_auth_failed";
39
- checkout_unavailable: "checkout_unavailable";
40
- checkout_path_invalid: "checkout_path_invalid";
41
48
  checkout_destination_occupied: "checkout_destination_occupied";
42
- git_unavailable: "git_unavailable";
43
- workspace_prep_failed: "workspace_prep_failed";
44
- setup_aborted: "setup_aborted";
49
+ checkout_failed: "checkout_failed";
50
+ checkout_path_invalid: "checkout_path_invalid";
51
+ checkout_unavailable: "checkout_unavailable";
45
52
  config_unresolvable: "config_unresolvable";
53
+ git_unavailable: "git_unavailable";
46
54
  output_invalid: "output_invalid";
47
- agent_config_invalid: "agent_config_invalid";
48
- agent_invocation_failed: "agent_invocation_failed";
49
- agent_harness_unavailable: "agent_harness_unavailable";
55
+ setup_aborted: "setup_aborted";
56
+ workspace_prep_failed: "workspace_prep_failed";
50
57
  }>>;
51
58
  field: z.ZodOptional<z.ZodString>;
52
59
  source: z.ZodOptional<z.ZodString>;
53
60
  agent_config_issue: z.ZodOptional<z.ZodEnum<{
54
- step_config_invalid: "step_config_invalid";
61
+ credentials_invalid: "credentials_invalid";
62
+ model_unavailable: "model_unavailable";
55
63
  provider_not_configured: "provider_not_configured";
56
64
  provider_unsupported: "provider_unsupported";
57
- model_unavailable: "model_unavailable";
58
- credentials_invalid: "credentials_invalid";
65
+ step_config_invalid: "step_config_invalid";
59
66
  }>>;
60
67
  category: z.ZodOptional<z.ZodEnum<{
61
68
  setup: "setup";
@@ -78,35 +85,56 @@ export declare const stepDtoSchema: z.ZodObject<{
78
85
  end_line: z.ZodNumber;
79
86
  }, z.core.$strip>>;
80
87
  status: z.ZodString;
88
+ status_reason: z.ZodNullable<z.ZodEnum<{
89
+ condition_errored: "condition_errored";
90
+ condition_rejected: "condition_rejected";
91
+ default_gate_rejected: "default_gate_rejected";
92
+ }>>;
81
93
  type: z.ZodString;
82
94
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
95
+ evaluation_trace: z.ZodNullable<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
96
+ expression: z.ZodString;
97
+ roots: z.ZodArray<z.ZodString>;
98
+ fill_target: z.ZodString;
99
+ evaluated_at: z.ZodString;
100
+ field: z.ZodString;
101
+ value: z.ZodOptional<z.ZodString>;
102
+ truncated: z.ZodOptional<z.ZodBoolean>;
103
+ expr_truncated: z.ZodOptional<z.ZodBoolean>;
104
+ reference: z.ZodOptional<z.ZodBoolean>;
105
+ degraded: z.ZodOptional<z.ZodBoolean>;
106
+ env_key: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ truncated: z.ZodLiteral<true>;
109
+ dropped: z.ZodNumber;
110
+ }, z.core.$strip>]>>>;
83
111
  error: z.ZodNullable<z.ZodObject<{
84
112
  message: z.ZodString;
85
113
  exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
86
114
  signal: z.ZodOptional<z.ZodString>;
87
115
  reason: z.ZodOptional<z.ZodEnum<{
88
- checkout_failed: "checkout_failed";
116
+ agent_config_invalid: "agent_config_invalid";
117
+ agent_harness_unavailable: "agent_harness_unavailable";
118
+ agent_invocation_failed: "agent_invocation_failed";
89
119
  checkout_auth_failed: "checkout_auth_failed";
90
- checkout_unavailable: "checkout_unavailable";
91
- checkout_path_invalid: "checkout_path_invalid";
92
120
  checkout_destination_occupied: "checkout_destination_occupied";
93
- git_unavailable: "git_unavailable";
94
- workspace_prep_failed: "workspace_prep_failed";
95
- setup_aborted: "setup_aborted";
121
+ checkout_failed: "checkout_failed";
122
+ checkout_path_invalid: "checkout_path_invalid";
123
+ checkout_unavailable: "checkout_unavailable";
96
124
  config_unresolvable: "config_unresolvable";
125
+ git_unavailable: "git_unavailable";
97
126
  output_invalid: "output_invalid";
98
- agent_config_invalid: "agent_config_invalid";
99
- agent_invocation_failed: "agent_invocation_failed";
100
- agent_harness_unavailable: "agent_harness_unavailable";
127
+ setup_aborted: "setup_aborted";
128
+ workspace_prep_failed: "workspace_prep_failed";
101
129
  }>>;
102
130
  field: z.ZodOptional<z.ZodString>;
103
131
  source: z.ZodOptional<z.ZodString>;
104
132
  agent_config_issue: z.ZodOptional<z.ZodEnum<{
105
- step_config_invalid: "step_config_invalid";
133
+ credentials_invalid: "credentials_invalid";
134
+ model_unavailable: "model_unavailable";
106
135
  provider_not_configured: "provider_not_configured";
107
136
  provider_unsupported: "provider_unsupported";
108
- model_unavailable: "model_unavailable";
109
- credentials_invalid: "credentials_invalid";
137
+ step_config_invalid: "step_config_invalid";
110
138
  }>>;
111
139
  category: z.ZodOptional<z.ZodEnum<{
112
140
  setup: "setup";
@@ -192,4 +220,65 @@ export declare const stepAttemptDtoSchema: z.ZodObject<{
192
220
  finished_at: z.ZodNullable<z.ZodString>;
193
221
  }, z.core.$strip>;
194
222
  export type StepAttemptDto = z.infer<typeof stepAttemptDtoSchema>;
223
+ export declare const stepAttemptDetailDtoSchema: z.ZodObject<{
224
+ id: z.ZodString;
225
+ step_id: z.ZodString;
226
+ attempt: z.ZodNumber;
227
+ execution_order: z.ZodNumber;
228
+ status: z.ZodString;
229
+ exit_code: z.ZodNullable<z.ZodNumber>;
230
+ output: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
231
+ outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
232
+ response: z.ZodNullable<z.ZodString>;
233
+ error: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
234
+ gate_result: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
235
+ kind: z.ZodLiteral<"none">;
236
+ }, z.core.$strip>, z.ZodObject<{
237
+ kind: z.ZodLiteral<"not_evaluated">;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ kind: z.ZodLiteral<"passed">;
240
+ passed: z.ZodLiteral<true>;
241
+ source: z.ZodString;
242
+ exit_code: z.ZodNullable<z.ZodNumber>;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ kind: z.ZodLiteral<"failed">;
245
+ passed: z.ZodLiteral<false>;
246
+ source: z.ZodString;
247
+ exit_code: z.ZodNullable<z.ZodNumber>;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ kind: z.ZodLiteral<"uncheckable">;
250
+ passed: z.ZodLiteral<false>;
251
+ uncheckable: z.ZodLiteral<true>;
252
+ reason: z.ZodString;
253
+ exit_code: z.ZodNullable<z.ZodNumber>;
254
+ }, z.core.$strip>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"evaluation_error">;
256
+ reason: z.ZodString;
257
+ exit_code: z.ZodNullable<z.ZodNumber>;
258
+ }, z.core.$strip>, z.ZodObject<{
259
+ kind: z.ZodLiteral<"unknown">;
260
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
261
+ }, z.core.$strip>], "kind">>;
262
+ restart_feedback: z.ZodNullable<z.ZodString>;
263
+ started_at: z.ZodString;
264
+ finished_at: z.ZodNullable<z.ZodString>;
265
+ config: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
266
+ evaluation_trace: z.ZodNullable<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
267
+ expression: z.ZodString;
268
+ roots: z.ZodArray<z.ZodString>;
269
+ fill_target: z.ZodString;
270
+ evaluated_at: z.ZodString;
271
+ field: z.ZodString;
272
+ value: z.ZodOptional<z.ZodString>;
273
+ truncated: z.ZodOptional<z.ZodBoolean>;
274
+ expr_truncated: z.ZodOptional<z.ZodBoolean>;
275
+ reference: z.ZodOptional<z.ZodBoolean>;
276
+ degraded: z.ZodOptional<z.ZodBoolean>;
277
+ env_key: z.ZodOptional<z.ZodString>;
278
+ }, z.core.$strip>, z.ZodObject<{
279
+ truncated: z.ZodLiteral<true>;
280
+ dropped: z.ZodNumber;
281
+ }, z.core.$strip>]>>>;
282
+ }, z.core.$strip>;
283
+ export type StepAttemptDetailDto = z.infer<typeof stepAttemptDetailDtoSchema>;
195
284
  //# sourceMappingURL=step.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/schemas/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK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AC,OAAO,aAAa,CAAC,CAAC;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAqCvB,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqB/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -1,4 +1,11 @@
1
1
  import { z } from 'zod';
2
+ import { evaluationTraceSchema } from './evaluation-trace.js';
3
+ export const STEP_STATUS_REASONS = [
4
+ 'default_gate_rejected',
5
+ 'condition_rejected',
6
+ 'condition_errored'
7
+ ];
8
+ export const stepStatusReasonSchema = z.enum(STEP_STATUS_REASONS);
2
9
  // Machine-readable cause of a step failure, for DB troubleshooting. The runner
3
10
  // reports it and the server stores it as-is. The `checkout_*`, `git_unavailable`,
4
11
  // `workspace_prep_failed`, and `setup_aborted` values cover checkout/setup failures.
@@ -68,8 +75,10 @@ export const stepDtoSchema = z.object({
68
75
  name: z.string(),
69
76
  source_location: stepSourceLocationSchema.nullable(),
70
77
  status: z.string(),
78
+ status_reason: stepStatusReasonSchema.nullable(),
71
79
  type: z.string(),
72
80
  config: z.record(z.string(), z.unknown()),
81
+ evaluation_trace: evaluationTraceSchema.nullable(),
73
82
  error: stepErrorDtoSchema,
74
83
  position: z.number(),
75
84
  // Execution-attempt identity of the current projection (>1 after a restart).
@@ -137,5 +146,9 @@ export const stepAttemptDtoSchema = z.object({
137
146
  started_at: z.string(),
138
147
  finished_at: z.string().nullable()
139
148
  });
149
+ export const stepAttemptDetailDtoSchema = stepAttemptDtoSchema.extend({
150
+ config: z.record(z.string(), z.unknown()).nullable(),
151
+ evaluation_trace: evaluationTraceSchema.nullable()
152
+ });
140
153
 
141
154
  //# sourceMappingURL=step.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/step.ts"],"sourcesContent":["import {z} from 'zod';\n\n// Machine-readable cause of a step failure, for DB troubleshooting. The runner\n// reports it and the server stores it as-is. The `checkout_*`, `git_unavailable`,\n// `workspace_prep_failed`, and `setup_aborted` values cover checkout/setup failures.\n// For agent steps the cause is split three ways: `agent_config_invalid` is a user-fixable\n// configuration error and carries an `agent_config_issue`; `agent_invocation_failed`\n// covers a provider/API failure once the configuration is valid; and\n// `agent_harness_unavailable` means the runner could not start its harness, so the model\n// was never called. The latter carries no `agent_config_issue`, because every issue code\n// names a user-fixable cause. (Aborts are never reported: the step loop stops before reporting.)\nexport const stepErrorReasonSchema = z.enum([\n 'checkout_failed',\n 'checkout_auth_failed',\n 'checkout_unavailable',\n 'checkout_path_invalid',\n 'checkout_destination_occupied',\n 'git_unavailable',\n 'workspace_prep_failed',\n 'setup_aborted',\n 'config_unresolvable',\n 'output_invalid',\n 'agent_config_invalid',\n 'agent_invocation_failed',\n 'agent_harness_unavailable',\n]);\n\nexport type StepErrorReasonDto = z.infer<typeof stepErrorReasonSchema>;\n\nexport const agentConfigIssueSchema = z.enum([\n 'step_config_invalid',\n 'provider_not_configured',\n 'provider_unsupported',\n 'model_unavailable',\n 'credentials_invalid',\n]);\n\nexport type AgentConfigIssueDto = z.infer<typeof agentConfigIssueSchema>;\n\n// Whether a failure is infrastructure (`setup`) or user-code (`user`). Server-derived\n// from the step's type on the read path; the runner never sends it.\nexport const stepErrorCategorySchema = z.enum(['setup', 'user']);\n\nexport type StepErrorCategoryDto = z.infer<typeof stepErrorCategorySchema>;\n\nexport const STEP_ERROR_MESSAGE_MAX_LENGTH = 2048;\n\nexport const stepErrorDtoSchema = z\n .object({\n message: z.string().max(STEP_ERROR_MESSAGE_MAX_LENGTH),\n exit_code: z.number().int().nullable().optional(),\n signal: z.string().optional(),\n reason: stepErrorReasonSchema.optional(),\n field: z.string().optional(),\n source: z.string().optional(),\n agent_config_issue: agentConfigIssueSchema.optional(),\n category: stepErrorCategorySchema.optional(),\n })\n .refine(\n (error) => error.agent_config_issue === undefined || error.reason === 'agent_config_invalid',\n {\n message: 'agent_config_issue requires reason to be agent_config_invalid',\n path: ['agent_config_issue'],\n },\n )\n .nullable();\n\nexport type StepErrorDto = z.infer<typeof stepErrorDtoSchema>;\n\nexport const stepSourceLocationSchema = z\n .object({\n start_line: z.number().int().positive(),\n end_line: z.number().int().positive(),\n })\n .refine((value) => value.end_line >= value.start_line, {\n message: 'end_line must be greater than or equal to start_line',\n path: ['end_line'],\n });\n\nexport type StepSourceLocationDto = z.infer<typeof stepSourceLocationSchema>;\n\nexport const stepDtoSchema = z.object({\n id: z.string().uuid(),\n job_execution_id: z.string().uuid(),\n key: z.string().nullable(),\n name: z.string(),\n source_location: stepSourceLocationSchema.nullable(),\n status: z.string(),\n type: z.string(),\n config: z.record(z.string(), z.unknown()),\n error: stepErrorDtoSchema,\n position: z.number(),\n // Execution-attempt identity of the current projection (>1 after a restart).\n current_attempt: z.number().int(),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport type StepDto = z.infer<typeof stepDtoSchema>;\n\nexport const stepGateResultDtoSchema = z\n .discriminatedUnion('kind', [\n z.object({\n kind: z.literal('none'),\n }),\n z.object({\n kind: z.literal('not_evaluated'),\n }),\n z.object({\n kind: z.literal('passed'),\n passed: z.literal(true),\n source: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('failed'),\n passed: z.literal(false),\n source: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('uncheckable'),\n passed: z.literal(false),\n uncheckable: z.literal(true),\n reason: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('evaluation_error'),\n reason: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('unknown'),\n data: z.record(z.string(), z.unknown()),\n }),\n ])\n .nullable();\n\nexport type StepGateResultDto = z.infer<typeof stepGateResultDtoSchema>;\n\n// One execution attempt of a step (the durable history behind the current\n// projection). Surfaced in run details so a restarted step's attempts are visible.\nexport const stepAttemptDtoSchema = z.object({\n id: z.string().uuid(),\n step_id: z.string().uuid(),\n attempt: z.number().int().positive(),\n execution_order: z.number().int().positive(),\n status: z.string(),\n exit_code: z.number().int().nullable(),\n // `output` and `error` are opaque audit blobs: the raw jsonb persisted for the\n // attempt, NOT snake_case-normalized (their nested keys may be camelCase, e.g.\n // `error.exitCode`). Consume the top-level snake_case `exit_code` for the\n // numeric code; treat these as display/debug payloads.\n output: z.record(z.string(), z.unknown()).nullable(),\n outputs: z.record(z.string(), z.unknown()).nullable(),\n response: z.string().nullable(),\n error: z.record(z.string(), z.unknown()).nullable(),\n // `unknown.data` is the raw jsonb gate payload for legacy or unrecognized\n // rows; nested keys are not snake_case-normalized.\n gate_result: stepGateResultDtoSchema,\n restart_feedback: z.string().nullable(),\n started_at: z.string(),\n finished_at: z.string().nullable(),\n});\n\nexport type StepAttemptDto = z.infer<typeof stepAttemptDtoSchema>;\n"],"names":["z","stepErrorReasonSchema","enum","agentConfigIssueSchema","stepErrorCategorySchema","STEP_ERROR_MESSAGE_MAX_LENGTH","stepErrorDtoSchema","object","message","string","max","exit_code","number","int","nullable","optional","signal","reason","field","source","agent_config_issue","category","refine","error","undefined","path","stepSourceLocationSchema","start_line","positive","end_line","value","stepDtoSchema","id","uuid","job_execution_id","key","name","source_location","status","type","config","record","unknown","position","current_attempt","created_at","updated_at","stepGateResultDtoSchema","discriminatedUnion","kind","literal","passed","uncheckable","data","stepAttemptDtoSchema","step_id","attempt","execution_order","output","outputs","response","gate_result","restart_feedback","started_at","finished_at"],"mapp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,MAAM,CAACzC,EAAES,MAAM,IAAIT,EAAE0C,OAAO,IAAI5B,QAAQ;IACjD,0EAA0E;IAC1E,mDAAmD;IACnD+C,aAAad;IACbe,kBAAkB9D,EAAES,MAAM,GAAGK,QAAQ;IACrCiD,YAAY/D,EAAES,MAAM;IACpBuD,aAAahE,EAAES,MAAM,GAAGK,QAAQ;AAClC,GAAG"}
1
+ {"version":3,"sources":["../../src/schemas/step.ts"],"sourcesContent":["import {z} from 'zod';\nimport {evaluationTraceSchema} from './evaluation-trace.js';\n\nexport const STEP_STATUS_REASONS = [\n 'default_gate_rejected',\n 'condition_rejected',\n 'condition_errored',\n] as const;\n\nexport const stepStatusReasonSchema = z.enum(STEP_STATUS_REASONS);\n\nexport type StepStatusReasonDto = z.infer<typeof stepStatusReasonSchema>;\n\n// Machine-readable cause of a step failure, for DB troubleshooting. The runner\n// reports it and the server stores it as-is. The `checkout_*`, `git_unavailable`,\n// `workspace_prep_failed`, and `setup_aborted` values cover checkout/setup failures.\n// For agent steps the cause is split three ways: `agent_config_invalid` is a user-fixable\n// configuration error and carries an `agent_config_issue`; `agent_invocation_failed`\n// covers a provider/API failure once the configuration is valid; and\n// `agent_harness_unavailable` means the runner could not start its harness, so the model\n// was never called. The latter carries no `agent_config_issue`, because every issue code\n// names a user-fixable cause. (Aborts are never reported: the step loop stops before reporting.)\nexport const stepErrorReasonSchema = z.enum([\n 'checkout_failed',\n 'checkout_auth_failed',\n 'checkout_unavailable',\n 'checkout_path_invalid',\n 'checkout_destination_occupied',\n 'git_unavailable',\n 'workspace_prep_failed',\n 'setup_aborted',\n 'config_unresolvable',\n 'output_invalid',\n 'agent_config_invalid',\n 'agent_invocation_failed',\n 'agent_harness_unavailable',\n]);\n\nexport type StepErrorReasonDto = z.infer<typeof stepErrorReasonSchema>;\n\nexport const agentConfigIssueSchema = z.enum([\n 'step_config_invalid',\n 'provider_not_configured',\n 'provider_unsupported',\n 'model_unavailable',\n 'credentials_invalid',\n]);\n\nexport type AgentConfigIssueDto = z.infer<typeof agentConfigIssueSchema>;\n\n// Whether a failure is infrastructure (`setup`) or user-code (`user`). Server-derived\n// from the step's type on the read path; the runner never sends it.\nexport const stepErrorCategorySchema = z.enum(['setup', 'user']);\n\nexport type StepErrorCategoryDto = z.infer<typeof stepErrorCategorySchema>;\n\nexport const STEP_ERROR_MESSAGE_MAX_LENGTH = 2048;\n\nexport const stepErrorDtoSchema = z\n .object({\n message: z.string().max(STEP_ERROR_MESSAGE_MAX_LENGTH),\n exit_code: z.number().int().nullable().optional(),\n signal: z.string().optional(),\n reason: stepErrorReasonSchema.optional(),\n field: z.string().optional(),\n source: z.string().optional(),\n agent_config_issue: agentConfigIssueSchema.optional(),\n category: stepErrorCategorySchema.optional(),\n })\n .refine(\n (error) => error.agent_config_issue === undefined || error.reason === 'agent_config_invalid',\n {\n message: 'agent_config_issue requires reason to be agent_config_invalid',\n path: ['agent_config_issue'],\n },\n )\n .nullable();\n\nexport type StepErrorDto = z.infer<typeof stepErrorDtoSchema>;\n\nexport const stepSourceLocationSchema = z\n .object({\n start_line: z.number().int().positive(),\n end_line: z.number().int().positive(),\n })\n .refine((value) => value.end_line >= value.start_line, {\n message: 'end_line must be greater than or equal to start_line',\n path: ['end_line'],\n });\n\nexport type StepSourceLocationDto = z.infer<typeof stepSourceLocationSchema>;\n\nexport const stepDtoSchema = z.object({\n id: z.string().uuid(),\n job_execution_id: z.string().uuid(),\n key: z.string().nullable(),\n name: z.string(),\n source_location: stepSourceLocationSchema.nullable(),\n status: z.string(),\n status_reason: stepStatusReasonSchema.nullable(),\n type: z.string(),\n config: z.record(z.string(), z.unknown()),\n evaluation_trace: evaluationTraceSchema.nullable(),\n error: stepErrorDtoSchema,\n position: z.number(),\n // Execution-attempt identity of the current projection (>1 after a restart).\n current_attempt: z.number().int(),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport type StepDto = z.infer<typeof stepDtoSchema>;\n\nexport const stepGateResultDtoSchema = z\n .discriminatedUnion('kind', [\n z.object({\n kind: z.literal('none'),\n }),\n z.object({\n kind: z.literal('not_evaluated'),\n }),\n z.object({\n kind: z.literal('passed'),\n passed: z.literal(true),\n source: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('failed'),\n passed: z.literal(false),\n source: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('uncheckable'),\n passed: z.literal(false),\n uncheckable: z.literal(true),\n reason: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('evaluation_error'),\n reason: z.string(),\n exit_code: z.number().int().nullable(),\n }),\n z.object({\n kind: z.literal('unknown'),\n data: z.record(z.string(), z.unknown()),\n }),\n ])\n .nullable();\n\nexport type StepGateResultDto = z.infer<typeof stepGateResultDtoSchema>;\n\n// One execution attempt of a step (the durable history behind the current\n// projection). Surfaced in run details so a restarted step's attempts are visible.\nexport const stepAttemptDtoSchema = z.object({\n id: z.string().uuid(),\n step_id: z.string().uuid(),\n attempt: z.number().int().positive(),\n execution_order: z.number().int().positive(),\n status: z.string(),\n exit_code: z.number().int().nullable(),\n // `output` and `error` are opaque audit blobs: the raw jsonb persisted for the\n // attempt, NOT snake_case-normalized (their nested keys may be camelCase, e.g.\n // `error.exitCode`). Consume the top-level snake_case `exit_code` for the\n // numeric code; treat these as display/debug payloads.\n output: z.record(z.string(), z.unknown()).nullable(),\n outputs: z.record(z.string(), z.unknown()).nullable(),\n response: z.string().nullable(),\n error: z.record(z.string(), z.unknown()).nullable(),\n // `unknown.data` is the raw jsonb gate payload for legacy or unrecognized\n // rows; nested keys are not snake_case-normalized.\n gate_result: stepGateResultDtoSchema,\n restart_feedback: z.string().nullable(),\n started_at: z.string(),\n finished_at: z.string().nullable(),\n});\n\nexport type StepAttemptDto = z.infer<typeof stepAttemptDtoSchema>;\n\nexport const stepAttemptDetailDtoSchema = stepAttemptDtoSchema.extend({\n config: z.record(z.string(), z.unknown()).nullable(),\n evaluation_trace: evaluationTraceSchema.nullable(),\n});\n\nexport type StepAttemptDetailDto = z.infer<typeof stepAttemptDetailDtoSchema>;\n"],"names":["z","evaluationTraceSchema","STEP_STATUS_REASONS","stepStatusReasonSchema","enum","stepErrorReasonSchema","agentConfigIssueSchema","stepErrorCategorySchema","STEP_ERROR_MESSAGE_MAX_LENGTH","stepErrorDtoSchema","object","message","string","max","exit_code","number","int","nullable","optional","signal","reason","field","source","agent_config_issue","category","refine","error","undefined","path","stepSourceLocationSchema","start_line","positive","end_line","value","stepDtoSchema","id","uuid","job_execution_id","key","name","source_location","status","status_reason","type","config","record","unknown","evaluation_trace","position","current_attempt","created_at","updated_at","stepGateResultDtoSchema","discriminatedUnion","kind","literal","passed","uncheckable","data","stepAttemptDtoSchema","step_id","attempt","execution_order","output","outputs","response","gate_result","restart_feedback","started_at","finished_at","stepAttemptDetailDtoSchema","extend"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,qBAAqB,QAAO,wBAAwB;AAE5D,OAAO,MAAMC,sBAAsB;IACjC;IACA;IACA;CACD,CAAU;AAEX,OAAO,MAAMC,yBAAyBH,EAAEI,IAAI,CAACF,qBAAqB;AAIlE,+EAA+E;AAC/E,kFAAkF;AAClF,qFAAqF;AACrF,0FAA0F;AAC1F,qFAAqF;AACrF,qEAAqE;AACrE,yFAAyF;AACzF,yFAAyF;AACzF,iGAAiG;AACjG,OAAO,MAAMG,wBAAwBL,EAAEI,IAAI,CAAC;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AAIH,OAAO,MAAME,yBAAyBN,EAAEI,IAAI,CAAC;IAC3C;IACA;IACA;IACA;IACA;CACD,EAAE;AAIH,sFAAsF;AACtF,oEAAoE;AACpE,OAAO,MAAMG,0BAA0BP,EAAEI,IAAI,CAAC;IAAC;IAAS;CAAO,EAAE;AAIjE,OAAO,MAAMI,gCAAgC,KAAK;AAElD,OAAO,MAAMC,qBAAqBT,EAC/BU,MAA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