@yourgpt/copilot-sdk 2.1.3 → 2.1.4

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.
@@ -1649,6 +1649,10 @@ function getZodEnumValues(schema) {
1649
1649
  return null;
1650
1650
  }
1651
1651
  function zodToJsonSchema(schema) {
1652
+ const result = _zodToJsonSchemaInternal(schema);
1653
+ return result;
1654
+ }
1655
+ function _zodToJsonSchemaInternal(schema) {
1652
1656
  if (!isZodSchema(schema)) {
1653
1657
  return { type: "string" };
1654
1658
  }
@@ -1690,7 +1694,7 @@ function zodToJsonSchema(schema) {
1690
1694
  const innerType = getZodInnerType(schema);
1691
1695
  const result2 = {
1692
1696
  type: "array",
1693
- items: innerType ? zodToJsonSchema(innerType) : { type: "string" }
1697
+ items: innerType ? _zodToJsonSchemaInternal(innerType) : { type: "string" }
1694
1698
  };
1695
1699
  if (description) result2.description = description;
1696
1700
  return result2;
@@ -1703,7 +1707,7 @@ function zodToJsonSchema(schema) {
1703
1707
  const properties = {};
1704
1708
  const required = [];
1705
1709
  for (const [key, value] of Object.entries(shapeObj)) {
1706
- properties[key] = zodToJsonSchema(value);
1710
+ properties[key] = _zodToJsonSchemaInternal(value);
1707
1711
  const fieldTypeName = getZodTypeName(value);
1708
1712
  if (fieldTypeName !== "ZodOptional" && fieldTypeName !== "ZodNullable") {
1709
1713
  required.push(key);
@@ -1721,14 +1725,14 @@ function zodToJsonSchema(schema) {
1721
1725
  case "ZodNullable": {
1722
1726
  const innerType = getZodInnerType(schema);
1723
1727
  if (innerType) {
1724
- return zodToJsonSchema(innerType);
1728
+ return _zodToJsonSchemaInternal(innerType);
1725
1729
  }
1726
1730
  return { type: "string", description };
1727
1731
  }
1728
1732
  case "ZodDefault": {
1729
1733
  const innerType = getZodInnerType(schema);
1730
1734
  if (innerType) {
1731
- const result2 = zodToJsonSchema(innerType);
1735
+ const result2 = _zodToJsonSchemaInternal(innerType);
1732
1736
  return result2;
1733
1737
  }
1734
1738
  return { type: "string", description };
@@ -1767,7 +1771,7 @@ function zodToJsonSchema(schema) {
1767
1771
  options = def?.options;
1768
1772
  }
1769
1773
  if (options && options.length > 0) {
1770
- return zodToJsonSchema(options[0]);
1774
+ return _zodToJsonSchemaInternal(options[0]);
1771
1775
  }
1772
1776
  return { type: "string", description };
1773
1777
  }
@@ -1778,7 +1782,7 @@ function zodToJsonSchema(schema) {
1778
1782
  }
1779
1783
  }
1780
1784
  function zodObjectToInputSchema(schema) {
1781
- const jsonSchema = zodToJsonSchema(schema);
1785
+ const jsonSchema = _zodToJsonSchemaInternal(schema);
1782
1786
  if (jsonSchema.type !== "object" || !jsonSchema.properties) {
1783
1787
  const typeName = getZodTypeName(schema);
1784
1788
  throw new Error(
@@ -2889,5 +2893,5 @@ exports.stopNetworkCapture = stopNetworkCapture;
2889
2893
  exports.streamSSE = streamSSE;
2890
2894
  exports.zodObjectToInputSchema = zodObjectToInputSchema;
2891
2895
  exports.zodToJsonSchema = zodToJsonSchema;
2892
- //# sourceMappingURL=chunk-WQSK3Z4K.cjs.map
2893
- //# sourceMappingURL=chunk-WQSK3Z4K.cjs.map
2896
+ //# sourceMappingURL=chunk-OQPRIB73.cjs.map
2897
+ //# sourceMappingURL=chunk-OQPRIB73.cjs.map