max-agent-ui 0.0.17 → 0.0.19
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/fesm2022/max-agent-ui.mjs +227 -17
- package/fesm2022/max-agent-ui.mjs.map +1 -1
- package/index.d.ts +94 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, OnInit, DestroyRef } from '@angular/core';
|
|
2
|
+
import { InjectionToken, OnInit, EventEmitter, DestroyRef } from '@angular/core';
|
|
3
3
|
import { HttpClient } from '@angular/common/http';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
|
|
@@ -32,6 +32,10 @@ interface AssistantStructuredAction {
|
|
|
32
32
|
capabilityKey: string;
|
|
33
33
|
arguments: AssistantFieldMap;
|
|
34
34
|
}
|
|
35
|
+
interface AssistantHostAction {
|
|
36
|
+
type: string;
|
|
37
|
+
payload: AssistantFieldMap;
|
|
38
|
+
}
|
|
35
39
|
interface AssistantConversationMessage {
|
|
36
40
|
role: 'user' | 'assistant';
|
|
37
41
|
content: string;
|
|
@@ -152,11 +156,20 @@ interface AssistantDisplayResponse {
|
|
|
152
156
|
sampleJsonResponse?: AssistantFieldValue | AssistantFieldMap;
|
|
153
157
|
grid?: AssistantResponseTable[];
|
|
154
158
|
tables?: AssistantResponseTable[];
|
|
159
|
+
searchResults?: AssistantSearchResult[];
|
|
155
160
|
visualisations?: AssistantVisualisation[];
|
|
156
161
|
shiftCardGroups?: AssistantShiftCardGroup[];
|
|
157
162
|
rota?: AssistantRotaCalendar;
|
|
158
163
|
markdown?: string;
|
|
159
164
|
}
|
|
165
|
+
interface AssistantSearchResult {
|
|
166
|
+
title: string;
|
|
167
|
+
type: string;
|
|
168
|
+
actions: Array<{
|
|
169
|
+
label: string;
|
|
170
|
+
hostAction: AssistantHostAction;
|
|
171
|
+
}>;
|
|
172
|
+
}
|
|
160
173
|
interface AssistantVisualisation {
|
|
161
174
|
type: 'doughnut' | 'bar';
|
|
162
175
|
title: string;
|
|
@@ -218,9 +231,36 @@ interface AssistantResponseTableAction {
|
|
|
218
231
|
}
|
|
219
232
|
interface AssistantUser {
|
|
220
233
|
[key: string]: AssistantFieldValue | undefined;
|
|
234
|
+
name?: string;
|
|
235
|
+
username?: string;
|
|
236
|
+
email?: string;
|
|
237
|
+
phone?: string;
|
|
221
238
|
token?: string;
|
|
222
239
|
version?: string;
|
|
223
240
|
}
|
|
241
|
+
type AssistantSupportTicketSeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
242
|
+
type AssistantSupportTagSeverity = 'success' | 'secondary' | 'info' | 'warn' | 'danger' | 'contrast';
|
|
243
|
+
interface AssistantSupportTag {
|
|
244
|
+
value: string;
|
|
245
|
+
label: string;
|
|
246
|
+
icon: string;
|
|
247
|
+
severity: AssistantSupportTagSeverity;
|
|
248
|
+
}
|
|
249
|
+
interface AssistantSupportTicketRequest {
|
|
250
|
+
name: string;
|
|
251
|
+
email: string;
|
|
252
|
+
phone?: string;
|
|
253
|
+
query: string;
|
|
254
|
+
severity: AssistantSupportTicketSeverity;
|
|
255
|
+
tags: string[];
|
|
256
|
+
app: AssistantProduct;
|
|
257
|
+
}
|
|
258
|
+
interface AssistantSupportTicketResponse {
|
|
259
|
+
success: boolean;
|
|
260
|
+
ticketReference: string;
|
|
261
|
+
message: string;
|
|
262
|
+
submittedAt: string;
|
|
263
|
+
}
|
|
224
264
|
interface AssistantChatRequest {
|
|
225
265
|
message: string;
|
|
226
266
|
stream?: boolean;
|
|
@@ -342,25 +382,49 @@ declare class MaxAssistantService {
|
|
|
342
382
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantService>;
|
|
343
383
|
}
|
|
344
384
|
|
|
385
|
+
declare class MaxAssistantSupportService {
|
|
386
|
+
readonly tagsEndpoint = "selection/support-tags";
|
|
387
|
+
readonly ticketsEndpoint = "support/tickets";
|
|
388
|
+
getSupportTags(): Observable<AssistantSupportTag[]>;
|
|
389
|
+
submitTicket(_ticket: AssistantSupportTicketRequest): Observable<AssistantSupportTicketResponse>;
|
|
390
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantSupportService, never>;
|
|
391
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantSupportService>;
|
|
392
|
+
}
|
|
393
|
+
|
|
345
394
|
declare const ASSISTANT_UI_COPY: {
|
|
346
395
|
title: string;
|
|
347
396
|
subtitle: string;
|
|
348
397
|
clearLabel: string;
|
|
349
398
|
clearTooltip: string;
|
|
399
|
+
closeLabel: string;
|
|
400
|
+
closeTooltip: string;
|
|
350
401
|
placeholder: string;
|
|
351
402
|
startingMessage: string;
|
|
352
403
|
errorMessage: string;
|
|
353
404
|
};
|
|
405
|
+
interface SupportTicketFormValue {
|
|
406
|
+
name: string;
|
|
407
|
+
email: string;
|
|
408
|
+
phone: string;
|
|
409
|
+
query: string;
|
|
410
|
+
severity: AssistantSupportTicketSeverity;
|
|
411
|
+
tags: string[];
|
|
412
|
+
}
|
|
354
413
|
declare class MaxAssistantComponent implements OnInit {
|
|
355
414
|
private readonly assistantService;
|
|
415
|
+
private readonly supportService;
|
|
356
416
|
private readonly destroyRef;
|
|
357
417
|
private readonly defaultConfig;
|
|
358
418
|
private messagesViewport?;
|
|
419
|
+
private composerInput?;
|
|
420
|
+
private supportQueryInput?;
|
|
359
421
|
app?: AssistantProduct;
|
|
360
422
|
assistantApiUrl?: string;
|
|
361
423
|
user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);
|
|
362
424
|
context?: Partial<AssistantRequestContext> | (() => Partial<AssistantRequestContext>);
|
|
363
425
|
requestHeaders?: Record<string, string> | (() => Record<string, string>);
|
|
426
|
+
hostAction: EventEmitter<AssistantHostAction>;
|
|
427
|
+
closeRequested: EventEmitter<void>;
|
|
364
428
|
protected readonly isSending: _angular_core.WritableSignal<boolean>;
|
|
365
429
|
protected readonly input: _angular_core.WritableSignal<string>;
|
|
366
430
|
protected readonly conversationId: _angular_core.WritableSignal<string | undefined>;
|
|
@@ -368,8 +432,21 @@ declare class MaxAssistantComponent implements OnInit {
|
|
|
368
432
|
protected readonly expandedDetailMessageIds: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
369
433
|
protected readonly expandedTraceStepKeys: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
370
434
|
protected readonly developerDetailsEnabled: boolean;
|
|
371
|
-
|
|
435
|
+
protected readonly supportTicketVisible: _angular_core.WritableSignal<boolean>;
|
|
436
|
+
protected readonly supportTicketSubmitting: _angular_core.WritableSignal<boolean>;
|
|
437
|
+
protected readonly supportTagsLoading: _angular_core.WritableSignal<boolean>;
|
|
438
|
+
protected readonly supportTags: _angular_core.WritableSignal<AssistantSupportTag[]>;
|
|
439
|
+
protected readonly supportTicketResult: _angular_core.WritableSignal<AssistantSupportTicketResponse | undefined>;
|
|
440
|
+
protected readonly supportTicketError: _angular_core.WritableSignal<string | undefined>;
|
|
441
|
+
protected readonly supportSeverityOptions: Array<{
|
|
442
|
+
label: string;
|
|
443
|
+
value: AssistantSupportTicketSeverity;
|
|
444
|
+
severity: AssistantSupportTagSeverity;
|
|
445
|
+
}>;
|
|
446
|
+
protected supportTicketForm: SupportTicketFormValue;
|
|
447
|
+
constructor(assistantService: MaxAssistantService, supportService: MaxAssistantSupportService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
|
|
372
448
|
ngOnInit(): void;
|
|
449
|
+
focusComposer(): void;
|
|
373
450
|
protected get uiCopy(): typeof ASSISTANT_UI_COPY;
|
|
374
451
|
protected get bootstrapConfig(): AssistantBootstrapConfig;
|
|
375
452
|
protected isWelcomeMessage(message: AssistantMessage): boolean;
|
|
@@ -379,6 +456,15 @@ declare class MaxAssistantComponent implements OnInit {
|
|
|
379
456
|
protected sendMessage(message?: string): void;
|
|
380
457
|
protected suggestionLabel(suggestion: AssistantSuggestion): string;
|
|
381
458
|
protected useSuggestion(suggestion: AssistantSuggestion): void;
|
|
459
|
+
protected performHostAction(action: AssistantHostAction): void;
|
|
460
|
+
protected requestClose(): void;
|
|
461
|
+
protected hasConversationStarted(): boolean;
|
|
462
|
+
protected openSupportTicket(): void;
|
|
463
|
+
protected closeSupportTicket(restoreComposerFocus?: boolean): void;
|
|
464
|
+
protected canSubmitSupportTicket(): boolean;
|
|
465
|
+
protected submitSupportTicket(): void;
|
|
466
|
+
protected searchResultIcon(type: string): string;
|
|
467
|
+
protected searchActionIcon(action: AssistantSearchResult['actions'][number]): string;
|
|
382
468
|
protected getTableRowActions(table: AssistantResponseTable, rowIndex: number): AssistantResponseTableAction[];
|
|
383
469
|
protected useTableAction(action: AssistantResponseTableAction): void;
|
|
384
470
|
protected resolvePendingAction(message: AssistantMessage, decision: AssistantConfirmation['decision']): void;
|
|
@@ -420,6 +506,9 @@ declare class MaxAssistantComponent implements OnInit {
|
|
|
420
506
|
private replaceMessage;
|
|
421
507
|
private createDefaultMessages;
|
|
422
508
|
private getInitialMessage;
|
|
509
|
+
private getConfiguredUser;
|
|
510
|
+
private createSupportTicketForm;
|
|
511
|
+
private getUserText;
|
|
423
512
|
private createAssistantResponseMessage;
|
|
424
513
|
private createMessage;
|
|
425
514
|
private createDisplayResponse;
|
|
@@ -440,7 +529,7 @@ declare class MaxAssistantComponent implements OnInit {
|
|
|
440
529
|
private getConversationHistory;
|
|
441
530
|
private scrollToLatest;
|
|
442
531
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantComponent, never>;
|
|
443
|
-
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,
|
|
532
|
+
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; }; }, { "hostAction": "hostAction"; "closeRequested": "closeRequested"; }, never, never, true, never>;
|
|
444
533
|
}
|
|
445
534
|
|
|
446
535
|
type MaxAgentShiftCardVariant = 'definition' | 'rota';
|
|
@@ -457,5 +546,5 @@ declare class MaxAgentShiftCardComponent {
|
|
|
457
546
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaxAgentShiftCardComponent, "max-agent-shift-card", never, { "shift": { "alias": "shift"; "required": true; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, true, never>;
|
|
458
547
|
}
|
|
459
548
|
|
|
460
|
-
export { MAX_ASSISTANT_CONFIG, MaxAgentShiftCardComponent, MaxAssistantComponent, MaxAssistantService };
|
|
461
|
-
export type { AssistantApiCall, AssistantCard, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFieldMap, AssistantFieldValue, AssistantMessage, AssistantPendingAction, AssistantProduct, AssistantRequestContext, AssistantResponseTable, AssistantResponseTableAction, AssistantResponseTableColumn, AssistantRotaCalendar, AssistantShiftCard, AssistantShiftCardGroup, AssistantSource, AssistantStructuredAction, AssistantSuggestion, AssistantToolExecution, AssistantTraceControl, AssistantTraceStep, AssistantTraceStepCategory, AssistantTraceStepMetadata, AssistantTraceStepStatus, AssistantTraceTechnology, AssistantUser, AssistantVisualisation, MaxAgentShiftCardVariant, MaxAssistantConfig };
|
|
549
|
+
export { MAX_ASSISTANT_CONFIG, MaxAgentShiftCardComponent, MaxAssistantComponent, MaxAssistantService, MaxAssistantSupportService };
|
|
550
|
+
export type { AssistantApiCall, AssistantCard, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFieldMap, AssistantFieldValue, AssistantHostAction, AssistantMessage, AssistantPendingAction, AssistantProduct, AssistantRequestContext, AssistantResponseTable, AssistantResponseTableAction, AssistantResponseTableColumn, AssistantRotaCalendar, AssistantSearchResult, AssistantShiftCard, AssistantShiftCardGroup, AssistantSource, AssistantStructuredAction, AssistantSuggestion, AssistantSupportTag, AssistantSupportTagSeverity, AssistantSupportTicketRequest, AssistantSupportTicketResponse, AssistantSupportTicketSeverity, AssistantToolExecution, AssistantTraceControl, AssistantTraceStep, AssistantTraceStepCategory, AssistantTraceStepMetadata, AssistantTraceStepStatus, AssistantTraceTechnology, AssistantUser, AssistantVisualisation, MaxAgentShiftCardVariant, MaxAssistantConfig };
|