@defai.digital/contracts 13.3.0 → 13.4.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 (108) hide show
  1. package/dist/agent/v1/index.d.ts +1 -1
  2. package/dist/agent/v1/index.d.ts.map +1 -1
  3. package/dist/agent/v1/index.js +2 -2
  4. package/dist/agent/v1/index.js.map +1 -1
  5. package/dist/agent/v1/schema.d.ts +79 -58
  6. package/dist/agent/v1/schema.d.ts.map +1 -1
  7. package/dist/agent/v1/schema.js +15 -9
  8. package/dist/agent/v1/schema.js.map +1 -1
  9. package/dist/autonomous-loop/v1/index.d.ts +8 -0
  10. package/dist/autonomous-loop/v1/index.d.ts.map +1 -0
  11. package/dist/autonomous-loop/v1/index.js +26 -0
  12. package/dist/autonomous-loop/v1/index.js.map +1 -0
  13. package/dist/autonomous-loop/v1/schema.d.ts +3796 -0
  14. package/dist/autonomous-loop/v1/schema.d.ts.map +1 -0
  15. package/dist/autonomous-loop/v1/schema.js +583 -0
  16. package/dist/autonomous-loop/v1/schema.js.map +1 -0
  17. package/dist/cli/v1/schema.d.ts +2 -2
  18. package/dist/config/v1/config.d.ts +40 -0
  19. package/dist/config/v1/config.d.ts.map +1 -1
  20. package/dist/config/v1/config.js +18 -0
  21. package/dist/config/v1/config.js.map +1 -1
  22. package/dist/config/v1/index.d.ts +1 -1
  23. package/dist/config/v1/index.d.ts.map +1 -1
  24. package/dist/config/v1/index.js +1 -1
  25. package/dist/config/v1/index.js.map +1 -1
  26. package/dist/config/v1/provider-config.d.ts +10 -10
  27. package/dist/config/v1/provider-config.d.ts.map +1 -1
  28. package/dist/config/v1/provider-config.js +10 -0
  29. package/dist/config/v1/provider-config.js.map +1 -1
  30. package/dist/cross-cutting/v1/saga.d.ts +2 -2
  31. package/dist/design/v1/schema.d.ts +2 -2
  32. package/dist/discussion/v1/index.d.ts +1 -1
  33. package/dist/discussion/v1/index.d.ts.map +1 -1
  34. package/dist/discussion/v1/index.js +1 -1
  35. package/dist/discussion/v1/index.js.map +1 -1
  36. package/dist/discussion/v1/schema.d.ts +76 -5
  37. package/dist/discussion/v1/schema.d.ts.map +1 -1
  38. package/dist/discussion/v1/schema.js +29 -0
  39. package/dist/discussion/v1/schema.js.map +1 -1
  40. package/dist/feedback/v1/index.d.ts +5 -0
  41. package/dist/feedback/v1/index.d.ts.map +1 -0
  42. package/dist/feedback/v1/index.js +5 -0
  43. package/dist/feedback/v1/index.js.map +1 -0
  44. package/dist/feedback/v1/schema.d.ts +381 -0
  45. package/dist/feedback/v1/schema.d.ts.map +1 -0
  46. package/dist/feedback/v1/schema.js +282 -0
  47. package/dist/feedback/v1/schema.js.map +1 -0
  48. package/dist/index.d.ts +12 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +18 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/mcp/v1/tools/agent.d.ts +39 -0
  53. package/dist/mcp/v1/tools/agent.d.ts.map +1 -1
  54. package/dist/mcp/v1/tools/agent.js +25 -0
  55. package/dist/mcp/v1/tools/agent.js.map +1 -1
  56. package/dist/mcp/v1/tools/session.d.ts +43 -0
  57. package/dist/mcp/v1/tools/session.d.ts.map +1 -1
  58. package/dist/mcp/v1/tools/session.js +40 -0
  59. package/dist/mcp/v1/tools/session.js.map +1 -1
  60. package/dist/mcp/v1/tools/trace.d.ts +134 -0
  61. package/dist/mcp/v1/tools/trace.d.ts.map +1 -1
  62. package/dist/mcp/v1/tools/trace.js +55 -0
  63. package/dist/mcp/v1/tools/trace.js.map +1 -1
  64. package/dist/mcp-ecosystem/v1/index.d.ts +7 -0
  65. package/dist/mcp-ecosystem/v1/index.d.ts.map +1 -0
  66. package/dist/mcp-ecosystem/v1/index.js +7 -0
  67. package/dist/mcp-ecosystem/v1/index.js.map +1 -0
  68. package/dist/mcp-ecosystem/v1/schema.d.ts +1690 -0
  69. package/dist/mcp-ecosystem/v1/schema.d.ts.map +1 -0
  70. package/dist/mcp-ecosystem/v1/schema.js +590 -0
  71. package/dist/mcp-ecosystem/v1/schema.js.map +1 -0
  72. package/dist/ml-lifecycle/v1/schema.d.ts +6 -6
  73. package/dist/orchestration/v1/schema.d.ts +8 -8
  74. package/dist/parallel-execution/v1/index.d.ts +8 -0
  75. package/dist/parallel-execution/v1/index.d.ts.map +1 -0
  76. package/dist/parallel-execution/v1/index.js +8 -0
  77. package/dist/parallel-execution/v1/index.js.map +1 -0
  78. package/dist/parallel-execution/v1/schema.d.ts +1218 -0
  79. package/dist/parallel-execution/v1/schema.d.ts.map +1 -0
  80. package/dist/parallel-execution/v1/schema.js +489 -0
  81. package/dist/parallel-execution/v1/schema.js.map +1 -0
  82. package/dist/provider/v1/port.d.ts +2 -2
  83. package/dist/research/v1/index.d.ts +5 -0
  84. package/dist/research/v1/index.d.ts.map +1 -0
  85. package/dist/research/v1/index.js +5 -0
  86. package/dist/research/v1/index.js.map +1 -0
  87. package/dist/research/v1/schema.d.ts +844 -0
  88. package/dist/research/v1/schema.d.ts.map +1 -0
  89. package/dist/research/v1/schema.js +230 -0
  90. package/dist/research/v1/schema.js.map +1 -0
  91. package/dist/semantic-context/v1/index.d.ts +8 -0
  92. package/dist/semantic-context/v1/index.d.ts.map +1 -0
  93. package/dist/semantic-context/v1/index.js +8 -0
  94. package/dist/semantic-context/v1/index.js.map +1 -0
  95. package/dist/semantic-context/v1/schema.d.ts +1195 -0
  96. package/dist/semantic-context/v1/schema.d.ts.map +1 -0
  97. package/dist/semantic-context/v1/schema.js +510 -0
  98. package/dist/semantic-context/v1/schema.js.map +1 -0
  99. package/dist/trace/v1/index.d.ts +1 -1
  100. package/dist/trace/v1/index.d.ts.map +1 -1
  101. package/dist/trace/v1/index.js +3 -1
  102. package/dist/trace/v1/index.js.map +1 -1
  103. package/dist/trace/v1/schema.d.ts +438 -11
  104. package/dist/trace/v1/schema.d.ts.map +1 -1
  105. package/dist/trace/v1/schema.js +144 -0
  106. package/dist/trace/v1/schema.js.map +1 -1
  107. package/dist/workflow-templates/v1/schema.d.ts +6 -6
  108. package/package.json +1 -1
@@ -0,0 +1,3796 @@
1
+ /**
2
+ * Autonomous Loop Contracts v1
3
+ *
4
+ * Schemas for governed write-test-fix cycles with guard gate integration.
5
+ *
6
+ * This enables autonomous development workflows where agents can iterate
7
+ * through planning, writing, testing, and fixing code while respecting
8
+ * governance policies and breakpoints.
9
+ */
10
+ import { z } from 'zod';
11
+ /**
12
+ * Phases of the autonomous loop
13
+ *
14
+ * - plan: Analyze requirements and plan implementation
15
+ * - write: Generate or modify code
16
+ * - test: Execute tests to verify changes
17
+ * - fix: Attempt to fix failing tests
18
+ * - verify: Final verification before completion
19
+ * - complete: Loop finished successfully
20
+ */
21
+ export declare const AutonomousLoopPhaseSchema: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
22
+ export type AutonomousLoopPhase = z.infer<typeof AutonomousLoopPhaseSchema>;
23
+ /**
24
+ * Status of the autonomous loop
25
+ *
26
+ * - running: Loop is actively executing
27
+ * - paused: Loop is paused at a breakpoint
28
+ * - completed: Loop finished successfully
29
+ * - failed: Loop failed after max retries
30
+ * - blocked: Loop blocked by guard gate
31
+ * - cancelled: Loop was cancelled by user
32
+ */
33
+ export declare const AutonomousLoopStatusSchema: z.ZodEnum<["running", "paused", "completed", "failed", "blocked", "cancelled"]>;
34
+ export type AutonomousLoopStatus = z.infer<typeof AutonomousLoopStatusSchema>;
35
+ /**
36
+ * Configuration for autonomous loop execution
37
+ *
38
+ * Invariants:
39
+ * - INV-ALO-001: Guard gates run after EVERY write phase
40
+ * - INV-ALO-002: Test phase required before verify (when requireTestPass=true)
41
+ * - INV-ALO-003: Fix attempts bounded by maxFixAttempts
42
+ * - INV-ALO-004: Breakpoints pause for user review
43
+ */
44
+ export declare const AutonomousLoopConfigSchema: z.ZodObject<{
45
+ /**
46
+ * Maximum iterations through the loop
47
+ */
48
+ maxIterations: z.ZodDefault<z.ZodNumber>;
49
+ /**
50
+ * Maximum fix attempts per iteration
51
+ * INV-ALO-003: Bounded fix attempts
52
+ */
53
+ maxFixAttempts: z.ZodDefault<z.ZodNumber>;
54
+ /**
55
+ * Guard policy to enforce
56
+ * INV-ALO-001: Guards run after write
57
+ */
58
+ guardPolicy: z.ZodOptional<z.ZodString>;
59
+ /**
60
+ * Whether tests must pass before verify phase
61
+ * INV-ALO-002: Test requirement
62
+ */
63
+ requireTestPass: z.ZodDefault<z.ZodBoolean>;
64
+ /**
65
+ * Phases that pause for user review
66
+ * INV-ALO-004: Breakpoint behavior
67
+ */
68
+ breakpoints: z.ZodDefault<z.ZodArray<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>, "many">>;
69
+ /**
70
+ * Test command to run
71
+ */
72
+ testCommand: z.ZodDefault<z.ZodString>;
73
+ /**
74
+ * Timeout for test execution in milliseconds
75
+ */
76
+ testTimeout: z.ZodDefault<z.ZodNumber>;
77
+ /**
78
+ * Timeout per phase in milliseconds
79
+ */
80
+ phaseTimeout: z.ZodDefault<z.ZodNumber>;
81
+ /**
82
+ * Whether to auto-commit successful changes
83
+ */
84
+ autoCommit: z.ZodDefault<z.ZodBoolean>;
85
+ /**
86
+ * Commit message template (uses {{phase}}, {{iteration}})
87
+ */
88
+ commitMessageTemplate: z.ZodDefault<z.ZodString>;
89
+ /**
90
+ * Working directory for execution
91
+ */
92
+ workingDirectory: z.ZodOptional<z.ZodString>;
93
+ /**
94
+ * Agent ID to use for code generation
95
+ */
96
+ agentId: z.ZodOptional<z.ZodString>;
97
+ /**
98
+ * Provider to use for LLM calls
99
+ */
100
+ provider: z.ZodOptional<z.ZodString>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ maxIterations: number;
103
+ maxFixAttempts: number;
104
+ requireTestPass: boolean;
105
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
106
+ testCommand: string;
107
+ testTimeout: number;
108
+ phaseTimeout: number;
109
+ autoCommit: boolean;
110
+ commitMessageTemplate: string;
111
+ agentId?: string | undefined;
112
+ provider?: string | undefined;
113
+ guardPolicy?: string | undefined;
114
+ workingDirectory?: string | undefined;
115
+ }, {
116
+ agentId?: string | undefined;
117
+ provider?: string | undefined;
118
+ maxIterations?: number | undefined;
119
+ maxFixAttempts?: number | undefined;
120
+ guardPolicy?: string | undefined;
121
+ requireTestPass?: boolean | undefined;
122
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
123
+ testCommand?: string | undefined;
124
+ testTimeout?: number | undefined;
125
+ phaseTimeout?: number | undefined;
126
+ autoCommit?: boolean | undefined;
127
+ commitMessageTemplate?: string | undefined;
128
+ workingDirectory?: string | undefined;
129
+ }>;
130
+ export type AutonomousLoopConfig = z.infer<typeof AutonomousLoopConfigSchema>;
131
+ /**
132
+ * Result of a guard gate check
133
+ */
134
+ export declare const GuardGateResultSchema: z.ZodObject<{
135
+ /**
136
+ * Gate identifier
137
+ */
138
+ gateId: z.ZodString;
139
+ /**
140
+ * Whether the gate passed
141
+ */
142
+ passed: z.ZodBoolean;
143
+ /**
144
+ * Severity if failed
145
+ */
146
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
147
+ /**
148
+ * Message explaining result
149
+ */
150
+ message: z.ZodOptional<z.ZodString>;
151
+ /**
152
+ * Detailed violations if any
153
+ */
154
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
155
+ path: z.ZodOptional<z.ZodString>;
156
+ rule: z.ZodOptional<z.ZodString>;
157
+ message: z.ZodString;
158
+ }, "strip", z.ZodTypeAny, {
159
+ message: string;
160
+ path?: string | undefined;
161
+ rule?: string | undefined;
162
+ }, {
163
+ message: string;
164
+ path?: string | undefined;
165
+ rule?: string | undefined;
166
+ }>, "many">>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ gateId: string;
169
+ passed: boolean;
170
+ message?: string | undefined;
171
+ severity?: "info" | "error" | "warning" | undefined;
172
+ violations?: {
173
+ message: string;
174
+ path?: string | undefined;
175
+ rule?: string | undefined;
176
+ }[] | undefined;
177
+ }, {
178
+ gateId: string;
179
+ passed: boolean;
180
+ message?: string | undefined;
181
+ severity?: "info" | "error" | "warning" | undefined;
182
+ violations?: {
183
+ message: string;
184
+ path?: string | undefined;
185
+ rule?: string | undefined;
186
+ }[] | undefined;
187
+ }>;
188
+ export type GuardGateResult = z.infer<typeof GuardGateResultSchema>;
189
+ /**
190
+ * Result of guard policy check
191
+ */
192
+ export declare const GuardCheckResultSchema: z.ZodObject<{
193
+ /**
194
+ * Policy that was checked
195
+ */
196
+ policyId: z.ZodString;
197
+ /**
198
+ * Whether all gates passed
199
+ */
200
+ passed: z.ZodBoolean;
201
+ /**
202
+ * Whether execution is blocked
203
+ */
204
+ blocked: z.ZodBoolean;
205
+ /**
206
+ * Individual gate results
207
+ */
208
+ gateResults: z.ZodArray<z.ZodObject<{
209
+ /**
210
+ * Gate identifier
211
+ */
212
+ gateId: z.ZodString;
213
+ /**
214
+ * Whether the gate passed
215
+ */
216
+ passed: z.ZodBoolean;
217
+ /**
218
+ * Severity if failed
219
+ */
220
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
221
+ /**
222
+ * Message explaining result
223
+ */
224
+ message: z.ZodOptional<z.ZodString>;
225
+ /**
226
+ * Detailed violations if any
227
+ */
228
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ path: z.ZodOptional<z.ZodString>;
230
+ rule: z.ZodOptional<z.ZodString>;
231
+ message: z.ZodString;
232
+ }, "strip", z.ZodTypeAny, {
233
+ message: string;
234
+ path?: string | undefined;
235
+ rule?: string | undefined;
236
+ }, {
237
+ message: string;
238
+ path?: string | undefined;
239
+ rule?: string | undefined;
240
+ }>, "many">>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ gateId: string;
243
+ passed: boolean;
244
+ message?: string | undefined;
245
+ severity?: "info" | "error" | "warning" | undefined;
246
+ violations?: {
247
+ message: string;
248
+ path?: string | undefined;
249
+ rule?: string | undefined;
250
+ }[] | undefined;
251
+ }, {
252
+ gateId: string;
253
+ passed: boolean;
254
+ message?: string | undefined;
255
+ severity?: "info" | "error" | "warning" | undefined;
256
+ violations?: {
257
+ message: string;
258
+ path?: string | undefined;
259
+ rule?: string | undefined;
260
+ }[] | undefined;
261
+ }>, "many">;
262
+ /**
263
+ * Summary message
264
+ */
265
+ summary: z.ZodOptional<z.ZodString>;
266
+ /**
267
+ * Check timestamp
268
+ */
269
+ checkedAt: z.ZodString;
270
+ }, "strip", z.ZodTypeAny, {
271
+ blocked: boolean;
272
+ policyId: string;
273
+ checkedAt: string;
274
+ passed: boolean;
275
+ gateResults: {
276
+ gateId: string;
277
+ passed: boolean;
278
+ message?: string | undefined;
279
+ severity?: "info" | "error" | "warning" | undefined;
280
+ violations?: {
281
+ message: string;
282
+ path?: string | undefined;
283
+ rule?: string | undefined;
284
+ }[] | undefined;
285
+ }[];
286
+ summary?: string | undefined;
287
+ }, {
288
+ blocked: boolean;
289
+ policyId: string;
290
+ checkedAt: string;
291
+ passed: boolean;
292
+ gateResults: {
293
+ gateId: string;
294
+ passed: boolean;
295
+ message?: string | undefined;
296
+ severity?: "info" | "error" | "warning" | undefined;
297
+ violations?: {
298
+ message: string;
299
+ path?: string | undefined;
300
+ rule?: string | undefined;
301
+ }[] | undefined;
302
+ }[];
303
+ summary?: string | undefined;
304
+ }>;
305
+ export type GuardCheckResult = z.infer<typeof GuardCheckResultSchema>;
306
+ /**
307
+ * Test execution result
308
+ */
309
+ export declare const TestResultSchema: z.ZodObject<{
310
+ /**
311
+ * Whether all tests passed
312
+ */
313
+ passed: z.ZodBoolean;
314
+ /**
315
+ * Total test count
316
+ */
317
+ totalTests: z.ZodNumber;
318
+ /**
319
+ * Passed test count
320
+ */
321
+ passedTests: z.ZodNumber;
322
+ /**
323
+ * Failed test count
324
+ */
325
+ failedTests: z.ZodNumber;
326
+ /**
327
+ * Skipped test count
328
+ */
329
+ skippedTests: z.ZodDefault<z.ZodNumber>;
330
+ /**
331
+ * Error output if failed
332
+ */
333
+ errorOutput: z.ZodOptional<z.ZodString>;
334
+ /**
335
+ * Test duration in milliseconds
336
+ */
337
+ durationMs: z.ZodNumber;
338
+ /**
339
+ * Failed test names
340
+ */
341
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ durationMs: number;
344
+ passed: boolean;
345
+ totalTests: number;
346
+ passedTests: number;
347
+ failedTests: number;
348
+ skippedTests: number;
349
+ errorOutput?: string | undefined;
350
+ failedTestNames?: string[] | undefined;
351
+ }, {
352
+ durationMs: number;
353
+ passed: boolean;
354
+ totalTests: number;
355
+ passedTests: number;
356
+ failedTests: number;
357
+ skippedTests?: number | undefined;
358
+ errorOutput?: string | undefined;
359
+ failedTestNames?: string[] | undefined;
360
+ }>;
361
+ export type TestResult = z.infer<typeof TestResultSchema>;
362
+ /**
363
+ * Iteration record in the loop
364
+ */
365
+ export declare const LoopIterationSchema: z.ZodObject<{
366
+ /**
367
+ * Iteration number (1-indexed)
368
+ */
369
+ iteration: z.ZodNumber;
370
+ /**
371
+ * Phase that completed
372
+ */
373
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
374
+ /**
375
+ * Whether phase succeeded
376
+ */
377
+ success: z.ZodBoolean;
378
+ /**
379
+ * Files changed in this iteration
380
+ */
381
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
382
+ /**
383
+ * Test result if test phase
384
+ */
385
+ testResult: z.ZodOptional<z.ZodObject<{
386
+ /**
387
+ * Whether all tests passed
388
+ */
389
+ passed: z.ZodBoolean;
390
+ /**
391
+ * Total test count
392
+ */
393
+ totalTests: z.ZodNumber;
394
+ /**
395
+ * Passed test count
396
+ */
397
+ passedTests: z.ZodNumber;
398
+ /**
399
+ * Failed test count
400
+ */
401
+ failedTests: z.ZodNumber;
402
+ /**
403
+ * Skipped test count
404
+ */
405
+ skippedTests: z.ZodDefault<z.ZodNumber>;
406
+ /**
407
+ * Error output if failed
408
+ */
409
+ errorOutput: z.ZodOptional<z.ZodString>;
410
+ /**
411
+ * Test duration in milliseconds
412
+ */
413
+ durationMs: z.ZodNumber;
414
+ /**
415
+ * Failed test names
416
+ */
417
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
418
+ }, "strip", z.ZodTypeAny, {
419
+ durationMs: number;
420
+ passed: boolean;
421
+ totalTests: number;
422
+ passedTests: number;
423
+ failedTests: number;
424
+ skippedTests: number;
425
+ errorOutput?: string | undefined;
426
+ failedTestNames?: string[] | undefined;
427
+ }, {
428
+ durationMs: number;
429
+ passed: boolean;
430
+ totalTests: number;
431
+ passedTests: number;
432
+ failedTests: number;
433
+ skippedTests?: number | undefined;
434
+ errorOutput?: string | undefined;
435
+ failedTestNames?: string[] | undefined;
436
+ }>>;
437
+ /**
438
+ * Guard result if write phase
439
+ */
440
+ guardResult: z.ZodOptional<z.ZodObject<{
441
+ /**
442
+ * Policy that was checked
443
+ */
444
+ policyId: z.ZodString;
445
+ /**
446
+ * Whether all gates passed
447
+ */
448
+ passed: z.ZodBoolean;
449
+ /**
450
+ * Whether execution is blocked
451
+ */
452
+ blocked: z.ZodBoolean;
453
+ /**
454
+ * Individual gate results
455
+ */
456
+ gateResults: z.ZodArray<z.ZodObject<{
457
+ /**
458
+ * Gate identifier
459
+ */
460
+ gateId: z.ZodString;
461
+ /**
462
+ * Whether the gate passed
463
+ */
464
+ passed: z.ZodBoolean;
465
+ /**
466
+ * Severity if failed
467
+ */
468
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
469
+ /**
470
+ * Message explaining result
471
+ */
472
+ message: z.ZodOptional<z.ZodString>;
473
+ /**
474
+ * Detailed violations if any
475
+ */
476
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
477
+ path: z.ZodOptional<z.ZodString>;
478
+ rule: z.ZodOptional<z.ZodString>;
479
+ message: z.ZodString;
480
+ }, "strip", z.ZodTypeAny, {
481
+ message: string;
482
+ path?: string | undefined;
483
+ rule?: string | undefined;
484
+ }, {
485
+ message: string;
486
+ path?: string | undefined;
487
+ rule?: string | undefined;
488
+ }>, "many">>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ gateId: string;
491
+ passed: boolean;
492
+ message?: string | undefined;
493
+ severity?: "info" | "error" | "warning" | undefined;
494
+ violations?: {
495
+ message: string;
496
+ path?: string | undefined;
497
+ rule?: string | undefined;
498
+ }[] | undefined;
499
+ }, {
500
+ gateId: string;
501
+ passed: boolean;
502
+ message?: string | undefined;
503
+ severity?: "info" | "error" | "warning" | undefined;
504
+ violations?: {
505
+ message: string;
506
+ path?: string | undefined;
507
+ rule?: string | undefined;
508
+ }[] | undefined;
509
+ }>, "many">;
510
+ /**
511
+ * Summary message
512
+ */
513
+ summary: z.ZodOptional<z.ZodString>;
514
+ /**
515
+ * Check timestamp
516
+ */
517
+ checkedAt: z.ZodString;
518
+ }, "strip", z.ZodTypeAny, {
519
+ blocked: boolean;
520
+ policyId: string;
521
+ checkedAt: string;
522
+ passed: boolean;
523
+ gateResults: {
524
+ gateId: string;
525
+ passed: boolean;
526
+ message?: string | undefined;
527
+ severity?: "info" | "error" | "warning" | undefined;
528
+ violations?: {
529
+ message: string;
530
+ path?: string | undefined;
531
+ rule?: string | undefined;
532
+ }[] | undefined;
533
+ }[];
534
+ summary?: string | undefined;
535
+ }, {
536
+ blocked: boolean;
537
+ policyId: string;
538
+ checkedAt: string;
539
+ passed: boolean;
540
+ gateResults: {
541
+ gateId: string;
542
+ passed: boolean;
543
+ message?: string | undefined;
544
+ severity?: "info" | "error" | "warning" | undefined;
545
+ violations?: {
546
+ message: string;
547
+ path?: string | undefined;
548
+ rule?: string | undefined;
549
+ }[] | undefined;
550
+ }[];
551
+ summary?: string | undefined;
552
+ }>>;
553
+ /**
554
+ * Fix attempts made
555
+ */
556
+ fixAttempts: z.ZodDefault<z.ZodNumber>;
557
+ /**
558
+ * Error message if failed
559
+ */
560
+ error: z.ZodOptional<z.ZodString>;
561
+ /**
562
+ * Duration in milliseconds
563
+ */
564
+ durationMs: z.ZodNumber;
565
+ /**
566
+ * Start timestamp
567
+ */
568
+ startedAt: z.ZodString;
569
+ /**
570
+ * End timestamp
571
+ */
572
+ completedAt: z.ZodOptional<z.ZodString>;
573
+ }, "strip", z.ZodTypeAny, {
574
+ durationMs: number;
575
+ success: boolean;
576
+ startedAt: string;
577
+ iteration: number;
578
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
579
+ changedFiles: string[];
580
+ fixAttempts: number;
581
+ error?: string | undefined;
582
+ guardResult?: {
583
+ blocked: boolean;
584
+ policyId: string;
585
+ checkedAt: string;
586
+ passed: boolean;
587
+ gateResults: {
588
+ gateId: string;
589
+ passed: boolean;
590
+ message?: string | undefined;
591
+ severity?: "info" | "error" | "warning" | undefined;
592
+ violations?: {
593
+ message: string;
594
+ path?: string | undefined;
595
+ rule?: string | undefined;
596
+ }[] | undefined;
597
+ }[];
598
+ summary?: string | undefined;
599
+ } | undefined;
600
+ completedAt?: string | undefined;
601
+ testResult?: {
602
+ durationMs: number;
603
+ passed: boolean;
604
+ totalTests: number;
605
+ passedTests: number;
606
+ failedTests: number;
607
+ skippedTests: number;
608
+ errorOutput?: string | undefined;
609
+ failedTestNames?: string[] | undefined;
610
+ } | undefined;
611
+ }, {
612
+ durationMs: number;
613
+ success: boolean;
614
+ startedAt: string;
615
+ iteration: number;
616
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
617
+ error?: string | undefined;
618
+ guardResult?: {
619
+ blocked: boolean;
620
+ policyId: string;
621
+ checkedAt: string;
622
+ passed: boolean;
623
+ gateResults: {
624
+ gateId: string;
625
+ passed: boolean;
626
+ message?: string | undefined;
627
+ severity?: "info" | "error" | "warning" | undefined;
628
+ violations?: {
629
+ message: string;
630
+ path?: string | undefined;
631
+ rule?: string | undefined;
632
+ }[] | undefined;
633
+ }[];
634
+ summary?: string | undefined;
635
+ } | undefined;
636
+ completedAt?: string | undefined;
637
+ changedFiles?: string[] | undefined;
638
+ testResult?: {
639
+ durationMs: number;
640
+ passed: boolean;
641
+ totalTests: number;
642
+ passedTests: number;
643
+ failedTests: number;
644
+ skippedTests?: number | undefined;
645
+ errorOutput?: string | undefined;
646
+ failedTestNames?: string[] | undefined;
647
+ } | undefined;
648
+ fixAttempts?: number | undefined;
649
+ }>;
650
+ export type LoopIteration = z.infer<typeof LoopIterationSchema>;
651
+ /**
652
+ * State of an autonomous loop
653
+ *
654
+ * Invariants:
655
+ * - INV-ALO-005: Changed files tracked for guard radius checks
656
+ */
657
+ export declare const AutonomousLoopStateSchema: z.ZodObject<{
658
+ /**
659
+ * Unique loop identifier
660
+ */
661
+ loopId: z.ZodString;
662
+ /**
663
+ * Current phase
664
+ */
665
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
666
+ /**
667
+ * Current iteration number
668
+ */
669
+ iteration: z.ZodNumber;
670
+ /**
671
+ * Current status
672
+ */
673
+ status: z.ZodEnum<["running", "paused", "completed", "failed", "blocked", "cancelled"]>;
674
+ /**
675
+ * Task description
676
+ */
677
+ task: z.ZodString;
678
+ /**
679
+ * Configuration used
680
+ */
681
+ config: z.ZodObject<{
682
+ /**
683
+ * Maximum iterations through the loop
684
+ */
685
+ maxIterations: z.ZodDefault<z.ZodNumber>;
686
+ /**
687
+ * Maximum fix attempts per iteration
688
+ * INV-ALO-003: Bounded fix attempts
689
+ */
690
+ maxFixAttempts: z.ZodDefault<z.ZodNumber>;
691
+ /**
692
+ * Guard policy to enforce
693
+ * INV-ALO-001: Guards run after write
694
+ */
695
+ guardPolicy: z.ZodOptional<z.ZodString>;
696
+ /**
697
+ * Whether tests must pass before verify phase
698
+ * INV-ALO-002: Test requirement
699
+ */
700
+ requireTestPass: z.ZodDefault<z.ZodBoolean>;
701
+ /**
702
+ * Phases that pause for user review
703
+ * INV-ALO-004: Breakpoint behavior
704
+ */
705
+ breakpoints: z.ZodDefault<z.ZodArray<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>, "many">>;
706
+ /**
707
+ * Test command to run
708
+ */
709
+ testCommand: z.ZodDefault<z.ZodString>;
710
+ /**
711
+ * Timeout for test execution in milliseconds
712
+ */
713
+ testTimeout: z.ZodDefault<z.ZodNumber>;
714
+ /**
715
+ * Timeout per phase in milliseconds
716
+ */
717
+ phaseTimeout: z.ZodDefault<z.ZodNumber>;
718
+ /**
719
+ * Whether to auto-commit successful changes
720
+ */
721
+ autoCommit: z.ZodDefault<z.ZodBoolean>;
722
+ /**
723
+ * Commit message template (uses {{phase}}, {{iteration}})
724
+ */
725
+ commitMessageTemplate: z.ZodDefault<z.ZodString>;
726
+ /**
727
+ * Working directory for execution
728
+ */
729
+ workingDirectory: z.ZodOptional<z.ZodString>;
730
+ /**
731
+ * Agent ID to use for code generation
732
+ */
733
+ agentId: z.ZodOptional<z.ZodString>;
734
+ /**
735
+ * Provider to use for LLM calls
736
+ */
737
+ provider: z.ZodOptional<z.ZodString>;
738
+ }, "strip", z.ZodTypeAny, {
739
+ maxIterations: number;
740
+ maxFixAttempts: number;
741
+ requireTestPass: boolean;
742
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
743
+ testCommand: string;
744
+ testTimeout: number;
745
+ phaseTimeout: number;
746
+ autoCommit: boolean;
747
+ commitMessageTemplate: string;
748
+ agentId?: string | undefined;
749
+ provider?: string | undefined;
750
+ guardPolicy?: string | undefined;
751
+ workingDirectory?: string | undefined;
752
+ }, {
753
+ agentId?: string | undefined;
754
+ provider?: string | undefined;
755
+ maxIterations?: number | undefined;
756
+ maxFixAttempts?: number | undefined;
757
+ guardPolicy?: string | undefined;
758
+ requireTestPass?: boolean | undefined;
759
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
760
+ testCommand?: string | undefined;
761
+ testTimeout?: number | undefined;
762
+ phaseTimeout?: number | undefined;
763
+ autoCommit?: boolean | undefined;
764
+ commitMessageTemplate?: string | undefined;
765
+ workingDirectory?: string | undefined;
766
+ }>;
767
+ /**
768
+ * All changed files across iterations
769
+ * INV-ALO-005: Tracked for guard radius
770
+ */
771
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
772
+ /**
773
+ * Iteration history
774
+ */
775
+ iterations: z.ZodDefault<z.ZodArray<z.ZodObject<{
776
+ /**
777
+ * Iteration number (1-indexed)
778
+ */
779
+ iteration: z.ZodNumber;
780
+ /**
781
+ * Phase that completed
782
+ */
783
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
784
+ /**
785
+ * Whether phase succeeded
786
+ */
787
+ success: z.ZodBoolean;
788
+ /**
789
+ * Files changed in this iteration
790
+ */
791
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
792
+ /**
793
+ * Test result if test phase
794
+ */
795
+ testResult: z.ZodOptional<z.ZodObject<{
796
+ /**
797
+ * Whether all tests passed
798
+ */
799
+ passed: z.ZodBoolean;
800
+ /**
801
+ * Total test count
802
+ */
803
+ totalTests: z.ZodNumber;
804
+ /**
805
+ * Passed test count
806
+ */
807
+ passedTests: z.ZodNumber;
808
+ /**
809
+ * Failed test count
810
+ */
811
+ failedTests: z.ZodNumber;
812
+ /**
813
+ * Skipped test count
814
+ */
815
+ skippedTests: z.ZodDefault<z.ZodNumber>;
816
+ /**
817
+ * Error output if failed
818
+ */
819
+ errorOutput: z.ZodOptional<z.ZodString>;
820
+ /**
821
+ * Test duration in milliseconds
822
+ */
823
+ durationMs: z.ZodNumber;
824
+ /**
825
+ * Failed test names
826
+ */
827
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
828
+ }, "strip", z.ZodTypeAny, {
829
+ durationMs: number;
830
+ passed: boolean;
831
+ totalTests: number;
832
+ passedTests: number;
833
+ failedTests: number;
834
+ skippedTests: number;
835
+ errorOutput?: string | undefined;
836
+ failedTestNames?: string[] | undefined;
837
+ }, {
838
+ durationMs: number;
839
+ passed: boolean;
840
+ totalTests: number;
841
+ passedTests: number;
842
+ failedTests: number;
843
+ skippedTests?: number | undefined;
844
+ errorOutput?: string | undefined;
845
+ failedTestNames?: string[] | undefined;
846
+ }>>;
847
+ /**
848
+ * Guard result if write phase
849
+ */
850
+ guardResult: z.ZodOptional<z.ZodObject<{
851
+ /**
852
+ * Policy that was checked
853
+ */
854
+ policyId: z.ZodString;
855
+ /**
856
+ * Whether all gates passed
857
+ */
858
+ passed: z.ZodBoolean;
859
+ /**
860
+ * Whether execution is blocked
861
+ */
862
+ blocked: z.ZodBoolean;
863
+ /**
864
+ * Individual gate results
865
+ */
866
+ gateResults: z.ZodArray<z.ZodObject<{
867
+ /**
868
+ * Gate identifier
869
+ */
870
+ gateId: z.ZodString;
871
+ /**
872
+ * Whether the gate passed
873
+ */
874
+ passed: z.ZodBoolean;
875
+ /**
876
+ * Severity if failed
877
+ */
878
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
879
+ /**
880
+ * Message explaining result
881
+ */
882
+ message: z.ZodOptional<z.ZodString>;
883
+ /**
884
+ * Detailed violations if any
885
+ */
886
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
887
+ path: z.ZodOptional<z.ZodString>;
888
+ rule: z.ZodOptional<z.ZodString>;
889
+ message: z.ZodString;
890
+ }, "strip", z.ZodTypeAny, {
891
+ message: string;
892
+ path?: string | undefined;
893
+ rule?: string | undefined;
894
+ }, {
895
+ message: string;
896
+ path?: string | undefined;
897
+ rule?: string | undefined;
898
+ }>, "many">>;
899
+ }, "strip", z.ZodTypeAny, {
900
+ gateId: string;
901
+ passed: boolean;
902
+ message?: string | undefined;
903
+ severity?: "info" | "error" | "warning" | undefined;
904
+ violations?: {
905
+ message: string;
906
+ path?: string | undefined;
907
+ rule?: string | undefined;
908
+ }[] | undefined;
909
+ }, {
910
+ gateId: string;
911
+ passed: boolean;
912
+ message?: string | undefined;
913
+ severity?: "info" | "error" | "warning" | undefined;
914
+ violations?: {
915
+ message: string;
916
+ path?: string | undefined;
917
+ rule?: string | undefined;
918
+ }[] | undefined;
919
+ }>, "many">;
920
+ /**
921
+ * Summary message
922
+ */
923
+ summary: z.ZodOptional<z.ZodString>;
924
+ /**
925
+ * Check timestamp
926
+ */
927
+ checkedAt: z.ZodString;
928
+ }, "strip", z.ZodTypeAny, {
929
+ blocked: boolean;
930
+ policyId: string;
931
+ checkedAt: string;
932
+ passed: boolean;
933
+ gateResults: {
934
+ gateId: string;
935
+ passed: boolean;
936
+ message?: string | undefined;
937
+ severity?: "info" | "error" | "warning" | undefined;
938
+ violations?: {
939
+ message: string;
940
+ path?: string | undefined;
941
+ rule?: string | undefined;
942
+ }[] | undefined;
943
+ }[];
944
+ summary?: string | undefined;
945
+ }, {
946
+ blocked: boolean;
947
+ policyId: string;
948
+ checkedAt: string;
949
+ passed: boolean;
950
+ gateResults: {
951
+ gateId: string;
952
+ passed: boolean;
953
+ message?: string | undefined;
954
+ severity?: "info" | "error" | "warning" | undefined;
955
+ violations?: {
956
+ message: string;
957
+ path?: string | undefined;
958
+ rule?: string | undefined;
959
+ }[] | undefined;
960
+ }[];
961
+ summary?: string | undefined;
962
+ }>>;
963
+ /**
964
+ * Fix attempts made
965
+ */
966
+ fixAttempts: z.ZodDefault<z.ZodNumber>;
967
+ /**
968
+ * Error message if failed
969
+ */
970
+ error: z.ZodOptional<z.ZodString>;
971
+ /**
972
+ * Duration in milliseconds
973
+ */
974
+ durationMs: z.ZodNumber;
975
+ /**
976
+ * Start timestamp
977
+ */
978
+ startedAt: z.ZodString;
979
+ /**
980
+ * End timestamp
981
+ */
982
+ completedAt: z.ZodOptional<z.ZodString>;
983
+ }, "strip", z.ZodTypeAny, {
984
+ durationMs: number;
985
+ success: boolean;
986
+ startedAt: string;
987
+ iteration: number;
988
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
989
+ changedFiles: string[];
990
+ fixAttempts: number;
991
+ error?: string | undefined;
992
+ guardResult?: {
993
+ blocked: boolean;
994
+ policyId: string;
995
+ checkedAt: string;
996
+ passed: boolean;
997
+ gateResults: {
998
+ gateId: string;
999
+ passed: boolean;
1000
+ message?: string | undefined;
1001
+ severity?: "info" | "error" | "warning" | undefined;
1002
+ violations?: {
1003
+ message: string;
1004
+ path?: string | undefined;
1005
+ rule?: string | undefined;
1006
+ }[] | undefined;
1007
+ }[];
1008
+ summary?: string | undefined;
1009
+ } | undefined;
1010
+ completedAt?: string | undefined;
1011
+ testResult?: {
1012
+ durationMs: number;
1013
+ passed: boolean;
1014
+ totalTests: number;
1015
+ passedTests: number;
1016
+ failedTests: number;
1017
+ skippedTests: number;
1018
+ errorOutput?: string | undefined;
1019
+ failedTestNames?: string[] | undefined;
1020
+ } | undefined;
1021
+ }, {
1022
+ durationMs: number;
1023
+ success: boolean;
1024
+ startedAt: string;
1025
+ iteration: number;
1026
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1027
+ error?: string | undefined;
1028
+ guardResult?: {
1029
+ blocked: boolean;
1030
+ policyId: string;
1031
+ checkedAt: string;
1032
+ passed: boolean;
1033
+ gateResults: {
1034
+ gateId: string;
1035
+ passed: boolean;
1036
+ message?: string | undefined;
1037
+ severity?: "info" | "error" | "warning" | undefined;
1038
+ violations?: {
1039
+ message: string;
1040
+ path?: string | undefined;
1041
+ rule?: string | undefined;
1042
+ }[] | undefined;
1043
+ }[];
1044
+ summary?: string | undefined;
1045
+ } | undefined;
1046
+ completedAt?: string | undefined;
1047
+ changedFiles?: string[] | undefined;
1048
+ testResult?: {
1049
+ durationMs: number;
1050
+ passed: boolean;
1051
+ totalTests: number;
1052
+ passedTests: number;
1053
+ failedTests: number;
1054
+ skippedTests?: number | undefined;
1055
+ errorOutput?: string | undefined;
1056
+ failedTestNames?: string[] | undefined;
1057
+ } | undefined;
1058
+ fixAttempts?: number | undefined;
1059
+ }>, "many">>;
1060
+ /**
1061
+ * Latest guard check result
1062
+ */
1063
+ lastGuardResult: z.ZodOptional<z.ZodObject<{
1064
+ /**
1065
+ * Policy that was checked
1066
+ */
1067
+ policyId: z.ZodString;
1068
+ /**
1069
+ * Whether all gates passed
1070
+ */
1071
+ passed: z.ZodBoolean;
1072
+ /**
1073
+ * Whether execution is blocked
1074
+ */
1075
+ blocked: z.ZodBoolean;
1076
+ /**
1077
+ * Individual gate results
1078
+ */
1079
+ gateResults: z.ZodArray<z.ZodObject<{
1080
+ /**
1081
+ * Gate identifier
1082
+ */
1083
+ gateId: z.ZodString;
1084
+ /**
1085
+ * Whether the gate passed
1086
+ */
1087
+ passed: z.ZodBoolean;
1088
+ /**
1089
+ * Severity if failed
1090
+ */
1091
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
1092
+ /**
1093
+ * Message explaining result
1094
+ */
1095
+ message: z.ZodOptional<z.ZodString>;
1096
+ /**
1097
+ * Detailed violations if any
1098
+ */
1099
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
1100
+ path: z.ZodOptional<z.ZodString>;
1101
+ rule: z.ZodOptional<z.ZodString>;
1102
+ message: z.ZodString;
1103
+ }, "strip", z.ZodTypeAny, {
1104
+ message: string;
1105
+ path?: string | undefined;
1106
+ rule?: string | undefined;
1107
+ }, {
1108
+ message: string;
1109
+ path?: string | undefined;
1110
+ rule?: string | undefined;
1111
+ }>, "many">>;
1112
+ }, "strip", z.ZodTypeAny, {
1113
+ gateId: string;
1114
+ passed: boolean;
1115
+ message?: string | undefined;
1116
+ severity?: "info" | "error" | "warning" | undefined;
1117
+ violations?: {
1118
+ message: string;
1119
+ path?: string | undefined;
1120
+ rule?: string | undefined;
1121
+ }[] | undefined;
1122
+ }, {
1123
+ gateId: string;
1124
+ passed: boolean;
1125
+ message?: string | undefined;
1126
+ severity?: "info" | "error" | "warning" | undefined;
1127
+ violations?: {
1128
+ message: string;
1129
+ path?: string | undefined;
1130
+ rule?: string | undefined;
1131
+ }[] | undefined;
1132
+ }>, "many">;
1133
+ /**
1134
+ * Summary message
1135
+ */
1136
+ summary: z.ZodOptional<z.ZodString>;
1137
+ /**
1138
+ * Check timestamp
1139
+ */
1140
+ checkedAt: z.ZodString;
1141
+ }, "strip", z.ZodTypeAny, {
1142
+ blocked: boolean;
1143
+ policyId: string;
1144
+ checkedAt: string;
1145
+ passed: boolean;
1146
+ gateResults: {
1147
+ gateId: string;
1148
+ passed: boolean;
1149
+ message?: string | undefined;
1150
+ severity?: "info" | "error" | "warning" | undefined;
1151
+ violations?: {
1152
+ message: string;
1153
+ path?: string | undefined;
1154
+ rule?: string | undefined;
1155
+ }[] | undefined;
1156
+ }[];
1157
+ summary?: string | undefined;
1158
+ }, {
1159
+ blocked: boolean;
1160
+ policyId: string;
1161
+ checkedAt: string;
1162
+ passed: boolean;
1163
+ gateResults: {
1164
+ gateId: string;
1165
+ passed: boolean;
1166
+ message?: string | undefined;
1167
+ severity?: "info" | "error" | "warning" | undefined;
1168
+ violations?: {
1169
+ message: string;
1170
+ path?: string | undefined;
1171
+ rule?: string | undefined;
1172
+ }[] | undefined;
1173
+ }[];
1174
+ summary?: string | undefined;
1175
+ }>>;
1176
+ /**
1177
+ * Latest test result
1178
+ */
1179
+ lastTestResult: z.ZodOptional<z.ZodObject<{
1180
+ /**
1181
+ * Whether all tests passed
1182
+ */
1183
+ passed: z.ZodBoolean;
1184
+ /**
1185
+ * Total test count
1186
+ */
1187
+ totalTests: z.ZodNumber;
1188
+ /**
1189
+ * Passed test count
1190
+ */
1191
+ passedTests: z.ZodNumber;
1192
+ /**
1193
+ * Failed test count
1194
+ */
1195
+ failedTests: z.ZodNumber;
1196
+ /**
1197
+ * Skipped test count
1198
+ */
1199
+ skippedTests: z.ZodDefault<z.ZodNumber>;
1200
+ /**
1201
+ * Error output if failed
1202
+ */
1203
+ errorOutput: z.ZodOptional<z.ZodString>;
1204
+ /**
1205
+ * Test duration in milliseconds
1206
+ */
1207
+ durationMs: z.ZodNumber;
1208
+ /**
1209
+ * Failed test names
1210
+ */
1211
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1212
+ }, "strip", z.ZodTypeAny, {
1213
+ durationMs: number;
1214
+ passed: boolean;
1215
+ totalTests: number;
1216
+ passedTests: number;
1217
+ failedTests: number;
1218
+ skippedTests: number;
1219
+ errorOutput?: string | undefined;
1220
+ failedTestNames?: string[] | undefined;
1221
+ }, {
1222
+ durationMs: number;
1223
+ passed: boolean;
1224
+ totalTests: number;
1225
+ passedTests: number;
1226
+ failedTests: number;
1227
+ skippedTests?: number | undefined;
1228
+ errorOutput?: string | undefined;
1229
+ failedTestNames?: string[] | undefined;
1230
+ }>>;
1231
+ /**
1232
+ * Current fix attempts in iteration
1233
+ */
1234
+ currentFixAttempts: z.ZodDefault<z.ZodNumber>;
1235
+ /**
1236
+ * Pause reason if paused
1237
+ */
1238
+ pauseReason: z.ZodOptional<z.ZodString>;
1239
+ /**
1240
+ * Error if failed or blocked
1241
+ */
1242
+ error: z.ZodOptional<z.ZodString>;
1243
+ /**
1244
+ * Session ID for tracking
1245
+ */
1246
+ sessionId: z.ZodOptional<z.ZodString>;
1247
+ /**
1248
+ * Start timestamp
1249
+ */
1250
+ startedAt: z.ZodString;
1251
+ /**
1252
+ * Last update timestamp
1253
+ */
1254
+ updatedAt: z.ZodString;
1255
+ /**
1256
+ * Completion timestamp
1257
+ */
1258
+ completedAt: z.ZodOptional<z.ZodString>;
1259
+ }, "strip", z.ZodTypeAny, {
1260
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
1261
+ config: {
1262
+ maxIterations: number;
1263
+ maxFixAttempts: number;
1264
+ requireTestPass: boolean;
1265
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
1266
+ testCommand: string;
1267
+ testTimeout: number;
1268
+ phaseTimeout: number;
1269
+ autoCommit: boolean;
1270
+ commitMessageTemplate: string;
1271
+ agentId?: string | undefined;
1272
+ provider?: string | undefined;
1273
+ guardPolicy?: string | undefined;
1274
+ workingDirectory?: string | undefined;
1275
+ };
1276
+ task: string;
1277
+ updatedAt: string;
1278
+ startedAt: string;
1279
+ iterations: {
1280
+ durationMs: number;
1281
+ success: boolean;
1282
+ startedAt: string;
1283
+ iteration: number;
1284
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1285
+ changedFiles: string[];
1286
+ fixAttempts: number;
1287
+ error?: string | undefined;
1288
+ guardResult?: {
1289
+ blocked: boolean;
1290
+ policyId: string;
1291
+ checkedAt: string;
1292
+ passed: boolean;
1293
+ gateResults: {
1294
+ gateId: string;
1295
+ passed: boolean;
1296
+ message?: string | undefined;
1297
+ severity?: "info" | "error" | "warning" | undefined;
1298
+ violations?: {
1299
+ message: string;
1300
+ path?: string | undefined;
1301
+ rule?: string | undefined;
1302
+ }[] | undefined;
1303
+ }[];
1304
+ summary?: string | undefined;
1305
+ } | undefined;
1306
+ completedAt?: string | undefined;
1307
+ testResult?: {
1308
+ durationMs: number;
1309
+ passed: boolean;
1310
+ totalTests: number;
1311
+ passedTests: number;
1312
+ failedTests: number;
1313
+ skippedTests: number;
1314
+ errorOutput?: string | undefined;
1315
+ failedTestNames?: string[] | undefined;
1316
+ } | undefined;
1317
+ }[];
1318
+ iteration: number;
1319
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1320
+ changedFiles: string[];
1321
+ loopId: string;
1322
+ currentFixAttempts: number;
1323
+ sessionId?: string | undefined;
1324
+ error?: string | undefined;
1325
+ completedAt?: string | undefined;
1326
+ lastGuardResult?: {
1327
+ blocked: boolean;
1328
+ policyId: string;
1329
+ checkedAt: string;
1330
+ passed: boolean;
1331
+ gateResults: {
1332
+ gateId: string;
1333
+ passed: boolean;
1334
+ message?: string | undefined;
1335
+ severity?: "info" | "error" | "warning" | undefined;
1336
+ violations?: {
1337
+ message: string;
1338
+ path?: string | undefined;
1339
+ rule?: string | undefined;
1340
+ }[] | undefined;
1341
+ }[];
1342
+ summary?: string | undefined;
1343
+ } | undefined;
1344
+ lastTestResult?: {
1345
+ durationMs: number;
1346
+ passed: boolean;
1347
+ totalTests: number;
1348
+ passedTests: number;
1349
+ failedTests: number;
1350
+ skippedTests: number;
1351
+ errorOutput?: string | undefined;
1352
+ failedTestNames?: string[] | undefined;
1353
+ } | undefined;
1354
+ pauseReason?: string | undefined;
1355
+ }, {
1356
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
1357
+ config: {
1358
+ agentId?: string | undefined;
1359
+ provider?: string | undefined;
1360
+ maxIterations?: number | undefined;
1361
+ maxFixAttempts?: number | undefined;
1362
+ guardPolicy?: string | undefined;
1363
+ requireTestPass?: boolean | undefined;
1364
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
1365
+ testCommand?: string | undefined;
1366
+ testTimeout?: number | undefined;
1367
+ phaseTimeout?: number | undefined;
1368
+ autoCommit?: boolean | undefined;
1369
+ commitMessageTemplate?: string | undefined;
1370
+ workingDirectory?: string | undefined;
1371
+ };
1372
+ task: string;
1373
+ updatedAt: string;
1374
+ startedAt: string;
1375
+ iteration: number;
1376
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1377
+ loopId: string;
1378
+ sessionId?: string | undefined;
1379
+ error?: string | undefined;
1380
+ completedAt?: string | undefined;
1381
+ iterations?: {
1382
+ durationMs: number;
1383
+ success: boolean;
1384
+ startedAt: string;
1385
+ iteration: number;
1386
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1387
+ error?: string | undefined;
1388
+ guardResult?: {
1389
+ blocked: boolean;
1390
+ policyId: string;
1391
+ checkedAt: string;
1392
+ passed: boolean;
1393
+ gateResults: {
1394
+ gateId: string;
1395
+ passed: boolean;
1396
+ message?: string | undefined;
1397
+ severity?: "info" | "error" | "warning" | undefined;
1398
+ violations?: {
1399
+ message: string;
1400
+ path?: string | undefined;
1401
+ rule?: string | undefined;
1402
+ }[] | undefined;
1403
+ }[];
1404
+ summary?: string | undefined;
1405
+ } | undefined;
1406
+ completedAt?: string | undefined;
1407
+ changedFiles?: string[] | undefined;
1408
+ testResult?: {
1409
+ durationMs: number;
1410
+ passed: boolean;
1411
+ totalTests: number;
1412
+ passedTests: number;
1413
+ failedTests: number;
1414
+ skippedTests?: number | undefined;
1415
+ errorOutput?: string | undefined;
1416
+ failedTestNames?: string[] | undefined;
1417
+ } | undefined;
1418
+ fixAttempts?: number | undefined;
1419
+ }[] | undefined;
1420
+ changedFiles?: string[] | undefined;
1421
+ lastGuardResult?: {
1422
+ blocked: boolean;
1423
+ policyId: string;
1424
+ checkedAt: string;
1425
+ passed: boolean;
1426
+ gateResults: {
1427
+ gateId: string;
1428
+ passed: boolean;
1429
+ message?: string | undefined;
1430
+ severity?: "info" | "error" | "warning" | undefined;
1431
+ violations?: {
1432
+ message: string;
1433
+ path?: string | undefined;
1434
+ rule?: string | undefined;
1435
+ }[] | undefined;
1436
+ }[];
1437
+ summary?: string | undefined;
1438
+ } | undefined;
1439
+ lastTestResult?: {
1440
+ durationMs: number;
1441
+ passed: boolean;
1442
+ totalTests: number;
1443
+ passedTests: number;
1444
+ failedTests: number;
1445
+ skippedTests?: number | undefined;
1446
+ errorOutput?: string | undefined;
1447
+ failedTestNames?: string[] | undefined;
1448
+ } | undefined;
1449
+ currentFixAttempts?: number | undefined;
1450
+ pauseReason?: string | undefined;
1451
+ }>;
1452
+ export type AutonomousLoopState = z.infer<typeof AutonomousLoopStateSchema>;
1453
+ /**
1454
+ * Request to start an autonomous loop
1455
+ */
1456
+ export declare const StartLoopRequestSchema: z.ZodObject<{
1457
+ /**
1458
+ * Task description
1459
+ */
1460
+ task: z.ZodString;
1461
+ /**
1462
+ * Configuration overrides
1463
+ */
1464
+ config: z.ZodOptional<z.ZodObject<{
1465
+ maxIterations: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1466
+ maxFixAttempts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1467
+ guardPolicy: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1468
+ requireTestPass: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1469
+ breakpoints: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>, "many">>>;
1470
+ testCommand: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1471
+ testTimeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1472
+ phaseTimeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1473
+ autoCommit: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1474
+ commitMessageTemplate: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1475
+ workingDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1476
+ agentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1477
+ provider: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1478
+ }, "strip", z.ZodTypeAny, {
1479
+ agentId?: string | undefined;
1480
+ provider?: string | undefined;
1481
+ maxIterations?: number | undefined;
1482
+ maxFixAttempts?: number | undefined;
1483
+ guardPolicy?: string | undefined;
1484
+ requireTestPass?: boolean | undefined;
1485
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
1486
+ testCommand?: string | undefined;
1487
+ testTimeout?: number | undefined;
1488
+ phaseTimeout?: number | undefined;
1489
+ autoCommit?: boolean | undefined;
1490
+ commitMessageTemplate?: string | undefined;
1491
+ workingDirectory?: string | undefined;
1492
+ }, {
1493
+ agentId?: string | undefined;
1494
+ provider?: string | undefined;
1495
+ maxIterations?: number | undefined;
1496
+ maxFixAttempts?: number | undefined;
1497
+ guardPolicy?: string | undefined;
1498
+ requireTestPass?: boolean | undefined;
1499
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
1500
+ testCommand?: string | undefined;
1501
+ testTimeout?: number | undefined;
1502
+ phaseTimeout?: number | undefined;
1503
+ autoCommit?: boolean | undefined;
1504
+ commitMessageTemplate?: string | undefined;
1505
+ workingDirectory?: string | undefined;
1506
+ }>>;
1507
+ /**
1508
+ * Session ID for tracking
1509
+ */
1510
+ sessionId: z.ZodOptional<z.ZodString>;
1511
+ /**
1512
+ * Initial context/files to work with
1513
+ */
1514
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1515
+ }, "strip", z.ZodTypeAny, {
1516
+ task: string;
1517
+ context?: Record<string, unknown> | undefined;
1518
+ config?: {
1519
+ agentId?: string | undefined;
1520
+ provider?: string | undefined;
1521
+ maxIterations?: number | undefined;
1522
+ maxFixAttempts?: number | undefined;
1523
+ guardPolicy?: string | undefined;
1524
+ requireTestPass?: boolean | undefined;
1525
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
1526
+ testCommand?: string | undefined;
1527
+ testTimeout?: number | undefined;
1528
+ phaseTimeout?: number | undefined;
1529
+ autoCommit?: boolean | undefined;
1530
+ commitMessageTemplate?: string | undefined;
1531
+ workingDirectory?: string | undefined;
1532
+ } | undefined;
1533
+ sessionId?: string | undefined;
1534
+ }, {
1535
+ task: string;
1536
+ context?: Record<string, unknown> | undefined;
1537
+ config?: {
1538
+ agentId?: string | undefined;
1539
+ provider?: string | undefined;
1540
+ maxIterations?: number | undefined;
1541
+ maxFixAttempts?: number | undefined;
1542
+ guardPolicy?: string | undefined;
1543
+ requireTestPass?: boolean | undefined;
1544
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
1545
+ testCommand?: string | undefined;
1546
+ testTimeout?: number | undefined;
1547
+ phaseTimeout?: number | undefined;
1548
+ autoCommit?: boolean | undefined;
1549
+ commitMessageTemplate?: string | undefined;
1550
+ workingDirectory?: string | undefined;
1551
+ } | undefined;
1552
+ sessionId?: string | undefined;
1553
+ }>;
1554
+ export type StartLoopRequest = z.infer<typeof StartLoopRequestSchema>;
1555
+ /**
1556
+ * Response from starting a loop
1557
+ */
1558
+ export declare const StartLoopResponseSchema: z.ZodObject<{
1559
+ /**
1560
+ * Loop ID
1561
+ */
1562
+ loopId: z.ZodString;
1563
+ /**
1564
+ * Initial state
1565
+ */
1566
+ state: z.ZodObject<{
1567
+ /**
1568
+ * Unique loop identifier
1569
+ */
1570
+ loopId: z.ZodString;
1571
+ /**
1572
+ * Current phase
1573
+ */
1574
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
1575
+ /**
1576
+ * Current iteration number
1577
+ */
1578
+ iteration: z.ZodNumber;
1579
+ /**
1580
+ * Current status
1581
+ */
1582
+ status: z.ZodEnum<["running", "paused", "completed", "failed", "blocked", "cancelled"]>;
1583
+ /**
1584
+ * Task description
1585
+ */
1586
+ task: z.ZodString;
1587
+ /**
1588
+ * Configuration used
1589
+ */
1590
+ config: z.ZodObject<{
1591
+ /**
1592
+ * Maximum iterations through the loop
1593
+ */
1594
+ maxIterations: z.ZodDefault<z.ZodNumber>;
1595
+ /**
1596
+ * Maximum fix attempts per iteration
1597
+ * INV-ALO-003: Bounded fix attempts
1598
+ */
1599
+ maxFixAttempts: z.ZodDefault<z.ZodNumber>;
1600
+ /**
1601
+ * Guard policy to enforce
1602
+ * INV-ALO-001: Guards run after write
1603
+ */
1604
+ guardPolicy: z.ZodOptional<z.ZodString>;
1605
+ /**
1606
+ * Whether tests must pass before verify phase
1607
+ * INV-ALO-002: Test requirement
1608
+ */
1609
+ requireTestPass: z.ZodDefault<z.ZodBoolean>;
1610
+ /**
1611
+ * Phases that pause for user review
1612
+ * INV-ALO-004: Breakpoint behavior
1613
+ */
1614
+ breakpoints: z.ZodDefault<z.ZodArray<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>, "many">>;
1615
+ /**
1616
+ * Test command to run
1617
+ */
1618
+ testCommand: z.ZodDefault<z.ZodString>;
1619
+ /**
1620
+ * Timeout for test execution in milliseconds
1621
+ */
1622
+ testTimeout: z.ZodDefault<z.ZodNumber>;
1623
+ /**
1624
+ * Timeout per phase in milliseconds
1625
+ */
1626
+ phaseTimeout: z.ZodDefault<z.ZodNumber>;
1627
+ /**
1628
+ * Whether to auto-commit successful changes
1629
+ */
1630
+ autoCommit: z.ZodDefault<z.ZodBoolean>;
1631
+ /**
1632
+ * Commit message template (uses {{phase}}, {{iteration}})
1633
+ */
1634
+ commitMessageTemplate: z.ZodDefault<z.ZodString>;
1635
+ /**
1636
+ * Working directory for execution
1637
+ */
1638
+ workingDirectory: z.ZodOptional<z.ZodString>;
1639
+ /**
1640
+ * Agent ID to use for code generation
1641
+ */
1642
+ agentId: z.ZodOptional<z.ZodString>;
1643
+ /**
1644
+ * Provider to use for LLM calls
1645
+ */
1646
+ provider: z.ZodOptional<z.ZodString>;
1647
+ }, "strip", z.ZodTypeAny, {
1648
+ maxIterations: number;
1649
+ maxFixAttempts: number;
1650
+ requireTestPass: boolean;
1651
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
1652
+ testCommand: string;
1653
+ testTimeout: number;
1654
+ phaseTimeout: number;
1655
+ autoCommit: boolean;
1656
+ commitMessageTemplate: string;
1657
+ agentId?: string | undefined;
1658
+ provider?: string | undefined;
1659
+ guardPolicy?: string | undefined;
1660
+ workingDirectory?: string | undefined;
1661
+ }, {
1662
+ agentId?: string | undefined;
1663
+ provider?: string | undefined;
1664
+ maxIterations?: number | undefined;
1665
+ maxFixAttempts?: number | undefined;
1666
+ guardPolicy?: string | undefined;
1667
+ requireTestPass?: boolean | undefined;
1668
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
1669
+ testCommand?: string | undefined;
1670
+ testTimeout?: number | undefined;
1671
+ phaseTimeout?: number | undefined;
1672
+ autoCommit?: boolean | undefined;
1673
+ commitMessageTemplate?: string | undefined;
1674
+ workingDirectory?: string | undefined;
1675
+ }>;
1676
+ /**
1677
+ * All changed files across iterations
1678
+ * INV-ALO-005: Tracked for guard radius
1679
+ */
1680
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1681
+ /**
1682
+ * Iteration history
1683
+ */
1684
+ iterations: z.ZodDefault<z.ZodArray<z.ZodObject<{
1685
+ /**
1686
+ * Iteration number (1-indexed)
1687
+ */
1688
+ iteration: z.ZodNumber;
1689
+ /**
1690
+ * Phase that completed
1691
+ */
1692
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
1693
+ /**
1694
+ * Whether phase succeeded
1695
+ */
1696
+ success: z.ZodBoolean;
1697
+ /**
1698
+ * Files changed in this iteration
1699
+ */
1700
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1701
+ /**
1702
+ * Test result if test phase
1703
+ */
1704
+ testResult: z.ZodOptional<z.ZodObject<{
1705
+ /**
1706
+ * Whether all tests passed
1707
+ */
1708
+ passed: z.ZodBoolean;
1709
+ /**
1710
+ * Total test count
1711
+ */
1712
+ totalTests: z.ZodNumber;
1713
+ /**
1714
+ * Passed test count
1715
+ */
1716
+ passedTests: z.ZodNumber;
1717
+ /**
1718
+ * Failed test count
1719
+ */
1720
+ failedTests: z.ZodNumber;
1721
+ /**
1722
+ * Skipped test count
1723
+ */
1724
+ skippedTests: z.ZodDefault<z.ZodNumber>;
1725
+ /**
1726
+ * Error output if failed
1727
+ */
1728
+ errorOutput: z.ZodOptional<z.ZodString>;
1729
+ /**
1730
+ * Test duration in milliseconds
1731
+ */
1732
+ durationMs: z.ZodNumber;
1733
+ /**
1734
+ * Failed test names
1735
+ */
1736
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1737
+ }, "strip", z.ZodTypeAny, {
1738
+ durationMs: number;
1739
+ passed: boolean;
1740
+ totalTests: number;
1741
+ passedTests: number;
1742
+ failedTests: number;
1743
+ skippedTests: number;
1744
+ errorOutput?: string | undefined;
1745
+ failedTestNames?: string[] | undefined;
1746
+ }, {
1747
+ durationMs: number;
1748
+ passed: boolean;
1749
+ totalTests: number;
1750
+ passedTests: number;
1751
+ failedTests: number;
1752
+ skippedTests?: number | undefined;
1753
+ errorOutput?: string | undefined;
1754
+ failedTestNames?: string[] | undefined;
1755
+ }>>;
1756
+ /**
1757
+ * Guard result if write phase
1758
+ */
1759
+ guardResult: z.ZodOptional<z.ZodObject<{
1760
+ /**
1761
+ * Policy that was checked
1762
+ */
1763
+ policyId: z.ZodString;
1764
+ /**
1765
+ * Whether all gates passed
1766
+ */
1767
+ passed: z.ZodBoolean;
1768
+ /**
1769
+ * Whether execution is blocked
1770
+ */
1771
+ blocked: z.ZodBoolean;
1772
+ /**
1773
+ * Individual gate results
1774
+ */
1775
+ gateResults: z.ZodArray<z.ZodObject<{
1776
+ /**
1777
+ * Gate identifier
1778
+ */
1779
+ gateId: z.ZodString;
1780
+ /**
1781
+ * Whether the gate passed
1782
+ */
1783
+ passed: z.ZodBoolean;
1784
+ /**
1785
+ * Severity if failed
1786
+ */
1787
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
1788
+ /**
1789
+ * Message explaining result
1790
+ */
1791
+ message: z.ZodOptional<z.ZodString>;
1792
+ /**
1793
+ * Detailed violations if any
1794
+ */
1795
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
1796
+ path: z.ZodOptional<z.ZodString>;
1797
+ rule: z.ZodOptional<z.ZodString>;
1798
+ message: z.ZodString;
1799
+ }, "strip", z.ZodTypeAny, {
1800
+ message: string;
1801
+ path?: string | undefined;
1802
+ rule?: string | undefined;
1803
+ }, {
1804
+ message: string;
1805
+ path?: string | undefined;
1806
+ rule?: string | undefined;
1807
+ }>, "many">>;
1808
+ }, "strip", z.ZodTypeAny, {
1809
+ gateId: string;
1810
+ passed: boolean;
1811
+ message?: string | undefined;
1812
+ severity?: "info" | "error" | "warning" | undefined;
1813
+ violations?: {
1814
+ message: string;
1815
+ path?: string | undefined;
1816
+ rule?: string | undefined;
1817
+ }[] | undefined;
1818
+ }, {
1819
+ gateId: string;
1820
+ passed: boolean;
1821
+ message?: string | undefined;
1822
+ severity?: "info" | "error" | "warning" | undefined;
1823
+ violations?: {
1824
+ message: string;
1825
+ path?: string | undefined;
1826
+ rule?: string | undefined;
1827
+ }[] | undefined;
1828
+ }>, "many">;
1829
+ /**
1830
+ * Summary message
1831
+ */
1832
+ summary: z.ZodOptional<z.ZodString>;
1833
+ /**
1834
+ * Check timestamp
1835
+ */
1836
+ checkedAt: z.ZodString;
1837
+ }, "strip", z.ZodTypeAny, {
1838
+ blocked: boolean;
1839
+ policyId: string;
1840
+ checkedAt: string;
1841
+ passed: boolean;
1842
+ gateResults: {
1843
+ gateId: string;
1844
+ passed: boolean;
1845
+ message?: string | undefined;
1846
+ severity?: "info" | "error" | "warning" | undefined;
1847
+ violations?: {
1848
+ message: string;
1849
+ path?: string | undefined;
1850
+ rule?: string | undefined;
1851
+ }[] | undefined;
1852
+ }[];
1853
+ summary?: string | undefined;
1854
+ }, {
1855
+ blocked: boolean;
1856
+ policyId: string;
1857
+ checkedAt: string;
1858
+ passed: boolean;
1859
+ gateResults: {
1860
+ gateId: string;
1861
+ passed: boolean;
1862
+ message?: string | undefined;
1863
+ severity?: "info" | "error" | "warning" | undefined;
1864
+ violations?: {
1865
+ message: string;
1866
+ path?: string | undefined;
1867
+ rule?: string | undefined;
1868
+ }[] | undefined;
1869
+ }[];
1870
+ summary?: string | undefined;
1871
+ }>>;
1872
+ /**
1873
+ * Fix attempts made
1874
+ */
1875
+ fixAttempts: z.ZodDefault<z.ZodNumber>;
1876
+ /**
1877
+ * Error message if failed
1878
+ */
1879
+ error: z.ZodOptional<z.ZodString>;
1880
+ /**
1881
+ * Duration in milliseconds
1882
+ */
1883
+ durationMs: z.ZodNumber;
1884
+ /**
1885
+ * Start timestamp
1886
+ */
1887
+ startedAt: z.ZodString;
1888
+ /**
1889
+ * End timestamp
1890
+ */
1891
+ completedAt: z.ZodOptional<z.ZodString>;
1892
+ }, "strip", z.ZodTypeAny, {
1893
+ durationMs: number;
1894
+ success: boolean;
1895
+ startedAt: string;
1896
+ iteration: number;
1897
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1898
+ changedFiles: string[];
1899
+ fixAttempts: number;
1900
+ error?: string | undefined;
1901
+ guardResult?: {
1902
+ blocked: boolean;
1903
+ policyId: string;
1904
+ checkedAt: string;
1905
+ passed: boolean;
1906
+ gateResults: {
1907
+ gateId: string;
1908
+ passed: boolean;
1909
+ message?: string | undefined;
1910
+ severity?: "info" | "error" | "warning" | undefined;
1911
+ violations?: {
1912
+ message: string;
1913
+ path?: string | undefined;
1914
+ rule?: string | undefined;
1915
+ }[] | undefined;
1916
+ }[];
1917
+ summary?: string | undefined;
1918
+ } | undefined;
1919
+ completedAt?: string | undefined;
1920
+ testResult?: {
1921
+ durationMs: number;
1922
+ passed: boolean;
1923
+ totalTests: number;
1924
+ passedTests: number;
1925
+ failedTests: number;
1926
+ skippedTests: number;
1927
+ errorOutput?: string | undefined;
1928
+ failedTestNames?: string[] | undefined;
1929
+ } | undefined;
1930
+ }, {
1931
+ durationMs: number;
1932
+ success: boolean;
1933
+ startedAt: string;
1934
+ iteration: number;
1935
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
1936
+ error?: string | undefined;
1937
+ guardResult?: {
1938
+ blocked: boolean;
1939
+ policyId: string;
1940
+ checkedAt: string;
1941
+ passed: boolean;
1942
+ gateResults: {
1943
+ gateId: string;
1944
+ passed: boolean;
1945
+ message?: string | undefined;
1946
+ severity?: "info" | "error" | "warning" | undefined;
1947
+ violations?: {
1948
+ message: string;
1949
+ path?: string | undefined;
1950
+ rule?: string | undefined;
1951
+ }[] | undefined;
1952
+ }[];
1953
+ summary?: string | undefined;
1954
+ } | undefined;
1955
+ completedAt?: string | undefined;
1956
+ changedFiles?: string[] | undefined;
1957
+ testResult?: {
1958
+ durationMs: number;
1959
+ passed: boolean;
1960
+ totalTests: number;
1961
+ passedTests: number;
1962
+ failedTests: number;
1963
+ skippedTests?: number | undefined;
1964
+ errorOutput?: string | undefined;
1965
+ failedTestNames?: string[] | undefined;
1966
+ } | undefined;
1967
+ fixAttempts?: number | undefined;
1968
+ }>, "many">>;
1969
+ /**
1970
+ * Latest guard check result
1971
+ */
1972
+ lastGuardResult: z.ZodOptional<z.ZodObject<{
1973
+ /**
1974
+ * Policy that was checked
1975
+ */
1976
+ policyId: z.ZodString;
1977
+ /**
1978
+ * Whether all gates passed
1979
+ */
1980
+ passed: z.ZodBoolean;
1981
+ /**
1982
+ * Whether execution is blocked
1983
+ */
1984
+ blocked: z.ZodBoolean;
1985
+ /**
1986
+ * Individual gate results
1987
+ */
1988
+ gateResults: z.ZodArray<z.ZodObject<{
1989
+ /**
1990
+ * Gate identifier
1991
+ */
1992
+ gateId: z.ZodString;
1993
+ /**
1994
+ * Whether the gate passed
1995
+ */
1996
+ passed: z.ZodBoolean;
1997
+ /**
1998
+ * Severity if failed
1999
+ */
2000
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
2001
+ /**
2002
+ * Message explaining result
2003
+ */
2004
+ message: z.ZodOptional<z.ZodString>;
2005
+ /**
2006
+ * Detailed violations if any
2007
+ */
2008
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
2009
+ path: z.ZodOptional<z.ZodString>;
2010
+ rule: z.ZodOptional<z.ZodString>;
2011
+ message: z.ZodString;
2012
+ }, "strip", z.ZodTypeAny, {
2013
+ message: string;
2014
+ path?: string | undefined;
2015
+ rule?: string | undefined;
2016
+ }, {
2017
+ message: string;
2018
+ path?: string | undefined;
2019
+ rule?: string | undefined;
2020
+ }>, "many">>;
2021
+ }, "strip", z.ZodTypeAny, {
2022
+ gateId: string;
2023
+ passed: boolean;
2024
+ message?: string | undefined;
2025
+ severity?: "info" | "error" | "warning" | undefined;
2026
+ violations?: {
2027
+ message: string;
2028
+ path?: string | undefined;
2029
+ rule?: string | undefined;
2030
+ }[] | undefined;
2031
+ }, {
2032
+ gateId: string;
2033
+ passed: boolean;
2034
+ message?: string | undefined;
2035
+ severity?: "info" | "error" | "warning" | undefined;
2036
+ violations?: {
2037
+ message: string;
2038
+ path?: string | undefined;
2039
+ rule?: string | undefined;
2040
+ }[] | undefined;
2041
+ }>, "many">;
2042
+ /**
2043
+ * Summary message
2044
+ */
2045
+ summary: z.ZodOptional<z.ZodString>;
2046
+ /**
2047
+ * Check timestamp
2048
+ */
2049
+ checkedAt: z.ZodString;
2050
+ }, "strip", z.ZodTypeAny, {
2051
+ blocked: boolean;
2052
+ policyId: string;
2053
+ checkedAt: string;
2054
+ passed: boolean;
2055
+ gateResults: {
2056
+ gateId: string;
2057
+ passed: boolean;
2058
+ message?: string | undefined;
2059
+ severity?: "info" | "error" | "warning" | undefined;
2060
+ violations?: {
2061
+ message: string;
2062
+ path?: string | undefined;
2063
+ rule?: string | undefined;
2064
+ }[] | undefined;
2065
+ }[];
2066
+ summary?: string | undefined;
2067
+ }, {
2068
+ blocked: boolean;
2069
+ policyId: string;
2070
+ checkedAt: string;
2071
+ passed: boolean;
2072
+ gateResults: {
2073
+ gateId: string;
2074
+ passed: boolean;
2075
+ message?: string | undefined;
2076
+ severity?: "info" | "error" | "warning" | undefined;
2077
+ violations?: {
2078
+ message: string;
2079
+ path?: string | undefined;
2080
+ rule?: string | undefined;
2081
+ }[] | undefined;
2082
+ }[];
2083
+ summary?: string | undefined;
2084
+ }>>;
2085
+ /**
2086
+ * Latest test result
2087
+ */
2088
+ lastTestResult: z.ZodOptional<z.ZodObject<{
2089
+ /**
2090
+ * Whether all tests passed
2091
+ */
2092
+ passed: z.ZodBoolean;
2093
+ /**
2094
+ * Total test count
2095
+ */
2096
+ totalTests: z.ZodNumber;
2097
+ /**
2098
+ * Passed test count
2099
+ */
2100
+ passedTests: z.ZodNumber;
2101
+ /**
2102
+ * Failed test count
2103
+ */
2104
+ failedTests: z.ZodNumber;
2105
+ /**
2106
+ * Skipped test count
2107
+ */
2108
+ skippedTests: z.ZodDefault<z.ZodNumber>;
2109
+ /**
2110
+ * Error output if failed
2111
+ */
2112
+ errorOutput: z.ZodOptional<z.ZodString>;
2113
+ /**
2114
+ * Test duration in milliseconds
2115
+ */
2116
+ durationMs: z.ZodNumber;
2117
+ /**
2118
+ * Failed test names
2119
+ */
2120
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2121
+ }, "strip", z.ZodTypeAny, {
2122
+ durationMs: number;
2123
+ passed: boolean;
2124
+ totalTests: number;
2125
+ passedTests: number;
2126
+ failedTests: number;
2127
+ skippedTests: number;
2128
+ errorOutput?: string | undefined;
2129
+ failedTestNames?: string[] | undefined;
2130
+ }, {
2131
+ durationMs: number;
2132
+ passed: boolean;
2133
+ totalTests: number;
2134
+ passedTests: number;
2135
+ failedTests: number;
2136
+ skippedTests?: number | undefined;
2137
+ errorOutput?: string | undefined;
2138
+ failedTestNames?: string[] | undefined;
2139
+ }>>;
2140
+ /**
2141
+ * Current fix attempts in iteration
2142
+ */
2143
+ currentFixAttempts: z.ZodDefault<z.ZodNumber>;
2144
+ /**
2145
+ * Pause reason if paused
2146
+ */
2147
+ pauseReason: z.ZodOptional<z.ZodString>;
2148
+ /**
2149
+ * Error if failed or blocked
2150
+ */
2151
+ error: z.ZodOptional<z.ZodString>;
2152
+ /**
2153
+ * Session ID for tracking
2154
+ */
2155
+ sessionId: z.ZodOptional<z.ZodString>;
2156
+ /**
2157
+ * Start timestamp
2158
+ */
2159
+ startedAt: z.ZodString;
2160
+ /**
2161
+ * Last update timestamp
2162
+ */
2163
+ updatedAt: z.ZodString;
2164
+ /**
2165
+ * Completion timestamp
2166
+ */
2167
+ completedAt: z.ZodOptional<z.ZodString>;
2168
+ }, "strip", z.ZodTypeAny, {
2169
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
2170
+ config: {
2171
+ maxIterations: number;
2172
+ maxFixAttempts: number;
2173
+ requireTestPass: boolean;
2174
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
2175
+ testCommand: string;
2176
+ testTimeout: number;
2177
+ phaseTimeout: number;
2178
+ autoCommit: boolean;
2179
+ commitMessageTemplate: string;
2180
+ agentId?: string | undefined;
2181
+ provider?: string | undefined;
2182
+ guardPolicy?: string | undefined;
2183
+ workingDirectory?: string | undefined;
2184
+ };
2185
+ task: string;
2186
+ updatedAt: string;
2187
+ startedAt: string;
2188
+ iterations: {
2189
+ durationMs: number;
2190
+ success: boolean;
2191
+ startedAt: string;
2192
+ iteration: number;
2193
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2194
+ changedFiles: string[];
2195
+ fixAttempts: number;
2196
+ error?: string | undefined;
2197
+ guardResult?: {
2198
+ blocked: boolean;
2199
+ policyId: string;
2200
+ checkedAt: string;
2201
+ passed: boolean;
2202
+ gateResults: {
2203
+ gateId: string;
2204
+ passed: boolean;
2205
+ message?: string | undefined;
2206
+ severity?: "info" | "error" | "warning" | undefined;
2207
+ violations?: {
2208
+ message: string;
2209
+ path?: string | undefined;
2210
+ rule?: string | undefined;
2211
+ }[] | undefined;
2212
+ }[];
2213
+ summary?: string | undefined;
2214
+ } | undefined;
2215
+ completedAt?: string | undefined;
2216
+ testResult?: {
2217
+ durationMs: number;
2218
+ passed: boolean;
2219
+ totalTests: number;
2220
+ passedTests: number;
2221
+ failedTests: number;
2222
+ skippedTests: number;
2223
+ errorOutput?: string | undefined;
2224
+ failedTestNames?: string[] | undefined;
2225
+ } | undefined;
2226
+ }[];
2227
+ iteration: number;
2228
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2229
+ changedFiles: string[];
2230
+ loopId: string;
2231
+ currentFixAttempts: number;
2232
+ sessionId?: string | undefined;
2233
+ error?: string | undefined;
2234
+ completedAt?: string | undefined;
2235
+ lastGuardResult?: {
2236
+ blocked: boolean;
2237
+ policyId: string;
2238
+ checkedAt: string;
2239
+ passed: boolean;
2240
+ gateResults: {
2241
+ gateId: string;
2242
+ passed: boolean;
2243
+ message?: string | undefined;
2244
+ severity?: "info" | "error" | "warning" | undefined;
2245
+ violations?: {
2246
+ message: string;
2247
+ path?: string | undefined;
2248
+ rule?: string | undefined;
2249
+ }[] | undefined;
2250
+ }[];
2251
+ summary?: string | undefined;
2252
+ } | undefined;
2253
+ lastTestResult?: {
2254
+ durationMs: number;
2255
+ passed: boolean;
2256
+ totalTests: number;
2257
+ passedTests: number;
2258
+ failedTests: number;
2259
+ skippedTests: number;
2260
+ errorOutput?: string | undefined;
2261
+ failedTestNames?: string[] | undefined;
2262
+ } | undefined;
2263
+ pauseReason?: string | undefined;
2264
+ }, {
2265
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
2266
+ config: {
2267
+ agentId?: string | undefined;
2268
+ provider?: string | undefined;
2269
+ maxIterations?: number | undefined;
2270
+ maxFixAttempts?: number | undefined;
2271
+ guardPolicy?: string | undefined;
2272
+ requireTestPass?: boolean | undefined;
2273
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2274
+ testCommand?: string | undefined;
2275
+ testTimeout?: number | undefined;
2276
+ phaseTimeout?: number | undefined;
2277
+ autoCommit?: boolean | undefined;
2278
+ commitMessageTemplate?: string | undefined;
2279
+ workingDirectory?: string | undefined;
2280
+ };
2281
+ task: string;
2282
+ updatedAt: string;
2283
+ startedAt: string;
2284
+ iteration: number;
2285
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2286
+ loopId: string;
2287
+ sessionId?: string | undefined;
2288
+ error?: string | undefined;
2289
+ completedAt?: string | undefined;
2290
+ iterations?: {
2291
+ durationMs: number;
2292
+ success: boolean;
2293
+ startedAt: string;
2294
+ iteration: number;
2295
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2296
+ error?: string | undefined;
2297
+ guardResult?: {
2298
+ blocked: boolean;
2299
+ policyId: string;
2300
+ checkedAt: string;
2301
+ passed: boolean;
2302
+ gateResults: {
2303
+ gateId: string;
2304
+ passed: boolean;
2305
+ message?: string | undefined;
2306
+ severity?: "info" | "error" | "warning" | undefined;
2307
+ violations?: {
2308
+ message: string;
2309
+ path?: string | undefined;
2310
+ rule?: string | undefined;
2311
+ }[] | undefined;
2312
+ }[];
2313
+ summary?: string | undefined;
2314
+ } | undefined;
2315
+ completedAt?: string | undefined;
2316
+ changedFiles?: string[] | undefined;
2317
+ testResult?: {
2318
+ durationMs: number;
2319
+ passed: boolean;
2320
+ totalTests: number;
2321
+ passedTests: number;
2322
+ failedTests: number;
2323
+ skippedTests?: number | undefined;
2324
+ errorOutput?: string | undefined;
2325
+ failedTestNames?: string[] | undefined;
2326
+ } | undefined;
2327
+ fixAttempts?: number | undefined;
2328
+ }[] | undefined;
2329
+ changedFiles?: string[] | undefined;
2330
+ lastGuardResult?: {
2331
+ blocked: boolean;
2332
+ policyId: string;
2333
+ checkedAt: string;
2334
+ passed: boolean;
2335
+ gateResults: {
2336
+ gateId: string;
2337
+ passed: boolean;
2338
+ message?: string | undefined;
2339
+ severity?: "info" | "error" | "warning" | undefined;
2340
+ violations?: {
2341
+ message: string;
2342
+ path?: string | undefined;
2343
+ rule?: string | undefined;
2344
+ }[] | undefined;
2345
+ }[];
2346
+ summary?: string | undefined;
2347
+ } | undefined;
2348
+ lastTestResult?: {
2349
+ durationMs: number;
2350
+ passed: boolean;
2351
+ totalTests: number;
2352
+ passedTests: number;
2353
+ failedTests: number;
2354
+ skippedTests?: number | undefined;
2355
+ errorOutput?: string | undefined;
2356
+ failedTestNames?: string[] | undefined;
2357
+ } | undefined;
2358
+ currentFixAttempts?: number | undefined;
2359
+ pauseReason?: string | undefined;
2360
+ }>;
2361
+ /**
2362
+ * Whether loop started successfully
2363
+ */
2364
+ started: z.ZodBoolean;
2365
+ /**
2366
+ * Message
2367
+ */
2368
+ message: z.ZodOptional<z.ZodString>;
2369
+ }, "strip", z.ZodTypeAny, {
2370
+ started: boolean;
2371
+ state: {
2372
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
2373
+ config: {
2374
+ maxIterations: number;
2375
+ maxFixAttempts: number;
2376
+ requireTestPass: boolean;
2377
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
2378
+ testCommand: string;
2379
+ testTimeout: number;
2380
+ phaseTimeout: number;
2381
+ autoCommit: boolean;
2382
+ commitMessageTemplate: string;
2383
+ agentId?: string | undefined;
2384
+ provider?: string | undefined;
2385
+ guardPolicy?: string | undefined;
2386
+ workingDirectory?: string | undefined;
2387
+ };
2388
+ task: string;
2389
+ updatedAt: string;
2390
+ startedAt: string;
2391
+ iterations: {
2392
+ durationMs: number;
2393
+ success: boolean;
2394
+ startedAt: string;
2395
+ iteration: number;
2396
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2397
+ changedFiles: string[];
2398
+ fixAttempts: number;
2399
+ error?: string | undefined;
2400
+ guardResult?: {
2401
+ blocked: boolean;
2402
+ policyId: string;
2403
+ checkedAt: string;
2404
+ passed: boolean;
2405
+ gateResults: {
2406
+ gateId: string;
2407
+ passed: boolean;
2408
+ message?: string | undefined;
2409
+ severity?: "info" | "error" | "warning" | undefined;
2410
+ violations?: {
2411
+ message: string;
2412
+ path?: string | undefined;
2413
+ rule?: string | undefined;
2414
+ }[] | undefined;
2415
+ }[];
2416
+ summary?: string | undefined;
2417
+ } | undefined;
2418
+ completedAt?: string | undefined;
2419
+ testResult?: {
2420
+ durationMs: number;
2421
+ passed: boolean;
2422
+ totalTests: number;
2423
+ passedTests: number;
2424
+ failedTests: number;
2425
+ skippedTests: number;
2426
+ errorOutput?: string | undefined;
2427
+ failedTestNames?: string[] | undefined;
2428
+ } | undefined;
2429
+ }[];
2430
+ iteration: number;
2431
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2432
+ changedFiles: string[];
2433
+ loopId: string;
2434
+ currentFixAttempts: number;
2435
+ sessionId?: string | undefined;
2436
+ error?: string | undefined;
2437
+ completedAt?: string | undefined;
2438
+ lastGuardResult?: {
2439
+ blocked: boolean;
2440
+ policyId: string;
2441
+ checkedAt: string;
2442
+ passed: boolean;
2443
+ gateResults: {
2444
+ gateId: string;
2445
+ passed: boolean;
2446
+ message?: string | undefined;
2447
+ severity?: "info" | "error" | "warning" | undefined;
2448
+ violations?: {
2449
+ message: string;
2450
+ path?: string | undefined;
2451
+ rule?: string | undefined;
2452
+ }[] | undefined;
2453
+ }[];
2454
+ summary?: string | undefined;
2455
+ } | undefined;
2456
+ lastTestResult?: {
2457
+ durationMs: number;
2458
+ passed: boolean;
2459
+ totalTests: number;
2460
+ passedTests: number;
2461
+ failedTests: number;
2462
+ skippedTests: number;
2463
+ errorOutput?: string | undefined;
2464
+ failedTestNames?: string[] | undefined;
2465
+ } | undefined;
2466
+ pauseReason?: string | undefined;
2467
+ };
2468
+ loopId: string;
2469
+ message?: string | undefined;
2470
+ }, {
2471
+ started: boolean;
2472
+ state: {
2473
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
2474
+ config: {
2475
+ agentId?: string | undefined;
2476
+ provider?: string | undefined;
2477
+ maxIterations?: number | undefined;
2478
+ maxFixAttempts?: number | undefined;
2479
+ guardPolicy?: string | undefined;
2480
+ requireTestPass?: boolean | undefined;
2481
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2482
+ testCommand?: string | undefined;
2483
+ testTimeout?: number | undefined;
2484
+ phaseTimeout?: number | undefined;
2485
+ autoCommit?: boolean | undefined;
2486
+ commitMessageTemplate?: string | undefined;
2487
+ workingDirectory?: string | undefined;
2488
+ };
2489
+ task: string;
2490
+ updatedAt: string;
2491
+ startedAt: string;
2492
+ iteration: number;
2493
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2494
+ loopId: string;
2495
+ sessionId?: string | undefined;
2496
+ error?: string | undefined;
2497
+ completedAt?: string | undefined;
2498
+ iterations?: {
2499
+ durationMs: number;
2500
+ success: boolean;
2501
+ startedAt: string;
2502
+ iteration: number;
2503
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
2504
+ error?: string | undefined;
2505
+ guardResult?: {
2506
+ blocked: boolean;
2507
+ policyId: string;
2508
+ checkedAt: string;
2509
+ passed: boolean;
2510
+ gateResults: {
2511
+ gateId: string;
2512
+ passed: boolean;
2513
+ message?: string | undefined;
2514
+ severity?: "info" | "error" | "warning" | undefined;
2515
+ violations?: {
2516
+ message: string;
2517
+ path?: string | undefined;
2518
+ rule?: string | undefined;
2519
+ }[] | undefined;
2520
+ }[];
2521
+ summary?: string | undefined;
2522
+ } | undefined;
2523
+ completedAt?: string | undefined;
2524
+ changedFiles?: string[] | undefined;
2525
+ testResult?: {
2526
+ durationMs: number;
2527
+ passed: boolean;
2528
+ totalTests: number;
2529
+ passedTests: number;
2530
+ failedTests: number;
2531
+ skippedTests?: number | undefined;
2532
+ errorOutput?: string | undefined;
2533
+ failedTestNames?: string[] | undefined;
2534
+ } | undefined;
2535
+ fixAttempts?: number | undefined;
2536
+ }[] | undefined;
2537
+ changedFiles?: string[] | undefined;
2538
+ lastGuardResult?: {
2539
+ blocked: boolean;
2540
+ policyId: string;
2541
+ checkedAt: string;
2542
+ passed: boolean;
2543
+ gateResults: {
2544
+ gateId: string;
2545
+ passed: boolean;
2546
+ message?: string | undefined;
2547
+ severity?: "info" | "error" | "warning" | undefined;
2548
+ violations?: {
2549
+ message: string;
2550
+ path?: string | undefined;
2551
+ rule?: string | undefined;
2552
+ }[] | undefined;
2553
+ }[];
2554
+ summary?: string | undefined;
2555
+ } | undefined;
2556
+ lastTestResult?: {
2557
+ durationMs: number;
2558
+ passed: boolean;
2559
+ totalTests: number;
2560
+ passedTests: number;
2561
+ failedTests: number;
2562
+ skippedTests?: number | undefined;
2563
+ errorOutput?: string | undefined;
2564
+ failedTestNames?: string[] | undefined;
2565
+ } | undefined;
2566
+ currentFixAttempts?: number | undefined;
2567
+ pauseReason?: string | undefined;
2568
+ };
2569
+ loopId: string;
2570
+ message?: string | undefined;
2571
+ }>;
2572
+ export type StartLoopResponse = z.infer<typeof StartLoopResponseSchema>;
2573
+ /**
2574
+ * Request to continue a paused loop
2575
+ */
2576
+ export declare const ContinueLoopRequestSchema: z.ZodObject<{
2577
+ /**
2578
+ * Loop ID to continue
2579
+ */
2580
+ loopId: z.ZodString;
2581
+ /**
2582
+ * Whether to skip to next phase
2583
+ */
2584
+ skipToPhase: z.ZodOptional<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>>;
2585
+ /**
2586
+ * User feedback/instructions
2587
+ */
2588
+ feedback: z.ZodOptional<z.ZodString>;
2589
+ /**
2590
+ * Override config for remaining iterations
2591
+ */
2592
+ configOverrides: z.ZodOptional<z.ZodObject<{
2593
+ maxIterations: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2594
+ maxFixAttempts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2595
+ guardPolicy: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2596
+ requireTestPass: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2597
+ breakpoints: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>, "many">>>;
2598
+ testCommand: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2599
+ testTimeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2600
+ phaseTimeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2601
+ autoCommit: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2602
+ commitMessageTemplate: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2603
+ workingDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2604
+ agentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2605
+ provider: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2606
+ }, "strip", z.ZodTypeAny, {
2607
+ agentId?: string | undefined;
2608
+ provider?: string | undefined;
2609
+ maxIterations?: number | undefined;
2610
+ maxFixAttempts?: number | undefined;
2611
+ guardPolicy?: string | undefined;
2612
+ requireTestPass?: boolean | undefined;
2613
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2614
+ testCommand?: string | undefined;
2615
+ testTimeout?: number | undefined;
2616
+ phaseTimeout?: number | undefined;
2617
+ autoCommit?: boolean | undefined;
2618
+ commitMessageTemplate?: string | undefined;
2619
+ workingDirectory?: string | undefined;
2620
+ }, {
2621
+ agentId?: string | undefined;
2622
+ provider?: string | undefined;
2623
+ maxIterations?: number | undefined;
2624
+ maxFixAttempts?: number | undefined;
2625
+ guardPolicy?: string | undefined;
2626
+ requireTestPass?: boolean | undefined;
2627
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2628
+ testCommand?: string | undefined;
2629
+ testTimeout?: number | undefined;
2630
+ phaseTimeout?: number | undefined;
2631
+ autoCommit?: boolean | undefined;
2632
+ commitMessageTemplate?: string | undefined;
2633
+ workingDirectory?: string | undefined;
2634
+ }>>;
2635
+ }, "strip", z.ZodTypeAny, {
2636
+ loopId: string;
2637
+ skipToPhase?: "write" | "complete" | "plan" | "test" | "fix" | "verify" | undefined;
2638
+ feedback?: string | undefined;
2639
+ configOverrides?: {
2640
+ agentId?: string | undefined;
2641
+ provider?: string | undefined;
2642
+ maxIterations?: number | undefined;
2643
+ maxFixAttempts?: number | undefined;
2644
+ guardPolicy?: string | undefined;
2645
+ requireTestPass?: boolean | undefined;
2646
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2647
+ testCommand?: string | undefined;
2648
+ testTimeout?: number | undefined;
2649
+ phaseTimeout?: number | undefined;
2650
+ autoCommit?: boolean | undefined;
2651
+ commitMessageTemplate?: string | undefined;
2652
+ workingDirectory?: string | undefined;
2653
+ } | undefined;
2654
+ }, {
2655
+ loopId: string;
2656
+ skipToPhase?: "write" | "complete" | "plan" | "test" | "fix" | "verify" | undefined;
2657
+ feedback?: string | undefined;
2658
+ configOverrides?: {
2659
+ agentId?: string | undefined;
2660
+ provider?: string | undefined;
2661
+ maxIterations?: number | undefined;
2662
+ maxFixAttempts?: number | undefined;
2663
+ guardPolicy?: string | undefined;
2664
+ requireTestPass?: boolean | undefined;
2665
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2666
+ testCommand?: string | undefined;
2667
+ testTimeout?: number | undefined;
2668
+ phaseTimeout?: number | undefined;
2669
+ autoCommit?: boolean | undefined;
2670
+ commitMessageTemplate?: string | undefined;
2671
+ workingDirectory?: string | undefined;
2672
+ } | undefined;
2673
+ }>;
2674
+ export type ContinueLoopRequest = z.infer<typeof ContinueLoopRequestSchema>;
2675
+ /**
2676
+ * Request to abort a loop
2677
+ */
2678
+ export declare const AbortLoopRequestSchema: z.ZodObject<{
2679
+ /**
2680
+ * Loop ID to abort
2681
+ */
2682
+ loopId: z.ZodString;
2683
+ /**
2684
+ * Reason for aborting
2685
+ */
2686
+ reason: z.ZodOptional<z.ZodString>;
2687
+ /**
2688
+ * Whether to keep changes made
2689
+ */
2690
+ keepChanges: z.ZodDefault<z.ZodBoolean>;
2691
+ }, "strip", z.ZodTypeAny, {
2692
+ loopId: string;
2693
+ keepChanges: boolean;
2694
+ reason?: string | undefined;
2695
+ }, {
2696
+ loopId: string;
2697
+ reason?: string | undefined;
2698
+ keepChanges?: boolean | undefined;
2699
+ }>;
2700
+ export type AbortLoopRequest = z.infer<typeof AbortLoopRequestSchema>;
2701
+ /**
2702
+ * Loop status response
2703
+ */
2704
+ export declare const LoopStatusResponseSchema: z.ZodObject<{
2705
+ /**
2706
+ * Current state
2707
+ */
2708
+ state: z.ZodObject<{
2709
+ /**
2710
+ * Unique loop identifier
2711
+ */
2712
+ loopId: z.ZodString;
2713
+ /**
2714
+ * Current phase
2715
+ */
2716
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
2717
+ /**
2718
+ * Current iteration number
2719
+ */
2720
+ iteration: z.ZodNumber;
2721
+ /**
2722
+ * Current status
2723
+ */
2724
+ status: z.ZodEnum<["running", "paused", "completed", "failed", "blocked", "cancelled"]>;
2725
+ /**
2726
+ * Task description
2727
+ */
2728
+ task: z.ZodString;
2729
+ /**
2730
+ * Configuration used
2731
+ */
2732
+ config: z.ZodObject<{
2733
+ /**
2734
+ * Maximum iterations through the loop
2735
+ */
2736
+ maxIterations: z.ZodDefault<z.ZodNumber>;
2737
+ /**
2738
+ * Maximum fix attempts per iteration
2739
+ * INV-ALO-003: Bounded fix attempts
2740
+ */
2741
+ maxFixAttempts: z.ZodDefault<z.ZodNumber>;
2742
+ /**
2743
+ * Guard policy to enforce
2744
+ * INV-ALO-001: Guards run after write
2745
+ */
2746
+ guardPolicy: z.ZodOptional<z.ZodString>;
2747
+ /**
2748
+ * Whether tests must pass before verify phase
2749
+ * INV-ALO-002: Test requirement
2750
+ */
2751
+ requireTestPass: z.ZodDefault<z.ZodBoolean>;
2752
+ /**
2753
+ * Phases that pause for user review
2754
+ * INV-ALO-004: Breakpoint behavior
2755
+ */
2756
+ breakpoints: z.ZodDefault<z.ZodArray<z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>, "many">>;
2757
+ /**
2758
+ * Test command to run
2759
+ */
2760
+ testCommand: z.ZodDefault<z.ZodString>;
2761
+ /**
2762
+ * Timeout for test execution in milliseconds
2763
+ */
2764
+ testTimeout: z.ZodDefault<z.ZodNumber>;
2765
+ /**
2766
+ * Timeout per phase in milliseconds
2767
+ */
2768
+ phaseTimeout: z.ZodDefault<z.ZodNumber>;
2769
+ /**
2770
+ * Whether to auto-commit successful changes
2771
+ */
2772
+ autoCommit: z.ZodDefault<z.ZodBoolean>;
2773
+ /**
2774
+ * Commit message template (uses {{phase}}, {{iteration}})
2775
+ */
2776
+ commitMessageTemplate: z.ZodDefault<z.ZodString>;
2777
+ /**
2778
+ * Working directory for execution
2779
+ */
2780
+ workingDirectory: z.ZodOptional<z.ZodString>;
2781
+ /**
2782
+ * Agent ID to use for code generation
2783
+ */
2784
+ agentId: z.ZodOptional<z.ZodString>;
2785
+ /**
2786
+ * Provider to use for LLM calls
2787
+ */
2788
+ provider: z.ZodOptional<z.ZodString>;
2789
+ }, "strip", z.ZodTypeAny, {
2790
+ maxIterations: number;
2791
+ maxFixAttempts: number;
2792
+ requireTestPass: boolean;
2793
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
2794
+ testCommand: string;
2795
+ testTimeout: number;
2796
+ phaseTimeout: number;
2797
+ autoCommit: boolean;
2798
+ commitMessageTemplate: string;
2799
+ agentId?: string | undefined;
2800
+ provider?: string | undefined;
2801
+ guardPolicy?: string | undefined;
2802
+ workingDirectory?: string | undefined;
2803
+ }, {
2804
+ agentId?: string | undefined;
2805
+ provider?: string | undefined;
2806
+ maxIterations?: number | undefined;
2807
+ maxFixAttempts?: number | undefined;
2808
+ guardPolicy?: string | undefined;
2809
+ requireTestPass?: boolean | undefined;
2810
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
2811
+ testCommand?: string | undefined;
2812
+ testTimeout?: number | undefined;
2813
+ phaseTimeout?: number | undefined;
2814
+ autoCommit?: boolean | undefined;
2815
+ commitMessageTemplate?: string | undefined;
2816
+ workingDirectory?: string | undefined;
2817
+ }>;
2818
+ /**
2819
+ * All changed files across iterations
2820
+ * INV-ALO-005: Tracked for guard radius
2821
+ */
2822
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2823
+ /**
2824
+ * Iteration history
2825
+ */
2826
+ iterations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2827
+ /**
2828
+ * Iteration number (1-indexed)
2829
+ */
2830
+ iteration: z.ZodNumber;
2831
+ /**
2832
+ * Phase that completed
2833
+ */
2834
+ phase: z.ZodEnum<["plan", "write", "test", "fix", "verify", "complete"]>;
2835
+ /**
2836
+ * Whether phase succeeded
2837
+ */
2838
+ success: z.ZodBoolean;
2839
+ /**
2840
+ * Files changed in this iteration
2841
+ */
2842
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2843
+ /**
2844
+ * Test result if test phase
2845
+ */
2846
+ testResult: z.ZodOptional<z.ZodObject<{
2847
+ /**
2848
+ * Whether all tests passed
2849
+ */
2850
+ passed: z.ZodBoolean;
2851
+ /**
2852
+ * Total test count
2853
+ */
2854
+ totalTests: z.ZodNumber;
2855
+ /**
2856
+ * Passed test count
2857
+ */
2858
+ passedTests: z.ZodNumber;
2859
+ /**
2860
+ * Failed test count
2861
+ */
2862
+ failedTests: z.ZodNumber;
2863
+ /**
2864
+ * Skipped test count
2865
+ */
2866
+ skippedTests: z.ZodDefault<z.ZodNumber>;
2867
+ /**
2868
+ * Error output if failed
2869
+ */
2870
+ errorOutput: z.ZodOptional<z.ZodString>;
2871
+ /**
2872
+ * Test duration in milliseconds
2873
+ */
2874
+ durationMs: z.ZodNumber;
2875
+ /**
2876
+ * Failed test names
2877
+ */
2878
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2879
+ }, "strip", z.ZodTypeAny, {
2880
+ durationMs: number;
2881
+ passed: boolean;
2882
+ totalTests: number;
2883
+ passedTests: number;
2884
+ failedTests: number;
2885
+ skippedTests: number;
2886
+ errorOutput?: string | undefined;
2887
+ failedTestNames?: string[] | undefined;
2888
+ }, {
2889
+ durationMs: number;
2890
+ passed: boolean;
2891
+ totalTests: number;
2892
+ passedTests: number;
2893
+ failedTests: number;
2894
+ skippedTests?: number | undefined;
2895
+ errorOutput?: string | undefined;
2896
+ failedTestNames?: string[] | undefined;
2897
+ }>>;
2898
+ /**
2899
+ * Guard result if write phase
2900
+ */
2901
+ guardResult: z.ZodOptional<z.ZodObject<{
2902
+ /**
2903
+ * Policy that was checked
2904
+ */
2905
+ policyId: z.ZodString;
2906
+ /**
2907
+ * Whether all gates passed
2908
+ */
2909
+ passed: z.ZodBoolean;
2910
+ /**
2911
+ * Whether execution is blocked
2912
+ */
2913
+ blocked: z.ZodBoolean;
2914
+ /**
2915
+ * Individual gate results
2916
+ */
2917
+ gateResults: z.ZodArray<z.ZodObject<{
2918
+ /**
2919
+ * Gate identifier
2920
+ */
2921
+ gateId: z.ZodString;
2922
+ /**
2923
+ * Whether the gate passed
2924
+ */
2925
+ passed: z.ZodBoolean;
2926
+ /**
2927
+ * Severity if failed
2928
+ */
2929
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
2930
+ /**
2931
+ * Message explaining result
2932
+ */
2933
+ message: z.ZodOptional<z.ZodString>;
2934
+ /**
2935
+ * Detailed violations if any
2936
+ */
2937
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
2938
+ path: z.ZodOptional<z.ZodString>;
2939
+ rule: z.ZodOptional<z.ZodString>;
2940
+ message: z.ZodString;
2941
+ }, "strip", z.ZodTypeAny, {
2942
+ message: string;
2943
+ path?: string | undefined;
2944
+ rule?: string | undefined;
2945
+ }, {
2946
+ message: string;
2947
+ path?: string | undefined;
2948
+ rule?: string | undefined;
2949
+ }>, "many">>;
2950
+ }, "strip", z.ZodTypeAny, {
2951
+ gateId: string;
2952
+ passed: boolean;
2953
+ message?: string | undefined;
2954
+ severity?: "info" | "error" | "warning" | undefined;
2955
+ violations?: {
2956
+ message: string;
2957
+ path?: string | undefined;
2958
+ rule?: string | undefined;
2959
+ }[] | undefined;
2960
+ }, {
2961
+ gateId: string;
2962
+ passed: boolean;
2963
+ message?: string | undefined;
2964
+ severity?: "info" | "error" | "warning" | undefined;
2965
+ violations?: {
2966
+ message: string;
2967
+ path?: string | undefined;
2968
+ rule?: string | undefined;
2969
+ }[] | undefined;
2970
+ }>, "many">;
2971
+ /**
2972
+ * Summary message
2973
+ */
2974
+ summary: z.ZodOptional<z.ZodString>;
2975
+ /**
2976
+ * Check timestamp
2977
+ */
2978
+ checkedAt: z.ZodString;
2979
+ }, "strip", z.ZodTypeAny, {
2980
+ blocked: boolean;
2981
+ policyId: string;
2982
+ checkedAt: string;
2983
+ passed: boolean;
2984
+ gateResults: {
2985
+ gateId: string;
2986
+ passed: boolean;
2987
+ message?: string | undefined;
2988
+ severity?: "info" | "error" | "warning" | undefined;
2989
+ violations?: {
2990
+ message: string;
2991
+ path?: string | undefined;
2992
+ rule?: string | undefined;
2993
+ }[] | undefined;
2994
+ }[];
2995
+ summary?: string | undefined;
2996
+ }, {
2997
+ blocked: boolean;
2998
+ policyId: string;
2999
+ checkedAt: string;
3000
+ passed: boolean;
3001
+ gateResults: {
3002
+ gateId: string;
3003
+ passed: boolean;
3004
+ message?: string | undefined;
3005
+ severity?: "info" | "error" | "warning" | undefined;
3006
+ violations?: {
3007
+ message: string;
3008
+ path?: string | undefined;
3009
+ rule?: string | undefined;
3010
+ }[] | undefined;
3011
+ }[];
3012
+ summary?: string | undefined;
3013
+ }>>;
3014
+ /**
3015
+ * Fix attempts made
3016
+ */
3017
+ fixAttempts: z.ZodDefault<z.ZodNumber>;
3018
+ /**
3019
+ * Error message if failed
3020
+ */
3021
+ error: z.ZodOptional<z.ZodString>;
3022
+ /**
3023
+ * Duration in milliseconds
3024
+ */
3025
+ durationMs: z.ZodNumber;
3026
+ /**
3027
+ * Start timestamp
3028
+ */
3029
+ startedAt: z.ZodString;
3030
+ /**
3031
+ * End timestamp
3032
+ */
3033
+ completedAt: z.ZodOptional<z.ZodString>;
3034
+ }, "strip", z.ZodTypeAny, {
3035
+ durationMs: number;
3036
+ success: boolean;
3037
+ startedAt: string;
3038
+ iteration: number;
3039
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3040
+ changedFiles: string[];
3041
+ fixAttempts: number;
3042
+ error?: string | undefined;
3043
+ guardResult?: {
3044
+ blocked: boolean;
3045
+ policyId: string;
3046
+ checkedAt: string;
3047
+ passed: boolean;
3048
+ gateResults: {
3049
+ gateId: string;
3050
+ passed: boolean;
3051
+ message?: string | undefined;
3052
+ severity?: "info" | "error" | "warning" | undefined;
3053
+ violations?: {
3054
+ message: string;
3055
+ path?: string | undefined;
3056
+ rule?: string | undefined;
3057
+ }[] | undefined;
3058
+ }[];
3059
+ summary?: string | undefined;
3060
+ } | undefined;
3061
+ completedAt?: string | undefined;
3062
+ testResult?: {
3063
+ durationMs: number;
3064
+ passed: boolean;
3065
+ totalTests: number;
3066
+ passedTests: number;
3067
+ failedTests: number;
3068
+ skippedTests: number;
3069
+ errorOutput?: string | undefined;
3070
+ failedTestNames?: string[] | undefined;
3071
+ } | undefined;
3072
+ }, {
3073
+ durationMs: number;
3074
+ success: boolean;
3075
+ startedAt: string;
3076
+ iteration: number;
3077
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3078
+ error?: string | undefined;
3079
+ guardResult?: {
3080
+ blocked: boolean;
3081
+ policyId: string;
3082
+ checkedAt: string;
3083
+ passed: boolean;
3084
+ gateResults: {
3085
+ gateId: string;
3086
+ passed: boolean;
3087
+ message?: string | undefined;
3088
+ severity?: "info" | "error" | "warning" | undefined;
3089
+ violations?: {
3090
+ message: string;
3091
+ path?: string | undefined;
3092
+ rule?: string | undefined;
3093
+ }[] | undefined;
3094
+ }[];
3095
+ summary?: string | undefined;
3096
+ } | undefined;
3097
+ completedAt?: string | undefined;
3098
+ changedFiles?: string[] | undefined;
3099
+ testResult?: {
3100
+ durationMs: number;
3101
+ passed: boolean;
3102
+ totalTests: number;
3103
+ passedTests: number;
3104
+ failedTests: number;
3105
+ skippedTests?: number | undefined;
3106
+ errorOutput?: string | undefined;
3107
+ failedTestNames?: string[] | undefined;
3108
+ } | undefined;
3109
+ fixAttempts?: number | undefined;
3110
+ }>, "many">>;
3111
+ /**
3112
+ * Latest guard check result
3113
+ */
3114
+ lastGuardResult: z.ZodOptional<z.ZodObject<{
3115
+ /**
3116
+ * Policy that was checked
3117
+ */
3118
+ policyId: z.ZodString;
3119
+ /**
3120
+ * Whether all gates passed
3121
+ */
3122
+ passed: z.ZodBoolean;
3123
+ /**
3124
+ * Whether execution is blocked
3125
+ */
3126
+ blocked: z.ZodBoolean;
3127
+ /**
3128
+ * Individual gate results
3129
+ */
3130
+ gateResults: z.ZodArray<z.ZodObject<{
3131
+ /**
3132
+ * Gate identifier
3133
+ */
3134
+ gateId: z.ZodString;
3135
+ /**
3136
+ * Whether the gate passed
3137
+ */
3138
+ passed: z.ZodBoolean;
3139
+ /**
3140
+ * Severity if failed
3141
+ */
3142
+ severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
3143
+ /**
3144
+ * Message explaining result
3145
+ */
3146
+ message: z.ZodOptional<z.ZodString>;
3147
+ /**
3148
+ * Detailed violations if any
3149
+ */
3150
+ violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
3151
+ path: z.ZodOptional<z.ZodString>;
3152
+ rule: z.ZodOptional<z.ZodString>;
3153
+ message: z.ZodString;
3154
+ }, "strip", z.ZodTypeAny, {
3155
+ message: string;
3156
+ path?: string | undefined;
3157
+ rule?: string | undefined;
3158
+ }, {
3159
+ message: string;
3160
+ path?: string | undefined;
3161
+ rule?: string | undefined;
3162
+ }>, "many">>;
3163
+ }, "strip", z.ZodTypeAny, {
3164
+ gateId: string;
3165
+ passed: boolean;
3166
+ message?: string | undefined;
3167
+ severity?: "info" | "error" | "warning" | undefined;
3168
+ violations?: {
3169
+ message: string;
3170
+ path?: string | undefined;
3171
+ rule?: string | undefined;
3172
+ }[] | undefined;
3173
+ }, {
3174
+ gateId: string;
3175
+ passed: boolean;
3176
+ message?: string | undefined;
3177
+ severity?: "info" | "error" | "warning" | undefined;
3178
+ violations?: {
3179
+ message: string;
3180
+ path?: string | undefined;
3181
+ rule?: string | undefined;
3182
+ }[] | undefined;
3183
+ }>, "many">;
3184
+ /**
3185
+ * Summary message
3186
+ */
3187
+ summary: z.ZodOptional<z.ZodString>;
3188
+ /**
3189
+ * Check timestamp
3190
+ */
3191
+ checkedAt: z.ZodString;
3192
+ }, "strip", z.ZodTypeAny, {
3193
+ blocked: boolean;
3194
+ policyId: string;
3195
+ checkedAt: string;
3196
+ passed: boolean;
3197
+ gateResults: {
3198
+ gateId: string;
3199
+ passed: boolean;
3200
+ message?: string | undefined;
3201
+ severity?: "info" | "error" | "warning" | undefined;
3202
+ violations?: {
3203
+ message: string;
3204
+ path?: string | undefined;
3205
+ rule?: string | undefined;
3206
+ }[] | undefined;
3207
+ }[];
3208
+ summary?: string | undefined;
3209
+ }, {
3210
+ blocked: boolean;
3211
+ policyId: string;
3212
+ checkedAt: string;
3213
+ passed: boolean;
3214
+ gateResults: {
3215
+ gateId: string;
3216
+ passed: boolean;
3217
+ message?: string | undefined;
3218
+ severity?: "info" | "error" | "warning" | undefined;
3219
+ violations?: {
3220
+ message: string;
3221
+ path?: string | undefined;
3222
+ rule?: string | undefined;
3223
+ }[] | undefined;
3224
+ }[];
3225
+ summary?: string | undefined;
3226
+ }>>;
3227
+ /**
3228
+ * Latest test result
3229
+ */
3230
+ lastTestResult: z.ZodOptional<z.ZodObject<{
3231
+ /**
3232
+ * Whether all tests passed
3233
+ */
3234
+ passed: z.ZodBoolean;
3235
+ /**
3236
+ * Total test count
3237
+ */
3238
+ totalTests: z.ZodNumber;
3239
+ /**
3240
+ * Passed test count
3241
+ */
3242
+ passedTests: z.ZodNumber;
3243
+ /**
3244
+ * Failed test count
3245
+ */
3246
+ failedTests: z.ZodNumber;
3247
+ /**
3248
+ * Skipped test count
3249
+ */
3250
+ skippedTests: z.ZodDefault<z.ZodNumber>;
3251
+ /**
3252
+ * Error output if failed
3253
+ */
3254
+ errorOutput: z.ZodOptional<z.ZodString>;
3255
+ /**
3256
+ * Test duration in milliseconds
3257
+ */
3258
+ durationMs: z.ZodNumber;
3259
+ /**
3260
+ * Failed test names
3261
+ */
3262
+ failedTestNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3263
+ }, "strip", z.ZodTypeAny, {
3264
+ durationMs: number;
3265
+ passed: boolean;
3266
+ totalTests: number;
3267
+ passedTests: number;
3268
+ failedTests: number;
3269
+ skippedTests: number;
3270
+ errorOutput?: string | undefined;
3271
+ failedTestNames?: string[] | undefined;
3272
+ }, {
3273
+ durationMs: number;
3274
+ passed: boolean;
3275
+ totalTests: number;
3276
+ passedTests: number;
3277
+ failedTests: number;
3278
+ skippedTests?: number | undefined;
3279
+ errorOutput?: string | undefined;
3280
+ failedTestNames?: string[] | undefined;
3281
+ }>>;
3282
+ /**
3283
+ * Current fix attempts in iteration
3284
+ */
3285
+ currentFixAttempts: z.ZodDefault<z.ZodNumber>;
3286
+ /**
3287
+ * Pause reason if paused
3288
+ */
3289
+ pauseReason: z.ZodOptional<z.ZodString>;
3290
+ /**
3291
+ * Error if failed or blocked
3292
+ */
3293
+ error: z.ZodOptional<z.ZodString>;
3294
+ /**
3295
+ * Session ID for tracking
3296
+ */
3297
+ sessionId: z.ZodOptional<z.ZodString>;
3298
+ /**
3299
+ * Start timestamp
3300
+ */
3301
+ startedAt: z.ZodString;
3302
+ /**
3303
+ * Last update timestamp
3304
+ */
3305
+ updatedAt: z.ZodString;
3306
+ /**
3307
+ * Completion timestamp
3308
+ */
3309
+ completedAt: z.ZodOptional<z.ZodString>;
3310
+ }, "strip", z.ZodTypeAny, {
3311
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
3312
+ config: {
3313
+ maxIterations: number;
3314
+ maxFixAttempts: number;
3315
+ requireTestPass: boolean;
3316
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
3317
+ testCommand: string;
3318
+ testTimeout: number;
3319
+ phaseTimeout: number;
3320
+ autoCommit: boolean;
3321
+ commitMessageTemplate: string;
3322
+ agentId?: string | undefined;
3323
+ provider?: string | undefined;
3324
+ guardPolicy?: string | undefined;
3325
+ workingDirectory?: string | undefined;
3326
+ };
3327
+ task: string;
3328
+ updatedAt: string;
3329
+ startedAt: string;
3330
+ iterations: {
3331
+ durationMs: number;
3332
+ success: boolean;
3333
+ startedAt: string;
3334
+ iteration: number;
3335
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3336
+ changedFiles: string[];
3337
+ fixAttempts: number;
3338
+ error?: string | undefined;
3339
+ guardResult?: {
3340
+ blocked: boolean;
3341
+ policyId: string;
3342
+ checkedAt: string;
3343
+ passed: boolean;
3344
+ gateResults: {
3345
+ gateId: string;
3346
+ passed: boolean;
3347
+ message?: string | undefined;
3348
+ severity?: "info" | "error" | "warning" | undefined;
3349
+ violations?: {
3350
+ message: string;
3351
+ path?: string | undefined;
3352
+ rule?: string | undefined;
3353
+ }[] | undefined;
3354
+ }[];
3355
+ summary?: string | undefined;
3356
+ } | undefined;
3357
+ completedAt?: string | undefined;
3358
+ testResult?: {
3359
+ durationMs: number;
3360
+ passed: boolean;
3361
+ totalTests: number;
3362
+ passedTests: number;
3363
+ failedTests: number;
3364
+ skippedTests: number;
3365
+ errorOutput?: string | undefined;
3366
+ failedTestNames?: string[] | undefined;
3367
+ } | undefined;
3368
+ }[];
3369
+ iteration: number;
3370
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3371
+ changedFiles: string[];
3372
+ loopId: string;
3373
+ currentFixAttempts: number;
3374
+ sessionId?: string | undefined;
3375
+ error?: string | undefined;
3376
+ completedAt?: string | undefined;
3377
+ lastGuardResult?: {
3378
+ blocked: boolean;
3379
+ policyId: string;
3380
+ checkedAt: string;
3381
+ passed: boolean;
3382
+ gateResults: {
3383
+ gateId: string;
3384
+ passed: boolean;
3385
+ message?: string | undefined;
3386
+ severity?: "info" | "error" | "warning" | undefined;
3387
+ violations?: {
3388
+ message: string;
3389
+ path?: string | undefined;
3390
+ rule?: string | undefined;
3391
+ }[] | undefined;
3392
+ }[];
3393
+ summary?: string | undefined;
3394
+ } | undefined;
3395
+ lastTestResult?: {
3396
+ durationMs: number;
3397
+ passed: boolean;
3398
+ totalTests: number;
3399
+ passedTests: number;
3400
+ failedTests: number;
3401
+ skippedTests: number;
3402
+ errorOutput?: string | undefined;
3403
+ failedTestNames?: string[] | undefined;
3404
+ } | undefined;
3405
+ pauseReason?: string | undefined;
3406
+ }, {
3407
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
3408
+ config: {
3409
+ agentId?: string | undefined;
3410
+ provider?: string | undefined;
3411
+ maxIterations?: number | undefined;
3412
+ maxFixAttempts?: number | undefined;
3413
+ guardPolicy?: string | undefined;
3414
+ requireTestPass?: boolean | undefined;
3415
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
3416
+ testCommand?: string | undefined;
3417
+ testTimeout?: number | undefined;
3418
+ phaseTimeout?: number | undefined;
3419
+ autoCommit?: boolean | undefined;
3420
+ commitMessageTemplate?: string | undefined;
3421
+ workingDirectory?: string | undefined;
3422
+ };
3423
+ task: string;
3424
+ updatedAt: string;
3425
+ startedAt: string;
3426
+ iteration: number;
3427
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3428
+ loopId: string;
3429
+ sessionId?: string | undefined;
3430
+ error?: string | undefined;
3431
+ completedAt?: string | undefined;
3432
+ iterations?: {
3433
+ durationMs: number;
3434
+ success: boolean;
3435
+ startedAt: string;
3436
+ iteration: number;
3437
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3438
+ error?: string | undefined;
3439
+ guardResult?: {
3440
+ blocked: boolean;
3441
+ policyId: string;
3442
+ checkedAt: string;
3443
+ passed: boolean;
3444
+ gateResults: {
3445
+ gateId: string;
3446
+ passed: boolean;
3447
+ message?: string | undefined;
3448
+ severity?: "info" | "error" | "warning" | undefined;
3449
+ violations?: {
3450
+ message: string;
3451
+ path?: string | undefined;
3452
+ rule?: string | undefined;
3453
+ }[] | undefined;
3454
+ }[];
3455
+ summary?: string | undefined;
3456
+ } | undefined;
3457
+ completedAt?: string | undefined;
3458
+ changedFiles?: string[] | undefined;
3459
+ testResult?: {
3460
+ durationMs: number;
3461
+ passed: boolean;
3462
+ totalTests: number;
3463
+ passedTests: number;
3464
+ failedTests: number;
3465
+ skippedTests?: number | undefined;
3466
+ errorOutput?: string | undefined;
3467
+ failedTestNames?: string[] | undefined;
3468
+ } | undefined;
3469
+ fixAttempts?: number | undefined;
3470
+ }[] | undefined;
3471
+ changedFiles?: string[] | undefined;
3472
+ lastGuardResult?: {
3473
+ blocked: boolean;
3474
+ policyId: string;
3475
+ checkedAt: string;
3476
+ passed: boolean;
3477
+ gateResults: {
3478
+ gateId: string;
3479
+ passed: boolean;
3480
+ message?: string | undefined;
3481
+ severity?: "info" | "error" | "warning" | undefined;
3482
+ violations?: {
3483
+ message: string;
3484
+ path?: string | undefined;
3485
+ rule?: string | undefined;
3486
+ }[] | undefined;
3487
+ }[];
3488
+ summary?: string | undefined;
3489
+ } | undefined;
3490
+ lastTestResult?: {
3491
+ durationMs: number;
3492
+ passed: boolean;
3493
+ totalTests: number;
3494
+ passedTests: number;
3495
+ failedTests: number;
3496
+ skippedTests?: number | undefined;
3497
+ errorOutput?: string | undefined;
3498
+ failedTestNames?: string[] | undefined;
3499
+ } | undefined;
3500
+ currentFixAttempts?: number | undefined;
3501
+ pauseReason?: string | undefined;
3502
+ }>;
3503
+ /**
3504
+ * Whether loop is active
3505
+ */
3506
+ isActive: z.ZodBoolean;
3507
+ /**
3508
+ * Whether waiting for user input
3509
+ */
3510
+ awaitingInput: z.ZodBoolean;
3511
+ /**
3512
+ * Progress percentage (0-100)
3513
+ */
3514
+ progress: z.ZodNumber;
3515
+ /**
3516
+ * Estimated remaining iterations
3517
+ */
3518
+ estimatedRemaining: z.ZodOptional<z.ZodNumber>;
3519
+ }, "strip", z.ZodTypeAny, {
3520
+ progress: number;
3521
+ state: {
3522
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
3523
+ config: {
3524
+ maxIterations: number;
3525
+ maxFixAttempts: number;
3526
+ requireTestPass: boolean;
3527
+ breakpoints: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[];
3528
+ testCommand: string;
3529
+ testTimeout: number;
3530
+ phaseTimeout: number;
3531
+ autoCommit: boolean;
3532
+ commitMessageTemplate: string;
3533
+ agentId?: string | undefined;
3534
+ provider?: string | undefined;
3535
+ guardPolicy?: string | undefined;
3536
+ workingDirectory?: string | undefined;
3537
+ };
3538
+ task: string;
3539
+ updatedAt: string;
3540
+ startedAt: string;
3541
+ iterations: {
3542
+ durationMs: number;
3543
+ success: boolean;
3544
+ startedAt: string;
3545
+ iteration: number;
3546
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3547
+ changedFiles: string[];
3548
+ fixAttempts: number;
3549
+ error?: string | undefined;
3550
+ guardResult?: {
3551
+ blocked: boolean;
3552
+ policyId: string;
3553
+ checkedAt: string;
3554
+ passed: boolean;
3555
+ gateResults: {
3556
+ gateId: string;
3557
+ passed: boolean;
3558
+ message?: string | undefined;
3559
+ severity?: "info" | "error" | "warning" | undefined;
3560
+ violations?: {
3561
+ message: string;
3562
+ path?: string | undefined;
3563
+ rule?: string | undefined;
3564
+ }[] | undefined;
3565
+ }[];
3566
+ summary?: string | undefined;
3567
+ } | undefined;
3568
+ completedAt?: string | undefined;
3569
+ testResult?: {
3570
+ durationMs: number;
3571
+ passed: boolean;
3572
+ totalTests: number;
3573
+ passedTests: number;
3574
+ failedTests: number;
3575
+ skippedTests: number;
3576
+ errorOutput?: string | undefined;
3577
+ failedTestNames?: string[] | undefined;
3578
+ } | undefined;
3579
+ }[];
3580
+ iteration: number;
3581
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3582
+ changedFiles: string[];
3583
+ loopId: string;
3584
+ currentFixAttempts: number;
3585
+ sessionId?: string | undefined;
3586
+ error?: string | undefined;
3587
+ completedAt?: string | undefined;
3588
+ lastGuardResult?: {
3589
+ blocked: boolean;
3590
+ policyId: string;
3591
+ checkedAt: string;
3592
+ passed: boolean;
3593
+ gateResults: {
3594
+ gateId: string;
3595
+ passed: boolean;
3596
+ message?: string | undefined;
3597
+ severity?: "info" | "error" | "warning" | undefined;
3598
+ violations?: {
3599
+ message: string;
3600
+ path?: string | undefined;
3601
+ rule?: string | undefined;
3602
+ }[] | undefined;
3603
+ }[];
3604
+ summary?: string | undefined;
3605
+ } | undefined;
3606
+ lastTestResult?: {
3607
+ durationMs: number;
3608
+ passed: boolean;
3609
+ totalTests: number;
3610
+ passedTests: number;
3611
+ failedTests: number;
3612
+ skippedTests: number;
3613
+ errorOutput?: string | undefined;
3614
+ failedTestNames?: string[] | undefined;
3615
+ } | undefined;
3616
+ pauseReason?: string | undefined;
3617
+ };
3618
+ isActive: boolean;
3619
+ awaitingInput: boolean;
3620
+ estimatedRemaining?: number | undefined;
3621
+ }, {
3622
+ progress: number;
3623
+ state: {
3624
+ status: "blocked" | "completed" | "failed" | "running" | "cancelled" | "paused";
3625
+ config: {
3626
+ agentId?: string | undefined;
3627
+ provider?: string | undefined;
3628
+ maxIterations?: number | undefined;
3629
+ maxFixAttempts?: number | undefined;
3630
+ guardPolicy?: string | undefined;
3631
+ requireTestPass?: boolean | undefined;
3632
+ breakpoints?: ("write" | "complete" | "plan" | "test" | "fix" | "verify")[] | undefined;
3633
+ testCommand?: string | undefined;
3634
+ testTimeout?: number | undefined;
3635
+ phaseTimeout?: number | undefined;
3636
+ autoCommit?: boolean | undefined;
3637
+ commitMessageTemplate?: string | undefined;
3638
+ workingDirectory?: string | undefined;
3639
+ };
3640
+ task: string;
3641
+ updatedAt: string;
3642
+ startedAt: string;
3643
+ iteration: number;
3644
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3645
+ loopId: string;
3646
+ sessionId?: string | undefined;
3647
+ error?: string | undefined;
3648
+ completedAt?: string | undefined;
3649
+ iterations?: {
3650
+ durationMs: number;
3651
+ success: boolean;
3652
+ startedAt: string;
3653
+ iteration: number;
3654
+ phase: "write" | "complete" | "plan" | "test" | "fix" | "verify";
3655
+ error?: string | undefined;
3656
+ guardResult?: {
3657
+ blocked: boolean;
3658
+ policyId: string;
3659
+ checkedAt: string;
3660
+ passed: boolean;
3661
+ gateResults: {
3662
+ gateId: string;
3663
+ passed: boolean;
3664
+ message?: string | undefined;
3665
+ severity?: "info" | "error" | "warning" | undefined;
3666
+ violations?: {
3667
+ message: string;
3668
+ path?: string | undefined;
3669
+ rule?: string | undefined;
3670
+ }[] | undefined;
3671
+ }[];
3672
+ summary?: string | undefined;
3673
+ } | undefined;
3674
+ completedAt?: string | undefined;
3675
+ changedFiles?: string[] | undefined;
3676
+ testResult?: {
3677
+ durationMs: number;
3678
+ passed: boolean;
3679
+ totalTests: number;
3680
+ passedTests: number;
3681
+ failedTests: number;
3682
+ skippedTests?: number | undefined;
3683
+ errorOutput?: string | undefined;
3684
+ failedTestNames?: string[] | undefined;
3685
+ } | undefined;
3686
+ fixAttempts?: number | undefined;
3687
+ }[] | undefined;
3688
+ changedFiles?: string[] | undefined;
3689
+ lastGuardResult?: {
3690
+ blocked: boolean;
3691
+ policyId: string;
3692
+ checkedAt: string;
3693
+ passed: boolean;
3694
+ gateResults: {
3695
+ gateId: string;
3696
+ passed: boolean;
3697
+ message?: string | undefined;
3698
+ severity?: "info" | "error" | "warning" | undefined;
3699
+ violations?: {
3700
+ message: string;
3701
+ path?: string | undefined;
3702
+ rule?: string | undefined;
3703
+ }[] | undefined;
3704
+ }[];
3705
+ summary?: string | undefined;
3706
+ } | undefined;
3707
+ lastTestResult?: {
3708
+ durationMs: number;
3709
+ passed: boolean;
3710
+ totalTests: number;
3711
+ passedTests: number;
3712
+ failedTests: number;
3713
+ skippedTests?: number | undefined;
3714
+ errorOutput?: string | undefined;
3715
+ failedTestNames?: string[] | undefined;
3716
+ } | undefined;
3717
+ currentFixAttempts?: number | undefined;
3718
+ pauseReason?: string | undefined;
3719
+ };
3720
+ isActive: boolean;
3721
+ awaitingInput: boolean;
3722
+ estimatedRemaining?: number | undefined;
3723
+ }>;
3724
+ export type LoopStatusResponse = z.infer<typeof LoopStatusResponseSchema>;
3725
+ export declare const AutonomousLoopErrorCodes: {
3726
+ /** Loop not found */
3727
+ readonly LOOP_NOT_FOUND: "ALO_LOOP_NOT_FOUND";
3728
+ /** Loop already running */
3729
+ readonly LOOP_ALREADY_RUNNING: "ALO_LOOP_ALREADY_RUNNING";
3730
+ /** Loop not paused */
3731
+ readonly LOOP_NOT_PAUSED: "ALO_LOOP_NOT_PAUSED";
3732
+ /** Max iterations exceeded */
3733
+ readonly MAX_ITERATIONS_EXCEEDED: "ALO_MAX_ITERATIONS_EXCEEDED";
3734
+ /** Max fix attempts exceeded */
3735
+ readonly MAX_FIX_ATTEMPTS_EXCEEDED: "ALO_MAX_FIX_ATTEMPTS_EXCEEDED";
3736
+ /** Guard gate blocked */
3737
+ readonly GUARD_BLOCKED: "ALO_GUARD_BLOCKED";
3738
+ /** Test execution failed */
3739
+ readonly TEST_FAILED: "ALO_TEST_FAILED";
3740
+ /** Phase timeout */
3741
+ readonly PHASE_TIMEOUT: "ALO_PHASE_TIMEOUT";
3742
+ /** Invalid phase transition */
3743
+ readonly INVALID_TRANSITION: "ALO_INVALID_TRANSITION";
3744
+ /** Cancelled by user */
3745
+ readonly CANCELLED: "ALO_CANCELLED";
3746
+ /** Agent execution failed */
3747
+ readonly AGENT_FAILED: "ALO_AGENT_FAILED";
3748
+ };
3749
+ export type AutonomousLoopErrorCode = (typeof AutonomousLoopErrorCodes)[keyof typeof AutonomousLoopErrorCodes];
3750
+ /**
3751
+ * Validates autonomous loop configuration
3752
+ */
3753
+ export declare function validateAutonomousLoopConfig(data: unknown): AutonomousLoopConfig;
3754
+ /**
3755
+ * Safely validates autonomous loop configuration
3756
+ */
3757
+ export declare function safeValidateAutonomousLoopConfig(data: unknown): {
3758
+ success: true;
3759
+ data: AutonomousLoopConfig;
3760
+ } | {
3761
+ success: false;
3762
+ error: z.ZodError;
3763
+ };
3764
+ /**
3765
+ * Validates autonomous loop state
3766
+ */
3767
+ export declare function validateAutonomousLoopState(data: unknown): AutonomousLoopState;
3768
+ /**
3769
+ * Validates start loop request
3770
+ */
3771
+ export declare function validateStartLoopRequest(data: unknown): StartLoopRequest;
3772
+ /**
3773
+ * Creates default autonomous loop configuration
3774
+ */
3775
+ export declare function createDefaultAutonomousLoopConfig(): AutonomousLoopConfig;
3776
+ /**
3777
+ * Creates initial loop state
3778
+ */
3779
+ export declare function createInitialLoopState(task: string, config?: Partial<AutonomousLoopConfig>): AutonomousLoopState;
3780
+ /**
3781
+ * Creates a loop iteration record
3782
+ */
3783
+ export declare function createLoopIteration(iteration: number, phase: AutonomousLoopPhase, success: boolean, options?: Partial<Omit<LoopIteration, 'iteration' | 'phase' | 'success'>>): LoopIteration;
3784
+ /**
3785
+ * Valid phase transitions
3786
+ */
3787
+ export declare const PHASE_TRANSITIONS: Record<AutonomousLoopPhase, AutonomousLoopPhase[]>;
3788
+ /**
3789
+ * Checks if a phase transition is valid
3790
+ */
3791
+ export declare function isValidPhaseTransition(from: AutonomousLoopPhase, to: AutonomousLoopPhase): boolean;
3792
+ /**
3793
+ * Gets valid next phases from current phase
3794
+ */
3795
+ export declare function getValidNextPhases(phase: AutonomousLoopPhase): AutonomousLoopPhase[];
3796
+ //# sourceMappingURL=schema.d.ts.map