max-agent-ui 0.0.10
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/README.md +99 -0
- package/fesm2022/max-agent-ui.mjs +284 -0
- package/fesm2022/max-agent-ui.mjs.map +1 -0
- package/package.json +37 -0
- package/types/max-agent-ui.d.ts +154 -0
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Max Agent UI
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build max-agent-ui
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
## Assistant Component
|
|
30
|
+
|
|
31
|
+
This package exposes one public API: the standalone chat assistant component.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { MaxAssistantComponent } from 'max-agent-ui';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Add `MaxAssistantComponent` to the consuming component imports and render:
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<max-assistant
|
|
41
|
+
assistantApiUrl="/api"
|
|
42
|
+
assistantSourceApp="cortex"
|
|
43
|
+
assistantTargetProduct="maxtime"
|
|
44
|
+
[context]="assistantContext"
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Use mock mode while integrating without a backend:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<max-assistant [useMockAssistantApi]="true" />
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Host apps should provide Angular `HttpClient` for real API calls and include their PrimeNG theme and PrimeIcons styles.
|
|
55
|
+
|
|
56
|
+
For local integration, install the generated tarball and peer UI dependencies in the consuming app:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install C:/Users/Dev100/Documents/Maxtime/Projects/maxtime-ui-library/dist/max-agent-ui/max-agent-ui-0.0.9.tgz primeng primeicons @angular/cdk
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Publishing the Library
|
|
63
|
+
|
|
64
|
+
Build and package the library:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
ng build max-agent-ui
|
|
68
|
+
cd dist/max-agent-ui
|
|
69
|
+
npm pack
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Publish the generated tarball after logging in to npm:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm login
|
|
76
|
+
npm publish max-agent-ui-0.0.9.tgz
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Running unit tests
|
|
80
|
+
|
|
81
|
+
To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
ng test
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Running end-to-end tests
|
|
88
|
+
|
|
89
|
+
For end-to-end (e2e) testing, run:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
ng e2e
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
96
|
+
|
|
97
|
+
## Additional Resources
|
|
98
|
+
|
|
99
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import * as i6 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, Injectable, signal, DestroyRef, Input, ViewChild, Component } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import * as i1 from '@angular/forms';
|
|
7
|
+
import { FormsModule } from '@angular/forms';
|
|
8
|
+
import * as i2 from 'primeng/button';
|
|
9
|
+
import { ButtonModule } from 'primeng/button';
|
|
10
|
+
import * as i3 from 'primeng/drawer';
|
|
11
|
+
import { DrawerModule } from 'primeng/drawer';
|
|
12
|
+
import * as i4 from 'primeng/textarea';
|
|
13
|
+
import { TextareaModule } from 'primeng/textarea';
|
|
14
|
+
import * as i5 from 'primeng/tooltip';
|
|
15
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
16
|
+
import { HttpClient } from '@angular/common/http';
|
|
17
|
+
import { throwError } from 'rxjs';
|
|
18
|
+
|
|
19
|
+
const MAX_ASSISTANT_CONFIG = new InjectionToken('MAX_ASSISTANT_CONFIG', {
|
|
20
|
+
factory: () => ({})
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const DEFAULT_ASSISTANT_CHAT_URL = 'https://fhmaof3b4kaxqfbnomfstxyhw40rrcjr.lambda-url.eu-west-2.on.aws/chat';
|
|
24
|
+
const DEFAULT_APP = 'assistant';
|
|
25
|
+
class MaxAssistantService {
|
|
26
|
+
config = inject(MAX_ASSISTANT_CONFIG);
|
|
27
|
+
http = inject(HttpClient, { optional: true });
|
|
28
|
+
sendMessage(message, conversationId, config = {}) {
|
|
29
|
+
const assistantConfig = {
|
|
30
|
+
...this.config,
|
|
31
|
+
...config
|
|
32
|
+
};
|
|
33
|
+
const request = {
|
|
34
|
+
message,
|
|
35
|
+
conversationId,
|
|
36
|
+
app: this.getApp(assistantConfig),
|
|
37
|
+
user: this.getUser(assistantConfig)
|
|
38
|
+
};
|
|
39
|
+
return this.postMessage(request, assistantConfig);
|
|
40
|
+
}
|
|
41
|
+
postMessage(request, config) {
|
|
42
|
+
if (!this.http) {
|
|
43
|
+
return throwError(() => new Error('HttpClient is not available. Add provideHttpClient() to the host app.'));
|
|
44
|
+
}
|
|
45
|
+
return this.http.post(this.getChatUrl(config), request);
|
|
46
|
+
}
|
|
47
|
+
getChatUrl(config) {
|
|
48
|
+
return config.assistantApiUrl?.trim() || DEFAULT_ASSISTANT_CHAT_URL;
|
|
49
|
+
}
|
|
50
|
+
getApp(config) {
|
|
51
|
+
return config.app || DEFAULT_APP;
|
|
52
|
+
}
|
|
53
|
+
getUser(config) {
|
|
54
|
+
if (typeof config.user === 'function') {
|
|
55
|
+
return config.user();
|
|
56
|
+
}
|
|
57
|
+
return config.user ?? {};
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MaxAssistantService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
60
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MaxAssistantService, providedIn: 'root' });
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MaxAssistantService, decorators: [{
|
|
63
|
+
type: Injectable,
|
|
64
|
+
args: [{
|
|
65
|
+
providedIn: 'root'
|
|
66
|
+
}]
|
|
67
|
+
}] });
|
|
68
|
+
|
|
69
|
+
const ASSISTANT_UI_COPY = {
|
|
70
|
+
title: 'Max',
|
|
71
|
+
subtitle: 'Maxtime Virtual Assistant',
|
|
72
|
+
launcherLabel: 'Open Maxtime virtual assistant',
|
|
73
|
+
openTooltip: 'Open Maxtime virtual assistant',
|
|
74
|
+
closeLabel: 'Close Maxtime virtual assistant',
|
|
75
|
+
placeholder: 'Ask Maxtime virtual assistant',
|
|
76
|
+
typingLabel: 'Maxtime virtual assistant is typing',
|
|
77
|
+
errorMessage: 'Maxtime virtual assistant could not be reached. Please try again.'
|
|
78
|
+
};
|
|
79
|
+
const DEFAULT_ASSISTANT_BOOTSTRAP = {
|
|
80
|
+
initialMessage: undefined,
|
|
81
|
+
initialSuggestions: []
|
|
82
|
+
};
|
|
83
|
+
class MaxAssistantComponent {
|
|
84
|
+
messagesViewport;
|
|
85
|
+
app;
|
|
86
|
+
user = {};
|
|
87
|
+
initialConfig = {};
|
|
88
|
+
panelVisible = signal(false, ...(ngDevMode ? [{ debugName: "panelVisible" }] : /* istanbul ignore next */ []));
|
|
89
|
+
isSending = signal(false, ...(ngDevMode ? [{ debugName: "isSending" }] : /* istanbul ignore next */ []));
|
|
90
|
+
input = signal('', ...(ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []));
|
|
91
|
+
conversationId = signal(undefined, ...(ngDevMode ? [{ debugName: "conversationId" }] : /* istanbul ignore next */ []));
|
|
92
|
+
messages = signal([], ...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
93
|
+
expandedInferenceMessageIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedInferenceMessageIds" }] : /* istanbul ignore next */ []));
|
|
94
|
+
assistantService = inject(MaxAssistantService);
|
|
95
|
+
destroyRef = inject(DestroyRef);
|
|
96
|
+
openPanel() {
|
|
97
|
+
this.panelVisible.set(true);
|
|
98
|
+
if (!this.messages().length && this.bootstrapConfig.initialMessage) {
|
|
99
|
+
this.messages.set([
|
|
100
|
+
this.createMessage('assistant', this.bootstrapConfig.initialMessage, this.bootstrapConfig.initialSuggestions)
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
this.scrollToLatest();
|
|
104
|
+
}
|
|
105
|
+
get uiCopy() {
|
|
106
|
+
return ASSISTANT_UI_COPY;
|
|
107
|
+
}
|
|
108
|
+
get bootstrapConfig() {
|
|
109
|
+
return {
|
|
110
|
+
...DEFAULT_ASSISTANT_BOOTSTRAP,
|
|
111
|
+
initialMessage: this.initialConfig.initialMessage,
|
|
112
|
+
initialSuggestions: this.initialConfig.initialSuggestions ?? []
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
closePanel() {
|
|
116
|
+
this.panelVisible.set(false);
|
|
117
|
+
}
|
|
118
|
+
sendMessage(message = this.input()) {
|
|
119
|
+
const trimmedMessage = message.trim();
|
|
120
|
+
if (!trimmedMessage || this.isSending()) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.input.set('');
|
|
124
|
+
this.appendMessage(this.createMessage('user', trimmedMessage));
|
|
125
|
+
this.isSending.set(true);
|
|
126
|
+
this.assistantService
|
|
127
|
+
.sendMessage(trimmedMessage, this.conversationId(), this.getAssistantConfig())
|
|
128
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
129
|
+
.subscribe({
|
|
130
|
+
next: response => {
|
|
131
|
+
this.conversationId.set(response.conversationId);
|
|
132
|
+
this.appendMessage(this.createAssistantResponseMessage(response, trimmedMessage));
|
|
133
|
+
this.isSending.set(false);
|
|
134
|
+
},
|
|
135
|
+
error: () => {
|
|
136
|
+
this.appendMessage({
|
|
137
|
+
...this.createMessage('assistant', this.uiCopy.errorMessage),
|
|
138
|
+
isError: true
|
|
139
|
+
});
|
|
140
|
+
this.isSending.set(false);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
useSuggestion(suggestion) {
|
|
145
|
+
this.sendMessage(suggestion);
|
|
146
|
+
}
|
|
147
|
+
onComposerKeydown(event) {
|
|
148
|
+
if (event.key === 'Enter' && !event.shiftKey) {
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
this.sendMessage();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
isInferenceDetailsVisible(messageId) {
|
|
154
|
+
return this.expandedInferenceMessageIds().has(messageId);
|
|
155
|
+
}
|
|
156
|
+
toggleInferenceDetails(messageId) {
|
|
157
|
+
const willOpen = !this.isInferenceDetailsVisible(messageId);
|
|
158
|
+
this.expandedInferenceMessageIds.update(expandedIds => {
|
|
159
|
+
const nextExpandedIds = new Set(expandedIds);
|
|
160
|
+
if (nextExpandedIds.has(messageId)) {
|
|
161
|
+
nextExpandedIds.delete(messageId);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
nextExpandedIds.add(messageId);
|
|
165
|
+
}
|
|
166
|
+
return nextExpandedIds;
|
|
167
|
+
});
|
|
168
|
+
if (willOpen) {
|
|
169
|
+
this.scrollToLatest();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
getAssistantConfig() {
|
|
173
|
+
return {
|
|
174
|
+
app: this.app,
|
|
175
|
+
user: this.user
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
appendMessage(message) {
|
|
179
|
+
this.messages.update(messages => [...messages, message]);
|
|
180
|
+
this.scrollToLatest();
|
|
181
|
+
}
|
|
182
|
+
createAssistantResponseMessage(response, userQuery) {
|
|
183
|
+
const displayResponse = this.createDisplayResponse(response, userQuery);
|
|
184
|
+
return this.createMessage('assistant', displayResponse.agentInferredResponse || response.answer, response.suggestions, response.sources, response.intent, response.intentLabel, response.app, response.productLabel, response.apiModule, response.confidence, response.parameters ?? response.entities, response.apiCalls, response.mockResult, response.llmUsed, response.availableModules, displayResponse);
|
|
185
|
+
}
|
|
186
|
+
createMessage(role, content, suggestions = [], sources = [], intent, intentLabel, app, productLabel, apiModule, confidence, parameters, apiCalls, mockResult, llmUsed, availableModules, displayResponse) {
|
|
187
|
+
return {
|
|
188
|
+
id: this.createId(),
|
|
189
|
+
role,
|
|
190
|
+
content,
|
|
191
|
+
displayResponse,
|
|
192
|
+
formattedParameters: this.formatJson(displayResponse?.agentExtractedIntent?.parameters),
|
|
193
|
+
formattedApiBody: this.formatJson(displayResponse?.agentExtractedIntent?.api?.body),
|
|
194
|
+
formattedApiResponse: this.formatJson(displayResponse?.apiResponse),
|
|
195
|
+
suggestions,
|
|
196
|
+
sources,
|
|
197
|
+
intent,
|
|
198
|
+
intentLabel,
|
|
199
|
+
app,
|
|
200
|
+
productLabel,
|
|
201
|
+
apiModule,
|
|
202
|
+
confidence,
|
|
203
|
+
parameters,
|
|
204
|
+
entities: parameters,
|
|
205
|
+
apiCalls,
|
|
206
|
+
mockResult,
|
|
207
|
+
llmUsed,
|
|
208
|
+
availableModules,
|
|
209
|
+
createdAt: new Date()
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
createDisplayResponse(response, userQuery) {
|
|
213
|
+
const provided = response.displayResponse ?? {};
|
|
214
|
+
const extractedIntent = this.createExtractedIntent(response, provided.agentExtractedIntent);
|
|
215
|
+
return {
|
|
216
|
+
userQuery: provided.userQuery || userQuery,
|
|
217
|
+
agentInferredResponse: provided.agentInferredResponse || response.answer,
|
|
218
|
+
agentExtractedIntent: extractedIntent,
|
|
219
|
+
apiResponse: provided.apiResponse ?? this.getApiResponseFallback(response),
|
|
220
|
+
markdown: provided.markdown
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
createExtractedIntent(response, provided) {
|
|
224
|
+
return {
|
|
225
|
+
project: provided?.project ?? response.productLabel ?? response.app,
|
|
226
|
+
projectKey: provided?.projectKey ?? response.app,
|
|
227
|
+
module: provided?.module ?? response.apiModule,
|
|
228
|
+
intent: provided?.intent ?? response.intent,
|
|
229
|
+
intentLabel: provided?.intentLabel ?? response.intentLabel,
|
|
230
|
+
confidence: provided?.confidence ?? response.confidence,
|
|
231
|
+
parameters: provided?.parameters ?? response.parameters ?? response.entities,
|
|
232
|
+
api: provided?.api ?? response.apiCalls?.[0]
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
getApiResponseFallback(response) {
|
|
236
|
+
if (!response.mockResult || !Object.keys(response.mockResult).length) {
|
|
237
|
+
return undefined;
|
|
238
|
+
}
|
|
239
|
+
return response.mockResult;
|
|
240
|
+
}
|
|
241
|
+
formatJson(value) {
|
|
242
|
+
if (value === undefined) {
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
return JSON.stringify(value, null, 2);
|
|
246
|
+
}
|
|
247
|
+
createId() {
|
|
248
|
+
return globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`;
|
|
249
|
+
}
|
|
250
|
+
scrollToLatest() {
|
|
251
|
+
setTimeout(() => {
|
|
252
|
+
const element = this.messagesViewport?.nativeElement;
|
|
253
|
+
if (element) {
|
|
254
|
+
element.scrollTop = element.scrollHeight;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MaxAssistantComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
259
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MaxAssistantComponent, isStandalone: true, selector: "max-assistant", inputs: { app: "app", user: "user", initialConfig: "initialConfig" }, viewQueries: [{ propertyName: "messagesViewport", first: true, predicate: ["messagesViewport"], descendants: true }], ngImport: i0, template: "<button\n pButton\n type=\"button\"\n class=\"assistant-launcher\"\n [attr.aria-label]=\"uiCopy.launcherLabel\"\n [pTooltip]=\"uiCopy.openTooltip\"\n tooltipPosition=\"left\"\n (click)=\"openPanel()\"\n>\n <span class=\"mascot\" aria-hidden=\"true\"></span>\n</button>\n\n<p-drawer\n [visible]=\"panelVisible()\"\n (visibleChange)=\"panelVisible.set($event)\"\n position=\"right\"\n styleClass=\"assistant-drawer\"\n [modal]=\"false\"\n [blockScroll]=\"false\"\n [showCloseIcon]=\"false\"\n>\n <section class=\"assistant-panel\" [attr.aria-label]=\"uiCopy.title\">\n <header class=\"assistant-header\">\n <span class=\"mascot large\" aria-hidden=\"true\"></span>\n <div>\n <h2>{{ uiCopy.title }}</h2>\n <span>{{ uiCopy.subtitle }}</span>\n </div>\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-times\"\n text\n rounded\n severity=\"secondary\"\n [attr.aria-label]=\"uiCopy.closeLabel\"\n (click)=\"closePanel()\"\n ></button>\n </header>\n\n <div #messagesViewport class=\"assistant-messages\">\n @for(message of messages(); track message.id) {\n <article class=\"message {{ message.role }}\" [class.error]=\"message.isError\">\n @if(message.displayResponse; as responseDetails) {\n <p class=\"assistant-result\">{{ responseDetails.agentInferredResponse || message.content }}</p>\n <button\n type=\"button\"\n class=\"inference-toggle\"\n [attr.aria-expanded]=\"isInferenceDetailsVisible(message.id)\"\n (click)=\"toggleInferenceDetails(message.id)\"\n >\n {{ isInferenceDetailsVisible(message.id) ? 'Hide Details' : 'Show Details' }}\n </button>\n\n @if(isInferenceDetailsVisible(message.id)) {\n <div class=\"response-details\">\n @if(responseDetails.userQuery) {\n <section class=\"response-section\">\n <h3>User Query</h3>\n <p class=\"quoted\">\"{{ responseDetails.userQuery }}\"</p>\n </section>\n }\n\n @if(responseDetails.agentExtractedIntent; as intent) {\n <section class=\"response-section\">\n <h3>Agent Extracted Intent</h3>\n <dl class=\"detail-grid\">\n @if(intent.project || intent.projectKey) {\n <div>\n <dt>Project</dt>\n <dd>\n {{ intent.project || intent.projectKey }}\n @if(intent.projectKey) {\n <span>{{ intent.projectKey }}</span>\n }\n </dd>\n </div>\n }\n @if(intent.module) {\n <div>\n <dt>Module</dt>\n <dd>{{ intent.module }}</dd>\n </div>\n }\n @if(intent.intentLabel) {\n <div>\n <dt>Intent Label</dt>\n <dd>{{ intent.intentLabel }}</dd>\n </div>\n }\n @if(intent.intent) {\n <div>\n <dt>Intent</dt>\n <dd>{{ intent.intent }}</dd>\n </div>\n }\n @if(intent.confidence !== undefined) {\n <div>\n <dt>Confidence</dt>\n <dd>{{ intent.confidence | percent: '1.0-0' }}</dd>\n </div>\n }\n </dl>\n\n @if(message.formattedParameters) {\n <div class=\"json-block\">\n <strong>Parameters</strong>\n <pre>{{ message.formattedParameters }}</pre>\n </div>\n }\n\n @if(intent.api?.url || intent.api?.method) {\n <div class=\"api-call-summary\">\n <strong>API Called</strong>\n <code>{{ intent.api?.method || 'GET' }} {{ intent.api?.url || 'URL not provided' }}</code>\n </div>\n }\n\n @if(message.formattedApiBody) {\n <div class=\"json-block\">\n <strong>API Body</strong>\n <pre>{{ message.formattedApiBody }}</pre>\n </div>\n }\n </section>\n }\n\n @if(message.formattedApiResponse) {\n <section class=\"response-section\">\n <h3>API Response</h3>\n <div class=\"json-block\">\n <strong>JSON</strong>\n <pre>{{ message.formattedApiResponse }}</pre>\n </div>\n </section>\n }\n </div>\n }\n } @else {\n <p>{{ message.content }}</p>\n }\n @if(message.role === 'assistant' && message.suggestions?.length) {\n <div class=\"suggestions\">\n @for(suggestion of message.suggestions ?? []; track suggestion) {\n <button\n pButton\n type=\"button\"\n size=\"small\"\n text\n severity=\"secondary\"\n class=\"suggestion-chip\"\n [label]=\"suggestion\"\n (click)=\"useSuggestion(suggestion)\"\n ></button>\n }\n </div>\n }\n </article>\n }\n @if(isSending()) {\n <article class=\"message assistant typing\" [attr.aria-label]=\"uiCopy.typingLabel\">\n <span></span>\n <span></span>\n <span></span>\n </article>\n }\n </div>\n\n <form class=\"assistant-composer\" (ngSubmit)=\"sendMessage()\">\n <textarea\n pTextarea\n name=\"assistantPrompt\"\n rows=\"2\"\n [placeholder]=\"uiCopy.placeholder\"\n [ngModel]=\"input()\"\n (ngModelChange)=\"input.set($event)\"\n (keydown)=\"onComposerKeydown($event)\"\n >\n </textarea>\n <button\n pButton\n type=\"submit\"\n icon=\"pi pi-send\"\n aria-label=\"Send message\"\n [disabled]=\"!input().trim() || isSending()\"\n ></button>\n </form>\n </section>\n</p-drawer>\n", styles: [":host{position:fixed;right:24px;bottom:24px;z-index:1100}.assistant-launcher{width:70px!important;height:56px!important;min-height:60px!important;padding:0 5px;border:0!important;border-radius:18px!important;color:inherit!important;background:#d7edff!important;box-shadow:0 0 0 1px #0078c824,0 10px 24px #0f172a24!important;overflow:visible}.assistant-launcher:hover,.assistant-launcher:focus-visible{background:#fff!important;box-shadow:0 0 0 2px #0078c838,0 12px 28px #0f172a29!important}.mascot{position:relative;display:grid;place-items:center;width:64px;height:56px;background:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"96\" viewBox=\"14 10 92 82\" role=\"img\" aria-label=\"Max smiling cloud AI mascot\">%0A <defs>%0A <filter id=\"softShadow\" x=\"-15%\" y=\"-15%\" width=\"130%\" height=\"140%\">%0A <feDropShadow dx=\"0\" dy=\"5\" stdDeviation=\"5\" flood-color=\"%230078C8\" flood-opacity=\"0.16\"/>%0A </filter>%0A </defs>%0A%0A <g fill=\"%230078C8\" opacity=\"0.28\">%0A <circle cx=\"34\" cy=\"57\" r=\"24\"/>%0A <circle cx=\"58\" cy=\"39\" r=\"31\"/>%0A <circle cx=\"86\" cy=\"58\" r=\"25\"/>%0A <rect x=\"28\" y=\"55\" width=\"68\" height=\"27\" rx=\"13.5\"/>%0A </g>%0A%0A <g fill=\"%230078C8\" opacity=\"0.68\" filter=\"url(%23softShadow)\">%0A <circle cx=\"35\" cy=\"59\" r=\"20\"/>%0A <circle cx=\"59\" cy=\"43\" r=\"27\"/>%0A <circle cx=\"84\" cy=\"60\" r=\"21\"/>%0A <rect x=\"31\" y=\"57\" width=\"64\" height=\"24\" rx=\"12\"/>%0A </g>%0A%0A <g fill=\"%23FFD54A\">%0A <path d=\"M46 48l3.4 6.8 6.8 3.4-6.8 3.4L46 68.4l-3.4-6.8-6.8-3.4 6.8-3.4z\"/>%0A <path d=\"M74 48l3.4 6.8 6.8 3.4-6.8 3.4-3.4 6.8-3.4-6.8-6.8-3.4 6.8-3.4z\"/>%0A <path d=\"M88 28l2 4 4 2-4 2-2 4-2-4-4-2 4-2z\"/>%0A </g>%0A%0A <path%0A d=\"M49 72c6 7 20 7 26 0\"%0A fill=\"none\"%0A stroke=\"%23FFD54A\"%0A stroke-width=\"4\"%0A stroke-linecap=\"round\"%0A />%0A</svg>%0A') center/contain no-repeat}.mascot.large{width:58px;height:46px}::ng-deep .assistant-drawer{width:min(560px,100vw)!important}::ng-deep .assistant-drawer .p-drawer-content{padding:0}::ng-deep .assistant-drawer .p-drawer-header{display:none}.assistant-panel{display:grid;grid-template-rows:auto 1fr auto;height:100%;min-height:0;background:var(--background-color, #f8fafc)}.assistant-header,.assistant-composer{display:flex;gap:12px;align-items:center;padding:16px;background:#fff;border-bottom:1px solid var(--border-color, #e2e8f0)}.assistant-header h2{margin:0;font-size:20px}.assistant-header span,.sources span{color:#64748b;font-size:12px;font-weight:700}.assistant-header button{margin-left:auto}.assistant-messages{min-height:0;overflow:auto;padding:18px}.message{width:fit-content;max-width:92%;margin-bottom:14px;padding:12px;border:1px solid var(--border-color, #e2e8f0);border-radius:var(--medium-border-radius, 8px);background:#fff;box-shadow:0 6px 18px #0f172a0f}.message.assistant{width:100%;max-width:100%}.message.user{width:fit-content;max-width:88%;margin-left:auto;color:#fff;background:var(--primary-color, #2563eb);border-color:var(--primary-color, #2563eb)}.message.error{border-color:var(--danger-color, #dc2626)}.message p{margin:0;line-height:1.45}.assistant-result{color:#1e293b}.inference-toggle{display:flex;width:fit-content;margin:10px 0 0 auto;padding:0;border:0;color:var(--primary-color, #2563eb);background:transparent;font:inherit;font-size:13px;font-weight:400;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.inference-toggle:hover{color:var(--primary-dark-color, #1d4ed8)}.inference-toggle:focus-visible{outline:2px solid var(--primary-color, #2563eb);outline-offset:3px}.suggestions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.suggestion-chip{border:1px solid rgba(var(--primary-color-rgb, 37, 99, 235),.28);color:var(--primary-dark-color, #1d4ed8);background:rgba(var(--primary-color-rgb, 37, 99, 235),.08);font-weight:700;box-shadow:0 4px 14px #0f172a0f;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.suggestion-chip:hover{border-color:rgba(var(--primary-color-rgb, 37, 99, 235),.42);color:var(--primary-dark-color, #1d4ed8);background:rgba(var(--primary-color-rgb, 37, 99, 235),.14)}.response-details{display:grid;gap:12px;margin-top:12px}.response-section{display:grid;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--border-color, #e2e8f0)}.response-section:last-child{padding-bottom:0;border-bottom:0}.response-section h3{margin:0;color:#0f172a;font-size:13px;font-weight:800}.quoted{padding:8px 10px;border-left:5px solid var(--primary-color, #2563eb);border-radius:var(--border-radius, 6px);color:#1e293b;background:#f8fafc}.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.detail-grid div{min-width:0;padding:8px;border-radius:var(--border-radius, 6px);background:#f8fafc}.detail-grid dt{margin-bottom:3px;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase}.detail-grid dd{margin:0;color:#334155;font-size:13px;font-weight:700;line-height:1.35;overflow-wrap:anywhere}.detail-grid dd span{display:block;margin-top:2px;color:#64748b;font-size:11px}.api-call-summary,.json-block{display:grid;gap:6px;padding:8px;border-radius:var(--border-radius, 6px);background:#f8fafc}.api-call-summary strong,.json-block strong{color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase}.api-call-summary code{color:var(--secondary-color, #0f172a);font-weight:800;white-space:normal;word-break:break-word}.json-block pre{max-height:220px;margin:0;overflow:auto;color:#0f172a;font-size:12px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.typing{display:flex;width:fit-content;max-width:fit-content;gap:5px;align-items:center;padding:4px 0;border:0;background:transparent;box-shadow:none}.typing span{width:7px;height:7px;border-radius:50%;background:var(--primary-color, #2563eb);animation:typing-dot .85s infinite ease-in-out}.typing span:nth-child(2){animation-delay:.15s}.assistant-composer{border-top:1px solid var(--border-color, #e2e8f0);border-bottom:0}.assistant-composer textarea{flex:1;min-height:46px;max-height:120px;resize:vertical}@keyframes typing-dot{0%,80%,to{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}@keyframes pulse{to{opacity:.35;transform:translateY(-2px)}}@media(max-width:640px){:host{right:16px;bottom:16px}.assistant-launcher{width:62px!important;min-width:62px!important;height:54px!important;min-height:54px!important}.assistant-messages{padding:14px}.detail-grid{grid-template-columns:1fr}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i3.Drawer, selector: "p-drawer", inputs: ["appendTo", "motionOptions", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i4.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["pTextareaPT", "pTextareaUnstyled", "autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: i6.PercentPipe, name: "percent" }] });
|
|
260
|
+
}
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MaxAssistantComponent, decorators: [{
|
|
262
|
+
type: Component,
|
|
263
|
+
args: [{ selector: 'max-assistant', imports: [CommonModule, FormsModule, ButtonModule, DrawerModule, TextareaModule, TooltipModule], template: "<button\n pButton\n type=\"button\"\n class=\"assistant-launcher\"\n [attr.aria-label]=\"uiCopy.launcherLabel\"\n [pTooltip]=\"uiCopy.openTooltip\"\n tooltipPosition=\"left\"\n (click)=\"openPanel()\"\n>\n <span class=\"mascot\" aria-hidden=\"true\"></span>\n</button>\n\n<p-drawer\n [visible]=\"panelVisible()\"\n (visibleChange)=\"panelVisible.set($event)\"\n position=\"right\"\n styleClass=\"assistant-drawer\"\n [modal]=\"false\"\n [blockScroll]=\"false\"\n [showCloseIcon]=\"false\"\n>\n <section class=\"assistant-panel\" [attr.aria-label]=\"uiCopy.title\">\n <header class=\"assistant-header\">\n <span class=\"mascot large\" aria-hidden=\"true\"></span>\n <div>\n <h2>{{ uiCopy.title }}</h2>\n <span>{{ uiCopy.subtitle }}</span>\n </div>\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-times\"\n text\n rounded\n severity=\"secondary\"\n [attr.aria-label]=\"uiCopy.closeLabel\"\n (click)=\"closePanel()\"\n ></button>\n </header>\n\n <div #messagesViewport class=\"assistant-messages\">\n @for(message of messages(); track message.id) {\n <article class=\"message {{ message.role }}\" [class.error]=\"message.isError\">\n @if(message.displayResponse; as responseDetails) {\n <p class=\"assistant-result\">{{ responseDetails.agentInferredResponse || message.content }}</p>\n <button\n type=\"button\"\n class=\"inference-toggle\"\n [attr.aria-expanded]=\"isInferenceDetailsVisible(message.id)\"\n (click)=\"toggleInferenceDetails(message.id)\"\n >\n {{ isInferenceDetailsVisible(message.id) ? 'Hide Details' : 'Show Details' }}\n </button>\n\n @if(isInferenceDetailsVisible(message.id)) {\n <div class=\"response-details\">\n @if(responseDetails.userQuery) {\n <section class=\"response-section\">\n <h3>User Query</h3>\n <p class=\"quoted\">\"{{ responseDetails.userQuery }}\"</p>\n </section>\n }\n\n @if(responseDetails.agentExtractedIntent; as intent) {\n <section class=\"response-section\">\n <h3>Agent Extracted Intent</h3>\n <dl class=\"detail-grid\">\n @if(intent.project || intent.projectKey) {\n <div>\n <dt>Project</dt>\n <dd>\n {{ intent.project || intent.projectKey }}\n @if(intent.projectKey) {\n <span>{{ intent.projectKey }}</span>\n }\n </dd>\n </div>\n }\n @if(intent.module) {\n <div>\n <dt>Module</dt>\n <dd>{{ intent.module }}</dd>\n </div>\n }\n @if(intent.intentLabel) {\n <div>\n <dt>Intent Label</dt>\n <dd>{{ intent.intentLabel }}</dd>\n </div>\n }\n @if(intent.intent) {\n <div>\n <dt>Intent</dt>\n <dd>{{ intent.intent }}</dd>\n </div>\n }\n @if(intent.confidence !== undefined) {\n <div>\n <dt>Confidence</dt>\n <dd>{{ intent.confidence | percent: '1.0-0' }}</dd>\n </div>\n }\n </dl>\n\n @if(message.formattedParameters) {\n <div class=\"json-block\">\n <strong>Parameters</strong>\n <pre>{{ message.formattedParameters }}</pre>\n </div>\n }\n\n @if(intent.api?.url || intent.api?.method) {\n <div class=\"api-call-summary\">\n <strong>API Called</strong>\n <code>{{ intent.api?.method || 'GET' }} {{ intent.api?.url || 'URL not provided' }}</code>\n </div>\n }\n\n @if(message.formattedApiBody) {\n <div class=\"json-block\">\n <strong>API Body</strong>\n <pre>{{ message.formattedApiBody }}</pre>\n </div>\n }\n </section>\n }\n\n @if(message.formattedApiResponse) {\n <section class=\"response-section\">\n <h3>API Response</h3>\n <div class=\"json-block\">\n <strong>JSON</strong>\n <pre>{{ message.formattedApiResponse }}</pre>\n </div>\n </section>\n }\n </div>\n }\n } @else {\n <p>{{ message.content }}</p>\n }\n @if(message.role === 'assistant' && message.suggestions?.length) {\n <div class=\"suggestions\">\n @for(suggestion of message.suggestions ?? []; track suggestion) {\n <button\n pButton\n type=\"button\"\n size=\"small\"\n text\n severity=\"secondary\"\n class=\"suggestion-chip\"\n [label]=\"suggestion\"\n (click)=\"useSuggestion(suggestion)\"\n ></button>\n }\n </div>\n }\n </article>\n }\n @if(isSending()) {\n <article class=\"message assistant typing\" [attr.aria-label]=\"uiCopy.typingLabel\">\n <span></span>\n <span></span>\n <span></span>\n </article>\n }\n </div>\n\n <form class=\"assistant-composer\" (ngSubmit)=\"sendMessage()\">\n <textarea\n pTextarea\n name=\"assistantPrompt\"\n rows=\"2\"\n [placeholder]=\"uiCopy.placeholder\"\n [ngModel]=\"input()\"\n (ngModelChange)=\"input.set($event)\"\n (keydown)=\"onComposerKeydown($event)\"\n >\n </textarea>\n <button\n pButton\n type=\"submit\"\n icon=\"pi pi-send\"\n aria-label=\"Send message\"\n [disabled]=\"!input().trim() || isSending()\"\n ></button>\n </form>\n </section>\n</p-drawer>\n", styles: [":host{position:fixed;right:24px;bottom:24px;z-index:1100}.assistant-launcher{width:70px!important;height:56px!important;min-height:60px!important;padding:0 5px;border:0!important;border-radius:18px!important;color:inherit!important;background:#d7edff!important;box-shadow:0 0 0 1px #0078c824,0 10px 24px #0f172a24!important;overflow:visible}.assistant-launcher:hover,.assistant-launcher:focus-visible{background:#fff!important;box-shadow:0 0 0 2px #0078c838,0 12px 28px #0f172a29!important}.mascot{position:relative;display:grid;place-items:center;width:64px;height:56px;background:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"96\" viewBox=\"14 10 92 82\" role=\"img\" aria-label=\"Max smiling cloud AI mascot\">%0A <defs>%0A <filter id=\"softShadow\" x=\"-15%\" y=\"-15%\" width=\"130%\" height=\"140%\">%0A <feDropShadow dx=\"0\" dy=\"5\" stdDeviation=\"5\" flood-color=\"%230078C8\" flood-opacity=\"0.16\"/>%0A </filter>%0A </defs>%0A%0A <g fill=\"%230078C8\" opacity=\"0.28\">%0A <circle cx=\"34\" cy=\"57\" r=\"24\"/>%0A <circle cx=\"58\" cy=\"39\" r=\"31\"/>%0A <circle cx=\"86\" cy=\"58\" r=\"25\"/>%0A <rect x=\"28\" y=\"55\" width=\"68\" height=\"27\" rx=\"13.5\"/>%0A </g>%0A%0A <g fill=\"%230078C8\" opacity=\"0.68\" filter=\"url(%23softShadow)\">%0A <circle cx=\"35\" cy=\"59\" r=\"20\"/>%0A <circle cx=\"59\" cy=\"43\" r=\"27\"/>%0A <circle cx=\"84\" cy=\"60\" r=\"21\"/>%0A <rect x=\"31\" y=\"57\" width=\"64\" height=\"24\" rx=\"12\"/>%0A </g>%0A%0A <g fill=\"%23FFD54A\">%0A <path d=\"M46 48l3.4 6.8 6.8 3.4-6.8 3.4L46 68.4l-3.4-6.8-6.8-3.4 6.8-3.4z\"/>%0A <path d=\"M74 48l3.4 6.8 6.8 3.4-6.8 3.4-3.4 6.8-3.4-6.8-6.8-3.4 6.8-3.4z\"/>%0A <path d=\"M88 28l2 4 4 2-4 2-2 4-2-4-4-2 4-2z\"/>%0A </g>%0A%0A <path%0A d=\"M49 72c6 7 20 7 26 0\"%0A fill=\"none\"%0A stroke=\"%23FFD54A\"%0A stroke-width=\"4\"%0A stroke-linecap=\"round\"%0A />%0A</svg>%0A') center/contain no-repeat}.mascot.large{width:58px;height:46px}::ng-deep .assistant-drawer{width:min(560px,100vw)!important}::ng-deep .assistant-drawer .p-drawer-content{padding:0}::ng-deep .assistant-drawer .p-drawer-header{display:none}.assistant-panel{display:grid;grid-template-rows:auto 1fr auto;height:100%;min-height:0;background:var(--background-color, #f8fafc)}.assistant-header,.assistant-composer{display:flex;gap:12px;align-items:center;padding:16px;background:#fff;border-bottom:1px solid var(--border-color, #e2e8f0)}.assistant-header h2{margin:0;font-size:20px}.assistant-header span,.sources span{color:#64748b;font-size:12px;font-weight:700}.assistant-header button{margin-left:auto}.assistant-messages{min-height:0;overflow:auto;padding:18px}.message{width:fit-content;max-width:92%;margin-bottom:14px;padding:12px;border:1px solid var(--border-color, #e2e8f0);border-radius:var(--medium-border-radius, 8px);background:#fff;box-shadow:0 6px 18px #0f172a0f}.message.assistant{width:100%;max-width:100%}.message.user{width:fit-content;max-width:88%;margin-left:auto;color:#fff;background:var(--primary-color, #2563eb);border-color:var(--primary-color, #2563eb)}.message.error{border-color:var(--danger-color, #dc2626)}.message p{margin:0;line-height:1.45}.assistant-result{color:#1e293b}.inference-toggle{display:flex;width:fit-content;margin:10px 0 0 auto;padding:0;border:0;color:var(--primary-color, #2563eb);background:transparent;font:inherit;font-size:13px;font-weight:400;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.inference-toggle:hover{color:var(--primary-dark-color, #1d4ed8)}.inference-toggle:focus-visible{outline:2px solid var(--primary-color, #2563eb);outline-offset:3px}.suggestions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.suggestion-chip{border:1px solid rgba(var(--primary-color-rgb, 37, 99, 235),.28);color:var(--primary-dark-color, #1d4ed8);background:rgba(var(--primary-color-rgb, 37, 99, 235),.08);font-weight:700;box-shadow:0 4px 14px #0f172a0f;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.suggestion-chip:hover{border-color:rgba(var(--primary-color-rgb, 37, 99, 235),.42);color:var(--primary-dark-color, #1d4ed8);background:rgba(var(--primary-color-rgb, 37, 99, 235),.14)}.response-details{display:grid;gap:12px;margin-top:12px}.response-section{display:grid;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--border-color, #e2e8f0)}.response-section:last-child{padding-bottom:0;border-bottom:0}.response-section h3{margin:0;color:#0f172a;font-size:13px;font-weight:800}.quoted{padding:8px 10px;border-left:5px solid var(--primary-color, #2563eb);border-radius:var(--border-radius, 6px);color:#1e293b;background:#f8fafc}.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.detail-grid div{min-width:0;padding:8px;border-radius:var(--border-radius, 6px);background:#f8fafc}.detail-grid dt{margin-bottom:3px;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase}.detail-grid dd{margin:0;color:#334155;font-size:13px;font-weight:700;line-height:1.35;overflow-wrap:anywhere}.detail-grid dd span{display:block;margin-top:2px;color:#64748b;font-size:11px}.api-call-summary,.json-block{display:grid;gap:6px;padding:8px;border-radius:var(--border-radius, 6px);background:#f8fafc}.api-call-summary strong,.json-block strong{color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase}.api-call-summary code{color:var(--secondary-color, #0f172a);font-weight:800;white-space:normal;word-break:break-word}.json-block pre{max-height:220px;margin:0;overflow:auto;color:#0f172a;font-size:12px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.typing{display:flex;width:fit-content;max-width:fit-content;gap:5px;align-items:center;padding:4px 0;border:0;background:transparent;box-shadow:none}.typing span{width:7px;height:7px;border-radius:50%;background:var(--primary-color, #2563eb);animation:typing-dot .85s infinite ease-in-out}.typing span:nth-child(2){animation-delay:.15s}.assistant-composer{border-top:1px solid var(--border-color, #e2e8f0);border-bottom:0}.assistant-composer textarea{flex:1;min-height:46px;max-height:120px;resize:vertical}@keyframes typing-dot{0%,80%,to{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}@keyframes pulse{to{opacity:.35;transform:translateY(-2px)}}@media(max-width:640px){:host{right:16px;bottom:16px}.assistant-launcher{width:62px!important;min-width:62px!important;height:54px!important;min-height:54px!important}.assistant-messages{padding:14px}.detail-grid{grid-template-columns:1fr}}\n"] }]
|
|
264
|
+
}], propDecorators: { messagesViewport: [{
|
|
265
|
+
type: ViewChild,
|
|
266
|
+
args: ['messagesViewport']
|
|
267
|
+
}], app: [{
|
|
268
|
+
type: Input
|
|
269
|
+
}], user: [{
|
|
270
|
+
type: Input
|
|
271
|
+
}], initialConfig: [{
|
|
272
|
+
type: Input
|
|
273
|
+
}] } });
|
|
274
|
+
|
|
275
|
+
/*
|
|
276
|
+
* Public API Surface of max-agent-ui
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Generated bundle index. Do not edit.
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
export { MAX_ASSISTANT_CONFIG, MaxAssistantComponent };
|
|
284
|
+
//# sourceMappingURL=max-agent-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-agent-ui.mjs","sources":["../../../projects/max-agent-ui/src/lib/config/assistant.config.ts","../../../projects/max-agent-ui/src/lib/components/assistant/max-assistant.service.ts","../../../projects/max-agent-ui/src/lib/components/assistant/max-assistant.component.ts","../../../projects/max-agent-ui/src/lib/components/assistant/max-assistant.component.html","../../../projects/max-agent-ui/src/public-api.ts","../../../projects/max-agent-ui/src/max-agent-ui.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { AssistantProduct, AssistantUser } from '../models/assistant.models';\n\nexport interface MaxAssistantConfig {\n assistantApiUrl?: string;\n app?: AssistantProduct;\n user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);\n}\n\nexport const MAX_ASSISTANT_CONFIG = new InjectionToken<MaxAssistantConfig>(\n 'MAX_ASSISTANT_CONFIG',\n {\n factory: () => ({})\n }\n);\n","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\n\nimport { MAX_ASSISTANT_CONFIG, MaxAssistantConfig } from '../../config/assistant.config';\nimport {\n AssistantChatRequest,\n AssistantChatResponse,\n AssistantProduct,\n AssistantUser\n} from '../../models/assistant.models';\n\nconst DEFAULT_ASSISTANT_CHAT_URL =\n 'https://fhmaof3b4kaxqfbnomfstxyhw40rrcjr.lambda-url.eu-west-2.on.aws/chat';\nconst DEFAULT_APP = 'assistant';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MaxAssistantService {\n private readonly config = inject(MAX_ASSISTANT_CONFIG);\n private readonly http = inject(HttpClient, { optional: true });\n\n sendMessage(\n message: string,\n conversationId?: string,\n config: MaxAssistantConfig = {}\n ): Observable<AssistantChatResponse> {\n const assistantConfig = {\n ...this.config,\n ...config\n };\n const request: AssistantChatRequest = {\n message,\n conversationId,\n app: this.getApp(assistantConfig),\n user: this.getUser(assistantConfig)\n };\n\n return this.postMessage(request, assistantConfig);\n }\n\n private postMessage(\n request: AssistantChatRequest,\n config: MaxAssistantConfig\n ): Observable<AssistantChatResponse> {\n if (!this.http) {\n return throwError(\n () => new Error('HttpClient is not available. Add provideHttpClient() to the host app.')\n );\n }\n\n return this.http.post<AssistantChatResponse>(this.getChatUrl(config), request);\n }\n\n private getChatUrl(config: MaxAssistantConfig): string {\n return config.assistantApiUrl?.trim() || DEFAULT_ASSISTANT_CHAT_URL;\n }\n\n private getApp(config: MaxAssistantConfig): AssistantProduct {\n return config.app || DEFAULT_APP;\n }\n\n private getUser(config: MaxAssistantConfig): AssistantUser {\n if (typeof config.user === 'function') {\n return config.user();\n }\n\n return config.user ?? {};\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, DestroyRef, ElementRef, inject, Input, signal, ViewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport { ButtonModule } from 'primeng/button';\nimport { DrawerModule } from 'primeng/drawer';\nimport { TextareaModule } from 'primeng/textarea';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { MaxAssistantConfig } from '../../config/assistant.config';\nimport {\n AssistantChatResponse,\n AssistantDisplayResponse,\n AssistantExtractedIntent,\n AssistantFieldMap,\n AssistantMessage,\n AssistantProduct,\n AssistantUser,\n InitialConfig\n} from '../../models/assistant.models';\nimport { MaxAssistantService } from './max-assistant.service';\n\nconst ASSISTANT_UI_COPY = {\n title: 'Max',\n subtitle: 'Maxtime Virtual Assistant',\n launcherLabel: 'Open Maxtime virtual assistant',\n openTooltip: 'Open Maxtime virtual assistant',\n closeLabel: 'Close Maxtime virtual assistant',\n placeholder: 'Ask Maxtime virtual assistant',\n typingLabel: 'Maxtime virtual assistant is typing',\n errorMessage: 'Maxtime virtual assistant could not be reached. Please try again.'\n};\n\ntype AssistantBootstrapConfig = Pick<InitialConfig, 'initialMessage'> &\n Required<Pick<InitialConfig, 'initialSuggestions'>>;\n\nconst DEFAULT_ASSISTANT_BOOTSTRAP: AssistantBootstrapConfig = {\n initialMessage: undefined,\n initialSuggestions: []\n};\n\n@Component({\n selector: 'max-assistant',\n imports: [CommonModule, FormsModule, ButtonModule, DrawerModule, TextareaModule, TooltipModule],\n templateUrl: './max-assistant.component.html',\n styleUrl: './max-assistant.component.scss'\n})\nexport class MaxAssistantComponent {\n @ViewChild('messagesViewport') private messagesViewport?: ElementRef<HTMLElement>;\n\n @Input() app?: AssistantProduct;\n @Input() user:\n | Partial<AssistantUser>\n | (() => Partial<AssistantUser>) = {};\n @Input() initialConfig: InitialConfig = {};\n\n protected readonly panelVisible = signal(false);\n protected readonly isSending = signal(false);\n protected readonly input = signal('');\n protected readonly conversationId = signal<string | undefined>(undefined);\n protected readonly messages = signal<AssistantMessage[]>([]);\n protected readonly expandedInferenceMessageIds = signal<ReadonlySet<string>>(new Set<string>());\n\n private readonly assistantService = inject(MaxAssistantService);\n private readonly destroyRef = inject(DestroyRef);\n\n protected openPanel() {\n this.panelVisible.set(true);\n\n if (!this.messages().length && this.bootstrapConfig.initialMessage) {\n this.messages.set([\n this.createMessage(\n 'assistant',\n this.bootstrapConfig.initialMessage,\n this.bootstrapConfig.initialSuggestions\n )\n ]);\n }\n\n this.scrollToLatest();\n }\n\n protected get uiCopy(): typeof ASSISTANT_UI_COPY {\n return ASSISTANT_UI_COPY;\n }\n\n protected get bootstrapConfig(): AssistantBootstrapConfig {\n return {\n ...DEFAULT_ASSISTANT_BOOTSTRAP,\n initialMessage: this.initialConfig.initialMessage,\n initialSuggestions: this.initialConfig.initialSuggestions ?? []\n };\n }\n\n protected closePanel() {\n this.panelVisible.set(false);\n }\n\n protected sendMessage(message = this.input()) {\n const trimmedMessage = message.trim();\n\n if (!trimmedMessage || this.isSending()) {\n return;\n }\n\n this.input.set('');\n this.appendMessage(this.createMessage('user', trimmedMessage));\n this.isSending.set(true);\n\n this.assistantService\n .sendMessage(trimmedMessage, this.conversationId(), this.getAssistantConfig())\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: response => {\n this.conversationId.set(response.conversationId);\n this.appendMessage(this.createAssistantResponseMessage(response, trimmedMessage));\n this.isSending.set(false);\n },\n error: () => {\n this.appendMessage({\n ...this.createMessage('assistant', this.uiCopy.errorMessage),\n isError: true\n });\n this.isSending.set(false);\n }\n });\n }\n\n protected useSuggestion(suggestion: string) {\n this.sendMessage(suggestion);\n }\n\n protected onComposerKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n this.sendMessage();\n }\n }\n\n protected isInferenceDetailsVisible(messageId: string): boolean {\n return this.expandedInferenceMessageIds().has(messageId);\n }\n\n protected toggleInferenceDetails(messageId: string) {\n const willOpen = !this.isInferenceDetailsVisible(messageId);\n\n this.expandedInferenceMessageIds.update(expandedIds => {\n const nextExpandedIds = new Set(expandedIds);\n\n if (nextExpandedIds.has(messageId)) {\n nextExpandedIds.delete(messageId);\n } else {\n nextExpandedIds.add(messageId);\n }\n\n return nextExpandedIds;\n });\n\n if (willOpen) {\n this.scrollToLatest();\n }\n }\n\n private getAssistantConfig(): MaxAssistantConfig {\n return {\n app: this.app,\n user: this.user\n };\n }\n\n private appendMessage(message: AssistantMessage) {\n this.messages.update(messages => [...messages, message]);\n this.scrollToLatest();\n }\n\n private createAssistantResponseMessage(\n response: AssistantChatResponse,\n userQuery: string\n ): AssistantMessage {\n const displayResponse = this.createDisplayResponse(response, userQuery);\n\n return this.createMessage(\n 'assistant',\n displayResponse.agentInferredResponse || response.answer,\n response.suggestions,\n response.sources,\n response.intent,\n response.intentLabel,\n response.app,\n response.productLabel,\n response.apiModule,\n response.confidence,\n response.parameters ?? response.entities,\n response.apiCalls,\n response.mockResult,\n response.llmUsed,\n response.availableModules,\n displayResponse\n );\n }\n\n private createMessage(\n role: AssistantMessage['role'],\n content: string,\n suggestions: string[] = [],\n sources: AssistantMessage['sources'] = [],\n intent?: string,\n intentLabel?: string,\n app?: string,\n productLabel?: string,\n apiModule?: string,\n confidence?: number,\n parameters?: AssistantFieldMap,\n apiCalls?: AssistantMessage['apiCalls'],\n mockResult?: AssistantFieldMap,\n llmUsed?: boolean,\n availableModules?: string[],\n displayResponse?: AssistantDisplayResponse\n ): AssistantMessage {\n return {\n id: this.createId(),\n role,\n content,\n displayResponse,\n formattedParameters: this.formatJson(displayResponse?.agentExtractedIntent?.parameters),\n formattedApiBody: this.formatJson(displayResponse?.agentExtractedIntent?.api?.body),\n formattedApiResponse: this.formatJson(displayResponse?.apiResponse),\n suggestions,\n sources,\n intent,\n intentLabel,\n app,\n productLabel,\n apiModule,\n confidence,\n parameters,\n entities: parameters,\n apiCalls,\n mockResult,\n llmUsed,\n availableModules,\n createdAt: new Date()\n };\n }\n\n private createDisplayResponse(\n response: AssistantChatResponse,\n userQuery: string\n ): AssistantDisplayResponse {\n const provided = response.displayResponse ?? {};\n const extractedIntent = this.createExtractedIntent(response, provided.agentExtractedIntent);\n\n return {\n userQuery: provided.userQuery || userQuery,\n agentInferredResponse: provided.agentInferredResponse || response.answer,\n agentExtractedIntent: extractedIntent,\n apiResponse: provided.apiResponse ?? this.getApiResponseFallback(response),\n markdown: provided.markdown\n };\n }\n\n private createExtractedIntent(\n response: AssistantChatResponse,\n provided?: AssistantExtractedIntent\n ): AssistantExtractedIntent {\n return {\n project: provided?.project ?? response.productLabel ?? response.app,\n projectKey: provided?.projectKey ?? response.app,\n module: provided?.module ?? response.apiModule,\n intent: provided?.intent ?? response.intent,\n intentLabel: provided?.intentLabel ?? response.intentLabel,\n confidence: provided?.confidence ?? response.confidence,\n parameters: provided?.parameters ?? response.parameters ?? response.entities,\n api: provided?.api ?? response.apiCalls?.[0]\n };\n }\n\n private getApiResponseFallback(response: AssistantChatResponse): AssistantFieldMap | undefined {\n if (!response.mockResult || !Object.keys(response.mockResult).length) {\n return undefined;\n }\n\n return response.mockResult;\n }\n\n private formatJson(value: unknown): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n\n return JSON.stringify(value, null, 2);\n }\n\n private createId(): string {\n return globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`;\n }\n\n private scrollToLatest() {\n setTimeout(() => {\n const element = this.messagesViewport?.nativeElement;\n\n if (element) {\n element.scrollTop = element.scrollHeight;\n }\n });\n }\n}\n","<button\n pButton\n type=\"button\"\n class=\"assistant-launcher\"\n [attr.aria-label]=\"uiCopy.launcherLabel\"\n [pTooltip]=\"uiCopy.openTooltip\"\n tooltipPosition=\"left\"\n (click)=\"openPanel()\"\n>\n <span class=\"mascot\" aria-hidden=\"true\"></span>\n</button>\n\n<p-drawer\n [visible]=\"panelVisible()\"\n (visibleChange)=\"panelVisible.set($event)\"\n position=\"right\"\n styleClass=\"assistant-drawer\"\n [modal]=\"false\"\n [blockScroll]=\"false\"\n [showCloseIcon]=\"false\"\n>\n <section class=\"assistant-panel\" [attr.aria-label]=\"uiCopy.title\">\n <header class=\"assistant-header\">\n <span class=\"mascot large\" aria-hidden=\"true\"></span>\n <div>\n <h2>{{ uiCopy.title }}</h2>\n <span>{{ uiCopy.subtitle }}</span>\n </div>\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-times\"\n text\n rounded\n severity=\"secondary\"\n [attr.aria-label]=\"uiCopy.closeLabel\"\n (click)=\"closePanel()\"\n ></button>\n </header>\n\n <div #messagesViewport class=\"assistant-messages\">\n @for(message of messages(); track message.id) {\n <article class=\"message {{ message.role }}\" [class.error]=\"message.isError\">\n @if(message.displayResponse; as responseDetails) {\n <p class=\"assistant-result\">{{ responseDetails.agentInferredResponse || message.content }}</p>\n <button\n type=\"button\"\n class=\"inference-toggle\"\n [attr.aria-expanded]=\"isInferenceDetailsVisible(message.id)\"\n (click)=\"toggleInferenceDetails(message.id)\"\n >\n {{ isInferenceDetailsVisible(message.id) ? 'Hide Details' : 'Show Details' }}\n </button>\n\n @if(isInferenceDetailsVisible(message.id)) {\n <div class=\"response-details\">\n @if(responseDetails.userQuery) {\n <section class=\"response-section\">\n <h3>User Query</h3>\n <p class=\"quoted\">\"{{ responseDetails.userQuery }}\"</p>\n </section>\n }\n\n @if(responseDetails.agentExtractedIntent; as intent) {\n <section class=\"response-section\">\n <h3>Agent Extracted Intent</h3>\n <dl class=\"detail-grid\">\n @if(intent.project || intent.projectKey) {\n <div>\n <dt>Project</dt>\n <dd>\n {{ intent.project || intent.projectKey }}\n @if(intent.projectKey) {\n <span>{{ intent.projectKey }}</span>\n }\n </dd>\n </div>\n }\n @if(intent.module) {\n <div>\n <dt>Module</dt>\n <dd>{{ intent.module }}</dd>\n </div>\n }\n @if(intent.intentLabel) {\n <div>\n <dt>Intent Label</dt>\n <dd>{{ intent.intentLabel }}</dd>\n </div>\n }\n @if(intent.intent) {\n <div>\n <dt>Intent</dt>\n <dd>{{ intent.intent }}</dd>\n </div>\n }\n @if(intent.confidence !== undefined) {\n <div>\n <dt>Confidence</dt>\n <dd>{{ intent.confidence | percent: '1.0-0' }}</dd>\n </div>\n }\n </dl>\n\n @if(message.formattedParameters) {\n <div class=\"json-block\">\n <strong>Parameters</strong>\n <pre>{{ message.formattedParameters }}</pre>\n </div>\n }\n\n @if(intent.api?.url || intent.api?.method) {\n <div class=\"api-call-summary\">\n <strong>API Called</strong>\n <code>{{ intent.api?.method || 'GET' }} {{ intent.api?.url || 'URL not provided' }}</code>\n </div>\n }\n\n @if(message.formattedApiBody) {\n <div class=\"json-block\">\n <strong>API Body</strong>\n <pre>{{ message.formattedApiBody }}</pre>\n </div>\n }\n </section>\n }\n\n @if(message.formattedApiResponse) {\n <section class=\"response-section\">\n <h3>API Response</h3>\n <div class=\"json-block\">\n <strong>JSON</strong>\n <pre>{{ message.formattedApiResponse }}</pre>\n </div>\n </section>\n }\n </div>\n }\n } @else {\n <p>{{ message.content }}</p>\n }\n @if(message.role === 'assistant' && message.suggestions?.length) {\n <div class=\"suggestions\">\n @for(suggestion of message.suggestions ?? []; track suggestion) {\n <button\n pButton\n type=\"button\"\n size=\"small\"\n text\n severity=\"secondary\"\n class=\"suggestion-chip\"\n [label]=\"suggestion\"\n (click)=\"useSuggestion(suggestion)\"\n ></button>\n }\n </div>\n }\n </article>\n }\n @if(isSending()) {\n <article class=\"message assistant typing\" [attr.aria-label]=\"uiCopy.typingLabel\">\n <span></span>\n <span></span>\n <span></span>\n </article>\n }\n </div>\n\n <form class=\"assistant-composer\" (ngSubmit)=\"sendMessage()\">\n <textarea\n pTextarea\n name=\"assistantPrompt\"\n rows=\"2\"\n [placeholder]=\"uiCopy.placeholder\"\n [ngModel]=\"input()\"\n (ngModelChange)=\"input.set($event)\"\n (keydown)=\"onComposerKeydown($event)\"\n >\n </textarea>\n <button\n pButton\n type=\"submit\"\n icon=\"pi pi-send\"\n aria-label=\"Send message\"\n [disabled]=\"!input().trim() || isSending()\"\n ></button>\n </form>\n </section>\n</p-drawer>\n","/*\n * Public API Surface of max-agent-ui\n */\n\nexport * from './lib/components/assistant/max-assistant.component';\nexport * from './lib/config/assistant.config';\nexport * from './lib/models/assistant.models';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;MAUa,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB,E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;kBANjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAChB,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,wsNAAA,EAAA,MAAA,EAAA,CAAA,y8MAAA,CAAA,EAAA;;sBAK9F,SAAS;uBAAC,kBAAkB;;sBAE5B;;sBACA;;sBAGA;;;AEtDH;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "max-agent-ui",
|
|
3
|
+
"version": "0.0.10",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org/"
|
|
6
|
+
},
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@angular/cdk": "^21.0.0",
|
|
9
|
+
"@angular/common": "^21.0.0",
|
|
10
|
+
"@angular/core": "^21.0.7",
|
|
11
|
+
"@angular/forms": "^21.0.0",
|
|
12
|
+
"primeicons": "^7.0.0",
|
|
13
|
+
"primeng": "^21.1.6",
|
|
14
|
+
"rxjs": "^7.8.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"tslib": "^2.3.0"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"fesm2022",
|
|
21
|
+
"types",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"module": "fesm2022/max-agent-ui.mjs",
|
|
26
|
+
"typings": "types/max-agent-ui.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
"./package.json": {
|
|
29
|
+
"default": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./types/max-agent-ui.d.ts",
|
|
33
|
+
"default": "./fesm2022/max-agent-ui.mjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"type": "module"
|
|
37
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
type AssistantProduct = string;
|
|
5
|
+
type AssistantFieldValue = string | number | boolean | null | AssistantFieldValue[] | {
|
|
6
|
+
[key: string]: AssistantFieldValue;
|
|
7
|
+
};
|
|
8
|
+
type AssistantFieldMap = Record<string, AssistantFieldValue>;
|
|
9
|
+
interface AssistantSource {
|
|
10
|
+
label: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
dateRange?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
}
|
|
15
|
+
interface AssistantApiCall {
|
|
16
|
+
method: string;
|
|
17
|
+
url: string;
|
|
18
|
+
purpose?: string;
|
|
19
|
+
params?: AssistantFieldMap;
|
|
20
|
+
body?: AssistantFieldMap;
|
|
21
|
+
}
|
|
22
|
+
interface AssistantExtractedIntent {
|
|
23
|
+
project?: string;
|
|
24
|
+
projectKey?: string;
|
|
25
|
+
module?: string;
|
|
26
|
+
intent?: string;
|
|
27
|
+
intentLabel?: string;
|
|
28
|
+
confidence?: number;
|
|
29
|
+
parameters?: AssistantFieldMap;
|
|
30
|
+
api?: AssistantApiCall;
|
|
31
|
+
}
|
|
32
|
+
interface AssistantDisplayResponse {
|
|
33
|
+
agentInferredResponse?: string;
|
|
34
|
+
userQuery?: string;
|
|
35
|
+
agentExtractedIntent?: AssistantExtractedIntent;
|
|
36
|
+
apiResponse?: AssistantFieldValue | AssistantFieldMap;
|
|
37
|
+
markdown?: string;
|
|
38
|
+
}
|
|
39
|
+
interface AssistantUser {
|
|
40
|
+
[key: string]: AssistantFieldValue | undefined;
|
|
41
|
+
token?: string;
|
|
42
|
+
}
|
|
43
|
+
interface AssistantChatRequest {
|
|
44
|
+
message: string;
|
|
45
|
+
conversationId?: string;
|
|
46
|
+
app: AssistantProduct;
|
|
47
|
+
user: AssistantUser;
|
|
48
|
+
}
|
|
49
|
+
interface InitialConfig {
|
|
50
|
+
initialMessage?: string;
|
|
51
|
+
initialSuggestions?: string[];
|
|
52
|
+
}
|
|
53
|
+
interface AssistantChatResponse {
|
|
54
|
+
answer: string;
|
|
55
|
+
conversationId: string;
|
|
56
|
+
displayResponse?: AssistantDisplayResponse;
|
|
57
|
+
suggestions?: string[];
|
|
58
|
+
sources?: AssistantSource[];
|
|
59
|
+
intent?: string;
|
|
60
|
+
intentLabel?: string;
|
|
61
|
+
app?: string;
|
|
62
|
+
productLabel?: string;
|
|
63
|
+
apiModule?: string;
|
|
64
|
+
confidence?: number;
|
|
65
|
+
parameters?: AssistantFieldMap;
|
|
66
|
+
entities?: AssistantFieldMap;
|
|
67
|
+
apiCalls?: AssistantApiCall[];
|
|
68
|
+
mockResult?: AssistantFieldMap;
|
|
69
|
+
llmUsed?: boolean;
|
|
70
|
+
availableModules?: string[];
|
|
71
|
+
outOfScope?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface AssistantMessage {
|
|
74
|
+
id: string;
|
|
75
|
+
role: 'assistant' | 'user';
|
|
76
|
+
content: string;
|
|
77
|
+
createdAt: Date;
|
|
78
|
+
displayResponse?: AssistantDisplayResponse;
|
|
79
|
+
formattedParameters?: string;
|
|
80
|
+
formattedApiBody?: string;
|
|
81
|
+
formattedApiResponse?: string;
|
|
82
|
+
suggestions?: string[];
|
|
83
|
+
sources?: AssistantSource[];
|
|
84
|
+
intent?: string;
|
|
85
|
+
intentLabel?: string;
|
|
86
|
+
app?: string;
|
|
87
|
+
productLabel?: string;
|
|
88
|
+
apiModule?: string;
|
|
89
|
+
confidence?: number;
|
|
90
|
+
parameters?: AssistantFieldMap;
|
|
91
|
+
entities?: AssistantFieldMap;
|
|
92
|
+
apiCalls?: AssistantApiCall[];
|
|
93
|
+
mockResult?: AssistantFieldMap;
|
|
94
|
+
llmUsed?: boolean;
|
|
95
|
+
availableModules?: string[];
|
|
96
|
+
isError?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare const ASSISTANT_UI_COPY: {
|
|
100
|
+
title: string;
|
|
101
|
+
subtitle: string;
|
|
102
|
+
launcherLabel: string;
|
|
103
|
+
openTooltip: string;
|
|
104
|
+
closeLabel: string;
|
|
105
|
+
placeholder: string;
|
|
106
|
+
typingLabel: string;
|
|
107
|
+
errorMessage: string;
|
|
108
|
+
};
|
|
109
|
+
type AssistantBootstrapConfig = Pick<InitialConfig, 'initialMessage'> & Required<Pick<InitialConfig, 'initialSuggestions'>>;
|
|
110
|
+
declare class MaxAssistantComponent {
|
|
111
|
+
private messagesViewport?;
|
|
112
|
+
app?: AssistantProduct;
|
|
113
|
+
user: Partial<AssistantUser> | (() => Partial<AssistantUser>);
|
|
114
|
+
initialConfig: InitialConfig;
|
|
115
|
+
protected readonly panelVisible: _angular_core.WritableSignal<boolean>;
|
|
116
|
+
protected readonly isSending: _angular_core.WritableSignal<boolean>;
|
|
117
|
+
protected readonly input: _angular_core.WritableSignal<string>;
|
|
118
|
+
protected readonly conversationId: _angular_core.WritableSignal<string | undefined>;
|
|
119
|
+
protected readonly messages: _angular_core.WritableSignal<AssistantMessage[]>;
|
|
120
|
+
protected readonly expandedInferenceMessageIds: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
121
|
+
private readonly assistantService;
|
|
122
|
+
private readonly destroyRef;
|
|
123
|
+
protected openPanel(): void;
|
|
124
|
+
protected get uiCopy(): typeof ASSISTANT_UI_COPY;
|
|
125
|
+
protected get bootstrapConfig(): AssistantBootstrapConfig;
|
|
126
|
+
protected closePanel(): void;
|
|
127
|
+
protected sendMessage(message?: string): void;
|
|
128
|
+
protected useSuggestion(suggestion: string): void;
|
|
129
|
+
protected onComposerKeydown(event: KeyboardEvent): void;
|
|
130
|
+
protected isInferenceDetailsVisible(messageId: string): boolean;
|
|
131
|
+
protected toggleInferenceDetails(messageId: string): void;
|
|
132
|
+
private getAssistantConfig;
|
|
133
|
+
private appendMessage;
|
|
134
|
+
private createAssistantResponseMessage;
|
|
135
|
+
private createMessage;
|
|
136
|
+
private createDisplayResponse;
|
|
137
|
+
private createExtractedIntent;
|
|
138
|
+
private getApiResponseFallback;
|
|
139
|
+
private formatJson;
|
|
140
|
+
private createId;
|
|
141
|
+
private scrollToLatest;
|
|
142
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantComponent, never>;
|
|
143
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaxAssistantComponent, "max-assistant", never, { "app": { "alias": "app"; "required": false; }; "user": { "alias": "user"; "required": false; }; "initialConfig": { "alias": "initialConfig"; "required": false; }; }, {}, never, never, true, never>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface MaxAssistantConfig {
|
|
147
|
+
assistantApiUrl?: string;
|
|
148
|
+
app?: AssistantProduct;
|
|
149
|
+
user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);
|
|
150
|
+
}
|
|
151
|
+
declare const MAX_ASSISTANT_CONFIG: InjectionToken<MaxAssistantConfig>;
|
|
152
|
+
|
|
153
|
+
export { MAX_ASSISTANT_CONFIG, MaxAssistantComponent };
|
|
154
|
+
export type { AssistantApiCall, AssistantChatRequest, AssistantChatResponse, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFieldMap, AssistantFieldValue, AssistantMessage, AssistantProduct, AssistantSource, AssistantUser, InitialConfig, MaxAssistantConfig };
|