@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,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotKit,
|
|
3
3
|
defaultCopilotContextCategories
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-ZRDV3MVW.mjs";
|
|
5
5
|
import "../../chunk-N4VN2B5S.mjs";
|
|
6
6
|
import "../../chunk-2MGJO3FY.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-FRXYSJGZ.mjs";
|
|
8
8
|
import "../../chunk-DSDAZA3B.mjs";
|
|
9
9
|
import "../../chunk-PIF5KJYI.mjs";
|
|
10
10
|
import "../../chunk-2IDV5OHF.mjs";
|
|
@@ -978,6 +978,7 @@ function ContextTab({ context }) {
|
|
|
978
978
|
|
|
979
979
|
// src/components/dev-console/console-trigger.tsx
|
|
980
980
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
981
|
+
var INSPECTOR_HIDE_KEY = "cpk:inspector:hidden";
|
|
981
982
|
function ConsoleTrigger({ position = "bottom-right" }) {
|
|
982
983
|
const context = useCopilotContext();
|
|
983
984
|
const hasApiKey = Boolean(context.copilotApiConfig.publicApiKey);
|
|
@@ -986,10 +987,18 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
986
987
|
const [isDragging, setIsDragging] = (0, import_react4.useState)(false);
|
|
987
988
|
const [buttonPosition, setButtonPosition] = (0, import_react4.useState)(null);
|
|
988
989
|
const [mounted, setMounted] = (0, import_react4.useState)(false);
|
|
990
|
+
const [isHidden, setIsHidden] = (0, import_react4.useState)(false);
|
|
989
991
|
const dragRef = (0, import_react4.useRef)(null);
|
|
990
992
|
const buttonRef = (0, import_react4.useRef)(null);
|
|
991
993
|
(0, import_react4.useEffect)(() => {
|
|
992
994
|
setMounted(true);
|
|
995
|
+
try {
|
|
996
|
+
const hidden = typeof window !== "undefined" ? localStorage.getItem(INSPECTOR_HIDE_KEY) : null;
|
|
997
|
+
if (hidden === "1" || hidden === "true") {
|
|
998
|
+
setIsHidden(true);
|
|
999
|
+
}
|
|
1000
|
+
} catch (e) {
|
|
1001
|
+
}
|
|
993
1002
|
if (typeof window !== "undefined" && !buttonPosition) {
|
|
994
1003
|
const buttonSize = 60;
|
|
995
1004
|
const margin = 24;
|
|
@@ -1041,7 +1050,7 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
1041
1050
|
document.removeEventListener("mouseup", handleMouseUp, { capture: true });
|
|
1042
1051
|
};
|
|
1043
1052
|
}, [isDragging]);
|
|
1044
|
-
if (!mounted || !buttonPosition) {
|
|
1053
|
+
if (!mounted || !buttonPosition || isHidden) {
|
|
1045
1054
|
return null;
|
|
1046
1055
|
}
|
|
1047
1056
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
@@ -1049,11 +1058,27 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
1049
1058
|
"button",
|
|
1050
1059
|
{
|
|
1051
1060
|
ref: buttonRef,
|
|
1052
|
-
onClick: () => {
|
|
1061
|
+
onClick: (e) => {
|
|
1053
1062
|
if (!isDragging) {
|
|
1063
|
+
if (e.metaKey || e.altKey) {
|
|
1064
|
+
try {
|
|
1065
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
1066
|
+
} catch (e2) {
|
|
1067
|
+
}
|
|
1068
|
+
setIsHidden(true);
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1054
1071
|
setIsModalOpen(true);
|
|
1055
1072
|
}
|
|
1056
1073
|
},
|
|
1074
|
+
onContextMenu: (e) => {
|
|
1075
|
+
e.preventDefault();
|
|
1076
|
+
try {
|
|
1077
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
1078
|
+
} catch (e2) {
|
|
1079
|
+
}
|
|
1080
|
+
setIsHidden(true);
|
|
1081
|
+
},
|
|
1057
1082
|
onMouseDown: handleMouseDown,
|
|
1058
1083
|
onMouseEnter: () => setIsHovered(true),
|
|
1059
1084
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -1083,6 +1108,42 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
1083
1108
|
},
|
|
1084
1109
|
title: hasApiKey ? "Open Inspector (Drag to move)" : "Inspector (License Key Required, Drag to move)",
|
|
1085
1110
|
children: [
|
|
1111
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1112
|
+
"div",
|
|
1113
|
+
{
|
|
1114
|
+
onClick: (e) => {
|
|
1115
|
+
e.preventDefault();
|
|
1116
|
+
e.stopPropagation();
|
|
1117
|
+
try {
|
|
1118
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
1119
|
+
} catch (e2) {
|
|
1120
|
+
}
|
|
1121
|
+
setIsHidden(true);
|
|
1122
|
+
},
|
|
1123
|
+
style: {
|
|
1124
|
+
position: "absolute",
|
|
1125
|
+
bottom: "2px",
|
|
1126
|
+
right: "2px",
|
|
1127
|
+
width: "20px",
|
|
1128
|
+
height: "20px",
|
|
1129
|
+
borderRadius: "50%",
|
|
1130
|
+
background: "#ffffff",
|
|
1131
|
+
color: "#ef4444",
|
|
1132
|
+
fontSize: "14px",
|
|
1133
|
+
lineHeight: "18px",
|
|
1134
|
+
textAlign: "center",
|
|
1135
|
+
boxShadow: "0 2px 6px rgba(0,0,0,0.35)",
|
|
1136
|
+
cursor: "pointer",
|
|
1137
|
+
border: "1px solid #e5e7eb",
|
|
1138
|
+
display: "flex",
|
|
1139
|
+
alignItems: "center",
|
|
1140
|
+
justifyContent: "center",
|
|
1141
|
+
zIndex: 1
|
|
1142
|
+
},
|
|
1143
|
+
title: "Hide Inspector",
|
|
1144
|
+
children: "\xD7"
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1086
1147
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1087
1148
|
"div",
|
|
1088
1149
|
{
|