@copilotkit/react-core 1.10.0-next.9 → 1.10.0
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 +104 -0
- package/dist/{chunk-VH45SC6Z.mjs → chunk-2GRWTU7W.mjs} +2 -2
- package/dist/chunk-3BASANUO.mjs +170 -0
- package/dist/chunk-3BASANUO.mjs.map +1 -0
- package/dist/{chunk-PHIMGB3K.mjs → chunk-5P46WS5M.mjs} +25 -19
- package/dist/chunk-5P46WS5M.mjs.map +1 -0
- package/dist/{chunk-AWFAFFO5.mjs → chunk-6ZLPNY7X.mjs} +7 -3
- package/dist/chunk-6ZLPNY7X.mjs.map +1 -0
- package/dist/{chunk-TTI4Z6GK.mjs → chunk-BEFEBKKI.mjs} +7 -7
- package/dist/chunk-BEFEBKKI.mjs.map +1 -0
- package/dist/{chunk-VSH4JSN3.mjs → chunk-F26O2HTO.mjs} +13 -7
- package/dist/chunk-F26O2HTO.mjs.map +1 -0
- package/dist/{chunk-GRCHDHC4.mjs → chunk-JY3STRON.mjs} +22 -4
- package/dist/chunk-JY3STRON.mjs.map +1 -0
- package/dist/{chunk-ZTZJIDRJ.mjs → chunk-N4VN2B5S.mjs} +2 -2
- package/dist/{chunk-FTP6FDYS.mjs → chunk-NTH42BY5.mjs} +2 -2
- package/dist/chunk-PIF5KJYI.mjs +103 -0
- package/dist/chunk-PIF5KJYI.mjs.map +1 -0
- package/dist/chunk-WSXTUD36.mjs +759 -0
- package/dist/chunk-WSXTUD36.mjs.map +1 -0
- package/dist/chunk-YIBUNEBN.mjs +34 -0
- package/dist/chunk-YIBUNEBN.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit-props.d.ts +9 -1
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +1052 -72
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +6 -3
- package/dist/components/copilot-provider/index.js +1052 -72
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +6 -3
- package/dist/components/dev-console/console-trigger.d.ts +8 -0
- package/dist/components/dev-console/console-trigger.js +1131 -0
- package/dist/components/dev-console/console-trigger.js.map +1 -0
- package/dist/components/dev-console/console-trigger.mjs +13 -0
- package/dist/components/dev-console/developer-console-modal.d.ts +10 -0
- package/dist/components/dev-console/developer-console-modal.js +977 -0
- package/dist/components/dev-console/developer-console-modal.js.map +1 -0
- package/dist/components/dev-console/developer-console-modal.mjs +12 -0
- package/dist/components/dev-console/developer-console-modal.mjs.map +1 -0
- package/dist/components/dev-console/icons.d.ts +9 -0
- package/dist/components/dev-console/icons.js +131 -0
- package/dist/components/dev-console/icons.js.map +1 -0
- package/dist/components/dev-console/icons.mjs +16 -0
- package/dist/components/dev-console/icons.mjs.map +1 -0
- package/dist/components/error-boundary/error-boundary.js +6 -2
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.js +1052 -72
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +6 -3
- package/dist/components/usage-banner.d.ts +2 -1
- package/dist/components/usage-banner.js +6 -2
- package/dist/components/usage-banner.js.map +1 -1
- package/dist/components/usage-banner.mjs +1 -1
- package/dist/hooks/index.d.ts +5 -5
- package/dist/hooks/index.js +58 -26
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +13 -10
- package/dist/hooks/use-coagent.d.ts +1 -1
- package/dist/hooks/use-coagent.js +18 -6
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +8 -5
- package/dist/hooks/use-copilot-chat-headless_c.d.ts +33 -0
- package/dist/hooks/{use-copilot-chat-light.js → use-copilot-chat-headless_c.js} +88 -19
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -0
- package/dist/hooks/{use-copilot-chat-light.mjs → use-copilot-chat-headless_c.mjs} +14 -8
- package/dist/hooks/use-copilot-chat-headless_c.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat.d.ts +85 -4
- package/dist/hooks/use-copilot-chat.js +38 -61
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +8 -8
- package/dist/hooks/use-copilot-chat_internal.d.ts +98 -12
- package/dist/hooks/use-copilot-chat_internal.js +13 -1
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +7 -4
- package/dist/hooks/use-langgraph-interrupt.js +13 -1
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +8 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1203 -200
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -11
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +7 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -4
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +6 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +6 -3
- package/dist/utils/suggestions.js.map +1 -1
- package/dist/utils/suggestions.mjs +6 -3
- package/package.json +3 -3
- package/src/components/copilot-provider/copilotkit-props.tsx +10 -1
- package/src/components/copilot-provider/copilotkit.tsx +25 -16
- package/src/components/dev-console/console-trigger.tsx +190 -0
- package/src/components/dev-console/developer-console-modal.tsx +866 -0
- package/src/components/dev-console/icons.tsx +101 -0
- package/src/components/usage-banner.tsx +8 -3
- package/src/hooks/index.ts +6 -7
- package/src/hooks/use-coagent.ts +6 -11
- package/src/hooks/use-copilot-chat-headless_c.ts +257 -0
- package/src/hooks/use-copilot-chat.ts +103 -154
- package/src/hooks/use-copilot-chat_internal.ts +122 -15
- package/dist/chunk-AWFAFFO5.mjs.map +0 -1
- package/dist/chunk-GRCHDHC4.mjs.map +0 -1
- package/dist/chunk-MWHILKQH.mjs +0 -18
- package/dist/chunk-MWHILKQH.mjs.map +0 -1
- package/dist/chunk-PHIMGB3K.mjs.map +0 -1
- package/dist/chunk-TTI4Z6GK.mjs.map +0 -1
- package/dist/chunk-VSH4JSN3.mjs.map +0 -1
- package/dist/hooks/use-copilot-chat-light.d.ts +0 -211
- package/dist/hooks/use-copilot-chat-light.js.map +0 -1
- package/src/hooks/use-copilot-chat-light.ts +0 -219
- /package/dist/{chunk-VH45SC6Z.mjs.map → chunk-2GRWTU7W.mjs.map} +0 -0
- /package/dist/{chunk-ZTZJIDRJ.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
- /package/dist/{chunk-FTP6FDYS.mjs.map → chunk-NTH42BY5.mjs.map} +0 -0
- /package/dist/{hooks/use-copilot-chat-light.mjs.map → components/dev-console/console-trigger.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "../chunk-6EKLRL7B.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useLangGraphInterrupt
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-NTH42BY5.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useMakeCopilotDocumentReadable
|
|
10
10
|
} from "../chunk-CLMDRYEN.mjs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
startAgent,
|
|
17
17
|
stopAgent,
|
|
18
18
|
useCoAgent
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-BEFEBKKI.mjs";
|
|
20
20
|
import {
|
|
21
21
|
useCopilotAdditionalInstructions
|
|
22
22
|
} from "../chunk-3RHHNUVV.mjs";
|
|
@@ -27,22 +27,25 @@ import {
|
|
|
27
27
|
useCopilotAction
|
|
28
28
|
} from "../chunk-OPRDTF4S.mjs";
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
} from "../chunk-
|
|
30
|
+
useCopilotChatHeadless_c
|
|
31
|
+
} from "../chunk-F26O2HTO.mjs";
|
|
32
32
|
import {
|
|
33
33
|
useCopilotChat as useCopilotChat2
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-YIBUNEBN.mjs";
|
|
35
35
|
import {
|
|
36
36
|
useCopilotChat
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-JY3STRON.mjs";
|
|
38
38
|
import {
|
|
39
39
|
useLangGraphInterruptRender
|
|
40
40
|
} from "../chunk-IN7GE4NO.mjs";
|
|
41
41
|
import "../chunk-KH27ZS4Y.mjs";
|
|
42
42
|
import "../chunk-4CEQJ2X6.mjs";
|
|
43
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-5P46WS5M.mjs";
|
|
44
|
+
import "../chunk-N4VN2B5S.mjs";
|
|
44
45
|
import "../chunk-MUDXTKXE.mjs";
|
|
45
|
-
import "../chunk-
|
|
46
|
+
import "../chunk-3BASANUO.mjs";
|
|
47
|
+
import "../chunk-WSXTUD36.mjs";
|
|
48
|
+
import "../chunk-PIF5KJYI.mjs";
|
|
46
49
|
import "../chunk-2IDV5OHF.mjs";
|
|
47
50
|
import "../chunk-PMAFHQ7P.mjs";
|
|
48
51
|
import "../chunk-5FHSUKQL.mjs";
|
|
@@ -54,7 +57,7 @@ import "../chunk-ICIK2BSB.mjs";
|
|
|
54
57
|
import "../chunk-N4WEHORG.mjs";
|
|
55
58
|
import "../chunk-O7ARI5CV.mjs";
|
|
56
59
|
import "../chunk-EFL5OBKN.mjs";
|
|
57
|
-
import "../chunk-
|
|
60
|
+
import "../chunk-6ZLPNY7X.mjs";
|
|
58
61
|
import "../chunk-YPSGKPDA.mjs";
|
|
59
62
|
import "../chunk-TEMLWRRT.mjs";
|
|
60
63
|
import "../chunk-ZLQVRPDS.mjs";
|
|
@@ -69,8 +72,8 @@ export {
|
|
|
69
72
|
useCopilotAdditionalInstructions,
|
|
70
73
|
useCopilotAuthenticatedAction_c,
|
|
71
74
|
useCopilotChat2 as useCopilotChat,
|
|
75
|
+
useCopilotChatHeadless_c,
|
|
72
76
|
useCopilotChat as useCopilotChatInternal,
|
|
73
|
-
useCopilotChatLight,
|
|
74
77
|
useCopilotReadable,
|
|
75
78
|
useCopilotRuntimeClient,
|
|
76
79
|
useLangGraphInterrupt,
|
|
@@ -199,6 +199,6 @@ type HintFunction = (params: HintFunctionParams) => Message | undefined;
|
|
|
199
199
|
declare function useCoAgent<T = any>(options: UseCoagentOptions<T>): UseCoagentReturnType<T>;
|
|
200
200
|
declare function startAgent(name: string, context: CopilotContextParams): void;
|
|
201
201
|
declare function stopAgent(name: string, context: CopilotContextParams): void;
|
|
202
|
-
declare function runAgent(name: string, context: CopilotContextParams, messages: Message$1[],
|
|
202
|
+
declare function runAgent(name: string, context: CopilotContextParams, messages: Message$1[], sendMessage: (message: Message) => Promise<void>, runChatCompletion: () => Promise<Message[]>, hint?: HintFunction): Promise<void>;
|
|
203
203
|
|
|
204
204
|
export { HintFunction, HintFunctionParams, UseCoagentReturnType, runAgent, startAgent, stopAgent, useCoAgent };
|
|
@@ -1653,6 +1653,13 @@ function useCopilotChat(options = {}) {
|
|
|
1653
1653
|
}));
|
|
1654
1654
|
const latestAppend = useUpdatedRef(append);
|
|
1655
1655
|
const latestAppendFunc = useAsyncCallback(
|
|
1656
|
+
(message, options2) => __async(this, null, function* () {
|
|
1657
|
+
abortSuggestions(options2 == null ? void 0 : options2.clearSuggestions);
|
|
1658
|
+
return yield latestAppend.current(message, options2);
|
|
1659
|
+
}),
|
|
1660
|
+
[latestAppend]
|
|
1661
|
+
);
|
|
1662
|
+
const latestSendMessageFunc = useAsyncCallback(
|
|
1656
1663
|
(message, options2) => __async(this, null, function* () {
|
|
1657
1664
|
abortSuggestions(options2 == null ? void 0 : options2.clearSuggestions);
|
|
1658
1665
|
return yield latestAppend.current((0, import_runtime_client_gql8.aguiToGQL)([message])[0], options2);
|
|
@@ -1680,6 +1687,9 @@ function useCopilotChat(options = {}) {
|
|
|
1680
1687
|
const latestSetMessages = useUpdatedRef(setMessages);
|
|
1681
1688
|
const latestSetMessagesFunc = (0, import_react10.useCallback)(
|
|
1682
1689
|
(messages2) => {
|
|
1690
|
+
if (messages2.every((message) => message instanceof import_runtime_client_gql8.Message)) {
|
|
1691
|
+
return latestSetMessages.current(messages2);
|
|
1692
|
+
}
|
|
1683
1693
|
return latestSetMessages.current((0, import_runtime_client_gql8.aguiToGQL)(messages2));
|
|
1684
1694
|
},
|
|
1685
1695
|
[latestSetMessages]
|
|
@@ -1716,7 +1726,9 @@ function useCopilotChat(options = {}) {
|
|
|
1716
1726
|
}, [latestReset]);
|
|
1717
1727
|
const interrupt = useLangGraphInterruptRender();
|
|
1718
1728
|
return {
|
|
1719
|
-
visibleMessages:
|
|
1729
|
+
visibleMessages: messages,
|
|
1730
|
+
messages: (0, import_runtime_client_gql8.gqlToAGUI)(messages, actions, coAgentStateRenders),
|
|
1731
|
+
sendMessage: latestSendMessageFunc,
|
|
1720
1732
|
appendMessage: latestAppendFunc,
|
|
1721
1733
|
setMessages: latestSetMessagesFunc,
|
|
1722
1734
|
reloadMessages: latestReloadFunc,
|
|
@@ -1791,7 +1803,7 @@ function useCoAgent(options) {
|
|
|
1791
1803
|
}, [availableAgents]);
|
|
1792
1804
|
const { getMessagesFromTap } = useMessagesTap();
|
|
1793
1805
|
const { coagentStates, coagentStatesRef, setCoagentStatesWithRef, threadId, copilotApiConfig } = context;
|
|
1794
|
-
const {
|
|
1806
|
+
const { sendMessage, runChatCompletion } = useCopilotChat();
|
|
1795
1807
|
const headers = __spreadValues({}, copilotApiConfig.headers || {});
|
|
1796
1808
|
const runtimeClient = useCopilotRuntimeClient({
|
|
1797
1809
|
url: copilotApiConfig.chatApiEndpoint,
|
|
@@ -1875,9 +1887,9 @@ function useCoAgent(options) {
|
|
|
1875
1887
|
}, [JSON.stringify(options.config), JSON.stringify(options.configurable)]);
|
|
1876
1888
|
const runAgentCallback = useAsyncCallback(
|
|
1877
1889
|
(hint) => __async(this, null, function* () {
|
|
1878
|
-
yield runAgent(name, context, getMessagesFromTap(),
|
|
1890
|
+
yield runAgent(name, context, getMessagesFromTap(), sendMessage, runChatCompletion, hint);
|
|
1879
1891
|
}),
|
|
1880
|
-
[name, context,
|
|
1892
|
+
[name, context, sendMessage, runChatCompletion]
|
|
1881
1893
|
);
|
|
1882
1894
|
return (0, import_react11.useMemo)(() => {
|
|
1883
1895
|
const coagentState = getCoagentState({ coagentStates, name, options });
|
|
@@ -1919,7 +1931,7 @@ function stopAgent(name, context) {
|
|
|
1919
1931
|
console.warn(`No agent session found for ${name}`);
|
|
1920
1932
|
}
|
|
1921
1933
|
}
|
|
1922
|
-
function runAgent(name, context, messages,
|
|
1934
|
+
function runAgent(name, context, messages, sendMessage, runChatCompletion, hint) {
|
|
1923
1935
|
return __async(this, null, function* () {
|
|
1924
1936
|
var _a, _b;
|
|
1925
1937
|
const { agentSession, setAgentSession } = context;
|
|
@@ -1939,7 +1951,7 @@ function runAgent(name, context, messages, appendMessage, runChatCompletion, hin
|
|
|
1939
1951
|
if (hint) {
|
|
1940
1952
|
const hintMessage = hint({ previousState, currentState: state });
|
|
1941
1953
|
if (hintMessage) {
|
|
1942
|
-
yield
|
|
1954
|
+
yield sendMessage(hintMessage);
|
|
1943
1955
|
} else {
|
|
1944
1956
|
yield runChatCompletion();
|
|
1945
1957
|
}
|