@icanbwell/baileyai-chat-ui 1.0.11 → 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/dist/index.d.ts CHANGED
@@ -53,17 +53,25 @@ 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 {
59
- /** Visible text on the header's reset control. */
58
+ export declare interface BaileyChatPanelLabels extends ToolStepLabels {
59
+ /** Visible text of the "new chat" item in the "..." menu. */
60
60
  newChatButtonText: string;
61
- /** Accessible name for the reset control — lowercase to match this component's other
62
- * aria-labels (send/stop/dismiss), which are also lowercase by existing convention. */
61
+ /** @deprecated No longer applied -- the "New chat" menu item is named by its visible text
62
+ * (`newChatButtonText`). Kept in the type so existing hosts still compile; will be removed
63
+ * in the next major version. */
63
64
  newChatAriaLabel: string;
64
- /** Accessible name for the history control — only rendered when `onHistoryClick` is
65
- * supplied (see BaileyChatPanelProps). Lowercase, same convention as newChatAriaLabel. */
65
+ /** @deprecated No longer applied -- the history menu item is named by its visible text
66
+ * (`historyMenuItemText`). Kept in the type so existing hosts still compile; will be
67
+ * removed in the next major version. */
66
68
  historyAriaLabel: string;
69
+ /** Visible text of the history item in the "..." menu — only rendered when
70
+ * `onHistoryClick` is supplied (see BaileyChatPanelProps). */
71
+ historyMenuItemText: string;
72
+ /** Accessible name for the "..." menu trigger beside the input row. Lowercase, same
73
+ * convention as the other aria-labels. */
74
+ menuAriaLabel: string;
67
75
  /** Heading above the suggestion cards in the empty state. */
68
76
  suggestionsTitle: string;
69
77
  /** Shown in the empty state when no `suggestions` prop is supplied. */
@@ -89,10 +97,29 @@ export declare interface BaileyChatPanelLabels {
89
97
  copyButtonTooltipDefault: string;
90
98
  /** Tooltip text immediately after a successful copy, on the per-message copy control. */
91
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;
92
105
  }
93
106
 
94
107
  export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
95
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;
96
123
  /** Overrides the input's placeholder in BOTH the empty and reply states, taking priority
97
124
  * over emptyPlaceholder/replyPlaceholder below. Omit to get the state-appropriate default. */
98
125
  placeholder?: string;
@@ -106,21 +133,22 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
106
133
  * been sent. Clicking one calls chat.send(value ?? label). Omit to keep the plain
107
134
  * "Ask Bailey a question to get started." empty state. */
108
135
  suggestions?: BaileySuggestion[];
109
- /** Renders a history-icon control in the toolbar row, next to "New chat" — a host's entry
110
- * point into its own conversation-history UI (this package has no opinion on how history
111
- * is stored/listed; it only renders the trigger). Rendered regardless of `isEmpty`, unlike
112
- * "New chat" (which only appears once a conversation has started) — history should stay
113
- * reachable even before the first message. Omit entirely to keep today's toolbar row
114
- * (just "New chat", nothing when empty). */
136
+ /** Adds a history item to the "..." menu beside the input row, beneath "New chat" — a host's
137
+ * entry point into its own conversation-history UI (this package has no opinion on how
138
+ * history is stored/listed; it only renders the trigger). Rendered regardless of `isEmpty`,
139
+ * unlike "New chat" (which only appears once a conversation has started) — history should
140
+ * stay reachable even before the first message. Omit entirely to keep the menu to just
141
+ * "New chat" (and no menu at all while the conversation is empty). */
115
142
  onHistoryClick?: () => void;
116
143
  /** A short privacy/compliance note rendered below the input row, as the panel's bottom-most
117
144
  * element — empty state only by default, or every state if `privacyNote.alwaysVisible` is
118
145
  * set. No default — the exact copy/link is host-specific, so nothing is shown unless a host
119
146
  * supplies one. */
120
147
  privacyNote?: BaileyPrivacyNote;
121
- /** Customizes the icon shown next to an inline activity line (e.g. "Checking your vitals.")
122
- * based on the tool/event name — defaults to a single generic icon for every line, rather
123
- * than guessing a per-tool glyph mapping. */
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. */
124
152
  resolveActivityIcon?: (toolName: string | null) => ReactNode;
125
153
  className?: string;
126
154
  /** Explicit panel height (number is treated as px, e.g. 600 or '600px' or '100vh'). Applied
@@ -175,6 +203,15 @@ export declare type BaileyContentPart = {
175
203
  type: 'image';
176
204
  src: string;
177
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;
178
215
  };
179
216
 
180
217
  export declare interface BaileyLastRequest {
@@ -239,6 +276,8 @@ export declare interface BaileyOutputItem {
239
276
  type: string;
240
277
  name?: string;
241
278
  arguments?: string;
279
+ call_id?: string;
280
+ display_name?: string;
242
281
  output?: string;
243
282
  is_error?: boolean;
244
283
  runtime_seconds?: number;
@@ -286,6 +325,16 @@ export declare type BaileyStreamEvent = {
286
325
  } | {
287
326
  type: 'info';
288
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;
289
338
  };
290
339
 
291
340
  export declare interface BaileyStreamStats {
@@ -314,12 +363,16 @@ export declare type BaileyTraceEvent = {
314
363
  args?: string;
315
364
  at: number;
316
365
  turnSentAt: number;
366
+ callId?: string;
367
+ displayName?: string;
317
368
  } | {
318
369
  kind: 'tool_end';
319
370
  name: string;
320
371
  args?: string;
321
372
  at: number;
322
373
  turnSentAt: number;
374
+ callId?: string;
375
+ displayName?: string;
323
376
  output?: string;
324
377
  isError?: boolean;
325
378
  runtimeSeconds?: number;
@@ -469,6 +522,32 @@ export declare const shouldUseGrid: (rows: BaileyTableCell[][]) => boolean;
469
522
 
470
523
  export declare function toActivityLines(events: BaileyTraceEvent[], turnSentAt: number | undefined): ActivityLine[];
471
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
+
472
551
  export declare function toTraceRows(events: BaileyTraceEvent[]): TraceRow[];
473
552
 
474
553
  export declare function toTraceSegments(rows: TraceRow[]): TraceSegment[];
@@ -561,7 +640,7 @@ export declare interface UseBaileyChatResult {
561
640
  /** Aborts any in-flight turn and resets the conversation to empty, so a host can offer a
562
641
  * "start over" control without remounting the component.
563
642
  *
564
- * `BaileyChatPanel`'s own "New chat" button calls whatever `newChat` sits on the `chat`
643
+ * `BaileyChatPanel`'s own "New chat" menu item calls whatever `newChat` sits on the `chat`
565
644
  * object it was given (read off `props.chat`, not this hook directly) — so a host that
566
645
  * needs to react to a reset (e.g. to also clear its own persisted conversation identity)
567
646
  * wraps this function before handing `chat` to the panel:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/baileyai-chat-ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.14",
4
4
  "description": "Shared React chat UI and streaming logic for Bailey, the icanbwell AI assistant",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -88,6 +88,7 @@
88
88
  }
89
89
  },
90
90
  "dependencies": {
91
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
91
92
  "@radix-ui/react-tooltip": "^1.1.8",
92
93
  "react-markdown": "^10.1.0",
93
94
  "remark-gfm": "^4.0.1"
@@ -112,7 +113,7 @@
112
113
  "eslint": "^9.39.1",
113
114
  "eslint-plugin-react-hooks": "^7.1.1",
114
115
  "eslint-plugin-react-refresh": "^0.5.4",
115
- "jsdom": "^29.1.1",
116
+ "jsdom": "^30.1.1",
116
117
  "postcss": "^8.5.23",
117
118
  "react": "^18.3.1",
118
119
  "react-chartjs-2": "^5.3.1",
@@ -123,5 +124,9 @@
123
124
  "vite": "^8.0.16",
124
125
  "vite-plugin-dts": "^4.5.4",
125
126
  "vitest": "^4.1.10"
127
+ },
128
+ "resolutions": {
129
+ "minimatch/brace-expansion": "2.1.4-aikido.2",
130
+ "node-gyp/undici": "8.10.2"
126
131
  }
127
132
  }