ferix-code 0.0.2-beta.2 → 0.0.2-beta.20
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.
- package/dist/index.d.ts +1891 -27
- package/dist/index.js +3408 -1006
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Schema, Brand, Stream, Effect, Context, Layer } from 'effect';
|
|
1
|
+
import { Schema, Either, Brand, ParseResult, Stream, Effect, Context, Layer } from 'effect';
|
|
2
2
|
import * as effect_Cause from 'effect/Cause';
|
|
3
3
|
import * as effect_Types from 'effect/Types';
|
|
4
4
|
import * as effect_Effect from 'effect/Effect';
|
|
5
5
|
import * as effect_ParseResult from 'effect/ParseResult';
|
|
6
6
|
import * as effect_SchemaAST from 'effect/SchemaAST';
|
|
7
|
+
import * as effect_Layer from 'effect/Layer';
|
|
7
8
|
|
|
8
9
|
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
10
|
readonly _tag: "LLMError";
|
|
@@ -51,6 +52,30 @@ declare class SessionStoreError extends SessionStoreError_base<{
|
|
|
51
52
|
readonly cause?: unknown;
|
|
52
53
|
}> {
|
|
53
54
|
}
|
|
55
|
+
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 & {
|
|
56
|
+
readonly _tag: "ProgressStoreError";
|
|
57
|
+
} & Readonly<A>;
|
|
58
|
+
/**
|
|
59
|
+
* Error that occurs during progress storage operations.
|
|
60
|
+
*/
|
|
61
|
+
declare class ProgressStoreError extends ProgressStoreError_base<{
|
|
62
|
+
readonly message: string;
|
|
63
|
+
readonly operation: "append" | "load" | "getRecent";
|
|
64
|
+
readonly cause?: unknown;
|
|
65
|
+
}> {
|
|
66
|
+
}
|
|
67
|
+
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 & {
|
|
68
|
+
readonly _tag: "GuardrailsStoreError";
|
|
69
|
+
} & Readonly<A>;
|
|
70
|
+
/**
|
|
71
|
+
* Error that occurs during guardrails storage operations.
|
|
72
|
+
*/
|
|
73
|
+
declare class GuardrailsStoreError extends GuardrailsStoreError_base<{
|
|
74
|
+
readonly message: string;
|
|
75
|
+
readonly operation: "add" | "load" | "getActive";
|
|
76
|
+
readonly cause?: unknown;
|
|
77
|
+
}> {
|
|
78
|
+
}
|
|
54
79
|
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 & {
|
|
55
80
|
readonly _tag: "OrchestratorError";
|
|
56
81
|
} & Readonly<A>;
|
|
@@ -63,11 +88,605 @@ declare class OrchestratorError extends OrchestratorError_base<{
|
|
|
63
88
|
readonly cause?: unknown;
|
|
64
89
|
}> {
|
|
65
90
|
}
|
|
91
|
+
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 & {
|
|
92
|
+
readonly _tag: "GitError";
|
|
93
|
+
} & Readonly<A>;
|
|
94
|
+
/**
|
|
95
|
+
* Error that occurs during git operations.
|
|
96
|
+
*/
|
|
97
|
+
declare class GitError extends GitError_base<{
|
|
98
|
+
readonly message: string;
|
|
99
|
+
readonly operation: "createWorktree" | "removeWorktree" | "removeWorktreeKeepBranch" | "commit" | "push" | "createPR" | "renameBranch" | "branchLookup" | "getCurrentBranch" | "status";
|
|
100
|
+
readonly cause?: unknown;
|
|
101
|
+
}> {
|
|
102
|
+
}
|
|
103
|
+
declare const TokenBudgetError_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 & {
|
|
104
|
+
readonly _tag: "TokenBudgetError";
|
|
105
|
+
} & Readonly<A>;
|
|
106
|
+
/**
|
|
107
|
+
* Error that occurs when token budget is exceeded.
|
|
108
|
+
*/
|
|
109
|
+
declare class TokenBudgetError extends TokenBudgetError_base<{
|
|
110
|
+
readonly message: string;
|
|
111
|
+
/** Total tokens used */
|
|
112
|
+
readonly budgetUsed: number;
|
|
113
|
+
/** Maximum tokens available */
|
|
114
|
+
readonly budgetMax: number;
|
|
115
|
+
/** Sections that couldn't fit */
|
|
116
|
+
readonly overflowSections: readonly string[];
|
|
117
|
+
}> {
|
|
118
|
+
}
|
|
119
|
+
declare const RetryExhaustedError_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 & {
|
|
120
|
+
readonly _tag: "RetryExhaustedError";
|
|
121
|
+
} & Readonly<A>;
|
|
122
|
+
/**
|
|
123
|
+
* Error that occurs when all retry attempts are exhausted.
|
|
124
|
+
*/
|
|
125
|
+
declare class RetryExhaustedError extends RetryExhaustedError_base<{
|
|
126
|
+
readonly message: string;
|
|
127
|
+
/** Number of attempts made */
|
|
128
|
+
readonly attempts: number;
|
|
129
|
+
/** The final error that caused failure */
|
|
130
|
+
readonly finalError: string;
|
|
131
|
+
/** Iteration where retries were exhausted */
|
|
132
|
+
readonly iteration: number;
|
|
133
|
+
}> {
|
|
134
|
+
}
|
|
135
|
+
declare const MetricsError_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 & {
|
|
136
|
+
readonly _tag: "MetricsError";
|
|
137
|
+
} & Readonly<A>;
|
|
138
|
+
/**
|
|
139
|
+
* Error that occurs during metrics operations.
|
|
140
|
+
*/
|
|
141
|
+
declare class MetricsError extends MetricsError_base<{
|
|
142
|
+
readonly message: string;
|
|
143
|
+
readonly operation: "record" | "get" | "clear";
|
|
144
|
+
readonly cause?: unknown;
|
|
145
|
+
}> {
|
|
146
|
+
}
|
|
66
147
|
/**
|
|
67
148
|
* Union of all possible errors in the system.
|
|
68
149
|
*/
|
|
69
|
-
type FerixError = LLMError | ParseError | PlanStoreError | SessionStoreError | OrchestratorError;
|
|
150
|
+
type FerixError = LLMError | ParseError | PlanStoreError | SessionStoreError | ProgressStoreError | GuardrailsStoreError | OrchestratorError | GitError | TokenBudgetError | RetryExhaustedError | MetricsError;
|
|
70
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Text delta event - streamed text content.
|
|
154
|
+
*/
|
|
155
|
+
declare const TextDeltaSchema: Schema.Struct<{
|
|
156
|
+
type: Schema.Literal<["text_delta"]>;
|
|
157
|
+
text: typeof Schema.String;
|
|
158
|
+
}>;
|
|
159
|
+
type TextDelta = typeof TextDeltaSchema.Type;
|
|
160
|
+
/**
|
|
161
|
+
* Input JSON delta - partial tool input being streamed.
|
|
162
|
+
*/
|
|
163
|
+
declare const InputJsonDeltaSchema: Schema.Struct<{
|
|
164
|
+
type: Schema.Literal<["input_json_delta"]>;
|
|
165
|
+
partial_json: typeof Schema.String;
|
|
166
|
+
}>;
|
|
167
|
+
type InputJsonDelta = typeof InputJsonDeltaSchema.Type;
|
|
168
|
+
/**
|
|
169
|
+
* Delta union - either text or input JSON delta.
|
|
170
|
+
*/
|
|
171
|
+
declare const DeltaSchema: Schema.Union<[Schema.Struct<{
|
|
172
|
+
type: Schema.Literal<["text_delta"]>;
|
|
173
|
+
text: typeof Schema.String;
|
|
174
|
+
}>, Schema.Struct<{
|
|
175
|
+
type: Schema.Literal<["input_json_delta"]>;
|
|
176
|
+
partial_json: typeof Schema.String;
|
|
177
|
+
}>]>;
|
|
178
|
+
type Delta = typeof DeltaSchema.Type;
|
|
179
|
+
/**
|
|
180
|
+
* Text content block in an assistant message.
|
|
181
|
+
*/
|
|
182
|
+
declare const TextContentBlockSchema: Schema.Struct<{
|
|
183
|
+
type: Schema.Literal<["text"]>;
|
|
184
|
+
text: typeof Schema.String;
|
|
185
|
+
}>;
|
|
186
|
+
type TextContentBlock = typeof TextContentBlockSchema.Type;
|
|
187
|
+
/**
|
|
188
|
+
* Tool use content block with name and input.
|
|
189
|
+
*/
|
|
190
|
+
declare const ToolUseContentBlockSchema: Schema.Struct<{
|
|
191
|
+
type: Schema.Literal<["tool_use"]>;
|
|
192
|
+
id: Schema.optional<typeof Schema.String>;
|
|
193
|
+
name: typeof Schema.String;
|
|
194
|
+
input: typeof Schema.Unknown;
|
|
195
|
+
}>;
|
|
196
|
+
type ToolUseContentBlock = typeof ToolUseContentBlockSchema.Type;
|
|
197
|
+
/**
|
|
198
|
+
* Content block union for assistant messages.
|
|
199
|
+
*/
|
|
200
|
+
declare const ContentBlockSchema: Schema.Union<[Schema.Struct<{
|
|
201
|
+
type: Schema.Literal<["text"]>;
|
|
202
|
+
text: typeof Schema.String;
|
|
203
|
+
}>, Schema.Struct<{
|
|
204
|
+
type: Schema.Literal<["tool_use"]>;
|
|
205
|
+
id: Schema.optional<typeof Schema.String>;
|
|
206
|
+
name: typeof Schema.String;
|
|
207
|
+
input: typeof Schema.Unknown;
|
|
208
|
+
}>]>;
|
|
209
|
+
type ContentBlock = typeof ContentBlockSchema.Type;
|
|
210
|
+
/**
|
|
211
|
+
* Content block start event - beginning of a content block.
|
|
212
|
+
*/
|
|
213
|
+
declare const ContentBlockStartSchema: Schema.Struct<{
|
|
214
|
+
type: Schema.Literal<["content_block_start"]>;
|
|
215
|
+
index: Schema.optional<typeof Schema.Number>;
|
|
216
|
+
content_block: Schema.Union<[Schema.Struct<{
|
|
217
|
+
type: Schema.Literal<["text"]>;
|
|
218
|
+
text: Schema.optional<typeof Schema.String>;
|
|
219
|
+
}>, Schema.Struct<{
|
|
220
|
+
type: Schema.Literal<["tool_use"]>;
|
|
221
|
+
id: Schema.optional<typeof Schema.String>;
|
|
222
|
+
name: typeof Schema.String;
|
|
223
|
+
input: Schema.optional<typeof Schema.Unknown>;
|
|
224
|
+
}>]>;
|
|
225
|
+
}>;
|
|
226
|
+
type ContentBlockStart = typeof ContentBlockStartSchema.Type;
|
|
227
|
+
/**
|
|
228
|
+
* Content block delta event - incremental update to a content block.
|
|
229
|
+
*/
|
|
230
|
+
declare const ContentBlockDeltaSchema: Schema.Struct<{
|
|
231
|
+
type: Schema.Literal<["content_block_delta"]>;
|
|
232
|
+
index: Schema.optional<typeof Schema.Number>;
|
|
233
|
+
delta: Schema.Union<[Schema.Struct<{
|
|
234
|
+
type: Schema.Literal<["text_delta"]>;
|
|
235
|
+
text: typeof Schema.String;
|
|
236
|
+
}>, Schema.Struct<{
|
|
237
|
+
type: Schema.Literal<["input_json_delta"]>;
|
|
238
|
+
partial_json: typeof Schema.String;
|
|
239
|
+
}>]>;
|
|
240
|
+
}>;
|
|
241
|
+
type ContentBlockDelta = typeof ContentBlockDeltaSchema.Type;
|
|
242
|
+
/**
|
|
243
|
+
* Content block stop event - end of a content block.
|
|
244
|
+
*/
|
|
245
|
+
declare const ContentBlockStopSchema: Schema.Struct<{
|
|
246
|
+
type: Schema.Literal<["content_block_stop"]>;
|
|
247
|
+
index: Schema.optional<typeof Schema.Number>;
|
|
248
|
+
}>;
|
|
249
|
+
type ContentBlockStop = typeof ContentBlockStopSchema.Type;
|
|
250
|
+
/**
|
|
251
|
+
* Assistant message event with full content.
|
|
252
|
+
*/
|
|
253
|
+
declare const AssistantMessageSchema: Schema.Struct<{
|
|
254
|
+
type: Schema.Literal<["assistant"]>;
|
|
255
|
+
message: Schema.Struct<{
|
|
256
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
257
|
+
type: Schema.Literal<["text"]>;
|
|
258
|
+
text: typeof Schema.String;
|
|
259
|
+
}>, Schema.Struct<{
|
|
260
|
+
type: Schema.Literal<["tool_use"]>;
|
|
261
|
+
id: Schema.optional<typeof Schema.String>;
|
|
262
|
+
name: typeof Schema.String;
|
|
263
|
+
input: typeof Schema.Unknown;
|
|
264
|
+
}>]>>;
|
|
265
|
+
}>;
|
|
266
|
+
}>;
|
|
267
|
+
type AssistantMessage = typeof AssistantMessageSchema.Type;
|
|
268
|
+
/**
|
|
269
|
+
* Stream event envelope - CLI wraps streaming events in this format.
|
|
270
|
+
*/
|
|
271
|
+
declare const StreamEventEnvelopeSchema: Schema.Struct<{
|
|
272
|
+
type: Schema.Literal<["stream_event"]>;
|
|
273
|
+
event: typeof Schema.Unknown;
|
|
274
|
+
}>;
|
|
275
|
+
type StreamEventEnvelope = typeof StreamEventEnvelopeSchema.Type;
|
|
276
|
+
/**
|
|
277
|
+
* Union of all Claude/Cursor CLI streaming events.
|
|
278
|
+
*/
|
|
279
|
+
declare const ClaudeCliEventSchema: Schema.Union<[Schema.Struct<{
|
|
280
|
+
type: Schema.Literal<["content_block_start"]>;
|
|
281
|
+
index: Schema.optional<typeof Schema.Number>;
|
|
282
|
+
content_block: Schema.Union<[Schema.Struct<{
|
|
283
|
+
type: Schema.Literal<["text"]>;
|
|
284
|
+
text: Schema.optional<typeof Schema.String>;
|
|
285
|
+
}>, Schema.Struct<{
|
|
286
|
+
type: Schema.Literal<["tool_use"]>;
|
|
287
|
+
id: Schema.optional<typeof Schema.String>;
|
|
288
|
+
name: typeof Schema.String;
|
|
289
|
+
input: Schema.optional<typeof Schema.Unknown>;
|
|
290
|
+
}>]>;
|
|
291
|
+
}>, Schema.Struct<{
|
|
292
|
+
type: Schema.Literal<["content_block_delta"]>;
|
|
293
|
+
index: Schema.optional<typeof Schema.Number>;
|
|
294
|
+
delta: Schema.Union<[Schema.Struct<{
|
|
295
|
+
type: Schema.Literal<["text_delta"]>;
|
|
296
|
+
text: typeof Schema.String;
|
|
297
|
+
}>, Schema.Struct<{
|
|
298
|
+
type: Schema.Literal<["input_json_delta"]>;
|
|
299
|
+
partial_json: typeof Schema.String;
|
|
300
|
+
}>]>;
|
|
301
|
+
}>, Schema.Struct<{
|
|
302
|
+
type: Schema.Literal<["content_block_stop"]>;
|
|
303
|
+
index: Schema.optional<typeof Schema.Number>;
|
|
304
|
+
}>, Schema.Struct<{
|
|
305
|
+
type: Schema.Literal<["assistant"]>;
|
|
306
|
+
message: Schema.Struct<{
|
|
307
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
308
|
+
type: Schema.Literal<["text"]>;
|
|
309
|
+
text: typeof Schema.String;
|
|
310
|
+
}>, Schema.Struct<{
|
|
311
|
+
type: Schema.Literal<["tool_use"]>;
|
|
312
|
+
id: Schema.optional<typeof Schema.String>;
|
|
313
|
+
name: typeof Schema.String;
|
|
314
|
+
input: typeof Schema.Unknown;
|
|
315
|
+
}>]>>;
|
|
316
|
+
}>;
|
|
317
|
+
}>, Schema.Struct<{
|
|
318
|
+
type: Schema.Literal<["stream_event"]>;
|
|
319
|
+
event: typeof Schema.Unknown;
|
|
320
|
+
}>]>;
|
|
321
|
+
type ClaudeCliEvent = typeof ClaudeCliEventSchema.Type;
|
|
322
|
+
/**
|
|
323
|
+
* Type guards using Effect Schema.
|
|
324
|
+
*/
|
|
325
|
+
declare const isContentBlockStart: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
326
|
+
readonly type: "content_block_start";
|
|
327
|
+
readonly index?: number | undefined;
|
|
328
|
+
readonly content_block: {
|
|
329
|
+
readonly type: "text";
|
|
330
|
+
readonly text?: string | undefined;
|
|
331
|
+
} | {
|
|
332
|
+
readonly type: "tool_use";
|
|
333
|
+
readonly input?: unknown;
|
|
334
|
+
readonly id?: string | undefined;
|
|
335
|
+
readonly name: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
declare const isContentBlockDelta: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
339
|
+
readonly type: "content_block_delta";
|
|
340
|
+
readonly index?: number | undefined;
|
|
341
|
+
readonly delta: {
|
|
342
|
+
readonly type: "text_delta";
|
|
343
|
+
readonly text: string;
|
|
344
|
+
} | {
|
|
345
|
+
readonly type: "input_json_delta";
|
|
346
|
+
readonly partial_json: string;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
declare const isContentBlockStop: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
350
|
+
readonly type: "content_block_stop";
|
|
351
|
+
readonly index?: number | undefined;
|
|
352
|
+
};
|
|
353
|
+
declare const isAssistantMessage: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
354
|
+
readonly type: "assistant";
|
|
355
|
+
readonly message: {
|
|
356
|
+
readonly content: readonly ({
|
|
357
|
+
readonly type: "text";
|
|
358
|
+
readonly text: string;
|
|
359
|
+
} | {
|
|
360
|
+
readonly type: "tool_use";
|
|
361
|
+
readonly input: unknown;
|
|
362
|
+
readonly id?: string | undefined;
|
|
363
|
+
readonly name: string;
|
|
364
|
+
})[];
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
declare const isStreamEventEnvelope: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
368
|
+
readonly type: "stream_event";
|
|
369
|
+
readonly event: unknown;
|
|
370
|
+
};
|
|
371
|
+
declare const isTextDelta: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
372
|
+
readonly type: "text_delta";
|
|
373
|
+
readonly text: string;
|
|
374
|
+
};
|
|
375
|
+
declare const isInputJsonDelta: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
376
|
+
readonly type: "input_json_delta";
|
|
377
|
+
readonly partial_json: string;
|
|
378
|
+
};
|
|
379
|
+
declare const isToolUseContentBlock: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
380
|
+
readonly type: "tool_use";
|
|
381
|
+
readonly input: unknown;
|
|
382
|
+
readonly id?: string | undefined;
|
|
383
|
+
readonly name: string;
|
|
384
|
+
};
|
|
385
|
+
declare const isTextContentBlock: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
386
|
+
readonly type: "text";
|
|
387
|
+
readonly text: string;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Decode helpers.
|
|
391
|
+
*/
|
|
392
|
+
declare const decodeClaudeCliEvent: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
393
|
+
readonly type: "content_block_start";
|
|
394
|
+
readonly index?: number | undefined;
|
|
395
|
+
readonly content_block: {
|
|
396
|
+
readonly type: "text";
|
|
397
|
+
readonly text?: string | undefined;
|
|
398
|
+
} | {
|
|
399
|
+
readonly type: "tool_use";
|
|
400
|
+
readonly input?: unknown;
|
|
401
|
+
readonly id?: string | undefined;
|
|
402
|
+
readonly name: string;
|
|
403
|
+
};
|
|
404
|
+
} | {
|
|
405
|
+
readonly type: "content_block_delta";
|
|
406
|
+
readonly index?: number | undefined;
|
|
407
|
+
readonly delta: {
|
|
408
|
+
readonly type: "text_delta";
|
|
409
|
+
readonly text: string;
|
|
410
|
+
} | {
|
|
411
|
+
readonly type: "input_json_delta";
|
|
412
|
+
readonly partial_json: string;
|
|
413
|
+
};
|
|
414
|
+
} | {
|
|
415
|
+
readonly type: "content_block_stop";
|
|
416
|
+
readonly index?: number | undefined;
|
|
417
|
+
} | {
|
|
418
|
+
readonly type: "assistant";
|
|
419
|
+
readonly message: {
|
|
420
|
+
readonly content: readonly ({
|
|
421
|
+
readonly type: "text";
|
|
422
|
+
readonly text: string;
|
|
423
|
+
} | {
|
|
424
|
+
readonly type: "tool_use";
|
|
425
|
+
readonly input: unknown;
|
|
426
|
+
readonly id?: string | undefined;
|
|
427
|
+
readonly name: string;
|
|
428
|
+
})[];
|
|
429
|
+
};
|
|
430
|
+
} | {
|
|
431
|
+
readonly type: "stream_event";
|
|
432
|
+
readonly event: unknown;
|
|
433
|
+
}, effect_ParseResult.ParseError, never>;
|
|
434
|
+
declare const decodeClaudeCliEventSync: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => {
|
|
435
|
+
readonly type: "content_block_start";
|
|
436
|
+
readonly index?: number | undefined;
|
|
437
|
+
readonly content_block: {
|
|
438
|
+
readonly type: "text";
|
|
439
|
+
readonly text?: string | undefined;
|
|
440
|
+
} | {
|
|
441
|
+
readonly type: "tool_use";
|
|
442
|
+
readonly input?: unknown;
|
|
443
|
+
readonly id?: string | undefined;
|
|
444
|
+
readonly name: string;
|
|
445
|
+
};
|
|
446
|
+
} | {
|
|
447
|
+
readonly type: "content_block_delta";
|
|
448
|
+
readonly index?: number | undefined;
|
|
449
|
+
readonly delta: {
|
|
450
|
+
readonly type: "text_delta";
|
|
451
|
+
readonly text: string;
|
|
452
|
+
} | {
|
|
453
|
+
readonly type: "input_json_delta";
|
|
454
|
+
readonly partial_json: string;
|
|
455
|
+
};
|
|
456
|
+
} | {
|
|
457
|
+
readonly type: "content_block_stop";
|
|
458
|
+
readonly index?: number | undefined;
|
|
459
|
+
} | {
|
|
460
|
+
readonly type: "assistant";
|
|
461
|
+
readonly message: {
|
|
462
|
+
readonly content: readonly ({
|
|
463
|
+
readonly type: "text";
|
|
464
|
+
readonly text: string;
|
|
465
|
+
} | {
|
|
466
|
+
readonly type: "tool_use";
|
|
467
|
+
readonly input: unknown;
|
|
468
|
+
readonly id?: string | undefined;
|
|
469
|
+
readonly name: string;
|
|
470
|
+
})[];
|
|
471
|
+
};
|
|
472
|
+
} | {
|
|
473
|
+
readonly type: "stream_event";
|
|
474
|
+
readonly event: unknown;
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Text content event from OpenCode.
|
|
479
|
+
*/
|
|
480
|
+
declare const OpenCodeTextEventSchema: Schema.Struct<{
|
|
481
|
+
type: Schema.Literal<["text"]>;
|
|
482
|
+
text: typeof Schema.String;
|
|
483
|
+
}>;
|
|
484
|
+
type OpenCodeTextEvent = typeof OpenCodeTextEventSchema.Type;
|
|
485
|
+
/**
|
|
486
|
+
* Tool state within a tool_use event.
|
|
487
|
+
*/
|
|
488
|
+
declare const OpenCodeToolStateSchema: Schema.Struct<{
|
|
489
|
+
status: typeof Schema.String;
|
|
490
|
+
input: typeof Schema.Unknown;
|
|
491
|
+
output: Schema.optional<typeof Schema.String>;
|
|
492
|
+
}>;
|
|
493
|
+
type OpenCodeToolState = typeof OpenCodeToolStateSchema.Type;
|
|
494
|
+
/**
|
|
495
|
+
* Tool part within a tool_use event.
|
|
496
|
+
*/
|
|
497
|
+
declare const OpenCodeToolPartSchema: Schema.Struct<{
|
|
498
|
+
tool: typeof Schema.String;
|
|
499
|
+
callID: typeof Schema.String;
|
|
500
|
+
state: Schema.Struct<{
|
|
501
|
+
status: typeof Schema.String;
|
|
502
|
+
input: typeof Schema.Unknown;
|
|
503
|
+
output: Schema.optional<typeof Schema.String>;
|
|
504
|
+
}>;
|
|
505
|
+
}>;
|
|
506
|
+
type OpenCodeToolPart = typeof OpenCodeToolPartSchema.Type;
|
|
507
|
+
/**
|
|
508
|
+
* Tool use event from OpenCode - complete tool invocation with input/output.
|
|
509
|
+
*/
|
|
510
|
+
declare const OpenCodeToolUseEventSchema: Schema.Struct<{
|
|
511
|
+
type: Schema.Literal<["tool_use"]>;
|
|
512
|
+
part: Schema.Struct<{
|
|
513
|
+
tool: typeof Schema.String;
|
|
514
|
+
callID: typeof Schema.String;
|
|
515
|
+
state: Schema.Struct<{
|
|
516
|
+
status: typeof Schema.String;
|
|
517
|
+
input: typeof Schema.Unknown;
|
|
518
|
+
output: Schema.optional<typeof Schema.String>;
|
|
519
|
+
}>;
|
|
520
|
+
}>;
|
|
521
|
+
}>;
|
|
522
|
+
type OpenCodeToolUseEvent = typeof OpenCodeToolUseEventSchema.Type;
|
|
523
|
+
/**
|
|
524
|
+
* Part information in step_start events.
|
|
525
|
+
*/
|
|
526
|
+
declare const OpenCodeStepPartSchema: Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
527
|
+
type OpenCodeStepPart = typeof OpenCodeStepPartSchema.Type;
|
|
528
|
+
/**
|
|
529
|
+
* Step start event from OpenCode.
|
|
530
|
+
*/
|
|
531
|
+
declare const OpenCodeStepStartSchema: Schema.Struct<{
|
|
532
|
+
type: Schema.Literal<["step_start"]>;
|
|
533
|
+
timestamp: typeof Schema.Number;
|
|
534
|
+
sessionID: typeof Schema.String;
|
|
535
|
+
part: Schema.optional<Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
536
|
+
}>;
|
|
537
|
+
type OpenCodeStepStart = typeof OpenCodeStepStartSchema.Type;
|
|
538
|
+
/**
|
|
539
|
+
* Token information in step_finish events.
|
|
540
|
+
*/
|
|
541
|
+
declare const OpenCodeTokensSchema: Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
542
|
+
type OpenCodeTokens = typeof OpenCodeTokensSchema.Type;
|
|
543
|
+
/**
|
|
544
|
+
* Cost information in step_finish events.
|
|
545
|
+
*/
|
|
546
|
+
declare const OpenCodeCostSchema: Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
547
|
+
type OpenCodeCost = typeof OpenCodeCostSchema.Type;
|
|
548
|
+
/**
|
|
549
|
+
* Step finish event from OpenCode.
|
|
550
|
+
*/
|
|
551
|
+
declare const OpenCodeStepFinishSchema: Schema.Struct<{
|
|
552
|
+
type: Schema.Literal<["step_finish"]>;
|
|
553
|
+
tokens: Schema.optional<Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
554
|
+
cost: Schema.optional<Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
555
|
+
}>;
|
|
556
|
+
type OpenCodeStepFinish = typeof OpenCodeStepFinishSchema.Type;
|
|
557
|
+
/**
|
|
558
|
+
* Union of all OpenCode CLI streaming events.
|
|
559
|
+
*/
|
|
560
|
+
declare const OpenCodeCliEventSchema: Schema.Union<[Schema.Struct<{
|
|
561
|
+
type: Schema.Literal<["text"]>;
|
|
562
|
+
text: typeof Schema.String;
|
|
563
|
+
}>, Schema.Struct<{
|
|
564
|
+
type: Schema.Literal<["tool_use"]>;
|
|
565
|
+
part: Schema.Struct<{
|
|
566
|
+
tool: typeof Schema.String;
|
|
567
|
+
callID: typeof Schema.String;
|
|
568
|
+
state: Schema.Struct<{
|
|
569
|
+
status: typeof Schema.String;
|
|
570
|
+
input: typeof Schema.Unknown;
|
|
571
|
+
output: Schema.optional<typeof Schema.String>;
|
|
572
|
+
}>;
|
|
573
|
+
}>;
|
|
574
|
+
}>, Schema.Struct<{
|
|
575
|
+
type: Schema.Literal<["step_start"]>;
|
|
576
|
+
timestamp: typeof Schema.Number;
|
|
577
|
+
sessionID: typeof Schema.String;
|
|
578
|
+
part: Schema.optional<Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
579
|
+
}>, Schema.Struct<{
|
|
580
|
+
type: Schema.Literal<["step_finish"]>;
|
|
581
|
+
tokens: Schema.optional<Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
582
|
+
cost: Schema.optional<Schema.extend<Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
583
|
+
}>]>;
|
|
584
|
+
type OpenCodeCliEvent = typeof OpenCodeCliEventSchema.Type;
|
|
585
|
+
/**
|
|
586
|
+
* Type guards using Effect Schema.
|
|
587
|
+
*/
|
|
588
|
+
declare const isOpenCodeTextEvent: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
589
|
+
readonly type: "text";
|
|
590
|
+
readonly text: string;
|
|
591
|
+
};
|
|
592
|
+
declare const isOpenCodeToolUseEvent: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
593
|
+
readonly type: "tool_use";
|
|
594
|
+
readonly part: {
|
|
595
|
+
readonly tool: string;
|
|
596
|
+
readonly callID: string;
|
|
597
|
+
readonly state: {
|
|
598
|
+
readonly input: unknown;
|
|
599
|
+
readonly status: string;
|
|
600
|
+
readonly output?: string | undefined;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
};
|
|
604
|
+
declare const isOpenCodeStepStart: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
605
|
+
readonly type: "step_start";
|
|
606
|
+
readonly part?: ({} & {
|
|
607
|
+
readonly [x: string]: unknown;
|
|
608
|
+
}) | undefined;
|
|
609
|
+
readonly timestamp: number;
|
|
610
|
+
readonly sessionID: string;
|
|
611
|
+
};
|
|
612
|
+
declare const isOpenCodeStepFinish: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
613
|
+
readonly type: "step_finish";
|
|
614
|
+
readonly tokens?: ({} & {
|
|
615
|
+
readonly [x: string]: unknown;
|
|
616
|
+
}) | undefined;
|
|
617
|
+
readonly cost?: ({} & {
|
|
618
|
+
readonly [x: string]: unknown;
|
|
619
|
+
}) | undefined;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Decode helpers.
|
|
623
|
+
*/
|
|
624
|
+
declare const decodeOpenCodeCliEvent: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
625
|
+
readonly type: "text";
|
|
626
|
+
readonly text: string;
|
|
627
|
+
} | {
|
|
628
|
+
readonly type: "tool_use";
|
|
629
|
+
readonly part: {
|
|
630
|
+
readonly tool: string;
|
|
631
|
+
readonly callID: string;
|
|
632
|
+
readonly state: {
|
|
633
|
+
readonly input: unknown;
|
|
634
|
+
readonly status: string;
|
|
635
|
+
readonly output?: string | undefined;
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
} | {
|
|
639
|
+
readonly type: "step_start";
|
|
640
|
+
readonly part?: ({} & {
|
|
641
|
+
readonly [x: string]: unknown;
|
|
642
|
+
}) | undefined;
|
|
643
|
+
readonly timestamp: number;
|
|
644
|
+
readonly sessionID: string;
|
|
645
|
+
} | {
|
|
646
|
+
readonly type: "step_finish";
|
|
647
|
+
readonly tokens?: ({} & {
|
|
648
|
+
readonly [x: string]: unknown;
|
|
649
|
+
}) | undefined;
|
|
650
|
+
readonly cost?: ({} & {
|
|
651
|
+
readonly [x: string]: unknown;
|
|
652
|
+
}) | undefined;
|
|
653
|
+
}, effect_ParseResult.ParseError, never>;
|
|
654
|
+
declare const decodeOpenCodeCliEventSync: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => {
|
|
655
|
+
readonly type: "text";
|
|
656
|
+
readonly text: string;
|
|
657
|
+
} | {
|
|
658
|
+
readonly type: "tool_use";
|
|
659
|
+
readonly part: {
|
|
660
|
+
readonly tool: string;
|
|
661
|
+
readonly callID: string;
|
|
662
|
+
readonly state: {
|
|
663
|
+
readonly input: unknown;
|
|
664
|
+
readonly status: string;
|
|
665
|
+
readonly output?: string | undefined;
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
} | {
|
|
669
|
+
readonly type: "step_start";
|
|
670
|
+
readonly part?: ({} & {
|
|
671
|
+
readonly [x: string]: unknown;
|
|
672
|
+
}) | undefined;
|
|
673
|
+
readonly timestamp: number;
|
|
674
|
+
readonly sessionID: string;
|
|
675
|
+
} | {
|
|
676
|
+
readonly type: "step_finish";
|
|
677
|
+
readonly tokens?: ({} & {
|
|
678
|
+
readonly [x: string]: unknown;
|
|
679
|
+
}) | undefined;
|
|
680
|
+
readonly cost?: ({} & {
|
|
681
|
+
readonly [x: string]: unknown;
|
|
682
|
+
}) | undefined;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Supported LLM provider names.
|
|
687
|
+
*/
|
|
688
|
+
declare const ProviderNameSchema: Schema.Literal<["claude", "cursor", "opencode"]>;
|
|
689
|
+
type ProviderName = typeof ProviderNameSchema.Type;
|
|
71
690
|
declare const PhasePromptOverridesSchema: Schema.Struct<{
|
|
72
691
|
breakdown: Schema.optional<typeof Schema.String>;
|
|
73
692
|
planning: Schema.optional<typeof Schema.String>;
|
|
@@ -114,6 +733,8 @@ declare const LoopConfigSchema: Schema.Struct<{
|
|
|
114
733
|
}>>;
|
|
115
734
|
additionalContext: Schema.optional<typeof Schema.String>;
|
|
116
735
|
}>>;
|
|
736
|
+
/** LLM provider to use. Defaults to "claude". */
|
|
737
|
+
provider: Schema.optional<Schema.Literal<["claude", "cursor", "opencode"]>>;
|
|
117
738
|
}>;
|
|
118
739
|
type LoopConfig = typeof LoopConfigSchema.Type;
|
|
119
740
|
declare const LoopSummarySchema: Schema.Struct<{
|
|
@@ -122,6 +743,8 @@ declare const LoopSummarySchema: Schema.Struct<{
|
|
|
122
743
|
sessionId: typeof Schema.String;
|
|
123
744
|
completedTasks: Schema.Array$<typeof Schema.String>;
|
|
124
745
|
durationMs: typeof Schema.Number;
|
|
746
|
+
branchPushed: Schema.optional<typeof Schema.Boolean>;
|
|
747
|
+
prUrl: Schema.optional<typeof Schema.String>;
|
|
125
748
|
}>;
|
|
126
749
|
type LoopSummary = typeof LoopSummarySchema.Type;
|
|
127
750
|
declare const LoopErrorSchema: Schema.Struct<{
|
|
@@ -152,6 +775,7 @@ declare const decodeLoopConfig: (u: unknown, overrideOptions?: effect_SchemaAST.
|
|
|
152
775
|
} | undefined;
|
|
153
776
|
readonly additionalContext?: string | undefined;
|
|
154
777
|
} | undefined;
|
|
778
|
+
readonly provider?: "claude" | "cursor" | "opencode" | undefined;
|
|
155
779
|
}, effect_ParseResult.ParseError, never>;
|
|
156
780
|
|
|
157
781
|
/**
|
|
@@ -180,6 +804,7 @@ declare const LoopStartedEventSchema: Schema.TaggedStruct<"LoopStarted", {
|
|
|
180
804
|
}>>;
|
|
181
805
|
additionalContext: Schema.optional<typeof Schema.String>;
|
|
182
806
|
}>>;
|
|
807
|
+
provider: Schema.optional<Schema.Literal<["claude", "cursor", "opencode"]>>;
|
|
183
808
|
}>;
|
|
184
809
|
timestamp: typeof Schema.Number;
|
|
185
810
|
}>;
|
|
@@ -191,6 +816,8 @@ declare const LoopCompletedEventSchema: Schema.TaggedStruct<"LoopCompleted", {
|
|
|
191
816
|
sessionId: typeof Schema.String;
|
|
192
817
|
completedTasks: Schema.Array$<typeof Schema.String>;
|
|
193
818
|
durationMs: typeof Schema.Number;
|
|
819
|
+
branchPushed: Schema.optional<typeof Schema.Boolean>;
|
|
820
|
+
prUrl: Schema.optional<typeof Schema.String>;
|
|
194
821
|
}>;
|
|
195
822
|
}>;
|
|
196
823
|
type LoopCompletedEvent = typeof LoopCompletedEventSchema.Type;
|
|
@@ -393,6 +1020,88 @@ declare const PlanUpdateFailedEventSchema: Schema.TaggedStruct<"PlanUpdateFailed
|
|
|
393
1020
|
planId: Schema.optional<typeof Schema.String>;
|
|
394
1021
|
}>;
|
|
395
1022
|
type PlanUpdateFailedEvent = typeof PlanUpdateFailedEventSchema.Type;
|
|
1023
|
+
/**
|
|
1024
|
+
* Learning recorded event - captures insights discovered during iteration.
|
|
1025
|
+
*/
|
|
1026
|
+
declare const LearningRecordedEventSchema: Schema.TaggedStruct<"LearningRecorded", {
|
|
1027
|
+
iteration: typeof Schema.Number;
|
|
1028
|
+
content: typeof Schema.String;
|
|
1029
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
1030
|
+
timestamp: typeof Schema.Number;
|
|
1031
|
+
}>;
|
|
1032
|
+
type LearningRecordedEvent = typeof LearningRecordedEventSchema.Type;
|
|
1033
|
+
/**
|
|
1034
|
+
* Guardrail added event - captures failure patterns to avoid.
|
|
1035
|
+
*/
|
|
1036
|
+
declare const GuardrailAddedEventSchema: Schema.TaggedStruct<"GuardrailAdded", {
|
|
1037
|
+
id: typeof Schema.String;
|
|
1038
|
+
iteration: typeof Schema.Number;
|
|
1039
|
+
pattern: typeof Schema.String;
|
|
1040
|
+
sign: typeof Schema.String;
|
|
1041
|
+
avoidance: typeof Schema.String;
|
|
1042
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
1043
|
+
timestamp: typeof Schema.Number;
|
|
1044
|
+
}>;
|
|
1045
|
+
type GuardrailAddedEvent = typeof GuardrailAddedEventSchema.Type;
|
|
1046
|
+
/**
|
|
1047
|
+
* Progress updated event - signals that progress file was updated.
|
|
1048
|
+
*/
|
|
1049
|
+
declare const ProgressUpdatedEventSchema: Schema.TaggedStruct<"ProgressUpdated", {
|
|
1050
|
+
sessionId: typeof Schema.String;
|
|
1051
|
+
iteration: typeof Schema.Number;
|
|
1052
|
+
taskId: typeof Schema.String;
|
|
1053
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
1054
|
+
timestamp: typeof Schema.Number;
|
|
1055
|
+
}>;
|
|
1056
|
+
type ProgressUpdatedEvent = typeof ProgressUpdatedEventSchema.Type;
|
|
1057
|
+
/**
|
|
1058
|
+
* Worktree created event - signals that a git worktree was created for the session.
|
|
1059
|
+
*/
|
|
1060
|
+
declare const WorktreeCreatedEventSchema: Schema.TaggedStruct<"WorktreeCreated", {
|
|
1061
|
+
sessionId: typeof Schema.String;
|
|
1062
|
+
worktreePath: typeof Schema.String;
|
|
1063
|
+
branchName: typeof Schema.String;
|
|
1064
|
+
timestamp: typeof Schema.Number;
|
|
1065
|
+
}>;
|
|
1066
|
+
type WorktreeCreatedEvent = typeof WorktreeCreatedEventSchema.Type;
|
|
1067
|
+
/**
|
|
1068
|
+
* Worktree removed event - signals that a git worktree was cleaned up.
|
|
1069
|
+
*/
|
|
1070
|
+
declare const WorktreeRemovedEventSchema: Schema.TaggedStruct<"WorktreeRemoved", {
|
|
1071
|
+
sessionId: typeof Schema.String;
|
|
1072
|
+
timestamp: typeof Schema.Number;
|
|
1073
|
+
}>;
|
|
1074
|
+
type WorktreeRemovedEvent = typeof WorktreeRemovedEventSchema.Type;
|
|
1075
|
+
/**
|
|
1076
|
+
* Branch pushed event - signals that a branch was pushed to origin.
|
|
1077
|
+
*/
|
|
1078
|
+
declare const BranchPushedEventSchema: Schema.TaggedStruct<"BranchPushed", {
|
|
1079
|
+
sessionId: typeof Schema.String;
|
|
1080
|
+
branchName: typeof Schema.String;
|
|
1081
|
+
timestamp: typeof Schema.Number;
|
|
1082
|
+
}>;
|
|
1083
|
+
type BranchPushedEvent = typeof BranchPushedEventSchema.Type;
|
|
1084
|
+
/**
|
|
1085
|
+
* PR created event - signals that a pull request was created.
|
|
1086
|
+
*/
|
|
1087
|
+
declare const PRCreatedEventSchema: Schema.TaggedStruct<"PRCreated", {
|
|
1088
|
+
sessionId: typeof Schema.String;
|
|
1089
|
+
prUrl: typeof Schema.String;
|
|
1090
|
+
title: typeof Schema.String;
|
|
1091
|
+
timestamp: typeof Schema.Number;
|
|
1092
|
+
}>;
|
|
1093
|
+
type PRCreatedEvent = typeof PRCreatedEventSchema.Type;
|
|
1094
|
+
/**
|
|
1095
|
+
* Session name generated event - signals that the LLM generated a descriptive name for the session.
|
|
1096
|
+
* Emitted during the discovery phase after the session name signal is parsed.
|
|
1097
|
+
*/
|
|
1098
|
+
declare const SessionNameGeneratedEventSchema: Schema.TaggedStruct<"SessionNameGenerated", {
|
|
1099
|
+
sessionId: typeof Schema.String;
|
|
1100
|
+
/** Task-based descriptive name (kebab-case slug, e.g., "add-dark-mode-toggle") */
|
|
1101
|
+
displayName: typeof Schema.String;
|
|
1102
|
+
timestamp: typeof Schema.Number;
|
|
1103
|
+
}>;
|
|
1104
|
+
type SessionNameGeneratedEvent = typeof SessionNameGeneratedEventSchema.Type;
|
|
396
1105
|
/**
|
|
397
1106
|
* Union of all domain events.
|
|
398
1107
|
*/
|
|
@@ -419,6 +1128,7 @@ declare const DomainEventSchema: Schema.Union<[Schema.TaggedStruct<"LoopStarted"
|
|
|
419
1128
|
}>>;
|
|
420
1129
|
additionalContext: Schema.optional<typeof Schema.String>;
|
|
421
1130
|
}>>;
|
|
1131
|
+
provider: Schema.optional<Schema.Literal<["claude", "cursor", "opencode"]>>;
|
|
422
1132
|
}>;
|
|
423
1133
|
timestamp: typeof Schema.Number;
|
|
424
1134
|
}>, Schema.TaggedStruct<"LoopCompleted", {
|
|
@@ -428,6 +1138,8 @@ declare const DomainEventSchema: Schema.Union<[Schema.TaggedStruct<"LoopStarted"
|
|
|
428
1138
|
sessionId: typeof Schema.String;
|
|
429
1139
|
completedTasks: Schema.Array$<typeof Schema.String>;
|
|
430
1140
|
durationMs: typeof Schema.Number;
|
|
1141
|
+
branchPushed: Schema.optional<typeof Schema.Boolean>;
|
|
1142
|
+
prUrl: Schema.optional<typeof Schema.String>;
|
|
431
1143
|
}>;
|
|
432
1144
|
}>, Schema.TaggedStruct<"LoopFailed", {
|
|
433
1145
|
error: Schema.Struct<{
|
|
@@ -550,11 +1262,52 @@ declare const DomainEventSchema: Schema.Union<[Schema.TaggedStruct<"LoopStarted"
|
|
|
550
1262
|
operation: Schema.Literal<["create", "update"]>;
|
|
551
1263
|
error: typeof Schema.String;
|
|
552
1264
|
planId: Schema.optional<typeof Schema.String>;
|
|
1265
|
+
}>, Schema.TaggedStruct<"LearningRecorded", {
|
|
1266
|
+
iteration: typeof Schema.Number;
|
|
1267
|
+
content: typeof Schema.String;
|
|
1268
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
1269
|
+
timestamp: typeof Schema.Number;
|
|
1270
|
+
}>, Schema.TaggedStruct<"GuardrailAdded", {
|
|
1271
|
+
id: typeof Schema.String;
|
|
1272
|
+
iteration: typeof Schema.Number;
|
|
1273
|
+
pattern: typeof Schema.String;
|
|
1274
|
+
sign: typeof Schema.String;
|
|
1275
|
+
avoidance: typeof Schema.String;
|
|
1276
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
1277
|
+
timestamp: typeof Schema.Number;
|
|
1278
|
+
}>, Schema.TaggedStruct<"ProgressUpdated", {
|
|
1279
|
+
sessionId: typeof Schema.String;
|
|
1280
|
+
iteration: typeof Schema.Number;
|
|
1281
|
+
taskId: typeof Schema.String;
|
|
1282
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
1283
|
+
timestamp: typeof Schema.Number;
|
|
1284
|
+
}>, Schema.TaggedStruct<"WorktreeCreated", {
|
|
1285
|
+
sessionId: typeof Schema.String;
|
|
1286
|
+
worktreePath: typeof Schema.String;
|
|
1287
|
+
branchName: typeof Schema.String;
|
|
1288
|
+
timestamp: typeof Schema.Number;
|
|
1289
|
+
}>, Schema.TaggedStruct<"WorktreeRemoved", {
|
|
1290
|
+
sessionId: typeof Schema.String;
|
|
1291
|
+
timestamp: typeof Schema.Number;
|
|
1292
|
+
}>, Schema.TaggedStruct<"BranchPushed", {
|
|
1293
|
+
sessionId: typeof Schema.String;
|
|
1294
|
+
branchName: typeof Schema.String;
|
|
1295
|
+
timestamp: typeof Schema.Number;
|
|
1296
|
+
}>, Schema.TaggedStruct<"PRCreated", {
|
|
1297
|
+
sessionId: typeof Schema.String;
|
|
1298
|
+
prUrl: typeof Schema.String;
|
|
1299
|
+
title: typeof Schema.String;
|
|
1300
|
+
timestamp: typeof Schema.Number;
|
|
1301
|
+
}>, Schema.TaggedStruct<"SessionNameGenerated", {
|
|
1302
|
+
sessionId: typeof Schema.String;
|
|
1303
|
+
/** Task-based descriptive name (kebab-case slug, e.g., "add-dark-mode-toggle") */
|
|
1304
|
+
displayName: typeof Schema.String;
|
|
1305
|
+
timestamp: typeof Schema.Number;
|
|
553
1306
|
}>]>;
|
|
554
1307
|
/**
|
|
555
1308
|
* Explicit discriminated union type for proper TypeScript narrowing.
|
|
556
1309
|
*/
|
|
557
|
-
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;
|
|
1310
|
+
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 | BranchPushedEvent | PRCreatedEvent | SessionNameGeneratedEvent;
|
|
558
1311
|
/**
|
|
559
1312
|
* Type guard utilities for domain events.
|
|
560
1313
|
*/
|
|
@@ -566,16 +1319,382 @@ declare const DomainEventUtils: {
|
|
|
566
1319
|
readonly isDiscoveryEvent: (e: DomainEvent) => e is DiscoveryStartedEvent | DiscoveryCompletedEvent;
|
|
567
1320
|
};
|
|
568
1321
|
|
|
1322
|
+
/**
|
|
1323
|
+
* Severity levels for guardrails.
|
|
1324
|
+
*/
|
|
1325
|
+
declare const GuardrailSeveritySchema: Schema.Literal<["warning", "critical"]>;
|
|
1326
|
+
type GuardrailSeverity = typeof GuardrailSeveritySchema.Type;
|
|
1327
|
+
/**
|
|
1328
|
+
* A guardrail represents a failure pattern to avoid.
|
|
1329
|
+
*
|
|
1330
|
+
* Guardrails are learned from previous iteration failures and
|
|
1331
|
+
* help prevent the LLM from repeating the same mistakes.
|
|
1332
|
+
*/
|
|
1333
|
+
declare const GuardrailSchema: Schema.Struct<{
|
|
1334
|
+
id: typeof Schema.String;
|
|
1335
|
+
createdAt: typeof Schema.String;
|
|
1336
|
+
iteration: typeof Schema.Number;
|
|
1337
|
+
pattern: typeof Schema.String;
|
|
1338
|
+
sign: typeof Schema.String;
|
|
1339
|
+
avoidance: typeof Schema.String;
|
|
1340
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
1341
|
+
}>;
|
|
1342
|
+
type Guardrail = typeof GuardrailSchema.Type;
|
|
1343
|
+
/**
|
|
1344
|
+
* The complete guardrails file structure.
|
|
1345
|
+
*
|
|
1346
|
+
* Contains session metadata and an array of guardrails.
|
|
1347
|
+
* This is the structure persisted to `.ferix/plans/:sessionId/guardrails.md`.
|
|
1348
|
+
*/
|
|
1349
|
+
declare const GuardrailsFileSchema: Schema.Struct<{
|
|
1350
|
+
sessionId: typeof Schema.String;
|
|
1351
|
+
createdAt: typeof Schema.String;
|
|
1352
|
+
guardrails: Schema.Array$<Schema.Struct<{
|
|
1353
|
+
id: typeof Schema.String;
|
|
1354
|
+
createdAt: typeof Schema.String;
|
|
1355
|
+
iteration: typeof Schema.Number;
|
|
1356
|
+
pattern: typeof Schema.String;
|
|
1357
|
+
sign: typeof Schema.String;
|
|
1358
|
+
avoidance: typeof Schema.String;
|
|
1359
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
1360
|
+
}>>;
|
|
1361
|
+
}>;
|
|
1362
|
+
type GuardrailsFile = typeof GuardrailsFileSchema.Type;
|
|
1363
|
+
/**
|
|
1364
|
+
* Decode helpers.
|
|
1365
|
+
*/
|
|
1366
|
+
declare const decodeGuardrail: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
1367
|
+
readonly iteration: number;
|
|
1368
|
+
readonly id: string;
|
|
1369
|
+
readonly createdAt: string;
|
|
1370
|
+
readonly pattern: string;
|
|
1371
|
+
readonly sign: string;
|
|
1372
|
+
readonly avoidance: string;
|
|
1373
|
+
readonly severity: "warning" | "critical";
|
|
1374
|
+
}, effect_ParseResult.ParseError, never>;
|
|
1375
|
+
declare const decodeGuardrailsFile: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
1376
|
+
readonly sessionId: string;
|
|
1377
|
+
readonly createdAt: string;
|
|
1378
|
+
readonly guardrails: readonly {
|
|
1379
|
+
readonly iteration: number;
|
|
1380
|
+
readonly id: string;
|
|
1381
|
+
readonly createdAt: string;
|
|
1382
|
+
readonly pattern: string;
|
|
1383
|
+
readonly sign: string;
|
|
1384
|
+
readonly avoidance: string;
|
|
1385
|
+
readonly severity: "warning" | "critical";
|
|
1386
|
+
}[];
|
|
1387
|
+
}, effect_ParseResult.ParseError, never>;
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* Read tool input schema.
|
|
1391
|
+
*/
|
|
1392
|
+
declare const ReadToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1393
|
+
file_path: typeof Schema.String;
|
|
1394
|
+
offset: Schema.optional<typeof Schema.Number>;
|
|
1395
|
+
limit: Schema.optional<typeof Schema.Number>;
|
|
1396
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1397
|
+
type ReadToolInput = typeof ReadToolInputSchema.Type;
|
|
1398
|
+
/**
|
|
1399
|
+
* Edit tool input schema.
|
|
1400
|
+
*/
|
|
1401
|
+
declare const EditToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1402
|
+
file_path: typeof Schema.String;
|
|
1403
|
+
old_string: typeof Schema.String;
|
|
1404
|
+
new_string: typeof Schema.String;
|
|
1405
|
+
replace_all: Schema.optional<typeof Schema.Boolean>;
|
|
1406
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1407
|
+
type EditToolInput = typeof EditToolInputSchema.Type;
|
|
1408
|
+
/**
|
|
1409
|
+
* Write tool input schema.
|
|
1410
|
+
*/
|
|
1411
|
+
declare const WriteToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1412
|
+
file_path: typeof Schema.String;
|
|
1413
|
+
content: typeof Schema.String;
|
|
1414
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1415
|
+
type WriteToolInput = typeof WriteToolInputSchema.Type;
|
|
1416
|
+
/**
|
|
1417
|
+
* Bash tool input schema.
|
|
1418
|
+
*/
|
|
1419
|
+
declare const BashToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1420
|
+
command: typeof Schema.String;
|
|
1421
|
+
description: Schema.optional<typeof Schema.String>;
|
|
1422
|
+
timeout: Schema.optional<typeof Schema.Number>;
|
|
1423
|
+
run_in_background: Schema.optional<typeof Schema.Boolean>;
|
|
1424
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1425
|
+
type BashToolInput = typeof BashToolInputSchema.Type;
|
|
1426
|
+
/**
|
|
1427
|
+
* Glob tool input schema.
|
|
1428
|
+
*/
|
|
1429
|
+
declare const GlobToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1430
|
+
pattern: typeof Schema.String;
|
|
1431
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1432
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1433
|
+
type GlobToolInput = typeof GlobToolInputSchema.Type;
|
|
1434
|
+
/**
|
|
1435
|
+
* Grep tool input schema.
|
|
1436
|
+
*/
|
|
1437
|
+
declare const GrepToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1438
|
+
pattern: typeof Schema.String;
|
|
1439
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1440
|
+
glob: Schema.optional<typeof Schema.String>;
|
|
1441
|
+
type: Schema.optional<typeof Schema.String>;
|
|
1442
|
+
output_mode: Schema.optional<Schema.Literal<["content", "files_with_matches", "count"]>>;
|
|
1443
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1444
|
+
type GrepToolInput = typeof GrepToolInputSchema.Type;
|
|
1445
|
+
/**
|
|
1446
|
+
* Task tool input schema.
|
|
1447
|
+
*/
|
|
1448
|
+
declare const TaskToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1449
|
+
description: typeof Schema.String;
|
|
1450
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1451
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1452
|
+
type TaskToolInput = typeof TaskToolInputSchema.Type;
|
|
1453
|
+
/**
|
|
1454
|
+
* WebFetch tool input schema.
|
|
1455
|
+
*/
|
|
1456
|
+
declare const WebFetchToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1457
|
+
url: typeof Schema.String;
|
|
1458
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1459
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1460
|
+
type WebFetchToolInput = typeof WebFetchToolInputSchema.Type;
|
|
1461
|
+
/**
|
|
1462
|
+
* WebSearch tool input schema.
|
|
1463
|
+
*/
|
|
1464
|
+
declare const WebSearchToolInputSchema: Schema.extend<Schema.Struct<{
|
|
1465
|
+
query: typeof Schema.String;
|
|
1466
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1467
|
+
type WebSearchToolInput = typeof WebSearchToolInputSchema.Type;
|
|
1468
|
+
/**
|
|
1469
|
+
* Registry of tool input schemas.
|
|
1470
|
+
*/
|
|
1471
|
+
declare const ToolInputSchemaRegistry: {
|
|
1472
|
+
readonly read: Schema.extend<Schema.Struct<{
|
|
1473
|
+
file_path: typeof Schema.String;
|
|
1474
|
+
offset: Schema.optional<typeof Schema.Number>;
|
|
1475
|
+
limit: Schema.optional<typeof Schema.Number>;
|
|
1476
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1477
|
+
readonly edit: Schema.extend<Schema.Struct<{
|
|
1478
|
+
file_path: typeof Schema.String;
|
|
1479
|
+
old_string: typeof Schema.String;
|
|
1480
|
+
new_string: typeof Schema.String;
|
|
1481
|
+
replace_all: Schema.optional<typeof Schema.Boolean>;
|
|
1482
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1483
|
+
readonly write: Schema.extend<Schema.Struct<{
|
|
1484
|
+
file_path: typeof Schema.String;
|
|
1485
|
+
content: typeof Schema.String;
|
|
1486
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1487
|
+
readonly bash: Schema.extend<Schema.Struct<{
|
|
1488
|
+
command: typeof Schema.String;
|
|
1489
|
+
description: Schema.optional<typeof Schema.String>;
|
|
1490
|
+
timeout: Schema.optional<typeof Schema.Number>;
|
|
1491
|
+
run_in_background: Schema.optional<typeof Schema.Boolean>;
|
|
1492
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1493
|
+
readonly glob: Schema.extend<Schema.Struct<{
|
|
1494
|
+
pattern: typeof Schema.String;
|
|
1495
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1496
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1497
|
+
readonly grep: Schema.extend<Schema.Struct<{
|
|
1498
|
+
pattern: typeof Schema.String;
|
|
1499
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1500
|
+
glob: Schema.optional<typeof Schema.String>;
|
|
1501
|
+
type: Schema.optional<typeof Schema.String>;
|
|
1502
|
+
output_mode: Schema.optional<Schema.Literal<["content", "files_with_matches", "count"]>>;
|
|
1503
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1504
|
+
readonly task: Schema.extend<Schema.Struct<{
|
|
1505
|
+
description: typeof Schema.String;
|
|
1506
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1507
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1508
|
+
readonly webfetch: Schema.extend<Schema.Struct<{
|
|
1509
|
+
url: typeof Schema.String;
|
|
1510
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1511
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1512
|
+
readonly websearch: Schema.extend<Schema.Struct<{
|
|
1513
|
+
query: typeof Schema.String;
|
|
1514
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1515
|
+
};
|
|
1516
|
+
/**
|
|
1517
|
+
* Known tool names.
|
|
1518
|
+
*/
|
|
1519
|
+
type KnownToolName = keyof typeof ToolInputSchemaRegistry;
|
|
1520
|
+
/**
|
|
1521
|
+
* Get the input schema for a tool.
|
|
1522
|
+
*
|
|
1523
|
+
* @param tool - Tool name (case-insensitive)
|
|
1524
|
+
* @returns Schema for the tool or undefined if not found
|
|
1525
|
+
*/
|
|
1526
|
+
declare function getToolInputSchema(tool: string): Schema.Schema<AnyToolInput, AnyToolInput, never> | undefined;
|
|
1527
|
+
/**
|
|
1528
|
+
* Union of all known tool inputs.
|
|
1529
|
+
*/
|
|
1530
|
+
declare const AnyToolInputSchema: Schema.Union<[Schema.extend<Schema.Struct<{
|
|
1531
|
+
file_path: typeof Schema.String;
|
|
1532
|
+
offset: Schema.optional<typeof Schema.Number>;
|
|
1533
|
+
limit: Schema.optional<typeof Schema.Number>;
|
|
1534
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1535
|
+
file_path: typeof Schema.String;
|
|
1536
|
+
old_string: typeof Schema.String;
|
|
1537
|
+
new_string: typeof Schema.String;
|
|
1538
|
+
replace_all: Schema.optional<typeof Schema.Boolean>;
|
|
1539
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1540
|
+
file_path: typeof Schema.String;
|
|
1541
|
+
content: typeof Schema.String;
|
|
1542
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1543
|
+
command: typeof Schema.String;
|
|
1544
|
+
description: Schema.optional<typeof Schema.String>;
|
|
1545
|
+
timeout: Schema.optional<typeof Schema.Number>;
|
|
1546
|
+
run_in_background: Schema.optional<typeof Schema.Boolean>;
|
|
1547
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1548
|
+
pattern: typeof Schema.String;
|
|
1549
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1550
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1551
|
+
pattern: typeof Schema.String;
|
|
1552
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1553
|
+
glob: Schema.optional<typeof Schema.String>;
|
|
1554
|
+
type: Schema.optional<typeof Schema.String>;
|
|
1555
|
+
output_mode: Schema.optional<Schema.Literal<["content", "files_with_matches", "count"]>>;
|
|
1556
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1557
|
+
description: typeof Schema.String;
|
|
1558
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1559
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1560
|
+
url: typeof Schema.String;
|
|
1561
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1562
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1563
|
+
query: typeof Schema.String;
|
|
1564
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>]>;
|
|
1565
|
+
type AnyToolInput = typeof AnyToolInputSchema.Type;
|
|
1566
|
+
/**
|
|
1567
|
+
* Validate a tool input against its schema.
|
|
1568
|
+
*
|
|
1569
|
+
* @param tool - Tool name
|
|
1570
|
+
* @param input - Input to validate
|
|
1571
|
+
* @returns Either with validated input or parse error
|
|
1572
|
+
*/
|
|
1573
|
+
declare function validateToolInput(tool: string, input: unknown): Either.Either<AnyToolInput, unknown>;
|
|
1574
|
+
/**
|
|
1575
|
+
* Type guards for specific tool inputs.
|
|
1576
|
+
*/
|
|
1577
|
+
declare const isReadToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1578
|
+
readonly file_path: string;
|
|
1579
|
+
readonly offset?: number | undefined;
|
|
1580
|
+
readonly limit?: number | undefined;
|
|
1581
|
+
} & {
|
|
1582
|
+
readonly [x: string]: unknown;
|
|
1583
|
+
};
|
|
1584
|
+
declare const isEditToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1585
|
+
readonly file_path: string;
|
|
1586
|
+
readonly old_string: string;
|
|
1587
|
+
readonly new_string: string;
|
|
1588
|
+
readonly replace_all?: boolean | undefined;
|
|
1589
|
+
} & {
|
|
1590
|
+
readonly [x: string]: unknown;
|
|
1591
|
+
};
|
|
1592
|
+
declare const isWriteToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1593
|
+
readonly content: string;
|
|
1594
|
+
readonly file_path: string;
|
|
1595
|
+
} & {
|
|
1596
|
+
readonly [x: string]: unknown;
|
|
1597
|
+
};
|
|
1598
|
+
declare const isBashToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1599
|
+
readonly description?: string | undefined;
|
|
1600
|
+
readonly command: string;
|
|
1601
|
+
readonly timeout?: number | undefined;
|
|
1602
|
+
readonly run_in_background?: boolean | undefined;
|
|
1603
|
+
} & {
|
|
1604
|
+
readonly [x: string]: unknown;
|
|
1605
|
+
};
|
|
1606
|
+
declare const isGlobToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1607
|
+
readonly pattern: string;
|
|
1608
|
+
readonly path?: string | undefined;
|
|
1609
|
+
} & {
|
|
1610
|
+
readonly [x: string]: unknown;
|
|
1611
|
+
};
|
|
1612
|
+
declare const isGrepToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1613
|
+
readonly type?: string | undefined;
|
|
1614
|
+
readonly pattern: string;
|
|
1615
|
+
readonly path?: string | undefined;
|
|
1616
|
+
readonly glob?: string | undefined;
|
|
1617
|
+
readonly output_mode?: "content" | "files_with_matches" | "count" | undefined;
|
|
1618
|
+
} & {
|
|
1619
|
+
readonly [x: string]: unknown;
|
|
1620
|
+
};
|
|
1621
|
+
declare const isTaskToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1622
|
+
readonly description: string;
|
|
1623
|
+
readonly prompt?: string | undefined;
|
|
1624
|
+
} & {
|
|
1625
|
+
readonly [x: string]: unknown;
|
|
1626
|
+
};
|
|
1627
|
+
declare const isWebFetchToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1628
|
+
readonly prompt?: string | undefined;
|
|
1629
|
+
readonly url: string;
|
|
1630
|
+
} & {
|
|
1631
|
+
readonly [x: string]: unknown;
|
|
1632
|
+
};
|
|
1633
|
+
declare const isWebSearchToolInput: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions | number) => u is {
|
|
1634
|
+
readonly query: string;
|
|
1635
|
+
} & {
|
|
1636
|
+
readonly [x: string]: unknown;
|
|
1637
|
+
};
|
|
1638
|
+
|
|
569
1639
|
declare const TextEventSchema: Schema.TaggedStruct<"Text", {
|
|
570
1640
|
text: typeof Schema.String;
|
|
571
1641
|
}>;
|
|
572
1642
|
declare const ToolStartEventSchema: Schema.TaggedStruct<"ToolStart", {
|
|
573
1643
|
tool: typeof Schema.String;
|
|
574
1644
|
}>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Tool use event schema.
|
|
1647
|
+
*
|
|
1648
|
+
* The input field uses AnyToolInputSchema for known tools,
|
|
1649
|
+
* but falls back to S.Unknown for forward compatibility with
|
|
1650
|
+
* unknown tools or new tool versions.
|
|
1651
|
+
*/
|
|
575
1652
|
declare const ToolUseEventSchema: Schema.TaggedStruct<"ToolUse", {
|
|
576
1653
|
tool: typeof Schema.String;
|
|
577
1654
|
input: typeof Schema.Unknown;
|
|
578
1655
|
}>;
|
|
1656
|
+
/**
|
|
1657
|
+
* Validated tool use event schema - validates input against known tool schemas.
|
|
1658
|
+
* Use this when you want strict validation of tool inputs.
|
|
1659
|
+
*/
|
|
1660
|
+
declare const ValidatedToolUseEventSchema: Schema.TaggedStruct<"ToolUse", {
|
|
1661
|
+
tool: typeof Schema.String;
|
|
1662
|
+
input: Schema.Union<[Schema.extend<Schema.Struct<{
|
|
1663
|
+
file_path: typeof Schema.String;
|
|
1664
|
+
offset: Schema.optional<typeof Schema.Number>;
|
|
1665
|
+
limit: Schema.optional<typeof Schema.Number>;
|
|
1666
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1667
|
+
file_path: typeof Schema.String;
|
|
1668
|
+
old_string: typeof Schema.String;
|
|
1669
|
+
new_string: typeof Schema.String;
|
|
1670
|
+
replace_all: Schema.optional<typeof Schema.Boolean>;
|
|
1671
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1672
|
+
file_path: typeof Schema.String;
|
|
1673
|
+
content: typeof Schema.String;
|
|
1674
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1675
|
+
command: typeof Schema.String;
|
|
1676
|
+
description: Schema.optional<typeof Schema.String>;
|
|
1677
|
+
timeout: Schema.optional<typeof Schema.Number>;
|
|
1678
|
+
run_in_background: Schema.optional<typeof Schema.Boolean>;
|
|
1679
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1680
|
+
pattern: typeof Schema.String;
|
|
1681
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1682
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1683
|
+
pattern: typeof Schema.String;
|
|
1684
|
+
path: Schema.optional<typeof Schema.String>;
|
|
1685
|
+
glob: Schema.optional<typeof Schema.String>;
|
|
1686
|
+
type: Schema.optional<typeof Schema.String>;
|
|
1687
|
+
output_mode: Schema.optional<Schema.Literal<["content", "files_with_matches", "count"]>>;
|
|
1688
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1689
|
+
description: typeof Schema.String;
|
|
1690
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1691
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1692
|
+
url: typeof Schema.String;
|
|
1693
|
+
prompt: Schema.optional<typeof Schema.String>;
|
|
1694
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, Schema.extend<Schema.Struct<{
|
|
1695
|
+
query: typeof Schema.String;
|
|
1696
|
+
}>, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>]>;
|
|
1697
|
+
}>;
|
|
579
1698
|
declare const ToolEndEventSchema: Schema.TaggedStruct<"ToolEnd", {
|
|
580
1699
|
tool: typeof Schema.String;
|
|
581
1700
|
}>;
|
|
@@ -600,6 +1719,14 @@ type ToolUseEvent = typeof ToolUseEventSchema.Type;
|
|
|
600
1719
|
type ToolEndEvent = typeof ToolEndEventSchema.Type;
|
|
601
1720
|
type DoneEvent = typeof DoneEventSchema.Type;
|
|
602
1721
|
type LLMEvent = TextEvent | ToolStartEvent | ToolUseEvent | ToolEndEvent | DoneEvent;
|
|
1722
|
+
/**
|
|
1723
|
+
* Validated tool use event type with typed input.
|
|
1724
|
+
*/
|
|
1725
|
+
interface ValidatedToolUseEvent {
|
|
1726
|
+
readonly _tag: "ToolUse";
|
|
1727
|
+
readonly tool: string;
|
|
1728
|
+
readonly input: AnyToolInput;
|
|
1729
|
+
}
|
|
603
1730
|
declare const decodeLLMEvent: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
604
1731
|
readonly _tag: "Text";
|
|
605
1732
|
readonly text: string;
|
|
@@ -617,6 +1744,13 @@ declare const decodeLLMEvent: (u: unknown, overrideOptions?: effect_SchemaAST.Pa
|
|
|
617
1744
|
readonly _tag: "Done";
|
|
618
1745
|
readonly output: string;
|
|
619
1746
|
}, effect_ParseResult.ParseError, never>;
|
|
1747
|
+
/**
|
|
1748
|
+
* Create a validated ToolUseEvent by validating the input against the tool's schema.
|
|
1749
|
+
*
|
|
1750
|
+
* @param event - ToolUseEvent with unknown input
|
|
1751
|
+
* @returns Either with validated event or parse error
|
|
1752
|
+
*/
|
|
1753
|
+
declare function validateToolUseEvent(event: ToolUseEvent): Either.Either<ToolUseEvent, unknown>;
|
|
620
1754
|
|
|
621
1755
|
declare const LogLevelSchema: Schema.Literal<["debug", "info", "warn", "error"]>;
|
|
622
1756
|
type LogLevel = typeof LogLevelSchema.Type;
|
|
@@ -769,22 +1903,22 @@ declare const decodePlan: (u: unknown, overrideOptions?: effect_SchemaAST.ParseO
|
|
|
769
1903
|
readonly context?: string | undefined;
|
|
770
1904
|
readonly tasks: readonly {
|
|
771
1905
|
readonly phases: readonly {
|
|
1906
|
+
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
772
1907
|
readonly id: string;
|
|
773
1908
|
readonly description: string;
|
|
774
|
-
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
775
1909
|
}[];
|
|
1910
|
+
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
1911
|
+
readonly attempts: number;
|
|
776
1912
|
readonly id: string;
|
|
777
1913
|
readonly description: string;
|
|
778
|
-
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
779
1914
|
readonly title: string;
|
|
780
1915
|
readonly criteria: readonly {
|
|
1916
|
+
readonly status: "pending" | "failed" | "passed";
|
|
781
1917
|
readonly id: string;
|
|
782
1918
|
readonly description: string;
|
|
783
|
-
readonly status: "pending" | "failed" | "passed";
|
|
784
1919
|
readonly failureReason?: string | undefined;
|
|
785
1920
|
}[];
|
|
786
1921
|
readonly filesToModify: readonly string[];
|
|
787
|
-
readonly attempts: number;
|
|
788
1922
|
readonly completionNotes?: string | undefined;
|
|
789
1923
|
}[];
|
|
790
1924
|
}, effect_ParseResult.ParseError, never>;
|
|
@@ -795,22 +1929,22 @@ declare const decodePlanData: (u: unknown, overrideOptions?: effect_SchemaAST.Pa
|
|
|
795
1929
|
readonly context?: string | undefined;
|
|
796
1930
|
readonly tasks: readonly {
|
|
797
1931
|
readonly phases: readonly {
|
|
1932
|
+
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
798
1933
|
readonly id: string;
|
|
799
1934
|
readonly description: string;
|
|
800
|
-
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
801
1935
|
}[];
|
|
1936
|
+
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
1937
|
+
readonly attempts: number;
|
|
802
1938
|
readonly id: string;
|
|
803
1939
|
readonly description: string;
|
|
804
|
-
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
805
1940
|
readonly title: string;
|
|
806
1941
|
readonly criteria: readonly {
|
|
1942
|
+
readonly status: "pending" | "failed" | "passed";
|
|
807
1943
|
readonly id: string;
|
|
808
1944
|
readonly description: string;
|
|
809
|
-
readonly status: "pending" | "failed" | "passed";
|
|
810
1945
|
readonly failureReason?: string | undefined;
|
|
811
1946
|
}[];
|
|
812
1947
|
readonly filesToModify: readonly string[];
|
|
813
|
-
readonly attempts: number;
|
|
814
1948
|
readonly completionNotes?: string | undefined;
|
|
815
1949
|
}[];
|
|
816
1950
|
}, effect_ParseResult.ParseError, never>;
|
|
@@ -840,11 +1974,83 @@ declare const RunOptionsDataSchema: Schema.Struct<{
|
|
|
840
1974
|
}>>;
|
|
841
1975
|
additionalContext: Schema.optional<typeof Schema.String>;
|
|
842
1976
|
}>>;
|
|
1977
|
+
provider: Schema.optional<Schema.Literal<["claude", "cursor", "opencode"]>>;
|
|
843
1978
|
}>;
|
|
844
1979
|
consumer: Schema.optional<Schema.Literal<["tui", "headless", "none"]>>;
|
|
845
1980
|
}>;
|
|
846
1981
|
type RunOptionsData = typeof RunOptionsDataSchema.Type;
|
|
847
1982
|
|
|
1983
|
+
/**
|
|
1984
|
+
* Action types for progress entries.
|
|
1985
|
+
*/
|
|
1986
|
+
declare const ProgressActionSchema: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
1987
|
+
type ProgressAction = typeof ProgressActionSchema.Type;
|
|
1988
|
+
/**
|
|
1989
|
+
* A single progress entry for the append-only log.
|
|
1990
|
+
*
|
|
1991
|
+
* Each entry records what happened in an iteration, including:
|
|
1992
|
+
* - Which task was worked on
|
|
1993
|
+
* - What action was taken
|
|
1994
|
+
* - A summary of the work
|
|
1995
|
+
* - Any learnings discovered
|
|
1996
|
+
* - Files that were modified
|
|
1997
|
+
*/
|
|
1998
|
+
declare const ProgressEntrySchema: Schema.Struct<{
|
|
1999
|
+
iteration: typeof Schema.Number;
|
|
2000
|
+
timestamp: typeof Schema.String;
|
|
2001
|
+
taskId: typeof Schema.String;
|
|
2002
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
2003
|
+
summary: typeof Schema.String;
|
|
2004
|
+
learnings: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
2005
|
+
filesModified: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
2006
|
+
}>;
|
|
2007
|
+
type ProgressEntry = typeof ProgressEntrySchema.Type;
|
|
2008
|
+
/**
|
|
2009
|
+
* The complete progress file structure.
|
|
2010
|
+
*
|
|
2011
|
+
* Contains session metadata and an array of progress entries.
|
|
2012
|
+
* This is the structure persisted to `.ferix/plans/:sessionId/progress.md`.
|
|
2013
|
+
*/
|
|
2014
|
+
declare const ProgressFileSchema: Schema.Struct<{
|
|
2015
|
+
sessionId: typeof Schema.String;
|
|
2016
|
+
createdAt: typeof Schema.String;
|
|
2017
|
+
entries: Schema.Array$<Schema.Struct<{
|
|
2018
|
+
iteration: typeof Schema.Number;
|
|
2019
|
+
timestamp: typeof Schema.String;
|
|
2020
|
+
taskId: typeof Schema.String;
|
|
2021
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
2022
|
+
summary: typeof Schema.String;
|
|
2023
|
+
learnings: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
2024
|
+
filesModified: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
2025
|
+
}>>;
|
|
2026
|
+
}>;
|
|
2027
|
+
type ProgressFile = typeof ProgressFileSchema.Type;
|
|
2028
|
+
/**
|
|
2029
|
+
* Decode helpers.
|
|
2030
|
+
*/
|
|
2031
|
+
declare const decodeProgressEntry: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
2032
|
+
readonly iteration: number;
|
|
2033
|
+
readonly timestamp: string;
|
|
2034
|
+
readonly taskId: string;
|
|
2035
|
+
readonly summary: string;
|
|
2036
|
+
readonly filesModified?: readonly string[] | undefined;
|
|
2037
|
+
readonly action: "failed" | "started" | "completed" | "learning";
|
|
2038
|
+
readonly learnings?: readonly string[] | undefined;
|
|
2039
|
+
}, effect_ParseResult.ParseError, never>;
|
|
2040
|
+
declare const decodeProgressFile: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
2041
|
+
readonly entries: readonly {
|
|
2042
|
+
readonly iteration: number;
|
|
2043
|
+
readonly timestamp: string;
|
|
2044
|
+
readonly taskId: string;
|
|
2045
|
+
readonly summary: string;
|
|
2046
|
+
readonly filesModified?: readonly string[] | undefined;
|
|
2047
|
+
readonly action: "failed" | "started" | "completed" | "learning";
|
|
2048
|
+
readonly learnings?: readonly string[] | undefined;
|
|
2049
|
+
}[];
|
|
2050
|
+
readonly sessionId: string;
|
|
2051
|
+
readonly createdAt: string;
|
|
2052
|
+
}, effect_ParseResult.ParseError, never>;
|
|
2053
|
+
|
|
848
2054
|
/**
|
|
849
2055
|
* Session status schema.
|
|
850
2056
|
*/
|
|
@@ -860,18 +2066,28 @@ declare const SessionSchema: Schema.Struct<{
|
|
|
860
2066
|
originalTask: typeof Schema.String;
|
|
861
2067
|
completedTasks: Schema.Array$<typeof Schema.String>;
|
|
862
2068
|
currentTaskId: Schema.optional<typeof Schema.String>;
|
|
2069
|
+
worktreePath: Schema.optional<typeof Schema.String>;
|
|
2070
|
+
branchName: Schema.optional<typeof Schema.String>;
|
|
2071
|
+
/** Task-based descriptive name (kebab-case slug, e.g., "add-dark-mode-toggle") */
|
|
2072
|
+
displayName: Schema.optional<typeof Schema.String>;
|
|
2073
|
+
/** The branch ferix was started from - used as PR base branch */
|
|
2074
|
+
baseBranch: Schema.optional<typeof Schema.String>;
|
|
863
2075
|
}>;
|
|
864
2076
|
type Session = typeof SessionSchema.Type;
|
|
865
2077
|
/**
|
|
866
2078
|
* Decode helper.
|
|
867
2079
|
*/
|
|
868
2080
|
declare const decodeSession: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
869
|
-
readonly
|
|
2081
|
+
readonly status: "failed" | "completed" | "active" | "paused";
|
|
870
2082
|
readonly id: string;
|
|
871
|
-
readonly
|
|
2083
|
+
readonly completedTasks: readonly string[];
|
|
872
2084
|
readonly createdAt: string;
|
|
873
2085
|
readonly originalTask: string;
|
|
2086
|
+
readonly worktreePath?: string | undefined;
|
|
2087
|
+
readonly branchName?: string | undefined;
|
|
2088
|
+
readonly displayName?: string | undefined;
|
|
874
2089
|
readonly currentTaskId?: string | undefined;
|
|
2090
|
+
readonly baseBranch?: string | undefined;
|
|
875
2091
|
}, effect_ParseResult.ParseError, never>;
|
|
876
2092
|
|
|
877
2093
|
/**
|
|
@@ -1024,6 +2240,38 @@ declare const TaskCompleteSignalSchema: Schema.TaggedStruct<"TaskComplete", Read
|
|
|
1024
2240
|
type TaskCompleteSignal = typeof TaskCompleteSignalSchema.Type;
|
|
1025
2241
|
declare const LoopCompleteSignalSchema: Schema.TaggedStruct<"LoopComplete", {}>;
|
|
1026
2242
|
type LoopCompleteSignal = typeof LoopCompleteSignalSchema.Type;
|
|
2243
|
+
/**
|
|
2244
|
+
* Session name signal - defines a task-based descriptive name for the session.
|
|
2245
|
+
* Generated during discovery phase.
|
|
2246
|
+
*/
|
|
2247
|
+
declare const SessionNameDefinedSignalSchema: Schema.TaggedStruct<"SessionNameDefined", {
|
|
2248
|
+
/** Kebab-case slug, e.g., "add-dark-mode-toggle" */
|
|
2249
|
+
name: typeof Schema.String;
|
|
2250
|
+
}>;
|
|
2251
|
+
type SessionNameDefinedSignal = typeof SessionNameDefinedSignalSchema.Type;
|
|
2252
|
+
/**
|
|
2253
|
+
* Learning category types.
|
|
2254
|
+
*/
|
|
2255
|
+
declare const LearningCategorySchema: Schema.Literal<["success", "failure", "optimization"]>;
|
|
2256
|
+
type LearningCategory = typeof LearningCategorySchema.Type;
|
|
2257
|
+
/**
|
|
2258
|
+
* Learning signal - records insights discovered during iteration.
|
|
2259
|
+
*/
|
|
2260
|
+
declare const LearningSignalSchema: Schema.TaggedStruct<"Learning", {
|
|
2261
|
+
content: typeof Schema.String;
|
|
2262
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
2263
|
+
}>;
|
|
2264
|
+
type LearningSignal = typeof LearningSignalSchema.Type;
|
|
2265
|
+
/**
|
|
2266
|
+
* Guardrail signal - records failure patterns to avoid.
|
|
2267
|
+
*/
|
|
2268
|
+
declare const GuardrailSignalSchema: Schema.TaggedStruct<"Guardrail", {
|
|
2269
|
+
pattern: typeof Schema.String;
|
|
2270
|
+
sign: typeof Schema.String;
|
|
2271
|
+
avoidance: typeof Schema.String;
|
|
2272
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
2273
|
+
}>;
|
|
2274
|
+
type GuardrailSignal = typeof GuardrailSignalSchema.Type;
|
|
1027
2275
|
/**
|
|
1028
2276
|
* Union of all signals.
|
|
1029
2277
|
*/
|
|
@@ -1064,7 +2312,18 @@ declare const SignalSchema: Schema.Union<[Schema.TaggedStruct<"TasksDefined", Re
|
|
|
1064
2312
|
summary: typeof Schema.String;
|
|
1065
2313
|
filesModified: Schema.Array$<typeof Schema.String>;
|
|
1066
2314
|
filesCreated: Schema.Array$<typeof Schema.String>;
|
|
1067
|
-
}>>, Schema.TaggedStruct<"LoopComplete", {}
|
|
2315
|
+
}>>, Schema.TaggedStruct<"LoopComplete", {}>, Schema.TaggedStruct<"Learning", {
|
|
2316
|
+
content: typeof Schema.String;
|
|
2317
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
2318
|
+
}>, Schema.TaggedStruct<"Guardrail", {
|
|
2319
|
+
pattern: typeof Schema.String;
|
|
2320
|
+
sign: typeof Schema.String;
|
|
2321
|
+
avoidance: typeof Schema.String;
|
|
2322
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
2323
|
+
}>, Schema.TaggedStruct<"SessionNameDefined", {
|
|
2324
|
+
/** Kebab-case slug, e.g., "add-dark-mode-toggle" */
|
|
2325
|
+
name: typeof Schema.String;
|
|
2326
|
+
}>]>;
|
|
1068
2327
|
type Signal = typeof SignalSchema.Type;
|
|
1069
2328
|
/**
|
|
1070
2329
|
* Decode helpers.
|
|
@@ -1122,6 +2381,19 @@ declare const decodeSignal: (u: unknown, overrideOptions?: effect_SchemaAST.Pars
|
|
|
1122
2381
|
readonly filesCreated: readonly string[];
|
|
1123
2382
|
} | {
|
|
1124
2383
|
readonly _tag: "LoopComplete";
|
|
2384
|
+
} | {
|
|
2385
|
+
readonly _tag: "SessionNameDefined";
|
|
2386
|
+
readonly name: string;
|
|
2387
|
+
} | {
|
|
2388
|
+
readonly _tag: "Learning";
|
|
2389
|
+
readonly content: string;
|
|
2390
|
+
readonly category?: "success" | "failure" | "optimization" | undefined;
|
|
2391
|
+
} | {
|
|
2392
|
+
readonly _tag: "Guardrail";
|
|
2393
|
+
readonly pattern: string;
|
|
2394
|
+
readonly sign: string;
|
|
2395
|
+
readonly avoidance: string;
|
|
2396
|
+
readonly severity: "warning" | "critical";
|
|
1125
2397
|
}, effect_ParseResult.ParseError, never>;
|
|
1126
2398
|
declare const decodeSignalSync: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => {
|
|
1127
2399
|
readonly _tag: "CheckPassed";
|
|
@@ -1176,8 +2448,130 @@ declare const decodeSignalSync: (u: unknown, overrideOptions?: effect_SchemaAST.
|
|
|
1176
2448
|
readonly filesCreated: readonly string[];
|
|
1177
2449
|
} | {
|
|
1178
2450
|
readonly _tag: "LoopComplete";
|
|
2451
|
+
} | {
|
|
2452
|
+
readonly _tag: "SessionNameDefined";
|
|
2453
|
+
readonly name: string;
|
|
2454
|
+
} | {
|
|
2455
|
+
readonly _tag: "Learning";
|
|
2456
|
+
readonly content: string;
|
|
2457
|
+
readonly category?: "success" | "failure" | "optimization" | undefined;
|
|
2458
|
+
} | {
|
|
2459
|
+
readonly _tag: "Guardrail";
|
|
2460
|
+
readonly pattern: string;
|
|
2461
|
+
readonly sign: string;
|
|
2462
|
+
readonly avoidance: string;
|
|
2463
|
+
readonly severity: "warning" | "critical";
|
|
1179
2464
|
};
|
|
1180
2465
|
|
|
2466
|
+
/**
|
|
2467
|
+
* Factory functions for creating signals with proper typing.
|
|
2468
|
+
*
|
|
2469
|
+
* These factories provide type-safe signal construction by adding
|
|
2470
|
+
* the _tag field automatically. Returns Effect Either for validation.
|
|
2471
|
+
*/
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* Create a TasksDefined signal.
|
|
2475
|
+
*/
|
|
2476
|
+
declare function createTasksDefinedSignal(input: {
|
|
2477
|
+
tasks: readonly TaskBasicInfo[];
|
|
2478
|
+
}): Either.Either<TasksDefinedSignal, ParseResult.ParseError>;
|
|
2479
|
+
/**
|
|
2480
|
+
* Create a PhasesDefinedSignal.
|
|
2481
|
+
*/
|
|
2482
|
+
declare function createPhasesDefinedSignal(input: {
|
|
2483
|
+
taskId: string;
|
|
2484
|
+
phases: readonly PhaseBasicInfo[];
|
|
2485
|
+
}): Either.Either<PhasesDefinedSignal, ParseResult.ParseError>;
|
|
2486
|
+
/**
|
|
2487
|
+
* Create a CriteriaDefinedSignal.
|
|
2488
|
+
*/
|
|
2489
|
+
declare function createCriteriaDefinedSignal(input: {
|
|
2490
|
+
taskId: string;
|
|
2491
|
+
criteria: readonly CriterionBasicInfo[];
|
|
2492
|
+
}): Either.Either<CriteriaDefinedSignal, ParseResult.ParseError>;
|
|
2493
|
+
/**
|
|
2494
|
+
* Create a PhaseStartedSignal.
|
|
2495
|
+
*/
|
|
2496
|
+
declare function createPhaseStartedSignal(input: {
|
|
2497
|
+
phaseId: string;
|
|
2498
|
+
}): Either.Either<PhaseStartedSignal, ParseResult.ParseError>;
|
|
2499
|
+
/**
|
|
2500
|
+
* Create a PhaseCompletedSignal.
|
|
2501
|
+
*/
|
|
2502
|
+
declare function createPhaseCompletedSignal(input: {
|
|
2503
|
+
phaseId: string;
|
|
2504
|
+
}): Either.Either<PhaseCompletedSignal, ParseResult.ParseError>;
|
|
2505
|
+
/**
|
|
2506
|
+
* Create a PhaseFailedSignal.
|
|
2507
|
+
*/
|
|
2508
|
+
declare function createPhaseFailedSignal(input: {
|
|
2509
|
+
phaseId: string;
|
|
2510
|
+
reason: string;
|
|
2511
|
+
}): Either.Either<PhaseFailedSignal, ParseResult.ParseError>;
|
|
2512
|
+
/**
|
|
2513
|
+
* Create a CriterionPassedSignal.
|
|
2514
|
+
*/
|
|
2515
|
+
declare function createCriterionPassedSignal(input: {
|
|
2516
|
+
criterionId: string;
|
|
2517
|
+
}): Either.Either<CriterionPassedSignal, ParseResult.ParseError>;
|
|
2518
|
+
/**
|
|
2519
|
+
* Create a CriterionFailedSignal.
|
|
2520
|
+
*/
|
|
2521
|
+
declare function createCriterionFailedSignal(input: {
|
|
2522
|
+
criterionId: string;
|
|
2523
|
+
reason: string;
|
|
2524
|
+
}): Either.Either<CriterionFailedSignal, ParseResult.ParseError>;
|
|
2525
|
+
/**
|
|
2526
|
+
* Create a CheckPassedSignal.
|
|
2527
|
+
*/
|
|
2528
|
+
declare function createCheckPassedSignal(_input: Record<string, never>): Either.Either<CheckPassedSignal, ParseResult.ParseError>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Create a CheckFailedSignal.
|
|
2531
|
+
*/
|
|
2532
|
+
declare function createCheckFailedSignal(_input: Record<string, never>): Either.Either<CheckFailedSignal, ParseResult.ParseError>;
|
|
2533
|
+
/**
|
|
2534
|
+
* Create a ReviewCompleteSignal.
|
|
2535
|
+
*/
|
|
2536
|
+
declare function createReviewCompleteSignal(input: {
|
|
2537
|
+
changesMade: boolean;
|
|
2538
|
+
}): Either.Either<ReviewCompleteSignal, ParseResult.ParseError>;
|
|
2539
|
+
/**
|
|
2540
|
+
* Create a TaskCompleteSignal.
|
|
2541
|
+
*/
|
|
2542
|
+
declare function createTaskCompleteSignal(input: {
|
|
2543
|
+
taskId: string;
|
|
2544
|
+
summary: string;
|
|
2545
|
+
filesModified: readonly string[];
|
|
2546
|
+
filesCreated: readonly string[];
|
|
2547
|
+
}): Either.Either<TaskCompleteSignal, ParseResult.ParseError>;
|
|
2548
|
+
/**
|
|
2549
|
+
* Create a LoopCompleteSignal.
|
|
2550
|
+
*/
|
|
2551
|
+
declare function createLoopCompleteSignal(_input: Record<string, never>): Either.Either<LoopCompleteSignal, ParseResult.ParseError>;
|
|
2552
|
+
/**
|
|
2553
|
+
* Create a LearningSignal.
|
|
2554
|
+
*/
|
|
2555
|
+
declare function createLearningSignal(input: {
|
|
2556
|
+
content: string;
|
|
2557
|
+
category?: LearningCategory;
|
|
2558
|
+
}): Either.Either<LearningSignal, ParseResult.ParseError>;
|
|
2559
|
+
/**
|
|
2560
|
+
* Create a GuardrailSignal.
|
|
2561
|
+
*/
|
|
2562
|
+
declare function createGuardrailSignal(input: {
|
|
2563
|
+
pattern: string;
|
|
2564
|
+
sign: string;
|
|
2565
|
+
avoidance: string;
|
|
2566
|
+
severity: "warning" | "critical";
|
|
2567
|
+
}): Either.Either<GuardrailSignal, ParseResult.ParseError>;
|
|
2568
|
+
/**
|
|
2569
|
+
* Create a SessionNameDefinedSignal.
|
|
2570
|
+
*/
|
|
2571
|
+
declare function createSessionNameDefinedSignal(input: {
|
|
2572
|
+
name: string;
|
|
2573
|
+
}): Either.Either<SessionNameDefinedSignal, ParseResult.ParseError>;
|
|
2574
|
+
|
|
1181
2575
|
/**
|
|
1182
2576
|
* Status for generated tasks in tasks.md
|
|
1183
2577
|
*/
|
|
@@ -1387,6 +2781,16 @@ declare function createHeadlessConsumer(): Consumer;
|
|
|
1387
2781
|
*/
|
|
1388
2782
|
declare function createTUIConsumer(): Consumer;
|
|
1389
2783
|
|
|
2784
|
+
/**
|
|
2785
|
+
* Options for LLM execution.
|
|
2786
|
+
*/
|
|
2787
|
+
interface LLMExecuteOptions {
|
|
2788
|
+
/**
|
|
2789
|
+
* Working directory for the LLM process.
|
|
2790
|
+
* Used when running in a worktree context.
|
|
2791
|
+
*/
|
|
2792
|
+
readonly cwd?: string;
|
|
2793
|
+
}
|
|
1390
2794
|
/**
|
|
1391
2795
|
* Service interface for LLM execution.
|
|
1392
2796
|
*
|
|
@@ -1413,9 +2817,10 @@ interface LLMService {
|
|
|
1413
2817
|
* The final event will be a "Done" event containing the full output.
|
|
1414
2818
|
*
|
|
1415
2819
|
* @param prompt - The prompt to send to the LLM
|
|
2820
|
+
* @param options - Optional execution options (e.g., cwd for worktree)
|
|
1416
2821
|
* @returns Stream of LLM events that can be consumed by any subscriber
|
|
1417
2822
|
*/
|
|
1418
|
-
readonly execute: (prompt: string) => Stream.Stream<LLMEvent, LLMError>;
|
|
2823
|
+
readonly execute: (prompt: string, options?: LLMExecuteOptions) => Stream.Stream<LLMEvent, LLMError>;
|
|
1419
2824
|
}
|
|
1420
2825
|
declare const LLM_base: Context.TagClass<LLM, "@ferix/LLM", LLMService>;
|
|
1421
2826
|
/**
|
|
@@ -1493,23 +2898,365 @@ declare function createMockLLM(config: MockLLMConfig): LLMService;
|
|
|
1493
2898
|
* });
|
|
1494
2899
|
* ```
|
|
1495
2900
|
*/
|
|
1496
|
-
declare function layer$
|
|
2901
|
+
declare function layer$5(config: MockLLMConfig): Layer.Layer<LLM>;
|
|
1497
2902
|
/**
|
|
1498
2903
|
* Mock namespace containing the Live layer and factory functions.
|
|
1499
2904
|
*/
|
|
1500
2905
|
declare const Mock: {
|
|
1501
2906
|
readonly Live: Layer.Layer<LLM, never, never>;
|
|
1502
|
-
readonly layer: typeof layer$
|
|
2907
|
+
readonly layer: typeof layer$5;
|
|
1503
2908
|
readonly createMockLLM: typeof createMockLLM;
|
|
1504
2909
|
};
|
|
1505
2910
|
|
|
2911
|
+
/**
|
|
2912
|
+
* Branded type for worktree paths.
|
|
2913
|
+
*/
|
|
2914
|
+
type WorktreePath = string & {
|
|
2915
|
+
readonly _brand: "WorktreePath";
|
|
2916
|
+
};
|
|
2917
|
+
/**
|
|
2918
|
+
* Branded type for commit hashes.
|
|
2919
|
+
*/
|
|
2920
|
+
type CommitHash = string & {
|
|
2921
|
+
readonly _brand: "CommitHash";
|
|
2922
|
+
};
|
|
2923
|
+
/**
|
|
2924
|
+
* Branded type for PR URLs.
|
|
2925
|
+
*/
|
|
2926
|
+
type PrUrl = string & {
|
|
2927
|
+
readonly _brand: "PrUrl";
|
|
2928
|
+
};
|
|
2929
|
+
/**
|
|
2930
|
+
* Information about a worktree.
|
|
2931
|
+
*/
|
|
2932
|
+
interface WorktreeInfo {
|
|
2933
|
+
readonly path: WorktreePath;
|
|
2934
|
+
readonly branch: string;
|
|
2935
|
+
readonly sessionId: string;
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* Service interface for git operations.
|
|
2939
|
+
*
|
|
2940
|
+
* Provides worktree management for isolated session execution.
|
|
2941
|
+
* Each session runs in its own worktree with a dedicated branch.
|
|
2942
|
+
*
|
|
2943
|
+
* @example
|
|
2944
|
+
* ```typescript
|
|
2945
|
+
* const git = yield* Git;
|
|
2946
|
+
*
|
|
2947
|
+
* // Create worktree for a session
|
|
2948
|
+
* const worktreePath = yield* git.createWorktree("calm-snails-dream-123");
|
|
2949
|
+
*
|
|
2950
|
+
* // Execute work in worktree...
|
|
2951
|
+
*
|
|
2952
|
+
* // Commit changes
|
|
2953
|
+
* yield* git.commitChanges("calm-snails-dream-123", "feat: complete task 1");
|
|
2954
|
+
*
|
|
2955
|
+
* // Cleanup when done
|
|
2956
|
+
* yield* git.removeWorktree("calm-snails-dream-123");
|
|
2957
|
+
* ```
|
|
2958
|
+
*/
|
|
2959
|
+
interface GitService {
|
|
2960
|
+
/**
|
|
2961
|
+
* Create a new worktree for a session.
|
|
2962
|
+
*
|
|
2963
|
+
* Creates a worktree at `.ferix/worktrees/{sessionId}` with a new branch
|
|
2964
|
+
* `ferix/{sessionId}` based on the current HEAD or specified base branch.
|
|
2965
|
+
*
|
|
2966
|
+
* @param sessionId - Session ID to create worktree for
|
|
2967
|
+
* @param baseBranch - Optional branch to base the worktree on (defaults to HEAD)
|
|
2968
|
+
* @returns Path to the created worktree
|
|
2969
|
+
*/
|
|
2970
|
+
readonly createWorktree: (sessionId: string, baseBranch?: string) => Effect.Effect<WorktreePath, GitError>;
|
|
2971
|
+
/**
|
|
2972
|
+
* Remove a worktree for a session.
|
|
2973
|
+
*
|
|
2974
|
+
* Removes the worktree directory and cleans up git references.
|
|
2975
|
+
*
|
|
2976
|
+
* @param sessionId - Session ID whose worktree to remove
|
|
2977
|
+
*/
|
|
2978
|
+
readonly removeWorktree: (sessionId: string) => Effect.Effect<void, GitError>;
|
|
2979
|
+
/**
|
|
2980
|
+
* Get the worktree path for a session if it exists.
|
|
2981
|
+
*
|
|
2982
|
+
* @param sessionId - Session ID to check
|
|
2983
|
+
* @returns Worktree path if exists, undefined otherwise
|
|
2984
|
+
*/
|
|
2985
|
+
readonly getWorktreePath: (sessionId: string) => Effect.Effect<WorktreePath | undefined, GitError>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Commit all changes in a session's worktree.
|
|
2988
|
+
*
|
|
2989
|
+
* Stages all changes and creates a commit with the given message.
|
|
2990
|
+
*
|
|
2991
|
+
* @param sessionId - Session ID whose worktree to commit
|
|
2992
|
+
* @param message - Commit message
|
|
2993
|
+
* @returns The commit hash
|
|
2994
|
+
*/
|
|
2995
|
+
readonly commitChanges: (sessionId: string, message: string) => Effect.Effect<CommitHash, GitError>;
|
|
2996
|
+
/**
|
|
2997
|
+
* Push the session's branch to the remote.
|
|
2998
|
+
*
|
|
2999
|
+
* @param sessionId - Session ID whose branch to push
|
|
3000
|
+
*/
|
|
3001
|
+
readonly pushBranch: (sessionId: string) => Effect.Effect<void, GitError>;
|
|
3002
|
+
/**
|
|
3003
|
+
* Create a pull request for the session's branch.
|
|
3004
|
+
*
|
|
3005
|
+
* Uses `gh` CLI to create a PR.
|
|
3006
|
+
*
|
|
3007
|
+
* @param sessionId - Session ID whose branch to create PR for
|
|
3008
|
+
* @param title - PR title
|
|
3009
|
+
* @param body - PR body/description
|
|
3010
|
+
* @param baseBranch - Optional base branch for the PR (defaults to repo default)
|
|
3011
|
+
* @returns URL of the created PR
|
|
3012
|
+
*/
|
|
3013
|
+
readonly createPR: (sessionId: string, title: string, body: string, baseBranch?: string) => Effect.Effect<PrUrl, GitError>;
|
|
3014
|
+
/**
|
|
3015
|
+
* Get the current branch name of the main repository.
|
|
3016
|
+
*
|
|
3017
|
+
* Used to capture the base branch when starting a session.
|
|
3018
|
+
*
|
|
3019
|
+
* @returns The current branch name
|
|
3020
|
+
*/
|
|
3021
|
+
readonly getCurrentBranch: () => Effect.Effect<string, GitError>;
|
|
3022
|
+
/**
|
|
3023
|
+
* Get the branch name for a session.
|
|
3024
|
+
*
|
|
3025
|
+
* @param sessionId - Session ID
|
|
3026
|
+
* @returns Branch name (e.g., "ferix/calm-snails-dream-123")
|
|
3027
|
+
*/
|
|
3028
|
+
readonly getBranchName: (sessionId: string) => string;
|
|
3029
|
+
/**
|
|
3030
|
+
* Remove a worktree but keep its branch.
|
|
3031
|
+
*
|
|
3032
|
+
* Removes the worktree directory and cleans up git worktree references,
|
|
3033
|
+
* but preserves the branch for user review and merge.
|
|
3034
|
+
*
|
|
3035
|
+
* @param sessionId - Session ID whose worktree to remove
|
|
3036
|
+
*/
|
|
3037
|
+
readonly removeWorktreeKeepBranch: (sessionId: string) => Effect.Effect<void, GitError>;
|
|
3038
|
+
/**
|
|
3039
|
+
* Rename a session's branch to use a descriptive display name.
|
|
3040
|
+
*
|
|
3041
|
+
* This is called after discovery phase when the LLM generates a
|
|
3042
|
+
* task-based name for the session.
|
|
3043
|
+
*
|
|
3044
|
+
* @param sessionId - Session ID whose branch to rename
|
|
3045
|
+
* @param displayName - New display name for the branch (kebab-case)
|
|
3046
|
+
* @returns The new branch name (e.g., "ferix/add-dark-mode")
|
|
3047
|
+
*/
|
|
3048
|
+
readonly renameBranch: (sessionId: string, displayName: string) => Effect.Effect<string, GitError>;
|
|
3049
|
+
}
|
|
3050
|
+
declare const Git_base: Context.TagClass<Git, "@ferix/Git", GitService>;
|
|
3051
|
+
/**
|
|
3052
|
+
* Effect Tag for the Git service.
|
|
3053
|
+
*
|
|
3054
|
+
* Use this tag to depend on git operations without coupling to a specific implementation.
|
|
3055
|
+
*/
|
|
3056
|
+
declare class Git extends Git_base {
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
/**
|
|
3060
|
+
* FileSystemGit namespace containing the Live layer.
|
|
3061
|
+
*/
|
|
3062
|
+
declare const FileSystemGit: {
|
|
3063
|
+
readonly Live: Layer.Layer<Git, never, never>;
|
|
3064
|
+
};
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* Creates a Layer for an in-memory git service.
|
|
3068
|
+
*
|
|
3069
|
+
* Each call creates a new isolated store.
|
|
3070
|
+
*
|
|
3071
|
+
* @example
|
|
3072
|
+
* ```typescript
|
|
3073
|
+
* const testLayer = MemoryGit.layer();
|
|
3074
|
+
*
|
|
3075
|
+
* const program = Effect.gen(function* () {
|
|
3076
|
+
* const git = yield* Git;
|
|
3077
|
+
* const path = yield* git.createWorktree("test-session");
|
|
3078
|
+
* return path;
|
|
3079
|
+
* });
|
|
3080
|
+
*
|
|
3081
|
+
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
3082
|
+
* ```
|
|
3083
|
+
*/
|
|
3084
|
+
declare function layer$4(): Layer.Layer<Git>;
|
|
3085
|
+
/**
|
|
3086
|
+
* MemoryGit namespace containing the Live layer and factory.
|
|
3087
|
+
*/
|
|
3088
|
+
declare const MemoryGit: {
|
|
3089
|
+
readonly Live: Layer.Layer<Git, never, never>;
|
|
3090
|
+
readonly layer: typeof layer$4;
|
|
3091
|
+
};
|
|
3092
|
+
|
|
3093
|
+
/**
|
|
3094
|
+
* Service interface for guardrails persistence.
|
|
3095
|
+
*
|
|
3096
|
+
* Guardrails are stored at `.ferix/plans/:sessionId/guardrails.md`.
|
|
3097
|
+
* They represent failure patterns learned from previous iterations
|
|
3098
|
+
* that the LLM should avoid.
|
|
3099
|
+
*
|
|
3100
|
+
* Implementations include:
|
|
3101
|
+
* - FileSystem: Persists to `.ferix/plans/` directory
|
|
3102
|
+
* - Memory: In-memory storage for testing
|
|
3103
|
+
*
|
|
3104
|
+
* @example
|
|
3105
|
+
* ```typescript
|
|
3106
|
+
* const guardrailsStore = yield* GuardrailsStore;
|
|
3107
|
+
*
|
|
3108
|
+
* // Add a guardrail
|
|
3109
|
+
* yield* guardrailsStore.add(sessionId, {
|
|
3110
|
+
* id: "gr-1",
|
|
3111
|
+
* createdAt: new Date().toISOString(),
|
|
3112
|
+
* iteration: 3,
|
|
3113
|
+
* pattern: "Modifying package.json without running install",
|
|
3114
|
+
* sign: "Build failures after dependency changes",
|
|
3115
|
+
* avoidance: "Always run npm install after modifying package.json",
|
|
3116
|
+
* severity: "critical",
|
|
3117
|
+
* });
|
|
3118
|
+
*
|
|
3119
|
+
* // Load all guardrails
|
|
3120
|
+
* const guardrails = yield* guardrailsStore.load(sessionId);
|
|
3121
|
+
*
|
|
3122
|
+
* // Get active guardrails for prompt
|
|
3123
|
+
* const active = yield* guardrailsStore.getActive(sessionId);
|
|
3124
|
+
* ```
|
|
3125
|
+
*/
|
|
3126
|
+
interface GuardrailsStoreService {
|
|
3127
|
+
/**
|
|
3128
|
+
* Add a guardrail to the session's collection.
|
|
3129
|
+
*
|
|
3130
|
+
* @param sessionId - Session this guardrail belongs to
|
|
3131
|
+
* @param guardrail - Guardrail to add
|
|
3132
|
+
*/
|
|
3133
|
+
readonly add: (sessionId: string, guardrail: Guardrail) => Effect.Effect<void, GuardrailsStoreError>;
|
|
3134
|
+
/**
|
|
3135
|
+
* Load the complete guardrails file for a session.
|
|
3136
|
+
*
|
|
3137
|
+
* @param sessionId - Session to load guardrails for
|
|
3138
|
+
* @returns The guardrails file with all entries
|
|
3139
|
+
*/
|
|
3140
|
+
readonly load: (sessionId: string) => Effect.Effect<GuardrailsFile, GuardrailsStoreError>;
|
|
3141
|
+
/**
|
|
3142
|
+
* Get all active guardrails for a session.
|
|
3143
|
+
*
|
|
3144
|
+
* @param sessionId - Session to get guardrails for
|
|
3145
|
+
* @returns Array of active guardrails
|
|
3146
|
+
*/
|
|
3147
|
+
readonly getActive: (sessionId: string) => Effect.Effect<readonly Guardrail[], GuardrailsStoreError>;
|
|
3148
|
+
}
|
|
3149
|
+
declare const GuardrailsStore_base: Context.TagClass<GuardrailsStore, "@ferix/GuardrailsStore", GuardrailsStoreService>;
|
|
3150
|
+
/**
|
|
3151
|
+
* Effect Tag for the GuardrailsStore service.
|
|
3152
|
+
*
|
|
3153
|
+
* Use this tag to depend on guardrails storage without coupling to a specific backend.
|
|
3154
|
+
*/
|
|
3155
|
+
declare class GuardrailsStore extends GuardrailsStore_base {
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
/**
|
|
3159
|
+
* FileSystemGuardrails namespace containing the Live layer.
|
|
3160
|
+
*/
|
|
3161
|
+
declare const FileSystemGuardrails: {
|
|
3162
|
+
readonly Live: Layer.Layer<GuardrailsStore, never, never>;
|
|
3163
|
+
};
|
|
3164
|
+
|
|
3165
|
+
/**
|
|
3166
|
+
* Creates a Layer for an in-memory guardrails store.
|
|
3167
|
+
*
|
|
3168
|
+
* Each call creates a new isolated store.
|
|
3169
|
+
*
|
|
3170
|
+
* @example
|
|
3171
|
+
* ```typescript
|
|
3172
|
+
* const testLayer = MemoryGuardrails.layer();
|
|
3173
|
+
*
|
|
3174
|
+
* const program = Effect.gen(function* () {
|
|
3175
|
+
* const guardrailsStore = yield* GuardrailsStore;
|
|
3176
|
+
* yield* guardrailsStore.add(sessionId, guardrail);
|
|
3177
|
+
* });
|
|
3178
|
+
*
|
|
3179
|
+
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
3180
|
+
* ```
|
|
3181
|
+
*/
|
|
3182
|
+
declare function layer$3(): Layer.Layer<GuardrailsStore>;
|
|
3183
|
+
/**
|
|
3184
|
+
* MemoryGuardrails namespace containing the Live layer and factory.
|
|
3185
|
+
*/
|
|
3186
|
+
declare const MemoryGuardrails: {
|
|
3187
|
+
readonly Live: Layer.Layer<GuardrailsStore, never, never>;
|
|
3188
|
+
readonly layer: typeof layer$3;
|
|
3189
|
+
};
|
|
3190
|
+
|
|
3191
|
+
/**
|
|
3192
|
+
* Provider configuration schema with runtime validation.
|
|
3193
|
+
*/
|
|
3194
|
+
declare const ProviderConfigSchema: Schema.Struct<{
|
|
3195
|
+
/** Provider name */
|
|
3196
|
+
name: Schema.Literal<["claude", "cursor", "opencode"]>;
|
|
3197
|
+
/** CLI command to execute */
|
|
3198
|
+
cliCommand: typeof Schema.String;
|
|
3199
|
+
/** Default arguments for the CLI */
|
|
3200
|
+
args: Schema.Array$<typeof Schema.String>;
|
|
3201
|
+
/** Environment variables to pass */
|
|
3202
|
+
env: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
3203
|
+
/** Permission mode for the CLI */
|
|
3204
|
+
permissions: Schema.optional<Schema.Literal<["acceptEdits", "yolo", "prompt"]>>;
|
|
3205
|
+
/** URL for installation instructions */
|
|
3206
|
+
installUrl: typeof Schema.String;
|
|
3207
|
+
}>;
|
|
3208
|
+
/**
|
|
3209
|
+
* Configuration for a provider.
|
|
3210
|
+
*/
|
|
3211
|
+
type ProviderConfig = typeof ProviderConfigSchema.Type;
|
|
3212
|
+
/**
|
|
3213
|
+
* Provider interface that all LLM implementations must satisfy.
|
|
3214
|
+
*
|
|
3215
|
+
* This interface abstracts the execution of prompts across different
|
|
3216
|
+
* AI CLI tools (Claude, Cursor, etc.).
|
|
3217
|
+
*/
|
|
3218
|
+
interface Provider {
|
|
3219
|
+
/** Provider name for identification */
|
|
3220
|
+
readonly name: ProviderName;
|
|
3221
|
+
/**
|
|
3222
|
+
* Execute a prompt and return a stream of events.
|
|
3223
|
+
*
|
|
3224
|
+
* @param prompt - The prompt to send to the LLM
|
|
3225
|
+
* @param options - Optional execution options
|
|
3226
|
+
* @returns Stream of LLM events
|
|
3227
|
+
*/
|
|
3228
|
+
readonly execute: (prompt: string, options?: LLMExecuteOptions) => Stream.Stream<LLMEvent, LLMError>;
|
|
3229
|
+
}
|
|
3230
|
+
/**
|
|
3231
|
+
* Default provider configurations.
|
|
3232
|
+
* Validated at module load time using Effect Schema.
|
|
3233
|
+
*/
|
|
3234
|
+
declare const PROVIDER_CONFIGS: Readonly<Record<ProviderName, ProviderConfig>>;
|
|
3235
|
+
|
|
1506
3236
|
/**
|
|
1507
3237
|
* ClaudeCLI namespace containing the Live layer.
|
|
1508
3238
|
*/
|
|
1509
3239
|
declare const ClaudeCLI: {
|
|
1510
|
-
readonly Live:
|
|
3240
|
+
readonly Live: effect_Layer.Layer<LLM, never, never>;
|
|
3241
|
+
readonly Provider: Provider;
|
|
1511
3242
|
};
|
|
1512
3243
|
|
|
3244
|
+
/**
|
|
3245
|
+
* CursorCLI namespace containing the Live layer.
|
|
3246
|
+
*/
|
|
3247
|
+
declare const CursorCLI: {
|
|
3248
|
+
readonly Live: effect_Layer.Layer<LLM, never, never>;
|
|
3249
|
+
readonly Provider: Provider;
|
|
3250
|
+
};
|
|
3251
|
+
|
|
3252
|
+
/**
|
|
3253
|
+
* Creates a Layer for the specified provider.
|
|
3254
|
+
*
|
|
3255
|
+
* @param name - The provider name
|
|
3256
|
+
* @returns Layer providing the LLM service
|
|
3257
|
+
*/
|
|
3258
|
+
declare function createProviderLayer(name: ProviderName): Layer.Layer<LLM>;
|
|
3259
|
+
|
|
1513
3260
|
/**
|
|
1514
3261
|
* Service interface for plan persistence.
|
|
1515
3262
|
*
|
|
@@ -1600,12 +3347,108 @@ declare const FileSystemPlan: {
|
|
|
1600
3347
|
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
1601
3348
|
* ```
|
|
1602
3349
|
*/
|
|
1603
|
-
declare function layer$
|
|
3350
|
+
declare function layer$2(): Layer.Layer<PlanStore>;
|
|
1604
3351
|
/**
|
|
1605
3352
|
* MemoryPlan namespace containing the Live layer and factory.
|
|
1606
3353
|
*/
|
|
1607
3354
|
declare const MemoryPlan: {
|
|
1608
3355
|
readonly Live: Layer.Layer<PlanStore, never, never>;
|
|
3356
|
+
readonly layer: typeof layer$2;
|
|
3357
|
+
};
|
|
3358
|
+
|
|
3359
|
+
/**
|
|
3360
|
+
* Service interface for progress persistence.
|
|
3361
|
+
*
|
|
3362
|
+
* Progress is stored as an append-only log at `.ferix/plans/:sessionId/progress.md`.
|
|
3363
|
+
* Each iteration appends entries recording what happened.
|
|
3364
|
+
*
|
|
3365
|
+
* Implementations include:
|
|
3366
|
+
* - FileSystem: Persists to `.ferix/plans/` directory
|
|
3367
|
+
* - Memory: In-memory storage for testing
|
|
3368
|
+
*
|
|
3369
|
+
* @example
|
|
3370
|
+
* ```typescript
|
|
3371
|
+
* const progressStore = yield* ProgressStore;
|
|
3372
|
+
*
|
|
3373
|
+
* // Append a progress entry
|
|
3374
|
+
* yield* progressStore.append(sessionId, {
|
|
3375
|
+
* iteration: 1,
|
|
3376
|
+
* timestamp: new Date().toISOString(),
|
|
3377
|
+
* taskId: "task-1",
|
|
3378
|
+
* action: "started",
|
|
3379
|
+
* summary: "Started implementing feature X",
|
|
3380
|
+
* });
|
|
3381
|
+
*
|
|
3382
|
+
* // Load all progress
|
|
3383
|
+
* const progress = yield* progressStore.load(sessionId);
|
|
3384
|
+
*
|
|
3385
|
+
* // Get recent entries
|
|
3386
|
+
* const recent = yield* progressStore.getRecent(sessionId, 5);
|
|
3387
|
+
* ```
|
|
3388
|
+
*/
|
|
3389
|
+
interface ProgressStoreService {
|
|
3390
|
+
/**
|
|
3391
|
+
* Append a progress entry to the session's log.
|
|
3392
|
+
*
|
|
3393
|
+
* @param sessionId - Session this entry belongs to
|
|
3394
|
+
* @param entry - Progress entry to append
|
|
3395
|
+
*/
|
|
3396
|
+
readonly append: (sessionId: string, entry: ProgressEntry) => Effect.Effect<void, ProgressStoreError>;
|
|
3397
|
+
/**
|
|
3398
|
+
* Load the complete progress file for a session.
|
|
3399
|
+
*
|
|
3400
|
+
* @param sessionId - Session to load progress for
|
|
3401
|
+
* @returns The progress file with all entries
|
|
3402
|
+
*/
|
|
3403
|
+
readonly load: (sessionId: string) => Effect.Effect<ProgressFile, ProgressStoreError>;
|
|
3404
|
+
/**
|
|
3405
|
+
* Get the most recent progress entries for a session.
|
|
3406
|
+
*
|
|
3407
|
+
* @param sessionId - Session to get progress for
|
|
3408
|
+
* @param count - Number of recent entries to return
|
|
3409
|
+
* @returns Array of recent progress entries
|
|
3410
|
+
*/
|
|
3411
|
+
readonly getRecent: (sessionId: string, count: number) => Effect.Effect<readonly ProgressEntry[], ProgressStoreError>;
|
|
3412
|
+
}
|
|
3413
|
+
declare const ProgressStore_base: Context.TagClass<ProgressStore, "@ferix/ProgressStore", ProgressStoreService>;
|
|
3414
|
+
/**
|
|
3415
|
+
* Effect Tag for the ProgressStore service.
|
|
3416
|
+
*
|
|
3417
|
+
* Use this tag to depend on progress storage without coupling to a specific backend.
|
|
3418
|
+
*/
|
|
3419
|
+
declare class ProgressStore extends ProgressStore_base {
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
/**
|
|
3423
|
+
* FileSystemProgress namespace containing the Live layer.
|
|
3424
|
+
*/
|
|
3425
|
+
declare const FileSystemProgress: {
|
|
3426
|
+
readonly Live: Layer.Layer<ProgressStore, never, never>;
|
|
3427
|
+
};
|
|
3428
|
+
|
|
3429
|
+
/**
|
|
3430
|
+
* Creates a Layer for an in-memory progress store.
|
|
3431
|
+
*
|
|
3432
|
+
* Each call creates a new isolated store.
|
|
3433
|
+
*
|
|
3434
|
+
* @example
|
|
3435
|
+
* ```typescript
|
|
3436
|
+
* const testLayer = MemoryProgress.layer();
|
|
3437
|
+
*
|
|
3438
|
+
* const program = Effect.gen(function* () {
|
|
3439
|
+
* const progressStore = yield* ProgressStore;
|
|
3440
|
+
* yield* progressStore.append(sessionId, entry);
|
|
3441
|
+
* });
|
|
3442
|
+
*
|
|
3443
|
+
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
3444
|
+
* ```
|
|
3445
|
+
*/
|
|
3446
|
+
declare function layer$1(): Layer.Layer<ProgressStore>;
|
|
3447
|
+
/**
|
|
3448
|
+
* MemoryProgress namespace containing the Live layer and factory.
|
|
3449
|
+
*/
|
|
3450
|
+
declare const MemoryProgress: {
|
|
3451
|
+
readonly Live: Layer.Layer<ProgressStore, never, never>;
|
|
1609
3452
|
readonly layer: typeof layer$1;
|
|
1610
3453
|
};
|
|
1611
3454
|
|
|
@@ -1788,9 +3631,9 @@ declare const FerixParser: {
|
|
|
1788
3631
|
* Production layer bundle.
|
|
1789
3632
|
*
|
|
1790
3633
|
* Uses real implementations:
|
|
1791
|
-
* - Claude CLI for LLM
|
|
3634
|
+
* - Claude CLI for LLM (default)
|
|
1792
3635
|
* - Ferix parser for signals
|
|
1793
|
-
* - File system for plan and
|
|
3636
|
+
* - File system for plan, session, progress, guardrails, and git storage
|
|
1794
3637
|
*
|
|
1795
3638
|
* @example
|
|
1796
3639
|
* ```typescript
|
|
@@ -1804,14 +3647,34 @@ declare const FerixParser: {
|
|
|
1804
3647
|
* );
|
|
1805
3648
|
* ```
|
|
1806
3649
|
*/
|
|
1807
|
-
declare const ProductionLayers: Layer.Layer<LLM | PlanStore | SessionStore | SignalParser, never, never>;
|
|
3650
|
+
declare const ProductionLayers: Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
3651
|
+
/**
|
|
3652
|
+
* Creates production layers with a specific LLM provider.
|
|
3653
|
+
*
|
|
3654
|
+
* @param provider - The provider name to use (defaults to "claude")
|
|
3655
|
+
* @returns A layer bundle with the specified provider
|
|
3656
|
+
*
|
|
3657
|
+
* @example
|
|
3658
|
+
* ```typescript
|
|
3659
|
+
* // Use Cursor instead of Claude
|
|
3660
|
+
* const layers = createProductionLayers("cursor");
|
|
3661
|
+
*
|
|
3662
|
+
* Effect.runPromise(
|
|
3663
|
+
* program.pipe(
|
|
3664
|
+
* Stream.runForEach(console.log),
|
|
3665
|
+
* Effect.provide(layers)
|
|
3666
|
+
* )
|
|
3667
|
+
* );
|
|
3668
|
+
* ```
|
|
3669
|
+
*/
|
|
3670
|
+
declare function createProductionLayers(provider?: ProviderName): Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
1808
3671
|
/**
|
|
1809
3672
|
* Test layer bundle.
|
|
1810
3673
|
*
|
|
1811
3674
|
* Uses mock/in-memory implementations:
|
|
1812
3675
|
* - Mock LLM (configurable events)
|
|
1813
3676
|
* - Ferix parser (real implementation - pure)
|
|
1814
|
-
* - In-memory plan and
|
|
3677
|
+
* - In-memory plan, session, progress, guardrails, and git storage
|
|
1815
3678
|
*
|
|
1816
3679
|
* @example
|
|
1817
3680
|
* ```typescript
|
|
@@ -1827,7 +3690,7 @@ declare const ProductionLayers: Layer.Layer<LLM | PlanStore | SessionStore | Sig
|
|
|
1827
3690
|
* expect(result).toContainEqual({ _tag: "LoopCompleted", ... });
|
|
1828
3691
|
* ```
|
|
1829
3692
|
*/
|
|
1830
|
-
declare const TestLayers: Layer.Layer<LLM | PlanStore | SessionStore | SignalParser, never, never>;
|
|
3693
|
+
declare const TestLayers: Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
1831
3694
|
/**
|
|
1832
3695
|
* Creates a test layer bundle with custom mock LLM events.
|
|
1833
3696
|
*
|
|
@@ -1844,12 +3707,13 @@ declare const TestLayers: Layer.Layer<LLM | PlanStore | SessionStore | SignalPar
|
|
|
1844
3707
|
* Effect.runPromise(program.pipe(Effect.provide(customTestLayers)));
|
|
1845
3708
|
* ```
|
|
1846
3709
|
*/
|
|
1847
|
-
declare function createTestLayers(events: Parameters<typeof Mock.layer>[0]["events"]): Layer.Layer<LLM | PlanStore | SessionStore | SignalParser, never, never>;
|
|
3710
|
+
declare function createTestLayers(events: Parameters<typeof Mock.layer>[0]["events"]): Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
1848
3711
|
|
|
1849
3712
|
/**
|
|
1850
3713
|
* Required services for the orchestrator.
|
|
3714
|
+
* Now includes ProgressStore, GuardrailsStore, and Git for worktree support.
|
|
1851
3715
|
*/
|
|
1852
|
-
type OrchestratorServices = LLM | SignalParser | PlanStore | SessionStore;
|
|
3716
|
+
type OrchestratorServices = LLM | SignalParser | PlanStore | SessionStore | ProgressStore | GuardrailsStore | Git;
|
|
1853
3717
|
/**
|
|
1854
3718
|
* Run the ralph loop.
|
|
1855
3719
|
*
|
|
@@ -2009,4 +3873,4 @@ declare function collectEvents(config: LoopConfig, mockEvents?: readonly LLMEven
|
|
|
2009
3873
|
*/
|
|
2010
3874
|
declare function main(config: LoopConfig): Promise<void>;
|
|
2011
3875
|
|
|
2012
|
-
export { type CheckFailedEvent, CheckFailedEventSchema, type CheckFailedSignal, CheckFailedSignalSchema, type CheckPassedEvent, CheckPassedEventSchema, type CheckPassedSignal, CheckPassedSignalSchema, ClaudeCLI, 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, FileSystemPlan, FileSystemSession, type GeneratedTask, type GeneratedTaskList, GeneratedTaskListSchema, GeneratedTaskSchema, type GeneratedTaskStatus, GeneratedTaskStatusSchema, type IterationCompletedEvent, IterationCompletedEventSchema, type IterationStartedEvent, IterationStartedEventSchema, LLM, LLMError, type LLMEvent, LLMEventSchema, type LLMService, type LLMTextEvent, LLMTextEventSchema, type LLMToolEndEvent, LLMToolEndEventSchema, type LLMToolStartEvent, LLMToolStartEventSchema, type LLMToolUseEvent, LLMToolUseEventSchema, 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, MemoryPlan, 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, ProductionLayers, 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, buildPrompt, collectEvents, createHeadlessConsumer, createTUIConsumer, createTestLayers, decodeLLMEvent, decodeLoopConfig, decodePlan, decodePlanData, decodeSession, decodeSignal, decodeSignalSync, formatTasksMd, main, parseTasksMd, run, runLoop, runTest };
|
|
3876
|
+
export { type AnyToolInput, AnyToolInputSchema, type AssistantMessage, AssistantMessageSchema, type BashToolInput, BashToolInputSchema, type BranchPushedEvent, BranchPushedEventSchema, type CheckFailedEvent, CheckFailedEventSchema, type CheckFailedSignal, CheckFailedSignalSchema, type CheckPassedEvent, CheckPassedEventSchema, type CheckPassedSignal, CheckPassedSignalSchema, ClaudeCLI, type ClaudeCliEvent, ClaudeCliEventSchema, type CommitHash, type ConsoleLoggerConfig, ConsoleLoggerConfigSchema, type Consumer, type ConsumerType, ConsumerTypeSchema, type ContentBlock, type ContentBlockDelta, ContentBlockDeltaSchema, ContentBlockSchema, type ContentBlockStart, ContentBlockStartSchema, type ContentBlockStop, ContentBlockStopSchema, 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, CursorCLI, type Delta, DeltaSchema, type DiscoveryCompletedEvent, DiscoveryCompletedEventSchema, type DiscoveryStartedEvent, DiscoveryStartedEventSchema, type DomainEvent, DomainEventSchema, DomainEventUtils, type DoneEvent, DoneEventSchema, type EditToolInput, EditToolInputSchema, 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 GlobToolInput, GlobToolInputSchema, type GrepToolInput, GrepToolInputSchema, type Guardrail, type GuardrailAddedEvent, GuardrailAddedEventSchema, GuardrailSchema, type GuardrailSeverity, GuardrailSeveritySchema, type GuardrailSignal, GuardrailSignalSchema, type GuardrailsFile, GuardrailsFileSchema, GuardrailsStore, GuardrailsStoreError, type GuardrailsStoreService, type InputJsonDelta, InputJsonDeltaSchema, type IterationCompletedEvent, IterationCompletedEventSchema, type IterationStartedEvent, IterationStartedEventSchema, type KnownToolName, 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, MetricsError, Mock, Mock as MockLLM, type OpenCodeCliEvent, OpenCodeCliEventSchema, type OpenCodeCost, OpenCodeCostSchema, type OpenCodeStepFinish, OpenCodeStepFinishSchema, type OpenCodeStepPart, OpenCodeStepPartSchema, type OpenCodeStepStart, OpenCodeStepStartSchema, type OpenCodeTextEvent, OpenCodeTextEventSchema, type OpenCodeTokens, OpenCodeTokensSchema, type OpenCodeToolPart, OpenCodeToolPartSchema, type OpenCodeToolState, OpenCodeToolStateSchema, type OpenCodeToolUseEvent, OpenCodeToolUseEventSchema, OrchestratorError, type OrchestratorServices, type PRCreatedEvent, PRCreatedEventSchema, PROVIDER_CONFIGS, 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 Provider, type ProviderConfig, type ProviderName, ProviderNameSchema, type ReadToolInput, ReadToolInputSchema, RetryExhaustedError, type ReviewCompleteData, ReviewCompleteDataSchema, type ReviewCompleteEvent, ReviewCompleteEventSchema, type ReviewCompleteSignal, ReviewCompleteSignalSchema, type RunOptions, type RunOptionsData, RunOptionsDataSchema, type Session, type SessionNameDefinedSignal, SessionNameDefinedSignalSchema, type SessionNameGeneratedEvent, SessionNameGeneratedEventSchema, SessionSchema, type SessionStatus, SessionStatusSchema, SessionStore, SessionStoreError, type SessionStoreService, type Signal, type SignalAccumulator, SignalParser, type SignalParserService, SignalSchema, type StreamEventEnvelope, StreamEventEnvelopeSchema, 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 TaskToolInput, TaskToolInputSchema, type TasksDefinedData, TasksDefinedDataSchema, type TasksDefinedEvent, TasksDefinedEventSchema, type TasksDefinedSignal, TasksDefinedSignalSchema, TestLayers, type TextContentBlock, TextContentBlockSchema, type TextDelta, TextDeltaSchema, type TextEvent, TextEventSchema, TokenBudgetError, type ToolEndEvent, ToolEndEventSchema, ToolInputSchemaRegistry, type ToolStartEvent, ToolStartEventSchema, type ToolUseContentBlock, ToolUseContentBlockSchema, type ToolUseEvent, ToolUseEventSchema, type ValidatedToolUseEvent, ValidatedToolUseEventSchema, type ViewMode, ViewModeSchema, type WebFetchToolInput, WebFetchToolInputSchema, type WebSearchToolInput, WebSearchToolInputSchema, type WorktreeCreatedEvent, WorktreeCreatedEventSchema, type WorktreeInfo, type WorktreePath, type WorktreeRemovedEvent, WorktreeRemovedEventSchema, type WriteToolInput, WriteToolInputSchema, buildPrompt, collectEvents, createCheckFailedSignal, createCheckPassedSignal, createCriteriaDefinedSignal, createCriterionFailedSignal, createCriterionPassedSignal, createGuardrailSignal, createHeadlessConsumer, createLearningSignal, createLoopCompleteSignal, createPhaseCompletedSignal, createPhaseFailedSignal, createPhaseStartedSignal, createPhasesDefinedSignal, createProductionLayers, createProviderLayer, createReviewCompleteSignal, createSessionNameDefinedSignal, createTUIConsumer, createTaskCompleteSignal, createTasksDefinedSignal, createTestLayers, decodeClaudeCliEvent, decodeClaudeCliEventSync, decodeGuardrail, decodeGuardrailsFile, decodeLLMEvent, decodeLoopConfig, decodeOpenCodeCliEvent, decodeOpenCodeCliEventSync, decodePlan, decodePlanData, decodeProgressEntry, decodeProgressFile, decodeSession, decodeSignal, decodeSignalSync, formatTasksMd, getToolInputSchema, isAssistantMessage, isBashToolInput, isContentBlockDelta, isContentBlockStart, isContentBlockStop, isEditToolInput, isGlobToolInput, isGrepToolInput, isInputJsonDelta, isOpenCodeStepFinish, isOpenCodeStepStart, isOpenCodeTextEvent, isOpenCodeToolUseEvent, isReadToolInput, isStreamEventEnvelope, isTaskToolInput, isTextContentBlock, isTextDelta, isToolUseContentBlock, isWebFetchToolInput, isWebSearchToolInput, isWriteToolInput, main, parseTasksMd, run, runLoop, runTest, validateToolInput, validateToolUseEvent };
|