@copilotkit/react-core 1.9.2-next.16 → 1.9.2-next.18
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 +19 -0
- package/dist/{chunk-T6CEBWGR.mjs → chunk-36MGCCPZ.mjs} +2 -2
- package/dist/{chunk-44XAHWIU.mjs → chunk-3SLA7Q2N.mjs} +2 -2
- package/dist/{chunk-ETFA6XAF.mjs → chunk-5BSUSFHM.mjs} +2 -2
- package/dist/{chunk-JUEBTQ7Q.mjs → chunk-5DODGOMM.mjs} +7 -7
- package/dist/{chunk-JUEBTQ7Q.mjs.map → chunk-5DODGOMM.mjs.map} +1 -1
- package/dist/{chunk-6V7FSJU5.mjs → chunk-5PE2XROA.mjs} +3 -3
- package/dist/{chunk-VUAQ2JRZ.mjs → chunk-7EJ4IWSA.mjs} +4 -4
- package/dist/{chunk-KPVFLQYE.mjs → chunk-BHGYBOR3.mjs} +4 -4
- package/dist/{chunk-BMHFKVRE.mjs → chunk-BVK7PLK6.mjs} +2 -2
- package/dist/{chunk-FIWNDD4G.mjs → chunk-DKZTPL66.mjs} +2 -2
- package/dist/{chunk-FIWNDD4G.mjs.map → chunk-DKZTPL66.mjs.map} +1 -1
- package/dist/{chunk-55QZ2SVJ.mjs → chunk-JWAXDYOW.mjs} +8 -8
- package/dist/chunk-JWAXDYOW.mjs.map +1 -0
- package/dist/{chunk-NBSSZHQO.mjs → chunk-KIXKBJUV.mjs} +2 -2
- package/dist/{chunk-R7XJ5MBN.mjs → chunk-KWQPQ4MM.mjs} +6 -6
- package/dist/{chunk-R7XJ5MBN.mjs.map → chunk-KWQPQ4MM.mjs.map} +1 -1
- package/dist/{chunk-SLNYMYUX.mjs → chunk-R2LNRHJP.mjs} +7 -7
- package/dist/{chunk-SLNYMYUX.mjs.map → chunk-R2LNRHJP.mjs.map} +1 -1
- package/dist/{chunk-LUZQL376.mjs → chunk-VDADWRS3.mjs} +2 -2
- package/dist/{chunk-654Z36FY.mjs → chunk-WR3XTNHJ.mjs} +2 -2
- package/dist/{chunk-SFADWQ4P.mjs → chunk-XJ34ATKP.mjs} +3 -3
- package/dist/components/copilot-provider/copilot-messages.js +6 -6
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +8 -8
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.js +15 -15
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +4 -4
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +15 -15
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +4 -4
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +15 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +1 -1
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/{copilot-context-5f835171.d.ts → copilot-context-3ab4fdf5.d.ts} +2 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +12 -12
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +15 -15
- package/dist/hooks/use-chat.d.ts +1 -1
- package/dist/hooks/use-chat.js +12 -12
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +3 -3
- package/dist/hooks/use-coagent-state-render.js +1 -1
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +2 -2
- package/dist/hooks/use-coagent.d.ts +1 -1
- package/dist/hooks/use-coagent.js +12 -12
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +7 -7
- package/dist/hooks/use-copilot-action.js +1 -1
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-additional-instructions.js +1 -1
- package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
- package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +1 -1
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat.d.ts +1 -1
- package/dist/hooks/use-copilot-chat.js +12 -12
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +6 -6
- package/dist/hooks/use-copilot-readable.js +1 -1
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +2 -2
- package/dist/hooks/use-copilot-runtime-client.d.ts +2 -2
- package/dist/hooks/use-copilot-runtime-client.js +7 -7
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.js +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +12 -12
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +7 -7
- package/dist/hooks/use-make-copilot-document-readable.js +1 -1
- package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +5 -5
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/utils/extract.d.ts +1 -1
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +4 -4
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +4 -4
- package/package.json +3 -3
- package/src/components/copilot-provider/__tests__/{copilotkit-trace.test.tsx → copilotkit-error.test.tsx} +17 -17
- package/src/components/copilot-provider/copilot-messages.tsx +6 -6
- package/src/components/copilot-provider/copilotkit-props.tsx +7 -7
- package/src/components/copilot-provider/copilotkit.tsx +2 -2
- package/src/context/copilot-context.tsx +3 -3
- package/src/hooks/use-chat.ts +6 -6
- package/src/hooks/use-copilot-runtime-client.ts +11 -12
- package/tsconfig.json +4 -1
- package/dist/chunk-55QZ2SVJ.mjs.map +0 -1
- /package/dist/{chunk-T6CEBWGR.mjs.map → chunk-36MGCCPZ.mjs.map} +0 -0
- /package/dist/{chunk-44XAHWIU.mjs.map → chunk-3SLA7Q2N.mjs.map} +0 -0
- /package/dist/{chunk-ETFA6XAF.mjs.map → chunk-5BSUSFHM.mjs.map} +0 -0
- /package/dist/{chunk-6V7FSJU5.mjs.map → chunk-5PE2XROA.mjs.map} +0 -0
- /package/dist/{chunk-VUAQ2JRZ.mjs.map → chunk-7EJ4IWSA.mjs.map} +0 -0
- /package/dist/{chunk-KPVFLQYE.mjs.map → chunk-BHGYBOR3.mjs.map} +0 -0
- /package/dist/{chunk-BMHFKVRE.mjs.map → chunk-BVK7PLK6.mjs.map} +0 -0
- /package/dist/{chunk-NBSSZHQO.mjs.map → chunk-KIXKBJUV.mjs.map} +0 -0
- /package/dist/{chunk-LUZQL376.mjs.map → chunk-VDADWRS3.mjs.map} +0 -0
- /package/dist/{chunk-654Z36FY.mjs.map → chunk-WR3XTNHJ.mjs.map} +0 -0
- /package/dist/{chunk-SFADWQ4P.mjs.map → chunk-XJ34ATKP.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import "../chunk-CQPYJIBH.mjs";
|
|
2
2
|
import {
|
|
3
3
|
useLangGraphInterruptRender
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-VDADWRS3.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useLangGraphInterrupt
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-5PE2XROA.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useMakeCopilotDocumentReadable
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-36MGCCPZ.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useCoAgentStateRender
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-KIXKBJUV.mjs";
|
|
14
14
|
import {
|
|
15
15
|
runAgent,
|
|
16
16
|
startAgent,
|
|
17
17
|
stopAgent,
|
|
18
18
|
useCoAgent
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-BHGYBOR3.mjs";
|
|
20
20
|
import {
|
|
21
21
|
useCopilotAdditionalInstructions
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-BVK7PLK6.mjs";
|
|
23
23
|
import {
|
|
24
24
|
useCopilotAuthenticatedAction_c
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-XJ34ATKP.mjs";
|
|
26
26
|
import {
|
|
27
27
|
useCopilotAction
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-WR3XTNHJ.mjs";
|
|
29
29
|
import {
|
|
30
30
|
useCopilotChat
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-7EJ4IWSA.mjs";
|
|
32
32
|
import {
|
|
33
33
|
useCopilotReadable
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-5BSUSFHM.mjs";
|
|
35
|
+
import "../chunk-KWQPQ4MM.mjs";
|
|
36
36
|
import "../chunk-SJJNFYGQ.mjs";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-R2LNRHJP.mjs";
|
|
38
38
|
import "../chunk-5FHSUKQL.mjs";
|
|
39
39
|
import "../chunk-RKTVJRK7.mjs";
|
|
40
40
|
import "../chunk-PMAFHQ7P.mjs";
|
|
41
41
|
import "../chunk-57K2ZJ5F.mjs";
|
|
42
42
|
import "../chunk-YPSGKPDA.mjs";
|
|
43
43
|
import "../chunk-DCTJZ742.mjs";
|
|
44
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-5DODGOMM.mjs";
|
|
45
45
|
import "../chunk-4CEQJ2X6.mjs";
|
|
46
46
|
import "../chunk-3OQM3NEK.mjs";
|
|
47
47
|
import "../chunk-O7ARI5CV.mjs";
|
|
48
48
|
import {
|
|
49
49
|
useCopilotRuntimeClient
|
|
50
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-JWAXDYOW.mjs";
|
|
51
51
|
import "../chunk-GFJW4RIM.mjs";
|
|
52
52
|
import "../chunk-YAF2LATQ.mjs";
|
|
53
|
-
import "../chunk-
|
|
53
|
+
import "../chunk-DKZTPL66.mjs";
|
|
54
54
|
import "../chunk-SKC7AJIV.mjs";
|
|
55
55
|
export {
|
|
56
56
|
runAgent,
|
package/dist/hooks/use-chat.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FunctionCallHandler, CoAgentStateRenderHandler } from '@copilotkit/shared';
|
|
3
3
|
import { Message, TextMessage, ForwardedParametersInput, ExtensionsInput } from '@copilotkit/runtime-client-gql';
|
|
4
|
-
import { c as CopilotApiConfig, A as AgentSession, L as LangGraphInterruptAction, d as LangGraphInterruptActionSetter } from '../copilot-context-
|
|
4
|
+
import { c as CopilotApiConfig, A as AgentSession, L as LangGraphInterruptAction, d as LangGraphInterruptActionSetter } from '../copilot-context-3ab4fdf5.js';
|
|
5
5
|
import { FrontendAction } from '../types/frontend-action.js';
|
|
6
6
|
import { CoagentState } from '../types/coagent-state.js';
|
|
7
7
|
import './use-tree.js';
|
package/dist/hooks/use-chat.js
CHANGED
|
@@ -139,13 +139,13 @@ function shouldShowDevConsole(showDevConsole) {
|
|
|
139
139
|
// src/hooks/use-copilot-runtime-client.ts
|
|
140
140
|
var useCopilotRuntimeClient = (options) => {
|
|
141
141
|
const { setBannerError } = useToast();
|
|
142
|
-
const _a = options, { showDevConsole,
|
|
142
|
+
const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
|
|
143
143
|
const lastStructuredErrorRef = (0, import_react2.useRef)(null);
|
|
144
144
|
const traceUIError = (error, originalError) => __async(void 0, null, function* () {
|
|
145
|
-
if (!
|
|
145
|
+
if (!onError || !runtimeOptions.publicApiKey)
|
|
146
146
|
return;
|
|
147
147
|
try {
|
|
148
|
-
const
|
|
148
|
+
const errorEvent = {
|
|
149
149
|
type: "error",
|
|
150
150
|
timestamp: Date.now(),
|
|
151
151
|
context: {
|
|
@@ -163,9 +163,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
163
163
|
},
|
|
164
164
|
error
|
|
165
165
|
};
|
|
166
|
-
yield
|
|
167
|
-
} catch (
|
|
168
|
-
console.error("Error in
|
|
166
|
+
yield onError(errorEvent);
|
|
167
|
+
} catch (error2) {
|
|
168
|
+
console.error("Error in onError handler:", error2);
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
const runtimeClient = (0, import_react2.useMemo)(() => {
|
|
@@ -229,7 +229,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
229
229
|
setBannerError(warningError);
|
|
230
230
|
}
|
|
231
231
|
}));
|
|
232
|
-
}, [runtimeOptions, setBannerError, showDevConsole,
|
|
232
|
+
}, [runtimeOptions, setBannerError, showDevConsole, onError]);
|
|
233
233
|
return runtimeClient;
|
|
234
234
|
};
|
|
235
235
|
function createStructuredError(gqlError) {
|
|
@@ -330,7 +330,7 @@ var emptyCopilotContext = {
|
|
|
330
330
|
langGraphInterruptAction: null,
|
|
331
331
|
setLangGraphInterruptAction: () => null,
|
|
332
332
|
removeLangGraphInterruptAction: () => null,
|
|
333
|
-
|
|
333
|
+
onError: void 0
|
|
334
334
|
};
|
|
335
335
|
var CopilotContext = import_react3.default.createContext(emptyCopilotContext);
|
|
336
336
|
function useCopilotContext() {
|
|
@@ -490,9 +490,9 @@ function useChat(options) {
|
|
|
490
490
|
const runChatCompletionRef = (0, import_react5.useRef)();
|
|
491
491
|
const addErrorToast = useErrorToast();
|
|
492
492
|
const { setBannerError } = useToast();
|
|
493
|
-
const {
|
|
493
|
+
const { onError } = useCopilotContext();
|
|
494
494
|
const traceUIError = (error, originalError) => __async(this, null, function* () {
|
|
495
|
-
if (!
|
|
495
|
+
if (!onError || !(copilotConfig == null ? void 0 : copilotConfig.publicApiKey))
|
|
496
496
|
return;
|
|
497
497
|
try {
|
|
498
498
|
const traceEvent = {
|
|
@@ -513,9 +513,9 @@ function useChat(options) {
|
|
|
513
513
|
},
|
|
514
514
|
error
|
|
515
515
|
};
|
|
516
|
-
yield
|
|
516
|
+
yield onError(traceEvent);
|
|
517
517
|
} catch (traceError) {
|
|
518
|
-
console.error("Error in use-chat
|
|
518
|
+
console.error("Error in use-chat onError handler:", traceError);
|
|
519
519
|
}
|
|
520
520
|
});
|
|
521
521
|
const agentSessionRef = (0, import_react5.useRef)(agentSession);
|