@acorex-platform/extension-ai-conversation-client 0.0.21
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/acorex-platform-extension-ai-conversation-client-acorex-platform-extension-ai-conversation-client-ZUV9J76R.mjs +1913 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client-acorex-platform-extension-ai-conversation-client-ZUV9J76R.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client-send-assist-chat-message.command-CMKccVFQ.mjs +96 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client-send-assist-chat-message.command-CMKccVFQ.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client-start-assist-chat.command-BGICtlcW.mjs +41 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client-start-assist-chat.command-BGICtlcW.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client.mjs +2 -0
- package/fesm2022/acorex-platform-extension-ai-conversation-client.mjs.map +1 -0
- package/package.json +24 -0
- package/types/acorex-platform-extension-ai-conversation-client.d.ts +89 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as i1 from '@acorex-platform/framework-client/core';
|
|
3
|
+
import { AXMConversationAssistResponsePort } from '@acorex-platform/module-conversation-client';
|
|
4
|
+
import { AXConversationSendMessageCommand, AXConversationMessage } from '@acorex/components/conversation';
|
|
5
|
+
|
|
6
|
+
declare class AXEAIConversationExtensionModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXEAIConversationExtensionModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXEAIConversationExtensionModule, never, [typeof i1.AXPComponentSlotModule], never>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXEAIConversationExtensionModule>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Subscribes to server-side assist SSE and forwards message patches to the in-memory realtime bus.
|
|
14
|
+
* AI generation and entity persistence run on the server ({@link AiConversationAssistResponseService}).
|
|
15
|
+
*/
|
|
16
|
+
declare class AXEConversationAssistResponseService implements AXMConversationAssistResponsePort {
|
|
17
|
+
private readonly transportService;
|
|
18
|
+
private readonly toastService;
|
|
19
|
+
private readonly translation;
|
|
20
|
+
private readonly store;
|
|
21
|
+
private readonly focus;
|
|
22
|
+
private readonly commandService;
|
|
23
|
+
private readonly injector;
|
|
24
|
+
/** Lazy: `AXConversationService` constructs the message API, which injects this port. */
|
|
25
|
+
private get conversationService();
|
|
26
|
+
private readonly messageCache;
|
|
27
|
+
private readonly conversationCache;
|
|
28
|
+
private readonly streamTasks;
|
|
29
|
+
private readonly streamReconnectTimers;
|
|
30
|
+
private readonly lastAssistSyncAt;
|
|
31
|
+
private currentUserId;
|
|
32
|
+
private composerGenerationConversationId;
|
|
33
|
+
private cancelAssistRequest;
|
|
34
|
+
private static readonly ASSIST_SYNC_MIN_INTERVAL_MS;
|
|
35
|
+
handleAfterUserMessage(conversationId: string, _userMessageId: string, _command: AXConversationSendMessageCommand, currentUserId: string): Promise<void>;
|
|
36
|
+
retryAssistResponse(conversationId: string, messageId: string): Promise<AXConversationMessage>;
|
|
37
|
+
reconcileStaleAssistPlaceholders(conversationId?: string): Promise<void>;
|
|
38
|
+
getLiveMessage(messageId: string): AXConversationMessage | null;
|
|
39
|
+
hasStreamingAssistPlaceholders(conversationId: string): Promise<boolean>;
|
|
40
|
+
mergeLiveConversationMessages(conversationId: string, persisted: AXConversationMessage[]): AXConversationMessage[];
|
|
41
|
+
private ensureAssistStreamSubscription;
|
|
42
|
+
private runAssistStream;
|
|
43
|
+
private requestAssistSync;
|
|
44
|
+
private handleAssistWireEvent;
|
|
45
|
+
private submitFrontendToolResult;
|
|
46
|
+
private showAssistToast;
|
|
47
|
+
/** Server generates the title via AI; client applies `conversation_patch` / `assist_completed.room`. */
|
|
48
|
+
private applyAssistAiTitleFromUserText;
|
|
49
|
+
/** After assist completes — memory update first; entity persist is async and must not block streaming UI. */
|
|
50
|
+
private applyAssistConversationRoomPatch;
|
|
51
|
+
/** Client fallback when server room patch is missing or peer display name is still the assist catalog label. */
|
|
52
|
+
private maybeApplyAssistAutoTitleAfterComplete;
|
|
53
|
+
private markUserMessageSeenByAssist;
|
|
54
|
+
private maybeMarkFocusedIncomingRead;
|
|
55
|
+
private applyLiveMessage;
|
|
56
|
+
/** Keeps assist bubbles below the linked user turn when client/server clocks disagree. */
|
|
57
|
+
private ensureAssistChronology;
|
|
58
|
+
/** Status can lag behind finalize metadata or transcript payload on late patches. */
|
|
59
|
+
private coerceLaggyStreamingTerminal;
|
|
60
|
+
/** Ignore out-of-order streaming patches after a terminal assist state was applied. */
|
|
61
|
+
private shouldIgnoreStaleStreamingDowngrade;
|
|
62
|
+
/**
|
|
63
|
+
* Assist-sync may reclaim a row as incomplete while the live SSE subscription is still
|
|
64
|
+
* receiving drafts (page refresh / server restart path). Never ignore cancel/supersede.
|
|
65
|
+
*/
|
|
66
|
+
private shouldIgnoreStaleIncompleteWhileLiveStreaming;
|
|
67
|
+
/** Maps streaming draft metadata into a display-friendly message for the chat renderer. */
|
|
68
|
+
private withStreamDraftForDisplay;
|
|
69
|
+
private repairAssistResponseAsComplete;
|
|
70
|
+
private warmConversationCache;
|
|
71
|
+
private syncAssistMessagesFromStore;
|
|
72
|
+
private scheduleAssistStreamReconnect;
|
|
73
|
+
private isBenignAssistStreamClose;
|
|
74
|
+
private flushLiveCacheToBus;
|
|
75
|
+
private handleAssistStreamTransportFailure;
|
|
76
|
+
/** Syncs composer Stop / spinner with assist streaming for the focused conversation. */
|
|
77
|
+
syncComposerGenerationForFocus(conversationId: string | null): Promise<void>;
|
|
78
|
+
cancelAssistGeneration(conversationId: string): Promise<void>;
|
|
79
|
+
private runCancelAssistGeneration;
|
|
80
|
+
private markComposerGenerating;
|
|
81
|
+
private syncComposerGeneratingForConversation;
|
|
82
|
+
private resolveActiveStreamingConversationId;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXEConversationAssistResponseService, never>;
|
|
84
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXEConversationAssistResponseService>;
|
|
85
|
+
}
|
|
86
|
+
/** @deprecated Use {@link AXEConversationAssistResponseService}. */
|
|
87
|
+
declare const AXCConversationAssistResponseService: typeof AXEConversationAssistResponseService;
|
|
88
|
+
|
|
89
|
+
export { AXCConversationAssistResponseService, AXEAIConversationExtensionModule, AXEConversationAssistResponseService };
|