@fifthrevision/axle 0.16.3 → 0.18.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/dist/index.d.ts CHANGED
@@ -2,9 +2,20 @@ import * as z$2 from "zod";
2
2
  import { ZodObject, z } from "zod";
3
3
 
4
4
  //#region src/types.d.ts
5
+ /**
6
+ * Token usage reported by a provider response.
7
+ */
5
8
  interface Stats {
9
+ /** Total effective input tokens. Includes `cachedIn` and `cacheWriteIn` when reported. */
6
10
  in: number;
11
+ /** Total output tokens. Includes `reasoningOut` when reported. */
7
12
  out: number;
13
+ /** Input tokens served from provider prompt/context cache. Included in `in`. */
14
+ cachedIn?: number;
15
+ /** Input tokens written into provider prompt/context cache. Included in `in`. */
16
+ cacheWriteIn?: number;
17
+ /** Output tokens spent on reasoning/thinking. Included in `out`. */
18
+ reasoningOut?: number;
8
19
  }
9
20
  //#endregion
10
21
  //#region src/messages/stream.d.ts
@@ -179,6 +190,9 @@ interface TokenUsage {
179
190
  inputTokens?: number;
180
191
  outputTokens?: number;
181
192
  totalTokens?: number;
193
+ cachedInputTokens?: number;
194
+ cacheWriteInputTokens?: number;
195
+ reasoningOutputTokens?: number;
182
196
  }
183
197
  interface ToolResult {
184
198
  kind: "tool";
@@ -315,37 +329,93 @@ declare function loadFileContent(filePath: string, encoding: "utf-8"): Promise<I
315
329
  declare function loadFileContent(filePath: string, encoding: "base64"): Promise<InlineBinaryFile>;
316
330
  //#endregion
317
331
  //#region src/providers/types.d.ts
318
- interface ProviderRequestContext {
332
+ /**
333
+ * Internal services available to provider adapters while executing a model request.
334
+ */
335
+ interface ProviderRuntime {
336
+ /** Request-scoped tracing span used by provider adapters. */
319
337
  tracer?: TracingContext;
338
+ /** Resolves file references before provider-specific request conversion. */
320
339
  fileResolver?: FileResolver;
321
340
  }
322
- interface GenerateTurnOptions {
341
+ /**
342
+ * Raw provider-specific request fields.
343
+ *
344
+ * Provider adapters apply this after Axle-normalized options, so these values
345
+ * can intentionally override Axle's provider mappings.
346
+ */
347
+ interface ProviderOptions {
348
+ [key: string]: any;
349
+ }
350
+ /**
351
+ * Controls how the model may use tools during a single model request.
352
+ */
353
+ type ToolChoice = "auto" | "none" | "required" | {
354
+ type: "tool";
355
+ name: string;
356
+ };
357
+ /**
358
+ * Provider-portable options for a single model request.
359
+ *
360
+ * These fields are normalized by Axle and mapped to each provider's request
361
+ * shape. Use `providerOptions` for provider-specific controls that are not
362
+ * represented here.
363
+ */
364
+ interface AxleModelRequestOptions {
365
+ /** Enables or disables provider reasoning/thinking controls where supported. */
366
+ reasoning?: boolean;
367
+ /** Maximum output tokens to request from the model. */
368
+ maxOutputTokens?: number;
369
+ /** Sampling temperature, when supported by the provider/model. */
323
370
  temperature?: number;
324
- top_p?: number;
325
- max_tokens?: number;
326
- frequency_penalty?: number;
327
- presence_penalty?: number;
371
+ /** Nucleus sampling value, mapped to provider-specific casing. */
372
+ topP?: number;
373
+ /** Stop sequence or sequences for text generation. */
328
374
  stop?: string | string[];
329
- [key: string]: any;
375
+ /** Constrains tool use for this model request. */
376
+ toolChoice?: ToolChoice;
377
+ /** Requests that the provider avoid parallel tool calls when supported. */
378
+ parallelToolCalls?: boolean;
379
+ /** Raw provider-specific request fields applied after normalized mappings. */
380
+ providerOptions?: ProviderOptions;
381
+ /** Abort signal for the in-flight model request. */
382
+ signal?: AbortSignal;
330
383
  }
331
- interface GenerationRequestParams {
384
+ /**
385
+ * Parameters passed to provider adapters for one non-streaming generation call.
386
+ */
387
+ interface ProviderGenerationParams extends AxleModelRequestOptions {
388
+ /** Conversation messages to send to the provider. */
332
389
  messages: Array<AxleMessage>;
390
+ /** Optional system/developer instruction for the request. */
333
391
  system?: string;
392
+ /** Executable tools exposed as provider function tools. */
334
393
  tools?: Array<ToolDefinition>;
335
- context: ProviderRequestContext;
336
- options?: GenerateTurnOptions;
337
- reasoning?: boolean;
338
- signal?: AbortSignal;
394
+ /** Provider-managed tools such as web search or code execution. */
395
+ providerTools?: Array<ProviderTool>;
396
+ /** Internal services available during provider request creation. */
397
+ runtime: ProviderRuntime;
339
398
  }
340
- interface StreamingRequestParams extends GenerationRequestParams {
341
- signal?: AbortSignal;
399
+ /**
400
+ * Parameters passed to provider adapters for one streaming generation call.
401
+ */
402
+ interface ProviderStreamParams extends ProviderGenerationParams {}
403
+ interface ContextUsage {
404
+ total: number;
405
+ system: number;
406
+ tools: number;
407
+ mcpTools: number;
408
+ providerTools: number;
409
+ messages: number;
410
+ limit?: number;
411
+ free?: number;
342
412
  }
343
413
  interface AIProvider {
344
414
  get name(): string;
345
415
  /** @internal */
346
- createGenerationRequest(model: string, params: GenerationRequestParams): Promise<ModelResult>;
416
+ createGenerationRequest(model: string, params: ProviderGenerationParams): Promise<ModelResult>;
347
417
  /** @internal */
348
- createStreamingRequest(model: string, params: StreamingRequestParams): AsyncGenerator<AnyStreamChunk, void, unknown>;
418
+ createStreamingRequest(model: string, params: ProviderStreamParams): AsyncGenerator<AnyStreamChunk, void, unknown>;
349
419
  }
350
420
  interface ModelResponse {
351
421
  type: "success";
@@ -445,7 +515,8 @@ interface ContentPartProviderTool {
445
515
  //#endregion
446
516
  //#region src/tools/registry.d.ts
447
517
  declare class ToolRegistry {
448
- private executableTools;
518
+ private tools;
519
+ private mcpTools;
449
520
  private providerTools;
450
521
  constructor(init?: {
451
522
  tools?: ExecutableTool[];
@@ -453,6 +524,8 @@ declare class ToolRegistry {
453
524
  });
454
525
  add(tool: ExecutableTool): void;
455
526
  add(tools: ExecutableTool[]): void;
527
+ addMcp(tool: ExecutableTool): void;
528
+ addMcp(tools: ExecutableTool[]): void;
456
529
  addProvider(tool: ProviderTool): void;
457
530
  addProvider(tools: ProviderTool[]): void;
458
531
  remove(name: string): boolean;
@@ -460,6 +533,8 @@ declare class ToolRegistry {
460
533
  get(name: string): ExecutableTool | undefined;
461
534
  getProvider(name: string): ProviderTool | undefined;
462
535
  executable(): ExecutableTool[];
536
+ local(): ExecutableTool[];
537
+ mcp(): ExecutableTool[];
463
538
  provider(): ProviderTool[];
464
539
  get size(): number;
465
540
  }
@@ -558,6 +633,50 @@ interface AgentMemory {
558
633
  tools?(): ExecutableTool[];
559
634
  }
560
635
  //#endregion
636
+ //#region src/providers/helpers.d.ts
637
+ type ToolCallResult = {
638
+ type: "success";
639
+ content: string | ToolResultPart[];
640
+ } | {
641
+ type: "error";
642
+ error: {
643
+ type: string;
644
+ message: string;
645
+ fatal?: boolean;
646
+ retryable?: boolean;
647
+ };
648
+ };
649
+ type ToolCallCallback = (name: string, parameters: Record<string, unknown>, ctx: ToolContext) => Promise<ToolCallResult | null | undefined>;
650
+ type GenerateError = {
651
+ kind: "model";
652
+ error: ModelError;
653
+ } | {
654
+ kind: "tool";
655
+ error: {
656
+ name: string;
657
+ message: string;
658
+ };
659
+ } | {
660
+ kind: "parse";
661
+ error: unknown;
662
+ message: string;
663
+ };
664
+ type GenerateResult<TResponse = AxleAssistantMessage> = {
665
+ ok: true;
666
+ response: TResponse;
667
+ messages: AxleMessage[];
668
+ final: AxleAssistantMessage;
669
+ usage?: Stats;
670
+ } | {
671
+ ok: false;
672
+ response?: undefined;
673
+ final?: AxleAssistantMessage;
674
+ messages: AxleMessage[];
675
+ error: GenerateError;
676
+ usage?: Stats;
677
+ };
678
+ type StreamResult<TResponse = AxleAssistantMessage> = GenerateResult<TResponse>;
679
+ //#endregion
561
680
  //#region src/turns/types.d.ts
562
681
  type TurnStatus = "streaming" | "complete" | "cancelled" | "error";
563
682
  interface TimingInfo {
@@ -752,14 +871,16 @@ declare class History {
752
871
  }
753
872
  //#endregion
754
873
  //#region src/core/parse.d.ts
755
- type OutputSchema = Record<string, z$2.ZodTypeAny>;
756
- type ParsedSchema<T extends OutputSchema> = { [K in keyof T]: z$2.output<T[K]> };
874
+ type OutputSchema = z$2.ZodTypeAny;
875
+ type ParsedSchema<T extends OutputSchema> = z$2.output<T>;
757
876
  declare function parseResponse<T extends OutputSchema>(rawValue: string, schema?: T): ParsedSchema<T> | string;
758
877
  //#endregion
759
878
  //#region src/core/Instruct.d.ts
760
879
  type InstructInputs = Record<string, unknown>;
761
880
  type InstructVarsMode = "required" | "optional";
762
- interface InstructOptions {
881
+ interface InstructOptions<TSchema extends OutputSchema | undefined = OutputSchema | undefined> {
882
+ prompt: string;
883
+ schema?: TSchema;
763
884
  vars?: InstructVarsMode;
764
885
  }
765
886
  declare class Instruct<TSchema extends OutputSchema | undefined = undefined> {
@@ -772,7 +893,7 @@ declare class Instruct<TSchema extends OutputSchema | undefined = undefined> {
772
893
  }>;
773
894
  vars: InstructVarsMode;
774
895
  schema: TSchema;
775
- constructor(prompt: string, schema?: TSchema, options?: InstructOptions);
896
+ constructor(options: InstructOptions<TSchema>);
776
897
  clone(): Instruct<TSchema>;
777
898
  withInputs(inputs: InstructInputs): Instruct<TSchema>;
778
899
  withInput(name: string, value: unknown): Instruct<TSchema>;
@@ -788,7 +909,7 @@ declare class Instruct<TSchema extends OutputSchema | undefined = undefined> {
788
909
  }
789
910
  //#endregion
790
911
  //#region src/core/Agent.d.ts
791
- interface AgentConfig {
912
+ interface AgentConfig extends Omit<AxleModelRequestOptions, "signal"> {
792
913
  provider: AIProvider;
793
914
  model: string;
794
915
  system?: string;
@@ -800,19 +921,24 @@ interface AgentConfig {
800
921
  memory?: AgentMemory;
801
922
  tracer?: TracingContext;
802
923
  fileResolver?: FileResolver;
803
- reasoning?: boolean;
804
924
  }
805
925
  interface AgentResult<T = string> {
806
- response: T | null;
926
+ ok: true;
927
+ response: T;
928
+ turn: Turn;
929
+ usage: Stats;
930
+ }
931
+ interface AgentErrorResult {
932
+ ok: false;
933
+ response?: undefined;
934
+ error: GenerateError;
807
935
  turn: Turn | undefined;
808
936
  usage: Stats;
809
937
  }
810
- type AgentHandle<T = string> = Handle<AgentResult<T>>;
938
+ type AgentHandle<T = string> = Handle<AgentResult<T> | AgentErrorResult>;
811
939
  type AgentEventCallback = (event: AgentEvent) => void;
812
- interface SendMessageOptions {
813
- signal?: AbortSignal;
940
+ interface SendMessageOptions extends AxleModelRequestOptions {
814
941
  fileResolver?: FileResolver;
815
- reasoning?: boolean;
816
942
  }
817
943
  declare class Agent {
818
944
  readonly provider: AIProvider;
@@ -823,7 +949,7 @@ declare class Agent {
823
949
  readonly scope?: Record<string, string>;
824
950
  readonly store: FileStore;
825
951
  readonly fileResolver?: FileResolver;
826
- readonly reasoning?: boolean;
952
+ readonly requestOptions: Omit<AxleModelRequestOptions, "signal">;
827
953
  readonly registry: ToolRegistry;
828
954
  system: string | undefined;
829
955
  private mcps;
@@ -836,10 +962,12 @@ declare class Agent {
836
962
  addMcps(mcps: MCP[]): void;
837
963
  hasTools(): boolean;
838
964
  on(callback: AgentEventCallback): void;
965
+ context(): ContextUsage;
839
966
  send(message: string | Instruct<undefined>, options?: SendMessageOptions): AgentHandle<string>;
840
967
  send<TSchema extends OutputSchema>(instruct: Instruct<TSchema>, options?: SendMessageOptions): AgentHandle<ParsedSchema<TSchema>>;
841
968
  private resolveMcpTools;
842
969
  private emitEvent;
970
+ private toToolDefinitions;
843
971
  private run;
844
972
  }
845
973
  //#endregion
@@ -945,6 +1073,21 @@ declare class AxleToolFatalError extends AxleError {
945
1073
  };
946
1074
  }
947
1075
  //#endregion
1076
+ //#region src/errors/InstructVariableError.d.ts
1077
+ declare class InstructVariableError extends AxleError {
1078
+ readonly missingVariables: string[];
1079
+ constructor(missingVariables: string[]);
1080
+ toJSON(): {
1081
+ missingVariables: string[];
1082
+ cause?: unknown;
1083
+ details?: Record<string, any> | undefined;
1084
+ id?: string | undefined;
1085
+ name: string;
1086
+ message: string;
1087
+ code: string;
1088
+ };
1089
+ }
1090
+ //#endregion
948
1091
  //#region src/errors/TaskError.d.ts
949
1092
  declare class TaskError extends AxleError {
950
1093
  constructor(message: string, options?: {
@@ -999,6 +1142,7 @@ declare const Gemini: {
999
1142
  readonly GEMINI_3_PRO: "gemini-3-pro-preview";
1000
1143
  readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
1001
1144
  readonly GEMINI_3_FLASH: "gemini-3-flash-preview";
1145
+ readonly GEMINI_3_5_FLASH: "gemini-3.5-flash";
1002
1146
  readonly GEMINI_2_5_PRO: "gemini-2.5-pro";
1003
1147
  readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
1004
1148
  readonly GEMINI_2_5_FLASH_LITE: "gemini-2.5-flash-lite";
@@ -1013,60 +1157,8 @@ declare const Gemini: {
1013
1157
  readonly DefaultModel: "gemini-3.1-flash-lite-preview";
1014
1158
  };
1015
1159
  //#endregion
1016
- //#region src/providers/generateTurn.d.ts
1017
- interface GenerateTurnProps {
1018
- provider: AIProvider;
1019
- model: string;
1020
- messages: Array<AxleMessage>;
1021
- system?: string;
1022
- tools?: Array<ToolDefinition>;
1023
- tracer?: TracingContext;
1024
- fileResolver?: FileResolver;
1025
- options?: GenerateTurnOptions;
1026
- reasoning?: boolean;
1027
- signal?: AbortSignal;
1028
- }
1029
- declare function generateTurn(props: GenerateTurnProps): Promise<ModelResult>;
1030
- //#endregion
1031
- //#region src/providers/helpers.d.ts
1032
- type ToolCallResult = {
1033
- type: "success";
1034
- content: string | ToolResultPart[];
1035
- } | {
1036
- type: "error";
1037
- error: {
1038
- type: string;
1039
- message: string;
1040
- fatal?: boolean;
1041
- retryable?: boolean;
1042
- };
1043
- };
1044
- type ToolCallCallback = (name: string, parameters: Record<string, unknown>, ctx: ToolContext) => Promise<ToolCallResult | null | undefined>;
1045
- type GenerateError = {
1046
- type: "model";
1047
- error: ModelError;
1048
- } | {
1049
- type: "tool";
1050
- error: {
1051
- name: string;
1052
- message: string;
1053
- };
1054
- };
1055
- type GenerateResult = {
1056
- result: "success";
1057
- messages: AxleMessage[];
1058
- final?: AxleAssistantMessage;
1059
- usage?: Stats;
1060
- } | {
1061
- result: "error";
1062
- messages: AxleMessage[];
1063
- error: GenerateError;
1064
- usage?: Stats;
1065
- };
1066
- type StreamResult = GenerateResult;
1067
- //#endregion
1068
1160
  //#region src/providers/generate.d.ts
1069
- interface GenerateOptions {
1161
+ interface GenerateParams extends AxleModelRequestOptions {
1070
1162
  provider: AIProvider;
1071
1163
  model: string;
1072
1164
  messages: Array<AxleMessage>;
@@ -1078,24 +1170,27 @@ interface GenerateOptions {
1078
1170
  maxIterations?: number;
1079
1171
  tracer?: TracingContext;
1080
1172
  fileResolver?: FileResolver;
1081
- options?: GenerateTurnOptions;
1082
- reasoning?: boolean;
1083
- signal?: AbortSignal;
1084
1173
  }
1085
- interface GenerateInstructOptions<TSchema extends OutputSchema | undefined> extends Omit<GenerateOptions, "messages"> {
1174
+ interface GenerateInstructParams<TSchema extends OutputSchema | undefined> extends Omit<GenerateParams, "messages"> {
1086
1175
  messages?: Array<AxleMessage>;
1087
1176
  instruct: Instruct<TSchema>;
1088
1177
  }
1089
- type GenerateInstructResult<TSchema extends OutputSchema | undefined> = (Extract<GenerateResult, {
1090
- result: "success";
1091
- }> & {
1092
- response: InstructResponse<TSchema> | null;
1093
- parseError?: unknown;
1094
- }) | Extract<GenerateResult, {
1095
- result: "error";
1096
- }>;
1097
- declare function generate<TSchema extends OutputSchema | undefined>(options: GenerateInstructOptions<TSchema>): Promise<GenerateInstructResult<TSchema>>;
1098
- declare function generate(options: GenerateOptions): Promise<GenerateResult>;
1178
+ type GenerateInstructResult<TSchema extends OutputSchema | undefined> = GenerateResult<InstructResponse<TSchema>>;
1179
+ declare function generate<TSchema extends OutputSchema | undefined>(options: GenerateInstructParams<TSchema>): Promise<GenerateInstructResult<TSchema>>;
1180
+ declare function generate(options: GenerateParams): Promise<GenerateResult>;
1181
+ //#endregion
1182
+ //#region src/providers/generateTurn.d.ts
1183
+ interface GenerateTurnParams extends AxleModelRequestOptions {
1184
+ provider: AIProvider;
1185
+ model: string;
1186
+ messages: Array<AxleMessage>;
1187
+ system?: string;
1188
+ tools?: Array<ToolDefinition>;
1189
+ providerTools?: Array<ProviderTool>;
1190
+ tracer?: TracingContext;
1191
+ fileResolver?: FileResolver;
1192
+ }
1193
+ declare function generateTurn(props: GenerateTurnParams): Promise<ModelResult>;
1099
1194
  //#endregion
1100
1195
  //#region src/providers/stream.d.ts
1101
1196
  type StreamEvent = {
@@ -1182,7 +1277,7 @@ type StreamEvent = {
1182
1277
  error: GenerateError;
1183
1278
  };
1184
1279
  type StreamEventCallback = (event: StreamEvent) => void;
1185
- interface StreamOptions {
1280
+ interface StreamParams extends AxleModelRequestOptions {
1186
1281
  provider: AIProvider;
1187
1282
  model: string;
1188
1283
  messages: Array<AxleMessage>;
@@ -1194,32 +1289,22 @@ interface StreamOptions {
1194
1289
  maxIterations?: number;
1195
1290
  tracer?: TracingContext;
1196
1291
  fileResolver?: FileResolver;
1197
- options?: GenerateTurnOptions;
1198
- reasoning?: boolean;
1199
- signal?: AbortSignal;
1200
1292
  }
1201
1293
  interface StreamHandle {
1202
1294
  on(callback: StreamEventCallback): void;
1203
1295
  cancel(reason?: unknown): void;
1204
1296
  readonly final: Promise<StreamResult>;
1205
1297
  }
1206
- interface StreamInstructOptions<TSchema extends OutputSchema | undefined> extends Omit<StreamOptions, "messages"> {
1298
+ interface StreamInstructParams<TSchema extends OutputSchema | undefined> extends Omit<StreamParams, "messages"> {
1207
1299
  messages?: Array<AxleMessage>;
1208
1300
  instruct: Instruct<TSchema>;
1209
1301
  }
1210
- type StreamInstructResult<TSchema extends OutputSchema | undefined> = (Extract<StreamResult, {
1211
- result: "success";
1212
- }> & {
1213
- response: InstructResponse<TSchema> | null;
1214
- parseError?: unknown;
1215
- }) | Extract<StreamResult, {
1216
- result: "error";
1217
- }>;
1302
+ type StreamInstructResult<TSchema extends OutputSchema | undefined> = StreamResult<InstructResponse<TSchema>>;
1218
1303
  interface StreamInstructHandle<TSchema extends OutputSchema | undefined> extends Omit<StreamHandle, "final"> {
1219
1304
  readonly final: Promise<StreamInstructResult<TSchema>>;
1220
1305
  }
1221
- declare function stream<TSchema extends OutputSchema | undefined>(options: StreamInstructOptions<TSchema>): StreamInstructHandle<TSchema>;
1222
- declare function stream(options: StreamOptions): StreamHandle;
1306
+ declare function stream<TSchema extends OutputSchema | undefined>(options: StreamInstructParams<TSchema>): StreamInstructHandle<TSchema>;
1307
+ declare function stream(options: StreamParams): StreamHandle;
1223
1308
  //#endregion
1224
1309
  //#region src/providers/openai/provider.d.ts
1225
1310
  declare function openai(apiKey: string): AIProvider;
@@ -1279,6 +1364,17 @@ declare const OpenAI: {
1279
1364
  readonly DefaultModel: "gpt-5.4-mini";
1280
1365
  };
1281
1366
  //#endregion
1367
+ //#region src/providers/context.d.ts
1368
+ interface ContextEstimateInput {
1369
+ system?: string;
1370
+ tools?: ToolDefinition[];
1371
+ providerTools?: ProviderTool[];
1372
+ mcpTools?: ToolDefinition[];
1373
+ messages: AxleMessage[];
1374
+ limit?: number;
1375
+ }
1376
+ declare function estimateContextUsage(input: ContextEstimateInput): ContextUsage;
1377
+ //#endregion
1282
1378
  //#region src/cli/configs/schemas.d.ts
1283
1379
  declare const BraveProviderConfigSchema: z.ZodObject<{
1284
1380
  "api-key": z.ZodString;
@@ -1495,4 +1591,4 @@ declare class LocalFileStore implements FileStore {
1495
1591
  write(path: string, content: string): Promise<void>;
1496
1592
  }
1497
1593
  //#endregion
1498
- export { type AIProvider, type ActionPart, type ActionResult, Agent, type AgentConfig, type AgentEvent, type AgentEventCallback, type AgentHandle, type AgentMemory, type AgentResult, Anthropic, AxleAbortError, AxleAgentAbortError, type AxleAssistantMessage, AxleError, type AxleMessage, AxleStopReason, type AxleToolCallMessage, type AxleToolCallResult, AxleToolFatalError, type AxleUserMessage, type ContentPart, type ContentPartFile, type ContentPartProviderTool, type ContentPartText, type ContentPartThinking, type ContentPartToolCall, type DeferredFileInfo, type EventLevel, type ExecutableTool, type FileInfo, type FileKind, type FilePart, type FileProviderId, type FileResolveFormat, type FileResolveRequest, type FileResolver, type FileStore, Gemini, type GenerateInstructOptions, type GenerateInstructResult, type Handle, History, Instruct, type InstructInputs, type InstructOptions, type InstructResponse, type InstructVarsMode, LocalFileStore, MCP, type MCPConfig, type MCPHttpConfig, type MCPStdioConfig, type MemoryContext, OpenAI, ProceduralMemory, type ProceduralMemoryConfig, type ProviderTool, type ProviderToolAction, type RecallResult, type ResolvedFileSource, type SendMessageOptions, SimpleWriter, type SimpleWriterOptions, type SpanData, type SpanOptions, type SpanType, type StreamEvent, type StreamEventCallback, type StreamHandle, type StreamInstructHandle, type StreamInstructOptions, type StreamInstructResult, type StreamResult, type SubagentAction, TaskError, type TextPart, type ThinkingPart, type ToolAction, type ToolContext, type ToolDefinition, ToolRegistry, type ToolResultPart, type TraceWriter, Tracer, type TracingContext, type Turn, TurnBuilder, type TurnPart, type TurnStatus, anthropic, braveSearchTool, calculatorTool, chatCompletions, createHandle, execTool, gemini, generate, generateTurn, loadFileContent, openai, parseResponse, patchFileTool, readFileTool, stream, writeFileTool };
1594
+ export { type AIProvider, type ActionPart, type ActionResult, Agent, type AgentConfig, type AgentEvent, type AgentEventCallback, type AgentHandle, type AgentMemory, type AgentResult, Anthropic, AxleAbortError, AxleAgentAbortError, type AxleAssistantMessage, AxleError, type AxleMessage, type AxleModelRequestOptions, AxleStopReason, type AxleToolCallMessage, type AxleToolCallResult, AxleToolFatalError, type AxleUserMessage, type ContentPart, type ContentPartFile, type ContentPartProviderTool, type ContentPartText, type ContentPartThinking, type ContentPartToolCall, type ContextUsage, type DeferredFileInfo, type EventLevel, type ExecutableTool, type FileInfo, type FileKind, type FilePart, type FileProviderId, type FileResolveFormat, type FileResolveRequest, type FileResolver, type FileStore, Gemini, type GenerateInstructParams, type GenerateInstructResult, type GenerateParams, type Handle, History, Instruct, type InstructInputs, type InstructOptions, type InstructResponse, InstructVariableError, type InstructVarsMode, LocalFileStore, MCP, type MCPConfig, type MCPHttpConfig, type MCPStdioConfig, type MemoryContext, OpenAI, ProceduralMemory, type ProceduralMemoryConfig, type ProviderOptions, type ProviderTool, type ProviderToolAction, type RecallResult, type ResolvedFileSource, type SendMessageOptions, SimpleWriter, type SimpleWriterOptions, type SpanData, type SpanOptions, type SpanType, type StreamEvent, type StreamEventCallback, type StreamHandle, type StreamInstructHandle, type StreamInstructParams, type StreamInstructResult, type StreamParams, type StreamResult, type SubagentAction, TaskError, type TextPart, type ThinkingPart, type ToolAction, type ToolChoice, type ToolContext, type ToolDefinition, ToolRegistry, type ToolResultPart, type TraceWriter, Tracer, type TracingContext, type Turn, TurnBuilder, type TurnPart, type TurnStatus, anthropic, braveSearchTool, calculatorTool, chatCompletions, createHandle, estimateContextUsage, execTool, gemini, generate, generateTurn, loadFileContent, openai, parseResponse, patchFileTool, readFileTool, stream, writeFileTool };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as e,C as t,D as n,E as r,M as i,O as a,S as o,T as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,j as _,k as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D,w as O,x as k,y as A}from"./ProceduralMemory-9bDT803s.js";import{i as j,o as M,r as N,s as P,t as F,u as I}from"./models-DlE4tfcj.js";import"./models-CKz-RHh1.js";var L=class e extends i{constructor(t,n){super(t,{code:`TASK_ERROR`,id:n?.id,details:{taskType:n?.taskType,taskIndex:n?.taskIndex,...n?.details},cause:n?.cause}),Object.setPrototypeOf(this,e.prototype)}};const R={Models:I,DefaultModel:P},z={Models:M,DefaultModel:j},B={Models:N,DefaultModel:F};export{u as Agent,R as Anthropic,_ as AxleAbortError,e as AxleAgentAbortError,i as AxleError,r as AxleStopReason,v as AxleToolFatalError,z as Gemini,k as History,A as Instruct,O as LocalFileStore,g as MCP,B as OpenAI,E as ProceduralMemory,x as SimpleWriter,L as TaskError,n as ToolRegistry,w as Tracer,t as TurnBuilder,m as anthropic,D as braveSearchTool,y as calculatorTool,h as chatCompletions,o as createHandle,d as execTool,b as gemini,p as generate,C as generateTurn,c as loadFileContent,f as openai,a as parseResponse,T as patchFileTool,S as readFileTool,s as stream,l as writeFileTool};
1
+ import{C as e,D as t,E as n,F as r,I as i,M as a,N as o,O as s,P as c,S as l,T as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,j as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,w as A,x as j,y as M}from"./ProceduralMemory-DI4cTlDN.js";import{i as N,o as P,r as F,s as I,t as L,u as R}from"./models-DnS0bPB-.js";import"./models-H-N2HJJz.js";var z=class e extends i{constructor(t,n){super(t,{code:`TASK_ERROR`,id:n?.id,details:{taskType:n?.taskType,taskIndex:n?.taskIndex,...n?.details},cause:n?.cause}),Object.setPrototypeOf(this,e.prototype)}};const B={Models:R,DefaultModel:I},V={Models:P,DefaultModel:N},H={Models:F,DefaultModel:L};export{j as Agent,B as Anthropic,r as AxleAbortError,c as AxleAgentAbortError,i as AxleError,t as AxleStopReason,o as AxleToolFatalError,V as Gemini,l as History,M as Instruct,p as InstructVariableError,u as LocalFileStore,y as MCP,H as OpenAI,O as ProceduralMemory,C as SimpleWriter,z as TaskError,s as ToolRegistry,E as Tracer,A as TurnBuilder,_ as anthropic,k as braveSearchTool,x as calculatorTool,v as chatCompletions,e as createHandle,a as estimateContextUsage,m as execTool,S as gemini,g as generate,T as generateTurn,d as loadFileContent,h as openai,b as parseResponse,D as patchFileTool,w as readFileTool,n as stream,f as writeFileTool};
@@ -22,6 +22,7 @@ declare const DEFAULT_MODEL$3: "claude-haiku-4-5-20251001";
22
22
  //#region src/providers/chatcompletions/models.d.ts
23
23
  declare const Models$2: {
24
24
  readonly QWEN_3_6_35B_A3B: "qwen/qwen3.6-35b-a3b";
25
+ readonly QWEN_3_6_PLUS: "qwen/qwen3.6-plus";
25
26
  readonly GEMMA_4_26B_A4B_IT: "google/gemma-4-26b-a4b-it";
26
27
  readonly MINISTRAL_3_8B: "mistralai/ministral-8b-2512";
27
28
  readonly MISTRAL_SMALL_4: "mistralai/mistral-small-2603";
@@ -42,6 +43,7 @@ declare const Models$1: {
42
43
  readonly GEMINI_3_PRO: "gemini-3-pro-preview";
43
44
  readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
44
45
  readonly GEMINI_3_FLASH: "gemini-3-flash-preview";
46
+ readonly GEMINI_3_5_FLASH: "gemini-3.5-flash";
45
47
  readonly GEMINI_2_5_PRO: "gemini-2.5-pro";
46
48
  readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
47
49
  readonly GEMINI_2_5_FLASH_LITE: "gemini-2.5-flash-lite";
@@ -53,7 +55,7 @@ declare const Models$1: {
53
55
  readonly GEMINI_FLASH_LITE_LATEST: "gemini-flash-lite-latest";
54
56
  readonly GEMINI_PRO_LATEST: "gemini-pro-latest";
55
57
  };
56
- declare const MULTIMODAL_MODELS$1: readonly ["gemini-3.1-pro-preview", "gemini-3.1-pro-preview-customtools", "gemini-3.1-flash-lite-preview", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-pro-latest"];
58
+ declare const MULTIMODAL_MODELS$1: readonly ["gemini-3.1-pro-preview", "gemini-3.1-pro-preview-customtools", "gemini-3.1-flash-lite-preview", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-3.5-flash", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-pro-latest"];
57
59
  declare const DEFAULT_MODEL$1: "gemini-3.1-flash-lite-preview";
58
60
  //#endregion
59
61
  //#region src/providers/openai/models.d.ts
@@ -0,0 +1 @@
1
+ const e={CLAUDE_OPUS_4_7:`claude-opus-4-7`,CLAUDE_SONNET_4_6:`claude-sonnet-4-6`,CLAUDE_OPUS_4_6:`claude-opus-4-6`,CLAUDE_OPUS_4_5_20251101:`claude-opus-4-5-20251101`,CLAUDE_OPUS_4_5:`claude-opus-4-5-20251101`,CLAUDE_SONNET_4_5_20250929:`claude-sonnet-4-5-20250929`,CLAUDE_SONNET_4_5:`claude-sonnet-4-5-20250929`,CLAUDE_HAIKU_4_5_20251001:`claude-haiku-4-5-20251001`,CLAUDE_HAIKU_4_5:`claude-haiku-4-5-20251001`,CLAUDE_OPUS_4_1_20250805:`claude-opus-4-1-20250805`,CLAUDE_OPUS_4_1:`claude-opus-4-1-20250805`,CLAUDE_OPUS_4_20250514:`claude-opus-4-20250514`,CLAUDE_OPUS_4:`claude-opus-4-20250514`,CLAUDE_SONNET_4_20250514:`claude-sonnet-4-20250514`,CLAUDE_SONNET_4:`claude-sonnet-4-20250514`},t=[e.CLAUDE_OPUS_4_7,e.CLAUDE_SONNET_4_6,e.CLAUDE_OPUS_4_6,e.CLAUDE_OPUS_4_5,e.CLAUDE_SONNET_4_5,e.CLAUDE_HAIKU_4_5,e.CLAUDE_OPUS_4_1,e.CLAUDE_OPUS_4,e.CLAUDE_SONNET_4],n={[e.CLAUDE_OPUS_4_7]:128e3,[e.CLAUDE_OPUS_4_6]:128e3,[e.CLAUDE_SONNET_4_6]:64e3,[e.CLAUDE_OPUS_4_5]:64e3,[e.CLAUDE_SONNET_4_5]:64e3,[e.CLAUDE_HAIKU_4_5]:64e3,[e.CLAUDE_SONNET_4]:64e3,[e.CLAUDE_OPUS_4_1]:32e3,[e.CLAUDE_OPUS_4]:32e3},r=e.CLAUDE_HAIKU_4_5,i={GEMINI_3_1_PRO_PREVIEW:`gemini-3.1-pro-preview`,GEMINI_3_1_PRO:`gemini-3.1-pro-preview`,GEMINI_3_1_PRO_PREVIEW_CUSTOMTOOLS:`gemini-3.1-pro-preview-customtools`,GEMINI_3_1_FLASH_LITE_PREVIEW:`gemini-3.1-flash-lite-preview`,GEMINI_3_1_FLASH_LITE:`gemini-3.1-flash-lite-preview`,GEMINI_3_PRO_PREVIEW:`gemini-3-pro-preview`,GEMINI_3_PRO:`gemini-3-pro-preview`,GEMINI_3_FLASH_PREVIEW:`gemini-3-flash-preview`,GEMINI_3_FLASH:`gemini-3-flash-preview`,GEMINI_3_5_FLASH:`gemini-3.5-flash`,GEMINI_2_5_PRO:`gemini-2.5-pro`,GEMINI_2_5_FLASH:`gemini-2.5-flash`,GEMINI_2_5_FLASH_LITE:`gemini-2.5-flash-lite`,GEMINI_2_0_FLASH:`gemini-2.0-flash`,GEMINI_2_0_FLASH_001:`gemini-2.0-flash-001`,GEMINI_2_0_FLASH_LITE:`gemini-2.0-flash-lite`,GEMINI_2_0_FLASH_LITE_001:`gemini-2.0-flash-lite-001`,GEMINI_FLASH_LATEST:`gemini-flash-latest`,GEMINI_FLASH_LITE_LATEST:`gemini-flash-lite-latest`,GEMINI_PRO_LATEST:`gemini-pro-latest`},a=[i.GEMINI_3_1_PRO,i.GEMINI_3_1_PRO_PREVIEW_CUSTOMTOOLS,i.GEMINI_3_1_FLASH_LITE,i.GEMINI_3_PRO,i.GEMINI_3_FLASH,i.GEMINI_3_5_FLASH,i.GEMINI_2_5_PRO,i.GEMINI_2_5_FLASH,i.GEMINI_2_5_FLASH_LITE,i.GEMINI_2_0_FLASH,i.GEMINI_2_0_FLASH_LITE,i.GEMINI_FLASH_LATEST,i.GEMINI_FLASH_LITE_LATEST,i.GEMINI_PRO_LATEST],o=i.GEMINI_3_1_FLASH_LITE,s={GPT_5_5_2026_04_23:`gpt-5.5-2026-04-23`,GPT_5_5:`gpt-5.5`,GPT_5_5_PRO_2026_04_23:`gpt-5.5-pro-2026-04-23`,GPT_5_5_PRO:`gpt-5.5-pro`,GPT_5_4_2026_03_05:`gpt-5.4-2026-03-05`,GPT_5_4:`gpt-5.4`,GPT_5_4_PRO_2026_03_05:`gpt-5.4-pro-2026-03-05`,GPT_5_4_PRO:`gpt-5.4-pro`,GPT_5_4_MINI_2026_03_17:`gpt-5.4-mini-2026-03-17`,GPT_5_4_MINI:`gpt-5.4-mini`,GPT_5_4_NANO_2026_03_17:`gpt-5.4-nano-2026-03-17`,GPT_5_4_NANO:`gpt-5.4-nano`,GPT_5_3_CHAT_LATEST:`gpt-5.3-chat-latest`,GPT_5_2_2025_12_11:`gpt-5.2-2025-12-11`,GPT_5_2:`gpt-5.2`,GPT_5_2_CHAT_LATEST:`gpt-5.2-chat-latest`,GPT_5_2_PRO_2025_12_11:`gpt-5.2-pro-2025-12-11`,GPT_5_2_PRO:`gpt-5.2-pro`,GPT_5_1_2025_11_13:`gpt-5.1-2025-11-13`,GPT_5_1:`gpt-5.1`,GPT_5_1_CHAT_LATEST:`gpt-5.1-chat-latest`,GPT_5_2025_08_07:`gpt-5-2025-08-07`,GPT_5:`gpt-5`,GPT_5_CHAT_LATEST:`gpt-5-chat-latest`,GPT_5_PRO_2025_10_06:`gpt-5-pro-2025-10-06`,GPT_5_PRO:`gpt-5-pro`,GPT_5_MINI_2025_08_07:`gpt-5-mini-2025-08-07`,GPT_5_MINI:`gpt-5-mini`,GPT_5_NANO_2025_08_07:`gpt-5-nano-2025-08-07`,GPT_5_NANO:`gpt-5-nano`,GPT_4_1_2025_04_14:`gpt-4.1-2025-04-14`,GPT_4_1:`gpt-4.1`,GPT_4_1_MINI_2025_04_14:`gpt-4.1-mini-2025-04-14`,GPT_4_1_MINI:`gpt-4.1-mini`,GPT_4_1_NANO_2025_04_14:`gpt-4.1-nano-2025-04-14`,GPT_4_1_NANO:`gpt-4.1-nano`,GPT_4O_2024_11_20:`gpt-4o-2024-11-20`,GPT_4O:`gpt-4o`,GPT_4O_MINI_2024_07_18:`gpt-4o-mini-2024-07-18`,GPT_4O_MINI:`gpt-4o-mini`,O4_MINI_2025_04_16:`o4-mini-2025-04-16`,O4_MINI:`o4-mini`,O3_2025_04_16:`o3-2025-04-16`,O3:`o3`,O3_PRO_2025_06_10:`o3-pro-2025-06-10`,O3_PRO:`o3-pro`,O3_MINI_2025_01_31:`o3-mini-2025-01-31`,O3_MINI:`o3-mini`},c=[s.GPT_5_5,s.GPT_5_5_PRO,s.GPT_5_4,s.GPT_5_4_PRO,s.GPT_5_4_MINI,s.GPT_5_4_NANO,s.GPT_5_3_CHAT_LATEST,s.GPT_5_2,s.GPT_5_2_CHAT_LATEST,s.GPT_5_2_PRO,s.GPT_5_1,s.GPT_5_1_CHAT_LATEST,s.GPT_5,s.GPT_5_CHAT_LATEST,s.GPT_5_PRO,s.GPT_5_MINI,s.GPT_5_NANO,s.GPT_4_1,s.GPT_4_1_MINI,s.GPT_4_1_NANO,s.GPT_4O,s.GPT_4O_MINI,s.O4_MINI,s.O3,s.O3_PRO,s.O3_MINI],l=s.GPT_5_4_MINI;export{a,n as c,o as i,t as l,c as n,i as o,s as r,r as s,l as t,e as u};
@@ -0,0 +1 @@
1
+ const e={QWEN_3_6_35B_A3B:`qwen/qwen3.6-35b-a3b`,QWEN_3_6_PLUS:`qwen/qwen3.6-plus`,GEMMA_4_26B_A4B_IT:`google/gemma-4-26b-a4b-it`,MINISTRAL_3_8B:`mistralai/ministral-8b-2512`,MISTRAL_SMALL_4:`mistralai/mistral-small-2603`,DEEPSEEK_V4_FLASH:`deepseek/deepseek-v4-flash`,MINIMAX_M2:`minimax/minimax-m2`},t=[e.QWEN_3_6_35B_A3B,e.GEMMA_4_26B_A4B_IT,e.MINISTRAL_3_8B,e.MISTRAL_SMALL_4,e.DEEPSEEK_V4_FLASH,e.MINIMAX_M2],n=e.QWEN_3_6_35B_A3B;export{e as n,t as r,n as t};
@@ -1,2 +1,2 @@
1
- import { a as MULTIMODAL_MODELS$1, c as Models$1, d as MULTIMODAL_MODELS, f as Models, i as DEFAULT_MODEL$2, l as SMALL_OPEN_WEIGHT_MODELS, n as MULTIMODAL_MODELS$2, o as Models$2, r as Models$3, s as DEFAULT_MODEL$1, t as DEFAULT_MODEL$3, u as DEFAULT_MODEL } from "../models-CI5k-LHn.js";
1
+ import { a as MULTIMODAL_MODELS$1, c as Models$1, d as MULTIMODAL_MODELS, f as Models, i as DEFAULT_MODEL$2, l as SMALL_OPEN_WEIGHT_MODELS, n as MULTIMODAL_MODELS$2, o as Models$2, r as Models$3, s as DEFAULT_MODEL$1, t as DEFAULT_MODEL$3, u as DEFAULT_MODEL } from "../models-CEgbBKiL.js";
2
2
  export { DEFAULT_MODEL as ANTHROPIC_DEFAULT_MODEL, MULTIMODAL_MODELS as ANTHROPIC_MULTIMODAL_MODELS, Models as AnthropicModels, DEFAULT_MODEL$1 as CHAT_COMPLETIONS_DEFAULT_MODEL, SMALL_OPEN_WEIGHT_MODELS as CHAT_COMPLETIONS_SMALL_OPEN_WEIGHT_MODELS, Models$1 as ChatCompletionsModels, DEFAULT_MODEL$2 as GEMINI_DEFAULT_MODEL, MULTIMODAL_MODELS$1 as GEMINI_MULTIMODAL_MODELS, Models$2 as GeminiModels, DEFAULT_MODEL$3 as OPENAI_DEFAULT_MODEL, MULTIMODAL_MODELS$2 as OPENAI_MULTIMODAL_MODELS, Models$3 as OpenAIModels };
@@ -1 +1 @@
1
- import{a as e,i as t,l as n,n as r,o as i,r as a,s as o,t as s,u as c}from"../models-DlE4tfcj.js";import{n as l,r as u,t as d}from"../models-CKz-RHh1.js";export{o as ANTHROPIC_DEFAULT_MODEL,n as ANTHROPIC_MULTIMODAL_MODELS,c as AnthropicModels,d as CHAT_COMPLETIONS_DEFAULT_MODEL,u as CHAT_COMPLETIONS_SMALL_OPEN_WEIGHT_MODELS,l as ChatCompletionsModels,t as GEMINI_DEFAULT_MODEL,e as GEMINI_MULTIMODAL_MODELS,i as GeminiModels,s as OPENAI_DEFAULT_MODEL,r as OPENAI_MULTIMODAL_MODELS,a as OpenAIModels};
1
+ import{a as e,i as t,l as n,n as r,o as i,r as a,s as o,t as s,u as c}from"../models-DnS0bPB-.js";import{n as l,r as u,t as d}from"../models-H-N2HJJz.js";export{o as ANTHROPIC_DEFAULT_MODEL,n as ANTHROPIC_MULTIMODAL_MODELS,c as AnthropicModels,d as CHAT_COMPLETIONS_DEFAULT_MODEL,u as CHAT_COMPLETIONS_SMALL_OPEN_WEIGHT_MODELS,l as ChatCompletionsModels,t as GEMINI_DEFAULT_MODEL,e as GEMINI_MULTIMODAL_MODELS,i as GeminiModels,s as OPENAI_DEFAULT_MODEL,r as OPENAI_MULTIMODAL_MODELS,a as OpenAIModels};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fifthrevision/axle",
3
- "version": "0.16.3",
3
+ "version": "0.18.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/johncch/axle.git"
@@ -33,7 +33,8 @@
33
33
  "changelog": "pnpm start -j ./jobs/changelog.job.yml --args",
34
34
  "update-models": "pnpm start -j ./jobs/bootstrap-models.job.yml",
35
35
  "release": "pnpm test && pnpm run build && npm version",
36
- "cut-release": "node scripts/cut-release.mjs"
36
+ "cut-release": "node scripts/cut-release.mjs",
37
+ "smoke-test": "pnpm exec tsx checks/baseline/run.ts"
37
38
  },
38
39
  "author": "Chong Han Chua",
39
40
  "license": "ISC",