faf-cli 3.1.6 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +57 -1
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +90 -12
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/check.d.ts +19 -3
  6. package/dist/commands/check.d.ts.map +1 -1
  7. package/dist/commands/check.js +280 -37
  8. package/dist/commands/check.js.map +1 -1
  9. package/dist/commands/human.d.ts +19 -0
  10. package/dist/commands/human.d.ts.map +1 -0
  11. package/dist/commands/human.js +205 -0
  12. package/dist/commands/human.js.map +1 -0
  13. package/dist/commands/readme.d.ts +16 -0
  14. package/dist/commands/readme.d.ts.map +1 -0
  15. package/dist/commands/readme.js +453 -0
  16. package/dist/commands/readme.js.map +1 -0
  17. package/dist/engines/fab-formats-processor.d.ts +8 -0
  18. package/dist/engines/fab-formats-processor.d.ts.map +1 -1
  19. package/dist/engines/fab-formats-processor.js +78 -1
  20. package/dist/engines/fab-formats-processor.js.map +1 -1
  21. package/dist/framework-detector.d.ts.map +1 -1
  22. package/dist/framework-detector.js +7 -0
  23. package/dist/framework-detector.js.map +1 -1
  24. package/dist/utils/fab-formats-engine.d.ts +7 -0
  25. package/dist/utils/fab-formats-engine.d.ts.map +1 -1
  26. package/dist/utils/fab-formats-engine.js +23 -1
  27. package/dist/utils/fab-formats-engine.js.map +1 -1
  28. package/dist/utils/file-utils.d.ts.map +1 -1
  29. package/dist/utils/file-utils.js +20 -1
  30. package/dist/utils/file-utils.js.map +1 -1
  31. package/dist/utils/turbo-cat-knowledge.d.ts +2 -0
  32. package/dist/utils/turbo-cat-knowledge.d.ts.map +1 -1
  33. package/dist/utils/turbo-cat-knowledge.js +15 -0
  34. package/dist/utils/turbo-cat-knowledge.js.map +1 -1
  35. package/dist/utils/turbo-cat.d.ts +7 -0
  36. package/dist/utils/turbo-cat.d.ts.map +1 -1
  37. package/dist/utils/turbo-cat.js +30 -2
  38. package/dist/utils/turbo-cat.js.map +1 -1
  39. package/package.json +1 -1
@@ -1,58 +1,301 @@
1
1
  "use strict";
2
2
  /**
3
- * 🔍 Check Command - Merged audit + validate functionality
4
- * Comprehensive .faf file validation and freshness checking
3
+ * 🔍 Check Command - Quality inspection & protection system
4
+ * Pre-flight inspection for human_context quality + field protection
5
+ *
6
+ * Features:
7
+ * - Quality detection: empty/generic/good/excellent per field
8
+ * - Protection system: lock good content from being overwritten
9
+ * - Integration with faf auto to respect protected fields
5
10
  */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
6
44
  Object.defineProperty(exports, "__esModule", { value: true });
7
45
  exports.checkCommand = checkCommand;
46
+ exports.isFieldProtected = isFieldProtected;
47
+ exports.getProtectedFields = getProtectedFields;
8
48
  const validate_1 = require("./validate");
9
49
  const audit_1 = require("./audit");
10
50
  const championship_style_1 = require("../utils/championship-style");
51
+ const file_utils_1 = require("../utils/file-utils");
52
+ const yaml_1 = require("../fix-once/yaml");
53
+ const fs_1 = require("fs");
54
+ const path = __importStar(require("path"));
55
+ // Generic values that indicate low quality
56
+ const GENERIC_PATTERNS = [
57
+ /^unknown$/i,
58
+ /^none$/i,
59
+ /^n\/a$/i,
60
+ /^todo$/i,
61
+ /^tbd$/i,
62
+ /^placeholder$/i,
63
+ /^fill this/i,
64
+ /^add your/i,
65
+ /^describe/i,
66
+ /^your project/i,
67
+ /^my project/i,
68
+ /^\[.*\]$/, // [bracketed placeholders]
69
+ /^<.*>$/, // <angle bracket placeholders>
70
+ ];
71
+ // Quality scoring criteria per field
72
+ const QUALITY_CRITERIA = {
73
+ who: {
74
+ minLength: 10,
75
+ excellentPatterns: [/team|company|developer|engineer|community/i]
76
+ },
77
+ what: {
78
+ minLength: 20,
79
+ excellentPatterns: [/that|which|for|enables|provides/i]
80
+ },
81
+ why: {
82
+ minLength: 15,
83
+ excellentPatterns: [/faster|better|easier|simpler|efficient|\d+x/i]
84
+ },
85
+ where: {
86
+ minLength: 8,
87
+ excellentPatterns: [/browser|server|edge|cloud|local|npm|cargo/i]
88
+ },
89
+ when: {
90
+ minLength: 5,
91
+ excellentPatterns: [/v\d|version|\d{4}|release|milestone/i]
92
+ },
93
+ how: {
94
+ minLength: 5,
95
+ excellentPatterns: [/npm|cargo|pip|run|install|clone|demo/i]
96
+ },
97
+ };
98
+ /**
99
+ * Assess quality of a single field value
100
+ */
101
+ function assessFieldQuality(field, value) {
102
+ // Empty check
103
+ if (!value || value.trim() === '') {
104
+ return 'empty';
105
+ }
106
+ const trimmed = value.trim();
107
+ // Generic check
108
+ for (const pattern of GENERIC_PATTERNS) {
109
+ if (pattern.test(trimmed)) {
110
+ return 'generic';
111
+ }
112
+ }
113
+ const criteria = QUALITY_CRITERIA[field] || { minLength: 10 };
114
+ // Length check for good
115
+ if (trimmed.length < criteria.minLength) {
116
+ return 'generic';
117
+ }
118
+ // Excellent check
119
+ if (criteria.excellentPatterns) {
120
+ for (const pattern of criteria.excellentPatterns) {
121
+ if (pattern.test(trimmed)) {
122
+ return 'excellent';
123
+ }
124
+ }
125
+ }
126
+ return 'good';
127
+ }
11
128
  /**
12
- * Comprehensive check command - combines validation and audit
129
+ * Get quality indicator emoji
130
+ */
131
+ function getQualityIndicator(quality) {
132
+ switch (quality) {
133
+ case 'empty': return '⬜'; // Empty slot
134
+ case 'generic': return '🟡'; // Needs improvement
135
+ case 'good': return '🟢'; // Good quality
136
+ case 'excellent': return '💎'; // Excellent
137
+ }
138
+ }
139
+ /**
140
+ * Get protection status indicator
141
+ */
142
+ function getProtectionIndicator(isProtected) {
143
+ return isProtected ? '🔒' : ' ';
144
+ }
145
+ /**
146
+ * Inspect human_context quality and optionally protect fields
13
147
  */
14
148
  async function checkCommand(options = {}) {
15
149
  try {
16
150
  const startTime = Date.now();
17
- console.log(championship_style_1.FAF_COLORS.fafCyan(`${championship_style_1.FAF_ICONS.magnifying_glass} Comprehensive .faf Check`));
18
- // If no specific options, do both format and freshness checks
19
- const checkFormat = options.format || (!options.fresh && !options.format);
20
- const checkFreshness = options.fresh || (!options.fresh && !options.format);
21
- let hasErrors = false;
22
- if (checkFormat) {
23
- console.log(`${championship_style_1.FAF_COLORS.fafCyan('├─ ')}Checking format and validity...`);
24
- try {
25
- // Call validate with proper parameters
26
- await (0, validate_1.validateFafFile)(undefined, {
27
- verbose: options.detailed
28
- });
29
- }
30
- catch {
31
- hasErrors = true;
32
- }
33
- }
34
- if (checkFreshness) {
35
- console.log(`${championship_style_1.FAF_COLORS.fafCyan('├─ ')}Checking freshness and completeness...`);
36
- try {
37
- // Call audit with proper parameters
38
- await (0, audit_1.auditFafFile)(undefined, {
39
- // AuditOptions doesn't have detailed, use defaults
40
- });
41
- }
42
- catch {
43
- hasErrors = true;
44
- }
45
- }
46
- const duration = Date.now() - startTime;
47
- if (!hasErrors) {
151
+ // Find and load the .faf file
152
+ const fafPath = await (0, file_utils_1.findFafFile)(process.cwd());
153
+ if (!fafPath) {
154
+ console.error(championship_style_1.FAF_COLORS.fafOrange('❌ No .faf file found. Run: faf init'));
155
+ process.exit(1);
156
+ }
157
+ const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
158
+ const fafData = (0, yaml_1.parse)(fafContent) || {};
159
+ const humanContext = fafData.human_context || {};
160
+ const protectedFields = fafData._protected_fields || [];
161
+ // The 6 Ws to check
162
+ const fields = ['who', 'what', 'why', 'where', 'when', 'how'];
163
+ // Assess quality of each field
164
+ const fieldQualities = fields.map(field => ({
165
+ field,
166
+ value: humanContext[field] || null,
167
+ quality: assessFieldQuality(field, humanContext[field]),
168
+ protected: protectedFields.includes(field),
169
+ }));
170
+ // Handle --unlock: remove all protections
171
+ if (options.unlock) {
172
+ fafData._protected_fields = [];
173
+ await fs_1.promises.writeFile(fafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
174
+ console.log(championship_style_1.FAF_COLORS.fafCyan(`🔓 All fields unlocked`));
175
+ console.log(` Protected fields cleared from ${path.basename(fafPath)}`);
176
+ return;
177
+ }
178
+ // Handle --protect: auto-protect good/excellent fields
179
+ if (options.protect) {
180
+ const toProtect = fieldQualities
181
+ .filter(f => f.quality === 'good' || f.quality === 'excellent')
182
+ .map(f => f.field);
183
+ if (toProtect.length === 0) {
184
+ console.log(championship_style_1.FAF_COLORS.fafOrange('⚠️ No fields qualify for protection (need good or excellent quality)'));
185
+ return;
186
+ }
187
+ // Merge with existing protected fields
188
+ const newProtected = [...new Set([...protectedFields, ...toProtect])];
189
+ fafData._protected_fields = newProtected;
190
+ await fs_1.promises.writeFile(fafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
191
+ console.log(championship_style_1.FAF_COLORS.fafGreen(`🔒 Protected ${toProtect.length} field(s):`));
192
+ for (const field of toProtect) {
193
+ const q = fieldQualities.find(f => f.field === field);
194
+ console.log(` ${getQualityIndicator(q?.quality || 'good')} ${field}`);
195
+ }
48
196
  console.log();
49
- console.log(championship_style_1.FAF_COLORS.fafGreen(`${championship_style_1.FAF_ICONS.trophy} All checks passed in ${duration}ms!`));
50
- console.log(`${championship_style_1.FAF_COLORS.fafCyan(`${championship_style_1.FAF_ICONS.magic_wand} Try: `)}faf score${championship_style_1.FAF_COLORS.fafCyan(' - See your completeness score')}`);
197
+ console.log(championship_style_1.FAF_COLORS.fafCyan(`💡 Protected fields won't be overwritten by faf auto or faf readme`));
198
+ return;
199
+ }
200
+ // Default behavior: show quality inspection
201
+ if (!options.quiet) {
202
+ console.log(championship_style_1.FAF_COLORS.fafCyan(`${championship_style_1.FAF_ICONS.magnifying_glass} Human Context Quality Check`));
203
+ console.log(championship_style_1.FAF_COLORS.fafCyan(` ${path.basename(fafPath)}`));
204
+ console.log();
205
+ }
206
+ // Count by quality level
207
+ const counts = {
208
+ empty: 0,
209
+ generic: 0,
210
+ good: 0,
211
+ excellent: 0,
212
+ };
213
+ // Display each field
214
+ for (const fq of fieldQualities) {
215
+ counts[fq.quality]++;
216
+ const indicator = getQualityIndicator(fq.quality);
217
+ const lockIcon = getProtectionIndicator(fq.protected);
218
+ const displayValue = fq.value
219
+ ? (fq.value.length > 50 ? fq.value.substring(0, 47) + '...' : fq.value)
220
+ : '(empty)';
221
+ if (!options.quiet) {
222
+ console.log(` ${indicator} ${lockIcon} ${fq.field.toUpperCase().padEnd(6)} ${championship_style_1.FAF_COLORS.fafCyan(displayValue)}`);
223
+ }
224
+ }
225
+ if (!options.quiet) {
226
+ console.log();
227
+ // Summary
228
+ const total = fields.length;
229
+ const qualityScore = Math.round(((counts.excellent * 1.0 + counts.good * 0.75 + counts.generic * 0.25) / total) * 100);
230
+ console.log(` 📊 Quality: ${qualityScore}%`);
231
+ console.log(` 💎 Excellent: ${counts.excellent} 🟢 Good: ${counts.good} 🟡 Generic: ${counts.generic} ⬜ Empty: ${counts.empty}`);
232
+ if (protectedFields.length > 0) {
233
+ console.log(` 🔒 Protected: ${protectedFields.join(', ')}`);
234
+ }
235
+ console.log();
236
+ // Suggestions
237
+ if (counts.empty > 0 || counts.generic > 0) {
238
+ console.log(championship_style_1.FAF_COLORS.fafOrange(' 💡 Improve with:'));
239
+ if (counts.empty > 0) {
240
+ console.log(` faf readme --apply (auto-extract from README)`);
241
+ console.log(` faf human-set <field> "<value>" (manual)`);
242
+ }
243
+ if (counts.generic > 0) {
244
+ console.log(` faf readme --apply --force (overwrite generic)`);
245
+ }
246
+ }
247
+ if (counts.good > 0 || counts.excellent > 0) {
248
+ const unprotectedGood = fieldQualities.filter(f => (f.quality === 'good' || f.quality === 'excellent') && !f.protected).length;
249
+ if (unprotectedGood > 0) {
250
+ console.log(championship_style_1.FAF_COLORS.fafGreen(` 🔒 Lock good content:`));
251
+ console.log(` faf check --protect (auto-protect good/excellent)`);
252
+ }
253
+ }
254
+ const duration = Date.now() - startTime;
255
+ console.log();
256
+ console.log(championship_style_1.FAF_COLORS.fafCyan(` ⚡ ${duration}ms`));
257
+ }
258
+ // Also run original format/freshness checks if requested
259
+ if (options.format || options.fresh) {
260
+ console.log();
261
+ if (options.format) {
262
+ console.log(`${championship_style_1.FAF_COLORS.fafCyan('├─ ')}Checking format and validity...`);
263
+ try {
264
+ await (0, validate_1.validateFafFile)(undefined, {
265
+ verbose: options.detailed
266
+ });
267
+ }
268
+ catch {
269
+ // Continue
270
+ }
271
+ }
272
+ if (options.fresh) {
273
+ console.log(`${championship_style_1.FAF_COLORS.fafCyan('├─ ')}Checking freshness and completeness...`);
274
+ try {
275
+ await (0, audit_1.auditFafFile)(undefined, {});
276
+ }
277
+ catch {
278
+ // Continue
279
+ }
280
+ }
51
281
  }
52
282
  }
53
283
  catch (error) {
54
- console.error(championship_style_1.FAF_COLORS.fafOrange(`${championship_style_1.FAF_ICONS.shield} Check failed: ${error instanceof Error ? error.message : String(error)}`));
284
+ console.error(championship_style_1.FAF_COLORS.fafOrange(`❌ Check failed: ${error instanceof Error ? error.message : String(error)}`));
55
285
  process.exit(1);
56
286
  }
57
287
  }
288
+ /**
289
+ * Check if a field is protected
290
+ */
291
+ function isFieldProtected(fafData, field) {
292
+ const protectedFields = fafData._protected_fields || [];
293
+ return protectedFields.includes(field);
294
+ }
295
+ /**
296
+ * Get all protected fields
297
+ */
298
+ function getProtectedFields(fafData) {
299
+ return fafData._protected_fields || [];
300
+ }
58
301
  //# sourceMappingURL=check.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAmBH,oCAgDC;AAjED,yCAA6C;AAC7C,mCAAuC;AACvC,oEAGqC;AASrC;;GAEG;AACI,KAAK,UAAU,YAAY,CAAC,UAA+B,EAAE;IAClE,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,OAAO,CAAC,GAAG,CAAC,+BAAU,CAAC,OAAO,CAAC,GAAG,8BAAS,CAAC,gBAAgB,2BAA2B,CAAC,CAAC,CAAC;QAE1F,8DAA8D;QAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1E,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE5E,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,GAAG,+BAAU,CAAC,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YAC3E,IAAI,CAAC;gBACH,uCAAuC;gBACvC,MAAM,IAAA,0BAAe,EAAC,SAAS,EAAE;oBA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f human - Interactive Human Context Collection
3
+ * Asks for one W at a time, simple and focused
4
+ */
5
+ interface HumanOptions {
6
+ all?: boolean;
7
+ skip?: boolean;
8
+ set?: string;
9
+ }
10
+ /**
11
+ * Main human command
12
+ */
13
+ export declare function humanCommand(projectPath?: string, options?: HumanOptions): Promise<void>;
14
+ /**
15
+ * Set a single human_context field (non-interactive)
16
+ */
17
+ export declare function humanSetCommand(field: string, value: string, projectPath?: string): Promise<void>;
18
+ export {};
19
+ //# sourceMappingURL=human.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human.d.ts","sourceRoot":"","sources":["../../src/commands/human.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA4BD;;GAEG;AACH,wBAAsB,YAAY,CAChC,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,YAAiB,iBA+G3B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,iBAgDrB"}
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ /**
3
+ * 🧡 faf human - Interactive Human Context Collection
4
+ * Asks for one W at a time, simple and focused
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.humanCommand = humanCommand;
41
+ exports.humanSetCommand = humanSetCommand;
42
+ const colors_1 = require("../fix-once/colors");
43
+ const fs_1 = require("fs");
44
+ const yaml_1 = require("../fix-once/yaml");
45
+ const championship_style_1 = require("../utils/championship-style");
46
+ const file_utils_1 = require("../utils/file-utils");
47
+ const readline = __importStar(require("readline"));
48
+ const W_FIELDS = [
49
+ { key: 'who', question: 'WHO is this for?', example: 'e.g., "Developers using AI assistants"' },
50
+ { key: 'what', question: 'WHAT does it do?', example: 'e.g., "CLI tool for project context"' },
51
+ { key: 'why', question: 'WHY does it exist?', example: 'e.g., "AI needs persistent context"' },
52
+ { key: 'where', question: 'WHERE does it run?', example: 'e.g., "npm, browser, edge"' },
53
+ { key: 'when', question: 'WHEN was it made/status?', example: 'e.g., "v1.0, production ready"' },
54
+ { key: 'how', question: 'HOW do you use it?', example: 'e.g., "npm install -g faf-cli"' },
55
+ ];
56
+ /**
57
+ * Prompt for a single input
58
+ */
59
+ async function askQuestion(rl, prompt) {
60
+ return new Promise((resolve) => {
61
+ rl.question(prompt, (answer) => {
62
+ resolve(answer.trim());
63
+ });
64
+ });
65
+ }
66
+ /**
67
+ * Main human command
68
+ */
69
+ async function humanCommand(projectPath, options = {}) {
70
+ const projectRoot = projectPath || process.cwd();
71
+ try {
72
+ // Find .faf file
73
+ const fafPath = await (0, file_utils_1.findFafFile)(projectRoot);
74
+ if (!fafPath) {
75
+ console.log();
76
+ console.log(colors_1.chalk.yellow(`${championship_style_1.FAF_ICONS.robot} No .faf file found. Run 'faf init' first.`));
77
+ return;
78
+ }
79
+ // Read existing .faf
80
+ const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
81
+ const fafData = (0, yaml_1.parse)(fafContent) || {};
82
+ if (!fafData.human_context) {
83
+ fafData.human_context = {};
84
+ }
85
+ // === NON-INTERACTIVE MODE: --set field "value" ===
86
+ if (options.set) {
87
+ const validFields = W_FIELDS.map(f => f.key);
88
+ const field = options.set.toLowerCase();
89
+ if (!validFields.includes(field)) {
90
+ console.log();
91
+ console.log(colors_1.chalk.red(`Unknown field: ${field}`));
92
+ console.log(colors_1.chalk.gray(`Valid fields: ${validFields.join(', ')}`));
93
+ return;
94
+ }
95
+ // The value comes as the next argument (projectPath in this case)
96
+ // We need to handle this differently - the value is passed separately
97
+ console.log();
98
+ console.log(colors_1.chalk.yellow(`Usage: faf human --set <field> "<value>"`));
99
+ console.log(colors_1.chalk.gray(`Example: faf human --set why "32x faster than Rust"`));
100
+ return;
101
+ }
102
+ // === INTERACTIVE MODE ===
103
+ console.log();
104
+ console.log(championship_style_1.FAF_COLORS.fafOrange(`${championship_style_1.FAF_ICONS.heart_orange} Human Context Collection`));
105
+ console.log(colors_1.chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
106
+ console.log(colors_1.chalk.gray(' Answer each question (Enter to skip)'));
107
+ console.log();
108
+ const rl = readline.createInterface({
109
+ input: process.stdin,
110
+ output: process.stdout
111
+ });
112
+ let updatedCount = 0;
113
+ for (const field of W_FIELDS) {
114
+ const currentValue = fafData.human_context[field.key];
115
+ const hasValue = currentValue && currentValue !== null && currentValue !== '';
116
+ // Skip if already has value and not --all flag
117
+ if (hasValue && !options.all) {
118
+ console.log(colors_1.chalk.gray(` ${field.key.toUpperCase()}: ${currentValue} (keeping)`));
119
+ continue;
120
+ }
121
+ // Show current value if exists
122
+ if (hasValue) {
123
+ console.log(colors_1.chalk.gray(` Current: ${currentValue}`));
124
+ }
125
+ // Ask the question
126
+ console.log(championship_style_1.FAF_COLORS.fafCyan(` ${field.question}`));
127
+ console.log(colors_1.chalk.gray(` ${field.example}`));
128
+ const answer = await askQuestion(rl, championship_style_1.FAF_COLORS.fafOrange(' > '));
129
+ if (answer) {
130
+ fafData.human_context[field.key] = answer;
131
+ updatedCount++;
132
+ console.log(colors_1.chalk.green(` ☑️ ${field.key} updated`));
133
+ }
134
+ else if (hasValue) {
135
+ console.log(colors_1.chalk.gray(` (kept existing)`));
136
+ }
137
+ else {
138
+ console.log(colors_1.chalk.gray(` (skipped)`));
139
+ }
140
+ console.log();
141
+ }
142
+ rl.close();
143
+ // Save if any updates
144
+ if (updatedCount > 0) {
145
+ await fs_1.promises.writeFile(fafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
146
+ console.log(colors_1.chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
147
+ console.log(championship_style_1.FAF_COLORS.fafGreen(`${championship_style_1.FAF_ICONS.heart_orange} Updated ${updatedCount} field${updatedCount > 1 ? 's' : ''}`));
148
+ console.log(colors_1.chalk.gray(' Run: faf score to see your new score'));
149
+ }
150
+ else {
151
+ console.log(colors_1.chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
152
+ console.log(colors_1.chalk.gray(' No changes made'));
153
+ }
154
+ console.log();
155
+ }
156
+ catch (error) {
157
+ console.log(colors_1.chalk.red(`\n${championship_style_1.FAF_ICONS.fire} Human context collection failed:`));
158
+ console.log(colors_1.chalk.red(error instanceof Error ? error.message : String(error)));
159
+ process.exit(1);
160
+ }
161
+ }
162
+ /**
163
+ * Set a single human_context field (non-interactive)
164
+ */
165
+ async function humanSetCommand(field, value, projectPath) {
166
+ const projectRoot = projectPath || process.cwd();
167
+ const validFields = W_FIELDS.map(f => f.key);
168
+ const fieldLower = field.toLowerCase();
169
+ if (!validFields.includes(fieldLower)) {
170
+ console.log();
171
+ console.log(colors_1.chalk.red(`Unknown field: ${field}`));
172
+ console.log(colors_1.chalk.gray(`Valid fields: ${validFields.join(', ')}`));
173
+ return;
174
+ }
175
+ try {
176
+ const fafPath = await (0, file_utils_1.findFafFile)(projectRoot);
177
+ if (!fafPath) {
178
+ console.log();
179
+ console.log(colors_1.chalk.yellow(`${championship_style_1.FAF_ICONS.robot} No .faf file found. Run 'faf init' first.`));
180
+ return;
181
+ }
182
+ const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
183
+ const fafData = (0, yaml_1.parse)(fafContent) || {};
184
+ if (!fafData.human_context) {
185
+ fafData.human_context = {};
186
+ }
187
+ const oldValue = fafData.human_context[fieldLower];
188
+ fafData.human_context[fieldLower] = value;
189
+ await fs_1.promises.writeFile(fafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
190
+ console.log();
191
+ console.log(championship_style_1.FAF_COLORS.fafOrange(`${championship_style_1.FAF_ICONS.heart_orange} Human Context Updated`));
192
+ console.log(colors_1.chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
193
+ console.log(colors_1.chalk.green(` ☑️ ${fieldLower.toUpperCase()}: ${value}`));
194
+ if (oldValue) {
195
+ console.log(colors_1.chalk.gray(` (was: ${oldValue})`));
196
+ }
197
+ console.log();
198
+ }
199
+ catch (error) {
200
+ console.log(colors_1.chalk.red(`\nFailed to set ${field}:`));
201
+ console.log(colors_1.chalk.red(error instanceof Error ? error.message : String(error)));
202
+ process.exit(1);
203
+ }
204
+ }
205
+ //# sourceMappingURL=human.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human.js","sourceRoot":"","sources":["../../src/commands/human.ts"],"names":[],"mappings":";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GAAG,CAAC,cAAK,CAAC,KAAK,CAAC,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC;QACxE,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,cAAK,CAAC,IAAI,CAAC,eAAe,QAAQ,GAAG,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IAEhB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,cAAK,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,cAAK,CAAC,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 📖 faf readme - Extract 6 Ws from README intelligently
3
+ * Reads README.md and fills human_context slots smartly
4
+ */
5
+ interface ReadmeOptions {
6
+ apply?: boolean;
7
+ force?: boolean;
8
+ file?: string;
9
+ quiet?: boolean;
10
+ }
11
+ /**
12
+ * Main readme command
13
+ */
14
+ export declare function readmeCommand(projectPath?: string, options?: ReadmeOptions): Promise<void>;
15
+ export {};
16
+ //# sourceMappingURL=readme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../src/commands/readme.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAyUD;;GAEG;AACH,wBAAsB,aAAa,CACjC,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,aAAkB,iBA4J5B"}