@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.
Files changed (63) hide show
  1. package/LICENSE +5 -0
  2. package/README.md +344 -28
  3. package/dist/components/AttachmentDropzone.d.ts +11 -0
  4. package/dist/components/AttachmentDropzone.d.ts.map +1 -0
  5. package/dist/components/AttachmentDropzone.js +128 -0
  6. package/dist/components/AttachmentDropzone.js.map +1 -0
  7. package/dist/components/ChatPane.d.ts +12 -0
  8. package/dist/components/ChatPane.d.ts.map +1 -0
  9. package/dist/components/ChatPane.js +54 -0
  10. package/dist/components/ChatPane.js.map +1 -0
  11. package/dist/components/CompletionCard.d.ts +9 -0
  12. package/dist/components/CompletionCard.d.ts.map +1 -0
  13. package/dist/components/CompletionCard.js +14 -0
  14. package/dist/components/CompletionCard.js.map +1 -0
  15. package/dist/components/OnboardingChat.d.ts +14 -0
  16. package/dist/components/OnboardingChat.d.ts.map +1 -0
  17. package/dist/components/OnboardingChat.js +72 -0
  18. package/dist/components/OnboardingChat.js.map +1 -0
  19. package/dist/components/ProgressChecklist.d.ts +9 -0
  20. package/dist/components/ProgressChecklist.d.ts.map +1 -0
  21. package/dist/components/ProgressChecklist.js +20 -0
  22. package/dist/components/ProgressChecklist.js.map +1 -0
  23. package/dist/components/RatingBar.d.ts +9 -0
  24. package/dist/components/RatingBar.d.ts.map +1 -0
  25. package/dist/components/RatingBar.js +38 -0
  26. package/dist/components/RatingBar.js.map +1 -0
  27. package/dist/components/SidePanel.d.ts +11 -0
  28. package/dist/components/SidePanel.d.ts.map +1 -0
  29. package/dist/components/SidePanel.js +13 -0
  30. package/dist/components/SidePanel.js.map +1 -0
  31. package/dist/context/OnboardingChatContext.d.ts +29 -0
  32. package/dist/context/OnboardingChatContext.d.ts.map +1 -0
  33. package/dist/context/OnboardingChatContext.js +30 -0
  34. package/dist/context/OnboardingChatContext.js.map +1 -0
  35. package/dist/errors.d.ts +16 -0
  36. package/dist/errors.d.ts.map +1 -0
  37. package/dist/errors.js +27 -0
  38. package/dist/errors.js.map +1 -0
  39. package/dist/hooks/useAutoGreeting.d.ts +9 -0
  40. package/dist/hooks/useAutoGreeting.d.ts.map +1 -0
  41. package/dist/hooks/useAutoGreeting.js +36 -0
  42. package/dist/hooks/useAutoGreeting.js.map +1 -0
  43. package/dist/hooks/useGoalProgress.d.ts +10 -0
  44. package/dist/hooks/useGoalProgress.d.ts.map +1 -0
  45. package/dist/hooks/useGoalProgress.js +48 -0
  46. package/dist/hooks/useGoalProgress.js.map +1 -0
  47. package/dist/hooks/useOnboardingChat.d.ts +16 -0
  48. package/dist/hooks/useOnboardingChat.d.ts.map +1 -0
  49. package/dist/hooks/useOnboardingChat.js +172 -0
  50. package/dist/hooks/useOnboardingChat.js.map +1 -0
  51. package/dist/hooks/usePanelRegistry.d.ts +11 -0
  52. package/dist/hooks/usePanelRegistry.d.ts.map +1 -0
  53. package/dist/hooks/usePanelRegistry.js +44 -0
  54. package/dist/hooks/usePanelRegistry.js.map +1 -0
  55. package/dist/index.d.ts +16 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +25 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/types/ui-types.d.ts +161 -0
  60. package/dist/types/ui-types.d.ts.map +1 -0
  61. package/dist/types/ui-types.js +9 -0
  62. package/dist/types/ui-types.js.map +1 -0
  63. package/package.json +70 -7
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Post-completion summary card shown when the onboarding session finishes.
4
+ * Displays the onboarding name, any handoff targets, and slots for children
5
+ * (typically a `<RatingBar>`).
6
+ */
7
+ export function CompletionCard({ onboardingName, handoffs, onHandoffClick, children, className, }) {
8
+ const sortedHandoffs = [...handoffs].sort((a, b) => a.order - b.order);
9
+ return (_jsxs("div", { className: ['ocu-completion-card', className].filter(Boolean).join(' '), role: "region", "aria-label": "Onboarding complete", children: [_jsxs("div", { className: "ocu-completion-card__header", children: [_jsx("span", { className: "ocu-completion-card__icon", "aria-hidden": "true", children: "\uD83C\uDF89" }), _jsxs("h2", { className: "ocu-completion-card__title", children: [onboardingName, " Complete!"] }), _jsx("p", { className: "ocu-completion-card__subtitle", children: "You're all set. Here's what you can do next:" })] }), sortedHandoffs.length > 0 && (_jsx("ul", { className: "ocu-completion-card__handoffs", children: sortedHandoffs.map(target => (_jsx(HandoffItem, { target: target, onClick: onHandoffClick }, target.id))) })), children !== undefined && children !== null && (_jsx("div", { className: "ocu-completion-card__footer", children: children }))] }));
10
+ }
11
+ function HandoffItem({ target, onClick }) {
12
+ return (_jsx("li", { className: "ocu-completion-card__handoff-item", children: _jsx("button", { type: "button", className: "ocu-completion-card__handoff-btn", onClick: () => onClick(target), children: target.label }) }));
13
+ }
14
+ //# sourceMappingURL=CompletionCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompletionCard.js","sourceRoot":"","sources":["../../src/components/CompletionCard.tsx"],"names":[],"mappings":";AAYA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,cAAc,EACd,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,SAAS,GACW;IACpB,MAAM,cAAc,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAEvE,OAAO,CACL,eACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAC,QAAQ,gBACF,qBAAqB,aAEhC,eAAK,SAAS,EAAC,6BAA6B,aAC1C,eAAM,SAAS,EAAC,2BAA2B,iBAAa,MAAM,6BAEvD,EACP,cAAI,SAAS,EAAC,4BAA4B,aACvC,cAAc,kBACZ,EACL,YAAG,SAAS,EAAC,+BAA+B,6DAExC,IACA,EAEL,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAC5B,aAAI,SAAS,EAAC,+BAA+B,YAC1C,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC5B,KAAC,WAAW,IAEV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,IAFlB,MAAM,CAAC,EAAE,CAGd,CACH,CAAC,GACC,CACN,EAEA,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,CAC9C,cAAK,SAAS,EAAC,6BAA6B,YAAE,QAAQ,GAAO,CAC9D,IACG,CACP,CAAC;AACJ,CAAC;AAOD,SAAS,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,EAAoB;IACxD,OAAO,CACL,aAAI,SAAS,EAAC,mCAAmC,YAC/C,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kCAAkC,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,YAE7B,MAAM,CAAC,KAAK,GACN,GACN,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { OnboardingChatProps } from '../types/ui-types';
3
+ /**
4
+ * Root split-pane onboarding chat component.
5
+ *
6
+ * Composes all hooks and child components:
7
+ * - Left pane: `<ChatPane>` with message list and input
8
+ * - Right pane: `<SidePanel>` driven by `usePanelRegistry`
9
+ * - `<ProgressChecklist>` shows live goal completion
10
+ * - `<CompletionCard>` + `<RatingBar>` shown when session ends
11
+ * - `useAutoGreeting` fires the persona greeting on mount
12
+ */
13
+ export declare function OnboardingChat({ chatEndpoint, ratingEndpoint, config, panelDescriptors, panelComponents, onComplete, sessionId, userId, fetchFn, className, }: OnboardingChatProps): React.ReactElement;
14
+ //# sourceMappingURL=OnboardingChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnboardingChat.d.ts","sourceRoot":"","sources":["../../src/components/OnboardingChat.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAUzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,cAAc,EACd,MAAM,EACN,gBAAqB,EACrB,eAAoB,EACpB,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,EACP,SAAS,GACV,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAoG1C"}
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ import { useEffect } from 'react';
10
+ import { useOnboardingChat } from '../hooks/useOnboardingChat';
11
+ import { usePanelRegistry } from '../hooks/usePanelRegistry';
12
+ import { useAutoGreeting } from '../hooks/useAutoGreeting';
13
+ import { OnboardingChatProvider } from '../context/OnboardingChatContext';
14
+ import { ChatPane } from './ChatPane';
15
+ import { SidePanel } from './SidePanel';
16
+ import { ProgressChecklist } from './ProgressChecklist';
17
+ import { CompletionCard } from './CompletionCard';
18
+ import { RatingBar } from './RatingBar';
19
+ /**
20
+ * Root split-pane onboarding chat component.
21
+ *
22
+ * Composes all hooks and child components:
23
+ * - Left pane: `<ChatPane>` with message list and input
24
+ * - Right pane: `<SidePanel>` driven by `usePanelRegistry`
25
+ * - `<ProgressChecklist>` shows live goal completion
26
+ * - `<CompletionCard>` + `<RatingBar>` shown when session ends
27
+ * - `useAutoGreeting` fires the persona greeting on mount
28
+ */
29
+ export function OnboardingChat({ chatEndpoint, ratingEndpoint, config, panelDescriptors = [], panelComponents = {}, onComplete, sessionId, userId, fetchFn, className, }) {
30
+ const chat = useOnboardingChat({
31
+ chatEndpoint,
32
+ sessionId,
33
+ userId,
34
+ fetchFn,
35
+ });
36
+ const { activePanel } = usePanelRegistry({
37
+ panelDescriptors,
38
+ toolCallEvents: chat.toolCallEvents,
39
+ });
40
+ useAutoGreeting({
41
+ messages: chat.messages,
42
+ send: chat.send,
43
+ greeting: config.persona.greeting,
44
+ });
45
+ // Notify parent when onboarding completes.
46
+ useEffect(() => {
47
+ if (chat.isComplete && onComplete) {
48
+ onComplete(chat.setupStatus);
49
+ }
50
+ }, [chat.isComplete, chat.setupStatus, onComplete]);
51
+ const handleRate = (rating) => {
52
+ if (!ratingEndpoint) {
53
+ return;
54
+ }
55
+ void fetch(ratingEndpoint, {
56
+ method: 'POST',
57
+ headers: { 'Content-Type': 'application/json' },
58
+ body: JSON.stringify({ rating, sessionId, userId }),
59
+ });
60
+ };
61
+ return (_jsx(OnboardingChatProvider, { value: chat, children: _jsxs("div", { className: ['ocu-onboarding-chat', className].filter(Boolean).join(' '), role: "main", "aria-label": `${config.name} onboarding`, children: [_jsxs("div", { className: "ocu-onboarding-chat__layout", children: [_jsxs("div", { className: "ocu-onboarding-chat__left", children: [_jsx(ProgressChecklist, { goals: config.goals, status: chat.setupStatus, className: "ocu-onboarding-chat__checklist" }), _jsx(ChatPane, { messages: chat.messages, isStreaming: chat.isStreaming, onSend: chat.send, className: "ocu-onboarding-chat__chat-pane" })] }), _jsx("div", { className: "ocu-onboarding-chat__right", children: chat.isComplete ? (_jsx(CompletionCard, { onboardingName: config.name, handoffs: config.handoffs, onHandoffClick: target => {
62
+ if (onComplete) {
63
+ onComplete(chat.setupStatus);
64
+ }
65
+ // Emit the target id via aria for host apps to intercept
66
+ const el = document.getElementById(`handoff-${target.id}`);
67
+ if (el) {
68
+ el.click();
69
+ }
70
+ }, className: "ocu-onboarding-chat__completion", children: _jsx(RatingBar, { onRate: handleRate }) })) : (_jsx(SidePanel, { activePanel: activePanel, panelComponents: panelComponents, className: "ocu-onboarding-chat__side-panel" })) })] }), chat.error !== null && (_jsx("div", { className: "ocu-onboarding-chat__error", role: "alert", "aria-live": "assertive", children: chat.error.message }))] }) }));
71
+ }
72
+ //# sourceMappingURL=OnboardingChat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnboardingChat.js","sourceRoot":"","sources":["../../src/components/OnboardingChat.tsx"],"names":[],"mappings":";AAAA;;;;;;EAME;AAEF,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,YAAY,EACZ,cAAc,EACd,MAAM,EACN,gBAAgB,GAAG,EAAE,EACrB,eAAe,GAAG,EAAE,EACpB,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,EACP,SAAS,GACW;IACpB,MAAM,IAAI,GAAG,iBAAiB,CAAC;QAC7B,YAAY;QACZ,SAAS;QACT,MAAM;QACN,OAAO;KACR,CAAC,CAAC;IAEH,MAAM,EAAE,WAAW,EAAE,GAAG,gBAAgB,CAAC;QACvC,gBAAgB;QAChB,cAAc,EAAE,IAAI,CAAC,cAAc;KACpC,CAAC,CAAC;IAEH,eAAe,CAAC;QACd,QAAQ,EAAE,IAAI,CAAC,QAA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AAM,EAAE,IAAI,CAAC,IAAI,EACjB,SAAS,EAAC,gCAAgC,GAC1C,IACE,EAEN,cAAK,SAAS,EAAC,4BAA4B,YACxC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CACjB,KAAC,cAAc,IACb,cAAc,EAAE,MAAM,CAAC,IAAI,EAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,cAAc,EAAE,MAAM,CAAC,EAAE;oCACvB,IAAI,UAAU,EAAE,CAAC;wCACf,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oCAC/B,CAAC;oCACD,yDAAyD;oCACzD,MAAM,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;oCAC3D,IAAI,EAAE,EAAE,CAAC;wCACP,EAAE,CAAC,KAAK,EAAE,CAAC;oCACb,CAAC;gCACH,CAAC,EACD,SAAS,EAAC,iCAAiC,YAE3C,KAAC,SAAS,IAAC,MAAM,EAAE,UAAU,GAAI,GAClB,CAClB,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAC,iCAAiC,GAC3C,CACH,GACG,IACF,EAEL,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,CACtB,cACE,SAAS,EAAC,4BAA4B,EACtC,IAAI,EAAC,OAAO,eACF,WAAW,YAEpB,IAAI,CAAC,KAAK,CAAC,OAAO,GACf,CACP,IACG,GACiB,CAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ProgressChecklistProps } from '../types/ui-types';
3
+ /**
4
+ * Live checklist of onboarding goals.
5
+ * Updates reactively as `status` (GoalProgress) changes via the SSE stream.
6
+ * Required goals show a "required" badge when `showRequired` is true.
7
+ */
8
+ export declare function ProgressChecklist({ goals, status, showRequired, className, }: ProgressChecklistProps): React.ReactElement;
9
+ //# sourceMappingURL=ProgressChecklist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressChecklist.d.ts","sourceRoot":"","sources":["../../src/components/ProgressChecklist.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAM,EACN,YAAmB,EACnB,SAAS,GACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CA2D7C"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useGoalProgress } from '../hooks/useGoalProgress';
3
+ /**
4
+ * Live checklist of onboarding goals.
5
+ * Updates reactively as `status` (GoalProgress) changes via the SSE stream.
6
+ * Required goals show a "required" badge when `showRequired` is true.
7
+ */
8
+ export function ProgressChecklist({ goals, status, showRequired = true, className, }) {
9
+ const { goalItems, requiredMet, requiredTotal } = useGoalProgress({
10
+ goals,
11
+ setupStatus: status,
12
+ });
13
+ return (_jsxs("div", { className: ['ocu-progress-checklist', className].filter(Boolean).join(' '), role: "region", "aria-label": "Onboarding progress", children: [_jsxs("div", { className: "ocu-progress-checklist__header", children: [_jsx("h3", { className: "ocu-progress-checklist__title", children: "Setup Progress" }), requiredTotal > 0 && (_jsxs("span", { className: "ocu-progress-checklist__summary", "aria-live": "polite", "aria-atomic": "true", children: [requiredMet, "/", requiredTotal, " required"] }))] }), _jsx("ul", { className: "ocu-progress-checklist__list", children: goalItems.map(item => (_jsxs("li", { className: [
14
+ 'ocu-progress-checklist__item',
15
+ item.completed ? 'ocu-progress-checklist__item--complete' : '',
16
+ ]
17
+ .filter(Boolean)
18
+ .join(' '), children: [_jsx("span", { className: "ocu-progress-checklist__checkbox", role: "img", "aria-label": item.completed ? 'Completed' : 'Incomplete', children: item.completed ? '✅' : '⬜' }), _jsx("span", { className: "ocu-progress-checklist__description", children: item.description }), showRequired && item.required && (_jsx("span", { className: "ocu-progress-checklist__required-badge", "aria-label": "Required", children: "required" }))] }, item.id))) })] }));
19
+ }
20
+ //# sourceMappingURL=ProgressChecklist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressChecklist.js","sourceRoot":"","sources":["../../src/components/ProgressChecklist.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAM,EACN,YAAY,GAAG,IAAI,EACnB,SAAS,GACc;IACvB,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,eAAe,CAAC;QAChE,KAAK;QACL,WAAW,EAAE,MAAM;KACpB,CAAC,CAAC;IAEH,OAAO,CACL,eACE,SAAS,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC1E,IAAI,EAAC,QAAQ,gBACF,qBAAqB,aAEhC,eAAK,SAAS,EAAC,gCAAgC,aAC7C,aAAI,SAAS,EAAC,+BAA+B,+BAAoB,EAChE,aAAa,GAAG,CAAC,IAAI,CACpB,gBACE,SAAS,EAAC,iCAAiC,eACjC,QAAQ,iBACN,MAAM,aAEjB,WAAW,OAAG,aAAa,iBACvB,CACR,IACG,EAEN,aAAI,SAAS,EAAC,8BAA8B,YACzC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACrB,cAEE,SAAS,EAAE;wBACT,8BAA8B;wBAC9B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,EAAE;qBAC/D;yBACE,MAAM,CAAC,OAAO,CAAC;yBACf,IAAI,CAAC,GAAG,CAAC,aAEZ,eACE,SAAS,EAAC,kCAAkC,EAC5C,IAAI,EAAC,KAAK,gBACE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,YAEtD,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GACtB,EACP,eAAM,SAAS,EAAC,qCAAqC,YAClD,IAAI,CAAC,WAAW,GACZ,EACN,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,CAChC,eACE,SAAS,EAAC,wCAAwC,gBACvC,UAAU,yBAGhB,CACR,KAzBI,IAAI,CAAC,EAAE,CA0BT,CACN,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { RatingBarProps } from '../types/ui-types';
3
+ /**
4
+ * Thumbs up / thumbs down rating bar shown after onboarding completes.
5
+ * Locks after the first rating to prevent double-submission.
6
+ * Mirrors nevarPro's post-completion rating bar.
7
+ */
8
+ export declare function RatingBar({ onRate, className }: RatingBarProps): React.ReactElement;
9
+ //# sourceMappingURL=RatingBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RatingBar.d.ts","sourceRoot":"","sources":["../../src/components/RatingBar.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAyDnF"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ import { useState } from 'react';
10
+ /**
11
+ * Thumbs up / thumbs down rating bar shown after onboarding completes.
12
+ * Locks after the first rating to prevent double-submission.
13
+ * Mirrors nevarPro's post-completion rating bar.
14
+ */
15
+ export function RatingBar({ onRate, className }) {
16
+ const [rated, setRated] = useState(null);
17
+ const handleRate = (rating) => {
18
+ if (rated !== null) {
19
+ return;
20
+ }
21
+ setRated(rating);
22
+ onRate(rating);
23
+ };
24
+ return (_jsxs("div", { className: ['ocu-rating-bar', className].filter(Boolean).join(' '), role: "group", "aria-label": "Rate this onboarding experience", children: [_jsx("span", { className: "ocu-rating-bar__label", children: "Was this helpful?" }), _jsx("button", { type: "button", className: [
25
+ 'ocu-rating-bar__btn',
26
+ 'ocu-rating-bar__btn--up',
27
+ rated === 'up' ? 'ocu-rating-bar__btn--selected' : '',
28
+ ]
29
+ .filter(Boolean)
30
+ .join(' '), onClick: () => handleRate('up'), disabled: rated !== null, "aria-pressed": rated === 'up', "aria-label": "Thumbs up", children: "\uD83D\uDC4D" }), _jsx("button", { type: "button", className: [
31
+ 'ocu-rating-bar__btn',
32
+ 'ocu-rating-bar__btn--down',
33
+ rated === 'down' ? 'ocu-rating-bar__btn--selected' : '',
34
+ ]
35
+ .filter(Boolean)
36
+ .join(' '), onClick: () => handleRate('down'), disabled: rated !== null, "aria-pressed": rated === 'down', "aria-label": "Thumbs down", children: "\uD83D\uDC4E" }), rated !== null && (_jsx("span", { className: "ocu-rating-bar__thanks", role: "status", children: "Thanks for your feedback!" }))] }));
37
+ }
38
+ //# sourceMappingURL=RatingBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RatingBar.js","sourceRoot":"","sources":["../../src/components/RatingBar.tsx"],"names":[],"mappings":";AAAA;;;;;;EAME;AAEF,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAkB;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,IAAI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AC,QAAQ,0CAE/C,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { SidePanelProps } from '../types/ui-types';
3
+ /**
4
+ * Right-side panel slot driven by the plugin panel registry.
5
+ *
6
+ * Renders the host-provided React component mapped to `activePanel`, or
7
+ * the `fallback` node when no panel is active or the slotId has no
8
+ * registered component.
9
+ */
10
+ export declare function SidePanel({ activePanel, panelComponents, fallback, className, }: SidePanelProps): React.ReactElement;
11
+ //# sourceMappingURL=SidePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../src/components/SidePanel.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,WAAW,EACX,eAAe,EACf,QAAQ,EACR,SAAS,GACV,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAuBrC"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Right-side panel slot driven by the plugin panel registry.
4
+ *
5
+ * Renders the host-provided React component mapped to `activePanel`, or
6
+ * the `fallback` node when no panel is active or the slotId has no
7
+ * registered component.
8
+ */
9
+ export function SidePanel({ activePanel, panelComponents, fallback, className, }) {
10
+ const PanelComponent = activePanel !== null ? panelComponents[activePanel] : undefined;
11
+ return (_jsx("div", { className: ['ocu-side-panel', className].filter(Boolean).join(' '), role: "complementary", "aria-label": "Side panel", children: PanelComponent !== undefined ? (_jsx(PanelComponent, {})) : (_jsx("div", { className: "ocu-side-panel__empty", children: fallback ?? (_jsx("span", { className: "ocu-side-panel__placeholder", children: "Content will appear here during onboarding." })) })) }));
12
+ }
13
+ //# sourceMappingURL=SidePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../src/components/SidePanel.tsx"],"names":[],"mappings":";AAWA;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,WAAW,EACX,eAAe,EACf,QAAQ,EACR,SAAS,GACM;IACf,MAAM,cAAc,GAClB,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAElE,OAAO,CACL,cACE,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAClE,IAAI,EAAC,eAAe,gBACT,YAAY,YAEtB,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,CAC9B,KAAC,cAAc,KAAG,CACnB,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,uBAAuB,YACnC,QAAQ,IAAI,CACX,eAAM,SAAS,EAAC,6BAA6B,4DAEtC,CACR,GACG,CACP,GACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { OnboardingMessage, Attachment, ToolCallEvent, SetupStatus } from '../types/ui-types';
3
+ /** Shared state value exposed via OnboardingChatContext. */
4
+ export interface OnboardingChatContextValue {
5
+ messages: OnboardingMessage[];
6
+ send: (text: string, attachments?: Attachment[]) => void;
7
+ isStreaming: boolean;
8
+ toolCallEvents: ToolCallEvent[];
9
+ lastToolCall: ToolCallEvent | null;
10
+ setupStatus: SetupStatus | null;
11
+ isComplete: boolean;
12
+ error: Error | null;
13
+ }
14
+ /** Props for OnboardingChatProvider. */
15
+ export interface OnboardingChatProviderProps {
16
+ value: OnboardingChatContextValue;
17
+ children: React.ReactNode;
18
+ }
19
+ /**
20
+ * Provides shared onboarding chat state to all descendant components.
21
+ * Wrap the root `<OnboardingChat>` tree with this provider.
22
+ */
23
+ export declare function OnboardingChatProvider({ value, children, }: OnboardingChatProviderProps): React.ReactElement;
24
+ /**
25
+ * Consumes the onboarding chat context.
26
+ * Throws `OnboardingUIError` if called outside a provider.
27
+ */
28
+ export declare function useOnboardingChatContext(): OnboardingChatContextValue;
29
+ //# sourceMappingURL=OnboardingChatContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnboardingChatContext.d.ts","sourceRoot":"","sources":["../../src/context/OnboardingChatContext.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,4DAA4D;AAC5D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IACzD,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,YAAY,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAID,wCAAwC;AACxC,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,0BAA0B,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,QAAQ,GACT,EAAE,2BAA2B,GAAG,KAAK,CAAC,YAAY,CAMlD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,0BAA0B,CASrE"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ import { createContext, useContext } from 'react';
10
+ import { OnboardingUIError } from '../errors';
11
+ const OnboardingChatContext = createContext(null);
12
+ /**
13
+ * Provides shared onboarding chat state to all descendant components.
14
+ * Wrap the root `<OnboardingChat>` tree with this provider.
15
+ */
16
+ export function OnboardingChatProvider({ value, children, }) {
17
+ return (_jsx(OnboardingChatContext.Provider, { value: value, children: children }));
18
+ }
19
+ /**
20
+ * Consumes the onboarding chat context.
21
+ * Throws `OnboardingUIError` if called outside a provider.
22
+ */
23
+ export function useOnboardingChatContext() {
24
+ const ctx = useContext(OnboardingChatContext);
25
+ if (ctx === null) {
26
+ throw new OnboardingUIError('useOnboardingChatContext must be used inside <OnboardingChatProvider>', { code: 'MISSING_CONTEXT' });
27
+ }
28
+ return ctx;
29
+ }
30
+ //# sourceMappingURL=OnboardingChatContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnboardingChatContext.js","sourceRoot":"","sources":["../../src/context/OnboardingChatContext.tsx"],"names":[],"mappings":";AAAA;;;;;;EAME;AAEF,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAoB9C,MAAM,qBAAqB,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC;AAQrF;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACrC,KAAK,EACL,QAAQ,GACoB;IAC5B,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACzC,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAC9C,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,iBAAiB,CACzB,uEAAuE,EACvE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAC5B,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Base error for all onboarding-chat-ui exceptional conditions.
3
+ *
4
+ * Uses ES2022 `Error.cause` chaining per the BernierLLC error propagation
5
+ * standard — underlying errors are never swallowed.
6
+ */
7
+ export declare class OnboardingUIError extends Error {
8
+ readonly code: string;
9
+ readonly context?: Record<string, unknown>;
10
+ constructor(message: string, options?: {
11
+ cause?: Error;
12
+ code?: string;
13
+ context?: Record<string, unknown>;
14
+ });
15
+ }
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGzC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC;CAUJ"}
package/dist/errors.js ADDED
@@ -0,0 +1,27 @@
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
+ /**
9
+ * Base error for all onboarding-chat-ui exceptional conditions.
10
+ *
11
+ * Uses ES2022 `Error.cause` chaining per the BernierLLC error propagation
12
+ * standard — underlying errors are never swallowed.
13
+ */
14
+ export class OnboardingUIError extends Error {
15
+ code;
16
+ context;
17
+ constructor(message, options) {
18
+ super(message, { cause: options?.cause });
19
+ this.name = 'OnboardingUIError';
20
+ this.code = options?.code ?? 'ONBOARDING_UI_ERROR';
21
+ if (options?.context !== undefined) {
22
+ this.context = options.context;
23
+ }
24
+ Error.captureStackTrace?.(this, this.constructor);
25
+ }
26
+ }
27
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,IAAI,CAAS;IACb,OAAO,CAA2B;IAE3C,YACE,OAAe,EACf,OAIC;QAED,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,qBAAqB,CAAC;QACnD,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ import type { UseAutoGreetingOptions } from '../types/ui-types';
2
+ /**
3
+ * Fires a greeting message via `send` on first mount when no messages exist.
4
+ *
5
+ * Guards with a ref so that even if the component re-renders before the
6
+ * timeout fires, the greeting is only sent once.
7
+ */
8
+ export declare function useAutoGreeting(options: UseAutoGreetingOptions): void;
9
+ //# sourceMappingURL=useAutoGreeting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoGreeting.d.ts","sourceRoot":"","sources":["../../src/hooks/useAutoGreeting.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAwBrE"}
@@ -0,0 +1,36 @@
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 { useEffect, useRef } from 'react';
9
+ /**
10
+ * Fires a greeting message via `send` on first mount when no messages exist.
11
+ *
12
+ * Guards with a ref so that even if the component re-renders before the
13
+ * timeout fires, the greeting is only sent once.
14
+ */
15
+ export function useAutoGreeting(options) {
16
+ const { messages, send, greeting, delayMs = 500 } = options;
17
+ const hasGreeted = useRef(false);
18
+ useEffect(() => {
19
+ // Only greet when there are no existing messages and we haven't greeted yet.
20
+ const shouldGreet = messages.length === 0 && !hasGreeted.current;
21
+ if (!shouldGreet) {
22
+ return undefined;
23
+ }
24
+ const timer = setTimeout(() => {
25
+ if (!hasGreeted.current) {
26
+ hasGreeted.current = true;
27
+ send(greeting);
28
+ }
29
+ }, delayMs);
30
+ return () => {
31
+ clearTimeout(timer);
32
+ };
33
+ // Intentionally empty deps — greeting fires exactly once on mount.
34
+ }, []);
35
+ }
36
+ //# sourceMappingURL=useAutoGreeting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoGreeting.js","sourceRoot":"","sources":["../../src/hooks/useAutoGreeting.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAA+B;IAC7D,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAC5D,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjC,SAAS,CAAC,GAAG,EAAE;QACb,6EAA6E;QAC7E,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAEjE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBACxB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC1B,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC;QACF,mEAAmE;IACrE,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { UseGoalProgressOptions, UseGoalProgressResult } from '../types/ui-types';
2
+ /**
3
+ * Derives display-ready goal items from the onboarding config goals and
4
+ * the live SetupStatus (GoalProgress) from the SSE stream.
5
+ *
6
+ * When setupStatus is null (before any status event has arrived), all goals
7
+ * are shown as incomplete.
8
+ */
9
+ export declare function useGoalProgress(options: UseGoalProgressOptions): UseGoalProgressResult;
10
+ //# sourceMappingURL=useGoalProgress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGoalProgress.d.ts","sourceRoot":"","sources":["../../src/hooks/useGoalProgress.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EAEtB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CA+CtF"}
@@ -0,0 +1,48 @@
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 { useMemo } from 'react';
9
+ /**
10
+ * Derives display-ready goal items from the onboarding config goals and
11
+ * the live SetupStatus (GoalProgress) from the SSE stream.
12
+ *
13
+ * When setupStatus is null (before any status event has arrived), all goals
14
+ * are shown as incomplete.
15
+ */
16
+ export function useGoalProgress(options) {
17
+ const { goals, setupStatus } = options;
18
+ const goalItems = useMemo(() => {
19
+ if (setupStatus === null) {
20
+ return goals.map(g => ({
21
+ id: g.id,
22
+ description: g.description,
23
+ required: g.required,
24
+ phase: g.phase,
25
+ completed: false,
26
+ }));
27
+ }
28
+ // Build a lookup of completed goal ids from the status.
29
+ const completedIds = new Set();
30
+ for (const gs of setupStatus.goals) {
31
+ if (gs.completed) {
32
+ completedIds.add(gs.goalId);
33
+ }
34
+ }
35
+ return goals.map(g => ({
36
+ id: g.id,
37
+ description: g.description,
38
+ required: g.required,
39
+ phase: g.phase,
40
+ completed: completedIds.has(g.id),
41
+ }));
42
+ }, [goals, setupStatus]);
43
+ const requiredMet = useMemo(() => goalItems.filter(g => g.required && g.completed).length, [goalItems]);
44
+ const requiredTotal = useMemo(() => goalItems.filter(g => g.required).length, [goalItems]);
45
+ const isComplete = useMemo(() => setupStatus?.isComplete ?? false, [setupStatus]);
46
+ return { goalItems, requiredMet, requiredTotal, isComplete };
47
+ }
48
+ //# sourceMappingURL=useGoalProgress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGoalProgress.js","sourceRoot":"","sources":["../../src/hooks/useGoalProgress.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAOhC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAA+B;IAC7D,MAAM,EAAE,KAAK,EAAE,WAAW,E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,CAC3B,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,EAC9C,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,WAAW,EAAE,UAAU,IAAI,KAAK,EACtC,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { SSEPayload, UseOnboardingChatOptions, UseOnboardingChatResult } from '../types/ui-types';
2
+ /**
3
+ * Parse complete SSE frames from a text buffer.
4
+ * Returns parsed events and any incomplete trailing content.
5
+ */
6
+ export declare function parseSSEFrames(buffer: string): {
7
+ events: SSEPayload[];
8
+ remaining: string;
9
+ };
10
+ /**
11
+ * Hook that manages the onboarding chat session: sends user messages to
12
+ * a backend SSE endpoint and updates messages, tool-call events, setup
13
+ * status, and completion state as events arrive.
14
+ */
15
+ export declare function useOnboardingChat(options: UseOnboardingChatOptions): UseOnboardingChatResult;
16
+ //# sourceMappingURL=useOnboardingChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnboardingChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnboardingChat.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAKV,UAAU,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAO3B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAuB1F;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,uBAAuB,CA6IzB"}