max-agent-ui 0.0.14 → 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/fesm2022/max-agent-ui.mjs +171 -40
- package/fesm2022/max-agent-ui.mjs.map +1 -1
- package/index.d.ts +26 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -179,6 +179,7 @@ interface AssistantUser {
|
|
|
179
179
|
}
|
|
180
180
|
interface AssistantChatRequest {
|
|
181
181
|
message: string;
|
|
182
|
+
stream?: boolean;
|
|
182
183
|
conversationId?: string;
|
|
183
184
|
history: AssistantConversationMessage[];
|
|
184
185
|
app: AssistantProduct;
|
|
@@ -186,6 +187,18 @@ interface AssistantChatRequest {
|
|
|
186
187
|
confirmation?: AssistantConfirmation;
|
|
187
188
|
structuredAction?: AssistantStructuredAction;
|
|
188
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
|
+
};
|
|
189
202
|
interface AssistantChatResponse {
|
|
190
203
|
answer: string;
|
|
191
204
|
conversationId: string;
|
|
@@ -248,10 +261,12 @@ interface AssistantMessage {
|
|
|
248
261
|
actionDecision?: AssistantConfirmation['decision'];
|
|
249
262
|
capabilityKey?: string;
|
|
250
263
|
isError?: boolean;
|
|
264
|
+
isStreaming?: boolean;
|
|
251
265
|
}
|
|
252
266
|
|
|
253
267
|
interface AssistantBootstrapConfig {
|
|
254
268
|
initialMessage?: string;
|
|
269
|
+
initialDescription?: string;
|
|
255
270
|
initialSuggestions: string[];
|
|
256
271
|
}
|
|
257
272
|
|
|
@@ -268,10 +283,11 @@ declare class MaxAssistantService {
|
|
|
268
283
|
private readonly config;
|
|
269
284
|
private readonly http;
|
|
270
285
|
constructor(config: MaxAssistantConfig, http: HttpClient | null);
|
|
271
|
-
sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig, confirmation?: AssistantConfirmation, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
|
|
286
|
+
sendMessage(message: string, conversationId?: string, config?: MaxAssistantConfig, confirmation?: AssistantConfirmation, history?: AssistantConversationMessage[], onProgress?: (progress: AssistantChatProgress) => void): Observable<AssistantChatResponse>;
|
|
272
287
|
confirmAction(actionId: number, decision: AssistantConfirmation['decision'], conversationId: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
|
|
273
288
|
sendStructuredAction(message: string, action: AssistantStructuredAction, conversationId?: string, config?: MaxAssistantConfig, history?: AssistantConversationMessage[]): Observable<AssistantChatResponse>;
|
|
274
289
|
private postMessage;
|
|
290
|
+
private streamMessage;
|
|
275
291
|
private getChatUrl;
|
|
276
292
|
private getApp;
|
|
277
293
|
private getUser;
|
|
@@ -291,12 +307,13 @@ declare const ASSISTANT_UI_COPY: {
|
|
|
291
307
|
clearLabel: string;
|
|
292
308
|
clearTooltip: string;
|
|
293
309
|
placeholder: string;
|
|
294
|
-
|
|
310
|
+
startingMessage: string;
|
|
295
311
|
errorMessage: string;
|
|
296
312
|
};
|
|
297
313
|
declare class MaxAssistantComponent {
|
|
298
314
|
private readonly assistantService;
|
|
299
315
|
private readonly destroyRef;
|
|
316
|
+
private readonly defaultConfig;
|
|
300
317
|
private launcher?;
|
|
301
318
|
private messagesViewport?;
|
|
302
319
|
app?: AssistantProduct;
|
|
@@ -312,12 +329,14 @@ declare class MaxAssistantComponent {
|
|
|
312
329
|
protected readonly expandedDetailMessageIds: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
313
330
|
protected readonly expandedTraceStepKeys: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
314
331
|
protected readonly developerDetailsEnabled: boolean;
|
|
315
|
-
constructor(assistantService: MaxAssistantService, destroyRef: DestroyRef);
|
|
332
|
+
constructor(assistantService: MaxAssistantService, destroyRef: DestroyRef, defaultConfig: MaxAssistantConfig);
|
|
316
333
|
protected openPanel(): void;
|
|
317
334
|
protected togglePanel(): void;
|
|
318
335
|
protected get launcherLabel(): string;
|
|
319
336
|
protected get uiCopy(): typeof ASSISTANT_UI_COPY;
|
|
320
337
|
protected get bootstrapConfig(): AssistantBootstrapConfig;
|
|
338
|
+
protected isWelcomeMessage(message: AssistantMessage): boolean;
|
|
339
|
+
protected isWelcomeState(message: AssistantMessage): boolean;
|
|
321
340
|
protected closePanel(): void;
|
|
322
341
|
protected onDocumentEscape(): void;
|
|
323
342
|
protected clearChatSession(): void;
|
|
@@ -354,7 +373,10 @@ declare class MaxAssistantComponent {
|
|
|
354
373
|
protected formatTraceCategory(category: string): string;
|
|
355
374
|
private getAssistantConfig;
|
|
356
375
|
private appendMessage;
|
|
376
|
+
private updateStreamingMessage;
|
|
377
|
+
private replaceMessage;
|
|
357
378
|
private createDefaultMessages;
|
|
379
|
+
private getInitialMessage;
|
|
358
380
|
private createAssistantResponseMessage;
|
|
359
381
|
private createMessage;
|
|
360
382
|
private createDisplayResponse;
|
|
@@ -379,4 +401,4 @@ declare class MaxAssistantComponent {
|
|
|
379
401
|
}
|
|
380
402
|
|
|
381
403
|
export { MAX_ASSISTANT_CONFIG, MaxAssistantComponent, MaxAssistantService };
|
|
382
|
-
export type { AssistantApiCall, AssistantCard, AssistantChatRequest, AssistantChatResponse, 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 };
|
|
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 };
|