@memberjunction/ai-agents 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 (165) hide show
  1. package/README.md +89 -2
  2. package/dist/AgentDataPreloader.d.ts +4 -2
  3. package/dist/AgentDataPreloader.d.ts.map +1 -1
  4. package/dist/AgentDataPreloader.js +21 -12
  5. package/dist/AgentDataPreloader.js.map +1 -1
  6. package/dist/AgentRunner.d.ts +150 -5
  7. package/dist/AgentRunner.d.ts.map +1 -1
  8. package/dist/AgentRunner.js +588 -64
  9. package/dist/AgentRunner.js.map +1 -1
  10. package/dist/AgentWakeTriggerService.d.ts +183 -0
  11. package/dist/AgentWakeTriggerService.d.ts.map +1 -0
  12. package/dist/AgentWakeTriggerService.js +485 -0
  13. package/dist/AgentWakeTriggerService.js.map +1 -0
  14. package/dist/ArtifactToolManager.d.ts +1 -0
  15. package/dist/ArtifactToolManager.d.ts.map +1 -1
  16. package/dist/ArtifactToolManager.js +5 -0
  17. package/dist/ArtifactToolManager.js.map +1 -1
  18. package/dist/ConversationToolManager.d.ts +1 -1
  19. package/dist/ConversationToolManager.d.ts.map +1 -1
  20. package/dist/ConversationToolManager.js +10 -4
  21. package/dist/ConversationToolManager.js.map +1 -1
  22. package/dist/MJAIAgentRequestEntityServer.d.ts +15 -1
  23. package/dist/MJAIAgentRequestEntityServer.d.ts.map +1 -1
  24. package/dist/MJAIAgentRequestEntityServer.js +63 -3
  25. package/dist/MJAIAgentRequestEntityServer.js.map +1 -1
  26. package/dist/agent-context-injector.d.ts +21 -4
  27. package/dist/agent-context-injector.d.ts.map +1 -1
  28. package/dist/agent-context-injector.js +49 -13
  29. package/dist/agent-context-injector.js.map +1 -1
  30. package/dist/agent-memory-context-builder.js +2 -2
  31. package/dist/agent-memory-context-builder.js.map +1 -1
  32. package/dist/agent-pre-execution-rag.d.ts.map +1 -1
  33. package/dist/agent-pre-execution-rag.js +6 -8
  34. package/dist/agent-pre-execution-rag.js.map +1 -1
  35. package/dist/agent-run-watchdog.d.ts +71 -18
  36. package/dist/agent-run-watchdog.d.ts.map +1 -1
  37. package/dist/agent-run-watchdog.js +223 -90
  38. package/dist/agent-run-watchdog.js.map +1 -1
  39. package/dist/agent-types/flow-agent-type.d.ts +13 -0
  40. package/dist/agent-types/flow-agent-type.d.ts.map +1 -1
  41. package/dist/agent-types/flow-agent-type.js +165 -27
  42. package/dist/agent-types/flow-agent-type.js.map +1 -1
  43. package/dist/agent-types/loop-agent-prompt-params.d.ts +32 -5
  44. package/dist/agent-types/loop-agent-prompt-params.d.ts.map +1 -1
  45. package/dist/agent-types/loop-agent-prompt-params.js +5 -3
  46. package/dist/agent-types/loop-agent-prompt-params.js.map +1 -1
  47. package/dist/agent-types/loop-agent-response-type.d.ts +35 -4
  48. package/dist/agent-types/loop-agent-response-type.d.ts.map +1 -1
  49. package/dist/agent-types/loop-agent-response-type.js +1 -1
  50. package/dist/agent-types/loop-agent-response-type.js.map +1 -1
  51. package/dist/agent-types/loop-agent-type.d.ts +103 -9
  52. package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
  53. package/dist/agent-types/loop-agent-type.js +351 -68
  54. package/dist/agent-types/loop-agent-type.js.map +1 -1
  55. package/dist/base-agent.d.ts +551 -44
  56. package/dist/base-agent.d.ts.map +1 -1
  57. package/dist/base-agent.js +2742 -549
  58. package/dist/base-agent.js.map +1 -1
  59. package/dist/bound-action-params.d.ts +57 -0
  60. package/dist/bound-action-params.d.ts.map +1 -0
  61. package/dist/bound-action-params.js +91 -0
  62. package/dist/bound-action-params.js.map +1 -0
  63. package/dist/catalog-narrowing.d.ts.map +1 -1
  64. package/dist/catalog-narrowing.js +6 -3
  65. package/dist/catalog-narrowing.js.map +1 -1
  66. package/dist/handoff-target.d.ts +80 -0
  67. package/dist/handoff-target.d.ts.map +1 -0
  68. package/dist/handoff-target.js +158 -0
  69. package/dist/handoff-target.js.map +1 -0
  70. package/dist/index.d.ts +7 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +7 -0
  73. package/dist/index.js.map +1 -1
  74. package/dist/memory-cleanup-agent.d.ts.map +1 -1
  75. package/dist/memory-cleanup-agent.js +3 -0
  76. package/dist/memory-cleanup-agent.js.map +1 -1
  77. package/dist/memory-manager-agent.d.ts.map +1 -1
  78. package/dist/memory-manager-agent.js +8 -1
  79. package/dist/memory-manager-agent.js.map +1 -1
  80. package/dist/native-tools/action-tool-builder.d.ts +6 -0
  81. package/dist/native-tools/action-tool-builder.d.ts.map +1 -1
  82. package/dist/native-tools/action-tool-builder.js +21 -5
  83. package/dist/native-tools/action-tool-builder.js.map +1 -1
  84. package/dist/native-tools/agent-tools.d.ts +64 -0
  85. package/dist/native-tools/agent-tools.d.ts.map +1 -0
  86. package/dist/native-tools/agent-tools.js +23 -0
  87. package/dist/native-tools/agent-tools.js.map +1 -0
  88. package/dist/native-tools/control-tools.d.ts +40 -7
  89. package/dist/native-tools/control-tools.d.ts.map +1 -1
  90. package/dist/native-tools/control-tools.js +139 -50
  91. package/dist/native-tools/control-tools.js.map +1 -1
  92. package/dist/native-tools/framework-tools.d.ts +47 -0
  93. package/dist/native-tools/framework-tools.d.ts.map +1 -0
  94. package/dist/native-tools/framework-tools.js +187 -0
  95. package/dist/native-tools/framework-tools.js.map +1 -0
  96. package/dist/native-tools/native-control-config.d.ts +93 -0
  97. package/dist/native-tools/native-control-config.d.ts.map +1 -0
  98. package/dist/native-tools/native-control-config.js +104 -0
  99. package/dist/native-tools/native-control-config.js.map +1 -0
  100. package/dist/native-tools/tool-result-turns.d.ts +41 -8
  101. package/dist/native-tools/tool-result-turns.d.ts.map +1 -1
  102. package/dist/native-tools/tool-result-turns.js +76 -2
  103. package/dist/native-tools/tool-result-turns.js.map +1 -1
  104. package/dist/native-tools/turn-mode.d.ts +8 -0
  105. package/dist/native-tools/turn-mode.d.ts.map +1 -0
  106. package/dist/native-tools/turn-mode.js +14 -0
  107. package/dist/native-tools/turn-mode.js.map +1 -0
  108. package/dist/pipeline/pipeline-registry.d.ts +5 -12
  109. package/dist/pipeline/pipeline-registry.d.ts.map +1 -1
  110. package/dist/pipeline/pipeline-registry.js +28 -2
  111. package/dist/pipeline/pipeline-registry.js.map +1 -1
  112. package/dist/pipeline/providers/serialize.d.ts +7 -3
  113. package/dist/pipeline/providers/serialize.d.ts.map +1 -1
  114. package/dist/pipeline/providers/serialize.js +9 -5
  115. package/dist/pipeline/providers/serialize.js.map +1 -1
  116. package/dist/query-builder-agent.d.ts +20 -1
  117. package/dist/query-builder-agent.d.ts.map +1 -1
  118. package/dist/query-builder-agent.js +35 -3
  119. package/dist/query-builder-agent.js.map +1 -1
  120. package/dist/realtime/bridge-room-transcript-sink.js +3 -0
  121. package/dist/realtime/bridge-room-transcript-sink.js.map +1 -1
  122. package/dist/realtime/bridge-session-transcript-sink.js +1 -0
  123. package/dist/realtime/bridge-session-transcript-sink.js.map +1 -1
  124. package/dist/realtime/realtime-client-session-service.d.ts +22 -2
  125. package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
  126. package/dist/realtime/realtime-client-session-service.js +70 -10
  127. package/dist/realtime/realtime-client-session-service.js.map +1 -1
  128. package/dist/realtime/realtime-coagent-config.d.ts.map +1 -1
  129. package/dist/realtime/realtime-coagent-config.js +2 -28
  130. package/dist/realtime/realtime-coagent-config.js.map +1 -1
  131. package/dist/realtime/realtime-recording-capture.d.ts +1 -0
  132. package/dist/realtime/realtime-recording-capture.d.ts.map +1 -1
  133. package/dist/realtime/realtime-recording-capture.js +17 -3
  134. package/dist/realtime/realtime-recording-capture.js.map +1 -1
  135. package/dist/realtime/realtime-recording-ledger.d.ts +20 -0
  136. package/dist/realtime/realtime-recording-ledger.d.ts.map +1 -1
  137. package/dist/realtime/realtime-recording-ledger.js +16 -0
  138. package/dist/realtime/realtime-recording-ledger.js.map +1 -1
  139. package/dist/realtime/realtime-recording-opus-assembly.d.ts.map +1 -1
  140. package/dist/realtime/realtime-recording-opus-assembly.js +9 -4
  141. package/dist/realtime/realtime-recording-opus-assembly.js.map +1 -1
  142. package/dist/realtime/realtime-recording-store.d.ts +6 -5
  143. package/dist/realtime/realtime-recording-store.d.ts.map +1 -1
  144. package/dist/realtime/realtime-recording-store.js +47 -21
  145. package/dist/realtime/realtime-recording-store.js.map +1 -1
  146. package/dist/realtime/realtime-session-runner.d.ts.map +1 -1
  147. package/dist/realtime/realtime-session-runner.js +5 -7
  148. package/dist/realtime/realtime-session-runner.js.map +1 -1
  149. package/dist/realtime/realtime-turn-moderator.d.ts.map +1 -1
  150. package/dist/realtime/realtime-turn-moderator.js +1 -0
  151. package/dist/realtime/realtime-turn-moderator.js.map +1 -1
  152. package/dist/rubric-evaluation-agent-runner.js +1 -0
  153. package/dist/rubric-evaluation-agent-runner.js.map +1 -1
  154. package/dist/runtime-state-fragment.d.ts.map +1 -1
  155. package/dist/runtime-state-fragment.js +3 -0
  156. package/dist/runtime-state-fragment.js.map +1 -1
  157. package/dist/sub-agent-consult.d.ts +75 -0
  158. package/dist/sub-agent-consult.d.ts.map +1 -0
  159. package/dist/sub-agent-consult.js +193 -0
  160. package/dist/sub-agent-consult.js.map +1 -0
  161. package/dist/volatile-child-prompt.d.ts +7 -0
  162. package/dist/volatile-child-prompt.d.ts.map +1 -1
  163. package/dist/volatile-child-prompt.js +8 -0
  164. package/dist/volatile-child-prompt.js.map +1 -1
  165. package/package.json +20 -20
package/README.md CHANGED
@@ -127,10 +127,12 @@ Abstract base that all agent types extend. Defines the `DetermineNextStep()` int
127
127
  | `Chat` | Send a message back to the user |
128
128
  | `Actions` | Execute one or more server-side actions |
129
129
  | `ClientTools` | Invoke browser-side tools (navigate, switch tabs, show results) |
130
- | `SubAgents` | Delegate to sub-agents |
130
+ | `SubAgents` / `Sub-Agent` | Delegate to child, related, or runtime-granted sub-agents and receive their result in-run |
131
+ | `Handoff` | Transfer a top-level interactive conversation to a directly discoverable peer agent (hosts that pass `handoffChain` only) |
132
+ | `Tasks` | Submit a durable `TaskGraphSpec` to the task-graph dispatcher and detach |
131
133
  | `MoreInfo` | Ask the user for additional information |
132
134
  | `Retry` | Retry the current step (e.g., after validation failure) |
133
- | `End` | Complete execution |
135
+ | `End` / `Success` / `Failed` | Complete execution |
134
136
  | `ForEach` | Iterate over a collection |
135
137
  | `While` | Loop while a condition is true |
136
138
 
@@ -170,6 +172,20 @@ When a Loop agent (such as `Sage`) emits `nextStep.type: 'Tasks'`, `LoopAgentTyp
170
172
  - **Single-node task graphs (1 task of kind `'Agent'` or `'Action'`)**: Automatically fold inline into a standard in-process `'Sub-Agents'` or `'Actions'` step — even when `taskGraph.continuation === 'reinvoke'` is specified (`terminateAfter: false` so the parent Loop agent gets another turn to synthesize the specialist's output). This avoids durable task-graph dispatch overhead for 1-step specialist delegations (e.g., `Query Builder`, `Visualization Agent`) and keeps live sub-agent streaming in the active chat turn.
171
173
  - **Multi-node task graphs (2+ tasks with `dependsOn` / `payloadMapping` or non-trivial scheduling)**: Dispatch as durable `MJ: Tasks` rows through [`@memberjunction/task-graph`](../../TaskGraph/README.md), broadcasting real-time step transitions via `TaskGraphFrameBroadcaster` and delivering synthesized continuation replies and artifacts back to the conversation via `TaskGraphContinuationDeliverer`.
172
174
 
175
+ ##### Execution Primitive Hierarchy & Native Tool-Calling JSON Envelope Bridge
176
+
177
+ Loop agents choose from four structured execution primitives depending on dataflow, iteration, and durability needs:
178
+
179
+ | Primitive | When to Use | Execution & Persistence |
180
+ |---|---|---|
181
+ | `Actions` / Native tool calls | 1–3 independent calls whose raw results the LLM needs in context | In-turn `Actions` / `Sub-Agents` run steps |
182
+ | `Pipeline` (`nextStep.type = 'Pipeline'`) | Linear server-side tool chains (`tool`, `jsonpath`, `select`, `grep`, `slice`, `head`, `tail`, `count`, `unique`, `sort`, `parse_json`) where intermediate outputs stay out of context | Single `Tool` (`Pipeline: N step(s)`) run step; `StructureActionResult` automatically coerces structured JSON `ActionResult.Message` payloads when an action declares no `Output` params |
183
+ | `ForEach` / `While` (`nextStep.type = 'ForEach' \| 'While'`) | In-turn batch iteration or bounded convergence, either with a single `action` / `subAgent` body or an ordered multi-step `steps?: LoopBodyActionStep[]` sequence chaining outputs via `{{steps.<id>.<field>}}` | Single `ForEach` / `While` run step plus linked child `Actions` / `Sub-Agents` steps |
184
+ | `Tasks` (`nextStep.type = 'Tasks'`) | Durable DAGs (`Agent`, `Action`, `Human`, `Prompt`, `ForEach` including `steps[]`, `While`, `Decision`), conditional/XOR `exclusiveGroup` forks, or long-running sleep/wake (`continuation: 'reinvoke'`) | Persisted `StepType = 'TaskGraph'` run step; submitting `AIAgentRun` parks in `Paused` until `TaskGraphDispatcher` settles the graph to `Completed` |
185
+
186
+ - **Native tool-calling JSON envelope bridge**: When a model runs in `Native` (hybrid) or `NativeImplicit` tool-calling mode (`ResolveNativeToolCalling`), it uses native tool calls for ordinary `Actions` / `Sub-Agent` / `ClientTools` turns, and bridges cleanly to `Pipeline`, `ForEach`, `While`, or `Tasks` by emitting **no native tool call on that turn** and replying with a `LoopAgentResponse` JSON envelope (`{ "taskComplete": false, "nextStep": { "type": "..." } }`).
187
+ - **Sanitized tool-name normalization**: `PipelineToolRegistry`, `BaseAgent` (`Actions`, `Sub-Agent`, `ForEach`/`While`, and `validateTasksNextStep`), and `TaskGraphService` / `TaskGraphDispatcher` normalize sanitized native tool names (`calculate_expression` → `"Calculate Expression"`, `delegate_to_query_builder` → `"Query Builder"`) via `SanitizeToolName` so JSON envelopes work seamlessly whether the model writes canonical MJ names or native tool identifiers.
188
+
173
189
  #### FlowAgentType
174
190
 
175
191
  Step-based agent that follows a predefined flow graph — steps with explicit conditional paths between them. Best for deterministic workflows where the execution path is known in advance.
@@ -302,6 +318,17 @@ Optimizes agent startup by batch-loading all required metadata in parallel:
302
318
  - Sub-agent data
303
319
  - Prompt configurations
304
320
 
321
+ ### AgentRunWatchdog
322
+
323
+ Process-wide guard that keeps an `AIAgentRun` from being left `Running` forever when its process dies or its final save fails. `BaseAgent` calls `Track()` once the run row exists and `Untrack()` as soon as the run leaves `Running` (Completed, Failed, Cancelled, AwaitingFeedback or Paused) — first thing in `Execute()`'s teardown, before any subclass `finalizeRun` hook.
324
+
325
+ - **Heartbeat** — every `heartbeatIntervalMs` (30s) it stamps `LastHeartbeatAt` on this process's in-flight runs.
326
+ - **Sweep** — every `sweepIntervalMs` (5 min) it force-fails `Running` runs whose heartbeat went stale (`staleThresholdMinutes`, 5) and drops finished runs from its tracked set. Once the process has tracked a run, the sweep keeps running even with nothing tracked, so it also closes runs that other, crashed instances left `Running`. The host also runs `SweepOrphanedRuns` once at startup.
327
+ - **Stop relay** — every 3s it checks whether one of its runs was marked `Cancelled` (the Stop button) and aborts that run.
328
+ - **Idle** — the heartbeat and the stop relay run only while at least one run is tracked: the last run leaving stops them, and the next `Track()` starts them again. With `sweepIntervalMs: 0` the sweep never starts either, so an idle process issues no periodic database statements; see the [Serverless Database Auto-Pause Guide](../../../guides/SERVERLESS_DATABASE_AUTO_PAUSE_GUIDE.md) for the trade-off.
329
+
330
+ Tune it with `AgentRunWatchdog.Instance.Configure({ ... })`; MJServer passes its `agentRunWatchdog` settings through at startup. `sweepIntervalMs: 0` turns the periodic sweep off (the startup sweep still runs, and the tracked-set prune moves to the heartbeat). Other values must be greater than 0; an invalid value throws.
331
+
305
332
  > 📖 **Memory is a big topic.** For the complete architecture — the three-tier model, injection and scoping, the in-flight write pipeline, and the Memory Manager's hardening/consolidation/decay phases — see the **[Agent Memory Guide](../../../guides/AGENT_MEMORY_GUIDE.md)**. The sections below are component-level summaries.
306
333
 
307
334
  ### MemoryWriteManager (In-Flight Memory Writes)
@@ -409,6 +436,24 @@ const result = await runner.ExecuteAgent({
409
436
  });
410
437
  ```
411
438
 
439
+ ### With Bound Action Parameters
440
+
441
+ A host can fix some of an action's input parameters for the run, so the model can neither see nor change them. A bound parameter is left out of the action's description in the prompt, out of its native tool schema, out of the result echoed to the model and out of what Find Candidate Actions / Find Best Action report; at dispatch the bound value replaces whatever the model sent under that name, the override is logged with the run and step IDs, and the action's execution log marks the parameter `Bound`. Bindings reach every sub-agent run. A required parameter bound to nothing, or a binding that names a parameter the action does not have, refuses the action before it runs: the model is told only that the action is unavailable, and the action is locked out for the rest of the run. A binding keyed by anything other than a known Action ID fails the run at its start.
442
+
443
+ ```typescript
444
+ const result = await runner.RunAgent({
445
+ agent: spaceAgent,
446
+ conversationMessages: messages,
447
+ contextUser: currentUser,
448
+ // Action ID → parameter name → value. The model is never told ChapterID exists.
449
+ boundActionParams: {
450
+ [listMembersActionId]: { ChapterID: space.ChapterID }
451
+ }
452
+ });
453
+ ```
454
+
455
+ **Limits.** Bindings are server-side only (no GraphQL input reaches them). A run with bindings has task graphs withheld, because a graph's action nodes are dispatched outside the agent's binding gate. A run stores its bindings on `MJ: AI Agent Runs.BoundActionParams`, and a run that continues another (`lastRunId`, including a resume from a stored request) applies them when its caller passes none; a prior run that cannot be read (missing, hidden from the context user, or holding bindings that do not parse to an object) fails the continuing run. `actionChanges` are not persisted, so a resumed run starts without them. Bindings hide a value from the model; they are not a boundary against the user, who can start an unbound run. The realtime client-direct action path and the `Execute Agent` action (along with Loop, Conditional, Retry and Parallel Execute when run without a `RunScope` that refuses them) dispatch without forwarding `boundActionParams`, so do not grant them to a bound agent. An action's own message text may mention a bound value. The rules are exported for hosts that dispatch actions themselves: `BindingsForAction`, `UnboundParams`, `IsBoundParamName`, `ApplyBoundActionParams`.
456
+
412
457
  ### With Memory Scope (Multi-Tenant)
413
458
 
414
459
  Multi-tenant deployments can isolate the agent's memory cohort (notes and examples) per request by passing scope fields on `ExecuteAgentParams`. The fields are top-level — there is no `userScope` wrapper:
@@ -604,6 +649,48 @@ const result = await runner.RunAgent({
604
649
  });
605
650
  ```
606
651
 
652
+ ## Event-Driven Agent Wakes (`AgentWakeTriggerService`)
653
+
654
+ Self-scheduling agents such as the Chief of Staff normally wake on a cron or adaptive `MJ: User Routines` schedule guarded by the 3-tier wake gate (see [Built-In Agents Guide](../../../guides/BUILT_IN_AGENTS_GUIDE.md)). `AgentWakeTriggerService` (a `BaseSingleton`, exported from this package) adds the event-driven complement: when something happens that an agent should react to now, it writes a one-shot `AgentWake` routine for the right user so the agent runs on the dispatcher's next sweep instead of waiting for its next scheduled slot.
655
+
656
+ **Delivery is a routine row, not a direct agent invocation.** Every trigger ends in `upsertImmediateWakeRoutine`, which finds (by `UserID` + `TargetID` + `WakeConfigurationObject.workstreamKey`) or creates an `MJ: User Routines` row with `RoutineType = 'AgentWake'`, `TargetType = 'Agent'`, `ScheduleMode = 'OneShot'`, `Status = 'Active'`, `NextRunAt = now`, and stores `{ workstreamKey, wakeReason, resumeState }` in `WakeConfigurationObject` (also mirrored into `StartingPayload` and `InitialMessage`). `resumeState` carries the latest event at its top level **and** every event since the last dispatcher claim in `resumeState.pendingEvents`: while the routine is still waiting (`Status = 'Active'` with a `NextRunAt`), a new event is appended rather than replacing the previous one, so two approvals clicked within one sweep both reach the agent; once the dispatcher has claimed the routine the list starts over. The same request in the same status is queued once. With more than one pending event, `wakeReason` / `InitialMessage` enumerate them. `UserRoutineDispatcherDriver` sweeps due routines once a minute, so "immediate" means **on the next sweep, within about a minute**. The dispatcher hands the agent `payload._wakeContext.resumeState` and runs it with `compactAfterRun: true`. A freshly created event routine carries no tier configuration, so `WakeGateEvaluator` fails open; an existing routine for the same workstream keeps whatever gate it already had.
657
+
658
+ | Trigger | Fired by | Whose agent wakes | `workstreamKey` | `resumeState.triggerType` |
659
+ |---|---|---|---|---|
660
+ | `TriggerWakeOnAgentRequestResolution` | `MJAIAgentRequestEntityServer.Save()` when an action-created `MJ: AI Agent Requests` row (`OriginatingAgentRunID` and `OriginatingTaskID` both null) moves from `Requested` to `Approved`, `Rejected` or `Responded` | The request owner (`RequestForUserID`) and `AgentID` | `approval-resolution` | `AgentRequestResolution` — `requestID`, `status`, `request`, `response`, parsed `responseData` and `commentsData`, `respondedByUserID`, `respondedAt` |
661
+ | Same method, inter-agent envelope | The resolved request's `Comments` is a `Send Inter-Agent Request` envelope (`interAgentCoordination: true`) | The **sender** user (`envelope.senderUserID`) and `senderAgentID` | envelope `workstreamKey`, else `inter-agent-resolution` | `InterAgentRequestResolved` — `requestID`, `status`, `subject`, `response`, `responseData`, `respondedByUserID`, `respondedAt`, `targetUserID`, `targetUserName` |
662
+ | `TriggerWakeOnIncomingInterAgentRequest` | `MJAIAgentRequestEntityServer.Save()` on a **new** `Requested` row whose `Comments` is an inter-agent envelope (`interAgentCoordination: true`) | The **target** user (`envelope.targetUserID`) and the request's `AgentID` | envelope `workstreamKey`, else `inter-agent-inbox` | `InterAgentRequestReceived` — `requestID`, `senderUserID`, `senderUserName`, `senderAgentID`, `subject`, `messageBody` |
663
+ | `RouteInboundUtilityMailboxWake` | An inbound-email ingestion path (none wired yet) passing an `InboundUtilityMailboxEmailInput` | The verified internal sender (`fromAddress` matches an active `MJ: Users` row) and the `AgentID` of the matching `MJ: AI Bridge Agent Identities` row (`IdentityType = 'Email'`, `IsActive`) | input `workstreamKey`, else identity `Configuration.defaultWorkstreamKey`, else `inbound-utility-mailbox` | `InboundUtilityMailboxEmail` — `identityID`, `utilityMailboxAddress`, `senderUserID`, `senderEmail`, `messageID`, `subject`, `bodyPreview`, `receivedAt` |
664
+
665
+ Every `resumeState` also repeats the `workstreamKey`. Requests that carry `OriginatingAgentRunID` (a paused run) or `OriginatingTaskID` (a task graph) are skipped — those resume through the existing `lastRunId` path and the task dispatcher, not through a wake.
666
+
667
+ **Policy checks.** `AgentUserPolicyEngine.GetPolicyForAgentAndUser` is consulted for the target user. A `Disabled` or `Paused` `MJ: AI Agent User Policies` row blocks every trigger; the incoming inter-agent trigger additionally requires an `Active` policy with `AllowInterAgentCoordination` not `false`; the mailbox trigger also refuses `EmailChannelMode = 'Disabled'`, enforces the identity's optional `Configuration.allowedUserID` / `allowedEmailDomains`, and rejects any sender that is not an active internal user.
668
+
669
+ **Result.** Each method returns an `AgentWakeTriggerResult` — `{ triggered, resultCode, reason, routineID, targetUserID, targetAgentID, workstreamKey, nextRunAtISO }` — and never throws for business outcomes. `resultCode` is one of `WAKE_SCHEDULED`, `SKIPPED_NOT_APPLICABLE`, `POLICY_DENIED`, `IDENTITY_NOT_FOUND`, `UNVERIFIED_EXTERNAL_SENDER`, `SENDER_NOT_AUTHORIZED_FOR_IDENTITY`, `SAVE_FAILED`.
670
+
671
+ ```typescript
672
+ import { LogStatus } from '@memberjunction/core';
673
+ import { AgentWakeTriggerService } from '@memberjunction/ai-agents';
674
+
675
+ // Inside a server-side entity subclass or resolver, after the request has saved:
676
+ const result = await AgentWakeTriggerService.Instance.TriggerWakeOnAgentRequestResolution(
677
+ request, // MJAIAgentRequestEntity, Status already Approved/Rejected/Responded
678
+ contextUser, // UserInfo the save ran under
679
+ this.ProviderToUse // IMetadataProvider; defaults to Metadata.Provider when omitted
680
+ );
681
+ if (!result.triggered) {
682
+ LogStatus(`No wake scheduled (${result.resultCode}): ${result.reason}`);
683
+ }
684
+ ```
685
+
686
+ **Current limitations**
687
+
688
+ - Routines are private to their owner (`MJUserRoutineEntityServer.validateOwnership`, plus row-level security on the lookup). A wake for the caller's own agent is saved in the caller's scope; a wake for another user (inter-agent arrival, or a resolution that wakes the sender) is saved as the scheduler's **system user** from `UserCache`, which the ownership gate exempts. If no system user is cached (unit tests, unusual hosts) the service falls back to the caller and logs that the save may be rejected.
689
+ - The service's `InterAgentCoordinationEnvelopeShape` accepts both the `InterAgentCoordinationEnvelope` field names the action writes (`protocolVersion`, `message`) and the older `envelopeVersion` / `messageBody` names. The two shapes are still declared separately because `@memberjunction/core-actions` depends on this package, not the reverse.
690
+ - Wakes are keyed by `UserID` + `TargetID` + `workstreamKey`; events for the same workstream that land between sweeps are queued in `resumeState.pendingEvents` (see above). The queue is at-least-once: an event that lands between the dispatcher's claim save and the service's save can be delivered twice, so the agent should treat `requestID` as idempotent and re-check the request's current status.
691
+ - `RouteInboundUtilityMailboxWake` has no production caller. Wiring it needs an inbound-email ingestion path (mailbox poller or provider webhook) that does not exist yet, and `resolveVerifiedInternalSender` should then resolve the sender through `UserCache` rather than building a role-less `UserInfo`. Deferred to a follow-up by decision.
692
+ - The wake is a `OneShot` `MJ: User Routines` row picked up by the dispatcher, not a direct `AgentRunner` call, so delivery latency is bounded by the sweep interval and the dispatcher's concurrency limit.
693
+
607
694
  ## Documentation
608
695
 
609
696
  Detailed guides are available in the [`docs/`](./docs/) directory:
@@ -37,7 +37,7 @@ export interface PreloadedDataResult {
37
37
  }
38
38
  export declare class AgentDataPreloader extends BaseSingleton<AgentDataPreloader> {
39
39
  /**
40
- * Per-agent cache (global, TTL-based)
40
+ * Per-agent cache (TTL-based), keyed by agent, data source and user
41
41
  */
42
42
  private _perAgentCache;
43
43
  /**
@@ -139,7 +139,9 @@ export declare class AgentDataPreloader extends BaseSingleton<AgentDataPreloader
139
139
  */
140
140
  private cacheData;
141
141
  /**
142
- * Generates a cache key for per-agent caching.
142
+ * Generates a cache key for per-agent caching. The key includes the user, because the rows were
143
+ * loaded under that user's row- and field-level permissions and must never be served to another
144
+ * user. Returns null when there is no user, in which case the data is not cached.
143
145
  *
144
146
  * @private
145
147
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AgentDataPreloader.d.ts","sourceRoot":"","sources":["../src/AgentDataPreloader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAqE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAc,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKnE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAA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OAIG;YACW,cAAc;IAmC5B;;;;OAIG;YACW,eAAe;IAiC7B;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IA0CrB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAuCjB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;CAG9B"}
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { AIEngine } from '@memberjunction/aiengine';
14
14
  import { LogError, LogStatusEx, IsVerboseLoggingEnabled, RunView, RunQuery } from '@memberjunction/core';
15
- import { UUIDsEqual, BaseSingleton } from '@memberjunction/global';
15
+ import { UUIDsEqual, BaseSingleton, UserScopedCacheKey } from '@memberjunction/global';
16
16
  import _ from 'lodash';
17
17
  /**
18
18
  * Singleton service for preloading agent data sources.
@@ -21,7 +21,8 @@ import _ from 'lodash';
21
21
  * in AIAgentDataSource metadata. Supports three cache policies:
22
22
  * - None: No caching, data is loaded fresh every time
23
23
  * - PerRun: Data is cached for the duration of a single agent run
24
- * - PerAgent: Data is cached globally with a TTL, shared across all runs
24
+ * - PerAgent: Data is cached with a TTL across runs of the agent, separately for each user,
25
+ * because the rows were loaded under that user's permissions
25
26
  *
26
27
  * @class AgentDataPreloader
27
28
  * @example
@@ -40,7 +41,7 @@ export class AgentDataPreloader extends BaseSingleton {
40
41
  constructor() {
41
42
  super();
42
43
  /**
43
- * Per-agent cache (global, TTL-based)
44
+ * Per-agent cache (TTL-based), keyed by agent, data source and user
44
45
  */
45
46
  this._perAgentCache = new Map();
46
47
  /**
@@ -256,7 +257,7 @@ export class AgentDataPreloader extends BaseSingleton {
256
257
  */
257
258
  async executeDataSource(source, contextUser, runId) {
258
259
  // Check cache first
259
- const cachedData = this.getCachedData(source, runId);
260
+ const cachedData = this.getCachedData(source, contextUser, runId);
260
261
  if (cachedData !== null) {
261
262
  LogStatusEx({
262
263
  message: `AgentDataPreloader: Using cached data for '${source.Name}'`,
@@ -277,7 +278,7 @@ export class AgentDataPreloader extends BaseSingleton {
277
278
  throw new Error(`Unknown source type: ${source.SourceType}`);
278
279
  }
279
280
  // Cache the data if policy dictates
280
- this.cacheData(source, data, runId);
281
+ this.cacheData(source, data, contextUser, runId);
281
282
  return data;
282
283
  }
283
284
  /**
@@ -348,7 +349,7 @@ export class AgentDataPreloader extends BaseSingleton {
348
349
  * @private
349
350
  * @returns Cached data or null if not cached/expired
350
351
  */
351
- getCachedData(source, runId) {
352
+ getCachedData(source, contextUser, runId) {
352
353
  if (source.CachePolicy === 'None') {
353
354
  return null;
354
355
  }
@@ -360,7 +361,10 @@ export class AgentDataPreloader extends BaseSingleton {
360
361
  return null;
361
362
  }
362
363
  if (source.CachePolicy === 'PerAgent') {
363
- const cacheKey = this.getPerAgentCacheKey(source);
364
+ const cacheKey = this.getPerAgentCacheKey(source, contextUser);
365
+ if (cacheKey === null) {
366
+ return null;
367
+ }
364
368
  const entry = this._perAgentCache.get(cacheKey);
365
369
  if (entry) {
366
370
  // Check if expired
@@ -383,7 +387,7 @@ export class AgentDataPreloader extends BaseSingleton {
383
387
  *
384
388
  * @private
385
389
  */
386
- cacheData(source, data, runId) {
390
+ cacheData(source, data, contextUser, runId) {
387
391
  if (source.CachePolicy === 'None') {
388
392
  return;
389
393
  }
@@ -401,7 +405,10 @@ export class AgentDataPreloader extends BaseSingleton {
401
405
  LogError(`PerAgent cache policy requires CacheTimeoutSeconds > 0 for data source '${source.Name}'`);
402
406
  return;
403
407
  }
404
- const cacheKey = this.getPerAgentCacheKey(source);
408
+ const cacheKey = this.getPerAgentCacheKey(source, contextUser);
409
+ if (cacheKey === null) {
410
+ return;
411
+ }
405
412
  const entry = {
406
413
  data,
407
414
  timestamp: new Date(),
@@ -411,12 +418,14 @@ export class AgentDataPreloader extends BaseSingleton {
411
418
  }
412
419
  }
413
420
  /**
414
- * Generates a cache key for per-agent caching.
421
+ * Generates a cache key for per-agent caching. The key includes the user, because the rows were
422
+ * loaded under that user's row- and field-level permissions and must never be served to another
423
+ * user. Returns null when there is no user, in which case the data is not cached.
415
424
  *
416
425
  * @private
417
426
  */
418
- getPerAgentCacheKey(source) {
419
- return `${source.AgentID}:${source.Name}`;
427
+ getPerAgentCacheKey(source, contextUser) {
428
+ return UserScopedCacheKey(contextUser?.ID, source.AgentID, source.Name);
420
429
  }
421
430
  }
422
431
  //# sourceMappingURL=AgentDataPreloader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentDataPreloader.js","sourceRoot":"","sources":["../src/AgentDataPreloader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,CAAC,MAAM,QAAQ,CAAC;AAoCvB;;;;;;;;;;;;;;;;GAgBG;AACH;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC,MAAM,OAAO,kBAAmB,SAAQ,aAAiC;IAWrE;QACI,KAAK,EAAE,CAAC;QAXZ;;WAEG;QACK,mBAAc,GAA4B,IAAI,GAAG,EAAE,CAAC;QAE5D;;WAEG;QACK,iBAAY,GAAsC,IAAI,GAAG,EAAE,CAAC;IAIpE,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,QAAQ;QACtB,OAAO,kBAAkB,CAAC,WAAW,EAAsB,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,KAAK,CAAC,gBAAgB,CACzB,OAAe,EACf,WAAqB,EACrB,KAAc;QAEd,IAAI,CAAC;YACD,WAAW,CAAC;gBACR,OAAO,EAAE,sDAAsD,OAAO,EAAE;gBACxE,WAAW,EAAE,IAAI;gBACjB,gBAAgB,EAAE,uBAAuB;aAC5C,CAAC,CAAC;YAEH,+BAA+B;YAC/B,MAAM,WAAW,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,MAAM,KAAK,GAAe;gBACtB,IAAI;gBACJ,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,cAAc,EAAE,MAAM,CAAC,mBAAmB;aAC7C,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACK,mBAAmB,CAAC,MAAiC,EAAE,WAAqB;QAChF,OAAO,kBAAkB,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC;CACJ"}
@@ -10,8 +10,10 @@
10
10
  * @since 2.49.0
11
11
  */
12
12
  import { UserInfo, IMetadataProvider } from '@memberjunction/core';
13
- import { ExecuteAgentResult, ExecuteAgentParams, MediaOutput, FileOutputRef } from '@memberjunction/ai-core-plus';
13
+ import { ExecuteAgentResult, ExecuteAgentParams, MediaOutput, FileOutputRef, MJAIAgentEntityExtended, AgentHandoffResult, AgentExecutionProgressCallback, AgentExecutionStreamingCallback } from '@memberjunction/ai-core-plus';
14
+ import { AgentPresetSource } from '@memberjunction/ai-engine-base';
14
15
  import { ArtifactTargetPlan } from './artifact-target-plan.js';
16
+ import { MJConversationDetailEntity, MJConversationDetailEntityExtended, MJAIAgentConfigurationEntity } from '@memberjunction/core-entities';
15
17
  /**
16
18
  * Identifies an artifact (and the version) that a run created.
17
19
  */
@@ -31,6 +33,78 @@ export interface CreatedArtifactInfo {
31
33
  export declare function SelectPrimaryArtifact(fileArtifacts: readonly CreatedArtifactInfo[] | undefined, payloadArtifact: CreatedArtifactInfo | undefined): CreatedArtifactInfo | undefined;
32
34
  /** @deprecated Use {@link SelectPrimaryArtifact}. */
33
35
  export declare function selectPrimaryArtifact(fileArtifacts: readonly CreatedArtifactInfo[] | undefined, payloadArtifact: CreatedArtifactInfo | undefined): CreatedArtifactInfo | undefined;
36
+ /**
37
+ * Builds the system message injected at index `0` of the target agent's `conversationMessages`
38
+ * when a conversation is transferred via handoff.
39
+ */
40
+ export declare function HandoffBriefMessage(sourceName: string, brief: string, reason?: string): string;
41
+ /**
42
+ * Metadata describing a single handoff hop passed to {@link FollowHandoffsHooks}.
43
+ */
44
+ export interface HandoffHopInfo {
45
+ hopIndex: number;
46
+ sourceAgent: MJAIAgentEntityExtended;
47
+ sourceConversationDetailId: string;
48
+ targetAgent: MJAIAgentEntityExtended;
49
+ targetConversationDetailId: string;
50
+ preset: MJAIAgentConfigurationEntity | null;
51
+ presetSource: AgentPresetSource;
52
+ handoff: AgentHandoffResult;
53
+ }
54
+ /**
55
+ * Information about the run that just handed off, passed to `OnHopStart`.
56
+ */
57
+ export interface HandoffPreviousRunInfo {
58
+ agentResult: ExecuteAgentResult;
59
+ conversationDetailId: string;
60
+ }
61
+ /**
62
+ * Callbacks returned by `OnHopStart` for a handoff hop's execution.
63
+ */
64
+ export interface HandoffHopCallbacks {
65
+ onProgress?: AgentExecutionProgressCallback;
66
+ onStreaming?: AgentExecutionStreamingCallback;
67
+ }
68
+ /**
69
+ * Outcome recorded for a single handoff hop by {@link AgentRunner.FollowHandoffs}.
70
+ */
71
+ export interface HandoffHopOutcome {
72
+ hopIndex: number;
73
+ targetAgent: MJAIAgentEntityExtended;
74
+ targetConversationDetailId: string;
75
+ preset: MJAIAgentConfigurationEntity | null;
76
+ presetSource: AgentPresetSource;
77
+ agentResult?: ExecuteAgentResult;
78
+ artifactInfo?: CreatedArtifactInfo;
79
+ error?: string;
80
+ }
81
+ /**
82
+ * Lifecycle hooks for {@link AgentRunner.FollowHandoffs}.
83
+ */
84
+ export interface FollowHandoffsHooks {
85
+ OnHopStart?: (hop: HandoffHopInfo, previous: HandoffPreviousRunInfo) => Promise<HandoffHopCallbacks | void> | HandoffHopCallbacks | void;
86
+ OnHopEnd?: (hop: HandoffHopInfo, outcome: HandoffHopOutcome) => Promise<void> | void;
87
+ }
88
+ /**
89
+ * Input options for {@link AgentRunner.FollowHandoffs}.
90
+ */
91
+ export interface FollowHandoffsInput<C = any> {
92
+ params: ExecuteAgentParams<C>;
93
+ sourceResult: ExecuteAgentResult;
94
+ conversationId: string;
95
+ sourceConversationDetailId: string;
96
+ createArtifacts?: boolean;
97
+ hooks?: FollowHandoffsHooks;
98
+ /**
99
+ * The user who writes this run's conversation rows (the target reply row and any refusal notice
100
+ * on the source row). Defaults to `params.contextUser`.
101
+ */
102
+ ConversationWriter?: UserInfo;
103
+ /**
104
+ * Optional pre-loaded server-authored source conversation detail entity for hop 0.
105
+ */
106
+ sourceConversationDetail?: MJConversationDetailEntityExtended;
107
+ }
34
108
  /**
35
109
  * AgentRunner provides a thin wrapper for executing AI agents.
36
110
  *
@@ -83,6 +157,8 @@ export declare class AgentRunner {
83
157
  * instead: a truncated title still names the artifact the user is looking at.
84
158
  */
85
159
  private static readonly ARTIFACT_NAME_MAX_LENGTH;
160
+ /** How long the end of a run waits for the generated conversation name before keeping the initial one. */
161
+ private static readonly NAMING_WAIT_MS;
86
162
  private readonly _provider;
87
163
  constructor(provider?: IMetadataProvider);
88
164
  /**
@@ -101,6 +177,35 @@ export declare class AgentRunner {
101
177
  * @throws {Error} Throws if agent type loading fails or agent instantiation fails
102
178
  */
103
179
  RunAgent<C = any, R = any>(params: ExecuteAgentParams<C>): Promise<ExecuteAgentResult<R>>;
180
+ /**
181
+ * Creates the reply row for an agent's turn on the server: `Role` `AI`, In-Progress, '⏳ Starting...', marked with
182
+ * `MarkServerAuthoredReply()` so the conversation detail gate accepts it. Only the server writes replies, so this is
183
+ * the one place a reply row starts; pass the returned instance to {@link RunAgentInConversation} as
184
+ * `agentResponseDetail` and the run writes its progress and result into it.
185
+ *
186
+ * @param args.conversationId The conversation the reply belongs to.
187
+ * @param args.branchId The fork it sits on, the same as the message it answers; null or omitted is Main.
188
+ * @param args.agentId The agent the reply is from; null for a status line no agent wrote (a workflow's).
189
+ * @param args.contextUser Whom the row is written as: the person the reply is for. They must own the conversation
190
+ * or hold an `Edit` grant on it.
191
+ * @param args.parentId The message the reply answers, when known.
192
+ * @param args.testRunId A test run to link the row to.
193
+ * @param args.provider The provider to write through; defaults to this runner's.
194
+ * @param args.message The row's text, for a server-composed status line; defaults to '⏳ Starting...'.
195
+ * @param args.status The row's status; defaults to In-Progress (a reply a run will fill).
196
+ * @returns The saved row. Throws with the gate's reason when the save is refused.
197
+ */
198
+ CreateAgentReplyDetail(args: {
199
+ conversationId: string;
200
+ branchId?: string | null;
201
+ agentId: string | null;
202
+ contextUser: UserInfo;
203
+ parentId?: string;
204
+ testRunId?: string;
205
+ provider?: IMetadataProvider;
206
+ message?: string;
207
+ status?: MJConversationDetailEntity['Status'];
208
+ }): Promise<MJConversationDetailEntityExtended>;
104
209
  /**
105
210
  * Runs an AI agent within a conversation context, handling conversation and artifact management.
106
211
  *
@@ -134,6 +239,12 @@ export declare class AgentRunner {
134
239
  conversationId?: string;
135
240
  /** Optional existing conversation detail ID. If provided, skips conversation/detail creation */
136
241
  conversationDetailId?: string;
242
+ /**
243
+ * The reply row the caller already created on the server for this run, with
244
+ * {@link CreateAgentReplyDetail}. The run's progress and result are written into this instance, so the
245
+ * writes carry its server-authored marker and its context user. Wins over `conversationDetailId`.
246
+ */
247
+ agentResponseDetail?: MJConversationDetailEntityExtended;
137
248
  /** The user's message text for this conversation turn (required if conversationDetailId not provided) */
138
249
  userMessage?: string;
139
250
  /** Whether to create artifacts from the agent's payload (default: true) */
@@ -144,6 +255,14 @@ export declare class AgentRunner {
144
255
  conversationName?: string;
145
256
  /** Optional test run ID to link conversation and details to (for test execution traceability) */
146
257
  testRunId?: string;
258
+ /**
259
+ * The user who writes this run's conversation rows: the conversation, the user's message and the agent's
260
+ * reply. Defaults to `params.contextUser`. A caller that runs the agent under an elevated principal on
261
+ * someone else's behalf (a public widget guest runs as the system user) names the conversation's owner
262
+ * here, because only the owner or a grantee may write a conversation's messages; the run's own records
263
+ * (run, steps, prompt runs, artifacts) are still written as `params.contextUser`.
264
+ */
265
+ ConversationWriter?: UserInfo;
147
266
  }): Promise<{
148
267
  /** The agent execution result */
149
268
  agentResult: ExecuteAgentResult<R>;
@@ -164,6 +283,22 @@ export declare class AgentRunner {
164
283
  */
165
284
  artifactInfo?: CreatedArtifactInfo;
166
285
  }>;
286
+ /**
287
+ * Executes server-side handoff hops sequentially in the same turn while the active run's
288
+ * result carries a resolved `handoff`.
289
+ */
290
+ FollowHandoffs<C = any>(input: FollowHandoffsInput<C>): Promise<HandoffHopOutcome[]>;
291
+ private findLatestHandoffStep;
292
+ private recordRefusedHandoffOnSource;
293
+ private updateSourceHandoffStepOutput;
294
+ private lookupTargetPriorRunId;
295
+ private buildHandoffTargetParams;
296
+ /**
297
+ * Starts the "Name Conversation" prompt for a new conversation so it runs alongside the agent, and
298
+ * returns the step that saves the generated name. That step runs after the run's own writes, which
299
+ * share the request's connection. A failed generation or save keeps the initial name.
300
+ */
301
+ private startConversationNaming;
167
302
  /**
168
303
  * Gets the maximum version number for an artifact.
169
304
  * Used when creating new versions of explicitly specified artifacts.
@@ -463,6 +598,8 @@ export declare class AgentRunner {
463
598
  * @param agentRunId - The ID of the agent run
464
599
  * @param mediaOutputs - Array of media outputs to save
465
600
  * @param contextUser - User context for the operation
601
+ * @param provider - Optional metadata provider for multi-provider support
602
+ * @param resolvedStorageAccountId - Optional pre-resolved storage account ID from the agent's resolution chain
466
603
  * @returns Array of saved AIAgentRunMedia IDs
467
604
  * @since 3.1.0
468
605
  *
@@ -477,7 +614,7 @@ export declare class AgentRunner {
477
614
  * console.log(`Saved ${mediaIds.length} media outputs`);
478
615
  * ```
479
616
  */
480
- SaveAgentRunMedia(agentRunId: string, mediaOutputs: MediaOutput[] | undefined, contextUser: UserInfo, provider?: IMetadataProvider): Promise<string[]>;
617
+ SaveAgentRunMedia(agentRunId: string, mediaOutputs: MediaOutput[] | undefined, contextUser: UserInfo, provider?: IMetadataProvider, resolvedStorageAccountId?: string): Promise<string[]>;
481
618
  /**
482
619
  * Determines whether a media output's bytes are already embedded inside the agent's
483
620
  * output payload (which is serialized into the report artifact by
@@ -650,11 +787,19 @@ export declare class AgentRunner {
650
787
  * `ArtifactToolManager`. No-op for binary content, non-JSON content, or
651
788
  * content that already has rows populated.
652
789
  *
653
- * Security: `RunQuery` uses the same read-only, `SQLExpressionValidator`-
654
- * checked execution path that `data-artifact-viewer` already uses at
655
- * render time — identical security posture to the existing view path.
790
+ * Security: the stored SQL runs as ad-hoc SQL for `contextUser`, so the provider
791
+ * allows only a single read statement over entity views that user may read in
792
+ * full (no row-level filter, no denied field). It runs on the host's read-only
793
+ * database login when one is configured, and on the default provider otherwise.
656
794
  */
657
795
  private hydrateSqlBackedContent;
796
+ /** True when the parsed artifact carries stored SQL whose rows are missing. */
797
+ private hasUnhydratedSql;
798
+ /**
799
+ * A RunQuery on the host's read-only database login when one is registered with the action
800
+ * engine, otherwise on the default provider.
801
+ */
802
+ private adhocSqlRunner;
658
803
  /**
659
804
  * Infer an artifact type name from a MIME type so ArtifactToolManager
660
805
  * can resolve the correct tool library.
@@ -1 +1 @@
1
- {"version":3,"file":"AgentRunner.d.ts","sourceRoot":"","sources":["../src/AgentRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAsG,QAAQ,EAAE,iBAAiB,EAAsC,MAAM,sBAAsB,CAAC;AAG3M,OAAO,EACH,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAErE,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAA+C,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA4BzG;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,aAAa,EAAE,SAAS,mBAAmB,EAAE,GAAG,SAAS,EACzD,eAAe,EAAE,mBAAmB,GAAG,SAAS,GACjD,m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