@fenglimg/fabric-cli 2.2.0-rc.4 → 2.2.0-rc.9

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.
Files changed (73) hide show
  1. package/README.md +8 -5
  2. package/dist/{chunk-5JG4QJLO.js → chunk-27HK6H5Y.js} +10 -5
  3. package/dist/{chunk-F6ITRM7T.js → chunk-2KBCTMID.js} +29 -6
  4. package/dist/chunk-3D7B2UAZ.js +149 -0
  5. package/dist/{chunk-XC5RUHLK.js → chunk-3IOLS5EK.js} +23 -38
  6. package/dist/{chunk-XHHCRDIR.js → chunk-7ZDXBOOU.js} +174 -211
  7. package/dist/{doctor-U5W4CX5I.js → chunk-E7HJUU34.js} +103 -51
  8. package/dist/{chunk-XCBVSGCS.js → chunk-FNHDQTPC.js} +1 -10
  9. package/dist/{chunk-2CY4BMTH.js → chunk-HORSMSZL.js} +9 -5
  10. package/dist/{chunk-BO4XIZWZ.js → chunk-NLNH64A3.js} +5 -18
  11. package/dist/{chunk-H3FE6VIK.js → chunk-PTGQAZEW.js} +13 -3
  12. package/dist/chunk-QFIVFZRH.js +13 -0
  13. package/dist/{chunk-5SSNE5GM.js → chunk-QPAW6IYT.js} +125 -39
  14. package/dist/{chunk-COI5VDFU.js → chunk-WA3DYGSY.js} +1 -2
  15. package/dist/{plan-context-hint-CHVZGOZ5.js → chunk-YM4XATJF.js} +29 -4
  16. package/dist/{config-VJMXCLXW.js → config-A3LTECAY.js} +4 -3
  17. package/dist/context-7NUKXDB6.js +117 -0
  18. package/dist/doctor-MDTZWKBK.js +24 -0
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +131 -21
  21. package/dist/info-7FKBTMVO.js +139 -0
  22. package/dist/install-v2-I6PJ6IFT.js +3279 -0
  23. package/dist/{metrics-RER6NLFC.js → metrics-HMFH4YHK.js} +1 -1
  24. package/dist/{onboard-coverage-JWQWDZW7.js → onboard-coverage-XSG77LL3.js} +48 -27
  25. package/dist/plan-context-hint-G75R4P4J.js +12 -0
  26. package/dist/{scope-explain-BWRWBCCP.js → scope-explain-HLJZ2M33.js} +3 -2
  27. package/dist/{status-7UFLWRX7.js → status-4R3TM4FJ.js} +8 -5
  28. package/dist/{store-ZEZMQVG7.js → store-HOCORVL3.js} +96 -350
  29. package/dist/{sync-EA5HZMXM.js → sync-DT5UJMMR.js} +36 -13
  30. package/dist/{uninstall-F75MPKQC.js → uninstall-IFN2KYBK.js} +71 -140
  31. package/dist/{whoami-3FRWYGML.js → whoami-ITGEFWH4.js} +9 -7
  32. package/package.json +7 -5
  33. package/templates/hooks/cite-policy-evict.cjs +5 -5
  34. package/templates/hooks/configs/README.md +14 -27
  35. package/templates/hooks/configs/claude-code.json +1 -1
  36. package/templates/hooks/configs/codex-hooks.json +3 -3
  37. package/templates/hooks/fabric-hint.cjs +326 -161
  38. package/templates/hooks/knowledge-hint-broad.cjs +431 -271
  39. package/templates/hooks/knowledge-hint-narrow.cjs +64 -77
  40. package/templates/hooks/lib/banner-i18n.cjs +31 -0
  41. package/templates/hooks/lib/bindings-snapshot-reader.cjs +118 -7
  42. package/templates/hooks/lib/cite-line-parser.cjs +12 -20
  43. package/templates/hooks/lib/client-adapter.cjs +66 -7
  44. package/templates/hooks/lib/nudge-policy.cjs +117 -0
  45. package/templates/hooks/lib/state-store.cjs +60 -0
  46. package/templates/hooks/post-tooluse-mutation.cjs +112 -11
  47. package/templates/skills/fabric/SKILL.md +100 -0
  48. package/templates/skills/fabric-archive/SKILL.md +29 -26
  49. package/templates/skills/fabric-archive/ref/dry-run-scope.md +1 -1
  50. package/templates/skills/fabric-archive/ref/i18n-policy.md +2 -3
  51. package/templates/skills/fabric-archive/ref/phase-1-5-onboard.md +2 -3
  52. package/templates/skills/fabric-archive/ref/phase-1-cross-session.md +1 -1
  53. package/templates/skills/fabric-archive/ref/phase-2-5-viability.md +1 -1
  54. package/templates/skills/fabric-archive/ref/phase-3-6-related-edges.md +18 -0
  55. package/templates/skills/fabric-archive/ref/phase-3-7-semantic-scope.md +47 -0
  56. package/templates/skills/fabric-audit/SKILL.md +13 -3
  57. package/templates/skills/fabric-connect/SKILL.md +3 -3
  58. package/templates/skills/fabric-import/SKILL.md +7 -7
  59. package/templates/skills/fabric-import/ref/i18n-policy.md +2 -3
  60. package/templates/skills/fabric-import/ref/state-recovery.md +1 -2
  61. package/templates/skills/fabric-review/SKILL.md +5 -5
  62. package/templates/skills/fabric-review/ref/cite-contract.md +1 -1
  63. package/templates/skills/fabric-review/ref/i18n-policy.md +2 -3
  64. package/templates/skills/fabric-review/ref/output-contract.md +1 -1
  65. package/templates/skills/fabric-review/ref/per-mode-flows.md +2 -2
  66. package/templates/skills/fabric-review/ref/worked-examples.md +1 -1
  67. package/templates/skills/fabric-store/SKILL.md +1 -1
  68. package/templates/skills/fabric-sync/SKILL.md +1 -1
  69. package/templates/skills/lib/shared-policy.md +2 -2
  70. package/dist/install-7XJ64WSC.js +0 -2743
  71. package/templates/hooks/configs/cursor-hooks.json +0 -30
  72. package/templates/hooks/lib/cite-contract-reminder.cjs +0 -179
  73. package/templates/hooks/lib/summary-fallback.cjs +0 -210
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getProjectTranslator
4
- } from "./chunk-2CY4BMTH.js";
4
+ } from "./chunk-HORSMSZL.js";
5
5
 
6
6
  // src/commands/metrics.ts
7
7
  import { resolve } from "path";
@@ -1,15 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-2CY4BMTH.js";
4
+ } from "./chunk-HORSMSZL.js";
5
5
 
6
6
  // src/commands/onboard-coverage.ts
7
- import { existsSync, readdirSync, readFileSync } from "fs";
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 runOnboardCoverage(projectRoot) {
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 knowledgeRoot = join(projectRoot, ".fabric", "knowledge");
103
- if (existsSync(knowledgeRoot)) {
104
- for (const typeDir of KNOWLEDGE_TYPE_DIRS) {
105
- const dir = join(knowledgeRoot, typeDir);
106
- if (!existsSync(dir)) continue;
107
- let entries;
108
- try {
109
- entries = readdirSync(dir, { withFileTypes: true });
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-2CY4BMTH.js";
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: "Explain the resolved read-set and write target for a scope"
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-5JG4QJLO.js";
6
- import "./chunk-5SSNE5GM.js";
7
- import "./chunk-XCBVSGCS.js";
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: "Show this project's Fabric store status" },
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(`active write: ${status.active_write_store ?? "(none \u2014 personal scope only)"}`);
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 {