@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.
Files changed (164) hide show
  1. package/dist/lib/components/attachment/image-viewer.component.d.ts +3 -1
  2. package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
  3. package/dist/lib/components/attachment/image-viewer.component.js +5 -1
  4. package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
  5. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  6. package/dist/lib/components/collection/collection-view.component.js +1 -0
  7. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  8. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +188 -9
  9. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  10. package/dist/lib/components/conversation/conversation-chat-area.component.js +1333 -464
  11. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  12. package/dist/lib/components/conversation/conversation-mode-picker.component.js +2 -2
  13. package/dist/lib/components/conversation/conversation-mode-picker.component.js.map +1 -1
  14. package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts +109 -0
  15. package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts.map +1 -0
  16. package/dist/lib/components/conversation/conversation-remote-browser-controller.js +298 -0
  17. package/dist/lib/components/conversation/conversation-remote-browser-controller.js.map +1 -0
  18. package/dist/lib/components/message/agent-handoff-card.component.d.ts +102 -0
  19. package/dist/lib/components/message/agent-handoff-card.component.d.ts.map +1 -0
  20. package/dist/lib/components/message/agent-handoff-card.component.js +439 -0
  21. package/dist/lib/components/message/agent-handoff-card.component.js.map +1 -0
  22. package/dist/lib/components/message/message-input.component.d.ts +126 -59
  23. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  24. package/dist/lib/components/message/message-input.component.js +559 -554
  25. package/dist/lib/components/message/message-input.component.js.map +1 -1
  26. package/dist/lib/components/message/message-item.component.d.ts +34 -2
  27. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  28. package/dist/lib/components/message/message-item.component.js +678 -520
  29. package/dist/lib/components/message/message-item.component.js.map +1 -1
  30. package/dist/lib/components/message/message-list.component.d.ts +13 -1
  31. package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
  32. package/dist/lib/components/message/message-list.component.js +92 -39
  33. package/dist/lib/components/message/message-list.component.js.map +1 -1
  34. package/dist/lib/components/overlay/chat-overlay.component.d.ts +19 -0
  35. package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
  36. package/dist/lib/components/overlay/chat-overlay.component.js +125 -13
  37. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  38. package/dist/lib/components/project/project-form-modal.component.js +2 -2
  39. package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
  40. package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js +1 -1
  41. package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js.map +1 -1
  42. package/dist/lib/components/realtime/media/media-channel-state.d.ts +5 -0
  43. package/dist/lib/components/realtime/media/media-channel-state.d.ts.map +1 -1
  44. package/dist/lib/components/realtime/media/media-channel-state.js +27 -1
  45. package/dist/lib/components/realtime/media/media-channel-state.js.map +1 -1
  46. package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
  47. package/dist/lib/components/realtime/media/media-channel.js +7 -2
  48. package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
  49. package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts +19 -2
  50. package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts.map +1 -1
  51. package/dist/lib/components/realtime/media/realtime-media-surface.component.js +59 -10
  52. package/dist/lib/components/realtime/media/realtime-media-surface.component.js.map +1 -1
  53. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +22 -6
  54. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
  55. package/dist/lib/components/realtime/realtime-agent-banner.component.js +160 -98
  56. package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
  57. package/dist/lib/components/realtime/realtime-call-failure-notice.d.ts +13 -0
  58. package/dist/lib/components/realtime/realtime-call-failure-notice.d.ts.map +1 -0
  59. package/dist/lib/components/realtime/realtime-call-failure-notice.js +21 -0
  60. package/dist/lib/components/realtime/realtime-call-failure-notice.js.map +1 -0
  61. package/dist/lib/components/realtime/realtime-composer.component.d.ts +26 -3
  62. package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
  63. package/dist/lib/components/realtime/realtime-composer.component.js +226 -120
  64. package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
  65. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +73 -16
  66. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
  67. package/dist/lib/components/realtime/realtime-session-overlay.component.js +219 -108
  68. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  69. package/dist/lib/components/realtime/realtime-ui-config.d.ts +9 -12
  70. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
  71. package/dist/lib/components/realtime/realtime-ui-config.js +38 -18
  72. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
  73. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
  74. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +34 -5
  75. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
  76. package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts +8 -2
  77. package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts.map +1 -1
  78. package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js +51 -10
  79. package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js.map +1 -1
  80. package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.d.ts +46 -0
  81. package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.d.ts.map +1 -0
  82. package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.js +64 -0
  83. package/dist/lib/components/realtime/whiteboard/whiteboard-channel-config.js.map +1 -0
  84. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +131 -9
  85. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  86. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +347 -38
  87. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  88. package/dist/lib/conversations.module.d.ts +2 -1
  89. package/dist/lib/conversations.module.d.ts.map +1 -1
  90. package/dist/lib/conversations.module.js +9 -4
  91. package/dist/lib/conversations.module.js.map +1 -1
  92. package/dist/lib/events/chat-events.d.ts +5 -4
  93. package/dist/lib/events/chat-events.d.ts.map +1 -1
  94. package/dist/lib/events/chat-events.js +2 -2
  95. package/dist/lib/events/chat-events.js.map +1 -1
  96. package/dist/lib/models/agent-turn.model.d.ts +11 -7
  97. package/dist/lib/models/agent-turn.model.d.ts.map +1 -1
  98. package/dist/lib/models/agent-turn.model.js.map +1 -1
  99. package/dist/lib/services/active-tasks.service.d.ts +5 -0
  100. package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
  101. package/dist/lib/services/active-tasks.service.js +16 -0
  102. package/dist/lib/services/active-tasks.service.js.map +1 -1
  103. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  104. package/dist/lib/services/agent-state.service.js +7 -1
  105. package/dist/lib/services/agent-state.service.js.map +1 -1
  106. package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
  107. package/dist/lib/services/artifact-permission.service.js +2 -0
  108. package/dist/lib/services/artifact-permission.service.js.map +1 -1
  109. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  110. package/dist/lib/services/artifact-state.service.js +1 -0
  111. package/dist/lib/services/artifact-state.service.js.map +1 -1
  112. package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
  113. package/dist/lib/services/collection-permission.service.js +1 -0
  114. package/dist/lib/services/collection-permission.service.js.map +1 -1
  115. package/dist/lib/services/conversation-agent.service.d.ts +38 -16
  116. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  117. package/dist/lib/services/conversation-agent.service.js +57 -71
  118. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  119. package/dist/lib/services/conversation-detail-window.store.d.ts +5 -0
  120. package/dist/lib/services/conversation-detail-window.store.d.ts.map +1 -1
  121. package/dist/lib/services/conversation-detail-window.store.js +52 -5
  122. package/dist/lib/services/conversation-detail-window.store.js.map +1 -1
  123. package/dist/lib/services/realtime-session-review.service.d.ts +2 -1
  124. package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
  125. package/dist/lib/services/realtime-session-review.service.js.map +1 -1
  126. package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
  127. package/dist/lib/services/realtime-session.service.js +2 -1
  128. package/dist/lib/services/realtime-session.service.js.map +1 -1
  129. package/dist/lib/services/search.service.d.ts.map +1 -1
  130. package/dist/lib/services/search.service.js +1 -0
  131. package/dist/lib/services/search.service.js.map +1 -1
  132. package/dist/lib/utils/agent-failure-display.d.ts +14 -0
  133. package/dist/lib/utils/agent-failure-display.d.ts.map +1 -0
  134. package/dist/lib/utils/agent-failure-display.js +26 -0
  135. package/dist/lib/utils/agent-failure-display.js.map +1 -0
  136. package/dist/lib/utils/agent-handoff-map.d.ts +52 -0
  137. package/dist/lib/utils/agent-handoff-map.d.ts.map +1 -0
  138. package/dist/lib/utils/agent-handoff-map.js +270 -0
  139. package/dist/lib/utils/agent-handoff-map.js.map +1 -0
  140. package/dist/lib/utils/agent-turn-routing.d.ts +62 -7
  141. package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -1
  142. package/dist/lib/utils/agent-turn-routing.js +147 -6
  143. package/dist/lib/utils/agent-turn-routing.js.map +1 -1
  144. package/dist/lib/utils/decision-routing.d.ts +17 -9
  145. package/dist/lib/utils/decision-routing.d.ts.map +1 -1
  146. package/dist/lib/utils/decision-routing.js +23 -14
  147. package/dist/lib/utils/decision-routing.js.map +1 -1
  148. package/dist/lib/utils/message-list-order.d.ts +13 -0
  149. package/dist/lib/utils/message-list-order.d.ts.map +1 -0
  150. package/dist/lib/utils/message-list-order.js +31 -0
  151. package/dist/lib/utils/message-list-order.js.map +1 -0
  152. package/dist/lib/utils/pin-state.d.ts +11 -0
  153. package/dist/lib/utils/pin-state.d.ts.map +1 -0
  154. package/dist/lib/utils/pin-state.js +9 -0
  155. package/dist/lib/utils/pin-state.js.map +1 -0
  156. package/dist/lib/utils/thread-replies.d.ts +34 -0
  157. package/dist/lib/utils/thread-replies.d.ts.map +1 -0
  158. package/dist/lib/utils/thread-replies.js +49 -0
  159. package/dist/lib/utils/thread-replies.js.map +1 -0
  160. package/dist/public-api.d.ts +6 -0
  161. package/dist/public-api.d.ts.map +1 -1
  162. package/dist/public-api.js +6 -0
  163. package/dist/public-api.js.map +1 -1
  164. 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, mentionParser: MentionParserService, agentClientService: AgentClientService);
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
- * Signature is preserved verbatim from the original service so existing
127
- * call sites continue to compile. The unused `conversationHistory`
128
- * parameter is kept for backwards compatibility (it was already
129
- * documented as "kept for backwards compatibility but not used" in the
130
- * original).
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[], conversationDetailId: string, onProgress?: AgentExecutionProgressCallback, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[],
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): Promise<ExecuteAgentResult | 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[], conversationDetailId: string, onProgress?: AgentExecutionProgressCallback, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[], allowedAgentIDs?: readonly string[] | null, agentHistoryFrom?: Date | null): Promise<ExecuteAgentResult | null>;
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, conversationDetailId: string, payload?: Record<string, unknown> | null, onProgress?: AgentExecutionProgressCallback, sourceArtifactId?: string, sourceArtifactVersionId?: string, agentConfigurationPresetId?: string, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: 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): Promise<ExecuteAgentResult | 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, conversationDetailId: string, 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): Promise<ExecuteAgentResult | null>;
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,EAAY,iBAAiB,EAAqB,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAwC,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC5I,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,KAA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,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;yCAxxBxB,wBAAwB;6CAAxB,wBAAwB;CAwzBpC"}
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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ectable } 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, mentionParser, agentClientService) {
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
- * Signature is preserved verbatim from the original service so existing
167
- * call sites continue to compile. The unused `conversationHistory`
168
- * parameter is kept for backwards compatibility (it was already
169
- * documented as "kept for backwards compatibility but not used" in the
170
- * original).
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, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs,
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
- conversationDetailId,
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, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom) {
196
- return this.ProcessMessage(conversationId, message, conversationHistory, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom);
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 pathFilter = await this.branchPathFilter(conversationId, branchId);
218
- if (pathFilter == null) {
219
- return undefined;
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
- const rv = RunView.FromMetadataProvider(this.Provider);
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, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs,
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
- console.log(`Invoking sub-agent: ${agentName}`, { reasoning, hasPayload: !!payload, hasConfigPreset: !!agentConfigurationPresetId });
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
- console.log(`Mapped agent configuration preset "${preset.Name}" to AIConfigurationID: ${aiConfigurationId || 'default'}`);
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
- ConversationDetailId: conversationDetailId,
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, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom) {
367
- return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom);
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
- console.log('🔍 Checking agent continuity intent...', {
428
- agentName: agent.Name,
429
- messagePreview: latestMessage.substring(0, 50),
430
- artifactCount: agentArtifacts.length
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
- console.log(`✅ Intent check result: ${decision}`, {
448
- reasoning,
449
- targetArtifactVersionId,
450
- latency: result.executionTimeMs || 'unknown'
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);