@fenglimg/fabric-cli 2.2.0-rc.3 → 2.2.0-rc.8
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 +8 -5
- package/dist/{chunk-5LQIHYFC.js → chunk-27HK6H5Y.js} +10 -5
- package/dist/{chunk-F6ITRM7T.js → chunk-2KBCTMID.js} +29 -6
- package/dist/{chunk-XC5RUHLK.js → chunk-3IOLS5EK.js} +23 -38
- package/dist/{chunk-XHHCRDIR.js → chunk-CMDW3PYK.js} +105 -220
- package/dist/chunk-FEOPLBGA.js +150 -0
- package/dist/{chunk-XCBVSGCS.js → chunk-FNHDQTPC.js} +1 -10
- package/dist/{chunk-2CY4BMTH.js → chunk-HORSMSZL.js} +9 -5
- package/dist/{doctor-J4O3X54I.js → chunk-JTHWLUD3.js} +103 -51
- package/dist/{chunk-BO4XIZWZ.js → chunk-NLNH64A3.js} +5 -18
- package/dist/{chunk-H3FE6VIK.js → chunk-PTGQAZEW.js} +13 -3
- package/dist/chunk-QFIVFZRH.js +13 -0
- package/dist/chunk-QPAW6IYT.js +387 -0
- package/dist/{chunk-COI5VDFU.js → chunk-WA3DYGSY.js} +1 -2
- package/dist/{plan-context-hint-CHVZGOZ5.js → chunk-YM4XATJF.js} +29 -4
- package/dist/{config-VJMXCLXW.js → config-A3LTECAY.js} +4 -3
- package/dist/context-7NUKXDB6.js +117 -0
- package/dist/doctor-REZDNH4A.js +24 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +131 -21
- package/dist/info-7FKBTMVO.js +139 -0
- package/dist/install-v2-2COC3DO3.js +3277 -0
- package/dist/{metrics-RER6NLFC.js → metrics-HMFH4YHK.js} +1 -1
- package/dist/{onboard-coverage-JWQWDZW7.js → onboard-coverage-XSG77LL3.js} +48 -27
- package/dist/plan-context-hint-G75R4P4J.js +12 -0
- package/dist/{scope-explain-BWRWBCCP.js → scope-explain-HLJZ2M33.js} +3 -2
- package/dist/{status-PANEGKU2.js → status-4R3TM4FJ.js} +8 -5
- package/dist/store-HOCORVL3.js +563 -0
- package/dist/{sync-EA5HZMXM.js → sync-DT5UJMMR.js} +36 -13
- package/dist/{uninstall-F75MPKQC.js → uninstall-62F4LNKI.js} +62 -140
- package/dist/{whoami-66YKY5DZ.js → whoami-ITGEFWH4.js} +9 -7
- package/package.json +7 -5
- package/templates/hooks/cite-policy-evict.cjs +5 -5
- package/templates/hooks/configs/README.md +14 -27
- package/templates/hooks/configs/claude-code.json +1 -1
- package/templates/hooks/configs/codex-hooks.json +3 -3
- package/templates/hooks/fabric-hint.cjs +301 -161
- package/templates/hooks/knowledge-hint-broad.cjs +426 -207
- package/templates/hooks/knowledge-hint-narrow.cjs +56 -56
- package/templates/hooks/lib/banner-i18n.cjs +31 -0
- package/templates/hooks/lib/bindings-snapshot-reader.cjs +117 -7
- package/templates/hooks/lib/cite-line-parser.cjs +12 -20
- package/templates/hooks/lib/client-adapter.cjs +66 -7
- package/templates/hooks/lib/nudge-policy.cjs +117 -0
- package/templates/hooks/lib/state-store.cjs +60 -0
- package/templates/hooks/lib/summary-fallback.cjs +82 -19
- package/templates/hooks/post-tooluse-mutation.cjs +112 -11
- package/templates/skills/fabric/SKILL.md +94 -0
- package/templates/skills/fabric-archive/SKILL.md +29 -26
- package/templates/skills/fabric-archive/ref/dry-run-scope.md +1 -1
- package/templates/skills/fabric-archive/ref/i18n-policy.md +2 -3
- package/templates/skills/fabric-archive/ref/phase-1-5-onboard.md +2 -3
- package/templates/skills/fabric-archive/ref/phase-1-cross-session.md +1 -1
- package/templates/skills/fabric-archive/ref/phase-2-5-viability.md +1 -1
- package/templates/skills/fabric-archive/ref/phase-3-6-related-edges.md +18 -0
- package/templates/skills/fabric-archive/ref/phase-3-7-semantic-scope.md +47 -0
- package/templates/skills/fabric-audit/SKILL.md +13 -3
- package/templates/skills/fabric-connect/SKILL.md +3 -3
- package/templates/skills/fabric-import/SKILL.md +7 -7
- package/templates/skills/fabric-import/ref/i18n-policy.md +2 -3
- package/templates/skills/fabric-import/ref/state-recovery.md +1 -2
- package/templates/skills/fabric-review/SKILL.md +5 -5
- package/templates/skills/fabric-review/ref/cite-contract.md +1 -1
- package/templates/skills/fabric-review/ref/i18n-policy.md +2 -3
- package/templates/skills/fabric-review/ref/output-contract.md +1 -1
- package/templates/skills/fabric-review/ref/per-mode-flows.md +2 -2
- package/templates/skills/fabric-review/ref/worked-examples.md +1 -1
- package/templates/skills/fabric-store/SKILL.md +1 -1
- package/templates/skills/fabric-sync/SKILL.md +1 -1
- package/templates/skills/lib/shared-policy.md +2 -2
- package/dist/chunk-5ZUMLCD5.js +0 -248
- package/dist/install-BULNDUIM.js +0 -2816
- package/dist/store-66NK2FTQ.js +0 -443
- package/templates/hooks/configs/cursor-hooks.json +0 -30
- package/templates/hooks/lib/cite-contract-reminder.cjs +0 -179
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
// src/i18n.ts
|
|
4
4
|
import {
|
|
5
5
|
createTranslator,
|
|
6
|
-
|
|
7
|
-
resolveFabricLocale
|
|
6
|
+
resolveGlobalLocale
|
|
8
7
|
} from "@fenglimg/fabric-shared";
|
|
9
|
-
var locale =
|
|
8
|
+
var locale = resolveGlobalLocale();
|
|
10
9
|
var t = createTranslator(locale);
|
|
11
|
-
function
|
|
12
|
-
|
|
10
|
+
function refreshLocale() {
|
|
11
|
+
locale = resolveGlobalLocale();
|
|
12
|
+
t = createTranslator(locale);
|
|
13
|
+
}
|
|
14
|
+
function getProjectTranslator(_projectRoot = process.cwd()) {
|
|
15
|
+
return createTranslator(resolveGlobalLocale());
|
|
13
16
|
}
|
|
14
17
|
function getDoctorTranslator(projectRoot) {
|
|
15
18
|
return getProjectTranslator(projectRoot);
|
|
@@ -17,6 +20,7 @@ function getDoctorTranslator(projectRoot) {
|
|
|
17
20
|
|
|
18
21
|
export {
|
|
19
22
|
t,
|
|
23
|
+
refreshLocale,
|
|
20
24
|
getProjectTranslator,
|
|
21
25
|
getDoctorTranslator
|
|
22
26
|
};
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
3
|
+
ensureStoreProjectBinding,
|
|
4
|
+
migrateRootConfig
|
|
5
|
+
} from "./chunk-FEOPLBGA.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveDevMode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WA3DYGSY.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
paint,
|
|
11
|
+
symbol
|
|
12
|
+
} from "./chunk-NLNH64A3.js";
|
|
13
13
|
import {
|
|
14
14
|
detectAliasLinkDrift,
|
|
15
15
|
missingRequiredStores,
|
|
16
16
|
syncStoreAliasLinks,
|
|
17
17
|
unboundAvailableStores
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QPAW6IYT.js";
|
|
19
|
+
import {
|
|
20
|
+
loadProjectConfig
|
|
21
|
+
} from "./chunk-QFIVFZRH.js";
|
|
19
22
|
import {
|
|
20
23
|
loadGlobalConfig,
|
|
21
|
-
loadProjectConfig,
|
|
22
24
|
resolveGlobalRoot
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FNHDQTPC.js";
|
|
26
|
+
import {
|
|
27
|
+
getDoctorTranslator,
|
|
28
|
+
t
|
|
29
|
+
} from "./chunk-HORSMSZL.js";
|
|
24
30
|
|
|
25
31
|
// src/commands/doctor.ts
|
|
26
32
|
import { confirm, isCancel } from "@clack/prompts";
|
|
@@ -37,9 +43,24 @@ import {
|
|
|
37
43
|
runDoctorConflictLint
|
|
38
44
|
} from "@fenglimg/fabric-server";
|
|
39
45
|
|
|
46
|
+
// src/install/backfill-unbound-project.ts
|
|
47
|
+
import { detectUnboundProject } from "@fenglimg/fabric-server";
|
|
48
|
+
async function backfillUnboundProject(projectRoot, globalRoot = resolveGlobalRoot()) {
|
|
49
|
+
const violation = detectUnboundProject(projectRoot);
|
|
50
|
+
if (violation === null) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const result = await ensureStoreProjectBinding(projectRoot, violation.alias, { globalRoot });
|
|
54
|
+
return {
|
|
55
|
+
alias: violation.alias,
|
|
56
|
+
project_id: result.project_id,
|
|
57
|
+
active_project: result.active_project
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
40
61
|
// src/store/doctor-checks.ts
|
|
41
62
|
import { join } from "path";
|
|
42
|
-
import { findStoreExecutableViolations,
|
|
63
|
+
import { findStoreExecutableViolations, storeRelativePathForMount } from "@fenglimg/fabric-shared";
|
|
43
64
|
function storeDoctorChecks(projectRoot, globalRoot = resolveGlobalRoot()) {
|
|
44
65
|
const diagnostics = [];
|
|
45
66
|
const global = loadGlobalConfig(globalRoot);
|
|
@@ -85,7 +106,7 @@ function storeDoctorChecks(projectRoot, globalRoot = resolveGlobalRoot()) {
|
|
|
85
106
|
message: `store '${store.alias}' is local-only; add a git remote to back it up`
|
|
86
107
|
});
|
|
87
108
|
}
|
|
88
|
-
const violations = findStoreExecutableViolations(join(globalRoot,
|
|
109
|
+
const violations = findStoreExecutableViolations(join(globalRoot, storeRelativePathForMount(store)));
|
|
89
110
|
if (violations.length > 0) {
|
|
90
111
|
diagnostics.push({
|
|
91
112
|
code: "executable_in_store",
|
|
@@ -101,8 +122,6 @@ function storeDoctorChecks(projectRoot, globalRoot = resolveGlobalRoot()) {
|
|
|
101
122
|
// src/commands/doctor.ts
|
|
102
123
|
import { buildDebugBundle } from "@fenglimg/fabric-shared";
|
|
103
124
|
var FIX_KNOWLEDGE_CODE_LABELS = {
|
|
104
|
-
knowledge_orphan_demote_required: "demote (maturity)",
|
|
105
|
-
knowledge_stale_archive_required: "archive (git mv)",
|
|
106
125
|
knowledge_pending_auto_archive: "archive (git mv, pending)",
|
|
107
126
|
knowledge_index_drift: "counter bump (agents.meta)",
|
|
108
127
|
knowledge_session_hints_stale: "cache delete"
|
|
@@ -133,40 +152,28 @@ var doctorCommand = defineCommand({
|
|
|
133
152
|
description: t("cli.doctor.args.json.description"),
|
|
134
153
|
default: false
|
|
135
154
|
},
|
|
136
|
-
strict: {
|
|
137
|
-
type: "boolean",
|
|
138
|
-
description: t("cli.doctor.args.strict.description"),
|
|
139
|
-
default: false
|
|
140
|
-
},
|
|
141
155
|
// v2.1.0-rc.1 P6 (S40): emit a redacted diagnostic bundle (config + store
|
|
142
156
|
// diagnostics; events excluded by default). Every string is secret-redacted
|
|
143
157
|
// so the bundle is safe to paste into a bug report. Read-only.
|
|
158
|
+
// EPIC-009: hidden flag (internal debug tool).
|
|
144
159
|
"debug-bundle": {
|
|
145
160
|
type: "boolean",
|
|
146
161
|
description: "Emit a redacted diagnostic bundle (config + store health) for bug reports",
|
|
147
162
|
default: false
|
|
148
163
|
},
|
|
149
|
-
//
|
|
150
|
-
// non-tty invocation that wants to run --fix-knowledge without setting
|
|
151
|
-
// FABRIC_NONINTERACTIVE=1 in the environment.
|
|
164
|
+
// EPIC-009: hidden flag (CI automation).
|
|
152
165
|
yes: {
|
|
153
166
|
type: "boolean",
|
|
154
167
|
description: t("cli.doctor.args.yes.description"),
|
|
155
168
|
default: false
|
|
156
169
|
},
|
|
157
|
-
//
|
|
158
|
-
// default the renderer folds remediation strings that target Fabric
|
|
159
|
-
// contributors (edit `packages/cli/templates/...`, interpret G1-G5
|
|
160
|
-
// cite-goodhart codes, etc.) since npm end users have no actionable
|
|
161
|
-
// lever for them. --verbose shows them.
|
|
170
|
+
// EPIC-009: hidden flag (advanced output).
|
|
162
171
|
verbose: {
|
|
163
172
|
type: "boolean",
|
|
164
173
|
description: t("cli.doctor.args.verbose.description"),
|
|
165
174
|
default: false
|
|
166
175
|
},
|
|
167
|
-
//
|
|
168
|
-
// inspections entirely — different output surface. Mutually exclusive
|
|
169
|
-
// with --fix / --fix-knowledge (enforced in run()).
|
|
176
|
+
// EPIC-009: hidden flags (report surfaces).
|
|
170
177
|
"cite-coverage": {
|
|
171
178
|
type: "boolean",
|
|
172
179
|
description: t("cli.doctor.args.cite-coverage.description"),
|
|
@@ -181,20 +188,14 @@ var doctorCommand = defineCommand({
|
|
|
181
188
|
type: "string",
|
|
182
189
|
description: t("cli.doctor.args.client.description"),
|
|
183
190
|
default: "all",
|
|
184
|
-
valueHint: "cc|codex|
|
|
191
|
+
valueHint: "cc|codex|all"
|
|
185
192
|
},
|
|
186
|
-
// v2.0.0-rc.24 TASK-10: --layer filter for the cite contract audit. Pairs
|
|
187
|
-
// with --cite-coverage. Validated against {'team','personal','all'} at
|
|
188
|
-
// command entry; rejects 'both' (rc.20 plan-context vocabulary) explicitly.
|
|
189
193
|
layer: {
|
|
190
194
|
type: "string",
|
|
191
195
|
description: t("cli.doctor.args.layer.description"),
|
|
192
196
|
default: "all",
|
|
193
197
|
valueHint: "team|personal|all"
|
|
194
198
|
},
|
|
195
|
-
// rc.23 TASK-007 (a-C2): description-grade back-fill flag set. Read-side
|
|
196
|
-
// by default; `--auto` flips the writer arm on. Mutually exclusive with
|
|
197
|
-
// --fix / --fix-knowledge / --cite-coverage (different mutation surfaces).
|
|
198
199
|
"enrich-descriptions": {
|
|
199
200
|
type: "boolean",
|
|
200
201
|
description: t("cli.doctor.args.enrich-descriptions.description"),
|
|
@@ -210,25 +211,16 @@ var doctorCommand = defineCommand({
|
|
|
210
211
|
description: t("cli.doctor.args.dry-run.description"),
|
|
211
212
|
default: false
|
|
212
213
|
},
|
|
213
|
-
// v2.0.0-rc.25 TASK-10: --archive-history flag (parallel to rc.20
|
|
214
|
-
// --cite-coverage). Read-only; reads session_archive_attempted events
|
|
215
|
-
// and renders a per-session table. Pairs with the shared `--since` flag.
|
|
216
214
|
"archive-history": {
|
|
217
215
|
type: "boolean",
|
|
218
216
|
description: t("cli.doctor.args.archive-history.description"),
|
|
219
217
|
default: false
|
|
220
218
|
},
|
|
221
|
-
// rc.37 NEW-33: unified history view across archive / fix / all surfaces.
|
|
222
|
-
// Mode = `archive | fix | all` (the `archive` mode delegates to the
|
|
223
|
-
// existing runDoctorArchiveHistory; `fix` aggregates doctor_run events;
|
|
224
|
-
// `all` rolls up both into a per-day count table). Read-only; mutex
|
|
225
|
-
// with the mutation arms.
|
|
226
219
|
history: {
|
|
227
220
|
type: "string",
|
|
228
221
|
description: t("cli.doctor.args.history.description"),
|
|
229
222
|
valueHint: "archive|fix|all"
|
|
230
223
|
},
|
|
231
|
-
// v2.1 ④ conflict-detection (P4): knowledge-conflict lint surface.
|
|
232
224
|
"lint-conflicts": {
|
|
233
225
|
type: "boolean",
|
|
234
226
|
description: t("cli.doctor.args.lint-conflicts.description"),
|
|
@@ -238,6 +230,12 @@ var doctorCommand = defineCommand({
|
|
|
238
230
|
type: "boolean",
|
|
239
231
|
description: t("cli.doctor.args.deep.description"),
|
|
240
232
|
default: false
|
|
233
|
+
},
|
|
234
|
+
// EPIC-009: hidden flag (strict mode for CI).
|
|
235
|
+
strict: {
|
|
236
|
+
type: "boolean",
|
|
237
|
+
description: t("cli.doctor.args.strict.description"),
|
|
238
|
+
default: false
|
|
241
239
|
}
|
|
242
240
|
},
|
|
243
241
|
async run({ args }) {
|
|
@@ -415,6 +413,8 @@ var doctorCommand = defineCommand({
|
|
|
415
413
|
}
|
|
416
414
|
let fixKnowledgeReport = null;
|
|
417
415
|
let fixReport = null;
|
|
416
|
+
let unboundProjectFix = null;
|
|
417
|
+
let rootConfigMigration = null;
|
|
418
418
|
let report;
|
|
419
419
|
if (fixKnowledge) {
|
|
420
420
|
const preReport = await runDoctorReport(resolution.target);
|
|
@@ -447,6 +447,8 @@ var doctorCommand = defineCommand({
|
|
|
447
447
|
if (args["dry-run"] === true) {
|
|
448
448
|
report = await runDoctorReport(resolution.target);
|
|
449
449
|
} else {
|
|
450
|
+
rootConfigMigration = migrateRootConfig(resolution.target);
|
|
451
|
+
unboundProjectFix = await backfillUnboundProject(resolution.target);
|
|
450
452
|
fixReport = await runDoctorFix(resolution.target);
|
|
451
453
|
report = fixReport.report;
|
|
452
454
|
syncStoreAliasLinks();
|
|
@@ -458,7 +460,12 @@ var doctorCommand = defineCommand({
|
|
|
458
460
|
if (args.json === true) {
|
|
459
461
|
writeStdout(
|
|
460
462
|
JSON.stringify(
|
|
461
|
-
{
|
|
463
|
+
{
|
|
464
|
+
...fixKnowledgeReport ?? fixReport ?? report,
|
|
465
|
+
store_diagnostics: storeDiagnostics,
|
|
466
|
+
...unboundProjectFix === null ? {} : { unbound_project_fix: unboundProjectFix },
|
|
467
|
+
...rootConfigMigration?.migrated === true ? { root_config_migration: rootConfigMigration } : {}
|
|
468
|
+
},
|
|
462
469
|
null,
|
|
463
470
|
2
|
|
464
471
|
)
|
|
@@ -472,6 +479,19 @@ var doctorCommand = defineCommand({
|
|
|
472
479
|
renderFixKnowledgeMutations(fixKnowledgeReport, dt);
|
|
473
480
|
} else if (fixReport !== null) {
|
|
474
481
|
writeStdout(fixReport.message);
|
|
482
|
+
if (unboundProjectFix !== null) {
|
|
483
|
+
writeStdout(
|
|
484
|
+
dt("cli.doctor.unbound-project-backfilled", {
|
|
485
|
+
alias: unboundProjectFix.alias,
|
|
486
|
+
project: unboundProjectFix.active_project
|
|
487
|
+
})
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
if (rootConfigMigration?.migrated === true) {
|
|
491
|
+
writeStdout(
|
|
492
|
+
`config: migrated legacy root fabric.config.json \u2192 .fabric/fabric-config.json${rootConfigMigration.mergedKeys.length > 0 ? ` (merged: ${rootConfigMigration.mergedKeys.join(", ")})` : ""}`
|
|
493
|
+
);
|
|
494
|
+
}
|
|
475
495
|
} else if ((fix || fixKnowledge) && args["dry-run"] === true) {
|
|
476
496
|
writeStdout(dt("cli.doctor.fix-dry-run-banner"));
|
|
477
497
|
}
|
|
@@ -503,6 +523,9 @@ function renderHumanReport(report, dt, verbose) {
|
|
|
503
523
|
writeStdout(`${renderStatus(report.status)} ${paint.ai("fabric doctor")} ${paint.human(report.summary.target)}`);
|
|
504
524
|
renderTldrHeader(report, dt, verbose);
|
|
505
525
|
for (const check of report.checks) {
|
|
526
|
+
if (!verbose && check.status === "ok") {
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
506
529
|
writeStdout(`${renderStatus(check.status)} ${check.name}: ${check.message}`);
|
|
507
530
|
}
|
|
508
531
|
const opts = { verbose, dt };
|
|
@@ -525,7 +548,7 @@ function renderStoreDiagnostics(diagnostics) {
|
|
|
525
548
|
writeStdout("");
|
|
526
549
|
writeStdout(paint.ai("store health"));
|
|
527
550
|
for (const diagnostic of diagnostics) {
|
|
528
|
-
const mark = diagnostic.severity === "warn" ? symbol.warn : "[info]";
|
|
551
|
+
const mark = diagnostic.severity === "error" ? symbol.error : diagnostic.severity === "warn" ? symbol.warn : "[info]";
|
|
529
552
|
const ref = diagnostic.ref === void 0 ? "" : ` [${diagnostic.ref}]`;
|
|
530
553
|
writeStdout(`${mark}${ref} ${diagnostic.message}`);
|
|
531
554
|
}
|
|
@@ -705,7 +728,6 @@ async function resolveFixKnowledgeConsent(options) {
|
|
|
705
728
|
var CITE_COVERAGE_CLIENT_FILTERS = /* @__PURE__ */ new Set([
|
|
706
729
|
"cc",
|
|
707
730
|
"codex",
|
|
708
|
-
"cursor",
|
|
709
731
|
"all"
|
|
710
732
|
]);
|
|
711
733
|
function isValidClientFilter(input) {
|
|
@@ -1036,9 +1058,39 @@ function formatTimestampForTable(iso) {
|
|
|
1036
1058
|
d.getUTCHours()
|
|
1037
1059
|
)}:${pad(d.getUTCMinutes())}`;
|
|
1038
1060
|
}
|
|
1061
|
+
function renderDoctorFilteredHelp() {
|
|
1062
|
+
const lines = [];
|
|
1063
|
+
lines.push(paint.ai("fabric doctor") + " \u2014 Diagnose and fix Fabric workspace issues");
|
|
1064
|
+
lines.push("");
|
|
1065
|
+
lines.push(`${paint.human("USAGE")}`);
|
|
1066
|
+
lines.push(` fabric doctor [OPTIONS]`);
|
|
1067
|
+
lines.push("");
|
|
1068
|
+
lines.push(`${paint.human("OPTIONS")}`);
|
|
1069
|
+
lines.push("");
|
|
1070
|
+
const exposedOptions = [
|
|
1071
|
+
["--target <path>", "Override project root (defaults to cwd)"],
|
|
1072
|
+
["--fix", "Auto-fix derived-state issues (agents.meta.json)"],
|
|
1073
|
+
["--fix-knowledge", "Auto-fix knowledge entry issues (frontmatter + git mv)"],
|
|
1074
|
+
["--json", "Output as JSON for programmatic consumption"],
|
|
1075
|
+
["--verbose", "Show maintainer-audience action hints"]
|
|
1076
|
+
];
|
|
1077
|
+
for (const [flag, desc] of exposedOptions) {
|
|
1078
|
+
lines.push(` ${paint.ai(flag)} ${desc}`);
|
|
1079
|
+
}
|
|
1080
|
+
lines.push("");
|
|
1081
|
+
lines.push(`${paint.human("EXAMPLES")}`);
|
|
1082
|
+
lines.push(` ${paint.ai("fabric doctor")} # Run diagnostics`);
|
|
1083
|
+
lines.push(` ${paint.ai("fabric doctor --fix")} # Fix derived-state issues`);
|
|
1084
|
+
lines.push(` ${paint.ai("fabric doctor --fix-knowledge")} # Fix knowledge entry issues`);
|
|
1085
|
+
lines.push("");
|
|
1086
|
+
lines.push(paint.human("Run `fabric doctor` to see a full diagnostic report with 48 checks."));
|
|
1087
|
+
writeStdout(lines.join("\n"));
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1039
1090
|
export {
|
|
1040
|
-
doctor_default as default,
|
|
1041
1091
|
doctorCommand,
|
|
1092
|
+
doctor_default,
|
|
1093
|
+
renderTldrHeader,
|
|
1042
1094
|
parseSinceDuration,
|
|
1043
|
-
|
|
1095
|
+
renderDoctorFilteredHelp
|
|
1044
1096
|
};
|
|
@@ -11,7 +11,7 @@ function isColorEnabled() {
|
|
|
11
11
|
if (force !== void 0) {
|
|
12
12
|
return force !== "0" && force.toLowerCase() !== "false";
|
|
13
13
|
}
|
|
14
|
-
return Boolean(process.stdout.isTTY)
|
|
14
|
+
return Boolean(process.stdout.isTTY);
|
|
15
15
|
}
|
|
16
16
|
function colorize(painter) {
|
|
17
17
|
return (value) => isColorEnabled() ? painter(value) : value;
|
|
@@ -27,30 +27,17 @@ var paint = {
|
|
|
27
27
|
};
|
|
28
28
|
var symbol = {
|
|
29
29
|
get ok() {
|
|
30
|
-
return isColorEnabled() ? paint.success("\u2713") : "[ok]";
|
|
30
|
+
return isColorEnabled() ? paint.success("[ok] \u2713") : "[ok]";
|
|
31
31
|
},
|
|
32
32
|
get warn() {
|
|
33
|
-
return isColorEnabled() ? paint.warn("!") : "[warn]";
|
|
33
|
+
return isColorEnabled() ? paint.warn("[warn] !") : "[warn]";
|
|
34
34
|
},
|
|
35
35
|
get error() {
|
|
36
|
-
return isColorEnabled() ? paint.error("x") : "[error]";
|
|
36
|
+
return isColorEnabled() ? paint.error("[error] x") : "[error]";
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
function displayWidth(value) {
|
|
40
|
-
return stringWidth(value);
|
|
41
|
-
}
|
|
42
|
-
function padEnd(value, width, char = " ") {
|
|
43
|
-
const fill = char.length > 0 ? char : " ";
|
|
44
|
-
let result = value;
|
|
45
|
-
while (displayWidth(result) < width) {
|
|
46
|
-
result += fill;
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
39
|
|
|
51
40
|
export {
|
|
52
41
|
paint,
|
|
53
|
-
symbol
|
|
54
|
-
displayWidth,
|
|
55
|
-
padEnd
|
|
42
|
+
symbol
|
|
56
43
|
};
|
|
@@ -3,12 +3,17 @@ import {
|
|
|
3
3
|
buildResolveInput
|
|
4
4
|
} from "./chunk-EOT63RDH.js";
|
|
5
5
|
import {
|
|
6
|
-
loadProjectConfig
|
|
6
|
+
loadProjectConfig
|
|
7
|
+
} from "./chunk-QFIVFZRH.js";
|
|
8
|
+
import {
|
|
7
9
|
resolveGlobalRoot
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FNHDQTPC.js";
|
|
9
11
|
|
|
10
12
|
// src/store/bindings-io.ts
|
|
11
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
resolveWorkspaceBindingId,
|
|
15
|
+
writeBindingsSnapshot
|
|
16
|
+
} from "@fenglimg/fabric-shared";
|
|
12
17
|
var DEFAULT_WRITE_SCOPE = "team";
|
|
13
18
|
function regenerateBindingsSnapshot(projectRoot, options) {
|
|
14
19
|
const globalRoot = options.globalRoot ?? resolveGlobalRoot();
|
|
@@ -20,9 +25,14 @@ function regenerateBindingsSnapshot(projectRoot, options) {
|
|
|
20
25
|
if (project?.project_id === void 0) {
|
|
21
26
|
return null;
|
|
22
27
|
}
|
|
28
|
+
const workspaceBindingId = resolveWorkspaceBindingId(project);
|
|
29
|
+
if (workspaceBindingId === void 0) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
23
32
|
return writeBindingsSnapshot({
|
|
24
33
|
globalRoot,
|
|
25
34
|
projectId: project.project_id,
|
|
35
|
+
workspaceBindingId,
|
|
26
36
|
resolveInput,
|
|
27
37
|
writeScope: options.writeScope ?? DEFAULT_WRITE_SCOPE,
|
|
28
38
|
now: options.now
|