@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.
@@ -1647,6 +1647,10 @@ function getZodEnumValues(schema) {
1647
1647
  return null;
1648
1648
  }
1649
1649
  function zodToJsonSchema(schema) {
1650
+ const result = _zodToJsonSchemaInternal(schema);
1651
+ return result;
1652
+ }
1653
+ function _zodToJsonSchemaInternal(schema) {
1650
1654
  if (!isZodSchema(schema)) {
1651
1655
  return { type: "string" };
1652
1656
  }
@@ -1688,7 +1692,7 @@ function zodToJsonSchema(schema) {
1688
1692
  const innerType = getZodInnerType(schema);
1689
1693
  const result2 = {
1690
1694
  type: "array",
1691
- items: innerType ? zodToJsonSchema(innerType) : { type: "string" }
1695
+ items: innerType ? _zodToJsonSchemaInternal(innerType) : { type: "string" }
1692
1696
  };
1693
1697
  if (description) result2.description = description;
1694
1698
  return result2;
@@ -1701,7 +1705,7 @@ function zodToJsonSchema(schema) {
1701
1705
  const properties = {};
1702
1706
  const required = [];
1703
1707
  for (const [key, value] of Object.entries(shapeObj)) {
1704
- properties[key] = zodToJsonSchema(value);
1708
+ properties[key] = _zodToJsonSchemaInternal(value);
1705
1709
  const fieldTypeName = getZodTypeName(value);
1706
1710
  if (fieldTypeName !== "ZodOptional" && fieldTypeName !== "ZodNullable") {
1707
1711
  required.push(key);
@@ -1719,14 +1723,14 @@ function zodToJsonSchema(schema) {
1719
1723
  case "ZodNullable": {
1720
1724
  const innerType = getZodInnerType(schema);
1721
1725
  if (innerType) {
1722
- return zodToJsonSchema(innerType);
1726
+ return _zodToJsonSchemaInternal(innerType);
1723
1727
  }
1724
1728
  return { type: "string", description };
1725
1729
  }
1726
1730
  case "ZodDefault": {
1727
1731
  const innerType = getZodInnerType(schema);
1728
1732
  if (innerType) {
1729
- const result2 = zodToJsonSchema(innerType);
1733
+ const result2 = _zodToJsonSchemaInternal(innerType);
1730
1734
  return result2;
1731
1735
  }
1732
1736
  return { type: "string", description };
@@ -1765,7 +1769,7 @@ function zodToJsonSchema(schema) {
1765
1769
  options = def?.options;
1766
1770
  }
1767
1771
  if (options && options.length > 0) {
1768
- return zodToJsonSchema(options[0]);
1772
+ return _zodToJsonSchemaInternal(options[0]);
1769
1773
  }
1770
1774
  return { type: "string", description };
1771
1775
  }
@@ -1776,7 +1780,7 @@ function zodToJsonSchema(schema) {
1776
1780
  }
1777
1781
  }
1778
1782
  function zodObjectToInputSchema(schema) {
1779
- const jsonSchema = zodToJsonSchema(schema);
1783
+ const jsonSchema = _zodToJsonSchemaInternal(schema);
1780
1784
  if (jsonSchema.type !== "object" || !jsonSchema.properties) {
1781
1785
  const typeName = getZodTypeName(schema);
1782
1786
  throw new Error(
@@ -2818,5 +2822,5 @@ function createThreadManager(config, callbacks) {
2818
2822
  }
2819
2823
 
2820
2824
  export { CLOUD_MAX_FILE_SIZE, DEFAULT_YOURGPT_ENDPOINT, SimpleThreadManagerState, ThreadManager, actionToTool, builtinTools, captureCurrentLogs, captureScreenshot, clearConsoleLogs, clearNetworkRequests, consoleLogsTool, createAssistantMessage, createCloudStorage, createConsoleLogsTool, createCustomDetector, createLocalStorageAdapter, createMemoryAdapter, createMessage, createNetworkRequestsTool, createSSEStream, createScreenshotTool, createServerAdapter, createThreadManager, createToolCall, createToolMessage, createUserMessage, defaultSystemMessage, defineClientTool, defineServerTool, defineTool, detectIntent, formatLogsForAI, formatRequestsForAI, formatSSE, generateId, generateMessageId, generateSuggestionReason, generateThreadId, generateThreadTitle, generateToolCallId, getAttachmentTypeFromMime, getConsoleErrors, getConsoleLogs, getConsoleWarnings, getFailedRequests, getNetworkRequests, getPrimaryTool, hasToolCalls, hasToolSuggestions, isConsoleCaptureActive, isNetworkCaptureActive, isScreenshotSupported, isToolResult, localStorageAdapter, networkRequestsTool, noopAdapter, parseSSELine, parseStreamEvent, parseToolCallArgs, processFileToAttachment, resizeScreenshot, screenshotTool, serializeStreamEvent, startConsoleCapture, startNetworkCapture, stopConsoleCapture, stopNetworkCapture, streamSSE, zodObjectToInputSchema, zodToJsonSchema };
2821
- //# sourceMappingURL=chunk-VFV5FVVI.js.map
2822
- //# sourceMappingURL=chunk-VFV5FVVI.js.map
2825
+ //# sourceMappingURL=chunk-37KEHUCE.js.map
2826
+ //# sourceMappingURL=chunk-37KEHUCE.js.map