@fifthrevision/axle 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,289 +1,294 @@
1
- import * as z from 'zod';
2
- import { ZodObject, z as z$1 } from 'zod';
1
+ import * as z$2 from "zod";
2
+ import { ZodObject, z } from "zod";
3
3
 
4
+ //#region src/types.d.ts
4
5
  interface Stats {
5
- in: number;
6
- out: number;
6
+ in: number;
7
+ out: number;
7
8
  }
8
-
9
+ //#endregion
10
+ //#region src/messages/stream.d.ts
9
11
  interface StreamChunk {
10
- type: "start" | "text-start" | "text-delta" | "text-complete" | "tool-call-start" | "tool-call-complete" | "thinking-start" | "thinking-delta" | "thinking-summary-delta" | "thinking-complete" | "internal-tool-start" | "internal-tool-complete" | "complete" | "error";
11
- id?: string;
12
- data?: any;
12
+ type: "start" | "text-start" | "text-delta" | "text-complete" | "tool-call-start" | "tool-call-complete" | "thinking-start" | "thinking-delta" | "thinking-summary-delta" | "thinking-complete" | "internal-tool-start" | "internal-tool-complete" | "complete" | "error";
13
+ id?: string;
14
+ data?: any;
13
15
  }
14
16
  interface StreamStartChunk extends StreamChunk {
15
- type: "start";
16
- id: string;
17
- data: {
18
- model: string;
19
- timestamp: number;
20
- };
17
+ type: "start";
18
+ id: string;
19
+ data: {
20
+ model: string;
21
+ timestamp: number;
22
+ };
21
23
  }
22
24
  interface StreamCompleteChunk extends StreamChunk {
23
- type: "complete";
24
- data: {
25
- finishReason: AxleStopReason;
26
- usage: Stats;
27
- };
25
+ type: "complete";
26
+ data: {
27
+ finishReason: AxleStopReason;
28
+ usage: Stats;
29
+ };
28
30
  }
29
31
  interface StreamErrorChunk extends StreamChunk {
30
- type: "error";
31
- data: {
32
- type: string;
33
- message: string;
34
- usage?: Stats;
35
- raw?: any;
36
- };
32
+ type: "error";
33
+ data: {
34
+ type: string;
35
+ message: string;
36
+ usage?: Stats;
37
+ raw?: any;
38
+ };
37
39
  }
38
40
  interface StreamTextStartChunk extends StreamChunk {
39
- type: "text-start";
40
- data: {
41
- index: number;
42
- };
41
+ type: "text-start";
42
+ data: {
43
+ index: number;
44
+ };
43
45
  }
44
46
  interface StreamTextDeltaChunk extends StreamChunk {
45
- type: "text-delta";
46
- data: {
47
- index: number;
48
- text: string;
49
- };
47
+ type: "text-delta";
48
+ data: {
49
+ index: number;
50
+ text: string;
51
+ };
50
52
  }
51
53
  interface StreamTextCompleteChunk extends StreamChunk {
52
- type: "text-complete";
53
- data: {
54
- index: number;
55
- };
54
+ type: "text-complete";
55
+ data: {
56
+ index: number;
57
+ };
56
58
  }
57
59
  interface StreamThinkingStartChunk extends StreamChunk {
58
- type: "thinking-start";
59
- data: {
60
- index: number;
61
- id?: string;
62
- redacted?: boolean;
63
- signature?: string;
64
- };
60
+ type: "thinking-start";
61
+ data: {
62
+ index: number;
63
+ id?: string;
64
+ redacted?: boolean;
65
+ signature?: string;
66
+ };
65
67
  }
66
68
  interface StreamThinkingDeltaChunk extends StreamChunk {
67
- type: "thinking-delta";
68
- data: {
69
- index: number;
70
- text: string;
71
- };
69
+ type: "thinking-delta";
70
+ data: {
71
+ index: number;
72
+ text: string;
73
+ };
72
74
  }
73
75
  interface StreamThinkingSummaryDeltaChunk extends StreamChunk {
74
- type: "thinking-summary-delta";
75
- data: {
76
- index: number;
77
- text: string;
78
- };
76
+ type: "thinking-summary-delta";
77
+ data: {
78
+ index: number;
79
+ text: string;
80
+ };
79
81
  }
80
82
  interface StreamThinkingCompleteChunk extends StreamChunk {
81
- type: "thinking-complete";
82
- data: {
83
- index: number;
84
- };
83
+ type: "thinking-complete";
84
+ data: {
85
+ index: number;
86
+ };
85
87
  }
86
88
  interface StreamToolCallStartChunk extends StreamChunk {
87
- type: "tool-call-start";
88
- data: {
89
- index: number;
90
- id: string;
91
- name: string;
92
- };
89
+ type: "tool-call-start";
90
+ data: {
91
+ index: number;
92
+ id: string;
93
+ name: string;
94
+ };
93
95
  }
94
96
  interface StreamToolCallCompleteChunk extends StreamChunk {
95
- type: "tool-call-complete";
96
- data: {
97
- index: number;
98
- id: string;
99
- name: string;
100
- arguments: any;
101
- providerMetadata?: Record<string, unknown>;
102
- };
97
+ type: "tool-call-complete";
98
+ data: {
99
+ index: number;
100
+ id: string;
101
+ name: string;
102
+ arguments: any;
103
+ providerMetadata?: Record<string, unknown>;
104
+ };
103
105
  }
104
106
  interface StreamInternalToolStartChunk extends StreamChunk {
105
- type: "internal-tool-start";
106
- data: {
107
- index: number;
108
- id: string;
109
- name: string;
110
- };
107
+ type: "internal-tool-start";
108
+ data: {
109
+ index: number;
110
+ id: string;
111
+ name: string;
112
+ };
111
113
  }
112
114
  interface StreamInternalToolCompleteChunk extends StreamChunk {
113
- type: "internal-tool-complete";
114
- data: {
115
- index: number;
116
- id: string;
117
- name: string;
118
- output?: unknown;
119
- };
115
+ type: "internal-tool-complete";
116
+ data: {
117
+ index: number;
118
+ id: string;
119
+ name: string;
120
+ output?: unknown;
121
+ };
120
122
  }
121
123
  type AnyStreamChunk = StreamStartChunk | StreamCompleteChunk | StreamErrorChunk | StreamTextStartChunk | StreamTextDeltaChunk | StreamTextCompleteChunk | StreamThinkingStartChunk | StreamThinkingDeltaChunk | StreamThinkingSummaryDeltaChunk | StreamThinkingCompleteChunk | StreamToolCallStartChunk | StreamToolCallCompleteChunk | StreamInternalToolStartChunk | StreamInternalToolCompleteChunk;
122
-
124
+ //#endregion
125
+ //#region src/tracer/types.d.ts
123
126
  type SpanStatus = "ok" | "error";
124
127
  type EventLevel = "debug" | "info" | "warn" | "error";
125
128
  type SpanType = string;
126
129
  interface SpanEvent {
127
- name: string;
128
- timestamp: number;
129
- level: EventLevel;
130
- attributes?: Record<string, unknown>;
130
+ name: string;
131
+ timestamp: number;
132
+ level: EventLevel;
133
+ attributes?: Record<string, unknown>;
131
134
  }
132
135
  interface SpanData {
133
- traceId: string;
134
- spanId: string;
135
- parentSpanId?: string;
136
- name: string;
137
- type?: SpanType;
138
- startTime: number;
139
- endTime?: number;
140
- status: SpanStatus;
141
- attributes: Record<string, unknown>;
142
- events: SpanEvent[];
143
- result?: SpanResult;
136
+ traceId: string;
137
+ spanId: string;
138
+ parentSpanId?: string;
139
+ name: string;
140
+ type?: SpanType;
141
+ startTime: number;
142
+ endTime?: number;
143
+ status: SpanStatus;
144
+ attributes: Record<string, unknown>;
145
+ events: SpanEvent[];
146
+ result?: SpanResult;
144
147
  }
145
148
  interface SpanOptions {
146
- type?: SpanType;
149
+ type?: SpanType;
147
150
  }
148
151
  type SpanResult = LLMResult | ToolResult;
149
152
  interface LLMResult {
150
- kind: "llm";
151
- model: string;
152
- request: LLMRequest;
153
- response: LLMResponse;
154
- usage?: TokenUsage;
155
- finishReason?: string;
153
+ kind: "llm";
154
+ model: string;
155
+ request: LLMRequest;
156
+ response: LLMResponse;
157
+ usage?: TokenUsage;
158
+ finishReason?: string;
156
159
  }
157
160
  interface LLMRequest {
158
- messages: unknown[];
159
- system?: string;
160
- tools?: unknown[];
161
+ messages: unknown[];
162
+ system?: string;
163
+ tools?: unknown[];
161
164
  }
162
165
  interface LLMResponse {
163
- content: unknown;
166
+ content: unknown;
164
167
  }
165
168
  interface TokenUsage {
166
- inputTokens?: number;
167
- outputTokens?: number;
168
- totalTokens?: number;
169
+ inputTokens?: number;
170
+ outputTokens?: number;
171
+ totalTokens?: number;
169
172
  }
170
173
  interface ToolResult {
171
- kind: "tool";
172
- name: string;
173
- input: unknown;
174
- output: unknown;
174
+ kind: "tool";
175
+ name: string;
176
+ input: unknown;
177
+ output: unknown;
175
178
  }
176
179
  interface TraceWriter {
177
- onSpanStart(span: SpanData): void;
178
- onSpanUpdate?(span: SpanData): void;
179
- onSpanEnd(span: SpanData): void;
180
- onEvent?(span: SpanData, event: SpanEvent): void;
181
- flush?(): Promise<void>;
180
+ onSpanStart(span: SpanData): void;
181
+ onSpanUpdate?(span: SpanData): void;
182
+ onSpanEnd(span: SpanData): void;
183
+ onEvent?(span: SpanData, event: SpanEvent): void;
184
+ flush?(): Promise<void>;
182
185
  }
183
186
  /**
184
187
  * Tracing context for a span. Created by Tracer.startSpan().
185
188
  * Can create child spans and log events within the span's scope.
186
189
  */
187
190
  interface TracingContext {
188
- startSpan(name: string, options?: SpanOptions): TracingContext;
189
- end(status?: SpanStatus): void;
190
- debug(message: string, attributes?: Record<string, unknown>): void;
191
- info(message: string, attributes?: Record<string, unknown>): void;
192
- warn(message: string, attributes?: Record<string, unknown>): void;
193
- error(message: string, attributes?: Record<string, unknown>): void;
194
- setAttribute(key: string, value: unknown): void;
195
- setAttributes(attributes: Record<string, unknown>): void;
196
- setResult(result: SpanResult): void;
197
- }
198
-
191
+ startSpan(name: string, options?: SpanOptions): TracingContext;
192
+ end(status?: SpanStatus): void;
193
+ debug(message: string, attributes?: Record<string, unknown>): void;
194
+ info(message: string, attributes?: Record<string, unknown>): void;
195
+ warn(message: string, attributes?: Record<string, unknown>): void;
196
+ error(message: string, attributes?: Record<string, unknown>): void;
197
+ setAttribute(key: string, value: unknown): void;
198
+ setAttributes(attributes: Record<string, unknown>): void;
199
+ setResult(result: SpanResult): void;
200
+ }
201
+ //#endregion
202
+ //#region src/providers/types.d.ts
199
203
  interface AIProvider {
200
- get name(): string;
201
- /** @internal */
202
- createGenerationRequest(model: string, params: {
203
- messages: Array<AxleMessage>;
204
- system?: string;
205
- tools?: Array<ToolDefinition>;
206
- context: {
207
- tracer?: TracingContext;
208
- };
209
- options?: {
210
- temperature?: number;
211
- top_p?: number;
212
- max_tokens?: number;
213
- frequency_penalty?: number;
214
- presence_penalty?: number;
215
- stop?: string | string[];
216
- [key: string]: any;
217
- };
218
- }): Promise<ModelResult>;
219
- /** @internal */
220
- createStreamingRequest?(model: string, params: {
221
- messages: Array<AxleMessage>;
222
- system?: string;
223
- tools?: Array<ToolDefinition>;
224
- context: {
225
- tracer?: TracingContext;
226
- };
227
- signal?: AbortSignal;
228
- options?: {
229
- temperature?: number;
230
- top_p?: number;
231
- max_tokens?: number;
232
- frequency_penalty?: number;
233
- presence_penalty?: number;
234
- stop?: string | string[];
235
- [key: string]: any;
236
- };
237
- }): AsyncGenerator<AnyStreamChunk, void, unknown>;
204
+ get name(): string;
205
+ /** @internal */
206
+ createGenerationRequest(model: string, params: {
207
+ messages: Array<AxleMessage>;
208
+ system?: string;
209
+ tools?: Array<ToolDefinition>;
210
+ context: {
211
+ tracer?: TracingContext;
212
+ };
213
+ options?: {
214
+ temperature?: number;
215
+ top_p?: number;
216
+ max_tokens?: number;
217
+ frequency_penalty?: number;
218
+ presence_penalty?: number;
219
+ stop?: string | string[];
220
+ [key: string]: any;
221
+ };
222
+ }): Promise<ModelResult>;
223
+ /** @internal */
224
+ createStreamingRequest?(model: string, params: {
225
+ messages: Array<AxleMessage>;
226
+ system?: string;
227
+ tools?: Array<ToolDefinition>;
228
+ context: {
229
+ tracer?: TracingContext;
230
+ };
231
+ signal?: AbortSignal;
232
+ options?: {
233
+ temperature?: number;
234
+ top_p?: number;
235
+ max_tokens?: number;
236
+ frequency_penalty?: number;
237
+ presence_penalty?: number;
238
+ stop?: string | string[];
239
+ [key: string]: any;
240
+ };
241
+ }): AsyncGenerator<AnyStreamChunk, void, unknown>;
238
242
  }
239
243
  interface ModelResponse {
240
- type: "success";
241
- role: "assistant";
242
- id: string;
243
- model: string;
244
- text: string;
245
- content: Array<ContentPartText | ContentPartThinking | ContentPartToolCall>;
246
- finishReason: AxleStopReason;
247
- usage: Stats;
248
- raw: any;
244
+ type: "success";
245
+ role: "assistant";
246
+ id: string;
247
+ model: string;
248
+ text: string;
249
+ content: Array<ContentPartText | ContentPartThinking | ContentPartToolCall>;
250
+ finishReason: AxleStopReason;
251
+ usage: Stats;
252
+ raw: any;
249
253
  }
250
254
  interface ModelError {
251
- type: "error";
252
- error: {
253
- type: string;
254
- message: string;
255
- };
256
- usage?: Stats;
257
- raw?: any;
255
+ type: "error";
256
+ error: {
257
+ type: string;
258
+ message: string;
259
+ };
260
+ usage?: Stats;
261
+ raw?: any;
258
262
  }
259
263
  type ModelResult = ModelResponse | ModelError;
260
264
  declare enum AxleStopReason {
261
- Stop = "stop",
262
- Length = "length",
263
- FunctionCall = "function_call",
264
- Error = "error",
265
- Custom = "custom",
266
- Cancelled = "cancelled"
267
- }
268
-
265
+ Stop = "stop",
266
+ Length = "length",
267
+ FunctionCall = "function_call",
268
+ Error = "error",
269
+ Custom = "custom",
270
+ Cancelled = "cancelled"
271
+ }
272
+ //#endregion
273
+ //#region src/utils/file.d.ts
269
274
  interface FileInfo {
270
- path: string;
271
- base64?: string;
272
- content?: string;
273
- mimeType: string;
274
- size: number;
275
- name: string;
276
- type: "image" | "document" | "text";
275
+ path: string;
276
+ base64?: string;
277
+ content?: string;
278
+ mimeType: string;
279
+ size: number;
280
+ name: string;
281
+ type: "image" | "document" | "text";
277
282
  }
278
283
  type TextFileInfo = FileInfo & {
279
- content: string;
280
- base64?: never;
281
- type: "text";
284
+ content: string;
285
+ base64?: never;
286
+ type: "text";
282
287
  };
283
288
  type Base64FileInfo = FileInfo & {
284
- base64: string;
285
- content?: never;
286
- type: "image" | "document";
289
+ base64: string;
290
+ content?: never;
291
+ type: "image" | "document";
287
292
  };
288
293
  /**
289
294
  * Load a file with the specified encoding or auto-detect based on file extension
@@ -294,660 +299,875 @@ type Base64FileInfo = FileInfo & {
294
299
  declare function loadFileContent(filePath: string): Promise<FileInfo>;
295
300
  declare function loadFileContent(filePath: string, encoding: "utf-8"): Promise<TextFileInfo>;
296
301
  declare function loadFileContent(filePath: string, encoding: "base64"): Promise<Base64FileInfo>;
297
-
302
+ //#endregion
303
+ //#region src/messages/message.d.ts
298
304
  type AxleMessage = AxleUserMessage | AxleAssistantMessage | AxleToolCallMessage;
299
305
  interface AxleUserMessage {
300
- role: "user";
301
- name?: string;
302
- content: string | Array<ContentPart>;
306
+ role: "user";
307
+ id?: string;
308
+ name?: string;
309
+ content: string | Array<ContentPart>;
303
310
  }
304
311
  interface AxleAssistantMessage {
305
- role: "assistant";
306
- id: string;
307
- model?: string;
308
- content: Array<ContentPartText | ContentPartThinking | ContentPartToolCall | ContentPartInternalTool>;
309
- finishReason?: AxleStopReason;
312
+ role: "assistant";
313
+ id: string;
314
+ model?: string;
315
+ content: Array<ContentPartText | ContentPartThinking | ContentPartToolCall | ContentPartInternalTool>;
316
+ finishReason?: AxleStopReason;
310
317
  }
311
318
  interface AxleToolCallMessage {
312
- role: "tool";
313
- content: Array<AxleToolCallResult>;
319
+ role: "tool";
320
+ id: string;
321
+ content: Array<AxleToolCallResult>;
314
322
  }
315
323
  type ToolResultPart = {
316
- type: "text";
317
- text: string;
324
+ type: "text";
325
+ text: string;
318
326
  } | {
319
- type: "image";
320
- data: string;
321
- mimeType: string;
327
+ type: "image";
328
+ data: string;
329
+ mimeType: string;
322
330
  };
323
331
  interface AxleToolCallResult {
324
- id: string;
325
- name: string;
326
- content: string | ToolResultPart[];
327
- isError?: boolean;
332
+ id: string;
333
+ name: string;
334
+ content: string | ToolResultPart[];
335
+ isError?: boolean;
328
336
  }
329
337
  type ContentPart = ContentPartText | ContentPartFile | ContentPartToolCall | ContentPartThinking | ContentPartInternalTool;
330
338
  interface ContentPartText {
331
- type: "text";
332
- text: string;
339
+ type: "text";
340
+ text: string;
333
341
  }
334
342
  interface ContentPartFile {
335
- type: "file";
336
- file: FileInfo;
343
+ type: "file";
344
+ file: FileInfo;
337
345
  }
338
346
  interface ContentPartThinking {
339
- type: "thinking";
340
- id?: string;
341
- text: string;
342
- summary?: string;
343
- redacted?: boolean;
344
- encrypted?: string;
345
- signature?: string;
347
+ type: "thinking";
348
+ id?: string;
349
+ text: string;
350
+ summary?: string;
351
+ redacted?: boolean;
352
+ encrypted?: string;
353
+ signature?: string;
346
354
  }
347
355
  interface ContentPartToolCall {
348
- type: "tool-call";
349
- id: string;
350
- name: string;
351
- parameters: Record<string, unknown>;
352
- providerMetadata?: Record<string, unknown>;
356
+ type: "tool-call";
357
+ id: string;
358
+ name: string;
359
+ parameters: Record<string, unknown>;
360
+ providerMetadata?: Record<string, unknown>;
353
361
  }
354
362
  interface ContentPartInternalTool {
355
- type: "internal-tool";
356
- id: string;
357
- name: string;
358
- input?: unknown;
359
- output?: unknown;
360
- }
361
-
363
+ type: "internal-tool";
364
+ id: string;
365
+ name: string;
366
+ input?: unknown;
367
+ output?: unknown;
368
+ }
369
+ //#endregion
370
+ //#region src/tools/types.d.ts
362
371
  interface ExecutableTool<TSchema extends ZodObject<any> = ZodObject<any>> {
363
- type?: "function";
364
- name: string;
365
- description: string;
366
- schema: TSchema;
367
- execute(input: z$1.infer<TSchema>): Promise<string | ToolResultPart[]>;
368
- configure?(config: Record<string, any>): void;
369
- summarize?(input: z$1.infer<TSchema>): string;
372
+ type?: "function";
373
+ name: string;
374
+ description: string;
375
+ schema: TSchema;
376
+ execute(input: z.infer<TSchema>): Promise<string | ToolResultPart[]>;
377
+ configure?(config: Record<string, any>): void;
378
+ summarize?(input: z.infer<TSchema>): string;
370
379
  }
371
380
  interface ServerTool {
372
- type: "server";
373
- name: string;
374
- config?: Record<string, unknown>;
381
+ type: "server";
382
+ name: string;
383
+ config?: Record<string, unknown>;
375
384
  }
376
385
  type AxleTool = ExecutableTool | ServerTool;
377
386
  type ToolDefinition = Pick<ExecutableTool, "name" | "description" | "schema">;
378
-
387
+ //#endregion
388
+ //#region src/mcp/MCP.d.ts
379
389
  interface MCPStdioConfig {
380
- transport: "stdio";
381
- name?: string;
382
- command: string;
383
- args?: string[];
384
- env?: Record<string, string>;
390
+ transport: "stdio";
391
+ name?: string;
392
+ command: string;
393
+ args?: string[];
394
+ env?: Record<string, string>;
385
395
  }
386
396
  interface MCPHttpConfig {
387
- transport: "http";
388
- name?: string;
389
- url: string;
390
- headers?: Record<string, string>;
397
+ transport: "http";
398
+ name?: string;
399
+ url: string;
400
+ headers?: Record<string, string>;
391
401
  }
392
402
  type MCPConfig = MCPStdioConfig | MCPHttpConfig;
393
403
  declare class MCP {
394
- private config;
395
- private client;
396
- private transport;
397
- private cachedMcpTools;
398
- private _connected;
399
- constructor(config: MCPConfig);
400
- get name(): string | undefined;
401
- get connected(): boolean;
402
- connect(options?: {
403
- tracer?: TracingContext;
404
- }): Promise<void>;
405
- listTools(options?: {
406
- prefix?: string;
407
- tracer?: TracingContext;
408
- }): Promise<ExecutableTool[]>;
409
- listToolDefinitions(options?: {
410
- prefix?: string;
411
- tracer?: TracingContext;
412
- }): Promise<ToolDefinition[]>;
413
- refreshTools(): Promise<ExecutableTool[]>;
414
- close(options?: {
415
- tracer?: TracingContext;
416
- }): Promise<void>;
417
- private fetchTools;
418
- private assertConnected;
404
+ private config;
405
+ private client;
406
+ private transport;
407
+ private cachedMcpTools;
408
+ private _connected;
409
+ constructor(config: MCPConfig);
410
+ get name(): string | undefined;
411
+ get connected(): boolean;
412
+ connect(options?: {
413
+ tracer?: TracingContext;
414
+ }): Promise<void>;
415
+ listTools(options?: {
416
+ prefix?: string;
417
+ tracer?: TracingContext;
418
+ }): Promise<ExecutableTool[]>;
419
+ listToolDefinitions(options?: {
420
+ prefix?: string;
421
+ tracer?: TracingContext;
422
+ }): Promise<ToolDefinition[]>;
423
+ refreshTools(): Promise<ExecutableTool[]>;
424
+ close(options?: {
425
+ tracer?: TracingContext;
426
+ }): Promise<void>;
427
+ private fetchTools;
428
+ private assertConnected;
419
429
  }
420
-
430
+ //#endregion
431
+ //#region src/store/types.d.ts
421
432
  interface FileStore {
422
- read(path: string): Promise<string | null>;
423
- write(path: string, content: string): Promise<void>;
433
+ read(path: string): Promise<string | null>;
434
+ write(path: string, content: string): Promise<void>;
424
435
  }
425
-
436
+ //#endregion
437
+ //#region src/memory/types.d.ts
426
438
  interface MemoryContext {
427
- name?: string;
428
- scope?: Record<string, string>;
429
- system?: string;
430
- messages: AxleMessage[];
431
- newMessages?: AxleMessage[];
432
- store: FileStore;
433
- tracer?: TracingContext;
439
+ name?: string;
440
+ scope?: Record<string, string>;
441
+ system?: string;
442
+ messages: AxleMessage[];
443
+ newMessages?: AxleMessage[];
444
+ store: FileStore;
445
+ tracer?: TracingContext;
434
446
  }
435
447
  interface RecallResult {
436
- systemSuffix?: string;
448
+ systemSuffix?: string;
437
449
  }
438
450
  interface AgentMemory {
439
- recall(context: MemoryContext): Promise<RecallResult>;
440
- record(context: MemoryContext): Promise<void>;
441
- tools?(): ExecutableTool[];
442
- }
443
-
444
- declare class History {
445
- system: string;
446
- private _messages;
447
- constructor(messages?: AxleMessage[]);
448
- get messages(): AxleMessage[];
449
- addSystem(message: string): void;
450
- addUser(message: string): void;
451
- addUser(parts: AxleUserMessage["content"]): void;
452
- addAssistant(message: string): void;
453
- addAssistant(params: Omit<AxleAssistantMessage, "role">): void;
454
- addToolResults(input: Array<AxleToolCallResult>): void;
455
- add(messages: AxleMessage | AxleMessage[]): void;
456
- latest(): AxleMessage | undefined;
457
- toString(): string;
451
+ recall(context: MemoryContext): Promise<RecallResult>;
452
+ record(context: MemoryContext): Promise<void>;
453
+ tools?(): ExecutableTool[];
454
+ }
455
+ //#endregion
456
+ //#region src/turns/types.d.ts
457
+ type TurnStatus = "streaming" | "complete" | "cancelled" | "error";
458
+ interface Turn {
459
+ id: string;
460
+ owner: "user" | "agent";
461
+ parts: TurnPart[];
462
+ status: TurnStatus;
463
+ usage?: Stats;
464
+ }
465
+ type TurnPart = TextPart | FilePart | ThinkingPart | ActionPart;
466
+ interface TextPart {
467
+ id: string;
468
+ type: "text";
469
+ text: string;
470
+ }
471
+ interface FilePart {
472
+ id: string;
473
+ type: "file";
474
+ file: FileInfo;
475
+ }
476
+ interface ThinkingPart {
477
+ id: string;
478
+ type: "thinking";
479
+ text: string;
480
+ summary?: string;
481
+ redacted?: boolean;
482
+ }
483
+ interface ActionPartBase {
484
+ id: string;
485
+ type: "action";
486
+ kind: string;
487
+ status: "pending" | "running" | "complete" | "cancelled" | "error";
488
+ }
489
+ interface ToolAction extends ActionPartBase {
490
+ kind: "tool";
491
+ detail: {
492
+ name: string;
493
+ parameters: Record<string, unknown>;
494
+ result?: ActionResult;
495
+ };
458
496
  }
459
-
460
- interface GenerateTurnOptions {
461
- temperature?: number;
462
- top_p?: number;
463
- max_tokens?: number;
464
- frequency_penalty?: number;
465
- presence_penalty?: number;
466
- stop?: string | string[];
467
- [key: string]: any;
497
+ interface SubagentAction extends ActionPartBase {
498
+ kind: "agent";
499
+ detail: {
500
+ name: string;
501
+ config?: Record<string, unknown>;
502
+ children: Turn[];
503
+ result?: ActionResult;
504
+ };
468
505
  }
469
- interface GenerateTurnProps {
470
- provider: AIProvider;
471
- model: string;
472
- messages: Array<AxleMessage>;
473
- system?: string;
474
- tools?: Array<ToolDefinition>;
475
- tracer?: TracingContext;
476
- options?: GenerateTurnOptions;
506
+ interface InternalToolAction extends ActionPartBase {
507
+ kind: "internal-tool";
508
+ detail: {
509
+ name: string;
510
+ input?: unknown;
511
+ result?: ActionResult;
512
+ };
477
513
  }
478
- declare function generateTurn(props: GenerateTurnProps): Promise<ModelResult>;
479
-
480
- type ToolCallResult = {
481
- type: "success";
482
- content: string | ToolResultPart[];
483
- } | {
484
- type: "error";
485
- error: {
486
- type: string;
487
- message: string;
488
- fatal?: boolean;
489
- retryable?: boolean;
490
- };
491
- };
492
- type ToolCallCallback = (name: string, parameters: Record<string, unknown>) => Promise<ToolCallResult | null | undefined>;
493
- type GenerateError = {
494
- type: "model";
495
- error: ModelError;
514
+ type ActionPart = ToolAction | SubagentAction | InternalToolAction;
515
+ type ActionResult = {
516
+ type: "success";
517
+ content: unknown;
496
518
  } | {
497
- type: "tool";
498
- error: {
499
- name: string;
500
- message: string;
501
- };
519
+ type: "error";
520
+ error: {
521
+ type: string;
522
+ message: string;
523
+ };
502
524
  };
503
- type GenerateResult = {
504
- result: "success";
505
- messages: AxleMessage[];
506
- final?: AxleAssistantMessage;
507
- usage?: Stats;
525
+ //#endregion
526
+ //#region src/turns/events.d.ts
527
+ type AgentEvent = {
528
+ type: "session:restore";
529
+ turns: Turn[];
530
+ config?: Record<string, unknown>;
508
531
  } | {
509
- result: "error";
510
- messages: AxleMessage[];
511
- error: GenerateError;
512
- usage?: Stats;
513
- };
514
- type StreamResult = GenerateResult | {
515
- result: "cancelled";
516
- messages: AxleMessage[];
517
- partial?: AxleAssistantMessage;
518
- usage: Stats;
519
- };
520
-
521
- type StreamEvent = {
522
- type: "text:start";
523
- index: number;
532
+ type: "turn:user";
533
+ turn: Turn;
524
534
  } | {
525
- type: "text:delta";
526
- index: number;
527
- delta: string;
528
- accumulated: string;
535
+ type: "turn:start";
536
+ turnId: string;
529
537
  } | {
530
- type: "text:end";
531
- index: number;
532
- final: string;
538
+ type: "turn:end";
539
+ turnId: string;
540
+ status: TurnStatus;
541
+ usage: Stats;
533
542
  } | {
534
- type: "thinking:start";
535
- index: number;
543
+ type: "part:start";
544
+ turnId: string;
545
+ part: TurnPart;
536
546
  } | {
537
- type: "thinking:delta";
538
- index: number;
539
- delta: string;
540
- accumulated: string;
547
+ type: "text:delta";
548
+ turnId: string;
549
+ partId: string;
550
+ delta: string;
541
551
  } | {
542
- type: "thinking:end";
543
- index: number;
544
- final: string;
552
+ type: "thinking:delta";
553
+ turnId: string;
554
+ partId: string;
555
+ delta: string;
545
556
  } | {
546
- type: "tool:start";
547
- index: number;
548
- id: string;
549
- name: string;
557
+ type: "part:end";
558
+ turnId: string;
559
+ partId: string;
550
560
  } | {
551
- type: "tool:execute";
552
- index: number;
553
- id: string;
554
- name: string;
555
- parameters: Record<string, unknown>;
561
+ type: "action:running";
562
+ turnId: string;
563
+ partId: string;
564
+ parameters?: Record<string, unknown>;
556
565
  } | {
557
- type: "tool:complete";
558
- index: number;
559
- id: string;
560
- name: string;
561
- result: ToolCallResult | null;
566
+ type: "action:complete";
567
+ turnId: string;
568
+ partId: string;
569
+ result: ActionResult;
562
570
  } | {
563
- type: "internal-tool:start";
564
- index: number;
565
- id: string;
566
- name: string;
571
+ type: "action:error";
572
+ turnId: string;
573
+ partId: string;
574
+ error: {
575
+ type: string;
576
+ message: string;
577
+ };
567
578
  } | {
568
- type: "internal-tool:complete";
569
- index: number;
570
- id: string;
571
- name: string;
572
- output?: unknown;
579
+ type: "action:child-event";
580
+ turnId: string;
581
+ partId: string;
582
+ event: AgentEvent;
573
583
  } | {
574
- type: "error";
575
- error: GenerateError;
584
+ type: "error";
585
+ error: {
586
+ type: string;
587
+ message: string;
588
+ };
576
589
  };
577
- type StreamEventCallback = (event: StreamEvent) => void;
578
- interface StreamOptions {
579
- provider: AIProvider;
580
- model: string;
581
- messages: Array<AxleMessage>;
582
- system?: string;
583
- tools?: Array<ToolDefinition>;
584
- serverTools?: Array<ServerTool>;
585
- onToolCall?: ToolCallCallback;
586
- maxIterations?: number;
587
- tracer?: TracingContext;
588
- options?: GenerateTurnOptions;
589
- }
590
- interface StreamHandle {
591
- on(callback: StreamEventCallback): void;
592
- cancel(): void;
593
- readonly final: Promise<StreamResult>;
590
+ //#endregion
591
+ //#region src/utils/utils.d.ts
592
+ interface Handle<T> {
593
+ cancel(): void;
594
+ readonly final: Promise<T>;
594
595
  }
595
- declare function stream(options: StreamOptions): StreamHandle;
596
-
597
- type OutputSchema = Record<string, z.ZodTypeAny>;
598
- type ParsedSchema<T extends OutputSchema> = {
599
- [K in keyof T]: z.output<T[K]>;
596
+ /**
597
+ * Creates a cancellable, queued async handle.
598
+ * Waits for `queue` before running `work`, merges an optional external signal
599
+ * with an internal abort controller, and returns the handle + settled promise
600
+ * for queue chaining.
601
+ */
602
+ declare function createHandle<T>(queue: Promise<void>, work: (signal: AbortSignal) => Promise<T>, externalSignal?: AbortSignal): {
603
+ handle: Handle<T>;
604
+ settled: Promise<void>;
600
605
  };
606
+ //#endregion
607
+ //#region src/core/history.d.ts
608
+ declare class History {
609
+ private _turns;
610
+ private _log;
611
+ constructor(init?: {
612
+ turns?: Turn[];
613
+ log?: AxleMessage[];
614
+ });
615
+ get turns(): Turn[];
616
+ get log(): AxleMessage[];
617
+ addTurn(turn: Turn): void;
618
+ appendToLog(messages: AxleMessage | AxleMessage[]): void;
619
+ latestTurn(): Turn | undefined;
620
+ toString(): string;
621
+ }
622
+ //#endregion
623
+ //#region src/core/parse.d.ts
624
+ type OutputSchema = Record<string, z$2.ZodTypeAny>;
625
+ type ParsedSchema<T extends OutputSchema> = { [K in keyof T]: z$2.output<T[K]> };
601
626
  declare function parseResponse<T extends OutputSchema>(rawValue: string, schema?: T): ParsedSchema<T> | string;
602
-
627
+ //#endregion
628
+ //#region src/core/Instruct.d.ts
603
629
  declare class Instruct<TSchema extends OutputSchema | undefined = undefined> {
604
- prompt: string;
605
- inputs: Record<string, string>;
606
- files: Base64FileInfo[];
607
- textReferences: Array<{
608
- content: string;
609
- name?: string;
610
- }>;
611
- instructions: string[];
612
- schema: TSchema;
613
- constructor(prompt: string, schema?: TSchema);
614
- setInputs(inputs: Record<string, string>): void;
615
- addInput(name: string, value: string): void;
616
- addFile(file: FileInfo | string, options?: {
617
- name?: string;
618
- }): void;
619
- addInstructions(instruction: string): void;
620
- hasFiles(): boolean;
630
+ prompt: string;
631
+ inputs: Record<string, string>;
632
+ files: Base64FileInfo[];
633
+ textReferences: Array<{
634
+ content: string;
635
+ name?: string;
636
+ }>;
637
+ instructions: string[];
638
+ schema: TSchema;
639
+ constructor(prompt: string, schema?: TSchema);
640
+ setInputs(inputs: Record<string, string>): void;
641
+ addInput(name: string, value: string): void;
642
+ addFile(file: FileInfo | string, options?: {
643
+ name?: string;
644
+ }): void;
645
+ addInstructions(instruction: string): void;
646
+ hasFiles(): boolean;
621
647
  }
622
-
648
+ //#endregion
649
+ //#region src/core/Agent.d.ts
623
650
  interface AgentOptions {
624
- strictVariables?: boolean;
651
+ strictVariables?: boolean;
625
652
  }
626
653
  interface AgentConfig {
627
- provider: AIProvider;
628
- model: string;
629
- system?: string;
630
- name?: string;
631
- scope?: Record<string, string>;
632
- tools?: AxleTool[];
633
- mcps?: MCP[];
634
- memory?: AgentMemory;
635
- tracer?: TracingContext;
636
- options?: AgentOptions;
654
+ provider: AIProvider;
655
+ model: string;
656
+ system?: string;
657
+ name?: string;
658
+ scope?: Record<string, string>;
659
+ tools?: AxleTool[];
660
+ mcps?: MCP[];
661
+ memory?: AgentMemory;
662
+ tracer?: TracingContext;
663
+ options?: AgentOptions;
637
664
  }
638
665
  interface AgentResult<T = string> {
639
- response: T | null;
640
- messages: AxleMessage[];
641
- final: AxleAssistantMessage | undefined;
642
- usage: Stats;
666
+ response: T | null;
667
+ turn: Turn | undefined;
668
+ usage: Stats;
643
669
  }
644
- interface AgentHandle<T = string> {
645
- cancel(): void;
646
- readonly final: Promise<AgentResult<T>>;
670
+ type AgentHandle<T = string> = Handle<AgentResult<T>>;
671
+ type AgentEventCallback = (event: AgentEvent) => void;
672
+ interface SendMessageOptions {
673
+ signal?: AbortSignal;
647
674
  }
648
- declare class Agent {
649
- readonly provider: AIProvider;
650
- readonly model: string;
651
- readonly history: History;
652
- readonly tracer?: TracingContext;
653
- readonly name?: string;
654
- readonly scope?: Record<string, string>;
655
- readonly store: FileStore;
656
- system: string | undefined;
657
- tools: Record<string, ExecutableTool>;
658
- serverTools: ServerTool[];
659
- private mcps;
660
- private mcpToolsResolved;
661
- private memory?;
662
- private options;
663
- private eventCallbacks;
664
- constructor(config: AgentConfig);
665
- addTool(tool: AxleTool): void;
666
- addTools(tools: AxleTool[]): void;
667
- addMcp(mcp: MCP): void;
668
- addMcps(mcps: MCP[]): void;
669
- hasTools(): boolean;
670
- on(callback: StreamEventCallback): void;
671
- send(message: string): AgentHandle<string>;
672
- send(instruct: Instruct<undefined>, variables?: Record<string, string>): AgentHandle<string>;
673
- send<TSchema extends OutputSchema>(instruct: Instruct<TSchema>, variables?: Record<string, string>): AgentHandle<ParsedSchema<TSchema>>;
674
- private resolveMcpTools;
675
- private execute;
675
+ interface SendInstructOptions extends SendMessageOptions {
676
+ variables?: Record<string, string>;
676
677
  }
677
-
678
+ declare class Agent {
679
+ readonly provider: AIProvider;
680
+ readonly model: string;
681
+ readonly history: History;
682
+ readonly tracer?: TracingContext;
683
+ readonly name?: string;
684
+ readonly scope?: Record<string, string>;
685
+ readonly store: FileStore;
686
+ system: string | undefined;
687
+ tools: Record<string, ExecutableTool>;
688
+ serverTools: ServerTool[];
689
+ private mcps;
690
+ private mcpToolsResolved;
691
+ private memory?;
692
+ private options;
693
+ private eventCallbacks;
694
+ private sendQueue;
695
+ constructor(config: AgentConfig);
696
+ addTool(tool: AxleTool): void;
697
+ addTools(tools: AxleTool[]): void;
698
+ addMcp(mcp: MCP): void;
699
+ addMcps(mcps: MCP[]): void;
700
+ hasTools(): boolean;
701
+ on(callback: AgentEventCallback): void;
702
+ send(message: string, options?: SendMessageOptions): AgentHandle<string>;
703
+ send(instruct: Instruct<undefined>, options?: SendInstructOptions): AgentHandle<string>;
704
+ send<TSchema extends OutputSchema>(instruct: Instruct<TSchema>, options?: SendInstructOptions): AgentHandle<ParsedSchema<TSchema>>;
705
+ private resolveMcpTools;
706
+ private emitEvent;
707
+ private run;
708
+ }
709
+ //#endregion
710
+ //#region src/core/compile.d.ts
678
711
  interface CompileOptions {
679
- strictVariables?: boolean;
712
+ strictVariables?: boolean;
680
713
  }
681
714
  declare function compileInstruct(instruct: Instruct<any>, variables?: Record<string, string>, options?: CompileOptions): string;
682
-
715
+ //#endregion
716
+ //#region src/providers/anthropic/provider.d.ts
683
717
  declare function anthropic(apiKey: string): AIProvider;
684
-
718
+ //#endregion
719
+ //#region src/providers/anthropic/index.d.ts
685
720
  declare const Anthropic: {
686
- readonly Models: {
687
- readonly CLAUDE_SONNET_4_6: "claude-sonnet-4-6";
688
- readonly CLAUDE_OPUS_4_6: "claude-opus-4-6";
689
- readonly CLAUDE_OPUS_4_5_20251101: "claude-opus-4-5-20251101";
690
- readonly CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101";
691
- readonly CLAUDE_HAIKU_4_5_20251001: "claude-haiku-4-5-20251001";
692
- readonly CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001";
693
- readonly CLAUDE_SONNET_4_5_20250929: "claude-sonnet-4-5-20250929";
694
- readonly CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929";
695
- readonly CLAUDE_OPUS_4_1_20250805: "claude-opus-4-1-20250805";
696
- readonly CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805";
697
- readonly CLAUDE_OPUS_4_20250514: "claude-opus-4-20250514";
698
- readonly CLAUDE_OPUS_4: "claude-opus-4-20250514";
699
- readonly CLAUDE_SONNET_4_20250514: "claude-sonnet-4-20250514";
700
- readonly CLAUDE_SONNET_4: "claude-sonnet-4-20250514";
701
- readonly CLAUDE_3_HAIKU_20240307: "claude-3-haiku-20240307";
702
- readonly CLAUDE_3_HAIKU: "claude-3-haiku-20240307";
703
- };
704
- readonly DefaultModel: "claude-haiku-4-5-20251001";
721
+ readonly Models: {
722
+ readonly CLAUDE_SONNET_4_6: "claude-sonnet-4-6";
723
+ readonly CLAUDE_OPUS_4_6: "claude-opus-4-6";
724
+ readonly CLAUDE_OPUS_4_5_20251101: "claude-opus-4-5-20251101";
725
+ readonly CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101";
726
+ readonly CLAUDE_SONNET_4_5_20250929: "claude-sonnet-4-5-20250929";
727
+ readonly CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929";
728
+ readonly CLAUDE_HAIKU_4_5_20251001: "claude-haiku-4-5-20251001";
729
+ readonly CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001";
730
+ readonly CLAUDE_OPUS_4_1_20250805: "claude-opus-4-1-20250805";
731
+ readonly CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805";
732
+ readonly CLAUDE_OPUS_4_20250514: "claude-opus-4-20250514";
733
+ readonly CLAUDE_OPUS_4: "claude-opus-4-20250514";
734
+ readonly CLAUDE_SONNET_4_20250514: "claude-sonnet-4-20250514";
735
+ readonly CLAUDE_SONNET_4: "claude-sonnet-4-20250514";
736
+ readonly CLAUDE_3_HAIKU_20240307: "claude-3-haiku-20240307";
737
+ readonly CLAUDE_3_HAIKU: "claude-3-haiku-20240307";
738
+ };
739
+ readonly DefaultModel: "claude-haiku-4-5-20251001";
705
740
  };
706
-
741
+ //#endregion
742
+ //#region src/providers/chatcompletions/provider.d.ts
707
743
  declare function chatCompletions(baseUrl: string, apiKey?: string): AIProvider;
708
-
744
+ //#endregion
745
+ //#region src/providers/gemini/provider.d.ts
709
746
  declare function gemini(apiKey: string): AIProvider;
710
-
747
+ //#endregion
748
+ //#region src/providers/gemini/index.d.ts
711
749
  declare const Gemini: {
712
- readonly Models: {
713
- readonly GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview";
714
- readonly GEMINI_3_1_PRO_PREVIEW_CUSTOMTOOLS: "gemini-3.1-pro-preview-customtools";
715
- readonly GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview";
716
- readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
717
- readonly GEMINI_2_5_PRO: "gemini-2.5-pro";
718
- readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
719
- readonly GEMINI_2_5_FLASH_LITE: "gemini-2.5-flash-lite";
720
- readonly GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025: "gemini-2.5-flash-lite-preview-09-2025";
721
- readonly GEMINI_2_0_FLASH: "gemini-2.0-flash";
722
- readonly GEMINI_2_0_FLASH_001: "gemini-2.0-flash-001";
723
- readonly GEMINI_2_0_FLASH_LITE: "gemini-2.0-flash-lite";
724
- readonly GEMINI_2_0_FLASH_LITE_001: "gemini-2.0-flash-lite-001";
725
- readonly GEMINI_FLASH_LATEST: "gemini-flash-latest";
726
- readonly GEMINI_FLASH_LITE_LATEST: "gemini-flash-lite-latest";
727
- readonly GEMINI_PRO_LATEST: "gemini-pro-latest";
728
- readonly GEMMA_3_27B_IT: "gemma-3-27b-it";
729
- readonly GEMMA_3_12B_IT: "gemma-3-12b-it";
730
- readonly GEMMA_3_4B_IT: "gemma-3-4b-it";
731
- readonly GEMMA_3_1B_IT: "gemma-3-1b-it";
732
- readonly GEMMA_3N_E4B_IT: "gemma-3n-e4b-it";
733
- readonly GEMMA_3N_E2B_IT: "gemma-3n-e2b-it";
734
- };
735
- readonly DefaultModel: "gemini-3-flash-preview";
750
+ readonly Models: {
751
+ readonly GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview";
752
+ readonly GEMINI_3_1_PRO_PREVIEW_CUSTOMTOOLS: "gemini-3.1-pro-preview-customtools";
753
+ readonly GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview";
754
+ readonly GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview";
755
+ readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
756
+ readonly GEMINI_2_5_PRO: "gemini-2.5-pro";
757
+ readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
758
+ readonly GEMINI_2_5_FLASH_LITE: "gemini-2.5-flash-lite";
759
+ readonly GEMINI_2_0_FLASH: "gemini-2.0-flash";
760
+ readonly GEMINI_2_0_FLASH_001: "gemini-2.0-flash-001";
761
+ readonly GEMINI_2_0_FLASH_LITE: "gemini-2.0-flash-lite";
762
+ readonly GEMINI_2_0_FLASH_LITE_001: "gemini-2.0-flash-lite-001";
763
+ readonly GEMINI_FLASH_LATEST: "gemini-flash-latest";
764
+ readonly GEMINI_FLASH_LITE_LATEST: "gemini-flash-lite-latest";
765
+ readonly GEMINI_PRO_LATEST: "gemini-pro-latest";
766
+ readonly GEMMA_4_31B_IT: "gemma-4-31b-it";
767
+ readonly GEMMA_4_E4B_IT: "gemma-4-26b-a4b-it";
768
+ readonly GEMMA_3_27B_IT: "gemma-3-27b-it";
769
+ readonly GEMMA_3_12B_IT: "gemma-3-12b-it";
770
+ readonly GEMMA_3_4B_IT: "gemma-3-4b-it";
771
+ readonly GEMMA_3_1B_IT: "gemma-3-1b-it";
772
+ readonly GEMMA_3N_E4B_IT: "gemma-3n-e4b-it";
773
+ readonly GEMMA_3N_E2B_IT: "gemma-3n-e2b-it";
774
+ };
775
+ readonly DefaultModel: "gemini-3.1-flash-lite-preview";
736
776
  };
737
-
777
+ //#endregion
778
+ //#region src/providers/helpers.d.ts
779
+ type ToolCallResult = {
780
+ type: "success";
781
+ content: string | ToolResultPart[];
782
+ } | {
783
+ type: "error";
784
+ error: {
785
+ type: string;
786
+ message: string;
787
+ fatal?: boolean;
788
+ retryable?: boolean;
789
+ };
790
+ };
791
+ type ToolCallCallback = (name: string, parameters: Record<string, unknown>) => Promise<ToolCallResult | null | undefined>;
792
+ type GenerateError = {
793
+ type: "model";
794
+ error: ModelError;
795
+ } | {
796
+ type: "tool";
797
+ error: {
798
+ name: string;
799
+ message: string;
800
+ };
801
+ };
802
+ type GenerateResult = {
803
+ result: "success";
804
+ messages: AxleMessage[];
805
+ final?: AxleAssistantMessage;
806
+ usage?: Stats;
807
+ } | {
808
+ result: "error";
809
+ messages: AxleMessage[];
810
+ error: GenerateError;
811
+ usage?: Stats;
812
+ };
813
+ type StreamResult = GenerateResult | {
814
+ result: "cancelled";
815
+ messages: AxleMessage[];
816
+ partial?: AxleAssistantMessage;
817
+ usage: Stats;
818
+ };
819
+ //#endregion
820
+ //#region src/providers/generateTurn.d.ts
821
+ interface GenerateTurnOptions {
822
+ temperature?: number;
823
+ top_p?: number;
824
+ max_tokens?: number;
825
+ frequency_penalty?: number;
826
+ presence_penalty?: number;
827
+ stop?: string | string[];
828
+ [key: string]: any;
829
+ }
830
+ interface GenerateTurnProps {
831
+ provider: AIProvider;
832
+ model: string;
833
+ messages: Array<AxleMessage>;
834
+ system?: string;
835
+ tools?: Array<ToolDefinition>;
836
+ tracer?: TracingContext;
837
+ options?: GenerateTurnOptions;
838
+ }
839
+ declare function generateTurn(props: GenerateTurnProps): Promise<ModelResult>;
840
+ //#endregion
841
+ //#region src/providers/generate.d.ts
738
842
  interface GenerateOptions {
739
- provider: AIProvider;
740
- model: string;
741
- messages: Array<AxleMessage>;
742
- system?: string;
743
- tools?: Array<ToolDefinition>;
744
- onToolCall?: ToolCallCallback;
745
- maxIterations?: number;
746
- tracer?: TracingContext;
747
- options?: GenerateTurnOptions;
843
+ provider: AIProvider;
844
+ model: string;
845
+ messages: Array<AxleMessage>;
846
+ system?: string;
847
+ tools?: Array<ToolDefinition>;
848
+ onToolCall?: ToolCallCallback;
849
+ maxIterations?: number;
850
+ tracer?: TracingContext;
851
+ options?: GenerateTurnOptions;
748
852
  }
749
853
  declare function generate(options: GenerateOptions): Promise<GenerateResult>;
750
-
854
+ //#endregion
855
+ //#region src/providers/stream.d.ts
856
+ type StreamEvent = {
857
+ type: "turn:start";
858
+ id: string;
859
+ model: string;
860
+ } | {
861
+ type: "turn:complete";
862
+ message: AxleAssistantMessage;
863
+ usage?: Stats;
864
+ } | {
865
+ type: "tool-results:start";
866
+ id: string;
867
+ } | {
868
+ type: "tool-results:complete";
869
+ message: AxleToolCallMessage;
870
+ } | {
871
+ type: "text:start";
872
+ index: number;
873
+ } | {
874
+ type: "text:delta";
875
+ index: number;
876
+ delta: string;
877
+ accumulated: string;
878
+ } | {
879
+ type: "text:end";
880
+ index: number;
881
+ final: string;
882
+ } | {
883
+ type: "thinking:start";
884
+ index: number;
885
+ } | {
886
+ type: "thinking:delta";
887
+ index: number;
888
+ delta: string;
889
+ accumulated: string;
890
+ } | {
891
+ type: "thinking:end";
892
+ index: number;
893
+ final: string;
894
+ } | {
895
+ type: "tool:request";
896
+ index: number;
897
+ id: string;
898
+ name: string;
899
+ } | {
900
+ type: "tool:exec-start";
901
+ index: number;
902
+ id: string;
903
+ name: string;
904
+ parameters: Record<string, unknown>;
905
+ } | {
906
+ type: "tool:exec-complete";
907
+ index: number;
908
+ id: string;
909
+ name: string;
910
+ result: ToolCallResult;
911
+ } | {
912
+ type: "internal-tool:start";
913
+ index: number;
914
+ id: string;
915
+ name: string;
916
+ } | {
917
+ type: "internal-tool:complete";
918
+ index: number;
919
+ id: string;
920
+ name: string;
921
+ output?: unknown;
922
+ } | {
923
+ type: "error";
924
+ error: GenerateError;
925
+ };
926
+ type StreamEventCallback = (event: StreamEvent) => void;
927
+ interface StreamOptions {
928
+ provider: AIProvider;
929
+ model: string;
930
+ messages: Array<AxleMessage>;
931
+ system?: string;
932
+ tools?: Array<ToolDefinition>;
933
+ serverTools?: Array<ServerTool>;
934
+ onToolCall?: ToolCallCallback;
935
+ maxIterations?: number;
936
+ tracer?: TracingContext;
937
+ options?: GenerateTurnOptions;
938
+ signal?: AbortSignal;
939
+ }
940
+ interface StreamHandle {
941
+ on(callback: StreamEventCallback): void;
942
+ cancel(): void;
943
+ readonly final: Promise<StreamResult>;
944
+ }
945
+ declare function stream(options: StreamOptions): StreamHandle;
946
+ //#endregion
947
+ //#region src/providers/openai/provider.d.ts
751
948
  declare function openai(apiKey: string): AIProvider;
752
-
949
+ //#endregion
950
+ //#region src/providers/openai/index.d.ts
753
951
  declare const OpenAI: {
754
- readonly Models: {
755
- readonly GPT_5_2: "gpt-5.2";
756
- readonly GPT_5_2_2025_12_11: "gpt-5.2-2025-12-11";
757
- readonly GPT_5_2_CHAT_LATEST: "gpt-5.2-chat-latest";
758
- readonly GPT_5_2_PRO: "gpt-5.2-pro";
759
- readonly GPT_5_2_PRO_2025_12_11: "gpt-5.2-pro-2025-12-11";
760
- readonly GPT_5_2_CODEX: "gpt-5.2-codex";
761
- readonly GPT_5_1: "gpt-5.1";
762
- readonly GPT_5_1_2025_11_13: "gpt-5.1-2025-11-13";
763
- readonly GPT_5_1_CHAT_LATEST: "gpt-5.1-chat-latest";
764
- readonly GPT_5_1_CODEX: "gpt-5.1-codex";
765
- readonly GPT_5_1_CODEX_MAX: "gpt-5.1-codex-max";
766
- readonly GPT_5_1_CODEX_MINI: "gpt-5.1-codex-mini";
767
- readonly GPT_5: "gpt-5";
768
- readonly GPT_5_2025_08_07: "gpt-5-2025-08-07";
769
- readonly GPT_5_CHAT_LATEST: "gpt-5-chat-latest";
770
- readonly GPT_5_CODEX: "gpt-5-codex";
771
- readonly GPT_5_MINI: "gpt-5-mini";
772
- readonly GPT_5_MINI_2025_08_07: "gpt-5-mini-2025-08-07";
773
- readonly GPT_5_NANO: "gpt-5-nano";
774
- readonly GPT_5_NANO_2025_08_07: "gpt-5-nano-2025-08-07";
775
- readonly GPT_5_PRO: "gpt-5-pro";
776
- readonly GPT_5_PRO_2025_10_06: "gpt-5-pro-2025-10-06";
777
- readonly GPT_5_SEARCH_API: "gpt-5-search-api";
778
- readonly GPT_5_SEARCH_API_2025_10_14: "gpt-5-search-api-2025-10-14";
779
- readonly GPT_4_1: "gpt-4.1";
780
- readonly GPT_4_1_2025_04_14: "gpt-4.1-2025-04-14";
781
- readonly GPT_4_1_MINI: "gpt-4.1-mini";
782
- readonly GPT_4_1_MINI_2025_04_14: "gpt-4.1-mini-2025-04-14";
783
- readonly GPT_4_1_NANO: "gpt-4.1-nano";
784
- readonly GPT_4_1_NANO_2025_04_14: "gpt-4.1-nano-2025-04-14";
785
- readonly GPT_4O: "gpt-4o";
786
- readonly GPT_4O_2024_11_20: "gpt-4o-2024-11-20";
787
- readonly GPT_4O_2024_08_06: "gpt-4o-2024-08-06";
788
- readonly GPT_4O_2024_05_13: "gpt-4o-2024-05-13";
789
- readonly GPT_4O_MINI: "gpt-4o-mini";
790
- readonly GPT_4O_MINI_2024_07_18: "gpt-4o-mini-2024-07-18";
791
- readonly GPT_4O_SEARCH_PREVIEW: "gpt-4o-search-preview";
792
- readonly GPT_4O_SEARCH_PREVIEW_2025_03_11: "gpt-4o-search-preview-2025-03-11";
793
- readonly GPT_4O_MINI_SEARCH_PREVIEW: "gpt-4o-mini-search-preview";
794
- readonly GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11: "gpt-4o-mini-search-preview-2025-03-11";
795
- readonly GPT_4_TURBO: "gpt-4-turbo";
796
- readonly GPT_4_TURBO_2024_04_09: "gpt-4-turbo-2024-04-09";
797
- readonly O4_MINI: "o4-mini";
798
- readonly O4_MINI_2025_04_16: "o4-mini-2025-04-16";
799
- readonly O3: "o3";
800
- readonly O3_2025_04_16: "o3-2025-04-16";
801
- readonly O3_PRO: "o3-pro";
802
- readonly O3_PRO_2025_06_10: "o3-pro-2025-06-10";
803
- readonly O3_MINI: "o3-mini";
804
- readonly O3_MINI_2025_01_31: "o3-mini-2025-01-31";
805
- readonly O1: "o1";
806
- readonly O1_2024_12_17: "o1-2024-12-17";
807
- readonly O1_PRO: "o1-pro";
808
- readonly O1_PRO_2025_03_19: "o1-pro-2025-03-19";
809
- };
810
- readonly DefaultModel: "gpt-5-mini";
952
+ readonly Models: {
953
+ readonly GPT_5_4_2026_03_05: "gpt-5.4-2026-03-05";
954
+ readonly GPT_5_4: "gpt-5.4";
955
+ readonly GPT_5_4_PRO_2026_03_05: "gpt-5.4-pro-2026-03-05";
956
+ readonly GPT_5_4_PRO: "gpt-5.4-pro";
957
+ readonly GPT_5_4_MINI_2026_03_17: "gpt-5.4-mini-2026-03-17";
958
+ readonly GPT_5_4_MINI: "gpt-5.4-mini";
959
+ readonly GPT_5_4_NANO_2026_03_17: "gpt-5.4-nano-2026-03-17";
960
+ readonly GPT_5_4_NANO: "gpt-5.4-nano";
961
+ readonly GPT_5_2_2025_12_11: "gpt-5.2-2025-12-11";
962
+ readonly GPT_5_2: "gpt-5.2";
963
+ readonly GPT_5_2_CHAT_LATEST: "gpt-5.2-chat-latest";
964
+ readonly GPT_5_2_PRO_2025_12_11: "gpt-5.2-pro-2025-12-11";
965
+ readonly GPT_5_2_PRO: "gpt-5.2-pro";
966
+ readonly GPT_5_1_2025_11_13: "gpt-5.1-2025-11-13";
967
+ readonly GPT_5_1: "gpt-5.1";
968
+ readonly GPT_5_1_CHAT_LATEST: "gpt-5.1-chat-latest";
969
+ readonly GPT_5_2025_08_07: "gpt-5-2025-08-07";
970
+ readonly GPT_5: "gpt-5";
971
+ readonly GPT_5_CHAT_LATEST: "gpt-5-chat-latest";
972
+ readonly GPT_5_PRO_2025_10_06: "gpt-5-pro-2025-10-06";
973
+ readonly GPT_5_PRO: "gpt-5-pro";
974
+ readonly GPT_5_MINI_2025_08_07: "gpt-5-mini-2025-08-07";
975
+ readonly GPT_5_MINI: "gpt-5-mini";
976
+ readonly GPT_5_NANO_2025_08_07: "gpt-5-nano-2025-08-07";
977
+ readonly GPT_5_NANO: "gpt-5-nano";
978
+ readonly GPT_4_1_2025_04_14: "gpt-4.1-2025-04-14";
979
+ readonly GPT_4_1: "gpt-4.1";
980
+ readonly GPT_4_1_MINI_2025_04_14: "gpt-4.1-mini-2025-04-14";
981
+ readonly GPT_4_1_MINI: "gpt-4.1-mini";
982
+ readonly GPT_4_1_NANO_2025_04_14: "gpt-4.1-nano-2025-04-14";
983
+ readonly GPT_4_1_NANO: "gpt-4.1-nano";
984
+ readonly GPT_4O_2024_11_20: "gpt-4o-2024-11-20";
985
+ readonly GPT_4O_2024_08_06: "gpt-4o-2024-08-06";
986
+ readonly GPT_4O_2024_05_13: "gpt-4o-2024-05-13";
987
+ readonly GPT_4O: "gpt-4o";
988
+ readonly GPT_4O_MINI_2024_07_18: "gpt-4o-mini-2024-07-18";
989
+ readonly GPT_4O_MINI: "gpt-4o-mini";
990
+ readonly O4_MINI_2025_04_16: "o4-mini-2025-04-16";
991
+ readonly O4_MINI: "o4-mini";
992
+ readonly O3_2025_04_16: "o3-2025-04-16";
993
+ readonly O3: "o3";
994
+ readonly O3_PRO_2025_06_10: "o3-pro-2025-06-10";
995
+ readonly O3_PRO: "o3-pro";
996
+ readonly O3_MINI_2025_01_31: "o3-mini-2025-01-31";
997
+ readonly O3_MINI: "o3-mini";
998
+ readonly O1_2024_12_17: "o1-2024-12-17";
999
+ readonly O1: "o1";
1000
+ readonly O1_PRO_2025_03_19: "o1-pro-2025-03-19";
1001
+ readonly O1_PRO: "o1-pro";
1002
+ };
1003
+ readonly DefaultModel: "gpt-5.4-mini";
811
1004
  };
812
-
813
- declare const BraveProviderConfigSchema: z$1.ZodObject<{
814
- "api-key": z$1.ZodString;
815
- rateLimit: z$1.ZodOptional<z$1.ZodNumber>;
816
- }, z$1.core.$strip>;
817
- type BraveProviderConfig = z$1.infer<typeof BraveProviderConfigSchema>;
818
-
819
- declare const braveSearchSchema: z.ZodObject<{
820
- searchTerm: z.ZodString;
1005
+ //#endregion
1006
+ //#region src/cli/configs/schemas.d.ts
1007
+ declare const BraveProviderConfigSchema: z.ZodObject<{
1008
+ "api-key": z.ZodString;
1009
+ rateLimit: z.ZodOptional<z.ZodNumber>;
821
1010
  }, z.core.$strip>;
1011
+ type BraveProviderConfig = z.infer<typeof BraveProviderConfigSchema>;
1012
+ //#endregion
1013
+ //#region src/tools/brave.d.ts
1014
+ declare const braveSearchSchema: z$2.ZodObject<{
1015
+ searchTerm: z$2.ZodString;
1016
+ }, z$2.core.$strip>;
822
1017
  declare class BraveSearchTool implements ExecutableTool<typeof braveSearchSchema> {
823
- name: string;
824
- description: string;
825
- schema: z.ZodObject<{
826
- searchTerm: z.ZodString;
827
- }, z.core.$strip>;
828
- apiKey: string;
829
- throttle: number | undefined;
830
- lastExecTime: number;
831
- constructor(config?: BraveProviderConfig);
832
- configure(config: BraveProviderConfig): void;
833
- execute(params: z.infer<typeof braveSearchSchema>): Promise<string>;
1018
+ name: string;
1019
+ description: string;
1020
+ schema: z$2.ZodObject<{
1021
+ searchTerm: z$2.ZodString;
1022
+ }, z$2.core.$strip>;
1023
+ apiKey: string | undefined;
1024
+ throttle: number | undefined;
1025
+ lastExecTime: number;
1026
+ constructor(config?: BraveProviderConfig);
1027
+ configure(config: BraveProviderConfig): void;
1028
+ execute(params: z$2.infer<typeof braveSearchSchema>): Promise<string>;
834
1029
  }
835
1030
  declare const braveSearchTool: BraveSearchTool;
836
-
837
- declare const calculatorSchema: z$1.ZodObject<{
838
- operation: z$1.ZodEnum<{
839
- add: "add";
840
- subtract: "subtract";
841
- multiply: "multiply";
842
- divide: "divide";
843
- }>;
844
- a: z$1.ZodNumber;
845
- b: z$1.ZodNumber;
846
- }, z$1.core.$strip>;
1031
+ //#endregion
1032
+ //#region src/tools/calculator.d.ts
1033
+ declare const calculatorSchema: z.ZodObject<{
1034
+ operation: z.ZodEnum<{
1035
+ add: "add";
1036
+ subtract: "subtract";
1037
+ multiply: "multiply";
1038
+ divide: "divide";
1039
+ }>;
1040
+ a: z.ZodNumber;
1041
+ b: z.ZodNumber;
1042
+ }, z.core.$strip>;
847
1043
  declare const calculatorTool: ExecutableTool<typeof calculatorSchema>;
848
-
1044
+ //#endregion
1045
+ //#region src/turns/builder.d.ts
1046
+ declare class TurnBuilder {
1047
+ private currentTurn;
1048
+ private currentTextPart;
1049
+ private currentThinkingPart;
1050
+ private toolIdMap;
1051
+ private accumulatedUsage;
1052
+ createUserTurn(message: AxleUserMessage): {
1053
+ turn: Turn;
1054
+ events: AgentEvent[];
1055
+ };
1056
+ startAgentTurn(): {
1057
+ turn: Turn;
1058
+ events: AgentEvent[];
1059
+ };
1060
+ handleStreamEvent(event: StreamEvent): AgentEvent[];
1061
+ finalizeTurn(outcome?: "complete" | "cancelled" | "error"): AgentEvent[];
1062
+ private closeOpenParts;
1063
+ private findActionPart;
1064
+ }
1065
+ //#endregion
1066
+ //#region src/tracer/tracer.d.ts
849
1067
  /**
850
1068
  * Root tracer that manages writers and creates spans.
851
1069
  * Use startSpan() to create TracingContext instances for hierarchical tracing.
852
1070
  * All logging happens within spans - the Tracer itself is just configuration and factory.
853
1071
  */
854
1072
  declare class Tracer {
855
- private writers;
856
- private _minLevel;
857
- get minLevel(): EventLevel;
858
- set minLevel(level: EventLevel);
859
- addWriter(writer: TraceWriter): void;
860
- removeWriter(writer: TraceWriter): void;
861
- startSpan(name: string, options?: SpanOptions): TracingContext;
862
- flush(): Promise<void>;
863
- /** @internal */
864
- _notifySpanEnd(spanData: SpanData): void;
865
- /** @internal */
866
- _notifySpanUpdate(spanData: SpanData): void;
867
- /** @internal */
868
- _notifyEvent(spanData: SpanData, event: SpanEvent): void;
869
- /** @internal */
870
- _notifySpanStart(spanData: SpanData): void;
871
- /** @internal */
872
- _shouldLog(level: EventLevel): boolean;
873
- }
874
-
1073
+ private writers;
1074
+ private _minLevel;
1075
+ get minLevel(): EventLevel;
1076
+ set minLevel(level: EventLevel);
1077
+ addWriter(writer: TraceWriter): void;
1078
+ removeWriter(writer: TraceWriter): void;
1079
+ startSpan(name: string, options?: SpanOptions): TracingContext;
1080
+ flush(): Promise<void>;
1081
+ /** @internal */
1082
+ _notifySpanEnd(spanData: SpanData): void;
1083
+ /** @internal */
1084
+ _notifySpanUpdate(spanData: SpanData): void;
1085
+ /** @internal */
1086
+ _notifyEvent(spanData: SpanData, event: SpanEvent): void;
1087
+ /** @internal */
1088
+ _notifySpanStart(spanData: SpanData): void;
1089
+ /** @internal */
1090
+ _shouldLog(level: EventLevel): boolean;
1091
+ }
1092
+ //#endregion
1093
+ //#region src/tracer/writers/simple.d.ts
875
1094
  interface SimpleWriterOptions {
876
- /** Minimum event level to display (default: "info") */
877
- minLevel?: EventLevel;
878
- /** Show internal spans - typically enabled via --debug flag (default: false) */
879
- showInternal?: boolean;
880
- /** Show timestamps (default: true) */
881
- showTimestamp?: boolean;
882
- /** Show duration on span end (default: true) */
883
- showDuration?: boolean;
884
- /** Render markdown in event messages that have markdown: true attribute (default: false) */
885
- markdown?: boolean;
886
- /** Custom output function (default: console.log) */
887
- output?: (line: string) => void;
1095
+ /** Minimum event level to display (default: "info") */
1096
+ minLevel?: EventLevel;
1097
+ /** Show internal spans - typically enabled via --debug flag (default: false) */
1098
+ showInternal?: boolean;
1099
+ /** Show timestamps (default: true) */
1100
+ showTimestamp?: boolean;
1101
+ /** Show duration on span end (default: true) */
1102
+ showDuration?: boolean;
1103
+ /** Render markdown in event messages that have markdown: true attribute (default: false) */
1104
+ markdown?: boolean;
1105
+ /** Custom output function (default: console.log) */
1106
+ output?: (line: string) => void;
888
1107
  }
889
1108
  declare class SimpleWriter implements TraceWriter {
890
- private minLevel;
891
- private showInternal;
892
- private showTimestamp;
893
- private showDuration;
894
- private markdown;
895
- private output;
896
- private spans;
897
- private visibleDepths;
898
- constructor(options?: SimpleWriterOptions);
899
- private shouldShowEvent;
900
- private isSpanVisible;
901
- /**
902
- * Find the nearest visible ancestor span for a given span.
903
- * Returns null if no visible ancestor exists (root level).
904
- */
905
- private findVisibleAncestor;
906
- /**
907
- * Calculate the visible depth for a span.
908
- * Only counts visible ancestors in the depth.
909
- */
910
- private calculateVisibleDepth;
911
- private formatTimestamp;
912
- private formatDuration;
913
- private formatIndent;
914
- private formatSpanName;
915
- private renderMarkdown;
916
- onSpanStart(span: SpanData): void;
917
- onSpanEnd(span: SpanData): void;
918
- onSpanUpdate(span: SpanData): void;
919
- onEvent(span: SpanData, event: SpanEvent): void;
920
- }
921
-
1109
+ private minLevel;
1110
+ private showInternal;
1111
+ private showTimestamp;
1112
+ private showDuration;
1113
+ private markdown;
1114
+ private output;
1115
+ private spans;
1116
+ private visibleDepths;
1117
+ constructor(options?: SimpleWriterOptions);
1118
+ private shouldShowEvent;
1119
+ private isSpanVisible;
1120
+ /**
1121
+ * Find the nearest visible ancestor span for a given span.
1122
+ * Returns null if no visible ancestor exists (root level).
1123
+ */
1124
+ private findVisibleAncestor;
1125
+ /**
1126
+ * Calculate the visible depth for a span.
1127
+ * Only counts visible ancestors in the depth.
1128
+ */
1129
+ private calculateVisibleDepth;
1130
+ private formatTimestamp;
1131
+ private formatDuration;
1132
+ private formatIndent;
1133
+ private formatSpanName;
1134
+ private renderMarkdown;
1135
+ onSpanStart(span: SpanData): void;
1136
+ onSpanEnd(span: SpanData): void;
1137
+ onSpanUpdate(span: SpanData): void;
1138
+ onEvent(span: SpanData, event: SpanEvent): void;
1139
+ }
1140
+ //#endregion
1141
+ //#region src/memory/ProceduralMemory.d.ts
922
1142
  interface ProceduralMemoryConfig {
923
- provider: AIProvider;
924
- model: string;
925
- enableTools?: boolean;
1143
+ provider: AIProvider;
1144
+ model: string;
1145
+ enableTools?: boolean;
926
1146
  }
927
1147
  declare class ProceduralMemory implements AgentMemory {
928
- private provider;
929
- private model;
930
- private enableTools;
931
- private lastStore?;
932
- private lastName?;
933
- private lastScope?;
934
- constructor(config: ProceduralMemoryConfig);
935
- recall(context: MemoryContext): Promise<RecallResult>;
936
- record(context: MemoryContext): Promise<void>;
937
- tools(): ExecutableTool[];
938
- private formatMessages;
939
- private parseInstructions;
940
- private getStorePath;
941
- private loadStore;
942
- private saveStore;
943
- }
944
-
1148
+ private provider;
1149
+ private model;
1150
+ private enableTools;
1151
+ private lastStore?;
1152
+ private lastName?;
1153
+ private lastScope?;
1154
+ constructor(config: ProceduralMemoryConfig);
1155
+ recall(context: MemoryContext): Promise<RecallResult>;
1156
+ record(context: MemoryContext): Promise<void>;
1157
+ tools(): ExecutableTool[];
1158
+ private formatMessages;
1159
+ private parseInstructions;
1160
+ private getStorePath;
1161
+ private loadStore;
1162
+ private saveStore;
1163
+ }
1164
+ //#endregion
1165
+ //#region src/store/LocalFileStore.d.ts
945
1166
  declare class LocalFileStore implements FileStore {
946
- readonly rootPath: string;
947
- constructor(rootPath: string);
948
- read(path: string): Promise<string | null>;
949
- write(path: string, content: string): Promise<void>;
1167
+ readonly rootPath: string;
1168
+ constructor(rootPath: string);
1169
+ read(path: string): Promise<string | null>;
1170
+ write(path: string, content: string): Promise<void>;
950
1171
  }
951
-
952
- export { Agent, Anthropic, AxleStopReason, Gemini, History, Instruct, LocalFileStore, MCP, OpenAI, ProceduralMemory, SimpleWriter, Tracer, anthropic, braveSearchTool, calculatorTool, chatCompletions, compileInstruct, gemini, generate, generateTurn, loadFileContent, openai, parseResponse, stream };
953
- export type { AIProvider, AgentConfig, AgentHandle, AgentMemory, AgentResult, AxleAssistantMessage, AxleMessage, AxleTool, AxleToolCallMessage, AxleToolCallResult, AxleUserMessage, ContentPart, ContentPartFile, ContentPartText, ContentPartThinking, ContentPartToolCall, EventLevel, ExecutableTool, FileInfo, FileStore, MCPConfig, MCPHttpConfig, MCPStdioConfig, MemoryContext, ProceduralMemoryConfig, RecallResult, ServerTool, SimpleWriterOptions, SpanData, SpanOptions, SpanType, StreamEvent, StreamEventCallback, ToolDefinition, ToolResultPart, TraceWriter, TracingContext };
1172
+ //#endregion
1173
+ export { type AIProvider, type ActionPart, type ActionResult, Agent, type AgentConfig, type AgentEvent, type AgentEventCallback, type AgentHandle, type AgentMemory, type AgentResult, Anthropic, type AxleAssistantMessage, type AxleMessage, AxleStopReason, type AxleTool, type AxleToolCallMessage, type AxleToolCallResult, type AxleUserMessage, type ContentPart, type ContentPartFile, type ContentPartInternalTool, type ContentPartText, type ContentPartThinking, type ContentPartToolCall, type EventLevel, type ExecutableTool, type FileInfo, type FilePart, type FileStore, Gemini, type Handle, History, Instruct, type InternalToolAction, LocalFileStore, MCP, type MCPConfig, type MCPHttpConfig, type MCPStdioConfig, type MemoryContext, OpenAI, ProceduralMemory, type ProceduralMemoryConfig, type RecallResult, type SendInstructOptions, type SendMessageOptions, type ServerTool, SimpleWriter, type SimpleWriterOptions, type SpanData, type SpanOptions, type SpanType, type StreamEvent, type StreamEventCallback, type StreamHandle, type StreamResult, type SubagentAction, type TextPart, type ThinkingPart, type ToolAction, type ToolDefinition, type ToolResultPart, type TraceWriter, Tracer, type TracingContext, type Turn, TurnBuilder, type TurnPart, type TurnStatus, anthropic, braveSearchTool, calculatorTool, chatCompletions, compileInstruct, createHandle, gemini, generate, generateTurn, loadFileContent, openai, parseResponse, stream };