@visma-swno/gaia-chat-ui 2.1.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/README.md +27 -5
- package/dist/app/app.d.ts +41 -0
- package/dist/app/app.styles.d.ts +2 -0
- package/dist/{src/app → app}/controllers/error-controller.d.ts +0 -1
- package/dist/{src/app → app}/localization.d.ts +1 -2
- package/dist/auth/auth-errors.d.ts +17 -0
- package/dist/auth/auth-provider.d.ts +10 -0
- package/dist/auth/strategies/base-strategy.d.ts +21 -0
- package/dist/auth/strategies/null-auth-strategy.d.ts +8 -0
- package/dist/auth/strategies/visitor-token-strategy.d.ts +9 -0
- package/dist/auth/strategies/visma-token-strategy.d.ts +9 -0
- package/dist/auth/strategy-factory.d.ts +13 -0
- package/dist/auth/token-cache.d.ts +17 -0
- package/dist/auth/token-parser.d.ts +6 -0
- package/dist/auth/types.d.ts +17 -0
- package/dist/components/app-header/app-header.d.ts +25 -0
- package/dist/components/app-header/app-header.styles.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +17 -0
- package/dist/components/avatar/avatar.styles.d.ts +2 -0
- package/dist/components/button/button.d.ts +16 -0
- package/dist/components/button/button.styles.d.ts +2 -0
- package/dist/components/conversation/conversation.d.ts +39 -0
- package/dist/components/conversation/conversation.styles.d.ts +2 -0
- package/dist/components/conversation/message-renderers.d.ts +39 -0
- package/dist/components/conversation/scroll-controller.d.ts +47 -0
- package/dist/components/disclaimer/disclaimer.d.ts +10 -0
- package/dist/components/disclaimer/disclaimer.styles.d.ts +2 -0
- package/dist/components/error-notification/error-notification.d.ts +16 -0
- package/dist/components/error-notification/error-notification.styles.d.ts +2 -0
- package/dist/components/feedback/feedback.d.ts +26 -0
- package/dist/components/feedback/feedback.styles.d.ts +2 -0
- package/dist/components/icon/icon-library.d.ts +40 -0
- package/dist/components/icon/icon.d.ts +19 -0
- package/dist/components/icon/icon.styles.d.ts +2 -0
- package/dist/components/markdown-content/markdown-content.d.ts +11 -0
- package/dist/components/markdown-content/markdown-content.styles.d.ts +2 -0
- package/dist/components/message/message.d.ts +12 -0
- package/dist/components/message/message.styles.d.ts +2 -0
- package/dist/components/message-composer/message-composer.d.ts +52 -0
- package/dist/components/message-composer/message-composer.styles.d.ts +2 -0
- package/dist/components/message-composer/resize-controller.d.ts +11 -0
- package/dist/components/popover/popover.d.ts +45 -0
- package/dist/components/popover/popover.styles.d.ts +2 -0
- package/dist/components/shared/base-element.d.ts +6 -0
- package/dist/components/shared/watch.d.ts +11 -0
- package/dist/components/source-list/source-list.d.ts +15 -0
- package/dist/components/source-list/source-list.styles.d.ts +2 -0
- package/dist/components/spinner/spinner.d.ts +10 -0
- package/dist/components/spinner/spinner.styles.d.ts +2 -0
- package/dist/components/typing-indicator/typing-indicator.d.ts +10 -0
- package/dist/components/typing-indicator/typing-indicator.styles.d.ts +2 -0
- package/dist/components/welcome-message/welcome-message.d.ts +15 -0
- package/dist/components/welcome-message/welcome-message.styles.d.ts +2 -0
- package/dist/core/context/app-context.d.ts +49 -0
- package/dist/{src/core → core}/effects/bootstrap-effect.d.ts +5 -2
- package/dist/{src/core → core}/effects/conversation-effect.d.ts +5 -2
- package/dist/{src/core → core}/effects/feedback-effect.d.ts +5 -3
- package/dist/{src/core → core}/effects/stream-effect.d.ts +9 -3
- package/dist/{src/core → core}/effects/stream-event-router.d.ts +0 -1
- package/dist/core/effects/support-effect.d.ts +33 -0
- package/dist/{src/core → core}/effects/task-runner.d.ts +0 -1
- package/dist/{src/core → core}/errors/app-error.d.ts +0 -1
- package/dist/{src/core → core}/events/public/app.d.ts +0 -21
- package/dist/{src/core → core}/events/transport/sse.d.ts +0 -1
- package/dist/{src/core → core}/events/transport/ws.d.ts +0 -1
- package/dist/{src/core → core}/state/index.d.ts +0 -1
- package/dist/{src/core → core}/state/root-reducer.d.ts +0 -1
- package/dist/{src/core → core}/state/slices/config-slice.d.ts +0 -1
- package/dist/{src/core → core}/state/slices/messages-slice.d.ts +0 -1
- package/dist/{src/core → core}/state/slices/session-slice.d.ts +0 -1
- package/dist/{src/core → core}/state/slices/ui-slice.d.ts +0 -1
- package/dist/{src/core → core}/state/store.d.ts +0 -1
- package/dist/core/types/host-context.d.ts +49 -0
- package/dist/{src/core → core}/types.d.ts +0 -1
- package/dist/{src/core → core}/utils/message-factory.d.ts +0 -1
- package/dist/{da-CIz_JTpK.js → da-BhU73DwX.js} +10 -8
- package/dist/fi-CWA_79BI.js +47 -0
- package/dist/{src/generated → generated}/locale-codes.d.ts +2 -3
- package/dist/{src/generated → generated}/locales/da.d.ts +6 -4
- package/dist/generated/locales/fi.d.ts +43 -0
- package/dist/{src/generated → generated}/locales/nb.d.ts +6 -4
- package/dist/generated/locales/nl.d.ts +43 -0
- package/dist/{src/generated → generated}/locales/sv.d.ts +6 -4
- package/dist/index-DCCkNOcP.js +7847 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +1 -2
- package/dist/index.umd.js +500 -570
- package/dist/infra/http/api-client.d.ts +13 -0
- package/dist/{src/infra → infra}/http/api-error.d.ts +0 -1
- package/dist/infra/http/auth-header-strategy.d.ts +14 -0
- package/dist/{src/infra → infra}/http/guards.d.ts +0 -1
- package/dist/{src/infra → infra}/signalr/signalr-error.d.ts +0 -1
- package/dist/{src/infra → infra}/sse/sse.d.ts +0 -1
- package/dist/{src/infra → infra}/sse/stream-error.d.ts +0 -1
- package/dist/{src/infra → infra}/storage/bootstrap-config-storage.d.ts +0 -1
- package/dist/{src/infra → infra}/storage/conversation-id-storage.d.ts +0 -1
- package/dist/{src/infra → infra}/storage/types.d.ts +0 -1
- package/dist/{src/infra → infra}/storage/visitor-token-storage.d.ts +0 -1
- package/dist/{nb-BRpEPPS7.js → nb-BWt8rKAf.js} +10 -8
- package/dist/nl-dkWq4g54.js +47 -0
- package/dist/{src/services → services}/bootstrap-service.d.ts +2 -2
- package/dist/{src/services → services}/chat-service.d.ts +2 -1
- package/dist/{src/services → services}/feedback-service.d.ts +0 -1
- package/dist/services/support-service.d.ts +7 -0
- package/dist/styles/host.styles.d.ts +2 -0
- package/dist/{sv-DMfrf_18.js → sv-Dyhy3RXT.js} +10 -8
- package/package.json +43 -20
- package/custom-elements.json +0 -261
- package/dist/da-CIz_JTpK.js.map +0 -1
- package/dist/index-CEIcDKQq.js +0 -6286
- package/dist/index-CEIcDKQq.js.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js.map +0 -1
- package/dist/nb-BRpEPPS7.js.map +0 -1
- package/dist/package.json.d.ts +0 -89
- package/dist/src/app/app.d.ts +0 -52
- package/dist/src/app/app.d.ts.map +0 -1
- package/dist/src/app/controllers/error-controller.d.ts.map +0 -1
- package/dist/src/app/localization.d.ts.map +0 -1
- package/dist/src/app/middlewares/middleware.d.ts +0 -12
- package/dist/src/app/middlewares/middleware.d.ts.map +0 -1
- package/dist/src/auth/access-token-provider.d.ts +0 -27
- package/dist/src/auth/access-token-provider.d.ts.map +0 -1
- package/dist/src/auth/auth-errors.d.ts +0 -13
- package/dist/src/auth/auth-errors.d.ts.map +0 -1
- package/dist/src/auth/strategies/strategy.d.ts +0 -38
- package/dist/src/auth/strategies/strategy.d.ts.map +0 -1
- package/dist/src/auth/strategies/visitor-token-strategy.d.ts +0 -14
- package/dist/src/auth/strategies/visitor-token-strategy.d.ts.map +0 -1
- package/dist/src/auth/strategies/visma-token-strategy.d.ts +0 -10
- package/dist/src/auth/strategies/visma-token-strategy.d.ts.map +0 -1
- package/dist/src/auth/strategy-factory.d.ts +0 -10
- package/dist/src/auth/strategy-factory.d.ts.map +0 -1
- package/dist/src/components/base-tw-element.d.ts +0 -5
- package/dist/src/components/base-tw-element.d.ts.map +0 -1
- package/dist/src/components/composer.d.ts +0 -21
- package/dist/src/components/composer.d.ts.map +0 -1
- package/dist/src/components/error-message.d.ts +0 -9
- package/dist/src/components/error-message.d.ts.map +0 -1
- package/dist/src/components/feedback-form.d.ts +0 -14
- package/dist/src/components/feedback-form.d.ts.map +0 -1
- package/dist/src/components/menu.d.ts +0 -11
- package/dist/src/components/menu.d.ts.map +0 -1
- package/dist/src/components/message/assistant.d.ts +0 -14
- package/dist/src/components/message/assistant.d.ts.map +0 -1
- package/dist/src/components/message/base.d.ts +0 -14
- package/dist/src/components/message/base.d.ts.map +0 -1
- package/dist/src/components/message/index.d.ts +0 -5
- package/dist/src/components/message/index.d.ts.map +0 -1
- package/dist/src/components/message/operator.d.ts +0 -7
- package/dist/src/components/message/operator.d.ts.map +0 -1
- package/dist/src/components/message/system.d.ts +0 -11
- package/dist/src/components/message/system.d.ts.map +0 -1
- package/dist/src/components/message/user.d.ts +0 -7
- package/dist/src/components/message/user.d.ts.map +0 -1
- package/dist/src/components/message-list.d.ts +0 -25
- package/dist/src/components/message-list.d.ts.map +0 -1
- package/dist/src/components/shared/markdown.d.ts +0 -2
- package/dist/src/components/shared/markdown.d.ts.map +0 -1
- package/dist/src/components/thinking-indicator.d.ts +0 -5
- package/dist/src/components/thinking-indicator.d.ts.map +0 -1
- package/dist/src/components/welcome-message.d.ts +0 -11
- package/dist/src/components/welcome-message.d.ts.map +0 -1
- package/dist/src/core/effects/bootstrap-effect.d.ts.map +0 -1
- package/dist/src/core/effects/conversation-effect.d.ts.map +0 -1
- package/dist/src/core/effects/feedback-effect.d.ts.map +0 -1
- package/dist/src/core/effects/stream-effect.d.ts.map +0 -1
- package/dist/src/core/effects/stream-event-router.d.ts.map +0 -1
- package/dist/src/core/effects/support-effect.d.ts +0 -25
- package/dist/src/core/effects/support-effect.d.ts.map +0 -1
- package/dist/src/core/effects/task-runner.d.ts.map +0 -1
- package/dist/src/core/errors/app-error.d.ts.map +0 -1
- package/dist/src/core/events/internal/commands.d.ts +0 -48
- package/dist/src/core/events/internal/commands.d.ts.map +0 -1
- package/dist/src/core/events/internal/index.d.ts +0 -3
- package/dist/src/core/events/internal/index.d.ts.map +0 -1
- package/dist/src/core/events/internal/utils.d.ts +0 -17
- package/dist/src/core/events/internal/utils.d.ts.map +0 -1
- package/dist/src/core/events/public/app.d.ts.map +0 -1
- package/dist/src/core/events/transport/sse.d.ts.map +0 -1
- package/dist/src/core/events/transport/ws.d.ts.map +0 -1
- package/dist/src/core/state/index.d.ts.map +0 -1
- package/dist/src/core/state/root-reducer.d.ts.map +0 -1
- package/dist/src/core/state/slices/config-slice.d.ts.map +0 -1
- package/dist/src/core/state/slices/messages-slice.d.ts.map +0 -1
- package/dist/src/core/state/slices/session-slice.d.ts.map +0 -1
- package/dist/src/core/state/slices/ui-slice.d.ts.map +0 -1
- package/dist/src/core/state/store.d.ts.map +0 -1
- package/dist/src/core/types.d.ts.map +0 -1
- package/dist/src/core/utils/message-factory.d.ts.map +0 -1
- package/dist/src/generated/locale-codes.d.ts.map +0 -1
- package/dist/src/generated/locales/da.d.ts.map +0 -1
- package/dist/src/generated/locales/nb.d.ts.map +0 -1
- package/dist/src/generated/locales/sv.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/infra/http/api-client.d.ts +0 -16
- package/dist/src/infra/http/api-client.d.ts.map +0 -1
- package/dist/src/infra/http/api-error.d.ts.map +0 -1
- package/dist/src/infra/http/guards.d.ts.map +0 -1
- package/dist/src/infra/signalr/signalr-error.d.ts.map +0 -1
- package/dist/src/infra/sse/sse.d.ts.map +0 -1
- package/dist/src/infra/sse/stream-error.d.ts.map +0 -1
- package/dist/src/infra/storage/bootstrap-config-storage.d.ts.map +0 -1
- package/dist/src/infra/storage/conversation-id-storage.d.ts.map +0 -1
- package/dist/src/infra/storage/types.d.ts.map +0 -1
- package/dist/src/infra/storage/visitor-token-storage.d.ts.map +0 -1
- package/dist/src/services/bootstrap-service.d.ts.map +0 -1
- package/dist/src/services/chat-service.d.ts.map +0 -1
- package/dist/src/services/feedback-service.d.ts.map +0 -1
- package/dist/sv-DMfrf_18.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.0.0](https://github.com/visma-swno/vsn-assistant/compare/web-component@v3.0.0...web-component@v4.0.0) (2025-12-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add Dutch and Finnish language support ([#1488](https://github.com/visma-swno/vsn-assistant/issues/1488)) ([1e2bf12](https://github.com/visma-swno/vsn-assistant/commit/1e2bf12b9fb544a248b1e666d2684efbceb9a93c))
|
|
9
|
+
* add icon component ([#1209](https://github.com/visma-swno/vsn-assistant/issues/1209)) ([ec48ccd](https://github.com/visma-swno/vsn-assistant/commit/ec48ccd63c1737388168a40431b28d6dd7cd2931))
|
|
10
|
+
* add popover/tooltip component for icon buttons ([#1169](https://github.com/visma-swno/vsn-assistant/issues/1169)) ([#1318](https://github.com/visma-swno/vsn-assistant/issues/1318)) ([9eeed50](https://github.com/visma-swno/vsn-assistant/commit/9eeed50f2b502f618dd0a11dcc244e6cc8cd486d))
|
|
11
|
+
* implement Host Context API for context-aware conversations ([#1313](https://github.com/visma-swno/vsn-assistant/issues/1313)) ([3a7a973](https://github.com/visma-swno/vsn-assistant/commit/3a7a9733c4f6d6c21d1952c137a36e7f3ccc88f0))
|
|
12
|
+
* **support:** web-component sends outbound support requests over HTTP ([#1435](https://github.com/visma-swno/vsn-assistant/issues/1435)) ([0f6c5a0](https://github.com/visma-swno/vsn-assistant/commit/0f6c5a0693f21bab2f312d3d987d7ce16eea763b))
|
|
13
|
+
* **web-component:** support relative image sources ([#1487](https://github.com/visma-swno/vsn-assistant/issues/1487)) ([6ccc8f9](https://github.com/visma-swno/vsn-assistant/commit/6ccc8f91a1305c13422f1ffa7e444b5cb92ba7b7))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* add white background ([#1207](https://github.com/visma-swno/vsn-assistant/issues/1207)) ([9fb01d4](https://github.com/visma-swno/vsn-assistant/commit/9fb01d4b0579f195915243ed5e39d0d726d43b65)), closes [#1202](https://github.com/visma-swno/vsn-assistant/issues/1202)
|
|
19
|
+
* **deps:** bump js-yaml from 4.1.0 to 4.1.1 in /web-component ([#1408](https://github.com/visma-swno/vsn-assistant/issues/1408)) ([475aa18](https://github.com/visma-swno/vsn-assistant/commit/475aa1893ce03351785a1031cab3f4bf29fa1c53))
|
|
20
|
+
* popover is hidden when slot element is disabled ([#1334](https://github.com/visma-swno/vsn-assistant/issues/1334)) ([fe78b8f](https://github.com/visma-swno/vsn-assistant/commit/fe78b8fc936b06db2b91d504ee4cb62c73963a46))
|
|
21
|
+
* re-add supporthub methods so support both old and new gaia-chat ([#1438](https://github.com/visma-swno/vsn-assistant/issues/1438)) ([ae86b2d](https://github.com/visma-swno/vsn-assistant/commit/ae86b2d76bf05050e213f24c499130475c4c6a15))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Build System
|
|
25
|
+
|
|
26
|
+
* **deps-dev:** bump happy-dom from 19.0.2 to 20.0.0 in /web-component in the npm_and_yarn group across 1 directory ([#1187](https://github.com/visma-swno/vsn-assistant/issues/1187)) ([1aab790](https://github.com/visma-swno/vsn-assistant/commit/1aab790aac45be55497fe29ddc82ca542e30ef69))
|
|
27
|
+
|
|
28
|
+
## [3.0.0](https://github.com/visma-swno/vsn-assistant/compare/web-component@v2.1.3...web-component@v3.0.0) (2025-10-14)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### ⚠ BREAKING CHANGES
|
|
32
|
+
|
|
33
|
+
* The authentication system has been completely redesigned for better flexibility and security.
|
|
34
|
+
* **deps-dev:** <a href="https://redirect.github.com/capricorn86/happy-dom/issues/1620">#1620</a> Release v18.0.0</li> <li>See full diff in <a href="https://github.com/capricorn86/happy-dom/compare/v18.0.1...v19.0.2">compare view</a></li> </ul> </details> <br />
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* add on-demand callback for token refresh ([#1192](https://github.com/visma-swno/vsn-assistant/issues/1192)) ([e5d6918](https://github.com/visma-swno/vsn-assistant/commit/e5d6918a9dc3eacecb2a4df77e724b9a53805a85))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* add fixed container sizes ([#1188](https://github.com/visma-swno/vsn-assistant/issues/1188)) ([b2b30c9](https://github.com/visma-swno/vsn-assistant/commit/b2b30c91da672beff532409436ab3037f53c66bc))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Build System
|
|
47
|
+
|
|
48
|
+
* **deps-dev:** bump happy-dom from 18.0.1 to 19.0.2 in /web-component ([#1158](https://github.com/visma-swno/vsn-assistant/issues/1158)) ([8eb4203](https://github.com/visma-swno/vsn-assistant/commit/8eb420315bbf0f2daae0b121570aba374c5af7a5))
|
|
49
|
+
|
|
3
50
|
## [2.1.3](https://github.com/visma-swno/vsn-assistant/compare/web-component@v2.1.2...web-component@v2.1.3) (2025-09-26)
|
|
4
51
|
|
|
5
52
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @visma-swno/gaia-chat-ui
|
|
2
2
|
|
|
3
|
-
Web component library for the
|
|
3
|
+
Web component library for the GAiA Assistant Chat UI, built with Lit for Visma Software Nordic products.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -21,13 +21,35 @@ import '@visma-swno/gaia-chat-ui';
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
|
-
<gaia-chat
|
|
25
|
-
profile-id="
|
|
26
|
-
base-url="https://
|
|
27
|
-
|
|
24
|
+
<gaia-chat
|
|
25
|
+
profile-id="YOUR_PROFILE_ID"
|
|
26
|
+
base-url="https://api.assistant.vsn.dev"
|
|
27
|
+
auth-strategy="visitor"
|
|
28
|
+
>
|
|
28
29
|
</gaia-chat>
|
|
29
30
|
```
|
|
30
31
|
|
|
32
|
+
For authenticated Visma users, switch to the Visma strategy and provide a token provider. Implement caching and refresh: reuse a valid token until shortly before its `exp` claim, then silently refresh.
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<gaia-chat
|
|
36
|
+
id="assistant"
|
|
37
|
+
profile-id="YOUR_PROFILE_ID"
|
|
38
|
+
base-url="https://api.assistant.vsn.dev"
|
|
39
|
+
auth-strategy="visma"
|
|
40
|
+
>
|
|
41
|
+
</gaia-chat>
|
|
42
|
+
<script type="module">
|
|
43
|
+
const assistant = document.getElementById('assistant');
|
|
44
|
+
|
|
45
|
+
assistant.tokenProvider = async () => {
|
|
46
|
+
const res = await fetch('/api/auth/assistant-token');
|
|
47
|
+
const { token } = await res.json();
|
|
48
|
+
return token;
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
52
|
+
|
|
31
53
|
## Documentation
|
|
32
54
|
|
|
33
55
|
For detailed documentation and development instructions, see the [main repository](https://github.com/visma-swno/vsn-assistant).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { TokenProvider } from '../auth/types';
|
|
3
|
+
import { HostContextProvider } from '../core/types/host-context';
|
|
4
|
+
import { StrategyType } from '../auth/strategy-factory';
|
|
5
|
+
import { BaseElement } from '../components/shared/base-element';
|
|
6
|
+
export declare class ChatApp extends BaseElement {
|
|
7
|
+
static styles: import('lit').CSSResult[];
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
profileId: string;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use hostContextProvider instead
|
|
12
|
+
*/
|
|
13
|
+
supportPartnerId?: string;
|
|
14
|
+
tokenProvider?: TokenProvider;
|
|
15
|
+
hostContextProvider?: HostContextProvider;
|
|
16
|
+
authStrategy: StrategyType;
|
|
17
|
+
closeable: boolean;
|
|
18
|
+
private langObserver?;
|
|
19
|
+
private store;
|
|
20
|
+
private bootstrapEffect;
|
|
21
|
+
private streamEffect;
|
|
22
|
+
private supportEffect;
|
|
23
|
+
private conversationEffect;
|
|
24
|
+
private feedbackEffect;
|
|
25
|
+
private state;
|
|
26
|
+
private isConnectedToSupport;
|
|
27
|
+
private unsubscribe?;
|
|
28
|
+
private strategyFactory;
|
|
29
|
+
private authProvider;
|
|
30
|
+
private apiClient;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
private handleAuthChanged;
|
|
34
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
35
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
'gaia-chat': ChatApp;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -3,5 +3,4 @@ export declare const getLocale: (() => string) & {
|
|
|
3
3
|
}, setLocale: ((newLocale: string) => Promise<void>) & {
|
|
4
4
|
_LIT_LOCALIZE_SET_LOCALE_?: never;
|
|
5
5
|
};
|
|
6
|
-
export declare function parseLocaleCode(locale: string): "en" | "da" | "nb" | "sv";
|
|
7
|
-
//# sourceMappingURL=localization.d.ts.map
|
|
6
|
+
export declare function parseLocaleCode(locale: string): "en" | "da" | "fi" | "nb" | "nl" | "sv";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class AuthError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
constructor(message: string, code: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class TokenExpiredError extends AuthError {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class TokenInvalidError extends AuthError {
|
|
9
|
+
constructor(reason?: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class TokenRefreshError extends AuthError {
|
|
12
|
+
readonly innerError?: unknown | undefined;
|
|
13
|
+
constructor(innerError?: unknown | undefined);
|
|
14
|
+
}
|
|
15
|
+
export declare class StrategyNotConfiguredError extends AuthError {
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthStrategy } from './strategies/base-strategy';
|
|
2
|
+
export declare class AuthProvider {
|
|
3
|
+
private strategy;
|
|
4
|
+
useStrategy(strategy: AuthStrategy): void;
|
|
5
|
+
getStrategy(): AuthStrategy;
|
|
6
|
+
getIdentifier(): string | null;
|
|
7
|
+
getAccessToken(): Promise<string | null>;
|
|
8
|
+
refresh(): Promise<void>;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TokenParser } from '../token-parser';
|
|
2
|
+
import { TokenStorage } from '../types';
|
|
3
|
+
import { TokenCache } from '../token-cache';
|
|
4
|
+
export interface AuthStrategy {
|
|
5
|
+
getName(): string;
|
|
6
|
+
getIdentifier(): string | null;
|
|
7
|
+
getAccessToken(): Promise<string | null>;
|
|
8
|
+
refresh(): Promise<void>;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class BaseAuthStrategy implements AuthStrategy {
|
|
12
|
+
protected readonly parser: TokenParser;
|
|
13
|
+
protected readonly cache: TokenCache;
|
|
14
|
+
constructor(parser: TokenParser, storage?: TokenStorage);
|
|
15
|
+
abstract getName(): string;
|
|
16
|
+
protected abstract fetchToken(): Promise<string>;
|
|
17
|
+
getIdentifier(): string | null;
|
|
18
|
+
getAccessToken(): Promise<string | null>;
|
|
19
|
+
refresh(): Promise<void>;
|
|
20
|
+
clear(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TokenParser } from '../token-parser';
|
|
2
|
+
import { TokenStorage } from '../types';
|
|
3
|
+
import { BaseAuthStrategy } from './base-strategy';
|
|
4
|
+
export declare class VisitorTokenStrategy extends BaseAuthStrategy {
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(baseUrl: string, parser: TokenParser, storage?: TokenStorage);
|
|
7
|
+
getName(): string;
|
|
8
|
+
protected fetchToken(): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TokenParser } from '../token-parser';
|
|
2
|
+
import { TokenProvider } from '../types';
|
|
3
|
+
import { BaseAuthStrategy } from './base-strategy';
|
|
4
|
+
export declare class VismaTokenStrategy extends BaseAuthStrategy {
|
|
5
|
+
private readonly tokenProvider;
|
|
6
|
+
constructor(tokenProvider: TokenProvider, parser: TokenParser);
|
|
7
|
+
getName(): string;
|
|
8
|
+
protected fetchToken(): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthStrategy } from './strategies/base-strategy';
|
|
2
|
+
import { TokenProvider, TokenStorage } from './types';
|
|
3
|
+
import { TokenParser } from './token-parser';
|
|
4
|
+
export type StrategyType = 'visma' | 'visitor';
|
|
5
|
+
export interface StrategyFactoryConfig {
|
|
6
|
+
parser?: TokenParser;
|
|
7
|
+
storage?: TokenStorage;
|
|
8
|
+
}
|
|
9
|
+
export declare class StrategyFactory {
|
|
10
|
+
private readonly config;
|
|
11
|
+
constructor(config: StrategyFactoryConfig);
|
|
12
|
+
create(type: StrategyType, tokenProvider?: TokenProvider, baseUrl?: string): AuthStrategy;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TokenParser } from './token-parser';
|
|
2
|
+
import { TokenInfo, TokenStorage } from './types';
|
|
3
|
+
export declare class TokenCache {
|
|
4
|
+
private readonly parser;
|
|
5
|
+
private readonly storage?;
|
|
6
|
+
private currentToken;
|
|
7
|
+
private refreshPromise;
|
|
8
|
+
constructor(parser: TokenParser, storage?: TokenStorage | undefined);
|
|
9
|
+
private loadFromStorage;
|
|
10
|
+
get(): TokenInfo | null;
|
|
11
|
+
set(token: string): TokenInfo;
|
|
12
|
+
clear(): void;
|
|
13
|
+
isExpired(): boolean;
|
|
14
|
+
getIdentifier(): string | null;
|
|
15
|
+
refreshWith(refreshFn: () => Promise<string>): Promise<TokenInfo | null>;
|
|
16
|
+
private performRefresh;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type TokenProvider = () => Promise<string>;
|
|
2
|
+
export interface DecodedToken {
|
|
3
|
+
exp: number;
|
|
4
|
+
sub: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface TokenInfo {
|
|
8
|
+
raw: string;
|
|
9
|
+
decoded: DecodedToken;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
subject: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TokenStorage {
|
|
14
|
+
load(): string | null;
|
|
15
|
+
save(token: string): void;
|
|
16
|
+
clear(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IConversationEffect } from '../../core/effects/conversation-effect';
|
|
2
|
+
import { ISupportEffect } from '../../core/effects/support-effect';
|
|
3
|
+
import { BaseElement } from '../shared/base-element';
|
|
4
|
+
import { AppStore } from '../../core/state';
|
|
5
|
+
export default class GaiaAppHeader extends BaseElement {
|
|
6
|
+
static styles: import('lit').CSSResult[];
|
|
7
|
+
store: AppStore;
|
|
8
|
+
conversationEffect: IConversationEffect;
|
|
9
|
+
supportEffect: ISupportEffect;
|
|
10
|
+
private disabled;
|
|
11
|
+
private isFeedbackOpen;
|
|
12
|
+
closeable: boolean;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
private unsubscribe?;
|
|
16
|
+
private handleClearConversation;
|
|
17
|
+
private handleToggleFeedback;
|
|
18
|
+
private handleCloseChat;
|
|
19
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
20
|
+
}
|
|
21
|
+
declare global {
|
|
22
|
+
interface HTMLElementTagNameMap {
|
|
23
|
+
'gaia-app-header': GaiaAppHeader;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IconName } from '../icon/icon-library';
|
|
2
|
+
import { BaseElement } from '../shared/base-element';
|
|
3
|
+
export default class GaiaAvatar extends BaseElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
private hasError;
|
|
6
|
+
label: string;
|
|
7
|
+
image: string | undefined;
|
|
8
|
+
icon: IconName;
|
|
9
|
+
bordered: boolean;
|
|
10
|
+
private handleImageLoadError;
|
|
11
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'gaia-avatar': GaiaAvatar;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseElement } from '../shared/base-element';
|
|
2
|
+
export default class GaiaButton extends BaseElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
labelSlot: HTMLSlotElement;
|
|
5
|
+
private isIconButton;
|
|
6
|
+
variant: 'primary' | 'secondary' | 'ghost' | 'transparent';
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
private handleLabelSlotChange;
|
|
10
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'gaia-button': GaiaButton;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { UiMessage } from '../../core/types';
|
|
3
|
+
import { BaseElement } from '../shared/base-element';
|
|
4
|
+
export declare class GaiaConversation extends BaseElement {
|
|
5
|
+
static styles: import('lit').CSSResult[];
|
|
6
|
+
private containerRef;
|
|
7
|
+
private scrollViewRef;
|
|
8
|
+
private lastMessageRef;
|
|
9
|
+
private scrollController;
|
|
10
|
+
private store;
|
|
11
|
+
private streamEffect;
|
|
12
|
+
private supportEffect;
|
|
13
|
+
private conversationEffect;
|
|
14
|
+
private welcomeMessage?;
|
|
15
|
+
private isThinking;
|
|
16
|
+
private isFeedbackOpen;
|
|
17
|
+
private channel;
|
|
18
|
+
private error?;
|
|
19
|
+
messages: UiMessage[];
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
private unsubscribe?;
|
|
23
|
+
private closeFeedbackIfOpen;
|
|
24
|
+
private handleApproveToolCall;
|
|
25
|
+
private handleDeclineToolCall;
|
|
26
|
+
private handleNewConversation;
|
|
27
|
+
private handleProvideSupportFeedback;
|
|
28
|
+
/**
|
|
29
|
+
* Callbacks passed to message renderers
|
|
30
|
+
*/
|
|
31
|
+
private get messageCallbacks();
|
|
32
|
+
protected updated(changedProperties: PropertyValues): Promise<void>;
|
|
33
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'gaia-conversation': GaiaConversation;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DirectiveResult } from 'lit/directive.js';
|
|
2
|
+
import { RefDirective } from 'lit/directives/ref.js';
|
|
3
|
+
import { nothing, TemplateResult } from 'lit';
|
|
4
|
+
import { AssistantMessage, OperatorMessage, SystemMessage, UiMessage, UserMessage } from '../../core/types';
|
|
5
|
+
/**
|
|
6
|
+
* Callback types for message interactions
|
|
7
|
+
*/
|
|
8
|
+
export type ToolCallHandler = (turnId: string, messageId: string) => void;
|
|
9
|
+
export interface MessageRendererCallbacks {
|
|
10
|
+
onApproveToolCall: ToolCallHandler;
|
|
11
|
+
onDeclineToolCall: ToolCallHandler;
|
|
12
|
+
onNewConversation: () => void;
|
|
13
|
+
onProvideFeedback: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders an assistant message with citations and tool call approval UI
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderAssistantMessage(message: AssistantMessage, ref: DirectiveResult<typeof RefDirective>, callbacks: MessageRendererCallbacks): TemplateResult;
|
|
19
|
+
/**
|
|
20
|
+
* Renders an operator message with typing indicator support
|
|
21
|
+
*/
|
|
22
|
+
export declare function renderOperatorMessage(message: OperatorMessage, ref: DirectiveResult<typeof RefDirective>): TemplateResult;
|
|
23
|
+
/**
|
|
24
|
+
* Renders a system message
|
|
25
|
+
*/
|
|
26
|
+
export declare function renderSystemMessage(message: SystemMessage, ref: DirectiveResult<typeof RefDirective>, callbacks: MessageRendererCallbacks): TemplateResult;
|
|
27
|
+
/**
|
|
28
|
+
* Renders a user message
|
|
29
|
+
*/
|
|
30
|
+
export declare function renderUserMessage(message: UserMessage, ref: DirectiveResult<typeof RefDirective>): TemplateResult;
|
|
31
|
+
/**
|
|
32
|
+
* Message renderer factory that dispatches to the appropriate renderer based on message role.
|
|
33
|
+
* Note: Tool messages should be filtered out before calling this function as they have no content.
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderMessage(message: UiMessage, ref: DirectiveResult<typeof RefDirective>, callbacks: MessageRendererCallbacks): TemplateResult | typeof nothing;
|
|
36
|
+
/**
|
|
37
|
+
* Filter messages to only those with content
|
|
38
|
+
*/
|
|
39
|
+
export declare function filterMessagesWithContent(messages: UiMessage[]): UiMessage[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
3
|
+
import { default as GaiaMessage } from '../message/message';
|
|
4
|
+
/**
|
|
5
|
+
* Scroll behavior types
|
|
6
|
+
*/
|
|
7
|
+
type ScrollBehavior = 'instant' | 'smooth';
|
|
8
|
+
/**
|
|
9
|
+
* Controller for managing scroll behavior in the conversation view.
|
|
10
|
+
* Handles automatic scrolling, user message anchoring, and scroll container height management.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ScrollController implements ReactiveController {
|
|
13
|
+
private host;
|
|
14
|
+
private container;
|
|
15
|
+
private scrollView;
|
|
16
|
+
private lastMessageElement;
|
|
17
|
+
constructor(host: ReactiveControllerHost, container: Ref<HTMLDivElement>, scrollView: Ref<HTMLDivElement>, lastMessageElement: Ref<GaiaMessage>);
|
|
18
|
+
hostConnected(): void;
|
|
19
|
+
hostDisconnected(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Get the role of the last message
|
|
22
|
+
*/
|
|
23
|
+
private get lastMessageRole();
|
|
24
|
+
/**
|
|
25
|
+
* Reset scroll container height to auto
|
|
26
|
+
*/
|
|
27
|
+
resetScroll(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Scroll to the bottom of the conversation
|
|
30
|
+
*/
|
|
31
|
+
scrollToBottom(behavior?: ScrollBehavior): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Anchor the last user message to the top of the viewport.
|
|
34
|
+
* This creates a smooth transition when waiting for assistant response.
|
|
35
|
+
*/
|
|
36
|
+
anchorUserMessage(behavior?: ScrollBehavior): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Handle scroll updates based on conversation state changes
|
|
39
|
+
*/
|
|
40
|
+
handleScrollUpdate(params: {
|
|
41
|
+
messageCount: number;
|
|
42
|
+
previousMessageCount: number;
|
|
43
|
+
channel: string;
|
|
44
|
+
isFeedbackOpen: boolean;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseElement } from '../shared/base-element';
|
|
2
|
+
export default class GaiaDisclaimer extends BaseElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'gaia-disclaimer': GaiaDisclaimer;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { nothing } from 'lit';
|
|
2
|
+
import { AppError } from '../../core/errors/app-error';
|
|
3
|
+
import { BaseElement } from '../shared/base-element';
|
|
4
|
+
export default class GaiaErrorNotification extends BaseElement {
|
|
5
|
+
static styles: import('lit').CSSResult[];
|
|
6
|
+
private store;
|
|
7
|
+
absolute: boolean;
|
|
8
|
+
error?: AppError;
|
|
9
|
+
private handleClearError;
|
|
10
|
+
render(): import('lit-html').TemplateResult<1> | typeof nothing;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'gaia-error-notification': GaiaErrorNotification;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseElement } from '../shared/base-element';
|
|
2
|
+
export default class GaiaFeedback extends BaseElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
private store?;
|
|
5
|
+
private feedbackEffect;
|
|
6
|
+
private ratingInput;
|
|
7
|
+
private commentInput;
|
|
8
|
+
private selectedRating;
|
|
9
|
+
private comment;
|
|
10
|
+
private target;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
private unsubscribe?;
|
|
14
|
+
private canSubmit;
|
|
15
|
+
private handleRatingChange;
|
|
16
|
+
private handleCommentChange;
|
|
17
|
+
private handleSubmit;
|
|
18
|
+
private handleReset;
|
|
19
|
+
private handleClose;
|
|
20
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'gaia-feedback': GaiaFeedback;
|
|
25
|
+
}
|
|
26
|
+
}
|