@copilotkit/react-core 1.10.4 → 1.10.5-next.1
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 +16 -0
- package/dist/{chunk-AALETENN.mjs → chunk-FRXYSJGZ.mjs} +64 -3
- package/dist/chunk-FRXYSJGZ.mjs.map +1 -0
- package/dist/{chunk-QNJNOZH3.mjs → chunk-O73FZGSU.mjs} +2 -2
- package/dist/{chunk-CLAHAV6J.mjs → chunk-OLXYK6PP.mjs} +3 -3
- package/dist/{chunk-ID5JRMGN.mjs → chunk-RLT4KZR4.mjs} +2 -2
- package/dist/{chunk-5KVEE73R.mjs → chunk-UPQPBCUW.mjs} +2 -2
- package/dist/{chunk-LLLCUHOO.mjs → chunk-WBBJMOZI.mjs} +18 -6
- package/dist/chunk-WBBJMOZI.mjs.map +1 -0
- package/dist/{chunk-EBSAU46C.mjs → chunk-WRPXFDFL.mjs} +2 -2
- package/dist/{chunk-HWM2Z3J3.mjs → chunk-XFJNMZ6X.mjs} +2 -2
- package/dist/{chunk-6WTWBXEJ.mjs → chunk-ZRDV3MVW.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit.js +63 -2
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +2 -2
- package/dist/components/copilot-provider/index.js +63 -2
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +2 -2
- package/dist/components/dev-console/console-trigger.js +63 -2
- package/dist/components/dev-console/console-trigger.js.map +1 -1
- package/dist/components/dev-console/console-trigger.mjs +1 -1
- package/dist/components/index.js +63 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.js +16 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +8 -8
- package/dist/hooks/use-chat.js +16 -4
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +1 -1
- package/dist/hooks/use-coagent.js +16 -4
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +5 -5
- package/dist/hooks/use-copilot-chat-headless_c.js +16 -4
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +5 -5
- package/dist/hooks/use-copilot-chat.js +16 -4
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +5 -5
- package/dist/hooks/use-copilot-chat_internal.js +16 -4
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +4 -4
- package/dist/hooks/use-langgraph-interrupt.js +16 -4
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +5 -5
- package/dist/index.js +79 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/lib/copilot-task.mjs +3 -3
- package/dist/lib/index.mjs +3 -3
- package/dist/utils/extract.mjs +2 -2
- package/dist/utils/index.mjs +2 -2
- package/dist/utils/suggestions.mjs +2 -2
- package/package.json +3 -3
- package/src/components/dev-console/console-trigger.tsx +66 -2
- package/src/hooks/use-chat.ts +18 -4
- package/dist/chunk-AALETENN.mjs.map +0 -1
- package/dist/chunk-LLLCUHOO.mjs.map +0 -1
- /package/dist/{chunk-QNJNOZH3.mjs.map → chunk-O73FZGSU.mjs.map} +0 -0
- /package/dist/{chunk-CLAHAV6J.mjs.map → chunk-OLXYK6PP.mjs.map} +0 -0
- /package/dist/{chunk-ID5JRMGN.mjs.map → chunk-RLT4KZR4.mjs.map} +0 -0
- /package/dist/{chunk-5KVEE73R.mjs.map → chunk-UPQPBCUW.mjs.map} +0 -0
- /package/dist/{chunk-EBSAU46C.mjs.map → chunk-WRPXFDFL.mjs.map} +0 -0
- /package/dist/{chunk-HWM2Z3J3.mjs.map → chunk-XFJNMZ6X.mjs.map} +0 -0
- /package/dist/{chunk-6WTWBXEJ.mjs.map → chunk-ZRDV3MVW.mjs.map} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChatHeadless_c
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-RLT4KZR4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultSystemMessage
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-OLXYK6PP.mjs";
|
|
7
7
|
import "../chunk-QF3Q5LUN.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-WBBJMOZI.mjs";
|
|
9
9
|
import "../chunk-4CEQJ2X6.mjs";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ZRDV3MVW.mjs";
|
|
11
11
|
import "../chunk-N4VN2B5S.mjs";
|
|
12
12
|
import "../chunk-2MGJO3FY.mjs";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-FRXYSJGZ.mjs";
|
|
14
14
|
import "../chunk-DSDAZA3B.mjs";
|
|
15
15
|
import "../chunk-PIF5KJYI.mjs";
|
|
16
16
|
import "../chunk-2IDV5OHF.mjs";
|
|
@@ -532,7 +532,18 @@ function useChat(options) {
|
|
|
532
532
|
const runChatCompletionRef = (0, import_react6.useRef)();
|
|
533
533
|
const addErrorToast = useErrorToast();
|
|
534
534
|
const { setBannerError } = useToast();
|
|
535
|
-
const { onError } = useCopilotContext();
|
|
535
|
+
const { onError, showDevConsole, getAllContext } = useCopilotContext();
|
|
536
|
+
const copilotReadableContext = getAllContext();
|
|
537
|
+
const context = (0, import_react6.useMemo)(
|
|
538
|
+
() => copilotReadableContext.map((contextItem) => {
|
|
539
|
+
const [description, ...valueParts] = contextItem.value.split(":");
|
|
540
|
+
return {
|
|
541
|
+
description: description.trim(),
|
|
542
|
+
value: valueParts.join(":").trim()
|
|
543
|
+
};
|
|
544
|
+
}),
|
|
545
|
+
[copilotReadableContext]
|
|
546
|
+
);
|
|
536
547
|
const traceUIError = (error, originalError) => __async(this, null, function* () {
|
|
537
548
|
try {
|
|
538
549
|
const traceEvent = {
|
|
@@ -566,7 +577,6 @@ function useChat(options) {
|
|
|
566
577
|
extensionsRef.current = extensions;
|
|
567
578
|
const publicApiKey = copilotConfig.publicApiKey;
|
|
568
579
|
const headers = __spreadValues(__spreadValues({}, copilotConfig.headers || {}), publicApiKey ? { [import_shared4.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: publicApiKey } : {});
|
|
569
|
-
const { showDevConsole } = useCopilotContext();
|
|
570
580
|
const runtimeClient = useCopilotRuntimeClient({
|
|
571
581
|
url: copilotConfig.chatApiEndpoint,
|
|
572
582
|
publicApiKey: copilotConfig.publicApiKey,
|
|
@@ -647,7 +657,8 @@ function useChat(options) {
|
|
|
647
657
|
}
|
|
648
658
|
return stateObject;
|
|
649
659
|
}),
|
|
650
|
-
forwardedParameters: options.forwardedParameters || {}
|
|
660
|
+
forwardedParameters: options.forwardedParameters || {},
|
|
661
|
+
context
|
|
651
662
|
}),
|
|
652
663
|
properties: finalProperties,
|
|
653
664
|
signal: (_e = chatAbortControllerRef.current) == null ? void 0 : _e.signal
|
|
@@ -959,7 +970,8 @@ function useChat(options) {
|
|
|
959
970
|
coagentStatesRef,
|
|
960
971
|
agentSession,
|
|
961
972
|
setAgentSession,
|
|
962
|
-
disableSystemMessage
|
|
973
|
+
disableSystemMessage,
|
|
974
|
+
context
|
|
963
975
|
]
|
|
964
976
|
);
|
|
965
977
|
runChatCompletionRef.current = runChatCompletion;
|