@fenglimg/fabric-shared 1.6.0 → 1.8.0-rc.1

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,7 +1,8 @@
1
1
  import { AgentsMetaNode, AgentsIdentitySource, AgentsLayer, AgentsTopologyType, HumanLockEntry, AgentsMeta, LedgerEntry } from './types/index.js';
2
- export { AgentsActivationTier, AgentsMetaNodeActivation, AiLedgerEntry, AuditMode, ClientPaths, FabricConfig, HumanLedgerEntry, RuleDescription, RuleDescriptionIndexItem } from './types/index.js';
2
+ export { AgentsActivationTier, AgentsMetaNodeActivation, AiLedgerEntry, AuditMode, ClientPaths, FabricConfig, HumanLedgerEntry, 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
+ export { annotateIntentRequestSchema, getRulesAnnotations, getRulesInputSchema, getRulesOutputSchema, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, ledgerQuerySchema, ledgerSourceSchema, planContextAnnotations, planContextInputSchema, planContextOutputSchema, ruleSectionsAnnotations, ruleSectionsInputSchema, ruleSectionsOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
5
6
 
6
7
  declare const AGENTS_META_LAYERS: readonly ["L0", "L1", "L2"];
7
8
  declare const AGENTS_META_TOPOLOGY_TYPES: readonly ["mirror", "cross-cutting", "domain", "local", "global"];
@@ -130,6 +131,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
130
131
  must_read_if: string;
131
132
  entities?: string[] | undefined;
132
133
  }>>;
134
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
133
135
  }, "strip", z.ZodTypeAny, {
134
136
  file: string;
135
137
  priority: "high" | "medium" | "low";
@@ -154,6 +156,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
154
156
  tier: "always" | "path" | "description";
155
157
  description?: string | undefined;
156
158
  } | undefined;
159
+ sections?: string[] | undefined;
157
160
  }, {
158
161
  file: string;
159
162
  priority: "high" | "medium" | "low";
@@ -178,6 +181,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
178
181
  tier: "always" | "path" | "description";
179
182
  description?: string | undefined;
180
183
  } | undefined;
184
+ sections?: string[] | undefined;
181
185
  }>, {
182
186
  file: string;
183
187
  priority: "high" | "medium" | "low";
@@ -202,6 +206,7 @@ declare const agentsMetaNodeSchema: z.ZodEffects<z.ZodObject<{
202
206
  tier: "always" | "path" | "description";
203
207
  description?: string | undefined;
204
208
  } | undefined;
209
+ sections?: string[] | undefined;
205
210
  }, unknown>;
206
211
  declare const agentsMetaSchema: z.ZodObject<{
207
212
  revision: z.ZodString;
@@ -249,6 +254,7 @@ declare const agentsMetaSchema: z.ZodObject<{
249
254
  must_read_if: string;
250
255
  entities?: string[] | undefined;
251
256
  }>>;
257
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
252
258
  }, "strip", z.ZodTypeAny, {
253
259
  file: string;
254
260
  priority: "high" | "medium" | "low";
@@ -273,6 +279,7 @@ declare const agentsMetaSchema: z.ZodObject<{
273
279
  tier: "always" | "path" | "description";
274
280
  description?: string | undefined;
275
281
  } | undefined;
282
+ sections?: string[] | undefined;
276
283
  }, {
277
284
  file: string;
278
285
  priority: "high" | "medium" | "low";
@@ -297,6 +304,7 @@ declare const agentsMetaSchema: z.ZodObject<{
297
304
  tier: "always" | "path" | "description";
298
305
  description?: string | undefined;
299
306
  } | undefined;
307
+ sections?: string[] | undefined;
300
308
  }>, {
301
309
  file: string;
302
310
  priority: "high" | "medium" | "low";
@@ -321,6 +329,7 @@ declare const agentsMetaSchema: z.ZodObject<{
321
329
  tier: "always" | "path" | "description";
322
330
  description?: string | undefined;
323
331
  } | undefined;
332
+ sections?: string[] | undefined;
324
333
  }, unknown>>;
325
334
  }, "strip", z.ZodTypeAny, {
326
335
  revision: string;
@@ -348,6 +357,7 @@ declare const agentsMetaSchema: z.ZodObject<{
348
357
  tier: "always" | "path" | "description";
349
358
  description?: string | undefined;
350
359
  } | undefined;
360
+ sections?: string[] | undefined;
351
361
  }>;
352
362
  }, {
353
363
  revision: string;
@@ -359,66 +369,154 @@ declare function deriveAgentsMetaIdentitySource(node: Pick<AgentsMetaNode, "file
359
369
  declare function deriveAgentsMetaLayer(file: string): AgentsLayer;
360
370
  declare function deriveAgentsMetaTopologyType(file: string): AgentsTopologyType;
361
371
 
362
- declare const ledgerSourceSchema: z.ZodEnum<["ai", "human"]>;
363
- declare const ledgerQuerySchema: z.ZodObject<{
364
- source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
365
- since: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, unknown>>;
366
- }, "strip", z.ZodTypeAny, {
367
- source?: "ai" | "human" | undefined;
368
- since?: number | undefined;
369
- }, {
370
- source?: "ai" | "human" | undefined;
371
- since?: unknown;
372
- }>;
373
- declare const historyStateQuerySchema: z.ZodEffects<z.ZodObject<{
374
- ledger_id: z.ZodOptional<z.ZodString>;
375
- ts: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, unknown>>;
376
- }, "strip", z.ZodTypeAny, {
377
- ledger_id?: string | undefined;
378
- ts?: number | undefined;
379
- }, {
380
- ledger_id?: string | undefined;
381
- ts?: unknown;
382
- }>, {
383
- ledger_id?: string | undefined;
384
- ts?: number | undefined;
385
- }, {
386
- ledger_id?: string | undefined;
387
- ts?: unknown;
388
- }>;
389
- declare const humanLockApproveRequestSchema: z.ZodObject<{
390
- file: z.ZodString;
391
- start_line: z.ZodNumber;
392
- end_line: z.ZodNumber;
393
- new_hash: z.ZodString;
394
- }, "strip", z.ZodTypeAny, {
395
- file: string;
396
- start_line: number;
397
- end_line: number;
398
- new_hash: string;
372
+ declare const RULE_TEST_INDEX_SCHEMA_VERSION = 1;
373
+ declare const ruleTestLinkSchema: z.ZodObject<{
374
+ rule_stable_id: z.ZodString;
375
+ rule_file: z.ZodString;
376
+ rule_hash: z.ZodString;
377
+ previous_rule_hash: z.ZodOptional<z.ZodString>;
378
+ test_file: z.ZodString;
379
+ test_hash: z.ZodString;
380
+ previous_test_hash: z.ZodOptional<z.ZodString>;
381
+ annotation_line: z.ZodNumber;
382
+ }, "strict", z.ZodTypeAny, {
383
+ rule_stable_id: string;
384
+ rule_file: string;
385
+ rule_hash: string;
386
+ test_file: string;
387
+ test_hash: string;
388
+ annotation_line: number;
389
+ previous_rule_hash?: string | undefined;
390
+ previous_test_hash?: string | undefined;
399
391
  }, {
400
- file: string;
401
- start_line: number;
402
- end_line: number;
403
- new_hash: string;
392
+ rule_stable_id: string;
393
+ rule_file: string;
394
+ rule_hash: string;
395
+ test_file: string;
396
+ test_hash: string;
397
+ annotation_line: number;
398
+ previous_rule_hash?: string | undefined;
399
+ previous_test_hash?: string | undefined;
404
400
  }>;
405
- declare const humanLockFileParamsSchema: z.ZodObject<{
406
- file: z.ZodString;
407
- }, "strip", z.ZodTypeAny, {
408
- file: string;
401
+ declare const ruleTestOrphanAnnotationSchema: z.ZodObject<{
402
+ rule_stable_id: z.ZodString;
403
+ test_file: z.ZodString;
404
+ test_hash: z.ZodString;
405
+ previous_test_hash: z.ZodOptional<z.ZodString>;
406
+ annotation_line: z.ZodNumber;
407
+ }, "strict", z.ZodTypeAny, {
408
+ rule_stable_id: string;
409
+ test_file: string;
410
+ test_hash: string;
411
+ annotation_line: number;
412
+ previous_test_hash?: string | undefined;
409
413
  }, {
410
- file: string;
414
+ rule_stable_id: string;
415
+ test_file: string;
416
+ test_hash: string;
417
+ annotation_line: number;
418
+ previous_test_hash?: string | undefined;
411
419
  }>;
412
- declare const annotateIntentRequestSchema: z.ZodObject<{
413
- ledger_entry_id: z.ZodString;
414
- annotation: z.ZodString;
415
- }, "strip", z.ZodTypeAny, {
416
- ledger_entry_id: string;
417
- annotation: string;
420
+ declare const ruleTestIndexSchema: z.ZodObject<{
421
+ schema_version: z.ZodLiteral<1>;
422
+ generated_at: z.ZodString;
423
+ revision: z.ZodOptional<z.ZodString>;
424
+ previous_revision: z.ZodOptional<z.ZodString>;
425
+ links: z.ZodArray<z.ZodObject<{
426
+ rule_stable_id: z.ZodString;
427
+ rule_file: z.ZodString;
428
+ rule_hash: z.ZodString;
429
+ previous_rule_hash: z.ZodOptional<z.ZodString>;
430
+ test_file: z.ZodString;
431
+ test_hash: z.ZodString;
432
+ previous_test_hash: z.ZodOptional<z.ZodString>;
433
+ annotation_line: z.ZodNumber;
434
+ }, "strict", z.ZodTypeAny, {
435
+ rule_stable_id: string;
436
+ rule_file: string;
437
+ rule_hash: string;
438
+ test_file: string;
439
+ test_hash: string;
440
+ annotation_line: number;
441
+ previous_rule_hash?: string | undefined;
442
+ previous_test_hash?: string | undefined;
443
+ }, {
444
+ rule_stable_id: string;
445
+ rule_file: string;
446
+ rule_hash: string;
447
+ test_file: string;
448
+ test_hash: string;
449
+ annotation_line: number;
450
+ previous_rule_hash?: string | undefined;
451
+ previous_test_hash?: string | undefined;
452
+ }>, "many">;
453
+ orphan_annotations: z.ZodArray<z.ZodObject<{
454
+ rule_stable_id: z.ZodString;
455
+ test_file: z.ZodString;
456
+ test_hash: z.ZodString;
457
+ previous_test_hash: z.ZodOptional<z.ZodString>;
458
+ annotation_line: z.ZodNumber;
459
+ }, "strict", z.ZodTypeAny, {
460
+ rule_stable_id: string;
461
+ test_file: string;
462
+ test_hash: string;
463
+ annotation_line: number;
464
+ previous_test_hash?: string | undefined;
465
+ }, {
466
+ rule_stable_id: string;
467
+ test_file: string;
468
+ test_hash: string;
469
+ annotation_line: number;
470
+ previous_test_hash?: string | undefined;
471
+ }>, "many">;
472
+ }, "strict", z.ZodTypeAny, {
473
+ schema_version: 1;
474
+ generated_at: string;
475
+ links: {
476
+ rule_stable_id: string;
477
+ rule_file: string;
478
+ rule_hash: string;
479
+ test_file: string;
480
+ test_hash: string;
481
+ annotation_line: number;
482
+ previous_rule_hash?: string | undefined;
483
+ previous_test_hash?: string | undefined;
484
+ }[];
485
+ orphan_annotations: {
486
+ rule_stable_id: string;
487
+ test_file: string;
488
+ test_hash: string;
489
+ annotation_line: number;
490
+ previous_test_hash?: string | undefined;
491
+ }[];
492
+ revision?: string | undefined;
493
+ previous_revision?: string | undefined;
418
494
  }, {
419
- ledger_entry_id: string;
420
- annotation: string;
495
+ schema_version: 1;
496
+ generated_at: string;
497
+ links: {
498
+ rule_stable_id: string;
499
+ rule_file: string;
500
+ rule_hash: string;
501
+ test_file: string;
502
+ test_hash: string;
503
+ annotation_line: number;
504
+ previous_rule_hash?: string | undefined;
505
+ previous_test_hash?: string | undefined;
506
+ }[];
507
+ orphan_annotations: {
508
+ rule_stable_id: string;
509
+ test_file: string;
510
+ test_hash: string;
511
+ annotation_line: number;
512
+ previous_test_hash?: string | undefined;
513
+ }[];
514
+ revision?: string | undefined;
515
+ previous_revision?: string | undefined;
421
516
  }>;
517
+ type RuleTestLink = z.infer<typeof ruleTestLinkSchema>;
518
+ type RuleTestOrphanAnnotation = z.infer<typeof ruleTestOrphanAnnotationSchema>;
519
+ type RuleTestIndex = z.infer<typeof ruleTestIndexSchema>;
422
520
 
423
521
  declare const aiLedgerEntrySchema: z.ZodObject<{
424
522
  source: z.ZodLiteral<"ai">;
@@ -428,16 +526,16 @@ declare const aiLedgerEntrySchema: z.ZodObject<{
428
526
  intent: z.ZodString;
429
527
  affected_paths: z.ZodArray<z.ZodString, "many">;
430
528
  }, "strip", z.ZodTypeAny, {
529
+ intent: string;
431
530
  source: "ai";
432
531
  ts: number;
433
- intent: string;
434
532
  affected_paths: string[];
435
533
  commit_sha?: string | undefined;
436
534
  id?: string | undefined;
437
535
  }, {
536
+ intent: string;
438
537
  source: "ai";
439
538
  ts: number;
440
- intent: string;
441
539
  affected_paths: string[];
442
540
  commit_sha?: string | undefined;
443
541
  id?: string | undefined;
@@ -453,9 +551,9 @@ declare const humanLedgerEntrySchema: z.ZodObject<{
453
551
  intent: z.ZodString;
454
552
  affected_paths: z.ZodArray<z.ZodString, "many">;
455
553
  }, "strip", z.ZodTypeAny, {
554
+ intent: string;
456
555
  source: "human";
457
556
  ts: number;
458
- intent: string;
459
557
  affected_paths: string[];
460
558
  parent_sha: string;
461
559
  diff_stat: string;
@@ -463,9 +561,9 @@ declare const humanLedgerEntrySchema: z.ZodObject<{
463
561
  id?: string | undefined;
464
562
  parent_ledger_entry_id?: string | undefined;
465
563
  }, {
564
+ intent: string;
466
565
  source: "human";
467
566
  ts: number;
468
- intent: string;
469
567
  affected_paths: string[];
470
568
  parent_sha: string;
471
569
  diff_stat: string;
@@ -481,16 +579,16 @@ declare const ledgerEntrySchema: z.ZodEffects<z.ZodDiscriminatedUnion<"source",
481
579
  intent: z.ZodString;
482
580
  affected_paths: z.ZodArray<z.ZodString, "many">;
483
581
  }, "strip", z.ZodTypeAny, {
582
+ intent: string;
484
583
  source: "ai";
485
584
  ts: number;
486
- intent: string;
487
585
  affected_paths: string[];
488
586
  commit_sha?: string | undefined;
489
587
  id?: string | undefined;
490
588
  }, {
589
+ intent: string;
491
590
  source: "ai";
492
591
  ts: number;
493
- intent: string;
494
592
  affected_paths: string[];
495
593
  commit_sha?: string | undefined;
496
594
  id?: string | undefined;
@@ -505,9 +603,9 @@ declare const ledgerEntrySchema: z.ZodEffects<z.ZodDiscriminatedUnion<"source",
505
603
  intent: z.ZodString;
506
604
  affected_paths: z.ZodArray<z.ZodString, "many">;
507
605
  }, "strip", z.ZodTypeAny, {
606
+ intent: string;
508
607
  source: "human";
509
608
  ts: number;
510
- intent: string;
511
609
  affected_paths: string[];
512
610
  parent_sha: string;
513
611
  diff_stat: string;
@@ -515,9 +613,9 @@ declare const ledgerEntrySchema: z.ZodEffects<z.ZodDiscriminatedUnion<"source",
515
613
  id?: string | undefined;
516
614
  parent_ledger_entry_id?: string | undefined;
517
615
  }, {
616
+ intent: string;
518
617
  source: "human";
519
618
  ts: number;
520
- intent: string;
521
619
  affected_paths: string[];
522
620
  parent_sha: string;
523
621
  diff_stat: string;
@@ -525,16 +623,16 @@ declare const ledgerEntrySchema: z.ZodEffects<z.ZodDiscriminatedUnion<"source",
525
623
  id?: string | undefined;
526
624
  parent_ledger_entry_id?: string | undefined;
527
625
  }>]>, {
626
+ intent: string;
528
627
  source: "ai";
529
628
  ts: number;
530
- intent: string;
531
629
  affected_paths: string[];
532
630
  commit_sha?: string | undefined;
533
631
  id?: string | undefined;
534
632
  } | {
633
+ intent: string;
535
634
  source: "human";
536
635
  ts: number;
537
- intent: string;
538
636
  affected_paths: string[];
539
637
  parent_sha: string;
540
638
  diff_stat: string;
@@ -600,85 +698,89 @@ declare const clientPathsSchema: z.ZodObject<{
600
698
  claudeCodeCLI: z.ZodOptional<z.ZodString>;
601
699
  claudeCodeDesktop: z.ZodOptional<z.ZodString>;
602
700
  cursor: z.ZodOptional<z.ZodString>;
603
- windsurf: z.ZodOptional<z.ZodString>;
604
- rooCode: z.ZodOptional<z.ZodString>;
605
- geminiCLI: z.ZodOptional<z.ZodString>;
606
701
  codexCLI: z.ZodOptional<z.ZodString>;
702
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
703
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
704
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
705
+ cursor: z.ZodOptional<z.ZodString>;
706
+ codexCLI: z.ZodOptional<z.ZodString>;
707
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
708
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
709
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
710
+ cursor: z.ZodOptional<z.ZodString>;
711
+ codexCLI: z.ZodOptional<z.ZodString>;
712
+ }, z.ZodTypeAny, "passthrough">>;
713
+ declare const mcpPayloadLimitsSchema: z.ZodOptional<z.ZodObject<{
714
+ warnBytes: z.ZodOptional<z.ZodNumber>;
715
+ hardBytes: z.ZodOptional<z.ZodNumber>;
607
716
  }, "strip", z.ZodTypeAny, {
608
- claudeCodeCLI?: string | undefined;
609
- claudeCodeDesktop?: string | undefined;
610
- cursor?: string | undefined;
611
- windsurf?: string | undefined;
612
- rooCode?: string | undefined;
613
- geminiCLI?: string | undefined;
614
- codexCLI?: string | undefined;
615
- }, {
616
- claudeCodeCLI?: string | undefined;
617
- claudeCodeDesktop?: string | undefined;
618
- cursor?: string | undefined;
619
- windsurf?: string | undefined;
620
- rooCode?: string | undefined;
621
- geminiCLI?: string | undefined;
622
- codexCLI?: string | undefined;
623
- }>;
717
+ warnBytes?: number | undefined;
718
+ hardBytes?: number | undefined;
719
+ }, {
720
+ warnBytes?: number | undefined;
721
+ hardBytes?: number | undefined;
722
+ }>>;
624
723
  declare const fabricConfigSchema: z.ZodObject<{
625
724
  clientPaths: z.ZodOptional<z.ZodObject<{
626
725
  claudeCodeCLI: z.ZodOptional<z.ZodString>;
627
726
  claudeCodeDesktop: z.ZodOptional<z.ZodString>;
628
727
  cursor: z.ZodOptional<z.ZodString>;
629
- windsurf: z.ZodOptional<z.ZodString>;
630
- rooCode: z.ZodOptional<z.ZodString>;
631
- geminiCLI: z.ZodOptional<z.ZodString>;
632
728
  codexCLI: z.ZodOptional<z.ZodString>;
633
- }, "strip", z.ZodTypeAny, {
634
- claudeCodeCLI?: string | undefined;
635
- claudeCodeDesktop?: string | undefined;
636
- cursor?: string | undefined;
637
- windsurf?: string | undefined;
638
- rooCode?: string | undefined;
639
- geminiCLI?: string | undefined;
640
- codexCLI?: string | undefined;
641
- }, {
642
- claudeCodeCLI?: string | undefined;
643
- claudeCodeDesktop?: string | undefined;
644
- cursor?: string | undefined;
645
- windsurf?: string | undefined;
646
- rooCode?: string | undefined;
647
- geminiCLI?: string | undefined;
648
- codexCLI?: string | undefined;
649
- }>>;
729
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
730
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
731
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
732
+ cursor: z.ZodOptional<z.ZodString>;
733
+ codexCLI: z.ZodOptional<z.ZodString>;
734
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
735
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
736
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
737
+ cursor: z.ZodOptional<z.ZodString>;
738
+ codexCLI: z.ZodOptional<z.ZodString>;
739
+ }, z.ZodTypeAny, "passthrough">>>;
650
740
  externalFixturePath: z.ZodOptional<z.ZodString>;
651
741
  scanIgnores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
652
742
  auditMode: z.ZodOptional<z.ZodEnum<["strict", "warn", "off"]>>;
653
743
  audit_mode: z.ZodOptional<z.ZodEnum<["strict", "warn", "off"]>>;
744
+ mcpPayloadLimits: z.ZodOptional<z.ZodObject<{
745
+ warnBytes: z.ZodOptional<z.ZodNumber>;
746
+ hardBytes: z.ZodOptional<z.ZodNumber>;
747
+ }, "strip", z.ZodTypeAny, {
748
+ warnBytes?: number | undefined;
749
+ hardBytes?: number | undefined;
750
+ }, {
751
+ warnBytes?: number | undefined;
752
+ hardBytes?: number | undefined;
753
+ }>>;
654
754
  }, "strip", z.ZodTypeAny, {
655
- clientPaths?: {
656
- claudeCodeCLI?: string | undefined;
657
- claudeCodeDesktop?: string | undefined;
658
- cursor?: string | undefined;
659
- windsurf?: string | undefined;
660
- rooCode?: string | undefined;
661
- geminiCLI?: string | undefined;
662
- codexCLI?: string | undefined;
663
- } | undefined;
755
+ clientPaths?: z.objectOutputType<{
756
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
757
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
758
+ cursor: z.ZodOptional<z.ZodString>;
759
+ codexCLI: z.ZodOptional<z.ZodString>;
760
+ }, z.ZodTypeAny, "passthrough"> | undefined;
664
761
  externalFixturePath?: string | undefined;
665
762
  scanIgnores?: string[] | undefined;
666
763
  auditMode?: "strict" | "warn" | "off" | undefined;
667
764
  audit_mode?: "strict" | "warn" | "off" | undefined;
668
- }, {
669
- clientPaths?: {
670
- claudeCodeCLI?: string | undefined;
671
- claudeCodeDesktop?: string | undefined;
672
- cursor?: string | undefined;
673
- windsurf?: string | undefined;
674
- rooCode?: string | undefined;
675
- geminiCLI?: string | undefined;
676
- codexCLI?: string | undefined;
765
+ mcpPayloadLimits?: {
766
+ warnBytes?: number | undefined;
767
+ hardBytes?: number | undefined;
677
768
  } | undefined;
769
+ }, {
770
+ clientPaths?: z.objectInputType<{
771
+ claudeCodeCLI: z.ZodOptional<z.ZodString>;
772
+ claudeCodeDesktop: z.ZodOptional<z.ZodString>;
773
+ cursor: z.ZodOptional<z.ZodString>;
774
+ codexCLI: z.ZodOptional<z.ZodString>;
775
+ }, z.ZodTypeAny, "passthrough"> | undefined;
678
776
  externalFixturePath?: string | undefined;
679
777
  scanIgnores?: string[] | undefined;
680
778
  auditMode?: "strict" | "warn" | "off" | undefined;
681
779
  audit_mode?: "strict" | "warn" | "off" | undefined;
780
+ mcpPayloadLimits?: {
781
+ warnBytes?: number | undefined;
782
+ hardBytes?: number | undefined;
783
+ } | undefined;
682
784
  }>;
683
785
 
684
786
  interface ForensicCodeSample {
@@ -780,12 +882,12 @@ declare const forensicEvidenceAnchorSchema: z.ZodObject<{
780
882
  snippet: z.ZodString;
781
883
  }, "strip", z.ZodTypeAny, {
782
884
  file: string;
783
- snippet: string;
784
885
  line: string;
886
+ snippet: string;
785
887
  }, {
786
888
  file: string;
787
- snippet: string;
788
889
  line: string;
890
+ snippet: string;
789
891
  }>;
790
892
  declare const forensicAssertionCoverageSchema: z.ZodObject<{
791
893
  ratio: z.ZodNumber;
@@ -813,12 +915,12 @@ declare const forensicAssertionSchema: z.ZodObject<{
813
915
  snippet: z.ZodString;
814
916
  }, "strip", z.ZodTypeAny, {
815
917
  file: string;
816
- snippet: string;
817
918
  line: string;
919
+ snippet: string;
818
920
  }, {
819
921
  file: string;
820
- snippet: string;
821
922
  line: string;
923
+ snippet: string;
822
924
  }>, "many">;
823
925
  coverage: z.ZodObject<{
824
926
  ratio: z.ZodNumber;
@@ -844,8 +946,8 @@ declare const forensicAssertionSchema: z.ZodObject<{
844
946
  confidence: "HIGH" | "MEDIUM" | "LOW";
845
947
  evidence: {
846
948
  file: string;
847
- snippet: string;
848
949
  line: string;
950
+ snippet: string;
849
951
  }[];
850
952
  coverage: {
851
953
  ratio: number;
@@ -861,8 +963,8 @@ declare const forensicAssertionSchema: z.ZodObject<{
861
963
  confidence: "HIGH" | "MEDIUM" | "LOW";
862
964
  evidence: {
863
965
  file: string;
864
- snippet: string;
865
966
  line: string;
967
+ snippet: string;
866
968
  }[];
867
969
  coverage: {
868
970
  ratio: number;
@@ -1031,12 +1133,12 @@ declare const forensicReportSchema: z.ZodObject<{
1031
1133
  snippet: z.ZodString;
1032
1134
  }, "strip", z.ZodTypeAny, {
1033
1135
  file: string;
1034
- snippet: string;
1035
1136
  line: string;
1137
+ snippet: string;
1036
1138
  }, {
1037
1139
  file: string;
1038
- snippet: string;
1039
1140
  line: string;
1141
+ snippet: string;
1040
1142
  }>, "many">;
1041
1143
  coverage: z.ZodObject<{
1042
1144
  ratio: z.ZodNumber;
@@ -1062,8 +1164,8 @@ declare const forensicReportSchema: z.ZodObject<{
1062
1164
  confidence: "HIGH" | "MEDIUM" | "LOW";
1063
1165
  evidence: {
1064
1166
  file: string;
1065
- snippet: string;
1066
1167
  line: string;
1168
+ snippet: string;
1067
1169
  }[];
1068
1170
  coverage: {
1069
1171
  ratio: number;
@@ -1079,8 +1181,8 @@ declare const forensicReportSchema: z.ZodObject<{
1079
1181
  confidence: "HIGH" | "MEDIUM" | "LOW";
1080
1182
  evidence: {
1081
1183
  file: string;
1082
- snippet: string;
1083
1184
  line: string;
1185
+ snippet: string;
1084
1186
  }[];
1085
1187
  coverage: {
1086
1188
  ratio: number;
@@ -1129,6 +1231,7 @@ declare const forensicReportSchema: z.ZodObject<{
1129
1231
  }>;
1130
1232
  recommendations_for_skill: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1131
1233
  }, "strip", z.ZodTypeAny, {
1234
+ generated_at: string;
1132
1235
  framework: {
1133
1236
  evidence: string[];
1134
1237
  kind: string;
@@ -1136,7 +1239,6 @@ declare const forensicReportSchema: z.ZodObject<{
1136
1239
  subkind: string;
1137
1240
  };
1138
1241
  version: string;
1139
- generated_at: string;
1140
1242
  generated_by: string;
1141
1243
  target: string;
1142
1244
  project_name: string;
@@ -1163,8 +1265,8 @@ declare const forensicReportSchema: z.ZodObject<{
1163
1265
  confidence: "HIGH" | "MEDIUM" | "LOW";
1164
1266
  evidence: {
1165
1267
  file: string;
1166
- snippet: string;
1167
1268
  line: string;
1269
+ snippet: string;
1168
1270
  }[];
1169
1271
  coverage: {
1170
1272
  ratio: number;
@@ -1191,6 +1293,7 @@ declare const forensicReportSchema: z.ZodObject<{
1191
1293
  };
1192
1294
  recommendations_for_skill?: string[] | undefined;
1193
1295
  }, {
1296
+ generated_at: string;
1194
1297
  framework: {
1195
1298
  evidence: string[];
1196
1299
  kind: string;
@@ -1198,7 +1301,6 @@ declare const forensicReportSchema: z.ZodObject<{
1198
1301
  subkind: string;
1199
1302
  };
1200
1303
  version: string;
1201
- generated_at: string;
1202
1304
  generated_by: string;
1203
1305
  target: string;
1204
1306
  project_name: string;
@@ -1225,8 +1327,8 @@ declare const forensicReportSchema: z.ZodObject<{
1225
1327
  confidence: "HIGH" | "MEDIUM" | "LOW";
1226
1328
  evidence: {
1227
1329
  file: string;
1228
- snippet: string;
1229
1330
  line: string;
1331
+ snippet: string;
1230
1332
  }[];
1231
1333
  coverage: {
1232
1334
  ratio: number;
@@ -1666,6 +1768,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
1666
1768
  must_read_if: string;
1667
1769
  entities?: string[] | undefined;
1668
1770
  }>>;
1771
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1669
1772
  }, "strip", z.ZodTypeAny, {
1670
1773
  file: string;
1671
1774
  priority: "high" | "medium" | "low";
@@ -1690,6 +1793,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
1690
1793
  tier: "always" | "path" | "description";
1691
1794
  description?: string | undefined;
1692
1795
  } | undefined;
1796
+ sections?: string[] | undefined;
1693
1797
  }, {
1694
1798
  file: string;
1695
1799
  priority: "high" | "medium" | "low";
@@ -1714,6 +1818,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
1714
1818
  tier: "always" | "path" | "description";
1715
1819
  description?: string | undefined;
1716
1820
  } | undefined;
1821
+ sections?: string[] | undefined;
1717
1822
  }>, {
1718
1823
  file: string;
1719
1824
  priority: "high" | "medium" | "low";
@@ -1738,6 +1843,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
1738
1843
  tier: "always" | "path" | "description";
1739
1844
  description?: string | undefined;
1740
1845
  } | undefined;
1846
+ sections?: string[] | undefined;
1741
1847
  }, unknown>>;
1742
1848
  }, "strip", z.ZodTypeAny, {
1743
1849
  revision: string;
@@ -1765,6 +1871,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
1765
1871
  tier: "always" | "path" | "description";
1766
1872
  description?: string | undefined;
1767
1873
  } | undefined;
1874
+ sections?: string[] | undefined;
1768
1875
  }>;
1769
1876
  }, {
1770
1877
  revision: string;
@@ -1798,6 +1905,7 @@ declare const metaUpdatedEventSchema: z.ZodObject<{
1798
1905
  tier: "always" | "path" | "description";
1799
1906
  description?: string | undefined;
1800
1907
  } | undefined;
1908
+ sections?: string[] | undefined;
1801
1909
  }>;
1802
1910
  };
1803
1911
  }, {
@@ -2007,16 +2115,16 @@ declare const ledgerAppendedEventSchema: z.ZodObject<{
2007
2115
  intent: z.ZodString;
2008
2116
  affected_paths: z.ZodArray<z.ZodString, "many">;
2009
2117
  }, "strip", z.ZodTypeAny, {
2118
+ intent: string;
2010
2119
  source: "ai";
2011
2120
  ts: number;
2012
- intent: string;
2013
2121
  affected_paths: string[];
2014
2122
  commit_sha?: string | undefined;
2015
2123
  id?: string | undefined;
2016
2124
  }, {
2125
+ intent: string;
2017
2126
  source: "ai";
2018
2127
  ts: number;
2019
- intent: string;
2020
2128
  affected_paths: string[];
2021
2129
  commit_sha?: string | undefined;
2022
2130
  id?: string | undefined;
@@ -2031,9 +2139,9 @@ declare const ledgerAppendedEventSchema: z.ZodObject<{
2031
2139
  intent: z.ZodString;
2032
2140
  affected_paths: z.ZodArray<z.ZodString, "many">;
2033
2141
  }, "strip", z.ZodTypeAny, {
2142
+ intent: string;
2034
2143
  source: "human";
2035
2144
  ts: number;
2036
- intent: string;
2037
2145
  affected_paths: string[];
2038
2146
  parent_sha: string;
2039
2147
  diff_stat: string;
@@ -2041,9 +2149,9 @@ declare const ledgerAppendedEventSchema: z.ZodObject<{
2041
2149
  id?: string | undefined;
2042
2150
  parent_ledger_entry_id?: string | undefined;
2043
2151
  }, {
2152
+ intent: string;
2044
2153
  source: "human";
2045
2154
  ts: number;
2046
- intent: string;
2047
2155
  affected_paths: string[];
2048
2156
  parent_sha: string;
2049
2157
  diff_stat: string;
@@ -2051,16 +2159,16 @@ declare const ledgerAppendedEventSchema: z.ZodObject<{
2051
2159
  id?: string | undefined;
2052
2160
  parent_ledger_entry_id?: string | undefined;
2053
2161
  }>]>, {
2162
+ intent: string;
2054
2163
  source: "ai";
2055
2164
  ts: number;
2056
- intent: string;
2057
2165
  affected_paths: string[];
2058
2166
  commit_sha?: string | undefined;
2059
2167
  id?: string | undefined;
2060
2168
  } | {
2169
+ intent: string;
2061
2170
  source: "human";
2062
2171
  ts: number;
2063
- intent: string;
2064
2172
  affected_paths: string[];
2065
2173
  parent_sha: string;
2066
2174
  diff_stat: string;
@@ -2071,16 +2179,16 @@ declare const ledgerAppendedEventSchema: z.ZodObject<{
2071
2179
  }, "strip", z.ZodTypeAny, {
2072
2180
  type: "ledger:appended";
2073
2181
  payload: {
2182
+ intent: string;
2074
2183
  source: "ai";
2075
2184
  ts: number;
2076
- intent: string;
2077
2185
  affected_paths: string[];
2078
2186
  commit_sha?: string | undefined;
2079
2187
  id?: string | undefined;
2080
2188
  } | {
2189
+ intent: string;
2081
2190
  source: "human";
2082
2191
  ts: number;
2083
- intent: string;
2084
2192
  affected_paths: string[];
2085
2193
  parent_sha: string;
2086
2194
  diff_stat: string;
@@ -2171,12 +2279,12 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2171
2279
  snippet: z.ZodString;
2172
2280
  }, "strip", z.ZodTypeAny, {
2173
2281
  file: string;
2174
- snippet: string;
2175
2282
  line: string;
2283
+ snippet: string;
2176
2284
  }, {
2177
2285
  file: string;
2178
- snippet: string;
2179
2286
  line: string;
2287
+ snippet: string;
2180
2288
  }>, "many">;
2181
2289
  coverage: z.ZodObject<{
2182
2290
  ratio: z.ZodNumber;
@@ -2202,8 +2310,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2202
2310
  confidence: "HIGH" | "MEDIUM" | "LOW";
2203
2311
  evidence: {
2204
2312
  file: string;
2205
- snippet: string;
2206
2313
  line: string;
2314
+ snippet: string;
2207
2315
  }[];
2208
2316
  coverage: {
2209
2317
  ratio: number;
@@ -2219,8 +2327,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2219
2327
  confidence: "HIGH" | "MEDIUM" | "LOW";
2220
2328
  evidence: {
2221
2329
  file: string;
2222
- snippet: string;
2223
2330
  line: string;
2331
+ snippet: string;
2224
2332
  }[];
2225
2333
  coverage: {
2226
2334
  ratio: number;
@@ -2269,6 +2377,7 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2269
2377
  }>;
2270
2378
  recommendations_for_skill: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2271
2379
  }, "strip", z.ZodTypeAny, {
2380
+ generated_at: string;
2272
2381
  framework: {
2273
2382
  evidence: string[];
2274
2383
  kind: string;
@@ -2276,7 +2385,6 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2276
2385
  subkind: string;
2277
2386
  };
2278
2387
  version: string;
2279
- generated_at: string;
2280
2388
  generated_by: string;
2281
2389
  target: string;
2282
2390
  project_name: string;
@@ -2303,8 +2411,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2303
2411
  confidence: "HIGH" | "MEDIUM" | "LOW";
2304
2412
  evidence: {
2305
2413
  file: string;
2306
- snippet: string;
2307
2414
  line: string;
2415
+ snippet: string;
2308
2416
  }[];
2309
2417
  coverage: {
2310
2418
  ratio: number;
@@ -2331,6 +2439,7 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2331
2439
  };
2332
2440
  recommendations_for_skill?: string[] | undefined;
2333
2441
  }, {
2442
+ generated_at: string;
2334
2443
  framework: {
2335
2444
  evidence: string[];
2336
2445
  kind: string;
@@ -2338,7 +2447,6 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2338
2447
  subkind: string;
2339
2448
  };
2340
2449
  version: string;
2341
- generated_at: string;
2342
2450
  generated_by: string;
2343
2451
  target: string;
2344
2452
  project_name: string;
@@ -2365,8 +2473,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2365
2473
  confidence: "HIGH" | "MEDIUM" | "LOW";
2366
2474
  evidence: {
2367
2475
  file: string;
2368
- snippet: string;
2369
2476
  line: string;
2477
+ snippet: string;
2370
2478
  }[];
2371
2479
  coverage: {
2372
2480
  ratio: number;
@@ -2396,6 +2504,7 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2396
2504
  }, "strip", z.ZodTypeAny, {
2397
2505
  type: "drift:detected";
2398
2506
  payload: {
2507
+ generated_at: string;
2399
2508
  framework: {
2400
2509
  evidence: string[];
2401
2510
  kind: string;
@@ -2403,7 +2512,6 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2403
2512
  subkind: string;
2404
2513
  };
2405
2514
  version: string;
2406
- generated_at: string;
2407
2515
  generated_by: string;
2408
2516
  target: string;
2409
2517
  project_name: string;
@@ -2430,8 +2538,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2430
2538
  confidence: "HIGH" | "MEDIUM" | "LOW";
2431
2539
  evidence: {
2432
2540
  file: string;
2433
- snippet: string;
2434
2541
  line: string;
2542
+ snippet: string;
2435
2543
  }[];
2436
2544
  coverage: {
2437
2545
  ratio: number;
@@ -2461,6 +2569,7 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2461
2569
  }, {
2462
2570
  type: "drift:detected";
2463
2571
  payload: {
2572
+ generated_at: string;
2464
2573
  framework: {
2465
2574
  evidence: string[];
2466
2575
  kind: string;
@@ -2468,7 +2577,6 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2468
2577
  subkind: string;
2469
2578
  };
2470
2579
  version: string;
2471
- generated_at: string;
2472
2580
  generated_by: string;
2473
2581
  target: string;
2474
2582
  project_name: string;
@@ -2495,8 +2603,8 @@ declare const driftDetectedEventSchema: z.ZodObject<{
2495
2603
  confidence: "HIGH" | "MEDIUM" | "LOW";
2496
2604
  evidence: {
2497
2605
  file: string;
2498
- snippet: string;
2499
2606
  line: string;
2607
+ snippet: string;
2500
2608
  }[];
2501
2609
  coverage: {
2502
2610
  ratio: number;
@@ -2572,6 +2680,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2572
2680
  must_read_if: string;
2573
2681
  entities?: string[] | undefined;
2574
2682
  }>>;
2683
+ sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2575
2684
  }, "strip", z.ZodTypeAny, {
2576
2685
  file: string;
2577
2686
  priority: "high" | "medium" | "low";
@@ -2596,6 +2705,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2596
2705
  tier: "always" | "path" | "description";
2597
2706
  description?: string | undefined;
2598
2707
  } | undefined;
2708
+ sections?: string[] | undefined;
2599
2709
  }, {
2600
2710
  file: string;
2601
2711
  priority: "high" | "medium" | "low";
@@ -2620,6 +2730,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2620
2730
  tier: "always" | "path" | "description";
2621
2731
  description?: string | undefined;
2622
2732
  } | undefined;
2733
+ sections?: string[] | undefined;
2623
2734
  }>, {
2624
2735
  file: string;
2625
2736
  priority: "high" | "medium" | "low";
@@ -2644,6 +2755,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2644
2755
  tier: "always" | "path" | "description";
2645
2756
  description?: string | undefined;
2646
2757
  } | undefined;
2758
+ sections?: string[] | undefined;
2647
2759
  }, unknown>>;
2648
2760
  }, "strip", z.ZodTypeAny, {
2649
2761
  revision: string;
@@ -2671,6 +2783,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2671
2783
  tier: "always" | "path" | "description";
2672
2784
  description?: string | undefined;
2673
2785
  } | undefined;
2786
+ sections?: string[] | undefined;
2674
2787
  }>;
2675
2788
  }, {
2676
2789
  revision: string;
@@ -2704,6 +2817,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2704
2817
  tier: "always" | "path" | "description";
2705
2818
  description?: string | undefined;
2706
2819
  } | undefined;
2820
+ sections?: string[] | undefined;
2707
2821
  }>;
2708
2822
  };
2709
2823
  }, {
@@ -2910,16 +3024,16 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2910
3024
  intent: z.ZodString;
2911
3025
  affected_paths: z.ZodArray<z.ZodString, "many">;
2912
3026
  }, "strip", z.ZodTypeAny, {
3027
+ intent: string;
2913
3028
  source: "ai";
2914
3029
  ts: number;
2915
- intent: string;
2916
3030
  affected_paths: string[];
2917
3031
  commit_sha?: string | undefined;
2918
3032
  id?: string | undefined;
2919
3033
  }, {
3034
+ intent: string;
2920
3035
  source: "ai";
2921
3036
  ts: number;
2922
- intent: string;
2923
3037
  affected_paths: string[];
2924
3038
  commit_sha?: string | undefined;
2925
3039
  id?: string | undefined;
@@ -2934,9 +3048,9 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2934
3048
  intent: z.ZodString;
2935
3049
  affected_paths: z.ZodArray<z.ZodString, "many">;
2936
3050
  }, "strip", z.ZodTypeAny, {
3051
+ intent: string;
2937
3052
  source: "human";
2938
3053
  ts: number;
2939
- intent: string;
2940
3054
  affected_paths: string[];
2941
3055
  parent_sha: string;
2942
3056
  diff_stat: string;
@@ -2944,9 +3058,9 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2944
3058
  id?: string | undefined;
2945
3059
  parent_ledger_entry_id?: string | undefined;
2946
3060
  }, {
3061
+ intent: string;
2947
3062
  source: "human";
2948
3063
  ts: number;
2949
- intent: string;
2950
3064
  affected_paths: string[];
2951
3065
  parent_sha: string;
2952
3066
  diff_stat: string;
@@ -2954,16 +3068,16 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2954
3068
  id?: string | undefined;
2955
3069
  parent_ledger_entry_id?: string | undefined;
2956
3070
  }>]>, {
3071
+ intent: string;
2957
3072
  source: "ai";
2958
3073
  ts: number;
2959
- intent: string;
2960
3074
  affected_paths: string[];
2961
3075
  commit_sha?: string | undefined;
2962
3076
  id?: string | undefined;
2963
3077
  } | {
3078
+ intent: string;
2964
3079
  source: "human";
2965
3080
  ts: number;
2966
- intent: string;
2967
3081
  affected_paths: string[];
2968
3082
  parent_sha: string;
2969
3083
  diff_stat: string;
@@ -2974,16 +3088,16 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2974
3088
  }, "strip", z.ZodTypeAny, {
2975
3089
  type: "ledger:appended";
2976
3090
  payload: {
3091
+ intent: string;
2977
3092
  source: "ai";
2978
3093
  ts: number;
2979
- intent: string;
2980
3094
  affected_paths: string[];
2981
3095
  commit_sha?: string | undefined;
2982
3096
  id?: string | undefined;
2983
3097
  } | {
3098
+ intent: string;
2984
3099
  source: "human";
2985
3100
  ts: number;
2986
- intent: string;
2987
3101
  affected_paths: string[];
2988
3102
  parent_sha: string;
2989
3103
  diff_stat: string;
@@ -3073,12 +3187,12 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3073
3187
  snippet: z.ZodString;
3074
3188
  }, "strip", z.ZodTypeAny, {
3075
3189
  file: string;
3076
- snippet: string;
3077
3190
  line: string;
3191
+ snippet: string;
3078
3192
  }, {
3079
3193
  file: string;
3080
- snippet: string;
3081
3194
  line: string;
3195
+ snippet: string;
3082
3196
  }>, "many">;
3083
3197
  coverage: z.ZodObject<{
3084
3198
  ratio: z.ZodNumber;
@@ -3104,8 +3218,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3104
3218
  confidence: "HIGH" | "MEDIUM" | "LOW";
3105
3219
  evidence: {
3106
3220
  file: string;
3107
- snippet: string;
3108
3221
  line: string;
3222
+ snippet: string;
3109
3223
  }[];
3110
3224
  coverage: {
3111
3225
  ratio: number;
@@ -3121,8 +3235,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3121
3235
  confidence: "HIGH" | "MEDIUM" | "LOW";
3122
3236
  evidence: {
3123
3237
  file: string;
3124
- snippet: string;
3125
3238
  line: string;
3239
+ snippet: string;
3126
3240
  }[];
3127
3241
  coverage: {
3128
3242
  ratio: number;
@@ -3171,6 +3285,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3171
3285
  }>;
3172
3286
  recommendations_for_skill: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3173
3287
  }, "strip", z.ZodTypeAny, {
3288
+ generated_at: string;
3174
3289
  framework: {
3175
3290
  evidence: string[];
3176
3291
  kind: string;
@@ -3178,7 +3293,6 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3178
3293
  subkind: string;
3179
3294
  };
3180
3295
  version: string;
3181
- generated_at: string;
3182
3296
  generated_by: string;
3183
3297
  target: string;
3184
3298
  project_name: string;
@@ -3205,8 +3319,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3205
3319
  confidence: "HIGH" | "MEDIUM" | "LOW";
3206
3320
  evidence: {
3207
3321
  file: string;
3208
- snippet: string;
3209
3322
  line: string;
3323
+ snippet: string;
3210
3324
  }[];
3211
3325
  coverage: {
3212
3326
  ratio: number;
@@ -3233,6 +3347,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3233
3347
  };
3234
3348
  recommendations_for_skill?: string[] | undefined;
3235
3349
  }, {
3350
+ generated_at: string;
3236
3351
  framework: {
3237
3352
  evidence: string[];
3238
3353
  kind: string;
@@ -3240,7 +3355,6 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3240
3355
  subkind: string;
3241
3356
  };
3242
3357
  version: string;
3243
- generated_at: string;
3244
3358
  generated_by: string;
3245
3359
  target: string;
3246
3360
  project_name: string;
@@ -3267,8 +3381,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3267
3381
  confidence: "HIGH" | "MEDIUM" | "LOW";
3268
3382
  evidence: {
3269
3383
  file: string;
3270
- snippet: string;
3271
3384
  line: string;
3385
+ snippet: string;
3272
3386
  }[];
3273
3387
  coverage: {
3274
3388
  ratio: number;
@@ -3298,6 +3412,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3298
3412
  }, "strip", z.ZodTypeAny, {
3299
3413
  type: "drift:detected";
3300
3414
  payload: {
3415
+ generated_at: string;
3301
3416
  framework: {
3302
3417
  evidence: string[];
3303
3418
  kind: string;
@@ -3305,7 +3420,6 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3305
3420
  subkind: string;
3306
3421
  };
3307
3422
  version: string;
3308
- generated_at: string;
3309
3423
  generated_by: string;
3310
3424
  target: string;
3311
3425
  project_name: string;
@@ -3332,8 +3446,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3332
3446
  confidence: "HIGH" | "MEDIUM" | "LOW";
3333
3447
  evidence: {
3334
3448
  file: string;
3335
- snippet: string;
3336
3449
  line: string;
3450
+ snippet: string;
3337
3451
  }[];
3338
3452
  coverage: {
3339
3453
  ratio: number;
@@ -3363,6 +3477,7 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3363
3477
  }, {
3364
3478
  type: "drift:detected";
3365
3479
  payload: {
3480
+ generated_at: string;
3366
3481
  framework: {
3367
3482
  evidence: string[];
3368
3483
  kind: string;
@@ -3370,7 +3485,6 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3370
3485
  subkind: string;
3371
3486
  };
3372
3487
  version: string;
3373
- generated_at: string;
3374
3488
  generated_by: string;
3375
3489
  target: string;
3376
3490
  project_name: string;
@@ -3397,8 +3511,8 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3397
3511
  confidence: "HIGH" | "MEDIUM" | "LOW";
3398
3512
  evidence: {
3399
3513
  file: string;
3400
- snippet: string;
3401
3514
  line: string;
3515
+ snippet: string;
3402
3516
  }[];
3403
3517
  coverage: {
3404
3518
  ratio: number;
@@ -3427,4 +3541,1236 @@ declare const fabricEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3427
3541
  };
3428
3542
  }>]>;
3429
3543
 
3430
- export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, AgentsMetaNode, AgentsTopologyType, type CandidateFileEntry, type CandidateFileFamily, type DriftDetectedEvent, 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 LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type MetaUpdatedEvent, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, annotateIntentRequestSchema, auditModeSchema, candidateFileEntrySchema, clientPathsSchema, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, driftDetectedEventSchema, fabricConfigSchema, fabricEventSchema, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, historyStateQuerySchema, humanLedgerEntrySchema, humanLockApproveRequestSchema, humanLockEntrySchema, humanLockFileParamsSchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, ledgerAppendedEventSchema, ledgerEntrySchema, ledgerQuerySchema, ledgerSourceSchema, lockApprovedEventSchema, lockDriftEventSchema, metaUpdatedEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, withDerivedAgentsMetaNodeDefaults };
3544
+ declare const ruleContextPlannedEventSchema: z.ZodObject<{
3545
+ event_type: z.ZodLiteral<"rule_context_planned">;
3546
+ target_paths: z.ZodArray<z.ZodString, "many">;
3547
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
3548
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
3549
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
3550
+ selection_token: z.ZodOptional<z.ZodString>;
3551
+ client_hash: z.ZodOptional<z.ZodString>;
3552
+ intent: z.ZodOptional<z.ZodString>;
3553
+ known_tech: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3554
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3555
+ kind: z.ZodLiteral<"fabric-event">;
3556
+ id: z.ZodString;
3557
+ ts: z.ZodNumber;
3558
+ schema_version: z.ZodLiteral<1>;
3559
+ correlation_id: z.ZodOptional<z.ZodString>;
3560
+ session_id: z.ZodOptional<z.ZodString>;
3561
+ }, "strip", z.ZodTypeAny, {
3562
+ schema_version: 1;
3563
+ required_stable_ids: string[];
3564
+ ai_selectable_stable_ids: string[];
3565
+ ts: number;
3566
+ id: string;
3567
+ kind: "fabric-event";
3568
+ event_type: "rule_context_planned";
3569
+ target_paths: string[];
3570
+ final_stable_ids: string[];
3571
+ known_tech?: string[] | undefined;
3572
+ intent?: string | undefined;
3573
+ client_hash?: string | undefined;
3574
+ correlation_id?: string | undefined;
3575
+ session_id?: string | undefined;
3576
+ selection_token?: string | undefined;
3577
+ diagnostics?: unknown[] | undefined;
3578
+ }, {
3579
+ schema_version: 1;
3580
+ required_stable_ids: string[];
3581
+ ai_selectable_stable_ids: string[];
3582
+ ts: number;
3583
+ id: string;
3584
+ kind: "fabric-event";
3585
+ event_type: "rule_context_planned";
3586
+ target_paths: string[];
3587
+ final_stable_ids: string[];
3588
+ known_tech?: string[] | undefined;
3589
+ intent?: string | undefined;
3590
+ client_hash?: string | undefined;
3591
+ correlation_id?: string | undefined;
3592
+ session_id?: string | undefined;
3593
+ selection_token?: string | undefined;
3594
+ diagnostics?: unknown[] | undefined;
3595
+ }>;
3596
+ declare const ruleSelectionEventSchema: z.ZodObject<{
3597
+ event_type: z.ZodLiteral<"rule_selection">;
3598
+ selection_token: z.ZodString;
3599
+ target_paths: z.ZodArray<z.ZodString, "many">;
3600
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
3601
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
3602
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
3603
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
3604
+ ai_selection_reasons: z.ZodRecord<z.ZodString, z.ZodString>;
3605
+ rejected_stable_ids: z.ZodArray<z.ZodString, "many">;
3606
+ ignored_stable_ids: z.ZodArray<z.ZodString, "many">;
3607
+ kind: z.ZodLiteral<"fabric-event">;
3608
+ id: z.ZodString;
3609
+ ts: z.ZodNumber;
3610
+ schema_version: z.ZodLiteral<1>;
3611
+ correlation_id: z.ZodOptional<z.ZodString>;
3612
+ session_id: z.ZodOptional<z.ZodString>;
3613
+ }, "strip", z.ZodTypeAny, {
3614
+ schema_version: 1;
3615
+ selection_token: string;
3616
+ required_stable_ids: string[];
3617
+ ai_selectable_stable_ids: string[];
3618
+ ai_selected_stable_ids: string[];
3619
+ ai_selection_reasons: Record<string, string>;
3620
+ ts: number;
3621
+ id: string;
3622
+ kind: "fabric-event";
3623
+ event_type: "rule_selection";
3624
+ target_paths: string[];
3625
+ final_stable_ids: string[];
3626
+ rejected_stable_ids: string[];
3627
+ ignored_stable_ids: string[];
3628
+ correlation_id?: string | undefined;
3629
+ session_id?: string | undefined;
3630
+ }, {
3631
+ schema_version: 1;
3632
+ selection_token: string;
3633
+ required_stable_ids: string[];
3634
+ ai_selectable_stable_ids: string[];
3635
+ ai_selected_stable_ids: string[];
3636
+ ai_selection_reasons: Record<string, string>;
3637
+ ts: number;
3638
+ id: string;
3639
+ kind: "fabric-event";
3640
+ event_type: "rule_selection";
3641
+ target_paths: string[];
3642
+ final_stable_ids: string[];
3643
+ rejected_stable_ids: string[];
3644
+ ignored_stable_ids: string[];
3645
+ correlation_id?: string | undefined;
3646
+ session_id?: string | undefined;
3647
+ }>;
3648
+ declare const ruleSectionsFetchedEventSchema: z.ZodObject<{
3649
+ event_type: z.ZodLiteral<"rule_sections_fetched">;
3650
+ selection_token: z.ZodString;
3651
+ target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3652
+ requested_sections: z.ZodArray<z.ZodString, "many">;
3653
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
3654
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
3655
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3656
+ kind: z.ZodLiteral<"fabric-event">;
3657
+ id: z.ZodString;
3658
+ ts: z.ZodNumber;
3659
+ schema_version: z.ZodLiteral<1>;
3660
+ correlation_id: z.ZodOptional<z.ZodString>;
3661
+ session_id: z.ZodOptional<z.ZodString>;
3662
+ }, "strip", z.ZodTypeAny, {
3663
+ schema_version: 1;
3664
+ selection_token: string;
3665
+ ai_selected_stable_ids: string[];
3666
+ ts: number;
3667
+ id: string;
3668
+ kind: "fabric-event";
3669
+ event_type: "rule_sections_fetched";
3670
+ final_stable_ids: string[];
3671
+ requested_sections: string[];
3672
+ correlation_id?: string | undefined;
3673
+ session_id?: string | undefined;
3674
+ diagnostics?: unknown[] | undefined;
3675
+ target_paths?: string[] | undefined;
3676
+ }, {
3677
+ schema_version: 1;
3678
+ selection_token: string;
3679
+ ai_selected_stable_ids: string[];
3680
+ ts: number;
3681
+ id: string;
3682
+ kind: "fabric-event";
3683
+ event_type: "rule_sections_fetched";
3684
+ final_stable_ids: string[];
3685
+ requested_sections: string[];
3686
+ correlation_id?: string | undefined;
3687
+ session_id?: string | undefined;
3688
+ diagnostics?: unknown[] | undefined;
3689
+ target_paths?: string[] | undefined;
3690
+ }>;
3691
+ declare const editIntentCheckedEventSchema: z.ZodObject<{
3692
+ event_type: z.ZodLiteral<"edit_intent_checked">;
3693
+ path: z.ZodString;
3694
+ compliant: z.ZodBoolean;
3695
+ intent: z.ZodString;
3696
+ ledger_entry_id: z.ZodString;
3697
+ ledger_source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
3698
+ commit_sha: z.ZodOptional<z.ZodString>;
3699
+ parent_sha: z.ZodOptional<z.ZodString>;
3700
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
3701
+ diff_stat: z.ZodOptional<z.ZodString>;
3702
+ annotation: z.ZodOptional<z.ZodString>;
3703
+ matched_rule_context_ts: z.ZodNullable<z.ZodNumber>;
3704
+ window_ms: z.ZodNumber;
3705
+ kind: z.ZodLiteral<"fabric-event">;
3706
+ id: z.ZodString;
3707
+ ts: z.ZodNumber;
3708
+ schema_version: z.ZodLiteral<1>;
3709
+ correlation_id: z.ZodOptional<z.ZodString>;
3710
+ session_id: z.ZodOptional<z.ZodString>;
3711
+ }, "strip", z.ZodTypeAny, {
3712
+ path: string;
3713
+ ledger_entry_id: string;
3714
+ schema_version: 1;
3715
+ intent: string;
3716
+ ts: number;
3717
+ id: string;
3718
+ kind: "fabric-event";
3719
+ event_type: "edit_intent_checked";
3720
+ compliant: boolean;
3721
+ matched_rule_context_ts: number | null;
3722
+ window_ms: number;
3723
+ correlation_id?: string | undefined;
3724
+ session_id?: string | undefined;
3725
+ annotation?: string | undefined;
3726
+ commit_sha?: string | undefined;
3727
+ parent_sha?: string | undefined;
3728
+ parent_ledger_entry_id?: string | undefined;
3729
+ diff_stat?: string | undefined;
3730
+ ledger_source?: "ai" | "human" | undefined;
3731
+ }, {
3732
+ path: string;
3733
+ ledger_entry_id: string;
3734
+ schema_version: 1;
3735
+ intent: string;
3736
+ ts: number;
3737
+ id: string;
3738
+ kind: "fabric-event";
3739
+ event_type: "edit_intent_checked";
3740
+ compliant: boolean;
3741
+ matched_rule_context_ts: number | null;
3742
+ window_ms: number;
3743
+ correlation_id?: string | undefined;
3744
+ session_id?: string | undefined;
3745
+ annotation?: string | undefined;
3746
+ commit_sha?: string | undefined;
3747
+ parent_sha?: string | undefined;
3748
+ parent_ledger_entry_id?: string | undefined;
3749
+ diff_stat?: string | undefined;
3750
+ ledger_source?: "ai" | "human" | undefined;
3751
+ }>;
3752
+ declare const ruleDriftDetectedEventSchema: z.ZodObject<{
3753
+ event_type: z.ZodLiteral<"rule_drift_detected">;
3754
+ revision: z.ZodOptional<z.ZodString>;
3755
+ drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
3756
+ missing_files: z.ZodArray<z.ZodString, "many">;
3757
+ stale_files: z.ZodArray<z.ZodString, "many">;
3758
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
3759
+ file: z.ZodString;
3760
+ stable_id: z.ZodString;
3761
+ expected_hash: z.ZodString;
3762
+ actual_hash: z.ZodNullable<z.ZodString>;
3763
+ }, "strip", z.ZodTypeAny, {
3764
+ file: string;
3765
+ stable_id: string;
3766
+ expected_hash: string;
3767
+ actual_hash: string | null;
3768
+ }, {
3769
+ file: string;
3770
+ stable_id: string;
3771
+ expected_hash: string;
3772
+ actual_hash: string | null;
3773
+ }>, "many">>;
3774
+ kind: z.ZodLiteral<"fabric-event">;
3775
+ id: z.ZodString;
3776
+ ts: z.ZodNumber;
3777
+ schema_version: z.ZodLiteral<1>;
3778
+ correlation_id: z.ZodOptional<z.ZodString>;
3779
+ session_id: z.ZodOptional<z.ZodString>;
3780
+ }, "strip", z.ZodTypeAny, {
3781
+ schema_version: 1;
3782
+ ts: number;
3783
+ id: string;
3784
+ kind: "fabric-event";
3785
+ event_type: "rule_drift_detected";
3786
+ drifted_stable_ids: string[];
3787
+ missing_files: string[];
3788
+ stale_files: string[];
3789
+ revision?: string | undefined;
3790
+ correlation_id?: string | undefined;
3791
+ session_id?: string | undefined;
3792
+ details?: {
3793
+ file: string;
3794
+ stable_id: string;
3795
+ expected_hash: string;
3796
+ actual_hash: string | null;
3797
+ }[] | undefined;
3798
+ }, {
3799
+ schema_version: 1;
3800
+ ts: number;
3801
+ id: string;
3802
+ kind: "fabric-event";
3803
+ event_type: "rule_drift_detected";
3804
+ drifted_stable_ids: string[];
3805
+ missing_files: string[];
3806
+ stale_files: string[];
3807
+ revision?: string | undefined;
3808
+ correlation_id?: string | undefined;
3809
+ session_id?: string | undefined;
3810
+ details?: {
3811
+ file: string;
3812
+ stable_id: string;
3813
+ expected_hash: string;
3814
+ actual_hash: string | null;
3815
+ }[] | undefined;
3816
+ }>;
3817
+ declare const ruleBaselineAcceptedEventSchema: z.ZodObject<{
3818
+ event_type: z.ZodLiteral<"rule_baseline_accepted">;
3819
+ revision: z.ZodString;
3820
+ previous_revision: z.ZodOptional<z.ZodString>;
3821
+ accepted_stable_ids: z.ZodArray<z.ZodString, "many">;
3822
+ source: z.ZodOptional<z.ZodEnum<["doctor_fix", "sync_meta"]>>;
3823
+ kind: z.ZodLiteral<"fabric-event">;
3824
+ id: z.ZodString;
3825
+ ts: z.ZodNumber;
3826
+ schema_version: z.ZodLiteral<1>;
3827
+ correlation_id: z.ZodOptional<z.ZodString>;
3828
+ session_id: z.ZodOptional<z.ZodString>;
3829
+ }, "strip", z.ZodTypeAny, {
3830
+ revision: string;
3831
+ schema_version: 1;
3832
+ ts: number;
3833
+ id: string;
3834
+ kind: "fabric-event";
3835
+ event_type: "rule_baseline_accepted";
3836
+ accepted_stable_ids: string[];
3837
+ previous_revision?: string | undefined;
3838
+ correlation_id?: string | undefined;
3839
+ session_id?: string | undefined;
3840
+ source?: "doctor_fix" | "sync_meta" | undefined;
3841
+ }, {
3842
+ revision: string;
3843
+ schema_version: 1;
3844
+ ts: number;
3845
+ id: string;
3846
+ kind: "fabric-event";
3847
+ event_type: "rule_baseline_accepted";
3848
+ accepted_stable_ids: string[];
3849
+ previous_revision?: string | undefined;
3850
+ correlation_id?: string | undefined;
3851
+ session_id?: string | undefined;
3852
+ source?: "doctor_fix" | "sync_meta" | undefined;
3853
+ }>;
3854
+ declare const baselineSyncedEventSchema: z.ZodObject<{
3855
+ event_type: z.ZodLiteral<"baseline_synced">;
3856
+ revision: z.ZodString;
3857
+ previous_revision: z.ZodOptional<z.ZodString>;
3858
+ synced_files: z.ZodArray<z.ZodString, "many">;
3859
+ accepted_stable_ids: z.ZodArray<z.ZodString, "many">;
3860
+ source: z.ZodEnum<["doctor_fix", "sync_meta"]>;
3861
+ kind: z.ZodLiteral<"fabric-event">;
3862
+ id: z.ZodString;
3863
+ ts: z.ZodNumber;
3864
+ schema_version: z.ZodLiteral<1>;
3865
+ correlation_id: z.ZodOptional<z.ZodString>;
3866
+ session_id: z.ZodOptional<z.ZodString>;
3867
+ }, "strip", z.ZodTypeAny, {
3868
+ revision: string;
3869
+ schema_version: 1;
3870
+ source: "doctor_fix" | "sync_meta";
3871
+ ts: number;
3872
+ id: string;
3873
+ kind: "fabric-event";
3874
+ event_type: "baseline_synced";
3875
+ accepted_stable_ids: string[];
3876
+ synced_files: string[];
3877
+ previous_revision?: string | undefined;
3878
+ correlation_id?: string | undefined;
3879
+ session_id?: string | undefined;
3880
+ }, {
3881
+ revision: string;
3882
+ schema_version: 1;
3883
+ source: "doctor_fix" | "sync_meta";
3884
+ ts: number;
3885
+ id: string;
3886
+ kind: "fabric-event";
3887
+ event_type: "baseline_synced";
3888
+ accepted_stable_ids: string[];
3889
+ synced_files: string[];
3890
+ previous_revision?: string | undefined;
3891
+ correlation_id?: string | undefined;
3892
+ session_id?: string | undefined;
3893
+ }>;
3894
+ declare const mcpEventLedgerEventSchema: z.ZodObject<{
3895
+ event_type: z.ZodLiteral<"mcp_event">;
3896
+ mcp_event_id: z.ZodString;
3897
+ stream_id: z.ZodString;
3898
+ message: z.ZodUnknown;
3899
+ kind: z.ZodLiteral<"fabric-event">;
3900
+ id: z.ZodString;
3901
+ ts: z.ZodNumber;
3902
+ schema_version: z.ZodLiteral<1>;
3903
+ correlation_id: z.ZodOptional<z.ZodString>;
3904
+ session_id: z.ZodOptional<z.ZodString>;
3905
+ }, "strip", z.ZodTypeAny, {
3906
+ schema_version: 1;
3907
+ ts: number;
3908
+ id: string;
3909
+ kind: "fabric-event";
3910
+ event_type: "mcp_event";
3911
+ mcp_event_id: string;
3912
+ stream_id: string;
3913
+ message?: unknown;
3914
+ correlation_id?: string | undefined;
3915
+ session_id?: string | undefined;
3916
+ }, {
3917
+ schema_version: 1;
3918
+ ts: number;
3919
+ id: string;
3920
+ kind: "fabric-event";
3921
+ event_type: "mcp_event";
3922
+ mcp_event_id: string;
3923
+ stream_id: string;
3924
+ message?: unknown;
3925
+ correlation_id?: string | undefined;
3926
+ session_id?: string | undefined;
3927
+ }>;
3928
+ declare const reapplyCompletedEventSchema: z.ZodObject<{
3929
+ event_type: z.ZodLiteral<"reapply_completed">;
3930
+ preserved_ledger: z.ZodBoolean;
3931
+ preserved_meta: z.ZodBoolean;
3932
+ rules_count: z.ZodNumber;
3933
+ kind: z.ZodLiteral<"fabric-event">;
3934
+ id: z.ZodString;
3935
+ ts: z.ZodNumber;
3936
+ schema_version: z.ZodLiteral<1>;
3937
+ correlation_id: z.ZodOptional<z.ZodString>;
3938
+ session_id: z.ZodOptional<z.ZodString>;
3939
+ }, "strip", z.ZodTypeAny, {
3940
+ schema_version: 1;
3941
+ ts: number;
3942
+ id: string;
3943
+ kind: "fabric-event";
3944
+ event_type: "reapply_completed";
3945
+ preserved_ledger: boolean;
3946
+ preserved_meta: boolean;
3947
+ rules_count: number;
3948
+ correlation_id?: string | undefined;
3949
+ session_id?: string | undefined;
3950
+ }, {
3951
+ schema_version: 1;
3952
+ ts: number;
3953
+ id: string;
3954
+ kind: "fabric-event";
3955
+ event_type: "reapply_completed";
3956
+ preserved_ledger: boolean;
3957
+ preserved_meta: boolean;
3958
+ rules_count: number;
3959
+ correlation_id?: string | undefined;
3960
+ session_id?: string | undefined;
3961
+ }>;
3962
+ declare const eventLedgerTruncatedEventSchema: z.ZodObject<{
3963
+ event_type: z.ZodLiteral<"event_ledger_truncated">;
3964
+ byte_offset: z.ZodNumber;
3965
+ byte_length: z.ZodNumber;
3966
+ corrupted_path: z.ZodString;
3967
+ kind: z.ZodLiteral<"fabric-event">;
3968
+ id: z.ZodString;
3969
+ ts: z.ZodNumber;
3970
+ schema_version: z.ZodLiteral<1>;
3971
+ correlation_id: z.ZodOptional<z.ZodString>;
3972
+ session_id: z.ZodOptional<z.ZodString>;
3973
+ }, "strip", z.ZodTypeAny, {
3974
+ schema_version: 1;
3975
+ ts: number;
3976
+ id: string;
3977
+ kind: "fabric-event";
3978
+ event_type: "event_ledger_truncated";
3979
+ byte_offset: number;
3980
+ byte_length: number;
3981
+ corrupted_path: string;
3982
+ correlation_id?: string | undefined;
3983
+ session_id?: string | undefined;
3984
+ }, {
3985
+ schema_version: 1;
3986
+ ts: number;
3987
+ id: string;
3988
+ kind: "fabric-event";
3989
+ event_type: "event_ledger_truncated";
3990
+ byte_offset: number;
3991
+ byte_length: number;
3992
+ corrupted_path: string;
3993
+ correlation_id?: string | undefined;
3994
+ session_id?: string | undefined;
3995
+ }>;
3996
+ declare const mcpConfigMigratedEventSchema: z.ZodObject<{
3997
+ event_type: z.ZodLiteral<"mcp_config_migrated">;
3998
+ source: z.ZodLiteral<"doctor_fix">;
3999
+ removed_from: z.ZodString;
4000
+ kind: z.ZodLiteral<"fabric-event">;
4001
+ id: z.ZodString;
4002
+ ts: z.ZodNumber;
4003
+ schema_version: z.ZodLiteral<1>;
4004
+ correlation_id: z.ZodOptional<z.ZodString>;
4005
+ session_id: z.ZodOptional<z.ZodString>;
4006
+ }, "strip", z.ZodTypeAny, {
4007
+ schema_version: 1;
4008
+ source: "doctor_fix";
4009
+ ts: number;
4010
+ id: string;
4011
+ kind: "fabric-event";
4012
+ event_type: "mcp_config_migrated";
4013
+ removed_from: string;
4014
+ correlation_id?: string | undefined;
4015
+ session_id?: string | undefined;
4016
+ }, {
4017
+ schema_version: 1;
4018
+ source: "doctor_fix";
4019
+ ts: number;
4020
+ id: string;
4021
+ kind: "fabric-event";
4022
+ event_type: "mcp_config_migrated";
4023
+ removed_from: string;
4024
+ correlation_id?: string | undefined;
4025
+ session_id?: string | undefined;
4026
+ }>;
4027
+ declare const metaReconciledOnStartupEventSchema: z.ZodObject<{
4028
+ event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
4029
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
4030
+ duration_ms: z.ZodNumber;
4031
+ source: z.ZodLiteral<"reconcileRules">;
4032
+ kind: z.ZodLiteral<"fabric-event">;
4033
+ id: z.ZodString;
4034
+ ts: z.ZodNumber;
4035
+ schema_version: z.ZodLiteral<1>;
4036
+ correlation_id: z.ZodOptional<z.ZodString>;
4037
+ session_id: z.ZodOptional<z.ZodString>;
4038
+ }, "strip", z.ZodTypeAny, {
4039
+ schema_version: 1;
4040
+ source: "reconcileRules";
4041
+ ts: number;
4042
+ id: string;
4043
+ kind: "fabric-event";
4044
+ event_type: "meta_reconciled_on_startup";
4045
+ reconciled_files: string[];
4046
+ duration_ms: number;
4047
+ correlation_id?: string | undefined;
4048
+ session_id?: string | undefined;
4049
+ }, {
4050
+ schema_version: 1;
4051
+ source: "reconcileRules";
4052
+ ts: number;
4053
+ id: string;
4054
+ kind: "fabric-event";
4055
+ event_type: "meta_reconciled_on_startup";
4056
+ reconciled_files: string[];
4057
+ duration_ms: number;
4058
+ correlation_id?: string | undefined;
4059
+ session_id?: string | undefined;
4060
+ }>;
4061
+ declare const metaReconciledEventSchema: z.ZodObject<{
4062
+ event_type: z.ZodLiteral<"meta_reconciled">;
4063
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
4064
+ duration_ms: z.ZodNumber;
4065
+ trigger: z.ZodEnum<["doctor", "manual"]>;
4066
+ source: z.ZodLiteral<"reconcileRules">;
4067
+ kind: z.ZodLiteral<"fabric-event">;
4068
+ id: z.ZodString;
4069
+ ts: z.ZodNumber;
4070
+ schema_version: z.ZodLiteral<1>;
4071
+ correlation_id: z.ZodOptional<z.ZodString>;
4072
+ session_id: z.ZodOptional<z.ZodString>;
4073
+ }, "strip", z.ZodTypeAny, {
4074
+ schema_version: 1;
4075
+ source: "reconcileRules";
4076
+ ts: number;
4077
+ id: string;
4078
+ kind: "fabric-event";
4079
+ event_type: "meta_reconciled";
4080
+ reconciled_files: string[];
4081
+ duration_ms: number;
4082
+ trigger: "manual" | "doctor";
4083
+ correlation_id?: string | undefined;
4084
+ session_id?: string | undefined;
4085
+ }, {
4086
+ schema_version: 1;
4087
+ source: "reconcileRules";
4088
+ ts: number;
4089
+ id: string;
4090
+ kind: "fabric-event";
4091
+ event_type: "meta_reconciled";
4092
+ reconciled_files: string[];
4093
+ duration_ms: number;
4094
+ trigger: "manual" | "doctor";
4095
+ correlation_id?: string | undefined;
4096
+ session_id?: string | undefined;
4097
+ }>;
4098
+ declare const claudeSkillPathMigratedEventSchema: z.ZodObject<{
4099
+ event_type: z.ZodLiteral<"claude_skill_path_migrated">;
4100
+ from: z.ZodString;
4101
+ to: z.ZodString;
4102
+ kind: z.ZodLiteral<"fabric-event">;
4103
+ id: z.ZodString;
4104
+ ts: z.ZodNumber;
4105
+ schema_version: z.ZodLiteral<1>;
4106
+ correlation_id: z.ZodOptional<z.ZodString>;
4107
+ session_id: z.ZodOptional<z.ZodString>;
4108
+ }, "strip", z.ZodTypeAny, {
4109
+ schema_version: 1;
4110
+ ts: number;
4111
+ id: string;
4112
+ kind: "fabric-event";
4113
+ event_type: "claude_skill_path_migrated";
4114
+ from: string;
4115
+ to: string;
4116
+ correlation_id?: string | undefined;
4117
+ session_id?: string | undefined;
4118
+ }, {
4119
+ schema_version: 1;
4120
+ ts: number;
4121
+ id: string;
4122
+ kind: "fabric-event";
4123
+ event_type: "claude_skill_path_migrated";
4124
+ from: string;
4125
+ to: string;
4126
+ correlation_id?: string | undefined;
4127
+ session_id?: string | undefined;
4128
+ }>;
4129
+ declare const legacyClientPathPresentEventSchema: z.ZodObject<{
4130
+ event_type: z.ZodLiteral<"legacy_client_path_present">;
4131
+ removed: z.ZodArray<z.ZodString, "many">;
4132
+ kind: z.ZodLiteral<"fabric-event">;
4133
+ id: z.ZodString;
4134
+ ts: z.ZodNumber;
4135
+ schema_version: z.ZodLiteral<1>;
4136
+ correlation_id: z.ZodOptional<z.ZodString>;
4137
+ session_id: z.ZodOptional<z.ZodString>;
4138
+ }, "strip", z.ZodTypeAny, {
4139
+ schema_version: 1;
4140
+ ts: number;
4141
+ id: string;
4142
+ kind: "fabric-event";
4143
+ event_type: "legacy_client_path_present";
4144
+ removed: string[];
4145
+ correlation_id?: string | undefined;
4146
+ session_id?: string | undefined;
4147
+ }, {
4148
+ schema_version: 1;
4149
+ ts: number;
4150
+ id: string;
4151
+ kind: "fabric-event";
4152
+ event_type: "legacy_client_path_present";
4153
+ removed: string[];
4154
+ correlation_id?: string | undefined;
4155
+ session_id?: string | undefined;
4156
+ }>;
4157
+ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
4158
+ event_type: z.ZodLiteral<"rule_context_planned">;
4159
+ target_paths: z.ZodArray<z.ZodString, "many">;
4160
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
4161
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
4162
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
4163
+ selection_token: z.ZodOptional<z.ZodString>;
4164
+ client_hash: z.ZodOptional<z.ZodString>;
4165
+ intent: z.ZodOptional<z.ZodString>;
4166
+ known_tech: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4167
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4168
+ kind: z.ZodLiteral<"fabric-event">;
4169
+ id: z.ZodString;
4170
+ ts: z.ZodNumber;
4171
+ schema_version: z.ZodLiteral<1>;
4172
+ correlation_id: z.ZodOptional<z.ZodString>;
4173
+ session_id: z.ZodOptional<z.ZodString>;
4174
+ }, "strip", z.ZodTypeAny, {
4175
+ schema_version: 1;
4176
+ required_stable_ids: string[];
4177
+ ai_selectable_stable_ids: string[];
4178
+ ts: number;
4179
+ id: string;
4180
+ kind: "fabric-event";
4181
+ event_type: "rule_context_planned";
4182
+ target_paths: string[];
4183
+ final_stable_ids: string[];
4184
+ known_tech?: string[] | undefined;
4185
+ intent?: string | undefined;
4186
+ client_hash?: string | undefined;
4187
+ correlation_id?: string | undefined;
4188
+ session_id?: string | undefined;
4189
+ selection_token?: string | undefined;
4190
+ diagnostics?: unknown[] | undefined;
4191
+ }, {
4192
+ schema_version: 1;
4193
+ required_stable_ids: string[];
4194
+ ai_selectable_stable_ids: string[];
4195
+ ts: number;
4196
+ id: string;
4197
+ kind: "fabric-event";
4198
+ event_type: "rule_context_planned";
4199
+ target_paths: string[];
4200
+ final_stable_ids: string[];
4201
+ known_tech?: string[] | undefined;
4202
+ intent?: string | undefined;
4203
+ client_hash?: string | undefined;
4204
+ correlation_id?: string | undefined;
4205
+ session_id?: string | undefined;
4206
+ selection_token?: string | undefined;
4207
+ diagnostics?: unknown[] | undefined;
4208
+ }>, z.ZodObject<{
4209
+ event_type: z.ZodLiteral<"rule_selection">;
4210
+ selection_token: z.ZodString;
4211
+ target_paths: z.ZodArray<z.ZodString, "many">;
4212
+ required_stable_ids: z.ZodArray<z.ZodString, "many">;
4213
+ ai_selectable_stable_ids: z.ZodArray<z.ZodString, "many">;
4214
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
4215
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
4216
+ ai_selection_reasons: z.ZodRecord<z.ZodString, z.ZodString>;
4217
+ rejected_stable_ids: z.ZodArray<z.ZodString, "many">;
4218
+ ignored_stable_ids: z.ZodArray<z.ZodString, "many">;
4219
+ kind: z.ZodLiteral<"fabric-event">;
4220
+ id: z.ZodString;
4221
+ ts: z.ZodNumber;
4222
+ schema_version: z.ZodLiteral<1>;
4223
+ correlation_id: z.ZodOptional<z.ZodString>;
4224
+ session_id: z.ZodOptional<z.ZodString>;
4225
+ }, "strip", z.ZodTypeAny, {
4226
+ schema_version: 1;
4227
+ selection_token: string;
4228
+ required_stable_ids: string[];
4229
+ ai_selectable_stable_ids: string[];
4230
+ ai_selected_stable_ids: string[];
4231
+ ai_selection_reasons: Record<string, string>;
4232
+ ts: number;
4233
+ id: string;
4234
+ kind: "fabric-event";
4235
+ event_type: "rule_selection";
4236
+ target_paths: string[];
4237
+ final_stable_ids: string[];
4238
+ rejected_stable_ids: string[];
4239
+ ignored_stable_ids: string[];
4240
+ correlation_id?: string | undefined;
4241
+ session_id?: string | undefined;
4242
+ }, {
4243
+ schema_version: 1;
4244
+ selection_token: string;
4245
+ required_stable_ids: string[];
4246
+ ai_selectable_stable_ids: string[];
4247
+ ai_selected_stable_ids: string[];
4248
+ ai_selection_reasons: Record<string, string>;
4249
+ ts: number;
4250
+ id: string;
4251
+ kind: "fabric-event";
4252
+ event_type: "rule_selection";
4253
+ target_paths: string[];
4254
+ final_stable_ids: string[];
4255
+ rejected_stable_ids: string[];
4256
+ ignored_stable_ids: string[];
4257
+ correlation_id?: string | undefined;
4258
+ session_id?: string | undefined;
4259
+ }>, z.ZodObject<{
4260
+ event_type: z.ZodLiteral<"rule_sections_fetched">;
4261
+ selection_token: z.ZodString;
4262
+ target_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4263
+ requested_sections: z.ZodArray<z.ZodString, "many">;
4264
+ final_stable_ids: z.ZodArray<z.ZodString, "many">;
4265
+ ai_selected_stable_ids: z.ZodArray<z.ZodString, "many">;
4266
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4267
+ kind: z.ZodLiteral<"fabric-event">;
4268
+ id: z.ZodString;
4269
+ ts: z.ZodNumber;
4270
+ schema_version: z.ZodLiteral<1>;
4271
+ correlation_id: z.ZodOptional<z.ZodString>;
4272
+ session_id: z.ZodOptional<z.ZodString>;
4273
+ }, "strip", z.ZodTypeAny, {
4274
+ schema_version: 1;
4275
+ selection_token: string;
4276
+ ai_selected_stable_ids: string[];
4277
+ ts: number;
4278
+ id: string;
4279
+ kind: "fabric-event";
4280
+ event_type: "rule_sections_fetched";
4281
+ final_stable_ids: string[];
4282
+ requested_sections: string[];
4283
+ correlation_id?: string | undefined;
4284
+ session_id?: string | undefined;
4285
+ diagnostics?: unknown[] | undefined;
4286
+ target_paths?: string[] | undefined;
4287
+ }, {
4288
+ schema_version: 1;
4289
+ selection_token: string;
4290
+ ai_selected_stable_ids: string[];
4291
+ ts: number;
4292
+ id: string;
4293
+ kind: "fabric-event";
4294
+ event_type: "rule_sections_fetched";
4295
+ final_stable_ids: string[];
4296
+ requested_sections: string[];
4297
+ correlation_id?: string | undefined;
4298
+ session_id?: string | undefined;
4299
+ diagnostics?: unknown[] | undefined;
4300
+ target_paths?: string[] | undefined;
4301
+ }>, z.ZodObject<{
4302
+ event_type: z.ZodLiteral<"edit_intent_checked">;
4303
+ path: z.ZodString;
4304
+ compliant: z.ZodBoolean;
4305
+ intent: z.ZodString;
4306
+ ledger_entry_id: z.ZodString;
4307
+ ledger_source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
4308
+ commit_sha: z.ZodOptional<z.ZodString>;
4309
+ parent_sha: z.ZodOptional<z.ZodString>;
4310
+ parent_ledger_entry_id: z.ZodOptional<z.ZodString>;
4311
+ diff_stat: z.ZodOptional<z.ZodString>;
4312
+ annotation: z.ZodOptional<z.ZodString>;
4313
+ matched_rule_context_ts: z.ZodNullable<z.ZodNumber>;
4314
+ window_ms: z.ZodNumber;
4315
+ kind: z.ZodLiteral<"fabric-event">;
4316
+ id: z.ZodString;
4317
+ ts: z.ZodNumber;
4318
+ schema_version: z.ZodLiteral<1>;
4319
+ correlation_id: z.ZodOptional<z.ZodString>;
4320
+ session_id: z.ZodOptional<z.ZodString>;
4321
+ }, "strip", z.ZodTypeAny, {
4322
+ path: string;
4323
+ ledger_entry_id: string;
4324
+ schema_version: 1;
4325
+ intent: string;
4326
+ ts: number;
4327
+ id: string;
4328
+ kind: "fabric-event";
4329
+ event_type: "edit_intent_checked";
4330
+ compliant: boolean;
4331
+ matched_rule_context_ts: number | null;
4332
+ window_ms: number;
4333
+ correlation_id?: string | undefined;
4334
+ session_id?: string | undefined;
4335
+ annotation?: string | undefined;
4336
+ commit_sha?: string | undefined;
4337
+ parent_sha?: string | undefined;
4338
+ parent_ledger_entry_id?: string | undefined;
4339
+ diff_stat?: string | undefined;
4340
+ ledger_source?: "ai" | "human" | undefined;
4341
+ }, {
4342
+ path: string;
4343
+ ledger_entry_id: string;
4344
+ schema_version: 1;
4345
+ intent: string;
4346
+ ts: number;
4347
+ id: string;
4348
+ kind: "fabric-event";
4349
+ event_type: "edit_intent_checked";
4350
+ compliant: boolean;
4351
+ matched_rule_context_ts: number | null;
4352
+ window_ms: number;
4353
+ correlation_id?: string | undefined;
4354
+ session_id?: string | undefined;
4355
+ annotation?: string | undefined;
4356
+ commit_sha?: string | undefined;
4357
+ parent_sha?: string | undefined;
4358
+ parent_ledger_entry_id?: string | undefined;
4359
+ diff_stat?: string | undefined;
4360
+ ledger_source?: "ai" | "human" | undefined;
4361
+ }>, z.ZodObject<{
4362
+ event_type: z.ZodLiteral<"rule_drift_detected">;
4363
+ revision: z.ZodOptional<z.ZodString>;
4364
+ drifted_stable_ids: z.ZodArray<z.ZodString, "many">;
4365
+ missing_files: z.ZodArray<z.ZodString, "many">;
4366
+ stale_files: z.ZodArray<z.ZodString, "many">;
4367
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
4368
+ file: z.ZodString;
4369
+ stable_id: z.ZodString;
4370
+ expected_hash: z.ZodString;
4371
+ actual_hash: z.ZodNullable<z.ZodString>;
4372
+ }, "strip", z.ZodTypeAny, {
4373
+ file: string;
4374
+ stable_id: string;
4375
+ expected_hash: string;
4376
+ actual_hash: string | null;
4377
+ }, {
4378
+ file: string;
4379
+ stable_id: string;
4380
+ expected_hash: string;
4381
+ actual_hash: string | null;
4382
+ }>, "many">>;
4383
+ kind: z.ZodLiteral<"fabric-event">;
4384
+ id: z.ZodString;
4385
+ ts: z.ZodNumber;
4386
+ schema_version: z.ZodLiteral<1>;
4387
+ correlation_id: z.ZodOptional<z.ZodString>;
4388
+ session_id: z.ZodOptional<z.ZodString>;
4389
+ }, "strip", z.ZodTypeAny, {
4390
+ schema_version: 1;
4391
+ ts: number;
4392
+ id: string;
4393
+ kind: "fabric-event";
4394
+ event_type: "rule_drift_detected";
4395
+ drifted_stable_ids: string[];
4396
+ missing_files: string[];
4397
+ stale_files: string[];
4398
+ revision?: string | undefined;
4399
+ correlation_id?: string | undefined;
4400
+ session_id?: string | undefined;
4401
+ details?: {
4402
+ file: string;
4403
+ stable_id: string;
4404
+ expected_hash: string;
4405
+ actual_hash: string | null;
4406
+ }[] | undefined;
4407
+ }, {
4408
+ schema_version: 1;
4409
+ ts: number;
4410
+ id: string;
4411
+ kind: "fabric-event";
4412
+ event_type: "rule_drift_detected";
4413
+ drifted_stable_ids: string[];
4414
+ missing_files: string[];
4415
+ stale_files: string[];
4416
+ revision?: string | undefined;
4417
+ correlation_id?: string | undefined;
4418
+ session_id?: string | undefined;
4419
+ details?: {
4420
+ file: string;
4421
+ stable_id: string;
4422
+ expected_hash: string;
4423
+ actual_hash: string | null;
4424
+ }[] | undefined;
4425
+ }>, z.ZodObject<{
4426
+ event_type: z.ZodLiteral<"rule_baseline_accepted">;
4427
+ revision: z.ZodString;
4428
+ previous_revision: z.ZodOptional<z.ZodString>;
4429
+ accepted_stable_ids: z.ZodArray<z.ZodString, "many">;
4430
+ source: z.ZodOptional<z.ZodEnum<["doctor_fix", "sync_meta"]>>;
4431
+ kind: z.ZodLiteral<"fabric-event">;
4432
+ id: z.ZodString;
4433
+ ts: z.ZodNumber;
4434
+ schema_version: z.ZodLiteral<1>;
4435
+ correlation_id: z.ZodOptional<z.ZodString>;
4436
+ session_id: z.ZodOptional<z.ZodString>;
4437
+ }, "strip", z.ZodTypeAny, {
4438
+ revision: string;
4439
+ schema_version: 1;
4440
+ ts: number;
4441
+ id: string;
4442
+ kind: "fabric-event";
4443
+ event_type: "rule_baseline_accepted";
4444
+ accepted_stable_ids: string[];
4445
+ previous_revision?: string | undefined;
4446
+ correlation_id?: string | undefined;
4447
+ session_id?: string | undefined;
4448
+ source?: "doctor_fix" | "sync_meta" | undefined;
4449
+ }, {
4450
+ revision: string;
4451
+ schema_version: 1;
4452
+ ts: number;
4453
+ id: string;
4454
+ kind: "fabric-event";
4455
+ event_type: "rule_baseline_accepted";
4456
+ accepted_stable_ids: string[];
4457
+ previous_revision?: string | undefined;
4458
+ correlation_id?: string | undefined;
4459
+ session_id?: string | undefined;
4460
+ source?: "doctor_fix" | "sync_meta" | undefined;
4461
+ }>, z.ZodObject<{
4462
+ event_type: z.ZodLiteral<"baseline_synced">;
4463
+ revision: z.ZodString;
4464
+ previous_revision: z.ZodOptional<z.ZodString>;
4465
+ synced_files: z.ZodArray<z.ZodString, "many">;
4466
+ accepted_stable_ids: z.ZodArray<z.ZodString, "many">;
4467
+ source: z.ZodEnum<["doctor_fix", "sync_meta"]>;
4468
+ kind: z.ZodLiteral<"fabric-event">;
4469
+ id: z.ZodString;
4470
+ ts: z.ZodNumber;
4471
+ schema_version: z.ZodLiteral<1>;
4472
+ correlation_id: z.ZodOptional<z.ZodString>;
4473
+ session_id: z.ZodOptional<z.ZodString>;
4474
+ }, "strip", z.ZodTypeAny, {
4475
+ revision: string;
4476
+ schema_version: 1;
4477
+ source: "doctor_fix" | "sync_meta";
4478
+ ts: number;
4479
+ id: string;
4480
+ kind: "fabric-event";
4481
+ event_type: "baseline_synced";
4482
+ accepted_stable_ids: string[];
4483
+ synced_files: string[];
4484
+ previous_revision?: string | undefined;
4485
+ correlation_id?: string | undefined;
4486
+ session_id?: string | undefined;
4487
+ }, {
4488
+ revision: string;
4489
+ schema_version: 1;
4490
+ source: "doctor_fix" | "sync_meta";
4491
+ ts: number;
4492
+ id: string;
4493
+ kind: "fabric-event";
4494
+ event_type: "baseline_synced";
4495
+ accepted_stable_ids: string[];
4496
+ synced_files: string[];
4497
+ previous_revision?: string | undefined;
4498
+ correlation_id?: string | undefined;
4499
+ session_id?: string | undefined;
4500
+ }>, z.ZodObject<{
4501
+ event_type: z.ZodLiteral<"mcp_event">;
4502
+ mcp_event_id: z.ZodString;
4503
+ stream_id: z.ZodString;
4504
+ message: z.ZodUnknown;
4505
+ kind: z.ZodLiteral<"fabric-event">;
4506
+ id: z.ZodString;
4507
+ ts: z.ZodNumber;
4508
+ schema_version: z.ZodLiteral<1>;
4509
+ correlation_id: z.ZodOptional<z.ZodString>;
4510
+ session_id: z.ZodOptional<z.ZodString>;
4511
+ }, "strip", z.ZodTypeAny, {
4512
+ schema_version: 1;
4513
+ ts: number;
4514
+ id: string;
4515
+ kind: "fabric-event";
4516
+ event_type: "mcp_event";
4517
+ mcp_event_id: string;
4518
+ stream_id: string;
4519
+ message?: unknown;
4520
+ correlation_id?: string | undefined;
4521
+ session_id?: string | undefined;
4522
+ }, {
4523
+ schema_version: 1;
4524
+ ts: number;
4525
+ id: string;
4526
+ kind: "fabric-event";
4527
+ event_type: "mcp_event";
4528
+ mcp_event_id: string;
4529
+ stream_id: string;
4530
+ message?: unknown;
4531
+ correlation_id?: string | undefined;
4532
+ session_id?: string | undefined;
4533
+ }>, z.ZodObject<{
4534
+ event_type: z.ZodLiteral<"reapply_completed">;
4535
+ preserved_ledger: z.ZodBoolean;
4536
+ preserved_meta: z.ZodBoolean;
4537
+ rules_count: z.ZodNumber;
4538
+ kind: z.ZodLiteral<"fabric-event">;
4539
+ id: z.ZodString;
4540
+ ts: z.ZodNumber;
4541
+ schema_version: z.ZodLiteral<1>;
4542
+ correlation_id: z.ZodOptional<z.ZodString>;
4543
+ session_id: z.ZodOptional<z.ZodString>;
4544
+ }, "strip", z.ZodTypeAny, {
4545
+ schema_version: 1;
4546
+ ts: number;
4547
+ id: string;
4548
+ kind: "fabric-event";
4549
+ event_type: "reapply_completed";
4550
+ preserved_ledger: boolean;
4551
+ preserved_meta: boolean;
4552
+ rules_count: number;
4553
+ correlation_id?: string | undefined;
4554
+ session_id?: string | undefined;
4555
+ }, {
4556
+ schema_version: 1;
4557
+ ts: number;
4558
+ id: string;
4559
+ kind: "fabric-event";
4560
+ event_type: "reapply_completed";
4561
+ preserved_ledger: boolean;
4562
+ preserved_meta: boolean;
4563
+ rules_count: number;
4564
+ correlation_id?: string | undefined;
4565
+ session_id?: string | undefined;
4566
+ }>, z.ZodObject<{
4567
+ event_type: z.ZodLiteral<"event_ledger_truncated">;
4568
+ byte_offset: z.ZodNumber;
4569
+ byte_length: z.ZodNumber;
4570
+ corrupted_path: z.ZodString;
4571
+ kind: z.ZodLiteral<"fabric-event">;
4572
+ id: z.ZodString;
4573
+ ts: z.ZodNumber;
4574
+ schema_version: z.ZodLiteral<1>;
4575
+ correlation_id: z.ZodOptional<z.ZodString>;
4576
+ session_id: z.ZodOptional<z.ZodString>;
4577
+ }, "strip", z.ZodTypeAny, {
4578
+ schema_version: 1;
4579
+ ts: number;
4580
+ id: string;
4581
+ kind: "fabric-event";
4582
+ event_type: "event_ledger_truncated";
4583
+ byte_offset: number;
4584
+ byte_length: number;
4585
+ corrupted_path: string;
4586
+ correlation_id?: string | undefined;
4587
+ session_id?: string | undefined;
4588
+ }, {
4589
+ schema_version: 1;
4590
+ ts: number;
4591
+ id: string;
4592
+ kind: "fabric-event";
4593
+ event_type: "event_ledger_truncated";
4594
+ byte_offset: number;
4595
+ byte_length: number;
4596
+ corrupted_path: string;
4597
+ correlation_id?: string | undefined;
4598
+ session_id?: string | undefined;
4599
+ }>, z.ZodObject<{
4600
+ event_type: z.ZodLiteral<"mcp_config_migrated">;
4601
+ source: z.ZodLiteral<"doctor_fix">;
4602
+ removed_from: z.ZodString;
4603
+ kind: z.ZodLiteral<"fabric-event">;
4604
+ id: z.ZodString;
4605
+ ts: z.ZodNumber;
4606
+ schema_version: z.ZodLiteral<1>;
4607
+ correlation_id: z.ZodOptional<z.ZodString>;
4608
+ session_id: z.ZodOptional<z.ZodString>;
4609
+ }, "strip", z.ZodTypeAny, {
4610
+ schema_version: 1;
4611
+ source: "doctor_fix";
4612
+ ts: number;
4613
+ id: string;
4614
+ kind: "fabric-event";
4615
+ event_type: "mcp_config_migrated";
4616
+ removed_from: string;
4617
+ correlation_id?: string | undefined;
4618
+ session_id?: string | undefined;
4619
+ }, {
4620
+ schema_version: 1;
4621
+ source: "doctor_fix";
4622
+ ts: number;
4623
+ id: string;
4624
+ kind: "fabric-event";
4625
+ event_type: "mcp_config_migrated";
4626
+ removed_from: string;
4627
+ correlation_id?: string | undefined;
4628
+ session_id?: string | undefined;
4629
+ }>, z.ZodObject<{
4630
+ event_type: z.ZodLiteral<"meta_reconciled_on_startup">;
4631
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
4632
+ duration_ms: z.ZodNumber;
4633
+ source: z.ZodLiteral<"reconcileRules">;
4634
+ kind: z.ZodLiteral<"fabric-event">;
4635
+ id: z.ZodString;
4636
+ ts: z.ZodNumber;
4637
+ schema_version: z.ZodLiteral<1>;
4638
+ correlation_id: z.ZodOptional<z.ZodString>;
4639
+ session_id: z.ZodOptional<z.ZodString>;
4640
+ }, "strip", z.ZodTypeAny, {
4641
+ schema_version: 1;
4642
+ source: "reconcileRules";
4643
+ ts: number;
4644
+ id: string;
4645
+ kind: "fabric-event";
4646
+ event_type: "meta_reconciled_on_startup";
4647
+ reconciled_files: string[];
4648
+ duration_ms: number;
4649
+ correlation_id?: string | undefined;
4650
+ session_id?: string | undefined;
4651
+ }, {
4652
+ schema_version: 1;
4653
+ source: "reconcileRules";
4654
+ ts: number;
4655
+ id: string;
4656
+ kind: "fabric-event";
4657
+ event_type: "meta_reconciled_on_startup";
4658
+ reconciled_files: string[];
4659
+ duration_ms: number;
4660
+ correlation_id?: string | undefined;
4661
+ session_id?: string | undefined;
4662
+ }>, z.ZodObject<{
4663
+ event_type: z.ZodLiteral<"meta_reconciled">;
4664
+ reconciled_files: z.ZodArray<z.ZodString, "many">;
4665
+ duration_ms: z.ZodNumber;
4666
+ trigger: z.ZodEnum<["doctor", "manual"]>;
4667
+ source: z.ZodLiteral<"reconcileRules">;
4668
+ kind: z.ZodLiteral<"fabric-event">;
4669
+ id: z.ZodString;
4670
+ ts: z.ZodNumber;
4671
+ schema_version: z.ZodLiteral<1>;
4672
+ correlation_id: z.ZodOptional<z.ZodString>;
4673
+ session_id: z.ZodOptional<z.ZodString>;
4674
+ }, "strip", z.ZodTypeAny, {
4675
+ schema_version: 1;
4676
+ source: "reconcileRules";
4677
+ ts: number;
4678
+ id: string;
4679
+ kind: "fabric-event";
4680
+ event_type: "meta_reconciled";
4681
+ reconciled_files: string[];
4682
+ duration_ms: number;
4683
+ trigger: "manual" | "doctor";
4684
+ correlation_id?: string | undefined;
4685
+ session_id?: string | undefined;
4686
+ }, {
4687
+ schema_version: 1;
4688
+ source: "reconcileRules";
4689
+ ts: number;
4690
+ id: string;
4691
+ kind: "fabric-event";
4692
+ event_type: "meta_reconciled";
4693
+ reconciled_files: string[];
4694
+ duration_ms: number;
4695
+ trigger: "manual" | "doctor";
4696
+ correlation_id?: string | undefined;
4697
+ session_id?: string | undefined;
4698
+ }>, z.ZodObject<{
4699
+ event_type: z.ZodLiteral<"claude_skill_path_migrated">;
4700
+ from: z.ZodString;
4701
+ to: z.ZodString;
4702
+ kind: z.ZodLiteral<"fabric-event">;
4703
+ id: z.ZodString;
4704
+ ts: z.ZodNumber;
4705
+ schema_version: z.ZodLiteral<1>;
4706
+ correlation_id: z.ZodOptional<z.ZodString>;
4707
+ session_id: z.ZodOptional<z.ZodString>;
4708
+ }, "strip", z.ZodTypeAny, {
4709
+ schema_version: 1;
4710
+ ts: number;
4711
+ id: string;
4712
+ kind: "fabric-event";
4713
+ event_type: "claude_skill_path_migrated";
4714
+ from: string;
4715
+ to: string;
4716
+ correlation_id?: string | undefined;
4717
+ session_id?: string | undefined;
4718
+ }, {
4719
+ schema_version: 1;
4720
+ ts: number;
4721
+ id: string;
4722
+ kind: "fabric-event";
4723
+ event_type: "claude_skill_path_migrated";
4724
+ from: string;
4725
+ to: string;
4726
+ correlation_id?: string | undefined;
4727
+ session_id?: string | undefined;
4728
+ }>, z.ZodObject<{
4729
+ event_type: z.ZodLiteral<"legacy_client_path_present">;
4730
+ removed: z.ZodArray<z.ZodString, "many">;
4731
+ kind: z.ZodLiteral<"fabric-event">;
4732
+ id: z.ZodString;
4733
+ ts: z.ZodNumber;
4734
+ schema_version: z.ZodLiteral<1>;
4735
+ correlation_id: z.ZodOptional<z.ZodString>;
4736
+ session_id: z.ZodOptional<z.ZodString>;
4737
+ }, "strip", z.ZodTypeAny, {
4738
+ schema_version: 1;
4739
+ ts: number;
4740
+ id: string;
4741
+ kind: "fabric-event";
4742
+ event_type: "legacy_client_path_present";
4743
+ removed: string[];
4744
+ correlation_id?: string | undefined;
4745
+ session_id?: string | undefined;
4746
+ }, {
4747
+ schema_version: 1;
4748
+ ts: number;
4749
+ id: string;
4750
+ kind: "fabric-event";
4751
+ event_type: "legacy_client_path_present";
4752
+ removed: string[];
4753
+ correlation_id?: string | undefined;
4754
+ session_id?: string | undefined;
4755
+ }>]>;
4756
+ type RuleContextPlannedEvent = z.infer<typeof ruleContextPlannedEventSchema>;
4757
+ type RuleSelectionEvent = z.infer<typeof ruleSelectionEventSchema>;
4758
+ type RuleSectionsFetchedEvent = z.infer<typeof ruleSectionsFetchedEventSchema>;
4759
+ type EditIntentCheckedEvent = z.infer<typeof editIntentCheckedEventSchema>;
4760
+ type RuleDriftDetectedEvent = z.infer<typeof ruleDriftDetectedEventSchema>;
4761
+ type RuleBaselineAcceptedEvent = z.infer<typeof ruleBaselineAcceptedEventSchema>;
4762
+ type BaselineSyncedEvent = z.infer<typeof baselineSyncedEventSchema>;
4763
+ type McpEventLedgerEvent = z.infer<typeof mcpEventLedgerEventSchema>;
4764
+ type ReapplyCompletedEvent = z.infer<typeof reapplyCompletedEventSchema>;
4765
+ type EventLedgerTruncatedEvent = z.infer<typeof eventLedgerTruncatedEventSchema>;
4766
+ type McpConfigMigratedEvent = z.infer<typeof mcpConfigMigratedEventSchema>;
4767
+ type MetaReconciledOnStartupEvent = z.infer<typeof metaReconciledOnStartupEventSchema>;
4768
+ type MetaReconciledEvent = z.infer<typeof metaReconciledEventSchema>;
4769
+ type ClaudeSkillPathMigratedEvent = z.infer<typeof claudeSkillPathMigratedEventSchema>;
4770
+ type LegacyClientPathPresentEvent = z.infer<typeof legacyClientPathPresentEventSchema>;
4771
+ type EventLedgerEvent = RuleContextPlannedEvent | RuleSelectionEvent | RuleSectionsFetchedEvent | EditIntentCheckedEvent | RuleDriftDetectedEvent | RuleBaselineAcceptedEvent | BaselineSyncedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | LegacyClientPathPresentEvent;
4772
+ type EventLedgerEventType = EventLedgerEvent["event_type"];
4773
+ 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;
4774
+ type EventLedgerEventInput = EventLedgerEventInputFor<EventLedgerEvent>;
4775
+
4776
+ export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, AgentsMetaNode, AgentsTopologyType, type BaselineSyncedEvent, type CandidateFileEntry, type CandidateFileFamily, type ClaudeSkillPathMigratedEvent, 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 LedgerAppendedEvent, LedgerEntry, type LegacyClientPathPresentEvent, type LockApprovedEvent, type LockDriftEvent, type McpConfigMigratedEvent, type McpEventLedgerEvent, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, RULE_TEST_INDEX_SCHEMA_VERSION, type ReapplyCompletedEvent, type RuleBaselineAcceptedEvent, type RuleContextPlannedEvent, type RuleDriftDetectedEvent, type RuleSectionsFetchedEvent, type RuleSelectionEvent, type RuleTestIndex, type RuleTestLink, type RuleTestOrphanAnnotation, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, auditModeSchema, baselineSyncedEventSchema, candidateFileEntrySchema, claudeSkillPathMigratedEventSchema, clientPathsSchema, 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, ledgerAppendedEventSchema, ledgerEntrySchema, legacyClientPathPresentEventSchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpPayloadLimitsSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, reapplyCompletedEventSchema, ruleBaselineAcceptedEventSchema, ruleContextPlannedEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, ruleDriftDetectedEventSchema, ruleSectionsFetchedEventSchema, ruleSelectionEventSchema, ruleTestIndexSchema, ruleTestLinkSchema, ruleTestOrphanAnnotationSchema, withDerivedAgentsMetaNodeDefaults };