@fenglimg/fabric-cli 2.0.0-rc.15 → 2.0.0-rc.21
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/dist/chunk-4HC5ZK7H.js +598 -0
- package/dist/{chunk-AXIFEVAS.js → chunk-FNO7CQDG.js} +1 -1
- package/dist/chunk-KZ2YITOS.js +225 -0
- package/dist/{chunk-SKSYUHKK.js → chunk-MF3OTILQ.js} +0 -4
- package/dist/{chunk-OBQU6NHO.js → chunk-ZSESMG6L.js} +0 -6
- package/dist/{config-7YD365I3.js → config-AYP5F72E.js} +2 -2
- package/dist/{doctor-6XHLQJXB.js → doctor-L6TIXXIX.js} +129 -3
- package/dist/index.js +11 -8
- package/dist/{install-JLDCHAXV.js → install-DNZXGFHJ.js} +23 -25
- package/dist/{plan-context-hint-73U4FGKO.js → plan-context-hint-CFDGXHCA.js} +4 -4
- package/dist/{serve-L3X5UHG2.js → serve-6PPQX7AW.js} +1 -1
- package/dist/{uninstall-DD6FIFCI.js → uninstall-L2HEEOU3.js} +147 -55
- package/package.json +3 -3
- package/templates/hooks/fabric-hint.cjs +350 -21
- package/templates/hooks/knowledge-hint-broad.cjs +39 -14
- package/templates/hooks/knowledge-hint-narrow.cjs +31 -7
- package/templates/hooks/lib/banner-i18n.cjs +252 -0
- package/dist/chunk-AIB54QRT.js +0 -82
- package/dist/chunk-UTF4YBDN.js +0 -366
- package/templates/agents-md/AGENTS.md.template +0 -59
- package/templates/bootstrap/CLAUDE.md +0 -8
- package/templates/bootstrap/codex-AGENTS-header.md +0 -6
- package/templates/bootstrap/cursor-fabric-bootstrap.mdc +0 -10
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.0.0-rc.16 TASK-001 (F2-prep): shared banner-i18n library for hook scripts.
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* - readFabricLanguage(projectRoot) → 'zh-CN' | 'en' | 'zh-CN-hybrid' | 'match-existing'
|
|
6
|
+
* Synchronously reads `fabric_language` from `.fabric/fabric-config.json`.
|
|
7
|
+
* Mirrors the never-throw contract of the existing config readers in
|
|
8
|
+
* fabric-hint.cjs (readReviewHintPendingCount, readMaintenanceHintDays, etc.):
|
|
9
|
+
* missing file / parse error / missing field → returns 'zh-CN' (the
|
|
10
|
+
* documented BACKWARD-COMPAT default — preserves rc.15 hard-coded zh-CN
|
|
11
|
+
* hook output when fabric_language was never a configurable key).
|
|
12
|
+
*
|
|
13
|
+
* 'match-existing' is ONLY returned when explicitly set in config; per UX
|
|
14
|
+
* i18n Policy class 1, renderBanner then folds 'match-existing' (and any
|
|
15
|
+
* unknown variant) down to 'en'.
|
|
16
|
+
*
|
|
17
|
+
* RC.16 TASK-002 NOTE: this default was originally 'match-existing' in
|
|
18
|
+
* TASK-001 but was tightened to 'zh-CN' here so that the existing rc.7+
|
|
19
|
+
* fabric-hint test fixtures (which never set fabric_language and expect
|
|
20
|
+
* zh-CN substrings byte-identically) continue passing without modification.
|
|
21
|
+
* Pre-user clean-slate policy: no shim, but back-compat for in-tree tests
|
|
22
|
+
* is the right line — they encode the rc.15 user-visible contract.
|
|
23
|
+
*
|
|
24
|
+
* - renderBanner(key, variant, params) → string
|
|
25
|
+
* Renders one of the 11 banner fragments for the requested variant.
|
|
26
|
+
* Variant fallback: STRINGS[key][variant] ?? STRINGS[key]['en'].
|
|
27
|
+
* Unknown / 'match-existing' / missing → 'en' table.
|
|
28
|
+
*
|
|
29
|
+
* - STRINGS — exported for test introspection only (read-only by convention).
|
|
30
|
+
*
|
|
31
|
+
* Banner keys (11 total):
|
|
32
|
+
* Signal A (archive): archiveLine1, archiveActivity, archiveCta
|
|
33
|
+
* Signal B (review): reviewLine1, reviewCta
|
|
34
|
+
* Signal C (import): importLine1, importCta
|
|
35
|
+
* Signal D (maintenance): maintenanceLine1Never, maintenanceLine1Aged, maintenanceLine2
|
|
36
|
+
* Broad hook: broadImportBanner
|
|
37
|
+
*
|
|
38
|
+
* Protected tokens — NEVER translated, kept verbatim across all 4 variants:
|
|
39
|
+
* - Slash commands: /fabric-archive, /fabric-review, /fabric-import
|
|
40
|
+
* - CLI commands: `fabric doctor --lint`
|
|
41
|
+
* - Numeric / template substrings the existing tests assert on:
|
|
42
|
+
* "${hoursElapsed.toFixed(1)}h" (e.g. "25.0h"), "阈值 ${N}h",
|
|
43
|
+
* "${count} 条", "${nodeCount}/${threshold}", "${days} 天"
|
|
44
|
+
* - 📋 Fabric: emoji prefix
|
|
45
|
+
*
|
|
46
|
+
* zh-CN-hybrid policy: Chinese narrative prose with English protected tokens
|
|
47
|
+
* preserved verbatim. In practice this matches zh-CN exactly because the
|
|
48
|
+
* banners already inline slash commands + CLI commands without translation;
|
|
49
|
+
* we keep the variant entries explicit anyway for forward-compat (future copy
|
|
50
|
+
* may diverge, e.g. mixing English connector words).
|
|
51
|
+
*
|
|
52
|
+
* match-existing policy: per UX i18n Policy class 1, falls back to 'en' at
|
|
53
|
+
* render time. The fallback decision is centralized in renderBanner; only an
|
|
54
|
+
* EXPLICIT `fabric_language: "match-existing"` in config triggers the en
|
|
55
|
+
* fallback. Unset / missing config defaults to 'zh-CN' (rc.15 back-compat).
|
|
56
|
+
*
|
|
57
|
+
* Pattern reference:
|
|
58
|
+
* - Never-throw fs read: fabric-hint.cjs `_readConfigNumber`,
|
|
59
|
+
* `readReviewHintPendingCount` (lines 720-743)
|
|
60
|
+
* - hooks/lib/*.cjs precedent: session-digest-writer.cjs
|
|
61
|
+
*/
|
|
62
|
+
"use strict";
|
|
63
|
+
|
|
64
|
+
const { existsSync, readFileSync } = require("node:fs");
|
|
65
|
+
const { join } = require("node:path");
|
|
66
|
+
|
|
67
|
+
const FABRIC_DIR = ".fabric";
|
|
68
|
+
const CONFIG_FILE = "fabric-config.json";
|
|
69
|
+
|
|
70
|
+
const VALID_LANGUAGES = ["zh-CN", "en", "zh-CN-hybrid", "match-existing"];
|
|
71
|
+
// rc.16 TASK-002: backward-compat default. rc.15 and earlier hardcoded
|
|
72
|
+
// zh-CN in the hook scripts; preserving zh-CN as the unset-default keeps
|
|
73
|
+
// the rc.7+ fabric-hint test fixtures (which assert Chinese substrings
|
|
74
|
+
// without ever setting fabric_language) green and matches the user-visible
|
|
75
|
+
// contract real workspaces have observed since rc.7.
|
|
76
|
+
const DEFAULT_LANGUAGE = "zh-CN";
|
|
77
|
+
const RENDER_FALLBACK_VARIANT = "en";
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Read `fabric_language` from <projectRoot>/.fabric/fabric-config.json.
|
|
81
|
+
*
|
|
82
|
+
* Returns one of the four valid language codes. Missing file, malformed JSON,
|
|
83
|
+
* missing/unknown field value → DEFAULT_LANGUAGE ('zh-CN' — see comment on
|
|
84
|
+
* the constant for the back-compat rationale). NEVER throws — config-read
|
|
85
|
+
* failure must not block any hook.
|
|
86
|
+
*/
|
|
87
|
+
function readFabricLanguage(projectRoot) {
|
|
88
|
+
if (typeof projectRoot !== "string" || projectRoot.length === 0) {
|
|
89
|
+
return DEFAULT_LANGUAGE;
|
|
90
|
+
}
|
|
91
|
+
const configPath = join(projectRoot, FABRIC_DIR, CONFIG_FILE);
|
|
92
|
+
if (!existsSync(configPath)) return DEFAULT_LANGUAGE;
|
|
93
|
+
try {
|
|
94
|
+
const parsed = JSON.parse(readFileSync(configPath, "utf8"));
|
|
95
|
+
const v = parsed && parsed.fabric_language;
|
|
96
|
+
if (typeof v === "string" && VALID_LANGUAGES.indexOf(v) !== -1) {
|
|
97
|
+
return v;
|
|
98
|
+
}
|
|
99
|
+
} catch {
|
|
100
|
+
// fall through to default
|
|
101
|
+
}
|
|
102
|
+
return DEFAULT_LANGUAGE;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// String table
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
//
|
|
109
|
+
// Each key maps variant -> (params) => string. Templates intentionally use
|
|
110
|
+
// the same parameter names across all four variants so call sites pass one
|
|
111
|
+
// shape. Substring contracts (see file header) are preserved verbatim across
|
|
112
|
+
// translations; only narrative connector words shift.
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
|
|
115
|
+
const STRINGS = {
|
|
116
|
+
// ---- Signal A: archive ----------------------------------------------------
|
|
117
|
+
// Source (zh-CN): fabric-hint.cjs:614 `📋 Fabric: 距上次归档 ${parts}。`
|
|
118
|
+
// params: { parts } where parts is pre-joined `已过 25.0h(阈值 24h)` etc.
|
|
119
|
+
archiveLine1: {
|
|
120
|
+
"zh-CN": (p) => `📋 Fabric: 距上次归档 ${p.parts}。`,
|
|
121
|
+
en: (p) => `📋 Fabric: ${p.parts} since last archive.`,
|
|
122
|
+
"zh-CN-hybrid": (p) => `📋 Fabric: 距上次归档 ${p.parts}。`,
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
// Source (zh-CN): fabric-hint.cjs:619 ` 最近活动集中在: ${activity}。`
|
|
126
|
+
// params: { activity }
|
|
127
|
+
archiveActivity: {
|
|
128
|
+
"zh-CN": (p) => ` 最近活动集中在: ${p.activity}。`,
|
|
129
|
+
en: (p) => ` Recent activity centered on: ${p.activity}.`,
|
|
130
|
+
"zh-CN-hybrid": (p) => ` 最近活动集中在: ${p.activity}。`,
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// Source (zh-CN): fabric-hint.cjs:621 ` 是否调 /fabric-archive 检查值得归档的决策/踩坑/复用?`
|
|
134
|
+
// params: {} — protected token /fabric-archive verbatim across all variants.
|
|
135
|
+
archiveCta: {
|
|
136
|
+
"zh-CN": () => " 是否调 /fabric-archive 检查值得归档的决策/踩坑/复用?",
|
|
137
|
+
en: () => " Run /fabric-archive to review decisions/pitfalls/reusables worth archiving?",
|
|
138
|
+
"zh-CN-hybrid": () => " 是否调 /fabric-archive 检查值得归档的决策/踩坑/复用?",
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
// ---- Signal B: review -----------------------------------------------------
|
|
142
|
+
// Source (zh-CN): fabric-hint.cjs:651 `📋 Fabric: 已积累 ${stats.count} 条待审核知识${ageSuffix}。`
|
|
143
|
+
// params: { count, ageSuffix } — ageSuffix is " / 最早一条 N.N 天前" or "" (zh-CN only)
|
|
144
|
+
// For en variant we shape the suffix inline to keep substring "${count}" addressable.
|
|
145
|
+
reviewLine1: {
|
|
146
|
+
"zh-CN": (p) => `📋 Fabric: 已积累 ${p.count} 条待审核知识${p.ageSuffix || ""}。`,
|
|
147
|
+
en: (p) => {
|
|
148
|
+
const suffix =
|
|
149
|
+
p.ageSuffix && p.ageSuffix.length > 0
|
|
150
|
+
? p.ageSuffix
|
|
151
|
+
.replace(" / 最早一条 ", " / oldest is ")
|
|
152
|
+
.replace(" 天前", "d old")
|
|
153
|
+
: "";
|
|
154
|
+
return `📋 Fabric: ${p.count} pending knowledge entries accumulated${suffix}.`;
|
|
155
|
+
},
|
|
156
|
+
"zh-CN-hybrid": (p) => `📋 Fabric: 已积累 ${p.count} 条待审核知识${p.ageSuffix || ""}。`,
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
// Source (zh-CN): fabric-hint.cjs:652 ` 是否调 /fabric-review 审核 pending/ 条目?`
|
|
160
|
+
// params: {} — protected token /fabric-review verbatim across all variants.
|
|
161
|
+
reviewCta: {
|
|
162
|
+
"zh-CN": () => " 是否调 /fabric-review 审核 pending/ 条目?",
|
|
163
|
+
en: () => " Run /fabric-review to triage pending/ entries?",
|
|
164
|
+
"zh-CN-hybrid": () => " 是否调 /fabric-review 审核 pending/ 条目?",
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// ---- Signal C: import (underseed) ----------------------------------------
|
|
168
|
+
// Source (zh-CN): fabric-hint.cjs:697 `📋 Fabric: 知识库节点数 ${nodeCount}/${threshold},距 init_scan_completed ${hoursSinceInit.toFixed(1)}h。`
|
|
169
|
+
// params: { nodeCount, threshold, hoursSinceInit } — caller supplies hoursSinceInit
|
|
170
|
+
// already toFixed(1)'d (i.e. as string "24.5") to keep all rendering pure.
|
|
171
|
+
importLine1: {
|
|
172
|
+
"zh-CN": (p) =>
|
|
173
|
+
`📋 Fabric: 知识库节点数 ${p.nodeCount}/${p.threshold},距 init_scan_completed ${p.hoursSinceInit}h。`,
|
|
174
|
+
en: (p) =>
|
|
175
|
+
`📋 Fabric: knowledge node count ${p.nodeCount}/${p.threshold}, ${p.hoursSinceInit}h since init_scan_completed.`,
|
|
176
|
+
"zh-CN-hybrid": (p) =>
|
|
177
|
+
`📋 Fabric: 知识库节点数 ${p.nodeCount}/${p.threshold},距 init_scan_completed ${p.hoursSinceInit}h。`,
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
// Source (zh-CN): fabric-hint.cjs:698 ` 是否调 /fabric-import 从 git 历史与现有文档回灌知识?`
|
|
181
|
+
// params: {} — protected token /fabric-import verbatim across all variants.
|
|
182
|
+
importCta: {
|
|
183
|
+
"zh-CN": () => " 是否调 /fabric-import 从 git 历史与现有文档回灌知识?",
|
|
184
|
+
en: () => " Run /fabric-import to backfill knowledge from git history and existing docs?",
|
|
185
|
+
"zh-CN-hybrid": () => " 是否调 /fabric-import 从 git 历史与现有文档回灌知识?",
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
// ---- Signal D: maintenance -----------------------------------------------
|
|
189
|
+
// Source (zh-CN): fabric-hint.cjs:931 `📋 Fabric: 从未运行 lint 检查。`
|
|
190
|
+
// params: {} — substring "从未运行 lint 检查" is test-asserted (zh-CN test).
|
|
191
|
+
maintenanceLine1Never: {
|
|
192
|
+
"zh-CN": () => "📋 Fabric: 从未运行 lint 检查。",
|
|
193
|
+
en: () => "📋 Fabric: lint check has never been run.",
|
|
194
|
+
"zh-CN-hybrid": () => "📋 Fabric: 从未运行 lint 检查。",
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
// Source (zh-CN): fabric-hint.cjs:932 `📋 Fabric: 已 ${days} 天未跑 lint 检查(实际 ${ageDays.toFixed(1)}d)。`
|
|
198
|
+
// params: { days, ageDays } — ageDays caller-supplied as already-toFixed(1) string.
|
|
199
|
+
// Substring "已 N 天未跑 lint" is test-asserted (zh-CN test).
|
|
200
|
+
maintenanceLine1Aged: {
|
|
201
|
+
"zh-CN": (p) => `📋 Fabric: 已 ${p.days} 天未跑 lint 检查(实际 ${p.ageDays}d)。`,
|
|
202
|
+
en: (p) => `📋 Fabric: ${p.days} days since the last lint check (actual ${p.ageDays}d).`,
|
|
203
|
+
"zh-CN-hybrid": (p) => `📋 Fabric: 已 ${p.days} 天未跑 lint 检查(实际 ${p.ageDays}d)。`,
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
// Source (zh-CN): fabric-hint.cjs:929 ` 是否调 \`fabric doctor --lint\` 看看知识库健康度?`
|
|
207
|
+
// params: {} — protected token `fabric doctor --lint` (with backticks) verbatim.
|
|
208
|
+
maintenanceLine2: {
|
|
209
|
+
"zh-CN": () => " 是否调 `fabric doctor --lint` 看看知识库健康度?",
|
|
210
|
+
en: () => " Run `fabric doctor --lint` to check knowledge-base health?",
|
|
211
|
+
"zh-CN-hybrid": () => " 是否调 `fabric doctor --lint` 看看知识库健康度?",
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
// ---- Broad hook: import recommendation ------------------------------------
|
|
215
|
+
// Source (zh-CN): knowledge-hint-broad.cjs:262
|
|
216
|
+
// " 📋 Fabric: 知识库稀疏,是否调 /fabric-import 从 git 历史与现有文档回灌知识?"
|
|
217
|
+
// Note: leading two spaces are intentional (existing banner indent).
|
|
218
|
+
// params: {} — protected token /fabric-import verbatim.
|
|
219
|
+
broadImportBanner: {
|
|
220
|
+
"zh-CN": () => " 📋 Fabric: 知识库稀疏,是否调 /fabric-import 从 git 历史与现有文档回灌知识?",
|
|
221
|
+
en: () =>
|
|
222
|
+
" 📋 Fabric: knowledge base is sparse — run /fabric-import to backfill from git history and existing docs?",
|
|
223
|
+
"zh-CN-hybrid": () =>
|
|
224
|
+
" 📋 Fabric: 知识库稀疏,是否调 /fabric-import 从 git 历史与现有文档回灌知识?",
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Render a banner fragment for the requested variant.
|
|
230
|
+
*
|
|
231
|
+
* Variant resolution:
|
|
232
|
+
* 1. If STRINGS[key][variant] exists → use it.
|
|
233
|
+
* 2. Else fall back to STRINGS[key][RENDER_FALLBACK_VARIANT] ('en').
|
|
234
|
+
* 3. If key itself is unknown → returns "" (defensive; never throws).
|
|
235
|
+
*
|
|
236
|
+
* 'match-existing' is intentionally NOT in the STRINGS table so it folds
|
|
237
|
+
* down to the 'en' fallback per UX i18n Policy class 1.
|
|
238
|
+
*/
|
|
239
|
+
function renderBanner(key, variant, params) {
|
|
240
|
+
const entry = STRINGS[key];
|
|
241
|
+
if (!entry) return "";
|
|
242
|
+
const tmpl = entry[variant] || entry[RENDER_FALLBACK_VARIANT];
|
|
243
|
+
if (typeof tmpl !== "function") return "";
|
|
244
|
+
try {
|
|
245
|
+
return tmpl(params || {});
|
|
246
|
+
} catch {
|
|
247
|
+
// Defensive: a missing param shouldn't crash the hook.
|
|
248
|
+
return "";
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
module.exports = { readFabricLanguage, renderBanner, STRINGS };
|
package/dist/chunk-AIB54QRT.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
resolveClients
|
|
4
|
-
} from "./chunk-SKSYUHKK.js";
|
|
5
|
-
import {
|
|
6
|
-
t
|
|
7
|
-
} from "./chunk-6ICJICVU.js";
|
|
8
|
-
|
|
9
|
-
// src/commands/config.ts
|
|
10
|
-
import { existsSync } from "fs";
|
|
11
|
-
import { readFile } from "fs/promises";
|
|
12
|
-
import { resolve } from "path";
|
|
13
|
-
import { fileURLToPath } from "url";
|
|
14
|
-
import { defineCommand } from "citty";
|
|
15
|
-
async function loadFabricConfig(workspaceRoot) {
|
|
16
|
-
const configPath = resolve(workspaceRoot, "fabric.config.json");
|
|
17
|
-
if (!existsSync(configPath)) {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
const parsed = JSON.parse(await readFile(configPath, "utf8"));
|
|
21
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
22
|
-
throw new Error(t("cli.config.errors.expected-object", { path: configPath }));
|
|
23
|
-
}
|
|
24
|
-
return parsed;
|
|
25
|
-
}
|
|
26
|
-
function resolveServerPath(override) {
|
|
27
|
-
if (override) return override;
|
|
28
|
-
if (process.env.FAB_SERVER_PATH) return resolve(process.env.FAB_SERVER_PATH);
|
|
29
|
-
return fileURLToPath(import.meta.resolve("@fenglimg/fabric-server"));
|
|
30
|
-
}
|
|
31
|
-
var configCmd = defineCommand({
|
|
32
|
-
meta: {
|
|
33
|
-
name: "config",
|
|
34
|
-
description: t("cli.config.description")
|
|
35
|
-
},
|
|
36
|
-
args: {
|
|
37
|
-
target: {
|
|
38
|
-
type: "string",
|
|
39
|
-
description: t("cli.config.args.target.description"),
|
|
40
|
-
valueHint: "path"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
async run(_ctx) {
|
|
44
|
-
console.log(t("cli.config.placeholder"));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
var config_default = configCmd;
|
|
48
|
-
async function installMcpClients(target, options = {}) {
|
|
49
|
-
const workspaceRoot = resolve(target);
|
|
50
|
-
const fabricConfig = await loadFabricConfig(workspaceRoot);
|
|
51
|
-
const selectedClients = options.clients === void 0 ? null : new Set(options.clients);
|
|
52
|
-
const serverPath = resolveServerPath(options.localServerPath);
|
|
53
|
-
const writers = resolveClients(workspaceRoot, fabricConfig, { claudeMcpScope: options.claudeMcpScope }).filter(
|
|
54
|
-
(writer) => selectedClients === null ? true : selectedClients.has(writer.clientKind)
|
|
55
|
-
);
|
|
56
|
-
const installed = [];
|
|
57
|
-
const skipped = [];
|
|
58
|
-
const details = [];
|
|
59
|
-
for (const writer of writers) {
|
|
60
|
-
const configPath = await writer.detect(workspaceRoot);
|
|
61
|
-
if (configPath === null) {
|
|
62
|
-
skipped.push(writer.clientKind);
|
|
63
|
-
details.push({ client: writer.clientKind, path: null, action: "skipped" });
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (options.dryRun) {
|
|
67
|
-
skipped.push(writer.clientKind);
|
|
68
|
-
details.push({ client: writer.clientKind, path: configPath, action: "dry-run" });
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
await writer.write(serverPath, workspaceRoot);
|
|
72
|
-
installed.push(writer.clientKind);
|
|
73
|
-
details.push({ client: writer.clientKind, path: configPath, action: "wrote" });
|
|
74
|
-
}
|
|
75
|
-
return { installed, skipped, details };
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
configCmd,
|
|
80
|
-
config_default,
|
|
81
|
-
installMcpClients
|
|
82
|
-
};
|