@yourgpt/copilot-sdk 2.1.5-alpha.1 → 2.1.5-alpha.2
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/dist/{chunk-4QXY2PBG.js → chunk-3AONOZLY.js} +2 -2
- package/dist/{chunk-4QXY2PBG.js.map → chunk-3AONOZLY.js.map} +1 -1
- package/dist/{chunk-JKGFQUHJ.cjs → chunk-MDS23G2S.cjs} +5 -5
- package/dist/{chunk-JKGFQUHJ.cjs.map → chunk-MDS23G2S.cjs.map} +1 -1
- package/dist/{chunk-5Q72LZ5H.js → chunk-PT2TOHG5.js} +7 -3
- package/dist/chunk-PT2TOHG5.js.map +1 -0
- package/dist/{chunk-ENFWM3EY.js → chunk-RKGRQRZU.js} +3 -3
- package/dist/{chunk-ENFWM3EY.js.map → chunk-RKGRQRZU.js.map} +1 -1
- package/dist/{chunk-IXWNDR7H.cjs → chunk-TCPAT3WG.cjs} +35 -31
- package/dist/chunk-TCPAT3WG.cjs.map +1 -0
- package/dist/{chunk-246B6X5D.cjs → chunk-TPB7XED6.cjs} +2 -2
- package/dist/{chunk-246B6X5D.cjs.map → chunk-TPB7XED6.cjs.map} +1 -1
- package/dist/{chunk-I3SQUNTT.cjs → chunk-WIXFZUEZ.cjs} +23 -23
- package/dist/{chunk-I3SQUNTT.cjs.map → chunk-WIXFZUEZ.cjs.map} +1 -1
- package/dist/{chunk-UXJ6LIZB.js → chunk-WZ2TOZ7M.js} +4 -4
- package/dist/{chunk-UXJ6LIZB.js.map → chunk-WZ2TOZ7M.js.map} +1 -1
- package/dist/core/index.cjs +82 -82
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +3 -3
- package/dist/{index-CiExk87c.d.cts → index-CzJB8Ddo.d.cts} +1 -1
- package/dist/{index-Dwrcf-CP.d.ts → index-D7169xuR.d.ts} +1 -1
- package/dist/mcp/index.d.cts +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/react/index.cjs +65 -65
- package/dist/react/index.d.cts +8 -4
- package/dist/react/index.d.ts +8 -4
- package/dist/react/index.js +4 -4
- package/dist/styles.css +43 -0
- package/dist/tools/anthropic/index.d.cts +1 -1
- package/dist/tools/anthropic/index.d.ts +1 -1
- package/dist/tools/brave/index.cjs +2 -2
- package/dist/tools/brave/index.d.cts +1 -1
- package/dist/tools/brave/index.d.ts +1 -1
- package/dist/tools/brave/index.js +1 -1
- package/dist/tools/exa/index.cjs +2 -2
- package/dist/tools/exa/index.d.cts +1 -1
- package/dist/tools/exa/index.d.ts +1 -1
- package/dist/tools/exa/index.js +1 -1
- package/dist/tools/google/index.cjs +2 -2
- package/dist/tools/google/index.d.cts +1 -1
- package/dist/tools/google/index.d.ts +1 -1
- package/dist/tools/google/index.js +1 -1
- package/dist/tools/openai/index.cjs +2 -2
- package/dist/tools/openai/index.d.cts +1 -1
- package/dist/tools/openai/index.d.ts +1 -1
- package/dist/tools/openai/index.js +1 -1
- package/dist/tools/searxng/index.cjs +2 -2
- package/dist/tools/searxng/index.d.cts +1 -1
- package/dist/tools/searxng/index.d.ts +1 -1
- package/dist/tools/searxng/index.js +1 -1
- package/dist/tools/serper/index.cjs +2 -2
- package/dist/tools/serper/index.d.cts +1 -1
- package/dist/tools/serper/index.d.ts +1 -1
- package/dist/tools/serper/index.js +1 -1
- package/dist/tools/tavily/index.cjs +2 -2
- package/dist/tools/tavily/index.d.cts +1 -1
- package/dist/tools/tavily/index.d.ts +1 -1
- package/dist/tools/tavily/index.js +1 -1
- package/dist/tools/web-search/index.cjs +3 -3
- package/dist/tools/web-search/index.d.cts +2 -2
- package/dist/tools/web-search/index.d.ts +2 -2
- package/dist/tools/web-search/index.js +2 -2
- package/dist/{tools-DHZhF5km.d.cts → tools-tmksfhUo.d.cts} +9 -0
- package/dist/{tools-DHZhF5km.d.ts → tools-tmksfhUo.d.ts} +9 -0
- package/dist/{types-BdX7uPj0.d.cts → types-BLw7mxtW.d.cts} +1 -1
- package/dist/{types-BTyJu0WD.d.ts → types-BqwW3Baj.d.ts} +1 -1
- package/dist/ui/index.cjs +291 -301
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +40 -56
- package/dist/ui/index.d.ts +40 -56
- package/dist/ui/index.js +238 -248
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-5Q72LZ5H.js.map +0 -1
- package/dist/chunk-IXWNDR7H.cjs.map +0 -1
package/dist/ui/index.d.cts
CHANGED
|
@@ -8,7 +8,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
8
8
|
import * as use_stick_to_bottom from 'use-stick-to-bottom';
|
|
9
9
|
import { d as WebSearchResult, f as WebSearchResponse } from '../types-ZguuKEs_.cjs';
|
|
10
10
|
import { a as Thread, c as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-BeFBBZ5i.cjs';
|
|
11
|
-
import { T as ToolDefinition } from '../tools-
|
|
11
|
+
import { T as ToolDefinition } from '../tools-tmksfhUo.cjs';
|
|
12
12
|
import { B as BranchInfo } from '../MessageTree-CoIt_4nB.cjs';
|
|
13
13
|
import { d as MCPUIIntent, n as MCPUIFrameProps, M as MCPUIResource } from '../types-B20VCJXL.cjs';
|
|
14
14
|
import { ClassValue } from 'clsx';
|
|
@@ -742,83 +742,30 @@ interface SimpleConfirmationProps {
|
|
|
742
742
|
*/
|
|
743
743
|
declare function SimpleConfirmation({ state, message, onApprove, onReject, rejectLabel, approveLabel, className, }: SimpleConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
744
744
|
|
|
745
|
-
/**
|
|
746
|
-
* Permission level for tool execution
|
|
747
|
-
*/
|
|
748
745
|
type PermissionLevel = "ask" | "allow_always" | "deny_always" | "session";
|
|
749
|
-
/**
|
|
750
|
-
* Permission option for dropdown/selection
|
|
751
|
-
*/
|
|
752
746
|
interface PermissionOption {
|
|
753
747
|
value: PermissionLevel;
|
|
754
748
|
label: string;
|
|
755
749
|
description?: string;
|
|
756
750
|
}
|
|
757
|
-
/**
|
|
758
|
-
* Default permission options
|
|
759
|
-
*/
|
|
760
751
|
declare const DEFAULT_PERMISSION_OPTIONS: PermissionOption[];
|
|
761
752
|
type ConfirmationState = "pending" | "approved" | "rejected";
|
|
762
753
|
interface PermissionConfirmationProps {
|
|
763
|
-
/** Current state: pending, approved, or rejected */
|
|
764
754
|
state: ConfirmationState;
|
|
765
|
-
/** Tool name */
|
|
766
755
|
toolName?: string;
|
|
767
|
-
/** Message to display */
|
|
768
756
|
message?: string;
|
|
769
|
-
/** Called when user approves with permission level */
|
|
770
757
|
onApprove?: (permissionLevel: PermissionLevel) => void;
|
|
771
|
-
/** Called when user rejects with permission level */
|
|
772
758
|
onReject?: (permissionLevel?: PermissionLevel) => void;
|
|
773
|
-
/** Show permission options (default: true) */
|
|
774
|
-
showPermissionOptions?: boolean;
|
|
775
|
-
/** Available permission options */
|
|
776
|
-
permissionOptions?: PermissionOption[];
|
|
777
|
-
/** Additional class name */
|
|
778
759
|
className?: string;
|
|
779
760
|
}
|
|
780
|
-
|
|
781
|
-
* PermissionConfirmation - Enhanced confirmation with permission level selection
|
|
782
|
-
*
|
|
783
|
-
* Shows a confirmation dialog for tool approval with options to remember the choice.
|
|
784
|
-
*
|
|
785
|
-
* @example
|
|
786
|
-
* ```tsx
|
|
787
|
-
* <PermissionConfirmation
|
|
788
|
-
* state="pending"
|
|
789
|
-
* toolName="capture_screenshot"
|
|
790
|
-
* message="Take a screenshot of the current screen?"
|
|
791
|
-
* onApprove={(level) => approveToolExecution(tool.id, level)}
|
|
792
|
-
* onReject={(level) => rejectToolExecution(tool.id, undefined, level)}
|
|
793
|
-
* />
|
|
794
|
-
* ```
|
|
795
|
-
*/
|
|
796
|
-
declare function PermissionConfirmation({ state, toolName, message, onApprove, onReject, showPermissionOptions, permissionOptions, className, }: PermissionConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
761
|
+
declare function PermissionConfirmation({ state, toolName, message, onApprove, onReject, className, }: PermissionConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
797
762
|
interface CompactPermissionConfirmationProps {
|
|
798
|
-
/** Current state: pending, approved, or rejected */
|
|
799
763
|
state: ConfirmationState;
|
|
800
|
-
/** Message to display */
|
|
801
764
|
message?: string;
|
|
802
|
-
/** Called when user approves */
|
|
803
765
|
onApprove?: (permissionLevel: PermissionLevel) => void;
|
|
804
|
-
/** Called when user rejects */
|
|
805
766
|
onReject?: (permissionLevel?: PermissionLevel) => void;
|
|
806
|
-
/** Additional class name */
|
|
807
767
|
className?: string;
|
|
808
768
|
}
|
|
809
|
-
/**
|
|
810
|
-
* CompactPermissionConfirmation - Simpler version with "Don't ask again" checkbox
|
|
811
|
-
*
|
|
812
|
-
* @example
|
|
813
|
-
* ```tsx
|
|
814
|
-
* <CompactPermissionConfirmation
|
|
815
|
-
* state="pending"
|
|
816
|
-
* message="Take a screenshot?"
|
|
817
|
-
* onApprove={(level) => approveToolExecution(tool.id, level)}
|
|
818
|
-
* onReject={(level) => rejectToolExecution(tool.id, undefined, level)}
|
|
819
|
-
* />
|
|
820
|
-
* ```
|
|
821
|
-
*/
|
|
822
769
|
declare function CompactPermissionConfirmation({ state, message, onApprove, onReject, className, }: CompactPermissionConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
823
770
|
|
|
824
771
|
type FollowUpProps = {
|
|
@@ -1299,6 +1246,8 @@ interface ToolExecutionData {
|
|
|
1299
1246
|
duration?: number;
|
|
1300
1247
|
/** Approval status for human-in-the-loop tools */
|
|
1301
1248
|
approvalStatus?: ToolApprovalStatus;
|
|
1249
|
+
/** Title shown in approval UI */
|
|
1250
|
+
approvalTitle?: string;
|
|
1302
1251
|
/** Message shown in approval UI */
|
|
1303
1252
|
approvalMessage?: string;
|
|
1304
1253
|
/** Data passed from user's approval action (e.g., selected item) */
|
|
@@ -1440,6 +1389,10 @@ interface ToolRendererProps {
|
|
|
1440
1389
|
error?: string;
|
|
1441
1390
|
/** Approval status for tools requiring confirmation */
|
|
1442
1391
|
approvalStatus?: ToolApprovalStatus;
|
|
1392
|
+
/** Title shown in approval UI */
|
|
1393
|
+
approvalTitle?: string;
|
|
1394
|
+
/** Message shown in approval UI */
|
|
1395
|
+
approvalMessage?: string;
|
|
1443
1396
|
/** Data passed from user's approval action */
|
|
1444
1397
|
approvalData?: Record<string, unknown>;
|
|
1445
1398
|
/** Tool source (mcp, native, custom) - useful for MCP tool identification */
|
|
@@ -1659,6 +1612,37 @@ type ChatProps = {
|
|
|
1659
1612
|
onApproveToolExecution?: (executionId: string, extraData?: Record<string, unknown>, permissionLevel?: PermissionLevel) => void;
|
|
1660
1613
|
/** Called when user rejects a tool execution */
|
|
1661
1614
|
onRejectToolExecution?: (executionId: string, reason?: string, permissionLevel?: PermissionLevel) => void;
|
|
1615
|
+
/**
|
|
1616
|
+
* Custom message list view.
|
|
1617
|
+
* Gives full control over how the message list is rendered.
|
|
1618
|
+
* Receives pre-rendered `messageElements` (default SDK output) and raw `messages`
|
|
1619
|
+
* so you can inject custom UI, reorder, or conditionally replace messages.
|
|
1620
|
+
*
|
|
1621
|
+
* @example
|
|
1622
|
+
* ```tsx
|
|
1623
|
+
* <CopilotChat
|
|
1624
|
+
* messageView={{
|
|
1625
|
+
* children: ({ messageElements, messages }) => (
|
|
1626
|
+
* <>
|
|
1627
|
+
* {messages.map((msg, i) =>
|
|
1628
|
+
* msg.metadata?.type === "plan"
|
|
1629
|
+
* ? <PlanCard key={msg.id} data={msg.metadata} />
|
|
1630
|
+
* : messageElements[i]
|
|
1631
|
+
* )}
|
|
1632
|
+
* </>
|
|
1633
|
+
* )
|
|
1634
|
+
* }}
|
|
1635
|
+
* />
|
|
1636
|
+
* ```
|
|
1637
|
+
*/
|
|
1638
|
+
messageView?: {
|
|
1639
|
+
children?: (props: {
|
|
1640
|
+
/** Raw messages array */
|
|
1641
|
+
messages: ChatMessage[];
|
|
1642
|
+
/** Pre-rendered message elements (default SDK rendering) */
|
|
1643
|
+
messageElements: React__default.ReactNode[];
|
|
1644
|
+
}) => React__default.ReactNode;
|
|
1645
|
+
};
|
|
1662
1646
|
/** Custom message renderer */
|
|
1663
1647
|
renderMessage?: (message: ChatMessage, index: number) => React__default.ReactNode;
|
|
1664
1648
|
/** Custom input renderer (replaces entire input area) */
|
|
@@ -1825,7 +1809,7 @@ declare function BackButton({ className, children, disabled, "aria-label": ariaL
|
|
|
1825
1809
|
*/
|
|
1826
1810
|
type ThreadPickerCompoundProps = Omit<ThreadPickerProps, "value" | "threads" | "onSelect" | "onNewThread" | "onDeleteThread" | "disabled">;
|
|
1827
1811
|
declare function ThreadPickerCompound(props: ThreadPickerCompoundProps): react_jsx_runtime.JSX.Element | null;
|
|
1828
|
-
declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, fallbackToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, groupConsecutiveMessages, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, getBranchInfo, onSwitchBranch, onEditMessage, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1812
|
+
declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, fallbackToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, messageView, renderMessage, renderInput, renderHeader, groupConsecutiveMessages, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, getBranchInfo, onSwitchBranch, onEditMessage, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1829
1813
|
/**
|
|
1830
1814
|
* Chat component with compound component pattern.
|
|
1831
1815
|
*
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
8
8
|
import * as use_stick_to_bottom from 'use-stick-to-bottom';
|
|
9
9
|
import { d as WebSearchResult, f as WebSearchResponse } from '../types-ZguuKEs_.js';
|
|
10
10
|
import { a as Thread, c as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-BeFBBZ5i.js';
|
|
11
|
-
import { T as ToolDefinition } from '../tools-
|
|
11
|
+
import { T as ToolDefinition } from '../tools-tmksfhUo.js';
|
|
12
12
|
import { B as BranchInfo } from '../MessageTree-CzaN9Eul.js';
|
|
13
13
|
import { d as MCPUIIntent, n as MCPUIFrameProps, M as MCPUIResource } from '../types-B20VCJXL.js';
|
|
14
14
|
import { ClassValue } from 'clsx';
|
|
@@ -742,83 +742,30 @@ interface SimpleConfirmationProps {
|
|
|
742
742
|
*/
|
|
743
743
|
declare function SimpleConfirmation({ state, message, onApprove, onReject, rejectLabel, approveLabel, className, }: SimpleConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
744
744
|
|
|
745
|
-
/**
|
|
746
|
-
* Permission level for tool execution
|
|
747
|
-
*/
|
|
748
745
|
type PermissionLevel = "ask" | "allow_always" | "deny_always" | "session";
|
|
749
|
-
/**
|
|
750
|
-
* Permission option for dropdown/selection
|
|
751
|
-
*/
|
|
752
746
|
interface PermissionOption {
|
|
753
747
|
value: PermissionLevel;
|
|
754
748
|
label: string;
|
|
755
749
|
description?: string;
|
|
756
750
|
}
|
|
757
|
-
/**
|
|
758
|
-
* Default permission options
|
|
759
|
-
*/
|
|
760
751
|
declare const DEFAULT_PERMISSION_OPTIONS: PermissionOption[];
|
|
761
752
|
type ConfirmationState = "pending" | "approved" | "rejected";
|
|
762
753
|
interface PermissionConfirmationProps {
|
|
763
|
-
/** Current state: pending, approved, or rejected */
|
|
764
754
|
state: ConfirmationState;
|
|
765
|
-
/** Tool name */
|
|
766
755
|
toolName?: string;
|
|
767
|
-
/** Message to display */
|
|
768
756
|
message?: string;
|
|
769
|
-
/** Called when user approves with permission level */
|
|
770
757
|
onApprove?: (permissionLevel: PermissionLevel) => void;
|
|
771
|
-
/** Called when user rejects with permission level */
|
|
772
758
|
onReject?: (permissionLevel?: PermissionLevel) => void;
|
|
773
|
-
/** Show permission options (default: true) */
|
|
774
|
-
showPermissionOptions?: boolean;
|
|
775
|
-
/** Available permission options */
|
|
776
|
-
permissionOptions?: PermissionOption[];
|
|
777
|
-
/** Additional class name */
|
|
778
759
|
className?: string;
|
|
779
760
|
}
|
|
780
|
-
|
|
781
|
-
* PermissionConfirmation - Enhanced confirmation with permission level selection
|
|
782
|
-
*
|
|
783
|
-
* Shows a confirmation dialog for tool approval with options to remember the choice.
|
|
784
|
-
*
|
|
785
|
-
* @example
|
|
786
|
-
* ```tsx
|
|
787
|
-
* <PermissionConfirmation
|
|
788
|
-
* state="pending"
|
|
789
|
-
* toolName="capture_screenshot"
|
|
790
|
-
* message="Take a screenshot of the current screen?"
|
|
791
|
-
* onApprove={(level) => approveToolExecution(tool.id, level)}
|
|
792
|
-
* onReject={(level) => rejectToolExecution(tool.id, undefined, level)}
|
|
793
|
-
* />
|
|
794
|
-
* ```
|
|
795
|
-
*/
|
|
796
|
-
declare function PermissionConfirmation({ state, toolName, message, onApprove, onReject, showPermissionOptions, permissionOptions, className, }: PermissionConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
761
|
+
declare function PermissionConfirmation({ state, toolName, message, onApprove, onReject, className, }: PermissionConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
797
762
|
interface CompactPermissionConfirmationProps {
|
|
798
|
-
/** Current state: pending, approved, or rejected */
|
|
799
763
|
state: ConfirmationState;
|
|
800
|
-
/** Message to display */
|
|
801
764
|
message?: string;
|
|
802
|
-
/** Called when user approves */
|
|
803
765
|
onApprove?: (permissionLevel: PermissionLevel) => void;
|
|
804
|
-
/** Called when user rejects */
|
|
805
766
|
onReject?: (permissionLevel?: PermissionLevel) => void;
|
|
806
|
-
/** Additional class name */
|
|
807
767
|
className?: string;
|
|
808
768
|
}
|
|
809
|
-
/**
|
|
810
|
-
* CompactPermissionConfirmation - Simpler version with "Don't ask again" checkbox
|
|
811
|
-
*
|
|
812
|
-
* @example
|
|
813
|
-
* ```tsx
|
|
814
|
-
* <CompactPermissionConfirmation
|
|
815
|
-
* state="pending"
|
|
816
|
-
* message="Take a screenshot?"
|
|
817
|
-
* onApprove={(level) => approveToolExecution(tool.id, level)}
|
|
818
|
-
* onReject={(level) => rejectToolExecution(tool.id, undefined, level)}
|
|
819
|
-
* />
|
|
820
|
-
* ```
|
|
821
|
-
*/
|
|
822
769
|
declare function CompactPermissionConfirmation({ state, message, onApprove, onReject, className, }: CompactPermissionConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
823
770
|
|
|
824
771
|
type FollowUpProps = {
|
|
@@ -1299,6 +1246,8 @@ interface ToolExecutionData {
|
|
|
1299
1246
|
duration?: number;
|
|
1300
1247
|
/** Approval status for human-in-the-loop tools */
|
|
1301
1248
|
approvalStatus?: ToolApprovalStatus;
|
|
1249
|
+
/** Title shown in approval UI */
|
|
1250
|
+
approvalTitle?: string;
|
|
1302
1251
|
/** Message shown in approval UI */
|
|
1303
1252
|
approvalMessage?: string;
|
|
1304
1253
|
/** Data passed from user's approval action (e.g., selected item) */
|
|
@@ -1440,6 +1389,10 @@ interface ToolRendererProps {
|
|
|
1440
1389
|
error?: string;
|
|
1441
1390
|
/** Approval status for tools requiring confirmation */
|
|
1442
1391
|
approvalStatus?: ToolApprovalStatus;
|
|
1392
|
+
/** Title shown in approval UI */
|
|
1393
|
+
approvalTitle?: string;
|
|
1394
|
+
/** Message shown in approval UI */
|
|
1395
|
+
approvalMessage?: string;
|
|
1443
1396
|
/** Data passed from user's approval action */
|
|
1444
1397
|
approvalData?: Record<string, unknown>;
|
|
1445
1398
|
/** Tool source (mcp, native, custom) - useful for MCP tool identification */
|
|
@@ -1659,6 +1612,37 @@ type ChatProps = {
|
|
|
1659
1612
|
onApproveToolExecution?: (executionId: string, extraData?: Record<string, unknown>, permissionLevel?: PermissionLevel) => void;
|
|
1660
1613
|
/** Called when user rejects a tool execution */
|
|
1661
1614
|
onRejectToolExecution?: (executionId: string, reason?: string, permissionLevel?: PermissionLevel) => void;
|
|
1615
|
+
/**
|
|
1616
|
+
* Custom message list view.
|
|
1617
|
+
* Gives full control over how the message list is rendered.
|
|
1618
|
+
* Receives pre-rendered `messageElements` (default SDK output) and raw `messages`
|
|
1619
|
+
* so you can inject custom UI, reorder, or conditionally replace messages.
|
|
1620
|
+
*
|
|
1621
|
+
* @example
|
|
1622
|
+
* ```tsx
|
|
1623
|
+
* <CopilotChat
|
|
1624
|
+
* messageView={{
|
|
1625
|
+
* children: ({ messageElements, messages }) => (
|
|
1626
|
+
* <>
|
|
1627
|
+
* {messages.map((msg, i) =>
|
|
1628
|
+
* msg.metadata?.type === "plan"
|
|
1629
|
+
* ? <PlanCard key={msg.id} data={msg.metadata} />
|
|
1630
|
+
* : messageElements[i]
|
|
1631
|
+
* )}
|
|
1632
|
+
* </>
|
|
1633
|
+
* )
|
|
1634
|
+
* }}
|
|
1635
|
+
* />
|
|
1636
|
+
* ```
|
|
1637
|
+
*/
|
|
1638
|
+
messageView?: {
|
|
1639
|
+
children?: (props: {
|
|
1640
|
+
/** Raw messages array */
|
|
1641
|
+
messages: ChatMessage[];
|
|
1642
|
+
/** Pre-rendered message elements (default SDK rendering) */
|
|
1643
|
+
messageElements: React__default.ReactNode[];
|
|
1644
|
+
}) => React__default.ReactNode;
|
|
1645
|
+
};
|
|
1662
1646
|
/** Custom message renderer */
|
|
1663
1647
|
renderMessage?: (message: ChatMessage, index: number) => React__default.ReactNode;
|
|
1664
1648
|
/** Custom input renderer (replaces entire input area) */
|
|
@@ -1825,7 +1809,7 @@ declare function BackButton({ className, children, disabled, "aria-label": ariaL
|
|
|
1825
1809
|
*/
|
|
1826
1810
|
type ThreadPickerCompoundProps = Omit<ThreadPickerProps, "value" | "threads" | "onSelect" | "onNewThread" | "onDeleteThread" | "disabled">;
|
|
1827
1811
|
declare function ThreadPickerCompound(props: ThreadPickerCompoundProps): react_jsx_runtime.JSX.Element | null;
|
|
1828
|
-
declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, fallbackToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, groupConsecutiveMessages, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, getBranchInfo, onSwitchBranch, onEditMessage, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1812
|
+
declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, fallbackToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, messageView, renderMessage, renderInput, renderHeader, groupConsecutiveMessages, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, getBranchInfo, onSwitchBranch, onEditMessage, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1829
1813
|
/**
|
|
1830
1814
|
* Chat component with compound component pattern.
|
|
1831
1815
|
*
|