@fenglimg/fabric-shared 2.0.0-rc.28 → 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.
- package/dist/{chunk-DXQVLDEB.js → chunk-225L7D4T.js} +35 -13
- package/dist/{chunk-G32HVF7H.js → chunk-Y2YBFL2G.js} +38 -14
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +158 -86
- package/dist/index.js +53 -16
- package/dist/node/mcp-payload-guard.d.ts +3 -1
- package/dist/node/mcp-payload-guard.js +6 -2
- package/dist/schemas/api-contracts.d.ts +132 -77
- package/dist/schemas/api-contracts.js +1 -1
- package/dist/types/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -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
|
-
//
|
|
137
|
-
// plus the sixth "unresolved" bucket.
|
|
138
|
-
"cite-coverage.contract.type.
|
|
139
|
-
"cite-coverage.contract.type.
|
|
140
|
-
"cite-coverage.contract.type.
|
|
141
|
-
"cite-coverage.contract.type.
|
|
142
|
-
"cite-coverage.contract.type.
|
|
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",
|
|
@@ -596,10 +602,16 @@ var enMessages = {
|
|
|
596
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.",
|
|
597
603
|
"cli.serve.args.target.description": "Target project path. Defaults to --target, then EXTERNAL_FIXTURE_PATH, then cwd.",
|
|
598
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.",
|
|
599
606
|
"cli.serve.ready.title": "Fabric Dashboard",
|
|
600
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.",
|
|
601
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.",
|
|
602
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).",
|
|
603
615
|
"cli.update.description": "Refresh MCP host configuration and git hooks without re-creating Fabric files.",
|
|
604
616
|
"cli.update.args.target.description": "Target project path. Defaults to --target, then EXTERNAL_FIXTURE_PATH, then cwd.",
|
|
605
617
|
"cli.update.args.no-mcp.description": "Skip re-configuring MCP clients",
|
|
@@ -912,6 +924,10 @@ var zhCNMessages = {
|
|
|
912
924
|
"doctor.section.manual": "\u9700\u624B\u52A8\u4FEE\u590D\uFF1A",
|
|
913
925
|
"doctor.section.warnings": "\u8B66\u544A\uFF1A",
|
|
914
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})",
|
|
915
931
|
// rc.20 TASK-07: cite-coverage 人类可读格式化键。
|
|
916
932
|
"doctor.section.cite-coverage": "Cite \u8986\u76D6\u7387:",
|
|
917
933
|
"doctor.cite.header": "\u8D77\u59CB {since} (\u653F\u7B56\u6FC0\u6D3B\u65F6\u95F4 {marker})",
|
|
@@ -947,12 +963,12 @@ var zhCNMessages = {
|
|
|
947
963
|
"cite-coverage.contract.status.ok": "\u6B63\u5E38",
|
|
948
964
|
"cite-coverage.contract.status.skipped_bootstrap_drift": "\u5DF2\u8DF3\u8FC7\uFF08bootstrap drift \u2014 \u8BF7\u8FD0\u884C fab install\uFF09",
|
|
949
965
|
"cite-coverage.contract.status.awaiting_marker": "\u7B49\u5F85\u9996\u6B21 marker emit",
|
|
950
|
-
//
|
|
951
|
-
"cite-coverage.contract.type.
|
|
952
|
-
"cite-coverage.contract.type.
|
|
953
|
-
"cite-coverage.contract.type.
|
|
954
|
-
"cite-coverage.contract.type.
|
|
955
|
-
"cite-coverage.contract.type.
|
|
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",
|
|
956
972
|
"cite-coverage.contract.type.unresolved": "unresolved",
|
|
957
973
|
// 知识层标签(per_layer_type 表头 + layer_filter 标识)。
|
|
958
974
|
"cite-coverage.layer.team": "team",
|
|
@@ -1405,10 +1421,16 @@ var zhCNMessages = {
|
|
|
1405
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",
|
|
1406
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",
|
|
1407
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",
|
|
1408
1425
|
"cli.serve.ready.title": "Fabric \u4EEA\u8868\u76D8",
|
|
1409
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",
|
|
1410
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",
|
|
1411
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",
|
|
1412
1434
|
"cli.update.description": "\u5237\u65B0 MCP \u4E3B\u673A\u914D\u7F6E\u548C git hooks\uFF0C\u4E0D\u91CD\u65B0\u521B\u5EFA Fabric \u6587\u4EF6\u3002",
|
|
1413
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",
|
|
1414
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(["
|
|
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
|
-
|
|
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
|
|
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
|
-
"
|
|
694
|
+
"models",
|
|
671
695
|
// entities, data structures, relationships
|
|
672
|
-
"
|
|
696
|
+
"decisions",
|
|
673
697
|
// architectural/technical choices with rationale
|
|
674
|
-
"
|
|
698
|
+
"guidelines",
|
|
675
699
|
// recommended practices (recommend) or anti-patterns (avoid)
|
|
676
|
-
"
|
|
700
|
+
"pitfalls",
|
|
677
701
|
// known risks, failure modes, troubleshooting
|
|
678
|
-
"
|
|
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
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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";
|