@wix/evalforge-types 0.61.0 → 0.63.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/build/index.js +84 -5
- package/build/index.js.map +2 -2
- package/build/index.mjs +82 -5
- package/build/index.mjs.map +2 -2
- package/build/types/assertion/assertion.d.ts +69 -1
- package/build/types/assertion/system-assertions.d.ts +1 -0
- package/build/types/scenario/test-scenario.d.ts +39 -3
- package/build/types/target/skill.d.ts +7 -3
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -33,6 +33,8 @@ __export(index_exports, {
|
|
|
33
33
|
AgentTypeSchema: () => AgentTypeSchema,
|
|
34
34
|
AllowedCommands: () => AllowedCommands,
|
|
35
35
|
AnyModelSchema: () => AnyModelSchema,
|
|
36
|
+
ApiCallAssertionSchema: () => ApiCallAssertionSchema,
|
|
37
|
+
ApiCallConfigSchema: () => ApiCallConfigSchema,
|
|
36
38
|
ApiCallSchema: () => ApiCallSchema,
|
|
37
39
|
AssertionConfigSchema: () => AssertionConfigSchema,
|
|
38
40
|
AssertionParameterSchema: () => AssertionParameterSchema,
|
|
@@ -424,8 +426,10 @@ function isValidSkillFolderName(name) {
|
|
|
424
426
|
var SkillMetadataSchema = import_zod7.z.object({
|
|
425
427
|
name: import_zod7.z.string(),
|
|
426
428
|
description: import_zod7.z.string(),
|
|
427
|
-
|
|
428
|
-
|
|
429
|
+
license: import_zod7.z.string().optional(),
|
|
430
|
+
compatibility: import_zod7.z.string().optional(),
|
|
431
|
+
metadata: import_zod7.z.record(import_zod7.z.string(), import_zod7.z.string()).optional(),
|
|
432
|
+
allowedTools: import_zod7.z.array(import_zod7.z.string()).optional()
|
|
429
433
|
});
|
|
430
434
|
var SkillFileSchema = import_zod7.z.object({
|
|
431
435
|
/** Relative path within the skill directory, e.g. "SKILL.md" or "references/API_SPEC.md" */
|
|
@@ -790,7 +794,8 @@ var AssertionTypeSchema = import_zod22.z.enum([
|
|
|
790
794
|
"build_passed",
|
|
791
795
|
"time_limit",
|
|
792
796
|
"cost",
|
|
793
|
-
"llm_judge"
|
|
797
|
+
"llm_judge",
|
|
798
|
+
"api_call"
|
|
794
799
|
]);
|
|
795
800
|
var AssertionParameterTypeSchema = import_zod22.z.enum([
|
|
796
801
|
"string",
|
|
@@ -869,6 +874,20 @@ var LlmJudgeConfigSchema = import_zod22.z.object({
|
|
|
869
874
|
/** User-defined parameters for this assertion */
|
|
870
875
|
parameters: import_zod22.z.array(AssertionParameterSchema).optional()
|
|
871
876
|
});
|
|
877
|
+
var ApiCallConfigSchema = import_zod22.z.strictObject({
|
|
878
|
+
/** URL to call */
|
|
879
|
+
url: import_zod22.z.string().min(1),
|
|
880
|
+
/** HTTP method (default GET) */
|
|
881
|
+
method: import_zod22.z.enum(["GET", "POST"]).optional(),
|
|
882
|
+
/** Request body (JSON string, for POST requests) */
|
|
883
|
+
requestBody: import_zod22.z.string().optional(),
|
|
884
|
+
/** Expected JSON response to validate against (subset match — extra fields in actual are OK) */
|
|
885
|
+
expectedResponse: import_zod22.z.string().min(1),
|
|
886
|
+
/** Request headers as JSON string of key-value pairs */
|
|
887
|
+
requestHeaders: import_zod22.z.string().optional(),
|
|
888
|
+
/** Request timeout in milliseconds (default 30000) */
|
|
889
|
+
timeoutMs: import_zod22.z.number().int().positive().optional()
|
|
890
|
+
});
|
|
872
891
|
var AssertionBaseFields = {
|
|
873
892
|
/** When true, the assertion's pass/fail logic is inverted (NOT operator). */
|
|
874
893
|
negate: import_zod22.z.boolean().optional()
|
|
@@ -893,6 +912,10 @@ var LlmJudgeAssertionSchema = LlmJudgeConfigSchema.extend({
|
|
|
893
912
|
type: import_zod22.z.literal("llm_judge"),
|
|
894
913
|
...AssertionBaseFields
|
|
895
914
|
});
|
|
915
|
+
var ApiCallAssertionSchema = ApiCallConfigSchema.extend({
|
|
916
|
+
type: import_zod22.z.literal("api_call"),
|
|
917
|
+
...AssertionBaseFields
|
|
918
|
+
});
|
|
896
919
|
var TimeAssertionSchema = TimeConfigSchema.extend({
|
|
897
920
|
type: import_zod22.z.literal("time_limit"),
|
|
898
921
|
...AssertionBaseFields
|
|
@@ -903,7 +926,8 @@ var AssertionSchema = import_zod22.z.union([
|
|
|
903
926
|
BuildPassedAssertionSchema,
|
|
904
927
|
TimeAssertionSchema,
|
|
905
928
|
CostAssertionSchema,
|
|
906
|
-
LlmJudgeAssertionSchema
|
|
929
|
+
LlmJudgeAssertionSchema,
|
|
930
|
+
ApiCallAssertionSchema
|
|
907
931
|
]);
|
|
908
932
|
var AssertionConfigSchema = import_zod22.z.union([
|
|
909
933
|
LlmJudgeConfigSchema,
|
|
@@ -912,6 +936,8 @@ var AssertionConfigSchema = import_zod22.z.union([
|
|
|
912
936
|
// requires skillNames
|
|
913
937
|
ToolCalledWithParamConfigSchema,
|
|
914
938
|
// requires toolName, uses strictObject
|
|
939
|
+
ApiCallConfigSchema,
|
|
940
|
+
// requires url + expectedResponse, uses strictObject
|
|
915
941
|
TimeConfigSchema,
|
|
916
942
|
// requires maxDurationMs, uses strictObject
|
|
917
943
|
CostConfigSchema,
|
|
@@ -935,6 +961,8 @@ function validateAssertionConfig(type, config) {
|
|
|
935
961
|
return TimeConfigSchema.safeParse(config).success;
|
|
936
962
|
case "llm_judge":
|
|
937
963
|
return LlmJudgeConfigSchema.safeParse(config).success;
|
|
964
|
+
case "api_call":
|
|
965
|
+
return ApiCallConfigSchema.safeParse(config).success;
|
|
938
966
|
default:
|
|
939
967
|
return false;
|
|
940
968
|
}
|
|
@@ -1606,7 +1634,8 @@ var SYSTEM_ASSERTION_IDS = {
|
|
|
1606
1634
|
BUILD_PASSED: "system:build_passed",
|
|
1607
1635
|
TIME_LIMIT: "system:time_limit",
|
|
1608
1636
|
COST: "system:cost",
|
|
1609
|
-
LLM_JUDGE: "system:llm_judge"
|
|
1637
|
+
LLM_JUDGE: "system:llm_judge",
|
|
1638
|
+
API_CALL: "system:api_call"
|
|
1610
1639
|
};
|
|
1611
1640
|
function isSystemAssertionId(id) {
|
|
1612
1641
|
return id.startsWith("system:");
|
|
@@ -1761,6 +1790,54 @@ var SYSTEM_ASSERTIONS = {
|
|
|
1761
1790
|
required: false
|
|
1762
1791
|
}
|
|
1763
1792
|
]
|
|
1793
|
+
},
|
|
1794
|
+
[SYSTEM_ASSERTION_IDS.API_CALL]: {
|
|
1795
|
+
id: SYSTEM_ASSERTION_IDS.API_CALL,
|
|
1796
|
+
name: "API Call",
|
|
1797
|
+
description: "Call an API endpoint and verify the response contains expected data",
|
|
1798
|
+
type: "api_call",
|
|
1799
|
+
parameters: [
|
|
1800
|
+
{
|
|
1801
|
+
name: "url",
|
|
1802
|
+
label: "URL",
|
|
1803
|
+
type: "string",
|
|
1804
|
+
required: true
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
name: "method",
|
|
1808
|
+
label: "HTTP Method",
|
|
1809
|
+
type: "string",
|
|
1810
|
+
required: false,
|
|
1811
|
+
defaultValue: "GET"
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
name: "requestBody",
|
|
1815
|
+
label: "Request Body (JSON)",
|
|
1816
|
+
type: "string",
|
|
1817
|
+
required: false
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
name: "expectedResponse",
|
|
1821
|
+
label: "Expected Response (JSON)",
|
|
1822
|
+
type: "string",
|
|
1823
|
+
required: true
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
name: "requestHeaders",
|
|
1827
|
+
label: "Headers (JSON)",
|
|
1828
|
+
type: "string",
|
|
1829
|
+
required: false,
|
|
1830
|
+
advanced: true
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
name: "timeoutMs",
|
|
1834
|
+
label: "Timeout (ms)",
|
|
1835
|
+
type: "number",
|
|
1836
|
+
required: false,
|
|
1837
|
+
defaultValue: 3e4,
|
|
1838
|
+
advanced: true
|
|
1839
|
+
}
|
|
1840
|
+
]
|
|
1764
1841
|
}
|
|
1765
1842
|
};
|
|
1766
1843
|
function getSystemAssertions() {
|
|
@@ -1784,6 +1861,8 @@ function getSystemAssertion(id) {
|
|
|
1784
1861
|
AgentTypeSchema,
|
|
1785
1862
|
AllowedCommands,
|
|
1786
1863
|
AnyModelSchema,
|
|
1864
|
+
ApiCallAssertionSchema,
|
|
1865
|
+
ApiCallConfigSchema,
|
|
1787
1866
|
ApiCallSchema,
|
|
1788
1867
|
AssertionConfigSchema,
|
|
1789
1868
|
AssertionParameterSchema,
|