@evelan/jexity-widget 0.11.0 → 0.11.7

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 (82) hide show
  1. package/dist/index.mjs +2391 -2095
  2. package/dist/index.mjs.map +1 -1
  3. package/dist/react.mjs +2343 -2047
  4. package/dist/react.mjs.map +1 -1
  5. package/dist/types/features/chat/components/ChatScreen.d.ts.map +1 -1
  6. package/dist/types/features/chat/components/EscalationFormScreen.d.ts.map +1 -1
  7. package/dist/types/features/chat/components/FormMessage.d.ts.map +1 -1
  8. package/dist/types/features/chat/components/HumanHandoffAction.d.ts.map +1 -1
  9. package/dist/types/features/chat/{components → composer/components}/ChatInput.d.ts +1 -1
  10. package/dist/types/features/chat/composer/components/ChatInput.d.ts.map +1 -0
  11. package/dist/types/features/chat/composer/components/ComposerRow.d.ts +27 -0
  12. package/dist/types/features/chat/composer/components/ComposerRow.d.ts.map +1 -0
  13. package/dist/types/features/chat/composer/components/RateLimitNotice.d.ts +9 -0
  14. package/dist/types/features/chat/composer/components/RateLimitNotice.d.ts.map +1 -0
  15. package/dist/types/features/chat/composer/components/SessionErrorNotice.d.ts +11 -0
  16. package/dist/types/features/chat/composer/components/SessionErrorNotice.d.ts.map +1 -0
  17. package/dist/types/features/chat/composer/hooks/useComposerInput.d.ts +35 -0
  18. package/dist/types/features/chat/composer/hooks/useComposerInput.d.ts.map +1 -0
  19. package/dist/types/features/chat/composer/hooks/useRateLimitCountdown.d.ts +23 -0
  20. package/dist/types/features/chat/composer/hooks/useRateLimitCountdown.d.ts.map +1 -0
  21. package/dist/types/features/chat/composer/hooks/useSendMessage.d.ts +27 -0
  22. package/dist/types/features/chat/composer/hooks/useSendMessage.d.ts.map +1 -0
  23. package/dist/types/features/chat/composer/index.d.ts +16 -0
  24. package/dist/types/features/chat/composer/index.d.ts.map +1 -0
  25. package/dist/types/features/chat/composer/state/attachments.d.ts +26 -0
  26. package/dist/types/features/chat/composer/state/attachments.d.ts.map +1 -0
  27. package/dist/types/features/chat/{composer.state.d.ts → composer/state/draft.d.ts} +3 -8
  28. package/dist/types/features/chat/composer/state/draft.d.ts.map +1 -0
  29. package/dist/types/features/chat/composer/state/index.d.ts +17 -0
  30. package/dist/types/features/chat/composer/state/index.d.ts.map +1 -0
  31. package/dist/types/features/chat/composer/state/rate-limit.d.ts +10 -0
  32. package/dist/types/features/chat/composer/state/rate-limit.d.ts.map +1 -0
  33. package/dist/types/features/chat/hooks/useConversation.d.ts +27 -0
  34. package/dist/types/features/chat/hooks/useConversation.d.ts.map +1 -0
  35. package/dist/types/features/chat/hooks/useConvexSession.d.ts +1 -0
  36. package/dist/types/features/chat/hooks/useConvexSession.d.ts.map +1 -1
  37. package/dist/types/features/chat/hooks/useEscalation.d.ts +25 -0
  38. package/dist/types/features/chat/hooks/useEscalation.d.ts.map +1 -0
  39. package/dist/types/features/chat/hooks/useHandoff.d.ts +23 -0
  40. package/dist/types/features/chat/hooks/useHandoff.d.ts.map +1 -0
  41. package/dist/types/features/chat/index.d.ts +18 -0
  42. package/dist/types/features/chat/index.d.ts.map +1 -0
  43. package/dist/types/features/chat/state/index.d.ts +13 -0
  44. package/dist/types/features/chat/state/index.d.ts.map +1 -0
  45. package/dist/types/features/chat/state/session-error.d.ts +16 -0
  46. package/dist/types/features/chat/state/session-error.d.ts.map +1 -0
  47. package/dist/types/features/chat/types.d.ts +19 -0
  48. package/dist/types/features/chat/types.d.ts.map +1 -0
  49. package/dist/types/features/home/components/HomeScreen.d.ts.map +1 -1
  50. package/dist/types/i18n/locales/de.d.ts.map +1 -1
  51. package/dist/types/i18n/locales/en.d.ts +9 -0
  52. package/dist/types/i18n/locales/en.d.ts.map +1 -1
  53. package/dist/types/lib/refreshBootstrap.d.ts +10 -0
  54. package/dist/types/lib/refreshBootstrap.d.ts.map +1 -0
  55. package/dist/types/module/screens/ScreenRouter.d.ts +1 -1
  56. package/dist/types/module/screens/ScreenRouter.d.ts.map +1 -1
  57. package/dist/types/module/shell/WidgetShell.d.ts.map +1 -1
  58. package/dist/types/module/shell/hooks/useBootstrap.d.ts +3 -1
  59. package/dist/types/module/shell/hooks/useBootstrap.d.ts.map +1 -1
  60. package/dist/types/module/shell/shell.state.d.ts +10 -0
  61. package/dist/types/module/shell/shell.state.d.ts.map +1 -1
  62. package/dist/types/module/visitor/idle-lock.d.ts +27 -0
  63. package/dist/types/module/visitor/idle-lock.d.ts.map +1 -0
  64. package/dist/types/module/visitor/visitor.state.d.ts +2 -0
  65. package/dist/types/module/visitor/visitor.state.d.ts.map +1 -1
  66. package/dist/types/shared/ui/Header.d.ts +8 -2
  67. package/dist/types/shared/ui/Header.d.ts.map +1 -1
  68. package/dist/types/shared/ui/HeaderActions.d.ts +11 -0
  69. package/dist/types/shared/ui/HeaderActions.d.ts.map +1 -0
  70. package/dist/types/shared/ui/HeaderCloseButton.d.ts +10 -0
  71. package/dist/types/shared/ui/HeaderCloseButton.d.ts.map +1 -0
  72. package/dist/types/shared/ui/HeaderLeft.d.ts +9 -0
  73. package/dist/types/shared/ui/HeaderLeft.d.ts.map +1 -0
  74. package/dist/types/shared/ui/HeaderTitle.d.ts +7 -0
  75. package/dist/types/shared/ui/HeaderTitle.d.ts.map +1 -0
  76. package/dist/widget.js +39 -39
  77. package/dist/widget.js.map +1 -1
  78. package/package.json +1 -1
  79. package/dist/types/features/chat/components/ChatInput.d.ts.map +0 -1
  80. package/dist/types/features/chat/components/RateLimitNotice.d.ts +0 -9
  81. package/dist/types/features/chat/components/RateLimitNotice.d.ts.map +0 -1
  82. package/dist/types/features/chat/composer.state.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ChatScreen.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/ChatScreen.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAMnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,UAAU,eAA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,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAClD,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,eAAe,gCAmFnL"}
@@ -1 +1 @@
1
- {"version":3,"file":"EscalationFormScreen.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/EscalationFormScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAEnE,UAAU,yBAAyB;IACjC,aAAa,EAAE,EAAE,CAAC,eAAe,CAAC,CAAA;IAClC,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,yBAAyB,gCAiEtG"}
1
+ {"version":3,"file":"EscalationFormScreen.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/EscalationFormScreen.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAEnE,UAAU,yBAAyB;IACjC,aAAa,EAAE,EAAE,CAAC,eAAe,CAAC,CAAA;IAClC,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,yBAAyB,gCAkEtG"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormMessage.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/FormMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAExE,UAAU,gBAAgB;IACxB,OAAO,EAAE,GAAG,CAAC,eAAe,CAAC,CAAA;IAC7B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,gBAAgB,gCA4B9E"}
1
+ {"version":3,"file":"FormMessage.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/FormMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAExE,UAAU,gBAAgB;IACxB,OAAO,EAAE,GAAG,CAAC,eAAe,CAAC,CAAA;IAC7B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,gBAAgB,gCA4B9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"HumanHandoffAction.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/HumanHandoffAction.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAEnE,UAAU,uBAAuB;IAC/B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,uBAAuB,gCAkDnF"}
1
+ {"version":3,"file":"HumanHandoffAction.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/components/HumanHandoffAction.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAEnE,UAAU,uBAAuB;IAC/B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,uBAAuB,gCAyDnF"}
@@ -11,7 +11,7 @@ interface ChatInputProps {
11
11
  } | null>;
12
12
  onStartFresh: () => void;
13
13
  }
14
- /** Text input + send button. Creates session lazily on first send. */
14
+ /** Composer area stacks inline notices above a single focus-within input row. */
15
15
  export declare function ChatInput({ sessionId, visitorId, isLoading, isStreaming, sessionStatus, ensureSession, onStartFresh }: ChatInputProps): import("preact").JSX.Element;
16
16
  export {};
17
17
  //# sourceMappingURL=ChatInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/components/ChatInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAEnE,UAAU,cAAc;IACtB,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,CAAA;IACtE,aAAa,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;IAC5F,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,cAAc,gCAoDrI"}
@@ -0,0 +1,27 @@
1
+ interface ComposerRowProps {
2
+ isStreaming: boolean;
3
+ disabled: boolean;
4
+ inputDisabled: boolean;
5
+ onSend: () => void;
6
+ }
7
+ /**
8
+ * Composer row — autosize textarea, attach button, staged image chips,
9
+ * and a state-driven send button rendered inside one focus-within card.
10
+ *
11
+ * Pure presentation. All side effects (autosize, file picker proxy,
12
+ * focus-on-empty-click, Enter-to-send) live in `useComposerInput`.
13
+ * The component reads two composer signals (`draftMessage`,
14
+ * `attachedImages`) for render-time conditionals and writes through
15
+ * the hook + `removeAttachedImage`.
16
+ *
17
+ * Design notes:
18
+ * - The whole card owns the border + focus-within highlight so the
19
+ * send button can never overflow at narrow viewports.
20
+ * - Send button has two visual states: "muted" (no draft / images)
21
+ * and "active" (something to send). Streaming locks the textarea
22
+ * via `inputDisabled` upstream; the button stays muted because
23
+ * hasInput is false after clear-on-send.
24
+ */
25
+ export declare function ComposerRow({ isStreaming, disabled, inputDisabled, onSend }: ComposerRowProps): import("preact").JSX.Element;
26
+ export {};
27
+ //# sourceMappingURL=ComposerRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComposerRow.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/components/ComposerRow.tsx"],"names":[],"mappings":"AAKA,UAAU,gBAAgB;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,aAAa,EAAE,OAAO,CAAA;IACtB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,gBAAgB,gCA4F7F"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Inline rate-limit countdown rendered above the chat input.
3
+ *
4
+ * Pure render. Timer ownership + auto-clear live in
5
+ * `useRateLimitCountdown` so the notice never has to think about
6
+ * intervals or signals directly.
7
+ */
8
+ export declare function RateLimitNotice(): import("preact").JSX.Element | null;
9
+ //# sourceMappingURL=RateLimitNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RateLimitNotice.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/components/RateLimitNotice.tsx"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,eAAe,wCAY9B"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Inline banner rendered above the chat input when session creation fails.
3
+ * Mirrors the RateLimitNotice pattern: module-scope signal, no prop drill,
4
+ * self-clears on the next successful ensureSession() / startFresh() call.
5
+ *
6
+ * Visitor-facing widget — console logs are invisible to operators, so every
7
+ * silent catch in useConvexSession / refreshBootstrap writes a reason here
8
+ * and this component renders it. See state/session-error.ts for the reason enum.
9
+ */
10
+ export declare function SessionErrorNotice(): import("preact").JSX.Element | null;
11
+ //# sourceMappingURL=SessionErrorNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionErrorNotice.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/components/SessionErrorNotice.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,wCAgBjC"}
@@ -0,0 +1,35 @@
1
+ import { useRef } from 'preact/hooks';
2
+ interface UseComposerInputArgs {
3
+ /** Called when the visitor presses Enter (without Shift). */
4
+ onSend: () => void;
5
+ }
6
+ interface UseComposerInputResult {
7
+ textareaRef: ReturnType<typeof useRef<HTMLTextAreaElement>>;
8
+ fileInputRef: ReturnType<typeof useRef<HTMLInputElement>>;
9
+ /** Enter → send, Shift+Enter → newline. */
10
+ onKeyDown: (e: KeyboardEvent) => void;
11
+ /** Proxy click into the hidden native file input. */
12
+ onAttachClick: () => void;
13
+ /** Validate + stage selected files, then reset the input value. */
14
+ onFilesPicked: (e: Event) => void;
15
+ /** Focus the textarea when the visitor clicks empty card padding. */
16
+ onCardClick: (e: MouseEvent) => void;
17
+ }
18
+ /**
19
+ * Composer input behaviours — the four side effects that used to live
20
+ * inline in ComposerRow.tsx:
21
+ *
22
+ * 1. Autosize the textarea up to MAX_TEXTAREA_PX, then scroll.
23
+ * 2. Send-on-Enter (preserving Shift+Enter for newline).
24
+ * 3. Attach button → hidden <input type="file"> proxy.
25
+ * 4. Click-on-empty-card → focus the textarea (Intercom pattern).
26
+ *
27
+ * Returning refs + handlers keeps ComposerRow purely declarative —
28
+ * it wires the result onto the DOM and never touches a useEffect or
29
+ * useRef of its own. The hook reads `draftMessage` directly because
30
+ * the autosize effect depends on the draft value, and that
31
+ * dependency is composer-internal.
32
+ */
33
+ export declare function useComposerInput({ onSend }: UseComposerInputArgs): UseComposerInputResult;
34
+ export {};
35
+ //# sourceMappingURL=useComposerInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComposerInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/hooks/useComposerInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,cAAc,CAAA;AAKhD,UAAU,oBAAoB;IAC5B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,UAAU,sBAAsB;IAC9B,WAAW,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAC3D,YAAY,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAA;IACzD,2CAA2C;IAC3C,SAAS,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IACrC,qDAAqD;IACrD,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,mEAAmE;IACnE,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;IACjC,qEAAqE;IACrE,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;CACrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,GAAG,sBAAsB,CAgDzF"}
@@ -0,0 +1,23 @@
1
+ interface UseRateLimitCountdownResult {
2
+ /** True while a rate-limit window is open. */
3
+ isActive: boolean;
4
+ /** Whole seconds remaining; 0 once the window expires. */
5
+ remainingSeconds: number;
6
+ }
7
+ /**
8
+ * Rate-limit countdown — owns the per-second tick on `nowMs` and the
9
+ * self-clearing setTimeout that resets `rateLimitedUntilMs` when the
10
+ * retry-after window elapses.
11
+ *
12
+ * Splitting this out of RateLimitNotice puts timer ownership next to
13
+ * the signal it drives (both live under `composer/state` /
14
+ * `composer/hooks`). The notice becomes pure render.
15
+ *
16
+ * Reading both signals inside the hook body subscribes the calling
17
+ * component to their updates, so the consumer re-renders once per
18
+ * tick during a countdown — that is exactly what a countdown display
19
+ * requires.
20
+ */
21
+ export declare function useRateLimitCountdown(): UseRateLimitCountdownResult;
22
+ export {};
23
+ //# sourceMappingURL=useRateLimitCountdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRateLimitCountdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/hooks/useRateLimitCountdown.ts"],"names":[],"mappings":"AAGA,UAAU,2BAA2B;IACnC,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAA;IACjB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,IAAI,2BAA2B,CAsBnE"}
@@ -0,0 +1,27 @@
1
+ import type { Id } from '@repo/backend/convex/_generated/dataModel';
2
+ interface UseSendMessageArgs {
3
+ sessionId: Id<'contactSessions'> | null;
4
+ visitorId: string | null;
5
+ ensureSession: () => Promise<{
6
+ sessionId: Id<'contactSessions'>;
7
+ visitorId: string;
8
+ } | null>;
9
+ }
10
+ /**
11
+ * Composer send-message hook — single seam over the Convex `send`
12
+ * mutation.
13
+ *
14
+ * Owns:
15
+ * - ensure-session lazy create (anonymous visitors commit on first send)
16
+ * - rate_limit response → write `rateLimitedUntilMs` signal
17
+ * - success → `markActivity` so the session stays in history list
18
+ * - network / NOT_FOUND throws → log
19
+ *
20
+ * The returned function takes only `content` because the session
21
+ * deps are captured at hook-call time. Composer state mutations
22
+ * (clear draft, clear staged images) remain in the calling component
23
+ * so the component still owns its composer reset.
24
+ */
25
+ export declare function useSendMessage({ sessionId, visitorId, ensureSession }: UseSendMessageArgs): (content: string) => Promise<void>;
26
+ export {};
27
+ //# sourceMappingURL=useSendMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/hooks/useSendMessage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAInE,UAAU,kBAAkB;IAC1B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,aAAa,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;CAC7F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,kBAAkB,IAKtD,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CA8ClE"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Composer sub-feature — public barrel.
3
+ *
4
+ * Everything the rest of the chat feature needs from the composer
5
+ * lives here. Reach-ins are not allowed: outside code must import
6
+ * from `'../composer'`, never `'../composer/components/...'` or
7
+ * `'../composer/state/...'`.
8
+ *
9
+ * Deletability: `rm -rf features/chat/composer/` plus removing the
10
+ * import line in ChatScreen + BotMessage takes the entire composer
11
+ * (input UI, attachment staging, rate-limit + session-error notices,
12
+ * draft signal, tag-agent helper) out of the build.
13
+ */
14
+ export { ChatInput } from './components/ChatInput';
15
+ export { tagAgent } from './state/draft';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/composer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Pending image attachments staged in the composer.
3
+ *
4
+ * Frontend-only state for now. The backend `send` mutation accepts a
5
+ * single `content: string` — image upload + persistence (Convex storage,
6
+ * message-level attachment array, agent vision-input wiring) is a
7
+ * follow-up. When that lands, replace `previewUrl` with the uploaded
8
+ * `storageId` and pass the array in `send(...)`.
9
+ *
10
+ * `previewUrl` is an `URL.createObjectURL(file)` blob — callers MUST
11
+ * revoke it via `removeAttachedImage` / `clearAttachedImages` to avoid
12
+ * leaking memory.
13
+ */
14
+ export interface AttachedImage {
15
+ id: string;
16
+ file: File;
17
+ previewUrl: string;
18
+ }
19
+ export declare const attachedImages: import("@preact/signals").Signal<AttachedImage[]>;
20
+ /** Appends image files (after size + count guards) and creates blob preview URLs. */
21
+ export declare function addAttachedImages(files: FileList | File[]): void;
22
+ /** Removes one staged image by id and revokes its blob URL. */
23
+ export declare function removeAttachedImage(id: string): void;
24
+ /** Revokes every staged blob URL and resets the list. Call after send + on unmount. */
25
+ export declare function clearAttachedImages(): void;
26
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/state/attachments.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,cAAc,mDAA8B,CAAA;AAyBzD,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,GAAG,IAAI,CAgBhE;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAMpD;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C"}
@@ -1,18 +1,13 @@
1
1
  /**
2
2
  * Visitor's draft message — shared so the reply icon on agent messages
3
3
  * can prepend an `@<agent>` mention into the active input. ChatInput
4
- * binds its <input> to this signal; BotMessage's reply icon writes to it.
4
+ * binds its <textarea> to this signal; BotMessage's reply icon writes
5
+ * to it via `tagAgent`.
5
6
  *
6
7
  * Module-scope signal is fine here: a widget instance has at most one
7
8
  * active composer, and visitors never have two widgets on the same page.
8
9
  */
9
10
  export declare const draftMessage: import("@preact/signals").Signal<string>;
10
- /** Wall-clock ms when visitor may send again. null = unsubscribed. */
11
- export declare const rateLimitedUntilMs: import("@preact/signals").Signal<number | null>;
12
- /** Module-scope wall-clock ticker. Updated once per second by RateLimitNotice
13
- * while a rate-limit countdown is active, used to derive remaining seconds.
14
- * Lives at module scope so multiple consumers share one timer if needed. */
15
- export declare const nowMs: import("@preact/signals").Signal<number>;
16
11
  /**
17
12
  * Prepends `@<firstName> ` to the current draft so the visitor can type
18
13
  * their question after the mention. If the draft already contains a
@@ -20,4 +15,4 @@ export declare const nowMs: import("@preact/signals").Signal<number>;
20
15
  * the existing draft is preserved.
21
16
  */
22
17
  export declare function tagAgent(agentName: string | undefined): void;
23
- //# sourceMappingURL=composer.state.d.ts.map
18
+ //# sourceMappingURL=draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/state/draft.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,0CAAa,CAAA;AAEtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAgB5D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Composer state barrel — three independently deletable slices.
3
+ *
4
+ * - draft.ts → draftMessage signal + tagAgent helper
5
+ * - rate-limit.ts → rateLimitedUntilMs + nowMs ticker
6
+ * - attachments.ts → staged image attachments + blob-URL hygiene
7
+ *
8
+ * Consumers inside `composer/` should import from `../state`. The
9
+ * outer composer barrel (`composer/index.ts`) re-exports only what is
10
+ * meant to cross the composer boundary (currently `tagAgent`, so
11
+ * BotMessage outside the composer can prepend mentions into the
12
+ * draft).
13
+ */
14
+ export { draftMessage, tagAgent } from './draft';
15
+ export { rateLimitedUntilMs, nowMs } from './rate-limit';
16
+ export { attachedImages, addAttachedImages, removeAttachedImage, clearAttachedImages, type AttachedImage, } from './attachments';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/state/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAA"}
@@ -0,0 +1,10 @@
1
+ /** Wall-clock ms when visitor may send again. null = unsubscribed. */
2
+ export declare const rateLimitedUntilMs: import("@preact/signals").Signal<number | null>;
3
+ /**
4
+ * Module-scope wall-clock ticker. Updated once per second by
5
+ * RateLimitNotice while a rate-limit countdown is active, used to
6
+ * derive remaining seconds. Lives at module scope so multiple
7
+ * consumers share one timer if needed.
8
+ */
9
+ export declare const nowMs: import("@preact/signals").Signal<number>;
10
+ //# sourceMappingURL=rate-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chat/composer/state/rate-limit.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,iDAA8B,CAAA;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,0CAA6B,CAAA"}
@@ -0,0 +1,27 @@
1
+ import type { Doc, Id } from '@repo/backend/convex/_generated/dataModel';
2
+ interface UseConversationArgs {
3
+ sessionId: Id<'contactSessions'> | null;
4
+ visitorId: string | null;
5
+ }
6
+ export type SessionLiveStatus = 'active' | 'escalated' | 'assigned' | 'resolved';
7
+ interface UseConversationResult {
8
+ /** Conversation rows; `undefined` until first server response (loading). */
9
+ conversations: Doc<'conversations'>[] | undefined;
10
+ /** Live status of the contact session, or null while loading / no session. */
11
+ sessionStatus: SessionLiveStatus | null;
12
+ /** True while the conversations query is in flight for a known session. */
13
+ isLoading: boolean;
14
+ /** True while any bot/agent message is mid-stream. */
15
+ isStreaming: boolean;
16
+ }
17
+ /**
18
+ * Conversation data hook — wraps the two Convex queries ChatScreen
19
+ * needs (message list + live session status) so the component is
20
+ * free of `api.functions.chat.public.*` paths.
21
+ *
22
+ * Both queries use the `'skip'` idle pattern until a session exists,
23
+ * keeping subscription cost at zero before the first send.
24
+ */
25
+ export declare function useConversation({ sessionId, visitorId }: UseConversationArgs): UseConversationResult;
26
+ export {};
27
+ //# sourceMappingURL=useConversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConversation.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/hooks/useConversation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAExE,UAAU,mBAAmB;IAC3B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAA;AAEhF,UAAU,qBAAqB;IAC7B,4EAA4E;IAC5E,aAAa,EAAE,GAAG,CAAC,eAAe,CAAC,EAAE,GAAG,SAAS,CAAA;IACjD,8EAA8E;IAC9E,aAAa,EAAE,iBAAiB,GAAG,IAAI,CAAA;IACvC,2EAA2E;IAC3E,SAAS,EAAE,OAAO,CAAA;IAClB,sDAAsD;IACtD,WAAW,EAAE,OAAO,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,qBAAqB,CA0BpG"}
@@ -1,3 +1,4 @@
1
+ import type { Id } from '@repo/backend/convex/_generated/dataModel';
1
2
  type SessionStatus = 'active' | 'escalated' | 'assigned' | 'resolved' | 'org_deleted' | null;
2
3
  export interface SessionResult {
3
4
  sessionId: Id<'contactSessions'>;
@@ -1 +1 @@
1
- {"version":3,"file":"useConvexSession.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/hooks/useConvexSession.ts"],"names":[],"mappings":"AAOA,KAAK,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,IAAI,CAAA;AAE5F,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,UAAU,aAAa;IACrB,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB,kFAAkF;IAClF,eAAe,EAAE,OAAO,CAAA;IACxB,0EAA0E;IAC1E,YAAY,EAAE,OAAO,CAAA;IACrB,8CAA8C;IAC9C,aAAa,EAAE,aAAa,CAAA;IAC5B,wFAAwF;IACxF,YAAY,EAAE,OAAO,CAAA;IACrB,4EAA4E;IAC5E,aAAa,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAClD,iEAAiE;IACjE,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAC/C;8EAC0E;IAC1E,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,CA0GlF"}
1
+ {"version":3,"file":"useConvexSession.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/hooks/useConvexSession.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2CAA2C,CAAA;AAmDnE,KAAK,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,IAAI,CAAA;AAE5F,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,UAAU,aAAa;IACrB,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB,kFAAkF;IAClF,eAAe,EAAE,OAAO,CAAA;IACxB,0EAA0E;IAC1E,YAAY,EAAE,OAAO,CAAA;IACrB,8CAA8C;IAC9C,aAAa,EAAE,aAAa,CAAA;IAC5B,wFAAwF;IACxF,YAAY,EAAE,OAAO,CAAA;IACrB,4EAA4E;IAC5E,aAAa,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAClD,iEAAiE;IACjE,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAC/C;8EAC0E;IAC1E,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,CA8IlF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Escalation submit hook — single touch point for the
3
+ * `submitEscalation` mutation.
4
+ *
5
+ * Returned function inserts the visitor's name + email onto the
6
+ * escalation form-message row and triggers the backend's inline
7
+ * escalation-confirm BotMessage insertion. Two consumers today
8
+ * (FormMessage + EscalationFormScreen); each owns its own
9
+ * submitting / error UI.
10
+ *
11
+ * Components that want error UI must catch the rejection themselves;
12
+ * this hook intentionally does not encapsulate error state because
13
+ * the two consumers render error differently (inline alert vs.
14
+ * silent log + form-reset).
15
+ */
16
+ export declare function useEscalation(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
17
+ visitorId: string;
18
+ visitorName: string;
19
+ visitorEmail: string;
20
+ sessionId: import("convex/values").GenericId<"contactSessions">;
21
+ formMessageId: import("convex/values").GenericId<"conversations">;
22
+ }, {
23
+ ticketRef: string;
24
+ }, string | undefined>>;
25
+ //# sourceMappingURL=useEscalation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEscalation.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/hooks/useEscalation.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa;;;;;;;;wBAE5B"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Handoff hook — single touch point for the headless
3
+ * `createEscalationRequest` mutation.
4
+ *
5
+ * Returned function fires the request and the backend decides the
6
+ * branch (skipForm vs. requires-form) via its return discriminator.
7
+ * Caller is responsible for navigating + reading the bootstrap
8
+ * token; the hook just abstracts the api path.
9
+ */
10
+ export declare function useHandoff(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
11
+ visitorId: string;
12
+ sessionId: import("convex/values").GenericId<"contactSessions">;
13
+ bootstrapToken: import("convex/values").GenericId<"widgetBootstrapTokens">;
14
+ }, {
15
+ skipForm: true;
16
+ ticketRef: string;
17
+ formMessageId?: undefined;
18
+ } | {
19
+ skipForm: false;
20
+ formMessageId: import("convex/values").GenericId<"conversations">;
21
+ ticketRef?: undefined;
22
+ }, string | undefined>>;
23
+ //# sourceMappingURL=useHandoff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHandoff.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/hooks/useHandoff.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,UAAU;;;;;;;;;;;;wBAEzB"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Chat feature — public barrel.
3
+ *
4
+ * The shell layer (`module/shell`, `module/screens`) imports from
5
+ * this file. Reach-ins to `components/...`, `composer/...`,
6
+ * `hooks/...`, or `state/...` are not allowed from outside the
7
+ * chat feature.
8
+ *
9
+ * Deletability: `rm -rf features/chat/` plus removing every line
10
+ * in WidgetShell and ScreenRouter that imports from this barrel
11
+ * takes the whole chat experience out of the build.
12
+ */
13
+ export { ChatScreen } from './components/ChatScreen';
14
+ export { EscalationFormScreen } from './components/EscalationFormScreen';
15
+ export { HumanHandoffAction } from './components/HumanHandoffAction';
16
+ export { useConvexSession } from './hooks/useConvexSession';
17
+ export type { SessionErrorReason, SessionResult } from './types';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Chat-feature cross-cutting state.
3
+ *
4
+ * State that is written outside the composer sub-feature lives here.
5
+ * Composer-owned state (draft, rate-limit, attachments) lives in
6
+ * `composer/state` and is exported from the composer barrel.
7
+ *
8
+ * - session-error.ts → sessionError + SessionErrorReason
9
+ * (written by hooks/useConvexSession, read by
10
+ * composer/components/SessionErrorNotice)
11
+ */
12
+ export { sessionError, type SessionErrorReason } from './session-error';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/state/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Inline notice for session-creation failures. Visitor-facing widget can't
3
+ * rely on console logs — every catch in useConvexSession / refreshBootstrap
4
+ * that returns null must also write a reason here so ChatInput can render
5
+ * a banner the visitor actually sees.
6
+ *
7
+ * - 'no-token' bootstrap token never arrived (initial POST failed,
8
+ * network down, or 10s wait timed out)
9
+ * - 'unauthorized' bootstrap token was rejected and refresh also failed
10
+ * (origin de-authorised, clock skew, domain mis-config)
11
+ * - 'network' transport error talking to Convex
12
+ * - 'unknown' any other thrown error
13
+ */
14
+ export type SessionErrorReason = 'no-token' | 'unauthorized' | 'network' | 'unknown';
15
+ export declare const sessionError: import("@preact/signals").Signal<SessionErrorReason | null>;
16
+ //# sourceMappingURL=session-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-error.d.ts","sourceRoot":"","sources":["../../../../../src/features/chat/state/session-error.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAA;AAEpF,eAAO,MAAM,YAAY,6DAA0C,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Chat-feature public types.
3
+ *
4
+ * Re-exports the types that cross the chat-feature boundary. Source
5
+ * definitions live next to their owning state slice or hook, but
6
+ * external consumers should reach for them through this module (or
7
+ * the chat-feature barrel) — never via internal `state/...` or
8
+ * `hooks/...` paths.
9
+ *
10
+ * - SessionErrorReason → defined alongside its signal in
11
+ * state/session-error.ts; consumed by hooks/useConvexSession and
12
+ * composer/components/SessionErrorNotice.
13
+ * - SessionResult → defined alongside the hook that emits it
14
+ * (hooks/useConvexSession); consumed by ScreenRouter to type the
15
+ * ensureSession / startFresh callbacks it threads into screens.
16
+ */
17
+ export type { SessionErrorReason } from './state/session-error';
18
+ export type { SessionResult } from './hooks/useConvexSession';
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/features/chat/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"HomeScreen.d.ts","sourceRoot":"","sources":["../../../../../src/features/home/components/HomeScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEtE,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IAEb,YAAY,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAEjD,cAAc,EAAE,MAAM,IAAI,CAAA;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,eAAe,gCAkGlF"}
1
+ {"version":3,"file":"HomeScreen.d.ts","sourceRoot":"","sources":["../../../../../src/features/home/components/HomeScreen.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEtE,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IAEb,YAAY,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAEjD,cAAc,EAAE,MAAM,IAAI,CAAA;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,eAAe,gCAgHlF"}
@@ -1 +1 @@
1
- {"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../../src/i18n/locales/de.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAEzC,eAAO,MAAM,EAAE,EAAE,aAiEhB,CAAA"}
1
+ {"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../../src/i18n/locales/de.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAEzC,eAAO,MAAM,EAAE,EAAE,aAuEhB,CAAA"}
@@ -4,11 +4,18 @@ export interface WidgetStrings {
4
4
  inputPlaceholder: string;
5
5
  aiThinking: string;
6
6
  sendAriaLabel: string;
7
+ attachImagesAriaLabel: string;
8
+ attachComingSoon: string;
9
+ removeAttachmentAriaLabel: string;
7
10
  openChatAriaLabel: string;
8
11
  closeChatAriaLabel: string;
9
12
  errorNetwork: string;
10
13
  errorQuota: string;
11
14
  errorRateLimited: string;
15
+ /** Shown when the widget couldn't get a bootstrap token (POST /widget/bootstrap failed or 10s wait timed out). */
16
+ errorSessionNoToken: string;
17
+ /** Shown when the bootstrap token was rejected and a refresh also failed. */
18
+ errorSessionUnauthorized: string;
12
19
  localeLabelDe: string;
13
20
  localeLabelEn: string;
14
21
  resumeConversation: string;
@@ -46,6 +53,8 @@ export interface WidgetStrings {
46
53
  escalationPromptSubmit: string;
47
54
  escalationSubmitFailed: string;
48
55
  sessionNotFoundPrompt: string;
56
+ /** Privacy notice shown on Home after the idle/visibility lock wiped the chat. */
57
+ sessionLocked: string;
49
58
  sessionResolved: string;
50
59
  tryAgain: string;
51
60
  goBack: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/locales/en.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,m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AAM,EAAE,EAAE,aAuEhB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { bootstrapToken } from '../module/shell/shell.state';
2
+ export type RefreshResult = {
3
+ ok: true;
4
+ token: NonNullable<typeof bootstrapToken.value>;
5
+ } | {
6
+ ok: false;
7
+ reason: 'no-inputs' | 'unauthorized' | 'not_found' | 'rate_limited' | 'network';
8
+ };
9
+ export declare function refreshBootstrapToken(): Promise<RefreshResult>;
10
+ //# sourceMappingURL=refreshBootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refreshBootstrap.d.ts","sourceRoot":"","sources":["../../../src/lib/refreshBootstrap.ts"],"names":[],"mappings":"AAWA,OAAO,EAAmB,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE7E,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAA;CAAE,GAC7D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,WAAW,GAAG,cAAc,GAAG,WAAW,GAAG,cAAc,GAAG,SAAS,CAAA;CAAE,CAAA;AAElG,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,aAAa,CAAC,CAgBpE"}
@@ -1,4 +1,4 @@
1
- import type { SessionResult } from '../../features/chat/hooks/useConvexSession';
1
+ import { type SessionResult } from '../../features/chat';
2
2
  interface ScreenRouterProps {
3
3
  greeting: string;
4
4
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenRouter.d.ts","sourceRoot":"","sources":["../../../../src/module/screens/ScreenRouter.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAA;AAE/E,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAA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