@fenglimg/fabric-shared 2.3.0-rc.12 → 2.3.0-rc.15
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-YLIWE46B.js → chunk-47M6HKBU.js} +75 -21
- package/dist/{chunk-TEITGZY3.js → chunk-5M3HB554.js} +25 -1
- package/dist/{chunk-KFFBQRL5.js → chunk-DNIICOSG.js} +3 -3
- package/dist/{chunk-ASS2KBB7.js → chunk-OX6DWUK4.js} +31 -2
- package/dist/i18n/index.js +3 -2
- package/dist/index.d.ts +441 -3
- package/dist/index.js +132 -28
- 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/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveGlobalLocale
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OX6DWUK4.js";
|
|
4
4
|
|
|
5
5
|
// src/i18n/locales/en.ts
|
|
6
6
|
var enMessages = {
|
|
@@ -48,6 +48,19 @@ var enMessages = {
|
|
|
48
48
|
"cli.inspect.explain.census": "census",
|
|
49
49
|
"cli.inspect.explain.census-total": "total {total}",
|
|
50
50
|
"cli.inspect.error": "inspect failed: {message}",
|
|
51
|
+
// `fabric preview` — local read-only knowledge preview web server (loopback-only).
|
|
52
|
+
"cli.preview.description": "Start a local read-only knowledge preview (browse in your browser, grouped by scope)",
|
|
53
|
+
"cli.preview.arg.port": "Port to listen on (default 7777).",
|
|
54
|
+
"cli.preview.arg.host": "Host to bind (default 127.0.0.1, loopback only).",
|
|
55
|
+
"cli.preview.arg.open": "Open the browser on start (default on; use --no-open to disable).",
|
|
56
|
+
"cli.preview.arg.target": "Override the project root (defaults to cwd).",
|
|
57
|
+
"cli.preview.arg.variant": "Default style variant to open (default: lumen; all styles at /gallery).",
|
|
58
|
+
"cli.preview.gallery-hint": "All styles gallery: {url}",
|
|
59
|
+
"cli.preview.started": "Knowledge preview started: {url}",
|
|
60
|
+
"cli.preview.opening": "Opening browser\u2026",
|
|
61
|
+
"cli.preview.stop-hint": "Press Ctrl-C to stop.",
|
|
62
|
+
"cli.preview.stopped": "Preview stopped.",
|
|
63
|
+
"cli.preview.error": "preview failed: {message}",
|
|
51
64
|
"cli.audit.description": "Knowledge & telemetry audit (cite/conflicts/history/metrics)",
|
|
52
65
|
// `fabric audit cite` — 0%-recall-coverage self-diagnosis hints.
|
|
53
66
|
"cli.audit.cite.recall-mismatch-hint": "recall coverage is 0 despite {recalls} recall(s) across {sessions} session(s) \u2014 none shared a session with an edit. The recall caller is likely passing a non-client session_id (correlation is session-scoped). See AGENTS.md: pass the real client session_id to fab_recall.",
|
|
@@ -168,7 +181,7 @@ var enMessages = {
|
|
|
168
181
|
"doctor.section.fixable": "Fixable errors:",
|
|
169
182
|
"doctor.section.manual": "Manual errors:",
|
|
170
183
|
"doctor.section.warnings": "Warnings:",
|
|
171
|
-
"doctor.section.fix-knowledge-mutations": "
|
|
184
|
+
"doctor.section.fix-knowledge-mutations": "Knowledge mutations (via --fix):",
|
|
172
185
|
// flat-design follow-up: the remaining doctor UI-shell strings (TL;DR header,
|
|
173
186
|
// --fix mutation plan, filtered --help) move off hardcoded English into i18n so
|
|
174
187
|
// the whole `fabric doctor` surface honours the machine locale. USAGE/OPTIONS/
|
|
@@ -183,6 +196,14 @@ var enMessages = {
|
|
|
183
196
|
"doctor.store.no-global-config": "no global Fabric config \u2014 run `fabric install --global <url>`",
|
|
184
197
|
"doctor.store.missing-required": "required store '{id}' is not mounted; run `fabric store mount`",
|
|
185
198
|
"doctor.store.unbound": "store '{alias}' is mounted but not bound to this project; run `fabric store bind {alias}` to read its knowledge here (then `fabric store switch-write {alias}` to write team knowledge into it)",
|
|
199
|
+
"doctor.store.empty": "bound store(s) have 0 knowledge entries ({stores}) \u2014 first-hit cannot succeed until you seed or clone knowledge; run `fabric first-hit --seed` (empty local store) or bind a remote team store with content",
|
|
200
|
+
"doctor.store.no-write-target": "no active write store for this project \u2014 bind and switch-write: `fabric store bind <alias>` then `fabric store switch-write <alias>` (or re-run `fabric install`)",
|
|
201
|
+
"doctor.store.no-match": "knowledge exists but no entry matches the probe paths \u2014 try broader paths or add relevance_paths for your modules",
|
|
202
|
+
"doctor.store.write-target-mismatch": "active write store '{alias}' is not a valid team write target for this project \u2014 run `fabric store switch-write <mounted-team-alias>`",
|
|
203
|
+
"doctor.store.first-hit-missing-required": "required store(s) not mounted: {ids} \u2014 bind/clone them then re-run `fabric first-hit`",
|
|
204
|
+
"doctor.store.first-hit-unreachable": "bound store dir missing on disk: {aliases} \u2014 remount or re-clone, then `fabric doctor`",
|
|
205
|
+
"doctor.store.hooks-missing": "knowledge present but SessionStart/PreToolUse hooks missing \u2014 re-run `fabric install`",
|
|
206
|
+
"doctor.store.first-hit-ok": "first-hit ready: {count} knowledge entries across {stores}",
|
|
186
207
|
"doctor.store.alias-drift": "by-alias readability link(s) out of sync for {refs}; run `fabric doctor --fix` to repair ~/.fabric/stores/by-alias/",
|
|
187
208
|
"doctor.store.local-only": "store '{alias}' is local-only; add a git remote to back it up",
|
|
188
209
|
"doctor.store.executable": "store '{alias}' contains executable/script files ({files}) \u2014 stores are data-only; Fabric never runs them (S65)",
|
|
@@ -191,15 +212,16 @@ var enMessages = {
|
|
|
191
212
|
"doctor.store.related-broken": "{count} broken `related` link(s) point at ids absent from the corpus: {samples}{overflow} \u2014 fix the related edges via `fab_review` (modify) or edit the entry frontmatter",
|
|
192
213
|
"doctor.store.related-hub": "related graph hubs (top {shown} of {total} referenced): {top}",
|
|
193
214
|
"doctor.store.unreachable": "store '{alias}' is in the read-set but unreachable on disk ({reason}); run `fabric store mount` / re-clone it, then `fabric doctor`",
|
|
215
|
+
"doctor.store.unreachable-bound": "bound store dir missing on disk: {stores} \u2014 re-clone or remount, then fabric doctor",
|
|
194
216
|
"doctor.store.consumption-heatmap": "top consumed (last {days}d, {consumed}/{total} entries read across {windows} window(s)): {top}",
|
|
195
217
|
"doctor.store.consumption-zero": "{count} entries never consumed in the last {days}d: {sample}{overflow} \u2014 review for retirement via `fab_review` (consumption is one signal, not proof of rot)",
|
|
196
218
|
"doctor.store.overflow-more": ", \u2026(+{count} more)",
|
|
197
|
-
"doctor.fix-plan.header": "
|
|
219
|
+
"doctor.fix-plan.header": "knowledge mutation plan ({count} total)",
|
|
198
220
|
"doctor.fix-plan.preview": "preview:",
|
|
199
221
|
"doctor.fix-plan.more": "... and {count} more",
|
|
200
222
|
"doctor.help.tagline": "Diagnose and fix Fabric workspace issues",
|
|
201
223
|
"doctor.help.flag.target": "Override project root (defaults to cwd)",
|
|
202
|
-
"doctor.help.flag.fix": "Auto-fix
|
|
224
|
+
"doctor.help.flag.fix": "Auto-fix derived state + auto-safe knowledge lint mutations",
|
|
203
225
|
"doctor.help.flag.json": "Output as JSON for programmatic consumption",
|
|
204
226
|
"doctor.help.flag.verbose": "Show maintainer-audience action hints",
|
|
205
227
|
"doctor.help.example.run": "Run diagnostics",
|
|
@@ -288,11 +310,11 @@ var enMessages = {
|
|
|
288
310
|
"cite-coverage.skip.architectural": "architectural layer",
|
|
289
311
|
"cite-coverage.skip.other": "other",
|
|
290
312
|
"cli.doctor.args.target.description": "Target project path. Defaults to --target, then EXTERNAL_FIXTURE_PATH, then cwd.",
|
|
291
|
-
"cli.doctor.args.fix.description": "Repair derived Fabric state (meta + indexes).",
|
|
313
|
+
"cli.doctor.args.fix.description": "Repair derived Fabric state (meta + indexes) and apply auto-safe knowledge lint mutations (store counter floor, stale session-hints cleanup). Decay/frontmatter lints stay report-only \u2014 remediate those via fabric-review.",
|
|
292
314
|
"cli.doctor.args.json.description": "Print the doctor report as JSON.",
|
|
293
315
|
"cli.doctor.args.strict.description": "Treat warnings as failures.",
|
|
294
|
-
"cli.doctor.args.fix-knowledge.description": "
|
|
295
|
-
"cli.doctor.args.yes.description": "Skip the
|
|
316
|
+
"cli.doctor.args.fix-knowledge.description": "Legacy alias wording: knowledge lint mutations now run under `fabric doctor --fix` (store counter floor + stale session-hints cleanup). Decay lints (orphan demote / stale archive) remain report-only \u2014 remediate via fabric-review. Default doctor run remains report-only.",
|
|
317
|
+
"cli.doctor.args.yes.description": "Skip the knowledge-mutation safety confirm inside `fabric doctor --fix`. Required for non-tty invocations unless FABRIC_NONINTERACTIVE=1 is set in the environment.",
|
|
296
318
|
// rc.35 TASK-12 (P0-11): --verbose unfolds maintainer-audience hints.
|
|
297
319
|
"cli.doctor.args.verbose.description": "Show all action hints including maintainer-audience ones (Fabric contributors editing the source tree). By default these are folded for npm end users.",
|
|
298
320
|
"doctor.maintainer-hint-folded": "(maintainer-only remediation \u2014 re-run with `fabric doctor --verbose` to see)",
|
|
@@ -425,9 +447,9 @@ var enMessages = {
|
|
|
425
447
|
"doctor.check.retired_reference.ok": "No retired tool/field names linger in the bootstrap, SKILL.md, or installed hooks.",
|
|
426
448
|
"doctor.check.retired_reference.message": "{count} stale pointer(s) to retired tool/field names in agent-facing text: {sample}",
|
|
427
449
|
"doctor.check.retired_reference.remediation": "Update the flagged text to the replacement token (or remove it), then re-run `fabric install` to resync the dogfood mirrors.",
|
|
428
|
-
// v2.0.0-rc.33 W3-6 (P1-13): SKILL.md token budget lint. warn >
|
|
450
|
+
// v2.0.0-rc.33 W3-6 (P1-13): SKILL.md token budget lint. warn > 8K / error > 10K tokens (chars/3 estimate). Anthropic recommends SKILL.md hot path stay ~3K, but the two watched skills (fabric-archive/review) are the richest core skills and legitimately run larger; warn sits at 8K (a 2K reaction buffer below the 10K install-abort hard cap) rather than 5K. Over 10K is blocking (wasted model context + load latency).
|
|
429
451
|
"doctor.check.skill_token_budget.name": "Skill token budget",
|
|
430
|
-
"doctor.check.skill_token_budget.ok": "All .claude/skills/<slug>/SKILL.md files are within token budget (warn
|
|
452
|
+
"doctor.check.skill_token_budget.ok": "All .claude/skills/<slug>/SKILL.md files are within token budget (warn 8K / error 10K).",
|
|
431
453
|
"doctor.check.skill_token_budget.message.singular": "{count} SKILL.md exceeds the token budget: {list}. Sink detail into ref/ for progressive disclosure.",
|
|
432
454
|
"doctor.check.skill_token_budget.message.plural": "{count} SKILL.md files exceed the token budget: {list}. Sink detail into ref/ for progressive disclosure.",
|
|
433
455
|
"doctor.check.skill_token_budget.remediation": "Move detailed phase / worked-examples / decision tables out of the SKILL.md hot path into `templates/skills/<slug>/ref/*.md`. Keep SKILL.md focused on trigger-gate + key-phase summaries; see W1 progressive disclosure split. Re-run `fabric install` to sync both client subtrees.",
|
|
@@ -511,7 +533,7 @@ var enMessages = {
|
|
|
511
533
|
"doctor.check.index_drift.ok": "agents.meta.json counters envelope is at or above the highest existing canonical counter for every (layer, type) pair.",
|
|
512
534
|
"doctor.check.index_drift.message.singular": "{count} (layer, type) counter slot have drifted below the observed canonical maximum (next allocate would collide). First: {detail}.",
|
|
513
535
|
"doctor.check.index_drift.message.plural": "{count} (layer, type) counter slots have drifted below the observed canonical maximum (next allocate would collide). First: {detail}.",
|
|
514
|
-
"doctor.check.index_drift.remediation": "Run `fabric doctor --fix
|
|
536
|
+
"doctor.check.index_drift.remediation": "Run `fabric doctor --fix` to bump agents.meta.json counters to max_observed + 1.",
|
|
515
537
|
"doctor.check.underseeded.name": "Knowledge underseeded",
|
|
516
538
|
"doctor.check.underseeded.ok": "Knowledge corpus has {count} canonical entries (>= {threshold}).",
|
|
517
539
|
"doctor.check.underseeded.message.singular": "Knowledge corpus has only {count} canonical entry (< {threshold} threshold). The plan_context retrieval surface is below its useful floor.",
|
|
@@ -521,7 +543,7 @@ var enMessages = {
|
|
|
521
543
|
"doctor.check.session_hints_stale.ok": "No session-hints cache files older than {days} days under .fabric/.cache/.",
|
|
522
544
|
"doctor.check.session_hints_stale.message.singular": "{count} session-hints cache file under .fabric/.cache/ is older than {days} days. First: {detail}.",
|
|
523
545
|
"doctor.check.session_hints_stale.message.plural": "{count} session-hints cache files under .fabric/.cache/ are older than {days} days. First: {detail}.",
|
|
524
|
-
"doctor.check.session_hints_stale.remediation": "Run `fabric doctor --fix
|
|
546
|
+
"doctor.check.session_hints_stale.remediation": "Run `fabric doctor --fix` to delete stale session-hints cache files.",
|
|
525
547
|
"doctor.check.hook_cache_writable.name": "Hook cache writable",
|
|
526
548
|
"doctor.check.hook_cache_writable.ok": "Hook sidecar cache path {path} accepts write probes.",
|
|
527
549
|
"doctor.check.hook_cache_writable.message": "Hook sidecar cache path {path} is not writable; hook state updates will silently fail. Error: {error}.",
|
|
@@ -1019,6 +1041,11 @@ var enMessages = {
|
|
|
1019
1041
|
// per [[fabric-serve-quarantine-not-delete]]. Restore from git history when
|
|
1020
1042
|
// the web UI surface is re-enabled.
|
|
1021
1043
|
// v2.0.0-rc.29 TASK-008 (BUG-L2): onboard-coverage i18n keys.
|
|
1044
|
+
"cli.first-hit.description": "Prove install\u2192first-hit readiness (bind + non-empty knowledge surface)",
|
|
1045
|
+
"cli.first-hit.args.json.description": "Machine-readable JSON report",
|
|
1046
|
+
"cli.first-hit.args.target.description": "Project root (default: cwd)",
|
|
1047
|
+
"cli.first-hit.args.seed.description": "If empty store, write minimal starter knowledge entries",
|
|
1048
|
+
"cli.first-hit.args.paths.description": "Comma-separated probe paths for surface check",
|
|
1022
1049
|
"cli.onboard-coverage.description": "Report S5 onboard-slot coverage for the workspace. Used by the fabric-archive Skill's first-run phase to detect unclaimed project-tone slots.",
|
|
1023
1050
|
"cli.onboard-coverage.args.json.description": "Emit machine-readable JSON to stdout instead of the human table.",
|
|
1024
1051
|
"cli.onboard-coverage.args.target.description": "Override the project root (defaults to cwd).",
|
|
@@ -1384,6 +1411,19 @@ var zhCNMessages = {
|
|
|
1384
1411
|
"cli.inspect.explain.census": "\u5168\u96C6\u666E\u67E5",
|
|
1385
1412
|
"cli.inspect.explain.census-total": "\u603B\u8BA1 {total}",
|
|
1386
1413
|
"cli.inspect.error": "inspect \u5931\u8D25:{message}",
|
|
1414
|
+
// `fabric preview` — 本地只读知识预览 web 服务(loopback-only)。
|
|
1415
|
+
"cli.preview.description": "\u542F\u52A8\u672C\u5730\u53EA\u8BFB\u77E5\u8BC6\u9884\u89C8\u9875(\u6D4F\u89C8\u5668\u91CC\u6309\u53D7\u4F17\u5206\u7EC4\u6D4F\u89C8)",
|
|
1416
|
+
"cli.preview.arg.port": "\u76D1\u542C\u7AEF\u53E3(\u9ED8\u8BA4 7777)\u3002",
|
|
1417
|
+
"cli.preview.arg.host": "\u76D1\u542C\u5730\u5740(\u9ED8\u8BA4 127.0.0.1,\u4EC5\u672C\u673A\u53EF\u8BBF\u95EE)\u3002",
|
|
1418
|
+
"cli.preview.arg.open": "\u542F\u52A8\u540E\u81EA\u52A8\u6253\u5F00\u6D4F\u89C8\u5668(\u9ED8\u8BA4\u5F00;\u4F20 --no-open \u5173\u95ED)\u3002",
|
|
1419
|
+
"cli.preview.arg.target": "\u8986\u76D6\u9879\u76EE\u6839\u76EE\u5F55(\u9ED8\u8BA4\u53D6 cwd)\u3002",
|
|
1420
|
+
"cli.preview.arg.variant": "\u9ED8\u8BA4\u6253\u5F00\u7684\u6837\u5F0F\u53D8\u4F53(\u9ED8\u8BA4 lumen;\u5168\u90E8\u98CE\u683C\u89C1 /gallery)\u3002",
|
|
1421
|
+
"cli.preview.gallery-hint": "\u6240\u6709\u6837\u5F0F\u753B\u5ECA:{url}",
|
|
1422
|
+
"cli.preview.started": "\u77E5\u8BC6\u9884\u89C8\u5DF2\u542F\u52A8:{url}",
|
|
1423
|
+
"cli.preview.opening": "\u6B63\u5728\u6253\u5F00\u6D4F\u89C8\u5668\u2026",
|
|
1424
|
+
"cli.preview.stop-hint": "\u6309 Ctrl-C \u505C\u6B62\u3002",
|
|
1425
|
+
"cli.preview.stopped": "\u9884\u89C8\u5DF2\u505C\u6B62\u3002",
|
|
1426
|
+
"cli.preview.error": "preview \u5931\u8D25:{message}",
|
|
1387
1427
|
"cli.audit.description": "\u77E5\u8BC6\u4E0E\u9065\u6D4B\u5BA1\u8BA1 (cite/conflicts/history/metrics)",
|
|
1388
1428
|
// `fabric audit cite` — recall 覆盖率为 0 的自诊断提示。
|
|
1389
1429
|
"cli.audit.cite.recall-mismatch-hint": "recall \u8986\u76D6\u7387\u4E3A 0,\u4F46\u672C\u7A97\u53E3\u6709 {recalls} \u6B21 recall(\u5206\u5E03\u5728 {sessions} \u4E2A\u4F1A\u8BDD)\u2014\u2014 \u6CA1\u6709\u4E00\u4E2A\u4E0E\u7F16\u8F91\u5171\u4EAB\u4F1A\u8BDD\u3002\u591A\u534A\u662F fab_recall \u8C03\u7528\u65B9\u4F20\u4E86\u975E\u5BA2\u6237\u7AEF session_id(\u5173\u8054\u6309\u4F1A\u8BDD\u9694\u79BB)\u3002\u89C1 AGENTS.md:fab_recall \u5FC5\u987B\u4F20\u5165\u771F\u5B9E\u5BA2\u6237\u7AEF session_id\u3002",
|
|
@@ -1499,7 +1539,7 @@ var zhCNMessages = {
|
|
|
1499
1539
|
"doctor.section.fixable": "\u53EF\u4FEE\u590D\u9519\u8BEF\uFF1A",
|
|
1500
1540
|
"doctor.section.manual": "\u9700\u624B\u52A8\u4FEE\u590D\uFF1A",
|
|
1501
1541
|
"doctor.section.warnings": "\u8B66\u544A\uFF1A",
|
|
1502
|
-
"doctor.section.fix-knowledge-mutations": "
|
|
1542
|
+
"doctor.section.fix-knowledge-mutations": "\u77E5\u8BC6\u4FA7\u53D8\u66F4\uFF1A",
|
|
1503
1543
|
// flat-design follow-up: doctor 剩余的 UI-shell 文案(TL;DR 头、--fix 变更计划、
|
|
1504
1544
|
// 过滤版 --help)从硬编码英文搬进 i18n,让整个 `fabric doctor` 输出跟随机器语言。
|
|
1505
1545
|
// USAGE/OPTIONS/EXAMPLES 标签保持英文,与其它命令 --help 的 citty renderUsage 对齐。
|
|
@@ -1512,6 +1552,14 @@ var zhCNMessages = {
|
|
|
1512
1552
|
"doctor.store.no-global-config": "\u65E0\u5168\u5C40 Fabric \u914D\u7F6E \u2014\u2014 \u8FD0\u884C `fabric install --global <url>`",
|
|
1513
1553
|
"doctor.store.missing-required": "\u5FC5\u9700 store '{id}' \u672A\u6302\u8F7D;\u8FD0\u884C `fabric store mount`",
|
|
1514
1554
|
"doctor.store.unbound": "store '{alias}' \u5DF2\u6302\u8F7D\u4F46\u672A\u7ED1\u5B9A\u5230\u672C\u9879\u76EE;\u8FD0\u884C `fabric store bind {alias}` \u5373\u53EF\u5728\u6B64\u8BFB\u53D6\u5B83\u7684\u77E5\u8BC6(\u518D\u7528 `fabric store switch-write {alias}` \u628A\u56E2\u961F\u77E5\u8BC6\u5199\u5165\u5B83)",
|
|
1555
|
+
"doctor.store.empty": "\u5DF2\u7ED1\u5B9A store \u77E5\u8BC6\u6761\u6570\u4E3A 0\uFF08{stores}\uFF09\u2014\u2014\u5728 seed \u6216 clone \u6709\u5185\u5BB9\u524D\u65E0\u6CD5 first-hit\uFF1B\u8FD0\u884C `fabric first-hit --seed`\uFF08\u7A7A\u672C\u5730\u5E93\uFF09\u6216\u7ED1\u5B9A\u5E26\u5185\u5BB9\u7684\u8FDC\u7A0B team store",
|
|
1556
|
+
"doctor.store.no-write-target": "\u672C\u9879\u76EE\u65E0\u6D3B\u52A8\u5199\u5E93 \u2014\u2014 \u5148 bind \u518D switch-write\uFF1A`fabric store bind <alias>` \u7136\u540E `fabric store switch-write <alias>`\uFF08\u6216\u91CD\u8DD1 `fabric install`\uFF09",
|
|
1557
|
+
"doctor.store.no-match": "\u77E5\u8BC6\u5B58\u5728\u4F46\u4E0E\u63A2\u6D4B\u8DEF\u5F84\u65E0\u5339\u914D \u2014\u2014 \u653E\u5BBD paths \u6216\u4E3A\u6A21\u5757\u8865 relevance_paths",
|
|
1558
|
+
"doctor.store.write-target-mismatch": "\u6D3B\u52A8\u5199\u5E93 '{alias}' \u4E0D\u662F\u672C\u9879\u76EE\u7684\u6709\u6548 team \u5199\u76EE\u6807 \u2014\u2014 \u8FD0\u884C `fabric store switch-write <\u5DF2\u6302\u8F7D team \u522B\u540D>`",
|
|
1559
|
+
"doctor.store.first-hit-missing-required": "\u5FC5\u9700 store \u672A\u6302\u8F7D: {ids} \u2014\u2014 \u5148 bind/clone \u518D\u8DD1 `fabric first-hit`",
|
|
1560
|
+
"doctor.store.first-hit-unreachable": "\u5DF2\u7ED1\u5B9A store \u76EE\u5F55\u78C1\u76D8\u7F3A\u5931: {aliases} \u2014\u2014 remount/re-clone \u540E\u8DD1 `fabric doctor`",
|
|
1561
|
+
"doctor.store.hooks-missing": "\u77E5\u8BC6\u5DF2\u6709\u4F46 SessionStart/PreToolUse hooks \u7F3A\u5931 \u2014\u2014 \u91CD\u8DD1 `fabric install`",
|
|
1562
|
+
"doctor.store.first-hit-ok": "first-hit \u5C31\u7EEA\uFF1A{count} \u6761\u77E5\u8BC6\uFF0Cstore\uFF1A{stores}",
|
|
1515
1563
|
"doctor.store.alias-drift": "by-alias \u53EF\u8BFB\u6027\u8F6F\u94FE\u4E0E\u6CE8\u518C\u8868\u4E0D\u540C\u6B65:{refs};\u8FD0\u884C `fabric doctor --fix` \u4FEE\u590D ~/.fabric/stores/by-alias/",
|
|
1516
1564
|
"doctor.store.local-only": "store '{alias}' \u4EC5\u672C\u5730;\u52A0\u4E00\u4E2A git remote \u4EE5\u5907\u4EFD",
|
|
1517
1565
|
"doctor.store.executable": "store '{alias}' \u542B\u53EF\u6267\u884C/\u811A\u672C\u6587\u4EF6({files})\u2014\u2014 store \u4EC5\u5B58\u6570\u636E;Fabric \u4ECE\u4E0D\u8FD0\u884C\u5B83\u4EEC (S65)",
|
|
@@ -1520,15 +1568,16 @@ var zhCNMessages = {
|
|
|
1520
1568
|
"doctor.store.related-broken": "{count} \u6761 `related` \u94FE\u63A5\u6307\u5411\u8BED\u6599\u4E2D\u4E0D\u5B58\u5728\u7684 id:{samples}{overflow} \u2014\u2014 \u901A\u8FC7 `fab_review` (modify) \u4FEE\u590D related \u8FB9,\u6216\u7F16\u8F91\u6761\u76EE frontmatter",
|
|
1521
1569
|
"doctor.store.related-hub": "related \u56FE\u8C31\u67A2\u7EBD(\u524D {shown} / \u5171 {total} \u4E2A\u88AB\u5F15\u7528):{top}",
|
|
1522
1570
|
"doctor.store.unreachable": "store '{alias}' \u5728 read-set \u4E2D\u4F46\u78C1\u76D8\u4E0A\u4E0D\u53EF\u8FBE({reason});\u8FD0\u884C `fabric store mount` / \u91CD\u65B0 clone,\u518D\u8DD1 `fabric doctor`",
|
|
1571
|
+
"doctor.store.unreachable-bound": "\u5DF2\u7ED1\u5B9A store \u7684\u78C1\u76D8\u76EE\u5F55\u7F3A\u5931\uFF1A{stores} \u2014 \u8BF7 re-clone \u6216 remount\uFF0C\u518D\u8DD1 fabric doctor",
|
|
1523
1572
|
"doctor.store.consumption-heatmap": "\u6D88\u8D39\u70ED\u533A(\u8FD1 {days}d,{consumed}/{total} \u6761\u88AB\u8BFB,\u8DE8 {windows} \u4E2A\u7A97\u53E3):{top}",
|
|
1524
1573
|
"doctor.store.consumption-zero": "{count} \u6761\u5728\u8FD1 {days}d \u5185\u4ECE\u672A\u88AB\u6D88\u8D39:{sample}{overflow} \u2014\u2014 \u901A\u8FC7 `fab_review` \u8003\u8651\u6DD8\u6C70(\u6D88\u8D39\u91CF\u53EA\u662F\u4FE1\u53F7\u4E4B\u4E00,\u975E\u9648\u65E7\u7684\u8BC1\u636E)",
|
|
1525
1574
|
"doctor.store.overflow-more": ", \u2026(+{count} \u6761)",
|
|
1526
|
-
"doctor.fix-plan.header": "
|
|
1575
|
+
"doctor.fix-plan.header": "\u77E5\u8BC6\u4FA7\u53D8\u66F4\u8BA1\u5212(\u5171 {count} \u9879)",
|
|
1527
1576
|
"doctor.fix-plan.preview": "\u9884\u89C8:",
|
|
1528
1577
|
"doctor.fix-plan.more": "... \u8FD8\u6709 {count} \u9879",
|
|
1529
1578
|
"doctor.help.tagline": "\u8BCA\u65AD\u5E76\u4FEE\u590D Fabric \u5DE5\u4F5C\u533A\u95EE\u9898",
|
|
1530
1579
|
"doctor.help.flag.target": "\u8986\u76D6\u9879\u76EE\u6839\u76EE\u5F55(\u9ED8\u8BA4\u5F53\u524D\u76EE\u5F55)",
|
|
1531
|
-
"doctor.help.flag.fix": "\u81EA\u52A8\u4FEE\u590D(\u6D3E\u751F\u72B6\u6001 + \u77E5\u8BC6
|
|
1580
|
+
"doctor.help.flag.fix": "\u81EA\u52A8\u4FEE\u590D(\u6D3E\u751F\u72B6\u6001 + \u77E5\u8BC6\u4FA7 cache/counter \u53D8\u66F4)",
|
|
1532
1581
|
"doctor.help.flag.json": "\u4EE5 JSON \u8F93\u51FA\u4F9B\u7A0B\u5E8F\u6D88\u8D39",
|
|
1533
1582
|
"doctor.help.flag.verbose": "\u663E\u793A\u9762\u5411\u7EF4\u62A4\u8005\u7684\u64CD\u4F5C\u63D0\u793A",
|
|
1534
1583
|
"doctor.help.example.run": "\u8FD0\u884C\u8BCA\u65AD",
|
|
@@ -1611,11 +1660,11 @@ var zhCNMessages = {
|
|
|
1611
1660
|
"cite-coverage.skip.architectural": "\u67B6\u6784\u5C42",
|
|
1612
1661
|
"cite-coverage.skip.other": "\u5176\u4ED6",
|
|
1613
1662
|
"cli.doctor.args.target.description": "\u76EE\u6807\u9879\u76EE\u8DEF\u5F84\u3002\u9ED8\u8BA4\u4F9D\u6B21\u4F7F\u7528 --target\u3001EXTERNAL_FIXTURE_PATH\u3001\u5F53\u524D\u76EE\u5F55\u3002",
|
|
1614
|
-
"cli.doctor.args.fix.description": "\u4FEE\u590D
|
|
1663
|
+
"cli.doctor.args.fix.description": "\u81EA\u52A8\u4FEE\u590D\u6D3E\u751F\u72B6\u6001\uFF08meta/\u7D22\u5F15/\u9501\uFF09\u4E0E\u77E5\u8BC6\u4FA7\u53D8\u66F4\uFF08store \u8BA1\u6570\u5668 floor\u3001\u9648\u65E7 session-hints \u7F13\u5B58\u6E05\u7406\uFF09\u3002\u8870\u51CF\u7C7B lint(orphan demote / stale archive)\u4ECD\u53EA\u8BFB\u4E0A\u62A5 \u2014 \u8BF7\u8D70 fab_review\u3002",
|
|
1615
1664
|
"cli.doctor.args.json.description": "\u4EE5 JSON \u8F93\u51FA doctor \u62A5\u544A\u3002",
|
|
1616
1665
|
"cli.doctor.args.strict.description": "\u5C06 warning \u4E5F\u89C6\u4E3A\u5931\u8D25\u3002",
|
|
1617
|
-
"cli.doctor.args.fix-knowledge.description": "\
|
|
1618
|
-
"cli.doctor.args.yes.description": "\u8DF3\u8FC7 --fix
|
|
1666
|
+
"cli.doctor.args.fix-knowledge.description": "\uFF08\u5185\u90E8/legacy \u540D\u79F0\uFF09\u77E5\u8BC6\u4FA7 mutation \u81C2\uFF0C\u73B0\u5DF2\u7531 `fabric doctor --fix` \u4E00\u5E76\u8C03\u7528\u3002\u52FF\u518D\u5355\u72EC\u4F9D\u8D56 --fix-knowledge\u3002",
|
|
1667
|
+
"cli.doctor.args.yes.description": "\u8DF3\u8FC7 --fix \u77E5\u8BC6\u4FA7\u5B89\u5168\u786E\u8BA4\uFF1B\u975E tty \u8C03\u7528\u5FC5\u987B\u663E\u5F0F\u8BBE\u7F6E\u8BE5\u6807\u8BB0\uFF0C\u6216\u5728\u73AF\u5883\u53D8\u91CF\u4E2D\u8BBE\u7F6E FABRIC_NONINTERACTIVE=1\u3002",
|
|
1619
1668
|
// rc.35 TASK-12 (P0-11): --verbose 展开 maintainer 受众的 remediation。
|
|
1620
1669
|
"cli.doctor.args.verbose.description": "\u5C55\u5F00\u5168\u90E8 action hint,\u5305\u62EC maintainer \u53D7\u4F17\u7684(Fabric \u8D21\u732E\u8005\u4FEE\u6E90\u7801\u7528)\u3002\u9ED8\u8BA4 npm \u7EC8\u7AEF\u7528\u6237\u89C6\u56FE\u4F1A\u628A\u8FD9\u4E9B\u6298\u53E0\u3002",
|
|
1621
1670
|
"doctor.maintainer-hint-folded": "(maintainer-only remediation \u2014 \u52A0 `fabric doctor --verbose` \u67E5\u770B)",
|
|
@@ -1746,9 +1795,9 @@ var zhCNMessages = {
|
|
|
1746
1795
|
"doctor.check.retired_reference.ok": "bootstrap\u3001SKILL.md\u3001\u5DF2\u5B89\u88C5 hooks \u4E2D\u65E0\u6B8B\u7559\u7684\u9000\u5F79\u5DE5\u5177/\u5B57\u6BB5\u540D\u3002",
|
|
1747
1796
|
"doctor.check.retired_reference.message": "agent \u53EF\u89C1\u6587\u672C\u4E2D\u6709 {count} \u5904\u6307\u5411\u9000\u5F79\u5DE5\u5177/\u5B57\u6BB5\u540D\u7684 stale pointer: {sample}",
|
|
1748
1797
|
"doctor.check.retired_reference.remediation": "\u628A\u547D\u4E2D\u6587\u672C\u6539\u4E3A\u66FF\u4EE3 token (\u6216\u5220\u9664), \u518D\u8DD1 `fabric install` \u91CD\u540C\u6B65 dogfood \u955C\u50CF\u3002",
|
|
1749
|
-
// v2.0.0-rc.33 W3-6 (P1-13): SKILL.md token budget lint。warn >
|
|
1798
|
+
// v2.0.0-rc.33 W3-6 (P1-13): SKILL.md token budget lint。warn > 8K / error > 10K token (chars/3 估算)。Anthropic 推荐 SKILL.md 热路径 ~3K, 但被监控的两个 skill (fabric-archive/review) 是最丰富的核心 skill, 合理偏大;warn 定在 8K (距 10K 装机硬闸留 2K 反应缓冲) 而非 5K。超过 10K 是阻断级 (model context 浪费 + 加载延迟)。
|
|
1750
1799
|
"doctor.check.skill_token_budget.name": "Skill token \u9884\u7B97",
|
|
1751
|
-
"doctor.check.skill_token_budget.ok": "\u6240\u6709 .claude/skills/<slug>/SKILL.md \u5728 token budget \u5185 (warn
|
|
1800
|
+
"doctor.check.skill_token_budget.ok": "\u6240\u6709 .claude/skills/<slug>/SKILL.md \u5728 token budget \u5185 (warn 8K / error 10K)\u3002",
|
|
1752
1801
|
"doctor.check.skill_token_budget.message.singular": "{count} \u4E2A SKILL.md \u8D85\u51FA token budget: {list}\u3002\u5EFA\u8BAE\u628A\u8BE6\u7EC6\u5185\u5BB9\u4E0B\u6C89\u5230 ref/ progressive disclosure\u3002",
|
|
1753
1802
|
"doctor.check.skill_token_budget.message.plural": "{count} \u4E2A SKILL.md \u8D85\u51FA token budget: {list}\u3002\u5EFA\u8BAE\u628A\u8BE6\u7EC6\u5185\u5BB9\u4E0B\u6C89\u5230 ref/ progressive disclosure\u3002",
|
|
1754
1803
|
"doctor.check.skill_token_budget.remediation": "\u5C06\u8D85\u6807 SKILL.md \u4E2D\u7684\u8BE6\u7EC6 phase / worked-examples / decision \u8868\u79FB\u5230 `templates/skills/<slug>/ref/*.md`,SKILL.md \u70ED\u8DEF\u5F84\u53EA\u7559 trigger gate + \u5173\u952E phase \u6982\u8981;\u53C2\u8003 W1 progressive disclosure \u62C6\u5206\u6A21\u5F0F\u3002\u91CD\u65B0\u8DD1 `fabric install` \u540C\u6B65\u4E24\u7AEF\u3002",
|
|
@@ -1832,7 +1881,7 @@ var zhCNMessages = {
|
|
|
1832
1881
|
"doctor.check.index_drift.ok": "agents.meta.json counters envelope \u5BF9\u6BCF\u4E2A (layer, type) pair \u90FD\u5927\u4E8E\u6216\u7B49\u4E8E\u73B0\u6709 canonical counter \u6700\u5927\u503C\u3002",
|
|
1833
1882
|
"doctor.check.index_drift.message.singular": "{count} \u4E2A (layer, type) counter slot \u5DF2\u4F4E\u4E8E\u89C2\u6D4B\u5230\u7684 canonical maximum\uFF08next allocate would collide\uFF09\u3002\u9996\u4E2A\uFF1A{detail}\u3002",
|
|
1834
1883
|
"doctor.check.index_drift.message.plural": "{count} \u4E2A (layer, type) counter slots \u5DF2\u4F4E\u4E8E\u89C2\u6D4B\u5230\u7684 canonical maximum\uFF08next allocate would collide\uFF09\u3002\u9996\u4E2A\uFF1A{detail}\u3002",
|
|
1835
|
-
"doctor.check.index_drift.remediation": "\u8FD0\u884C `fabric doctor --fix
|
|
1884
|
+
"doctor.check.index_drift.remediation": "\u8FD0\u884C `fabric doctor --fix` \u5C06 agents.meta.json counters \u63D0\u5347\u5230 max_observed + 1\u3002",
|
|
1836
1885
|
"doctor.check.underseeded.name": "\u77E5\u8BC6\u79CD\u5B50\u4E0D\u8DB3",
|
|
1837
1886
|
"doctor.check.underseeded.ok": "\u77E5\u8BC6\u5E93\u5DF2\u6709 {count} \u4E2A canonical entries\uFF08>= {threshold}\uFF09\u3002",
|
|
1838
1887
|
"doctor.check.underseeded.message.singular": "\u77E5\u8BC6\u5E93\u4EC5\u6709 {count} \u4E2A canonical entry\uFF08< {threshold} threshold\uFF09\u3002plan_context \u68C0\u7D22\u9762\u4F4E\u4E8E\u53EF\u7528\u4E0B\u9650\u3002",
|
|
@@ -1842,7 +1891,7 @@ var zhCNMessages = {
|
|
|
1842
1891
|
"doctor.check.session_hints_stale.ok": ".fabric/.cache/ \u4E0B\u6CA1\u6709\u8D85\u8FC7 {days} \u5929\u7684 session-hints cache files\u3002",
|
|
1843
1892
|
"doctor.check.session_hints_stale.message.singular": ".fabric/.cache/ \u4E0B\u6709 {count} \u4E2A session-hints cache file \u8D85\u8FC7 {days} \u5929\u3002\u9996\u4E2A\uFF1A{detail}\u3002",
|
|
1844
1893
|
"doctor.check.session_hints_stale.message.plural": ".fabric/.cache/ \u4E0B\u6709 {count} \u4E2A session-hints cache files \u8D85\u8FC7 {days} \u5929\u3002\u9996\u4E2A\uFF1A{detail}\u3002",
|
|
1845
|
-
"doctor.check.session_hints_stale.remediation": "\u8FD0\u884C `fabric doctor --fix
|
|
1894
|
+
"doctor.check.session_hints_stale.remediation": "\u8FD0\u884C `fabric doctor --fix` \u5220\u9664\u8FC7\u671F\u7684 session-hints cache files\u3002",
|
|
1846
1895
|
"doctor.check.hook_cache_writable.name": "Hook \u7F13\u5B58\u53EF\u5199",
|
|
1847
1896
|
"doctor.check.hook_cache_writable.ok": "Hook sidecar cache \u8DEF\u5F84 {path} \u53EF\u5199\u5165\u63A2\u9488\u6587\u4EF6\u3002",
|
|
1848
1897
|
"doctor.check.hook_cache_writable.message": "Hook sidecar cache \u8DEF\u5F84 {path} \u4E0D\u53EF\u5199\uFF1Bhook state updates \u4F1A\u9759\u9ED8\u5931\u8D25\u3002\u9519\u8BEF\uFF1A{error}\u3002",
|
|
@@ -2330,6 +2379,11 @@ var zhCNMessages = {
|
|
|
2330
2379
|
// per [[fabric-serve-quarantine-not-delete]]. Restore from git history when
|
|
2331
2380
|
// the web UI surface is re-enabled.
|
|
2332
2381
|
// v2.0.0-rc.29 TASK-008 (BUG-L2): onboard-coverage 国际化键。
|
|
2382
|
+
"cli.first-hit.description": "\u9A8C\u6536 install\u2192first-hit \u5C31\u7EEA\uFF08bind + \u975E\u7A7A\u77E5\u8BC6\u9762\uFF09",
|
|
2383
|
+
"cli.first-hit.args.json.description": "\u673A\u5668\u53EF\u8BFB JSON \u62A5\u544A",
|
|
2384
|
+
"cli.first-hit.args.target.description": "\u9879\u76EE\u6839\uFF08\u9ED8\u8BA4 cwd\uFF09",
|
|
2385
|
+
"cli.first-hit.args.seed.description": "\u82E5 store \u4E3A\u7A7A\u5219\u5199\u5165\u6700\u5C0F starter \u77E5\u8BC6\u6761\u76EE",
|
|
2386
|
+
"cli.first-hit.args.paths.description": "\u9017\u53F7\u5206\u9694\u7684\u63A2\u6D4B\u8DEF\u5F84",
|
|
2333
2387
|
"cli.onboard-coverage.description": "\u6C47\u603B\u5F53\u524D\u5DE5\u4F5C\u533A\u7684 S5 onboard-slot \u8986\u76D6\u5EA6\u3002fabric-archive Skill \u9996\u8DD1\u9636\u6BB5\u7528\u5B83\u5224\u65AD\u54EA\u4E9B\u9879\u76EE\u8BED\u8C03\u69FD\u4F4D\u5C1A\u672A\u88AB\u8BA4\u9886\u3002",
|
|
2334
2388
|
"cli.onboard-coverage.args.json.description": "\u8F93\u51FA\u673A\u5668\u53EF\u8BFB\u7684 JSON \u5230 stdout\uFF08\u66FF\u4EE3\u4EBA\u7C7B\u53EF\u8BFB\u7684\u8868\u683C\uFF09\u3002",
|
|
2335
2389
|
"cli.onboard-coverage.args.target.description": "\u8986\u76D6\u9879\u76EE\u6839\u76EE\u5F55\uFF08\u9ED8\u8BA4\u4E3A\u5F53\u524D\u5DE5\u4F5C\u76EE\u5F55\uFF09\u3002",
|
|
@@ -709,7 +709,18 @@ var _fabReviewModifyChangesSchema = z3.object({
|
|
|
709
709
|
// impact are flow-arrays.
|
|
710
710
|
must_read_if: z3.string().optional(),
|
|
711
711
|
intent_clues: z3.array(z3.string()).optional(),
|
|
712
|
-
impact: z3.array(z3.string()).optional()
|
|
712
|
+
impact: z3.array(z3.string()).optional(),
|
|
713
|
+
// ISS-20260711-180: propose writes these; without them here zod .strip()
|
|
714
|
+
// silently drops modify patches (KT-PIT-0005 recurrence).
|
|
715
|
+
tech_stack: z3.array(z3.string()).optional(),
|
|
716
|
+
evidence_paths: z3.array(z3.string()).optional(),
|
|
717
|
+
onboard_slot: z3.enum([
|
|
718
|
+
"tech-stack-decision",
|
|
719
|
+
"architecture-pattern",
|
|
720
|
+
"code-style-tone",
|
|
721
|
+
"build-system-idiom",
|
|
722
|
+
"domain-vocabulary"
|
|
723
|
+
]).optional()
|
|
713
724
|
});
|
|
714
725
|
var FabReviewInputSchema = z3.discriminatedUnion("action", [
|
|
715
726
|
z3.object({
|
|
@@ -863,6 +874,8 @@ var _fabReviewListItemSchema = z3.object({
|
|
|
863
874
|
tags: z3.array(z3.string()).optional(),
|
|
864
875
|
title: z3.string().optional(),
|
|
865
876
|
summary: z3.string().optional(),
|
|
877
|
+
// ISS-20260712-011: triage UI needs proposed_reason without a second Read.
|
|
878
|
+
proposed_reason: z3.string().optional(),
|
|
866
879
|
// Store-only cutover: origin reflects the resolved store audience where the
|
|
867
880
|
// pending file lives; layer reflects the declared classification that will
|
|
868
881
|
// drive approval semantics.
|
|
@@ -902,10 +915,16 @@ var _fabReviewSearchItemSchema = z3.object({
|
|
|
902
915
|
// hits in the same array.
|
|
903
916
|
stable_id: z3.string().optional()
|
|
904
917
|
});
|
|
918
|
+
var _fabReviewFailedItemSchema = z3.object({
|
|
919
|
+
pending_path: z3.string(),
|
|
920
|
+
reason: z3.string()
|
|
921
|
+
});
|
|
905
922
|
var FabReviewOutputSchema = z3.discriminatedUnion("action", [
|
|
906
923
|
z3.object({
|
|
907
924
|
action: z3.literal("approve"),
|
|
908
925
|
approved: z3.array(z3.object({ pending_path: z3.string(), stable_id: z3.string() })),
|
|
926
|
+
// ISS-20260712-012: partial-failure surface so empty approved[] is not false-success.
|
|
927
|
+
failed: z3.array(_fabReviewFailedItemSchema).optional(),
|
|
909
928
|
warnings: z3.array(structuredWarningSchema).optional()
|
|
910
929
|
}),
|
|
911
930
|
z3.object({
|
|
@@ -953,6 +972,8 @@ var FabReviewOutputSchema = z3.discriminatedUnion("action", [
|
|
|
953
972
|
superseded_by: z3.string().optional()
|
|
954
973
|
})
|
|
955
974
|
),
|
|
975
|
+
// ISS-20260712-012: partial-failure surface for skipped/unresolvable paths.
|
|
976
|
+
failed: z3.array(_fabReviewFailedItemSchema).optional(),
|
|
956
977
|
warnings: z3.array(structuredWarningSchema).optional()
|
|
957
978
|
})
|
|
958
979
|
]);
|
|
@@ -984,6 +1005,9 @@ var FabReviewOutputShape = {
|
|
|
984
1005
|
approved: z3.array(z3.object({ pending_path: z3.string(), stable_id: z3.string() })).optional().describe(
|
|
985
1006
|
"Allocated stable ids paired with their original pending paths. Present when action=approve."
|
|
986
1007
|
),
|
|
1008
|
+
failed: z3.array(z3.object({ pending_path: z3.string(), reason: z3.string() })).optional().describe(
|
|
1009
|
+
"Paths that did not apply (approve/retire). Present when any path was skipped or failed."
|
|
1010
|
+
),
|
|
987
1011
|
rejected: z3.array(z3.string()).optional().describe(
|
|
988
1012
|
"Pending paths that were rejected (files retained on disk; doctor owns vacuum). Present when action=reject."
|
|
989
1013
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveGlobalLocale
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OX6DWUK4.js";
|
|
4
4
|
|
|
5
5
|
// src/templates/bootstrap-canonical.ts
|
|
6
6
|
var BOOTSTRAP_MARKER_BEGIN = "<!-- fabric:bootstrap:begin -->";
|
|
@@ -37,7 +37,7 @@ var BOOTSTRAP_CANONICAL_ZH = `# Fabric Bootstrap
|
|
|
37
37
|
|
|
38
38
|
## \u884C\u4E3A\u89C4\u5219
|
|
39
39
|
- **\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
|
|
40
|
-
- **\`.fabric/agents.meta.json\` \u4E25\u7981\u624B\u52A8\u7F16\u8F91
|
|
40
|
+
- **\`.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
|
|
41
41
|
|
|
42
42
|
## \u77E5\u8BC6\u5E93(KB)
|
|
43
43
|
- **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
|
|
@@ -96,7 +96,7 @@ See \`docs/USER-QUICKSTART.md\` for the full maintainer version.
|
|
|
96
96
|
|
|
97
97
|
## Behavior Rules
|
|
98
98
|
- **Before modifying any file**: first \`fab_recall(paths=[<file-being-edited>])\` \u2014\u2014 a single call returns the relevant KB descriptions + native read paths (\`entries[].read_path\`). \`fab_recall\` no longer delivers bodies; when you need a body, do a native Read of its \`entries[].read_path\` (\`Read <store>/knowledge/<type>/<id>--*.md\`), which the PostToolUse hook records as \`knowledge_body_read\`. Lean default: descriptions + index already suffice to discover entries; read a body once on demand, don't re-inject it every turn (KT-GLD-0005).
|
|
99
|
-
- **Never hand-edit \`.fabric/agents.meta.json
|
|
99
|
+
- **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.
|
|
100
100
|
|
|
101
101
|
## Knowledge Base (KB)
|
|
102
102
|
- **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.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
atomicWriteJson,
|
|
3
|
+
withFileLock
|
|
4
|
+
} from "./chunk-C7WZPYZE.js";
|
|
5
|
+
|
|
1
6
|
// src/i18n/normalize-locale.ts
|
|
2
7
|
function normalizeLocale(raw) {
|
|
3
8
|
if (typeof raw !== "string") {
|
|
@@ -189,7 +194,8 @@ var globalConfigSchema = z.object({
|
|
|
189
194
|
}).passthrough();
|
|
190
195
|
|
|
191
196
|
// src/store/global-config-io.ts
|
|
192
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
197
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
198
|
+
import { mkdir } from "fs/promises";
|
|
193
199
|
import { homedir } from "os";
|
|
194
200
|
import { join } from "path";
|
|
195
201
|
function isTestRuntime() {
|
|
@@ -210,6 +216,9 @@ function resolveGlobalRoot() {
|
|
|
210
216
|
function globalConfigPath(globalRoot = resolveGlobalRoot()) {
|
|
211
217
|
return join(globalRoot, "fabric-global.json");
|
|
212
218
|
}
|
|
219
|
+
function globalConfigLockPath(globalRoot) {
|
|
220
|
+
return `${globalConfigPath(globalRoot)}.lock`;
|
|
221
|
+
}
|
|
213
222
|
function loadGlobalConfig(globalRoot = resolveGlobalRoot()) {
|
|
214
223
|
const path = globalConfigPath(globalRoot);
|
|
215
224
|
if (!existsSync(path)) {
|
|
@@ -217,11 +226,30 @@ function loadGlobalConfig(globalRoot = resolveGlobalRoot()) {
|
|
|
217
226
|
}
|
|
218
227
|
return globalConfigSchema.parse(JSON.parse(readFileSync(path, "utf8")));
|
|
219
228
|
}
|
|
229
|
+
async function saveGlobalConfigAsync(config, globalRoot = resolveGlobalRoot()) {
|
|
230
|
+
const validated = globalConfigSchema.parse(config);
|
|
231
|
+
await mkdir(globalRoot, { recursive: true });
|
|
232
|
+
const path = globalConfigPath(globalRoot);
|
|
233
|
+
await withFileLock(globalConfigLockPath(globalRoot), async () => {
|
|
234
|
+
await atomicWriteJson(path, validated, { indent: 2 });
|
|
235
|
+
});
|
|
236
|
+
}
|
|
220
237
|
function saveGlobalConfig(config, globalRoot = resolveGlobalRoot()) {
|
|
221
238
|
const validated = globalConfigSchema.parse(config);
|
|
222
239
|
mkdirSync(globalRoot, { recursive: true });
|
|
223
|
-
|
|
240
|
+
const path = globalConfigPath(globalRoot);
|
|
241
|
+
const tmpPath = `${path}.${process.pid}.${Date.now()}.tmp`;
|
|
242
|
+
try {
|
|
243
|
+
writeFileSync(tmpPath, `${JSON.stringify(validated, null, 2)}
|
|
224
244
|
`, "utf8");
|
|
245
|
+
renameSync(tmpPath, path);
|
|
246
|
+
} catch (error) {
|
|
247
|
+
try {
|
|
248
|
+
unlinkSync(tmpPath);
|
|
249
|
+
} catch {
|
|
250
|
+
}
|
|
251
|
+
throw error;
|
|
252
|
+
}
|
|
225
253
|
}
|
|
226
254
|
|
|
227
255
|
// src/i18n/resolve-global-locale.ts
|
|
@@ -269,6 +297,7 @@ export {
|
|
|
269
297
|
resolveGlobalRoot,
|
|
270
298
|
globalConfigPath,
|
|
271
299
|
loadGlobalConfig,
|
|
300
|
+
saveGlobalConfigAsync,
|
|
272
301
|
saveGlobalConfig,
|
|
273
302
|
resolveGlobalLocale
|
|
274
303
|
};
|
package/dist/i18n/index.js
CHANGED
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
enMessages,
|
|
6
6
|
resolveFabricLocale,
|
|
7
7
|
zhCNMessages
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-47M6HKBU.js";
|
|
9
9
|
import {
|
|
10
10
|
detectNodeLocale,
|
|
11
11
|
normalizeLocale,
|
|
12
12
|
resolveGlobalLocale
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-OX6DWUK4.js";
|
|
14
|
+
import "../chunk-C7WZPYZE.js";
|
|
14
15
|
export {
|
|
15
16
|
PROTECTED_TOKENS,
|
|
16
17
|
createTranslator,
|