@syntrologie/adapt-faq 0.0.0-semantically-released → 2.0.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/schema.d.ts CHANGED
@@ -15,20 +15,137 @@ export declare const FAQQuestionSchema: z.ZodObject<{
15
15
  id: z.ZodString;
16
16
  /** The question text */
17
17
  question: z.ZodString;
18
- /** The answer text (supports basic markdown) */
19
- answer: z.ZodString;
18
+ /** The answer content (plain string, rich HTML, or enhanced markdown) */
19
+ answer: z.ZodUnion<[z.ZodString, z.ZodObject<{
20
+ type: z.ZodLiteral<"rich">;
21
+ html: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: "rich";
24
+ html: string;
25
+ }, {
26
+ type: "rich";
27
+ html: string;
28
+ }>, z.ZodObject<{
29
+ type: z.ZodLiteral<"markdown">;
30
+ content: z.ZodString;
31
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
+ id: z.ZodString;
33
+ type: z.ZodEnum<["image", "video"]>;
34
+ src: z.ZodString;
35
+ alt: z.ZodOptional<z.ZodString>;
36
+ width: z.ZodOptional<z.ZodNumber>;
37
+ height: z.ZodOptional<z.ZodNumber>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ type: "image" | "video";
40
+ id: string;
41
+ src: string;
42
+ width?: number | undefined;
43
+ height?: number | undefined;
44
+ alt?: string | undefined;
45
+ }, {
46
+ type: "image" | "video";
47
+ id: string;
48
+ src: string;
49
+ width?: number | undefined;
50
+ height?: number | undefined;
51
+ alt?: string | undefined;
52
+ }>, "many">>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ type: "markdown";
55
+ content: string;
56
+ assets?: {
57
+ type: "image" | "video";
58
+ id: string;
59
+ src: string;
60
+ width?: number | undefined;
61
+ height?: number | undefined;
62
+ alt?: string | undefined;
63
+ }[] | undefined;
64
+ }, {
65
+ type: "markdown";
66
+ content: string;
67
+ assets?: {
68
+ type: "image" | "video";
69
+ id: string;
70
+ src: string;
71
+ width?: number | undefined;
72
+ height?: number | undefined;
73
+ alt?: string | undefined;
74
+ }[] | undefined;
75
+ }>]>;
20
76
  /** Optional category for grouping */
21
77
  category: z.ZodOptional<z.ZodString>;
78
+ /** Optional priority for ordering */
79
+ priority: z.ZodOptional<z.ZodNumber>;
80
+ /** Optional AI answer generation strategy */
81
+ answerStrategy: z.ZodOptional<z.ZodObject<{
82
+ endpoint: z.ZodString;
83
+ context: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
84
+ cache: z.ZodOptional<z.ZodEnum<["session", "none"]>>;
85
+ fallback: z.ZodOptional<z.ZodString>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ endpoint: string;
88
+ context?: string[] | undefined;
89
+ cache?: "session" | "none" | undefined;
90
+ fallback?: string | undefined;
91
+ }, {
92
+ endpoint: string;
93
+ context?: string[] | undefined;
94
+ cache?: "session" | "none" | undefined;
95
+ fallback?: string | undefined;
96
+ }>>;
22
97
  }, "strip", z.ZodTypeAny, {
23
98
  question: string;
24
- answer: string;
99
+ answer: string | {
100
+ type: "rich";
101
+ html: string;
102
+ } | {
103
+ type: "markdown";
104
+ content: string;
105
+ assets?: {
106
+ type: "image" | "video";
107
+ id: string;
108
+ src: string;
109
+ width?: number | undefined;
110
+ height?: number | undefined;
111
+ alt?: string | undefined;
112
+ }[] | undefined;
113
+ };
25
114
  id: string;
115
+ priority?: number | undefined;
26
116
  category?: string | undefined;
117
+ answerStrategy?: {
118
+ endpoint: string;
119
+ context?: string[] | undefined;
120
+ cache?: "session" | "none" | undefined;
121
+ fallback?: string | undefined;
122
+ } | undefined;
27
123
  }, {
28
124
  question: string;
29
- answer: string;
125
+ answer: string | {
126
+ type: "rich";
127
+ html: string;
128
+ } | {
129
+ type: "markdown";
130
+ content: string;
131
+ assets?: {
132
+ type: "image" | "video";
133
+ id: string;
134
+ src: string;
135
+ width?: number | undefined;
136
+ height?: number | undefined;
137
+ alt?: string | undefined;
138
+ }[] | undefined;
139
+ };
30
140
  id: string;
141
+ priority?: number | undefined;
31
142
  category?: string | undefined;
143
+ answerStrategy?: {
144
+ endpoint: string;
145
+ context?: string[] | undefined;
146
+ cache?: "session" | "none" | undefined;
147
+ fallback?: string | undefined;
148
+ } | undefined;
32
149
  }>;
33
150
  /** Per-item activation strategy (null = always show) */
34
151
  showWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -130,9 +247,30 @@ export declare const FAQQuestionSchema: z.ZodObject<{
130
247
  }, "strip", z.ZodTypeAny, {
131
248
  config: {
132
249
  question: string;
133
- answer: string;
250
+ answer: string | {
251
+ type: "rich";
252
+ html: string;
253
+ } | {
254
+ type: "markdown";
255
+ content: string;
256
+ assets?: {
257
+ type: "image" | "video";
258
+ id: string;
259
+ src: string;
260
+ width?: number | undefined;
261
+ height?: number | undefined;
262
+ alt?: string | undefined;
263
+ }[] | undefined;
264
+ };
134
265
  id: string;
266
+ priority?: number | undefined;
135
267
  category?: string | undefined;
268
+ answerStrategy?: {
269
+ endpoint: string;
270
+ context?: string[] | undefined;
271
+ cache?: "session" | "none" | undefined;
272
+ fallback?: string | undefined;
273
+ } | undefined;
136
274
  };
137
275
  kind: "faq:question";
138
276
  showWhen?: {
@@ -166,9 +304,30 @@ export declare const FAQQuestionSchema: z.ZodObject<{
166
304
  }, {
167
305
  config: {
168
306
  question: string;
169
- answer: string;
307
+ answer: string | {
308
+ type: "rich";
309
+ html: string;
310
+ } | {
311
+ type: "markdown";
312
+ content: string;
313
+ assets?: {
314
+ type: "image" | "video";
315
+ id: string;
316
+ src: string;
317
+ width?: number | undefined;
318
+ height?: number | undefined;
319
+ alt?: string | undefined;
320
+ }[] | undefined;
321
+ };
170
322
  id: string;
323
+ priority?: number | undefined;
171
324
  category?: string | undefined;
325
+ answerStrategy?: {
326
+ endpoint: string;
327
+ context?: string[] | undefined;
328
+ cache?: "session" | "none" | undefined;
329
+ fallback?: string | undefined;
330
+ } | undefined;
172
331
  };
173
332
  kind: "faq:question";
174
333
  showWhen?: {
@@ -219,20 +378,137 @@ export declare const configSchema: z.ZodObject<{
219
378
  id: z.ZodString;
220
379
  /** The question text */
221
380
  question: z.ZodString;
222
- /** The answer text (supports basic markdown) */
223
- answer: z.ZodString;
381
+ /** The answer content (plain string, rich HTML, or enhanced markdown) */
382
+ answer: z.ZodUnion<[z.ZodString, z.ZodObject<{
383
+ type: z.ZodLiteral<"rich">;
384
+ html: z.ZodString;
385
+ }, "strip", z.ZodTypeAny, {
386
+ type: "rich";
387
+ html: string;
388
+ }, {
389
+ type: "rich";
390
+ html: string;
391
+ }>, z.ZodObject<{
392
+ type: z.ZodLiteral<"markdown">;
393
+ content: z.ZodString;
394
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
395
+ id: z.ZodString;
396
+ type: z.ZodEnum<["image", "video"]>;
397
+ src: z.ZodString;
398
+ alt: z.ZodOptional<z.ZodString>;
399
+ width: z.ZodOptional<z.ZodNumber>;
400
+ height: z.ZodOptional<z.ZodNumber>;
401
+ }, "strip", z.ZodTypeAny, {
402
+ type: "image" | "video";
403
+ id: string;
404
+ src: string;
405
+ width?: number | undefined;
406
+ height?: number | undefined;
407
+ alt?: string | undefined;
408
+ }, {
409
+ type: "image" | "video";
410
+ id: string;
411
+ src: string;
412
+ width?: number | undefined;
413
+ height?: number | undefined;
414
+ alt?: string | undefined;
415
+ }>, "many">>;
416
+ }, "strip", z.ZodTypeAny, {
417
+ type: "markdown";
418
+ content: string;
419
+ assets?: {
420
+ type: "image" | "video";
421
+ id: string;
422
+ src: string;
423
+ width?: number | undefined;
424
+ height?: number | undefined;
425
+ alt?: string | undefined;
426
+ }[] | undefined;
427
+ }, {
428
+ type: "markdown";
429
+ content: string;
430
+ assets?: {
431
+ type: "image" | "video";
432
+ id: string;
433
+ src: string;
434
+ width?: number | undefined;
435
+ height?: number | undefined;
436
+ alt?: string | undefined;
437
+ }[] | undefined;
438
+ }>]>;
224
439
  /** Optional category for grouping */
225
440
  category: z.ZodOptional<z.ZodString>;
441
+ /** Optional priority for ordering */
442
+ priority: z.ZodOptional<z.ZodNumber>;
443
+ /** Optional AI answer generation strategy */
444
+ answerStrategy: z.ZodOptional<z.ZodObject<{
445
+ endpoint: z.ZodString;
446
+ context: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
447
+ cache: z.ZodOptional<z.ZodEnum<["session", "none"]>>;
448
+ fallback: z.ZodOptional<z.ZodString>;
449
+ }, "strip", z.ZodTypeAny, {
450
+ endpoint: string;
451
+ context?: string[] | undefined;
452
+ cache?: "session" | "none" | undefined;
453
+ fallback?: string | undefined;
454
+ }, {
455
+ endpoint: string;
456
+ context?: string[] | undefined;
457
+ cache?: "session" | "none" | undefined;
458
+ fallback?: string | undefined;
459
+ }>>;
226
460
  }, "strip", z.ZodTypeAny, {
227
461
  question: string;
228
- answer: string;
462
+ answer: string | {
463
+ type: "rich";
464
+ html: string;
465
+ } | {
466
+ type: "markdown";
467
+ content: string;
468
+ assets?: {
469
+ type: "image" | "video";
470
+ id: string;
471
+ src: string;
472
+ width?: number | undefined;
473
+ height?: number | undefined;
474
+ alt?: string | undefined;
475
+ }[] | undefined;
476
+ };
229
477
  id: string;
478
+ priority?: number | undefined;
230
479
  category?: string | undefined;
480
+ answerStrategy?: {
481
+ endpoint: string;
482
+ context?: string[] | undefined;
483
+ cache?: "session" | "none" | undefined;
484
+ fallback?: string | undefined;
485
+ } | undefined;
231
486
  }, {
232
487
  question: string;
233
- answer: string;
488
+ answer: string | {
489
+ type: "rich";
490
+ html: string;
491
+ } | {
492
+ type: "markdown";
493
+ content: string;
494
+ assets?: {
495
+ type: "image" | "video";
496
+ id: string;
497
+ src: string;
498
+ width?: number | undefined;
499
+ height?: number | undefined;
500
+ alt?: string | undefined;
501
+ }[] | undefined;
502
+ };
234
503
  id: string;
504
+ priority?: number | undefined;
235
505
  category?: string | undefined;
506
+ answerStrategy?: {
507
+ endpoint: string;
508
+ context?: string[] | undefined;
509
+ cache?: "session" | "none" | undefined;
510
+ fallback?: string | undefined;
511
+ } | undefined;
236
512
  }>;
237
513
  /** Per-item activation strategy (null = always show) */
238
514
  showWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -334,9 +610,30 @@ export declare const configSchema: z.ZodObject<{
334
610
  }, "strip", z.ZodTypeAny, {
335
611
  config: {
336
612
  question: string;
337
- answer: string;
613
+ answer: string | {
614
+ type: "rich";
615
+ html: string;
616
+ } | {
617
+ type: "markdown";
618
+ content: string;
619
+ assets?: {
620
+ type: "image" | "video";
621
+ id: string;
622
+ src: string;
623
+ width?: number | undefined;
624
+ height?: number | undefined;
625
+ alt?: string | undefined;
626
+ }[] | undefined;
627
+ };
338
628
  id: string;
629
+ priority?: number | undefined;
339
630
  category?: string | undefined;
631
+ answerStrategy?: {
632
+ endpoint: string;
633
+ context?: string[] | undefined;
634
+ cache?: "session" | "none" | undefined;
635
+ fallback?: string | undefined;
636
+ } | undefined;
340
637
  };
341
638
  kind: "faq:question";
342
639
  showWhen?: {
@@ -370,9 +667,30 @@ export declare const configSchema: z.ZodObject<{
370
667
  }, {
371
668
  config: {
372
669
  question: string;
373
- answer: string;
670
+ answer: string | {
671
+ type: "rich";
672
+ html: string;
673
+ } | {
674
+ type: "markdown";
675
+ content: string;
676
+ assets?: {
677
+ type: "image" | "video";
678
+ id: string;
679
+ src: string;
680
+ width?: number | undefined;
681
+ height?: number | undefined;
682
+ alt?: string | undefined;
683
+ }[] | undefined;
684
+ };
374
685
  id: string;
686
+ priority?: number | undefined;
375
687
  category?: string | undefined;
688
+ answerStrategy?: {
689
+ endpoint: string;
690
+ context?: string[] | undefined;
691
+ cache?: "session" | "none" | undefined;
692
+ fallback?: string | undefined;
693
+ } | undefined;
376
694
  };
377
695
  kind: "faq:question";
378
696
  showWhen?: {
@@ -404,19 +722,54 @@ export declare const configSchema: z.ZodObject<{
404
722
  timeoutMs?: number | undefined;
405
723
  } | null | undefined;
406
724
  }>, "many">>;
407
- }, "strip", z.ZodTypeAny, {
408
- theme: "light" | "dark" | "auto";
409
- searchable: boolean;
410
- expandBehavior: "single" | "multiple";
411
- actions: {
412
- config: {
413
- question: string;
414
- answer: string;
415
- id: string;
416
- category?: string | undefined;
417
- };
418
- kind: "faq:question";
419
- showWhen?: {
725
+ /** Feedback widget configuration */
726
+ feedback: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
727
+ style: z.ZodEnum<["thumbs", "rating"]>;
728
+ prompt: z.ZodOptional<z.ZodString>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ style: "thumbs" | "rating";
731
+ prompt?: string | undefined;
732
+ }, {
733
+ style: "thumbs" | "rating";
734
+ prompt?: string | undefined;
735
+ }>]>>;
736
+ /** Question ordering strategy */
737
+ ordering: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["static", "priority"]>, z.ZodObject<{
738
+ type: z.ZodLiteral<"segment">;
739
+ segmentWeights: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
740
+ }, "strip", z.ZodTypeAny, {
741
+ type: "segment";
742
+ segmentWeights: Record<string, string[]>;
743
+ }, {
744
+ type: "segment";
745
+ segmentWeights: Record<string, string[]>;
746
+ }>]>>;
747
+ /** Dynamic FAQ injection rules */
748
+ injections: z.ZodOptional<z.ZodArray<z.ZodObject<{
749
+ trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
750
+ type: z.ZodLiteral<"rules">;
751
+ rules: z.ZodArray<z.ZodObject<{
752
+ conditions: z.ZodArray<z.ZodObject<{
753
+ type: z.ZodString;
754
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
755
+ type: z.ZodString;
756
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
757
+ type: z.ZodString;
758
+ }, z.ZodTypeAny, "passthrough">>, "many">;
759
+ value: z.ZodUnknown;
760
+ }, "strip", z.ZodTypeAny, {
761
+ conditions: z.objectOutputType<{
762
+ type: z.ZodString;
763
+ }, z.ZodTypeAny, "passthrough">[];
764
+ value?: unknown;
765
+ }, {
766
+ conditions: z.objectInputType<{
767
+ type: z.ZodString;
768
+ }, z.ZodTypeAny, "passthrough">[];
769
+ value?: unknown;
770
+ }>, "many">;
771
+ default: z.ZodUnknown;
772
+ }, "strip", z.ZodTypeAny, {
420
773
  rules: {
421
774
  conditions: z.objectOutputType<{
422
775
  type: z.ZodString;
@@ -425,41 +778,485 @@ export declare const configSchema: z.ZodObject<{
425
778
  }[];
426
779
  type: "rules";
427
780
  default?: unknown;
428
- } | {
781
+ }, {
782
+ rules: {
783
+ conditions: z.objectInputType<{
784
+ type: z.ZodString;
785
+ }, z.ZodTypeAny, "passthrough">[];
786
+ value?: unknown;
787
+ }[];
788
+ type: "rules";
789
+ default?: unknown;
790
+ }>, z.ZodObject<{
791
+ type: z.ZodLiteral<"score">;
792
+ field: z.ZodString;
793
+ threshold: z.ZodNumber;
794
+ above: z.ZodUnknown;
795
+ below: z.ZodUnknown;
796
+ }, "strip", z.ZodTypeAny, {
429
797
  type: "score";
430
798
  field: string;
431
799
  threshold: number;
432
800
  above?: unknown;
433
801
  below?: unknown;
434
- } | {
802
+ }, {
803
+ type: "score";
804
+ field: string;
805
+ threshold: number;
806
+ above?: unknown;
807
+ below?: unknown;
808
+ }>, z.ZodObject<{
809
+ type: z.ZodLiteral<"model">;
810
+ modelId: z.ZodString;
811
+ inputs: z.ZodArray<z.ZodString, "many">;
812
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
813
+ default: z.ZodUnknown;
814
+ }, "strip", z.ZodTypeAny, {
435
815
  type: "model";
436
816
  modelId: string;
437
817
  inputs: string[];
438
818
  outputMapping: Record<string, unknown>;
439
819
  default?: unknown;
440
- } | {
820
+ }, {
821
+ type: "model";
822
+ modelId: string;
823
+ inputs: string[];
824
+ outputMapping: Record<string, unknown>;
825
+ default?: unknown;
826
+ }>, z.ZodObject<{
827
+ type: z.ZodLiteral<"external">;
828
+ endpoint: z.ZodString;
829
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
830
+ default: z.ZodUnknown;
831
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
832
+ }, "strip", z.ZodTypeAny, {
441
833
  type: "external";
442
834
  endpoint: string;
443
835
  default?: unknown;
444
836
  method?: "GET" | "POST" | undefined;
445
837
  timeoutMs?: number | undefined;
446
- } | null | undefined;
447
- }[];
448
- }, {
449
- theme?: "light" | "dark" | "auto" | undefined;
450
- searchable?: boolean | undefined;
451
- expandBehavior?: "single" | "multiple" | undefined;
452
- actions?: {
453
- config: {
454
- question: string;
455
- answer: string;
456
- id: string;
457
- category?: string | undefined;
458
- };
459
- kind: "faq:question";
460
- showWhen?: {
838
+ }, {
839
+ type: "external";
840
+ endpoint: string;
841
+ default?: unknown;
842
+ method?: "GET" | "POST" | undefined;
843
+ timeoutMs?: number | undefined;
844
+ }>]>;
845
+ items: z.ZodArray<z.ZodLazy<z.ZodObject<{
846
+ kind: z.ZodLiteral<"faq:question">;
847
+ config: z.ZodObject<{
848
+ /** Unique identifier for this question */
849
+ id: z.ZodString;
850
+ /** The question text */
851
+ question: z.ZodString;
852
+ /** The answer content (plain string, rich HTML, or enhanced markdown) */
853
+ answer: z.ZodUnion<[z.ZodString, z.ZodObject<{
854
+ type: z.ZodLiteral<"rich">;
855
+ html: z.ZodString;
856
+ }, "strip", z.ZodTypeAny, {
857
+ type: "rich";
858
+ html: string;
859
+ }, {
860
+ type: "rich";
861
+ html: string;
862
+ }>, z.ZodObject<{
863
+ type: z.ZodLiteral<"markdown">;
864
+ content: z.ZodString;
865
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
866
+ id: z.ZodString;
867
+ type: z.ZodEnum<["image", "video"]>;
868
+ src: z.ZodString;
869
+ alt: z.ZodOptional<z.ZodString>;
870
+ width: z.ZodOptional<z.ZodNumber>;
871
+ height: z.ZodOptional<z.ZodNumber>;
872
+ }, "strip", z.ZodTypeAny, {
873
+ type: "image" | "video";
874
+ id: string;
875
+ src: string;
876
+ width?: number | undefined;
877
+ height?: number | undefined;
878
+ alt?: string | undefined;
879
+ }, {
880
+ type: "image" | "video";
881
+ id: string;
882
+ src: string;
883
+ width?: number | undefined;
884
+ height?: number | undefined;
885
+ alt?: string | undefined;
886
+ }>, "many">>;
887
+ }, "strip", z.ZodTypeAny, {
888
+ type: "markdown";
889
+ content: string;
890
+ assets?: {
891
+ type: "image" | "video";
892
+ id: string;
893
+ src: string;
894
+ width?: number | undefined;
895
+ height?: number | undefined;
896
+ alt?: string | undefined;
897
+ }[] | undefined;
898
+ }, {
899
+ type: "markdown";
900
+ content: string;
901
+ assets?: {
902
+ type: "image" | "video";
903
+ id: string;
904
+ src: string;
905
+ width?: number | undefined;
906
+ height?: number | undefined;
907
+ alt?: string | undefined;
908
+ }[] | undefined;
909
+ }>]>;
910
+ /** Optional category for grouping */
911
+ category: z.ZodOptional<z.ZodString>;
912
+ /** Optional priority for ordering */
913
+ priority: z.ZodOptional<z.ZodNumber>;
914
+ /** Optional AI answer generation strategy */
915
+ answerStrategy: z.ZodOptional<z.ZodObject<{
916
+ endpoint: z.ZodString;
917
+ context: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
918
+ cache: z.ZodOptional<z.ZodEnum<["session", "none"]>>;
919
+ fallback: z.ZodOptional<z.ZodString>;
920
+ }, "strip", z.ZodTypeAny, {
921
+ endpoint: string;
922
+ context?: string[] | undefined;
923
+ cache?: "session" | "none" | undefined;
924
+ fallback?: string | undefined;
925
+ }, {
926
+ endpoint: string;
927
+ context?: string[] | undefined;
928
+ cache?: "session" | "none" | undefined;
929
+ fallback?: string | undefined;
930
+ }>>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ question: string;
933
+ answer: string | {
934
+ type: "rich";
935
+ html: string;
936
+ } | {
937
+ type: "markdown";
938
+ content: string;
939
+ assets?: {
940
+ type: "image" | "video";
941
+ id: string;
942
+ src: string;
943
+ width?: number | undefined;
944
+ height?: number | undefined;
945
+ alt?: string | undefined;
946
+ }[] | undefined;
947
+ };
948
+ id: string;
949
+ priority?: number | undefined;
950
+ category?: string | undefined;
951
+ answerStrategy?: {
952
+ endpoint: string;
953
+ context?: string[] | undefined;
954
+ cache?: "session" | "none" | undefined;
955
+ fallback?: string | undefined;
956
+ } | undefined;
957
+ }, {
958
+ question: string;
959
+ answer: string | {
960
+ type: "rich";
961
+ html: string;
962
+ } | {
963
+ type: "markdown";
964
+ content: string;
965
+ assets?: {
966
+ type: "image" | "video";
967
+ id: string;
968
+ src: string;
969
+ width?: number | undefined;
970
+ height?: number | undefined;
971
+ alt?: string | undefined;
972
+ }[] | undefined;
973
+ };
974
+ id: string;
975
+ priority?: number | undefined;
976
+ category?: string | undefined;
977
+ answerStrategy?: {
978
+ endpoint: string;
979
+ context?: string[] | undefined;
980
+ cache?: "session" | "none" | undefined;
981
+ fallback?: string | undefined;
982
+ } | undefined;
983
+ }>;
984
+ /** Per-item activation strategy (null = always show) */
985
+ showWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
986
+ type: z.ZodLiteral<"rules">;
987
+ rules: z.ZodArray<z.ZodObject<{
988
+ conditions: z.ZodArray<z.ZodObject<{
989
+ type: z.ZodString;
990
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
991
+ type: z.ZodString;
992
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
993
+ type: z.ZodString;
994
+ }, z.ZodTypeAny, "passthrough">>, "many">;
995
+ value: z.ZodUnknown;
996
+ }, "strip", z.ZodTypeAny, {
997
+ conditions: z.objectOutputType<{
998
+ type: z.ZodString;
999
+ }, z.ZodTypeAny, "passthrough">[];
1000
+ value?: unknown;
1001
+ }, {
1002
+ conditions: z.objectInputType<{
1003
+ type: z.ZodString;
1004
+ }, z.ZodTypeAny, "passthrough">[];
1005
+ value?: unknown;
1006
+ }>, "many">;
1007
+ default: z.ZodUnknown;
1008
+ }, "strip", z.ZodTypeAny, {
1009
+ rules: {
1010
+ conditions: z.objectOutputType<{
1011
+ type: z.ZodString;
1012
+ }, z.ZodTypeAny, "passthrough">[];
1013
+ value?: unknown;
1014
+ }[];
1015
+ type: "rules";
1016
+ default?: unknown;
1017
+ }, {
1018
+ rules: {
1019
+ conditions: z.objectInputType<{
1020
+ type: z.ZodString;
1021
+ }, z.ZodTypeAny, "passthrough">[];
1022
+ value?: unknown;
1023
+ }[];
1024
+ type: "rules";
1025
+ default?: unknown;
1026
+ }>, z.ZodObject<{
1027
+ type: z.ZodLiteral<"score">;
1028
+ field: z.ZodString;
1029
+ threshold: z.ZodNumber;
1030
+ above: z.ZodUnknown;
1031
+ below: z.ZodUnknown;
1032
+ }, "strip", z.ZodTypeAny, {
1033
+ type: "score";
1034
+ field: string;
1035
+ threshold: number;
1036
+ above?: unknown;
1037
+ below?: unknown;
1038
+ }, {
1039
+ type: "score";
1040
+ field: string;
1041
+ threshold: number;
1042
+ above?: unknown;
1043
+ below?: unknown;
1044
+ }>, z.ZodObject<{
1045
+ type: z.ZodLiteral<"model">;
1046
+ modelId: z.ZodString;
1047
+ inputs: z.ZodArray<z.ZodString, "many">;
1048
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1049
+ default: z.ZodUnknown;
1050
+ }, "strip", z.ZodTypeAny, {
1051
+ type: "model";
1052
+ modelId: string;
1053
+ inputs: string[];
1054
+ outputMapping: Record<string, unknown>;
1055
+ default?: unknown;
1056
+ }, {
1057
+ type: "model";
1058
+ modelId: string;
1059
+ inputs: string[];
1060
+ outputMapping: Record<string, unknown>;
1061
+ default?: unknown;
1062
+ }>, z.ZodObject<{
1063
+ type: z.ZodLiteral<"external">;
1064
+ endpoint: z.ZodString;
1065
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1066
+ default: z.ZodUnknown;
1067
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1068
+ }, "strip", z.ZodTypeAny, {
1069
+ type: "external";
1070
+ endpoint: string;
1071
+ default?: unknown;
1072
+ method?: "GET" | "POST" | undefined;
1073
+ timeoutMs?: number | undefined;
1074
+ }, {
1075
+ type: "external";
1076
+ endpoint: string;
1077
+ default?: unknown;
1078
+ method?: "GET" | "POST" | undefined;
1079
+ timeoutMs?: number | undefined;
1080
+ }>]>>>;
1081
+ }, "strip", z.ZodTypeAny, {
1082
+ config: {
1083
+ question: string;
1084
+ answer: string | {
1085
+ type: "rich";
1086
+ html: string;
1087
+ } | {
1088
+ type: "markdown";
1089
+ content: string;
1090
+ assets?: {
1091
+ type: "image" | "video";
1092
+ id: string;
1093
+ src: string;
1094
+ width?: number | undefined;
1095
+ height?: number | undefined;
1096
+ alt?: string | undefined;
1097
+ }[] | undefined;
1098
+ };
1099
+ id: string;
1100
+ priority?: number | undefined;
1101
+ category?: string | undefined;
1102
+ answerStrategy?: {
1103
+ endpoint: string;
1104
+ context?: string[] | undefined;
1105
+ cache?: "session" | "none" | undefined;
1106
+ fallback?: string | undefined;
1107
+ } | undefined;
1108
+ };
1109
+ kind: "faq:question";
1110
+ showWhen?: {
1111
+ rules: {
1112
+ conditions: z.objectOutputType<{
1113
+ type: z.ZodString;
1114
+ }, z.ZodTypeAny, "passthrough">[];
1115
+ value?: unknown;
1116
+ }[];
1117
+ type: "rules";
1118
+ default?: unknown;
1119
+ } | {
1120
+ type: "score";
1121
+ field: string;
1122
+ threshold: number;
1123
+ above?: unknown;
1124
+ below?: unknown;
1125
+ } | {
1126
+ type: "model";
1127
+ modelId: string;
1128
+ inputs: string[];
1129
+ outputMapping: Record<string, unknown>;
1130
+ default?: unknown;
1131
+ } | {
1132
+ type: "external";
1133
+ endpoint: string;
1134
+ default?: unknown;
1135
+ method?: "GET" | "POST" | undefined;
1136
+ timeoutMs?: number | undefined;
1137
+ } | null | undefined;
1138
+ }, {
1139
+ config: {
1140
+ question: string;
1141
+ answer: string | {
1142
+ type: "rich";
1143
+ html: string;
1144
+ } | {
1145
+ type: "markdown";
1146
+ content: string;
1147
+ assets?: {
1148
+ type: "image" | "video";
1149
+ id: string;
1150
+ src: string;
1151
+ width?: number | undefined;
1152
+ height?: number | undefined;
1153
+ alt?: string | undefined;
1154
+ }[] | undefined;
1155
+ };
1156
+ id: string;
1157
+ priority?: number | undefined;
1158
+ category?: string | undefined;
1159
+ answerStrategy?: {
1160
+ endpoint: string;
1161
+ context?: string[] | undefined;
1162
+ cache?: "session" | "none" | undefined;
1163
+ fallback?: string | undefined;
1164
+ } | undefined;
1165
+ };
1166
+ kind: "faq:question";
1167
+ showWhen?: {
1168
+ rules: {
1169
+ conditions: z.objectInputType<{
1170
+ type: z.ZodString;
1171
+ }, z.ZodTypeAny, "passthrough">[];
1172
+ value?: unknown;
1173
+ }[];
1174
+ type: "rules";
1175
+ default?: unknown;
1176
+ } | {
1177
+ type: "score";
1178
+ field: string;
1179
+ threshold: number;
1180
+ above?: unknown;
1181
+ below?: unknown;
1182
+ } | {
1183
+ type: "model";
1184
+ modelId: string;
1185
+ inputs: string[];
1186
+ outputMapping: Record<string, unknown>;
1187
+ default?: unknown;
1188
+ } | {
1189
+ type: "external";
1190
+ endpoint: string;
1191
+ default?: unknown;
1192
+ method?: "GET" | "POST" | undefined;
1193
+ timeoutMs?: number | undefined;
1194
+ } | null | undefined;
1195
+ }>>, "many">;
1196
+ position: z.ZodOptional<z.ZodEnum<["prepend", "append"]>>;
1197
+ once: z.ZodOptional<z.ZodBoolean>;
1198
+ }, "strip", z.ZodTypeAny, {
1199
+ items: {
1200
+ config: {
1201
+ question: string;
1202
+ answer: string | {
1203
+ type: "rich";
1204
+ html: string;
1205
+ } | {
1206
+ type: "markdown";
1207
+ content: string;
1208
+ assets?: {
1209
+ type: "image" | "video";
1210
+ id: string;
1211
+ src: string;
1212
+ width?: number | undefined;
1213
+ height?: number | undefined;
1214
+ alt?: string | undefined;
1215
+ }[] | undefined;
1216
+ };
1217
+ id: string;
1218
+ priority?: number | undefined;
1219
+ category?: string | undefined;
1220
+ answerStrategy?: {
1221
+ endpoint: string;
1222
+ context?: string[] | undefined;
1223
+ cache?: "session" | "none" | undefined;
1224
+ fallback?: string | undefined;
1225
+ } | undefined;
1226
+ };
1227
+ kind: "faq:question";
1228
+ showWhen?: {
1229
+ rules: {
1230
+ conditions: z.objectOutputType<{
1231
+ type: z.ZodString;
1232
+ }, z.ZodTypeAny, "passthrough">[];
1233
+ value?: unknown;
1234
+ }[];
1235
+ type: "rules";
1236
+ default?: unknown;
1237
+ } | {
1238
+ type: "score";
1239
+ field: string;
1240
+ threshold: number;
1241
+ above?: unknown;
1242
+ below?: unknown;
1243
+ } | {
1244
+ type: "model";
1245
+ modelId: string;
1246
+ inputs: string[];
1247
+ outputMapping: Record<string, unknown>;
1248
+ default?: unknown;
1249
+ } | {
1250
+ type: "external";
1251
+ endpoint: string;
1252
+ default?: unknown;
1253
+ method?: "GET" | "POST" | undefined;
1254
+ timeoutMs?: number | undefined;
1255
+ } | null | undefined;
1256
+ }[];
1257
+ trigger: {
461
1258
  rules: {
462
- conditions: z.objectInputType<{
1259
+ conditions: z.objectOutputType<{
463
1260
  type: z.ZodString;
464
1261
  }, z.ZodTypeAny, "passthrough">[];
465
1262
  value?: unknown;
@@ -484,102 +1281,69 @@ export declare const configSchema: z.ZodObject<{
484
1281
  default?: unknown;
485
1282
  method?: "GET" | "POST" | undefined;
486
1283
  timeoutMs?: number | undefined;
487
- } | null | undefined;
488
- }[] | undefined;
489
- }>;
490
- export type FAQConfig = z.infer<typeof configSchema>;
491
- /**
492
- * Validate a FAQ question action.
493
- */
494
- export declare function validateFAQQuestion(data: unknown): z.SafeParseReturnType<{
495
- config: {
496
- question: string;
497
- answer: string;
498
- id: string;
499
- category?: string | undefined;
500
- };
501
- kind: "faq:question";
502
- showWhen?: {
503
- rules: {
504
- conditions: z.objectInputType<{
505
- type: z.ZodString;
506
- }, z.ZodTypeAny, "passthrough">[];
507
- value?: unknown;
508
- }[];
509
- type: "rules";
510
- default?: unknown;
511
- } | {
512
- type: "score";
513
- field: string;
514
- threshold: number;
515
- above?: unknown;
516
- below?: unknown;
517
- } | {
518
- type: "model";
519
- modelId: string;
520
- inputs: string[];
521
- outputMapping: Record<string, unknown>;
522
- default?: unknown;
523
- } | {
524
- type: "external";
525
- endpoint: string;
526
- default?: unknown;
527
- method?: "GET" | "POST" | undefined;
528
- timeoutMs?: number | undefined;
529
- } | null | undefined;
530
- }, {
531
- config: {
532
- question: string;
533
- answer: string;
534
- id: string;
535
- category?: string | undefined;
536
- };
537
- kind: "faq:question";
538
- showWhen?: {
539
- rules: {
540
- conditions: z.objectOutputType<{
541
- type: z.ZodString;
542
- }, z.ZodTypeAny, "passthrough">[];
543
- value?: unknown;
544
- }[];
545
- type: "rules";
546
- default?: unknown;
547
- } | {
548
- type: "score";
549
- field: string;
550
- threshold: number;
551
- above?: unknown;
552
- below?: unknown;
553
- } | {
554
- type: "model";
555
- modelId: string;
556
- inputs: string[];
557
- outputMapping: Record<string, unknown>;
558
- default?: unknown;
559
- } | {
560
- type: "external";
561
- endpoint: string;
562
- default?: unknown;
563
- method?: "GET" | "POST" | undefined;
564
- timeoutMs?: number | undefined;
565
- } | null | undefined;
566
- }>;
567
- /**
568
- * Validate the full FAQ config.
569
- */
570
- export declare function validateFAQConfig(data: unknown): z.SafeParseReturnType<{
571
- theme?: "light" | "dark" | "auto" | undefined;
572
- searchable?: boolean | undefined;
573
- expandBehavior?: "single" | "multiple" | undefined;
574
- actions?: {
575
- config: {
576
- question: string;
577
- answer: string;
578
- id: string;
579
- category?: string | undefined;
580
1284
  };
581
- kind: "faq:question";
582
- showWhen?: {
1285
+ position?: "prepend" | "append" | undefined;
1286
+ once?: boolean | undefined;
1287
+ }, {
1288
+ items: {
1289
+ config: {
1290
+ question: string;
1291
+ answer: string | {
1292
+ type: "rich";
1293
+ html: string;
1294
+ } | {
1295
+ type: "markdown";
1296
+ content: string;
1297
+ assets?: {
1298
+ type: "image" | "video";
1299
+ id: string;
1300
+ src: string;
1301
+ width?: number | undefined;
1302
+ height?: number | undefined;
1303
+ alt?: string | undefined;
1304
+ }[] | undefined;
1305
+ };
1306
+ id: string;
1307
+ priority?: number | undefined;
1308
+ category?: string | undefined;
1309
+ answerStrategy?: {
1310
+ endpoint: string;
1311
+ context?: string[] | undefined;
1312
+ cache?: "session" | "none" | undefined;
1313
+ fallback?: string | undefined;
1314
+ } | undefined;
1315
+ };
1316
+ kind: "faq:question";
1317
+ showWhen?: {
1318
+ rules: {
1319
+ conditions: z.objectInputType<{
1320
+ type: z.ZodString;
1321
+ }, z.ZodTypeAny, "passthrough">[];
1322
+ value?: unknown;
1323
+ }[];
1324
+ type: "rules";
1325
+ default?: unknown;
1326
+ } | {
1327
+ type: "score";
1328
+ field: string;
1329
+ threshold: number;
1330
+ above?: unknown;
1331
+ below?: unknown;
1332
+ } | {
1333
+ type: "model";
1334
+ modelId: string;
1335
+ inputs: string[];
1336
+ outputMapping: Record<string, unknown>;
1337
+ default?: unknown;
1338
+ } | {
1339
+ type: "external";
1340
+ endpoint: string;
1341
+ default?: unknown;
1342
+ method?: "GET" | "POST" | undefined;
1343
+ timeoutMs?: number | undefined;
1344
+ } | null | undefined;
1345
+ }[];
1346
+ trigger: {
583
1347
  rules: {
584
1348
  conditions: z.objectInputType<{
585
1349
  type: z.ZodString;
@@ -606,18 +1370,41 @@ export declare function validateFAQConfig(data: unknown): z.SafeParseReturnType<
606
1370
  default?: unknown;
607
1371
  method?: "GET" | "POST" | undefined;
608
1372
  timeoutMs?: number | undefined;
609
- } | null | undefined;
610
- }[] | undefined;
611
- }, {
1373
+ };
1374
+ position?: "prepend" | "append" | undefined;
1375
+ once?: boolean | undefined;
1376
+ }>, "many">>;
1377
+ }, "strip", z.ZodTypeAny, {
612
1378
  theme: "light" | "dark" | "auto";
613
1379
  searchable: boolean;
614
1380
  expandBehavior: "single" | "multiple";
615
1381
  actions: {
616
1382
  config: {
617
1383
  question: string;
618
- answer: string;
1384
+ answer: string | {
1385
+ type: "rich";
1386
+ html: string;
1387
+ } | {
1388
+ type: "markdown";
1389
+ content: string;
1390
+ assets?: {
1391
+ type: "image" | "video";
1392
+ id: string;
1393
+ src: string;
1394
+ width?: number | undefined;
1395
+ height?: number | undefined;
1396
+ alt?: string | undefined;
1397
+ }[] | undefined;
1398
+ };
619
1399
  id: string;
1400
+ priority?: number | undefined;
620
1401
  category?: string | undefined;
1402
+ answerStrategy?: {
1403
+ endpoint: string;
1404
+ context?: string[] | undefined;
1405
+ cache?: "session" | "none" | undefined;
1406
+ fallback?: string | undefined;
1407
+ } | undefined;
621
1408
  };
622
1409
  kind: "faq:question";
623
1410
  showWhen?: {
@@ -649,5 +1436,1263 @@ export declare function validateFAQConfig(data: unknown): z.SafeParseReturnType<
649
1436
  timeoutMs?: number | undefined;
650
1437
  } | null | undefined;
651
1438
  }[];
1439
+ feedback?: boolean | {
1440
+ style: "thumbs" | "rating";
1441
+ prompt?: string | undefined;
1442
+ } | undefined;
1443
+ ordering?: "static" | "priority" | {
1444
+ type: "segment";
1445
+ segmentWeights: Record<string, string[]>;
1446
+ } | undefined;
1447
+ injections?: {
1448
+ items: {
1449
+ config: {
1450
+ question: string;
1451
+ answer: string | {
1452
+ type: "rich";
1453
+ html: string;
1454
+ } | {
1455
+ type: "markdown";
1456
+ content: string;
1457
+ assets?: {
1458
+ type: "image" | "video";
1459
+ id: string;
1460
+ src: string;
1461
+ width?: number | undefined;
1462
+ height?: number | undefined;
1463
+ alt?: string | undefined;
1464
+ }[] | undefined;
1465
+ };
1466
+ id: string;
1467
+ priority?: number | undefined;
1468
+ category?: string | undefined;
1469
+ answerStrategy?: {
1470
+ endpoint: string;
1471
+ context?: string[] | undefined;
1472
+ cache?: "session" | "none" | undefined;
1473
+ fallback?: string | undefined;
1474
+ } | undefined;
1475
+ };
1476
+ kind: "faq:question";
1477
+ showWhen?: {
1478
+ rules: {
1479
+ conditions: z.objectOutputType<{
1480
+ type: z.ZodString;
1481
+ }, z.ZodTypeAny, "passthrough">[];
1482
+ value?: unknown;
1483
+ }[];
1484
+ type: "rules";
1485
+ default?: unknown;
1486
+ } | {
1487
+ type: "score";
1488
+ field: string;
1489
+ threshold: number;
1490
+ above?: unknown;
1491
+ below?: unknown;
1492
+ } | {
1493
+ type: "model";
1494
+ modelId: string;
1495
+ inputs: string[];
1496
+ outputMapping: Record<string, unknown>;
1497
+ default?: unknown;
1498
+ } | {
1499
+ type: "external";
1500
+ endpoint: string;
1501
+ default?: unknown;
1502
+ method?: "GET" | "POST" | undefined;
1503
+ timeoutMs?: number | undefined;
1504
+ } | null | undefined;
1505
+ }[];
1506
+ trigger: {
1507
+ rules: {
1508
+ conditions: z.objectOutputType<{
1509
+ type: z.ZodString;
1510
+ }, z.ZodTypeAny, "passthrough">[];
1511
+ value?: unknown;
1512
+ }[];
1513
+ type: "rules";
1514
+ default?: unknown;
1515
+ } | {
1516
+ type: "score";
1517
+ field: string;
1518
+ threshold: number;
1519
+ above?: unknown;
1520
+ below?: unknown;
1521
+ } | {
1522
+ type: "model";
1523
+ modelId: string;
1524
+ inputs: string[];
1525
+ outputMapping: Record<string, unknown>;
1526
+ default?: unknown;
1527
+ } | {
1528
+ type: "external";
1529
+ endpoint: string;
1530
+ default?: unknown;
1531
+ method?: "GET" | "POST" | undefined;
1532
+ timeoutMs?: number | undefined;
1533
+ };
1534
+ position?: "prepend" | "append" | undefined;
1535
+ once?: boolean | undefined;
1536
+ }[] | undefined;
1537
+ }, {
1538
+ theme?: "light" | "dark" | "auto" | undefined;
1539
+ searchable?: boolean | undefined;
1540
+ expandBehavior?: "single" | "multiple" | undefined;
1541
+ actions?: {
1542
+ config: {
1543
+ question: string;
1544
+ answer: string | {
1545
+ type: "rich";
1546
+ html: string;
1547
+ } | {
1548
+ type: "markdown";
1549
+ content: string;
1550
+ assets?: {
1551
+ type: "image" | "video";
1552
+ id: string;
1553
+ src: string;
1554
+ width?: number | undefined;
1555
+ height?: number | undefined;
1556
+ alt?: string | undefined;
1557
+ }[] | undefined;
1558
+ };
1559
+ id: string;
1560
+ priority?: number | undefined;
1561
+ category?: string | undefined;
1562
+ answerStrategy?: {
1563
+ endpoint: string;
1564
+ context?: string[] | undefined;
1565
+ cache?: "session" | "none" | undefined;
1566
+ fallback?: string | undefined;
1567
+ } | undefined;
1568
+ };
1569
+ kind: "faq:question";
1570
+ showWhen?: {
1571
+ rules: {
1572
+ conditions: z.objectInputType<{
1573
+ type: z.ZodString;
1574
+ }, z.ZodTypeAny, "passthrough">[];
1575
+ value?: unknown;
1576
+ }[];
1577
+ type: "rules";
1578
+ default?: unknown;
1579
+ } | {
1580
+ type: "score";
1581
+ field: string;
1582
+ threshold: number;
1583
+ above?: unknown;
1584
+ below?: unknown;
1585
+ } | {
1586
+ type: "model";
1587
+ modelId: string;
1588
+ inputs: string[];
1589
+ outputMapping: Record<string, unknown>;
1590
+ default?: unknown;
1591
+ } | {
1592
+ type: "external";
1593
+ endpoint: string;
1594
+ default?: unknown;
1595
+ method?: "GET" | "POST" | undefined;
1596
+ timeoutMs?: number | undefined;
1597
+ } | null | undefined;
1598
+ }[] | undefined;
1599
+ feedback?: boolean | {
1600
+ style: "thumbs" | "rating";
1601
+ prompt?: string | undefined;
1602
+ } | undefined;
1603
+ ordering?: "static" | "priority" | {
1604
+ type: "segment";
1605
+ segmentWeights: Record<string, string[]>;
1606
+ } | undefined;
1607
+ injections?: {
1608
+ items: {
1609
+ config: {
1610
+ question: string;
1611
+ answer: string | {
1612
+ type: "rich";
1613
+ html: string;
1614
+ } | {
1615
+ type: "markdown";
1616
+ content: string;
1617
+ assets?: {
1618
+ type: "image" | "video";
1619
+ id: string;
1620
+ src: string;
1621
+ width?: number | undefined;
1622
+ height?: number | undefined;
1623
+ alt?: string | undefined;
1624
+ }[] | undefined;
1625
+ };
1626
+ id: string;
1627
+ priority?: number | undefined;
1628
+ category?: string | undefined;
1629
+ answerStrategy?: {
1630
+ endpoint: string;
1631
+ context?: string[] | undefined;
1632
+ cache?: "session" | "none" | undefined;
1633
+ fallback?: string | undefined;
1634
+ } | undefined;
1635
+ };
1636
+ kind: "faq:question";
1637
+ showWhen?: {
1638
+ rules: {
1639
+ conditions: z.objectInputType<{
1640
+ type: z.ZodString;
1641
+ }, z.ZodTypeAny, "passthrough">[];
1642
+ value?: unknown;
1643
+ }[];
1644
+ type: "rules";
1645
+ default?: unknown;
1646
+ } | {
1647
+ type: "score";
1648
+ field: string;
1649
+ threshold: number;
1650
+ above?: unknown;
1651
+ below?: unknown;
1652
+ } | {
1653
+ type: "model";
1654
+ modelId: string;
1655
+ inputs: string[];
1656
+ outputMapping: Record<string, unknown>;
1657
+ default?: unknown;
1658
+ } | {
1659
+ type: "external";
1660
+ endpoint: string;
1661
+ default?: unknown;
1662
+ method?: "GET" | "POST" | undefined;
1663
+ timeoutMs?: number | undefined;
1664
+ } | null | undefined;
1665
+ }[];
1666
+ trigger: {
1667
+ rules: {
1668
+ conditions: z.objectInputType<{
1669
+ type: z.ZodString;
1670
+ }, z.ZodTypeAny, "passthrough">[];
1671
+ value?: unknown;
1672
+ }[];
1673
+ type: "rules";
1674
+ default?: unknown;
1675
+ } | {
1676
+ type: "score";
1677
+ field: string;
1678
+ threshold: number;
1679
+ above?: unknown;
1680
+ below?: unknown;
1681
+ } | {
1682
+ type: "model";
1683
+ modelId: string;
1684
+ inputs: string[];
1685
+ outputMapping: Record<string, unknown>;
1686
+ default?: unknown;
1687
+ } | {
1688
+ type: "external";
1689
+ endpoint: string;
1690
+ default?: unknown;
1691
+ method?: "GET" | "POST" | undefined;
1692
+ timeoutMs?: number | undefined;
1693
+ };
1694
+ position?: "prepend" | "append" | undefined;
1695
+ once?: boolean | undefined;
1696
+ }[] | undefined;
1697
+ }>;
1698
+ export type FAQConfig = z.infer<typeof configSchema>;
1699
+ /**
1700
+ * Schema for scrolling to a specific FAQ item.
1701
+ * Requires either itemId or itemQuestion to identify the target.
1702
+ */
1703
+ export declare const ScrollToFaqSchema: z.ZodEffects<z.ZodObject<{
1704
+ kind: z.ZodLiteral<"faq:scroll_to">;
1705
+ itemId: z.ZodOptional<z.ZodString>;
1706
+ itemQuestion: z.ZodOptional<z.ZodString>;
1707
+ expand: z.ZodOptional<z.ZodBoolean>;
1708
+ behavior: z.ZodOptional<z.ZodEnum<["smooth", "instant", "auto"]>>;
1709
+ }, "strip", z.ZodTypeAny, {
1710
+ kind: "faq:scroll_to";
1711
+ itemId?: string | undefined;
1712
+ behavior?: "auto" | "smooth" | "instant" | undefined;
1713
+ itemQuestion?: string | undefined;
1714
+ expand?: boolean | undefined;
1715
+ }, {
1716
+ kind: "faq:scroll_to";
1717
+ itemId?: string | undefined;
1718
+ behavior?: "auto" | "smooth" | "instant" | undefined;
1719
+ itemQuestion?: string | undefined;
1720
+ expand?: boolean | undefined;
1721
+ }>, {
1722
+ kind: "faq:scroll_to";
1723
+ itemId?: string | undefined;
1724
+ behavior?: "auto" | "smooth" | "instant" | undefined;
1725
+ itemQuestion?: string | undefined;
1726
+ expand?: boolean | undefined;
1727
+ }, {
1728
+ kind: "faq:scroll_to";
1729
+ itemId?: string | undefined;
1730
+ behavior?: "auto" | "smooth" | "instant" | undefined;
1731
+ itemQuestion?: string | undefined;
1732
+ expand?: boolean | undefined;
1733
+ }>;
1734
+ /**
1735
+ * Schema for toggling a FAQ item open/closed.
1736
+ * Requires either itemId or itemQuestion to identify the target.
1737
+ */
1738
+ export declare const ToggleFaqItemSchema: z.ZodEffects<z.ZodObject<{
1739
+ kind: z.ZodLiteral<"faq:toggle_item">;
1740
+ itemId: z.ZodOptional<z.ZodString>;
1741
+ itemQuestion: z.ZodOptional<z.ZodString>;
1742
+ state: z.ZodDefault<z.ZodEnum<["open", "closed", "toggle"]>>;
1743
+ }, "strip", z.ZodTypeAny, {
1744
+ kind: "faq:toggle_item";
1745
+ state: "open" | "closed" | "toggle";
1746
+ itemId?: string | undefined;
1747
+ itemQuestion?: string | undefined;
1748
+ }, {
1749
+ kind: "faq:toggle_item";
1750
+ itemId?: string | undefined;
1751
+ itemQuestion?: string | undefined;
1752
+ state?: "open" | "closed" | "toggle" | undefined;
1753
+ }>, {
1754
+ kind: "faq:toggle_item";
1755
+ state: "open" | "closed" | "toggle";
1756
+ itemId?: string | undefined;
1757
+ itemQuestion?: string | undefined;
1758
+ }, {
1759
+ kind: "faq:toggle_item";
1760
+ itemId?: string | undefined;
1761
+ itemQuestion?: string | undefined;
1762
+ state?: "open" | "closed" | "toggle" | undefined;
1763
+ }>;
1764
+ /**
1765
+ * Schema for updating FAQ items (add, remove, reorder, replace).
1766
+ */
1767
+ export declare const UpdateFaqSchema: z.ZodObject<{
1768
+ kind: z.ZodLiteral<"faq:update">;
1769
+ operation: z.ZodEnum<["add", "remove", "reorder", "replace"]>;
1770
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1771
+ kind: z.ZodLiteral<"faq:question">;
1772
+ config: z.ZodObject<{
1773
+ /** Unique identifier for this question */
1774
+ id: z.ZodString;
1775
+ /** The question text */
1776
+ question: z.ZodString;
1777
+ /** The answer content (plain string, rich HTML, or enhanced markdown) */
1778
+ answer: z.ZodUnion<[z.ZodString, z.ZodObject<{
1779
+ type: z.ZodLiteral<"rich">;
1780
+ html: z.ZodString;
1781
+ }, "strip", z.ZodTypeAny, {
1782
+ type: "rich";
1783
+ html: string;
1784
+ }, {
1785
+ type: "rich";
1786
+ html: string;
1787
+ }>, z.ZodObject<{
1788
+ type: z.ZodLiteral<"markdown">;
1789
+ content: z.ZodString;
1790
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1791
+ id: z.ZodString;
1792
+ type: z.ZodEnum<["image", "video"]>;
1793
+ src: z.ZodString;
1794
+ alt: z.ZodOptional<z.ZodString>;
1795
+ width: z.ZodOptional<z.ZodNumber>;
1796
+ height: z.ZodOptional<z.ZodNumber>;
1797
+ }, "strip", z.ZodTypeAny, {
1798
+ type: "image" | "video";
1799
+ id: string;
1800
+ src: string;
1801
+ width?: number | undefined;
1802
+ height?: number | undefined;
1803
+ alt?: string | undefined;
1804
+ }, {
1805
+ type: "image" | "video";
1806
+ id: string;
1807
+ src: string;
1808
+ width?: number | undefined;
1809
+ height?: number | undefined;
1810
+ alt?: string | undefined;
1811
+ }>, "many">>;
1812
+ }, "strip", z.ZodTypeAny, {
1813
+ type: "markdown";
1814
+ content: string;
1815
+ assets?: {
1816
+ type: "image" | "video";
1817
+ id: string;
1818
+ src: string;
1819
+ width?: number | undefined;
1820
+ height?: number | undefined;
1821
+ alt?: string | undefined;
1822
+ }[] | undefined;
1823
+ }, {
1824
+ type: "markdown";
1825
+ content: string;
1826
+ assets?: {
1827
+ type: "image" | "video";
1828
+ id: string;
1829
+ src: string;
1830
+ width?: number | undefined;
1831
+ height?: number | undefined;
1832
+ alt?: string | undefined;
1833
+ }[] | undefined;
1834
+ }>]>;
1835
+ /** Optional category for grouping */
1836
+ category: z.ZodOptional<z.ZodString>;
1837
+ /** Optional priority for ordering */
1838
+ priority: z.ZodOptional<z.ZodNumber>;
1839
+ /** Optional AI answer generation strategy */
1840
+ answerStrategy: z.ZodOptional<z.ZodObject<{
1841
+ endpoint: z.ZodString;
1842
+ context: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1843
+ cache: z.ZodOptional<z.ZodEnum<["session", "none"]>>;
1844
+ fallback: z.ZodOptional<z.ZodString>;
1845
+ }, "strip", z.ZodTypeAny, {
1846
+ endpoint: string;
1847
+ context?: string[] | undefined;
1848
+ cache?: "session" | "none" | undefined;
1849
+ fallback?: string | undefined;
1850
+ }, {
1851
+ endpoint: string;
1852
+ context?: string[] | undefined;
1853
+ cache?: "session" | "none" | undefined;
1854
+ fallback?: string | undefined;
1855
+ }>>;
1856
+ }, "strip", z.ZodTypeAny, {
1857
+ question: string;
1858
+ answer: string | {
1859
+ type: "rich";
1860
+ html: string;
1861
+ } | {
1862
+ type: "markdown";
1863
+ content: string;
1864
+ assets?: {
1865
+ type: "image" | "video";
1866
+ id: string;
1867
+ src: string;
1868
+ width?: number | undefined;
1869
+ height?: number | undefined;
1870
+ alt?: string | undefined;
1871
+ }[] | undefined;
1872
+ };
1873
+ id: string;
1874
+ priority?: number | undefined;
1875
+ category?: string | undefined;
1876
+ answerStrategy?: {
1877
+ endpoint: string;
1878
+ context?: string[] | undefined;
1879
+ cache?: "session" | "none" | undefined;
1880
+ fallback?: string | undefined;
1881
+ } | undefined;
1882
+ }, {
1883
+ question: string;
1884
+ answer: string | {
1885
+ type: "rich";
1886
+ html: string;
1887
+ } | {
1888
+ type: "markdown";
1889
+ content: string;
1890
+ assets?: {
1891
+ type: "image" | "video";
1892
+ id: string;
1893
+ src: string;
1894
+ width?: number | undefined;
1895
+ height?: number | undefined;
1896
+ alt?: string | undefined;
1897
+ }[] | undefined;
1898
+ };
1899
+ id: string;
1900
+ priority?: number | undefined;
1901
+ category?: string | undefined;
1902
+ answerStrategy?: {
1903
+ endpoint: string;
1904
+ context?: string[] | undefined;
1905
+ cache?: "session" | "none" | undefined;
1906
+ fallback?: string | undefined;
1907
+ } | undefined;
1908
+ }>;
1909
+ /** Per-item activation strategy (null = always show) */
1910
+ showWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1911
+ type: z.ZodLiteral<"rules">;
1912
+ rules: z.ZodArray<z.ZodObject<{
1913
+ conditions: z.ZodArray<z.ZodObject<{
1914
+ type: z.ZodString;
1915
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1916
+ type: z.ZodString;
1917
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1918
+ type: z.ZodString;
1919
+ }, z.ZodTypeAny, "passthrough">>, "many">;
1920
+ value: z.ZodUnknown;
1921
+ }, "strip", z.ZodTypeAny, {
1922
+ conditions: z.objectOutputType<{
1923
+ type: z.ZodString;
1924
+ }, z.ZodTypeAny, "passthrough">[];
1925
+ value?: unknown;
1926
+ }, {
1927
+ conditions: z.objectInputType<{
1928
+ type: z.ZodString;
1929
+ }, z.ZodTypeAny, "passthrough">[];
1930
+ value?: unknown;
1931
+ }>, "many">;
1932
+ default: z.ZodUnknown;
1933
+ }, "strip", z.ZodTypeAny, {
1934
+ rules: {
1935
+ conditions: z.objectOutputType<{
1936
+ type: z.ZodString;
1937
+ }, z.ZodTypeAny, "passthrough">[];
1938
+ value?: unknown;
1939
+ }[];
1940
+ type: "rules";
1941
+ default?: unknown;
1942
+ }, {
1943
+ rules: {
1944
+ conditions: z.objectInputType<{
1945
+ type: z.ZodString;
1946
+ }, z.ZodTypeAny, "passthrough">[];
1947
+ value?: unknown;
1948
+ }[];
1949
+ type: "rules";
1950
+ default?: unknown;
1951
+ }>, z.ZodObject<{
1952
+ type: z.ZodLiteral<"score">;
1953
+ field: z.ZodString;
1954
+ threshold: z.ZodNumber;
1955
+ above: z.ZodUnknown;
1956
+ below: z.ZodUnknown;
1957
+ }, "strip", z.ZodTypeAny, {
1958
+ type: "score";
1959
+ field: string;
1960
+ threshold: number;
1961
+ above?: unknown;
1962
+ below?: unknown;
1963
+ }, {
1964
+ type: "score";
1965
+ field: string;
1966
+ threshold: number;
1967
+ above?: unknown;
1968
+ below?: unknown;
1969
+ }>, z.ZodObject<{
1970
+ type: z.ZodLiteral<"model">;
1971
+ modelId: z.ZodString;
1972
+ inputs: z.ZodArray<z.ZodString, "many">;
1973
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1974
+ default: z.ZodUnknown;
1975
+ }, "strip", z.ZodTypeAny, {
1976
+ type: "model";
1977
+ modelId: string;
1978
+ inputs: string[];
1979
+ outputMapping: Record<string, unknown>;
1980
+ default?: unknown;
1981
+ }, {
1982
+ type: "model";
1983
+ modelId: string;
1984
+ inputs: string[];
1985
+ outputMapping: Record<string, unknown>;
1986
+ default?: unknown;
1987
+ }>, z.ZodObject<{
1988
+ type: z.ZodLiteral<"external">;
1989
+ endpoint: z.ZodString;
1990
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1991
+ default: z.ZodUnknown;
1992
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1993
+ }, "strip", z.ZodTypeAny, {
1994
+ type: "external";
1995
+ endpoint: string;
1996
+ default?: unknown;
1997
+ method?: "GET" | "POST" | undefined;
1998
+ timeoutMs?: number | undefined;
1999
+ }, {
2000
+ type: "external";
2001
+ endpoint: string;
2002
+ default?: unknown;
2003
+ method?: "GET" | "POST" | undefined;
2004
+ timeoutMs?: number | undefined;
2005
+ }>]>>>;
2006
+ }, "strip", z.ZodTypeAny, {
2007
+ config: {
2008
+ question: string;
2009
+ answer: string | {
2010
+ type: "rich";
2011
+ html: string;
2012
+ } | {
2013
+ type: "markdown";
2014
+ content: string;
2015
+ assets?: {
2016
+ type: "image" | "video";
2017
+ id: string;
2018
+ src: string;
2019
+ width?: number | undefined;
2020
+ height?: number | undefined;
2021
+ alt?: string | undefined;
2022
+ }[] | undefined;
2023
+ };
2024
+ id: string;
2025
+ priority?: number | undefined;
2026
+ category?: string | undefined;
2027
+ answerStrategy?: {
2028
+ endpoint: string;
2029
+ context?: string[] | undefined;
2030
+ cache?: "session" | "none" | undefined;
2031
+ fallback?: string | undefined;
2032
+ } | undefined;
2033
+ };
2034
+ kind: "faq:question";
2035
+ showWhen?: {
2036
+ rules: {
2037
+ conditions: z.objectOutputType<{
2038
+ type: z.ZodString;
2039
+ }, z.ZodTypeAny, "passthrough">[];
2040
+ value?: unknown;
2041
+ }[];
2042
+ type: "rules";
2043
+ default?: unknown;
2044
+ } | {
2045
+ type: "score";
2046
+ field: string;
2047
+ threshold: number;
2048
+ above?: unknown;
2049
+ below?: unknown;
2050
+ } | {
2051
+ type: "model";
2052
+ modelId: string;
2053
+ inputs: string[];
2054
+ outputMapping: Record<string, unknown>;
2055
+ default?: unknown;
2056
+ } | {
2057
+ type: "external";
2058
+ endpoint: string;
2059
+ default?: unknown;
2060
+ method?: "GET" | "POST" | undefined;
2061
+ timeoutMs?: number | undefined;
2062
+ } | null | undefined;
2063
+ }, {
2064
+ config: {
2065
+ question: string;
2066
+ answer: string | {
2067
+ type: "rich";
2068
+ html: string;
2069
+ } | {
2070
+ type: "markdown";
2071
+ content: string;
2072
+ assets?: {
2073
+ type: "image" | "video";
2074
+ id: string;
2075
+ src: string;
2076
+ width?: number | undefined;
2077
+ height?: number | undefined;
2078
+ alt?: string | undefined;
2079
+ }[] | undefined;
2080
+ };
2081
+ id: string;
2082
+ priority?: number | undefined;
2083
+ category?: string | undefined;
2084
+ answerStrategy?: {
2085
+ endpoint: string;
2086
+ context?: string[] | undefined;
2087
+ cache?: "session" | "none" | undefined;
2088
+ fallback?: string | undefined;
2089
+ } | undefined;
2090
+ };
2091
+ kind: "faq:question";
2092
+ showWhen?: {
2093
+ rules: {
2094
+ conditions: z.objectInputType<{
2095
+ type: z.ZodString;
2096
+ }, z.ZodTypeAny, "passthrough">[];
2097
+ value?: unknown;
2098
+ }[];
2099
+ type: "rules";
2100
+ default?: unknown;
2101
+ } | {
2102
+ type: "score";
2103
+ field: string;
2104
+ threshold: number;
2105
+ above?: unknown;
2106
+ below?: unknown;
2107
+ } | {
2108
+ type: "model";
2109
+ modelId: string;
2110
+ inputs: string[];
2111
+ outputMapping: Record<string, unknown>;
2112
+ default?: unknown;
2113
+ } | {
2114
+ type: "external";
2115
+ endpoint: string;
2116
+ default?: unknown;
2117
+ method?: "GET" | "POST" | undefined;
2118
+ timeoutMs?: number | undefined;
2119
+ } | null | undefined;
2120
+ }>, "many">>;
2121
+ itemId: z.ZodOptional<z.ZodString>;
2122
+ order: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2123
+ position: z.ZodOptional<z.ZodEnum<["prepend", "append", "before", "after"]>>;
2124
+ anchorId: z.ZodOptional<z.ZodString>;
2125
+ }, "strip", z.ZodTypeAny, {
2126
+ operation: "add" | "remove" | "reorder" | "replace";
2127
+ kind: "faq:update";
2128
+ itemId?: string | undefined;
2129
+ items?: {
2130
+ config: {
2131
+ question: string;
2132
+ answer: string | {
2133
+ type: "rich";
2134
+ html: string;
2135
+ } | {
2136
+ type: "markdown";
2137
+ content: string;
2138
+ assets?: {
2139
+ type: "image" | "video";
2140
+ id: string;
2141
+ src: string;
2142
+ width?: number | undefined;
2143
+ height?: number | undefined;
2144
+ alt?: string | undefined;
2145
+ }[] | undefined;
2146
+ };
2147
+ id: string;
2148
+ priority?: number | undefined;
2149
+ category?: string | undefined;
2150
+ answerStrategy?: {
2151
+ endpoint: string;
2152
+ context?: string[] | undefined;
2153
+ cache?: "session" | "none" | undefined;
2154
+ fallback?: string | undefined;
2155
+ } | undefined;
2156
+ };
2157
+ kind: "faq:question";
2158
+ showWhen?: {
2159
+ rules: {
2160
+ conditions: z.objectOutputType<{
2161
+ type: z.ZodString;
2162
+ }, z.ZodTypeAny, "passthrough">[];
2163
+ value?: unknown;
2164
+ }[];
2165
+ type: "rules";
2166
+ default?: unknown;
2167
+ } | {
2168
+ type: "score";
2169
+ field: string;
2170
+ threshold: number;
2171
+ above?: unknown;
2172
+ below?: unknown;
2173
+ } | {
2174
+ type: "model";
2175
+ modelId: string;
2176
+ inputs: string[];
2177
+ outputMapping: Record<string, unknown>;
2178
+ default?: unknown;
2179
+ } | {
2180
+ type: "external";
2181
+ endpoint: string;
2182
+ default?: unknown;
2183
+ method?: "GET" | "POST" | undefined;
2184
+ timeoutMs?: number | undefined;
2185
+ } | null | undefined;
2186
+ }[] | undefined;
2187
+ anchorId?: string | undefined;
2188
+ position?: "prepend" | "append" | "before" | "after" | undefined;
2189
+ order?: string[] | undefined;
2190
+ }, {
2191
+ operation: "add" | "remove" | "reorder" | "replace";
2192
+ kind: "faq:update";
2193
+ itemId?: string | undefined;
2194
+ items?: {
2195
+ config: {
2196
+ question: string;
2197
+ answer: string | {
2198
+ type: "rich";
2199
+ html: string;
2200
+ } | {
2201
+ type: "markdown";
2202
+ content: string;
2203
+ assets?: {
2204
+ type: "image" | "video";
2205
+ id: string;
2206
+ src: string;
2207
+ width?: number | undefined;
2208
+ height?: number | undefined;
2209
+ alt?: string | undefined;
2210
+ }[] | undefined;
2211
+ };
2212
+ id: string;
2213
+ priority?: number | undefined;
2214
+ category?: string | undefined;
2215
+ answerStrategy?: {
2216
+ endpoint: string;
2217
+ context?: string[] | undefined;
2218
+ cache?: "session" | "none" | undefined;
2219
+ fallback?: string | undefined;
2220
+ } | undefined;
2221
+ };
2222
+ kind: "faq:question";
2223
+ showWhen?: {
2224
+ rules: {
2225
+ conditions: z.objectInputType<{
2226
+ type: z.ZodString;
2227
+ }, z.ZodTypeAny, "passthrough">[];
2228
+ value?: unknown;
2229
+ }[];
2230
+ type: "rules";
2231
+ default?: unknown;
2232
+ } | {
2233
+ type: "score";
2234
+ field: string;
2235
+ threshold: number;
2236
+ above?: unknown;
2237
+ below?: unknown;
2238
+ } | {
2239
+ type: "model";
2240
+ modelId: string;
2241
+ inputs: string[];
2242
+ outputMapping: Record<string, unknown>;
2243
+ default?: unknown;
2244
+ } | {
2245
+ type: "external";
2246
+ endpoint: string;
2247
+ default?: unknown;
2248
+ method?: "GET" | "POST" | undefined;
2249
+ timeoutMs?: number | undefined;
2250
+ } | null | undefined;
2251
+ }[] | undefined;
2252
+ anchorId?: string | undefined;
2253
+ position?: "prepend" | "append" | "before" | "after" | undefined;
2254
+ order?: string[] | undefined;
2255
+ }>;
2256
+ /**
2257
+ * Validate a FAQ question action.
2258
+ */
2259
+ export declare function validateFAQQuestion(data: unknown): z.SafeParseReturnType<{
2260
+ config: {
2261
+ question: string;
2262
+ answer: string | {
2263
+ type: "rich";
2264
+ html: string;
2265
+ } | {
2266
+ type: "markdown";
2267
+ content: string;
2268
+ assets?: {
2269
+ type: "image" | "video";
2270
+ id: string;
2271
+ src: string;
2272
+ width?: number | undefined;
2273
+ height?: number | undefined;
2274
+ alt?: string | undefined;
2275
+ }[] | undefined;
2276
+ };
2277
+ id: string;
2278
+ priority?: number | undefined;
2279
+ category?: string | undefined;
2280
+ answerStrategy?: {
2281
+ endpoint: string;
2282
+ context?: string[] | undefined;
2283
+ cache?: "session" | "none" | undefined;
2284
+ fallback?: string | undefined;
2285
+ } | undefined;
2286
+ };
2287
+ kind: "faq:question";
2288
+ showWhen?: {
2289
+ rules: {
2290
+ conditions: z.objectInputType<{
2291
+ type: z.ZodString;
2292
+ }, z.ZodTypeAny, "passthrough">[];
2293
+ value?: unknown;
2294
+ }[];
2295
+ type: "rules";
2296
+ default?: unknown;
2297
+ } | {
2298
+ type: "score";
2299
+ field: string;
2300
+ threshold: number;
2301
+ above?: unknown;
2302
+ below?: unknown;
2303
+ } | {
2304
+ type: "model";
2305
+ modelId: string;
2306
+ inputs: string[];
2307
+ outputMapping: Record<string, unknown>;
2308
+ default?: unknown;
2309
+ } | {
2310
+ type: "external";
2311
+ endpoint: string;
2312
+ default?: unknown;
2313
+ method?: "GET" | "POST" | undefined;
2314
+ timeoutMs?: number | undefined;
2315
+ } | null | undefined;
2316
+ }, {
2317
+ config: {
2318
+ question: string;
2319
+ answer: string | {
2320
+ type: "rich";
2321
+ html: string;
2322
+ } | {
2323
+ type: "markdown";
2324
+ content: string;
2325
+ assets?: {
2326
+ type: "image" | "video";
2327
+ id: string;
2328
+ src: string;
2329
+ width?: number | undefined;
2330
+ height?: number | undefined;
2331
+ alt?: string | undefined;
2332
+ }[] | undefined;
2333
+ };
2334
+ id: string;
2335
+ priority?: number | undefined;
2336
+ category?: string | undefined;
2337
+ answerStrategy?: {
2338
+ endpoint: string;
2339
+ context?: string[] | undefined;
2340
+ cache?: "session" | "none" | undefined;
2341
+ fallback?: string | undefined;
2342
+ } | undefined;
2343
+ };
2344
+ kind: "faq:question";
2345
+ showWhen?: {
2346
+ rules: {
2347
+ conditions: z.objectOutputType<{
2348
+ type: z.ZodString;
2349
+ }, z.ZodTypeAny, "passthrough">[];
2350
+ value?: unknown;
2351
+ }[];
2352
+ type: "rules";
2353
+ default?: unknown;
2354
+ } | {
2355
+ type: "score";
2356
+ field: string;
2357
+ threshold: number;
2358
+ above?: unknown;
2359
+ below?: unknown;
2360
+ } | {
2361
+ type: "model";
2362
+ modelId: string;
2363
+ inputs: string[];
2364
+ outputMapping: Record<string, unknown>;
2365
+ default?: unknown;
2366
+ } | {
2367
+ type: "external";
2368
+ endpoint: string;
2369
+ default?: unknown;
2370
+ method?: "GET" | "POST" | undefined;
2371
+ timeoutMs?: number | undefined;
2372
+ } | null | undefined;
2373
+ }>;
2374
+ /**
2375
+ * Validate the full FAQ config.
2376
+ */
2377
+ export declare function validateFAQConfig(data: unknown): z.SafeParseReturnType<{
2378
+ theme?: "light" | "dark" | "auto" | undefined;
2379
+ searchable?: boolean | undefined;
2380
+ expandBehavior?: "single" | "multiple" | undefined;
2381
+ actions?: {
2382
+ config: {
2383
+ question: string;
2384
+ answer: string | {
2385
+ type: "rich";
2386
+ html: string;
2387
+ } | {
2388
+ type: "markdown";
2389
+ content: string;
2390
+ assets?: {
2391
+ type: "image" | "video";
2392
+ id: string;
2393
+ src: string;
2394
+ width?: number | undefined;
2395
+ height?: number | undefined;
2396
+ alt?: string | undefined;
2397
+ }[] | undefined;
2398
+ };
2399
+ id: string;
2400
+ priority?: number | undefined;
2401
+ category?: string | undefined;
2402
+ answerStrategy?: {
2403
+ endpoint: string;
2404
+ context?: string[] | undefined;
2405
+ cache?: "session" | "none" | undefined;
2406
+ fallback?: string | undefined;
2407
+ } | undefined;
2408
+ };
2409
+ kind: "faq:question";
2410
+ showWhen?: {
2411
+ rules: {
2412
+ conditions: z.objectInputType<{
2413
+ type: z.ZodString;
2414
+ }, z.ZodTypeAny, "passthrough">[];
2415
+ value?: unknown;
2416
+ }[];
2417
+ type: "rules";
2418
+ default?: unknown;
2419
+ } | {
2420
+ type: "score";
2421
+ field: string;
2422
+ threshold: number;
2423
+ above?: unknown;
2424
+ below?: unknown;
2425
+ } | {
2426
+ type: "model";
2427
+ modelId: string;
2428
+ inputs: string[];
2429
+ outputMapping: Record<string, unknown>;
2430
+ default?: unknown;
2431
+ } | {
2432
+ type: "external";
2433
+ endpoint: string;
2434
+ default?: unknown;
2435
+ method?: "GET" | "POST" | undefined;
2436
+ timeoutMs?: number | undefined;
2437
+ } | null | undefined;
2438
+ }[] | undefined;
2439
+ feedback?: boolean | {
2440
+ style: "thumbs" | "rating";
2441
+ prompt?: string | undefined;
2442
+ } | undefined;
2443
+ ordering?: "static" | "priority" | {
2444
+ type: "segment";
2445
+ segmentWeights: Record<string, string[]>;
2446
+ } | undefined;
2447
+ injections?: {
2448
+ items: {
2449
+ config: {
2450
+ question: string;
2451
+ answer: string | {
2452
+ type: "rich";
2453
+ html: string;
2454
+ } | {
2455
+ type: "markdown";
2456
+ content: string;
2457
+ assets?: {
2458
+ type: "image" | "video";
2459
+ id: string;
2460
+ src: string;
2461
+ width?: number | undefined;
2462
+ height?: number | undefined;
2463
+ alt?: string | undefined;
2464
+ }[] | undefined;
2465
+ };
2466
+ id: string;
2467
+ priority?: number | undefined;
2468
+ category?: string | undefined;
2469
+ answerStrategy?: {
2470
+ endpoint: string;
2471
+ context?: string[] | undefined;
2472
+ cache?: "session" | "none" | undefined;
2473
+ fallback?: string | undefined;
2474
+ } | undefined;
2475
+ };
2476
+ kind: "faq:question";
2477
+ showWhen?: {
2478
+ rules: {
2479
+ conditions: z.objectInputType<{
2480
+ type: z.ZodString;
2481
+ }, z.ZodTypeAny, "passthrough">[];
2482
+ value?: unknown;
2483
+ }[];
2484
+ type: "rules";
2485
+ default?: unknown;
2486
+ } | {
2487
+ type: "score";
2488
+ field: string;
2489
+ threshold: number;
2490
+ above?: unknown;
2491
+ below?: unknown;
2492
+ } | {
2493
+ type: "model";
2494
+ modelId: string;
2495
+ inputs: string[];
2496
+ outputMapping: Record<string, unknown>;
2497
+ default?: unknown;
2498
+ } | {
2499
+ type: "external";
2500
+ endpoint: string;
2501
+ default?: unknown;
2502
+ method?: "GET" | "POST" | undefined;
2503
+ timeoutMs?: number | undefined;
2504
+ } | null | undefined;
2505
+ }[];
2506
+ trigger: {
2507
+ rules: {
2508
+ conditions: z.objectInputType<{
2509
+ type: z.ZodString;
2510
+ }, z.ZodTypeAny, "passthrough">[];
2511
+ value?: unknown;
2512
+ }[];
2513
+ type: "rules";
2514
+ default?: unknown;
2515
+ } | {
2516
+ type: "score";
2517
+ field: string;
2518
+ threshold: number;
2519
+ above?: unknown;
2520
+ below?: unknown;
2521
+ } | {
2522
+ type: "model";
2523
+ modelId: string;
2524
+ inputs: string[];
2525
+ outputMapping: Record<string, unknown>;
2526
+ default?: unknown;
2527
+ } | {
2528
+ type: "external";
2529
+ endpoint: string;
2530
+ default?: unknown;
2531
+ method?: "GET" | "POST" | undefined;
2532
+ timeoutMs?: number | undefined;
2533
+ };
2534
+ position?: "prepend" | "append" | undefined;
2535
+ once?: boolean | undefined;
2536
+ }[] | undefined;
2537
+ }, {
2538
+ theme: "light" | "dark" | "auto";
2539
+ searchable: boolean;
2540
+ expandBehavior: "single" | "multiple";
2541
+ actions: {
2542
+ config: {
2543
+ question: string;
2544
+ answer: string | {
2545
+ type: "rich";
2546
+ html: string;
2547
+ } | {
2548
+ type: "markdown";
2549
+ content: string;
2550
+ assets?: {
2551
+ type: "image" | "video";
2552
+ id: string;
2553
+ src: string;
2554
+ width?: number | undefined;
2555
+ height?: number | undefined;
2556
+ alt?: string | undefined;
2557
+ }[] | undefined;
2558
+ };
2559
+ id: string;
2560
+ priority?: number | undefined;
2561
+ category?: string | undefined;
2562
+ answerStrategy?: {
2563
+ endpoint: string;
2564
+ context?: string[] | undefined;
2565
+ cache?: "session" | "none" | undefined;
2566
+ fallback?: string | undefined;
2567
+ } | undefined;
2568
+ };
2569
+ kind: "faq:question";
2570
+ showWhen?: {
2571
+ rules: {
2572
+ conditions: z.objectOutputType<{
2573
+ type: z.ZodString;
2574
+ }, z.ZodTypeAny, "passthrough">[];
2575
+ value?: unknown;
2576
+ }[];
2577
+ type: "rules";
2578
+ default?: unknown;
2579
+ } | {
2580
+ type: "score";
2581
+ field: string;
2582
+ threshold: number;
2583
+ above?: unknown;
2584
+ below?: unknown;
2585
+ } | {
2586
+ type: "model";
2587
+ modelId: string;
2588
+ inputs: string[];
2589
+ outputMapping: Record<string, unknown>;
2590
+ default?: unknown;
2591
+ } | {
2592
+ type: "external";
2593
+ endpoint: string;
2594
+ default?: unknown;
2595
+ method?: "GET" | "POST" | undefined;
2596
+ timeoutMs?: number | undefined;
2597
+ } | null | undefined;
2598
+ }[];
2599
+ feedback?: boolean | {
2600
+ style: "thumbs" | "rating";
2601
+ prompt?: string | undefined;
2602
+ } | undefined;
2603
+ ordering?: "static" | "priority" | {
2604
+ type: "segment";
2605
+ segmentWeights: Record<string, string[]>;
2606
+ } | undefined;
2607
+ injections?: {
2608
+ items: {
2609
+ config: {
2610
+ question: string;
2611
+ answer: string | {
2612
+ type: "rich";
2613
+ html: string;
2614
+ } | {
2615
+ type: "markdown";
2616
+ content: string;
2617
+ assets?: {
2618
+ type: "image" | "video";
2619
+ id: string;
2620
+ src: string;
2621
+ width?: number | undefined;
2622
+ height?: number | undefined;
2623
+ alt?: string | undefined;
2624
+ }[] | undefined;
2625
+ };
2626
+ id: string;
2627
+ priority?: number | undefined;
2628
+ category?: string | undefined;
2629
+ answerStrategy?: {
2630
+ endpoint: string;
2631
+ context?: string[] | undefined;
2632
+ cache?: "session" | "none" | undefined;
2633
+ fallback?: string | undefined;
2634
+ } | undefined;
2635
+ };
2636
+ kind: "faq:question";
2637
+ showWhen?: {
2638
+ rules: {
2639
+ conditions: z.objectOutputType<{
2640
+ type: z.ZodString;
2641
+ }, z.ZodTypeAny, "passthrough">[];
2642
+ value?: unknown;
2643
+ }[];
2644
+ type: "rules";
2645
+ default?: unknown;
2646
+ } | {
2647
+ type: "score";
2648
+ field: string;
2649
+ threshold: number;
2650
+ above?: unknown;
2651
+ below?: unknown;
2652
+ } | {
2653
+ type: "model";
2654
+ modelId: string;
2655
+ inputs: string[];
2656
+ outputMapping: Record<string, unknown>;
2657
+ default?: unknown;
2658
+ } | {
2659
+ type: "external";
2660
+ endpoint: string;
2661
+ default?: unknown;
2662
+ method?: "GET" | "POST" | undefined;
2663
+ timeoutMs?: number | undefined;
2664
+ } | null | undefined;
2665
+ }[];
2666
+ trigger: {
2667
+ rules: {
2668
+ conditions: z.objectOutputType<{
2669
+ type: z.ZodString;
2670
+ }, z.ZodTypeAny, "passthrough">[];
2671
+ value?: unknown;
2672
+ }[];
2673
+ type: "rules";
2674
+ default?: unknown;
2675
+ } | {
2676
+ type: "score";
2677
+ field: string;
2678
+ threshold: number;
2679
+ above?: unknown;
2680
+ below?: unknown;
2681
+ } | {
2682
+ type: "model";
2683
+ modelId: string;
2684
+ inputs: string[];
2685
+ outputMapping: Record<string, unknown>;
2686
+ default?: unknown;
2687
+ } | {
2688
+ type: "external";
2689
+ endpoint: string;
2690
+ default?: unknown;
2691
+ method?: "GET" | "POST" | undefined;
2692
+ timeoutMs?: number | undefined;
2693
+ };
2694
+ position?: "prepend" | "append" | undefined;
2695
+ once?: boolean | undefined;
2696
+ }[] | undefined;
652
2697
  }>;
653
2698
  //# sourceMappingURL=schema.d.ts.map