max-agent-ui 0.0.24 → 0.0.27

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 CHANGED
@@ -28,6 +28,10 @@ interface AssistantConfirmation {
28
28
  actionId: number;
29
29
  decision: 'approve' | 'reject';
30
30
  }
31
+ interface AssistantAnalyticsPage {
32
+ offset: number;
33
+ pageSize: 250;
34
+ }
31
35
  interface AssistantStructuredAction {
32
36
  capabilityKey: string;
33
37
  arguments: AssistantFieldMap;
@@ -235,6 +239,16 @@ interface AssistantResponseTable {
235
239
  columns: AssistantResponseTableColumn[];
236
240
  rows: AssistantFieldMap[];
237
241
  actions?: AssistantResponseTableAction[];
242
+ pagination?: AssistantResponseTablePagination;
243
+ }
244
+ interface AssistantResponseTablePagination {
245
+ query: string;
246
+ offset: number;
247
+ pageSize: 250;
248
+ totalRecords: number;
249
+ returnedRecords: number;
250
+ remainingRecords: number;
251
+ nextOffset?: number;
238
252
  }
239
253
  interface AssistantResponseTableAction {
240
254
  rowIndex: number;
@@ -253,11 +267,15 @@ interface AssistantUser {
253
267
  token?: string;
254
268
  version?: string;
255
269
  }
256
- type AssistantSupportTicketSeverity = 'low' | 'medium' | 'high' | 'critical';
257
270
  type AssistantSupportTagSeverity = 'success' | 'secondary' | 'info' | 'warn' | 'danger' | 'contrast';
258
- interface AssistantSupportTag {
259
- value: string;
271
+ interface AssistantSelectableEntity {
272
+ id: number;
260
273
  label: string;
274
+ }
275
+ interface AssistantSupportSeverity extends AssistantSelectableEntity {
276
+ color: string;
277
+ }
278
+ interface AssistantSupportTag extends AssistantSelectableEntity {
261
279
  icon: string;
262
280
  severity: AssistantSupportTagSeverity;
263
281
  }
@@ -267,13 +285,13 @@ interface AssistantSupportTicketRequest {
267
285
  phone?: string;
268
286
  subject: string;
269
287
  query: string;
270
- severity: AssistantSupportTicketSeverity;
271
- tags: string[];
288
+ severity: AssistantSupportSeverity;
289
+ tags: AssistantSelectableEntity[];
272
290
  app: AssistantProduct;
273
291
  }
274
292
  interface AssistantSupportTicketResponse {
275
293
  success: boolean;
276
- ticketReference: string;
294
+ ticketReference?: string;
277
295
  message: string;
278
296
  submittedAt: string;
279
297
  }
@@ -304,6 +322,7 @@ interface AssistantChatRequest {
304
322
  user?: Pick<AssistantUser, 'name' | 'username' | 'email'>;
305
323
  context?: AssistantRequestContext;
306
324
  confirmation?: AssistantConfirmation;
325
+ analyticsPage?: AssistantAnalyticsPage;
307
326
  structuredAction?: AssistantStructuredAction;
308
327
  }
309
328
  interface AssistantChatProgress {
@@ -405,6 +424,7 @@ declare class MaxAssistantService {
405
424
  sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig, confirmation?: AssistantConfirmation, history?: AssistantConversationMessage[], onProgress?: (progress: AssistantChatProgress) => void): Observable<AssistantChatResponse>;
406
425
  confirmAction(actionId: number, decision: AssistantConfirmation['decision'], conversationId: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
407
426
  sendStructuredAction(message: string, action: AssistantStructuredAction, conversationId?: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
427
+ retrieveAnalyticsPage(message: string, analyticsPage: AssistantAnalyticsPage, conversationId?: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
408
428
  private postMessage;
409
429
  private streamMessage;
410
430
  private getChatUrl;
@@ -428,12 +448,34 @@ declare class MaxAssistantFeedbackService {
428
448
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantFeedbackService>;
429
449
  }
430
450
 
451
+ declare class MaxAssistantExportService {
452
+ exportTableToExcel(table: AssistantResponseTable): Promise<void>;
453
+ exportVisualisationToPdf(visualisation: AssistantVisualisation): Promise<void>;
454
+ private chartTotal;
455
+ private toExportCellValue;
456
+ private exportFileName;
457
+ private fallbackColor;
458
+ private pdfColor;
459
+ private downloadFile;
460
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantExportService, never>;
461
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantExportService>;
462
+ }
463
+
431
464
  declare class MaxAssistantSupportService {
432
- readonly tagsEndpoint = "selection/support-tags";
433
- readonly ticketsEndpoint = "support/tickets";
465
+ private readonly config;
466
+ private readonly http;
467
+ readonly ticketsEndpoint = "/ticket";
468
+ readonly tagsEndpoint = "/selection/lookup/supportticket/tag";
469
+ readonly severitiesEndpoint = "/selection/lookup/supportticket/severity";
470
+ constructor(config: MaxAssistantConfig, http: HttpClient | null);
434
471
  getSupportTags(): Observable<AssistantSupportTag[]>;
435
- submitTicket(_ticket: AssistantSupportTicketRequest): Observable<AssistantSupportTicketResponse>;
436
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantSupportService, never>;
472
+ getSupportSeverities(): Observable<AssistantSupportSeverity[]>;
473
+ submitTicket(ticket: AssistantSupportTicketRequest, config?: MaxAssistantConfig): Observable<AssistantSupportTicketResponse>;
474
+ private toTicketResponse;
475
+ private getHeaders;
476
+ private getUser;
477
+ private mergeConfig;
478
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantSupportService, [null, { optional: true; }]>;
437
479
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantSupportService>;
438
480
  }
439
481
 
@@ -456,8 +498,8 @@ interface SupportTicketFormValue {
456
498
  phone: string;
457
499
  subject: string;
458
500
  query: string;
459
- severity: AssistantSupportTicketSeverity;
460
- tags: string[];
501
+ severity: AssistantSupportSeverity | null;
502
+ tags: AssistantSupportTag[];
461
503
  }
462
504
  interface FeedbackFormValue {
463
505
  name: string;
@@ -474,6 +516,7 @@ interface AssistantEntitySuggestionOption extends AssistantSuggestionOption {
474
516
  }
475
517
  declare class MaxAssistantComponent implements OnInit {
476
518
  private readonly assistantService;
519
+ private readonly exportService;
477
520
  private readonly feedbackService;
478
521
  private readonly supportService;
479
522
  private readonly destroyRef;
@@ -496,6 +539,8 @@ declare class MaxAssistantComponent implements OnInit {
496
539
  protected readonly messages: _angular_core.WritableSignal<AssistantMessage[]>;
497
540
  protected readonly expandedDetailMessageIds: _angular_core.WritableSignal<ReadonlySet<string>>;
498
541
  protected readonly expandedTraceStepKeys: _angular_core.WritableSignal<ReadonlySet<string>>;
542
+ protected readonly loadingTablePage: _angular_core.WritableSignal<string | undefined>;
543
+ protected readonly tablePageErrors: _angular_core.WritableSignal<Readonly<Record<string, string>>>;
499
544
  protected readonly feedbackVisible: _angular_core.WritableSignal<boolean>;
500
545
  protected readonly feedbackSubmitting: _angular_core.WritableSignal<boolean>;
501
546
  protected readonly feedbackResult: _angular_core.WritableSignal<AssistantFeedbackResponse | undefined>;
@@ -509,15 +554,12 @@ declare class MaxAssistantComponent implements OnInit {
509
554
  protected readonly supportTicketSubmitting: _angular_core.WritableSignal<boolean>;
510
555
  protected readonly supportTagsLoading: _angular_core.WritableSignal<boolean>;
511
556
  protected readonly supportTags: _angular_core.WritableSignal<AssistantSupportTag[]>;
557
+ protected readonly supportSeverities: _angular_core.WritableSignal<AssistantSupportSeverity[]>;
512
558
  protected readonly supportTicketResult: _angular_core.WritableSignal<AssistantSupportTicketResponse | undefined>;
513
559
  protected readonly supportTicketError: _angular_core.WritableSignal<string | undefined>;
514
- protected readonly supportSeverityOptions: Array<{
515
- label: string;
516
- value: AssistantSupportTicketSeverity;
517
- severity: AssistantSupportTagSeverity;
518
- }>;
560
+ protected readonly supportTicketSubmissionFailed: _angular_core.WritableSignal<boolean>;
519
561
  protected supportTicketForm: SupportTicketFormValue;
520
- constructor(assistantService: MaxAssistantService, feedbackService: MaxAssistantFeedbackService, supportService: MaxAssistantSupportService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
562
+ constructor(assistantService: MaxAssistantService, exportService: MaxAssistantExportService, feedbackService: MaxAssistantFeedbackService, supportService: MaxAssistantSupportService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
521
563
  ngOnInit(): void;
522
564
  focusComposer(): void;
523
565
  protected get uiCopy(): typeof ASSISTANT_UI_COPY;
@@ -549,6 +591,7 @@ declare class MaxAssistantComponent implements OnInit {
549
591
  protected openSupportTicket(): void;
550
592
  protected closeSupportTicket(restoreComposerFocus?: boolean): void;
551
593
  protected canSubmitSupportTicket(): boolean;
594
+ protected supportSeverityColor(color: string): string;
552
595
  protected submitSupportTicket(): void;
553
596
  protected openFeedback(responseMessage: AssistantMessage): void;
554
597
  protected closeFeedback(restoreComposerFocus?: boolean): void;
@@ -566,6 +609,14 @@ declare class MaxAssistantComponent implements OnInit {
566
609
  protected isTraceStepExpanded(messageId: string, stepId: number): boolean;
567
610
  protected toggleTraceStep(messageId: string, stepId: number): void;
568
611
  protected getResponseGrid(responseDetails: AssistantDisplayResponse): AssistantResponseTable[];
612
+ protected retrieveNextTablePage(message: AssistantMessage, table: AssistantResponseTable, tableIndex: number): void;
613
+ protected tablePageStatus(table: AssistantResponseTable): string;
614
+ protected hasNextTablePage(table: AssistantResponseTable): boolean;
615
+ protected nextTablePageLabel(pagination: AssistantResponseTablePagination): string;
616
+ protected isTablePageLoading(messageId: string, tableIndex: number): boolean;
617
+ protected tablePageError(messageId: string, tableIndex: number): string | undefined;
618
+ protected exportTable(table: AssistantResponseTable): void;
619
+ protected exportVisualisation(visualisation: AssistantVisualisation): void;
569
620
  protected chartTotal(visualisation: AssistantVisualisation): number;
570
621
  protected chartColor(visualisation: AssistantVisualisation, index: number): string;
571
622
  protected doughnutDashArray(visualisation: AssistantVisualisation, index: number): string;
@@ -595,6 +646,9 @@ declare class MaxAssistantComponent implements OnInit {
595
646
  private appendMessage;
596
647
  private updateStreamingMessage;
597
648
  private replaceMessage;
649
+ private mergeTablePage;
650
+ private mergeDeveloperTraces;
651
+ private tablePageKey;
598
652
  private createDefaultMessages;
599
653
  private getInitialMessage;
600
654
  private getConfiguredUser;
@@ -656,4 +710,4 @@ declare class MaxAgentShiftCardComponent {
656
710
  }
657
711
 
658
712
  export { MAX_ASSISTANT_CONFIG, MaxAgentEntityOptionComponent, MaxAgentShiftCardComponent, MaxAssistantComponent, MaxAssistantFeedbackService, MaxAssistantService, MaxAssistantSupportService };
659
- export type { AssistantApiCall, AssistantCard, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFeedbackCategory, AssistantFeedbackRequest, AssistantFeedbackResponse, AssistantFieldMap, AssistantFieldValue, AssistantHostAction, AssistantMessage, AssistantPendingAction, AssistantProduct, AssistantRequestContext, AssistantResponseTable, AssistantResponseTableAction, AssistantResponseTableColumn, AssistantRotaCalendar, AssistantSearchResult, AssistantShiftCard, AssistantShiftCardGroup, AssistantSource, AssistantStructuredAction, AssistantSuggestion, AssistantSuggestionEntity, AssistantSuggestionOption, AssistantSupportTag, AssistantSupportTagSeverity, AssistantSupportTicketRequest, AssistantSupportTicketResponse, AssistantSupportTicketSeverity, AssistantToolExecution, AssistantTraceControl, AssistantTraceStep, AssistantTraceStepCategory, AssistantTraceStepMetadata, AssistantTraceStepStatus, AssistantTraceTechnology, AssistantUser, AssistantVisualisation, MaxAgentShiftCardVariant, MaxAssistantConfig };
713
+ export type { AssistantAnalyticsPage, AssistantApiCall, AssistantCard, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFeedbackCategory, AssistantFeedbackRequest, AssistantFeedbackResponse, AssistantFieldMap, AssistantFieldValue, AssistantHostAction, AssistantMessage, AssistantPendingAction, AssistantProduct, AssistantRequestContext, AssistantResponseTable, AssistantResponseTableAction, AssistantResponseTableColumn, AssistantResponseTablePagination, AssistantRotaCalendar, AssistantSearchResult, AssistantSelectableEntity, AssistantShiftCard, AssistantShiftCardGroup, AssistantSource, AssistantStructuredAction, AssistantSuggestion, AssistantSuggestionEntity, AssistantSuggestionOption, AssistantSupportSeverity, AssistantSupportTag, AssistantSupportTagSeverity, AssistantSupportTicketRequest, AssistantSupportTicketResponse, AssistantToolExecution, AssistantTraceControl, AssistantTraceStep, AssistantTraceStepCategory, AssistantTraceStepMetadata, AssistantTraceStepStatus, AssistantTraceTechnology, AssistantUser, AssistantVisualisation, MaxAgentShiftCardVariant, MaxAssistantConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "max-agent-ui",
3
- "version": "0.0.24",
3
+ "version": "0.0.27",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -14,8 +14,10 @@
14
14
  "rxjs": "^7.8.0"
15
15
  },
16
16
  "dependencies": {
17
+ "jspdf": "^3.0.4",
17
18
  "marked": "18.0.7",
18
- "tslib": "^2.3.0"
19
+ "tslib": "^2.3.0",
20
+ "xlsx": "^0.18.5"
19
21
  },
20
22
  "files": [
21
23
  "fesm2022",