@icanbwell/baileyai-chat-ui 1.0.28 → 1.1.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/README.md +62 -16
- package/dist/baileyai-chat-ui.cjs +3 -3
- package/dist/baileyai-chat-ui.css +1 -1
- package/dist/baileyai-chat-ui.js +1189 -1164
- package/dist/chart.js +1 -2
- package/dist/index.d.ts +30 -3
- package/dist/{safeMarkdownUrl-Bqv6Q4u1.js → safeMarkdownUrl-Dpm09Re7.js} +1 -2
- package/dist/table.js +2 -3
- package/package.json +3 -3
package/dist/chart.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
3
3
|
import { Box as n } from "@mui/material";
|
|
4
4
|
import { ArcElement as r, BarController as i, BarElement as a, CategoryScale as o, Chart as s, DoughnutController as c, Legend as l, LineController as u, LineElement as d, LinearScale as f, PieController as p, PointElement as m, ScatterController as h, Title as g, Tooltip as _ } from "chart.js";
|
|
5
5
|
import { Chart as v } from "react-chartjs-2";
|
|
6
|
-
|
|
6
|
+
// src/ui/BaileyChart.tsx
|
|
7
7
|
s.register(o, f, m, d, a, r, g, _, l, i, u, p, c, h);
|
|
8
8
|
var y = [
|
|
9
9
|
"#2563eb",
|
|
@@ -63,5 +63,4 @@ var y = [
|
|
|
63
63
|
})
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
-
//#endregion
|
|
67
66
|
export { x as BaileyChart, b as DEFAULT_DARK_PALETTE, y as DEFAULT_LIGHT_PALETTE };
|
package/dist/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare interface BaileyChatInputMessage {
|
|
|
77
77
|
titleHint?: string;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, emptyPlaceholder, suggestions, onHistoryClick, history, locale, privacyNote, resolveActivityIcon, sendIcon, className, height, width, hideDeveloperDetails, renderMessageActions, renderTable, renderChart, renderMcpApp, labels: labelsProp, formatMessageTime: formatMessageTimeProp, }: BaileyChatPanelProps): JSX_2.Element;
|
|
80
|
+
export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, emptyPlaceholder, assistantName, suggestions, suggestionsAlign, hideMenuButton, onHistoryClick, history, locale, privacyNote, resolveActivityIcon, sendIcon, className, height, width, hideDeveloperDetails, renderMessageActions, feedback, renderTable, renderChart, renderMcpApp, labels: labelsProp, formatMessageTime: formatMessageTimeProp, }: BaileyChatPanelProps): JSX_2.Element;
|
|
81
81
|
|
|
82
82
|
export declare interface BaileyChatPanelLabels extends ToolStepLabels, Partial<BaileyHistoryLabels> {
|
|
83
83
|
/** Visible text of the "new chat" item in the "..." menu. */
|
|
@@ -160,8 +160,19 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
|
|
|
160
160
|
emptyPlaceholder?: string;
|
|
161
161
|
/** Suggested prompts shown ("Suggested for you") in the empty state before any message has
|
|
162
162
|
* been sent. Clicking one calls chat.send(value ?? label). Omit to keep the plain
|
|
163
|
-
* "Ask
|
|
163
|
+
* "Ask bailey a question to get started." empty state. */
|
|
164
164
|
suggestions?: BaileySuggestion[];
|
|
165
|
+
/** What the assistant is called in the panel's default copy (empty-state message, input
|
|
166
|
+
* placeholders, feedback prompt). Defaults to 'bailey'. An explicit `labels`, `placeholder`,
|
|
167
|
+
* `emptyPlaceholder` or `replyPlaceholder` still wins. Pass the same value to `useBaileyChat`
|
|
168
|
+
* to rename the assistant in its error messages. */
|
|
169
|
+
assistantName?: string;
|
|
170
|
+
/** Placement of the suggestion cards. Defaults to 'start' (full-width cards at the top). 'end'
|
|
171
|
+
* right-aligns them and anchors them to the bottom of the transcript, just above the input. */
|
|
172
|
+
suggestionsAlign?: 'start' | 'end';
|
|
173
|
+
/** Hides the "..." menu button beside the input row entirely — including its "New chat" and
|
|
174
|
+
* history items, so a host that sets this must provide its own entry points for both. */
|
|
175
|
+
hideMenuButton?: boolean;
|
|
165
176
|
/** Adds a history item to the "..." menu beside the input row, beneath "New chat" — a host's
|
|
166
177
|
* entry point into its own conversation-history UI (this package has no opinion on how
|
|
167
178
|
* history is stored/listed; it only renders the trigger). Rendered regardless of `isEmpty`,
|
|
@@ -210,6 +221,12 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
|
|
|
210
221
|
* Content-derived actions (e.g. baileyai-skills-service's save-as-skill artifact UI) are a
|
|
211
222
|
* host-side composition around useBaileyChat, not this prop — see the Phase 4 plan. */
|
|
212
223
|
renderMessageActions?: (message: BaileyMessage) => ReactNode;
|
|
224
|
+
/** Thumbs up/down feedback on completed assistant messages. On by default whenever `chat` was
|
|
225
|
+
* created with a `client` (`chat.feedback`), a conversation id is held, and the message has a `serverMessageId`; the
|
|
226
|
+
* buttons render before `renderMessageActions`. Pass `false` to turn it off (e.g. when the
|
|
227
|
+
* host renders its own `BaileyFeedbackButtons`, or on a 503 from the feedback API), or an
|
|
228
|
+
* object to tune the reason chips, comment limit or labels. */
|
|
229
|
+
feedback?: false | Pick<BaileyFeedbackButtonsProps, 'reasonOptions' | 'maxCommentLength' | 'labels'>;
|
|
213
230
|
/** Overrides individual UI strings for localization — merged shallowly with English
|
|
214
231
|
* defaults, so a host only needs to supply the keys its i18n system actually translates.
|
|
215
232
|
* Pass fully-resolved strings, not translation keys — this package has no opinion on which
|
|
@@ -411,6 +428,8 @@ export declare interface BaileyFeedbackButtonsProps {
|
|
|
411
428
|
/** Comment length limit; defaults to 2000 and can only be lowered. */
|
|
412
429
|
maxCommentLength?: number;
|
|
413
430
|
labels?: Partial<BaileyFeedbackLabels>;
|
|
431
|
+
/** What the assistant is called in the default comment placeholder. Defaults to 'bailey'. */
|
|
432
|
+
assistantName?: string;
|
|
414
433
|
className?: string;
|
|
415
434
|
}
|
|
416
435
|
|
|
@@ -1027,12 +1046,14 @@ export declare type TraceSegment = {
|
|
|
1027
1046
|
|
|
1028
1047
|
export declare function traceSummaryLine(events: BaileyTraceEvent[]): string;
|
|
1029
1048
|
|
|
1030
|
-
export declare const useBaileyChat: ({ transport, model, instructions, tools, toolChoice, firstUserMessagePrefix, onAssistantMessageComplete, idleTimeoutMs, client, conversationId: seedConversationId, sub: rawSub, storage: storageOption, storageKey, sendFullTranscript, onStorageError, onContextLoss, }: UseBaileyChatConfig) => UseBaileyChatResult;
|
|
1049
|
+
export declare const useBaileyChat: ({ transport, model, instructions, assistantName, tools, toolChoice, firstUserMessagePrefix, onAssistantMessageComplete, idleTimeoutMs, client, conversationId: seedConversationId, sub: rawSub, storage: storageOption, storageKey, sendFullTranscript, onStorageError, onContextLoss, }: UseBaileyChatConfig) => UseBaileyChatResult;
|
|
1031
1050
|
|
|
1032
1051
|
export declare interface UseBaileyChatConfig {
|
|
1033
1052
|
transport: BaileyChatTransport;
|
|
1034
1053
|
model: string;
|
|
1035
1054
|
instructions: string;
|
|
1055
|
+
/** What the assistant is called in user-facing error messages. Defaults to 'bailey'. */
|
|
1056
|
+
assistantName?: string;
|
|
1036
1057
|
/** Passed verbatim to transport.streamChat on every turn. Memoize this array (e.g. via
|
|
1037
1058
|
* useMemo) to avoid recreating send/stop/retryLast on every render. */
|
|
1038
1059
|
tools?: BaileyMcpToolConfig[];
|
|
@@ -1176,6 +1197,12 @@ export declare interface UseBaileyChatResult {
|
|
|
1176
1197
|
hasEarlier?: boolean;
|
|
1177
1198
|
/** State of the most recent history load. */
|
|
1178
1199
|
historyStatus?: 'idle' | 'loading' | 'error';
|
|
1200
|
+
/** Feedback handlers bound to `client` and the held conversation id; present only when the hook
|
|
1201
|
+
* was given a `client`. `BaileyChatPanel` uses them to show thumbs up/down on assistant
|
|
1202
|
+
* messages by default. Becomes undefined once the feedback API answers 503 (disabled for the
|
|
1203
|
+
* environment), until `client` changes. Optional in the type so hosts that construct their own
|
|
1204
|
+
* result objects still compile. */
|
|
1205
|
+
feedback?: BaileyFeedbackHandlers;
|
|
1179
1206
|
}
|
|
1180
1207
|
|
|
1181
1208
|
/** Lists the caller's conversations through `client` (loading, error, refresh, load more, delete with
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/safeMarkdownUrl.ts
|
|
2
2
|
var e = /^(https?|mailto):/i, t = (e) => e.replace(/[\t\n\r]/g, "").trim(), n = (n) => {
|
|
3
3
|
let r = t(n);
|
|
4
4
|
return !/^[a-z][a-z0-9+.-]*:/i.test(r) || e.test(r);
|
|
@@ -6,5 +6,4 @@ var e = /^(https?|mailto):/i, t = (e) => e.replace(/[\t\n\r]/g, "").trim(), n =
|
|
|
6
6
|
let n = t(e);
|
|
7
7
|
return r.test(n) ? !0 : n.length <= a && i.test(n);
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n, o as t };
|
package/dist/table.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as e } from "./safeMarkdownUrl-
|
|
1
|
+
import { n as e } from "./safeMarkdownUrl-Dpm09Re7.js";
|
|
2
2
|
import { useMemo as t } from "react";
|
|
3
3
|
import { Fragment as n, jsx as r } from "react/jsx-runtime";
|
|
4
4
|
import { Box as i, Link as a } from "@mui/material";
|
|
5
5
|
import { AgGridReact as o } from "ag-grid-react";
|
|
6
6
|
import { ClientSideRowModelModule as s, ColumnAutoSizeModule as c, ColumnHoverModule as l, ModuleRegistry as u, NumberFilterModule as d, RowAutoHeightModule as f, RowStyleModule as p, TextFilterModule as m, TooltipModule as h, themeBalham as g } from "ag-grid-community";
|
|
7
|
-
|
|
7
|
+
// src/ui/BaileyTable.tsx
|
|
8
8
|
u.registerModules([
|
|
9
9
|
c,
|
|
10
10
|
l,
|
|
@@ -61,5 +61,4 @@ var _ = {
|
|
|
61
61
|
})
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
|
-
//#endregion
|
|
65
64
|
export { b as BaileyTable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/baileyai-chat-ui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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": {
|
|
@@ -121,12 +121,12 @@
|
|
|
121
121
|
"tailwindcss": "^4.3.1",
|
|
122
122
|
"typescript": "^6.0.3",
|
|
123
123
|
"typescript-eslint": "^8.67.0",
|
|
124
|
-
"vite": "^8.
|
|
124
|
+
"vite": "^8.3.5",
|
|
125
125
|
"vite-plugin-dts": "^4.5.4",
|
|
126
126
|
"vitest": "^4.1.10"
|
|
127
127
|
},
|
|
128
128
|
"resolutions": {
|
|
129
129
|
"minimatch/brace-expansion": "2.1.4-aikido.2",
|
|
130
|
-
"node-gyp/undici": "8.10.2"
|
|
130
|
+
"node-gyp/undici": "8.10.2-aikido.3"
|
|
131
131
|
}
|
|
132
132
|
}
|