@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
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
t
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HORSMSZL.js";
|
|
5
5
|
|
|
6
6
|
// src/commands/onboard-coverage.ts
|
|
7
|
-
import { existsSync,
|
|
7
|
+
import { existsSync, readFileSync } from "fs";
|
|
8
8
|
import { join, resolve } from "path";
|
|
9
9
|
import { defineCommand } from "citty";
|
|
10
10
|
import {
|
|
11
|
+
buildStoreResolveInput,
|
|
12
|
+
createStoreResolver,
|
|
11
13
|
ONBOARD_SLOT_NAMES,
|
|
12
|
-
ONBOARD_SLOT_TOTAL
|
|
14
|
+
ONBOARD_SLOT_TOTAL,
|
|
15
|
+
readKnowledgeAcrossStores,
|
|
16
|
+
resolveGlobalRoot,
|
|
17
|
+
storeRelativePathForMount
|
|
13
18
|
} from "@fenglimg/fabric-shared";
|
|
14
19
|
var KNOWLEDGE_TYPE_DIRS = [
|
|
15
20
|
"decisions",
|
|
@@ -97,30 +102,46 @@ function readOptedOutSlots(projectRoot) {
|
|
|
97
102
|
if (!Array.isArray(slots)) return [];
|
|
98
103
|
return slots.filter((v) => typeof v === "string");
|
|
99
104
|
}
|
|
100
|
-
function
|
|
105
|
+
function readSetStoreDirs(projectRoot) {
|
|
106
|
+
let input;
|
|
107
|
+
try {
|
|
108
|
+
input = buildStoreResolveInput(projectRoot);
|
|
109
|
+
} catch {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
if (input === null) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
const readSet = createStoreResolver().resolveReadSet(input);
|
|
116
|
+
const globalRoot = resolveGlobalRoot();
|
|
117
|
+
return readSet.stores.map((store) => ({
|
|
118
|
+
store_uuid: store.store_uuid,
|
|
119
|
+
alias: store.alias,
|
|
120
|
+
// D4 two-layer layout: resolve via the mounted record (group + label), not
|
|
121
|
+
// the single-segment uuid path — mirrors the other read-set consumers.
|
|
122
|
+
dir: join(
|
|
123
|
+
globalRoot,
|
|
124
|
+
storeRelativePathForMount(
|
|
125
|
+
input.mountedStores.find((s) => s.store_uuid === store.store_uuid) ?? {
|
|
126
|
+
store_uuid: store.store_uuid
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
function entryName(filePath) {
|
|
133
|
+
return filePath.split(/[\\/]/u).at(-1) ?? filePath;
|
|
134
|
+
}
|
|
135
|
+
async function runOnboardCoverage(projectRoot) {
|
|
101
136
|
const filled = emptyFilled();
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} catch {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
for (const entry of entries) {
|
|
114
|
-
if (!entry.isFile()) continue;
|
|
115
|
-
if (!entry.name.endsWith(".md")) continue;
|
|
116
|
-
const filePath = join(dir, entry.name);
|
|
117
|
-
const slot = readOnboardSlotFrontmatter(filePath);
|
|
118
|
-
if (slot === void 0) continue;
|
|
119
|
-
if (!ONBOARD_SLOT_NAMES.includes(slot)) continue;
|
|
120
|
-
const stableId = readStableIdFrontmatter(filePath, entry.name);
|
|
121
|
-
filled[slot].push(stableId);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
137
|
+
const refs = await readKnowledgeAcrossStores(readSetStoreDirs(projectRoot));
|
|
138
|
+
for (const ref of refs) {
|
|
139
|
+
if (!KNOWLEDGE_TYPE_DIRS.includes(ref.type)) continue;
|
|
140
|
+
const slot = readOnboardSlotFrontmatter(ref.file);
|
|
141
|
+
if (slot === void 0) continue;
|
|
142
|
+
if (!ONBOARD_SLOT_NAMES.includes(slot)) continue;
|
|
143
|
+
const stableId = readStableIdFrontmatter(ref.file, entryName(ref.file));
|
|
144
|
+
filled[slot].push(ref.alias.length === 0 ? stableId : `${ref.alias}:${stableId}`);
|
|
124
145
|
}
|
|
125
146
|
const optedOut = readOptedOutSlots(projectRoot);
|
|
126
147
|
const missing = ONBOARD_SLOT_NAMES.filter((slot) => {
|
|
@@ -196,7 +217,7 @@ var onboardCoverageCommand = defineCommand({
|
|
|
196
217
|
async run({ args }) {
|
|
197
218
|
try {
|
|
198
219
|
const projectRoot = resolve(args.target ?? process.cwd());
|
|
199
|
-
const report = runOnboardCoverage(projectRoot);
|
|
220
|
+
const report = await runOnboardCoverage(projectRoot);
|
|
200
221
|
if (args.json === true) {
|
|
201
222
|
process.stdout.write(`${JSON.stringify(report)}
|
|
202
223
|
`);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
planContextHintCommand,
|
|
4
|
+
plan_context_hint_default,
|
|
5
|
+
runPlanContextHint
|
|
6
|
+
} from "./chunk-YM4XATJF.js";
|
|
7
|
+
import "./chunk-WA3DYGSY.js";
|
|
8
|
+
export {
|
|
9
|
+
plan_context_hint_default as default,
|
|
10
|
+
planContextHintCommand,
|
|
11
|
+
runPlanContextHint
|
|
12
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-EOT63RDH.js";
|
|
5
5
|
import {
|
|
6
6
|
getProjectTranslator
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HORSMSZL.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/scope-explain.ts
|
|
10
10
|
import { defineCommand } from "citty";
|
|
@@ -12,7 +12,7 @@ import { FabricError } from "@fenglimg/fabric-shared/errors";
|
|
|
12
12
|
var scope_explain_default = defineCommand({
|
|
13
13
|
meta: {
|
|
14
14
|
name: "scope-explain",
|
|
15
|
-
description: "
|
|
15
|
+
description: "[DEPRECATED] Use 'fabric info scope <path>' instead"
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
18
18
|
scope: {
|
|
@@ -22,6 +22,7 @@ var scope_explain_default = defineCommand({
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
run({ args }) {
|
|
25
|
+
console.error("\u26A0\uFE0F DEPRECATED: 'fabric scope-explain' is deprecated. Use 'fabric info scope <path>' instead.");
|
|
25
26
|
const projectRoot = process.cwd();
|
|
26
27
|
let result;
|
|
27
28
|
try {
|
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
import {
|
|
3
3
|
projectStatus,
|
|
4
4
|
warnUnknownFlags
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-27HK6H5Y.js";
|
|
6
|
+
import "./chunk-QPAW6IYT.js";
|
|
7
|
+
import "./chunk-QFIVFZRH.js";
|
|
8
|
+
import "./chunk-FNHDQTPC.js";
|
|
8
9
|
|
|
9
10
|
// src/commands/status.ts
|
|
10
11
|
import { defineCommand } from "citty";
|
|
11
12
|
var status_default = defineCommand({
|
|
12
|
-
meta: { name: "status", description: "
|
|
13
|
+
meta: { name: "status", description: "[DEPRECATED] Use 'fabric info' instead" },
|
|
13
14
|
args: {
|
|
14
15
|
// F27: `--json` machine-readable output (was silently ignored pre-F27).
|
|
15
16
|
json: { type: "boolean", description: "Emit machine-readable JSON instead of text" }
|
|
16
17
|
},
|
|
17
18
|
run({ args }) {
|
|
18
19
|
warnUnknownFlags(["json"]);
|
|
20
|
+
console.error("\u26A0\uFE0F DEPRECATED: 'fabric status' is deprecated. Use 'fabric info' instead.");
|
|
19
21
|
const status = projectStatus(process.cwd());
|
|
20
22
|
if (args.json === true) {
|
|
21
23
|
console.log(JSON.stringify(status, null, 2));
|
|
@@ -26,7 +28,8 @@ var status_default = defineCommand({
|
|
|
26
28
|
console.log(`project_id: ${projectIdLabel}`);
|
|
27
29
|
console.log(`mounted stores: ${status.mounted.length > 0 ? status.mounted.join(", ") : "(none)"}`);
|
|
28
30
|
console.log(`required: ${status.required.length > 0 ? status.required.join(", ") : "(none)"}`);
|
|
29
|
-
console.log(`
|
|
31
|
+
console.log(`default write: ${status.default_write_store ?? status.active_write_store ?? "(none \u2014 personal scope only)"}`);
|
|
32
|
+
console.log(`write routes: ${status.write_routes.length}`);
|
|
30
33
|
}
|
|
31
34
|
});
|
|
32
35
|
export {
|