@memberjunction/ai-agents 6.2.0-edge.2 → 6.2.0-edge.4
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 +6 -0
- package/dist/AgentDecisionService.d.ts +8 -1
- package/dist/AgentDecisionService.d.ts.map +1 -1
- package/dist/AgentDecisionService.js +4 -0
- package/dist/AgentDecisionService.js.map +1 -1
- package/dist/AgentRunner.d.ts +51 -2
- package/dist/AgentRunner.d.ts.map +1 -1
- package/dist/AgentRunner.js +121 -23
- package/dist/AgentRunner.js.map +1 -1
- package/dist/ConversationCompactionManager.d.ts +9 -1
- package/dist/ConversationCompactionManager.d.ts.map +1 -1
- package/dist/ConversationCompactionManager.js +6 -3
- package/dist/ConversationCompactionManager.js.map +1 -1
- package/dist/ConversationToolManager.d.ts +13 -2
- package/dist/ConversationToolManager.d.ts.map +1 -1
- package/dist/ConversationToolManager.js +19 -3
- package/dist/ConversationToolManager.js.map +1 -1
- package/dist/KnowledgeAgent.d.ts.map +1 -1
- package/dist/KnowledgeAgent.js +6 -1
- package/dist/KnowledgeAgent.js.map +1 -1
- package/dist/MJAIAgentRequestEntityServer.d.ts +6 -0
- package/dist/MJAIAgentRequestEntityServer.d.ts.map +1 -1
- package/dist/MJAIAgentRequestEntityServer.js +26 -1
- package/dist/MJAIAgentRequestEntityServer.js.map +1 -1
- package/dist/PayloadFeedbackManager.d.ts +3 -0
- package/dist/PayloadFeedbackManager.d.ts.map +1 -1
- package/dist/PayloadFeedbackManager.js +2 -1
- package/dist/PayloadFeedbackManager.js.map +1 -1
- package/dist/agent-run-watchdog.d.ts +65 -5
- package/dist/agent-run-watchdog.d.ts.map +1 -1
- package/dist/agent-run-watchdog.js +143 -28
- package/dist/agent-run-watchdog.js.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.d.ts +7 -0
- package/dist/agent-types/loop-agent-prompt-params.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.js +1 -0
- package/dist/agent-types/loop-agent-prompt-params.js.map +1 -1
- package/dist/agent-types/loop-agent-type.d.ts +20 -0
- package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-type.js +73 -2
- package/dist/agent-types/loop-agent-type.js.map +1 -1
- package/dist/artifact-tools/SearchResultSetToolLibrary.js +4 -4
- package/dist/artifact-tools/SearchResultSetToolLibrary.js.map +1 -1
- package/dist/base-agent.d.ts +310 -26
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +867 -244
- package/dist/base-agent.js.map +1 -1
- package/dist/client-tool-results.d.ts +45 -0
- package/dist/client-tool-results.d.ts.map +1 -0
- package/dist/client-tool-results.js +94 -0
- package/dist/client-tool-results.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/native-tools/action-tool-builder.d.ts +14 -0
- package/dist/native-tools/action-tool-builder.d.ts.map +1 -1
- package/dist/native-tools/action-tool-builder.js +62 -7
- package/dist/native-tools/action-tool-builder.js.map +1 -1
- package/dist/native-tools/control-tools.d.ts +17 -1
- package/dist/native-tools/control-tools.d.ts.map +1 -1
- package/dist/native-tools/control-tools.js +40 -3
- package/dist/native-tools/control-tools.js.map +1 -1
- package/dist/prior-turn-tool-result-cache.d.ts +31 -12
- package/dist/prior-turn-tool-result-cache.d.ts.map +1 -1
- package/dist/prior-turn-tool-result-cache.js +59 -16
- package/dist/prior-turn-tool-result-cache.js.map +1 -1
- package/dist/realtime/bridge-host-params.d.ts +22 -0
- package/dist/realtime/bridge-host-params.d.ts.map +1 -0
- package/dist/realtime/bridge-host-params.js +53 -0
- package/dist/realtime/bridge-host-params.js.map +1 -0
- package/dist/realtime/bridge-realtime-session-factory.d.ts +63 -3
- package/dist/realtime/bridge-realtime-session-factory.d.ts.map +1 -1
- package/dist/realtime/bridge-realtime-session-factory.js +83 -22
- package/dist/realtime/bridge-realtime-session-factory.js.map +1 -1
- package/dist/realtime/bridge-realtime-usage-recorder.d.ts +81 -0
- package/dist/realtime/bridge-realtime-usage-recorder.d.ts.map +1 -0
- package/dist/realtime/bridge-realtime-usage-recorder.js +194 -0
- package/dist/realtime/bridge-realtime-usage-recorder.js.map +1 -0
- package/dist/realtime/bridge-session-transcript-sink.d.ts +37 -0
- package/dist/realtime/bridge-session-transcript-sink.d.ts.map +1 -0
- package/dist/realtime/bridge-session-transcript-sink.js +58 -0
- package/dist/realtime/bridge-session-transcript-sink.js.map +1 -0
- package/dist/realtime/client-only-channel-server.d.ts +83 -0
- package/dist/realtime/client-only-channel-server.d.ts.map +1 -0
- package/dist/realtime/client-only-channel-server.js +107 -0
- package/dist/realtime/client-only-channel-server.js.map +1 -0
- package/dist/realtime/identity-verification-channel-server.d.ts +50 -0
- package/dist/realtime/identity-verification-channel-server.d.ts.map +1 -0
- package/dist/realtime/identity-verification-channel-server.js +66 -0
- package/dist/realtime/identity-verification-channel-server.js.map +1 -0
- package/dist/realtime/interactive-component-channel-server.d.ts +39 -0
- package/dist/realtime/interactive-component-channel-server.d.ts.map +1 -0
- package/dist/realtime/interactive-component-channel-server.js +55 -0
- package/dist/realtime/interactive-component-channel-server.js.map +1 -0
- package/dist/realtime/realtime-avatar-resolution.d.ts +194 -0
- package/dist/realtime/realtime-avatar-resolution.d.ts.map +1 -0
- package/dist/realtime/realtime-avatar-resolution.js +208 -0
- package/dist/realtime/realtime-avatar-resolution.js.map +1 -0
- package/dist/realtime/realtime-channel-policy.d.ts +81 -0
- package/dist/realtime/realtime-channel-policy.d.ts.map +1 -0
- package/dist/realtime/realtime-channel-policy.js +91 -0
- package/dist/realtime/realtime-channel-policy.js.map +1 -0
- package/dist/realtime/realtime-channel-server-host.d.ts +14 -0
- package/dist/realtime/realtime-channel-server-host.d.ts.map +1 -1
- package/dist/realtime/realtime-channel-server-host.js +35 -0
- package/dist/realtime/realtime-channel-server-host.js.map +1 -1
- package/dist/realtime/realtime-client-session-service.d.ts +493 -30
- package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
- package/dist/realtime/realtime-client-session-service.js +825 -98
- package/dist/realtime/realtime-client-session-service.js.map +1 -1
- package/dist/realtime/realtime-coagent-config.d.ts +94 -15
- package/dist/realtime/realtime-coagent-config.d.ts.map +1 -1
- package/dist/realtime/realtime-coagent-config.js +109 -4
- package/dist/realtime/realtime-coagent-config.js.map +1 -1
- package/dist/realtime/realtime-coagent-resolution.d.ts +90 -0
- package/dist/realtime/realtime-coagent-resolution.d.ts.map +1 -0
- package/dist/realtime/realtime-coagent-resolution.js +186 -0
- package/dist/realtime/realtime-coagent-resolution.js.map +1 -0
- package/dist/realtime/realtime-delegation-narrator.d.ts +97 -0
- package/dist/realtime/realtime-delegation-narrator.d.ts.map +1 -0
- package/dist/realtime/realtime-delegation-narrator.js +162 -0
- package/dist/realtime/realtime-delegation-narrator.js.map +1 -0
- package/dist/realtime/realtime-recording-store.d.ts +136 -16
- package/dist/realtime/realtime-recording-store.d.ts.map +1 -1
- package/dist/realtime/realtime-recording-store.js +505 -39
- package/dist/realtime/realtime-recording-store.js.map +1 -1
- package/dist/realtime/realtime-session-runner.d.ts +2 -82
- package/dist/realtime/realtime-session-runner.d.ts.map +1 -1
- package/dist/realtime/realtime-session-runner.js +16 -191
- package/dist/realtime/realtime-session-runner.js.map +1 -1
- package/dist/realtime/realtime-vendor-resolution.d.ts +9 -0
- package/dist/realtime/realtime-vendor-resolution.d.ts.map +1 -1
- package/dist/realtime/realtime-vendor-resolution.js +16 -5
- package/dist/realtime/realtime-vendor-resolution.js.map +1 -1
- package/dist/realtime/realtime-video-output-gate.d.ts +83 -0
- package/dist/realtime/realtime-video-output-gate.d.ts.map +1 -0
- package/dist/realtime/realtime-video-output-gate.js +79 -0
- package/dist/realtime/realtime-video-output-gate.js.map +1 -0
- package/dist/rubric-evaluation-agent-runner.js +17 -8
- package/dist/rubric-evaluation-agent-runner.js.map +1 -1
- package/dist/self-check.d.ts +6 -3
- package/dist/self-check.d.ts.map +1 -1
- package/dist/self-check.js +3 -3
- package/dist/self-check.js.map +1 -1
- package/dist/tool-result-format.d.ts +14 -0
- package/dist/tool-result-format.d.ts.map +1 -1
- package/dist/tool-result-format.js.map +1 -1
- package/package.json +19 -19
|
@@ -20,6 +20,13 @@ import { CarryForwardStepRecord } from './tool-result-format.js';
|
|
|
20
20
|
* - Entries are keyed by conversation AND agent, mirroring the DB path's `AgentID`
|
|
21
21
|
* filter — in a multi-agent conversation, agent B must never inherit agent A's
|
|
22
22
|
* results labeled "your previous turn".
|
|
23
|
+
* - Entries are also keyed by branch, mirroring the DB path's branch-path filter — a
|
|
24
|
+
* run never inherits results from a run whose reply row is off its path. A branch with
|
|
25
|
+
* no entry yet falls back to the DB path, which can return a trunk run from before the fork.
|
|
26
|
+
* - Entries carry the reply row of the run that stored them. When a save on this server
|
|
27
|
+
* marks that row replaced (`ReplacedAt` set by an in-place rerun of its turn), the entry
|
|
28
|
+
* is no longer served, just as the DB path leaves out runs whose reply row is replaced:
|
|
29
|
+
* a replaced answer's tool results are never carried forward.
|
|
23
30
|
* - Values are the raw completed-`Tool`-step `OutputData` projections; eligibility is
|
|
24
31
|
* still decided downstream by `BuildPriorTurnToolResultsMessage` via `toolFamily`,
|
|
25
32
|
* identical for cached and DB-loaded records.
|
|
@@ -38,9 +45,14 @@ import { CarryForwardStepRecord } from './tool-result-format.js';
|
|
|
38
45
|
* the TTL bounds the staleness window, and each node self-heals on its next completed
|
|
39
46
|
* run for that conversation — so the fallback keeps the default single-node deployment
|
|
40
47
|
* exact while multi-node degrades gracefully rather than paying the queries every turn.
|
|
48
|
+
* The replaced-row rule has the same limit: a replacement saved on another server is not
|
|
49
|
+
* seen here, so this node can still serve that run's entry until it expires or is replaced.
|
|
41
50
|
*/
|
|
42
51
|
export declare class PriorTurnToolResultCache extends BaseSingleton<PriorTurnToolResultCache> {
|
|
43
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Protected per the {@link BaseSingleton} contract — obtain via {@link Instance}. Listens for
|
|
54
|
+
* entity saves on this server to learn which conversation details were replaced.
|
|
55
|
+
*/
|
|
44
56
|
protected constructor();
|
|
45
57
|
/** Process-wide singleton accessor (Global Object Store backed, bundler-duplication safe). */
|
|
46
58
|
static get Instance(): PriorTurnToolResultCache;
|
|
@@ -51,21 +63,28 @@ export declare class PriorTurnToolResultCache extends BaseSingleton<PriorTurnToo
|
|
|
51
63
|
* bounding the multi-node staleness window described above.
|
|
52
64
|
*/
|
|
53
65
|
private cache;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
66
|
+
/** Normalized ids of conversation details replaced by an in-place rerun, seen on this server. */
|
|
67
|
+
private replacedDetails;
|
|
68
|
+
/** Key: conversation, agent and branch ('trunk' when none), so an entry serves only runs on the branch that stored it. */
|
|
58
69
|
private static buildKey;
|
|
59
70
|
/**
|
|
60
71
|
* Returns the carry-forward records of this agent's most recent settled root run in
|
|
61
|
-
* the conversation on this node
|
|
62
|
-
*
|
|
63
|
-
* database".
|
|
72
|
+
* the conversation on this node, on one branch path (`branchId` null is the trunk) —
|
|
73
|
+
* `[]` means "settled with no tool results" (a valid, query-skipping answer);
|
|
74
|
+
* `undefined` means "not known here, ask the database". An entry whose run's reply row
|
|
75
|
+
* was replaced is dropped and reads as `undefined`.
|
|
76
|
+
*/
|
|
77
|
+
Get(conversationId: string, agentId: string, branchId: string | null): CarryForwardStepRecord[] | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Records a settled root run's carry-forward projections (empty array included) for one branch path.
|
|
80
|
+
* `sourceDetailId` is the run's reply row; the entry is not served once that row is replaced.
|
|
64
81
|
*/
|
|
65
|
-
|
|
66
|
-
/** Records a
|
|
67
|
-
|
|
68
|
-
/** Drops every entry — test isolation hook. */
|
|
82
|
+
Set(conversationId: string, agentId: string, branchId: string | null, steps: CarryForwardStepRecord[], sourceDetailId?: string | null): void;
|
|
83
|
+
/** Records that an in-place rerun replaced a conversation detail; entries whose run replied with it are no longer served. */
|
|
84
|
+
MarkDetailReplaced(detailId: string): void;
|
|
85
|
+
/** Drops every entry and every replaced-detail mark — test isolation hook. */
|
|
69
86
|
Clear(): void;
|
|
87
|
+
/** Marks a conversation detail replaced when a save on this server leaves its `ReplacedAt` set. */
|
|
88
|
+
private onGlobalEvent;
|
|
70
89
|
}
|
|
71
90
|
//# sourceMappingURL=prior-turn-tool-result-cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prior-turn-tool-result-cache.d.ts","sourceRoot":"","sources":["../src/prior-turn-tool-result-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prior-turn-tool-result-cache.d.ts","sourceRoot":"","sources":["../src/prior-turn-tool-result-cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAkE,MAAM,wBAAwB,CAAC;AACvH,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAS9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,wBAAyB,SAAQ,aAAa,CAAC,wBAAwB,CAAC;IACjF;;;OAGG;IACH,SAAS;IAKT,8FAA8F;IAC9F,WAAkB,QAAQ,IAAI,wBAAwB,CAErD;IAED;;;;;OAKG;IACH,OAAO,CAAC,KAAK,CAGV;IAEH,iGAAiG;IACjG,OAAO,CAAC,eAAe,CAAmD;IAE1E,0HAA0H;IAC1H,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB;;;;;;OAMG;IACI,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,sBAAsB,EAAE,GAAG,SAAS;IAalH;;;OAGG;IACI,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,cAAc,GAAE,MAAM,GAAG,IAAW,GAAG,IAAI;IAIzJ,6HAA6H;IACtH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIjD,8EAA8E;IACvE,KAAK,IAAI,IAAI;IAKpB,mGAAmG;IACnG,OAAO,CAAC,aAAa;CAUxB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseEntity } from '@memberjunction/core';
|
|
2
|
+
import { ConversationEngine, MJConversationDetailEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { BaseSingleton, MJEventType, MJGlobal, MJLruCache, NormalizeUUID } from '@memberjunction/global';
|
|
2
4
|
/**
|
|
3
5
|
* Process-wide cache of the most recent settled root run's Tool-step results per
|
|
4
6
|
* conversation + agent, keeping the prior-turn carry-forward check off the database on
|
|
@@ -19,6 +21,13 @@ import { BaseSingleton, MJLruCache, NormalizeUUID } from '@memberjunction/global
|
|
|
19
21
|
* - Entries are keyed by conversation AND agent, mirroring the DB path's `AgentID`
|
|
20
22
|
* filter — in a multi-agent conversation, agent B must never inherit agent A's
|
|
21
23
|
* results labeled "your previous turn".
|
|
24
|
+
* - Entries are also keyed by branch, mirroring the DB path's branch-path filter — a
|
|
25
|
+
* run never inherits results from a run whose reply row is off its path. A branch with
|
|
26
|
+
* no entry yet falls back to the DB path, which can return a trunk run from before the fork.
|
|
27
|
+
* - Entries carry the reply row of the run that stored them. When a save on this server
|
|
28
|
+
* marks that row replaced (`ReplacedAt` set by an in-place rerun of its turn), the entry
|
|
29
|
+
* is no longer served, just as the DB path leaves out runs whose reply row is replaced:
|
|
30
|
+
* a replaced answer's tool results are never carried forward.
|
|
22
31
|
* - Values are the raw completed-`Tool`-step `OutputData` projections; eligibility is
|
|
23
32
|
* still decided downstream by `BuildPriorTurnToolResultsMessage` via `toolFamily`,
|
|
24
33
|
* identical for cached and DB-loaded records.
|
|
@@ -37,9 +46,14 @@ import { BaseSingleton, MJLruCache, NormalizeUUID } from '@memberjunction/global
|
|
|
37
46
|
* the TTL bounds the staleness window, and each node self-heals on its next completed
|
|
38
47
|
* run for that conversation — so the fallback keeps the default single-node deployment
|
|
39
48
|
* exact while multi-node degrades gracefully rather than paying the queries every turn.
|
|
49
|
+
* The replaced-row rule has the same limit: a replacement saved on another server is not
|
|
50
|
+
* seen here, so this node can still serve that run's entry until it expires or is replaced.
|
|
40
51
|
*/
|
|
41
52
|
export class PriorTurnToolResultCache extends BaseSingleton {
|
|
42
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Protected per the {@link BaseSingleton} contract — obtain via {@link Instance}. Listens for
|
|
55
|
+
* entity saves on this server to learn which conversation details were replaced.
|
|
56
|
+
*/
|
|
43
57
|
constructor() {
|
|
44
58
|
super();
|
|
45
59
|
/**
|
|
@@ -52,34 +66,63 @@ export class PriorTurnToolResultCache extends BaseSingleton {
|
|
|
52
66
|
maxSize: 500,
|
|
53
67
|
ttlMs: 30 * 60 * 1000
|
|
54
68
|
});
|
|
69
|
+
/** Normalized ids of conversation details replaced by an in-place rerun, seen on this server. */
|
|
70
|
+
this.replacedDetails = new MJLruCache({ maxSize: 5000 });
|
|
71
|
+
MJGlobal.Instance.GetEventListener(false).subscribe(event => this.onGlobalEvent(event));
|
|
55
72
|
}
|
|
56
73
|
/** Process-wide singleton accessor (Global Object Store backed, bundler-duplication safe). */
|
|
57
74
|
static get Instance() {
|
|
58
75
|
return super.getInstance();
|
|
59
76
|
}
|
|
77
|
+
/** Key: conversation, agent and branch ('trunk' when none), so an entry serves only runs on the branch that stored it. */
|
|
78
|
+
static buildKey(conversationId, agentId, branchId) {
|
|
79
|
+
return `${NormalizeUUID(conversationId)}::${NormalizeUUID(agentId)}::${branchId ? NormalizeUUID(branchId) : 'trunk'}`;
|
|
80
|
+
}
|
|
60
81
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
82
|
+
* Returns the carry-forward records of this agent's most recent settled root run in
|
|
83
|
+
* the conversation on this node, on one branch path (`branchId` null is the trunk) —
|
|
84
|
+
* `[]` means "settled with no tool results" (a valid, query-skipping answer);
|
|
85
|
+
* `undefined` means "not known here, ask the database". An entry whose run's reply row
|
|
86
|
+
* was replaced is dropped and reads as `undefined`.
|
|
63
87
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
88
|
+
Get(conversationId, agentId, branchId) {
|
|
89
|
+
const key = PriorTurnToolResultCache.buildKey(conversationId, agentId, branchId);
|
|
90
|
+
const entry = this.cache.Get(key);
|
|
91
|
+
if (!entry) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
if (entry.SourceDetailID && this.replacedDetails.Has(NormalizeUUID(entry.SourceDetailID))) {
|
|
95
|
+
this.cache.Delete(key);
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
return entry.Steps;
|
|
66
99
|
}
|
|
67
100
|
/**
|
|
68
|
-
*
|
|
69
|
-
* the
|
|
70
|
-
* valid, query-skipping answer); `undefined` means "not known here, ask the
|
|
71
|
-
* database".
|
|
101
|
+
* Records a settled root run's carry-forward projections (empty array included) for one branch path.
|
|
102
|
+
* `sourceDetailId` is the run's reply row; the entry is not served once that row is replaced.
|
|
72
103
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
104
|
+
Set(conversationId, agentId, branchId, steps, sourceDetailId = null) {
|
|
105
|
+
this.cache.Set(PriorTurnToolResultCache.buildKey(conversationId, agentId, branchId), { Steps: steps, SourceDetailID: sourceDetailId });
|
|
75
106
|
}
|
|
76
|
-
/** Records a
|
|
77
|
-
|
|
78
|
-
this.
|
|
107
|
+
/** Records that an in-place rerun replaced a conversation detail; entries whose run replied with it are no longer served. */
|
|
108
|
+
MarkDetailReplaced(detailId) {
|
|
109
|
+
this.replacedDetails.Set(NormalizeUUID(detailId), true);
|
|
79
110
|
}
|
|
80
|
-
/** Drops every entry — test isolation hook. */
|
|
111
|
+
/** Drops every entry and every replaced-detail mark — test isolation hook. */
|
|
81
112
|
Clear() {
|
|
82
113
|
this.cache.Clear();
|
|
114
|
+
this.replacedDetails.Clear();
|
|
115
|
+
}
|
|
116
|
+
/** Marks a conversation detail replaced when a save on this server leaves its `ReplacedAt` set. */
|
|
117
|
+
onGlobalEvent(event) {
|
|
118
|
+
if (event.event !== MJEventType.ComponentEvent || event.eventCode !== BaseEntity.BaseEventCode) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const entityEvent = event.args;
|
|
122
|
+
const detail = entityEvent?.baseEntity;
|
|
123
|
+
if (entityEvent?.type === 'save' && detail instanceof MJConversationDetailEntity && ConversationEngine.IsReplacedRow(detail)) {
|
|
124
|
+
this.MarkDetailReplaced(detail.ID);
|
|
125
|
+
}
|
|
83
126
|
}
|
|
84
127
|
}
|
|
85
128
|
//# sourceMappingURL=prior-turn-tool-result-cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prior-turn-tool-result-cache.js","sourceRoot":"","sources":["../src/prior-turn-tool-result-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"prior-turn-tool-result-cache.js","sourceRoot":"","sources":["../src/prior-turn-tool-result-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAgB,MAAM,wBAAwB,CAAC;AAUvH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,OAAO,wBAAyB,SAAQ,aAAuC;IACjF;;;OAGG;IACH;QACI,KAAK,EAAE,CAAC;QASZ;;;;;WAKG;QACK,UAAK,GAAG,IAAI,UAAU,CAAyB;YACnD,OAAO,EAAE,GAAG;YACZ,KAAK,E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B,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,cAAsB,EAAE,OAAe,EAAE,QAAuB,EAAE,KAA+B,EAAE,iBAAgC,IAAI;QAC9I,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;IAC3I,CAAC;IAED,6HAA6H;IACtH,kBAAkB,CAAC,QAAgB;QACtC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,8EAA8E;IACvE,KAAK;QACR,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,mGAAmG;IAC3F,aAAa,CAAC,KAAc;QAChC,IAAI,KAAK,CAAC,KAAK,KAAK,WAAW,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS,KAAK,UAAU,CAAC,aAAa,EAAE,CAAC;YAC7F,OAAO;QACX,CAAC;QACD,MAAM,WAAW,GAAgC,KAAK,CAAC,IAAI,CAAC;QAC5D,MAAM,MAAM,GAAG,WAAW,EAAE,UAAU,CAAC;QACvC,IAAI,WAAW,EAAE,IAAI,KAAK,MAAM,IAAI,MAAM,YAAY,0BAA0B,IAAI,kBAAkB,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3H,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACvC,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type guards for the host-supplied extras that ride `ExecuteAgentParams.data` into a bridged
|
|
3
|
+
* realtime session (`realtimeHostTools`, `realtimeHostFraming`, `realtimePriorTranscript`, `conversationId`).
|
|
4
|
+
*
|
|
5
|
+
* `data` is an open bag, so a value of the wrong shape is possible (a host bug, a stale caller). A malformed
|
|
6
|
+
* value is ignored and logged rather than thrown on, so one bad optional extra cannot fail a call.
|
|
7
|
+
*
|
|
8
|
+
* @module @memberjunction/ai-agents
|
|
9
|
+
* @author MemberJunction.com
|
|
10
|
+
*/
|
|
11
|
+
import type { RealtimeToolDefinition } from '@memberjunction/ai';
|
|
12
|
+
/**
|
|
13
|
+
* Reads `data.realtimeHostTools`. Absent yields `undefined`; a value that is not an array of well-formed tool
|
|
14
|
+
* definitions is ignored (logged) as a whole, so the model never sees a half-valid tool set.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ReadHostTools(value: unknown): RealtimeToolDefinition[] | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Reads a trimmed, non-empty string from the data bag. Absent or blank yields `undefined`; a non-string value is
|
|
19
|
+
* ignored and logged under `name`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ReadTrimmedString(value: unknown, name: string): string | undefined;
|
|
22
|
+
//# sourceMappingURL=bridge-host-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-host-params.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-host-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAkBjE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,EAAE,GAAG,SAAS,CASlF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASlF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type guards for the host-supplied extras that ride `ExecuteAgentParams.data` into a bridged
|
|
3
|
+
* realtime session (`realtimeHostTools`, `realtimeHostFraming`, `realtimePriorTranscript`, `conversationId`).
|
|
4
|
+
*
|
|
5
|
+
* `data` is an open bag, so a value of the wrong shape is possible (a host bug, a stale caller). A malformed
|
|
6
|
+
* value is ignored and logged rather than thrown on, so one bad optional extra cannot fail a call.
|
|
7
|
+
*
|
|
8
|
+
* @module @memberjunction/ai-agents
|
|
9
|
+
* @author MemberJunction.com
|
|
10
|
+
*/
|
|
11
|
+
import { LogError } from '@memberjunction/core';
|
|
12
|
+
/** Whether a value is a well-formed tool definition (a name, a description, and an object parameter schema). */
|
|
13
|
+
function isToolDefinition(value) {
|
|
14
|
+
if (typeof value !== 'object' || value === null) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const candidate = value;
|
|
18
|
+
return (typeof candidate.Name === 'string' &&
|
|
19
|
+
candidate.Name.trim().length > 0 &&
|
|
20
|
+
typeof candidate.Description === 'string' &&
|
|
21
|
+
typeof candidate.ParametersSchema === 'object' &&
|
|
22
|
+
candidate.ParametersSchema !== null &&
|
|
23
|
+
!Array.isArray(candidate.ParametersSchema));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reads `data.realtimeHostTools`. Absent yields `undefined`; a value that is not an array of well-formed tool
|
|
27
|
+
* definitions is ignored (logged) as a whole, so the model never sees a half-valid tool set.
|
|
28
|
+
*/
|
|
29
|
+
export function ReadHostTools(value) {
|
|
30
|
+
if (value === undefined || value === null) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
if (!Array.isArray(value) || !value.every(isToolDefinition)) {
|
|
34
|
+
LogError('[BridgeRealtime] ignoring malformed realtimeHostTools (expected an array of { Name, Description, ParametersSchema }).');
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return value.length > 0 ? value : undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Reads a trimmed, non-empty string from the data bag. Absent or blank yields `undefined`; a non-string value is
|
|
41
|
+
* ignored and logged under `name`.
|
|
42
|
+
*/
|
|
43
|
+
export function ReadTrimmedString(value, name) {
|
|
44
|
+
if (value === undefined || value === null) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
if (typeof value !== 'string') {
|
|
48
|
+
LogError(`[BridgeRealtime] ignoring ${name}: expected a string, got ${typeof value}.`);
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
return value.trim() || undefined;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=bridge-host-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-host-params.js","sourceRoot":"","sources":["../../src/realtime/bridge-host-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,gHAAgH;AAChH,SAAS,gBAAgB,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,SAAS,GAAG,KAA+D,CAAC;IAClF,OAAO,CACH,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;QAClC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QAChC,OAAO,SAAS,CAAC,WAAW,KAAK,QAAQ;QACzC,OAAO,SAAS,CAAC,gBAAgB,KAAK,QAAQ;QAC9C,SAAS,CAAC,gBAAgB,KAAK,IAAI;QACnC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAC7C,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IACxC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC1D,QAAQ,CAAC,uHAAuH,CAAC,CAAC;QAClI,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc,EAAE,IAAY;IAC1D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,QAAQ,CAAC,6BAA6B,IAAI,4BAA4B,OAAO,KAAK,GAAG,CAAC,CAAC;QACvF,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;AACrC,CAAC"}
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
* @module @memberjunction/ai-agents
|
|
17
17
|
* @author MemberJunction.com
|
|
18
18
|
*/
|
|
19
|
-
import { IRealtimeSession, RealtimeVoiceOption, AIAPIKeyResolver } from '@memberjunction/ai';
|
|
19
|
+
import { IRealtimeSession, ChatMessage, RealtimeVoiceOption, RealtimeToolDefinition, AIAPIKeyResolver } from '@memberjunction/ai';
|
|
20
20
|
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
21
|
+
import { RealtimeHostToolsResolver } from './realtime-client-session-service.js';
|
|
21
22
|
/**
|
|
22
23
|
* The context a bridge passes to {@link CreateBridgeRealtimeSession}. Structurally compatible with the
|
|
23
24
|
* LiveKit coordinator's `RealtimeSessionStartContext` (and any future bridge's equivalent) so this factory
|
|
@@ -64,6 +65,40 @@ export interface BridgeRealtimeSessionContext {
|
|
|
64
65
|
MeetingMode?: boolean;
|
|
65
66
|
/** The names the agent answers to (display name + aliases) — phrasing for the meeting prompt only. */
|
|
66
67
|
SelfNames?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Tools the host declares and executes itself (a phone call's `transfer_call` / `send_dtmf` / `end_call`).
|
|
70
|
+
* Added to the model's tool set; executed through the runtime's local tool handler
|
|
71
|
+
* (see `GetBridgeRealtimeRuntime`).
|
|
72
|
+
*/
|
|
73
|
+
HostTools?: RealtimeToolDefinition[];
|
|
74
|
+
/**
|
|
75
|
+
* Optional callback that allows the host to resolve host tools dynamically based on
|
|
76
|
+
* the model, vendor, and driver actually resolved for the session, before session opening.
|
|
77
|
+
*/
|
|
78
|
+
ResolveHostTools?: RealtimeHostToolsResolver;
|
|
79
|
+
/** Host-authored instructions appended to the system prompt (e.g. the phone-call and caller framing). */
|
|
80
|
+
HostFraming?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Role-tagged transcript lines (`User: …` / `Assistant: …`) of the conversation so far, framed into the
|
|
83
|
+
* prompt as "earlier in this conversation". Set when a lost model session is re-opened mid-call so the new
|
|
84
|
+
* session remembers what was said.
|
|
85
|
+
*/
|
|
86
|
+
PriorTranscript?: string;
|
|
87
|
+
/** Earlier turns to seed the model's context. Defaults to none (a fresh call has no history). */
|
|
88
|
+
ConversationMessages?: ChatMessage[];
|
|
89
|
+
/** The `MJ: Conversations` row the session writes to — stamped on the co-agent observability run. */
|
|
90
|
+
ConversationID?: string;
|
|
91
|
+
/**
|
|
92
|
+
* `'room'` when the bridge's bot can publish the agent's avatar into the room (the LiveKit coordinator asks its native
|
|
93
|
+
* module first). Flows to the session's avatar request, so the driver may render it. Absent: audio only.
|
|
94
|
+
*/
|
|
95
|
+
AvatarDelivery?: 'room';
|
|
96
|
+
/**
|
|
97
|
+
* `true` when the session is a phone call (a carrier call, or a SIP call in a LiveKit room). Flows to
|
|
98
|
+
* `params.data.realtimePhoneCall`: the session then asks the driver for no avatar (the caller sees no video) and
|
|
99
|
+
* reports `phone` as its avatar status.
|
|
100
|
+
*/
|
|
101
|
+
PhoneCall?: boolean;
|
|
67
102
|
}
|
|
68
103
|
/**
|
|
69
104
|
* Opens a raw {@link IRealtimeSession} for the agent named in `ctx`. Bind this onto a bridge's
|
|
@@ -88,20 +123,45 @@ export declare function CreateBridgeRealtimeSession(ctx: BridgeRealtimeSessionCo
|
|
|
88
123
|
* @param provider The metadata provider (required — skipped without it).
|
|
89
124
|
*/
|
|
90
125
|
export declare function FinalizeBridgeCoAgentRuns(agentSessionID: string, success: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* A voice the dev model/voice picker offers: one per persona, or one per voice only the driver declares. Two personas can
|
|
128
|
+
* share a voice `ID` (a voice, and the same voice with a face), so {@link PersonaID} tells them apart. A persona voice also
|
|
129
|
+
* carries the avatar that comes with it and the persona's preview image; a voice only the driver declares carries none of
|
|
130
|
+
* the three.
|
|
131
|
+
*/
|
|
132
|
+
export interface RealtimeModelVoiceOption extends RealtimeVoiceOption {
|
|
133
|
+
/** The persona this voice belongs to (`MJ: AI Personas.ID`). Absent for a voice only the driver declares. */
|
|
134
|
+
PersonaID?: string;
|
|
135
|
+
/**
|
|
136
|
+
* The avatar that comes with this voice: the `APIName` of the persona's preset Video binding on the model's vendor,
|
|
137
|
+
* which is what `realtime.video.avatarId` takes. Absent when the persona has no such binding there, or only a custom
|
|
138
|
+
* one (custom avatars are not supported), and on a model that shows no avatar there (its Video/Output row turns
|
|
139
|
+
* video off, or its driver renders none on that vendor's endpoint).
|
|
140
|
+
*/
|
|
141
|
+
AvatarID?: string;
|
|
142
|
+
/** The persona's preview image (`MJ: AI Personas.PreviewImageURL`), when it has one. */
|
|
143
|
+
PreviewImageURL?: string;
|
|
144
|
+
}
|
|
91
145
|
/** An active Realtime model paired with the voices its driver supports — for the dev model/voice picker. */
|
|
92
146
|
export interface RealtimeModelVoices {
|
|
93
147
|
/** The `MJ: AI Models` row id. */
|
|
94
148
|
ModelID: string;
|
|
95
149
|
/** The model's display name. */
|
|
96
150
|
ModelName: string;
|
|
97
|
-
/** The
|
|
98
|
-
Voices:
|
|
151
|
+
/** The model's persona voices on its vendor, then the driver's other voices (empty when there are none). */
|
|
152
|
+
Voices: RealtimeModelVoiceOption[];
|
|
99
153
|
}
|
|
100
154
|
/**
|
|
101
155
|
* Enumerates the active Realtime models with each driver's supported voices — the source for the dev
|
|
102
156
|
* model/voice picker. Only models with an Active vendor + resolvable API key + ClassFactory driver are
|
|
103
157
|
* returned (a model you can't actually run isn't worth offering). Voices come from the driver
|
|
104
158
|
* ({@link BaseRealtimeModel.SupportedVoices}) — the near-term, driver-owned source of truth.
|
|
159
|
+
* A persona voice whose persona also has a preset Video binding on the same vendor names that avatar
|
|
160
|
+
* ({@link RealtimeModelVoiceOption.AvatarID}), when the model shows avatars on that vendor
|
|
161
|
+
* ({@link RealtimeModelShowsAvatar}: its Video/Output row allows video or it has none, and the driver
|
|
162
|
+
* renders avatars on its endpoint); driver voices never do. So the picker marks a voice "Comes with an
|
|
163
|
+
* avatar" only where a call can show one. A persona with a face doesn't stand in for its plain voice, so
|
|
164
|
+
* the plain voice is listed too.
|
|
105
165
|
*
|
|
106
166
|
* @param contextUser The user the engine config runs as (server-side).
|
|
107
167
|
* @param provider The request-scoped metadata provider (multi-provider safe).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-realtime-session-factory.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"bridge-realtime-session-factory.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAqB,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAwB,MAAM,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EAAE,4BAA4B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+E9G;AAmDD;;;;;;;;;;;GAWG;AACH,wBAAsB,yBAAyB,CAC3C,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,QAAQ,EACtB,QAAQ,CAAC,EAAE,iBAAiB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,6GAA6G;IAC7G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,4GAA4G;AAC5G,MAAM,WAAW,mBAAmB;IAChC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,4GAA4G;IAC5G,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,sBAAsB,CACxC,WAAW,CAAC,EAAE,QAAQ,EACtB,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,aAAa,GAAE,gBAAyC,GACzD,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA+BhC"}
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { BaseRealtimeModel, MakeAIAPIKeyResolver } from '@memberjunction/ai';
|
|
20
20
|
import { Metadata } from '@memberjunction/core';
|
|
21
|
-
import { MJGlobal, UUIDsEqual } from '@memberjunction/global';
|
|
21
|
+
import { MJGlobal, UUIDsEqual, IndexByUUID } from '@memberjunction/global';
|
|
22
22
|
import { AIEngine } from '@memberjunction/aiengine';
|
|
23
23
|
import { BaseAgent } from '../base-agent.js';
|
|
24
24
|
import { RealtimeClientSessionService } from './realtime-client-session-service.js';
|
|
25
25
|
import { SelectRealtimeVendorForModel } from './realtime-vendor-resolution.js';
|
|
26
|
+
import { RealtimeModelShowsAvatar } from './realtime-video-output-gate.js';
|
|
26
27
|
/**
|
|
27
28
|
* Opens a raw {@link IRealtimeSession} for the agent named in `ctx`. Bind this onto a bridge's
|
|
28
29
|
* session-factory seam (e.g. `LiveKitAgentRoomCoordinator.Instance.SetSessionFactory(CreateBridgeRealtimeSession)`).
|
|
@@ -97,8 +98,9 @@ export async function CreateBridgeRealtimeSession(ctx) {
|
|
|
97
98
|
agent,
|
|
98
99
|
contextUser: ctx.ContextUser,
|
|
99
100
|
provider,
|
|
100
|
-
// A fresh bridge session starts with no prior turns; memory context degrades gracefully to empty.
|
|
101
|
-
|
|
101
|
+
// A fresh bridge session starts with no prior turns; memory context degrades gracefully to empty. A
|
|
102
|
+
// re-opened session (model-drop recovery) is given what was said so far via PriorTranscript instead.
|
|
103
|
+
conversationMessages: ctx.ConversationMessages ?? [],
|
|
102
104
|
// Realtime extras ride params.data: the TARGET agent the co-agent voices via `invoke-target-agent`
|
|
103
105
|
// (without it the co-agent stays idle), plus optional per-session dev overrides for the model/voice
|
|
104
106
|
// so two agents in the same room can sound distinct. Omitted keys are simply absent.
|
|
@@ -127,9 +129,30 @@ function buildRealtimeData(ctx) {
|
|
|
127
129
|
if (ctx.MeetingMode === true) {
|
|
128
130
|
data.realtimeMeetingMode = true;
|
|
129
131
|
}
|
|
132
|
+
if (ctx.HostTools && ctx.HostTools.length > 0) {
|
|
133
|
+
data.realtimeHostTools = ctx.HostTools;
|
|
134
|
+
}
|
|
135
|
+
if (ctx.ResolveHostTools) {
|
|
136
|
+
data.resolveHostTools = ctx.ResolveHostTools;
|
|
137
|
+
}
|
|
138
|
+
if (ctx.HostFraming && ctx.HostFraming.trim().length > 0) {
|
|
139
|
+
data.realtimeHostFraming = ctx.HostFraming.trim();
|
|
140
|
+
}
|
|
141
|
+
if (ctx.PriorTranscript && ctx.PriorTranscript.trim().length > 0) {
|
|
142
|
+
data.realtimePriorTranscript = ctx.PriorTranscript.trim();
|
|
143
|
+
}
|
|
144
|
+
if (ctx.ConversationID && ctx.ConversationID.trim().length > 0) {
|
|
145
|
+
data.conversationId = ctx.ConversationID.trim();
|
|
146
|
+
}
|
|
130
147
|
if (ctx.SelfNames && ctx.SelfNames.length > 0) {
|
|
131
148
|
data.realtimeSelfNames = ctx.SelfNames;
|
|
132
149
|
}
|
|
150
|
+
if (ctx.AvatarDelivery === 'room') {
|
|
151
|
+
data.realtimeAvatarDelivery = 'room';
|
|
152
|
+
}
|
|
153
|
+
if (ctx.PhoneCall === true) {
|
|
154
|
+
data.realtimePhoneCall = true;
|
|
155
|
+
}
|
|
133
156
|
return Object.keys(data).length > 0 ? data : undefined;
|
|
134
157
|
}
|
|
135
158
|
/**
|
|
@@ -155,6 +178,12 @@ export async function FinalizeBridgeCoAgentRuns(agentSessionID, success, context
|
|
|
155
178
|
* model/voice picker. Only models with an Active vendor + resolvable API key + ClassFactory driver are
|
|
156
179
|
* returned (a model you can't actually run isn't worth offering). Voices come from the driver
|
|
157
180
|
* ({@link BaseRealtimeModel.SupportedVoices}) — the near-term, driver-owned source of truth.
|
|
181
|
+
* A persona voice whose persona also has a preset Video binding on the same vendor names that avatar
|
|
182
|
+
* ({@link RealtimeModelVoiceOption.AvatarID}), when the model shows avatars on that vendor
|
|
183
|
+
* ({@link RealtimeModelShowsAvatar}: its Video/Output row allows video or it has none, and the driver
|
|
184
|
+
* renders avatars on its endpoint); driver voices never do. So the picker marks a voice "Comes with an
|
|
185
|
+
* avatar" only where a call can show one. A persona with a face doesn't stand in for its plain voice, so
|
|
186
|
+
* the plain voice is listed too.
|
|
158
187
|
*
|
|
159
188
|
* @param contextUser The user the engine config runs as (server-side).
|
|
160
189
|
* @param provider The request-scoped metadata provider (multi-provider safe).
|
|
@@ -176,30 +205,62 @@ export async function GetRealtimeModelVoices(contextUser, provider, resolveAPIKe
|
|
|
176
205
|
if (!driverClass) {
|
|
177
206
|
continue; // no active vendor with a resolvable key — not runnable, so omit
|
|
178
207
|
}
|
|
179
|
-
// 1. Consult metadata first (Personas & PersonaVendors carry curated names/descriptions)
|
|
180
|
-
const modelPersonas = AIEngine.Instance.GetModelPersonas(model.ID, 'Audio', selection.VendorID);
|
|
181
|
-
const voices = modelPersonas.map((rp) => ({
|
|
182
|
-
ID: rp.PersonaVendor.APIName,
|
|
183
|
-
Name: rp.Persona.Name,
|
|
184
|
-
}));
|
|
185
|
-
// Collect explicitly excluded voice IDs (IsSupported === false) for this model and vendor
|
|
186
|
-
const excludedVoiceApiNames = new Set(AIEngine.Instance.GetModelPersonaExclusions(model.ID, 'Audio', selection.VendorID)
|
|
187
|
-
.map((name) => name.toLowerCase()));
|
|
188
|
-
// 2. Union with driver SupportedVoices: append any driver voices not already present or explicitly excluded
|
|
189
208
|
const instance = MJGlobal.Instance.ClassFactory.CreateInstance(BaseRealtimeModel, driverClass, resolveAPIKey(driverClass));
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
voices.push(dv);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
209
|
+
// 1. Consult metadata first (Personas & PersonaVendors carry curated names/descriptions, and avatars where the
|
|
210
|
+
// model shows them on this vendor)
|
|
211
|
+
const showsAvatar = instance ? RealtimeModelShowsAvatar({ ModelID: model.ID, APIName: selection.APIName, Model: instance }, AIEngine.Instance) : false;
|
|
212
|
+
const voices = personaVoiceOptions(model.ID, selection.VendorID, showsAvatar);
|
|
213
|
+
// 2. Union with driver SupportedVoices: append the driver voices no persona offers plainly, unless excluded
|
|
214
|
+
appendDriverVoices(voices, instance?.SupportedVoices ?? [], model.ID, selection.VendorID);
|
|
199
215
|
out.push({ ModelID: model.ID, ModelName: model.Name ?? '', Voices: voices });
|
|
200
216
|
}
|
|
201
217
|
return out;
|
|
202
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* Appends the driver's voices that no persona already offers as a plain voice (without a face), skipping the ones the
|
|
221
|
+
* model explicitly excludes (`IsSupported === false`). A persona with a face doesn't stand in for its plain voice, so the
|
|
222
|
+
* voice stays pickable without the face. Driver voices have no persona: no avatar, no image.
|
|
223
|
+
*/
|
|
224
|
+
function appendDriverVoices(voices, driverVoices, modelID, vendorID) {
|
|
225
|
+
const excluded = new Set(AIEngine.Instance.GetModelPersonaExclusions(modelID, 'Audio', vendorID).map((name) => name.toLowerCase()));
|
|
226
|
+
for (const dv of driverVoices) {
|
|
227
|
+
const id = dv.ID.toLowerCase();
|
|
228
|
+
if (!excluded.has(id) && !voices.some((v) => !v.AvatarID && v.ID.toLowerCase() === id)) {
|
|
229
|
+
voices.push({ ID: dv.ID, Name: dv.Name });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The model's persona voices on a vendor, one per persona, in persona order. On a model that shows avatars there, a
|
|
235
|
+
* persona whose preset Video binding on the same vendor the model supports carries that binding's `APIName` as its avatar
|
|
236
|
+
* (the face the session asks for when the voice is picked); a binding on any other vendor doesn't count, nor does a custom
|
|
237
|
+
* one, and with no vendor there is nothing to match. On a model that shows none, no voice comes with an avatar.
|
|
238
|
+
*
|
|
239
|
+
* @param showsAvatar Whether the model shows avatars on this vendor ({@link RealtimeModelShowsAvatar}).
|
|
240
|
+
*/
|
|
241
|
+
function personaVoiceOptions(modelID, vendorID, showsAvatar) {
|
|
242
|
+
const faces = vendorID && showsAvatar ? AIEngine.Instance.GetModelPersonas(modelID, 'Video', vendorID).filter(isPresetFace) : [];
|
|
243
|
+
// First face per persona wins, as faces.find() would.
|
|
244
|
+
const facesByPersona = IndexByUUID(faces, (f) => f.Persona.ID);
|
|
245
|
+
return AIEngine.Instance.GetModelPersonas(modelID, 'Audio', vendorID).map((voice) => {
|
|
246
|
+
const face = facesByPersona.Get(voice.Persona.ID);
|
|
247
|
+
const image = voice.Persona.PreviewImageURL?.trim();
|
|
248
|
+
return {
|
|
249
|
+
ID: voice.PersonaVendor.APIName,
|
|
250
|
+
Name: voice.Persona.Name,
|
|
251
|
+
PersonaID: voice.Persona.ID,
|
|
252
|
+
...(face ? { AvatarID: face.PersonaVendor.APIName.trim() } : {}),
|
|
253
|
+
...(image ? { PreviewImageURL: image } : {}),
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Whether a Video binding is a face a picked voice can bring: a preset (`Avatar.Kind` absent or `'preset'`). Custom avatars
|
|
259
|
+
* are not supported, so a session asking for one would stay audio only.
|
|
260
|
+
*/
|
|
261
|
+
function isPresetFace(face) {
|
|
262
|
+
return (face.PersonaVendor.VendorSettingsObject?.Avatar?.Kind ?? 'preset') !== 'custom';
|
|
263
|
+
}
|
|
203
264
|
/** Resolves the agent entity from the engine cache by id (preferred), then by case-insensitive name. */
|
|
204
265
|
function resolveAgentEntity(ctx) {
|
|
205
266
|
const agents = AIEngine.Instance.Agents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-realtime-session-factory.js","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"bridge-realtime-session-factory.js","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,iBAAiB,EAAiE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3K,OAAO,EAAqB,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAiB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,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