max-agent-ui 0.0.13 → 0.0.15

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/index.d.ts ADDED
@@ -0,0 +1,404 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, DestroyRef } from '@angular/core';
3
+ import { HttpClient } from '@angular/common/http';
4
+ import { Observable } from 'rxjs';
5
+
6
+ type AssistantProduct = string;
7
+ type AssistantFieldValue = string | number | boolean | null | AssistantFieldValue[] | {
8
+ [key: string]: AssistantFieldValue;
9
+ };
10
+ type AssistantFieldMap = Record<string, AssistantFieldValue>;
11
+ interface AssistantSource {
12
+ title: string;
13
+ sourceUri: string;
14
+ citation: string;
15
+ score: number;
16
+ }
17
+ interface AssistantRequestContext {
18
+ tenantId?: string;
19
+ organisationId?: string;
20
+ userId?: string;
21
+ role?: string;
22
+ permissions: string[];
23
+ route?: string;
24
+ timezone: string;
25
+ module?: string;
26
+ }
27
+ interface AssistantConfirmation {
28
+ actionId: number;
29
+ decision: 'approve' | 'reject';
30
+ }
31
+ interface AssistantStructuredAction {
32
+ capabilityKey: string;
33
+ arguments: AssistantFieldMap;
34
+ }
35
+ interface AssistantConversationMessage {
36
+ role: 'user' | 'assistant';
37
+ content: string;
38
+ capabilityKey?: string;
39
+ }
40
+ type AssistantSuggestion = string | {
41
+ label: string;
42
+ message: string;
43
+ structuredAction?: AssistantStructuredAction;
44
+ };
45
+ interface AssistantPendingAction {
46
+ id: number;
47
+ summary: string;
48
+ method: 'POST' | 'PATCH' | 'DELETE';
49
+ expiresAt: string;
50
+ }
51
+ interface AssistantToolExecution {
52
+ toolName: string;
53
+ method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
54
+ endpoint: string;
55
+ statusCode: number;
56
+ }
57
+ type AssistantTraceStepCategory = 'request' | 'intent_projection' | 'embedding' | 'capability_routing' | 'argument_extraction' | 'api_call' | 'action' | 'response';
58
+ type AssistantTraceStepStatus = 'running' | 'succeeded' | 'failed';
59
+ interface AssistantTraceTechnology {
60
+ component: string;
61
+ library?: string;
62
+ provider?: string;
63
+ model?: string;
64
+ operation?: string;
65
+ }
66
+ interface AssistantTraceControl {
67
+ mode: 'deterministic' | 'single_model_call' | 'single_embedding_call';
68
+ maximumIterations?: number;
69
+ iterationsUsed?: number;
70
+ stopCondition: string;
71
+ autonomousModelLoop: boolean;
72
+ }
73
+ interface AssistantTraceStepMetadata {
74
+ summary: string;
75
+ technology?: AssistantTraceTechnology;
76
+ control?: AssistantTraceControl;
77
+ }
78
+ interface AssistantTraceStep {
79
+ id: number;
80
+ category: AssistantTraceStepCategory;
81
+ title: string;
82
+ status: AssistantTraceStepStatus;
83
+ startedAt: string;
84
+ durationMs?: number;
85
+ metadata?: AssistantTraceStepMetadata;
86
+ input?: AssistantFieldValue;
87
+ output?: AssistantFieldValue;
88
+ error?: {
89
+ message: string;
90
+ statusCode?: number;
91
+ };
92
+ }
93
+ interface AssistantDeveloperTrace {
94
+ run?: {
95
+ traceVersion: '2.0';
96
+ architecture: 'deterministic_staged_pipeline';
97
+ startedAt: string;
98
+ completedAt: string;
99
+ durationMs: number;
100
+ llmCalls: number;
101
+ embeddingCalls: number;
102
+ apiCalls: number;
103
+ autonomousModelLoop: false;
104
+ loopPolicy: string;
105
+ };
106
+ steps: AssistantTraceStep[];
107
+ }
108
+ interface AssistantCard {
109
+ title: string;
110
+ subtitle?: string;
111
+ metrics: Array<{
112
+ label: string;
113
+ value: string;
114
+ tone?: 'default' | 'positive' | 'warning';
115
+ }>;
116
+ footer?: string;
117
+ }
118
+ interface AssistantContextResolution {
119
+ status: 'resolved' | 'ambiguous' | 'unmatched';
120
+ contextKey?: string;
121
+ contextLabel?: string;
122
+ moduleKey?: string;
123
+ capabilityKey?: string;
124
+ capabilityLabel?: string;
125
+ requestKind?: 'informational' | 'navigational' | 'analytical' | 'live_read' | 'action';
126
+ requiresLiveData: boolean;
127
+ confidence: number;
128
+ }
129
+ interface AssistantApiCall {
130
+ method: string;
131
+ url: string;
132
+ purpose?: string;
133
+ headers?: AssistantFieldMap;
134
+ params?: AssistantFieldMap;
135
+ body?: AssistantFieldMap;
136
+ }
137
+ interface AssistantExtractedIntent {
138
+ project?: string;
139
+ projectKey?: string;
140
+ module?: string;
141
+ intent?: string;
142
+ intentLabel?: string;
143
+ confidence?: number;
144
+ parameters?: AssistantFieldMap;
145
+ api?: AssistantApiCall;
146
+ }
147
+ interface AssistantDisplayResponse {
148
+ agentInferredResponse?: string;
149
+ userQuery?: string;
150
+ agentExtractedIntent?: AssistantExtractedIntent;
151
+ apiResponse?: AssistantFieldValue | AssistantFieldMap;
152
+ sampleJsonResponse?: AssistantFieldValue | AssistantFieldMap;
153
+ grid?: AssistantResponseTable[];
154
+ tables?: AssistantResponseTable[];
155
+ markdown?: string;
156
+ }
157
+ interface AssistantResponseTableColumn {
158
+ field: string;
159
+ header: string;
160
+ }
161
+ interface AssistantResponseTable {
162
+ title?: string;
163
+ columns: AssistantResponseTableColumn[];
164
+ rows: AssistantFieldMap[];
165
+ actions?: AssistantResponseTableAction[];
166
+ }
167
+ interface AssistantResponseTableAction {
168
+ rowIndex: number;
169
+ label: string;
170
+ message: string;
171
+ tone?: 'primary' | 'success' | 'danger' | 'secondary';
172
+ confirmOnClick?: boolean;
173
+ structuredAction: AssistantStructuredAction;
174
+ }
175
+ interface AssistantUser {
176
+ [key: string]: AssistantFieldValue | undefined;
177
+ token?: string;
178
+ version?: string;
179
+ }
180
+ interface AssistantChatRequest {
181
+ message: string;
182
+ stream?: boolean;
183
+ conversationId?: string;
184
+ history: AssistantConversationMessage[];
185
+ app: AssistantProduct;
186
+ context: AssistantRequestContext;
187
+ confirmation?: AssistantConfirmation;
188
+ structuredAction?: AssistantStructuredAction;
189
+ }
190
+ interface AssistantChatProgress {
191
+ type: 'progress';
192
+ stage: 'request' | 'intent_projection' | 'embedding' | 'capability_routing' | 'argument_extraction' | 'api_call' | 'action' | 'response';
193
+ message: string;
194
+ }
195
+ type AssistantChatStreamEvent = AssistantChatProgress | {
196
+ type: 'result';
197
+ response: AssistantChatResponse;
198
+ } | {
199
+ type: 'error';
200
+ message: string;
201
+ };
202
+ interface AssistantChatResponse {
203
+ answer: string;
204
+ conversationId: string;
205
+ product: string;
206
+ status: 'answered' | 'clarification_required' | 'insufficient_knowledge' | 'live_data_required' | 'confirmation_required' | 'action_completed' | 'action_cancelled';
207
+ contextResolution: AssistantContextResolution;
208
+ pendingAction?: AssistantPendingAction;
209
+ toolExecution?: AssistantToolExecution;
210
+ developerTrace?: AssistantDeveloperTrace;
211
+ displayResponse?: AssistantDisplayResponse;
212
+ suggestions?: AssistantSuggestion[];
213
+ cards?: AssistantCard[];
214
+ sources?: AssistantSource[];
215
+ intent?: string;
216
+ intentLabel?: string;
217
+ app?: string;
218
+ productLabel?: string;
219
+ apiModule?: string;
220
+ confidence?: number;
221
+ parameters?: AssistantFieldMap;
222
+ entities?: AssistantFieldMap;
223
+ apiCalls?: AssistantApiCall[];
224
+ apiResult?: AssistantFieldMap;
225
+ mockResult?: AssistantFieldMap;
226
+ llmUsed?: boolean;
227
+ availableModules?: string[];
228
+ outOfScope?: boolean;
229
+ }
230
+ interface AssistantMessage {
231
+ id: string;
232
+ role: 'assistant' | 'user';
233
+ content: string;
234
+ createdAt: Date;
235
+ displayResponse?: AssistantDisplayResponse;
236
+ formattedParameters?: string;
237
+ formattedApiHeaders?: string;
238
+ formattedApiBody?: string;
239
+ formattedApiResponse?: string;
240
+ formattedSampleJsonResponse?: string;
241
+ suggestions?: AssistantSuggestion[];
242
+ sources?: AssistantSource[];
243
+ intent?: string;
244
+ intentLabel?: string;
245
+ app?: string;
246
+ productLabel?: string;
247
+ apiModule?: string;
248
+ confidence?: number;
249
+ parameters?: AssistantFieldMap;
250
+ entities?: AssistantFieldMap;
251
+ apiCalls?: AssistantApiCall[];
252
+ apiResult?: AssistantFieldMap;
253
+ mockResult?: AssistantFieldMap;
254
+ llmUsed?: boolean;
255
+ availableModules?: string[];
256
+ status?: AssistantChatResponse['status'];
257
+ pendingAction?: AssistantPendingAction;
258
+ toolExecution?: AssistantToolExecution;
259
+ developerTrace?: AssistantDeveloperTrace;
260
+ cards?: AssistantCard[];
261
+ actionDecision?: AssistantConfirmation['decision'];
262
+ capabilityKey?: string;
263
+ isError?: boolean;
264
+ isStreaming?: boolean;
265
+ }
266
+
267
+ interface AssistantBootstrapConfig {
268
+ initialMessage?: string;
269
+ initialDescription?: string;
270
+ initialSuggestions: string[];
271
+ }
272
+
273
+ interface MaxAssistantConfig {
274
+ assistantApiUrl?: string;
275
+ app?: AssistantProduct;
276
+ user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);
277
+ context?: Partial<AssistantRequestContext> | (() => Partial<AssistantRequestContext>);
278
+ requestHeaders?: Record<string, string> | (() => Record<string, string>);
279
+ }
280
+ declare const MAX_ASSISTANT_CONFIG: InjectionToken<MaxAssistantConfig>;
281
+
282
+ declare class MaxAssistantService {
283
+ private readonly config;
284
+ private readonly http;
285
+ constructor(config: MaxAssistantConfig, http: HttpClient | null);
286
+ sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig, confirmation?: AssistantConfirmation, history?: AssistantConversationMessage[], onProgress?: (progress: AssistantChatProgress) => void): Observable<AssistantChatResponse>;
287
+ confirmAction(actionId: number, decision: AssistantConfirmation['decision'], conversationId: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
288
+ sendStructuredAction(message: string, action: AssistantStructuredAction, conversationId?: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
289
+ private postMessage;
290
+ private streamMessage;
291
+ private getChatUrl;
292
+ private getApp;
293
+ private getUser;
294
+ private getContext;
295
+ private getHeaders;
296
+ private compactConfig;
297
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantService, [null, { optional: true; }]>;
298
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantService>;
299
+ }
300
+
301
+ declare const ASSISTANT_UI_COPY: {
302
+ title: string;
303
+ subtitle: string;
304
+ launcherLabel: string;
305
+ openTooltip: string;
306
+ closeLabel: string;
307
+ clearLabel: string;
308
+ clearTooltip: string;
309
+ placeholder: string;
310
+ startingMessage: string;
311
+ errorMessage: string;
312
+ };
313
+ declare class MaxAssistantComponent {
314
+ private readonly assistantService;
315
+ private readonly destroyRef;
316
+ private readonly defaultConfig;
317
+ private launcher?;
318
+ private messagesViewport?;
319
+ app?: AssistantProduct;
320
+ assistantApiUrl?: string;
321
+ user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);
322
+ context?: Partial<AssistantRequestContext> | (() => Partial<AssistantRequestContext>);
323
+ requestHeaders?: Record<string, string> | (() => Record<string, string>);
324
+ protected readonly panelVisible: _angular_core.WritableSignal<boolean>;
325
+ protected readonly isSending: _angular_core.WritableSignal<boolean>;
326
+ protected readonly input: _angular_core.WritableSignal<string>;
327
+ protected readonly conversationId: _angular_core.WritableSignal<string | undefined>;
328
+ protected readonly messages: _angular_core.WritableSignal<AssistantMessage[]>;
329
+ protected readonly expandedDetailMessageIds: _angular_core.WritableSignal<ReadonlySet<string>>;
330
+ protected readonly expandedTraceStepKeys: _angular_core.WritableSignal<ReadonlySet<string>>;
331
+ protected readonly developerDetailsEnabled: boolean;
332
+ constructor(assistantService: MaxAssistantService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
333
+ protected openPanel(): void;
334
+ protected togglePanel(): void;
335
+ protected get launcherLabel(): string;
336
+ protected get uiCopy(): typeof ASSISTANT_UI_COPY;
337
+ protected get bootstrapConfig(): AssistantBootstrapConfig;
338
+ protected isWelcomeMessage(message: AssistantMessage): boolean;
339
+ protected isWelcomeState(message: AssistantMessage): boolean;
340
+ protected closePanel(): void;
341
+ protected onDocumentEscape(): void;
342
+ protected clearChatSession(): void;
343
+ protected sendMessage(message?: string): void;
344
+ protected suggestionLabel(suggestion: AssistantSuggestion): string;
345
+ protected useSuggestion(suggestion: AssistantSuggestion): void;
346
+ protected getTableRowActions(table: AssistantResponseTable, rowIndex: number): AssistantResponseTableAction[];
347
+ protected useTableAction(action: AssistantResponseTableAction): void;
348
+ protected resolvePendingAction(message: AssistantMessage, decision: AssistantConfirmation['decision']): void;
349
+ private resolveErrorMessage;
350
+ protected onComposerKeydown(event: KeyboardEvent): void;
351
+ protected isDetailsVisible(messageId: string): boolean;
352
+ protected toggleDetails(messageId: string, initialStepId?: number): void;
353
+ protected isTraceStepExpanded(messageId: string, stepId: number): boolean;
354
+ protected toggleTraceStep(messageId: string, stepId: number): void;
355
+ protected getResponseGrid(responseDetails: AssistantDisplayResponse): AssistantResponseTable[];
356
+ protected formatTraceValue(value: AssistantFieldValue | undefined): string;
357
+ protected traceMap(value: AssistantFieldValue | undefined): AssistantFieldMap | undefined;
358
+ protected traceMapField(value: AssistantFieldValue | undefined, key: string): AssistantFieldMap | undefined;
359
+ protected traceArrayField(value: AssistantFieldValue | undefined, key: string): AssistantFieldValue[];
360
+ protected traceField(value: AssistantFieldValue | undefined, key: string): AssistantFieldValue | undefined;
361
+ protected traceEntries(value: AssistantFieldValue | AssistantFieldMap | undefined, excludedKeys?: string[]): Array<{
362
+ key: string;
363
+ label: string;
364
+ value: AssistantFieldValue;
365
+ }>;
366
+ protected formatTraceLabel(value: string): string;
367
+ protected formatTraceScalar(value: AssistantFieldValue | undefined): string;
368
+ protected formatSimilarity(value: AssistantFieldValue | undefined): string;
369
+ protected getHttpStatus(step: AssistantTraceStep): number | undefined;
370
+ protected isHttpSuccessful(step: AssistantTraceStep): boolean;
371
+ protected traceStepTone(step: AssistantTraceStep): AssistantTraceStep['status'];
372
+ protected traceStepStatus(step: AssistantTraceStep): string;
373
+ protected formatTraceCategory(category: string): string;
374
+ private getAssistantConfig;
375
+ private appendMessage;
376
+ private updateStreamingMessage;
377
+ private replaceMessage;
378
+ private createDefaultMessages;
379
+ private getInitialMessage;
380
+ private createAssistantResponseMessage;
381
+ private createMessage;
382
+ private createDisplayResponse;
383
+ private createExtractedIntent;
384
+ private getToolApiCalls;
385
+ private getSampleJsonResponseFallback;
386
+ private getDisplayTables;
387
+ private extractTableRows;
388
+ private getTableColumns;
389
+ private formatTableRow;
390
+ private formatCellValue;
391
+ private toColumnHeader;
392
+ private formatJson;
393
+ private isEmptyObject;
394
+ private isFieldMap;
395
+ private createId;
396
+ private traceStepKey;
397
+ private getConversationHistory;
398
+ private scrollToLatest;
399
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantComponent, never>;
400
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaxAssistantComponent, "max-assistant", never, { "app": { "alias": "app"; "required": false; }; "assistantApiUrl": { "alias": "assistantApiUrl"; "required": false; }; "user": { "alias": "user"; "required": false; }; "context": { "alias": "context"; "required": false; }; "requestHeaders": { "alias": "requestHeaders"; "required": false; }; }, {}, never, never, true, never>;
401
+ }
402
+
403
+ export { MAX_ASSISTANT_CONFIG, MaxAssistantComponent, MaxAssistantService };
404
+ export type { AssistantApiCall, AssistantCard, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFieldMap, AssistantFieldValue, AssistantMessage, AssistantPendingAction, AssistantProduct, AssistantRequestContext, AssistantResponseTable, AssistantResponseTableAction, AssistantResponseTableColumn, AssistantSource, AssistantStructuredAction, AssistantSuggestion, AssistantToolExecution, AssistantTraceControl, AssistantTraceStep, AssistantTraceStepCategory, AssistantTraceStepMetadata, AssistantTraceStepStatus, AssistantTraceTechnology, AssistantUser, MaxAssistantConfig };
package/package.json CHANGED
@@ -1,37 +1,38 @@
1
1
  {
2
2
  "name": "max-agent-ui",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
7
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",
8
+ "@angular/cdk": ">=20.0.0 <22.0.0",
9
+ "@angular/common": ">=20.0.0 <22.0.0",
10
+ "@angular/core": ">=20.0.0 <22.0.0",
11
+ "@angular/forms": ">=20.0.0 <22.0.0",
12
12
  "primeicons": "^7.0.0",
13
- "primeng": "^21.1.6",
13
+ "primeng": ">=20.0.0 <22.0.0",
14
14
  "rxjs": "^7.8.0"
15
15
  },
16
16
  "dependencies": {
17
+ "marked": "18.0.7",
17
18
  "tslib": "^2.3.0"
18
19
  },
19
20
  "files": [
20
21
  "fesm2022",
22
+ "index.d.ts",
21
23
  "types",
22
24
  "README.md"
23
25
  ],
24
26
  "sideEffects": false,
25
27
  "module": "fesm2022/max-agent-ui.mjs",
26
- "typings": "types/max-agent-ui.d.ts",
28
+ "typings": "index.d.ts",
27
29
  "exports": {
28
30
  "./package.json": {
29
31
  "default": "./package.json"
30
32
  },
31
33
  ".": {
32
- "types": "./types/max-agent-ui.d.ts",
34
+ "types": "./index.d.ts",
33
35
  "default": "./fesm2022/max-agent-ui.mjs"
34
36
  }
35
- },
36
- "type": "module"
37
+ }
37
38
  }
@@ -1,204 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { InjectionToken, DestroyRef } from '@angular/core';
3
- import { HttpClient } from '@angular/common/http';
4
- import { Observable } from 'rxjs';
5
-
6
- type AssistantProduct = string;
7
- type AssistantFieldValue = string | number | boolean | null | AssistantFieldValue[] | {
8
- [key: string]: AssistantFieldValue;
9
- };
10
- type AssistantFieldMap = Record<string, AssistantFieldValue>;
11
- interface AssistantSource {
12
- label: string;
13
- type?: string;
14
- dateRange?: string;
15
- url?: string;
16
- }
17
- interface AssistantApiCall {
18
- method: string;
19
- url: string;
20
- purpose?: string;
21
- headers?: AssistantFieldMap;
22
- params?: AssistantFieldMap;
23
- body?: AssistantFieldMap;
24
- }
25
- interface AssistantExtractedIntent {
26
- project?: string;
27
- projectKey?: string;
28
- module?: string;
29
- intent?: string;
30
- intentLabel?: string;
31
- confidence?: number;
32
- parameters?: AssistantFieldMap;
33
- api?: AssistantApiCall;
34
- }
35
- interface AssistantDisplayResponse {
36
- agentInferredResponse?: string;
37
- userQuery?: string;
38
- agentExtractedIntent?: AssistantExtractedIntent;
39
- apiResponse?: AssistantFieldValue | AssistantFieldMap;
40
- sampleJsonResponse?: AssistantFieldValue | AssistantFieldMap;
41
- grid?: AssistantResponseTable[];
42
- tables?: AssistantResponseTable[];
43
- markdown?: string;
44
- }
45
- interface AssistantResponseTableColumn {
46
- field: string;
47
- header: string;
48
- }
49
- interface AssistantResponseTable {
50
- title?: string;
51
- columns: AssistantResponseTableColumn[];
52
- rows: AssistantFieldMap[];
53
- }
54
- interface AssistantUser {
55
- [key: string]: AssistantFieldValue | undefined;
56
- token?: string;
57
- version?: string;
58
- }
59
- interface AssistantChatRequest {
60
- message: string;
61
- conversationId?: string;
62
- app: AssistantProduct;
63
- user: AssistantUser;
64
- }
65
- interface AssistantChatResponse {
66
- answer: string;
67
- conversationId: string;
68
- displayResponse?: AssistantDisplayResponse;
69
- suggestions?: string[];
70
- sources?: AssistantSource[];
71
- intent?: string;
72
- intentLabel?: string;
73
- app?: string;
74
- productLabel?: string;
75
- apiModule?: string;
76
- confidence?: number;
77
- parameters?: AssistantFieldMap;
78
- entities?: AssistantFieldMap;
79
- apiCalls?: AssistantApiCall[];
80
- apiResult?: AssistantFieldMap;
81
- mockResult?: AssistantFieldMap;
82
- llmUsed?: boolean;
83
- availableModules?: string[];
84
- outOfScope?: boolean;
85
- }
86
- interface AssistantMessage {
87
- id: string;
88
- role: 'assistant' | 'user';
89
- content: string;
90
- createdAt: Date;
91
- displayResponse?: AssistantDisplayResponse;
92
- formattedParameters?: string;
93
- formattedApiHeaders?: string;
94
- formattedApiBody?: string;
95
- formattedApiResponse?: string;
96
- formattedSampleJsonResponse?: string;
97
- suggestions?: string[];
98
- sources?: AssistantSource[];
99
- intent?: string;
100
- intentLabel?: string;
101
- app?: string;
102
- productLabel?: string;
103
- apiModule?: string;
104
- confidence?: number;
105
- parameters?: AssistantFieldMap;
106
- entities?: AssistantFieldMap;
107
- apiCalls?: AssistantApiCall[];
108
- apiResult?: AssistantFieldMap;
109
- mockResult?: AssistantFieldMap;
110
- llmUsed?: boolean;
111
- availableModules?: string[];
112
- isError?: boolean;
113
- }
114
-
115
- interface AssistantBootstrapConfig {
116
- initialMessage?: string;
117
- initialSuggestions: string[];
118
- }
119
-
120
- interface MaxAssistantConfig {
121
- assistantApiUrl?: string;
122
- app?: AssistantProduct;
123
- user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);
124
- }
125
- declare const MAX_ASSISTANT_CONFIG: InjectionToken<MaxAssistantConfig>;
126
-
127
- declare class MaxAssistantService {
128
- private readonly config;
129
- private readonly http;
130
- constructor(config: MaxAssistantConfig, http: HttpClient | null);
131
- sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig): Observable<AssistantChatResponse>;
132
- private postMessage;
133
- private getChatUrl;
134
- private getApp;
135
- private getUser;
136
- private compactConfig;
137
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantService, [null, { optional: true; }]>;
138
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantService>;
139
- }
140
-
141
- declare const ASSISTANT_UI_COPY: {
142
- title: string;
143
- subtitle: string;
144
- launcherLabel: string;
145
- openTooltip: string;
146
- closeLabel: string;
147
- clearLabel: string;
148
- clearTooltip: string;
149
- placeholder: string;
150
- typingLabel: string;
151
- errorMessage: string;
152
- };
153
- declare class MaxAssistantComponent {
154
- private readonly assistantService;
155
- private readonly destroyRef;
156
- private messagesViewport?;
157
- app?: AssistantProduct;
158
- assistantApiUrl?: string;
159
- user: Partial<AssistantUser> | (() => Partial<AssistantUser>);
160
- protected readonly panelVisible: _angular_core.WritableSignal<boolean>;
161
- protected readonly isSending: _angular_core.WritableSignal<boolean>;
162
- protected readonly input: _angular_core.WritableSignal<string>;
163
- protected readonly conversationId: _angular_core.WritableSignal<string | undefined>;
164
- protected readonly messages: _angular_core.WritableSignal<AssistantMessage[]>;
165
- protected readonly expandedInferenceMessageIds: _angular_core.WritableSignal<ReadonlySet<string>>;
166
- constructor(assistantService: MaxAssistantService, destroyRef: DestroyRef);
167
- protected openPanel(): void;
168
- protected togglePanel(): void;
169
- protected get launcherLabel(): string;
170
- protected get uiCopy(): typeof ASSISTANT_UI_COPY;
171
- protected get bootstrapConfig(): AssistantBootstrapConfig;
172
- protected closePanel(): void;
173
- protected clearChatSession(): void;
174
- protected sendMessage(message?: string): void;
175
- protected useSuggestion(suggestion: string): void;
176
- protected onComposerKeydown(event: KeyboardEvent): void;
177
- protected isInferenceDetailsVisible(messageId: string): boolean;
178
- protected toggleInferenceDetails(messageId: string): void;
179
- protected getResponseGrid(responseDetails: AssistantDisplayResponse): AssistantResponseTable[];
180
- private getAssistantConfig;
181
- private appendMessage;
182
- private createDefaultMessages;
183
- private createAssistantResponseMessage;
184
- private createMessage;
185
- private createDisplayResponse;
186
- private createExtractedIntent;
187
- private getSampleJsonResponseFallback;
188
- private getDisplayTables;
189
- private extractTableRows;
190
- private getTableColumns;
191
- private formatTableRow;
192
- private formatCellValue;
193
- private toColumnHeader;
194
- private formatJson;
195
- private isEmptyObject;
196
- private isFieldMap;
197
- private createId;
198
- private scrollToLatest;
199
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantComponent, never>;
200
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaxAssistantComponent, "max-assistant", never, { "app": { "alias": "app"; "required": false; }; "assistantApiUrl": { "alias": "assistantApiUrl"; "required": false; }; "user": { "alias": "user"; "required": false; }; }, {}, never, never, true, never>;
201
- }
202
-
203
- export { MAX_ASSISTANT_CONFIG, MaxAssistantComponent };
204
- export type { AssistantApiCall, AssistantChatRequest, AssistantChatResponse, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFieldMap, AssistantFieldValue, AssistantMessage, AssistantProduct, AssistantResponseTable, AssistantResponseTableColumn, AssistantSource, AssistantUser, MaxAssistantConfig };