@paddockai/react 0.0.4 → 0.0.5
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/index.cjs +499 -10
- package/dist/index.d.cts +186 -5
- package/dist/index.d.ts +186 -5
- package/dist/index.js +490 -7
- package/dist/ui.cjs +586 -0
- package/dist/ui.d.cts +187 -0
- package/dist/ui.d.ts +187 -0
- package/dist/ui.js +572 -0
- package/package.json +15 -3
package/dist/ui.d.cts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode, HTMLAttributes, TextareaHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import { ToolPart, ToolSummary, Author as Author$1, UseSessionResult, TokenMode, SessionStatusInfo, ConnectionState, EventType, Delivery, Part as Part$1, AgentTurn } from '@paddockai/react';
|
|
4
|
+
|
|
5
|
+
type AuthorRole = "person" | "agent" | "system";
|
|
6
|
+
/** An author as the application shows it. */
|
|
7
|
+
type ResolvedAuthor = {
|
|
8
|
+
name: string;
|
|
9
|
+
avatarUrl?: string;
|
|
10
|
+
role: AuthorRole;
|
|
11
|
+
self: boolean;
|
|
12
|
+
};
|
|
13
|
+
type ToolCardProps = {
|
|
14
|
+
part: ToolPart;
|
|
15
|
+
summary: ToolSummary;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Tool cards by key: "mcp:server/tool", "mcp:server", "raw:rawName", or a tool name
|
|
19
|
+
* such as "file_edit". The most specific key that is present wins.
|
|
20
|
+
*/
|
|
21
|
+
type ToolRegistry = Record<string, ComponentType<ToolCardProps>>;
|
|
22
|
+
type MarkdownComponent = ComponentType<{
|
|
23
|
+
children: string;
|
|
24
|
+
}>;
|
|
25
|
+
type UIProviderProps = {
|
|
26
|
+
/** Renders agent text; without one, text renders as plain text. */
|
|
27
|
+
markdown?: MarkdownComponent;
|
|
28
|
+
tools?: ToolRegistry;
|
|
29
|
+
/** Maps an author to the application's people; the default shows name, else id, as a person. */
|
|
30
|
+
resolveAuthor?: (author: Author$1) => ResolvedAuthor;
|
|
31
|
+
/** The person using the application, so the default resolver marks their messages as self. */
|
|
32
|
+
participant?: {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
/** The agent's display identity. */
|
|
36
|
+
agent?: {
|
|
37
|
+
name: string;
|
|
38
|
+
avatarUrl?: string;
|
|
39
|
+
};
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
/** Supplies markdown, tool cards, the author resolver, and the agent's identity to the components below. */
|
|
43
|
+
declare function UIProvider({ markdown, tools, resolveAuthor, participant, agent, children }: UIProviderProps): react.JSX.Element;
|
|
44
|
+
|
|
45
|
+
type ElementProps = Omit<HTMLAttributes<HTMLElement>, "part"> & {
|
|
46
|
+
/** Renders the single child element instead, with this element's props and state attributes merged in. */
|
|
47
|
+
asChild?: boolean;
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type SessionRootProps = ElementProps & {
|
|
52
|
+
session: UseSessionResult;
|
|
53
|
+
/** The token's mode, as useSessionToken returns it. */
|
|
54
|
+
mode?: TokenMode | null;
|
|
55
|
+
};
|
|
56
|
+
declare function SessionRoot({ session, mode, asChild, children, ...rest }: SessionRootProps): react.JSX.Element;
|
|
57
|
+
/** Context for one useSession result and its token's mode. */
|
|
58
|
+
declare const Session: {
|
|
59
|
+
Root: typeof SessionRoot;
|
|
60
|
+
};
|
|
61
|
+
type SessionStatusDetail = SessionStatusInfo & {
|
|
62
|
+
connection: ConnectionState;
|
|
63
|
+
connectionError: Error | null;
|
|
64
|
+
error: UseSessionResult["error"];
|
|
65
|
+
retryAt: string | null;
|
|
66
|
+
};
|
|
67
|
+
type SessionStatusProps = Omit<ElementProps, "children"> & {
|
|
68
|
+
children?: (status: SessionStatusDetail) => ReactNode;
|
|
69
|
+
};
|
|
70
|
+
/** The session's status and connection, or what a render function makes of them. */
|
|
71
|
+
declare function SessionStatus({ children, asChild, ...rest }: SessionStatusProps): ReactNode;
|
|
72
|
+
type SessionPeekDetail = {
|
|
73
|
+
status: string;
|
|
74
|
+
connected: boolean;
|
|
75
|
+
activity: string | null;
|
|
76
|
+
};
|
|
77
|
+
type SessionPeekProps = Omit<ElementProps, "children"> & {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
token: string;
|
|
80
|
+
baseUrl?: string;
|
|
81
|
+
children?: (peek: SessionPeekDetail) => ReactNode;
|
|
82
|
+
};
|
|
83
|
+
/** One session compactly: its status, and the running tool's title or the latest agent text. */
|
|
84
|
+
declare function SessionPeek({ sessionId, token, baseUrl, ...rest }: SessionPeekProps): react.JSX.Element;
|
|
85
|
+
|
|
86
|
+
type ConversationRootProps = ElementProps & {
|
|
87
|
+
/** The items to show; by default, the conversation of the enclosing Session.Root. */
|
|
88
|
+
items?: readonly unknown[];
|
|
89
|
+
/** Event types to show as notices when the items come from the session. */
|
|
90
|
+
notices?: readonly EventType[];
|
|
91
|
+
};
|
|
92
|
+
declare function ConversationRoot({ items, notices, asChild, children, onScroll, ...rest }: ConversationRootProps): react.JSX.Element;
|
|
93
|
+
type ConversationItemsProps<T = unknown> = Omit<ElementProps, "children"> & {
|
|
94
|
+
/** Renders one item; by default, conversation items render with the default components. */
|
|
95
|
+
children?: (item: T, index: number) => ReactNode;
|
|
96
|
+
};
|
|
97
|
+
declare function ConversationItems<T = unknown>({ children, asChild, ...rest }: ConversationItemsProps<T>): ReactNode;
|
|
98
|
+
declare function ConversationEmpty({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
99
|
+
/** A log of items that stays at the bottom while the reader is there. */
|
|
100
|
+
declare const Conversation: {
|
|
101
|
+
Root: typeof ConversationRoot;
|
|
102
|
+
Items: typeof ConversationItems;
|
|
103
|
+
Empty: typeof ConversationEmpty;
|
|
104
|
+
};
|
|
105
|
+
type MessageRootProps = ElementProps & {
|
|
106
|
+
role: AuthorRole;
|
|
107
|
+
author?: ResolvedAuthor | null;
|
|
108
|
+
delivery?: Delivery;
|
|
109
|
+
"data-notice"?: string;
|
|
110
|
+
};
|
|
111
|
+
declare function MessageRoot({ role, author, delivery, asChild, children, ...rest }: MessageRootProps): react.JSX.Element;
|
|
112
|
+
declare function MessageContent({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
113
|
+
/** One message from plain props, so an application can render its own thread with it. */
|
|
114
|
+
declare const Message: {
|
|
115
|
+
Root: typeof MessageRoot;
|
|
116
|
+
Content: typeof MessageContent;
|
|
117
|
+
};
|
|
118
|
+
type AuthorProps = ElementProps & {
|
|
119
|
+
author?: ResolvedAuthor | null;
|
|
120
|
+
};
|
|
121
|
+
/** An author's name; by default, the enclosing message's author. */
|
|
122
|
+
declare function Author({ author, asChild, children, ...rest }: AuthorProps): ReactNode;
|
|
123
|
+
type TurnRootProps = ElementProps & {
|
|
124
|
+
turn: AgentTurn;
|
|
125
|
+
};
|
|
126
|
+
declare function TurnRoot({ turn, asChild, children, ...rest }: TurnRootProps): react.JSX.Element;
|
|
127
|
+
type TurnPartsProps = Omit<ElementProps, "children"> & {
|
|
128
|
+
children?: (part: Part$1) => ReactNode;
|
|
129
|
+
};
|
|
130
|
+
declare function TurnParts({ children, asChild, ...rest }: TurnPartsProps): ReactNode;
|
|
131
|
+
type TurnStatusProps = Omit<ElementProps, "children"> & {
|
|
132
|
+
children?: (turn: AgentTurn) => ReactNode;
|
|
133
|
+
};
|
|
134
|
+
declare function TurnStatus({ children, asChild, ...rest }: TurnStatusProps): ReactNode;
|
|
135
|
+
/** An agent turn, its parts, and how it ended. */
|
|
136
|
+
declare const Turn: {
|
|
137
|
+
Root: typeof TurnRoot;
|
|
138
|
+
Parts: typeof TurnParts;
|
|
139
|
+
Status: typeof TurnStatus;
|
|
140
|
+
};
|
|
141
|
+
type PartProps = ElementProps & {
|
|
142
|
+
part: Part$1;
|
|
143
|
+
};
|
|
144
|
+
/** One part of a turn: text through markdown, reasoning and unknown messages as disclosures, a tool through the registry. */
|
|
145
|
+
declare function Part({ part, asChild, children, ...rest }: PartProps): ReactNode;
|
|
146
|
+
type ToolCallRootProps = ElementProps & {
|
|
147
|
+
part: ToolPart;
|
|
148
|
+
};
|
|
149
|
+
declare function ToolCallRoot({ part, asChild, children, ...rest }: ToolCallRootProps): react.JSX.Element;
|
|
150
|
+
declare function ToolCallTitle({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
151
|
+
type ToolCallDetailProps = Omit<ElementProps, "children"> & {
|
|
152
|
+
children?: (summary: ToolSummary) => ReactNode;
|
|
153
|
+
};
|
|
154
|
+
declare function ToolCallDetail({ asChild, children, ...rest }: ToolCallDetailProps): ReactNode;
|
|
155
|
+
declare function ToolCallChildren({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
156
|
+
/** The default tool card: its title, its detail, and a subagent's work. */
|
|
157
|
+
declare const ToolCall: {
|
|
158
|
+
Root: typeof ToolCallRoot;
|
|
159
|
+
Title: typeof ToolCallTitle;
|
|
160
|
+
Detail: typeof ToolCallDetail;
|
|
161
|
+
Children: typeof ToolCallChildren;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
type ComposerRootProps = ElementProps & {
|
|
165
|
+
onError?: (error: Error) => void;
|
|
166
|
+
};
|
|
167
|
+
declare function ComposerRoot({ onError, asChild, children, ...rest }: ComposerRootProps): react.JSX.Element;
|
|
168
|
+
type ComposerInputProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onChange"> & {
|
|
169
|
+
asChild?: boolean;
|
|
170
|
+
children?: ReactNode;
|
|
171
|
+
};
|
|
172
|
+
declare function ComposerInput({ asChild, children, onKeyDown, ...rest }: ComposerInputProps): ReactNode;
|
|
173
|
+
type ComposerButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
174
|
+
asChild?: boolean;
|
|
175
|
+
};
|
|
176
|
+
declare function ComposerSend({ asChild, children, ...rest }: ComposerButtonProps): ReactNode;
|
|
177
|
+
declare function ComposerStop({ asChild, children, onClick, ...rest }: ComposerButtonProps): ReactNode;
|
|
178
|
+
/** A form over useComposer: a text area, a send button, and a stop button. */
|
|
179
|
+
declare const Composer: {
|
|
180
|
+
Root: typeof ComposerRoot;
|
|
181
|
+
Input: typeof ComposerInput;
|
|
182
|
+
Send: typeof ComposerSend;
|
|
183
|
+
Stop: typeof ComposerStop;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export { Author, Composer, Conversation, Message, Part, Session, SessionPeek, SessionStatus, ToolCall, Turn, UIProvider };
|
|
187
|
+
export type { AuthorProps, AuthorRole, ComposerButtonProps, ComposerInputProps, ComposerRootProps, ConversationItemsProps, ConversationRootProps, ElementProps, MarkdownComponent, MessageRootProps, PartProps, ResolvedAuthor, SessionPeekDetail, SessionPeekProps, SessionRootProps, SessionStatusDetail, SessionStatusProps, ToolCallDetailProps, ToolCallRootProps, ToolCardProps, ToolRegistry, TurnPartsProps, TurnRootProps, TurnStatusProps, UIProviderProps };
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode, HTMLAttributes, TextareaHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import { ToolPart, ToolSummary, Author as Author$1, UseSessionResult, TokenMode, SessionStatusInfo, ConnectionState, EventType, Delivery, Part as Part$1, AgentTurn } from '@paddockai/react';
|
|
4
|
+
|
|
5
|
+
type AuthorRole = "person" | "agent" | "system";
|
|
6
|
+
/** An author as the application shows it. */
|
|
7
|
+
type ResolvedAuthor = {
|
|
8
|
+
name: string;
|
|
9
|
+
avatarUrl?: string;
|
|
10
|
+
role: AuthorRole;
|
|
11
|
+
self: boolean;
|
|
12
|
+
};
|
|
13
|
+
type ToolCardProps = {
|
|
14
|
+
part: ToolPart;
|
|
15
|
+
summary: ToolSummary;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Tool cards by key: "mcp:server/tool", "mcp:server", "raw:rawName", or a tool name
|
|
19
|
+
* such as "file_edit". The most specific key that is present wins.
|
|
20
|
+
*/
|
|
21
|
+
type ToolRegistry = Record<string, ComponentType<ToolCardProps>>;
|
|
22
|
+
type MarkdownComponent = ComponentType<{
|
|
23
|
+
children: string;
|
|
24
|
+
}>;
|
|
25
|
+
type UIProviderProps = {
|
|
26
|
+
/** Renders agent text; without one, text renders as plain text. */
|
|
27
|
+
markdown?: MarkdownComponent;
|
|
28
|
+
tools?: ToolRegistry;
|
|
29
|
+
/** Maps an author to the application's people; the default shows name, else id, as a person. */
|
|
30
|
+
resolveAuthor?: (author: Author$1) => ResolvedAuthor;
|
|
31
|
+
/** The person using the application, so the default resolver marks their messages as self. */
|
|
32
|
+
participant?: {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
/** The agent's display identity. */
|
|
36
|
+
agent?: {
|
|
37
|
+
name: string;
|
|
38
|
+
avatarUrl?: string;
|
|
39
|
+
};
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
/** Supplies markdown, tool cards, the author resolver, and the agent's identity to the components below. */
|
|
43
|
+
declare function UIProvider({ markdown, tools, resolveAuthor, participant, agent, children }: UIProviderProps): react.JSX.Element;
|
|
44
|
+
|
|
45
|
+
type ElementProps = Omit<HTMLAttributes<HTMLElement>, "part"> & {
|
|
46
|
+
/** Renders the single child element instead, with this element's props and state attributes merged in. */
|
|
47
|
+
asChild?: boolean;
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type SessionRootProps = ElementProps & {
|
|
52
|
+
session: UseSessionResult;
|
|
53
|
+
/** The token's mode, as useSessionToken returns it. */
|
|
54
|
+
mode?: TokenMode | null;
|
|
55
|
+
};
|
|
56
|
+
declare function SessionRoot({ session, mode, asChild, children, ...rest }: SessionRootProps): react.JSX.Element;
|
|
57
|
+
/** Context for one useSession result and its token's mode. */
|
|
58
|
+
declare const Session: {
|
|
59
|
+
Root: typeof SessionRoot;
|
|
60
|
+
};
|
|
61
|
+
type SessionStatusDetail = SessionStatusInfo & {
|
|
62
|
+
connection: ConnectionState;
|
|
63
|
+
connectionError: Error | null;
|
|
64
|
+
error: UseSessionResult["error"];
|
|
65
|
+
retryAt: string | null;
|
|
66
|
+
};
|
|
67
|
+
type SessionStatusProps = Omit<ElementProps, "children"> & {
|
|
68
|
+
children?: (status: SessionStatusDetail) => ReactNode;
|
|
69
|
+
};
|
|
70
|
+
/** The session's status and connection, or what a render function makes of them. */
|
|
71
|
+
declare function SessionStatus({ children, asChild, ...rest }: SessionStatusProps): ReactNode;
|
|
72
|
+
type SessionPeekDetail = {
|
|
73
|
+
status: string;
|
|
74
|
+
connected: boolean;
|
|
75
|
+
activity: string | null;
|
|
76
|
+
};
|
|
77
|
+
type SessionPeekProps = Omit<ElementProps, "children"> & {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
token: string;
|
|
80
|
+
baseUrl?: string;
|
|
81
|
+
children?: (peek: SessionPeekDetail) => ReactNode;
|
|
82
|
+
};
|
|
83
|
+
/** One session compactly: its status, and the running tool's title or the latest agent text. */
|
|
84
|
+
declare function SessionPeek({ sessionId, token, baseUrl, ...rest }: SessionPeekProps): react.JSX.Element;
|
|
85
|
+
|
|
86
|
+
type ConversationRootProps = ElementProps & {
|
|
87
|
+
/** The items to show; by default, the conversation of the enclosing Session.Root. */
|
|
88
|
+
items?: readonly unknown[];
|
|
89
|
+
/** Event types to show as notices when the items come from the session. */
|
|
90
|
+
notices?: readonly EventType[];
|
|
91
|
+
};
|
|
92
|
+
declare function ConversationRoot({ items, notices, asChild, children, onScroll, ...rest }: ConversationRootProps): react.JSX.Element;
|
|
93
|
+
type ConversationItemsProps<T = unknown> = Omit<ElementProps, "children"> & {
|
|
94
|
+
/** Renders one item; by default, conversation items render with the default components. */
|
|
95
|
+
children?: (item: T, index: number) => ReactNode;
|
|
96
|
+
};
|
|
97
|
+
declare function ConversationItems<T = unknown>({ children, asChild, ...rest }: ConversationItemsProps<T>): ReactNode;
|
|
98
|
+
declare function ConversationEmpty({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
99
|
+
/** A log of items that stays at the bottom while the reader is there. */
|
|
100
|
+
declare const Conversation: {
|
|
101
|
+
Root: typeof ConversationRoot;
|
|
102
|
+
Items: typeof ConversationItems;
|
|
103
|
+
Empty: typeof ConversationEmpty;
|
|
104
|
+
};
|
|
105
|
+
type MessageRootProps = ElementProps & {
|
|
106
|
+
role: AuthorRole;
|
|
107
|
+
author?: ResolvedAuthor | null;
|
|
108
|
+
delivery?: Delivery;
|
|
109
|
+
"data-notice"?: string;
|
|
110
|
+
};
|
|
111
|
+
declare function MessageRoot({ role, author, delivery, asChild, children, ...rest }: MessageRootProps): react.JSX.Element;
|
|
112
|
+
declare function MessageContent({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
113
|
+
/** One message from plain props, so an application can render its own thread with it. */
|
|
114
|
+
declare const Message: {
|
|
115
|
+
Root: typeof MessageRoot;
|
|
116
|
+
Content: typeof MessageContent;
|
|
117
|
+
};
|
|
118
|
+
type AuthorProps = ElementProps & {
|
|
119
|
+
author?: ResolvedAuthor | null;
|
|
120
|
+
};
|
|
121
|
+
/** An author's name; by default, the enclosing message's author. */
|
|
122
|
+
declare function Author({ author, asChild, children, ...rest }: AuthorProps): ReactNode;
|
|
123
|
+
type TurnRootProps = ElementProps & {
|
|
124
|
+
turn: AgentTurn;
|
|
125
|
+
};
|
|
126
|
+
declare function TurnRoot({ turn, asChild, children, ...rest }: TurnRootProps): react.JSX.Element;
|
|
127
|
+
type TurnPartsProps = Omit<ElementProps, "children"> & {
|
|
128
|
+
children?: (part: Part$1) => ReactNode;
|
|
129
|
+
};
|
|
130
|
+
declare function TurnParts({ children, asChild, ...rest }: TurnPartsProps): ReactNode;
|
|
131
|
+
type TurnStatusProps = Omit<ElementProps, "children"> & {
|
|
132
|
+
children?: (turn: AgentTurn) => ReactNode;
|
|
133
|
+
};
|
|
134
|
+
declare function TurnStatus({ children, asChild, ...rest }: TurnStatusProps): ReactNode;
|
|
135
|
+
/** An agent turn, its parts, and how it ended. */
|
|
136
|
+
declare const Turn: {
|
|
137
|
+
Root: typeof TurnRoot;
|
|
138
|
+
Parts: typeof TurnParts;
|
|
139
|
+
Status: typeof TurnStatus;
|
|
140
|
+
};
|
|
141
|
+
type PartProps = ElementProps & {
|
|
142
|
+
part: Part$1;
|
|
143
|
+
};
|
|
144
|
+
/** One part of a turn: text through markdown, reasoning and unknown messages as disclosures, a tool through the registry. */
|
|
145
|
+
declare function Part({ part, asChild, children, ...rest }: PartProps): ReactNode;
|
|
146
|
+
type ToolCallRootProps = ElementProps & {
|
|
147
|
+
part: ToolPart;
|
|
148
|
+
};
|
|
149
|
+
declare function ToolCallRoot({ part, asChild, children, ...rest }: ToolCallRootProps): react.JSX.Element;
|
|
150
|
+
declare function ToolCallTitle({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
151
|
+
type ToolCallDetailProps = Omit<ElementProps, "children"> & {
|
|
152
|
+
children?: (summary: ToolSummary) => ReactNode;
|
|
153
|
+
};
|
|
154
|
+
declare function ToolCallDetail({ asChild, children, ...rest }: ToolCallDetailProps): ReactNode;
|
|
155
|
+
declare function ToolCallChildren({ asChild, children, ...rest }: ElementProps): ReactNode;
|
|
156
|
+
/** The default tool card: its title, its detail, and a subagent's work. */
|
|
157
|
+
declare const ToolCall: {
|
|
158
|
+
Root: typeof ToolCallRoot;
|
|
159
|
+
Title: typeof ToolCallTitle;
|
|
160
|
+
Detail: typeof ToolCallDetail;
|
|
161
|
+
Children: typeof ToolCallChildren;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
type ComposerRootProps = ElementProps & {
|
|
165
|
+
onError?: (error: Error) => void;
|
|
166
|
+
};
|
|
167
|
+
declare function ComposerRoot({ onError, asChild, children, ...rest }: ComposerRootProps): react.JSX.Element;
|
|
168
|
+
type ComposerInputProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onChange"> & {
|
|
169
|
+
asChild?: boolean;
|
|
170
|
+
children?: ReactNode;
|
|
171
|
+
};
|
|
172
|
+
declare function ComposerInput({ asChild, children, onKeyDown, ...rest }: ComposerInputProps): ReactNode;
|
|
173
|
+
type ComposerButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
174
|
+
asChild?: boolean;
|
|
175
|
+
};
|
|
176
|
+
declare function ComposerSend({ asChild, children, ...rest }: ComposerButtonProps): ReactNode;
|
|
177
|
+
declare function ComposerStop({ asChild, children, onClick, ...rest }: ComposerButtonProps): ReactNode;
|
|
178
|
+
/** A form over useComposer: a text area, a send button, and a stop button. */
|
|
179
|
+
declare const Composer: {
|
|
180
|
+
Root: typeof ComposerRoot;
|
|
181
|
+
Input: typeof ComposerInput;
|
|
182
|
+
Send: typeof ComposerSend;
|
|
183
|
+
Stop: typeof ComposerStop;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export { Author, Composer, Conversation, Message, Part, Session, SessionPeek, SessionStatus, ToolCall, Turn, UIProvider };
|
|
187
|
+
export type { AuthorProps, AuthorRole, ComposerButtonProps, ComposerInputProps, ComposerRootProps, ConversationItemsProps, ConversationRootProps, ElementProps, MarkdownComponent, MessageRootProps, PartProps, ResolvedAuthor, SessionPeekDetail, SessionPeekProps, SessionRootProps, SessionStatusDetail, SessionStatusProps, ToolCallDetailProps, ToolCallRootProps, ToolCardProps, ToolRegistry, TurnPartsProps, TurnRootProps, TurnStatusProps, UIProviderProps };
|