faf-mcp 1.3.0 → 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.
Files changed (100) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/CLAUDE.md +5 -5
  3. package/README.md +70 -14
  4. package/assets/thumbnail.png +0 -0
  5. package/dist/src/faf-core/commands/agents.d.ts +29 -0
  6. package/dist/src/faf-core/commands/agents.js +140 -0
  7. package/dist/src/faf-core/commands/agents.js.map +1 -0
  8. package/dist/src/faf-core/commands/bi-sync.d.ts +9 -5
  9. package/dist/src/faf-core/commands/bi-sync.js +89 -85
  10. package/dist/src/faf-core/commands/bi-sync.js.map +1 -1
  11. package/dist/src/faf-core/commands/conductor.d.ts +25 -0
  12. package/dist/src/faf-core/commands/conductor.js +157 -0
  13. package/dist/src/faf-core/commands/conductor.js.map +1 -0
  14. package/dist/src/faf-core/commands/cursor.d.ts +29 -0
  15. package/dist/src/faf-core/commands/cursor.js +134 -0
  16. package/dist/src/faf-core/commands/cursor.js.map +1 -0
  17. package/dist/src/faf-core/commands/gemini.d.ts +29 -0
  18. package/dist/src/faf-core/commands/gemini.js +133 -0
  19. package/dist/src/faf-core/commands/gemini.js.map +1 -0
  20. package/dist/src/faf-core/commands/git-context.d.ts +23 -0
  21. package/dist/src/faf-core/commands/git-context.js +66 -0
  22. package/dist/src/faf-core/commands/git-context.js.map +1 -0
  23. package/dist/src/faf-core/commands/human.d.ts +27 -0
  24. package/dist/src/faf-core/commands/human.js +183 -0
  25. package/dist/src/faf-core/commands/human.js.map +1 -0
  26. package/dist/src/faf-core/commands/readme.d.ts +47 -0
  27. package/dist/src/faf-core/commands/readme.js +361 -0
  28. package/dist/src/faf-core/commands/readme.js.map +1 -0
  29. package/dist/src/faf-core/engines/fab-formats-processor.js +3 -3
  30. package/dist/src/faf-core/engines/fab-formats-processor.js.map +1 -1
  31. package/dist/src/faf-core/engines/faf-dna.d.ts +1 -1
  32. package/dist/src/faf-core/engines/faf-dna.js +4 -3
  33. package/dist/src/faf-core/engines/faf-dna.js.map +1 -1
  34. package/dist/src/faf-core/generators/faf-generator-championship.js +9 -8
  35. package/dist/src/faf-core/generators/faf-generator-championship.js.map +1 -1
  36. package/dist/src/faf-core/parsers/agents-parser.d.ts +59 -0
  37. package/dist/src/faf-core/parsers/agents-parser.js +324 -0
  38. package/dist/src/faf-core/parsers/agents-parser.js.map +1 -0
  39. package/dist/src/faf-core/parsers/conductor-parser.d.ts +85 -0
  40. package/dist/src/faf-core/parsers/conductor-parser.js +293 -0
  41. package/dist/src/faf-core/parsers/conductor-parser.js.map +1 -0
  42. package/dist/src/faf-core/parsers/cursorrules-parser.d.ts +57 -0
  43. package/dist/src/faf-core/parsers/cursorrules-parser.js +317 -0
  44. package/dist/src/faf-core/parsers/cursorrules-parser.js.map +1 -0
  45. package/dist/src/faf-core/parsers/faf-git-generator.d.ts +53 -0
  46. package/dist/src/faf-core/parsers/faf-git-generator.js +512 -0
  47. package/dist/src/faf-core/parsers/faf-git-generator.js.map +1 -0
  48. package/dist/src/faf-core/parsers/gemini-parser.d.ts +57 -0
  49. package/dist/src/faf-core/parsers/gemini-parser.js +263 -0
  50. package/dist/src/faf-core/parsers/gemini-parser.js.map +1 -0
  51. package/dist/src/faf-core/parsers/github-extractor.d.ts +61 -0
  52. package/dist/src/faf-core/parsers/github-extractor.js +374 -0
  53. package/dist/src/faf-core/parsers/github-extractor.js.map +1 -0
  54. package/dist/src/faf-core/parsers/index.d.ts +12 -0
  55. package/dist/src/{compiler → faf-core/parsers}/index.js +10 -5
  56. package/dist/src/faf-core/parsers/index.js.map +1 -0
  57. package/dist/src/faf-core/parsers/slot-counter.d.ts +55 -0
  58. package/dist/src/faf-core/parsers/slot-counter.js +100 -0
  59. package/dist/src/faf-core/parsers/slot-counter.js.map +1 -0
  60. package/dist/src/faf-core/utils/balance-visualizer.js +3 -3
  61. package/dist/src/faf-core/utils/balance-visualizer.js.map +1 -1
  62. package/dist/src/handlers/championship-tools.d.ts +10 -5
  63. package/dist/src/handlers/championship-tools.js +261 -233
  64. package/dist/src/handlers/championship-tools.js.map +1 -1
  65. package/dist/src/handlers/engine-adapter.js +238 -5
  66. package/dist/src/handlers/engine-adapter.js.map +1 -1
  67. package/dist/src/handlers/tools.d.ts +61 -0
  68. package/dist/src/handlers/tools.js +2109 -126
  69. package/dist/src/handlers/tools.js.map +1 -1
  70. package/dist/src/index.js +0 -0
  71. package/dist/src/types/tool-visibility.js +51 -10
  72. package/dist/src/types/tool-visibility.js.map +1 -1
  73. package/dist/src/utils/championship-format.js +11 -9
  74. package/dist/src/utils/championship-format.js.map +1 -1
  75. package/dist/src/utils/path-resolver.js +56 -2
  76. package/dist/src/utils/path-resolver.js.map +1 -1
  77. package/dist/src/utils/visual-style.js +7 -5
  78. package/dist/src/utils/visual-style.js.map +1 -1
  79. package/dist/src/version.js +24 -11
  80. package/dist/src/version.js.map +1 -1
  81. package/package.json +5 -3
  82. package/project.faf +14 -18
  83. package/dist/index.json +0 -1
  84. package/dist/src/compiler/index.d.ts +0 -7
  85. package/dist/src/compiler/index.js.map +0 -1
  86. package/dist/src/compiler/scorer.d.ts +0 -53
  87. package/dist/src/compiler/scorer.js +0 -189
  88. package/dist/src/compiler/scorer.js.map +0 -1
  89. package/dist/src/compiler/slot-validator.d.ts +0 -32
  90. package/dist/src/compiler/slot-validator.js +0 -293
  91. package/dist/src/compiler/slot-validator.js.map +0 -1
  92. package/dist/src/compiler/type-detector.d.ts +0 -62
  93. package/dist/src/compiler/type-detector.js +0 -388
  94. package/dist/src/compiler/type-detector.js.map +0 -1
  95. package/dist/src/types/project-types.d.ts +0 -22
  96. package/dist/src/types/project-types.js +0 -85
  97. package/dist/src/types/project-types.js.map +0 -1
  98. package/dist/src/types/slots.d.ts +0 -39
  99. package/dist/src/types/slots.js +0 -162
  100. package/dist/src/types/slots.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,53 @@ All notable changes to faf-mcp will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.0] - 2026-03-07 — The Interop MCP for Context
9
+
10
+ **Define once. Sync everywhere.**
11
+
12
+ ### Added
13
+
14
+ - **AI Format Interop** — 5 new MCP tools for cross-platform AI context
15
+ - `faf_agents`: Import/export/sync AGENTS.md (OpenAI Codex / Linux Foundation)
16
+ - `faf_cursor`: Import/export/sync .cursorrules (Cursor IDE)
17
+ - `faf_gemini`: Import/export/sync GEMINI.md (Google Gemini CLI)
18
+ - `faf_conductor`: Import/export Conductor directory structure
19
+ - `faf_git`: Extract .faf context from any public GitHub repo URL
20
+ - **Bi-sync `--all` flag** — Sync project.faf to all formats at once (CLAUDE.md + AGENTS.md + .cursorrules + GEMINI.md)
21
+ - **7 bundled parsers** — All parser logic runs standalone, zero CLI dependency
22
+ - agents-parser, cursorrules-parser, gemini-parser, conductor-parser
23
+ - github-extractor, faf-git-generator, slot-counter
24
+ - **WJTTC v2.0.0 Championship Suite** — 73 Brake/Engine/Aero tests
25
+ - **New test suites** — interop-v450, cli-mcp-parity, type-definitions-edge-cases
26
+
27
+ ### Changed
28
+
29
+ - **Tool count**: 56 → 61 (25 core + 36 advanced)
30
+ - **Tests**: 84 → 309 (9 suites)
31
+ - **MCP SDK**: ^1.26.0 → ^1.27.1
32
+ - Tier system fix: 100 = Trophy max (105 removed)
33
+ - Path resolver: tilde expansion + project discovery
34
+ - Version resolver: multi-path package.json fallback
35
+
36
+ ### Why Major Version
37
+
38
+ New interop tools change the MCP contract surface. Define once in .faf, sync to every AI platform.
39
+
40
+ ## [1.3.1] - 2026-02-15
41
+
42
+ ### Fixed
43
+
44
+ - **Remove 105% scoring system** - Align with official FAF tier system (0-100%)
45
+ - Remove Easter egg logic that awarded 105% for rich .faf + CLAUDE.md
46
+ - Update to Trophy (100%) as perfect score
47
+ - 🍊 Big Orange is now a BADGE awarded separately, not a calculated score
48
+ - Update tests and documentation to reflect correct tier system
49
+ - Fixes alignment with FAF standard where scores range 0-100%
50
+
51
+ ### Changed
52
+
53
+ - Updated faf-cli dependency to v4.4.0
54
+
8
55
  ## [1.3.0] - 2026-02-09
9
56
 
10
57
  ### 🌐 MCPaaS Integration - Universal Context Sharing
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # 🏎️ CLAUDE.md - faf-mcp Persistent Context & Intelligence
2
2
 
3
3
  ## PROJECT STATE: GOOD 🚀
4
- **Current Position:** Universal MCP server for all platforms
4
+ **Current Position:** USE>FAF™ - IANA-registered format (application/vnd.faf+yaml) • Universal AI context • MCP server for all platforms • Start with 'Use FAF'
5
5
  **Tyre Compound:** ULTRASOFT C5 (Maximum Performance)
6
6
 
7
7
  ---
@@ -10,21 +10,21 @@
10
10
 
11
11
  ### Project Identity
12
12
  - **Name:** faf-mcp
13
- - **Stack:** Node.js/TypeScript
13
+ - **Stack:** CLI/TypeScript/TypeScript (tsc)/npm registry/Node.js
14
14
  - **Quality:** F1-INSPIRED (Championship Performance)
15
15
 
16
16
  ### Technical Architecture
17
- - **What Building:** Universal FAF MCP Server - AI Context Intelligence for All Platforms
17
+ - **What Building:** USE>FAF - IANA-registered format (application/vnd.faf+yaml) • Universal AI context MCP server for all platforms • Start with 'Use FAF'
18
18
  - **Main Language:** TypeScript
19
19
 
20
20
  ### 📊 Context Quality Status
21
21
  - **Overall Assessment:** Good
22
- - **Last Updated:** 2025-12-18
22
+ - **Last Updated:** 2026-03-07
23
23
 
24
24
  ---
25
25
 
26
26
  **STATUS: BI-SYNC ACTIVE 🔗 - Synchronized with .faf context!**
27
27
 
28
- *Last Sync: 2025-12-18T20:42:35.461Z*
28
+ *Last Sync: 2026-03-07T17:33:41.765Z*
29
29
  *Sync Engine: F1-Inspired Software Engineering*
30
30
  *🏎️⚡️_championship_sync*
package/README.md CHANGED
@@ -6,15 +6,15 @@
6
6
  </div>
7
7
  </div>
8
8
 
9
- > **.FAF optimizes AI for your codebase.** At 100% (Gold Code), AI stops guessing and starts knowing. Universal MCP server for Cursor, Windsurf, Cline, VS Code, and all MCP-compatible platforms.
10
-
11
- **Universal version of [claude-faf-mcp](https://github.com/Wolfe-Jam/claude-faf-mcp)** — Anthropic-approved MCP server, now compatible with all platforms.
9
+ > **Define once. Sync everywhere.** Universal MCP server for Cursor, Windsurf, Cline, VS Code, and all MCP-compatible platforms. At 100% (Gold Code), AI stops guessing and starts knowing.
12
10
 
13
11
  [![CI](https://github.com/Wolfe-Jam/faf-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Wolfe-Jam/faf-mcp/actions/workflows/ci.yml)
14
12
  [![NPM Downloads](https://img.shields.io/npm/dt/faf-mcp?label=total%20downloads&color=00CCFF)](https://www.npmjs.com/package/faf-mcp)
15
13
  [![npm version](https://img.shields.io/npm/v/faf-mcp?color=00CCFF)](https://www.npmjs.com/package/faf-mcp)
16
14
  [![Website](https://img.shields.io/badge/Website-faf.one-orange)](https://faf.one)
17
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16
+ [![project.faf](https://img.shields.io/badge/project.faf-inside-00D4D4)](https://github.com/Wolfe-Jam/faf)
17
+ [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new?repository-url=https://github.com/Wolfe-Jam/faf-mcp)
18
18
 
19
19
  ---
20
20
 
@@ -63,22 +63,38 @@ Setup savings get you started. Lifecycle optimization keeps you ahead.
63
63
 
64
64
  ---
65
65
 
66
- ## Quick Start
66
+ ## Three Ways to Deploy
67
+
68
+ | Door | Method | Best For |
69
+ |------|--------|----------|
70
+ | **Hosted** | [mcpaas.live](https://mcpaas.live) | Zero-install, point any MCP client to the URL |
71
+ | **Self-Deploy** | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new?repository-url=https://github.com/Wolfe-Jam/faf-mcp) | Your own instance, full control |
72
+ | **Local** | `npx faf-mcp` | IDE integration via stdio transport |
73
+
74
+ ### Hosted (mcpaas.live)
75
+
76
+ Point your MCP client to `https://mcpaas.live/sse` — no install, no config, no maintenance. Served from 300+ Cloudflare edges with sub-ms cold starts via 2.7KB Zig-WASM engine.
77
+
78
+ ### Self-Deploy (Vercel)
67
79
 
68
- **1. Install:**
80
+ Click the Deploy button above to get your own MCP server on Vercel in one click. Once deployed, your server exposes:
81
+ - `/health` — Health check
82
+ - `/info` — Server metadata + tool list
83
+ - `/sse` — MCP Server-Sent Events transport
84
+ - `/ghost` — Ghost guardian demo
85
+
86
+ ### Local (npm)
69
87
 
70
88
  ```bash
71
- npm install -g faf-mcp
89
+ npx faf-mcp
72
90
  ```
73
91
 
74
- **2. Add to your MCP config:**
92
+ Or install globally and add to your MCP config:
75
93
 
76
94
  ```json
77
95
  {"mcpServers": {"faf": {"command": "npx", "args": ["-y", "faf-mcp"]}}}
78
96
  ```
79
97
 
80
- ### Platform-Specific Setup
81
-
82
98
  | Platform | Config File |
83
99
  |----------|-------------|
84
100
  | **Cursor** | `~/.cursor/mcp.json` |
@@ -89,7 +105,40 @@ npm install -g faf-mcp
89
105
 
90
106
  ---
91
107
 
92
- ## ☁️ Cloud Sync (NEW in v1.3.0)
108
+ ## 🔄 AI Format Interop
109
+
110
+ Define once in `.faf`, sync to every AI platform:
111
+
112
+ ```
113
+ project.faf
114
+
115
+ ┌────────┬───────┴───────┬────────────┐
116
+ ▼ ▼ ▼ ▼
117
+ CLAUDE.md AGENTS.md .cursorrules GEMINI.md
118
+ (Claude) (Codex) (Cursor) (Gemini)
119
+ ```
120
+
121
+ | Tool | Platform | Action |
122
+ |------|----------|--------|
123
+ | `faf_agents` | OpenAI Codex | Import/export/sync AGENTS.md |
124
+ | `faf_cursor` | Cursor IDE | Import/export/sync .cursorrules |
125
+ | `faf_gemini` | Google Gemini | Import/export/sync GEMINI.md |
126
+ | `faf_conductor` | Conductor | Import/export directory structure |
127
+ | `faf_git` | GitHub | Generate .faf from any repo URL |
128
+
129
+ ```bash
130
+ # Sync to all formats at once
131
+ faf bi-sync --all
132
+
133
+ # Generate .faf from any GitHub repo
134
+ faf_git { url: "https://github.com/facebook/react" }
135
+ ```
136
+
137
+ **61 tools** (25 core + 36 advanced) · **309 tests** (9 suites) · **7 bundled parsers**
138
+
139
+ ---
140
+
141
+ ## ☁️ Cloud Sync
93
142
 
94
143
  Share your FAF context globally via [mcpaas.live](https://mcpaas.live):
95
144
 
@@ -127,6 +176,7 @@ project.faf ←──── 8ms ────→ CLAUDE.md
127
176
  ```
128
177
 
129
178
  - Update either file → both stay aligned
179
+ - `--all` flag syncs to CLAUDE.md + AGENTS.md + .cursorrules + GEMINI.md
130
180
  - Zero manual maintenance
131
181
  - Works across teams, branches, sessions
132
182
  - **Context never goes stale**
@@ -165,7 +215,7 @@ Works on all platforms — stops web search, forces tool usage.
165
215
 
166
216
  ---
167
217
 
168
- ## 🛠️ 22 Native MCP Tools
218
+ ## 🛠️ 25 Core MCP Tools
169
219
 
170
220
  | Tool | Purpose |
171
221
  |------|---------|
@@ -176,14 +226,20 @@ Works on all platforms — stops web search, forces tool usage.
176
226
  | `faf_enhance` | Intelligent enhancement |
177
227
  | `faf_read` | Parse and validate FAF files |
178
228
  | `faf_write` | Create/update FAF with validation |
179
- | **☁️ Cloud Tools** | **(NEW in v1.3.0)** |
229
+ | **🔄 Interop Tools** | |
230
+ | `faf_agents` | Import/export/sync AGENTS.md |
231
+ | `faf_cursor` | Import/export/sync .cursorrules |
232
+ | `faf_gemini` | Import/export/sync GEMINI.md |
233
+ | `faf_conductor` | Import/export directory structure |
234
+ | `faf_git` | Generate .faf from GitHub repo URL |
235
+ | **☁️ Cloud Tools** | |
180
236
  | `faf_cloud_publish` | Upload to mcpaas.live |
181
237
  | `faf_cloud_fetch` | Pull from cloud |
182
238
  | `faf_cloud_list` | List souls |
183
239
  | `faf_cloud_search` | Search souls |
184
240
  | `faf_cloud_share` | Generate share links |
185
241
 
186
- **Plus CLI fallback with 40+ commands** (via faf-cli v4.3.0):
242
+ **Plus 36 advanced tools and CLI fallback** (via faf-cli v5.0.1):
187
243
  - `faf readme` - Extract 6 Ws from README (+25-35% boost)
188
244
  - `faf human-add` - Non-interactive YAML merge (6Ws Builder)
189
245
  - `faf git` - GitHub repo analysis without cloning
@@ -210,7 +266,7 @@ Works on all platforms — stops web search, forces tool usage.
210
266
 
211
267
  ## 📦 Ecosystem
212
268
 
213
- - **[claude-faf-mcp](https://npmjs.com/package/claude-faf-mcp)** — Claude Desktop (52 tools)
269
+ - **[claude-faf-mcp](https://npmjs.com/package/claude-faf-mcp)** — Claude Desktop (33 tools)
214
270
  - **[faf-cli](https://npmjs.com/package/faf-cli)** — Terminal CLI (18k+ downloads)
215
271
  - **[faf-wasm](https://www.npmjs.com/package/faf-wasm)** — WASM SDK (<5ms scoring)
216
272
  - **[faf.one](https://faf.one)** — Official website
Binary file
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Agents Command - v4.5.0 Interop Edition
3
+ *
4
+ * Import/Export/Sync between AGENTS.md and project.faf
5
+ * Bundled command — no CLI dependency required.
6
+ */
7
+ export interface AgentsCommandResult {
8
+ success: boolean;
9
+ action: 'import' | 'export' | 'sync';
10
+ message: string;
11
+ data?: any;
12
+ warnings?: string[];
13
+ }
14
+ /**
15
+ * Import AGENTS.md into project.faf
16
+ */
17
+ export declare function agentsImportCommand(projectPath: string, options?: {
18
+ merge?: boolean;
19
+ }): Promise<AgentsCommandResult>;
20
+ /**
21
+ * Export project.faf to AGENTS.md
22
+ */
23
+ export declare function agentsExportCommand(projectPath: string, options?: {
24
+ force?: boolean;
25
+ }): Promise<AgentsCommandResult>;
26
+ /**
27
+ * Sync AGENTS.md <-> project.faf (FAF is source of truth by default)
28
+ */
29
+ export declare function agentsSyncCommand(projectPath: string): Promise<AgentsCommandResult>;
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ /**
3
+ * Agents Command - v4.5.0 Interop Edition
4
+ *
5
+ * Import/Export/Sync between AGENTS.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.agentsImportCommand = agentsImportCommand;
13
+ exports.agentsExportCommand = agentsExportCommand;
14
+ exports.agentsSyncCommand = agentsSyncCommand;
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 agents_parser_js_1 = require("../parsers/agents-parser.js");
20
+ /**
21
+ * Import AGENTS.md into project.faf
22
+ */
23
+ async function agentsImportCommand(projectPath, options = {}) {
24
+ const agentsPath = await (0, agents_parser_js_1.detectAgentsMd)(projectPath);
25
+ if (!agentsPath) {
26
+ return {
27
+ success: false,
28
+ action: 'import',
29
+ message: 'No AGENTS.md found in project directory',
30
+ };
31
+ }
32
+ const result = await (0, agents_parser_js_1.agentsImport)(agentsPath);
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 merge mode, read existing .faf and merge
42
+ if (options.merge) {
43
+ const fafPath = await (0, file_utils_js_1.findFafFile)(projectPath);
44
+ if (fafPath) {
45
+ try {
46
+ const existingContent = await fs_1.promises.readFile(fafPath, 'utf-8');
47
+ const existingFaf = (0, yaml_js_1.parse)(existingContent);
48
+ // Merge: spread existing + overlay imported fields
49
+ const merged = {
50
+ ...existingFaf,
51
+ project: {
52
+ ...(existingFaf.project || {}),
53
+ rules: [
54
+ ...(existingFaf.project?.rules || []),
55
+ ...result.faf.project.rules,
56
+ ],
57
+ guidelines: [
58
+ ...(existingFaf.project?.guidelines || []),
59
+ ...result.faf.project.guidelines,
60
+ ],
61
+ codingStyle: [
62
+ ...(existingFaf.project?.codingStyle || []),
63
+ ...result.faf.project.codingStyle,
64
+ ],
65
+ },
66
+ };
67
+ const yamlContent = (0, yaml_js_1.stringify)(merged);
68
+ await fs_1.promises.writeFile(fafPath, yamlContent);
69
+ return {
70
+ success: true,
71
+ action: 'import',
72
+ message: `Merged AGENTS.md into existing .faf (${result.sectionsFound.length} sections)`,
73
+ data: { sectionsFound: result.sectionsFound, merged: true },
74
+ warnings: result.warnings,
75
+ };
76
+ }
77
+ catch {
78
+ // Fall through to create new
79
+ }
80
+ }
81
+ }
82
+ return {
83
+ success: true,
84
+ action: 'import',
85
+ message: `Imported AGENTS.md (${result.sectionsFound.length} sections found)`,
86
+ data: { faf: result.faf, sectionsFound: result.sectionsFound },
87
+ warnings: result.warnings,
88
+ };
89
+ }
90
+ /**
91
+ * Export project.faf to AGENTS.md
92
+ */
93
+ async function agentsExportCommand(projectPath, options = {}) {
94
+ // Check for existing .faf
95
+ const fafPath = await (0, file_utils_js_1.findFafFile)(projectPath);
96
+ if (!fafPath) {
97
+ return {
98
+ success: false,
99
+ action: 'export',
100
+ message: 'No .faf file found. Run faf init first.',
101
+ };
102
+ }
103
+ // Check if AGENTS.md already exists
104
+ const outputPath = path_1.default.join(projectPath, 'AGENTS.md');
105
+ if (!options.force) {
106
+ try {
107
+ await fs_1.promises.access(outputPath);
108
+ return {
109
+ success: false,
110
+ action: 'export',
111
+ message: 'AGENTS.md already exists. Use force: true to overwrite.',
112
+ };
113
+ }
114
+ catch {
115
+ // File doesn't exist, proceed
116
+ }
117
+ }
118
+ // Read and parse .faf
119
+ const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
120
+ const fafData = (0, yaml_js_1.parse)(fafContent);
121
+ // Export
122
+ const result = await (0, agents_parser_js_1.agentsExport)(fafData, outputPath);
123
+ return {
124
+ success: result.success,
125
+ action: 'export',
126
+ message: result.success
127
+ ? `Exported project.faf to AGENTS.md`
128
+ : 'Export failed',
129
+ data: { filePath: result.filePath },
130
+ warnings: result.warnings,
131
+ };
132
+ }
133
+ /**
134
+ * Sync AGENTS.md <-> project.faf (FAF is source of truth by default)
135
+ */
136
+ async function agentsSyncCommand(projectPath) {
137
+ // FAF is always source of truth in MCP context
138
+ return await agentsExportCommand(projectPath, { force: true });
139
+ }
140
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/agents.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,kDA4EC;AAKD,kDA6CC;AAKD,8CAKC;AA7JD,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,8CAA8C;IAC9C,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,MAAM,IAAA,2BAAW,EAAC,WAAW,CAAC,CAAC;QAC/C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,eAAe,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC5D,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,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,+CAA+C;IAC/C,OAAO,MAAM,mBAAmB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC"}
@@ -1,13 +1,17 @@
1
1
  /**
2
2
  * 🔗 Bi-Sync Engine - Mk3 Bundled Edition
3
3
  * Revolutionary project.faf ↔ CLAUDE.md Synchronization
4
+ * v4.5.0: Added agents/cursor/gemini/all flags for multi-format sync
4
5
  */
5
6
  export interface BiSyncOptions {
6
7
  auto?: boolean;
7
8
  watch?: boolean;
8
9
  force?: boolean;
9
10
  json?: boolean;
10
- target?: 'auto' | '.clinerules' | '.cursorrules' | '.windsurfrules' | 'CLAUDE.md' | 'all';
11
+ agents?: boolean;
12
+ cursor?: boolean;
13
+ gemini?: boolean;
14
+ all?: boolean;
11
15
  }
12
16
  export interface BiSyncResult {
13
17
  success: boolean;
@@ -18,10 +22,10 @@ export interface BiSyncResult {
18
22
  message: string;
19
23
  }
20
24
  /**
21
- * 🔄 Convert project.faf YAML content to platform-specific format
25
+ * 🔄 Convert project.faf YAML content to CLAUDE.md Markdown format
22
26
  */
23
- export declare function fafToPlatformFormat(fafContent: string, targetPlatform: string): string;
27
+ export declare function fafToClaudeMd(fafContent: string): string;
24
28
  /**
25
- * 🔗 Main Bi-Sync function - Platform-Aware
29
+ * 🔗 Main Bi-Sync function
26
30
  */
27
- export declare function syncBiDirectional(projectPath?: string, options?: BiSyncOptions): Promise<BiSyncResult>;
31
+ export declare function syncBiDirectional(projectPath?: string, _options?: BiSyncOptions): Promise<BiSyncResult>;