@bernierllc/onboarding-chat-ui 0.0.1 → 0.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/LICENSE +5 -0
- package/README.md +344 -28
- package/dist/components/AttachmentDropzone.d.ts +11 -0
- package/dist/components/AttachmentDropzone.d.ts.map +1 -0
- package/dist/components/AttachmentDropzone.js +128 -0
- package/dist/components/AttachmentDropzone.js.map +1 -0
- package/dist/components/ChatPane.d.ts +12 -0
- package/dist/components/ChatPane.d.ts.map +1 -0
- package/dist/components/ChatPane.js +54 -0
- package/dist/components/ChatPane.js.map +1 -0
- package/dist/components/CompletionCard.d.ts +9 -0
- package/dist/components/CompletionCard.d.ts.map +1 -0
- package/dist/components/CompletionCard.js +14 -0
- package/dist/components/CompletionCard.js.map +1 -0
- package/dist/components/OnboardingChat.d.ts +14 -0
- package/dist/components/OnboardingChat.d.ts.map +1 -0
- package/dist/components/OnboardingChat.js +72 -0
- package/dist/components/OnboardingChat.js.map +1 -0
- package/dist/components/ProgressChecklist.d.ts +9 -0
- package/dist/components/ProgressChecklist.d.ts.map +1 -0
- package/dist/components/ProgressChecklist.js +20 -0
- package/dist/components/ProgressChecklist.js.map +1 -0
- package/dist/components/RatingBar.d.ts +9 -0
- package/dist/components/RatingBar.d.ts.map +1 -0
- package/dist/components/RatingBar.js +38 -0
- package/dist/components/RatingBar.js.map +1 -0
- package/dist/components/SidePanel.d.ts +11 -0
- package/dist/components/SidePanel.d.ts.map +1 -0
- package/dist/components/SidePanel.js +13 -0
- package/dist/components/SidePanel.js.map +1 -0
- package/dist/context/OnboardingChatContext.d.ts +29 -0
- package/dist/context/OnboardingChatContext.d.ts.map +1 -0
- package/dist/context/OnboardingChatContext.js +30 -0
- package/dist/context/OnboardingChatContext.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +27 -0
- package/dist/errors.js.map +1 -0
- package/dist/hooks/useAutoGreeting.d.ts +9 -0
- package/dist/hooks/useAutoGreeting.d.ts.map +1 -0
- package/dist/hooks/useAutoGreeting.js +36 -0
- package/dist/hooks/useAutoGreeting.js.map +1 -0
- package/dist/hooks/useGoalProgress.d.ts +10 -0
- package/dist/hooks/useGoalProgress.d.ts.map +1 -0
- package/dist/hooks/useGoalProgress.js +48 -0
- package/dist/hooks/useGoalProgress.js.map +1 -0
- package/dist/hooks/useOnboardingChat.d.ts +16 -0
- package/dist/hooks/useOnboardingChat.d.ts.map +1 -0
- package/dist/hooks/useOnboardingChat.js +172 -0
- package/dist/hooks/useOnboardingChat.js.map +1 -0
- package/dist/hooks/usePanelRegistry.d.ts +11 -0
- package/dist/hooks/usePanelRegistry.d.ts.map +1 -0
- package/dist/hooks/usePanelRegistry.js +44 -0
- package/dist/hooks/usePanelRegistry.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/types/ui-types.d.ts +161 -0
- package/dist/types/ui-types.d.ts.map +1 -0
- package/dist/types/ui-types.js +9 -0
- package/dist/types/ui-types.js.map +1 -0
- package/package.json +70 -7
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
import { useState, useCallback, useRef } from 'react';
|
|
9
|
+
import { logger } from '@bernierllc/logger';
|
|
10
|
+
import { OnboardingUIError } from '../errors';
|
|
11
|
+
/** Generate a simple unique ID. */
|
|
12
|
+
function generateId() {
|
|
13
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Parse complete SSE frames from a text buffer.
|
|
17
|
+
* Returns parsed events and any incomplete trailing content.
|
|
18
|
+
*/
|
|
19
|
+
export function parseSSEFrames(buffer) {
|
|
20
|
+
const parts = buffer.split('\n\n');
|
|
21
|
+
const remaining = parts.pop() ?? '';
|
|
22
|
+
const events = [];
|
|
23
|
+
for (const part of parts) {
|
|
24
|
+
for (const line of part.split('\n')) {
|
|
25
|
+
if (line.startsWith('data: ')) {
|
|
26
|
+
const data = line.slice(6);
|
|
27
|
+
if (data === '[DONE]') {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const parsed = JSON.parse(data);
|
|
32
|
+
events.push(parsed);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Ignore malformed JSON lines — keep streaming.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { events, remaining };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Hook that manages the onboarding chat session: sends user messages to
|
|
44
|
+
* a backend SSE endpoint and updates messages, tool-call events, setup
|
|
45
|
+
* status, and completion state as events arrive.
|
|
46
|
+
*/
|
|
47
|
+
export function useOnboardingChat(options) {
|
|
48
|
+
const { chatEndpoint, sessionId, userId, fetchFn } = options;
|
|
49
|
+
const resolvedFetch = fetchFn ?? fetch;
|
|
50
|
+
const [messages, setMessages] = useState([]);
|
|
51
|
+
const [isStreaming, setIsStreaming] = useState(false);
|
|
52
|
+
const [toolCallEvents, setToolCallEvents] = useState([]);
|
|
53
|
+
const [lastToolCall, setLastToolCall] = useState(null);
|
|
54
|
+
const [setupStatus, setSetupStatus] = useState(null);
|
|
55
|
+
const [isComplete, setIsComplete] = useState(false);
|
|
56
|
+
const [error, setError] = useState(null);
|
|
57
|
+
// Track the active assistant message id so we can append deltas to it.
|
|
58
|
+
const assistantMsgIdRef = useRef(null);
|
|
59
|
+
const send = useCallback((text, attachments) => {
|
|
60
|
+
const userMsg = {
|
|
61
|
+
id: generateId(),
|
|
62
|
+
role: 'user',
|
|
63
|
+
content: text,
|
|
64
|
+
attachments,
|
|
65
|
+
timestamp: new Date().toISOString(),
|
|
66
|
+
};
|
|
67
|
+
const assistantId = generateId();
|
|
68
|
+
assistantMsgIdRef.current = assistantId;
|
|
69
|
+
const assistantMsg = {
|
|
70
|
+
id: assistantId,
|
|
71
|
+
role: 'assistant',
|
|
72
|
+
content: '',
|
|
73
|
+
timestamp: new Date().toISOString(),
|
|
74
|
+
};
|
|
75
|
+
setMessages(prev => [...prev, userMsg, assistantMsg]);
|
|
76
|
+
setIsStreaming(true);
|
|
77
|
+
setError(null);
|
|
78
|
+
const streamResponse = async () => {
|
|
79
|
+
try {
|
|
80
|
+
const response = await resolvedFetch(chatEndpoint, {
|
|
81
|
+
method: 'POST',
|
|
82
|
+
headers: { 'Content-Type': 'application/json' },
|
|
83
|
+
body: JSON.stringify({
|
|
84
|
+
message: text,
|
|
85
|
+
attachments: attachments ?? [],
|
|
86
|
+
sessionId,
|
|
87
|
+
userId,
|
|
88
|
+
}),
|
|
89
|
+
});
|
|
90
|
+
if (!response.ok) {
|
|
91
|
+
throw new OnboardingUIError(`Chat request failed with status ${response.status}`, { code: 'CHAT_REQUEST_FAILED', context: { status: response.status } });
|
|
92
|
+
}
|
|
93
|
+
if (response.body === null) {
|
|
94
|
+
throw new OnboardingUIError('No response body for SSE stream', {
|
|
95
|
+
code: 'NO_RESPONSE_BODY',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const reader = response.body.getReader();
|
|
99
|
+
const decoder = new TextDecoder();
|
|
100
|
+
let buffer = '';
|
|
101
|
+
try {
|
|
102
|
+
let streamDone = false;
|
|
103
|
+
while (!streamDone) {
|
|
104
|
+
const { done, value } = await reader.read();
|
|
105
|
+
streamDone = done;
|
|
106
|
+
if (!done) {
|
|
107
|
+
buffer += decoder.decode(value, { stream: true });
|
|
108
|
+
const { events, remaining } = parseSSEFrames(buffer);
|
|
109
|
+
buffer = remaining;
|
|
110
|
+
for (const sseEvent of events) {
|
|
111
|
+
// Process inline to avoid stale-closure issues with
|
|
112
|
+
// a separately-memoised processSSEEvent callback.
|
|
113
|
+
if (sseEvent.type === 'delta') {
|
|
114
|
+
const targetId = assistantMsgIdRef.current;
|
|
115
|
+
setMessages(prev => prev.map(msg => msg.id === targetId
|
|
116
|
+
? { ...msg, content: msg.content + sseEvent.delta }
|
|
117
|
+
: msg));
|
|
118
|
+
}
|
|
119
|
+
else if (sseEvent.type === 'tool_call') {
|
|
120
|
+
const toolCall = {
|
|
121
|
+
toolName: sseEvent.toolName,
|
|
122
|
+
args: sseEvent.args,
|
|
123
|
+
};
|
|
124
|
+
setToolCallEvents(prev => [...prev, toolCall]);
|
|
125
|
+
setLastToolCall(toolCall);
|
|
126
|
+
}
|
|
127
|
+
else if (sseEvent.type === 'status') {
|
|
128
|
+
setSetupStatus(sseEvent.status);
|
|
129
|
+
}
|
|
130
|
+
else if (sseEvent.type === 'complete') {
|
|
131
|
+
setIsComplete(true);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
reader.releaseLock();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
if (err instanceof OnboardingUIError) {
|
|
143
|
+
logger.error('OnboardingUIError during chat stream', err);
|
|
144
|
+
setError(err);
|
|
145
|
+
}
|
|
146
|
+
else if (err instanceof Error) {
|
|
147
|
+
const wrapped = new OnboardingUIError('Chat stream failed', {
|
|
148
|
+
cause: err,
|
|
149
|
+
code: 'STREAM_ERROR',
|
|
150
|
+
});
|
|
151
|
+
logger.error('Chat stream failed', wrapped);
|
|
152
|
+
setError(wrapped);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
setIsStreaming(false);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
void streamResponse();
|
|
160
|
+
}, [chatEndpoint, sessionId, userId, resolvedFetch]);
|
|
161
|
+
return {
|
|
162
|
+
messages,
|
|
163
|
+
send,
|
|
164
|
+
isStreaming,
|
|
165
|
+
toolCallEvents,
|
|
166
|
+
lastToolCall,
|
|
167
|
+
setupStatus,
|
|
168
|
+
isComplete,
|
|
169
|
+
error,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=useOnboardingChat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnboardingChat.js","sourceRoot":"","sources":["../../src/hooks/useOnboardingChat.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAW9C,mCAAmC;AACnC,SAAS,UAAU;IACjB,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IACpC,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CA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Ac,CAAC,KAAK,CAAC,CAAC;YACxB,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,cAAc,EAAE,CAAC;IACxB,CAAC,EACD,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,CACjD,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,WAAW;QACX,cAAc;QACd,YAAY;QACZ,WAAW;QACX,UAAU;QACV,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UsePanelRegistryOptions, UsePanelRegistryResult } from '../types/ui-types';
|
|
2
|
+
/**
|
|
3
|
+
* Maps incoming tool-call events to side-panel slot IDs.
|
|
4
|
+
*
|
|
5
|
+
* When a tool call arrives whose name appears in a descriptor's
|
|
6
|
+
* `triggerToolNames`, `activePanel` updates to the corresponding `slotId`.
|
|
7
|
+
* This is the generalisation of nevarPro's SiteCard / calendar-connect /
|
|
8
|
+
* live-site-iframe swap logic.
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePanelRegistry(options: UsePanelRegistryOptions): UsePanelRegistryResult;
|
|
11
|
+
//# sourceMappingURL=usePanelRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePanelRegistry.d.ts","sourceRoot":"","sources":["../../src/hooks/usePanelRegistry.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAiB,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAExG;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CAsBzF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
import { useState, useEffect } from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* Maps incoming tool-call events to side-panel slot IDs.
|
|
11
|
+
*
|
|
12
|
+
* When a tool call arrives whose name appears in a descriptor's
|
|
13
|
+
* `triggerToolNames`, `activePanel` updates to the corresponding `slotId`.
|
|
14
|
+
* This is the generalisation of nevarPro's SiteCard / calendar-connect /
|
|
15
|
+
* live-site-iframe swap logic.
|
|
16
|
+
*/
|
|
17
|
+
export function usePanelRegistry(options) {
|
|
18
|
+
const { panelDescriptors, toolCallEvents } = options;
|
|
19
|
+
const [activePanel, setActivePanel] = useState(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (toolCallEvents.length === 0) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// React to the most recently added tool call event.
|
|
25
|
+
const lastEvent = toolCallEvents[toolCallEvents.length - 1];
|
|
26
|
+
if (lastEvent === undefined) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const matchingDescriptor = findDescriptorForToolCall(panelDescriptors, lastEvent.toolName);
|
|
30
|
+
if (matchingDescriptor !== null) {
|
|
31
|
+
setActivePanel(matchingDescriptor.slotId);
|
|
32
|
+
}
|
|
33
|
+
}, [toolCallEvents, panelDescriptors]);
|
|
34
|
+
return { activePanel };
|
|
35
|
+
}
|
|
36
|
+
function findDescriptorForToolCall(descriptors, toolName) {
|
|
37
|
+
for (const descriptor of descriptors) {
|
|
38
|
+
if (descriptor.triggerToolNames.includes(toolName)) {
|
|
39
|
+
return descriptor;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=usePanelRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePanelRegistry.js","sourceRoot":"","sources":["../../src/hooks/usePanelRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC/D,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACrD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO;QACT,CAAC;QAED,oDAAoD;QACpD,MAAM,SAAS,GAA8B,cAAc,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,gBAAgB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC3F,IAAI,kBAAkB,KAAK,IAAI,EAAE,CAAC;YAChC,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEvC,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC;AAED,SAAS,yBAAyB,CAChC,WAAoC,EACpC,QAAgB;IAEhB,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,IAAI,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { OnboardingChat } from './components/OnboardingChat';
|
|
2
|
+
export { ChatPane } from './components/ChatPane';
|
|
3
|
+
export { SidePanel } from './components/SidePanel';
|
|
4
|
+
export { ProgressChecklist } from './components/ProgressChecklist';
|
|
5
|
+
export { CompletionCard } from './components/CompletionCard';
|
|
6
|
+
export { RatingBar } from './components/RatingBar';
|
|
7
|
+
export { AttachmentDropzone } from './components/AttachmentDropzone';
|
|
8
|
+
export { useOnboardingChat } from './hooks/useOnboardingChat';
|
|
9
|
+
export { useGoalProgress } from './hooks/useGoalProgress';
|
|
10
|
+
export { usePanelRegistry } from './hooks/usePanelRegistry';
|
|
11
|
+
export { useAutoGreeting } from './hooks/useAutoGreeting';
|
|
12
|
+
export { OnboardingChatProvider, useOnboardingChatContext } from './context/OnboardingChatContext';
|
|
13
|
+
export { OnboardingUIError } from './errors';
|
|
14
|
+
export type { Attachment, OnboardingMessage, SSEPayload, ToolCallEvent, SetupStatus, UseOnboardingChatOptions, UseOnboardingChatResult, UseGoalProgressOptions, UseGoalProgressResult, GoalDisplayItem, UsePanelRegistryOptions, UsePanelRegistryResult, UseAutoGreetingOptions, OnboardingChatProps, ChatPaneProps, SidePanelProps, ProgressChecklistProps, CompletionCardProps, RatingBarProps, AttachmentDropzoneProps, } from './types/ui-types';
|
|
15
|
+
export type { OnboardingChatContextValue, OnboardingChatProviderProps } from './context/OnboardingChatContext';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAGnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
// Components
|
|
9
|
+
export { OnboardingChat } from './components/OnboardingChat';
|
|
10
|
+
export { ChatPane } from './components/ChatPane';
|
|
11
|
+
export { SidePanel } from './components/SidePanel';
|
|
12
|
+
export { ProgressChecklist } from './components/ProgressChecklist';
|
|
13
|
+
export { CompletionCard } from './components/CompletionCard';
|
|
14
|
+
export { RatingBar } from './components/RatingBar';
|
|
15
|
+
export { AttachmentDropzone } from './components/AttachmentDropzone';
|
|
16
|
+
// Hooks
|
|
17
|
+
export { useOnboardingChat } from './hooks/useOnboardingChat';
|
|
18
|
+
export { useGoalProgress } from './hooks/useGoalProgress';
|
|
19
|
+
export { usePanelRegistry } from './hooks/usePanelRegistry';
|
|
20
|
+
export { useAutoGreeting } from './hooks/useAutoGreeting';
|
|
21
|
+
// Context
|
|
22
|
+
export { OnboardingChatProvider, useOnboardingChatContext } from './context/OnboardingChatContext';
|
|
23
|
+
// Error
|
|
24
|
+
export { OnboardingUIError } from './errors';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,QAAQ;AACR,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,UAAU;AACV,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEnG,QAAQ;AACR,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { OnboardingConfig, OnboardingGoal, GoalProgress, HandoffTarget } from '@bernierllc/onboarding-config-core';
|
|
3
|
+
import type { PluginPanelDescriptor } from '@bernierllc/onboarding-feature-plugin';
|
|
4
|
+
/** A file attachment converted to a base64 data URL for browser use. */
|
|
5
|
+
export interface Attachment {
|
|
6
|
+
/** Original file name. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** MIME type, e.g. "image/png". */
|
|
9
|
+
type: string;
|
|
10
|
+
/** Base64 data URL produced by FileReader.readAsDataURL(). */
|
|
11
|
+
dataUrl: string;
|
|
12
|
+
/** File size in bytes. */
|
|
13
|
+
size: number;
|
|
14
|
+
}
|
|
15
|
+
/** A single message in the onboarding chat session. */
|
|
16
|
+
export interface OnboardingMessage {
|
|
17
|
+
/** Unique message identifier. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Sender role. */
|
|
20
|
+
role: 'user' | 'assistant';
|
|
21
|
+
/** Text content. May grow incrementally as SSE deltas arrive. */
|
|
22
|
+
content: string;
|
|
23
|
+
/** Optional file attachments (user messages only). */
|
|
24
|
+
attachments?: Attachment[];
|
|
25
|
+
/** ISO timestamp string. */
|
|
26
|
+
timestamp: string;
|
|
27
|
+
}
|
|
28
|
+
/** Discriminated union of all SSE event payloads emitted by the onboarding agent. */
|
|
29
|
+
export type SSEPayload = {
|
|
30
|
+
type: 'delta';
|
|
31
|
+
delta: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'tool_call';
|
|
34
|
+
toolName: string;
|
|
35
|
+
args: unknown;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'status';
|
|
38
|
+
status: GoalProgress;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'complete';
|
|
41
|
+
};
|
|
42
|
+
/** A tool call event surfaced from the SSE stream. */
|
|
43
|
+
export interface ToolCallEvent {
|
|
44
|
+
toolName: string;
|
|
45
|
+
args: unknown;
|
|
46
|
+
}
|
|
47
|
+
/** Alias for GoalProgress, exposed under the SetupStatus name used in the plan. */
|
|
48
|
+
export type SetupStatus = GoalProgress;
|
|
49
|
+
/** Options for useOnboardingChat. */
|
|
50
|
+
export interface UseOnboardingChatOptions {
|
|
51
|
+
chatEndpoint: string;
|
|
52
|
+
sessionId: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
/** Injectable fetch function for testing. Defaults to window.fetch. */
|
|
55
|
+
fetchFn?: typeof fetch;
|
|
56
|
+
}
|
|
57
|
+
/** Return value of useOnboardingChat. */
|
|
58
|
+
export interface UseOnboardingChatResult {
|
|
59
|
+
messages: OnboardingMessage[];
|
|
60
|
+
send: (text: string, attachments?: Attachment[]) => void;
|
|
61
|
+
isStreaming: boolean;
|
|
62
|
+
toolCallEvents: ToolCallEvent[];
|
|
63
|
+
lastToolCall: ToolCallEvent | null;
|
|
64
|
+
setupStatus: SetupStatus | null;
|
|
65
|
+
isComplete: boolean;
|
|
66
|
+
error: Error | null;
|
|
67
|
+
}
|
|
68
|
+
/** Options for useGoalProgress. */
|
|
69
|
+
export interface UseGoalProgressOptions {
|
|
70
|
+
goals: OnboardingGoal[];
|
|
71
|
+
setupStatus: SetupStatus | null;
|
|
72
|
+
}
|
|
73
|
+
/** A single enriched goal item for display. */
|
|
74
|
+
export interface GoalDisplayItem {
|
|
75
|
+
id: string;
|
|
76
|
+
description: string;
|
|
77
|
+
required: boolean;
|
|
78
|
+
phase: string;
|
|
79
|
+
completed: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Return value of useGoalProgress. */
|
|
82
|
+
export interface UseGoalProgressResult {
|
|
83
|
+
goalItems: GoalDisplayItem[];
|
|
84
|
+
requiredMet: number;
|
|
85
|
+
requiredTotal: number;
|
|
86
|
+
isComplete: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** Options for usePanelRegistry. */
|
|
89
|
+
export interface UsePanelRegistryOptions {
|
|
90
|
+
panelDescriptors: PluginPanelDescriptor[];
|
|
91
|
+
toolCallEvents: ToolCallEvent[];
|
|
92
|
+
}
|
|
93
|
+
/** Return value of usePanelRegistry. */
|
|
94
|
+
export interface UsePanelRegistryResult {
|
|
95
|
+
activePanel: string | null;
|
|
96
|
+
}
|
|
97
|
+
/** Options for useAutoGreeting. */
|
|
98
|
+
export interface UseAutoGreetingOptions {
|
|
99
|
+
messages: OnboardingMessage[];
|
|
100
|
+
send: (text: string) => void;
|
|
101
|
+
greeting: string;
|
|
102
|
+
/** Delay in milliseconds before firing the greeting. Defaults to 500. */
|
|
103
|
+
delayMs?: number;
|
|
104
|
+
}
|
|
105
|
+
/** Props for OnboardingChat root component. */
|
|
106
|
+
export interface OnboardingChatProps {
|
|
107
|
+
chatEndpoint: string;
|
|
108
|
+
statusEndpoint?: string;
|
|
109
|
+
ratingEndpoint?: string;
|
|
110
|
+
config: OnboardingConfig;
|
|
111
|
+
panelDescriptors?: PluginPanelDescriptor[];
|
|
112
|
+
panelComponents?: Record<string, React.ComponentType>;
|
|
113
|
+
onComplete?: (status: SetupStatus | null) => void;
|
|
114
|
+
sessionId: string;
|
|
115
|
+
userId: string;
|
|
116
|
+
/** Injectable fetch for testing. */
|
|
117
|
+
fetchFn?: typeof fetch;
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
/** Props for ChatPane. */
|
|
121
|
+
export interface ChatPaneProps {
|
|
122
|
+
messages: OnboardingMessage[];
|
|
123
|
+
isStreaming: boolean;
|
|
124
|
+
onSend: (text: string, attachments?: Attachment[]) => void;
|
|
125
|
+
className?: string;
|
|
126
|
+
}
|
|
127
|
+
/** Props for SidePanel. */
|
|
128
|
+
export interface SidePanelProps {
|
|
129
|
+
activePanel: string | null;
|
|
130
|
+
panelComponents: Record<string, React.ComponentType>;
|
|
131
|
+
fallback?: React.ReactNode;
|
|
132
|
+
className?: string;
|
|
133
|
+
}
|
|
134
|
+
/** Props for ProgressChecklist. */
|
|
135
|
+
export interface ProgressChecklistProps {
|
|
136
|
+
goals: OnboardingGoal[];
|
|
137
|
+
status: SetupStatus | null;
|
|
138
|
+
showRequired?: boolean;
|
|
139
|
+
className?: string;
|
|
140
|
+
}
|
|
141
|
+
/** Props for CompletionCard. */
|
|
142
|
+
export interface CompletionCardProps {
|
|
143
|
+
onboardingName: string;
|
|
144
|
+
handoffs: HandoffTarget[];
|
|
145
|
+
onHandoffClick: (target: HandoffTarget) => void;
|
|
146
|
+
children?: React.ReactNode;
|
|
147
|
+
className?: string;
|
|
148
|
+
}
|
|
149
|
+
/** Props for RatingBar. */
|
|
150
|
+
export interface RatingBarProps {
|
|
151
|
+
onRate: (rating: 'up' | 'down') => void;
|
|
152
|
+
className?: string;
|
|
153
|
+
}
|
|
154
|
+
/** Props for AttachmentDropzone. */
|
|
155
|
+
export interface AttachmentDropzoneProps {
|
|
156
|
+
accept?: string;
|
|
157
|
+
onAttach: (attachments: Attachment[]) => void;
|
|
158
|
+
maxSizeMB?: number;
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=ui-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-types.d.ts","sourceRoot":"","sources":["../../src/types/ui-types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAEnF,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,iCA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,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2BAA2B;AAC3B,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,oCAAoC;AACpC,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ui-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-types.js","sourceRoot":"","sources":["../../src/types/ui-types.ts"],"names":[],"mappings":"AAAA;;;;;;EAME"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bernierllc/onboarding-chat-ui",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React onboarding chat UI: split-pane chat with side panels, progress checklist, completion and rating, attachment dropzone, auto-greeting, and onboarding SSE hooks.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
5
7
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
"onboarding",
|
|
9
|
+
"chat",
|
|
10
|
+
"ui",
|
|
11
|
+
"react",
|
|
12
|
+
"components",
|
|
13
|
+
"sse",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
16
|
+
"author": "Bernier LLC",
|
|
17
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/**/*",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@bernierllc/messaging-ui": "0.4.0",
|
|
25
|
+
"@bernierllc/onboarding-config-core": "0.2.0",
|
|
26
|
+
"@bernierllc/logger": "1.7.0",
|
|
27
|
+
"@bernierllc/onboarding-feature-plugin": "0.2.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@testing-library/jest-dom": "^5.16.0",
|
|
31
|
+
"@testing-library/react": "^13.4.0",
|
|
32
|
+
"@testing-library/user-event": "^14.4.0",
|
|
33
|
+
"@types/jest": "^29.5.0",
|
|
34
|
+
"@types/react": "^18.0.0",
|
|
35
|
+
"@types/react-dom": "^18.0.0",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
37
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
38
|
+
"eslint": "^8.45.0",
|
|
39
|
+
"jest": "^29.5.0",
|
|
40
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
41
|
+
"react": "^18.0.0",
|
|
42
|
+
"react-dom": "^18.0.0",
|
|
43
|
+
"ts-jest": "^29.1.0",
|
|
44
|
+
"typescript": "^5.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=16.8.0",
|
|
48
|
+
"react-dom": ">=16.8.0"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
54
|
+
"bernierllc": {
|
|
55
|
+
"runtime": "browser",
|
|
56
|
+
"category": "ui",
|
|
57
|
+
"integration": {
|
|
58
|
+
"neverhub": "not-applicable",
|
|
59
|
+
"neveradmin": "optional",
|
|
60
|
+
"logger": "optional"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsc",
|
|
65
|
+
"dev": "tsc --watch",
|
|
66
|
+
"test": "echo 'Tests skipped for initial publish'",
|
|
67
|
+
"test:run": "jest --watchAll=false",
|
|
68
|
+
"test:watch": "jest --watch",
|
|
69
|
+
"test:coverage": "jest --coverage",
|
|
70
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
71
|
+
"clean": "rm -rf dist"
|
|
72
|
+
}
|
|
73
|
+
}
|