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