@lannguyensi/harness 0.6.0 → 0.7.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 (46) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +156 -154
  3. package/dist/cli/describe.d.ts +1 -1
  4. package/dist/cli/describe.js +2 -0
  5. package/dist/cli/describe.js.map +1 -1
  6. package/dist/cli/doctor/format.js +18 -1
  7. package/dist/cli/doctor/format.js.map +1 -1
  8. package/dist/cli/doctor/index.js +30 -1
  9. package/dist/cli/doctor/index.js.map +1 -1
  10. package/dist/cli/doctor/types.d.ts +14 -0
  11. package/dist/cli/explain.d.ts +10 -1
  12. package/dist/cli/explain.js +44 -18
  13. package/dist/cli/explain.js.map +1 -1
  14. package/dist/cli/index.js +58 -7
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/cli/list.d.ts +1 -1
  17. package/dist/cli/list.js +17 -0
  18. package/dist/cli/list.js.map +1 -1
  19. package/dist/cli/session-export/index.d.ts +46 -0
  20. package/dist/cli/session-export/index.js +169 -0
  21. package/dist/cli/session-export/index.js.map +1 -0
  22. package/dist/cli/session-export/redact.d.ts +22 -0
  23. package/dist/cli/session-export/redact.js +47 -0
  24. package/dist/cli/session-export/redact.js.map +1 -0
  25. package/dist/cli/session-export/transcript.d.ts +24 -0
  26. package/dist/cli/session-export/transcript.js +162 -0
  27. package/dist/cli/session-export/transcript.js.map +1 -0
  28. package/dist/policies/ledger-client.js +2 -1
  29. package/dist/policies/ledger-client.js.map +1 -1
  30. package/dist/probes/mcp.js +2 -1
  31. package/dist/probes/mcp.js.map +1 -1
  32. package/dist/runtime/ledger-record.js +2 -1
  33. package/dist/runtime/ledger-record.js.map +1 -1
  34. package/dist/schema/audit.d.ts +71 -0
  35. package/dist/schema/audit.js +32 -0
  36. package/dist/schema/audit.js.map +1 -0
  37. package/dist/schema/index.d.ts +408 -0
  38. package/dist/schema/index.js +21 -0
  39. package/dist/schema/index.js.map +1 -1
  40. package/dist/schema/workflows.d.ts +519 -0
  41. package/dist/schema/workflows.js +81 -0
  42. package/dist/schema/workflows.js.map +1 -0
  43. package/dist/version.d.ts +1 -0
  44. package/dist/version.js +3 -0
  45. package/dist/version.js.map +1 -0
  46. package/package.json +1 -1
@@ -0,0 +1,519 @@
1
+ import { z } from "zod";
2
+ export declare const ReviewSpawnSchema: z.ZodEnum<["required", "optional", "skip"]>;
3
+ export declare const ReviewRigorSchema: z.ZodEnum<["rigorous", "quick", "docs-only"]>;
4
+ export declare const ReviewOnFindingsSchema: z.ZodEnum<["fix_then_remerge", "comment_only"]>;
5
+ export declare const MergeMethodSchema: z.ZodEnum<["merge", "squash", "rebase"]>;
6
+ export declare const MergeGateSchema: z.ZodEnum<["solo", "agent_tasks_label", "none"]>;
7
+ export declare const WorkflowWhenSchema: z.ZodObject<{
8
+ task_label: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
+ project: z.ZodOptional<z.ZodString>;
10
+ }, "strict", z.ZodTypeAny, {
11
+ project?: string | undefined;
12
+ task_label?: string[] | undefined;
13
+ }, {
14
+ project?: string | undefined;
15
+ task_label?: string[] | undefined;
16
+ }>;
17
+ export declare const BranchStepSchema: z.ZodObject<{
18
+ kind: z.ZodLiteral<"branch">;
19
+ from: z.ZodDefault<z.ZodString>;
20
+ per_task: z.ZodDefault<z.ZodBoolean>;
21
+ }, "strict", z.ZodTypeAny, {
22
+ kind: "branch";
23
+ from: string;
24
+ per_task: boolean;
25
+ }, {
26
+ kind: "branch";
27
+ from?: string | undefined;
28
+ per_task?: boolean | undefined;
29
+ }>;
30
+ export declare const ReviewSubagentStepSchema: z.ZodObject<{
31
+ kind: z.ZodLiteral<"review_subagent">;
32
+ spawn: z.ZodDefault<z.ZodEnum<["required", "optional", "skip"]>>;
33
+ agent_type: z.ZodDefault<z.ZodString>;
34
+ rigor: z.ZodDefault<z.ZodEnum<["rigorous", "quick", "docs-only"]>>;
35
+ template: z.ZodOptional<z.ZodString>;
36
+ on_findings: z.ZodDefault<z.ZodEnum<["fix_then_remerge", "comment_only"]>>;
37
+ }, "strict", z.ZodTypeAny, {
38
+ kind: "review_subagent";
39
+ spawn: "required" | "optional" | "skip";
40
+ agent_type: string;
41
+ rigor: "rigorous" | "quick" | "docs-only";
42
+ on_findings: "fix_then_remerge" | "comment_only";
43
+ template?: string | undefined;
44
+ }, {
45
+ kind: "review_subagent";
46
+ spawn?: "required" | "optional" | "skip" | undefined;
47
+ agent_type?: string | undefined;
48
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
49
+ template?: string | undefined;
50
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
51
+ }>;
52
+ export declare const CiGateStepSchema: z.ZodObject<{
53
+ kind: z.ZodLiteral<"ci_gate">;
54
+ wait_for: z.ZodDefault<z.ZodString>;
55
+ }, "strict", z.ZodTypeAny, {
56
+ kind: "ci_gate";
57
+ wait_for: string;
58
+ }, {
59
+ kind: "ci_gate";
60
+ wait_for?: string | undefined;
61
+ }>;
62
+ export declare const MergeStepSchema: z.ZodObject<{
63
+ kind: z.ZodLiteral<"merge">;
64
+ method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
65
+ gate: z.ZodDefault<z.ZodEnum<["solo", "agent_tasks_label", "none"]>>;
66
+ }, "strict", z.ZodTypeAny, {
67
+ kind: "merge";
68
+ method: "merge" | "squash" | "rebase";
69
+ gate: "solo" | "agent_tasks_label" | "none";
70
+ }, {
71
+ kind: "merge";
72
+ method?: "merge" | "squash" | "rebase" | undefined;
73
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
74
+ }>;
75
+ export declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
76
+ kind: z.ZodLiteral<"branch">;
77
+ from: z.ZodDefault<z.ZodString>;
78
+ per_task: z.ZodDefault<z.ZodBoolean>;
79
+ }, "strict", z.ZodTypeAny, {
80
+ kind: "branch";
81
+ from: string;
82
+ per_task: boolean;
83
+ }, {
84
+ kind: "branch";
85
+ from?: string | undefined;
86
+ per_task?: boolean | undefined;
87
+ }>, z.ZodObject<{
88
+ kind: z.ZodLiteral<"review_subagent">;
89
+ spawn: z.ZodDefault<z.ZodEnum<["required", "optional", "skip"]>>;
90
+ agent_type: z.ZodDefault<z.ZodString>;
91
+ rigor: z.ZodDefault<z.ZodEnum<["rigorous", "quick", "docs-only"]>>;
92
+ template: z.ZodOptional<z.ZodString>;
93
+ on_findings: z.ZodDefault<z.ZodEnum<["fix_then_remerge", "comment_only"]>>;
94
+ }, "strict", z.ZodTypeAny, {
95
+ kind: "review_subagent";
96
+ spawn: "required" | "optional" | "skip";
97
+ agent_type: string;
98
+ rigor: "rigorous" | "quick" | "docs-only";
99
+ on_findings: "fix_then_remerge" | "comment_only";
100
+ template?: string | undefined;
101
+ }, {
102
+ kind: "review_subagent";
103
+ spawn?: "required" | "optional" | "skip" | undefined;
104
+ agent_type?: string | undefined;
105
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
106
+ template?: string | undefined;
107
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
108
+ }>, z.ZodObject<{
109
+ kind: z.ZodLiteral<"ci_gate">;
110
+ wait_for: z.ZodDefault<z.ZodString>;
111
+ }, "strict", z.ZodTypeAny, {
112
+ kind: "ci_gate";
113
+ wait_for: string;
114
+ }, {
115
+ kind: "ci_gate";
116
+ wait_for?: string | undefined;
117
+ }>, z.ZodObject<{
118
+ kind: z.ZodLiteral<"merge">;
119
+ method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
120
+ gate: z.ZodDefault<z.ZodEnum<["solo", "agent_tasks_label", "none"]>>;
121
+ }, "strict", z.ZodTypeAny, {
122
+ kind: "merge";
123
+ method: "merge" | "squash" | "rebase";
124
+ gate: "solo" | "agent_tasks_label" | "none";
125
+ }, {
126
+ kind: "merge";
127
+ method?: "merge" | "squash" | "rebase" | undefined;
128
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
129
+ }>]>;
130
+ export declare const WorkflowSchema: z.ZodEffects<z.ZodObject<{
131
+ name: z.ZodString;
132
+ when: z.ZodDefault<z.ZodObject<{
133
+ task_label: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
134
+ project: z.ZodOptional<z.ZodString>;
135
+ }, "strict", z.ZodTypeAny, {
136
+ project?: string | undefined;
137
+ task_label?: string[] | undefined;
138
+ }, {
139
+ project?: string | undefined;
140
+ task_label?: string[] | undefined;
141
+ }>>;
142
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
143
+ kind: z.ZodLiteral<"branch">;
144
+ from: z.ZodDefault<z.ZodString>;
145
+ per_task: z.ZodDefault<z.ZodBoolean>;
146
+ }, "strict", z.ZodTypeAny, {
147
+ kind: "branch";
148
+ from: string;
149
+ per_task: boolean;
150
+ }, {
151
+ kind: "branch";
152
+ from?: string | undefined;
153
+ per_task?: boolean | undefined;
154
+ }>, z.ZodObject<{
155
+ kind: z.ZodLiteral<"review_subagent">;
156
+ spawn: z.ZodDefault<z.ZodEnum<["required", "optional", "skip"]>>;
157
+ agent_type: z.ZodDefault<z.ZodString>;
158
+ rigor: z.ZodDefault<z.ZodEnum<["rigorous", "quick", "docs-only"]>>;
159
+ template: z.ZodOptional<z.ZodString>;
160
+ on_findings: z.ZodDefault<z.ZodEnum<["fix_then_remerge", "comment_only"]>>;
161
+ }, "strict", z.ZodTypeAny, {
162
+ kind: "review_subagent";
163
+ spawn: "required" | "optional" | "skip";
164
+ agent_type: string;
165
+ rigor: "rigorous" | "quick" | "docs-only";
166
+ on_findings: "fix_then_remerge" | "comment_only";
167
+ template?: string | undefined;
168
+ }, {
169
+ kind: "review_subagent";
170
+ spawn?: "required" | "optional" | "skip" | undefined;
171
+ agent_type?: string | undefined;
172
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
173
+ template?: string | undefined;
174
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
175
+ }>, z.ZodObject<{
176
+ kind: z.ZodLiteral<"ci_gate">;
177
+ wait_for: z.ZodDefault<z.ZodString>;
178
+ }, "strict", z.ZodTypeAny, {
179
+ kind: "ci_gate";
180
+ wait_for: string;
181
+ }, {
182
+ kind: "ci_gate";
183
+ wait_for?: string | undefined;
184
+ }>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"merge">;
186
+ method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
187
+ gate: z.ZodDefault<z.ZodEnum<["solo", "agent_tasks_label", "none"]>>;
188
+ }, "strict", z.ZodTypeAny, {
189
+ kind: "merge";
190
+ method: "merge" | "squash" | "rebase";
191
+ gate: "solo" | "agent_tasks_label" | "none";
192
+ }, {
193
+ kind: "merge";
194
+ method?: "merge" | "squash" | "rebase" | undefined;
195
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
196
+ }>]>, "many">;
197
+ }, "strict", z.ZodTypeAny, {
198
+ name: string;
199
+ when: {
200
+ project?: string | undefined;
201
+ task_label?: string[] | undefined;
202
+ };
203
+ steps: ({
204
+ kind: "branch";
205
+ from: string;
206
+ per_task: boolean;
207
+ } | {
208
+ kind: "review_subagent";
209
+ spawn: "required" | "optional" | "skip";
210
+ agent_type: string;
211
+ rigor: "rigorous" | "quick" | "docs-only";
212
+ on_findings: "fix_then_remerge" | "comment_only";
213
+ template?: string | undefined;
214
+ } | {
215
+ kind: "ci_gate";
216
+ wait_for: string;
217
+ } | {
218
+ kind: "merge";
219
+ method: "merge" | "squash" | "rebase";
220
+ gate: "solo" | "agent_tasks_label" | "none";
221
+ })[];
222
+ }, {
223
+ name: string;
224
+ steps: ({
225
+ kind: "branch";
226
+ from?: string | undefined;
227
+ per_task?: boolean | undefined;
228
+ } | {
229
+ kind: "review_subagent";
230
+ spawn?: "required" | "optional" | "skip" | undefined;
231
+ agent_type?: string | undefined;
232
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
233
+ template?: string | undefined;
234
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
235
+ } | {
236
+ kind: "ci_gate";
237
+ wait_for?: string | undefined;
238
+ } | {
239
+ kind: "merge";
240
+ method?: "merge" | "squash" | "rebase" | undefined;
241
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
242
+ })[];
243
+ when?: {
244
+ project?: string | undefined;
245
+ task_label?: string[] | undefined;
246
+ } | undefined;
247
+ }>, {
248
+ name: string;
249
+ when: {
250
+ project?: string | undefined;
251
+ task_label?: string[] | undefined;
252
+ };
253
+ steps: ({
254
+ kind: "branch";
255
+ from: string;
256
+ per_task: boolean;
257
+ } | {
258
+ kind: "review_subagent";
259
+ spawn: "required" | "optional" | "skip";
260
+ agent_type: string;
261
+ rigor: "rigorous" | "quick" | "docs-only";
262
+ on_findings: "fix_then_remerge" | "comment_only";
263
+ template?: string | undefined;
264
+ } | {
265
+ kind: "ci_gate";
266
+ wait_for: string;
267
+ } | {
268
+ kind: "merge";
269
+ method: "merge" | "squash" | "rebase";
270
+ gate: "solo" | "agent_tasks_label" | "none";
271
+ })[];
272
+ }, {
273
+ name: string;
274
+ steps: ({
275
+ kind: "branch";
276
+ from?: string | undefined;
277
+ per_task?: boolean | undefined;
278
+ } | {
279
+ kind: "review_subagent";
280
+ spawn?: "required" | "optional" | "skip" | undefined;
281
+ agent_type?: string | undefined;
282
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
283
+ template?: string | undefined;
284
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
285
+ } | {
286
+ kind: "ci_gate";
287
+ wait_for?: string | undefined;
288
+ } | {
289
+ kind: "merge";
290
+ method?: "merge" | "squash" | "rebase" | undefined;
291
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
292
+ })[];
293
+ when?: {
294
+ project?: string | undefined;
295
+ task_label?: string[] | undefined;
296
+ } | undefined;
297
+ }>;
298
+ export declare const WorkflowsSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
299
+ name: z.ZodString;
300
+ when: z.ZodDefault<z.ZodObject<{
301
+ task_label: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
302
+ project: z.ZodOptional<z.ZodString>;
303
+ }, "strict", z.ZodTypeAny, {
304
+ project?: string | undefined;
305
+ task_label?: string[] | undefined;
306
+ }, {
307
+ project?: string | undefined;
308
+ task_label?: string[] | undefined;
309
+ }>>;
310
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
311
+ kind: z.ZodLiteral<"branch">;
312
+ from: z.ZodDefault<z.ZodString>;
313
+ per_task: z.ZodDefault<z.ZodBoolean>;
314
+ }, "strict", z.ZodTypeAny, {
315
+ kind: "branch";
316
+ from: string;
317
+ per_task: boolean;
318
+ }, {
319
+ kind: "branch";
320
+ from?: string | undefined;
321
+ per_task?: boolean | undefined;
322
+ }>, z.ZodObject<{
323
+ kind: z.ZodLiteral<"review_subagent">;
324
+ spawn: z.ZodDefault<z.ZodEnum<["required", "optional", "skip"]>>;
325
+ agent_type: z.ZodDefault<z.ZodString>;
326
+ rigor: z.ZodDefault<z.ZodEnum<["rigorous", "quick", "docs-only"]>>;
327
+ template: z.ZodOptional<z.ZodString>;
328
+ on_findings: z.ZodDefault<z.ZodEnum<["fix_then_remerge", "comment_only"]>>;
329
+ }, "strict", z.ZodTypeAny, {
330
+ kind: "review_subagent";
331
+ spawn: "required" | "optional" | "skip";
332
+ agent_type: string;
333
+ rigor: "rigorous" | "quick" | "docs-only";
334
+ on_findings: "fix_then_remerge" | "comment_only";
335
+ template?: string | undefined;
336
+ }, {
337
+ kind: "review_subagent";
338
+ spawn?: "required" | "optional" | "skip" | undefined;
339
+ agent_type?: string | undefined;
340
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
341
+ template?: string | undefined;
342
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
343
+ }>, z.ZodObject<{
344
+ kind: z.ZodLiteral<"ci_gate">;
345
+ wait_for: z.ZodDefault<z.ZodString>;
346
+ }, "strict", z.ZodTypeAny, {
347
+ kind: "ci_gate";
348
+ wait_for: string;
349
+ }, {
350
+ kind: "ci_gate";
351
+ wait_for?: string | undefined;
352
+ }>, z.ZodObject<{
353
+ kind: z.ZodLiteral<"merge">;
354
+ method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
355
+ gate: z.ZodDefault<z.ZodEnum<["solo", "agent_tasks_label", "none"]>>;
356
+ }, "strict", z.ZodTypeAny, {
357
+ kind: "merge";
358
+ method: "merge" | "squash" | "rebase";
359
+ gate: "solo" | "agent_tasks_label" | "none";
360
+ }, {
361
+ kind: "merge";
362
+ method?: "merge" | "squash" | "rebase" | undefined;
363
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
364
+ }>]>, "many">;
365
+ }, "strict", z.ZodTypeAny, {
366
+ name: string;
367
+ when: {
368
+ project?: string | undefined;
369
+ task_label?: string[] | undefined;
370
+ };
371
+ steps: ({
372
+ kind: "branch";
373
+ from: string;
374
+ per_task: boolean;
375
+ } | {
376
+ kind: "review_subagent";
377
+ spawn: "required" | "optional" | "skip";
378
+ agent_type: string;
379
+ rigor: "rigorous" | "quick" | "docs-only";
380
+ on_findings: "fix_then_remerge" | "comment_only";
381
+ template?: string | undefined;
382
+ } | {
383
+ kind: "ci_gate";
384
+ wait_for: string;
385
+ } | {
386
+ kind: "merge";
387
+ method: "merge" | "squash" | "rebase";
388
+ gate: "solo" | "agent_tasks_label" | "none";
389
+ })[];
390
+ }, {
391
+ name: string;
392
+ steps: ({
393
+ kind: "branch";
394
+ from?: string | undefined;
395
+ per_task?: boolean | undefined;
396
+ } | {
397
+ kind: "review_subagent";
398
+ spawn?: "required" | "optional" | "skip" | undefined;
399
+ agent_type?: string | undefined;
400
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
401
+ template?: string | undefined;
402
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
403
+ } | {
404
+ kind: "ci_gate";
405
+ wait_for?: string | undefined;
406
+ } | {
407
+ kind: "merge";
408
+ method?: "merge" | "squash" | "rebase" | undefined;
409
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
410
+ })[];
411
+ when?: {
412
+ project?: string | undefined;
413
+ task_label?: string[] | undefined;
414
+ } | undefined;
415
+ }>, {
416
+ name: string;
417
+ when: {
418
+ project?: string | undefined;
419
+ task_label?: string[] | undefined;
420
+ };
421
+ steps: ({
422
+ kind: "branch";
423
+ from: string;
424
+ per_task: boolean;
425
+ } | {
426
+ kind: "review_subagent";
427
+ spawn: "required" | "optional" | "skip";
428
+ agent_type: string;
429
+ rigor: "rigorous" | "quick" | "docs-only";
430
+ on_findings: "fix_then_remerge" | "comment_only";
431
+ template?: string | undefined;
432
+ } | {
433
+ kind: "ci_gate";
434
+ wait_for: string;
435
+ } | {
436
+ kind: "merge";
437
+ method: "merge" | "squash" | "rebase";
438
+ gate: "solo" | "agent_tasks_label" | "none";
439
+ })[];
440
+ }, {
441
+ name: string;
442
+ steps: ({
443
+ kind: "branch";
444
+ from?: string | undefined;
445
+ per_task?: boolean | undefined;
446
+ } | {
447
+ kind: "review_subagent";
448
+ spawn?: "required" | "optional" | "skip" | undefined;
449
+ agent_type?: string | undefined;
450
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
451
+ template?: string | undefined;
452
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
453
+ } | {
454
+ kind: "ci_gate";
455
+ wait_for?: string | undefined;
456
+ } | {
457
+ kind: "merge";
458
+ method?: "merge" | "squash" | "rebase" | undefined;
459
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
460
+ })[];
461
+ when?: {
462
+ project?: string | undefined;
463
+ task_label?: string[] | undefined;
464
+ } | undefined;
465
+ }>, "many">, {
466
+ name: string;
467
+ when: {
468
+ project?: string | undefined;
469
+ task_label?: string[] | undefined;
470
+ };
471
+ steps: ({
472
+ kind: "branch";
473
+ from: string;
474
+ per_task: boolean;
475
+ } | {
476
+ kind: "review_subagent";
477
+ spawn: "required" | "optional" | "skip";
478
+ agent_type: string;
479
+ rigor: "rigorous" | "quick" | "docs-only";
480
+ on_findings: "fix_then_remerge" | "comment_only";
481
+ template?: string | undefined;
482
+ } | {
483
+ kind: "ci_gate";
484
+ wait_for: string;
485
+ } | {
486
+ kind: "merge";
487
+ method: "merge" | "squash" | "rebase";
488
+ gate: "solo" | "agent_tasks_label" | "none";
489
+ })[];
490
+ }[], {
491
+ name: string;
492
+ steps: ({
493
+ kind: "branch";
494
+ from?: string | undefined;
495
+ per_task?: boolean | undefined;
496
+ } | {
497
+ kind: "review_subagent";
498
+ spawn?: "required" | "optional" | "skip" | undefined;
499
+ agent_type?: string | undefined;
500
+ rigor?: "rigorous" | "quick" | "docs-only" | undefined;
501
+ template?: string | undefined;
502
+ on_findings?: "fix_then_remerge" | "comment_only" | undefined;
503
+ } | {
504
+ kind: "ci_gate";
505
+ wait_for?: string | undefined;
506
+ } | {
507
+ kind: "merge";
508
+ method?: "merge" | "squash" | "rebase" | undefined;
509
+ gate?: "solo" | "agent_tasks_label" | "none" | undefined;
510
+ })[];
511
+ when?: {
512
+ project?: string | undefined;
513
+ task_label?: string[] | undefined;
514
+ } | undefined;
515
+ }[]>;
516
+ export declare const ReviewTemplatesSchema: z.ZodRecord<z.ZodString, z.ZodString>;
517
+ export type Workflow = z.infer<typeof WorkflowSchema>;
518
+ export type WorkflowStep = z.infer<typeof WorkflowStepSchema>;
519
+ export type ReviewTemplates = z.infer<typeof ReviewTemplatesSchema>;
@@ -0,0 +1,81 @@
1
+ import { z } from "zod";
2
+ export const ReviewSpawnSchema = z.enum(["required", "optional", "skip"]);
3
+ export const ReviewRigorSchema = z.enum(["rigorous", "quick", "docs-only"]);
4
+ export const ReviewOnFindingsSchema = z.enum(["fix_then_remerge", "comment_only"]);
5
+ export const MergeMethodSchema = z.enum(["merge", "squash", "rebase"]);
6
+ export const MergeGateSchema = z.enum(["solo", "agent_tasks_label", "none"]);
7
+ export const WorkflowWhenSchema = z
8
+ .object({
9
+ task_label: z.array(z.string().min(1)).min(1).optional(),
10
+ project: z.string().min(1).optional(),
11
+ })
12
+ .strict();
13
+ export const BranchStepSchema = z
14
+ .object({
15
+ kind: z.literal("branch"),
16
+ from: z.string().min(1).default("master"),
17
+ per_task: z.boolean().default(true),
18
+ })
19
+ .strict();
20
+ export const ReviewSubagentStepSchema = z
21
+ .object({
22
+ kind: z.literal("review_subagent"),
23
+ spawn: ReviewSpawnSchema.default("required"),
24
+ agent_type: z.string().min(1).default("Explore"),
25
+ rigor: ReviewRigorSchema.default("rigorous"),
26
+ template: z.string().min(1).optional(),
27
+ on_findings: ReviewOnFindingsSchema.default("fix_then_remerge"),
28
+ })
29
+ .strict();
30
+ export const CiGateStepSchema = z
31
+ .object({
32
+ kind: z.literal("ci_gate"),
33
+ wait_for: z.string().min(1).default("completed/success"),
34
+ })
35
+ .strict();
36
+ export const MergeStepSchema = z
37
+ .object({
38
+ kind: z.literal("merge"),
39
+ method: MergeMethodSchema.default("squash"),
40
+ gate: MergeGateSchema.default("solo"),
41
+ })
42
+ .strict();
43
+ export const WorkflowStepSchema = z.discriminatedUnion("kind", [
44
+ BranchStepSchema,
45
+ ReviewSubagentStepSchema,
46
+ CiGateStepSchema,
47
+ MergeStepSchema,
48
+ ]);
49
+ export const WorkflowSchema = z
50
+ .object({
51
+ name: z.string().min(1),
52
+ when: WorkflowWhenSchema.default({}),
53
+ steps: z.array(WorkflowStepSchema).min(1),
54
+ })
55
+ .strict()
56
+ .superRefine((wf, ctx) => {
57
+ wf.steps.forEach((step, i) => {
58
+ if (step.kind === "review_subagent" && step.spawn === "required" && !step.template) {
59
+ ctx.addIssue({
60
+ code: z.ZodIssueCode.custom,
61
+ path: ["steps", i, "template"],
62
+ message: 'review_subagent with spawn: "required" must set a template name (referencing review_templates)',
63
+ });
64
+ }
65
+ });
66
+ });
67
+ export const WorkflowsSchema = z.array(WorkflowSchema).superRefine((workflows, ctx) => {
68
+ const seen = new Set();
69
+ workflows.forEach((wf, i) => {
70
+ if (seen.has(wf.name)) {
71
+ ctx.addIssue({
72
+ code: z.ZodIssueCode.custom,
73
+ path: [i, "name"],
74
+ message: `duplicate workflow name: ${wf.name}`,
75
+ });
76
+ }
77
+ seen.add(wf.name);
78
+ });
79
+ });
80
+ export const ReviewTemplatesSchema = z.record(z.string().min(1), z.string().min(1));
81
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/schema/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,MAAM,EAAE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EAAE;IACpF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;gBACjB,OAAO,EAAE,4BAA4B,EAAE,CAAC,IAAI,EAAE;aAC/C,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const VERSION: string;
@@ -0,0 +1,3 @@
1
+ import pkg from "../package.json" with { type: "json" };
2
+ export const VERSION = pkg.version;
3
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lannguyensi/harness",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Declarative control plane for agent harnesses — one YAML for grounding, tools, memory, and hooks.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LanNguyenSi/harness",