@yourgpt/copilot-sdk 2.0.2-beta.2 → 2.1.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.
Files changed (86) hide show
  1. package/README.md +0 -42
  2. package/dist/{chunk-UOWLKFXK.cjs → chunk-33JSFVGH.cjs} +23 -23
  3. package/dist/{chunk-UOWLKFXK.cjs.map → chunk-33JSFVGH.cjs.map} +1 -1
  4. package/dist/{chunk-IXFV6AW6.js → chunk-3SP6V22Y.js} +246 -219
  5. package/dist/chunk-3SP6V22Y.js.map +1 -0
  6. package/dist/{chunk-7XFFRV7D.js → chunk-7PJ4GAJR.js} +4 -4
  7. package/dist/{chunk-7XFFRV7D.js.map → chunk-7PJ4GAJR.js.map} +1 -1
  8. package/dist/{chunk-ZPYQDMUX.js → chunk-7YZVSG62.js} +3 -3
  9. package/dist/{chunk-ZPYQDMUX.js.map → chunk-7YZVSG62.js.map} +1 -1
  10. package/dist/{chunk-BKO7DSPU.js → chunk-BRUDSHCV.js} +2 -2
  11. package/dist/chunk-BRUDSHCV.js.map +1 -0
  12. package/dist/{chunk-BH7MNDWW.js → chunk-EWVQWTNV.js} +13 -3
  13. package/dist/chunk-EWVQWTNV.js.map +1 -0
  14. package/dist/{chunk-CEKAYA2Q.cjs → chunk-HNRFRNMY.cjs} +2 -2
  15. package/dist/chunk-HNRFRNMY.cjs.map +1 -0
  16. package/dist/{chunk-7K7HZMP4.cjs → chunk-JGPDQDY4.cjs} +13 -3
  17. package/dist/chunk-JGPDQDY4.cjs.map +1 -0
  18. package/dist/{chunk-H5XMKBBA.cjs → chunk-MUZ2RYS2.cjs} +268 -241
  19. package/dist/chunk-MUZ2RYS2.cjs.map +1 -0
  20. package/dist/{chunk-UIWFYMAO.cjs → chunk-O33I4HBL.cjs} +5 -5
  21. package/dist/{chunk-UIWFYMAO.cjs.map → chunk-O33I4HBL.cjs.map} +1 -1
  22. package/dist/core/index.cjs +80 -80
  23. package/dist/core/index.d.cts +3 -3
  24. package/dist/core/index.d.ts +3 -3
  25. package/dist/core/index.js +3 -3
  26. package/dist/{index-pWEH7pUE.d.ts → index-25qIYJ21.d.ts} +1 -1
  27. package/dist/{index-2VtgKM8S.d.cts → index-C261xY-B.d.cts} +1 -1
  28. package/dist/mcp/index.cjs +47 -47
  29. package/dist/mcp/index.d.cts +13 -3
  30. package/dist/mcp/index.d.ts +13 -3
  31. package/dist/mcp/index.js +2 -2
  32. package/dist/react/index.cjs +50 -50
  33. package/dist/react/index.d.cts +18 -5
  34. package/dist/react/index.d.ts +18 -5
  35. package/dist/react/index.js +5 -5
  36. package/dist/tools/anthropic/index.d.cts +1 -1
  37. package/dist/tools/anthropic/index.d.ts +1 -1
  38. package/dist/tools/brave/index.cjs +2 -2
  39. package/dist/tools/brave/index.d.cts +1 -1
  40. package/dist/tools/brave/index.d.ts +1 -1
  41. package/dist/tools/brave/index.js +1 -1
  42. package/dist/tools/exa/index.cjs +2 -2
  43. package/dist/tools/exa/index.d.cts +1 -1
  44. package/dist/tools/exa/index.d.ts +1 -1
  45. package/dist/tools/exa/index.js +1 -1
  46. package/dist/tools/google/index.cjs +2 -2
  47. package/dist/tools/google/index.d.cts +1 -1
  48. package/dist/tools/google/index.d.ts +1 -1
  49. package/dist/tools/google/index.js +1 -1
  50. package/dist/tools/openai/index.cjs +2 -2
  51. package/dist/tools/openai/index.d.cts +1 -1
  52. package/dist/tools/openai/index.d.ts +1 -1
  53. package/dist/tools/openai/index.js +1 -1
  54. package/dist/tools/searxng/index.cjs +2 -2
  55. package/dist/tools/searxng/index.d.cts +1 -1
  56. package/dist/tools/searxng/index.d.ts +1 -1
  57. package/dist/tools/searxng/index.js +1 -1
  58. package/dist/tools/serper/index.cjs +2 -2
  59. package/dist/tools/serper/index.d.cts +1 -1
  60. package/dist/tools/serper/index.d.ts +1 -1
  61. package/dist/tools/serper/index.js +1 -1
  62. package/dist/tools/tavily/index.cjs +2 -2
  63. package/dist/tools/tavily/index.d.cts +1 -1
  64. package/dist/tools/tavily/index.d.ts +1 -1
  65. package/dist/tools/tavily/index.js +1 -1
  66. package/dist/tools/web-search/index.cjs +3 -3
  67. package/dist/tools/web-search/index.d.cts +2 -2
  68. package/dist/tools/web-search/index.d.ts +2 -2
  69. package/dist/tools/web-search/index.js +2 -2
  70. package/dist/{tools-DDWrco4h.d.cts → tools-Clyufshc.d.cts} +14 -1
  71. package/dist/{tools-DDWrco4h.d.ts → tools-Clyufshc.d.ts} +14 -1
  72. package/dist/{types-DjSfYNKj.d.cts → types-DM6M_pv_.d.cts} +43 -2
  73. package/dist/{types-Cizh9K_f.d.ts → types-wudOhedT.d.ts} +43 -2
  74. package/dist/ui/index.cjs +56 -26
  75. package/dist/ui/index.cjs.map +1 -1
  76. package/dist/ui/index.d.cts +37 -3
  77. package/dist/ui/index.d.ts +37 -3
  78. package/dist/ui/index.js +52 -22
  79. package/dist/ui/index.js.map +1 -1
  80. package/package.json +1 -1
  81. package/dist/chunk-7K7HZMP4.cjs.map +0 -1
  82. package/dist/chunk-BH7MNDWW.js.map +0 -1
  83. package/dist/chunk-BKO7DSPU.js.map +0 -1
  84. package/dist/chunk-CEKAYA2Q.cjs.map +0 -1
  85. package/dist/chunk-H5XMKBBA.cjs.map +0 -1
  86. package/dist/chunk-IXFV6AW6.js.map +0 -1
package/README.md CHANGED
@@ -44,48 +44,6 @@ function App() {
44
44
  | `/ui` | Pre-built UI components |
45
45
  | `/core` | Types, utilities, tool helpers |
46
46
 
47
- ## Built-in Tools
48
-
49
- ### Web Search
50
-
51
- Add real-time web search capabilities to your AI copilot. **No extra API key needed** - use your existing OpenAI or Google key.
52
-
53
- ```typescript
54
- import { createWebSearchTool } from "@yourgpt/copilot-sdk/core";
55
-
56
- // Use OpenAI's built-in search (recommended)
57
- const webSearch = createWebSearchTool({
58
- provider: "openai",
59
- apiKey: process.env.OPENAI_API_KEY,
60
- });
61
-
62
- // Or use Google's built-in search
63
- const webSearch = createWebSearchTool({
64
- provider: "google",
65
- apiKey: process.env.GOOGLE_API_KEY,
66
- });
67
-
68
- const runtime = createRuntime({
69
- provider: openai,
70
- model: "gpt-4o",
71
- tools: [webSearch],
72
- });
73
- ```
74
-
75
- **Native Providers (No extra API needed):**
76
-
77
- - `openai` - OpenAI's built-in web search
78
- - `google` - Google's grounding with Google Search
79
- - `anthropic` - Anthropic's built-in web search
80
-
81
- **Third-Party Providers:**
82
-
83
- - [Tavily](https://tavily.com/) - AI-native search with answer generation
84
- - [Serper](https://serper.dev/) - Google Search API
85
- - [Brave](https://brave.com/search/api/) - Privacy-focused search
86
- - [Exa](https://exa.ai/) - Semantic AI search
87
- - [SearXNG](https://docs.searxng.org/) - Self-hosted metasearch
88
-
89
47
  ## Examples
90
48
 
91
49
  Explore real-world implementations and demo projects.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkUIWFYMAO_cjs = require('./chunk-UIWFYMAO.cjs');
4
- var chunkCEKAYA2Q_cjs = require('./chunk-CEKAYA2Q.cjs');
3
+ var chunkO33I4HBL_cjs = require('./chunk-O33I4HBL.cjs');
4
+ var chunkHNRFRNMY_cjs = require('./chunk-HNRFRNMY.cjs');
5
5
 
6
6
  // src/core/tools/screenshot.ts
7
7
  var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
@@ -1036,7 +1036,7 @@ function createCustomDetector(customKeywords) {
1036
1036
  }
1037
1037
 
1038
1038
  // src/core/tools/builtin/screenshot.ts
1039
- var screenshotTool = chunkCEKAYA2Q_cjs.tool({
1039
+ var screenshotTool = chunkHNRFRNMY_cjs.tool({
1040
1040
  description: "Capture a screenshot of the user's current screen/viewport. Use this when the user asks you to look at their screen, see what they're seeing, help with visual issues, or debug UI problems.",
1041
1041
  location: "client",
1042
1042
  inputSchema: {
@@ -1055,7 +1055,7 @@ var screenshotTool = chunkCEKAYA2Q_cjs.tool({
1055
1055
  approvalMessage: "Allow AI to capture a screenshot of your screen?",
1056
1056
  handler: async (params) => {
1057
1057
  if (!isScreenshotSupported()) {
1058
- return chunkCEKAYA2Q_cjs.failure("Screenshot capture is not supported in this environment");
1058
+ return chunkHNRFRNMY_cjs.failure("Screenshot capture is not supported in this environment");
1059
1059
  }
1060
1060
  try {
1061
1061
  const options = {};
@@ -1081,20 +1081,20 @@ var screenshotTool = chunkCEKAYA2Q_cjs.tool({
1081
1081
  }
1082
1082
  };
1083
1083
  } catch (error) {
1084
- return chunkCEKAYA2Q_cjs.failure(
1084
+ return chunkHNRFRNMY_cjs.failure(
1085
1085
  error instanceof Error ? error.message : "Screenshot capture failed"
1086
1086
  );
1087
1087
  }
1088
1088
  }
1089
1089
  });
1090
1090
  function createScreenshotTool(options) {
1091
- return chunkCEKAYA2Q_cjs.tool({
1091
+ return chunkHNRFRNMY_cjs.tool({
1092
1092
  ...screenshotTool,
1093
1093
  needsApproval: options?.needsApproval ?? true,
1094
1094
  approvalMessage: options?.approvalMessage ?? "Allow AI to capture a screenshot of your screen?",
1095
1095
  handler: async (params) => {
1096
1096
  if (!isScreenshotSupported()) {
1097
- return chunkCEKAYA2Q_cjs.failure(
1097
+ return chunkHNRFRNMY_cjs.failure(
1098
1098
  "Screenshot capture is not supported in this environment"
1099
1099
  );
1100
1100
  }
@@ -1120,7 +1120,7 @@ function createScreenshotTool(options) {
1120
1120
  }
1121
1121
  };
1122
1122
  } catch (error) {
1123
- return chunkCEKAYA2Q_cjs.failure(
1123
+ return chunkHNRFRNMY_cjs.failure(
1124
1124
  error instanceof Error ? error.message : "Screenshot capture failed"
1125
1125
  );
1126
1126
  }
@@ -1133,7 +1133,7 @@ var isBrowser4 = typeof window !== "undefined" && typeof console !== "undefined"
1133
1133
  if (isBrowser4 && !isConsoleCaptureActive()) {
1134
1134
  startConsoleCapture();
1135
1135
  }
1136
- var consoleLogsTool = chunkCEKAYA2Q_cjs.tool({
1136
+ var consoleLogsTool = chunkHNRFRNMY_cjs.tool({
1137
1137
  description: "Get recent console logs from the browser. Use this when debugging JavaScript errors, checking for warnings, or understanding what's happening in the application.",
1138
1138
  location: "client",
1139
1139
  inputSchema: {
@@ -1166,7 +1166,7 @@ var consoleLogsTool = chunkCEKAYA2Q_cjs.tool({
1166
1166
  types: params.types
1167
1167
  });
1168
1168
  const formattedLogs = formatLogsForAI(logs.logs);
1169
- return chunkCEKAYA2Q_cjs.success(
1169
+ return chunkHNRFRNMY_cjs.success(
1170
1170
  {
1171
1171
  logs: formattedLogs,
1172
1172
  count: logs.logs.length,
@@ -1175,14 +1175,14 @@ var consoleLogsTool = chunkCEKAYA2Q_cjs.tool({
1175
1175
  `Retrieved ${logs.logs.length} console logs`
1176
1176
  );
1177
1177
  } catch (error) {
1178
- return chunkCEKAYA2Q_cjs.failure(
1178
+ return chunkHNRFRNMY_cjs.failure(
1179
1179
  error instanceof Error ? error.message : "Failed to get console logs"
1180
1180
  );
1181
1181
  }
1182
1182
  }
1183
1183
  });
1184
1184
  function createConsoleLogsTool(options) {
1185
- return chunkCEKAYA2Q_cjs.tool({
1185
+ return chunkHNRFRNMY_cjs.tool({
1186
1186
  ...consoleLogsTool,
1187
1187
  needsApproval: options?.needsApproval ?? true,
1188
1188
  approvalMessage: options?.approvalMessage ?? "Allow AI to access browser console logs?",
@@ -1196,7 +1196,7 @@ function createConsoleLogsTool(options) {
1196
1196
  types: params.types
1197
1197
  });
1198
1198
  const formattedLogs = formatLogsForAI(logs.logs);
1199
- return chunkCEKAYA2Q_cjs.success(
1199
+ return chunkHNRFRNMY_cjs.success(
1200
1200
  {
1201
1201
  logs: formattedLogs,
1202
1202
  count: logs.logs.length,
@@ -1205,7 +1205,7 @@ function createConsoleLogsTool(options) {
1205
1205
  `Retrieved ${logs.logs.length} console logs`
1206
1206
  );
1207
1207
  } catch (error) {
1208
- return chunkCEKAYA2Q_cjs.failure(
1208
+ return chunkHNRFRNMY_cjs.failure(
1209
1209
  error instanceof Error ? error.message : "Failed to get console logs"
1210
1210
  );
1211
1211
  }
@@ -1214,7 +1214,7 @@ function createConsoleLogsTool(options) {
1214
1214
  }
1215
1215
 
1216
1216
  // src/core/tools/builtin/network.ts
1217
- var networkRequestsTool = chunkCEKAYA2Q_cjs.tool({
1217
+ var networkRequestsTool = chunkHNRFRNMY_cjs.tool({
1218
1218
  description: "Get recent network requests from the browser. Use this when debugging API calls, checking for failed requests, analyzing network activity, or troubleshooting connectivity issues.",
1219
1219
  location: "client",
1220
1220
  inputSchema: {
@@ -1243,7 +1243,7 @@ var networkRequestsTool = chunkCEKAYA2Q_cjs.tool({
1243
1243
  failedOnly: params.failedOnly
1244
1244
  });
1245
1245
  const formattedRequests = formatRequestsForAI(requests.requests);
1246
- return chunkCEKAYA2Q_cjs.success(
1246
+ return chunkHNRFRNMY_cjs.success(
1247
1247
  {
1248
1248
  requests: formattedRequests,
1249
1249
  count: requests.requests.length,
@@ -1252,14 +1252,14 @@ var networkRequestsTool = chunkCEKAYA2Q_cjs.tool({
1252
1252
  `Retrieved ${requests.requests.length} network requests`
1253
1253
  );
1254
1254
  } catch (error) {
1255
- return chunkCEKAYA2Q_cjs.failure(
1255
+ return chunkHNRFRNMY_cjs.failure(
1256
1256
  error instanceof Error ? error.message : "Failed to get network requests"
1257
1257
  );
1258
1258
  }
1259
1259
  }
1260
1260
  });
1261
1261
  function createNetworkRequestsTool(options) {
1262
- return chunkCEKAYA2Q_cjs.tool({
1262
+ return chunkHNRFRNMY_cjs.tool({
1263
1263
  ...networkRequestsTool,
1264
1264
  needsApproval: options?.needsApproval ?? true,
1265
1265
  approvalMessage: options?.approvalMessage ?? "Allow AI to access network request history?",
@@ -1273,7 +1273,7 @@ function createNetworkRequestsTool(options) {
1273
1273
  failedOnly: params.failedOnly
1274
1274
  });
1275
1275
  const formattedRequests = formatRequestsForAI(requests.requests);
1276
- return chunkCEKAYA2Q_cjs.success(
1276
+ return chunkHNRFRNMY_cjs.success(
1277
1277
  {
1278
1278
  requests: formattedRequests,
1279
1279
  count: requests.requests.length,
@@ -1282,7 +1282,7 @@ function createNetworkRequestsTool(options) {
1282
1282
  `Retrieved ${requests.requests.length} network requests`
1283
1283
  );
1284
1284
  } catch (error) {
1285
- return chunkCEKAYA2Q_cjs.failure(
1285
+ return chunkHNRFRNMY_cjs.failure(
1286
1286
  error instanceof Error ? error.message : "Failed to get network requests"
1287
1287
  );
1288
1288
  }
@@ -1306,7 +1306,7 @@ var builtinTools = {
1306
1306
  },
1307
1307
  web_search: {
1308
1308
  name: "web_search",
1309
- ...chunkUIWFYMAO_cjs.webSearchTool
1309
+ ...chunkO33I4HBL_cjs.webSearchTool
1310
1310
  }
1311
1311
  };
1312
1312
 
@@ -2889,5 +2889,5 @@ exports.stopNetworkCapture = stopNetworkCapture;
2889
2889
  exports.streamSSE = streamSSE;
2890
2890
  exports.zodObjectToInputSchema = zodObjectToInputSchema;
2891
2891
  exports.zodToJsonSchema = zodToJsonSchema;
2892
- //# sourceMappingURL=chunk-UOWLKFXK.cjs.map
2893
- //# sourceMappingURL=chunk-UOWLKFXK.cjs.map
2892
+ //# sourceMappingURL=chunk-33JSFVGH.cjs.map
2893
+ //# sourceMappingURL=chunk-33JSFVGH.cjs.map