max-agent-ui 0.0.36 → 0.0.38
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 +437 -145
- package/fesm2022/max-agent-ui.mjs.map +1 -1
- package/index.d.ts +59 -20
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, OnInit, EventEmitter, DestroyRef } from '@angular/core';
|
|
2
|
+
import { InjectionToken, OnInit, DoCheck, EventEmitter, DestroyRef } from '@angular/core';
|
|
3
3
|
import { HttpClient } from '@angular/common/http';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
|
|
@@ -30,7 +30,7 @@ interface AssistantConfirmation {
|
|
|
30
30
|
}
|
|
31
31
|
interface AssistantAnalyticsPage {
|
|
32
32
|
offset: number;
|
|
33
|
-
pageSize:
|
|
33
|
+
pageSize: 100;
|
|
34
34
|
}
|
|
35
35
|
interface AssistantStructuredAction {
|
|
36
36
|
capabilityKey: string;
|
|
@@ -206,13 +206,26 @@ interface AssistantSearchResult {
|
|
|
206
206
|
hostAction: AssistantHostAction;
|
|
207
207
|
}>;
|
|
208
208
|
}
|
|
209
|
+
type AssistantVisualisationType = 'bar' | 'horizontalBar' | 'stackedBar' | 'doughnut' | 'pie' | 'line' | 'lineStyles' | 'radar' | 'polarArea' | 'barLine';
|
|
210
|
+
interface AssistantVisualisationDataset {
|
|
211
|
+
label: string;
|
|
212
|
+
values: number[];
|
|
213
|
+
type?: 'bar' | 'line';
|
|
214
|
+
color?: string;
|
|
215
|
+
colors?: string[];
|
|
216
|
+
borderDash?: number[];
|
|
217
|
+
fill?: boolean;
|
|
218
|
+
}
|
|
209
219
|
interface AssistantVisualisation {
|
|
210
|
-
type:
|
|
220
|
+
type: AssistantVisualisationType;
|
|
211
221
|
title: string;
|
|
212
222
|
labels: string[];
|
|
213
223
|
values: number[];
|
|
214
224
|
colors?: string[];
|
|
215
225
|
valueLabel?: string;
|
|
226
|
+
datasets?: AssistantVisualisationDataset[];
|
|
227
|
+
xAxisLabel?: string;
|
|
228
|
+
yAxisLabel?: string;
|
|
216
229
|
}
|
|
217
230
|
interface AssistantShiftCard {
|
|
218
231
|
id?: string | number;
|
|
@@ -262,7 +275,7 @@ interface AssistantResponseTable {
|
|
|
262
275
|
interface AssistantResponseTablePagination {
|
|
263
276
|
query: string;
|
|
264
277
|
offset: number;
|
|
265
|
-
pageSize:
|
|
278
|
+
pageSize: 100;
|
|
266
279
|
totalRecords: number;
|
|
267
280
|
totalRecordsExact?: boolean;
|
|
268
281
|
returnedRecords: number;
|
|
@@ -331,6 +344,8 @@ interface AssistantFeedbackResponse {
|
|
|
331
344
|
submittedAt: string;
|
|
332
345
|
}
|
|
333
346
|
interface AssistantChatRequest {
|
|
347
|
+
conversationStateVersion?: 1;
|
|
348
|
+
conversationState?: string;
|
|
334
349
|
message: string;
|
|
335
350
|
stream?: boolean;
|
|
336
351
|
conversationId?: string;
|
|
@@ -344,17 +359,28 @@ interface AssistantChatRequest {
|
|
|
344
359
|
}
|
|
345
360
|
interface AssistantChatProgress {
|
|
346
361
|
type: 'progress';
|
|
347
|
-
stage: 'request' | 'intent_projection' | 'embedding' | 'capability_routing' | 'argument_extraction' | 'api_call' | 'action' | 'response';
|
|
362
|
+
stage: 'request' | 'authorization' | 'intent_projection' | 'embedding' | 'capability_routing' | 'argument_extraction' | 'api_call' | 'action' | 'response';
|
|
348
363
|
message: string;
|
|
349
364
|
}
|
|
350
|
-
|
|
365
|
+
interface AssistantChatDelta {
|
|
366
|
+
type: 'delta';
|
|
367
|
+
delta: string;
|
|
368
|
+
}
|
|
369
|
+
interface AssistantChatData {
|
|
370
|
+
type: 'data';
|
|
371
|
+
data: Pick<AssistantChatResponse, 'displayResponse' | 'cards'>;
|
|
372
|
+
}
|
|
373
|
+
type AssistantChatActivity = AssistantChatProgress | AssistantChatDelta | AssistantChatData;
|
|
374
|
+
type AssistantChatStreamEvent = AssistantChatActivity | {
|
|
351
375
|
type: 'result';
|
|
352
376
|
response: AssistantChatResponse;
|
|
353
377
|
} | {
|
|
354
378
|
type: 'error';
|
|
355
379
|
message: string;
|
|
380
|
+
code?: string;
|
|
356
381
|
};
|
|
357
382
|
interface AssistantChatResponse {
|
|
383
|
+
conversationState?: string;
|
|
358
384
|
answer: string;
|
|
359
385
|
conversationId: string;
|
|
360
386
|
product: string;
|
|
@@ -417,6 +443,8 @@ interface AssistantMessage {
|
|
|
417
443
|
capabilityKey?: string;
|
|
418
444
|
isError?: boolean;
|
|
419
445
|
isStreaming?: boolean;
|
|
446
|
+
processingUpdates?: AssistantChatProgress[];
|
|
447
|
+
streamingContent?: string;
|
|
420
448
|
}
|
|
421
449
|
|
|
422
450
|
interface AssistantBootstrapConfig {
|
|
@@ -426,6 +454,9 @@ interface AssistantBootstrapConfig {
|
|
|
426
454
|
}
|
|
427
455
|
|
|
428
456
|
interface MaxAssistantConfig {
|
|
457
|
+
/** Per-request transient state supplied by the assistant, never persisted by the host. */
|
|
458
|
+
conversationStateVersion?: 1;
|
|
459
|
+
conversationState?: string;
|
|
429
460
|
apiBaseUrl?: string;
|
|
430
461
|
assistantApiUrl?: string;
|
|
431
462
|
app?: AssistantProduct;
|
|
@@ -439,7 +470,7 @@ declare class MaxAssistantService {
|
|
|
439
470
|
private readonly config;
|
|
440
471
|
private readonly http;
|
|
441
472
|
constructor(config: MaxAssistantConfig, http: HttpClient | null);
|
|
442
|
-
sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig, confirmation?: AssistantConfirmation, history?: AssistantConversationMessage[], onProgress?: (
|
|
473
|
+
sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig, confirmation?: AssistantConfirmation, history?: AssistantConversationMessage[], onProgress?: (activity: AssistantChatActivity) => void): Observable<AssistantChatResponse>;
|
|
443
474
|
confirmAction(actionId: number, decision: AssistantConfirmation['decision'], conversationId: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
|
|
444
475
|
sendStructuredAction(message: string, action: AssistantStructuredAction, conversationId?: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
|
|
445
476
|
retrieveAnalyticsPage(message: string, analyticsPage: AssistantAnalyticsPage, conversationId?: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
|
|
@@ -475,12 +506,9 @@ declare class MaxAssistantFeedbackService {
|
|
|
475
506
|
|
|
476
507
|
declare class MaxAssistantExportService {
|
|
477
508
|
exportTableToExcel(table: AssistantResponseTable): Promise<void>;
|
|
478
|
-
exportVisualisationToPdf(visualisation: AssistantVisualisation): Promise<void>;
|
|
479
|
-
private chartTotal;
|
|
509
|
+
exportVisualisationToPdf(visualisation: AssistantVisualisation, visualisationElement: HTMLElement): Promise<void>;
|
|
480
510
|
private toExportCellValue;
|
|
481
511
|
private exportFileName;
|
|
482
|
-
private fallbackColor;
|
|
483
|
-
private pdfColor;
|
|
484
512
|
private downloadFile;
|
|
485
513
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAssistantExportService, never>;
|
|
486
514
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaxAssistantExportService>;
|
|
@@ -537,15 +565,19 @@ interface AssistantEntitySuggestionOption extends AssistantSuggestionOption {
|
|
|
537
565
|
presentation: 'person_card' | 'entity_tag';
|
|
538
566
|
entity: AssistantSuggestionEntity;
|
|
539
567
|
}
|
|
540
|
-
declare class MaxAssistantComponent implements OnInit {
|
|
568
|
+
declare class MaxAssistantComponent implements OnInit, DoCheck {
|
|
541
569
|
private readonly assistantService;
|
|
542
570
|
private readonly exportService;
|
|
543
571
|
private readonly feedbackService;
|
|
544
572
|
private readonly supportService;
|
|
545
573
|
private readonly destroyRef;
|
|
546
574
|
private readonly defaultConfig;
|
|
575
|
+
private readonly sessionState;
|
|
547
576
|
private messagesViewport?;
|
|
548
577
|
private activeTurnAnchorMessageId?;
|
|
578
|
+
private scrollToLatestTimer?;
|
|
579
|
+
private readonly visualisationDataCache;
|
|
580
|
+
private readonly visualisationOptionsCache;
|
|
549
581
|
private composerInput?;
|
|
550
582
|
private supportQueryInput?;
|
|
551
583
|
private feedbackInput?;
|
|
@@ -585,6 +617,9 @@ declare class MaxAssistantComponent implements OnInit {
|
|
|
585
617
|
protected supportTicketForm: SupportTicketFormValue;
|
|
586
618
|
constructor(assistantService: MaxAssistantService, exportService: MaxAssistantExportService, feedbackService: MaxAssistantFeedbackService, supportService: MaxAssistantSupportService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
|
|
587
619
|
ngOnInit(): void;
|
|
620
|
+
ngDoCheck(): void;
|
|
621
|
+
resetSession(): void;
|
|
622
|
+
protected onPageHide(): void;
|
|
588
623
|
focusComposer(): void;
|
|
589
624
|
protected get uiCopy(): typeof ASSISTANT_UI_COPY;
|
|
590
625
|
protected get bootstrapConfig(): AssistantBootstrapConfig;
|
|
@@ -644,14 +679,18 @@ declare class MaxAssistantComponent implements OnInit {
|
|
|
644
679
|
protected isTablePageLoading(messageId: string, tableIndex: number): boolean;
|
|
645
680
|
protected tablePageError(messageId: string, tableIndex: number): string | undefined;
|
|
646
681
|
protected exportTable(table: AssistantResponseTable): void;
|
|
647
|
-
protected exportVisualisation(visualisation: AssistantVisualisation): void;
|
|
648
|
-
protected
|
|
649
|
-
protected
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
682
|
+
protected exportVisualisation(visualisation: AssistantVisualisation, visualisationElement: HTMLElement): void;
|
|
683
|
+
protected chartType(visualisation: AssistantVisualisation): 'bar' | 'line' | 'doughnut' | 'pie' | 'radar' | 'polarArea';
|
|
684
|
+
protected chartData(visualisation: AssistantVisualisation): {
|
|
685
|
+
labels: string[];
|
|
686
|
+
datasets: Array<Record<string, unknown>>;
|
|
687
|
+
};
|
|
688
|
+
protected chartOptions(visualisation: AssistantVisualisation): Record<string, unknown>;
|
|
689
|
+
protected chartHeight(visualisation: AssistantVisualisation): number;
|
|
690
|
+
private shouldShowChartLegend;
|
|
653
691
|
protected chartAriaLabel(visualisation: AssistantVisualisation): string;
|
|
654
|
-
private
|
|
692
|
+
private chartColour;
|
|
693
|
+
private colourWithOpacity;
|
|
655
694
|
protected formatTraceValue(value: AssistantFieldValue | undefined): string;
|
|
656
695
|
protected traceMap(value: AssistantFieldValue | undefined): AssistantFieldMap | undefined;
|
|
657
696
|
protected traceMapField(value: AssistantFieldValue | undefined, key: string): AssistantFieldMap | undefined;
|
|
@@ -740,4 +779,4 @@ declare class MaxAgentShiftCardComponent {
|
|
|
740
779
|
}
|
|
741
780
|
|
|
742
781
|
export { MAX_ASSISTANT_CONFIG, MaxAgentEntityOptionComponent, MaxAgentShiftCardComponent, MaxAssistantComponent, MaxAssistantFeedbackService, MaxAssistantService, MaxAssistantSupportService };
|
|
743
|
-
export type { AssistantAnalyticsPage, AssistantApiCall, AssistantCard, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFeedbackCategory, AssistantFeedbackRequest, AssistantFeedbackResponse, AssistantFieldMap, AssistantFieldValue, AssistantHelpGuide, AssistantHelpIcon, 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 };
|
|
782
|
+
export type { AssistantAnalyticsPage, AssistantApiCall, AssistantCard, AssistantChatActivity, AssistantChatData, AssistantChatDelta, AssistantChatProgress, AssistantChatRequest, AssistantChatResponse, AssistantChatStreamEvent, AssistantConfirmation, AssistantContextResolution, AssistantConversationMessage, AssistantDeveloperTrace, AssistantDisplayResponse, AssistantExtractedIntent, AssistantFeedbackCategory, AssistantFeedbackRequest, AssistantFeedbackResponse, AssistantFieldMap, AssistantFieldValue, AssistantHelpGuide, AssistantHelpIcon, 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, AssistantVisualisationDataset, AssistantVisualisationType, MaxAgentShiftCardVariant, MaxAssistantConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "max-agent-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"@angular/common": ">=20.0.0 <22.0.0",
|
|
10
10
|
"@angular/core": ">=20.0.0 <22.0.0",
|
|
11
11
|
"@angular/forms": ">=20.0.0 <22.0.0",
|
|
12
|
+
"chart.js": ">=4.4.0 <5.0.0",
|
|
12
13
|
"primeicons": "^7.0.0",
|
|
13
14
|
"primeng": ">=20.0.0 <22.0.0",
|
|
14
15
|
"rxjs": "^7.8.0"
|