@copilotkit/react-core 1.10.6-next.3 → 1.10.6-next.4

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 (98) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{chunk-Q3MCVRO3.mjs → chunk-6ESSSQ7Q.mjs} +8 -21
  3. package/dist/chunk-6ESSSQ7Q.mjs.map +1 -0
  4. package/dist/{chunk-X5GRTEAW.mjs → chunk-6GPVUMBU.mjs} +2 -2
  5. package/dist/{chunk-H4AHA2Y7.mjs → chunk-AKR2SSUJ.mjs} +2 -2
  6. package/dist/{chunk-HPENLSA7.mjs → chunk-BXXJQ2BL.mjs} +8 -8
  7. package/dist/{chunk-M37URBJS.mjs → chunk-C6IANC2R.mjs} +6 -6
  8. package/dist/{chunk-CUWOXXM5.mjs → chunk-DXEQPN43.mjs} +2 -2
  9. package/dist/{chunk-O23SRQP6.mjs → chunk-E3624YDU.mjs} +2 -2
  10. package/dist/{chunk-GOYHJKDZ.mjs → chunk-EDBI5PCJ.mjs} +4 -4
  11. package/dist/{chunk-R4Y45UGQ.mjs → chunk-EVVO67QO.mjs} +2 -2
  12. package/dist/{chunk-U6EFKGUQ.mjs → chunk-GGLAHG3I.mjs} +13 -13
  13. package/dist/{chunk-3WUDRJTT.mjs → chunk-GT5WI3AF.mjs} +4 -4
  14. package/dist/{chunk-OXHA67SG.mjs → chunk-MIXSWZSB.mjs} +5 -5
  15. package/dist/{chunk-E6ER5C5U.mjs → chunk-MQYWH4E6.mjs} +2 -2
  16. package/dist/{chunk-L3I57GMV.mjs → chunk-N4VN2B5S.mjs} +4 -4
  17. package/dist/{chunk-E3DNTN4X.mjs → chunk-NSBAWITG.mjs} +8 -8
  18. package/dist/{chunk-K5CYESBQ.mjs → chunk-OAGAFMUM.mjs} +2 -2
  19. package/dist/{chunk-TUTNHDM3.mjs → chunk-OKCYPO4I.mjs} +4 -4
  20. package/dist/{chunk-R4YSN6OK.mjs → chunk-OT5NHMEC.mjs} +6 -6
  21. package/dist/{chunk-HI6SPUOX.mjs → chunk-T3376SZS.mjs} +4 -4
  22. package/dist/{chunk-GIGUZ2OK.mjs → chunk-U7QULEVO.mjs} +2 -2
  23. package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
  24. package/dist/components/copilot-provider/copilotkit.js +7 -17
  25. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  26. package/dist/components/copilot-provider/copilotkit.mjs +10 -10
  27. package/dist/components/copilot-provider/index.js +7 -17
  28. package/dist/components/copilot-provider/index.js.map +1 -1
  29. package/dist/components/copilot-provider/index.mjs +10 -10
  30. package/dist/components/dev-console/console-trigger.mjs +3 -3
  31. package/dist/components/dev-console/developer-console-modal.mjs +2 -2
  32. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  33. package/dist/components/index.js +7 -17
  34. package/dist/components/index.js.map +1 -1
  35. package/dist/components/index.mjs +10 -10
  36. package/dist/context/index.mjs +4 -4
  37. package/dist/hooks/index.js +7 -32
  38. package/dist/hooks/index.js.map +1 -1
  39. package/dist/hooks/index.mjs +42 -42
  40. package/dist/hooks/use-chat.js +7 -32
  41. package/dist/hooks/use-chat.js.map +1 -1
  42. package/dist/hooks/use-chat.mjs +3 -4
  43. package/dist/hooks/use-coagent-state-render.mjs +2 -2
  44. package/dist/hooks/use-coagent.js +7 -32
  45. package/dist/hooks/use-coagent.js.map +1 -1
  46. package/dist/hooks/use-coagent.mjs +15 -15
  47. package/dist/hooks/use-copilot-action.mjs +2 -2
  48. package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
  49. package/dist/hooks/use-copilot-chat-headless_c.js +7 -32
  50. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  51. package/dist/hooks/use-copilot-chat-headless_c.mjs +15 -15
  52. package/dist/hooks/use-copilot-chat.js +7 -32
  53. package/dist/hooks/use-copilot-chat.js.map +1 -1
  54. package/dist/hooks/use-copilot-chat.mjs +15 -15
  55. package/dist/hooks/use-copilot-chat_internal.js +7 -32
  56. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  57. package/dist/hooks/use-copilot-chat_internal.mjs +14 -14
  58. package/dist/hooks/use-copilot-runtime-client.js +7 -32
  59. package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
  60. package/dist/hooks/use-copilot-runtime-client.mjs +1 -2
  61. package/dist/hooks/use-default-tool.mjs +3 -3
  62. package/dist/hooks/use-frontend-tool.mjs +3 -3
  63. package/dist/hooks/use-human-in-the-loop.mjs +3 -3
  64. package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
  65. package/dist/hooks/use-langgraph-interrupt.js +7 -32
  66. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  67. package/dist/hooks/use-langgraph-interrupt.mjs +15 -15
  68. package/dist/hooks/use-render-tool-call.mjs +3 -3
  69. package/dist/index.js +7 -17
  70. package/dist/index.js.map +1 -1
  71. package/dist/index.mjs +47 -47
  72. package/dist/lib/copilot-task.mjs +12 -12
  73. package/dist/lib/index.mjs +12 -12
  74. package/dist/utils/extract.mjs +10 -10
  75. package/dist/utils/index.mjs +12 -12
  76. package/dist/utils/suggestions.mjs +10 -10
  77. package/package.json +3 -3
  78. package/src/hooks/use-copilot-runtime-client.ts +10 -21
  79. package/dist/chunk-Q3MCVRO3.mjs.map +0 -1
  80. /package/dist/{chunk-X5GRTEAW.mjs.map → chunk-6GPVUMBU.mjs.map} +0 -0
  81. /package/dist/{chunk-H4AHA2Y7.mjs.map → chunk-AKR2SSUJ.mjs.map} +0 -0
  82. /package/dist/{chunk-HPENLSA7.mjs.map → chunk-BXXJQ2BL.mjs.map} +0 -0
  83. /package/dist/{chunk-M37URBJS.mjs.map → chunk-C6IANC2R.mjs.map} +0 -0
  84. /package/dist/{chunk-CUWOXXM5.mjs.map → chunk-DXEQPN43.mjs.map} +0 -0
  85. /package/dist/{chunk-O23SRQP6.mjs.map → chunk-E3624YDU.mjs.map} +0 -0
  86. /package/dist/{chunk-GOYHJKDZ.mjs.map → chunk-EDBI5PCJ.mjs.map} +0 -0
  87. /package/dist/{chunk-R4Y45UGQ.mjs.map → chunk-EVVO67QO.mjs.map} +0 -0
  88. /package/dist/{chunk-U6EFKGUQ.mjs.map → chunk-GGLAHG3I.mjs.map} +0 -0
  89. /package/dist/{chunk-3WUDRJTT.mjs.map → chunk-GT5WI3AF.mjs.map} +0 -0
  90. /package/dist/{chunk-OXHA67SG.mjs.map → chunk-MIXSWZSB.mjs.map} +0 -0
  91. /package/dist/{chunk-E6ER5C5U.mjs.map → chunk-MQYWH4E6.mjs.map} +0 -0
  92. /package/dist/{chunk-L3I57GMV.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
  93. /package/dist/{chunk-E3DNTN4X.mjs.map → chunk-NSBAWITG.mjs.map} +0 -0
  94. /package/dist/{chunk-K5CYESBQ.mjs.map → chunk-OAGAFMUM.mjs.map} +0 -0
  95. /package/dist/{chunk-TUTNHDM3.mjs.map → chunk-OKCYPO4I.mjs.map} +0 -0
  96. /package/dist/{chunk-R4YSN6OK.mjs.map → chunk-OT5NHMEC.mjs.map} +0 -0
  97. /package/dist/{chunk-HI6SPUOX.mjs.map → chunk-T3376SZS.mjs.map} +0 -0
  98. /package/dist/{chunk-GIGUZ2OK.mjs.map → chunk-U7QULEVO.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # ui
2
2
 
3
+ ## 1.10.6-next.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 8626c5a: - fix: surface errors also in production
8
+ - Updated dependencies [8626c5a]
9
+ - @copilotkit/runtime-client-gql@1.10.6-next.4
10
+ - @copilotkit/shared@1.10.6-next.4
11
+
3
12
  ## 1.10.6-next.3
4
13
 
5
14
  ### Patch Changes
@@ -1,6 +1,3 @@
1
- import {
2
- shouldShowDevConsole
3
- } from "./chunk-ICIK2BSB.mjs";
4
1
  import {
5
2
  useToast
6
3
  } from "./chunk-EFL5OBKN.mjs";
@@ -62,15 +59,10 @@ var useCopilotRuntimeClient = (options) => {
62
59
  const routeError = (gqlError) => {
63
60
  const extensions = gqlError.extensions;
64
61
  const visibility = extensions == null ? void 0 : extensions.visibility;
65
- const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
66
62
  if (visibility === ErrorVisibility.SILENT) {
67
63
  console.error("CopilotKit Silent Error:", gqlError.message);
68
64
  return;
69
65
  }
70
- if (!isDev) {
71
- console.error("CopilotKit Error (hidden in production):", gqlError.message);
72
- return;
73
- }
74
66
  const now = Date.now();
75
67
  const errorMessage = gqlError.message;
76
68
  if (lastStructuredErrorRef.current && lastStructuredErrorRef.current.message === errorMessage && now - lastStructuredErrorRef.current.timestamp < 150) {
@@ -92,17 +84,12 @@ var useCopilotRuntimeClient = (options) => {
92
84
  };
93
85
  graphQLErrors.forEach(routeError);
94
86
  } else {
95
- const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
96
- if (!isDev) {
97
- console.error("CopilotKit Error (hidden in production):", error);
98
- } else {
99
- const fallbackError = new CopilotKitError({
100
- message: (error == null ? void 0 : error.message) || String(error),
101
- code: CopilotKitErrorCode.UNKNOWN
102
- });
103
- setBannerError(fallbackError);
104
- traceUIError(fallbackError, error);
105
- }
87
+ const fallbackError = new CopilotKitError({
88
+ message: (error == null ? void 0 : error.message) || String(error),
89
+ code: CopilotKitErrorCode.UNKNOWN
90
+ });
91
+ setBannerError(fallbackError);
92
+ traceUIError(fallbackError, error);
106
93
  }
107
94
  },
108
95
  handleGQLWarning: (message) => {
@@ -114,7 +101,7 @@ var useCopilotRuntimeClient = (options) => {
114
101
  setBannerError(warningError);
115
102
  }
116
103
  }));
117
- }, [runtimeOptions, setBannerError, showDevConsole, onError]);
104
+ }, [runtimeOptions, setBannerError, onError]);
118
105
  return runtimeClient;
119
106
  };
120
107
  function createStructuredError(gqlError) {
@@ -144,4 +131,4 @@ function createStructuredError(gqlError) {
144
131
  export {
145
132
  useCopilotRuntimeClient
146
133
  };
147
- //# sourceMappingURL=chunk-Q3MCVRO3.mjs.map
134
+ //# sourceMappingURL=chunk-6ESSSQ7Q.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/use-copilot-runtime-client.ts"],"sourcesContent":["import {\n CopilotRuntimeClient,\n CopilotRuntimeClientOptions,\n GraphQLError,\n} from \"@copilotkit/runtime-client-gql\";\nimport { useToast } from \"../components/toast/toast-provider\";\nimport { useMemo, useRef } from \"react\";\nimport {\n ErrorVisibility,\n CopilotKitApiDiscoveryError,\n CopilotKitRemoteEndpointDiscoveryError,\n CopilotKitAgentDiscoveryError,\n CopilotKitError,\n CopilotKitErrorCode,\n CopilotErrorHandler,\n CopilotErrorEvent,\n} from \"@copilotkit/shared\";\nimport { shouldShowDevConsole } from \"../utils/dev-console\";\n\nexport interface CopilotRuntimeClientHookOptions extends CopilotRuntimeClientOptions {\n showDevConsole?: boolean;\n onError: CopilotErrorHandler;\n}\n\nexport const useCopilotRuntimeClient = (options: CopilotRuntimeClientHookOptions) => {\n const { setBannerError } = useToast();\n const { showDevConsole, onError, ...runtimeOptions } = options;\n\n // Deduplication state for structured errors\n const lastStructuredErrorRef = useRef<{ message: string; timestamp: number } | null>(null);\n\n // Helper function to trace UI errors\n const traceUIError = async (error: CopilotKitError, originalError?: any) => {\n try {\n const errorEvent: CopilotErrorEvent = {\n type: \"error\",\n timestamp: Date.now(),\n context: {\n source: \"ui\",\n request: {\n operation: \"runtimeClient\",\n url: runtimeOptions.url,\n startTime: Date.now(),\n },\n technical: {\n environment: \"browser\",\n userAgent: typeof navigator !== \"undefined\" ? navigator.userAgent : undefined,\n stackTrace: originalError instanceof Error ? originalError.stack : undefined,\n },\n },\n error,\n };\n await onError(errorEvent);\n } catch (error) {\n console.error(\"Error in onError handler:\", error);\n }\n };\n\n const runtimeClient = useMemo(() => {\n return new CopilotRuntimeClient({\n ...runtimeOptions,\n handleGQLErrors: (error) => {\n if ((error as any).graphQLErrors?.length) {\n const graphQLErrors = (error as any).graphQLErrors as GraphQLError[];\n\n // Route all errors to banners for consistent UI\n const routeError = (gqlError: GraphQLError) => {\n const extensions = gqlError.extensions;\n const visibility = extensions?.visibility as ErrorVisibility;\n\n // Silent errors - just log\n if (visibility === ErrorVisibility.SILENT) {\n console.error(\"CopilotKit Silent Error:\", gqlError.message);\n return;\n }\n\n // All errors (including DEV_ONLY) show as banners for consistency\n // Deduplicate to prevent spam\n const now = Date.now();\n const errorMessage = gqlError.message;\n if (\n lastStructuredErrorRef.current &&\n lastStructuredErrorRef.current.message === errorMessage &&\n now - lastStructuredErrorRef.current.timestamp < 150\n ) {\n return; // Skip duplicate\n }\n lastStructuredErrorRef.current = { message: errorMessage, timestamp: now };\n\n const ckError = createStructuredError(gqlError);\n if (ckError) {\n setBannerError(ckError);\n // Trace the error\n traceUIError(ckError, gqlError);\n // TODO: if onError & renderError should work without key, insert here\n } else {\n // Fallback for unstructured errors\n const fallbackError = new CopilotKitError({\n message: gqlError.message,\n code: CopilotKitErrorCode.UNKNOWN,\n });\n setBannerError(fallbackError);\n // Trace the fallback error\n traceUIError(fallbackError, gqlError);\n // TODO: if onError & renderError should work without key, insert here\n }\n };\n\n // Process all errors as banners\n graphQLErrors.forEach(routeError);\n } else {\n // Route non-GraphQL errors to banner as well\n const fallbackError = new CopilotKitError({\n message: error?.message || String(error),\n code: CopilotKitErrorCode.UNKNOWN,\n });\n setBannerError(fallbackError);\n // Trace the non-GraphQL error\n traceUIError(fallbackError, error);\n // TODO: if onError & renderError should work without key, insert here\n }\n },\n handleGQLWarning: (message: string) => {\n console.warn(message);\n // Show warnings as banners too for consistency\n const warningError = new CopilotKitError({\n message,\n code: CopilotKitErrorCode.UNKNOWN,\n });\n setBannerError(warningError);\n },\n });\n }, [runtimeOptions, setBannerError, onError]);\n\n return runtimeClient;\n};\n\n// Create appropriate structured error from GraphQL error\nfunction createStructuredError(gqlError: GraphQLError): CopilotKitError | null {\n const extensions = gqlError.extensions;\n const originalError = extensions?.originalError as any;\n const message = originalError?.message || gqlError.message;\n const code = extensions?.code as CopilotKitErrorCode;\n\n if (code) {\n return new CopilotKitError({ message, code });\n }\n\n // Legacy error detection by stack trace\n if (originalError?.stack?.includes(\"CopilotApiDiscoveryError\")) {\n return new CopilotKitApiDiscoveryError({ message });\n }\n if (originalError?.stack?.includes(\"CopilotKitRemoteEndpointDiscoveryError\")) {\n return new CopilotKitRemoteEndpointDiscoveryError({ message });\n }\n if (originalError?.stack?.includes(\"CopilotKitAgentDiscoveryError\")) {\n return new CopilotKitAgentDiscoveryError({\n agentName: \"\",\n availableAgents: [],\n });\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EACE;AAAA,OAGK;AAEP,SAAS,SAAS,cAAc;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAQA,IAAM,0BAA0B,CAAC,YAA6C;AACnF,QAAM,EAAE,eAAe,IAAI,SAAS;AACpC,QAAuD,cAA/C,kBAAgB,QA1B1B,IA0ByD,IAAnB,2BAAmB,IAAnB,CAA5B,kBAAgB;AAGxB,QAAM,yBAAyB,OAAsD,IAAI;AAGzF,QAAM,eAAe,CAAO,OAAwB,kBAAwB;AAC1E,QAAI;AACF,YAAM,aAAgC;AAAA,QACpC,MAAM;AAAA,QACN,WAAW,KAAK,IAAI;AAAA,QACpB,SAAS;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,WAAW;AAAA,YACX,KAAK,eAAe;AAAA,YACpB,WAAW,KAAK,IAAI;AAAA,UACtB;AAAA,UACA,WAAW;AAAA,YACT,aAAa;AAAA,YACb,WAAW,OAAO,cAAc,cAAc,UAAU,YAAY;AAAA,YACpE,YAAY,yBAAyB,QAAQ,cAAc,QAAQ;AAAA,UACrE;AAAA,QACF;AAAA,QACA;AAAA,MACF;AACA,YAAM,QAAQ,UAAU;AAAA,IAC1B,SAASA,QAAP;AACA,cAAQ,MAAM,6BAA6BA,MAAK;AAAA,IAClD;AAAA,EACF;AAEA,QAAM,gBAAgB,QAAQ,MAAM;AAClC,WAAO,IAAI,qBAAqB,iCAC3B,iBAD2B;AAAA,MAE9B,iBAAiB,CAAC,UAAU;AA7DlC,YAAAC;AA8DQ,aAAKA,MAAA,MAAc,kBAAd,gBAAAA,IAA6B,QAAQ;AACxC,gBAAM,gBAAiB,MAAc;AAGrC,gBAAM,aAAa,CAAC,aAA2B;AAC7C,kBAAM,aAAa,SAAS;AAC5B,kBAAM,aAAa,yCAAY;AAG/B,gBAAI,eAAe,gBAAgB,QAAQ;AACzC,sBAAQ,MAAM,4BAA4B,SAAS,OAAO;AAC1D;AAAA,YACF;AAIA,kBAAM,MAAM,KAAK,IAAI;AACrB,kBAAM,eAAe,SAAS;AAC9B,gBACE,uBAAuB,WACvB,uBAAuB,QAAQ,YAAY,gBAC3C,MAAM,uBAAuB,QAAQ,YAAY,KACjD;AACA;AAAA,YACF;AACA,mCAAuB,UAAU,EAAE,SAAS,cAAc,WAAW,IAAI;AAEzE,kBAAM,UAAU,sBAAsB,QAAQ;AAC9C,gBAAI,SAAS;AACX,6BAAe,OAAO;AAEtB,2BAAa,SAAS,QAAQ;AAAA,YAEhC,OAAO;AAEL,oBAAM,gBAAgB,IAAI,gBAAgB;AAAA,gBACxC,SAAS,SAAS;AAAA,gBAClB,MAAM,oBAAoB;AAAA,cAC5B,CAAC;AACD,6BAAe,aAAa;AAE5B,2BAAa,eAAe,QAAQ;AAAA,YAEtC;AAAA,UACF;AAGA,wBAAc,QAAQ,UAAU;AAAA,QAClC,OAAO;AAEL,gBAAM,gBAAgB,IAAI,gBAAgB;AAAA,YACxC,UAAS,+BAAO,YAAW,OAAO,KAAK;AAAA,YACvC,MAAM,oBAAoB;AAAA,UAC5B,CAAC;AACD,yBAAe,aAAa;AAE5B,uBAAa,eAAe,KAAK;AAAA,QAEnC;AAAA,MACF;AAAA,MACA,kBAAkB,CAAC,YAAoB;AACrC,gBAAQ,KAAK,OAAO;AAEpB,cAAM,eAAe,IAAI,gBAAgB;AAAA,UACvC;AAAA,UACA,MAAM,oBAAoB;AAAA,QAC5B,CAAC;AACD,uBAAe,YAAY;AAAA,MAC7B;AAAA,IACF,EAAC;AAAA,EACH,GAAG,CAAC,gBAAgB,gBAAgB,OAAO,CAAC;AAE5C,SAAO;AACT;AAGA,SAAS,sBAAsB,UAAgD;AA1I/E;AA2IE,QAAM,aAAa,SAAS;AAC5B,QAAM,gBAAgB,yCAAY;AAClC,QAAM,WAAU,+CAAe,YAAW,SAAS;AACnD,QAAM,OAAO,yCAAY;AAEzB,MAAI,MAAM;AACR,WAAO,IAAI,gBAAgB,EAAE,SAAS,KAAK,CAAC;AAAA,EAC9C;AAGA,OAAI,oDAAe,UAAf,mBAAsB,SAAS,6BAA6B;AAC9D,WAAO,IAAI,4BAA4B,EAAE,QAAQ,CAAC;AAAA,EACpD;AACA,OAAI,oDAAe,UAAf,mBAAsB,SAAS,2CAA2C;AAC5E,WAAO,IAAI,uCAAuC,EAAE,QAAQ,CAAC;AAAA,EAC/D;AACA,OAAI,oDAAe,UAAf,mBAAsB,SAAS,kCAAkC;AACnE,WAAO,IAAI,8BAA8B;AAAA,MACvC,WAAW;AAAA,MACX,iBAAiB,CAAC;AAAA,IACpB,CAAC;AAAA,EACH;AAEA,SAAO;AACT;","names":["error","_a"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotAction
3
- } from "./chunk-HI6SPUOX.mjs";
3
+ } from "./chunk-T3376SZS.mjs";
4
4
 
5
5
  // src/hooks/use-frontend-tool.ts
6
6
  function useFrontendTool(tool, dependencies) {
@@ -10,4 +10,4 @@ function useFrontendTool(tool, dependencies) {
10
10
  export {
11
11
  useFrontendTool
12
12
  };
13
- //# sourceMappingURL=chunk-X5GRTEAW.mjs.map
13
+ //# sourceMappingURL=chunk-6GPVUMBU.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotAction
3
- } from "./chunk-HI6SPUOX.mjs";
3
+ } from "./chunk-T3376SZS.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -19,4 +19,4 @@ function useRenderToolCall(tool, dependencies) {
19
19
  export {
20
20
  useRenderToolCall
21
21
  };
22
- //# sourceMappingURL=chunk-H4AHA2Y7.mjs.map
22
+ //# sourceMappingURL=chunk-AKR2SSUJ.mjs.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  useCopilotChat
3
- } from "./chunk-E3DNTN4X.mjs";
3
+ } from "./chunk-NSBAWITG.mjs";
4
4
  import {
5
5
  useMessagesTap
6
- } from "./chunk-M37URBJS.mjs";
6
+ } from "./chunk-C6IANC2R.mjs";
7
+ import {
8
+ useCopilotRuntimeClient
9
+ } from "./chunk-6ESSSQ7Q.mjs";
7
10
  import {
8
11
  useAsyncCallback
9
12
  } from "./chunk-N4WEHORG.mjs";
10
13
  import {
11
- useCopilotRuntimeClient
12
- } from "./chunk-Q3MCVRO3.mjs";
14
+ useToast
15
+ } from "./chunk-EFL5OBKN.mjs";
13
16
  import {
14
17
  useCopilotContext
15
18
  } from "./chunk-EUX2P2E7.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-HPENLSA7.mjs.map
239
+ //# sourceMappingURL=chunk-BXXJQ2BL.mjs.map
@@ -1,15 +1,15 @@
1
- import {
2
- CopilotMessagesContext
3
- } from "./chunk-ZLQVRPDS.mjs";
4
1
  import {
5
2
  shouldShowDevConsole
6
3
  } from "./chunk-ICIK2BSB.mjs";
4
+ import {
5
+ useToast
6
+ } from "./chunk-EFL5OBKN.mjs";
7
7
  import {
8
8
  useCopilotContext
9
9
  } from "./chunk-EUX2P2E7.mjs";
10
10
  import {
11
- useToast
12
- } from "./chunk-EFL5OBKN.mjs";
11
+ CopilotMessagesContext
12
+ } from "./chunk-ZLQVRPDS.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-M37URBJS.mjs.map
222
+ //# sourceMappingURL=chunk-C6IANC2R.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DeveloperConsoleModal
3
- } from "./chunk-TUTNHDM3.mjs";
3
+ } from "./chunk-OKCYPO4I.mjs";
4
4
  import {
5
5
  CopilotKitIcon
6
6
  } from "./chunk-PIF5KJYI.mjs";
@@ -228,4 +228,4 @@ function ConsoleTrigger({ position = "bottom-right" }) {
228
228
  export {
229
229
  ConsoleTrigger
230
230
  };
231
- //# sourceMappingURL=chunk-CUWOXXM5.mjs.map
231
+ //# sourceMappingURL=chunk-DXEQPN43.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotChat
3
- } from "./chunk-E3DNTN4X.mjs";
3
+ } from "./chunk-NSBAWITG.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-O23SRQP6.mjs.map
34
+ //# sourceMappingURL=chunk-E3624YDU.mjs.map
@@ -1,9 +1,9 @@
1
- import {
2
- defaultCopilotContextCategories
3
- } from "./chunk-U6EFKGUQ.mjs";
4
1
  import {
5
2
  processActionsForRuntimeRequest
6
3
  } from "./chunk-4CEQJ2X6.mjs";
4
+ import {
5
+ defaultCopilotContextCategories
6
+ } from "./chunk-GGLAHG3I.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-GOYHJKDZ.mjs.map
120
+ //# sourceMappingURL=chunk-EDBI5PCJ.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotAction
3
- } from "./chunk-HI6SPUOX.mjs";
3
+ } from "./chunk-T3376SZS.mjs";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadProps,
@@ -22,4 +22,4 @@ function useHumanInTheLoop(tool, dependencies) {
22
22
  export {
23
23
  useHumanInTheLoop
24
24
  };
25
- //# sourceMappingURL=chunk-R4Y45UGQ.mjs.map
25
+ //# sourceMappingURL=chunk-EVVO67QO.mjs.map
@@ -1,35 +1,35 @@
1
1
  import {
2
2
  ConsoleTrigger
3
- } from "./chunk-CUWOXXM5.mjs";
3
+ } from "./chunk-DXEQPN43.mjs";
4
4
  import {
5
5
  CopilotErrorBoundary
6
- } from "./chunk-L3I57GMV.mjs";
6
+ } from "./chunk-N4VN2B5S.mjs";
7
7
  import {
8
8
  CopilotMessages,
9
9
  MessagesTapProvider
10
- } from "./chunk-M37URBJS.mjs";
10
+ } from "./chunk-C6IANC2R.mjs";
11
+ import {
12
+ shouldShowDevConsole
13
+ } from "./chunk-ICIK2BSB.mjs";
11
14
  import {
12
15
  use_tree_default
13
16
  } from "./chunk-RKTVJRK7.mjs";
14
17
  import {
15
18
  use_flat_category_store_default
16
19
  } from "./chunk-5FHSUKQL.mjs";
20
+ import {
21
+ useCopilotRuntimeClient
22
+ } from "./chunk-6ESSSQ7Q.mjs";
23
+ import {
24
+ ToastProvider
25
+ } from "./chunk-EFL5OBKN.mjs";
17
26
  import {
18
27
  UsageBanner,
19
28
  getErrorActions
20
29
  } from "./chunk-6ZLPNY7X.mjs";
21
- import {
22
- useCopilotRuntimeClient
23
- } from "./chunk-Q3MCVRO3.mjs";
24
- import {
25
- shouldShowDevConsole
26
- } from "./chunk-ICIK2BSB.mjs";
27
30
  import {
28
31
  CopilotContext
29
32
  } from "./chunk-EUX2P2E7.mjs";
30
- import {
31
- ToastProvider
32
- } from "./chunk-EFL5OBKN.mjs";
33
33
  import {
34
34
  __async,
35
35
  __objRest,
@@ -801,4 +801,4 @@ export {
801
801
  CopilotKitInternal,
802
802
  defaultCopilotContextCategories
803
803
  };
804
- //# sourceMappingURL=chunk-U6EFKGUQ.mjs.map
804
+ //# sourceMappingURL=chunk-GGLAHG3I.mjs.map
@@ -1,9 +1,9 @@
1
- import {
2
- CopilotContext
3
- } from "./chunk-EUX2P2E7.mjs";
4
1
  import {
5
2
  useToast
6
3
  } from "./chunk-EFL5OBKN.mjs";
4
+ import {
5
+ CopilotContext
6
+ } from "./chunk-EUX2P2E7.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-3WUDRJTT.mjs.map
88
+ //# sourceMappingURL=chunk-GT5WI3AF.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useCopilotChat
3
- } from "./chunk-E3DNTN4X.mjs";
4
- import {
5
- CopilotContext
6
- } from "./chunk-EUX2P2E7.mjs";
3
+ } from "./chunk-NSBAWITG.mjs";
7
4
  import {
8
5
  useToast
9
6
  } from "./chunk-EFL5OBKN.mjs";
7
+ import {
8
+ CopilotContext
9
+ } from "./chunk-EUX2P2E7.mjs";
10
10
  import {
11
11
  __spreadProps,
12
12
  __spreadValues
@@ -68,4 +68,4 @@ function useLangGraphInterrupt(action, dependencies) {
68
68
  export {
69
69
  useLangGraphInterrupt
70
70
  };
71
- //# sourceMappingURL=chunk-OXHA67SG.mjs.map
71
+ //# sourceMappingURL=chunk-MIXSWZSB.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotAction
3
- } from "./chunk-HI6SPUOX.mjs";
3
+ } from "./chunk-T3376SZS.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -14,4 +14,4 @@ function useDefaultTool(tool, dependencies) {
14
14
  export {
15
15
  useDefaultTool
16
16
  };
17
- //# sourceMappingURL=chunk-E6ER5C5U.mjs.map
17
+ //# sourceMappingURL=chunk-MQYWH4E6.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";
4
7
  import {
5
8
  UsageBanner,
6
9
  getErrorActions
7
10
  } 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-L3I57GMV.mjs.map
83
+ //# sourceMappingURL=chunk-N4VN2B5S.mjs.map
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  useLangGraphInterruptRender
3
3
  } from "./chunk-ZVOLWJCY.mjs";
4
+ import {
5
+ useChat
6
+ } from "./chunk-OT5NHMEC.mjs";
4
7
  import {
5
8
  defaultCopilotContextCategories,
6
9
  reloadSuggestions
7
- } from "./chunk-U6EFKGUQ.mjs";
8
- import {
9
- useCopilotMessagesContext
10
- } from "./chunk-ZLQVRPDS.mjs";
11
- import {
12
- useChat
13
- } from "./chunk-R4YSN6OK.mjs";
10
+ } from "./chunk-GGLAHG3I.mjs";
14
11
  import {
15
12
  useAsyncCallback
16
13
  } from "./chunk-N4WEHORG.mjs";
17
14
  import {
18
15
  useCopilotContext
19
16
  } from "./chunk-EUX2P2E7.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-E3DNTN4X.mjs.map
332
+ //# sourceMappingURL=chunk-NSBAWITG.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotChat
3
- } from "./chunk-E3DNTN4X.mjs";
3
+ } from "./chunk-NSBAWITG.mjs";
4
4
  import {
5
5
  useCopilotContext
6
6
  } from "./chunk-EUX2P2E7.mjs";
@@ -82,4 +82,4 @@ function useCopilotChatHeadless_c(options = {}) {
82
82
  export {
83
83
  useCopilotChatHeadless_c
84
84
  };
85
- //# sourceMappingURL=chunk-K5CYESBQ.mjs.map
85
+ //# sourceMappingURL=chunk-OAGAFMUM.mjs.map
@@ -3,12 +3,12 @@ import {
3
3
  CopilotKitIcon,
4
4
  ExclamationMarkTriangleIcon
5
5
  } from "./chunk-PIF5KJYI.mjs";
6
- import {
7
- useCopilotMessagesContext
8
- } from "./chunk-ZLQVRPDS.mjs";
9
6
  import {
10
7
  useCopilotContext
11
8
  } from "./chunk-EUX2P2E7.mjs";
9
+ import {
10
+ useCopilotMessagesContext
11
+ } from "./chunk-ZLQVRPDS.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-TUTNHDM3.mjs.map
759
+ //# sourceMappingURL=chunk-OKCYPO4I.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-6ESSSQ7Q.mjs";
4
7
  import {
5
8
  useAsyncCallback,
6
9
  useErrorToast
7
10
  } from "./chunk-N4WEHORG.mjs";
8
11
  import {
9
- useCopilotRuntimeClient
10
- } from "./chunk-Q3MCVRO3.mjs";
12
+ useToast
13
+ } from "./chunk-EFL5OBKN.mjs";
11
14
  import {
12
15
  useCopilotContext
13
16
  } from "./chunk-EUX2P2E7.mjs";
14
- import {
15
- useToast
16
- } from "./chunk-EFL5OBKN.mjs";
17
17
  import {
18
18
  __async,
19
19
  __spreadProps,
@@ -720,4 +720,4 @@ function getPairedFeAction(actions, message) {
720
720
  export {
721
721
  useChat
722
722
  };
723
- //# sourceMappingURL=chunk-R4YSN6OK.mjs.map
723
+ //# sourceMappingURL=chunk-OT5NHMEC.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAsyncCallback
3
3
  } from "./chunk-N4WEHORG.mjs";
4
- import {
5
- useCopilotContext
6
- } from "./chunk-EUX2P2E7.mjs";
7
4
  import {
8
5
  useToast
9
6
  } from "./chunk-EFL5OBKN.mjs";
7
+ import {
8
+ useCopilotContext
9
+ } from "./chunk-EUX2P2E7.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-HI6SPUOX.mjs.map
142
+ //# sourceMappingURL=chunk-T3376SZS.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotAction
3
- } from "./chunk-HI6SPUOX.mjs";
3
+ } from "./chunk-T3376SZS.mjs";
4
4
  import {
5
5
  useCopilotContext
6
6
  } from "./chunk-EUX2P2E7.mjs";
@@ -56,4 +56,4 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
56
56
  export {
57
57
  useCopilotAuthenticatedAction_c
58
58
  };
59
- //# sourceMappingURL=chunk-GIGUZ2OK.mjs.map
59
+ //# sourceMappingURL=chunk-U7QULEVO.mjs.map
@@ -2,11 +2,11 @@ import {
2
2
  CopilotMessages,
3
3
  MessagesTapProvider,
4
4
  useMessagesTap
5
- } from "../../chunk-M37URBJS.mjs";
6
- import "../../chunk-ZLQVRPDS.mjs";
5
+ } from "../../chunk-C6IANC2R.mjs";
7
6
  import "../../chunk-ICIK2BSB.mjs";
8
- import "../../chunk-EUX2P2E7.mjs";
9
7
  import "../../chunk-EFL5OBKN.mjs";
8
+ import "../../chunk-EUX2P2E7.mjs";
9
+ import "../../chunk-ZLQVRPDS.mjs";
10
10
  import "../../chunk-SKC7AJIV.mjs";
11
11
  export {
12
12
  CopilotMessages,
@@ -1153,15 +1153,10 @@ var useCopilotRuntimeClient = (options) => {
1153
1153
  const routeError = (gqlError) => {
1154
1154
  const extensions = gqlError.extensions;
1155
1155
  const visibility = extensions == null ? void 0 : extensions.visibility;
1156
- const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
1157
1156
  if (visibility === import_shared6.ErrorVisibility.SILENT) {
1158
1157
  console.error("CopilotKit Silent Error:", gqlError.message);
1159
1158
  return;
1160
1159
  }
1161
- if (!isDev) {
1162
- console.error("CopilotKit Error (hidden in production):", gqlError.message);
1163
- return;
1164
- }
1165
1160
  const now = Date.now();
1166
1161
  const errorMessage = gqlError.message;
1167
1162
  if (lastStructuredErrorRef.current && lastStructuredErrorRef.current.message === errorMessage && now - lastStructuredErrorRef.current.timestamp < 150) {
@@ -1183,17 +1178,12 @@ var useCopilotRuntimeClient = (options) => {
1183
1178
  };
1184
1179
  graphQLErrors.forEach(routeError);
1185
1180
  } else {
1186
- const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
1187
- if (!isDev) {
1188
- console.error("CopilotKit Error (hidden in production):", error);
1189
- } else {
1190
- const fallbackError = new import_shared6.CopilotKitError({
1191
- message: (error == null ? void 0 : error.message) || String(error),
1192
- code: import_shared6.CopilotKitErrorCode.UNKNOWN
1193
- });
1194
- setBannerError(fallbackError);
1195
- traceUIError(fallbackError, error);
1196
- }
1181
+ const fallbackError = new import_shared6.CopilotKitError({
1182
+ message: (error == null ? void 0 : error.message) || String(error),
1183
+ code: import_shared6.CopilotKitErrorCode.UNKNOWN
1184
+ });
1185
+ setBannerError(fallbackError);
1186
+ traceUIError(fallbackError, error);
1197
1187
  }
1198
1188
  },
1199
1189
  handleGQLWarning: (message) => {
@@ -1205,7 +1195,7 @@ var useCopilotRuntimeClient = (options) => {
1205
1195
  setBannerError(warningError);
1206
1196
  }
1207
1197
  }));
1208
- }, [runtimeOptions, setBannerError, showDevConsole, onError]);
1198
+ }, [runtimeOptions, setBannerError, onError]);
1209
1199
  return runtimeClient;
1210
1200
  };
1211
1201
  function createStructuredError(gqlError) {