@fractary/faber 1.1.0 → 1.2.1
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/__tests__/integration/forge-integration.test.d.ts +7 -0
- package/dist/__tests__/integration/forge-integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/forge-integration.test.js +370 -0
- package/dist/__tests__/integration/forge-integration.test.js.map +1 -0
- package/dist/config.d.ts +45 -44
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +114 -28
- package/dist/config.js.map +1 -1
- package/dist/spec/manager.js +1 -1
- package/dist/spec/manager.js.map +1 -1
- package/dist/types.d.ts +24 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow/__tests__/agent-executor.test.d.ts +5 -0
- package/dist/workflow/__tests__/agent-executor.test.d.ts.map +1 -0
- package/dist/workflow/__tests__/agent-executor.test.js +282 -0
- package/dist/workflow/__tests__/agent-executor.test.js.map +1 -0
- package/dist/workflow/agent-executor.d.ts +59 -0
- package/dist/workflow/agent-executor.d.ts.map +1 -0
- package/dist/workflow/agent-executor.js +150 -0
- package/dist/workflow/agent-executor.js.map +1 -0
- package/dist/workflow/faber.d.ts +13 -0
- package/dist/workflow/faber.d.ts.map +1 -1
- package/dist/workflow/faber.js +87 -2
- package/dist/workflow/faber.js.map +1 -1
- package/dist/workflow/index.d.ts +2 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +3 -1
- package/dist/workflow/index.js.map +1 -1
- package/package.json +2 -1
- package/LICENSE +0 -21
- package/README.md +0 -263
package/dist/config.d.ts
CHANGED
|
@@ -96,11 +96,11 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
96
96
|
} & {
|
|
97
97
|
refineSpec: z.ZodDefault<z.ZodBoolean>;
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
|
-
enabled: boolean;
|
|
100
99
|
refineSpec: boolean;
|
|
100
|
+
enabled: boolean;
|
|
101
101
|
}, {
|
|
102
|
-
enabled?: boolean | undefined;
|
|
103
102
|
refineSpec?: boolean | undefined;
|
|
103
|
+
enabled?: boolean | undefined;
|
|
104
104
|
}>>;
|
|
105
105
|
build: z.ZodDefault<z.ZodObject<{
|
|
106
106
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -114,11 +114,11 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
114
114
|
} & {
|
|
115
115
|
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
116
116
|
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
enabled: boolean;
|
|
118
117
|
maxRetries: number;
|
|
118
|
+
enabled: boolean;
|
|
119
119
|
}, {
|
|
120
|
-
enabled?: boolean | undefined;
|
|
121
120
|
maxRetries?: number | undefined;
|
|
121
|
+
enabled?: boolean | undefined;
|
|
122
122
|
}>>;
|
|
123
123
|
release: z.ZodDefault<z.ZodObject<{
|
|
124
124
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -126,53 +126,53 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
126
126
|
requestReviews: z.ZodDefault<z.ZodBoolean>;
|
|
127
127
|
reviewers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
128
128
|
}, "strip", z.ZodTypeAny, {
|
|
129
|
-
enabled: boolean;
|
|
130
129
|
requestReviews: boolean;
|
|
131
130
|
reviewers: string[];
|
|
131
|
+
enabled: boolean;
|
|
132
132
|
}, {
|
|
133
|
-
enabled?: boolean | undefined;
|
|
134
133
|
requestReviews?: boolean | undefined;
|
|
135
134
|
reviewers?: string[] | undefined;
|
|
135
|
+
enabled?: boolean | undefined;
|
|
136
136
|
}>>;
|
|
137
137
|
}, "strip", z.ZodTypeAny, {
|
|
138
138
|
frame: {
|
|
139
139
|
enabled: boolean;
|
|
140
140
|
};
|
|
141
141
|
architect: {
|
|
142
|
-
enabled: boolean;
|
|
143
142
|
refineSpec: boolean;
|
|
143
|
+
enabled: boolean;
|
|
144
144
|
};
|
|
145
145
|
build: {
|
|
146
146
|
enabled: boolean;
|
|
147
147
|
};
|
|
148
148
|
evaluate: {
|
|
149
|
-
enabled: boolean;
|
|
150
149
|
maxRetries: number;
|
|
150
|
+
enabled: boolean;
|
|
151
151
|
};
|
|
152
152
|
release: {
|
|
153
|
-
enabled: boolean;
|
|
154
153
|
requestReviews: boolean;
|
|
155
154
|
reviewers: string[];
|
|
155
|
+
enabled: boolean;
|
|
156
156
|
};
|
|
157
157
|
}, {
|
|
158
158
|
frame?: {
|
|
159
159
|
enabled?: boolean | undefined;
|
|
160
160
|
} | undefined;
|
|
161
161
|
architect?: {
|
|
162
|
-
enabled?: boolean | undefined;
|
|
163
162
|
refineSpec?: boolean | undefined;
|
|
163
|
+
enabled?: boolean | undefined;
|
|
164
164
|
} | undefined;
|
|
165
165
|
build?: {
|
|
166
166
|
enabled?: boolean | undefined;
|
|
167
167
|
} | undefined;
|
|
168
168
|
evaluate?: {
|
|
169
|
-
enabled?: boolean | undefined;
|
|
170
169
|
maxRetries?: number | undefined;
|
|
170
|
+
enabled?: boolean | undefined;
|
|
171
171
|
} | undefined;
|
|
172
172
|
release?: {
|
|
173
|
-
enabled?: boolean | undefined;
|
|
174
173
|
requestReviews?: boolean | undefined;
|
|
175
174
|
reviewers?: string[] | undefined;
|
|
175
|
+
enabled?: boolean | undefined;
|
|
176
176
|
} | undefined;
|
|
177
177
|
}>;
|
|
178
178
|
hooks: z.ZodOptional<z.ZodObject<{
|
|
@@ -216,20 +216,20 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
216
216
|
enabled: boolean;
|
|
217
217
|
};
|
|
218
218
|
architect: {
|
|
219
|
-
enabled: boolean;
|
|
220
219
|
refineSpec: boolean;
|
|
220
|
+
enabled: boolean;
|
|
221
221
|
};
|
|
222
222
|
build: {
|
|
223
223
|
enabled: boolean;
|
|
224
224
|
};
|
|
225
225
|
evaluate: {
|
|
226
|
-
enabled: boolean;
|
|
227
226
|
maxRetries: number;
|
|
227
|
+
enabled: boolean;
|
|
228
228
|
};
|
|
229
229
|
release: {
|
|
230
|
-
enabled: boolean;
|
|
231
230
|
requestReviews: boolean;
|
|
232
231
|
reviewers: string[];
|
|
232
|
+
enabled: boolean;
|
|
233
233
|
};
|
|
234
234
|
};
|
|
235
235
|
hooks?: {
|
|
@@ -250,20 +250,20 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
250
250
|
enabled?: boolean | undefined;
|
|
251
251
|
} | undefined;
|
|
252
252
|
architect?: {
|
|
253
|
-
enabled?: boolean | undefined;
|
|
254
253
|
refineSpec?: boolean | undefined;
|
|
254
|
+
enabled?: boolean | undefined;
|
|
255
255
|
} | undefined;
|
|
256
256
|
build?: {
|
|
257
257
|
enabled?: boolean | undefined;
|
|
258
258
|
} | undefined;
|
|
259
259
|
evaluate?: {
|
|
260
|
-
enabled?: boolean | undefined;
|
|
261
260
|
maxRetries?: number | undefined;
|
|
261
|
+
enabled?: boolean | undefined;
|
|
262
262
|
} | undefined;
|
|
263
263
|
release?: {
|
|
264
|
-
enabled?: boolean | undefined;
|
|
265
264
|
requestReviews?: boolean | undefined;
|
|
266
265
|
reviewers?: string[] | undefined;
|
|
266
|
+
enabled?: boolean | undefined;
|
|
267
267
|
} | undefined;
|
|
268
268
|
};
|
|
269
269
|
autonomy?: "dry-run" | "assisted" | "guarded" | "autonomous" | undefined;
|
|
@@ -421,11 +421,11 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
421
421
|
} & {
|
|
422
422
|
refineSpec: z.ZodDefault<z.ZodBoolean>;
|
|
423
423
|
}, "strip", z.ZodTypeAny, {
|
|
424
|
-
enabled: boolean;
|
|
425
424
|
refineSpec: boolean;
|
|
425
|
+
enabled: boolean;
|
|
426
426
|
}, {
|
|
427
|
-
enabled?: boolean | undefined;
|
|
428
427
|
refineSpec?: boolean | undefined;
|
|
428
|
+
enabled?: boolean | undefined;
|
|
429
429
|
}>>;
|
|
430
430
|
build: z.ZodDefault<z.ZodObject<{
|
|
431
431
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -439,11 +439,11 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
439
439
|
} & {
|
|
440
440
|
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
441
441
|
}, "strip", z.ZodTypeAny, {
|
|
442
|
-
enabled: boolean;
|
|
443
442
|
maxRetries: number;
|
|
443
|
+
enabled: boolean;
|
|
444
444
|
}, {
|
|
445
|
-
enabled?: boolean | undefined;
|
|
446
445
|
maxRetries?: number | undefined;
|
|
446
|
+
enabled?: boolean | undefined;
|
|
447
447
|
}>>;
|
|
448
448
|
release: z.ZodDefault<z.ZodObject<{
|
|
449
449
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -451,53 +451,53 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
451
451
|
requestReviews: z.ZodDefault<z.ZodBoolean>;
|
|
452
452
|
reviewers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
453
453
|
}, "strip", z.ZodTypeAny, {
|
|
454
|
-
enabled: boolean;
|
|
455
454
|
requestReviews: boolean;
|
|
456
455
|
reviewers: string[];
|
|
456
|
+
enabled: boolean;
|
|
457
457
|
}, {
|
|
458
|
-
enabled?: boolean | undefined;
|
|
459
458
|
requestReviews?: boolean | undefined;
|
|
460
459
|
reviewers?: string[] | undefined;
|
|
460
|
+
enabled?: boolean | undefined;
|
|
461
461
|
}>>;
|
|
462
462
|
}, "strip", z.ZodTypeAny, {
|
|
463
463
|
frame: {
|
|
464
464
|
enabled: boolean;
|
|
465
465
|
};
|
|
466
466
|
architect: {
|
|
467
|
-
enabled: boolean;
|
|
468
467
|
refineSpec: boolean;
|
|
468
|
+
enabled: boolean;
|
|
469
469
|
};
|
|
470
470
|
build: {
|
|
471
471
|
enabled: boolean;
|
|
472
472
|
};
|
|
473
473
|
evaluate: {
|
|
474
|
-
enabled: boolean;
|
|
475
474
|
maxRetries: number;
|
|
475
|
+
enabled: boolean;
|
|
476
476
|
};
|
|
477
477
|
release: {
|
|
478
|
-
enabled: boolean;
|
|
479
478
|
requestReviews: boolean;
|
|
480
479
|
reviewers: string[];
|
|
480
|
+
enabled: boolean;
|
|
481
481
|
};
|
|
482
482
|
}, {
|
|
483
483
|
frame?: {
|
|
484
484
|
enabled?: boolean | undefined;
|
|
485
485
|
} | undefined;
|
|
486
486
|
architect?: {
|
|
487
|
-
enabled?: boolean | undefined;
|
|
488
487
|
refineSpec?: boolean | undefined;
|
|
488
|
+
enabled?: boolean | undefined;
|
|
489
489
|
} | undefined;
|
|
490
490
|
build?: {
|
|
491
491
|
enabled?: boolean | undefined;
|
|
492
492
|
} | undefined;
|
|
493
493
|
evaluate?: {
|
|
494
|
-
enabled?: boolean | undefined;
|
|
495
494
|
maxRetries?: number | undefined;
|
|
495
|
+
enabled?: boolean | undefined;
|
|
496
496
|
} | undefined;
|
|
497
497
|
release?: {
|
|
498
|
-
enabled?: boolean | undefined;
|
|
499
498
|
requestReviews?: boolean | undefined;
|
|
500
499
|
reviewers?: string[] | undefined;
|
|
500
|
+
enabled?: boolean | undefined;
|
|
501
501
|
} | undefined;
|
|
502
502
|
}>;
|
|
503
503
|
hooks: z.ZodOptional<z.ZodObject<{
|
|
@@ -541,20 +541,20 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
541
541
|
enabled: boolean;
|
|
542
542
|
};
|
|
543
543
|
architect: {
|
|
544
|
-
enabled: boolean;
|
|
545
544
|
refineSpec: boolean;
|
|
545
|
+
enabled: boolean;
|
|
546
546
|
};
|
|
547
547
|
build: {
|
|
548
548
|
enabled: boolean;
|
|
549
549
|
};
|
|
550
550
|
evaluate: {
|
|
551
|
-
enabled: boolean;
|
|
552
551
|
maxRetries: number;
|
|
552
|
+
enabled: boolean;
|
|
553
553
|
};
|
|
554
554
|
release: {
|
|
555
|
-
enabled: boolean;
|
|
556
555
|
requestReviews: boolean;
|
|
557
556
|
reviewers: string[];
|
|
557
|
+
enabled: boolean;
|
|
558
558
|
};
|
|
559
559
|
};
|
|
560
560
|
hooks?: {
|
|
@@ -575,20 +575,20 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
575
575
|
enabled?: boolean | undefined;
|
|
576
576
|
} | undefined;
|
|
577
577
|
architect?: {
|
|
578
|
-
enabled?: boolean | undefined;
|
|
579
578
|
refineSpec?: boolean | undefined;
|
|
579
|
+
enabled?: boolean | undefined;
|
|
580
580
|
} | undefined;
|
|
581
581
|
build?: {
|
|
582
582
|
enabled?: boolean | undefined;
|
|
583
583
|
} | undefined;
|
|
584
584
|
evaluate?: {
|
|
585
|
-
enabled?: boolean | undefined;
|
|
586
585
|
maxRetries?: number | undefined;
|
|
586
|
+
enabled?: boolean | undefined;
|
|
587
587
|
} | undefined;
|
|
588
588
|
release?: {
|
|
589
|
-
enabled?: boolean | undefined;
|
|
590
589
|
requestReviews?: boolean | undefined;
|
|
591
590
|
reviewers?: string[] | undefined;
|
|
591
|
+
enabled?: boolean | undefined;
|
|
592
592
|
} | undefined;
|
|
593
593
|
};
|
|
594
594
|
autonomy?: "dry-run" | "assisted" | "guarded" | "autonomous" | undefined;
|
|
@@ -623,20 +623,20 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
623
623
|
enabled: boolean;
|
|
624
624
|
};
|
|
625
625
|
architect: {
|
|
626
|
-
enabled: boolean;
|
|
627
626
|
refineSpec: boolean;
|
|
627
|
+
enabled: boolean;
|
|
628
628
|
};
|
|
629
629
|
build: {
|
|
630
630
|
enabled: boolean;
|
|
631
631
|
};
|
|
632
632
|
evaluate: {
|
|
633
|
-
enabled: boolean;
|
|
634
633
|
maxRetries: number;
|
|
634
|
+
enabled: boolean;
|
|
635
635
|
};
|
|
636
636
|
release: {
|
|
637
|
-
enabled: boolean;
|
|
638
637
|
requestReviews: boolean;
|
|
639
638
|
reviewers: string[];
|
|
639
|
+
enabled: boolean;
|
|
640
640
|
};
|
|
641
641
|
};
|
|
642
642
|
hooks?: {
|
|
@@ -732,20 +732,20 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
732
732
|
enabled?: boolean | undefined;
|
|
733
733
|
} | undefined;
|
|
734
734
|
architect?: {
|
|
735
|
-
enabled?: boolean | undefined;
|
|
736
735
|
refineSpec?: boolean | undefined;
|
|
736
|
+
enabled?: boolean | undefined;
|
|
737
737
|
} | undefined;
|
|
738
738
|
build?: {
|
|
739
739
|
enabled?: boolean | undefined;
|
|
740
740
|
} | undefined;
|
|
741
741
|
evaluate?: {
|
|
742
|
-
enabled?: boolean | undefined;
|
|
743
742
|
maxRetries?: number | undefined;
|
|
743
|
+
enabled?: boolean | undefined;
|
|
744
744
|
} | undefined;
|
|
745
745
|
release?: {
|
|
746
|
-
enabled?: boolean | undefined;
|
|
747
746
|
requestReviews?: boolean | undefined;
|
|
748
747
|
reviewers?: string[] | undefined;
|
|
748
|
+
enabled?: boolean | undefined;
|
|
749
749
|
} | undefined;
|
|
750
750
|
};
|
|
751
751
|
autonomy?: "dry-run" | "assisted" | "guarded" | "autonomous" | undefined;
|
|
@@ -773,9 +773,10 @@ declare const FaberConfigSchema: z.ZodObject<{
|
|
|
773
773
|
*/
|
|
774
774
|
export declare function findProjectRoot(startDir?: string): string;
|
|
775
775
|
/**
|
|
776
|
-
* Load a
|
|
776
|
+
* Load a configuration file (supports both YAML and JSON)
|
|
777
|
+
* Prefers YAML (.yaml) over JSON (.json) for backward compatibility
|
|
777
778
|
*/
|
|
778
|
-
export declare function
|
|
779
|
+
export declare function loadConfigFile<T>(configDir: string, root: string): T | null;
|
|
779
780
|
/**
|
|
780
781
|
* Load work plugin configuration
|
|
781
782
|
*
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;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AAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,UAAU,CA+BZ;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAe7D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAqBjE;AAMD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -40,7 +40,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.WorkflowConfigSchema = exports.RepoConfigSchema = exports.WorkConfigSchema = exports.FaberConfigSchema = exports.ConfigInitializer = void 0;
|
|
42
42
|
exports.findProjectRoot = findProjectRoot;
|
|
43
|
-
exports.
|
|
43
|
+
exports.loadConfigFile = loadConfigFile;
|
|
44
44
|
exports.loadWorkConfig = loadWorkConfig;
|
|
45
45
|
exports.loadRepoConfig = loadRepoConfig;
|
|
46
46
|
exports.loadFaberConfig = loadFaberConfig;
|
|
@@ -54,6 +54,7 @@ exports.loadLogConfig = loadLogConfig;
|
|
|
54
54
|
exports.loadStateConfig = loadStateConfig;
|
|
55
55
|
const fs = __importStar(require("fs"));
|
|
56
56
|
const path = __importStar(require("path"));
|
|
57
|
+
const yaml = __importStar(require("js-yaml"));
|
|
57
58
|
const zod_1 = require("zod");
|
|
58
59
|
const errors_1 = require("./errors");
|
|
59
60
|
// ============================================================================
|
|
@@ -152,10 +153,11 @@ exports.FaberConfigSchema = FaberConfigSchema;
|
|
|
152
153
|
// ============================================================================
|
|
153
154
|
// Configuration Paths
|
|
154
155
|
// ============================================================================
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
const
|
|
156
|
+
const CONFIG_FILENAME_YAML = 'config.yaml';
|
|
157
|
+
const CONFIG_FILENAME_JSON = 'config.json';
|
|
158
|
+
const FABER_CONFIG_DIR = '.fractary/plugins/faber';
|
|
159
|
+
const WORK_CONFIG_DIR = '.fractary/plugins/work';
|
|
160
|
+
const REPO_CONFIG_DIR = '.fractary/plugins/repo';
|
|
159
161
|
// ============================================================================
|
|
160
162
|
// Configuration Loader
|
|
161
163
|
// ============================================================================
|
|
@@ -181,19 +183,33 @@ function findProjectRoot(startDir) {
|
|
|
181
183
|
return process.cwd();
|
|
182
184
|
}
|
|
183
185
|
/**
|
|
184
|
-
* Load a
|
|
186
|
+
* Load a configuration file (supports both YAML and JSON)
|
|
187
|
+
* Prefers YAML (.yaml) over JSON (.json) for backward compatibility
|
|
185
188
|
*/
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
function loadConfigFile(configDir, root) {
|
|
190
|
+
// Try YAML first (preferred format)
|
|
191
|
+
const yamlPath = path.join(root, configDir, CONFIG_FILENAME_YAML);
|
|
192
|
+
if (fs.existsSync(yamlPath)) {
|
|
193
|
+
try {
|
|
194
|
+
const content = fs.readFileSync(yamlPath, 'utf-8');
|
|
195
|
+
return yaml.load(content);
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
193
200
|
}
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
// Fall back to JSON (legacy format)
|
|
202
|
+
const jsonPath = path.join(root, configDir, CONFIG_FILENAME_JSON);
|
|
203
|
+
if (fs.existsSync(jsonPath)) {
|
|
204
|
+
try {
|
|
205
|
+
const content = fs.readFileSync(jsonPath, 'utf-8');
|
|
206
|
+
return JSON.parse(content);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
196
211
|
}
|
|
212
|
+
return null;
|
|
197
213
|
}
|
|
198
214
|
/**
|
|
199
215
|
* Load work plugin configuration
|
|
@@ -205,24 +221,34 @@ function loadJsonConfig(filePath) {
|
|
|
205
221
|
*/
|
|
206
222
|
function loadWorkConfig(projectRoot, options) {
|
|
207
223
|
const root = projectRoot || findProjectRoot();
|
|
208
|
-
const
|
|
209
|
-
const config = loadJsonConfig(configPath);
|
|
224
|
+
const config = loadConfigFile(WORK_CONFIG_DIR, root);
|
|
210
225
|
if (!config) {
|
|
226
|
+
// Try loading from FABER config as fallback (but only if FABER config file exists to avoid infinite recursion)
|
|
227
|
+
const faberConfigFile = loadConfigFile(FABER_CONFIG_DIR, root);
|
|
228
|
+
if (faberConfigFile) {
|
|
229
|
+
const faberConfig = loadFaberConfig(root, { allowMissing: true });
|
|
230
|
+
if (faberConfig?.work) {
|
|
231
|
+
return faberConfig.work;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
211
234
|
if (options?.allowMissing) {
|
|
212
235
|
return null;
|
|
213
236
|
}
|
|
237
|
+
const yamlPath = path.join(root, WORK_CONFIG_DIR, CONFIG_FILENAME_YAML);
|
|
238
|
+
const jsonPath = path.join(root, WORK_CONFIG_DIR, CONFIG_FILENAME_JSON);
|
|
214
239
|
throw new errors_1.ConfigValidationError([
|
|
215
240
|
'Work plugin configuration not found.',
|
|
216
241
|
'',
|
|
217
242
|
'Run the following command to create a default configuration:',
|
|
218
243
|
' fractary init',
|
|
219
244
|
'',
|
|
220
|
-
`Expected config at: ${
|
|
245
|
+
`Expected config at: ${yamlPath} or ${jsonPath}`,
|
|
221
246
|
]);
|
|
222
247
|
}
|
|
223
248
|
// Handle handlers structure from plugins
|
|
224
249
|
const handlers = config['handlers'];
|
|
225
250
|
if (handlers) {
|
|
251
|
+
// Try complex structure first (handlers.work-tracker.active.platform)
|
|
226
252
|
const workTracker = handlers['work-tracker'];
|
|
227
253
|
if (workTracker) {
|
|
228
254
|
const platform = workTracker['active'];
|
|
@@ -236,12 +262,29 @@ function loadWorkConfig(projectRoot, options) {
|
|
|
236
262
|
};
|
|
237
263
|
}
|
|
238
264
|
}
|
|
265
|
+
// Fallback to simple structure (handlers.github)
|
|
266
|
+
const platforms = ['github', 'jira', 'linear'];
|
|
267
|
+
for (const platform of platforms) {
|
|
268
|
+
const platformConfig = handlers[platform];
|
|
269
|
+
if (platformConfig) {
|
|
270
|
+
return {
|
|
271
|
+
platform: platform,
|
|
272
|
+
owner: platformConfig['owner'],
|
|
273
|
+
repo: platformConfig['repo'],
|
|
274
|
+
project: platformConfig['project_key'],
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
239
278
|
}
|
|
240
279
|
// Fallback to direct config
|
|
241
280
|
const result = WorkConfigSchema.safeParse(config);
|
|
242
281
|
if (result.success) {
|
|
243
282
|
return result.data;
|
|
244
283
|
}
|
|
284
|
+
// If config is invalid and allowMissing is true, return null
|
|
285
|
+
if (options?.allowMissing) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
245
288
|
throw new errors_1.ConfigValidationError(['Invalid work configuration']);
|
|
246
289
|
}
|
|
247
290
|
/**
|
|
@@ -254,24 +297,34 @@ function loadWorkConfig(projectRoot, options) {
|
|
|
254
297
|
*/
|
|
255
298
|
function loadRepoConfig(projectRoot, options) {
|
|
256
299
|
const root = projectRoot || findProjectRoot();
|
|
257
|
-
const
|
|
258
|
-
const config = loadJsonConfig(configPath);
|
|
300
|
+
const config = loadConfigFile(REPO_CONFIG_DIR, root);
|
|
259
301
|
if (!config) {
|
|
302
|
+
// Try loading from FABER config as fallback (but only if FABER config file exists to avoid infinite recursion)
|
|
303
|
+
const faberConfigFile = loadConfigFile(FABER_CONFIG_DIR, root);
|
|
304
|
+
if (faberConfigFile) {
|
|
305
|
+
const faberConfig = loadFaberConfig(root, { allowMissing: true });
|
|
306
|
+
if (faberConfig?.repo) {
|
|
307
|
+
return faberConfig.repo;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
260
310
|
if (options?.allowMissing) {
|
|
261
311
|
return null;
|
|
262
312
|
}
|
|
313
|
+
const yamlPath = path.join(root, REPO_CONFIG_DIR, CONFIG_FILENAME_YAML);
|
|
314
|
+
const jsonPath = path.join(root, REPO_CONFIG_DIR, CONFIG_FILENAME_JSON);
|
|
263
315
|
throw new errors_1.ConfigValidationError([
|
|
264
316
|
'Repo plugin configuration not found.',
|
|
265
317
|
'',
|
|
266
318
|
'Run the following command to create a default configuration:',
|
|
267
319
|
' fractary init',
|
|
268
320
|
'',
|
|
269
|
-
`Expected config at: ${
|
|
321
|
+
`Expected config at: ${yamlPath} or ${jsonPath}`,
|
|
270
322
|
]);
|
|
271
323
|
}
|
|
272
324
|
// Handle handlers structure from plugins
|
|
273
325
|
const handlers = config['handlers'];
|
|
274
326
|
if (handlers) {
|
|
327
|
+
// Try complex structure first (handlers.source-control.active.platform)
|
|
275
328
|
const sourceControl = handlers['source-control'];
|
|
276
329
|
if (sourceControl) {
|
|
277
330
|
const platform = sourceControl['active'];
|
|
@@ -285,12 +338,29 @@ function loadRepoConfig(projectRoot, options) {
|
|
|
285
338
|
};
|
|
286
339
|
}
|
|
287
340
|
}
|
|
341
|
+
// Fallback to simple structure (handlers.github)
|
|
342
|
+
const platforms = ['github', 'gitlab', 'bitbucket'];
|
|
343
|
+
for (const platform of platforms) {
|
|
344
|
+
const platformConfig = handlers[platform];
|
|
345
|
+
if (platformConfig) {
|
|
346
|
+
return {
|
|
347
|
+
platform: platform,
|
|
348
|
+
owner: platformConfig['owner'],
|
|
349
|
+
repo: platformConfig['repo'],
|
|
350
|
+
defaultBranch: platformConfig['default_branch'] || 'main',
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
}
|
|
288
354
|
}
|
|
289
355
|
// Fallback to direct config
|
|
290
356
|
const result = RepoConfigSchema.safeParse(config);
|
|
291
357
|
if (result.success) {
|
|
292
358
|
return result.data;
|
|
293
359
|
}
|
|
360
|
+
// If config is invalid and allowMissing is true, return null
|
|
361
|
+
if (options?.allowMissing) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
294
364
|
throw new errors_1.ConfigValidationError(['Invalid repo configuration']);
|
|
295
365
|
}
|
|
296
366
|
/**
|
|
@@ -303,8 +373,7 @@ function loadRepoConfig(projectRoot, options) {
|
|
|
303
373
|
*/
|
|
304
374
|
function loadFaberConfig(projectRoot, options) {
|
|
305
375
|
const root = projectRoot || findProjectRoot();
|
|
306
|
-
const
|
|
307
|
-
const config = loadJsonConfig(configPath);
|
|
376
|
+
const config = loadConfigFile(FABER_CONFIG_DIR, root);
|
|
308
377
|
if (!config) {
|
|
309
378
|
// Try to construct from individual plugin configs
|
|
310
379
|
const workConfig = loadWorkConfig(root, { allowMissing: true });
|
|
@@ -335,13 +404,15 @@ function loadFaberConfig(projectRoot, options) {
|
|
|
335
404
|
if (options?.allowMissing) {
|
|
336
405
|
return null;
|
|
337
406
|
}
|
|
407
|
+
const yamlPath = path.join(root, FABER_CONFIG_DIR, CONFIG_FILENAME_YAML);
|
|
408
|
+
const jsonPath = path.join(root, FABER_CONFIG_DIR, CONFIG_FILENAME_JSON);
|
|
338
409
|
throw new errors_1.ConfigValidationError([
|
|
339
410
|
'FABER configuration not found.',
|
|
340
411
|
'',
|
|
341
412
|
'Run the following command to create a default configuration:',
|
|
342
413
|
' fractary init',
|
|
343
414
|
'',
|
|
344
|
-
`Expected config at: ${
|
|
415
|
+
`Expected config at: ${yamlPath} or ${jsonPath}`,
|
|
345
416
|
]);
|
|
346
417
|
}
|
|
347
418
|
const result = FaberConfigSchema.safeParse(config);
|
|
@@ -427,7 +498,7 @@ function writeConfig(configPath, config) {
|
|
|
427
498
|
* // ConfigInitializer.writeConfig(config);
|
|
428
499
|
*/
|
|
429
500
|
function initFaberConfig(projectRoot, config) {
|
|
430
|
-
const configPath = path.join(projectRoot,
|
|
501
|
+
const configPath = path.join(projectRoot, FABER_CONFIG_DIR, CONFIG_FILENAME_JSON);
|
|
431
502
|
const fullConfig = validateConfig({
|
|
432
503
|
schema_version: '1.0',
|
|
433
504
|
...config,
|
|
@@ -456,8 +527,15 @@ function loadSpecConfig(projectRoot, options) {
|
|
|
456
527
|
const root = projectRoot || findProjectRoot();
|
|
457
528
|
const faberConfig = loadFaberConfig(root, { allowMissing: true });
|
|
458
529
|
if (faberConfig?.artifacts?.specs) {
|
|
530
|
+
const configPath = faberConfig.artifacts.specs.local_path;
|
|
531
|
+
// If it's the schema default (/specs), use relative default instead
|
|
532
|
+
if (configPath === '/specs') {
|
|
533
|
+
return {
|
|
534
|
+
localPath: path.join(root, 'specs'),
|
|
535
|
+
};
|
|
536
|
+
}
|
|
459
537
|
return {
|
|
460
|
-
localPath: path.join(root,
|
|
538
|
+
localPath: path.isAbsolute(configPath) ? configPath : path.join(root, configPath),
|
|
461
539
|
};
|
|
462
540
|
}
|
|
463
541
|
// No FABER config found - throw or return defaults based on options
|
|
@@ -484,8 +562,9 @@ function loadLogConfig(projectRoot) {
|
|
|
484
562
|
const root = projectRoot || findProjectRoot();
|
|
485
563
|
const faberConfig = loadFaberConfig(root, { allowMissing: true });
|
|
486
564
|
if (faberConfig?.artifacts?.logs) {
|
|
565
|
+
const configPath = faberConfig.artifacts.logs.local_path;
|
|
487
566
|
return {
|
|
488
|
-
localPath: path.join(root,
|
|
567
|
+
localPath: path.isAbsolute(configPath) ? configPath : path.join(root, configPath),
|
|
489
568
|
};
|
|
490
569
|
}
|
|
491
570
|
// No FABER config found - return defaults (logs are optional)
|
|
@@ -503,8 +582,15 @@ function loadStateConfig(projectRoot) {
|
|
|
503
582
|
const root = projectRoot || findProjectRoot();
|
|
504
583
|
const faberConfig = loadFaberConfig(root, { allowMissing: true });
|
|
505
584
|
if (faberConfig?.artifacts?.state) {
|
|
585
|
+
const configPath = faberConfig.artifacts.state.local_path;
|
|
586
|
+
// If it's the schema default (.fractary/plugins/faber), use new default instead
|
|
587
|
+
if (configPath === '.fractary/plugins/faber') {
|
|
588
|
+
return {
|
|
589
|
+
localPath: path.join(root, '.faber', 'state'),
|
|
590
|
+
};
|
|
591
|
+
}
|
|
506
592
|
return {
|
|
507
|
-
localPath: path.join(root,
|
|
593
|
+
localPath: path.isAbsolute(configPath) ? configPath : path.join(root, configPath),
|
|
508
594
|
};
|
|
509
595
|
}
|
|
510
596
|
// No FABER config found - return defaults (state is optional)
|