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,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🇬🇧 faf innit - British Init Command (Mk3 Bundled)
|
|
3
|
+
* "Innit bruv" - Initialize with style
|
|
4
|
+
*/
|
|
5
|
+
import { InitOptions, InitResult } from './init';
|
|
6
|
+
export { InitOptions, InitResult };
|
|
7
|
+
export declare function innitFafFile(projectPath?: string, options?: InitOptions): Promise<InitResult>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 🇬🇧 faf innit - British Init Command (Mk3 Bundled)
|
|
4
|
+
* "Innit bruv" - Initialize with style
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.innitFafFile = innitFafFile;
|
|
8
|
+
const init_1 = require("./init");
|
|
9
|
+
async function innitFafFile(projectPath, options = {}) {
|
|
10
|
+
// Just delegate to init - same functionality, British flavor
|
|
11
|
+
return (0, init_1.initFafFile)(projectPath, options);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=innit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"innit.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/innit.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAMH,oCAGC;AAPD,iCAA8D;AAIvD,KAAK,UAAU,YAAY,CAAC,WAAoB,EAAE,UAAuB,EAAE;IAChF,6DAA6D;IAC7D,OAAO,IAAA,kBAAW,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔄 faf migrate - Migrate legacy .faf to project.faf (Mk3 Bundled)
|
|
3
|
+
*/
|
|
4
|
+
export interface MigrateOptions {
|
|
5
|
+
force?: boolean;
|
|
6
|
+
json?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface MigrateResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
migrated: boolean;
|
|
11
|
+
from?: string;
|
|
12
|
+
to?: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function migrateFafFile(projectPath?: string, options?: MigrateOptions): Promise<MigrateResult>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 🔄 faf migrate - Migrate legacy .faf to project.faf (Mk3 Bundled)
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.migrateFafFile = migrateFafFile;
|
|
40
|
+
const fs_1 = require("fs");
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const file_utils_1 = require("../utils/file-utils");
|
|
43
|
+
async function migrateFafFile(projectPath, options = {}) {
|
|
44
|
+
try {
|
|
45
|
+
const projectRoot = projectPath || process.cwd();
|
|
46
|
+
const legacyPath = path.join(projectRoot, '.faf');
|
|
47
|
+
const newPath = path.join(projectRoot, 'project.faf');
|
|
48
|
+
// Check if legacy file exists
|
|
49
|
+
if (!await (0, file_utils_1.fileExists)(legacyPath)) {
|
|
50
|
+
return {
|
|
51
|
+
success: true,
|
|
52
|
+
migrated: false,
|
|
53
|
+
message: 'No legacy .faf file found - nothing to migrate'
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Check if new file already exists
|
|
57
|
+
if (await (0, file_utils_1.fileExists)(newPath) && !options.force) {
|
|
58
|
+
return {
|
|
59
|
+
success: false,
|
|
60
|
+
migrated: false,
|
|
61
|
+
message: 'project.faf already exists. Use --force to overwrite.'
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// Read legacy file
|
|
65
|
+
const content = await fs_1.promises.readFile(legacyPath, 'utf-8');
|
|
66
|
+
// Write to new location
|
|
67
|
+
await fs_1.promises.writeFile(newPath, content, 'utf-8');
|
|
68
|
+
// Delete legacy file (optional - could keep as backup)
|
|
69
|
+
// await fs.unlink(legacyPath);
|
|
70
|
+
return {
|
|
71
|
+
success: true,
|
|
72
|
+
migrated: true,
|
|
73
|
+
from: legacyPath,
|
|
74
|
+
to: newPath,
|
|
75
|
+
message: 'Successfully migrated .faf to project.faf'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return {
|
|
80
|
+
success: false,
|
|
81
|
+
migrated: false,
|
|
82
|
+
message: error instanceof Error ? error.message : 'Migration failed'
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/migrate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBH,wCAgDC;AAjED,2BAAoC;AACpC,2CAA6B;AAC7B,oDAAiD;AAe1C,KAAK,UAAU,cAAc,CAAC,WAAoB,EAAE,UAA0B,EAAE;IACrF,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACjD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE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for instant context generation
|
|
4
|
+
*/
|
|
5
|
+
interface QuickOptions {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
json?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface QuickResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
created: boolean;
|
|
12
|
+
filePath?: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function quickCommand(projectPath: string, input?: string, options?: QuickOptions): Promise<QuickResult>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ⚡ FAF Quick - Lightning-fast .faf creation (Mk3 Bundled)
|
|
4
|
+
* One-liner format for instant context generation
|
|
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.quickCommand = quickCommand;
|
|
41
|
+
const fs_1 = require("fs");
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const yaml_1 = require("../fix-once/yaml");
|
|
44
|
+
const file_utils_1 = require("../utils/file-utils");
|
|
45
|
+
/**
|
|
46
|
+
* Quick format parser - accepts simple comma-separated values
|
|
47
|
+
* Format: "project name, what it does, main language, framework, where deployed"
|
|
48
|
+
*/
|
|
49
|
+
function parseQuickInput(input) {
|
|
50
|
+
if (!input) {
|
|
51
|
+
return {
|
|
52
|
+
projectName: 'my-project',
|
|
53
|
+
projectGoal: 'Build amazing software',
|
|
54
|
+
mainLanguage: 'TypeScript',
|
|
55
|
+
framework: 'none',
|
|
56
|
+
hosting: 'cloud',
|
|
57
|
+
slotBasedPercentage: 50,
|
|
58
|
+
fafScore: 50
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const parts = input.split(',').map(s => s.trim());
|
|
62
|
+
return {
|
|
63
|
+
projectName: parts[0] || 'my-project',
|
|
64
|
+
projectGoal: parts[1] || 'Build amazing software',
|
|
65
|
+
mainLanguage: parts[2] || 'TypeScript',
|
|
66
|
+
framework: parts[3] || 'none',
|
|
67
|
+
hosting: parts[4] || 'cloud',
|
|
68
|
+
slotBasedPercentage: 60,
|
|
69
|
+
fafScore: 60
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async function quickCommand(projectPath, input, options = {}) {
|
|
73
|
+
try {
|
|
74
|
+
const fafPath = path.join(projectPath, 'project.faf');
|
|
75
|
+
// Check if file exists
|
|
76
|
+
if (await (0, file_utils_1.fileExists)(fafPath) && !options.force) {
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
created: false,
|
|
80
|
+
message: 'project.faf already exists. Use --force to overwrite.'
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// Parse input
|
|
84
|
+
const parsed = parseQuickInput(input);
|
|
85
|
+
// Generate quick .faf file
|
|
86
|
+
const fafData = {
|
|
87
|
+
faf_version: '2.5.0',
|
|
88
|
+
ai_scoring_system: '2025-09-20',
|
|
89
|
+
ai_score: `${parsed.fafScore}%`,
|
|
90
|
+
ai_confidence: 'MEDIUM',
|
|
91
|
+
ai_value: '30_seconds_replaces_20_minutes_of_questions',
|
|
92
|
+
ai_tldr: {
|
|
93
|
+
project: `${parsed.projectName} - ${parsed.projectGoal}`,
|
|
94
|
+
stack: `${parsed.mainLanguage}/${parsed.framework}`,
|
|
95
|
+
quality_bar: 'ZERO_ERRORS_F1_STANDARDS',
|
|
96
|
+
current_focus: 'Quick start - ready to build',
|
|
97
|
+
your_role: 'Build features with context'
|
|
98
|
+
},
|
|
99
|
+
instant_context: {
|
|
100
|
+
what_building: parsed.projectGoal,
|
|
101
|
+
tech_stack: `${parsed.mainLanguage}/${parsed.framework}`,
|
|
102
|
+
main_language: parsed.mainLanguage,
|
|
103
|
+
deployment: parsed.hosting,
|
|
104
|
+
key_files: ['package.json', 'README.md']
|
|
105
|
+
},
|
|
106
|
+
context_quality: {
|
|
107
|
+
slots_filled: '12/21 (57%)',
|
|
108
|
+
ai_confidence: 'MEDIUM',
|
|
109
|
+
handoff_ready: true,
|
|
110
|
+
missing_context: ['CI/CD pipeline', 'Database', 'Testing strategy']
|
|
111
|
+
},
|
|
112
|
+
project: {
|
|
113
|
+
name: parsed.projectName,
|
|
114
|
+
goal: parsed.projectGoal,
|
|
115
|
+
main_language: parsed.mainLanguage,
|
|
116
|
+
generated: new Date().toISOString(),
|
|
117
|
+
mission: '🚀 Make Your AI Happy! 🧡 Trust-Driven 🤖',
|
|
118
|
+
revolution: '30 seconds replaces 20 minutes of questions',
|
|
119
|
+
brand: 'F1-Inspired Software Engineering - Championship AI Context',
|
|
120
|
+
version: '1.0.0',
|
|
121
|
+
type: parsed.framework.toLowerCase()
|
|
122
|
+
},
|
|
123
|
+
stack: {
|
|
124
|
+
frontend: parsed.framework !== 'none' ? parsed.framework : 'None',
|
|
125
|
+
css_framework: 'None',
|
|
126
|
+
ui_library: 'None',
|
|
127
|
+
state_management: 'None',
|
|
128
|
+
backend: 'Node.js',
|
|
129
|
+
runtime: 'Node.js',
|
|
130
|
+
database: 'None',
|
|
131
|
+
build: 'Vite',
|
|
132
|
+
package_manager: 'npm',
|
|
133
|
+
api_type: 'REST',
|
|
134
|
+
hosting: parsed.hosting,
|
|
135
|
+
cicd: 'None',
|
|
136
|
+
testing: 'None',
|
|
137
|
+
language: parsed.mainLanguage
|
|
138
|
+
},
|
|
139
|
+
preferences: {
|
|
140
|
+
quality_bar: 'zero_errors',
|
|
141
|
+
commit_style: 'conventional_emoji',
|
|
142
|
+
response_style: 'concise_code_first',
|
|
143
|
+
explanation_level: 'minimal',
|
|
144
|
+
communication: 'direct',
|
|
145
|
+
testing: 'required',
|
|
146
|
+
documentation: 'as_needed'
|
|
147
|
+
},
|
|
148
|
+
state: {
|
|
149
|
+
phase: 'development',
|
|
150
|
+
version: '1.0.0',
|
|
151
|
+
focus: 'quick_start',
|
|
152
|
+
status: 'green_flag',
|
|
153
|
+
next_milestone: 'first_feature',
|
|
154
|
+
blockers: null
|
|
155
|
+
},
|
|
156
|
+
tags: {
|
|
157
|
+
auto_generated: [parsed.projectName.toLowerCase(), parsed.mainLanguage.toLowerCase()],
|
|
158
|
+
smart_defaults: ['.faf', 'ai-ready', '2025', 'quick-start'],
|
|
159
|
+
user_defined: null
|
|
160
|
+
},
|
|
161
|
+
meta: {
|
|
162
|
+
last_enhanced: new Date().toISOString(),
|
|
163
|
+
enhanced_by: 'faf-quick-command'
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
// Write file
|
|
167
|
+
const yamlContent = (0, yaml_1.stringify)(fafData);
|
|
168
|
+
await fs_1.promises.writeFile(fafPath, yamlContent, 'utf-8');
|
|
169
|
+
return {
|
|
170
|
+
success: true,
|
|
171
|
+
created: true,
|
|
172
|
+
filePath: fafPath,
|
|
173
|
+
message: `⚡ Created project.faf at ${fafPath} - Score: ${parsed.fafScore}%`
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
return {
|
|
178
|
+
success: false,
|
|
179
|
+
created: false,
|
|
180
|
+
message: error instanceof Error ? error.message : 'Quick command failed'
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=quick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/quick.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,oCAoHC;AAnKD,2BAAoC;AACpC,2CAA6B;AAC7B,2CAA8D;AAC9D,oDAAiD;AAcjD;;;GAGG;AACH,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;YACL,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,wBAAwB;YACrC,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,MAAM;YACjB,OAAO,EAAE,OAAO;YAChB,mBAAmB,EAAE,EAAE;YACvB,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IA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K,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;SACzE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* faf score - Programmatic API (MCP-ready)
|
|
3
|
+
* No console output, returns structured data
|
|
4
|
+
*/
|
|
5
|
+
import { CompilationResult } from '../compiler/faf-compiler.js';
|
|
6
|
+
export interface ScoreOptions {
|
|
7
|
+
json?: boolean;
|
|
8
|
+
trace?: boolean;
|
|
9
|
+
verify?: boolean;
|
|
10
|
+
breakdown?: boolean;
|
|
11
|
+
checksum?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ScoreResult {
|
|
14
|
+
score: number;
|
|
15
|
+
filled: number;
|
|
16
|
+
total: number;
|
|
17
|
+
breakdown: {
|
|
18
|
+
project: {
|
|
19
|
+
filled: number;
|
|
20
|
+
total: number;
|
|
21
|
+
percentage: number;
|
|
22
|
+
};
|
|
23
|
+
stack: {
|
|
24
|
+
filled: number;
|
|
25
|
+
total: number;
|
|
26
|
+
percentage: number;
|
|
27
|
+
};
|
|
28
|
+
human: {
|
|
29
|
+
filled: number;
|
|
30
|
+
total: number;
|
|
31
|
+
percentage: number;
|
|
32
|
+
};
|
|
33
|
+
discovery: {
|
|
34
|
+
filled: number;
|
|
35
|
+
total: number;
|
|
36
|
+
percentage: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
trace?: CompilationResult['trace'];
|
|
40
|
+
diagnostics?: CompilationResult['diagnostics'];
|
|
41
|
+
checksum?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Score a .faf file - programmatic API
|
|
45
|
+
* Returns structured data, no console output
|
|
46
|
+
*/
|
|
47
|
+
export declare function scoreFafFile(file?: string, options?: ScoreOptions): Promise<ScoreResult>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* faf score - Programmatic API (MCP-ready)
|
|
4
|
+
* No console output, returns structured data
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.scoreFafFile = scoreFafFile;
|
|
8
|
+
const faf_compiler_js_1 = require("../compiler/faf-compiler.js");
|
|
9
|
+
const file_utils_js_1 = require("../utils/file-utils.js");
|
|
10
|
+
/**
|
|
11
|
+
* Score a .faf file - programmatic API
|
|
12
|
+
* Returns structured data, no console output
|
|
13
|
+
*/
|
|
14
|
+
async function scoreFafFile(file, options = {}) {
|
|
15
|
+
// Find .faf file
|
|
16
|
+
const fafPath = file || await (0, file_utils_js_1.findFafFile)(process.cwd());
|
|
17
|
+
if (!fafPath) {
|
|
18
|
+
throw new Error('No .faf file found');
|
|
19
|
+
}
|
|
20
|
+
// Create compiler
|
|
21
|
+
const compiler = new faf_compiler_js_1.FafCompiler();
|
|
22
|
+
// Compile with or without trace
|
|
23
|
+
const result = options.trace
|
|
24
|
+
? await compiler.compileWithTrace(fafPath)
|
|
25
|
+
: await compiler.compile(fafPath);
|
|
26
|
+
// Verify checksum if provided
|
|
27
|
+
if (options.checksum && result.checksum !== options.checksum) {
|
|
28
|
+
throw new Error(`Checksum mismatch: expected ${options.checksum}, got ${result.checksum}`);
|
|
29
|
+
}
|
|
30
|
+
// Return structured data
|
|
31
|
+
const scoreResult = {
|
|
32
|
+
score: result.score,
|
|
33
|
+
filled: result.filled,
|
|
34
|
+
total: result.total,
|
|
35
|
+
breakdown: result.breakdown,
|
|
36
|
+
};
|
|
37
|
+
// Add optional fields
|
|
38
|
+
if (options.trace) {
|
|
39
|
+
scoreResult.trace = result.trace;
|
|
40
|
+
}
|
|
41
|
+
if (options.breakdown && result.diagnostics.length > 0) {
|
|
42
|
+
scoreResult.diagnostics = result.diagnostics;
|
|
43
|
+
}
|
|
44
|
+
if (options.checksum || options.verify) {
|
|
45
|
+
scoreResult.checksum = result.checksum;
|
|
46
|
+
}
|
|
47
|
+
return scoreResult;
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;QAClB,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,IAAI,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvD,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAC/C,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACvC,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACzC,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔄 faf sync - Sync Command (Mk3 Bundled)
|
|
3
|
+
* Sync project.faf file with project changes (package.json, git, etc.)
|
|
4
|
+
*/
|
|
5
|
+
export interface SyncOptions {
|
|
6
|
+
auto?: boolean;
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
json?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface SyncResult {
|
|
11
|
+
success: boolean;
|
|
12
|
+
changesDetected: number;
|
|
13
|
+
changesApplied: number;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function syncFafFile(projectPath?: string, options?: SyncOptions): Promise<SyncResult>;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 🔄 faf sync - Sync Command (Mk3 Bundled)
|
|
4
|
+
* Sync project.faf file with project changes (package.json, git, etc.)
|
|
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.syncFafFile = syncFafFile;
|
|
41
|
+
const fs_1 = require("fs");
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const yaml_1 = require("../fix-once/yaml");
|
|
44
|
+
const file_utils_1 = require("../utils/file-utils");
|
|
45
|
+
async function syncFafFile(projectPath, options = {}) {
|
|
46
|
+
try {
|
|
47
|
+
const fafPath = projectPath ? path.join(projectPath, 'project.faf') : await (0, file_utils_1.findFafFile)();
|
|
48
|
+
if (!fafPath || !await (0, file_utils_1.fileExists)(fafPath)) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
changesDetected: 0,
|
|
52
|
+
changesApplied: 0,
|
|
53
|
+
message: 'No project.faf file found. Run faf init first.'
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Read current .faf file
|
|
57
|
+
const content = await fs_1.promises.readFile(fafPath, 'utf-8');
|
|
58
|
+
const fafData = (0, yaml_1.parse)(content);
|
|
59
|
+
// Detect changes
|
|
60
|
+
const changes = await detectProjectChanges(fafData, path.dirname(fafPath));
|
|
61
|
+
if (changes.length === 0) {
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
changesDetected: 0,
|
|
65
|
+
changesApplied: 0,
|
|
66
|
+
message: 'project.faf file is up to date'
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (options.dryRun) {
|
|
70
|
+
return {
|
|
71
|
+
success: true,
|
|
72
|
+
changesDetected: changes.length,
|
|
73
|
+
changesApplied: 0,
|
|
74
|
+
message: `Found ${changes.length} potential updates (dry run - no changes applied)`
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Apply changes if auto mode
|
|
78
|
+
if (options.auto) {
|
|
79
|
+
applyChanges(fafData, changes);
|
|
80
|
+
// Update generated timestamp
|
|
81
|
+
if (!fafData.meta)
|
|
82
|
+
fafData.meta = {};
|
|
83
|
+
fafData.meta.last_sync = new Date().toISOString();
|
|
84
|
+
// Write updated .faf file
|
|
85
|
+
const updatedContent = (0, yaml_1.stringify)(fafData);
|
|
86
|
+
await fs_1.promises.writeFile(fafPath, updatedContent, 'utf-8');
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
changesDetected: changes.length,
|
|
90
|
+
changesApplied: changes.length,
|
|
91
|
+
message: `Applied ${changes.length} changes to project.faf`
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
success: true,
|
|
96
|
+
changesDetected: changes.length,
|
|
97
|
+
changesApplied: 0,
|
|
98
|
+
message: `Found ${changes.length} potential updates. Run with --auto to apply.`
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return {
|
|
103
|
+
success: false,
|
|
104
|
+
changesDetected: 0,
|
|
105
|
+
changesApplied: 0,
|
|
106
|
+
message: error instanceof Error ? error.message : 'Sync failed'
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function detectProjectChanges(fafData, projectRoot) {
|
|
111
|
+
const changes = [];
|
|
112
|
+
try {
|
|
113
|
+
// Check package.json changes
|
|
114
|
+
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
115
|
+
if (await (0, file_utils_1.fileExists)(packageJsonPath)) {
|
|
116
|
+
const packageContent = await fs_1.promises.readFile(packageJsonPath, 'utf-8');
|
|
117
|
+
const packageData = JSON.parse(packageContent);
|
|
118
|
+
// Project name change
|
|
119
|
+
if (packageData.name && packageData.name !== fafData.project?.name) {
|
|
120
|
+
changes.push({
|
|
121
|
+
path: 'project.name',
|
|
122
|
+
description: 'Project name changed in package.json',
|
|
123
|
+
oldValue: fafData.project?.name || 'undefined',
|
|
124
|
+
newValue: packageData.name,
|
|
125
|
+
confidence: 'high'
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
// Description/goal change
|
|
129
|
+
if (packageData.description && packageData.description !== fafData.project?.goal) {
|
|
130
|
+
changes.push({
|
|
131
|
+
path: 'project.goal',
|
|
132
|
+
description: 'Project description changed in package.json',
|
|
133
|
+
oldValue: fafData.project?.goal || 'undefined',
|
|
134
|
+
newValue: packageData.description,
|
|
135
|
+
confidence: 'medium'
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Dependencies changes - detect frameworks
|
|
139
|
+
const deps = {
|
|
140
|
+
...packageData.dependencies,
|
|
141
|
+
...packageData.devDependencies
|
|
142
|
+
};
|
|
143
|
+
// Check for framework changes
|
|
144
|
+
if (deps.svelte && !fafData.stack?.frontend?.includes('Svelte')) {
|
|
145
|
+
changes.push({
|
|
146
|
+
path: 'stack.frontend',
|
|
147
|
+
description: 'Svelte dependency detected',
|
|
148
|
+
oldValue: fafData.stack?.frontend || '',
|
|
149
|
+
newValue: 'Svelte',
|
|
150
|
+
confidence: 'high'
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (deps.react && !fafData.stack?.frontend?.includes('React')) {
|
|
154
|
+
changes.push({
|
|
155
|
+
path: 'stack.frontend',
|
|
156
|
+
description: 'React dependency detected',
|
|
157
|
+
oldValue: fafData.stack?.frontend || '',
|
|
158
|
+
newValue: 'React',
|
|
159
|
+
confidence: 'high'
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (deps.vue && !fafData.stack?.frontend?.includes('Vue')) {
|
|
163
|
+
changes.push({
|
|
164
|
+
path: 'stack.frontend',
|
|
165
|
+
description: 'Vue dependency detected',
|
|
166
|
+
oldValue: fafData.stack?.frontend || '',
|
|
167
|
+
newValue: 'Vue',
|
|
168
|
+
confidence: 'high'
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Check if generated timestamp is very old (30+ days)
|
|
173
|
+
if (fafData.meta?.generated) {
|
|
174
|
+
const generatedDate = new Date(fafData.meta.generated);
|
|
175
|
+
const daysSince = Math.abs(Date.now() - generatedDate.getTime()) / (1000 * 60 * 60 * 24);
|
|
176
|
+
if (daysSince > 30) {
|
|
177
|
+
changes.push({
|
|
178
|
+
path: 'meta.generated',
|
|
179
|
+
description: `Generated timestamp is ${Math.round(daysSince)} days old`,
|
|
180
|
+
oldValue: fafData.meta.generated,
|
|
181
|
+
newValue: new Date().toISOString(),
|
|
182
|
+
confidence: 'high'
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// Continue with what we have
|
|
189
|
+
}
|
|
190
|
+
return changes;
|
|
191
|
+
}
|
|
192
|
+
function applyChanges(fafData, changes) {
|
|
193
|
+
changes.forEach(change => {
|
|
194
|
+
if (change.confidence === 'high' || change.confidence === 'medium') {
|
|
195
|
+
setNestedValue(fafData, change.path, change.newValue);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function setNestedValue(obj, path, value) {
|
|
200
|
+
const parts = path.split('.');
|
|
201
|
+
let current = obj;
|
|
202
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
203
|
+
if (!current[parts[i]]) {
|
|
204
|
+
current[parts[i]] = {};
|
|
205
|
+
}
|
|
206
|
+
current = current[parts[i]];
|
|
207
|
+
}
|
|
208
|
+
current[parts[parts.length - 1]] = value;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=sync.js.map
|