@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.
Files changed (69) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{chunk-DSDAZA3B.mjs → chunk-23SOG4FI.mjs} +4 -4
  3. package/dist/{chunk-KWS75AOU.mjs → chunk-4JBVPOHK.mjs} +2 -2
  4. package/dist/{chunk-LLLCUHOO.mjs → chunk-6INCKUL6.mjs} +6 -6
  5. package/dist/{chunk-5KVEE73R.mjs → chunk-7D4OASUM.mjs} +4 -4
  6. package/dist/{chunk-6WTWBXEJ.mjs → chunk-7LZXD5RJ.mjs} +11 -11
  7. package/dist/{chunk-QNJNOZH3.mjs → chunk-AGP7SAEE.mjs} +8 -8
  8. package/dist/{chunk-JEMBA7PE.mjs → chunk-AR7HJPGU.mjs} +4 -4
  9. package/dist/{chunk-2QZSAQTX.mjs → chunk-CLQLVMW4.mjs} +4 -4
  10. package/dist/{chunk-CLAHAV6J.mjs → chunk-FCRODLLL.mjs} +8 -8
  11. package/dist/{chunk-AALETENN.mjs → chunk-G2GQX4FI.mjs} +65 -4
  12. package/dist/chunk-G2GQX4FI.mjs.map +1 -0
  13. package/dist/{chunk-ID5JRMGN.mjs → chunk-HHLBUGRA.mjs} +2 -2
  14. package/dist/{chunk-HWM2Z3J3.mjs → chunk-KA3NCZEJ.mjs} +2 -2
  15. package/dist/{chunk-N4VN2B5S.mjs → chunk-L3I57GMV.mjs} +4 -4
  16. package/dist/{chunk-2MGJO3FY.mjs → chunk-MY2BUA6F.mjs} +6 -6
  17. package/dist/{chunk-EBSAU46C.mjs → chunk-NALRM7KT.mjs} +5 -5
  18. package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
  19. package/dist/components/copilot-provider/copilotkit.js +63 -2
  20. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  21. package/dist/components/copilot-provider/copilotkit.mjs +10 -10
  22. package/dist/components/copilot-provider/index.js +63 -2
  23. package/dist/components/copilot-provider/index.js.map +1 -1
  24. package/dist/components/copilot-provider/index.mjs +10 -10
  25. package/dist/components/dev-console/console-trigger.js +63 -2
  26. package/dist/components/dev-console/console-trigger.js.map +1 -1
  27. package/dist/components/dev-console/console-trigger.mjs +3 -3
  28. package/dist/components/dev-console/developer-console-modal.mjs +2 -2
  29. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  30. package/dist/components/index.js +63 -2
  31. package/dist/components/index.js.map +1 -1
  32. package/dist/components/index.mjs +10 -10
  33. package/dist/context/index.mjs +4 -4
  34. package/dist/hooks/index.mjs +31 -31
  35. package/dist/hooks/use-chat.mjs +4 -4
  36. package/dist/hooks/use-coagent-state-render.mjs +2 -2
  37. package/dist/hooks/use-coagent.mjs +15 -15
  38. package/dist/hooks/use-copilot-action.mjs +2 -2
  39. package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
  40. package/dist/hooks/use-copilot-chat-headless_c.mjs +15 -15
  41. package/dist/hooks/use-copilot-chat.mjs +15 -15
  42. package/dist/hooks/use-copilot-chat_internal.mjs +14 -14
  43. package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
  44. package/dist/hooks/use-langgraph-interrupt.mjs +15 -15
  45. package/dist/index.js +63 -2
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +35 -35
  48. package/dist/lib/copilot-task.mjs +12 -12
  49. package/dist/lib/index.mjs +12 -12
  50. package/dist/utils/extract.mjs +10 -10
  51. package/dist/utils/index.mjs +10 -10
  52. package/dist/utils/suggestions.mjs +10 -10
  53. package/package.json +3 -3
  54. package/src/components/dev-console/console-trigger.tsx +66 -2
  55. package/dist/chunk-AALETENN.mjs.map +0 -1
  56. /package/dist/{chunk-DSDAZA3B.mjs.map → chunk-23SOG4FI.mjs.map} +0 -0
  57. /package/dist/{chunk-KWS75AOU.mjs.map → chunk-4JBVPOHK.mjs.map} +0 -0
  58. /package/dist/{chunk-LLLCUHOO.mjs.map → chunk-6INCKUL6.mjs.map} +0 -0
  59. /package/dist/{chunk-5KVEE73R.mjs.map → chunk-7D4OASUM.mjs.map} +0 -0
  60. /package/dist/{chunk-6WTWBXEJ.mjs.map → chunk-7LZXD5RJ.mjs.map} +0 -0
  61. /package/dist/{chunk-QNJNOZH3.mjs.map → chunk-AGP7SAEE.mjs.map} +0 -0
  62. /package/dist/{chunk-JEMBA7PE.mjs.map → chunk-AR7HJPGU.mjs.map} +0 -0
  63. /package/dist/{chunk-2QZSAQTX.mjs.map → chunk-CLQLVMW4.mjs.map} +0 -0
  64. /package/dist/{chunk-CLAHAV6J.mjs.map → chunk-FCRODLLL.mjs.map} +0 -0
  65. /package/dist/{chunk-ID5JRMGN.mjs.map → chunk-HHLBUGRA.mjs.map} +0 -0
  66. /package/dist/{chunk-HWM2Z3J3.mjs.map → chunk-KA3NCZEJ.mjs.map} +0 -0
  67. /package/dist/{chunk-N4VN2B5S.mjs.map → chunk-L3I57GMV.mjs.map} +0 -0
  68. /package/dist/{chunk-2MGJO3FY.mjs.map → chunk-MY2BUA6F.mjs.map} +0 -0
  69. /package/dist/{chunk-EBSAU46C.mjs.map → chunk-NALRM7KT.mjs.map} +0 -0
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  CopilotKit,
3
3
  defaultCopilotContextCategories
4
- } from "../../chunk-6WTWBXEJ.mjs";
5
- import "../../chunk-N4VN2B5S.mjs";
6
- import "../../chunk-2MGJO3FY.mjs";
7
- import "../../chunk-AALETENN.mjs";
8
- import "../../chunk-DSDAZA3B.mjs";
4
+ } from "../../chunk-7LZXD5RJ.mjs";
5
+ import "../../chunk-L3I57GMV.mjs";
6
+ import "../../chunk-MY2BUA6F.mjs";
7
+ import "../../chunk-G2GQX4FI.mjs";
8
+ import "../../chunk-23SOG4FI.mjs";
9
9
  import "../../chunk-PIF5KJYI.mjs";
10
10
  import "../../chunk-2IDV5OHF.mjs";
11
11
  import "../../chunk-PMAFHQ7P.mjs";
12
12
  import "../../chunk-5FHSUKQL.mjs";
13
13
  import "../../chunk-RKTVJRK7.mjs";
14
- import "../../chunk-Q3MCVRO3.mjs";
15
- import "../../chunk-ICIK2BSB.mjs";
14
+ import "../../chunk-ZLQVRPDS.mjs";
15
+ import "../../chunk-6ZLPNY7X.mjs";
16
16
  import "../../chunk-N4WEHORG.mjs";
17
17
  import "../../chunk-O7ARI5CV.mjs";
18
- import "../../chunk-EFL5OBKN.mjs";
19
- import "../../chunk-6ZLPNY7X.mjs";
18
+ import "../../chunk-Q3MCVRO3.mjs";
19
+ import "../../chunk-ICIK2BSB.mjs";
20
20
  import "../../chunk-YHT6CWIY.mjs";
21
- import "../../chunk-ZLQVRPDS.mjs";
21
+ import "../../chunk-EFL5OBKN.mjs";
22
22
  import "../../chunk-SKC7AJIV.mjs";
23
23
  export {
24
24
  CopilotKit,
@@ -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
  {