@memberjunction/ng-conversations 6.2.0-edge.5 → 6.2.0-edge.7
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/dist/lib/components/attachment/image-viewer.component.d.ts +3 -1
- package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.js +5 -1
- package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +1 -0
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +188 -9
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +1333 -464
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-mode-picker.component.js +2 -2
- package/dist/lib/components/conversation/conversation-mode-picker.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts +109 -0
- package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts.map +1 -0
- package/dist/lib/components/conversation/conversation-remote-browser-controller.js +298 -0
- package/dist/lib/components/conversation/conversation-remote-browser-controller.js.map +1 -0
- package/dist/lib/components/message/agent-handoff-card.component.d.ts +102 -0
- package/dist/lib/components/message/agent-handoff-card.component.d.ts.map +1 -0
- package/dist/lib/components/message/agent-handoff-card.component.js +439 -0
- package/dist/lib/components/message/agent-handoff-card.component.js.map +1 -0
- package/dist/lib/components/message/message-input.component.d.ts +126 -59
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +559 -554
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +34 -2
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +678 -520
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +13 -1
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +92 -39
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +19 -0
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +125 -13
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +2 -2
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js +1 -1
- package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js.map +1 -1
- package/dist/lib/components/realtime/media/media-channel-state.d.ts +5 -0
- package/dist/lib/components/realtime/media/media-channel-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/media-channel-state.js +27 -1
- package/dist/lib/components/realtime/media/media-channel-state.js.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.js +7 -2
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
- package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts +19 -2
- package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/realtime-media-surface.component.js +59 -10
- package/dist/lib/components/realtime/media/realtime-media-surface.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +22 -6
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +160 -98
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-call-failure-notice.d.ts +13 -0
- package/dist/lib/components/realtime/realtime-call-failure-notice.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-call-failure-notice.js +21 -0
- package/dist/lib/components/realtime/realtime-call-failure-notice.js.map +1 -0
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +26 -3
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +226 -120
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +73 -16
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +219 -108
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +9 -12
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.js +38 -18
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +34 -5
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts +8 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js +51 -10
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.d.ts +46 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.d.ts.map +1 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.js +64 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.js.map +1 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +131 -9
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +347 -38
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +2 -1
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +9 -4
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +5 -4
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +2 -2
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +11 -7
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -1
- package/dist/lib/models/agent-turn.model.js.map +1 -1
- package/dist/lib/services/active-tasks.service.d.ts +5 -0
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
- package/dist/lib/services/active-tasks.service.js +16 -0
- package/dist/lib/services/active-tasks.service.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +7 -1
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-permission.service.js +2 -0
- package/dist/lib/services/artifact-permission.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +1 -0
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
- package/dist/lib/services/collection-permission.service.js +1 -0
- package/dist/lib/services/collection-permission.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +38 -16
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +57 -71
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-detail-window.store.d.ts +5 -0
- package/dist/lib/services/conversation-detail-window.store.d.ts.map +1 -1
- package/dist/lib/services/conversation-detail-window.store.js +52 -5
- package/dist/lib/services/conversation-detail-window.store.js.map +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts +2 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +2 -1
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +1 -0
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/utils/agent-failure-display.d.ts +14 -0
- package/dist/lib/utils/agent-failure-display.d.ts.map +1 -0
- package/dist/lib/utils/agent-failure-display.js +26 -0
- package/dist/lib/utils/agent-failure-display.js.map +1 -0
- package/dist/lib/utils/agent-handoff-map.d.ts +52 -0
- package/dist/lib/utils/agent-handoff-map.d.ts.map +1 -0
- package/dist/lib/utils/agent-handoff-map.js +270 -0
- package/dist/lib/utils/agent-handoff-map.js.map +1 -0
- package/dist/lib/utils/agent-turn-routing.d.ts +62 -7
- package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -1
- package/dist/lib/utils/agent-turn-routing.js +147 -6
- package/dist/lib/utils/agent-turn-routing.js.map +1 -1
- package/dist/lib/utils/decision-routing.d.ts +17 -9
- package/dist/lib/utils/decision-routing.d.ts.map +1 -1
- package/dist/lib/utils/decision-routing.js +23 -14
- package/dist/lib/utils/decision-routing.js.map +1 -1
- package/dist/lib/utils/message-list-order.d.ts +13 -0
- package/dist/lib/utils/message-list-order.d.ts.map +1 -0
- package/dist/lib/utils/message-list-order.js +31 -0
- package/dist/lib/utils/message-list-order.js.map +1 -0
- package/dist/lib/utils/pin-state.d.ts +11 -0
- package/dist/lib/utils/pin-state.d.ts.map +1 -0
- package/dist/lib/utils/pin-state.js +9 -0
- package/dist/lib/utils/pin-state.js.map +1 -0
- package/dist/lib/utils/thread-replies.d.ts +34 -0
- package/dist/lib/utils/thread-replies.d.ts.map +1 -0
- package/dist/lib/utils/thread-replies.js +49 -0
- package/dist/lib/utils/thread-replies.js.map +1 -0
- package/dist/public-api.d.ts +6 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +6 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +36 -36
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { IMetadataProvider } from '@memberjunction/core';
|
|
3
|
-
import { type RunDecisionParams, type RunDecisionResult } from '@memberjunction/graphql-dataprovider';
|
|
3
|
+
import { type RunDecisionParams, type RunDecisionResult, type AgentReplyAcknowledgement } from '@memberjunction/graphql-dataprovider';
|
|
4
4
|
import { ExecuteAgentResult, AgentExecutionProgressCallback } from '@memberjunction/ai-core-plus';
|
|
5
5
|
import { MJConversationDetailEntity } from '@memberjunction/core-entities';
|
|
6
6
|
import { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended } from '@memberjunction/ai-core-plus';
|
|
@@ -46,6 +46,24 @@ export interface IntentCheckResult {
|
|
|
46
46
|
reasoning: string;
|
|
47
47
|
targetArtifactVersionId?: string;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Where a sub-agent's reply sits in the conversation. The server sets it (only the server writes agent replies), from
|
|
51
|
+
* these checked inputs.
|
|
52
|
+
*/
|
|
53
|
+
export interface SubAgentThreading {
|
|
54
|
+
/** The message the reply threads under, when not the user's message (a delegate's reply sits under the manager's). */
|
|
55
|
+
ReplyParentId?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* An agent (the conversation manager) whose line "Continuing with **{agent}** for refinement..." the server posts
|
|
58
|
+
* before the reply; the reply threads under it.
|
|
59
|
+
*/
|
|
60
|
+
AnnouncedByAgentId?: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* The branch the turn runs on when it forks off an earlier message on another branch (such as Regenerate, which
|
|
63
|
+
* creates a new fork before running the agent while the user's message stays on its original branch).
|
|
64
|
+
*/
|
|
65
|
+
ReplyBranchId?: string | null;
|
|
66
|
+
}
|
|
49
67
|
/**
|
|
50
68
|
* Angular DI service for conversation-level agent orchestration.
|
|
51
69
|
*
|
|
@@ -68,7 +86,6 @@ export interface IntentCheckResult {
|
|
|
68
86
|
* difference vs. the original.
|
|
69
87
|
*/
|
|
70
88
|
export declare class ConversationAgentService {
|
|
71
|
-
private mentionParser;
|
|
72
89
|
private agentClientService;
|
|
73
90
|
/** GraphQL AI client - retained for RunAIPrompt (intent checking) which AgentClientService doesn't wrap */
|
|
74
91
|
private _aiClient;
|
|
@@ -80,7 +97,7 @@ export declare class ConversationAgentService {
|
|
|
80
97
|
/** @deprecated Use {@link IsProcessing$}. */
|
|
81
98
|
get isProcessing$(): Observable<boolean>;
|
|
82
99
|
private _provider;
|
|
83
|
-
constructor(_bootstrap: ConversationsRuntimeBootstrap,
|
|
100
|
+
constructor(_bootstrap: ConversationsRuntimeBootstrap, _mentionParser: MentionParserService, agentClientService: AgentClientService);
|
|
84
101
|
/**
|
|
85
102
|
* The metadata provider this service uses. When unset, falls back to Metadata.Provider.
|
|
86
103
|
* Setting it re-initializes the AI client and forwards the provider to the runtime's runner.
|
|
@@ -123,19 +140,21 @@ export declare class ConversationAgentService {
|
|
|
123
140
|
* Process a message through the conversation manager agent. Delegates to
|
|
124
141
|
* `ConversationsRuntime.Instance.AgentRunner.processMessage(...)`.
|
|
125
142
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
143
|
+
* The unused `conversationHistory` parameter is kept for backwards compatibility (it was already
|
|
144
|
+
* documented as "kept for backwards compatibility but not used" in the original).
|
|
145
|
+
*
|
|
146
|
+
* @param onReplyAccepted Called with the reply row the server creates for the turn (only the server
|
|
147
|
+
* writes agent replies), before any progress: key the turn's task and completion by its ID.
|
|
131
148
|
*/
|
|
132
|
-
ProcessMessage(conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[],
|
|
149
|
+
ProcessMessage(conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], onReplyAccepted: (reply: AgentReplyAcknowledgement) => void, onProgress?: AgentExecutionProgressCallback, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[],
|
|
133
150
|
/** The agents the conversation manager may delegate to. Null or omitted allows every agent. */
|
|
134
151
|
allowedAgentIDs?: readonly string[] | null,
|
|
135
152
|
/** The first moment of the conversation the run may read. Null or omitted reads all of it. */
|
|
136
|
-
agentHistoryFrom?: Date | null
|
|
153
|
+
agentHistoryFrom?: Date | null,
|
|
154
|
+
/** The branch the turn runs on when it forks off an earlier message on another branch. */
|
|
155
|
+
replyBranchId?: string | null): Promise<ExecuteAgentResult | null>;
|
|
137
156
|
/** @deprecated Use {@link ProcessMessage}. */
|
|
138
|
-
processMessage(conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[],
|
|
157
|
+
processMessage(conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], onReplyAccepted: (reply: AgentReplyAcknowledgement) => void, onProgress?: AgentExecutionProgressCallback, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[], allowedAgentIDs?: readonly string[] | null, agentHistoryFrom?: Date | null, replyBranchId?: string | null): Promise<ExecuteAgentResult | null>;
|
|
139
158
|
/**
|
|
140
159
|
* Configuration preset an agent was pinned to by a previous `@mention` in this conversation.
|
|
141
160
|
*
|
|
@@ -155,8 +174,6 @@ export declare class ConversationAgentService {
|
|
|
155
174
|
* the trunk.
|
|
156
175
|
*/
|
|
157
176
|
FindConfigurationPresetForAgent(conversationId: string, agentId: string, branchId?: string | null): Promise<string | undefined>;
|
|
158
|
-
/** Returns the configId this message pins for `agentId`, or null when it pins none. */
|
|
159
|
-
private readAgentConfigFromMention;
|
|
160
177
|
/**
|
|
161
178
|
* Clear the session for a conversation (useful when starting a new topic)
|
|
162
179
|
*/
|
|
@@ -176,12 +193,17 @@ export declare class ConversationAgentService {
|
|
|
176
193
|
*
|
|
177
194
|
* Stays on the Angular shim because it directly uses AgentClientService.
|
|
178
195
|
* Could move to the runtime in a follow-up if needed.
|
|
196
|
+
*
|
|
197
|
+
* @param onReplyAccepted Called with the reply row the server creates for the run (only the server
|
|
198
|
+
* writes agent replies), before any progress: key the run's task and completion by its ID.
|
|
179
199
|
*/
|
|
180
|
-
InvokeSubAgent(agentName: string, conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], reasoning: string,
|
|
200
|
+
InvokeSubAgent(agentName: string, conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], reasoning: string, onReplyAccepted: (reply: AgentReplyAcknowledgement) => void, payload?: Record<string, unknown> | null, onProgress?: AgentExecutionProgressCallback, sourceArtifactId?: string, sourceArtifactVersionId?: string, agentConfigurationPresetId?: string, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[],
|
|
181
201
|
/** The first moment of the conversation the run may read. Null or omitted reads all of it. */
|
|
182
|
-
agentHistoryFrom?: Date | null
|
|
202
|
+
agentHistoryFrom?: Date | null,
|
|
203
|
+
/** Where the reply sits in the conversation. Omitted, it answers `message` directly. */
|
|
204
|
+
threading?: SubAgentThreading | null): Promise<ExecuteAgentResult | null>;
|
|
183
205
|
/** @deprecated Use {@link InvokeSubAgent}. */
|
|
184
|
-
invokeSubAgent(agentName: string, conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], reasoning: string,
|
|
206
|
+
invokeSubAgent(agentName: string, conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], reasoning: string, onReplyAccepted: (reply: AgentReplyAcknowledgement) => void, payload?: Record<string, unknown> | null, onProgress?: AgentExecutionProgressCallback, sourceArtifactId?: string, sourceArtifactVersionId?: string, agentConfigurationPresetId?: string, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[], agentHistoryFrom?: Date | null, threading?: SubAgentThreading | null): Promise<ExecuteAgentResult | null>;
|
|
185
207
|
/**
|
|
186
208
|
* Check if user's latest message should continue with the previous agent or route through Sage.
|
|
187
209
|
* Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAyB,iBAAiB,EAAqB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAwC,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAC5K,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAkC,MAAM,8BAA8B,CAAC;AAElI,OAAO,EAEL,0BAA0B,EAG3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;;AAWzC;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAC7D,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,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B,CAAC;IAI7B;;;;;;;OAOG;IACU,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAO/E;;;;;;;;OAQG;IACU,kBAAkB,CAC7B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAIlC;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,qBAAqB;IAqCnC,kEAAkE;YACpD,iBAAiB;IAoB/B;;;;;;;;;;;;;;;;;;OAkBG;IACU,4BAA4B,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAKrC;;;;;;;;;OASG;YACW,wBAAwB;IAiBtC;;;;;;;;;OASG;YACW,aAAa;IA4B3B;;;;;;;;;OASG;YACW,gBAAgB;IAU9B;;;;;;OAMG;IACU,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAI3F;;;;;OAKG;YACW,qBAAqB;yCApxBxB,wBAAwB;6CAAxB,wBAAwB;CAqzBpC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Metadata, RunView } from '@memberjunction/core';
|
|
2
|
+
import { LogStatusEx, Metadata, RunView } from '@memberjunction/core';
|
|
3
3
|
import { GraphQLAIClient } from '@memberjunction/graphql-dataprovider';
|
|
4
4
|
import { coerceFailedExecuteAgentResult } from '@memberjunction/ai-core-plus';
|
|
5
|
-
import { AIEngineBase } from '@memberjunction/ai-engine-base';
|
|
5
|
+
import { AIEngineBase, FindMentionPinnedPresetID } from '@memberjunction/ai-engine-base';
|
|
6
6
|
import { ConversationEngine } from '@memberjunction/core-entities';
|
|
7
7
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
8
8
|
import { ConversationsRuntime } from '@memberjunction/conversations-runtime';
|
|
@@ -12,11 +12,6 @@ import * as i0 from "@angular/core";
|
|
|
12
12
|
import * as i1 from "./conversations-runtime-bootstrap.service";
|
|
13
13
|
import * as i2 from "./mention-parser.service";
|
|
14
14
|
import * as i3 from "@memberjunction/ng-agent-client";
|
|
15
|
-
/**
|
|
16
|
-
* Rows the configuration-preset lookup parses before giving up. The SQL prefilter is a LIKE,
|
|
17
|
-
* so a few candidates may not be real mention blobs; this bounds how many we inspect.
|
|
18
|
-
*/
|
|
19
|
-
const CONFIG_PRESET_CANDIDATE_ROWS = 5;
|
|
20
15
|
/**
|
|
21
16
|
* Cap on artifact versions listed for the intent classifier.
|
|
22
17
|
*
|
|
@@ -47,7 +42,6 @@ const MAX_AGENT_ARTIFACT_VERSIONS = 40;
|
|
|
47
42
|
* difference vs. the original.
|
|
48
43
|
*/
|
|
49
44
|
export class ConversationAgentService {
|
|
50
|
-
mentionParser;
|
|
51
45
|
agentClientService;
|
|
52
46
|
/** GraphQL AI client - retained for RunAIPrompt (intent checking) which AgentClientService doesn't wrap */
|
|
53
47
|
_aiClient = null;
|
|
@@ -61,8 +55,7 @@ export class ConversationAgentService {
|
|
|
61
55
|
return this.IsProcessing$;
|
|
62
56
|
}
|
|
63
57
|
_provider = null;
|
|
64
|
-
constructor(_bootstrap,
|
|
65
|
-
this.mentionParser = mentionParser;
|
|
58
|
+
constructor(_bootstrap, _mentionParser, agentClientService) {
|
|
66
59
|
this.agentClientService = agentClientService;
|
|
67
60
|
// Injecting `_bootstrap` forces the runtime's INotificationAdapter +
|
|
68
61
|
// IActiveTaskTracker adapters to register before any shim method runs.
|
|
@@ -163,17 +156,19 @@ export class ConversationAgentService {
|
|
|
163
156
|
* Process a message through the conversation manager agent. Delegates to
|
|
164
157
|
* `ConversationsRuntime.Instance.AgentRunner.processMessage(...)`.
|
|
165
158
|
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
159
|
+
* The unused `conversationHistory` parameter is kept for backwards compatibility (it was already
|
|
160
|
+
* documented as "kept for backwards compatibility but not used" in the original).
|
|
161
|
+
*
|
|
162
|
+
* @param onReplyAccepted Called with the reply row the server creates for the turn (only the server
|
|
163
|
+
* writes agent replies), before any progress: key the turn's task and completion by its ID.
|
|
171
164
|
*/
|
|
172
|
-
async ProcessMessage(conversationId, message, conversationHistory,
|
|
165
|
+
async ProcessMessage(conversationId, message, conversationHistory, onReplyAccepted, onProgress, appContext, planMode, requestedSkillIDs,
|
|
173
166
|
/** The agents the conversation manager may delegate to. Null or omitted allows every agent. */
|
|
174
167
|
allowedAgentIDs,
|
|
175
168
|
/** The first moment of the conversation the run may read. Null or omitted reads all of it. */
|
|
176
|
-
agentHistoryFrom
|
|
169
|
+
agentHistoryFrom,
|
|
170
|
+
/** The branch the turn runs on when it forks off an earlier message on another branch. */
|
|
171
|
+
replyBranchId) {
|
|
177
172
|
// Warm the cached default-agent name for any synchronous consumers
|
|
178
173
|
// before the runtime resolves on its own.
|
|
179
174
|
if (!this._conversationManagerAgent) {
|
|
@@ -182,18 +177,19 @@ export class ConversationAgentService {
|
|
|
182
177
|
return ConversationsRuntime.Instance.AgentRunner.processMessage({
|
|
183
178
|
conversationId,
|
|
184
179
|
message,
|
|
185
|
-
|
|
180
|
+
onReplyAccepted,
|
|
186
181
|
appContext,
|
|
187
182
|
onProgress,
|
|
188
183
|
...(planMode ? { planMode: true } : {}),
|
|
189
184
|
...(requestedSkillIDs?.length ? { requestedSkillIDs } : {}),
|
|
190
185
|
...(allowedAgentIDs != null ? { AllowedAgentIDs: allowedAgentIDs } : {}),
|
|
191
186
|
...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),
|
|
187
|
+
...(replyBranchId ? { ReplyBranchID: replyBranchId } : {}),
|
|
192
188
|
});
|
|
193
189
|
}
|
|
194
190
|
/** @deprecated Use {@link ProcessMessage}. */
|
|
195
|
-
async processMessage(conversationId, message, conversationHistory,
|
|
196
|
-
return this.ProcessMessage(conversationId, message, conversationHistory,
|
|
191
|
+
async processMessage(conversationId, message, conversationHistory, onReplyAccepted, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom, replyBranchId) {
|
|
192
|
+
return this.ProcessMessage(conversationId, message, conversationHistory, onReplyAccepted, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom, replyBranchId);
|
|
197
193
|
}
|
|
198
194
|
/**
|
|
199
195
|
* Configuration preset an agent was pinned to by a previous `@mention` in this conversation.
|
|
@@ -214,43 +210,11 @@ export class ConversationAgentService {
|
|
|
214
210
|
* the trunk.
|
|
215
211
|
*/
|
|
216
212
|
async FindConfigurationPresetForAgent(conversationId, agentId, branchId) {
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
|
|
213
|
+
const configurationId = await FindMentionPinnedPresetID(conversationId, agentId, branchId, this.Provider.CurrentUser ?? undefined, this.Provider);
|
|
214
|
+
if (configurationId) {
|
|
215
|
+
console.log(`\u{1F3AF} Found configuration preset from @mention: ${configurationId}`);
|
|
220
216
|
}
|
|
221
|
-
|
|
222
|
-
const result = await rv.RunView({
|
|
223
|
-
EntityName: 'MJ: Conversation Details',
|
|
224
|
-
ExtraFilter: `${pathFilter} AND Role='User'`
|
|
225
|
-
+ ` AND Message LIKE '%"configId"%' AND Message LIKE '%${agentId}%'`,
|
|
226
|
-
OrderBy: 'Sequence DESC',
|
|
227
|
-
// >1 because LIKE cannot tell a mention blob from the same id appearing elsewhere in
|
|
228
|
-
// the prose; the parse below is authoritative and picks the newest genuine match.
|
|
229
|
-
MaxRows: CONFIG_PRESET_CANDIDATE_ROWS,
|
|
230
|
-
Fields: ['ID', 'Message'],
|
|
231
|
-
ResultType: 'simple'
|
|
232
|
-
}, this.Provider.CurrentUser ?? undefined);
|
|
233
|
-
if (!result.Success) {
|
|
234
|
-
console.error('Failed to resolve configuration preset:', result.ErrorMessage);
|
|
235
|
-
return undefined;
|
|
236
|
-
}
|
|
237
|
-
for (const row of result.Results || []) {
|
|
238
|
-
const configurationId = this.readAgentConfigFromMention(row.Message, agentId);
|
|
239
|
-
if (configurationId) {
|
|
240
|
-
console.log(`\u{1F3AF} Found configuration preset from @mention: ${configurationId}`);
|
|
241
|
-
return configurationId;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
/** Returns the configId this message pins for `agentId`, or null when it pins none. */
|
|
247
|
-
readAgentConfigFromMention(message, agentId) {
|
|
248
|
-
if (!message) {
|
|
249
|
-
return null;
|
|
250
|
-
}
|
|
251
|
-
const parsed = this.mentionParser.parseMentions(message, AIEngineBase.Instance.ReadableAgents, []);
|
|
252
|
-
const mention = parsed.agentMention;
|
|
253
|
-
return mention?.id === agentId && mention.configurationId ? mention.configurationId : null;
|
|
217
|
+
return configurationId;
|
|
254
218
|
}
|
|
255
219
|
/**
|
|
256
220
|
* Clear the session for a conversation (useful when starting a new topic)
|
|
@@ -285,10 +249,15 @@ export class ConversationAgentService {
|
|
|
285
249
|
*
|
|
286
250
|
* Stays on the Angular shim because it directly uses AgentClientService.
|
|
287
251
|
* Could move to the runtime in a follow-up if needed.
|
|
252
|
+
*
|
|
253
|
+
* @param onReplyAccepted Called with the reply row the server creates for the run (only the server
|
|
254
|
+
* writes agent replies), before any progress: key the run's task and completion by its ID.
|
|
288
255
|
*/
|
|
289
|
-
async InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning,
|
|
256
|
+
async InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, onReplyAccepted, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs,
|
|
290
257
|
/** The first moment of the conversation the run may read. Null or omitted reads all of it. */
|
|
291
|
-
agentHistoryFrom
|
|
258
|
+
agentHistoryFrom,
|
|
259
|
+
/** Where the reply sits in the conversation. Omitted, it answers `message` directly. */
|
|
260
|
+
threading) {
|
|
292
261
|
try {
|
|
293
262
|
// Ensure AIEngineBase is configured
|
|
294
263
|
await AIEngineBase.Instance.Config(false);
|
|
@@ -303,7 +272,11 @@ export class ConversationAgentService {
|
|
|
303
272
|
if (requestedSkillIDs?.length) {
|
|
304
273
|
this.warnOnUnacceptedSkills(agent, requestedSkillIDs);
|
|
305
274
|
}
|
|
306
|
-
|
|
275
|
+
LogStatusEx({
|
|
276
|
+
message: `Invoking sub-agent: ${agentName}`,
|
|
277
|
+
verboseOnly: true,
|
|
278
|
+
additionalArgs: [{ reasoning, hasPayload: !!payload, hasConfigPreset: !!agentConfigurationPresetId }]
|
|
279
|
+
});
|
|
307
280
|
// Map AIAgentConfiguration preset ID to actual AIConfiguration ID
|
|
308
281
|
let aiConfigurationId = undefined;
|
|
309
282
|
if (agentConfigurationPresetId) {
|
|
@@ -311,14 +284,18 @@ export class ConversationAgentService {
|
|
|
311
284
|
const preset = presets.find(p => UUIDsEqual(p.ID, agentConfigurationPresetId) || UUIDsEqual(p.AIConfigurationID, agentConfigurationPresetId));
|
|
312
285
|
if (preset) {
|
|
313
286
|
aiConfigurationId = preset.AIConfigurationID || undefined;
|
|
314
|
-
|
|
287
|
+
LogStatusEx({ message: `Mapped agent configuration preset "${preset.Name}" to AIConfigurationID: ${aiConfigurationId || 'default'}`, verboseOnly: true });
|
|
315
288
|
}
|
|
316
289
|
else {
|
|
317
290
|
console.warn(`Agent configuration preset ${agentConfigurationPresetId} not found for agent ${agent.ID}`);
|
|
318
291
|
}
|
|
319
292
|
}
|
|
320
293
|
const agentParams = {
|
|
321
|
-
|
|
294
|
+
UserMessageId: message.ID,
|
|
295
|
+
OnAccepted: onReplyAccepted,
|
|
296
|
+
...(threading?.ReplyParentId ? { ReplyParentId: threading.ReplyParentId } : {}),
|
|
297
|
+
...(threading?.AnnouncedByAgentId ? { AnnouncedByAgentId: threading.AnnouncedByAgentId } : {}),
|
|
298
|
+
...(threading?.ReplyBranchId ? { ReplyBranchId: threading.ReplyBranchId } : {}),
|
|
322
299
|
AgentId: agent.ID,
|
|
323
300
|
MaxHistoryMessages: 20,
|
|
324
301
|
Data: {
|
|
@@ -363,8 +340,8 @@ export class ConversationAgentService {
|
|
|
363
340
|
}
|
|
364
341
|
}
|
|
365
342
|
/** @deprecated Use {@link InvokeSubAgent}. */
|
|
366
|
-
async invokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning,
|
|
367
|
-
return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning,
|
|
343
|
+
async invokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, onReplyAccepted, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom, threading) {
|
|
344
|
+
return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, onReplyAccepted, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom, threading);
|
|
368
345
|
}
|
|
369
346
|
/**
|
|
370
347
|
* Check if user's latest message should continue with the previous agent or route through Sage.
|
|
@@ -424,10 +401,14 @@ export class ConversationAgentService {
|
|
|
424
401
|
${compactHistory}${artifactContext}
|
|
425
402
|
|
|
426
403
|
**Latest User Message**: "${latestMessage}"`;
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
404
|
+
LogStatusEx({
|
|
405
|
+
message: '🔍 Checking agent continuity intent...',
|
|
406
|
+
verboseOnly: true,
|
|
407
|
+
additionalArgs: [{
|
|
408
|
+
agentName: agent.Name,
|
|
409
|
+
messagePreview: latestMessage.substring(0, 50),
|
|
410
|
+
artifactCount: agentArtifacts.length
|
|
411
|
+
}]
|
|
431
412
|
});
|
|
432
413
|
const result = await this._aiClient.RunAIPrompt({
|
|
433
414
|
promptId: prompt.ID,
|
|
@@ -444,10 +425,14 @@ ${compactHistory}${artifactContext}
|
|
|
444
425
|
const decision = parsed.continuesWith.toUpperCase();
|
|
445
426
|
const reasoning = parsed.reasoning || 'No reasoning provided';
|
|
446
427
|
const targetArtifactVersionId = parsed.targetArtifactVersionId || undefined;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
428
|
+
LogStatusEx({
|
|
429
|
+
message: `✅ Intent check result: ${decision}`,
|
|
430
|
+
verboseOnly: true,
|
|
431
|
+
additionalArgs: [{
|
|
432
|
+
reasoning,
|
|
433
|
+
targetArtifactVersionId,
|
|
434
|
+
latency: result.executionTimeMs || 'unknown'
|
|
435
|
+
}]
|
|
451
436
|
});
|
|
452
437
|
if (decision === 'YES' || decision === 'NO' || decision === 'UNSURE') {
|
|
453
438
|
return {
|
|
@@ -679,6 +664,7 @@ ${compactHistory}${artifactContext}
|
|
|
679
664
|
ExtraFilter: extraFilter,
|
|
680
665
|
OrderBy: orderBy,
|
|
681
666
|
MaxRows: 1,
|
|
667
|
+
SkipTotalRowCount: true,
|
|
682
668
|
Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Content'],
|
|
683
669
|
ResultType: 'simple'
|
|
684
670
|
}, this.Provider.CurrentUser ?? undefined);
|