max-agent-ui 0.0.15 → 0.0.17
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 +22 -5
- package/fesm2022/max-agent-ui.mjs +109 -44
- package/fesm2022/max-agent-ui.mjs.map +1 -1
- package/index.d.ts +71 -14
- 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, DestroyRef } from '@angular/core';
|
|
2
|
+
import { InjectionToken, OnInit, DestroyRef } from '@angular/core';
|
|
3
3
|
import { HttpClient } from '@angular/common/http';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
|
|
@@ -152,8 +152,52 @@ interface AssistantDisplayResponse {
|
|
|
152
152
|
sampleJsonResponse?: AssistantFieldValue | AssistantFieldMap;
|
|
153
153
|
grid?: AssistantResponseTable[];
|
|
154
154
|
tables?: AssistantResponseTable[];
|
|
155
|
+
visualisations?: AssistantVisualisation[];
|
|
156
|
+
shiftCardGroups?: AssistantShiftCardGroup[];
|
|
157
|
+
rota?: AssistantRotaCalendar;
|
|
155
158
|
markdown?: string;
|
|
156
159
|
}
|
|
160
|
+
interface AssistantVisualisation {
|
|
161
|
+
type: 'doughnut' | 'bar';
|
|
162
|
+
title: string;
|
|
163
|
+
labels: string[];
|
|
164
|
+
values: number[];
|
|
165
|
+
colors?: string[];
|
|
166
|
+
}
|
|
167
|
+
interface AssistantShiftCard {
|
|
168
|
+
id?: string | number;
|
|
169
|
+
startTime: string;
|
|
170
|
+
endTime: string;
|
|
171
|
+
days?: string;
|
|
172
|
+
code?: string;
|
|
173
|
+
description?: string;
|
|
174
|
+
role?: string;
|
|
175
|
+
location?: string;
|
|
176
|
+
departments?: string[];
|
|
177
|
+
taskCount?: number;
|
|
178
|
+
color?: string;
|
|
179
|
+
}
|
|
180
|
+
interface AssistantShiftCardGroup {
|
|
181
|
+
title: string;
|
|
182
|
+
shifts: AssistantShiftCard[];
|
|
183
|
+
}
|
|
184
|
+
interface AssistantRotaCalendar {
|
|
185
|
+
title: string;
|
|
186
|
+
startDate?: string;
|
|
187
|
+
weeksCount: number;
|
|
188
|
+
autoPublish?: string;
|
|
189
|
+
contracted?: string;
|
|
190
|
+
weeks: Array<{
|
|
191
|
+
week: number;
|
|
192
|
+
duration?: string;
|
|
193
|
+
days: Array<{
|
|
194
|
+
day: number;
|
|
195
|
+
label: string;
|
|
196
|
+
period?: string;
|
|
197
|
+
shifts: AssistantShiftCard[];
|
|
198
|
+
}>;
|
|
199
|
+
}>;
|
|
200
|
+
}
|
|
157
201
|
interface AssistantResponseTableColumn {
|
|
158
202
|
field: string;
|
|
159
203
|
header: string;
|
|
@@ -301,27 +345,22 @@ declare class MaxAssistantService {
|
|
|
301
345
|
declare const ASSISTANT_UI_COPY: {
|
|
302
346
|
title: string;
|
|
303
347
|
subtitle: string;
|
|
304
|
-
launcherLabel: string;
|
|
305
|
-
openTooltip: string;
|
|
306
|
-
closeLabel: string;
|
|
307
348
|
clearLabel: string;
|
|
308
349
|
clearTooltip: string;
|
|
309
350
|
placeholder: string;
|
|
310
351
|
startingMessage: string;
|
|
311
352
|
errorMessage: string;
|
|
312
353
|
};
|
|
313
|
-
declare class MaxAssistantComponent {
|
|
354
|
+
declare class MaxAssistantComponent implements OnInit {
|
|
314
355
|
private readonly assistantService;
|
|
315
356
|
private readonly destroyRef;
|
|
316
357
|
private readonly defaultConfig;
|
|
317
|
-
private launcher?;
|
|
318
358
|
private messagesViewport?;
|
|
319
359
|
app?: AssistantProduct;
|
|
320
360
|
assistantApiUrl?: string;
|
|
321
361
|
user?: Partial<AssistantUser> | (() => Partial<AssistantUser>);
|
|
322
362
|
context?: Partial<AssistantRequestContext> | (() => Partial<AssistantRequestContext>);
|
|
323
363
|
requestHeaders?: Record<string, string> | (() => Record<string, string>);
|
|
324
|
-
protected readonly panelVisible: _angular_core.WritableSignal<boolean>;
|
|
325
364
|
protected readonly isSending: _angular_core.WritableSignal<boolean>;
|
|
326
365
|
protected readonly input: _angular_core.WritableSignal<string>;
|
|
327
366
|
protected readonly conversationId: _angular_core.WritableSignal<string | undefined>;
|
|
@@ -330,14 +369,11 @@ declare class MaxAssistantComponent {
|
|
|
330
369
|
protected readonly expandedTraceStepKeys: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
331
370
|
protected readonly developerDetailsEnabled: boolean;
|
|
332
371
|
constructor(assistantService: MaxAssistantService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
|
|
333
|
-
|
|
334
|
-
protected togglePanel(): void;
|
|
335
|
-
protected get launcherLabel(): string;
|
|
372
|
+
ngOnInit(): void;
|
|
336
373
|
protected get uiCopy(): typeof ASSISTANT_UI_COPY;
|
|
337
374
|
protected get bootstrapConfig(): AssistantBootstrapConfig;
|
|
338
375
|
protected isWelcomeMessage(message: AssistantMessage): boolean;
|
|
339
376
|
protected isWelcomeState(message: AssistantMessage): boolean;
|
|
340
|
-
protected closePanel(): void;
|
|
341
377
|
protected onDocumentEscape(): void;
|
|
342
378
|
protected clearChatSession(): void;
|
|
343
379
|
protected sendMessage(message?: string): void;
|
|
@@ -353,6 +389,13 @@ declare class MaxAssistantComponent {
|
|
|
353
389
|
protected isTraceStepExpanded(messageId: string, stepId: number): boolean;
|
|
354
390
|
protected toggleTraceStep(messageId: string, stepId: number): void;
|
|
355
391
|
protected getResponseGrid(responseDetails: AssistantDisplayResponse): AssistantResponseTable[];
|
|
392
|
+
protected chartTotal(visualisation: AssistantVisualisation): number;
|
|
393
|
+
protected chartColor(visualisation: AssistantVisualisation, index: number): string;
|
|
394
|
+
protected doughnutDashArray(visualisation: AssistantVisualisation, index: number): string;
|
|
395
|
+
protected doughnutDashOffset(visualisation: AssistantVisualisation, index: number): number;
|
|
396
|
+
protected barWidth(visualisation: AssistantVisualisation, index: number): number;
|
|
397
|
+
protected chartAriaLabel(visualisation: AssistantVisualisation): string;
|
|
398
|
+
private chartPercentage;
|
|
356
399
|
protected formatTraceValue(value: AssistantFieldValue | undefined): string;
|
|
357
400
|
protected traceMap(value: AssistantFieldValue | undefined): AssistantFieldMap | undefined;
|
|
358
401
|
protected traceMapField(value: AssistantFieldValue | undefined, key: string): AssistantFieldMap | undefined;
|
|
@@ -397,8 +440,22 @@ declare class MaxAssistantComponent {
|
|
|
397
440
|
private getConversationHistory;
|
|
398
441
|
private scrollToLatest;
|
|
399
442
|
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,
|
|
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, ["[maxAssistantHeaderAction]"], true, never>;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
type MaxAgentShiftCardVariant = 'definition' | 'rota';
|
|
447
|
+
declare class MaxAgentShiftCardComponent {
|
|
448
|
+
shift: AssistantShiftCard;
|
|
449
|
+
variant: MaxAgentShiftCardVariant;
|
|
450
|
+
protected get accentColor(): string;
|
|
451
|
+
protected get timeLabel(): string;
|
|
452
|
+
protected get departmentLabel(): string;
|
|
453
|
+
protected get taskLabel(): string;
|
|
454
|
+
private formatTime;
|
|
455
|
+
private formatTimeToAmPm;
|
|
456
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaxAgentShiftCardComponent, never>;
|
|
457
|
+
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>;
|
|
401
458
|
}
|
|
402
459
|
|
|
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 };
|
|
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 };
|