@fenglimg/fabric-cli 2.0.0-rc.11 → 2.0.0-rc.13
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/README.md +3 -3
- package/dist/{chunk-5MQ52F42.js → chunk-FDRLV5PL.js} +13 -8
- package/dist/{chunk-HQLEHH4O.js → chunk-OHWQNSLH.js} +1 -1
- package/dist/{chunk-WPTA74BY.js → chunk-Q72D24BG.js} +6 -4
- package/dist/{chunk-AW3G7ZH5.js → chunk-X7QPY5KH.js} +68 -41
- package/dist/{hooks-NX32PPEN.js → hooks-HIWYI3VG.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/{init-C56PWHID.js → install-SLS5W27W.js} +115 -109
- package/dist/{scan-66EKMNAY.js → scan-VHKZPT2W.js} +1 -1
- package/dist/{uninstall-DBAR2JBS.js → uninstall-JHUSFENL.js} +27 -18
- package/package.json +3 -3
- package/templates/hooks/configs/README.md +1 -1
- package/templates/hooks/knowledge-hint-broad.cjs +28 -107
- package/templates/skills/fabric-archive/SKILL.md +15 -15
- package/templates/skills/fabric-import/SKILL.md +26 -26
- package/templates/skills/fabric-review/SKILL.md +19 -19
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
hooksCommand,
|
|
4
4
|
installHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q72D24BG.js";
|
|
6
6
|
import {
|
|
7
7
|
detectExistingLanguage,
|
|
8
8
|
detectFramework,
|
|
9
9
|
runInitScan
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FDRLV5PL.js";
|
|
11
11
|
import {
|
|
12
12
|
detectClientSupports,
|
|
13
13
|
resolveClients
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OHWQNSLH.js";
|
|
15
15
|
import {
|
|
16
|
-
|
|
16
|
+
addFabricKnowledgeBaseSection,
|
|
17
17
|
installArchiveHintHook,
|
|
18
18
|
installFabricArchiveSkill,
|
|
19
19
|
installFabricImportSkill,
|
|
@@ -22,8 +22,9 @@ import {
|
|
|
22
22
|
installKnowledgeHintNarrowHook,
|
|
23
23
|
mergeClaudeCodeHookConfig,
|
|
24
24
|
mergeCodexHookConfig,
|
|
25
|
-
mergeCursorHookConfig
|
|
26
|
-
|
|
25
|
+
mergeCursorHookConfig,
|
|
26
|
+
readFabricLanguagePreference
|
|
27
|
+
} from "./chunk-X7QPY5KH.js";
|
|
27
28
|
import {
|
|
28
29
|
displayWidth,
|
|
29
30
|
padEnd,
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
t
|
|
38
39
|
} from "./chunk-6ICJICVU.js";
|
|
39
40
|
|
|
40
|
-
// src/commands/
|
|
41
|
+
// src/commands/install.ts
|
|
41
42
|
import { randomUUID } from "crypto";
|
|
42
43
|
import { homedir } from "os";
|
|
43
44
|
import * as childProcess from "child_process";
|
|
@@ -1293,7 +1294,7 @@ function readProjectName(target) {
|
|
|
1293
1294
|
return basename(target);
|
|
1294
1295
|
}
|
|
1295
1296
|
function getCliVersion() {
|
|
1296
|
-
return true ? "2.0.0-rc.
|
|
1297
|
+
return true ? "2.0.0-rc.13" : "unknown";
|
|
1297
1298
|
}
|
|
1298
1299
|
function sortRecord(record) {
|
|
1299
1300
|
return Object.fromEntries(Object.entries(record).sort(([left], [right]) => left.localeCompare(right)));
|
|
@@ -1302,7 +1303,7 @@ function toPosixPath(path) {
|
|
|
1302
1303
|
return path.split(sep).join("/");
|
|
1303
1304
|
}
|
|
1304
1305
|
|
|
1305
|
-
// src/commands/
|
|
1306
|
+
// src/commands/install.ts
|
|
1306
1307
|
var AGENTS_MD_DEFAULT_CONTENT = `# Project Knowledge
|
|
1307
1308
|
|
|
1308
1309
|
This project uses [Fabric](https://github.com/fenglimg/fabric) for cross-client AI knowledge management.
|
|
@@ -1315,76 +1316,76 @@ See \`.fabric/knowledge/\` for project decisions, pitfalls, guidelines, models,
|
|
|
1315
1316
|
var LOCAL_FABRIC_SERVER_PATH = join2("node_modules", "@fenglimg", "fabric-server", "dist", "index.js");
|
|
1316
1317
|
var FABRIC_SERVER_PACKAGE = "@fenglimg/fabric-server";
|
|
1317
1318
|
var INIT_WIZARD_GROUP_CANCELLED = /* @__PURE__ */ Symbol("init-wizard-group-cancelled");
|
|
1318
|
-
var
|
|
1319
|
+
var installCommand = defineCommand2({
|
|
1319
1320
|
meta: {
|
|
1320
|
-
name: "
|
|
1321
|
-
description: t("cli.
|
|
1321
|
+
name: "install",
|
|
1322
|
+
description: t("cli.install.description")
|
|
1322
1323
|
},
|
|
1323
1324
|
args: {
|
|
1324
1325
|
target: {
|
|
1325
1326
|
type: "string",
|
|
1326
|
-
description: t("cli.
|
|
1327
|
+
description: t("cli.install.args.target.description")
|
|
1327
1328
|
},
|
|
1328
1329
|
debug: {
|
|
1329
1330
|
type: "boolean",
|
|
1330
|
-
description: t("cli.
|
|
1331
|
+
description: t("cli.install.args.debug.description"),
|
|
1331
1332
|
default: false
|
|
1332
1333
|
},
|
|
1333
1334
|
force: {
|
|
1334
1335
|
type: "boolean",
|
|
1335
|
-
description: t("cli.
|
|
1336
|
+
description: t("cli.install.args.force.description"),
|
|
1336
1337
|
default: false
|
|
1337
1338
|
},
|
|
1338
1339
|
yes: {
|
|
1339
1340
|
type: "boolean",
|
|
1340
|
-
description: t("cli.
|
|
1341
|
+
description: t("cli.install.args.yes.description"),
|
|
1341
1342
|
default: false
|
|
1342
1343
|
},
|
|
1343
1344
|
plan: {
|
|
1344
1345
|
type: "boolean",
|
|
1345
|
-
description: t("cli.
|
|
1346
|
+
description: t("cli.install.args.plan.description"),
|
|
1346
1347
|
default: false
|
|
1347
1348
|
},
|
|
1348
1349
|
reapply: {
|
|
1349
1350
|
type: "boolean",
|
|
1350
|
-
description: t("cli.
|
|
1351
|
+
description: t("cli.install.args.reapply.description"),
|
|
1351
1352
|
default: false
|
|
1352
1353
|
},
|
|
1353
1354
|
bootstrap: {
|
|
1354
1355
|
type: "boolean",
|
|
1355
1356
|
default: true,
|
|
1356
|
-
negativeDescription: t("cli.
|
|
1357
|
+
negativeDescription: t("cli.install.args.no-bootstrap.description")
|
|
1357
1358
|
},
|
|
1358
1359
|
mcp: {
|
|
1359
1360
|
type: "boolean",
|
|
1360
1361
|
default: true,
|
|
1361
|
-
negativeDescription: t("cli.
|
|
1362
|
+
negativeDescription: t("cli.install.args.no-mcp.description")
|
|
1362
1363
|
},
|
|
1363
1364
|
hooks: {
|
|
1364
1365
|
type: "boolean",
|
|
1365
1366
|
default: true,
|
|
1366
|
-
negativeDescription: t("cli.
|
|
1367
|
+
negativeDescription: t("cli.install.args.no-hooks.description")
|
|
1367
1368
|
},
|
|
1368
1369
|
interactive: {
|
|
1369
1370
|
type: "boolean",
|
|
1370
|
-
description: t("cli.
|
|
1371
|
+
description: t("cli.install.args.interactive.description"),
|
|
1371
1372
|
default: true
|
|
1372
1373
|
},
|
|
1373
1374
|
"mcp-install": {
|
|
1374
1375
|
type: "string",
|
|
1375
1376
|
default: "global",
|
|
1376
|
-
description: t("cli.
|
|
1377
|
+
description: t("cli.install.mcp.install.prompt")
|
|
1377
1378
|
},
|
|
1378
1379
|
scope: {
|
|
1379
1380
|
type: "string",
|
|
1380
|
-
description: t("cli.
|
|
1381
|
+
description: t("cli.install.mcp.scope.description")
|
|
1381
1382
|
}
|
|
1382
1383
|
},
|
|
1383
1384
|
async run({ args }) {
|
|
1384
1385
|
await runInitCommand(args);
|
|
1385
1386
|
}
|
|
1386
1387
|
});
|
|
1387
|
-
var
|
|
1388
|
+
var install_default = installCommand;
|
|
1388
1389
|
async function runInitCommand(args) {
|
|
1389
1390
|
const logger = createDebugLogger(args.debug);
|
|
1390
1391
|
const resolution = resolveDevMode(args.target, process.cwd());
|
|
@@ -1397,13 +1398,13 @@ async function runInitCommand(args) {
|
|
|
1397
1398
|
logger(step);
|
|
1398
1399
|
}
|
|
1399
1400
|
if (intent.options.planOnly) {
|
|
1400
|
-
writeStderr2(t("cli.
|
|
1401
|
+
writeStderr2(t("cli.install.compat.plan"));
|
|
1401
1402
|
}
|
|
1402
1403
|
if (args.interactive === false) {
|
|
1403
|
-
writeStderr2(t("cli.
|
|
1404
|
+
writeStderr2(t("cli.install.compat.interactive"));
|
|
1404
1405
|
}
|
|
1405
1406
|
if (args.bootstrap === false || args.mcp === false || args.hooks === false) {
|
|
1406
|
-
writeStderr2(t("cli.
|
|
1407
|
+
writeStderr2(t("cli.install.compat.legacy-stage-flags"));
|
|
1407
1408
|
}
|
|
1408
1409
|
const supports = detectClientSupports(intent.target);
|
|
1409
1410
|
const basePlan = await buildInitExecutionPlan({
|
|
@@ -1434,7 +1435,7 @@ function writeDefaultFabricConfig(fabricDir, targetRoot) {
|
|
|
1434
1435
|
// README.md + docs/*.md (CJK ratio > 0.3 → "zh-CN", else "en"). Users
|
|
1435
1436
|
// can edit `.fabric/fabric-config.json` to override. See
|
|
1436
1437
|
// packages/shared/src/schemas/fabric-config.ts for the enum.
|
|
1437
|
-
|
|
1438
|
+
fabric_language: detectedLanguage,
|
|
1438
1439
|
// fabric-hint Stop hook Signal A (archive): time-branch threshold, hours
|
|
1439
1440
|
// since last knowledge_proposed event.
|
|
1440
1441
|
archive_hint_hours: 24,
|
|
@@ -1491,7 +1492,7 @@ function writeDefaultFabricConfig(fabricDir, targetRoot) {
|
|
|
1491
1492
|
mkdirSync(fabricDir, { recursive: true });
|
|
1492
1493
|
writeFileSync(target, JSON.stringify(FABRIC_CONFIG_DEFAULTS, null, 2) + "\n", "utf8");
|
|
1493
1494
|
log.info(
|
|
1494
|
-
`Detected and fixated
|
|
1495
|
+
`Detected and fixated fabric_language = ${detectedLanguage}; edit ${target} to override.`
|
|
1495
1496
|
);
|
|
1496
1497
|
}
|
|
1497
1498
|
function resolveInitCliIntent(args, targetInput) {
|
|
@@ -1525,7 +1526,7 @@ function resolveClaudeMcpScope(raw) {
|
|
|
1525
1526
|
if (raw === "user") {
|
|
1526
1527
|
return "user";
|
|
1527
1528
|
}
|
|
1528
|
-
writeStderr2(t("cli.
|
|
1529
|
+
writeStderr2(t("cli.install.mcp.scope.invalid", { value: raw }));
|
|
1529
1530
|
return "project";
|
|
1530
1531
|
}
|
|
1531
1532
|
async function buildInitExecutionPlan(input) {
|
|
@@ -1565,7 +1566,7 @@ async function buildInitExecutionPlan(input) {
|
|
|
1565
1566
|
}
|
|
1566
1567
|
async function executeInitExecutionPlan(plan) {
|
|
1567
1568
|
if (plan.options.force) {
|
|
1568
|
-
writeStderr2(t("cli.
|
|
1569
|
+
writeStderr2(t("cli.install.force.warning", { path: plan.target }));
|
|
1569
1570
|
}
|
|
1570
1571
|
if (plan.options.reapply && !plan.options.planOnly && !plan.interactive) {
|
|
1571
1572
|
writeStderr2(formatInitModeBanner(plan.options));
|
|
@@ -1772,27 +1773,31 @@ function printInitScaffoldResult(created) {
|
|
|
1772
1773
|
function printInitPostSetup(plan, stageResults, finalSupports) {
|
|
1773
1774
|
if (shouldPrintHooksNextStep(plan.options, stageResults)) {
|
|
1774
1775
|
console.log(
|
|
1775
|
-
t("cli.
|
|
1776
|
+
t("cli.install.next-step", {
|
|
1776
1777
|
label: nextLabel(),
|
|
1777
|
-
message: paint.muted(t("cli.
|
|
1778
|
+
message: paint.muted(t("cli.install.next-step.message"))
|
|
1778
1779
|
})
|
|
1779
1780
|
);
|
|
1780
1781
|
}
|
|
1781
1782
|
console.log(
|
|
1782
|
-
t("cli.
|
|
1783
|
+
t("cli.install.reason-message", {
|
|
1783
1784
|
label: reasonLabel(),
|
|
1784
1785
|
message: paint.muted(formatInitReasonMessage(finalSupports))
|
|
1785
1786
|
})
|
|
1786
1787
|
);
|
|
1787
1788
|
printInitStageSummary(stageResults);
|
|
1788
1789
|
printInitCapabilitySummary(finalSupports, stageResults, plan.options);
|
|
1790
|
+
const fabricLanguage = readFabricLanguagePreference(plan.target);
|
|
1791
|
+
console.log(
|
|
1792
|
+
paint.muted(t("cli.install.language_preference_hint", { value: fabricLanguage }))
|
|
1793
|
+
);
|
|
1789
1794
|
}
|
|
1790
1795
|
function printInitPlanPreview(plan) {
|
|
1791
|
-
console.log(t("cli.
|
|
1796
|
+
console.log(t("cli.install.plan.preview-title"));
|
|
1792
1797
|
printInitPlanSummary(plan.target, plan.options, plan.mcpInstallMode, plan.supports);
|
|
1793
1798
|
console.log(
|
|
1794
|
-
t("cli.
|
|
1795
|
-
mode: plan.options.reapply ? t("cli.
|
|
1799
|
+
t("cli.install.plan.preview-result", {
|
|
1800
|
+
mode: plan.options.reapply ? t("cli.install.mode.reapply") : t("cli.install.mode.default"),
|
|
1796
1801
|
bootstrap: yesNoLabel(!plan.options.skipBootstrap),
|
|
1797
1802
|
mcp: yesNoLabel(!plan.options.skipMcp),
|
|
1798
1803
|
hooks: yesNoLabel(!plan.options.skipHooks)
|
|
@@ -1822,7 +1827,7 @@ async function executeInitStagePlan(plan, stageName) {
|
|
|
1822
1827
|
if (stage.skipped) {
|
|
1823
1828
|
return { name: stageName, disposition: "skipped" };
|
|
1824
1829
|
}
|
|
1825
|
-
console.log(formatInitStageHeader(t(`cli.
|
|
1830
|
+
console.log(formatInitStageHeader(t(`cli.install.stages.${stageName}`)));
|
|
1826
1831
|
try {
|
|
1827
1832
|
switch (stage.name) {
|
|
1828
1833
|
case "bootstrap": {
|
|
@@ -1836,7 +1841,8 @@ async function executeInitStagePlan(plan, stageName) {
|
|
|
1836
1841
|
installResults.push(await runBestEffortSingle("claude-hook-config", () => mergeClaudeCodeHookConfig(plan.target)));
|
|
1837
1842
|
installResults.push(await runBestEffortSingle("codex-hook-config", () => mergeCodexHookConfig(plan.target)));
|
|
1838
1843
|
installResults.push(await runBestEffortSingle("cursor-hook-config", () => mergeCursorHookConfig(plan.target)));
|
|
1839
|
-
|
|
1844
|
+
const fabricLanguage = readFabricLanguagePreference(plan.target);
|
|
1845
|
+
installResults.push(...await runBestEffort("section", () => addFabricKnowledgeBaseSection(plan.target, fabricLanguage)));
|
|
1840
1846
|
const installedCount = installResults.filter((r) => r.status === "written").length;
|
|
1841
1847
|
const skippedCount = installResults.filter((r) => r.status === "skipped").length;
|
|
1842
1848
|
const errorCount = installResults.filter((r) => r.status === "error").length;
|
|
@@ -1852,12 +1858,12 @@ async function executeInitStagePlan(plan, stageName) {
|
|
|
1852
1858
|
case "mcp": {
|
|
1853
1859
|
if (stage.installMode === "local") {
|
|
1854
1860
|
const manager = stage.packageManager ?? detectPackageManager(plan.target);
|
|
1855
|
-
writeStderr2(t("cli.
|
|
1856
|
-
writeStderr2(t("cli.
|
|
1861
|
+
writeStderr2(t("cli.install.mcp.install.local"));
|
|
1862
|
+
writeStderr2(t("cli.install.mcp.local.installing", { manager }));
|
|
1857
1863
|
installLocalFabricServer(plan.target, manager);
|
|
1858
|
-
writeStderr2(t("cli.
|
|
1864
|
+
writeStderr2(t("cli.install.mcp.local.installed"));
|
|
1859
1865
|
} else {
|
|
1860
|
-
writeStderr2(t("cli.
|
|
1866
|
+
writeStderr2(t("cli.install.mcp.install.global"));
|
|
1861
1867
|
}
|
|
1862
1868
|
const result = await installMcpClients(plan.target, {
|
|
1863
1869
|
force: plan.options.force,
|
|
@@ -1892,7 +1898,7 @@ function shouldReplaceWritableDirectory(path, options) {
|
|
|
1892
1898
|
return false;
|
|
1893
1899
|
}
|
|
1894
1900
|
if (!options?.force) {
|
|
1895
|
-
throw new Error(t("cli.
|
|
1901
|
+
throw new Error(t("cli.install.errors.abort-existing", { path }));
|
|
1896
1902
|
}
|
|
1897
1903
|
return true;
|
|
1898
1904
|
}
|
|
@@ -1901,7 +1907,7 @@ function planFreshPath(path, options) {
|
|
|
1901
1907
|
return "created";
|
|
1902
1908
|
}
|
|
1903
1909
|
if (!options?.force) {
|
|
1904
|
-
throw new Error(t("cli.
|
|
1910
|
+
throw new Error(t("cli.install.errors.abort-existing", { path }));
|
|
1905
1911
|
}
|
|
1906
1912
|
return "overwritten";
|
|
1907
1913
|
}
|
|
@@ -1914,59 +1920,59 @@ function preparePlannedPath(path, action) {
|
|
|
1914
1920
|
function createDefaultInitWizardAdapter() {
|
|
1915
1921
|
return {
|
|
1916
1922
|
async run(context) {
|
|
1917
|
-
intro(t("cli.
|
|
1923
|
+
intro(t("cli.install.wizard.intro"));
|
|
1918
1924
|
note(
|
|
1919
|
-
t("cli.
|
|
1925
|
+
t("cli.install.wizard.overview.body", {
|
|
1920
1926
|
target: context.target,
|
|
1921
1927
|
mode: formatInitModeBadge(context.options)
|
|
1922
1928
|
}),
|
|
1923
|
-
t("cli.
|
|
1929
|
+
t("cli.install.wizard.overview.title")
|
|
1924
1930
|
);
|
|
1925
1931
|
printInitPlanSummary(context.target, context.options, context.mcpInstallMode, context.supports);
|
|
1926
|
-
log.step(t("cli.
|
|
1932
|
+
log.step(t("cli.install.wizard.step.target"));
|
|
1927
1933
|
const continueWithTarget = await confirm({
|
|
1928
|
-
message: t("cli.
|
|
1934
|
+
message: t("cli.install.wizard.target.confirm", { target: context.target }),
|
|
1929
1935
|
initialValue: true
|
|
1930
1936
|
});
|
|
1931
1937
|
if (isCancel(continueWithTarget) || !continueWithTarget) {
|
|
1932
1938
|
emitInitWizardCancellation();
|
|
1933
1939
|
return null;
|
|
1934
1940
|
}
|
|
1935
|
-
log.step(t("cli.
|
|
1941
|
+
log.step(t("cli.install.wizard.step.plan"));
|
|
1936
1942
|
let groupedSelection;
|
|
1937
1943
|
try {
|
|
1938
1944
|
groupedSelection = await group(
|
|
1939
1945
|
{
|
|
1940
1946
|
bootstrap: async () => context.lockedStages.includes("bootstrap") ? false : confirmInGroup({
|
|
1941
|
-
message: t("cli.
|
|
1947
|
+
message: t("cli.install.wizard.stage.bootstrap", {
|
|
1942
1948
|
defaultValue: formatPromptDefault(!context.options.skipBootstrap)
|
|
1943
1949
|
}),
|
|
1944
1950
|
initialValue: !context.options.skipBootstrap
|
|
1945
1951
|
}),
|
|
1946
1952
|
mcp: async () => context.lockedStages.includes("mcp") ? false : confirmInGroup({
|
|
1947
|
-
message: t("cli.
|
|
1953
|
+
message: t("cli.install.wizard.stage.mcp", {
|
|
1948
1954
|
defaultValue: formatPromptDefault(!context.options.skipMcp)
|
|
1949
1955
|
}),
|
|
1950
1956
|
initialValue: !context.options.skipMcp
|
|
1951
1957
|
}),
|
|
1952
1958
|
mcpInstallMode: async ({ results }) => results.mcp ? selectMcpInstallModeInGroup({
|
|
1953
|
-
message: t("cli.
|
|
1959
|
+
message: t("cli.install.wizard.mcp-install", { defaultValue: context.mcpInstallMode }),
|
|
1954
1960
|
initialValue: context.mcpInstallMode,
|
|
1955
1961
|
options: [
|
|
1956
|
-
{ value: "global", label: "global", hint: t("cli.
|
|
1957
|
-
{ value: "local", label: "local", hint: t("cli.
|
|
1962
|
+
{ value: "global", label: "global", hint: t("cli.install.mcp.install.global") },
|
|
1963
|
+
{ value: "local", label: "local", hint: t("cli.install.mcp.install.local") }
|
|
1958
1964
|
]
|
|
1959
1965
|
}) : context.mcpInstallMode,
|
|
1960
1966
|
claudeMcpScope: async ({ results }) => results.mcp ? selectClaudeMcpScopeInGroup({
|
|
1961
|
-
message: t("cli.
|
|
1967
|
+
message: t("cli.install.wizard.mcp-scope", { defaultValue: context.claudeMcpScope }),
|
|
1962
1968
|
initialValue: context.claudeMcpScope,
|
|
1963
1969
|
options: [
|
|
1964
|
-
{ value: "project", label: "project", hint: t("cli.
|
|
1965
|
-
{ value: "user", label: "user", hint: t("cli.
|
|
1970
|
+
{ value: "project", label: "project", hint: t("cli.install.mcp.scope.project") },
|
|
1971
|
+
{ value: "user", label: "user", hint: t("cli.install.mcp.scope.user") }
|
|
1966
1972
|
]
|
|
1967
1973
|
}) : context.claudeMcpScope,
|
|
1968
1974
|
hooks: async () => context.lockedStages.includes("hooks") ? false : confirmInGroup({
|
|
1969
|
-
message: t("cli.
|
|
1975
|
+
message: t("cli.install.wizard.stage.hooks", {
|
|
1970
1976
|
defaultValue: formatPromptDefault(!context.options.skipHooks)
|
|
1971
1977
|
}),
|
|
1972
1978
|
initialValue: !context.options.skipHooks
|
|
@@ -1995,23 +2001,23 @@ function createDefaultInitWizardAdapter() {
|
|
|
1995
2001
|
skipMcp: !groupedSelection.mcp,
|
|
1996
2002
|
skipHooks: !groupedSelection.hooks
|
|
1997
2003
|
};
|
|
1998
|
-
log.step(t("cli.
|
|
2004
|
+
log.step(t("cli.install.wizard.step.review"));
|
|
1999
2005
|
printInitPlanSummary(context.target, previewOptions, groupedSelection.mcpInstallMode, context.supports);
|
|
2000
2006
|
const confirmed = await confirm({
|
|
2001
|
-
message: t("cli.
|
|
2007
|
+
message: t("cli.install.wizard.execute.confirm"),
|
|
2002
2008
|
initialValue: true
|
|
2003
2009
|
});
|
|
2004
2010
|
if (isCancel(confirmed) || !confirmed) {
|
|
2005
2011
|
emitInitWizardCancellation();
|
|
2006
2012
|
return null;
|
|
2007
2013
|
}
|
|
2008
|
-
outro(t("cli.
|
|
2014
|
+
outro(t("cli.install.wizard.outro"));
|
|
2009
2015
|
return groupedSelection;
|
|
2010
2016
|
}
|
|
2011
2017
|
};
|
|
2012
2018
|
}
|
|
2013
2019
|
function emitInitWizardCancellation() {
|
|
2014
|
-
cancel(t("cli.
|
|
2020
|
+
cancel(t("cli.install.wizard.cancelled"));
|
|
2015
2021
|
}
|
|
2016
2022
|
async function confirmInGroup(options) {
|
|
2017
2023
|
const result = await confirm(options);
|
|
@@ -2060,27 +2066,27 @@ function formatPromptDefault(value) {
|
|
|
2060
2066
|
}
|
|
2061
2067
|
function formatInitModeBanner(options) {
|
|
2062
2068
|
if (options.planOnly && options.reapply) {
|
|
2063
|
-
return t("cli.
|
|
2069
|
+
return t("cli.install.plan.mode-banner.plan-reapply");
|
|
2064
2070
|
}
|
|
2065
2071
|
if (options.planOnly) {
|
|
2066
|
-
return t("cli.
|
|
2072
|
+
return t("cli.install.plan.mode-banner.plan");
|
|
2067
2073
|
}
|
|
2068
2074
|
if (options.reapply) {
|
|
2069
|
-
return t("cli.
|
|
2075
|
+
return t("cli.install.plan.mode-banner.reapply");
|
|
2070
2076
|
}
|
|
2071
|
-
return t("cli.
|
|
2077
|
+
return t("cli.install.plan.mode-banner.default");
|
|
2072
2078
|
}
|
|
2073
2079
|
function formatInitModeBadge(options) {
|
|
2074
2080
|
if (options.planOnly && options.reapply) {
|
|
2075
|
-
return t("cli.
|
|
2081
|
+
return t("cli.install.mode.badge.plan-reapply");
|
|
2076
2082
|
}
|
|
2077
2083
|
if (options.planOnly) {
|
|
2078
|
-
return t("cli.
|
|
2084
|
+
return t("cli.install.mode.badge.plan");
|
|
2079
2085
|
}
|
|
2080
2086
|
if (options.reapply) {
|
|
2081
|
-
return t("cli.
|
|
2087
|
+
return t("cli.install.mode.badge.reapply");
|
|
2082
2088
|
}
|
|
2083
|
-
return t("cli.
|
|
2089
|
+
return t("cli.install.mode.badge.default");
|
|
2084
2090
|
}
|
|
2085
2091
|
function normalizeTarget2(targetInput) {
|
|
2086
2092
|
return isAbsolute2(targetInput) ? targetInput : resolve3(process.cwd(), targetInput);
|
|
@@ -2107,7 +2113,7 @@ function resolveMcpInstallMode(rawMode) {
|
|
|
2107
2113
|
if (rawMode === void 0 || rawMode === "global" || rawMode === "local") {
|
|
2108
2114
|
return rawMode ?? "global";
|
|
2109
2115
|
}
|
|
2110
|
-
writeStderr2(t("cli.
|
|
2116
|
+
writeStderr2(t("cli.install.mcp.install.invalid", { value: rawMode }));
|
|
2111
2117
|
return "global";
|
|
2112
2118
|
}
|
|
2113
2119
|
function installLocalFabricServer(target, manager) {
|
|
@@ -2183,7 +2189,7 @@ function printInitStageSummary(stageResults) {
|
|
|
2183
2189
|
console.log(formatInitStageSummaryLine("failed", collectInitStageNames(stageResults, "failed")));
|
|
2184
2190
|
}
|
|
2185
2191
|
function formatInitStageSummaryLine(disposition, stages) {
|
|
2186
|
-
const label = disposition === "ran" ? paint.success(t("cli.
|
|
2192
|
+
const label = disposition === "ran" ? paint.success(t("cli.install.stages.summary.ran")) : disposition === "skipped" ? paint.muted(t("cli.install.stages.summary.skipped")) : paint.error(t("cli.install.stages.summary.failed"));
|
|
2187
2193
|
return `${label}: ${stages.length > 0 ? stages.join(", ") : t("cli.shared.none")}`;
|
|
2188
2194
|
}
|
|
2189
2195
|
function collectInitStageNames(stageResults, disposition) {
|
|
@@ -2196,11 +2202,11 @@ function isInteractiveInit() {
|
|
|
2196
2202
|
return Boolean(process.stdin.isTTY) && Boolean(process.stdout.isTTY) && Boolean(process.stderr.isTTY);
|
|
2197
2203
|
}
|
|
2198
2204
|
function printInitPlanSummary(target, options, mcpInstallMode, supports) {
|
|
2199
|
-
console.log(t("cli.
|
|
2205
|
+
console.log(t("cli.install.plan.title"));
|
|
2200
2206
|
console.log(formatInitModeBanner(options));
|
|
2201
|
-
console.log(t("cli.
|
|
2207
|
+
console.log(t("cli.install.plan.target", { target }));
|
|
2202
2208
|
console.log(
|
|
2203
|
-
t("cli.
|
|
2209
|
+
t("cli.install.plan.actions", {
|
|
2204
2210
|
bootstrap: yesNoLabel(!options.skipBootstrap),
|
|
2205
2211
|
mcp: yesNoLabel(!options.skipMcp),
|
|
2206
2212
|
hooks: yesNoLabel(!options.skipHooks),
|
|
@@ -2209,11 +2215,11 @@ function printInitPlanSummary(target, options, mcpInstallMode, supports) {
|
|
|
2209
2215
|
);
|
|
2210
2216
|
const detected = supports.filter((support) => support.detected);
|
|
2211
2217
|
console.log(
|
|
2212
|
-
t("cli.
|
|
2218
|
+
t("cli.install.plan.detected", {
|
|
2213
2219
|
clients: detected.length > 0 ? detected.map((support) => support.label).join(", ") : t("cli.shared.none")
|
|
2214
2220
|
})
|
|
2215
2221
|
);
|
|
2216
|
-
console.log(t("cli.
|
|
2222
|
+
console.log(t("cli.install.plan.writes"));
|
|
2217
2223
|
console.log(` - ${target}/.fabric/knowledge/{decisions,pitfalls,guidelines,models,processes,pending}/`);
|
|
2218
2224
|
console.log(` - ${target}/.fabric/agents.meta.json`);
|
|
2219
2225
|
console.log(` - ${target}/.fabric/events.jsonl`);
|
|
@@ -2223,18 +2229,18 @@ function printInitPlanSummary(target, options, mcpInstallMode, supports) {
|
|
|
2223
2229
|
function printInitCapabilitySummary(supports, stageResults, options) {
|
|
2224
2230
|
const detected = supports.filter((support) => support.detected);
|
|
2225
2231
|
if (detected.length === 0) {
|
|
2226
|
-
console.log(t("cli.
|
|
2232
|
+
console.log(t("cli.install.capabilities.none"));
|
|
2227
2233
|
return;
|
|
2228
2234
|
}
|
|
2229
|
-
console.log(t("cli.
|
|
2235
|
+
console.log(t("cli.install.capabilities.title"));
|
|
2230
2236
|
const rows = detected.map((support) => toCapabilityRow(support, stageResults, options));
|
|
2231
2237
|
const headers = {
|
|
2232
|
-
client: t("cli.
|
|
2233
|
-
bootstrap: t("cli.
|
|
2234
|
-
mcp: t("cli.
|
|
2235
|
-
hook: t("cli.
|
|
2236
|
-
skill: t("cli.
|
|
2237
|
-
followUp: t("cli.
|
|
2238
|
+
client: t("cli.install.capabilities.header.client"),
|
|
2239
|
+
bootstrap: t("cli.install.capabilities.header.bootstrap"),
|
|
2240
|
+
mcp: t("cli.install.capabilities.header.mcp"),
|
|
2241
|
+
hook: t("cli.install.capabilities.header.hook"),
|
|
2242
|
+
skill: t("cli.install.capabilities.header.skill"),
|
|
2243
|
+
followUp: t("cli.install.capabilities.header.follow-up")
|
|
2238
2244
|
};
|
|
2239
2245
|
const widths = {
|
|
2240
2246
|
client: Math.max(displayWidth(headers.client), ...rows.map((row) => displayWidth(row.client))),
|
|
@@ -2252,8 +2258,8 @@ function printInitCapabilitySummary(supports, stageResults, options) {
|
|
|
2252
2258
|
}
|
|
2253
2259
|
function toCapabilityRow(support, stageResults, options) {
|
|
2254
2260
|
const stage = (name) => stageResults.find((entry) => entry.name === name)?.disposition ?? null;
|
|
2255
|
-
const bootstrap = support.capabilities.bootstrap ? capabilityStatus(options.skipBootstrap ? "skipped" : stage("bootstrap")) : t("cli.
|
|
2256
|
-
const mcp = support.capabilities.mcp ? capabilityStatus(options.skipMcp ? "skipped" : stage("mcp")) : t("cli.
|
|
2261
|
+
const bootstrap = support.capabilities.bootstrap ? capabilityStatus(options.skipBootstrap ? "skipped" : stage("bootstrap")) : t("cli.install.capabilities.status.na");
|
|
2262
|
+
const mcp = support.capabilities.mcp ? capabilityStatus(options.skipMcp ? "skipped" : stage("mcp")) : t("cli.install.capabilities.status.na");
|
|
2257
2263
|
const hook = capabilityInstallStatus(support, "hook");
|
|
2258
2264
|
const skill = capabilityInstallStatus(support, "skill");
|
|
2259
2265
|
return {
|
|
@@ -2262,14 +2268,14 @@ function toCapabilityRow(support, stageResults, options) {
|
|
|
2262
2268
|
mcp,
|
|
2263
2269
|
hook,
|
|
2264
2270
|
skill,
|
|
2265
|
-
followUp: hasInstalledCapability(support, "skill") ? t("cli.
|
|
2271
|
+
followUp: hasInstalledCapability(support, "skill") ? t("cli.install.capabilities.follow-up.ready") : support.capabilities.skill ? t("cli.install.capabilities.follow-up.install") : t("cli.install.capabilities.follow-up.manual")
|
|
2266
2272
|
};
|
|
2267
2273
|
}
|
|
2268
2274
|
function capabilityInstallStatus(support, capability) {
|
|
2269
2275
|
if (!support.capabilities[capability]) {
|
|
2270
|
-
return t("cli.
|
|
2276
|
+
return t("cli.install.capabilities.status.na");
|
|
2271
2277
|
}
|
|
2272
|
-
return hasInstalledCapability(support, capability) ? t("cli.
|
|
2278
|
+
return hasInstalledCapability(support, capability) ? t("cli.install.capabilities.status.installed") : t("cli.install.capabilities.status.supported");
|
|
2273
2279
|
}
|
|
2274
2280
|
function hasInstalledCapability(support, capability) {
|
|
2275
2281
|
return support.installedCapabilities?.[capability] === true;
|
|
@@ -2277,15 +2283,15 @@ function hasInstalledCapability(support, capability) {
|
|
|
2277
2283
|
function capabilityStatus(disposition) {
|
|
2278
2284
|
switch (disposition) {
|
|
2279
2285
|
case "ran":
|
|
2280
|
-
return t("cli.
|
|
2286
|
+
return t("cli.install.capabilities.status.ready");
|
|
2281
2287
|
case "skipped":
|
|
2282
|
-
return t("cli.
|
|
2288
|
+
return t("cli.install.capabilities.status.skipped");
|
|
2283
2289
|
case "failed":
|
|
2284
|
-
return t("cli.
|
|
2290
|
+
return t("cli.install.capabilities.status.failed");
|
|
2285
2291
|
case null:
|
|
2286
|
-
return t("cli.
|
|
2292
|
+
return t("cli.install.capabilities.status.na");
|
|
2287
2293
|
default:
|
|
2288
|
-
return t("cli.
|
|
2294
|
+
return t("cli.install.capabilities.status.ready");
|
|
2289
2295
|
}
|
|
2290
2296
|
}
|
|
2291
2297
|
function formatCapabilityTableRow(row, widths) {
|
|
@@ -2311,21 +2317,21 @@ function formatCapabilityDivider(widths) {
|
|
|
2311
2317
|
function formatInitReasonMessage(supports) {
|
|
2312
2318
|
const detected = supports.filter((support) => support.detected);
|
|
2313
2319
|
if (detected.some((support) => support.capabilities.skill)) {
|
|
2314
|
-
return t("cli.
|
|
2320
|
+
return t("cli.install.reason-message.installable-body");
|
|
2315
2321
|
}
|
|
2316
|
-
return t("cli.
|
|
2322
|
+
return t("cli.install.reason-message.manual-body");
|
|
2317
2323
|
}
|
|
2318
2324
|
function yesNoLabel(value) {
|
|
2319
2325
|
return value ? t("cli.shared.yes") : t("cli.shared.no");
|
|
2320
2326
|
}
|
|
2321
2327
|
function formatInitPathAction(path, action) {
|
|
2322
|
-
return t("cli.
|
|
2328
|
+
return t("cli.install.created-path", { label: labelForInitWriteAction(action), path });
|
|
2323
2329
|
}
|
|
2324
2330
|
function formatAgentsMdAction(path, action) {
|
|
2325
2331
|
if (action === "preserved") {
|
|
2326
|
-
return t("cli.
|
|
2332
|
+
return t("cli.install.skipped-existing-path", { label: skippedLabel(), path });
|
|
2327
2333
|
}
|
|
2328
|
-
return t("cli.
|
|
2334
|
+
return t("cli.install.created-path", { label: createdLabel(), path });
|
|
2329
2335
|
}
|
|
2330
2336
|
function labelForInitWriteAction(action) {
|
|
2331
2337
|
return action === "overwritten" ? overwrittenLabel() : createdLabel();
|
|
@@ -2343,16 +2349,16 @@ function reasonLabel() {
|
|
|
2343
2349
|
return paint.human(t("cli.shared.reason"));
|
|
2344
2350
|
}
|
|
2345
2351
|
function overwrittenLabel() {
|
|
2346
|
-
return paint.warn(t("cli.
|
|
2352
|
+
return paint.warn(t("cli.install.force.overwritten"));
|
|
2347
2353
|
}
|
|
2348
2354
|
function completedStageLabel() {
|
|
2349
|
-
return paint.success(t("cli.
|
|
2355
|
+
return paint.success(t("cli.install.stages.completed"));
|
|
2350
2356
|
}
|
|
2351
2357
|
function skippedStageLabel() {
|
|
2352
|
-
return paint.muted(t("cli.
|
|
2358
|
+
return paint.muted(t("cli.install.stages.skipped"));
|
|
2353
2359
|
}
|
|
2354
2360
|
function failedStageLabel() {
|
|
2355
|
-
return paint.error(t("cli.
|
|
2361
|
+
return paint.error(t("cli.install.stages.failed"));
|
|
2356
2362
|
}
|
|
2357
2363
|
function writeStderr2(message) {
|
|
2358
2364
|
process.stderr.write(`${message}
|
|
@@ -2362,12 +2368,12 @@ export {
|
|
|
2362
2368
|
buildInitExecutionPlan,
|
|
2363
2369
|
buildInitFabricPlan,
|
|
2364
2370
|
createDefaultInitWizardAdapter,
|
|
2365
|
-
|
|
2371
|
+
install_default as default,
|
|
2366
2372
|
detectPackageManager,
|
|
2367
2373
|
executeInitExecutionPlan,
|
|
2368
2374
|
executeInitFabricPlan,
|
|
2369
|
-
initCommand,
|
|
2370
2375
|
initFabric,
|
|
2376
|
+
installCommand,
|
|
2371
2377
|
resolveInitExecutionPlanWithWizard,
|
|
2372
2378
|
runInitCommand,
|
|
2373
2379
|
shouldUseInitWizard
|