ferix-code 0.0.2-beta.0 → 0.0.2-beta.10
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 +688 -21
- package/dist/index.js +1943 -813
- package/package.json +11 -12
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,30 @@ declare class SessionStoreError extends SessionStoreError_base<{
|
|
|
51
51
|
readonly cause?: unknown;
|
|
52
52
|
}> {
|
|
53
53
|
}
|
|
54
|
+
declare const ProgressStoreError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
|
|
55
|
+
readonly _tag: "ProgressStoreError";
|
|
56
|
+
} & Readonly<A>;
|
|
57
|
+
/**
|
|
58
|
+
* Error that occurs during progress storage operations.
|
|
59
|
+
*/
|
|
60
|
+
declare class ProgressStoreError extends ProgressStoreError_base<{
|
|
61
|
+
readonly message: string;
|
|
62
|
+
readonly operation: "append" | "load" | "getRecent";
|
|
63
|
+
readonly cause?: unknown;
|
|
64
|
+
}> {
|
|
65
|
+
}
|
|
66
|
+
declare const GuardrailsStoreError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
|
|
67
|
+
readonly _tag: "GuardrailsStoreError";
|
|
68
|
+
} & Readonly<A>;
|
|
69
|
+
/**
|
|
70
|
+
* Error that occurs during guardrails storage operations.
|
|
71
|
+
*/
|
|
72
|
+
declare class GuardrailsStoreError extends GuardrailsStoreError_base<{
|
|
73
|
+
readonly message: string;
|
|
74
|
+
readonly operation: "add" | "load" | "getActive";
|
|
75
|
+
readonly cause?: unknown;
|
|
76
|
+
}> {
|
|
77
|
+
}
|
|
54
78
|
declare const OrchestratorError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
|
|
55
79
|
readonly _tag: "OrchestratorError";
|
|
56
80
|
} & Readonly<A>;
|
|
@@ -63,10 +87,22 @@ declare class OrchestratorError extends OrchestratorError_base<{
|
|
|
63
87
|
readonly cause?: unknown;
|
|
64
88
|
}> {
|
|
65
89
|
}
|
|
90
|
+
declare const GitError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
|
|
91
|
+
readonly _tag: "GitError";
|
|
92
|
+
} & Readonly<A>;
|
|
93
|
+
/**
|
|
94
|
+
* Error that occurs during git operations.
|
|
95
|
+
*/
|
|
96
|
+
declare class GitError extends GitError_base<{
|
|
97
|
+
readonly message: string;
|
|
98
|
+
readonly operation: "createWorktree" | "removeWorktree" | "commit" | "push" | "createPR" | "status";
|
|
99
|
+
readonly cause?: unknown;
|
|
100
|
+
}> {
|
|
101
|
+
}
|
|
66
102
|
/**
|
|
67
103
|
* Union of all possible errors in the system.
|
|
68
104
|
*/
|
|
69
|
-
type FerixError = LLMError | ParseError | PlanStoreError | SessionStoreError | OrchestratorError;
|
|
105
|
+
type FerixError = LLMError | ParseError | PlanStoreError | SessionStoreError | ProgressStoreError | GuardrailsStoreError | OrchestratorError | GitError;
|
|
70
106
|
|
|
71
107
|
declare const PhasePromptOverridesSchema: Schema.Struct<{
|
|
72
108
|
breakdown: Schema.optional<typeof Schema.String>;
|
|
@@ -393,6 +429,58 @@ declare const PlanUpdateFailedEventSchema: Schema.TaggedStruct<"PlanUpdateFailed
|
|
|
393
429
|
planId: Schema.optional<typeof Schema.String>;
|
|
394
430
|
}>;
|
|
395
431
|
type PlanUpdateFailedEvent = typeof PlanUpdateFailedEventSchema.Type;
|
|
432
|
+
/**
|
|
433
|
+
* Learning recorded event - captures insights discovered during iteration.
|
|
434
|
+
*/
|
|
435
|
+
declare const LearningRecordedEventSchema: Schema.TaggedStruct<"LearningRecorded", {
|
|
436
|
+
iteration: typeof Schema.Number;
|
|
437
|
+
content: typeof Schema.String;
|
|
438
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
439
|
+
timestamp: typeof Schema.Number;
|
|
440
|
+
}>;
|
|
441
|
+
type LearningRecordedEvent = typeof LearningRecordedEventSchema.Type;
|
|
442
|
+
/**
|
|
443
|
+
* Guardrail added event - captures failure patterns to avoid.
|
|
444
|
+
*/
|
|
445
|
+
declare const GuardrailAddedEventSchema: Schema.TaggedStruct<"GuardrailAdded", {
|
|
446
|
+
id: typeof Schema.String;
|
|
447
|
+
iteration: typeof Schema.Number;
|
|
448
|
+
pattern: typeof Schema.String;
|
|
449
|
+
sign: typeof Schema.String;
|
|
450
|
+
avoidance: typeof Schema.String;
|
|
451
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
452
|
+
timestamp: typeof Schema.Number;
|
|
453
|
+
}>;
|
|
454
|
+
type GuardrailAddedEvent = typeof GuardrailAddedEventSchema.Type;
|
|
455
|
+
/**
|
|
456
|
+
* Progress updated event - signals that progress file was updated.
|
|
457
|
+
*/
|
|
458
|
+
declare const ProgressUpdatedEventSchema: Schema.TaggedStruct<"ProgressUpdated", {
|
|
459
|
+
sessionId: typeof Schema.String;
|
|
460
|
+
iteration: typeof Schema.Number;
|
|
461
|
+
taskId: typeof Schema.String;
|
|
462
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
463
|
+
timestamp: typeof Schema.Number;
|
|
464
|
+
}>;
|
|
465
|
+
type ProgressUpdatedEvent = typeof ProgressUpdatedEventSchema.Type;
|
|
466
|
+
/**
|
|
467
|
+
* Worktree created event - signals that a git worktree was created for the session.
|
|
468
|
+
*/
|
|
469
|
+
declare const WorktreeCreatedEventSchema: Schema.TaggedStruct<"WorktreeCreated", {
|
|
470
|
+
sessionId: typeof Schema.String;
|
|
471
|
+
worktreePath: typeof Schema.String;
|
|
472
|
+
branchName: typeof Schema.String;
|
|
473
|
+
timestamp: typeof Schema.Number;
|
|
474
|
+
}>;
|
|
475
|
+
type WorktreeCreatedEvent = typeof WorktreeCreatedEventSchema.Type;
|
|
476
|
+
/**
|
|
477
|
+
* Worktree removed event - signals that a git worktree was cleaned up.
|
|
478
|
+
*/
|
|
479
|
+
declare const WorktreeRemovedEventSchema: Schema.TaggedStruct<"WorktreeRemoved", {
|
|
480
|
+
sessionId: typeof Schema.String;
|
|
481
|
+
timestamp: typeof Schema.Number;
|
|
482
|
+
}>;
|
|
483
|
+
type WorktreeRemovedEvent = typeof WorktreeRemovedEventSchema.Type;
|
|
396
484
|
/**
|
|
397
485
|
* Union of all domain events.
|
|
398
486
|
*/
|
|
@@ -550,11 +638,38 @@ declare const DomainEventSchema: Schema.Union<[Schema.TaggedStruct<"LoopStarted"
|
|
|
550
638
|
operation: Schema.Literal<["create", "update"]>;
|
|
551
639
|
error: typeof Schema.String;
|
|
552
640
|
planId: Schema.optional<typeof Schema.String>;
|
|
641
|
+
}>, Schema.TaggedStruct<"LearningRecorded", {
|
|
642
|
+
iteration: typeof Schema.Number;
|
|
643
|
+
content: typeof Schema.String;
|
|
644
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
645
|
+
timestamp: typeof Schema.Number;
|
|
646
|
+
}>, Schema.TaggedStruct<"GuardrailAdded", {
|
|
647
|
+
id: typeof Schema.String;
|
|
648
|
+
iteration: typeof Schema.Number;
|
|
649
|
+
pattern: typeof Schema.String;
|
|
650
|
+
sign: typeof Schema.String;
|
|
651
|
+
avoidance: typeof Schema.String;
|
|
652
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
653
|
+
timestamp: typeof Schema.Number;
|
|
654
|
+
}>, Schema.TaggedStruct<"ProgressUpdated", {
|
|
655
|
+
sessionId: typeof Schema.String;
|
|
656
|
+
iteration: typeof Schema.Number;
|
|
657
|
+
taskId: typeof Schema.String;
|
|
658
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
659
|
+
timestamp: typeof Schema.Number;
|
|
660
|
+
}>, Schema.TaggedStruct<"WorktreeCreated", {
|
|
661
|
+
sessionId: typeof Schema.String;
|
|
662
|
+
worktreePath: typeof Schema.String;
|
|
663
|
+
branchName: typeof Schema.String;
|
|
664
|
+
timestamp: typeof Schema.Number;
|
|
665
|
+
}>, Schema.TaggedStruct<"WorktreeRemoved", {
|
|
666
|
+
sessionId: typeof Schema.String;
|
|
667
|
+
timestamp: typeof Schema.Number;
|
|
553
668
|
}>]>;
|
|
554
669
|
/**
|
|
555
670
|
* Explicit discriminated union type for proper TypeScript narrowing.
|
|
556
671
|
*/
|
|
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;
|
|
672
|
+
type DomainEvent = LoopStartedEvent | LoopCompletedEvent | LoopFailedEvent | DiscoveryStartedEvent | DiscoveryCompletedEvent | IterationStartedEvent | IterationCompletedEvent | LLMTextEvent | LLMToolStartEvent | LLMToolUseEvent | LLMToolEndEvent | TasksDefinedEvent | PhasesDefinedEvent | CriteriaDefinedEvent | PhaseStartedEvent | PhaseCompletedEvent | PhaseFailedEvent | CriterionPassedEvent | CriterionFailedEvent | CheckPassedEvent | CheckFailedEvent | ReviewCompleteEvent | TaskCompletedEvent | PlanCreatedEvent | PlanUpdatedEvent | PlanUpdateFailedEvent | LearningRecordedEvent | GuardrailAddedEvent | ProgressUpdatedEvent | WorktreeCreatedEvent | WorktreeRemovedEvent;
|
|
558
673
|
/**
|
|
559
674
|
* Type guard utilities for domain events.
|
|
560
675
|
*/
|
|
@@ -566,6 +681,73 @@ declare const DomainEventUtils: {
|
|
|
566
681
|
readonly isDiscoveryEvent: (e: DomainEvent) => e is DiscoveryStartedEvent | DiscoveryCompletedEvent;
|
|
567
682
|
};
|
|
568
683
|
|
|
684
|
+
/**
|
|
685
|
+
* Severity levels for guardrails.
|
|
686
|
+
*/
|
|
687
|
+
declare const GuardrailSeveritySchema: Schema.Literal<["warning", "critical"]>;
|
|
688
|
+
type GuardrailSeverity = typeof GuardrailSeveritySchema.Type;
|
|
689
|
+
/**
|
|
690
|
+
* A guardrail represents a failure pattern to avoid.
|
|
691
|
+
*
|
|
692
|
+
* Guardrails are learned from previous iteration failures and
|
|
693
|
+
* help prevent the LLM from repeating the same mistakes.
|
|
694
|
+
*/
|
|
695
|
+
declare const GuardrailSchema: Schema.Struct<{
|
|
696
|
+
id: typeof Schema.String;
|
|
697
|
+
createdAt: typeof Schema.String;
|
|
698
|
+
iteration: typeof Schema.Number;
|
|
699
|
+
pattern: typeof Schema.String;
|
|
700
|
+
sign: typeof Schema.String;
|
|
701
|
+
avoidance: typeof Schema.String;
|
|
702
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
703
|
+
}>;
|
|
704
|
+
type Guardrail = typeof GuardrailSchema.Type;
|
|
705
|
+
/**
|
|
706
|
+
* The complete guardrails file structure.
|
|
707
|
+
*
|
|
708
|
+
* Contains session metadata and an array of guardrails.
|
|
709
|
+
* This is the structure persisted to `.ferix/plans/:sessionId/guardrails.md`.
|
|
710
|
+
*/
|
|
711
|
+
declare const GuardrailsFileSchema: Schema.Struct<{
|
|
712
|
+
sessionId: typeof Schema.String;
|
|
713
|
+
createdAt: typeof Schema.String;
|
|
714
|
+
guardrails: Schema.Array$<Schema.Struct<{
|
|
715
|
+
id: typeof Schema.String;
|
|
716
|
+
createdAt: typeof Schema.String;
|
|
717
|
+
iteration: typeof Schema.Number;
|
|
718
|
+
pattern: typeof Schema.String;
|
|
719
|
+
sign: typeof Schema.String;
|
|
720
|
+
avoidance: typeof Schema.String;
|
|
721
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
722
|
+
}>>;
|
|
723
|
+
}>;
|
|
724
|
+
type GuardrailsFile = typeof GuardrailsFileSchema.Type;
|
|
725
|
+
/**
|
|
726
|
+
* Decode helpers.
|
|
727
|
+
*/
|
|
728
|
+
declare const decodeGuardrail: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
729
|
+
readonly iteration: number;
|
|
730
|
+
readonly id: string;
|
|
731
|
+
readonly createdAt: string;
|
|
732
|
+
readonly pattern: string;
|
|
733
|
+
readonly sign: string;
|
|
734
|
+
readonly avoidance: string;
|
|
735
|
+
readonly severity: "warning" | "critical";
|
|
736
|
+
}, effect_ParseResult.ParseError, never>;
|
|
737
|
+
declare const decodeGuardrailsFile: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
738
|
+
readonly sessionId: string;
|
|
739
|
+
readonly createdAt: string;
|
|
740
|
+
readonly guardrails: readonly {
|
|
741
|
+
readonly iteration: number;
|
|
742
|
+
readonly id: string;
|
|
743
|
+
readonly createdAt: string;
|
|
744
|
+
readonly pattern: string;
|
|
745
|
+
readonly sign: string;
|
|
746
|
+
readonly avoidance: string;
|
|
747
|
+
readonly severity: "warning" | "critical";
|
|
748
|
+
}[];
|
|
749
|
+
}, effect_ParseResult.ParseError, never>;
|
|
750
|
+
|
|
569
751
|
declare const TextEventSchema: Schema.TaggedStruct<"Text", {
|
|
570
752
|
text: typeof Schema.String;
|
|
571
753
|
}>;
|
|
@@ -769,18 +951,18 @@ declare const decodePlan: (u: unknown, overrideOptions?: effect_SchemaAST.ParseO
|
|
|
769
951
|
readonly context?: string | undefined;
|
|
770
952
|
readonly tasks: readonly {
|
|
771
953
|
readonly phases: readonly {
|
|
954
|
+
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
772
955
|
readonly id: string;
|
|
773
956
|
readonly description: string;
|
|
774
|
-
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
775
957
|
}[];
|
|
958
|
+
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
776
959
|
readonly id: string;
|
|
777
960
|
readonly description: string;
|
|
778
|
-
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
779
961
|
readonly title: string;
|
|
780
962
|
readonly criteria: readonly {
|
|
963
|
+
readonly status: "pending" | "failed" | "passed";
|
|
781
964
|
readonly id: string;
|
|
782
965
|
readonly description: string;
|
|
783
|
-
readonly status: "pending" | "failed" | "passed";
|
|
784
966
|
readonly failureReason?: string | undefined;
|
|
785
967
|
}[];
|
|
786
968
|
readonly filesToModify: readonly string[];
|
|
@@ -795,18 +977,18 @@ declare const decodePlanData: (u: unknown, overrideOptions?: effect_SchemaAST.Pa
|
|
|
795
977
|
readonly context?: string | undefined;
|
|
796
978
|
readonly tasks: readonly {
|
|
797
979
|
readonly phases: readonly {
|
|
980
|
+
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
798
981
|
readonly id: string;
|
|
799
982
|
readonly description: string;
|
|
800
|
-
readonly status: "pending" | "in_progress" | "done" | "failed";
|
|
801
983
|
}[];
|
|
984
|
+
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
802
985
|
readonly id: string;
|
|
803
986
|
readonly description: string;
|
|
804
|
-
readonly status: "planning" | "pending" | "in_progress" | "done" | "failed" | "skipped";
|
|
805
987
|
readonly title: string;
|
|
806
988
|
readonly criteria: readonly {
|
|
989
|
+
readonly status: "pending" | "failed" | "passed";
|
|
807
990
|
readonly id: string;
|
|
808
991
|
readonly description: string;
|
|
809
|
-
readonly status: "pending" | "failed" | "passed";
|
|
810
992
|
readonly failureReason?: string | undefined;
|
|
811
993
|
}[];
|
|
812
994
|
readonly filesToModify: readonly string[];
|
|
@@ -845,6 +1027,77 @@ declare const RunOptionsDataSchema: Schema.Struct<{
|
|
|
845
1027
|
}>;
|
|
846
1028
|
type RunOptionsData = typeof RunOptionsDataSchema.Type;
|
|
847
1029
|
|
|
1030
|
+
/**
|
|
1031
|
+
* Action types for progress entries.
|
|
1032
|
+
*/
|
|
1033
|
+
declare const ProgressActionSchema: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
1034
|
+
type ProgressAction = typeof ProgressActionSchema.Type;
|
|
1035
|
+
/**
|
|
1036
|
+
* A single progress entry for the append-only log.
|
|
1037
|
+
*
|
|
1038
|
+
* Each entry records what happened in an iteration, including:
|
|
1039
|
+
* - Which task was worked on
|
|
1040
|
+
* - What action was taken
|
|
1041
|
+
* - A summary of the work
|
|
1042
|
+
* - Any learnings discovered
|
|
1043
|
+
* - Files that were modified
|
|
1044
|
+
*/
|
|
1045
|
+
declare const ProgressEntrySchema: Schema.Struct<{
|
|
1046
|
+
iteration: typeof Schema.Number;
|
|
1047
|
+
timestamp: typeof Schema.String;
|
|
1048
|
+
taskId: typeof Schema.String;
|
|
1049
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
1050
|
+
summary: typeof Schema.String;
|
|
1051
|
+
learnings: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
1052
|
+
filesModified: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
1053
|
+
}>;
|
|
1054
|
+
type ProgressEntry = typeof ProgressEntrySchema.Type;
|
|
1055
|
+
/**
|
|
1056
|
+
* The complete progress file structure.
|
|
1057
|
+
*
|
|
1058
|
+
* Contains session metadata and an array of progress entries.
|
|
1059
|
+
* This is the structure persisted to `.ferix/plans/:sessionId/progress.md`.
|
|
1060
|
+
*/
|
|
1061
|
+
declare const ProgressFileSchema: Schema.Struct<{
|
|
1062
|
+
sessionId: typeof Schema.String;
|
|
1063
|
+
createdAt: typeof Schema.String;
|
|
1064
|
+
entries: Schema.Array$<Schema.Struct<{
|
|
1065
|
+
iteration: typeof Schema.Number;
|
|
1066
|
+
timestamp: typeof Schema.String;
|
|
1067
|
+
taskId: typeof Schema.String;
|
|
1068
|
+
action: Schema.Literal<["started", "completed", "failed", "learning"]>;
|
|
1069
|
+
summary: typeof Schema.String;
|
|
1070
|
+
learnings: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
1071
|
+
filesModified: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
1072
|
+
}>>;
|
|
1073
|
+
}>;
|
|
1074
|
+
type ProgressFile = typeof ProgressFileSchema.Type;
|
|
1075
|
+
/**
|
|
1076
|
+
* Decode helpers.
|
|
1077
|
+
*/
|
|
1078
|
+
declare const decodeProgressEntry: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
1079
|
+
readonly iteration: number;
|
|
1080
|
+
readonly taskId: string;
|
|
1081
|
+
readonly summary: string;
|
|
1082
|
+
readonly filesModified?: readonly string[] | undefined;
|
|
1083
|
+
readonly timestamp: string;
|
|
1084
|
+
readonly action: "failed" | "started" | "completed" | "learning";
|
|
1085
|
+
readonly learnings?: readonly string[] | undefined;
|
|
1086
|
+
}, effect_ParseResult.ParseError, never>;
|
|
1087
|
+
declare const decodeProgressFile: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
1088
|
+
readonly entries: readonly {
|
|
1089
|
+
readonly iteration: number;
|
|
1090
|
+
readonly taskId: string;
|
|
1091
|
+
readonly summary: string;
|
|
1092
|
+
readonly filesModified?: readonly string[] | undefined;
|
|
1093
|
+
readonly timestamp: string;
|
|
1094
|
+
readonly action: "failed" | "started" | "completed" | "learning";
|
|
1095
|
+
readonly learnings?: readonly string[] | undefined;
|
|
1096
|
+
}[];
|
|
1097
|
+
readonly sessionId: string;
|
|
1098
|
+
readonly createdAt: string;
|
|
1099
|
+
}, effect_ParseResult.ParseError, never>;
|
|
1100
|
+
|
|
848
1101
|
/**
|
|
849
1102
|
* Session status schema.
|
|
850
1103
|
*/
|
|
@@ -860,17 +1113,21 @@ declare const SessionSchema: Schema.Struct<{
|
|
|
860
1113
|
originalTask: typeof Schema.String;
|
|
861
1114
|
completedTasks: Schema.Array$<typeof Schema.String>;
|
|
862
1115
|
currentTaskId: Schema.optional<typeof Schema.String>;
|
|
1116
|
+
worktreePath: Schema.optional<typeof Schema.String>;
|
|
1117
|
+
branchName: Schema.optional<typeof Schema.String>;
|
|
863
1118
|
}>;
|
|
864
1119
|
type Session = typeof SessionSchema.Type;
|
|
865
1120
|
/**
|
|
866
1121
|
* Decode helper.
|
|
867
1122
|
*/
|
|
868
1123
|
declare const decodeSession: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => effect_Effect.Effect<{
|
|
1124
|
+
readonly status: "failed" | "completed" | "active" | "paused";
|
|
869
1125
|
readonly completedTasks: readonly string[];
|
|
870
1126
|
readonly id: string;
|
|
871
|
-
readonly status: "failed" | "active" | "completed" | "paused";
|
|
872
1127
|
readonly createdAt: string;
|
|
873
1128
|
readonly originalTask: string;
|
|
1129
|
+
readonly worktreePath?: string | undefined;
|
|
1130
|
+
readonly branchName?: string | undefined;
|
|
874
1131
|
readonly currentTaskId?: string | undefined;
|
|
875
1132
|
}, effect_ParseResult.ParseError, never>;
|
|
876
1133
|
|
|
@@ -1024,6 +1281,29 @@ declare const TaskCompleteSignalSchema: Schema.TaggedStruct<"TaskComplete", Read
|
|
|
1024
1281
|
type TaskCompleteSignal = typeof TaskCompleteSignalSchema.Type;
|
|
1025
1282
|
declare const LoopCompleteSignalSchema: Schema.TaggedStruct<"LoopComplete", {}>;
|
|
1026
1283
|
type LoopCompleteSignal = typeof LoopCompleteSignalSchema.Type;
|
|
1284
|
+
/**
|
|
1285
|
+
* Learning category types.
|
|
1286
|
+
*/
|
|
1287
|
+
declare const LearningCategorySchema: Schema.Literal<["success", "failure", "optimization"]>;
|
|
1288
|
+
type LearningCategory = typeof LearningCategorySchema.Type;
|
|
1289
|
+
/**
|
|
1290
|
+
* Learning signal - records insights discovered during iteration.
|
|
1291
|
+
*/
|
|
1292
|
+
declare const LearningSignalSchema: Schema.TaggedStruct<"Learning", {
|
|
1293
|
+
content: typeof Schema.String;
|
|
1294
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
1295
|
+
}>;
|
|
1296
|
+
type LearningSignal = typeof LearningSignalSchema.Type;
|
|
1297
|
+
/**
|
|
1298
|
+
* Guardrail signal - records failure patterns to avoid.
|
|
1299
|
+
*/
|
|
1300
|
+
declare const GuardrailSignalSchema: Schema.TaggedStruct<"Guardrail", {
|
|
1301
|
+
pattern: typeof Schema.String;
|
|
1302
|
+
sign: typeof Schema.String;
|
|
1303
|
+
avoidance: typeof Schema.String;
|
|
1304
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
1305
|
+
}>;
|
|
1306
|
+
type GuardrailSignal = typeof GuardrailSignalSchema.Type;
|
|
1027
1307
|
/**
|
|
1028
1308
|
* Union of all signals.
|
|
1029
1309
|
*/
|
|
@@ -1064,7 +1344,15 @@ declare const SignalSchema: Schema.Union<[Schema.TaggedStruct<"TasksDefined", Re
|
|
|
1064
1344
|
summary: typeof Schema.String;
|
|
1065
1345
|
filesModified: Schema.Array$<typeof Schema.String>;
|
|
1066
1346
|
filesCreated: Schema.Array$<typeof Schema.String>;
|
|
1067
|
-
}>>, Schema.TaggedStruct<"LoopComplete", {}
|
|
1347
|
+
}>>, Schema.TaggedStruct<"LoopComplete", {}>, Schema.TaggedStruct<"Learning", {
|
|
1348
|
+
content: typeof Schema.String;
|
|
1349
|
+
category: Schema.optional<Schema.Literal<["success", "failure", "optimization"]>>;
|
|
1350
|
+
}>, Schema.TaggedStruct<"Guardrail", {
|
|
1351
|
+
pattern: typeof Schema.String;
|
|
1352
|
+
sign: typeof Schema.String;
|
|
1353
|
+
avoidance: typeof Schema.String;
|
|
1354
|
+
severity: Schema.Literal<["warning", "critical"]>;
|
|
1355
|
+
}>]>;
|
|
1068
1356
|
type Signal = typeof SignalSchema.Type;
|
|
1069
1357
|
/**
|
|
1070
1358
|
* Decode helpers.
|
|
@@ -1122,6 +1410,16 @@ declare const decodeSignal: (u: unknown, overrideOptions?: effect_SchemaAST.Pars
|
|
|
1122
1410
|
readonly filesCreated: readonly string[];
|
|
1123
1411
|
} | {
|
|
1124
1412
|
readonly _tag: "LoopComplete";
|
|
1413
|
+
} | {
|
|
1414
|
+
readonly _tag: "Learning";
|
|
1415
|
+
readonly content: string;
|
|
1416
|
+
readonly category?: "success" | "failure" | "optimization" | undefined;
|
|
1417
|
+
} | {
|
|
1418
|
+
readonly _tag: "Guardrail";
|
|
1419
|
+
readonly pattern: string;
|
|
1420
|
+
readonly sign: string;
|
|
1421
|
+
readonly avoidance: string;
|
|
1422
|
+
readonly severity: "warning" | "critical";
|
|
1125
1423
|
}, effect_ParseResult.ParseError, never>;
|
|
1126
1424
|
declare const decodeSignalSync: (u: unknown, overrideOptions?: effect_SchemaAST.ParseOptions) => {
|
|
1127
1425
|
readonly _tag: "CheckPassed";
|
|
@@ -1176,6 +1474,16 @@ declare const decodeSignalSync: (u: unknown, overrideOptions?: effect_SchemaAST.
|
|
|
1176
1474
|
readonly filesCreated: readonly string[];
|
|
1177
1475
|
} | {
|
|
1178
1476
|
readonly _tag: "LoopComplete";
|
|
1477
|
+
} | {
|
|
1478
|
+
readonly _tag: "Learning";
|
|
1479
|
+
readonly content: string;
|
|
1480
|
+
readonly category?: "success" | "failure" | "optimization" | undefined;
|
|
1481
|
+
} | {
|
|
1482
|
+
readonly _tag: "Guardrail";
|
|
1483
|
+
readonly pattern: string;
|
|
1484
|
+
readonly sign: string;
|
|
1485
|
+
readonly avoidance: string;
|
|
1486
|
+
readonly severity: "warning" | "critical";
|
|
1179
1487
|
};
|
|
1180
1488
|
|
|
1181
1489
|
/**
|
|
@@ -1387,6 +1695,16 @@ declare function createHeadlessConsumer(): Consumer;
|
|
|
1387
1695
|
*/
|
|
1388
1696
|
declare function createTUIConsumer(): Consumer;
|
|
1389
1697
|
|
|
1698
|
+
/**
|
|
1699
|
+
* Options for LLM execution.
|
|
1700
|
+
*/
|
|
1701
|
+
interface LLMExecuteOptions {
|
|
1702
|
+
/**
|
|
1703
|
+
* Working directory for the LLM process.
|
|
1704
|
+
* Used when running in a worktree context.
|
|
1705
|
+
*/
|
|
1706
|
+
readonly cwd?: string;
|
|
1707
|
+
}
|
|
1390
1708
|
/**
|
|
1391
1709
|
* Service interface for LLM execution.
|
|
1392
1710
|
*
|
|
@@ -1413,9 +1731,10 @@ interface LLMService {
|
|
|
1413
1731
|
* The final event will be a "Done" event containing the full output.
|
|
1414
1732
|
*
|
|
1415
1733
|
* @param prompt - The prompt to send to the LLM
|
|
1734
|
+
* @param options - Optional execution options (e.g., cwd for worktree)
|
|
1416
1735
|
* @returns Stream of LLM events that can be consumed by any subscriber
|
|
1417
1736
|
*/
|
|
1418
|
-
readonly execute: (prompt: string) => Stream.Stream<LLMEvent, LLMError>;
|
|
1737
|
+
readonly execute: (prompt: string, options?: LLMExecuteOptions) => Stream.Stream<LLMEvent, LLMError>;
|
|
1419
1738
|
}
|
|
1420
1739
|
declare const LLM_base: Context.TagClass<LLM, "@ferix/LLM", LLMService>;
|
|
1421
1740
|
/**
|
|
@@ -1493,16 +1812,267 @@ declare function createMockLLM(config: MockLLMConfig): LLMService;
|
|
|
1493
1812
|
* });
|
|
1494
1813
|
* ```
|
|
1495
1814
|
*/
|
|
1496
|
-
declare function layer$
|
|
1815
|
+
declare function layer$5(config: MockLLMConfig): Layer.Layer<LLM>;
|
|
1497
1816
|
/**
|
|
1498
1817
|
* Mock namespace containing the Live layer and factory functions.
|
|
1499
1818
|
*/
|
|
1500
1819
|
declare const Mock: {
|
|
1501
1820
|
readonly Live: Layer.Layer<LLM, never, never>;
|
|
1502
|
-
readonly layer: typeof layer$
|
|
1821
|
+
readonly layer: typeof layer$5;
|
|
1503
1822
|
readonly createMockLLM: typeof createMockLLM;
|
|
1504
1823
|
};
|
|
1505
1824
|
|
|
1825
|
+
/**
|
|
1826
|
+
* Branded type for worktree paths.
|
|
1827
|
+
*/
|
|
1828
|
+
type WorktreePath = string & {
|
|
1829
|
+
readonly _brand: "WorktreePath";
|
|
1830
|
+
};
|
|
1831
|
+
/**
|
|
1832
|
+
* Branded type for commit hashes.
|
|
1833
|
+
*/
|
|
1834
|
+
type CommitHash = string & {
|
|
1835
|
+
readonly _brand: "CommitHash";
|
|
1836
|
+
};
|
|
1837
|
+
/**
|
|
1838
|
+
* Branded type for PR URLs.
|
|
1839
|
+
*/
|
|
1840
|
+
type PrUrl = string & {
|
|
1841
|
+
readonly _brand: "PrUrl";
|
|
1842
|
+
};
|
|
1843
|
+
/**
|
|
1844
|
+
* Information about a worktree.
|
|
1845
|
+
*/
|
|
1846
|
+
interface WorktreeInfo {
|
|
1847
|
+
readonly path: WorktreePath;
|
|
1848
|
+
readonly branch: string;
|
|
1849
|
+
readonly sessionId: string;
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Service interface for git operations.
|
|
1853
|
+
*
|
|
1854
|
+
* Provides worktree management for isolated session execution.
|
|
1855
|
+
* Each session runs in its own worktree with a dedicated branch.
|
|
1856
|
+
*
|
|
1857
|
+
* @example
|
|
1858
|
+
* ```typescript
|
|
1859
|
+
* const git = yield* Git;
|
|
1860
|
+
*
|
|
1861
|
+
* // Create worktree for a session
|
|
1862
|
+
* const worktreePath = yield* git.createWorktree("calm-snails-dream-123");
|
|
1863
|
+
*
|
|
1864
|
+
* // Execute work in worktree...
|
|
1865
|
+
*
|
|
1866
|
+
* // Commit changes
|
|
1867
|
+
* yield* git.commitChanges("calm-snails-dream-123", "feat: complete task 1");
|
|
1868
|
+
*
|
|
1869
|
+
* // Cleanup when done
|
|
1870
|
+
* yield* git.removeWorktree("calm-snails-dream-123");
|
|
1871
|
+
* ```
|
|
1872
|
+
*/
|
|
1873
|
+
interface GitService {
|
|
1874
|
+
/**
|
|
1875
|
+
* Create a new worktree for a session.
|
|
1876
|
+
*
|
|
1877
|
+
* Creates a worktree at `.ferix/worktrees/{sessionId}` with a new branch
|
|
1878
|
+
* `ferix/{sessionId}` based on the current HEAD or specified base branch.
|
|
1879
|
+
*
|
|
1880
|
+
* @param sessionId - Session ID to create worktree for
|
|
1881
|
+
* @param baseBranch - Optional branch to base the worktree on (defaults to HEAD)
|
|
1882
|
+
* @returns Path to the created worktree
|
|
1883
|
+
*/
|
|
1884
|
+
readonly createWorktree: (sessionId: string, baseBranch?: string) => Effect.Effect<WorktreePath, GitError>;
|
|
1885
|
+
/**
|
|
1886
|
+
* Remove a worktree for a session.
|
|
1887
|
+
*
|
|
1888
|
+
* Removes the worktree directory and cleans up git references.
|
|
1889
|
+
*
|
|
1890
|
+
* @param sessionId - Session ID whose worktree to remove
|
|
1891
|
+
*/
|
|
1892
|
+
readonly removeWorktree: (sessionId: string) => Effect.Effect<void, GitError>;
|
|
1893
|
+
/**
|
|
1894
|
+
* Get the worktree path for a session if it exists.
|
|
1895
|
+
*
|
|
1896
|
+
* @param sessionId - Session ID to check
|
|
1897
|
+
* @returns Worktree path if exists, undefined otherwise
|
|
1898
|
+
*/
|
|
1899
|
+
readonly getWorktreePath: (sessionId: string) => Effect.Effect<WorktreePath | undefined, GitError>;
|
|
1900
|
+
/**
|
|
1901
|
+
* Commit all changes in a session's worktree.
|
|
1902
|
+
*
|
|
1903
|
+
* Stages all changes and creates a commit with the given message.
|
|
1904
|
+
*
|
|
1905
|
+
* @param sessionId - Session ID whose worktree to commit
|
|
1906
|
+
* @param message - Commit message
|
|
1907
|
+
* @returns The commit hash
|
|
1908
|
+
*/
|
|
1909
|
+
readonly commitChanges: (sessionId: string, message: string) => Effect.Effect<CommitHash, GitError>;
|
|
1910
|
+
/**
|
|
1911
|
+
* Push the session's branch to the remote.
|
|
1912
|
+
*
|
|
1913
|
+
* @param sessionId - Session ID whose branch to push
|
|
1914
|
+
*/
|
|
1915
|
+
readonly pushBranch: (sessionId: string) => Effect.Effect<void, GitError>;
|
|
1916
|
+
/**
|
|
1917
|
+
* Create a pull request for the session's branch.
|
|
1918
|
+
*
|
|
1919
|
+
* Uses `gh` CLI to create a PR.
|
|
1920
|
+
*
|
|
1921
|
+
* @param sessionId - Session ID whose branch to create PR for
|
|
1922
|
+
* @param title - PR title
|
|
1923
|
+
* @param body - PR body/description
|
|
1924
|
+
* @returns URL of the created PR
|
|
1925
|
+
*/
|
|
1926
|
+
readonly createPR: (sessionId: string, title: string, body: string) => Effect.Effect<PrUrl, GitError>;
|
|
1927
|
+
/**
|
|
1928
|
+
* Get the branch name for a session.
|
|
1929
|
+
*
|
|
1930
|
+
* @param sessionId - Session ID
|
|
1931
|
+
* @returns Branch name (e.g., "ferix/calm-snails-dream-123")
|
|
1932
|
+
*/
|
|
1933
|
+
readonly getBranchName: (sessionId: string) => string;
|
|
1934
|
+
}
|
|
1935
|
+
declare const Git_base: Context.TagClass<Git, "@ferix/Git", GitService>;
|
|
1936
|
+
/**
|
|
1937
|
+
* Effect Tag for the Git service.
|
|
1938
|
+
*
|
|
1939
|
+
* Use this tag to depend on git operations without coupling to a specific implementation.
|
|
1940
|
+
*/
|
|
1941
|
+
declare class Git extends Git_base {
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* FileSystemGit namespace containing the Live layer.
|
|
1946
|
+
*/
|
|
1947
|
+
declare const FileSystemGit: {
|
|
1948
|
+
readonly Live: Layer.Layer<Git, never, never>;
|
|
1949
|
+
};
|
|
1950
|
+
|
|
1951
|
+
/**
|
|
1952
|
+
* Creates a Layer for an in-memory git service.
|
|
1953
|
+
*
|
|
1954
|
+
* Each call creates a new isolated store.
|
|
1955
|
+
*
|
|
1956
|
+
* @example
|
|
1957
|
+
* ```typescript
|
|
1958
|
+
* const testLayer = MemoryGit.layer();
|
|
1959
|
+
*
|
|
1960
|
+
* const program = Effect.gen(function* () {
|
|
1961
|
+
* const git = yield* Git;
|
|
1962
|
+
* const path = yield* git.createWorktree("test-session");
|
|
1963
|
+
* return path;
|
|
1964
|
+
* });
|
|
1965
|
+
*
|
|
1966
|
+
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
1967
|
+
* ```
|
|
1968
|
+
*/
|
|
1969
|
+
declare function layer$4(): Layer.Layer<Git>;
|
|
1970
|
+
/**
|
|
1971
|
+
* MemoryGit namespace containing the Live layer and factory.
|
|
1972
|
+
*/
|
|
1973
|
+
declare const MemoryGit: {
|
|
1974
|
+
readonly Live: Layer.Layer<Git, never, never>;
|
|
1975
|
+
readonly layer: typeof layer$4;
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* Service interface for guardrails persistence.
|
|
1980
|
+
*
|
|
1981
|
+
* Guardrails are stored at `.ferix/plans/:sessionId/guardrails.md`.
|
|
1982
|
+
* They represent failure patterns learned from previous iterations
|
|
1983
|
+
* that the LLM should avoid.
|
|
1984
|
+
*
|
|
1985
|
+
* Implementations include:
|
|
1986
|
+
* - FileSystem: Persists to `.ferix/plans/` directory
|
|
1987
|
+
* - Memory: In-memory storage for testing
|
|
1988
|
+
*
|
|
1989
|
+
* @example
|
|
1990
|
+
* ```typescript
|
|
1991
|
+
* const guardrailsStore = yield* GuardrailsStore;
|
|
1992
|
+
*
|
|
1993
|
+
* // Add a guardrail
|
|
1994
|
+
* yield* guardrailsStore.add(sessionId, {
|
|
1995
|
+
* id: "gr-1",
|
|
1996
|
+
* createdAt: new Date().toISOString(),
|
|
1997
|
+
* iteration: 3,
|
|
1998
|
+
* pattern: "Modifying package.json without running install",
|
|
1999
|
+
* sign: "Build failures after dependency changes",
|
|
2000
|
+
* avoidance: "Always run npm install after modifying package.json",
|
|
2001
|
+
* severity: "critical",
|
|
2002
|
+
* });
|
|
2003
|
+
*
|
|
2004
|
+
* // Load all guardrails
|
|
2005
|
+
* const guardrails = yield* guardrailsStore.load(sessionId);
|
|
2006
|
+
*
|
|
2007
|
+
* // Get active guardrails for prompt
|
|
2008
|
+
* const active = yield* guardrailsStore.getActive(sessionId);
|
|
2009
|
+
* ```
|
|
2010
|
+
*/
|
|
2011
|
+
interface GuardrailsStoreService {
|
|
2012
|
+
/**
|
|
2013
|
+
* Add a guardrail to the session's collection.
|
|
2014
|
+
*
|
|
2015
|
+
* @param sessionId - Session this guardrail belongs to
|
|
2016
|
+
* @param guardrail - Guardrail to add
|
|
2017
|
+
*/
|
|
2018
|
+
readonly add: (sessionId: string, guardrail: Guardrail) => Effect.Effect<void, GuardrailsStoreError>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Load the complete guardrails file for a session.
|
|
2021
|
+
*
|
|
2022
|
+
* @param sessionId - Session to load guardrails for
|
|
2023
|
+
* @returns The guardrails file with all entries
|
|
2024
|
+
*/
|
|
2025
|
+
readonly load: (sessionId: string) => Effect.Effect<GuardrailsFile, GuardrailsStoreError>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Get all active guardrails for a session.
|
|
2028
|
+
*
|
|
2029
|
+
* @param sessionId - Session to get guardrails for
|
|
2030
|
+
* @returns Array of active guardrails
|
|
2031
|
+
*/
|
|
2032
|
+
readonly getActive: (sessionId: string) => Effect.Effect<readonly Guardrail[], GuardrailsStoreError>;
|
|
2033
|
+
}
|
|
2034
|
+
declare const GuardrailsStore_base: Context.TagClass<GuardrailsStore, "@ferix/GuardrailsStore", GuardrailsStoreService>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Effect Tag for the GuardrailsStore service.
|
|
2037
|
+
*
|
|
2038
|
+
* Use this tag to depend on guardrails storage without coupling to a specific backend.
|
|
2039
|
+
*/
|
|
2040
|
+
declare class GuardrailsStore extends GuardrailsStore_base {
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* FileSystemGuardrails namespace containing the Live layer.
|
|
2045
|
+
*/
|
|
2046
|
+
declare const FileSystemGuardrails: {
|
|
2047
|
+
readonly Live: Layer.Layer<GuardrailsStore, never, never>;
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Creates a Layer for an in-memory guardrails store.
|
|
2052
|
+
*
|
|
2053
|
+
* Each call creates a new isolated store.
|
|
2054
|
+
*
|
|
2055
|
+
* @example
|
|
2056
|
+
* ```typescript
|
|
2057
|
+
* const testLayer = MemoryGuardrails.layer();
|
|
2058
|
+
*
|
|
2059
|
+
* const program = Effect.gen(function* () {
|
|
2060
|
+
* const guardrailsStore = yield* GuardrailsStore;
|
|
2061
|
+
* yield* guardrailsStore.add(sessionId, guardrail);
|
|
2062
|
+
* });
|
|
2063
|
+
*
|
|
2064
|
+
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
2065
|
+
* ```
|
|
2066
|
+
*/
|
|
2067
|
+
declare function layer$3(): Layer.Layer<GuardrailsStore>;
|
|
2068
|
+
/**
|
|
2069
|
+
* MemoryGuardrails namespace containing the Live layer and factory.
|
|
2070
|
+
*/
|
|
2071
|
+
declare const MemoryGuardrails: {
|
|
2072
|
+
readonly Live: Layer.Layer<GuardrailsStore, never, never>;
|
|
2073
|
+
readonly layer: typeof layer$3;
|
|
2074
|
+
};
|
|
2075
|
+
|
|
1506
2076
|
/**
|
|
1507
2077
|
* ClaudeCLI namespace containing the Live layer.
|
|
1508
2078
|
*/
|
|
@@ -1600,12 +2170,108 @@ declare const FileSystemPlan: {
|
|
|
1600
2170
|
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
1601
2171
|
* ```
|
|
1602
2172
|
*/
|
|
1603
|
-
declare function layer$
|
|
2173
|
+
declare function layer$2(): Layer.Layer<PlanStore>;
|
|
1604
2174
|
/**
|
|
1605
2175
|
* MemoryPlan namespace containing the Live layer and factory.
|
|
1606
2176
|
*/
|
|
1607
2177
|
declare const MemoryPlan: {
|
|
1608
2178
|
readonly Live: Layer.Layer<PlanStore, never, never>;
|
|
2179
|
+
readonly layer: typeof layer$2;
|
|
2180
|
+
};
|
|
2181
|
+
|
|
2182
|
+
/**
|
|
2183
|
+
* Service interface for progress persistence.
|
|
2184
|
+
*
|
|
2185
|
+
* Progress is stored as an append-only log at `.ferix/plans/:sessionId/progress.md`.
|
|
2186
|
+
* Each iteration appends entries recording what happened.
|
|
2187
|
+
*
|
|
2188
|
+
* Implementations include:
|
|
2189
|
+
* - FileSystem: Persists to `.ferix/plans/` directory
|
|
2190
|
+
* - Memory: In-memory storage for testing
|
|
2191
|
+
*
|
|
2192
|
+
* @example
|
|
2193
|
+
* ```typescript
|
|
2194
|
+
* const progressStore = yield* ProgressStore;
|
|
2195
|
+
*
|
|
2196
|
+
* // Append a progress entry
|
|
2197
|
+
* yield* progressStore.append(sessionId, {
|
|
2198
|
+
* iteration: 1,
|
|
2199
|
+
* timestamp: new Date().toISOString(),
|
|
2200
|
+
* taskId: "task-1",
|
|
2201
|
+
* action: "started",
|
|
2202
|
+
* summary: "Started implementing feature X",
|
|
2203
|
+
* });
|
|
2204
|
+
*
|
|
2205
|
+
* // Load all progress
|
|
2206
|
+
* const progress = yield* progressStore.load(sessionId);
|
|
2207
|
+
*
|
|
2208
|
+
* // Get recent entries
|
|
2209
|
+
* const recent = yield* progressStore.getRecent(sessionId, 5);
|
|
2210
|
+
* ```
|
|
2211
|
+
*/
|
|
2212
|
+
interface ProgressStoreService {
|
|
2213
|
+
/**
|
|
2214
|
+
* Append a progress entry to the session's log.
|
|
2215
|
+
*
|
|
2216
|
+
* @param sessionId - Session this entry belongs to
|
|
2217
|
+
* @param entry - Progress entry to append
|
|
2218
|
+
*/
|
|
2219
|
+
readonly append: (sessionId: string, entry: ProgressEntry) => Effect.Effect<void, ProgressStoreError>;
|
|
2220
|
+
/**
|
|
2221
|
+
* Load the complete progress file for a session.
|
|
2222
|
+
*
|
|
2223
|
+
* @param sessionId - Session to load progress for
|
|
2224
|
+
* @returns The progress file with all entries
|
|
2225
|
+
*/
|
|
2226
|
+
readonly load: (sessionId: string) => Effect.Effect<ProgressFile, ProgressStoreError>;
|
|
2227
|
+
/**
|
|
2228
|
+
* Get the most recent progress entries for a session.
|
|
2229
|
+
*
|
|
2230
|
+
* @param sessionId - Session to get progress for
|
|
2231
|
+
* @param count - Number of recent entries to return
|
|
2232
|
+
* @returns Array of recent progress entries
|
|
2233
|
+
*/
|
|
2234
|
+
readonly getRecent: (sessionId: string, count: number) => Effect.Effect<readonly ProgressEntry[], ProgressStoreError>;
|
|
2235
|
+
}
|
|
2236
|
+
declare const ProgressStore_base: Context.TagClass<ProgressStore, "@ferix/ProgressStore", ProgressStoreService>;
|
|
2237
|
+
/**
|
|
2238
|
+
* Effect Tag for the ProgressStore service.
|
|
2239
|
+
*
|
|
2240
|
+
* Use this tag to depend on progress storage without coupling to a specific backend.
|
|
2241
|
+
*/
|
|
2242
|
+
declare class ProgressStore extends ProgressStore_base {
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
/**
|
|
2246
|
+
* FileSystemProgress namespace containing the Live layer.
|
|
2247
|
+
*/
|
|
2248
|
+
declare const FileSystemProgress: {
|
|
2249
|
+
readonly Live: Layer.Layer<ProgressStore, never, never>;
|
|
2250
|
+
};
|
|
2251
|
+
|
|
2252
|
+
/**
|
|
2253
|
+
* Creates a Layer for an in-memory progress store.
|
|
2254
|
+
*
|
|
2255
|
+
* Each call creates a new isolated store.
|
|
2256
|
+
*
|
|
2257
|
+
* @example
|
|
2258
|
+
* ```typescript
|
|
2259
|
+
* const testLayer = MemoryProgress.layer();
|
|
2260
|
+
*
|
|
2261
|
+
* const program = Effect.gen(function* () {
|
|
2262
|
+
* const progressStore = yield* ProgressStore;
|
|
2263
|
+
* yield* progressStore.append(sessionId, entry);
|
|
2264
|
+
* });
|
|
2265
|
+
*
|
|
2266
|
+
* Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
|
2267
|
+
* ```
|
|
2268
|
+
*/
|
|
2269
|
+
declare function layer$1(): Layer.Layer<ProgressStore>;
|
|
2270
|
+
/**
|
|
2271
|
+
* MemoryProgress namespace containing the Live layer and factory.
|
|
2272
|
+
*/
|
|
2273
|
+
declare const MemoryProgress: {
|
|
2274
|
+
readonly Live: Layer.Layer<ProgressStore, never, never>;
|
|
1609
2275
|
readonly layer: typeof layer$1;
|
|
1610
2276
|
};
|
|
1611
2277
|
|
|
@@ -1790,7 +2456,7 @@ declare const FerixParser: {
|
|
|
1790
2456
|
* Uses real implementations:
|
|
1791
2457
|
* - Claude CLI for LLM
|
|
1792
2458
|
* - Ferix parser for signals
|
|
1793
|
-
* - File system for plan and
|
|
2459
|
+
* - File system for plan, session, progress, guardrails, and git storage
|
|
1794
2460
|
*
|
|
1795
2461
|
* @example
|
|
1796
2462
|
* ```typescript
|
|
@@ -1804,14 +2470,14 @@ declare const FerixParser: {
|
|
|
1804
2470
|
* );
|
|
1805
2471
|
* ```
|
|
1806
2472
|
*/
|
|
1807
|
-
declare const ProductionLayers: Layer.Layer<LLM | PlanStore | SessionStore | SignalParser, never, never>;
|
|
2473
|
+
declare const ProductionLayers: Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
1808
2474
|
/**
|
|
1809
2475
|
* Test layer bundle.
|
|
1810
2476
|
*
|
|
1811
2477
|
* Uses mock/in-memory implementations:
|
|
1812
2478
|
* - Mock LLM (configurable events)
|
|
1813
2479
|
* - Ferix parser (real implementation - pure)
|
|
1814
|
-
* - In-memory plan and
|
|
2480
|
+
* - In-memory plan, session, progress, guardrails, and git storage
|
|
1815
2481
|
*
|
|
1816
2482
|
* @example
|
|
1817
2483
|
* ```typescript
|
|
@@ -1827,7 +2493,7 @@ declare const ProductionLayers: Layer.Layer<LLM | PlanStore | SessionStore | Sig
|
|
|
1827
2493
|
* expect(result).toContainEqual({ _tag: "LoopCompleted", ... });
|
|
1828
2494
|
* ```
|
|
1829
2495
|
*/
|
|
1830
|
-
declare const TestLayers: Layer.Layer<LLM | PlanStore | SessionStore | SignalParser, never, never>;
|
|
2496
|
+
declare const TestLayers: Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
1831
2497
|
/**
|
|
1832
2498
|
* Creates a test layer bundle with custom mock LLM events.
|
|
1833
2499
|
*
|
|
@@ -1844,12 +2510,13 @@ declare const TestLayers: Layer.Layer<LLM | PlanStore | SessionStore | SignalPar
|
|
|
1844
2510
|
* Effect.runPromise(program.pipe(Effect.provide(customTestLayers)));
|
|
1845
2511
|
* ```
|
|
1846
2512
|
*/
|
|
1847
|
-
declare function createTestLayers(events: Parameters<typeof Mock.layer>[0]["events"]): Layer.Layer<LLM | PlanStore | SessionStore | SignalParser, never, never>;
|
|
2513
|
+
declare function createTestLayers(events: Parameters<typeof Mock.layer>[0]["events"]): Layer.Layer<Git | GuardrailsStore | LLM | PlanStore | ProgressStore | SessionStore | SignalParser, never, never>;
|
|
1848
2514
|
|
|
1849
2515
|
/**
|
|
1850
2516
|
* Required services for the orchestrator.
|
|
2517
|
+
* Now includes ProgressStore, GuardrailsStore, and Git for worktree support.
|
|
1851
2518
|
*/
|
|
1852
|
-
type OrchestratorServices = LLM | SignalParser | PlanStore | SessionStore;
|
|
2519
|
+
type OrchestratorServices = LLM | SignalParser | PlanStore | SessionStore | ProgressStore | GuardrailsStore | Git;
|
|
1853
2520
|
/**
|
|
1854
2521
|
* Run the ralph loop.
|
|
1855
2522
|
*
|
|
@@ -2009,4 +2676,4 @@ declare function collectEvents(config: LoopConfig, mockEvents?: readonly LLMEven
|
|
|
2009
2676
|
*/
|
|
2010
2677
|
declare function main(config: LoopConfig): Promise<void>;
|
|
2011
2678
|
|
|
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 };
|
|
2679
|
+
export { type CheckFailedEvent, CheckFailedEventSchema, type CheckFailedSignal, CheckFailedSignalSchema, type CheckPassedEvent, CheckPassedEventSchema, type CheckPassedSignal, CheckPassedSignalSchema, ClaudeCLI, type CommitHash, type ConsoleLoggerConfig, ConsoleLoggerConfigSchema, type Consumer, type ConsumerType, ConsumerTypeSchema, type CriteriaDefinedData, CriteriaDefinedDataSchema, type CriteriaDefinedEvent, CriteriaDefinedEventSchema, type CriteriaDefinedSignal, CriteriaDefinedSignalSchema, type Criterion, type CriterionBasicInfo, CriterionBasicInfoSchema, type CriterionFailedData, CriterionFailedDataSchema, type CriterionFailedEvent, CriterionFailedEventSchema, type CriterionFailedSignal, CriterionFailedSignalSchema, type CriterionIdData, CriterionIdDataSchema, type CriterionPassedEvent, CriterionPassedEventSchema, type CriterionPassedSignal, CriterionPassedSignalSchema, CriterionSchema, type CriterionStatus, CriterionStatusSchema, type DiscoveryCompletedEvent, DiscoveryCompletedEventSchema, type DiscoveryStartedEvent, DiscoveryStartedEventSchema, type DomainEvent, DomainEventSchema, DomainEventUtils, type DoneEvent, DoneEventSchema, type ExecutionMode, ExecutionModeSchema, type FerixError, FerixParser, type FileLoggerConfig, FileLoggerConfigSchema, FileSystemGit, FileSystemGuardrails, FileSystemPlan, FileSystemProgress, FileSystemSession, type GeneratedTask, type GeneratedTaskList, GeneratedTaskListSchema, GeneratedTaskSchema, type GeneratedTaskStatus, GeneratedTaskStatusSchema, Git, GitError, type GitService, type Guardrail, type GuardrailAddedEvent, GuardrailAddedEventSchema, GuardrailSchema, type GuardrailSeverity, GuardrailSeveritySchema, type GuardrailSignal, GuardrailSignalSchema, type GuardrailsFile, GuardrailsFileSchema, GuardrailsStore, GuardrailsStoreError, type GuardrailsStoreService, type IterationCompletedEvent, IterationCompletedEventSchema, type IterationStartedEvent, IterationStartedEventSchema, LLM, LLMError, type LLMEvent, LLMEventSchema, type LLMExecuteOptions, type LLMService, type LLMTextEvent, LLMTextEventSchema, type LLMToolEndEvent, LLMToolEndEventSchema, type LLMToolStartEvent, LLMToolStartEventSchema, type LLMToolUseEvent, LLMToolUseEventSchema, type LearningCategory, LearningCategorySchema, type LearningRecordedEvent, LearningRecordedEventSchema, type LearningSignal, LearningSignalSchema, type LogEntry, LogEntrySchema, type LogLevel, LogLevelSchema, type LoopCompleteSignal, LoopCompleteSignalSchema, type LoopCompletedEvent, LoopCompletedEventSchema, type LoopConfig, LoopConfigSchema, type LoopError, LoopErrorSchema, type LoopFailedEvent, LoopFailedEventSchema, type LoopStartedEvent, LoopStartedEventSchema, type LoopStatus, LoopStatusSchema, type LoopSummary, LoopSummarySchema, MemoryGit, MemoryGuardrails, MemoryPlan, MemoryProgress, MemorySession, Mock, Mock as MockLLM, OrchestratorError, type OrchestratorServices, ParseError, type Phase, type PhaseBasicInfo, PhaseBasicInfoSchema, type PhaseCompletedEvent, PhaseCompletedEventSchema, type PhaseCompletedSignal, PhaseCompletedSignalSchema, type PhaseFailedData, PhaseFailedDataSchema, type PhaseFailedEvent, PhaseFailedEventSchema, type PhaseFailedSignal, PhaseFailedSignalSchema, type PhaseIdData, PhaseIdDataSchema, type PhasePromptOverrides, PhasePromptOverridesSchema, PhaseSchema, type PhaseStartedEvent, PhaseStartedEventSchema, type PhaseStartedSignal, PhaseStartedSignalSchema, type PhaseStatus, PhaseStatusSchema, type PhasesDefinedData, PhasesDefinedDataSchema, type PhasesDefinedEvent, PhasesDefinedEventSchema, type PhasesDefinedSignal, PhasesDefinedSignalSchema, type Plan, type PlanCreatedEvent, PlanCreatedEventSchema, type PlanData, PlanDataSchema, PlanId, PlanSchema, PlanStore, PlanStoreError, type PlanStoreService, type PlanUpdateFailedEvent, PlanUpdateFailedEventSchema, type PlanUpdatedEvent, PlanUpdatedEventSchema, type PrUrl, ProductionLayers, type ProgressAction, ProgressActionSchema, type ProgressEntry, ProgressEntrySchema, type ProgressFile, ProgressFileSchema, ProgressStore, ProgressStoreError, type ProgressStoreService, type ProgressUpdatedEvent, ProgressUpdatedEventSchema, type PromptConfig, PromptConfigSchema, type ReviewCompleteData, ReviewCompleteDataSchema, type ReviewCompleteEvent, ReviewCompleteEventSchema, type ReviewCompleteSignal, ReviewCompleteSignalSchema, type RunOptions, type RunOptionsData, RunOptionsDataSchema, type Session, SessionSchema, type SessionStatus, SessionStatusSchema, SessionStore, SessionStoreError, type SessionStoreService, type Signal, type SignalAccumulator, SignalParser, type SignalParserService, SignalSchema, type TUICriterion, TUICriterionSchema, type TUICriterionStatus, TUICriterionStatusSchema, type TUIPhase, TUIPhaseSchema, type TUIPhaseStatus, TUIPhaseStatusSchema, type TUIState, TUIStateSchema, type TUITask, TUITaskSchema, type TUITaskStatus, TUITaskStatusSchema, type Task, type TaskBasicInfo, TaskBasicInfoSchema, type TaskCompleteData, TaskCompleteDataSchema, type TaskCompleteSignal, type TaskCompleteSignalData, TaskCompleteSignalDataSchema, TaskCompleteSignalSchema, type TaskCompletedEvent, TaskCompletedEventSchema, TaskSchema, type TaskStatus, TaskStatusSchema, type TasksDefinedData, TasksDefinedDataSchema, type TasksDefinedEvent, TasksDefinedEventSchema, type TasksDefinedSignal, TasksDefinedSignalSchema, TestLayers, type TextEvent, TextEventSchema, type ToolEndEvent, ToolEndEventSchema, type ToolStartEvent, ToolStartEventSchema, type ToolUseEvent, ToolUseEventSchema, type ViewMode, ViewModeSchema, type WorktreeCreatedEvent, WorktreeCreatedEventSchema, type WorktreeInfo, type WorktreePath, type WorktreeRemovedEvent, WorktreeRemovedEventSchema, buildPrompt, collectEvents, createHeadlessConsumer, createTUIConsumer, createTestLayers, decodeGuardrail, decodeGuardrailsFile, decodeLLMEvent, decodeLoopConfig, decodePlan, decodePlanData, decodeProgressEntry, decodeProgressFile, decodeSession, decodeSignal, decodeSignalSync, formatTasksMd, main, parseTasksMd, run, runLoop, runTest };
|