@planningo/duul 1.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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.ko.md +438 -0
  3. package/README.md +463 -0
  4. package/build/index.d.ts +2 -0
  5. package/build/index.js +18 -0
  6. package/build/prompts/code-review-system.d.ts +9 -0
  7. package/build/prompts/code-review-system.js +116 -0
  8. package/build/prompts/execution-partition-system.d.ts +11 -0
  9. package/build/prompts/execution-partition-system.js +76 -0
  10. package/build/prompts/plan-review-system.d.ts +29 -0
  11. package/build/prompts/plan-review-system.js +175 -0
  12. package/build/schemas/code-review.d.ts +514 -0
  13. package/build/schemas/code-review.js +175 -0
  14. package/build/schemas/common.d.ts +118 -0
  15. package/build/schemas/common.js +64 -0
  16. package/build/schemas/execution-partition.d.ts +597 -0
  17. package/build/schemas/execution-partition.js +107 -0
  18. package/build/schemas/plan-review.d.ts +523 -0
  19. package/build/schemas/plan-review.js +175 -0
  20. package/build/services/filesystem-tools.d.ts +6 -0
  21. package/build/services/filesystem-tools.js +39 -0
  22. package/build/services/filesystem.d.ts +69 -0
  23. package/build/services/filesystem.js +609 -0
  24. package/build/services/pricing.d.ts +8 -0
  25. package/build/services/pricing.js +105 -0
  26. package/build/services/providers/anthropic.d.ts +28 -0
  27. package/build/services/providers/anthropic.js +431 -0
  28. package/build/services/providers/google.d.ts +28 -0
  29. package/build/services/providers/google.js +358 -0
  30. package/build/services/providers/openai.d.ts +22 -0
  31. package/build/services/providers/openai.js +395 -0
  32. package/build/services/providers/types.d.ts +82 -0
  33. package/build/services/providers/types.js +1 -0
  34. package/build/services/review-gates.d.ts +83 -0
  35. package/build/services/review-gates.js +200 -0
  36. package/build/services/review-limits.d.ts +36 -0
  37. package/build/services/review-limits.js +65 -0
  38. package/build/services/reviewer.d.ts +30 -0
  39. package/build/services/reviewer.js +243 -0
  40. package/build/services/usage-logger.d.ts +2 -0
  41. package/build/services/usage-logger.js +42 -0
  42. package/build/tools/code-review.d.ts +2 -0
  43. package/build/tools/code-review.js +178 -0
  44. package/build/tools/execution-partition.d.ts +2 -0
  45. package/build/tools/execution-partition.js +146 -0
  46. package/build/tools/plan-review.d.ts +2 -0
  47. package/build/tools/plan-review.js +183 -0
  48. package/package.json +65 -0
@@ -0,0 +1,597 @@
1
+ import { z } from 'zod';
2
+ export declare const ExecutionPartitionInputSchema: z.ZodObject<{
3
+ approved_plan: z.ZodString;
4
+ workspace_root: z.ZodString;
5
+ working_directories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6
+ changed_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ entrypoints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ artifact_refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
9
+ path: z.ZodString;
10
+ reason: z.ZodString;
11
+ priority: z.ZodEnum<["high", "medium", "low"]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ path: string;
14
+ reason: string;
15
+ priority: "high" | "medium" | "low";
16
+ }, {
17
+ path: string;
18
+ reason: string;
19
+ priority: "high" | "medium" | "low";
20
+ }>, "many">>;
21
+ constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
+ max_parallelism: z.ZodOptional<z.ZodNumber>;
23
+ previous_review_id: z.ZodOptional<z.ZodString>;
24
+ iteration_count: z.ZodOptional<z.ZodNumber>;
25
+ max_review_iterations: z.ZodOptional<z.ZodNumber>;
26
+ reviewer_config: z.ZodOptional<z.ZodObject<{
27
+ provider: z.ZodOptional<z.ZodEnum<["openai", "anthropic", "google", "openrouter", "compatible"]>>;
28
+ model: z.ZodOptional<z.ZodString>;
29
+ base_url: z.ZodOptional<z.ZodString>;
30
+ api_key: z.ZodOptional<z.ZodString>;
31
+ temperature: z.ZodOptional<z.ZodNumber>;
32
+ top_p: z.ZodOptional<z.ZodNumber>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ provider?: "openai" | "anthropic" | "google" | "openrouter" | "compatible" | undefined;
35
+ model?: string | undefined;
36
+ base_url?: string | undefined;
37
+ api_key?: string | undefined;
38
+ temperature?: number | undefined;
39
+ top_p?: number | undefined;
40
+ }, {
41
+ provider?: "openai" | "anthropic" | "google" | "openrouter" | "compatible" | undefined;
42
+ model?: string | undefined;
43
+ base_url?: string | undefined;
44
+ api_key?: string | undefined;
45
+ temperature?: number | undefined;
46
+ top_p?: number | undefined;
47
+ }>>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ workspace_root: string;
50
+ approved_plan: string;
51
+ iteration_count?: number | undefined;
52
+ changed_files?: string[] | undefined;
53
+ constraints?: string[] | undefined;
54
+ working_directories?: string[] | undefined;
55
+ entrypoints?: string[] | undefined;
56
+ artifact_refs?: {
57
+ path: string;
58
+ reason: string;
59
+ priority: "high" | "medium" | "low";
60
+ }[] | undefined;
61
+ previous_review_id?: string | undefined;
62
+ max_review_iterations?: number | undefined;
63
+ reviewer_config?: {
64
+ provider?: "openai" | "anthropic" | "google" | "openrouter" | "compatible" | undefined;
65
+ model?: string | undefined;
66
+ base_url?: string | undefined;
67
+ api_key?: string | undefined;
68
+ temperature?: number | undefined;
69
+ top_p?: number | undefined;
70
+ } | undefined;
71
+ max_parallelism?: number | undefined;
72
+ }, {
73
+ workspace_root: string;
74
+ approved_plan: string;
75
+ iteration_count?: number | undefined;
76
+ changed_files?: string[] | undefined;
77
+ constraints?: string[] | undefined;
78
+ working_directories?: string[] | undefined;
79
+ entrypoints?: string[] | undefined;
80
+ artifact_refs?: {
81
+ path: string;
82
+ reason: string;
83
+ priority: "high" | "medium" | "low";
84
+ }[] | undefined;
85
+ previous_review_id?: string | undefined;
86
+ max_review_iterations?: number | undefined;
87
+ reviewer_config?: {
88
+ provider?: "openai" | "anthropic" | "google" | "openrouter" | "compatible" | undefined;
89
+ model?: string | undefined;
90
+ base_url?: string | undefined;
91
+ api_key?: string | undefined;
92
+ temperature?: number | undefined;
93
+ top_p?: number | undefined;
94
+ } | undefined;
95
+ max_parallelism?: number | undefined;
96
+ }>;
97
+ export declare const ExecutionPartitionOutputSchema: z.ZodObject<{
98
+ execution_mode: z.ZodEnum<["serial", "parallel", "hybrid"]>;
99
+ rationale: z.ZodString;
100
+ requires_human_checkpoint: z.ZodBoolean;
101
+ human_checkpoint_reasons: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
102
+ spawn_strategy: z.ZodEnum<["new_workspace", "reuse_workspace"]>;
103
+ handoff_artifact_pattern: z.ZodString;
104
+ subtask_result_schema_version: z.ZodLiteral<"1.0">;
105
+ subtasks: z.ZodArray<z.ZodObject<{
106
+ id: z.ZodString;
107
+ title: z.ZodString;
108
+ goal: z.ZodString;
109
+ can_run_in_parallel: z.ZodBoolean;
110
+ depends_on: z.ZodArray<z.ZodString, "many">;
111
+ workspace_name_hint: z.ZodString;
112
+ spawn_strategy: z.ZodEnum<["new_workspace", "reuse_workspace"]>;
113
+ scope: z.ZodObject<{
114
+ working_directories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
115
+ changed_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
116
+ entrypoints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
117
+ artifact_refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
118
+ path: z.ZodString;
119
+ reason: z.ZodString;
120
+ priority: z.ZodEnum<["high", "medium", "low"]>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ path: string;
123
+ reason: string;
124
+ priority: "high" | "medium" | "low";
125
+ }, {
126
+ path: string;
127
+ reason: string;
128
+ priority: "high" | "medium" | "low";
129
+ }>, "many">>;
130
+ linked_roots: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ changed_files?: string[] | undefined;
133
+ working_directories?: string[] | undefined;
134
+ linked_roots?: string[] | undefined;
135
+ entrypoints?: string[] | undefined;
136
+ artifact_refs?: {
137
+ path: string;
138
+ reason: string;
139
+ priority: "high" | "medium" | "low";
140
+ }[] | undefined;
141
+ }, {
142
+ changed_files?: string[] | undefined;
143
+ working_directories?: string[] | undefined;
144
+ linked_roots?: string[] | undefined;
145
+ entrypoints?: string[] | undefined;
146
+ artifact_refs?: {
147
+ path: string;
148
+ reason: string;
149
+ priority: "high" | "medium" | "low";
150
+ }[] | undefined;
151
+ }>;
152
+ handoff_contract: z.ZodArray<z.ZodString, "many">;
153
+ completion_criteria: z.ZodArray<z.ZodString, "many">;
154
+ review_focus: z.ZodArray<z.ZodString, "many">;
155
+ risk_level: z.ZodEnum<["high", "medium", "low"]>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ id: string;
158
+ title: string;
159
+ goal: string;
160
+ can_run_in_parallel: boolean;
161
+ depends_on: string[];
162
+ workspace_name_hint: string;
163
+ spawn_strategy: "new_workspace" | "reuse_workspace";
164
+ scope: {
165
+ changed_files?: string[] | undefined;
166
+ working_directories?: string[] | undefined;
167
+ linked_roots?: string[] | undefined;
168
+ entrypoints?: string[] | undefined;
169
+ artifact_refs?: {
170
+ path: string;
171
+ reason: string;
172
+ priority: "high" | "medium" | "low";
173
+ }[] | undefined;
174
+ };
175
+ handoff_contract: string[];
176
+ completion_criteria: string[];
177
+ review_focus: string[];
178
+ risk_level: "high" | "medium" | "low";
179
+ }, {
180
+ id: string;
181
+ title: string;
182
+ goal: string;
183
+ can_run_in_parallel: boolean;
184
+ depends_on: string[];
185
+ workspace_name_hint: string;
186
+ spawn_strategy: "new_workspace" | "reuse_workspace";
187
+ scope: {
188
+ changed_files?: string[] | undefined;
189
+ working_directories?: string[] | undefined;
190
+ linked_roots?: string[] | undefined;
191
+ entrypoints?: string[] | undefined;
192
+ artifact_refs?: {
193
+ path: string;
194
+ reason: string;
195
+ priority: "high" | "medium" | "low";
196
+ }[] | undefined;
197
+ };
198
+ handoff_contract: string[];
199
+ completion_criteria: string[];
200
+ review_focus: string[];
201
+ risk_level: "high" | "medium" | "low";
202
+ }>, "many">;
203
+ global_checkpoints: z.ZodArray<z.ZodString, "many">;
204
+ merge_order: z.ZodArray<z.ZodString, "many">;
205
+ retry_policy: z.ZodObject<{
206
+ max_retries: z.ZodNumber;
207
+ on_review_revise: z.ZodLiteral<"retry_subtask">;
208
+ on_tool_exhaustion: z.ZodLiteral<"retry_with_narrower_scope">;
209
+ on_conflict: z.ZodLiteral<"serialize_and_retry">;
210
+ on_blocker: z.ZodLiteral<"escalate_to_human">;
211
+ on_max_retries_exceeded: z.ZodLiteral<"abort_subtask_and_report">;
212
+ }, "strip", z.ZodTypeAny, {
213
+ max_retries: number;
214
+ on_review_revise: "retry_subtask";
215
+ on_tool_exhaustion: "retry_with_narrower_scope";
216
+ on_conflict: "serialize_and_retry";
217
+ on_blocker: "escalate_to_human";
218
+ on_max_retries_exceeded: "abort_subtask_and_report";
219
+ }, {
220
+ max_retries: number;
221
+ on_review_revise: "retry_subtask";
222
+ on_tool_exhaustion: "retry_with_narrower_scope";
223
+ on_conflict: "serialize_and_retry";
224
+ on_blocker: "escalate_to_human";
225
+ on_max_retries_exceeded: "abort_subtask_and_report";
226
+ }>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ spawn_strategy: "new_workspace" | "reuse_workspace";
229
+ execution_mode: "serial" | "parallel" | "hybrid";
230
+ rationale: string;
231
+ requires_human_checkpoint: boolean;
232
+ human_checkpoint_reasons: string[] | null;
233
+ handoff_artifact_pattern: string;
234
+ subtask_result_schema_version: "1.0";
235
+ subtasks: {
236
+ id: string;
237
+ title: string;
238
+ goal: string;
239
+ can_run_in_parallel: boolean;
240
+ depends_on: string[];
241
+ workspace_name_hint: string;
242
+ spawn_strategy: "new_workspace" | "reuse_workspace";
243
+ scope: {
244
+ changed_files?: string[] | undefined;
245
+ working_directories?: string[] | undefined;
246
+ linked_roots?: string[] | undefined;
247
+ entrypoints?: string[] | undefined;
248
+ artifact_refs?: {
249
+ path: string;
250
+ reason: string;
251
+ priority: "high" | "medium" | "low";
252
+ }[] | undefined;
253
+ };
254
+ handoff_contract: string[];
255
+ completion_criteria: string[];
256
+ review_focus: string[];
257
+ risk_level: "high" | "medium" | "low";
258
+ }[];
259
+ global_checkpoints: string[];
260
+ merge_order: string[];
261
+ retry_policy: {
262
+ max_retries: number;
263
+ on_review_revise: "retry_subtask";
264
+ on_tool_exhaustion: "retry_with_narrower_scope";
265
+ on_conflict: "serialize_and_retry";
266
+ on_blocker: "escalate_to_human";
267
+ on_max_retries_exceeded: "abort_subtask_and_report";
268
+ };
269
+ }, {
270
+ spawn_strategy: "new_workspace" | "reuse_workspace";
271
+ execution_mode: "serial" | "parallel" | "hybrid";
272
+ rationale: string;
273
+ requires_human_checkpoint: boolean;
274
+ human_checkpoint_reasons: string[] | null;
275
+ handoff_artifact_pattern: string;
276
+ subtask_result_schema_version: "1.0";
277
+ subtasks: {
278
+ id: string;
279
+ title: string;
280
+ goal: string;
281
+ can_run_in_parallel: boolean;
282
+ depends_on: string[];
283
+ workspace_name_hint: string;
284
+ spawn_strategy: "new_workspace" | "reuse_workspace";
285
+ scope: {
286
+ changed_files?: string[] | undefined;
287
+ working_directories?: string[] | undefined;
288
+ linked_roots?: string[] | undefined;
289
+ entrypoints?: string[] | undefined;
290
+ artifact_refs?: {
291
+ path: string;
292
+ reason: string;
293
+ priority: "high" | "medium" | "low";
294
+ }[] | undefined;
295
+ };
296
+ handoff_contract: string[];
297
+ completion_criteria: string[];
298
+ review_focus: string[];
299
+ risk_level: "high" | "medium" | "low";
300
+ }[];
301
+ global_checkpoints: string[];
302
+ merge_order: string[];
303
+ retry_policy: {
304
+ max_retries: number;
305
+ on_review_revise: "retry_subtask";
306
+ on_tool_exhaustion: "retry_with_narrower_scope";
307
+ on_conflict: "serialize_and_retry";
308
+ on_blocker: "escalate_to_human";
309
+ on_max_retries_exceeded: "abort_subtask_and_report";
310
+ };
311
+ }>;
312
+ export declare const ExecutionPartitionMcpOutputSchema: z.ZodObject<{
313
+ execution_mode: z.ZodEnum<["serial", "parallel", "hybrid"]>;
314
+ rationale: z.ZodString;
315
+ requires_human_checkpoint: z.ZodBoolean;
316
+ human_checkpoint_reasons: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
317
+ spawn_strategy: z.ZodEnum<["new_workspace", "reuse_workspace"]>;
318
+ handoff_artifact_pattern: z.ZodString;
319
+ subtask_result_schema_version: z.ZodLiteral<"1.0">;
320
+ subtasks: z.ZodArray<z.ZodObject<{
321
+ id: z.ZodString;
322
+ title: z.ZodString;
323
+ goal: z.ZodString;
324
+ can_run_in_parallel: z.ZodBoolean;
325
+ depends_on: z.ZodArray<z.ZodString, "many">;
326
+ workspace_name_hint: z.ZodString;
327
+ spawn_strategy: z.ZodEnum<["new_workspace", "reuse_workspace"]>;
328
+ scope: z.ZodObject<{
329
+ working_directories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
330
+ changed_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
331
+ entrypoints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
332
+ artifact_refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
333
+ path: z.ZodString;
334
+ reason: z.ZodString;
335
+ priority: z.ZodEnum<["high", "medium", "low"]>;
336
+ }, "strip", z.ZodTypeAny, {
337
+ path: string;
338
+ reason: string;
339
+ priority: "high" | "medium" | "low";
340
+ }, {
341
+ path: string;
342
+ reason: string;
343
+ priority: "high" | "medium" | "low";
344
+ }>, "many">>;
345
+ linked_roots: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
346
+ }, "strip", z.ZodTypeAny, {
347
+ changed_files?: string[] | undefined;
348
+ working_directories?: string[] | undefined;
349
+ linked_roots?: string[] | undefined;
350
+ entrypoints?: string[] | undefined;
351
+ artifact_refs?: {
352
+ path: string;
353
+ reason: string;
354
+ priority: "high" | "medium" | "low";
355
+ }[] | undefined;
356
+ }, {
357
+ changed_files?: string[] | undefined;
358
+ working_directories?: string[] | undefined;
359
+ linked_roots?: string[] | undefined;
360
+ entrypoints?: string[] | undefined;
361
+ artifact_refs?: {
362
+ path: string;
363
+ reason: string;
364
+ priority: "high" | "medium" | "low";
365
+ }[] | undefined;
366
+ }>;
367
+ handoff_contract: z.ZodArray<z.ZodString, "many">;
368
+ completion_criteria: z.ZodArray<z.ZodString, "many">;
369
+ review_focus: z.ZodArray<z.ZodString, "many">;
370
+ risk_level: z.ZodEnum<["high", "medium", "low"]>;
371
+ }, "strip", z.ZodTypeAny, {
372
+ id: string;
373
+ title: string;
374
+ goal: string;
375
+ can_run_in_parallel: boolean;
376
+ depends_on: string[];
377
+ workspace_name_hint: string;
378
+ spawn_strategy: "new_workspace" | "reuse_workspace";
379
+ scope: {
380
+ changed_files?: string[] | undefined;
381
+ working_directories?: string[] | undefined;
382
+ linked_roots?: string[] | undefined;
383
+ entrypoints?: string[] | undefined;
384
+ artifact_refs?: {
385
+ path: string;
386
+ reason: string;
387
+ priority: "high" | "medium" | "low";
388
+ }[] | undefined;
389
+ };
390
+ handoff_contract: string[];
391
+ completion_criteria: string[];
392
+ review_focus: string[];
393
+ risk_level: "high" | "medium" | "low";
394
+ }, {
395
+ id: string;
396
+ title: string;
397
+ goal: string;
398
+ can_run_in_parallel: boolean;
399
+ depends_on: string[];
400
+ workspace_name_hint: string;
401
+ spawn_strategy: "new_workspace" | "reuse_workspace";
402
+ scope: {
403
+ changed_files?: string[] | undefined;
404
+ working_directories?: string[] | undefined;
405
+ linked_roots?: string[] | undefined;
406
+ entrypoints?: string[] | undefined;
407
+ artifact_refs?: {
408
+ path: string;
409
+ reason: string;
410
+ priority: "high" | "medium" | "low";
411
+ }[] | undefined;
412
+ };
413
+ handoff_contract: string[];
414
+ completion_criteria: string[];
415
+ review_focus: string[];
416
+ risk_level: "high" | "medium" | "low";
417
+ }>, "many">;
418
+ global_checkpoints: z.ZodArray<z.ZodString, "many">;
419
+ merge_order: z.ZodArray<z.ZodString, "many">;
420
+ retry_policy: z.ZodObject<{
421
+ max_retries: z.ZodNumber;
422
+ on_review_revise: z.ZodLiteral<"retry_subtask">;
423
+ on_tool_exhaustion: z.ZodLiteral<"retry_with_narrower_scope">;
424
+ on_conflict: z.ZodLiteral<"serialize_and_retry">;
425
+ on_blocker: z.ZodLiteral<"escalate_to_human">;
426
+ on_max_retries_exceeded: z.ZodLiteral<"abort_subtask_and_report">;
427
+ }, "strip", z.ZodTypeAny, {
428
+ max_retries: number;
429
+ on_review_revise: "retry_subtask";
430
+ on_tool_exhaustion: "retry_with_narrower_scope";
431
+ on_conflict: "serialize_and_retry";
432
+ on_blocker: "escalate_to_human";
433
+ on_max_retries_exceeded: "abort_subtask_and_report";
434
+ }, {
435
+ max_retries: number;
436
+ on_review_revise: "retry_subtask";
437
+ on_tool_exhaustion: "retry_with_narrower_scope";
438
+ on_conflict: "serialize_and_retry";
439
+ on_blocker: "escalate_to_human";
440
+ on_max_retries_exceeded: "abort_subtask_and_report";
441
+ }>;
442
+ } & {
443
+ review_id: z.ZodString;
444
+ } & {
445
+ iteration_count: z.ZodNumber;
446
+ iteration_limit: z.ZodNumber;
447
+ iteration_limit_reached: z.ZodBoolean;
448
+ } & {
449
+ token_usage: z.ZodObject<{
450
+ input_tokens: z.ZodNumber;
451
+ output_tokens: z.ZodNumber;
452
+ total_tokens: z.ZodNumber;
453
+ api_calls: z.ZodNumber;
454
+ provider: z.ZodString;
455
+ model: z.ZodString;
456
+ estimated_cost_usd: z.ZodNullable<z.ZodNumber>;
457
+ cached_input_tokens: z.ZodOptional<z.ZodNumber>;
458
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
459
+ }, "strip", z.ZodTypeAny, {
460
+ provider: string;
461
+ model: string;
462
+ input_tokens: number;
463
+ output_tokens: number;
464
+ total_tokens: number;
465
+ api_calls: number;
466
+ estimated_cost_usd: number | null;
467
+ cached_input_tokens?: number | undefined;
468
+ cache_creation_input_tokens?: number | undefined;
469
+ }, {
470
+ provider: string;
471
+ model: string;
472
+ input_tokens: number;
473
+ output_tokens: number;
474
+ total_tokens: number;
475
+ api_calls: number;
476
+ estimated_cost_usd: number | null;
477
+ cached_input_tokens?: number | undefined;
478
+ cache_creation_input_tokens?: number | undefined;
479
+ }>;
480
+ }, "strip", z.ZodTypeAny, {
481
+ iteration_count: number;
482
+ iteration_limit: number;
483
+ iteration_limit_reached: boolean;
484
+ token_usage: {
485
+ provider: string;
486
+ model: string;
487
+ input_tokens: number;
488
+ output_tokens: number;
489
+ total_tokens: number;
490
+ api_calls: number;
491
+ estimated_cost_usd: number | null;
492
+ cached_input_tokens?: number | undefined;
493
+ cache_creation_input_tokens?: number | undefined;
494
+ };
495
+ review_id: string;
496
+ spawn_strategy: "new_workspace" | "reuse_workspace";
497
+ execution_mode: "serial" | "parallel" | "hybrid";
498
+ rationale: string;
499
+ requires_human_checkpoint: boolean;
500
+ human_checkpoint_reasons: string[] | null;
501
+ handoff_artifact_pattern: string;
502
+ subtask_result_schema_version: "1.0";
503
+ subtasks: {
504
+ id: string;
505
+ title: string;
506
+ goal: string;
507
+ can_run_in_parallel: boolean;
508
+ depends_on: string[];
509
+ workspace_name_hint: string;
510
+ spawn_strategy: "new_workspace" | "reuse_workspace";
511
+ scope: {
512
+ changed_files?: string[] | undefined;
513
+ working_directories?: string[] | undefined;
514
+ linked_roots?: string[] | undefined;
515
+ entrypoints?: string[] | undefined;
516
+ artifact_refs?: {
517
+ path: string;
518
+ reason: string;
519
+ priority: "high" | "medium" | "low";
520
+ }[] | undefined;
521
+ };
522
+ handoff_contract: string[];
523
+ completion_criteria: string[];
524
+ review_focus: string[];
525
+ risk_level: "high" | "medium" | "low";
526
+ }[];
527
+ global_checkpoints: string[];
528
+ merge_order: string[];
529
+ retry_policy: {
530
+ max_retries: number;
531
+ on_review_revise: "retry_subtask";
532
+ on_tool_exhaustion: "retry_with_narrower_scope";
533
+ on_conflict: "serialize_and_retry";
534
+ on_blocker: "escalate_to_human";
535
+ on_max_retries_exceeded: "abort_subtask_and_report";
536
+ };
537
+ }, {
538
+ iteration_count: number;
539
+ iteration_limit: number;
540
+ iteration_limit_reached: boolean;
541
+ token_usage: {
542
+ provider: string;
543
+ model: string;
544
+ input_tokens: number;
545
+ output_tokens: number;
546
+ total_tokens: number;
547
+ api_calls: number;
548
+ estimated_cost_usd: number | null;
549
+ cached_input_tokens?: number | undefined;
550
+ cache_creation_input_tokens?: number | undefined;
551
+ };
552
+ review_id: string;
553
+ spawn_strategy: "new_workspace" | "reuse_workspace";
554
+ execution_mode: "serial" | "parallel" | "hybrid";
555
+ rationale: string;
556
+ requires_human_checkpoint: boolean;
557
+ human_checkpoint_reasons: string[] | null;
558
+ handoff_artifact_pattern: string;
559
+ subtask_result_schema_version: "1.0";
560
+ subtasks: {
561
+ id: string;
562
+ title: string;
563
+ goal: string;
564
+ can_run_in_parallel: boolean;
565
+ depends_on: string[];
566
+ workspace_name_hint: string;
567
+ spawn_strategy: "new_workspace" | "reuse_workspace";
568
+ scope: {
569
+ changed_files?: string[] | undefined;
570
+ working_directories?: string[] | undefined;
571
+ linked_roots?: string[] | undefined;
572
+ entrypoints?: string[] | undefined;
573
+ artifact_refs?: {
574
+ path: string;
575
+ reason: string;
576
+ priority: "high" | "medium" | "low";
577
+ }[] | undefined;
578
+ };
579
+ handoff_contract: string[];
580
+ completion_criteria: string[];
581
+ review_focus: string[];
582
+ risk_level: "high" | "medium" | "low";
583
+ }[];
584
+ global_checkpoints: string[];
585
+ merge_order: string[];
586
+ retry_policy: {
587
+ max_retries: number;
588
+ on_review_revise: "retry_subtask";
589
+ on_tool_exhaustion: "retry_with_narrower_scope";
590
+ on_conflict: "serialize_and_retry";
591
+ on_blocker: "escalate_to_human";
592
+ on_max_retries_exceeded: "abort_subtask_and_report";
593
+ };
594
+ }>;
595
+ export type ExecutionPartitionInput = z.infer<typeof ExecutionPartitionInputSchema>;
596
+ export type ExecutionPartitionOutput = z.infer<typeof ExecutionPartitionOutputSchema>;
597
+ export type ExecutionPartitionMcpOutput = z.infer<typeof ExecutionPartitionMcpOutputSchema>;