ferix-code 0.0.2-beta.9 → 0.0.2

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 (3) hide show
  1. package/dist/index.d.ts +1 -2678
  2. package/dist/index.js +2983 -1214
  3. package/package.json +7 -2
package/dist/index.d.ts CHANGED
@@ -1,2679 +1,2 @@
1
- import { Schema, Brand, Stream, Effect, Context, Layer } from 'effect';
2
- import * as effect_Cause from 'effect/Cause';
3
- import * as effect_Types from 'effect/Types';
4
- import * as effect_Effect from 'effect/Effect';
5
- import * as effect_ParseResult from 'effect/ParseResult';
6
- import * as effect_SchemaAST from 'effect/SchemaAST';
7
1
 
8
- declare const LLMError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
9
- readonly _tag: "LLMError";
10
- } & Readonly<A>;
11
- /**
12
- * Error that occurs during LLM execution.
13
- */
14
- declare class LLMError extends LLMError_base<{
15
- readonly message: string;
16
- readonly cause?: unknown;
17
- }> {
18
- }
19
- declare const ParseError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
20
- readonly _tag: "ParseError";
21
- } & Readonly<A>;
22
- /**
23
- * Error that occurs when parsing signals from LLM output.
24
- */
25
- declare class ParseError extends ParseError_base<{
26
- readonly message: string;
27
- readonly input?: string;
28
- }> {
29
- }
30
- declare const PlanStoreError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
31
- readonly _tag: "PlanStoreError";
32
- } & Readonly<A>;
33
- /**
34
- * Error that occurs during plan storage operations.
35
- */
36
- declare class PlanStoreError extends PlanStoreError_base<{
37
- readonly message: string;
38
- readonly operation: "create" | "load" | "update" | "list";
39
- readonly cause?: unknown;
40
- }> {
41
- }
42
- declare const SessionStoreError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
43
- readonly _tag: "SessionStoreError";
44
- } & Readonly<A>;
45
- /**
46
- * Error that occurs during session storage operations.
47
- */
48
- declare class SessionStoreError extends SessionStoreError_base<{
49
- readonly message: string;
50
- readonly operation: "create" | "get" | "update";
51
- readonly cause?: unknown;
52
- }> {
53
- }
54
- declare const ProgressStoreError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
55
- readonly _tag: "ProgressStoreError";
56
- } & Readonly<A>;
57
- /**
58
- * Error that occurs during progress storage operations.
59
- */
60
- declare class ProgressStoreError extends ProgressStoreError_base<{
61
- readonly message: string;
62
- readonly operation: "append" | "load" | "getRecent";
63
- readonly cause?: unknown;
64
- }> {
65
- }
66
- declare const GuardrailsStoreError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
67
- readonly _tag: "GuardrailsStoreError";
68
- } & Readonly<A>;
69
- /**
70
- * Error that occurs during guardrails storage operations.
71
- */
72
- declare class GuardrailsStoreError extends GuardrailsStoreError_base<{
73
- readonly message: string;
74
- readonly operation: "add" | "load" | "getActive";
75
- readonly cause?: unknown;
76
- }> {
77
- }
78
- declare const OrchestratorError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
79
- readonly _tag: "OrchestratorError";
80
- } & Readonly<A>;
81
- /**
82
- * Error that occurs during orchestrator execution.
83
- */
84
- declare class OrchestratorError extends OrchestratorError_base<{
85
- readonly message: string;
86
- readonly phase: "setup" | "discovery" | "iteration" | "cleanup";
87
- readonly cause?: unknown;
88
- }> {
89
- }
90
- declare const GitError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
91
- readonly _tag: "GitError";
92
- } & Readonly<A>;
93
- /**
94
- * Error that occurs during git operations.
95
- */
96
- declare class GitError extends GitError_base<{
97
- readonly message: string;
98
- readonly operation: "createWorktree" | "removeWorktree" | "commit" | "push" | "createPR" | "status";
99
- readonly cause?: unknown;
100
- }> {
101
- }
102
- /**
103
- * Union of all possible errors in the system.
104
- */
105
- type FerixError = LLMError | ParseError | PlanStoreError | SessionStoreError | ProgressStoreError | GuardrailsStoreError | OrchestratorError | GitError;
106
-
107
- declare const PhasePromptOverridesSchema: Schema.Struct<{
108
- breakdown: Schema.optional<typeof Schema.String>;
109
- planning: Schema.optional<typeof Schema.String>;
110
- execution: Schema.optional<typeof Schema.String>;
111
- check: Schema.optional<typeof Schema.String>;
112
- verify: Schema.optional<typeof Schema.String>;
113
- review: Schema.optional<typeof Schema.String>;
114
- completion: Schema.optional<typeof Schema.String>;
115
- }>;
116
- type PhasePromptOverrides = typeof PhasePromptOverridesSchema.Type;
117
- declare const PromptConfigSchema: Schema.Struct<{
118
- systemPrompt: Schema.optional<typeof Schema.String>;
119
- phases: Schema.optional<Schema.Struct<{
120
- breakdown: Schema.optional<typeof Schema.String>;
121
- planning: Schema.optional<typeof Schema.String>;
122
- execution: Schema.optional<typeof Schema.String>;
123
- check: Schema.optional<typeof Schema.String>;
124
- verify: Schema.optional<typeof Schema.String>;
125
- review: Schema.optional<typeof Schema.String>;
126
- completion: Schema.optional<typeof Schema.String>;
127
- }>>;
128
- additionalContext: Schema.optional<typeof Schema.String>;
129
- }>;
130
- type PromptConfig = typeof PromptConfigSchema.Type;
131
- declare const LoopConfigSchema: Schema.Struct<{
132
- task: typeof Schema.String;
133
- maxIterations: typeof Schema.Number;
134
- verifyCommands: Schema.Array$<typeof Schema.String>;
135
- sessionId: Schema.optional<typeof Schema.String>;
136
- branch: Schema.optional<typeof Schema.String>;
137
- push: Schema.optional<typeof Schema.Boolean>;
138
- pr: Schema.optional<typeof Schema.Boolean>;
139
- verbose: Schema.optional<typeof Schema.Boolean>;
140
- prompts: Schema.optional<Schema.Struct<{
141
- systemPrompt: Schema.optional<typeof Schema.String>;
142
- phases: Schema.optional<Schema.Struct<{
143
- breakdown: Schema.optional<typeof Schema.String>;
144
- planning: Schema.optional<typeof Schema.String>;
145
- execution: Schema.optional<typeof Schema.String>;
146
- check: Schema.optional<typeof Schema.String>;
147
- verify: Schema.optional<typeof Schema.String>;
148
- review: Schema.optional<typeof Schema.String>;
149
- completion: Schema.optional<typeof Schema.String>;
150
- }>>;
151
- additionalContext: Schema.optional<typeof Schema.String>;
152
- }>>;
153
- }>;
154
- type LoopConfig = typeof LoopConfigSchema.Type;
155
- declare const LoopSummarySchema: Schema.Struct<{
156
- iterations: typeof Schema.Number;
157
- success: typeof Schema.Boolean;
158
- sessionId: typeof Schema.String;
159
- completedTasks: Schema.Array$<typeof Schema.String>;
160
- durationMs: typeof Schema.Number;
161
- }>;
162
- type LoopSummary = typeof LoopSummarySchema.Type;
163
- declare const LoopErrorSchema: Schema.Struct<{
164
- message: typeof Schema.String;
165
- phase: typeof Schema.String;
166
- iteration: Schema.optional<typeof Schema.Number>;
167
- }>;
168
- type LoopError = typeof LoopErrorSchema.Type;
169
- declare const decodeLoopConfig: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
170
- readonly task: string;
171
- readonly maxIterations: number;
172
- readonly verifyCommands: readonly string[];
173
- readonly push?: boolean | undefined;
174
- readonly sessionId?: string | undefined;
175
- readonly branch?: string | undefined;
176
- readonly pr?: boolean | undefined;
177
- readonly verbose?: boolean | undefined;
178
- readonly prompts?: {
179
- readonly systemPrompt?: string | undefined;
180
- readonly phases?: {
181
- readonly breakdown?: string | undefined;
182
- readonly planning?: string | undefined;
183
- readonly execution?: string | undefined;
184
- readonly check?: string | undefined;
185
- readonly verify?: string | undefined;
186
- readonly review?: string | undefined;
187
- readonly completion?: string | undefined;
188
- } | undefined;
189
- readonly additionalContext?: string | undefined;
190
- } | undefined;
191
- }, effect_ParseResult.ParseError, never>;
192
-
193
- /**
194
- * Loop lifecycle events.
195
- */
196
- declare const LoopStartedEventSchema: Schema.TaggedStruct<"LoopStarted", {
197
- config: Schema.Struct<{
198
- task: typeof Schema.String;
199
- maxIterations: typeof Schema.Number;
200
- verifyCommands: Schema.Array$<typeof Schema.String>;
201
- sessionId: Schema.optional<typeof Schema.String>;
202
- branch: Schema.optional<typeof Schema.String>;
203
- push: Schema.optional<typeof Schema.Boolean>;
204
- pr: Schema.optional<typeof Schema.Boolean>;
205
- verbose: Schema.optional<typeof Schema.Boolean>;
206
- prompts: Schema.optional<Schema.Struct<{
207
- systemPrompt: Schema.optional<typeof Schema.String>;
208
- phases: Schema.optional<Schema.Struct<{
209
- breakdown: Schema.optional<typeof Schema.String>;
210
- planning: Schema.optional<typeof Schema.String>;
211
- execution: Schema.optional<typeof Schema.String>;
212
- check: Schema.optional<typeof Schema.String>;
213
- verify: Schema.optional<typeof Schema.String>;
214
- review: Schema.optional<typeof Schema.String>;
215
- completion: Schema.optional<typeof Schema.String>;
216
- }>>;
217
- additionalContext: Schema.optional<typeof Schema.String>;
218
- }>>;
219
- }>;
220
- timestamp: typeof Schema.Number;
221
- }>;
222
- type LoopStartedEvent = typeof LoopStartedEventSchema.Type;
223
- declare const LoopCompletedEventSchema: Schema.TaggedStruct<"LoopCompleted", {
224
- summary: Schema.Struct<{
225
- iterations: typeof Schema.Number;
226
- success: typeof Schema.Boolean;
227
- sessionId: typeof Schema.String;
228
- completedTasks: Schema.Array$<typeof Schema.String>;
229
- durationMs: typeof Schema.Number;
230
- }>;
231
- }>;
232
- type LoopCompletedEvent = typeof LoopCompletedEventSchema.Type;
233
- declare const LoopFailedEventSchema: Schema.TaggedStruct<"LoopFailed", {
234
- error: Schema.Struct<{
235
- message: typeof Schema.String;
236
- phase: typeof Schema.String;
237
- iteration: Schema.optional<typeof Schema.Number>;
238
- }>;
239
- }>;
240
- type LoopFailedEvent = typeof LoopFailedEventSchema.Type;
241
- /**
242
- * Discovery phase events.
243
- */
244
- declare const DiscoveryStartedEventSchema: Schema.TaggedStruct<"DiscoveryStarted", {
245
- timestamp: typeof Schema.Number;
246
- }>;
247
- type DiscoveryStartedEvent = typeof DiscoveryStartedEventSchema.Type;
248
- declare const DiscoveryCompletedEventSchema: Schema.TaggedStruct<"DiscoveryCompleted", {
249
- taskCount: typeof Schema.Number;
250
- timestamp: typeof Schema.Number;
251
- }>;
252
- type DiscoveryCompletedEvent = typeof DiscoveryCompletedEventSchema.Type;
253
- /**
254
- * Iteration events.
255
- */
256
- declare const IterationStartedEventSchema: Schema.TaggedStruct<"IterationStarted", {
257
- iteration: typeof Schema.Number;
258
- }>;
259
- type IterationStartedEvent = typeof IterationStartedEventSchema.Type;
260
- declare const IterationCompletedEventSchema: Schema.TaggedStruct<"IterationCompleted", {
261
- iteration: typeof Schema.Number;
262
- }>;
263
- type IterationCompletedEvent = typeof IterationCompletedEventSchema.Type;
264
- /**
265
- * LLM events.
266
- */
267
- declare const LLMTextEventSchema: Schema.TaggedStruct<"LLMText", {
268
- text: typeof Schema.String;
269
- }>;
270
- type LLMTextEvent = typeof LLMTextEventSchema.Type;
271
- declare const LLMToolStartEventSchema: Schema.TaggedStruct<"LLMToolStart", {
272
- tool: typeof Schema.String;
273
- }>;
274
- type LLMToolStartEvent = typeof LLMToolStartEventSchema.Type;
275
- declare const LLMToolUseEventSchema: Schema.TaggedStruct<"LLMToolUse", {
276
- tool: typeof Schema.String;
277
- input: typeof Schema.Unknown;
278
- }>;
279
- type LLMToolUseEvent = typeof LLMToolUseEventSchema.Type;
280
- declare const LLMToolEndEventSchema: Schema.TaggedStruct<"LLMToolEnd", {
281
- tool: typeof Schema.String;
282
- }>;
283
- type LLMToolEndEvent = typeof LLMToolEndEventSchema.Type;
284
- /**
285
- * Task/Phase/Criteria definition events.
286
- */
287
- declare const TasksDefinedEventSchema: Schema.TaggedStruct<"TasksDefined", Readonly<{
288
- tasks: Schema.Array$<Schema.Struct<{
289
- id: typeof Schema.String;
290
- title: typeof Schema.String;
291
- description: typeof Schema.String;
292
- }>>;
293
- }> & Schema.Struct.Fields>;
294
- type TasksDefinedEvent = typeof TasksDefinedEventSchema.Type;
295
- declare const PhasesDefinedEventSchema: Schema.TaggedStruct<"PhasesDefined", Readonly<{
296
- taskId: typeof Schema.String;
297
- phases: Schema.Array$<Schema.Struct<{
298
- id: typeof Schema.String;
299
- description: typeof Schema.String;
300
- }>>;
301
- }> & Schema.Struct.Fields>;
302
- type PhasesDefinedEvent = typeof PhasesDefinedEventSchema.Type;
303
- declare const CriteriaDefinedEventSchema: Schema.TaggedStruct<"CriteriaDefined", Readonly<{
304
- taskId: typeof Schema.String;
305
- criteria: Schema.Array$<Schema.Struct<{
306
- id: typeof Schema.String;
307
- description: typeof Schema.String;
308
- }>>;
309
- }> & Schema.Struct.Fields>;
310
- type CriteriaDefinedEvent = typeof CriteriaDefinedEventSchema.Type;
311
- /**
312
- * Phase lifecycle events.
313
- */
314
- declare const PhaseStartedEventSchema: Schema.TaggedStruct<"PhaseStarted", Readonly<{
315
- phaseId: typeof Schema.String;
316
- }> & Schema.Struct.Fields>;
317
- type PhaseStartedEvent = typeof PhaseStartedEventSchema.Type;
318
- declare const PhaseCompletedEventSchema: Schema.TaggedStruct<"PhaseCompleted", Readonly<{
319
- phaseId: typeof Schema.String;
320
- }> & Schema.Struct.Fields>;
321
- type PhaseCompletedEvent = typeof PhaseCompletedEventSchema.Type;
322
- declare const PhaseFailedEventSchema: Schema.TaggedStruct<"PhaseFailed", Readonly<{
323
- phaseId: typeof Schema.String;
324
- reason: typeof Schema.String;
325
- }> & Schema.Struct.Fields>;
326
- type PhaseFailedEvent = typeof PhaseFailedEventSchema.Type;
327
- /**
328
- * Criterion events.
329
- */
330
- declare const CriterionPassedEventSchema: Schema.TaggedStruct<"CriterionPassed", Readonly<{
331
- criterionId: typeof Schema.String;
332
- }> & Schema.Struct.Fields>;
333
- type CriterionPassedEvent = typeof CriterionPassedEventSchema.Type;
334
- declare const CriterionFailedEventSchema: Schema.TaggedStruct<"CriterionFailed", Readonly<{
335
- criterionId: typeof Schema.String;
336
- reason: typeof Schema.String;
337
- }> & Schema.Struct.Fields>;
338
- type CriterionFailedEvent = typeof CriterionFailedEventSchema.Type;
339
- /**
340
- * Check events.
341
- */
342
- declare const CheckPassedEventSchema: Schema.TaggedStruct<"CheckPassed", {}>;
343
- type CheckPassedEvent = typeof CheckPassedEventSchema.Type;
344
- declare const CheckFailedEventSchema: Schema.TaggedStruct<"CheckFailed", {
345
- failedCriteria: Schema.Array$<typeof Schema.String>;
346
- }>;
347
- type CheckFailedEvent = typeof CheckFailedEventSchema.Type;
348
- /**
349
- * Review event.
350
- */
351
- declare const ReviewCompleteEventSchema: Schema.TaggedStruct<"ReviewComplete", Readonly<{
352
- changesMade: typeof Schema.Boolean;
353
- }> & Schema.Struct.Fields>;
354
- type ReviewCompleteEvent = typeof ReviewCompleteEventSchema.Type;
355
- /**
356
- * Task completion event.
357
- */
358
- declare const TaskCompletedEventSchema: Schema.TaggedStruct<"TaskCompleted", Readonly<{
359
- taskId: typeof Schema.String;
360
- summary: typeof Schema.String;
361
- }> & Schema.Struct.Fields>;
362
- type TaskCompletedEvent = typeof TaskCompletedEventSchema.Type;
363
- /**
364
- * Plan events.
365
- */
366
- declare const PlanCreatedEventSchema: Schema.TaggedStruct<"PlanCreated", {
367
- plan: Schema.Struct<{
368
- id: typeof Schema.String;
369
- sessionId: typeof Schema.String;
370
- createdAt: typeof Schema.String;
371
- originalTask: typeof Schema.String;
372
- context: Schema.optional<typeof Schema.String>;
373
- tasks: Schema.Array$<Schema.Struct<{
374
- id: typeof Schema.String;
375
- title: typeof Schema.String;
376
- description: typeof Schema.String;
377
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
378
- phases: Schema.Array$<Schema.Struct<{
379
- id: typeof Schema.String;
380
- description: typeof Schema.String;
381
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
382
- }>>;
383
- criteria: Schema.Array$<Schema.Struct<{
384
- id: typeof Schema.String;
385
- description: typeof Schema.String;
386
- status: Schema.Literal<["pending", "passed", "failed"]>;
387
- failureReason: Schema.optional<typeof Schema.String>;
388
- }>>;
389
- filesToModify: Schema.Array$<typeof Schema.String>;
390
- attempts: typeof Schema.Number;
391
- completionNotes: Schema.optional<typeof Schema.String>;
392
- }>>;
393
- }>;
394
- }>;
395
- type PlanCreatedEvent = typeof PlanCreatedEventSchema.Type;
396
- declare const PlanUpdatedEventSchema: Schema.TaggedStruct<"PlanUpdated", {
397
- plan: Schema.Struct<{
398
- id: typeof Schema.String;
399
- sessionId: typeof Schema.String;
400
- createdAt: typeof Schema.String;
401
- originalTask: typeof Schema.String;
402
- context: Schema.optional<typeof Schema.String>;
403
- tasks: Schema.Array$<Schema.Struct<{
404
- id: typeof Schema.String;
405
- title: typeof Schema.String;
406
- description: typeof Schema.String;
407
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
408
- phases: Schema.Array$<Schema.Struct<{
409
- id: typeof Schema.String;
410
- description: typeof Schema.String;
411
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
412
- }>>;
413
- criteria: Schema.Array$<Schema.Struct<{
414
- id: typeof Schema.String;
415
- description: typeof Schema.String;
416
- status: Schema.Literal<["pending", "passed", "failed"]>;
417
- failureReason: Schema.optional<typeof Schema.String>;
418
- }>>;
419
- filesToModify: Schema.Array$<typeof Schema.String>;
420
- attempts: typeof Schema.Number;
421
- completionNotes: Schema.optional<typeof Schema.String>;
422
- }>>;
423
- }>;
424
- }>;
425
- type PlanUpdatedEvent = typeof PlanUpdatedEventSchema.Type;
426
- declare const PlanUpdateFailedEventSchema: Schema.TaggedStruct<"PlanUpdateFailed", {
427
- operation: Schema.Literal<["create", "update"]>;
428
- error: typeof Schema.String;
429
- planId: Schema.optional<typeof Schema.String>;
430
- }>;
431
- type PlanUpdateFailedEvent = typeof PlanUpdateFailedEventSchema.Type;
432
- /**
433
- * Learning recorded event - captures insights discovered during iteration.
434
- */
435
- declare const LearningRecordedEventSchema: Schema.TaggedStruct<"LearningRecorded", {
436
- iteration: typeof Schema.Number;
437
- content: typeof Schema.String;
438
- category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
439
- timestamp: typeof Schema.Number;
440
- }>;
441
- type LearningRecordedEvent = typeof LearningRecordedEventSchema.Type;
442
- /**
443
- * Guardrail added event - captures failure patterns to avoid.
444
- */
445
- declare const GuardrailAddedEventSchema: Schema.TaggedStruct<"GuardrailAdded", {
446
- id: typeof Schema.String;
447
- iteration: typeof Schema.Number;
448
- pattern: typeof Schema.String;
449
- sign: typeof Schema.String;
450
- avoidance: typeof Schema.String;
451
- severity: Schema.Literal<["warning", "critical"]>;
452
- timestamp: typeof Schema.Number;
453
- }>;
454
- type GuardrailAddedEvent = typeof GuardrailAddedEventSchema.Type;
455
- /**
456
- * Progress updated event - signals that progress file was updated.
457
- */
458
- declare const ProgressUpdatedEventSchema: Schema.TaggedStruct<"ProgressUpdated", {
459
- sessionId: typeof Schema.String;
460
- iteration: typeof Schema.Number;
461
- taskId: typeof Schema.String;
462
- action: Schema.Literal<["started", "completed", "failed", "learning"]>;
463
- timestamp: typeof Schema.Number;
464
- }>;
465
- type ProgressUpdatedEvent = typeof ProgressUpdatedEventSchema.Type;
466
- /**
467
- * Worktree created event - signals that a git worktree was created for the session.
468
- */
469
- declare const WorktreeCreatedEventSchema: Schema.TaggedStruct<"WorktreeCreated", {
470
- sessionId: typeof Schema.String;
471
- worktreePath: typeof Schema.String;
472
- branchName: typeof Schema.String;
473
- timestamp: typeof Schema.Number;
474
- }>;
475
- type WorktreeCreatedEvent = typeof WorktreeCreatedEventSchema.Type;
476
- /**
477
- * Worktree removed event - signals that a git worktree was cleaned up.
478
- */
479
- declare const WorktreeRemovedEventSchema: Schema.TaggedStruct<"WorktreeRemoved", {
480
- sessionId: typeof Schema.String;
481
- timestamp: typeof Schema.Number;
482
- }>;
483
- type WorktreeRemovedEvent = typeof WorktreeRemovedEventSchema.Type;
484
- /**
485
- * Union of all domain events.
486
- */
487
- declare const DomainEventSchema: Schema.Union<[Schema.TaggedStruct<"LoopStarted", {
488
- config: Schema.Struct<{
489
- task: typeof Schema.String;
490
- maxIterations: typeof Schema.Number;
491
- verifyCommands: Schema.Array$<typeof Schema.String>;
492
- sessionId: Schema.optional<typeof Schema.String>;
493
- branch: Schema.optional<typeof Schema.String>;
494
- push: Schema.optional<typeof Schema.Boolean>;
495
- pr: Schema.optional<typeof Schema.Boolean>;
496
- verbose: Schema.optional<typeof Schema.Boolean>;
497
- prompts: Schema.optional<Schema.Struct<{
498
- systemPrompt: Schema.optional<typeof Schema.String>;
499
- phases: Schema.optional<Schema.Struct<{
500
- breakdown: Schema.optional<typeof Schema.String>;
501
- planning: Schema.optional<typeof Schema.String>;
502
- execution: Schema.optional<typeof Schema.String>;
503
- check: Schema.optional<typeof Schema.String>;
504
- verify: Schema.optional<typeof Schema.String>;
505
- review: Schema.optional<typeof Schema.String>;
506
- completion: Schema.optional<typeof Schema.String>;
507
- }>>;
508
- additionalContext: Schema.optional<typeof Schema.String>;
509
- }>>;
510
- }>;
511
- timestamp: typeof Schema.Number;
512
- }>, Schema.TaggedStruct<"LoopCompleted", {
513
- summary: Schema.Struct<{
514
- iterations: typeof Schema.Number;
515
- success: typeof Schema.Boolean;
516
- sessionId: typeof Schema.String;
517
- completedTasks: Schema.Array$<typeof Schema.String>;
518
- durationMs: typeof Schema.Number;
519
- }>;
520
- }>, Schema.TaggedStruct<"LoopFailed", {
521
- error: Schema.Struct<{
522
- message: typeof Schema.String;
523
- phase: typeof Schema.String;
524
- iteration: Schema.optional<typeof Schema.Number>;
525
- }>;
526
- }>, Schema.TaggedStruct<"DiscoveryStarted", {
527
- timestamp: typeof Schema.Number;
528
- }>, Schema.TaggedStruct<"DiscoveryCompleted", {
529
- taskCount: typeof Schema.Number;
530
- timestamp: typeof Schema.Number;
531
- }>, Schema.TaggedStruct<"IterationStarted", {
532
- iteration: typeof Schema.Number;
533
- }>, Schema.TaggedStruct<"IterationCompleted", {
534
- iteration: typeof Schema.Number;
535
- }>, Schema.TaggedStruct<"LLMText", {
536
- text: typeof Schema.String;
537
- }>, Schema.TaggedStruct<"LLMToolStart", {
538
- tool: typeof Schema.String;
539
- }>, Schema.TaggedStruct<"LLMToolUse", {
540
- tool: typeof Schema.String;
541
- input: typeof Schema.Unknown;
542
- }>, Schema.TaggedStruct<"LLMToolEnd", {
543
- tool: typeof Schema.String;
544
- }>, Schema.TaggedStruct<"TasksDefined", Readonly<{
545
- tasks: Schema.Array$<Schema.Struct<{
546
- id: typeof Schema.String;
547
- title: typeof Schema.String;
548
- description: typeof Schema.String;
549
- }>>;
550
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"PhasesDefined", Readonly<{
551
- taskId: typeof Schema.String;
552
- phases: Schema.Array$<Schema.Struct<{
553
- id: typeof Schema.String;
554
- description: typeof Schema.String;
555
- }>>;
556
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"CriteriaDefined", Readonly<{
557
- taskId: typeof Schema.String;
558
- criteria: Schema.Array$<Schema.Struct<{
559
- id: typeof Schema.String;
560
- description: typeof Schema.String;
561
- }>>;
562
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"PhaseStarted", Readonly<{
563
- phaseId: typeof Schema.String;
564
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"PhaseCompleted", Readonly<{
565
- phaseId: typeof Schema.String;
566
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"PhaseFailed", Readonly<{
567
- phaseId: typeof Schema.String;
568
- reason: typeof Schema.String;
569
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"CriterionPassed", Readonly<{
570
- criterionId: typeof Schema.String;
571
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"CriterionFailed", Readonly<{
572
- criterionId: typeof Schema.String;
573
- reason: typeof Schema.String;
574
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"CheckPassed", {}>, Schema.TaggedStruct<"CheckFailed", {
575
- failedCriteria: Schema.Array$<typeof Schema.String>;
576
- }>, Schema.TaggedStruct<"ReviewComplete", Readonly<{
577
- changesMade: typeof Schema.Boolean;
578
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"TaskCompleted", Readonly<{
579
- taskId: typeof Schema.String;
580
- summary: typeof Schema.String;
581
- }> & Schema.Struct.Fields>, Schema.TaggedStruct<"PlanCreated", {
582
- plan: Schema.Struct<{
583
- id: typeof Schema.String;
584
- sessionId: typeof Schema.String;
585
- createdAt: typeof Schema.String;
586
- originalTask: typeof Schema.String;
587
- context: Schema.optional<typeof Schema.String>;
588
- tasks: Schema.Array$<Schema.Struct<{
589
- id: typeof Schema.String;
590
- title: typeof Schema.String;
591
- description: typeof Schema.String;
592
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
593
- phases: Schema.Array$<Schema.Struct<{
594
- id: typeof Schema.String;
595
- description: typeof Schema.String;
596
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
597
- }>>;
598
- criteria: Schema.Array$<Schema.Struct<{
599
- id: typeof Schema.String;
600
- description: typeof Schema.String;
601
- status: Schema.Literal<["pending", "passed", "failed"]>;
602
- failureReason: Schema.optional<typeof Schema.String>;
603
- }>>;
604
- filesToModify: Schema.Array$<typeof Schema.String>;
605
- attempts: typeof Schema.Number;
606
- completionNotes: Schema.optional<typeof Schema.String>;
607
- }>>;
608
- }>;
609
- }>, Schema.TaggedStruct<"PlanUpdated", {
610
- plan: Schema.Struct<{
611
- id: typeof Schema.String;
612
- sessionId: typeof Schema.String;
613
- createdAt: typeof Schema.String;
614
- originalTask: typeof Schema.String;
615
- context: Schema.optional<typeof Schema.String>;
616
- tasks: Schema.Array$<Schema.Struct<{
617
- id: typeof Schema.String;
618
- title: typeof Schema.String;
619
- description: typeof Schema.String;
620
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
621
- phases: Schema.Array$<Schema.Struct<{
622
- id: typeof Schema.String;
623
- description: typeof Schema.String;
624
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
625
- }>>;
626
- criteria: Schema.Array$<Schema.Struct<{
627
- id: typeof Schema.String;
628
- description: typeof Schema.String;
629
- status: Schema.Literal<["pending", "passed", "failed"]>;
630
- failureReason: Schema.optional<typeof Schema.String>;
631
- }>>;
632
- filesToModify: Schema.Array$<typeof Schema.String>;
633
- attempts: typeof Schema.Number;
634
- completionNotes: Schema.optional<typeof Schema.String>;
635
- }>>;
636
- }>;
637
- }>, Schema.TaggedStruct<"PlanUpdateFailed", {
638
- operation: Schema.Literal<["create", "update"]>;
639
- error: typeof Schema.String;
640
- planId: Schema.optional<typeof Schema.String>;
641
- }>, Schema.TaggedStruct<"LearningRecorded", {
642
- iteration: typeof Schema.Number;
643
- content: typeof Schema.String;
644
- category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
645
- timestamp: typeof Schema.Number;
646
- }>, Schema.TaggedStruct<"GuardrailAdded", {
647
- id: typeof Schema.String;
648
- iteration: typeof Schema.Number;
649
- pattern: typeof Schema.String;
650
- sign: typeof Schema.String;
651
- avoidance: typeof Schema.String;
652
- severity: Schema.Literal<["warning", "critical"]>;
653
- timestamp: typeof Schema.Number;
654
- }>, Schema.TaggedStruct<"ProgressUpdated", {
655
- sessionId: typeof Schema.String;
656
- iteration: typeof Schema.Number;
657
- taskId: typeof Schema.String;
658
- action: Schema.Literal<["started", "completed", "failed", "learning"]>;
659
- timestamp: typeof Schema.Number;
660
- }>, Schema.TaggedStruct<"WorktreeCreated", {
661
- sessionId: typeof Schema.String;
662
- worktreePath: typeof Schema.String;
663
- branchName: typeof Schema.String;
664
- timestamp: typeof Schema.Number;
665
- }>, Schema.TaggedStruct<"WorktreeRemoved", {
666
- sessionId: typeof Schema.String;
667
- timestamp: typeof Schema.Number;
668
- }>]>;
669
- /**
670
- * Explicit discriminated union type for proper TypeScript narrowing.
671
- */
672
- type DomainEvent = LoopStartedEvent | LoopCompletedEvent | LoopFailedEvent | DiscoveryStartedEvent | DiscoveryCompletedEvent | IterationStartedEvent | IterationCompletedEvent | LLMTextEvent | LLMToolStartEvent | LLMToolUseEvent | LLMToolEndEvent | TasksDefinedEvent | PhasesDefinedEvent | CriteriaDefinedEvent | PhaseStartedEvent | PhaseCompletedEvent | PhaseFailedEvent | CriterionPassedEvent | CriterionFailedEvent | CheckPassedEvent | CheckFailedEvent | ReviewCompleteEvent | TaskCompletedEvent | PlanCreatedEvent | PlanUpdatedEvent | PlanUpdateFailedEvent | LearningRecordedEvent | GuardrailAddedEvent | ProgressUpdatedEvent | WorktreeCreatedEvent | WorktreeRemovedEvent;
673
- /**
674
- * Type guard utilities for domain events.
675
- */
676
- declare const DomainEventUtils: {
677
- readonly isLLMEvent: (e: DomainEvent) => e is LLMTextEvent | LLMToolStartEvent | LLMToolUseEvent | LLMToolEndEvent;
678
- readonly isPhaseEvent: (e: DomainEvent) => e is PhaseStartedEvent | PhaseCompletedEvent | PhaseFailedEvent;
679
- readonly isCriterionEvent: (e: DomainEvent) => e is CriterionPassedEvent | CriterionFailedEvent;
680
- readonly isLoopEvent: (e: DomainEvent) => e is LoopStartedEvent | LoopCompletedEvent | LoopFailedEvent;
681
- readonly isDiscoveryEvent: (e: DomainEvent) => e is DiscoveryStartedEvent | DiscoveryCompletedEvent;
682
- };
683
-
684
- /**
685
- * Severity levels for guardrails.
686
- */
687
- declare const GuardrailSeveritySchema: Schema.Literal<["warning", "critical"]>;
688
- type GuardrailSeverity = typeof GuardrailSeveritySchema.Type;
689
- /**
690
- * A guardrail represents a failure pattern to avoid.
691
- *
692
- * Guardrails are learned from previous iteration failures and
693
- * help prevent the LLM from repeating the same mistakes.
694
- */
695
- declare const GuardrailSchema: Schema.Struct<{
696
- id: typeof Schema.String;
697
- createdAt: typeof Schema.String;
698
- iteration: typeof Schema.Number;
699
- pattern: typeof Schema.String;
700
- sign: typeof Schema.String;
701
- avoidance: typeof Schema.String;
702
- severity: Schema.Literal<["warning", "critical"]>;
703
- }>;
704
- type Guardrail = typeof GuardrailSchema.Type;
705
- /**
706
- * The complete guardrails file structure.
707
- *
708
- * Contains session metadata and an array of guardrails.
709
- * This is the structure persisted to `.ferix/plans/:sessionId/guardrails.md`.
710
- */
711
- declare const GuardrailsFileSchema: Schema.Struct<{
712
- sessionId: typeof Schema.String;
713
- createdAt: typeof Schema.String;
714
- guardrails: Schema.Array$<Schema.Struct<{
715
- id: typeof Schema.String;
716
- createdAt: typeof Schema.String;
717
- iteration: typeof Schema.Number;
718
- pattern: typeof Schema.String;
719
- sign: typeof Schema.String;
720
- avoidance: typeof Schema.String;
721
- severity: Schema.Literal<["warning", "critical"]>;
722
- }>>;
723
- }>;
724
- type GuardrailsFile = typeof GuardrailsFileSchema.Type;
725
- /**
726
- * Decode helpers.
727
- */
728
- declare const decodeGuardrail: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
729
- readonly iteration: number;
730
- readonly id: string;
731
- readonly createdAt: string;
732
- readonly pattern: string;
733
- readonly sign: string;
734
- readonly avoidance: string;
735
- readonly severity: "warning" | "critical";
736
- }, effect_ParseResult.ParseError, never>;
737
- declare const decodeGuardrailsFile: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
738
- readonly sessionId: string;
739
- readonly createdAt: string;
740
- readonly guardrails: readonly {
741
- readonly iteration: number;
742
- readonly id: string;
743
- readonly createdAt: string;
744
- readonly pattern: string;
745
- readonly sign: string;
746
- readonly avoidance: string;
747
- readonly severity: "warning" | "critical";
748
- }[];
749
- }, effect_ParseResult.ParseError, never>;
750
-
751
- declare const TextEventSchema: Schema.TaggedStruct<"Text", {
752
- text: typeof Schema.String;
753
- }>;
754
- declare const ToolStartEventSchema: Schema.TaggedStruct<"ToolStart", {
755
- tool: typeof Schema.String;
756
- }>;
757
- declare const ToolUseEventSchema: Schema.TaggedStruct<"ToolUse", {
758
- tool: typeof Schema.String;
759
- input: typeof Schema.Unknown;
760
- }>;
761
- declare const ToolEndEventSchema: Schema.TaggedStruct<"ToolEnd", {
762
- tool: typeof Schema.String;
763
- }>;
764
- declare const DoneEventSchema: Schema.TaggedStruct<"Done", {
765
- output: typeof Schema.String;
766
- }>;
767
- declare const LLMEventSchema: Schema.Union<[Schema.TaggedStruct<"Text", {
768
- text: typeof Schema.String;
769
- }>, Schema.TaggedStruct<"ToolStart", {
770
- tool: typeof Schema.String;
771
- }>, Schema.TaggedStruct<"ToolUse", {
772
- tool: typeof Schema.String;
773
- input: typeof Schema.Unknown;
774
- }>, Schema.TaggedStruct<"ToolEnd", {
775
- tool: typeof Schema.String;
776
- }>, Schema.TaggedStruct<"Done", {
777
- output: typeof Schema.String;
778
- }>]>;
779
- type TextEvent = typeof TextEventSchema.Type;
780
- type ToolStartEvent = typeof ToolStartEventSchema.Type;
781
- type ToolUseEvent = typeof ToolUseEventSchema.Type;
782
- type ToolEndEvent = typeof ToolEndEventSchema.Type;
783
- type DoneEvent = typeof DoneEventSchema.Type;
784
- type LLMEvent = TextEvent | ToolStartEvent | ToolUseEvent | ToolEndEvent | DoneEvent;
785
- declare const decodeLLMEvent: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
786
- readonly _tag: "Text";
787
- readonly text: string;
788
- } | {
789
- readonly _tag: "ToolStart";
790
- readonly tool: string;
791
- } | {
792
- readonly input: unknown;
793
- readonly _tag: "ToolUse";
794
- readonly tool: string;
795
- } | {
796
- readonly _tag: "ToolEnd";
797
- readonly tool: string;
798
- } | {
799
- readonly _tag: "Done";
800
- readonly output: string;
801
- }, effect_ParseResult.ParseError, never>;
802
-
803
- declare const LogLevelSchema: Schema.Literal<["debug", "info", "warn", "error"]>;
804
- type LogLevel = typeof LogLevelSchema.Type;
805
- declare const LogEntrySchema: Schema.Struct<{
806
- level: Schema.Literal<["debug", "info", "warn", "error"]>;
807
- message: typeof Schema.String;
808
- timestamp: typeof Schema.String;
809
- context: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
810
- }>;
811
- type LogEntry = typeof LogEntrySchema.Type;
812
- declare const ConsoleLoggerConfigSchema: Schema.Struct<{
813
- level: Schema.optional<Schema.Literal<["debug", "info", "warn", "error"]>>;
814
- colors: Schema.optional<typeof Schema.Boolean>;
815
- }>;
816
- type ConsoleLoggerConfig = typeof ConsoleLoggerConfigSchema.Type;
817
- declare const FileLoggerConfigSchema: Schema.Struct<{
818
- path: Schema.optional<typeof Schema.String>;
819
- level: Schema.optional<Schema.Literal<["debug", "info", "warn", "error"]>>;
820
- }>;
821
- type FileLoggerConfig = typeof FileLoggerConfigSchema.Type;
822
-
823
- /**
824
- * Branded PlanId type.
825
- */
826
- type PlanId = string & Brand.Brand<"PlanId">;
827
- declare const PlanId: Brand.Brand.Constructor<PlanId>;
828
- /**
829
- * Status schemas.
830
- */
831
- declare const TaskStatusSchema: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
832
- type TaskStatus = typeof TaskStatusSchema.Type;
833
- declare const PhaseStatusSchema: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
834
- type PhaseStatus = typeof PhaseStatusSchema.Type;
835
- declare const CriterionStatusSchema: Schema.Literal<["pending", "passed", "failed"]>;
836
- type CriterionStatus = typeof CriterionStatusSchema.Type;
837
- /**
838
- * Phase schema.
839
- */
840
- declare const PhaseSchema: Schema.Struct<{
841
- id: typeof Schema.String;
842
- description: typeof Schema.String;
843
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
844
- }>;
845
- type Phase = typeof PhaseSchema.Type;
846
- /**
847
- * Criterion schema.
848
- */
849
- declare const CriterionSchema: Schema.Struct<{
850
- id: typeof Schema.String;
851
- description: typeof Schema.String;
852
- status: Schema.Literal<["pending", "passed", "failed"]>;
853
- failureReason: Schema.optional<typeof Schema.String>;
854
- }>;
855
- type Criterion = typeof CriterionSchema.Type;
856
- /**
857
- * Task schema.
858
- */
859
- declare const TaskSchema: Schema.Struct<{
860
- id: typeof Schema.String;
861
- title: typeof Schema.String;
862
- description: typeof Schema.String;
863
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
864
- phases: Schema.Array$<Schema.Struct<{
865
- id: typeof Schema.String;
866
- description: typeof Schema.String;
867
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
868
- }>>;
869
- criteria: Schema.Array$<Schema.Struct<{
870
- id: typeof Schema.String;
871
- description: typeof Schema.String;
872
- status: Schema.Literal<["pending", "passed", "failed"]>;
873
- failureReason: Schema.optional<typeof Schema.String>;
874
- }>>;
875
- filesToModify: Schema.Array$<typeof Schema.String>;
876
- attempts: typeof Schema.Number;
877
- completionNotes: Schema.optional<typeof Schema.String>;
878
- }>;
879
- type Task = typeof TaskSchema.Type;
880
- /**
881
- * Plan data schema (without id, for deserialization).
882
- */
883
- declare const PlanDataSchema: Schema.Struct<{
884
- sessionId: typeof Schema.String;
885
- createdAt: typeof Schema.String;
886
- originalTask: typeof Schema.String;
887
- context: Schema.optional<typeof Schema.String>;
888
- tasks: Schema.Array$<Schema.Struct<{
889
- id: typeof Schema.String;
890
- title: typeof Schema.String;
891
- description: typeof Schema.String;
892
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
893
- phases: Schema.Array$<Schema.Struct<{
894
- id: typeof Schema.String;
895
- description: typeof Schema.String;
896
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
897
- }>>;
898
- criteria: Schema.Array$<Schema.Struct<{
899
- id: typeof Schema.String;
900
- description: typeof Schema.String;
901
- status: Schema.Literal<["pending", "passed", "failed"]>;
902
- failureReason: Schema.optional<typeof Schema.String>;
903
- }>>;
904
- filesToModify: Schema.Array$<typeof Schema.String>;
905
- attempts: typeof Schema.Number;
906
- completionNotes: Schema.optional<typeof Schema.String>;
907
- }>>;
908
- }>;
909
- type PlanData = typeof PlanDataSchema.Type;
910
- /**
911
- * Plan schema with id.
912
- */
913
- declare const PlanSchema: Schema.Struct<{
914
- id: typeof Schema.String;
915
- sessionId: typeof Schema.String;
916
- createdAt: typeof Schema.String;
917
- originalTask: typeof Schema.String;
918
- context: Schema.optional<typeof Schema.String>;
919
- tasks: Schema.Array$<Schema.Struct<{
920
- id: typeof Schema.String;
921
- title: typeof Schema.String;
922
- description: typeof Schema.String;
923
- status: Schema.Literal<["pending", "planning", "in_progress", "done", "failed", "skipped"]>;
924
- phases: Schema.Array$<Schema.Struct<{
925
- id: typeof Schema.String;
926
- description: typeof Schema.String;
927
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
928
- }>>;
929
- criteria: Schema.Array$<Schema.Struct<{
930
- id: typeof Schema.String;
931
- description: typeof Schema.String;
932
- status: Schema.Literal<["pending", "passed", "failed"]>;
933
- failureReason: Schema.optional<typeof Schema.String>;
934
- }>>;
935
- filesToModify: Schema.Array$<typeof Schema.String>;
936
- attempts: typeof Schema.Number;
937
- completionNotes: Schema.optional<typeof Schema.String>;
938
- }>>;
939
- }>;
940
- type Plan = typeof PlanSchema.Type & {
941
- readonly id: PlanId;
942
- };
943
- /**
944
- * Decode helpers.
945
- */
946
- declare const decodePlan: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
947
- readonly sessionId: string;
948
- readonly id: string;
949
- readonly createdAt: string;
950
- readonly originalTask: string;
951
- readonly context?: string | undefined;
952
- readonly tasks: readonly {
953
- readonly phases: readonly {
954
- readonly status: "pending" | "in_progress" | "done" | "failed";
955
- readonly id: string;
956
- readonly description: string;
957
- }[];
958
- readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
959
- readonly id: string;
960
- readonly description: string;
961
- readonly title: string;
962
- readonly criteria: readonly {
963
- readonly status: "pending" | "failed" | "passed";
964
- readonly id: string;
965
- readonly description: string;
966
- readonly failureReason?: string | undefined;
967
- }[];
968
- readonly filesToModify: readonly string[];
969
- readonly attempts: number;
970
- readonly completionNotes?: string | undefined;
971
- }[];
972
- }, effect_ParseResult.ParseError, never>;
973
- declare const decodePlanData: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
974
- readonly sessionId: string;
975
- readonly createdAt: string;
976
- readonly originalTask: string;
977
- readonly context?: string | undefined;
978
- readonly tasks: readonly {
979
- readonly phases: readonly {
980
- readonly status: "pending" | "in_progress" | "done" | "failed";
981
- readonly id: string;
982
- readonly description: string;
983
- }[];
984
- readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
985
- readonly id: string;
986
- readonly description: string;
987
- readonly title: string;
988
- readonly criteria: readonly {
989
- readonly status: "pending" | "failed" | "passed";
990
- readonly id: string;
991
- readonly description: string;
992
- readonly failureReason?: string | undefined;
993
- }[];
994
- readonly filesToModify: readonly string[];
995
- readonly attempts: number;
996
- readonly completionNotes?: string | undefined;
997
- }[];
998
- }, effect_ParseResult.ParseError, never>;
999
-
1000
- declare const ConsumerTypeSchema: Schema.Literal<["tui", "headless", "none"]>;
1001
- type ConsumerType = typeof ConsumerTypeSchema.Type;
1002
- declare const RunOptionsDataSchema: Schema.Struct<{
1003
- config: Schema.Struct<{
1004
- task: typeof Schema.String;
1005
- maxIterations: typeof Schema.Number;
1006
- verifyCommands: Schema.Array$<typeof Schema.String>;
1007
- sessionId: Schema.optional<typeof Schema.String>;
1008
- branch: Schema.optional<typeof Schema.String>;
1009
- push: Schema.optional<typeof Schema.Boolean>;
1010
- pr: Schema.optional<typeof Schema.Boolean>;
1011
- verbose: Schema.optional<typeof Schema.Boolean>;
1012
- prompts: Schema.optional<Schema.Struct<{
1013
- systemPrompt: Schema.optional<typeof Schema.String>;
1014
- phases: Schema.optional<Schema.Struct<{
1015
- breakdown: Schema.optional<typeof Schema.String>;
1016
- planning: Schema.optional<typeof Schema.String>;
1017
- execution: Schema.optional<typeof Schema.String>;
1018
- check: Schema.optional<typeof Schema.String>;
1019
- verify: Schema.optional<typeof Schema.String>;
1020
- review: Schema.optional<typeof Schema.String>;
1021
- completion: Schema.optional<typeof Schema.String>;
1022
- }>>;
1023
- additionalContext: Schema.optional<typeof Schema.String>;
1024
- }>>;
1025
- }>;
1026
- consumer: Schema.optional<Schema.Literal<["tui", "headless", "none"]>>;
1027
- }>;
1028
- type RunOptionsData = typeof RunOptionsDataSchema.Type;
1029
-
1030
- /**
1031
- * Action types for progress entries.
1032
- */
1033
- declare const ProgressActionSchema: Schema.Literal<["started", "completed", "failed", "learning"]>;
1034
- type ProgressAction = typeof ProgressActionSchema.Type;
1035
- /**
1036
- * A single progress entry for the append-only log.
1037
- *
1038
- * Each entry records what happened in an iteration, including:
1039
- * - Which task was worked on
1040
- * - What action was taken
1041
- * - A summary of the work
1042
- * - Any learnings discovered
1043
- * - Files that were modified
1044
- */
1045
- declare const ProgressEntrySchema: Schema.Struct<{
1046
- iteration: typeof Schema.Number;
1047
- timestamp: typeof Schema.String;
1048
- taskId: typeof Schema.String;
1049
- action: Schema.Literal<["started", "completed", "failed", "learning"]>;
1050
- summary: typeof Schema.String;
1051
- learnings: Schema.optional<Schema.Array$<typeof Schema.String>>;
1052
- filesModified: Schema.optional<Schema.Array$<typeof Schema.String>>;
1053
- }>;
1054
- type ProgressEntry = typeof ProgressEntrySchema.Type;
1055
- /**
1056
- * The complete progress file structure.
1057
- *
1058
- * Contains session metadata and an array of progress entries.
1059
- * This is the structure persisted to `.ferix/plans/:sessionId/progress.md`.
1060
- */
1061
- declare const ProgressFileSchema: Schema.Struct<{
1062
- sessionId: typeof Schema.String;
1063
- createdAt: typeof Schema.String;
1064
- entries: Schema.Array$<Schema.Struct<{
1065
- iteration: typeof Schema.Number;
1066
- timestamp: typeof Schema.String;
1067
- taskId: typeof Schema.String;
1068
- action: Schema.Literal<["started", "completed", "failed", "learning"]>;
1069
- summary: typeof Schema.String;
1070
- learnings: Schema.optional<Schema.Array$<typeof Schema.String>>;
1071
- filesModified: Schema.optional<Schema.Array$<typeof Schema.String>>;
1072
- }>>;
1073
- }>;
1074
- type ProgressFile = typeof ProgressFileSchema.Type;
1075
- /**
1076
- * Decode helpers.
1077
- */
1078
- declare const decodeProgressEntry: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
1079
- readonly iteration: number;
1080
- readonly taskId: string;
1081
- readonly summary: string;
1082
- readonly filesModified?: readonly string[] | undefined;
1083
- readonly timestamp: string;
1084
- readonly action: "failed" | "started" | "completed" | "learning";
1085
- readonly learnings?: readonly string[] | undefined;
1086
- }, effect_ParseResult.ParseError, never>;
1087
- declare const decodeProgressFile: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
1088
- readonly entries: readonly {
1089
- readonly iteration: number;
1090
- readonly taskId: string;
1091
- readonly summary: string;
1092
- readonly filesModified?: readonly string[] | undefined;
1093
- readonly timestamp: string;
1094
- readonly action: "failed" | "started" | "completed" | "learning";
1095
- readonly learnings?: readonly string[] | undefined;
1096
- }[];
1097
- readonly sessionId: string;
1098
- readonly createdAt: string;
1099
- }, effect_ParseResult.ParseError, never>;
1100
-
1101
- /**
1102
- * Session status schema.
1103
- */
1104
- declare const SessionStatusSchema: Schema.Literal<["active", "completed", "failed", "paused"]>;
1105
- type SessionStatus = typeof SessionStatusSchema.Type;
1106
- /**
1107
- * Session schema.
1108
- */
1109
- declare const SessionSchema: Schema.Struct<{
1110
- id: typeof Schema.String;
1111
- createdAt: typeof Schema.String;
1112
- status: Schema.Literal<["active", "completed", "failed", "paused"]>;
1113
- originalTask: typeof Schema.String;
1114
- completedTasks: Schema.Array$<typeof Schema.String>;
1115
- currentTaskId: Schema.optional<typeof Schema.String>;
1116
- worktreePath: Schema.optional<typeof Schema.String>;
1117
- branchName: Schema.optional<typeof Schema.String>;
1118
- }>;
1119
- type Session = typeof SessionSchema.Type;
1120
- /**
1121
- * Decode helper.
1122
- */
1123
- declare const decodeSession: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
1124
- readonly status: "failed" | "completed" | "active" | "paused";
1125
- readonly completedTasks: readonly string[];
1126
- readonly id: string;
1127
- readonly createdAt: string;
1128
- readonly originalTask: string;
1129
- readonly worktreePath?: string | undefined;
1130
- readonly branchName?: string | undefined;
1131
- readonly currentTaskId?: string | undefined;
1132
- }, effect_ParseResult.ParseError, never>;
1133
-
1134
- /**
1135
- * Basic info schemas for tasks, phases, and criteria.
1136
- */
1137
- declare const TaskBasicInfoSchema: Schema.Struct<{
1138
- id: typeof Schema.String;
1139
- title: typeof Schema.String;
1140
- description: typeof Schema.String;
1141
- }>;
1142
- type TaskBasicInfo = typeof TaskBasicInfoSchema.Type;
1143
- declare const PhaseBasicInfoSchema: Schema.Struct<{
1144
- id: typeof Schema.String;
1145
- description: typeof Schema.String;
1146
- }>;
1147
- type PhaseBasicInfo = typeof PhaseBasicInfoSchema.Type;
1148
- declare const CriterionBasicInfoSchema: Schema.Struct<{
1149
- id: typeof Schema.String;
1150
- description: typeof Schema.String;
1151
- }>;
1152
- type CriterionBasicInfo = typeof CriterionBasicInfoSchema.Type;
1153
- /**
1154
- * Data schemas (base for signals, without _tag).
1155
- */
1156
- declare const TasksDefinedDataSchema: Schema.Struct<{
1157
- tasks: Schema.Array$<Schema.Struct<{
1158
- id: typeof Schema.String;
1159
- title: typeof Schema.String;
1160
- description: typeof Schema.String;
1161
- }>>;
1162
- }>;
1163
- type TasksDefinedData = typeof TasksDefinedDataSchema.Type;
1164
- declare const PhasesDefinedDataSchema: Schema.Struct<{
1165
- taskId: typeof Schema.String;
1166
- phases: Schema.Array$<Schema.Struct<{
1167
- id: typeof Schema.String;
1168
- description: typeof Schema.String;
1169
- }>>;
1170
- }>;
1171
- type PhasesDefinedData = typeof PhasesDefinedDataSchema.Type;
1172
- declare const CriteriaDefinedDataSchema: Schema.Struct<{
1173
- taskId: typeof Schema.String;
1174
- criteria: Schema.Array$<Schema.Struct<{
1175
- id: typeof Schema.String;
1176
- description: typeof Schema.String;
1177
- }>>;
1178
- }>;
1179
- type CriteriaDefinedData = typeof CriteriaDefinedDataSchema.Type;
1180
- declare const PhaseIdDataSchema: Schema.Struct<{
1181
- phaseId: typeof Schema.String;
1182
- }>;
1183
- type PhaseIdData = typeof PhaseIdDataSchema.Type;
1184
- declare const PhaseFailedDataSchema: Schema.Struct<{
1185
- phaseId: typeof Schema.String;
1186
- reason: typeof Schema.String;
1187
- }>;
1188
- type PhaseFailedData = typeof PhaseFailedDataSchema.Type;
1189
- declare const CriterionIdDataSchema: Schema.Struct<{
1190
- criterionId: typeof Schema.String;
1191
- }>;
1192
- type CriterionIdData = typeof CriterionIdDataSchema.Type;
1193
- declare const CriterionFailedDataSchema: Schema.Struct<{
1194
- criterionId: typeof Schema.String;
1195
- reason: typeof Schema.String;
1196
- }>;
1197
- type CriterionFailedData = typeof CriterionFailedDataSchema.Type;
1198
- declare const ReviewCompleteDataSchema: Schema.Struct<{
1199
- changesMade: typeof Schema.Boolean;
1200
- }>;
1201
- type ReviewCompleteData = typeof ReviewCompleteDataSchema.Type;
1202
- declare const TaskCompleteSignalDataSchema: Schema.Struct<{
1203
- taskId: typeof Schema.String;
1204
- summary: typeof Schema.String;
1205
- filesModified: Schema.Array$<typeof Schema.String>;
1206
- filesCreated: Schema.Array$<typeof Schema.String>;
1207
- }>;
1208
- type TaskCompleteSignalData = typeof TaskCompleteSignalDataSchema.Type;
1209
- /**
1210
- * TaskCompleteData without file arrays (used by events).
1211
- */
1212
- declare const TaskCompleteDataSchema: Schema.Struct<{
1213
- taskId: typeof Schema.String;
1214
- summary: typeof Schema.String;
1215
- }>;
1216
- type TaskCompleteData = typeof TaskCompleteDataSchema.Type;
1217
-
1218
- /**
1219
- * Signal schemas.
1220
- */
1221
- declare const TasksDefinedSignalSchema: Schema.TaggedStruct<"TasksDefined", Readonly<{
1222
- tasks: Schema.Array$<Schema.Struct<{
1223
- id: typeof Schema.String;
1224
- title: typeof Schema.String;
1225
- description: typeof Schema.String;
1226
- }>>;
1227
- }>>;
1228
- type TasksDefinedSignal = typeof TasksDefinedSignalSchema.Type;
1229
- declare const PhasesDefinedSignalSchema: Schema.TaggedStruct<"PhasesDefined", Readonly<{
1230
- taskId: typeof Schema.String;
1231
- phases: Schema.Array$<Schema.Struct<{
1232
- id: typeof Schema.String;
1233
- description: typeof Schema.String;
1234
- }>>;
1235
- }>>;
1236
- type PhasesDefinedSignal = typeof PhasesDefinedSignalSchema.Type;
1237
- declare const CriteriaDefinedSignalSchema: Schema.TaggedStruct<"CriteriaDefined", Readonly<{
1238
- taskId: typeof Schema.String;
1239
- criteria: Schema.Array$<Schema.Struct<{
1240
- id: typeof Schema.String;
1241
- description: typeof Schema.String;
1242
- }>>;
1243
- }>>;
1244
- type CriteriaDefinedSignal = typeof CriteriaDefinedSignalSchema.Type;
1245
- declare const PhaseStartedSignalSchema: Schema.TaggedStruct<"PhaseStarted", Readonly<{
1246
- phaseId: typeof Schema.String;
1247
- }>>;
1248
- type PhaseStartedSignal = typeof PhaseStartedSignalSchema.Type;
1249
- declare const PhaseCompletedSignalSchema: Schema.TaggedStruct<"PhaseCompleted", Readonly<{
1250
- phaseId: typeof Schema.String;
1251
- }>>;
1252
- type PhaseCompletedSignal = typeof PhaseCompletedSignalSchema.Type;
1253
- declare const PhaseFailedSignalSchema: Schema.TaggedStruct<"PhaseFailed", Readonly<{
1254
- phaseId: typeof Schema.String;
1255
- reason: typeof Schema.String;
1256
- }>>;
1257
- type PhaseFailedSignal = typeof PhaseFailedSignalSchema.Type;
1258
- declare const CriterionPassedSignalSchema: Schema.TaggedStruct<"CriterionPassed", Readonly<{
1259
- criterionId: typeof Schema.String;
1260
- }>>;
1261
- type CriterionPassedSignal = typeof CriterionPassedSignalSchema.Type;
1262
- declare const CriterionFailedSignalSchema: Schema.TaggedStruct<"CriterionFailed", Readonly<{
1263
- criterionId: typeof Schema.String;
1264
- reason: typeof Schema.String;
1265
- }>>;
1266
- type CriterionFailedSignal = typeof CriterionFailedSignalSchema.Type;
1267
- declare const CheckPassedSignalSchema: Schema.TaggedStruct<"CheckPassed", {}>;
1268
- type CheckPassedSignal = typeof CheckPassedSignalSchema.Type;
1269
- declare const CheckFailedSignalSchema: Schema.TaggedStruct<"CheckFailed", {}>;
1270
- type CheckFailedSignal = typeof CheckFailedSignalSchema.Type;
1271
- declare const ReviewCompleteSignalSchema: Schema.TaggedStruct<"ReviewComplete", Readonly<{
1272
- changesMade: typeof Schema.Boolean;
1273
- }>>;
1274
- type ReviewCompleteSignal = typeof ReviewCompleteSignalSchema.Type;
1275
- declare const TaskCompleteSignalSchema: Schema.TaggedStruct<"TaskComplete", Readonly<{
1276
- taskId: typeof Schema.String;
1277
- summary: typeof Schema.String;
1278
- filesModified: Schema.Array$<typeof Schema.String>;
1279
- filesCreated: Schema.Array$<typeof Schema.String>;
1280
- }>>;
1281
- type TaskCompleteSignal = typeof TaskCompleteSignalSchema.Type;
1282
- declare const LoopCompleteSignalSchema: Schema.TaggedStruct<"LoopComplete", {}>;
1283
- type LoopCompleteSignal = typeof LoopCompleteSignalSchema.Type;
1284
- /**
1285
- * Learning category types.
1286
- */
1287
- declare const LearningCategorySchema: Schema.Literal<["success", "failure", "optimization"]>;
1288
- type LearningCategory = typeof LearningCategorySchema.Type;
1289
- /**
1290
- * Learning signal - records insights discovered during iteration.
1291
- */
1292
- declare const LearningSignalSchema: Schema.TaggedStruct<"Learning", {
1293
- content: typeof Schema.String;
1294
- category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
1295
- }>;
1296
- type LearningSignal = typeof LearningSignalSchema.Type;
1297
- /**
1298
- * Guardrail signal - records failure patterns to avoid.
1299
- */
1300
- declare const GuardrailSignalSchema: Schema.TaggedStruct<"Guardrail", {
1301
- pattern: typeof Schema.String;
1302
- sign: typeof Schema.String;
1303
- avoidance: typeof Schema.String;
1304
- severity: Schema.Literal<["warning", "critical"]>;
1305
- }>;
1306
- type GuardrailSignal = typeof GuardrailSignalSchema.Type;
1307
- /**
1308
- * Union of all signals.
1309
- */
1310
- declare const SignalSchema: Schema.Union<[Schema.TaggedStruct<"TasksDefined", Readonly<{
1311
- tasks: Schema.Array$<Schema.Struct<{
1312
- id: typeof Schema.String;
1313
- title: typeof Schema.String;
1314
- description: typeof Schema.String;
1315
- }>>;
1316
- }>>, Schema.TaggedStruct<"PhasesDefined", Readonly<{
1317
- taskId: typeof Schema.String;
1318
- phases: Schema.Array$<Schema.Struct<{
1319
- id: typeof Schema.String;
1320
- description: typeof Schema.String;
1321
- }>>;
1322
- }>>, Schema.TaggedStruct<"CriteriaDefined", Readonly<{
1323
- taskId: typeof Schema.String;
1324
- criteria: Schema.Array$<Schema.Struct<{
1325
- id: typeof Schema.String;
1326
- description: typeof Schema.String;
1327
- }>>;
1328
- }>>, Schema.TaggedStruct<"PhaseStarted", Readonly<{
1329
- phaseId: typeof Schema.String;
1330
- }>>, Schema.TaggedStruct<"PhaseCompleted", Readonly<{
1331
- phaseId: typeof Schema.String;
1332
- }>>, Schema.TaggedStruct<"PhaseFailed", Readonly<{
1333
- phaseId: typeof Schema.String;
1334
- reason: typeof Schema.String;
1335
- }>>, Schema.TaggedStruct<"CriterionPassed", Readonly<{
1336
- criterionId: typeof Schema.String;
1337
- }>>, Schema.TaggedStruct<"CriterionFailed", Readonly<{
1338
- criterionId: typeof Schema.String;
1339
- reason: typeof Schema.String;
1340
- }>>, Schema.TaggedStruct<"CheckPassed", {}>, Schema.TaggedStruct<"CheckFailed", {}>, Schema.TaggedStruct<"ReviewComplete", Readonly<{
1341
- changesMade: typeof Schema.Boolean;
1342
- }>>, Schema.TaggedStruct<"TaskComplete", Readonly<{
1343
- taskId: typeof Schema.String;
1344
- summary: typeof Schema.String;
1345
- filesModified: Schema.Array$<typeof Schema.String>;
1346
- filesCreated: Schema.Array$<typeof Schema.String>;
1347
- }>>, Schema.TaggedStruct<"LoopComplete", {}>, Schema.TaggedStruct<"Learning", {
1348
- content: typeof Schema.String;
1349
- category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
1350
- }>, Schema.TaggedStruct<"Guardrail", {
1351
- pattern: typeof Schema.String;
1352
- sign: typeof Schema.String;
1353
- avoidance: typeof Schema.String;
1354
- severity: Schema.Literal<["warning", "critical"]>;
1355
- }>]>;
1356
- type Signal = typeof SignalSchema.Type;
1357
- /**
1358
- * Decode helpers.
1359
- */
1360
- declare const decodeSignal: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
1361
- readonly _tag: "CheckPassed";
1362
- } | {
1363
- readonly _tag: "TasksDefined";
1364
- readonly tasks: readonly {
1365
- readonly id: string;
1366
- readonly description: string;
1367
- readonly title: string;
1368
- }[];
1369
- } | {
1370
- readonly phases: readonly {
1371
- readonly id: string;
1372
- readonly description: string;
1373
- }[];
1374
- readonly _tag: "PhasesDefined";
1375
- readonly taskId: string;
1376
- } | {
1377
- readonly _tag: "CriteriaDefined";
1378
- readonly criteria: readonly {
1379
- readonly id: string;
1380
- readonly description: string;
1381
- }[];
1382
- readonly taskId: string;
1383
- } | {
1384
- readonly _tag: "PhaseStarted";
1385
- readonly phaseId: string;
1386
- } | {
1387
- readonly _tag: "PhaseCompleted";
1388
- readonly phaseId: string;
1389
- } | {
1390
- readonly _tag: "PhaseFailed";
1391
- readonly phaseId: string;
1392
- readonly reason: string;
1393
- } | {
1394
- readonly _tag: "CriterionPassed";
1395
- readonly criterionId: string;
1396
- } | {
1397
- readonly _tag: "CriterionFailed";
1398
- readonly reason: string;
1399
- readonly criterionId: string;
1400
- } | {
1401
- readonly _tag: "CheckFailed";
1402
- } | {
1403
- readonly _tag: "ReviewComplete";
1404
- readonly changesMade: boolean;
1405
- } | {
1406
- readonly _tag: "TaskComplete";
1407
- readonly taskId: string;
1408
- readonly summary: string;
1409
- readonly filesModified: readonly string[];
1410
- readonly filesCreated: readonly string[];
1411
- } | {
1412
- readonly _tag: "LoopComplete";
1413
- } | {
1414
- readonly _tag: "Learning";
1415
- readonly content: string;
1416
- readonly category?: "success" | "failure" | "optimization" | undefined;
1417
- } | {
1418
- readonly _tag: "Guardrail";
1419
- readonly pattern: string;
1420
- readonly sign: string;
1421
- readonly avoidance: string;
1422
- readonly severity: "warning" | "critical";
1423
- }, effect_ParseResult.ParseError, never>;
1424
- declare const decodeSignalSync: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => {
1425
- readonly _tag: "CheckPassed";
1426
- } | {
1427
- readonly _tag: "TasksDefined";
1428
- readonly tasks: readonly {
1429
- readonly id: string;
1430
- readonly description: string;
1431
- readonly title: string;
1432
- }[];
1433
- } | {
1434
- readonly phases: readonly {
1435
- readonly id: string;
1436
- readonly description: string;
1437
- }[];
1438
- readonly _tag: "PhasesDefined";
1439
- readonly taskId: string;
1440
- } | {
1441
- readonly _tag: "CriteriaDefined";
1442
- readonly criteria: readonly {
1443
- readonly id: string;
1444
- readonly description: string;
1445
- }[];
1446
- readonly taskId: string;
1447
- } | {
1448
- readonly _tag: "PhaseStarted";
1449
- readonly phaseId: string;
1450
- } | {
1451
- readonly _tag: "PhaseCompleted";
1452
- readonly phaseId: string;
1453
- } | {
1454
- readonly _tag: "PhaseFailed";
1455
- readonly phaseId: string;
1456
- readonly reason: string;
1457
- } | {
1458
- readonly _tag: "CriterionPassed";
1459
- readonly criterionId: string;
1460
- } | {
1461
- readonly _tag: "CriterionFailed";
1462
- readonly reason: string;
1463
- readonly criterionId: string;
1464
- } | {
1465
- readonly _tag: "CheckFailed";
1466
- } | {
1467
- readonly _tag: "ReviewComplete";
1468
- readonly changesMade: boolean;
1469
- } | {
1470
- readonly _tag: "TaskComplete";
1471
- readonly taskId: string;
1472
- readonly summary: string;
1473
- readonly filesModified: readonly string[];
1474
- readonly filesCreated: readonly string[];
1475
- } | {
1476
- readonly _tag: "LoopComplete";
1477
- } | {
1478
- readonly _tag: "Learning";
1479
- readonly content: string;
1480
- readonly category?: "success" | "failure" | "optimization" | undefined;
1481
- } | {
1482
- readonly _tag: "Guardrail";
1483
- readonly pattern: string;
1484
- readonly sign: string;
1485
- readonly avoidance: string;
1486
- readonly severity: "warning" | "critical";
1487
- };
1488
-
1489
- /**
1490
- * Status for generated tasks in tasks.md
1491
- */
1492
- declare const GeneratedTaskStatusSchema: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1493
- type GeneratedTaskStatus = typeof GeneratedTaskStatusSchema.Type;
1494
- /**
1495
- * Single generated task entry schema
1496
- */
1497
- declare const GeneratedTaskSchema: Schema.Struct<{
1498
- id: typeof Schema.String;
1499
- title: typeof Schema.String;
1500
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1501
- }>;
1502
- type GeneratedTask = typeof GeneratedTaskSchema.Type;
1503
- /**
1504
- * Array of generated tasks schema
1505
- */
1506
- declare const GeneratedTaskListSchema: Schema.Array$<Schema.Struct<{
1507
- id: typeof Schema.String;
1508
- title: typeof Schema.String;
1509
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1510
- }>>;
1511
- type GeneratedTaskList = typeof GeneratedTaskListSchema.Type;
1512
- /**
1513
- * Format tasks to a human-readable markdown string
1514
- */
1515
- declare function formatTasksMd(tasks: GeneratedTaskList): string;
1516
- /**
1517
- * Parse markdown back to validated tasks
1518
- */
1519
- declare function parseTasksMd(content: string): GeneratedTaskList;
1520
-
1521
- declare const ViewModeSchema: Schema.Literal<["logs", "tasks", "detail"]>;
1522
- type ViewMode = typeof ViewModeSchema.Type;
1523
- declare const LoopStatusSchema: Schema.Literal<["idle", "running", "complete", "error"]>;
1524
- type LoopStatus = typeof LoopStatusSchema.Type;
1525
- declare const ExecutionModeSchema: Schema.Literal<["idle", "discovery", "breakdown", "planning", "working", "checking", "verifying", "reviewing"]>;
1526
- type ExecutionMode = typeof ExecutionModeSchema.Type;
1527
- declare const TUIPhaseStatusSchema: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1528
- type TUIPhaseStatus = typeof TUIPhaseStatusSchema.Type;
1529
- declare const TUICriterionStatusSchema: Schema.Literal<["pending", "passed", "failed"]>;
1530
- type TUICriterionStatus = typeof TUICriterionStatusSchema.Type;
1531
- declare const TUITaskStatusSchema: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1532
- type TUITaskStatus = typeof TUITaskStatusSchema.Type;
1533
- declare const TUIPhaseSchema: Schema.Struct<{
1534
- id: typeof Schema.String;
1535
- description: typeof Schema.String;
1536
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1537
- startedAt: Schema.optional<typeof Schema.Number>;
1538
- completedAt: Schema.optional<typeof Schema.Number>;
1539
- }>;
1540
- type TUIPhase = typeof TUIPhaseSchema.Type;
1541
- declare const TUICriterionSchema: Schema.Struct<{
1542
- id: typeof Schema.String;
1543
- description: typeof Schema.String;
1544
- status: Schema.Literal<["pending", "passed", "failed"]>;
1545
- failureReason: Schema.optional<typeof Schema.String>;
1546
- }>;
1547
- type TUICriterion = typeof TUICriterionSchema.Type;
1548
- declare const TUITaskSchema: Schema.Struct<{
1549
- id: typeof Schema.String;
1550
- title: typeof Schema.String;
1551
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1552
- phases: Schema.Array$<Schema.Struct<{
1553
- id: typeof Schema.String;
1554
- description: typeof Schema.String;
1555
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1556
- startedAt: Schema.optional<typeof Schema.Number>;
1557
- completedAt: Schema.optional<typeof Schema.Number>;
1558
- }>>;
1559
- criteria: Schema.Array$<Schema.Struct<{
1560
- id: typeof Schema.String;
1561
- description: typeof Schema.String;
1562
- status: Schema.Literal<["pending", "passed", "failed"]>;
1563
- failureReason: Schema.optional<typeof Schema.String>;
1564
- }>>;
1565
- startedAt: Schema.optional<typeof Schema.Number>;
1566
- completedAt: Schema.optional<typeof Schema.Number>;
1567
- }>;
1568
- type TUITask = typeof TUITaskSchema.Type;
1569
- declare const TUIStateSchema: Schema.Struct<{
1570
- task: typeof Schema.String;
1571
- iteration: typeof Schema.Number;
1572
- maxIterations: typeof Schema.Number;
1573
- status: Schema.Literal<["idle", "running", "complete", "error"]>;
1574
- startTime: typeof Schema.Number;
1575
- discoveryInProgress: typeof Schema.Boolean;
1576
- discoveryCompleted: typeof Schema.Boolean;
1577
- executionMode: Schema.Literal<["idle", "discovery", "breakdown", "planning", "working", "checking", "verifying", "reviewing"]>;
1578
- currentTool: Schema.optional<typeof Schema.String>;
1579
- currentTaskId: Schema.optional<typeof Schema.String>;
1580
- outputLines: Schema.Array$<typeof Schema.String>;
1581
- partialLine: typeof Schema.String;
1582
- tasks: Schema.Array$<Schema.Struct<{
1583
- id: typeof Schema.String;
1584
- title: typeof Schema.String;
1585
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1586
- phases: Schema.Array$<Schema.Struct<{
1587
- id: typeof Schema.String;
1588
- description: typeof Schema.String;
1589
- status: Schema.Literal<["pending", "in_progress", "done", "failed"]>;
1590
- startedAt: Schema.optional<typeof Schema.Number>;
1591
- completedAt: Schema.optional<typeof Schema.Number>;
1592
- }>>;
1593
- criteria: Schema.Array$<Schema.Struct<{
1594
- id: typeof Schema.String;
1595
- description: typeof Schema.String;
1596
- status: Schema.Literal<["pending", "passed", "failed"]>;
1597
- failureReason: Schema.optional<typeof Schema.String>;
1598
- }>>;
1599
- startedAt: Schema.optional<typeof Schema.Number>;
1600
- completedAt: Schema.optional<typeof Schema.Number>;
1601
- }>>;
1602
- viewMode: Schema.Literal<["logs", "tasks", "detail"]>;
1603
- selectedTaskIndex: typeof Schema.Number;
1604
- scrollOffset: typeof Schema.Number;
1605
- userScrolled: typeof Schema.Boolean;
1606
- gitBranch: Schema.optional<typeof Schema.String>;
1607
- gitPushed: typeof Schema.Boolean;
1608
- prUrl: Schema.optional<typeof Schema.String>;
1609
- }>;
1610
- type TUIState = typeof TUIStateSchema.Type;
1611
-
1612
- /**
1613
- * A consumer processes a stream of domain events.
1614
- *
1615
- * This is the ONLY interface between orchestrator and presentation.
1616
- * Consumers are completely decoupled from the orchestrator.
1617
- *
1618
- * @example Creating a custom consumer
1619
- * ```typescript
1620
- * const myConsumer: Consumer = {
1621
- * consume: (events) =>
1622
- * events.pipe(
1623
- * Stream.runForEach((event) =>
1624
- * Effect.sync(() => console.log(event._tag))
1625
- * )
1626
- * ),
1627
- * };
1628
- * ```
1629
- *
1630
- * @example WebSocket consumer
1631
- * ```typescript
1632
- * const wsConsumer: Consumer = {
1633
- * consume: (events) =>
1634
- * events.pipe(
1635
- * Stream.runForEach((event) =>
1636
- * Effect.sync(() => ws.send(JSON.stringify(event)))
1637
- * )
1638
- * ),
1639
- * };
1640
- * ```
1641
- */
1642
- interface Consumer {
1643
- /**
1644
- * Consume a stream of events.
1645
- *
1646
- * The consumer handles its own lifecycle (setup, teardown).
1647
- * The returned Effect completes when the stream is exhausted
1648
- * or an error occurs.
1649
- *
1650
- * @param events - Stream of domain events to process
1651
- * @returns Effect that completes when consumption is done
1652
- */
1653
- readonly consume: (events: Stream.Stream<DomainEvent, unknown, never>) => Effect.Effect<void, unknown>;
1654
- }
1655
-
1656
- /**
1657
- * Creates a headless consumer that logs events to the console.
1658
- *
1659
- * This consumer is suitable for CI environments or piped output.
1660
- * It formats events as colored log lines.
1661
- *
1662
- * @returns A Consumer that logs to stdout
1663
- *
1664
- * @example
1665
- * ```typescript
1666
- * const consumer = createHeadlessConsumer();
1667
- * const events = runLoop(config).pipe(Stream.provideLayer(layers));
1668
- * await consumer.consume(events).pipe(Effect.runPromise);
1669
- * ```
1670
- */
1671
- declare function createHeadlessConsumer(): Consumer;
1672
-
1673
- /**
1674
- * Creates a TUI consumer that renders events to a full-screen terminal interface.
1675
- *
1676
- * The TUI provides:
1677
- * - Header with task and iteration info
1678
- * - Status bar with current phase, tool, and progress
1679
- * - Three view modes: logs, tasks list, task detail
1680
- * - Scrollable output area with ferix tag styling
1681
- * - Keyboard navigation (vim-style j/k, g/G)
1682
- * - Mouse wheel support
1683
- * - Context-sensitive footer with keyboard hints
1684
- *
1685
- * Uses ANSI escape codes for terminal control (alternate buffer, cursor hiding, etc).
1686
- *
1687
- * @returns A Consumer that renders to the terminal
1688
- *
1689
- * @example
1690
- * ```typescript
1691
- * const consumer = createTUIConsumer();
1692
- * const events = runLoop(config).pipe(Stream.provideLayer(layers));
1693
- * await consumer.consume(events).pipe(Effect.runPromise);
1694
- * ```
1695
- */
1696
- declare function createTUIConsumer(): Consumer;
1697
-
1698
- /**
1699
- * Options for LLM execution.
1700
- */
1701
- interface LLMExecuteOptions {
1702
- /**
1703
- * Working directory for the LLM process.
1704
- * Used when running in a worktree context.
1705
- */
1706
- readonly cwd?: string;
1707
- }
1708
- /**
1709
- * Service interface for LLM execution.
1710
- *
1711
- * Implementations include:
1712
- * - ClaudeCLI: Spawns `claude` CLI with stream-json output
1713
- * - Mock: Returns predefined events for testing
1714
- *
1715
- * @example
1716
- * ```typescript
1717
- * const llm = yield* LLM;
1718
- * const events = llm.execute("Fix the bug in main.ts");
1719
- *
1720
- * await events.pipe(
1721
- * Stream.runForEach((event) => console.log(event)),
1722
- * Effect.runPromise
1723
- * );
1724
- * ```
1725
- */
1726
- interface LLMService {
1727
- /**
1728
- * Execute a prompt and return a stream of events.
1729
- *
1730
- * The stream emits events in real-time as the LLM produces output.
1731
- * The final event will be a "Done" event containing the full output.
1732
- *
1733
- * @param prompt - The prompt to send to the LLM
1734
- * @param options - Optional execution options (e.g., cwd for worktree)
1735
- * @returns Stream of LLM events that can be consumed by any subscriber
1736
- */
1737
- readonly execute: (prompt: string, options?: LLMExecuteOptions) => Stream.Stream<LLMEvent, LLMError>;
1738
- }
1739
- declare const LLM_base: Context.TagClass<LLM, "@ferix/LLM", LLMService>;
1740
- /**
1741
- * Effect Tag for the LLM service.
1742
- *
1743
- * Use this tag to depend on an LLM implementation without coupling to a specific provider.
1744
- *
1745
- * @example
1746
- * ```typescript
1747
- * const program = Effect.gen(function* () {
1748
- * const llm = yield* LLM;
1749
- * return yield* llm.execute(prompt).pipe(Stream.runCollect);
1750
- * });
1751
- *
1752
- * // Provide different implementations
1753
- * program.pipe(Effect.provide(ClaudeCLI.Live)); // Production
1754
- * program.pipe(Effect.provide(Mock.Live)); // Testing
1755
- * ```
1756
- */
1757
- declare class LLM extends LLM_base {
1758
- }
1759
-
1760
- /**
1761
- * Schema for MockLLMConfig for runtime validation.
1762
- */
1763
- declare const MockLLMConfigSchema: Schema.Struct<{
1764
- events: Schema.Array$<Schema.Union<[Schema.TaggedStruct<"Text", {
1765
- text: typeof Schema.String;
1766
- }>, Schema.TaggedStruct<"ToolStart", {
1767
- tool: typeof Schema.String;
1768
- }>, Schema.TaggedStruct<"ToolUse", {
1769
- tool: typeof Schema.String;
1770
- input: typeof Schema.Unknown;
1771
- }>, Schema.TaggedStruct<"ToolEnd", {
1772
- tool: typeof Schema.String;
1773
- }>, Schema.TaggedStruct<"Done", {
1774
- output: typeof Schema.String;
1775
- }>]>>;
1776
- delayMs: Schema.optional<typeof Schema.Number>;
1777
- }>;
1778
- type MockLLMConfig = typeof MockLLMConfigSchema.Type;
1779
- /**
1780
- * Creates a mock LLM service that emits predefined events.
1781
- *
1782
- * Useful for testing without making real LLM calls.
1783
- *
1784
- * @param config - Configuration specifying events to emit
1785
- * @returns An LLMService that emits the configured events
1786
- *
1787
- * @example
1788
- * ```typescript
1789
- * const mockLLM = createMockLLM({
1790
- * events: [
1791
- * { _tag: "Text", text: "Hello " },
1792
- * { _tag: "Text", text: "World!" },
1793
- * { _tag: "Done", output: "Hello World!" },
1794
- * ],
1795
- * });
1796
- * ```
1797
- */
1798
- declare function createMockLLM(config: MockLLMConfig): LLMService;
1799
- /**
1800
- * Creates a Layer with custom mock events.
1801
- *
1802
- * @param config - Configuration specifying events to emit
1803
- * @returns A Layer providing the configured mock LLM
1804
- *
1805
- * @example
1806
- * ```typescript
1807
- * const customMockLayer = Mock.layer({
1808
- * events: [
1809
- * { _tag: "Text", text: "<ferix:tasks><task id=\"1\">Test</task></ferix:tasks>" },
1810
- * { _tag: "Done", output: "..." },
1811
- * ],
1812
- * });
1813
- * ```
1814
- */
1815
- declare function layer$5(config: MockLLMConfig): Layer.Layer<LLM>;
1816
- /**
1817
- * Mock namespace containing the Live layer and factory functions.
1818
- */
1819
- declare const Mock: {
1820
- readonly Live: Layer.Layer<LLM, never, never>;
1821
- readonly layer: typeof layer$5;
1822
- readonly createMockLLM: typeof createMockLLM;
1823
- };
1824
-
1825
- /**
1826
- * Branded type for worktree paths.
1827
- */
1828
- type WorktreePath = string & {
1829
- readonly _brand: "WorktreePath";
1830
- };
1831
- /**
1832
- * Branded type for commit hashes.
1833
- */
1834
- type CommitHash = string & {
1835
- readonly _brand: "CommitHash";
1836
- };
1837
- /**
1838
- * Branded type for PR URLs.
1839
- */
1840
- type PrUrl = string & {
1841
- readonly _brand: "PrUrl";
1842
- };
1843
- /**
1844
- * Information about a worktree.
1845
- */
1846
- interface WorktreeInfo {
1847
- readonly path: WorktreePath;
1848
- readonly branch: string;
1849
- readonly sessionId: string;
1850
- }
1851
- /**
1852
- * Service interface for git operations.
1853
- *
1854
- * Provides worktree management for isolated session execution.
1855
- * Each session runs in its own worktree with a dedicated branch.
1856
- *
1857
- * @example
1858
- * ```typescript
1859
- * const git = yield* Git;
1860
- *
1861
- * // Create worktree for a session
1862
- * const worktreePath = yield* git.createWorktree("calm-snails-dream-123");
1863
- *
1864
- * // Execute work in worktree...
1865
- *
1866
- * // Commit changes
1867
- * yield* git.commitChanges("calm-snails-dream-123", "feat: complete task 1");
1868
- *
1869
- * // Cleanup when done
1870
- * yield* git.removeWorktree("calm-snails-dream-123");
1871
- * ```
1872
- */
1873
- interface GitService {
1874
- /**
1875
- * Create a new worktree for a session.
1876
- *
1877
- * Creates a worktree at `.ferix/worktrees/{sessionId}` with a new branch
1878
- * `ferix/{sessionId}` based on the current HEAD or specified base branch.
1879
- *
1880
- * @param sessionId - Session ID to create worktree for
1881
- * @param baseBranch - Optional branch to base the worktree on (defaults to HEAD)
1882
- * @returns Path to the created worktree
1883
- */
1884
- readonly createWorktree: (sessionId: string, baseBranch?: string) => Effect.Effect<WorktreePath, GitError>;
1885
- /**
1886
- * Remove a worktree for a session.
1887
- *
1888
- * Removes the worktree directory and cleans up git references.
1889
- *
1890
- * @param sessionId - Session ID whose worktree to remove
1891
- */
1892
- readonly removeWorktree: (sessionId: string) => Effect.Effect<void, GitError>;
1893
- /**
1894
- * Get the worktree path for a session if it exists.
1895
- *
1896
- * @param sessionId - Session ID to check
1897
- * @returns Worktree path if exists, undefined otherwise
1898
- */
1899
- readonly getWorktreePath: (sessionId: string) => Effect.Effect<WorktreePath | undefined, GitError>;
1900
- /**
1901
- * Commit all changes in a session's worktree.
1902
- *
1903
- * Stages all changes and creates a commit with the given message.
1904
- *
1905
- * @param sessionId - Session ID whose worktree to commit
1906
- * @param message - Commit message
1907
- * @returns The commit hash
1908
- */
1909
- readonly commitChanges: (sessionId: string, message: string) => Effect.Effect<CommitHash, GitError>;
1910
- /**
1911
- * Push the session's branch to the remote.
1912
- *
1913
- * @param sessionId - Session ID whose branch to push
1914
- */
1915
- readonly pushBranch: (sessionId: string) => Effect.Effect<void, GitError>;
1916
- /**
1917
- * Create a pull request for the session's branch.
1918
- *
1919
- * Uses `gh` CLI to create a PR.
1920
- *
1921
- * @param sessionId - Session ID whose branch to create PR for
1922
- * @param title - PR title
1923
- * @param body - PR body/description
1924
- * @returns URL of the created PR
1925
- */
1926
- readonly createPR: (sessionId: string, title: string, body: string) => Effect.Effect<PrUrl, GitError>;
1927
- /**
1928
- * Get the branch name for a session.
1929
- *
1930
- * @param sessionId - Session ID
1931
- * @returns Branch name (e.g., "ferix/calm-snails-dream-123")
1932
- */
1933
- readonly getBranchName: (sessionId: string) => string;
1934
- }
1935
- declare const Git_base: Context.TagClass<Git, "@ferix/Git", GitService>;
1936
- /**
1937
- * Effect Tag for the Git service.
1938
- *
1939
- * Use this tag to depend on git operations without coupling to a specific implementation.
1940
- */
1941
- declare class Git extends Git_base {
1942
- }
1943
-
1944
- /**
1945
- * FileSystemGit namespace containing the Live layer.
1946
- */
1947
- declare const FileSystemGit: {
1948
- readonly Live: Layer.Layer<Git, never, never>;
1949
- };
1950
-
1951
- /**
1952
- * Creates a Layer for an in-memory git service.
1953
- *
1954
- * Each call creates a new isolated store.
1955
- *
1956
- * @example
1957
- * ```typescript
1958
- * const testLayer = MemoryGit.layer();
1959
- *
1960
- * const program = Effect.gen(function* () {
1961
- * const git = yield* Git;
1962
- * const path = yield* git.createWorktree("test-session");
1963
- * return path;
1964
- * });
1965
- *
1966
- * Effect.runPromise(program.pipe(Effect.provide(testLayer)));
1967
- * ```
1968
- */
1969
- declare function layer$4(): Layer.Layer<Git>;
1970
- /**
1971
- * MemoryGit namespace containing the Live layer and factory.
1972
- */
1973
- declare const MemoryGit: {
1974
- readonly Live: Layer.Layer<Git, never, never>;
1975
- readonly layer: typeof layer$4;
1976
- };
1977
-
1978
- /**
1979
- * Service interface for guardrails persistence.
1980
- *
1981
- * Guardrails are stored at `.ferix/plans/:sessionId/guardrails.md`.
1982
- * They represent failure patterns learned from previous iterations
1983
- * that the LLM should avoid.
1984
- *
1985
- * Implementations include:
1986
- * - FileSystem: Persists to `.ferix/plans/` directory
1987
- * - Memory: In-memory storage for testing
1988
- *
1989
- * @example
1990
- * ```typescript
1991
- * const guardrailsStore = yield* GuardrailsStore;
1992
- *
1993
- * // Add a guardrail
1994
- * yield* guardrailsStore.add(sessionId, {
1995
- * id: "gr-1",
1996
- * createdAt: new Date().toISOString(),
1997
- * iteration: 3,
1998
- * pattern: "Modifying package.json without running install",
1999
- * sign: "Build failures after dependency changes",
2000
- * avoidance: "Always run npm install after modifying package.json",
2001
- * severity: "critical",
2002
- * });
2003
- *
2004
- * // Load all guardrails
2005
- * const guardrails = yield* guardrailsStore.load(sessionId);
2006
- *
2007
- * // Get active guardrails for prompt
2008
- * const active = yield* guardrailsStore.getActive(sessionId);
2009
- * ```
2010
- */
2011
- interface GuardrailsStoreService {
2012
- /**
2013
- * Add a guardrail to the session's collection.
2014
- *
2015
- * @param sessionId - Session this guardrail belongs to
2016
- * @param guardrail - Guardrail to add
2017
- */
2018
- readonly add: (sessionId: string, guardrail: Guardrail) => Effect.Effect<void, GuardrailsStoreError>;
2019
- /**
2020
- * Load the complete guardrails file for a session.
2021
- *
2022
- * @param sessionId - Session to load guardrails for
2023
- * @returns The guardrails file with all entries
2024
- */
2025
- readonly load: (sessionId: string) => Effect.Effect<GuardrailsFile, GuardrailsStoreError>;
2026
- /**
2027
- * Get all active guardrails for a session.
2028
- *
2029
- * @param sessionId - Session to get guardrails for
2030
- * @returns Array of active guardrails
2031
- */
2032
- readonly getActive: (sessionId: string) => Effect.Effect<readonly Guardrail[], GuardrailsStoreError>;
2033
- }
2034
- declare const GuardrailsStore_base: Context.TagClass<GuardrailsStore, "@ferix/GuardrailsStore", GuardrailsStoreService>;
2035
- /**
2036
- * Effect Tag for the GuardrailsStore service.
2037
- *
2038
- * Use this tag to depend on guardrails storage without coupling to a specific backend.
2039
- */
2040
- declare class GuardrailsStore extends GuardrailsStore_base {
2041
- }
2042
-
2043
- /**
2044
- * FileSystemGuardrails namespace containing the Live layer.
2045
- */
2046
- declare const FileSystemGuardrails: {
2047
- readonly Live: Layer.Layer<GuardrailsStore, never, never>;
2048
- };
2049
-
2050
- /**
2051
- * Creates a Layer for an in-memory guardrails store.
2052
- *
2053
- * Each call creates a new isolated store.
2054
- *
2055
- * @example
2056
- * ```typescript
2057
- * const testLayer = MemoryGuardrails.layer();
2058
- *
2059
- * const program = Effect.gen(function* () {
2060
- * const guardrailsStore = yield* GuardrailsStore;
2061
- * yield* guardrailsStore.add(sessionId, guardrail);
2062
- * });
2063
- *
2064
- * Effect.runPromise(program.pipe(Effect.provide(testLayer)));
2065
- * ```
2066
- */
2067
- declare function layer$3(): Layer.Layer<GuardrailsStore>;
2068
- /**
2069
- * MemoryGuardrails namespace containing the Live layer and factory.
2070
- */
2071
- declare const MemoryGuardrails: {
2072
- readonly Live: Layer.Layer<GuardrailsStore, never, never>;
2073
- readonly layer: typeof layer$3;
2074
- };
2075
-
2076
- /**
2077
- * ClaudeCLI namespace containing the Live layer.
2078
- */
2079
- declare const ClaudeCLI: {
2080
- readonly Live: Layer.Layer<LLM, never, never>;
2081
- };
2082
-
2083
- /**
2084
- * Service interface for plan persistence.
2085
- *
2086
- * Plans are stored per session at `.ferix/plans/:sessionId/task-N.md`.
2087
- * Each task gets its own file that is updated across iterations.
2088
- *
2089
- * Implementations include:
2090
- * - FileSystem: Persists to `.ferix/plans/` directory
2091
- * - Memory: In-memory storage for testing
2092
- *
2093
- * @example
2094
- * ```typescript
2095
- * const planStore = yield* PlanStore;
2096
- *
2097
- * // Create a new plan
2098
- * const planId = yield* planStore.create(sessionId, plan);
2099
- *
2100
- * // Update after iteration
2101
- * yield* planStore.update(planId, updatedPlan);
2102
- *
2103
- * // Load existing plan
2104
- * const plan = yield* planStore.load(planId);
2105
- * ```
2106
- */
2107
- interface PlanStoreService {
2108
- /**
2109
- * Create a new plan for a session.
2110
- *
2111
- * @param sessionId - Session this plan belongs to
2112
- * @param plan - Plan to persist
2113
- * @returns The generated plan ID
2114
- */
2115
- readonly create: (sessionId: string, plan: Omit<Plan, "id">) => Effect.Effect<PlanId, PlanStoreError>;
2116
- /**
2117
- * Load a plan by ID.
2118
- *
2119
- * @param planId - ID of the plan to load
2120
- * @param sessionId - Optional session ID for O(1) lookup. If not provided, searches all sessions.
2121
- * @returns The loaded plan
2122
- */
2123
- readonly load: (planId: PlanId, sessionId?: string) => Effect.Effect<Plan, PlanStoreError>;
2124
- /**
2125
- * Update an existing plan.
2126
- *
2127
- * @param planId - ID of the plan to update
2128
- * @param plan - Updated plan data
2129
- */
2130
- readonly update: (planId: PlanId, plan: Plan) => Effect.Effect<void, PlanStoreError>;
2131
- /**
2132
- * List all plans for a session.
2133
- *
2134
- * @param sessionId - Session to list plans for
2135
- * @returns Array of plan IDs
2136
- */
2137
- readonly list: (sessionId: string) => Effect.Effect<readonly PlanId[], PlanStoreError>;
2138
- }
2139
- declare const PlanStore_base: Context.TagClass<PlanStore, "@ferix/PlanStore", PlanStoreService>;
2140
- /**
2141
- * Effect Tag for the PlanStore service.
2142
- *
2143
- * Use this tag to depend on plan storage without coupling to a specific backend.
2144
- */
2145
- declare class PlanStore extends PlanStore_base {
2146
- }
2147
-
2148
- /**
2149
- * FileSystemPlan namespace containing the Live layer.
2150
- */
2151
- declare const FileSystemPlan: {
2152
- readonly Live: Layer.Layer<PlanStore, never, never>;
2153
- };
2154
-
2155
- /**
2156
- * Creates a Layer for an in-memory plan store.
2157
- *
2158
- * Each call creates a new isolated store.
2159
- *
2160
- * @example
2161
- * ```typescript
2162
- * const testLayer = MemoryPlan.layer();
2163
- *
2164
- * const program = Effect.gen(function* () {
2165
- * const planStore = yield* PlanStore;
2166
- * const planId = yield* planStore.create(sessionId, plan);
2167
- * return planId;
2168
- * });
2169
- *
2170
- * Effect.runPromise(program.pipe(Effect.provide(testLayer)));
2171
- * ```
2172
- */
2173
- declare function layer$2(): Layer.Layer<PlanStore>;
2174
- /**
2175
- * MemoryPlan namespace containing the Live layer and factory.
2176
- */
2177
- declare const MemoryPlan: {
2178
- readonly Live: Layer.Layer<PlanStore, never, never>;
2179
- readonly layer: typeof layer$2;
2180
- };
2181
-
2182
- /**
2183
- * Service interface for progress persistence.
2184
- *
2185
- * Progress is stored as an append-only log at `.ferix/plans/:sessionId/progress.md`.
2186
- * Each iteration appends entries recording what happened.
2187
- *
2188
- * Implementations include:
2189
- * - FileSystem: Persists to `.ferix/plans/` directory
2190
- * - Memory: In-memory storage for testing
2191
- *
2192
- * @example
2193
- * ```typescript
2194
- * const progressStore = yield* ProgressStore;
2195
- *
2196
- * // Append a progress entry
2197
- * yield* progressStore.append(sessionId, {
2198
- * iteration: 1,
2199
- * timestamp: new Date().toISOString(),
2200
- * taskId: "task-1",
2201
- * action: "started",
2202
- * summary: "Started implementing feature X",
2203
- * });
2204
- *
2205
- * // Load all progress
2206
- * const progress = yield* progressStore.load(sessionId);
2207
- *
2208
- * // Get recent entries
2209
- * const recent = yield* progressStore.getRecent(sessionId, 5);
2210
- * ```
2211
- */
2212
- interface ProgressStoreService {
2213
- /**
2214
- * Append a progress entry to the session's log.
2215
- *
2216
- * @param sessionId - Session this entry belongs to
2217
- * @param entry - Progress entry to append
2218
- */
2219
- readonly append: (sessionId: string, entry: ProgressEntry) => Effect.Effect<void, ProgressStoreError>;
2220
- /**
2221
- * Load the complete progress file for a session.
2222
- *
2223
- * @param sessionId - Session to load progress for
2224
- * @returns The progress file with all entries
2225
- */
2226
- readonly load: (sessionId: string) => Effect.Effect<ProgressFile, ProgressStoreError>;
2227
- /**
2228
- * Get the most recent progress entries for a session.
2229
- *
2230
- * @param sessionId - Session to get progress for
2231
- * @param count - Number of recent entries to return
2232
- * @returns Array of recent progress entries
2233
- */
2234
- readonly getRecent: (sessionId: string, count: number) => Effect.Effect<readonly ProgressEntry[], ProgressStoreError>;
2235
- }
2236
- declare const ProgressStore_base: Context.TagClass<ProgressStore, "@ferix/ProgressStore", ProgressStoreService>;
2237
- /**
2238
- * Effect Tag for the ProgressStore service.
2239
- *
2240
- * Use this tag to depend on progress storage without coupling to a specific backend.
2241
- */
2242
- declare class ProgressStore extends ProgressStore_base {
2243
- }
2244
-
2245
- /**
2246
- * FileSystemProgress namespace containing the Live layer.
2247
- */
2248
- declare const FileSystemProgress: {
2249
- readonly Live: Layer.Layer<ProgressStore, never, never>;
2250
- };
2251
-
2252
- /**
2253
- * Creates a Layer for an in-memory progress store.
2254
- *
2255
- * Each call creates a new isolated store.
2256
- *
2257
- * @example
2258
- * ```typescript
2259
- * const testLayer = MemoryProgress.layer();
2260
- *
2261
- * const program = Effect.gen(function* () {
2262
- * const progressStore = yield* ProgressStore;
2263
- * yield* progressStore.append(sessionId, entry);
2264
- * });
2265
- *
2266
- * Effect.runPromise(program.pipe(Effect.provide(testLayer)));
2267
- * ```
2268
- */
2269
- declare function layer$1(): Layer.Layer<ProgressStore>;
2270
- /**
2271
- * MemoryProgress namespace containing the Live layer and factory.
2272
- */
2273
- declare const MemoryProgress: {
2274
- readonly Live: Layer.Layer<ProgressStore, never, never>;
2275
- readonly layer: typeof layer$1;
2276
- };
2277
-
2278
- /**
2279
- * Service interface for session persistence.
2280
- *
2281
- * Sessions track execution state across runs, enabling:
2282
- * - Resumption of interrupted loops
2283
- * - Progress tracking across tasks
2284
- * - Context building from completed work
2285
- *
2286
- * @example
2287
- * ```typescript
2288
- * const sessionStore = yield* SessionStore;
2289
- *
2290
- * // Start a new session
2291
- * const session = yield* sessionStore.create("Implement auth feature");
2292
- *
2293
- * // Update progress
2294
- * yield* sessionStore.update(session.id, {
2295
- * ...session,
2296
- * currentTaskId: "1",
2297
- * });
2298
- *
2299
- * // Mark task complete
2300
- * yield* sessionStore.update(session.id, {
2301
- * ...session,
2302
- * completedTasks: [...session.completedTasks, "1"],
2303
- * });
2304
- * ```
2305
- */
2306
- interface SessionStoreService {
2307
- /**
2308
- * Create a new session.
2309
- *
2310
- * @param originalTask - The task that initiated this session
2311
- * @returns The created session with a generated ID
2312
- */
2313
- readonly create: (originalTask: string) => Effect.Effect<Session, SessionStoreError>;
2314
- /**
2315
- * Get an existing session by ID.
2316
- *
2317
- * @param sessionId - ID of the session to retrieve
2318
- * @returns The session, or error if not found
2319
- */
2320
- readonly get: (sessionId: string) => Effect.Effect<Session, SessionStoreError>;
2321
- /**
2322
- * Update an existing session.
2323
- *
2324
- * @param sessionId - ID of the session to update
2325
- * @param session - Updated session data
2326
- */
2327
- readonly update: (sessionId: string, session: Session) => Effect.Effect<void, SessionStoreError>;
2328
- }
2329
- declare const SessionStore_base: Context.TagClass<SessionStore, "@ferix/SessionStore", SessionStoreService>;
2330
- /**
2331
- * Effect Tag for the SessionStore service.
2332
- *
2333
- * Use this tag to depend on session storage without coupling to a specific backend.
2334
- */
2335
- declare class SessionStore extends SessionStore_base {
2336
- }
2337
-
2338
- /**
2339
- * FileSystemSession namespace containing the Live layer.
2340
- */
2341
- declare const FileSystemSession: {
2342
- readonly Live: Layer.Layer<SessionStore, never, never>;
2343
- };
2344
-
2345
- /**
2346
- * Creates a Layer for an in-memory session store.
2347
- *
2348
- * Each call creates a new isolated store.
2349
- *
2350
- * @example
2351
- * ```typescript
2352
- * const testLayer = MemorySession.layer();
2353
- *
2354
- * const program = Effect.gen(function* () {
2355
- * const sessionStore = yield* SessionStore;
2356
- * const session = yield* sessionStore.create("Test task");
2357
- * return session;
2358
- * });
2359
- *
2360
- * Effect.runPromise(program.pipe(Effect.provide(testLayer)));
2361
- * ```
2362
- */
2363
- declare function layer(): Layer.Layer<SessionStore>;
2364
- /**
2365
- * MemorySession namespace containing the Live layer and factory.
2366
- */
2367
- declare const MemorySession: {
2368
- readonly Live: Layer.Layer<SessionStore, never, never>;
2369
- readonly layer: typeof layer;
2370
- };
2371
-
2372
- /**
2373
- * Accumulator for parsing signals across multiple text chunks.
2374
- *
2375
- * LLM output arrives in chunks, and signals may span multiple chunks.
2376
- * The accumulator buffers text and extracts complete signals.
2377
- */
2378
- interface SignalAccumulator {
2379
- /**
2380
- * Feed a text chunk to the accumulator.
2381
- *
2382
- * @param text - Text chunk from LLM output
2383
- * @returns Array of complete signals found in the accumulated text
2384
- */
2385
- readonly feed: (text: string) => Effect.Effect<readonly Signal[], ParseError>;
2386
- /**
2387
- * Flush any remaining buffered text and extract final signals.
2388
- *
2389
- * Call this when the LLM stream ends to ensure no signals are lost.
2390
- *
2391
- * @returns Array of signals found in remaining buffer
2392
- */
2393
- readonly flush: () => Effect.Effect<readonly Signal[], ParseError>;
2394
- }
2395
- /**
2396
- * Service interface for parsing signals from LLM output.
2397
- *
2398
- * Signals are structured XML-like tags embedded in LLM output:
2399
- * - `<ferix:tasks>...</ferix:tasks>` - Task definitions
2400
- * - `<ferix:phase-start id="1.1"/>` - Phase lifecycle
2401
- * - `<ferix:criterion-passed id="1.c1"/>` - Criterion verification
2402
- *
2403
- * @example
2404
- * ```typescript
2405
- * const parser = yield* SignalParser;
2406
- * const accumulator = yield* parser.createAccumulator();
2407
- *
2408
- * for (const chunk of textChunks) {
2409
- * const signals = yield* accumulator.feed(chunk);
2410
- * for (const signal of signals) {
2411
- * // Handle signal
2412
- * }
2413
- * }
2414
- *
2415
- * const finalSignals = yield* accumulator.flush();
2416
- * ```
2417
- */
2418
- interface SignalParserService {
2419
- /**
2420
- * Parse a complete text and extract all signals.
2421
- *
2422
- * Use this for parsing complete output. For streaming, use createAccumulator.
2423
- *
2424
- * @param text - Complete text to parse
2425
- * @returns Array of signals found in the text
2426
- */
2427
- readonly parse: (text: string) => Effect.Effect<readonly Signal[], ParseError>;
2428
- /**
2429
- * Create a stateful accumulator for streaming signal parsing.
2430
- *
2431
- * The accumulator handles partial signals that span multiple chunks.
2432
- *
2433
- * @returns An accumulator instance for incremental parsing
2434
- */
2435
- readonly createAccumulator: () => Effect.Effect<SignalAccumulator>;
2436
- }
2437
- declare const SignalParser_base: Context.TagClass<SignalParser, "@ferix/SignalParser", SignalParserService>;
2438
- /**
2439
- * Effect Tag for the SignalParser service.
2440
- *
2441
- * Use this tag to depend on signal parsing without coupling to a specific implementation.
2442
- */
2443
- declare class SignalParser extends SignalParser_base {
2444
- }
2445
-
2446
- /**
2447
- * FerixParser namespace containing the Live layer.
2448
- */
2449
- declare const FerixParser: {
2450
- readonly Live: Layer.Layer<SignalParser, never, never>;
2451
- };
2452
-
2453
- /**
2454
- * Production layer bundle.
2455
- *
2456
- * Uses real implementations:
2457
- * - Claude CLI for LLM
2458
- * - Ferix parser for signals
2459
- * - File system for plan, session, progress, guardrails, and git storage
2460
- *
2461
- * @example
2462
- * ```typescript
2463
- * const program = runLoop(config);
2464
- *
2465
- * Effect.runPromise(
2466
- * program.pipe(
2467
- * Stream.runForEach(console.log),
2468
- * Effect.provide(ProductionLayers)
2469
- * )
2470
- * );
2471
- * ```
2472
- */
2473
- declare const ProductionLayers: Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
2474
- /**
2475
- * Test layer bundle.
2476
- *
2477
- * Uses mock/in-memory implementations:
2478
- * - Mock LLM (configurable events)
2479
- * - Ferix parser (real implementation - pure)
2480
- * - In-memory plan, session, progress, guardrails, and git storage
2481
- *
2482
- * @example
2483
- * ```typescript
2484
- * const testProgram = runLoop(config);
2485
- *
2486
- * const result = await Effect.runPromise(
2487
- * testProgram.pipe(
2488
- * Stream.runCollect,
2489
- * Effect.provide(TestLayers)
2490
- * )
2491
- * );
2492
- *
2493
- * expect(result).toContainEqual({ _tag: "LoopCompleted", ... });
2494
- * ```
2495
- */
2496
- declare const TestLayers: Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
2497
- /**
2498
- * Creates a test layer bundle with custom mock LLM events.
2499
- *
2500
- * @param events - Events to emit from the mock LLM
2501
- * @returns A layer bundle for testing with the specified events
2502
- *
2503
- * @example
2504
- * ```typescript
2505
- * const customTestLayers = createTestLayers([
2506
- * { _tag: "Text", text: "<ferix:tasks>...</ferix:tasks>" },
2507
- * { _tag: "Done", output: "..." },
2508
- * ]);
2509
- *
2510
- * Effect.runPromise(program.pipe(Effect.provide(customTestLayers)));
2511
- * ```
2512
- */
2513
- declare function createTestLayers(events: Parameters<typeof Mock.layer>[0]["events"]): Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
2514
-
2515
- /**
2516
- * Required services for the orchestrator.
2517
- * Now includes ProgressStore, GuardrailsStore, and Git for worktree support.
2518
- */
2519
- type OrchestratorServices = LLM | SignalParser | PlanStore | SessionStore | ProgressStore | GuardrailsStore | Git;
2520
- /**
2521
- * Run the ralph loop.
2522
- *
2523
- * Returns a Stream of DomainEvents that ANY consumer can subscribe to.
2524
- * The orchestrator has NO knowledge of how events are consumed.
2525
- *
2526
- * @param config - Loop configuration
2527
- * @returns Stream of domain events
2528
- *
2529
- * @example TUI consumption
2530
- * ```typescript
2531
- * const events = runLoop(config);
2532
- * await events.pipe(
2533
- * Stream.runForEach((event) => tui.render(event)),
2534
- * Effect.provide(ProductionLayers),
2535
- * Effect.runPromise
2536
- * );
2537
- * ```
2538
- *
2539
- * @example Web consumption
2540
- * ```typescript
2541
- * const events = runLoop(config);
2542
- * await events.pipe(
2543
- * Stream.runForEach((event) => websocket.send(JSON.stringify(event))),
2544
- * Effect.provide(ProductionLayers),
2545
- * Effect.runPromise
2546
- * );
2547
- * ```
2548
- *
2549
- * @example Collecting events for testing
2550
- * ```typescript
2551
- * const events = runLoop(config);
2552
- * const collected = await events.pipe(
2553
- * Stream.runCollect,
2554
- * Effect.provide(TestLayers),
2555
- * Effect.runPromise
2556
- * );
2557
- * expect(collected).toContainEqual({ _tag: "LoopStarted", ... });
2558
- * ```
2559
- */
2560
- declare function runLoop(config: LoopConfig): Stream.Stream<DomainEvent, never, OrchestratorServices>;
2561
-
2562
- /**
2563
- * Builds the iteration prompt with context and instructions.
2564
- *
2565
- * @param config - Loop configuration
2566
- * @param iteration - Current iteration number
2567
- * @param plan - Current plan state (if available)
2568
- * @returns The complete prompt for this iteration
2569
- */
2570
- declare function buildPrompt(config: LoopConfig, iteration: number, plan?: Plan): string;
2571
-
2572
- /**
2573
- * Options for running the ralph loop program.
2574
- */
2575
- interface RunOptions {
2576
- /**
2577
- * Loop configuration.
2578
- */
2579
- readonly config: LoopConfig;
2580
- /**
2581
- * Consumer type for output.
2582
- * - "tui": Full-screen terminal UI
2583
- * - "headless": Simple console logging
2584
- * - "none": No output (for programmatic use)
2585
- *
2586
- * @default "headless"
2587
- */
2588
- readonly consumer?: ConsumerType;
2589
- /**
2590
- * Optional callback for each domain event.
2591
- * Called in addition to the selected consumer.
2592
- */
2593
- readonly onEvent?: (event: DomainEvent) => void;
2594
- }
2595
- /**
2596
- * Run the ralph loop with production layers.
2597
- *
2598
- * This is the main entry point for running a ralph loop.
2599
- * It composes all services and consumers into a single Effect program.
2600
- *
2601
- * @param options - Run options including config and consumer type
2602
- * @returns Effect that completes when the loop finishes
2603
- *
2604
- * @example Basic usage
2605
- * ```typescript
2606
- * await run({
2607
- * config: {
2608
- * task: "Implement the feature",
2609
- * maxIterations: 3,
2610
- * verifyCommands: ["bun test"],
2611
- * },
2612
- * consumer: "tui",
2613
- * }).pipe(Effect.runPromise);
2614
- * ```
2615
- *
2616
- * @example With event callback
2617
- * ```typescript
2618
- * await run({
2619
- * config: { task: "Fix the bug", maxIterations: 1, verifyCommands: [] },
2620
- * consumer: "headless",
2621
- * onEvent: (event) => {
2622
- * if (event._tag === "TaskCompleted") {
2623
- * console.log("Task done:", event.taskId);
2624
- * }
2625
- * },
2626
- * }).pipe(Effect.runPromise);
2627
- * ```
2628
- */
2629
- declare function run(options: RunOptions): Effect.Effect<void, unknown, never>;
2630
- /**
2631
- * Run the ralph loop with test layers.
2632
- *
2633
- * Uses mock LLM and in-memory storage for testing.
2634
- *
2635
- * @param options - Run options including config
2636
- * @param mockEvents - Optional custom mock events
2637
- * @returns Effect that completes when the loop finishes
2638
- *
2639
- * @example
2640
- * ```typescript
2641
- * const mockEvents: LLMEvent[] = [
2642
- * { _tag: "Text", text: "<ferix:tasks><task id=\"1\">Test</task></ferix:tasks>" },
2643
- * { _tag: "Done", output: "..." },
2644
- * ];
2645
- *
2646
- * await runTest(
2647
- * { config: { task: "test", maxIterations: 1, verifyCommands: [] } },
2648
- * mockEvents
2649
- * ).pipe(Effect.runPromise);
2650
- * ```
2651
- */
2652
- declare function runTest(options: Omit<RunOptions, "consumer">, mockEvents?: readonly LLMEvent[]): Effect.Effect<void, unknown, never>;
2653
- /**
2654
- * Collect all events from a ralph loop run.
2655
- *
2656
- * Useful for testing to get all emitted events.
2657
- *
2658
- * @param config - Loop configuration
2659
- * @param mockEvents - Optional custom mock events
2660
- * @returns Array of all domain events emitted
2661
- *
2662
- * @example
2663
- * ```typescript
2664
- * const events = await collectEvents(config, mockEvents).pipe(Effect.runPromise);
2665
- * expect(events).toContainEqual({ _tag: "LoopStarted", ... });
2666
- * ```
2667
- */
2668
- declare function collectEvents(config: LoopConfig, mockEvents?: readonly LLMEvent[]): Effect.Effect<readonly DomainEvent[], unknown, never>;
2669
- /**
2670
- * Main CLI entry point.
2671
- *
2672
- * Automatically selects TUI for TTY, headless otherwise.
2673
- *
2674
- * @param config - Loop configuration
2675
- * @returns Promise that resolves when the loop completes
2676
- */
2677
- declare function main(config: LoopConfig): Promise<void>;
2678
-
2679
- export { type CheckFailedEvent, CheckFailedEventSchema, type CheckFailedSignal, CheckFailedSignalSchema, type CheckPassedEvent, CheckPassedEventSchema, type CheckPassedSignal, CheckPassedSignalSchema, ClaudeCLI, type CommitHash, type ConsoleLoggerConfig, ConsoleLoggerConfigSchema, type Consumer, type ConsumerType, ConsumerTypeSchema, type CriteriaDefinedData, CriteriaDefinedDataSchema, type CriteriaDefinedEvent, CriteriaDefinedEventSchema, type CriteriaDefinedSignal, CriteriaDefinedSignalSchema, type Criterion, type CriterionBasicInfo, CriterionBasicInfoSchema, type CriterionFailedData, CriterionFailedDataSchema, type CriterionFailedEvent, CriterionFailedEventSchema, type CriterionFailedSignal, CriterionFailedSignalSchema, type CriterionIdData, CriterionIdDataSchema, type CriterionPassedEvent, CriterionPassedEventSchema, type CriterionPassedSignal, CriterionPassedSignalSchema, CriterionSchema, type CriterionStatus, CriterionStatusSchema, type DiscoveryCompletedEvent, DiscoveryCompletedEventSchema, type DiscoveryStartedEvent, DiscoveryStartedEventSchema, type DomainEvent, DomainEventSchema, DomainEventUtils, type DoneEvent, DoneEventSchema, type ExecutionMode, ExecutionModeSchema, type FerixError, FerixParser, type FileLoggerConfig, FileLoggerConfigSchema, FileSystemGit, FileSystemGuardrails, FileSystemPlan, FileSystemProgress, FileSystemSession, type GeneratedTask, type GeneratedTaskList, GeneratedTaskListSchema, GeneratedTaskSchema, type GeneratedTaskStatus, GeneratedTaskStatusSchema, Git, GitError, type GitService, type Guardrail, type GuardrailAddedEvent, GuardrailAddedEventSchema, GuardrailSchema, type GuardrailSeverity, GuardrailSeveritySchema, type GuardrailSignal, GuardrailSignalSchema, type GuardrailsFile, GuardrailsFileSchema, GuardrailsStore, GuardrailsStoreError, type GuardrailsStoreService, type IterationCompletedEvent, IterationCompletedEventSchema, type IterationStartedEvent, IterationStartedEventSchema, LLM, LLMError, type LLMEvent, LLMEventSchema, type LLMExecuteOptions, type LLMService, type LLMTextEvent, LLMTextEventSchema, type LLMToolEndEvent, LLMToolEndEventSchema, type LLMToolStartEvent, LLMToolStartEventSchema, type LLMToolUseEvent, LLMToolUseEventSchema, type LearningCategory, LearningCategorySchema, type LearningRecordedEvent, LearningRecordedEventSchema, type LearningSignal, LearningSignalSchema, type LogEntry, LogEntrySchema, type LogLevel, LogLevelSchema, type LoopCompleteSignal, LoopCompleteSignalSchema, type LoopCompletedEvent, LoopCompletedEventSchema, type LoopConfig, LoopConfigSchema, type LoopError, LoopErrorSchema, type LoopFailedEvent, LoopFailedEventSchema, type LoopStartedEvent, LoopStartedEventSchema, type LoopStatus, LoopStatusSchema, type LoopSummary, LoopSummarySchema, MemoryGit, MemoryGuardrails, MemoryPlan, MemoryProgress, MemorySession, Mock, Mock as MockLLM, OrchestratorError, type OrchestratorServices, ParseError, type Phase, type PhaseBasicInfo, PhaseBasicInfoSchema, type PhaseCompletedEvent, PhaseCompletedEventSchema, type PhaseCompletedSignal, PhaseCompletedSignalSchema, type PhaseFailedData, PhaseFailedDataSchema, type PhaseFailedEvent, PhaseFailedEventSchema, type PhaseFailedSignal, PhaseFailedSignalSchema, type PhaseIdData, PhaseIdDataSchema, type PhasePromptOverrides, PhasePromptOverridesSchema, PhaseSchema, type PhaseStartedEvent, PhaseStartedEventSchema, type PhaseStartedSignal, PhaseStartedSignalSchema, type PhaseStatus, PhaseStatusSchema, type PhasesDefinedData, PhasesDefinedDataSchema, type PhasesDefinedEvent, PhasesDefinedEventSchema, type PhasesDefinedSignal, PhasesDefinedSignalSchema, type Plan, type PlanCreatedEvent, PlanCreatedEventSchema, type PlanData, PlanDataSchema, PlanId, PlanSchema, PlanStore, PlanStoreError, type PlanStoreService, type PlanUpdateFailedEvent, PlanUpdateFailedEventSchema, type PlanUpdatedEvent, PlanUpdatedEventSchema, type PrUrl, ProductionLayers, type ProgressAction, ProgressActionSchema, type ProgressEntry, ProgressEntrySchema, type ProgressFile, ProgressFileSchema, ProgressStore, ProgressStoreError, type ProgressStoreService, type ProgressUpdatedEvent, ProgressUpdatedEventSchema, type PromptConfig, PromptConfigSchema, type ReviewCompleteData, ReviewCompleteDataSchema, type ReviewCompleteEvent, ReviewCompleteEventSchema, type ReviewCompleteSignal, ReviewCompleteSignalSchema, type RunOptions, type RunOptionsData, RunOptionsDataSchema, type Session, SessionSchema, type SessionStatus, SessionStatusSchema, SessionStore, SessionStoreError, type SessionStoreService, type Signal, type SignalAccumulator, SignalParser, type SignalParserService, SignalSchema, type TUICriterion, TUICriterionSchema, type TUICriterionStatus, TUICriterionStatusSchema, type TUIPhase, TUIPhaseSchema, type TUIPhaseStatus, TUIPhaseStatusSchema, type TUIState, TUIStateSchema, type TUITask, TUITaskSchema, type TUITaskStatus, TUITaskStatusSchema, type Task, type TaskBasicInfo, TaskBasicInfoSchema, type TaskCompleteData, TaskCompleteDataSchema, type TaskCompleteSignal, type TaskCompleteSignalData, TaskCompleteSignalDataSchema, TaskCompleteSignalSchema, type TaskCompletedEvent, TaskCompletedEventSchema, TaskSchema, type TaskStatus, TaskStatusSchema, type TasksDefinedData, TasksDefinedDataSchema, type TasksDefinedEvent, TasksDefinedEventSchema, type TasksDefinedSignal, TasksDefinedSignalSchema, TestLayers, type TextEvent, TextEventSchema, type ToolEndEvent, ToolEndEventSchema, type ToolStartEvent, ToolStartEventSchema, type ToolUseEvent, ToolUseEventSchema, type ViewMode, ViewModeSchema, type WorktreeCreatedEvent, WorktreeCreatedEventSchema, type WorktreeInfo, type WorktreePath, type WorktreeRemovedEvent, WorktreeRemovedEventSchema, buildPrompt, collectEvents, createHeadlessConsumer, createTUIConsumer, createTestLayers, decodeGuardrail, decodeGuardrailsFile, decodeLLMEvent, decodeLoopConfig, decodePlan, decodePlanData, decodeProgressEntry, decodeProgressFile, decodeSession, decodeSignal, decodeSignalSync, formatTasksMd, main, parseTasksMd, run, runLoop, runTest };
2
+ export { }