@mozaik-ai/core 4.2.0-beta.9 → 4.2.0
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 +21 -21
- package/dist/index.d.mts +524 -349
- package/dist/index.d.ts +524 -349
- package/dist/index.js +1276 -1308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1250 -1305
- package/dist/index.mjs.map +1 -1
- package/package.json +65 -84
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,139 @@
|
|
|
1
|
-
|
|
1
|
+
declare abstract class ContextItem {
|
|
2
|
+
abstract readonly type: string;
|
|
3
|
+
getType(): string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare class FunctionCallItem extends ContextItem {
|
|
7
|
+
readonly type = "function_call";
|
|
8
|
+
readonly callId: string;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly args: string;
|
|
11
|
+
private constructor();
|
|
12
|
+
static rehydrate(data: {
|
|
13
|
+
callId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
args: string;
|
|
16
|
+
}): FunctionCallItem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare abstract class ItemContent {
|
|
20
|
+
abstract readonly type: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare class OutputText extends ItemContent {
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly type = "output_text";
|
|
26
|
+
private constructor();
|
|
27
|
+
static rehydrate(data: {
|
|
28
|
+
text: string;
|
|
29
|
+
}): OutputText;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare class ModelMessageItem extends ContextItem {
|
|
33
|
+
readonly type = "message";
|
|
34
|
+
readonly role = "assistant";
|
|
35
|
+
readonly content: OutputText;
|
|
36
|
+
private constructor();
|
|
37
|
+
static rehydrate(data: {
|
|
38
|
+
text: string;
|
|
39
|
+
}): ModelMessageItem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class InputText extends ItemContent {
|
|
43
|
+
readonly text: string;
|
|
44
|
+
readonly type = "input_text";
|
|
45
|
+
private constructor();
|
|
46
|
+
static create(text: string): InputText;
|
|
47
|
+
static rehydrate(data: {
|
|
48
|
+
text: string;
|
|
49
|
+
}): InputText;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class SummaryText extends ItemContent {
|
|
53
|
+
readonly text: string;
|
|
54
|
+
readonly type = "summary_text";
|
|
55
|
+
private constructor();
|
|
56
|
+
static rehydrate(data: {
|
|
57
|
+
text: string;
|
|
58
|
+
}): SummaryText;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare class ReasoningItem extends ContextItem {
|
|
62
|
+
readonly type = "reasoning";
|
|
63
|
+
readonly content: InputText | undefined;
|
|
64
|
+
readonly encryptedContent: string | undefined;
|
|
65
|
+
readonly summary: SummaryText[];
|
|
66
|
+
private constructor();
|
|
67
|
+
static rehydrate(data: {
|
|
68
|
+
content: InputText | undefined;
|
|
69
|
+
encryptedContent: string | undefined;
|
|
70
|
+
summary: SummaryText[];
|
|
71
|
+
}): ReasoningItem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class ModelContext {
|
|
75
|
+
readonly id: string;
|
|
76
|
+
readonly items: ContextItem[];
|
|
77
|
+
constructor(id: string, items: ContextItem[]);
|
|
78
|
+
getItems(): ContextItem[];
|
|
79
|
+
addContextItems(contextItems: ContextItem[]): ModelContext;
|
|
80
|
+
addContextItem(item: ContextItem): ModelContext;
|
|
81
|
+
static create(): ModelContext;
|
|
82
|
+
static rehydrate(data: {
|
|
83
|
+
id: string;
|
|
84
|
+
items: ContextItem[];
|
|
85
|
+
}): ModelContext;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class UserMessageItem extends ContextItem {
|
|
89
|
+
readonly type = "message";
|
|
90
|
+
readonly role = "user";
|
|
91
|
+
readonly content: InputText;
|
|
92
|
+
private constructor();
|
|
93
|
+
static create(text: string): UserMessageItem;
|
|
94
|
+
static rehydrate(data: {
|
|
95
|
+
text: string;
|
|
96
|
+
}): UserMessageItem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare class DeveloperMessageItem extends ContextItem {
|
|
100
|
+
readonly type = "message";
|
|
101
|
+
readonly role = "developer";
|
|
102
|
+
readonly content: InputText;
|
|
103
|
+
private constructor();
|
|
104
|
+
static create(text: string): DeveloperMessageItem;
|
|
105
|
+
static rehydrate(data: {
|
|
106
|
+
text: string;
|
|
107
|
+
}): DeveloperMessageItem;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class FunctionCallOutputItem extends ContextItem {
|
|
111
|
+
readonly type = "function_call_output";
|
|
112
|
+
readonly callId: string;
|
|
113
|
+
readonly output: InputText;
|
|
114
|
+
private constructor();
|
|
115
|
+
static create(callId: string, output: string): FunctionCallOutputItem;
|
|
116
|
+
static rehydrate(data: {
|
|
117
|
+
callId: string;
|
|
118
|
+
output: InputText;
|
|
119
|
+
}): FunctionCallOutputItem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface FunctionTool {
|
|
123
|
+
type: "function";
|
|
124
|
+
name: string;
|
|
125
|
+
description: string;
|
|
126
|
+
parameters: Record<string, any>;
|
|
127
|
+
strict: boolean;
|
|
128
|
+
invoke: (args: any) => Promise<any>;
|
|
129
|
+
}
|
|
130
|
+
type Tool = FunctionTool;
|
|
131
|
+
|
|
132
|
+
type SituationContext$1<TEvent extends SemanticEvent = SemanticEvent> = {
|
|
2
133
|
readonly event: TEvent;
|
|
3
134
|
readonly participant: Participant;
|
|
4
135
|
};
|
|
5
|
-
declare abstract class SituationSpecification<TEvent extends
|
|
136
|
+
declare abstract class SituationSpecification<TEvent extends SemanticEvent = SemanticEvent> {
|
|
6
137
|
abstract isSatisfiedBy(situationContext: SituationContext$1<TEvent>): boolean;
|
|
7
138
|
and(other: SituationSpecification<TEvent>): SituationSpecification<TEvent>;
|
|
8
139
|
or(other: SituationSpecification<TEvent>): SituationSpecification<TEvent>;
|
|
@@ -13,7 +144,7 @@ interface SituationHandler {
|
|
|
13
144
|
readonly specification: SituationSpecification;
|
|
14
145
|
readonly processor: SituationProcessor;
|
|
15
146
|
}
|
|
16
|
-
type SituationContext<TEvent extends
|
|
147
|
+
type SituationContext<TEvent extends SemanticEvent = SemanticEvent> = {
|
|
17
148
|
readonly event: TEvent;
|
|
18
149
|
readonly participant: Participant;
|
|
19
150
|
};
|
|
@@ -21,139 +152,161 @@ interface SituationProcessor {
|
|
|
21
152
|
apply(context: SituationContext): void | Promise<void>;
|
|
22
153
|
}
|
|
23
154
|
|
|
24
|
-
type ParticipantRole = "agent" | "
|
|
155
|
+
type ParticipantRole = "agent" | "human";
|
|
25
156
|
type ParticipantManifest = {
|
|
26
157
|
readonly id: string;
|
|
27
158
|
readonly name: string;
|
|
28
159
|
readonly role: ParticipantRole;
|
|
29
160
|
readonly capabilities?: readonly string[];
|
|
30
161
|
};
|
|
31
|
-
declare class Participant {
|
|
32
|
-
private manifest;
|
|
162
|
+
declare abstract class Participant {
|
|
163
|
+
private readonly manifest;
|
|
33
164
|
private handlers;
|
|
34
|
-
constructor(manifest: ParticipantManifest, handlers: SituationHandler[]);
|
|
165
|
+
protected constructor(manifest: ParticipantManifest, handlers: SituationHandler[]);
|
|
35
166
|
getManifest(): ParticipantManifest;
|
|
36
|
-
setManifest(manifest: ParticipantManifest): void;
|
|
37
167
|
getId(): string;
|
|
38
168
|
getHandlers(): SituationHandler[];
|
|
39
169
|
setHandlers(handlers: SituationHandler[]): void;
|
|
40
170
|
}
|
|
41
171
|
|
|
42
|
-
declare class
|
|
172
|
+
declare class SemanticEvent<TType extends string = string, TPayload = unknown> {
|
|
43
173
|
readonly type: TType;
|
|
44
174
|
readonly producerId: string;
|
|
45
175
|
readonly occurredAt: Date;
|
|
46
176
|
readonly payload: TPayload;
|
|
47
177
|
constructor(type: TType, producerId: string, occurredAt: Date, payload: TPayload);
|
|
48
|
-
static create<TType extends string = string, TPayload = unknown>(type: TType, producerId: string,
|
|
178
|
+
static create<TType extends string = string, TPayload = unknown>(type: TType, producerId: string, payload: TPayload): SemanticEvent<TType, TPayload>;
|
|
49
179
|
}
|
|
50
180
|
|
|
51
|
-
interface
|
|
181
|
+
interface FunctionCallRunner {
|
|
182
|
+
run(call: FunctionCallItem, tool: Tool): Promise<FunctionCallOutputItem>;
|
|
52
183
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
name: string;
|
|
57
|
-
description: string;
|
|
58
|
-
parameters: Record<string, any>;
|
|
59
|
-
strict: boolean;
|
|
60
|
-
invoke: (args: any) => Promise<any> | any;
|
|
184
|
+
interface FunctionCallParams {
|
|
185
|
+
call: FunctionCallItem;
|
|
186
|
+
inferenceInput: InferenceInput;
|
|
61
187
|
}
|
|
62
|
-
type Tool = FunctionTool;
|
|
63
188
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
participants: Participant[];
|
|
68
|
-
};
|
|
69
|
-
declare class Space {
|
|
70
|
-
private readonly id;
|
|
71
|
-
private name;
|
|
72
|
-
private participants;
|
|
73
|
-
private events;
|
|
74
|
-
constructor(id: string, name: string, participants: Participant[], events?: SpaceEvent[]);
|
|
75
|
-
getId(): string;
|
|
76
|
-
getName(): string;
|
|
77
|
-
addParticipant(participant: Participant): SpaceEvent | undefined;
|
|
78
|
-
getParticipant(id: string): Participant | undefined;
|
|
79
|
-
removeParticipant(participant: Participant): SpaceEvent;
|
|
80
|
-
getParticipants(): Participant[];
|
|
81
|
-
sendMessage(participant: Participant, message: string, occurredAt: Date): SpaceEvent;
|
|
82
|
-
getEvents(): SpaceEvent[];
|
|
83
|
-
static create(name: string, participants?: Participant[]): Space;
|
|
84
|
-
get record(): SpaceRecord;
|
|
85
|
-
static rehydrate({ id, name, participants }: SpaceRecord): Space;
|
|
189
|
+
interface InterceptionHandler {
|
|
190
|
+
isSatisfiedBy(transition: ExecutableTransition): boolean;
|
|
191
|
+
handle(transition: ExecutableTransition): Promise<ExecutableTransition>;
|
|
86
192
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
193
|
+
type InterceptionOutput = {
|
|
194
|
+
type: "continue";
|
|
195
|
+
transition: LoopTransition;
|
|
196
|
+
} | {
|
|
197
|
+
type: "pause";
|
|
198
|
+
pendingTransition: LoopTransition;
|
|
199
|
+
} | {
|
|
200
|
+
type: "stop";
|
|
201
|
+
reason?: string;
|
|
202
|
+
};
|
|
203
|
+
interface InterceptionParams {
|
|
204
|
+
pendingTransition: LoopTransition;
|
|
91
205
|
}
|
|
92
206
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
resolveRuntime: () => RuntimeService<TSharedState>;
|
|
98
|
-
createParticipant: (name: string, capabilities: readonly string[], handlers: SituationHandler[]) => Promise<Participant>;
|
|
99
|
-
createSpace: (name: string) => Promise<Space>;
|
|
100
|
-
join: (spaceId: string, participant: Participant) => Promise<void>;
|
|
101
|
-
leave: (spaceId: string, participantId: string) => Promise<void>;
|
|
102
|
-
sendMessage: (spaceId: string, participantId: string, message: string) => Promise<void>;
|
|
103
|
-
sendMessageTool: FunctionTool;
|
|
207
|
+
type LoopStateId = "message_received" | "inference" | "inference_streaming" | "function_call" | "model_message" | "idle";
|
|
208
|
+
type ReceivedMessage = {
|
|
209
|
+
content: string;
|
|
210
|
+
input: InferenceInput;
|
|
104
211
|
};
|
|
212
|
+
interface FunctionCallExecutionOutput {
|
|
213
|
+
item: FunctionCallOutputItem;
|
|
214
|
+
}
|
|
215
|
+
interface ModelMessageParams {
|
|
216
|
+
answer: ModelMessageItem;
|
|
217
|
+
}
|
|
218
|
+
interface LoopStateContract {
|
|
219
|
+
message_received: {
|
|
220
|
+
input: ReceivedMessage;
|
|
221
|
+
output: InferenceInput;
|
|
222
|
+
};
|
|
223
|
+
inference: {
|
|
224
|
+
input: InferenceInput;
|
|
225
|
+
output: InferenceOutput;
|
|
226
|
+
};
|
|
227
|
+
inference_streaming: {
|
|
228
|
+
input: InferenceInput;
|
|
229
|
+
output: InferenceOutput;
|
|
230
|
+
};
|
|
231
|
+
function_call: {
|
|
232
|
+
input: FunctionCallParams;
|
|
233
|
+
output: FunctionCallExecutionOutput;
|
|
234
|
+
};
|
|
235
|
+
model_message: {
|
|
236
|
+
input: ModelMessageParams;
|
|
237
|
+
output: void;
|
|
238
|
+
};
|
|
239
|
+
interception: {
|
|
240
|
+
input: InterceptionParams;
|
|
241
|
+
output: InterceptionOutput;
|
|
242
|
+
};
|
|
243
|
+
idle: {
|
|
244
|
+
input: undefined;
|
|
245
|
+
output: void;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
type ExecutableLoopStateId = Exclude<LoopStateId, "idle">;
|
|
249
|
+
type ExecutableTransition = LoopTransition<ExecutableLoopStateId>;
|
|
250
|
+
type LoopStateExecution<TStateId extends ExecutableLoopStateId = ExecutableLoopStateId> = {
|
|
251
|
+
[K in TStateId]: {
|
|
252
|
+
stateId: K;
|
|
253
|
+
input: LoopStateContract[K]["input"];
|
|
254
|
+
output: LoopStateContract[K]["output"];
|
|
255
|
+
};
|
|
256
|
+
}[TStateId];
|
|
257
|
+
type LoopTransition<TStateId extends LoopStateId = LoopStateId> = {
|
|
258
|
+
[K in TStateId]: {
|
|
259
|
+
nextStateId: K;
|
|
260
|
+
input: LoopStateContract[K]["input"];
|
|
261
|
+
};
|
|
262
|
+
}[TStateId];
|
|
105
263
|
|
|
106
|
-
|
|
107
|
-
readonly
|
|
108
|
-
|
|
109
|
-
interface InputText extends ItemContent {
|
|
110
|
-
readonly type: "input_text";
|
|
111
|
-
readonly text: string;
|
|
112
|
-
}
|
|
113
|
-
interface SummaryText {
|
|
114
|
-
readonly type: "summary_text";
|
|
115
|
-
readonly text: string;
|
|
116
|
-
}
|
|
117
|
-
interface ReasoningItem {
|
|
118
|
-
readonly type: "reasoning";
|
|
119
|
-
readonly content?: InputText;
|
|
120
|
-
readonly encryptedContent?: string;
|
|
121
|
-
readonly summary: SummaryText[];
|
|
122
|
-
}
|
|
123
|
-
interface MessageItem {
|
|
124
|
-
readonly type: "user_message" | "system_message" | "developer_message" | "model_message";
|
|
125
|
-
readonly text: string;
|
|
126
|
-
}
|
|
127
|
-
interface ModelMessageItem extends MessageItem {
|
|
128
|
-
readonly type: "model_message";
|
|
129
|
-
readonly text: string;
|
|
264
|
+
declare class InputTokenDetails {
|
|
265
|
+
readonly cached_tokens: number;
|
|
266
|
+
constructor(cached_tokens: number);
|
|
130
267
|
}
|
|
131
|
-
|
|
132
|
-
readonly
|
|
133
|
-
|
|
134
|
-
readonly toolName: string;
|
|
135
|
-
readonly toolArguments: string;
|
|
268
|
+
declare class OutputTokenDetails {
|
|
269
|
+
readonly reasoning_tokens: number;
|
|
270
|
+
constructor(reasoning_tokens: number);
|
|
136
271
|
}
|
|
137
|
-
|
|
138
|
-
readonly
|
|
139
|
-
readonly
|
|
140
|
-
readonly
|
|
272
|
+
declare class TokenUsage {
|
|
273
|
+
readonly inputTokens: number;
|
|
274
|
+
readonly outputTokens: number;
|
|
275
|
+
readonly totalTokens: number;
|
|
276
|
+
readonly inputTokenDetails: InputTokenDetails;
|
|
277
|
+
readonly outputTokenDetails: OutputTokenDetails;
|
|
278
|
+
constructor(inputTokens: number, outputTokens: number, totalTokens: number, inputTokenDetails: InputTokenDetails, outputTokenDetails: OutputTokenDetails);
|
|
141
279
|
}
|
|
142
|
-
|
|
143
|
-
type
|
|
144
|
-
|
|
145
|
-
|
|
280
|
+
|
|
281
|
+
type InferenceInput = {
|
|
282
|
+
model: string;
|
|
283
|
+
maxOutputTokens?: number;
|
|
284
|
+
reasoningEffort?: string;
|
|
285
|
+
tools?: Tool[];
|
|
286
|
+
streaming?: boolean;
|
|
287
|
+
structuredOutput?: StructuredOutputFormat;
|
|
288
|
+
context: ModelContext;
|
|
146
289
|
};
|
|
290
|
+
type InferenceItem = FunctionCallItem | ReasoningItem | ModelMessageItem;
|
|
291
|
+
type InferenceOutput = {
|
|
292
|
+
items: InferenceItem[];
|
|
293
|
+
tokenUsage: TokenUsage | undefined;
|
|
294
|
+
rowResponse: any;
|
|
295
|
+
};
|
|
296
|
+
interface InferenceRunner {
|
|
297
|
+
run(request: InferenceInput): Promise<InferenceOutput>;
|
|
298
|
+
stream(request: InferenceInput): AsyncGenerator<SemanticEvent>;
|
|
299
|
+
}
|
|
147
300
|
|
|
148
301
|
interface InferenceEndpointMapper {
|
|
149
|
-
toRequest(
|
|
150
|
-
toResponse(response: any):
|
|
302
|
+
toRequest(inferenceInput: InferenceInput): any;
|
|
303
|
+
toResponse(response: any): InferenceOutput;
|
|
151
304
|
}
|
|
152
305
|
|
|
153
306
|
interface Endpoint {
|
|
154
307
|
endpointMapper: InferenceEndpointMapper;
|
|
155
|
-
infer(requestParams:
|
|
156
|
-
stream(requestParams:
|
|
308
|
+
infer(requestParams: InferenceInput): Promise<InferenceOutput>;
|
|
309
|
+
stream(requestParams: InferenceInput): AsyncIterable<SemanticEvent>;
|
|
157
310
|
}
|
|
158
311
|
|
|
159
312
|
type GenerativeModel = {
|
|
@@ -173,290 +326,312 @@ type ModelSpecification = {
|
|
|
173
326
|
supportsStructuredOutput: boolean;
|
|
174
327
|
};
|
|
175
328
|
|
|
329
|
+
interface RequestValidationRule {
|
|
330
|
+
readonly name: string;
|
|
331
|
+
isValid(inferenceInput: InferenceInput, model: ModelSpecification): boolean;
|
|
332
|
+
}
|
|
333
|
+
|
|
176
334
|
type StructuredOutputFormat = {
|
|
177
335
|
name?: string;
|
|
178
336
|
schema: Record<string, any>;
|
|
179
337
|
strict?: boolean;
|
|
180
338
|
};
|
|
181
339
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
340
|
+
interface ModelContextRepository {
|
|
341
|
+
save(context: ModelContext): Promise<void>;
|
|
342
|
+
get(id: string): Promise<ModelContext>;
|
|
343
|
+
getByProjectId(projectId: string): Promise<ModelContext[]>;
|
|
185
344
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
345
|
+
|
|
346
|
+
interface McpServerConfig {
|
|
347
|
+
/** The MCP server URL, e.g. https://api.githubcopilot.com/mcp/ */
|
|
348
|
+
url: string;
|
|
349
|
+
/** Bearer token sent as `Authorization: Bearer <token>` (e.g. a GitHub token). */
|
|
350
|
+
authToken?: string;
|
|
351
|
+
/** Extra headers merged into every request (overridden by `authToken` for Authorization). */
|
|
352
|
+
headers?: Record<string, string>;
|
|
353
|
+
/** Client name reported to the server (defaults to "mozaik"). */
|
|
354
|
+
name?: string;
|
|
189
355
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
356
|
+
interface McpToolSpec {
|
|
357
|
+
name: string;
|
|
358
|
+
description: string;
|
|
359
|
+
/** JSON Schema for the tool's arguments (maps 1:1 to FunctionTool.parameters). */
|
|
360
|
+
inputSchema: Record<string, any>;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* A thin wrapper over the MCP TypeScript SDK using the Streamable HTTP transport — what
|
|
364
|
+
* remote MCP servers (e.g. GitHub's `api.githubcopilot.com/mcp/`) speak. One client per
|
|
365
|
+
* server; lazily connects on first use. Infrastructure-only: the domain never sees this.
|
|
366
|
+
*/
|
|
367
|
+
declare class McpClient {
|
|
368
|
+
private readonly config;
|
|
369
|
+
private readonly client;
|
|
370
|
+
private readonly transport;
|
|
371
|
+
private connected;
|
|
372
|
+
constructor(config: McpServerConfig);
|
|
373
|
+
connect(): Promise<void>;
|
|
374
|
+
/** The tools this server exposes. */
|
|
375
|
+
listTools(): Promise<McpToolSpec[]>;
|
|
376
|
+
/** Call a tool by name; returns its text output. Throws if the server flags an error. */
|
|
377
|
+
callTool(name: string, args: Record<string, any>): Promise<string>;
|
|
378
|
+
close(): Promise<void>;
|
|
197
379
|
}
|
|
198
380
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
381
|
+
/** The slice of an MCP client the registry needs — lets tests inject a fake. */
|
|
382
|
+
interface McpClientLike {
|
|
383
|
+
listTools(): Promise<Array<{
|
|
384
|
+
name: string;
|
|
385
|
+
description: string;
|
|
386
|
+
inputSchema: Record<string, any>;
|
|
387
|
+
}>>;
|
|
388
|
+
callTool(name: string, args: Record<string, any>): Promise<string>;
|
|
389
|
+
close(): Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Connects to one or more MCP servers and exposes their tools as mozaik `FunctionTool`s.
|
|
393
|
+
* Each tool's `invoke()` proxies the call back to its MCP server. Because they are plain
|
|
394
|
+
* FunctionTools, every provider mapper and the existing function-call loop handle them
|
|
395
|
+
* with no changes — MCP support adds no new tool type and touches no provider code.
|
|
396
|
+
*
|
|
397
|
+
* `strict` is false: MCP servers publish arbitrary JSON Schemas that won't always satisfy
|
|
398
|
+
* a provider's strict function-calling mode.
|
|
399
|
+
*/
|
|
400
|
+
declare class McpToolRegistry {
|
|
401
|
+
private readonly servers;
|
|
402
|
+
private readonly createClient;
|
|
403
|
+
private readonly clients;
|
|
404
|
+
constructor(servers: McpServerConfig[], createClient?: (config: McpServerConfig) => McpClientLike);
|
|
405
|
+
/** Discover every tool across the configured servers, as FunctionTools ready to pass to a model. */
|
|
406
|
+
discoverTools(): Promise<FunctionTool[]>;
|
|
407
|
+
/** Close all underlying MCP connections. */
|
|
408
|
+
close(): Promise<void>;
|
|
216
409
|
}
|
|
217
410
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
411
|
+
declare class SystemMessageItem extends ContextItem {
|
|
412
|
+
readonly type = "message";
|
|
413
|
+
readonly role = "system";
|
|
414
|
+
readonly content: InputText;
|
|
415
|
+
private constructor();
|
|
416
|
+
static create(text: string): SystemMessageItem;
|
|
417
|
+
static rehydrate(data: {
|
|
418
|
+
text: string;
|
|
419
|
+
}): SystemMessageItem;
|
|
221
420
|
}
|
|
222
421
|
|
|
223
|
-
|
|
224
|
-
|
|
422
|
+
declare class Memory {
|
|
423
|
+
private readonly context;
|
|
424
|
+
private constructor();
|
|
425
|
+
getContext(): ModelContext;
|
|
426
|
+
static create(): Memory;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare class Agent extends Participant {
|
|
430
|
+
private memory;
|
|
431
|
+
private developerMessage;
|
|
432
|
+
private tools;
|
|
433
|
+
constructor(manifest: ParticipantManifest, developerMessage: string, tools: Tool[], memory: Memory, handlers: SituationHandler[]);
|
|
434
|
+
static create({ name, instruction, tools, capabilities, handlers, }: {
|
|
435
|
+
instruction: string;
|
|
436
|
+
tools: Tool[];
|
|
437
|
+
name: string;
|
|
438
|
+
capabilities: readonly string[];
|
|
439
|
+
handlers: SituationHandler[];
|
|
440
|
+
}): Agent;
|
|
441
|
+
getTools(): Tool[];
|
|
442
|
+
getDeveloperMessage(): string;
|
|
443
|
+
getMemory(): Memory;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
declare function createAgent({ name, capabilities, instruction, tools, handlers, }: {
|
|
225
447
|
name: string;
|
|
448
|
+
capabilities: readonly string[];
|
|
226
449
|
instruction: string;
|
|
227
450
|
tools: Tool[];
|
|
228
|
-
|
|
229
|
-
};
|
|
451
|
+
handlers: SituationHandler[];
|
|
452
|
+
}): Agent;
|
|
230
453
|
|
|
231
|
-
declare class
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
private _instruction;
|
|
235
|
-
private _memory;
|
|
236
|
-
private _tools;
|
|
237
|
-
constructor(id: string, name: string, instruction: string, tools: Tool[], memory: Memory);
|
|
238
|
-
get id(): string;
|
|
239
|
-
get name(): string;
|
|
240
|
-
get instruction(): string;
|
|
241
|
-
get tools(): Tool[];
|
|
242
|
-
get memory(): Memory;
|
|
243
|
-
static create({ name, instruction, tools, memory, }: {
|
|
454
|
+
declare class Human extends Participant {
|
|
455
|
+
constructor(manifest: ParticipantManifest, handlers: SituationHandler[]);
|
|
456
|
+
static create({ name, capabilities, handlers, }: {
|
|
244
457
|
name: string;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}): Agent;
|
|
249
|
-
static rehydrate(record: AgentRecord): Agent;
|
|
458
|
+
capabilities: readonly string[];
|
|
459
|
+
handlers: SituationHandler[];
|
|
460
|
+
}): Human;
|
|
250
461
|
}
|
|
251
462
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
463
|
+
declare function createHuman({ name, capabilities, handlers, }: {
|
|
464
|
+
name: string;
|
|
465
|
+
capabilities: readonly string[];
|
|
466
|
+
handlers: SituationHandler[];
|
|
467
|
+
}): Human;
|
|
468
|
+
|
|
469
|
+
declare abstract class RuntimeState {
|
|
470
|
+
participants: Map<string, Participant>;
|
|
471
|
+
addParticipant(participant: Participant): void;
|
|
472
|
+
removeParticipant(participant: Participant): void;
|
|
473
|
+
getParticipant(id: string): Participant | undefined;
|
|
474
|
+
getParticipants(): readonly Participant[];
|
|
257
475
|
}
|
|
258
476
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
477
|
+
declare class EventProcessor {
|
|
478
|
+
process(event: SemanticEvent, consumer: Participant): void;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare class RuntimeService<TRuntimeState extends RuntimeState> {
|
|
482
|
+
readonly state: TRuntimeState;
|
|
483
|
+
private readonly processor;
|
|
484
|
+
private readonly inferenceRunner;
|
|
485
|
+
private readonly functionCallRunner;
|
|
486
|
+
constructor(state: TRuntimeState, processor: EventProcessor, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner);
|
|
487
|
+
join(participant: Participant): void;
|
|
488
|
+
leave(participant: Participant): void;
|
|
489
|
+
publish(event: SemanticEvent): void;
|
|
490
|
+
getParticipant(id: string): Participant | undefined;
|
|
491
|
+
getInferenceRunner(): InferenceRunner;
|
|
492
|
+
getFunctionCallRunner(): FunctionCallRunner;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
type InferenceRunnerConfig = {
|
|
496
|
+
supportedModels?: GenerativeModel[];
|
|
497
|
+
runner?: InferenceRunner;
|
|
279
498
|
};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
499
|
+
declare function defineRuntime<TRuntimeState extends RuntimeState>(): {
|
|
500
|
+
initializeRuntime: (config: {
|
|
501
|
+
state: TRuntimeState;
|
|
502
|
+
inferenceRunnerConfig?: InferenceRunnerConfig;
|
|
503
|
+
}) => RuntimeService<TRuntimeState>;
|
|
504
|
+
resolveRuntime: () => RuntimeService<TRuntimeState>;
|
|
505
|
+
resolveParticipant: (id: string) => Participant;
|
|
506
|
+
join: (participant: Participant) => void;
|
|
507
|
+
leave: (participant: Participant) => void;
|
|
508
|
+
sendMessage: (message: string, senderId: string) => void;
|
|
509
|
+
sendEvent: (event: SemanticEvent, senderId: string) => void;
|
|
510
|
+
runLoop: (agentId: string, message: string, inferenceInput: InferenceInput, interceptionHandler?: InterceptionHandler) => void;
|
|
285
511
|
};
|
|
286
|
-
type PendingOperation = PendingInference | PendingToolExecution;
|
|
287
512
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
513
|
+
declare const supportedModels: GenerativeModel[];
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Optional connection config. When omitted, the `openai` SDK reads
|
|
517
|
+
* `OPENAI_API_KEY` and `OPENAI_BASE_URL` from the environment.
|
|
518
|
+
*/
|
|
519
|
+
interface OpenAIResponsesConfig {
|
|
520
|
+
baseURL?: string;
|
|
521
|
+
apiKey?: string;
|
|
522
|
+
}
|
|
523
|
+
declare class OpenAIResponses implements Endpoint {
|
|
524
|
+
endpointMapper: InferenceEndpointMapper;
|
|
525
|
+
private _client?;
|
|
526
|
+
private readonly clientConfig;
|
|
527
|
+
constructor(endpointMapper?: InferenceEndpointMapper, config?: OpenAIResponsesConfig);
|
|
528
|
+
private get client();
|
|
529
|
+
infer(inferenceInput: InferenceInput): Promise<InferenceOutput>;
|
|
530
|
+
stream(inferenceInput: InferenceInput): AsyncIterable<SemanticEvent>;
|
|
294
531
|
}
|
|
295
532
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
533
|
+
/**
|
|
534
|
+
* Optional connection config. When omitted, the `openai` SDK reads
|
|
535
|
+
* `OPENAI_API_KEY` and `OPENAI_BASE_URL` from the environment, so the
|
|
536
|
+
* default-constructed runtime targets whatever `OPENAI_BASE_URL` points
|
|
537
|
+
* at (real OpenAI when unset). Provider presets (e.g. DeepSeek) pass an
|
|
538
|
+
* explicit base URL + credential.
|
|
539
|
+
*/
|
|
540
|
+
interface OpenAICompatibleConfig {
|
|
541
|
+
baseURL?: string;
|
|
542
|
+
apiKey?: string;
|
|
543
|
+
/**
|
|
544
|
+
* Extra request-body fields merged into every `chat.completions`
|
|
545
|
+
* call. This is how provider-specific quirks are handled **without
|
|
546
|
+
* a per-provider subclass in mozaik** — the consumer supplies the
|
|
547
|
+
* vendor-only fields (e.g. DeepSeek's `{ thinking: { type } }`,
|
|
548
|
+
* safety flags, routing hints). Standard fields the runtime already
|
|
549
|
+
* sets (`model`, `messages`, `tools`, `reasoning_effort`) take
|
|
550
|
+
* precedence and are not overwritten.
|
|
551
|
+
*/
|
|
552
|
+
extraBody?: Record<string, unknown>;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Generic adapter for any **OpenAI Chat Completions**-compatible
|
|
556
|
+
* endpoint — real OpenAI, DeepSeek, Xiaomi MiMo, OpenRouter, vLLM,
|
|
557
|
+
* Ollama, etc. It speaks `/chat/completions` (not the Responses API),
|
|
558
|
+
* which is the dialect third-party OpenAI-compatible providers expose.
|
|
559
|
+
*
|
|
560
|
+
* The base URL and credential are configurable; everything else (the
|
|
561
|
+
* `ModelContext` ⇄ chat-message conversion, tool-call round-trip, token
|
|
562
|
+
* usage extraction) is provider-agnostic. Provider-specific request
|
|
563
|
+
* shaping (e.g. DeepSeek's `thinking` field) is supplied by the
|
|
564
|
+
* consumer via {@link OpenAICompatibleConfig.extraBody} — mozaik stays
|
|
565
|
+
* generic and gains no per-provider subclasses.
|
|
566
|
+
*
|
|
567
|
+
* Was `DeepSeekChatCompletions`; generalized so consumers can point it
|
|
568
|
+
* at any OpenAI-compatible endpoint.
|
|
569
|
+
*/
|
|
570
|
+
declare class OpenAIChatCompletions implements Endpoint {
|
|
571
|
+
endpointMapper: InferenceEndpointMapper;
|
|
572
|
+
private _client?;
|
|
573
|
+
private readonly clientConfig;
|
|
574
|
+
private readonly extraBody;
|
|
575
|
+
constructor(endpointMapper?: InferenceEndpointMapper, config?: OpenAICompatibleConfig);
|
|
576
|
+
private get client();
|
|
577
|
+
private buildRequest;
|
|
578
|
+
infer(inferenceInput: InferenceInput): Promise<InferenceOutput>;
|
|
579
|
+
stream(inferenceInput: InferenceInput): AsyncIterable<SemanticEvent>;
|
|
305
580
|
}
|
|
306
581
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
582
|
+
interface AnthropicConnectionConfig {
|
|
583
|
+
baseURL?: string;
|
|
584
|
+
apiKey?: string;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Native Anthropic adapter on the `@anthropic-ai/sdk` (`messages.create`).
|
|
588
|
+
* Maps domain context to Anthropic's `messages`/`content` blocks shape,
|
|
589
|
+
* system prompt, tools, adaptive thinking, and structured output config.
|
|
590
|
+
*/
|
|
591
|
+
declare class AnthropicMessages implements Endpoint {
|
|
592
|
+
endpointMapper: InferenceEndpointMapper;
|
|
593
|
+
private _client?;
|
|
594
|
+
private readonly clientConfig;
|
|
595
|
+
constructor(endpointMapper?: InferenceEndpointMapper, config?: AnthropicConnectionConfig);
|
|
596
|
+
private get client();
|
|
597
|
+
infer(inferenceInput: InferenceInput): Promise<InferenceOutput>;
|
|
598
|
+
stream(inferenceInput: InferenceInput): AsyncIterable<SemanticEvent>;
|
|
599
|
+
}
|
|
324
600
|
|
|
325
|
-
|
|
326
|
-
|
|
601
|
+
interface GeminiConnectionConfig {
|
|
602
|
+
baseURL?: string;
|
|
603
|
+
apiKey?: string;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Native Gemini adapter on the `@google/genai` SDK (`generateContent` /
|
|
607
|
+
* `generateContentStream`). Unlike an OpenAI-compat shim this maps our
|
|
608
|
+
* domain context to Gemini's native `contents`/`parts` shape, system
|
|
609
|
+
* instruction, `functionDeclarations`, and `thinkingConfig`, and reads
|
|
610
|
+
* thought parts + native usage metadata back out. Another `ModelRuntime`
|
|
611
|
+
* — no runner or port changes.
|
|
612
|
+
*/
|
|
613
|
+
declare class GeminiGenerateContent implements Endpoint {
|
|
614
|
+
endpointMapper: InferenceEndpointMapper;
|
|
615
|
+
private _client?;
|
|
616
|
+
private readonly clientConfig;
|
|
617
|
+
constructor(endpointMapper?: InferenceEndpointMapper, config?: GeminiConnectionConfig);
|
|
618
|
+
private get client();
|
|
619
|
+
infer(inferenceInput: InferenceInput): Promise<InferenceOutput>;
|
|
620
|
+
stream(inferenceInput: InferenceInput): AsyncIterable<SemanticEvent>;
|
|
327
621
|
}
|
|
328
622
|
|
|
329
|
-
|
|
330
|
-
readonly
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
};
|
|
334
|
-
type LoopRuleRecord = {
|
|
335
|
-
readonly id: string;
|
|
336
|
-
readonly priority: number;
|
|
337
|
-
readonly condition: LoopSpecification;
|
|
338
|
-
readonly action: LoopAction;
|
|
339
|
-
};
|
|
340
|
-
declare class LoopRule {
|
|
341
|
-
_id: string;
|
|
342
|
-
_priority: number;
|
|
343
|
-
_condition: LoopSpecification;
|
|
344
|
-
_action: LoopAction;
|
|
345
|
-
constructor(id: string, condition: LoopSpecification, action: LoopAction, priority: number);
|
|
346
|
-
get id(): string;
|
|
347
|
-
get priority(): number;
|
|
348
|
-
get condition(): LoopSpecification;
|
|
349
|
-
get action(): LoopAction;
|
|
350
|
-
static create(spec: CreateLoopRuleParams): LoopRule;
|
|
351
|
-
static rehydrate(spec: LoopRuleRecord): LoopRule;
|
|
352
|
-
}
|
|
353
|
-
type RuleBookRecord = {
|
|
354
|
-
readonly rules: LoopRuleRecord[];
|
|
355
|
-
};
|
|
356
|
-
declare class RuleBook {
|
|
357
|
-
private rules;
|
|
358
|
-
private constructor();
|
|
359
|
-
addRule(rule: LoopRule): void;
|
|
360
|
-
removeRule(rule: LoopRule): void;
|
|
361
|
-
getRules(): readonly LoopRule[];
|
|
362
|
-
static create(loopRuleParams: CreateLoopRuleParams[]): RuleBook;
|
|
363
|
-
static rehydrate(record: RuleBookRecord): RuleBook;
|
|
364
|
-
record(): RuleBookRecord;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
interface LoopRecord {
|
|
368
|
-
id: string;
|
|
369
|
-
agentId: string;
|
|
370
|
-
subject: string;
|
|
371
|
-
createdAt: Date;
|
|
372
|
-
state: LoopStateId;
|
|
373
|
-
inferenceRequest?: InferenceRequest;
|
|
374
|
-
pendingOperation?: PendingOperation;
|
|
375
|
-
transitionHistory: LoopTransition[];
|
|
376
|
-
operationHistory: CompletedOperation[];
|
|
377
|
-
ruleBook: RuleBookRecord;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
type LoopStateId = "idle" | "awaiting_inference_request" | "awaiting_inference" | "awaiting_tool_output" | "stopped" | "completed";
|
|
381
|
-
type CreateLoopParams = {
|
|
382
|
-
subject: string;
|
|
383
|
-
agentId: string;
|
|
384
|
-
rules: CreateLoopRuleParams[];
|
|
385
|
-
} | {
|
|
386
|
-
subject: string;
|
|
387
|
-
agentId: string;
|
|
388
|
-
request: InferenceRequest;
|
|
389
|
-
};
|
|
390
|
-
declare class Loop {
|
|
391
|
-
private readonly loopId;
|
|
392
|
-
private readonly agentId;
|
|
393
|
-
private readonly subject;
|
|
394
|
-
private readonly createdAt;
|
|
395
|
-
private state;
|
|
396
|
-
private pendingOperation;
|
|
397
|
-
private readonly transitionHistory;
|
|
398
|
-
private inferenceRequest;
|
|
399
|
-
private readonly operationHistory;
|
|
400
|
-
private readonly _ruleBook;
|
|
401
|
-
private constructor();
|
|
402
|
-
get id(): string;
|
|
403
|
-
get stateId(): LoopStateId;
|
|
404
|
-
get pending(): PendingOperation | undefined;
|
|
405
|
-
get history(): readonly LoopTransition[];
|
|
406
|
-
get completedOperations(): readonly CompletedOperation[];
|
|
407
|
-
get request(): InferenceRequest | undefined;
|
|
408
|
-
get ruleBook(): RuleBook;
|
|
409
|
-
getSubject(): string;
|
|
410
|
-
getAgentId(): string;
|
|
411
|
-
record(): LoopRecord;
|
|
412
|
-
moveToIdle(reason: string, transitionId: string): void;
|
|
413
|
-
moveToAwaitingInference(operation: PendingInference): void;
|
|
414
|
-
moveToAwaitingToolOutput(operation: Extract<PendingOperation, {
|
|
415
|
-
type: "tool_execution";
|
|
416
|
-
}>, occurredAt: Date): void;
|
|
417
|
-
requestInference(request: InferenceRequest): PendingInference;
|
|
418
|
-
requestToolUse(operationId: string, call: ToolUseRequest, requestedAt: Date): PendingToolExecution;
|
|
419
|
-
private transitionTo;
|
|
420
|
-
private assertIdle;
|
|
421
|
-
private assertAwaitingInferenceRequest;
|
|
422
|
-
receiveInferenceResult(operationId: string, result: InferenceResult): void;
|
|
423
|
-
receiveToolUseResult(operationId: string, result: ToolUseResult): void;
|
|
424
|
-
complete(reason: string): void;
|
|
425
|
-
stop(reason: string): void;
|
|
426
|
-
wait(reason: string): void;
|
|
427
|
-
private assertNotSettled;
|
|
428
|
-
static create(agentId: string, subject: string, ruleBook: RuleBook): Loop;
|
|
429
|
-
static rehydrate(record: LoopRecord): Loop;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
interface LoopRepository {
|
|
433
|
-
save(loop: Loop): Promise<void>;
|
|
434
|
-
findById(id: string): Promise<Loop | undefined>;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
interface ToolUseRunner {
|
|
438
|
-
run(request: ToolUseRequest, tool: Tool): Promise<ToolUseResult>;
|
|
623
|
+
declare class InferenceInputValidator {
|
|
624
|
+
private readonly rules;
|
|
625
|
+
constructor(rules?: RequestValidationRule[]);
|
|
626
|
+
validate(inferenceInput: InferenceInput, model: ModelSpecification): void;
|
|
439
627
|
}
|
|
440
628
|
|
|
441
|
-
|
|
442
|
-
supportedModels
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
inferenceRunnerConfig?: InferenceRunnerConfig;
|
|
449
|
-
toolRunner?: ToolUseRunner;
|
|
450
|
-
};
|
|
451
|
-
declare function defineAgentModule(config: AgentModuleConfig): {
|
|
452
|
-
createAgent: (config: {
|
|
453
|
-
name: string;
|
|
454
|
-
instruction: string;
|
|
455
|
-
tools: Tool[];
|
|
456
|
-
handlers: SituationHandler[];
|
|
457
|
-
}) => Promise<Agent>;
|
|
458
|
-
createLoop: (params: CreateLoopParams) => Promise<Loop>;
|
|
459
|
-
runLoop: (loopId: string) => Promise<Loop>;
|
|
460
|
-
};
|
|
629
|
+
declare class DefaultInferenceRunner implements InferenceRunner {
|
|
630
|
+
private readonly supportedModels;
|
|
631
|
+
private readonly requestValidator;
|
|
632
|
+
constructor(supportedModels: GenerativeModel[], requestValidator: InferenceInputValidator);
|
|
633
|
+
run(input: InferenceInput): Promise<InferenceOutput>;
|
|
634
|
+
stream(input: InferenceInput): AsyncGenerator<SemanticEvent>;
|
|
635
|
+
}
|
|
461
636
|
|
|
462
|
-
export { Agent, type
|
|
637
|
+
export { Agent, AnthropicMessages, ContextItem, DefaultInferenceRunner, DeveloperMessageItem, type Endpoint, type ExecutableLoopStateId, type ExecutableTransition, FunctionCallItem, FunctionCallOutputItem, GeminiGenerateContent, Human, type InferenceInput, type InferenceOutput, type InferenceRunner, type InferenceRunnerConfig, InputTokenDetails, type InterceptionHandler, type LoopStateExecution, type LoopTransition, McpClient, type McpServerConfig, McpToolRegistry, type McpToolSpec, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIChatCompletions, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, RuntimeState, SemanticEvent, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, type StructuredOutputFormat, SystemMessageItem, TokenUsage, type Tool, UserMessageItem, createAgent, createHuman, defineRuntime, supportedModels };
|