@fenglimg/fabric-shared 2.1.0-rc.2 → 2.2.0-rc.3

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/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { A as AgentsMetaNode, a as AgentsIdentitySource, b as AgentsLayer, c as AgentsTopologyType, H as HumanLockEntry, f as fabricConfigSchema, d as AgentsMeta, L as LedgerEntry } from './index-GQpaWTm-.js';
2
- export { e as AgentsActivationTier, g as AgentsMetaCountersEnvelope, h as AgentsMetaKnowledgeTypeCounters, i as AgentsMetaNodeActivation, j as AiLedgerEntry, k as AuditMode, C as ClientPaths, D as DefaultLayerFilter, F as FabricConfig, l as FabricLanguage, m as HumanLedgerEntry, M as McpPayloadLimits, R as RuleDescription, n as RuleDescriptionIndexItem, o as auditModeSchema, p as clientPathsSchema, q as defaultLayerFilterSchema, r as fabricLanguageSchema, s as mcpPayloadLimitsSchema, t as selectionTokenTtlMsSchema } from './index-GQpaWTm-.js';
3
- export { Locale, Messages, PROTECTED_TOKENS, ProtectedToken, TranslationKey, Translator, createTranslator, defaultMessages, detectNodeLocale, enMessages, normalizeLocale, resolveFabricLocale, zhCNMessages } from './i18n/index.js';
1
+ import { A as AgentsMetaNode, a as AgentsIdentitySource, b as AgentsLayer, c as AgentsTopologyType, H as HumanLockEntry, f as fabricConfigSchema, F as FabricConfig, d as AgentsMeta, L as LedgerEntry } from './index-Dm4IJWwB.js';
2
+ export { e as AgentsActivationTier, g as AgentsMetaCountersEnvelope, h as AgentsMetaKnowledgeTypeCounters, i as AgentsMetaNodeActivation, j as AiLedgerEntry, k as AuditMode, C as ClientPaths, D as DefaultLayerFilter, l as FabricLanguage, m as HumanLedgerEntry, M as McpPayloadLimits, R as RuleDescription, n as RuleDescriptionIndexItem, o as auditModeSchema, p as clientPathsSchema, q as defaultLayerFilterSchema, r as fabricLanguageSchema, s as mcpPayloadLimitsSchema, t as planContextTopKSchema, u as selectionTokenTtlMsSchema } from './index-Dm4IJWwB.js';
3
+ import { Translator } from './i18n/index.js';
4
+ export { Locale, Messages, PROTECTED_TOKENS, ProtectedToken, TranslationKey, createTranslator, defaultMessages, detectNodeLocale, enMessages, normalizeLocale, resolveFabricLocale, zhCNMessages } from './i18n/index.js';
4
5
  import { z } from 'zod';
5
6
  import { Layer, KnowledgeType, StableId } from './schemas/api-contracts.js';
6
7
  export { ArchiveScanInput, ArchiveScanOutput, CiteContractMetrics, CiteCoverageReport, CiteLayerTypeBreakdown, FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, FabReviewInput, FabReviewInputSchema, FabReviewInputShape, FabReviewOutput, FabReviewOutputSchema, FabReviewOutputShape, KNOWLEDGE_TYPE_CODES, KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, KnowledgeTypeCode, KnowledgeTypeSchema, LayerSchema, Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, ProposedReason, ProposedReasonSchema, StableIdSchema, annotateIntentRequestSchema, archiveScanAnnotations, archiveScanInputSchema, archiveScanOutputSchema, citeContractMetricsSchema, citeCoverageReportSchema, citeLayerTypeBreakdownSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, recallAnnotations, recallInputSchema, recallOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
@@ -34,6 +35,7 @@ declare const ruleDescriptionSchema: z.ZodObject<{
34
35
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
35
36
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
36
37
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
38
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
37
39
  }, "strict", z.ZodTypeAny, {
38
40
  relevance_scope: "narrow" | "broad";
39
41
  relevance_paths: string[];
@@ -50,6 +52,7 @@ declare const ruleDescriptionSchema: z.ZodObject<{
50
52
  knowledge_layer?: "personal" | "team" | undefined;
51
53
  layer_reason?: string | undefined;
52
54
  tags?: string[] | undefined;
55
+ related?: string[] | undefined;
53
56
  }, {
54
57
  summary: string;
55
58
  intent_clues: string[];
@@ -66,6 +69,7 @@ declare const ruleDescriptionSchema: z.ZodObject<{
66
69
  knowledge_layer?: "personal" | "team" | undefined;
67
70
  layer_reason?: string | undefined;
68
71
  tags?: string[] | undefined;
72
+ related?: string[] | undefined;
69
73
  }>;
70
74
  declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
71
75
  stable_id: z.ZodString;
@@ -88,6 +92,7 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
88
92
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
89
93
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
90
94
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
95
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
91
96
  }, "strict", z.ZodTypeAny, {
92
97
  relevance_scope: "narrow" | "broad";
93
98
  relevance_paths: string[];
@@ -104,6 +109,7 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
104
109
  knowledge_layer?: "personal" | "team" | undefined;
105
110
  layer_reason?: string | undefined;
106
111
  tags?: string[] | undefined;
112
+ related?: string[] | undefined;
107
113
  }, {
108
114
  summary: string;
109
115
  intent_clues: string[];
@@ -120,6 +126,7 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
120
126
  knowledge_layer?: "personal" | "team" | undefined;
121
127
  layer_reason?: string | undefined;
122
128
  tags?: string[] | undefined;
129
+ related?: string[] | undefined;
123
130
  }>;
124
131
  }, "strict", z.ZodTypeAny, {
125
132
  description: {
@@ -138,6 +145,7 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
138
145
  knowledge_layer?: "personal" | "team" | undefined;
139
146
  layer_reason?: string | undefined;
140
147
  tags?: string[] | undefined;
148
+ related?: string[] | undefined;
141
149
  };
142
150
  stable_id: string;
143
151
  level: "L0" | "L1" | "L2";
@@ -160,6 +168,7 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
160
168
  knowledge_layer?: "personal" | "team" | undefined;
161
169
  layer_reason?: string | undefined;
162
170
  tags?: string[] | undefined;
171
+ related?: string[] | undefined;
163
172
  };
164
173
  stable_id: string;
165
174
  level: "L0" | "L1" | "L2";
@@ -199,6 +208,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
199
208
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
200
209
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
201
210
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
211
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
202
212
  }, "strict", z.ZodTypeAny, {
203
213
  relevance_scope: "narrow" | "broad";
204
214
  relevance_paths: string[];
@@ -215,6 +225,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
215
225
  knowledge_layer?: "personal" | "team" | undefined;
216
226
  layer_reason?: string | undefined;
217
227
  tags?: string[] | undefined;
228
+ related?: string[] | undefined;
218
229
  }, {
219
230
  summary: string;
220
231
  intent_clues: string[];
@@ -231,6 +242,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
231
242
  knowledge_layer?: "personal" | "team" | undefined;
232
243
  layer_reason?: string | undefined;
233
244
  tags?: string[] | undefined;
245
+ related?: string[] | undefined;
234
246
  }>>;
235
247
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
236
248
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -266,6 +278,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
266
278
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
267
279
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
268
280
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
281
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
269
282
  }, "strict", z.ZodTypeAny, {
270
283
  relevance_scope: "narrow" | "broad";
271
284
  relevance_paths: string[];
@@ -282,6 +295,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
282
295
  knowledge_layer?: "personal" | "team" | undefined;
283
296
  layer_reason?: string | undefined;
284
297
  tags?: string[] | undefined;
298
+ related?: string[] | undefined;
285
299
  }, {
286
300
  summary: string;
287
301
  intent_clues: string[];
@@ -298,6 +312,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
298
312
  knowledge_layer?: "personal" | "team" | undefined;
299
313
  layer_reason?: string | undefined;
300
314
  tags?: string[] | undefined;
315
+ related?: string[] | undefined;
301
316
  }>>;
302
317
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
303
318
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -333,6 +348,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
333
348
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
334
349
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
335
350
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
351
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
336
352
  }, "strict", z.ZodTypeAny, {
337
353
  relevance_scope: "narrow" | "broad";
338
354
  relevance_paths: string[];
@@ -349,6 +365,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
349
365
  knowledge_layer?: "personal" | "team" | undefined;
350
366
  layer_reason?: string | undefined;
351
367
  tags?: string[] | undefined;
368
+ related?: string[] | undefined;
352
369
  }, {
353
370
  summary: string;
354
371
  intent_clues: string[];
@@ -365,6 +382,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
365
382
  knowledge_layer?: "personal" | "team" | undefined;
366
383
  layer_reason?: string | undefined;
367
384
  tags?: string[] | undefined;
385
+ related?: string[] | undefined;
368
386
  }>>;
369
387
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
370
388
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
@@ -400,6 +418,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
400
418
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
401
419
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
402
420
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
421
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
403
422
  }, "strict", z.ZodTypeAny, {
404
423
  relevance_scope: "narrow" | "broad";
405
424
  relevance_paths: string[];
@@ -416,6 +435,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
416
435
  knowledge_layer?: "personal" | "team" | undefined;
417
436
  layer_reason?: string | undefined;
418
437
  tags?: string[] | undefined;
438
+ related?: string[] | undefined;
419
439
  }, {
420
440
  summary: string;
421
441
  intent_clues: string[];
@@ -432,6 +452,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
432
452
  knowledge_layer?: "personal" | "team" | undefined;
433
453
  layer_reason?: string | undefined;
434
454
  tags?: string[] | undefined;
455
+ related?: string[] | undefined;
435
456
  }>>;
436
457
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
437
458
  }, z.ZodTypeAny, "passthrough">, unknown>;
@@ -541,6 +562,7 @@ declare const agentsMetaSchema: z.ZodObject<{
541
562
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
542
563
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
543
564
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
565
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
544
566
  }, "strict", z.ZodTypeAny, {
545
567
  relevance_scope: "narrow" | "broad";
546
568
  relevance_paths: string[];
@@ -557,6 +579,7 @@ declare const agentsMetaSchema: z.ZodObject<{
557
579
  knowledge_layer?: "personal" | "team" | undefined;
558
580
  layer_reason?: string | undefined;
559
581
  tags?: string[] | undefined;
582
+ related?: string[] | undefined;
560
583
  }, {
561
584
  summary: string;
562
585
  intent_clues: string[];
@@ -573,6 +596,7 @@ declare const agentsMetaSchema: z.ZodObject<{
573
596
  knowledge_layer?: "personal" | "team" | undefined;
574
597
  layer_reason?: string | undefined;
575
598
  tags?: string[] | undefined;
599
+ related?: string[] | undefined;
576
600
  }>>;
577
601
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
578
602
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -608,6 +632,7 @@ declare const agentsMetaSchema: z.ZodObject<{
608
632
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
609
633
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
610
634
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
635
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
611
636
  }, "strict", z.ZodTypeAny, {
612
637
  relevance_scope: "narrow" | "broad";
613
638
  relevance_paths: string[];
@@ -624,6 +649,7 @@ declare const agentsMetaSchema: z.ZodObject<{
624
649
  knowledge_layer?: "personal" | "team" | undefined;
625
650
  layer_reason?: string | undefined;
626
651
  tags?: string[] | undefined;
652
+ related?: string[] | undefined;
627
653
  }, {
628
654
  summary: string;
629
655
  intent_clues: string[];
@@ -640,6 +666,7 @@ declare const agentsMetaSchema: z.ZodObject<{
640
666
  knowledge_layer?: "personal" | "team" | undefined;
641
667
  layer_reason?: string | undefined;
642
668
  tags?: string[] | undefined;
669
+ related?: string[] | undefined;
643
670
  }>>;
644
671
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
645
672
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -675,6 +702,7 @@ declare const agentsMetaSchema: z.ZodObject<{
675
702
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
676
703
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
677
704
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
705
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
678
706
  }, "strict", z.ZodTypeAny, {
679
707
  relevance_scope: "narrow" | "broad";
680
708
  relevance_paths: string[];
@@ -691,6 +719,7 @@ declare const agentsMetaSchema: z.ZodObject<{
691
719
  knowledge_layer?: "personal" | "team" | undefined;
692
720
  layer_reason?: string | undefined;
693
721
  tags?: string[] | undefined;
722
+ related?: string[] | undefined;
694
723
  }, {
695
724
  summary: string;
696
725
  intent_clues: string[];
@@ -707,6 +736,7 @@ declare const agentsMetaSchema: z.ZodObject<{
707
736
  knowledge_layer?: "personal" | "team" | undefined;
708
737
  layer_reason?: string | undefined;
709
738
  tags?: string[] | undefined;
739
+ related?: string[] | undefined;
710
740
  }>>;
711
741
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
712
742
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
@@ -742,6 +772,7 @@ declare const agentsMetaSchema: z.ZodObject<{
742
772
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
743
773
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
744
774
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
775
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
745
776
  }, "strict", z.ZodTypeAny, {
746
777
  relevance_scope: "narrow" | "broad";
747
778
  relevance_paths: string[];
@@ -758,6 +789,7 @@ declare const agentsMetaSchema: z.ZodObject<{
758
789
  knowledge_layer?: "personal" | "team" | undefined;
759
790
  layer_reason?: string | undefined;
760
791
  tags?: string[] | undefined;
792
+ related?: string[] | undefined;
761
793
  }, {
762
794
  summary: string;
763
795
  intent_clues: string[];
@@ -774,6 +806,7 @@ declare const agentsMetaSchema: z.ZodObject<{
774
806
  knowledge_layer?: "personal" | "team" | undefined;
775
807
  layer_reason?: string | undefined;
776
808
  tags?: string[] | undefined;
809
+ related?: string[] | undefined;
777
810
  }>>;
778
811
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
779
812
  }, z.ZodTypeAny, "passthrough">, unknown>>;
@@ -882,6 +915,7 @@ declare const agentsMetaSchema: z.ZodObject<{
882
915
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
883
916
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
884
917
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
918
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
885
919
  }, "strict", z.ZodTypeAny, {
886
920
  relevance_scope: "narrow" | "broad";
887
921
  relevance_paths: string[];
@@ -898,6 +932,7 @@ declare const agentsMetaSchema: z.ZodObject<{
898
932
  knowledge_layer?: "personal" | "team" | undefined;
899
933
  layer_reason?: string | undefined;
900
934
  tags?: string[] | undefined;
935
+ related?: string[] | undefined;
901
936
  }, {
902
937
  summary: string;
903
938
  intent_clues: string[];
@@ -914,6 +949,7 @@ declare const agentsMetaSchema: z.ZodObject<{
914
949
  knowledge_layer?: "personal" | "team" | undefined;
915
950
  layer_reason?: string | undefined;
916
951
  tags?: string[] | undefined;
952
+ related?: string[] | undefined;
917
953
  }>>;
918
954
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
919
955
  }, z.ZodTypeAny, "passthrough">>;
@@ -2955,7 +2991,11 @@ declare function createStoreResolver(): StoreResolver;
2955
2991
 
2956
2992
  declare function readStoreIdentity(absDir: string): StoreIdentity | null;
2957
2993
  declare function recognizeStoreDir(absDir: string): boolean;
2958
- declare function findStoreExecutableViolations(absDir: string): string[];
2994
+ type FindStoreExecutableViolationsOptions = {
2995
+ maxDepth?: number;
2996
+ maxEntries?: number;
2997
+ };
2998
+ declare function findStoreExecutableViolations(absDir: string, options?: FindStoreExecutableViolationsOptions): string[];
2959
2999
 
2960
3000
  interface QualifiedCandidate {
2961
3001
  store_uuid: string;
@@ -3016,6 +3056,17 @@ declare function listStoreKnowledge(store: MountedStoreDir): StoreKnowledgeRef[]
3016
3056
  declare function readKnowledgeAcrossStores(stores: MountedStoreDir[]): StoreKnowledgeRef[];
3017
3057
  declare function aggregatePendingAcrossStores(stores: MountedStoreDir[]): StoreKnowledgeRef[];
3018
3058
 
3059
+ declare function resolveGlobalRoot(): string;
3060
+ declare function globalConfigPath(globalRoot?: string): string;
3061
+ declare function loadGlobalConfig(globalRoot?: string): GlobalConfig | null;
3062
+ declare function saveGlobalConfig(config: GlobalConfig, globalRoot?: string): void;
3063
+
3064
+ declare function projectConfigPath(projectRoot: string): string;
3065
+ declare function loadProjectConfig(projectRoot: string): FabricConfig | null;
3066
+ declare function saveProjectConfig(config: FabricConfig, projectRoot: string): void;
3067
+
3068
+ declare function buildStoreResolveInput(projectRoot: string, globalRoot?: string): StoreResolveInput | null;
3069
+
3019
3070
  interface SecretFinding {
3020
3071
  rule: string;
3021
3072
  line: number;
@@ -3024,6 +3075,16 @@ declare function scanForSecrets(content: string): SecretFinding[];
3024
3075
  declare function hasSecrets(content: string): boolean;
3025
3076
  declare const REDACTION_PLACEHOLDER_PREFIX = "[REDACTED:";
3026
3077
  declare function redactSecrets(content: string): string;
3078
+ declare function scrubRemoteUrl(remote: string): string;
3079
+
3080
+ type ScanRecommendationInput = {
3081
+ frameworkKind: string;
3082
+ hasMeta?: boolean;
3083
+ readmeOk?: boolean;
3084
+ hasContributing?: boolean;
3085
+ hasExistingFabric?: boolean;
3086
+ };
3087
+ declare function buildScanRecommendations(input: ScanRecommendationInput, t: Translator): string[];
3027
3088
 
3028
3089
  type StoreVisibility = "shared" | "personal";
3029
3090
  interface CrossStoreRefViolation {
@@ -3517,13 +3578,13 @@ declare const forensicFrameworkSchema: z.ZodObject<{
3517
3578
  evidence: z.ZodArray<z.ZodString, "many">;
3518
3579
  }, "strip", z.ZodTypeAny, {
3519
3580
  version: string;
3520
- evidence: string[];
3521
3581
  kind: string;
3582
+ evidence: string[];
3522
3583
  subkind: string;
3523
3584
  }, {
3524
3585
  version: string;
3525
- evidence: string[];
3526
3586
  kind: string;
3587
+ evidence: string[];
3527
3588
  subkind: string;
3528
3589
  }>;
3529
3590
  declare const forensicReadmeSchema: z.ZodObject<{
@@ -3575,13 +3636,13 @@ declare const forensicReportSchema: z.ZodObject<{
3575
3636
  evidence: z.ZodArray<z.ZodString, "many">;
3576
3637
  }, "strip", z.ZodTypeAny, {
3577
3638
  version: string;
3578
- evidence: string[];
3579
3639
  kind: string;
3640
+ evidence: string[];
3580
3641
  subkind: string;
3581
3642
  }, {
3582
3643
  version: string;
3583
- evidence: string[];
3584
3644
  kind: string;
3645
+ evidence: string[];
3585
3646
  subkind: string;
3586
3647
  }>;
3587
3648
  topology: z.ZodObject<{
@@ -3742,8 +3803,8 @@ declare const forensicReportSchema: z.ZodObject<{
3742
3803
  target: string;
3743
3804
  framework: {
3744
3805
  version: string;
3745
- evidence: string[];
3746
3806
  kind: string;
3807
+ evidence: string[];
3747
3808
  subkind: string;
3748
3809
  };
3749
3810
  generated_by: string;
@@ -3804,8 +3865,8 @@ declare const forensicReportSchema: z.ZodObject<{
3804
3865
  target: string;
3805
3866
  framework: {
3806
3867
  version: string;
3807
- evidence: string[];
3808
3868
  kind: string;
3869
+ evidence: string[];
3809
3870
  subkind: string;
3810
3871
  };
3811
3872
  generated_by: string;
@@ -4263,6 +4324,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4263
4324
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4264
4325
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4265
4326
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4327
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4266
4328
  }, "strict", z.ZodTypeAny, {
4267
4329
  relevance_scope: "narrow" | "broad";
4268
4330
  relevance_paths: string[];
@@ -4279,6 +4341,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4279
4341
  knowledge_layer?: "personal" | "team" | undefined;
4280
4342
  layer_reason?: string | undefined;
4281
4343
  tags?: string[] | undefined;
4344
+ related?: string[] | undefined;
4282
4345
  }, {
4283
4346
  summary: string;
4284
4347
  intent_clues: string[];
@@ -4295,6 +4358,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4295
4358
  knowledge_layer?: "personal" | "team" | undefined;
4296
4359
  layer_reason?: string | undefined;
4297
4360
  tags?: string[] | undefined;
4361
+ related?: string[] | undefined;
4298
4362
  }>>;
4299
4363
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4300
4364
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -4330,6 +4394,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4330
4394
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4331
4395
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4332
4396
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4397
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4333
4398
  }, "strict", z.ZodTypeAny, {
4334
4399
  relevance_scope: "narrow" | "broad";
4335
4400
  relevance_paths: string[];
@@ -4346,6 +4411,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4346
4411
  knowledge_layer?: "personal" | "team" | undefined;
4347
4412
  layer_reason?: string | undefined;
4348
4413
  tags?: string[] | undefined;
4414
+ related?: string[] | undefined;
4349
4415
  }, {
4350
4416
  summary: string;
4351
4417
  intent_clues: string[];
@@ -4362,6 +4428,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4362
4428
  knowledge_layer?: "personal" | "team" | undefined;
4363
4429
  layer_reason?: string | undefined;
4364
4430
  tags?: string[] | undefined;
4431
+ related?: string[] | undefined;
4365
4432
  }>>;
4366
4433
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4367
4434
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -4397,6 +4464,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4397
4464
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4398
4465
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4399
4466
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4467
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4400
4468
  }, "strict", z.ZodTypeAny, {
4401
4469
  relevance_scope: "narrow" | "broad";
4402
4470
  relevance_paths: string[];
@@ -4413,6 +4481,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4413
4481
  knowledge_layer?: "personal" | "team" | undefined;
4414
4482
  layer_reason?: string | undefined;
4415
4483
  tags?: string[] | undefined;
4484
+ related?: string[] | undefined;
4416
4485
  }, {
4417
4486
  summary: string;
4418
4487
  intent_clues: string[];
@@ -4429,6 +4498,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4429
4498
  knowledge_layer?: "personal" | "team" | undefined;
4430
4499
  layer_reason?: string | undefined;
4431
4500
  tags?: string[] | undefined;
4501
+ related?: string[] | undefined;
4432
4502
  }>>;
4433
4503
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4434
4504
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
@@ -4464,6 +4534,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4464
4534
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4465
4535
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4466
4536
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4537
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4467
4538
  }, "strict", z.ZodTypeAny, {
4468
4539
  relevance_scope: "narrow" | "broad";
4469
4540
  relevance_paths: string[];
@@ -4480,6 +4551,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4480
4551
  knowledge_layer?: "personal" | "team" | undefined;
4481
4552
  layer_reason?: string | undefined;
4482
4553
  tags?: string[] | undefined;
4554
+ related?: string[] | undefined;
4483
4555
  }, {
4484
4556
  summary: string;
4485
4557
  intent_clues: string[];
@@ -4496,6 +4568,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4496
4568
  knowledge_layer?: "personal" | "team" | undefined;
4497
4569
  layer_reason?: string | undefined;
4498
4570
  tags?: string[] | undefined;
4571
+ related?: string[] | undefined;
4499
4572
  }>>;
4500
4573
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4501
4574
  }, z.ZodTypeAny, "passthrough">, unknown>>;
@@ -4604,6 +4677,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4604
4677
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4605
4678
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4606
4679
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4680
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4607
4681
  }, "strict", z.ZodTypeAny, {
4608
4682
  relevance_scope: "narrow" | "broad";
4609
4683
  relevance_paths: string[];
@@ -4620,6 +4694,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4620
4694
  knowledge_layer?: "personal" | "team" | undefined;
4621
4695
  layer_reason?: string | undefined;
4622
4696
  tags?: string[] | undefined;
4697
+ related?: string[] | undefined;
4623
4698
  }, {
4624
4699
  summary: string;
4625
4700
  intent_clues: string[];
@@ -4636,6 +4711,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4636
4711
  knowledge_layer?: "personal" | "team" | undefined;
4637
4712
  layer_reason?: string | undefined;
4638
4713
  tags?: string[] | undefined;
4714
+ related?: string[] | undefined;
4639
4715
  }>>;
4640
4716
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4641
4717
  }, z.ZodTypeAny, "passthrough">>;
@@ -4712,6 +4788,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4712
4788
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4713
4789
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4714
4790
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4791
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4715
4792
  }, "strict", z.ZodTypeAny, {
4716
4793
  relevance_scope: "narrow" | "broad";
4717
4794
  relevance_paths: string[];
@@ -4728,6 +4805,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4728
4805
  knowledge_layer?: "personal" | "team" | undefined;
4729
4806
  layer_reason?: string | undefined;
4730
4807
  tags?: string[] | undefined;
4808
+ related?: string[] | undefined;
4731
4809
  }, {
4732
4810
  summary: string;
4733
4811
  intent_clues: string[];
@@ -4744,6 +4822,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
4744
4822
  knowledge_layer?: "personal" | "team" | undefined;
4745
4823
  layer_reason?: string | undefined;
4746
4824
  tags?: string[] | undefined;
4825
+ related?: string[] | undefined;
4747
4826
  }>>;
4748
4827
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4749
4828
  }, z.ZodTypeAny, "passthrough">>;
@@ -5087,13 +5166,13 @@ declare const driftDetectedEventSchema: z.ZodObject<{
5087
5166
  evidence: z.ZodArray<z.ZodString, "many">;
5088
5167
  }, "strip", z.ZodTypeAny, {
5089
5168
  version: string;
5090
- evidence: string[];
5091
5169
  kind: string;
5170
+ evidence: string[];
5092
5171
  subkind: string;
5093
5172
  }, {
5094
5173
  version: string;
5095
- evidence: string[];
5096
5174
  kind: string;
5175
+ evidence: string[];
5097
5176
  subkind: string;
5098
5177
  }>;
5099
5178
  topology: z.ZodObject<{
@@ -5254,8 +5333,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
5254
5333
  target: string;
5255
5334
  framework: {
5256
5335
  version: string;
5257
- evidence: string[];
5258
5336
  kind: string;
5337
+ evidence: string[];
5259
5338
  subkind: string;
5260
5339
  };
5261
5340
  generated_by: string;
@@ -5316,8 +5395,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
5316
5395
  target: string;
5317
5396
  framework: {
5318
5397
  version: string;
5319
- evidence: string[];
5320
5398
  kind: string;
5399
+ evidence: string[];
5321
5400
  subkind: string;
5322
5401
  };
5323
5402
  generated_by: string;
@@ -5381,8 +5460,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
5381
5460
  target: string;
5382
5461
  framework: {
5383
5462
  version: string;
5384
- evidence: string[];
5385
5463
  kind: string;
5464
+ evidence: string[];
5386
5465
  subkind: string;
5387
5466
  };
5388
5467
  generated_by: string;
@@ -5446,8 +5525,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
5446
5525
  target: string;
5447
5526
  framework: {
5448
5527
  version: string;
5449
- evidence: string[];
5450
5528
  kind: string;
5529
+ evidence: string[];
5451
5530
  subkind: string;
5452
5531
  };
5453
5532
  generated_by: string;
@@ -5541,6 +5620,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5541
5620
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5542
5621
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
5543
5622
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5623
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5544
5624
  }, "strict", z.ZodTypeAny, {
5545
5625
  relevance_scope: "narrow" | "broad";
5546
5626
  relevance_paths: string[];
@@ -5557,6 +5637,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5557
5637
  knowledge_layer?: "personal" | "team" | undefined;
5558
5638
  layer_reason?: string | undefined;
5559
5639
  tags?: string[] | undefined;
5640
+ related?: string[] | undefined;
5560
5641
  }, {
5561
5642
  summary: string;
5562
5643
  intent_clues: string[];
@@ -5573,6 +5654,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5573
5654
  knowledge_layer?: "personal" | "team" | undefined;
5574
5655
  layer_reason?: string | undefined;
5575
5656
  tags?: string[] | undefined;
5657
+ related?: string[] | undefined;
5576
5658
  }>>;
5577
5659
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5578
5660
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -5608,6 +5690,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5608
5690
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5609
5691
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
5610
5692
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5693
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5611
5694
  }, "strict", z.ZodTypeAny, {
5612
5695
  relevance_scope: "narrow" | "broad";
5613
5696
  relevance_paths: string[];
@@ -5624,6 +5707,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5624
5707
  knowledge_layer?: "personal" | "team" | undefined;
5625
5708
  layer_reason?: string | undefined;
5626
5709
  tags?: string[] | undefined;
5710
+ related?: string[] | undefined;
5627
5711
  }, {
5628
5712
  summary: string;
5629
5713
  intent_clues: string[];
@@ -5640,6 +5724,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5640
5724
  knowledge_layer?: "personal" | "team" | undefined;
5641
5725
  layer_reason?: string | undefined;
5642
5726
  tags?: string[] | undefined;
5727
+ related?: string[] | undefined;
5643
5728
  }>>;
5644
5729
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5645
5730
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -5675,6 +5760,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5675
5760
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5676
5761
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
5677
5762
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5763
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5678
5764
  }, "strict", z.ZodTypeAny, {
5679
5765
  relevance_scope: "narrow" | "broad";
5680
5766
  relevance_paths: string[];
@@ -5691,6 +5777,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5691
5777
  knowledge_layer?: "personal" | "team" | undefined;
5692
5778
  layer_reason?: string | undefined;
5693
5779
  tags?: string[] | undefined;
5780
+ related?: string[] | undefined;
5694
5781
  }, {
5695
5782
  summary: string;
5696
5783
  intent_clues: string[];
@@ -5707,6 +5794,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5707
5794
  knowledge_layer?: "personal" | "team" | undefined;
5708
5795
  layer_reason?: string | undefined;
5709
5796
  tags?: string[] | undefined;
5797
+ related?: string[] | undefined;
5710
5798
  }>>;
5711
5799
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5712
5800
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
@@ -5742,6 +5830,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5742
5830
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5743
5831
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
5744
5832
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5833
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5745
5834
  }, "strict", z.ZodTypeAny, {
5746
5835
  relevance_scope: "narrow" | "broad";
5747
5836
  relevance_paths: string[];
@@ -5758,6 +5847,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5758
5847
  knowledge_layer?: "personal" | "team" | undefined;
5759
5848
  layer_reason?: string | undefined;
5760
5849
  tags?: string[] | undefined;
5850
+ related?: string[] | undefined;
5761
5851
  }, {
5762
5852
  summary: string;
5763
5853
  intent_clues: string[];
@@ -5774,6 +5864,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5774
5864
  knowledge_layer?: "personal" | "team" | undefined;
5775
5865
  layer_reason?: string | undefined;
5776
5866
  tags?: string[] | undefined;
5867
+ related?: string[] | undefined;
5777
5868
  }>>;
5778
5869
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5779
5870
  }, z.ZodTypeAny, "passthrough">, unknown>>;
@@ -5882,6 +5973,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5882
5973
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5883
5974
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
5884
5975
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5976
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5885
5977
  }, "strict", z.ZodTypeAny, {
5886
5978
  relevance_scope: "narrow" | "broad";
5887
5979
  relevance_paths: string[];
@@ -5898,6 +5990,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5898
5990
  knowledge_layer?: "personal" | "team" | undefined;
5899
5991
  layer_reason?: string | undefined;
5900
5992
  tags?: string[] | undefined;
5993
+ related?: string[] | undefined;
5901
5994
  }, {
5902
5995
  summary: string;
5903
5996
  intent_clues: string[];
@@ -5914,6 +6007,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5914
6007
  knowledge_layer?: "personal" | "team" | undefined;
5915
6008
  layer_reason?: string | undefined;
5916
6009
  tags?: string[] | undefined;
6010
+ related?: string[] | undefined;
5917
6011
  }>>;
5918
6012
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5919
6013
  }, z.ZodTypeAny, "passthrough">>;
@@ -5990,6 +6084,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5990
6084
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5991
6085
  relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
5992
6086
  relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6087
+ related: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
5993
6088
  }, "strict", z.ZodTypeAny, {
5994
6089
  relevance_scope: "narrow" | "broad";
5995
6090
  relevance_paths: string[];
@@ -6006,6 +6101,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6006
6101
  knowledge_layer?: "personal" | "team" | undefined;
6007
6102
  layer_reason?: string | undefined;
6008
6103
  tags?: string[] | undefined;
6104
+ related?: string[] | undefined;
6009
6105
  }, {
6010
6106
  summary: string;
6011
6107
  intent_clues: string[];
@@ -6022,6 +6118,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6022
6118
  knowledge_layer?: "personal" | "team" | undefined;
6023
6119
  layer_reason?: string | undefined;
6024
6120
  tags?: string[] | undefined;
6121
+ related?: string[] | undefined;
6025
6122
  }>>;
6026
6123
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6027
6124
  }, z.ZodTypeAny, "passthrough">>;
@@ -6361,13 +6458,13 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6361
6458
  evidence: z.ZodArray<z.ZodString, "many">;
6362
6459
  }, "strip", z.ZodTypeAny, {
6363
6460
  version: string;
6364
- evidence: string[];
6365
6461
  kind: string;
6462
+ evidence: string[];
6366
6463
  subkind: string;
6367
6464
  }, {
6368
6465
  version: string;
6369
- evidence: string[];
6370
6466
  kind: string;
6467
+ evidence: string[];
6371
6468
  subkind: string;
6372
6469
  }>;
6373
6470
  topology: z.ZodObject<{
@@ -6528,8 +6625,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6528
6625
  target: string;
6529
6626
  framework: {
6530
6627
  version: string;
6531
- evidence: string[];
6532
6628
  kind: string;
6629
+ evidence: string[];
6533
6630
  subkind: string;
6534
6631
  };
6535
6632
  generated_by: string;
@@ -6590,8 +6687,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6590
6687
  target: string;
6591
6688
  framework: {
6592
6689
  version: string;
6593
- evidence: string[];
6594
6690
  kind: string;
6691
+ evidence: string[];
6595
6692
  subkind: string;
6596
6693
  };
6597
6694
  generated_by: string;
@@ -6655,8 +6752,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6655
6752
  target: string;
6656
6753
  framework: {
6657
6754
  version: string;
6658
- evidence: string[];
6659
6755
  kind: string;
6756
+ evidence: string[];
6660
6757
  subkind: string;
6661
6758
  };
6662
6759
  generated_by: string;
@@ -6720,8 +6817,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6720
6817
  target: string;
6721
6818
  framework: {
6722
6819
  version: string;
6723
- evidence: string[];
6724
6820
  kind: string;
6821
+ evidence: string[];
6725
6822
  subkind: string;
6726
6823
  };
6727
6824
  generated_by: string;
@@ -8149,26 +8246,27 @@ declare const assistantTurnObservedEventSchema: z.ZodObject<{
8149
8246
  kind: z.ZodEnum<["edit", "not_edit", "require", "forbid"]>;
8150
8247
  target: z.ZodString;
8151
8248
  }, "strip", z.ZodTypeAny, {
8152
- target: string;
8153
8249
  kind: "require" | "edit" | "not_edit" | "forbid";
8154
- }, {
8155
8250
  target: string;
8251
+ }, {
8156
8252
  kind: "require" | "edit" | "not_edit" | "forbid";
8253
+ target: string;
8157
8254
  }>, "many">;
8158
8255
  skip_reason: z.ZodNullable<z.ZodString>;
8159
8256
  }, "strip", z.ZodTypeAny, {
8160
8257
  operators: {
8161
- target: string;
8162
8258
  kind: "require" | "edit" | "not_edit" | "forbid";
8259
+ target: string;
8163
8260
  }[];
8164
8261
  skip_reason: string | null;
8165
8262
  }, {
8166
8263
  operators: {
8167
- target: string;
8168
8264
  kind: "require" | "edit" | "not_edit" | "forbid";
8265
+ target: string;
8169
8266
  }[];
8170
8267
  skip_reason: string | null;
8171
8268
  }>, "many">>;
8269
+ cite_stores: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodString>, "many">>;
8172
8270
  client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
8173
8271
  turn_id: z.ZodString;
8174
8272
  envelope_index: z.ZodOptional<z.ZodNumber>;
@@ -8191,14 +8289,15 @@ declare const assistantTurnObservedEventSchema: z.ZodObject<{
8191
8289
  cite_tags: ("none" | "applied" | "dismissed")[];
8192
8290
  cite_commitments: {
8193
8291
  operators: {
8194
- target: string;
8195
8292
  kind: "require" | "edit" | "not_edit" | "forbid";
8293
+ target: string;
8196
8294
  }[];
8197
8295
  skip_reason: string | null;
8198
8296
  }[];
8199
8297
  turn_id: string;
8200
8298
  correlation_id?: string | undefined;
8201
8299
  session_id?: string | undefined;
8300
+ cite_stores?: (string | null)[] | undefined;
8202
8301
  client?: "cursor" | "cc" | "codex" | undefined;
8203
8302
  envelope_index?: number | undefined;
8204
8303
  }, {
@@ -8216,11 +8315,12 @@ declare const assistantTurnObservedEventSchema: z.ZodObject<{
8216
8315
  cite_tags?: unknown[] | undefined;
8217
8316
  cite_commitments?: {
8218
8317
  operators: {
8219
- target: string;
8220
8318
  kind: "require" | "edit" | "not_edit" | "forbid";
8319
+ target: string;
8221
8320
  }[];
8222
8321
  skip_reason: string | null;
8223
8322
  }[] | undefined;
8323
+ cite_stores?: (string | null)[] | undefined;
8224
8324
  client?: "cursor" | "cc" | "codex" | undefined;
8225
8325
  envelope_index?: number | undefined;
8226
8326
  }>;
@@ -8462,17 +8562,14 @@ declare const sessionArchiveAttemptedEventSchema: z.ZodObject<{
8462
8562
  candidates_proposed?: number | undefined;
8463
8563
  knowledge_proposed_ids?: string[] | undefined;
8464
8564
  }>;
8465
- declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
8466
- event_type: z.ZodLiteral<"knowledge_context_planned">;
8467
- target_paths: z.ZodArray<z.ZodString, "many">;
8468
- required_stable_ids: z.ZodArray<z.ZodString, "many">;
8469
- ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
8470
- final_stable_ids: z.ZodArray<z.ZodString, "many">;
8471
- selection_token: z.ZodOptional<z.ZodString>;
8472
- client_hash: z.ZodOptional<z.ZodString>;
8473
- intent: z.ZodOptional<z.ZodString>;
8474
- known_tech: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8475
- diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
8565
+ declare const hookSurfaceEmittedEventSchema: z.ZodObject<{
8566
+ event_type: z.ZodLiteral<"hook_surface_emitted">;
8567
+ hook_name: z.ZodString;
8568
+ client: z.ZodEnum<["cc", "codex", "cursor"]>;
8569
+ target_channel: z.ZodString;
8570
+ rendered_ids: z.ZodArray<z.ZodString, "many">;
8571
+ delivery_status: z.ZodEnum<["delivered", "suppressed", "error"]>;
8572
+ suppression_reason: z.ZodOptional<z.ZodString>;
8476
8573
  kind: z.ZodLiteral<"fabric-event">;
8477
8574
  id: z.ZodString;
8478
8575
  ts: z.ZodNumber;
@@ -8481,49 +8578,39 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8481
8578
  session_id: z.ZodOptional<z.ZodString>;
8482
8579
  }, "strip", z.ZodTypeAny, {
8483
8580
  id: string;
8484
- target_paths: string[];
8485
8581
  ts: number;
8486
8582
  schema_version: 1;
8487
8583
  kind: "fabric-event";
8488
- event_type: "knowledge_context_planned";
8489
- required_stable_ids: string[];
8490
- ai_selectable_stable_ids: string[];
8491
- final_stable_ids: string[];
8492
- known_tech?: string[] | undefined;
8493
- intent?: string | undefined;
8494
- client_hash?: string | undefined;
8584
+ event_type: "hook_surface_emitted";
8585
+ client: "cursor" | "cc" | "codex";
8586
+ hook_name: string;
8587
+ target_channel: string;
8588
+ rendered_ids: string[];
8589
+ delivery_status: "error" | "delivered" | "suppressed";
8495
8590
  correlation_id?: string | undefined;
8496
8591
  session_id?: string | undefined;
8497
- selection_token?: string | undefined;
8498
- diagnostics?: unknown[] | undefined;
8592
+ suppression_reason?: string | undefined;
8499
8593
  }, {
8500
8594
  id: string;
8501
- target_paths: string[];
8502
8595
  ts: number;
8503
8596
  schema_version: 1;
8504
8597
  kind: "fabric-event";
8505
- event_type: "knowledge_context_planned";
8506
- required_stable_ids: string[];
8507
- ai_selectable_stable_ids: string[];
8508
- final_stable_ids: string[];
8509
- known_tech?: string[] | undefined;
8510
- intent?: string | undefined;
8511
- client_hash?: string | undefined;
8598
+ event_type: "hook_surface_emitted";
8599
+ client: "cursor" | "cc" | "codex";
8600
+ hook_name: string;
8601
+ target_channel: string;
8602
+ rendered_ids: string[];
8603
+ delivery_status: "error" | "delivered" | "suppressed";
8512
8604
  correlation_id?: string | undefined;
8513
8605
  session_id?: string | undefined;
8514
- selection_token?: string | undefined;
8515
- diagnostics?: unknown[] | undefined;
8516
- }>, z.ZodObject<{
8517
- event_type: z.ZodLiteral<"knowledge_selection">;
8518
- selection_token: z.ZodString;
8519
- target_paths: z.ZodArray<z.ZodString, "many">;
8520
- required_stable_ids: z.ZodArray<z.ZodString, "many">;
8521
- ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
8522
- ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
8523
- final_stable_ids: z.ZodArray<z.ZodString, "many">;
8524
- ai_selection_reasons: z.ZodRecord<z.ZodString, z.ZodString>;
8525
- rejected_stable_ids: z.ZodArray<z.ZodString, "many">;
8526
- ignored_stable_ids: z.ZodArray<z.ZodString, "many">;
8606
+ suppression_reason?: string | undefined;
8607
+ }>;
8608
+ declare const hookSignalEmittedEventSchema: z.ZodObject<{
8609
+ event_type: z.ZodLiteral<"hook_signal_emitted">;
8610
+ signal_type: z.ZodEnum<["archive", "review", "maintenance", "other"]>;
8611
+ threshold: z.ZodNumber;
8612
+ actual_value: z.ZodNumber;
8613
+ fired: z.ZodBoolean;
8527
8614
  kind: z.ZodLiteral<"fabric-event">;
8528
8615
  id: z.ZodString;
8529
8616
  ts: z.ZodNumber;
@@ -8532,46 +8619,38 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8532
8619
  session_id: z.ZodOptional<z.ZodString>;
8533
8620
  }, "strip", z.ZodTypeAny, {
8534
8621
  id: string;
8535
- target_paths: string[];
8536
- selection_token: string;
8537
- ai_selected_stable_ids: string[];
8538
- ai_selection_reasons: Record<string, string>;
8539
8622
  ts: number;
8540
8623
  schema_version: 1;
8541
8624
  kind: "fabric-event";
8542
- event_type: "knowledge_selection";
8543
- required_stable_ids: string[];
8544
- ai_selectable_stable_ids: string[];
8545
- final_stable_ids: string[];
8546
- rejected_stable_ids: string[];
8547
- ignored_stable_ids: string[];
8625
+ event_type: "hook_signal_emitted";
8626
+ signal_type: "archive" | "review" | "maintenance" | "other";
8627
+ threshold: number;
8628
+ actual_value: number;
8629
+ fired: boolean;
8548
8630
  correlation_id?: string | undefined;
8549
8631
  session_id?: string | undefined;
8550
8632
  }, {
8551
8633
  id: string;
8552
- target_paths: string[];
8553
- selection_token: string;
8554
- ai_selected_stable_ids: string[];
8555
- ai_selection_reasons: Record<string, string>;
8556
8634
  ts: number;
8557
8635
  schema_version: 1;
8558
8636
  kind: "fabric-event";
8559
- event_type: "knowledge_selection";
8560
- required_stable_ids: string[];
8561
- ai_selectable_stable_ids: string[];
8562
- final_stable_ids: string[];
8563
- rejected_stable_ids: string[];
8564
- ignored_stable_ids: string[];
8637
+ event_type: "hook_signal_emitted";
8638
+ signal_type: "archive" | "review" | "maintenance" | "other";
8639
+ threshold: number;
8640
+ actual_value: number;
8641
+ fired: boolean;
8565
8642
  correlation_id?: string | undefined;
8566
8643
  session_id?: string | undefined;
8567
- }>, z.ZodObject<{
8568
- event_type: z.ZodLiteral<"knowledge_sections_fetched">;
8569
- selection_token: z.ZodString;
8570
- target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8571
- requested_sections: z.ZodArray<z.ZodString, "many">;
8572
- final_stable_ids: z.ZodArray<z.ZodString, "many">;
8573
- ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
8574
- diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
8644
+ }>;
8645
+ declare const mcpStdioTraceEventSchema: z.ZodObject<{
8646
+ event_type: z.ZodLiteral<"mcp_stdio_trace">;
8647
+ tool_name: z.ZodString;
8648
+ request_id: z.ZodString;
8649
+ duration_ms: z.ZodNumber;
8650
+ status: z.ZodEnum<["ok", "error"]>;
8651
+ payload_bytes_in: z.ZodNumber;
8652
+ payload_bytes_out: z.ZodNumber;
8653
+ error_code: z.ZodOptional<z.ZodString>;
8575
8654
  kind: z.ZodLiteral<"fabric-event">;
8576
8655
  id: z.ZodString;
8577
8656
  ts: z.ZodNumber;
@@ -8579,47 +8658,43 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8579
8658
  correlation_id: z.ZodOptional<z.ZodString>;
8580
8659
  session_id: z.ZodOptional<z.ZodString>;
8581
8660
  }, "strip", z.ZodTypeAny, {
8661
+ status: "ok" | "error";
8582
8662
  id: string;
8583
- selection_token: string;
8584
- ai_selected_stable_ids: string[];
8585
8663
  ts: number;
8586
8664
  schema_version: 1;
8587
8665
  kind: "fabric-event";
8588
- event_type: "knowledge_sections_fetched";
8589
- final_stable_ids: string[];
8590
- requested_sections: string[];
8666
+ event_type: "mcp_stdio_trace";
8667
+ duration_ms: number;
8668
+ tool_name: string;
8669
+ request_id: string;
8670
+ payload_bytes_in: number;
8671
+ payload_bytes_out: number;
8591
8672
  correlation_id?: string | undefined;
8592
8673
  session_id?: string | undefined;
8593
- target_paths?: string[] | undefined;
8594
- diagnostics?: unknown[] | undefined;
8674
+ error_code?: string | undefined;
8595
8675
  }, {
8676
+ status: "ok" | "error";
8596
8677
  id: string;
8597
- selection_token: string;
8598
- ai_selected_stable_ids: string[];
8599
8678
  ts: number;
8600
8679
  schema_version: 1;
8601
8680
  kind: "fabric-event";
8602
- event_type: "knowledge_sections_fetched";
8603
- final_stable_ids: string[];
8604
- requested_sections: string[];
8681
+ event_type: "mcp_stdio_trace";
8682
+ duration_ms: number;
8683
+ tool_name: string;
8684
+ request_id: string;
8685
+ payload_bytes_in: number;
8686
+ payload_bytes_out: number;
8605
8687
  correlation_id?: string | undefined;
8606
8688
  session_id?: string | undefined;
8607
- target_paths?: string[] | undefined;
8608
- diagnostics?: unknown[] | undefined;
8609
- }>, z.ZodObject<{
8610
- event_type: z.ZodLiteral<"edit_intent_checked">;
8611
- path: z.ZodString;
8612
- compliant: z.ZodBoolean;
8613
- intent: z.ZodString;
8614
- ledger_entry_id: z.ZodString;
8615
- ledger_source: z.ZodOptional<z.ZodEnum<["ai", "human", "hook"]>>;
8616
- commit_sha: z.ZodOptional<z.ZodString>;
8617
- parent_sha: z.ZodOptional<z.ZodString>;
8618
- parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
8619
- diff_stat: z.ZodOptional<z.ZodString>;
8620
- annotation: z.ZodOptional<z.ZodString>;
8621
- matched_rule_context_ts: z.ZodNullable<z.ZodNumber>;
8622
- window_ms: z.ZodNumber;
8689
+ error_code?: string | undefined;
8690
+ }>;
8691
+ declare const payloadGuardObservedEventSchema: z.ZodObject<{
8692
+ event_type: z.ZodLiteral<"payload_guard_observed">;
8693
+ tool_name: z.ZodString;
8694
+ path_count: z.ZodNumber;
8695
+ tokens_estimated: z.ZodNumber;
8696
+ truncated: z.ZodBoolean;
8697
+ cap: z.ZodNumber;
8623
8698
  kind: z.ZodLiteral<"fabric-event">;
8624
8699
  id: z.ZodString;
8625
8700
  ts: z.ZodNumber;
@@ -8627,67 +8702,37 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8627
8702
  correlation_id: z.ZodOptional<z.ZodString>;
8628
8703
  session_id: z.ZodOptional<z.ZodString>;
8629
8704
  }, "strip", z.ZodTypeAny, {
8630
- path: string;
8631
8705
  id: string;
8632
- intent: string;
8633
8706
  ts: number;
8634
- ledger_entry_id: string;
8635
8707
  schema_version: 1;
8636
8708
  kind: "fabric-event";
8637
- event_type: "edit_intent_checked";
8638
- compliant: boolean;
8639
- matched_rule_context_ts: number | null;
8640
- window_ms: number;
8709
+ event_type: "payload_guard_observed";
8710
+ tool_name: string;
8711
+ path_count: number;
8712
+ tokens_estimated: number;
8713
+ truncated: boolean;
8714
+ cap: number;
8641
8715
  correlation_id?: string | undefined;
8642
8716
  session_id?: string | undefined;
8643
- annotation?: string | undefined;
8644
- commit_sha?: string | undefined;
8645
- parent_sha?: string | undefined;
8646
- parent_ledger_entry_id?: string | undefined;
8647
- diff_stat?: string | undefined;
8648
- ledger_source?: "ai" | "human" | "hook" | undefined;
8649
8717
  }, {
8650
- path: string;
8651
8718
  id: string;
8652
- intent: string;
8653
8719
  ts: number;
8654
- ledger_entry_id: string;
8655
8720
  schema_version: 1;
8656
8721
  kind: "fabric-event";
8657
- event_type: "edit_intent_checked";
8658
- compliant: boolean;
8659
- matched_rule_context_ts: number | null;
8660
- window_ms: number;
8722
+ event_type: "payload_guard_observed";
8723
+ tool_name: string;
8724
+ path_count: number;
8725
+ tokens_estimated: number;
8726
+ truncated: boolean;
8727
+ cap: number;
8661
8728
  correlation_id?: string | undefined;
8662
8729
  session_id?: string | undefined;
8663
- annotation?: string | undefined;
8664
- commit_sha?: string | undefined;
8665
- parent_sha?: string | undefined;
8666
- parent_ledger_entry_id?: string | undefined;
8667
- diff_stat?: string | undefined;
8668
- ledger_source?: "ai" | "human" | "hook" | undefined;
8669
- }>, z.ZodObject<{
8670
- event_type: z.ZodLiteral<"knowledge_drift_detected">;
8671
- revision: z.ZodOptional<z.ZodString>;
8672
- drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
8673
- missing_files: z.ZodArray<z.ZodString, "many">;
8674
- stale_files: z.ZodArray<z.ZodString, "many">;
8675
- details: z.ZodOptional<z.ZodArray<z.ZodObject<{
8676
- file: z.ZodString;
8677
- stable_id: z.ZodString;
8678
- expected_hash: z.ZodString;
8679
- actual_hash: z.ZodNullable<z.ZodString>;
8680
- }, "strip", z.ZodTypeAny, {
8681
- file: string;
8682
- stable_id: string;
8683
- expected_hash: string;
8684
- actual_hash: string | null;
8685
- }, {
8686
- file: string;
8687
- stable_id: string;
8688
- expected_hash: string;
8689
- actual_hash: string | null;
8690
- }>, "many">>;
8730
+ }>;
8731
+ declare const skillInvocationStartedEventSchema: z.ZodObject<{
8732
+ event_type: z.ZodLiteral<"skill_invocation_started">;
8733
+ skill_name: z.ZodString;
8734
+ trigger_source: z.ZodEnum<["user", "auto_invoke", "ai_self_trigger", "chained"]>;
8735
+ entry_point: z.ZodString;
8691
8736
  kind: z.ZodLiteral<"fabric-event">;
8692
8737
  id: z.ZodString;
8693
8738
  ts: z.ZodNumber;
@@ -8699,42 +8744,31 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8699
8744
  ts: number;
8700
8745
  schema_version: 1;
8701
8746
  kind: "fabric-event";
8702
- event_type: "knowledge_drift_detected";
8703
- drifted_stable_ids: string[];
8704
- missing_files: string[];
8705
- stale_files: string[];
8747
+ event_type: "skill_invocation_started";
8748
+ skill_name: string;
8749
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
8750
+ entry_point: string;
8706
8751
  correlation_id?: string | undefined;
8707
8752
  session_id?: string | undefined;
8708
- revision?: string | undefined;
8709
- details?: {
8710
- file: string;
8711
- stable_id: string;
8712
- expected_hash: string;
8713
- actual_hash: string | null;
8714
- }[] | undefined;
8715
8753
  }, {
8716
8754
  id: string;
8717
8755
  ts: number;
8718
8756
  schema_version: 1;
8719
8757
  kind: "fabric-event";
8720
- event_type: "knowledge_drift_detected";
8721
- drifted_stable_ids: string[];
8722
- missing_files: string[];
8723
- stale_files: string[];
8758
+ event_type: "skill_invocation_started";
8759
+ skill_name: string;
8760
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
8761
+ entry_point: string;
8724
8762
  correlation_id?: string | undefined;
8725
8763
  session_id?: string | undefined;
8726
- revision?: string | undefined;
8727
- details?: {
8728
- file: string;
8729
- stable_id: string;
8730
- expected_hash: string;
8731
- actual_hash: string | null;
8732
- }[] | undefined;
8733
- }>, z.ZodObject<{
8734
- event_type: z.ZodLiteral<"mcp_event">;
8735
- mcp_event_id: z.ZodString;
8736
- stream_id: z.ZodString;
8737
- message: z.ZodUnknown;
8764
+ }>;
8765
+ declare const skillInvocationCompletedEventSchema: z.ZodObject<{
8766
+ event_type: z.ZodLiteral<"skill_invocation_completed">;
8767
+ skill_name: z.ZodString;
8768
+ trigger_source: z.ZodEnum<["user", "auto_invoke", "ai_self_trigger", "chained"]>;
8769
+ entry_point: z.ZodString;
8770
+ outcome: z.ZodEnum<["completed", "aborted", "error", "no_op"]>;
8771
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
8738
8772
  kind: z.ZodLiteral<"fabric-event">;
8739
8773
  id: z.ZodString;
8740
8774
  ts: z.ZodNumber;
@@ -8746,28 +8780,35 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8746
8780
  ts: number;
8747
8781
  schema_version: 1;
8748
8782
  kind: "fabric-event";
8749
- event_type: "mcp_event";
8750
- mcp_event_id: string;
8751
- stream_id: string;
8752
- message?: unknown;
8783
+ event_type: "skill_invocation_completed";
8784
+ outcome: "aborted" | "completed" | "error" | "no_op";
8785
+ skill_name: string;
8786
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
8787
+ entry_point: string;
8753
8788
  correlation_id?: string | undefined;
8754
8789
  session_id?: string | undefined;
8790
+ elapsed_ms?: number | undefined;
8755
8791
  }, {
8756
8792
  id: string;
8757
8793
  ts: number;
8758
8794
  schema_version: 1;
8759
8795
  kind: "fabric-event";
8760
- event_type: "mcp_event";
8761
- mcp_event_id: string;
8762
- stream_id: string;
8763
- message?: unknown;
8796
+ event_type: "skill_invocation_completed";
8797
+ outcome: "aborted" | "completed" | "error" | "no_op";
8798
+ skill_name: string;
8799
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
8800
+ entry_point: string;
8764
8801
  correlation_id?: string | undefined;
8765
8802
  session_id?: string | undefined;
8766
- }>, z.ZodObject<{
8767
- event_type: z.ZodLiteral<"reapply_completed">;
8768
- preserved_ledger: z.ZodBoolean;
8769
- preserved_meta: z.ZodBoolean;
8770
- rules_count: z.ZodNumber;
8803
+ elapsed_ms?: number | undefined;
8804
+ }>;
8805
+ declare const skillPhaseTransitionEventSchema: z.ZodObject<{
8806
+ event_type: z.ZodLiteral<"skill_phase_transition">;
8807
+ skill_name: z.ZodString;
8808
+ phase: z.ZodString;
8809
+ status: z.ZodEnum<["entered", "completed", "skipped", "failed"]>;
8810
+ checkpoint: z.ZodOptional<z.ZodString>;
8811
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
8771
8812
  kind: z.ZodLiteral<"fabric-event">;
8772
8813
  id: z.ZodString;
8773
8814
  ts: z.ZodNumber;
@@ -8775,32 +8816,38 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8775
8816
  correlation_id: z.ZodOptional<z.ZodString>;
8776
8817
  session_id: z.ZodOptional<z.ZodString>;
8777
8818
  }, "strip", z.ZodTypeAny, {
8819
+ status: "skipped" | "completed" | "failed" | "entered";
8778
8820
  id: string;
8779
8821
  ts: number;
8780
8822
  schema_version: 1;
8781
8823
  kind: "fabric-event";
8782
- event_type: "reapply_completed";
8783
- preserved_ledger: boolean;
8784
- preserved_meta: boolean;
8785
- rules_count: number;
8824
+ phase: string;
8825
+ event_type: "skill_phase_transition";
8826
+ skill_name: string;
8786
8827
  correlation_id?: string | undefined;
8787
8828
  session_id?: string | undefined;
8829
+ elapsed_ms?: number | undefined;
8830
+ checkpoint?: string | undefined;
8788
8831
  }, {
8832
+ status: "skipped" | "completed" | "failed" | "entered";
8789
8833
  id: string;
8790
8834
  ts: number;
8791
8835
  schema_version: 1;
8792
8836
  kind: "fabric-event";
8793
- event_type: "reapply_completed";
8794
- preserved_ledger: boolean;
8795
- preserved_meta: boolean;
8796
- rules_count: number;
8837
+ phase: string;
8838
+ event_type: "skill_phase_transition";
8839
+ skill_name: string;
8797
8840
  correlation_id?: string | undefined;
8798
8841
  session_id?: string | undefined;
8799
- }>, z.ZodObject<{
8800
- event_type: z.ZodLiteral<"install_diff_applied">;
8801
- applied: z.ZodArray<z.ZodString, "many">;
8802
- canonical: z.ZodArray<z.ZodString, "many">;
8803
- drifted: z.ZodArray<z.ZodString, "many">;
8842
+ elapsed_ms?: number | undefined;
8843
+ checkpoint?: string | undefined;
8844
+ }>;
8845
+ declare const skillTriggerCandidateEventSchema: z.ZodObject<{
8846
+ event_type: z.ZodLiteral<"skill_trigger_candidate">;
8847
+ skill_name: z.ZodString;
8848
+ trigger_source: z.ZodEnum<["user", "auto_invoke", "ai_self_trigger", "chained"]>;
8849
+ signal: z.ZodString;
8850
+ invoked: z.ZodBoolean;
8804
8851
  kind: z.ZodLiteral<"fabric-event">;
8805
8852
  id: z.ZodString;
8806
8853
  ts: z.ZodNumber;
@@ -8809,31 +8856,37 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8809
8856
  session_id: z.ZodOptional<z.ZodString>;
8810
8857
  }, "strip", z.ZodTypeAny, {
8811
8858
  id: string;
8812
- canonical: string[];
8813
- drifted: string[];
8814
8859
  ts: number;
8815
8860
  schema_version: 1;
8816
8861
  kind: "fabric-event";
8817
- applied: string[];
8818
- event_type: "install_diff_applied";
8862
+ event_type: "skill_trigger_candidate";
8863
+ skill_name: string;
8864
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
8865
+ signal: string;
8866
+ invoked: boolean;
8819
8867
  correlation_id?: string | undefined;
8820
8868
  session_id?: string | undefined;
8821
8869
  }, {
8822
8870
  id: string;
8823
- canonical: string[];
8824
- drifted: string[];
8825
8871
  ts: number;
8826
8872
  schema_version: 1;
8827
8873
  kind: "fabric-event";
8828
- applied: string[];
8829
- event_type: "install_diff_applied";
8874
+ event_type: "skill_trigger_candidate";
8875
+ skill_name: string;
8876
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
8877
+ signal: string;
8878
+ invoked: boolean;
8830
8879
  correlation_id?: string | undefined;
8831
8880
  session_id?: string | undefined;
8832
- }>, z.ZodObject<{
8833
- event_type: z.ZodLiteral<"event_ledger_truncated">;
8834
- byte_offset: z.ZodNumber;
8835
- byte_length: z.ZodNumber;
8836
- corrupted_path: z.ZodString;
8881
+ }>;
8882
+ declare const llmJudgeRunEventSchema: z.ZodObject<{
8883
+ event_type: z.ZodLiteral<"llm_judge_run">;
8884
+ prompt: z.ZodString;
8885
+ version: z.ZodString;
8886
+ model: z.ZodString;
8887
+ input_trace_id: z.ZodString;
8888
+ score: z.ZodNumber;
8889
+ rationale: z.ZodString;
8837
8890
  kind: z.ZodLiteral<"fabric-event">;
8838
8891
  id: z.ZodString;
8839
8892
  ts: z.ZodNumber;
@@ -8842,30 +8895,38 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8842
8895
  session_id: z.ZodOptional<z.ZodString>;
8843
8896
  }, "strip", z.ZodTypeAny, {
8844
8897
  id: string;
8898
+ version: string;
8845
8899
  ts: number;
8900
+ model: string;
8846
8901
  schema_version: 1;
8847
8902
  kind: "fabric-event";
8848
- event_type: "event_ledger_truncated";
8849
- byte_offset: number;
8850
- byte_length: number;
8851
- corrupted_path: string;
8903
+ rationale: string;
8904
+ event_type: "llm_judge_run";
8905
+ prompt: string;
8906
+ input_trace_id: string;
8907
+ score: number;
8852
8908
  correlation_id?: string | undefined;
8853
8909
  session_id?: string | undefined;
8854
8910
  }, {
8855
8911
  id: string;
8912
+ version: string;
8856
8913
  ts: number;
8914
+ model: string;
8857
8915
  schema_version: 1;
8858
8916
  kind: "fabric-event";
8859
- event_type: "event_ledger_truncated";
8860
- byte_offset: number;
8861
- byte_length: number;
8862
- corrupted_path: string;
8917
+ rationale: string;
8918
+ event_type: "llm_judge_run";
8919
+ prompt: string;
8920
+ input_trace_id: string;
8921
+ score: number;
8863
8922
  correlation_id?: string | undefined;
8864
8923
  session_id?: string | undefined;
8865
- }>, z.ZodObject<{
8866
- event_type: z.ZodLiteral<"mcp_config_migrated">;
8867
- source: z.ZodLiteral<"doctor_fix">;
8868
- removed_from: z.ZodString;
8924
+ }>;
8925
+ declare const clientCapabilitySnapshotEventSchema: z.ZodObject<{
8926
+ event_type: z.ZodLiteral<"client_capability_snapshot">;
8927
+ client: z.ZodEnum<["cc", "codex", "cursor"]>;
8928
+ capabilities: z.ZodArray<z.ZodString, "many">;
8929
+ version: z.ZodString;
8869
8930
  kind: z.ZodLiteral<"fabric-event">;
8870
8931
  id: z.ZodString;
8871
8932
  ts: z.ZodNumber;
@@ -8874,31 +8935,29 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8874
8935
  session_id: z.ZodOptional<z.ZodString>;
8875
8936
  }, "strip", z.ZodTypeAny, {
8876
8937
  id: string;
8877
- source: "doctor_fix";
8938
+ version: string;
8878
8939
  ts: number;
8879
8940
  schema_version: 1;
8941
+ capabilities: string[];
8880
8942
  kind: "fabric-event";
8881
- event_type: "mcp_config_migrated";
8882
- removed_from: string;
8943
+ event_type: "client_capability_snapshot";
8944
+ client: "cursor" | "cc" | "codex";
8883
8945
  correlation_id?: string | undefined;
8884
8946
  session_id?: string | undefined;
8885
8947
  }, {
8886
8948
  id: string;
8887
- source: "doctor_fix";
8949
+ version: string;
8888
8950
  ts: number;
8889
8951
  schema_version: 1;
8952
+ capabilities: string[];
8890
8953
  kind: "fabric-event";
8891
- event_type: "mcp_config_migrated";
8892
- removed_from: string;
8954
+ event_type: "client_capability_snapshot";
8955
+ client: "cursor" | "cc" | "codex";
8893
8956
  correlation_id?: string | undefined;
8894
8957
  session_id?: string | undefined;
8895
- }>, z.ZodObject<{
8896
- event_type: z.ZodLiteral<"bootstrap_marker_migrated">;
8897
- path: z.ZodString;
8898
- migrated_count: z.ZodNumber;
8899
- legacy_marker: z.ZodLiteral<"fabric:knowledge-base">;
8900
- new_marker: z.ZodLiteral<"fabric:bootstrap">;
8901
- timestamp: z.ZodString;
8958
+ }>;
8959
+ declare const sessionEndedEventSchema: z.ZodObject<{
8960
+ event_type: z.ZodLiteral<"session_ended">;
8902
8961
  kind: z.ZodLiteral<"fabric-event">;
8903
8962
  id: z.ZodString;
8904
8963
  ts: z.ZodNumber;
@@ -8906,36 +8965,29 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8906
8965
  correlation_id: z.ZodOptional<z.ZodString>;
8907
8966
  session_id: z.ZodOptional<z.ZodString>;
8908
8967
  }, "strip", z.ZodTypeAny, {
8909
- path: string;
8910
8968
  id: string;
8911
8969
  ts: number;
8912
8970
  schema_version: 1;
8913
8971
  kind: "fabric-event";
8914
- event_type: "bootstrap_marker_migrated";
8915
- migrated_count: number;
8916
- legacy_marker: "fabric:knowledge-base";
8917
- new_marker: "fabric:bootstrap";
8918
- timestamp: string;
8972
+ event_type: "session_ended";
8919
8973
  correlation_id?: string | undefined;
8920
8974
  session_id?: string | undefined;
8921
8975
  }, {
8922
- path: string;
8923
8976
  id: string;
8924
8977
  ts: number;
8925
8978
  schema_version: 1;
8926
8979
  kind: "fabric-event";
8927
- event_type: "bootstrap_marker_migrated";
8928
- migrated_count: number;
8929
- legacy_marker: "fabric:knowledge-base";
8930
- new_marker: "fabric:bootstrap";
8931
- timestamp: string;
8980
+ event_type: "session_ended";
8932
8981
  correlation_id?: string | undefined;
8933
8982
  session_id?: string | undefined;
8934
- }>, z.ZodObject<{
8935
- event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
8936
- reconciled_files: z.ZodArray<z.ZodString, "many">;
8937
- duration_ms: z.ZodNumber;
8938
- source: z.ZodLiteral<"reconcileKnowledge">;
8983
+ }>;
8984
+ declare const fileMutatedEventSchema: z.ZodObject<{
8985
+ event_type: z.ZodLiteral<"file_mutated">;
8986
+ path: z.ZodString;
8987
+ tool_call_id: z.ZodString;
8988
+ tool_name: z.ZodOptional<z.ZodString>;
8989
+ source_event_id: z.ZodOptional<z.ZodString>;
8990
+ store_id: z.ZodOptional<z.ZodString>;
8939
8991
  kind: z.ZodLiteral<"fabric-event">;
8940
8992
  id: z.ZodString;
8941
8993
  ts: z.ZodNumber;
@@ -8943,34 +8995,34 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8943
8995
  correlation_id: z.ZodOptional<z.ZodString>;
8944
8996
  session_id: z.ZodOptional<z.ZodString>;
8945
8997
  }, "strip", z.ZodTypeAny, {
8998
+ path: string;
8946
8999
  id: string;
8947
- source: "reconcileKnowledge";
8948
9000
  ts: number;
8949
9001
  schema_version: 1;
8950
9002
  kind: "fabric-event";
8951
- event_type: "meta_reconciled_on_startup";
8952
- reconciled_files: string[];
8953
- duration_ms: number;
9003
+ event_type: "file_mutated";
9004
+ tool_call_id: string;
8954
9005
  correlation_id?: string | undefined;
8955
9006
  session_id?: string | undefined;
9007
+ tool_name?: string | undefined;
9008
+ source_event_id?: string | undefined;
9009
+ store_id?: string | undefined;
8956
9010
  }, {
9011
+ path: string;
8957
9012
  id: string;
8958
- source: "reconcileKnowledge";
8959
9013
  ts: number;
8960
9014
  schema_version: 1;
8961
9015
  kind: "fabric-event";
8962
- event_type: "meta_reconciled_on_startup";
8963
- reconciled_files: string[];
8964
- duration_ms: number;
9016
+ event_type: "file_mutated";
9017
+ tool_call_id: string;
8965
9018
  correlation_id?: string | undefined;
8966
9019
  session_id?: string | undefined;
8967
- }>, z.ZodObject<{
8968
- event_type: z.ZodLiteral<"meta_reconciled">;
8969
- reconciled_files: z.ZodArray<z.ZodString, "many">;
8970
- duration_ms: z.ZodNumber;
8971
- trigger: z.ZodEnum<["doctor", "manual", "auto-heal-description", "auto-heal-after-drift", "post-approve", "post-modify"]>;
8972
- source: z.ZodLiteral<"reconcileKnowledge">;
8973
- force_write_reason: z.ZodOptional<z.ZodEnum<["revision_drift"]>>;
9020
+ tool_name?: string | undefined;
9021
+ source_event_id?: string | undefined;
9022
+ store_id?: string | undefined;
9023
+ }>;
9024
+ declare const precompactObservedEventSchema: z.ZodObject<{
9025
+ event_type: z.ZodLiteral<"precompact_observed">;
8974
9026
  kind: z.ZodLiteral<"fabric-event">;
8975
9027
  id: z.ZodString;
8976
9028
  ts: z.ZodNumber;
@@ -8979,34 +9031,25 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
8979
9031
  session_id: z.ZodOptional<z.ZodString>;
8980
9032
  }, "strip", z.ZodTypeAny, {
8981
9033
  id: string;
8982
- source: "reconcileKnowledge";
8983
9034
  ts: number;
8984
9035
  schema_version: 1;
8985
9036
  kind: "fabric-event";
8986
- event_type: "meta_reconciled";
8987
- reconciled_files: string[];
8988
- duration_ms: number;
8989
- trigger: "manual" | "doctor" | "auto-heal-description" | "auto-heal-after-drift" | "post-approve" | "post-modify";
9037
+ event_type: "precompact_observed";
8990
9038
  correlation_id?: string | undefined;
8991
9039
  session_id?: string | undefined;
8992
- force_write_reason?: "revision_drift" | undefined;
8993
9040
  }, {
8994
9041
  id: string;
8995
- source: "reconcileKnowledge";
8996
9042
  ts: number;
8997
9043
  schema_version: 1;
8998
9044
  kind: "fabric-event";
8999
- event_type: "meta_reconciled";
9000
- reconciled_files: string[];
9001
- duration_ms: number;
9002
- trigger: "manual" | "doctor" | "auto-heal-description" | "auto-heal-after-drift" | "post-approve" | "post-modify";
9045
+ event_type: "precompact_observed";
9003
9046
  correlation_id?: string | undefined;
9004
9047
  session_id?: string | undefined;
9005
- force_write_reason?: "revision_drift" | undefined;
9006
- }>, z.ZodObject<{
9007
- event_type: z.ZodLiteral<"claude_skill_path_migrated">;
9008
- from: z.ZodString;
9009
- to: z.ZodString;
9048
+ }>;
9049
+ declare const graphEdgeCandidateRequestedEventSchema: z.ZodObject<{
9050
+ event_type: z.ZodLiteral<"graph_edge_candidate_requested">;
9051
+ stable_id: z.ZodString;
9052
+ store: z.ZodOptional<z.ZodString>;
9010
9053
  kind: z.ZodLiteral<"fabric-event">;
9011
9054
  id: z.ZodString;
9012
9055
  ts: z.ZodNumber;
@@ -9015,28 +9058,36 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9015
9058
  session_id: z.ZodOptional<z.ZodString>;
9016
9059
  }, "strip", z.ZodTypeAny, {
9017
9060
  id: string;
9061
+ stable_id: string;
9018
9062
  ts: number;
9019
9063
  schema_version: 1;
9020
9064
  kind: "fabric-event";
9021
- event_type: "claude_skill_path_migrated";
9022
- from: string;
9023
- to: string;
9065
+ event_type: "graph_edge_candidate_requested";
9024
9066
  correlation_id?: string | undefined;
9025
9067
  session_id?: string | undefined;
9068
+ store?: string | undefined;
9026
9069
  }, {
9027
9070
  id: string;
9071
+ stable_id: string;
9028
9072
  ts: number;
9029
9073
  schema_version: 1;
9030
9074
  kind: "fabric-event";
9031
- event_type: "claude_skill_path_migrated";
9032
- from: string;
9033
- to: string;
9075
+ event_type: "graph_edge_candidate_requested";
9034
9076
  correlation_id?: string | undefined;
9035
9077
  session_id?: string | undefined;
9036
- }>, z.ZodObject<{
9037
- event_type: z.ZodLiteral<"claude_hook_path_migrated">;
9038
- from: z.ZodString;
9039
- to: z.ZodString;
9078
+ store?: string | undefined;
9079
+ }>;
9080
+ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
9081
+ event_type: z.ZodLiteral<"knowledge_context_planned">;
9082
+ target_paths: z.ZodArray<z.ZodString, "many">;
9083
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
9084
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
9085
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
9086
+ selection_token: z.ZodOptional<z.ZodString>;
9087
+ client_hash: z.ZodOptional<z.ZodString>;
9088
+ intent: z.ZodOptional<z.ZodString>;
9089
+ known_tech: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9090
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
9040
9091
  kind: z.ZodLiteral<"fabric-event">;
9041
9092
  id: z.ZodString;
9042
9093
  ts: z.ZodNumber;
@@ -9045,28 +9096,49 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9045
9096
  session_id: z.ZodOptional<z.ZodString>;
9046
9097
  }, "strip", z.ZodTypeAny, {
9047
9098
  id: string;
9099
+ target_paths: string[];
9048
9100
  ts: number;
9049
9101
  schema_version: 1;
9050
9102
  kind: "fabric-event";
9051
- event_type: "claude_hook_path_migrated";
9052
- from: string;
9053
- to: string;
9103
+ event_type: "knowledge_context_planned";
9104
+ required_stable_ids: string[];
9105
+ ai_selectable_stable_ids: string[];
9106
+ final_stable_ids: string[];
9107
+ known_tech?: string[] | undefined;
9108
+ intent?: string | undefined;
9109
+ client_hash?: string | undefined;
9054
9110
  correlation_id?: string | undefined;
9055
9111
  session_id?: string | undefined;
9112
+ selection_token?: string | undefined;
9113
+ diagnostics?: unknown[] | undefined;
9056
9114
  }, {
9057
9115
  id: string;
9116
+ target_paths: string[];
9058
9117
  ts: number;
9059
9118
  schema_version: 1;
9060
9119
  kind: "fabric-event";
9061
- event_type: "claude_hook_path_migrated";
9062
- from: string;
9063
- to: string;
9120
+ event_type: "knowledge_context_planned";
9121
+ required_stable_ids: string[];
9122
+ ai_selectable_stable_ids: string[];
9123
+ final_stable_ids: string[];
9124
+ known_tech?: string[] | undefined;
9125
+ intent?: string | undefined;
9126
+ client_hash?: string | undefined;
9064
9127
  correlation_id?: string | undefined;
9065
9128
  session_id?: string | undefined;
9129
+ selection_token?: string | undefined;
9130
+ diagnostics?: unknown[] | undefined;
9066
9131
  }>, z.ZodObject<{
9067
- event_type: z.ZodLiteral<"codex_skill_path_migrated">;
9068
- from: z.ZodString;
9069
- to: z.ZodString;
9132
+ event_type: z.ZodLiteral<"knowledge_selection">;
9133
+ selection_token: z.ZodString;
9134
+ target_paths: z.ZodArray<z.ZodString, "many">;
9135
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
9136
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
9137
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
9138
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
9139
+ ai_selection_reasons: z.ZodRecord<z.ZodString, z.ZodString>;
9140
+ rejected_stable_ids: z.ZodArray<z.ZodString, "many">;
9141
+ ignored_stable_ids: z.ZodArray<z.ZodString, "many">;
9070
9142
  kind: z.ZodLiteral<"fabric-event">;
9071
9143
  id: z.ZodString;
9072
9144
  ts: z.ZodNumber;
@@ -9075,29 +9147,46 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9075
9147
  session_id: z.ZodOptional<z.ZodString>;
9076
9148
  }, "strip", z.ZodTypeAny, {
9077
9149
  id: string;
9150
+ target_paths: string[];
9151
+ selection_token: string;
9152
+ ai_selected_stable_ids: string[];
9153
+ ai_selection_reasons: Record<string, string>;
9078
9154
  ts: number;
9079
9155
  schema_version: 1;
9080
9156
  kind: "fabric-event";
9081
- event_type: "codex_skill_path_migrated";
9082
- from: string;
9083
- to: string;
9157
+ event_type: "knowledge_selection";
9158
+ required_stable_ids: string[];
9159
+ ai_selectable_stable_ids: string[];
9160
+ final_stable_ids: string[];
9161
+ rejected_stable_ids: string[];
9162
+ ignored_stable_ids: string[];
9084
9163
  correlation_id?: string | undefined;
9085
9164
  session_id?: string | undefined;
9086
9165
  }, {
9087
9166
  id: string;
9167
+ target_paths: string[];
9168
+ selection_token: string;
9169
+ ai_selected_stable_ids: string[];
9170
+ ai_selection_reasons: Record<string, string>;
9088
9171
  ts: number;
9089
9172
  schema_version: 1;
9090
9173
  kind: "fabric-event";
9091
- event_type: "codex_skill_path_migrated";
9092
- from: string;
9093
- to: string;
9174
+ event_type: "knowledge_selection";
9175
+ required_stable_ids: string[];
9176
+ ai_selectable_stable_ids: string[];
9177
+ final_stable_ids: string[];
9178
+ rejected_stable_ids: string[];
9179
+ ignored_stable_ids: string[];
9094
9180
  correlation_id?: string | undefined;
9095
9181
  session_id?: string | undefined;
9096
9182
  }>, z.ZodObject<{
9097
- event_type: z.ZodLiteral<"init_scan_completed">;
9098
- written_stable_ids: z.ZodArray<z.ZodString, "many">;
9099
- duration_ms: z.ZodNumber;
9100
- source: z.ZodOptional<z.ZodEnum<["init", "scan", "doctor_fix", "doctor-rescan"]>>;
9183
+ event_type: z.ZodLiteral<"knowledge_sections_fetched">;
9184
+ selection_token: z.ZodString;
9185
+ target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9186
+ requested_sections: z.ZodArray<z.ZodString, "many">;
9187
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
9188
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
9189
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
9101
9190
  kind: z.ZodLiteral<"fabric-event">;
9102
9191
  id: z.ZodString;
9103
9192
  ts: z.ZodNumber;
@@ -9106,31 +9195,839 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9106
9195
  session_id: z.ZodOptional<z.ZodString>;
9107
9196
  }, "strip", z.ZodTypeAny, {
9108
9197
  id: string;
9198
+ selection_token: string;
9199
+ ai_selected_stable_ids: string[];
9109
9200
  ts: number;
9110
9201
  schema_version: 1;
9111
9202
  kind: "fabric-event";
9112
- event_type: "init_scan_completed";
9113
- duration_ms: number;
9114
- written_stable_ids: string[];
9203
+ event_type: "knowledge_sections_fetched";
9204
+ final_stable_ids: string[];
9205
+ requested_sections: string[];
9115
9206
  correlation_id?: string | undefined;
9116
9207
  session_id?: string | undefined;
9117
- source?: "init" | "doctor_fix" | "scan" | "doctor-rescan" | undefined;
9208
+ target_paths?: string[] | undefined;
9209
+ diagnostics?: unknown[] | undefined;
9118
9210
  }, {
9119
9211
  id: string;
9212
+ selection_token: string;
9213
+ ai_selected_stable_ids: string[];
9120
9214
  ts: number;
9121
9215
  schema_version: 1;
9122
9216
  kind: "fabric-event";
9123
- event_type: "init_scan_completed";
9124
- duration_ms: number;
9125
- written_stable_ids: string[];
9217
+ event_type: "knowledge_sections_fetched";
9218
+ final_stable_ids: string[];
9219
+ requested_sections: string[];
9126
9220
  correlation_id?: string | undefined;
9127
9221
  session_id?: string | undefined;
9128
- source?: "init" | "doctor_fix" | "scan" | "doctor-rescan" | undefined;
9222
+ target_paths?: string[] | undefined;
9223
+ diagnostics?: unknown[] | undefined;
9129
9224
  }>, z.ZodObject<{
9130
- event_type: z.ZodLiteral<"knowledge_proposed">;
9131
- stable_id: z.ZodOptional<z.ZodString>;
9132
- timestamp: z.ZodString;
9133
- reason: z.ZodOptional<z.ZodString>;
9225
+ event_type: z.ZodLiteral<"edit_intent_checked">;
9226
+ path: z.ZodString;
9227
+ compliant: z.ZodBoolean;
9228
+ intent: z.ZodString;
9229
+ ledger_entry_id: z.ZodString;
9230
+ ledger_source: z.ZodOptional<z.ZodEnum<["ai", "human", "hook"]>>;
9231
+ commit_sha: z.ZodOptional<z.ZodString>;
9232
+ parent_sha: z.ZodOptional<z.ZodString>;
9233
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
9234
+ diff_stat: z.ZodOptional<z.ZodString>;
9235
+ annotation: z.ZodOptional<z.ZodString>;
9236
+ matched_rule_context_ts: z.ZodNullable<z.ZodNumber>;
9237
+ window_ms: z.ZodNumber;
9238
+ kind: z.ZodLiteral<"fabric-event">;
9239
+ id: z.ZodString;
9240
+ ts: z.ZodNumber;
9241
+ schema_version: z.ZodLiteral<1>;
9242
+ correlation_id: z.ZodOptional<z.ZodString>;
9243
+ session_id: z.ZodOptional<z.ZodString>;
9244
+ }, "strip", z.ZodTypeAny, {
9245
+ path: string;
9246
+ id: string;
9247
+ intent: string;
9248
+ ts: number;
9249
+ ledger_entry_id: string;
9250
+ schema_version: 1;
9251
+ kind: "fabric-event";
9252
+ event_type: "edit_intent_checked";
9253
+ compliant: boolean;
9254
+ matched_rule_context_ts: number | null;
9255
+ window_ms: number;
9256
+ correlation_id?: string | undefined;
9257
+ session_id?: string | undefined;
9258
+ annotation?: string | undefined;
9259
+ commit_sha?: string | undefined;
9260
+ parent_sha?: string | undefined;
9261
+ parent_ledger_entry_id?: string | undefined;
9262
+ diff_stat?: string | undefined;
9263
+ ledger_source?: "ai" | "human" | "hook" | undefined;
9264
+ }, {
9265
+ path: string;
9266
+ id: string;
9267
+ intent: string;
9268
+ ts: number;
9269
+ ledger_entry_id: string;
9270
+ schema_version: 1;
9271
+ kind: "fabric-event";
9272
+ event_type: "edit_intent_checked";
9273
+ compliant: boolean;
9274
+ matched_rule_context_ts: number | null;
9275
+ window_ms: number;
9276
+ correlation_id?: string | undefined;
9277
+ session_id?: string | undefined;
9278
+ annotation?: string | undefined;
9279
+ commit_sha?: string | undefined;
9280
+ parent_sha?: string | undefined;
9281
+ parent_ledger_entry_id?: string | undefined;
9282
+ diff_stat?: string | undefined;
9283
+ ledger_source?: "ai" | "human" | "hook" | undefined;
9284
+ }>, z.ZodObject<{
9285
+ event_type: z.ZodLiteral<"knowledge_drift_detected">;
9286
+ revision: z.ZodOptional<z.ZodString>;
9287
+ drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
9288
+ missing_files: z.ZodArray<z.ZodString, "many">;
9289
+ stale_files: z.ZodArray<z.ZodString, "many">;
9290
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
9291
+ file: z.ZodString;
9292
+ stable_id: z.ZodString;
9293
+ expected_hash: z.ZodString;
9294
+ actual_hash: z.ZodNullable<z.ZodString>;
9295
+ }, "strip", z.ZodTypeAny, {
9296
+ file: string;
9297
+ stable_id: string;
9298
+ expected_hash: string;
9299
+ actual_hash: string | null;
9300
+ }, {
9301
+ file: string;
9302
+ stable_id: string;
9303
+ expected_hash: string;
9304
+ actual_hash: string | null;
9305
+ }>, "many">>;
9306
+ kind: z.ZodLiteral<"fabric-event">;
9307
+ id: z.ZodString;
9308
+ ts: z.ZodNumber;
9309
+ schema_version: z.ZodLiteral<1>;
9310
+ correlation_id: z.ZodOptional<z.ZodString>;
9311
+ session_id: z.ZodOptional<z.ZodString>;
9312
+ }, "strip", z.ZodTypeAny, {
9313
+ id: string;
9314
+ ts: number;
9315
+ schema_version: 1;
9316
+ kind: "fabric-event";
9317
+ event_type: "knowledge_drift_detected";
9318
+ drifted_stable_ids: string[];
9319
+ missing_files: string[];
9320
+ stale_files: string[];
9321
+ correlation_id?: string | undefined;
9322
+ session_id?: string | undefined;
9323
+ revision?: string | undefined;
9324
+ details?: {
9325
+ file: string;
9326
+ stable_id: string;
9327
+ expected_hash: string;
9328
+ actual_hash: string | null;
9329
+ }[] | undefined;
9330
+ }, {
9331
+ id: string;
9332
+ ts: number;
9333
+ schema_version: 1;
9334
+ kind: "fabric-event";
9335
+ event_type: "knowledge_drift_detected";
9336
+ drifted_stable_ids: string[];
9337
+ missing_files: string[];
9338
+ stale_files: string[];
9339
+ correlation_id?: string | undefined;
9340
+ session_id?: string | undefined;
9341
+ revision?: string | undefined;
9342
+ details?: {
9343
+ file: string;
9344
+ stable_id: string;
9345
+ expected_hash: string;
9346
+ actual_hash: string | null;
9347
+ }[] | undefined;
9348
+ }>, z.ZodObject<{
9349
+ event_type: z.ZodLiteral<"mcp_event">;
9350
+ mcp_event_id: z.ZodString;
9351
+ stream_id: z.ZodString;
9352
+ message: z.ZodUnknown;
9353
+ kind: z.ZodLiteral<"fabric-event">;
9354
+ id: z.ZodString;
9355
+ ts: z.ZodNumber;
9356
+ schema_version: z.ZodLiteral<1>;
9357
+ correlation_id: z.ZodOptional<z.ZodString>;
9358
+ session_id: z.ZodOptional<z.ZodString>;
9359
+ }, "strip", z.ZodTypeAny, {
9360
+ id: string;
9361
+ ts: number;
9362
+ schema_version: 1;
9363
+ kind: "fabric-event";
9364
+ event_type: "mcp_event";
9365
+ mcp_event_id: string;
9366
+ stream_id: string;
9367
+ message?: unknown;
9368
+ correlation_id?: string | undefined;
9369
+ session_id?: string | undefined;
9370
+ }, {
9371
+ id: string;
9372
+ ts: number;
9373
+ schema_version: 1;
9374
+ kind: "fabric-event";
9375
+ event_type: "mcp_event";
9376
+ mcp_event_id: string;
9377
+ stream_id: string;
9378
+ message?: unknown;
9379
+ correlation_id?: string | undefined;
9380
+ session_id?: string | undefined;
9381
+ }>, z.ZodObject<{
9382
+ event_type: z.ZodLiteral<"reapply_completed">;
9383
+ preserved_ledger: z.ZodBoolean;
9384
+ preserved_meta: z.ZodBoolean;
9385
+ rules_count: z.ZodNumber;
9386
+ kind: z.ZodLiteral<"fabric-event">;
9387
+ id: z.ZodString;
9388
+ ts: z.ZodNumber;
9389
+ schema_version: z.ZodLiteral<1>;
9390
+ correlation_id: z.ZodOptional<z.ZodString>;
9391
+ session_id: z.ZodOptional<z.ZodString>;
9392
+ }, "strip", z.ZodTypeAny, {
9393
+ id: string;
9394
+ ts: number;
9395
+ schema_version: 1;
9396
+ kind: "fabric-event";
9397
+ event_type: "reapply_completed";
9398
+ preserved_ledger: boolean;
9399
+ preserved_meta: boolean;
9400
+ rules_count: number;
9401
+ correlation_id?: string | undefined;
9402
+ session_id?: string | undefined;
9403
+ }, {
9404
+ id: string;
9405
+ ts: number;
9406
+ schema_version: 1;
9407
+ kind: "fabric-event";
9408
+ event_type: "reapply_completed";
9409
+ preserved_ledger: boolean;
9410
+ preserved_meta: boolean;
9411
+ rules_count: number;
9412
+ correlation_id?: string | undefined;
9413
+ session_id?: string | undefined;
9414
+ }>, z.ZodObject<{
9415
+ event_type: z.ZodLiteral<"install_diff_applied">;
9416
+ applied: z.ZodArray<z.ZodString, "many">;
9417
+ canonical: z.ZodArray<z.ZodString, "many">;
9418
+ drifted: z.ZodArray<z.ZodString, "many">;
9419
+ kind: z.ZodLiteral<"fabric-event">;
9420
+ id: z.ZodString;
9421
+ ts: z.ZodNumber;
9422
+ schema_version: z.ZodLiteral<1>;
9423
+ correlation_id: z.ZodOptional<z.ZodString>;
9424
+ session_id: z.ZodOptional<z.ZodString>;
9425
+ }, "strip", z.ZodTypeAny, {
9426
+ id: string;
9427
+ canonical: string[];
9428
+ drifted: string[];
9429
+ ts: number;
9430
+ schema_version: 1;
9431
+ kind: "fabric-event";
9432
+ applied: string[];
9433
+ event_type: "install_diff_applied";
9434
+ correlation_id?: string | undefined;
9435
+ session_id?: string | undefined;
9436
+ }, {
9437
+ id: string;
9438
+ canonical: string[];
9439
+ drifted: string[];
9440
+ ts: number;
9441
+ schema_version: 1;
9442
+ kind: "fabric-event";
9443
+ applied: string[];
9444
+ event_type: "install_diff_applied";
9445
+ correlation_id?: string | undefined;
9446
+ session_id?: string | undefined;
9447
+ }>, z.ZodObject<{
9448
+ event_type: z.ZodLiteral<"event_ledger_truncated">;
9449
+ byte_offset: z.ZodNumber;
9450
+ byte_length: z.ZodNumber;
9451
+ corrupted_path: z.ZodString;
9452
+ kind: z.ZodLiteral<"fabric-event">;
9453
+ id: z.ZodString;
9454
+ ts: z.ZodNumber;
9455
+ schema_version: z.ZodLiteral<1>;
9456
+ correlation_id: z.ZodOptional<z.ZodString>;
9457
+ session_id: z.ZodOptional<z.ZodString>;
9458
+ }, "strip", z.ZodTypeAny, {
9459
+ id: string;
9460
+ ts: number;
9461
+ schema_version: 1;
9462
+ kind: "fabric-event";
9463
+ event_type: "event_ledger_truncated";
9464
+ byte_offset: number;
9465
+ byte_length: number;
9466
+ corrupted_path: string;
9467
+ correlation_id?: string | undefined;
9468
+ session_id?: string | undefined;
9469
+ }, {
9470
+ id: string;
9471
+ ts: number;
9472
+ schema_version: 1;
9473
+ kind: "fabric-event";
9474
+ event_type: "event_ledger_truncated";
9475
+ byte_offset: number;
9476
+ byte_length: number;
9477
+ corrupted_path: string;
9478
+ correlation_id?: string | undefined;
9479
+ session_id?: string | undefined;
9480
+ }>, z.ZodObject<{
9481
+ event_type: z.ZodLiteral<"mcp_config_migrated">;
9482
+ source: z.ZodLiteral<"doctor_fix">;
9483
+ removed_from: z.ZodString;
9484
+ kind: z.ZodLiteral<"fabric-event">;
9485
+ id: z.ZodString;
9486
+ ts: z.ZodNumber;
9487
+ schema_version: z.ZodLiteral<1>;
9488
+ correlation_id: z.ZodOptional<z.ZodString>;
9489
+ session_id: z.ZodOptional<z.ZodString>;
9490
+ }, "strip", z.ZodTypeAny, {
9491
+ id: string;
9492
+ source: "doctor_fix";
9493
+ ts: number;
9494
+ schema_version: 1;
9495
+ kind: "fabric-event";
9496
+ event_type: "mcp_config_migrated";
9497
+ removed_from: string;
9498
+ correlation_id?: string | undefined;
9499
+ session_id?: string | undefined;
9500
+ }, {
9501
+ id: string;
9502
+ source: "doctor_fix";
9503
+ ts: number;
9504
+ schema_version: 1;
9505
+ kind: "fabric-event";
9506
+ event_type: "mcp_config_migrated";
9507
+ removed_from: string;
9508
+ correlation_id?: string | undefined;
9509
+ session_id?: string | undefined;
9510
+ }>, z.ZodObject<{
9511
+ event_type: z.ZodLiteral<"bootstrap_marker_migrated">;
9512
+ path: z.ZodString;
9513
+ migrated_count: z.ZodNumber;
9514
+ legacy_marker: z.ZodLiteral<"fabric:knowledge-base">;
9515
+ new_marker: z.ZodLiteral<"fabric:bootstrap">;
9516
+ timestamp: z.ZodString;
9517
+ kind: z.ZodLiteral<"fabric-event">;
9518
+ id: z.ZodString;
9519
+ ts: z.ZodNumber;
9520
+ schema_version: z.ZodLiteral<1>;
9521
+ correlation_id: z.ZodOptional<z.ZodString>;
9522
+ session_id: z.ZodOptional<z.ZodString>;
9523
+ }, "strip", z.ZodTypeAny, {
9524
+ path: string;
9525
+ id: string;
9526
+ ts: number;
9527
+ schema_version: 1;
9528
+ kind: "fabric-event";
9529
+ event_type: "bootstrap_marker_migrated";
9530
+ migrated_count: number;
9531
+ legacy_marker: "fabric:knowledge-base";
9532
+ new_marker: "fabric:bootstrap";
9533
+ timestamp: string;
9534
+ correlation_id?: string | undefined;
9535
+ session_id?: string | undefined;
9536
+ }, {
9537
+ path: string;
9538
+ id: string;
9539
+ ts: number;
9540
+ schema_version: 1;
9541
+ kind: "fabric-event";
9542
+ event_type: "bootstrap_marker_migrated";
9543
+ migrated_count: number;
9544
+ legacy_marker: "fabric:knowledge-base";
9545
+ new_marker: "fabric:bootstrap";
9546
+ timestamp: string;
9547
+ correlation_id?: string | undefined;
9548
+ session_id?: string | undefined;
9549
+ }>, z.ZodObject<{
9550
+ event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
9551
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
9552
+ duration_ms: z.ZodNumber;
9553
+ source: z.ZodLiteral<"reconcileKnowledge">;
9554
+ kind: z.ZodLiteral<"fabric-event">;
9555
+ id: z.ZodString;
9556
+ ts: z.ZodNumber;
9557
+ schema_version: z.ZodLiteral<1>;
9558
+ correlation_id: z.ZodOptional<z.ZodString>;
9559
+ session_id: z.ZodOptional<z.ZodString>;
9560
+ }, "strip", z.ZodTypeAny, {
9561
+ id: string;
9562
+ source: "reconcileKnowledge";
9563
+ ts: number;
9564
+ schema_version: 1;
9565
+ kind: "fabric-event";
9566
+ event_type: "meta_reconciled_on_startup";
9567
+ reconciled_files: string[];
9568
+ duration_ms: number;
9569
+ correlation_id?: string | undefined;
9570
+ session_id?: string | undefined;
9571
+ }, {
9572
+ id: string;
9573
+ source: "reconcileKnowledge";
9574
+ ts: number;
9575
+ schema_version: 1;
9576
+ kind: "fabric-event";
9577
+ event_type: "meta_reconciled_on_startup";
9578
+ reconciled_files: string[];
9579
+ duration_ms: number;
9580
+ correlation_id?: string | undefined;
9581
+ session_id?: string | undefined;
9582
+ }>, z.ZodObject<{
9583
+ event_type: z.ZodLiteral<"meta_reconciled">;
9584
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
9585
+ duration_ms: z.ZodNumber;
9586
+ trigger: z.ZodEnum<["doctor", "manual", "auto-heal-description", "auto-heal-after-drift", "post-approve", "post-modify"]>;
9587
+ source: z.ZodLiteral<"reconcileKnowledge">;
9588
+ force_write_reason: z.ZodOptional<z.ZodEnum<["revision_drift"]>>;
9589
+ kind: z.ZodLiteral<"fabric-event">;
9590
+ id: z.ZodString;
9591
+ ts: z.ZodNumber;
9592
+ schema_version: z.ZodLiteral<1>;
9593
+ correlation_id: z.ZodOptional<z.ZodString>;
9594
+ session_id: z.ZodOptional<z.ZodString>;
9595
+ }, "strip", z.ZodTypeAny, {
9596
+ id: string;
9597
+ source: "reconcileKnowledge";
9598
+ ts: number;
9599
+ schema_version: 1;
9600
+ kind: "fabric-event";
9601
+ event_type: "meta_reconciled";
9602
+ reconciled_files: string[];
9603
+ duration_ms: number;
9604
+ trigger: "manual" | "doctor" | "auto-heal-description" | "auto-heal-after-drift" | "post-approve" | "post-modify";
9605
+ correlation_id?: string | undefined;
9606
+ session_id?: string | undefined;
9607
+ force_write_reason?: "revision_drift" | undefined;
9608
+ }, {
9609
+ id: string;
9610
+ source: "reconcileKnowledge";
9611
+ ts: number;
9612
+ schema_version: 1;
9613
+ kind: "fabric-event";
9614
+ event_type: "meta_reconciled";
9615
+ reconciled_files: string[];
9616
+ duration_ms: number;
9617
+ trigger: "manual" | "doctor" | "auto-heal-description" | "auto-heal-after-drift" | "post-approve" | "post-modify";
9618
+ correlation_id?: string | undefined;
9619
+ session_id?: string | undefined;
9620
+ force_write_reason?: "revision_drift" | undefined;
9621
+ }>, z.ZodObject<{
9622
+ event_type: z.ZodLiteral<"claude_skill_path_migrated">;
9623
+ from: z.ZodString;
9624
+ to: z.ZodString;
9625
+ kind: z.ZodLiteral<"fabric-event">;
9626
+ id: z.ZodString;
9627
+ ts: z.ZodNumber;
9628
+ schema_version: z.ZodLiteral<1>;
9629
+ correlation_id: z.ZodOptional<z.ZodString>;
9630
+ session_id: z.ZodOptional<z.ZodString>;
9631
+ }, "strip", z.ZodTypeAny, {
9632
+ id: string;
9633
+ ts: number;
9634
+ schema_version: 1;
9635
+ kind: "fabric-event";
9636
+ event_type: "claude_skill_path_migrated";
9637
+ from: string;
9638
+ to: string;
9639
+ correlation_id?: string | undefined;
9640
+ session_id?: string | undefined;
9641
+ }, {
9642
+ id: string;
9643
+ ts: number;
9644
+ schema_version: 1;
9645
+ kind: "fabric-event";
9646
+ event_type: "claude_skill_path_migrated";
9647
+ from: string;
9648
+ to: string;
9649
+ correlation_id?: string | undefined;
9650
+ session_id?: string | undefined;
9651
+ }>, z.ZodObject<{
9652
+ event_type: z.ZodLiteral<"claude_hook_path_migrated">;
9653
+ from: z.ZodString;
9654
+ to: z.ZodString;
9655
+ kind: z.ZodLiteral<"fabric-event">;
9656
+ id: z.ZodString;
9657
+ ts: z.ZodNumber;
9658
+ schema_version: z.ZodLiteral<1>;
9659
+ correlation_id: z.ZodOptional<z.ZodString>;
9660
+ session_id: z.ZodOptional<z.ZodString>;
9661
+ }, "strip", z.ZodTypeAny, {
9662
+ id: string;
9663
+ ts: number;
9664
+ schema_version: 1;
9665
+ kind: "fabric-event";
9666
+ event_type: "claude_hook_path_migrated";
9667
+ from: string;
9668
+ to: string;
9669
+ correlation_id?: string | undefined;
9670
+ session_id?: string | undefined;
9671
+ }, {
9672
+ id: string;
9673
+ ts: number;
9674
+ schema_version: 1;
9675
+ kind: "fabric-event";
9676
+ event_type: "claude_hook_path_migrated";
9677
+ from: string;
9678
+ to: string;
9679
+ correlation_id?: string | undefined;
9680
+ session_id?: string | undefined;
9681
+ }>, z.ZodObject<{
9682
+ event_type: z.ZodLiteral<"codex_skill_path_migrated">;
9683
+ from: z.ZodString;
9684
+ to: z.ZodString;
9685
+ kind: z.ZodLiteral<"fabric-event">;
9686
+ id: z.ZodString;
9687
+ ts: z.ZodNumber;
9688
+ schema_version: z.ZodLiteral<1>;
9689
+ correlation_id: z.ZodOptional<z.ZodString>;
9690
+ session_id: z.ZodOptional<z.ZodString>;
9691
+ }, "strip", z.ZodTypeAny, {
9692
+ id: string;
9693
+ ts: number;
9694
+ schema_version: 1;
9695
+ kind: "fabric-event";
9696
+ event_type: "codex_skill_path_migrated";
9697
+ from: string;
9698
+ to: string;
9699
+ correlation_id?: string | undefined;
9700
+ session_id?: string | undefined;
9701
+ }, {
9702
+ id: string;
9703
+ ts: number;
9704
+ schema_version: 1;
9705
+ kind: "fabric-event";
9706
+ event_type: "codex_skill_path_migrated";
9707
+ from: string;
9708
+ to: string;
9709
+ correlation_id?: string | undefined;
9710
+ session_id?: string | undefined;
9711
+ }>, z.ZodObject<{
9712
+ event_type: z.ZodLiteral<"init_scan_completed">;
9713
+ written_stable_ids: z.ZodArray<z.ZodString, "many">;
9714
+ duration_ms: z.ZodNumber;
9715
+ source: z.ZodOptional<z.ZodEnum<["init", "scan", "doctor_fix", "doctor-rescan"]>>;
9716
+ kind: z.ZodLiteral<"fabric-event">;
9717
+ id: z.ZodString;
9718
+ ts: z.ZodNumber;
9719
+ schema_version: z.ZodLiteral<1>;
9720
+ correlation_id: z.ZodOptional<z.ZodString>;
9721
+ session_id: z.ZodOptional<z.ZodString>;
9722
+ }, "strip", z.ZodTypeAny, {
9723
+ id: string;
9724
+ ts: number;
9725
+ schema_version: 1;
9726
+ kind: "fabric-event";
9727
+ event_type: "init_scan_completed";
9728
+ duration_ms: number;
9729
+ written_stable_ids: string[];
9730
+ correlation_id?: string | undefined;
9731
+ session_id?: string | undefined;
9732
+ source?: "init" | "doctor_fix" | "scan" | "doctor-rescan" | undefined;
9733
+ }, {
9734
+ id: string;
9735
+ ts: number;
9736
+ schema_version: 1;
9737
+ kind: "fabric-event";
9738
+ event_type: "init_scan_completed";
9739
+ duration_ms: number;
9740
+ written_stable_ids: string[];
9741
+ correlation_id?: string | undefined;
9742
+ session_id?: string | undefined;
9743
+ source?: "init" | "doctor_fix" | "scan" | "doctor-rescan" | undefined;
9744
+ }>, z.ZodObject<{
9745
+ event_type: z.ZodLiteral<"knowledge_proposed">;
9746
+ stable_id: z.ZodOptional<z.ZodString>;
9747
+ timestamp: z.ZodString;
9748
+ reason: z.ZodOptional<z.ZodString>;
9749
+ kind: z.ZodLiteral<"fabric-event">;
9750
+ id: z.ZodString;
9751
+ ts: z.ZodNumber;
9752
+ schema_version: z.ZodLiteral<1>;
9753
+ correlation_id: z.ZodOptional<z.ZodString>;
9754
+ session_id: z.ZodOptional<z.ZodString>;
9755
+ }, "strip", z.ZodTypeAny, {
9756
+ id: string;
9757
+ ts: number;
9758
+ schema_version: 1;
9759
+ kind: "fabric-event";
9760
+ event_type: "knowledge_proposed";
9761
+ timestamp: string;
9762
+ stable_id?: string | undefined;
9763
+ correlation_id?: string | undefined;
9764
+ session_id?: string | undefined;
9765
+ reason?: string | undefined;
9766
+ }, {
9767
+ id: string;
9768
+ ts: number;
9769
+ schema_version: 1;
9770
+ kind: "fabric-event";
9771
+ event_type: "knowledge_proposed";
9772
+ timestamp: string;
9773
+ stable_id?: string | undefined;
9774
+ correlation_id?: string | undefined;
9775
+ session_id?: string | undefined;
9776
+ reason?: string | undefined;
9777
+ }>, z.ZodObject<{
9778
+ event_type: z.ZodLiteral<"knowledge_promote_started">;
9779
+ stable_id: z.ZodOptional<z.ZodString>;
9780
+ timestamp: z.ZodString;
9781
+ reason: z.ZodOptional<z.ZodString>;
9782
+ kind: z.ZodLiteral<"fabric-event">;
9783
+ id: z.ZodString;
9784
+ ts: z.ZodNumber;
9785
+ schema_version: z.ZodLiteral<1>;
9786
+ correlation_id: z.ZodOptional<z.ZodString>;
9787
+ session_id: z.ZodOptional<z.ZodString>;
9788
+ }, "strip", z.ZodTypeAny, {
9789
+ id: string;
9790
+ ts: number;
9791
+ schema_version: 1;
9792
+ kind: "fabric-event";
9793
+ event_type: "knowledge_promote_started";
9794
+ timestamp: string;
9795
+ stable_id?: string | undefined;
9796
+ correlation_id?: string | undefined;
9797
+ session_id?: string | undefined;
9798
+ reason?: string | undefined;
9799
+ }, {
9800
+ id: string;
9801
+ ts: number;
9802
+ schema_version: 1;
9803
+ kind: "fabric-event";
9804
+ event_type: "knowledge_promote_started";
9805
+ timestamp: string;
9806
+ stable_id?: string | undefined;
9807
+ correlation_id?: string | undefined;
9808
+ session_id?: string | undefined;
9809
+ reason?: string | undefined;
9810
+ }>, z.ZodObject<{
9811
+ event_type: z.ZodLiteral<"knowledge_promoted">;
9812
+ stable_id: z.ZodOptional<z.ZodString>;
9813
+ timestamp: z.ZodString;
9814
+ reason: z.ZodOptional<z.ZodString>;
9815
+ kind: z.ZodLiteral<"fabric-event">;
9816
+ id: z.ZodString;
9817
+ ts: z.ZodNumber;
9818
+ schema_version: z.ZodLiteral<1>;
9819
+ correlation_id: z.ZodOptional<z.ZodString>;
9820
+ session_id: z.ZodOptional<z.ZodString>;
9821
+ }, "strip", z.ZodTypeAny, {
9822
+ id: string;
9823
+ ts: number;
9824
+ schema_version: 1;
9825
+ kind: "fabric-event";
9826
+ event_type: "knowledge_promoted";
9827
+ timestamp: string;
9828
+ stable_id?: string | undefined;
9829
+ correlation_id?: string | undefined;
9830
+ session_id?: string | undefined;
9831
+ reason?: string | undefined;
9832
+ }, {
9833
+ id: string;
9834
+ ts: number;
9835
+ schema_version: 1;
9836
+ kind: "fabric-event";
9837
+ event_type: "knowledge_promoted";
9838
+ timestamp: string;
9839
+ stable_id?: string | undefined;
9840
+ correlation_id?: string | undefined;
9841
+ session_id?: string | undefined;
9842
+ reason?: string | undefined;
9843
+ }>, z.ZodObject<{
9844
+ event_type: z.ZodLiteral<"knowledge_promote_failed">;
9845
+ stable_id: z.ZodOptional<z.ZodString>;
9846
+ timestamp: z.ZodString;
9847
+ reason: z.ZodString;
9848
+ kind: z.ZodLiteral<"fabric-event">;
9849
+ id: z.ZodString;
9850
+ ts: z.ZodNumber;
9851
+ schema_version: z.ZodLiteral<1>;
9852
+ correlation_id: z.ZodOptional<z.ZodString>;
9853
+ session_id: z.ZodOptional<z.ZodString>;
9854
+ }, "strip", z.ZodTypeAny, {
9855
+ id: string;
9856
+ reason: string;
9857
+ ts: number;
9858
+ schema_version: 1;
9859
+ kind: "fabric-event";
9860
+ event_type: "knowledge_promote_failed";
9861
+ timestamp: string;
9862
+ stable_id?: string | undefined;
9863
+ correlation_id?: string | undefined;
9864
+ session_id?: string | undefined;
9865
+ }, {
9866
+ id: string;
9867
+ reason: string;
9868
+ ts: number;
9869
+ schema_version: 1;
9870
+ kind: "fabric-event";
9871
+ event_type: "knowledge_promote_failed";
9872
+ timestamp: string;
9873
+ stable_id?: string | undefined;
9874
+ correlation_id?: string | undefined;
9875
+ session_id?: string | undefined;
9876
+ }>, z.ZodObject<{
9877
+ event_type: z.ZodLiteral<"knowledge_layer_changed">;
9878
+ stable_id: z.ZodOptional<z.ZodString>;
9879
+ timestamp: z.ZodString;
9880
+ reason: z.ZodOptional<z.ZodString>;
9881
+ from_layer: z.ZodEnum<["team", "personal"]>;
9882
+ to_layer: z.ZodEnum<["team", "personal"]>;
9883
+ previous_stable_id: z.ZodOptional<z.ZodString>;
9884
+ kind: z.ZodLiteral<"fabric-event">;
9885
+ id: z.ZodString;
9886
+ ts: z.ZodNumber;
9887
+ schema_version: z.ZodLiteral<1>;
9888
+ correlation_id: z.ZodOptional<z.ZodString>;
9889
+ session_id: z.ZodOptional<z.ZodString>;
9890
+ }, "strip", z.ZodTypeAny, {
9891
+ id: string;
9892
+ ts: number;
9893
+ schema_version: 1;
9894
+ kind: "fabric-event";
9895
+ event_type: "knowledge_layer_changed";
9896
+ timestamp: string;
9897
+ from_layer: "personal" | "team";
9898
+ to_layer: "personal" | "team";
9899
+ stable_id?: string | undefined;
9900
+ correlation_id?: string | undefined;
9901
+ session_id?: string | undefined;
9902
+ reason?: string | undefined;
9903
+ previous_stable_id?: string | undefined;
9904
+ }, {
9905
+ id: string;
9906
+ ts: number;
9907
+ schema_version: 1;
9908
+ kind: "fabric-event";
9909
+ event_type: "knowledge_layer_changed";
9910
+ timestamp: string;
9911
+ from_layer: "personal" | "team";
9912
+ to_layer: "personal" | "team";
9913
+ stable_id?: string | undefined;
9914
+ correlation_id?: string | undefined;
9915
+ session_id?: string | undefined;
9916
+ reason?: string | undefined;
9917
+ previous_stable_id?: string | undefined;
9918
+ }>, z.ZodObject<{
9919
+ event_type: z.ZodLiteral<"knowledge_id_redirect">;
9920
+ timestamp: z.ZodString;
9921
+ previous_stable_id: z.ZodString;
9922
+ new_stable_id: z.ZodString;
9923
+ reason: z.ZodOptional<z.ZodString>;
9924
+ kind: z.ZodLiteral<"fabric-event">;
9925
+ id: z.ZodString;
9926
+ ts: z.ZodNumber;
9927
+ schema_version: z.ZodLiteral<1>;
9928
+ correlation_id: z.ZodOptional<z.ZodString>;
9929
+ session_id: z.ZodOptional<z.ZodString>;
9930
+ }, "strip", z.ZodTypeAny, {
9931
+ id: string;
9932
+ new_stable_id: string;
9933
+ ts: number;
9934
+ schema_version: 1;
9935
+ kind: "fabric-event";
9936
+ event_type: "knowledge_id_redirect";
9937
+ timestamp: string;
9938
+ previous_stable_id: string;
9939
+ correlation_id?: string | undefined;
9940
+ session_id?: string | undefined;
9941
+ reason?: string | undefined;
9942
+ }, {
9943
+ id: string;
9944
+ new_stable_id: string;
9945
+ ts: number;
9946
+ schema_version: 1;
9947
+ kind: "fabric-event";
9948
+ event_type: "knowledge_id_redirect";
9949
+ timestamp: string;
9950
+ previous_stable_id: string;
9951
+ correlation_id?: string | undefined;
9952
+ session_id?: string | undefined;
9953
+ reason?: string | undefined;
9954
+ }>, z.ZodObject<{
9955
+ event_type: z.ZodLiteral<"knowledge_slug_renamed">;
9956
+ stable_id: z.ZodOptional<z.ZodString>;
9957
+ timestamp: z.ZodString;
9958
+ reason: z.ZodOptional<z.ZodString>;
9959
+ from_slug: z.ZodString;
9960
+ to_slug: z.ZodString;
9961
+ kind: z.ZodLiteral<"fabric-event">;
9962
+ id: z.ZodString;
9963
+ ts: z.ZodNumber;
9964
+ schema_version: z.ZodLiteral<1>;
9965
+ correlation_id: z.ZodOptional<z.ZodString>;
9966
+ session_id: z.ZodOptional<z.ZodString>;
9967
+ }, "strip", z.ZodTypeAny, {
9968
+ id: string;
9969
+ ts: number;
9970
+ schema_version: 1;
9971
+ kind: "fabric-event";
9972
+ event_type: "knowledge_slug_renamed";
9973
+ timestamp: string;
9974
+ from_slug: string;
9975
+ to_slug: string;
9976
+ stable_id?: string | undefined;
9977
+ correlation_id?: string | undefined;
9978
+ session_id?: string | undefined;
9979
+ reason?: string | undefined;
9980
+ }, {
9981
+ id: string;
9982
+ ts: number;
9983
+ schema_version: 1;
9984
+ kind: "fabric-event";
9985
+ event_type: "knowledge_slug_renamed";
9986
+ timestamp: string;
9987
+ from_slug: string;
9988
+ to_slug: string;
9989
+ stable_id?: string | undefined;
9990
+ correlation_id?: string | undefined;
9991
+ session_id?: string | undefined;
9992
+ reason?: string | undefined;
9993
+ }>, z.ZodObject<{
9994
+ event_type: z.ZodLiteral<"knowledge_demoted">;
9995
+ stable_id: z.ZodOptional<z.ZodString>;
9996
+ timestamp: z.ZodString;
9997
+ reason: z.ZodOptional<z.ZodString>;
9998
+ kind: z.ZodLiteral<"fabric-event">;
9999
+ id: z.ZodString;
10000
+ ts: z.ZodNumber;
10001
+ schema_version: z.ZodLiteral<1>;
10002
+ correlation_id: z.ZodOptional<z.ZodString>;
10003
+ session_id: z.ZodOptional<z.ZodString>;
10004
+ }, "strip", z.ZodTypeAny, {
10005
+ id: string;
10006
+ ts: number;
10007
+ schema_version: 1;
10008
+ kind: "fabric-event";
10009
+ event_type: "knowledge_demoted";
10010
+ timestamp: string;
10011
+ stable_id?: string | undefined;
10012
+ correlation_id?: string | undefined;
10013
+ session_id?: string | undefined;
10014
+ reason?: string | undefined;
10015
+ }, {
10016
+ id: string;
10017
+ ts: number;
10018
+ schema_version: 1;
10019
+ kind: "fabric-event";
10020
+ event_type: "knowledge_demoted";
10021
+ timestamp: string;
10022
+ stable_id?: string | undefined;
10023
+ correlation_id?: string | undefined;
10024
+ session_id?: string | undefined;
10025
+ reason?: string | undefined;
10026
+ }>, z.ZodObject<{
10027
+ event_type: z.ZodLiteral<"knowledge_archived">;
10028
+ stable_id: z.ZodOptional<z.ZodString>;
10029
+ timestamp: z.ZodString;
10030
+ reason: z.ZodOptional<z.ZodString>;
9134
10031
  kind: z.ZodLiteral<"fabric-event">;
9135
10032
  id: z.ZodString;
9136
10033
  ts: z.ZodNumber;
@@ -9142,7 +10039,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9142
10039
  ts: number;
9143
10040
  schema_version: 1;
9144
10041
  kind: "fabric-event";
9145
- event_type: "knowledge_proposed";
10042
+ event_type: "knowledge_archived";
9146
10043
  timestamp: string;
9147
10044
  stable_id?: string | undefined;
9148
10045
  correlation_id?: string | undefined;
@@ -9153,14 +10050,14 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9153
10050
  ts: number;
9154
10051
  schema_version: 1;
9155
10052
  kind: "fabric-event";
9156
- event_type: "knowledge_proposed";
10053
+ event_type: "knowledge_archived";
9157
10054
  timestamp: string;
9158
10055
  stable_id?: string | undefined;
9159
10056
  correlation_id?: string | undefined;
9160
10057
  session_id?: string | undefined;
9161
10058
  reason?: string | undefined;
9162
10059
  }>, z.ZodObject<{
9163
- event_type: z.ZodLiteral<"knowledge_promote_started">;
10060
+ event_type: z.ZodLiteral<"knowledge_archive_attempted">;
9164
10061
  stable_id: z.ZodOptional<z.ZodString>;
9165
10062
  timestamp: z.ZodString;
9166
10063
  reason: z.ZodOptional<z.ZodString>;
@@ -9175,7 +10072,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9175
10072
  ts: number;
9176
10073
  schema_version: 1;
9177
10074
  kind: "fabric-event";
9178
- event_type: "knowledge_promote_started";
10075
+ event_type: "knowledge_archive_attempted";
9179
10076
  timestamp: string;
9180
10077
  stable_id?: string | undefined;
9181
10078
  correlation_id?: string | undefined;
@@ -9186,17 +10083,19 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9186
10083
  ts: number;
9187
10084
  schema_version: 1;
9188
10085
  kind: "fabric-event";
9189
- event_type: "knowledge_promote_started";
10086
+ event_type: "knowledge_archive_attempted";
9190
10087
  timestamp: string;
9191
10088
  stable_id?: string | undefined;
9192
10089
  correlation_id?: string | undefined;
9193
10090
  session_id?: string | undefined;
9194
10091
  reason?: string | undefined;
9195
10092
  }>, z.ZodObject<{
9196
- event_type: z.ZodLiteral<"knowledge_promoted">;
10093
+ event_type: z.ZodLiteral<"knowledge_unarchived">;
9197
10094
  stable_id: z.ZodOptional<z.ZodString>;
9198
10095
  timestamp: z.ZodString;
9199
10096
  reason: z.ZodOptional<z.ZodString>;
10097
+ archive_path: z.ZodOptional<z.ZodString>;
10098
+ restored_to: z.ZodOptional<z.ZodString>;
9200
10099
  kind: z.ZodLiteral<"fabric-event">;
9201
10100
  id: z.ZodString;
9202
10101
  ts: z.ZodNumber;
@@ -9208,25 +10107,65 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9208
10107
  ts: number;
9209
10108
  schema_version: 1;
9210
10109
  kind: "fabric-event";
9211
- event_type: "knowledge_promoted";
10110
+ event_type: "knowledge_unarchived";
9212
10111
  timestamp: string;
9213
10112
  stable_id?: string | undefined;
9214
10113
  correlation_id?: string | undefined;
9215
10114
  session_id?: string | undefined;
9216
10115
  reason?: string | undefined;
10116
+ archive_path?: string | undefined;
10117
+ restored_to?: string | undefined;
9217
10118
  }, {
9218
10119
  id: string;
9219
10120
  ts: number;
9220
10121
  schema_version: 1;
9221
10122
  kind: "fabric-event";
9222
- event_type: "knowledge_promoted";
10123
+ event_type: "knowledge_unarchived";
9223
10124
  timestamp: string;
9224
10125
  stable_id?: string | undefined;
9225
10126
  correlation_id?: string | undefined;
9226
10127
  session_id?: string | undefined;
9227
10128
  reason?: string | undefined;
10129
+ archive_path?: string | undefined;
10130
+ restored_to?: string | undefined;
9228
10131
  }>, z.ZodObject<{
9229
- event_type: z.ZodLiteral<"knowledge_promote_failed">;
10132
+ event_type: z.ZodLiteral<"knowledge_deferred">;
10133
+ stable_id: z.ZodOptional<z.ZodString>;
10134
+ timestamp: z.ZodString;
10135
+ reason: z.ZodOptional<z.ZodString>;
10136
+ until: z.ZodOptional<z.ZodString>;
10137
+ kind: z.ZodLiteral<"fabric-event">;
10138
+ id: z.ZodString;
10139
+ ts: z.ZodNumber;
10140
+ schema_version: z.ZodLiteral<1>;
10141
+ correlation_id: z.ZodOptional<z.ZodString>;
10142
+ session_id: z.ZodOptional<z.ZodString>;
10143
+ }, "strip", z.ZodTypeAny, {
10144
+ id: string;
10145
+ ts: number;
10146
+ schema_version: 1;
10147
+ kind: "fabric-event";
10148
+ event_type: "knowledge_deferred";
10149
+ timestamp: string;
10150
+ stable_id?: string | undefined;
10151
+ correlation_id?: string | undefined;
10152
+ session_id?: string | undefined;
10153
+ reason?: string | undefined;
10154
+ until?: string | undefined;
10155
+ }, {
10156
+ id: string;
10157
+ ts: number;
10158
+ schema_version: 1;
10159
+ kind: "fabric-event";
10160
+ event_type: "knowledge_deferred";
10161
+ timestamp: string;
10162
+ stable_id?: string | undefined;
10163
+ correlation_id?: string | undefined;
10164
+ session_id?: string | undefined;
10165
+ reason?: string | undefined;
10166
+ until?: string | undefined;
10167
+ }>, z.ZodObject<{
10168
+ event_type: z.ZodLiteral<"knowledge_rejected">;
9230
10169
  stable_id: z.ZodOptional<z.ZodString>;
9231
10170
  timestamp: z.ZodString;
9232
10171
  reason: z.ZodString;
@@ -9242,7 +10181,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9242
10181
  ts: number;
9243
10182
  schema_version: 1;
9244
10183
  kind: "fabric-event";
9245
- event_type: "knowledge_promote_failed";
10184
+ event_type: "knowledge_rejected";
9246
10185
  timestamp: string;
9247
10186
  stable_id?: string | undefined;
9248
10187
  correlation_id?: string | undefined;
@@ -9253,19 +10192,187 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9253
10192
  ts: number;
9254
10193
  schema_version: 1;
9255
10194
  kind: "fabric-event";
9256
- event_type: "knowledge_promote_failed";
10195
+ event_type: "knowledge_rejected";
9257
10196
  timestamp: string;
9258
10197
  stable_id?: string | undefined;
9259
10198
  correlation_id?: string | undefined;
9260
10199
  session_id?: string | undefined;
9261
10200
  }>, z.ZodObject<{
9262
- event_type: z.ZodLiteral<"knowledge_layer_changed">;
9263
- stable_id: z.ZodOptional<z.ZodString>;
10201
+ event_type: z.ZodLiteral<"knowledge_consumed">;
10202
+ stable_id: z.ZodString;
10203
+ consumed_at: z.ZodString;
10204
+ client_hash: z.ZodString;
10205
+ kind: z.ZodLiteral<"fabric-event">;
10206
+ id: z.ZodString;
10207
+ ts: z.ZodNumber;
10208
+ schema_version: z.ZodLiteral<1>;
10209
+ correlation_id: z.ZodOptional<z.ZodString>;
10210
+ session_id: z.ZodOptional<z.ZodString>;
10211
+ }, "strip", z.ZodTypeAny, {
10212
+ id: string;
10213
+ stable_id: string;
10214
+ client_hash: string;
10215
+ ts: number;
10216
+ schema_version: 1;
10217
+ kind: "fabric-event";
10218
+ event_type: "knowledge_consumed";
10219
+ consumed_at: string;
10220
+ correlation_id?: string | undefined;
10221
+ session_id?: string | undefined;
10222
+ }, {
10223
+ id: string;
10224
+ stable_id: string;
10225
+ client_hash: string;
10226
+ ts: number;
10227
+ schema_version: 1;
10228
+ kind: "fabric-event";
10229
+ event_type: "knowledge_consumed";
10230
+ consumed_at: string;
10231
+ correlation_id?: string | undefined;
10232
+ session_id?: string | undefined;
10233
+ }>, z.ZodObject<{
10234
+ event_type: z.ZodLiteral<"knowledge_scope_degraded">;
10235
+ stable_id: z.ZodString;
9264
10236
  timestamp: z.ZodString;
9265
- reason: z.ZodOptional<z.ZodString>;
9266
- from_layer: z.ZodEnum<["team", "personal"]>;
9267
- to_layer: z.ZodEnum<["team", "personal"]>;
9268
- previous_stable_id: z.ZodOptional<z.ZodString>;
10237
+ from_scope: z.ZodEnum<["narrow", "broad"]>;
10238
+ to_scope: z.ZodEnum<["narrow", "broad"]>;
10239
+ reason: z.ZodString;
10240
+ kind: z.ZodLiteral<"fabric-event">;
10241
+ id: z.ZodString;
10242
+ ts: z.ZodNumber;
10243
+ schema_version: z.ZodLiteral<1>;
10244
+ correlation_id: z.ZodOptional<z.ZodString>;
10245
+ session_id: z.ZodOptional<z.ZodString>;
10246
+ }, "strip", z.ZodTypeAny, {
10247
+ id: string;
10248
+ stable_id: string;
10249
+ reason: string;
10250
+ ts: number;
10251
+ schema_version: 1;
10252
+ kind: "fabric-event";
10253
+ event_type: "knowledge_scope_degraded";
10254
+ timestamp: string;
10255
+ from_scope: "narrow" | "broad";
10256
+ to_scope: "narrow" | "broad";
10257
+ correlation_id?: string | undefined;
10258
+ session_id?: string | undefined;
10259
+ }, {
10260
+ id: string;
10261
+ stable_id: string;
10262
+ reason: string;
10263
+ ts: number;
10264
+ schema_version: 1;
10265
+ kind: "fabric-event";
10266
+ event_type: "knowledge_scope_degraded";
10267
+ timestamp: string;
10268
+ from_scope: "narrow" | "broad";
10269
+ to_scope: "narrow" | "broad";
10270
+ correlation_id?: string | undefined;
10271
+ session_id?: string | undefined;
10272
+ }>, z.ZodObject<{
10273
+ event_type: z.ZodLiteral<"pending_auto_archived">;
10274
+ pending_path: z.ZodString;
10275
+ archived_to: z.ZodString;
10276
+ reason: z.ZodString;
10277
+ kind: z.ZodLiteral<"fabric-event">;
10278
+ id: z.ZodString;
10279
+ ts: z.ZodNumber;
10280
+ schema_version: z.ZodLiteral<1>;
10281
+ correlation_id: z.ZodOptional<z.ZodString>;
10282
+ session_id: z.ZodOptional<z.ZodString>;
10283
+ }, "strip", z.ZodTypeAny, {
10284
+ id: string;
10285
+ pending_path: string;
10286
+ reason: string;
10287
+ ts: number;
10288
+ schema_version: 1;
10289
+ kind: "fabric-event";
10290
+ event_type: "pending_auto_archived";
10291
+ archived_to: string;
10292
+ correlation_id?: string | undefined;
10293
+ session_id?: string | undefined;
10294
+ }, {
10295
+ id: string;
10296
+ pending_path: string;
10297
+ reason: string;
10298
+ ts: number;
10299
+ schema_version: 1;
10300
+ kind: "fabric-event";
10301
+ event_type: "pending_auto_archived";
10302
+ archived_to: string;
10303
+ correlation_id?: string | undefined;
10304
+ session_id?: string | undefined;
10305
+ }>, z.ZodObject<{
10306
+ event_type: z.ZodLiteral<"knowledge_path_dangled">;
10307
+ stable_id: z.ZodString;
10308
+ removed_glob: z.ZodString;
10309
+ kind: z.ZodLiteral<"fabric-event">;
10310
+ id: z.ZodString;
10311
+ ts: z.ZodNumber;
10312
+ schema_version: z.ZodLiteral<1>;
10313
+ correlation_id: z.ZodOptional<z.ZodString>;
10314
+ session_id: z.ZodOptional<z.ZodString>;
10315
+ }, "strip", z.ZodTypeAny, {
10316
+ id: string;
10317
+ stable_id: string;
10318
+ ts: number;
10319
+ schema_version: 1;
10320
+ kind: "fabric-event";
10321
+ event_type: "knowledge_path_dangled";
10322
+ removed_glob: string;
10323
+ correlation_id?: string | undefined;
10324
+ session_id?: string | undefined;
10325
+ }, {
10326
+ id: string;
10327
+ stable_id: string;
10328
+ ts: number;
10329
+ schema_version: 1;
10330
+ kind: "fabric-event";
10331
+ event_type: "knowledge_path_dangled";
10332
+ removed_glob: string;
10333
+ correlation_id?: string | undefined;
10334
+ session_id?: string | undefined;
10335
+ }>, z.ZodObject<{
10336
+ event_type: z.ZodLiteral<"doctor_run">;
10337
+ mode: z.ZodEnum<["lint", "fix-knowledge"]>;
10338
+ issues: z.ZodNumber;
10339
+ mutations: z.ZodOptional<z.ZodNumber>;
10340
+ timestamp: z.ZodString;
10341
+ kind: z.ZodLiteral<"fabric-event">;
10342
+ id: z.ZodString;
10343
+ ts: z.ZodNumber;
10344
+ schema_version: z.ZodLiteral<1>;
10345
+ correlation_id: z.ZodOptional<z.ZodString>;
10346
+ session_id: z.ZodOptional<z.ZodString>;
10347
+ }, "strip", z.ZodTypeAny, {
10348
+ issues: number;
10349
+ id: string;
10350
+ ts: number;
10351
+ schema_version: 1;
10352
+ kind: "fabric-event";
10353
+ event_type: "doctor_run";
10354
+ timestamp: string;
10355
+ mode: "lint" | "fix-knowledge";
10356
+ correlation_id?: string | undefined;
10357
+ session_id?: string | undefined;
10358
+ mutations?: number | undefined;
10359
+ }, {
10360
+ issues: number;
10361
+ id: string;
10362
+ ts: number;
10363
+ schema_version: 1;
10364
+ kind: "fabric-event";
10365
+ event_type: "doctor_run";
10366
+ timestamp: string;
10367
+ mode: "lint" | "fix-knowledge";
10368
+ correlation_id?: string | undefined;
10369
+ session_id?: string | undefined;
10370
+ mutations?: number | undefined;
10371
+ }>, z.ZodObject<{
10372
+ event_type: z.ZodLiteral<"relevance_migration_run">;
10373
+ timestamp: z.ZodString;
10374
+ scanned_count: z.ZodNumber;
10375
+ touched_count: z.ZodNumber;
9269
10376
  kind: z.ZodLiteral<"fabric-event">;
9270
10377
  id: z.ZodString;
9271
10378
  ts: z.ZodNumber;
@@ -9277,35 +10384,58 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9277
10384
  ts: number;
9278
10385
  schema_version: 1;
9279
10386
  kind: "fabric-event";
9280
- event_type: "knowledge_layer_changed";
10387
+ event_type: "relevance_migration_run";
9281
10388
  timestamp: string;
9282
- from_layer: "personal" | "team";
9283
- to_layer: "personal" | "team";
9284
- stable_id?: string | undefined;
10389
+ scanned_count: number;
10390
+ touched_count: number;
9285
10391
  correlation_id?: string | undefined;
9286
10392
  session_id?: string | undefined;
9287
- reason?: string | undefined;
9288
- previous_stable_id?: string | undefined;
9289
10393
  }, {
9290
10394
  id: string;
9291
10395
  ts: number;
9292
10396
  schema_version: 1;
9293
10397
  kind: "fabric-event";
9294
- event_type: "knowledge_layer_changed";
10398
+ event_type: "relevance_migration_run";
9295
10399
  timestamp: string;
9296
- from_layer: "personal" | "team";
9297
- to_layer: "personal" | "team";
9298
- stable_id?: string | undefined;
10400
+ scanned_count: number;
10401
+ touched_count: number;
9299
10402
  correlation_id?: string | undefined;
9300
10403
  session_id?: string | undefined;
9301
- reason?: string | undefined;
9302
- previous_stable_id?: string | undefined;
9303
10404
  }>, z.ZodObject<{
9304
- event_type: z.ZodLiteral<"knowledge_id_redirect">;
10405
+ event_type: z.ZodLiteral<"assistant_turn_observed">;
10406
+ kb_line_raw: z.ZodNullable<z.ZodString>;
10407
+ cite_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
10408
+ cite_tags: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEnum<["applied", "dismissed", "none"]>, "none" | "applied" | "dismissed", unknown>, "many">>;
10409
+ cite_commitments: z.ZodDefault<z.ZodArray<z.ZodObject<{
10410
+ operators: z.ZodArray<z.ZodObject<{
10411
+ kind: z.ZodEnum<["edit", "not_edit", "require", "forbid"]>;
10412
+ target: z.ZodString;
10413
+ }, "strip", z.ZodTypeAny, {
10414
+ kind: "require" | "edit" | "not_edit" | "forbid";
10415
+ target: string;
10416
+ }, {
10417
+ kind: "require" | "edit" | "not_edit" | "forbid";
10418
+ target: string;
10419
+ }>, "many">;
10420
+ skip_reason: z.ZodNullable<z.ZodString>;
10421
+ }, "strip", z.ZodTypeAny, {
10422
+ operators: {
10423
+ kind: "require" | "edit" | "not_edit" | "forbid";
10424
+ target: string;
10425
+ }[];
10426
+ skip_reason: string | null;
10427
+ }, {
10428
+ operators: {
10429
+ kind: "require" | "edit" | "not_edit" | "forbid";
10430
+ target: string;
10431
+ }[];
10432
+ skip_reason: string | null;
10433
+ }>, "many">>;
10434
+ cite_stores: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodString>, "many">>;
10435
+ client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
10436
+ turn_id: z.ZodString;
10437
+ envelope_index: z.ZodOptional<z.ZodNumber>;
9305
10438
  timestamp: z.ZodString;
9306
- previous_stable_id: z.ZodString;
9307
- new_stable_id: z.ZodString;
9308
- reason: z.ZodOptional<z.ZodString>;
9309
10439
  kind: z.ZodLiteral<"fabric-event">;
9310
10440
  id: z.ZodString;
9311
10441
  ts: z.ZodNumber;
@@ -9314,35 +10444,54 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9314
10444
  session_id: z.ZodOptional<z.ZodString>;
9315
10445
  }, "strip", z.ZodTypeAny, {
9316
10446
  id: string;
9317
- new_stable_id: string;
9318
10447
  ts: number;
9319
10448
  schema_version: 1;
9320
10449
  kind: "fabric-event";
9321
- event_type: "knowledge_id_redirect";
10450
+ event_type: "assistant_turn_observed";
9322
10451
  timestamp: string;
9323
- previous_stable_id: string;
10452
+ kb_line_raw: string | null;
10453
+ cite_ids: string[];
10454
+ cite_tags: ("none" | "applied" | "dismissed")[];
10455
+ cite_commitments: {
10456
+ operators: {
10457
+ kind: "require" | "edit" | "not_edit" | "forbid";
10458
+ target: string;
10459
+ }[];
10460
+ skip_reason: string | null;
10461
+ }[];
10462
+ turn_id: string;
9324
10463
  correlation_id?: string | undefined;
9325
10464
  session_id?: string | undefined;
9326
- reason?: string | undefined;
10465
+ cite_stores?: (string | null)[] | undefined;
10466
+ client?: "cursor" | "cc" | "codex" | undefined;
10467
+ envelope_index?: number | undefined;
9327
10468
  }, {
9328
10469
  id: string;
9329
- new_stable_id: string;
9330
10470
  ts: number;
9331
10471
  schema_version: 1;
9332
10472
  kind: "fabric-event";
9333
- event_type: "knowledge_id_redirect";
10473
+ event_type: "assistant_turn_observed";
9334
10474
  timestamp: string;
9335
- previous_stable_id: string;
10475
+ kb_line_raw: string | null;
10476
+ turn_id: string;
9336
10477
  correlation_id?: string | undefined;
9337
10478
  session_id?: string | undefined;
9338
- reason?: string | undefined;
10479
+ cite_ids?: string[] | undefined;
10480
+ cite_tags?: unknown[] | undefined;
10481
+ cite_commitments?: {
10482
+ operators: {
10483
+ kind: "require" | "edit" | "not_edit" | "forbid";
10484
+ target: string;
10485
+ }[];
10486
+ skip_reason: string | null;
10487
+ }[] | undefined;
10488
+ cite_stores?: (string | null)[] | undefined;
10489
+ client?: "cursor" | "cc" | "codex" | undefined;
10490
+ envelope_index?: number | undefined;
9339
10491
  }>, z.ZodObject<{
9340
- event_type: z.ZodLiteral<"knowledge_slug_renamed">;
9341
- stable_id: z.ZodOptional<z.ZodString>;
10492
+ event_type: z.ZodLiteral<"cite_policy_activated">;
10493
+ policy_version: z.ZodString;
9342
10494
  timestamp: z.ZodString;
9343
- reason: z.ZodOptional<z.ZodString>;
9344
- from_slug: z.ZodString;
9345
- to_slug: z.ZodString;
9346
10495
  kind: z.ZodLiteral<"fabric-event">;
9347
10496
  id: z.ZodString;
9348
10497
  ts: z.ZodNumber;
@@ -9354,32 +10503,23 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9354
10503
  ts: number;
9355
10504
  schema_version: 1;
9356
10505
  kind: "fabric-event";
9357
- event_type: "knowledge_slug_renamed";
10506
+ event_type: "cite_policy_activated";
9358
10507
  timestamp: string;
9359
- from_slug: string;
9360
- to_slug: string;
9361
- stable_id?: string | undefined;
10508
+ policy_version: string;
9362
10509
  correlation_id?: string | undefined;
9363
10510
  session_id?: string | undefined;
9364
- reason?: string | undefined;
9365
10511
  }, {
9366
10512
  id: string;
9367
10513
  ts: number;
9368
10514
  schema_version: 1;
9369
10515
  kind: "fabric-event";
9370
- event_type: "knowledge_slug_renamed";
10516
+ event_type: "cite_policy_activated";
9371
10517
  timestamp: string;
9372
- from_slug: string;
9373
- to_slug: string;
9374
- stable_id?: string | undefined;
10518
+ policy_version: string;
9375
10519
  correlation_id?: string | undefined;
9376
10520
  session_id?: string | undefined;
9377
- reason?: string | undefined;
9378
10521
  }>, z.ZodObject<{
9379
- event_type: z.ZodLiteral<"knowledge_demoted">;
9380
- stable_id: z.ZodOptional<z.ZodString>;
9381
- timestamp: z.ZodString;
9382
- reason: z.ZodOptional<z.ZodString>;
10522
+ event_type: z.ZodLiteral<"cite_contract_policy_activated">;
9383
10523
  kind: z.ZodLiteral<"fabric-event">;
9384
10524
  id: z.ZodString;
9385
10525
  ts: z.ZodNumber;
@@ -9391,28 +10531,23 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9391
10531
  ts: number;
9392
10532
  schema_version: 1;
9393
10533
  kind: "fabric-event";
9394
- event_type: "knowledge_demoted";
9395
- timestamp: string;
9396
- stable_id?: string | undefined;
10534
+ event_type: "cite_contract_policy_activated";
9397
10535
  correlation_id?: string | undefined;
9398
10536
  session_id?: string | undefined;
9399
- reason?: string | undefined;
9400
10537
  }, {
9401
10538
  id: string;
9402
10539
  ts: number;
9403
10540
  schema_version: 1;
9404
10541
  kind: "fabric-event";
9405
- event_type: "knowledge_demoted";
9406
- timestamp: string;
9407
- stable_id?: string | undefined;
10542
+ event_type: "cite_contract_policy_activated";
9408
10543
  correlation_id?: string | undefined;
9409
10544
  session_id?: string | undefined;
9410
- reason?: string | undefined;
9411
10545
  }>, z.ZodObject<{
9412
- event_type: z.ZodLiteral<"knowledge_archived">;
9413
- stable_id: z.ZodOptional<z.ZodString>;
9414
- timestamp: z.ZodString;
9415
- reason: z.ZodOptional<z.ZodString>;
10546
+ event_type: z.ZodLiteral<"knowledge_meta_auto_healed">;
10547
+ previous_revision_hash: z.ZodString;
10548
+ revision_hash: z.ZodString;
10549
+ trigger: z.ZodLiteral<"read">;
10550
+ caller: z.ZodOptional<z.ZodEnum<["planContext", "getKnowledgeSections", "getKnowledge", "extractKnowledge"]>>;
9416
10551
  kind: z.ZodLiteral<"fabric-event">;
9417
10552
  id: z.ZodString;
9418
10553
  ts: z.ZodNumber;
@@ -9421,31 +10556,34 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9421
10556
  session_id: z.ZodOptional<z.ZodString>;
9422
10557
  }, "strip", z.ZodTypeAny, {
9423
10558
  id: string;
10559
+ revision_hash: string;
10560
+ previous_revision_hash: string;
9424
10561
  ts: number;
9425
10562
  schema_version: 1;
9426
10563
  kind: "fabric-event";
9427
- event_type: "knowledge_archived";
9428
- timestamp: string;
9429
- stable_id?: string | undefined;
10564
+ event_type: "knowledge_meta_auto_healed";
10565
+ trigger: "read";
9430
10566
  correlation_id?: string | undefined;
9431
10567
  session_id?: string | undefined;
9432
- reason?: string | undefined;
10568
+ caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
9433
10569
  }, {
9434
10570
  id: string;
10571
+ revision_hash: string;
10572
+ previous_revision_hash: string;
9435
10573
  ts: number;
9436
10574
  schema_version: 1;
9437
10575
  kind: "fabric-event";
9438
- event_type: "knowledge_archived";
9439
- timestamp: string;
9440
- stable_id?: string | undefined;
10576
+ event_type: "knowledge_meta_auto_healed";
10577
+ trigger: "read";
9441
10578
  correlation_id?: string | undefined;
9442
10579
  session_id?: string | undefined;
9443
- reason?: string | undefined;
10580
+ caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
9444
10581
  }>, z.ZodObject<{
9445
- event_type: z.ZodLiteral<"knowledge_archive_attempted">;
9446
- stable_id: z.ZodOptional<z.ZodString>;
9447
- timestamp: z.ZodString;
9448
- reason: z.ZodOptional<z.ZodString>;
10582
+ event_type: z.ZodLiteral<"events_rotated">;
10583
+ cutoff_ts: z.ZodString;
10584
+ archived_count: z.ZodNumber;
10585
+ kept_count: z.ZodNumber;
10586
+ archive_path: z.ZodString;
9449
10587
  kind: z.ZodLiteral<"fabric-event">;
9450
10588
  id: z.ZodString;
9451
10589
  ts: z.ZodNumber;
@@ -9457,30 +10595,30 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9457
10595
  ts: number;
9458
10596
  schema_version: 1;
9459
10597
  kind: "fabric-event";
9460
- event_type: "knowledge_archive_attempted";
9461
- timestamp: string;
9462
- stable_id?: string | undefined;
10598
+ event_type: "events_rotated";
10599
+ archive_path: string;
10600
+ cutoff_ts: string;
10601
+ archived_count: number;
10602
+ kept_count: number;
9463
10603
  correlation_id?: string | undefined;
9464
10604
  session_id?: string | undefined;
9465
- reason?: string | undefined;
9466
10605
  }, {
9467
10606
  id: string;
9468
10607
  ts: number;
9469
10608
  schema_version: 1;
9470
10609
  kind: "fabric-event";
9471
- event_type: "knowledge_archive_attempted";
9472
- timestamp: string;
9473
- stable_id?: string | undefined;
10610
+ event_type: "events_rotated";
10611
+ archive_path: string;
10612
+ cutoff_ts: string;
10613
+ archived_count: number;
10614
+ kept_count: number;
9474
10615
  correlation_id?: string | undefined;
9475
10616
  session_id?: string | undefined;
9476
- reason?: string | undefined;
9477
10617
  }>, z.ZodObject<{
9478
- event_type: z.ZodLiteral<"knowledge_unarchived">;
9479
- stable_id: z.ZodOptional<z.ZodString>;
10618
+ event_type: z.ZodLiteral<"serve_lock_cleared">;
10619
+ pid: z.ZodNumber;
10620
+ age_ms: z.ZodNumber;
9480
10621
  timestamp: z.ZodString;
9481
- reason: z.ZodOptional<z.ZodString>;
9482
- archive_path: z.ZodOptional<z.ZodString>;
9483
- restored_to: z.ZodOptional<z.ZodString>;
9484
10622
  kind: z.ZodLiteral<"fabric-event">;
9485
10623
  id: z.ZodString;
9486
10624
  ts: z.ZodNumber;
@@ -9492,33 +10630,29 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9492
10630
  ts: number;
9493
10631
  schema_version: 1;
9494
10632
  kind: "fabric-event";
9495
- event_type: "knowledge_unarchived";
10633
+ event_type: "serve_lock_cleared";
9496
10634
  timestamp: string;
9497
- stable_id?: string | undefined;
10635
+ pid: number;
10636
+ age_ms: number;
9498
10637
  correlation_id?: string | undefined;
9499
10638
  session_id?: string | undefined;
9500
- reason?: string | undefined;
9501
- archive_path?: string | undefined;
9502
- restored_to?: string | undefined;
9503
10639
  }, {
9504
10640
  id: string;
9505
10641
  ts: number;
9506
10642
  schema_version: 1;
9507
10643
  kind: "fabric-event";
9508
- event_type: "knowledge_unarchived";
10644
+ event_type: "serve_lock_cleared";
9509
10645
  timestamp: string;
9510
- stable_id?: string | undefined;
10646
+ pid: number;
10647
+ age_ms: number;
9511
10648
  correlation_id?: string | undefined;
9512
10649
  session_id?: string | undefined;
9513
- reason?: string | undefined;
9514
- archive_path?: string | undefined;
9515
- restored_to?: string | undefined;
9516
10650
  }>, z.ZodObject<{
9517
- event_type: z.ZodLiteral<"knowledge_deferred">;
9518
- stable_id: z.ZodOptional<z.ZodString>;
10651
+ event_type: z.ZodLiteral<"knowledge_enriched">;
10652
+ path: z.ZodString;
10653
+ added_fields: z.ZodArray<z.ZodEnum<["intent_clues", "tech_stack", "impact", "must_read_if"]>, "many">;
10654
+ mode: z.ZodEnum<["auto", "preview", "readonly", "interactive"]>;
9519
10655
  timestamp: z.ZodString;
9520
- reason: z.ZodOptional<z.ZodString>;
9521
- until: z.ZodOptional<z.ZodString>;
9522
10656
  kind: z.ZodLiteral<"fabric-event">;
9523
10657
  id: z.ZodString;
9524
10658
  ts: z.ZodNumber;
@@ -9526,34 +10660,35 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9526
10660
  correlation_id: z.ZodOptional<z.ZodString>;
9527
10661
  session_id: z.ZodOptional<z.ZodString>;
9528
10662
  }, "strip", z.ZodTypeAny, {
10663
+ path: string;
9529
10664
  id: string;
9530
10665
  ts: number;
9531
10666
  schema_version: 1;
9532
10667
  kind: "fabric-event";
9533
- event_type: "knowledge_deferred";
10668
+ event_type: "knowledge_enriched";
9534
10669
  timestamp: string;
9535
- stable_id?: string | undefined;
10670
+ mode: "auto" | "preview" | "readonly" | "interactive";
10671
+ added_fields: ("intent_clues" | "tech_stack" | "impact" | "must_read_if")[];
9536
10672
  correlation_id?: string | undefined;
9537
10673
  session_id?: string | undefined;
9538
- reason?: string | undefined;
9539
- until?: string | undefined;
9540
10674
  }, {
10675
+ path: string;
9541
10676
  id: string;
9542
10677
  ts: number;
9543
10678
  schema_version: 1;
9544
10679
  kind: "fabric-event";
9545
- event_type: "knowledge_deferred";
10680
+ event_type: "knowledge_enriched";
9546
10681
  timestamp: string;
9547
- stable_id?: string | undefined;
10682
+ mode: "auto" | "preview" | "readonly" | "interactive";
10683
+ added_fields: ("intent_clues" | "tech_stack" | "impact" | "must_read_if")[];
9548
10684
  correlation_id?: string | undefined;
9549
10685
  session_id?: string | undefined;
9550
- reason?: string | undefined;
9551
- until?: string | undefined;
9552
10686
  }>, z.ZodObject<{
9553
- event_type: z.ZodLiteral<"knowledge_rejected">;
9554
- stable_id: z.ZodOptional<z.ZodString>;
9555
- timestamp: z.ZodString;
9556
- reason: z.ZodString;
10687
+ event_type: z.ZodLiteral<"session_archive_attempted">;
10688
+ outcome: z.ZodEnum<["proposed", "viability_failed", "user_dismissed", "skipped_no_signal"]>;
10689
+ covered_through_ts: z.ZodNumber;
10690
+ candidates_proposed: z.ZodDefault<z.ZodNumber>;
10691
+ knowledge_proposed_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
9557
10692
  kind: z.ZodLiteral<"fabric-event">;
9558
10693
  id: z.ZodString;
9559
10694
  ts: z.ZodNumber;
@@ -9562,31 +10697,36 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9562
10697
  session_id: z.ZodOptional<z.ZodString>;
9563
10698
  }, "strip", z.ZodTypeAny, {
9564
10699
  id: string;
9565
- reason: string;
10700
+ covered_through_ts: number;
9566
10701
  ts: number;
9567
10702
  schema_version: 1;
9568
10703
  kind: "fabric-event";
9569
- event_type: "knowledge_rejected";
9570
- timestamp: string;
9571
- stable_id?: string | undefined;
10704
+ event_type: "session_archive_attempted";
10705
+ outcome: "user_dismissed" | "proposed" | "viability_failed" | "skipped_no_signal";
10706
+ candidates_proposed: number;
10707
+ knowledge_proposed_ids: string[];
9572
10708
  correlation_id?: string | undefined;
9573
10709
  session_id?: string | undefined;
9574
10710
  }, {
9575
10711
  id: string;
9576
- reason: string;
10712
+ covered_through_ts: number;
9577
10713
  ts: number;
9578
10714
  schema_version: 1;
9579
10715
  kind: "fabric-event";
9580
- event_type: "knowledge_rejected";
9581
- timestamp: string;
9582
- stable_id?: string | undefined;
10716
+ event_type: "session_archive_attempted";
10717
+ outcome: "user_dismissed" | "proposed" | "viability_failed" | "skipped_no_signal";
9583
10718
  correlation_id?: string | undefined;
9584
10719
  session_id?: string | undefined;
10720
+ candidates_proposed?: number | undefined;
10721
+ knowledge_proposed_ids?: string[] | undefined;
9585
10722
  }>, z.ZodObject<{
9586
- event_type: z.ZodLiteral<"knowledge_consumed">;
9587
- stable_id: z.ZodString;
9588
- consumed_at: z.ZodString;
9589
- client_hash: z.ZodString;
10723
+ event_type: z.ZodLiteral<"hook_surface_emitted">;
10724
+ hook_name: z.ZodString;
10725
+ client: z.ZodEnum<["cc", "codex", "cursor"]>;
10726
+ target_channel: z.ZodString;
10727
+ rendered_ids: z.ZodArray<z.ZodString, "many">;
10728
+ delivery_status: z.ZodEnum<["delivered", "suppressed", "error"]>;
10729
+ suppression_reason: z.ZodOptional<z.ZodString>;
9590
10730
  kind: z.ZodLiteral<"fabric-event">;
9591
10731
  id: z.ZodString;
9592
10732
  ts: z.ZodNumber;
@@ -9595,33 +10735,38 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9595
10735
  session_id: z.ZodOptional<z.ZodString>;
9596
10736
  }, "strip", z.ZodTypeAny, {
9597
10737
  id: string;
9598
- stable_id: string;
9599
- client_hash: string;
9600
10738
  ts: number;
9601
10739
  schema_version: 1;
9602
10740
  kind: "fabric-event";
9603
- event_type: "knowledge_consumed";
9604
- consumed_at: string;
10741
+ event_type: "hook_surface_emitted";
10742
+ client: "cursor" | "cc" | "codex";
10743
+ hook_name: string;
10744
+ target_channel: string;
10745
+ rendered_ids: string[];
10746
+ delivery_status: "error" | "delivered" | "suppressed";
9605
10747
  correlation_id?: string | undefined;
9606
10748
  session_id?: string | undefined;
10749
+ suppression_reason?: string | undefined;
9607
10750
  }, {
9608
10751
  id: string;
9609
- stable_id: string;
9610
- client_hash: string;
9611
10752
  ts: number;
9612
10753
  schema_version: 1;
9613
10754
  kind: "fabric-event";
9614
- event_type: "knowledge_consumed";
9615
- consumed_at: string;
10755
+ event_type: "hook_surface_emitted";
10756
+ client: "cursor" | "cc" | "codex";
10757
+ hook_name: string;
10758
+ target_channel: string;
10759
+ rendered_ids: string[];
10760
+ delivery_status: "error" | "delivered" | "suppressed";
9616
10761
  correlation_id?: string | undefined;
9617
10762
  session_id?: string | undefined;
10763
+ suppression_reason?: string | undefined;
9618
10764
  }>, z.ZodObject<{
9619
- event_type: z.ZodLiteral<"knowledge_scope_degraded">;
9620
- stable_id: z.ZodString;
9621
- timestamp: z.ZodString;
9622
- from_scope: z.ZodEnum<["narrow", "broad"]>;
9623
- to_scope: z.ZodEnum<["narrow", "broad"]>;
9624
- reason: z.ZodString;
10765
+ event_type: z.ZodLiteral<"hook_signal_emitted">;
10766
+ signal_type: z.ZodEnum<["archive", "review", "maintenance", "other"]>;
10767
+ threshold: z.ZodNumber;
10768
+ actual_value: z.ZodNumber;
10769
+ fired: z.ZodBoolean;
9625
10770
  kind: z.ZodLiteral<"fabric-event">;
9626
10771
  id: z.ZodString;
9627
10772
  ts: z.ZodNumber;
@@ -9630,35 +10775,37 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9630
10775
  session_id: z.ZodOptional<z.ZodString>;
9631
10776
  }, "strip", z.ZodTypeAny, {
9632
10777
  id: string;
9633
- stable_id: string;
9634
- reason: string;
9635
10778
  ts: number;
9636
10779
  schema_version: 1;
9637
10780
  kind: "fabric-event";
9638
- event_type: "knowledge_scope_degraded";
9639
- timestamp: string;
9640
- from_scope: "narrow" | "broad";
9641
- to_scope: "narrow" | "broad";
10781
+ event_type: "hook_signal_emitted";
10782
+ signal_type: "archive" | "review" | "maintenance" | "other";
10783
+ threshold: number;
10784
+ actual_value: number;
10785
+ fired: boolean;
9642
10786
  correlation_id?: string | undefined;
9643
10787
  session_id?: string | undefined;
9644
10788
  }, {
9645
10789
  id: string;
9646
- stable_id: string;
9647
- reason: string;
9648
10790
  ts: number;
9649
10791
  schema_version: 1;
9650
10792
  kind: "fabric-event";
9651
- event_type: "knowledge_scope_degraded";
9652
- timestamp: string;
9653
- from_scope: "narrow" | "broad";
9654
- to_scope: "narrow" | "broad";
10793
+ event_type: "hook_signal_emitted";
10794
+ signal_type: "archive" | "review" | "maintenance" | "other";
10795
+ threshold: number;
10796
+ actual_value: number;
10797
+ fired: boolean;
9655
10798
  correlation_id?: string | undefined;
9656
10799
  session_id?: string | undefined;
9657
10800
  }>, z.ZodObject<{
9658
- event_type: z.ZodLiteral<"pending_auto_archived">;
9659
- pending_path: z.ZodString;
9660
- archived_to: z.ZodString;
9661
- reason: z.ZodString;
10801
+ event_type: z.ZodLiteral<"mcp_stdio_trace">;
10802
+ tool_name: z.ZodString;
10803
+ request_id: z.ZodString;
10804
+ duration_ms: z.ZodNumber;
10805
+ status: z.ZodEnum<["ok", "error"]>;
10806
+ payload_bytes_in: z.ZodNumber;
10807
+ payload_bytes_out: z.ZodNumber;
10808
+ error_code: z.ZodOptional<z.ZodString>;
9662
10809
  kind: z.ZodLiteral<"fabric-event">;
9663
10810
  id: z.ZodString;
9664
10811
  ts: z.ZodNumber;
@@ -9666,31 +10813,42 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9666
10813
  correlation_id: z.ZodOptional<z.ZodString>;
9667
10814
  session_id: z.ZodOptional<z.ZodString>;
9668
10815
  }, "strip", z.ZodTypeAny, {
10816
+ status: "ok" | "error";
9669
10817
  id: string;
9670
- pending_path: string;
9671
- reason: string;
9672
10818
  ts: number;
9673
10819
  schema_version: 1;
9674
10820
  kind: "fabric-event";
9675
- event_type: "pending_auto_archived";
9676
- archived_to: string;
10821
+ event_type: "mcp_stdio_trace";
10822
+ duration_ms: number;
10823
+ tool_name: string;
10824
+ request_id: string;
10825
+ payload_bytes_in: number;
10826
+ payload_bytes_out: number;
9677
10827
  correlation_id?: string | undefined;
9678
10828
  session_id?: string | undefined;
10829
+ error_code?: string | undefined;
9679
10830
  }, {
10831
+ status: "ok" | "error";
9680
10832
  id: string;
9681
- pending_path: string;
9682
- reason: string;
9683
10833
  ts: number;
9684
10834
  schema_version: 1;
9685
10835
  kind: "fabric-event";
9686
- event_type: "pending_auto_archived";
9687
- archived_to: string;
10836
+ event_type: "mcp_stdio_trace";
10837
+ duration_ms: number;
10838
+ tool_name: string;
10839
+ request_id: string;
10840
+ payload_bytes_in: number;
10841
+ payload_bytes_out: number;
9688
10842
  correlation_id?: string | undefined;
9689
10843
  session_id?: string | undefined;
10844
+ error_code?: string | undefined;
9690
10845
  }>, z.ZodObject<{
9691
- event_type: z.ZodLiteral<"knowledge_path_dangled">;
9692
- stable_id: z.ZodString;
9693
- removed_glob: z.ZodString;
10846
+ event_type: z.ZodLiteral<"payload_guard_observed">;
10847
+ tool_name: z.ZodString;
10848
+ path_count: z.ZodNumber;
10849
+ tokens_estimated: z.ZodNumber;
10850
+ truncated: z.ZodBoolean;
10851
+ cap: z.ZodNumber;
9694
10852
  kind: z.ZodLiteral<"fabric-event">;
9695
10853
  id: z.ZodString;
9696
10854
  ts: z.ZodNumber;
@@ -9699,30 +10857,35 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9699
10857
  session_id: z.ZodOptional<z.ZodString>;
9700
10858
  }, "strip", z.ZodTypeAny, {
9701
10859
  id: string;
9702
- stable_id: string;
9703
10860
  ts: number;
9704
10861
  schema_version: 1;
9705
10862
  kind: "fabric-event";
9706
- event_type: "knowledge_path_dangled";
9707
- removed_glob: string;
10863
+ event_type: "payload_guard_observed";
10864
+ tool_name: string;
10865
+ path_count: number;
10866
+ tokens_estimated: number;
10867
+ truncated: boolean;
10868
+ cap: number;
9708
10869
  correlation_id?: string | undefined;
9709
10870
  session_id?: string | undefined;
9710
10871
  }, {
9711
10872
  id: string;
9712
- stable_id: string;
9713
10873
  ts: number;
9714
10874
  schema_version: 1;
9715
10875
  kind: "fabric-event";
9716
- event_type: "knowledge_path_dangled";
9717
- removed_glob: string;
10876
+ event_type: "payload_guard_observed";
10877
+ tool_name: string;
10878
+ path_count: number;
10879
+ tokens_estimated: number;
10880
+ truncated: boolean;
10881
+ cap: number;
9718
10882
  correlation_id?: string | undefined;
9719
10883
  session_id?: string | undefined;
9720
10884
  }>, z.ZodObject<{
9721
- event_type: z.ZodLiteral<"doctor_run">;
9722
- mode: z.ZodEnum<["lint", "fix-knowledge"]>;
9723
- issues: z.ZodNumber;
9724
- mutations: z.ZodOptional<z.ZodNumber>;
9725
- timestamp: z.ZodString;
10885
+ event_type: z.ZodLiteral<"skill_invocation_started">;
10886
+ skill_name: z.ZodString;
10887
+ trigger_source: z.ZodEnum<["user", "auto_invoke", "ai_self_trigger", "chained"]>;
10888
+ entry_point: z.ZodString;
9726
10889
  kind: z.ZodLiteral<"fabric-event">;
9727
10890
  id: z.ZodString;
9728
10891
  ts: z.ZodNumber;
@@ -9730,34 +10893,34 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9730
10893
  correlation_id: z.ZodOptional<z.ZodString>;
9731
10894
  session_id: z.ZodOptional<z.ZodString>;
9732
10895
  }, "strip", z.ZodTypeAny, {
9733
- issues: number;
9734
10896
  id: string;
9735
10897
  ts: number;
9736
10898
  schema_version: 1;
9737
10899
  kind: "fabric-event";
9738
- event_type: "doctor_run";
9739
- timestamp: string;
9740
- mode: "lint" | "fix-knowledge";
10900
+ event_type: "skill_invocation_started";
10901
+ skill_name: string;
10902
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
10903
+ entry_point: string;
9741
10904
  correlation_id?: string | undefined;
9742
10905
  session_id?: string | undefined;
9743
- mutations?: number | undefined;
9744
10906
  }, {
9745
- issues: number;
9746
10907
  id: string;
9747
10908
  ts: number;
9748
10909
  schema_version: 1;
9749
10910
  kind: "fabric-event";
9750
- event_type: "doctor_run";
9751
- timestamp: string;
9752
- mode: "lint" | "fix-knowledge";
10911
+ event_type: "skill_invocation_started";
10912
+ skill_name: string;
10913
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
10914
+ entry_point: string;
9753
10915
  correlation_id?: string | undefined;
9754
10916
  session_id?: string | undefined;
9755
- mutations?: number | undefined;
9756
10917
  }>, z.ZodObject<{
9757
- event_type: z.ZodLiteral<"relevance_migration_run">;
9758
- timestamp: z.ZodString;
9759
- scanned_count: z.ZodNumber;
9760
- touched_count: z.ZodNumber;
10918
+ event_type: z.ZodLiteral<"skill_invocation_completed">;
10919
+ skill_name: z.ZodString;
10920
+ trigger_source: z.ZodEnum<["user", "auto_invoke", "ai_self_trigger", "chained"]>;
10921
+ entry_point: z.ZodString;
10922
+ outcome: z.ZodEnum<["completed", "aborted", "error", "no_op"]>;
10923
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
9761
10924
  kind: z.ZodLiteral<"fabric-event">;
9762
10925
  id: z.ZodString;
9763
10926
  ts: z.ZodNumber;
@@ -9769,57 +10932,34 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9769
10932
  ts: number;
9770
10933
  schema_version: 1;
9771
10934
  kind: "fabric-event";
9772
- event_type: "relevance_migration_run";
9773
- timestamp: string;
9774
- scanned_count: number;
9775
- touched_count: number;
10935
+ event_type: "skill_invocation_completed";
10936
+ outcome: "aborted" | "completed" | "error" | "no_op";
10937
+ skill_name: string;
10938
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
10939
+ entry_point: string;
9776
10940
  correlation_id?: string | undefined;
9777
10941
  session_id?: string | undefined;
10942
+ elapsed_ms?: number | undefined;
9778
10943
  }, {
9779
10944
  id: string;
9780
10945
  ts: number;
9781
10946
  schema_version: 1;
9782
10947
  kind: "fabric-event";
9783
- event_type: "relevance_migration_run";
9784
- timestamp: string;
9785
- scanned_count: number;
9786
- touched_count: number;
10948
+ event_type: "skill_invocation_completed";
10949
+ outcome: "aborted" | "completed" | "error" | "no_op";
10950
+ skill_name: string;
10951
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
10952
+ entry_point: string;
9787
10953
  correlation_id?: string | undefined;
9788
10954
  session_id?: string | undefined;
10955
+ elapsed_ms?: number | undefined;
9789
10956
  }>, z.ZodObject<{
9790
- event_type: z.ZodLiteral<"assistant_turn_observed">;
9791
- kb_line_raw: z.ZodNullable<z.ZodString>;
9792
- cite_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
9793
- cite_tags: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEnum<["applied", "dismissed", "none"]>, "none" | "applied" | "dismissed", unknown>, "many">>;
9794
- cite_commitments: z.ZodDefault<z.ZodArray<z.ZodObject<{
9795
- operators: z.ZodArray<z.ZodObject<{
9796
- kind: z.ZodEnum<["edit", "not_edit", "require", "forbid"]>;
9797
- target: z.ZodString;
9798
- }, "strip", z.ZodTypeAny, {
9799
- target: string;
9800
- kind: "require" | "edit" | "not_edit" | "forbid";
9801
- }, {
9802
- target: string;
9803
- kind: "require" | "edit" | "not_edit" | "forbid";
9804
- }>, "many">;
9805
- skip_reason: z.ZodNullable<z.ZodString>;
9806
- }, "strip", z.ZodTypeAny, {
9807
- operators: {
9808
- target: string;
9809
- kind: "require" | "edit" | "not_edit" | "forbid";
9810
- }[];
9811
- skip_reason: string | null;
9812
- }, {
9813
- operators: {
9814
- target: string;
9815
- kind: "require" | "edit" | "not_edit" | "forbid";
9816
- }[];
9817
- skip_reason: string | null;
9818
- }>, "many">>;
9819
- client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
9820
- turn_id: z.ZodString;
9821
- envelope_index: z.ZodOptional<z.ZodNumber>;
9822
- timestamp: z.ZodString;
10957
+ event_type: z.ZodLiteral<"skill_phase_transition">;
10958
+ skill_name: z.ZodString;
10959
+ phase: z.ZodString;
10960
+ status: z.ZodEnum<["entered", "completed", "skipped", "failed"]>;
10961
+ checkpoint: z.ZodOptional<z.ZodString>;
10962
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
9823
10963
  kind: z.ZodLiteral<"fabric-event">;
9824
10964
  id: z.ZodString;
9825
10965
  ts: z.ZodNumber;
@@ -9827,53 +10967,37 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9827
10967
  correlation_id: z.ZodOptional<z.ZodString>;
9828
10968
  session_id: z.ZodOptional<z.ZodString>;
9829
10969
  }, "strip", z.ZodTypeAny, {
10970
+ status: "skipped" | "completed" | "failed" | "entered";
9830
10971
  id: string;
9831
10972
  ts: number;
9832
10973
  schema_version: 1;
9833
10974
  kind: "fabric-event";
9834
- event_type: "assistant_turn_observed";
9835
- timestamp: string;
9836
- kb_line_raw: string | null;
9837
- cite_ids: string[];
9838
- cite_tags: ("none" | "applied" | "dismissed")[];
9839
- cite_commitments: {
9840
- operators: {
9841
- target: string;
9842
- kind: "require" | "edit" | "not_edit" | "forbid";
9843
- }[];
9844
- skip_reason: string | null;
9845
- }[];
9846
- turn_id: string;
10975
+ phase: string;
10976
+ event_type: "skill_phase_transition";
10977
+ skill_name: string;
9847
10978
  correlation_id?: string | undefined;
9848
10979
  session_id?: string | undefined;
9849
- client?: "cursor" | "cc" | "codex" | undefined;
9850
- envelope_index?: number | undefined;
10980
+ elapsed_ms?: number | undefined;
10981
+ checkpoint?: string | undefined;
9851
10982
  }, {
10983
+ status: "skipped" | "completed" | "failed" | "entered";
9852
10984
  id: string;
9853
10985
  ts: number;
9854
10986
  schema_version: 1;
9855
10987
  kind: "fabric-event";
9856
- event_type: "assistant_turn_observed";
9857
- timestamp: string;
9858
- kb_line_raw: string | null;
9859
- turn_id: string;
10988
+ phase: string;
10989
+ event_type: "skill_phase_transition";
10990
+ skill_name: string;
9860
10991
  correlation_id?: string | undefined;
9861
10992
  session_id?: string | undefined;
9862
- cite_ids?: string[] | undefined;
9863
- cite_tags?: unknown[] | undefined;
9864
- cite_commitments?: {
9865
- operators: {
9866
- target: string;
9867
- kind: "require" | "edit" | "not_edit" | "forbid";
9868
- }[];
9869
- skip_reason: string | null;
9870
- }[] | undefined;
9871
- client?: "cursor" | "cc" | "codex" | undefined;
9872
- envelope_index?: number | undefined;
10993
+ elapsed_ms?: number | undefined;
10994
+ checkpoint?: string | undefined;
9873
10995
  }>, z.ZodObject<{
9874
- event_type: z.ZodLiteral<"cite_policy_activated">;
9875
- policy_version: z.ZodString;
9876
- timestamp: z.ZodString;
10996
+ event_type: z.ZodLiteral<"skill_trigger_candidate">;
10997
+ skill_name: z.ZodString;
10998
+ trigger_source: z.ZodEnum<["user", "auto_invoke", "ai_self_trigger", "chained"]>;
10999
+ signal: z.ZodString;
11000
+ invoked: z.ZodBoolean;
9877
11001
  kind: z.ZodLiteral<"fabric-event">;
9878
11002
  id: z.ZodString;
9879
11003
  ts: z.ZodNumber;
@@ -9885,9 +11009,11 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9885
11009
  ts: number;
9886
11010
  schema_version: 1;
9887
11011
  kind: "fabric-event";
9888
- event_type: "cite_policy_activated";
9889
- timestamp: string;
9890
- policy_version: string;
11012
+ event_type: "skill_trigger_candidate";
11013
+ skill_name: string;
11014
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
11015
+ signal: string;
11016
+ invoked: boolean;
9891
11017
  correlation_id?: string | undefined;
9892
11018
  session_id?: string | undefined;
9893
11019
  }, {
@@ -9895,13 +11021,21 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9895
11021
  ts: number;
9896
11022
  schema_version: 1;
9897
11023
  kind: "fabric-event";
9898
- event_type: "cite_policy_activated";
9899
- timestamp: string;
9900
- policy_version: string;
11024
+ event_type: "skill_trigger_candidate";
11025
+ skill_name: string;
11026
+ trigger_source: "user" | "auto_invoke" | "ai_self_trigger" | "chained";
11027
+ signal: string;
11028
+ invoked: boolean;
9901
11029
  correlation_id?: string | undefined;
9902
11030
  session_id?: string | undefined;
9903
11031
  }>, z.ZodObject<{
9904
- event_type: z.ZodLiteral<"cite_contract_policy_activated">;
11032
+ event_type: z.ZodLiteral<"llm_judge_run">;
11033
+ prompt: z.ZodString;
11034
+ version: z.ZodString;
11035
+ model: z.ZodString;
11036
+ input_trace_id: z.ZodString;
11037
+ score: z.ZodNumber;
11038
+ rationale: z.ZodString;
9905
11039
  kind: z.ZodLiteral<"fabric-event">;
9906
11040
  id: z.ZodString;
9907
11041
  ts: z.ZodNumber;
@@ -9910,26 +11044,37 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9910
11044
  session_id: z.ZodOptional<z.ZodString>;
9911
11045
  }, "strip", z.ZodTypeAny, {
9912
11046
  id: string;
11047
+ version: string;
9913
11048
  ts: number;
11049
+ model: string;
9914
11050
  schema_version: 1;
9915
11051
  kind: "fabric-event";
9916
- event_type: "cite_contract_policy_activated";
11052
+ rationale: string;
11053
+ event_type: "llm_judge_run";
11054
+ prompt: string;
11055
+ input_trace_id: string;
11056
+ score: number;
9917
11057
  correlation_id?: string | undefined;
9918
11058
  session_id?: string | undefined;
9919
11059
  }, {
9920
11060
  id: string;
11061
+ version: string;
9921
11062
  ts: number;
11063
+ model: string;
9922
11064
  schema_version: 1;
9923
11065
  kind: "fabric-event";
9924
- event_type: "cite_contract_policy_activated";
11066
+ rationale: string;
11067
+ event_type: "llm_judge_run";
11068
+ prompt: string;
11069
+ input_trace_id: string;
11070
+ score: number;
9925
11071
  correlation_id?: string | undefined;
9926
11072
  session_id?: string | undefined;
9927
11073
  }>, z.ZodObject<{
9928
- event_type: z.ZodLiteral<"knowledge_meta_auto_healed">;
9929
- previous_revision_hash: z.ZodString;
9930
- revision_hash: z.ZodString;
9931
- trigger: z.ZodLiteral<"read">;
9932
- caller: z.ZodOptional<z.ZodEnum<["planContext", "getKnowledgeSections", "getKnowledge", "extractKnowledge"]>>;
11074
+ event_type: z.ZodLiteral<"client_capability_snapshot">;
11075
+ client: z.ZodEnum<["cc", "codex", "cursor"]>;
11076
+ capabilities: z.ZodArray<z.ZodString, "many">;
11077
+ version: z.ZodString;
9933
11078
  kind: z.ZodLiteral<"fabric-event">;
9934
11079
  id: z.ZodString;
9935
11080
  ts: z.ZodNumber;
@@ -9938,34 +11083,28 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9938
11083
  session_id: z.ZodOptional<z.ZodString>;
9939
11084
  }, "strip", z.ZodTypeAny, {
9940
11085
  id: string;
9941
- revision_hash: string;
9942
- previous_revision_hash: string;
11086
+ version: string;
9943
11087
  ts: number;
9944
11088
  schema_version: 1;
11089
+ capabilities: string[];
9945
11090
  kind: "fabric-event";
9946
- event_type: "knowledge_meta_auto_healed";
9947
- trigger: "read";
11091
+ event_type: "client_capability_snapshot";
11092
+ client: "cursor" | "cc" | "codex";
9948
11093
  correlation_id?: string | undefined;
9949
11094
  session_id?: string | undefined;
9950
- caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
9951
11095
  }, {
9952
11096
  id: string;
9953
- revision_hash: string;
9954
- previous_revision_hash: string;
11097
+ version: string;
9955
11098
  ts: number;
9956
11099
  schema_version: 1;
11100
+ capabilities: string[];
9957
11101
  kind: "fabric-event";
9958
- event_type: "knowledge_meta_auto_healed";
9959
- trigger: "read";
11102
+ event_type: "client_capability_snapshot";
11103
+ client: "cursor" | "cc" | "codex";
9960
11104
  correlation_id?: string | undefined;
9961
11105
  session_id?: string | undefined;
9962
- caller?: "planContext" | "getKnowledgeSections" | "getKnowledge" | "extractKnowledge" | undefined;
9963
11106
  }>, z.ZodObject<{
9964
- event_type: z.ZodLiteral<"events_rotated">;
9965
- cutoff_ts: z.ZodString;
9966
- archived_count: z.ZodNumber;
9967
- kept_count: z.ZodNumber;
9968
- archive_path: z.ZodString;
11107
+ event_type: z.ZodLiteral<"session_ended">;
9969
11108
  kind: z.ZodLiteral<"fabric-event">;
9970
11109
  id: z.ZodString;
9971
11110
  ts: z.ZodNumber;
@@ -9977,11 +11116,7 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9977
11116
  ts: number;
9978
11117
  schema_version: 1;
9979
11118
  kind: "fabric-event";
9980
- event_type: "events_rotated";
9981
- archive_path: string;
9982
- cutoff_ts: string;
9983
- archived_count: number;
9984
- kept_count: number;
11119
+ event_type: "session_ended";
9985
11120
  correlation_id?: string | undefined;
9986
11121
  session_id?: string | undefined;
9987
11122
  }, {
@@ -9989,18 +11124,16 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
9989
11124
  ts: number;
9990
11125
  schema_version: 1;
9991
11126
  kind: "fabric-event";
9992
- event_type: "events_rotated";
9993
- archive_path: string;
9994
- cutoff_ts: string;
9995
- archived_count: number;
9996
- kept_count: number;
11127
+ event_type: "session_ended";
9997
11128
  correlation_id?: string | undefined;
9998
11129
  session_id?: string | undefined;
9999
11130
  }>, z.ZodObject<{
10000
- event_type: z.ZodLiteral<"serve_lock_cleared">;
10001
- pid: z.ZodNumber;
10002
- age_ms: z.ZodNumber;
10003
- timestamp: z.ZodString;
11131
+ event_type: z.ZodLiteral<"file_mutated">;
11132
+ path: z.ZodString;
11133
+ tool_call_id: z.ZodString;
11134
+ tool_name: z.ZodOptional<z.ZodString>;
11135
+ source_event_id: z.ZodOptional<z.ZodString>;
11136
+ store_id: z.ZodOptional<z.ZodString>;
10004
11137
  kind: z.ZodLiteral<"fabric-event">;
10005
11138
  id: z.ZodString;
10006
11139
  ts: z.ZodNumber;
@@ -10008,33 +11141,33 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
10008
11141
  correlation_id: z.ZodOptional<z.ZodString>;
10009
11142
  session_id: z.ZodOptional<z.ZodString>;
10010
11143
  }, "strip", z.ZodTypeAny, {
11144
+ path: string;
10011
11145
  id: string;
10012
11146
  ts: number;
10013
11147
  schema_version: 1;
10014
11148
  kind: "fabric-event";
10015
- event_type: "serve_lock_cleared";
10016
- timestamp: string;
10017
- pid: number;
10018
- age_ms: number;
11149
+ event_type: "file_mutated";
11150
+ tool_call_id: string;
10019
11151
  correlation_id?: string | undefined;
10020
11152
  session_id?: string | undefined;
11153
+ tool_name?: string | undefined;
11154
+ source_event_id?: string | undefined;
11155
+ store_id?: string | undefined;
10021
11156
  }, {
11157
+ path: string;
10022
11158
  id: string;
10023
11159
  ts: number;
10024
11160
  schema_version: 1;
10025
11161
  kind: "fabric-event";
10026
- event_type: "serve_lock_cleared";
10027
- timestamp: string;
10028
- pid: number;
10029
- age_ms: number;
11162
+ event_type: "file_mutated";
11163
+ tool_call_id: string;
10030
11164
  correlation_id?: string | undefined;
10031
11165
  session_id?: string | undefined;
11166
+ tool_name?: string | undefined;
11167
+ source_event_id?: string | undefined;
11168
+ store_id?: string | undefined;
10032
11169
  }>, z.ZodObject<{
10033
- event_type: z.ZodLiteral<"knowledge_enriched">;
10034
- path: z.ZodString;
10035
- added_fields: z.ZodArray<z.ZodEnum<["intent_clues", "tech_stack", "impact", "must_read_if"]>, "many">;
10036
- mode: z.ZodEnum<["auto", "preview", "readonly", "interactive"]>;
10037
- timestamp: z.ZodString;
11170
+ event_type: z.ZodLiteral<"precompact_observed">;
10038
11171
  kind: z.ZodLiteral<"fabric-event">;
10039
11172
  id: z.ZodString;
10040
11173
  ts: z.ZodNumber;
@@ -10042,35 +11175,25 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
10042
11175
  correlation_id: z.ZodOptional<z.ZodString>;
10043
11176
  session_id: z.ZodOptional<z.ZodString>;
10044
11177
  }, "strip", z.ZodTypeAny, {
10045
- path: string;
10046
11178
  id: string;
10047
11179
  ts: number;
10048
11180
  schema_version: 1;
10049
11181
  kind: "fabric-event";
10050
- event_type: "knowledge_enriched";
10051
- timestamp: string;
10052
- mode: "auto" | "preview" | "readonly" | "interactive";
10053
- added_fields: ("intent_clues" | "tech_stack" | "impact" | "must_read_if")[];
11182
+ event_type: "precompact_observed";
10054
11183
  correlation_id?: string | undefined;
10055
11184
  session_id?: string | undefined;
10056
11185
  }, {
10057
- path: string;
10058
11186
  id: string;
10059
11187
  ts: number;
10060
11188
  schema_version: 1;
10061
11189
  kind: "fabric-event";
10062
- event_type: "knowledge_enriched";
10063
- timestamp: string;
10064
- mode: "auto" | "preview" | "readonly" | "interactive";
10065
- added_fields: ("intent_clues" | "tech_stack" | "impact" | "must_read_if")[];
11190
+ event_type: "precompact_observed";
10066
11191
  correlation_id?: string | undefined;
10067
11192
  session_id?: string | undefined;
10068
11193
  }>, z.ZodObject<{
10069
- event_type: z.ZodLiteral<"session_archive_attempted">;
10070
- outcome: z.ZodEnum<["proposed", "viability_failed", "user_dismissed", "skipped_no_signal"]>;
10071
- covered_through_ts: z.ZodNumber;
10072
- candidates_proposed: z.ZodDefault<z.ZodNumber>;
10073
- knowledge_proposed_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
11194
+ event_type: z.ZodLiteral<"graph_edge_candidate_requested">;
11195
+ stable_id: z.ZodString;
11196
+ store: z.ZodOptional<z.ZodString>;
10074
11197
  kind: z.ZodLiteral<"fabric-event">;
10075
11198
  id: z.ZodString;
10076
11199
  ts: z.ZodNumber;
@@ -10079,28 +11202,24 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
10079
11202
  session_id: z.ZodOptional<z.ZodString>;
10080
11203
  }, "strip", z.ZodTypeAny, {
10081
11204
  id: string;
10082
- covered_through_ts: number;
11205
+ stable_id: string;
10083
11206
  ts: number;
10084
11207
  schema_version: 1;
10085
11208
  kind: "fabric-event";
10086
- event_type: "session_archive_attempted";
10087
- outcome: "user_dismissed" | "proposed" | "viability_failed" | "skipped_no_signal";
10088
- candidates_proposed: number;
10089
- knowledge_proposed_ids: string[];
11209
+ event_type: "graph_edge_candidate_requested";
10090
11210
  correlation_id?: string | undefined;
10091
11211
  session_id?: string | undefined;
11212
+ store?: string | undefined;
10092
11213
  }, {
10093
11214
  id: string;
10094
- covered_through_ts: number;
11215
+ stable_id: string;
10095
11216
  ts: number;
10096
11217
  schema_version: 1;
10097
11218
  kind: "fabric-event";
10098
- event_type: "session_archive_attempted";
10099
- outcome: "user_dismissed" | "proposed" | "viability_failed" | "skipped_no_signal";
11219
+ event_type: "graph_edge_candidate_requested";
10100
11220
  correlation_id?: string | undefined;
10101
11221
  session_id?: string | undefined;
10102
- candidates_proposed?: number | undefined;
10103
- knowledge_proposed_ids?: string[] | undefined;
11222
+ store?: string | undefined;
10104
11223
  }>]>;
10105
11224
  type KnowledgeContextPlannedEvent = z.infer<typeof knowledgeContextPlannedEventSchema>;
10106
11225
  type KnowledgeSelectionEvent = z.infer<typeof knowledgeSelectionEventSchema>;
@@ -10146,7 +11265,21 @@ type EventsRotatedEvent = z.infer<typeof eventsRotatedEventSchema>;
10146
11265
  type ServeLockClearedEvent = z.infer<typeof serveLockClearedEventSchema>;
10147
11266
  type KnowledgeEnrichedEvent = z.infer<typeof knowledgeEnrichedEventSchema>;
10148
11267
  type SessionArchiveAttemptedEvent = z.infer<typeof sessionArchiveAttemptedEventSchema>;
10149
- type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | InstallDiffAppliedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | BootstrapMarkerMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent | KnowledgeProposedEvent | KnowledgePromoteStartedEvent | KnowledgePromotedEvent | KnowledgePromoteFailedEvent | KnowledgeLayerChangedEvent | KnowledgeIdRedirectEvent | KnowledgeSlugRenamedEvent | KnowledgeDemotedEvent | KnowledgeArchivedEvent | KnowledgeArchiveAttemptedEvent | KnowledgeUnarchivedEvent | KnowledgeDeferredEvent | KnowledgeRejectedEvent | KnowledgeConsumedEvent | KnowledgeScopeDegradedEvent | PendingAutoArchivedEvent | KnowledgePathDangledEvent | DoctorRunEvent | RelevanceMigrationRunEvent | AssistantTurnObservedEvent | CitePolicyActivatedEvent | CiteContractPolicyActivatedEvent | KnowledgeMetaAutoHealedEvent | EventsRotatedEvent | ServeLockClearedEvent | KnowledgeEnrichedEvent | SessionArchiveAttemptedEvent;
11268
+ type HookSurfaceEmittedEvent = z.infer<typeof hookSurfaceEmittedEventSchema>;
11269
+ type HookSignalEmittedEvent = z.infer<typeof hookSignalEmittedEventSchema>;
11270
+ type McpStdioTraceEvent = z.infer<typeof mcpStdioTraceEventSchema>;
11271
+ type PayloadGuardObservedEvent = z.infer<typeof payloadGuardObservedEventSchema>;
11272
+ type SkillInvocationStartedEvent = z.infer<typeof skillInvocationStartedEventSchema>;
11273
+ type SkillInvocationCompletedEvent = z.infer<typeof skillInvocationCompletedEventSchema>;
11274
+ type SkillPhaseTransitionEvent = z.infer<typeof skillPhaseTransitionEventSchema>;
11275
+ type SkillTriggerCandidateEvent = z.infer<typeof skillTriggerCandidateEventSchema>;
11276
+ type LlmJudgeRunEvent = z.infer<typeof llmJudgeRunEventSchema>;
11277
+ type ClientCapabilitySnapshotEvent = z.infer<typeof clientCapabilitySnapshotEventSchema>;
11278
+ type SessionEndedEvent = z.infer<typeof sessionEndedEventSchema>;
11279
+ type FileMutatedEvent = z.infer<typeof fileMutatedEventSchema>;
11280
+ type PrecompactObservedEvent = z.infer<typeof precompactObservedEventSchema>;
11281
+ type GraphEdgeCandidateRequestedEvent = z.infer<typeof graphEdgeCandidateRequestedEventSchema>;
11282
+ type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | InstallDiffAppliedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | BootstrapMarkerMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent | KnowledgeProposedEvent | KnowledgePromoteStartedEvent | KnowledgePromotedEvent | KnowledgePromoteFailedEvent | KnowledgeLayerChangedEvent | KnowledgeIdRedirectEvent | KnowledgeSlugRenamedEvent | KnowledgeDemotedEvent | KnowledgeArchivedEvent | KnowledgeArchiveAttemptedEvent | KnowledgeUnarchivedEvent | KnowledgeDeferredEvent | KnowledgeRejectedEvent | KnowledgeConsumedEvent | KnowledgeScopeDegradedEvent | PendingAutoArchivedEvent | KnowledgePathDangledEvent | DoctorRunEvent | RelevanceMigrationRunEvent | AssistantTurnObservedEvent | CitePolicyActivatedEvent | CiteContractPolicyActivatedEvent | KnowledgeMetaAutoHealedEvent | EventsRotatedEvent | ServeLockClearedEvent | KnowledgeEnrichedEvent | SessionArchiveAttemptedEvent | HookSurfaceEmittedEvent | HookSignalEmittedEvent | McpStdioTraceEvent | PayloadGuardObservedEvent | SkillInvocationStartedEvent | SkillInvocationCompletedEvent | SkillPhaseTransitionEvent | SkillTriggerCandidateEvent | LlmJudgeRunEvent | ClientCapabilitySnapshotEvent | SessionEndedEvent | FileMutatedEvent | PrecompactObservedEvent | GraphEdgeCandidateRequestedEvent;
10150
11283
  type EventLedgerEventType = EventLedgerEvent["event_type"];
10151
11284
  type EventLedgerEventInputFor<T extends EventLedgerEvent> = T extends EventLedgerEvent ? Omit<T, "kind" | "id" | "ts" | "schema_version" | "correlation_id" | "session_id"> & Partial<Pick<T, "id" | "ts" | "correlation_id" | "session_id">> : never;
10152
11285
  type EventLedgerEventInput = EventLedgerEventInputFor<EventLedgerEvent>;
@@ -10188,4 +11321,44 @@ declare function normalizeCiteTag(rawTag: string): CiteTag;
10188
11321
  */
10189
11322
  declare function parseCiteLine(raw: string): ParseCiteLineResult;
10190
11323
 
10191
- export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type AssistantTurnObservedEvent, type BootstrapMarkerMigratedEvent, type CandidateFileEntry, type CandidateFileFamily, type CiteCommitment, type CiteCommitmentOperator, type CiteCommitmentOperatorKind, type CiteContractPolicyActivatedEvent, type CitePolicyActivatedEvent, type CiteTag, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type CodexSkillPathMigratedEvent, type CrossStoreLintInput, type CrossStoreRefViolation, type DebugBundle, type DebugBundleInput, type DoctorRunEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EntryLayer, type EntryScopeMetadata, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type EventsRotatedEvent, type FabricConfigSchemaShape, type FabricEvent, type FailureStage, type FailureTrace, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, GLOBAL_BINDINGS_DIR, GLOBAL_REF_PATTERN, GLOBAL_STATE_DIR, type GlobalConfig, type GlobalRef, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, type InitStoreOptions, type InstallDiffAppliedEvent, KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION, KNOWN_SCOPE_PREFIXES, type KnowledgeArchiveAttemptedEvent, type KnowledgeArchivedEvent, type KnowledgeConsumedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDeferredEvent, type KnowledgeDemotedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeEnrichedEvent, type KnowledgeIdRedirectEvent, type KnowledgeLayerChangedEvent, type KnowledgeMetaAutoHealedEvent, type KnowledgePathDangledEvent, type KnowledgePromoteFailedEvent, type KnowledgePromoteStartedEvent, type KnowledgePromotedEvent, type KnowledgeProposedEvent, type KnowledgeProvenance, type KnowledgeRejectedEvent, type KnowledgeScopeDegradedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, type KnowledgeSlugRenamedEvent, type KnowledgeTestIndex, type KnowledgeTestLink, type KnowledgeTestOrphanAnnotation, KnowledgeType, type KnowledgeUnarchivedEvent, Layer, type LedgerAppendedEvent, LedgerEntry, type LocalKnowledgeId, type LockApprovedEvent, type LockDriftEvent, MCP_STORE_AWARE_CONTRACTS, MCP_STORE_AWARE_TOOLS, type McpConfigMigratedEvent, type McpEventLedgerEvent, type McpStoreAwareContract, type McpStoreAwareTool, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, type MountedStore, type MountedStoreDir, ONBOARD_SLOT_NAMES, ONBOARD_SLOT_TOTAL, type OnboardSlot, PARITY_CLIENTS, PARITY_SURFACES, PERSONAL_SCOPE, PERSONAL_STORE_SENTINEL, PROJECT_ROOT_SIGNALS, type PanelFieldGroup, type PanelFieldMeta, type ParityCapability, type ParityClient, type ParityClientExpectation, type ParityMatrix, type ParitySurface, type ParseCiteLineResult, type ParsedGlobalRef, type PendingAutoArchivedEvent, type ProjectRootGoldenCase, type ProjectRootResolution, type ProjectRootResolver, type ProjectRootSignal, type ProjectRootSignals, type QualifiedCandidate, type QualifiedIdResolution, REDACTION_PLACEHOLDER_PREFIX, type ReadSetEntry, type ReadSetGoldenCase, type ReapplyCompletedEvent, type RelevanceMigrationRunEvent, type RequiredStoreEntry, type ResolutionCandidate, type ResolutionResult, type ResolutionWarning, type ResolveOptions, type ResolvedBindingsSnapshot, type ResolvedEntry, ResolverNotImplementedError, SCOPE_COORDINATE_PATTERN, STORES_ROOT_DIR, STORE_GITIGNORE, STORE_KNOWLEDGE_TYPE_DIRS, STORE_LAYOUT, STORE_PENDING_DIR, STORE_RESOLVER_WARNING_CODES, STORE_UUID_PATTERN, type ScopeCoordinate, type SecretFinding, type ServeLockClearedEvent, type SessionArchiveAttemptedEvent, StableId, type StoreAwareEntry, type StoreCounters, type StoreExplain, type StoreIdentity, type StoreKnowledgeRef, type StoreLayout, type StoreReadSet, type StoreResolveInput, type StoreResolver, type StoreResolverWarning, type StoreResolverWarningCode, type StoreVisibility, UID_SEGMENT_PATTERN, type Uid, type ValidateResult, type WriteBindingsSnapshotOptions, type WriteTarget, type WrittenToStore, addMountedStore, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aggregatePendingAcrossStores, aiLedgerEntrySchema, allocateKnowledgeId, assistantTurnObservedEventSchema, bindRequiredStore, bindingsSnapshotPath, bootstrapMarkerMigratedEventSchema, buildDebugBundle, buildFailureTrace, candidateFileEntrySchema, citeContractPolicyActivatedEventSchema, citePolicyActivatedEventSchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, codexSkillPathMigratedEventSchema, createProjectRootResolver, createStoreResolver, defaultAgentsMetaCounters, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, detachMountedStore, doctorRunEventSchema, driftDetectedEventSchema, editIntentCheckedEventSchema, entryScopeMetadataSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, eventsRotatedEventSchema, explainStore, fabricConfigSchema, fabricEventSchema, findMountedStore, findStoreExecutableViolations, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, formatGlobalRef, getPanelFieldByKey, getPanelFields, globalConfigSchema, globalRefSchema, hasSecrets, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, initStore, installDiffAppliedEventSchema, isKnowledgeStableId, isPersonalLeakIntoSharedStore, isPersonalScope, knowledgeArchiveAttemptedEventSchema, knowledgeArchivedEventSchema, knowledgeConsumedEventSchema, knowledgeContextPlannedEventSchema, knowledgeDeferredEventSchema, knowledgeDemotedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeEnrichedEventSchema, knowledgeIdRedirectEventSchema, knowledgeLayerChangedEventSchema, knowledgeMetaAutoHealedEventSchema, knowledgePathDangledEventSchema, knowledgePromoteFailedEventSchema, knowledgePromoteStartedEventSchema, knowledgePromotedEventSchema, knowledgeProposedEventSchema, knowledgeProvenanceSchema, knowledgeRejectedEventSchema, knowledgeScopeDegradedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, knowledgeSlugRenamedEventSchema, knowledgeTestIndexSchema, knowledgeTestLinkSchema, knowledgeTestOrphanAnnotationSchema, knowledgeUnarchivedEventSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lintCrossStoreReferences, listStoreKnowledge, localKnowledgeIdSchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, mountedStoreSchema, normalizeCiteTag, onboardSlotSchema, parityCapabilitySchema, parityClientExpectationSchema, parityClientSchema, parityMatrixSchema, paritySurfaceSchema, parseCiteLine, parseGlobalRef, pendingAutoArchivedEventSchema, projectRootGoldenCaseSchema, projectRootGoldenFileSchema, projectRootResolutionSchema, projectRootSignalSchema, projectRootSignalsSchema, readBindingsSnapshot, readKnowledgeAcrossStores, readSetEntrySchema, readSetGoldenCaseSchema, readSetGoldenFileSchema, readStoreIdentity, reapplyCompletedEventSchema, recognizeStoreDir, redactSecrets, relevanceMigrationRunEventSchema, requiredStoreEntrySchema, resolveCandidates, resolveStoreQualifiedId, resolvedBindingsSnapshotSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, scanForSecrets, scopeCoordinateSchema, scopeRoot, serveLockClearedEventSchema, sessionArchiveAttemptedEventSchema, storeAwareEntrySchema, storeCountersSchema, storeIdentitySchema, storeKnowledgeTypeDir, storeReadSetSchema, storeRelativePath, storeResolveInputSchema, storeResolverWarningCodeSchema, storeResolverWarningSchema, storeUuidSchema, uidSchema, withDerivedAgentsMetaNodeDefaults, writeBindingsSnapshot, writeTargetSchema, writtenToStoreSchema };
11324
+ /**
11325
+ * Tokenize bilingual text into BM25 terms.
11326
+ *
11327
+ * Latin/digit runs become lower-cased word tokens; CJK runs become overlapping
11328
+ * character bigrams (singleton for length-1 runs). Returns terms in document
11329
+ * order, including duplicates — callers that need term frequencies count them,
11330
+ * callers that need a vocabulary dedupe.
11331
+ */
11332
+ declare function tokenize(text: string): string[];
11333
+
11334
+ type RetrievalBudgetProfile = "conservative" | "balanced" | "generous";
11335
+ interface ResolvedRetrievalBudget {
11336
+ /** MCP layer — max candidates returned by fab_plan_context (count). */
11337
+ topK: number;
11338
+ /** MCP layer — payload soft-warn threshold (bytes). */
11339
+ payloadWarnBytes: number;
11340
+ /** MCP layer — payload hard trim ceiling (bytes). */
11341
+ payloadHardBytes: number;
11342
+ /** Injection layer — SessionStart broad-menu body char budget. */
11343
+ injectionChars: number;
11344
+ }
11345
+ declare const DEFAULT_RETRIEVAL_BUDGET_PROFILE: RetrievalBudgetProfile;
11346
+ /** The per-field overrides that, when present, take precedence over the profile. */
11347
+ interface RetrievalBudgetOverrides {
11348
+ profile?: RetrievalBudgetProfile;
11349
+ topK?: number;
11350
+ payloadWarnBytes?: number;
11351
+ payloadHardBytes?: number;
11352
+ injectionChars?: number;
11353
+ }
11354
+ /**
11355
+ * Resolve the layered retrieval budget: start from the named profile (default
11356
+ * `balanced`), then let any explicitly-supplied per-field override win. Each
11357
+ * field is resolved independently, so an operator can pin a single knob (e.g.
11358
+ * payloadHardBytes) while the rest follow the chosen profile.
11359
+ */
11360
+ declare function resolveRetrievalBudget(overrides?: RetrievalBudgetOverrides): ResolvedRetrievalBudget;
11361
+ /** Exposed for tests / introspection — the raw profile table. */
11362
+ declare function retrievalBudgetProfile(profile: RetrievalBudgetProfile): ResolvedRetrievalBudget;
11363
+
11364
+ export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type AssistantTurnObservedEvent, type BootstrapMarkerMigratedEvent, type CandidateFileEntry, type CandidateFileFamily, type CiteCommitment, type CiteCommitmentOperator, type CiteCommitmentOperatorKind, type CiteContractPolicyActivatedEvent, type CitePolicyActivatedEvent, type CiteTag, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type ClientCapabilitySnapshotEvent, type CodexSkillPathMigratedEvent, type CrossStoreLintInput, type CrossStoreRefViolation, DEFAULT_RETRIEVAL_BUDGET_PROFILE, type DebugBundle, type DebugBundleInput, type DoctorRunEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EntryLayer, type EntryScopeMetadata, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type EventsRotatedEvent, FabricConfig, type FabricConfigSchemaShape, type FabricEvent, type FailureStage, type FailureTrace, type FileMutatedEvent, type FindStoreExecutableViolationsOptions, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, GLOBAL_BINDINGS_DIR, GLOBAL_REF_PATTERN, GLOBAL_STATE_DIR, type GlobalConfig, type GlobalRef, type GraphEdgeCandidateRequestedEvent, type HookSignalEmittedEvent, type HookSurfaceEmittedEvent, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, type InitStoreOptions, type InstallDiffAppliedEvent, KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION, KNOWN_SCOPE_PREFIXES, type KnowledgeArchiveAttemptedEvent, type KnowledgeArchivedEvent, type KnowledgeConsumedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDeferredEvent, type KnowledgeDemotedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeEnrichedEvent, type KnowledgeIdRedirectEvent, type KnowledgeLayerChangedEvent, type KnowledgeMetaAutoHealedEvent, type KnowledgePathDangledEvent, type KnowledgePromoteFailedEvent, type KnowledgePromoteStartedEvent, type KnowledgePromotedEvent, type KnowledgeProposedEvent, type KnowledgeProvenance, type KnowledgeRejectedEvent, type KnowledgeScopeDegradedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, type KnowledgeSlugRenamedEvent, type KnowledgeTestIndex, type KnowledgeTestLink, type KnowledgeTestOrphanAnnotation, KnowledgeType, type KnowledgeUnarchivedEvent, Layer, type LedgerAppendedEvent, LedgerEntry, type LlmJudgeRunEvent, type LocalKnowledgeId, type LockApprovedEvent, type LockDriftEvent, MCP_STORE_AWARE_CONTRACTS, MCP_STORE_AWARE_TOOLS, type McpConfigMigratedEvent, type McpEventLedgerEvent, type McpStdioTraceEvent, type McpStoreAwareContract, type McpStoreAwareTool, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, type MountedStore, type MountedStoreDir, ONBOARD_SLOT_NAMES, ONBOARD_SLOT_TOTAL, type OnboardSlot, PARITY_CLIENTS, PARITY_SURFACES, PERSONAL_SCOPE, PERSONAL_STORE_SENTINEL, PROJECT_ROOT_SIGNALS, type PanelFieldGroup, type PanelFieldMeta, type ParityCapability, type ParityClient, type ParityClientExpectation, type ParityMatrix, type ParitySurface, type ParseCiteLineResult, type ParsedGlobalRef, type PayloadGuardObservedEvent, type PendingAutoArchivedEvent, type PrecompactObservedEvent, type ProjectRootGoldenCase, type ProjectRootResolution, type ProjectRootResolver, type ProjectRootSignal, type ProjectRootSignals, type QualifiedCandidate, type QualifiedIdResolution, REDACTION_PLACEHOLDER_PREFIX, type ReadSetEntry, type ReadSetGoldenCase, type ReapplyCompletedEvent, type RelevanceMigrationRunEvent, type RequiredStoreEntry, type ResolutionCandidate, type ResolutionResult, type ResolutionWarning, type ResolveOptions, type ResolvedBindingsSnapshot, type ResolvedEntry, type ResolvedRetrievalBudget, ResolverNotImplementedError, type RetrievalBudgetOverrides, type RetrievalBudgetProfile, SCOPE_COORDINATE_PATTERN, STORES_ROOT_DIR, STORE_GITIGNORE, STORE_KNOWLEDGE_TYPE_DIRS, STORE_LAYOUT, STORE_PENDING_DIR, STORE_RESOLVER_WARNING_CODES, STORE_UUID_PATTERN, type ScanRecommendationInput, type ScopeCoordinate, type SecretFinding, type ServeLockClearedEvent, type SessionArchiveAttemptedEvent, type SessionEndedEvent, type SkillInvocationCompletedEvent, type SkillInvocationStartedEvent, type SkillPhaseTransitionEvent, type SkillTriggerCandidateEvent, StableId, type StoreAwareEntry, type StoreCounters, type StoreExplain, type StoreIdentity, type StoreKnowledgeRef, type StoreLayout, type StoreReadSet, type StoreResolveInput, type StoreResolver, type StoreResolverWarning, type StoreResolverWarningCode, type StoreVisibility, Translator, UID_SEGMENT_PATTERN, type Uid, type ValidateResult, type WriteBindingsSnapshotOptions, type WriteTarget, type WrittenToStore, addMountedStore, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aggregatePendingAcrossStores, aiLedgerEntrySchema, allocateKnowledgeId, assistantTurnObservedEventSchema, bindRequiredStore, bindingsSnapshotPath, bootstrapMarkerMigratedEventSchema, buildDebugBundle, buildFailureTrace, buildScanRecommendations, buildStoreResolveInput, candidateFileEntrySchema, citeContractPolicyActivatedEventSchema, citePolicyActivatedEventSchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, clientCapabilitySnapshotEventSchema, codexSkillPathMigratedEventSchema, createProjectRootResolver, createStoreResolver, defaultAgentsMetaCounters, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, detachMountedStore, doctorRunEventSchema, driftDetectedEventSchema, editIntentCheckedEventSchema, entryScopeMetadataSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, eventsRotatedEventSchema, explainStore, fabricConfigSchema, fabricEventSchema, fileMutatedEventSchema, findMountedStore, findStoreExecutableViolations, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, formatGlobalRef, getPanelFieldByKey, getPanelFields, globalConfigPath, globalConfigSchema, globalRefSchema, graphEdgeCandidateRequestedEventSchema, hasSecrets, hookSignalEmittedEventSchema, hookSurfaceEmittedEventSchema, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, initStore, installDiffAppliedEventSchema, isKnowledgeStableId, isPersonalLeakIntoSharedStore, isPersonalScope, knowledgeArchiveAttemptedEventSchema, knowledgeArchivedEventSchema, knowledgeConsumedEventSchema, knowledgeContextPlannedEventSchema, knowledgeDeferredEventSchema, knowledgeDemotedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeEnrichedEventSchema, knowledgeIdRedirectEventSchema, knowledgeLayerChangedEventSchema, knowledgeMetaAutoHealedEventSchema, knowledgePathDangledEventSchema, knowledgePromoteFailedEventSchema, knowledgePromoteStartedEventSchema, knowledgePromotedEventSchema, knowledgeProposedEventSchema, knowledgeProvenanceSchema, knowledgeRejectedEventSchema, knowledgeScopeDegradedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, knowledgeSlugRenamedEventSchema, knowledgeTestIndexSchema, knowledgeTestLinkSchema, knowledgeTestOrphanAnnotationSchema, knowledgeUnarchivedEventSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lintCrossStoreReferences, listStoreKnowledge, llmJudgeRunEventSchema, loadGlobalConfig, loadProjectConfig, localKnowledgeIdSchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpStdioTraceEventSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, mountedStoreSchema, normalizeCiteTag, onboardSlotSchema, parityCapabilitySchema, parityClientExpectationSchema, parityClientSchema, parityMatrixSchema, paritySurfaceSchema, parseCiteLine, parseGlobalRef, payloadGuardObservedEventSchema, pendingAutoArchivedEventSchema, precompactObservedEventSchema, projectConfigPath, projectRootGoldenCaseSchema, projectRootGoldenFileSchema, projectRootResolutionSchema, projectRootSignalSchema, projectRootSignalsSchema, readBindingsSnapshot, readKnowledgeAcrossStores, readSetEntrySchema, readSetGoldenCaseSchema, readSetGoldenFileSchema, readStoreIdentity, reapplyCompletedEventSchema, recognizeStoreDir, redactSecrets, relevanceMigrationRunEventSchema, requiredStoreEntrySchema, resolveCandidates, resolveGlobalRoot, resolveRetrievalBudget, resolveStoreQualifiedId, resolvedBindingsSnapshotSchema, retrievalBudgetProfile, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, saveGlobalConfig, saveProjectConfig, scanForSecrets, scopeCoordinateSchema, scopeRoot, scrubRemoteUrl, serveLockClearedEventSchema, sessionArchiveAttemptedEventSchema, sessionEndedEventSchema, skillInvocationCompletedEventSchema, skillInvocationStartedEventSchema, skillPhaseTransitionEventSchema, skillTriggerCandidateEventSchema, storeAwareEntrySchema, storeCountersSchema, storeIdentitySchema, storeKnowledgeTypeDir, storeReadSetSchema, storeRelativePath, storeResolveInputSchema, storeResolverWarningCodeSchema, storeResolverWarningSchema, storeUuidSchema, tokenize, uidSchema, withDerivedAgentsMetaNodeDefaults, writeBindingsSnapshot, writeTargetSchema, writtenToStoreSchema };