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