@icanbwell/baileyai-chat-ui 1.0.12 → 1.0.14
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/README.md +21 -0
- package/dist/baileyai-chat-ui.cjs +3 -3
- package/dist/baileyai-chat-ui.css +1 -1
- package/dist/baileyai-chat-ui.js +553 -397
- package/dist/index.d.ts +76 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ export declare interface BaileyChatInputMessage {
|
|
|
53
53
|
titleHint?: string;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, emptyPlaceholder, suggestions, onHistoryClick, privacyNote, resolveActivityIcon, className, height, width, hideDeveloperDetails, renderMessageActions, renderTable, renderChart, labels: labelsProp, formatMessageTime: formatMessageTimeProp, }: BaileyChatPanelProps): JSX_2.Element;
|
|
56
|
+
export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, emptyPlaceholder, suggestions, onHistoryClick, privacyNote, resolveActivityIcon, className, height, width, hideDeveloperDetails, renderMessageActions, renderTable, renderChart, renderMcpApp, labels: labelsProp, formatMessageTime: formatMessageTimeProp, }: BaileyChatPanelProps): JSX_2.Element;
|
|
57
57
|
|
|
58
|
-
export declare interface BaileyChatPanelLabels {
|
|
58
|
+
export declare interface BaileyChatPanelLabels extends ToolStepLabels {
|
|
59
59
|
/** Visible text of the "new chat" item in the "..." menu. */
|
|
60
60
|
newChatButtonText: string;
|
|
61
61
|
/** @deprecated No longer applied -- the "New chat" menu item is named by its visible text
|
|
@@ -97,10 +97,29 @@ export declare interface BaileyChatPanelLabels {
|
|
|
97
97
|
copyButtonTooltipDefault: string;
|
|
98
98
|
/** Tooltip text immediately after a successful copy, on the per-message copy control. */
|
|
99
99
|
copyButtonTooltipCopied: string;
|
|
100
|
+
/** iframe `title` attribute (accessible name) for an 'mcp_app' part (MCP Apps, SEP-1865)
|
|
101
|
+
* that doesn't carry its own `title` from the tool/resource. Only used by the default
|
|
102
|
+
* McpAppFrame renderer — a host-supplied `renderMcpApp` (BaileyChatPanelProps) owns its
|
|
103
|
+
* own accessible naming instead. */
|
|
104
|
+
mcpAppDefaultTitle: string;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
|
|
103
108
|
chat: UseBaileyChatResult;
|
|
109
|
+
/** Overrides the default McpAppFrame rendering for an 'mcp_app' content part (MCP Apps,
|
|
110
|
+
* SEP-1865) — e.g. a host that wants to supply its own iframe-hosting shell instead of this
|
|
111
|
+
* package's default sandboxed iframe. Not part of BaileyMarkdownRenderers: an mcp_app part
|
|
112
|
+
* is structured data attached to the message (BaileyMessage.parts), the same way image parts
|
|
113
|
+
* are, not a markdown-AST override. Omit to get the default McpAppFrame. */
|
|
114
|
+
renderMcpApp?: (part: {
|
|
115
|
+
html: string;
|
|
116
|
+
title?: string;
|
|
117
|
+
resourceUri: string;
|
|
118
|
+
csp?: Record<string, unknown>;
|
|
119
|
+
permissions?: Record<string, unknown>;
|
|
120
|
+
prefersBorder?: boolean;
|
|
121
|
+
displayMode?: string;
|
|
122
|
+
}) => ReactNode;
|
|
104
123
|
/** Overrides the input's placeholder in BOTH the empty and reply states, taking priority
|
|
105
124
|
* over emptyPlaceholder/replyPlaceholder below. Omit to get the state-appropriate default. */
|
|
106
125
|
placeholder?: string;
|
|
@@ -126,9 +145,10 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
|
|
|
126
145
|
* set. No default — the exact copy/link is host-specific, so nothing is shown unless a host
|
|
127
146
|
* supplies one. */
|
|
128
147
|
privacyNote?: BaileyPrivacyNote;
|
|
129
|
-
/** Customizes the icon shown next to
|
|
130
|
-
*
|
|
131
|
-
*
|
|
148
|
+
/** Customizes the icon shown next to each tool step — the live "Checking your vitals…" line
|
|
149
|
+
* while a tool runs, and each entry in the expanded "Used N tools" summary — based on the
|
|
150
|
+
* tool name. Defaults to a single generic icon for every step, rather than guessing a
|
|
151
|
+
* per-tool glyph mapping. */
|
|
132
152
|
resolveActivityIcon?: (toolName: string | null) => ReactNode;
|
|
133
153
|
className?: string;
|
|
134
154
|
/** Explicit panel height (number is treated as px, e.g. 600 or '600px' or '100vh'). Applied
|
|
@@ -183,6 +203,15 @@ export declare type BaileyContentPart = {
|
|
|
183
203
|
type: 'image';
|
|
184
204
|
src: string;
|
|
185
205
|
alt?: string;
|
|
206
|
+
} | {
|
|
207
|
+
type: 'mcp_app';
|
|
208
|
+
html: string;
|
|
209
|
+
title?: string;
|
|
210
|
+
resourceUri: string;
|
|
211
|
+
csp?: Record<string, unknown>;
|
|
212
|
+
permissions?: Record<string, unknown>;
|
|
213
|
+
prefersBorder?: boolean;
|
|
214
|
+
displayMode?: string;
|
|
186
215
|
};
|
|
187
216
|
|
|
188
217
|
export declare interface BaileyLastRequest {
|
|
@@ -247,6 +276,8 @@ export declare interface BaileyOutputItem {
|
|
|
247
276
|
type: string;
|
|
248
277
|
name?: string;
|
|
249
278
|
arguments?: string;
|
|
279
|
+
call_id?: string;
|
|
280
|
+
display_name?: string;
|
|
250
281
|
output?: string;
|
|
251
282
|
is_error?: boolean;
|
|
252
283
|
runtime_seconds?: number;
|
|
@@ -294,6 +325,16 @@ export declare type BaileyStreamEvent = {
|
|
|
294
325
|
} | {
|
|
295
326
|
type: 'info';
|
|
296
327
|
message: string;
|
|
328
|
+
} | {
|
|
329
|
+
type: 'mcp_app';
|
|
330
|
+
html: string;
|
|
331
|
+
title?: string;
|
|
332
|
+
resourceUri?: string;
|
|
333
|
+
protocolVersion?: string;
|
|
334
|
+
csp?: Record<string, unknown>;
|
|
335
|
+
permissions?: Record<string, unknown>;
|
|
336
|
+
prefersBorder?: boolean;
|
|
337
|
+
displayMode?: string;
|
|
297
338
|
};
|
|
298
339
|
|
|
299
340
|
export declare interface BaileyStreamStats {
|
|
@@ -322,12 +363,16 @@ export declare type BaileyTraceEvent = {
|
|
|
322
363
|
args?: string;
|
|
323
364
|
at: number;
|
|
324
365
|
turnSentAt: number;
|
|
366
|
+
callId?: string;
|
|
367
|
+
displayName?: string;
|
|
325
368
|
} | {
|
|
326
369
|
kind: 'tool_end';
|
|
327
370
|
name: string;
|
|
328
371
|
args?: string;
|
|
329
372
|
at: number;
|
|
330
373
|
turnSentAt: number;
|
|
374
|
+
callId?: string;
|
|
375
|
+
displayName?: string;
|
|
331
376
|
output?: string;
|
|
332
377
|
isError?: boolean;
|
|
333
378
|
runtimeSeconds?: number;
|
|
@@ -477,6 +522,32 @@ export declare const shouldUseGrid: (rows: BaileyTableCell[][]) => boolean;
|
|
|
477
522
|
|
|
478
523
|
export declare function toActivityLines(events: BaileyTraceEvent[], turnSentAt: number | undefined): ActivityLine[];
|
|
479
524
|
|
|
525
|
+
export declare interface ToolStep {
|
|
526
|
+
key: string;
|
|
527
|
+
callId: string | undefined;
|
|
528
|
+
toolName: string;
|
|
529
|
+
label: string;
|
|
530
|
+
status: ToolStepStatus;
|
|
531
|
+
runtimeSeconds?: number;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
declare interface ToolStepLabels {
|
|
535
|
+
/** Collapsed summary for a turn that used exactly one tool. */
|
|
536
|
+
toolStepsSummaryOne: string;
|
|
537
|
+
/** Collapsed summary for a turn that used several tools; `{count}` is replaced. */
|
|
538
|
+
toolStepsSummaryMany: string;
|
|
539
|
+
/** Appended to the summary when any tool failed; `{failed}` is replaced. */
|
|
540
|
+
toolStepsFailedSuffix: string;
|
|
541
|
+
/** Marker next to a failed step in the expanded list. */
|
|
542
|
+
toolStepFailedText: string;
|
|
543
|
+
/** Marker next to a step that never finished (turn stopped or errored mid-call). */
|
|
544
|
+
toolStepStoppedText: string;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export declare type ToolStepStatus = 'running' | 'done' | 'failed';
|
|
548
|
+
|
|
549
|
+
export declare function toToolSteps(events: BaileyTraceEvent[], turnSentAt: number | undefined): ToolStep[];
|
|
550
|
+
|
|
480
551
|
export declare function toTraceRows(events: BaileyTraceEvent[]): TraceRow[];
|
|
481
552
|
|
|
482
553
|
export declare function toTraceSegments(rows: TraceRow[]): TraceSegment[];
|