@fenglimg/fabric-shared 2.3.0-rc.12 → 2.3.0-rc.16
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/dist/{chunk-TEITGZY3.js → chunk-5M3HB554.js} +25 -1
- package/dist/{chunk-ASS2KBB7.js → chunk-OX6DWUK4.js} +31 -2
- package/dist/{chunk-KFFBQRL5.js → chunk-V7IUN5U2.js} +9 -7
- package/dist/{chunk-YLIWE46B.js → chunk-WXVFJBL5.js} +155 -33
- package/dist/i18n/index.js +3 -2
- package/dist/{index-B2e0wKJi.d.ts → index-KvxqMZV1.d.ts} +6 -0
- package/dist/index.d.ts +460 -21
- package/dist/index.js +266 -43
- package/dist/schemas/api-contracts.d.ts +144 -0
- package/dist/schemas/api-contracts.js +1 -1
- package/dist/templates/bootstrap-canonical.d.ts +2 -2
- package/dist/templates/bootstrap-canonical.js +3 -2
- package/dist/theme.d.ts +6 -3
- package/dist/theme.js +27 -5
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ declare const BOOTSTRAP_REGEX: RegExp;
|
|
|
48
48
|
*
|
|
49
49
|
* Length guarantee: ≥ 800 bytes (rc.24: grew from ≥400 with cite-contract syntax).
|
|
50
50
|
*/
|
|
51
|
-
declare const BOOTSTRAP_CANONICAL_ZH = "# Fabric Bootstrap\n\n\u672C\u9879\u76EE\u4F7F\u7528 Fabric \u7BA1\u7406\u8DE8\u5BA2\u6237\u7AEF AI \u77E5\u8BC6\u4E0E\u884C\u4E3A\u89C4\u5219\u3002\u672C\u6587\u4EF6\u7531 `fabric install` \u540C\u6B65\u5230\u4E24\u7AEF managed block,**\u4E0D\u8981\u624B\u52A8\u7F16\u8F91\u4E24\u7AEF\u7684 block**,\u53EA\u6539\u8FD9\u91CC + \u91CD\u8DD1 `fabric install`\u3002\n\n## For Developers\n\n\u8FD9\u4E2A\u6587\u4EF6\u662F **AI \u5BA2\u6237\u7AEF\u7684\u7B56\u7565\u4E0E\u89C4\u7EA6\u914D\u7F6E**,\u4E0D\u662F dev onboarding\u3002\u4F60\u4E0D\u9700\u8981\u8BFB Self-archive / Cite / Phase 0.4 \u7B49\u7EC6\u8282\u3002\n\u4F5C\u4E3A dev \u4F60\u53EA\u9700\u8981:\u5728\u6BCF\u4E2A repo \u8DD1\u4E00\u6B21 `fabric install`,\u7528 `fabric store bind <alias>` / `fabric store switch-write <alias>` \u63A5\u5165\u5199\u5165 store,\u51FA\u95EE\u9898\u8DD1 `fabric doctor`\u3002\n**\u4E25\u7981\u624B\u52A8\u7F16\u8F91 `.fabric/agents.meta.json`** \u2014 \u6D3E\u751F\u72B6\u6001\u7531 engine \u91CD\u5EFA\u3002\n\n## 5 \u5206\u949F\u4E0A\u624B (Dev Quickstart)\n\n**Fabric \u662F\u4EC0\u4E48**:\u8DE8\u5BA2\u6237\u7AEF(Claude Code / Codex CLI)\u7684 AI \u77E5\u8BC6\u5C42\u3002\u628A\u56E2\u961F/\u9879\u76EE\u7684 **decisions / pitfalls / guidelines / models / processes** \u5B58\u4E3A markdown,hook \u81EA\u52A8 surface \u7ED9 AI,\u8BA9 AI \u4E0D\u7528\u6BCF\u6B21\u91CD\u5B66\u3002\n\n**\u4F60\u8981\u505A\u7684 (DO)** vs **engine \u81EA\u52A8\u7684 (DON'T \u624B\u52A8)**:\n\n| \u4F60 DO | \u4F60 DON'T |\n| --- | --- |\n| \u6BCF\u4E2A repo \u8DD1\u4E00\u6B21 `fabric install` | \u624B\u7F16 `.fabric/agents.meta.json` |\n| \u5F02\u5E38\u65F6\u8DD1 `fabric doctor` (--fix \u81EA\u6108) | \u624B\u7F16 `.claude/hooks/` \u4E0B `.cjs` |\n| \u7528 `fabric-archive` / `fabric-review` / `fabric store ...` \u7BA1\u7406 store-backed knowledge | \u624B\u5199\u4EFB\u4F55\u975E store knowledge \u6839 |\n| `npm install -g @fenglimg/fabric-cli@latest` \u5347\u7EA7 | \u80CC 35 \u6761 doctor lint \u4EE3\u7801 |\n\n**4 \u6B65\u5FAA\u73AF**: `fabric install` (\u4E00\u6B21) \u2192 \u7ED1\u5B9A\u5E76\u9009\u62E9\u5199\u5165 store \u2192 AI \u6B63\u5E38\u5DE5\u4F5C (hook on session start + edit) \u2192 AI \u901A\u8FC7 MCP \u5199\u5165\u5F53\u524D write store \u7684 pending \u6761\u76EE\u5E76\u8FD4\u56DE `pending_path` \u2192 \u7528 `fabric-review` skill \u5BA1\u6838\u3002\n\n**\u771F\u4F8B**:\u67D0 sprite \u9ED1\u8FB9 root cause \u662F `atlas.premultiplyAlpha` flag \u53CD\u5411 \u2014 \u5F52\u6863\u8FDB store \u7684 `knowledge/pitfalls/` \u540E,\u4E0B\u6B21\u540C\u7C7B\u95EE\u9898 AI \u81EA\u52A8 reference\u3002\n\n\u5B8C\u6574 maintainer \u7248\u89C1 `docs/USER-QUICKSTART.md`\u3002\n\n## \u884C\u4E3A\u89C4\u5219\n- **\u4FEE\u6539\u4EFB\u4F55\u6587\u4EF6\u524D**:\u5148 `fab_recall(paths=[<\u88AB\u6539\u6587\u4EF6>])` \u2014\u2014 \u4E00\u6B21\u8C03\u7528\u62FF\u56DE\u76F8\u5173 KB \u7684\u63CF\u8FF0 + \u539F\u751F\u8BFB\u53D6\u8DEF\u5F84(`entries[].read_path`)\u3002`fab_recall` \u4E0D\u518D\u6295\u9012\u6B63\u6587;\u9700\u8981\u67D0\u6761\u6B63\u6587\u65F6\u76F4\u63A5\u5BF9\u5176 `entries[].read_path` \u505A\u539F\u751F Read(`Read <store>/knowledge/<type>/<id>--*.md`),\u8FD9\u4F1A\u88AB PostToolUse hook \u8BB0\u4E3A `knowledge_body_read`\u3002lean \u9ED8\u8BA4:\u63CF\u8FF0+\u7D22\u5F15\u5DF2\u591F\u53D1\u73B0\u6761\u76EE,\u6B63\u6587\u6309\u9700\u8BFB\u4E00\u6B21,\u4E0D\u6BCF\u8F6E\u91CD\u704C(KT-GLD-0005)\u3002\n- **`.fabric/agents.meta.json` \u4E25\u7981\u624B\u52A8\u7F16\u8F91**;engine \u4F1A\u81EA\u52A8\u540C\u6B65\u6D3E\u751F\u72B6\u6001,\u663E\u5F0F reconcile \u8DD1 `fabric doctor --fix`\u3002\n\n## \u77E5\u8BC6\u5E93(KB)\n- **Discovery**:SessionStart hook \u5217 broad-scoped \u6761\u76EE(\u6761\u76EE\u6309 `semantic_scope` \u5206\u4E09\u5C42:`team` \u56E2\u961F\u901A\u7528 / `project:<id>` \u672C\u9879\u76EE\u4E13\u5C5E(\u4EC5\u5728\u7ED1\u5B9A\u8BE5\u9879\u76EE\u7684\u4ED3\u5E93\u6D6E\u73B0)/ `personal` \u4E2A\u4EBA `KP-*`,\u4E09\u8005\u5F15\u7528\u65B9\u5F0F\u76F8\u540C);edit \u6587\u4EF6\u65F6 PreToolUse hook \u53EF\u80FD\u89E6\u53D1 narrow hint\u3002\n- **Scope \u4E09\u8F74(\u4E3A\u4EC0\u4E48\u6CA1\u6D6E\u73B0)** (KT-MOD-0001):\u4E00\u6761\u77E5\u8BC6\u662F\u5426\u6D6E\u73B0\u7531\u4E09\u4E2A**\u6B63\u4EA4**\u8F74\u51B3\u5B9A \u2014\u2014 \u2460 `semantic_scope` \u53D7\u4F17(`team` / `project:<id>` / `personal`;\u7ED1\u9519\u9879\u76EE\u5219\u4E0D\u663E)\u2461 `relevance_scope` \u65F6\u673A(`broad` \u5E38\u9A7B / `narrow` \u4EC5\u7F16\u8F91\u5339\u914D\u6587\u4EF6\u65F6\u6D6E\u73B0)\u2462 `store` \u7269\u7406\u5E93(\u6CA1 `fabric store bind` \u5C31\u4E0D\u8BFB)\u3002\u4E09\u8F74\u540D\u5B57\u4F1A\u649E(\"team\" \u65E2\u662F\u53D7\u4F17\u503C\u4E5F\u53EF\u662F store \u522B\u540D),\u6240\u4EE5\u56F0\u60D1\"\u4E3A\u4EC0\u4E48\u8FD9\u6761\u6CA1\u6D6E\u73B0\"\u65F6\u8DD1 `fabric audit why-not-surfaced <id>` \u9010\u56E0\u8BCA\u65AD(store \u6CA1\u7ED1 / scope \u4E0D\u5339\u914D / narrow \u65F6\u673A)\u3002\n- **Usage**:\u8D70\u5355\u6B65 `fab_recall(paths=[...])` \u4E00\u6B21\u62FF\u56DE\u76F8\u5173 KB \u7684\u63CF\u8FF0 + \u8BFB\u53D6\u8DEF\u5F84;\u9700\u8981\u67D0\u6761\u6B63\u6587\u65F6\u5BF9\u5176 `entries[].read_path` \u505A\u539F\u751F Read \u53D6\u56DE(\u4E0D\u518D\u8D70 MCP \u4E8C\u6B21\u53D6\u6B63\u6587)\u3002\n- **session_id**: \u8C03\u7528 `fab_recall` \u65F6, \u52A1\u5FC5\u628A\u5F53\u524D client session id \u4F5C\u4E3A `session_id` \u53C2\u6570\u4F20\u5165(Claude Code \u7684 session id \u5728 stdin payload \u4E2D, Codex \u7684\u5BF9\u5E94 identifier \u540C\u7406)\u3002\u8FD9\u80FD\u8BA9 `fabric doctor --archive-history` \u4E0E `fabric-hint.cjs` Stop hook \u51C6\u786E\u8BC6\u522B\u8DE8\u4F1A\u8BDD debt \u72B6\u6001\u3002\n- **Skills (4)**:\u5199\u6D41\u7A0B `fabric-archive`(\u542B source mode \u51B7\u542F\u52A8\u4ECE git/docs \u56DE\u704C)/ `fabric-review`(\u542B retire \u8BED\u4E49\u6DD8\u6C70 + relate \u5173\u8054\u5EFA\u8FB9 \u5B50\u6D41\u7A0B);store \u8FD0\u7EF4 `fabric-store` / `fabric-sync`\u3002\n- **Language**:\u6E32\u67D3\u6309 `~/.fabric/fabric-global.json` \u7684 `language` \u5B57\u6BB5(machine-wide tone)\u3002\n- **Archive cadence nudge** (rc.36): \u6BCF\u5B8C\u6210\u4E00\u6279 Edit(\u9ED8\u8BA4 ~20 \u6B21, \u4E0E Stop hook \u9608\u503C config `archive_edit_threshold` \u4E00\u81F4)/ \u663E\u8457 decision \u540E,\u5728\u5408\u9002\u56DE\u5408\u4E3B\u52A8 propose \u8C03 `fabric-archive` skill \u2014 archive \u6CA1\u5EFA\u7ACB\u9891\u7387\u4F1A\u8BA9 KB \u6162\u901F\u6B7B\u6389\u3002\n- **Review backlog nudge** (rc.36): \u9700\u8981\u5224\u65AD pending backlog \u65F6\u8D70 `fab_pending action=\"list\"` \u6216 `fabric-review` \u8FD4\u56DE\u7684 `pending_path`;\u4E0D\u8981 glob \u9879\u76EE\u672C\u5730 `.fabric/knowledge/pending`\u3002\u5F53\u53EF\u89C1 pending \u7D2F\u79EF >10 \u6761\u65F6,\u5728\u5408\u9002\u56DE\u5408\u4E3B\u52A8 propose \u8C03 `fabric-review` skill \u6279\u91CF\u5BA1,\u907F\u514D draft \u5361\u6B7B\u3002\n\n## Self-archive policy (v2.2 C1: \u7CBE\u7B80\u8BF4\u660E\u4E66)\n\n\u51FA\u73B0\u660E\u786E\u5F52\u6863\u4FE1\u53F7\u65F6, \u4E8E\u8BE5 turn \u672B\u5C3E\u81EA\u4E3B\u8C03\u7528 `fabric-archive` skill(AI \u81EA\u89E6\u53D1\u5165\u53E3 E3):\n\n- **\u89E6\u53D1** (\u4E8C\u9009\u4E00): \u2460 **User-driven normative** \u2014 \u7528\u6237\u8BF4 `\u4EE5\u540E` / `always` / `never` / `\u4E0B\u6B21` / `\u8BB0\u4E00\u4E0B`, \u6216\u5728 \u22652 \u5019\u9009\u95F4\u6743\u8861\u540E\u9501\u5B9A\u65B9\u5411, \u6216\u62D2\u4E86\u5EFA\u8BAE\u5E76\u7ED9\u4E86\u7406\u7531(\u7406\u7531\u5373\u77E5\u8BC6); \u2461 **Wrong-turn-and-revert** \u2014 \u4F60\u8BD5\u4E86 path X \u53CD\u601D\u540E\u6539\u8D70 path Y(\"\u5426\u5B9A+\u66FF\u4EE3\"\u4E24\u6B65\u7ED3\u6784, \u975E\u5355\u7EAF\u63A2\u7D22\u5931\u8D25)\u3002\n- **\u4E0D\u89E6\u53D1**: \u7528\u6237\u7EAF\u8BE2\u95EE / \u7B80\u5355 refactor\u00B7typo / \u51ED\u7A7A\"\u6211\u5B66\u5230\u4E86\"\u7684\u6D1E\u5BDF\u3002\n- **\u9632 loop**: \u540C turn \u6700\u591A\u81EA\u8C03 1 \u6B21; \u540C session \u540C outcome \u4E0D\u91CD\u590D; skill \u5185 Phase 2.5 viability gate \u515C\u5E95\u3002\n- **\u56DE\u6267 (marker-free)**: \u76F4\u63A5\u81EA\u8C03 `fabric-archive` skill \u5373\u53EF, \u65E0\u9700\u6253\u5370\u4EFB\u4F55\u6697\u53F7\u5B57\u7B26\u4E32 \u2014\u2014 skill \u9ED8\u8BA4\u628A AI \u81EA\u8C03\u8BC6\u522B\u4E3A E3(\u786E\u5B9A\u6027 else \u8DEF\u7531, \u4E0D\u518D\u4F9D\u8D56 AI \u8F93\u51FA\u7CBE\u786E\u5B57\u7B26\u4E32)\u3002skill \u843D pending \u540E\u8FD4\u56DE `pending_path`, \u4E0D\u8BE5\u8BB0\u5C31\u56DE `undo`(\u6211\u8C03 fab_review reject)\u3002\n\n## Cite policy (v2.2 C1: recall \u81EA\u52A8\u8BB0\u8D26, \u96F6\u9996\u884C\u8D1F\u62C5)\n\n- **\u6838\u5FC3 (recall-first \u81EA\u52A8\u8BB0\u8D26)**: \u6539\u4EFB\u4F55\u6587\u4EF6\u524D\u5148 `fab_recall(paths=[<\u88AB\u6539\u6587\u4EF6>])`\u3002\u7CFB\u7EDF\u6309\"\u672C session recall \u547D\u4E2D\u7684 path \u4E0E\u7F16\u8F91\u76EE\u6807\u91CD\u53E0\"\u81EA\u52A8\u628A\u53EC\u56DE\u7684 KB \u8BB0\u4E3A\u8BE5\u6B21 edit \u7684\u5F15\u7528 \u2014\u2014 **\u65E0\u9700\u624B\u5199\u4EFB\u4F55\u56DE\u590D\u9996\u884C**(C1 \u5220\u9664\u9996\u884C `KB:` contract \u516B\u80A1:\u5148\u60F3\u540E\u8BF4,recall \u624D\u662F\u5F15\u7528\u53D1\u751F\u7684\u771F\u5B9E\u4FE1\u53F7)\u3002PreToolUse \u68C0\u6D4B\u4E0D\u5230\u76F8\u5173 recall \u65F6\u7ED9\u4E00\u6761\u8F6F nudge(nudge \u975E gate,\u5B88 KT-DEC-0007)\u3002\n- **\u552F\u4E00\u8981\u5F00\u53E3\u7684\u65F6\u5019 (dismissed / override)**: \u4F60\u5224\u65AD\u67D0\u53EC\u56DE KB \u4E0D\u8BE5\u5E94\u7528\u65F6,\u8BF4\u4E00\u53E5 `dismissed: <id> (<reason>)`;reason \u679A\u4E3E `scope-mismatch | outdated | not-applicable | other:<text>`\u3002\u9700\u7CBE\u786E\u6807\u6CE8\u4ECD\u53EF\u7528\u9996\u884C `KB: <id> [applied|dismissed]`(\u89E3\u6790\u5668\u4FDD\u7559,\u5411\u540E\u517C\u5BB9)\u3002\n- **`[applied]` \u9A8C\u8BC1\u4E49\u52A1**: \u5F15\u7528\u4EFB\u4F55 id(\u81EA\u52A8\u6216\u624B\u5199)\u524D\u5FC5\u987B\u5148 fab_recall \u5B9E\u9645\u6293\u56DE KB(\u6309\u9700\u5BF9\u6B63\u6587\u8DEF\u5F84\u505A\u539F\u751F Read),\u9632\u6B62\u7F16\u9020 id\u3002\u9A8C\u8BC1\u4E0D\u901A\u8FC7 = \u4E0D\u80FD cite\u3002\n- **\u7A3D\u6838\u4E0E\u5B8C\u6574\u89C4\u7EA6**: `fabric audit cite` \u8F93\u51FA\u8986\u76D6\u7387(\u4E0D\u963B\u65AD\u5DE5\u4F5C,\u53EA\u8BB0\u5F55);contract operator / store \u524D\u7F00 / skip\u00B7dismissed \u8BCD\u5178 / \u7C7B\u578B\u8DEF\u7531 / \u88C1\u51B3\u9636\u68AF\u7B49\u5B8C\u6574\u89C4\u7EA6\u6743\u5A01\u8BE6\u53C2 `fabric-review` skill \u7684 `ref/cite-contract.md` \u2014\u2014 bootstrap \u53EA\u7559\u53EF\u6267\u884C core\u3002\n";
|
|
51
|
+
declare const BOOTSTRAP_CANONICAL_ZH = "# Fabric Bootstrap\n\n\u672C\u9879\u76EE\u4F7F\u7528 Fabric \u7BA1\u7406\u8DE8\u5BA2\u6237\u7AEF AI \u77E5\u8BC6\u4E0E\u884C\u4E3A\u89C4\u5219\u3002\u672C\u6587\u4EF6\u7531 `fabric install` \u540C\u6B65\u5230\u4E24\u7AEF managed block,**\u4E0D\u8981\u624B\u52A8\u7F16\u8F91\u4E24\u7AEF\u7684 block**,\u53EA\u6539\u8FD9\u91CC + \u91CD\u8DD1 `fabric install`\u3002\n\n## For Developers\n\n\u8FD9\u4E2A\u6587\u4EF6\u662F **AI \u5BA2\u6237\u7AEF\u7684\u7B56\u7565\u4E0E\u89C4\u7EA6\u914D\u7F6E**,\u4E0D\u662F dev onboarding\u3002\u4F60\u4E0D\u9700\u8981\u8BFB Self-archive / Cite / Phase 0.4 \u7B49\u7EC6\u8282\u3002\n\u4F5C\u4E3A dev \u4F60\u53EA\u9700\u8981:\u5728\u6BCF\u4E2A repo \u8DD1\u4E00\u6B21 `fabric install`,\u7528 `fabric store bind <alias>` / `fabric store switch-write <alias>` \u63A5\u5165\u5199\u5165 store,\u51FA\u95EE\u9898\u8DD1 `fabric doctor`\u3002\n**\u4E25\u7981\u624B\u52A8\u7F16\u8F91 `.fabric/agents.meta.json`** \u2014 \u6D3E\u751F\u72B6\u6001\u7531 engine \u91CD\u5EFA\u3002\n\n## 5 \u5206\u949F\u4E0A\u624B (Dev Quickstart)\n\n**Fabric \u662F\u4EC0\u4E48**:\u8DE8\u5BA2\u6237\u7AEF(Claude Code / Codex CLI)\u7684 AI \u77E5\u8BC6\u5C42\u3002\u628A\u56E2\u961F/\u9879\u76EE\u7684 **decisions / pitfalls / guidelines / models / processes** \u5B58\u4E3A markdown,hook \u81EA\u52A8 surface \u7ED9 AI,\u8BA9 AI \u4E0D\u7528\u6BCF\u6B21\u91CD\u5B66\u3002\n\n**\u4F60\u8981\u505A\u7684 (DO)** vs **engine \u81EA\u52A8\u7684 (DON'T \u624B\u52A8)**:\n\n| \u4F60 DO | \u4F60 DON'T |\n| --- | --- |\n| \u6BCF\u4E2A repo \u8DD1\u4E00\u6B21 `fabric install` | \u624B\u7F16 `.fabric/agents.meta.json` |\n| \u5F02\u5E38\u65F6\u8DD1 `fabric doctor` (--fix \u81EA\u6108) | \u624B\u7F16 `.claude/hooks/` \u4E0B `.cjs` |\n| \u7528 `fabric-archive` / `fabric-review` / `fabric store ...` \u7BA1\u7406 store-backed knowledge | \u624B\u5199\u4EFB\u4F55\u975E store knowledge \u6839 |\n| `npm install -g @fenglimg/fabric-cli@latest` \u5347\u7EA7 | \u80CC 35 \u6761 doctor lint \u4EE3\u7801 |\n\n**4 \u6B65\u5FAA\u73AF**: `fabric install` (\u4E00\u6B21) \u2192 \u7ED1\u5B9A\u5E76\u9009\u62E9\u5199\u5165 store \u2192 AI \u6B63\u5E38\u5DE5\u4F5C (hook on session start + edit) \u2192 AI \u901A\u8FC7 MCP \u5199\u5165\u5F53\u524D write store \u7684 pending \u6761\u76EE\u5E76\u8FD4\u56DE `pending_path` \u2192 \u7528 `fabric-review` skill \u5BA1\u6838\u3002\n\n**\u771F\u4F8B**:\u67D0 sprite \u9ED1\u8FB9 root cause \u662F `atlas.premultiplyAlpha` flag \u53CD\u5411 \u2014 \u5F52\u6863\u8FDB store \u7684 `knowledge/pitfalls/` \u540E,\u4E0B\u6B21\u540C\u7C7B\u95EE\u9898 AI \u81EA\u52A8 reference\u3002\n\n\u5B8C\u6574 maintainer \u7248\u89C1 `docs/USER-QUICKSTART.md`\u3002\n\n## \u884C\u4E3A\u89C4\u5219\n- **Pre-action gating (\u4FEE\u6539\u4EFB\u4F55\u6587\u4EF6\u524D MUST)**: \u2460 \u5148 `fab_recall(paths=[<\u88AB\u6539\u6587\u4EF6>], session_id=<client-session-id>)`\uFF1B\u2461 \u6309\u9700\u539F\u751F Read \u547D\u4E2D\u7684 `entries[].read_path` \u6B63\u6587(PostToolUse \u8BB0\u4E3A `knowledge_body_read`)\uFF1B\u2462 \u8DF3\u8FC7\u4E0D\u9002\u7528\u547D\u4E2D\u65F6\u8BF4 `dismissed: <id> (<reason>)`\u3002`fab_recall` \u4E0D\u518D\u6295\u9012\u6B63\u6587;lean \u9ED8\u8BA4\u63CF\u8FF0+\u7D22\u5F15\u5DF2\u591F\u53D1\u73B0\u6761\u76EE(KT-GLD-0005)\u3002PreToolUse \u4EC5\u8F6F nudge,\u5B88 KT-DEC-0007(\u975E permanent gate / \u65E0 `decision:block`)\u3002\n- **Archive-as-truth**: \u8FDB canonical **\u552F\u4E00\u8DEF\u5F84** \u662F `fab_propose` \u2192 pending \u2192 `fabric-review`/`fab_review` \u5BA1\u6279\uFF1B\u7981\u6B62\u628A chat/log \u81EA\u52A8 promote \u8FDB canonical\u3002\n- **`.fabric/agents.meta.json` \u4E25\u7981\u624B\u52A8\u7F16\u8F91**\uFF08co-location index \u5DF2\u9000\u5F79;\u77E5\u8BC6\u5728 mounted stores\uFF09\u3002\u5F02\u5E38\u65F6\u8DD1 `fabric doctor` / `fabric doctor --fix` \u81EA\u6108\u53EF\u4FEE\u590D\u9879\u3002\n\n## \u77E5\u8BC6\u5E93(KB)\n- **Discovery**:SessionStart hook \u5217 broad-scoped \u6761\u76EE(\u6761\u76EE\u6309 `semantic_scope` \u5206\u4E09\u5C42:`team` \u56E2\u961F\u901A\u7528 / `project:<id>` \u672C\u9879\u76EE\u4E13\u5C5E(\u4EC5\u5728\u7ED1\u5B9A\u8BE5\u9879\u76EE\u7684\u4ED3\u5E93\u6D6E\u73B0)/ `personal` \u4E2A\u4EBA `KP-*`,\u4E09\u8005\u5F15\u7528\u65B9\u5F0F\u76F8\u540C);edit \u6587\u4EF6\u65F6 PreToolUse hook \u53EF\u80FD\u89E6\u53D1 narrow hint\u3002\n- **Scope \u4E09\u8F74(\u4E3A\u4EC0\u4E48\u6CA1\u6D6E\u73B0)** (KT-MOD-0001):\u4E00\u6761\u77E5\u8BC6\u662F\u5426\u6D6E\u73B0\u7531\u4E09\u4E2A**\u6B63\u4EA4**\u8F74\u51B3\u5B9A \u2014\u2014 \u2460 `semantic_scope` \u53D7\u4F17(`team` / `project:<id>` / `personal`;\u7ED1\u9519\u9879\u76EE\u5219\u4E0D\u663E)\u2461 `relevance_scope` \u65F6\u673A(`broad` \u5E38\u9A7B / `narrow` \u4EC5\u7F16\u8F91\u5339\u914D\u6587\u4EF6\u65F6\u6D6E\u73B0)\u2462 `store` \u7269\u7406\u5E93(\u6CA1 `fabric store bind` \u5C31\u4E0D\u8BFB)\u3002\u4E09\u8F74\u540D\u5B57\u4F1A\u649E(\"team\" \u65E2\u662F\u53D7\u4F17\u503C\u4E5F\u53EF\u662F store \u522B\u540D),\u6240\u4EE5\u56F0\u60D1\"\u4E3A\u4EC0\u4E48\u8FD9\u6761\u6CA1\u6D6E\u73B0\"\u65F6\u8DD1 `fabric audit why-not-surfaced <id>` \u9010\u56E0\u8BCA\u65AD(store \u6CA1\u7ED1 / scope \u4E0D\u5339\u914D / narrow \u65F6\u673A)\u3002\n- **Usage**:\u8D70\u5355\u6B65 `fab_recall(paths=[...])` \u4E00\u6B21\u62FF\u56DE\u76F8\u5173 KB \u7684\u63CF\u8FF0 + \u8BFB\u53D6\u8DEF\u5F84;\u9700\u8981\u67D0\u6761\u6B63\u6587\u65F6\u5BF9\u5176 `entries[].read_path` \u505A\u539F\u751F Read \u53D6\u56DE(\u4E0D\u518D\u8D70 MCP \u4E8C\u6B21\u53D6\u6B63\u6587)\u3002\n- **session_id**: \u8C03\u7528 `fab_recall` \u65F6, \u52A1\u5FC5\u628A\u5F53\u524D client session id \u4F5C\u4E3A `session_id` \u53C2\u6570\u4F20\u5165(Claude Code \u7684 session id \u5728 stdin payload \u4E2D, Codex \u7684\u5BF9\u5E94 identifier \u540C\u7406)\u3002\u8FD9\u80FD\u8BA9 `fabric doctor --archive-history` \u4E0E `fabric-hint.cjs` Stop hook \u51C6\u786E\u8BC6\u522B\u8DE8\u4F1A\u8BDD debt \u72B6\u6001\u3002\n- **Skills (4)**:\u5199\u6D41\u7A0B `fabric-archive`(\u542B source mode \u51B7\u542F\u52A8\u4ECE git/docs \u56DE\u704C)/ `fabric-review`(\u542B retire \u8BED\u4E49\u6DD8\u6C70 + relate \u5173\u8054\u5EFA\u8FB9 \u5B50\u6D41\u7A0B);store \u8FD0\u7EF4 `fabric-store` / `fabric-sync`\u3002\n- **Language**:\u6E32\u67D3\u6309 `~/.fabric/fabric-global.json` \u7684 `language` \u5B57\u6BB5(machine-wide tone)\u3002\n- **Archive cadence nudge** (rc.36 / finish\u2192archive): \u663E\u8457 decision \u6536\u53E3\u6216\u4E00\u6279 Edit \u8FBE\u5230 config `archive_edit_threshold`(\u9ED8\u8BA4 20) \u540E,\u5728\u5408\u9002\u56DE\u5408\u8F7B\u91CF\u81EA\u8C03 `fabric-archive`(\u540C turn \u6700\u591A 1 \u6B21;\u975E task engine / \u975E Stop-hook flood)\u3002Stop hook \u4EC5 soft threshold nudge,\u5B88 KT-DEC-0007 \u2014 archive \u6CA1\u5EFA\u7ACB\u9891\u7387\u4F1A\u8BA9 KB \u6162\u901F\u6B7B\u6389\u3002\n- **Review backlog nudge** (rc.36): \u9700\u8981\u5224\u65AD pending backlog \u65F6\u8D70 `fab_pending action=\"list\"` \u6216 `fabric-review` \u8FD4\u56DE\u7684 `pending_path`;\u4E0D\u8981 glob \u9879\u76EE\u672C\u5730 `.fabric/knowledge/pending`\u3002\u5F53\u53EF\u89C1 pending \u7D2F\u79EF >10 \u6761\u65F6,\u5728\u5408\u9002\u56DE\u5408\u4E3B\u52A8 propose \u8C03 `fabric-review` skill \u6279\u91CF\u5BA1,\u907F\u514D draft \u5361\u6B7B\u3002\n\n## Self-archive policy (v2.2 C1: \u7CBE\u7B80\u8BF4\u660E\u4E66)\n\n\u51FA\u73B0\u660E\u786E\u5F52\u6863\u4FE1\u53F7\u65F6, \u4E8E\u8BE5 turn \u672B\u5C3E\u81EA\u4E3B\u8C03\u7528 `fabric-archive` skill(AI \u81EA\u89E6\u53D1\u5165\u53E3 E3):\n\n- **\u89E6\u53D1** (\u4E8C\u9009\u4E00): \u2460 **User-driven normative** \u2014 \u7528\u6237\u8BF4 `\u4EE5\u540E` / `always` / `never` / `\u4E0B\u6B21` / `\u8BB0\u4E00\u4E0B`, \u6216\u5728 \u22652 \u5019\u9009\u95F4\u6743\u8861\u540E\u9501\u5B9A\u65B9\u5411, \u6216\u62D2\u4E86\u5EFA\u8BAE\u5E76\u7ED9\u4E86\u7406\u7531(\u7406\u7531\u5373\u77E5\u8BC6); \u2461 **Wrong-turn-and-revert** \u2014 \u4F60\u8BD5\u4E86 path X \u53CD\u601D\u540E\u6539\u8D70 path Y(\"\u5426\u5B9A+\u66FF\u4EE3\"\u4E24\u6B65\u7ED3\u6784, \u975E\u5355\u7EAF\u63A2\u7D22\u5931\u8D25)\u3002\n- **\u4E0D\u89E6\u53D1**: \u7528\u6237\u7EAF\u8BE2\u95EE / \u7B80\u5355 refactor\u00B7typo / \u51ED\u7A7A\"\u6211\u5B66\u5230\u4E86\"\u7684\u6D1E\u5BDF\u3002\n- **\u9632 loop**: \u540C turn \u6700\u591A\u81EA\u8C03 1 \u6B21; \u540C session \u540C outcome \u4E0D\u91CD\u590D; skill \u5185 Phase 2.5 viability gate \u515C\u5E95\u3002\n- **\u56DE\u6267 (marker-free)**: \u76F4\u63A5\u81EA\u8C03 `fabric-archive` skill \u5373\u53EF, \u65E0\u9700\u6253\u5370\u4EFB\u4F55\u6697\u53F7\u5B57\u7B26\u4E32 \u2014\u2014 skill \u9ED8\u8BA4\u628A AI \u81EA\u8C03\u8BC6\u522B\u4E3A E3(\u786E\u5B9A\u6027 else \u8DEF\u7531, \u4E0D\u518D\u4F9D\u8D56 AI \u8F93\u51FA\u7CBE\u786E\u5B57\u7B26\u4E32)\u3002skill \u843D pending \u540E\u8FD4\u56DE `pending_path`, \u4E0D\u8BE5\u8BB0\u5C31\u56DE `undo`(\u6211\u8C03 fab_review reject)\u3002\n\n## Cite policy (v2.2 C1: recall \u81EA\u52A8\u8BB0\u8D26, \u96F6\u9996\u884C\u8D1F\u62C5)\n\n- **\u6838\u5FC3 (recall-first \u81EA\u52A8\u8BB0\u8D26)**: \u6539\u4EFB\u4F55\u6587\u4EF6\u524D\u5148 `fab_recall(paths=[<\u88AB\u6539\u6587\u4EF6>])`\u3002\u7CFB\u7EDF\u6309\"\u672C session recall \u547D\u4E2D\u7684 path \u4E0E\u7F16\u8F91\u76EE\u6807\u91CD\u53E0\"\u81EA\u52A8\u628A\u53EC\u56DE\u7684 KB \u8BB0\u4E3A\u8BE5\u6B21 edit \u7684\u5F15\u7528 \u2014\u2014 **\u65E0\u9700\u624B\u5199\u4EFB\u4F55\u56DE\u590D\u9996\u884C**(C1 \u5220\u9664\u9996\u884C `KB:` contract \u516B\u80A1:\u5148\u60F3\u540E\u8BF4,recall \u624D\u662F\u5F15\u7528\u53D1\u751F\u7684\u771F\u5B9E\u4FE1\u53F7)\u3002PreToolUse \u68C0\u6D4B\u4E0D\u5230\u76F8\u5173 recall \u65F6\u7ED9\u4E00\u6761\u8F6F nudge(nudge \u975E gate,\u5B88 KT-DEC-0007)\u3002\n- **\u552F\u4E00\u8981\u5F00\u53E3\u7684\u65F6\u5019 (dismissed / override)**: \u4F60\u5224\u65AD\u67D0\u53EC\u56DE KB \u4E0D\u8BE5\u5E94\u7528\u65F6,\u8BF4\u4E00\u53E5 `dismissed: <id> (<reason>)`;reason \u679A\u4E3E `scope-mismatch | outdated | not-applicable | other:<text>`\u3002\u9700\u7CBE\u786E\u6807\u6CE8\u4ECD\u53EF\u7528\u9996\u884C `KB: <id> [applied|dismissed]`(\u89E3\u6790\u5668\u4FDD\u7559,\u5411\u540E\u517C\u5BB9)\u3002\n- **`[applied]` \u9A8C\u8BC1\u4E49\u52A1**: \u5F15\u7528\u4EFB\u4F55 id(\u81EA\u52A8\u6216\u624B\u5199)\u524D\u5FC5\u987B\u5148 fab_recall \u5B9E\u9645\u6293\u56DE KB(\u6309\u9700\u5BF9\u6B63\u6587\u8DEF\u5F84\u505A\u539F\u751F Read),\u9632\u6B62\u7F16\u9020 id\u3002\u9A8C\u8BC1\u4E0D\u901A\u8FC7 = \u4E0D\u80FD cite\u3002\n- **\u7A3D\u6838\u4E0E\u5B8C\u6574\u89C4\u7EA6**: `fabric audit cite` \u8F93\u51FA\u8986\u76D6\u7387(\u4E0D\u963B\u65AD\u5DE5\u4F5C,\u53EA\u8BB0\u5F55);contract operator / store \u524D\u7F00 / skip\u00B7dismissed \u8BCD\u5178 / \u7C7B\u578B\u8DEF\u7531 / \u88C1\u51B3\u9636\u68AF\u7B49\u5B8C\u6574\u89C4\u7EA6\u6743\u5A01\u8BE6\u53C2 `fabric-review` skill \u7684 `ref/cite-contract.md` \u2014\u2014 bootstrap \u53EA\u7559\u53EF\u6267\u884C core\u3002\n";
|
|
52
52
|
/**
|
|
53
53
|
* Canonical bootstrap body (en) — the English parallel of
|
|
54
54
|
* {@link BOOTSTRAP_CANONICAL_ZH}. Structurally parallel (same H2 section count,
|
|
@@ -58,7 +58,7 @@ declare const BOOTSTRAP_CANONICAL_ZH = "# Fabric Bootstrap\n\n\u672C\u9879\u76EE
|
|
|
58
58
|
* in English). Byte-locked: a zh-CN machine never sees this body and an en
|
|
59
59
|
* machine never sees the ZH one, but both are install/doctor contracts.
|
|
60
60
|
*/
|
|
61
|
-
declare const BOOTSTRAP_CANONICAL_EN = "# Fabric Bootstrap\n\nThis project uses Fabric to manage cross-client AI knowledge and behavior rules. This file is synced into the managed block on both clients by `fabric install` \u2014 **do not hand-edit the block on any client**; edit here + re-run `fabric install`.\n\n## For Developers\n\nThis file is the **AI client's policy & convention config**, not dev onboarding. You don't need to read the Self-archive / Cite / Phase 0.4 details.\nAs a dev you only need to: run `fabric install` once per repo, use `fabric store bind <alias>` / `fabric store switch-write <alias>` to wire up a write store, and run `fabric doctor` when something breaks.\n**Never hand-edit `.fabric/agents.meta.json`** \u2014 derived state is rebuilt by the engine.\n\n## Dev Quickstart\n\n**What Fabric is**: a cross-client (Claude Code / Codex CLI) AI knowledge layer. Store the team/project **decisions / pitfalls / guidelines / models / processes** as markdown; hooks surface them to the AI automatically so it doesn't re-learn every time.\n\n**What you DO** vs **what the engine does (DON'T hand-edit)**:\n\n| You DO | You DON'T |\n| --- | --- |\n| Run `fabric install` once per repo | Hand-edit `.fabric/agents.meta.json` |\n| Run `fabric doctor` (--fix self-heals) on trouble | Hand-edit `.cjs` under `.claude/hooks/` |\n| Use `fabric-archive` / `fabric-review` / `fabric store ...` to manage store-backed knowledge | Hand-write any non-store knowledge root |\n| `npm install -g @fenglimg/fabric-cli@latest` to upgrade | Memorize the 35 doctor lint codes |\n\n**4-step loop**: `fabric install` (once) \u2192 bind and pick a write store \u2192 AI works normally (hook on session start + edit) \u2192 the AI writes pending entries into the current write store via MCP and returns a `pending_path` \u2192 review with the `fabric-review` skill.\n\n**Real example**: a sprite black-edge root cause was the `atlas.premultiplyAlpha` flag being inverted \u2014 once archived into the store's `knowledge/pitfalls/`, the AI auto-references it next time a similar issue shows up.\n\nSee `docs/USER-QUICKSTART.md` for the full maintainer version.\n\n## Behavior Rules\n- **
|
|
61
|
+
declare const BOOTSTRAP_CANONICAL_EN = "# Fabric Bootstrap\n\nThis project uses Fabric to manage cross-client AI knowledge and behavior rules. This file is synced into the managed block on both clients by `fabric install` \u2014 **do not hand-edit the block on any client**; edit here + re-run `fabric install`.\n\n## For Developers\n\nThis file is the **AI client's policy & convention config**, not dev onboarding. You don't need to read the Self-archive / Cite / Phase 0.4 details.\nAs a dev you only need to: run `fabric install` once per repo, use `fabric store bind <alias>` / `fabric store switch-write <alias>` to wire up a write store, and run `fabric doctor` when something breaks.\n**Never hand-edit `.fabric/agents.meta.json`** \u2014 derived state is rebuilt by the engine.\n\n## Dev Quickstart\n\n**What Fabric is**: a cross-client (Claude Code / Codex CLI) AI knowledge layer. Store the team/project **decisions / pitfalls / guidelines / models / processes** as markdown; hooks surface them to the AI automatically so it doesn't re-learn every time.\n\n**What you DO** vs **what the engine does (DON'T hand-edit)**:\n\n| You DO | You DON'T |\n| --- | --- |\n| Run `fabric install` once per repo | Hand-edit `.fabric/agents.meta.json` |\n| Run `fabric doctor` (--fix self-heals) on trouble | Hand-edit `.cjs` under `.claude/hooks/` |\n| Use `fabric-archive` / `fabric-review` / `fabric store ...` to manage store-backed knowledge | Hand-write any non-store knowledge root |\n| `npm install -g @fenglimg/fabric-cli@latest` to upgrade | Memorize the 35 doctor lint codes |\n\n**4-step loop**: `fabric install` (once) \u2192 bind and pick a write store \u2192 AI works normally (hook on session start + edit) \u2192 the AI writes pending entries into the current write store via MCP and returns a `pending_path` \u2192 review with the `fabric-review` skill.\n\n**Real example**: a sprite black-edge root cause was the `atlas.premultiplyAlpha` flag being inverted \u2014 once archived into the store's `knowledge/pitfalls/`, the AI auto-references it next time a similar issue shows up.\n\nSee `docs/USER-QUICKSTART.md` for the full maintainer version.\n\n## Behavior Rules\n- **Pre-action gating (MUST before Edit/Write)**: (1) call `fab_recall(paths=[<file-being-edited>], session_id=<client-session-id>)`; (2) optionally native-Read selected `entries[].read_path` bodies (PostToolUse records `knowledge_body_read`); (3) when skipping a hit, say `dismissed: <id> (<reason>)`. `fab_recall` no longer delivers bodies; lean default is description+index discovery (KT-GLD-0005). PreToolUse is soft nudge only per KT-DEC-0007 (never permanent gate / no `decision:block`).\n- **Archive-as-truth**: the **only** path into canonical is `fab_propose` \u2192 pending \u2192 `fabric-review`/`fab_review` approve; never auto-promote chat/logs into canonical.\n- **Never hand-edit `.fabric/agents.meta.json`** (co-location index retired; knowledge lives in mounted stores). For anomalies run `fabric doctor` / `fabric doctor --fix` on fixable state.\n\n## Knowledge Base (KB)\n- **Discovery**: the SessionStart hook lists broad-scoped entries (scoped by `semantic_scope` across three tiers: `team` team-wide / `project:<id>` this-project-only (surfaces only in repos bound to that project) / `personal` `KP-*`, all three referenced the same way); editing a file may trigger a narrow hint via the PreToolUse hook.\n- **Scope's 3 axes (why something isn't surfacing)** (KT-MOD-0001): whether an entry surfaces is decided by three **orthogonal** axes \u2014 \u2460 `semantic_scope` audience (`team` / `project:<id>` / `personal`; the wrong project binding hides it) \u2461 `relevance_scope` timing (`broad` always-on / `narrow` only when you edit a matching file) \u2462 `store` physical lib (not read without `fabric store bind`). The axis names collide (\"team\" is both an audience value and a possible store alias), so when puzzled about \"why isn't this surfacing\" run `fabric audit why-not-surfaced <id>` for a per-cause diagnosis (store unbound / scope mismatch / narrow timing).\n- **Usage**: go one-step `fab_recall(paths=[...])` to fetch the relevant KB descriptions + read paths in one call; when you need a body, do a native Read of its `entries[].read_path` (no second MCP round-trip for the body).\n- **session_id**: when calling `fab_recall`, always pass the current client session id as the `session_id` argument (Claude Code's session id is in the stdin payload; Codex's corresponding identifier likewise). This lets `fabric doctor --archive-history` and the `fabric-hint.cjs` Stop hook track cross-session debt accurately.\n- **Skills (4)**: write flow `fabric-archive` (with source-mode cold-start backfill from git/docs) / `fabric-review` (with retire-deprecation + relate-edge sub-flows); store ops `fabric-store` / `fabric-sync`.\n- **Language**: rendered per the `language` field in `~/.fabric/fabric-global.json` (machine-wide tone).\n- **Archive cadence nudge** (rc.36 / finish\u2192archive): after a significant decision lands or an edit batch reaches config `archive_edit_threshold` (default 20), lightly self-trigger `fabric-archive` at a suitable turn (max 1 per turn; not a task engine / not Stop-hook flood). Stop hook remains a soft threshold nudge per KT-DEC-0007 \u2014 without an archive cadence the KB slowly dies.\n- **Review backlog nudge** (rc.36): to judge the pending backlog, go through `fab_pending action=\"list\"` or the `pending_path` returned by `fabric-review`; don't glob the project-local `.fabric/knowledge/pending`. When the visible pending count exceeds 10, proactively propose the `fabric-review` skill at a suitable turn to batch-review and avoid draft deadlock.\n\n## Self-archive policy (v2.2 C1: lean spec)\n\nWhen a clear archival signal appears, autonomously invoke the `fabric-archive` skill at the end of that turn (AI self-trigger entry E3):\n\n- **Trigger** (either): \u2460 **User-driven normative** \u2014 the user says `\u4EE5\u540E` / `always` / `never` / `\u4E0B\u6B21` / `\u8BB0\u4E00\u4E0B`, or locks a direction with rationale after weighing \u22652 candidates, or rejects a suggestion and states a reason (the reason is knowledge); \u2461 **Wrong-turn-and-revert** \u2014 you tried path X, then after reflection switched to path Y (a two-step \"negate + replace\" structure, not mere exploratory failure).\n- **Does NOT trigger**: pure user questions / simple refactor\u00B7typo / a baseless \"I learned something\" insight.\n- **Anti-loop**: at most 1 self-invocation per turn; no repeat for the same outcome in the same session; the skill's Phase 2.5 viability gate is the backstop.\n- **Receipt (marker-free)**: just invoke the `fabric-archive` skill directly \u2014 no marker string to print: the skill routes an AI self-invocation to E3 by default (deterministic else-branch, no longer dependent on the AI emitting an exact string). The skill returns `pending_path` after writing pending \u2014 reply `undo` if it shouldn't be recorded (I'll call fab_review reject).\n\n## Cite policy (v2.2 C1: recall auto-accounting, zero first-line burden)\n\n- **Core (recall-first auto-accounting)**: before changing any file, run `fab_recall(paths=[<file-being-edited>])` first. The system auto-accounts the recalled KB as that edit's citation by \"paths recall-hit this session overlap the edit target\" \u2014\u2014 **no hand-written first reply line needed** (C1 removes the first-line `KB:` contract boilerplate: think-then-speak, recall is the real signal that a citation happened). The PreToolUse hook gives a soft nudge when it detects no relevant recall (nudge, not a gate, per KT-DEC-0007).\n- **The only time to speak up (dismissed / override)**: when you judge a recalled KB should NOT apply, say one line `dismissed: <id> (<reason>)`; reason enum `scope-mismatch | outdated | not-applicable | other:<text>`. For precise annotation you may still use a first-line `KB: <id> [applied|dismissed]` (parser retained, backward compatible).\n- **`[applied]` verification duty**: citing any id (auto or hand-written) requires first fetching the KB via fab_recall (a native Read of its body path when needed) to prevent fabricated ids. Verification failing = you cannot cite.\n- **Audit & full spec**: `fabric audit cite` reports coverage (does not block your work, only records); the full spec (contract operators / store prefix / skip\u00B7dismissed dictionaries / type routing / adjudication ladder) lives authoritatively in the `fabric-review` skill's `ref/cite-contract.md` \u2014\u2014 bootstrap keeps only the executable core.\n";
|
|
62
62
|
/**
|
|
63
63
|
* Locale-keyed canonical bodies. The single content-layer source consumers
|
|
64
64
|
* (install writer, doctor drift comparator) select from via
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
BOOTSTRAP_REGEX,
|
|
8
8
|
matchBootstrapCanonicalLocale,
|
|
9
9
|
resolveBootstrapCanonical
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-V7IUN5U2.js";
|
|
11
|
+
import "../chunk-OX6DWUK4.js";
|
|
12
|
+
import "../chunk-C7WZPYZE.js";
|
|
12
13
|
export {
|
|
13
14
|
BOOTSTRAP_CANONICAL_BY_LOCALE,
|
|
14
15
|
BOOTSTRAP_CANONICAL_EN,
|
package/dist/theme.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const ANSI: {
|
|
|
5
5
|
};
|
|
6
6
|
declare const PALETTE: {
|
|
7
7
|
readonly success: "\u001B[38;2;46;204;113m";
|
|
8
|
-
readonly warn: "\u001B[38;2;
|
|
8
|
+
readonly warn: "\u001B[38;2;180;120;0m";
|
|
9
9
|
readonly error: "\u001B[38;2;231;76;60m";
|
|
10
10
|
readonly drift: "\u001B[38;2;155;89;182m";
|
|
11
11
|
readonly ai: "\u001B[38;2;52;152;219m";
|
|
@@ -14,8 +14,11 @@ declare const PALETTE: {
|
|
|
14
14
|
readonly muted: "\u001B[2m";
|
|
15
15
|
};
|
|
16
16
|
type ThemeToken = keyof typeof PALETTE;
|
|
17
|
+
declare const PALETTE_256: Record<ThemeToken, string>;
|
|
17
18
|
declare function isColorEnabled(env?: NodeJS.ProcessEnv, isTTY?: boolean): boolean;
|
|
18
|
-
|
|
19
|
+
type ColorDepth = "none" | "ansi16" | "ansi256" | "truecolor";
|
|
20
|
+
declare function detectColorDepth(env?: NodeJS.ProcessEnv, isTTY?: boolean): ColorDepth;
|
|
21
|
+
declare function paint(token: ThemeToken, text: string, colorOn?: boolean, depth?: ColorDepth): string;
|
|
19
22
|
declare const SYMBOL_ASCII: {
|
|
20
23
|
readonly ok: "[ok]";
|
|
21
24
|
readonly warn: "[warn]";
|
|
@@ -31,4 +34,4 @@ declare const SCOPE_BADGE_TOKEN: {
|
|
|
31
34
|
};
|
|
32
35
|
declare function scopeBadge(scope: keyof typeof SCOPE_BADGE_TOKEN, colorOn?: boolean): string;
|
|
33
36
|
|
|
34
|
-
export { ANSI, PALETTE, SYMBOL_ASCII, type ThemeToken, headerRule, isColorEnabled, paint, scopeBadge, sectionBar, symbol };
|
|
37
|
+
export { ANSI, type ColorDepth, PALETTE, PALETTE_256, SYMBOL_ASCII, type ThemeToken, detectColorDepth, headerRule, isColorEnabled, paint, scopeBadge, sectionBar, symbol };
|
package/dist/theme.js
CHANGED
|
@@ -7,8 +7,8 @@ var ANSI = {
|
|
|
7
7
|
var PALETTE = {
|
|
8
8
|
success: "\x1B[38;2;46;204;113m",
|
|
9
9
|
// emerald
|
|
10
|
-
warn: "\x1B[38;2;
|
|
11
|
-
// amber
|
|
10
|
+
warn: "\x1B[38;2;180;120;0m",
|
|
11
|
+
// darker amber — ISS-20260713-068 light-terminal contrast
|
|
12
12
|
error: "\x1B[38;2;231;76;60m",
|
|
13
13
|
// alizarin
|
|
14
14
|
drift: "\x1B[38;2;155;89;182m",
|
|
@@ -21,15 +21,35 @@ var PALETTE = {
|
|
|
21
21
|
// amethyst (headers / emphasis)
|
|
22
22
|
muted: ANSI.dim
|
|
23
23
|
};
|
|
24
|
+
var PALETTE_256 = {
|
|
25
|
+
success: "\x1B[38;5;77m",
|
|
26
|
+
warn: "\x1B[38;5;178m",
|
|
27
|
+
error: "\x1B[38;5;203m",
|
|
28
|
+
drift: "\x1B[38;5;141m",
|
|
29
|
+
ai: "\x1B[38;5;75m",
|
|
30
|
+
human: "\x1B[38;5;80m",
|
|
31
|
+
accent: "\x1B[38;5;141m",
|
|
32
|
+
muted: ANSI.dim
|
|
33
|
+
};
|
|
24
34
|
function isColorEnabled(env = process.env, isTTY) {
|
|
25
35
|
if (env.NO_COLOR) return false;
|
|
26
36
|
const force = env.FORCE_COLOR;
|
|
27
37
|
if (force !== void 0) return force !== "0" && force.toLowerCase() !== "false";
|
|
28
38
|
return Boolean(isTTY ?? process.stdout.isTTY);
|
|
29
39
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
32
|
-
|
|
40
|
+
function detectColorDepth(env = process.env, isTTY) {
|
|
41
|
+
if (!isColorEnabled(env, isTTY)) return "none";
|
|
42
|
+
const colorterm = (env.COLORTERM || "").toLowerCase();
|
|
43
|
+
if (colorterm.includes("truecolor") || colorterm.includes("24bit")) return "truecolor";
|
|
44
|
+
const term = (env.TERM || "").toLowerCase();
|
|
45
|
+
if (term.includes("256color") || term.includes("256")) return "ansi256";
|
|
46
|
+
if (term === "linux" || term === "dumb") return "ansi16";
|
|
47
|
+
return "truecolor";
|
|
48
|
+
}
|
|
49
|
+
function paint(token, text, colorOn = isColorEnabled(), depth = detectColorDepth()) {
|
|
50
|
+
if (!colorOn || depth === "none") return text;
|
|
51
|
+
const pal = depth === "ansi256" ? PALETTE_256 : PALETTE;
|
|
52
|
+
return `${pal[token]}${text}${ANSI.reset}`;
|
|
33
53
|
}
|
|
34
54
|
var SYMBOL_ASCII = { ok: "[ok]", warn: "[warn]", error: "[error]" };
|
|
35
55
|
var SYMBOL_GLYPH = { ok: "[ok] \u2713", warn: "[warn] !", error: "[error] x" };
|
|
@@ -54,7 +74,9 @@ function scopeBadge(scope, colorOn = isColorEnabled()) {
|
|
|
54
74
|
export {
|
|
55
75
|
ANSI,
|
|
56
76
|
PALETTE,
|
|
77
|
+
PALETTE_256,
|
|
57
78
|
SYMBOL_ASCII,
|
|
79
|
+
detectColorDepth,
|
|
58
80
|
headerRule,
|
|
59
81
|
isColorEnabled,
|
|
60
82
|
paint,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as AgentsIdentitySource, d as AgentsMeta, e as AgentsMetaCountersEnvelope, g as AgentsMetaKnowledgeTypeCounters, A as AgentsMetaNode, b as AgentsTopologyType, h as AiLedgerEntry, i as AuditMode, C as ClientPaths, D as DefaultLayerFilter, F as FabricConfig, j as FabricLanguage, m as HumanLedgerEntry, H as HumanLockEntry, L as LedgerEntry, n as McpPayloadLimits, o as RecallScore, p as RecallScoreBreakdown, q as RuleDescription, r as RuleDescriptionIndexItem } from '../index-
|
|
1
|
+
export { a as AgentsIdentitySource, d as AgentsMeta, e as AgentsMetaCountersEnvelope, g as AgentsMetaKnowledgeTypeCounters, A as AgentsMetaNode, b as AgentsTopologyType, h as AiLedgerEntry, i as AuditMode, C as ClientPaths, D as DefaultLayerFilter, F as FabricConfig, j as FabricLanguage, m as HumanLedgerEntry, H as HumanLockEntry, L as LedgerEntry, n as McpPayloadLimits, o as RecallScore, p as RecallScoreBreakdown, q as RuleDescription, r as RuleDescriptionIndexItem } from '../index-KvxqMZV1.js';
|
|
2
2
|
import 'zod';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fenglimg/fabric-shared",
|
|
3
|
-
"version": "2.3.0-rc.
|
|
3
|
+
"version": "2.3.0-rc.16",
|
|
4
4
|
"description": "Fabric shared types — Zod schemas, i18n, atomic-write helpers, MCP payload guard, error classes. Consumed by @fenglimg/fabric-server + @fenglimg/fabric-cli.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "wangzhichao <fenglimg90@gmail.com>",
|