faf-mcp 1.3.1 → 2.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 +32 -0
- package/CLAUDE.md +5 -5
- package/README.md +70 -14
- package/assets/thumbnail.png +0 -0
- package/dist/src/faf-core/commands/agents.d.ts +29 -0
- package/dist/src/faf-core/commands/agents.js +140 -0
- package/dist/src/faf-core/commands/agents.js.map +1 -0
- package/dist/src/faf-core/commands/bi-sync.d.ts +9 -5
- package/dist/src/faf-core/commands/bi-sync.js +89 -85
- package/dist/src/faf-core/commands/bi-sync.js.map +1 -1
- package/dist/src/faf-core/commands/conductor.d.ts +25 -0
- package/dist/src/faf-core/commands/conductor.js +157 -0
- package/dist/src/faf-core/commands/conductor.js.map +1 -0
- package/dist/src/faf-core/commands/cursor.d.ts +29 -0
- package/dist/src/faf-core/commands/cursor.js +134 -0
- package/dist/src/faf-core/commands/cursor.js.map +1 -0
- package/dist/src/faf-core/commands/gemini.d.ts +29 -0
- package/dist/src/faf-core/commands/gemini.js +133 -0
- package/dist/src/faf-core/commands/gemini.js.map +1 -0
- package/dist/src/faf-core/commands/git-context.d.ts +23 -0
- package/dist/src/faf-core/commands/git-context.js +66 -0
- package/dist/src/faf-core/commands/git-context.js.map +1 -0
- package/dist/src/faf-core/commands/human.d.ts +27 -0
- package/dist/src/faf-core/commands/human.js +183 -0
- package/dist/src/faf-core/commands/human.js.map +1 -0
- package/dist/src/faf-core/commands/readme.d.ts +47 -0
- package/dist/src/faf-core/commands/readme.js +361 -0
- package/dist/src/faf-core/commands/readme.js.map +1 -0
- package/dist/src/faf-core/engines/fab-formats-processor.js +3 -3
- package/dist/src/faf-core/engines/fab-formats-processor.js.map +1 -1
- package/dist/src/faf-core/engines/faf-dna.d.ts +1 -1
- package/dist/src/faf-core/engines/faf-dna.js +4 -3
- package/dist/src/faf-core/engines/faf-dna.js.map +1 -1
- package/dist/src/faf-core/generators/faf-generator-championship.js +9 -8
- package/dist/src/faf-core/generators/faf-generator-championship.js.map +1 -1
- package/dist/src/faf-core/parsers/agents-parser.d.ts +59 -0
- package/dist/src/faf-core/parsers/agents-parser.js +324 -0
- package/dist/src/faf-core/parsers/agents-parser.js.map +1 -0
- package/dist/src/faf-core/parsers/conductor-parser.d.ts +85 -0
- package/dist/src/faf-core/parsers/conductor-parser.js +293 -0
- package/dist/src/faf-core/parsers/conductor-parser.js.map +1 -0
- package/dist/src/faf-core/parsers/cursorrules-parser.d.ts +57 -0
- package/dist/src/faf-core/parsers/cursorrules-parser.js +317 -0
- package/dist/src/faf-core/parsers/cursorrules-parser.js.map +1 -0
- package/dist/src/faf-core/parsers/faf-git-generator.d.ts +53 -0
- package/dist/src/faf-core/parsers/faf-git-generator.js +512 -0
- package/dist/src/faf-core/parsers/faf-git-generator.js.map +1 -0
- package/dist/src/faf-core/parsers/gemini-parser.d.ts +57 -0
- package/dist/src/faf-core/parsers/gemini-parser.js +263 -0
- package/dist/src/faf-core/parsers/gemini-parser.js.map +1 -0
- package/dist/src/faf-core/parsers/github-extractor.d.ts +61 -0
- package/dist/src/faf-core/parsers/github-extractor.js +374 -0
- package/dist/src/faf-core/parsers/github-extractor.js.map +1 -0
- package/dist/src/faf-core/parsers/index.d.ts +12 -0
- package/dist/src/{compiler → faf-core/parsers}/index.js +10 -5
- package/dist/src/faf-core/parsers/index.js.map +1 -0
- package/dist/src/faf-core/parsers/slot-counter.d.ts +55 -0
- package/dist/src/faf-core/parsers/slot-counter.js +100 -0
- package/dist/src/faf-core/parsers/slot-counter.js.map +1 -0
- package/dist/src/faf-core/utils/balance-visualizer.js +3 -3
- package/dist/src/faf-core/utils/balance-visualizer.js.map +1 -1
- package/dist/src/handlers/championship-tools.d.ts +10 -5
- package/dist/src/handlers/championship-tools.js +259 -232
- package/dist/src/handlers/championship-tools.js.map +1 -1
- package/dist/src/handlers/engine-adapter.js +238 -5
- package/dist/src/handlers/engine-adapter.js.map +1 -1
- package/dist/src/handlers/tools.d.ts +61 -0
- package/dist/src/handlers/tools.js +2103 -102
- package/dist/src/handlers/tools.js.map +1 -1
- package/dist/src/index.js +0 -0
- package/dist/src/types/tool-visibility.js +51 -10
- package/dist/src/types/tool-visibility.js.map +1 -1
- package/dist/src/utils/championship-format.js +11 -9
- package/dist/src/utils/championship-format.js.map +1 -1
- package/dist/src/utils/path-resolver.js +56 -2
- package/dist/src/utils/path-resolver.js.map +1 -1
- package/dist/src/utils/visual-style.js +7 -5
- package/dist/src/utils/visual-style.js.map +1 -1
- package/dist/src/version.js +24 -11
- package/dist/src/version.js.map +1 -1
- package/package.json +5 -3
- package/project.faf +14 -18
- package/dist/index.json +0 -1
- package/dist/src/compiler/index.d.ts +0 -7
- package/dist/src/compiler/index.js.map +0 -1
- package/dist/src/compiler/scorer.d.ts +0 -53
- package/dist/src/compiler/scorer.js +0 -189
- package/dist/src/compiler/scorer.js.map +0 -1
- package/dist/src/compiler/slot-validator.d.ts +0 -32
- package/dist/src/compiler/slot-validator.js +0 -293
- package/dist/src/compiler/slot-validator.js.map +0 -1
- package/dist/src/compiler/type-detector.d.ts +0 -62
- package/dist/src/compiler/type-detector.js +0 -388
- package/dist/src/compiler/type-detector.js.map +0 -1
- package/dist/src/types/project-types.d.ts +0 -22
- package/dist/src/types/project-types.js +0 -85
- package/dist/src/types/project-types.js.map +0 -1
- package/dist/src/types/slots.d.ts +0 -39
- package/dist/src/types/slots.js +0 -162
- package/dist/src/types/slots.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini Command - v4.5.0 Interop Edition
|
|
3
|
+
*
|
|
4
|
+
* Import/Export/Sync between GEMINI.md and project.faf
|
|
5
|
+
* Bundled command — no CLI dependency required.
|
|
6
|
+
*/
|
|
7
|
+
export interface GeminiCommandResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
action: 'import' | 'export' | 'sync';
|
|
10
|
+
message: string;
|
|
11
|
+
data?: any;
|
|
12
|
+
warnings?: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Import GEMINI.md into project.faf
|
|
16
|
+
*/
|
|
17
|
+
export declare function geminiImportCommand(projectPath: string, options?: {
|
|
18
|
+
merge?: boolean;
|
|
19
|
+
}): Promise<GeminiCommandResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Export project.faf to GEMINI.md
|
|
22
|
+
*/
|
|
23
|
+
export declare function geminiExportCommand(projectPath: string, options?: {
|
|
24
|
+
force?: boolean;
|
|
25
|
+
}): Promise<GeminiCommandResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Sync GEMINI.md <-> project.faf
|
|
28
|
+
*/
|
|
29
|
+
export declare function geminiSyncCommand(projectPath: string): Promise<GeminiCommandResult>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Gemini Command - v4.5.0 Interop Edition
|
|
4
|
+
*
|
|
5
|
+
* Import/Export/Sync between GEMINI.md and project.faf
|
|
6
|
+
* Bundled command — no CLI dependency required.
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.geminiImportCommand = geminiImportCommand;
|
|
13
|
+
exports.geminiExportCommand = geminiExportCommand;
|
|
14
|
+
exports.geminiSyncCommand = geminiSyncCommand;
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
const fs_1 = require("fs");
|
|
17
|
+
const file_utils_js_1 = require("../utils/file-utils.js");
|
|
18
|
+
const yaml_js_1 = require("../fix-once/yaml.js");
|
|
19
|
+
const gemini_parser_js_1 = require("../parsers/gemini-parser.js");
|
|
20
|
+
/**
|
|
21
|
+
* Import GEMINI.md into project.faf
|
|
22
|
+
*/
|
|
23
|
+
async function geminiImportCommand(projectPath, options = {}) {
|
|
24
|
+
const geminiPath = await (0, gemini_parser_js_1.detectGeminiMd)(projectPath);
|
|
25
|
+
if (!geminiPath) {
|
|
26
|
+
return {
|
|
27
|
+
success: false,
|
|
28
|
+
action: 'import',
|
|
29
|
+
message: 'No GEMINI.md found in project directory',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const result = await (0, gemini_parser_js_1.geminiImport)(geminiPath);
|
|
33
|
+
if (!result.success) {
|
|
34
|
+
return {
|
|
35
|
+
success: false,
|
|
36
|
+
action: 'import',
|
|
37
|
+
message: result.warnings.join(', '),
|
|
38
|
+
warnings: result.warnings,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (options.merge) {
|
|
42
|
+
const fafPath = await (0, file_utils_js_1.findFafFile)(projectPath);
|
|
43
|
+
if (fafPath) {
|
|
44
|
+
try {
|
|
45
|
+
const existingContent = await fs_1.promises.readFile(fafPath, 'utf-8');
|
|
46
|
+
const existingFaf = (0, yaml_js_1.parse)(existingContent);
|
|
47
|
+
const merged = {
|
|
48
|
+
...existingFaf,
|
|
49
|
+
project: {
|
|
50
|
+
...(existingFaf.project || {}),
|
|
51
|
+
rules: [
|
|
52
|
+
...(existingFaf.project?.rules || []),
|
|
53
|
+
...result.faf.project.rules,
|
|
54
|
+
],
|
|
55
|
+
guidelines: [
|
|
56
|
+
...(existingFaf.project?.guidelines || []),
|
|
57
|
+
...result.faf.project.guidelines,
|
|
58
|
+
],
|
|
59
|
+
codingStyle: [
|
|
60
|
+
...(existingFaf.project?.codingStyle || []),
|
|
61
|
+
...result.faf.project.codingStyle,
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const yamlContent = (0, yaml_js_1.stringify)(merged);
|
|
66
|
+
await fs_1.promises.writeFile(fafPath, yamlContent);
|
|
67
|
+
return {
|
|
68
|
+
success: true,
|
|
69
|
+
action: 'import',
|
|
70
|
+
message: `Merged GEMINI.md into existing .faf (${result.sectionsFound.length} sections)`,
|
|
71
|
+
data: { sectionsFound: result.sectionsFound, merged: true },
|
|
72
|
+
warnings: result.warnings,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Fall through
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
success: true,
|
|
82
|
+
action: 'import',
|
|
83
|
+
message: `Imported GEMINI.md (${result.sectionsFound.length} sections found)`,
|
|
84
|
+
data: { faf: result.faf, sectionsFound: result.sectionsFound },
|
|
85
|
+
warnings: result.warnings,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Export project.faf to GEMINI.md
|
|
90
|
+
*/
|
|
91
|
+
async function geminiExportCommand(projectPath, options = {}) {
|
|
92
|
+
const fafPath = await (0, file_utils_js_1.findFafFile)(projectPath);
|
|
93
|
+
if (!fafPath) {
|
|
94
|
+
return {
|
|
95
|
+
success: false,
|
|
96
|
+
action: 'export',
|
|
97
|
+
message: 'No .faf file found. Run faf init first.',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const outputPath = path_1.default.join(projectPath, 'GEMINI.md');
|
|
101
|
+
if (!options.force) {
|
|
102
|
+
try {
|
|
103
|
+
await fs_1.promises.access(outputPath);
|
|
104
|
+
return {
|
|
105
|
+
success: false,
|
|
106
|
+
action: 'export',
|
|
107
|
+
message: 'GEMINI.md already exists. Use force: true to overwrite.',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// File doesn't exist, proceed
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
|
|
115
|
+
const fafData = (0, yaml_js_1.parse)(fafContent);
|
|
116
|
+
const result = await (0, gemini_parser_js_1.geminiExport)(fafData, outputPath);
|
|
117
|
+
return {
|
|
118
|
+
success: result.success,
|
|
119
|
+
action: 'export',
|
|
120
|
+
message: result.success
|
|
121
|
+
? `Exported project.faf to GEMINI.md`
|
|
122
|
+
: 'Export failed',
|
|
123
|
+
data: { filePath: result.filePath },
|
|
124
|
+
warnings: result.warnings,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Sync GEMINI.md <-> project.faf
|
|
129
|
+
*/
|
|
130
|
+
async function geminiSyncCommand(projectPath) {
|
|
131
|
+
return await geminiExportCommand(projectPath, { force: true });
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=gemini.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/gemini.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,kDA0EC;AAKD,kDAyCC;AAKD,8CAIC;AAtJD,gDAAwB;AACxB,2BAAoC;AACpC,0DAAqD;AACrD,iDAAqF;AACrF,kEAIqC;AAUrC;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,UAA+B,EAAE;IAEjC,MAAM,UAAU,GAAG,MAAM,IAAA,iCAAc,EAAC,WAAW,CAAC,CAAC;IAErD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,yCAAyC;SACnD,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,+BAAY,EAAC,UAAU,CAAC,CAAC;IAE9C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,MAAM,IAAA,2BAAW,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E,MAAM,CAAC,OAAO;QACvB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,MAAM,CAAC,OAAO;YACrB,CAAC,CAAC,mCAAmC;YACrC,CAAC,CAAC,eAAe;QACnB,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;QACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;AACJ,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iBAAiB,CACrC,WAAmB;IAEnB,OAAO,MAAM,mBAAmB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Context Command - v4.5.0 Interop Edition
|
|
3
|
+
*
|
|
4
|
+
* Generate project.faf from a GitHub repository URL.
|
|
5
|
+
* Fetches metadata, README, package.json — no cloning needed.
|
|
6
|
+
* Bundled command — no CLI dependency required.
|
|
7
|
+
*/
|
|
8
|
+
export interface GitContextResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
data?: {
|
|
12
|
+
owner: string;
|
|
13
|
+
repo: string;
|
|
14
|
+
score: number;
|
|
15
|
+
tier: string;
|
|
16
|
+
fafContent: string;
|
|
17
|
+
filePath?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Generate project.faf from a GitHub URL
|
|
22
|
+
*/
|
|
23
|
+
export declare function gitContextCommand(url: string, outputPath?: string): Promise<GitContextResult>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Git Context Command - v4.5.0 Interop Edition
|
|
4
|
+
*
|
|
5
|
+
* Generate project.faf from a GitHub repository URL.
|
|
6
|
+
* Fetches metadata, README, package.json — no cloning needed.
|
|
7
|
+
* Bundled command — no CLI dependency required.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.gitContextCommand = gitContextCommand;
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
15
|
+
const fs_1 = require("fs");
|
|
16
|
+
const github_extractor_js_1 = require("../parsers/github-extractor.js");
|
|
17
|
+
const faf_git_generator_js_1 = require("../parsers/faf-git-generator.js");
|
|
18
|
+
/**
|
|
19
|
+
* Generate project.faf from a GitHub URL
|
|
20
|
+
*/
|
|
21
|
+
async function gitContextCommand(url, outputPath) {
|
|
22
|
+
// Parse the URL
|
|
23
|
+
const parsed = (0, github_extractor_js_1.parseGitHubUrl)(url);
|
|
24
|
+
if (!parsed) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
message: `Invalid GitHub URL: ${url}. Expected format: https://github.com/owner/repo or owner/repo`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const { owner, repo } = parsed;
|
|
31
|
+
try {
|
|
32
|
+
// Fetch metadata with file checks
|
|
33
|
+
const metadata = await (0, github_extractor_js_1.fetchGitHubMetadata)(owner, repo, true);
|
|
34
|
+
// Fetch file tree
|
|
35
|
+
const files = await (0, github_extractor_js_1.fetchGitHubFileTree)(owner, repo, metadata.defaultBranch);
|
|
36
|
+
// Generate .faf content
|
|
37
|
+
const { content, score } = await (0, faf_git_generator_js_1.generateEnhancedFaf)(metadata, files);
|
|
38
|
+
const tier = (0, faf_git_generator_js_1.getScoreTier)(score);
|
|
39
|
+
// Write to file if output path provided
|
|
40
|
+
let filePath;
|
|
41
|
+
if (outputPath) {
|
|
42
|
+
filePath = path_1.default.join(outputPath, 'project.faf');
|
|
43
|
+
await fs_1.promises.writeFile(filePath, content, 'utf-8');
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
message: `Generated project.faf for ${owner}/${repo} — Score: ${score}% (${tier})`,
|
|
48
|
+
data: {
|
|
49
|
+
owner,
|
|
50
|
+
repo,
|
|
51
|
+
score,
|
|
52
|
+
tier,
|
|
53
|
+
fafContent: content,
|
|
54
|
+
filePath,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
message: `Failed to fetch GitHub metadata: ${errorMessage}`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=git-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-context.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/git-context.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AA8BH,8CAoDC;AAhFD,gDAAwB;AACxB,2BAAoC;AACpC,wEAIwC;AACxC,0EAGyC;AAezC;;GAEG;AACI,KAAK,UAAU,iBAAiB,CACrC,GAAW,EACX,UAAmB;IAEnB,gBAAgB;IAChB,MAAM,MAAM,GAAG,IAAA,oCAAc,EAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,uBAAuB,GAAG,gEAAgE;SACpG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAE/B,IAAI,CAAC;QACH,kCAAkC;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAA,yCAAmB,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAE9D,kBAAkB;QAClB,MAAM,KAAK,GAAG,MAAM,IAAA,yCAAmB,EAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;QAE7E,wBAAwB;QACxB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,0CAAmB,EAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,GAAG,IAAA,mCAAY,EAAC,KAAK,CAAC,CAAC;QAEjC,wCAAwC;QACxC,IAAI,QAA4B,CAAC;QACjC,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;YAChD,MAAM,aAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,6BAA6B,KAAK,IAAI,IAAI,aAAa,KAAK,MAAM,IAAI,GAAG;YAClF,IAAI,EAAE;gBACJ,KAAK;gBACL,IAAI;gBACJ,KAAK;gBACL,IAAI;gBACJ,UAAU,EAAE,OAAO;gBACnB,QAAQ;aACT;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,oCAAoC,YAAY,EAAE;SAC5D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human Context Management - MCP Bundled Version
|
|
3
|
+
* Non-interactive YAML merge for MCP context
|
|
4
|
+
*/
|
|
5
|
+
export interface HumanAddOptions {
|
|
6
|
+
yaml?: string;
|
|
7
|
+
field?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
merge?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface HumanAddResult {
|
|
12
|
+
success: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
fieldsUpdated?: string[];
|
|
15
|
+
score?: number;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Add or update human_context in project.faf
|
|
20
|
+
* MCP-compatible non-interactive version
|
|
21
|
+
*/
|
|
22
|
+
export declare function humanAddCommand(projectPath: string, options?: HumanAddOptions): Promise<HumanAddResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Set a single human_context field
|
|
25
|
+
* Convenience wrapper for single field updates
|
|
26
|
+
*/
|
|
27
|
+
export declare function humanSetCommand(projectPath: string, field: string, value: string): Promise<HumanAddResult>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Human Context Management - MCP Bundled Version
|
|
4
|
+
* Non-interactive YAML merge for MCP context
|
|
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.humanAddCommand = humanAddCommand;
|
|
41
|
+
exports.humanSetCommand = humanSetCommand;
|
|
42
|
+
const fs_1 = require("fs");
|
|
43
|
+
const yaml_1 = require("yaml");
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
/**
|
|
46
|
+
* Find project.faf file
|
|
47
|
+
*/
|
|
48
|
+
async function findFafFile(startPath) {
|
|
49
|
+
const possiblePaths = [
|
|
50
|
+
path.join(startPath, 'project.faf'),
|
|
51
|
+
path.join(startPath, '.faf'),
|
|
52
|
+
path.join(startPath, 'faf.yml'),
|
|
53
|
+
path.join(startPath, 'faf.yaml'),
|
|
54
|
+
];
|
|
55
|
+
for (const fafPath of possiblePaths) {
|
|
56
|
+
try {
|
|
57
|
+
await fs_1.promises.access(fafPath);
|
|
58
|
+
return fafPath;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// File doesn't exist, continue
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Add or update human_context in project.faf
|
|
68
|
+
* MCP-compatible non-interactive version
|
|
69
|
+
*/
|
|
70
|
+
async function humanAddCommand(projectPath, options = {}) {
|
|
71
|
+
try {
|
|
72
|
+
// Find existing .faf file
|
|
73
|
+
const fafPath = await findFafFile(projectPath);
|
|
74
|
+
if (!fafPath) {
|
|
75
|
+
// Create new project.faf if it doesn't exist
|
|
76
|
+
const newFafPath = path.join(projectPath, 'project.faf');
|
|
77
|
+
if (options.yaml) {
|
|
78
|
+
// Parse the input YAML
|
|
79
|
+
const inputData = (0, yaml_1.parse)(options.yaml);
|
|
80
|
+
// If input has human_context key, use it directly
|
|
81
|
+
// Otherwise wrap the input as human_context
|
|
82
|
+
const fafData = inputData.human_context
|
|
83
|
+
? inputData
|
|
84
|
+
: { human_context: inputData };
|
|
85
|
+
await fs_1.promises.writeFile(newFafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
|
|
86
|
+
const fields = Object.keys(fafData.human_context || {});
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
message: `Created ${newFafPath} with human_context`,
|
|
90
|
+
fieldsUpdated: fields
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
else if (options.field && options.value) {
|
|
94
|
+
// Single field mode
|
|
95
|
+
const fafData = {
|
|
96
|
+
human_context: {
|
|
97
|
+
[options.field]: options.value
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
await fs_1.promises.writeFile(newFafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
message: `Created ${newFafPath} with ${options.field}`,
|
|
104
|
+
fieldsUpdated: [options.field]
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return {
|
|
109
|
+
success: false,
|
|
110
|
+
message: 'No .faf file found and no input provided',
|
|
111
|
+
error: 'Run faf_init first or provide YAML/field input'
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Read existing .faf file
|
|
116
|
+
const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
|
|
117
|
+
const fafData = (0, yaml_1.parse)(fafContent) || {};
|
|
118
|
+
if (!fafData.human_context) {
|
|
119
|
+
fafData.human_context = {};
|
|
120
|
+
}
|
|
121
|
+
const fieldsUpdated = [];
|
|
122
|
+
// YAML merge mode
|
|
123
|
+
if (options.yaml) {
|
|
124
|
+
const inputData = (0, yaml_1.parse)(options.yaml);
|
|
125
|
+
// Extract human_context from input
|
|
126
|
+
const humanContext = inputData.human_context || inputData;
|
|
127
|
+
// Merge fields
|
|
128
|
+
for (const [key, value] of Object.entries(humanContext)) {
|
|
129
|
+
if (value !== null && value !== undefined && value !== '') {
|
|
130
|
+
fafData.human_context[key] = value;
|
|
131
|
+
fieldsUpdated.push(key);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Single field mode
|
|
136
|
+
if (options.field && options.value) {
|
|
137
|
+
fafData.human_context[options.field] = options.value;
|
|
138
|
+
fieldsUpdated.push(options.field);
|
|
139
|
+
}
|
|
140
|
+
// Save updated .faf
|
|
141
|
+
if (fieldsUpdated.length > 0) {
|
|
142
|
+
await fs_1.promises.writeFile(fafPath, (0, yaml_1.stringify)(fafData), 'utf-8');
|
|
143
|
+
return {
|
|
144
|
+
success: true,
|
|
145
|
+
message: `Updated ${fieldsUpdated.length} field(s) in ${fafPath}`,
|
|
146
|
+
fieldsUpdated
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return {
|
|
151
|
+
success: false,
|
|
152
|
+
message: 'No fields to update',
|
|
153
|
+
error: 'Provide yaml or field/value parameters'
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
return {
|
|
159
|
+
success: false,
|
|
160
|
+
message: 'Failed to add human context',
|
|
161
|
+
error: error instanceof Error ? error.message : String(error)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Set a single human_context field
|
|
167
|
+
* Convenience wrapper for single field updates
|
|
168
|
+
*/
|
|
169
|
+
async function humanSetCommand(projectPath, field, value) {
|
|
170
|
+
const validFields = ['who', 'what', 'where', 'why', 'when', 'how'];
|
|
171
|
+
if (!validFields.includes(field.toLowerCase())) {
|
|
172
|
+
return {
|
|
173
|
+
success: false,
|
|
174
|
+
message: `Invalid field: ${field}`,
|
|
175
|
+
error: `Valid fields: ${validFields.join(', ')}`
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return humanAddCommand(projectPath, {
|
|
179
|
+
field: field.toLowerCase(),
|
|
180
|
+
value
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=human.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/human.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDH,0CA8GC;AAMD,0CAmBC;AArLD,2BAAoC;AACpC,+BAAsE;AACtE,2CAA6B;AAiB7B;;GAEG;AACH,KAAK,UAAU,WAAW,CAAC,SAAiB;IAC1C,MAAM,aAAa,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;KACjC,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,aAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACzB,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,eAAe,CACnC,WAAmB,EACnB,UAA2B,EAAE;IAE7B,IAAI,CAAC;QACH,0BAA0B;QAC1B,MAAM,OAAO,GAA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AAC,WAAW,EAAE;QAC1B,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* README Context Extraction - MCP Bundled Version
|
|
3
|
+
* Non-interactive extraction of 6 Ws from README files
|
|
4
|
+
*/
|
|
5
|
+
export interface ExtractedContext {
|
|
6
|
+
who?: string;
|
|
7
|
+
what?: string;
|
|
8
|
+
where?: string;
|
|
9
|
+
why?: string;
|
|
10
|
+
when?: string;
|
|
11
|
+
how?: string;
|
|
12
|
+
confidence: {
|
|
13
|
+
who: number;
|
|
14
|
+
what: number;
|
|
15
|
+
where: number;
|
|
16
|
+
why: number;
|
|
17
|
+
when: number;
|
|
18
|
+
how: number;
|
|
19
|
+
overall: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface ReadmeExtractResult {
|
|
23
|
+
success: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
extracted?: ExtractedContext;
|
|
26
|
+
readmePath?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Extract 6 Ws from README content
|
|
31
|
+
* Ported from faf-cli v4.3.0
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractSixWs(content: string): ExtractedContext;
|
|
34
|
+
/**
|
|
35
|
+
* Extract context from README file
|
|
36
|
+
* Non-interactive MCP version
|
|
37
|
+
*/
|
|
38
|
+
export declare function readmeExtractCommand(projectPath: string): Promise<ReadmeExtractResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Extract and merge README context into project.faf
|
|
41
|
+
* Combines extraction + merging in one step
|
|
42
|
+
*/
|
|
43
|
+
export declare function readmeMergeCommand(projectPath: string, options?: {
|
|
44
|
+
overwrite?: boolean;
|
|
45
|
+
}): Promise<ReadmeExtractResult & {
|
|
46
|
+
fieldsUpdated?: string[];
|
|
47
|
+
}>;
|