@fenglimg/fabric-shared 2.0.0-rc.1 → 2.0.0

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,9 +1,9 @@
1
1
  import { AgentsMetaNode, AgentsIdentitySource, AgentsLayer, AgentsTopologyType, HumanLockEntry, AgentsMeta, LedgerEntry } from './types/index.js';
2
- export { AgentsActivationTier, AgentsMetaCountersEnvelope, AgentsMetaKnowledgeTypeCounters, AgentsMetaNodeActivation, AiLedgerEntry, AuditMode, ClientPaths, FabricConfig, HumanLedgerEntry, McpPayloadLimits, RuleDescription, RuleDescriptionIndexItem } from './types/index.js';
2
+ export { AgentsActivationTier, AgentsMetaCountersEnvelope, AgentsMetaKnowledgeTypeCounters, AgentsMetaNodeActivation, AiLedgerEntry, AuditMode, ClientPaths, DefaultLayerFilter, FabricConfig, HumanLedgerEntry, KnowledgeLanguage, McpPayloadLimits, RuleDescription, RuleDescriptionIndexItem } from './types/index.js';
3
3
  export { Locale, Messages, PROTECTED_TOKENS, ProtectedToken, TranslationKey, Translator, createTranslator, defaultMessages, detectNodeLocale, enMessages, normalizeLocale, zhCNMessages } from './i18n/index.js';
4
4
  import { z } from 'zod';
5
5
  import { Layer, KnowledgeType, StableId } from './schemas/api-contracts.js';
6
- export { KNOWLEDGE_TYPE_CODES, KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, KnowledgeTypeCode, KnowledgeTypeSchema, LayerSchema, Maturity, MaturitySchema, StableIdSchema, annotateIntentRequestSchema, formatKnowledgeId, getRulesAnnotations, getRulesInputSchema, getRulesOutputSchema, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextInputSchema, planContextOutputSchema, ruleSectionsAnnotations, ruleSectionsInputSchema, ruleSectionsOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
6
+ export { FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, FabReviewInput, FabReviewInputSchema, FabReviewOutput, FabReviewOutputSchema, KNOWLEDGE_TYPE_CODES, KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, KnowledgeTypeCode, KnowledgeTypeSchema, LayerSchema, Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, ProposedReason, ProposedReasonSchema, StableIdSchema, annotateIntentRequestSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, getKnowledgeAnnotations, getKnowledgeInputSchema, getKnowledgeOutputSchema, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
7
7
 
8
8
  declare const AGENTS_META_LAYERS: readonly ["L0", "L1", "L2"];
9
9
  declare const AGENTS_META_TOPOLOGY_TYPES: readonly ["mirror", "cross-cutting", "domain", "local", "global"];
@@ -11,7 +11,7 @@ declare const AGENTS_META_IDENTITY_SOURCES: readonly ["declared", "derived"];
11
11
  declare const agentsLayerSchema: z.ZodEnum<["L0", "L1", "L2"]>;
12
12
  declare const agentsTopologyTypeSchema: z.ZodEnum<["mirror", "cross-cutting", "domain", "local", "global"]>;
13
13
  declare const agentsIdentitySourceSchema: z.ZodEnum<["declared", "derived"]>;
14
- type AgentsMetaNodeInput = Omit<AgentsMetaNode, "layer" | "topology_type"> & Partial<Pick<AgentsMetaNode, "layer" | "topology_type">>;
14
+ type AgentsMetaNodeInput = AgentsMetaNode;
15
15
  declare const ruleDescriptionSchema: z.ZodObject<{
16
16
  summary: z.ZodString;
17
17
  intent_clues: z.ZodArray<z.ZodString, "many">;
@@ -26,12 +26,16 @@ declare const ruleDescriptionSchema: z.ZodObject<{
26
26
  layer_reason: z.ZodOptional<z.ZodString>;
27
27
  created_at: z.ZodOptional<z.ZodString>;
28
28
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
29
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
30
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
29
31
  }, "strict", z.ZodTypeAny, {
30
32
  summary: string;
31
33
  intent_clues: string[];
32
34
  tech_stack: string[];
33
35
  impact: string[];
34
36
  must_read_if: string;
37
+ relevance_scope: "narrow" | "broad";
38
+ relevance_paths: string[];
35
39
  entities?: string[] | undefined;
36
40
  id?: string | undefined;
37
41
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -54,6 +58,8 @@ declare const ruleDescriptionSchema: z.ZodObject<{
54
58
  layer_reason?: string | undefined;
55
59
  created_at?: string | undefined;
56
60
  tags?: string[] | undefined;
61
+ relevance_scope?: "narrow" | "broad" | undefined;
62
+ relevance_paths?: string[] | undefined;
57
63
  }>;
58
64
  declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
59
65
  stable_id: z.ZodString;
@@ -74,12 +80,16 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
74
80
  layer_reason: z.ZodOptional<z.ZodString>;
75
81
  created_at: z.ZodOptional<z.ZodString>;
76
82
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
83
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
84
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
77
85
  }, "strict", z.ZodTypeAny, {
78
86
  summary: string;
79
87
  intent_clues: string[];
80
88
  tech_stack: string[];
81
89
  impact: string[];
82
90
  must_read_if: string;
91
+ relevance_scope: "narrow" | "broad";
92
+ relevance_paths: string[];
83
93
  entities?: string[] | undefined;
84
94
  id?: string | undefined;
85
95
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -102,6 +112,8 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
102
112
  layer_reason?: string | undefined;
103
113
  created_at?: string | undefined;
104
114
  tags?: string[] | undefined;
115
+ relevance_scope?: "narrow" | "broad" | undefined;
116
+ relevance_paths?: string[] | undefined;
105
117
  }>;
106
118
  }, "strict", z.ZodTypeAny, {
107
119
  description: {
@@ -110,6 +122,8 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
110
122
  tech_stack: string[];
111
123
  impact: string[];
112
124
  must_read_if: string;
125
+ relevance_scope: "narrow" | "broad";
126
+ relevance_paths: string[];
113
127
  entities?: string[] | undefined;
114
128
  id?: string | undefined;
115
129
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -138,6 +152,8 @@ declare const ruleDescriptionIndexItemSchema: z.ZodObject<{
138
152
  layer_reason?: string | undefined;
139
153
  created_at?: string | undefined;
140
154
  tags?: string[] | undefined;
155
+ relevance_scope?: "narrow" | "broad" | undefined;
156
+ relevance_paths?: string[] | undefined;
141
157
  };
142
158
  stable_id: string;
143
159
  level: "L0" | "L1" | "L2";
@@ -148,11 +164,6 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
148
164
  file: z.ZodString;
149
165
  content_ref: z.ZodOptional<z.ZodString>;
150
166
  scope_glob: z.ZodString;
151
- deps: z.ZodArray<z.ZodString, "many">;
152
- priority: z.ZodEnum<["high", "medium", "low"]>;
153
- level: z.ZodOptional<z.ZodEnum<["L0", "L1", "L2"]>>;
154
- layer: z.ZodEnum<["L0", "L1", "L2"]>;
155
- topology_type: z.ZodEnum<["mirror", "cross-cutting", "domain", "local", "global"]>;
156
167
  hash: z.ZodString;
157
168
  stable_id: z.ZodOptional<z.ZodString>;
158
169
  identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
@@ -180,12 +191,16 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
180
191
  layer_reason: z.ZodOptional<z.ZodString>;
181
192
  created_at: z.ZodOptional<z.ZodString>;
182
193
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
194
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
195
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
183
196
  }, "strict", z.ZodTypeAny, {
184
197
  summary: string;
185
198
  intent_clues: string[];
186
199
  tech_stack: string[];
187
200
  impact: string[];
188
201
  must_read_if: string;
202
+ relevance_scope: "narrow" | "broad";
203
+ relevance_paths: string[];
189
204
  entities?: string[] | undefined;
190
205
  id?: string | undefined;
191
206
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -208,22 +223,51 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
208
223
  layer_reason?: string | undefined;
209
224
  created_at?: string | undefined;
210
225
  tags?: string[] | undefined;
226
+ relevance_scope?: "narrow" | "broad" | undefined;
227
+ relevance_paths?: string[] | undefined;
211
228
  }>>;
212
229
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
213
- }, "strip", z.ZodTypeAny, {
214
- file: string;
215
- priority: "high" | "medium" | "low";
216
- hash: string;
217
- layer: "L0" | "L1" | "L2";
218
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
219
- scope_glob: string;
220
- deps: string[];
221
- description?: {
230
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
231
+ file: z.ZodString;
232
+ content_ref: z.ZodOptional<z.ZodString>;
233
+ scope_glob: z.ZodString;
234
+ hash: z.ZodString;
235
+ stable_id: z.ZodOptional<z.ZodString>;
236
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
237
+ activation: z.ZodOptional<z.ZodObject<{
238
+ tier: z.ZodEnum<["always", "path", "description"]>;
239
+ description: z.ZodOptional<z.ZodString>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ tier: "always" | "path" | "description";
242
+ description?: string | undefined;
243
+ }, {
244
+ tier: "always" | "path" | "description";
245
+ description?: string | undefined;
246
+ }>>;
247
+ description: z.ZodOptional<z.ZodObject<{
248
+ summary: z.ZodString;
249
+ intent_clues: z.ZodArray<z.ZodString, "many">;
250
+ tech_stack: z.ZodArray<z.ZodString, "many">;
251
+ impact: z.ZodArray<z.ZodString, "many">;
252
+ must_read_if: z.ZodString;
253
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
254
+ id: z.ZodOptional<z.ZodString>;
255
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
256
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
257
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
258
+ layer_reason: z.ZodOptional<z.ZodString>;
259
+ created_at: z.ZodOptional<z.ZodString>;
260
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
261
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
262
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
263
+ }, "strict", z.ZodTypeAny, {
222
264
  summary: string;
223
265
  intent_clues: string[];
224
266
  tech_stack: string[];
225
267
  impact: string[];
226
268
  must_read_if: string;
269
+ relevance_scope: "narrow" | "broad";
270
+ relevance_paths: string[];
227
271
  entities?: string[] | undefined;
228
272
  id?: string | undefined;
229
273
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -232,25 +276,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
232
276
  layer_reason?: string | undefined;
233
277
  created_at?: string | undefined;
234
278
  tags?: string[] | undefined;
235
- } | undefined;
236
- stable_id?: string | undefined;
237
- level?: "L0" | "L1" | "L2" | undefined;
238
- sections?: string[] | undefined;
239
- content_ref?: string | undefined;
240
- identity_source?: "declared" | "derived" | undefined;
241
- activation?: {
242
- tier: "always" | "path" | "description";
243
- description?: string | undefined;
244
- } | undefined;
245
- }, {
246
- file: string;
247
- priority: "high" | "medium" | "low";
248
- hash: string;
249
- layer: "L0" | "L1" | "L2";
250
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
251
- scope_glob: string;
252
- deps: string[];
253
- description?: {
279
+ }, {
254
280
  summary: string;
255
281
  intent_clues: string[];
256
282
  tech_stack: string[];
@@ -264,30 +290,51 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
264
290
  layer_reason?: string | undefined;
265
291
  created_at?: string | undefined;
266
292
  tags?: string[] | undefined;
267
- } | undefined;
268
- stable_id?: string | undefined;
269
- level?: "L0" | "L1" | "L2" | undefined;
270
- sections?: string[] | undefined;
271
- content_ref?: string | undefined;
272
- identity_source?: "declared" | "derived" | undefined;
273
- activation?: {
293
+ relevance_scope?: "narrow" | "broad" | undefined;
294
+ relevance_paths?: string[] | undefined;
295
+ }>>;
296
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
297
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
298
+ file: z.ZodString;
299
+ content_ref: z.ZodOptional<z.ZodString>;
300
+ scope_glob: z.ZodString;
301
+ hash: z.ZodString;
302
+ stable_id: z.ZodOptional<z.ZodString>;
303
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
304
+ activation: z.ZodOptional<z.ZodObject<{
305
+ tier: z.ZodEnum<["always", "path", "description"]>;
306
+ description: z.ZodOptional<z.ZodString>;
307
+ }, "strip", z.ZodTypeAny, {
274
308
  tier: "always" | "path" | "description";
275
309
  description?: string | undefined;
276
- } | undefined;
277
- }>, {
278
- file: string;
279
- priority: "high" | "medium" | "low";
280
- hash: string;
281
- layer: "L0" | "L1" | "L2";
282
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
283
- scope_glob: string;
284
- deps: string[];
285
- description?: {
310
+ }, {
311
+ tier: "always" | "path" | "description";
312
+ description?: string | undefined;
313
+ }>>;
314
+ description: z.ZodOptional<z.ZodObject<{
315
+ summary: z.ZodString;
316
+ intent_clues: z.ZodArray<z.ZodString, "many">;
317
+ tech_stack: z.ZodArray<z.ZodString, "many">;
318
+ impact: z.ZodArray<z.ZodString, "many">;
319
+ must_read_if: z.ZodString;
320
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
321
+ id: z.ZodOptional<z.ZodString>;
322
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
323
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
324
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
325
+ layer_reason: z.ZodOptional<z.ZodString>;
326
+ created_at: z.ZodOptional<z.ZodString>;
327
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
328
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
329
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
330
+ }, "strict", z.ZodTypeAny, {
286
331
  summary: string;
287
332
  intent_clues: string[];
288
333
  tech_stack: string[];
289
334
  impact: string[];
290
335
  must_read_if: string;
336
+ relevance_scope: "narrow" | "broad";
337
+ relevance_paths: string[];
291
338
  entities?: string[] | undefined;
292
339
  id?: string | undefined;
293
340
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -296,17 +343,92 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
296
343
  layer_reason?: string | undefined;
297
344
  created_at?: string | undefined;
298
345
  tags?: string[] | undefined;
299
- } | undefined;
300
- stable_id?: string | undefined;
301
- level?: "L0" | "L1" | "L2" | undefined;
302
- sections?: string[] | undefined;
303
- content_ref?: string | undefined;
304
- identity_source?: "declared" | "derived" | undefined;
305
- activation?: {
346
+ }, {
347
+ summary: string;
348
+ intent_clues: string[];
349
+ tech_stack: string[];
350
+ impact: string[];
351
+ must_read_if: string;
352
+ entities?: string[] | undefined;
353
+ id?: string | undefined;
354
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
355
+ maturity?: "draft" | "verified" | "proven" | undefined;
356
+ knowledge_layer?: "personal" | "team" | undefined;
357
+ layer_reason?: string | undefined;
358
+ created_at?: string | undefined;
359
+ tags?: string[] | undefined;
360
+ relevance_scope?: "narrow" | "broad" | undefined;
361
+ relevance_paths?: string[] | undefined;
362
+ }>>;
363
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
364
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
365
+ file: z.ZodString;
366
+ content_ref: z.ZodOptional<z.ZodString>;
367
+ scope_glob: z.ZodString;
368
+ hash: z.ZodString;
369
+ stable_id: z.ZodOptional<z.ZodString>;
370
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
371
+ activation: z.ZodOptional<z.ZodObject<{
372
+ tier: z.ZodEnum<["always", "path", "description"]>;
373
+ description: z.ZodOptional<z.ZodString>;
374
+ }, "strip", z.ZodTypeAny, {
306
375
  tier: "always" | "path" | "description";
307
376
  description?: string | undefined;
308
- } | undefined;
309
- }, unknown>;
377
+ }, {
378
+ tier: "always" | "path" | "description";
379
+ description?: string | undefined;
380
+ }>>;
381
+ description: z.ZodOptional<z.ZodObject<{
382
+ summary: z.ZodString;
383
+ intent_clues: z.ZodArray<z.ZodString, "many">;
384
+ tech_stack: z.ZodArray<z.ZodString, "many">;
385
+ impact: z.ZodArray<z.ZodString, "many">;
386
+ must_read_if: z.ZodString;
387
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
388
+ id: z.ZodOptional<z.ZodString>;
389
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
390
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
391
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
392
+ layer_reason: z.ZodOptional<z.ZodString>;
393
+ created_at: z.ZodOptional<z.ZodString>;
394
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
395
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
396
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
397
+ }, "strict", z.ZodTypeAny, {
398
+ summary: string;
399
+ intent_clues: string[];
400
+ tech_stack: string[];
401
+ impact: string[];
402
+ must_read_if: string;
403
+ relevance_scope: "narrow" | "broad";
404
+ relevance_paths: string[];
405
+ entities?: string[] | undefined;
406
+ id?: string | undefined;
407
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
408
+ maturity?: "draft" | "verified" | "proven" | undefined;
409
+ knowledge_layer?: "personal" | "team" | undefined;
410
+ layer_reason?: string | undefined;
411
+ created_at?: string | undefined;
412
+ tags?: string[] | undefined;
413
+ }, {
414
+ summary: string;
415
+ intent_clues: string[];
416
+ tech_stack: string[];
417
+ impact: string[];
418
+ must_read_if: string;
419
+ entities?: string[] | undefined;
420
+ id?: string | undefined;
421
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
422
+ maturity?: "draft" | "verified" | "proven" | undefined;
423
+ knowledge_layer?: "personal" | "team" | undefined;
424
+ layer_reason?: string | undefined;
425
+ created_at?: string | undefined;
426
+ tags?: string[] | undefined;
427
+ relevance_scope?: "narrow" | "broad" | undefined;
428
+ relevance_paths?: string[] | undefined;
429
+ }>>;
430
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
431
+ }, z.ZodTypeAny, "passthrough">, unknown>;
310
432
  declare const AgentsMetaCountersSchema: z.ZodDefault<z.ZodObject<{
311
433
  KP: z.ZodDefault<z.ZodObject<{
312
434
  MOD: z.ZodDefault<z.ZodNumber>;
@@ -384,11 +506,6 @@ declare const agentsMetaSchema: z.ZodObject<{
384
506
  file: z.ZodString;
385
507
  content_ref: z.ZodOptional<z.ZodString>;
386
508
  scope_glob: z.ZodString;
387
- deps: z.ZodArray<z.ZodString, "many">;
388
- priority: z.ZodEnum<["high", "medium", "low"]>;
389
- level: z.ZodOptional<z.ZodEnum<["L0", "L1", "L2"]>>;
390
- layer: z.ZodEnum<["L0", "L1", "L2"]>;
391
- topology_type: z.ZodEnum<["mirror", "cross-cutting", "domain", "local", "global"]>;
392
509
  hash: z.ZodString;
393
510
  stable_id: z.ZodOptional<z.ZodString>;
394
511
  identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
@@ -416,12 +533,16 @@ declare const agentsMetaSchema: z.ZodObject<{
416
533
  layer_reason: z.ZodOptional<z.ZodString>;
417
534
  created_at: z.ZodOptional<z.ZodString>;
418
535
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
536
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
537
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
419
538
  }, "strict", z.ZodTypeAny, {
420
539
  summary: string;
421
540
  intent_clues: string[];
422
541
  tech_stack: string[];
423
542
  impact: string[];
424
543
  must_read_if: string;
544
+ relevance_scope: "narrow" | "broad";
545
+ relevance_paths: string[];
425
546
  entities?: string[] | undefined;
426
547
  id?: string | undefined;
427
548
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -444,22 +565,51 @@ declare const agentsMetaSchema: z.ZodObject<{
444
565
  layer_reason?: string | undefined;
445
566
  created_at?: string | undefined;
446
567
  tags?: string[] | undefined;
568
+ relevance_scope?: "narrow" | "broad" | undefined;
569
+ relevance_paths?: string[] | undefined;
447
570
  }>>;
448
571
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
449
- }, "strip", z.ZodTypeAny, {
450
- file: string;
451
- priority: "high" | "medium" | "low";
452
- hash: string;
453
- layer: "L0" | "L1" | "L2";
454
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
455
- scope_glob: string;
456
- deps: string[];
457
- description?: {
572
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
573
+ file: z.ZodString;
574
+ content_ref: z.ZodOptional<z.ZodString>;
575
+ scope_glob: z.ZodString;
576
+ hash: z.ZodString;
577
+ stable_id: z.ZodOptional<z.ZodString>;
578
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
579
+ activation: z.ZodOptional<z.ZodObject<{
580
+ tier: z.ZodEnum<["always", "path", "description"]>;
581
+ description: z.ZodOptional<z.ZodString>;
582
+ }, "strip", z.ZodTypeAny, {
583
+ tier: "always" | "path" | "description";
584
+ description?: string | undefined;
585
+ }, {
586
+ tier: "always" | "path" | "description";
587
+ description?: string | undefined;
588
+ }>>;
589
+ description: z.ZodOptional<z.ZodObject<{
590
+ summary: z.ZodString;
591
+ intent_clues: z.ZodArray<z.ZodString, "many">;
592
+ tech_stack: z.ZodArray<z.ZodString, "many">;
593
+ impact: z.ZodArray<z.ZodString, "many">;
594
+ must_read_if: z.ZodString;
595
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
596
+ id: z.ZodOptional<z.ZodString>;
597
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
598
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
599
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
600
+ layer_reason: z.ZodOptional<z.ZodString>;
601
+ created_at: z.ZodOptional<z.ZodString>;
602
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
603
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
604
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
605
+ }, "strict", z.ZodTypeAny, {
458
606
  summary: string;
459
607
  intent_clues: string[];
460
608
  tech_stack: string[];
461
609
  impact: string[];
462
610
  must_read_if: string;
611
+ relevance_scope: "narrow" | "broad";
612
+ relevance_paths: string[];
463
613
  entities?: string[] | undefined;
464
614
  id?: string | undefined;
465
615
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -468,25 +618,7 @@ declare const agentsMetaSchema: z.ZodObject<{
468
618
  layer_reason?: string | undefined;
469
619
  created_at?: string | undefined;
470
620
  tags?: string[] | undefined;
471
- } | undefined;
472
- stable_id?: string | undefined;
473
- level?: "L0" | "L1" | "L2" | undefined;
474
- sections?: string[] | undefined;
475
- content_ref?: string | undefined;
476
- identity_source?: "declared" | "derived" | undefined;
477
- activation?: {
478
- tier: "always" | "path" | "description";
479
- description?: string | undefined;
480
- } | undefined;
481
- }, {
482
- file: string;
483
- priority: "high" | "medium" | "low";
484
- hash: string;
485
- layer: "L0" | "L1" | "L2";
486
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
487
- scope_glob: string;
488
- deps: string[];
489
- description?: {
621
+ }, {
490
622
  summary: string;
491
623
  intent_clues: string[];
492
624
  tech_stack: string[];
@@ -500,30 +632,51 @@ declare const agentsMetaSchema: z.ZodObject<{
500
632
  layer_reason?: string | undefined;
501
633
  created_at?: string | undefined;
502
634
  tags?: string[] | undefined;
503
- } | undefined;
504
- stable_id?: string | undefined;
505
- level?: "L0" | "L1" | "L2" | undefined;
506
- sections?: string[] | undefined;
507
- content_ref?: string | undefined;
508
- identity_source?: "declared" | "derived" | undefined;
509
- activation?: {
635
+ relevance_scope?: "narrow" | "broad" | undefined;
636
+ relevance_paths?: string[] | undefined;
637
+ }>>;
638
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
639
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
640
+ file: z.ZodString;
641
+ content_ref: z.ZodOptional<z.ZodString>;
642
+ scope_glob: z.ZodString;
643
+ hash: z.ZodString;
644
+ stable_id: z.ZodOptional<z.ZodString>;
645
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
646
+ activation: z.ZodOptional<z.ZodObject<{
647
+ tier: z.ZodEnum<["always", "path", "description"]>;
648
+ description: z.ZodOptional<z.ZodString>;
649
+ }, "strip", z.ZodTypeAny, {
510
650
  tier: "always" | "path" | "description";
511
651
  description?: string | undefined;
512
- } | undefined;
513
- }>, {
514
- file: string;
515
- priority: "high" | "medium" | "low";
516
- hash: string;
517
- layer: "L0" | "L1" | "L2";
518
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
519
- scope_glob: string;
520
- deps: string[];
521
- description?: {
652
+ }, {
653
+ tier: "always" | "path" | "description";
654
+ description?: string | undefined;
655
+ }>>;
656
+ description: z.ZodOptional<z.ZodObject<{
657
+ summary: z.ZodString;
658
+ intent_clues: z.ZodArray<z.ZodString, "many">;
659
+ tech_stack: z.ZodArray<z.ZodString, "many">;
660
+ impact: z.ZodArray<z.ZodString, "many">;
661
+ must_read_if: z.ZodString;
662
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
663
+ id: z.ZodOptional<z.ZodString>;
664
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
665
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
666
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
667
+ layer_reason: z.ZodOptional<z.ZodString>;
668
+ created_at: z.ZodOptional<z.ZodString>;
669
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
670
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
671
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
672
+ }, "strict", z.ZodTypeAny, {
522
673
  summary: string;
523
674
  intent_clues: string[];
524
675
  tech_stack: string[];
525
676
  impact: string[];
526
677
  must_read_if: string;
678
+ relevance_scope: "narrow" | "broad";
679
+ relevance_paths: string[];
527
680
  entities?: string[] | undefined;
528
681
  id?: string | undefined;
529
682
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -532,36 +685,111 @@ declare const agentsMetaSchema: z.ZodObject<{
532
685
  layer_reason?: string | undefined;
533
686
  created_at?: string | undefined;
534
687
  tags?: string[] | undefined;
535
- } | undefined;
536
- stable_id?: string | undefined;
537
- level?: "L0" | "L1" | "L2" | undefined;
538
- sections?: string[] | undefined;
539
- content_ref?: string | undefined;
540
- identity_source?: "declared" | "derived" | undefined;
541
- activation?: {
542
- tier: "always" | "path" | "description";
543
- description?: string | undefined;
544
- } | undefined;
545
- }, unknown>>;
546
- counters: z.ZodOptional<z.ZodDefault<z.ZodObject<{
547
- KP: z.ZodDefault<z.ZodObject<{
548
- MOD: z.ZodDefault<z.ZodNumber>;
549
- DEC: z.ZodDefault<z.ZodNumber>;
550
- GLD: z.ZodDefault<z.ZodNumber>;
551
- PIT: z.ZodDefault<z.ZodNumber>;
552
- PRO: z.ZodDefault<z.ZodNumber>;
553
- }, "strip", z.ZodTypeAny, {
554
- MOD: number;
555
- DEC: number;
556
- GLD: number;
557
- PIT: number;
558
- PRO: number;
559
688
  }, {
560
- MOD?: number | undefined;
561
- DEC?: number | undefined;
562
- GLD?: number | undefined;
563
- PIT?: number | undefined;
564
- PRO?: number | undefined;
689
+ summary: string;
690
+ intent_clues: string[];
691
+ tech_stack: string[];
692
+ impact: string[];
693
+ must_read_if: string;
694
+ entities?: string[] | undefined;
695
+ id?: string | undefined;
696
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
697
+ maturity?: "draft" | "verified" | "proven" | undefined;
698
+ knowledge_layer?: "personal" | "team" | undefined;
699
+ layer_reason?: string | undefined;
700
+ created_at?: string | undefined;
701
+ tags?: string[] | undefined;
702
+ relevance_scope?: "narrow" | "broad" | undefined;
703
+ relevance_paths?: string[] | undefined;
704
+ }>>;
705
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
706
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
707
+ file: z.ZodString;
708
+ content_ref: z.ZodOptional<z.ZodString>;
709
+ scope_glob: z.ZodString;
710
+ hash: z.ZodString;
711
+ stable_id: z.ZodOptional<z.ZodString>;
712
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
713
+ activation: z.ZodOptional<z.ZodObject<{
714
+ tier: z.ZodEnum<["always", "path", "description"]>;
715
+ description: z.ZodOptional<z.ZodString>;
716
+ }, "strip", z.ZodTypeAny, {
717
+ tier: "always" | "path" | "description";
718
+ description?: string | undefined;
719
+ }, {
720
+ tier: "always" | "path" | "description";
721
+ description?: string | undefined;
722
+ }>>;
723
+ description: z.ZodOptional<z.ZodObject<{
724
+ summary: z.ZodString;
725
+ intent_clues: z.ZodArray<z.ZodString, "many">;
726
+ tech_stack: z.ZodArray<z.ZodString, "many">;
727
+ impact: z.ZodArray<z.ZodString, "many">;
728
+ must_read_if: z.ZodString;
729
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
730
+ id: z.ZodOptional<z.ZodString>;
731
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
732
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
733
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
734
+ layer_reason: z.ZodOptional<z.ZodString>;
735
+ created_at: z.ZodOptional<z.ZodString>;
736
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
737
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
738
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
739
+ }, "strict", z.ZodTypeAny, {
740
+ summary: string;
741
+ intent_clues: string[];
742
+ tech_stack: string[];
743
+ impact: string[];
744
+ must_read_if: string;
745
+ relevance_scope: "narrow" | "broad";
746
+ relevance_paths: string[];
747
+ entities?: string[] | undefined;
748
+ id?: string | undefined;
749
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
750
+ maturity?: "draft" | "verified" | "proven" | undefined;
751
+ knowledge_layer?: "personal" | "team" | undefined;
752
+ layer_reason?: string | undefined;
753
+ created_at?: string | undefined;
754
+ tags?: string[] | undefined;
755
+ }, {
756
+ summary: string;
757
+ intent_clues: string[];
758
+ tech_stack: string[];
759
+ impact: string[];
760
+ must_read_if: string;
761
+ entities?: string[] | undefined;
762
+ id?: string | undefined;
763
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
764
+ maturity?: "draft" | "verified" | "proven" | undefined;
765
+ knowledge_layer?: "personal" | "team" | undefined;
766
+ layer_reason?: string | undefined;
767
+ created_at?: string | undefined;
768
+ tags?: string[] | undefined;
769
+ relevance_scope?: "narrow" | "broad" | undefined;
770
+ relevance_paths?: string[] | undefined;
771
+ }>>;
772
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
773
+ }, z.ZodTypeAny, "passthrough">, unknown>>;
774
+ counters: z.ZodOptional<z.ZodDefault<z.ZodObject<{
775
+ KP: z.ZodDefault<z.ZodObject<{
776
+ MOD: z.ZodDefault<z.ZodNumber>;
777
+ DEC: z.ZodDefault<z.ZodNumber>;
778
+ GLD: z.ZodDefault<z.ZodNumber>;
779
+ PIT: z.ZodDefault<z.ZodNumber>;
780
+ PRO: z.ZodDefault<z.ZodNumber>;
781
+ }, "strip", z.ZodTypeAny, {
782
+ MOD: number;
783
+ DEC: number;
784
+ GLD: number;
785
+ PIT: number;
786
+ PRO: number;
787
+ }, {
788
+ MOD?: number | undefined;
789
+ DEC?: number | undefined;
790
+ GLD?: number | undefined;
791
+ PIT?: number | undefined;
792
+ PRO?: number | undefined;
565
793
  }>>;
566
794
  KT: z.ZodDefault<z.ZodObject<{
567
795
  MOD: z.ZodDefault<z.ZodNumber>;
@@ -615,20 +843,47 @@ declare const agentsMetaSchema: z.ZodObject<{
615
843
  }>>>;
616
844
  }, "strip", z.ZodTypeAny, {
617
845
  revision: string;
618
- nodes: Record<string, {
619
- file: string;
620
- priority: "high" | "medium" | "low";
621
- hash: string;
622
- layer: "L0" | "L1" | "L2";
623
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
624
- scope_glob: string;
625
- deps: string[];
626
- description?: {
846
+ nodes: Record<string, z.objectOutputType<{
847
+ file: z.ZodString;
848
+ content_ref: z.ZodOptional<z.ZodString>;
849
+ scope_glob: z.ZodString;
850
+ hash: z.ZodString;
851
+ stable_id: z.ZodOptional<z.ZodString>;
852
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
853
+ activation: z.ZodOptional<z.ZodObject<{
854
+ tier: z.ZodEnum<["always", "path", "description"]>;
855
+ description: z.ZodOptional<z.ZodString>;
856
+ }, "strip", z.ZodTypeAny, {
857
+ tier: "always" | "path" | "description";
858
+ description?: string | undefined;
859
+ }, {
860
+ tier: "always" | "path" | "description";
861
+ description?: string | undefined;
862
+ }>>;
863
+ description: z.ZodOptional<z.ZodObject<{
864
+ summary: z.ZodString;
865
+ intent_clues: z.ZodArray<z.ZodString, "many">;
866
+ tech_stack: z.ZodArray<z.ZodString, "many">;
867
+ impact: z.ZodArray<z.ZodString, "many">;
868
+ must_read_if: z.ZodString;
869
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
870
+ id: z.ZodOptional<z.ZodString>;
871
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
872
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
873
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
874
+ layer_reason: z.ZodOptional<z.ZodString>;
875
+ created_at: z.ZodOptional<z.ZodString>;
876
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
877
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
878
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
879
+ }, "strict", z.ZodTypeAny, {
627
880
  summary: string;
628
881
  intent_clues: string[];
629
882
  tech_stack: string[];
630
883
  impact: string[];
631
884
  must_read_if: string;
885
+ relevance_scope: "narrow" | "broad";
886
+ relevance_paths: string[];
632
887
  entities?: string[] | undefined;
633
888
  id?: string | undefined;
634
889
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -637,17 +892,25 @@ declare const agentsMetaSchema: z.ZodObject<{
637
892
  layer_reason?: string | undefined;
638
893
  created_at?: string | undefined;
639
894
  tags?: string[] | undefined;
640
- } | undefined;
641
- stable_id?: string | undefined;
642
- level?: "L0" | "L1" | "L2" | undefined;
643
- sections?: string[] | undefined;
644
- content_ref?: string | undefined;
645
- identity_source?: "declared" | "derived" | undefined;
646
- activation?: {
647
- tier: "always" | "path" | "description";
648
- description?: string | undefined;
649
- } | undefined;
650
- }>;
895
+ }, {
896
+ summary: string;
897
+ intent_clues: string[];
898
+ tech_stack: string[];
899
+ impact: string[];
900
+ must_read_if: string;
901
+ entities?: string[] | undefined;
902
+ id?: string | undefined;
903
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
904
+ maturity?: "draft" | "verified" | "proven" | undefined;
905
+ knowledge_layer?: "personal" | "team" | undefined;
906
+ layer_reason?: string | undefined;
907
+ created_at?: string | undefined;
908
+ tags?: string[] | undefined;
909
+ relevance_scope?: "narrow" | "broad" | undefined;
910
+ relevance_paths?: string[] | undefined;
911
+ }>>;
912
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
913
+ }, z.ZodTypeAny, "passthrough">>;
651
914
  counters?: {
652
915
  KP: {
653
916
  MOD: number;
@@ -721,8 +984,8 @@ declare function deriveAgentsMetaIdentitySource(node: Pick<AgentsMetaNode, "file
721
984
  declare function deriveAgentsMetaLayer(file: string): AgentsLayer;
722
985
  declare function deriveAgentsMetaTopologyType(file: string): AgentsTopologyType;
723
986
 
724
- declare const RULE_TEST_INDEX_SCHEMA_VERSION = 1;
725
- declare const ruleTestLinkSchema: z.ZodObject<{
987
+ declare const KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION = 1;
988
+ declare const knowledgeTestLinkSchema: z.ZodObject<{
726
989
  rule_stable_id: z.ZodString;
727
990
  rule_file: z.ZodString;
728
991
  rule_hash: z.ZodString;
@@ -750,7 +1013,7 @@ declare const ruleTestLinkSchema: z.ZodObject<{
750
1013
  previous_rule_hash?: string | undefined;
751
1014
  previous_test_hash?: string | undefined;
752
1015
  }>;
753
- declare const ruleTestOrphanAnnotationSchema: z.ZodObject<{
1016
+ declare const knowledgeTestOrphanAnnotationSchema: z.ZodObject<{
754
1017
  rule_stable_id: z.ZodString;
755
1018
  test_file: z.ZodString;
756
1019
  test_hash: z.ZodString;
@@ -769,7 +1032,7 @@ declare const ruleTestOrphanAnnotationSchema: z.ZodObject<{
769
1032
  annotation_line: number;
770
1033
  previous_test_hash?: string | undefined;
771
1034
  }>;
772
- declare const ruleTestIndexSchema: z.ZodObject<{
1035
+ declare const knowledgeTestIndexSchema: z.ZodObject<{
773
1036
  schema_version: z.ZodLiteral<1>;
774
1037
  generated_at: z.ZodString;
775
1038
  revision: z.ZodOptional<z.ZodString>;
@@ -866,9 +1129,9 @@ declare const ruleTestIndexSchema: z.ZodObject<{
866
1129
  revision?: string | undefined;
867
1130
  previous_revision?: string | undefined;
868
1131
  }>;
869
- type RuleTestLink = z.infer<typeof ruleTestLinkSchema>;
870
- type RuleTestOrphanAnnotation = z.infer<typeof ruleTestOrphanAnnotationSchema>;
871
- type RuleTestIndex = z.infer<typeof ruleTestIndexSchema>;
1132
+ type KnowledgeTestLink = z.infer<typeof knowledgeTestLinkSchema>;
1133
+ type KnowledgeTestOrphanAnnotation = z.infer<typeof knowledgeTestOrphanAnnotationSchema>;
1134
+ type KnowledgeTestIndex = z.infer<typeof knowledgeTestIndexSchema>;
872
1135
 
873
1136
  declare const aiLedgerEntrySchema: z.ZodObject<{
874
1137
  source: z.ZodLiteral<"ai">;
@@ -1072,6 +1335,8 @@ declare const mcpPayloadLimitsSchema: z.ZodOptional<z.ZodObject<{
1072
1335
  warnBytes?: number | undefined;
1073
1336
  hardBytes?: number | undefined;
1074
1337
  }>>;
1338
+ declare const knowledgeLanguageSchema: z.ZodEnum<["match-existing", "zh-CN", "en"]>;
1339
+ declare const defaultLayerFilterSchema: z.ZodEnum<["team", "personal", "both"]>;
1075
1340
  declare const fabricConfigSchema: z.ZodObject<{
1076
1341
  clientPaths: z.ZodOptional<z.ZodObject<{
1077
1342
  claudeCodeCLI: z.ZodOptional<z.ZodString>;
@@ -1103,7 +1368,27 @@ declare const fabricConfigSchema: z.ZodObject<{
1103
1368
  warnBytes?: number | undefined;
1104
1369
  hardBytes?: number | undefined;
1105
1370
  }>>;
1371
+ knowledge_language: z.ZodDefault<z.ZodOptional<z.ZodEnum<["match-existing", "zh-CN", "en"]>>>;
1372
+ default_layer_filter: z.ZodDefault<z.ZodOptional<z.ZodEnum<["team", "personal", "both"]>>>;
1373
+ archive_hint_cooldown_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1374
+ underseed_node_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1375
+ archive_edit_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1376
+ archive_hint_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1377
+ review_hint_pending_count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1378
+ review_hint_pending_age_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1379
+ maintenance_hint_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1380
+ maintenance_hint_cooldown_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1106
1381
  }, "strip", z.ZodTypeAny, {
1382
+ knowledge_language: "match-existing" | "zh-CN" | "en";
1383
+ default_layer_filter: "personal" | "team" | "both";
1384
+ archive_hint_cooldown_hours: number;
1385
+ underseed_node_threshold: number;
1386
+ archive_edit_threshold: number;
1387
+ archive_hint_hours: number;
1388
+ review_hint_pending_count: number;
1389
+ review_hint_pending_age_days: number;
1390
+ maintenance_hint_days: number;
1391
+ maintenance_hint_cooldown_days: number;
1107
1392
  clientPaths?: {
1108
1393
  claudeCodeCLI?: string | undefined;
1109
1394
  claudeCodeDesktop?: string | undefined;
@@ -1133,6 +1418,16 @@ declare const fabricConfigSchema: z.ZodObject<{
1133
1418
  warnBytes?: number | undefined;
1134
1419
  hardBytes?: number | undefined;
1135
1420
  } | undefined;
1421
+ knowledge_language?: "match-existing" | "zh-CN" | "en" | undefined;
1422
+ default_layer_filter?: "personal" | "team" | "both" | undefined;
1423
+ archive_hint_cooldown_hours?: number | undefined;
1424
+ underseed_node_threshold?: number | undefined;
1425
+ archive_edit_threshold?: number | undefined;
1426
+ archive_hint_hours?: number | undefined;
1427
+ review_hint_pending_count?: number | undefined;
1428
+ review_hint_pending_age_days?: number | undefined;
1429
+ maintenance_hint_days?: number | undefined;
1430
+ maintenance_hint_cooldown_days?: number | undefined;
1136
1431
  }>;
1137
1432
 
1138
1433
  interface ForensicCodeSample {
@@ -1362,14 +1657,14 @@ declare const forensicFrameworkSchema: z.ZodObject<{
1362
1657
  subkind: z.ZodString;
1363
1658
  evidence: z.ZodArray<z.ZodString, "many">;
1364
1659
  }, "strip", z.ZodTypeAny, {
1660
+ version: string;
1365
1661
  evidence: string[];
1366
1662
  kind: string;
1367
- version: string;
1368
1663
  subkind: string;
1369
1664
  }, {
1665
+ version: string;
1370
1666
  evidence: string[];
1371
1667
  kind: string;
1372
- version: string;
1373
1668
  subkind: string;
1374
1669
  }>;
1375
1670
  declare const forensicReadmeSchema: z.ZodObject<{
@@ -1420,14 +1715,14 @@ declare const forensicReportSchema: z.ZodObject<{
1420
1715
  subkind: z.ZodString;
1421
1716
  evidence: z.ZodArray<z.ZodString, "many">;
1422
1717
  }, "strip", z.ZodTypeAny, {
1718
+ version: string;
1423
1719
  evidence: string[];
1424
1720
  kind: string;
1425
- version: string;
1426
1721
  subkind: string;
1427
1722
  }, {
1723
+ version: string;
1428
1724
  evidence: string[];
1429
1725
  kind: string;
1430
- version: string;
1431
1726
  subkind: string;
1432
1727
  }>;
1433
1728
  topology: z.ZodObject<{
@@ -1583,14 +1878,14 @@ declare const forensicReportSchema: z.ZodObject<{
1583
1878
  }>;
1584
1879
  recommendations_for_skill: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1585
1880
  }, "strip", z.ZodTypeAny, {
1881
+ version: string;
1586
1882
  generated_at: string;
1587
1883
  framework: {
1884
+ version: string;
1588
1885
  evidence: string[];
1589
1886
  kind: string;
1590
- version: string;
1591
1887
  subkind: string;
1592
1888
  };
1593
- version: string;
1594
1889
  generated_by: string;
1595
1890
  target: string;
1596
1891
  project_name: string;
@@ -1645,14 +1940,14 @@ declare const forensicReportSchema: z.ZodObject<{
1645
1940
  };
1646
1941
  recommendations_for_skill?: string[] | undefined;
1647
1942
  }, {
1943
+ version: string;
1648
1944
  generated_at: string;
1649
1945
  framework: {
1946
+ version: string;
1650
1947
  evidence: string[];
1651
1948
  kind: string;
1652
- version: string;
1653
1949
  subkind: string;
1654
1950
  };
1655
- version: string;
1656
1951
  generated_by: string;
1657
1952
  target: string;
1658
1953
  project_name: string;
@@ -1755,12 +2050,12 @@ declare const initContextFrameworkSchema: z.ZodObject<{
1755
2050
  version: z.ZodString;
1756
2051
  subkind: z.ZodString;
1757
2052
  }, "strip", z.ZodTypeAny, {
1758
- kind: string;
1759
2053
  version: string;
2054
+ kind: string;
1760
2055
  subkind: string;
1761
2056
  }, {
1762
- kind: string;
1763
2057
  version: string;
2058
+ kind: string;
1764
2059
  subkind: string;
1765
2060
  }>;
1766
2061
  declare const initContextInvariantConfidenceSnapshotSchema: z.ZodObject<{
@@ -1876,12 +2171,12 @@ declare const initContextSchema: z.ZodObject<{
1876
2171
  version: z.ZodString;
1877
2172
  subkind: z.ZodString;
1878
2173
  }, "strip", z.ZodTypeAny, {
1879
- kind: string;
1880
2174
  version: string;
2175
+ kind: string;
1881
2176
  subkind: string;
1882
2177
  }, {
1883
- kind: string;
1884
2178
  version: string;
2179
+ kind: string;
1885
2180
  subkind: string;
1886
2181
  }>;
1887
2182
  architecture_patterns: z.ZodArray<z.ZodString, "many">;
@@ -1975,8 +2270,8 @@ declare const initContextSchema: z.ZodObject<{
1975
2270
  forensic_ref: z.ZodString;
1976
2271
  }, "strip", z.ZodTypeAny, {
1977
2272
  framework: {
1978
- kind: string;
1979
2273
  version: string;
2274
+ kind: string;
1980
2275
  subkind: string;
1981
2276
  };
1982
2277
  architecture_patterns: string[];
@@ -2010,8 +2305,8 @@ declare const initContextSchema: z.ZodObject<{
2010
2305
  forensic_ref: string;
2011
2306
  }, {
2012
2307
  framework: {
2013
- kind: string;
2014
2308
  version: string;
2309
+ kind: string;
2015
2310
  subkind: string;
2016
2311
  };
2017
2312
  architecture_patterns: string[];
@@ -2080,11 +2375,6 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2080
2375
  file: z.ZodString;
2081
2376
  content_ref: z.ZodOptional<z.ZodString>;
2082
2377
  scope_glob: z.ZodString;
2083
- deps: z.ZodArray<z.ZodString, "many">;
2084
- priority: z.ZodEnum<["high", "medium", "low"]>;
2085
- level: z.ZodOptional<z.ZodEnum<["L0", "L1", "L2"]>>;
2086
- layer: z.ZodEnum<["L0", "L1", "L2"]>;
2087
- topology_type: z.ZodEnum<["mirror", "cross-cutting", "domain", "local", "global"]>;
2088
2378
  hash: z.ZodString;
2089
2379
  stable_id: z.ZodOptional<z.ZodString>;
2090
2380
  identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
@@ -2112,12 +2402,16 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2112
2402
  layer_reason: z.ZodOptional<z.ZodString>;
2113
2403
  created_at: z.ZodOptional<z.ZodString>;
2114
2404
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
2405
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
2406
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2115
2407
  }, "strict", z.ZodTypeAny, {
2116
2408
  summary: string;
2117
2409
  intent_clues: string[];
2118
2410
  tech_stack: string[];
2119
2411
  impact: string[];
2120
2412
  must_read_if: string;
2413
+ relevance_scope: "narrow" | "broad";
2414
+ relevance_paths: string[];
2121
2415
  entities?: string[] | undefined;
2122
2416
  id?: string | undefined;
2123
2417
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -2140,22 +2434,51 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2140
2434
  layer_reason?: string | undefined;
2141
2435
  created_at?: string | undefined;
2142
2436
  tags?: string[] | undefined;
2437
+ relevance_scope?: "narrow" | "broad" | undefined;
2438
+ relevance_paths?: string[] | undefined;
2143
2439
  }>>;
2144
2440
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2145
- }, "strip", z.ZodTypeAny, {
2146
- file: string;
2147
- priority: "high" | "medium" | "low";
2148
- hash: string;
2149
- layer: "L0" | "L1" | "L2";
2150
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
2151
- scope_glob: string;
2152
- deps: string[];
2153
- description?: {
2441
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2442
+ file: z.ZodString;
2443
+ content_ref: z.ZodOptional<z.ZodString>;
2444
+ scope_glob: z.ZodString;
2445
+ hash: z.ZodString;
2446
+ stable_id: z.ZodOptional<z.ZodString>;
2447
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
2448
+ activation: z.ZodOptional<z.ZodObject<{
2449
+ tier: z.ZodEnum<["always", "path", "description"]>;
2450
+ description: z.ZodOptional<z.ZodString>;
2451
+ }, "strip", z.ZodTypeAny, {
2452
+ tier: "always" | "path" | "description";
2453
+ description?: string | undefined;
2454
+ }, {
2455
+ tier: "always" | "path" | "description";
2456
+ description?: string | undefined;
2457
+ }>>;
2458
+ description: z.ZodOptional<z.ZodObject<{
2459
+ summary: z.ZodString;
2460
+ intent_clues: z.ZodArray<z.ZodString, "many">;
2461
+ tech_stack: z.ZodArray<z.ZodString, "many">;
2462
+ impact: z.ZodArray<z.ZodString, "many">;
2463
+ must_read_if: z.ZodString;
2464
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2465
+ id: z.ZodOptional<z.ZodString>;
2466
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
2467
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
2468
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
2469
+ layer_reason: z.ZodOptional<z.ZodString>;
2470
+ created_at: z.ZodOptional<z.ZodString>;
2471
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
2472
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
2473
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2474
+ }, "strict", z.ZodTypeAny, {
2154
2475
  summary: string;
2155
2476
  intent_clues: string[];
2156
2477
  tech_stack: string[];
2157
2478
  impact: string[];
2158
2479
  must_read_if: string;
2480
+ relevance_scope: "narrow" | "broad";
2481
+ relevance_paths: string[];
2159
2482
  entities?: string[] | undefined;
2160
2483
  id?: string | undefined;
2161
2484
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -2164,25 +2487,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2164
2487
  layer_reason?: string | undefined;
2165
2488
  created_at?: string | undefined;
2166
2489
  tags?: string[] | undefined;
2167
- } | undefined;
2168
- stable_id?: string | undefined;
2169
- level?: "L0" | "L1" | "L2" | undefined;
2170
- sections?: string[] | undefined;
2171
- content_ref?: string | undefined;
2172
- identity_source?: "declared" | "derived" | undefined;
2173
- activation?: {
2174
- tier: "always" | "path" | "description";
2175
- description?: string | undefined;
2176
- } | undefined;
2177
- }, {
2178
- file: string;
2179
- priority: "high" | "medium" | "low";
2180
- hash: string;
2181
- layer: "L0" | "L1" | "L2";
2182
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
2183
- scope_glob: string;
2184
- deps: string[];
2185
- description?: {
2490
+ }, {
2186
2491
  summary: string;
2187
2492
  intent_clues: string[];
2188
2493
  tech_stack: string[];
@@ -2196,30 +2501,51 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2196
2501
  layer_reason?: string | undefined;
2197
2502
  created_at?: string | undefined;
2198
2503
  tags?: string[] | undefined;
2199
- } | undefined;
2200
- stable_id?: string | undefined;
2201
- level?: "L0" | "L1" | "L2" | undefined;
2202
- sections?: string[] | undefined;
2203
- content_ref?: string | undefined;
2204
- identity_source?: "declared" | "derived" | undefined;
2205
- activation?: {
2504
+ relevance_scope?: "narrow" | "broad" | undefined;
2505
+ relevance_paths?: string[] | undefined;
2506
+ }>>;
2507
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2508
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2509
+ file: z.ZodString;
2510
+ content_ref: z.ZodOptional<z.ZodString>;
2511
+ scope_glob: z.ZodString;
2512
+ hash: z.ZodString;
2513
+ stable_id: z.ZodOptional<z.ZodString>;
2514
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
2515
+ activation: z.ZodOptional<z.ZodObject<{
2516
+ tier: z.ZodEnum<["always", "path", "description"]>;
2517
+ description: z.ZodOptional<z.ZodString>;
2518
+ }, "strip", z.ZodTypeAny, {
2206
2519
  tier: "always" | "path" | "description";
2207
2520
  description?: string | undefined;
2208
- } | undefined;
2209
- }>, {
2210
- file: string;
2211
- priority: "high" | "medium" | "low";
2212
- hash: string;
2213
- layer: "L0" | "L1" | "L2";
2214
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
2215
- scope_glob: string;
2216
- deps: string[];
2217
- description?: {
2521
+ }, {
2522
+ tier: "always" | "path" | "description";
2523
+ description?: string | undefined;
2524
+ }>>;
2525
+ description: z.ZodOptional<z.ZodObject<{
2526
+ summary: z.ZodString;
2527
+ intent_clues: z.ZodArray<z.ZodString, "many">;
2528
+ tech_stack: z.ZodArray<z.ZodString, "many">;
2529
+ impact: z.ZodArray<z.ZodString, "many">;
2530
+ must_read_if: z.ZodString;
2531
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2532
+ id: z.ZodOptional<z.ZodString>;
2533
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
2534
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
2535
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
2536
+ layer_reason: z.ZodOptional<z.ZodString>;
2537
+ created_at: z.ZodOptional<z.ZodString>;
2538
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
2539
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
2540
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2541
+ }, "strict", z.ZodTypeAny, {
2218
2542
  summary: string;
2219
2543
  intent_clues: string[];
2220
2544
  tech_stack: string[];
2221
2545
  impact: string[];
2222
2546
  must_read_if: string;
2547
+ relevance_scope: "narrow" | "broad";
2548
+ relevance_paths: string[];
2223
2549
  entities?: string[] | undefined;
2224
2550
  id?: string | undefined;
2225
2551
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -2228,17 +2554,92 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2228
2554
  layer_reason?: string | undefined;
2229
2555
  created_at?: string | undefined;
2230
2556
  tags?: string[] | undefined;
2231
- } | undefined;
2232
- stable_id?: string | undefined;
2233
- level?: "L0" | "L1" | "L2" | undefined;
2234
- sections?: string[] | undefined;
2235
- content_ref?: string | undefined;
2236
- identity_source?: "declared" | "derived" | undefined;
2237
- activation?: {
2238
- tier: "always" | "path" | "description";
2239
- description?: string | undefined;
2240
- } | undefined;
2241
- }, unknown>>;
2557
+ }, {
2558
+ summary: string;
2559
+ intent_clues: string[];
2560
+ tech_stack: string[];
2561
+ impact: string[];
2562
+ must_read_if: string;
2563
+ entities?: string[] | undefined;
2564
+ id?: string | undefined;
2565
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
2566
+ maturity?: "draft" | "verified" | "proven" | undefined;
2567
+ knowledge_layer?: "personal" | "team" | undefined;
2568
+ layer_reason?: string | undefined;
2569
+ created_at?: string | undefined;
2570
+ tags?: string[] | undefined;
2571
+ relevance_scope?: "narrow" | "broad" | undefined;
2572
+ relevance_paths?: string[] | undefined;
2573
+ }>>;
2574
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2575
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
2576
+ file: z.ZodString;
2577
+ content_ref: z.ZodOptional<z.ZodString>;
2578
+ scope_glob: z.ZodString;
2579
+ hash: z.ZodString;
2580
+ stable_id: z.ZodOptional<z.ZodString>;
2581
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
2582
+ activation: z.ZodOptional<z.ZodObject<{
2583
+ tier: z.ZodEnum<["always", "path", "description"]>;
2584
+ description: z.ZodOptional<z.ZodString>;
2585
+ }, "strip", z.ZodTypeAny, {
2586
+ tier: "always" | "path" | "description";
2587
+ description?: string | undefined;
2588
+ }, {
2589
+ tier: "always" | "path" | "description";
2590
+ description?: string | undefined;
2591
+ }>>;
2592
+ description: z.ZodOptional<z.ZodObject<{
2593
+ summary: z.ZodString;
2594
+ intent_clues: z.ZodArray<z.ZodString, "many">;
2595
+ tech_stack: z.ZodArray<z.ZodString, "many">;
2596
+ impact: z.ZodArray<z.ZodString, "many">;
2597
+ must_read_if: z.ZodString;
2598
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2599
+ id: z.ZodOptional<z.ZodString>;
2600
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
2601
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
2602
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
2603
+ layer_reason: z.ZodOptional<z.ZodString>;
2604
+ created_at: z.ZodOptional<z.ZodString>;
2605
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
2606
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
2607
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2608
+ }, "strict", z.ZodTypeAny, {
2609
+ summary: string;
2610
+ intent_clues: string[];
2611
+ tech_stack: string[];
2612
+ impact: string[];
2613
+ must_read_if: string;
2614
+ relevance_scope: "narrow" | "broad";
2615
+ relevance_paths: string[];
2616
+ entities?: string[] | undefined;
2617
+ id?: string | undefined;
2618
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
2619
+ maturity?: "draft" | "verified" | "proven" | undefined;
2620
+ knowledge_layer?: "personal" | "team" | undefined;
2621
+ layer_reason?: string | undefined;
2622
+ created_at?: string | undefined;
2623
+ tags?: string[] | undefined;
2624
+ }, {
2625
+ summary: string;
2626
+ intent_clues: string[];
2627
+ tech_stack: string[];
2628
+ impact: string[];
2629
+ must_read_if: string;
2630
+ entities?: string[] | undefined;
2631
+ id?: string | undefined;
2632
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
2633
+ maturity?: "draft" | "verified" | "proven" | undefined;
2634
+ knowledge_layer?: "personal" | "team" | undefined;
2635
+ layer_reason?: string | undefined;
2636
+ created_at?: string | undefined;
2637
+ tags?: string[] | undefined;
2638
+ relevance_scope?: "narrow" | "broad" | undefined;
2639
+ relevance_paths?: string[] | undefined;
2640
+ }>>;
2641
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2642
+ }, z.ZodTypeAny, "passthrough">, unknown>>;
2242
2643
  counters: z.ZodOptional<z.ZodDefault<z.ZodObject<{
2243
2644
  KP: z.ZodDefault<z.ZodObject<{
2244
2645
  MOD: z.ZodDefault<z.ZodNumber>;
@@ -2311,20 +2712,47 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2311
2712
  }>>>;
2312
2713
  }, "strip", z.ZodTypeAny, {
2313
2714
  revision: string;
2314
- nodes: Record<string, {
2315
- file: string;
2316
- priority: "high" | "medium" | "low";
2317
- hash: string;
2318
- layer: "L0" | "L1" | "L2";
2319
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
2320
- scope_glob: string;
2321
- deps: string[];
2322
- description?: {
2715
+ nodes: Record<string, z.objectOutputType<{
2716
+ file: z.ZodString;
2717
+ content_ref: z.ZodOptional<z.ZodString>;
2718
+ scope_glob: z.ZodString;
2719
+ hash: z.ZodString;
2720
+ stable_id: z.ZodOptional<z.ZodString>;
2721
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
2722
+ activation: z.ZodOptional<z.ZodObject<{
2723
+ tier: z.ZodEnum<["always", "path", "description"]>;
2724
+ description: z.ZodOptional<z.ZodString>;
2725
+ }, "strip", z.ZodTypeAny, {
2726
+ tier: "always" | "path" | "description";
2727
+ description?: string | undefined;
2728
+ }, {
2729
+ tier: "always" | "path" | "description";
2730
+ description?: string | undefined;
2731
+ }>>;
2732
+ description: z.ZodOptional<z.ZodObject<{
2733
+ summary: z.ZodString;
2734
+ intent_clues: z.ZodArray<z.ZodString, "many">;
2735
+ tech_stack: z.ZodArray<z.ZodString, "many">;
2736
+ impact: z.ZodArray<z.ZodString, "many">;
2737
+ must_read_if: z.ZodString;
2738
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2739
+ id: z.ZodOptional<z.ZodString>;
2740
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
2741
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
2742
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
2743
+ layer_reason: z.ZodOptional<z.ZodString>;
2744
+ created_at: z.ZodOptional<z.ZodString>;
2745
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
2746
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
2747
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2748
+ }, "strict", z.ZodTypeAny, {
2323
2749
  summary: string;
2324
2750
  intent_clues: string[];
2325
2751
  tech_stack: string[];
2326
2752
  impact: string[];
2327
2753
  must_read_if: string;
2754
+ relevance_scope: "narrow" | "broad";
2755
+ relevance_paths: string[];
2328
2756
  entities?: string[] | undefined;
2329
2757
  id?: string | undefined;
2330
2758
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -2333,17 +2761,25 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2333
2761
  layer_reason?: string | undefined;
2334
2762
  created_at?: string | undefined;
2335
2763
  tags?: string[] | undefined;
2336
- } | undefined;
2337
- stable_id?: string | undefined;
2338
- level?: "L0" | "L1" | "L2" | undefined;
2339
- sections?: string[] | undefined;
2340
- content_ref?: string | undefined;
2341
- identity_source?: "declared" | "derived" | undefined;
2342
- activation?: {
2343
- tier: "always" | "path" | "description";
2344
- description?: string | undefined;
2345
- } | undefined;
2346
- }>;
2764
+ }, {
2765
+ summary: string;
2766
+ intent_clues: string[];
2767
+ tech_stack: string[];
2768
+ impact: string[];
2769
+ must_read_if: string;
2770
+ entities?: string[] | undefined;
2771
+ id?: string | undefined;
2772
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
2773
+ maturity?: "draft" | "verified" | "proven" | undefined;
2774
+ knowledge_layer?: "personal" | "team" | undefined;
2775
+ layer_reason?: string | undefined;
2776
+ created_at?: string | undefined;
2777
+ tags?: string[] | undefined;
2778
+ relevance_scope?: "narrow" | "broad" | undefined;
2779
+ relevance_paths?: string[] | undefined;
2780
+ }>>;
2781
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2782
+ }, z.ZodTypeAny, "passthrough">>;
2347
2783
  counters?: {
2348
2784
  KP: {
2349
2785
  MOD: number;
@@ -2384,20 +2820,47 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2384
2820
  type: "meta:updated";
2385
2821
  payload: {
2386
2822
  revision: string;
2387
- nodes: Record<string, {
2388
- file: string;
2389
- priority: "high" | "medium" | "low";
2390
- hash: string;
2391
- layer: "L0" | "L1" | "L2";
2392
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
2393
- scope_glob: string;
2394
- deps: string[];
2395
- description?: {
2823
+ nodes: Record<string, z.objectOutputType<{
2824
+ file: z.ZodString;
2825
+ content_ref: z.ZodOptional<z.ZodString>;
2826
+ scope_glob: z.ZodString;
2827
+ hash: z.ZodString;
2828
+ stable_id: z.ZodOptional<z.ZodString>;
2829
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
2830
+ activation: z.ZodOptional<z.ZodObject<{
2831
+ tier: z.ZodEnum<["always", "path", "description"]>;
2832
+ description: z.ZodOptional<z.ZodString>;
2833
+ }, "strip", z.ZodTypeAny, {
2834
+ tier: "always" | "path" | "description";
2835
+ description?: string | undefined;
2836
+ }, {
2837
+ tier: "always" | "path" | "description";
2838
+ description?: string | undefined;
2839
+ }>>;
2840
+ description: z.ZodOptional<z.ZodObject<{
2841
+ summary: z.ZodString;
2842
+ intent_clues: z.ZodArray<z.ZodString, "many">;
2843
+ tech_stack: z.ZodArray<z.ZodString, "many">;
2844
+ impact: z.ZodArray<z.ZodString, "many">;
2845
+ must_read_if: z.ZodString;
2846
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2847
+ id: z.ZodOptional<z.ZodString>;
2848
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
2849
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
2850
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
2851
+ layer_reason: z.ZodOptional<z.ZodString>;
2852
+ created_at: z.ZodOptional<z.ZodString>;
2853
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
2854
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
2855
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2856
+ }, "strict", z.ZodTypeAny, {
2396
2857
  summary: string;
2397
2858
  intent_clues: string[];
2398
2859
  tech_stack: string[];
2399
2860
  impact: string[];
2400
2861
  must_read_if: string;
2862
+ relevance_scope: "narrow" | "broad";
2863
+ relevance_paths: string[];
2401
2864
  entities?: string[] | undefined;
2402
2865
  id?: string | undefined;
2403
2866
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -2406,17 +2869,25 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
2406
2869
  layer_reason?: string | undefined;
2407
2870
  created_at?: string | undefined;
2408
2871
  tags?: string[] | undefined;
2409
- } | undefined;
2410
- stable_id?: string | undefined;
2411
- level?: "L0" | "L1" | "L2" | undefined;
2412
- sections?: string[] | undefined;
2413
- content_ref?: string | undefined;
2414
- identity_source?: "declared" | "derived" | undefined;
2415
- activation?: {
2416
- tier: "always" | "path" | "description";
2417
- description?: string | undefined;
2418
- } | undefined;
2419
- }>;
2872
+ }, {
2873
+ summary: string;
2874
+ intent_clues: string[];
2875
+ tech_stack: string[];
2876
+ impact: string[];
2877
+ must_read_if: string;
2878
+ entities?: string[] | undefined;
2879
+ id?: string | undefined;
2880
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
2881
+ maturity?: "draft" | "verified" | "proven" | undefined;
2882
+ knowledge_layer?: "personal" | "team" | undefined;
2883
+ layer_reason?: string | undefined;
2884
+ created_at?: string | undefined;
2885
+ tags?: string[] | undefined;
2886
+ relevance_scope?: "narrow" | "broad" | undefined;
2887
+ relevance_paths?: string[] | undefined;
2888
+ }>>;
2889
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2890
+ }, z.ZodTypeAny, "passthrough">>;
2420
2891
  counters?: {
2421
2892
  KP: {
2422
2893
  MOD: number;
@@ -2756,14 +3227,14 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2756
3227
  subkind: z.ZodString;
2757
3228
  evidence: z.ZodArray<z.ZodString, "many">;
2758
3229
  }, "strip", z.ZodTypeAny, {
3230
+ version: string;
2759
3231
  evidence: string[];
2760
3232
  kind: string;
2761
- version: string;
2762
3233
  subkind: string;
2763
3234
  }, {
3235
+ version: string;
2764
3236
  evidence: string[];
2765
3237
  kind: string;
2766
- version: string;
2767
3238
  subkind: string;
2768
3239
  }>;
2769
3240
  topology: z.ZodObject<{
@@ -2919,14 +3390,14 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2919
3390
  }>;
2920
3391
  recommendations_for_skill: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2921
3392
  }, "strip", z.ZodTypeAny, {
3393
+ version: string;
2922
3394
  generated_at: string;
2923
3395
  framework: {
3396
+ version: string;
2924
3397
  evidence: string[];
2925
3398
  kind: string;
2926
- version: string;
2927
3399
  subkind: string;
2928
3400
  };
2929
- version: string;
2930
3401
  generated_by: string;
2931
3402
  target: string;
2932
3403
  project_name: string;
@@ -2981,14 +3452,14 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2981
3452
  };
2982
3453
  recommendations_for_skill?: string[] | undefined;
2983
3454
  }, {
3455
+ version: string;
2984
3456
  generated_at: string;
2985
3457
  framework: {
3458
+ version: string;
2986
3459
  evidence: string[];
2987
3460
  kind: string;
2988
- version: string;
2989
3461
  subkind: string;
2990
3462
  };
2991
- version: string;
2992
3463
  generated_by: string;
2993
3464
  target: string;
2994
3465
  project_name: string;
@@ -3046,14 +3517,14 @@ declare const driftDetectedEventSchema: z.ZodObject<{
3046
3517
  }, "strip", z.ZodTypeAny, {
3047
3518
  type: "drift:detected";
3048
3519
  payload: {
3520
+ version: string;
3049
3521
  generated_at: string;
3050
3522
  framework: {
3523
+ version: string;
3051
3524
  evidence: string[];
3052
3525
  kind: string;
3053
- version: string;
3054
3526
  subkind: string;
3055
3527
  };
3056
- version: string;
3057
3528
  generated_by: string;
3058
3529
  target: string;
3059
3530
  project_name: string;
@@ -3111,14 +3582,14 @@ declare const driftDetectedEventSchema: z.ZodObject<{
3111
3582
  }, {
3112
3583
  type: "drift:detected";
3113
3584
  payload: {
3585
+ version: string;
3114
3586
  generated_at: string;
3115
3587
  framework: {
3588
+ version: string;
3116
3589
  evidence: string[];
3117
3590
  kind: string;
3118
- version: string;
3119
3591
  subkind: string;
3120
3592
  };
3121
- version: string;
3122
3593
  generated_by: string;
3123
3594
  target: string;
3124
3595
  project_name: string;
@@ -3182,11 +3653,6 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3182
3653
  file: z.ZodString;
3183
3654
  content_ref: z.ZodOptional<z.ZodString>;
3184
3655
  scope_glob: z.ZodString;
3185
- deps: z.ZodArray<z.ZodString, "many">;
3186
- priority: z.ZodEnum<["high", "medium", "low"]>;
3187
- level: z.ZodOptional<z.ZodEnum<["L0", "L1", "L2"]>>;
3188
- layer: z.ZodEnum<["L0", "L1", "L2"]>;
3189
- topology_type: z.ZodEnum<["mirror", "cross-cutting", "domain", "local", "global"]>;
3190
3656
  hash: z.ZodString;
3191
3657
  stable_id: z.ZodOptional<z.ZodString>;
3192
3658
  identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
@@ -3214,12 +3680,16 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3214
3680
  layer_reason: z.ZodOptional<z.ZodString>;
3215
3681
  created_at: z.ZodOptional<z.ZodString>;
3216
3682
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
3683
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
3684
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3217
3685
  }, "strict", z.ZodTypeAny, {
3218
3686
  summary: string;
3219
3687
  intent_clues: string[];
3220
3688
  tech_stack: string[];
3221
3689
  impact: string[];
3222
3690
  must_read_if: string;
3691
+ relevance_scope: "narrow" | "broad";
3692
+ relevance_paths: string[];
3223
3693
  entities?: string[] | undefined;
3224
3694
  id?: string | undefined;
3225
3695
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -3242,22 +3712,51 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3242
3712
  layer_reason?: string | undefined;
3243
3713
  created_at?: string | undefined;
3244
3714
  tags?: string[] | undefined;
3715
+ relevance_scope?: "narrow" | "broad" | undefined;
3716
+ relevance_paths?: string[] | undefined;
3245
3717
  }>>;
3246
3718
  sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3247
- }, "strip", z.ZodTypeAny, {
3248
- file: string;
3249
- priority: "high" | "medium" | "low";
3250
- hash: string;
3251
- layer: "L0" | "L1" | "L2";
3252
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
3253
- scope_glob: string;
3254
- deps: string[];
3255
- description?: {
3719
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3720
+ file: z.ZodString;
3721
+ content_ref: z.ZodOptional<z.ZodString>;
3722
+ scope_glob: z.ZodString;
3723
+ hash: z.ZodString;
3724
+ stable_id: z.ZodOptional<z.ZodString>;
3725
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
3726
+ activation: z.ZodOptional<z.ZodObject<{
3727
+ tier: z.ZodEnum<["always", "path", "description"]>;
3728
+ description: z.ZodOptional<z.ZodString>;
3729
+ }, "strip", z.ZodTypeAny, {
3730
+ tier: "always" | "path" | "description";
3731
+ description?: string | undefined;
3732
+ }, {
3733
+ tier: "always" | "path" | "description";
3734
+ description?: string | undefined;
3735
+ }>>;
3736
+ description: z.ZodOptional<z.ZodObject<{
3737
+ summary: z.ZodString;
3738
+ intent_clues: z.ZodArray<z.ZodString, "many">;
3739
+ tech_stack: z.ZodArray<z.ZodString, "many">;
3740
+ impact: z.ZodArray<z.ZodString, "many">;
3741
+ must_read_if: z.ZodString;
3742
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3743
+ id: z.ZodOptional<z.ZodString>;
3744
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
3745
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
3746
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
3747
+ layer_reason: z.ZodOptional<z.ZodString>;
3748
+ created_at: z.ZodOptional<z.ZodString>;
3749
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
3750
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
3751
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3752
+ }, "strict", z.ZodTypeAny, {
3256
3753
  summary: string;
3257
3754
  intent_clues: string[];
3258
3755
  tech_stack: string[];
3259
3756
  impact: string[];
3260
3757
  must_read_if: string;
3758
+ relevance_scope: "narrow" | "broad";
3759
+ relevance_paths: string[];
3261
3760
  entities?: string[] | undefined;
3262
3761
  id?: string | undefined;
3263
3762
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -3266,25 +3765,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3266
3765
  layer_reason?: string | undefined;
3267
3766
  created_at?: string | undefined;
3268
3767
  tags?: string[] | undefined;
3269
- } | undefined;
3270
- stable_id?: string | undefined;
3271
- level?: "L0" | "L1" | "L2" | undefined;
3272
- sections?: string[] | undefined;
3273
- content_ref?: string | undefined;
3274
- identity_source?: "declared" | "derived" | undefined;
3275
- activation?: {
3276
- tier: "always" | "path" | "description";
3277
- description?: string | undefined;
3278
- } | undefined;
3279
- }, {
3280
- file: string;
3281
- priority: "high" | "medium" | "low";
3282
- hash: string;
3283
- layer: "L0" | "L1" | "L2";
3284
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
3285
- scope_glob: string;
3286
- deps: string[];
3287
- description?: {
3768
+ }, {
3288
3769
  summary: string;
3289
3770
  intent_clues: string[];
3290
3771
  tech_stack: string[];
@@ -3298,30 +3779,51 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3298
3779
  layer_reason?: string | undefined;
3299
3780
  created_at?: string | undefined;
3300
3781
  tags?: string[] | undefined;
3301
- } | undefined;
3302
- stable_id?: string | undefined;
3303
- level?: "L0" | "L1" | "L2" | undefined;
3304
- sections?: string[] | undefined;
3305
- content_ref?: string | undefined;
3306
- identity_source?: "declared" | "derived" | undefined;
3307
- activation?: {
3308
- tier: "always" | "path" | "description";
3309
- description?: string | undefined;
3310
- } | undefined;
3311
- }>, {
3312
- file: string;
3313
- priority: "high" | "medium" | "low";
3314
- hash: string;
3315
- layer: "L0" | "L1" | "L2";
3316
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
3317
- scope_glob: string;
3318
- deps: string[];
3319
- description?: {
3320
- summary: string;
3321
- intent_clues: string[];
3322
- tech_stack: string[];
3782
+ relevance_scope?: "narrow" | "broad" | undefined;
3783
+ relevance_paths?: string[] | undefined;
3784
+ }>>;
3785
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3786
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3787
+ file: z.ZodString;
3788
+ content_ref: z.ZodOptional<z.ZodString>;
3789
+ scope_glob: z.ZodString;
3790
+ hash: z.ZodString;
3791
+ stable_id: z.ZodOptional<z.ZodString>;
3792
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
3793
+ activation: z.ZodOptional<z.ZodObject<{
3794
+ tier: z.ZodEnum<["always", "path", "description"]>;
3795
+ description: z.ZodOptional<z.ZodString>;
3796
+ }, "strip", z.ZodTypeAny, {
3797
+ tier: "always" | "path" | "description";
3798
+ description?: string | undefined;
3799
+ }, {
3800
+ tier: "always" | "path" | "description";
3801
+ description?: string | undefined;
3802
+ }>>;
3803
+ description: z.ZodOptional<z.ZodObject<{
3804
+ summary: z.ZodString;
3805
+ intent_clues: z.ZodArray<z.ZodString, "many">;
3806
+ tech_stack: z.ZodArray<z.ZodString, "many">;
3807
+ impact: z.ZodArray<z.ZodString, "many">;
3808
+ must_read_if: z.ZodString;
3809
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3810
+ id: z.ZodOptional<z.ZodString>;
3811
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
3812
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
3813
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
3814
+ layer_reason: z.ZodOptional<z.ZodString>;
3815
+ created_at: z.ZodOptional<z.ZodString>;
3816
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
3817
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
3818
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3819
+ }, "strict", z.ZodTypeAny, {
3820
+ summary: string;
3821
+ intent_clues: string[];
3822
+ tech_stack: string[];
3323
3823
  impact: string[];
3324
3824
  must_read_if: string;
3825
+ relevance_scope: "narrow" | "broad";
3826
+ relevance_paths: string[];
3325
3827
  entities?: string[] | undefined;
3326
3828
  id?: string | undefined;
3327
3829
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -3330,17 +3832,92 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3330
3832
  layer_reason?: string | undefined;
3331
3833
  created_at?: string | undefined;
3332
3834
  tags?: string[] | undefined;
3333
- } | undefined;
3334
- stable_id?: string | undefined;
3335
- level?: "L0" | "L1" | "L2" | undefined;
3336
- sections?: string[] | undefined;
3337
- content_ref?: string | undefined;
3338
- identity_source?: "declared" | "derived" | undefined;
3339
- activation?: {
3835
+ }, {
3836
+ summary: string;
3837
+ intent_clues: string[];
3838
+ tech_stack: string[];
3839
+ impact: string[];
3840
+ must_read_if: string;
3841
+ entities?: string[] | undefined;
3842
+ id?: string | undefined;
3843
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
3844
+ maturity?: "draft" | "verified" | "proven" | undefined;
3845
+ knowledge_layer?: "personal" | "team" | undefined;
3846
+ layer_reason?: string | undefined;
3847
+ created_at?: string | undefined;
3848
+ tags?: string[] | undefined;
3849
+ relevance_scope?: "narrow" | "broad" | undefined;
3850
+ relevance_paths?: string[] | undefined;
3851
+ }>>;
3852
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3853
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
3854
+ file: z.ZodString;
3855
+ content_ref: z.ZodOptional<z.ZodString>;
3856
+ scope_glob: z.ZodString;
3857
+ hash: z.ZodString;
3858
+ stable_id: z.ZodOptional<z.ZodString>;
3859
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
3860
+ activation: z.ZodOptional<z.ZodObject<{
3861
+ tier: z.ZodEnum<["always", "path", "description"]>;
3862
+ description: z.ZodOptional<z.ZodString>;
3863
+ }, "strip", z.ZodTypeAny, {
3340
3864
  tier: "always" | "path" | "description";
3341
3865
  description?: string | undefined;
3342
- } | undefined;
3343
- }, unknown>>;
3866
+ }, {
3867
+ tier: "always" | "path" | "description";
3868
+ description?: string | undefined;
3869
+ }>>;
3870
+ description: z.ZodOptional<z.ZodObject<{
3871
+ summary: z.ZodString;
3872
+ intent_clues: z.ZodArray<z.ZodString, "many">;
3873
+ tech_stack: z.ZodArray<z.ZodString, "many">;
3874
+ impact: z.ZodArray<z.ZodString, "many">;
3875
+ must_read_if: z.ZodString;
3876
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3877
+ id: z.ZodOptional<z.ZodString>;
3878
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
3879
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
3880
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
3881
+ layer_reason: z.ZodOptional<z.ZodString>;
3882
+ created_at: z.ZodOptional<z.ZodString>;
3883
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
3884
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
3885
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3886
+ }, "strict", z.ZodTypeAny, {
3887
+ summary: string;
3888
+ intent_clues: string[];
3889
+ tech_stack: string[];
3890
+ impact: string[];
3891
+ must_read_if: string;
3892
+ relevance_scope: "narrow" | "broad";
3893
+ relevance_paths: string[];
3894
+ entities?: string[] | undefined;
3895
+ id?: string | undefined;
3896
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
3897
+ maturity?: "draft" | "verified" | "proven" | undefined;
3898
+ knowledge_layer?: "personal" | "team" | undefined;
3899
+ layer_reason?: string | undefined;
3900
+ created_at?: string | undefined;
3901
+ tags?: string[] | undefined;
3902
+ }, {
3903
+ summary: string;
3904
+ intent_clues: string[];
3905
+ tech_stack: string[];
3906
+ impact: string[];
3907
+ must_read_if: string;
3908
+ entities?: string[] | undefined;
3909
+ id?: string | undefined;
3910
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
3911
+ maturity?: "draft" | "verified" | "proven" | undefined;
3912
+ knowledge_layer?: "personal" | "team" | undefined;
3913
+ layer_reason?: string | undefined;
3914
+ created_at?: string | undefined;
3915
+ tags?: string[] | undefined;
3916
+ relevance_scope?: "narrow" | "broad" | undefined;
3917
+ relevance_paths?: string[] | undefined;
3918
+ }>>;
3919
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3920
+ }, z.ZodTypeAny, "passthrough">, unknown>>;
3344
3921
  counters: z.ZodOptional<z.ZodDefault<z.ZodObject<{
3345
3922
  KP: z.ZodDefault<z.ZodObject<{
3346
3923
  MOD: z.ZodDefault<z.ZodNumber>;
@@ -3413,20 +3990,47 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3413
3990
  }>>>;
3414
3991
  }, "strip", z.ZodTypeAny, {
3415
3992
  revision: string;
3416
- nodes: Record<string, {
3417
- file: string;
3418
- priority: "high" | "medium" | "low";
3419
- hash: string;
3420
- layer: "L0" | "L1" | "L2";
3421
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
3422
- scope_glob: string;
3423
- deps: string[];
3424
- description?: {
3993
+ nodes: Record<string, z.objectOutputType<{
3994
+ file: z.ZodString;
3995
+ content_ref: z.ZodOptional<z.ZodString>;
3996
+ scope_glob: z.ZodString;
3997
+ hash: z.ZodString;
3998
+ stable_id: z.ZodOptional<z.ZodString>;
3999
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
4000
+ activation: z.ZodOptional<z.ZodObject<{
4001
+ tier: z.ZodEnum<["always", "path", "description"]>;
4002
+ description: z.ZodOptional<z.ZodString>;
4003
+ }, "strip", z.ZodTypeAny, {
4004
+ tier: "always" | "path" | "description";
4005
+ description?: string | undefined;
4006
+ }, {
4007
+ tier: "always" | "path" | "description";
4008
+ description?: string | undefined;
4009
+ }>>;
4010
+ description: z.ZodOptional<z.ZodObject<{
4011
+ summary: z.ZodString;
4012
+ intent_clues: z.ZodArray<z.ZodString, "many">;
4013
+ tech_stack: z.ZodArray<z.ZodString, "many">;
4014
+ impact: z.ZodArray<z.ZodString, "many">;
4015
+ must_read_if: z.ZodString;
4016
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4017
+ id: z.ZodOptional<z.ZodString>;
4018
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
4019
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
4020
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
4021
+ layer_reason: z.ZodOptional<z.ZodString>;
4022
+ created_at: z.ZodOptional<z.ZodString>;
4023
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4024
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4025
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4026
+ }, "strict", z.ZodTypeAny, {
3425
4027
  summary: string;
3426
4028
  intent_clues: string[];
3427
4029
  tech_stack: string[];
3428
4030
  impact: string[];
3429
4031
  must_read_if: string;
4032
+ relevance_scope: "narrow" | "broad";
4033
+ relevance_paths: string[];
3430
4034
  entities?: string[] | undefined;
3431
4035
  id?: string | undefined;
3432
4036
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -3435,17 +4039,25 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3435
4039
  layer_reason?: string | undefined;
3436
4040
  created_at?: string | undefined;
3437
4041
  tags?: string[] | undefined;
3438
- } | undefined;
3439
- stable_id?: string | undefined;
3440
- level?: "L0" | "L1" | "L2" | undefined;
3441
- sections?: string[] | undefined;
3442
- content_ref?: string | undefined;
3443
- identity_source?: "declared" | "derived" | undefined;
3444
- activation?: {
3445
- tier: "always" | "path" | "description";
3446
- description?: string | undefined;
3447
- } | undefined;
3448
- }>;
4042
+ }, {
4043
+ summary: string;
4044
+ intent_clues: string[];
4045
+ tech_stack: string[];
4046
+ impact: string[];
4047
+ must_read_if: string;
4048
+ entities?: string[] | undefined;
4049
+ id?: string | undefined;
4050
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
4051
+ maturity?: "draft" | "verified" | "proven" | undefined;
4052
+ knowledge_layer?: "personal" | "team" | undefined;
4053
+ layer_reason?: string | undefined;
4054
+ created_at?: string | undefined;
4055
+ tags?: string[] | undefined;
4056
+ relevance_scope?: "narrow" | "broad" | undefined;
4057
+ relevance_paths?: string[] | undefined;
4058
+ }>>;
4059
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4060
+ }, z.ZodTypeAny, "passthrough">>;
3449
4061
  counters?: {
3450
4062
  KP: {
3451
4063
  MOD: number;
@@ -3486,20 +4098,47 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3486
4098
  type: "meta:updated";
3487
4099
  payload: {
3488
4100
  revision: string;
3489
- nodes: Record<string, {
3490
- file: string;
3491
- priority: "high" | "medium" | "low";
3492
- hash: string;
3493
- layer: "L0" | "L1" | "L2";
3494
- topology_type: "mirror" | "cross-cutting" | "domain" | "local" | "global";
3495
- scope_glob: string;
3496
- deps: string[];
3497
- description?: {
4101
+ nodes: Record<string, z.objectOutputType<{
4102
+ file: z.ZodString;
4103
+ content_ref: z.ZodOptional<z.ZodString>;
4104
+ scope_glob: z.ZodString;
4105
+ hash: z.ZodString;
4106
+ stable_id: z.ZodOptional<z.ZodString>;
4107
+ identity_source: z.ZodOptional<z.ZodEnum<["declared", "derived"]>>;
4108
+ activation: z.ZodOptional<z.ZodObject<{
4109
+ tier: z.ZodEnum<["always", "path", "description"]>;
4110
+ description: z.ZodOptional<z.ZodString>;
4111
+ }, "strip", z.ZodTypeAny, {
4112
+ tier: "always" | "path" | "description";
4113
+ description?: string | undefined;
4114
+ }, {
4115
+ tier: "always" | "path" | "description";
4116
+ description?: string | undefined;
4117
+ }>>;
4118
+ description: z.ZodOptional<z.ZodObject<{
4119
+ summary: z.ZodString;
4120
+ intent_clues: z.ZodArray<z.ZodString, "many">;
4121
+ tech_stack: z.ZodArray<z.ZodString, "many">;
4122
+ impact: z.ZodArray<z.ZodString, "many">;
4123
+ must_read_if: z.ZodString;
4124
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4125
+ id: z.ZodOptional<z.ZodString>;
4126
+ knowledge_type: z.ZodOptional<z.ZodEnum<["model", "decision", "guideline", "pitfall", "process"]>>;
4127
+ maturity: z.ZodOptional<z.ZodEnum<["draft", "verified", "proven"]>>;
4128
+ knowledge_layer: z.ZodOptional<z.ZodEnum<["personal", "team"]>>;
4129
+ layer_reason: z.ZodOptional<z.ZodString>;
4130
+ created_at: z.ZodOptional<z.ZodString>;
4131
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4132
+ relevance_scope: z.ZodDefault<z.ZodEnum<["narrow", "broad"]>>;
4133
+ relevance_paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4134
+ }, "strict", z.ZodTypeAny, {
3498
4135
  summary: string;
3499
4136
  intent_clues: string[];
3500
4137
  tech_stack: string[];
3501
4138
  impact: string[];
3502
4139
  must_read_if: string;
4140
+ relevance_scope: "narrow" | "broad";
4141
+ relevance_paths: string[];
3503
4142
  entities?: string[] | undefined;
3504
4143
  id?: string | undefined;
3505
4144
  knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
@@ -3508,17 +4147,25 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3508
4147
  layer_reason?: string | undefined;
3509
4148
  created_at?: string | undefined;
3510
4149
  tags?: string[] | undefined;
3511
- } | undefined;
3512
- stable_id?: string | undefined;
3513
- level?: "L0" | "L1" | "L2" | undefined;
3514
- sections?: string[] | undefined;
3515
- content_ref?: string | undefined;
3516
- identity_source?: "declared" | "derived" | undefined;
3517
- activation?: {
3518
- tier: "always" | "path" | "description";
3519
- description?: string | undefined;
3520
- } | undefined;
3521
- }>;
4150
+ }, {
4151
+ summary: string;
4152
+ intent_clues: string[];
4153
+ tech_stack: string[];
4154
+ impact: string[];
4155
+ must_read_if: string;
4156
+ entities?: string[] | undefined;
4157
+ id?: string | undefined;
4158
+ knowledge_type?: "model" | "decision" | "guideline" | "pitfall" | "process" | undefined;
4159
+ maturity?: "draft" | "verified" | "proven" | undefined;
4160
+ knowledge_layer?: "personal" | "team" | undefined;
4161
+ layer_reason?: string | undefined;
4162
+ created_at?: string | undefined;
4163
+ tags?: string[] | undefined;
4164
+ relevance_scope?: "narrow" | "broad" | undefined;
4165
+ relevance_paths?: string[] | undefined;
4166
+ }>>;
4167
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4168
+ }, z.ZodTypeAny, "passthrough">>;
3522
4169
  counters?: {
3523
4170
  KP: {
3524
4171
  MOD: number;
@@ -3854,14 +4501,14 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3854
4501
  subkind: z.ZodString;
3855
4502
  evidence: z.ZodArray<z.ZodString, "many">;
3856
4503
  }, "strip", z.ZodTypeAny, {
4504
+ version: string;
3857
4505
  evidence: string[];
3858
4506
  kind: string;
3859
- version: string;
3860
4507
  subkind: string;
3861
4508
  }, {
4509
+ version: string;
3862
4510
  evidence: string[];
3863
4511
  kind: string;
3864
- version: string;
3865
4512
  subkind: string;
3866
4513
  }>;
3867
4514
  topology: z.ZodObject<{
@@ -4017,14 +4664,14 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4017
4664
  }>;
4018
4665
  recommendations_for_skill: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4019
4666
  }, "strip", z.ZodTypeAny, {
4667
+ version: string;
4020
4668
  generated_at: string;
4021
4669
  framework: {
4670
+ version: string;
4022
4671
  evidence: string[];
4023
4672
  kind: string;
4024
- version: string;
4025
4673
  subkind: string;
4026
4674
  };
4027
- version: string;
4028
4675
  generated_by: string;
4029
4676
  target: string;
4030
4677
  project_name: string;
@@ -4079,14 +4726,14 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4079
4726
  };
4080
4727
  recommendations_for_skill?: string[] | undefined;
4081
4728
  }, {
4729
+ version: string;
4082
4730
  generated_at: string;
4083
4731
  framework: {
4732
+ version: string;
4084
4733
  evidence: string[];
4085
4734
  kind: string;
4086
- version: string;
4087
4735
  subkind: string;
4088
4736
  };
4089
- version: string;
4090
4737
  generated_by: string;
4091
4738
  target: string;
4092
4739
  project_name: string;
@@ -4144,14 +4791,14 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4144
4791
  }, "strip", z.ZodTypeAny, {
4145
4792
  type: "drift:detected";
4146
4793
  payload: {
4794
+ version: string;
4147
4795
  generated_at: string;
4148
4796
  framework: {
4797
+ version: string;
4149
4798
  evidence: string[];
4150
4799
  kind: string;
4151
- version: string;
4152
4800
  subkind: string;
4153
4801
  };
4154
- version: string;
4155
4802
  generated_by: string;
4156
4803
  target: string;
4157
4804
  project_name: string;
@@ -4207,73 +4854,1242 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4207
4854
  recommendations_for_skill?: string[] | undefined;
4208
4855
  };
4209
4856
  }, {
4210
- type: "drift:detected";
4211
- payload: {
4212
- generated_at: string;
4213
- framework: {
4214
- evidence: string[];
4215
- kind: string;
4216
- version: string;
4217
- subkind: string;
4218
- };
4219
- version: string;
4220
- generated_by: string;
4221
- target: string;
4222
- project_name: string;
4223
- topology: {
4224
- total_files: number;
4225
- by_ext: Record<string, number>;
4226
- key_dirs: string[];
4227
- max_depth: number;
4228
- };
4229
- entry_points: {
4230
- path: string;
4231
- reason: string;
4232
- size_bytes?: number | undefined;
4233
- }[];
4234
- code_samples: {
4235
- path: string;
4236
- lines: string;
4237
- snippet: string;
4238
- pattern_hint: string;
4239
- }[];
4240
- assertions: {
4241
- type: "domain" | "framework" | "pattern" | "invariant";
4242
- statement: string;
4243
- confidence: "HIGH" | "MEDIUM" | "LOW";
4244
- evidence: {
4245
- file: string;
4246
- line: string;
4247
- snippet: string;
4248
- }[];
4249
- coverage: {
4250
- ratio: number;
4251
- total: number;
4252
- matched: number;
4253
- co_occurring_patterns: string[];
4254
- };
4255
- proposed_rule?: string | undefined;
4256
- alternatives?: string[] | undefined;
4257
- }[];
4258
- candidate_files: {
4259
- path: string;
4260
- family: "domain" | "entry" | "component" | "config" | "test";
4261
- rationale: string;
4262
- }[];
4263
- sampling_budget: {
4264
- max_files: 15;
4265
- max_lines_per_file: 100;
4266
- };
4267
- readme: {
4268
- quality: "missing" | "ok" | "stub";
4269
- line_count: number;
4270
- has_contributing: boolean;
4271
- };
4272
- recommendations_for_skill?: string[] | undefined;
4273
- };
4274
- }>]>;
4275
-
4276
- declare const knowledgeContextPlannedEventSchema: z.ZodObject<{
4857
+ type: "drift:detected";
4858
+ payload: {
4859
+ version: string;
4860
+ generated_at: string;
4861
+ framework: {
4862
+ version: string;
4863
+ evidence: string[];
4864
+ kind: string;
4865
+ subkind: string;
4866
+ };
4867
+ generated_by: string;
4868
+ target: string;
4869
+ project_name: string;
4870
+ topology: {
4871
+ total_files: number;
4872
+ by_ext: Record<string, number>;
4873
+ key_dirs: string[];
4874
+ max_depth: number;
4875
+ };
4876
+ entry_points: {
4877
+ path: string;
4878
+ reason: string;
4879
+ size_bytes?: number | undefined;
4880
+ }[];
4881
+ code_samples: {
4882
+ path: string;
4883
+ lines: string;
4884
+ snippet: string;
4885
+ pattern_hint: string;
4886
+ }[];
4887
+ assertions: {
4888
+ type: "domain" | "framework" | "pattern" | "invariant";
4889
+ statement: string;
4890
+ confidence: "HIGH" | "MEDIUM" | "LOW";
4891
+ evidence: {
4892
+ file: string;
4893
+ line: string;
4894
+ snippet: string;
4895
+ }[];
4896
+ coverage: {
4897
+ ratio: number;
4898
+ total: number;
4899
+ matched: number;
4900
+ co_occurring_patterns: string[];
4901
+ };
4902
+ proposed_rule?: string | undefined;
4903
+ alternatives?: string[] | undefined;
4904
+ }[];
4905
+ candidate_files: {
4906
+ path: string;
4907
+ family: "domain" | "entry" | "component" | "config" | "test";
4908
+ rationale: string;
4909
+ }[];
4910
+ sampling_budget: {
4911
+ max_files: 15;
4912
+ max_lines_per_file: 100;
4913
+ };
4914
+ readme: {
4915
+ quality: "missing" | "ok" | "stub";
4916
+ line_count: number;
4917
+ has_contributing: boolean;
4918
+ };
4919
+ recommendations_for_skill?: string[] | undefined;
4920
+ };
4921
+ }>]>;
4922
+
4923
+ declare const knowledgeContextPlannedEventSchema: z.ZodObject<{
4924
+ event_type: z.ZodLiteral<"knowledge_context_planned">;
4925
+ target_paths: z.ZodArray<z.ZodString, "many">;
4926
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
4927
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
4928
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
4929
+ selection_token: z.ZodOptional<z.ZodString>;
4930
+ client_hash: z.ZodOptional<z.ZodString>;
4931
+ intent: z.ZodOptional<z.ZodString>;
4932
+ known_tech: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4933
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4934
+ kind: z.ZodLiteral<"fabric-event">;
4935
+ id: z.ZodString;
4936
+ ts: z.ZodNumber;
4937
+ schema_version: z.ZodLiteral<1>;
4938
+ correlation_id: z.ZodOptional<z.ZodString>;
4939
+ session_id: z.ZodOptional<z.ZodString>;
4940
+ }, "strip", z.ZodTypeAny, {
4941
+ id: string;
4942
+ target_paths: string[];
4943
+ ts: number;
4944
+ schema_version: 1;
4945
+ kind: "fabric-event";
4946
+ event_type: "knowledge_context_planned";
4947
+ required_stable_ids: string[];
4948
+ ai_selectable_stable_ids: string[];
4949
+ final_stable_ids: string[];
4950
+ known_tech?: string[] | undefined;
4951
+ intent?: string | undefined;
4952
+ client_hash?: string | undefined;
4953
+ correlation_id?: string | undefined;
4954
+ session_id?: string | undefined;
4955
+ selection_token?: string | undefined;
4956
+ diagnostics?: unknown[] | undefined;
4957
+ }, {
4958
+ id: string;
4959
+ target_paths: string[];
4960
+ ts: number;
4961
+ schema_version: 1;
4962
+ kind: "fabric-event";
4963
+ event_type: "knowledge_context_planned";
4964
+ required_stable_ids: string[];
4965
+ ai_selectable_stable_ids: string[];
4966
+ final_stable_ids: string[];
4967
+ known_tech?: string[] | undefined;
4968
+ intent?: string | undefined;
4969
+ client_hash?: string | undefined;
4970
+ correlation_id?: string | undefined;
4971
+ session_id?: string | undefined;
4972
+ selection_token?: string | undefined;
4973
+ diagnostics?: unknown[] | undefined;
4974
+ }>;
4975
+ declare const knowledgeSelectionEventSchema: z.ZodObject<{
4976
+ event_type: z.ZodLiteral<"knowledge_selection">;
4977
+ selection_token: z.ZodString;
4978
+ target_paths: z.ZodArray<z.ZodString, "many">;
4979
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
4980
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
4981
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
4982
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
4983
+ ai_selection_reasons: z.ZodRecord<z.ZodString, z.ZodString>;
4984
+ rejected_stable_ids: z.ZodArray<z.ZodString, "many">;
4985
+ ignored_stable_ids: z.ZodArray<z.ZodString, "many">;
4986
+ kind: z.ZodLiteral<"fabric-event">;
4987
+ id: z.ZodString;
4988
+ ts: z.ZodNumber;
4989
+ schema_version: z.ZodLiteral<1>;
4990
+ correlation_id: z.ZodOptional<z.ZodString>;
4991
+ session_id: z.ZodOptional<z.ZodString>;
4992
+ }, "strip", z.ZodTypeAny, {
4993
+ id: string;
4994
+ target_paths: string[];
4995
+ selection_token: string;
4996
+ ai_selected_stable_ids: string[];
4997
+ ai_selection_reasons: Record<string, string>;
4998
+ ts: number;
4999
+ schema_version: 1;
5000
+ kind: "fabric-event";
5001
+ event_type: "knowledge_selection";
5002
+ required_stable_ids: string[];
5003
+ ai_selectable_stable_ids: string[];
5004
+ final_stable_ids: string[];
5005
+ rejected_stable_ids: string[];
5006
+ ignored_stable_ids: string[];
5007
+ correlation_id?: string | undefined;
5008
+ session_id?: string | undefined;
5009
+ }, {
5010
+ id: string;
5011
+ target_paths: string[];
5012
+ selection_token: string;
5013
+ ai_selected_stable_ids: string[];
5014
+ ai_selection_reasons: Record<string, string>;
5015
+ ts: number;
5016
+ schema_version: 1;
5017
+ kind: "fabric-event";
5018
+ event_type: "knowledge_selection";
5019
+ required_stable_ids: string[];
5020
+ ai_selectable_stable_ids: string[];
5021
+ final_stable_ids: string[];
5022
+ rejected_stable_ids: string[];
5023
+ ignored_stable_ids: string[];
5024
+ correlation_id?: string | undefined;
5025
+ session_id?: string | undefined;
5026
+ }>;
5027
+ declare const knowledgeSectionsFetchedEventSchema: z.ZodObject<{
5028
+ event_type: z.ZodLiteral<"knowledge_sections_fetched">;
5029
+ selection_token: z.ZodString;
5030
+ target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5031
+ requested_sections: z.ZodArray<z.ZodString, "many">;
5032
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
5033
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
5034
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
5035
+ kind: z.ZodLiteral<"fabric-event">;
5036
+ id: z.ZodString;
5037
+ ts: z.ZodNumber;
5038
+ schema_version: z.ZodLiteral<1>;
5039
+ correlation_id: z.ZodOptional<z.ZodString>;
5040
+ session_id: z.ZodOptional<z.ZodString>;
5041
+ }, "strip", z.ZodTypeAny, {
5042
+ id: string;
5043
+ selection_token: string;
5044
+ ai_selected_stable_ids: string[];
5045
+ ts: number;
5046
+ schema_version: 1;
5047
+ kind: "fabric-event";
5048
+ event_type: "knowledge_sections_fetched";
5049
+ final_stable_ids: string[];
5050
+ requested_sections: string[];
5051
+ correlation_id?: string | undefined;
5052
+ session_id?: string | undefined;
5053
+ target_paths?: string[] | undefined;
5054
+ diagnostics?: unknown[] | undefined;
5055
+ }, {
5056
+ id: string;
5057
+ selection_token: string;
5058
+ ai_selected_stable_ids: string[];
5059
+ ts: number;
5060
+ schema_version: 1;
5061
+ kind: "fabric-event";
5062
+ event_type: "knowledge_sections_fetched";
5063
+ final_stable_ids: string[];
5064
+ requested_sections: string[];
5065
+ correlation_id?: string | undefined;
5066
+ session_id?: string | undefined;
5067
+ target_paths?: string[] | undefined;
5068
+ diagnostics?: unknown[] | undefined;
5069
+ }>;
5070
+ declare const editIntentCheckedEventSchema: z.ZodObject<{
5071
+ event_type: z.ZodLiteral<"edit_intent_checked">;
5072
+ path: z.ZodString;
5073
+ compliant: z.ZodBoolean;
5074
+ intent: z.ZodString;
5075
+ ledger_entry_id: z.ZodString;
5076
+ ledger_source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
5077
+ commit_sha: z.ZodOptional<z.ZodString>;
5078
+ parent_sha: z.ZodOptional<z.ZodString>;
5079
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
5080
+ diff_stat: z.ZodOptional<z.ZodString>;
5081
+ annotation: z.ZodOptional<z.ZodString>;
5082
+ matched_rule_context_ts: z.ZodNullable<z.ZodNumber>;
5083
+ window_ms: z.ZodNumber;
5084
+ kind: z.ZodLiteral<"fabric-event">;
5085
+ id: z.ZodString;
5086
+ ts: z.ZodNumber;
5087
+ schema_version: z.ZodLiteral<1>;
5088
+ correlation_id: z.ZodOptional<z.ZodString>;
5089
+ session_id: z.ZodOptional<z.ZodString>;
5090
+ }, "strip", z.ZodTypeAny, {
5091
+ path: string;
5092
+ id: string;
5093
+ intent: string;
5094
+ ts: number;
5095
+ ledger_entry_id: string;
5096
+ schema_version: 1;
5097
+ kind: "fabric-event";
5098
+ event_type: "edit_intent_checked";
5099
+ compliant: boolean;
5100
+ matched_rule_context_ts: number | null;
5101
+ window_ms: number;
5102
+ correlation_id?: string | undefined;
5103
+ session_id?: string | undefined;
5104
+ annotation?: string | undefined;
5105
+ commit_sha?: string | undefined;
5106
+ parent_sha?: string | undefined;
5107
+ parent_ledger_entry_id?: string | undefined;
5108
+ diff_stat?: string | undefined;
5109
+ ledger_source?: "ai" | "human" | undefined;
5110
+ }, {
5111
+ path: string;
5112
+ id: string;
5113
+ intent: string;
5114
+ ts: number;
5115
+ ledger_entry_id: string;
5116
+ schema_version: 1;
5117
+ kind: "fabric-event";
5118
+ event_type: "edit_intent_checked";
5119
+ compliant: boolean;
5120
+ matched_rule_context_ts: number | null;
5121
+ window_ms: number;
5122
+ correlation_id?: string | undefined;
5123
+ session_id?: string | undefined;
5124
+ annotation?: string | undefined;
5125
+ commit_sha?: string | undefined;
5126
+ parent_sha?: string | undefined;
5127
+ parent_ledger_entry_id?: string | undefined;
5128
+ diff_stat?: string | undefined;
5129
+ ledger_source?: "ai" | "human" | undefined;
5130
+ }>;
5131
+ declare const knowledgeDriftDetectedEventSchema: z.ZodObject<{
5132
+ event_type: z.ZodLiteral<"knowledge_drift_detected">;
5133
+ revision: z.ZodOptional<z.ZodString>;
5134
+ drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
5135
+ missing_files: z.ZodArray<z.ZodString, "many">;
5136
+ stale_files: z.ZodArray<z.ZodString, "many">;
5137
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
5138
+ file: z.ZodString;
5139
+ stable_id: z.ZodString;
5140
+ expected_hash: z.ZodString;
5141
+ actual_hash: z.ZodNullable<z.ZodString>;
5142
+ }, "strip", z.ZodTypeAny, {
5143
+ file: string;
5144
+ stable_id: string;
5145
+ expected_hash: string;
5146
+ actual_hash: string | null;
5147
+ }, {
5148
+ file: string;
5149
+ stable_id: string;
5150
+ expected_hash: string;
5151
+ actual_hash: string | null;
5152
+ }>, "many">>;
5153
+ kind: z.ZodLiteral<"fabric-event">;
5154
+ id: z.ZodString;
5155
+ ts: z.ZodNumber;
5156
+ schema_version: z.ZodLiteral<1>;
5157
+ correlation_id: z.ZodOptional<z.ZodString>;
5158
+ session_id: z.ZodOptional<z.ZodString>;
5159
+ }, "strip", z.ZodTypeAny, {
5160
+ id: string;
5161
+ ts: number;
5162
+ schema_version: 1;
5163
+ kind: "fabric-event";
5164
+ event_type: "knowledge_drift_detected";
5165
+ drifted_stable_ids: string[];
5166
+ missing_files: string[];
5167
+ stale_files: string[];
5168
+ correlation_id?: string | undefined;
5169
+ session_id?: string | undefined;
5170
+ revision?: string | undefined;
5171
+ details?: {
5172
+ file: string;
5173
+ stable_id: string;
5174
+ expected_hash: string;
5175
+ actual_hash: string | null;
5176
+ }[] | undefined;
5177
+ }, {
5178
+ id: string;
5179
+ ts: number;
5180
+ schema_version: 1;
5181
+ kind: "fabric-event";
5182
+ event_type: "knowledge_drift_detected";
5183
+ drifted_stable_ids: string[];
5184
+ missing_files: string[];
5185
+ stale_files: string[];
5186
+ correlation_id?: string | undefined;
5187
+ session_id?: string | undefined;
5188
+ revision?: string | undefined;
5189
+ details?: {
5190
+ file: string;
5191
+ stable_id: string;
5192
+ expected_hash: string;
5193
+ actual_hash: string | null;
5194
+ }[] | undefined;
5195
+ }>;
5196
+ declare const mcpEventLedgerEventSchema: z.ZodObject<{
5197
+ event_type: z.ZodLiteral<"mcp_event">;
5198
+ mcp_event_id: z.ZodString;
5199
+ stream_id: z.ZodString;
5200
+ message: z.ZodUnknown;
5201
+ kind: z.ZodLiteral<"fabric-event">;
5202
+ id: z.ZodString;
5203
+ ts: z.ZodNumber;
5204
+ schema_version: z.ZodLiteral<1>;
5205
+ correlation_id: z.ZodOptional<z.ZodString>;
5206
+ session_id: z.ZodOptional<z.ZodString>;
5207
+ }, "strip", z.ZodTypeAny, {
5208
+ id: string;
5209
+ ts: number;
5210
+ schema_version: 1;
5211
+ kind: "fabric-event";
5212
+ event_type: "mcp_event";
5213
+ mcp_event_id: string;
5214
+ stream_id: string;
5215
+ message?: unknown;
5216
+ correlation_id?: string | undefined;
5217
+ session_id?: string | undefined;
5218
+ }, {
5219
+ id: string;
5220
+ ts: number;
5221
+ schema_version: 1;
5222
+ kind: "fabric-event";
5223
+ event_type: "mcp_event";
5224
+ mcp_event_id: string;
5225
+ stream_id: string;
5226
+ message?: unknown;
5227
+ correlation_id?: string | undefined;
5228
+ session_id?: string | undefined;
5229
+ }>;
5230
+ declare const reapplyCompletedEventSchema: z.ZodObject<{
5231
+ event_type: z.ZodLiteral<"reapply_completed">;
5232
+ preserved_ledger: z.ZodBoolean;
5233
+ preserved_meta: z.ZodBoolean;
5234
+ rules_count: z.ZodNumber;
5235
+ kind: z.ZodLiteral<"fabric-event">;
5236
+ id: z.ZodString;
5237
+ ts: z.ZodNumber;
5238
+ schema_version: z.ZodLiteral<1>;
5239
+ correlation_id: z.ZodOptional<z.ZodString>;
5240
+ session_id: z.ZodOptional<z.ZodString>;
5241
+ }, "strip", z.ZodTypeAny, {
5242
+ id: string;
5243
+ ts: number;
5244
+ schema_version: 1;
5245
+ kind: "fabric-event";
5246
+ event_type: "reapply_completed";
5247
+ preserved_ledger: boolean;
5248
+ preserved_meta: boolean;
5249
+ rules_count: number;
5250
+ correlation_id?: string | undefined;
5251
+ session_id?: string | undefined;
5252
+ }, {
5253
+ id: string;
5254
+ ts: number;
5255
+ schema_version: 1;
5256
+ kind: "fabric-event";
5257
+ event_type: "reapply_completed";
5258
+ preserved_ledger: boolean;
5259
+ preserved_meta: boolean;
5260
+ rules_count: number;
5261
+ correlation_id?: string | undefined;
5262
+ session_id?: string | undefined;
5263
+ }>;
5264
+ declare const eventLedgerTruncatedEventSchema: z.ZodObject<{
5265
+ event_type: z.ZodLiteral<"event_ledger_truncated">;
5266
+ byte_offset: z.ZodNumber;
5267
+ byte_length: z.ZodNumber;
5268
+ corrupted_path: z.ZodString;
5269
+ kind: z.ZodLiteral<"fabric-event">;
5270
+ id: z.ZodString;
5271
+ ts: z.ZodNumber;
5272
+ schema_version: z.ZodLiteral<1>;
5273
+ correlation_id: z.ZodOptional<z.ZodString>;
5274
+ session_id: z.ZodOptional<z.ZodString>;
5275
+ }, "strip", z.ZodTypeAny, {
5276
+ id: string;
5277
+ ts: number;
5278
+ schema_version: 1;
5279
+ kind: "fabric-event";
5280
+ event_type: "event_ledger_truncated";
5281
+ byte_offset: number;
5282
+ byte_length: number;
5283
+ corrupted_path: string;
5284
+ correlation_id?: string | undefined;
5285
+ session_id?: string | undefined;
5286
+ }, {
5287
+ id: string;
5288
+ ts: number;
5289
+ schema_version: 1;
5290
+ kind: "fabric-event";
5291
+ event_type: "event_ledger_truncated";
5292
+ byte_offset: number;
5293
+ byte_length: number;
5294
+ corrupted_path: string;
5295
+ correlation_id?: string | undefined;
5296
+ session_id?: string | undefined;
5297
+ }>;
5298
+ declare const mcpConfigMigratedEventSchema: z.ZodObject<{
5299
+ event_type: z.ZodLiteral<"mcp_config_migrated">;
5300
+ source: z.ZodLiteral<"doctor_fix">;
5301
+ removed_from: z.ZodString;
5302
+ kind: z.ZodLiteral<"fabric-event">;
5303
+ id: z.ZodString;
5304
+ ts: z.ZodNumber;
5305
+ schema_version: z.ZodLiteral<1>;
5306
+ correlation_id: z.ZodOptional<z.ZodString>;
5307
+ session_id: z.ZodOptional<z.ZodString>;
5308
+ }, "strip", z.ZodTypeAny, {
5309
+ id: string;
5310
+ source: "doctor_fix";
5311
+ ts: number;
5312
+ schema_version: 1;
5313
+ kind: "fabric-event";
5314
+ event_type: "mcp_config_migrated";
5315
+ removed_from: string;
5316
+ correlation_id?: string | undefined;
5317
+ session_id?: string | undefined;
5318
+ }, {
5319
+ id: string;
5320
+ source: "doctor_fix";
5321
+ ts: number;
5322
+ schema_version: 1;
5323
+ kind: "fabric-event";
5324
+ event_type: "mcp_config_migrated";
5325
+ removed_from: string;
5326
+ correlation_id?: string | undefined;
5327
+ session_id?: string | undefined;
5328
+ }>;
5329
+ declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
5330
+ event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
5331
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
5332
+ duration_ms: z.ZodNumber;
5333
+ source: z.ZodLiteral<"reconcileKnowledge">;
5334
+ kind: z.ZodLiteral<"fabric-event">;
5335
+ id: z.ZodString;
5336
+ ts: z.ZodNumber;
5337
+ schema_version: z.ZodLiteral<1>;
5338
+ correlation_id: z.ZodOptional<z.ZodString>;
5339
+ session_id: z.ZodOptional<z.ZodString>;
5340
+ }, "strip", z.ZodTypeAny, {
5341
+ id: string;
5342
+ source: "reconcileKnowledge";
5343
+ ts: number;
5344
+ schema_version: 1;
5345
+ kind: "fabric-event";
5346
+ event_type: "meta_reconciled_on_startup";
5347
+ reconciled_files: string[];
5348
+ duration_ms: number;
5349
+ correlation_id?: string | undefined;
5350
+ session_id?: string | undefined;
5351
+ }, {
5352
+ id: string;
5353
+ source: "reconcileKnowledge";
5354
+ ts: number;
5355
+ schema_version: 1;
5356
+ kind: "fabric-event";
5357
+ event_type: "meta_reconciled_on_startup";
5358
+ reconciled_files: string[];
5359
+ duration_ms: number;
5360
+ correlation_id?: string | undefined;
5361
+ session_id?: string | undefined;
5362
+ }>;
5363
+ declare const metaReconciledEventSchema: z.ZodObject<{
5364
+ event_type: z.ZodLiteral<"meta_reconciled">;
5365
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
5366
+ duration_ms: z.ZodNumber;
5367
+ trigger: z.ZodEnum<["doctor", "manual"]>;
5368
+ source: z.ZodLiteral<"reconcileKnowledge">;
5369
+ kind: z.ZodLiteral<"fabric-event">;
5370
+ id: z.ZodString;
5371
+ ts: z.ZodNumber;
5372
+ schema_version: z.ZodLiteral<1>;
5373
+ correlation_id: z.ZodOptional<z.ZodString>;
5374
+ session_id: z.ZodOptional<z.ZodString>;
5375
+ }, "strip", z.ZodTypeAny, {
5376
+ id: string;
5377
+ source: "reconcileKnowledge";
5378
+ ts: number;
5379
+ schema_version: 1;
5380
+ kind: "fabric-event";
5381
+ event_type: "meta_reconciled";
5382
+ reconciled_files: string[];
5383
+ duration_ms: number;
5384
+ trigger: "manual" | "doctor";
5385
+ correlation_id?: string | undefined;
5386
+ session_id?: string | undefined;
5387
+ }, {
5388
+ id: string;
5389
+ source: "reconcileKnowledge";
5390
+ ts: number;
5391
+ schema_version: 1;
5392
+ kind: "fabric-event";
5393
+ event_type: "meta_reconciled";
5394
+ reconciled_files: string[];
5395
+ duration_ms: number;
5396
+ trigger: "manual" | "doctor";
5397
+ correlation_id?: string | undefined;
5398
+ session_id?: string | undefined;
5399
+ }>;
5400
+ declare const claudeSkillPathMigratedEventSchema: z.ZodObject<{
5401
+ event_type: z.ZodLiteral<"claude_skill_path_migrated">;
5402
+ from: z.ZodString;
5403
+ to: z.ZodString;
5404
+ kind: z.ZodLiteral<"fabric-event">;
5405
+ id: z.ZodString;
5406
+ ts: z.ZodNumber;
5407
+ schema_version: z.ZodLiteral<1>;
5408
+ correlation_id: z.ZodOptional<z.ZodString>;
5409
+ session_id: z.ZodOptional<z.ZodString>;
5410
+ }, "strip", z.ZodTypeAny, {
5411
+ id: string;
5412
+ ts: number;
5413
+ schema_version: 1;
5414
+ kind: "fabric-event";
5415
+ event_type: "claude_skill_path_migrated";
5416
+ from: string;
5417
+ to: string;
5418
+ correlation_id?: string | undefined;
5419
+ session_id?: string | undefined;
5420
+ }, {
5421
+ id: string;
5422
+ ts: number;
5423
+ schema_version: 1;
5424
+ kind: "fabric-event";
5425
+ event_type: "claude_skill_path_migrated";
5426
+ from: string;
5427
+ to: string;
5428
+ correlation_id?: string | undefined;
5429
+ session_id?: string | undefined;
5430
+ }>;
5431
+ declare const claudeHookPathMigratedEventSchema: z.ZodObject<{
5432
+ event_type: z.ZodLiteral<"claude_hook_path_migrated">;
5433
+ from: z.ZodString;
5434
+ to: z.ZodString;
5435
+ kind: z.ZodLiteral<"fabric-event">;
5436
+ id: z.ZodString;
5437
+ ts: z.ZodNumber;
5438
+ schema_version: z.ZodLiteral<1>;
5439
+ correlation_id: z.ZodOptional<z.ZodString>;
5440
+ session_id: z.ZodOptional<z.ZodString>;
5441
+ }, "strip", z.ZodTypeAny, {
5442
+ id: string;
5443
+ ts: number;
5444
+ schema_version: 1;
5445
+ kind: "fabric-event";
5446
+ event_type: "claude_hook_path_migrated";
5447
+ from: string;
5448
+ to: string;
5449
+ correlation_id?: string | undefined;
5450
+ session_id?: string | undefined;
5451
+ }, {
5452
+ id: string;
5453
+ ts: number;
5454
+ schema_version: 1;
5455
+ kind: "fabric-event";
5456
+ event_type: "claude_hook_path_migrated";
5457
+ from: string;
5458
+ to: string;
5459
+ correlation_id?: string | undefined;
5460
+ session_id?: string | undefined;
5461
+ }>;
5462
+ declare const codexSkillPathMigratedEventSchema: z.ZodObject<{
5463
+ event_type: z.ZodLiteral<"codex_skill_path_migrated">;
5464
+ from: z.ZodString;
5465
+ to: z.ZodString;
5466
+ kind: z.ZodLiteral<"fabric-event">;
5467
+ id: z.ZodString;
5468
+ ts: z.ZodNumber;
5469
+ schema_version: z.ZodLiteral<1>;
5470
+ correlation_id: z.ZodOptional<z.ZodString>;
5471
+ session_id: z.ZodOptional<z.ZodString>;
5472
+ }, "strip", z.ZodTypeAny, {
5473
+ id: string;
5474
+ ts: number;
5475
+ schema_version: 1;
5476
+ kind: "fabric-event";
5477
+ event_type: "codex_skill_path_migrated";
5478
+ from: string;
5479
+ to: string;
5480
+ correlation_id?: string | undefined;
5481
+ session_id?: string | undefined;
5482
+ }, {
5483
+ id: string;
5484
+ ts: number;
5485
+ schema_version: 1;
5486
+ kind: "fabric-event";
5487
+ event_type: "codex_skill_path_migrated";
5488
+ from: string;
5489
+ to: string;
5490
+ correlation_id?: string | undefined;
5491
+ session_id?: string | undefined;
5492
+ }>;
5493
+ declare const initScanCompletedEventSchema: z.ZodObject<{
5494
+ event_type: z.ZodLiteral<"init_scan_completed">;
5495
+ written_stable_ids: z.ZodArray<z.ZodString, "many">;
5496
+ duration_ms: z.ZodNumber;
5497
+ source: z.ZodOptional<z.ZodEnum<["init", "scan", "doctor_fix"]>>;
5498
+ kind: z.ZodLiteral<"fabric-event">;
5499
+ id: z.ZodString;
5500
+ ts: z.ZodNumber;
5501
+ schema_version: z.ZodLiteral<1>;
5502
+ correlation_id: z.ZodOptional<z.ZodString>;
5503
+ session_id: z.ZodOptional<z.ZodString>;
5504
+ }, "strip", z.ZodTypeAny, {
5505
+ id: string;
5506
+ ts: number;
5507
+ schema_version: 1;
5508
+ kind: "fabric-event";
5509
+ event_type: "init_scan_completed";
5510
+ duration_ms: number;
5511
+ written_stable_ids: string[];
5512
+ correlation_id?: string | undefined;
5513
+ session_id?: string | undefined;
5514
+ source?: "doctor_fix" | "init" | "scan" | undefined;
5515
+ }, {
5516
+ id: string;
5517
+ ts: number;
5518
+ schema_version: 1;
5519
+ kind: "fabric-event";
5520
+ event_type: "init_scan_completed";
5521
+ duration_ms: number;
5522
+ written_stable_ids: string[];
5523
+ correlation_id?: string | undefined;
5524
+ session_id?: string | undefined;
5525
+ source?: "doctor_fix" | "init" | "scan" | undefined;
5526
+ }>;
5527
+ declare const knowledgeProposedEventSchema: z.ZodObject<{
5528
+ event_type: z.ZodLiteral<"knowledge_proposed">;
5529
+ stable_id: z.ZodOptional<z.ZodString>;
5530
+ timestamp: z.ZodString;
5531
+ reason: z.ZodOptional<z.ZodString>;
5532
+ kind: z.ZodLiteral<"fabric-event">;
5533
+ id: z.ZodString;
5534
+ ts: z.ZodNumber;
5535
+ schema_version: z.ZodLiteral<1>;
5536
+ correlation_id: z.ZodOptional<z.ZodString>;
5537
+ session_id: z.ZodOptional<z.ZodString>;
5538
+ }, "strip", z.ZodTypeAny, {
5539
+ id: string;
5540
+ ts: number;
5541
+ schema_version: 1;
5542
+ kind: "fabric-event";
5543
+ event_type: "knowledge_proposed";
5544
+ timestamp: string;
5545
+ stable_id?: string | undefined;
5546
+ correlation_id?: string | undefined;
5547
+ session_id?: string | undefined;
5548
+ reason?: string | undefined;
5549
+ }, {
5550
+ id: string;
5551
+ ts: number;
5552
+ schema_version: 1;
5553
+ kind: "fabric-event";
5554
+ event_type: "knowledge_proposed";
5555
+ timestamp: string;
5556
+ stable_id?: string | undefined;
5557
+ correlation_id?: string | undefined;
5558
+ session_id?: string | undefined;
5559
+ reason?: string | undefined;
5560
+ }>;
5561
+ declare const knowledgePromoteStartedEventSchema: z.ZodObject<{
5562
+ event_type: z.ZodLiteral<"knowledge_promote_started">;
5563
+ stable_id: z.ZodOptional<z.ZodString>;
5564
+ timestamp: z.ZodString;
5565
+ reason: z.ZodOptional<z.ZodString>;
5566
+ kind: z.ZodLiteral<"fabric-event">;
5567
+ id: z.ZodString;
5568
+ ts: z.ZodNumber;
5569
+ schema_version: z.ZodLiteral<1>;
5570
+ correlation_id: z.ZodOptional<z.ZodString>;
5571
+ session_id: z.ZodOptional<z.ZodString>;
5572
+ }, "strip", z.ZodTypeAny, {
5573
+ id: string;
5574
+ ts: number;
5575
+ schema_version: 1;
5576
+ kind: "fabric-event";
5577
+ event_type: "knowledge_promote_started";
5578
+ timestamp: string;
5579
+ stable_id?: string | undefined;
5580
+ correlation_id?: string | undefined;
5581
+ session_id?: string | undefined;
5582
+ reason?: string | undefined;
5583
+ }, {
5584
+ id: string;
5585
+ ts: number;
5586
+ schema_version: 1;
5587
+ kind: "fabric-event";
5588
+ event_type: "knowledge_promote_started";
5589
+ timestamp: string;
5590
+ stable_id?: string | undefined;
5591
+ correlation_id?: string | undefined;
5592
+ session_id?: string | undefined;
5593
+ reason?: string | undefined;
5594
+ }>;
5595
+ declare const knowledgePromotedEventSchema: z.ZodObject<{
5596
+ event_type: z.ZodLiteral<"knowledge_promoted">;
5597
+ stable_id: z.ZodOptional<z.ZodString>;
5598
+ timestamp: z.ZodString;
5599
+ reason: z.ZodOptional<z.ZodString>;
5600
+ kind: z.ZodLiteral<"fabric-event">;
5601
+ id: z.ZodString;
5602
+ ts: z.ZodNumber;
5603
+ schema_version: z.ZodLiteral<1>;
5604
+ correlation_id: z.ZodOptional<z.ZodString>;
5605
+ session_id: z.ZodOptional<z.ZodString>;
5606
+ }, "strip", z.ZodTypeAny, {
5607
+ id: string;
5608
+ ts: number;
5609
+ schema_version: 1;
5610
+ kind: "fabric-event";
5611
+ event_type: "knowledge_promoted";
5612
+ timestamp: string;
5613
+ stable_id?: string | undefined;
5614
+ correlation_id?: string | undefined;
5615
+ session_id?: string | undefined;
5616
+ reason?: string | undefined;
5617
+ }, {
5618
+ id: string;
5619
+ ts: number;
5620
+ schema_version: 1;
5621
+ kind: "fabric-event";
5622
+ event_type: "knowledge_promoted";
5623
+ timestamp: string;
5624
+ stable_id?: string | undefined;
5625
+ correlation_id?: string | undefined;
5626
+ session_id?: string | undefined;
5627
+ reason?: string | undefined;
5628
+ }>;
5629
+ declare const knowledgePromoteFailedEventSchema: z.ZodObject<{
5630
+ event_type: z.ZodLiteral<"knowledge_promote_failed">;
5631
+ stable_id: z.ZodOptional<z.ZodString>;
5632
+ timestamp: z.ZodString;
5633
+ reason: z.ZodString;
5634
+ kind: z.ZodLiteral<"fabric-event">;
5635
+ id: z.ZodString;
5636
+ ts: z.ZodNumber;
5637
+ schema_version: z.ZodLiteral<1>;
5638
+ correlation_id: z.ZodOptional<z.ZodString>;
5639
+ session_id: z.ZodOptional<z.ZodString>;
5640
+ }, "strip", z.ZodTypeAny, {
5641
+ id: string;
5642
+ reason: string;
5643
+ ts: number;
5644
+ schema_version: 1;
5645
+ kind: "fabric-event";
5646
+ event_type: "knowledge_promote_failed";
5647
+ timestamp: string;
5648
+ stable_id?: string | undefined;
5649
+ correlation_id?: string | undefined;
5650
+ session_id?: string | undefined;
5651
+ }, {
5652
+ id: string;
5653
+ reason: string;
5654
+ ts: number;
5655
+ schema_version: 1;
5656
+ kind: "fabric-event";
5657
+ event_type: "knowledge_promote_failed";
5658
+ timestamp: string;
5659
+ stable_id?: string | undefined;
5660
+ correlation_id?: string | undefined;
5661
+ session_id?: string | undefined;
5662
+ }>;
5663
+ declare const knowledgeLayerChangedEventSchema: z.ZodObject<{
5664
+ event_type: z.ZodLiteral<"knowledge_layer_changed">;
5665
+ stable_id: z.ZodOptional<z.ZodString>;
5666
+ timestamp: z.ZodString;
5667
+ reason: z.ZodOptional<z.ZodString>;
5668
+ from_layer: z.ZodEnum<["team", "personal"]>;
5669
+ to_layer: z.ZodEnum<["team", "personal"]>;
5670
+ kind: z.ZodLiteral<"fabric-event">;
5671
+ id: z.ZodString;
5672
+ ts: z.ZodNumber;
5673
+ schema_version: z.ZodLiteral<1>;
5674
+ correlation_id: z.ZodOptional<z.ZodString>;
5675
+ session_id: z.ZodOptional<z.ZodString>;
5676
+ }, "strip", z.ZodTypeAny, {
5677
+ id: string;
5678
+ ts: number;
5679
+ schema_version: 1;
5680
+ kind: "fabric-event";
5681
+ event_type: "knowledge_layer_changed";
5682
+ timestamp: string;
5683
+ from_layer: "personal" | "team";
5684
+ to_layer: "personal" | "team";
5685
+ stable_id?: string | undefined;
5686
+ correlation_id?: string | undefined;
5687
+ session_id?: string | undefined;
5688
+ reason?: string | undefined;
5689
+ }, {
5690
+ id: string;
5691
+ ts: number;
5692
+ schema_version: 1;
5693
+ kind: "fabric-event";
5694
+ event_type: "knowledge_layer_changed";
5695
+ timestamp: string;
5696
+ from_layer: "personal" | "team";
5697
+ to_layer: "personal" | "team";
5698
+ stable_id?: string | undefined;
5699
+ correlation_id?: string | undefined;
5700
+ session_id?: string | undefined;
5701
+ reason?: string | undefined;
5702
+ }>;
5703
+ declare const knowledgeSlugRenamedEventSchema: z.ZodObject<{
5704
+ event_type: z.ZodLiteral<"knowledge_slug_renamed">;
5705
+ stable_id: z.ZodOptional<z.ZodString>;
5706
+ timestamp: z.ZodString;
5707
+ reason: z.ZodOptional<z.ZodString>;
5708
+ from_slug: z.ZodString;
5709
+ to_slug: z.ZodString;
5710
+ kind: z.ZodLiteral<"fabric-event">;
5711
+ id: z.ZodString;
5712
+ ts: z.ZodNumber;
5713
+ schema_version: z.ZodLiteral<1>;
5714
+ correlation_id: z.ZodOptional<z.ZodString>;
5715
+ session_id: z.ZodOptional<z.ZodString>;
5716
+ }, "strip", z.ZodTypeAny, {
5717
+ id: string;
5718
+ ts: number;
5719
+ schema_version: 1;
5720
+ kind: "fabric-event";
5721
+ event_type: "knowledge_slug_renamed";
5722
+ timestamp: string;
5723
+ from_slug: string;
5724
+ to_slug: string;
5725
+ stable_id?: string | undefined;
5726
+ correlation_id?: string | undefined;
5727
+ session_id?: string | undefined;
5728
+ reason?: string | undefined;
5729
+ }, {
5730
+ id: string;
5731
+ ts: number;
5732
+ schema_version: 1;
5733
+ kind: "fabric-event";
5734
+ event_type: "knowledge_slug_renamed";
5735
+ timestamp: string;
5736
+ from_slug: string;
5737
+ to_slug: string;
5738
+ stable_id?: string | undefined;
5739
+ correlation_id?: string | undefined;
5740
+ session_id?: string | undefined;
5741
+ reason?: string | undefined;
5742
+ }>;
5743
+ declare const knowledgeDemotedEventSchema: z.ZodObject<{
5744
+ event_type: z.ZodLiteral<"knowledge_demoted">;
5745
+ stable_id: z.ZodOptional<z.ZodString>;
5746
+ timestamp: z.ZodString;
5747
+ reason: z.ZodOptional<z.ZodString>;
5748
+ kind: z.ZodLiteral<"fabric-event">;
5749
+ id: z.ZodString;
5750
+ ts: z.ZodNumber;
5751
+ schema_version: z.ZodLiteral<1>;
5752
+ correlation_id: z.ZodOptional<z.ZodString>;
5753
+ session_id: z.ZodOptional<z.ZodString>;
5754
+ }, "strip", z.ZodTypeAny, {
5755
+ id: string;
5756
+ ts: number;
5757
+ schema_version: 1;
5758
+ kind: "fabric-event";
5759
+ event_type: "knowledge_demoted";
5760
+ timestamp: string;
5761
+ stable_id?: string | undefined;
5762
+ correlation_id?: string | undefined;
5763
+ session_id?: string | undefined;
5764
+ reason?: string | undefined;
5765
+ }, {
5766
+ id: string;
5767
+ ts: number;
5768
+ schema_version: 1;
5769
+ kind: "fabric-event";
5770
+ event_type: "knowledge_demoted";
5771
+ timestamp: string;
5772
+ stable_id?: string | undefined;
5773
+ correlation_id?: string | undefined;
5774
+ session_id?: string | undefined;
5775
+ reason?: string | undefined;
5776
+ }>;
5777
+ declare const knowledgeArchivedEventSchema: z.ZodObject<{
5778
+ event_type: z.ZodLiteral<"knowledge_archived">;
5779
+ stable_id: z.ZodOptional<z.ZodString>;
5780
+ timestamp: z.ZodString;
5781
+ reason: z.ZodOptional<z.ZodString>;
5782
+ kind: z.ZodLiteral<"fabric-event">;
5783
+ id: z.ZodString;
5784
+ ts: z.ZodNumber;
5785
+ schema_version: z.ZodLiteral<1>;
5786
+ correlation_id: z.ZodOptional<z.ZodString>;
5787
+ session_id: z.ZodOptional<z.ZodString>;
5788
+ }, "strip", z.ZodTypeAny, {
5789
+ id: string;
5790
+ ts: number;
5791
+ schema_version: 1;
5792
+ kind: "fabric-event";
5793
+ event_type: "knowledge_archived";
5794
+ timestamp: string;
5795
+ stable_id?: string | undefined;
5796
+ correlation_id?: string | undefined;
5797
+ session_id?: string | undefined;
5798
+ reason?: string | undefined;
5799
+ }, {
5800
+ id: string;
5801
+ ts: number;
5802
+ schema_version: 1;
5803
+ kind: "fabric-event";
5804
+ event_type: "knowledge_archived";
5805
+ timestamp: string;
5806
+ stable_id?: string | undefined;
5807
+ correlation_id?: string | undefined;
5808
+ session_id?: string | undefined;
5809
+ reason?: string | undefined;
5810
+ }>;
5811
+ declare const knowledgeArchiveAttemptedEventSchema: z.ZodObject<{
5812
+ event_type: z.ZodLiteral<"knowledge_archive_attempted">;
5813
+ stable_id: z.ZodOptional<z.ZodString>;
5814
+ timestamp: z.ZodString;
5815
+ reason: z.ZodOptional<z.ZodString>;
5816
+ kind: z.ZodLiteral<"fabric-event">;
5817
+ id: z.ZodString;
5818
+ ts: z.ZodNumber;
5819
+ schema_version: z.ZodLiteral<1>;
5820
+ correlation_id: z.ZodOptional<z.ZodString>;
5821
+ session_id: z.ZodOptional<z.ZodString>;
5822
+ }, "strip", z.ZodTypeAny, {
5823
+ id: string;
5824
+ ts: number;
5825
+ schema_version: 1;
5826
+ kind: "fabric-event";
5827
+ event_type: "knowledge_archive_attempted";
5828
+ timestamp: string;
5829
+ stable_id?: string | undefined;
5830
+ correlation_id?: string | undefined;
5831
+ session_id?: string | undefined;
5832
+ reason?: string | undefined;
5833
+ }, {
5834
+ id: string;
5835
+ ts: number;
5836
+ schema_version: 1;
5837
+ kind: "fabric-event";
5838
+ event_type: "knowledge_archive_attempted";
5839
+ timestamp: string;
5840
+ stable_id?: string | undefined;
5841
+ correlation_id?: string | undefined;
5842
+ session_id?: string | undefined;
5843
+ reason?: string | undefined;
5844
+ }>;
5845
+ declare const knowledgeDeferredEventSchema: z.ZodObject<{
5846
+ event_type: z.ZodLiteral<"knowledge_deferred">;
5847
+ stable_id: z.ZodOptional<z.ZodString>;
5848
+ timestamp: z.ZodString;
5849
+ reason: z.ZodOptional<z.ZodString>;
5850
+ until: z.ZodOptional<z.ZodString>;
5851
+ kind: z.ZodLiteral<"fabric-event">;
5852
+ id: z.ZodString;
5853
+ ts: z.ZodNumber;
5854
+ schema_version: z.ZodLiteral<1>;
5855
+ correlation_id: z.ZodOptional<z.ZodString>;
5856
+ session_id: z.ZodOptional<z.ZodString>;
5857
+ }, "strip", z.ZodTypeAny, {
5858
+ id: string;
5859
+ ts: number;
5860
+ schema_version: 1;
5861
+ kind: "fabric-event";
5862
+ event_type: "knowledge_deferred";
5863
+ timestamp: string;
5864
+ stable_id?: string | undefined;
5865
+ correlation_id?: string | undefined;
5866
+ session_id?: string | undefined;
5867
+ reason?: string | undefined;
5868
+ until?: string | undefined;
5869
+ }, {
5870
+ id: string;
5871
+ ts: number;
5872
+ schema_version: 1;
5873
+ kind: "fabric-event";
5874
+ event_type: "knowledge_deferred";
5875
+ timestamp: string;
5876
+ stable_id?: string | undefined;
5877
+ correlation_id?: string | undefined;
5878
+ session_id?: string | undefined;
5879
+ reason?: string | undefined;
5880
+ until?: string | undefined;
5881
+ }>;
5882
+ declare const knowledgeRejectedEventSchema: z.ZodObject<{
5883
+ event_type: z.ZodLiteral<"knowledge_rejected">;
5884
+ stable_id: z.ZodOptional<z.ZodString>;
5885
+ timestamp: z.ZodString;
5886
+ reason: z.ZodString;
5887
+ kind: z.ZodLiteral<"fabric-event">;
5888
+ id: z.ZodString;
5889
+ ts: z.ZodNumber;
5890
+ schema_version: z.ZodLiteral<1>;
5891
+ correlation_id: z.ZodOptional<z.ZodString>;
5892
+ session_id: z.ZodOptional<z.ZodString>;
5893
+ }, "strip", z.ZodTypeAny, {
5894
+ id: string;
5895
+ reason: string;
5896
+ ts: number;
5897
+ schema_version: 1;
5898
+ kind: "fabric-event";
5899
+ event_type: "knowledge_rejected";
5900
+ timestamp: string;
5901
+ stable_id?: string | undefined;
5902
+ correlation_id?: string | undefined;
5903
+ session_id?: string | undefined;
5904
+ }, {
5905
+ id: string;
5906
+ reason: string;
5907
+ ts: number;
5908
+ schema_version: 1;
5909
+ kind: "fabric-event";
5910
+ event_type: "knowledge_rejected";
5911
+ timestamp: string;
5912
+ stable_id?: string | undefined;
5913
+ correlation_id?: string | undefined;
5914
+ session_id?: string | undefined;
5915
+ }>;
5916
+ declare const knowledgeConsumedEventSchema: z.ZodObject<{
5917
+ event_type: z.ZodLiteral<"knowledge_consumed">;
5918
+ stable_id: z.ZodString;
5919
+ consumed_at: z.ZodString;
5920
+ client_hash: z.ZodString;
5921
+ kind: z.ZodLiteral<"fabric-event">;
5922
+ id: z.ZodString;
5923
+ ts: z.ZodNumber;
5924
+ schema_version: z.ZodLiteral<1>;
5925
+ correlation_id: z.ZodOptional<z.ZodString>;
5926
+ session_id: z.ZodOptional<z.ZodString>;
5927
+ }, "strip", z.ZodTypeAny, {
5928
+ id: string;
5929
+ stable_id: string;
5930
+ client_hash: string;
5931
+ ts: number;
5932
+ schema_version: 1;
5933
+ kind: "fabric-event";
5934
+ event_type: "knowledge_consumed";
5935
+ consumed_at: string;
5936
+ correlation_id?: string | undefined;
5937
+ session_id?: string | undefined;
5938
+ }, {
5939
+ id: string;
5940
+ stable_id: string;
5941
+ client_hash: string;
5942
+ ts: number;
5943
+ schema_version: 1;
5944
+ kind: "fabric-event";
5945
+ event_type: "knowledge_consumed";
5946
+ consumed_at: string;
5947
+ correlation_id?: string | undefined;
5948
+ session_id?: string | undefined;
5949
+ }>;
5950
+ declare const knowledgeScopeDegradedEventSchema: z.ZodObject<{
5951
+ event_type: z.ZodLiteral<"knowledge_scope_degraded">;
5952
+ stable_id: z.ZodString;
5953
+ timestamp: z.ZodString;
5954
+ from_scope: z.ZodEnum<["narrow", "broad"]>;
5955
+ to_scope: z.ZodEnum<["narrow", "broad"]>;
5956
+ reason: z.ZodString;
5957
+ kind: z.ZodLiteral<"fabric-event">;
5958
+ id: z.ZodString;
5959
+ ts: z.ZodNumber;
5960
+ schema_version: z.ZodLiteral<1>;
5961
+ correlation_id: z.ZodOptional<z.ZodString>;
5962
+ session_id: z.ZodOptional<z.ZodString>;
5963
+ }, "strip", z.ZodTypeAny, {
5964
+ id: string;
5965
+ stable_id: string;
5966
+ reason: string;
5967
+ ts: number;
5968
+ schema_version: 1;
5969
+ kind: "fabric-event";
5970
+ event_type: "knowledge_scope_degraded";
5971
+ timestamp: string;
5972
+ from_scope: "narrow" | "broad";
5973
+ to_scope: "narrow" | "broad";
5974
+ correlation_id?: string | undefined;
5975
+ session_id?: string | undefined;
5976
+ }, {
5977
+ id: string;
5978
+ stable_id: string;
5979
+ reason: string;
5980
+ ts: number;
5981
+ schema_version: 1;
5982
+ kind: "fabric-event";
5983
+ event_type: "knowledge_scope_degraded";
5984
+ timestamp: string;
5985
+ from_scope: "narrow" | "broad";
5986
+ to_scope: "narrow" | "broad";
5987
+ correlation_id?: string | undefined;
5988
+ session_id?: string | undefined;
5989
+ }>;
5990
+ declare const doctorRunEventSchema: z.ZodObject<{
5991
+ event_type: z.ZodLiteral<"doctor_run">;
5992
+ mode: z.ZodEnum<["lint", "apply-lint"]>;
5993
+ issues: z.ZodNumber;
5994
+ mutations: z.ZodOptional<z.ZodNumber>;
5995
+ timestamp: z.ZodString;
5996
+ kind: z.ZodLiteral<"fabric-event">;
5997
+ id: z.ZodString;
5998
+ ts: z.ZodNumber;
5999
+ schema_version: z.ZodLiteral<1>;
6000
+ correlation_id: z.ZodOptional<z.ZodString>;
6001
+ session_id: z.ZodOptional<z.ZodString>;
6002
+ }, "strip", z.ZodTypeAny, {
6003
+ issues: number;
6004
+ id: string;
6005
+ ts: number;
6006
+ schema_version: 1;
6007
+ kind: "fabric-event";
6008
+ event_type: "doctor_run";
6009
+ timestamp: string;
6010
+ mode: "lint" | "apply-lint";
6011
+ correlation_id?: string | undefined;
6012
+ session_id?: string | undefined;
6013
+ mutations?: number | undefined;
6014
+ }, {
6015
+ issues: number;
6016
+ id: string;
6017
+ ts: number;
6018
+ schema_version: 1;
6019
+ kind: "fabric-event";
6020
+ event_type: "doctor_run";
6021
+ timestamp: string;
6022
+ mode: "lint" | "apply-lint";
6023
+ correlation_id?: string | undefined;
6024
+ session_id?: string | undefined;
6025
+ mutations?: number | undefined;
6026
+ }>;
6027
+ declare const knowledgePathDangledEventSchema: z.ZodObject<{
6028
+ event_type: z.ZodLiteral<"knowledge_path_dangled">;
6029
+ stable_id: z.ZodString;
6030
+ removed_glob: z.ZodString;
6031
+ kind: z.ZodLiteral<"fabric-event">;
6032
+ id: z.ZodString;
6033
+ ts: z.ZodNumber;
6034
+ schema_version: z.ZodLiteral<1>;
6035
+ correlation_id: z.ZodOptional<z.ZodString>;
6036
+ session_id: z.ZodOptional<z.ZodString>;
6037
+ }, "strip", z.ZodTypeAny, {
6038
+ id: string;
6039
+ stable_id: string;
6040
+ ts: number;
6041
+ schema_version: 1;
6042
+ kind: "fabric-event";
6043
+ event_type: "knowledge_path_dangled";
6044
+ removed_glob: string;
6045
+ correlation_id?: string | undefined;
6046
+ session_id?: string | undefined;
6047
+ }, {
6048
+ id: string;
6049
+ stable_id: string;
6050
+ ts: number;
6051
+ schema_version: 1;
6052
+ kind: "fabric-event";
6053
+ event_type: "knowledge_path_dangled";
6054
+ removed_glob: string;
6055
+ correlation_id?: string | undefined;
6056
+ session_id?: string | undefined;
6057
+ }>;
6058
+ declare const pendingAutoArchivedEventSchema: z.ZodObject<{
6059
+ event_type: z.ZodLiteral<"pending_auto_archived">;
6060
+ pending_path: z.ZodString;
6061
+ archived_to: z.ZodString;
6062
+ reason: z.ZodString;
6063
+ kind: z.ZodLiteral<"fabric-event">;
6064
+ id: z.ZodString;
6065
+ ts: z.ZodNumber;
6066
+ schema_version: z.ZodLiteral<1>;
6067
+ correlation_id: z.ZodOptional<z.ZodString>;
6068
+ session_id: z.ZodOptional<z.ZodString>;
6069
+ }, "strip", z.ZodTypeAny, {
6070
+ id: string;
6071
+ pending_path: string;
6072
+ reason: string;
6073
+ ts: number;
6074
+ schema_version: 1;
6075
+ kind: "fabric-event";
6076
+ event_type: "pending_auto_archived";
6077
+ archived_to: string;
6078
+ correlation_id?: string | undefined;
6079
+ session_id?: string | undefined;
6080
+ }, {
6081
+ id: string;
6082
+ pending_path: string;
6083
+ reason: string;
6084
+ ts: number;
6085
+ schema_version: 1;
6086
+ kind: "fabric-event";
6087
+ event_type: "pending_auto_archived";
6088
+ archived_to: string;
6089
+ correlation_id?: string | undefined;
6090
+ session_id?: string | undefined;
6091
+ }>;
6092
+ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
4277
6093
  event_type: z.ZodLiteral<"knowledge_context_planned">;
4278
6094
  target_paths: z.ZodArray<z.ZodString, "many">;
4279
6095
  required_stable_ids: z.ZodArray<z.ZodString, "many">;
@@ -4292,13 +6108,13 @@ declare const knowledgeContextPlannedEventSchema: z.ZodObject<{
4292
6108
  session_id: z.ZodOptional<z.ZodString>;
4293
6109
  }, "strip", z.ZodTypeAny, {
4294
6110
  id: string;
4295
- required_stable_ids: string[];
4296
- ai_selectable_stable_ids: string[];
6111
+ target_paths: string[];
4297
6112
  ts: number;
4298
6113
  schema_version: 1;
4299
6114
  kind: "fabric-event";
4300
6115
  event_type: "knowledge_context_planned";
4301
- target_paths: string[];
6116
+ required_stable_ids: string[];
6117
+ ai_selectable_stable_ids: string[];
4302
6118
  final_stable_ids: string[];
4303
6119
  known_tech?: string[] | undefined;
4304
6120
  intent?: string | undefined;
@@ -4309,13 +6125,13 @@ declare const knowledgeContextPlannedEventSchema: z.ZodObject<{
4309
6125
  diagnostics?: unknown[] | undefined;
4310
6126
  }, {
4311
6127
  id: string;
4312
- required_stable_ids: string[];
4313
- ai_selectable_stable_ids: string[];
6128
+ target_paths: string[];
4314
6129
  ts: number;
4315
6130
  schema_version: 1;
4316
6131
  kind: "fabric-event";
4317
6132
  event_type: "knowledge_context_planned";
4318
- target_paths: string[];
6133
+ required_stable_ids: string[];
6134
+ ai_selectable_stable_ids: string[];
4319
6135
  final_stable_ids: string[];
4320
6136
  known_tech?: string[] | undefined;
4321
6137
  intent?: string | undefined;
@@ -4324,8 +6140,7 @@ declare const knowledgeContextPlannedEventSchema: z.ZodObject<{
4324
6140
  session_id?: string | undefined;
4325
6141
  selection_token?: string | undefined;
4326
6142
  diagnostics?: unknown[] | undefined;
4327
- }>;
4328
- declare const knowledgeSelectionEventSchema: z.ZodObject<{
6143
+ }>, z.ZodObject<{
4329
6144
  event_type: z.ZodLiteral<"knowledge_selection">;
4330
6145
  selection_token: z.ZodString;
4331
6146
  target_paths: z.ZodArray<z.ZodString, "many">;
@@ -4344,16 +6159,16 @@ declare const knowledgeSelectionEventSchema: z.ZodObject<{
4344
6159
  session_id: z.ZodOptional<z.ZodString>;
4345
6160
  }, "strip", z.ZodTypeAny, {
4346
6161
  id: string;
6162
+ target_paths: string[];
4347
6163
  selection_token: string;
4348
- required_stable_ids: string[];
4349
- ai_selectable_stable_ids: string[];
4350
6164
  ai_selected_stable_ids: string[];
4351
6165
  ai_selection_reasons: Record<string, string>;
4352
6166
  ts: number;
4353
6167
  schema_version: 1;
4354
6168
  kind: "fabric-event";
4355
6169
  event_type: "knowledge_selection";
4356
- target_paths: string[];
6170
+ required_stable_ids: string[];
6171
+ ai_selectable_stable_ids: string[];
4357
6172
  final_stable_ids: string[];
4358
6173
  rejected_stable_ids: string[];
4359
6174
  ignored_stable_ids: string[];
@@ -4361,23 +6176,22 @@ declare const knowledgeSelectionEventSchema: z.ZodObject<{
4361
6176
  session_id?: string | undefined;
4362
6177
  }, {
4363
6178
  id: string;
6179
+ target_paths: string[];
4364
6180
  selection_token: string;
4365
- required_stable_ids: string[];
4366
- ai_selectable_stable_ids: string[];
4367
6181
  ai_selected_stable_ids: string[];
4368
6182
  ai_selection_reasons: Record<string, string>;
4369
6183
  ts: number;
4370
6184
  schema_version: 1;
4371
6185
  kind: "fabric-event";
4372
6186
  event_type: "knowledge_selection";
4373
- target_paths: string[];
6187
+ required_stable_ids: string[];
6188
+ ai_selectable_stable_ids: string[];
4374
6189
  final_stable_ids: string[];
4375
6190
  rejected_stable_ids: string[];
4376
6191
  ignored_stable_ids: string[];
4377
6192
  correlation_id?: string | undefined;
4378
6193
  session_id?: string | undefined;
4379
- }>;
4380
- declare const knowledgeSectionsFetchedEventSchema: z.ZodObject<{
6194
+ }>, z.ZodObject<{
4381
6195
  event_type: z.ZodLiteral<"knowledge_sections_fetched">;
4382
6196
  selection_token: z.ZodString;
4383
6197
  target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -4403,8 +6217,8 @@ declare const knowledgeSectionsFetchedEventSchema: z.ZodObject<{
4403
6217
  requested_sections: string[];
4404
6218
  correlation_id?: string | undefined;
4405
6219
  session_id?: string | undefined;
4406
- diagnostics?: unknown[] | undefined;
4407
6220
  target_paths?: string[] | undefined;
6221
+ diagnostics?: unknown[] | undefined;
4408
6222
  }, {
4409
6223
  id: string;
4410
6224
  selection_token: string;
@@ -4417,10 +6231,9 @@ declare const knowledgeSectionsFetchedEventSchema: z.ZodObject<{
4417
6231
  requested_sections: string[];
4418
6232
  correlation_id?: string | undefined;
4419
6233
  session_id?: string | undefined;
4420
- diagnostics?: unknown[] | undefined;
4421
6234
  target_paths?: string[] | undefined;
4422
- }>;
4423
- declare const editIntentCheckedEventSchema: z.ZodObject<{
6235
+ diagnostics?: unknown[] | undefined;
6236
+ }>, z.ZodObject<{
4424
6237
  event_type: z.ZodLiteral<"edit_intent_checked">;
4425
6238
  path: z.ZodString;
4426
6239
  compliant: z.ZodBoolean;
@@ -4442,10 +6255,10 @@ declare const editIntentCheckedEventSchema: z.ZodObject<{
4442
6255
  session_id: z.ZodOptional<z.ZodString>;
4443
6256
  }, "strip", z.ZodTypeAny, {
4444
6257
  path: string;
4445
- ledger_entry_id: string;
4446
6258
  id: string;
4447
6259
  intent: string;
4448
6260
  ts: number;
6261
+ ledger_entry_id: string;
4449
6262
  schema_version: 1;
4450
6263
  kind: "fabric-event";
4451
6264
  event_type: "edit_intent_checked";
@@ -4462,10 +6275,10 @@ declare const editIntentCheckedEventSchema: z.ZodObject<{
4462
6275
  ledger_source?: "ai" | "human" | undefined;
4463
6276
  }, {
4464
6277
  path: string;
4465
- ledger_entry_id: string;
4466
6278
  id: string;
4467
6279
  intent: string;
4468
6280
  ts: number;
6281
+ ledger_entry_id: string;
4469
6282
  schema_version: 1;
4470
6283
  kind: "fabric-event";
4471
6284
  event_type: "edit_intent_checked";
@@ -4480,8 +6293,7 @@ declare const editIntentCheckedEventSchema: z.ZodObject<{
4480
6293
  parent_ledger_entry_id?: string | undefined;
4481
6294
  diff_stat?: string | undefined;
4482
6295
  ledger_source?: "ai" | "human" | undefined;
4483
- }>;
4484
- declare const knowledgeDriftDetectedEventSchema: z.ZodObject<{
6296
+ }>, z.ZodObject<{
4485
6297
  event_type: z.ZodLiteral<"knowledge_drift_detected">;
4486
6298
  revision: z.ZodOptional<z.ZodString>;
4487
6299
  drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
@@ -4545,8 +6357,7 @@ declare const knowledgeDriftDetectedEventSchema: z.ZodObject<{
4545
6357
  expected_hash: string;
4546
6358
  actual_hash: string | null;
4547
6359
  }[] | undefined;
4548
- }>;
4549
- declare const mcpEventLedgerEventSchema: z.ZodObject<{
6360
+ }>, z.ZodObject<{
4550
6361
  event_type: z.ZodLiteral<"mcp_event">;
4551
6362
  mcp_event_id: z.ZodString;
4552
6363
  stream_id: z.ZodString;
@@ -4579,8 +6390,7 @@ declare const mcpEventLedgerEventSchema: z.ZodObject<{
4579
6390
  message?: unknown;
4580
6391
  correlation_id?: string | undefined;
4581
6392
  session_id?: string | undefined;
4582
- }>;
4583
- declare const reapplyCompletedEventSchema: z.ZodObject<{
6393
+ }>, z.ZodObject<{
4584
6394
  event_type: z.ZodLiteral<"reapply_completed">;
4585
6395
  preserved_ledger: z.ZodBoolean;
4586
6396
  preserved_meta: z.ZodBoolean;
@@ -4613,8 +6423,7 @@ declare const reapplyCompletedEventSchema: z.ZodObject<{
4613
6423
  rules_count: number;
4614
6424
  correlation_id?: string | undefined;
4615
6425
  session_id?: string | undefined;
4616
- }>;
4617
- declare const eventLedgerTruncatedEventSchema: z.ZodObject<{
6426
+ }>, z.ZodObject<{
4618
6427
  event_type: z.ZodLiteral<"event_ledger_truncated">;
4619
6428
  byte_offset: z.ZodNumber;
4620
6429
  byte_length: z.ZodNumber;
@@ -4647,8 +6456,7 @@ declare const eventLedgerTruncatedEventSchema: z.ZodObject<{
4647
6456
  corrupted_path: string;
4648
6457
  correlation_id?: string | undefined;
4649
6458
  session_id?: string | undefined;
4650
- }>;
4651
- declare const mcpConfigMigratedEventSchema: z.ZodObject<{
6459
+ }>, z.ZodObject<{
4652
6460
  event_type: z.ZodLiteral<"mcp_config_migrated">;
4653
6461
  source: z.ZodLiteral<"doctor_fix">;
4654
6462
  removed_from: z.ZodString;
@@ -4678,12 +6486,11 @@ declare const mcpConfigMigratedEventSchema: z.ZodObject<{
4678
6486
  removed_from: string;
4679
6487
  correlation_id?: string | undefined;
4680
6488
  session_id?: string | undefined;
4681
- }>;
4682
- declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
6489
+ }>, z.ZodObject<{
4683
6490
  event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
4684
6491
  reconciled_files: z.ZodArray<z.ZodString, "many">;
4685
6492
  duration_ms: z.ZodNumber;
4686
- source: z.ZodLiteral<"reconcileRules">;
6493
+ source: z.ZodLiteral<"reconcileKnowledge">;
4687
6494
  kind: z.ZodLiteral<"fabric-event">;
4688
6495
  id: z.ZodString;
4689
6496
  ts: z.ZodNumber;
@@ -4692,7 +6499,7 @@ declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
4692
6499
  session_id: z.ZodOptional<z.ZodString>;
4693
6500
  }, "strip", z.ZodTypeAny, {
4694
6501
  id: string;
4695
- source: "reconcileRules";
6502
+ source: "reconcileKnowledge";
4696
6503
  ts: number;
4697
6504
  schema_version: 1;
4698
6505
  kind: "fabric-event";
@@ -4703,7 +6510,7 @@ declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
4703
6510
  session_id?: string | undefined;
4704
6511
  }, {
4705
6512
  id: string;
4706
- source: "reconcileRules";
6513
+ source: "reconcileKnowledge";
4707
6514
  ts: number;
4708
6515
  schema_version: 1;
4709
6516
  kind: "fabric-event";
@@ -4712,13 +6519,12 @@ declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
4712
6519
  duration_ms: number;
4713
6520
  correlation_id?: string | undefined;
4714
6521
  session_id?: string | undefined;
4715
- }>;
4716
- declare const metaReconciledEventSchema: z.ZodObject<{
6522
+ }>, z.ZodObject<{
4717
6523
  event_type: z.ZodLiteral<"meta_reconciled">;
4718
6524
  reconciled_files: z.ZodArray<z.ZodString, "many">;
4719
6525
  duration_ms: z.ZodNumber;
4720
6526
  trigger: z.ZodEnum<["doctor", "manual"]>;
4721
- source: z.ZodLiteral<"reconcileRules">;
6527
+ source: z.ZodLiteral<"reconcileKnowledge">;
4722
6528
  kind: z.ZodLiteral<"fabric-event">;
4723
6529
  id: z.ZodString;
4724
6530
  ts: z.ZodNumber;
@@ -4727,7 +6533,7 @@ declare const metaReconciledEventSchema: z.ZodObject<{
4727
6533
  session_id: z.ZodOptional<z.ZodString>;
4728
6534
  }, "strip", z.ZodTypeAny, {
4729
6535
  id: string;
4730
- source: "reconcileRules";
6536
+ source: "reconcileKnowledge";
4731
6537
  ts: number;
4732
6538
  schema_version: 1;
4733
6539
  kind: "fabric-event";
@@ -4739,7 +6545,7 @@ declare const metaReconciledEventSchema: z.ZodObject<{
4739
6545
  session_id?: string | undefined;
4740
6546
  }, {
4741
6547
  id: string;
4742
- source: "reconcileRules";
6548
+ source: "reconcileKnowledge";
4743
6549
  ts: number;
4744
6550
  schema_version: 1;
4745
6551
  kind: "fabric-event";
@@ -4749,8 +6555,7 @@ declare const metaReconciledEventSchema: z.ZodObject<{
4749
6555
  trigger: "manual" | "doctor";
4750
6556
  correlation_id?: string | undefined;
4751
6557
  session_id?: string | undefined;
4752
- }>;
4753
- declare const claudeSkillPathMigratedEventSchema: z.ZodObject<{
6558
+ }>, z.ZodObject<{
4754
6559
  event_type: z.ZodLiteral<"claude_skill_path_migrated">;
4755
6560
  from: z.ZodString;
4756
6561
  to: z.ZodString;
@@ -4780,8 +6585,7 @@ declare const claudeSkillPathMigratedEventSchema: z.ZodObject<{
4780
6585
  to: string;
4781
6586
  correlation_id?: string | undefined;
4782
6587
  session_id?: string | undefined;
4783
- }>;
4784
- declare const claudeHookPathMigratedEventSchema: z.ZodObject<{
6588
+ }>, z.ZodObject<{
4785
6589
  event_type: z.ZodLiteral<"claude_hook_path_migrated">;
4786
6590
  from: z.ZodString;
4787
6591
  to: z.ZodString;
@@ -4811,8 +6615,7 @@ declare const claudeHookPathMigratedEventSchema: z.ZodObject<{
4811
6615
  to: string;
4812
6616
  correlation_id?: string | undefined;
4813
6617
  session_id?: string | undefined;
4814
- }>;
4815
- declare const codexSkillPathMigratedEventSchema: z.ZodObject<{
6618
+ }>, z.ZodObject<{
4816
6619
  event_type: z.ZodLiteral<"codex_skill_path_migrated">;
4817
6620
  from: z.ZodString;
4818
6621
  to: z.ZodString;
@@ -4842,8 +6645,7 @@ declare const codexSkillPathMigratedEventSchema: z.ZodObject<{
4842
6645
  to: string;
4843
6646
  correlation_id?: string | undefined;
4844
6647
  session_id?: string | undefined;
4845
- }>;
4846
- declare const initScanCompletedEventSchema: z.ZodObject<{
6648
+ }>, z.ZodObject<{
4847
6649
  event_type: z.ZodLiteral<"init_scan_completed">;
4848
6650
  written_stable_ids: z.ZodArray<z.ZodString, "many">;
4849
6651
  duration_ms: z.ZodNumber;
@@ -4876,18 +6678,11 @@ declare const initScanCompletedEventSchema: z.ZodObject<{
4876
6678
  correlation_id?: string | undefined;
4877
6679
  session_id?: string | undefined;
4878
6680
  source?: "doctor_fix" | "init" | "scan" | undefined;
4879
- }>;
4880
- declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
4881
- event_type: z.ZodLiteral<"knowledge_context_planned">;
4882
- target_paths: z.ZodArray<z.ZodString, "many">;
4883
- required_stable_ids: z.ZodArray<z.ZodString, "many">;
4884
- ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
4885
- final_stable_ids: z.ZodArray<z.ZodString, "many">;
4886
- selection_token: z.ZodOptional<z.ZodString>;
4887
- client_hash: z.ZodOptional<z.ZodString>;
4888
- intent: z.ZodOptional<z.ZodString>;
4889
- known_tech: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4890
- diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
6681
+ }>, z.ZodObject<{
6682
+ event_type: z.ZodLiteral<"knowledge_proposed">;
6683
+ stable_id: z.ZodOptional<z.ZodString>;
6684
+ timestamp: z.ZodString;
6685
+ reason: z.ZodOptional<z.ZodString>;
4891
6686
  kind: z.ZodLiteral<"fabric-event">;
4892
6687
  id: z.ZodString;
4893
6688
  ts: z.ZodNumber;
@@ -4896,49 +6691,31 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
4896
6691
  session_id: z.ZodOptional<z.ZodString>;
4897
6692
  }, "strip", z.ZodTypeAny, {
4898
6693
  id: string;
4899
- required_stable_ids: string[];
4900
- ai_selectable_stable_ids: string[];
4901
6694
  ts: number;
4902
6695
  schema_version: 1;
4903
6696
  kind: "fabric-event";
4904
- event_type: "knowledge_context_planned";
4905
- target_paths: string[];
4906
- final_stable_ids: string[];
4907
- known_tech?: string[] | undefined;
4908
- intent?: string | undefined;
4909
- client_hash?: string | undefined;
6697
+ event_type: "knowledge_proposed";
6698
+ timestamp: string;
6699
+ stable_id?: string | undefined;
4910
6700
  correlation_id?: string | undefined;
4911
6701
  session_id?: string | undefined;
4912
- selection_token?: string | undefined;
4913
- diagnostics?: unknown[] | undefined;
6702
+ reason?: string | undefined;
4914
6703
  }, {
4915
6704
  id: string;
4916
- required_stable_ids: string[];
4917
- ai_selectable_stable_ids: string[];
4918
6705
  ts: number;
4919
6706
  schema_version: 1;
4920
6707
  kind: "fabric-event";
4921
- event_type: "knowledge_context_planned";
4922
- target_paths: string[];
4923
- final_stable_ids: string[];
4924
- known_tech?: string[] | undefined;
4925
- intent?: string | undefined;
4926
- client_hash?: string | undefined;
6708
+ event_type: "knowledge_proposed";
6709
+ timestamp: string;
6710
+ stable_id?: string | undefined;
4927
6711
  correlation_id?: string | undefined;
4928
6712
  session_id?: string | undefined;
4929
- selection_token?: string | undefined;
4930
- diagnostics?: unknown[] | undefined;
6713
+ reason?: string | undefined;
4931
6714
  }>, z.ZodObject<{
4932
- event_type: z.ZodLiteral<"knowledge_selection">;
4933
- selection_token: z.ZodString;
4934
- target_paths: z.ZodArray<z.ZodString, "many">;
4935
- required_stable_ids: z.ZodArray<z.ZodString, "many">;
4936
- ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
4937
- ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
4938
- final_stable_ids: z.ZodArray<z.ZodString, "many">;
4939
- ai_selection_reasons: z.ZodRecord<z.ZodString, z.ZodString>;
4940
- rejected_stable_ids: z.ZodArray<z.ZodString, "many">;
4941
- ignored_stable_ids: z.ZodArray<z.ZodString, "many">;
6715
+ event_type: z.ZodLiteral<"knowledge_promote_started">;
6716
+ stable_id: z.ZodOptional<z.ZodString>;
6717
+ timestamp: z.ZodString;
6718
+ reason: z.ZodOptional<z.ZodString>;
4942
6719
  kind: z.ZodLiteral<"fabric-event">;
4943
6720
  id: z.ZodString;
4944
6721
  ts: z.ZodNumber;
@@ -4947,46 +6724,64 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
4947
6724
  session_id: z.ZodOptional<z.ZodString>;
4948
6725
  }, "strip", z.ZodTypeAny, {
4949
6726
  id: string;
4950
- selection_token: string;
4951
- required_stable_ids: string[];
4952
- ai_selectable_stable_ids: string[];
4953
- ai_selected_stable_ids: string[];
4954
- ai_selection_reasons: Record<string, string>;
4955
6727
  ts: number;
4956
6728
  schema_version: 1;
4957
6729
  kind: "fabric-event";
4958
- event_type: "knowledge_selection";
4959
- target_paths: string[];
4960
- final_stable_ids: string[];
4961
- rejected_stable_ids: string[];
4962
- ignored_stable_ids: string[];
6730
+ event_type: "knowledge_promote_started";
6731
+ timestamp: string;
6732
+ stable_id?: string | undefined;
4963
6733
  correlation_id?: string | undefined;
4964
6734
  session_id?: string | undefined;
6735
+ reason?: string | undefined;
4965
6736
  }, {
4966
6737
  id: string;
4967
- selection_token: string;
4968
- required_stable_ids: string[];
4969
- ai_selectable_stable_ids: string[];
4970
- ai_selected_stable_ids: string[];
4971
- ai_selection_reasons: Record<string, string>;
4972
6738
  ts: number;
4973
6739
  schema_version: 1;
4974
6740
  kind: "fabric-event";
4975
- event_type: "knowledge_selection";
4976
- target_paths: string[];
4977
- final_stable_ids: string[];
4978
- rejected_stable_ids: string[];
4979
- ignored_stable_ids: string[];
6741
+ event_type: "knowledge_promote_started";
6742
+ timestamp: string;
6743
+ stable_id?: string | undefined;
6744
+ correlation_id?: string | undefined;
6745
+ session_id?: string | undefined;
6746
+ reason?: string | undefined;
6747
+ }>, z.ZodObject<{
6748
+ event_type: z.ZodLiteral<"knowledge_promoted">;
6749
+ stable_id: z.ZodOptional<z.ZodString>;
6750
+ timestamp: z.ZodString;
6751
+ reason: z.ZodOptional<z.ZodString>;
6752
+ kind: z.ZodLiteral<"fabric-event">;
6753
+ id: z.ZodString;
6754
+ ts: z.ZodNumber;
6755
+ schema_version: z.ZodLiteral<1>;
6756
+ correlation_id: z.ZodOptional<z.ZodString>;
6757
+ session_id: z.ZodOptional<z.ZodString>;
6758
+ }, "strip", z.ZodTypeAny, {
6759
+ id: string;
6760
+ ts: number;
6761
+ schema_version: 1;
6762
+ kind: "fabric-event";
6763
+ event_type: "knowledge_promoted";
6764
+ timestamp: string;
6765
+ stable_id?: string | undefined;
6766
+ correlation_id?: string | undefined;
6767
+ session_id?: string | undefined;
6768
+ reason?: string | undefined;
6769
+ }, {
6770
+ id: string;
6771
+ ts: number;
6772
+ schema_version: 1;
6773
+ kind: "fabric-event";
6774
+ event_type: "knowledge_promoted";
6775
+ timestamp: string;
6776
+ stable_id?: string | undefined;
4980
6777
  correlation_id?: string | undefined;
4981
6778
  session_id?: string | undefined;
6779
+ reason?: string | undefined;
4982
6780
  }>, z.ZodObject<{
4983
- event_type: z.ZodLiteral<"knowledge_sections_fetched">;
4984
- selection_token: z.ZodString;
4985
- target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4986
- requested_sections: z.ZodArray<z.ZodString, "many">;
4987
- final_stable_ids: z.ZodArray<z.ZodString, "many">;
4988
- ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
4989
- diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
6781
+ event_type: z.ZodLiteral<"knowledge_promote_failed">;
6782
+ stable_id: z.ZodOptional<z.ZodString>;
6783
+ timestamp: z.ZodString;
6784
+ reason: z.ZodString;
4990
6785
  kind: z.ZodLiteral<"fabric-event">;
4991
6786
  id: z.ZodString;
4992
6787
  ts: z.ZodNumber;
@@ -4995,46 +6790,33 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
4995
6790
  session_id: z.ZodOptional<z.ZodString>;
4996
6791
  }, "strip", z.ZodTypeAny, {
4997
6792
  id: string;
4998
- selection_token: string;
4999
- ai_selected_stable_ids: string[];
6793
+ reason: string;
5000
6794
  ts: number;
5001
6795
  schema_version: 1;
5002
6796
  kind: "fabric-event";
5003
- event_type: "knowledge_sections_fetched";
5004
- final_stable_ids: string[];
5005
- requested_sections: string[];
6797
+ event_type: "knowledge_promote_failed";
6798
+ timestamp: string;
6799
+ stable_id?: string | undefined;
5006
6800
  correlation_id?: string | undefined;
5007
6801
  session_id?: string | undefined;
5008
- diagnostics?: unknown[] | undefined;
5009
- target_paths?: string[] | undefined;
5010
6802
  }, {
5011
6803
  id: string;
5012
- selection_token: string;
5013
- ai_selected_stable_ids: string[];
6804
+ reason: string;
5014
6805
  ts: number;
5015
6806
  schema_version: 1;
5016
6807
  kind: "fabric-event";
5017
- event_type: "knowledge_sections_fetched";
5018
- final_stable_ids: string[];
5019
- requested_sections: string[];
6808
+ event_type: "knowledge_promote_failed";
6809
+ timestamp: string;
6810
+ stable_id?: string | undefined;
5020
6811
  correlation_id?: string | undefined;
5021
6812
  session_id?: string | undefined;
5022
- diagnostics?: unknown[] | undefined;
5023
- target_paths?: string[] | undefined;
5024
6813
  }>, z.ZodObject<{
5025
- event_type: z.ZodLiteral<"edit_intent_checked">;
5026
- path: z.ZodString;
5027
- compliant: z.ZodBoolean;
5028
- intent: z.ZodString;
5029
- ledger_entry_id: z.ZodString;
5030
- ledger_source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
5031
- commit_sha: z.ZodOptional<z.ZodString>;
5032
- parent_sha: z.ZodOptional<z.ZodString>;
5033
- parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
5034
- diff_stat: z.ZodOptional<z.ZodString>;
5035
- annotation: z.ZodOptional<z.ZodString>;
5036
- matched_rule_context_ts: z.ZodNullable<z.ZodNumber>;
5037
- window_ms: z.ZodNumber;
6814
+ event_type: z.ZodLiteral<"knowledge_layer_changed">;
6815
+ stable_id: z.ZodOptional<z.ZodString>;
6816
+ timestamp: z.ZodString;
6817
+ reason: z.ZodOptional<z.ZodString>;
6818
+ from_layer: z.ZodEnum<["team", "personal"]>;
6819
+ to_layer: z.ZodEnum<["team", "personal"]>;
5038
6820
  kind: z.ZodLiteral<"fabric-event">;
5039
6821
  id: z.ZodString;
5040
6822
  ts: z.ZodNumber;
@@ -5042,67 +6824,38 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5042
6824
  correlation_id: z.ZodOptional<z.ZodString>;
5043
6825
  session_id: z.ZodOptional<z.ZodString>;
5044
6826
  }, "strip", z.ZodTypeAny, {
5045
- path: string;
5046
- ledger_entry_id: string;
5047
6827
  id: string;
5048
- intent: string;
5049
6828
  ts: number;
5050
6829
  schema_version: 1;
5051
6830
  kind: "fabric-event";
5052
- event_type: "edit_intent_checked";
5053
- compliant: boolean;
5054
- matched_rule_context_ts: number | null;
5055
- window_ms: number;
6831
+ event_type: "knowledge_layer_changed";
6832
+ timestamp: string;
6833
+ from_layer: "personal" | "team";
6834
+ to_layer: "personal" | "team";
6835
+ stable_id?: string | undefined;
5056
6836
  correlation_id?: string | undefined;
5057
6837
  session_id?: string | undefined;
5058
- annotation?: string | undefined;
5059
- commit_sha?: string | undefined;
5060
- parent_sha?: string | undefined;
5061
- parent_ledger_entry_id?: string | undefined;
5062
- diff_stat?: string | undefined;
5063
- ledger_source?: "ai" | "human" | undefined;
6838
+ reason?: string | undefined;
5064
6839
  }, {
5065
- path: string;
5066
- ledger_entry_id: string;
5067
6840
  id: string;
5068
- intent: string;
5069
6841
  ts: number;
5070
6842
  schema_version: 1;
5071
6843
  kind: "fabric-event";
5072
- event_type: "edit_intent_checked";
5073
- compliant: boolean;
5074
- matched_rule_context_ts: number | null;
5075
- window_ms: number;
6844
+ event_type: "knowledge_layer_changed";
6845
+ timestamp: string;
6846
+ from_layer: "personal" | "team";
6847
+ to_layer: "personal" | "team";
6848
+ stable_id?: string | undefined;
5076
6849
  correlation_id?: string | undefined;
5077
6850
  session_id?: string | undefined;
5078
- annotation?: string | undefined;
5079
- commit_sha?: string | undefined;
5080
- parent_sha?: string | undefined;
5081
- parent_ledger_entry_id?: string | undefined;
5082
- diff_stat?: string | undefined;
5083
- ledger_source?: "ai" | "human" | undefined;
6851
+ reason?: string | undefined;
5084
6852
  }>, z.ZodObject<{
5085
- event_type: z.ZodLiteral<"knowledge_drift_detected">;
5086
- revision: z.ZodOptional<z.ZodString>;
5087
- drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
5088
- missing_files: z.ZodArray<z.ZodString, "many">;
5089
- stale_files: z.ZodArray<z.ZodString, "many">;
5090
- details: z.ZodOptional<z.ZodArray<z.ZodObject<{
5091
- file: z.ZodString;
5092
- stable_id: z.ZodString;
5093
- expected_hash: z.ZodString;
5094
- actual_hash: z.ZodNullable<z.ZodString>;
5095
- }, "strip", z.ZodTypeAny, {
5096
- file: string;
5097
- stable_id: string;
5098
- expected_hash: string;
5099
- actual_hash: string | null;
5100
- }, {
5101
- file: string;
5102
- stable_id: string;
5103
- expected_hash: string;
5104
- actual_hash: string | null;
5105
- }>, "many">>;
6853
+ event_type: z.ZodLiteral<"knowledge_slug_renamed">;
6854
+ stable_id: z.ZodOptional<z.ZodString>;
6855
+ timestamp: z.ZodString;
6856
+ reason: z.ZodOptional<z.ZodString>;
6857
+ from_slug: z.ZodString;
6858
+ to_slug: z.ZodString;
5106
6859
  kind: z.ZodLiteral<"fabric-event">;
5107
6860
  id: z.ZodString;
5108
6861
  ts: z.ZodNumber;
@@ -5114,42 +6867,32 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5114
6867
  ts: number;
5115
6868
  schema_version: 1;
5116
6869
  kind: "fabric-event";
5117
- event_type: "knowledge_drift_detected";
5118
- drifted_stable_ids: string[];
5119
- missing_files: string[];
5120
- stale_files: string[];
6870
+ event_type: "knowledge_slug_renamed";
6871
+ timestamp: string;
6872
+ from_slug: string;
6873
+ to_slug: string;
6874
+ stable_id?: string | undefined;
5121
6875
  correlation_id?: string | undefined;
5122
6876
  session_id?: string | undefined;
5123
- revision?: string | undefined;
5124
- details?: {
5125
- file: string;
5126
- stable_id: string;
5127
- expected_hash: string;
5128
- actual_hash: string | null;
5129
- }[] | undefined;
6877
+ reason?: string | undefined;
5130
6878
  }, {
5131
6879
  id: string;
5132
6880
  ts: number;
5133
6881
  schema_version: 1;
5134
6882
  kind: "fabric-event";
5135
- event_type: "knowledge_drift_detected";
5136
- drifted_stable_ids: string[];
5137
- missing_files: string[];
5138
- stale_files: string[];
6883
+ event_type: "knowledge_slug_renamed";
6884
+ timestamp: string;
6885
+ from_slug: string;
6886
+ to_slug: string;
6887
+ stable_id?: string | undefined;
5139
6888
  correlation_id?: string | undefined;
5140
6889
  session_id?: string | undefined;
5141
- revision?: string | undefined;
5142
- details?: {
5143
- file: string;
5144
- stable_id: string;
5145
- expected_hash: string;
5146
- actual_hash: string | null;
5147
- }[] | undefined;
6890
+ reason?: string | undefined;
5148
6891
  }>, z.ZodObject<{
5149
- event_type: z.ZodLiteral<"mcp_event">;
5150
- mcp_event_id: z.ZodString;
5151
- stream_id: z.ZodString;
5152
- message: z.ZodUnknown;
6892
+ event_type: z.ZodLiteral<"knowledge_demoted">;
6893
+ stable_id: z.ZodOptional<z.ZodString>;
6894
+ timestamp: z.ZodString;
6895
+ reason: z.ZodOptional<z.ZodString>;
5153
6896
  kind: z.ZodLiteral<"fabric-event">;
5154
6897
  id: z.ZodString;
5155
6898
  ts: z.ZodNumber;
@@ -5161,28 +6904,28 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5161
6904
  ts: number;
5162
6905
  schema_version: 1;
5163
6906
  kind: "fabric-event";
5164
- event_type: "mcp_event";
5165
- mcp_event_id: string;
5166
- stream_id: string;
5167
- message?: unknown;
6907
+ event_type: "knowledge_demoted";
6908
+ timestamp: string;
6909
+ stable_id?: string | undefined;
5168
6910
  correlation_id?: string | undefined;
5169
6911
  session_id?: string | undefined;
6912
+ reason?: string | undefined;
5170
6913
  }, {
5171
6914
  id: string;
5172
6915
  ts: number;
5173
6916
  schema_version: 1;
5174
6917
  kind: "fabric-event";
5175
- event_type: "mcp_event";
5176
- mcp_event_id: string;
5177
- stream_id: string;
5178
- message?: unknown;
6918
+ event_type: "knowledge_demoted";
6919
+ timestamp: string;
6920
+ stable_id?: string | undefined;
5179
6921
  correlation_id?: string | undefined;
5180
6922
  session_id?: string | undefined;
6923
+ reason?: string | undefined;
5181
6924
  }>, z.ZodObject<{
5182
- event_type: z.ZodLiteral<"reapply_completed">;
5183
- preserved_ledger: z.ZodBoolean;
5184
- preserved_meta: z.ZodBoolean;
5185
- rules_count: z.ZodNumber;
6925
+ event_type: z.ZodLiteral<"knowledge_archived">;
6926
+ stable_id: z.ZodOptional<z.ZodString>;
6927
+ timestamp: z.ZodString;
6928
+ reason: z.ZodOptional<z.ZodString>;
5186
6929
  kind: z.ZodLiteral<"fabric-event">;
5187
6930
  id: z.ZodString;
5188
6931
  ts: z.ZodNumber;
@@ -5194,28 +6937,28 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5194
6937
  ts: number;
5195
6938
  schema_version: 1;
5196
6939
  kind: "fabric-event";
5197
- event_type: "reapply_completed";
5198
- preserved_ledger: boolean;
5199
- preserved_meta: boolean;
5200
- rules_count: number;
6940
+ event_type: "knowledge_archived";
6941
+ timestamp: string;
6942
+ stable_id?: string | undefined;
5201
6943
  correlation_id?: string | undefined;
5202
6944
  session_id?: string | undefined;
6945
+ reason?: string | undefined;
5203
6946
  }, {
5204
6947
  id: string;
5205
6948
  ts: number;
5206
6949
  schema_version: 1;
5207
6950
  kind: "fabric-event";
5208
- event_type: "reapply_completed";
5209
- preserved_ledger: boolean;
5210
- preserved_meta: boolean;
5211
- rules_count: number;
6951
+ event_type: "knowledge_archived";
6952
+ timestamp: string;
6953
+ stable_id?: string | undefined;
5212
6954
  correlation_id?: string | undefined;
5213
6955
  session_id?: string | undefined;
6956
+ reason?: string | undefined;
5214
6957
  }>, z.ZodObject<{
5215
- event_type: z.ZodLiteral<"event_ledger_truncated">;
5216
- byte_offset: z.ZodNumber;
5217
- byte_length: z.ZodNumber;
5218
- corrupted_path: z.ZodString;
6958
+ event_type: z.ZodLiteral<"knowledge_archive_attempted">;
6959
+ stable_id: z.ZodOptional<z.ZodString>;
6960
+ timestamp: z.ZodString;
6961
+ reason: z.ZodOptional<z.ZodString>;
5219
6962
  kind: z.ZodLiteral<"fabric-event">;
5220
6963
  id: z.ZodString;
5221
6964
  ts: z.ZodNumber;
@@ -5227,27 +6970,29 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5227
6970
  ts: number;
5228
6971
  schema_version: 1;
5229
6972
  kind: "fabric-event";
5230
- event_type: "event_ledger_truncated";
5231
- byte_offset: number;
5232
- byte_length: number;
5233
- corrupted_path: string;
6973
+ event_type: "knowledge_archive_attempted";
6974
+ timestamp: string;
6975
+ stable_id?: string | undefined;
5234
6976
  correlation_id?: string | undefined;
5235
6977
  session_id?: string | undefined;
6978
+ reason?: string | undefined;
5236
6979
  }, {
5237
6980
  id: string;
5238
6981
  ts: number;
5239
6982
  schema_version: 1;
5240
6983
  kind: "fabric-event";
5241
- event_type: "event_ledger_truncated";
5242
- byte_offset: number;
5243
- byte_length: number;
5244
- corrupted_path: string;
6984
+ event_type: "knowledge_archive_attempted";
6985
+ timestamp: string;
6986
+ stable_id?: string | undefined;
5245
6987
  correlation_id?: string | undefined;
5246
6988
  session_id?: string | undefined;
6989
+ reason?: string | undefined;
5247
6990
  }>, z.ZodObject<{
5248
- event_type: z.ZodLiteral<"mcp_config_migrated">;
5249
- source: z.ZodLiteral<"doctor_fix">;
5250
- removed_from: z.ZodString;
6991
+ event_type: z.ZodLiteral<"knowledge_deferred">;
6992
+ stable_id: z.ZodOptional<z.ZodString>;
6993
+ timestamp: z.ZodString;
6994
+ reason: z.ZodOptional<z.ZodString>;
6995
+ until: z.ZodOptional<z.ZodString>;
5251
6996
  kind: z.ZodLiteral<"fabric-event">;
5252
6997
  id: z.ZodString;
5253
6998
  ts: z.ZodNumber;
@@ -5256,29 +7001,33 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5256
7001
  session_id: z.ZodOptional<z.ZodString>;
5257
7002
  }, "strip", z.ZodTypeAny, {
5258
7003
  id: string;
5259
- source: "doctor_fix";
5260
7004
  ts: number;
5261
7005
  schema_version: 1;
5262
7006
  kind: "fabric-event";
5263
- event_type: "mcp_config_migrated";
5264
- removed_from: string;
7007
+ event_type: "knowledge_deferred";
7008
+ timestamp: string;
7009
+ stable_id?: string | undefined;
5265
7010
  correlation_id?: string | undefined;
5266
7011
  session_id?: string | undefined;
7012
+ reason?: string | undefined;
7013
+ until?: string | undefined;
5267
7014
  }, {
5268
7015
  id: string;
5269
- source: "doctor_fix";
5270
7016
  ts: number;
5271
7017
  schema_version: 1;
5272
7018
  kind: "fabric-event";
5273
- event_type: "mcp_config_migrated";
5274
- removed_from: string;
7019
+ event_type: "knowledge_deferred";
7020
+ timestamp: string;
7021
+ stable_id?: string | undefined;
5275
7022
  correlation_id?: string | undefined;
5276
7023
  session_id?: string | undefined;
7024
+ reason?: string | undefined;
7025
+ until?: string | undefined;
5277
7026
  }>, z.ZodObject<{
5278
- event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
5279
- reconciled_files: z.ZodArray<z.ZodString, "many">;
5280
- duration_ms: z.ZodNumber;
5281
- source: z.ZodLiteral<"reconcileRules">;
7027
+ event_type: z.ZodLiteral<"knowledge_rejected">;
7028
+ stable_id: z.ZodOptional<z.ZodString>;
7029
+ timestamp: z.ZodString;
7030
+ reason: z.ZodString;
5282
7031
  kind: z.ZodLiteral<"fabric-event">;
5283
7032
  id: z.ZodString;
5284
7033
  ts: z.ZodNumber;
@@ -5287,32 +7036,31 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5287
7036
  session_id: z.ZodOptional<z.ZodString>;
5288
7037
  }, "strip", z.ZodTypeAny, {
5289
7038
  id: string;
5290
- source: "reconcileRules";
7039
+ reason: string;
5291
7040
  ts: number;
5292
7041
  schema_version: 1;
5293
7042
  kind: "fabric-event";
5294
- event_type: "meta_reconciled_on_startup";
5295
- reconciled_files: string[];
5296
- duration_ms: number;
7043
+ event_type: "knowledge_rejected";
7044
+ timestamp: string;
7045
+ stable_id?: string | undefined;
5297
7046
  correlation_id?: string | undefined;
5298
7047
  session_id?: string | undefined;
5299
7048
  }, {
5300
7049
  id: string;
5301
- source: "reconcileRules";
7050
+ reason: string;
5302
7051
  ts: number;
5303
7052
  schema_version: 1;
5304
7053
  kind: "fabric-event";
5305
- event_type: "meta_reconciled_on_startup";
5306
- reconciled_files: string[];
5307
- duration_ms: number;
7054
+ event_type: "knowledge_rejected";
7055
+ timestamp: string;
7056
+ stable_id?: string | undefined;
5308
7057
  correlation_id?: string | undefined;
5309
7058
  session_id?: string | undefined;
5310
7059
  }>, z.ZodObject<{
5311
- event_type: z.ZodLiteral<"meta_reconciled">;
5312
- reconciled_files: z.ZodArray<z.ZodString, "many">;
5313
- duration_ms: z.ZodNumber;
5314
- trigger: z.ZodEnum<["doctor", "manual"]>;
5315
- source: z.ZodLiteral<"reconcileRules">;
7060
+ event_type: z.ZodLiteral<"knowledge_consumed">;
7061
+ stable_id: z.ZodString;
7062
+ consumed_at: z.ZodString;
7063
+ client_hash: z.ZodString;
5316
7064
  kind: z.ZodLiteral<"fabric-event">;
5317
7065
  id: z.ZodString;
5318
7066
  ts: z.ZodNumber;
@@ -5321,32 +7069,33 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5321
7069
  session_id: z.ZodOptional<z.ZodString>;
5322
7070
  }, "strip", z.ZodTypeAny, {
5323
7071
  id: string;
5324
- source: "reconcileRules";
7072
+ stable_id: string;
7073
+ client_hash: string;
5325
7074
  ts: number;
5326
7075
  schema_version: 1;
5327
7076
  kind: "fabric-event";
5328
- event_type: "meta_reconciled";
5329
- reconciled_files: string[];
5330
- duration_ms: number;
5331
- trigger: "manual" | "doctor";
7077
+ event_type: "knowledge_consumed";
7078
+ consumed_at: string;
5332
7079
  correlation_id?: string | undefined;
5333
7080
  session_id?: string | undefined;
5334
7081
  }, {
5335
7082
  id: string;
5336
- source: "reconcileRules";
7083
+ stable_id: string;
7084
+ client_hash: string;
5337
7085
  ts: number;
5338
7086
  schema_version: 1;
5339
7087
  kind: "fabric-event";
5340
- event_type: "meta_reconciled";
5341
- reconciled_files: string[];
5342
- duration_ms: number;
5343
- trigger: "manual" | "doctor";
7088
+ event_type: "knowledge_consumed";
7089
+ consumed_at: string;
5344
7090
  correlation_id?: string | undefined;
5345
7091
  session_id?: string | undefined;
5346
7092
  }>, z.ZodObject<{
5347
- event_type: z.ZodLiteral<"claude_skill_path_migrated">;
5348
- from: z.ZodString;
5349
- to: z.ZodString;
7093
+ event_type: z.ZodLiteral<"knowledge_scope_degraded">;
7094
+ stable_id: z.ZodString;
7095
+ timestamp: z.ZodString;
7096
+ from_scope: z.ZodEnum<["narrow", "broad"]>;
7097
+ to_scope: z.ZodEnum<["narrow", "broad"]>;
7098
+ reason: z.ZodString;
5350
7099
  kind: z.ZodLiteral<"fabric-event">;
5351
7100
  id: z.ZodString;
5352
7101
  ts: z.ZodNumber;
@@ -5355,28 +7104,35 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5355
7104
  session_id: z.ZodOptional<z.ZodString>;
5356
7105
  }, "strip", z.ZodTypeAny, {
5357
7106
  id: string;
7107
+ stable_id: string;
7108
+ reason: string;
5358
7109
  ts: number;
5359
7110
  schema_version: 1;
5360
7111
  kind: "fabric-event";
5361
- event_type: "claude_skill_path_migrated";
5362
- from: string;
5363
- to: string;
7112
+ event_type: "knowledge_scope_degraded";
7113
+ timestamp: string;
7114
+ from_scope: "narrow" | "broad";
7115
+ to_scope: "narrow" | "broad";
5364
7116
  correlation_id?: string | undefined;
5365
7117
  session_id?: string | undefined;
5366
7118
  }, {
5367
7119
  id: string;
7120
+ stable_id: string;
7121
+ reason: string;
5368
7122
  ts: number;
5369
7123
  schema_version: 1;
5370
7124
  kind: "fabric-event";
5371
- event_type: "claude_skill_path_migrated";
5372
- from: string;
5373
- to: string;
7125
+ event_type: "knowledge_scope_degraded";
7126
+ timestamp: string;
7127
+ from_scope: "narrow" | "broad";
7128
+ to_scope: "narrow" | "broad";
5374
7129
  correlation_id?: string | undefined;
5375
7130
  session_id?: string | undefined;
5376
7131
  }>, z.ZodObject<{
5377
- event_type: z.ZodLiteral<"claude_hook_path_migrated">;
5378
- from: z.ZodString;
5379
- to: z.ZodString;
7132
+ event_type: z.ZodLiteral<"pending_auto_archived">;
7133
+ pending_path: z.ZodString;
7134
+ archived_to: z.ZodString;
7135
+ reason: z.ZodString;
5380
7136
  kind: z.ZodLiteral<"fabric-event">;
5381
7137
  id: z.ZodString;
5382
7138
  ts: z.ZodNumber;
@@ -5385,28 +7141,30 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5385
7141
  session_id: z.ZodOptional<z.ZodString>;
5386
7142
  }, "strip", z.ZodTypeAny, {
5387
7143
  id: string;
7144
+ pending_path: string;
7145
+ reason: string;
5388
7146
  ts: number;
5389
7147
  schema_version: 1;
5390
7148
  kind: "fabric-event";
5391
- event_type: "claude_hook_path_migrated";
5392
- from: string;
5393
- to: string;
7149
+ event_type: "pending_auto_archived";
7150
+ archived_to: string;
5394
7151
  correlation_id?: string | undefined;
5395
7152
  session_id?: string | undefined;
5396
7153
  }, {
5397
7154
  id: string;
7155
+ pending_path: string;
7156
+ reason: string;
5398
7157
  ts: number;
5399
7158
  schema_version: 1;
5400
7159
  kind: "fabric-event";
5401
- event_type: "claude_hook_path_migrated";
5402
- from: string;
5403
- to: string;
7160
+ event_type: "pending_auto_archived";
7161
+ archived_to: string;
5404
7162
  correlation_id?: string | undefined;
5405
7163
  session_id?: string | undefined;
5406
7164
  }>, z.ZodObject<{
5407
- event_type: z.ZodLiteral<"codex_skill_path_migrated">;
5408
- from: z.ZodString;
5409
- to: z.ZodString;
7165
+ event_type: z.ZodLiteral<"knowledge_path_dangled">;
7166
+ stable_id: z.ZodString;
7167
+ removed_glob: z.ZodString;
5410
7168
  kind: z.ZodLiteral<"fabric-event">;
5411
7169
  id: z.ZodString;
5412
7170
  ts: z.ZodNumber;
@@ -5415,29 +7173,30 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5415
7173
  session_id: z.ZodOptional<z.ZodString>;
5416
7174
  }, "strip", z.ZodTypeAny, {
5417
7175
  id: string;
7176
+ stable_id: string;
5418
7177
  ts: number;
5419
7178
  schema_version: 1;
5420
7179
  kind: "fabric-event";
5421
- event_type: "codex_skill_path_migrated";
5422
- from: string;
5423
- to: string;
7180
+ event_type: "knowledge_path_dangled";
7181
+ removed_glob: string;
5424
7182
  correlation_id?: string | undefined;
5425
7183
  session_id?: string | undefined;
5426
7184
  }, {
5427
7185
  id: string;
7186
+ stable_id: string;
5428
7187
  ts: number;
5429
7188
  schema_version: 1;
5430
7189
  kind: "fabric-event";
5431
- event_type: "codex_skill_path_migrated";
5432
- from: string;
5433
- to: string;
7190
+ event_type: "knowledge_path_dangled";
7191
+ removed_glob: string;
5434
7192
  correlation_id?: string | undefined;
5435
7193
  session_id?: string | undefined;
5436
7194
  }>, z.ZodObject<{
5437
- event_type: z.ZodLiteral<"init_scan_completed">;
5438
- written_stable_ids: z.ZodArray<z.ZodString, "many">;
5439
- duration_ms: z.ZodNumber;
5440
- source: z.ZodOptional<z.ZodEnum<["init", "scan", "doctor_fix"]>>;
7195
+ event_type: z.ZodLiteral<"doctor_run">;
7196
+ mode: z.ZodEnum<["lint", "apply-lint"]>;
7197
+ issues: z.ZodNumber;
7198
+ mutations: z.ZodOptional<z.ZodNumber>;
7199
+ timestamp: z.ZodString;
5441
7200
  kind: z.ZodLiteral<"fabric-event">;
5442
7201
  id: z.ZodString;
5443
7202
  ts: z.ZodNumber;
@@ -5445,27 +7204,29 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
5445
7204
  correlation_id: z.ZodOptional<z.ZodString>;
5446
7205
  session_id: z.ZodOptional<z.ZodString>;
5447
7206
  }, "strip", z.ZodTypeAny, {
7207
+ issues: number;
5448
7208
  id: string;
5449
7209
  ts: number;
5450
7210
  schema_version: 1;
5451
7211
  kind: "fabric-event";
5452
- event_type: "init_scan_completed";
5453
- duration_ms: number;
5454
- written_stable_ids: string[];
7212
+ event_type: "doctor_run";
7213
+ timestamp: string;
7214
+ mode: "lint" | "apply-lint";
5455
7215
  correlation_id?: string | undefined;
5456
7216
  session_id?: string | undefined;
5457
- source?: "doctor_fix" | "init" | "scan" | undefined;
7217
+ mutations?: number | undefined;
5458
7218
  }, {
7219
+ issues: number;
5459
7220
  id: string;
5460
7221
  ts: number;
5461
7222
  schema_version: 1;
5462
7223
  kind: "fabric-event";
5463
- event_type: "init_scan_completed";
5464
- duration_ms: number;
5465
- written_stable_ids: string[];
7224
+ event_type: "doctor_run";
7225
+ timestamp: string;
7226
+ mode: "lint" | "apply-lint";
5466
7227
  correlation_id?: string | undefined;
5467
7228
  session_id?: string | undefined;
5468
- source?: "doctor_fix" | "init" | "scan" | undefined;
7229
+ mutations?: number | undefined;
5469
7230
  }>]>;
5470
7231
  type KnowledgeContextPlannedEvent = z.infer<typeof knowledgeContextPlannedEventSchema>;
5471
7232
  type KnowledgeSelectionEvent = z.infer<typeof knowledgeSelectionEventSchema>;
@@ -5482,9 +7243,25 @@ type ClaudeSkillPathMigratedEvent = z.infer<typeof claudeSkillPathMigratedEventS
5482
7243
  type ClaudeHookPathMigratedEvent = z.infer<typeof claudeHookPathMigratedEventSchema>;
5483
7244
  type CodexSkillPathMigratedEvent = z.infer<typeof codexSkillPathMigratedEventSchema>;
5484
7245
  type InitScanCompletedEvent = z.infer<typeof initScanCompletedEventSchema>;
5485
- type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent;
7246
+ type KnowledgeProposedEvent = z.infer<typeof knowledgeProposedEventSchema>;
7247
+ type KnowledgePromoteStartedEvent = z.infer<typeof knowledgePromoteStartedEventSchema>;
7248
+ type KnowledgePromotedEvent = z.infer<typeof knowledgePromotedEventSchema>;
7249
+ type KnowledgePromoteFailedEvent = z.infer<typeof knowledgePromoteFailedEventSchema>;
7250
+ type KnowledgeLayerChangedEvent = z.infer<typeof knowledgeLayerChangedEventSchema>;
7251
+ type KnowledgeSlugRenamedEvent = z.infer<typeof knowledgeSlugRenamedEventSchema>;
7252
+ type KnowledgeDemotedEvent = z.infer<typeof knowledgeDemotedEventSchema>;
7253
+ type KnowledgeArchivedEvent = z.infer<typeof knowledgeArchivedEventSchema>;
7254
+ type KnowledgeArchiveAttemptedEvent = z.infer<typeof knowledgeArchiveAttemptedEventSchema>;
7255
+ type KnowledgeDeferredEvent = z.infer<typeof knowledgeDeferredEventSchema>;
7256
+ type KnowledgeRejectedEvent = z.infer<typeof knowledgeRejectedEventSchema>;
7257
+ type KnowledgeConsumedEvent = z.infer<typeof knowledgeConsumedEventSchema>;
7258
+ type KnowledgeScopeDegradedEvent = z.infer<typeof knowledgeScopeDegradedEventSchema>;
7259
+ type PendingAutoArchivedEvent = z.infer<typeof pendingAutoArchivedEventSchema>;
7260
+ type KnowledgePathDangledEvent = z.infer<typeof knowledgePathDangledEventSchema>;
7261
+ type DoctorRunEvent = z.infer<typeof doctorRunEventSchema>;
7262
+ type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent | KnowledgeProposedEvent | KnowledgePromoteStartedEvent | KnowledgePromotedEvent | KnowledgePromoteFailedEvent | KnowledgeLayerChangedEvent | KnowledgeSlugRenamedEvent | KnowledgeDemotedEvent | KnowledgeArchivedEvent | KnowledgeArchiveAttemptedEvent | KnowledgeDeferredEvent | KnowledgeRejectedEvent | KnowledgeConsumedEvent | KnowledgeScopeDegradedEvent | PendingAutoArchivedEvent | KnowledgePathDangledEvent | DoctorRunEvent;
5486
7263
  type EventLedgerEventType = EventLedgerEvent["event_type"];
5487
7264
  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;
5488
7265
  type EventLedgerEventInput = EventLedgerEventInputFor<EventLedgerEvent>;
5489
7266
 
5490
- export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type CandidateFileEntry, type CandidateFileFamily, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type CodexSkillPathMigratedEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type FabricEvent, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, KnowledgeType, Layer, type LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type McpConfigMigratedEvent, type McpEventLedgerEvent, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, RULE_TEST_INDEX_SCHEMA_VERSION, type ReapplyCompletedEvent, type RuleTestIndex, type RuleTestLink, type RuleTestOrphanAnnotation, StableId, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, allocateKnowledgeId, auditModeSchema, candidateFileEntrySchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, clientPathsSchema, codexSkillPathMigratedEventSchema, defaultAgentsMetaCounters, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, driftDetectedEventSchema, editIntentCheckedEventSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, fabricConfigSchema, fabricEventSchema, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, isKnowledgeStableId, knowledgeContextPlannedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpPayloadLimitsSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, reapplyCompletedEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, ruleTestIndexSchema, ruleTestLinkSchema, ruleTestOrphanAnnotationSchema, withDerivedAgentsMetaNodeDefaults };
7267
+ export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type CandidateFileEntry, type CandidateFileFamily, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type CodexSkillPathMigratedEvent, type DoctorRunEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type FabricEvent, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION, type KnowledgeArchiveAttemptedEvent, type KnowledgeArchivedEvent, type KnowledgeConsumedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDeferredEvent, type KnowledgeDemotedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeLayerChangedEvent, type KnowledgePathDangledEvent, type KnowledgePromoteFailedEvent, type KnowledgePromoteStartedEvent, type KnowledgePromotedEvent, type KnowledgeProposedEvent, type KnowledgeRejectedEvent, type KnowledgeScopeDegradedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, type KnowledgeSlugRenamedEvent, type KnowledgeTestIndex, type KnowledgeTestLink, type KnowledgeTestOrphanAnnotation, KnowledgeType, Layer, type LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type McpConfigMigratedEvent, type McpEventLedgerEvent, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, type PendingAutoArchivedEvent, type ReapplyCompletedEvent, StableId, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, allocateKnowledgeId, auditModeSchema, candidateFileEntrySchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, clientPathsSchema, codexSkillPathMigratedEventSchema, defaultAgentsMetaCounters, defaultLayerFilterSchema, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, doctorRunEventSchema, driftDetectedEventSchema, editIntentCheckedEventSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, fabricConfigSchema, fabricEventSchema, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, isKnowledgeStableId, knowledgeArchiveAttemptedEventSchema, knowledgeArchivedEventSchema, knowledgeConsumedEventSchema, knowledgeContextPlannedEventSchema, knowledgeDeferredEventSchema, knowledgeDemotedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeLanguageSchema, knowledgeLayerChangedEventSchema, knowledgePathDangledEventSchema, knowledgePromoteFailedEventSchema, knowledgePromoteStartedEventSchema, knowledgePromotedEventSchema, knowledgeProposedEventSchema, knowledgeRejectedEventSchema, knowledgeScopeDegradedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, knowledgeSlugRenamedEventSchema, knowledgeTestIndexSchema, knowledgeTestLinkSchema, knowledgeTestOrphanAnnotationSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpPayloadLimitsSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, pendingAutoArchivedEventSchema, reapplyCompletedEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, withDerivedAgentsMetaNodeDefaults };