@copilotkit/react-core 0.0.0-fix-error-surfacing-prod-20251007135841 → 0.0.0-fix-allow-action-wrapper-disable-20251007143856
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/CHANGELOG.md +4 -5
- package/dist/{chunk-E3624YDU.mjs → chunk-2TLKKHCN.mjs} +2 -2
- package/dist/{chunk-EDBI5PCJ.mjs → chunk-55UOFCC4.mjs} +2 -2
- package/dist/{chunk-OT5NHMEC.mjs → chunk-GFCDU2YP.mjs} +2 -2
- package/dist/{chunk-YH6JKJML.mjs → chunk-KT3BEAIO.mjs} +1 -1
- package/dist/chunk-KT3BEAIO.mjs.map +1 -0
- package/dist/{chunk-33OKWHPL.mjs → chunk-M7TN7DDX.mjs} +2 -2
- package/dist/chunk-M7TN7DDX.mjs.map +1 -0
- package/dist/{chunk-GGLAHG3I.mjs → chunk-P6KEB6HU.mjs} +5 -5
- package/dist/{chunk-6ESSSQ7Q.mjs → chunk-Q3MCVRO3.mjs} +21 -8
- package/dist/chunk-Q3MCVRO3.mjs.map +1 -0
- package/dist/{chunk-MIXSWZSB.mjs → chunk-QATHZ5U6.mjs} +2 -2
- package/dist/{chunk-OAGAFMUM.mjs → chunk-SU2G5I76.mjs} +2 -2
- package/dist/{chunk-CV2PDTC7.mjs → chunk-V6DILK7X.mjs} +2 -2
- package/dist/chunk-V6DILK7X.mjs.map +1 -0
- package/dist/{chunk-BXXJQ2BL.mjs → chunk-VCYV4GLO.mjs} +3 -3
- package/dist/{chunk-NSBAWITG.mjs → chunk-VXXDWHQ2.mjs} +3 -3
- package/dist/components/copilot-provider/copilotkit.js +17 -7
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +3 -3
- package/dist/components/copilot-provider/index.js +17 -7
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +3 -3
- package/dist/components/index.js +17 -7
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/hooks/index.js +34 -9
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +12 -12
- package/dist/hooks/use-chat.js +32 -7
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +3 -2
- package/dist/hooks/use-coagent.js +32 -7
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +6 -6
- package/dist/hooks/use-copilot-chat-headless_c.js +32 -7
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +6 -6
- package/dist/hooks/use-copilot-chat.js +32 -7
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +6 -6
- package/dist/hooks/use-copilot-chat_internal.js +32 -7
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +5 -5
- package/dist/hooks/use-copilot-runtime-client.js +32 -7
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +2 -1
- package/dist/hooks/use-frontend-tool.d.ts +4 -1
- package/dist/hooks/use-frontend-tool.js.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +1 -1
- package/dist/hooks/use-human-in-the-loop.d.ts +4 -2
- package/dist/hooks/use-human-in-the-loop.js +1 -1
- package/dist/hooks/use-human-in-the-loop.js.map +1 -1
- package/dist/hooks/use-human-in-the-loop.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +32 -7
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +6 -6
- package/dist/hooks/use-render-tool-call.d.ts +4 -1
- package/dist/hooks/use-render-tool-call.js +1 -1
- package/dist/hooks/use-render-tool-call.js.map +1 -1
- package/dist/hooks/use-render-tool-call.mjs +1 -1
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -15
- package/dist/lib/copilot-task.mjs +4 -4
- package/dist/lib/index.mjs +4 -4
- package/dist/utils/extract.mjs +3 -3
- package/dist/utils/index.mjs +5 -5
- package/dist/utils/suggestions.mjs +3 -3
- package/package.json +5 -5
- package/src/hooks/use-copilot-runtime-client.ts +21 -10
- package/src/hooks/use-frontend-tool.ts +8 -4
- package/src/hooks/use-human-in-the-loop.ts +7 -4
- package/src/hooks/use-render-tool-call.ts +7 -3
- package/dist/chunk-33OKWHPL.mjs.map +0 -1
- package/dist/chunk-6ESSSQ7Q.mjs.map +0 -1
- package/dist/chunk-CV2PDTC7.mjs.map +0 -1
- package/dist/chunk-YH6JKJML.mjs.map +0 -1
- /package/dist/{chunk-E3624YDU.mjs.map → chunk-2TLKKHCN.mjs.map} +0 -0
- /package/dist/{chunk-EDBI5PCJ.mjs.map → chunk-55UOFCC4.mjs.map} +0 -0
- /package/dist/{chunk-OT5NHMEC.mjs.map → chunk-GFCDU2YP.mjs.map} +0 -0
- /package/dist/{chunk-GGLAHG3I.mjs.map → chunk-P6KEB6HU.mjs.map} +0 -0
- /package/dist/{chunk-MIXSWZSB.mjs.map → chunk-QATHZ5U6.mjs.map} +0 -0
- /package/dist/{chunk-OAGAFMUM.mjs.map → chunk-SU2G5I76.mjs.map} +0 -0
- /package/dist/{chunk-BXXJQ2BL.mjs.map → chunk-VCYV4GLO.mjs.map} +0 -0
- /package/dist/{chunk-NSBAWITG.mjs.map → chunk-VXXDWHQ2.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "../chunk-DZTU6PGS.mjs";
|
|
2
2
|
import {
|
|
3
3
|
useLangGraphInterrupt
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-QATHZ5U6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useMakeCopilotDocumentReadable
|
|
7
7
|
} from "../chunk-BBUQMG45.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useRenderToolCall
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-V6DILK7X.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useCopilotReadable
|
|
13
13
|
} from "../chunk-HDOG2RTM.mjs";
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "../chunk-MQYWH4E6.mjs";
|
|
17
17
|
import {
|
|
18
18
|
useFrontendTool
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-KT3BEAIO.mjs";
|
|
20
20
|
import {
|
|
21
21
|
useHumanInTheLoop
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-M7TN7DDX.mjs";
|
|
23
23
|
import {
|
|
24
24
|
useCoAgentStateRender
|
|
25
25
|
} from "../chunk-GT5WI3AF.mjs";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
startAgent,
|
|
29
29
|
stopAgent,
|
|
30
30
|
useCoAgent
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-VCYV4GLO.mjs";
|
|
32
32
|
import {
|
|
33
33
|
useCopilotAdditionalInstructions
|
|
34
34
|
} from "../chunk-MGWRDFBE.mjs";
|
|
@@ -40,32 +40,32 @@ import {
|
|
|
40
40
|
} from "../chunk-T3376SZS.mjs";
|
|
41
41
|
import {
|
|
42
42
|
useCopilotChatHeadless_c
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-SU2G5I76.mjs";
|
|
44
44
|
import {
|
|
45
45
|
useCopilotChat as useCopilotChat2
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-2TLKKHCN.mjs";
|
|
47
47
|
import {
|
|
48
48
|
useCopilotChat
|
|
49
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-VXXDWHQ2.mjs";
|
|
50
50
|
import {
|
|
51
51
|
useLangGraphInterruptRender
|
|
52
52
|
} from "../chunk-ZVOLWJCY.mjs";
|
|
53
|
-
import "../chunk-
|
|
53
|
+
import "../chunk-GFCDU2YP.mjs";
|
|
54
54
|
import "../chunk-4CEQJ2X6.mjs";
|
|
55
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-P6KEB6HU.mjs";
|
|
56
56
|
import "../chunk-DXEQPN43.mjs";
|
|
57
57
|
import "../chunk-OKCYPO4I.mjs";
|
|
58
58
|
import "../chunk-PIF5KJYI.mjs";
|
|
59
59
|
import "../chunk-N4VN2B5S.mjs";
|
|
60
60
|
import "../chunk-2IDV5OHF.mjs";
|
|
61
61
|
import "../chunk-C6IANC2R.mjs";
|
|
62
|
-
import "../chunk-ICIK2BSB.mjs";
|
|
63
62
|
import "../chunk-RKTVJRK7.mjs";
|
|
64
63
|
import "../chunk-PMAFHQ7P.mjs";
|
|
65
64
|
import "../chunk-5FHSUKQL.mjs";
|
|
66
65
|
import {
|
|
67
66
|
useCopilotRuntimeClient
|
|
68
|
-
} from "../chunk-
|
|
67
|
+
} from "../chunk-Q3MCVRO3.mjs";
|
|
68
|
+
import "../chunk-ICIK2BSB.mjs";
|
|
69
69
|
import "../chunk-N4WEHORG.mjs";
|
|
70
70
|
import "../chunk-O7ARI5CV.mjs";
|
|
71
71
|
import "../chunk-EFL5OBKN.mjs";
|
package/dist/hooks/use-chat.js
CHANGED
|
@@ -230,6 +230,21 @@ function useToast() {
|
|
|
230
230
|
// src/hooks/use-copilot-runtime-client.ts
|
|
231
231
|
var import_react3 = require("react");
|
|
232
232
|
var import_shared3 = require("@copilotkit/shared");
|
|
233
|
+
|
|
234
|
+
// src/utils/dev-console.ts
|
|
235
|
+
function isLocalhost() {
|
|
236
|
+
if (typeof window === "undefined")
|
|
237
|
+
return false;
|
|
238
|
+
return window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "0.0.0.0";
|
|
239
|
+
}
|
|
240
|
+
function shouldShowDevConsole(showDevConsole) {
|
|
241
|
+
if (showDevConsole !== void 0) {
|
|
242
|
+
return showDevConsole;
|
|
243
|
+
}
|
|
244
|
+
return isLocalhost();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// src/hooks/use-copilot-runtime-client.ts
|
|
233
248
|
var useCopilotRuntimeClient = (options) => {
|
|
234
249
|
const { setBannerError } = useToast();
|
|
235
250
|
const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
|
|
@@ -268,10 +283,15 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
268
283
|
const routeError = (gqlError) => {
|
|
269
284
|
const extensions = gqlError.extensions;
|
|
270
285
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
286
|
+
const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
|
|
271
287
|
if (visibility === import_shared3.ErrorVisibility.SILENT) {
|
|
272
288
|
console.error("CopilotKit Silent Error:", gqlError.message);
|
|
273
289
|
return;
|
|
274
290
|
}
|
|
291
|
+
if (!isDev) {
|
|
292
|
+
console.error("CopilotKit Error (hidden in production):", gqlError.message);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
275
295
|
const now = Date.now();
|
|
276
296
|
const errorMessage = gqlError.message;
|
|
277
297
|
if (lastStructuredErrorRef.current && lastStructuredErrorRef.current.message === errorMessage && now - lastStructuredErrorRef.current.timestamp < 150) {
|
|
@@ -293,12 +313,17 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
293
313
|
};
|
|
294
314
|
graphQLErrors.forEach(routeError);
|
|
295
315
|
} else {
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
316
|
+
const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
|
|
317
|
+
if (!isDev) {
|
|
318
|
+
console.error("CopilotKit Error (hidden in production):", error);
|
|
319
|
+
} else {
|
|
320
|
+
const fallbackError = new import_shared3.CopilotKitError({
|
|
321
|
+
message: (error == null ? void 0 : error.message) || String(error),
|
|
322
|
+
code: import_shared3.CopilotKitErrorCode.UNKNOWN
|
|
323
|
+
});
|
|
324
|
+
setBannerError(fallbackError);
|
|
325
|
+
traceUIError(fallbackError, error);
|
|
326
|
+
}
|
|
302
327
|
}
|
|
303
328
|
},
|
|
304
329
|
handleGQLWarning: (message) => {
|
|
@@ -310,7 +335,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
310
335
|
setBannerError(warningError);
|
|
311
336
|
}
|
|
312
337
|
}));
|
|
313
|
-
}, [runtimeOptions, setBannerError, onError]);
|
|
338
|
+
}, [runtimeOptions, setBannerError, showDevConsole, onError]);
|
|
314
339
|
return runtimeClient;
|
|
315
340
|
};
|
|
316
341
|
function createStructuredError(gqlError) {
|