@yourgpt/copilot-sdk 1.4.1 → 1.4.2
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-T6W2Y3D6.js → chunk-55EABH45.js} +127 -68
- package/dist/chunk-55EABH45.js.map +1 -0
- package/dist/{chunk-7JQ5GJSK.js → chunk-B3FE7HDI.js} +3 -3
- package/dist/{chunk-7JQ5GJSK.js.map → chunk-B3FE7HDI.js.map} +1 -1
- package/dist/{chunk-I623CRO4.cjs → chunk-CVKN4H62.cjs} +127 -68
- package/dist/chunk-CVKN4H62.cjs.map +1 -0
- package/dist/{chunk-KRZXN5KV.cjs → chunk-ZR4YXLCM.cjs} +27 -27
- package/dist/{chunk-KRZXN5KV.cjs.map → chunk-ZR4YXLCM.cjs.map} +1 -1
- package/dist/core/index.cjs +76 -76
- package/dist/core/index.d.cts +8 -6
- package/dist/core/index.d.ts +8 -6
- package/dist/core/index.js +1 -1
- package/dist/react/index.cjs +42 -42
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/ui/index.cjs +7 -7
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +3 -3
- package/dist/ui/index.js.map +1 -1
- package/package.json +7 -6
- package/dist/chunk-I623CRO4.cjs.map +0 -1
- package/dist/chunk-T6W2Y3D6.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCVKN4H62_cjs = require('./chunk-CVKN4H62.cjs');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var z = require('zod');
|
|
@@ -2148,17 +2148,17 @@ function useAITools(options = {}) {
|
|
|
2148
2148
|
const rememberedConsentRef = react.useRef(/* @__PURE__ */ new Set());
|
|
2149
2149
|
react.useEffect(() => {
|
|
2150
2150
|
if (!autoStart || !isEnabled) return;
|
|
2151
|
-
if (consoleCapture && !
|
|
2152
|
-
|
|
2151
|
+
if (consoleCapture && !chunkCVKN4H62_cjs.isConsoleCaptureActive()) {
|
|
2152
|
+
chunkCVKN4H62_cjs.startConsoleCapture(consoleOptions);
|
|
2153
2153
|
setActiveCaptures((prev) => ({ ...prev, console: true }));
|
|
2154
2154
|
}
|
|
2155
|
-
if (network && !
|
|
2156
|
-
|
|
2155
|
+
if (network && !chunkCVKN4H62_cjs.isNetworkCaptureActive()) {
|
|
2156
|
+
chunkCVKN4H62_cjs.startNetworkCapture(networkOptions);
|
|
2157
2157
|
setActiveCaptures((prev) => ({ ...prev, network: true }));
|
|
2158
2158
|
}
|
|
2159
2159
|
return () => {
|
|
2160
|
-
|
|
2161
|
-
|
|
2160
|
+
chunkCVKN4H62_cjs.stopConsoleCapture();
|
|
2161
|
+
chunkCVKN4H62_cjs.stopNetworkCapture();
|
|
2162
2162
|
};
|
|
2163
2163
|
}, [
|
|
2164
2164
|
autoStart,
|
|
@@ -2173,12 +2173,12 @@ function useAITools(options = {}) {
|
|
|
2173
2173
|
if (!screenshot) {
|
|
2174
2174
|
throw new Error("Screenshot capture is not enabled");
|
|
2175
2175
|
}
|
|
2176
|
-
if (!
|
|
2176
|
+
if (!chunkCVKN4H62_cjs.isScreenshotSupported()) {
|
|
2177
2177
|
throw new Error(
|
|
2178
2178
|
"Screenshot capture is not supported in this environment"
|
|
2179
2179
|
);
|
|
2180
2180
|
}
|
|
2181
|
-
return
|
|
2181
|
+
return chunkCVKN4H62_cjs.captureScreenshot({ ...screenshotOptions, ...opts });
|
|
2182
2182
|
},
|
|
2183
2183
|
[screenshot, screenshotOptions]
|
|
2184
2184
|
);
|
|
@@ -2187,7 +2187,7 @@ function useAITools(options = {}) {
|
|
|
2187
2187
|
if (!consoleCapture) {
|
|
2188
2188
|
return { logs: [], totalCaptured: 0 };
|
|
2189
2189
|
}
|
|
2190
|
-
return
|
|
2190
|
+
return chunkCVKN4H62_cjs.getConsoleLogs({ ...consoleOptions, ...opts });
|
|
2191
2191
|
},
|
|
2192
2192
|
[consoleCapture, consoleOptions]
|
|
2193
2193
|
);
|
|
@@ -2196,7 +2196,7 @@ function useAITools(options = {}) {
|
|
|
2196
2196
|
if (!network) {
|
|
2197
2197
|
return { requests: [], totalCaptured: 0 };
|
|
2198
2198
|
}
|
|
2199
|
-
return
|
|
2199
|
+
return chunkCVKN4H62_cjs.getNetworkRequests({ ...networkOptions, ...opts });
|
|
2200
2200
|
},
|
|
2201
2201
|
[network, networkOptions]
|
|
2202
2202
|
);
|
|
@@ -2289,23 +2289,23 @@ function useAITools(options = {}) {
|
|
|
2289
2289
|
]
|
|
2290
2290
|
);
|
|
2291
2291
|
const startCapturing = react.useCallback(() => {
|
|
2292
|
-
if (consoleCapture && !
|
|
2293
|
-
|
|
2292
|
+
if (consoleCapture && !chunkCVKN4H62_cjs.isConsoleCaptureActive()) {
|
|
2293
|
+
chunkCVKN4H62_cjs.startConsoleCapture(consoleOptions);
|
|
2294
2294
|
setActiveCaptures((prev) => ({ ...prev, console: true }));
|
|
2295
2295
|
}
|
|
2296
|
-
if (network && !
|
|
2297
|
-
|
|
2296
|
+
if (network && !chunkCVKN4H62_cjs.isNetworkCaptureActive()) {
|
|
2297
|
+
chunkCVKN4H62_cjs.startNetworkCapture(networkOptions);
|
|
2298
2298
|
setActiveCaptures((prev) => ({ ...prev, network: true }));
|
|
2299
2299
|
}
|
|
2300
2300
|
}, [consoleCapture, network, consoleOptions, networkOptions]);
|
|
2301
2301
|
const stopCapturing = react.useCallback(() => {
|
|
2302
|
-
|
|
2303
|
-
|
|
2302
|
+
chunkCVKN4H62_cjs.stopConsoleCapture();
|
|
2303
|
+
chunkCVKN4H62_cjs.stopNetworkCapture();
|
|
2304
2304
|
setActiveCaptures({ console: false, network: false });
|
|
2305
2305
|
}, []);
|
|
2306
2306
|
const clearCaptured = react.useCallback(() => {
|
|
2307
|
-
|
|
2308
|
-
|
|
2307
|
+
chunkCVKN4H62_cjs.clearConsoleLogs();
|
|
2308
|
+
chunkCVKN4H62_cjs.clearNetworkRequests();
|
|
2309
2309
|
}, []);
|
|
2310
2310
|
const formatForAI = react.useCallback((context) => {
|
|
2311
2311
|
const parts = [];
|
|
@@ -2315,16 +2315,16 @@ function useAITools(options = {}) {
|
|
|
2315
2315
|
);
|
|
2316
2316
|
}
|
|
2317
2317
|
if (context.consoleLogs && context.consoleLogs.logs.length > 0) {
|
|
2318
|
-
parts.push(
|
|
2318
|
+
parts.push(chunkCVKN4H62_cjs.formatLogsForAI(context.consoleLogs.logs));
|
|
2319
2319
|
}
|
|
2320
2320
|
if (context.networkRequests && context.networkRequests.requests.length > 0) {
|
|
2321
|
-
parts.push(
|
|
2321
|
+
parts.push(chunkCVKN4H62_cjs.formatRequestsForAI(context.networkRequests.requests));
|
|
2322
2322
|
}
|
|
2323
2323
|
return parts.length > 0 ? parts.join("\n\n---\n\n") : "No context captured.";
|
|
2324
2324
|
}, []);
|
|
2325
2325
|
const detectIntentFn = react.useCallback(
|
|
2326
2326
|
(message) => {
|
|
2327
|
-
const result =
|
|
2327
|
+
const result = chunkCVKN4H62_cjs.detectIntent(message);
|
|
2328
2328
|
result.suggestedTools = result.suggestedTools.filter((tool) => {
|
|
2329
2329
|
if (tool === "screenshot") return screenshot;
|
|
2330
2330
|
if (tool === "console") return consoleCapture;
|
|
@@ -2448,7 +2448,7 @@ function convertZodSchema(schema, _toolName) {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
} catch {
|
|
2450
2450
|
}
|
|
2451
|
-
return
|
|
2451
|
+
return chunkCVKN4H62_cjs.zodObjectToInputSchema(schema);
|
|
2452
2452
|
}
|
|
2453
2453
|
function useToolWithSchema(config, dependencies = []) {
|
|
2454
2454
|
const { registerTool, unregisterTool } = useCopilotContext();
|
|
@@ -2746,7 +2746,7 @@ function useAgent(options) {
|
|
|
2746
2746
|
if (!response.ok) {
|
|
2747
2747
|
throw new Error(`Agent error: ${response.status}`);
|
|
2748
2748
|
}
|
|
2749
|
-
for await (const event of
|
|
2749
|
+
for await (const event of chunkCVKN4H62_cjs.streamSSE(response)) {
|
|
2750
2750
|
handleAgentEvent(event);
|
|
2751
2751
|
}
|
|
2752
2752
|
} catch (err) {
|
|
@@ -3240,7 +3240,7 @@ function createReactThreadManagerState(initialThreads) {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
|
|
3242
3242
|
// src/react/internal/ReactThreadManager.ts
|
|
3243
|
-
var _ReactThreadManager = class _ReactThreadManager extends
|
|
3243
|
+
var _ReactThreadManager = class _ReactThreadManager extends chunkCVKN4H62_cjs.ThreadManager {
|
|
3244
3244
|
constructor(config = {}, callbacks = {}) {
|
|
3245
3245
|
const reactState = new ReactThreadManagerState();
|
|
3246
3246
|
super({ ...config, state: reactState }, callbacks);
|
|
@@ -3800,5 +3800,5 @@ exports.useToolExecutor = useToolExecutor;
|
|
|
3800
3800
|
exports.useToolWithSchema = useToolWithSchema;
|
|
3801
3801
|
exports.useTools = useTools;
|
|
3802
3802
|
exports.useToolsWithSchema = useToolsWithSchema;
|
|
3803
|
-
//# sourceMappingURL=chunk-
|
|
3804
|
-
//# sourceMappingURL=chunk-
|
|
3803
|
+
//# sourceMappingURL=chunk-ZR4YXLCM.cjs.map
|
|
3804
|
+
//# sourceMappingURL=chunk-ZR4YXLCM.cjs.map
|