@copilotkit/react-ui 1.59.5 → 1.60.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/react-ui",
3
- "version": "1.59.5",
3
+ "version": "1.60.1",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "ai",
@@ -48,9 +48,9 @@
48
48
  "rehype-raw": "^7.0.0",
49
49
  "remark-gfm": "^4.0.1",
50
50
  "remark-math": "^6.0.0",
51
- "@copilotkit/react-core": "1.59.5",
52
- "@copilotkit/runtime-client-gql": "1.59.5",
53
- "@copilotkit/shared": "1.59.5"
51
+ "@copilotkit/runtime-client-gql": "1.60.1",
52
+ "@copilotkit/react-core": "1.60.1",
53
+ "@copilotkit/shared": "1.60.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.1.0",
@@ -30,10 +30,9 @@
30
30
  * ### With Observability Hooks
31
31
  *
32
32
  * To monitor user interactions, provide the `observabilityHooks` prop.
33
- * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.
34
33
  *
35
34
  * ```tsx
36
- * <CopilotKit publicApiKey="YOUR_PUBLIC_API_KEY">
35
+ * <CopilotKit>
37
36
  * <CopilotChat
38
37
  * observabilityHooks={{
39
38
  * onMessageSent: (message) => {
@@ -62,12 +61,8 @@
62
61
  * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
63
62
  */
64
63
 
65
- import {
66
- ChatContext,
67
- ChatContextProvider,
68
- CopilotChatIcons,
69
- CopilotChatLabels,
70
- } from "./ChatContext";
64
+ import type { CopilotChatIcons, CopilotChatLabels } from "./ChatContext";
65
+ import { ChatContext, ChatContextProvider } from "./ChatContext";
71
66
  import { Messages as DefaultMessages } from "./Messages";
72
67
  import { Input as DefaultInput } from "./Input";
73
68
  import { RenderMessage as DefaultRenderMessage } from "./messages/RenderMessage";
@@ -75,26 +70,25 @@ import { AssistantMessage as DefaultAssistantMessage } from "./messages/Assistan
75
70
  import { UserMessage as DefaultUserMessage } from "./messages/UserMessage";
76
71
  import { ImageRenderer as DefaultImageRenderer } from "./messages/ImageRenderer";
77
72
  import React, { useEffect, useRef, useState, useCallback } from "react";
73
+ import type { SystemMessageFunction } from "@copilotkit/react-core";
78
74
  import {
79
- SystemMessageFunction,
80
75
  useCopilotContext,
81
76
  useCopilotChatInternal,
82
- type OnStopGeneration,
83
- type OnReloadMessages,
84
- type ChatSuggestions,
77
+ } from "@copilotkit/react-core";
78
+ import type {
79
+ OnStopGeneration,
80
+ OnReloadMessages,
81
+ ChatSuggestions,
85
82
  } from "@copilotkit/react-core";
86
83
  import {
87
84
  CopilotKitError,
88
85
  CopilotKitErrorCode,
89
- CopilotErrorEvent,
90
- Message,
91
86
  Severity,
92
87
  ErrorVisibility,
93
88
  styledConsole,
94
- CopilotErrorHandler,
95
89
  randomUUID,
96
90
  } from "@copilotkit/shared";
97
- import {
91
+ import type {
98
92
  AssistantMessageProps,
99
93
  ChatError,
100
94
  ComponentsMap,
@@ -119,7 +113,12 @@ import {
119
113
  formatFileSize,
120
114
  deprecationWarning,
121
115
  } from "./attachment-utils";
122
- import type { InputContent } from "@copilotkit/shared";
116
+ import type {
117
+ InputContent,
118
+ CopilotErrorEvent,
119
+ Message,
120
+ CopilotErrorHandler,
121
+ } from "@copilotkit/shared";
123
122
  import { Suggestions as DefaultRenderSuggestionsList } from "./Suggestions";
124
123
 
125
124
  /**
@@ -354,7 +353,6 @@ export interface CopilotChatProps {
354
353
 
355
354
  /**
356
355
  * Event hooks for CopilotKit chat events.
357
- * These hooks only work when publicApiKey is provided.
358
356
  */
359
357
  observabilityHooks?: CopilotObservabilityHooks;
360
358
 
@@ -31,10 +31,9 @@
31
31
  * ### With Observability Hooks
32
32
  *
33
33
  * To monitor user interactions, provide the `observabilityHooks` prop.
34
- * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.
35
34
  *
36
35
  * ```tsx
37
- * <CopilotKit publicApiKey="YOUR_PUBLIC_API_KEY">
36
+ * <CopilotKit>
38
37
  * <CopilotPopup
39
38
  * observabilityHooks={{
40
39
  * onChatExpanded: () => {
@@ -66,7 +65,8 @@
66
65
  * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
67
66
  */
68
67
 
69
- import { CopilotModal, CopilotModalProps } from "./Modal";
68
+ import type { CopilotModalProps } from "./Modal";
69
+ import { CopilotModal } from "./Modal";
70
70
 
71
71
  export function CopilotPopup(props: CopilotModalProps) {
72
72
  props = {
@@ -33,10 +33,9 @@
33
33
  * ### With Observability Hooks
34
34
  *
35
35
  * To monitor user interactions, provide the `observabilityHooks` prop.
36
- * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.
37
36
  *
38
37
  * ```tsx
39
- * <CopilotKit publicApiKey="YOUR_PUBLIC_API_KEY">
38
+ * <CopilotKit>
40
39
  * <CopilotSidebar
41
40
  * observabilityHooks={{
42
41
  * onChatExpanded: () => {
@@ -70,7 +69,8 @@
70
69
  * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
71
70
  */
72
71
  import React, { useState } from "react";
73
- import { CopilotModal, CopilotModalProps } from "./Modal";
72
+ import type { CopilotModalProps } from "./Modal";
73
+ import { CopilotModal } from "./Modal";
74
74
 
75
75
  export function CopilotSidebar(props: CopilotModalProps) {
76
76
  props = {
@@ -1,12 +1,12 @@
1
- import {
1
+ import type {
2
2
  AIMessage,
3
3
  Message,
4
4
  UserMessage,
5
5
  CopilotErrorEvent,
6
6
  } from "@copilotkit/shared";
7
- import { CopilotChatSuggestion } from "../../types/suggestions";
8
- import { ReactNode } from "react";
9
- import { ImageData } from "@copilotkit/shared";
7
+ import type { CopilotChatSuggestion } from "../../types/suggestions";
8
+ import type { ReactNode } from "react";
9
+ import type { ImageData } from "@copilotkit/shared";
10
10
  import type { InputContentSource } from "@copilotkit/shared";
11
11
  import type {
12
12
  AttachmentsConfig,
@@ -19,7 +19,6 @@ export type { AttachmentsConfig, Attachment, AttachmentModality };
19
19
 
20
20
  /**
21
21
  * Event hooks for CopilotKit chat events.
22
- * These hooks only work when publicApiKey is provided.
23
22
  */
24
23
  export interface CopilotObservabilityHooks {
25
24
  /**