@copilotkit/react-core 1.10.5-next.1 → 1.10.5-next.10
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 +66 -0
- package/dist/{chunk-WBBJMOZI.mjs → chunk-3N4MVKFZ.mjs} +20 -18
- package/dist/chunk-3N4MVKFZ.mjs.map +1 -0
- package/dist/{chunk-2QZSAQTX.mjs → chunk-3WUDRJTT.mjs} +4 -4
- package/dist/{chunk-O73FZGSU.mjs → chunk-7LTRT3IV.mjs} +8 -8
- package/dist/{chunk-CXDK6XA5.mjs → chunk-BBUQMG45.mjs} +2 -2
- package/dist/{chunk-FRXYSJGZ.mjs → chunk-CUWOXXM5.mjs} +3 -3
- package/dist/{chunk-YHT6CWIY.mjs → chunk-EUX2P2E7.mjs} +5 -3
- package/dist/{chunk-YHT6CWIY.mjs.map → chunk-EUX2P2E7.mjs.map} +1 -1
- package/dist/{chunk-KWS75AOU.mjs → chunk-GIGUZ2OK.mjs} +3 -3
- package/dist/{chunk-36FJAVOF.mjs → chunk-HDOG2RTM.mjs} +2 -2
- package/dist/{chunk-JEMBA7PE.mjs → chunk-HI6SPUOX.mjs} +4 -4
- package/dist/{chunk-OLXYK6PP.mjs → chunk-HYJUBYMU.mjs} +10 -10
- package/dist/{chunk-UPQPBCUW.mjs → chunk-IHV5PTID.mjs} +4 -4
- package/dist/{chunk-ZRDV3MVW.mjs → chunk-ITDKIB5E.mjs} +37 -30
- package/dist/chunk-ITDKIB5E.mjs.map +1 -0
- package/dist/{chunk-XFJNMZ6X.mjs → chunk-JBACWIFW.mjs} +2 -2
- package/dist/{chunk-RLT4KZR4.mjs → chunk-JCHRWCYH.mjs} +3 -3
- package/dist/{chunk-N4VN2B5S.mjs → chunk-L3I57GMV.mjs} +4 -4
- package/dist/{chunk-WRPXFDFL.mjs → chunk-L5MS4UDD.mjs} +13 -7
- package/dist/chunk-L5MS4UDD.mjs.map +1 -0
- package/dist/{chunk-2MGJO3FY.mjs → chunk-M37URBJS.mjs} +7 -7
- package/dist/{chunk-MZ37BAAE.mjs → chunk-MGWRDFBE.mjs} +2 -2
- package/dist/{chunk-DSDAZA3B.mjs → chunk-TUTNHDM3.mjs} +4 -4
- package/dist/{chunk-QF3Q5LUN.mjs → chunk-ZVOLWJCY.mjs} +5 -5
- package/dist/chunk-ZVOLWJCY.mjs.map +1 -0
- package/dist/components/copilot-provider/copilot-messages.js +4 -2
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
- package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.js +30 -21
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +10 -10
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +30 -21
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +10 -10
- package/dist/components/dev-console/console-trigger.js +4 -2
- package/dist/components/dev-console/console-trigger.js.map +1 -1
- package/dist/components/dev-console/console-trigger.mjs +3 -3
- package/dist/components/dev-console/developer-console-modal.js +4 -2
- package/dist/components/dev-console/developer-console-modal.js.map +1 -1
- package/dist/components/dev-console/developer-console-modal.mjs +2 -2
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +30 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -10
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +4 -2
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/copilot-messages-context.d.ts +2 -2
- package/dist/context/index.d.ts +2 -2
- package/dist/context/index.js +4 -2
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +4 -4
- package/dist/{copilot-context-59740e82.d.ts → copilot-context-cf9de848.d.ts} +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +28 -18
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +34 -34
- package/dist/hooks/use-chat.d.ts +1 -1
- package/dist/hooks/use-chat.js +17 -13
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +4 -4
- package/dist/hooks/use-coagent-state-render.js +4 -2
- 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 +20 -16
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +16 -16
- package/dist/hooks/use-copilot-action.js +4 -2
- 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 +4 -2
- 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 +4 -2
- 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-headless_c.d.ts +2 -2
- package/dist/hooks/use-copilot-chat-headless_c.js +20 -16
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +16 -16
- package/dist/hooks/use-copilot-chat.d.ts +2 -2
- package/dist/hooks/use-copilot-chat.js +20 -16
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +16 -16
- package/dist/hooks/use-copilot-chat_internal.d.ts +2 -2
- package/dist/hooks/use-copilot-chat_internal.js +20 -16
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +15 -15
- package/dist/hooks/use-copilot-readable.js +4 -2
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt-render.js +7 -5
- 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 +28 -18
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +16 -16
- package/dist/hooks/use-make-copilot-document-readable.js +4 -2
- 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-d1743abe.d.ts → index-1f5b66ac.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +54 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -39
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +12 -12
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +12 -12
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/types/interrupt-action.js.map +1 -1
- package/dist/utils/extract.d.ts +2 -2
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +10 -10
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +10 -10
- package/dist/utils/suggestions.d.ts +2 -2
- package/dist/utils/suggestions.js.map +1 -1
- package/dist/utils/suggestions.mjs +10 -10
- package/package.json +3 -3
- package/src/components/copilot-provider/copilotkit.tsx +27 -17
- package/src/context/copilot-context.tsx +3 -3
- package/src/hooks/use-chat.ts +9 -7
- package/src/hooks/use-langgraph-interrupt-render.ts +4 -3
- package/src/hooks/use-langgraph-interrupt.ts +8 -3
- package/src/types/interrupt-action.ts +4 -1
- package/dist/chunk-QF3Q5LUN.mjs.map +0 -1
- package/dist/chunk-WBBJMOZI.mjs.map +0 -1
- package/dist/chunk-WRPXFDFL.mjs.map +0 -1
- package/dist/chunk-ZRDV3MVW.mjs.map +0 -1
- /package/dist/{chunk-2QZSAQTX.mjs.map → chunk-3WUDRJTT.mjs.map} +0 -0
- /package/dist/{chunk-O73FZGSU.mjs.map → chunk-7LTRT3IV.mjs.map} +0 -0
- /package/dist/{chunk-CXDK6XA5.mjs.map → chunk-BBUQMG45.mjs.map} +0 -0
- /package/dist/{chunk-FRXYSJGZ.mjs.map → chunk-CUWOXXM5.mjs.map} +0 -0
- /package/dist/{chunk-KWS75AOU.mjs.map → chunk-GIGUZ2OK.mjs.map} +0 -0
- /package/dist/{chunk-36FJAVOF.mjs.map → chunk-HDOG2RTM.mjs.map} +0 -0
- /package/dist/{chunk-JEMBA7PE.mjs.map → chunk-HI6SPUOX.mjs.map} +0 -0
- /package/dist/{chunk-OLXYK6PP.mjs.map → chunk-HYJUBYMU.mjs.map} +0 -0
- /package/dist/{chunk-UPQPBCUW.mjs.map → chunk-IHV5PTID.mjs.map} +0 -0
- /package/dist/{chunk-XFJNMZ6X.mjs.map → chunk-JBACWIFW.mjs.map} +0 -0
- /package/dist/{chunk-RLT4KZR4.mjs.map → chunk-JCHRWCYH.mjs.map} +0 -0
- /package/dist/{chunk-N4VN2B5S.mjs.map → chunk-L3I57GMV.mjs.map} +0 -0
- /package/dist/{chunk-2MGJO3FY.mjs.map → chunk-M37URBJS.mjs.map} +0 -0
- /package/dist/{chunk-MZ37BAAE.mjs.map → chunk-MGWRDFBE.mjs.map} +0 -0
- /package/dist/{chunk-DSDAZA3B.mjs.map → chunk-TUTNHDM3.mjs.map} +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChatHeadless_c
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-JCHRWCYH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultSystemMessage
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-DSDAZA3B.mjs";
|
|
6
|
+
} from "../chunk-HYJUBYMU.mjs";
|
|
7
|
+
import "../chunk-ZVOLWJCY.mjs";
|
|
8
|
+
import "../chunk-YPSGKPDA.mjs";
|
|
9
|
+
import "../chunk-ITDKIB5E.mjs";
|
|
10
|
+
import "../chunk-L3I57GMV.mjs";
|
|
11
|
+
import "../chunk-M37URBJS.mjs";
|
|
12
|
+
import "../chunk-CUWOXXM5.mjs";
|
|
13
|
+
import "../chunk-TUTNHDM3.mjs";
|
|
15
14
|
import "../chunk-PIF5KJYI.mjs";
|
|
16
15
|
import "../chunk-2IDV5OHF.mjs";
|
|
17
16
|
import "../chunk-PMAFHQ7P.mjs";
|
|
18
17
|
import "../chunk-5FHSUKQL.mjs";
|
|
19
18
|
import "../chunk-RKTVJRK7.mjs";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-ZLQVRPDS.mjs";
|
|
20
|
+
import "../chunk-6ZLPNY7X.mjs";
|
|
21
|
+
import "../chunk-3N4MVKFZ.mjs";
|
|
22
|
+
import "../chunk-4CEQJ2X6.mjs";
|
|
22
23
|
import "../chunk-N4WEHORG.mjs";
|
|
23
24
|
import "../chunk-O7ARI5CV.mjs";
|
|
25
|
+
import "../chunk-Q3MCVRO3.mjs";
|
|
26
|
+
import "../chunk-ICIK2BSB.mjs";
|
|
27
|
+
import "../chunk-EUX2P2E7.mjs";
|
|
24
28
|
import "../chunk-EFL5OBKN.mjs";
|
|
25
|
-
import "../chunk-6ZLPNY7X.mjs";
|
|
26
|
-
import "../chunk-YPSGKPDA.mjs";
|
|
27
|
-
import "../chunk-YHT6CWIY.mjs";
|
|
28
|
-
import "../chunk-ZLQVRPDS.mjs";
|
|
29
29
|
import "../chunk-SKC7AJIV.mjs";
|
|
30
30
|
export {
|
|
31
31
|
defaultSystemMessage,
|
|
@@ -4,14 +4,14 @@ import '@copilotkit/runtime-client-gql';
|
|
|
4
4
|
import '@copilotkit/shared';
|
|
5
5
|
import './use-chat.js';
|
|
6
6
|
import 'react';
|
|
7
|
-
import '../copilot-context-
|
|
7
|
+
import '../copilot-context-cf9de848.js';
|
|
8
8
|
import '../types/frontend-action.js';
|
|
9
9
|
import './use-tree.js';
|
|
10
10
|
import '../types/document-pointer.js';
|
|
11
11
|
import '../types/chat-suggestion-configuration.js';
|
|
12
12
|
import '../types/coagent-action.js';
|
|
13
13
|
import '../types/coagent-state.js';
|
|
14
|
-
import '../index-
|
|
14
|
+
import '../index-1f5b66ac.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `useCopilotChat` is a lightweight React hook for headless chat interactions.
|
|
@@ -158,8 +158,10 @@ var emptyCopilotContext = {
|
|
|
158
158
|
setExtensions: () => {
|
|
159
159
|
},
|
|
160
160
|
langGraphInterruptAction: null,
|
|
161
|
-
setLangGraphInterruptAction: () =>
|
|
162
|
-
|
|
161
|
+
setLangGraphInterruptAction: () => {
|
|
162
|
+
},
|
|
163
|
+
removeLangGraphInterruptAction: () => {
|
|
164
|
+
},
|
|
163
165
|
onError: () => {
|
|
164
166
|
},
|
|
165
167
|
bannerError: null,
|
|
@@ -702,7 +704,7 @@ function useChat(options) {
|
|
|
702
704
|
if (ev.name === import_runtime_client_gql3.MetaEventName.LangGraphInterruptEvent) {
|
|
703
705
|
let eventValue = (0, import_runtime_client_gql3.langGraphInterruptEvent)(ev).value;
|
|
704
706
|
eventValue = (0, import_shared4.parseJson)(eventValue, eventValue);
|
|
705
|
-
setLangGraphInterruptAction({
|
|
707
|
+
setLangGraphInterruptAction(threadId, {
|
|
706
708
|
event: __spreadProps(__spreadValues({}, (0, import_runtime_client_gql3.langGraphInterruptEvent)(ev)), {
|
|
707
709
|
value: eventValue
|
|
708
710
|
})
|
|
@@ -765,7 +767,7 @@ function useChat(options) {
|
|
|
765
767
|
preservedStructure: !!originalCode
|
|
766
768
|
});
|
|
767
769
|
setIsLoading(false);
|
|
768
|
-
|
|
770
|
+
throw new Error(structuredError.message);
|
|
769
771
|
} else if (messages2.length > 0) {
|
|
770
772
|
newMessages = [...messages2];
|
|
771
773
|
for (const message of messages2) {
|
|
@@ -886,8 +888,8 @@ function useChat(options) {
|
|
|
886
888
|
}
|
|
887
889
|
const currentResultMessagePairedFeAction = message.isResultMessage() ? getPairedFeAction(actions, message) : null;
|
|
888
890
|
if (action && message.isActionExecutionMessage()) {
|
|
889
|
-
const
|
|
890
|
-
const alreadyProcessed =
|
|
891
|
+
const pairedFeAction = getPairedFeAction(actions, message);
|
|
892
|
+
const alreadyProcessed = !pairedFeAction && finalMessages.some(
|
|
891
893
|
(fm) => fm.isResultMessage() && fm.actionExecutionId === message.id
|
|
892
894
|
);
|
|
893
895
|
if (alreadyProcessed) {
|
|
@@ -896,16 +898,16 @@ function useChat(options) {
|
|
|
896
898
|
action,
|
|
897
899
|
message
|
|
898
900
|
);
|
|
899
|
-
const
|
|
900
|
-
if (
|
|
901
|
+
const pairedFeAction2 = getPairedFeAction(actions, resultMessage);
|
|
902
|
+
if (pairedFeAction2) {
|
|
901
903
|
const newExecutionMessage = new import_runtime_client_gql3.ActionExecutionMessage({
|
|
902
|
-
name:
|
|
904
|
+
name: pairedFeAction2.name,
|
|
903
905
|
arguments: (0, import_shared4.parseJson)(resultMessage.result, resultMessage.result),
|
|
904
906
|
status: message.status,
|
|
905
907
|
createdAt: message.createdAt,
|
|
906
908
|
parentMessageId: message.parentMessageId
|
|
907
909
|
});
|
|
908
|
-
yield executeActionFromMessage(
|
|
910
|
+
yield executeActionFromMessage(pairedFeAction2, newExecutionMessage);
|
|
909
911
|
}
|
|
910
912
|
}
|
|
911
913
|
} else if (message.isResultMessage() && currentResultMessagePairedFeAction) {
|
|
@@ -1000,7 +1002,7 @@ function useChat(options) {
|
|
|
1000
1002
|
switch (event.name) {
|
|
1001
1003
|
case import_runtime_client_gql3.MetaEventName.LangGraphInterruptEvent:
|
|
1002
1004
|
if (event.response) {
|
|
1003
|
-
setLangGraphInterruptAction(null);
|
|
1005
|
+
setLangGraphInterruptAction(threadId, null);
|
|
1004
1006
|
const value = event.value;
|
|
1005
1007
|
return [
|
|
1006
1008
|
...acc,
|
|
@@ -1050,8 +1052,8 @@ function useChat(options) {
|
|
|
1050
1052
|
console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);
|
|
1051
1053
|
return;
|
|
1052
1054
|
}
|
|
1053
|
-
let historyCutoff = [];
|
|
1054
|
-
if (messages.length > 2) {
|
|
1055
|
+
let historyCutoff = [messages[0]];
|
|
1056
|
+
if (messages.length > 2 && reloadMessageIndex !== 0) {
|
|
1055
1057
|
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).reverse().find(
|
|
1056
1058
|
(msg) => (
|
|
1057
1059
|
// @ts-expect-error -- message has role
|
|
@@ -1062,6 +1064,8 @@ function useChat(options) {
|
|
|
1062
1064
|
(msg) => msg.id === lastUserMessageBeforeRegenerate.id
|
|
1063
1065
|
);
|
|
1064
1066
|
historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);
|
|
1067
|
+
} else if (messages.length > 2 && reloadMessageIndex === 0) {
|
|
1068
|
+
historyCutoff = [messages[0], messages[1]];
|
|
1065
1069
|
}
|
|
1066
1070
|
setMessages(historyCutoff);
|
|
1067
1071
|
return runChatCompletionAndHandleFunctionCall(historyCutoff);
|
|
@@ -1454,16 +1458,16 @@ var InterruptRenderer = ({ event, result, render, resolve }) => {
|
|
|
1454
1458
|
return render({ event, result, resolve });
|
|
1455
1459
|
};
|
|
1456
1460
|
function useLangGraphInterruptRender() {
|
|
1457
|
-
const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession } = useCopilotContext();
|
|
1461
|
+
const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession, threadId } = useCopilotContext();
|
|
1458
1462
|
const responseRef = import_react8.default.useRef();
|
|
1459
1463
|
const resolveInterrupt = (0, import_react8.useCallback)(
|
|
1460
1464
|
(response) => {
|
|
1461
1465
|
responseRef.current = response;
|
|
1462
1466
|
setTimeout(() => {
|
|
1463
|
-
setLangGraphInterruptAction({ event: { response } });
|
|
1467
|
+
setLangGraphInterruptAction(threadId, { event: { response } });
|
|
1464
1468
|
}, 0);
|
|
1465
1469
|
},
|
|
1466
|
-
[setLangGraphInterruptAction]
|
|
1470
|
+
[setLangGraphInterruptAction, threadId]
|
|
1467
1471
|
);
|
|
1468
1472
|
if (!langGraphInterruptAction || !langGraphInterruptAction.event || !langGraphInterruptAction.render)
|
|
1469
1473
|
return null;
|