@shipfox/api-workflows-dto 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +46 -0
  5. package/LICENSE +21 -0
  6. package/dist/events.d.ts +316 -0
  7. package/dist/events.d.ts.map +1 -0
  8. package/dist/events.js +144 -0
  9. package/dist/events.js.map +1 -0
  10. package/dist/index.d.ts +5 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +6 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/schemas/agent-runtime-config.d.ts +7 -0
  15. package/dist/schemas/agent-runtime-config.d.ts.map +1 -0
  16. package/dist/schemas/agent-runtime-config.js +7 -0
  17. package/dist/schemas/agent-runtime-config.js.map +1 -0
  18. package/dist/schemas/checkout-token.d.ts +56 -0
  19. package/dist/schemas/checkout-token.d.ts.map +1 -0
  20. package/dist/schemas/checkout-token.js +44 -0
  21. package/dist/schemas/checkout-token.js.map +1 -0
  22. package/dist/schemas/checkout.d.ts +10 -0
  23. package/dist/schemas/checkout.d.ts.map +1 -0
  24. package/dist/schemas/checkout.js +10 -0
  25. package/dist/schemas/checkout.js.map +1 -0
  26. package/dist/schemas/index.d.ts +11 -0
  27. package/dist/schemas/index.d.ts.map +1 -0
  28. package/dist/schemas/index.js +12 -0
  29. package/dist/schemas/index.js.map +1 -0
  30. package/dist/schemas/job-execution.d.ts +116 -0
  31. package/dist/schemas/job-execution.d.ts.map +1 -0
  32. package/dist/schemas/job-execution.js +42 -0
  33. package/dist/schemas/job-execution.js.map +1 -0
  34. package/dist/schemas/job-listening.d.ts +93 -0
  35. package/dist/schemas/job-listening.d.ts.map +1 -0
  36. package/dist/schemas/job-listening.js +60 -0
  37. package/dist/schemas/job-listening.js.map +1 -0
  38. package/dist/schemas/job.d.ts +101 -0
  39. package/dist/schemas/job.d.ts.map +1 -0
  40. package/dist/schemas/job.js +43 -0
  41. package/dist/schemas/job.js.map +1 -0
  42. package/dist/schemas/log-outcome.d.ts +7 -0
  43. package/dist/schemas/log-outcome.d.ts.map +1 -0
  44. package/dist/schemas/log-outcome.js +7 -0
  45. package/dist/schemas/log-outcome.js.map +1 -0
  46. package/dist/schemas/step.d.ts +186 -0
  47. package/dist/schemas/step.d.ts.map +1 -0
  48. package/dist/schemas/step.js +137 -0
  49. package/dist/schemas/step.js.map +1 -0
  50. package/dist/schemas/workflow-run-detail.d.ts +807 -0
  51. package/dist/schemas/workflow-run-detail.d.ts.map +1 -0
  52. package/dist/schemas/workflow-run-detail.js +51 -0
  53. package/dist/schemas/workflow-run-detail.js.map +1 -0
  54. package/dist/schemas/workflow-run.d.ts +213 -0
  55. package/dist/schemas/workflow-run.d.ts.map +1 -0
  56. package/dist/schemas/workflow-run.js +112 -0
  57. package/dist/schemas/workflow-run.js.map +1 -0
  58. package/dist/tsconfig.test.tsbuildinfo +1 -0
  59. package/package.json +55 -0
  60. package/src/events.test.ts +362 -0
  61. package/src/events.ts +180 -0
  62. package/src/index.ts +130 -0
  63. package/src/schemas/agent-runtime-config.test.ts +17 -0
  64. package/src/schemas/agent-runtime-config.ts +8 -0
  65. package/src/schemas/checkout-token.test.ts +162 -0
  66. package/src/schemas/checkout-token.ts +45 -0
  67. package/src/schemas/checkout.test.ts +49 -0
  68. package/src/schemas/checkout.ts +11 -0
  69. package/src/schemas/index.ts +104 -0
  70. package/src/schemas/job-execution.test.ts +27 -0
  71. package/src/schemas/job-execution.ts +92 -0
  72. package/src/schemas/job-listening.test.ts +64 -0
  73. package/src/schemas/job-listening.ts +59 -0
  74. package/src/schemas/job.test.ts +42 -0
  75. package/src/schemas/job.ts +53 -0
  76. package/src/schemas/log-outcome.ts +5 -0
  77. package/src/schemas/step-source-location.test.ts +45 -0
  78. package/src/schemas/step.test.ts +176 -0
  79. package/src/schemas/step.ts +163 -0
  80. package/src/schemas/workflow-run-detail.ts +67 -0
  81. package/src/schemas/workflow-run.test.ts +59 -0
  82. package/src/schemas/workflow-run.ts +144 -0
  83. package/tsconfig.build.json +9 -0
  84. package/tsconfig.build.tsbuildinfo +1 -0
  85. package/tsconfig.json +3 -0
  86. package/tsconfig.test.json +8 -0
  87. package/vitest.config.ts +3 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runtime-config.d.ts","sourceRoot":"","sources":["../../src/schemas/agent-runtime-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export const agentRuntimeConfigQuerySchema = z.object({
3
+ step_id: z.string().uuid(),
4
+ attempt: z.coerce.number().int().positive()
5
+ });
6
+
7
+ //# sourceMappingURL=agent-runtime-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/agent-runtime-config.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const agentRuntimeConfigQuerySchema = z.object({\n step_id: z.string().uuid(),\n attempt: z.coerce.number().int().positive(),\n});\n\nexport type AgentRuntimeConfigQueryDto = z.infer<typeof agentRuntimeConfigQuerySchema>;\n"],"names":["z","agentRuntimeConfigQuerySchema","object","step_id","string","uuid","attempt","coerce","number","int","positive"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,gCAAgCD,EAAEE,MAAM,CAAC;IACpDC,SAASH,EAAEI,MAAM,GAAGC,IAAI;IACxBC,SAASN,EAAEO,MAAM,CAACC,MAAM,GAAGC,GAAG,GAAGC,QAAQ;AAC3C,GAAG"}
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+ export declare const checkoutTokenAuthSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ carry: z.ZodEnum<{
4
+ header: "header";
5
+ userinfo: "userinfo";
6
+ }>;
7
+ host: z.ZodString;
8
+ persist: z.ZodBoolean;
9
+ kind: z.ZodLiteral<"basic">;
10
+ username: z.ZodString;
11
+ token: z.ZodString;
12
+ expires_at: z.ZodString;
13
+ }, z.core.$strip>, z.ZodObject<{
14
+ carry: z.ZodEnum<{
15
+ header: "header";
16
+ userinfo: "userinfo";
17
+ }>;
18
+ host: z.ZodString;
19
+ persist: z.ZodBoolean;
20
+ kind: z.ZodLiteral<"bearer">;
21
+ token: z.ZodString;
22
+ expires_at: z.ZodString;
23
+ }, z.core.$strip>], "kind">;
24
+ export type CheckoutTokenAuthDto = z.infer<typeof checkoutTokenAuthSchema>;
25
+ export declare const checkoutTokenResponseSchema: z.ZodObject<{
26
+ repository_url: z.ZodString;
27
+ ref: z.ZodString;
28
+ git_author: z.ZodOptional<z.ZodObject<{
29
+ name: z.ZodString;
30
+ email: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ auth: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
33
+ carry: z.ZodEnum<{
34
+ header: "header";
35
+ userinfo: "userinfo";
36
+ }>;
37
+ host: z.ZodString;
38
+ persist: z.ZodBoolean;
39
+ kind: z.ZodLiteral<"basic">;
40
+ username: z.ZodString;
41
+ token: z.ZodString;
42
+ expires_at: z.ZodString;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ carry: z.ZodEnum<{
45
+ header: "header";
46
+ userinfo: "userinfo";
47
+ }>;
48
+ host: z.ZodString;
49
+ persist: z.ZodBoolean;
50
+ kind: z.ZodLiteral<"bearer">;
51
+ token: z.ZodString;
52
+ expires_at: z.ZodString;
53
+ }, z.core.$strip>], "kind">>;
54
+ }, z.core.$strip>;
55
+ export type CheckoutTokenResponseDto = z.infer<typeof checkoutTokenResponseSchema>;
56
+ //# sourceMappingURL=checkout-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-token.d.ts","sourceRoot":"","sources":["../../src/schemas/checkout-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA4BtB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;2BAGlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOtC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ const carryFields = {
3
+ carry: z.enum([
4
+ 'header',
5
+ 'userinfo'
6
+ ]),
7
+ host: z.string().min(1),
8
+ persist: z.boolean()
9
+ };
10
+ const checkoutGitAuthorSchema = z.object({
11
+ name: z.string().min(1),
12
+ email: z.string().min(1)
13
+ });
14
+ const checkoutTokenBasicAuthSchema = z.object({
15
+ kind: z.literal('basic'),
16
+ username: z.string().min(1),
17
+ token: z.string().min(1),
18
+ expires_at: z.string().datetime({
19
+ offset: true
20
+ }),
21
+ ...carryFields
22
+ });
23
+ const checkoutTokenBearerAuthSchema = z.object({
24
+ kind: z.literal('bearer'),
25
+ token: z.string().min(1),
26
+ expires_at: z.string().datetime({
27
+ offset: true
28
+ }),
29
+ ...carryFields
30
+ });
31
+ export const checkoutTokenAuthSchema = z.discriminatedUnion('kind', [
32
+ checkoutTokenBasicAuthSchema,
33
+ checkoutTokenBearerAuthSchema
34
+ ]);
35
+ export const checkoutTokenResponseSchema = z.object({
36
+ repository_url: z.string().min(1),
37
+ ref: z.string().min(1),
38
+ git_author: checkoutGitAuthorSchema.optional(),
39
+ // Optional: credential-free providers (e.g. the debug source control) return a
40
+ // public clone URL with no auth material, so the runner clones without a token.
41
+ auth: checkoutTokenAuthSchema.optional()
42
+ });
43
+
44
+ //# sourceMappingURL=checkout-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/checkout-token.ts"],"sourcesContent":["import {z} from 'zod';\n\nconst carryFields = {\n carry: z.enum(['header', 'userinfo']),\n host: z.string().min(1),\n persist: z.boolean(),\n};\n\nconst checkoutGitAuthorSchema = z.object({\n name: z.string().min(1),\n email: z.string().min(1),\n});\n\nconst checkoutTokenBasicAuthSchema = z.object({\n kind: z.literal('basic'),\n username: z.string().min(1),\n token: z.string().min(1),\n expires_at: z.string().datetime({offset: true}),\n ...carryFields,\n});\n\nconst checkoutTokenBearerAuthSchema = z.object({\n kind: z.literal('bearer'),\n token: z.string().min(1),\n expires_at: z.string().datetime({offset: true}),\n ...carryFields,\n});\n\nexport const checkoutTokenAuthSchema = z.discriminatedUnion('kind', [\n checkoutTokenBasicAuthSchema,\n checkoutTokenBearerAuthSchema,\n]);\n\nexport type CheckoutTokenAuthDto = z.infer<typeof checkoutTokenAuthSchema>;\n\nexport const checkoutTokenResponseSchema = z.object({\n repository_url: z.string().min(1),\n ref: z.string().min(1),\n git_author: checkoutGitAuthorSchema.optional(),\n // Optional: credential-free providers (e.g. the debug source control) return a\n // public clone URL with no auth material, so the runner clones without a token.\n auth: checkoutTokenAuthSchema.optional(),\n});\n\nexport type CheckoutTokenResponseDto = z.infer<typeof checkoutTokenResponseSchema>;\n"],"names":["z","carryFields","carry","enum","host","string","min","persist","boolean","checkoutGitAuthorSchema","object","name","email","checkoutTokenBasicAuthSchema","kind","literal","username","token","expires_at","datetime","offset","checkoutTokenBearerAuthSchema","checkoutTokenAuthSchema","discriminatedUnion","checkoutTokenResponseSchema","repository_url","ref","git_author","optional","auth"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,MAAMC,cAAc;IAClBC,OAAOF,EAAEG,IAAI,CAAC;QAAC;QAAU;KAAW;IACpCC,MAAMJ,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACrBC,SAASP,EAAEQ,OAAO;AACpB;AAEA,MAAMC,0BAA0BT,EAAEU,MAAM,CAAC;IACvCC,MAAMX,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACrBM,OAAOZ,EAAEK,MAAM,GAAGC,GAAG,CAAC;AACxB;AAEA,MAAMO,+BAA+Bb,EAAEU,MAAM,CAAC;IAC5CI,MAAMd,EAAEe,OAAO,CAAC;IAChBC,UAAUhB,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACzBW,OAAOjB,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACtBY,YAAYlB,EAAEK,MAAM,GAAGc,QAAQ,CAAC;QAACC,QAAQ;IAAI;IAC7C,GAAGnB,WAAW;AAChB;AAEA,MAAMoB,gCAAgCrB,EAAEU,MAAM,CAAC;IAC7CI,MAAMd,EAAEe,OAAO,CAAC;IAChBE,OAAOjB,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACtBY,YAAYlB,EAAEK,MAAM,GAAGc,QAAQ,CAAC;QAACC,QAAQ;IAAI;IAC7C,GAAGnB,WAAW;AAChB;AAEA,OAAO,MAAMqB,0BAA0BtB,EAAEuB,kBAAkB,CAAC,QAAQ;IAClEV;IACAQ;CACD,EAAE;AAIH,OAAO,MAAMG,8BAA8BxB,EAAEU,MAAM,CAAC;IAClDe,gBAAgBzB,EAAEK,MAAM,GAAGC,GAAG,CAAC;IAC/BoB,KAAK1B,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACpBqB,YAAYlB,wBAAwBmB,QAAQ;IAC5C,+EAA+E;IAC/E,gFAAgF;IAChFC,MAAMP,wBAAwBM,QAAQ;AACxC,GAAG"}
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export declare const checkoutIntentSchema: z.ZodObject<{
3
+ repository_url: z.ZodString;
4
+ ref: z.ZodString;
5
+ provider: z.ZodString;
6
+ source_connection_id: z.ZodString;
7
+ external_repository_id: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export type CheckoutIntentDto = z.infer<typeof checkoutIntentSchema>;
10
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/schemas/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,oBAAoB;;;;;;iBAM/B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export const checkoutIntentSchema = z.object({
3
+ repository_url: z.string().min(1),
4
+ ref: z.string().min(1),
5
+ provider: z.string().min(1),
6
+ source_connection_id: z.string().uuid(),
7
+ external_repository_id: z.string().min(1)
8
+ });
9
+
10
+ //# sourceMappingURL=checkout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/checkout.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const checkoutIntentSchema = z.object({\n repository_url: z.string().min(1),\n ref: z.string().min(1),\n provider: z.string().min(1),\n source_connection_id: z.string().uuid(),\n external_repository_id: z.string().min(1),\n});\n\nexport type CheckoutIntentDto = z.infer<typeof checkoutIntentSchema>;\n"],"names":["z","checkoutIntentSchema","object","repository_url","string","min","ref","provider","source_connection_id","uuid","external_repository_id"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,uBAAuBD,EAAEE,MAAM,CAAC;IAC3CC,gBAAgBH,EAAEI,MAAM,GAAGC,GAAG,CAAC;IAC/BC,KAAKN,EAAEI,MAAM,GAAGC,GAAG,CAAC;IACpBE,UAAUP,EAAEI,MAAM,GAAGC,GAAG,CAAC;IACzBG,sBAAsBR,EAAEI,MAAM,GAAGK,IAAI;IACrCC,wBAAwBV,EAAEI,MAAM,GAAGC,GAAG,CAAC;AACzC,GAAG"}
@@ -0,0 +1,11 @@
1
+ export { type AgentRuntimeConfigQueryDto, agentRuntimeConfigQuerySchema, } from './agent-runtime-config.js';
2
+ export { type CheckoutIntentDto, checkoutIntentSchema } from './checkout.js';
3
+ export { type CheckoutTokenAuthDto, type CheckoutTokenResponseDto, checkoutTokenAuthSchema, checkoutTokenResponseSchema, } from './checkout-token.js';
4
+ export { type JobDto, type JobStatusDto, type JobStatusReasonDto, jobDtoSchema, jobStatusReasonSchema, jobStatusSchema, } from './job.js';
5
+ export { type NextStepResponseDto, nextStepResponseSchema, type ReportStepBodyDto, type ReportStepResponseDto, reportStepBodySchema, reportStepResponseSchema, STEP_RESPONSE_MAX_LENGTH, } from './job-execution.js';
6
+ export { type JobListeningDto, type JobModeDto, jobListeningBatchSchema, jobListeningSchema, jobModeSchema, type ListenerStatusDto, type ListeningTriggerDto, listenerStatusSchema, listeningTriggerSchema, type ResolutionReasonDto, resolutionReasonSchema, type TriggerEventsBatchDto, triggerEventsBatchSchema, type WorkflowExecutionContextDto, type WorkflowExecutionEventDto, workflowExecutionContextSchema, workflowExecutionEventSchema, } from './job-listening.js';
7
+ export { type LogOutcomeDto, logOutcomeSchema } from './log-outcome.js';
8
+ export { type AgentConfigIssueDto, agentConfigIssueSchema, STEP_ERROR_MESSAGE_MAX_LENGTH, type StepAttemptDto, type StepDto, type StepErrorCategoryDto, type StepErrorDto, type StepErrorReasonDto, type StepGateResultDto, stepAttemptDtoSchema, stepDtoSchema, stepErrorCategorySchema, stepErrorDtoSchema, stepErrorReasonSchema, stepGateResultDtoSchema, } from './step.js';
9
+ export { type RerunWorkflowRunBodyDto, rerunWorkflowRunBodySchema, type WorkflowRunAggregatesQueryDto, type WorkflowRunAggregatesResponseDto, type WorkflowRunAttemptDto, type WorkflowRunAttemptsResponseDto, type WorkflowRunDto, type WorkflowRunListQueryDto, type WorkflowRunListResponseDto, type WorkflowRunRerunModeDto, type WorkflowRunResponseDto, type WorkflowRunStatusDto, type WorkflowSourceSnapshotDto, workflowRunAggregatesQuerySchema, workflowRunAggregatesResponseSchema, workflowRunAttemptDtoSchema, workflowRunAttemptsResponseSchema, workflowRunDtoSchema, workflowRunListQuerySchema, workflowRunListResponseSchema, workflowRunRerunModeSchema, workflowRunResponseSchema, workflowRunStatusSchema, workflowSourceSnapshotSchema, } from './workflow-run.js';
10
+ export { type JobExecutionDto, jobExecutionDtoSchema, jobExecutionStatusSchema, type WorkflowRunDetailResponseDto, type WorkflowRunJobDetailDto, type WorkflowRunJobExecutionDetailDto, type WorkflowRunStepDetailDto, workflowRunDetailResponseSchema, workflowRunJobDetailDtoSchema, workflowRunJobExecutionDetailDtoSchema, workflowRunStepDetailDtoSchema, } from './workflow-run-detail.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,KAAK,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC3E,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,YAAY,EACZ,qBAAqB,EACrB,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,wBAAwB,EACxB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,KAAK,aAAa,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACtE,OAAO,EACL,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,gCAAgC,EAChC,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,oBAAoB,EACpB,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,eAAe,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,wBAAwB,EAC7B,+BAA+B,EAC/B,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { agentRuntimeConfigQuerySchema } from './agent-runtime-config.js';
2
+ export { checkoutIntentSchema } from './checkout.js';
3
+ export { checkoutTokenAuthSchema, checkoutTokenResponseSchema } from './checkout-token.js';
4
+ export { jobDtoSchema, jobStatusReasonSchema, jobStatusSchema } from './job.js';
5
+ export { nextStepResponseSchema, reportStepBodySchema, reportStepResponseSchema, STEP_RESPONSE_MAX_LENGTH } from './job-execution.js';
6
+ export { jobListeningBatchSchema, jobListeningSchema, jobModeSchema, listenerStatusSchema, listeningTriggerSchema, resolutionReasonSchema, triggerEventsBatchSchema, workflowExecutionContextSchema, workflowExecutionEventSchema } from './job-listening.js';
7
+ export { logOutcomeSchema } from './log-outcome.js';
8
+ export { agentConfigIssueSchema, STEP_ERROR_MESSAGE_MAX_LENGTH, stepAttemptDtoSchema, stepDtoSchema, stepErrorCategorySchema, stepErrorDtoSchema, stepErrorReasonSchema, stepGateResultDtoSchema } from './step.js';
9
+ export { rerunWorkflowRunBodySchema, workflowRunAggregatesQuerySchema, workflowRunAggregatesResponseSchema, workflowRunAttemptDtoSchema, workflowRunAttemptsResponseSchema, workflowRunDtoSchema, workflowRunListQuerySchema, workflowRunListResponseSchema, workflowRunRerunModeSchema, workflowRunResponseSchema, workflowRunStatusSchema, workflowSourceSnapshotSchema } from './workflow-run.js';
10
+ export { jobExecutionDtoSchema, jobExecutionStatusSchema, workflowRunDetailResponseSchema, workflowRunJobDetailDtoSchema, workflowRunJobExecutionDetailDtoSchema, workflowRunStepDetailDtoSchema } from './workflow-run-detail.js';
11
+
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n type AgentRuntimeConfigQueryDto,\n agentRuntimeConfigQuerySchema,\n} from './agent-runtime-config.js';\nexport {type CheckoutIntentDto, checkoutIntentSchema} from './checkout.js';\nexport {\n type CheckoutTokenAuthDto,\n type CheckoutTokenResponseDto,\n checkoutTokenAuthSchema,\n checkoutTokenResponseSchema,\n} from './checkout-token.js';\nexport {\n type JobDto,\n type JobStatusDto,\n type JobStatusReasonDto,\n jobDtoSchema,\n jobStatusReasonSchema,\n jobStatusSchema,\n} from './job.js';\nexport {\n type NextStepResponseDto,\n nextStepResponseSchema,\n type ReportStepBodyDto,\n type ReportStepResponseDto,\n reportStepBodySchema,\n reportStepResponseSchema,\n STEP_RESPONSE_MAX_LENGTH,\n} from './job-execution.js';\nexport {\n type JobListeningDto,\n type JobModeDto,\n jobListeningBatchSchema,\n jobListeningSchema,\n jobModeSchema,\n type ListenerStatusDto,\n type ListeningTriggerDto,\n listenerStatusSchema,\n listeningTriggerSchema,\n type ResolutionReasonDto,\n resolutionReasonSchema,\n type TriggerEventsBatchDto,\n triggerEventsBatchSchema,\n type WorkflowExecutionContextDto,\n type WorkflowExecutionEventDto,\n workflowExecutionContextSchema,\n workflowExecutionEventSchema,\n} from './job-listening.js';\nexport {type LogOutcomeDto, logOutcomeSchema} from './log-outcome.js';\nexport {\n type AgentConfigIssueDto,\n agentConfigIssueSchema,\n STEP_ERROR_MESSAGE_MAX_LENGTH,\n type StepAttemptDto,\n type StepDto,\n type StepErrorCategoryDto,\n type StepErrorDto,\n type StepErrorReasonDto,\n type StepGateResultDto,\n stepAttemptDtoSchema,\n stepDtoSchema,\n stepErrorCategorySchema,\n stepErrorDtoSchema,\n stepErrorReasonSchema,\n stepGateResultDtoSchema,\n} from './step.js';\nexport {\n type RerunWorkflowRunBodyDto,\n rerunWorkflowRunBodySchema,\n type WorkflowRunAggregatesQueryDto,\n type WorkflowRunAggregatesResponseDto,\n type WorkflowRunAttemptDto,\n type WorkflowRunAttemptsResponseDto,\n type WorkflowRunDto,\n type WorkflowRunListQueryDto,\n type WorkflowRunListResponseDto,\n type WorkflowRunRerunModeDto,\n type WorkflowRunResponseDto,\n type WorkflowRunStatusDto,\n type WorkflowSourceSnapshotDto,\n workflowRunAggregatesQuerySchema,\n workflowRunAggregatesResponseSchema,\n workflowRunAttemptDtoSchema,\n workflowRunAttemptsResponseSchema,\n workflowRunDtoSchema,\n workflowRunListQuerySchema,\n workflowRunListResponseSchema,\n workflowRunRerunModeSchema,\n workflowRunResponseSchema,\n workflowRunStatusSchema,\n workflowSourceSnapshotSchema,\n} from './workflow-run.js';\nexport {\n type JobExecutionDto,\n jobExecutionDtoSchema,\n jobExecutionStatusSchema,\n type WorkflowRunDetailResponseDto,\n type WorkflowRunJobDetailDto,\n type WorkflowRunJobExecutionDetailDto,\n type WorkflowRunStepDetailDto,\n workflowRunDetailResponseSchema,\n workflowRunJobDetailDtoSchema,\n workflowRunJobExecutionDetailDtoSchema,\n workflowRunStepDetailDtoSchema,\n} from './workflow-run-detail.js';\n"],"names":["agentRuntimeConfigQuerySchema","checkoutIntentSchema","checkoutTokenAuthSchema","checkoutTokenResponseSchema","jobDtoSchema","jobStatusReasonSchema","jobStatusSchema","nextStepResponseSchema","reportStepBodySchema","reportStepResponseSchema","STEP_RESPONSE_MAX_LENGTH","jobListeningBatchSchema","jobListeningSchema","jobModeSchema","listenerStatusSchema","listeningTriggerSchema","resolutionReasonSchema","triggerEventsBatchSchema","workflowExecutionContextSchema","workflowExecutionEventSchema","logOutcomeSchema","agentConfigIssueSchema","STEP_ERROR_MESSAGE_MAX_LENGTH","stepAttemptDtoSchema","stepDtoSchema","stepErrorCategorySchema","stepErrorDtoSchema","stepErrorReasonSchema","stepGateResultDtoSchema","rerunWorkflowRunBodySchema","workflowRunAggregatesQuerySchema","workflowRunAggregatesResponseSchema","workflowRunAttemptDtoSchema","workflowRunAttemptsResponseSchema","workflowRunDtoSchema","workflowRunListQuerySchema","workflowRunListResponseSchema","workflowRunRerunModeSchema","workflowRunResponseSchema","workflowRunStatusSchema","workflowSourceSnapshotSchema","jobExecutionDtoSchema","jobExecutionStatusSchema","workflowRunDetailResponseSchema","workflowRunJobDetailDtoSchema","workflowRunJobExecutionDetailDtoSchema","workflowRunStepDetailDtoSchema"],"mappings":"AAAA,SAEEA,6BAA6B,QACxB,4BAA4B;AACnC,SAAgCC,oBAAoB,QAAO,gBAAgB;AAC3E,SAGEC,uBAAuB,EACvBC,2BAA2B,QACtB,sBAAsB;AAC7B,SAIEC,YAAY,EACZC,qBAAqB,EACrBC,eAAe,QACV,WAAW;AAClB,SAEEC,sBAAsB,EAGtBC,oBAAoB,EACpBC,wBAAwB,EACxBC,wBAAwB,QACnB,qBAAqB;AAC5B,SAGEC,uBAAuB,EACvBC,kBAAkB,EAClBC,aAAa,EAGbC,oBAAoB,EACpBC,sBAAsB,EAEtBC,sBAAsB,EAEtBC,wBAAwB,EAGxBC,8BAA8B,EAC9BC,4BAA4B,QACvB,qBAAqB;AAC5B,SAA4BC,gBAAgB,QAAO,mBAAmB;AACtE,SAEEC,sBAAsB,EACtBC,6BAA6B,EAO7BC,oBAAoB,EACpBC,aAAa,EACbC,uBAAuB,EACvBC,kBAAkB,EAClBC,qBAAqB,EACrBC,uBAAuB,QAClB,YAAY;AACnB,SAEEC,0BAA0B,EAY1BC,gCAAgC,EAChCC,mCAAmC,EACnCC,2BAA2B,EAC3BC,iCAAiC,EACjCC,oBAAoB,EACpBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,yBAAyB,EACzBC,uBAAuB,EACvBC,4BAA4B,QACvB,oBAAoB;AAC3B,SAEEC,qBAAqB,EACrBC,wBAAwB,EAKxBC,+BAA+B,EAC/BC,6BAA6B,EAC7BC,sCAAsC,EACtCC,8BAA8B,QACzB,2BAA2B"}
@@ -0,0 +1,116 @@
1
+ import { z } from 'zod';
2
+ export declare const STEP_RESPONSE_MAX_LENGTH: number;
3
+ /**
4
+ * The job to progress is identified by the caller's lease-token claims, never by
5
+ * the request. An unknown job is a 404, not a `done`.
6
+ */
7
+ export declare const nextStepResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ kind: z.ZodLiteral<"step">;
9
+ step: z.ZodObject<{
10
+ id: z.ZodString;
11
+ job_execution_id: z.ZodString;
12
+ key: z.ZodNullable<z.ZodString>;
13
+ name: z.ZodString;
14
+ source_location: z.ZodNullable<z.ZodObject<{
15
+ start_line: z.ZodNumber;
16
+ end_line: z.ZodNumber;
17
+ }, z.core.$strip>>;
18
+ status: z.ZodString;
19
+ type: z.ZodString;
20
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
21
+ error: z.ZodNullable<z.ZodObject<{
22
+ message: z.ZodString;
23
+ exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
24
+ signal: z.ZodOptional<z.ZodString>;
25
+ reason: z.ZodOptional<z.ZodEnum<{
26
+ checkout_failed: "checkout_failed";
27
+ checkout_auth_failed: "checkout_auth_failed";
28
+ checkout_unavailable: "checkout_unavailable";
29
+ git_unavailable: "git_unavailable";
30
+ workspace_prep_failed: "workspace_prep_failed";
31
+ setup_aborted: "setup_aborted";
32
+ config_unresolvable: "config_unresolvable";
33
+ output_invalid: "output_invalid";
34
+ agent_config_invalid: "agent_config_invalid";
35
+ agent_invocation_failed: "agent_invocation_failed";
36
+ }>>;
37
+ field: z.ZodOptional<z.ZodString>;
38
+ source: z.ZodOptional<z.ZodString>;
39
+ agent_config_issue: z.ZodOptional<z.ZodEnum<{
40
+ step_config_invalid: "step_config_invalid";
41
+ provider_not_configured: "provider_not_configured";
42
+ provider_unsupported: "provider_unsupported";
43
+ model_unavailable: "model_unavailable";
44
+ credentials_invalid: "credentials_invalid";
45
+ }>>;
46
+ category: z.ZodOptional<z.ZodEnum<{
47
+ setup: "setup";
48
+ user: "user";
49
+ }>>;
50
+ }, z.core.$strip>>;
51
+ position: z.ZodNumber;
52
+ current_attempt: z.ZodNumber;
53
+ created_at: z.ZodString;
54
+ updated_at: z.ZodString;
55
+ }, z.core.$strip>;
56
+ attempt: z.ZodNumber;
57
+ lease_token: z.ZodString;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ kind: z.ZodLiteral<"done">;
60
+ status: z.ZodEnum<{
61
+ succeeded: "succeeded";
62
+ failed: "failed";
63
+ }>;
64
+ }, z.core.$strip>], "kind">;
65
+ export type NextStepResponseDto = z.infer<typeof nextStepResponseSchema>;
66
+ export declare const reportStepBodySchema: z.ZodObject<{
67
+ status: z.ZodEnum<{
68
+ succeeded: "succeeded";
69
+ failed: "failed";
70
+ }>;
71
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
72
+ message: z.ZodString;
73
+ exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
74
+ signal: z.ZodOptional<z.ZodString>;
75
+ reason: z.ZodOptional<z.ZodEnum<{
76
+ checkout_failed: "checkout_failed";
77
+ checkout_auth_failed: "checkout_auth_failed";
78
+ checkout_unavailable: "checkout_unavailable";
79
+ git_unavailable: "git_unavailable";
80
+ workspace_prep_failed: "workspace_prep_failed";
81
+ setup_aborted: "setup_aborted";
82
+ config_unresolvable: "config_unresolvable";
83
+ output_invalid: "output_invalid";
84
+ agent_config_invalid: "agent_config_invalid";
85
+ agent_invocation_failed: "agent_invocation_failed";
86
+ }>>;
87
+ field: z.ZodOptional<z.ZodString>;
88
+ source: z.ZodOptional<z.ZodString>;
89
+ agent_config_issue: z.ZodOptional<z.ZodEnum<{
90
+ step_config_invalid: "step_config_invalid";
91
+ provider_not_configured: "provider_not_configured";
92
+ provider_unsupported: "provider_unsupported";
93
+ model_unavailable: "model_unavailable";
94
+ credentials_invalid: "credentials_invalid";
95
+ }>>;
96
+ category: z.ZodOptional<z.ZodEnum<{
97
+ setup: "setup";
98
+ user: "user";
99
+ }>>;
100
+ }, z.core.$strip>>>;
101
+ attempt: z.ZodOptional<z.ZodNumber>;
102
+ exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
103
+ output: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
104
+ response: z.ZodOptional<z.ZodString>;
105
+ log_outcome: z.ZodEnum<{
106
+ drained: "drained";
107
+ abandoned: "abandoned";
108
+ }>;
109
+ }, z.core.$strip>;
110
+ export type ReportStepBodyDto = z.infer<typeof reportStepBodySchema>;
111
+ export declare const reportStepResponseSchema: z.ZodObject<{
112
+ ok: z.ZodBoolean;
113
+ cancel: z.ZodBoolean;
114
+ }, z.core.$strip>;
115
+ export type ReportStepResponseDto = z.infer<typeof reportStepResponseSchema>;
116
+ //# sourceMappingURL=job-execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-execution.d.ts","sourceRoot":"","sources":["../../src/schemas/job-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,wBAAwB,QAAW,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAwBjC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwC7B,CAAC;AAEL,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,eAAO,MAAM,wBAAwB;;;iBAOnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import { logOutcomeSchema } from './log-outcome.js';
3
+ import { stepDtoSchema, stepErrorDtoSchema } from './step.js';
4
+ export const STEP_RESPONSE_MAX_LENGTH = 8 * 1024;
5
+ /**
6
+ * The job to progress is identified by the caller's lease-token claims, never by
7
+ * the request. An unknown job is a 404, not a `done`.
8
+ */ export const nextStepResponseSchema = z.discriminatedUnion('kind', [
9
+ z.object({
10
+ kind: z.literal('step'),
11
+ step: stepDtoSchema,
12
+ attempt: z.number().int().positive().describe('Attempt number for this step dispatch. Echo it back when reporting the step result so stale reports from older attempts can be ignored.'),
13
+ lease_token: z.string().min(1).describe('Job-lease token re-scoped to this dispatched step attempt. The runner presents it as its lease for log-append authorization and carries it on later step requests.')
14
+ }),
15
+ z.object({
16
+ kind: z.literal('done'),
17
+ status: z.enum([
18
+ 'succeeded',
19
+ 'failed'
20
+ ]).describe('Terminal status of the job when no step remains to run.')
21
+ })
22
+ ]);
23
+ export const reportStepBodySchema = z.object({
24
+ status: z.enum([
25
+ 'succeeded',
26
+ 'failed'
27
+ ]).describe('Final status reported for the step attempt.'),
28
+ error: stepErrorDtoSchema.optional().describe('Failure details. Required when status is failed.'),
29
+ attempt: z.number().int().positive().optional().describe('Attempt number echoed from next-step. Older runners may omit it; when present, it protects the workflow from stale reports.'),
30
+ exit_code: z.number().int().nullable().optional().describe('Process exit code for the step attempt. Persisted as the canonical attempt exit code and used by gate evaluation.'),
31
+ output: z.record(z.string(), z.unknown()).nullable().optional().describe('Structured output captured for attempt history. Large textual logs are stored separately.'),
32
+ response: z.string().max(STEP_RESPONSE_MAX_LENGTH).optional().describe('Capped final assistant response for agent step attempts. Omitted for run steps.'),
33
+ log_outcome: logOutcomeSchema.describe('Whether the runner drained all locally spooled logs before reporting, or abandoned the log stream for backend closure.')
34
+ }).refine((body)=>body.status === 'succeeded' ? body.error == null : body.error != null, {
35
+ message: 'succeeded steps must not include an error and failed steps must include one'
36
+ });
37
+ export const reportStepResponseSchema = z.object({
38
+ ok: z.boolean().describe('Whether the step report was accepted.'),
39
+ cancel: z.boolean().describe('Whether the runner should stop working on the job because it finished without full success.')
40
+ });
41
+
42
+ //# sourceMappingURL=job-execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/job-execution.ts"],"sourcesContent":["import {z} from 'zod';\nimport {logOutcomeSchema} from './log-outcome.js';\nimport {stepDtoSchema, stepErrorDtoSchema} from './step.js';\n\nexport const STEP_RESPONSE_MAX_LENGTH = 8 * 1024;\n\n/**\n * The job to progress is identified by the caller's lease-token claims, never by\n * the request. An unknown job is a 404, not a `done`.\n */\nexport const nextStepResponseSchema = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('step'),\n step: stepDtoSchema,\n attempt: z\n .number()\n .int()\n .positive()\n .describe(\n 'Attempt number for this step dispatch. Echo it back when reporting the step result so stale reports from older attempts can be ignored.',\n ),\n lease_token: z\n .string()\n .min(1)\n .describe(\n 'Job-lease token re-scoped to this dispatched step attempt. The runner presents it as its lease for log-append authorization and carries it on later step requests.',\n ),\n }),\n z.object({\n kind: z.literal('done'),\n status: z\n .enum(['succeeded', 'failed'])\n .describe('Terminal status of the job when no step remains to run.'),\n }),\n]);\n\nexport type NextStepResponseDto = z.infer<typeof nextStepResponseSchema>;\n\nexport const reportStepBodySchema = z\n .object({\n status: z.enum(['succeeded', 'failed']).describe('Final status reported for the step attempt.'),\n error: stepErrorDtoSchema\n .optional()\n .describe('Failure details. Required when status is failed.'),\n attempt: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Attempt number echoed from next-step. Older runners may omit it; when present, it protects the workflow from stale reports.',\n ),\n exit_code: z\n .number()\n .int()\n .nullable()\n .optional()\n .describe(\n 'Process exit code for the step attempt. Persisted as the canonical attempt exit code and used by gate evaluation.',\n ),\n output: z\n .record(z.string(), z.unknown())\n .nullable()\n .optional()\n .describe(\n 'Structured output captured for attempt history. Large textual logs are stored separately.',\n ),\n response: z\n .string()\n .max(STEP_RESPONSE_MAX_LENGTH)\n .optional()\n .describe('Capped final assistant response for agent step attempts. Omitted for run steps.'),\n log_outcome: logOutcomeSchema.describe(\n 'Whether the runner drained all locally spooled logs before reporting, or abandoned the log stream for backend closure.',\n ),\n })\n .refine((body) => (body.status === 'succeeded' ? body.error == null : body.error != null), {\n message: 'succeeded steps must not include an error and failed steps must include one',\n });\n\nexport type ReportStepBodyDto = z.infer<typeof reportStepBodySchema>;\n\nexport const reportStepResponseSchema = z.object({\n ok: z.boolean().describe('Whether the step report was accepted.'),\n cancel: z\n .boolean()\n .describe(\n 'Whether the runner should stop working on the job because it finished without full success.',\n ),\n});\n\nexport type ReportStepResponseDto = z.infer<typeof reportStepResponseSchema>;\n"],"names":["z","logOutcomeSchema","stepDtoSchema","stepErrorDtoSchema","STEP_RESPONSE_MAX_LENGTH","nextStepResponseSchema","discriminatedUnion","object","kind","literal","step","attempt","number","int","positive","describe","lease_token","string","min","status","enum","reportStepBodySchema","error","optional","exit_code","nullable","output","record","unknown","response","max","log_outcome","refine","body","message","reportStepResponseSchema","ok","boolean","cancel"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,gBAAgB,QAAO,mBAAmB;AAClD,SAAQC,aAAa,EAAEC,kBAAkB,QAAO,YAAY;AAE5D,OAAO,MAAMC,2BAA2B,IAAI,KAAK;AAEjD;;;CAGC,GACD,OAAO,MAAMC,yBAAyBL,EAAEM,kBAAkB,CAAC,QAAQ;IACjEN,EAAEO,MAAM,CAAC;QACPC,MAAMR,EAAES,OAAO,CAAC;QAChBC,MAAMR;QACNS,SAASX,EACNY,MAAM,GACNC,GAAG,GACHC,QAAQ,GACRC,QAAQ,CACP;QAEJC,aAAahB,EACViB,MAAM,GACNC,GAAG,CAAC,GACJH,QAAQ,CACP;IAEN;IACAf,EAAEO,MAAM,CAAC;QACPC,MAAMR,EAAES,OAAO,CAAC;QAChBU,QAAQnB,EACLoB,IAAI,CAAC;YAAC;YAAa;SAAS,EAC5BL,QAAQ,CAAC;IACd;CACD,EAAE;AAIH,OAAO,MAAMM,uBAAuBrB,EACjCO,MAAM,CAAC;IACNY,QAAQnB,EAAEoB,IAAI,CAAC;QAAC;QAAa;KAAS,EAAEL,QAAQ,CAAC;IACjDO,OAAOnB,mBACJoB,QAAQ,GACRR,QAAQ,CAAC;IACZJ,SAASX,EACNY,MAAM,GACNC,GAAG,GACHC,QAAQ,GACRS,QAAQ,GACRR,QAAQ,CACP;IAEJS,WAAWxB,EACRY,MAAM,GACNC,GAAG,GACHY,QAAQ,GACRF,QAAQ,GACRR,QAAQ,CACP;IAEJW,QAAQ1B,EACL2B,MAAM,CAAC3B,EAAEiB,MAAM,IAAIjB,EAAE4B,OAAO,IAC5BH,QAAQ,GACRF,QAAQ,GACRR,QAAQ,CACP;IAEJc,UAAU7B,EACPiB,MAAM,GACNa,GAAG,CAAC1B,0BACJmB,QAAQ,GACRR,QAAQ,CAAC;IACZgB,aAAa9B,iBAAiBc,QAAQ,CACpC;AAEJ,GACCiB,MAAM,CAAC,CAACC,OAAUA,KAAKd,MAAM,KAAK,cAAcc,KAAKX,KAAK,IAAI,OAAOW,KAAKX,KAAK,IAAI,MAAO;IACzFY,SAAS;AACX,GAAG;AAIL,OAAO,MAAMC,2BAA2BnC,EAAEO,MAAM,CAAC;IAC/C6B,IAAIpC,EAAEqC,OAAO,GAAGtB,QAAQ,CAAC;IACzBuB,QAAQtC,EACLqC,OAAO,GACPtB,QAAQ,CACP;AAEN,GAAG"}
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ export declare const jobModeSchema: z.ZodEnum<{
3
+ one_shot: "one_shot";
4
+ listening: "listening";
5
+ }>;
6
+ export declare const listenerStatusSchema: z.ZodEnum<{
7
+ listening: "listening";
8
+ inactive: "inactive";
9
+ resolved: "resolved";
10
+ }>;
11
+ export declare const resolutionReasonSchema: z.ZodEnum<{
12
+ until: "until";
13
+ timeout: "timeout";
14
+ max_executions: "max_executions";
15
+ cancelled: "cancelled";
16
+ }>;
17
+ export declare const listeningTriggerSchema: z.ZodObject<{
18
+ source: z.ZodString;
19
+ event: z.ZodString;
20
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
21
+ filter: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ export declare const jobListeningBatchSchema: z.ZodObject<{
24
+ debounce_ms: z.ZodOptional<z.ZodNumber>;
25
+ max_size: z.ZodOptional<z.ZodNumber>;
26
+ max_wait_ms: z.ZodOptional<z.ZodNumber>;
27
+ }, z.core.$strip>;
28
+ export declare const jobListeningSchema: z.ZodObject<{
29
+ on: z.ZodArray<z.ZodObject<{
30
+ source: z.ZodString;
31
+ event: z.ZodString;
32
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
33
+ filter: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>>;
35
+ until: z.ZodNullable<z.ZodArray<z.ZodObject<{
36
+ source: z.ZodString;
37
+ event: z.ZodString;
38
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
39
+ filter: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>>>;
41
+ timeout_ms: z.ZodNullable<z.ZodNumber>;
42
+ max_executions: z.ZodNullable<z.ZodNumber>;
43
+ batch: z.ZodNullable<z.ZodObject<{
44
+ debounce_ms: z.ZodOptional<z.ZodNumber>;
45
+ max_size: z.ZodOptional<z.ZodNumber>;
46
+ max_wait_ms: z.ZodOptional<z.ZodNumber>;
47
+ }, z.core.$strip>>;
48
+ on_resolve: z.ZodEnum<{
49
+ finish: "finish";
50
+ cancel: "cancel";
51
+ }>;
52
+ execution_timeout_ms: z.ZodNullable<z.ZodNumber>;
53
+ name: z.ZodNullable<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ export declare const workflowExecutionEventSchema: z.ZodObject<{
56
+ source: z.ZodString;
57
+ event: z.ZodString;
58
+ delivery_id: z.ZodString;
59
+ received_at: z.ZodString;
60
+ data: z.ZodUnknown;
61
+ }, z.core.$strip>;
62
+ export declare const workflowExecutionContextSchema: z.ZodObject<{
63
+ index: z.ZodNumber;
64
+ name: z.ZodString;
65
+ status: z.ZodString;
66
+ started_at: z.ZodNullable<z.ZodString>;
67
+ finished_at: z.ZodNullable<z.ZodString>;
68
+ events: z.ZodArray<z.ZodObject<{
69
+ source: z.ZodString;
70
+ event: z.ZodString;
71
+ delivery_id: z.ZodString;
72
+ received_at: z.ZodString;
73
+ data: z.ZodUnknown;
74
+ }, z.core.$strip>>;
75
+ }, z.core.$strip>;
76
+ export declare const triggerEventsBatchSchema: z.ZodObject<{
77
+ events: z.ZodArray<z.ZodObject<{
78
+ source: z.ZodString;
79
+ event: z.ZodString;
80
+ delivery_id: z.ZodString;
81
+ received_at: z.ZodString;
82
+ data: z.ZodUnknown;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
85
+ export type JobModeDto = z.infer<typeof jobModeSchema>;
86
+ export type ListenerStatusDto = z.infer<typeof listenerStatusSchema>;
87
+ export type ResolutionReasonDto = z.infer<typeof resolutionReasonSchema>;
88
+ export type ListeningTriggerDto = z.infer<typeof listeningTriggerSchema>;
89
+ export type JobListeningDto = z.infer<typeof jobListeningSchema>;
90
+ export type WorkflowExecutionEventDto = z.infer<typeof workflowExecutionEventSchema>;
91
+ export type WorkflowExecutionContextDto = z.infer<typeof workflowExecutionContextSchema>;
92
+ export type TriggerEventsBatchDto = z.infer<typeof triggerEventsBatchSchema>;
93
+ //# sourceMappingURL=job-listening.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-listening.d.ts","sourceRoot":"","sources":["../../src/schemas/job-listening.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,aAAa;;;EAAoC,CAAC;AAC/D,eAAO,MAAM,oBAAoB;;;;EAAgD,CAAC;AAClF,eAAO,MAAM,sBAAsB;;;;;EAA8D,CAAC;AAElG,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS7B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;iBAMvC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;iBAOzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;iBAEnC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACjE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACrF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACzF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { z } from 'zod';
2
+ export const jobModeSchema = z.enum([
3
+ 'one_shot',
4
+ 'listening'
5
+ ]);
6
+ export const listenerStatusSchema = z.enum([
7
+ 'inactive',
8
+ 'listening',
9
+ 'resolved'
10
+ ]);
11
+ export const resolutionReasonSchema = z.enum([
12
+ 'until',
13
+ 'timeout',
14
+ 'max_executions',
15
+ 'cancelled'
16
+ ]);
17
+ export const listeningTriggerSchema = z.object({
18
+ source: z.string(),
19
+ event: z.string(),
20
+ inputs: z.record(z.string(), z.unknown()).optional(),
21
+ filter: z.string().optional()
22
+ });
23
+ export const jobListeningBatchSchema = z.object({
24
+ debounce_ms: z.number().int().positive().optional(),
25
+ max_size: z.number().int().positive().optional(),
26
+ max_wait_ms: z.number().int().positive().optional()
27
+ });
28
+ export const jobListeningSchema = z.object({
29
+ on: z.array(listeningTriggerSchema).min(1),
30
+ until: z.array(listeningTriggerSchema).min(1).nullable(),
31
+ timeout_ms: z.number().int().positive().nullable(),
32
+ max_executions: z.number().int().positive().nullable(),
33
+ batch: jobListeningBatchSchema.nullable(),
34
+ on_resolve: z.enum([
35
+ 'finish',
36
+ 'cancel'
37
+ ]),
38
+ execution_timeout_ms: z.number().int().positive().nullable(),
39
+ name: z.string().nullable()
40
+ });
41
+ export const workflowExecutionEventSchema = z.object({
42
+ source: z.string(),
43
+ event: z.string(),
44
+ delivery_id: z.string(),
45
+ received_at: z.string(),
46
+ data: z.unknown()
47
+ });
48
+ export const workflowExecutionContextSchema = z.object({
49
+ index: z.number().int().nonnegative(),
50
+ name: z.string(),
51
+ status: z.string(),
52
+ started_at: z.string().nullable(),
53
+ finished_at: z.string().nullable(),
54
+ events: z.array(workflowExecutionEventSchema)
55
+ });
56
+ export const triggerEventsBatchSchema = z.object({
57
+ events: z.array(workflowExecutionEventSchema)
58
+ });
59
+
60
+ //# sourceMappingURL=job-listening.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/job-listening.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const jobModeSchema = z.enum(['one_shot', 'listening']);\nexport const listenerStatusSchema = z.enum(['inactive', 'listening', 'resolved']);\nexport const resolutionReasonSchema = z.enum(['until', 'timeout', 'max_executions', 'cancelled']);\n\nexport const listeningTriggerSchema = z.object({\n source: z.string(),\n event: z.string(),\n inputs: z.record(z.string(), z.unknown()).optional(),\n filter: z.string().optional(),\n});\n\nexport const jobListeningBatchSchema = z.object({\n debounce_ms: z.number().int().positive().optional(),\n max_size: z.number().int().positive().optional(),\n max_wait_ms: z.number().int().positive().optional(),\n});\n\nexport const jobListeningSchema = z.object({\n on: z.array(listeningTriggerSchema).min(1),\n until: z.array(listeningTriggerSchema).min(1).nullable(),\n timeout_ms: z.number().int().positive().nullable(),\n max_executions: z.number().int().positive().nullable(),\n batch: jobListeningBatchSchema.nullable(),\n on_resolve: z.enum(['finish', 'cancel']),\n execution_timeout_ms: z.number().int().positive().nullable(),\n name: z.string().nullable(),\n});\n\nexport const workflowExecutionEventSchema = z.object({\n source: z.string(),\n event: z.string(),\n delivery_id: z.string(),\n received_at: z.string(),\n data: z.unknown(),\n});\n\nexport const workflowExecutionContextSchema = z.object({\n index: z.number().int().nonnegative(),\n name: z.string(),\n status: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n events: z.array(workflowExecutionEventSchema),\n});\n\nexport const triggerEventsBatchSchema = z.object({\n events: z.array(workflowExecutionEventSchema),\n});\n\nexport type JobModeDto = z.infer<typeof jobModeSchema>;\nexport type ListenerStatusDto = z.infer<typeof listenerStatusSchema>;\nexport type ResolutionReasonDto = z.infer<typeof resolutionReasonSchema>;\nexport type ListeningTriggerDto = z.infer<typeof listeningTriggerSchema>;\nexport type JobListeningDto = z.infer<typeof jobListeningSchema>;\nexport type WorkflowExecutionEventDto = z.infer<typeof workflowExecutionEventSchema>;\nexport type WorkflowExecutionContextDto = z.infer<typeof workflowExecutionContextSchema>;\nexport type TriggerEventsBatchDto = z.infer<typeof triggerEventsBatchSchema>;\n"],"names":["z","jobModeSchema","enum","listenerStatusSchema","resolutionReasonSchema","listeningTriggerSchema","object","source","string","event","inputs","record","unknown","optional","filter","jobListeningBatchSchema","debounce_ms","number","int","positive","max_size","max_wait_ms","jobListeningSchema","on","array","min","until","nullable","timeout_ms","max_executions","batch","on_resolve","execution_timeout_ms","name","workflowExecutionEventSchema","delivery_id","received_at","data","workflowExecutionContextSchema","index","nonnegative","status","started_at","finished_at","events","triggerEventsBatchSchema"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,gBAAgBD,EAAEE,IAAI,CAAC;IAAC;IAAY;CAAY,EAAE;AAC/D,OAAO,MAAMC,uBAAuBH,EAAEE,IAAI,CAAC;IAAC;IAAY;IAAa;CAAW,EAAE;AAClF,OAAO,MAAME,yBAAyBJ,EAAEE,IAAI,CAAC;IAAC;IAAS;IAAW;IAAkB;CAAY,EAAE;AAElG,OAAO,MAAMG,yBAAyBL,EAAEM,MAAM,CAAC;IAC7CC,QAAQP,EAAEQ,MAAM;IAChBC,OAAOT,EAAEQ,MAAM;IACfE,QAAQV,EAAEW,MAAM,CAACX,EAAEQ,MAAM,IAAIR,EAAEY,OAAO,IAAIC,QAAQ;IAClDC,QAAQd,EAAEQ,MAAM,GAAGK,QAAQ;AAC7B,GAAG;AAEH,OAAO,MAAME,0BAA0Bf,EAAEM,MAAM,CAAC;IAC9CU,aAAahB,EAAEiB,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGN,QAAQ;IACjDO,UAAUpB,EAAEiB,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGN,QAAQ;IAC9CQ,aAAarB,EAAEiB,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGN,QAAQ;AACnD,GAAG;AAEH,OAAO,MAAMS,qBAAqBtB,EAAEM,MAAM,CAAC;IACzCiB,IAAIvB,EAAEwB,KAAK,CAACnB,wBAAwBoB,GAAG,CAAC;IACxCC,OAAO1B,EAAEwB,KAAK,CAACnB,wBAAwBoB,GAAG,CAAC,GAAGE,QAAQ;IACtDC,YAAY5B,EAAEiB,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGQ,QAAQ;IAChDE,gBAAgB7B,EAAEiB,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGQ,QAAQ;IACpDG,OAAOf,wBAAwBY,QAAQ;IACvCI,YAAY/B,EAAEE,IAAI,CAAC;QAAC;QAAU;KAAS;IACvC8B,sBAAsBhC,EAAEiB,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGQ,QAAQ;IAC1DM,MAAMjC,EAAEQ,MAAM,GAAGmB,QAAQ;AAC3B,GAAG;AAEH,OAAO,MAAMO,+BAA+BlC,EAAEM,MAAM,CAAC;IACnDC,QAAQP,EAAEQ,MAAM;IAChBC,OAAOT,EAAEQ,MAAM;IACf2B,aAAanC,EAAEQ,MAAM;IACrB4B,aAAapC,EAAEQ,MAAM;IACrB6B,MAAMrC,EAAEY,OAAO;AACjB,GAAG;AAEH,OAAO,MAAM0B,iCAAiCtC,EAAEM,MAAM,CAAC;IACrDiC,OAAOvC,EAAEiB,MAAM,GAAGC,GAAG,GAAGsB,WAAW;IACnCP,MAAMjC,EAAEQ,MAAM;IACdiC,QAAQzC,EAAEQ,MAAM;IAChBkC,YAAY1C,EAAEQ,MAAM,GAAGmB,QAAQ;IAC/BgB,aAAa3C,EAAEQ,MAAM,GAAGmB,QAAQ;IAChCiB,QAAQ5C,EAAEwB,KAAK,CAACU;AAClB,GAAG;AAEH,OAAO,MAAMW,2BAA2B7C,EAAEM,MAAM,CAAC;IAC/CsC,QAAQ5C,EAAEwB,KAAK,CAACU;AAClB,GAAG"}