@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,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-DSDAZA3B.mjs";
|
|
3
|
+
} from "../chunk-JBACWIFW.mjs";
|
|
4
|
+
import "../chunk-HYJUBYMU.mjs";
|
|
5
|
+
import "../chunk-ZVOLWJCY.mjs";
|
|
6
|
+
import "../chunk-YPSGKPDA.mjs";
|
|
7
|
+
import "../chunk-ITDKIB5E.mjs";
|
|
8
|
+
import "../chunk-L3I57GMV.mjs";
|
|
9
|
+
import "../chunk-M37URBJS.mjs";
|
|
10
|
+
import "../chunk-CUWOXXM5.mjs";
|
|
11
|
+
import "../chunk-TUTNHDM3.mjs";
|
|
13
12
|
import "../chunk-PIF5KJYI.mjs";
|
|
14
13
|
import "../chunk-2IDV5OHF.mjs";
|
|
15
14
|
import "../chunk-PMAFHQ7P.mjs";
|
|
16
15
|
import "../chunk-5FHSUKQL.mjs";
|
|
17
16
|
import "../chunk-RKTVJRK7.mjs";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-ZLQVRPDS.mjs";
|
|
18
|
+
import "../chunk-6ZLPNY7X.mjs";
|
|
19
|
+
import "../chunk-3N4MVKFZ.mjs";
|
|
20
|
+
import "../chunk-4CEQJ2X6.mjs";
|
|
20
21
|
import "../chunk-N4WEHORG.mjs";
|
|
21
22
|
import "../chunk-O7ARI5CV.mjs";
|
|
23
|
+
import "../chunk-Q3MCVRO3.mjs";
|
|
24
|
+
import "../chunk-ICIK2BSB.mjs";
|
|
25
|
+
import "../chunk-EUX2P2E7.mjs";
|
|
22
26
|
import "../chunk-EFL5OBKN.mjs";
|
|
23
|
-
import "../chunk-6ZLPNY7X.mjs";
|
|
24
|
-
import "../chunk-YPSGKPDA.mjs";
|
|
25
|
-
import "../chunk-YHT6CWIY.mjs";
|
|
26
|
-
import "../chunk-ZLQVRPDS.mjs";
|
|
27
27
|
import "../chunk-SKC7AJIV.mjs";
|
|
28
28
|
export {
|
|
29
29
|
useCopilotChat
|
|
@@ -2,9 +2,9 @@ import { SystemMessageFunction } from '../types/system-message.js';
|
|
|
2
2
|
import { Message as Message$1 } from '@copilotkit/runtime-client-gql';
|
|
3
3
|
import { Message } from '@copilotkit/shared';
|
|
4
4
|
import { AppendMessageOptions } from './use-chat.js';
|
|
5
|
-
import { S as SuggestionItem } from '../index-
|
|
5
|
+
import { S as SuggestionItem } from '../index-1f5b66ac.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';
|
|
@@ -157,8 +157,10 @@ var emptyCopilotContext = {
|
|
|
157
157
|
setExtensions: () => {
|
|
158
158
|
},
|
|
159
159
|
langGraphInterruptAction: null,
|
|
160
|
-
setLangGraphInterruptAction: () =>
|
|
161
|
-
|
|
160
|
+
setLangGraphInterruptAction: () => {
|
|
161
|
+
},
|
|
162
|
+
removeLangGraphInterruptAction: () => {
|
|
163
|
+
},
|
|
162
164
|
onError: () => {
|
|
163
165
|
},
|
|
164
166
|
bannerError: null,
|
|
@@ -701,7 +703,7 @@ function useChat(options) {
|
|
|
701
703
|
if (ev.name === import_runtime_client_gql3.MetaEventName.LangGraphInterruptEvent) {
|
|
702
704
|
let eventValue = (0, import_runtime_client_gql3.langGraphInterruptEvent)(ev).value;
|
|
703
705
|
eventValue = (0, import_shared4.parseJson)(eventValue, eventValue);
|
|
704
|
-
setLangGraphInterruptAction({
|
|
706
|
+
setLangGraphInterruptAction(threadId, {
|
|
705
707
|
event: __spreadProps(__spreadValues({}, (0, import_runtime_client_gql3.langGraphInterruptEvent)(ev)), {
|
|
706
708
|
value: eventValue
|
|
707
709
|
})
|
|
@@ -764,7 +766,7 @@ function useChat(options) {
|
|
|
764
766
|
preservedStructure: !!originalCode
|
|
765
767
|
});
|
|
766
768
|
setIsLoading(false);
|
|
767
|
-
|
|
769
|
+
throw new Error(structuredError.message);
|
|
768
770
|
} else if (messages2.length > 0) {
|
|
769
771
|
newMessages = [...messages2];
|
|
770
772
|
for (const message of messages2) {
|
|
@@ -885,8 +887,8 @@ function useChat(options) {
|
|
|
885
887
|
}
|
|
886
888
|
const currentResultMessagePairedFeAction = message.isResultMessage() ? getPairedFeAction(actions, message) : null;
|
|
887
889
|
if (action && message.isActionExecutionMessage()) {
|
|
888
|
-
const
|
|
889
|
-
const alreadyProcessed =
|
|
890
|
+
const pairedFeAction = getPairedFeAction(actions, message);
|
|
891
|
+
const alreadyProcessed = !pairedFeAction && finalMessages.some(
|
|
890
892
|
(fm) => fm.isResultMessage() && fm.actionExecutionId === message.id
|
|
891
893
|
);
|
|
892
894
|
if (alreadyProcessed) {
|
|
@@ -895,16 +897,16 @@ function useChat(options) {
|
|
|
895
897
|
action,
|
|
896
898
|
message
|
|
897
899
|
);
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
900
|
+
const pairedFeAction2 = getPairedFeAction(actions, resultMessage);
|
|
901
|
+
if (pairedFeAction2) {
|
|
900
902
|
const newExecutionMessage = new import_runtime_client_gql3.ActionExecutionMessage({
|
|
901
|
-
name:
|
|
903
|
+
name: pairedFeAction2.name,
|
|
902
904
|
arguments: (0, import_shared4.parseJson)(resultMessage.result, resultMessage.result),
|
|
903
905
|
status: message.status,
|
|
904
906
|
createdAt: message.createdAt,
|
|
905
907
|
parentMessageId: message.parentMessageId
|
|
906
908
|
});
|
|
907
|
-
yield executeActionFromMessage(
|
|
909
|
+
yield executeActionFromMessage(pairedFeAction2, newExecutionMessage);
|
|
908
910
|
}
|
|
909
911
|
}
|
|
910
912
|
} else if (message.isResultMessage() && currentResultMessagePairedFeAction) {
|
|
@@ -999,7 +1001,7 @@ function useChat(options) {
|
|
|
999
1001
|
switch (event.name) {
|
|
1000
1002
|
case import_runtime_client_gql3.MetaEventName.LangGraphInterruptEvent:
|
|
1001
1003
|
if (event.response) {
|
|
1002
|
-
setLangGraphInterruptAction(null);
|
|
1004
|
+
setLangGraphInterruptAction(threadId, null);
|
|
1003
1005
|
const value = event.value;
|
|
1004
1006
|
return [
|
|
1005
1007
|
...acc,
|
|
@@ -1049,8 +1051,8 @@ function useChat(options) {
|
|
|
1049
1051
|
console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);
|
|
1050
1052
|
return;
|
|
1051
1053
|
}
|
|
1052
|
-
let historyCutoff = [];
|
|
1053
|
-
if (messages.length > 2) {
|
|
1054
|
+
let historyCutoff = [messages[0]];
|
|
1055
|
+
if (messages.length > 2 && reloadMessageIndex !== 0) {
|
|
1054
1056
|
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).reverse().find(
|
|
1055
1057
|
(msg) => (
|
|
1056
1058
|
// @ts-expect-error -- message has role
|
|
@@ -1061,6 +1063,8 @@ function useChat(options) {
|
|
|
1061
1063
|
(msg) => msg.id === lastUserMessageBeforeRegenerate.id
|
|
1062
1064
|
);
|
|
1063
1065
|
historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);
|
|
1066
|
+
} else if (messages.length > 2 && reloadMessageIndex === 0) {
|
|
1067
|
+
historyCutoff = [messages[0], messages[1]];
|
|
1064
1068
|
}
|
|
1065
1069
|
setMessages(historyCutoff);
|
|
1066
1070
|
return runChatCompletionAndHandleFunctionCall(historyCutoff);
|
|
@@ -1453,16 +1457,16 @@ var InterruptRenderer = ({ event, result, render, resolve }) => {
|
|
|
1453
1457
|
return render({ event, result, resolve });
|
|
1454
1458
|
};
|
|
1455
1459
|
function useLangGraphInterruptRender() {
|
|
1456
|
-
const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession } = useCopilotContext();
|
|
1460
|
+
const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession, threadId } = useCopilotContext();
|
|
1457
1461
|
const responseRef = import_react8.default.useRef();
|
|
1458
1462
|
const resolveInterrupt = (0, import_react8.useCallback)(
|
|
1459
1463
|
(response) => {
|
|
1460
1464
|
responseRef.current = response;
|
|
1461
1465
|
setTimeout(() => {
|
|
1462
|
-
setLangGraphInterruptAction({ event: { response } });
|
|
1466
|
+
setLangGraphInterruptAction(threadId, { event: { response } });
|
|
1463
1467
|
}, 0);
|
|
1464
1468
|
},
|
|
1465
|
-
[setLangGraphInterruptAction]
|
|
1469
|
+
[setLangGraphInterruptAction, threadId]
|
|
1466
1470
|
);
|
|
1467
1471
|
if (!langGraphInterruptAction || !langGraphInterruptAction.event || !langGraphInterruptAction.render)
|
|
1468
1472
|
return null;
|