@memberjunction/ai-agents 6.2.0-edge.0 → 6.2.0-edge.1
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/README.md +25 -0
- package/dist/AgentDataPreloader.d.ts +4 -0
- package/dist/AgentDataPreloader.d.ts.map +1 -1
- package/dist/AgentDataPreloader.js +10 -2
- package/dist/AgentDataPreloader.js.map +1 -1
- package/dist/AgentRunner.d.ts +9 -4
- package/dist/AgentRunner.d.ts.map +1 -1
- package/dist/AgentRunner.js +39 -27
- package/dist/AgentRunner.js.map +1 -1
- package/dist/ArtifactToolManager.d.ts +4 -4
- package/dist/ArtifactToolManager.js +10 -10
- package/dist/ConversationToolManager.d.ts +16 -3
- package/dist/ConversationToolManager.d.ts.map +1 -1
- package/dist/ConversationToolManager.js +28 -5
- package/dist/ConversationToolManager.js.map +1 -1
- package/dist/PayloadChangeAnalyzer.d.ts +4 -0
- package/dist/PayloadChangeAnalyzer.d.ts.map +1 -1
- package/dist/PayloadChangeAnalyzer.js +10 -2
- package/dist/PayloadChangeAnalyzer.js.map +1 -1
- package/dist/PayloadFeedbackManager.d.ts +8 -0
- package/dist/PayloadFeedbackManager.d.ts.map +1 -1
- package/dist/PayloadFeedbackManager.js +20 -4
- package/dist/PayloadFeedbackManager.js.map +1 -1
- package/dist/PayloadManager.d.ts +27 -0
- package/dist/PayloadManager.d.ts.map +1 -1
- package/dist/PayloadManager.js +47 -15
- package/dist/PayloadManager.js.map +1 -1
- package/dist/agent-types/base-agent-type.d.ts +16 -0
- package/dist/agent-types/base-agent-type.d.ts.map +1 -1
- package/dist/agent-types/base-agent-type.js +20 -1
- package/dist/agent-types/base-agent-type.js.map +1 -1
- package/dist/agent-types/flow-agent-type.d.ts +9 -0
- package/dist/agent-types/flow-agent-type.d.ts.map +1 -1
- package/dist/agent-types/flow-agent-type.js +18 -5
- package/dist/agent-types/flow-agent-type.js.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.d.ts +74 -0
- package/dist/agent-types/loop-agent-prompt-params.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.js +2 -0
- package/dist/agent-types/loop-agent-prompt-params.js.map +1 -1
- package/dist/artifact-target-plan.d.ts +2 -0
- package/dist/artifact-target-plan.d.ts.map +1 -1
- package/dist/artifact-target-plan.js +5 -1
- package/dist/artifact-target-plan.js.map +1 -1
- package/dist/base-agent.d.ts +394 -3
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +889 -77
- package/dist/base-agent.js.map +1 -1
- package/dist/constants.d.ts +57 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +70 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/memory-manager-agent.d.ts +12 -12
- package/dist/memory-manager-agent.js +65 -65
- package/dist/native-tools/action-tool-builder.d.ts +8 -0
- package/dist/native-tools/action-tool-builder.d.ts.map +1 -1
- package/dist/native-tools/action-tool-builder.js +22 -6
- package/dist/native-tools/action-tool-builder.js.map +1 -1
- package/dist/native-tools/control-tools.d.ts +8 -0
- package/dist/native-tools/control-tools.d.ts.map +1 -1
- package/dist/native-tools/control-tools.js +25 -9
- package/dist/native-tools/control-tools.js.map +1 -1
- package/dist/native-tools/dual-channel.d.ts +2 -0
- package/dist/native-tools/dual-channel.d.ts.map +1 -1
- package/dist/native-tools/dual-channel.js +5 -1
- package/dist/native-tools/dual-channel.js.map +1 -1
- package/dist/native-tools/tool-result-turns.d.ts +9 -0
- package/dist/native-tools/tool-result-turns.d.ts.map +1 -1
- package/dist/native-tools/tool-result-turns.js +15 -3
- package/dist/native-tools/tool-result-turns.js.map +1 -1
- package/dist/pipeline/coerce.d.ts +14 -0
- package/dist/pipeline/coerce.d.ts.map +1 -1
- package/dist/pipeline/coerce.js +37 -9
- package/dist/pipeline/coerce.js.map +1 -1
- package/dist/pipeline/jsonpath-eval.d.ts +4 -0
- package/dist/pipeline/jsonpath-eval.d.ts.map +1 -1
- package/dist/pipeline/jsonpath-eval.js +10 -2
- package/dist/pipeline/jsonpath-eval.js.map +1 -1
- package/dist/pipeline/operators.js +16 -16
- package/dist/pipeline/path.d.ts +6 -0
- package/dist/pipeline/path.d.ts.map +1 -1
- package/dist/pipeline/path.js +17 -5
- package/dist/pipeline/path.js.map +1 -1
- package/dist/pipeline/pipeline-executor.js +10 -10
- package/dist/pipeline/predicate.d.ts +4 -0
- package/dist/pipeline/predicate.d.ts.map +1 -1
- package/dist/pipeline/predicate.js +15 -7
- package/dist/pipeline/predicate.js.map +1 -1
- package/dist/pipeline/providers/action-provider.js +2 -2
- package/dist/pipeline/providers/artifact-tool-provider.js +2 -2
- package/dist/pipeline/providers/serialize.d.ts +4 -0
- package/dist/pipeline/providers/serialize.d.ts.map +1 -1
- package/dist/pipeline/providers/serialize.js +10 -2
- package/dist/pipeline/providers/serialize.js.map +1 -1
- package/dist/pipeline/template.d.ts +4 -0
- package/dist/pipeline/template.d.ts.map +1 -1
- package/dist/pipeline/template.js +15 -7
- package/dist/pipeline/template.js.map +1 -1
- package/dist/realtime/agent-media-library.d.ts +10 -0
- package/dist/realtime/agent-media-library.d.ts.map +1 -1
- package/dist/realtime/agent-media-library.js +29 -9
- package/dist/realtime/agent-media-library.js.map +1 -1
- package/dist/realtime/media-channel-server.js +2 -2
- package/dist/realtime/meeting-controls-state.d.ts +2 -0
- package/dist/realtime/meeting-controls-state.d.ts.map +1 -1
- package/dist/realtime/meeting-controls-state.js +6 -2
- package/dist/realtime/meeting-controls-state.js.map +1 -1
- package/dist/realtime/realtime-channel-server-data-context.d.ts +2 -0
- package/dist/realtime/realtime-channel-server-data-context.d.ts.map +1 -1
- package/dist/realtime/realtime-channel-server-data-context.js +5 -1
- package/dist/realtime/realtime-channel-server-data-context.js.map +1 -1
- package/dist/realtime/realtime-channel-server-host.js +2 -2
- package/dist/realtime/realtime-client-session-service.d.ts +4 -0
- package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
- package/dist/realtime/realtime-client-session-service.js +15 -6
- package/dist/realtime/realtime-client-session-service.js.map +1 -1
- package/dist/realtime/realtime-coagent-config.d.ts +2 -0
- package/dist/realtime/realtime-coagent-config.d.ts.map +1 -1
- package/dist/realtime/realtime-coagent-config.js +6 -2
- package/dist/realtime/realtime-coagent-config.js.map +1 -1
- package/dist/realtime/realtime-recording-store.d.ts +15 -0
- package/dist/realtime/realtime-recording-store.d.ts.map +1 -1
- package/dist/realtime/realtime-recording-store.js +31 -7
- package/dist/realtime/realtime-recording-store.js.map +1 -1
- package/dist/realtime/realtime-session-runner.d.ts +4 -4
- package/dist/realtime/realtime-session-runner.js +9 -9
- package/dist/realtime/realtime-session-runner.js.map +1 -1
- package/dist/runtime-state-fragment.d.ts +101 -0
- package/dist/runtime-state-fragment.d.ts.map +1 -0
- package/dist/runtime-state-fragment.js +173 -0
- package/dist/runtime-state-fragment.js.map +1 -0
- package/dist/types/payload-operations.d.ts +8 -0
- package/dist/types/payload-operations.d.ts.map +1 -1
- package/dist/types/payload-operations.js +21 -5
- package/dist/types/payload-operations.js.map +1 -1
- package/dist/utils/ConversationMessageResolver.d.ts +4 -0
- package/dist/utils/ConversationMessageResolver.d.ts.map +1 -1
- package/dist/utils/ConversationMessageResolver.js +10 -2
- package/dist/utils/ConversationMessageResolver.js.map +1 -1
- package/dist/volatile-child-prompt.d.ts +33 -0
- package/dist/volatile-child-prompt.d.ts.map +1 -0
- package/dist/volatile-child-prompt.js +76 -0
- package/dist/volatile-child-prompt.js.map +1 -0
- package/package.json +20 -18
package/README.md
CHANGED
|
@@ -460,6 +460,17 @@ The Memory Manager runs on a schedule (every ~15 minutes). `AIEngineBase` alread
|
|
|
460
460
|
* **Single source of truth for status**: note status filtering reuses `IsInjectableNoteStatus()` from `@memberjunction/core-entities` (Active + Provisional), the same predicate the read-path injection/scoping queries use, so the maintenance set can never drift from the injectable set.
|
|
461
461
|
* **Intentional exceptions** (still hit the DB): the **hardening pass** loads `entity_object` provisional notes *specifically to mutate them*, so it reads fresh, owned entities; the resolved-source-chain loader keeps a targeted `RunView` **only** for note IDs the cache misses; and `MJ: AI Agent Runs` reads stay as queries because runs are transactional and not cached by `AIEngineBase`.
|
|
462
462
|
|
|
463
|
+
### 6. Trailing Runtime State (prompt-cache layout)
|
|
464
|
+
The Loop agent's volatile per-iteration state — current date/time, Scratchpad State and Payload — is never rendered in the system prompt. `preparePromptParams` builds it into a `<mj-runtime-state>` fragment (`RuntimeStateFragmentBuilder`) appended as the **final user message** of each request, and the system prompt carries a static `## Runtime State` pointer. Provider prompt caching is a prefix match over `tools → system → messages`, so a byte-stable system prompt lets the entire history cache incrementally: measured on Sage, 0% → 78–90% cached on Anthropic and OpenAI, 21% → 91% on xAI, 30–65% → 66–96% on Gemini and Cerebras, with prompt cost per million tokens down 37–80%.
|
|
465
|
+
|
|
466
|
+
* **Per-provider retention** — providers with a byte-prefix cache (OpenAI, xAI) need prior fragments *retained* and the new one appended; block-cache providers (Anthropic, Gemini, Cerebras) get the previous fragment *replaced*. The choice is the model catalog's `ModelConfiguration.LLM.PrefixPromptCache` flag, set under the vendor row's `Configuration.ModelDefaults` and inherited by every model it serves unless a model-vendor row overrides it (`BaseAgent.resolvePrefixPromptCache` → `AIEngine.GetEffectiveModelConfiguration`, cascade Model Types < Models < Vendors' `Configuration.ModelDefaults` < Model Vendors), decided once per run and frozen. No provider names live in code.
|
|
467
|
+
* **Escaping at send time** — the fragment tag literals are escaped in every non-system message of the outgoing *copy* of the history, so no tool result, user turn or tool-call argument can pose as framework state; the stored history is never mutated.
|
|
468
|
+
* **Delivery gate** — the fragment is only sent when the system prompt template carries the pointer; a template still embedding the old blocks (unsynced database) or one with neither (Flow, custom prompts) gets none. Markers: `VOLATILE_TEMPLATE_MARKERS`, overridable via the protected `volatileTemplateMarkers` getter.
|
|
469
|
+
* **Specialization placement** — `specializationPlacement: auto` relocates a child prompt into the fragment (`<mj-agent-specialization>`) only when its unrendered template references a volatile placeholder, handing the runner the pre-rendered text via `AIPromptParams.PreRenderedChildTemplates`.
|
|
470
|
+
* **Anthropic breakpoint** — `BaseLLM.splitTrailingVolatileState` lets `AnthropicLLM` place its `cache_control` breakpoint on the last real history message and send the fragment uncached.
|
|
471
|
+
|
|
472
|
+
All placeholder names, tag literals and headings are in [`src/constants.ts`](./src/constants.ts). Full mechanism: [Agent Prompt Caching Guide](../../../guides/AGENT_PROMPT_CACHING_GUIDE.md); numbers: [Performance and Cost Briefing](./docs/PROMPT_CACHE_PERFORMANCE_BRIEFING.md).
|
|
473
|
+
|
|
463
474
|
## Cross-Turn Conversation Compaction & History Retrieval
|
|
464
475
|
|
|
465
476
|
Long conversations no longer grow the agent's context without bound. Two cooperating layers (design: [`plans/agent-conversation-compaction.md`](../../../plans/agent-conversation-compaction.md)) activate **only when a run carries `ExecuteAgentParams.conversationId`** — programmatic runs, sub-agents, and tests without a conversation are untouched:
|
|
@@ -472,6 +483,18 @@ Long conversations no longer grow the agent's context without bound. Two coopera
|
|
|
472
483
|
|
|
473
484
|
**Prior-turn tool-result carry-forward.** Because each turn rebuilds its messages from the conversation window, a tool result paged in on turn N would be gone on turn N+1. `injectPriorTurnToolResults` re-injects the same agent's immediately previous settled root run's successful read-tool results (eligibility decided by the `toolFamily` stamped in each Tool step's `OutputData`) as one transient, compactable message — one-turn memory by construction, scoped by `AgentID` so parallel agents in one conversation never inherit each other's results. The per-turn prior-run lookup is served by `PriorTurnToolResultCache` (a `BaseSingleton` wrapping `MJLruCache`, keyed by conversation + agent): the settling root run publishes its own Tool-step projections from memory at finalize — an empty array for tool-free runs, so the common case costs **zero DB queries per turn** — and the loader falls back to the original RunView pair only on a cache miss. Both loaders share one entity-typed predicate (`BaseAgent.carryForwardPredicate` + `settledRunStatuses`) so the SQL filter and the in-memory projection cannot drift; freshness semantics and the multi-node staleness bound are documented on the cache class.
|
|
474
485
|
|
|
486
|
+
## Action Failure Circuit Breaker
|
|
487
|
+
|
|
488
|
+
`executeActionsStep` now reports an action's real outcome (`ActionResult.Success`, result code, message) — previously a failed action was reported to the model as a success and agents retried unconfigured tools until the run timed out. On top of that, `ExecuteSingleAction` applies a run-scoped breaker before dispatching, checked fatal → identical-arguments → budget:
|
|
489
|
+
|
|
490
|
+
| Rule | Trigger | Effect |
|
|
491
|
+
|---|---|---|
|
|
492
|
+
| Fatal lockout | One credential / service-configuration failure (`isFatalActionError`; parameter-level "not configured" messages are deliberately non-fatal) | Action disabled for the run, any arguments |
|
|
493
|
+
| Identical arguments | `IDENTICAL_FAILURE_THRESHOLD` (2) failures with the same normalized arguments | Calls with those arguments blocked; other arguments dispatch |
|
|
494
|
+
| Attempt budget | `ACTION_FAILURE_BUDGET` (5) consecutive failures, any arguments | Action disabled for the run |
|
|
495
|
+
|
|
496
|
+
A success clears both counters. A blocked call returns a `CircuitBreakerActionResult` (carrying `Reason`) in ~0 ms without reaching the action engine, and the model receives a `[CRITICAL/ACTION_UNAVAILABLE | REPEATED_IDENTICAL_CALL | ATTEMPTS_EXHAUSTED]` directive as a user message (a `[WARNING/ACTION_FAILURE]` with an "attempt N of 5" counter otherwise). Argument identity is `normalizeActionParams` (three protected layers: outer → per-entry → recursive value). The pipeline registry and the ForEach / While operators pass `{ skipCircuitBreaker: true }` and bypass every rule, leaving the history untouched. Evidence and thresholds: [Performance and Cost Briefing §4](./docs/PROMPT_CACHE_PERFORMANCE_BRIEFING.md).
|
|
497
|
+
|
|
475
498
|
## Documentation
|
|
476
499
|
|
|
477
500
|
Detailed guides are available in the [`docs/`](./docs/) directory:
|
|
@@ -479,6 +502,8 @@ Detailed guides are available in the [`docs/`](./docs/) directory:
|
|
|
479
502
|
| Guide | Description |
|
|
480
503
|
|---|---|
|
|
481
504
|
| [Actions Guide](./docs/actions-guide.md) | Action discovery, execution, result lifecycle, expiration/compaction, context recovery |
|
|
505
|
+
| [Prompt-Cache Performance and Cost Briefing](./docs/PROMPT_CACHE_PERFORMANCE_BRIEFING.md) | Before/after cached share and cost per model and topology for the trailing runtime-state layout; the action circuit breaker's before/after; what to re-measure |
|
|
506
|
+
| [Agent Prompt Caching Guide](../../../guides/AGENT_PROMPT_CACHING_GUIDE.md) | Repo-level guide: the trailing-state layout, the `PrefixPromptCache` flag from the model catalog, the Anthropic breakpoint seam, specialization placement, the circuit breaker |
|
|
482
507
|
| [Client Tools Guide](./docs/CLIENT_TOOLS_GUIDE.md) | Browser-side tool invocation, runtime decoration, timeout config, prompt design, security |
|
|
483
508
|
| [Sub-Agents Guide](./docs/sub-agents-guide.md) | Child agents, related agents, payload flow, context propagation, loops |
|
|
484
509
|
| [Human-in-the-Loop](./docs/HUMAN_IN_THE_LOOP.md) | Feedback requests, assignment strategies, request lifecycle |
|
|
@@ -82,11 +82,15 @@ export declare class AgentDataPreloader extends BaseSingleton<AgentDataPreloader
|
|
|
82
82
|
*
|
|
83
83
|
* @param {string} runId - The run ID to clear cache for
|
|
84
84
|
*/
|
|
85
|
+
ClearRunCache(runId: string): void;
|
|
86
|
+
/** @deprecated Use {@link ClearRunCache}. */
|
|
85
87
|
clearRunCache(runId: string): void;
|
|
86
88
|
/**
|
|
87
89
|
* Clears all per-agent cached data.
|
|
88
90
|
* Can be called to force refresh of global cached data.
|
|
89
91
|
*/
|
|
92
|
+
ClearAgentCache(): void;
|
|
93
|
+
/** @deprecated Use {@link ClearAgentCache}. */
|
|
90
94
|
clearAgentCache(): void;
|
|
91
95
|
/**
|
|
92
96
|
* Resolves all data sources with bounded concurrency, preserving input order
|
|
@@ -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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ACI,eAAe,IAAI,IAAI;IAS9B,+CAA+C;IACxC,eAAe,IAAI,IAAI;IAI9B;;;;;;OAMG;YACW,kBAAkB;IAwChC;;;;OAIG;YACW,uBAAuB;IAiBrC;;;;;OAKG;YACW,iBAAiB;IAiC/B;;;;OAIG;YACW,cAAc;IAmC5B;;;;OAIG;YACW,eAAe;IAiC7B;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAsCrB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAmCjB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CAG9B"}
|
|
@@ -164,7 +164,7 @@ export class AgentDataPreloader extends BaseSingleton {
|
|
|
164
164
|
*
|
|
165
165
|
* @param {string} runId - The run ID to clear cache for
|
|
166
166
|
*/
|
|
167
|
-
|
|
167
|
+
ClearRunCache(runId) {
|
|
168
168
|
this._perRunCache.delete(runId);
|
|
169
169
|
LogStatusEx({
|
|
170
170
|
message: `AgentDataPreloader: Cleared per-run cache for run ${runId}`,
|
|
@@ -172,11 +172,15 @@ export class AgentDataPreloader extends BaseSingleton {
|
|
|
172
172
|
isVerboseEnabled: IsVerboseLoggingEnabled
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
+
/** @deprecated Use {@link ClearRunCache}. */
|
|
176
|
+
clearRunCache(runId) {
|
|
177
|
+
return this.ClearRunCache(runId);
|
|
178
|
+
}
|
|
175
179
|
/**
|
|
176
180
|
* Clears all per-agent cached data.
|
|
177
181
|
* Can be called to force refresh of global cached data.
|
|
178
182
|
*/
|
|
179
|
-
|
|
183
|
+
ClearAgentCache() {
|
|
180
184
|
this._perAgentCache.clear();
|
|
181
185
|
LogStatusEx({
|
|
182
186
|
message: `AgentDataPreloader: Cleared all per-agent cache`,
|
|
@@ -184,6 +188,10 @@ export class AgentDataPreloader extends BaseSingleton {
|
|
|
184
188
|
isVerboseEnabled: IsVerboseLoggingEnabled
|
|
185
189
|
});
|
|
186
190
|
}
|
|
191
|
+
/** @deprecated Use {@link ClearAgentCache}. */
|
|
192
|
+
clearAgentCache() {
|
|
193
|
+
return this.ClearAgentCache();
|
|
194
|
+
}
|
|
187
195
|
/**
|
|
188
196
|
* Resolves all data sources with bounded concurrency, preserving input order
|
|
189
197
|
* in the returned result array. Each item is wrapped so the caller can
|
|
@@ -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,GAAG,MAAM,IA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|
28
28
|
* Callers surface this as a single "open the artifact" affordance, so a document-generating run
|
|
29
29
|
* used to point at raw JSON. With several files, the first is the primary one.
|
|
30
30
|
*/
|
|
31
|
+
export declare function SelectPrimaryArtifact(fileArtifacts: readonly CreatedArtifactInfo[] | undefined, payloadArtifact: CreatedArtifactInfo | undefined): CreatedArtifactInfo | undefined;
|
|
32
|
+
/** @deprecated Use {@link SelectPrimaryArtifact}. */
|
|
31
33
|
export declare function selectPrimaryArtifact(fileArtifacts: readonly CreatedArtifactInfo[] | undefined, payloadArtifact: CreatedArtifactInfo | undefined): CreatedArtifactInfo | undefined;
|
|
32
34
|
/**
|
|
33
35
|
* AgentRunner provides a thin wrapper for executing AI agents.
|
|
@@ -275,7 +277,7 @@ export declare class AgentRunner {
|
|
|
275
277
|
* @param value - Any value, however malformed.
|
|
276
278
|
* @returns A short single-line description, never throwing.
|
|
277
279
|
*/
|
|
278
|
-
private static
|
|
280
|
+
private static describeUntrustedValue;
|
|
279
281
|
/**
|
|
280
282
|
* Escapes an id for interpolation into a `RunView.ExtraFilter`, warning when the value cannot
|
|
281
283
|
* be an id at all.
|
|
@@ -291,7 +293,7 @@ export declare class AgentRunner {
|
|
|
291
293
|
* @param label - What the id is, for the warning.
|
|
292
294
|
* @returns The escaped id, ready to sit inside single quotes.
|
|
293
295
|
*/
|
|
294
|
-
private static
|
|
296
|
+
private static filterId;
|
|
295
297
|
/**
|
|
296
298
|
* Coerces one of a directive's free-text fields into something safe to persist.
|
|
297
299
|
*
|
|
@@ -305,7 +307,7 @@ export declare class AgentRunner {
|
|
|
305
307
|
* @param maxLength - Column limit to clamp to; omit for `nvarchar(MAX)` columns.
|
|
306
308
|
* @returns The trimmed (and clamped) text, or `undefined` when there is nothing usable.
|
|
307
309
|
*/
|
|
308
|
-
private static
|
|
310
|
+
private static safeDirectiveText;
|
|
309
311
|
/**
|
|
310
312
|
* Vets one rung of the version-target ladder, returning the plan with a normalized id when the
|
|
311
313
|
* target is usable and `null` when the caller should fall back.
|
|
@@ -396,7 +398,7 @@ export declare class AgentRunner {
|
|
|
396
398
|
* @returns Generated conversation name and description, or null if generation failed
|
|
397
399
|
* @private
|
|
398
400
|
*/
|
|
399
|
-
private
|
|
401
|
+
private generateConversationName;
|
|
400
402
|
/**
|
|
401
403
|
* Saves media outputs to AIAgentRunMedia table for permanent storage.
|
|
402
404
|
* Creates a record for each media output promoted during agent execution.
|
|
@@ -572,6 +574,9 @@ export declare class AgentRunner {
|
|
|
572
574
|
* Gathers all artifacts from a conversation (both artifact-system records and
|
|
573
575
|
* uploaded file attachments) so the ArtifactToolManager can make them available
|
|
574
576
|
* to the agent as input artifacts.
|
|
577
|
+
*
|
|
578
|
+
* @param historyFrom The run's history floor (`ExecuteAgentParams.ConversationHistoryFrom`).
|
|
579
|
+
* When set, only artifacts attached to messages written at or after it are gathered.
|
|
575
580
|
*/
|
|
576
581
|
private gatherConversationArtifacts;
|
|
577
582
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRunner.d.ts","sourceRoot":"","sources":["../src/AgentRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAA0F,QAAQ,EAAE,iBAAiB,EAAsC,MAAM,sBAAsB,CAAC;AAG/L,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"AgentRunner.d.ts","sourceRoot":"","sources":["../src/AgentRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAA0F,QAAQ,EAAE,iBAAiB,EAAsC,MAAM,sBAAsB,CAAC;AAG/L,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAA4D,MAAM,8BAA8B,CAAC;AAC5K,OAAO,EAA+C,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAwBzG;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MA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;;;;;;;;;;;;;;;;OAgBG;YACW,uBAAuB;IAgDrC;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAS7B;;;;;;;;OAQG;YACW,2BAA2B;CAyC5C"}
|
package/dist/AgentRunner.js
CHANGED
|
@@ -13,9 +13,10 @@ import { createHash } from 'crypto';
|
|
|
13
13
|
import { LogError, LogStatusEx, IsVerboseLoggingEnabled, LogStatus, Metadata, RunView, RunQuery, ProviderType } from '@memberjunction/core';
|
|
14
14
|
import { MJGlobal, UUIDsEqual, IsValidUUID, EscapeSQLString } from '@memberjunction/global';
|
|
15
15
|
import { AIEngine } from '@memberjunction/aiengine';
|
|
16
|
-
import {
|
|
16
|
+
import { ResolvePromptRunUserID } from '@memberjunction/ai-core-plus';
|
|
17
|
+
import { PlanArtifactTarget, IsKnownArtifactBehavior } from './artifact-target-plan.js';
|
|
17
18
|
import { BaseAgent } from './base-agent.js';
|
|
18
|
-
import { MJEnvironmentEntityExtended, ArtifactMetadataEngine, ExtractBase64FromDataUrl, DecideInlineStorage } from '@memberjunction/core-entities';
|
|
19
|
+
import { MJEnvironmentEntityExtended, ArtifactMetadataEngine, ConversationEngine, ExtractBase64FromDataUrl, DecideInlineStorage } from '@memberjunction/core-entities';
|
|
19
20
|
import { FileStorageEngine } from '@memberjunction/storage';
|
|
20
21
|
/**
|
|
21
22
|
* Choose the artifact a run should be represented by.
|
|
@@ -25,9 +26,13 @@ import { FileStorageEngine } from '@memberjunction/storage';
|
|
|
25
26
|
* Callers surface this as a single "open the artifact" affordance, so a document-generating run
|
|
26
27
|
* used to point at raw JSON. With several files, the first is the primary one.
|
|
27
28
|
*/
|
|
28
|
-
export function
|
|
29
|
+
export function SelectPrimaryArtifact(fileArtifacts, payloadArtifact) {
|
|
29
30
|
return fileArtifacts?.[0] ?? payloadArtifact;
|
|
30
31
|
}
|
|
32
|
+
/** @deprecated Use {@link SelectPrimaryArtifact}. */
|
|
33
|
+
export function selectPrimaryArtifact(fileArtifacts, payloadArtifact) {
|
|
34
|
+
return SelectPrimaryArtifact(fileArtifacts, payloadArtifact);
|
|
35
|
+
}
|
|
31
36
|
/**
|
|
32
37
|
* AgentRunner provides a thin wrapper for executing AI agents.
|
|
33
38
|
*
|
|
@@ -211,7 +216,7 @@ export class AgentRunner {
|
|
|
211
216
|
let conversationDescription = null;
|
|
212
217
|
if (!conversationName && options.userMessage) {
|
|
213
218
|
// Try to generate a name using the "Name Conversation" prompt (same as UI)
|
|
214
|
-
const nameResult = await this.
|
|
219
|
+
const nameResult = await this.generateConversationName(options.userMessage, contextUser, md);
|
|
215
220
|
if (nameResult) {
|
|
216
221
|
conversationName = nameResult.name;
|
|
217
222
|
conversationDescription = nameResult.description;
|
|
@@ -308,7 +313,7 @@ export class AgentRunner {
|
|
|
308
313
|
// the conversation with the artifact already available." This means ALL artifacts
|
|
309
314
|
// in the conversation (both agent-produced Output and user-attached Input) should
|
|
310
315
|
// be available to the agent via artifact tools.
|
|
311
|
-
const inputArtifacts = await this.gatherConversationArtifacts(conversationId, contextUser);
|
|
316
|
+
const inputArtifacts = await this.gatherConversationArtifacts(conversationId, contextUser, params.ConversationHistoryFrom);
|
|
312
317
|
const modifiedParams = {
|
|
313
318
|
...params,
|
|
314
319
|
// First-class conversationId gates the cross-turn context features
|
|
@@ -475,7 +480,7 @@ export class AgentRunner {
|
|
|
475
480
|
// snapshot of the agent's internal state, useful when the payload IS the deliverable
|
|
476
481
|
// (a report agent) and misleading when it is not — a document run reported the
|
|
477
482
|
// payload, so "open the artifact" opened raw JSON instead of the document.
|
|
478
|
-
const artifactInfo =
|
|
483
|
+
const artifactInfo = SelectPrimaryArtifact(fileArtifacts, payloadArtifact);
|
|
479
484
|
return {
|
|
480
485
|
agentResult,
|
|
481
486
|
conversationId,
|
|
@@ -522,7 +527,7 @@ export class AgentRunner {
|
|
|
522
527
|
const rv = RunView.FromMetadataProvider(provider || this._provider);
|
|
523
528
|
const result = await rv.RunView({
|
|
524
529
|
EntityName: 'MJ: Artifact Versions',
|
|
525
|
-
ExtraFilter: `ArtifactID='${AgentRunner.
|
|
530
|
+
ExtraFilter: `ArtifactID='${AgentRunner.filterId(artifactId, 'GetMaxVersionForArtifact artifactId')}'`,
|
|
526
531
|
OrderBy: 'VersionNumber DESC',
|
|
527
532
|
MaxRows: 1,
|
|
528
533
|
ResultType: 'entity_object'
|
|
@@ -562,13 +567,13 @@ export class AgentRunner {
|
|
|
562
567
|
const latestVersion = Number(latestVersionNumber);
|
|
563
568
|
if (!Number.isFinite(latestVersion)) {
|
|
564
569
|
LogError(`CheckForDuplicateVersion: latestVersionNumber is not a finite number ` +
|
|
565
|
-
`("${AgentRunner.
|
|
570
|
+
`("${AgentRunner.describeUntrustedValue(latestVersionNumber)}") — skipping the duplicate check`);
|
|
566
571
|
return null;
|
|
567
572
|
}
|
|
568
573
|
const rv = RunView.FromMetadataProvider(provider || this._provider);
|
|
569
574
|
const result = await rv.RunView({
|
|
570
575
|
EntityName: 'MJ: Artifact Versions',
|
|
571
|
-
ExtraFilter: `ArtifactID='${AgentRunner.
|
|
576
|
+
ExtraFilter: `ArtifactID='${AgentRunner.filterId(artifactId, 'CheckForDuplicateVersion artifactId')}' AND VersionNumber=${latestVersion}`,
|
|
572
577
|
Fields: ['ID', 'ContentHash'],
|
|
573
578
|
MaxRows: 1,
|
|
574
579
|
ResultType: 'simple'
|
|
@@ -626,7 +631,7 @@ export class AgentRunner {
|
|
|
626
631
|
const rv = RunView.FromMetadataProvider(provider || this._provider);
|
|
627
632
|
const result = await rv.RunView({
|
|
628
633
|
EntityName: 'MJ: Conversation Detail Artifacts',
|
|
629
|
-
ExtraFilter: `ConversationDetailID='${AgentRunner.
|
|
634
|
+
ExtraFilter: `ConversationDetailID='${AgentRunner.filterId(conversationDetailId, 'FindPreviousArtifactForMessage conversationDetailId')}' AND Direction='Output'`,
|
|
630
635
|
OrderBy: '__mj_CreatedAt DESC',
|
|
631
636
|
MaxRows: 1,
|
|
632
637
|
ResultType: 'entity_object'
|
|
@@ -727,7 +732,7 @@ export class AgentRunner {
|
|
|
727
732
|
const directive = behaviorRecognized ? rawDirective : undefined;
|
|
728
733
|
if (!behaviorRecognized) {
|
|
729
734
|
LogError(`Ignoring artifact directive from agent "${agent?.Name}": unrecognized behavior ` +
|
|
730
|
-
`("${AgentRunner.
|
|
735
|
+
`("${AgentRunner.describeUntrustedValue(rawDirective.behavior)}") — using the historical chain instead`);
|
|
731
736
|
}
|
|
732
737
|
// planArtifactTarget discards a non-string targetArtifactId silently (it is pure and
|
|
733
738
|
// cannot log). Before this check lived in the pure function, VetArtifactVersionTarget
|
|
@@ -738,11 +743,11 @@ export class AgentRunner {
|
|
|
738
743
|
const rawTarget = directive.targetArtifactId;
|
|
739
744
|
if (rawTarget !== undefined && rawTarget !== null && typeof rawTarget !== 'string') {
|
|
740
745
|
LogError(`Ignoring targetArtifactId from agent "${agent?.Name}": ` +
|
|
741
|
-
`"${AgentRunner.
|
|
746
|
+
`"${AgentRunner.describeUntrustedValue(rawTarget)}" is not a string — ` +
|
|
742
747
|
`versioning the run's sourceArtifactId instead`);
|
|
743
748
|
}
|
|
744
749
|
}
|
|
745
|
-
let plan =
|
|
750
|
+
let plan = PlanArtifactTarget(directive, sourceArtifactId);
|
|
746
751
|
if (plan.kind === 'suppress') {
|
|
747
752
|
LogStatus(`Skipping artifact creation - agent "${agent?.Name}" suppressed artifacts for this step`);
|
|
748
753
|
return undefined;
|
|
@@ -761,7 +766,7 @@ export class AgentRunner {
|
|
|
761
766
|
break;
|
|
762
767
|
}
|
|
763
768
|
plan = plan.source === 'directive'
|
|
764
|
-
?
|
|
769
|
+
? PlanArtifactTarget(undefined, sourceArtifactId) // drop the directive, keep the caller's id
|
|
765
770
|
: { kind: 'legacy' }; // the caller's own id failed; nothing left to try
|
|
766
771
|
}
|
|
767
772
|
let artifactId;
|
|
@@ -812,7 +817,7 @@ export class AgentRunner {
|
|
|
812
817
|
}
|
|
813
818
|
LogStatus(`Created artifact version ${newVersionNumber} (${version.ID})`);
|
|
814
819
|
// First version of a new artifact: adopt the extracted Name attribute unless the agent named it
|
|
815
|
-
if (isNewArtifact && newVersionNumber === 1 && !AgentRunner.
|
|
820
|
+
if (isNewArtifact && newVersionNumber === 1 && !AgentRunner.safeDirectiveText(directive?.name, AgentRunner.ARTIFACT_NAME_MAX_LENGTH)) {
|
|
816
821
|
const nameAttr = version.Attributes?.find((attr) => attr.StandardProperty === 'name' || attr.Name?.toLowerCase() === 'name');
|
|
817
822
|
let extractedName = nameAttr?.Value?.trim();
|
|
818
823
|
if (extractedName && extractedName.toLowerCase() !== 'null') {
|
|
@@ -849,7 +854,7 @@ export class AgentRunner {
|
|
|
849
854
|
* @param value - Any value, however malformed.
|
|
850
855
|
* @returns A short single-line description, never throwing.
|
|
851
856
|
*/
|
|
852
|
-
static
|
|
857
|
+
static describeUntrustedValue(value) {
|
|
853
858
|
let text;
|
|
854
859
|
try {
|
|
855
860
|
text = typeof value === 'string' ? value : (JSON.stringify(value) ?? Object.prototype.toString.call(value));
|
|
@@ -875,9 +880,9 @@ export class AgentRunner {
|
|
|
875
880
|
* @param label - What the id is, for the warning.
|
|
876
881
|
* @returns The escaped id, ready to sit inside single quotes.
|
|
877
882
|
*/
|
|
878
|
-
static
|
|
883
|
+
static filterId(id, label) {
|
|
879
884
|
if (!IsValidUUID(id)) {
|
|
880
|
-
LogError(`${label} is not a UUID-shaped id ("${AgentRunner.
|
|
885
|
+
LogError(`${label} is not a UUID-shaped id ("${AgentRunner.describeUntrustedValue(id)}") — this query cannot match a row`);
|
|
881
886
|
}
|
|
882
887
|
return EscapeSQLString(id);
|
|
883
888
|
}
|
|
@@ -894,7 +899,7 @@ export class AgentRunner {
|
|
|
894
899
|
* @param maxLength - Column limit to clamp to; omit for `nvarchar(MAX)` columns.
|
|
895
900
|
* @returns The trimmed (and clamped) text, or `undefined` when there is nothing usable.
|
|
896
901
|
*/
|
|
897
|
-
static
|
|
902
|
+
static safeDirectiveText(value, maxLength) {
|
|
898
903
|
if (typeof value !== 'string') {
|
|
899
904
|
return undefined;
|
|
900
905
|
}
|
|
@@ -977,7 +982,7 @@ export class AgentRunner {
|
|
|
977
982
|
async VetArtifactVersionTarget(plan, contextUser, md, agentName, rejectedIds) {
|
|
978
983
|
const origin = plan.source === 'directive' ? `artifact directive from agent "${agentName}"` : 'sourceArtifactId';
|
|
979
984
|
if (typeof plan.artifactId !== 'string' || !IsValidUUID(plan.artifactId)) {
|
|
980
|
-
LogError(`Ignoring ${origin}: "${AgentRunner.
|
|
985
|
+
LogError(`Ignoring ${origin}: "${AgentRunner.describeUntrustedValue(plan.artifactId)}" is not a valid artifact ID`);
|
|
981
986
|
return null;
|
|
982
987
|
}
|
|
983
988
|
const artifactId = plan.artifactId.trim();
|
|
@@ -1038,10 +1043,10 @@ export class AgentRunner {
|
|
|
1038
1043
|
const agentName = agent?.Name || 'Agent';
|
|
1039
1044
|
// Both fields are model output: coerced, trimmed, and (for Name) clamped to its column so a
|
|
1040
1045
|
// long or non-string title cannot fail validation and take the whole artifact down with it.
|
|
1041
|
-
artifact.Name = AgentRunner.
|
|
1046
|
+
artifact.Name = AgentRunner.safeDirectiveText(directive?.name, AgentRunner.ARTIFACT_NAME_MAX_LENGTH)
|
|
1042
1047
|
|| `${agentName} Payload - ${new Date().toLocaleString()}`;
|
|
1043
1048
|
// Description is nvarchar(MAX), so there is no length to clamp to — only the type to check.
|
|
1044
|
-
artifact.Description = AgentRunner.
|
|
1049
|
+
artifact.Description = AgentRunner.safeDirectiveText(directive?.description)
|
|
1045
1050
|
|| `Payload returned by ${agentName}`;
|
|
1046
1051
|
// Use agent's DefaultArtifactTypeID if available
|
|
1047
1052
|
artifact.TypeID = agent?.DefaultArtifactTypeID || AgentRunner.JSON_ARTIFACT_TYPE_ID;
|
|
@@ -1073,7 +1078,7 @@ export class AgentRunner {
|
|
|
1073
1078
|
* @returns Generated conversation name and description, or null if generation failed
|
|
1074
1079
|
* @private
|
|
1075
1080
|
*/
|
|
1076
|
-
async
|
|
1081
|
+
async generateConversationName(userMessage, contextUser, provider) {
|
|
1077
1082
|
try {
|
|
1078
1083
|
// Import AIPromptRunner, AIPromptParams, and AIEngine
|
|
1079
1084
|
const { AIPromptRunner } = await import('@memberjunction/ai-prompts');
|
|
@@ -1091,6 +1096,7 @@ export class AgentRunner {
|
|
|
1091
1096
|
const promptParams = new AIPromptParams();
|
|
1092
1097
|
promptParams.prompt = prompt;
|
|
1093
1098
|
promptParams.contextUser = contextUser;
|
|
1099
|
+
promptParams.UserID = ResolvePromptRunUserID({ ContextUser: contextUser }) ?? undefined;
|
|
1094
1100
|
promptParams.conversationMessages = [{ role: 'user', content: userMessage }];
|
|
1095
1101
|
promptParams.provider = provider || this._provider;
|
|
1096
1102
|
const runner = new AIPromptRunner();
|
|
@@ -1643,7 +1649,7 @@ export class AgentRunner {
|
|
|
1643
1649
|
if (!conversationId) {
|
|
1644
1650
|
return params;
|
|
1645
1651
|
}
|
|
1646
|
-
const inputArtifacts = await this.gatherConversationArtifacts(conversationId, params.contextUser);
|
|
1652
|
+
const inputArtifacts = await this.gatherConversationArtifacts(conversationId, params.contextUser, params.ConversationHistoryFrom);
|
|
1647
1653
|
return inputArtifacts.length > 0 ? { ...params, inputArtifacts } : params;
|
|
1648
1654
|
}
|
|
1649
1655
|
/**
|
|
@@ -1665,14 +1671,20 @@ export class AgentRunner {
|
|
|
1665
1671
|
* Gathers all artifacts from a conversation (both artifact-system records and
|
|
1666
1672
|
* uploaded file attachments) so the ArtifactToolManager can make them available
|
|
1667
1673
|
* to the agent as input artifacts.
|
|
1674
|
+
*
|
|
1675
|
+
* @param historyFrom The run's history floor (`ExecuteAgentParams.ConversationHistoryFrom`).
|
|
1676
|
+
* When set, only artifacts attached to messages written at or after it are gathered.
|
|
1668
1677
|
*/
|
|
1669
|
-
async gatherConversationArtifacts(conversationId, contextUser) {
|
|
1678
|
+
async gatherConversationArtifacts(conversationId, contextUser, historyFrom) {
|
|
1670
1679
|
try {
|
|
1671
1680
|
const rv = new RunView();
|
|
1672
|
-
|
|
1681
|
+
const conversationFilter = `ConversationID='${conversationId}'`;
|
|
1682
|
+
// Get all conversation detail IDs for this conversation (from its floor, if the run has one)
|
|
1673
1683
|
const details = await rv.RunView({
|
|
1674
1684
|
EntityName: 'MJ: Conversation Details',
|
|
1675
|
-
ExtraFilter:
|
|
1685
|
+
ExtraFilter: historyFrom
|
|
1686
|
+
? `${conversationFilter} AND ${ConversationEngine.HistoryFromFilter(historyFrom)}`
|
|
1687
|
+
: conversationFilter,
|
|
1676
1688
|
Fields: ['ID'],
|
|
1677
1689
|
ResultType: 'simple',
|
|
1678
1690
|
}, contextUser);
|