@kindlm/core 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/index.cjs +15 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +245 -100
- package/dist/index.d.ts +245 -100
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ interface ProviderAdapter {
|
|
|
71
71
|
complete(request: ProviderRequest): Promise<ProviderResponse>;
|
|
72
72
|
estimateCost(model: string, usage: ProviderResponse["usage"]): number | null;
|
|
73
73
|
supportsTools(model: string): boolean;
|
|
74
|
+
embed?(text: string, model?: string): Promise<number[]>;
|
|
74
75
|
}
|
|
75
76
|
interface ProviderAdapterConfig {
|
|
76
77
|
apiKey: string;
|
|
@@ -89,6 +90,7 @@ interface ConversationResult {
|
|
|
89
90
|
allToolCalls: ProviderToolCall[];
|
|
90
91
|
totalUsage: ProviderResponse["usage"];
|
|
91
92
|
totalLatencyMs: number;
|
|
93
|
+
truncated: boolean;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
type Result<T, E = KindlmError> = {
|
|
@@ -188,22 +190,22 @@ declare const ToolCallExpectSchema: z.ZodObject<{
|
|
|
188
190
|
shouldNotCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
189
191
|
argsMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
190
192
|
argsSchema: z.ZodOptional<z.ZodString>;
|
|
193
|
+
argsSchemaResolved: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
191
194
|
order: z.ZodOptional<z.ZodNumber>;
|
|
192
|
-
responseContains: z.ZodOptional<z.ZodString>;
|
|
193
195
|
}, "strip", z.ZodTypeAny, {
|
|
194
196
|
tool: string;
|
|
195
197
|
shouldNotCall: boolean;
|
|
196
198
|
argsMatch?: Record<string, unknown> | undefined;
|
|
197
199
|
argsSchema?: string | undefined;
|
|
200
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
198
201
|
order?: number | undefined;
|
|
199
|
-
responseContains?: string | undefined;
|
|
200
202
|
}, {
|
|
201
203
|
tool: string;
|
|
202
204
|
shouldNotCall?: boolean | undefined;
|
|
203
205
|
argsMatch?: Record<string, unknown> | undefined;
|
|
204
206
|
argsSchema?: string | undefined;
|
|
207
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
205
208
|
order?: number | undefined;
|
|
206
|
-
responseContains?: string | undefined;
|
|
207
209
|
}>;
|
|
208
210
|
declare const ExpectSchema: z.ZodObject<{
|
|
209
211
|
output: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
@@ -324,22 +326,22 @@ declare const ExpectSchema: z.ZodObject<{
|
|
|
324
326
|
shouldNotCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
325
327
|
argsMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
326
328
|
argsSchema: z.ZodOptional<z.ZodString>;
|
|
329
|
+
argsSchemaResolved: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
327
330
|
order: z.ZodOptional<z.ZodNumber>;
|
|
328
|
-
responseContains: z.ZodOptional<z.ZodString>;
|
|
329
331
|
}, "strip", z.ZodTypeAny, {
|
|
330
332
|
tool: string;
|
|
331
333
|
shouldNotCall: boolean;
|
|
332
334
|
argsMatch?: Record<string, unknown> | undefined;
|
|
333
335
|
argsSchema?: string | undefined;
|
|
336
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
334
337
|
order?: number | undefined;
|
|
335
|
-
responseContains?: string | undefined;
|
|
336
338
|
}, {
|
|
337
339
|
tool: string;
|
|
338
340
|
shouldNotCall?: boolean | undefined;
|
|
339
341
|
argsMatch?: Record<string, unknown> | undefined;
|
|
340
342
|
argsSchema?: string | undefined;
|
|
343
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
341
344
|
order?: number | undefined;
|
|
342
|
-
responseContains?: string | undefined;
|
|
343
345
|
}>, "many">>;
|
|
344
346
|
baseline: z.ZodOptional<z.ZodObject<{
|
|
345
347
|
drift: z.ZodOptional<z.ZodObject<{
|
|
@@ -368,6 +370,20 @@ declare const ExpectSchema: z.ZodObject<{
|
|
|
368
370
|
fields?: string[] | undefined;
|
|
369
371
|
} | undefined;
|
|
370
372
|
}>>;
|
|
373
|
+
latency: z.ZodOptional<z.ZodObject<{
|
|
374
|
+
maxMs: z.ZodNumber;
|
|
375
|
+
}, "strip", z.ZodTypeAny, {
|
|
376
|
+
maxMs: number;
|
|
377
|
+
}, {
|
|
378
|
+
maxMs: number;
|
|
379
|
+
}>>;
|
|
380
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
381
|
+
maxUsd: z.ZodNumber;
|
|
382
|
+
}, "strip", z.ZodTypeAny, {
|
|
383
|
+
maxUsd: number;
|
|
384
|
+
}, {
|
|
385
|
+
maxUsd: number;
|
|
386
|
+
}>>;
|
|
371
387
|
}, "strip", z.ZodTypeAny, {
|
|
372
388
|
judge?: {
|
|
373
389
|
criteria: string;
|
|
@@ -401,8 +417,8 @@ declare const ExpectSchema: z.ZodObject<{
|
|
|
401
417
|
shouldNotCall: boolean;
|
|
402
418
|
argsMatch?: Record<string, unknown> | undefined;
|
|
403
419
|
argsSchema?: string | undefined;
|
|
420
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
404
421
|
order?: number | undefined;
|
|
405
|
-
responseContains?: string | undefined;
|
|
406
422
|
}[] | undefined;
|
|
407
423
|
baseline?: {
|
|
408
424
|
drift?: {
|
|
@@ -411,6 +427,12 @@ declare const ExpectSchema: z.ZodObject<{
|
|
|
411
427
|
fields?: string[] | undefined;
|
|
412
428
|
} | undefined;
|
|
413
429
|
} | undefined;
|
|
430
|
+
latency?: {
|
|
431
|
+
maxMs: number;
|
|
432
|
+
} | undefined;
|
|
433
|
+
cost?: {
|
|
434
|
+
maxUsd: number;
|
|
435
|
+
} | undefined;
|
|
414
436
|
}, {
|
|
415
437
|
judge?: {
|
|
416
438
|
criteria: string;
|
|
@@ -444,8 +466,8 @@ declare const ExpectSchema: z.ZodObject<{
|
|
|
444
466
|
shouldNotCall?: boolean | undefined;
|
|
445
467
|
argsMatch?: Record<string, unknown> | undefined;
|
|
446
468
|
argsSchema?: string | undefined;
|
|
469
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
447
470
|
order?: number | undefined;
|
|
448
|
-
responseContains?: string | undefined;
|
|
449
471
|
}[] | undefined;
|
|
450
472
|
baseline?: {
|
|
451
473
|
drift?: {
|
|
@@ -454,6 +476,12 @@ declare const ExpectSchema: z.ZodObject<{
|
|
|
454
476
|
fields?: string[] | undefined;
|
|
455
477
|
} | undefined;
|
|
456
478
|
} | undefined;
|
|
479
|
+
latency?: {
|
|
480
|
+
maxMs: number;
|
|
481
|
+
} | undefined;
|
|
482
|
+
cost?: {
|
|
483
|
+
maxUsd: number;
|
|
484
|
+
} | undefined;
|
|
457
485
|
}>;
|
|
458
486
|
declare const ToolSimulationSchema: z.ZodObject<{
|
|
459
487
|
name: z.ZodString;
|
|
@@ -649,22 +677,22 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
649
677
|
shouldNotCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
650
678
|
argsMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
651
679
|
argsSchema: z.ZodOptional<z.ZodString>;
|
|
680
|
+
argsSchemaResolved: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
652
681
|
order: z.ZodOptional<z.ZodNumber>;
|
|
653
|
-
responseContains: z.ZodOptional<z.ZodString>;
|
|
654
682
|
}, "strip", z.ZodTypeAny, {
|
|
655
683
|
tool: string;
|
|
656
684
|
shouldNotCall: boolean;
|
|
657
685
|
argsMatch?: Record<string, unknown> | undefined;
|
|
658
686
|
argsSchema?: string | undefined;
|
|
687
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
659
688
|
order?: number | undefined;
|
|
660
|
-
responseContains?: string | undefined;
|
|
661
689
|
}, {
|
|
662
690
|
tool: string;
|
|
663
691
|
shouldNotCall?: boolean | undefined;
|
|
664
692
|
argsMatch?: Record<string, unknown> | undefined;
|
|
665
693
|
argsSchema?: string | undefined;
|
|
694
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
666
695
|
order?: number | undefined;
|
|
667
|
-
responseContains?: string | undefined;
|
|
668
696
|
}>, "many">>;
|
|
669
697
|
baseline: z.ZodOptional<z.ZodObject<{
|
|
670
698
|
drift: z.ZodOptional<z.ZodObject<{
|
|
@@ -693,6 +721,20 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
693
721
|
fields?: string[] | undefined;
|
|
694
722
|
} | undefined;
|
|
695
723
|
}>>;
|
|
724
|
+
latency: z.ZodOptional<z.ZodObject<{
|
|
725
|
+
maxMs: z.ZodNumber;
|
|
726
|
+
}, "strip", z.ZodTypeAny, {
|
|
727
|
+
maxMs: number;
|
|
728
|
+
}, {
|
|
729
|
+
maxMs: number;
|
|
730
|
+
}>>;
|
|
731
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
732
|
+
maxUsd: z.ZodNumber;
|
|
733
|
+
}, "strip", z.ZodTypeAny, {
|
|
734
|
+
maxUsd: number;
|
|
735
|
+
}, {
|
|
736
|
+
maxUsd: number;
|
|
737
|
+
}>>;
|
|
696
738
|
}, "strip", z.ZodTypeAny, {
|
|
697
739
|
judge?: {
|
|
698
740
|
criteria: string;
|
|
@@ -726,8 +768,8 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
726
768
|
shouldNotCall: boolean;
|
|
727
769
|
argsMatch?: Record<string, unknown> | undefined;
|
|
728
770
|
argsSchema?: string | undefined;
|
|
771
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
729
772
|
order?: number | undefined;
|
|
730
|
-
responseContains?: string | undefined;
|
|
731
773
|
}[] | undefined;
|
|
732
774
|
baseline?: {
|
|
733
775
|
drift?: {
|
|
@@ -736,6 +778,12 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
736
778
|
fields?: string[] | undefined;
|
|
737
779
|
} | undefined;
|
|
738
780
|
} | undefined;
|
|
781
|
+
latency?: {
|
|
782
|
+
maxMs: number;
|
|
783
|
+
} | undefined;
|
|
784
|
+
cost?: {
|
|
785
|
+
maxUsd: number;
|
|
786
|
+
} | undefined;
|
|
739
787
|
}, {
|
|
740
788
|
judge?: {
|
|
741
789
|
criteria: string;
|
|
@@ -769,8 +817,8 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
769
817
|
shouldNotCall?: boolean | undefined;
|
|
770
818
|
argsMatch?: Record<string, unknown> | undefined;
|
|
771
819
|
argsSchema?: string | undefined;
|
|
820
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
772
821
|
order?: number | undefined;
|
|
773
|
-
responseContains?: string | undefined;
|
|
774
822
|
}[] | undefined;
|
|
775
823
|
baseline?: {
|
|
776
824
|
drift?: {
|
|
@@ -779,6 +827,12 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
779
827
|
fields?: string[] | undefined;
|
|
780
828
|
} | undefined;
|
|
781
829
|
} | undefined;
|
|
830
|
+
latency?: {
|
|
831
|
+
maxMs: number;
|
|
832
|
+
} | undefined;
|
|
833
|
+
cost?: {
|
|
834
|
+
maxUsd: number;
|
|
835
|
+
} | undefined;
|
|
782
836
|
}>;
|
|
783
837
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
784
838
|
skip: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -818,8 +872,8 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
818
872
|
shouldNotCall: boolean;
|
|
819
873
|
argsMatch?: Record<string, unknown> | undefined;
|
|
820
874
|
argsSchema?: string | undefined;
|
|
875
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
821
876
|
order?: number | undefined;
|
|
822
|
-
responseContains?: string | undefined;
|
|
823
877
|
}[] | undefined;
|
|
824
878
|
baseline?: {
|
|
825
879
|
drift?: {
|
|
@@ -828,6 +882,12 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
828
882
|
fields?: string[] | undefined;
|
|
829
883
|
} | undefined;
|
|
830
884
|
} | undefined;
|
|
885
|
+
latency?: {
|
|
886
|
+
maxMs: number;
|
|
887
|
+
} | undefined;
|
|
888
|
+
cost?: {
|
|
889
|
+
maxUsd: number;
|
|
890
|
+
} | undefined;
|
|
831
891
|
};
|
|
832
892
|
skip: boolean;
|
|
833
893
|
prompt?: string | undefined;
|
|
@@ -880,8 +940,8 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
880
940
|
shouldNotCall?: boolean | undefined;
|
|
881
941
|
argsMatch?: Record<string, unknown> | undefined;
|
|
882
942
|
argsSchema?: string | undefined;
|
|
943
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
883
944
|
order?: number | undefined;
|
|
884
|
-
responseContains?: string | undefined;
|
|
885
945
|
}[] | undefined;
|
|
886
946
|
baseline?: {
|
|
887
947
|
drift?: {
|
|
@@ -890,6 +950,12 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
890
950
|
fields?: string[] | undefined;
|
|
891
951
|
} | undefined;
|
|
892
952
|
} | undefined;
|
|
953
|
+
latency?: {
|
|
954
|
+
maxMs: number;
|
|
955
|
+
} | undefined;
|
|
956
|
+
cost?: {
|
|
957
|
+
maxUsd: number;
|
|
958
|
+
} | undefined;
|
|
893
959
|
};
|
|
894
960
|
prompt?: string | undefined;
|
|
895
961
|
command?: string | undefined;
|
|
@@ -944,8 +1010,8 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
944
1010
|
shouldNotCall: boolean;
|
|
945
1011
|
argsMatch?: Record<string, unknown> | undefined;
|
|
946
1012
|
argsSchema?: string | undefined;
|
|
1013
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
947
1014
|
order?: number | undefined;
|
|
948
|
-
responseContains?: string | undefined;
|
|
949
1015
|
}[] | undefined;
|
|
950
1016
|
baseline?: {
|
|
951
1017
|
drift?: {
|
|
@@ -954,6 +1020,12 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
954
1020
|
fields?: string[] | undefined;
|
|
955
1021
|
} | undefined;
|
|
956
1022
|
} | undefined;
|
|
1023
|
+
latency?: {
|
|
1024
|
+
maxMs: number;
|
|
1025
|
+
} | undefined;
|
|
1026
|
+
cost?: {
|
|
1027
|
+
maxUsd: number;
|
|
1028
|
+
} | undefined;
|
|
957
1029
|
};
|
|
958
1030
|
skip: boolean;
|
|
959
1031
|
prompt?: string | undefined;
|
|
@@ -1006,8 +1078,8 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1006
1078
|
shouldNotCall?: boolean | undefined;
|
|
1007
1079
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1008
1080
|
argsSchema?: string | undefined;
|
|
1081
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1009
1082
|
order?: number | undefined;
|
|
1010
|
-
responseContains?: string | undefined;
|
|
1011
1083
|
}[] | undefined;
|
|
1012
1084
|
baseline?: {
|
|
1013
1085
|
drift?: {
|
|
@@ -1016,6 +1088,12 @@ declare const TestCaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1016
1088
|
fields?: string[] | undefined;
|
|
1017
1089
|
} | undefined;
|
|
1018
1090
|
} | undefined;
|
|
1091
|
+
latency?: {
|
|
1092
|
+
maxMs: number;
|
|
1093
|
+
} | undefined;
|
|
1094
|
+
cost?: {
|
|
1095
|
+
maxUsd: number;
|
|
1096
|
+
} | undefined;
|
|
1019
1097
|
};
|
|
1020
1098
|
prompt?: string | undefined;
|
|
1021
1099
|
command?: string | undefined;
|
|
@@ -1560,22 +1638,22 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1560
1638
|
shouldNotCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1561
1639
|
argsMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1562
1640
|
argsSchema: z.ZodOptional<z.ZodString>;
|
|
1641
|
+
argsSchemaResolved: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1563
1642
|
order: z.ZodOptional<z.ZodNumber>;
|
|
1564
|
-
responseContains: z.ZodOptional<z.ZodString>;
|
|
1565
1643
|
}, "strip", z.ZodTypeAny, {
|
|
1566
1644
|
tool: string;
|
|
1567
1645
|
shouldNotCall: boolean;
|
|
1568
1646
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1569
1647
|
argsSchema?: string | undefined;
|
|
1648
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1570
1649
|
order?: number | undefined;
|
|
1571
|
-
responseContains?: string | undefined;
|
|
1572
1650
|
}, {
|
|
1573
1651
|
tool: string;
|
|
1574
1652
|
shouldNotCall?: boolean | undefined;
|
|
1575
1653
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1576
1654
|
argsSchema?: string | undefined;
|
|
1655
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1577
1656
|
order?: number | undefined;
|
|
1578
|
-
responseContains?: string | undefined;
|
|
1579
1657
|
}>, "many">>;
|
|
1580
1658
|
baseline: z.ZodOptional<z.ZodObject<{
|
|
1581
1659
|
drift: z.ZodOptional<z.ZodObject<{
|
|
@@ -1604,6 +1682,20 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1604
1682
|
fields?: string[] | undefined;
|
|
1605
1683
|
} | undefined;
|
|
1606
1684
|
}>>;
|
|
1685
|
+
latency: z.ZodOptional<z.ZodObject<{
|
|
1686
|
+
maxMs: z.ZodNumber;
|
|
1687
|
+
}, "strip", z.ZodTypeAny, {
|
|
1688
|
+
maxMs: number;
|
|
1689
|
+
}, {
|
|
1690
|
+
maxMs: number;
|
|
1691
|
+
}>>;
|
|
1692
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
1693
|
+
maxUsd: z.ZodNumber;
|
|
1694
|
+
}, "strip", z.ZodTypeAny, {
|
|
1695
|
+
maxUsd: number;
|
|
1696
|
+
}, {
|
|
1697
|
+
maxUsd: number;
|
|
1698
|
+
}>>;
|
|
1607
1699
|
}, "strip", z.ZodTypeAny, {
|
|
1608
1700
|
judge?: {
|
|
1609
1701
|
criteria: string;
|
|
@@ -1637,8 +1729,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1637
1729
|
shouldNotCall: boolean;
|
|
1638
1730
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1639
1731
|
argsSchema?: string | undefined;
|
|
1732
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1640
1733
|
order?: number | undefined;
|
|
1641
|
-
responseContains?: string | undefined;
|
|
1642
1734
|
}[] | undefined;
|
|
1643
1735
|
baseline?: {
|
|
1644
1736
|
drift?: {
|
|
@@ -1647,6 +1739,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1647
1739
|
fields?: string[] | undefined;
|
|
1648
1740
|
} | undefined;
|
|
1649
1741
|
} | undefined;
|
|
1742
|
+
latency?: {
|
|
1743
|
+
maxMs: number;
|
|
1744
|
+
} | undefined;
|
|
1745
|
+
cost?: {
|
|
1746
|
+
maxUsd: number;
|
|
1747
|
+
} | undefined;
|
|
1650
1748
|
}, {
|
|
1651
1749
|
judge?: {
|
|
1652
1750
|
criteria: string;
|
|
@@ -1680,8 +1778,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1680
1778
|
shouldNotCall?: boolean | undefined;
|
|
1681
1779
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1682
1780
|
argsSchema?: string | undefined;
|
|
1781
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1683
1782
|
order?: number | undefined;
|
|
1684
|
-
responseContains?: string | undefined;
|
|
1685
1783
|
}[] | undefined;
|
|
1686
1784
|
baseline?: {
|
|
1687
1785
|
drift?: {
|
|
@@ -1690,6 +1788,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1690
1788
|
fields?: string[] | undefined;
|
|
1691
1789
|
} | undefined;
|
|
1692
1790
|
} | undefined;
|
|
1791
|
+
latency?: {
|
|
1792
|
+
maxMs: number;
|
|
1793
|
+
} | undefined;
|
|
1794
|
+
cost?: {
|
|
1795
|
+
maxUsd: number;
|
|
1796
|
+
} | undefined;
|
|
1693
1797
|
}>;
|
|
1694
1798
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1695
1799
|
skip: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -1729,8 +1833,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1729
1833
|
shouldNotCall: boolean;
|
|
1730
1834
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1731
1835
|
argsSchema?: string | undefined;
|
|
1836
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1732
1837
|
order?: number | undefined;
|
|
1733
|
-
responseContains?: string | undefined;
|
|
1734
1838
|
}[] | undefined;
|
|
1735
1839
|
baseline?: {
|
|
1736
1840
|
drift?: {
|
|
@@ -1739,6 +1843,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1739
1843
|
fields?: string[] | undefined;
|
|
1740
1844
|
} | undefined;
|
|
1741
1845
|
} | undefined;
|
|
1846
|
+
latency?: {
|
|
1847
|
+
maxMs: number;
|
|
1848
|
+
} | undefined;
|
|
1849
|
+
cost?: {
|
|
1850
|
+
maxUsd: number;
|
|
1851
|
+
} | undefined;
|
|
1742
1852
|
};
|
|
1743
1853
|
skip: boolean;
|
|
1744
1854
|
prompt?: string | undefined;
|
|
@@ -1791,8 +1901,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1791
1901
|
shouldNotCall?: boolean | undefined;
|
|
1792
1902
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1793
1903
|
argsSchema?: string | undefined;
|
|
1904
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1794
1905
|
order?: number | undefined;
|
|
1795
|
-
responseContains?: string | undefined;
|
|
1796
1906
|
}[] | undefined;
|
|
1797
1907
|
baseline?: {
|
|
1798
1908
|
drift?: {
|
|
@@ -1801,6 +1911,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1801
1911
|
fields?: string[] | undefined;
|
|
1802
1912
|
} | undefined;
|
|
1803
1913
|
} | undefined;
|
|
1914
|
+
latency?: {
|
|
1915
|
+
maxMs: number;
|
|
1916
|
+
} | undefined;
|
|
1917
|
+
cost?: {
|
|
1918
|
+
maxUsd: number;
|
|
1919
|
+
} | undefined;
|
|
1804
1920
|
};
|
|
1805
1921
|
prompt?: string | undefined;
|
|
1806
1922
|
command?: string | undefined;
|
|
@@ -1855,8 +1971,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1855
1971
|
shouldNotCall: boolean;
|
|
1856
1972
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1857
1973
|
argsSchema?: string | undefined;
|
|
1974
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1858
1975
|
order?: number | undefined;
|
|
1859
|
-
responseContains?: string | undefined;
|
|
1860
1976
|
}[] | undefined;
|
|
1861
1977
|
baseline?: {
|
|
1862
1978
|
drift?: {
|
|
@@ -1865,6 +1981,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1865
1981
|
fields?: string[] | undefined;
|
|
1866
1982
|
} | undefined;
|
|
1867
1983
|
} | undefined;
|
|
1984
|
+
latency?: {
|
|
1985
|
+
maxMs: number;
|
|
1986
|
+
} | undefined;
|
|
1987
|
+
cost?: {
|
|
1988
|
+
maxUsd: number;
|
|
1989
|
+
} | undefined;
|
|
1868
1990
|
};
|
|
1869
1991
|
skip: boolean;
|
|
1870
1992
|
prompt?: string | undefined;
|
|
@@ -1917,8 +2039,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1917
2039
|
shouldNotCall?: boolean | undefined;
|
|
1918
2040
|
argsMatch?: Record<string, unknown> | undefined;
|
|
1919
2041
|
argsSchema?: string | undefined;
|
|
2042
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
1920
2043
|
order?: number | undefined;
|
|
1921
|
-
responseContains?: string | undefined;
|
|
1922
2044
|
}[] | undefined;
|
|
1923
2045
|
baseline?: {
|
|
1924
2046
|
drift?: {
|
|
@@ -1927,6 +2049,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
1927
2049
|
fields?: string[] | undefined;
|
|
1928
2050
|
} | undefined;
|
|
1929
2051
|
} | undefined;
|
|
2052
|
+
latency?: {
|
|
2053
|
+
maxMs: number;
|
|
2054
|
+
} | undefined;
|
|
2055
|
+
cost?: {
|
|
2056
|
+
maxUsd: number;
|
|
2057
|
+
} | undefined;
|
|
1930
2058
|
};
|
|
1931
2059
|
prompt?: string | undefined;
|
|
1932
2060
|
command?: string | undefined;
|
|
@@ -2099,18 +2227,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2099
2227
|
}>>;
|
|
2100
2228
|
upload: z.ZodDefault<z.ZodObject<{
|
|
2101
2229
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2102
|
-
includeArtifacts: z.ZodDefault<z.ZodBoolean>;
|
|
2103
|
-
redactPatterns: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
2104
2230
|
apiUrl: z.ZodDefault<z.ZodString>;
|
|
2105
2231
|
}, "strip", z.ZodTypeAny, {
|
|
2106
2232
|
enabled: boolean;
|
|
2107
|
-
includeArtifacts: boolean;
|
|
2108
2233
|
apiUrl: string;
|
|
2109
|
-
redactPatterns?: string[] | undefined;
|
|
2110
2234
|
}, {
|
|
2111
2235
|
enabled?: boolean | undefined;
|
|
2112
|
-
includeArtifacts?: boolean | undefined;
|
|
2113
|
-
redactPatterns?: string[] | undefined;
|
|
2114
2236
|
apiUrl?: string | undefined;
|
|
2115
2237
|
}>>;
|
|
2116
2238
|
defaults: z.ZodDefault<z.ZodObject<{
|
|
@@ -2221,8 +2343,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2221
2343
|
shouldNotCall: boolean;
|
|
2222
2344
|
argsMatch?: Record<string, unknown> | undefined;
|
|
2223
2345
|
argsSchema?: string | undefined;
|
|
2346
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
2224
2347
|
order?: number | undefined;
|
|
2225
|
-
responseContains?: string | undefined;
|
|
2226
2348
|
}[] | undefined;
|
|
2227
2349
|
baseline?: {
|
|
2228
2350
|
drift?: {
|
|
@@ -2231,6 +2353,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2231
2353
|
fields?: string[] | undefined;
|
|
2232
2354
|
} | undefined;
|
|
2233
2355
|
} | undefined;
|
|
2356
|
+
latency?: {
|
|
2357
|
+
maxMs: number;
|
|
2358
|
+
} | undefined;
|
|
2359
|
+
cost?: {
|
|
2360
|
+
maxUsd: number;
|
|
2361
|
+
} | undefined;
|
|
2234
2362
|
};
|
|
2235
2363
|
skip: boolean;
|
|
2236
2364
|
prompt?: string | undefined;
|
|
@@ -2263,9 +2391,7 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2263
2391
|
};
|
|
2264
2392
|
upload: {
|
|
2265
2393
|
enabled: boolean;
|
|
2266
|
-
includeArtifacts: boolean;
|
|
2267
2394
|
apiUrl: string;
|
|
2268
|
-
redactPatterns?: string[] | undefined;
|
|
2269
2395
|
};
|
|
2270
2396
|
defaults: {
|
|
2271
2397
|
timeoutMs: number;
|
|
@@ -2393,8 +2519,8 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2393
2519
|
shouldNotCall?: boolean | undefined;
|
|
2394
2520
|
argsMatch?: Record<string, unknown> | undefined;
|
|
2395
2521
|
argsSchema?: string | undefined;
|
|
2522
|
+
argsSchemaResolved?: Record<string, unknown> | undefined;
|
|
2396
2523
|
order?: number | undefined;
|
|
2397
|
-
responseContains?: string | undefined;
|
|
2398
2524
|
}[] | undefined;
|
|
2399
2525
|
baseline?: {
|
|
2400
2526
|
drift?: {
|
|
@@ -2403,6 +2529,12 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2403
2529
|
fields?: string[] | undefined;
|
|
2404
2530
|
} | undefined;
|
|
2405
2531
|
} | undefined;
|
|
2532
|
+
latency?: {
|
|
2533
|
+
maxMs: number;
|
|
2534
|
+
} | undefined;
|
|
2535
|
+
cost?: {
|
|
2536
|
+
maxUsd: number;
|
|
2537
|
+
} | undefined;
|
|
2406
2538
|
};
|
|
2407
2539
|
prompt?: string | undefined;
|
|
2408
2540
|
command?: string | undefined;
|
|
@@ -2465,8 +2597,6 @@ declare const KindLMConfigSchema: z.ZodObject<{
|
|
|
2465
2597
|
} | undefined;
|
|
2466
2598
|
upload?: {
|
|
2467
2599
|
enabled?: boolean | undefined;
|
|
2468
|
-
includeArtifacts?: boolean | undefined;
|
|
2469
|
-
redactPatterns?: string[] | undefined;
|
|
2470
2600
|
apiUrl?: string | undefined;
|
|
2471
2601
|
} | undefined;
|
|
2472
2602
|
defaults?: {
|
|
@@ -2660,58 +2790,7 @@ type TraceConfig = z.infer<typeof TraceConfigSchema>;
|
|
|
2660
2790
|
type SpanMapping = z.infer<typeof SpanMappingSchema>;
|
|
2661
2791
|
type SpanFilter = z.infer<typeof SpanFilterSchema>;
|
|
2662
2792
|
|
|
2663
|
-
|
|
2664
|
-
title: string;
|
|
2665
|
-
generatedAt: string;
|
|
2666
|
-
version: string;
|
|
2667
|
-
hash: string;
|
|
2668
|
-
sections: ComplianceSection[];
|
|
2669
|
-
}
|
|
2670
|
-
interface ComplianceSection {
|
|
2671
|
-
articleRef: string;
|
|
2672
|
-
title: string;
|
|
2673
|
-
content: string;
|
|
2674
|
-
evidence: ComplianceEvidence[];
|
|
2675
|
-
}
|
|
2676
|
-
interface ComplianceEvidence {
|
|
2677
|
-
testName: string;
|
|
2678
|
-
suiteName: string;
|
|
2679
|
-
passed: boolean;
|
|
2680
|
-
details: string;
|
|
2681
|
-
}
|
|
2682
|
-
interface JUnitReport {
|
|
2683
|
-
name: string;
|
|
2684
|
-
tests: number;
|
|
2685
|
-
failures: number;
|
|
2686
|
-
errors: number;
|
|
2687
|
-
time: number;
|
|
2688
|
-
testSuites: JUnitTestSuite[];
|
|
2689
|
-
}
|
|
2690
|
-
interface JUnitTestSuite {
|
|
2691
|
-
name: string;
|
|
2692
|
-
tests: number;
|
|
2693
|
-
failures: number;
|
|
2694
|
-
errors: number;
|
|
2695
|
-
time: number;
|
|
2696
|
-
testCases: JUnitTestCase[];
|
|
2697
|
-
}
|
|
2698
|
-
interface JUnitTestCase {
|
|
2699
|
-
name: string;
|
|
2700
|
-
classname: string;
|
|
2701
|
-
time: number;
|
|
2702
|
-
failure?: {
|
|
2703
|
-
message: string;
|
|
2704
|
-
type: string;
|
|
2705
|
-
content: string;
|
|
2706
|
-
};
|
|
2707
|
-
error?: {
|
|
2708
|
-
message: string;
|
|
2709
|
-
type: string;
|
|
2710
|
-
content: string;
|
|
2711
|
-
};
|
|
2712
|
-
}
|
|
2713
|
-
|
|
2714
|
-
type FailureCode = "SCHEMA_INVALID" | "SCHEMA_PARSE_ERROR" | "PII_DETECTED" | "KEYWORD_DENIED" | "KEYWORD_MISSING" | "CONTAINS_FAILED" | "NOT_CONTAINS_FAILED" | "MAX_LENGTH_EXCEEDED" | "JUDGE_BELOW_THRESHOLD" | "TOOL_CALL_MISSING" | "TOOL_CALL_UNEXPECTED" | "TOOL_CALL_ARGS_MISMATCH" | "TOOL_CALL_ORDER_WRONG" | "TOOL_CALL_ARGS_SCHEMA_INVALID" | "DRIFT_EXCEEDED" | "PROVIDER_TIMEOUT" | "PROVIDER_AUTH_FAILED" | "PROVIDER_ERROR" | "INVALID_PATTERN" | "INTERNAL_ERROR";
|
|
2793
|
+
type FailureCode = "SCHEMA_INVALID" | "SCHEMA_PARSE_ERROR" | "PII_DETECTED" | "KEYWORD_DENIED" | "KEYWORD_MISSING" | "CONTAINS_FAILED" | "NOT_CONTAINS_FAILED" | "MAX_LENGTH_EXCEEDED" | "JUDGE_BELOW_THRESHOLD" | "JUDGE_PARSE_ERROR" | "JUDGE_EVAL_ERROR" | "TOOL_CALL_MISSING" | "TOOL_CALL_UNEXPECTED" | "TOOL_CALL_ARGS_MISMATCH" | "TOOL_CALL_ORDER_WRONG" | "TOOL_CALL_ARGS_SCHEMA_INVALID" | "DRIFT_EXCEEDED" | "DRIFT_PARSE_ERROR" | "PROVIDER_TIMEOUT" | "PROVIDER_AUTH_FAILED" | "PROVIDER_ERROR" | "INVALID_PATTERN" | "INTERNAL_ERROR" | "BUDGET_EXCEEDED";
|
|
2715
2794
|
interface AssertionResult {
|
|
2716
2795
|
assertionType: string;
|
|
2717
2796
|
label: string;
|
|
@@ -2732,6 +2811,13 @@ interface AssertionContext {
|
|
|
2732
2811
|
configDir: string;
|
|
2733
2812
|
latencyMs?: number;
|
|
2734
2813
|
costUsd?: number;
|
|
2814
|
+
validateJsonSchema?: (schema: Record<string, unknown>, data: unknown) => {
|
|
2815
|
+
valid: true;
|
|
2816
|
+
} | {
|
|
2817
|
+
valid: false;
|
|
2818
|
+
errors: string[];
|
|
2819
|
+
};
|
|
2820
|
+
getEmbedding?: (text: string) => Promise<number[]>;
|
|
2735
2821
|
}
|
|
2736
2822
|
interface Assertion {
|
|
2737
2823
|
readonly type: string;
|
|
@@ -2745,7 +2831,7 @@ interface ToolCallExpectation {
|
|
|
2745
2831
|
argsSchema?: string;
|
|
2746
2832
|
order?: number;
|
|
2747
2833
|
}
|
|
2748
|
-
declare function createToolCalledAssertion(tool: string, argsMatch?: Record<string, unknown
|
|
2834
|
+
declare function createToolCalledAssertion(tool: string, argsMatch?: Record<string, unknown>, argsSchema?: string): Assertion;
|
|
2749
2835
|
declare function createToolNotCalledAssertion(tool: string): Assertion;
|
|
2750
2836
|
declare function createToolOrderAssertion(expectations: ToolCallExpectation[]): Assertion;
|
|
2751
2837
|
|
|
@@ -2775,6 +2861,7 @@ interface JudgeAssertionConfig {
|
|
|
2775
2861
|
criteria: string;
|
|
2776
2862
|
minScore: number;
|
|
2777
2863
|
rubric?: string;
|
|
2864
|
+
model?: string;
|
|
2778
2865
|
}
|
|
2779
2866
|
declare function createJudgeAssertion(config: JudgeAssertionConfig): Assertion;
|
|
2780
2867
|
|
|
@@ -2783,6 +2870,7 @@ interface DriftAssertionConfig {
|
|
|
2783
2870
|
method: "judge" | "embedding" | "field-diff";
|
|
2784
2871
|
fields?: string[];
|
|
2785
2872
|
}
|
|
2873
|
+
declare function cosineSimilarity(a: number[], b: number[]): number;
|
|
2786
2874
|
declare function createDriftAssertion(config: DriftAssertionConfig): Assertion;
|
|
2787
2875
|
|
|
2788
2876
|
interface LatencyAssertionConfig {
|
|
@@ -2800,13 +2888,21 @@ interface AssertionOverrides {
|
|
|
2800
2888
|
schemaContent?: Record<string, unknown>;
|
|
2801
2889
|
}
|
|
2802
2890
|
declare function createAssertionsFromExpect(expect: Expect, overrides?: AssertionOverrides): Assertion[];
|
|
2803
|
-
declare function createAssertionRegistry(): Map<string, AssertionFactory>;
|
|
2804
2891
|
|
|
2805
2892
|
type AssertionCategory = "deterministic" | "probabilistic";
|
|
2806
2893
|
declare function classifyAssertion(assertionType: string): AssertionCategory;
|
|
2807
2894
|
declare function isDeterministic(assertionType: string): boolean;
|
|
2808
2895
|
declare function isProbabilistic(assertionType: string): boolean;
|
|
2809
2896
|
|
|
2897
|
+
type NormalizedScore = {
|
|
2898
|
+
ok: true;
|
|
2899
|
+
score: number;
|
|
2900
|
+
} | {
|
|
2901
|
+
ok: false;
|
|
2902
|
+
reason: string;
|
|
2903
|
+
};
|
|
2904
|
+
declare function validateUnitIntervalScore(value: unknown, fieldName: string): NormalizedScore;
|
|
2905
|
+
|
|
2810
2906
|
declare function createOpenAIAdapter(httpClient: HttpClient): ProviderAdapter;
|
|
2811
2907
|
|
|
2812
2908
|
declare function createAnthropicAdapter(httpClient: HttpClient): ProviderAdapter;
|
|
@@ -2829,9 +2925,25 @@ interface RetryOptions {
|
|
|
2829
2925
|
maxRetries: number;
|
|
2830
2926
|
shouldRetry: (error: unknown) => boolean;
|
|
2831
2927
|
baseDelayMs?: number;
|
|
2928
|
+
maxDelayMs?: number;
|
|
2929
|
+
getRetryAfterMs?: (error: unknown) => number | undefined;
|
|
2832
2930
|
}
|
|
2833
2931
|
declare function withRetry<T>(fn: () => Promise<T>, options: RetryOptions): Promise<T>;
|
|
2834
2932
|
|
|
2933
|
+
interface ModelPricing {
|
|
2934
|
+
input: number;
|
|
2935
|
+
output: number;
|
|
2936
|
+
}
|
|
2937
|
+
type PricingMatch = {
|
|
2938
|
+
ok: true;
|
|
2939
|
+
price: ModelPricing;
|
|
2940
|
+
matchedModel: string;
|
|
2941
|
+
matchType: "exact" | "prefix";
|
|
2942
|
+
} | {
|
|
2943
|
+
ok: false;
|
|
2944
|
+
};
|
|
2945
|
+
declare function lookupModelPricing(model: string, pricingTable: Record<string, ModelPricing>): PricingMatch;
|
|
2946
|
+
|
|
2835
2947
|
interface FileReader {
|
|
2836
2948
|
readFile(path: string): Result<string>;
|
|
2837
2949
|
}
|
|
@@ -2841,8 +2953,8 @@ interface ParseOptions {
|
|
|
2841
2953
|
}
|
|
2842
2954
|
declare function parseConfig(yamlContent: string, options: ParseOptions): Result<KindLMConfig>;
|
|
2843
2955
|
|
|
2844
|
-
declare function interpolate(template: string, vars: Record<string, string>): Result<string>;
|
|
2845
|
-
declare function findMissingVars(template: string, vars: Record<string, string>): string[];
|
|
2956
|
+
declare function interpolate(template: string, vars: Record<string, string>, env?: Record<string, string | undefined>): Result<string>;
|
|
2957
|
+
declare function findMissingVars(template: string, vars: Record<string, string>, _env?: Record<string, string | undefined>): string[];
|
|
2846
2958
|
|
|
2847
2959
|
interface TestCaseRunResult {
|
|
2848
2960
|
testCaseName: string;
|
|
@@ -2857,12 +2969,18 @@ interface TestCaseRunResult {
|
|
|
2857
2969
|
totalTokens: number;
|
|
2858
2970
|
};
|
|
2859
2971
|
costEstimateUsd: number | null;
|
|
2972
|
+
errored?: boolean;
|
|
2973
|
+
error?: {
|
|
2974
|
+
code: string;
|
|
2975
|
+
message: string;
|
|
2976
|
+
};
|
|
2860
2977
|
}
|
|
2861
2978
|
interface AggregatedTestResult {
|
|
2862
2979
|
testCaseName: string;
|
|
2863
2980
|
modelId: string;
|
|
2864
2981
|
runCount: number;
|
|
2865
2982
|
passed: boolean;
|
|
2983
|
+
errored: boolean;
|
|
2866
2984
|
passRate: number;
|
|
2867
2985
|
assertionScores: Record<string, {
|
|
2868
2986
|
mean: number;
|
|
@@ -2875,7 +2993,7 @@ interface AggregatedTestResult {
|
|
|
2875
2993
|
totalTokens: number;
|
|
2876
2994
|
runs: TestCaseRunResult[];
|
|
2877
2995
|
}
|
|
2878
|
-
declare function aggregateRuns(runs: TestCaseRunResult[]): AggregatedTestResult
|
|
2996
|
+
declare function aggregateRuns(runs: TestCaseRunResult[]): Result<AggregatedTestResult, string>;
|
|
2879
2997
|
|
|
2880
2998
|
declare const BASELINE_VERSION = "1";
|
|
2881
2999
|
interface BaselineIO {
|
|
@@ -2897,6 +3015,19 @@ interface BaselineData {
|
|
|
2897
3015
|
createdAt: string;
|
|
2898
3016
|
results: Record<string, BaselineTestEntry>;
|
|
2899
3017
|
}
|
|
3018
|
+
type MigrationResult = {
|
|
3019
|
+
ok: true;
|
|
3020
|
+
baseline: BaselineData;
|
|
3021
|
+
migrated: boolean;
|
|
3022
|
+
} | {
|
|
3023
|
+
ok: false;
|
|
3024
|
+
error: string;
|
|
3025
|
+
};
|
|
3026
|
+
/**
|
|
3027
|
+
* Attempt to migrate a parsed baseline object from its current version
|
|
3028
|
+
* to BASELINE_VERSION through a chain of migrations.
|
|
3029
|
+
*/
|
|
3030
|
+
declare function migrateBaseline(raw: unknown): MigrationResult;
|
|
2900
3031
|
declare function serializeBaseline(data: BaselineData): string;
|
|
2901
3032
|
declare function deserializeBaseline(raw: string): Result<BaselineData>;
|
|
2902
3033
|
declare function readBaseline(suiteName: string, io: BaselineIO): Result<BaselineData>;
|
|
@@ -2973,7 +3104,10 @@ interface RunnerResult {
|
|
|
2973
3104
|
runResult: RunResult;
|
|
2974
3105
|
aggregated: AggregatedTestResult[];
|
|
2975
3106
|
}
|
|
2976
|
-
|
|
3107
|
+
interface RunOptions {
|
|
3108
|
+
tags?: string[];
|
|
3109
|
+
}
|
|
3110
|
+
declare function createRunner(config: KindLMConfig, deps: RunnerDeps, options?: RunOptions): {
|
|
2977
3111
|
run(): Promise<Result<RunnerResult>>;
|
|
2978
3112
|
};
|
|
2979
3113
|
|
|
@@ -2996,7 +3130,7 @@ interface ReporterOutput {
|
|
|
2996
3130
|
}
|
|
2997
3131
|
interface Reporter {
|
|
2998
3132
|
readonly name: string;
|
|
2999
|
-
generate(runResult: RunResult, gateEvaluation: GateEvaluation): ReporterOutput
|
|
3133
|
+
generate(runResult: RunResult, gateEvaluation: GateEvaluation): Promise<ReporterOutput>;
|
|
3000
3134
|
}
|
|
3001
3135
|
interface Colorize {
|
|
3002
3136
|
bold: (text: string) => string;
|
|
@@ -3012,11 +3146,22 @@ declare const noColor: Colorize;
|
|
|
3012
3146
|
|
|
3013
3147
|
declare function createPrettyReporter(colorize?: Colorize): Reporter;
|
|
3014
3148
|
|
|
3015
|
-
declare function createJsonReporter(): Reporter;
|
|
3149
|
+
declare function createJsonReporter(version?: string): Reporter;
|
|
3016
3150
|
|
|
3017
3151
|
declare function createJunitReporter(): Reporter;
|
|
3018
3152
|
|
|
3019
|
-
|
|
3153
|
+
interface ComplianceRunMetadata {
|
|
3154
|
+
runId: string;
|
|
3155
|
+
kindlmVersion: string;
|
|
3156
|
+
gitCommitSha?: string;
|
|
3157
|
+
modelIds: string[];
|
|
3158
|
+
configHash?: string;
|
|
3159
|
+
systemName?: string;
|
|
3160
|
+
operator?: string;
|
|
3161
|
+
riskLevel?: string;
|
|
3162
|
+
intendedPurpose?: string;
|
|
3163
|
+
}
|
|
3164
|
+
declare function createComplianceReporter(metadata?: ComplianceRunMetadata): Reporter;
|
|
3020
3165
|
|
|
3021
3166
|
declare function buildBaselineData(suiteName: string, aggregated: AggregatedTestResult[], timestamp: string): BaselineData;
|
|
3022
3167
|
|
|
@@ -3058,4 +3203,4 @@ interface BuildContextOptions {
|
|
|
3058
3203
|
}
|
|
3059
3204
|
declare function buildContextFromTrace(result: SpanMappingResult, options: BuildContextOptions): AssertionContext;
|
|
3060
3205
|
|
|
3061
|
-
export { type AggregatedTestResult, type Assertion, type AssertionCategory, type AssertionContext, type AssertionFactory, type AssertionOverrides, type AssertionResult, BASELINE_VERSION, type BaselineComparison, type BaselineData, type BaselineIO, type BaselineImprovement, type BaselineRegression, type BaselineTestEntry, type BaselineUnchanged, type BuildContextOptions, type Colorize, type CommandExecuteOptions, type CommandExecutor, type CommandResult, type ComplianceConfig, type
|
|
3206
|
+
export { type AggregatedTestResult, type Assertion, type AssertionCategory, type AssertionContext, type AssertionFactory, type AssertionOverrides, type AssertionResult, BASELINE_VERSION, type BaselineComparison, type BaselineData, type BaselineIO, type BaselineImprovement, type BaselineRegression, type BaselineTestEntry, type BaselineUnchanged, type BuildContextOptions, type Colorize, type CommandExecuteOptions, type CommandExecutor, type CommandResult, type ComplianceConfig, type ComplianceRunMetadata, type ConversationResult, type ConversationTurn, type CostAssertionConfig, type DriftAssertionConfig, type ErrorCode, type Expect, type FailureCode, type FileReader, type GateEvaluation, type GateResult, type GatesConfig, type HttpClient, type HttpRequestInit, type HttpResponse, type JudgeAssertionConfig, type JudgeCriterion, type KindLMConfig, KindLMConfigSchema, type KindLMConfig as KindlmConfig, type KindlmError, type LatencyAssertionConfig, type MigrationResult, type ModelConfig, type ModelPricing, type NormalizedScore, type OtlpAttribute, type OtlpAttributeValue, type OtlpResourceSpans, type OtlpScopeSpans, type OtlpSpan, type OtlpTracesPayload, type ParseOptions, type ParsedSpan, type PiiAssertionConfig, type PricingMatch, type ProgressEvent, type ProviderAdapter, type ProviderAdapterConfig, type ProviderConfig, ProviderError, type ProviderErrorCode, type ProviderMessage, type ProviderRequest, type ProviderResponse, type ProviderToolCall, type ProviderToolDefinition, type RawCommandOutput, type Reporter, type ReporterOutput, type Result, type RetryOptions, type RunOptions, type RunResult, type RunnerDeps, type RunnerResult, type SchemaAssertionConfig, type SpanFilter, SpanFilterSchema, type SpanMapping, type SpanMappingResult, SpanMappingSchema, type SuiteRunResult, type TestCase, type TestCaseRunResult, type TestRunResult, type ToolCallExpect, type ToolCallExpectation, type ToolSimulation, type TraceConfig, TraceConfigSchema, aggregateRuns, buildBaselineData, buildContextFromTrace, classifyAssertion, compareBaseline, cosineSimilarity, createAnthropicAdapter, createAssertionsFromExpect, createCohereAdapter, createComplianceReporter, createCostAssertion, createDriftAssertion, createGeminiAdapter, createJsonReporter, createJudgeAssertion, createJunitReporter, createKeywordsAbsentAssertion, createKeywordsPresentAssertion, createLatencyAssertion, createMistralAdapter, createOllamaAdapter, createOpenAIAdapter, createPiiAssertion, createPrettyReporter, createProvider, createRunner, createSchemaAssertion, createToolCalledAssertion, createToolNotCalledAssertion, createToolOrderAssertion, deserializeBaseline, err, evaluateGates, filterSpans, findMissingVars, interpolate, isDeterministic, isProbabilistic, listBaselines, lookupModelPricing, mapSpansToResult, migrateBaseline, noColor, ok, parseCommandOutput, parseConfig, parseOtlpPayload, readBaseline, runConversation, serializeBaseline, validateConfig, validateUnitIntervalScore, withRetry, writeBaseline };
|