@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,2 @@
1
+ $ shipfox-swc
2
+ Successfully compiled: 13 files with swc (44.11ms)
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-emit
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-check
package/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # @shipfox/api-workflows-dto
2
+
3
+ ## 2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1b0d344: Publishes the complete API runtime closure with packed-consumer-safe internal imports and records its exact package set in application releases.
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5c18360: Durable gate restart: a failing gate's `on_failure.restart_from` now records the failed attempt, rewinds the job's step projection from the named earlier step back to pending (opening fresh attempts), and leaves the job running so it re-executes from there — all in one transaction with the report. A per-step attempt cap (default 3) bounds restart loops, exhausting to a `restart_exhausted` failure. Adds the `workflows.step.restart_enqueued` event.
14
+ - 7a9943d: Adds the backend contract for per-step execution: job claims mint a lease token for the step API, step reports carry attempts and exit codes, and workflow completion can be signalled through the workflows outbox. The runner-side step loop is intentionally owned by the follow-up runner protocol work.
15
+ - 736249b: Expose step attempts in the read API: the run-detail endpoint now returns `current_attempt` on each step plus its per-attempt history (`attempts[]`, with status, exit code, gate result and restart reason), so a restarted step's attempts are visible.
16
+ - 2bc5595: Adds workflow-run cancellation across the API, orchestration queue cleanup, event contract, and run-page cancel action.
17
+ - 940696a: Adds the credential-free checkout intent type and a checkout-token response DTO (basic/bearer auth with a validated expiry) to the Orchestration DTO package, establishing the contract for runner-managed repository checkouts over the lease-scoped checkout flow.
18
+ - e9396c9: Give every runner-dispatched job a synthetic "Set up job" step at position 0 (à la GitHub Actions), so failures that happen around the user steps — workspace preparation today, the repository checkout next — are reported through the existing per-step protocol instead of hanging the job until the lease/timeout fires. The runner prepares the per-job workspace inside this step and reports the outcome; a failed setup flows through the existing fail-job cascade, finalizing the job `failed` in seconds with no user step run.
19
+
20
+ Extends `stepErrorDtoSchema` with an optional machine-readable `reason` (`workspace_prep_failed`, `git_unavailable`, `checkout_*`, `setup_aborted`) and a `category` (`setup` | `user`). The runner reports `reason`; the server derives `category` from the step type on read (the runner is an untrusted boundary). The restart resolver now skips the synthetic step so a user step named "Set up job" can never rewind setup mid-job.
21
+
22
+ - 3afb7e3: Adds job execution success expressions and execution timeouts to workflow documents.
23
+ Renames job execution IDs in auth, runner, workflow, and timeout event contracts to the explicit `jobExecutionId` / `job_execution_id` shape.
24
+ - c652a68: Add a single reliable job-terminal event: `workflows.job.terminated` is now written in the same transaction as every terminal job-status flip (normal completion, DAG cancellation, lease-expiry resolution, and timeout), and the run-level `workflows.workflow_run.terminated` is emitted the same way. All workflows event names are aligned on one `WORKFLOWS_<entity>_<verb>` scheme, so the run and job terminal events read as the same event at two scopes.
25
+
26
+ Internal breaking change (`WORKFLOWS_JOB_COMPLETED` → `WORKFLOWS_JOB_STEPS_SETTLED`, `WORKFLOW_RUN_*` → `WORKFLOWS_WORKFLOW_RUN_*`, with matching DTO type renames) consumed only within this monorepo.
27
+
28
+ - c0a883c: Adds the runner-facing per-step endpoints (`POST /runs/jobs/current/steps/next` and `/steps/:stepId/report`) authed by a locally-verified job lease token, with the matching request/response schemas.
29
+ - d69b164: Adds workflow run attempt lineage APIs and a run summary switcher for navigating rerun attempts.
30
+ - e699508: Adds first-class skipped workflow jobs with persisted status reasons across API DTOs, orchestration, events, and client run views.
31
+
32
+ ### Patch Changes
33
+
34
+ - eb40964: Add an inline `agent` workflow step that the runner runs with the pi harness. A step is an agent step when it carries `model` + `prompt` and no `run`; it takes a free-text `model`, a single `prompt`, and an optional `thinking` level (default `high`). The step runs to process-success (the agent ran to completion) and reports through the existing step protocol with no runner/backend protocol change, so change quality is judged by a downstream `run` + `gate` step. v1 does not persist the agent's work (no diff, commit, or PR).
35
+ - c17dd6e: Adds run-step output emission through `$SHIPFOX_OUTPUT` with runner-side parsing, caps, masking, and report plumbing.
36
+ - f98c2be: [api/workflows] Add the lease-authed `POST /runs/jobs/current/checkout-token` endpoint. The runner exchanges its job lease for short-lived, read-only repository checkout credentials. The job's checkout intent is resolved server-side from the authoritative `jobId` claim (`job -> run -> project` source metadata) and minted on demand via the integration service's `createCheckoutSpec()`; no credential material is ever stored on the job/run or queued. `checkoutTokenResponseSchema.auth` stays optional so credential-free providers can return a public clone URL with no token, and `integrationRouteErrorHandler` is exported from `@shipfox/api-integration-core` so the route reuses the shared provider-error mapping.
37
+ - b525dcd: Let an agent workflow step pick its pi provider with an optional free-text `provider` field (default `anthropic`), threaded to the runner's pi model lookup, and split agent-step failures into a user-fixable `agent_config_invalid` reason (unknown provider, missing runner credentials, wrong provider/model pair) versus `agent_invocation_failed` for genuine provider/API errors.
38
+ - 795f440: Adds the listener orchestration loop for long-lived listening jobs: durable event draining, one execution per buffered event, resolution on until, listening deadline, or max executions, and a run-timeout backstop that resolves active listeners.
39
+ - 3dcd751: Adds listener filter snapshots to job activation events and persists them on listener subscriptions.
40
+ - 362b3eb: Scope runner log append authorization to the dispatched step attempt carried by the job lease token.
41
+ - 2fb3e87: Derives workflow run attempt durations on the client and displays them in the run list and run header.
42
+ - ef1e917: Adds listening-job authoring fields and trusted execution context validation for listening jobs.
43
+ Separates workflow identifiers so internal rows use UUID `id`, authored workflow/job/step
44
+ references use `key`, and UI labels use `name`.
45
+ - 2933c33: Adds drain-boundary Zod validation for current outbox publisher event payloads.
46
+ - 8ecc121: Track queue/run/finish timing for workflow runs and jobs. Adds nullable `started_at`/`finished_at` to workflow runs and `queued_at`/`started_at`/`finished_at` to jobs, exposed on the run and job DTOs. The runners module emits two new authoritative-timestamp events (`runners.job.queued`, `runners.job.started`) in the same transaction as the enqueue/claim; workflows projects them onto the job row with a first-write-wins `coalesce`, so the at-least-once outbox can redeliver out of order safely. Run `started_at`/`finished_at` and job `finished_at` are stamped in-module at the status transitions. All columns are nullable and eventually consistent, so consumers must treat a missing endpoint as "not yet known" and clamp any duration math.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shipfox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,316 @@
1
+ import { z } from 'zod';
2
+ export declare const WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED: "workflows.workflow_run_attempt.created";
3
+ export declare const WORKFLOWS_WORKFLOW_RUN_TERMINATED: "workflows.workflow_run.terminated";
4
+ export declare const WORKFLOWS_WORKFLOW_RUN_CANCELLED: "workflows.workflow_run.cancelled";
5
+ export declare const WORKFLOWS_JOB_EXECUTION_TIMED_OUT: "workflows.job_execution.timed_out";
6
+ export declare const WORKFLOWS_JOB_ACTIVATED: "workflows.job.activated";
7
+ export declare const WORKFLOWS_JOB_EVENT_DELIVERED: "workflows.job_event.delivered";
8
+ export declare const WORKFLOWS_JOB_TERMINATED: "workflows.job.terminated";
9
+ export declare const WORKFLOWS_JOB_STEPS_SETTLED: "workflows.job.steps_settled";
10
+ export declare const WORKFLOWS_STEP_RESTART_ENQUEUED: "workflows.step.restart_enqueued";
11
+ export declare const WORKFLOWS_STEP_ATTEMPT_TERMINATED: "workflows.step_attempt.terminated";
12
+ export declare const workflowsWorkflowRunAttemptCreatedSchema: z.ZodObject<{
13
+ workflowRunId: z.ZodString;
14
+ workflowRunAttemptId: z.ZodString;
15
+ attempt: z.ZodNumber;
16
+ workspaceId: z.ZodString;
17
+ projectId: z.ZodString;
18
+ definitionId: z.ZodString;
19
+ }, z.core.$strip>;
20
+ export type WorkflowsWorkflowRunAttemptCreatedEventDto = z.infer<typeof workflowsWorkflowRunAttemptCreatedSchema>;
21
+ export declare const workflowRunTerminalStatusSchema: z.ZodEnum<{
22
+ cancelled: "cancelled";
23
+ succeeded: "succeeded";
24
+ failed: "failed";
25
+ }>;
26
+ export declare const jobTerminalStatusSchema: z.ZodEnum<{
27
+ cancelled: "cancelled";
28
+ succeeded: "succeeded";
29
+ failed: "failed";
30
+ skipped: "skipped";
31
+ }>;
32
+ export declare const terminalStatusSchema: z.ZodEnum<{
33
+ cancelled: "cancelled";
34
+ succeeded: "succeeded";
35
+ failed: "failed";
36
+ }>;
37
+ export declare const workflowsWorkflowRunTerminatedSchema: z.ZodObject<{
38
+ workflowRunId: z.ZodString;
39
+ workflowRunAttemptId: z.ZodString;
40
+ projectId: z.ZodString;
41
+ status: z.ZodEnum<{
42
+ cancelled: "cancelled";
43
+ succeeded: "succeeded";
44
+ failed: "failed";
45
+ }>;
46
+ }, z.core.$strip>;
47
+ export type WorkflowsWorkflowRunTerminatedEventDto = z.infer<typeof workflowsWorkflowRunTerminatedSchema>;
48
+ export declare const workflowsWorkflowRunCancelledSchema: z.ZodObject<{
49
+ workflowRunId: z.ZodString;
50
+ workflowRunAttemptId: z.ZodString;
51
+ projectId: z.ZodString;
52
+ }, z.core.$strip>;
53
+ export type WorkflowsWorkflowRunCancelledEventDto = z.infer<typeof workflowsWorkflowRunCancelledSchema>;
54
+ export declare const workflowsJobExecutionTimedOutSchema: z.ZodObject<{
55
+ jobId: z.ZodString;
56
+ jobExecutionId: z.ZodString;
57
+ workflowRunAttemptId: z.ZodString;
58
+ }, z.core.$strip>;
59
+ export type WorkflowsJobExecutionTimedOutEventDto = z.infer<typeof workflowsJobExecutionTimedOutSchema>;
60
+ export declare const workflowsJobActivatedSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
61
+ jobId: z.ZodString;
62
+ workflowRunId: z.ZodString;
63
+ workspaceId: z.ZodString;
64
+ mode: z.ZodLiteral<"one_shot">;
65
+ on: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
66
+ source: z.ZodString;
67
+ event: z.ZodString;
68
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
69
+ filter: z.ZodOptional<z.ZodString>;
70
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
71
+ }, z.core.$strip>>>>;
72
+ until: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
73
+ source: z.ZodString;
74
+ event: z.ZodString;
75
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
76
+ filter: z.ZodOptional<z.ZodString>;
77
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
78
+ }, z.core.$strip>>>>;
79
+ }, z.core.$strip>, z.ZodObject<{
80
+ jobId: z.ZodString;
81
+ workflowRunId: z.ZodString;
82
+ workspaceId: z.ZodString;
83
+ mode: z.ZodLiteral<"listening">;
84
+ on: z.ZodArray<z.ZodObject<{
85
+ source: z.ZodString;
86
+ event: z.ZodString;
87
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
88
+ filter: z.ZodOptional<z.ZodString>;
89
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
90
+ }, z.core.$strip>>;
91
+ until: z.ZodNullable<z.ZodArray<z.ZodObject<{
92
+ source: z.ZodString;
93
+ event: z.ZodString;
94
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
95
+ filter: z.ZodOptional<z.ZodString>;
96
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
+ }, z.core.$strip>>>;
98
+ }, z.core.$strip>], "mode">;
99
+ export type WorkflowsJobActivatedEventDto = z.infer<typeof workflowsJobActivatedSchema>;
100
+ export declare const workflowsJobEventDeliveredSchema: z.ZodObject<{
101
+ jobId: z.ZodString;
102
+ disposition: z.ZodEnum<{
103
+ fire: "fire";
104
+ resolve: "resolve";
105
+ }>;
106
+ eventRef: z.ZodString;
107
+ eventName: z.ZodString;
108
+ }, z.core.$strip>;
109
+ export type WorkflowsJobEventDeliveredEventDto = z.infer<typeof workflowsJobEventDeliveredSchema>;
110
+ export declare const workflowsJobTerminatedSchema: z.ZodObject<{
111
+ jobId: z.ZodString;
112
+ workflowRunId: z.ZodString;
113
+ workflowRunAttemptId: z.ZodString;
114
+ status: z.ZodEnum<{
115
+ cancelled: "cancelled";
116
+ succeeded: "succeeded";
117
+ failed: "failed";
118
+ skipped: "skipped";
119
+ }>;
120
+ statusReason: z.ZodNullable<z.ZodEnum<{
121
+ unknown: "unknown";
122
+ dependency_not_completed: "dependency_not_completed";
123
+ condition_false: "condition_false";
124
+ default_gate_rejected: "default_gate_rejected";
125
+ condition_rejected: "condition_rejected";
126
+ condition_errored: "condition_errored";
127
+ user_cancelled: "user_cancelled";
128
+ run_cancelled: "run_cancelled";
129
+ timed_out: "timed_out";
130
+ runner_lost: "runner_lost";
131
+ step_failed: "step_failed";
132
+ }>>;
133
+ }, z.core.$strip>;
134
+ export type WorkflowsJobTerminatedEventDto = z.infer<typeof workflowsJobTerminatedSchema>;
135
+ export declare const workflowsJobStepsSettledSchema: z.ZodObject<{
136
+ jobId: z.ZodString;
137
+ jobExecutionId: z.ZodString;
138
+ workflowRunId: z.ZodString;
139
+ workflowRunAttemptId: z.ZodString;
140
+ status: z.ZodEnum<{
141
+ succeeded: "succeeded";
142
+ failed: "failed";
143
+ }>;
144
+ }, z.core.$strip>;
145
+ export type WorkflowsJobStepsSettledEventDto = z.infer<typeof workflowsJobStepsSettledSchema>;
146
+ export declare const workflowsStepRestartEnqueuedSchema: z.ZodObject<{
147
+ jobId: z.ZodString;
148
+ workflowRunId: z.ZodString;
149
+ workflowRunAttemptId: z.ZodString;
150
+ failedStepId: z.ZodString;
151
+ failedStepAttempt: z.ZodNumber;
152
+ restartFromStepId: z.ZodString;
153
+ feedback: z.ZodString;
154
+ }, z.core.$strip>;
155
+ export type WorkflowsStepRestartEnqueuedEventDto = z.infer<typeof workflowsStepRestartEnqueuedSchema>;
156
+ export declare const workflowsStepAttemptTerminatedSchema: z.ZodObject<{
157
+ jobId: z.ZodString;
158
+ workflowRunId: z.ZodString;
159
+ workflowRunAttemptId: z.ZodString;
160
+ workspaceId: z.ZodString;
161
+ projectId: z.ZodString;
162
+ stepId: z.ZodString;
163
+ attempt: z.ZodNumber;
164
+ logOutcome: z.ZodEnum<{
165
+ drained: "drained";
166
+ abandoned: "abandoned";
167
+ }>;
168
+ }, z.core.$strip>;
169
+ export type WorkflowsStepAttemptTerminatedEventDto = z.infer<typeof workflowsStepAttemptTerminatedSchema>;
170
+ export interface WorkflowsEventMapDto {
171
+ [WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED]: WorkflowsWorkflowRunAttemptCreatedEventDto;
172
+ [WORKFLOWS_WORKFLOW_RUN_TERMINATED]: WorkflowsWorkflowRunTerminatedEventDto;
173
+ [WORKFLOWS_WORKFLOW_RUN_CANCELLED]: WorkflowsWorkflowRunCancelledEventDto;
174
+ [WORKFLOWS_JOB_EXECUTION_TIMED_OUT]: WorkflowsJobExecutionTimedOutEventDto;
175
+ [WORKFLOWS_JOB_ACTIVATED]: WorkflowsJobActivatedEventDto;
176
+ [WORKFLOWS_JOB_EVENT_DELIVERED]: WorkflowsJobEventDeliveredEventDto;
177
+ [WORKFLOWS_JOB_TERMINATED]: WorkflowsJobTerminatedEventDto;
178
+ [WORKFLOWS_JOB_STEPS_SETTLED]: WorkflowsJobStepsSettledEventDto;
179
+ [WORKFLOWS_STEP_RESTART_ENQUEUED]: WorkflowsStepRestartEnqueuedEventDto;
180
+ [WORKFLOWS_STEP_ATTEMPT_TERMINATED]: WorkflowsStepAttemptTerminatedEventDto;
181
+ }
182
+ export declare const workflowsEventSchemas: {
183
+ "workflows.workflow_run_attempt.created": z.ZodObject<{
184
+ workflowRunId: z.ZodString;
185
+ workflowRunAttemptId: z.ZodString;
186
+ attempt: z.ZodNumber;
187
+ workspaceId: z.ZodString;
188
+ projectId: z.ZodString;
189
+ definitionId: z.ZodString;
190
+ }, z.core.$strip>;
191
+ "workflows.workflow_run.terminated": z.ZodObject<{
192
+ workflowRunId: z.ZodString;
193
+ workflowRunAttemptId: z.ZodString;
194
+ projectId: z.ZodString;
195
+ status: z.ZodEnum<{
196
+ cancelled: "cancelled";
197
+ succeeded: "succeeded";
198
+ failed: "failed";
199
+ }>;
200
+ }, z.core.$strip>;
201
+ "workflows.workflow_run.cancelled": z.ZodObject<{
202
+ workflowRunId: z.ZodString;
203
+ workflowRunAttemptId: z.ZodString;
204
+ projectId: z.ZodString;
205
+ }, z.core.$strip>;
206
+ "workflows.job_execution.timed_out": z.ZodObject<{
207
+ jobId: z.ZodString;
208
+ jobExecutionId: z.ZodString;
209
+ workflowRunAttemptId: z.ZodString;
210
+ }, z.core.$strip>;
211
+ "workflows.job.activated": z.ZodDiscriminatedUnion<[z.ZodObject<{
212
+ jobId: z.ZodString;
213
+ workflowRunId: z.ZodString;
214
+ workspaceId: z.ZodString;
215
+ mode: z.ZodLiteral<"one_shot">;
216
+ on: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
217
+ source: z.ZodString;
218
+ event: z.ZodString;
219
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
220
+ filter: z.ZodOptional<z.ZodString>;
221
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
222
+ }, z.core.$strip>>>>;
223
+ until: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
224
+ source: z.ZodString;
225
+ event: z.ZodString;
226
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
227
+ filter: z.ZodOptional<z.ZodString>;
228
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
229
+ }, z.core.$strip>>>>;
230
+ }, z.core.$strip>, z.ZodObject<{
231
+ jobId: z.ZodString;
232
+ workflowRunId: z.ZodString;
233
+ workspaceId: z.ZodString;
234
+ mode: z.ZodLiteral<"listening">;
235
+ on: z.ZodArray<z.ZodObject<{
236
+ source: z.ZodString;
237
+ event: z.ZodString;
238
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
239
+ filter: z.ZodOptional<z.ZodString>;
240
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
241
+ }, z.core.$strip>>;
242
+ until: z.ZodNullable<z.ZodArray<z.ZodObject<{
243
+ source: z.ZodString;
244
+ event: z.ZodString;
245
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ filter: z.ZodOptional<z.ZodString>;
247
+ filter_snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
248
+ }, z.core.$strip>>>;
249
+ }, z.core.$strip>], "mode">;
250
+ "workflows.job_event.delivered": z.ZodObject<{
251
+ jobId: z.ZodString;
252
+ disposition: z.ZodEnum<{
253
+ fire: "fire";
254
+ resolve: "resolve";
255
+ }>;
256
+ eventRef: z.ZodString;
257
+ eventName: z.ZodString;
258
+ }, z.core.$strip>;
259
+ "workflows.job.terminated": z.ZodObject<{
260
+ jobId: z.ZodString;
261
+ workflowRunId: z.ZodString;
262
+ workflowRunAttemptId: z.ZodString;
263
+ status: z.ZodEnum<{
264
+ cancelled: "cancelled";
265
+ succeeded: "succeeded";
266
+ failed: "failed";
267
+ skipped: "skipped";
268
+ }>;
269
+ statusReason: z.ZodNullable<z.ZodEnum<{
270
+ unknown: "unknown";
271
+ dependency_not_completed: "dependency_not_completed";
272
+ condition_false: "condition_false";
273
+ default_gate_rejected: "default_gate_rejected";
274
+ condition_rejected: "condition_rejected";
275
+ condition_errored: "condition_errored";
276
+ user_cancelled: "user_cancelled";
277
+ run_cancelled: "run_cancelled";
278
+ timed_out: "timed_out";
279
+ runner_lost: "runner_lost";
280
+ step_failed: "step_failed";
281
+ }>>;
282
+ }, z.core.$strip>;
283
+ "workflows.job.steps_settled": z.ZodObject<{
284
+ jobId: z.ZodString;
285
+ jobExecutionId: z.ZodString;
286
+ workflowRunId: z.ZodString;
287
+ workflowRunAttemptId: z.ZodString;
288
+ status: z.ZodEnum<{
289
+ succeeded: "succeeded";
290
+ failed: "failed";
291
+ }>;
292
+ }, z.core.$strip>;
293
+ "workflows.step.restart_enqueued": z.ZodObject<{
294
+ jobId: z.ZodString;
295
+ workflowRunId: z.ZodString;
296
+ workflowRunAttemptId: z.ZodString;
297
+ failedStepId: z.ZodString;
298
+ failedStepAttempt: z.ZodNumber;
299
+ restartFromStepId: z.ZodString;
300
+ feedback: z.ZodString;
301
+ }, z.core.$strip>;
302
+ "workflows.step_attempt.terminated": z.ZodObject<{
303
+ jobId: z.ZodString;
304
+ workflowRunId: z.ZodString;
305
+ workflowRunAttemptId: z.ZodString;
306
+ workspaceId: z.ZodString;
307
+ projectId: z.ZodString;
308
+ stepId: z.ZodString;
309
+ attempt: z.ZodNumber;
310
+ logOutcome: z.ZodEnum<{
311
+ drained: "drained";
312
+ abandoned: "abandoned";
313
+ }>;
314
+ }, z.core.$strip>;
315
+ };
316
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAOtB,eAAO,MAAM,sCAAsC,EACjD,wCAAiD,CAAC;AAEpD,eAAO,MAAM,iCAAiC,EAAG,mCAA4C,CAAC;AAE9F,eAAO,MAAM,gCAAgC,EAAG,kCAA2C,CAAC;AAC5F,eAAO,MAAM,iCAAiC,EAAG,mCAA4C,CAAC;AAC9F,eAAO,MAAM,uBAAuB,EAAG,yBAAkC,CAAC;AAC1E,eAAO,MAAM,6BAA6B,EAAG,+BAAwC,CAAC;AAGtF,eAAO,MAAM,wBAAwB,EAAG,0BAAmC,CAAC;AAI5E,eAAO,MAAM,2BAA2B,EAAG,6BAAsC,CAAC;AAKlF,eAAO,MAAM,+BAA+B,EAAG,iCAA0C,CAAC;AAC1F,eAAO,MAAM,iCAAiC,EAAG,mCAA4C,CAAC;AAE9F,eAAO,MAAM,wCAAwC;;;;;;;iBAOnD,CAAC;AACH,MAAM,MAAM,0CAA0C,GAAG,CAAC,CAAC,KAAK,CAC9D,OAAO,wCAAwC,CAChD,CAAC;AAIF,eAAO,MAAM,+BAA+B;;;;EAA+C,CAAC;AAC5F,eAAO,MAAM,uBAAuB;;;;;EAA0D,CAAC;AAC/F,eAAO,MAAM,oBAAoB;;;;EAAkC,CAAC;AAEpE,eAAO,MAAM,oCAAoC;;;;;;;;;iBAK/C,CAAC;AACH,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,oCAAoC,CAC5C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACz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3E,CAAC,uBAAuB,CAAC,EAAE,6BAA6B,CAAC;IACzD,CAAC,6BAA6B,CAAC,EAAE,kCAAkC,CAAC;IACpE,CAAC,wBAAwB,CAAC,EAAE,8BAA8B,CAAC;IAC3D,CAAC,2BAA2B,CAAC,EAAE,gCAAgC,CAAC;IAChE,CAAC,+BAA+B,CAAC,EAAE,oCAAoC,CAAC;IACxE,CAAC,iCAAiC,CAAC,EAAE,sCAAsC,CAAC;CAC7E;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWuB,CAAC"}
package/dist/events.js ADDED
@@ -0,0 +1,144 @@
1
+ import { z } from 'zod';
2
+ import { jobStatusReasonSchema } from './schemas/job.js';
3
+ import { listeningTriggerSchema } from './schemas/job-listening.js';
4
+ import { logOutcomeSchema } from './schemas/log-outcome.js';
5
+ const nonEmptyStringSchema = z.string().nonempty();
6
+ export const WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED = 'workflows.workflow_run_attempt.created';
7
+ // Terminal fact for a workflow run, written in the same transaction as the status flip.
8
+ export const WORKFLOWS_WORKFLOW_RUN_TERMINATED = 'workflows.workflow_run.terminated';
9
+ // Intent fact for cooperative run cancellation. Consumers use this to stop orchestration.
10
+ export const WORKFLOWS_WORKFLOW_RUN_CANCELLED = 'workflows.workflow_run.cancelled';
11
+ export const WORKFLOWS_JOB_EXECUTION_TIMED_OUT = 'workflows.job_execution.timed_out';
12
+ export const WORKFLOWS_JOB_ACTIVATED = 'workflows.job.activated';
13
+ export const WORKFLOWS_JOB_EVENT_DELIVERED = 'workflows.job_event.delivered';
14
+ // Terminal fact for a job: the single reliable "this job is over" signal, written in
15
+ // the same transaction as the status flip, on every terminal path.
16
+ export const WORKFLOWS_JOB_TERMINATED = 'workflows.job.terminated';
17
+ // Internal signal, not a terminal fact: a job's steps have all settled, so the
18
+ // on-job-steps-settled subscriber can raise the Temporal JOB_FINISHED_SIGNAL. Fires
19
+ // before the job row is terminal; observe WORKFLOWS_JOB_TERMINATED for the outcome.
20
+ export const WORKFLOWS_JOB_STEPS_SETTLED = 'workflows.job.steps_settled';
21
+ // Written in the same transaction as a durable gate restart: the failed attempt
22
+ // plus the rewind of the projection from `restart_from`. The pull-based runner
23
+ // re-dispatches the rewound step on its next pull, so consumers must treat this
24
+ // at-least-once outbox event as idempotent audit data.
25
+ export const WORKFLOWS_STEP_RESTART_ENQUEUED = 'workflows.step.restart_enqueued';
26
+ export const WORKFLOWS_STEP_ATTEMPT_TERMINATED = 'workflows.step_attempt.terminated';
27
+ export const workflowsWorkflowRunAttemptCreatedSchema = z.object({
28
+ workflowRunId: nonEmptyStringSchema,
29
+ workflowRunAttemptId: nonEmptyStringSchema,
30
+ attempt: z.number().int().positive(),
31
+ workspaceId: nonEmptyStringSchema,
32
+ projectId: nonEmptyStringSchema,
33
+ definitionId: nonEmptyStringSchema
34
+ });
35
+ // Keep outbox terminal statuses narrower than the public status schemas, which
36
+ // also carry pending/running and job-only skipped.
37
+ export const workflowRunTerminalStatusSchema = z.enum([
38
+ 'succeeded',
39
+ 'failed',
40
+ 'cancelled'
41
+ ]);
42
+ export const jobTerminalStatusSchema = z.enum([
43
+ 'succeeded',
44
+ 'failed',
45
+ 'cancelled',
46
+ 'skipped'
47
+ ]);
48
+ export const terminalStatusSchema = workflowRunTerminalStatusSchema;
49
+ export const workflowsWorkflowRunTerminatedSchema = z.object({
50
+ workflowRunId: nonEmptyStringSchema,
51
+ workflowRunAttemptId: nonEmptyStringSchema,
52
+ projectId: nonEmptyStringSchema,
53
+ status: workflowRunTerminalStatusSchema
54
+ });
55
+ export const workflowsWorkflowRunCancelledSchema = z.object({
56
+ workflowRunId: nonEmptyStringSchema,
57
+ workflowRunAttemptId: nonEmptyStringSchema,
58
+ projectId: nonEmptyStringSchema
59
+ });
60
+ export const workflowsJobExecutionTimedOutSchema = z.object({
61
+ jobId: nonEmptyStringSchema,
62
+ jobExecutionId: nonEmptyStringSchema,
63
+ workflowRunAttemptId: nonEmptyStringSchema
64
+ });
65
+ const workflowsJobActivatedBaseSchema = z.object({
66
+ jobId: nonEmptyStringSchema,
67
+ workflowRunId: nonEmptyStringSchema,
68
+ workspaceId: nonEmptyStringSchema
69
+ });
70
+ const resolvedListeningTriggerSchema = listeningTriggerSchema.extend({
71
+ filter_snapshot: z.record(z.string(), z.unknown()).optional()
72
+ });
73
+ export const workflowsJobActivatedSchema = z.discriminatedUnion('mode', [
74
+ workflowsJobActivatedBaseSchema.extend({
75
+ mode: z.literal('one_shot'),
76
+ on: z.array(resolvedListeningTriggerSchema).nullable().optional(),
77
+ until: z.array(resolvedListeningTriggerSchema).nullable().optional()
78
+ }),
79
+ workflowsJobActivatedBaseSchema.extend({
80
+ mode: z.literal('listening'),
81
+ on: z.array(resolvedListeningTriggerSchema).nonempty(),
82
+ until: z.array(resolvedListeningTriggerSchema).nullable()
83
+ })
84
+ ]);
85
+ export const workflowsJobEventDeliveredSchema = z.object({
86
+ jobId: nonEmptyStringSchema,
87
+ disposition: z.enum([
88
+ 'fire',
89
+ 'resolve'
90
+ ]),
91
+ eventRef: nonEmptyStringSchema,
92
+ eventName: nonEmptyStringSchema
93
+ });
94
+ export const workflowsJobTerminatedSchema = z.object({
95
+ jobId: nonEmptyStringSchema,
96
+ workflowRunId: nonEmptyStringSchema,
97
+ workflowRunAttemptId: nonEmptyStringSchema,
98
+ status: jobTerminalStatusSchema,
99
+ statusReason: jobStatusReasonSchema.nullable()
100
+ });
101
+ const settledStatusSchema = z.enum([
102
+ 'succeeded',
103
+ 'failed'
104
+ ]);
105
+ export const workflowsJobStepsSettledSchema = z.object({
106
+ jobId: nonEmptyStringSchema,
107
+ jobExecutionId: nonEmptyStringSchema,
108
+ workflowRunId: nonEmptyStringSchema,
109
+ workflowRunAttemptId: nonEmptyStringSchema,
110
+ status: settledStatusSchema
111
+ });
112
+ export const workflowsStepRestartEnqueuedSchema = z.object({
113
+ jobId: nonEmptyStringSchema,
114
+ workflowRunId: nonEmptyStringSchema,
115
+ workflowRunAttemptId: nonEmptyStringSchema,
116
+ failedStepId: nonEmptyStringSchema,
117
+ failedStepAttempt: z.number(),
118
+ restartFromStepId: nonEmptyStringSchema,
119
+ feedback: nonEmptyStringSchema
120
+ });
121
+ export const workflowsStepAttemptTerminatedSchema = z.object({
122
+ jobId: nonEmptyStringSchema,
123
+ workflowRunId: nonEmptyStringSchema,
124
+ workflowRunAttemptId: nonEmptyStringSchema,
125
+ workspaceId: nonEmptyStringSchema,
126
+ projectId: nonEmptyStringSchema,
127
+ stepId: nonEmptyStringSchema,
128
+ attempt: z.number().int().positive(),
129
+ logOutcome: logOutcomeSchema
130
+ });
131
+ export const workflowsEventSchemas = {
132
+ [WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED]: workflowsWorkflowRunAttemptCreatedSchema,
133
+ [WORKFLOWS_WORKFLOW_RUN_TERMINATED]: workflowsWorkflowRunTerminatedSchema,
134
+ [WORKFLOWS_WORKFLOW_RUN_CANCELLED]: workflowsWorkflowRunCancelledSchema,
135
+ [WORKFLOWS_JOB_EXECUTION_TIMED_OUT]: workflowsJobExecutionTimedOutSchema,
136
+ [WORKFLOWS_JOB_ACTIVATED]: workflowsJobActivatedSchema,
137
+ [WORKFLOWS_JOB_EVENT_DELIVERED]: workflowsJobEventDeliveredSchema,
138
+ [WORKFLOWS_JOB_TERMINATED]: workflowsJobTerminatedSchema,
139
+ [WORKFLOWS_JOB_STEPS_SETTLED]: workflowsJobStepsSettledSchema,
140
+ [WORKFLOWS_STEP_RESTART_ENQUEUED]: workflowsStepRestartEnqueuedSchema,
141
+ [WORKFLOWS_STEP_ATTEMPT_TERMINATED]: workflowsStepAttemptTerminatedSchema
142
+ };
143
+
144
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/events.ts"],"sourcesContent":["import {z} from 'zod';\nimport {jobStatusReasonSchema} from './schemas/job.js';\nimport {listeningTriggerSchema} from './schemas/job-listening.js';\nimport {logOutcomeSchema} from './schemas/log-outcome.js';\n\nconst nonEmptyStringSchema = z.string().nonempty();\n\nexport const WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED =\n 'workflows.workflow_run_attempt.created' as const;\n// Terminal fact for a workflow run, written in the same transaction as the status flip.\nexport const WORKFLOWS_WORKFLOW_RUN_TERMINATED = 'workflows.workflow_run.terminated' as const;\n// Intent fact for cooperative run cancellation. Consumers use this to stop orchestration.\nexport const WORKFLOWS_WORKFLOW_RUN_CANCELLED = 'workflows.workflow_run.cancelled' as const;\nexport const WORKFLOWS_JOB_EXECUTION_TIMED_OUT = 'workflows.job_execution.timed_out' as const;\nexport const WORKFLOWS_JOB_ACTIVATED = 'workflows.job.activated' as const;\nexport const WORKFLOWS_JOB_EVENT_DELIVERED = 'workflows.job_event.delivered' as const;\n// Terminal fact for a job: the single reliable \"this job is over\" signal, written in\n// the same transaction as the status flip, on every terminal path.\nexport const WORKFLOWS_JOB_TERMINATED = 'workflows.job.terminated' as const;\n// Internal signal, not a terminal fact: a job's steps have all settled, so the\n// on-job-steps-settled subscriber can raise the Temporal JOB_FINISHED_SIGNAL. Fires\n// before the job row is terminal; observe WORKFLOWS_JOB_TERMINATED for the outcome.\nexport const WORKFLOWS_JOB_STEPS_SETTLED = 'workflows.job.steps_settled' as const;\n// Written in the same transaction as a durable gate restart: the failed attempt\n// plus the rewind of the projection from `restart_from`. The pull-based runner\n// re-dispatches the rewound step on its next pull, so consumers must treat this\n// at-least-once outbox event as idempotent audit data.\nexport const WORKFLOWS_STEP_RESTART_ENQUEUED = 'workflows.step.restart_enqueued' as const;\nexport const WORKFLOWS_STEP_ATTEMPT_TERMINATED = 'workflows.step_attempt.terminated' as const;\n\nexport const workflowsWorkflowRunAttemptCreatedSchema = z.object({\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n attempt: z.number().int().positive(),\n workspaceId: nonEmptyStringSchema,\n projectId: nonEmptyStringSchema,\n definitionId: nonEmptyStringSchema,\n});\nexport type WorkflowsWorkflowRunAttemptCreatedEventDto = z.infer<\n typeof workflowsWorkflowRunAttemptCreatedSchema\n>;\n\n// Keep outbox terminal statuses narrower than the public status schemas, which\n// also carry pending/running and job-only skipped.\nexport const workflowRunTerminalStatusSchema = z.enum(['succeeded', 'failed', 'cancelled']);\nexport const jobTerminalStatusSchema = z.enum(['succeeded', 'failed', 'cancelled', 'skipped']);\nexport const terminalStatusSchema = workflowRunTerminalStatusSchema;\n\nexport const workflowsWorkflowRunTerminatedSchema = z.object({\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n projectId: nonEmptyStringSchema,\n status: workflowRunTerminalStatusSchema,\n});\nexport type WorkflowsWorkflowRunTerminatedEventDto = z.infer<\n typeof workflowsWorkflowRunTerminatedSchema\n>;\n\nexport const workflowsWorkflowRunCancelledSchema = z.object({\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n projectId: nonEmptyStringSchema,\n});\nexport type WorkflowsWorkflowRunCancelledEventDto = z.infer<\n typeof workflowsWorkflowRunCancelledSchema\n>;\n\nexport const workflowsJobExecutionTimedOutSchema = z.object({\n jobId: nonEmptyStringSchema,\n jobExecutionId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n});\nexport type WorkflowsJobExecutionTimedOutEventDto = z.infer<\n typeof workflowsJobExecutionTimedOutSchema\n>;\n\nconst workflowsJobActivatedBaseSchema = z.object({\n jobId: nonEmptyStringSchema,\n workflowRunId: nonEmptyStringSchema,\n workspaceId: nonEmptyStringSchema,\n});\n\nconst resolvedListeningTriggerSchema = listeningTriggerSchema.extend({\n filter_snapshot: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const workflowsJobActivatedSchema = z.discriminatedUnion('mode', [\n workflowsJobActivatedBaseSchema.extend({\n mode: z.literal('one_shot'),\n on: z.array(resolvedListeningTriggerSchema).nullable().optional(),\n until: z.array(resolvedListeningTriggerSchema).nullable().optional(),\n }),\n workflowsJobActivatedBaseSchema.extend({\n mode: z.literal('listening'),\n on: z.array(resolvedListeningTriggerSchema).nonempty(),\n until: z.array(resolvedListeningTriggerSchema).nullable(),\n }),\n]);\nexport type WorkflowsJobActivatedEventDto = z.infer<typeof workflowsJobActivatedSchema>;\n\nexport const workflowsJobEventDeliveredSchema = z.object({\n jobId: nonEmptyStringSchema,\n disposition: z.enum(['fire', 'resolve']),\n eventRef: nonEmptyStringSchema,\n eventName: nonEmptyStringSchema,\n});\nexport type WorkflowsJobEventDeliveredEventDto = z.infer<typeof workflowsJobEventDeliveredSchema>;\n\nexport const workflowsJobTerminatedSchema = z.object({\n jobId: nonEmptyStringSchema,\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n status: jobTerminalStatusSchema,\n statusReason: jobStatusReasonSchema.nullable(),\n});\nexport type WorkflowsJobTerminatedEventDto = z.infer<typeof workflowsJobTerminatedSchema>;\n\nconst settledStatusSchema = z.enum(['succeeded', 'failed']);\n\nexport const workflowsJobStepsSettledSchema = z.object({\n jobId: nonEmptyStringSchema,\n jobExecutionId: nonEmptyStringSchema,\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n status: settledStatusSchema,\n});\nexport type WorkflowsJobStepsSettledEventDto = z.infer<typeof workflowsJobStepsSettledSchema>;\n\nexport const workflowsStepRestartEnqueuedSchema = z.object({\n jobId: nonEmptyStringSchema,\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n failedStepId: nonEmptyStringSchema,\n failedStepAttempt: z.number(),\n restartFromStepId: nonEmptyStringSchema,\n feedback: nonEmptyStringSchema,\n});\nexport type WorkflowsStepRestartEnqueuedEventDto = z.infer<\n typeof workflowsStepRestartEnqueuedSchema\n>;\n\nexport const workflowsStepAttemptTerminatedSchema = z.object({\n jobId: nonEmptyStringSchema,\n workflowRunId: nonEmptyStringSchema,\n workflowRunAttemptId: nonEmptyStringSchema,\n workspaceId: nonEmptyStringSchema,\n projectId: nonEmptyStringSchema,\n stepId: nonEmptyStringSchema,\n attempt: z.number().int().positive(),\n logOutcome: logOutcomeSchema,\n});\nexport type WorkflowsStepAttemptTerminatedEventDto = z.infer<\n typeof workflowsStepAttemptTerminatedSchema\n>;\n\nexport interface WorkflowsEventMapDto {\n [WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED]: WorkflowsWorkflowRunAttemptCreatedEventDto;\n [WORKFLOWS_WORKFLOW_RUN_TERMINATED]: WorkflowsWorkflowRunTerminatedEventDto;\n [WORKFLOWS_WORKFLOW_RUN_CANCELLED]: WorkflowsWorkflowRunCancelledEventDto;\n [WORKFLOWS_JOB_EXECUTION_TIMED_OUT]: WorkflowsJobExecutionTimedOutEventDto;\n [WORKFLOWS_JOB_ACTIVATED]: WorkflowsJobActivatedEventDto;\n [WORKFLOWS_JOB_EVENT_DELIVERED]: WorkflowsJobEventDeliveredEventDto;\n [WORKFLOWS_JOB_TERMINATED]: WorkflowsJobTerminatedEventDto;\n [WORKFLOWS_JOB_STEPS_SETTLED]: WorkflowsJobStepsSettledEventDto;\n [WORKFLOWS_STEP_RESTART_ENQUEUED]: WorkflowsStepRestartEnqueuedEventDto;\n [WORKFLOWS_STEP_ATTEMPT_TERMINATED]: WorkflowsStepAttemptTerminatedEventDto;\n}\n\nexport const workflowsEventSchemas = {\n [WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED]: workflowsWorkflowRunAttemptCreatedSchema,\n [WORKFLOWS_WORKFLOW_RUN_TERMINATED]: workflowsWorkflowRunTerminatedSchema,\n [WORKFLOWS_WORKFLOW_RUN_CANCELLED]: workflowsWorkflowRunCancelledSchema,\n [WORKFLOWS_JOB_EXECUTION_TIMED_OUT]: workflowsJobExecutionTimedOutSchema,\n [WORKFLOWS_JOB_ACTIVATED]: workflowsJobActivatedSchema,\n [WORKFLOWS_JOB_EVENT_DELIVERED]: workflowsJobEventDeliveredSchema,\n [WORKFLOWS_JOB_TERMINATED]: workflowsJobTerminatedSchema,\n [WORKFLOWS_JOB_STEPS_SETTLED]: workflowsJobStepsSettledSchema,\n [WORKFLOWS_STEP_RESTART_ENQUEUED]: workflowsStepRestartEnqueuedSchema,\n [WORKFLOWS_STEP_ATTEMPT_TERMINATED]: workflowsStepAttemptTerminatedSchema,\n} satisfies Record<keyof WorkflowsEventMapDto, z.ZodType>;\n"],"names":["z","jobStatusReasonSchema","listeningTriggerSchema","logOutcomeSchema","nonEmptyStringSchema","string","nonempty","WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED","WORKFLOWS_WORKFLOW_RUN_TERMINATED","WORKFLOWS_WORKFLOW_RUN_CANCELLED","WORKFLOWS_JOB_EXECUTION_TIMED_OUT","WORKFLOWS_JOB_ACTIVATED","WORKFLOWS_JOB_EVENT_DELIVERED","WORKFLOWS_JOB_TERMINATED","WORKFLOWS_JOB_STEPS_SETTLED","WORKFLOWS_STEP_RESTART_ENQUEUED","WORKFLOWS_STEP_ATTEMPT_TERMINATED","workflowsWorkflowRunAttemptCreatedSchema","object","workflowRunId","workflowRunAttemptId","attempt","number","int","positive","workspaceId","projectId","definitionId","workflowRunTerminalStatusSchema","enum","jobTerminalStatusSchema","terminalStatusSchema","workflowsWorkflowRunTerminatedSchema","status","workflowsWorkflowRunCancelledSchema","workflowsJobExecutionTimedOutSchema","jobId","jobExecutionId","workflowsJobActivatedBaseSchema","resolvedListeningTriggerSchema","extend","filter_snapshot","record","unknown","optional","workflowsJobActivatedSchema","discriminatedUnion","mode","literal","on","array","nullable","until","workflowsJobEventDeliveredSchema","disposition","eventRef","eventName","workflowsJobTerminatedSchema","statusReason","settledStatusSchema","workflowsJobStepsSettledSchema","workflowsStepRestartEnqueuedSchema","failedStepId","failedStepAttempt","restartFromStepId","feed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AAEkB,MAAM,CAAC;IACnDkB,OAAOhC;IACPe,eAAef;IACfgB,sBAAsBhB;IACtB6B,QAAQH;IACR4B,cAAczD,sBAAsBkD,QAAQ;AAC9C,GAAG;AAGH,MAAMQ,sBAAsB3D,EAAE6B,IAAI,CAAC;IAAC;IAAa;CAAS;AAE1D,OAAO,MAAM+B,iCAAiC5D,EAAEkB,MAAM,CAAC;IACrDkB,OAAOhC;IACPiC,gBAAgBjC;IAChBe,eAAef;IACfgB,sBAAsBhB;IACtB6B,QAAQ0B;AACV,GAAG;AAGH,OAAO,MAAME,qCAAqC7D,EAAEkB,MAAM,CAAC;IACzDkB,OAAOhC;IACPe,eAAef;IACfgB,sBAAsBhB;IACtB0D,cAAc1D;IACd2D,mBAAmB/D,EAAEsB,MAAM;IAC3B0C,mBAAmB5D;IACnB6D,UAAU7D;AACZ,GAAG;AAKH,OAAO,MAAM8D,uCAAuClE,EAAEkB,MAAM,CAAC;IAC3DkB,OAAOhC;IACPe,eAAef;IACfgB,sBAAsBhB;IACtBqB,aAAarB;IACbsB,WAAWtB;IACX+D,QAAQ/D;IACRiB,SAASrB,EAAEsB,MAAM,GAAGC,GAAG,GAAGC,QAAQ;IAClC4C,YAAYjE;AACd,GAAG;AAkBH,OAAO,MAAMkE,wBAAwB;IACnC,CAAC9D,uCAAuC,EAAEU;IAC1C,CAACT,kCAAkC,EAAEwB;IACrC,CAACvB,iCAAiC,EAAEyB;IACpC,CAACxB,kCAAkC,EAAEyB;IACrC,CAACxB,wBAAwB,EAAEkC;IAC3B,CAACjC,8BAA8B,EAAEyC;IACjC,CAACxC,yBAAyB,EAAE4C;IAC5B,CAAC3C,4BAA4B,EAAE8C;IAC/B,CAAC7C,gCAAgC,EAAE8C;IACnC,CAAC7C,kCAAkC,EAAEkD;AACvC,EAA0D"}
@@ -0,0 +1,5 @@
1
+ export { type AgentConfigIssueDto, type AgentRuntimeConfigQueryDto, agentConfigIssueSchema, agentRuntimeConfigQuerySchema, type CheckoutIntentDto, type CheckoutTokenAuthDto, type CheckoutTokenResponseDto, checkoutIntentSchema, checkoutTokenAuthSchema, checkoutTokenResponseSchema, type JobDto, type JobExecutionDto, type JobListeningDto, type JobModeDto, type JobStatusDto, type JobStatusReasonDto, jobDtoSchema, jobListeningBatchSchema, jobListeningSchema, jobModeSchema, jobStatusReasonSchema, jobStatusSchema, type ListenerStatusDto, type ListeningTriggerDto, type LogOutcomeDto, listenerStatusSchema, listeningTriggerSchema, logOutcomeSchema, type NextStepResponseDto, nextStepResponseSchema, type ReportStepBodyDto, type ReportStepResponseDto, type RerunWorkflowRunBodyDto, type ResolutionReasonDto, reportStepBodySchema, reportStepResponseSchema, rerunWorkflowRunBodySchema, resolutionReasonSchema, STEP_ERROR_MESSAGE_MAX_LENGTH, STEP_RESPONSE_MAX_LENGTH, type StepAttemptDto, type StepDto, type StepErrorCategoryDto, type StepErrorDto, type StepErrorReasonDto, type StepGateResultDto, stepAttemptDtoSchema, stepDtoSchema, stepErrorCategorySchema, stepErrorDtoSchema, stepErrorReasonSchema, stepGateResultDtoSchema, type TriggerEventsBatchDto, triggerEventsBatchSchema, type WorkflowExecutionContextDto, type WorkflowExecutionEventDto, type WorkflowRunAggregatesQueryDto, type WorkflowRunAggregatesResponseDto, type WorkflowRunAttemptDto, type WorkflowRunAttemptsResponseDto, type WorkflowRunDetailResponseDto, type WorkflowRunDto, type WorkflowRunJobDetailDto, type WorkflowRunJobExecutionDetailDto, type WorkflowRunListQueryDto, type WorkflowRunListResponseDto, type WorkflowRunRerunModeDto, type WorkflowRunResponseDto, type WorkflowRunStatusDto, type WorkflowRunStepDetailDto, workflowExecutionContextSchema, workflowExecutionEventSchema, workflowRunAggregatesQuerySchema, workflowRunAggregatesResponseSchema, workflowRunAttemptDtoSchema, workflowRunAttemptsResponseSchema, workflowRunDetailResponseSchema, workflowRunDtoSchema, workflowRunJobDetailDtoSchema, workflowRunJobExecutionDetailDtoSchema, workflowRunListQuerySchema, workflowRunListResponseSchema, workflowRunRerunModeSchema, workflowRunResponseSchema, workflowRunStatusSchema, workflowRunStepDetailDtoSchema, } from '#schemas/index.js';
2
+ export { type StepSourceLocationDto, stepSourceLocationSchema } from '#schemas/step.js';
3
+ export { type WorkflowSourceSnapshotDto, workflowSourceSnapshotSchema, } from '#schemas/workflow-run.js';
4
+ export { jobTerminalStatusSchema, terminalStatusSchema, WORKFLOWS_JOB_ACTIVATED, WORKFLOWS_JOB_EVENT_DELIVERED, WORKFLOWS_JOB_EXECUTION_TIMED_OUT, WORKFLOWS_JOB_STEPS_SETTLED, WORKFLOWS_JOB_TERMINATED, WORKFLOWS_STEP_ATTEMPT_TERMINATED, WORKFLOWS_STEP_RESTART_ENQUEUED, WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED, WORKFLOWS_WORKFLOW_RUN_CANCELLED, WORKFLOWS_WORKFLOW_RUN_TERMINATED, type WorkflowsEventMapDto, type WorkflowsJobActivatedEventDto, type WorkflowsJobEventDeliveredEventDto, type WorkflowsJobExecutionTimedOutEventDto, type WorkflowsJobStepsSettledEventDto, type WorkflowsJobTerminatedEventDto, type WorkflowsStepAttemptTerminatedEventDto, type WorkflowsStepRestartEnqueuedEventDto, type WorkflowsWorkflowRunAttemptCreatedEventDto, type WorkflowsWorkflowRunCancelledEventDto, type WorkflowsWorkflowRunTerminatedEventDto, workflowRunTerminalStatusSchema, workflowsEventSchemas, workflowsJobActivatedSchema, workflowsJobEventDeliveredSchema, workflowsJobExecutionTimedOutSchema, workflowsJobStepsSettledSchema, workflowsJobTerminatedSchema, workflowsStepAttemptTerminatedSchema, workflowsStepRestartEnqueuedSchema, workflowsWorkflowRunAttemptCreatedSchema, workflowsWorkflowRunCancelledSchema, workflowsWorkflowRunTerminatedSchema, } from './events.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KA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C9B,4BAA4B,EAC5B,gCAAgC,EAChC,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,+BAA+B,EAC/B,oBAAoB,EACpB,6BAA6B,EAC7B,sCAAsC,EACtC,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,KAAK,qBAAqB,EAAE,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AACtF,OAAO,EACL,KAAK,yBAAyB,EAC9B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC3B,wBAAwB,EACxB,iCAAiC,EACjC,+BAA+B,EAC/B,sCAAsC,EACtC,gCAAgC,EAChC,iCAAiC,EACjC,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACnC,KAAK,sCAAsC,EAC3C,KAAK,oCAAoC,EACzC,KAAK,0CAA0C,EAC/C,KAAK,qCAAqC,EAC1C,KAAK,sCAAsC,EAC3C,+BAA+B,EAC/B,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,8BAA8B,EAC9B,4BAA4B,EAC5B,oCAAoC,EACpC,kCAAkC,EAClC,wCAAwC,EACxC,mCAAmC,EACnC,oCAAoC,GACrC,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { agentConfigIssueSchema, agentRuntimeConfigQuerySchema, checkoutIntentSchema, checkoutTokenAuthSchema, checkoutTokenResponseSchema, jobDtoSchema, jobListeningBatchSchema, jobListeningSchema, jobModeSchema, jobStatusReasonSchema, jobStatusSchema, listenerStatusSchema, listeningTriggerSchema, logOutcomeSchema, nextStepResponseSchema, reportStepBodySchema, reportStepResponseSchema, rerunWorkflowRunBodySchema, resolutionReasonSchema, STEP_ERROR_MESSAGE_MAX_LENGTH, STEP_RESPONSE_MAX_LENGTH, stepAttemptDtoSchema, stepDtoSchema, stepErrorCategorySchema, stepErrorDtoSchema, stepErrorReasonSchema, stepGateResultDtoSchema, triggerEventsBatchSchema, workflowExecutionContextSchema, workflowExecutionEventSchema, workflowRunAggregatesQuerySchema, workflowRunAggregatesResponseSchema, workflowRunAttemptDtoSchema, workflowRunAttemptsResponseSchema, workflowRunDetailResponseSchema, workflowRunDtoSchema, workflowRunJobDetailDtoSchema, workflowRunJobExecutionDetailDtoSchema, workflowRunListQuerySchema, workflowRunListResponseSchema, workflowRunRerunModeSchema, workflowRunResponseSchema, workflowRunStatusSchema, workflowRunStepDetailDtoSchema } from '#schemas/index.js';
2
+ export { stepSourceLocationSchema } from '#schemas/step.js';
3
+ export { workflowSourceSnapshotSchema } from '#schemas/workflow-run.js';
4
+ export { jobTerminalStatusSchema, terminalStatusSchema, WORKFLOWS_JOB_ACTIVATED, WORKFLOWS_JOB_EVENT_DELIVERED, WORKFLOWS_JOB_EXECUTION_TIMED_OUT, WORKFLOWS_JOB_STEPS_SETTLED, WORKFLOWS_JOB_TERMINATED, WORKFLOWS_STEP_ATTEMPT_TERMINATED, WORKFLOWS_STEP_RESTART_ENQUEUED, WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED, WORKFLOWS_WORKFLOW_RUN_CANCELLED, WORKFLOWS_WORKFLOW_RUN_TERMINATED, workflowRunTerminalStatusSchema, workflowsEventSchemas, workflowsJobActivatedSchema, workflowsJobEventDeliveredSchema, workflowsJobExecutionTimedOutSchema, workflowsJobStepsSettledSchema, workflowsJobTerminatedSchema, workflowsStepAttemptTerminatedSchema, workflowsStepRestartEnqueuedSchema, workflowsWorkflowRunAttemptCreatedSchema, workflowsWorkflowRunCancelledSchema, workflowsWorkflowRunTerminatedSchema } from './events.js';
5
+
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type AgentConfigIssueDto,\n type AgentRuntimeConfigQueryDto,\n agentConfigIssueSchema,\n agentRuntimeConfigQuerySchema,\n type CheckoutIntentDto,\n type CheckoutTokenAuthDto,\n type CheckoutTokenResponseDto,\n checkoutIntentSchema,\n checkoutTokenAuthSchema,\n checkoutTokenResponseSchema,\n type JobDto,\n type JobExecutionDto,\n type JobListeningDto,\n type JobModeDto,\n type JobStatusDto,\n type JobStatusReasonDto,\n jobDtoSchema,\n jobListeningBatchSchema,\n jobListeningSchema,\n jobModeSchema,\n jobStatusReasonSchema,\n jobStatusSchema,\n type ListenerStatusDto,\n type ListeningTriggerDto,\n type LogOutcomeDto,\n listenerStatusSchema,\n listeningTriggerSchema,\n logOutcomeSchema,\n type NextStepResponseDto,\n nextStepResponseSchema,\n type ReportStepBodyDto,\n type ReportStepResponseDto,\n type RerunWorkflowRunBodyDto,\n type ResolutionReasonDto,\n reportStepBodySchema,\n reportStepResponseSchema,\n rerunWorkflowRunBodySchema,\n resolutionReasonSchema,\n STEP_ERROR_MESSAGE_MAX_LENGTH,\n STEP_RESPONSE_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 type TriggerEventsBatchDto,\n triggerEventsBatchSchema,\n type WorkflowExecutionContextDto,\n type WorkflowExecutionEventDto,\n type WorkflowRunAggregatesQueryDto,\n type WorkflowRunAggregatesResponseDto,\n type WorkflowRunAttemptDto,\n type WorkflowRunAttemptsResponseDto,\n type WorkflowRunDetailResponseDto,\n type WorkflowRunDto,\n type WorkflowRunJobDetailDto,\n type WorkflowRunJobExecutionDetailDto,\n type WorkflowRunListQueryDto,\n type WorkflowRunListResponseDto,\n type WorkflowRunRerunModeDto,\n type WorkflowRunResponseDto,\n type WorkflowRunStatusDto,\n type WorkflowRunStepDetailDto,\n workflowExecutionContextSchema,\n workflowExecutionEventSchema,\n workflowRunAggregatesQuerySchema,\n workflowRunAggregatesResponseSchema,\n workflowRunAttemptDtoSchema,\n workflowRunAttemptsResponseSchema,\n workflowRunDetailResponseSchema,\n workflowRunDtoSchema,\n workflowRunJobDetailDtoSchema,\n workflowRunJobExecutionDetailDtoSchema,\n workflowRunListQuerySchema,\n workflowRunListResponseSchema,\n workflowRunRerunModeSchema,\n workflowRunResponseSchema,\n workflowRunStatusSchema,\n workflowRunStepDetailDtoSchema,\n} from '#schemas/index.js';\nexport {type StepSourceLocationDto, stepSourceLocationSchema} from '#schemas/step.js';\nexport {\n type WorkflowSourceSnapshotDto,\n workflowSourceSnapshotSchema,\n} from '#schemas/workflow-run.js';\nexport {\n jobTerminalStatusSchema,\n terminalStatusSchema,\n WORKFLOWS_JOB_ACTIVATED,\n WORKFLOWS_JOB_EVENT_DELIVERED,\n WORKFLOWS_JOB_EXECUTION_TIMED_OUT,\n WORKFLOWS_JOB_STEPS_SETTLED,\n WORKFLOWS_JOB_TERMINATED,\n WORKFLOWS_STEP_ATTEMPT_TERMINATED,\n WORKFLOWS_STEP_RESTART_ENQUEUED,\n WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED,\n WORKFLOWS_WORKFLOW_RUN_CANCELLED,\n WORKFLOWS_WORKFLOW_RUN_TERMINATED,\n type WorkflowsEventMapDto,\n type WorkflowsJobActivatedEventDto,\n type WorkflowsJobEventDeliveredEventDto,\n type WorkflowsJobExecutionTimedOutEventDto,\n type WorkflowsJobStepsSettledEventDto,\n type WorkflowsJobTerminatedEventDto,\n type WorkflowsStepAttemptTerminatedEventDto,\n type WorkflowsStepRestartEnqueuedEventDto,\n type WorkflowsWorkflowRunAttemptCreatedEventDto,\n type WorkflowsWorkflowRunCancelledEventDto,\n type WorkflowsWorkflowRunTerminatedEventDto,\n workflowRunTerminalStatusSchema,\n workflowsEventSchemas,\n workflowsJobActivatedSchema,\n workflowsJobEventDeliveredSchema,\n workflowsJobExecutionTimedOutSchema,\n workflowsJobStepsSettledSchema,\n workflowsJobTerminatedSchema,\n workflowsStepAttemptTerminatedSchema,\n workflowsStepRestartEnqueuedSchema,\n workflowsWorkflowRunAttemptCreatedSchema,\n workflowsWorkflowRunCancelledSchema,\n workflowsWorkflowRunTerminatedSchema,\n} from './events.js';\n"],"names":["agentConfigIssueSchema","agentRuntimeConfigQuerySchema","checkoutIntentSchema","checkoutTokenAuthSchema","checkoutTokenResponseSchema","jobDtoSchema","jobListeningBatchSchema","jobListeningSchema","jobModeSchema","jobStatusReasonSchema","jobStatusSchema","listenerStatusSchema","listeningTriggerSchema","logOutcomeSchema","nextStepResponseSchema","reportStepBodySchema","reportStepResponseSchema","rerunWorkflowRunBodySchema","resolutionReasonSchema","STEP_ERROR_MESSAGE_MAX_LENGTH","STEP_RESPONSE_MAX_LENGTH","stepAttemptDtoSchema","stepDtoSchema","stepErrorCategorySchema","stepErrorDtoSchema","stepErrorReasonSchema","stepGateResultDtoSchema","triggerEventsBatchSchema","workflowExecutionContextSchema","workflowExecutionEventSchema","workflowRunAggregatesQuerySchema","workflowRunAggregatesResponseSchema","workflowRunAttemptDtoSchema","workflowRunAttemptsResponseSchema","workflowRunDetailResponseSchema","workflowRunDtoSchema","workflowRunJobDetailDtoSchema","workflowRunJobExecutionDetailDtoSchema","workflowRunListQuerySchema","workflowRunListResponseSchema","workflowRunRerunModeSchema","workflowRunResponseSchema","workflowRunStatusSchema","workflowRunStepDetailDtoSchema","stepSourceLocationSchema","workflowSourceSnapshotSchema","jobTerminalStatusSchema","terminalStatusSchema","WORKFLOWS_JOB_ACTIVATED","WORKFLOWS_JOB_EVENT_DELIVERED","WORKFLOWS_JOB_EXECUTION_TIMED_OUT","WORKFLOWS_JOB_STEPS_SETTLED","WORKFLOWS_JOB_TERMINATED","WORKFLOWS_STEP_ATTEMPT_TERMINATED","WORKFLOWS_STEP_RESTART_ENQUEUED","WORKFLOWS_WORKFLOW_RUN_ATTEMPT_CREATED","WORKFLOWS_WORKFLOW_RUN_CANCELLED","WORKFLOWS_WORKFLOW_RUN_TERMINATED","workflowRunTerminalStatusSchema","workflowsEventSchemas","workflowsJobActivatedSchema","workflowsJobEventDeliveredSchema","workflowsJobExecutionTimedOutSchema","workflowsJobStepsSettledSchema","workflowsJobTerminatedSchema","workflowsStepAttemptTerminatedSchema","workflowsStepRestartEnqueuedSchema","workflowsWorkflowRunAttemptCreatedSchema","workflowsWorkflowRunCancelledSchema","workflowsWorkflowRunTerminatedSchema"],"mappings":"AAAA,SAGEA,sBAAsB,EACtBC,6BAA6B,EAI7BC,oBAAoB,EACpBC,uBAAuB,EACvBC,2BAA2B,EAO3BC,YAAY,EACZC,uBAAuB,EACvBC,kBAAkB,EAClBC,aAAa,EACbC,qBAAqB,EACrBC,eAAe,EAIfC,oBAAoB,EACpBC,sBAAsB,EACtBC,gBAAgB,EAEhBC,sBAAsB,EAKtBC,oBAAoB,EACpBC,wBAAwB,EACxBC,0BAA0B,EAC1BC,sBAAsB,EACtBC,6BAA6B,EAC7BC,wBAAwB,EAOxBC,oBAAoB,EACpBC,aAAa,EACbC,uBAAuB,EACvBC,kBAAkB,EAClBC,qBAAqB,EACrBC,uBAAuB,EAEvBC,wBAAwB,EAiBxBC,8BAA8B,EAC9BC,4BAA4B,EAC5BC,gCAAgC,EAChCC,mCAAmC,EACnCC,2BAA2B,EAC3BC,iCAAiC,EACjCC,+BAA+B,EAC/BC,oBAAoB,EACpBC,6BAA6B,EAC7BC,sCAAsC,EACtCC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,yBAAyB,EACzBC,uBAAuB,EACvBC,8BAA8B,QACzB,oBAAoB;AAC3B,SAAoCC,wBAAwB,QAAO,mBAAmB;AACtF,SAEEC,4BAA4B,QACvB,2BAA2B;AAClC,SACEC,uBAAuB,EACvBC,oBAAoB,EACpBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,iCAAiC,EACjCC,2BAA2B,EAC3BC,wBAAwB,EACxBC,iCAAiC,EACjCC,+BAA+B,EAC/BC,sCAAsC,EACtCC,gCAAgC,EAChCC,iCAAiC,EAYjCC,+BAA+B,EAC/BC,qBAAqB,EACrBC,2BAA2B,EAC3BC,gCAAgC,EAChCC,mCAAmC,EACnCC,8BAA8B,EAC9BC,4BAA4B,EAC5BC,oCAAoC,EACpCC,kCAAkC,EAClCC,wCAAwC,EACxCC,mCAAmC,EACnCC,oCAAoC,QAC/B,cAAc"}
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const agentRuntimeConfigQuerySchema: z.ZodObject<{
3
+ step_id: z.ZodString;
4
+ attempt: z.ZodCoercedNumber<unknown>;
5
+ }, z.core.$strip>;
6
+ export type AgentRuntimeConfigQueryDto = z.infer<typeof agentRuntimeConfigQuerySchema>;
7
+ //# sourceMappingURL=agent-runtime-config.d.ts.map