@scarn/sdk 0.8.2 → 0.8.4

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 (66) hide show
  1. package/dist/automations/define-automation.d.ts +20 -0
  2. package/dist/automations/index.d.ts +8 -0
  3. package/dist/automations/index.js +21 -0
  4. package/dist/automations/targets.d.ts +36 -0
  5. package/dist/automations/types.d.ts +116 -0
  6. package/dist/{chunk-nb0nkt71.js → chunk-01nfqm18.js} +1 -0
  7. package/dist/chunk-0vzq22dj.js +73 -0
  8. package/dist/chunk-11hbmexe.js +250 -0
  9. package/dist/{chunk-2fn95pdd.js → chunk-3gy0cb5f.js} +5 -1
  10. package/dist/{chunk-qrasq5xe.js → chunk-43y7tfn4.js} +33 -414
  11. package/dist/chunk-61jf8b6s.js +53 -0
  12. package/dist/chunk-76d1bwwz.js +119 -0
  13. package/dist/chunk-8z1wa3kd.js +109 -0
  14. package/dist/{chunk-p7yrcmqm.js → chunk-cnxaagfj.js} +2 -52
  15. package/dist/{chunk-cdanncng.js → chunk-ejzfdm1z.js} +21 -5
  16. package/dist/{chunk-gds7w7zh.js → chunk-fgfhvsee.js} +1 -4
  17. package/dist/{chunk-x9788y82.js → chunk-hyaez4ee.js} +145 -16
  18. package/dist/{chunk-mz53r914.js → chunk-jj9pezwb.js} +22 -119
  19. package/dist/{chunk-8pyhrdgy.js → chunk-wnfj3wyx.js} +55 -11
  20. package/dist/chunk-x0hjhqrf.js +416 -0
  21. package/dist/chunk-y11p1q7r.js +159 -0
  22. package/dist/client.js +4 -2
  23. package/dist/contracts/automation-document/index.d.ts +5 -0
  24. package/dist/contracts/automation-document/index.js +34 -0
  25. package/dist/contracts/automation-document/schema.d.ts +363 -0
  26. package/dist/contracts/pipeline-document/built-ins.d.ts +1 -1
  27. package/dist/contracts/pipeline-document/index.js +9 -7
  28. package/dist/contracts/pipeline-document/schema.d.ts +3 -3
  29. package/dist/contracts/work-item-changes.d.ts +6 -4
  30. package/dist/contracts/work-item-changes.js +2 -2
  31. package/dist/defaults/index.js +2 -2
  32. package/dist/definitions/automations/automations-client.d.ts +178 -0
  33. package/dist/definitions/automations/index.d.ts +1 -0
  34. package/dist/definitions/automations/index.js +12 -0
  35. package/dist/definitions/pipelines/index.d.ts +0 -1
  36. package/dist/definitions/pipelines/index.js +4 -12
  37. package/dist/definitions/pipelines/work-item-fields.d.ts +11 -22
  38. package/dist/definitions/steps/define-code-step.d.ts +8 -5
  39. package/dist/definitions/steps/define-step.d.ts +22 -11
  40. package/dist/definitions/steps/index.js +13 -6
  41. package/dist/definitions/steps/repo.d.ts +11 -3
  42. package/dist/definitions/steps/runtime.d.ts +11 -12
  43. package/dist/definitions/steps/step-definitions-client.d.ts +105 -3
  44. package/dist/definitions/steps/step-features.d.ts +89 -6
  45. package/dist/definitions/steps/step-handle.d.ts +6 -1
  46. package/dist/definitions/validation/index.js +2 -2
  47. package/dist/generated/index.d.ts +2 -2
  48. package/dist/generated/sdk.gen.d.ts +38 -6
  49. package/dist/generated/types.gen.d.ts +3026 -1889
  50. package/dist/index.d.ts +1 -0
  51. package/dist/index.js +44 -30
  52. package/dist/pipelines/define-pipeline.d.ts +7 -7
  53. package/dist/pipelines/handles.d.ts +0 -5
  54. package/dist/pipelines/index.js +7 -4
  55. package/dist/pipelines/types.d.ts +13 -1
  56. package/dist/push/collect-definitions.d.ts +3 -8
  57. package/dist/push/collect-pipeline-documents.d.ts +13 -3
  58. package/dist/push/index.d.ts +2 -2
  59. package/dist/push/index.js +87 -124
  60. package/dist/push/push-from-directory.d.ts +10 -6
  61. package/dist/repo-config.d.ts +14 -4
  62. package/dist/repo-config.js +5 -1
  63. package/dist/task-plane-client.d.ts +71 -1
  64. package/package.json +13 -1
  65. package/dist/chunk-ra53p0v8.js +0 -256
  66. package/dist/definitions/pipelines/define-default-pipeline-assignment.d.ts +0 -263
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The automation document contract: what an automation JSON document is.
3
+ * Conditions and args share the pipeline document's grammar.
4
+ */
5
+ export * from "./schema";
@@ -0,0 +1,34 @@
1
+ // @bun
2
+ import {
3
+ AUTOMATION_EVENTS,
4
+ AUTOMATION_SCOPES,
5
+ AUTOMATION_SUBJECTS,
6
+ PROJECT_AUTOMATION_EVENTS,
7
+ WORK_ITEM_AUTOMATION_EVENTS,
8
+ automationDocumentJsonSchema,
9
+ automationDocumentSchema,
10
+ automationNextSchema,
11
+ automationRouteSchema,
12
+ automationRuleSchema,
13
+ automationTargetSchema,
14
+ eventHasChild,
15
+ scopeOfEvent
16
+ } from "../../chunk-76d1bwwz.js";
17
+ import"../../chunk-cnxaagfj.js";
18
+ import"../../chunk-skzxcba3.js";
19
+ import"../../chunk-y64skrwp.js";
20
+ export {
21
+ AUTOMATION_EVENTS,
22
+ AUTOMATION_SCOPES,
23
+ AUTOMATION_SUBJECTS,
24
+ PROJECT_AUTOMATION_EVENTS,
25
+ WORK_ITEM_AUTOMATION_EVENTS,
26
+ automationDocumentJsonSchema,
27
+ automationDocumentSchema,
28
+ automationNextSchema,
29
+ automationRouteSchema,
30
+ automationRuleSchema,
31
+ automationTargetSchema,
32
+ eventHasChild,
33
+ scopeOfEvent
34
+ };
@@ -0,0 +1,363 @@
1
+ /**
2
+ * The zod schema for automation JSON documents (schema version 1): what
3
+ * `defineAutomation` compiles to and `scarn pipelines build` writes as
4
+ * `<key>.json`, next to the pipeline documents.
5
+ *
6
+ * ```json
7
+ * {
8
+ * "kind": "automation",
9
+ * "schemaVersion": 1,
10
+ * "key": "wayfinder",
11
+ * "title": "Wayfinder",
12
+ * "scope": "workItem",
13
+ * "rules": [
14
+ * {
15
+ * "event": "child.ready",
16
+ * "next": {
17
+ * "routes": [
18
+ * {
19
+ * "when": { "path": "event.child.labels", "op": "contains", "value": "wayfinder:research" },
20
+ * "kind": "step",
21
+ * "to": "research",
22
+ * "args": { "question": "event.child.title" },
23
+ * "on": "child"
24
+ * }
25
+ * ],
26
+ * "otherwise": { "kind": "skip" }
27
+ * }
28
+ * }
29
+ * ]
30
+ * }
31
+ * ```
32
+ *
33
+ * - `scope` limits `event`: work-item automations react to `self.attached`
34
+ * and `child.*`, project automations to `workItem.*`.
35
+ * - `next` has the shape of a pipeline node's `next`: `match` (`"first"`, the
36
+ * default, or `"all"`), `routes`, each with an optional `when`, and
37
+ * `otherwise`. A rule with one target compiles to one route without `when`.
38
+ * - Each route is a target: `step` (a step key, with args) or `pipeline` (a
39
+ * pipeline key), each started for the work item `on` names (`"workItem"`,
40
+ * the one the rule is about, or `"child"`, only on `child.*` events);
41
+ * `attach` (another automation's key, project scope only); or `skip`.
42
+ * - Refs in `when` and `args` read the event: `event.workItem.<prop>`,
43
+ * `event.child.<prop>` (on `child.*` events) and `event.label` (on
44
+ * `workItem.label.added`), where `<prop>` is `title`, `description`,
45
+ * `labels`, `state` or `fields.<name>`. Args use the pipeline arg format
46
+ * (a ref string, `{ "value": ... }` or `{ "list": [...] }`).
47
+ *
48
+ * The schema checks structure and that events fit the scope. Whether `to`
49
+ * names a known step or pipeline, and whether args fit its input, is checked
50
+ * when the automation is published.
51
+ */
52
+ import { z } from "zod";
53
+ export declare const AUTOMATION_SCOPES: readonly ["workItem", "project"];
54
+ /** Events of a work-item automation: about its own work item and its child work items. */
55
+ export declare const WORK_ITEM_AUTOMATION_EVENTS: readonly ["self.attached", "child.created", "child.ready", "child.closed"];
56
+ /** Events of a project automation: about any top-level work item in the project. */
57
+ export declare const PROJECT_AUTOMATION_EVENTS: readonly ["workItem.created", "workItem.ready", "workItem.label.added"];
58
+ export declare const AUTOMATION_EVENTS: readonly ["self.attached", "child.created", "child.ready", "child.closed", "workItem.created", "workItem.ready", "workItem.label.added"];
59
+ /** Which work item a started Task or pipeline run is for. */
60
+ export declare const AUTOMATION_SUBJECTS: readonly ["workItem", "child"];
61
+ export type AutomationScope = (typeof AUTOMATION_SCOPES)[number];
62
+ export type WorkItemAutomationEvent = (typeof WORK_ITEM_AUTOMATION_EVENTS)[number];
63
+ export type ProjectAutomationEvent = (typeof PROJECT_AUTOMATION_EVENTS)[number];
64
+ export type AutomationEvent = (typeof AUTOMATION_EVENTS)[number];
65
+ export type AutomationSubject = (typeof AUTOMATION_SUBJECTS)[number];
66
+ /** The scope whose automations react to `event`. */
67
+ export declare function scopeOfEvent(event: AutomationEvent): AutomationScope;
68
+ /** Whether `event` has a `child` work item. */
69
+ export declare function eventHasChild(event: AutomationEvent): boolean;
70
+ /** What a rule starts: a step's Task, a pipeline run, an attachment, or nothing. */
71
+ export declare const automationTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
72
+ kind: z.ZodLiteral<"step">;
73
+ to: z.ZodString;
74
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
75
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
76
+ }, z.core.$strict>, z.ZodObject<{
77
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
78
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
79
+ }, z.core.$strict>]>>;
80
+ }, z.core.$strict>]>>>;
81
+ on: z.ZodEnum<{
82
+ workItem: "workItem";
83
+ child: "child";
84
+ }>;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"pipeline">;
87
+ to: z.ZodString;
88
+ on: z.ZodEnum<{
89
+ workItem: "workItem";
90
+ child: "child";
91
+ }>;
92
+ }, z.core.$strict>, z.ZodObject<{
93
+ kind: z.ZodLiteral<"attach">;
94
+ automation: z.ZodString;
95
+ }, z.core.$strict>, z.ZodObject<{
96
+ kind: z.ZodLiteral<"skip">;
97
+ }, z.core.$strict>], "kind">;
98
+ /** One route: an optional `when`, then the target's keys. */
99
+ export declare const automationRouteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ kind: z.ZodLiteral<"step">;
101
+ to: z.ZodString;
102
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
103
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
106
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
107
+ }, z.core.$strict>]>>;
108
+ }, z.core.$strict>]>>>;
109
+ on: z.ZodEnum<{
110
+ workItem: "workItem";
111
+ child: "child";
112
+ }>;
113
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
114
+ }, z.core.$strict>, z.ZodObject<{
115
+ kind: z.ZodLiteral<"pipeline">;
116
+ to: z.ZodString;
117
+ on: z.ZodEnum<{
118
+ workItem: "workItem";
119
+ child: "child";
120
+ }>;
121
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
122
+ }, z.core.$strict>, z.ZodObject<{
123
+ kind: z.ZodLiteral<"attach">;
124
+ automation: z.ZodString;
125
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
126
+ }, z.core.$strict>, z.ZodObject<{
127
+ kind: z.ZodLiteral<"skip">;
128
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
129
+ }, z.core.$strict>], "kind">;
130
+ export declare const automationNextSchema: z.ZodObject<{
131
+ match: z.ZodOptional<z.ZodEnum<{
132
+ all: "all";
133
+ first: "first";
134
+ }>>;
135
+ routes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
136
+ kind: z.ZodLiteral<"step">;
137
+ to: z.ZodString;
138
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
139
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
140
+ }, z.core.$strict>, z.ZodObject<{
141
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
142
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
143
+ }, z.core.$strict>]>>;
144
+ }, z.core.$strict>]>>>;
145
+ on: z.ZodEnum<{
146
+ workItem: "workItem";
147
+ child: "child";
148
+ }>;
149
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
150
+ }, z.core.$strict>, z.ZodObject<{
151
+ kind: z.ZodLiteral<"pipeline">;
152
+ to: z.ZodString;
153
+ on: z.ZodEnum<{
154
+ workItem: "workItem";
155
+ child: "child";
156
+ }>;
157
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
158
+ }, z.core.$strict>, z.ZodObject<{
159
+ kind: z.ZodLiteral<"attach">;
160
+ automation: z.ZodString;
161
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
162
+ }, z.core.$strict>, z.ZodObject<{
163
+ kind: z.ZodLiteral<"skip">;
164
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
165
+ }, z.core.$strict>], "kind">>;
166
+ otherwise: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
167
+ kind: z.ZodLiteral<"step">;
168
+ to: z.ZodString;
169
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
170
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
173
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
174
+ }, z.core.$strict>]>>;
175
+ }, z.core.$strict>]>>>;
176
+ on: z.ZodEnum<{
177
+ workItem: "workItem";
178
+ child: "child";
179
+ }>;
180
+ }, z.core.$strict>, z.ZodObject<{
181
+ kind: z.ZodLiteral<"pipeline">;
182
+ to: z.ZodString;
183
+ on: z.ZodEnum<{
184
+ workItem: "workItem";
185
+ child: "child";
186
+ }>;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ kind: z.ZodLiteral<"attach">;
189
+ automation: z.ZodString;
190
+ }, z.core.$strict>, z.ZodObject<{
191
+ kind: z.ZodLiteral<"skip">;
192
+ }, z.core.$strict>], "kind">>;
193
+ }, z.core.$strict>;
194
+ export declare const automationRuleSchema: z.ZodObject<{
195
+ event: z.ZodEnum<{
196
+ "self.attached": "self.attached";
197
+ "child.created": "child.created";
198
+ "child.ready": "child.ready";
199
+ "child.closed": "child.closed";
200
+ "workItem.created": "workItem.created";
201
+ "workItem.ready": "workItem.ready";
202
+ "workItem.label.added": "workItem.label.added";
203
+ }>;
204
+ next: z.ZodObject<{
205
+ match: z.ZodOptional<z.ZodEnum<{
206
+ all: "all";
207
+ first: "first";
208
+ }>>;
209
+ routes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
210
+ kind: z.ZodLiteral<"step">;
211
+ to: z.ZodString;
212
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
213
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
216
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
217
+ }, z.core.$strict>]>>;
218
+ }, z.core.$strict>]>>>;
219
+ on: z.ZodEnum<{
220
+ workItem: "workItem";
221
+ child: "child";
222
+ }>;
223
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
224
+ }, z.core.$strict>, z.ZodObject<{
225
+ kind: z.ZodLiteral<"pipeline">;
226
+ to: z.ZodString;
227
+ on: z.ZodEnum<{
228
+ workItem: "workItem";
229
+ child: "child";
230
+ }>;
231
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
232
+ }, z.core.$strict>, z.ZodObject<{
233
+ kind: z.ZodLiteral<"attach">;
234
+ automation: z.ZodString;
235
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
236
+ }, z.core.$strict>, z.ZodObject<{
237
+ kind: z.ZodLiteral<"skip">;
238
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
239
+ }, z.core.$strict>], "kind">>;
240
+ otherwise: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
241
+ kind: z.ZodLiteral<"step">;
242
+ to: z.ZodString;
243
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
244
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
247
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
248
+ }, z.core.$strict>]>>;
249
+ }, z.core.$strict>]>>>;
250
+ on: z.ZodEnum<{
251
+ workItem: "workItem";
252
+ child: "child";
253
+ }>;
254
+ }, z.core.$strict>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"pipeline">;
256
+ to: z.ZodString;
257
+ on: z.ZodEnum<{
258
+ workItem: "workItem";
259
+ child: "child";
260
+ }>;
261
+ }, z.core.$strict>, z.ZodObject<{
262
+ kind: z.ZodLiteral<"attach">;
263
+ automation: z.ZodString;
264
+ }, z.core.$strict>, z.ZodObject<{
265
+ kind: z.ZodLiteral<"skip">;
266
+ }, z.core.$strict>], "kind">>;
267
+ }, z.core.$strict>;
268
+ }, z.core.$strict>;
269
+ type Target = z.infer<typeof automationTargetSchema>;
270
+ export declare const automationDocumentSchema: z.ZodObject<{
271
+ $schema: z.ZodOptional<z.ZodString>;
272
+ kind: z.ZodLiteral<"automation">;
273
+ schemaVersion: z.ZodLiteral<1>;
274
+ key: z.ZodString;
275
+ title: z.ZodOptional<z.ZodString>;
276
+ scope: z.ZodEnum<{
277
+ workItem: "workItem";
278
+ project: "project";
279
+ }>;
280
+ rules: z.ZodArray<z.ZodObject<{
281
+ event: z.ZodEnum<{
282
+ "self.attached": "self.attached";
283
+ "child.created": "child.created";
284
+ "child.ready": "child.ready";
285
+ "child.closed": "child.closed";
286
+ "workItem.created": "workItem.created";
287
+ "workItem.ready": "workItem.ready";
288
+ "workItem.label.added": "workItem.label.added";
289
+ }>;
290
+ next: z.ZodObject<{
291
+ match: z.ZodOptional<z.ZodEnum<{
292
+ all: "all";
293
+ first: "first";
294
+ }>>;
295
+ routes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
296
+ kind: z.ZodLiteral<"step">;
297
+ to: z.ZodString;
298
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
299
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
302
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
303
+ }, z.core.$strict>]>>;
304
+ }, z.core.$strict>]>>>;
305
+ on: z.ZodEnum<{
306
+ workItem: "workItem";
307
+ child: "child";
308
+ }>;
309
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
310
+ }, z.core.$strict>, z.ZodObject<{
311
+ kind: z.ZodLiteral<"pipeline">;
312
+ to: z.ZodString;
313
+ on: z.ZodEnum<{
314
+ workItem: "workItem";
315
+ child: "child";
316
+ }>;
317
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
318
+ }, z.core.$strict>, z.ZodObject<{
319
+ kind: z.ZodLiteral<"attach">;
320
+ automation: z.ZodString;
321
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
322
+ }, z.core.$strict>, z.ZodObject<{
323
+ kind: z.ZodLiteral<"skip">;
324
+ when: z.ZodOptional<z.ZodType<import("../pipeline-document").Condition, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").Condition, unknown>>>;
325
+ }, z.core.$strict>], "kind">>;
326
+ otherwise: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
327
+ kind: z.ZodLiteral<"step">;
328
+ to: z.ZodString;
329
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
330
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
331
+ }, z.core.$strict>, z.ZodObject<{
332
+ list: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
333
+ value: z.ZodType<import("../pipeline-document").JsonValue, unknown, z.core.$ZodTypeInternals<import("../pipeline-document").JsonValue, unknown>>;
334
+ }, z.core.$strict>]>>;
335
+ }, z.core.$strict>]>>>;
336
+ on: z.ZodEnum<{
337
+ workItem: "workItem";
338
+ child: "child";
339
+ }>;
340
+ }, z.core.$strict>, z.ZodObject<{
341
+ kind: z.ZodLiteral<"pipeline">;
342
+ to: z.ZodString;
343
+ on: z.ZodEnum<{
344
+ workItem: "workItem";
345
+ child: "child";
346
+ }>;
347
+ }, z.core.$strict>, z.ZodObject<{
348
+ kind: z.ZodLiteral<"attach">;
349
+ automation: z.ZodString;
350
+ }, z.core.$strict>, z.ZodObject<{
351
+ kind: z.ZodLiteral<"skip">;
352
+ }, z.core.$strict>], "kind">>;
353
+ }, z.core.$strict>;
354
+ }, z.core.$strict>>;
355
+ }, z.core.$strict>;
356
+ export type AutomationTargetJson = Target;
357
+ export type AutomationRoute = z.infer<typeof automationRouteSchema>;
358
+ export type AutomationNext = z.infer<typeof automationNextSchema>;
359
+ export type AutomationRule = z.infer<typeof automationRuleSchema>;
360
+ export type AutomationDocument = z.infer<typeof automationDocumentSchema>;
361
+ /** The JSON Schema for automation documents, for editors and external tools. */
362
+ export declare function automationDocumentJsonSchema(): Record<string, unknown>;
363
+ export {};
@@ -3,7 +3,7 @@
3
3
  * the input a `reply` wait takes, and caught errors.
4
4
  */
5
5
  import type { JsonSchema } from "./json";
6
- export declare const BUILT_IN_ERRORS: readonly ["Scarn.All", "Scarn.StepFailed", "Scarn.HealthCheckFailed", "Scarn.Timeout", "Scarn.HeartbeatTimeout", "Scarn.MaxRunsExceeded", "Scarn.MaxTurnsExceeded", "Scarn.ConditionError", "Scarn.ArgsError", "Scarn.LogArchiveFailed", "Scarn.WorkItemChangesInvalid", "Scarn.WorkItemNotNative"];
6
+ export declare const BUILT_IN_ERRORS: readonly ["Scarn.All", "Scarn.StepFailed", "Scarn.HealthCheckFailed", "Scarn.Timeout", "Scarn.HeartbeatTimeout", "Scarn.MaxRunsExceeded", "Scarn.MaxTurnsExceeded", "Scarn.ConcurrencyGroupFull", "Scarn.ConditionError", "Scarn.ArgsError", "Scarn.LogArchiveFailed", "Scarn.WorkItemChangesInvalid", "Scarn.WorkItemNotNative"];
7
7
  /** The errors a wait node can raise, so the only names its `catch` may use. */
8
8
  export declare const WAIT_ERRORS: readonly ["Scarn.All", "Scarn.MaxRunsExceeded", "Scarn.ArgsError"];
9
9
  /**
@@ -1,4 +1,11 @@
1
1
  // @bun
2
+ import {
3
+ deepEqual,
4
+ isJsonObject,
5
+ jsonPointer,
6
+ routeAt,
7
+ routeEntries
8
+ } from "../../chunk-61jf8b6s.js";
2
9
  import {
3
10
  ALIAS_PATTERN,
4
11
  COMPARISON_OPERATORS,
@@ -17,11 +24,8 @@ import {
17
24
  computedSourceSchema,
18
25
  conditionSchema,
19
26
  decisionActionSchema,
20
- deepEqual,
21
27
  eachSchema,
22
28
  failNodeSchema,
23
- isJsonObject,
24
- jsonPointer,
25
29
  listSchema,
26
30
  literalSchema,
27
31
  nextSchema,
@@ -30,15 +34,13 @@ import {
30
34
  pipelineDocumentJsonSchema,
31
35
  pipelineDocumentSchema,
32
36
  retrySchema,
33
- routeAt,
34
- routeEntries,
35
37
  routeSchema,
36
38
  startSchema,
37
39
  stepNodeSchema,
38
40
  succeedNodeSchema,
39
41
  toleratedFailuresSchema,
40
42
  waitNodeSchema
41
- } from "../../chunk-p7yrcmqm.js";
43
+ } from "../../chunk-cnxaagfj.js";
42
44
  import {
43
45
  BUILT_IN_ERRORS,
44
46
  CONVERSATION_RESULT_SCHEMA,
@@ -47,7 +49,7 @@ import {
47
49
  REPLY_RESULT_SCHEMA,
48
50
  WAIT_ERRORS,
49
51
  decisionResultSchema
50
- } from "../../chunk-nb0nkt71.js";
52
+ } from "../../chunk-01nfqm18.js";
51
53
  import"../../chunk-skzxcba3.js";
52
54
  import"../../chunk-y64skrwp.js";
53
55
  export {
@@ -311,9 +311,9 @@ export declare const waitNodeSchema: z.ZodObject<{
311
311
  kind: z.ZodLiteral<"wait">;
312
312
  title: z.ZodOptional<z.ZodString>;
313
313
  for: z.ZodEnum<{
314
- event: "event";
315
314
  decision: "decision";
316
315
  reply: "reply";
316
+ event: "event";
317
317
  timer: "timer";
318
318
  }>;
319
319
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -478,9 +478,9 @@ export declare const nodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
478
478
  kind: z.ZodLiteral<"wait">;
479
479
  title: z.ZodOptional<z.ZodString>;
480
480
  for: z.ZodEnum<{
481
- event: "event";
482
481
  decision: "decision";
483
482
  reply: "reply";
483
+ event: "event";
484
484
  timer: "timer";
485
485
  }>;
486
486
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -671,9 +671,9 @@ export declare const pipelineDocumentSchema: z.ZodObject<{
671
671
  kind: z.ZodLiteral<"wait">;
672
672
  title: z.ZodOptional<z.ZodString>;
673
673
  for: z.ZodEnum<{
674
- event: "event";
675
674
  decision: "decision";
676
675
  reply: "reply";
676
+ event: "event";
677
677
  timer: "timer";
678
678
  }>;
679
679
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -9,7 +9,13 @@ export type WorkItemChange = {
9
9
  title: string;
10
10
  description: string;
11
11
  fields?: Record<string, unknown>;
12
+ labels?: string[];
12
13
  blockedBy?: string[];
14
+ } | {
15
+ kind: "label";
16
+ workItemId: string;
17
+ add?: string[];
18
+ remove?: string[];
13
19
  } | {
14
20
  kind: "block";
15
21
  blockedWorkItemId: string;
@@ -29,10 +35,6 @@ export type WorkItemChange = {
29
35
  workItemId: string;
30
36
  reason: WorkItemCloseReason;
31
37
  resolution?: string | null;
32
- } | {
33
- kind: "startTask";
34
- workItemId: string;
35
- stepKey: string;
36
38
  };
37
39
  export declare function buildWorkItemChangesPath(workspacePath: string): string;
38
40
  /** The changes recorded so far; a missing file means none. */
@@ -18,11 +18,11 @@ var workItemChangesFileSchema = exports_external.object({
18
18
  changes: exports_external.array(exports_external.looseObject({
19
19
  kind: exports_external.enum([
20
20
  "create",
21
+ "label",
21
22
  "block",
22
23
  "describe",
23
24
  "comment",
24
- "close",
25
- "startTask"
25
+ "close"
26
26
  ])
27
27
  }))
28
28
  });
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-rt9tq4j6.js";
5
5
  import {
6
6
  createScarnClient
7
- } from "../chunk-2fn95pdd.js";
8
- import"../chunk-8pyhrdgy.js";
7
+ } from "../chunk-3gy0cb5f.js";
8
+ import"../chunk-wnfj3wyx.js";
9
9
  import"../chunk-y64skrwp.js";
10
10
 
11
11
  // src/defaults/auth-file.ts