@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.mjs CHANGED
@@ -226,8 +226,10 @@ function isValidSkillFolderName(name) {
226
226
  var SkillMetadataSchema = z7.object({
227
227
  name: z7.string(),
228
228
  description: z7.string(),
229
- allowedTools: z7.array(z7.string()).optional(),
230
- skills: z7.array(z7.string()).optional()
229
+ license: z7.string().optional(),
230
+ compatibility: z7.string().optional(),
231
+ metadata: z7.record(z7.string(), z7.string()).optional(),
232
+ allowedTools: z7.array(z7.string()).optional()
231
233
  });
232
234
  var SkillFileSchema = z7.object({
233
235
  /** Relative path within the skill directory, e.g. "SKILL.md" or "references/API_SPEC.md" */
@@ -592,7 +594,8 @@ var AssertionTypeSchema = z22.enum([
592
594
  "build_passed",
593
595
  "time_limit",
594
596
  "cost",
595
- "llm_judge"
597
+ "llm_judge",
598
+ "api_call"
596
599
  ]);
597
600
  var AssertionParameterTypeSchema = z22.enum([
598
601
  "string",
@@ -671,6 +674,20 @@ var LlmJudgeConfigSchema = z22.object({
671
674
  /** User-defined parameters for this assertion */
672
675
  parameters: z22.array(AssertionParameterSchema).optional()
673
676
  });
677
+ var ApiCallConfigSchema = z22.strictObject({
678
+ /** URL to call */
679
+ url: z22.string().min(1),
680
+ /** HTTP method (default GET) */
681
+ method: z22.enum(["GET", "POST"]).optional(),
682
+ /** Request body (JSON string, for POST requests) */
683
+ requestBody: z22.string().optional(),
684
+ /** Expected JSON response to validate against (subset match — extra fields in actual are OK) */
685
+ expectedResponse: z22.string().min(1),
686
+ /** Request headers as JSON string of key-value pairs */
687
+ requestHeaders: z22.string().optional(),
688
+ /** Request timeout in milliseconds (default 30000) */
689
+ timeoutMs: z22.number().int().positive().optional()
690
+ });
674
691
  var AssertionBaseFields = {
675
692
  /** When true, the assertion's pass/fail logic is inverted (NOT operator). */
676
693
  negate: z22.boolean().optional()
@@ -695,6 +712,10 @@ var LlmJudgeAssertionSchema = LlmJudgeConfigSchema.extend({
695
712
  type: z22.literal("llm_judge"),
696
713
  ...AssertionBaseFields
697
714
  });
715
+ var ApiCallAssertionSchema = ApiCallConfigSchema.extend({
716
+ type: z22.literal("api_call"),
717
+ ...AssertionBaseFields
718
+ });
698
719
  var TimeAssertionSchema = TimeConfigSchema.extend({
699
720
  type: z22.literal("time_limit"),
700
721
  ...AssertionBaseFields
@@ -705,7 +726,8 @@ var AssertionSchema = z22.union([
705
726
  BuildPassedAssertionSchema,
706
727
  TimeAssertionSchema,
707
728
  CostAssertionSchema,
708
- LlmJudgeAssertionSchema
729
+ LlmJudgeAssertionSchema,
730
+ ApiCallAssertionSchema
709
731
  ]);
710
732
  var AssertionConfigSchema = z22.union([
711
733
  LlmJudgeConfigSchema,
@@ -714,6 +736,8 @@ var AssertionConfigSchema = z22.union([
714
736
  // requires skillNames
715
737
  ToolCalledWithParamConfigSchema,
716
738
  // requires toolName, uses strictObject
739
+ ApiCallConfigSchema,
740
+ // requires url + expectedResponse, uses strictObject
717
741
  TimeConfigSchema,
718
742
  // requires maxDurationMs, uses strictObject
719
743
  CostConfigSchema,
@@ -737,6 +761,8 @@ function validateAssertionConfig(type, config) {
737
761
  return TimeConfigSchema.safeParse(config).success;
738
762
  case "llm_judge":
739
763
  return LlmJudgeConfigSchema.safeParse(config).success;
764
+ case "api_call":
765
+ return ApiCallConfigSchema.safeParse(config).success;
740
766
  default:
741
767
  return false;
742
768
  }
@@ -1408,7 +1434,8 @@ var SYSTEM_ASSERTION_IDS = {
1408
1434
  BUILD_PASSED: "system:build_passed",
1409
1435
  TIME_LIMIT: "system:time_limit",
1410
1436
  COST: "system:cost",
1411
- LLM_JUDGE: "system:llm_judge"
1437
+ LLM_JUDGE: "system:llm_judge",
1438
+ API_CALL: "system:api_call"
1412
1439
  };
1413
1440
  function isSystemAssertionId(id) {
1414
1441
  return id.startsWith("system:");
@@ -1563,6 +1590,54 @@ var SYSTEM_ASSERTIONS = {
1563
1590
  required: false
1564
1591
  }
1565
1592
  ]
1593
+ },
1594
+ [SYSTEM_ASSERTION_IDS.API_CALL]: {
1595
+ id: SYSTEM_ASSERTION_IDS.API_CALL,
1596
+ name: "API Call",
1597
+ description: "Call an API endpoint and verify the response contains expected data",
1598
+ type: "api_call",
1599
+ parameters: [
1600
+ {
1601
+ name: "url",
1602
+ label: "URL",
1603
+ type: "string",
1604
+ required: true
1605
+ },
1606
+ {
1607
+ name: "method",
1608
+ label: "HTTP Method",
1609
+ type: "string",
1610
+ required: false,
1611
+ defaultValue: "GET"
1612
+ },
1613
+ {
1614
+ name: "requestBody",
1615
+ label: "Request Body (JSON)",
1616
+ type: "string",
1617
+ required: false
1618
+ },
1619
+ {
1620
+ name: "expectedResponse",
1621
+ label: "Expected Response (JSON)",
1622
+ type: "string",
1623
+ required: true
1624
+ },
1625
+ {
1626
+ name: "requestHeaders",
1627
+ label: "Headers (JSON)",
1628
+ type: "string",
1629
+ required: false,
1630
+ advanced: true
1631
+ },
1632
+ {
1633
+ name: "timeoutMs",
1634
+ label: "Timeout (ms)",
1635
+ type: "number",
1636
+ required: false,
1637
+ defaultValue: 3e4,
1638
+ advanced: true
1639
+ }
1640
+ ]
1566
1641
  }
1567
1642
  };
1568
1643
  function getSystemAssertions() {
@@ -1585,6 +1660,8 @@ export {
1585
1660
  AgentTypeSchema,
1586
1661
  AllowedCommands,
1587
1662
  AnyModelSchema,
1663
+ ApiCallAssertionSchema,
1664
+ ApiCallConfigSchema,
1588
1665
  ApiCallSchema,
1589
1666
  AssertionConfigSchema,
1590
1667
  AssertionParameterSchema,