@copilotkit/react-core 1.10.4 → 1.10.5-next.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 +8 -0
- package/dist/{chunk-DSDAZA3B.mjs → chunk-23SOG4FI.mjs} +4 -4
- package/dist/{chunk-KWS75AOU.mjs → chunk-4JBVPOHK.mjs} +2 -2
- package/dist/{chunk-LLLCUHOO.mjs → chunk-6INCKUL6.mjs} +6 -6
- package/dist/{chunk-5KVEE73R.mjs → chunk-7D4OASUM.mjs} +4 -4
- package/dist/{chunk-6WTWBXEJ.mjs → chunk-7LZXD5RJ.mjs} +11 -11
- package/dist/{chunk-QNJNOZH3.mjs → chunk-AGP7SAEE.mjs} +8 -8
- package/dist/{chunk-JEMBA7PE.mjs → chunk-AR7HJPGU.mjs} +4 -4
- package/dist/{chunk-2QZSAQTX.mjs → chunk-CLQLVMW4.mjs} +4 -4
- package/dist/{chunk-CLAHAV6J.mjs → chunk-FCRODLLL.mjs} +8 -8
- package/dist/{chunk-AALETENN.mjs → chunk-G2GQX4FI.mjs} +65 -4
- package/dist/chunk-G2GQX4FI.mjs.map +1 -0
- package/dist/{chunk-ID5JRMGN.mjs → chunk-HHLBUGRA.mjs} +2 -2
- package/dist/{chunk-HWM2Z3J3.mjs → chunk-KA3NCZEJ.mjs} +2 -2
- package/dist/{chunk-N4VN2B5S.mjs → chunk-L3I57GMV.mjs} +4 -4
- package/dist/{chunk-2MGJO3FY.mjs → chunk-MY2BUA6F.mjs} +6 -6
- package/dist/{chunk-EBSAU46C.mjs → chunk-NALRM7KT.mjs} +5 -5
- package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
- 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 +10 -10
- 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 +10 -10
- 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 +3 -3
- package/dist/components/dev-console/developer-console-modal.mjs +2 -2
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.js +63 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -10
- package/dist/context/index.mjs +4 -4
- package/dist/hooks/index.mjs +31 -31
- package/dist/hooks/use-chat.mjs +4 -4
- package/dist/hooks/use-coagent-state-render.mjs +2 -2
- package/dist/hooks/use-coagent.mjs +15 -15
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat-headless_c.mjs +15 -15
- package/dist/hooks/use-copilot-chat.mjs +15 -15
- package/dist/hooks/use-copilot-chat_internal.mjs +14 -14
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +15 -15
- package/dist/index.js +63 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -35
- package/dist/lib/copilot-task.mjs +12 -12
- package/dist/lib/index.mjs +12 -12
- package/dist/utils/extract.mjs +10 -10
- package/dist/utils/index.mjs +10 -10
- package/dist/utils/suggestions.mjs +10 -10
- package/package.json +3 -3
- package/src/components/dev-console/console-trigger.tsx +66 -2
- package/dist/chunk-AALETENN.mjs.map +0 -1
- /package/dist/{chunk-DSDAZA3B.mjs.map → chunk-23SOG4FI.mjs.map} +0 -0
- /package/dist/{chunk-KWS75AOU.mjs.map → chunk-4JBVPOHK.mjs.map} +0 -0
- /package/dist/{chunk-LLLCUHOO.mjs.map → chunk-6INCKUL6.mjs.map} +0 -0
- /package/dist/{chunk-5KVEE73R.mjs.map → chunk-7D4OASUM.mjs.map} +0 -0
- /package/dist/{chunk-6WTWBXEJ.mjs.map → chunk-7LZXD5RJ.mjs.map} +0 -0
- /package/dist/{chunk-QNJNOZH3.mjs.map → chunk-AGP7SAEE.mjs.map} +0 -0
- /package/dist/{chunk-JEMBA7PE.mjs.map → chunk-AR7HJPGU.mjs.map} +0 -0
- /package/dist/{chunk-2QZSAQTX.mjs.map → chunk-CLQLVMW4.mjs.map} +0 -0
- /package/dist/{chunk-CLAHAV6J.mjs.map → chunk-FCRODLLL.mjs.map} +0 -0
- /package/dist/{chunk-ID5JRMGN.mjs.map → chunk-HHLBUGRA.mjs.map} +0 -0
- /package/dist/{chunk-HWM2Z3J3.mjs.map → chunk-KA3NCZEJ.mjs.map} +0 -0
- /package/dist/{chunk-N4VN2B5S.mjs.map → chunk-L3I57GMV.mjs.map} +0 -0
- /package/dist/{chunk-2MGJO3FY.mjs.map → chunk-MY2BUA6F.mjs.map} +0 -0
- /package/dist/{chunk-EBSAU46C.mjs.map → chunk-NALRM7KT.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
CopilotKitIcon,
|
|
4
4
|
ExclamationMarkTriangleIcon
|
|
5
5
|
} from "./chunk-PIF5KJYI.mjs";
|
|
6
|
-
import {
|
|
7
|
-
useCopilotContext
|
|
8
|
-
} from "./chunk-YHT6CWIY.mjs";
|
|
9
6
|
import {
|
|
10
7
|
useCopilotMessagesContext
|
|
11
8
|
} from "./chunk-ZLQVRPDS.mjs";
|
|
9
|
+
import {
|
|
10
|
+
useCopilotContext
|
|
11
|
+
} from "./chunk-YHT6CWIY.mjs";
|
|
12
12
|
|
|
13
13
|
// src/components/dev-console/developer-console-modal.tsx
|
|
14
14
|
import { COPILOTKIT_VERSION } from "@copilotkit/shared";
|
|
@@ -756,4 +756,4 @@ function ContextTab({ context }) {
|
|
|
756
756
|
export {
|
|
757
757
|
DeveloperConsoleModal
|
|
758
758
|
};
|
|
759
|
-
//# sourceMappingURL=chunk-
|
|
759
|
+
//# sourceMappingURL=chunk-23SOG4FI.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AR7HJPGU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-YHT6CWIY.mjs";
|
|
@@ -56,4 +56,4 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
56
56
|
export {
|
|
57
57
|
useCopilotAuthenticatedAction_c
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-4JBVPOHK.mjs.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processActionsForRuntimeRequest
|
|
3
3
|
} from "./chunk-4CEQJ2X6.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useCopilotRuntimeClient
|
|
6
|
-
} from "./chunk-Q3MCVRO3.mjs";
|
|
7
4
|
import {
|
|
8
5
|
useAsyncCallback,
|
|
9
6
|
useErrorToast
|
|
10
7
|
} from "./chunk-N4WEHORG.mjs";
|
|
11
8
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
useCopilotRuntimeClient
|
|
10
|
+
} from "./chunk-Q3MCVRO3.mjs";
|
|
14
11
|
import {
|
|
15
12
|
useCopilotContext
|
|
16
13
|
} from "./chunk-YHT6CWIY.mjs";
|
|
14
|
+
import {
|
|
15
|
+
useToast
|
|
16
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
17
17
|
import {
|
|
18
18
|
__async,
|
|
19
19
|
__spreadProps,
|
|
@@ -706,4 +706,4 @@ function getPairedFeAction(actions, message) {
|
|
|
706
706
|
export {
|
|
707
707
|
useChat
|
|
708
708
|
};
|
|
709
|
-
//# sourceMappingURL=chunk-
|
|
709
|
+
//# sourceMappingURL=chunk-6INCKUL6.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultCopilotContextCategories
|
|
3
|
+
} from "./chunk-7LZXD5RJ.mjs";
|
|
1
4
|
import {
|
|
2
5
|
processActionsForRuntimeRequest
|
|
3
6
|
} from "./chunk-4CEQJ2X6.mjs";
|
|
4
|
-
import {
|
|
5
|
-
defaultCopilotContextCategories
|
|
6
|
-
} from "./chunk-6WTWBXEJ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
@@ -117,4 +117,4 @@ ${instructions}
|
|
|
117
117
|
export {
|
|
118
118
|
CopilotTask
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-7D4OASUM.mjs.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotErrorBoundary
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L3I57GMV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotMessages,
|
|
6
6
|
MessagesTapProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MY2BUA6F.mjs";
|
|
8
8
|
import {
|
|
9
9
|
ConsoleTrigger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-G2GQX4FI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
use_flat_category_store_default
|
|
13
13
|
} from "./chunk-5FHSUKQL.mjs";
|
|
14
14
|
import {
|
|
15
15
|
use_tree_default
|
|
16
16
|
} from "./chunk-RKTVJRK7.mjs";
|
|
17
|
+
import {
|
|
18
|
+
UsageBanner,
|
|
19
|
+
getErrorActions
|
|
20
|
+
} from "./chunk-6ZLPNY7X.mjs";
|
|
17
21
|
import {
|
|
18
22
|
useCopilotRuntimeClient
|
|
19
23
|
} from "./chunk-Q3MCVRO3.mjs";
|
|
20
24
|
import {
|
|
21
25
|
shouldShowDevConsole
|
|
22
26
|
} from "./chunk-ICIK2BSB.mjs";
|
|
23
|
-
import {
|
|
24
|
-
ToastProvider
|
|
25
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
26
|
-
import {
|
|
27
|
-
UsageBanner,
|
|
28
|
-
getErrorActions
|
|
29
|
-
} from "./chunk-6ZLPNY7X.mjs";
|
|
30
27
|
import {
|
|
31
28
|
CopilotContext
|
|
32
29
|
} from "./chunk-YHT6CWIY.mjs";
|
|
30
|
+
import {
|
|
31
|
+
ToastProvider
|
|
32
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
33
33
|
import {
|
|
34
34
|
__async,
|
|
35
35
|
__objRest,
|
|
@@ -794,4 +794,4 @@ export {
|
|
|
794
794
|
CopilotKitInternal,
|
|
795
795
|
defaultCopilotContextCategories
|
|
796
796
|
};
|
|
797
|
-
//# sourceMappingURL=chunk-
|
|
797
|
+
//# sourceMappingURL=chunk-7LZXD5RJ.mjs.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FCRODLLL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useMessagesTap
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
useCopilotRuntimeClient
|
|
9
|
-
} from "./chunk-Q3MCVRO3.mjs";
|
|
6
|
+
} from "./chunk-MY2BUA6F.mjs";
|
|
10
7
|
import {
|
|
11
8
|
useAsyncCallback
|
|
12
9
|
} from "./chunk-N4WEHORG.mjs";
|
|
13
10
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
useCopilotRuntimeClient
|
|
12
|
+
} from "./chunk-Q3MCVRO3.mjs";
|
|
16
13
|
import {
|
|
17
14
|
useCopilotContext
|
|
18
15
|
} from "./chunk-YHT6CWIY.mjs";
|
|
16
|
+
import {
|
|
17
|
+
useToast
|
|
18
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__async,
|
|
21
21
|
__spreadProps,
|
|
@@ -236,4 +236,4 @@ export {
|
|
|
236
236
|
stopAgent,
|
|
237
237
|
runAgent
|
|
238
238
|
};
|
|
239
|
-
//# sourceMappingURL=chunk-
|
|
239
|
+
//# sourceMappingURL=chunk-AGP7SAEE.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAsyncCallback
|
|
3
3
|
} from "./chunk-N4WEHORG.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useToast
|
|
6
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
7
4
|
import {
|
|
8
5
|
useCopilotContext
|
|
9
6
|
} from "./chunk-YHT6CWIY.mjs";
|
|
7
|
+
import {
|
|
8
|
+
useToast
|
|
9
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__async,
|
|
12
12
|
__spreadValues
|
|
@@ -139,4 +139,4 @@ function isFrontendAction(action) {
|
|
|
139
139
|
export {
|
|
140
140
|
useCopilotAction
|
|
141
141
|
};
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
142
|
+
//# sourceMappingURL=chunk-AR7HJPGU.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useToast
|
|
3
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
4
1
|
import {
|
|
5
2
|
CopilotContext
|
|
6
3
|
} from "./chunk-YHT6CWIY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useToast
|
|
6
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
7
7
|
|
|
8
8
|
// src/hooks/use-coagent-state-render.ts
|
|
9
9
|
import { useRef, useContext, useEffect } from "react";
|
|
@@ -85,4 +85,4 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
85
85
|
export {
|
|
86
86
|
useCoAgentStateRender
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-CLQLVMW4.mjs.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useLangGraphInterruptRender
|
|
3
3
|
} from "./chunk-QF3Q5LUN.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useChat
|
|
6
|
-
} from "./chunk-LLLCUHOO.mjs";
|
|
7
4
|
import {
|
|
8
5
|
defaultCopilotContextCategories,
|
|
9
6
|
reloadSuggestions
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7LZXD5RJ.mjs";
|
|
8
|
+
import {
|
|
9
|
+
useCopilotMessagesContext
|
|
10
|
+
} from "./chunk-ZLQVRPDS.mjs";
|
|
11
|
+
import {
|
|
12
|
+
useChat
|
|
13
|
+
} from "./chunk-6INCKUL6.mjs";
|
|
11
14
|
import {
|
|
12
15
|
useAsyncCallback
|
|
13
16
|
} from "./chunk-N4WEHORG.mjs";
|
|
14
17
|
import {
|
|
15
18
|
useCopilotContext
|
|
16
19
|
} from "./chunk-YHT6CWIY.mjs";
|
|
17
|
-
import {
|
|
18
|
-
useCopilotMessagesContext
|
|
19
|
-
} from "./chunk-ZLQVRPDS.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__async,
|
|
22
22
|
__spreadProps,
|
|
@@ -329,4 +329,4 @@ export {
|
|
|
329
329
|
useCopilotChat,
|
|
330
330
|
defaultSystemMessage
|
|
331
331
|
};
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-FCRODLLL.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeveloperConsoleModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-23SOG4FI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotKitIcon
|
|
6
6
|
} from "./chunk-PIF5KJYI.mjs";
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
// src/components/dev-console/console-trigger.tsx
|
|
12
12
|
import { useState, useEffect, useRef } from "react";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var INSPECTOR_HIDE_KEY = "cpk:inspector:hidden";
|
|
14
15
|
function ConsoleTrigger({ position = "bottom-right" }) {
|
|
15
16
|
const context = useCopilotContext();
|
|
16
17
|
const hasApiKey = Boolean(context.copilotApiConfig.publicApiKey);
|
|
@@ -19,10 +20,18 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
19
20
|
const [isDragging, setIsDragging] = useState(false);
|
|
20
21
|
const [buttonPosition, setButtonPosition] = useState(null);
|
|
21
22
|
const [mounted, setMounted] = useState(false);
|
|
23
|
+
const [isHidden, setIsHidden] = useState(false);
|
|
22
24
|
const dragRef = useRef(null);
|
|
23
25
|
const buttonRef = useRef(null);
|
|
24
26
|
useEffect(() => {
|
|
25
27
|
setMounted(true);
|
|
28
|
+
try {
|
|
29
|
+
const hidden = typeof window !== "undefined" ? localStorage.getItem(INSPECTOR_HIDE_KEY) : null;
|
|
30
|
+
if (hidden === "1" || hidden === "true") {
|
|
31
|
+
setIsHidden(true);
|
|
32
|
+
}
|
|
33
|
+
} catch (e) {
|
|
34
|
+
}
|
|
26
35
|
if (typeof window !== "undefined" && !buttonPosition) {
|
|
27
36
|
const buttonSize = 60;
|
|
28
37
|
const margin = 24;
|
|
@@ -74,7 +83,7 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
74
83
|
document.removeEventListener("mouseup", handleMouseUp, { capture: true });
|
|
75
84
|
};
|
|
76
85
|
}, [isDragging]);
|
|
77
|
-
if (!mounted || !buttonPosition) {
|
|
86
|
+
if (!mounted || !buttonPosition || isHidden) {
|
|
78
87
|
return null;
|
|
79
88
|
}
|
|
80
89
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -82,11 +91,27 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
82
91
|
"button",
|
|
83
92
|
{
|
|
84
93
|
ref: buttonRef,
|
|
85
|
-
onClick: () => {
|
|
94
|
+
onClick: (e) => {
|
|
86
95
|
if (!isDragging) {
|
|
96
|
+
if (e.metaKey || e.altKey) {
|
|
97
|
+
try {
|
|
98
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
99
|
+
} catch (e2) {
|
|
100
|
+
}
|
|
101
|
+
setIsHidden(true);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
87
104
|
setIsModalOpen(true);
|
|
88
105
|
}
|
|
89
106
|
},
|
|
107
|
+
onContextMenu: (e) => {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
try {
|
|
110
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
111
|
+
} catch (e2) {
|
|
112
|
+
}
|
|
113
|
+
setIsHidden(true);
|
|
114
|
+
},
|
|
90
115
|
onMouseDown: handleMouseDown,
|
|
91
116
|
onMouseEnter: () => setIsHovered(true),
|
|
92
117
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -116,6 +141,42 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
116
141
|
},
|
|
117
142
|
title: hasApiKey ? "Open Inspector (Drag to move)" : "Inspector (License Key Required, Drag to move)",
|
|
118
143
|
children: [
|
|
144
|
+
/* @__PURE__ */ jsx(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
onClick: (e) => {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
try {
|
|
151
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
152
|
+
} catch (e2) {
|
|
153
|
+
}
|
|
154
|
+
setIsHidden(true);
|
|
155
|
+
},
|
|
156
|
+
style: {
|
|
157
|
+
position: "absolute",
|
|
158
|
+
bottom: "2px",
|
|
159
|
+
right: "2px",
|
|
160
|
+
width: "20px",
|
|
161
|
+
height: "20px",
|
|
162
|
+
borderRadius: "50%",
|
|
163
|
+
background: "#ffffff",
|
|
164
|
+
color: "#ef4444",
|
|
165
|
+
fontSize: "14px",
|
|
166
|
+
lineHeight: "18px",
|
|
167
|
+
textAlign: "center",
|
|
168
|
+
boxShadow: "0 2px 6px rgba(0,0,0,0.35)",
|
|
169
|
+
cursor: "pointer",
|
|
170
|
+
border: "1px solid #e5e7eb",
|
|
171
|
+
display: "flex",
|
|
172
|
+
alignItems: "center",
|
|
173
|
+
justifyContent: "center",
|
|
174
|
+
zIndex: 1
|
|
175
|
+
},
|
|
176
|
+
title: "Hide Inspector",
|
|
177
|
+
children: "\xD7"
|
|
178
|
+
}
|
|
179
|
+
),
|
|
119
180
|
/* @__PURE__ */ jsx(
|
|
120
181
|
"div",
|
|
121
182
|
{
|
|
@@ -167,4 +228,4 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
167
228
|
export {
|
|
168
229
|
ConsoleTrigger
|
|
169
230
|
};
|
|
170
|
-
//# sourceMappingURL=chunk-
|
|
231
|
+
//# sourceMappingURL=chunk-G2GQX4FI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/dev-console/console-trigger.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useEffect, useRef } from \"react\";\nimport { useCopilotContext } from \"../../context/copilot-context\";\nimport { CopilotKitIcon } from \"./icons\";\nimport { DeveloperConsoleModal } from \"./developer-console-modal\";\n\n// Storage key for hiding the Inspector trigger/modal\nconst INSPECTOR_HIDE_KEY = \"cpk:inspector:hidden\";\n\ninterface ConsoleTriggerProps {\n position?: \"bottom-left\" | \"bottom-right\";\n}\n\nexport function ConsoleTrigger({ position = \"bottom-right\" }: ConsoleTriggerProps) {\n const context = useCopilotContext();\n const hasApiKey = Boolean(context.copilotApiConfig.publicApiKey);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [buttonPosition, setButtonPosition] = useState<{ x: number; y: number } | null>(null);\n const [mounted, setMounted] = useState(false);\n const [isHidden, setIsHidden] = useState(false);\n\n const dragRef = useRef<{\n startX: number;\n startY: number;\n buttonX: number;\n buttonY: number;\n } | null>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n // Initialize on client side only\n useEffect(() => {\n setMounted(true);\n try {\n const hidden =\n typeof window !== \"undefined\" ? localStorage.getItem(INSPECTOR_HIDE_KEY) : null;\n if (hidden === \"1\" || hidden === \"true\") {\n setIsHidden(true);\n }\n } catch {\n // ignore\n }\n if (typeof window !== \"undefined\" && !buttonPosition) {\n const buttonSize = 60;\n const margin = 24;\n\n const initialPosition = {\n x: margin,\n y: window.innerHeight - buttonSize - margin,\n };\n\n setButtonPosition(initialPosition);\n }\n }, [position]);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n e.preventDefault();\n if (!buttonPosition) return;\n\n dragRef.current = {\n startX: e.clientX,\n startY: e.clientY,\n buttonX: buttonPosition.x,\n buttonY: buttonPosition.y,\n };\n setIsDragging(true);\n };\n\n useEffect(() => {\n if (!isDragging) return;\n\n const handleMouseMove = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n if (!dragRef.current) return;\n\n const deltaX = e.clientX - dragRef.current.startX;\n const deltaY = e.clientY - dragRef.current.startY;\n\n // Calculate new position\n let newX = dragRef.current.buttonX + deltaX;\n let newY = dragRef.current.buttonY + deltaY;\n\n // Keep button within viewport bounds\n newX = Math.max(0, Math.min(newX, window.innerWidth - 60));\n newY = Math.max(0, Math.min(newY, window.innerHeight - 60));\n\n setButtonPosition({ x: newX, y: newY });\n };\n\n const handleMouseUp = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n dragRef.current = null;\n };\n\n // Use capture phase to intercept events before they reach other handlers\n document.addEventListener(\"mousemove\", handleMouseMove, { capture: true, passive: false });\n document.addEventListener(\"mouseup\", handleMouseUp, { capture: true, passive: false });\n\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove, { capture: true });\n document.removeEventListener(\"mouseup\", handleMouseUp, { capture: true });\n };\n }, [isDragging]);\n\n // Don't render until mounted and position is initialized\n if (!mounted || !buttonPosition || isHidden) {\n return null;\n }\n\n return (\n <>\n <button\n ref={buttonRef}\n onClick={(e) => {\n if (!isDragging) {\n // Modifier-click hides\n if (e.metaKey || e.altKey) {\n try {\n localStorage.setItem(INSPECTOR_HIDE_KEY, \"1\");\n } catch {}\n setIsHidden(true);\n return;\n }\n setIsModalOpen(true);\n }\n }}\n onContextMenu={(e) => {\n e.preventDefault();\n try {\n localStorage.setItem(INSPECTOR_HIDE_KEY, \"1\");\n } catch {}\n setIsHidden(true);\n }}\n onMouseDown={handleMouseDown}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{\n position: \"fixed\",\n left: `${buttonPosition.x}px`,\n top: `${buttonPosition.y}px`,\n zIndex: 2147483647,\n width: \"60px\",\n height: \"60px\",\n background: isDragging ? \"#000000\" : isHovered ? \"#111111\" : \"#000000\",\n color: \"white\",\n borderRadius: \"50%\",\n boxShadow: isDragging\n ? \"0 8px 32px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4)\"\n : isHovered\n ? \"0 12px 40px rgba(0, 0, 0, 0.7), 0 6px 20px rgba(0, 0, 0, 0.5)\"\n : \"0 6px 20px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3)\",\n transition: isDragging ? \"none\" : \"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: \"none\",\n cursor: isDragging ? \"grabbing\" : \"grab\",\n opacity: 1,\n userSelect: \"none\",\n transform: isDragging ? \"scale(1.05)\" : isHovered ? \"scale(1.1)\" : \"scale(1)\",\n backdropFilter: \"blur(10px)\",\n pointerEvents: \"auto\",\n isolation: \"isolate\",\n }}\n title={\n hasApiKey\n ? \"Open Inspector (Drag to move)\"\n : \"Inspector (License Key Required, Drag to move)\"\n }\n >\n {/* Close (hide) control */}\n <div\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n try {\n localStorage.setItem(INSPECTOR_HIDE_KEY, \"1\");\n } catch {\n // ignore\n }\n setIsHidden(true);\n }}\n style={{\n position: \"absolute\",\n bottom: \"2px\",\n right: \"2px\",\n width: \"20px\",\n height: \"20px\",\n borderRadius: \"50%\",\n background: \"#ffffff\",\n color: \"#ef4444\",\n fontSize: \"14px\",\n lineHeight: \"18px\",\n textAlign: \"center\",\n boxShadow: \"0 2px 6px rgba(0,0,0,0.35)\",\n cursor: \"pointer\",\n border: \"1px solid #e5e7eb\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 1,\n }}\n title=\"Hide Inspector\"\n >\n ×\n </div>\n <div\n style={{\n width: \"28px\",\n height: \"28px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: \"drop-shadow(0 2px 4px rgba(0,0,0,0.2))\",\n }}\n >\n <CopilotKitIcon />\n </div>\n {!hasApiKey && (\n <div\n style={{\n position: \"absolute\",\n top: \"-2px\",\n right: \"-2px\",\n width: \"18px\",\n height: \"18px\",\n background: \"linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%)\",\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxShadow: \"0 2px 8px rgba(255, 107, 107, 0.4)\",\n border: \"2px solid white\",\n }}\n >\n <span style={{ fontSize: \"10px\", color: \"white\", fontWeight: \"bold\" }}>!</span>\n </div>\n )}\n </button>\n\n <DeveloperConsoleModal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n hasApiKey={hasApiKey}\n />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AAEA,SAAgB,UAAU,WAAW,cAAc;AAkH/C,mBA6DI,KA5DF,YADF;AA5GJ,IAAM,qBAAqB;AAMpB,SAAS,eAAe,EAAE,WAAW,eAAe,GAAwB;AACjF,QAAM,UAAU,kBAAkB;AAClC,QAAM,YAAY,QAAQ,QAAQ,iBAAiB,YAAY;AAC/D,QAAM,CAAC,aAA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R,SAAS;AAAA,gBACT,YAAY;AAAA,gBACZ,gBAAgB;AAAA,gBAChB,QAAQ;AAAA,cACV;AAAA,cACA,OAAM;AAAA,cACP;AAAA;AAAA,UAED;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,gBACL,OAAO;AAAA,gBACP,QAAQ;AAAA,gBACR,SAAS;AAAA,gBACT,YAAY;AAAA,gBACZ,gBAAgB;AAAA,gBAChB,QAAQ;AAAA,cACV;AAAA,cAEA,8BAAC,kBAAe;AAAA;AAAA,UAClB;AAAA,UACC,CAAC,aACA;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,gBACL,UAAU;AAAA,gBACV,KAAK;AAAA,gBACL,OAAO;AAAA,gBACP,OAAO;AAAA,gBACP,QAAQ;AAAA,gBACR,YAAY;AAAA,gBACZ,cAAc;AAAA,gBACd,SAAS;AAAA,gBACT,YAAY;AAAA,gBACZ,gBAAgB;AAAA,gBAChB,WAAW;AAAA,gBACX,QAAQ;AAAA,cACV;AAAA,cAEA,8BAAC,UAAK,OAAO,EAAE,UAAU,QAAQ,OAAO,SAAS,YAAY,OAAO,GAAG,eAAC;AAAA;AAAA,UAC1E;AAAA;AAAA;AAAA,IAEJ;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ;AAAA,QACR,SAAS,MAAM,eAAe,KAAK;AAAA,QACnC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["e"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FCRODLLL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-YHT6CWIY.mjs";
|
|
@@ -82,4 +82,4 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
82
82
|
export {
|
|
83
83
|
useCopilotChatHeadless_c
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-HHLBUGRA.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FCRODLLL.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-chat.ts
|
|
6
6
|
function useCopilotChat2(options = {}) {
|
|
@@ -31,4 +31,4 @@ function useCopilotChat2(options = {}) {
|
|
|
31
31
|
export {
|
|
32
32
|
useCopilotChat2 as useCopilotChat
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-KA3NCZEJ.mjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StatusChecker
|
|
3
3
|
} from "./chunk-PMAFHQ7P.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useErrorToast
|
|
6
|
-
} from "./chunk-N4WEHORG.mjs";
|
|
7
4
|
import {
|
|
8
5
|
UsageBanner,
|
|
9
6
|
getErrorActions
|
|
10
7
|
} from "./chunk-6ZLPNY7X.mjs";
|
|
8
|
+
import {
|
|
9
|
+
useErrorToast
|
|
10
|
+
} from "./chunk-N4WEHORG.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/error-boundary/error-boundary.tsx
|
|
13
13
|
import React, { useEffect } from "react";
|
|
@@ -80,4 +80,4 @@ export {
|
|
|
80
80
|
CopilotErrorBoundary,
|
|
81
81
|
ErrorToast
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-L3I57GMV.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CopilotMessagesContext
|
|
3
|
+
} from "./chunk-ZLQVRPDS.mjs";
|
|
1
4
|
import {
|
|
2
5
|
shouldShowDevConsole
|
|
3
6
|
} from "./chunk-ICIK2BSB.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useToast
|
|
6
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useCopilotContext
|
|
9
9
|
} from "./chunk-YHT6CWIY.mjs";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
useToast
|
|
12
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__async
|
|
15
15
|
} from "./chunk-SKC7AJIV.mjs";
|
|
@@ -219,4 +219,4 @@ export {
|
|
|
219
219
|
MessagesTapProvider,
|
|
220
220
|
CopilotMessages
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-MY2BUA6F.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
useToast
|
|
6
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
3
|
+
} from "./chunk-FCRODLLL.mjs";
|
|
7
4
|
import {
|
|
8
5
|
CopilotContext
|
|
9
6
|
} from "./chunk-YHT6CWIY.mjs";
|
|
7
|
+
import {
|
|
8
|
+
useToast
|
|
9
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__spreadProps,
|
|
12
12
|
__spreadValues
|
|
@@ -62,4 +62,4 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
62
62
|
export {
|
|
63
63
|
useLangGraphInterrupt
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-NALRM7KT.mjs.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
CopilotMessages,
|
|
3
3
|
MessagesTapProvider,
|
|
4
4
|
useMessagesTap
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-MY2BUA6F.mjs";
|
|
6
|
+
import "../../chunk-ZLQVRPDS.mjs";
|
|
6
7
|
import "../../chunk-ICIK2BSB.mjs";
|
|
7
|
-
import "../../chunk-EFL5OBKN.mjs";
|
|
8
8
|
import "../../chunk-YHT6CWIY.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-EFL5OBKN.mjs";
|
|
10
10
|
import "../../chunk-SKC7AJIV.mjs";
|
|
11
11
|
export {
|
|
12
12
|
CopilotMessages,
|
|
@@ -2150,6 +2150,7 @@ function ContextTab({ context }) {
|
|
|
2150
2150
|
|
|
2151
2151
|
// src/components/dev-console/console-trigger.tsx
|
|
2152
2152
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2153
|
+
var INSPECTOR_HIDE_KEY = "cpk:inspector:hidden";
|
|
2153
2154
|
function ConsoleTrigger({ position = "bottom-right" }) {
|
|
2154
2155
|
const context = useCopilotContext();
|
|
2155
2156
|
const hasApiKey = Boolean(context.copilotApiConfig.publicApiKey);
|
|
@@ -2158,10 +2159,18 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
2158
2159
|
const [isDragging, setIsDragging] = (0, import_react10.useState)(false);
|
|
2159
2160
|
const [buttonPosition, setButtonPosition] = (0, import_react10.useState)(null);
|
|
2160
2161
|
const [mounted, setMounted] = (0, import_react10.useState)(false);
|
|
2162
|
+
const [isHidden, setIsHidden] = (0, import_react10.useState)(false);
|
|
2161
2163
|
const dragRef = (0, import_react10.useRef)(null);
|
|
2162
2164
|
const buttonRef = (0, import_react10.useRef)(null);
|
|
2163
2165
|
(0, import_react10.useEffect)(() => {
|
|
2164
2166
|
setMounted(true);
|
|
2167
|
+
try {
|
|
2168
|
+
const hidden = typeof window !== "undefined" ? localStorage.getItem(INSPECTOR_HIDE_KEY) : null;
|
|
2169
|
+
if (hidden === "1" || hidden === "true") {
|
|
2170
|
+
setIsHidden(true);
|
|
2171
|
+
}
|
|
2172
|
+
} catch (e) {
|
|
2173
|
+
}
|
|
2165
2174
|
if (typeof window !== "undefined" && !buttonPosition) {
|
|
2166
2175
|
const buttonSize = 60;
|
|
2167
2176
|
const margin = 24;
|
|
@@ -2213,7 +2222,7 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
2213
2222
|
document.removeEventListener("mouseup", handleMouseUp, { capture: true });
|
|
2214
2223
|
};
|
|
2215
2224
|
}, [isDragging]);
|
|
2216
|
-
if (!mounted || !buttonPosition) {
|
|
2225
|
+
if (!mounted || !buttonPosition || isHidden) {
|
|
2217
2226
|
return null;
|
|
2218
2227
|
}
|
|
2219
2228
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
@@ -2221,11 +2230,27 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
2221
2230
|
"button",
|
|
2222
2231
|
{
|
|
2223
2232
|
ref: buttonRef,
|
|
2224
|
-
onClick: () => {
|
|
2233
|
+
onClick: (e) => {
|
|
2225
2234
|
if (!isDragging) {
|
|
2235
|
+
if (e.metaKey || e.altKey) {
|
|
2236
|
+
try {
|
|
2237
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
2238
|
+
} catch (e2) {
|
|
2239
|
+
}
|
|
2240
|
+
setIsHidden(true);
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2226
2243
|
setIsModalOpen(true);
|
|
2227
2244
|
}
|
|
2228
2245
|
},
|
|
2246
|
+
onContextMenu: (e) => {
|
|
2247
|
+
e.preventDefault();
|
|
2248
|
+
try {
|
|
2249
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
2250
|
+
} catch (e2) {
|
|
2251
|
+
}
|
|
2252
|
+
setIsHidden(true);
|
|
2253
|
+
},
|
|
2229
2254
|
onMouseDown: handleMouseDown,
|
|
2230
2255
|
onMouseEnter: () => setIsHovered(true),
|
|
2231
2256
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -2255,6 +2280,42 @@ function ConsoleTrigger({ position = "bottom-right" }) {
|
|
|
2255
2280
|
},
|
|
2256
2281
|
title: hasApiKey ? "Open Inspector (Drag to move)" : "Inspector (License Key Required, Drag to move)",
|
|
2257
2282
|
children: [
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2284
|
+
"div",
|
|
2285
|
+
{
|
|
2286
|
+
onClick: (e) => {
|
|
2287
|
+
e.preventDefault();
|
|
2288
|
+
e.stopPropagation();
|
|
2289
|
+
try {
|
|
2290
|
+
localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
|
|
2291
|
+
} catch (e2) {
|
|
2292
|
+
}
|
|
2293
|
+
setIsHidden(true);
|
|
2294
|
+
},
|
|
2295
|
+
style: {
|
|
2296
|
+
position: "absolute",
|
|
2297
|
+
bottom: "2px",
|
|
2298
|
+
right: "2px",
|
|
2299
|
+
width: "20px",
|
|
2300
|
+
height: "20px",
|
|
2301
|
+
borderRadius: "50%",
|
|
2302
|
+
background: "#ffffff",
|
|
2303
|
+
color: "#ef4444",
|
|
2304
|
+
fontSize: "14px",
|
|
2305
|
+
lineHeight: "18px",
|
|
2306
|
+
textAlign: "center",
|
|
2307
|
+
boxShadow: "0 2px 6px rgba(0,0,0,0.35)",
|
|
2308
|
+
cursor: "pointer",
|
|
2309
|
+
border: "1px solid #e5e7eb",
|
|
2310
|
+
display: "flex",
|
|
2311
|
+
alignItems: "center",
|
|
2312
|
+
justifyContent: "center",
|
|
2313
|
+
zIndex: 1
|
|
2314
|
+
},
|
|
2315
|
+
title: "Hide Inspector",
|
|
2316
|
+
children: "\xD7"
|
|
2317
|
+
}
|
|
2318
|
+
),
|
|
2258
2319
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2259
2320
|
"div",
|
|
2260
2321
|
{
|