faf-mcp 1.0.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.
- package/CHANGELOG.md +34 -0
- package/CLAUDE.md +73 -0
- package/LICENSE +22 -0
- package/README.md +165 -0
- package/assets/Project-faf-pckg-json-README.png +0 -0
- package/assets/icons/faf-icon-128.png +0 -0
- package/assets/icons/faf-icon-256.png +0 -0
- package/assets/icons/faf-icon-48.png +0 -0
- package/assets/icons/faf-icon-512.png +0 -0
- package/assets/icons/orange-smiley.svg +6 -0
- package/dist/src/compiler/index.d.ts +7 -0
- package/dist/src/compiler/index.js +24 -0
- package/dist/src/compiler/index.js.map +1 -0
- package/dist/src/compiler/scorer.d.ts +53 -0
- package/dist/src/compiler/scorer.js +189 -0
- package/dist/src/compiler/scorer.js.map +1 -0
- package/dist/src/compiler/slot-validator.d.ts +32 -0
- package/dist/src/compiler/slot-validator.js +293 -0
- package/dist/src/compiler/slot-validator.js.map +1 -0
- package/dist/src/compiler/type-detector.d.ts +62 -0
- package/dist/src/compiler/type-detector.js +388 -0
- package/dist/src/compiler/type-detector.js.map +1 -0
- package/dist/src/config/visibility.d.ts +41 -0
- package/dist/src/config/visibility.js +158 -0
- package/dist/src/config/visibility.js.map +1 -0
- package/dist/src/faf-core/commands/audit.d.ts +21 -0
- package/dist/src/faf-core/commands/audit.js +83 -0
- package/dist/src/faf-core/commands/audit.js.map +1 -0
- package/dist/src/faf-core/commands/auto.d.ts +25 -0
- package/dist/src/faf-core/commands/auto.js +74 -0
- package/dist/src/faf-core/commands/auto.js.map +1 -0
- package/dist/src/faf-core/commands/bi-sync.d.ts +26 -0
- package/dist/src/faf-core/commands/bi-sync.js +157 -0
- package/dist/src/faf-core/commands/bi-sync.js.map +1 -0
- package/dist/src/faf-core/commands/doctor.d.ts +17 -0
- package/dist/src/faf-core/commands/doctor.js +198 -0
- package/dist/src/faf-core/commands/doctor.js.map +1 -0
- package/dist/src/faf-core/commands/enhance.d.ts +46 -0
- package/dist/src/faf-core/commands/enhance.js +360 -0
- package/dist/src/faf-core/commands/enhance.js.map +1 -0
- package/dist/src/faf-core/commands/formats.d.ts +22 -0
- package/dist/src/faf-core/commands/formats.js +117 -0
- package/dist/src/faf-core/commands/formats.js.map +1 -0
- package/dist/src/faf-core/commands/init.d.ts +26 -0
- package/dist/src/faf-core/commands/init.js +114 -0
- package/dist/src/faf-core/commands/init.js.map +1 -0
- package/dist/src/faf-core/commands/innit.d.ts +7 -0
- package/dist/src/faf-core/commands/innit.js +13 -0
- package/dist/src/faf-core/commands/innit.js.map +1 -0
- package/dist/src/faf-core/commands/migrate.d.ts +15 -0
- package/dist/src/faf-core/commands/migrate.js +86 -0
- package/dist/src/faf-core/commands/migrate.js.map +1 -0
- package/dist/src/faf-core/commands/quick.d.ts +16 -0
- package/dist/src/faf-core/commands/quick.js +184 -0
- package/dist/src/faf-core/commands/quick.js.map +1 -0
- package/dist/src/faf-core/commands/score.d.ts +47 -0
- package/dist/src/faf-core/commands/score.js +49 -0
- package/dist/src/faf-core/commands/score.js.map +1 -0
- package/dist/src/faf-core/commands/sync.d.ts +16 -0
- package/dist/src/faf-core/commands/sync.js +210 -0
- package/dist/src/faf-core/commands/sync.js.map +1 -0
- package/dist/src/faf-core/commands/update.d.ts +12 -0
- package/dist/src/faf-core/commands/update.js +46 -0
- package/dist/src/faf-core/commands/update.js.map +1 -0
- package/dist/src/faf-core/commands/validate.d.ts +21 -0
- package/dist/src/faf-core/commands/validate.js +81 -0
- package/dist/src/faf-core/commands/validate.js.map +1 -0
- package/dist/src/faf-core/compiler/faf-compiler.d.ts +138 -0
- package/dist/src/faf-core/compiler/faf-compiler.js +794 -0
- package/dist/src/faf-core/compiler/faf-compiler.js.map +1 -0
- package/dist/src/faf-core/engines/dependency-tsa.d.ts +88 -0
- package/dist/src/faf-core/engines/dependency-tsa.js +361 -0
- package/dist/src/faf-core/engines/dependency-tsa.js.map +1 -0
- package/dist/src/faf-core/engines/fab-formats-processor.d.ts +166 -0
- package/dist/src/faf-core/engines/fab-formats-processor.js +1274 -0
- package/dist/src/faf-core/engines/fab-formats-processor.js.map +1 -0
- package/dist/src/faf-core/engines/faf-dna.d.ts +159 -0
- package/dist/src/faf-core/engines/faf-dna.js +554 -0
- package/dist/src/faf-core/engines/faf-dna.js.map +1 -0
- package/dist/src/faf-core/engines/relentless-context-extractor.d.ts +100 -0
- package/dist/src/faf-core/engines/relentless-context-extractor.js +625 -0
- package/dist/src/faf-core/engines/relentless-context-extractor.js.map +1 -0
- package/dist/src/faf-core/fix-once/colors.d.ts +104 -0
- package/dist/src/faf-core/fix-once/colors.js +236 -0
- package/dist/src/faf-core/fix-once/colors.js.map +1 -0
- package/dist/src/faf-core/fix-once/types.d.ts +257 -0
- package/dist/src/faf-core/fix-once/types.js +26 -0
- package/dist/src/faf-core/fix-once/types.js.map +1 -0
- package/dist/src/faf-core/fix-once/yaml.d.ts +57 -0
- package/dist/src/faf-core/fix-once/yaml.js +172 -0
- package/dist/src/faf-core/fix-once/yaml.js.map +1 -0
- package/dist/src/faf-core/generators/faf-generator-championship.d.ts +16 -0
- package/dist/src/faf-core/generators/faf-generator-championship.js +462 -0
- package/dist/src/faf-core/generators/faf-generator-championship.js.map +1 -0
- package/dist/src/faf-core/utils/balance-visualizer.d.ts +37 -0
- package/dist/src/faf-core/utils/balance-visualizer.js +197 -0
- package/dist/src/faf-core/utils/balance-visualizer.js.map +1 -0
- package/dist/src/faf-core/utils/championship-style.d.ts +109 -0
- package/dist/src/faf-core/utils/championship-style.js +219 -0
- package/dist/src/faf-core/utils/championship-style.js.map +1 -0
- package/dist/src/faf-core/utils/chrome-extension-detector.d.ts +73 -0
- package/dist/src/faf-core/utils/chrome-extension-detector.js +268 -0
- package/dist/src/faf-core/utils/chrome-extension-detector.js.map +1 -0
- package/dist/src/faf-core/utils/fafignore-parser.d.ts +20 -0
- package/dist/src/faf-core/utils/fafignore-parser.js +178 -0
- package/dist/src/faf-core/utils/fafignore-parser.js.map +1 -0
- package/dist/src/faf-core/utils/file-utils.d.ts +112 -0
- package/dist/src/faf-core/utils/file-utils.js +846 -0
- package/dist/src/faf-core/utils/file-utils.js.map +1 -0
- package/dist/src/faf-core/utils/native-file-finder.d.ts +115 -0
- package/dist/src/faf-core/utils/native-file-finder.js +211 -0
- package/dist/src/faf-core/utils/native-file-finder.js.map +1 -0
- package/dist/src/faf-core/utils/platform-detector.d.ts +30 -0
- package/dist/src/faf-core/utils/platform-detector.js +218 -0
- package/dist/src/faf-core/utils/platform-detector.js.map +1 -0
- package/dist/src/faf-core/utils/technical-credit.d.ts +35 -0
- package/dist/src/faf-core/utils/technical-credit.js +286 -0
- package/dist/src/faf-core/utils/technical-credit.js.map +1 -0
- package/dist/src/faf-core/utils/yaml-generator.d.ts +41 -0
- package/dist/src/faf-core/utils/yaml-generator.js +360 -0
- package/dist/src/faf-core/utils/yaml-generator.js.map +1 -0
- package/dist/src/handlers/behavioral-instruction.d.ts +16 -0
- package/dist/src/handlers/behavioral-instruction.js +43 -0
- package/dist/src/handlers/behavioral-instruction.js.map +1 -0
- package/dist/src/handlers/championship-tools.d.ts +113 -0
- package/dist/src/handlers/championship-tools.js +2602 -0
- package/dist/src/handlers/championship-tools.js.map +1 -0
- package/dist/src/handlers/engine-adapter.d.ts +28 -0
- package/dist/src/handlers/engine-adapter.js +603 -0
- package/dist/src/handlers/engine-adapter.js.map +1 -0
- package/dist/src/handlers/fileHandler.d.ts +36 -0
- package/dist/src/handlers/fileHandler.js +246 -0
- package/dist/src/handlers/fileHandler.js.map +1 -0
- package/dist/src/handlers/resources.d.ts +18 -0
- package/dist/src/handlers/resources.js +78 -0
- package/dist/src/handlers/resources.js.map +1 -0
- package/dist/src/handlers/tool-registry.d.ts +23 -0
- package/dist/src/handlers/tool-registry.js +68 -0
- package/dist/src/handlers/tool-registry.js.map +1 -0
- package/dist/src/handlers/tool-types.d.ts +167 -0
- package/dist/src/handlers/tool-types.js +7 -0
- package/dist/src/handlers/tool-types.js.map +1 -0
- package/dist/src/handlers/tools.d.ts +25 -0
- package/dist/src/handlers/tools.js +1168 -0
- package/dist/src/handlers/tools.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +17 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/server.d.ts +28 -0
- package/dist/src/server.js +179 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/test-all-functions.d.ts +15 -0
- package/dist/src/test-all-functions.js +163 -0
- package/dist/src/test-all-functions.js.map +1 -0
- package/dist/src/types/mcp-tools.d.ts +53 -0
- package/dist/src/types/mcp-tools.js +77 -0
- package/dist/src/types/mcp-tools.js.map +1 -0
- package/dist/src/types/project-types.d.ts +22 -0
- package/dist/src/types/project-types.js +85 -0
- package/dist/src/types/project-types.js.map +1 -0
- package/dist/src/types/slots.d.ts +39 -0
- package/dist/src/types/slots.js +162 -0
- package/dist/src/types/slots.js.map +1 -0
- package/dist/src/types/tool-visibility.d.ts +36 -0
- package/dist/src/types/tool-visibility.js +510 -0
- package/dist/src/types/tool-visibility.js.map +1 -0
- package/dist/src/utils/auto-path-detection.d.ts +26 -0
- package/dist/src/utils/auto-path-detection.js +198 -0
- package/dist/src/utils/auto-path-detection.js.map +1 -0
- package/dist/src/utils/championship-format.d.ts +30 -0
- package/dist/src/utils/championship-format.js +79 -0
- package/dist/src/utils/championship-format.js.map +1 -0
- package/dist/src/utils/cli-detector.d.ts +20 -0
- package/dist/src/utils/cli-detector.js +230 -0
- package/dist/src/utils/cli-detector.js.map +1 -0
- package/dist/src/utils/display-protocol.d.ts +57 -0
- package/dist/src/utils/display-protocol.js +131 -0
- package/dist/src/utils/display-protocol.js.map +1 -0
- package/dist/src/utils/faf-file-finder.d.ts +59 -0
- package/dist/src/utils/faf-file-finder.js +139 -0
- package/dist/src/utils/faf-file-finder.js.map +1 -0
- package/dist/src/utils/fuzzy-detector.d.ts +56 -0
- package/dist/src/utils/fuzzy-detector.js +221 -0
- package/dist/src/utils/fuzzy-detector.js.map +1 -0
- package/dist/src/utils/path-resolver.d.ts +51 -0
- package/dist/src/utils/path-resolver.js +214 -0
- package/dist/src/utils/path-resolver.js.map +1 -0
- package/dist/src/utils/type-guards.d.ts +9 -0
- package/dist/src/utils/type-guards.js +27 -0
- package/dist/src/utils/type-guards.js.map +1 -0
- package/dist/src/utils/username-detector.d.ts +27 -0
- package/dist/src/utils/username-detector.js +90 -0
- package/dist/src/utils/username-detector.js.map +1 -0
- package/dist/src/utils/visual-style.d.ts +62 -0
- package/dist/src/utils/visual-style.js +164 -0
- package/dist/src/utils/visual-style.js.map +1 -0
- package/dist/src/version.d.ts +9 -0
- package/dist/src/version.js +37 -0
- package/dist/src/version.js.map +1 -0
- package/package.json +114 -0
- package/scripts/discord-sync-curated.js +233 -0
- package/scripts/discord-sync-final.js +218 -0
- package/scripts/discord-sync-simple.js +175 -0
- package/scripts/discord-sync-working.js +187 -0
- package/scripts/discord-sync.js +181 -0
- package/scripts/postinstall.js +46 -0
- package/skill/SKILL.md +385 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🎨 FIX-ONCE Color System - NATIVE ANSI EDITION
|
|
3
|
+
* Single source of truth for all colors in FAF CLI
|
|
4
|
+
*
|
|
5
|
+
* CHALK HAS BEEN CHALKED OFF! ✅
|
|
6
|
+
* Using native ANSI escape codes - ZERO dependencies
|
|
7
|
+
* Fix once = Works FOREVER
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Universal color system - CHALK FREE! 🎉
|
|
11
|
+
* Never import chalk again - this is all we need
|
|
12
|
+
*/
|
|
13
|
+
export declare const colors: {
|
|
14
|
+
primary: (text: string) => string;
|
|
15
|
+
secondary: (text: string) => string;
|
|
16
|
+
success: (text: string) => string;
|
|
17
|
+
error: (text: string) => string;
|
|
18
|
+
warning: (text: string) => string;
|
|
19
|
+
info: (text: string) => string;
|
|
20
|
+
muted: (text: string) => string;
|
|
21
|
+
bright: (text: string) => string;
|
|
22
|
+
dim: (text: string) => string;
|
|
23
|
+
highlight: (text: string) => string;
|
|
24
|
+
bold: (text: string) => string;
|
|
25
|
+
italic: (text: string) => string;
|
|
26
|
+
underline: (text: string) => string;
|
|
27
|
+
fafCyan: (text: string) => string;
|
|
28
|
+
fafOrange: (text: string) => string;
|
|
29
|
+
fafGreen: (text: string) => string;
|
|
30
|
+
fafWhite: (text: string) => string;
|
|
31
|
+
championship: (text: string) => string;
|
|
32
|
+
trust: (text: string) => string;
|
|
33
|
+
score: (text: string) => string;
|
|
34
|
+
cyan: (text: string) => string;
|
|
35
|
+
green: (text: string) => string;
|
|
36
|
+
yellow: (text: string) => string;
|
|
37
|
+
red: (text: string) => string;
|
|
38
|
+
blue: (text: string) => string;
|
|
39
|
+
gray: (text: string) => string;
|
|
40
|
+
orange: (text: string) => string;
|
|
41
|
+
black: (text: string) => string;
|
|
42
|
+
white: (text: string) => string;
|
|
43
|
+
magenta: (text: string) => string;
|
|
44
|
+
bgRed: (text: string) => string;
|
|
45
|
+
bgGreen: (text: string) => string;
|
|
46
|
+
bgYellow: (text: string) => string;
|
|
47
|
+
bgBlue: (text: string) => string;
|
|
48
|
+
bgMagenta: (text: string) => string;
|
|
49
|
+
bgCyan: (text: string) => string;
|
|
50
|
+
bgWhite: (text: string) => string;
|
|
51
|
+
strip: (text: string) => string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Color bars for visualizations
|
|
55
|
+
* Used by AI|HUMAN balance and other displays
|
|
56
|
+
*/
|
|
57
|
+
export declare const bars: {
|
|
58
|
+
filled: string;
|
|
59
|
+
empty: string;
|
|
60
|
+
cyan: (length: number) => string;
|
|
61
|
+
orange: (length: number) => string;
|
|
62
|
+
green: (length: number) => string;
|
|
63
|
+
balanced: (length: number, isBalanced: boolean) => string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Get color based on score/percentage
|
|
67
|
+
* Centralizes all score-based coloring logic
|
|
68
|
+
*/
|
|
69
|
+
export declare function getScoreColor(score: number): (text: string) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Format score with appropriate color
|
|
72
|
+
* Single place for all score formatting
|
|
73
|
+
*/
|
|
74
|
+
export declare function formatScore(score: number, prefix?: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* Trust level formatting
|
|
77
|
+
* Centralizes trust dashboard colors
|
|
78
|
+
*/
|
|
79
|
+
export declare function getTrustColor(trustLevel: number): (text: string) => string;
|
|
80
|
+
/**
|
|
81
|
+
* Trust emoji based on level
|
|
82
|
+
* Single source for trust indicators
|
|
83
|
+
*/
|
|
84
|
+
export declare function getTrustEmoji(trustLevel: number): string;
|
|
85
|
+
export default colors;
|
|
86
|
+
export declare const chalk: any;
|
|
87
|
+
export declare const cyan: (text: string) => string, green: (text: string) => string, yellow: (text: string) => string, red: (text: string) => string, blue: (text: string) => string, gray: (text: string) => string, orange: (text: string) => string, bold: (text: string) => string, dim: (text: string) => string, bgBlue: (text: string) => string, black: (text: string) => string, white: (text: string) => string, magenta: (text: string) => string;
|
|
88
|
+
/**
|
|
89
|
+
* CASCADE EFFECTS OF CHALKING OFF CHALK:
|
|
90
|
+
*
|
|
91
|
+
* 1. NO MORE PINK SURPRISES! Colors work correctly
|
|
92
|
+
* 2. ZERO dependency on chalk - one less thing to break
|
|
93
|
+
* 3. Faster startup - no chalk loading
|
|
94
|
+
* 4. Smaller package size - no chalk bloat
|
|
95
|
+
* 5. Works in ALL environments - just ANSI codes
|
|
96
|
+
* 6. NO_COLOR still supported for accessibility
|
|
97
|
+
* 7. Future proof - ANSI codes are eternal
|
|
98
|
+
*
|
|
99
|
+
* MAINTENANCE: This file should NEVER import from other modules
|
|
100
|
+
* It should be the LOWEST level dependency
|
|
101
|
+
*
|
|
102
|
+
* CHALK STATUS: ❌ CHALKED OFF!
|
|
103
|
+
* DC STATUS: 1/3 dependencies eliminated! 🏁
|
|
104
|
+
*/
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 🎨 FIX-ONCE Color System - NATIVE ANSI EDITION
|
|
4
|
+
* Single source of truth for all colors in FAF CLI
|
|
5
|
+
*
|
|
6
|
+
* CHALK HAS BEEN CHALKED OFF! ✅
|
|
7
|
+
* Using native ANSI escape codes - ZERO dependencies
|
|
8
|
+
* Fix once = Works FOREVER
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.magenta = exports.white = exports.black = exports.bgBlue = exports.dim = exports.bold = exports.orange = exports.gray = exports.blue = exports.red = exports.yellow = exports.green = exports.cyan = exports.chalk = exports.bars = exports.colors = void 0;
|
|
12
|
+
exports.getScoreColor = getScoreColor;
|
|
13
|
+
exports.formatScore = formatScore;
|
|
14
|
+
exports.getTrustColor = getTrustColor;
|
|
15
|
+
exports.getTrustEmoji = getTrustEmoji;
|
|
16
|
+
/**
|
|
17
|
+
* ANSI Escape Codes Reference
|
|
18
|
+
* No more pink surprises, no more chalk bugs!
|
|
19
|
+
*/
|
|
20
|
+
const ANSI = {
|
|
21
|
+
// Reset
|
|
22
|
+
reset: '\x1b[0m',
|
|
23
|
+
// Styles
|
|
24
|
+
bold: '\x1b[1m',
|
|
25
|
+
dim: '\x1b[2m',
|
|
26
|
+
italic: '\x1b[3m',
|
|
27
|
+
underline: '\x1b[4m',
|
|
28
|
+
// Colors
|
|
29
|
+
black: '\x1b[30m',
|
|
30
|
+
red: '\x1b[31m',
|
|
31
|
+
green: '\x1b[32m',
|
|
32
|
+
yellow: '\x1b[33m',
|
|
33
|
+
blue: '\x1b[34m',
|
|
34
|
+
magenta: '\x1b[35m',
|
|
35
|
+
cyan: '\x1b[36m',
|
|
36
|
+
white: '\x1b[37m',
|
|
37
|
+
gray: '\x1b[90m',
|
|
38
|
+
// Bright colors
|
|
39
|
+
brightRed: '\x1b[91m',
|
|
40
|
+
brightGreen: '\x1b[92m',
|
|
41
|
+
brightYellow: '\x1b[93m',
|
|
42
|
+
brightBlue: '\x1b[94m',
|
|
43
|
+
brightMagenta: '\x1b[95m',
|
|
44
|
+
brightCyan: '\x1b[96m',
|
|
45
|
+
brightWhite: '\x1b[97m',
|
|
46
|
+
// 256 color mode for orange (closest to #FF6B35)
|
|
47
|
+
orange: '\x1b[38;5;208m', // Orange in 256 color mode
|
|
48
|
+
// Background colors
|
|
49
|
+
bgRed: '\x1b[41m',
|
|
50
|
+
bgGreen: '\x1b[42m',
|
|
51
|
+
bgYellow: '\x1b[43m',
|
|
52
|
+
bgBlue: '\x1b[44m',
|
|
53
|
+
bgMagenta: '\x1b[45m',
|
|
54
|
+
bgCyan: '\x1b[46m',
|
|
55
|
+
bgWhite: '\x1b[47m',
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Helper to wrap text in ANSI codes
|
|
59
|
+
*/
|
|
60
|
+
function ansi(text, ...codes) {
|
|
61
|
+
// NO_COLOR environment variable support
|
|
62
|
+
if (process.env.NO_COLOR) {
|
|
63
|
+
return text;
|
|
64
|
+
}
|
|
65
|
+
return `${codes.join('')}${text}${ANSI.reset}`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Universal color system - CHALK FREE! 🎉
|
|
69
|
+
* Never import chalk again - this is all we need
|
|
70
|
+
*/
|
|
71
|
+
exports.colors = {
|
|
72
|
+
// Primary brand colors
|
|
73
|
+
primary: (text) => ansi(text, ANSI.cyan),
|
|
74
|
+
secondary: (text) => ansi(text, ANSI.yellow),
|
|
75
|
+
success: (text) => ansi(text, ANSI.green),
|
|
76
|
+
error: (text) => ansi(text, ANSI.red),
|
|
77
|
+
warning: (text) => ansi(text, ANSI.yellow),
|
|
78
|
+
// Semantic colors
|
|
79
|
+
info: (text) => ansi(text, ANSI.blue),
|
|
80
|
+
muted: (text) => ansi(text, ANSI.gray),
|
|
81
|
+
bright: (text) => ansi(text, ANSI.white),
|
|
82
|
+
dim: (text) => ansi(text, ANSI.dim),
|
|
83
|
+
highlight: (text) => ansi(text, ANSI.yellow, ANSI.bold),
|
|
84
|
+
// Style modifiers
|
|
85
|
+
bold: (text) => ansi(text, ANSI.bold),
|
|
86
|
+
italic: (text) => ansi(text, ANSI.italic),
|
|
87
|
+
underline: (text) => ansi(text, ANSI.underline),
|
|
88
|
+
// FAF specific colors (Championship theme)
|
|
89
|
+
fafCyan: (text) => ansi(text, ANSI.cyan),
|
|
90
|
+
fafOrange: (text) => ansi(text, ANSI.orange), // True FAF Orange (256 color)
|
|
91
|
+
fafGreen: (text) => ansi(text, ANSI.green),
|
|
92
|
+
fafWhite: (text) => ansi(text, ANSI.white),
|
|
93
|
+
// Special effects
|
|
94
|
+
championship: (text) => ansi(text, ANSI.bold, ANSI.cyan),
|
|
95
|
+
trust: (text) => ansi(text, ANSI.bold, ANSI.green),
|
|
96
|
+
score: (text) => {
|
|
97
|
+
const match = text.match(/(\d+)%/);
|
|
98
|
+
if (match) {
|
|
99
|
+
const score = parseInt(match[1]);
|
|
100
|
+
if (score >= 85)
|
|
101
|
+
return ansi(text, ANSI.green);
|
|
102
|
+
if (score >= 70)
|
|
103
|
+
return ansi(text, ANSI.yellow);
|
|
104
|
+
return ansi(text, ANSI.red);
|
|
105
|
+
}
|
|
106
|
+
return text;
|
|
107
|
+
},
|
|
108
|
+
// Additional colors for chalk compatibility
|
|
109
|
+
cyan: (text) => ansi(text, ANSI.cyan),
|
|
110
|
+
green: (text) => ansi(text, ANSI.green),
|
|
111
|
+
yellow: (text) => ansi(text, ANSI.yellow),
|
|
112
|
+
red: (text) => ansi(text, ANSI.red),
|
|
113
|
+
blue: (text) => ansi(text, ANSI.blue),
|
|
114
|
+
gray: (text) => ansi(text, ANSI.gray),
|
|
115
|
+
orange: (text) => ansi(text, ANSI.orange),
|
|
116
|
+
black: (text) => ansi(text, ANSI.black),
|
|
117
|
+
white: (text) => ansi(text, ANSI.white),
|
|
118
|
+
magenta: (text) => ansi(text, ANSI.magenta),
|
|
119
|
+
bgRed: (text) => ansi(text, ANSI.bgRed),
|
|
120
|
+
bgGreen: (text) => ansi(text, ANSI.bgGreen),
|
|
121
|
+
bgYellow: (text) => ansi(text, ANSI.bgYellow),
|
|
122
|
+
bgBlue: (text) => ansi(text, ANSI.bgBlue),
|
|
123
|
+
bgMagenta: (text) => ansi(text, ANSI.bgMagenta),
|
|
124
|
+
bgCyan: (text) => ansi(text, ANSI.bgCyan),
|
|
125
|
+
bgWhite: (text) => ansi(text, ANSI.bgWhite),
|
|
126
|
+
// NO_COLOR support (accessibility)
|
|
127
|
+
strip: (text) => {
|
|
128
|
+
return text.replace(/\x1b\[[0-9;]*m/g, '');
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Color bars for visualizations
|
|
133
|
+
* Used by AI|HUMAN balance and other displays
|
|
134
|
+
*/
|
|
135
|
+
exports.bars = {
|
|
136
|
+
filled: '█',
|
|
137
|
+
empty: '░',
|
|
138
|
+
cyan: (length) => exports.colors.fafCyan(exports.bars.filled.repeat(length)),
|
|
139
|
+
orange: (length) => exports.colors.fafOrange(exports.bars.filled.repeat(length)),
|
|
140
|
+
green: (length) => exports.colors.success(exports.bars.filled.repeat(length)),
|
|
141
|
+
// Balanced bar (green when perfect)
|
|
142
|
+
balanced: (length, isBalanced) => {
|
|
143
|
+
const bar = exports.bars.filled.repeat(length);
|
|
144
|
+
return isBalanced ? exports.colors.success(bar) : exports.colors.primary(bar);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Get color based on score/percentage
|
|
149
|
+
* Centralizes all score-based coloring logic
|
|
150
|
+
*/
|
|
151
|
+
function getScoreColor(score) {
|
|
152
|
+
if (score >= 85)
|
|
153
|
+
return exports.colors.success;
|
|
154
|
+
if (score >= 70)
|
|
155
|
+
return exports.colors.warning;
|
|
156
|
+
if (score >= 50)
|
|
157
|
+
return exports.colors.secondary;
|
|
158
|
+
return exports.colors.error;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Format score with appropriate color
|
|
162
|
+
* Single place for all score formatting
|
|
163
|
+
*/
|
|
164
|
+
function formatScore(score, prefix = 'Score') {
|
|
165
|
+
const color = getScoreColor(score);
|
|
166
|
+
return color(`${prefix}: ${score}%`);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Trust level formatting
|
|
170
|
+
* Centralizes trust dashboard colors
|
|
171
|
+
*/
|
|
172
|
+
function getTrustColor(trustLevel) {
|
|
173
|
+
if (trustLevel >= 85)
|
|
174
|
+
return exports.colors.trust;
|
|
175
|
+
if (trustLevel >= 70)
|
|
176
|
+
return exports.colors.warning;
|
|
177
|
+
if (trustLevel >= 50)
|
|
178
|
+
return exports.colors.secondary;
|
|
179
|
+
return exports.colors.error;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Trust emoji based on level
|
|
183
|
+
* Single source for trust indicators
|
|
184
|
+
*/
|
|
185
|
+
function getTrustEmoji(trustLevel) {
|
|
186
|
+
if (trustLevel >= 85)
|
|
187
|
+
return '🧡';
|
|
188
|
+
if (trustLevel >= 70)
|
|
189
|
+
return '🟡';
|
|
190
|
+
if (trustLevel >= 50)
|
|
191
|
+
return '🟠';
|
|
192
|
+
return '🔴';
|
|
193
|
+
}
|
|
194
|
+
// Export default for convenience
|
|
195
|
+
exports.default = exports.colors;
|
|
196
|
+
// Create chainable chalk replacement
|
|
197
|
+
const createChainableColor = () => {
|
|
198
|
+
const chainable = {};
|
|
199
|
+
// Add all color methods
|
|
200
|
+
Object.keys(exports.colors).forEach(key => {
|
|
201
|
+
if (typeof exports.colors[key] === 'function') {
|
|
202
|
+
chainable[key] = exports.colors[key];
|
|
203
|
+
// Make each color chainable
|
|
204
|
+
Object.keys(exports.colors).forEach(innerKey => {
|
|
205
|
+
if (typeof exports.colors[innerKey] === 'function') {
|
|
206
|
+
chainable[key][innerKey] = (text) => {
|
|
207
|
+
return exports.colors[key](exports.colors[innerKey](text));
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return chainable;
|
|
214
|
+
};
|
|
215
|
+
// Export chalk alias for compatibility with chaining support
|
|
216
|
+
exports.chalk = createChainableColor();
|
|
217
|
+
// Individual exports for compatibility (destructure from colors)
|
|
218
|
+
exports.cyan = exports.colors.cyan, exports.green = exports.colors.green, exports.yellow = exports.colors.yellow, exports.red = exports.colors.red, exports.blue = exports.colors.blue, exports.gray = exports.colors.gray, exports.orange = exports.colors.orange, exports.bold = exports.colors.bold, exports.dim = exports.colors.dim, exports.bgBlue = exports.colors.bgBlue, exports.black = exports.colors.black, exports.white = exports.colors.white, exports.magenta = exports.colors.magenta;
|
|
219
|
+
/**
|
|
220
|
+
* CASCADE EFFECTS OF CHALKING OFF CHALK:
|
|
221
|
+
*
|
|
222
|
+
* 1. NO MORE PINK SURPRISES! Colors work correctly
|
|
223
|
+
* 2. ZERO dependency on chalk - one less thing to break
|
|
224
|
+
* 3. Faster startup - no chalk loading
|
|
225
|
+
* 4. Smaller package size - no chalk bloat
|
|
226
|
+
* 5. Works in ALL environments - just ANSI codes
|
|
227
|
+
* 6. NO_COLOR still supported for accessibility
|
|
228
|
+
* 7. Future proof - ANSI codes are eternal
|
|
229
|
+
*
|
|
230
|
+
* MAINTENANCE: This file should NEVER import from other modules
|
|
231
|
+
* It should be the LOWEST level dependency
|
|
232
|
+
*
|
|
233
|
+
* CHALK STATUS: ❌ CHALKED OFF!
|
|
234
|
+
* DC STATUS: 1/3 dependencies eliminated! 🏁
|
|
235
|
+
*/
|
|
236
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../../src/faf-core/fix-once/colors.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAwJH,sCAKC;AAMD,kCAGC;AAMD,sCAKC;AAMD,sCAKC;AA1LD;;;GAGG;AACH,MAAM,IAAI,GAAG;IACX,QAAQ;IACR,KAAK,EAAE,SAAS;IAE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
*
|
|
5
|
+
* APPROVAL REQUIRED TO MODIFY THIS FILE
|
|
6
|
+
* This registry prevents type conflicts and cascade errors
|
|
7
|
+
* Fix once = Works indefinitely
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* FAB-FORMATS Analysis Result
|
|
11
|
+
* The new championship engine output
|
|
12
|
+
*/
|
|
13
|
+
export interface FabFormatsAnalysis {
|
|
14
|
+
discoveredFormats: FormatInfo[];
|
|
15
|
+
technicalStack: TechnologyStack;
|
|
16
|
+
humanContext: HumanContext;
|
|
17
|
+
intelligenceScore: number;
|
|
18
|
+
performanceMs: number;
|
|
19
|
+
filesProcessed: number;
|
|
20
|
+
quality: QualityAssessment;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Legacy compatibility - maps old to new
|
|
24
|
+
* Prevents breaking existing code
|
|
25
|
+
*/
|
|
26
|
+
export type TurboCatAnalysis = FabFormatsAnalysis;
|
|
27
|
+
export interface FormatInfo {
|
|
28
|
+
fileName: string;
|
|
29
|
+
formatType: string;
|
|
30
|
+
fileType: 'code' | 'config' | 'doc' | 'data' | 'test';
|
|
31
|
+
intelligenceBonus: number;
|
|
32
|
+
quality?: 'EXCEPTIONAL' | 'PROFESSIONAL' | 'GOOD' | 'BASIC' | 'MINIMAL';
|
|
33
|
+
}
|
|
34
|
+
export interface TechnologyStack {
|
|
35
|
+
frontend?: string;
|
|
36
|
+
backend?: string;
|
|
37
|
+
database?: string;
|
|
38
|
+
runtime?: string;
|
|
39
|
+
buildTool?: string;
|
|
40
|
+
packageManager?: string;
|
|
41
|
+
testing?: string;
|
|
42
|
+
cicd?: string;
|
|
43
|
+
cloud?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface HumanContext {
|
|
46
|
+
who?: {
|
|
47
|
+
value: string;
|
|
48
|
+
confidence: 'CERTAIN' | 'PROBABLE' | 'INFERRED';
|
|
49
|
+
};
|
|
50
|
+
what?: {
|
|
51
|
+
value: string;
|
|
52
|
+
confidence: 'CERTAIN' | 'PROBABLE' | 'INFERRED';
|
|
53
|
+
};
|
|
54
|
+
why?: {
|
|
55
|
+
value: string;
|
|
56
|
+
confidence: 'CERTAIN' | 'PROBABLE' | 'INFERRED';
|
|
57
|
+
};
|
|
58
|
+
where?: {
|
|
59
|
+
value: string;
|
|
60
|
+
confidence: 'CERTAIN' | 'PROBABLE' | 'INFERRED';
|
|
61
|
+
};
|
|
62
|
+
when?: {
|
|
63
|
+
value: string;
|
|
64
|
+
confidence: 'CERTAIN' | 'PROBABLE' | 'INFERRED';
|
|
65
|
+
};
|
|
66
|
+
how?: {
|
|
67
|
+
value: string;
|
|
68
|
+
confidence: 'CERTAIN' | 'PROBABLE' | 'INFERRED';
|
|
69
|
+
};
|
|
70
|
+
additionalContext?: Record<string, any>;
|
|
71
|
+
contextScore: number;
|
|
72
|
+
totalPRDScore: number;
|
|
73
|
+
successRate: string;
|
|
74
|
+
}
|
|
75
|
+
export interface QualityAssessment {
|
|
76
|
+
grade: 'EXCEPTIONAL' | 'PROFESSIONAL' | 'GOOD' | 'BASIC' | 'MINIMAL';
|
|
77
|
+
score: number;
|
|
78
|
+
improvements: string[];
|
|
79
|
+
}
|
|
80
|
+
export interface FafScore {
|
|
81
|
+
totalScore: number;
|
|
82
|
+
breakdown: ScoreBreakdown;
|
|
83
|
+
balance: BalanceData;
|
|
84
|
+
recommendations: string[];
|
|
85
|
+
timestamp: Date;
|
|
86
|
+
}
|
|
87
|
+
export interface ScoreBreakdown {
|
|
88
|
+
technical: number;
|
|
89
|
+
human: number;
|
|
90
|
+
freshness: number;
|
|
91
|
+
completeness: number;
|
|
92
|
+
}
|
|
93
|
+
export interface BalanceData {
|
|
94
|
+
aiPercentage: number;
|
|
95
|
+
humanPercentage: number;
|
|
96
|
+
isBalanced: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface TrustScore {
|
|
99
|
+
overall: number;
|
|
100
|
+
contextCompleteness: number;
|
|
101
|
+
aiCompatibility: number;
|
|
102
|
+
freshnessScore: number;
|
|
103
|
+
verificationStatus: 'verified' | 'unverified' | 'failed';
|
|
104
|
+
}
|
|
105
|
+
export interface TrustDashboardOptions {
|
|
106
|
+
detailed?: boolean;
|
|
107
|
+
confidence?: boolean;
|
|
108
|
+
garage?: boolean;
|
|
109
|
+
panic?: boolean;
|
|
110
|
+
quality?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface CoachingMessage {
|
|
113
|
+
text: string;
|
|
114
|
+
type: 'ai' | 'human' | 'system' | 'trust';
|
|
115
|
+
priority: number;
|
|
116
|
+
}
|
|
117
|
+
export interface FileTypePriority {
|
|
118
|
+
pattern: string;
|
|
119
|
+
name: string;
|
|
120
|
+
value: number;
|
|
121
|
+
reason: string;
|
|
122
|
+
category: 'foundation' | 'framework' | 'quality' | 'deployment';
|
|
123
|
+
}
|
|
124
|
+
export interface ProcessedFile {
|
|
125
|
+
fileName: string;
|
|
126
|
+
fileType: string;
|
|
127
|
+
intelligenceBonus: number;
|
|
128
|
+
}
|
|
129
|
+
export interface CommandOptions {
|
|
130
|
+
force?: boolean;
|
|
131
|
+
detailed?: boolean;
|
|
132
|
+
output?: string;
|
|
133
|
+
template?: string;
|
|
134
|
+
minimum?: string;
|
|
135
|
+
format?: 'json' | 'yaml' | 'text';
|
|
136
|
+
color?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface InitOptions extends CommandOptions {
|
|
139
|
+
projectType?: string;
|
|
140
|
+
skipIgnore?: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface ScoreOptions extends CommandOptions {
|
|
143
|
+
details?: boolean;
|
|
144
|
+
minimum?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface TrustOptions extends TrustDashboardOptions {
|
|
147
|
+
}
|
|
148
|
+
export interface FafFile {
|
|
149
|
+
ai_scoring_system: string;
|
|
150
|
+
ai_score: string;
|
|
151
|
+
ai_confidence: string;
|
|
152
|
+
ai_value: string;
|
|
153
|
+
ai_tldr: {
|
|
154
|
+
project: string;
|
|
155
|
+
stack: string;
|
|
156
|
+
quality_bar: string;
|
|
157
|
+
current_focus: string;
|
|
158
|
+
your_role: string;
|
|
159
|
+
};
|
|
160
|
+
instant_context: {
|
|
161
|
+
what_building: string;
|
|
162
|
+
tech_stack: string;
|
|
163
|
+
main_language: string;
|
|
164
|
+
deployment: string;
|
|
165
|
+
key_files: string[];
|
|
166
|
+
};
|
|
167
|
+
context_quality: {
|
|
168
|
+
slots_filled: string;
|
|
169
|
+
ai_confidence: string;
|
|
170
|
+
handoff_ready: boolean;
|
|
171
|
+
missing_context: string[];
|
|
172
|
+
};
|
|
173
|
+
project: ProjectInfo;
|
|
174
|
+
ai_instructions: AIInstructions;
|
|
175
|
+
stack: TechnologyStack;
|
|
176
|
+
preferences: Preferences;
|
|
177
|
+
state: ProjectState;
|
|
178
|
+
tags: Tags;
|
|
179
|
+
human_context?: HumanContext;
|
|
180
|
+
ai_scoring_details: ScoringDetails;
|
|
181
|
+
}
|
|
182
|
+
export interface ProjectInfo {
|
|
183
|
+
name: string;
|
|
184
|
+
goal: string;
|
|
185
|
+
main_language: string;
|
|
186
|
+
generated: string;
|
|
187
|
+
mission: string;
|
|
188
|
+
revolution: string;
|
|
189
|
+
brand: string;
|
|
190
|
+
}
|
|
191
|
+
export interface AIInstructions {
|
|
192
|
+
priority_order: string[];
|
|
193
|
+
working_style: {
|
|
194
|
+
code_first: boolean;
|
|
195
|
+
explanations: string;
|
|
196
|
+
quality_bar: string;
|
|
197
|
+
testing: string;
|
|
198
|
+
};
|
|
199
|
+
warnings: string[];
|
|
200
|
+
}
|
|
201
|
+
export interface Preferences {
|
|
202
|
+
quality_bar: string;
|
|
203
|
+
commit_style: string;
|
|
204
|
+
response_style: string;
|
|
205
|
+
explanation_level: string;
|
|
206
|
+
communication: string;
|
|
207
|
+
testing: string;
|
|
208
|
+
documentation: string;
|
|
209
|
+
}
|
|
210
|
+
export interface ProjectState {
|
|
211
|
+
phase: string;
|
|
212
|
+
version: string;
|
|
213
|
+
focus: string;
|
|
214
|
+
status: string;
|
|
215
|
+
next_milestone: string;
|
|
216
|
+
blockers: string[];
|
|
217
|
+
}
|
|
218
|
+
export interface Tags {
|
|
219
|
+
auto_generated: string[];
|
|
220
|
+
smart_defaults: string[];
|
|
221
|
+
user_defined: string[];
|
|
222
|
+
}
|
|
223
|
+
export interface ScoringDetails {
|
|
224
|
+
system_date: string;
|
|
225
|
+
slot_based_percentage: number;
|
|
226
|
+
ai_score: number;
|
|
227
|
+
total_slots: number;
|
|
228
|
+
filled_slots: number;
|
|
229
|
+
scoring_method: string;
|
|
230
|
+
trust_embedded: string;
|
|
231
|
+
}
|
|
232
|
+
export type DeepPartial<T> = {
|
|
233
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
234
|
+
};
|
|
235
|
+
export type RequireAtLeastOne<T> = {
|
|
236
|
+
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
237
|
+
}[keyof T];
|
|
238
|
+
export type Analysis = FabFormatsAnalysis;
|
|
239
|
+
export type Score = FafScore;
|
|
240
|
+
export type Trust = TrustScore;
|
|
241
|
+
export type Context = HumanContext;
|
|
242
|
+
export type Stack = TechnologyStack;
|
|
243
|
+
/**
|
|
244
|
+
* CASCADE EFFECTS OF THIS MODULE:
|
|
245
|
+
*
|
|
246
|
+
* 1. Fixes ALL TypeScript type errors immediately
|
|
247
|
+
* 2. Provides single source of truth for types
|
|
248
|
+
* 3. Enables safe refactoring (change once, update everywhere)
|
|
249
|
+
* 4. Prevents type conflicts between modules
|
|
250
|
+
* 5. Makes IDE autocomplete work perfectly
|
|
251
|
+
* 6. Simplifies testing (clear type contracts)
|
|
252
|
+
* 7. Documents expected data structures
|
|
253
|
+
* 8. Enables type-safe communication between modules
|
|
254
|
+
*
|
|
255
|
+
* MAINTENANCE: All types should be defined HERE
|
|
256
|
+
* Individual modules should ONLY import from this registry
|
|
257
|
+
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 🏗️ FIX-ONCE Type Registry
|
|
4
|
+
* Single source of truth for all types in FAF CLI
|
|
5
|
+
*
|
|
6
|
+
* APPROVAL REQUIRED TO MODIFY THIS FILE
|
|
7
|
+
* This registry prevents type conflicts and cascade errors
|
|
8
|
+
* Fix once = Works indefinitely
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
/**
|
|
12
|
+
* CASCADE EFFECTS OF THIS MODULE:
|
|
13
|
+
*
|
|
14
|
+
* 1. Fixes ALL TypeScript type errors immediately
|
|
15
|
+
* 2. Provides single source of truth for types
|
|
16
|
+
* 3. Enables safe refactoring (change once, update everywhere)
|
|
17
|
+
* 4. Prevents type conflicts between modules
|
|
18
|
+
* 5. Makes IDE autocomplete work perfectly
|
|
19
|
+
* 6. Simplifies testing (clear type contracts)
|
|
20
|
+
* 7. Documents expected data structures
|
|
21
|
+
* 8. Enables type-safe communication between modules
|
|
22
|
+
*
|
|
23
|
+
* MAINTENANCE: All types should be defined HERE
|
|
24
|
+
* Individual modules should ONLY import from this registry
|
|
25
|
+
*/
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/faf-core/fix-once/types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAwRH;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔥 YAML FIX-ONCE ABSTRACTION
|
|
3
|
+
*
|
|
4
|
+
* ROCK SOLID YAML PARSING - FIX ONCE, DONE FOREVER
|
|
5
|
+
*
|
|
6
|
+
* This module handles ALL YAML edge cases:
|
|
7
|
+
* ✅ Empty files
|
|
8
|
+
* ✅ Null/undefined content
|
|
9
|
+
* ✅ Invalid YAML syntax
|
|
10
|
+
* ✅ Type validation
|
|
11
|
+
* ✅ Corrupted files
|
|
12
|
+
* ✅ Clear error messages
|
|
13
|
+
* ✅ Primitive vs Object validation
|
|
14
|
+
*
|
|
15
|
+
* NEVER touch raw YAML parsing outside this file.
|
|
16
|
+
*/
|
|
17
|
+
import * as yaml from 'yaml';
|
|
18
|
+
/**
|
|
19
|
+
* Safe YAML parse - handles ALL edge cases
|
|
20
|
+
* ROCK SOLID - FIX ONCE, DONE FOREVER
|
|
21
|
+
*/
|
|
22
|
+
export declare function parse(content: string | null | undefined, options?: {
|
|
23
|
+
filepath?: string;
|
|
24
|
+
}): any;
|
|
25
|
+
/**
|
|
26
|
+
* Safe YAML stringify - handles edge cases
|
|
27
|
+
* ROCK SOLID - FIX ONCE, DONE FOREVER
|
|
28
|
+
*/
|
|
29
|
+
export declare function stringify(data: any, options?: any): string;
|
|
30
|
+
export declare const parseDocument: typeof yaml.parseDocument;
|
|
31
|
+
export declare const Document: typeof yaml.Document;
|
|
32
|
+
declare const _default: {
|
|
33
|
+
parse: typeof parse;
|
|
34
|
+
stringify: typeof stringify;
|
|
35
|
+
Document: typeof yaml.Document;
|
|
36
|
+
parseDocument: typeof yaml.parseDocument;
|
|
37
|
+
};
|
|
38
|
+
export default _default;
|
|
39
|
+
export declare const YAML: {
|
|
40
|
+
parse: typeof parse;
|
|
41
|
+
stringify: typeof stringify;
|
|
42
|
+
Document: typeof yaml.Document;
|
|
43
|
+
parseDocument: typeof yaml.parseDocument;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* 🔥 ROCK SOLID STATUS: ACHIEVED
|
|
47
|
+
*
|
|
48
|
+
* All edge cases handled:
|
|
49
|
+
* ✅ Null/undefined → Clear error
|
|
50
|
+
* ✅ Empty files → Clear error
|
|
51
|
+
* ✅ Wrong types → Clear error
|
|
52
|
+
* ✅ Invalid YAML → Wrapped error with context
|
|
53
|
+
* ✅ Primitives → Clear error (.faf must be objects)
|
|
54
|
+
* ✅ Arrays → Clear error (.faf must be objects)
|
|
55
|
+
*
|
|
56
|
+
* FIX ONCE, DONE FOREVER
|
|
57
|
+
*/
|