@fenglimg/fabric-shared 2.0.0-rc.27 → 2.0.0-rc.29

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.
@@ -98,6 +98,12 @@ var enMessages = {
98
98
  "doctor.section.manual": "Manual errors:",
99
99
  "doctor.section.warnings": "Warnings:",
100
100
  "doctor.section.fix-knowledge-mutations": "Fix-knowledge mutations:",
101
+ // v2.0.0-rc.29 REVIEW (codex LOW-2): F2's payload-limit defaults reach the JSON
102
+ // envelope but never surfaced in the human renderer, so operators tuning
103
+ // `mcpPayloadLimits` had no fast `fab doctor` confirmation that their config
104
+ // override took effect. Two strings: a section header + a one-liner row.
105
+ "doctor.section.payload-limits": "MCP payload limits:",
106
+ "doctor.payload-limits.line": "warn={warnKb} KB, hard={hardKb} KB (source: {source})",
101
107
  // rc.20 TASK-07: cite-coverage human-readable formatter keys.
102
108
  "doctor.section.cite-coverage": "Cite coverage:",
103
109
  "doctor.cite.header": "Since {since} via marker {marker}",
@@ -133,13 +139,13 @@ var enMessages = {
133
139
  "cite-coverage.contract.status.ok": "ok",
134
140
  "cite-coverage.contract.status.skipped_bootstrap_drift": "skipped (bootstrap drift \u2014 run `fab install`)",
135
141
  "cite-coverage.contract.status.awaiting_marker": "awaiting first marker emit",
136
- // Singular knowledge-type labels (verbatim alignment with KnowledgeTypeSchema)
137
- // plus the sixth "unresolved" bucket.
138
- "cite-coverage.contract.type.decision": "decision",
139
- "cite-coverage.contract.type.pitfall": "pitfall",
140
- "cite-coverage.contract.type.model": "model",
141
- "cite-coverage.contract.type.guideline": "guideline",
142
- "cite-coverage.contract.type.process": "process",
142
+ // Plural knowledge-type labels (rc.29 BUG-C1: verbatim alignment with
143
+ // canonical KnowledgeTypeSchema) plus the sixth "unresolved" bucket.
144
+ "cite-coverage.contract.type.decisions": "decisions",
145
+ "cite-coverage.contract.type.pitfalls": "pitfalls",
146
+ "cite-coverage.contract.type.models": "models",
147
+ "cite-coverage.contract.type.guidelines": "guidelines",
148
+ "cite-coverage.contract.type.processes": "processes",
143
149
  "cite-coverage.contract.type.unresolved": "unresolved",
144
150
  // Layer labels (per_layer_type headers + layer_filter banner).
145
151
  "cite-coverage.layer.team": "team",
@@ -267,6 +273,11 @@ var enMessages = {
267
273
  "doctor.check.event_ledger_schema_compat.message.schema_version": "events.jsonl has {count} row(s) with unsupported `schema_version` (samples: {samples}).",
268
274
  "doctor.check.event_ledger_schema_compat.message.event_type": "events.jsonl has {count} row(s) with unknown `event_type` (samples: {samples}).",
269
275
  "doctor.check.event_ledger_schema_compat.remediation": "Either upgrade the fab CLI to a server-compatible version, or archive `.fabric/events.jsonl` and run `fab doctor --fix` to recreate a fresh ledger.",
276
+ // v2.0.0-rc.28 TASK-04 (audit §3.1): SKILL ref/ mirror parity check.
277
+ "doctor.check.skill_ref_mirror.name": "Skill ref mirror parity",
278
+ "doctor.check.skill_ref_mirror.ok": "All `.claude/skills/<slug>/ref/` and `.codex/skills/<slug>/ref/` files are byte-identical.",
279
+ "doctor.check.skill_ref_mirror.message": "{count} skill ref file(s) differ between `.claude/skills/` and `.codex/skills/` (paths: {list}). One client was hand-edited or partially installed.",
280
+ "doctor.check.skill_ref_mirror.remediation": "Run `fab install` to rewrite both client subtrees from the canonical templates and restore parity.",
270
281
  "doctor.check.meta_manually_diverged.name": "Meta manual divergence",
271
282
  "doctor.check.meta_manually_diverged.ok.unreadable": "agents.meta.json not readable; skipping divergence check.",
272
283
  "doctor.check.meta_manually_diverged.message.extra.singular": "agents.meta.json has {count} entry with no backing file on disk. Run --fix to reconcile.",
@@ -591,10 +602,16 @@ var enMessages = {
591
602
  "cli.serve.args.host.description": "Listen host, default 127.0.0.1. Non-loopback hosts (e.g. 0.0.0.0) require FABRIC_AUTH_TOKEN to enable Bearer auth, otherwise serve falls back to 127.0.0.1.",
592
603
  "cli.serve.args.target.description": "Target project path. Defaults to --target, then EXTERNAL_FIXTURE_PATH, then cwd.",
593
604
  "cli.serve.args.debug.description": "Print target resolution details to stderr.",
605
+ "cli.serve.args.allow-loopback-no-auth.description": "Opt in to running the loopback HTTP server without Bearer auth (default-deny). Use only on a trusted single-user machine; any local process can then read your knowledge ledger.",
594
606
  "cli.serve.ready.title": "Fabric Dashboard",
595
607
  "cli.serve.lock-held.action-hint": "A `fab serve` instance (PID {pid}) is holding the workspace lock. Stop it (Ctrl-C in that terminal or `kill {pid}`) before running this command.",
596
608
  "cli.serve.warning.host-fallback": "--host {host} requires FABRIC_AUTH_TOKEN for non-loopback exposure; falling back to 127.0.0.1. To bind {host}, run: FABRIC_AUTH_TOKEN=<token> fab serve --host {host}",
609
+ "cli.serve.warning.loopback-deny-default": "FABRIC_AUTH_TOKEN is not set: /api /events /mcp will return 401 by default (any local process could otherwise read .fabric/agents.meta.json + forensic.json + events.jsonl). Set FABRIC_AUTH_TOKEN=<secret> or pass --allow-loopback-no-auth to opt in.",
597
610
  "cli.serve.error.port-in-use": "Port {port} in use - try --port {nextPort}",
611
+ // v2.0.0-rc.29 TASK-008 (BUG-L2): onboard-coverage i18n keys.
612
+ "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.",
613
+ "cli.onboard-coverage.args.json.description": "Emit machine-readable JSON to stdout instead of the human table.",
614
+ "cli.onboard-coverage.args.target.description": "Override the project root (defaults to cwd).",
598
615
  "cli.update.description": "Refresh MCP host configuration and git hooks without re-creating Fabric files.",
599
616
  "cli.update.args.target.description": "Target project path. Defaults to --target, then EXTERNAL_FIXTURE_PATH, then cwd.",
600
617
  "cli.update.args.no-mcp.description": "Skip re-configuring MCP clients",
@@ -907,6 +924,10 @@ var zhCNMessages = {
907
924
  "doctor.section.manual": "\u9700\u624B\u52A8\u4FEE\u590D\uFF1A",
908
925
  "doctor.section.warnings": "\u8B66\u544A\uFF1A",
909
926
  "doctor.section.fix-knowledge-mutations": "Fix-knowledge \u53D8\u66F4\uFF1A",
927
+ // v2.0.0-rc.29 REVIEW (codex LOW-2): F2 的 payload 阈值之前只出现在 JSON envelope,
928
+ // 人类输出看不到,导致改了 mcpPayloadLimits 之后没法用 `fab doctor` 快速确认是否生效。
929
+ "doctor.section.payload-limits": "MCP payload \u9608\u503C\uFF1A",
930
+ "doctor.payload-limits.line": "warn={warnKb} KB, hard={hardKb} KB (\u6765\u6E90: {source})",
910
931
  // rc.20 TASK-07: cite-coverage 人类可读格式化键。
911
932
  "doctor.section.cite-coverage": "Cite \u8986\u76D6\u7387:",
912
933
  "doctor.cite.header": "\u8D77\u59CB {since} (\u653F\u7B56\u6FC0\u6D3B\u65F6\u95F4 {marker})",
@@ -942,12 +963,12 @@ var zhCNMessages = {
942
963
  "cite-coverage.contract.status.ok": "\u6B63\u5E38",
943
964
  "cite-coverage.contract.status.skipped_bootstrap_drift": "\u5DF2\u8DF3\u8FC7\uFF08bootstrap drift \u2014 \u8BF7\u8FD0\u884C fab install\uFF09",
944
965
  "cite-coverage.contract.status.awaiting_marker": "\u7B49\u5F85\u9996\u6B21 marker emit",
945
- // 单数知识类型(与 KnowledgeTypeSchema 枚举字面量逐字对齐)+ 第六桶 unresolved。
946
- "cite-coverage.contract.type.decision": "decision",
947
- "cite-coverage.contract.type.pitfall": "pitfall",
948
- "cite-coverage.contract.type.model": "model",
949
- "cite-coverage.contract.type.guideline": "guideline",
950
- "cite-coverage.contract.type.process": "process",
966
+ // 复数知识类型(rc.29 BUG-C1: 与统一后的 KnowledgeTypeSchema 枚举字面量逐字对齐)+ 第六桶 unresolved。
967
+ "cite-coverage.contract.type.decisions": "decisions",
968
+ "cite-coverage.contract.type.pitfalls": "pitfalls",
969
+ "cite-coverage.contract.type.models": "models",
970
+ "cite-coverage.contract.type.guidelines": "guidelines",
971
+ "cite-coverage.contract.type.processes": "processes",
951
972
  "cite-coverage.contract.type.unresolved": "unresolved",
952
973
  // 知识层标签(per_layer_type 表头 + layer_filter 标识)。
953
974
  "cite-coverage.layer.team": "team",
@@ -1073,6 +1094,11 @@ var zhCNMessages = {
1073
1094
  "doctor.check.event_ledger_schema_compat.message.schema_version": "events.jsonl \u542B {count} \u884C `schema_version` \u4E0D\u88AB\u5F53\u524D CLI \u8BC6\u522B\uFF08\u6837\u672C: {samples}\uFF09\u3002",
1074
1095
  "doctor.check.event_ledger_schema_compat.message.event_type": "events.jsonl \u542B {count} \u884C `event_type` \u4E0D\u5728\u5F53\u524D schema \u4E2D\uFF08\u6837\u672C: {samples}\uFF09\u3002",
1075
1096
  "doctor.check.event_ledger_schema_compat.remediation": "\u5347\u7EA7 fab CLI \u5230\u4E0E server \u517C\u5BB9\u7684\u7248\u672C\uFF0C\u6216\u5907\u4EFD `.fabric/events.jsonl` \u540E\u8DD1 `fab doctor --fix` \u91CD\u5EFA\u7A7A ledger\u3002",
1097
+ // v2.0.0-rc.28 TASK-04 (audit §3.1): SKILL ref/ 镜像一致性检查。
1098
+ "doctor.check.skill_ref_mirror.name": "Skill ref \u955C\u50CF\u4E00\u81F4\u6027",
1099
+ "doctor.check.skill_ref_mirror.ok": "`.claude/skills/<slug>/ref/` \u4E0E `.codex/skills/<slug>/ref/` \u5B57\u8282\u4E00\u81F4\u3002",
1100
+ "doctor.check.skill_ref_mirror.message": "\u6709 {count} \u4E2A ref \u6587\u4EF6\u5728 `.claude/skills/` \u4E0E `.codex/skills/` \u4E4B\u95F4\u4E0D\u4E00\u81F4\uFF08\u8DEF\u5F84: {list}\uFF09\u3002\u53EF\u80FD\u67D0\u7AEF\u88AB\u624B\u52A8\u7F16\u8F91\u6216 install \u5199\u5165\u5931\u8D25\u3002",
1101
+ "doctor.check.skill_ref_mirror.remediation": "\u8DD1 `fab install` \u4ECE canonical templates \u91CD\u5199\u4E24\u7AEF ref \u5B50\u6811\u4EE5\u6062\u590D\u4E00\u81F4\u3002",
1076
1102
  "doctor.check.meta_manually_diverged.name": "Meta manual divergence",
1077
1103
  "doctor.check.meta_manually_diverged.ok.unreadable": "agents.meta.json \u4E0D\u53EF\u8BFB\uFF0C\u8DF3\u8FC7 divergence \u68C0\u67E5\u3002",
1078
1104
  "doctor.check.meta_manually_diverged.message.extra.singular": "agents.meta.json \u4E2D\u6709 {count} \u4E2A entry \u5728\u78C1\u76D8\u4E0A\u6CA1\u6709\u5BF9\u5E94\u6587\u4EF6\u3002\u8FD0\u884C --fix \u6267\u884C reconcile\u3002",
@@ -1395,10 +1421,16 @@ var zhCNMessages = {
1395
1421
  "cli.serve.args.host.description": "\u76D1\u542C\u4E3B\u673A\uFF0C\u9ED8\u8BA4 127.0.0.1\u3002\u7ED1\u5B9A\u975E loopback \u4E3B\u673A\uFF08\u5982 0.0.0.0\uFF09\u5FC5\u987B\u8BBE\u7F6E FABRIC_AUTH_TOKEN \u542F\u7528 Bearer \u9274\u6743\uFF0C\u5426\u5219\u5C06\u81EA\u52A8\u56DE\u9000\u5230 127.0.0.1\u3002",
1396
1422
  "cli.serve.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",
1397
1423
  "cli.serve.args.debug.description": "\u5C06\u76EE\u6807\u89E3\u6790\u7EC6\u8282\u8F93\u51FA\u5230 stderr\u3002",
1424
+ "cli.serve.args.allow-loopback-no-auth.description": "\u663E\u5F0F\u5141\u8BB8\u5728 loopback \u4E0A\u4EE5\u65E0\u9274\u6743\u65B9\u5F0F\u8FD0\u884C\uFF08\u9ED8\u8BA4 default-deny\uFF09\u3002\u4EC5\u5728\u53EF\u4FE1\u5355\u7528\u6237\u673A\u5668\u4E0A\u4F7F\u7528\u2014\u2014\u5426\u5219\u4EFB\u4F55\u672C\u673A\u8FDB\u7A0B\u90FD\u80FD\u8BFB\u53D6\u4F60\u7684\u77E5\u8BC6\u5E93\u8D26\u672C\u3002",
1398
1425
  "cli.serve.ready.title": "Fabric \u4EEA\u8868\u76D8",
1399
1426
  "cli.serve.lock-held.action-hint": "\u53E6\u4E00\u4E2A `fab serve` \u8FDB\u7A0B (PID {pid}) \u6B63\u5360\u7528\u5DE5\u4F5C\u533A\u9501\u3002\u8BF7\u5148\u505C\u6B62\u5B83 (\u5728\u8BE5\u7EC8\u7AEF\u6309 Ctrl-C \u6216\u8FD0\u884C `kill {pid}`) \u518D\u6267\u884C\u6B64\u547D\u4EE4\u3002",
1400
1427
  "cli.serve.warning.host-fallback": "--host {host} \u9700\u8981\u8BBE\u7F6E FABRIC_AUTH_TOKEN \u624D\u80FD\u5BF9\u5916\u66B4\u9732\uFF1B\u5DF2\u56DE\u9000\u5230 127.0.0.1\u3002\u5982\u9700\u7ED1\u5B9A {host}\uFF0C\u8BF7\u8FD0\u884C\uFF1AFABRIC_AUTH_TOKEN=<token> fab serve --host {host}",
1428
+ "cli.serve.warning.loopback-deny-default": "\u672A\u8BBE\u7F6E FABRIC_AUTH_TOKEN\uFF1A/api /events /mcp \u9ED8\u8BA4\u8FD4\u56DE 401\uFF08\u5426\u5219\u4EFB\u4F55\u672C\u673A\u8FDB\u7A0B\u90FD\u80FD\u8BFB\u53D6 .fabric/agents.meta.json + forensic.json + events.jsonl\uFF09\u3002\u8BF7\u8BBE\u7F6E FABRIC_AUTH_TOKEN=<secret>\uFF0C\u6216\u4F20\u5165 --allow-loopback-no-auth \u663E\u5F0F\u653E\u884C\u3002",
1401
1429
  "cli.serve.error.port-in-use": "\u7AEF\u53E3 {port} \u5DF2\u88AB\u5360\u7528\uFF0C\u53EF\u5C1D\u8BD5 --port {nextPort}",
1430
+ // v2.0.0-rc.29 TASK-008 (BUG-L2): onboard-coverage 国际化键。
1431
+ "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",
1432
+ "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",
1433
+ "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",
1402
1434
  "cli.update.description": "\u5237\u65B0 MCP \u4E3B\u673A\u914D\u7F6E\u548C git hooks\uFF0C\u4E0D\u91CD\u65B0\u521B\u5EFA Fabric \u6587\u4EF6\u3002",
1403
1435
  "cli.update.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",
1404
1436
  "cli.update.args.no-mcp.description": "\u8DF3\u8FC7\u91CD\u65B0\u914D\u7F6E MCP \u5BA2\u6237\u7AEF",
@@ -20,7 +20,7 @@ var structuredWarningSchema = z2.object({
20
20
  line: z2.number().optional(),
21
21
  action_hint: z2.string()
22
22
  });
23
- var _knowledgeTypeEnum = z2.enum(["model", "decision", "guideline", "pitfall", "process"]);
23
+ var _knowledgeTypeEnum = z2.enum(["models", "decisions", "guidelines", "pitfalls", "processes"]);
24
24
  var _maturityEnum = z2.enum(["draft", "verified", "proven"]);
25
25
  var _layerEnum = z2.enum(["personal", "team"]);
26
26
  var _ruleDescriptionSchema = z2.object({
@@ -493,6 +493,28 @@ var _fabReviewListItemSchema = z2.object({
493
493
  // small for routine list calls.
494
494
  body: z2.string().optional()
495
495
  });
496
+ var _fabReviewSearchItemSchema = z2.object({
497
+ // Search hits live in one of two trees:
498
+ // - "pending" → .fabric/knowledge/pending/ (or ~/.fabric/knowledge/pending/)
499
+ // - "canonical" → .fabric/knowledge/{decisions,pitfalls,...} (or personal mirror)
500
+ area: z2.enum(["pending", "canonical"]),
501
+ path: z2.string(),
502
+ path_absolute: z2.string().optional(),
503
+ type: z2.enum(["decisions", "pitfalls", "guidelines", "models", "processes"]),
504
+ layer: z2.enum(["team", "personal"]),
505
+ maturity: z2.enum(["draft", "verified", "proven"]),
506
+ tags: z2.array(z2.string()).optional(),
507
+ title: z2.string().optional(),
508
+ summary: z2.string().optional(),
509
+ origin: z2.enum(["team", "personal"]).optional(),
510
+ status: z2.enum(["active", "rejected", "deferred"]).optional(),
511
+ deferred_until: z2.string().datetime().optional(),
512
+ body: z2.string().optional(),
513
+ // For pending hits the upstream stable_id may still be unassigned — keep it
514
+ // optional so canonical hits (which always have one) parse alongside pending
515
+ // hits in the same array.
516
+ stable_id: z2.string().optional()
517
+ });
496
518
  var FabReviewOutputSchema = z2.discriminatedUnion("action", [
497
519
  z2.object({
498
520
  action: z2.literal("list"),
@@ -519,7 +541,9 @@ var FabReviewOutputSchema = z2.discriminatedUnion("action", [
519
541
  }),
520
542
  z2.object({
521
543
  action: z2.literal("search"),
522
- items: z2.array(_fabReviewListItemSchema),
544
+ // v2.0.0-rc.29 TASK-007 (BUG-M4): search returns the new search-item
545
+ // shape with `area` discriminator + neutrally-named `path` field.
546
+ items: z2.array(_fabReviewSearchItemSchema),
523
547
  warnings: z2.array(structuredWarningSchema).optional()
524
548
  }),
525
549
  z2.object({
@@ -532,8 +556,8 @@ var FabReviewOutputShape = {
532
556
  action: z2.enum(["list", "approve", "reject", "modify", "search", "defer"]).describe(
533
557
  "Echoes the input action; clients can switch on it for per-variant fields below."
534
558
  ),
535
- items: z2.array(_fabReviewListItemSchema).optional().describe(
536
- "Pending/canonical entries surfaced. Present when action=list or action=search."
559
+ items: z2.array(z2.union([_fabReviewListItemSchema, _fabReviewSearchItemSchema])).optional().describe(
560
+ "Pending entries (action=list, `pending_path` shape) or pending+canonical entries (action=search, `area`+`path` shape)."
537
561
  ),
538
562
  approved: z2.array(z2.object({ pending_path: z2.string(), stable_id: z2.string() })).optional().describe(
539
563
  "Allocated stable ids paired with their original pending paths. Present when action=approve."
@@ -667,15 +691,15 @@ var annotateIntentRequestSchema = z2.object({
667
691
  annotation: z2.string().trim().min(1)
668
692
  });
669
693
  var KnowledgeTypeSchema = z2.enum([
670
- "model",
694
+ "models",
671
695
  // entities, data structures, relationships
672
- "decision",
696
+ "decisions",
673
697
  // architectural/technical choices with rationale
674
- "guideline",
698
+ "guidelines",
675
699
  // recommended practices (recommend) or anti-patterns (avoid)
676
- "pitfall",
700
+ "pitfalls",
677
701
  // known risks, failure modes, troubleshooting
678
- "process"
702
+ "processes"
679
703
  // workflows, state machines, operational steps
680
704
  ]);
681
705
  var MaturitySchema = z2.enum(["draft", "verified", "proven"]);
@@ -697,11 +721,11 @@ var KnowledgeEntryFrontmatterSchema = z2.object({
697
721
  // Note: 'tags' and other fields can be added later but core schema is these 6
698
722
  });
699
723
  var KNOWLEDGE_TYPE_CODES = {
700
- model: "MOD",
701
- decision: "DEC",
702
- guideline: "GLD",
703
- pitfall: "PIT",
704
- process: "PRO"
724
+ models: "MOD",
725
+ decisions: "DEC",
726
+ guidelines: "GLD",
727
+ pitfalls: "PIT",
728
+ processes: "PRO"
705
729
  };
706
730
  function formatKnowledgeId(layer, type, counter) {
707
731
  const layerPrefix = layer === "personal" ? "KP" : "KT";
@@ -7,7 +7,7 @@ import {
7
7
  normalizeLocale,
8
8
  resolveFabricLocale,
9
9
  zhCNMessages
10
- } from "../chunk-LXQ77R3D.js";
10
+ } from "../chunk-225L7D4T.js";
11
11
  export {
12
12
  PROTECTED_TOKENS,
13
13
  createTranslator,