@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
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import "../chunk-KDAZGZ24.mjs";
|
|
2
2
|
import {
|
|
3
3
|
useLangGraphInterrupt
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-QSXY7DMT.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useMakeCopilotDocumentReadable
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-CXDK6XA5.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useCopilotAdditionalInstructions
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-MZ37BAAE.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useCopilotAuthenticatedAction_c
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-4JBVPOHK.mjs";
|
|
14
14
|
import {
|
|
15
15
|
useCopilotAction
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-AR7HJPGU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
useCopilotChatHeadless_c
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-SIMMEOMI.mjs";
|
|
20
20
|
import {
|
|
21
21
|
useCopilotChat as useCopilotChat2
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-FAHEDJFT.mjs";
|
|
23
23
|
import {
|
|
24
24
|
useCopilotReadable
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-36FJAVOF.mjs";
|
|
26
26
|
import {
|
|
27
27
|
useCoAgentStateRender
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-CLQLVMW4.mjs";
|
|
29
29
|
import {
|
|
30
30
|
runAgent,
|
|
31
31
|
startAgent,
|
|
32
32
|
stopAgent,
|
|
33
33
|
useCoAgent
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-G5C5THRU.mjs";
|
|
35
35
|
import {
|
|
36
36
|
useCopilotChat
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-KOQSZFJQ.mjs";
|
|
38
38
|
import {
|
|
39
39
|
useLangGraphInterruptRender
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-QF3Q5LUN.mjs";
|
|
41
41
|
import "../chunk-YPSGKPDA.mjs";
|
|
42
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-FIYI7ZK4.mjs";
|
|
43
43
|
import "../chunk-L3I57GMV.mjs";
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-TUTNHDM3.mjs";
|
|
44
|
+
import "../chunk-G2GQX4FI.mjs";
|
|
45
|
+
import "../chunk-23SOG4FI.mjs";
|
|
47
46
|
import "../chunk-PIF5KJYI.mjs";
|
|
47
|
+
import "../chunk-MY2BUA6F.mjs";
|
|
48
48
|
import "../chunk-2IDV5OHF.mjs";
|
|
49
49
|
import "../chunk-PMAFHQ7P.mjs";
|
|
50
50
|
import "../chunk-5FHSUKQL.mjs";
|
|
51
51
|
import "../chunk-RKTVJRK7.mjs";
|
|
52
52
|
import "../chunk-ZLQVRPDS.mjs";
|
|
53
53
|
import "../chunk-6ZLPNY7X.mjs";
|
|
54
|
-
import "../chunk-
|
|
54
|
+
import "../chunk-667MDI44.mjs";
|
|
55
55
|
import "../chunk-4CEQJ2X6.mjs";
|
|
56
56
|
import "../chunk-N4WEHORG.mjs";
|
|
57
57
|
import "../chunk-O7ARI5CV.mjs";
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
useCopilotRuntimeClient
|
|
60
60
|
} from "../chunk-Q3MCVRO3.mjs";
|
|
61
61
|
import "../chunk-ICIK2BSB.mjs";
|
|
62
|
-
import "../chunk-
|
|
62
|
+
import "../chunk-YHT6CWIY.mjs";
|
|
63
63
|
import "../chunk-EFL5OBKN.mjs";
|
|
64
64
|
import "../chunk-SKC7AJIV.mjs";
|
|
65
65
|
export {
|
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-59740e82.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
|
@@ -184,10 +184,8 @@ var emptyCopilotContext = {
|
|
|
184
184
|
setExtensions: () => {
|
|
185
185
|
},
|
|
186
186
|
langGraphInterruptAction: null,
|
|
187
|
-
setLangGraphInterruptAction: () =>
|
|
188
|
-
|
|
189
|
-
removeLangGraphInterruptAction: () => {
|
|
190
|
-
},
|
|
187
|
+
setLangGraphInterruptAction: () => null,
|
|
188
|
+
removeLangGraphInterruptAction: () => null,
|
|
191
189
|
onError: () => {
|
|
192
190
|
},
|
|
193
191
|
bannerError: null,
|
|
@@ -679,7 +677,7 @@ function useChat(options) {
|
|
|
679
677
|
if (ev.name === import_runtime_client_gql3.MetaEventName.LangGraphInterruptEvent) {
|
|
680
678
|
let eventValue = (0, import_runtime_client_gql3.langGraphInterruptEvent)(ev).value;
|
|
681
679
|
eventValue = (0, import_shared4.parseJson)(eventValue, eventValue);
|
|
682
|
-
setLangGraphInterruptAction(
|
|
680
|
+
setLangGraphInterruptAction({
|
|
683
681
|
event: __spreadProps(__spreadValues({}, (0, import_runtime_client_gql3.langGraphInterruptEvent)(ev)), {
|
|
684
682
|
value: eventValue
|
|
685
683
|
})
|
|
@@ -742,7 +740,7 @@ function useChat(options) {
|
|
|
742
740
|
preservedStructure: !!originalCode
|
|
743
741
|
});
|
|
744
742
|
setIsLoading(false);
|
|
745
|
-
|
|
743
|
+
break;
|
|
746
744
|
} else if (messages2.length > 0) {
|
|
747
745
|
newMessages = [...messages2];
|
|
748
746
|
for (const message of messages2) {
|
|
@@ -863,8 +861,8 @@ function useChat(options) {
|
|
|
863
861
|
}
|
|
864
862
|
const currentResultMessagePairedFeAction = message.isResultMessage() ? getPairedFeAction(actions, message) : null;
|
|
865
863
|
if (action && message.isActionExecutionMessage()) {
|
|
866
|
-
const
|
|
867
|
-
const alreadyProcessed =
|
|
864
|
+
const isRenderAndWaitAction = (action == null ? void 0 : action._isRenderAndWait) || false;
|
|
865
|
+
const alreadyProcessed = isRenderAndWaitAction && finalMessages.some(
|
|
868
866
|
(fm) => fm.isResultMessage() && fm.actionExecutionId === message.id
|
|
869
867
|
);
|
|
870
868
|
if (alreadyProcessed) {
|
|
@@ -873,16 +871,16 @@ function useChat(options) {
|
|
|
873
871
|
action,
|
|
874
872
|
message
|
|
875
873
|
);
|
|
876
|
-
const
|
|
877
|
-
if (
|
|
874
|
+
const pairedFeAction = getPairedFeAction(actions, resultMessage);
|
|
875
|
+
if (pairedFeAction) {
|
|
878
876
|
const newExecutionMessage = new import_runtime_client_gql3.ActionExecutionMessage({
|
|
879
|
-
name:
|
|
877
|
+
name: pairedFeAction.name,
|
|
880
878
|
arguments: (0, import_shared4.parseJson)(resultMessage.result, resultMessage.result),
|
|
881
879
|
status: message.status,
|
|
882
880
|
createdAt: message.createdAt,
|
|
883
881
|
parentMessageId: message.parentMessageId
|
|
884
882
|
});
|
|
885
|
-
yield executeActionFromMessage(
|
|
883
|
+
yield executeActionFromMessage(pairedFeAction, newExecutionMessage);
|
|
886
884
|
}
|
|
887
885
|
}
|
|
888
886
|
} else if (message.isResultMessage() && currentResultMessagePairedFeAction) {
|
|
@@ -977,7 +975,7 @@ function useChat(options) {
|
|
|
977
975
|
switch (event.name) {
|
|
978
976
|
case import_runtime_client_gql3.MetaEventName.LangGraphInterruptEvent:
|
|
979
977
|
if (event.response) {
|
|
980
|
-
setLangGraphInterruptAction(
|
|
978
|
+
setLangGraphInterruptAction(null);
|
|
981
979
|
const value = event.value;
|
|
982
980
|
return [
|
|
983
981
|
...acc,
|
|
@@ -1027,8 +1025,8 @@ function useChat(options) {
|
|
|
1027
1025
|
console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);
|
|
1028
1026
|
return;
|
|
1029
1027
|
}
|
|
1030
|
-
let historyCutoff = [
|
|
1031
|
-
if (messages.length > 2
|
|
1028
|
+
let historyCutoff = [];
|
|
1029
|
+
if (messages.length > 2) {
|
|
1032
1030
|
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).reverse().find(
|
|
1033
1031
|
(msg) => (
|
|
1034
1032
|
// @ts-expect-error -- message has role
|
|
@@ -1039,8 +1037,6 @@ function useChat(options) {
|
|
|
1039
1037
|
(msg) => msg.id === lastUserMessageBeforeRegenerate.id
|
|
1040
1038
|
);
|
|
1041
1039
|
historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);
|
|
1042
|
-
} else if (messages.length > 2 && reloadMessageIndex === 0) {
|
|
1043
|
-
historyCutoff = [messages[0], messages[1]];
|
|
1044
1040
|
}
|
|
1045
1041
|
setMessages(historyCutoff);
|
|
1046
1042
|
return runChatCompletionAndHandleFunctionCall(historyCutoff);
|