@icanbwell/baileyai-chat-ui 0.3.4 → 0.4.1-pre.0
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/baileyai-chat-ui.cjs +5 -5
- package/dist/baileyai-chat-ui.css +1 -1
- package/dist/baileyai-chat-ui.js +434 -278
- package/dist/index.d.ts +64 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,20 @@ import { Components } from 'react-markdown';
|
|
|
2
2
|
import { JSX } from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
+
export declare function ActivityIcon({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
|
|
9
|
+
export declare interface ActivityLine {
|
|
10
|
+
key: string;
|
|
11
|
+
text: string;
|
|
12
|
+
toolName: string | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare function ArrowUpRightIcon({ className }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
}): JSX.Element;
|
|
18
|
+
|
|
5
19
|
export declare const BAILEY_CHART_PROMPT_FRAGMENT: string;
|
|
6
20
|
|
|
7
21
|
export declare const BAILEY_TABLE_GRID_ROW_THRESHOLD = 5;
|
|
@@ -32,12 +46,39 @@ export declare interface BaileyChatInputMessage {
|
|
|
32
46
|
content: string;
|
|
33
47
|
}
|
|
34
48
|
|
|
35
|
-
export declare function BaileyChatPanel({ chat, placeholder, className, renderMessageActions, renderTable, renderChart, }: BaileyChatPanelProps): JSX.Element;
|
|
49
|
+
export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, suggestions, privacyNote, resolveActivityIcon, className, height, width, hideDeveloperDetails, renderMessageActions, renderTable, renderChart, }: BaileyChatPanelProps): JSX.Element;
|
|
36
50
|
|
|
37
51
|
export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
|
|
38
52
|
chat: UseBaileyChatResult;
|
|
53
|
+
/** Overrides the input's placeholder in BOTH the empty and reply states, taking priority
|
|
54
|
+
* over emptyPlaceholder/replyPlaceholder below. Omit to get the state-appropriate default. */
|
|
39
55
|
placeholder?: string;
|
|
56
|
+
/** Placeholder shown once the conversation has started; ignored if `placeholder` is set. */
|
|
57
|
+
replyPlaceholder?: string;
|
|
58
|
+
/** Suggested prompts shown ("Suggested for you") in the empty state before any message has
|
|
59
|
+
* been sent. Clicking one calls chat.send(value ?? label). Omit to keep the plain
|
|
60
|
+
* "Ask Bailey a question to get started." empty state. */
|
|
61
|
+
suggestions?: BaileySuggestion[];
|
|
62
|
+
/** A short privacy/compliance note rendered above the input, empty state only. No default —
|
|
63
|
+
* the exact copy/link is host-specific, so nothing is shown unless a host supplies one. */
|
|
64
|
+
privacyNote?: BaileyPrivacyNote;
|
|
65
|
+
/** Customizes the icon shown next to an inline activity line (e.g. "Checking your vitals.")
|
|
66
|
+
* based on the tool/event name — defaults to a single generic icon for every line, rather
|
|
67
|
+
* than guessing a per-tool glyph mapping. */
|
|
68
|
+
resolveActivityIcon?: (toolName: string | null) => ReactNode;
|
|
40
69
|
className?: string;
|
|
70
|
+
/** Explicit panel height (number is treated as px, e.g. 600 or '600px' or '100vh'). Applied
|
|
71
|
+
* as an inline style, which wins over the default `h-full` CSS class regardless of whether
|
|
72
|
+
* a host has its own Tailwind build — so a host can size the panel without needing to
|
|
73
|
+
* produce a matching utility class of its own. Omit to keep sizing to 100% of the parent. */
|
|
74
|
+
height?: number | string;
|
|
75
|
+
/** Explicit panel width, same semantics as `height`. Omit to size to the parent's width. */
|
|
76
|
+
width?: number | string;
|
|
77
|
+
/** Hides the developer-facing "Show details" trace panel (tool call args/output, raw
|
|
78
|
+
* request/response payloads) entirely — for a host that wants Bailey's chat experience
|
|
79
|
+
* without exposing that debugging surface to end users. Defaults to false (shown), matching
|
|
80
|
+
* today's behavior. */
|
|
81
|
+
hideDeveloperDetails?: boolean;
|
|
41
82
|
/** Renders next to the built-in copy button for a completed assistant message — a static,
|
|
42
83
|
* per-message extension point for a host action (e.g. "regenerate", feedback buttons).
|
|
43
84
|
* Content-derived actions (e.g. baileyai-skills-service's save-as-skill artifact UI) are a
|
|
@@ -99,6 +140,9 @@ export declare interface BaileyMessage {
|
|
|
99
140
|
role: 'user' | 'assistant';
|
|
100
141
|
content: string;
|
|
101
142
|
streaming?: boolean;
|
|
143
|
+
/** When this message was created, stamped by useBaileyChat. Optional so hosts constructing
|
|
144
|
+
* BaileyMessage objects by hand (e.g. tests, seed data) aren't forced to supply it. */
|
|
145
|
+
createdAt?: number;
|
|
102
146
|
}
|
|
103
147
|
|
|
104
148
|
export declare interface BaileyOutputItem {
|
|
@@ -110,6 +154,12 @@ export declare interface BaileyOutputItem {
|
|
|
110
154
|
runtime_seconds?: number;
|
|
111
155
|
}
|
|
112
156
|
|
|
157
|
+
export declare interface BaileyPrivacyNote {
|
|
158
|
+
text: string;
|
|
159
|
+
linkLabel: string;
|
|
160
|
+
linkHref: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
113
163
|
export declare type BaileyStreamEvent = {
|
|
114
164
|
type: 'response.output_text.delta';
|
|
115
165
|
delta: string;
|
|
@@ -143,6 +193,13 @@ export declare interface BaileyStreamStats {
|
|
|
143
193
|
lastChunkAt: number | null;
|
|
144
194
|
}
|
|
145
195
|
|
|
196
|
+
export declare interface BaileySuggestion {
|
|
197
|
+
/** Shown on the suggestion card. */
|
|
198
|
+
label: string;
|
|
199
|
+
/** Sent to chat.send() when the card is clicked — defaults to `label` when omitted. */
|
|
200
|
+
value?: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
146
203
|
export declare interface BaileyTableCell {
|
|
147
204
|
text: string;
|
|
148
205
|
href?: string;
|
|
@@ -245,6 +302,10 @@ export declare interface HastNode {
|
|
|
245
302
|
|
|
246
303
|
export declare function hasTraceFailure(events: BaileyTraceEvent[]): boolean;
|
|
247
304
|
|
|
305
|
+
export declare function HeartIcon({ className }: {
|
|
306
|
+
className?: string;
|
|
307
|
+
}): JSX.Element;
|
|
308
|
+
|
|
248
309
|
export declare const isSafeMarkdownUrl: (href: string) => boolean;
|
|
249
310
|
|
|
250
311
|
export declare function joinInstructions(...parts: Array<string | undefined | null | false>): string;
|
|
@@ -279,6 +340,8 @@ export declare function resolveToolCall(name: string, argsJson: string | undefin
|
|
|
279
340
|
|
|
280
341
|
export declare const shouldUseGrid: (rows: BaileyTableCell[][]) => boolean;
|
|
281
342
|
|
|
343
|
+
export declare function toActivityLines(events: BaileyTraceEvent[], turnSentAt: number | undefined): ActivityLine[];
|
|
344
|
+
|
|
282
345
|
export declare function toTraceRows(events: BaileyTraceEvent[]): TraceRow[];
|
|
283
346
|
|
|
284
347
|
export declare function toTraceSegments(rows: TraceRow[]): TraceSegment[];
|