@visma-swno/gaia-chat-ui 4.2.0-beta.2 → 4.2.0-beta.4

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 (164) hide show
  1. package/README.md +0 -9
  2. package/dist/app/app.d.ts +9 -5
  3. package/dist/app/chat-context.d.ts +25 -0
  4. package/dist/components/canvas/canvas-code-view/canvas-code-view.d.ts +19 -0
  5. package/dist/components/canvas/canvas-revision-selector/canvas-revision-selector.d.ts +20 -0
  6. package/dist/components/canvas/canvas-toolbar/canvas-toolbar.d.ts +23 -0
  7. package/dist/components/canvas/canvas-workspace/canvas-workspace.d.ts +23 -0
  8. package/dist/components/canvas/iframe-preview/iframe-preview.d.ts +59 -0
  9. package/dist/components/composer/disclaimer/disclaimer.d.ts +8 -0
  10. package/dist/components/composer/message-composer.d.ts +14 -0
  11. package/dist/components/conversation/activity-indicator/activity-indicator.d.ts +8 -0
  12. package/dist/components/conversation/conversation.d.ts +17 -5
  13. package/dist/components/conversation/markdown-content/citation-injector.d.ts +6 -0
  14. package/dist/components/conversation/markdown-content/markdown-content.d.ts +24 -3
  15. package/dist/components/conversation/markdown-content/markdown-renderer.d.ts +12 -0
  16. package/dist/components/conversation/welcome-message/welcome-message.d.ts +10 -4
  17. package/dist/components/conversation/welcome-message/welcome-message.styles.d.ts +1 -1
  18. package/dist/components/feedback/consent-dialog.d.ts +34 -0
  19. package/dist/components/feedback/feedback-confirmation.d.ts +25 -0
  20. package/dist/components/feedback/feedback.d.ts +18 -2
  21. package/dist/components/layout/app-header/app-header.d.ts +13 -4
  22. package/dist/components/layout/connection-status-overlay/connection-status-overlay.d.ts +9 -0
  23. package/dist/components/message/assistant-message.d.ts +23 -0
  24. package/dist/components/message/message-actions.d.ts +47 -0
  25. package/dist/components/message/message-actions.styles.d.ts +2 -0
  26. package/dist/components/message/message.d.ts +17 -55
  27. package/dist/components/message/message.styles.d.ts +1 -1
  28. package/dist/components/message/renderers/canvas-tool-card.d.ts +24 -0
  29. package/dist/components/message/renderers/canvas-tool-card.styles.d.ts +2 -0
  30. package/dist/components/message/renderers/citation-link/citation-link.d.ts +60 -0
  31. package/dist/components/message/renderers/citation-link/citation-link.styles.d.ts +2 -0
  32. package/dist/components/message/renderers/tool-approval-block.d.ts +19 -2
  33. package/dist/components/message/renderers/tool-status-block.d.ts +21 -4
  34. package/dist/components/message/renderers/typing-indicator/typing-indicator.d.ts +8 -0
  35. package/dist/components/primitives/avatar/avatar.d.ts +74 -6
  36. package/dist/components/primitives/badge/badge.d.ts +29 -0
  37. package/dist/components/primitives/button/button.d.ts +13 -2
  38. package/dist/components/primitives/checkbox/checkbox.d.ts +63 -0
  39. package/dist/components/primitives/dropdown/dropdown-item.d.ts +31 -0
  40. package/dist/components/primitives/dropdown/dropdown.d.ts +87 -0
  41. package/dist/components/primitives/empty-state/empty-state.d.ts +22 -0
  42. package/dist/components/primitives/form-field/form-field.d.ts +36 -0
  43. package/dist/components/primitives/icon/icon.d.ts +11 -1
  44. package/dist/components/primitives/modal/modal.d.ts +49 -0
  45. package/dist/components/primitives/modal/modal.styles.d.ts +2 -0
  46. package/dist/components/primitives/notification/notification.d.ts +63 -0
  47. package/dist/components/primitives/notification/notification.styles.d.ts +2 -0
  48. package/dist/components/primitives/radio-button/radio-button.d.ts +63 -0
  49. package/dist/components/primitives/radio-button/radio-button.styles.d.ts +2 -0
  50. package/dist/components/primitives/skeleton/skeleton.d.ts +28 -0
  51. package/dist/components/primitives/skeleton/skeleton.styles.d.ts +2 -0
  52. package/dist/components/primitives/spinner/spinner.d.ts +7 -0
  53. package/dist/components/primitives/status-dot/status-dot.d.ts +12 -0
  54. package/dist/components/primitives/status-dot/status-dot.styles.d.ts +2 -0
  55. package/dist/components/primitives/surface/surface.d.ts +29 -0
  56. package/dist/components/primitives/surface/surface.styles.d.ts +2 -0
  57. package/dist/components/primitives/switch/switch.d.ts +61 -0
  58. package/dist/components/primitives/switch/switch.styles.d.ts +2 -0
  59. package/dist/components/primitives/tag/tag.d.ts +47 -0
  60. package/dist/components/primitives/tag/tag.styles.d.ts +2 -0
  61. package/dist/components/primitives/text-area/text-area.d.ts +67 -0
  62. package/dist/components/primitives/text-area/text-area.styles.d.ts +2 -0
  63. package/dist/components/primitives/text-input/text-input.d.ts +78 -0
  64. package/dist/components/primitives/text-input/text-input.styles.d.ts +2 -0
  65. package/dist/components/primitives/tooltip/tooltip.d.ts +99 -0
  66. package/dist/components/primitives/tooltip/tooltip.styles.d.ts +2 -0
  67. package/dist/components/shared/controllers/conversation-scroll-controller.d.ts +30 -0
  68. package/dist/components/shared/controllers/floating-controller.d.ts +73 -0
  69. package/dist/components/shared/controllers/focus-trap-controller.d.ts +16 -0
  70. package/dist/components/shared/controllers/iframe-preview-controller.d.ts +39 -0
  71. package/dist/components/shared/controllers/resize-controller.d.ts +22 -0
  72. package/dist/components/shared/controllers/scroll-controller.d.ts +17 -0
  73. package/dist/components/shared/controllers/toolbar-controller.d.ts +19 -0
  74. package/dist/components/shared/disposable-controller.d.ts +9 -0
  75. package/dist/components/shared/error-boundary.d.ts +14 -0
  76. package/dist/components/shared/suggested-question-pills.d.ts +24 -0
  77. package/dist/components/shared/suggested-question-pills.styles.d.ts +2 -0
  78. package/dist/core/adapters/citation-utils.d.ts +26 -0
  79. package/dist/core/adapters/index.d.ts +10 -0
  80. package/dist/core/adapters/memoized-mapper.d.ts +45 -0
  81. package/dist/core/adapters/message-mapper.d.ts +29 -117
  82. package/dist/core/adapters/message-types.d.ts +94 -0
  83. package/dist/core/adapters/tool-utils.d.ts +19 -2
  84. package/dist/core/canvas/canvas-state-container.d.ts +6 -0
  85. package/dist/core/canvas/canvas-store-controller.d.ts +9 -0
  86. package/dist/core/canvas/canvas-store.d.ts +72 -0
  87. package/dist/core/canvas/canvas-types.d.ts +35 -0
  88. package/dist/core/canvas/index.d.ts +4 -0
  89. package/dist/core/constants.d.ts +12 -0
  90. package/dist/core/errors.d.ts +3 -1
  91. package/dist/core/shared/context-store-controller.d.ts +26 -0
  92. package/dist/core/shared/state-container.d.ts +18 -0
  93. package/dist/{services → core/store}/agent-subscriber.d.ts +19 -5
  94. package/dist/core/store/auth-coordinator.d.ts +8 -2
  95. package/dist/core/store/bootstrap-loader.d.ts +2 -1
  96. package/dist/core/store/chat-state-container.d.ts +4 -10
  97. package/dist/core/store/chat-store.d.ts +47 -24
  98. package/dist/core/store/config-manager.d.ts +11 -1
  99. package/dist/core/store/feedback-coordinator.d.ts +39 -0
  100. package/dist/core/store/feedback-manager.d.ts +2 -1
  101. package/dist/core/store/health-manager.d.ts +36 -0
  102. package/dist/core/store/index.d.ts +12 -3
  103. package/dist/core/store/message-projection.d.ts +38 -0
  104. package/dist/{services → core/store}/run-coordinator.d.ts +24 -6
  105. package/dist/core/store/selectors/component-selectors.d.ts +71 -0
  106. package/dist/core/store/selectors/index.d.ts +7 -0
  107. package/dist/core/store/selectors/message-selectors.d.ts +53 -0
  108. package/dist/core/store/session-manager.d.ts +2 -0
  109. package/dist/core/store/store-controller.d.ts +3 -14
  110. package/dist/core/store/support-manager.d.ts +7 -9
  111. package/dist/core/store/tool-registry.d.ts +29 -3
  112. package/dist/core/tools/built-in-tools.d.ts +14 -0
  113. package/dist/core/types.d.ts +27 -0
  114. package/dist/custom-elements.json +1 -0
  115. package/dist/{da-BoJQ3AZC.js → da-9IG18yZ6.js} +39 -9
  116. package/dist/{fi-B10q-5gh.js → fi-DwB8EgSP.js} +39 -9
  117. package/dist/generated/locales/da.d.ts +35 -6
  118. package/dist/generated/locales/fi.d.ts +35 -6
  119. package/dist/generated/locales/nb.d.ts +35 -6
  120. package/dist/generated/locales/nl.d.ts +35 -6
  121. package/dist/generated/locales/sv.d.ts +35 -6
  122. package/dist/index-C2Q856CM.js +17383 -0
  123. package/dist/index.d.ts +2 -2
  124. package/dist/index.es.js +16112 -4
  125. package/dist/{markdown-CD6L_ZXu.js → markdown-BhQzVTJQ.js} +402 -395
  126. package/dist/{nb-C-lyw_Di.js → nb-BBumrBPR.js} +39 -9
  127. package/dist/{nl-C91EhoSO.js → nl-BqENEZnL.js} +39 -9
  128. package/dist/services/agent-service.d.ts +17 -18
  129. package/dist/services/api-client.d.ts +9 -22
  130. package/dist/services/api-schemas.d.ts +12 -8
  131. package/dist/services/auth-service.d.ts +29 -7
  132. package/dist/services/index.d.ts +5 -2
  133. package/dist/services/message-converter.d.ts +25 -0
  134. package/dist/services/support-service.d.ts +22 -18
  135. package/dist/{signalr-BjF2V9mZ.js → signalr-Cz-g9DNq.js} +1 -1
  136. package/dist/{sv-B3z601zM.js → sv-Dmo2Yvcn.js} +39 -9
  137. package/dist/types/events.d.ts +26 -0
  138. package/dist/types/index.d.ts +2 -1
  139. package/dist/utils/polling-task.d.ts +2 -0
  140. package/dist/utils/suggested-question-tags.d.ts +10 -0
  141. package/dist/vscode.html-custom-data.json +1154 -0
  142. package/package.json +12 -11
  143. package/dist/chart-block-DYZfc12a.js +0 -112
  144. package/dist/components/composer/resize-controller.d.ts +0 -11
  145. package/dist/components/conversation/scroll-utils.d.ts +0 -20
  146. package/dist/components/layout/error-notification/error-notification.d.ts +0 -16
  147. package/dist/components/message/renderers/chart-block/chart-block.d.ts +0 -27
  148. package/dist/components/primitives/popover/popover.d.ts +0 -46
  149. package/dist/components/shared/render-json-value.d.ts +0 -2
  150. package/dist/core/store/store-context.d.ts +0 -12
  151. package/dist/core/tools/echarts-tool.d.ts +0 -3
  152. package/dist/echarts-1kWCFQ2W.js +0 -44024
  153. package/dist/index-C_1azLkG.js +0 -13371
  154. package/dist/index.umd.js +0 -768
  155. package/dist/services/thread-rehydrator.d.ts +0 -9
  156. /package/dist/components/{composer/disclaimer/disclaimer.styles.d.ts → canvas/canvas-toolbar/canvas-toolbar.styles.d.ts} +0 -0
  157. /package/dist/components/{conversation/activity-indicator/activity-indicator.styles.d.ts → canvas/canvas-workspace/canvas-workspace.styles.d.ts} +0 -0
  158. /package/dist/components/message/{renderers/chart-block/chart-block.styles.d.ts → assistant-message.styles.d.ts} +0 -0
  159. /package/dist/components/{layout/app-header/app-header.styles.d.ts → primitives/badge/badge.styles.d.ts} +0 -0
  160. /package/dist/components/{layout/error-notification/error-notification.styles.d.ts → primitives/checkbox/checkbox.styles.d.ts} +0 -0
  161. /package/dist/components/primitives/{icon/icon.styles.d.ts → dropdown/dropdown-item.styles.d.ts} +0 -0
  162. /package/dist/components/primitives/{popover/popover.styles.d.ts → dropdown/dropdown.styles.d.ts} +0 -0
  163. /package/dist/components/{shared/error-boundary.styles.d.ts → primitives/empty-state/empty-state.styles.d.ts} +0 -0
  164. /package/dist/{styles/host.styles.d.ts → components/primitives/form-field/form-field.styles.d.ts} +0 -0
package/README.md CHANGED
@@ -62,7 +62,6 @@ Provide a `tokenProvider` that returns a valid OAuth access token. Implement cac
62
62
  | `auth-strategy` | `'visitor' \| 'visma'` | `'visitor'` | Authentication strategy. |
63
63
  | `closeable` | `boolean` | `true` | Show a close button in the header. |
64
64
  | `selected-model` | `string` | `''` | Override the default AI model. Must be in the profile's allowed overrides. |
65
- | `enable-charts` | `boolean` | `false` | Enable inline chart rendering via the built-in echarts tool. |
66
65
  | `tokenProvider` | `() => Promise<string>` | — | Async function returning an OAuth access token (Visma mode). Set via JS. |
67
66
  | `hostContextProvider` | `HostContextProvider` | — | Async function returning application context per message. Set via JS. |
68
67
  | `tools` | `FrontendTool[]` | `[]` | Frontend tool definitions sent to the agent. Set via JS. |
@@ -162,14 +161,6 @@ interface FrontendTool {
162
161
  }
163
162
  ```
164
163
 
165
- ## Charts
166
-
167
- Set `enable-charts` to enable the built-in echarts frontend tool. When enabled, the agent can render inline charts using [Apache ECharts](https://echarts.apache.org/).
168
-
169
- ```html
170
- <gaia-chat enable-charts></gaia-chat>
171
- ```
172
-
173
164
  ## Icon Registry
174
165
 
175
166
  Register custom SVG icons for use in the component:
package/dist/app/app.d.ts CHANGED
@@ -51,19 +51,23 @@ export declare class ChatApp extends BaseElement {
51
51
  selectedModel: string;
52
52
  /** Frontend tool definitions sent to the agent. */
53
53
  tools: FrontendTool[];
54
- /** Enable inline chart rendering for the echarts frontend tool. */
55
- enableCharts: boolean;
56
54
  private get activeLang();
57
55
  private langObserver?;
58
56
  private store;
59
- private storeState;
60
- private unsubscribeStore?;
61
- private apiClient;
57
+ private canvasStore;
58
+ private canvasEnabled;
59
+ private canvasActive;
60
+ private canvasExpanded;
61
+ private disposables;
62
+ private ctx;
63
+ private handleInlineQuestionClick;
62
64
  connectedCallback(): void;
63
65
  disconnectedCallback(): void;
64
66
  private handleAuthChanged;
65
67
  willUpdate(changedProperties: PropertyValues): void;
66
68
  private applySelectedModel;
69
+ private toggleHostAttribute;
70
+ private handleKeyDown;
67
71
  /** Clears the current conversation and resets the chat. */
68
72
  clearConversation(): void;
69
73
  /** Stops any active support session. */
@@ -0,0 +1,25 @@
1
+ import { ReactiveControllerHost } from 'lit';
2
+ import { CanvasStore } from '../core/canvas';
3
+ import { ChatStore } from '../core/store';
4
+ import { AgentService } from '../services/agent-service';
5
+ import { ApiClient } from '../services/api-client';
6
+ import { SupportService } from '../services/support-service';
7
+ export interface ChatContext {
8
+ apiClient: ApiClient;
9
+ agentService: AgentService;
10
+ supportService: SupportService;
11
+ store: ChatStore;
12
+ canvasStore: CanvasStore;
13
+ }
14
+ /**
15
+ * Create the full chat context: API client, services, stores, and canvas wiring.
16
+ */
17
+ export declare function createChatContext(host: ReactiveControllerHost & HTMLElement, baseUrl: string): ChatContext;
18
+ /**
19
+ * Subscribe to store state and auto-start support when channel switches.
20
+ * Returns an unsubscribe function.
21
+ *
22
+ * Tracks previous channel in a dedicated variable to avoid dependency
23
+ * on subscription ordering with other store subscribers.
24
+ */
25
+ export declare function subscribeAutoSupport(store: ChatStore, getBaseUrl: () => string): () => void;
@@ -0,0 +1,19 @@
1
+ import { BaseElement } from '../../shared/base-element';
2
+ /**
3
+ * Code viewer for canvas content.
4
+ *
5
+ * Renders code in a plain `<pre><code>` block.
6
+ *
7
+ * @element gaia-canvas-code-view
8
+ */
9
+ export declare class CanvasCodeView extends BaseElement {
10
+ static styles: import('lit').CSSResult[];
11
+ content: string;
12
+ language: string;
13
+ render(): import('lit-html').TemplateResult<1>;
14
+ }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'gaia-canvas-code-view': CanvasCodeView;
18
+ }
19
+ }
@@ -0,0 +1,20 @@
1
+ import { BaseElement } from '../../shared/base-element';
2
+ /**
3
+ * Dropdown selector for switching between canvas revisions.
4
+ *
5
+ * When multiple revisions exist, renders a `<select>` with version
6
+ * labels. Otherwise shows a static version number.
7
+ *
8
+ * @element gaia-canvas-revision-selector
9
+ */
10
+ export declare class CanvasRevisionSelector extends BaseElement {
11
+ static styles: import('lit').CSSResult[];
12
+ private ctrl;
13
+ private handleChange;
14
+ render(): import('lit-html').TemplateResult<1>;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ 'gaia-canvas-revision-selector': CanvasRevisionSelector;
19
+ }
20
+ }
@@ -0,0 +1,23 @@
1
+ import { BaseElement } from '../../shared/base-element';
2
+ /**
3
+ * Toolbar for the canvas workspace with tab switching, download, and close actions.
4
+ *
5
+ * Displays the canvas title, Code/Preview tab buttons, an optional
6
+ * PDF download button (for report-source canvases with ready exports),
7
+ * and a close button.
8
+ *
9
+ * @element gaia-canvas-toolbar
10
+ */
11
+ export declare class CanvasToolbar extends BaseElement {
12
+ static styles: import('lit').CSSResult[];
13
+ private ctrl;
14
+ private handleTabClick;
15
+ private handleClose;
16
+ private handleDownload;
17
+ render(): import('lit-html').TemplateResult<1>;
18
+ }
19
+ declare global {
20
+ interface HTMLElementTagNameMap {
21
+ 'gaia-canvas-toolbar': CanvasToolbar;
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import { nothing } from 'lit';
2
+ import { BaseElement } from '../../shared/base-element';
3
+ /**
4
+ * Side panel workspace for viewing and editing canvas content.
5
+ *
6
+ * Renders a toolbar and either a code view or a live preview (HTML or
7
+ * report) depending on the active tab. Shows a progress shimmer while
8
+ * the canvas is being created or updated.
9
+ *
10
+ * @element gaia-canvas-workspace
11
+ */
12
+ export declare class CanvasWorkspace extends BaseElement {
13
+ static styles: import('lit').CSSResult[];
14
+ private ctrl;
15
+ private renderPreview;
16
+ private handleRenderResult;
17
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
18
+ }
19
+ declare global {
20
+ interface HTMLElementTagNameMap {
21
+ 'gaia-canvas-workspace': CanvasWorkspace;
22
+ }
23
+ }
@@ -0,0 +1,59 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { BaseElement } from '../../shared/base-element';
3
+ export type IframePreviewMode = 'transpile' | 'html';
4
+ /**
5
+ * Unified iframe preview component supporting two rendering modes:
6
+ *
7
+ * - **transpile**: Transpiles TSX/JSX source with Sucrase (lazy-loaded),
8
+ * then posts the compiled code to a renderer iframe served from the API.
9
+ * - **html**: Renders report-source-html content directly as complete HTML
10
+ * with DOMPurify sanitization and optional ECharts bundle injection.
11
+ *
12
+ * @element gaia-iframe-preview
13
+ *
14
+ * @fires canvas-render-result - Bubbles render success or error details
15
+ */
16
+ export declare class IframePreview extends BaseElement {
17
+ static styles: import('lit').CSSResult[];
18
+ content: string;
19
+ title: string;
20
+ /** Rendering mode: 'transpile' for TSX/JSX, 'html' for report HTML. */
21
+ mode: IframePreviewMode;
22
+ /** URL of the canvas renderer app (transpile mode only). */
23
+ rendererUrl: string;
24
+ /** URL of the ECharts bundle script (html mode only). */
25
+ chartsScriptUrl: string;
26
+ private iframeRef;
27
+ private pendingCode;
28
+ private preview;
29
+ private htmlRenderGeneration;
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
32
+ protected willUpdate(changed: PropertyValues): void;
33
+ /**
34
+ * Target origin for postMessage to the sandboxed iframe.
35
+ * Without `allow-same-origin`, the iframe gets an opaque origin,
36
+ * so we must use '*'. The iframe sandbox (allow-scripts only) prevents
37
+ * same-origin access, cookie/storage reads, navigation, and popups.
38
+ * Only transpiled source code is transmitted — no auth tokens or secrets.
39
+ */
40
+ private getRendererOrigin;
41
+ private handleRendererReady;
42
+ private transpileAndSend;
43
+ private updateIframeHtml;
44
+ private loadChartsScript;
45
+ /**
46
+ * Error harness script injected into the report iframe.
47
+ * Catches JS errors and scans the DOM for chart rendering errors,
48
+ * then reports render status back to the parent via postMessage.
49
+ */
50
+ private static readonly ERROR_HARNESS;
51
+ private buildHtml;
52
+ private escapeHtml;
53
+ render(): import('lit-html').TemplateResult<1>;
54
+ }
55
+ declare global {
56
+ interface HTMLElementTagNameMap {
57
+ 'gaia-iframe-preview': IframePreview;
58
+ }
59
+ }
@@ -1,4 +1,12 @@
1
1
  import { BaseElement } from '../../shared/base-element';
2
+ /**
3
+ * AI disclaimer notice displayed below the message composer.
4
+ *
5
+ * Shows a static message informing users that answers are AI-generated
6
+ * and may contain errors, with a link to the terms of use.
7
+ *
8
+ * @element gaia-disclaimer
9
+ */
2
10
  export declare class GaiaDisclaimer extends BaseElement {
3
11
  static styles: import('lit').CSSResult[];
4
12
  render(): import('lit-html').TemplateResult<1>;
@@ -1,6 +1,18 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { HostContextProvider } from '../../types';
3
3
  import { BaseElement } from '../shared/base-element';
4
+ /**
5
+ * Text input area for composing and sending messages.
6
+ *
7
+ * Provides an auto-resizing textarea, character count validation,
8
+ * suggested question pills (when the conversation is empty), a send
9
+ * button, and the AI disclaimer. Routes messages to either the AI
10
+ * agent or the support operator depending on the active channel.
11
+ *
12
+ * @element gaia-message-composer
13
+ *
14
+ * @fires {MessageSentEvent} message-sent - When the user sends a message
15
+ */
4
16
  export declare class GaiaMessageComposer extends BaseElement {
5
17
  static styles: import('lit').CSSResult[];
6
18
  private debounceTimer?;
@@ -19,12 +31,14 @@ export declare class GaiaMessageComposer extends BaseElement {
19
31
  hostContextProvider?: HostContextProvider;
20
32
  rows: number;
21
33
  maxRows: number;
34
+ connectedCallback(): void;
22
35
  disconnectedCallback(): void;
23
36
  private get notAllowedToSendMessage();
24
37
  private isMessageNotAllowed;
25
38
  private validateInput;
26
39
  private handleChange;
27
40
  private handleInput;
41
+ private handleFeedbackClosed;
28
42
  private closeFeedbackIfOpen;
29
43
  private handleSendMessage;
30
44
  private resolveHostContext;
@@ -1,6 +1,14 @@
1
1
  import { nothing } from 'lit';
2
2
  import { SupportSessionActivityType } from '../../../core/types';
3
3
  import { BaseElement } from '../../shared/base-element';
4
+ /**
5
+ * Inline divider that marks support session transitions in the conversation.
6
+ *
7
+ * Renders a horizontal rule with an icon and label indicating a support
8
+ * session has started or ended (e.g. "You have been connected to support").
9
+ *
10
+ * @element gaia-activity-indicator
11
+ */
4
12
  export declare class GaiaActivityIndicator extends BaseElement {
5
13
  static styles: import('lit').CSSResult[];
6
14
  /**
@@ -1,22 +1,34 @@
1
1
  import { BaseElement } from '../shared/base-element';
2
+ /**
3
+ * Scrollable message list that renders the full conversation.
4
+ *
5
+ * Displays welcome content when the conversation is empty, then switches
6
+ * to a block-based message list as messages arrive. Handles auto-scrolling,
7
+ * thinking indicators, inline error notifications, the feedback form, and
8
+ * feedback confirmation.
9
+ *
10
+ * @element gaia-conversation
11
+ */
2
12
  export declare class GaiaConversation extends BaseElement {
3
13
  static styles: import('lit').CSSResult[][];
4
14
  private containerRef;
5
15
  private scrollViewRef;
6
16
  private lastMessageRef;
7
17
  private ctrl;
8
- /** Tracked for scroll change detection. */
9
- private prevMessages;
10
- private prevFeedbackOpen;
11
- private prevError;
18
+ private handleThumb;
19
+ private scrollCtrl;
12
20
  protected updated(): Promise<void>;
13
- private handleScrollUpdate;
14
21
  /**
15
22
  * Whether the thinking indicator should be visible.
16
23
  * Hidden when the last message is a pending tool call with a visible
17
24
  * summary — its status block shows its own shimmer animation.
18
25
  */
19
26
  private shouldShowThinking;
27
+ /**
28
+ * Check if a message belongs to the currently active (non-idle) run.
29
+ */
30
+ private isMessageInActiveRun;
31
+ private renderRunGroup;
20
32
  render(): import('lit-html').TemplateResult<1>;
21
33
  }
22
34
  declare global {
@@ -0,0 +1,6 @@
1
+ import { SearchCitation } from '../../../core/adapters/tool-utils';
2
+ /**
3
+ * Walk text nodes in the container and replace citation markers with
4
+ * <gaia-citation-link> elements.
5
+ */
6
+ export declare function injectCitationLinks(container: HTMLElement, citationMap: Map<string, SearchCitation>): void;
@@ -1,10 +1,31 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { SearchCitation } from '../../../core/adapters/tool-utils';
1
3
  import { BaseElement } from '../../shared/base-element';
4
+ /**
5
+ * Renders a Markdown string as sanitized HTML with optional citation links.
6
+ *
7
+ * Uses `marked` for parsing and `DOMPurify` for XSS protection. After the
8
+ * initial render, footnote-style reference markers in the HTML are replaced
9
+ * with interactive `<gaia-citation-link>` elements when citations are present.
10
+ *
11
+ * @element gaia-markdown-content
12
+ */
2
13
  export declare class GaiaMarkdownContent extends BaseElement {
3
14
  static styles: import('lit').CSSResult[];
4
- private static hookInstalled;
5
- private static installDOMPurifyHook;
6
15
  value: string;
7
- connectedCallback(): void;
16
+ citations: SearchCitation[];
17
+ streaming: boolean;
18
+ /**
19
+ * Positioning boundary element passed through to citation links.
20
+ */
21
+ boundaryElement: HTMLElement | null;
22
+ private markdownEl;
23
+ /** Index of citations by referenceId for quick lookup. */
24
+ private citationMap;
25
+ protected willUpdate(changed: PropertyValues): void;
26
+ protected updated(changed: PropertyValues): void;
27
+ /** Propagate boundaryElement and disabled state to all injected citation links. */
28
+ private updateCitationLinks;
8
29
  render(): import('lit-html').TemplateResult<1>;
9
30
  }
10
31
  declare global {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Markdown Renderer
3
+ *
4
+ * Module-level setup for marked + DOMPurify. Configured once at import time
5
+ * instead of on component lifecycle, avoiding global side effects from
6
+ * component connectedCallback.
7
+ */
8
+ /**
9
+ * Parse markdown to sanitized HTML string.
10
+ * Uses module-level marked + DOMPurify configuration.
11
+ */
12
+ export declare function renderMarkdown(value: string): string;
@@ -1,10 +1,16 @@
1
- import { IconName } from '../../primitives/icon/icon-registry';
2
- import { WelcomeMessage } from '../../../services/api-client';
1
+ import { WelcomeMessage } from '../../../core/types';
3
2
  import { BaseElement } from '../../shared/base-element';
3
+ /**
4
+ * Welcome screen shown when the conversation is empty.
5
+ *
6
+ * Renders a greeting title, optional body text, a call-to-action prompt,
7
+ * and optional informational cards driven by the `blocks` field.
8
+ *
9
+ * @element gaia-welcome-message
10
+ */
4
11
  export declare class GaiaWelcomeMessage extends BaseElement {
5
- static styles: import('lit').CSSResult[];
12
+ static styles: import('lit').CSSResult[][];
6
13
  welcomeMessage?: WelcomeMessage;
7
- protected getIcon(icon: string): IconName;
8
14
  render(): import('lit-html').TemplateResult<1>;
9
15
  }
10
16
  declare global {
@@ -1,2 +1,2 @@
1
- declare const _default: import('lit').CSSResult;
1
+ declare const _default: import('lit').CSSResult[];
2
2
  export default _default;
@@ -0,0 +1,34 @@
1
+ import { nothing } from 'lit';
2
+ import { BaseElement } from '../shared/base-element';
3
+ export interface ConsentConfirmedEvent {
4
+ consent: boolean;
5
+ }
6
+ /**
7
+ * Consent dialog asking whether to share the conversation for feedback review.
8
+ *
9
+ * Opened by the feedback form when conversation sharing is enabled.
10
+ * Renders a modal with Yes/No buttons and a privacy statement link.
11
+ *
12
+ * @element gaia-consent-dialog
13
+ *
14
+ * @fires consent-confirmed - When the user confirms or declines consent.
15
+ * `event.detail` contains `{ consent: boolean }`.
16
+ */
17
+ export declare class GaiaConsentDialog extends BaseElement {
18
+ private isOpen;
19
+ /**
20
+ * Shows the consent dialog and moves focus into it.
21
+ */
22
+ show(): Promise<void>;
23
+ /**
24
+ * Closes the consent dialog and restores focus.
25
+ */
26
+ close(): void;
27
+ private handleConsentConfirmed;
28
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
29
+ }
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ 'gaia-consent-dialog': GaiaConsentDialog;
33
+ }
34
+ }
@@ -0,0 +1,25 @@
1
+ import { BaseElement } from '../shared/base-element';
2
+ /**
3
+ * Success notification shown after feedback is submitted.
4
+ *
5
+ * Displays a "Thank you" message as a success notification. When the
6
+ * user consented to share their conversation, also shows a Privacy ID
7
+ * with a copy button so they can save it for data-deletion requests.
8
+ *
9
+ * @element gaia-feedback-confirmation
10
+ */
11
+ export declare class GaiaFeedbackConfirmation extends BaseElement {
12
+ static styles: import('lit').CSSResult[];
13
+ private ctrl;
14
+ private copied;
15
+ private get visitorUserId();
16
+ private get shouldShowPrivacyId();
17
+ private handleClose;
18
+ private handleCopyPrivacyId;
19
+ render(): import('lit-html').TemplateResult<1>;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'gaia-feedback-confirmation': GaiaFeedbackConfirmation;
24
+ }
25
+ }
@@ -1,18 +1,34 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { BaseElement } from '../shared/base-element';
3
+ /**
4
+ * Feedback form for rating and commenting on the chat experience.
5
+ *
6
+ * Renders a 1–5 emoji rating scale and an optional comment textarea
7
+ * inside a focus-trapped dialog surface. When conversation sharing
8
+ * is enabled, submitting opens a consent dialog before finalizing.
9
+ *
10
+ * @element gaia-feedback
11
+ *
12
+ * @fires {FeedbackSubmittedEvent} feedback-submitted - When feedback is successfully submitted
13
+ * @fires {FeedbackClosedEvent} feedback-closed - When the form is closed (via submit or dismiss)
14
+ */
3
15
  export declare class GaiaFeedback extends BaseElement {
4
16
  static styles: import('lit').CSSResult[];
5
17
  private ctrl;
18
+ private focusTrap;
6
19
  private ratingInput;
7
- private commentInput;
20
+ private consentDialog;
8
21
  private closeButton;
9
22
  private selectedRating;
10
23
  private comment;
24
+ connectedCallback(): void;
25
+ disconnectedCallback(): void;
11
26
  private canSubmit;
27
+ private ratingIcons;
12
28
  private handleRatingChange;
13
29
  private handleCommentChange;
14
30
  private handleSubmit;
15
- private handleReset;
31
+ private handleConsentConfirmed;
16
32
  protected firstUpdated(_changedProperties: PropertyValues): void;
17
33
  private handleKeyDown;
18
34
  private handleClose;
@@ -1,17 +1,26 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { BaseElement } from '../../shared/base-element';
3
+ /**
4
+ * Application header bar with feedback, new-chat, and close actions.
5
+ *
6
+ * Renders a toolbar with icon buttons for opening the feedback form,
7
+ * clearing the conversation, and closing the chat widget. Actions are
8
+ * disabled while the chat is initializing or a run is in progress.
9
+ *
10
+ * @element gaia-app-header
11
+ *
12
+ * @fires {ConversationClearedEvent} conversation-cleared - When the user starts a new chat
13
+ * @fires {CloseRequestedEvent} close-requested - When the user clicks the close button
14
+ */
3
15
  export declare class GaiaAppHeader extends BaseElement {
4
16
  static styles: import('lit').CSSResult[];
5
17
  private ctrl;
6
- private activeToolbarIndex;
18
+ private toolbar;
7
19
  closeable: boolean;
8
20
  connectedCallback(): void;
9
21
  disconnectedCallback(): void;
10
22
  protected updated(changed: PropertyValues): void;
11
23
  private getToolbarButtons;
12
- private updateToolbarTabindex;
13
- private nextEnabledIndex;
14
- private handleToolbarKeyDown;
15
24
  private handleFeedbackClosed;
16
25
  private handleClearConversation;
17
26
  private handleToggleFeedback;
@@ -1,5 +1,14 @@
1
1
  import { nothing } from 'lit';
2
2
  import { BaseElement } from '../../shared/base-element';
3
+ /**
4
+ * Overlay displayed when the backend is unreachable.
5
+ *
6
+ * Shows a warning icon, a "Service temporarily unavailable" message,
7
+ * and a reconnecting dot animation. Automatically hides when the
8
+ * connection is restored.
9
+ *
10
+ * @element gaia-connection-status-overlay
11
+ */
3
12
  export declare class GaiaConnectionStatusOverlay extends BaseElement {
4
13
  static styles: import('lit').CSSResult[];
5
14
  private ctrl;
@@ -0,0 +1,23 @@
1
+ import { nothing } from 'lit';
2
+ import { UiAssistantMessage } from '../../core/adapters';
3
+ import { SearchCitation } from '../../core/adapters/tool-utils';
4
+ import { BaseElement } from '../shared/base-element';
5
+ export declare class GaiaAssistantMessage extends BaseElement {
6
+ static styles: import('lit').CSSResult[][];
7
+ message: UiAssistantMessage;
8
+ citations: SearchCitation[];
9
+ isStreaming: boolean;
10
+ private bodyEl;
11
+ /** Cached result of extractSuggestedQuestions for the current content. */
12
+ private cachedExtraction;
13
+ private getExtractedContent;
14
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
15
+ private renderToolCalls;
16
+ private renderToolCall;
17
+ private handleInlineQuestionClick;
18
+ }
19
+ declare global {
20
+ interface HTMLElementTagNameMap {
21
+ 'gaia-assistant-message': GaiaAssistantMessage;
22
+ }
23
+ }
@@ -0,0 +1,47 @@
1
+ import { nothing } from 'lit';
2
+ import { BaseElement } from '../shared/base-element';
3
+ /**
4
+ * Copy and thumbs-up/down feedback buttons for a message.
5
+ *
6
+ * Renders a copy-to-clipboard button and, for assistant messages, thumbs
7
+ * up/down feedback toggle buttons. Actions are hidden while the message
8
+ * belongs to an active run. Rendered once per run group by the conversation
9
+ * component (not per message).
10
+ *
11
+ * The component self-manages its visibility: when no buttons would be
12
+ * rendered it sets `display: none` via the `has-actions` host attribute,
13
+ * so no spacing is reserved in the layout.
14
+ *
15
+ * Receives callbacks as props instead of using `StoreController` so
16
+ * the component stays independently testable without a store context.
17
+ *
18
+ * @element gaia-message-actions
19
+ */
20
+ export declare class GaiaMessageActions extends BaseElement {
21
+ static styles: import('lit').CSSResult[][];
22
+ /** The message ID for feedback submission. */
23
+ messageId: string;
24
+ /** The message type (only assistant messages show feedback buttons). */
25
+ messageType: 'user' | 'assistant' | 'operator';
26
+ /** The content to copy. Empty string hides the copy button. */
27
+ copyContent: string;
28
+ /** Whether this message belongs to the currently active run. Hides actions while active. */
29
+ inActiveRun: boolean;
30
+ /** Callback for submitting message thumbs. Set by parent message component. */
31
+ onThumb?: (messageId: string, isPositive: boolean | null) => Promise<boolean>;
32
+ private isCopied;
33
+ private feedbackState;
34
+ private copyTimeoutId?;
35
+ private get hasVisibleActions();
36
+ disconnectedCallback(): void;
37
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
38
+ private renderCopyButton;
39
+ private renderFeedbackButtons;
40
+ private handleCopyClick;
41
+ private handleFeedbackClick;
42
+ }
43
+ declare global {
44
+ interface HTMLElementTagNameMap {
45
+ 'gaia-message-actions': GaiaMessageActions;
46
+ }
47
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: import('lit').CSSResult[];
2
+ export default _default;