@memberjunction/ai-agents 6.2.0-edge.1 → 6.2.0-edge.2
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 +18 -0
- package/dist/AgentDecisionService.d.ts +83 -0
- package/dist/AgentDecisionService.d.ts.map +1 -0
- package/dist/AgentDecisionService.js +155 -0
- package/dist/AgentDecisionService.js.map +1 -0
- package/dist/AgentRunner.d.ts +7 -0
- package/dist/AgentRunner.d.ts.map +1 -1
- package/dist/AgentRunner.js +16 -5
- package/dist/AgentRunner.js.map +1 -1
- package/dist/KnowledgeAgent.d.ts.map +1 -1
- package/dist/KnowledgeAgent.js +6 -6
- package/dist/KnowledgeAgent.js.map +1 -1
- package/dist/PayloadFeedbackManager.d.ts +113 -14
- package/dist/PayloadFeedbackManager.d.ts.map +1 -1
- package/dist/PayloadFeedbackManager.js +228 -88
- package/dist/PayloadFeedbackManager.js.map +1 -1
- package/dist/agent-context-injector.d.ts +47 -3
- package/dist/agent-context-injector.d.ts.map +1 -1
- package/dist/agent-context-injector.js +77 -10
- package/dist/agent-context-injector.js.map +1 -1
- package/dist/agent-memory-context-builder.d.ts +13 -0
- package/dist/agent-memory-context-builder.d.ts.map +1 -1
- package/dist/agent-memory-context-builder.js +24 -5
- package/dist/agent-memory-context-builder.js.map +1 -1
- package/dist/agent-types/flow-agent-type.d.ts +97 -0
- package/dist/agent-types/flow-agent-type.d.ts.map +1 -1
- package/dist/agent-types/flow-agent-type.js +281 -24
- package/dist/agent-types/flow-agent-type.js.map +1 -1
- package/dist/agent-types/flow-graph-executor.d.ts +12 -1
- package/dist/agent-types/flow-graph-executor.d.ts.map +1 -1
- package/dist/agent-types/flow-graph-executor.js +25 -1
- package/dist/agent-types/flow-graph-executor.js.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.d.ts +239 -66
- package/dist/agent-types/loop-agent-prompt-params.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.js +47 -2
- package/dist/agent-types/loop-agent-prompt-params.js.map +1 -1
- package/dist/agent-types/loop-agent-response-type.d.ts +12 -1
- package/dist/agent-types/loop-agent-response-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-response-type.js.map +1 -1
- package/dist/agent-types/loop-agent-type.d.ts +6 -0
- package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-type.js +42 -3
- package/dist/agent-types/loop-agent-type.js.map +1 -1
- package/dist/base-agent.d.ts +492 -2
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +1686 -95
- package/dist/base-agent.js.map +1 -1
- package/dist/catalog-narrowing.d.ts +136 -0
- package/dist/catalog-narrowing.d.ts.map +1 -0
- package/dist/catalog-narrowing.js +212 -0
- package/dist/catalog-narrowing.js.map +1 -0
- package/dist/decision-discovery.d.ts +401 -0
- package/dist/decision-discovery.d.ts.map +1 -0
- package/dist/decision-discovery.js +511 -0
- package/dist/decision-discovery.js.map +1 -0
- package/dist/finish-if-mode-warnings.d.ts +39 -0
- package/dist/finish-if-mode-warnings.d.ts.map +1 -0
- package/dist/finish-if-mode-warnings.js +78 -0
- package/dist/finish-if-mode-warnings.js.map +1 -0
- package/dist/finish-if-state.d.ts +72 -0
- package/dist/finish-if-state.d.ts.map +1 -0
- package/dist/finish-if-state.js +109 -0
- package/dist/finish-if-state.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/memory-manager-agent.d.ts +108 -2
- package/dist/memory-manager-agent.d.ts.map +1 -1
- package/dist/memory-manager-agent.js +172 -9
- package/dist/memory-manager-agent.js.map +1 -1
- package/dist/memory-note-gate.d.ts +208 -0
- package/dist/memory-note-gate.d.ts.map +1 -0
- package/dist/memory-note-gate.js +294 -0
- package/dist/memory-note-gate.js.map +1 -0
- package/dist/realtime/bridge-realtime-session-factory.d.ts +5 -2
- package/dist/realtime/bridge-realtime-session-factory.d.ts.map +1 -1
- package/dist/realtime/bridge-realtime-session-factory.js +7 -4
- package/dist/realtime/bridge-realtime-session-factory.js.map +1 -1
- package/dist/realtime/bridge-room-transcript-sink.d.ts.map +1 -1
- package/dist/realtime/bridge-room-transcript-sink.js +15 -9
- package/dist/realtime/bridge-room-transcript-sink.js.map +1 -1
- package/dist/realtime/realtime-client-session-service.d.ts +54 -12
- package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
- package/dist/realtime/realtime-client-session-service.js +76 -25
- package/dist/realtime/realtime-client-session-service.js.map +1 -1
- package/dist/realtime/realtime-vendor-resolution.d.ts +8 -3
- package/dist/realtime/realtime-vendor-resolution.d.ts.map +1 -1
- package/dist/realtime/realtime-vendor-resolution.js +3 -3
- package/dist/realtime/realtime-vendor-resolution.js.map +1 -1
- package/dist/rubric-evaluation-agent-runner.d.ts +2 -0
- package/dist/rubric-evaluation-agent-runner.d.ts.map +1 -0
- package/dist/rubric-evaluation-agent-runner.js +38 -0
- package/dist/rubric-evaluation-agent-runner.js.map +1 -0
- package/dist/self-check.d.ts +98 -0
- package/dist/self-check.d.ts.map +1 -0
- package/dist/self-check.js +74 -0
- package/dist/self-check.js.map +1 -0
- package/package.json +19 -18
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pure typed-decision gate module for extracted memory notes.
|
|
3
|
+
*
|
|
4
|
+
* Implements question generation, state projection, Platt calibration application,
|
|
5
|
+
* and note filtering for durable memory candidates.
|
|
6
|
+
*
|
|
7
|
+
* @module @memberjunction/ai-agents
|
|
8
|
+
*/
|
|
9
|
+
import { type AIModelConfiguration, type DecisionAnswer, type LikelihoodQuestion, type PlattCalibration } from '@memberjunction/ai';
|
|
10
|
+
import { type DecisionAnsweringModel, type DecisionModelCalibration, type MJAIPromptEntityExtended } from '@memberjunction/ai-core-plus';
|
|
11
|
+
import type { MJAIModelVendorEntity, MJAIPromptModelEntity } from '@memberjunction/core-entities';
|
|
12
|
+
/**
|
|
13
|
+
* Standard instructions used for Likelihood questions evaluating candidate memory notes.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MEMORY_NOTE_QUESTION_INSTRUCTIONS = "This note is a correct, durable fact or preference about the user, their organization or how they want the agent to work, that is worth remembering in future conversations; it is not a one-off request, a guess, or a detail of this conversation only.";
|
|
16
|
+
/**
|
|
17
|
+
* Maximum character limit for a candidate note's content in the decision state.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MEMORY_NOTE_MAX_CONTENT_CHARS = 1000;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum character limit for conversation excerpts in the decision state.
|
|
22
|
+
*/
|
|
23
|
+
export declare const MEMORY_NOTE_MAX_EXCERPT_CHARS = 4000;
|
|
24
|
+
/**
|
|
25
|
+
* The least **calibrated** probability at which a candidate note is kept.
|
|
26
|
+
*
|
|
27
|
+
* Set from the memory-note gate measurement (plan Task 3.4, 2026-09-29): 60 synthetic conversations,
|
|
28
|
+
* 337 candidate notes labelled durable, ephemeral, wrong or speculative, two repeats. At a calibrated
|
|
29
|
+
* 0.6, Jev kept durable notes at 96.1% precision and 95.4% recall, and kept 6.2% of the
|
|
30
|
+
* conversation-only (ephemeral) notes. A proxy self-report scorer's `confidence >= 80` kept 40.0% of
|
|
31
|
+
* them at 85.3% precision and 98.7% recall. Neither kept a wrong note; the gate kept 3.4% of the
|
|
32
|
+
* speculative ones, the proxy none.
|
|
33
|
+
*
|
|
34
|
+
* **The baseline is a proxy, not today's Memory Manager.** Its self-reported confidence came from a
|
|
35
|
+
* separate scoring call with a four-band rubric (90-100 stated, 75-89 strongly implied, 50-74
|
|
36
|
+
* possible, below 50 skip). Production's `Memory Manager - Extract Notes` template has three bands
|
|
37
|
+
* (90-100, 80-89, below 80 skip), and skip rules the proxy doesn't have: one-time requests, matters
|
|
38
|
+
* resolved within the conversation, and task-scoped clarifications. Those rules drop exactly the
|
|
39
|
+
* ephemeral notes counted here before any confidence filter runs, so production probably keeps fewer
|
|
40
|
+
* than 40% of them. The gate's own figures stand; the comparison is against the proxy.
|
|
41
|
+
*/
|
|
42
|
+
export declare const MEMORY_NOTE_MIN_PROBABILITY = 0.6;
|
|
43
|
+
/**
|
|
44
|
+
* Platt calibration of the memory-note Likelihood, each tied to the exact model it was fitted on (see
|
|
45
|
+
* `FindDecisionCalibration` in `@memberjunction/ai-core-plus`): the MJ decision model that answered
|
|
46
|
+
* (`ModelName`, from `modelInfo.modelName`) and the model its driver reports behind it
|
|
47
|
+
* (`ResolvedModel`, from `DecisionResult.ResolvedModel`). Fitted on the memory-note gate measurement:
|
|
48
|
+
* - **Jev** at its pinned `APIName`, `typesafe/jev-1.13-20260917`, which it reports back as the
|
|
49
|
+
* resolved model.
|
|
50
|
+
*
|
|
51
|
+
* Only models that beat the proxy self-report scorer (see {@link MEMORY_NOTE_MIN_PROBABILITY}) are
|
|
52
|
+
* listed. LLM Decision was measured and left out: at any threshold it kept more wrong and speculative
|
|
53
|
+
* notes than the proxy's `confidence >= 80` (at a calibrated 0.6, 11.5% of wrong notes). A batch answered by any other model, including Jev at another version,
|
|
54
|
+
* falls back to the self-reported confidence rule, as a failed decision does. Refit, and add the new
|
|
55
|
+
* pair, whenever a model, its version or the question changes.
|
|
56
|
+
*/
|
|
57
|
+
export declare const MEMORY_NOTE_DECISION_CALIBRATION: readonly DecisionModelCalibration<PlattCalibration>[];
|
|
58
|
+
/**
|
|
59
|
+
* Shape of a candidate note evaluated by the decision gate.
|
|
60
|
+
*/
|
|
61
|
+
export interface MemoryNoteCandidate {
|
|
62
|
+
readonly type: 'Preference' | 'Constraint' | 'Context' | 'Issue' | string;
|
|
63
|
+
readonly content: string;
|
|
64
|
+
readonly confidence?: number;
|
|
65
|
+
readonly scopeLevel?: 'global' | 'company' | 'user' | string;
|
|
66
|
+
readonly agentId?: string | null;
|
|
67
|
+
readonly userId?: string | null;
|
|
68
|
+
readonly companyId?: string | null;
|
|
69
|
+
/** The conversation the note was extracted from: the one it is judged against. */
|
|
70
|
+
readonly sourceConversationId?: string | null;
|
|
71
|
+
}
|
|
72
|
+
/** One turn of the conversation a note came from, as the gate's state quotes it. */
|
|
73
|
+
export interface MemoryNoteExcerptTurn {
|
|
74
|
+
readonly role: string;
|
|
75
|
+
readonly text: string;
|
|
76
|
+
}
|
|
77
|
+
/** A conversation candidate notes may have come from. */
|
|
78
|
+
export interface MemoryNoteConversation {
|
|
79
|
+
readonly ConversationId: string;
|
|
80
|
+
readonly Turns: ReadonlyArray<MemoryNoteExcerptTurn>;
|
|
81
|
+
}
|
|
82
|
+
/** The candidate notes of one conversation, with that conversation's excerpt: one decision state. */
|
|
83
|
+
export interface MemoryNoteConversationBatch<T extends MemoryNoteCandidate = MemoryNoteCandidate> {
|
|
84
|
+
readonly ConversationId: string;
|
|
85
|
+
readonly Excerpt: string;
|
|
86
|
+
readonly Notes: T[];
|
|
87
|
+
}
|
|
88
|
+
/** Candidate notes grouped by the conversation they came from. */
|
|
89
|
+
export interface MemoryNoteConversationGrouping<T extends MemoryNoteCandidate = MemoryNoteCandidate> {
|
|
90
|
+
/** One batch per conversation with notes, in the conversations' order; each keeps its notes' order. */
|
|
91
|
+
readonly Batches: MemoryNoteConversationBatch<T>[];
|
|
92
|
+
/** The notes whose conversation could not be told: they must not be judged against any. */
|
|
93
|
+
readonly Unattributed: T[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Projection of a candidate note in the decision state payload.
|
|
97
|
+
*/
|
|
98
|
+
export interface MemoryNoteStateItem {
|
|
99
|
+
readonly type: string;
|
|
100
|
+
readonly scope: string;
|
|
101
|
+
readonly content: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Decision state object sent with the decision prompt.
|
|
105
|
+
*/
|
|
106
|
+
export type MemoryNoteDecisionState = {
|
|
107
|
+
readonly notes: Record<string, MemoryNoteStateItem>;
|
|
108
|
+
readonly conversationExcerpt?: string;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Individual evaluated note verdict.
|
|
112
|
+
*/
|
|
113
|
+
export interface JudgedMemoryNote<T extends MemoryNoteCandidate = MemoryNoteCandidate> {
|
|
114
|
+
readonly Note: T;
|
|
115
|
+
readonly Key: string;
|
|
116
|
+
readonly RawProbability?: number;
|
|
117
|
+
readonly CalibratedProbability?: number;
|
|
118
|
+
readonly Kept: boolean;
|
|
119
|
+
readonly Reason: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Aggregate verdict for a batch of evaluated memory notes.
|
|
123
|
+
*/
|
|
124
|
+
export interface MemoryNoteGateVerdict<T extends MemoryNoteCandidate = MemoryNoteCandidate> {
|
|
125
|
+
readonly KeptNotes: T[];
|
|
126
|
+
readonly JudgedNotes: JudgedMemoryNote<T>[];
|
|
127
|
+
/** The model that answered, as the decision result reported it. */
|
|
128
|
+
readonly AnsweredBy: DecisionAnsweringModel;
|
|
129
|
+
readonly Calibrated: boolean;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* What {@link MemoryNotePromptQuestionCap} reads from the AI engine to resolve the question limit.
|
|
133
|
+
* `AIEngine.Instance` satisfies it.
|
|
134
|
+
*/
|
|
135
|
+
export interface MemoryNoteEngineSource {
|
|
136
|
+
readonly Prompts: ReadonlyArray<Pick<MJAIPromptEntityExtended, 'ID' | 'Name'>>;
|
|
137
|
+
readonly PromptModels: ReadonlyArray<Pick<MJAIPromptModelEntity, 'PromptID' | 'ModelID' | 'VendorID' | 'Status'>>;
|
|
138
|
+
readonly ModelVendors: ReadonlyArray<Pick<MJAIModelVendorEntity, 'ID' | 'ModelID' | 'VendorID'>>;
|
|
139
|
+
GetEffectiveModelConfiguration(modelID: string, vendorModelVendorID?: string): Pick<AIModelConfiguration, 'Decision'> | null;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Builds likelihood questions for each candidate note, keyed n1, n2, etc.
|
|
143
|
+
*
|
|
144
|
+
* Each question quotes its own note. Question keys are labels for code, not instructions to the
|
|
145
|
+
* model, and a native decision driver (Jev) may answer each question separately against the state,
|
|
146
|
+
* so a question that only named its key would ask the same thing about every note. Measured: with
|
|
147
|
+
* the note left out of the question, Jev's answers were at chance (AUC 0.51).
|
|
148
|
+
*
|
|
149
|
+
* @param notes The candidate notes to build questions for.
|
|
150
|
+
*/
|
|
151
|
+
export declare function BuildMemoryNoteQuestions(notes: ReadonlyArray<MemoryNoteCandidate>): Record<string, LikelihoodQuestion>;
|
|
152
|
+
/** One note's question: the durable-memory test, then the note itself, capped. */
|
|
153
|
+
export declare function MemoryNoteQuestionInstructions(note: MemoryNoteCandidate): string;
|
|
154
|
+
/**
|
|
155
|
+
* The conversation a batch of notes came from, as the gate's state quotes it: one `[role]: text`
|
|
156
|
+
* line per turn. The measurement rig wrote its corpus excerpts with this, one conversation per
|
|
157
|
+
* state, which is what the Platt fit and the threshold were set on; {@link BuildMemoryNoteState}
|
|
158
|
+
* caps it.
|
|
159
|
+
*
|
|
160
|
+
* @param turns The conversation's turns, in order.
|
|
161
|
+
*/
|
|
162
|
+
export declare function FormatMemoryNoteExcerpt(turns: ReadonlyArray<MemoryNoteExcerptTurn>): string;
|
|
163
|
+
/**
|
|
164
|
+
* Groups candidate notes by the conversation they came from, so each note is judged against its own
|
|
165
|
+
* conversation, as the gate was measured: one conversation per decision state. A note whose
|
|
166
|
+
* `sourceConversationId` names none of the conversations belongs to the only conversation when there
|
|
167
|
+
* is one; with several, it is unattributed, and must not be judged against another conversation.
|
|
168
|
+
*
|
|
169
|
+
* @param notes The candidate notes.
|
|
170
|
+
* @param conversations The conversations they were extracted from.
|
|
171
|
+
*/
|
|
172
|
+
export declare function GroupMemoryNotesByConversation<T extends MemoryNoteCandidate>(notes: ReadonlyArray<T>, conversations: ReadonlyArray<MemoryNoteConversation>): MemoryNoteConversationGrouping<T>;
|
|
173
|
+
/**
|
|
174
|
+
* Builds the state object for the decision prompt, capping content and excerpts.
|
|
175
|
+
*
|
|
176
|
+
* @param notes Candidate notes to project.
|
|
177
|
+
* @param sourceExcerpts Optional conversation thread context.
|
|
178
|
+
*/
|
|
179
|
+
export declare function BuildMemoryNoteState(notes: ReadonlyArray<MemoryNoteCandidate>, sourceExcerpts?: string | Record<string, string> | readonly string[]): MemoryNoteDecisionState;
|
|
180
|
+
/**
|
|
181
|
+
* Evaluates decision answers against candidate notes using Platt calibration.
|
|
182
|
+
*
|
|
183
|
+
* The calibration is the one fitted on the exact model that answered (`FindDecisionCalibration`).
|
|
184
|
+
* An answer from any other model, including a calibrated model at another version, is uncalibrated
|
|
185
|
+
* and keeps nothing (fails safe toward writing no durable memory).
|
|
186
|
+
*
|
|
187
|
+
* @param answers The answers returned by the decision runner.
|
|
188
|
+
* @param notes The candidate notes evaluated.
|
|
189
|
+
* @param answeredBy The model that answered: the MJ decision model and the model its driver resolved.
|
|
190
|
+
* @param threshold The calibrated probability at which a note is kept (default: {@link MEMORY_NOTE_MIN_PROBABILITY}, 0.6).
|
|
191
|
+
* @param calibrations Optional calibration table override (defaults to {@link MEMORY_NOTE_DECISION_CALIBRATION}).
|
|
192
|
+
*/
|
|
193
|
+
export declare function JudgeMemoryNotes<T extends MemoryNoteCandidate = MemoryNoteCandidate>(answers: Record<string, DecisionAnswer> | undefined, notes: ReadonlyArray<T>, answeredBy?: DecisionAnsweringModel, threshold?: number, calibrations?: readonly DecisionModelCalibration<PlattCalibration>[]): MemoryNoteGateVerdict<T>;
|
|
194
|
+
/**
|
|
195
|
+
* Looks up the prompt's configured MaxQuestionsPerCall limit from active PromptModels.
|
|
196
|
+
*
|
|
197
|
+
* @param engine AIEngine metadata source.
|
|
198
|
+
* @param promptName Name of the decision prompt (default: 'Default Decision').
|
|
199
|
+
*/
|
|
200
|
+
export declare function MemoryNotePromptQuestionCap(engine: MemoryNoteEngineSource, promptName?: string): number | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Splits candidate notes into chunks not exceeding the specified chunk size.
|
|
203
|
+
*
|
|
204
|
+
* @param notes The notes to chunk.
|
|
205
|
+
* @param chunkSize Maximum number of notes per chunk.
|
|
206
|
+
*/
|
|
207
|
+
export declare function ChunkMemoryNotes<T>(notes: ReadonlyArray<T>, chunkSize?: number): T[][];
|
|
208
|
+
//# sourceMappingURL=memory-note-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-note-gate.d.ts","sourceRoot":"","sources":["../src/memory-note-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGlG;;GAEG;AACH,eAAO,MAAM,iCAAiC,8PACiN,CAAC;AAEhQ;;GAEG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,wBAAwB,CAAC,gBAAgB,CAAC,EAEhG,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC1E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7D,QAAQ,CAAC,OAAO,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GAAE,MAA2B,GACxC,MAAM,GAAG,SAAS,CAmBpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAStF"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pure typed-decision gate module for extracted memory notes.
|
|
3
|
+
*
|
|
4
|
+
* Implements question generation, state projection, Platt calibration application,
|
|
5
|
+
* and note filtering for durable memory candidates.
|
|
6
|
+
*
|
|
7
|
+
* @module @memberjunction/ai-agents
|
|
8
|
+
*/
|
|
9
|
+
import { ApplyPlattCalibration } from '@memberjunction/ai';
|
|
10
|
+
import { DescribeAnsweringModel, FindDecisionCalibration } from '@memberjunction/ai-core-plus';
|
|
11
|
+
import { UUIDsEqual } from '@memberjunction/global';
|
|
12
|
+
/**
|
|
13
|
+
* Standard instructions used for Likelihood questions evaluating candidate memory notes.
|
|
14
|
+
*/
|
|
15
|
+
export const MEMORY_NOTE_QUESTION_INSTRUCTIONS = 'This note is a correct, durable fact or preference about the user, their organization or how they want the agent to work, that is worth remembering in future conversations; it is not a one-off request, a guess, or a detail of this conversation only.';
|
|
16
|
+
/**
|
|
17
|
+
* Maximum character limit for a candidate note's content in the decision state.
|
|
18
|
+
*/
|
|
19
|
+
export const MEMORY_NOTE_MAX_CONTENT_CHARS = 1000;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum character limit for conversation excerpts in the decision state.
|
|
22
|
+
*/
|
|
23
|
+
export const MEMORY_NOTE_MAX_EXCERPT_CHARS = 4000;
|
|
24
|
+
/**
|
|
25
|
+
* The least **calibrated** probability at which a candidate note is kept.
|
|
26
|
+
*
|
|
27
|
+
* Set from the memory-note gate measurement (plan Task 3.4, 2026-09-29): 60 synthetic conversations,
|
|
28
|
+
* 337 candidate notes labelled durable, ephemeral, wrong or speculative, two repeats. At a calibrated
|
|
29
|
+
* 0.6, Jev kept durable notes at 96.1% precision and 95.4% recall, and kept 6.2% of the
|
|
30
|
+
* conversation-only (ephemeral) notes. A proxy self-report scorer's `confidence >= 80` kept 40.0% of
|
|
31
|
+
* them at 85.3% precision and 98.7% recall. Neither kept a wrong note; the gate kept 3.4% of the
|
|
32
|
+
* speculative ones, the proxy none.
|
|
33
|
+
*
|
|
34
|
+
* **The baseline is a proxy, not today's Memory Manager.** Its self-reported confidence came from a
|
|
35
|
+
* separate scoring call with a four-band rubric (90-100 stated, 75-89 strongly implied, 50-74
|
|
36
|
+
* possible, below 50 skip). Production's `Memory Manager - Extract Notes` template has three bands
|
|
37
|
+
* (90-100, 80-89, below 80 skip), and skip rules the proxy doesn't have: one-time requests, matters
|
|
38
|
+
* resolved within the conversation, and task-scoped clarifications. Those rules drop exactly the
|
|
39
|
+
* ephemeral notes counted here before any confidence filter runs, so production probably keeps fewer
|
|
40
|
+
* than 40% of them. The gate's own figures stand; the comparison is against the proxy.
|
|
41
|
+
*/
|
|
42
|
+
export const MEMORY_NOTE_MIN_PROBABILITY = 0.6;
|
|
43
|
+
/**
|
|
44
|
+
* Platt calibration of the memory-note Likelihood, each tied to the exact model it was fitted on (see
|
|
45
|
+
* `FindDecisionCalibration` in `@memberjunction/ai-core-plus`): the MJ decision model that answered
|
|
46
|
+
* (`ModelName`, from `modelInfo.modelName`) and the model its driver reports behind it
|
|
47
|
+
* (`ResolvedModel`, from `DecisionResult.ResolvedModel`). Fitted on the memory-note gate measurement:
|
|
48
|
+
* - **Jev** at its pinned `APIName`, `typesafe/jev-1.13-20260917`, which it reports back as the
|
|
49
|
+
* resolved model.
|
|
50
|
+
*
|
|
51
|
+
* Only models that beat the proxy self-report scorer (see {@link MEMORY_NOTE_MIN_PROBABILITY}) are
|
|
52
|
+
* listed. LLM Decision was measured and left out: at any threshold it kept more wrong and speculative
|
|
53
|
+
* notes than the proxy's `confidence >= 80` (at a calibrated 0.6, 11.5% of wrong notes). A batch answered by any other model, including Jev at another version,
|
|
54
|
+
* falls back to the self-reported confidence rule, as a failed decision does. Refit, and add the new
|
|
55
|
+
* pair, whenever a model, its version or the question changes.
|
|
56
|
+
*/
|
|
57
|
+
export const MEMORY_NOTE_DECISION_CALIBRATION = Object.freeze([
|
|
58
|
+
Object.freeze({ ModelName: 'Jev', ResolvedModel: 'typesafe/jev-1.13-20260917', Calibration: Object.freeze({ A: 3.6391, B: -5.7059 }) })
|
|
59
|
+
]);
|
|
60
|
+
/**
|
|
61
|
+
* Builds likelihood questions for each candidate note, keyed n1, n2, etc.
|
|
62
|
+
*
|
|
63
|
+
* Each question quotes its own note. Question keys are labels for code, not instructions to the
|
|
64
|
+
* model, and a native decision driver (Jev) may answer each question separately against the state,
|
|
65
|
+
* so a question that only named its key would ask the same thing about every note. Measured: with
|
|
66
|
+
* the note left out of the question, Jev's answers were at chance (AUC 0.51).
|
|
67
|
+
*
|
|
68
|
+
* @param notes The candidate notes to build questions for.
|
|
69
|
+
*/
|
|
70
|
+
export function BuildMemoryNoteQuestions(notes) {
|
|
71
|
+
const questions = {};
|
|
72
|
+
for (let i = 0; i < notes.length; i++) {
|
|
73
|
+
questions[`n${i + 1}`] = {
|
|
74
|
+
Kind: 'Likelihood',
|
|
75
|
+
Instructions: MemoryNoteQuestionInstructions(notes[i])
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return questions;
|
|
79
|
+
}
|
|
80
|
+
/** One note's question: the durable-memory test, then the note itself, capped. */
|
|
81
|
+
export function MemoryNoteQuestionInstructions(note) {
|
|
82
|
+
const content = (note.content ?? '').slice(0, MEMORY_NOTE_MAX_CONTENT_CHARS);
|
|
83
|
+
return `${MEMORY_NOTE_QUESTION_INSTRUCTIONS}\n\nThe note (${note.type}, ${note.scopeLevel ?? 'user'} scope): "${content}"`;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The conversation a batch of notes came from, as the gate's state quotes it: one `[role]: text`
|
|
87
|
+
* line per turn. The measurement rig wrote its corpus excerpts with this, one conversation per
|
|
88
|
+
* state, which is what the Platt fit and the threshold were set on; {@link BuildMemoryNoteState}
|
|
89
|
+
* caps it.
|
|
90
|
+
*
|
|
91
|
+
* @param turns The conversation's turns, in order.
|
|
92
|
+
*/
|
|
93
|
+
export function FormatMemoryNoteExcerpt(turns) {
|
|
94
|
+
return turns.map(turn => `[${turn.role}]: ${turn.text}`).join('\n');
|
|
95
|
+
}
|
|
96
|
+
/** The conversation a note names, compared as UUIDs, or null when it names none of them. */
|
|
97
|
+
function conversationOf(note, conversations) {
|
|
98
|
+
const source = note.sourceConversationId;
|
|
99
|
+
return source ? conversations.find(c => UUIDsEqual(c.ConversationId, source)) ?? null : null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Groups candidate notes by the conversation they came from, so each note is judged against its own
|
|
103
|
+
* conversation, as the gate was measured: one conversation per decision state. A note whose
|
|
104
|
+
* `sourceConversationId` names none of the conversations belongs to the only conversation when there
|
|
105
|
+
* is one; with several, it is unattributed, and must not be judged against another conversation.
|
|
106
|
+
*
|
|
107
|
+
* @param notes The candidate notes.
|
|
108
|
+
* @param conversations The conversations they were extracted from.
|
|
109
|
+
*/
|
|
110
|
+
export function GroupMemoryNotesByConversation(notes, conversations) {
|
|
111
|
+
const byConversation = new Map();
|
|
112
|
+
const unattributed = [];
|
|
113
|
+
for (const note of notes) {
|
|
114
|
+
const conversation = conversationOf(note, conversations) ?? (conversations.length === 1 ? conversations[0] : null);
|
|
115
|
+
if (!conversation) {
|
|
116
|
+
unattributed.push(note);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
byConversation.set(conversation, [...(byConversation.get(conversation) ?? []), note]);
|
|
120
|
+
}
|
|
121
|
+
const batches = conversations
|
|
122
|
+
.filter(c => byConversation.has(c))
|
|
123
|
+
.map(c => ({ ConversationId: c.ConversationId, Excerpt: FormatMemoryNoteExcerpt(c.Turns), Notes: byConversation.get(c) ?? [] }));
|
|
124
|
+
return { Batches: batches, Unattributed: unattributed };
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Formats source conversation excerpts into a single string within max character limits.
|
|
128
|
+
*/
|
|
129
|
+
function formatExcerpt(sourceExcerpts) {
|
|
130
|
+
if (!sourceExcerpts) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
let text;
|
|
134
|
+
if (typeof sourceExcerpts === 'string') {
|
|
135
|
+
text = sourceExcerpts.trim();
|
|
136
|
+
}
|
|
137
|
+
else if (Array.isArray(sourceExcerpts)) {
|
|
138
|
+
text = sourceExcerpts.join('\n---\n').trim();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
text = Object.entries(sourceExcerpts)
|
|
142
|
+
.map(([id, excerpt]) => `[${id}]: ${excerpt}`)
|
|
143
|
+
.join('\n---\n')
|
|
144
|
+
.trim();
|
|
145
|
+
}
|
|
146
|
+
return text.length > 0 ? text.slice(0, MEMORY_NOTE_MAX_EXCERPT_CHARS) : undefined;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Builds the state object for the decision prompt, capping content and excerpts.
|
|
150
|
+
*
|
|
151
|
+
* @param notes Candidate notes to project.
|
|
152
|
+
* @param sourceExcerpts Optional conversation thread context.
|
|
153
|
+
*/
|
|
154
|
+
export function BuildMemoryNoteState(notes, sourceExcerpts) {
|
|
155
|
+
const notesMap = {};
|
|
156
|
+
for (let i = 0; i < notes.length; i++) {
|
|
157
|
+
const note = notes[i];
|
|
158
|
+
const key = `n${i + 1}`;
|
|
159
|
+
notesMap[key] = {
|
|
160
|
+
type: note.type,
|
|
161
|
+
scope: note.scopeLevel ?? 'user',
|
|
162
|
+
content: (note.content ?? '').slice(0, MEMORY_NOTE_MAX_CONTENT_CHARS)
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
const excerpt = formatExcerpt(sourceExcerpts);
|
|
166
|
+
return excerpt ? { notes: notesMap, conversationExcerpt: excerpt } : { notes: notesMap };
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Extracts raw probability from a decision answer if it is a valid Likelihood.
|
|
170
|
+
*/
|
|
171
|
+
function extractRawProbability(answer) {
|
|
172
|
+
if (!answer || answer.Kind !== 'Likelihood') {
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
if (typeof answer.Probability !== 'number' || !Number.isFinite(answer.Probability)) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return answer.Probability;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Judges a single note when the model is uncalibrated.
|
|
182
|
+
*/
|
|
183
|
+
function judgeUncalibratedNote(note, key, rawProb, answeredBy) {
|
|
184
|
+
const reason = answeredBy.ModelName?.trim() || answeredBy.ResolvedModel?.trim()
|
|
185
|
+
? `The answering model ${DescribeAnsweringModel(answeredBy)} has no memory-note calibration, so the gate keeps nothing`
|
|
186
|
+
: 'No answering model was reported, so the gate keeps nothing';
|
|
187
|
+
return {
|
|
188
|
+
Note: note,
|
|
189
|
+
Key: key,
|
|
190
|
+
RawProbability: rawProb,
|
|
191
|
+
Kept: false,
|
|
192
|
+
Reason: reason
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Judges a single note when calibration parameters are present.
|
|
197
|
+
*/
|
|
198
|
+
function judgeCalibratedNote(note, key, rawProb, calibration, threshold) {
|
|
199
|
+
if (rawProb === undefined) {
|
|
200
|
+
return {
|
|
201
|
+
Note: note,
|
|
202
|
+
Key: key,
|
|
203
|
+
Kept: false,
|
|
204
|
+
Reason: `Missing or invalid Likelihood answer for question '${key}'`
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
const calProb = ApplyPlattCalibration(rawProb, calibration);
|
|
208
|
+
const kept = calProb >= threshold;
|
|
209
|
+
const reason = kept
|
|
210
|
+
? `Calibrated probability ${calProb.toFixed(4)} >= threshold ${threshold}`
|
|
211
|
+
: `Calibrated probability ${calProb.toFixed(4)} < threshold ${threshold}`;
|
|
212
|
+
return {
|
|
213
|
+
Note: note,
|
|
214
|
+
Key: key,
|
|
215
|
+
RawProbability: rawProb,
|
|
216
|
+
CalibratedProbability: calProb,
|
|
217
|
+
Kept: kept,
|
|
218
|
+
Reason: reason
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Evaluates decision answers against candidate notes using Platt calibration.
|
|
223
|
+
*
|
|
224
|
+
* The calibration is the one fitted on the exact model that answered (`FindDecisionCalibration`).
|
|
225
|
+
* An answer from any other model, including a calibrated model at another version, is uncalibrated
|
|
226
|
+
* and keeps nothing (fails safe toward writing no durable memory).
|
|
227
|
+
*
|
|
228
|
+
* @param answers The answers returned by the decision runner.
|
|
229
|
+
* @param notes The candidate notes evaluated.
|
|
230
|
+
* @param answeredBy The model that answered: the MJ decision model and the model its driver resolved.
|
|
231
|
+
* @param threshold The calibrated probability at which a note is kept (default: {@link MEMORY_NOTE_MIN_PROBABILITY}, 0.6).
|
|
232
|
+
* @param calibrations Optional calibration table override (defaults to {@link MEMORY_NOTE_DECISION_CALIBRATION}).
|
|
233
|
+
*/
|
|
234
|
+
export function JudgeMemoryNotes(answers, notes, answeredBy = {}, threshold = MEMORY_NOTE_MIN_PROBABILITY, calibrations = MEMORY_NOTE_DECISION_CALIBRATION) {
|
|
235
|
+
const calibration = FindDecisionCalibration(calibrations, answeredBy);
|
|
236
|
+
const judgedNotes = [];
|
|
237
|
+
for (let i = 0; i < notes.length; i++) {
|
|
238
|
+
const note = notes[i];
|
|
239
|
+
const key = `n${i + 1}`;
|
|
240
|
+
const rawProb = extractRawProbability(answers?.[key]);
|
|
241
|
+
const judged = calibration
|
|
242
|
+
? judgeCalibratedNote(note, key, rawProb, calibration, threshold)
|
|
243
|
+
: judgeUncalibratedNote(note, key, rawProb, answeredBy);
|
|
244
|
+
judgedNotes.push(judged);
|
|
245
|
+
}
|
|
246
|
+
const keptNotes = judgedNotes.filter(j => j.Kept).map(j => j.Note);
|
|
247
|
+
return {
|
|
248
|
+
KeptNotes: keptNotes,
|
|
249
|
+
JudgedNotes: judgedNotes,
|
|
250
|
+
AnsweredBy: answeredBy,
|
|
251
|
+
Calibrated: calibration !== null
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Looks up the prompt's configured MaxQuestionsPerCall limit from active PromptModels.
|
|
256
|
+
*
|
|
257
|
+
* @param engine AIEngine metadata source.
|
|
258
|
+
* @param promptName Name of the decision prompt (default: 'Default Decision').
|
|
259
|
+
*/
|
|
260
|
+
export function MemoryNotePromptQuestionCap(engine, promptName = 'Default Decision') {
|
|
261
|
+
const target = promptName.trim().toLowerCase();
|
|
262
|
+
const prompt = engine.Prompts?.find(p => (p.Name ?? '').trim().toLowerCase() === target);
|
|
263
|
+
if (!prompt) {
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
const caps = (engine.PromptModels ?? [])
|
|
267
|
+
.filter(pm => UUIDsEqual(pm.PromptID, prompt.ID) && (pm.Status === 'Active' || pm.Status === 'Preview'))
|
|
268
|
+
.map(pm => {
|
|
269
|
+
const modelVendor = pm.VendorID
|
|
270
|
+
? (engine.ModelVendors ?? []).find(mv => UUIDsEqual(mv.ModelID, pm.ModelID) && UUIDsEqual(mv.VendorID, pm.VendorID))
|
|
271
|
+
: undefined;
|
|
272
|
+
return engine.GetEffectiveModelConfiguration(pm.ModelID, modelVendor?.ID)?.Decision
|
|
273
|
+
?.MaxQuestionsPerCall;
|
|
274
|
+
});
|
|
275
|
+
const declared = caps.filter((cap) => typeof cap === 'number' && cap > 0);
|
|
276
|
+
return declared.length > 0 ? Math.min(...declared) : undefined;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Splits candidate notes into chunks not exceeding the specified chunk size.
|
|
280
|
+
*
|
|
281
|
+
* @param notes The notes to chunk.
|
|
282
|
+
* @param chunkSize Maximum number of notes per chunk.
|
|
283
|
+
*/
|
|
284
|
+
export function ChunkMemoryNotes(notes, chunkSize) {
|
|
285
|
+
if (!chunkSize || chunkSize <= 0 || !Number.isFinite(chunkSize) || notes.length <= chunkSize) {
|
|
286
|
+
return [Array.from(notes)];
|
|
287
|
+
}
|
|
288
|
+
const chunks = [];
|
|
289
|
+
for (let i = 0; i < notes.length; i += chunkSize) {
|
|
290
|
+
chunks.push(notes.slice(i, i + chunkSize));
|
|
291
|
+
}
|
|
292
|
+
return chunks;
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=memory-note-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-note-gate.js","sourceRoot":"","sources":["../src/memory-note-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACH,qBAAqB,EAKxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,sBAAsB,EACtB,uBAAuB,EAI1B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC1C,2PAA2P,CAAC;AAEhQ;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAA0D,MAAM,CAAC,MAAM,CAAC;IACjH,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,4BAA4B,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;CAC1I,CAAC,CAAC;AA+FH;;;;;;;;;GASG;AACH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7 +16,7 @@
|
|
|
16
16
|
* @module @memberjunction/ai-agents
|
|
17
17
|
* @author MemberJunction.com
|
|
18
18
|
*/
|
|
19
|
-
import { IRealtimeSession, RealtimeVoiceOption } from '@memberjunction/ai';
|
|
19
|
+
import { IRealtimeSession, RealtimeVoiceOption, AIAPIKeyResolver } from '@memberjunction/ai';
|
|
20
20
|
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
21
21
|
/**
|
|
22
22
|
* The context a bridge passes to {@link CreateBridgeRealtimeSession}. Structurally compatible with the
|
|
@@ -105,7 +105,10 @@ export interface RealtimeModelVoices {
|
|
|
105
105
|
*
|
|
106
106
|
* @param contextUser The user the engine config runs as (server-side).
|
|
107
107
|
* @param provider The request-scoped metadata provider (multi-provider safe).
|
|
108
|
+
* @param resolveAPIKey Key-resolution seam deciding which vendors count as runnable. Defaults to the
|
|
109
|
+
* platform lookup (`AI_VENDOR_API_KEY__<driver>`); the voice-picker query has no run context and
|
|
110
|
+
* passes none, so today the list always reflects the platform's keys.
|
|
108
111
|
* @returns Active realtime models, each with its driver's voices.
|
|
109
112
|
*/
|
|
110
|
-
export declare function GetRealtimeModelVoices(contextUser?: UserInfo, provider?: IMetadataProvider): Promise<RealtimeModelVoices[]>;
|
|
113
|
+
export declare function GetRealtimeModelVoices(contextUser?: UserInfo, provider?: IMetadataProvider, resolveAPIKey?: AIAPIKeyResolver): Promise<RealtimeModelVoices[]>;
|
|
111
114
|
//# sourceMappingURL=bridge-realtime-session-factory.d.ts.map
|
|
@@ -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,EAAkC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"bridge-realtime-session-factory.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[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AE,MAAM,CAAC;IAClB,4FAA4F;IAC5F,MAAM,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CACxC,WAAW,CAAC,EAAE,QAAQ,EACtB,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,aAAa,GAAE,gBAAyC,GACzD,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA8ChC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @module @memberjunction/ai-agents
|
|
17
17
|
* @author MemberJunction.com
|
|
18
18
|
*/
|
|
19
|
-
import { BaseRealtimeModel,
|
|
19
|
+
import { BaseRealtimeModel, MakeAIAPIKeyResolver } from '@memberjunction/ai';
|
|
20
20
|
import { Metadata } from '@memberjunction/core';
|
|
21
21
|
import { MJGlobal, UUIDsEqual } from '@memberjunction/global';
|
|
22
22
|
import { AIEngine } from '@memberjunction/aiengine';
|
|
@@ -158,9 +158,12 @@ export async function FinalizeBridgeCoAgentRuns(agentSessionID, success, context
|
|
|
158
158
|
*
|
|
159
159
|
* @param contextUser The user the engine config runs as (server-side).
|
|
160
160
|
* @param provider The request-scoped metadata provider (multi-provider safe).
|
|
161
|
+
* @param resolveAPIKey Key-resolution seam deciding which vendors count as runnable. Defaults to the
|
|
162
|
+
* platform lookup (`AI_VENDOR_API_KEY__<driver>`); the voice-picker query has no run context and
|
|
163
|
+
* passes none, so today the list always reflects the platform's keys.
|
|
161
164
|
* @returns Active realtime models, each with its driver's voices.
|
|
162
165
|
*/
|
|
163
|
-
export async function GetRealtimeModelVoices(contextUser, provider) {
|
|
166
|
+
export async function GetRealtimeModelVoices(contextUser, provider, resolveAPIKey = MakeAIAPIKeyResolver()) {
|
|
164
167
|
await AIEngine.Instance.Config(false, contextUser, provider);
|
|
165
168
|
const isRealtime = (t) => typeof t === 'string' && t.trim().toLowerCase() === 'realtime';
|
|
166
169
|
const models = AIEngine.Instance.Models
|
|
@@ -168,7 +171,7 @@ export async function GetRealtimeModelVoices(contextUser, provider) {
|
|
|
168
171
|
.sort((a, b) => (b.PowerRank ?? 0) - (a.PowerRank ?? 0));
|
|
169
172
|
const out = [];
|
|
170
173
|
for (const model of models) {
|
|
171
|
-
const selection = SelectRealtimeVendorForModel(model.ID);
|
|
174
|
+
const selection = SelectRealtimeVendorForModel(model.ID, resolveAPIKey);
|
|
172
175
|
const driverClass = selection?.DriverClass ?? null;
|
|
173
176
|
if (!driverClass) {
|
|
174
177
|
continue; // no active vendor with a resolvable key — not runnable, so omit
|
|
@@ -183,7 +186,7 @@ export async function GetRealtimeModelVoices(contextUser, provider) {
|
|
|
183
186
|
const excludedVoiceApiNames = new Set(AIEngine.Instance.GetModelPersonaExclusions(model.ID, 'Audio', selection.VendorID)
|
|
184
187
|
.map((name) => name.toLowerCase()));
|
|
185
188
|
// 2. Union with driver SupportedVoices: append any driver voices not already present or explicitly excluded
|
|
186
|
-
const instance = MJGlobal.Instance.ClassFactory.CreateInstance(BaseRealtimeModel, driverClass,
|
|
189
|
+
const instance = MJGlobal.Instance.ClassFactory.CreateInstance(BaseRealtimeModel, driverClass, resolveAPIKey(driverClass));
|
|
187
190
|
for (const dv of instance?.SupportedVoices ?? []) {
|
|
188
191
|
const dvIdLower = dv.ID.toLowerCase();
|
|
189
192
|
if (excludedVoiceApiNames.has(dvIdLower)) {
|
|
@@ -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,EAAyC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnJ,OAAO,E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E,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,cAAc,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,aAAa,EAAE,OAAO,CAAC;IACvB,sGAAsG;IACtG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,MAAM,MAAM,wBAAwB,GAAG,CACnC,IAAI,EAAE,yBAAyB,EAC/B,WAAW,CAAC,EAAE,QAAQ,EACtB,QAAQ,CAAC,EAAE,iBAAiB,KAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;AAKnB;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,+BAA+B,GAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"bridge-room-transcript-sink.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-room-transcript-sink.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAgC,MAAM,sBAAsB,CAAC;AAIjG,+HAA+H;AAC/H,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,CAAC;AAE7E,2GAA2G;AAC3G,MAAM,WAAW,+BAA+B;IAC5C,+GAA+G;IAC/G,gBAAgB,EAAE,MAAM,CAAC;IACzB,qHAAqH;IACrH,gBAAgB,CAAC,EAAE,4BAA4B,CAAC;IAChD,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,6FAA6F;IAC7F,OAAO,EAAE,MAAM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