@fenglimg/fabric-cli 2.0.0 → 2.1.0-rc.2

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 (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -5
  3. package/dist/chunk-BATF4PEJ.js +361 -0
  4. package/dist/{chunk-OBQU6NHO.js → chunk-COI5VDFU.js} +0 -18
  5. package/dist/chunk-F46ORPOA.js +903 -0
  6. package/dist/chunk-HFQVXY6P.js +86 -0
  7. package/dist/chunk-L4Q55UC4.js +52 -0
  8. package/dist/chunk-LFIKMVY7.js +27 -0
  9. package/dist/chunk-MF3OTILQ.js +544 -0
  10. package/dist/chunk-PWLW3B57.js +18 -0
  11. package/dist/chunk-RYAFBNES.js +33 -0
  12. package/dist/chunk-T5RPGCCM.js +40 -0
  13. package/dist/chunk-WU6GAPKH.js +36 -0
  14. package/dist/config-XJIPZNUP.js +13 -0
  15. package/dist/doctor-QVNPHLJK.js +920 -0
  16. package/dist/index.js +23 -8
  17. package/dist/{init-BIRSIOXO.js → install-2HDO5FTQ.js} +807 -705
  18. package/dist/metrics-ACEQFPDU.js +122 -0
  19. package/dist/onboard-coverage-MFCAEBDO.js +220 -0
  20. package/dist/{plan-context-hint-QMUPAXIB.js → plan-context-hint-FC6P3WFE.js} +34 -28
  21. package/dist/scope-explain-2F2R5URO.js +33 -0
  22. package/dist/status-GLQWLWH6.js +23 -0
  23. package/dist/store-XTSE5TY6.js +105 -0
  24. package/dist/sync-BJCWDPNC.js +245 -0
  25. package/dist/uninstall-TAXSUSKH.js +1073 -0
  26. package/dist/whoami-B6AEMSEV.js +31 -0
  27. package/package.json +30 -5
  28. package/templates/hooks/cite-policy-evict.cjs +231 -0
  29. package/templates/hooks/configs/README.md +29 -6
  30. package/templates/hooks/configs/claude-code.json +14 -3
  31. package/templates/hooks/configs/codex-hooks.json +6 -3
  32. package/templates/hooks/configs/cursor-hooks.json +8 -10
  33. package/templates/hooks/fabric-hint.cjs +873 -105
  34. package/templates/hooks/knowledge-hint-broad.cjs +549 -135
  35. package/templates/hooks/knowledge-hint-narrow.cjs +830 -26
  36. package/templates/hooks/lib/banner-i18n.cjs +309 -0
  37. package/templates/hooks/lib/bindings-snapshot-reader.cjs +81 -0
  38. package/templates/hooks/lib/cite-contract-reminder.cjs +179 -0
  39. package/templates/hooks/lib/cite-line-parser.cjs +180 -0
  40. package/templates/hooks/lib/client-adapter.cjs +106 -0
  41. package/templates/hooks/lib/config-cache.cjs +107 -0
  42. package/templates/hooks/lib/state-store.cjs +84 -0
  43. package/templates/hooks/lib/summary-fallback.cjs +210 -0
  44. package/templates/skills/fabric-archive/SKILL.md +97 -419
  45. package/templates/skills/fabric-archive/ref/dry-run-scope.md +16 -0
  46. package/templates/skills/fabric-archive/ref/e5-cron-recap.md +58 -0
  47. package/templates/skills/fabric-archive/ref/i18n-policy.md +86 -0
  48. package/templates/skills/fabric-archive/ref/phase-0-range-resolution.md +156 -0
  49. package/templates/skills/fabric-archive/ref/phase-1-5-onboard.md +218 -0
  50. package/templates/skills/fabric-archive/ref/phase-1-cross-session.md +62 -0
  51. package/templates/skills/fabric-archive/ref/phase-2-5-viability.md +68 -0
  52. package/templates/skills/fabric-archive/ref/phase-3-5-scope.md +108 -0
  53. package/templates/skills/fabric-archive/ref/phase-3-classify.md +63 -0
  54. package/templates/skills/fabric-archive/ref/phase-4-5-emit.md +78 -0
  55. package/templates/skills/fabric-archive/ref/phase-4-mcp-persist.md +89 -0
  56. package/templates/skills/fabric-archive/ref/rc-history.md +38 -0
  57. package/templates/skills/fabric-archive/ref/worked-examples.md +78 -0
  58. package/templates/skills/fabric-import/SKILL.md +77 -514
  59. package/templates/skills/fabric-import/ref/checkpoint-state.md +85 -0
  60. package/templates/skills/fabric-import/ref/i18n-policy.md +79 -0
  61. package/templates/skills/fabric-import/ref/output-contract.md +61 -0
  62. package/templates/skills/fabric-import/ref/phase-2-mining.md +213 -0
  63. package/templates/skills/fabric-import/ref/phase-3-dedup.md +75 -0
  64. package/templates/skills/fabric-import/ref/state-recovery.md +57 -0
  65. package/templates/skills/fabric-import/ref/worked-examples.md +127 -0
  66. package/templates/skills/fabric-review/SKILL.md +90 -284
  67. package/templates/skills/fabric-review/ref/askuserquestion-policy.md +66 -0
  68. package/templates/skills/fabric-review/ref/i18n-policy.md +111 -0
  69. package/templates/skills/fabric-review/ref/modify-flow.md +103 -0
  70. package/templates/skills/fabric-review/ref/output-contract.md +58 -0
  71. package/templates/skills/fabric-review/ref/per-mode-flows.md +155 -0
  72. package/templates/skills/fabric-review/ref/semantic-check.md +26 -0
  73. package/templates/skills/fabric-review/ref/worked-examples.md +95 -0
  74. package/templates/skills/fabric-sync/SKILL.md +46 -0
  75. package/templates/skills/lib/shared-policy.md +69 -0
  76. package/dist/chunk-6ICJICVU.js +0 -10
  77. package/dist/chunk-74SZWYPH.js +0 -658
  78. package/dist/chunk-EYIDD2YS.js +0 -1000
  79. package/dist/doctor-T7JWODKG.js +0 -282
  80. package/dist/hooks-Y74Y5LQS.js +0 -12
  81. package/dist/scan-LMK3UCWL.js +0 -22
  82. package/dist/serve-H554BHLG.js +0 -124
  83. package/templates/agents-md/AGENTS.md.template +0 -59
  84. package/templates/bootstrap/CLAUDE.md +0 -8
  85. package/templates/bootstrap/codex-AGENTS-header.md +0 -6
  86. package/templates/bootstrap/cursor-fabric-bootstrap.mdc +0 -10
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/i18n.ts
4
+ import {
5
+ createTranslator,
6
+ detectNodeLocale,
7
+ resolveFabricLocale
8
+ } from "@fenglimg/fabric-shared";
9
+ var locale = detectNodeLocale();
10
+ var t = createTranslator(locale);
11
+ function getDoctorTranslator(projectRoot) {
12
+ return createTranslator(resolveFabricLocale(projectRoot));
13
+ }
14
+
15
+ export {
16
+ t,
17
+ getDoctorTranslator
18
+ };
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/store/global-config-io.ts
4
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
5
+ import { homedir } from "os";
6
+ import { join } from "path";
7
+ import { globalConfigSchema } from "@fenglimg/fabric-shared";
8
+ function resolveGlobalRoot() {
9
+ return join(process.env.FABRIC_HOME ?? homedir(), ".fabric");
10
+ }
11
+ function globalConfigPath(globalRoot = resolveGlobalRoot()) {
12
+ return join(globalRoot, "fabric-global.json");
13
+ }
14
+ function loadGlobalConfig(globalRoot = resolveGlobalRoot()) {
15
+ const path = globalConfigPath(globalRoot);
16
+ if (!existsSync(path)) {
17
+ return null;
18
+ }
19
+ return globalConfigSchema.parse(JSON.parse(readFileSync(path, "utf8")));
20
+ }
21
+ function saveGlobalConfig(config, globalRoot = resolveGlobalRoot()) {
22
+ const validated = globalConfigSchema.parse(config);
23
+ mkdirSync(globalRoot, { recursive: true });
24
+ writeFileSync(globalConfigPath(globalRoot), `${JSON.stringify(validated, null, 2)}
25
+ `, "utf8");
26
+ }
27
+
28
+ export {
29
+ resolveGlobalRoot,
30
+ globalConfigPath,
31
+ loadGlobalConfig,
32
+ saveGlobalConfig
33
+ };
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ loadProjectConfig
4
+ } from "./chunk-LFIKMVY7.js";
5
+ import {
6
+ loadGlobalConfig,
7
+ resolveGlobalRoot
8
+ } from "./chunk-RYAFBNES.js";
9
+
10
+ // src/store/info-ops.ts
11
+ function whoami(globalRoot = resolveGlobalRoot()) {
12
+ const config = loadGlobalConfig(globalRoot);
13
+ if (config === null) {
14
+ return null;
15
+ }
16
+ return {
17
+ uid: config.uid,
18
+ stores: config.stores.map((s) => ({
19
+ alias: s.alias,
20
+ store_uuid: s.store_uuid,
21
+ local_only: s.remote === void 0
22
+ }))
23
+ };
24
+ }
25
+ function projectStatus(projectRoot, globalRoot = resolveGlobalRoot()) {
26
+ const global = loadGlobalConfig(globalRoot);
27
+ const project = loadProjectConfig(projectRoot);
28
+ return {
29
+ uid: global?.uid ?? null,
30
+ mounted: (global?.stores ?? []).map((s) => s.alias),
31
+ project_id: project?.project_id ?? null,
32
+ required: (project?.required_stores ?? []).map((r) => r.id),
33
+ active_write_store: project?.active_write_store ?? null
34
+ };
35
+ }
36
+
37
+ export {
38
+ whoami,
39
+ projectStatus
40
+ };
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ buildResolveInput
4
+ } from "./chunk-L4Q55UC4.js";
5
+ import {
6
+ loadProjectConfig
7
+ } from "./chunk-LFIKMVY7.js";
8
+ import {
9
+ resolveGlobalRoot
10
+ } from "./chunk-RYAFBNES.js";
11
+
12
+ // src/store/bindings-io.ts
13
+ import { writeBindingsSnapshot } from "@fenglimg/fabric-shared";
14
+ var DEFAULT_WRITE_SCOPE = "team";
15
+ function regenerateBindingsSnapshot(projectRoot, options) {
16
+ const globalRoot = options.globalRoot ?? resolveGlobalRoot();
17
+ const resolveInput = buildResolveInput(projectRoot, globalRoot);
18
+ if (resolveInput === null) {
19
+ return null;
20
+ }
21
+ const project = loadProjectConfig(projectRoot);
22
+ if (project?.project_id === void 0) {
23
+ return null;
24
+ }
25
+ return writeBindingsSnapshot({
26
+ globalRoot,
27
+ projectId: project.project_id,
28
+ resolveInput,
29
+ writeScope: options.writeScope ?? DEFAULT_WRITE_SCOPE,
30
+ now: options.now
31
+ });
32
+ }
33
+
34
+ export {
35
+ regenerateBindingsSnapshot
36
+ };
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ configCmd,
4
+ config_default,
5
+ installMcpClients
6
+ } from "./chunk-BATF4PEJ.js";
7
+ import "./chunk-MF3OTILQ.js";
8
+ import "./chunk-PWLW3B57.js";
9
+ export {
10
+ configCmd,
11
+ config_default as default,
12
+ installMcpClients
13
+ };