faf-mcp 3.0.1 → 3.0.2
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 +14 -1
- package/CLAUDE.md +2 -2
- package/README.md +27 -17
- package/dist/src/cli.js +2 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/faf-core/commands/agents.js +19 -5
- package/dist/src/faf-core/commands/agents.js.map +1 -1
- package/dist/src/faf-core/commands/claude.d.ts +0 -1
- package/dist/src/faf-core/commands/claude.js +1 -2
- package/dist/src/faf-core/commands/claude.js.map +1 -1
- package/dist/src/faf-core/commands/conductor.js +35 -10
- package/dist/src/faf-core/commands/conductor.js.map +1 -1
- package/dist/src/faf-core/commands/cursor.js +19 -5
- package/dist/src/faf-core/commands/cursor.js.map +1 -1
- package/dist/src/faf-core/commands/gemini.js +19 -5
- package/dist/src/faf-core/commands/gemini.js.map +1 -1
- package/dist/src/faf-core/commands/git-context.d.ts +12 -3
- package/dist/src/faf-core/commands/git-context.js +28 -6
- package/dist/src/faf-core/commands/git-context.js.map +1 -1
- package/dist/src/faf-core/commands/sync.d.ts +8 -0
- package/dist/src/faf-core/commands/sync.js +20 -23
- package/dist/src/faf-core/commands/sync.js.map +1 -1
- package/dist/src/faf-core/fix-once/yaml.js +12 -13
- package/dist/src/faf-core/fix-once/yaml.js.map +1 -1
- package/dist/src/faf-core/parsers/faf-git-generator.d.ts +0 -1
- package/dist/src/faf-core/parsers/faf-git-generator.js +13 -34
- package/dist/src/faf-core/parsers/faf-git-generator.js.map +1 -1
- package/dist/src/handlers/engine-adapter.js +5 -3
- package/dist/src/handlers/engine-adapter.js.map +1 -1
- package/dist/src/handlers/tools.js +95 -80
- package/dist/src/handlers/tools.js.map +1 -1
- package/package.json +3 -3
- package/project.faf +2 -2
- package/scripts/sync-version.js +2 -1
- package/skills/faf-ide/SKILL.md +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- faf: faf-mcp | TypeScript | mcp | The Interop MCP for Context — the Cursor / IDE Edition. Persistent context for Cursor, VS Code, and every MCP-compatible IDE. IANA-registered application/vnd.faf+yaml. Start with "Use FAF". -->
|
|
2
|
-
<!-- faf: doc=changelog | latest=v3.0.
|
|
2
|
+
<!-- faf: doc=changelog | latest=v3.0.2 | canonical=project.faf | family=FAF -->
|
|
3
3
|
|
|
4
4
|
# Changelog
|
|
5
5
|
|
|
@@ -8,6 +8,19 @@ All notable changes to faf-mcp will be documented in this file.
|
|
|
8
8
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
9
9
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
10
10
|
|
|
11
|
+
## [3.0.2] - 2026-09-10 — The Compose Edition
|
|
12
|
+
|
|
13
|
+
**Tools that say what they do: `faf_git` scores with faf-cli and asks before overwriting, `faf_sync` previews each change, and imports say when nothing was written.**
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **`faf_git` has one scorer.** It reported its own slot count (100% Trophy on files faf-cli scores 5–14%); it now reports faf-cli's score of the bytes it authored. It writes the .faf slots faf-cli scores (`project.goal`, `project.main_language`, `human_context`), so the score reflects what it found, and it refuses to replace an existing `project.faf` unless you pass `force: true`.
|
|
17
|
+
- **`faf_sync` previews each change.** The dry run lists every field it would update, once, with the value `apply: true` will write. It used to give a count and suggest a CLI flag the tool does not take.
|
|
18
|
+
- **Imports say when nothing was written.** `faf_agents`, `faf_cursor`, `faf_gemini` and `faf_conductor` import without `merge` now say so; `merge: true` with no `project.faf` fails with a clear message. `faf_conductor` export fills its sections from the .faf fields.
|
|
19
|
+
- **Errors speak MCP.** YAML parse errors no longer carry terminal colour codes or a CLI command, and the `faf_score` headline no longer carries stray control bytes.
|
|
20
|
+
- **Descriptions and annotations match the handlers.** `faf_dna` is marked as writing; `faf_write`, `faf_conductor` and `faf_git` as able to overwrite; `faf_check` protect is described as advisory; `faf_trust`, `faf_doctor`, `faf_formats`, `faf_clear`, `faf_context`, `faf_auto` and `faf_quick` say what they do. `faf_debug` checks write access without writing a file, `faf_guide` teaches the MCP tools, and `faf_quick` writes a format version and no default language.
|
|
21
|
+
- Repo: `ABOUT.md` (a false "Anthropic stewardship" line and a monorepo layout that no longer exists) and `demo-server.js` (an HTTP demo with retired tools) are archived under git tags and removed; `SECURITY.md` supports 3.x; `CONTRIBUTING.md` lists Node 22 and Bun.
|
|
22
|
+
- A version bump now re-stamps the project's release line and re-renders CLAUDE.md and the Copilot file from it.
|
|
23
|
+
|
|
11
24
|
## [3.0.1] - 2026-09-10 — The Compose Edition
|
|
12
25
|
|
|
13
26
|
**Names that match the code: `faf_bi_sync` is now `faf_claude`, `faf_init` writes what `faf init` writes, and the listings lead with .FAF Context.**
|
package/CLAUDE.md
CHANGED
|
@@ -25,12 +25,12 @@ The Interop MCP for Context — the Cursor / IDE Edition. Persistent context for
|
|
|
25
25
|
- **What:** The Cursor / IDE Edition — persistent context for Cursor, VS Code, and every MCP-compatible IDE — 29 MCP tools (15 essential shown by default), interop with AGENTS.md, .cursorrules, GEMINI.md
|
|
26
26
|
- **Why:** Eliminate the 20-minute AI context tax — give AI instant project understanding in 30 seconds
|
|
27
27
|
- **Where:** npm · MCP Registry · any MCP-compatible IDE — people get it how they wish
|
|
28
|
-
- **When:** Production/Stable — v3.0.
|
|
28
|
+
- **When:** Production/Stable — v3.0.2 The Compose Edition, WJTTC certified
|
|
29
29
|
- **How:** npx faf-mcp or npm install -g faf-mcp, then add to your MCP config
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
*STATUS: BI-SYNC ACTIVE — 2026-09-
|
|
33
|
+
*STATUS: BI-SYNC ACTIVE — 2026-09-10T20:10:15.531Z*
|
|
34
34
|
<!-- faf:end -->
|
|
35
35
|
|
|
36
36
|
## Working here
|
package/README.md
CHANGED
|
@@ -27,14 +27,16 @@
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
## What's New in 3.0.
|
|
30
|
+
## What's New in 3.0.2 — The Compose Edition
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Tools that say what they do: `faf_git` scores with faf-cli and asks before overwriting, `faf_sync` previews each change, and imports say when nothing was written.**
|
|
33
33
|
|
|
34
|
-
- **`
|
|
35
|
-
- **`
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
34
|
+
- **`faf_git` has one scorer.** It reports faf-cli's score of the file it authored, writes the slots faf-cli scores, and asks before replacing an existing `project.faf`.
|
|
35
|
+
- **`faf_sync` previews each change.** The dry run lists every field it would update and names `apply: true`.
|
|
36
|
+
- **Imports say when nothing was written,** and `merge: true` with no `project.faf` fails clearly.
|
|
37
|
+
- **Descriptions, annotations and errors match the code.** No CLI commands or terminal colour codes in tool output.
|
|
38
|
+
|
|
39
|
+
3.0.1 renamed `faf_bi_sync` to `faf_claude` and made `faf_init` write what `faf init` writes. The full history is in the [CHANGELOG](CHANGELOG.md).
|
|
38
40
|
|
|
39
41
|
## The Compose Edition (3.0)
|
|
40
42
|
|
|
@@ -179,20 +181,28 @@ Works on all platforms — stops web search, forces tool usage.
|
|
|
179
181
|
|
|
180
182
|
## 29 MCP Tools
|
|
181
183
|
|
|
184
|
+
The 15 Core tools, shown by default:
|
|
185
|
+
|
|
182
186
|
| Tool | Purpose |
|
|
183
187
|
|------|---------|
|
|
184
|
-
| `faf_init` |
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
188
|
+
| `faf_init` | Create a new `project.faf` (use `faf_auto` to enhance an existing one) |
|
|
189
|
+
| `faf_auto` | One-call setup: init or merge, stack detection, CLAUDE.md, score |
|
|
190
|
+
| `faf_go` | Guided interview that fills the missing human-context and goal fields toward 100% |
|
|
191
|
+
| `faf_score` | AI-readiness score (0-100%) and tier; `details:true` adds a slot-by-slot breakdown |
|
|
192
|
+
| `faf_doctor` | Diagnose a low score: missing files, slot counts, config issues, each with a fix |
|
|
193
|
+
| `faf_check` | Rate each `human_context` field empty / generic / good |
|
|
194
|
+
| `faf_trust` | Validate the required fields and `about.*` block with faf-cli's validator |
|
|
195
|
+
| `faf_sync` | Reconcile `project.faf` with package.json (dry-run; `apply:true` writes) |
|
|
196
|
+
| `faf_context` | Set or show the active project path |
|
|
197
|
+
| `faf_about` | What the IANA-registered `.faf` format is, in plain language |
|
|
190
198
|
| **Interop Tools** | |
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
195
|
-
| `faf_git` | Author .faf from GitHub repo URL |
|
|
199
|
+
| `faf_claude` | Write CLAUDE.md from `project.faf` (`all:true` also writes AGENTS.md, .cursorrules, GEMINI.md) |
|
|
200
|
+
| `faf_agents` | Import AGENTS.md into `project.faf`, or write it from `project.faf` |
|
|
201
|
+
| `faf_cursor` | Import .cursorrules into `project.faf`, or write it from `project.faf` |
|
|
202
|
+
| `faf_gemini` | Import GEMINI.md into `project.faf`, or write it from `project.faf` |
|
|
203
|
+
| `faf_git` | Author a `project.faf` from a public GitHub repo URL |
|
|
204
|
+
|
|
205
|
+
**+14 more with `FAF_TOOLS=all`:** `faf_status` · `faf_what` · `faf_guide` · `faf_debug` · `faf_clear` · `faf_list` · `faf_read` (read a file within the allowed roots: cwd, the OS temp dir, or `FAF_ALLOWED_ROOTS`) · `faf_write` (write a file within the same roots) · `faf_readme` · `faf_human_add` · `faf_quick` · `faf_formats` · `faf_dna` · `faf_conductor`
|
|
196
206
|
|
|
197
207
|
**Built on faf-cli.** Every tool composes the bundled [faf-cli](https://www.npmjs.com/package/faf-cli) in-process — the same scorer, the same renderers, the same block injector the CLI uses. Nothing shells out to a `faf` on your PATH.
|
|
198
208
|
|
package/dist/src/cli.js
CHANGED
|
@@ -10,7 +10,8 @@ async function main() {
|
|
|
10
10
|
cors: true
|
|
11
11
|
});
|
|
12
12
|
await server.start();
|
|
13
|
-
|
|
13
|
+
// stderr: stdout is the JSON-RPC stream in stdio mode.
|
|
14
|
+
console.error('FAF MCP Server started in stdio mode');
|
|
14
15
|
}
|
|
15
16
|
main().catch((error) => {
|
|
16
17
|
console.error('Failed to start MCP server:', error);
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;;AAEA,qCAAwC;AAExC,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC;QAC9B,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;;AAEA,qCAAwC;AAExC,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC;QAC9B,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,uDAAuD;IACvD,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -74,15 +74,29 @@ async function agentsImportCommand(projectPath, options = {}) {
|
|
|
74
74
|
warnings: result.warnings,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
catch {
|
|
78
|
-
|
|
77
|
+
catch (error) {
|
|
78
|
+
return {
|
|
79
|
+
success: false,
|
|
80
|
+
action: 'import',
|
|
81
|
+
message: `Could not merge AGENTS.md into project.faf: ${error instanceof Error ? error.message : String(error)}`,
|
|
82
|
+
warnings: result.warnings,
|
|
83
|
+
};
|
|
79
84
|
}
|
|
80
85
|
}
|
|
86
|
+
// merge was asked for and there is nothing to merge into: say so rather
|
|
87
|
+
// than report a no-op as an import.
|
|
88
|
+
return {
|
|
89
|
+
success: false,
|
|
90
|
+
action: 'import',
|
|
91
|
+
message: 'No project.faf to merge into — run faf_init first',
|
|
92
|
+
warnings: result.warnings,
|
|
93
|
+
};
|
|
81
94
|
}
|
|
95
|
+
// Without merge nothing is written: say exactly that.
|
|
82
96
|
return {
|
|
83
97
|
success: true,
|
|
84
98
|
action: 'import',
|
|
85
|
-
message: `
|
|
99
|
+
message: `Parsed AGENTS.md (${result.sectionsFound.length} sections) — nothing written; pass merge: true to write it into project.faf`,
|
|
86
100
|
data: { faf: result.faf, sectionsFound: result.sectionsFound },
|
|
87
101
|
warnings: result.warnings,
|
|
88
102
|
};
|
|
@@ -97,7 +111,7 @@ async function agentsExportCommand(projectPath, options = {}) {
|
|
|
97
111
|
return {
|
|
98
112
|
success: false,
|
|
99
113
|
action: 'export',
|
|
100
|
-
message: 'No .faf file found. Run
|
|
114
|
+
message: 'No .faf file found. Run faf_init first.',
|
|
101
115
|
};
|
|
102
116
|
}
|
|
103
117
|
// Check if AGENTS.md already exists
|
|
@@ -108,7 +122,7 @@ async function agentsExportCommand(projectPath, options = {}) {
|
|
|
108
122
|
return {
|
|
109
123
|
success: false,
|
|
110
124
|
action: 'export',
|
|
111
|
-
message: 'AGENTS.md already exists.
|
|
125
|
+
message: 'AGENTS.md already exists. Pass force: true to update its faf-managed block (content outside it is kept).',
|
|
112
126
|
};
|
|
113
127
|
}
|
|
114
128
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/agents.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/agents.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,kDA0FC;AAKD,kDA6CC;AAKD,8CAKC;AA3KD,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,MAAM,WAAW,GAAG,IAAA,eAAS,EAAC,eAAe,CAAC,CAAC;gBAE/C,mDAAmD;gBACnD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UAAU,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,eAAS,EAAC,UAAU,CAAC,CAAC;IAEtC,SAAS;IACT,MAAM,MAAM,GAAG,MAAM,IAAA,+BAAY,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEvD,OAAO;QACL,OAAO,EAAE,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,+CAA+C;IAC/C,OAAO,MAAM,mBAAmB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -63,7 +63,6 @@ async function claudeExportCommand(projectPath, _options = {}) {
|
|
|
63
63
|
success: false,
|
|
64
64
|
direction: 'none',
|
|
65
65
|
filesChanged: [],
|
|
66
|
-
conflicts: [],
|
|
67
66
|
duration: 0,
|
|
68
67
|
message: ''
|
|
69
68
|
};
|
|
@@ -71,7 +70,7 @@ async function claudeExportCommand(projectPath, _options = {}) {
|
|
|
71
70
|
// Find project.faf file
|
|
72
71
|
const fafPath = projectPath ? path.join(projectPath, 'project.faf') : await (0, file_utils_1.findFafFile)();
|
|
73
72
|
if (!fafPath || !await (0, file_utils_1.fileExists)(fafPath)) {
|
|
74
|
-
result.message = 'No project.faf file found. Run
|
|
73
|
+
result.message = 'No project.faf file found. Run faf_init first.';
|
|
75
74
|
result.duration = Date.now() - startTime;
|
|
76
75
|
return result;
|
|
77
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/claude.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/claude.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCH,kDAgHC;AA9ID,2CAAsD;AACtD,2CAA6B;AAC7B,2BAAoC;AACpC,oDAA8D;AAC9D,2CAAkD;AAClD,2CAAkD;AAClD,2CAAkD;AAClD,qEAAuD;AAkBvD;;;;GAIG;AACI,KAAK,UAAU,mBAAmB,CAAC,WAAoB,EAAE,WAAgC,EAAE;IAChG,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAuB;QACjC,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,IAAI,CAAC;QACH,wBAAwB;QACxB,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,wBAAW,GAAE,CAAC;QAE1F,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,IAAA,uBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YAC3C,MAAM,CAAC,OAAO,GAAG,gDAAgD,CAAC;YAClE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;YACzC,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,YAAY,GAAG,IAAI,CAAC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AAI,CAAC,WAAW,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY;YACd,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,CAAC,OAAO,IAAI,kBAAkB,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACtG,CAAC;QAED,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QACzC,OAAO,MAAM,CAAC;IAEhB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QACzC,MAAM,CAAC,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;QACnF,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -78,15 +78,29 @@ async function conductorImportCommand(projectPath, options = {}) {
|
|
|
78
78
|
warnings: result.warnings,
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
catch {
|
|
82
|
-
|
|
81
|
+
catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
success: false,
|
|
84
|
+
action: 'import',
|
|
85
|
+
message: `Could not merge conductor/ into project.faf: ${error instanceof Error ? error.message : String(error)}`,
|
|
86
|
+
warnings: result.warnings,
|
|
87
|
+
};
|
|
83
88
|
}
|
|
84
89
|
}
|
|
90
|
+
// merge was asked for and there is nothing to merge into: say so rather
|
|
91
|
+
// than report a no-op as an import.
|
|
92
|
+
return {
|
|
93
|
+
success: false,
|
|
94
|
+
action: 'import',
|
|
95
|
+
message: 'No project.faf to merge into — run faf_init first',
|
|
96
|
+
warnings: result.warnings,
|
|
97
|
+
};
|
|
85
98
|
}
|
|
99
|
+
// Without merge nothing is written: say exactly that.
|
|
86
100
|
return {
|
|
87
101
|
success: true,
|
|
88
102
|
action: 'import',
|
|
89
|
-
message: `
|
|
103
|
+
message: `Parsed conductor/ (${result.filesProcessed.length} files) — nothing written; pass merge: true to write it into project.faf`,
|
|
90
104
|
data: { faf: result.faf, filesProcessed: result.filesProcessed },
|
|
91
105
|
warnings: result.warnings,
|
|
92
106
|
};
|
|
@@ -100,7 +114,7 @@ async function conductorExportCommand(projectPath, options = {}) {
|
|
|
100
114
|
return {
|
|
101
115
|
success: false,
|
|
102
116
|
action: 'export',
|
|
103
|
-
message: 'No .faf file found. Run
|
|
117
|
+
message: 'No .faf file found. Run faf_init first.',
|
|
104
118
|
};
|
|
105
119
|
}
|
|
106
120
|
const outputPath = path_1.default.join(projectPath, 'conductor');
|
|
@@ -122,18 +136,29 @@ async function conductorExportCommand(projectPath, options = {}) {
|
|
|
122
136
|
}
|
|
123
137
|
const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
|
|
124
138
|
const fafData = (0, yaml_js_1.parse)(fafContent);
|
|
125
|
-
// Build the conductor-compatible structure
|
|
139
|
+
// Build the conductor-compatible structure. Read the spec fields a
|
|
140
|
+
// project.faf actually carries (project.main_language / goal, stack.*);
|
|
141
|
+
// the list-shaped fields (stack.languages, project.goals, …) that a
|
|
142
|
+
// conductor merge writes stay as a fallback.
|
|
143
|
+
const specValues = (...values) => values.filter((v) => typeof v === 'string' && v !== '' && v !== 'slotignored');
|
|
144
|
+
const firstNonEmpty = (...lists) => {
|
|
145
|
+
for (const list of lists) {
|
|
146
|
+
if (Array.isArray(list) && list.length > 0)
|
|
147
|
+
return list;
|
|
148
|
+
}
|
|
149
|
+
return [];
|
|
150
|
+
};
|
|
126
151
|
const conductorFaf = {
|
|
127
152
|
project: {
|
|
128
153
|
name: fafData.project?.name || 'Unknown',
|
|
129
154
|
description: fafData.project?.description || fafData.project?.goal || '',
|
|
130
155
|
type: fafData.project?.type || 'application',
|
|
131
|
-
goals: fafData.project?.goals
|
|
156
|
+
goals: firstNonEmpty(specValues(fafData.project?.goal), fafData.project?.goals),
|
|
132
157
|
stack: {
|
|
133
|
-
languages: fafData.stack?.languages
|
|
134
|
-
frameworks: fafData.stack?.
|
|
135
|
-
databases: fafData.stack?.databases
|
|
136
|
-
infrastructure: fafData.stack?.
|
|
158
|
+
languages: firstNonEmpty(specValues(fafData.project?.main_language), fafData.stack?.languages, fafData.project?.stack?.languages),
|
|
159
|
+
frameworks: firstNonEmpty(specValues(fafData.stack?.frontend, fafData.stack?.backend), fafData.stack?.frameworks, fafData.project?.stack?.frameworks),
|
|
160
|
+
databases: firstNonEmpty(specValues(fafData.stack?.database), fafData.stack?.databases, fafData.project?.stack?.databases),
|
|
161
|
+
infrastructure: firstNonEmpty(specValues(fafData.stack?.hosting, fafData.stack?.cicd), fafData.stack?.infrastructure, fafData.project?.stack?.infrastructure),
|
|
137
162
|
},
|
|
138
163
|
rules: fafData.project?.rules || [],
|
|
139
164
|
guidelines: fafData.project?.guidelines || [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conductor.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/conductor.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAwBH,
|
|
1
|
+
{"version":3,"file":"conductor.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/conductor.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAwBH,wDA+FC;AAKD,wDA+FC;AAzND,gDAAwB;AACxB,2BAAoC;AACpC,0DAAqD;AACrD,iDAAqF;AACrF,wEAKwC;AAUxC;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,UAA+B,EAAE;IAEjC,MAAM,YAAY,GAAG,MAAM,IAAA,qCAAe,EAAC,WAAW,CAAC,CAAC;IAExD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAA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ectPath, options = {}) {
|
|
|
73
73
|
warnings: result.warnings,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
catch {
|
|
77
|
-
|
|
76
|
+
catch (error) {
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
action: 'import',
|
|
80
|
+
message: `Could not merge .cursorrules into project.faf: ${error instanceof Error ? error.message : String(error)}`,
|
|
81
|
+
warnings: result.warnings,
|
|
82
|
+
};
|
|
78
83
|
}
|
|
79
84
|
}
|
|
85
|
+
// merge was asked for and there is nothing to merge into: say so rather
|
|
86
|
+
// than report a no-op as an import.
|
|
87
|
+
return {
|
|
88
|
+
success: false,
|
|
89
|
+
action: 'import',
|
|
90
|
+
message: 'No project.faf to merge into — run faf_init first',
|
|
91
|
+
warnings: result.warnings,
|
|
92
|
+
};
|
|
80
93
|
}
|
|
94
|
+
// Without merge nothing is written: say exactly that.
|
|
81
95
|
return {
|
|
82
96
|
success: true,
|
|
83
97
|
action: 'import',
|
|
84
|
-
message: `
|
|
98
|
+
message: `Parsed .cursorrules (${result.sectionsFound.length} sections) — nothing written; pass merge: true to write it into project.faf`,
|
|
85
99
|
data: { faf: result.faf, sectionsFound: result.sectionsFound },
|
|
86
100
|
warnings: result.warnings,
|
|
87
101
|
};
|
|
@@ -95,7 +109,7 @@ async function cursorExportCommand(projectPath, options = {}) {
|
|
|
95
109
|
return {
|
|
96
110
|
success: false,
|
|
97
111
|
action: 'export',
|
|
98
|
-
message: 'No .faf file found. Run
|
|
112
|
+
message: 'No .faf file found. Run faf_init first.',
|
|
99
113
|
};
|
|
100
114
|
}
|
|
101
115
|
const outputPath = path_1.default.join(projectPath, '.cursorrules');
|
|
@@ -105,7 +119,7 @@ async function cursorExportCommand(projectPath, options = {}) {
|
|
|
105
119
|
return {
|
|
106
120
|
success: false,
|
|
107
121
|
action: 'export',
|
|
108
|
-
message: '.cursorrules already exists.
|
|
122
|
+
message: '.cursorrules already exists. Pass force: true to update its faf-managed block (content outside it is kept).',
|
|
109
123
|
};
|
|
110
124
|
}
|
|
111
125
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/cursor.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/cursor.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,kDAyFC;AAKD,kDAyCC;AAKD,8CAIC;AArKD,gDAAwB;AACxB,2BAAoC;AACpC,0DAAqD;AACrD,iDAAqF;AACrF,4EAI0C;AAU1C;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,UAA+B,EAAE;IAEjC,MAAM,UAAU,GAAG,MAAM,IAAA,yCAAiB,EAAC,WAAW,CAAC,CAAC;IAExD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,4CAA4C;SACtD,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,oCAAY,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,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AAC;YACP,8BAA8B;QAChC,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,eAAS,EAAC,UAAU,CAAC,CAAC;IAEtC,MAAM,MAAM,GAAG,MAAM,IAAA,oCAAY,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEvD,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,MAAM,CAAC,OAAO;YACrB,CAAC,CAAC,sCAAsC;YACxC,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"}
|
|
@@ -72,15 +72,29 @@ async function geminiImportCommand(projectPath, options = {}) {
|
|
|
72
72
|
warnings: result.warnings,
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
catch {
|
|
76
|
-
|
|
75
|
+
catch (error) {
|
|
76
|
+
return {
|
|
77
|
+
success: false,
|
|
78
|
+
action: 'import',
|
|
79
|
+
message: `Could not merge GEMINI.md into project.faf: ${error instanceof Error ? error.message : String(error)}`,
|
|
80
|
+
warnings: result.warnings,
|
|
81
|
+
};
|
|
77
82
|
}
|
|
78
83
|
}
|
|
84
|
+
// merge was asked for and there is nothing to merge into: say so rather
|
|
85
|
+
// than report a no-op as an import.
|
|
86
|
+
return {
|
|
87
|
+
success: false,
|
|
88
|
+
action: 'import',
|
|
89
|
+
message: 'No project.faf to merge into — run faf_init first',
|
|
90
|
+
warnings: result.warnings,
|
|
91
|
+
};
|
|
79
92
|
}
|
|
93
|
+
// Without merge nothing is written: say exactly that.
|
|
80
94
|
return {
|
|
81
95
|
success: true,
|
|
82
96
|
action: 'import',
|
|
83
|
-
message: `
|
|
97
|
+
message: `Parsed GEMINI.md (${result.sectionsFound.length} sections) — nothing written; pass merge: true to write it into project.faf`,
|
|
84
98
|
data: { faf: result.faf, sectionsFound: result.sectionsFound },
|
|
85
99
|
warnings: result.warnings,
|
|
86
100
|
};
|
|
@@ -94,7 +108,7 @@ async function geminiExportCommand(projectPath, options = {}) {
|
|
|
94
108
|
return {
|
|
95
109
|
success: false,
|
|
96
110
|
action: 'export',
|
|
97
|
-
message: 'No .faf file found. Run
|
|
111
|
+
message: 'No .faf file found. Run faf_init first.',
|
|
98
112
|
};
|
|
99
113
|
}
|
|
100
114
|
const outputPath = path_1.default.join(projectPath, 'GEMINI.md');
|
|
@@ -104,7 +118,7 @@ async function geminiExportCommand(projectPath, options = {}) {
|
|
|
104
118
|
return {
|
|
105
119
|
success: false,
|
|
106
120
|
action: 'export',
|
|
107
|
-
message: 'GEMINI.md already exists.
|
|
121
|
+
message: 'GEMINI.md already exists. Pass force: true to update its faf-managed block (content outside it is kept).',
|
|
108
122
|
};
|
|
109
123
|
}
|
|
110
124
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/gemini.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,
|
|
1
|
+
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/gemini.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAuBH,kDAwFC;AAKD,kDAyCC;AAKD,8CAIC;AApKD,gDAAwB;AACxB,2BAAoC;AACpC,0DAAqD;AACrD,iDAAqF;AACrF,kEAIqC;AAUrC;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,UAA+B,EAAE;IA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Q,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"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Git Context Command — Interop (faf-mcp 2.0.0; ported from faf-cli 4.5.0 via claude-faf-mcp 4.5.0)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Author project.faf from a GitHub repository URL.
|
|
5
5
|
* Fetches metadata, README, package.json — no cloning needed.
|
|
6
6
|
* Bundled command — no CLI dependency required.
|
|
7
|
+
*
|
|
8
|
+
* The score it reports is faf-cli's scorer on the exact bytes authored —
|
|
9
|
+
* the same number faf_score gives that file. The ported slot counter that
|
|
10
|
+
* used to supply it credited defaults and 'slotignored' slots that were
|
|
11
|
+
* never written, so a 10% file was announced as 100% (Trophy).
|
|
7
12
|
*/
|
|
13
|
+
export interface GitContextOptions {
|
|
14
|
+
/** Replace an existing <outputPath>/project.faf. Without it the command refuses. */
|
|
15
|
+
force?: boolean;
|
|
16
|
+
}
|
|
8
17
|
export interface GitContextResult {
|
|
9
18
|
success: boolean;
|
|
10
19
|
message: string;
|
|
@@ -18,6 +27,6 @@ export interface GitContextResult {
|
|
|
18
27
|
};
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
|
-
*
|
|
30
|
+
* Author project.faf from a GitHub URL
|
|
22
31
|
*/
|
|
23
|
-
export declare function gitContextCommand(url: string, outputPath?: string): Promise<GitContextResult>;
|
|
32
|
+
export declare function gitContextCommand(url: string, outputPath?: string, options?: GitContextOptions): Promise<GitContextResult>;
|
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Git Context Command — Interop (faf-mcp 2.0.0; ported from faf-cli 4.5.0 via claude-faf-mcp 4.5.0)
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Author project.faf from a GitHub repository URL.
|
|
6
6
|
* Fetches metadata, README, package.json — no cloning needed.
|
|
7
7
|
* Bundled command — no CLI dependency required.
|
|
8
|
+
*
|
|
9
|
+
* The score it reports is faf-cli's scorer on the exact bytes authored —
|
|
10
|
+
* the same number faf_score gives that file. The ported slot counter that
|
|
11
|
+
* used to supply it credited defaults and 'slotignored' slots that were
|
|
12
|
+
* never written, so a 10% file was announced as 100% (Trophy).
|
|
8
13
|
*/
|
|
9
14
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -15,10 +20,11 @@ const path_1 = __importDefault(require("path"));
|
|
|
15
20
|
const fs_1 = require("fs");
|
|
16
21
|
const github_extractor_js_1 = require("../parsers/github-extractor.js");
|
|
17
22
|
const faf_git_generator_js_1 = require("../parsers/faf-git-generator.js");
|
|
23
|
+
const faf_cli_bridge_js_1 = require("../../utils/faf-cli-bridge.js");
|
|
18
24
|
/**
|
|
19
|
-
*
|
|
25
|
+
* Author project.faf from a GitHub URL
|
|
20
26
|
*/
|
|
21
|
-
async function gitContextCommand(url, outputPath) {
|
|
27
|
+
async function gitContextCommand(url, outputPath, options = {}) {
|
|
22
28
|
// Parse the URL
|
|
23
29
|
const parsed = (0, github_extractor_js_1.parseGitHubUrl)(url);
|
|
24
30
|
if (!parsed) {
|
|
@@ -28,14 +34,30 @@ async function gitContextCommand(url, outputPath) {
|
|
|
28
34
|
};
|
|
29
35
|
}
|
|
30
36
|
const { owner, repo } = parsed;
|
|
37
|
+
// Never replace an existing project.faf unless asked — checked before any
|
|
38
|
+
// network call, so a refusal costs nothing and writes nothing.
|
|
39
|
+
if (outputPath && !options.force) {
|
|
40
|
+
const existing = path_1.default.join(outputPath, 'project.faf');
|
|
41
|
+
const exists = await fs_1.promises.access(existing).then(() => true, () => false);
|
|
42
|
+
if (exists) {
|
|
43
|
+
return {
|
|
44
|
+
success: false,
|
|
45
|
+
message: `project.faf already exists at ${outputPath}. Pass force: true to overwrite.`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
31
49
|
try {
|
|
32
50
|
// Fetch metadata with file checks
|
|
33
51
|
const metadata = await (0, github_extractor_js_1.fetchGitHubMetadata)(owner, repo, true);
|
|
34
52
|
// Fetch file tree
|
|
35
53
|
const files = await (0, github_extractor_js_1.fetchGitHubFileTree)(owner, repo, metadata.defaultBranch);
|
|
36
|
-
//
|
|
37
|
-
const { content
|
|
38
|
-
|
|
54
|
+
// Author the .faf content
|
|
55
|
+
const { content } = await (0, faf_git_generator_js_1.generateEnhancedFaf)(metadata, files);
|
|
56
|
+
// One scorer: faf-cli's, on the bytes authored.
|
|
57
|
+
const { scoreFafYaml } = await faf_cli_bridge_js_1.fafCli;
|
|
58
|
+
const scored = scoreFafYaml(content);
|
|
59
|
+
const score = scored.score;
|
|
60
|
+
const tier = scored.tier.name;
|
|
39
61
|
// Write to file if output path provided
|
|
40
62
|
let filePath;
|
|
41
63
|
if (outputPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-context.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/git-context.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"git-context.js","sourceRoot":"","sources":["../../../../src/faf-core/commands/git-context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;AAiCH,8CAuEC;AAtGD,gDAAwB;AACxB,2BAAoC;AACpC,wEAIwC;AACxC,0EAAsE;AACtE,qEAAuD;AAoBvD;;GAEG;AACI,KAAK,UAAU,iBAAiB,CACrC,GAAW,EACX,UAAmB,EACnB,UAA6B,EAAE;IAE/B,gBAAgB;IAChB,MAAM,MAAM,GAAG,IAAA,oCAAc,EAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,KAAK;YACd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