@fenglimg/fabric-shared 2.3.0-rc.10 → 2.3.0-rc.12

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.
@@ -49,16 +49,24 @@ var _knowledgeTypeEnum = z3.enum(["models", "decisions", "guidelines", "pitfalls
49
49
  var _maturityEnum = z3.enum(["draft", "verified", "proven"]);
50
50
  var _ruleDescriptionSchema = z3.object({
51
51
  summary: z3.string(),
52
- intent_clues: z3.array(z3.string()),
52
+ // TASK-005 wire thinning: intent_clues dropped from recall wire (0 hook
53
+ // consumers grep-verified). Selection signal is summary + must_read_if
54
+ // (when distinct) + knowledge_type; intent_clues is preserved in the on-disk
55
+ // .md frontmatter (KB source-of-truth) and reachable via read_path.
56
+ intent_clues: z3.array(z3.string()).optional(),
53
57
  // wire-slim (payload): fab_recall projects a LEAN description (summary +
54
- // must_read_if + intent_clues + knowledge_type — the selection signal), leaving
55
- // tech_stack/impact to be Read on demand via read_path (KT-DEC-0026 lean
58
+ // must_read_if + knowledge_type — the selection signal), leaving tech_stack/
59
+ // impact/intent_clues to be Read on demand via read_path (KT-DEC-0026 lean
56
60
  // contract at the field level). So they are optional on the wire. plan-context
57
- // still returns them in full — zod keeps optional-present values, only ABSENT is
58
- // now allowed, so no plan-context consumer regresses.
61
+ // still returns them in full — zod keeps optional-present values, only ABSENT
62
+ // is now allowed, so no plan-context consumer regresses.
59
63
  tech_stack: z3.array(z3.string()).optional(),
60
64
  impact: z3.array(z3.string()).optional(),
61
- must_read_if: z3.string(),
65
+ // TASK-002 wire dedup: omitted when identical to `summary` (~40% of KB entries
66
+ // — knowledge-meta-builder.ts:212/:248 `?? summary` fallback). Consumers may
67
+ // fall back to `summary` when absent. KB source-of-truth (the .md frontmatter)
68
+ // stays unchanged; this optionality is a WIRE-only projection.
69
+ must_read_if: z3.string().optional(),
62
70
  // v2.0: optional knowledge-entry fields. Absent for v1.x rules; present for
63
71
  // entries that declare frontmatter `id/type/maturity`. W4/Track1: the redundant
64
72
  // `knowledge_layer` field was removed — a candidate's layer is derived from its
@@ -310,28 +318,40 @@ var recallInputSchema = z3.object({
310
318
  // W1-3 / KT-DEC-0031: graph expansion (surface related read paths, no body).
311
319
  include_related: z3.boolean().optional().describe(
312
320
  "When true, also surface the one-hop `related` graph neighbours (of the surfaced entries) that are present in the candidate set \u2014 their descriptions and read paths, NOT their bodies."
321
+ ),
322
+ // TASK-006 (KT-PIT-0036 observability opt-in): score_breakdown carries the
323
+ // numbers-only signal decomposition (bm25/vector/salience/recency/locality/
324
+ // proximity/credibility → final). Emitted per-entry ONLY when this flag is
325
+ // true — the debug/tuning surface. Steady-state recall omits it to stay lean
326
+ // (~4.8KB saved on a 24-entry sample). final===score invariant still enforced
327
+ // at the plan-context service layer (candidate_scores Map) regardless.
328
+ include_score_breakdown: z3.boolean().optional().describe(
329
+ "When true, populate `entry.score_breakdown` (numbers-only signal decomposition \u2014 bm25/vector/salience/recency/locality/proximity/credibility \u2192 final). Off by default for wire efficiency. Enable when debugging ranking or tuning scoring weights."
313
330
  )
314
331
  });
332
+ var _recallEntryDescriptionSchema = z3.object({
333
+ summary: z3.string(),
334
+ // TASK-002: omitted when identical to summary (~40% dedup).
335
+ must_read_if: z3.string().optional(),
336
+ // Semantic-preservation (PLN-002 F1 restored): knowledge-hint-narrow.cjs
337
+ // consumes this for the "⚠️ 后果" narrow-hint line.
338
+ impact: z3.array(z3.string()).optional(),
339
+ // Semantic-preservation (PLN-002): cite-contract-reminder.cjs consumes it.
340
+ knowledge_type: _knowledgeTypeEnum.optional()
341
+ });
315
342
  var _recallEntrySchema = z3.object({
316
343
  stable_id: z3.string(),
317
- // 1-based relevance rank (entries are returned best-first). The surfaced
318
- // ranking signal entries are already sorted, rank makes the order explicit.
319
- rank: z3.number().int().positive(),
320
- // The DESCRIPTION (summary / intent_clues / must_read_if / related ...). No body.
321
- description: _ruleDescriptionSchema,
344
+ // The projected DESCRIPTION (recall-specific slim contract, not the shared
345
+ // frontmatter shape). Codex review F6: dedicated schema locks the wire contract.
346
+ description: _recallEntryDescriptionSchema,
322
347
  // on-disk knowledge file to Read for the full body. Omitted when the entry has
323
348
  // no resolvable file (description-only discovery) or was scoped out by `ids`.
324
349
  read_path: z3.string().optional(),
325
350
  // originating store alias (omitted for unqualified / single-store entries).
326
- store: z3.object({ alias: z3.string() }).optional(),
351
+ store_alias: z3.string().optional(),
327
352
  // true when this entry's body is ALSO injected at SessionStart (broad
328
353
  // model/guideline "ALWAYS-ACTIVE") — skip the Read, it is already in context.
329
354
  body_in_context: z3.boolean().optional(),
330
- // P1 recall-observability: the fused relevance score this entry scored during
331
- // the plan-context sort (was computed internally but dropped before this wave).
332
- // Optional + additive — backward-compatible. MUST be declared here or zod
333
- // .strip() silently drops it at the MCP boundary (KT-PIT-0005).
334
- score: z3.number().optional(),
335
355
  // P1 recall-observability: numbers-only decomposition of `score` into its
336
356
  // weighted signal contributions. NEVER carries body/description text — preserves
337
357
  // the lean read_path contract (KT-DEC-0019 / KT-GLD-0005). bm25_rank/vector_rank
@@ -355,25 +375,24 @@ var _recallEntrySchema = z3.object({
355
375
  }).optional()
356
376
  });
357
377
  var recallOutputSchema = z3.object({
378
+ // Retained: client hook cache key (packages/cli/.claude/hooks/knowledge-hint-narrow.cjs)
358
379
  revision_hash: z3.string(),
359
- stale: z3.boolean(),
360
380
  // ux-w2-4: single unified entry list (was candidates[] + paths[] + per-path
361
381
  // requirement-profile entries[]). Each item carries description + read_path +
362
382
  // rank + body_in_context, so the agent never joins two arrays on stable_id.
363
383
  entries: z3.array(_recallEntrySchema),
364
- // v2.2 payload de-dup: single top-level echo of the caller's `intent`.
365
- // Omitted when no intent.
366
- intent: z3.string().optional(),
367
384
  // K6 (W3-K): structured list of lower-ranked candidates dropped by the
368
- // retrieval pipeline, each tagged with WHY (`retrieval_budget` = top_k cap +
369
- // ratio-to-top floor; `payload_budget` = MCP payload-byte trim). Present (and
370
- // non-empty) ONLY when truncation fired — keeps the steady-state wire shape
371
- // unchanged while signalling which entries exist ("narrow your intent"), now
372
- // with a controlled reason instead of a bare count. Reuses the archive-scan
373
- // {key,reason} omission convention (_recallDropReasonSchema, keyed on id).
374
- dropped: z3.array(z3.object({ id: z3.string(), reason: _recallDropReasonSchema })).optional(),
375
- preflight_diagnostics: z3.array(_preflightDiagnosticSchema),
385
+ // retrieval pipeline. dropped_ids preserves per-id transparency (KT-DEC-0028);
386
+ // dropped_reasons hoists the reason to a top-level count map (68/68 same-reason
387
+ // observation from ANL-002). Present ONLY when truncation fired.
388
+ dropped_ids: z3.array(z3.string()).optional(),
389
+ dropped_reasons: z3.object({
390
+ retrieval_budget: z3.number().int().nonnegative().optional(),
391
+ payload_budget: z3.number().int().nonnegative().optional()
392
+ }).optional(),
393
+ preflight_diagnostics: z3.array(_preflightDiagnosticSchema).optional(),
376
394
  warnings: z3.array(structuredWarningSchema).optional(),
395
+ // Auto-heal banner pair (consumed by knowledge-hint-broad.cjs:711-729).
377
396
  auto_healed: z3.boolean().optional(),
378
397
  previous_revision_hash: z3.string().optional(),
379
398
  // v2.0.0-rc.37 NEW-24: parallel to planContextOutputSchema.redirects — stale
@@ -384,9 +403,6 @@ var recallOutputSchema = z3.object({
384
403
  // (appended id → surfaced source id). Present only when include_related
385
404
  // appended an in-corpus neighbour. Omitted on the steady-state path.
386
405
  related_appended: z3.record(z3.string()).optional(),
387
- // v2.2 MC1-recall-pack: standing behavioral directive (cite-before-edit) +
388
- // dynamic discovery hints, so the one-call recall is self-describing.
389
- directive: z3.string(),
390
406
  next_steps: z3.array(z3.string()).optional()
391
407
  });
392
408
  var recallAnnotations = {
@@ -728,11 +744,45 @@ var FabReviewInputSchema = z3.discriminatedUnion("action", [
728
744
  layer: z3.enum(["team", "personal"])
729
745
  })
730
746
  }),
747
+ // v2.3 batch content-modify: array-native flush for the fabric-review maintain
748
+ // loop. Each item is an INDEPENDENT content edit — unlike approve/reject/defer
749
+ // (which share one reason/until over pending_paths[]), modify needs its OWN
750
+ // changes per entry, so the shape is items[] not paths[]. Layer is stripped
751
+ // per item (content-only; layer-flips stay on the single interactive
752
+ // modify-layer path). Per-item failure is isolated: a bad item reports
753
+ // {ok:false, error} in modified[] without aborting its siblings.
754
+ z3.object({
755
+ action: z3.literal("modify-content-batch"),
756
+ items: z3.array(
757
+ z3.object({
758
+ pending_path: z3.string().min(1),
759
+ changes: _fabReviewModifyChangesSchema
760
+ })
761
+ ).min(1)
762
+ }),
731
763
  z3.object({
732
764
  action: z3.literal("defer"),
733
765
  pending_paths: z3.array(z3.string()).min(1),
734
766
  until: z3.string().datetime().optional(),
735
767
  reason: z3.string().optional()
768
+ }),
769
+ // retire (W3-C: fabric-review retire-mode landing surface). Semantically
770
+ // deprecates one or more CANONICAL knowledge entries so they stop surfacing in
771
+ // recall candidates / broad SessionStart indexes — WITHOUT deleting the file
772
+ // (red line: deprecate-over-delete). The service writes `deprecated: true`
773
+ // (+ `superseded_by: <id>` when the entry is replaced) into the entry's
774
+ // frontmatter via the same in-place merge path modify uses; body + stable_id
775
+ // are preserved so the "当时为什么这么决策" rationale stays inspectable.
776
+ z3.object({
777
+ action: z3.literal("retire"),
778
+ // Canonical entry paths (store-absolute, from fab_pending list/search).
779
+ pending_paths: z3.array(z3.string()).min(1),
780
+ // Optional stable_id of the entry that supersedes these (bare `KT-DEC-0001`
781
+ // or store-qualified `alias:KT-DEC-0001`). Written as `superseded_by`
782
+ // frontmatter so the supersession chain is recoverable.
783
+ superseded_by: z3.string().optional(),
784
+ // Optional human reason recorded on the knowledge_modified ledger event.
785
+ reason: z3.string().optional()
736
786
  })
737
787
  ]);
738
788
  var FabPendingInputSchema = z3.discriminatedUnion("action", [
@@ -758,11 +808,20 @@ var FabPendingInputShape = {
758
808
  )
759
809
  };
760
810
  var FabReviewInputShape = {
761
- action: z3.enum(["approve", "reject", "modify", "modify-content", "modify-layer", "defer"]).describe(
762
- "Action selector. Discriminates the per-action fields below; required. modify-content edits scalars (no layer); modify-layer is the layer-flip path (changes.layer required); modify is the legacy combined alias. (list/search moved to the read-only fab_pending tool.)"
811
+ action: z3.enum([
812
+ "approve",
813
+ "reject",
814
+ "modify",
815
+ "modify-content",
816
+ "modify-layer",
817
+ "modify-content-batch",
818
+ "defer",
819
+ "retire"
820
+ ]).describe(
821
+ "Action selector. Discriminates the per-action fields below; required. modify-content edits scalars (no layer); modify-layer is the layer-flip path (changes.layer required); modify is the legacy combined alias; modify-content-batch flushes an array of independent content edits (items[]) in one call; retire marks canonical entries deprecated (deprecate-over-delete) so they stop surfacing. (list/search moved to the read-only fab_pending tool.)"
763
822
  ),
764
823
  pending_paths: z3.array(z3.string()).min(1).optional().describe(
765
- "Workspace-relative pending entry paths. Required when action=approve|reject|defer (non-empty array)."
824
+ "Workspace-relative pending entry paths (or canonical entry paths for action=retire). Required when action=approve|reject|defer|retire (non-empty array)."
766
825
  ),
767
826
  pending_path: z3.string().min(1).optional().describe(
768
827
  "Workspace-relative pending OR canonical entry path. Required when action=modify."
@@ -773,8 +832,19 @@ var FabReviewInputShape = {
773
832
  changes: _fabReviewModifyChangesSchema.optional().describe(
774
833
  "Frontmatter scalar patches (title/summary/layer/maturity/tags/relevance_*/semantic_scope/related). Required when action=modify. semantic_scope re-scopes the entry's resolution coordinate in place (e.g. team \u2192 project:<id>) without moving stores; personal-root coordinates are rejected (use modify-layer)."
775
834
  ),
835
+ items: z3.array(
836
+ z3.object({
837
+ pending_path: z3.string().min(1),
838
+ changes: _fabReviewModifyChangesSchema
839
+ })
840
+ ).min(1).optional().describe(
841
+ "Batch of independent content edits \u2014 required (non-empty) when action=modify-content-batch. Each item {pending_path, changes} is applied content-only (layer stripped); per-item failures surface in modified[] without aborting siblings."
842
+ ),
776
843
  until: z3.string().datetime().optional().describe(
777
844
  "ISO-8601 datetime upper bound for the deferral. Optional; used only when action=defer."
845
+ ),
846
+ superseded_by: z3.string().optional().describe(
847
+ "Stable_id (bare or store-qualified) of the entry that supersedes the retired one, written as `superseded_by` frontmatter. Optional; used only when action=retire."
778
848
  )
779
849
  };
780
850
  var _fabReviewListItemSchema = z3.object({
@@ -851,10 +921,39 @@ var FabReviewOutputSchema = z3.discriminatedUnion("action", [
851
921
  new_stable_id: z3.string().optional(),
852
922
  warnings: z3.array(structuredWarningSchema).optional()
853
923
  }),
924
+ // v2.3 batch content-modify result: per-item {pending_path, ok, error?}. No
925
+ // prior/new_stable_id — content edits strip layer, so no id reallocation can
926
+ // occur. ok=false items carry the failure message; siblings still applied
927
+ // (partial failure is reported per-item, never thrown for the whole batch).
928
+ z3.object({
929
+ action: z3.literal("modify-content-batch"),
930
+ modified: z3.array(
931
+ z3.object({
932
+ pending_path: z3.string(),
933
+ ok: z3.boolean(),
934
+ error: z3.string().optional()
935
+ })
936
+ ),
937
+ warnings: z3.array(structuredWarningSchema).optional()
938
+ }),
854
939
  z3.object({
855
940
  action: z3.literal("defer"),
856
941
  deferred: z3.array(z3.string()),
857
942
  warnings: z3.array(structuredWarningSchema).optional()
943
+ }),
944
+ z3.object({
945
+ action: z3.literal("retire"),
946
+ // Each retired canonical entry: its echoed path + (when the frontmatter
947
+ // carried one) its stable_id, plus the superseded_by id when supplied. The
948
+ // file is NOT deleted — only marked `deprecated: true` in place.
949
+ retired: z3.array(
950
+ z3.object({
951
+ path: z3.string(),
952
+ stable_id: z3.string().optional(),
953
+ superseded_by: z3.string().optional()
954
+ })
955
+ ),
956
+ warnings: z3.array(structuredWarningSchema).optional()
858
957
  })
859
958
  ]);
860
959
  var FabPendingOutputSchema = z3.discriminatedUnion("action", [
@@ -879,7 +978,7 @@ var FabPendingOutputShape = {
879
978
  warnings: z3.array(structuredWarningSchema).optional()
880
979
  };
881
980
  var FabReviewOutputShape = {
882
- action: z3.enum(["approve", "reject", "modify", "defer"]).describe(
981
+ action: z3.enum(["approve", "reject", "modify", "modify-content-batch", "defer", "retire"]).describe(
883
982
  "Echoes the input action; clients can switch on it for per-variant fields below. (list/search results moved to the read-only fab_pending tool.)"
884
983
  ),
885
984
  approved: z3.array(z3.object({ pending_path: z3.string(), stable_id: z3.string() })).optional().describe(
@@ -897,9 +996,27 @@ var FabReviewOutputShape = {
897
996
  new_stable_id: z3.string().optional().describe(
898
997
  "New stable id after reallocation. Present when action=modify AND a layer-flip reallocated the id."
899
998
  ),
999
+ modified: z3.array(
1000
+ z3.object({
1001
+ pending_path: z3.string(),
1002
+ ok: z3.boolean(),
1003
+ error: z3.string().optional()
1004
+ })
1005
+ ).optional().describe(
1006
+ "Per-item results for action=modify-content-batch: {pending_path, ok, error?}. ok=false items carry the error; siblings still applied."
1007
+ ),
900
1008
  deferred: z3.array(z3.string()).optional().describe(
901
1009
  "Pending paths that were deferred (files retained on disk). Present when action=defer."
902
1010
  ),
1011
+ retired: z3.array(
1012
+ z3.object({
1013
+ path: z3.string(),
1014
+ stable_id: z3.string().optional(),
1015
+ superseded_by: z3.string().optional()
1016
+ })
1017
+ ).optional().describe(
1018
+ "Canonical entries marked deprecated in place (files retained \u2014 deprecate-over-delete). Present when action=retire."
1019
+ ),
903
1020
  // v2.0.0-rc.23 TASK-009 (d): optional warnings surface for the first-reconcile
904
1021
  // gate (`meta_stale` / `reconcile_failed`). Absent on the steady-state path.
905
1022
  warnings: z3.array(structuredWarningSchema).optional()
@@ -648,6 +648,13 @@ var enMessages = {
648
648
  "doctor.check.write_route_target_unbound.ok": "Every write_routes[*].store is present in required_stores; the scope\u2192store routing is statically consistent.",
649
649
  "doctor.check.write_route_target_unbound.message": '{count} write_route(s) point at an unbound store ({routes}); fab_propose on those scopes will report "no write-target store resolved".',
650
650
  "doctor.check.write_route_target_unbound.remediation": "Either \u2460 `fabric store bind <store>` to add the target to required_stores (under the single team slot rule this replaces the current one), or \u2461 edit `.fabric/fabric-config.json` to remove the stale write_route.",
651
+ // stray_fabric_dir_detected — rc.11 root-cause fix: server-side resolveProjectRoot used cwd,
652
+ // so a subprocess launched from a subdirectory created .fabric/ in the wrong place. This
653
+ // lint walks the project tree and reports every .fabric/ other than <root>/.fabric.
654
+ "doctor.check.stray_fabric_dir_detected.name": "Stray .fabric directories",
655
+ "doctor.check.stray_fabric_dir_detected.ok": "No stray .fabric directories under the project root \u2014 the only authoritative anchor is <projectRoot>/.fabric.",
656
+ "doctor.check.stray_fabric_dir_detected.message": "Found {count} stray .fabric director(ies) ({dirs}) left by subprocesses that mistook a subdirectory for the project root (pre-rc.10 hooks / pre-rc.11 server-side). These scatter events.jsonl / metrics.jsonl / .cache across the source tree.",
657
+ "doctor.check.stray_fabric_dir_detected.remediation": "Run `fabric doctor --fix` to rename each stray dir to `.fabric.stale-<timestamp>` (rescue-before-delete \u2014 never a hard delete). Review the renamed dirs before merging events. Also upgrade global fabric-cli to rc.11+ so the server-side git-anchor resolver is active.",
651
658
  "doctor.check.skill_md_yaml_invalid.name": "Skill markdown YAML",
652
659
  "doctor.check.skill_md_yaml_invalid.ok": "All .claude/.codex SKILL.md frontmatter values parse as strict YAML.",
653
660
  "doctor.check.skill_md_yaml_invalid.message.singular": "{count} SKILL.md frontmatter value contains an unquoted ': ' that strict YAML parsers reject (Claude Code tolerates it; Codex CLI drops the skill at load). First: {detail}.",
@@ -1962,6 +1969,12 @@ var zhCNMessages = {
1962
1969
  "doctor.check.write_route_target_unbound.ok": "\u6240\u6709 write_routes \u7684\u76EE\u6807 store \u90FD\u5728 required_stores \u5185,scope\u2192store \u8DEF\u7531\u9759\u6001\u4E00\u81F4\u3002",
1963
1970
  "doctor.check.write_route_target_unbound.message": '{count} \u6761 write_route \u6307\u5411\u672A\u7ED1\u5B9A\u7684 store({routes});fab_propose \u5728\u8FD9\u4E9B scope \u4E0A\u4F1A\u62A5 "no write-target store resolved"\u3002',
1964
1971
  "doctor.check.write_route_target_unbound.remediation": "\u4E8C\u9009\u4E00:\u2460 `fabric store bind <store>` \u628A\u76EE\u6807 store \u52A0\u8FDB required_stores(\u5355 team \u69FD = \u9700\u66FF\u6362\u6389\u5F53\u524D\u7684),\u6216 \u2461 \u7F16\u8F91 `.fabric/fabric-config.json` \u5220\u6389\u8FD9\u6761 write_route\u3002",
1972
+ // stray_fabric_dir_detected — rc.11 root-cause fix: server-side resolveProjectRoot 之前用 cwd,
1973
+ // 从子目录起的子进程会把 .fabric/ 建在错误的路径。此 lint 扫描项目树,找出 <root>/.fabric 之外的所有 .fabric/。
1974
+ "doctor.check.stray_fabric_dir_detected.name": "\u6E38\u79BB .fabric \u76EE\u5F55",
1975
+ "doctor.check.stray_fabric_dir_detected.ok": "\u9879\u76EE\u4E0B\u672A\u53D1\u73B0\u6E38\u79BB .fabric \u76EE\u5F55,\u552F\u4E00\u6743\u5A01\u6839 .fabric \u5C31\u662F <projectRoot>/.fabric\u3002",
1976
+ "doctor.check.stray_fabric_dir_detected.message": "\u53D1\u73B0 {count} \u4E2A\u6E38\u79BB .fabric \u76EE\u5F55({dirs}),\u5B83\u4EEC\u662F\u5B50\u8FDB\u7A0B\u5728\u5B50\u76EE\u5F55\u88AB\u8BEF\u8BA4\u4F5C project root \u7684\u5386\u53F2\u9057\u7559(rc.10 \u4E4B\u524D\u7684 hook / rc.11 \u4E4B\u524D\u7684 server \u4FA7),\u4F1A\u5BFC\u81F4 events.jsonl / metrics.jsonl / .cache \u6563\u843D\u3002",
1977
+ "doctor.check.stray_fabric_dir_detected.remediation": "\u8DD1 `fabric doctor --fix` \u4F1A\u628A\u6BCF\u4E2A\u6E38\u79BB dir \u6539\u540D\u4E3A `.fabric.stale-<timestamp>`(rescue-before-delete,\u4E0D\u786C\u5220)\u3002\u6539\u540D\u540E\u53EF\u4EBA\u5DE5\u6838\u5BF9\u662F\u5426\u9700\u8981\u5408\u5E76 events \u518D\u5220\u3002\u540C\u65F6\u5347\u7EA7\u672C\u673A fabric-cli \u81F3 rc.11+ \u8BA9 server \u4FA7 git-anchor \u751F\u6548\u3002",
1965
1978
  "doctor.check.skill_md_yaml_invalid.name": "Skill markdown YAML",
1966
1979
  "doctor.check.skill_md_yaml_invalid.ok": "\u6240\u6709 .claude/.codex SKILL.md frontmatter values \u90FD\u80FD\u6309 strict YAML \u89E3\u6790\u3002",
1967
1980
  "doctor.check.skill_md_yaml_invalid.message.singular": "{count} \u4E2A SKILL.md frontmatter value \u5305\u542B\u672A\u52A0\u5F15\u53F7\u7684 ': '\uFF0Cstrict YAML parsers \u4F1A\u62D2\u7EDD\uFF08Claude Code tolerates it\uFF1BCodex CLI drops the skill at load\uFF09\u3002\u9996\u4E2A\uFF1A{detail}\u3002",
@@ -5,7 +5,7 @@ import {
5
5
  enMessages,
6
6
  resolveFabricLocale,
7
7
  zhCNMessages
8
- } from "../chunk-XRX6RVZY.js";
8
+ } from "../chunk-YLIWE46B.js";
9
9
  import {
10
10
  detectNodeLocale,
11
11
  normalizeLocale,
package/dist/index.d.ts CHANGED
@@ -8431,7 +8431,6 @@ declare const llmJudgeRunEventSchema: z.ZodObject<{
8431
8431
  }, "strip", z.ZodTypeAny, {
8432
8432
  id: string;
8433
8433
  version: string;
8434
- score: number;
8435
8434
  ts: number;
8436
8435
  model: string;
8437
8436
  schema_version: 1;
@@ -8440,12 +8439,12 @@ declare const llmJudgeRunEventSchema: z.ZodObject<{
8440
8439
  event_type: "llm_judge_run";
8441
8440
  prompt: string;
8442
8441
  input_trace_id: string;
8442
+ score: number;
8443
8443
  correlation_id?: string | undefined;
8444
8444
  session_id?: string | undefined;
8445
8445
  }, {
8446
8446
  id: string;
8447
8447
  version: string;
8448
- score: number;
8449
8448
  ts: number;
8450
8449
  model: string;
8451
8450
  schema_version: 1;
@@ -8454,6 +8453,7 @@ declare const llmJudgeRunEventSchema: z.ZodObject<{
8454
8453
  event_type: "llm_judge_run";
8455
8454
  prompt: string;
8456
8455
  input_trace_id: string;
8456
+ score: number;
8457
8457
  correlation_id?: string | undefined;
8458
8458
  session_id?: string | undefined;
8459
8459
  }>;
@@ -10599,7 +10599,6 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
10599
10599
  }, "strip", z.ZodTypeAny, {
10600
10600
  id: string;
10601
10601
  version: string;
10602
- score: number;
10603
10602
  ts: number;
10604
10603
  model: string;
10605
10604
  schema_version: 1;
@@ -10608,12 +10607,12 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
10608
10607
  event_type: "llm_judge_run";
10609
10608
  prompt: string;
10610
10609
  input_trace_id: string;
10610
+ score: number;
10611
10611
  correlation_id?: string | undefined;
10612
10612
  session_id?: string | undefined;
10613
10613
  }, {
10614
10614
  id: string;
10615
10615
  version: string;
10616
- score: number;
10617
10616
  ts: number;
10618
10617
  model: string;
10619
10618
  schema_version: 1;
@@ -10622,6 +10621,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
10622
10621
  event_type: "llm_judge_run";
10623
10622
  prompt: string;
10624
10623
  input_trace_id: string;
10624
+ score: number;
10625
10625
  correlation_id?: string | undefined;
10626
10626
  session_id?: string | undefined;
10627
10627
  }>, z.ZodObject<{
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  enMessages,
17
17
  resolveFabricLocale,
18
18
  zhCNMessages
19
- } from "./chunk-XRX6RVZY.js";
19
+ } from "./chunk-YLIWE46B.js";
20
20
  import {
21
21
  GLOBAL_BINDINGS_DIR,
22
22
  GLOBAL_STATE_DIR,
@@ -116,7 +116,7 @@ import {
116
116
  scopeCoordinateSchema,
117
117
  scopeRoot,
118
118
  structuredWarningSchema
119
- } from "./chunk-TV264D7E.js";
119
+ } from "./chunk-TEITGZY3.js";
120
120
 
121
121
  // src/schemas/agents-meta.ts
122
122
  import { z } from "zod";
@@ -90,10 +90,10 @@ declare const planContextOutputSchema: z.ZodObject<{
90
90
  stable_id: z.ZodString;
91
91
  description: z.ZodObject<{
92
92
  summary: z.ZodString;
93
- intent_clues: z.ZodArray<z.ZodString, "many">;
93
+ intent_clues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
94
94
  tech_stack: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
95
95
  impact: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
96
- must_read_if: z.ZodString;
96
+ must_read_if: z.ZodOptional<z.ZodString>;
97
97
  id: z.ZodOptional<z.ZodString>;
98
98
  knowledge_type: z.ZodOptional<z.ZodEnum<["models", "decisions", "guidelines", "pitfalls", "processes"]>>;
99
99
  maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
@@ -105,14 +105,14 @@ declare const planContextOutputSchema: z.ZodObject<{
105
105
  aliases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
106
  }, "strip", z.ZodTypeAny, {
107
107
  summary: string;
108
- intent_clues: string[];
109
- must_read_if: string;
110
108
  created_at?: string | undefined;
111
109
  id?: string | undefined;
112
110
  relevance_scope?: "narrow" | "broad" | undefined;
113
111
  relevance_paths?: string[] | undefined;
112
+ intent_clues?: string[] | undefined;
114
113
  tech_stack?: string[] | undefined;
115
114
  impact?: string[] | undefined;
115
+ must_read_if?: string | undefined;
116
116
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
117
117
  maturity?: "draft" | "verified" | "proven" | undefined;
118
118
  tags?: string[] | undefined;
@@ -120,14 +120,14 @@ declare const planContextOutputSchema: z.ZodObject<{
120
120
  aliases?: string[] | undefined;
121
121
  }, {
122
122
  summary: string;
123
- intent_clues: string[];
124
- must_read_if: string;
125
123
  created_at?: string | undefined;
126
124
  id?: string | undefined;
127
125
  relevance_scope?: "narrow" | "broad" | undefined;
128
126
  relevance_paths?: string[] | undefined;
127
+ intent_clues?: string[] | undefined;
129
128
  tech_stack?: string[] | undefined;
130
129
  impact?: string[] | undefined;
130
+ must_read_if?: string | undefined;
131
131
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
132
132
  maturity?: "draft" | "verified" | "proven" | undefined;
133
133
  tags?: string[] | undefined;
@@ -138,14 +138,14 @@ declare const planContextOutputSchema: z.ZodObject<{
138
138
  }, "strip", z.ZodTypeAny, {
139
139
  description: {
140
140
  summary: string;
141
- intent_clues: string[];
142
- must_read_if: string;
143
141
  created_at?: string | undefined;
144
142
  id?: string | undefined;
145
143
  relevance_scope?: "narrow" | "broad" | undefined;
146
144
  relevance_paths?: string[] | undefined;
145
+ intent_clues?: string[] | undefined;
147
146
  tech_stack?: string[] | undefined;
148
147
  impact?: string[] | undefined;
148
+ must_read_if?: string | undefined;
149
149
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
150
150
  maturity?: "draft" | "verified" | "proven" | undefined;
151
151
  tags?: string[] | undefined;
@@ -157,14 +157,14 @@ declare const planContextOutputSchema: z.ZodObject<{
157
157
  }, {
158
158
  description: {
159
159
  summary: string;
160
- intent_clues: string[];
161
- must_read_if: string;
162
160
  created_at?: string | undefined;
163
161
  id?: string | undefined;
164
162
  relevance_scope?: "narrow" | "broad" | undefined;
165
163
  relevance_paths?: string[] | undefined;
164
+ intent_clues?: string[] | undefined;
166
165
  tech_stack?: string[] | undefined;
167
166
  impact?: string[] | undefined;
167
+ must_read_if?: string | undefined;
168
168
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
169
169
  maturity?: "draft" | "verified" | "proven" | undefined;
170
170
  tags?: string[] | undefined;
@@ -241,14 +241,14 @@ declare const planContextOutputSchema: z.ZodObject<{
241
241
  candidates: {
242
242
  description: {
243
243
  summary: string;
244
- intent_clues: string[];
245
- must_read_if: string;
246
244
  created_at?: string | undefined;
247
245
  id?: string | undefined;
248
246
  relevance_scope?: "narrow" | "broad" | undefined;
249
247
  relevance_paths?: string[] | undefined;
248
+ intent_clues?: string[] | undefined;
250
249
  tech_stack?: string[] | undefined;
251
250
  impact?: string[] | undefined;
251
+ must_read_if?: string | undefined;
252
252
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
253
253
  maturity?: "draft" | "verified" | "proven" | undefined;
254
254
  tags?: string[] | undefined;
@@ -296,14 +296,14 @@ declare const planContextOutputSchema: z.ZodObject<{
296
296
  candidates: {
297
297
  description: {
298
298
  summary: string;
299
- intent_clues: string[];
300
- must_read_if: string;
301
299
  created_at?: string | undefined;
302
300
  id?: string | undefined;
303
301
  relevance_scope?: "narrow" | "broad" | undefined;
304
302
  relevance_paths?: string[] | undefined;
303
+ intent_clues?: string[] | undefined;
305
304
  tech_stack?: string[] | undefined;
306
305
  impact?: string[] | undefined;
306
+ must_read_if?: string | undefined;
307
307
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
308
308
  maturity?: "draft" | "verified" | "proven" | undefined;
309
309
  tags?: string[] | undefined;
@@ -568,6 +568,7 @@ declare const recallInputSchema: z.ZodObject<{
568
568
  target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
569
569
  ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
570
570
  include_related: z.ZodOptional<z.ZodBoolean>;
571
+ include_score_breakdown: z.ZodOptional<z.ZodBoolean>;
571
572
  }, "strip", z.ZodTypeAny, {
572
573
  paths: string[];
573
574
  known_tech?: string[] | undefined;
@@ -580,6 +581,7 @@ declare const recallInputSchema: z.ZodObject<{
580
581
  target_paths?: string[] | undefined;
581
582
  ids?: string[] | undefined;
582
583
  include_related?: boolean | undefined;
584
+ include_score_breakdown?: boolean | undefined;
583
585
  }, {
584
586
  paths: string[];
585
587
  known_tech?: string[] | undefined;
@@ -592,69 +594,31 @@ declare const recallInputSchema: z.ZodObject<{
592
594
  target_paths?: string[] | undefined;
593
595
  ids?: string[] | undefined;
594
596
  include_related?: boolean | undefined;
597
+ include_score_breakdown?: boolean | undefined;
595
598
  }>;
596
599
  declare const recallOutputSchema: z.ZodObject<{
597
600
  revision_hash: z.ZodString;
598
- stale: z.ZodBoolean;
599
601
  entries: z.ZodArray<z.ZodObject<{
600
602
  stable_id: z.ZodString;
601
- rank: z.ZodNumber;
602
603
  description: z.ZodObject<{
603
604
  summary: z.ZodString;
604
- intent_clues: z.ZodArray<z.ZodString, "many">;
605
- tech_stack: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
605
+ must_read_if: z.ZodOptional<z.ZodString>;
606
606
  impact: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
607
- must_read_if: z.ZodString;
608
- id: z.ZodOptional<z.ZodString>;
609
607
  knowledge_type: z.ZodOptional<z.ZodEnum<["models", "decisions", "guidelines", "pitfalls", "processes"]>>;
610
- maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
611
- created_at: z.ZodOptional<z.ZodString>;
612
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
613
- relevance_scope: z.ZodOptional<z.ZodEnum<["narrow", "broad"]>>;
614
- relevance_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
615
- related: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
616
- aliases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
617
608
  }, "strip", z.ZodTypeAny, {
618
609
  summary: string;
619
- intent_clues: string[];
620
- must_read_if: string;
621
- created_at?: string | undefined;
622
- id?: string | undefined;
623
- relevance_scope?: "narrow" | "broad" | undefined;
624
- relevance_paths?: string[] | undefined;
625
- tech_stack?: string[] | undefined;
626
610
  impact?: string[] | undefined;
611
+ must_read_if?: string | undefined;
627
612
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
628
- maturity?: "draft" | "verified" | "proven" | undefined;
629
- tags?: string[] | undefined;
630
- related?: string[] | undefined;
631
- aliases?: string[] | undefined;
632
613
  }, {
633
614
  summary: string;
634
- intent_clues: string[];
635
- must_read_if: string;
636
- created_at?: string | undefined;
637
- id?: string | undefined;
638
- relevance_scope?: "narrow" | "broad" | undefined;
639
- relevance_paths?: string[] | undefined;
640
- tech_stack?: string[] | undefined;
641
615
  impact?: string[] | undefined;
616
+ must_read_if?: string | undefined;
642
617
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
643
- maturity?: "draft" | "verified" | "proven" | undefined;
644
- tags?: string[] | undefined;
645
- related?: string[] | undefined;
646
- aliases?: string[] | undefined;
647
618
  }>;
648
619
  read_path: z.ZodOptional<z.ZodString>;
649
- store: z.ZodOptional<z.ZodObject<{
650
- alias: z.ZodString;
651
- }, "strip", z.ZodTypeAny, {
652
- alias: string;
653
- }, {
654
- alias: string;
655
- }>>;
620
+ store_alias: z.ZodOptional<z.ZodString>;
656
621
  body_in_context: z.ZodOptional<z.ZodBoolean>;
657
- score: z.ZodOptional<z.ZodNumber>;
658
622
  score_breakdown: z.ZodOptional<z.ZodObject<{
659
623
  final: z.ZodNumber;
660
624
  bm25: z.ZodOptional<z.ZodNumber>;
@@ -692,28 +656,14 @@ declare const recallOutputSchema: z.ZodObject<{
692
656
  }, "strip", z.ZodTypeAny, {
693
657
  description: {
694
658
  summary: string;
695
- intent_clues: string[];
696
- must_read_if: string;
697
- created_at?: string | undefined;
698
- id?: string | undefined;
699
- relevance_scope?: "narrow" | "broad" | undefined;
700
- relevance_paths?: string[] | undefined;
701
- tech_stack?: string[] | undefined;
702
659
  impact?: string[] | undefined;
660
+ must_read_if?: string | undefined;
703
661
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
704
- maturity?: "draft" | "verified" | "proven" | undefined;
705
- tags?: string[] | undefined;
706
- related?: string[] | undefined;
707
- aliases?: string[] | undefined;
708
662
  };
709
663
  stable_id: string;
710
- rank: number;
711
- store?: {
712
- alias: string;
713
- } | undefined;
714
664
  read_path?: string | undefined;
665
+ store_alias?: string | undefined;
715
666
  body_in_context?: boolean | undefined;
716
- score?: number | undefined;
717
667
  score_breakdown?: {
718
668
  final: number;
719
669
  salience: number;
@@ -729,28 +679,14 @@ declare const recallOutputSchema: z.ZodObject<{
729
679
  }, {
730
680
  description: {
731
681
  summary: string;
732
- intent_clues: string[];
733
- must_read_if: string;
734
- created_at?: string | undefined;
735
- id?: string | undefined;
736
- relevance_scope?: "narrow" | "broad" | undefined;
737
- relevance_paths?: string[] | undefined;
738
- tech_stack?: string[] | undefined;
739
682
  impact?: string[] | undefined;
683
+ must_read_if?: string | undefined;
740
684
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
741
- maturity?: "draft" | "verified" | "proven" | undefined;
742
- tags?: string[] | undefined;
743
- related?: string[] | undefined;
744
- aliases?: string[] | undefined;
745
685
  };
746
686
  stable_id: string;
747
- rank: number;
748
- store?: {
749
- alias: string;
750
- } | undefined;
751
687
  read_path?: string | undefined;
688
+ store_alias?: string | undefined;
752
689
  body_in_context?: boolean | undefined;
753
- score?: number | undefined;
754
690
  score_breakdown?: {
755
691
  final: number;
756
692
  salience: number;
@@ -764,18 +700,18 @@ declare const recallOutputSchema: z.ZodObject<{
764
700
  credibility?: number | undefined;
765
701
  } | undefined;
766
702
  }>, "many">;
767
- intent: z.ZodOptional<z.ZodString>;
768
- dropped: z.ZodOptional<z.ZodArray<z.ZodObject<{
769
- id: z.ZodString;
770
- reason: z.ZodEnum<["retrieval_budget", "payload_budget"]>;
703
+ dropped_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
704
+ dropped_reasons: z.ZodOptional<z.ZodObject<{
705
+ retrieval_budget: z.ZodOptional<z.ZodNumber>;
706
+ payload_budget: z.ZodOptional<z.ZodNumber>;
771
707
  }, "strip", z.ZodTypeAny, {
772
- id: string;
773
- reason: "retrieval_budget" | "payload_budget";
708
+ retrieval_budget?: number | undefined;
709
+ payload_budget?: number | undefined;
774
710
  }, {
775
- id: string;
776
- reason: "retrieval_budget" | "payload_budget";
777
- }>, "many">>;
778
- preflight_diagnostics: z.ZodArray<z.ZodObject<{
711
+ retrieval_budget?: number | undefined;
712
+ payload_budget?: number | undefined;
713
+ }>>;
714
+ preflight_diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
779
715
  code: z.ZodEnum<["missing_description", "empty_shell_suppressed"]>;
780
716
  severity: z.ZodLiteral<"warn">;
781
717
  message: z.ZodString;
@@ -793,7 +729,7 @@ declare const recallOutputSchema: z.ZodObject<{
793
729
  severity: "warn";
794
730
  path?: string | undefined;
795
731
  stable_ids?: string[] | undefined;
796
- }>, "many">;
732
+ }>, "many">>;
797
733
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
798
734
  code: z.ZodString;
799
735
  file: z.ZodString;
@@ -817,34 +753,19 @@ declare const recallOutputSchema: z.ZodObject<{
817
753
  previous_revision_hash: z.ZodOptional<z.ZodString>;
818
754
  redirects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
819
755
  related_appended: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
820
- directive: z.ZodString;
821
756
  next_steps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
822
757
  }, "strip", z.ZodTypeAny, {
823
758
  entries: {
824
759
  description: {
825
760
  summary: string;
826
- intent_clues: string[];
827
- must_read_if: string;
828
- created_at?: string | undefined;
829
- id?: string | undefined;
830
- relevance_scope?: "narrow" | "broad" | undefined;
831
- relevance_paths?: string[] | undefined;
832
- tech_stack?: string[] | undefined;
833
761
  impact?: string[] | undefined;
762
+ must_read_if?: string | undefined;
834
763
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
835
- maturity?: "draft" | "verified" | "proven" | undefined;
836
- tags?: string[] | undefined;
837
- related?: string[] | undefined;
838
- aliases?: string[] | undefined;
839
764
  };
840
765
  stable_id: string;
841
- rank: number;
842
- store?: {
843
- alias: string;
844
- } | undefined;
845
766
  read_path?: string | undefined;
767
+ store_alias?: string | undefined;
846
768
  body_in_context?: boolean | undefined;
847
- score?: number | undefined;
848
769
  score_breakdown?: {
849
770
  final: number;
850
771
  salience: number;
@@ -858,20 +779,13 @@ declare const recallOutputSchema: z.ZodObject<{
858
779
  credibility?: number | undefined;
859
780
  } | undefined;
860
781
  }[];
861
- stale: boolean;
862
782
  revision_hash: string;
863
- preflight_diagnostics: {
783
+ preflight_diagnostics?: {
864
784
  code: "missing_description" | "empty_shell_suppressed";
865
785
  message: string;
866
786
  severity: "warn";
867
787
  path?: string | undefined;
868
788
  stable_ids?: string[] | undefined;
869
- }[];
870
- directive: string;
871
- intent?: string | undefined;
872
- dropped?: {
873
- id: string;
874
- reason: "retrieval_budget" | "payload_budget";
875
789
  }[] | undefined;
876
790
  warnings?: {
877
791
  code: string;
@@ -884,33 +798,24 @@ declare const recallOutputSchema: z.ZodObject<{
884
798
  previous_revision_hash?: string | undefined;
885
799
  redirects?: Record<string, string> | undefined;
886
800
  related_appended?: Record<string, string> | undefined;
801
+ dropped_ids?: string[] | undefined;
802
+ dropped_reasons?: {
803
+ retrieval_budget?: number | undefined;
804
+ payload_budget?: number | undefined;
805
+ } | undefined;
887
806
  next_steps?: string[] | undefined;
888
807
  }, {
889
808
  entries: {
890
809
  description: {
891
810
  summary: string;
892
- intent_clues: string[];
893
- must_read_if: string;
894
- created_at?: string | undefined;
895
- id?: string | undefined;
896
- relevance_scope?: "narrow" | "broad" | undefined;
897
- relevance_paths?: string[] | undefined;
898
- tech_stack?: string[] | undefined;
899
811
  impact?: string[] | undefined;
812
+ must_read_if?: string | undefined;
900
813
  knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes" | undefined;
901
- maturity?: "draft" | "verified" | "proven" | undefined;
902
- tags?: string[] | undefined;
903
- related?: string[] | undefined;
904
- aliases?: string[] | undefined;
905
814
  };
906
815
  stable_id: string;
907
- rank: number;
908
- store?: {
909
- alias: string;
910
- } | undefined;
911
816
  read_path?: string | undefined;
817
+ store_alias?: string | undefined;
912
818
  body_in_context?: boolean | undefined;
913
- score?: number | undefined;
914
819
  score_breakdown?: {
915
820
  final: number;
916
821
  salience: number;
@@ -924,20 +829,13 @@ declare const recallOutputSchema: z.ZodObject<{
924
829
  credibility?: number | undefined;
925
830
  } | undefined;
926
831
  }[];
927
- stale: boolean;
928
832
  revision_hash: string;
929
- preflight_diagnostics: {
833
+ preflight_diagnostics?: {
930
834
  code: "missing_description" | "empty_shell_suppressed";
931
835
  message: string;
932
836
  severity: "warn";
933
837
  path?: string | undefined;
934
838
  stable_ids?: string[] | undefined;
935
- }[];
936
- directive: string;
937
- intent?: string | undefined;
938
- dropped?: {
939
- id: string;
940
- reason: "retrieval_budget" | "payload_budget";
941
839
  }[] | undefined;
942
840
  warnings?: {
943
841
  code: string;
@@ -950,6 +848,11 @@ declare const recallOutputSchema: z.ZodObject<{
950
848
  previous_revision_hash?: string | undefined;
951
849
  redirects?: Record<string, string> | undefined;
952
850
  related_appended?: Record<string, string> | undefined;
851
+ dropped_ids?: string[] | undefined;
852
+ dropped_reasons?: {
853
+ retrieval_budget?: number | undefined;
854
+ payload_budget?: number | undefined;
855
+ } | undefined;
953
856
  next_steps?: string[] | undefined;
954
857
  }>;
955
858
  declare const recallAnnotations: {
@@ -1463,6 +1366,121 @@ declare const FabReviewInputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObje
1463
1366
  related?: string[] | undefined;
1464
1367
  title?: string | undefined;
1465
1368
  };
1369
+ }>, z.ZodObject<{
1370
+ action: z.ZodLiteral<"modify-content-batch">;
1371
+ items: z.ZodArray<z.ZodObject<{
1372
+ pending_path: z.ZodString;
1373
+ changes: z.ZodObject<{
1374
+ title: z.ZodOptional<z.ZodString>;
1375
+ summary: z.ZodOptional<z.ZodString>;
1376
+ layer: z.ZodOptional<z.ZodEnum<["team", "personal"]>>;
1377
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
1378
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1379
+ relevance_scope: z.ZodOptional<z.ZodEnum<["narrow", "broad"]>>;
1380
+ relevance_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1381
+ semantic_scope: z.ZodOptional<z.ZodString>;
1382
+ related: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1383
+ must_read_if: z.ZodOptional<z.ZodString>;
1384
+ intent_clues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1385
+ impact: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1386
+ }, "strip", z.ZodTypeAny, {
1387
+ semantic_scope?: string | undefined;
1388
+ relevance_scope?: "narrow" | "broad" | undefined;
1389
+ relevance_paths?: string[] | undefined;
1390
+ layer?: "personal" | "team" | undefined;
1391
+ summary?: string | undefined;
1392
+ intent_clues?: string[] | undefined;
1393
+ impact?: string[] | undefined;
1394
+ must_read_if?: string | undefined;
1395
+ maturity?: "draft" | "verified" | "proven" | undefined;
1396
+ tags?: string[] | undefined;
1397
+ related?: string[] | undefined;
1398
+ title?: string | undefined;
1399
+ }, {
1400
+ semantic_scope?: string | undefined;
1401
+ relevance_scope?: "narrow" | "broad" | undefined;
1402
+ relevance_paths?: string[] | undefined;
1403
+ layer?: "personal" | "team" | undefined;
1404
+ summary?: string | undefined;
1405
+ intent_clues?: string[] | undefined;
1406
+ impact?: string[] | undefined;
1407
+ must_read_if?: string | undefined;
1408
+ maturity?: "draft" | "verified" | "proven" | undefined;
1409
+ tags?: string[] | undefined;
1410
+ related?: string[] | undefined;
1411
+ title?: string | undefined;
1412
+ }>;
1413
+ }, "strip", z.ZodTypeAny, {
1414
+ pending_path: string;
1415
+ changes: {
1416
+ semantic_scope?: string | undefined;
1417
+ relevance_scope?: "narrow" | "broad" | undefined;
1418
+ relevance_paths?: string[] | undefined;
1419
+ layer?: "personal" | "team" | undefined;
1420
+ summary?: string | undefined;
1421
+ intent_clues?: string[] | undefined;
1422
+ impact?: string[] | undefined;
1423
+ must_read_if?: string | undefined;
1424
+ maturity?: "draft" | "verified" | "proven" | undefined;
1425
+ tags?: string[] | undefined;
1426
+ related?: string[] | undefined;
1427
+ title?: string | undefined;
1428
+ };
1429
+ }, {
1430
+ pending_path: string;
1431
+ changes: {
1432
+ semantic_scope?: string | undefined;
1433
+ relevance_scope?: "narrow" | "broad" | undefined;
1434
+ relevance_paths?: string[] | undefined;
1435
+ layer?: "personal" | "team" | undefined;
1436
+ summary?: string | undefined;
1437
+ intent_clues?: string[] | undefined;
1438
+ impact?: string[] | undefined;
1439
+ must_read_if?: string | undefined;
1440
+ maturity?: "draft" | "verified" | "proven" | undefined;
1441
+ tags?: string[] | undefined;
1442
+ related?: string[] | undefined;
1443
+ title?: string | undefined;
1444
+ };
1445
+ }>, "many">;
1446
+ }, "strip", z.ZodTypeAny, {
1447
+ action: "modify-content-batch";
1448
+ items: {
1449
+ pending_path: string;
1450
+ changes: {
1451
+ semantic_scope?: string | undefined;
1452
+ relevance_scope?: "narrow" | "broad" | undefined;
1453
+ relevance_paths?: string[] | undefined;
1454
+ layer?: "personal" | "team" | undefined;
1455
+ summary?: string | undefined;
1456
+ intent_clues?: string[] | undefined;
1457
+ impact?: string[] | undefined;
1458
+ must_read_if?: string | undefined;
1459
+ maturity?: "draft" | "verified" | "proven" | undefined;
1460
+ tags?: string[] | undefined;
1461
+ related?: string[] | undefined;
1462
+ title?: string | undefined;
1463
+ };
1464
+ }[];
1465
+ }, {
1466
+ action: "modify-content-batch";
1467
+ items: {
1468
+ pending_path: string;
1469
+ changes: {
1470
+ semantic_scope?: string | undefined;
1471
+ relevance_scope?: "narrow" | "broad" | undefined;
1472
+ relevance_paths?: string[] | undefined;
1473
+ layer?: "personal" | "team" | undefined;
1474
+ summary?: string | undefined;
1475
+ intent_clues?: string[] | undefined;
1476
+ impact?: string[] | undefined;
1477
+ must_read_if?: string | undefined;
1478
+ maturity?: "draft" | "verified" | "proven" | undefined;
1479
+ tags?: string[] | undefined;
1480
+ related?: string[] | undefined;
1481
+ title?: string | undefined;
1482
+ };
1483
+ }[];
1466
1484
  }>, z.ZodObject<{
1467
1485
  action: z.ZodLiteral<"defer">;
1468
1486
  pending_paths: z.ZodArray<z.ZodString, "many">;
@@ -1478,6 +1496,21 @@ declare const FabReviewInputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObje
1478
1496
  pending_paths: string[];
1479
1497
  reason?: string | undefined;
1480
1498
  until?: string | undefined;
1499
+ }>, z.ZodObject<{
1500
+ action: z.ZodLiteral<"retire">;
1501
+ pending_paths: z.ZodArray<z.ZodString, "many">;
1502
+ superseded_by: z.ZodOptional<z.ZodString>;
1503
+ reason: z.ZodOptional<z.ZodString>;
1504
+ }, "strip", z.ZodTypeAny, {
1505
+ action: "retire";
1506
+ pending_paths: string[];
1507
+ reason?: string | undefined;
1508
+ superseded_by?: string | undefined;
1509
+ }, {
1510
+ action: "retire";
1511
+ pending_paths: string[];
1512
+ reason?: string | undefined;
1513
+ superseded_by?: string | undefined;
1481
1514
  }>]>;
1482
1515
  type FabReviewInput = z.infer<typeof FabReviewInputSchema>;
1483
1516
  declare const FabPendingInputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
@@ -1626,7 +1659,7 @@ declare const FabPendingInputShape: {
1626
1659
  readonly query: z.ZodOptional<z.ZodString>;
1627
1660
  };
1628
1661
  declare const FabReviewInputShape: {
1629
- readonly action: z.ZodEnum<["approve", "reject", "modify", "modify-content", "modify-layer", "defer"]>;
1662
+ readonly action: z.ZodEnum<["approve", "reject", "modify", "modify-content", "modify-layer", "modify-content-batch", "defer", "retire"]>;
1630
1663
  readonly pending_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1631
1664
  readonly pending_path: z.ZodOptional<z.ZodString>;
1632
1665
  readonly reason: z.ZodOptional<z.ZodString>;
@@ -1670,7 +1703,83 @@ declare const FabReviewInputShape: {
1670
1703
  related?: string[] | undefined;
1671
1704
  title?: string | undefined;
1672
1705
  }>>;
1706
+ readonly items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1707
+ pending_path: z.ZodString;
1708
+ changes: z.ZodObject<{
1709
+ title: z.ZodOptional<z.ZodString>;
1710
+ summary: z.ZodOptional<z.ZodString>;
1711
+ layer: z.ZodOptional<z.ZodEnum<["team", "personal"]>>;
1712
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
1713
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1714
+ relevance_scope: z.ZodOptional<z.ZodEnum<["narrow", "broad"]>>;
1715
+ relevance_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1716
+ semantic_scope: z.ZodOptional<z.ZodString>;
1717
+ related: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1718
+ must_read_if: z.ZodOptional<z.ZodString>;
1719
+ intent_clues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1720
+ impact: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1721
+ }, "strip", z.ZodTypeAny, {
1722
+ semantic_scope?: string | undefined;
1723
+ relevance_scope?: "narrow" | "broad" | undefined;
1724
+ relevance_paths?: string[] | undefined;
1725
+ layer?: "personal" | "team" | undefined;
1726
+ summary?: string | undefined;
1727
+ intent_clues?: string[] | undefined;
1728
+ impact?: string[] | undefined;
1729
+ must_read_if?: string | undefined;
1730
+ maturity?: "draft" | "verified" | "proven" | undefined;
1731
+ tags?: string[] | undefined;
1732
+ related?: string[] | undefined;
1733
+ title?: string | undefined;
1734
+ }, {
1735
+ semantic_scope?: string | undefined;
1736
+ relevance_scope?: "narrow" | "broad" | undefined;
1737
+ relevance_paths?: string[] | undefined;
1738
+ layer?: "personal" | "team" | undefined;
1739
+ summary?: string | undefined;
1740
+ intent_clues?: string[] | undefined;
1741
+ impact?: string[] | undefined;
1742
+ must_read_if?: string | undefined;
1743
+ maturity?: "draft" | "verified" | "proven" | undefined;
1744
+ tags?: string[] | undefined;
1745
+ related?: string[] | undefined;
1746
+ title?: string | undefined;
1747
+ }>;
1748
+ }, "strip", z.ZodTypeAny, {
1749
+ pending_path: string;
1750
+ changes: {
1751
+ semantic_scope?: string | undefined;
1752
+ relevance_scope?: "narrow" | "broad" | undefined;
1753
+ relevance_paths?: string[] | undefined;
1754
+ layer?: "personal" | "team" | undefined;
1755
+ summary?: string | undefined;
1756
+ intent_clues?: string[] | undefined;
1757
+ impact?: string[] | undefined;
1758
+ must_read_if?: string | undefined;
1759
+ maturity?: "draft" | "verified" | "proven" | undefined;
1760
+ tags?: string[] | undefined;
1761
+ related?: string[] | undefined;
1762
+ title?: string | undefined;
1763
+ };
1764
+ }, {
1765
+ pending_path: string;
1766
+ changes: {
1767
+ semantic_scope?: string | undefined;
1768
+ relevance_scope?: "narrow" | "broad" | undefined;
1769
+ relevance_paths?: string[] | undefined;
1770
+ layer?: "personal" | "team" | undefined;
1771
+ summary?: string | undefined;
1772
+ intent_clues?: string[] | undefined;
1773
+ impact?: string[] | undefined;
1774
+ must_read_if?: string | undefined;
1775
+ maturity?: "draft" | "verified" | "proven" | undefined;
1776
+ tags?: string[] | undefined;
1777
+ related?: string[] | undefined;
1778
+ title?: string | undefined;
1779
+ };
1780
+ }>, "many">>;
1673
1781
  readonly until: z.ZodOptional<z.ZodString>;
1782
+ readonly superseded_by: z.ZodOptional<z.ZodString>;
1674
1783
  };
1675
1784
  declare const FabReviewOutputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
1676
1785
  action: z.ZodLiteral<"approve">;
@@ -1819,6 +1928,68 @@ declare const FabReviewOutputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObj
1819
1928
  }[] | undefined;
1820
1929
  prior_stable_id?: string | undefined;
1821
1930
  new_stable_id?: string | undefined;
1931
+ }>, z.ZodObject<{
1932
+ action: z.ZodLiteral<"modify-content-batch">;
1933
+ modified: z.ZodArray<z.ZodObject<{
1934
+ pending_path: z.ZodString;
1935
+ ok: z.ZodBoolean;
1936
+ error: z.ZodOptional<z.ZodString>;
1937
+ }, "strip", z.ZodTypeAny, {
1938
+ ok: boolean;
1939
+ pending_path: string;
1940
+ error?: string | undefined;
1941
+ }, {
1942
+ ok: boolean;
1943
+ pending_path: string;
1944
+ error?: string | undefined;
1945
+ }>, "many">;
1946
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1947
+ code: z.ZodString;
1948
+ file: z.ZodString;
1949
+ line: z.ZodOptional<z.ZodNumber>;
1950
+ message: z.ZodOptional<z.ZodString>;
1951
+ action_hint: z.ZodString;
1952
+ }, "strip", z.ZodTypeAny, {
1953
+ code: string;
1954
+ file: string;
1955
+ action_hint: string;
1956
+ message?: string | undefined;
1957
+ line?: number | undefined;
1958
+ }, {
1959
+ code: string;
1960
+ file: string;
1961
+ action_hint: string;
1962
+ message?: string | undefined;
1963
+ line?: number | undefined;
1964
+ }>, "many">>;
1965
+ }, "strip", z.ZodTypeAny, {
1966
+ action: "modify-content-batch";
1967
+ modified: {
1968
+ ok: boolean;
1969
+ pending_path: string;
1970
+ error?: string | undefined;
1971
+ }[];
1972
+ warnings?: {
1973
+ code: string;
1974
+ file: string;
1975
+ action_hint: string;
1976
+ message?: string | undefined;
1977
+ line?: number | undefined;
1978
+ }[] | undefined;
1979
+ }, {
1980
+ action: "modify-content-batch";
1981
+ modified: {
1982
+ ok: boolean;
1983
+ pending_path: string;
1984
+ error?: string | undefined;
1985
+ }[];
1986
+ warnings?: {
1987
+ code: string;
1988
+ file: string;
1989
+ action_hint: string;
1990
+ message?: string | undefined;
1991
+ line?: number | undefined;
1992
+ }[] | undefined;
1822
1993
  }>, z.ZodObject<{
1823
1994
  action: z.ZodLiteral<"defer">;
1824
1995
  deferred: z.ZodArray<z.ZodString, "many">;
@@ -1861,6 +2032,68 @@ declare const FabReviewOutputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObj
1861
2032
  message?: string | undefined;
1862
2033
  line?: number | undefined;
1863
2034
  }[] | undefined;
2035
+ }>, z.ZodObject<{
2036
+ action: z.ZodLiteral<"retire">;
2037
+ retired: z.ZodArray<z.ZodObject<{
2038
+ path: z.ZodString;
2039
+ stable_id: z.ZodOptional<z.ZodString>;
2040
+ superseded_by: z.ZodOptional<z.ZodString>;
2041
+ }, "strip", z.ZodTypeAny, {
2042
+ path: string;
2043
+ stable_id?: string | undefined;
2044
+ superseded_by?: string | undefined;
2045
+ }, {
2046
+ path: string;
2047
+ stable_id?: string | undefined;
2048
+ superseded_by?: string | undefined;
2049
+ }>, "many">;
2050
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
2051
+ code: z.ZodString;
2052
+ file: z.ZodString;
2053
+ line: z.ZodOptional<z.ZodNumber>;
2054
+ message: z.ZodOptional<z.ZodString>;
2055
+ action_hint: z.ZodString;
2056
+ }, "strip", z.ZodTypeAny, {
2057
+ code: string;
2058
+ file: string;
2059
+ action_hint: string;
2060
+ message?: string | undefined;
2061
+ line?: number | undefined;
2062
+ }, {
2063
+ code: string;
2064
+ file: string;
2065
+ action_hint: string;
2066
+ message?: string | undefined;
2067
+ line?: number | undefined;
2068
+ }>, "many">>;
2069
+ }, "strip", z.ZodTypeAny, {
2070
+ action: "retire";
2071
+ retired: {
2072
+ path: string;
2073
+ stable_id?: string | undefined;
2074
+ superseded_by?: string | undefined;
2075
+ }[];
2076
+ warnings?: {
2077
+ code: string;
2078
+ file: string;
2079
+ action_hint: string;
2080
+ message?: string | undefined;
2081
+ line?: number | undefined;
2082
+ }[] | undefined;
2083
+ }, {
2084
+ action: "retire";
2085
+ retired: {
2086
+ path: string;
2087
+ stable_id?: string | undefined;
2088
+ superseded_by?: string | undefined;
2089
+ }[];
2090
+ warnings?: {
2091
+ code: string;
2092
+ file: string;
2093
+ action_hint: string;
2094
+ message?: string | undefined;
2095
+ line?: number | undefined;
2096
+ }[] | undefined;
1864
2097
  }>]>;
1865
2098
  type FabReviewOutput = z.infer<typeof FabReviewOutputSchema>;
1866
2099
  declare const FabPendingOutputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
@@ -2197,7 +2430,7 @@ declare const FabPendingOutputShape: {
2197
2430
  }>, "many">>;
2198
2431
  };
2199
2432
  declare const FabReviewOutputShape: {
2200
- readonly action: z.ZodEnum<["approve", "reject", "modify", "defer"]>;
2433
+ readonly action: z.ZodEnum<["approve", "reject", "modify", "modify-content-batch", "defer", "retire"]>;
2201
2434
  readonly approved: z.ZodOptional<z.ZodArray<z.ZodObject<{
2202
2435
  pending_path: z.ZodString;
2203
2436
  stable_id: z.ZodString;
@@ -2212,7 +2445,33 @@ declare const FabReviewOutputShape: {
2212
2445
  readonly pending_path: z.ZodOptional<z.ZodString>;
2213
2446
  readonly prior_stable_id: z.ZodOptional<z.ZodString>;
2214
2447
  readonly new_stable_id: z.ZodOptional<z.ZodString>;
2448
+ readonly modified: z.ZodOptional<z.ZodArray<z.ZodObject<{
2449
+ pending_path: z.ZodString;
2450
+ ok: z.ZodBoolean;
2451
+ error: z.ZodOptional<z.ZodString>;
2452
+ }, "strip", z.ZodTypeAny, {
2453
+ ok: boolean;
2454
+ pending_path: string;
2455
+ error?: string | undefined;
2456
+ }, {
2457
+ ok: boolean;
2458
+ pending_path: string;
2459
+ error?: string | undefined;
2460
+ }>, "many">>;
2215
2461
  readonly deferred: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2462
+ readonly retired: z.ZodOptional<z.ZodArray<z.ZodObject<{
2463
+ path: z.ZodString;
2464
+ stable_id: z.ZodOptional<z.ZodString>;
2465
+ superseded_by: z.ZodOptional<z.ZodString>;
2466
+ }, "strip", z.ZodTypeAny, {
2467
+ path: string;
2468
+ stable_id?: string | undefined;
2469
+ superseded_by?: string | undefined;
2470
+ }, {
2471
+ path: string;
2472
+ stable_id?: string | undefined;
2473
+ superseded_by?: string | undefined;
2474
+ }>, "many">>;
2216
2475
  readonly warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
2217
2476
  code: z.ZodString;
2218
2477
  file: z.ZodString;
@@ -47,7 +47,7 @@ import {
47
47
  recallInputSchema,
48
48
  recallOutputSchema,
49
49
  structuredWarningSchema
50
- } from "../chunk-TV264D7E.js";
50
+ } from "../chunk-TEITGZY3.js";
51
51
  export {
52
52
  FabExtractKnowledgeInputSchema,
53
53
  FabExtractKnowledgeInputShape,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fenglimg/fabric-shared",
3
- "version": "2.3.0-rc.10",
3
+ "version": "2.3.0-rc.12",
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>",