@yourgpt/copilot-sdk 2.1.2 → 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.
- package/dist/{chunk-XAC7NTIO.js → chunk-37KEHUCE.js} +14 -10
- package/dist/chunk-37KEHUCE.js.map +1 -0
- package/dist/{chunk-VXT2O6R6.js → chunk-7PKGRYHY.js} +278 -82
- package/dist/chunk-7PKGRYHY.js.map +1 -0
- package/dist/{chunk-VUHP6TAN.js → chunk-LZMBBGWH.js} +3 -3
- package/dist/{chunk-VUHP6TAN.js.map → chunk-LZMBBGWH.js.map} +1 -1
- package/dist/{chunk-BNBEKK3U.cjs → chunk-N6VZ7FOW.cjs} +302 -106
- package/dist/chunk-N6VZ7FOW.cjs.map +1 -0
- package/dist/{chunk-7MZLBGFQ.cjs → chunk-OQPRIB73.cjs} +33 -29
- package/dist/chunk-OQPRIB73.cjs.map +1 -0
- package/dist/{chunk-CSEZZ5DX.cjs → chunk-POZNNKNJ.cjs} +2 -2
- package/dist/{chunk-CSEZZ5DX.cjs.map → chunk-POZNNKNJ.cjs.map} +1 -1
- package/dist/{chunk-BMYNG3WM.js → chunk-QLH6TSCC.js} +2 -2
- package/dist/{chunk-BMYNG3WM.js.map → chunk-QLH6TSCC.js.map} +1 -1
- package/dist/{chunk-GSTTJ46F.cjs → chunk-WAPGTQDR.cjs} +5 -5
- package/dist/{chunk-GSTTJ46F.cjs.map → chunk-WAPGTQDR.cjs.map} +1 -1
- package/dist/core/index.cjs +80 -80
- package/dist/core/index.d.cts +17 -6
- package/dist/core/index.d.ts +17 -6
- package/dist/core/index.js +3 -3
- package/dist/{index-jwRcC2QD.d.cts → index-BHkRA0mM.d.cts} +1 -1
- package/dist/{index-Du3Akr_E.d.ts → index-tB0qI8my.d.ts} +1 -1
- package/dist/mcp/index.d.cts +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/react/index.cjs +53 -49
- package/dist/react/index.d.cts +78 -19
- package/dist/react/index.d.ts +78 -19
- package/dist/react/index.js +4 -4
- package/dist/tools/anthropic/index.d.cts +1 -1
- package/dist/tools/anthropic/index.d.ts +1 -1
- package/dist/tools/brave/index.cjs +2 -2
- package/dist/tools/brave/index.d.cts +1 -1
- package/dist/tools/brave/index.d.ts +1 -1
- package/dist/tools/brave/index.js +1 -1
- package/dist/tools/exa/index.cjs +2 -2
- package/dist/tools/exa/index.d.cts +1 -1
- package/dist/tools/exa/index.d.ts +1 -1
- package/dist/tools/exa/index.js +1 -1
- package/dist/tools/google/index.cjs +2 -2
- package/dist/tools/google/index.d.cts +1 -1
- package/dist/tools/google/index.d.ts +1 -1
- package/dist/tools/google/index.js +1 -1
- package/dist/tools/openai/index.cjs +2 -2
- package/dist/tools/openai/index.d.cts +1 -1
- package/dist/tools/openai/index.d.ts +1 -1
- package/dist/tools/openai/index.js +1 -1
- package/dist/tools/searxng/index.cjs +2 -2
- package/dist/tools/searxng/index.d.cts +1 -1
- package/dist/tools/searxng/index.d.ts +1 -1
- package/dist/tools/searxng/index.js +1 -1
- package/dist/tools/serper/index.cjs +2 -2
- package/dist/tools/serper/index.d.cts +1 -1
- package/dist/tools/serper/index.d.ts +1 -1
- package/dist/tools/serper/index.js +1 -1
- package/dist/tools/tavily/index.cjs +2 -2
- package/dist/tools/tavily/index.d.cts +1 -1
- package/dist/tools/tavily/index.d.ts +1 -1
- package/dist/tools/tavily/index.js +1 -1
- package/dist/tools/web-search/index.cjs +3 -3
- package/dist/tools/web-search/index.d.cts +2 -2
- package/dist/tools/web-search/index.d.ts +2 -2
- package/dist/tools/web-search/index.js +2 -2
- package/dist/{tools-BHQRB_YT.d.cts → tools-coIcskZ4.d.cts} +18 -4
- package/dist/{tools-BHQRB_YT.d.ts → tools-coIcskZ4.d.ts} +18 -4
- package/dist/{types-8_Hp2rmm.d.cts → types-C8t4Ut8f.d.cts} +1 -1
- package/dist/{types-OYi-iUVY.d.ts → types-rjaSVmEF.d.ts} +1 -1
- package/dist/ui/index.cjs +8 -8
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-7MZLBGFQ.cjs.map +0 -1
- package/dist/chunk-BNBEKK3U.cjs.map +0 -1
- package/dist/chunk-VXT2O6R6.js.map +0 -1
- package/dist/chunk-XAC7NTIO.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkWAPGTQDR_cjs = require('./chunk-WAPGTQDR.cjs');
|
|
4
|
+
var chunkPOZNNKNJ_cjs = require('./chunk-POZNNKNJ.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 =
|
|
1039
|
+
var screenshotTool = chunkPOZNNKNJ_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 = chunkCSEZZ5DX_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
|
|
1058
|
+
return chunkPOZNNKNJ_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 = chunkCSEZZ5DX_cjs.tool({
|
|
|
1081
1081
|
}
|
|
1082
1082
|
};
|
|
1083
1083
|
} catch (error) {
|
|
1084
|
-
return
|
|
1084
|
+
return chunkPOZNNKNJ_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
|
|
1091
|
+
return chunkPOZNNKNJ_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
|
|
1097
|
+
return chunkPOZNNKNJ_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
|
|
1123
|
+
return chunkPOZNNKNJ_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 =
|
|
1136
|
+
var consoleLogsTool = chunkPOZNNKNJ_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 = chunkCSEZZ5DX_cjs.tool({
|
|
|
1166
1166
|
types: params.types
|
|
1167
1167
|
});
|
|
1168
1168
|
const formattedLogs = formatLogsForAI(logs.logs);
|
|
1169
|
-
return
|
|
1169
|
+
return chunkPOZNNKNJ_cjs.success(
|
|
1170
1170
|
{
|
|
1171
1171
|
logs: formattedLogs,
|
|
1172
1172
|
count: logs.logs.length,
|
|
@@ -1175,14 +1175,14 @@ var consoleLogsTool = chunkCSEZZ5DX_cjs.tool({
|
|
|
1175
1175
|
`Retrieved ${logs.logs.length} console logs`
|
|
1176
1176
|
);
|
|
1177
1177
|
} catch (error) {
|
|
1178
|
-
return
|
|
1178
|
+
return chunkPOZNNKNJ_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
|
|
1185
|
+
return chunkPOZNNKNJ_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
|
|
1199
|
+
return chunkPOZNNKNJ_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
|
|
1208
|
+
return chunkPOZNNKNJ_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 =
|
|
1217
|
+
var networkRequestsTool = chunkPOZNNKNJ_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 = chunkCSEZZ5DX_cjs.tool({
|
|
|
1243
1243
|
failedOnly: params.failedOnly
|
|
1244
1244
|
});
|
|
1245
1245
|
const formattedRequests = formatRequestsForAI(requests.requests);
|
|
1246
|
-
return
|
|
1246
|
+
return chunkPOZNNKNJ_cjs.success(
|
|
1247
1247
|
{
|
|
1248
1248
|
requests: formattedRequests,
|
|
1249
1249
|
count: requests.requests.length,
|
|
@@ -1252,14 +1252,14 @@ var networkRequestsTool = chunkCSEZZ5DX_cjs.tool({
|
|
|
1252
1252
|
`Retrieved ${requests.requests.length} network requests`
|
|
1253
1253
|
);
|
|
1254
1254
|
} catch (error) {
|
|
1255
|
-
return
|
|
1255
|
+
return chunkPOZNNKNJ_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
|
|
1262
|
+
return chunkPOZNNKNJ_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
|
|
1276
|
+
return chunkPOZNNKNJ_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
|
|
1285
|
+
return chunkPOZNNKNJ_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
|
-
...
|
|
1309
|
+
...chunkWAPGTQDR_cjs.webSearchTool
|
|
1310
1310
|
}
|
|
1311
1311
|
};
|
|
1312
1312
|
|
|
@@ -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 ?
|
|
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] =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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-
|
|
2893
|
-
//# sourceMappingURL=chunk-
|
|
2896
|
+
//# sourceMappingURL=chunk-OQPRIB73.cjs.map
|
|
2897
|
+
//# sourceMappingURL=chunk-OQPRIB73.cjs.map
|