@junando/core 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +1456 -5
  2. package/dist/index.js +512 -47
  3. package/package.json +2 -1
package/dist/index.d.ts CHANGED
@@ -183,6 +183,10 @@ declare const AlertClusterSchema: z.ZodObject<{
183
183
  representativeTraceIds: z.ZodArray<z.ZodString, "many">;
184
184
  firstSeenAt: z.ZodString;
185
185
  latencyP99Ms: z.ZodOptional<z.ZodNumber>;
186
+ /** Severity level — can be derived from ALERT_TYPE_LABELS[alertType].severity */
187
+ severity: z.ZodOptional<z.ZodEnum<["critical", "high", "medium", "low"]>>;
188
+ /** Arbitrary key-value labels passed through from alerts */
189
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
186
190
  }, "strip", z.ZodTypeAny, {
187
191
  fingerprint: string;
188
192
  serviceName: string;
@@ -191,7 +195,9 @@ declare const AlertClusterSchema: z.ZodObject<{
191
195
  alertCount: number;
192
196
  representativeTraceIds: string[];
193
197
  firstSeenAt: string;
198
+ labels?: Record<string, string> | undefined;
194
199
  latencyP99Ms?: number | undefined;
200
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
195
201
  }, {
196
202
  fingerprint: string;
197
203
  serviceName: string;
@@ -200,7 +206,9 @@ declare const AlertClusterSchema: z.ZodObject<{
200
206
  alertCount: number;
201
207
  representativeTraceIds: string[];
202
208
  firstSeenAt: string;
209
+ labels?: Record<string, string> | undefined;
203
210
  latencyP99Ms?: number | undefined;
211
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
204
212
  }>;
205
213
  type AlertCluster = z.infer<typeof AlertClusterSchema>;
206
214
 
@@ -234,6 +242,8 @@ declare const IncidentSchema: z.ZodObject<{
234
242
  representativeTraceIds: z.ZodArray<z.ZodString, "many">;
235
243
  firstSeenAt: z.ZodString;
236
244
  latencyP99Ms: z.ZodOptional<z.ZodNumber>;
245
+ severity: z.ZodOptional<z.ZodEnum<["critical", "high", "medium", "low"]>>;
246
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
237
247
  }, "strip", z.ZodTypeAny, {
238
248
  fingerprint: string;
239
249
  serviceName: string;
@@ -242,7 +252,9 @@ declare const IncidentSchema: z.ZodObject<{
242
252
  alertCount: number;
243
253
  representativeTraceIds: string[];
244
254
  firstSeenAt: string;
255
+ labels?: Record<string, string> | undefined;
245
256
  latencyP99Ms?: number | undefined;
257
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
246
258
  }, {
247
259
  fingerprint: string;
248
260
  serviceName: string;
@@ -251,7 +263,9 @@ declare const IncidentSchema: z.ZodObject<{
251
263
  alertCount: number;
252
264
  representativeTraceIds: string[];
253
265
  firstSeenAt: string;
266
+ labels?: Record<string, string> | undefined;
254
267
  latencyP99Ms?: number | undefined;
268
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
255
269
  }>;
256
270
  traces: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
257
271
  analysis: z.ZodOptional<z.ZodObject<{
@@ -283,7 +297,9 @@ declare const IncidentSchema: z.ZodObject<{
283
297
  alertCount: number;
284
298
  representativeTraceIds: string[];
285
299
  firstSeenAt: string;
300
+ labels?: Record<string, string> | undefined;
286
301
  latencyP99Ms?: number | undefined;
302
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
287
303
  };
288
304
  processedAt: string;
289
305
  traces?: Record<string, unknown>[] | undefined;
@@ -303,7 +319,9 @@ declare const IncidentSchema: z.ZodObject<{
303
319
  alertCount: number;
304
320
  representativeTraceIds: string[];
305
321
  firstSeenAt: string;
322
+ labels?: Record<string, string> | undefined;
306
323
  latencyP99Ms?: number | undefined;
324
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
307
325
  };
308
326
  processedAt: string;
309
327
  traces?: Record<string, unknown>[] | undefined;
@@ -319,6 +337,1288 @@ type UrgencyLevel = z.infer<typeof UrgencyLevelSchema>;
319
337
  type LLMAnalysis = z.infer<typeof LLMAnalysisSchema>;
320
338
  type Incident = z.infer<typeof IncidentSchema>;
321
339
 
340
+ declare enum RuleActionType {
341
+ Suppress = "suppress",
342
+ Route = "route",
343
+ Escalate = "escalate",
344
+ Tag = "tag"
345
+ }
346
+ declare enum SeverityLevel {
347
+ Critical = "critical",
348
+ High = "high",
349
+ Medium = "medium",
350
+ Low = "low"
351
+ }
352
+ /** Rule evaluation points in the pipeline */
353
+ declare enum RuleEvaluationPhase {
354
+ PreLlm = "pre-llm",
355
+ PostLlm = "post-llm"
356
+ }
357
+ interface RuleCondition {
358
+ serviceName?: string;
359
+ alertType?: AlertType;
360
+ severity?: SeverityLevel;
361
+ labels?: Record<string, string>;
362
+ endpointPath?: string;
363
+ alertCount?: {
364
+ min?: number;
365
+ max?: number;
366
+ };
367
+ latencyP99Ms?: {
368
+ min?: number;
369
+ max?: number;
370
+ };
371
+ /** POST-LLM only (analysis must be present) */
372
+ urgencyLevel?: z.infer<typeof UrgencyLevelSchema>;
373
+ requiresRollback?: boolean;
374
+ impactedServices?: string[];
375
+ }
376
+ declare const RuleConditionSchema: z.ZodObject<{
377
+ serviceName: z.ZodOptional<z.ZodString>;
378
+ alertType: z.ZodOptional<z.ZodNativeEnum<typeof AlertType>>;
379
+ severity: z.ZodOptional<z.ZodNativeEnum<typeof SeverityLevel>>;
380
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
381
+ endpointPath: z.ZodOptional<z.ZodString>;
382
+ alertCount: z.ZodOptional<z.ZodObject<{
383
+ min: z.ZodOptional<z.ZodNumber>;
384
+ max: z.ZodOptional<z.ZodNumber>;
385
+ }, "strip", z.ZodTypeAny, {
386
+ min?: number | undefined;
387
+ max?: number | undefined;
388
+ }, {
389
+ min?: number | undefined;
390
+ max?: number | undefined;
391
+ }>>;
392
+ latencyP99Ms: z.ZodOptional<z.ZodObject<{
393
+ min: z.ZodOptional<z.ZodNumber>;
394
+ max: z.ZodOptional<z.ZodNumber>;
395
+ }, "strip", z.ZodTypeAny, {
396
+ min?: number | undefined;
397
+ max?: number | undefined;
398
+ }, {
399
+ min?: number | undefined;
400
+ max?: number | undefined;
401
+ }>>;
402
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
403
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
404
+ impactedServices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ serviceName?: string | undefined;
407
+ alertType?: AlertType | undefined;
408
+ endpointPath?: string | undefined;
409
+ labels?: Record<string, string> | undefined;
410
+ alertCount?: {
411
+ min?: number | undefined;
412
+ max?: number | undefined;
413
+ } | undefined;
414
+ latencyP99Ms?: {
415
+ min?: number | undefined;
416
+ max?: number | undefined;
417
+ } | undefined;
418
+ severity?: SeverityLevel | undefined;
419
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
420
+ requiresRollback?: boolean | undefined;
421
+ impactedServices?: string[] | undefined;
422
+ }, {
423
+ serviceName?: string | undefined;
424
+ alertType?: AlertType | undefined;
425
+ endpointPath?: string | undefined;
426
+ labels?: Record<string, string> | undefined;
427
+ alertCount?: {
428
+ min?: number | undefined;
429
+ max?: number | undefined;
430
+ } | undefined;
431
+ latencyP99Ms?: {
432
+ min?: number | undefined;
433
+ max?: number | undefined;
434
+ } | undefined;
435
+ severity?: SeverityLevel | undefined;
436
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
437
+ requiresRollback?: boolean | undefined;
438
+ impactedServices?: string[] | undefined;
439
+ }>;
440
+ type RuleAction = {
441
+ type: RuleActionType.Suppress;
442
+ } | {
443
+ type: RuleActionType.Route;
444
+ channel: string;
445
+ } | {
446
+ type: RuleActionType.Escalate;
447
+ channel: string;
448
+ } | {
449
+ type: RuleActionType.Tag;
450
+ key: string;
451
+ value: string;
452
+ };
453
+ declare const RuleActionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
454
+ type: z.ZodLiteral<RuleActionType.Suppress>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ type: RuleActionType.Suppress;
457
+ }, {
458
+ type: RuleActionType.Suppress;
459
+ }>, z.ZodObject<{
460
+ type: z.ZodLiteral<RuleActionType.Route>;
461
+ channel: z.ZodString;
462
+ }, "strip", z.ZodTypeAny, {
463
+ type: RuleActionType.Route;
464
+ channel: string;
465
+ }, {
466
+ type: RuleActionType.Route;
467
+ channel: string;
468
+ }>, z.ZodObject<{
469
+ type: z.ZodLiteral<RuleActionType.Escalate>;
470
+ channel: z.ZodString;
471
+ }, "strip", z.ZodTypeAny, {
472
+ type: RuleActionType.Escalate;
473
+ channel: string;
474
+ }, {
475
+ type: RuleActionType.Escalate;
476
+ channel: string;
477
+ }>, z.ZodObject<{
478
+ type: z.ZodLiteral<RuleActionType.Tag>;
479
+ key: z.ZodString;
480
+ value: z.ZodString;
481
+ }, "strip", z.ZodTypeAny, {
482
+ value: string;
483
+ type: RuleActionType.Tag;
484
+ key: string;
485
+ }, {
486
+ value: string;
487
+ type: RuleActionType.Tag;
488
+ key: string;
489
+ }>]>;
490
+ interface Rule {
491
+ id: string;
492
+ name?: string;
493
+ condition: RuleCondition;
494
+ actions: RuleAction[];
495
+ /** POST-LLM only (can only be used in post-llm section) */
496
+ urgencyLevel?: z.infer<typeof UrgencyLevelSchema>;
497
+ requiresRollback?: boolean;
498
+ }
499
+ declare const RuleSchema: z.ZodObject<{
500
+ id: z.ZodString;
501
+ name: z.ZodOptional<z.ZodString>;
502
+ condition: z.ZodObject<{
503
+ serviceName: z.ZodOptional<z.ZodString>;
504
+ alertType: z.ZodOptional<z.ZodNativeEnum<typeof AlertType>>;
505
+ severity: z.ZodOptional<z.ZodNativeEnum<typeof SeverityLevel>>;
506
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
507
+ endpointPath: z.ZodOptional<z.ZodString>;
508
+ alertCount: z.ZodOptional<z.ZodObject<{
509
+ min: z.ZodOptional<z.ZodNumber>;
510
+ max: z.ZodOptional<z.ZodNumber>;
511
+ }, "strip", z.ZodTypeAny, {
512
+ min?: number | undefined;
513
+ max?: number | undefined;
514
+ }, {
515
+ min?: number | undefined;
516
+ max?: number | undefined;
517
+ }>>;
518
+ latencyP99Ms: z.ZodOptional<z.ZodObject<{
519
+ min: z.ZodOptional<z.ZodNumber>;
520
+ max: z.ZodOptional<z.ZodNumber>;
521
+ }, "strip", z.ZodTypeAny, {
522
+ min?: number | undefined;
523
+ max?: number | undefined;
524
+ }, {
525
+ min?: number | undefined;
526
+ max?: number | undefined;
527
+ }>>;
528
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
529
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
530
+ impactedServices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
531
+ }, "strip", z.ZodTypeAny, {
532
+ serviceName?: string | undefined;
533
+ alertType?: AlertType | undefined;
534
+ endpointPath?: string | undefined;
535
+ labels?: Record<string, string> | undefined;
536
+ alertCount?: {
537
+ min?: number | undefined;
538
+ max?: number | undefined;
539
+ } | undefined;
540
+ latencyP99Ms?: {
541
+ min?: number | undefined;
542
+ max?: number | undefined;
543
+ } | undefined;
544
+ severity?: SeverityLevel | undefined;
545
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
546
+ requiresRollback?: boolean | undefined;
547
+ impactedServices?: string[] | undefined;
548
+ }, {
549
+ serviceName?: string | undefined;
550
+ alertType?: AlertType | undefined;
551
+ endpointPath?: string | undefined;
552
+ labels?: Record<string, string> | undefined;
553
+ alertCount?: {
554
+ min?: number | undefined;
555
+ max?: number | undefined;
556
+ } | undefined;
557
+ latencyP99Ms?: {
558
+ min?: number | undefined;
559
+ max?: number | undefined;
560
+ } | undefined;
561
+ severity?: SeverityLevel | undefined;
562
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
563
+ requiresRollback?: boolean | undefined;
564
+ impactedServices?: string[] | undefined;
565
+ }>;
566
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
567
+ type: z.ZodLiteral<RuleActionType.Suppress>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ type: RuleActionType.Suppress;
570
+ }, {
571
+ type: RuleActionType.Suppress;
572
+ }>, z.ZodObject<{
573
+ type: z.ZodLiteral<RuleActionType.Route>;
574
+ channel: z.ZodString;
575
+ }, "strip", z.ZodTypeAny, {
576
+ type: RuleActionType.Route;
577
+ channel: string;
578
+ }, {
579
+ type: RuleActionType.Route;
580
+ channel: string;
581
+ }>, z.ZodObject<{
582
+ type: z.ZodLiteral<RuleActionType.Escalate>;
583
+ channel: z.ZodString;
584
+ }, "strip", z.ZodTypeAny, {
585
+ type: RuleActionType.Escalate;
586
+ channel: string;
587
+ }, {
588
+ type: RuleActionType.Escalate;
589
+ channel: string;
590
+ }>, z.ZodObject<{
591
+ type: z.ZodLiteral<RuleActionType.Tag>;
592
+ key: z.ZodString;
593
+ value: z.ZodString;
594
+ }, "strip", z.ZodTypeAny, {
595
+ value: string;
596
+ type: RuleActionType.Tag;
597
+ key: string;
598
+ }, {
599
+ value: string;
600
+ type: RuleActionType.Tag;
601
+ key: string;
602
+ }>]>, "many">;
603
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
604
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
605
+ }, "strip", z.ZodTypeAny, {
606
+ id: string;
607
+ condition: {
608
+ serviceName?: string | undefined;
609
+ alertType?: AlertType | undefined;
610
+ endpointPath?: string | undefined;
611
+ labels?: Record<string, string> | undefined;
612
+ alertCount?: {
613
+ min?: number | undefined;
614
+ max?: number | undefined;
615
+ } | undefined;
616
+ latencyP99Ms?: {
617
+ min?: number | undefined;
618
+ max?: number | undefined;
619
+ } | undefined;
620
+ severity?: SeverityLevel | undefined;
621
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
622
+ requiresRollback?: boolean | undefined;
623
+ impactedServices?: string[] | undefined;
624
+ };
625
+ actions: ({
626
+ type: RuleActionType.Suppress;
627
+ } | {
628
+ type: RuleActionType.Route;
629
+ channel: string;
630
+ } | {
631
+ type: RuleActionType.Escalate;
632
+ channel: string;
633
+ } | {
634
+ value: string;
635
+ type: RuleActionType.Tag;
636
+ key: string;
637
+ })[];
638
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
639
+ requiresRollback?: boolean | undefined;
640
+ name?: string | undefined;
641
+ }, {
642
+ id: string;
643
+ condition: {
644
+ serviceName?: string | undefined;
645
+ alertType?: AlertType | undefined;
646
+ endpointPath?: string | undefined;
647
+ labels?: Record<string, string> | undefined;
648
+ alertCount?: {
649
+ min?: number | undefined;
650
+ max?: number | undefined;
651
+ } | undefined;
652
+ latencyP99Ms?: {
653
+ min?: number | undefined;
654
+ max?: number | undefined;
655
+ } | undefined;
656
+ severity?: SeverityLevel | undefined;
657
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
658
+ requiresRollback?: boolean | undefined;
659
+ impactedServices?: string[] | undefined;
660
+ };
661
+ actions: ({
662
+ type: RuleActionType.Suppress;
663
+ } | {
664
+ type: RuleActionType.Route;
665
+ channel: string;
666
+ } | {
667
+ type: RuleActionType.Escalate;
668
+ channel: string;
669
+ } | {
670
+ value: string;
671
+ type: RuleActionType.Tag;
672
+ key: string;
673
+ })[];
674
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
675
+ requiresRollback?: boolean | undefined;
676
+ name?: string | undefined;
677
+ }>;
678
+ interface RuleSection {
679
+ rules: Rule[];
680
+ }
681
+ declare const RuleSectionSchema: z.ZodObject<{
682
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
683
+ id: z.ZodString;
684
+ name: z.ZodOptional<z.ZodString>;
685
+ condition: z.ZodObject<{
686
+ serviceName: z.ZodOptional<z.ZodString>;
687
+ alertType: z.ZodOptional<z.ZodNativeEnum<typeof AlertType>>;
688
+ severity: z.ZodOptional<z.ZodNativeEnum<typeof SeverityLevel>>;
689
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
690
+ endpointPath: z.ZodOptional<z.ZodString>;
691
+ alertCount: z.ZodOptional<z.ZodObject<{
692
+ min: z.ZodOptional<z.ZodNumber>;
693
+ max: z.ZodOptional<z.ZodNumber>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ min?: number | undefined;
696
+ max?: number | undefined;
697
+ }, {
698
+ min?: number | undefined;
699
+ max?: number | undefined;
700
+ }>>;
701
+ latencyP99Ms: z.ZodOptional<z.ZodObject<{
702
+ min: z.ZodOptional<z.ZodNumber>;
703
+ max: z.ZodOptional<z.ZodNumber>;
704
+ }, "strip", z.ZodTypeAny, {
705
+ min?: number | undefined;
706
+ max?: number | undefined;
707
+ }, {
708
+ min?: number | undefined;
709
+ max?: number | undefined;
710
+ }>>;
711
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
712
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
713
+ impactedServices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
714
+ }, "strip", z.ZodTypeAny, {
715
+ serviceName?: string | undefined;
716
+ alertType?: AlertType | undefined;
717
+ endpointPath?: string | undefined;
718
+ labels?: Record<string, string> | undefined;
719
+ alertCount?: {
720
+ min?: number | undefined;
721
+ max?: number | undefined;
722
+ } | undefined;
723
+ latencyP99Ms?: {
724
+ min?: number | undefined;
725
+ max?: number | undefined;
726
+ } | undefined;
727
+ severity?: SeverityLevel | undefined;
728
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
729
+ requiresRollback?: boolean | undefined;
730
+ impactedServices?: string[] | undefined;
731
+ }, {
732
+ serviceName?: string | undefined;
733
+ alertType?: AlertType | undefined;
734
+ endpointPath?: string | undefined;
735
+ labels?: Record<string, string> | undefined;
736
+ alertCount?: {
737
+ min?: number | undefined;
738
+ max?: number | undefined;
739
+ } | undefined;
740
+ latencyP99Ms?: {
741
+ min?: number | undefined;
742
+ max?: number | undefined;
743
+ } | undefined;
744
+ severity?: SeverityLevel | undefined;
745
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
746
+ requiresRollback?: boolean | undefined;
747
+ impactedServices?: string[] | undefined;
748
+ }>;
749
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
750
+ type: z.ZodLiteral<RuleActionType.Suppress>;
751
+ }, "strip", z.ZodTypeAny, {
752
+ type: RuleActionType.Suppress;
753
+ }, {
754
+ type: RuleActionType.Suppress;
755
+ }>, z.ZodObject<{
756
+ type: z.ZodLiteral<RuleActionType.Route>;
757
+ channel: z.ZodString;
758
+ }, "strip", z.ZodTypeAny, {
759
+ type: RuleActionType.Route;
760
+ channel: string;
761
+ }, {
762
+ type: RuleActionType.Route;
763
+ channel: string;
764
+ }>, z.ZodObject<{
765
+ type: z.ZodLiteral<RuleActionType.Escalate>;
766
+ channel: z.ZodString;
767
+ }, "strip", z.ZodTypeAny, {
768
+ type: RuleActionType.Escalate;
769
+ channel: string;
770
+ }, {
771
+ type: RuleActionType.Escalate;
772
+ channel: string;
773
+ }>, z.ZodObject<{
774
+ type: z.ZodLiteral<RuleActionType.Tag>;
775
+ key: z.ZodString;
776
+ value: z.ZodString;
777
+ }, "strip", z.ZodTypeAny, {
778
+ value: string;
779
+ type: RuleActionType.Tag;
780
+ key: string;
781
+ }, {
782
+ value: string;
783
+ type: RuleActionType.Tag;
784
+ key: string;
785
+ }>]>, "many">;
786
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
787
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
788
+ }, "strip", z.ZodTypeAny, {
789
+ id: string;
790
+ condition: {
791
+ serviceName?: string | undefined;
792
+ alertType?: AlertType | undefined;
793
+ endpointPath?: string | undefined;
794
+ labels?: Record<string, string> | undefined;
795
+ alertCount?: {
796
+ min?: number | undefined;
797
+ max?: number | undefined;
798
+ } | undefined;
799
+ latencyP99Ms?: {
800
+ min?: number | undefined;
801
+ max?: number | undefined;
802
+ } | undefined;
803
+ severity?: SeverityLevel | undefined;
804
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
805
+ requiresRollback?: boolean | undefined;
806
+ impactedServices?: string[] | undefined;
807
+ };
808
+ actions: ({
809
+ type: RuleActionType.Suppress;
810
+ } | {
811
+ type: RuleActionType.Route;
812
+ channel: string;
813
+ } | {
814
+ type: RuleActionType.Escalate;
815
+ channel: string;
816
+ } | {
817
+ value: string;
818
+ type: RuleActionType.Tag;
819
+ key: string;
820
+ })[];
821
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
822
+ requiresRollback?: boolean | undefined;
823
+ name?: string | undefined;
824
+ }, {
825
+ id: string;
826
+ condition: {
827
+ serviceName?: string | undefined;
828
+ alertType?: AlertType | undefined;
829
+ endpointPath?: string | undefined;
830
+ labels?: Record<string, string> | undefined;
831
+ alertCount?: {
832
+ min?: number | undefined;
833
+ max?: number | undefined;
834
+ } | undefined;
835
+ latencyP99Ms?: {
836
+ min?: number | undefined;
837
+ max?: number | undefined;
838
+ } | undefined;
839
+ severity?: SeverityLevel | undefined;
840
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
841
+ requiresRollback?: boolean | undefined;
842
+ impactedServices?: string[] | undefined;
843
+ };
844
+ actions: ({
845
+ type: RuleActionType.Suppress;
846
+ } | {
847
+ type: RuleActionType.Route;
848
+ channel: string;
849
+ } | {
850
+ type: RuleActionType.Escalate;
851
+ channel: string;
852
+ } | {
853
+ value: string;
854
+ type: RuleActionType.Tag;
855
+ key: string;
856
+ })[];
857
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
858
+ requiresRollback?: boolean | undefined;
859
+ name?: string | undefined;
860
+ }>, "many">>;
861
+ }, "strip", z.ZodTypeAny, {
862
+ rules: {
863
+ id: string;
864
+ condition: {
865
+ serviceName?: string | undefined;
866
+ alertType?: AlertType | undefined;
867
+ endpointPath?: string | undefined;
868
+ labels?: Record<string, string> | undefined;
869
+ alertCount?: {
870
+ min?: number | undefined;
871
+ max?: number | undefined;
872
+ } | undefined;
873
+ latencyP99Ms?: {
874
+ min?: number | undefined;
875
+ max?: number | undefined;
876
+ } | undefined;
877
+ severity?: SeverityLevel | undefined;
878
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
879
+ requiresRollback?: boolean | undefined;
880
+ impactedServices?: string[] | undefined;
881
+ };
882
+ actions: ({
883
+ type: RuleActionType.Suppress;
884
+ } | {
885
+ type: RuleActionType.Route;
886
+ channel: string;
887
+ } | {
888
+ type: RuleActionType.Escalate;
889
+ channel: string;
890
+ } | {
891
+ value: string;
892
+ type: RuleActionType.Tag;
893
+ key: string;
894
+ })[];
895
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
896
+ requiresRollback?: boolean | undefined;
897
+ name?: string | undefined;
898
+ }[];
899
+ }, {
900
+ rules?: {
901
+ id: string;
902
+ condition: {
903
+ serviceName?: string | undefined;
904
+ alertType?: AlertType | undefined;
905
+ endpointPath?: string | undefined;
906
+ labels?: Record<string, string> | undefined;
907
+ alertCount?: {
908
+ min?: number | undefined;
909
+ max?: number | undefined;
910
+ } | undefined;
911
+ latencyP99Ms?: {
912
+ min?: number | undefined;
913
+ max?: number | undefined;
914
+ } | undefined;
915
+ severity?: SeverityLevel | undefined;
916
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
917
+ requiresRollback?: boolean | undefined;
918
+ impactedServices?: string[] | undefined;
919
+ };
920
+ actions: ({
921
+ type: RuleActionType.Suppress;
922
+ } | {
923
+ type: RuleActionType.Route;
924
+ channel: string;
925
+ } | {
926
+ type: RuleActionType.Escalate;
927
+ channel: string;
928
+ } | {
929
+ value: string;
930
+ type: RuleActionType.Tag;
931
+ key: string;
932
+ })[];
933
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
934
+ requiresRollback?: boolean | undefined;
935
+ name?: string | undefined;
936
+ }[] | undefined;
937
+ }>;
938
+ interface RuleConfiguration {
939
+ [RuleEvaluationPhase.PreLlm]: RuleSection;
940
+ [RuleEvaluationPhase.PostLlm]: RuleSection;
941
+ }
942
+ declare const RuleConfigurationSchema: z.ZodObject<{
943
+ "pre-llm": z.ZodObject<{
944
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
945
+ id: z.ZodString;
946
+ name: z.ZodOptional<z.ZodString>;
947
+ condition: z.ZodObject<{
948
+ serviceName: z.ZodOptional<z.ZodString>;
949
+ alertType: z.ZodOptional<z.ZodNativeEnum<typeof AlertType>>;
950
+ severity: z.ZodOptional<z.ZodNativeEnum<typeof SeverityLevel>>;
951
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
952
+ endpointPath: z.ZodOptional<z.ZodString>;
953
+ alertCount: z.ZodOptional<z.ZodObject<{
954
+ min: z.ZodOptional<z.ZodNumber>;
955
+ max: z.ZodOptional<z.ZodNumber>;
956
+ }, "strip", z.ZodTypeAny, {
957
+ min?: number | undefined;
958
+ max?: number | undefined;
959
+ }, {
960
+ min?: number | undefined;
961
+ max?: number | undefined;
962
+ }>>;
963
+ latencyP99Ms: z.ZodOptional<z.ZodObject<{
964
+ min: z.ZodOptional<z.ZodNumber>;
965
+ max: z.ZodOptional<z.ZodNumber>;
966
+ }, "strip", z.ZodTypeAny, {
967
+ min?: number | undefined;
968
+ max?: number | undefined;
969
+ }, {
970
+ min?: number | undefined;
971
+ max?: number | undefined;
972
+ }>>;
973
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
974
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
975
+ impactedServices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
976
+ }, "strip", z.ZodTypeAny, {
977
+ serviceName?: string | undefined;
978
+ alertType?: AlertType | undefined;
979
+ endpointPath?: string | undefined;
980
+ labels?: Record<string, string> | undefined;
981
+ alertCount?: {
982
+ min?: number | undefined;
983
+ max?: number | undefined;
984
+ } | undefined;
985
+ latencyP99Ms?: {
986
+ min?: number | undefined;
987
+ max?: number | undefined;
988
+ } | undefined;
989
+ severity?: SeverityLevel | undefined;
990
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
991
+ requiresRollback?: boolean | undefined;
992
+ impactedServices?: string[] | undefined;
993
+ }, {
994
+ serviceName?: string | undefined;
995
+ alertType?: AlertType | undefined;
996
+ endpointPath?: string | undefined;
997
+ labels?: Record<string, string> | undefined;
998
+ alertCount?: {
999
+ min?: number | undefined;
1000
+ max?: number | undefined;
1001
+ } | undefined;
1002
+ latencyP99Ms?: {
1003
+ min?: number | undefined;
1004
+ max?: number | undefined;
1005
+ } | undefined;
1006
+ severity?: SeverityLevel | undefined;
1007
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1008
+ requiresRollback?: boolean | undefined;
1009
+ impactedServices?: string[] | undefined;
1010
+ }>;
1011
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1012
+ type: z.ZodLiteral<RuleActionType.Suppress>;
1013
+ }, "strip", z.ZodTypeAny, {
1014
+ type: RuleActionType.Suppress;
1015
+ }, {
1016
+ type: RuleActionType.Suppress;
1017
+ }>, z.ZodObject<{
1018
+ type: z.ZodLiteral<RuleActionType.Route>;
1019
+ channel: z.ZodString;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ type: RuleActionType.Route;
1022
+ channel: string;
1023
+ }, {
1024
+ type: RuleActionType.Route;
1025
+ channel: string;
1026
+ }>, z.ZodObject<{
1027
+ type: z.ZodLiteral<RuleActionType.Escalate>;
1028
+ channel: z.ZodString;
1029
+ }, "strip", z.ZodTypeAny, {
1030
+ type: RuleActionType.Escalate;
1031
+ channel: string;
1032
+ }, {
1033
+ type: RuleActionType.Escalate;
1034
+ channel: string;
1035
+ }>, z.ZodObject<{
1036
+ type: z.ZodLiteral<RuleActionType.Tag>;
1037
+ key: z.ZodString;
1038
+ value: z.ZodString;
1039
+ }, "strip", z.ZodTypeAny, {
1040
+ value: string;
1041
+ type: RuleActionType.Tag;
1042
+ key: string;
1043
+ }, {
1044
+ value: string;
1045
+ type: RuleActionType.Tag;
1046
+ key: string;
1047
+ }>]>, "many">;
1048
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1049
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
1050
+ }, "strip", z.ZodTypeAny, {
1051
+ id: string;
1052
+ condition: {
1053
+ serviceName?: string | undefined;
1054
+ alertType?: AlertType | undefined;
1055
+ endpointPath?: string | undefined;
1056
+ labels?: Record<string, string> | undefined;
1057
+ alertCount?: {
1058
+ min?: number | undefined;
1059
+ max?: number | undefined;
1060
+ } | undefined;
1061
+ latencyP99Ms?: {
1062
+ min?: number | undefined;
1063
+ max?: number | undefined;
1064
+ } | undefined;
1065
+ severity?: SeverityLevel | undefined;
1066
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1067
+ requiresRollback?: boolean | undefined;
1068
+ impactedServices?: string[] | undefined;
1069
+ };
1070
+ actions: ({
1071
+ type: RuleActionType.Suppress;
1072
+ } | {
1073
+ type: RuleActionType.Route;
1074
+ channel: string;
1075
+ } | {
1076
+ type: RuleActionType.Escalate;
1077
+ channel: string;
1078
+ } | {
1079
+ value: string;
1080
+ type: RuleActionType.Tag;
1081
+ key: string;
1082
+ })[];
1083
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1084
+ requiresRollback?: boolean | undefined;
1085
+ name?: string | undefined;
1086
+ }, {
1087
+ id: string;
1088
+ condition: {
1089
+ serviceName?: string | undefined;
1090
+ alertType?: AlertType | undefined;
1091
+ endpointPath?: string | undefined;
1092
+ labels?: Record<string, string> | undefined;
1093
+ alertCount?: {
1094
+ min?: number | undefined;
1095
+ max?: number | undefined;
1096
+ } | undefined;
1097
+ latencyP99Ms?: {
1098
+ min?: number | undefined;
1099
+ max?: number | undefined;
1100
+ } | undefined;
1101
+ severity?: SeverityLevel | undefined;
1102
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1103
+ requiresRollback?: boolean | undefined;
1104
+ impactedServices?: string[] | undefined;
1105
+ };
1106
+ actions: ({
1107
+ type: RuleActionType.Suppress;
1108
+ } | {
1109
+ type: RuleActionType.Route;
1110
+ channel: string;
1111
+ } | {
1112
+ type: RuleActionType.Escalate;
1113
+ channel: string;
1114
+ } | {
1115
+ value: string;
1116
+ type: RuleActionType.Tag;
1117
+ key: string;
1118
+ })[];
1119
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1120
+ requiresRollback?: boolean | undefined;
1121
+ name?: string | undefined;
1122
+ }>, "many">>;
1123
+ }, "strip", z.ZodTypeAny, {
1124
+ rules: {
1125
+ id: string;
1126
+ condition: {
1127
+ serviceName?: string | undefined;
1128
+ alertType?: AlertType | undefined;
1129
+ endpointPath?: string | undefined;
1130
+ labels?: Record<string, string> | undefined;
1131
+ alertCount?: {
1132
+ min?: number | undefined;
1133
+ max?: number | undefined;
1134
+ } | undefined;
1135
+ latencyP99Ms?: {
1136
+ min?: number | undefined;
1137
+ max?: number | undefined;
1138
+ } | undefined;
1139
+ severity?: SeverityLevel | undefined;
1140
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1141
+ requiresRollback?: boolean | undefined;
1142
+ impactedServices?: string[] | undefined;
1143
+ };
1144
+ actions: ({
1145
+ type: RuleActionType.Suppress;
1146
+ } | {
1147
+ type: RuleActionType.Route;
1148
+ channel: string;
1149
+ } | {
1150
+ type: RuleActionType.Escalate;
1151
+ channel: string;
1152
+ } | {
1153
+ value: string;
1154
+ type: RuleActionType.Tag;
1155
+ key: string;
1156
+ })[];
1157
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1158
+ requiresRollback?: boolean | undefined;
1159
+ name?: string | undefined;
1160
+ }[];
1161
+ }, {
1162
+ rules?: {
1163
+ id: string;
1164
+ condition: {
1165
+ serviceName?: string | undefined;
1166
+ alertType?: AlertType | undefined;
1167
+ endpointPath?: string | undefined;
1168
+ labels?: Record<string, string> | undefined;
1169
+ alertCount?: {
1170
+ min?: number | undefined;
1171
+ max?: number | undefined;
1172
+ } | undefined;
1173
+ latencyP99Ms?: {
1174
+ min?: number | undefined;
1175
+ max?: number | undefined;
1176
+ } | undefined;
1177
+ severity?: SeverityLevel | undefined;
1178
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1179
+ requiresRollback?: boolean | undefined;
1180
+ impactedServices?: string[] | undefined;
1181
+ };
1182
+ actions: ({
1183
+ type: RuleActionType.Suppress;
1184
+ } | {
1185
+ type: RuleActionType.Route;
1186
+ channel: string;
1187
+ } | {
1188
+ type: RuleActionType.Escalate;
1189
+ channel: string;
1190
+ } | {
1191
+ value: string;
1192
+ type: RuleActionType.Tag;
1193
+ key: string;
1194
+ })[];
1195
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1196
+ requiresRollback?: boolean | undefined;
1197
+ name?: string | undefined;
1198
+ }[] | undefined;
1199
+ }>;
1200
+ "post-llm": z.ZodObject<{
1201
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
1202
+ id: z.ZodString;
1203
+ name: z.ZodOptional<z.ZodString>;
1204
+ condition: z.ZodObject<{
1205
+ serviceName: z.ZodOptional<z.ZodString>;
1206
+ alertType: z.ZodOptional<z.ZodNativeEnum<typeof AlertType>>;
1207
+ severity: z.ZodOptional<z.ZodNativeEnum<typeof SeverityLevel>>;
1208
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1209
+ endpointPath: z.ZodOptional<z.ZodString>;
1210
+ alertCount: z.ZodOptional<z.ZodObject<{
1211
+ min: z.ZodOptional<z.ZodNumber>;
1212
+ max: z.ZodOptional<z.ZodNumber>;
1213
+ }, "strip", z.ZodTypeAny, {
1214
+ min?: number | undefined;
1215
+ max?: number | undefined;
1216
+ }, {
1217
+ min?: number | undefined;
1218
+ max?: number | undefined;
1219
+ }>>;
1220
+ latencyP99Ms: z.ZodOptional<z.ZodObject<{
1221
+ min: z.ZodOptional<z.ZodNumber>;
1222
+ max: z.ZodOptional<z.ZodNumber>;
1223
+ }, "strip", z.ZodTypeAny, {
1224
+ min?: number | undefined;
1225
+ max?: number | undefined;
1226
+ }, {
1227
+ min?: number | undefined;
1228
+ max?: number | undefined;
1229
+ }>>;
1230
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1231
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
1232
+ impactedServices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1233
+ }, "strip", z.ZodTypeAny, {
1234
+ serviceName?: string | undefined;
1235
+ alertType?: AlertType | undefined;
1236
+ endpointPath?: string | undefined;
1237
+ labels?: Record<string, string> | undefined;
1238
+ alertCount?: {
1239
+ min?: number | undefined;
1240
+ max?: number | undefined;
1241
+ } | undefined;
1242
+ latencyP99Ms?: {
1243
+ min?: number | undefined;
1244
+ max?: number | undefined;
1245
+ } | undefined;
1246
+ severity?: SeverityLevel | undefined;
1247
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1248
+ requiresRollback?: boolean | undefined;
1249
+ impactedServices?: string[] | undefined;
1250
+ }, {
1251
+ serviceName?: string | undefined;
1252
+ alertType?: AlertType | undefined;
1253
+ endpointPath?: string | undefined;
1254
+ labels?: Record<string, string> | undefined;
1255
+ alertCount?: {
1256
+ min?: number | undefined;
1257
+ max?: number | undefined;
1258
+ } | undefined;
1259
+ latencyP99Ms?: {
1260
+ min?: number | undefined;
1261
+ max?: number | undefined;
1262
+ } | undefined;
1263
+ severity?: SeverityLevel | undefined;
1264
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1265
+ requiresRollback?: boolean | undefined;
1266
+ impactedServices?: string[] | undefined;
1267
+ }>;
1268
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1269
+ type: z.ZodLiteral<RuleActionType.Suppress>;
1270
+ }, "strip", z.ZodTypeAny, {
1271
+ type: RuleActionType.Suppress;
1272
+ }, {
1273
+ type: RuleActionType.Suppress;
1274
+ }>, z.ZodObject<{
1275
+ type: z.ZodLiteral<RuleActionType.Route>;
1276
+ channel: z.ZodString;
1277
+ }, "strip", z.ZodTypeAny, {
1278
+ type: RuleActionType.Route;
1279
+ channel: string;
1280
+ }, {
1281
+ type: RuleActionType.Route;
1282
+ channel: string;
1283
+ }>, z.ZodObject<{
1284
+ type: z.ZodLiteral<RuleActionType.Escalate>;
1285
+ channel: z.ZodString;
1286
+ }, "strip", z.ZodTypeAny, {
1287
+ type: RuleActionType.Escalate;
1288
+ channel: string;
1289
+ }, {
1290
+ type: RuleActionType.Escalate;
1291
+ channel: string;
1292
+ }>, z.ZodObject<{
1293
+ type: z.ZodLiteral<RuleActionType.Tag>;
1294
+ key: z.ZodString;
1295
+ value: z.ZodString;
1296
+ }, "strip", z.ZodTypeAny, {
1297
+ value: string;
1298
+ type: RuleActionType.Tag;
1299
+ key: string;
1300
+ }, {
1301
+ value: string;
1302
+ type: RuleActionType.Tag;
1303
+ key: string;
1304
+ }>]>, "many">;
1305
+ urgencyLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1306
+ requiresRollback: z.ZodOptional<z.ZodBoolean>;
1307
+ }, "strip", z.ZodTypeAny, {
1308
+ id: string;
1309
+ condition: {
1310
+ serviceName?: string | undefined;
1311
+ alertType?: AlertType | undefined;
1312
+ endpointPath?: string | undefined;
1313
+ labels?: Record<string, string> | undefined;
1314
+ alertCount?: {
1315
+ min?: number | undefined;
1316
+ max?: number | undefined;
1317
+ } | undefined;
1318
+ latencyP99Ms?: {
1319
+ min?: number | undefined;
1320
+ max?: number | undefined;
1321
+ } | undefined;
1322
+ severity?: SeverityLevel | undefined;
1323
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1324
+ requiresRollback?: boolean | undefined;
1325
+ impactedServices?: string[] | undefined;
1326
+ };
1327
+ actions: ({
1328
+ type: RuleActionType.Suppress;
1329
+ } | {
1330
+ type: RuleActionType.Route;
1331
+ channel: string;
1332
+ } | {
1333
+ type: RuleActionType.Escalate;
1334
+ channel: string;
1335
+ } | {
1336
+ value: string;
1337
+ type: RuleActionType.Tag;
1338
+ key: string;
1339
+ })[];
1340
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1341
+ requiresRollback?: boolean | undefined;
1342
+ name?: string | undefined;
1343
+ }, {
1344
+ id: string;
1345
+ condition: {
1346
+ serviceName?: string | undefined;
1347
+ alertType?: AlertType | undefined;
1348
+ endpointPath?: string | undefined;
1349
+ labels?: Record<string, string> | undefined;
1350
+ alertCount?: {
1351
+ min?: number | undefined;
1352
+ max?: number | undefined;
1353
+ } | undefined;
1354
+ latencyP99Ms?: {
1355
+ min?: number | undefined;
1356
+ max?: number | undefined;
1357
+ } | undefined;
1358
+ severity?: SeverityLevel | undefined;
1359
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1360
+ requiresRollback?: boolean | undefined;
1361
+ impactedServices?: string[] | undefined;
1362
+ };
1363
+ actions: ({
1364
+ type: RuleActionType.Suppress;
1365
+ } | {
1366
+ type: RuleActionType.Route;
1367
+ channel: string;
1368
+ } | {
1369
+ type: RuleActionType.Escalate;
1370
+ channel: string;
1371
+ } | {
1372
+ value: string;
1373
+ type: RuleActionType.Tag;
1374
+ key: string;
1375
+ })[];
1376
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1377
+ requiresRollback?: boolean | undefined;
1378
+ name?: string | undefined;
1379
+ }>, "many">>;
1380
+ }, "strip", z.ZodTypeAny, {
1381
+ rules: {
1382
+ id: string;
1383
+ condition: {
1384
+ serviceName?: string | undefined;
1385
+ alertType?: AlertType | undefined;
1386
+ endpointPath?: string | undefined;
1387
+ labels?: Record<string, string> | undefined;
1388
+ alertCount?: {
1389
+ min?: number | undefined;
1390
+ max?: number | undefined;
1391
+ } | undefined;
1392
+ latencyP99Ms?: {
1393
+ min?: number | undefined;
1394
+ max?: number | undefined;
1395
+ } | undefined;
1396
+ severity?: SeverityLevel | undefined;
1397
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1398
+ requiresRollback?: boolean | undefined;
1399
+ impactedServices?: string[] | undefined;
1400
+ };
1401
+ actions: ({
1402
+ type: RuleActionType.Suppress;
1403
+ } | {
1404
+ type: RuleActionType.Route;
1405
+ channel: string;
1406
+ } | {
1407
+ type: RuleActionType.Escalate;
1408
+ channel: string;
1409
+ } | {
1410
+ value: string;
1411
+ type: RuleActionType.Tag;
1412
+ key: string;
1413
+ })[];
1414
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1415
+ requiresRollback?: boolean | undefined;
1416
+ name?: string | undefined;
1417
+ }[];
1418
+ }, {
1419
+ rules?: {
1420
+ id: string;
1421
+ condition: {
1422
+ serviceName?: string | undefined;
1423
+ alertType?: AlertType | undefined;
1424
+ endpointPath?: string | undefined;
1425
+ labels?: Record<string, string> | undefined;
1426
+ alertCount?: {
1427
+ min?: number | undefined;
1428
+ max?: number | undefined;
1429
+ } | undefined;
1430
+ latencyP99Ms?: {
1431
+ min?: number | undefined;
1432
+ max?: number | undefined;
1433
+ } | undefined;
1434
+ severity?: SeverityLevel | undefined;
1435
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1436
+ requiresRollback?: boolean | undefined;
1437
+ impactedServices?: string[] | undefined;
1438
+ };
1439
+ actions: ({
1440
+ type: RuleActionType.Suppress;
1441
+ } | {
1442
+ type: RuleActionType.Route;
1443
+ channel: string;
1444
+ } | {
1445
+ type: RuleActionType.Escalate;
1446
+ channel: string;
1447
+ } | {
1448
+ value: string;
1449
+ type: RuleActionType.Tag;
1450
+ key: string;
1451
+ })[];
1452
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1453
+ requiresRollback?: boolean | undefined;
1454
+ name?: string | undefined;
1455
+ }[] | undefined;
1456
+ }>;
1457
+ }, "strip", z.ZodTypeAny, {
1458
+ "pre-llm": {
1459
+ rules: {
1460
+ id: string;
1461
+ condition: {
1462
+ serviceName?: string | undefined;
1463
+ alertType?: AlertType | undefined;
1464
+ endpointPath?: string | undefined;
1465
+ labels?: Record<string, string> | undefined;
1466
+ alertCount?: {
1467
+ min?: number | undefined;
1468
+ max?: number | undefined;
1469
+ } | undefined;
1470
+ latencyP99Ms?: {
1471
+ min?: number | undefined;
1472
+ max?: number | undefined;
1473
+ } | undefined;
1474
+ severity?: SeverityLevel | undefined;
1475
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1476
+ requiresRollback?: boolean | undefined;
1477
+ impactedServices?: string[] | undefined;
1478
+ };
1479
+ actions: ({
1480
+ type: RuleActionType.Suppress;
1481
+ } | {
1482
+ type: RuleActionType.Route;
1483
+ channel: string;
1484
+ } | {
1485
+ type: RuleActionType.Escalate;
1486
+ channel: string;
1487
+ } | {
1488
+ value: string;
1489
+ type: RuleActionType.Tag;
1490
+ key: string;
1491
+ })[];
1492
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1493
+ requiresRollback?: boolean | undefined;
1494
+ name?: string | undefined;
1495
+ }[];
1496
+ };
1497
+ "post-llm": {
1498
+ rules: {
1499
+ id: string;
1500
+ condition: {
1501
+ serviceName?: string | undefined;
1502
+ alertType?: AlertType | undefined;
1503
+ endpointPath?: string | undefined;
1504
+ labels?: Record<string, string> | undefined;
1505
+ alertCount?: {
1506
+ min?: number | undefined;
1507
+ max?: number | undefined;
1508
+ } | undefined;
1509
+ latencyP99Ms?: {
1510
+ min?: number | undefined;
1511
+ max?: number | undefined;
1512
+ } | undefined;
1513
+ severity?: SeverityLevel | undefined;
1514
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1515
+ requiresRollback?: boolean | undefined;
1516
+ impactedServices?: string[] | undefined;
1517
+ };
1518
+ actions: ({
1519
+ type: RuleActionType.Suppress;
1520
+ } | {
1521
+ type: RuleActionType.Route;
1522
+ channel: string;
1523
+ } | {
1524
+ type: RuleActionType.Escalate;
1525
+ channel: string;
1526
+ } | {
1527
+ value: string;
1528
+ type: RuleActionType.Tag;
1529
+ key: string;
1530
+ })[];
1531
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1532
+ requiresRollback?: boolean | undefined;
1533
+ name?: string | undefined;
1534
+ }[];
1535
+ };
1536
+ }, {
1537
+ "pre-llm": {
1538
+ rules?: {
1539
+ id: string;
1540
+ condition: {
1541
+ serviceName?: string | undefined;
1542
+ alertType?: AlertType | undefined;
1543
+ endpointPath?: string | undefined;
1544
+ labels?: Record<string, string> | undefined;
1545
+ alertCount?: {
1546
+ min?: number | undefined;
1547
+ max?: number | undefined;
1548
+ } | undefined;
1549
+ latencyP99Ms?: {
1550
+ min?: number | undefined;
1551
+ max?: number | undefined;
1552
+ } | undefined;
1553
+ severity?: SeverityLevel | undefined;
1554
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1555
+ requiresRollback?: boolean | undefined;
1556
+ impactedServices?: string[] | undefined;
1557
+ };
1558
+ actions: ({
1559
+ type: RuleActionType.Suppress;
1560
+ } | {
1561
+ type: RuleActionType.Route;
1562
+ channel: string;
1563
+ } | {
1564
+ type: RuleActionType.Escalate;
1565
+ channel: string;
1566
+ } | {
1567
+ value: string;
1568
+ type: RuleActionType.Tag;
1569
+ key: string;
1570
+ })[];
1571
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1572
+ requiresRollback?: boolean | undefined;
1573
+ name?: string | undefined;
1574
+ }[] | undefined;
1575
+ };
1576
+ "post-llm": {
1577
+ rules?: {
1578
+ id: string;
1579
+ condition: {
1580
+ serviceName?: string | undefined;
1581
+ alertType?: AlertType | undefined;
1582
+ endpointPath?: string | undefined;
1583
+ labels?: Record<string, string> | undefined;
1584
+ alertCount?: {
1585
+ min?: number | undefined;
1586
+ max?: number | undefined;
1587
+ } | undefined;
1588
+ latencyP99Ms?: {
1589
+ min?: number | undefined;
1590
+ max?: number | undefined;
1591
+ } | undefined;
1592
+ severity?: SeverityLevel | undefined;
1593
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1594
+ requiresRollback?: boolean | undefined;
1595
+ impactedServices?: string[] | undefined;
1596
+ };
1597
+ actions: ({
1598
+ type: RuleActionType.Suppress;
1599
+ } | {
1600
+ type: RuleActionType.Route;
1601
+ channel: string;
1602
+ } | {
1603
+ type: RuleActionType.Escalate;
1604
+ channel: string;
1605
+ } | {
1606
+ value: string;
1607
+ type: RuleActionType.Tag;
1608
+ key: string;
1609
+ })[];
1610
+ urgencyLevel?: "critical" | "high" | "medium" | "low" | undefined;
1611
+ requiresRollback?: boolean | undefined;
1612
+ name?: string | undefined;
1613
+ }[] | undefined;
1614
+ };
1615
+ }>;
1616
+ type ValidatedRuleCondition = z.infer<typeof RuleConditionSchema>;
1617
+ type ValidatedRuleAction = z.infer<typeof RuleActionSchema>;
1618
+ type ValidatedRule = z.infer<typeof RuleSchema>;
1619
+ type ValidatedRuleSection = z.infer<typeof RuleSectionSchema>;
1620
+ type ValidatedRuleConfiguration = z.infer<typeof RuleConfigurationSchema>;
1621
+
322
1622
  interface TraceabilityDocument {
323
1623
  '@timestamp': string;
324
1624
  uploadId?: string;
@@ -379,7 +1679,14 @@ interface ILLMProvider {
379
1679
  * Implementations: SlackNotifier, TeamsNotifier, ConsoleNotifier (local dev/tests)
380
1680
  */
381
1681
  interface INotifier {
382
- send(cluster: AlertCluster, analysis: LLMAnalysis | null): Promise<void>;
1682
+ /**
1683
+ * Deliver an incident diagnosis to a ChatOps channel.
1684
+ * @param channel — optional channel override for multi-channel routing.
1685
+ * When provided, implementations MAY route to the specified channel
1686
+ * instead of their default. Backward-compatible — existing call sites
1687
+ * work unchanged.
1688
+ */
1689
+ send(cluster: AlertCluster, analysis: LLMAnalysis | null, channel?: string): Promise<void>;
383
1690
  }
384
1691
  /**
385
1692
  * Indexer.
@@ -389,6 +1696,30 @@ interface INotifier {
389
1696
  interface IIndexer<TDocument> {
390
1697
  index(doc: TDocument): Promise<void>;
391
1698
  }
1699
+ /**
1700
+ * Result of rule engine evaluation.
1701
+ */
1702
+ interface RuleActionResult {
1703
+ suppressed: boolean;
1704
+ actions: RuleAction[];
1705
+ matchedRuleId?: string;
1706
+ tags: Record<string, string>;
1707
+ }
1708
+ /**
1709
+ * Rule engine port — evaluates rules at pipeline hooks.
1710
+ */
1711
+ interface IRuleEngine {
1712
+ /**
1713
+ * PRE-LLM: evaluated after dedup, before LLM.
1714
+ * Returns actions to apply, or suppressed=true if should not proceed.
1715
+ */
1716
+ evaluatePreLlm(cluster: AlertCluster): RuleActionResult;
1717
+ /**
1718
+ * POST-LLM: evaluated after LLM analysis.
1719
+ * Returns additional actions based on analysis (escalate, tag, etc.).
1720
+ */
1721
+ evaluatePostLlm(cluster: AlertCluster, analysis: LLMAnalysis): RuleActionResult;
1722
+ }
392
1723
 
393
1724
  declare class ClusteringService {
394
1725
  /**
@@ -432,6 +1763,7 @@ interface Dependencies {
432
1763
  dedupTtlSeconds: number;
433
1764
  clustering?: ClusteringService;
434
1765
  onClustersBuilt?: (count: number) => void;
1766
+ ruleEngine?: IRuleEngine;
435
1767
  }
436
1768
  declare class ProcessIncidentUseCase {
437
1769
  private readonly deps;
@@ -544,6 +1876,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodObject<{
544
1876
  nodeEnv: z.ZodDefault<z.ZodEnum<["development", "test", "production"]>>;
545
1877
  llmFallbackModels: z.ZodEffects<z.ZodOptional<z.ZodString>, string[], string | undefined>;
546
1878
  llmFallbackTimeoutMs: z.ZodDefault<z.ZodNumber>;
1879
+ rulesConfigPath: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
547
1880
  }, "strip", z.ZodTypeAny, {
548
1881
  dedupTtlSeconds: number;
549
1882
  llmProvider: "gemini" | "claude" | "openrouter" | "qwen";
@@ -562,6 +1895,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodObject<{
562
1895
  teamsWebhookUrl?: string | undefined;
563
1896
  lokiUrl?: string | undefined;
564
1897
  sqsQueueUrl?: string | undefined;
1898
+ rulesConfigPath?: string | undefined;
565
1899
  }, {
566
1900
  llmProvider: "gemini" | "claude" | "openrouter" | "qwen";
567
1901
  llmApiKey: string;
@@ -580,6 +1914,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodObject<{
580
1914
  nodeEnv?: "production" | "development" | "test" | undefined;
581
1915
  llmFallbackModels?: string | undefined;
582
1916
  llmFallbackTimeoutMs?: number | undefined;
1917
+ rulesConfigPath?: string | undefined;
583
1918
  }>, {
584
1919
  dedupTtlSeconds: number;
585
1920
  llmProvider: "gemini" | "claude" | "openrouter" | "qwen";
@@ -598,6 +1933,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodObject<{
598
1933
  teamsWebhookUrl?: string | undefined;
599
1934
  lokiUrl?: string | undefined;
600
1935
  sqsQueueUrl?: string | undefined;
1936
+ rulesConfigPath?: string | undefined;
601
1937
  }, {
602
1938
  llmProvider: "gemini" | "claude" | "openrouter" | "qwen";
603
1939
  llmApiKey: string;
@@ -616,17 +1952,29 @@ declare const ConfigSchema: z.ZodEffects<z.ZodObject<{
616
1952
  nodeEnv?: "production" | "development" | "test" | undefined;
617
1953
  llmFallbackModels?: string | undefined;
618
1954
  llmFallbackTimeoutMs?: number | undefined;
1955
+ rulesConfigPath?: string | undefined;
619
1956
  }>;
620
1957
  type Config = z.infer<typeof ConfigSchema>;
621
1958
  declare function loadConfig(): Promise<Config>;
622
1959
 
1960
+ /**
1961
+ * Creates the notifier for the application.
1962
+ *
1963
+ * When `config.rulesConfigPath` is set:
1964
+ * - Reads and validates the rules YAML config
1965
+ * - Creates a ChannelRegistry with the default notifier as fallback
1966
+ * - Wraps the default notifier with a RoutingNotifier for multi-channel dispatch
1967
+ *
1968
+ * When `config.rulesConfigPath` is NOT set:
1969
+ * - Returns the default notifier directly (backward-compatible)
1970
+ */
623
1971
  declare function createNotifier(config: Config): INotifier;
624
1972
 
625
1973
  declare class SlackNotifier implements INotifier {
626
1974
  private readonly botToken;
627
1975
  private readonly channel;
628
1976
  constructor(botToken: string, channel: string);
629
- send(cluster: AlertCluster, analysis: LLMAnalysis | null): Promise<void>;
1977
+ send(cluster: AlertCluster, analysis: LLMAnalysis | null, _channel?: string): Promise<void>;
630
1978
  private buildAnalysisMessage;
631
1979
  private buildFallbackMessage;
632
1980
  }
@@ -635,7 +1983,7 @@ declare class ConsoleNotifier implements INotifier {
635
1983
  cluster: AlertCluster;
636
1984
  analysis: LLMAnalysis | null;
637
1985
  }>;
638
- send(cluster: AlertCluster, analysis: LLMAnalysis | null): Promise<void>;
1986
+ send(cluster: AlertCluster, analysis: LLMAnalysis | null, _channel?: string): Promise<void>;
639
1987
  }
640
1988
 
641
1989
  declare class TeamsNotifierError extends Error {
@@ -646,7 +1994,59 @@ declare class TeamsNotifier implements INotifier {
646
1994
  private readonly timeoutMs;
647
1995
  private readonly hostForErrors;
648
1996
  constructor(webhookUrl: string, timeoutMs?: number);
1997
+ send(cluster: AlertCluster, analysis: LLMAnalysis | null, _channel?: string): Promise<void>;
1998
+ }
1999
+
2000
+ declare class ChannelRegistry {
2001
+ private readonly _channels;
2002
+ private _default;
2003
+ /**
2004
+ * Register a notifier for a given channel name.
2005
+ * Overwrites any existing registration for that name.
2006
+ */
2007
+ register(channel: string, notifier: INotifier): void;
2008
+ /**
2009
+ * Set the default notifier to use when a channel is not found.
2010
+ */
2011
+ setDefault(notifier: INotifier): void;
2012
+ /**
2013
+ * Resolve a channel name to its notifier instance.
2014
+ * Falls back to the default notifier if the channel is unknown.
2015
+ *
2016
+ * @throws {Error} if the channel is unknown and no default is set
2017
+ */
2018
+ resolve(channel: string): INotifier;
2019
+ /**
2020
+ * Check if a channel is registered.
2021
+ */
2022
+ has(channel: string): boolean;
2023
+ }
2024
+
2025
+ declare class RoutingNotifier implements INotifier {
2026
+ private readonly registry;
2027
+ private readonly defaultNotifier;
2028
+ constructor(registry: ChannelRegistry, defaultNotifier: INotifier);
2029
+ /**
2030
+ * Implements INotifier.send — sends via default notifier.
2031
+ * Backward-compatible with existing call sites that don't use rule actions.
2032
+ */
649
2033
  send(cluster: AlertCluster, analysis: LLMAnalysis | null): Promise<void>;
2034
+ /**
2035
+ * Dispatch notifications based on rule engine actions.
2036
+ *
2037
+ * - Route actions: send to the specified channel instead of default.
2038
+ * - Escalate actions: send additional notifications to escalation channels.
2039
+ * - Tag actions: metadata-only, no notification side effect.
2040
+ * - Suppress actions: skip all notification (defensive — caller should have already skipped).
2041
+ * - Unknown channels: fall back to default notifier.
2042
+ * - Empty actions or no Route/Escalate: send via default notifier.
2043
+ */
2044
+ sendWithActions(cluster: AlertCluster, analysis: LLMAnalysis | null, actions: RuleAction[]): Promise<void>;
2045
+ /**
2046
+ * Resolve a channel name to its notifier and send.
2047
+ * Falls back to default notifier if channel is unknown.
2048
+ */
2049
+ private tryResolveAndSend;
650
2050
  }
651
2051
 
652
2052
  interface SendMessageParams {
@@ -685,6 +2085,54 @@ declare class MockTraceRepository implements ITraceRepository {
685
2085
  addFixture(traceId: string, spans: Record<string, unknown>[]): void;
686
2086
  }
687
2087
 
2088
+ /**
2089
+ * Parse and validate a YAML string into a RuleConfiguration.
2090
+ * Pure function — no I/O, no side effects. Fast-fails on invalid config.
2091
+ *
2092
+ * @throws {Error} if YAML is malformed or Zod validation fails
2093
+ */
2094
+ declare function parseRuleConfig(yamlString: string): ValidatedRuleConfiguration;
2095
+
2096
+ type Predicate = (cluster: AlertCluster, analysis?: LLMAnalysis) => boolean;
2097
+ /**
2098
+ * Compile a RuleCondition into a predicate function.
2099
+ * The returned function can be called with (cluster, analysis?) to evaluate the condition.
2100
+ * Pre-compilation ensures the field iteration and matcher assembly happen once at load time.
2101
+ *
2102
+ * All specified conditions must match (AND logic).
2103
+ * If no fields are specified, the predicate returns true (match-all).
2104
+ */
2105
+ declare function compileCondition(condition: ValidatedRuleCondition): Predicate;
2106
+
2107
+ /**
2108
+ * Dispatch an array of RuleAction into a RuleActionResult.
2109
+ * All actions are processed in order.
2110
+ * The result accumulates: suppressed flag, route/escalate actions, and tags.
2111
+ *
2112
+ * Pure function — no I/O, no side effects beyond the returned result.
2113
+ */
2114
+ declare function dispatchActions(actions: RuleAction[]): RuleActionResult;
2115
+
2116
+ declare class RuleEngine implements IRuleEngine {
2117
+ private readonly preLlmRules;
2118
+ private readonly postLlmRules;
2119
+ constructor(config: ValidatedRuleConfiguration);
2120
+ /**
2121
+ * Evaluate PRE-LLM rules against a cluster.
2122
+ * First-match-wins — returns result of first matching rule.
2123
+ * If no rule matches, returns pass-through (suppressed=false, no actions).
2124
+ */
2125
+ evaluatePreLlm(cluster: AlertCluster): RuleActionResult;
2126
+ /**
2127
+ * Evaluate POST-LLM rules against a cluster and LLM analysis.
2128
+ * First-match-wins — returns result of first matching rule.
2129
+ * If no rule matches, returns pass-through.
2130
+ */
2131
+ evaluatePostLlm(cluster: AlertCluster, analysis: LLMAnalysis): RuleActionResult;
2132
+ private compileSection;
2133
+ private evaluateRules;
2134
+ }
2135
+
688
2136
  declare class FactoryRegistry<T> {
689
2137
  private readonly _factories;
690
2138
  private _default;
@@ -739,6 +2187,8 @@ declare const dedupDuplicate: Counter<"source">;
739
2187
  declare const notificationsTotal: Counter<"channel" | "outcome">;
740
2188
  /** Tracks approximate number of unprocessed SQS messages (queue lag). */
741
2189
  declare const sqsQueueLag: Gauge<"queue_name">;
2190
+ /** Tracks clusters suppressed by the rule engine, segmented by rule ID. */
2191
+ declare const suppressedClusters: Gauge<"rule_id">;
742
2192
 
743
2193
  declare const index_alertClusters: typeof alertClusters;
744
2194
  declare const index_alertsProcessed: typeof alertsProcessed;
@@ -753,9 +2203,10 @@ declare const index_notificationsTotal: typeof notificationsTotal;
753
2203
  declare const index_pipelineInlineFailuresTotal: typeof pipelineInlineFailuresTotal;
754
2204
  declare const index_registry: typeof registry;
755
2205
  declare const index_sqsQueueLag: typeof sqsQueueLag;
2206
+ declare const index_suppressedClusters: typeof suppressedClusters;
756
2207
  declare const index_webhookRequestsTotal: typeof webhookRequestsTotal;
757
2208
  declare namespace index {
758
- export { index_alertClusters as alertClusters, index_alertsProcessed as alertsProcessed, index_alertsReceived as alertsReceived, index_dedupDuplicate as dedupDuplicate, index_dedupNew as dedupNew, index_dedupRedisFailoverTotal as dedupRedisFailoverTotal, index_latency as latency, index_llmInferenceDuration as llmInferenceDuration, index_llmInferenceTotal as llmInferenceTotal, index_notificationsTotal as notificationsTotal, index_pipelineInlineFailuresTotal as pipelineInlineFailuresTotal, index_registry as registry, index_sqsQueueLag as sqsQueueLag, index_webhookRequestsTotal as webhookRequestsTotal };
2209
+ export { index_alertClusters as alertClusters, index_alertsProcessed as alertsProcessed, index_alertsReceived as alertsReceived, index_dedupDuplicate as dedupDuplicate, index_dedupNew as dedupNew, index_dedupRedisFailoverTotal as dedupRedisFailoverTotal, index_latency as latency, index_llmInferenceDuration as llmInferenceDuration, index_llmInferenceTotal as llmInferenceTotal, index_notificationsTotal as notificationsTotal, index_pipelineInlineFailuresTotal as pipelineInlineFailuresTotal, index_registry as registry, index_sqsQueueLag as sqsQueueLag, index_suppressedClusters as suppressedClusters, index_webhookRequestsTotal as webhookRequestsTotal };
759
2210
  }
760
2211
 
761
- export { ALERT_TYPE_LABELS, type AlertCluster, AlertClusterSchema, type AlertErrorType, type AlertStatus, AlertStatusSchema, AlertType, type AlertmanagerPayload, AlertmanagerPayloadSchema, CIRCUIT_BREAKER, ClaudeProvider, ClusteringService, type Config, ConsoleNotifier, DEDUP_TTL_MS_MULTIPLIER, DEV_SERVER_PORT, FactoryRegistry, Fingerprint, GeminiProvider, HOUR_MS, HTTP_TIMEOUT_MS, type IAlertQueue, type IDeduplicationStore, type IIndexer, type ILLMProvider, type INotifier, type ITraceRepository, InMemoryAlertQueue, InMemoryDeduplicationStore, InMemoryIndexer, type Incident, IncidentSchema, type LLMAnalysis, LLMAnalysisSchema, LLMProviderType, LLM_FALLBACK_DEFAULTS, LLM_MAX_TOKENS, LLM_MODELS, type Logger, type LoggerOptions, LokiTraceRepository, MockLLMProvider, MockTraceRepository, type NormalizedAlert, NormalizedAlertSchema, type OpenSearchHttpFetcher, type OpenSearchHttpResponse, OpenSearchIndexer, type OpenSearchIndexerDeps, PAYLOAD_DEFAULTS, ProcessIncidentUseCase, RATE_LIMITER, REDIS_KEY_PREFIX, RedisDeduplicationStore, SLACK_API_URL, SQSAlertQueue, type SignedHttpRequest, SlackNotifier, TEAMS_WEBHOOK_TIMEOUT_MS, TeamsNotifier, TeamsNotifierError, type TraceabilityDocument, URGENCY_EMOJI, type UrgencyLevel, UrgencyLevelSchema, WEBHOOK_DEFAULTS, createLLMProvider, createLogger, createNotifier, flushLoki, loadConfig, index as metrics, normalizePayload, reinitLogger, startSqsLagPoller };
2212
+ export { ALERT_TYPE_LABELS, type AlertCluster, AlertClusterSchema, type AlertErrorType, type AlertStatus, AlertStatusSchema, AlertType, type AlertmanagerPayload, AlertmanagerPayloadSchema, CIRCUIT_BREAKER, ChannelRegistry, ClaudeProvider, ClusteringService, type Config, ConsoleNotifier, DEDUP_TTL_MS_MULTIPLIER, DEV_SERVER_PORT, FactoryRegistry, Fingerprint, GeminiProvider, HOUR_MS, HTTP_TIMEOUT_MS, type IAlertQueue, type IDeduplicationStore, type IIndexer, type ILLMProvider, type INotifier, type IRuleEngine, type ITraceRepository, InMemoryAlertQueue, InMemoryDeduplicationStore, InMemoryIndexer, type Incident, IncidentSchema, type LLMAnalysis, LLMAnalysisSchema, LLMProviderType, LLM_FALLBACK_DEFAULTS, LLM_MAX_TOKENS, LLM_MODELS, type Logger, type LoggerOptions, LokiTraceRepository, MockLLMProvider, MockTraceRepository, type NormalizedAlert, NormalizedAlertSchema, type OpenSearchHttpFetcher, type OpenSearchHttpResponse, OpenSearchIndexer, type OpenSearchIndexerDeps, PAYLOAD_DEFAULTS, ProcessIncidentUseCase, RATE_LIMITER, REDIS_KEY_PREFIX, RedisDeduplicationStore, RoutingNotifier, type Rule, type RuleAction, type RuleActionResult, RuleActionSchema, RuleActionType, type RuleCondition, RuleConditionSchema, type RuleConfiguration, RuleConfigurationSchema, RuleEngine, RuleEvaluationPhase, RuleSchema, type RuleSection, RuleSectionSchema, SLACK_API_URL, SQSAlertQueue, SeverityLevel, type SignedHttpRequest, SlackNotifier, TEAMS_WEBHOOK_TIMEOUT_MS, TeamsNotifier, TeamsNotifierError, type TraceabilityDocument, URGENCY_EMOJI, type UrgencyLevel, UrgencyLevelSchema, type ValidatedRule, type ValidatedRuleAction, type ValidatedRuleCondition, type ValidatedRuleConfiguration, type ValidatedRuleSection, WEBHOOK_DEFAULTS, compileCondition, createLLMProvider, createLogger, createNotifier, dispatchActions, flushLoki, loadConfig, index as metrics, normalizePayload, parseRuleConfig, reinitLogger, startSqsLagPoller };