@fenglimg/fabric-cli 2.2.0-rc.1 → 2.2.0-rc.10
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-27HK6H5Y.js +69 -0
- package/dist/{chunk-AOE6AYI7.js → chunk-2KBCTMID.js} +31 -8
- package/dist/chunk-3D7B2UAZ.js +149 -0
- package/dist/{chunk-XC5RUHLK.js → chunk-3IOLS5EK.js} +23 -38
- package/dist/{plan-context-hint-FC6P3WFE.js → chunk-722JU5BP.js} +52 -12
- package/dist/{chunk-2R55HNVD.js → chunk-7ZDXBOOU.js} +234 -206
- package/dist/{doctor-YONYXDX6.js → chunk-E7HJUU34.js} +215 -52
- package/dist/chunk-EOT63RDH.js +36 -0
- package/dist/chunk-FNHDQTPC.js +16 -0
- package/dist/{chunk-2CY4BMTH.js → chunk-HORSMSZL.js} +9 -5
- package/dist/{chunk-BO4XIZWZ.js → chunk-NLNH64A3.js} +5 -18
- package/dist/{chunk-WU6GAPKH.js → chunk-PTGQAZEW.js} +12 -4
- 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/{config-XYRBZJDU.js → config-A3LTECAY.js} +4 -3
- package/dist/context-UJCGYOT6.js +117 -0
- package/dist/doctor-MDTZWKBK.js +24 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +133 -22
- package/dist/info-7FKBTMVO.js +139 -0
- package/dist/install-v2-RINEA24K.js +3279 -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-5TNGH3R4.js +12 -0
- package/dist/{scope-explain-CDIZESP5.js → scope-explain-HLJZ2M33.js} +17 -6
- package/dist/status-4R3TM4FJ.js +37 -0
- package/dist/store-HOCORVL3.js +563 -0
- package/dist/{sync-UJ4BBCZJ.js → sync-DT5UJMMR.js} +197 -30
- package/dist/{uninstall-C3QXKOO6.js → uninstall-IFN2KYBK.js} +97 -140
- package/dist/whoami-ITGEFWH4.js +49 -0
- package/package.json +7 -5
- package/templates/hooks/cite-policy-evict.cjs +412 -160
- package/templates/hooks/configs/README.md +14 -27
- package/templates/hooks/configs/claude-code.json +17 -2
- package/templates/hooks/configs/codex-hooks.json +15 -3
- package/templates/hooks/fabric-hint.cjs +477 -176
- package/templates/hooks/knowledge-hint-broad.cjs +577 -274
- package/templates/hooks/knowledge-hint-narrow.cjs +113 -73
- package/templates/hooks/lib/banner-i18n.cjs +31 -0
- package/templates/hooks/lib/bindings-snapshot-reader.cjs +118 -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/post-tooluse-mutation.cjs +386 -0
- package/templates/hooks/session-end-marker.cjs +140 -0
- package/templates/skills/fabric/SKILL.md +100 -0
- package/templates/skills/fabric-archive/SKILL.md +35 -24
- 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 +14 -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-4R2CYEA4.js +0 -116
- package/dist/chunk-L4Q55UC4.js +0 -52
- package/dist/chunk-LFIKMVY7.js +0 -27
- package/dist/chunk-RYAFBNES.js +0 -33
- package/dist/chunk-T5RPGCCM.js +0 -40
- package/dist/install-74ANPCCP.js +0 -2737
- package/dist/status-GLQWLWH6.js +0 -23
- package/dist/store-XB3ADT65.js +0 -144
- package/dist/whoami-2MLO4Y37.js +0 -36
- package/templates/hooks/configs/cursor-hooks.json +0 -18
- package/templates/hooks/lib/cite-contract-reminder.cjs +0 -179
- package/templates/hooks/lib/summary-fallback.cjs +0 -210
|
@@ -4,7 +4,7 @@ These JSON files are **fragment templates** consumed by `fabric install` and
|
|
|
4
4
|
`fabric hooks install`. They are not standalone client config files.
|
|
5
5
|
|
|
6
6
|
The supported clients are pinned by `packages/shared/src/schemas/fabric-config.ts`
|
|
7
|
-
to Claude Code
|
|
7
|
+
to Claude Code and Codex CLI. Adding a new client requires extending
|
|
8
8
|
that schema first.
|
|
9
9
|
|
|
10
10
|
## claude-code.json
|
|
@@ -25,45 +25,32 @@ Written to (or merged into) the user repo's `.codex/hooks.json`. NOTE: Codex
|
|
|
25
25
|
project-level hooks file is JSON, **not** TOML — only the user-level Codex MCP
|
|
26
26
|
config (`~/.codex/config.toml`) is TOML.
|
|
27
27
|
|
|
28
|
-
## cursor-hooks.json
|
|
29
|
-
|
|
30
|
-
Written to (or merged into) the user repo's `.cursor/hooks.json`. Schema
|
|
31
|
-
authoritative source: https://cursor.com/cn/docs/hooks. Top-level requires
|
|
32
|
-
`version: 1` (number literal, NOT string) and a `hooks` object (NOT `events`)
|
|
33
|
-
keyed by camelCase event names: `stop`, `sessionStart`, `preToolUse`. Per-entry
|
|
34
|
-
shape stays flat (Codex-style): `{command, matcher?, type?, timeout?,
|
|
35
|
-
loop_limit?, failClosed?}`. rc.14 TASK-001 corrected rc.13's wrong top-level
|
|
36
|
-
envelope (was `{events: {Stop, SessionStart, PreToolUse}}` PascalCase, which
|
|
37
|
-
Cursor rejects with "Config version must be a number; Config hooks must be an
|
|
38
|
-
object").
|
|
39
|
-
|
|
40
28
|
## Per-client schema comparison (v2.0.0-rc.37 NEW-29)
|
|
41
29
|
|
|
42
30
|
Each host program enforces its own wire format — `fabric install` cannot
|
|
43
|
-
serialize one shared shape across
|
|
44
|
-
side-by-side so anyone editing one config knows what the
|
|
45
|
-
|
|
46
|
-
| Axis | Claude Code | Codex CLI |
|
|
47
|
-
| -------------------- | ---------------------------------------- | -------------------------------------------------- |
|
|
48
|
-
| Settings file | `.claude/settings.json` | `.codex/hooks.json` |
|
|
49
|
-
| Top-level envelope | `hooks: { ... }` (no version) | `events: { ... }` (no version) |
|
|
50
|
-
| Event-name case | PascalCase: `Stop`, `SessionStart`, `PreToolUse`, `UserPromptSubmit` | PascalCase: `Stop`, `SessionStart`, `PreToolUse` |
|
|
51
|
-
| Per-entry shape | Nested matcher: `[{matcher, hooks:[{type:"command", command}]}]` | Flat: `[{command, matcher?}]` |
|
|
52
|
-
| Path interpolation | `${CLAUDE_PROJECT_DIR}` (env var) | `"$(git rev-parse --show-toplevel)"` (shell expansion) |
|
|
53
|
-
| Cite-policy event | `UserPromptSubmit` (per-prompt) | `SessionStart` 2nd entry (rc.37 NEW-21 parity) |
|
|
31
|
+
serialize one shared shape across both. Differences are pinned here
|
|
32
|
+
side-by-side so anyone editing one config knows what the other requires.
|
|
33
|
+
|
|
34
|
+
| Axis | Claude Code | Codex CLI |
|
|
35
|
+
| -------------------- | ---------------------------------------- | -------------------------------------------------- |
|
|
36
|
+
| Settings file | `.claude/settings.json` | `.codex/hooks.json` |
|
|
37
|
+
| Top-level envelope | `hooks: { ... }` (no version) | `events: { ... }` (no version) |
|
|
38
|
+
| Event-name case | PascalCase: `Stop`, `SessionStart`, `PreToolUse`, `UserPromptSubmit` | PascalCase: `Stop`, `SessionStart`, `PreToolUse` |
|
|
39
|
+
| Per-entry shape | Nested matcher: `[{matcher, hooks:[{type:"command", command}]}]` | Flat: `[{command, matcher?}]` |
|
|
40
|
+
| Path interpolation | `${CLAUDE_PROJECT_DIR}` (env var) | `"$(git rev-parse --show-toplevel)"` (shell expansion) |
|
|
41
|
+
| Cite-policy event | `UserPromptSubmit` (per-prompt) | `SessionStart` 2nd entry (rc.37 NEW-21 parity) |
|
|
54
42
|
|
|
55
43
|
Whenever a hook is added to one config, walk this table and add the equivalent
|
|
56
|
-
entry to the other
|
|
44
|
+
entry to the other — `fabric install` merges each into its respective
|
|
57
45
|
target verbatim, so missing entries silently degrade the cross-client surface.
|
|
58
46
|
|
|
59
47
|
## fabric-hint.cjs script paths
|
|
60
48
|
|
|
61
49
|
- Claude: `.claude/hooks/fabric-hint.cjs` (project-relative)
|
|
62
50
|
- Codex: `.codex/hooks/fabric-hint.cjs` (project-relative)
|
|
63
|
-
- Cursor: `.cursor/hooks/fabric-hint.cjs` (project-relative)
|
|
64
51
|
|
|
65
52
|
The single shared script lives at `packages/cli/templates/hooks/fabric-hint.cjs`
|
|
66
|
-
in this repo and is copied into
|
|
53
|
+
in this repo and is copied into both `<client>/hooks/` destinations by the
|
|
67
54
|
install wiring. The script emits stdout JSON
|
|
68
55
|
`{decision:"block", reason, signal, recommended_skill}` with exit 0 when one of
|
|
69
56
|
three signals trips:
|
|
@@ -29,17 +29,32 @@
|
|
|
29
29
|
{
|
|
30
30
|
"type": "command",
|
|
31
31
|
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/knowledge-hint-narrow.cjs"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "command",
|
|
35
|
+
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/cite-policy-evict.cjs"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"PostToolUse": [
|
|
41
|
+
{
|
|
42
|
+
"matcher": "Edit|Write|MultiEdit|Read",
|
|
43
|
+
"hooks": [
|
|
44
|
+
{
|
|
45
|
+
"type": "command",
|
|
46
|
+
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/post-tooluse-mutation.cjs"
|
|
32
47
|
}
|
|
33
48
|
]
|
|
34
49
|
}
|
|
35
50
|
],
|
|
36
|
-
"
|
|
51
|
+
"SessionEnd": [
|
|
37
52
|
{
|
|
38
53
|
"matcher": "*",
|
|
39
54
|
"hooks": [
|
|
40
55
|
{
|
|
41
56
|
"type": "command",
|
|
42
|
-
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/
|
|
57
|
+
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/session-end-marker.cjs"
|
|
43
58
|
}
|
|
44
59
|
]
|
|
45
60
|
}
|
|
@@ -8,15 +8,27 @@
|
|
|
8
8
|
"SessionStart": [
|
|
9
9
|
{
|
|
10
10
|
"command": "\"$(git rev-parse --show-toplevel)/.codex/hooks/knowledge-hint-broad.cjs\""
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"PreToolUse": [
|
|
14
|
+
{
|
|
15
|
+
"matcher": "Edit|Write|MultiEdit|apply_patch",
|
|
16
|
+
"command": "\"$(git rev-parse --show-toplevel)/.codex/hooks/knowledge-hint-narrow.cjs\""
|
|
11
17
|
},
|
|
12
18
|
{
|
|
19
|
+
"matcher": "Edit|Write|MultiEdit|apply_patch",
|
|
13
20
|
"command": "\"$(git rev-parse --show-toplevel)/.codex/hooks/cite-policy-evict.cjs\""
|
|
14
21
|
}
|
|
15
22
|
],
|
|
16
|
-
"
|
|
23
|
+
"PostToolUse": [
|
|
17
24
|
{
|
|
18
|
-
"matcher": "Edit|Write|MultiEdit",
|
|
19
|
-
"command": "\"$(git rev-parse --show-toplevel)/.codex/hooks/
|
|
25
|
+
"matcher": "Edit|Write|MultiEdit|apply_patch|Read",
|
|
26
|
+
"command": "\"$(git rev-parse --show-toplevel)/.codex/hooks/post-tooluse-mutation.cjs\""
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"SessionEnd": [
|
|
30
|
+
{
|
|
31
|
+
"command": "\"$(git rev-parse --show-toplevel)/.codex/hooks/session-end-marker.cjs\""
|
|
20
32
|
}
|
|
21
33
|
]
|
|
22
34
|
}
|