@fenglimg/fabric-cli 2.0.0-rc.1 → 2.0.0-rc.11
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 +6 -6
- package/dist/{chunk-UHNP7T7W.js → chunk-5MQ52F42.js} +347 -86
- package/dist/chunk-6ICJICVU.js +10 -0
- package/dist/chunk-AW3G7ZH5.js +576 -0
- package/dist/chunk-HQLEHH4O.js +321 -0
- package/dist/{chunk-5LOYBXWD.js → chunk-OBQU6NHO.js} +2 -52
- package/dist/chunk-WPTA74BY.js +184 -0
- package/dist/chunk-WWNXR34K.js +49 -0
- package/dist/doctor-RILCO5OG.js +282 -0
- package/dist/hooks-NX32PPEN.js +13 -0
- package/dist/index.js +8 -5
- package/dist/{init-DRHUYHYA.js → init-C56PWHID.js} +225 -491
- package/dist/plan-context-hint-QMUPAXIB.js +98 -0
- package/dist/{scan-HU2EGITF.js → scan-66EKMNAY.js} +6 -2
- package/dist/{serve-3LXXSBFR.js → serve-NGLXHDYC.js} +8 -4
- package/dist/uninstall-DBAR2JBS.js +1082 -0
- package/package.json +3 -3
- package/templates/bootstrap/CLAUDE.md +1 -1
- package/templates/bootstrap/codex-AGENTS-header.md +1 -1
- package/templates/bootstrap/cursor-fabric-bootstrap.mdc +1 -1
- package/templates/hooks/configs/README.md +73 -0
- package/templates/hooks/configs/claude-code.json +37 -0
- package/templates/hooks/configs/codex-hooks.json +20 -0
- package/templates/hooks/configs/cursor-hooks.json +20 -0
- package/templates/hooks/fabric-hint.cjs +1337 -0
- package/templates/hooks/knowledge-hint-broad.cjs +612 -0
- package/templates/hooks/knowledge-hint-narrow.cjs +826 -0
- package/templates/hooks/lib/session-digest-writer.cjs +172 -0
- package/templates/skills/fabric-archive/SKILL.md +640 -0
- package/templates/skills/fabric-import/SKILL.md +850 -0
- package/templates/skills/fabric-review/SKILL.md +717 -0
- package/dist/doctor-DUHWLAYD.js +0 -98
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
resolveDevMode
|
|
4
|
+
} from "./chunk-OBQU6NHO.js";
|
|
5
|
+
|
|
6
|
+
// src/commands/plan-context-hint.ts
|
|
7
|
+
import { defineCommand } from "citty";
|
|
8
|
+
import { planContext } from "@fenglimg/fabric-server";
|
|
9
|
+
var ALL_PATHS_SENTINEL = "**";
|
|
10
|
+
var planContextHintCommand = defineCommand({
|
|
11
|
+
meta: {
|
|
12
|
+
name: "plan-context-hint",
|
|
13
|
+
description: "Emit versioned knowledge hint JSON to stdout. Used by rc.6 hooks and the fabric-import skill."
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
paths: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Comma-separated list of file paths to compute narrow hints for."
|
|
19
|
+
},
|
|
20
|
+
all: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
description: "Return the full broad+narrow set with no path filter.",
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
target: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Override the project root (defaults to cwd / dev-mode resolution)."
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
async run({ args }) {
|
|
31
|
+
try {
|
|
32
|
+
const output = await runPlanContextHint({
|
|
33
|
+
paths: parsePathsArg(args.paths),
|
|
34
|
+
all: args.all === true,
|
|
35
|
+
target: args.target
|
|
36
|
+
});
|
|
37
|
+
process.stdout.write(`${JSON.stringify(output)}
|
|
38
|
+
`);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
41
|
+
process.stderr.write(`plan-context-hint failed: ${message}
|
|
42
|
+
`);
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var plan_context_hint_default = planContextHintCommand;
|
|
48
|
+
async function runPlanContextHint(opts) {
|
|
49
|
+
const all = opts.all === true;
|
|
50
|
+
const explicitPaths = (opts.paths ?? []).filter((p) => p.length > 0);
|
|
51
|
+
const targetPaths = all ? [ALL_PATHS_SENTINEL] : explicitPaths.length > 0 ? explicitPaths : [ALL_PATHS_SENTINEL];
|
|
52
|
+
const resolution = resolveDevMode(opts.target, process.cwd());
|
|
53
|
+
const result = await planContext(resolution.target, {
|
|
54
|
+
paths: targetPaths
|
|
55
|
+
});
|
|
56
|
+
const sharedIndex = result.shared.description_index;
|
|
57
|
+
const narrowSource = all ? sharedIndex : (
|
|
58
|
+
// Path mode: union of per-entry description_index across requested
|
|
59
|
+
// paths, deduped by stable_id. This is identical to `shared` for L0/L1
|
|
60
|
+
// entries (always included) and additionally captures L2 entries whose
|
|
61
|
+
// scope_glob matches the requested path.
|
|
62
|
+
dedupeByStableId(result.entries.flatMap((entry) => entry.description_index))
|
|
63
|
+
);
|
|
64
|
+
const narrow = narrowSource.map((item) => ({
|
|
65
|
+
id: item.stable_id,
|
|
66
|
+
type: item.type ?? item.description.knowledge_type ?? "",
|
|
67
|
+
maturity: item.maturity ?? item.description.maturity ?? "",
|
|
68
|
+
summary: item.description.summary
|
|
69
|
+
}));
|
|
70
|
+
return {
|
|
71
|
+
version: 1,
|
|
72
|
+
revision_hash: result.revision_hash,
|
|
73
|
+
target_paths: targetPaths,
|
|
74
|
+
narrow,
|
|
75
|
+
broad_count: sharedIndex.length
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function parsePathsArg(raw) {
|
|
79
|
+
if (raw === void 0 || raw.length === 0) {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
return raw.split(",").map((part) => part.trim()).filter((part) => part.length > 0);
|
|
83
|
+
}
|
|
84
|
+
function dedupeByStableId(items) {
|
|
85
|
+
const seen = /* @__PURE__ */ new Set();
|
|
86
|
+
const result = [];
|
|
87
|
+
for (const item of items) {
|
|
88
|
+
if (seen.has(item.stable_id)) continue;
|
|
89
|
+
seen.add(item.stable_id);
|
|
90
|
+
result.push(item);
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
plan_context_hint_default as default,
|
|
96
|
+
planContextHintCommand,
|
|
97
|
+
runPlanContextHint
|
|
98
|
+
};
|
|
@@ -3,17 +3,21 @@ import {
|
|
|
3
3
|
__testing__,
|
|
4
4
|
createScanReport,
|
|
5
5
|
deriveTagsFromForensic,
|
|
6
|
+
detectExistingLanguage,
|
|
6
7
|
formatKnowledgeId,
|
|
7
8
|
runInitScan,
|
|
8
9
|
scanCommand,
|
|
9
10
|
scan_default
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-5MQ52F42.js";
|
|
12
|
+
import "./chunk-WWNXR34K.js";
|
|
13
|
+
import "./chunk-OBQU6NHO.js";
|
|
14
|
+
import "./chunk-6ICJICVU.js";
|
|
12
15
|
export {
|
|
13
16
|
__testing__,
|
|
14
17
|
createScanReport,
|
|
15
18
|
scan_default as default,
|
|
16
19
|
deriveTagsFromForensic,
|
|
20
|
+
detectExistingLanguage,
|
|
17
21
|
formatKnowledgeId,
|
|
18
22
|
runInitScan,
|
|
19
23
|
scanCommand
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
createDebugLogger,
|
|
4
3
|
paint,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
symbol
|
|
5
|
+
} from "./chunk-WWNXR34K.js";
|
|
6
|
+
import {
|
|
7
|
+
createDebugLogger,
|
|
8
|
+
resolveDevMode
|
|
9
|
+
} from "./chunk-OBQU6NHO.js";
|
|
10
|
+
import {
|
|
7
11
|
t
|
|
8
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6ICJICVU.js";
|
|
9
13
|
|
|
10
14
|
// src/commands/serve.ts
|
|
11
15
|
import { defineCommand } from "citty";
|