@fifthrevision/axle 0.26.0 → 0.27.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.
@@ -886,6 +886,11 @@ interface Turn<TAnnotation extends Annotation = Annotation> {
886
886
  timing?: TimingInfo;
887
887
  /** Token usage accumulated for this turn, when available. */
888
888
  usage?: Stats;
889
+ /** Terminal model or provider error associated with this turn. */
890
+ error?: {
891
+ type: string;
892
+ message: string;
893
+ };
889
894
  }
890
895
  /**
891
896
  * Any renderable part within a turn.
@@ -1189,6 +1194,7 @@ type TurnEvent<TAnnotation extends Annotation = Annotation> = {
1189
1194
  event: TurnEvent<TAnnotation>;
1190
1195
  } | AnnotationEvent<TAnnotation> | {
1191
1196
  type: "error";
1197
+ turnId?: string;
1192
1198
  error: {
1193
1199
  type: string;
1194
1200
  message: string;
@@ -1 +1 @@
1
- const e=new Set(Object.keys({"session:restore":!0,"turn:user":!0,"turn:start":!0,"turn:end":!0,"compaction:start":!0,"compaction:end":!0,"part:start":!0,"text:delta":!0,"text:citation":!0,"thinking:delta":!0,"thinking:summary-delta":!0,"thinking:update":!0,"part:end":!0,"action:args-delta":!0,"action:running":!0,"action:progress":!0,"action:complete":!0,"action:error":!0,"action:child-event":!0,"annotation:start":!0,"annotation:update":!0,"annotation:end":!0,error:!0}));function t(t){return e.has(t.type)}var n=class e{_state;constructor(e){this._state={turns:e?.turns??[],sessionAnnotations:e?.sessionAnnotations}}get state(){return this._state}apply(e){return t(e)?this.applyTurnEvent(e):{handled:!1,state:this._state,event:e}}applyTurnEvent(t){switch(t.type){case`session:restore`:return this.replaceState({turns:t.turns??[],sessionAnnotations:t.sessionAnnotations},t);case`turn:user`:return this.replaceTurns([...this._state.turns,t.turn],t);case`turn:start`:{let e={id:t.turnId,owner:`agent`,parts:[],status:`streaming`,...t.timing?{timing:t.timing}:{}};return this.replaceTurns([...this._state.turns,e],t)}case`compaction:start`:{let e={id:t.id,owner:`agent`,parts:[{id:t.id,type:`compaction`}],status:`streaming`,...t.timing?{timing:t.timing}:{}};return this.replaceTurns([...this._state.turns,e],t)}case`compaction:end`:{if(t.outcome===`skipped`){let e=this._state.turns.filter(e=>e.id!==t.id);return e.length===this._state.turns.length?this.handled(t):this.replaceTurns(e,t)}let e=t.outcome===`complete`?`complete`:`error`,n=!1,r=this._state.turns.map(r=>r.id===t.id?(n=!0,{...r,status:e,parts:r.parts.map(e=>e.type===`compaction`&&t.record?{...e,record:t.record}:e),timing:t.timing??r.timing}):r);return n?this.replaceTurns(r,t):this.handled(t)}case`part:start`:return this.updateTurn(t.turnId,t,e=>({...e,parts:[...e.parts,t.part]}));case`text:delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`text`?{...e,text:e.text+t.delta}:e);case`text:citation`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`text`?{...e,citations:[...e.citations??[],t.citation]}:e);case`thinking:delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,text:(e.text??``)+t.delta}:e);case`thinking:summary-delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,summary:(e.summary??``)+t.delta}:e);case`thinking:update`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,...t.redacted===void 0?{}:{redacted:t.redacted},...t.continuity?{continuity:t.continuity}:{},...t.providerMetadata?{providerMetadata:t.providerMetadata}:{}}:e);case`part:end`:return this.updatePart(t.turnId,t.partId,t,e=>({...e,timing:t.timing??e.timing}));case`action:args-delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type!==`action`||e.kind!==`tool`?e:{...e,detail:{...e.detail,pendingArgs:t.accumulated}});case`action:running`:return this.updatePart(t.turnId,t.partId,t,e=>{if(e.type!==`action`)return e;if(e.kind===`tool`){let{pendingArgs:n,...r}=e.detail;return{...e,status:`running`,detail:t.parameters?{...r,parameters:t.parameters}:r}}return{...e,status:`running`}});case`action:progress`:return this.updatePart(t.turnId,t.partId,t,e=>{if(e.type!==`action`)return e;let n=e.detail.result,r=n?.type===`in-progress`?n.content:``;return{...e,detail:{...e.detail,result:{type:`in-progress`,content:r+t.chunk}}}});case`action:complete`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`action`?{...e,status:`complete`,detail:{...e.detail,result:t.result},timing:t.timing??e.timing}:e);case`action:error`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`action`?{...e,status:`error`,detail:{...e.detail,result:{type:`error`,error:t.error}},timing:t.timing??e.timing}:e);case`turn:end`:return this.updateTurn(t.turnId,t,e=>({...e,status:t.status,usage:t.usage,timing:t.timing??e.timing}));case`annotation:start`:return this.addAnnotation(t);case`annotation:update`:return this.replaceAnnotation(t,!1);case`annotation:end`:return this.replaceAnnotation(t,!0);case`error`:return this.handled(t);case`action:child-event`:return this.updatePart(t.turnId,t.partId,t,n=>{if(n.type!==`action`||n.kind!==`agent`)return n;let r=new e({turns:n.detail.children}).apply(t.event);return{...n,detail:{...n.detail,children:r.state.turns}}});default:return this.handled(t)}}replaceState(e,t){return this._state=e,this.handled(t)}replaceTurns(e,t){return this.replaceState({...this._state,turns:e},t)}updateTurn(e,t,n){let r=!1,i=this._state.turns.map(t=>{if(t.id!==e)return t;let i=n(t);return i===t?t:(r=!0,i)});return r?this.replaceTurns(i,t):this.handled(t)}updatePart(e,t,n,r){return this.updateTurn(e,n,e=>{let n=!1,i=e.parts.map(e=>{if(e.id!==t)return e;let i=r(e);return i===e?e:(n=!0,i)});return n?{...e,parts:i}:e})}addAnnotation(e){let t=e.target,n=r(e.annotation);return n?t.type===`session`?this.replaceState({...this._state,sessionAnnotations:[...this._state.sessionAnnotations??[],n]},e):t.type===`turn`?this.updateTurn(t.turnId,e,e=>({...e,annotations:[...e.annotations??[],n]})):this.updatePart(t.turnId,t.partId,e,e=>({...e,annotations:[...e.annotations??[],n]})):this.handled(e)}replaceAnnotation(e,t){let n=e.target,a=r(e.annotation,t);if(!a)return this.handled(e);if(n.type===`session`){let t=i(this._state.sessionAnnotations,a);return t?this.replaceState({...this._state,sessionAnnotations:t},e):this.handled(e)}return n.type===`turn`?this.updateTurn(n.turnId,e,e=>{let t=i(e.annotations,a);return t?{...e,annotations:t}:e}):this.updatePart(n.turnId,n.partId,e,e=>{let t=i(e.annotations,a);return t?{...e,annotations:t}:e})}handled(e){return{handled:!0,state:this._state,event:e}}};function r(e,t=!1){if(!e)return;let n=t?e.status??`complete`:e.status,r={...e,placement:e.placement??`after`};return n?{...r,status:n}:r}function i(e,t){if(!e)return;let n=!1,r=e.map(e=>e.id===t.id?(n=!0,t):e);return n?r:void 0}export{n as t};
1
+ const e=new Set(Object.keys({"session:restore":!0,"turn:user":!0,"turn:start":!0,"turn:end":!0,"compaction:start":!0,"compaction:end":!0,"part:start":!0,"text:delta":!0,"text:citation":!0,"thinking:delta":!0,"thinking:summary-delta":!0,"thinking:update":!0,"part:end":!0,"action:args-delta":!0,"action:running":!0,"action:progress":!0,"action:complete":!0,"action:error":!0,"action:child-event":!0,"annotation:start":!0,"annotation:update":!0,"annotation:end":!0,error:!0}));function t(t){return e.has(t.type)}var n=class e{_state;constructor(e){this._state={turns:e?.turns??[],sessionAnnotations:e?.sessionAnnotations}}get state(){return this._state}apply(e){return t(e)?this.applyTurnEvent(e):{handled:!1,state:this._state,event:e}}applyTurnEvent(t){switch(t.type){case`session:restore`:return this.replaceState({turns:t.turns??[],sessionAnnotations:t.sessionAnnotations},t);case`turn:user`:return this.replaceTurns([...this._state.turns,t.turn],t);case`turn:start`:{let e={id:t.turnId,owner:`agent`,parts:[],status:`streaming`,...t.timing?{timing:t.timing}:{}};return this.replaceTurns([...this._state.turns,e],t)}case`compaction:start`:{let e={id:t.id,owner:`agent`,parts:[{id:t.id,type:`compaction`}],status:`streaming`,...t.timing?{timing:t.timing}:{}};return this.replaceTurns([...this._state.turns,e],t)}case`compaction:end`:{if(t.outcome===`skipped`){let e=this._state.turns.filter(e=>e.id!==t.id);return e.length===this._state.turns.length?this.handled(t):this.replaceTurns(e,t)}let e=t.outcome===`complete`?`complete`:`error`,n=!1,r=this._state.turns.map(r=>r.id===t.id?(n=!0,{...r,status:e,parts:r.parts.map(e=>e.type===`compaction`&&t.record?{...e,record:t.record}:e),timing:t.timing??r.timing}):r);return n?this.replaceTurns(r,t):this.handled(t)}case`part:start`:return this.updateTurn(t.turnId,t,e=>({...e,parts:[...e.parts,t.part]}));case`text:delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`text`?{...e,text:e.text+t.delta}:e);case`text:citation`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`text`?{...e,citations:[...e.citations??[],t.citation]}:e);case`thinking:delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,text:(e.text??``)+t.delta}:e);case`thinking:summary-delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,summary:(e.summary??``)+t.delta}:e);case`thinking:update`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,...t.redacted===void 0?{}:{redacted:t.redacted},...t.continuity?{continuity:t.continuity}:{},...t.providerMetadata?{providerMetadata:t.providerMetadata}:{}}:e);case`part:end`:return this.updatePart(t.turnId,t.partId,t,e=>({...e,timing:t.timing??e.timing}));case`action:args-delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type!==`action`||e.kind!==`tool`?e:{...e,detail:{...e.detail,pendingArgs:t.accumulated}});case`action:running`:return this.updatePart(t.turnId,t.partId,t,e=>{if(e.type!==`action`)return e;if(e.kind===`tool`){let{pendingArgs:n,...r}=e.detail;return{...e,status:`running`,detail:t.parameters?{...r,parameters:t.parameters}:r}}return{...e,status:`running`}});case`action:progress`:return this.updatePart(t.turnId,t.partId,t,e=>{if(e.type!==`action`)return e;let n=e.detail.result,r=n?.type===`in-progress`?n.content:``;return{...e,detail:{...e.detail,result:{type:`in-progress`,content:r+t.chunk}}}});case`action:complete`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`action`?{...e,status:`complete`,detail:{...e.detail,result:t.result},timing:t.timing??e.timing}:e);case`action:error`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`action`?{...e,status:`error`,detail:{...e.detail,result:{type:`error`,error:t.error}},timing:t.timing??e.timing}:e);case`turn:end`:return this.updateTurn(t.turnId,t,e=>({...e,status:t.status,usage:t.usage,timing:t.timing??e.timing}));case`annotation:start`:return this.addAnnotation(t);case`annotation:update`:return this.replaceAnnotation(t,!1);case`annotation:end`:return this.replaceAnnotation(t,!0);case`error`:return t.turnId?this.updateTurn(t.turnId,t,e=>({...e,error:t.error})):this.handled(t);case`action:child-event`:return this.updatePart(t.turnId,t.partId,t,n=>{if(n.type!==`action`||n.kind!==`agent`)return n;let r=new e({turns:n.detail.children}).apply(t.event);return{...n,detail:{...n.detail,children:r.state.turns}}});default:return this.handled(t)}}replaceState(e,t){return this._state=e,this.handled(t)}replaceTurns(e,t){return this.replaceState({...this._state,turns:e},t)}updateTurn(e,t,n){let r=!1,i=this._state.turns.map(t=>{if(t.id!==e)return t;let i=n(t);return i===t?t:(r=!0,i)});return r?this.replaceTurns(i,t):this.handled(t)}updatePart(e,t,n,r){return this.updateTurn(e,n,e=>{let n=!1,i=e.parts.map(e=>{if(e.id!==t)return e;let i=r(e);return i===e?e:(n=!0,i)});return n?{...e,parts:i}:e})}addAnnotation(e){let t=e.target,n=r(e.annotation);return n?t.type===`session`?this.replaceState({...this._state,sessionAnnotations:[...this._state.sessionAnnotations??[],n]},e):t.type===`turn`?this.updateTurn(t.turnId,e,e=>({...e,annotations:[...e.annotations??[],n]})):this.updatePart(t.turnId,t.partId,e,e=>({...e,annotations:[...e.annotations??[],n]})):this.handled(e)}replaceAnnotation(e,t){let n=e.target,a=r(e.annotation,t);if(!a)return this.handled(e);if(n.type===`session`){let t=i(this._state.sessionAnnotations,a);return t?this.replaceState({...this._state,sessionAnnotations:t},e):this.handled(e)}return n.type===`turn`?this.updateTurn(n.turnId,e,e=>{let t=i(e.annotations,a);return t?{...e,annotations:t}:e}):this.updatePart(n.turnId,n.partId,e,e=>{let t=i(e.annotations,a);return t?{...e,annotations:t}:e})}handled(e){return{handled:!0,state:this._state,event:e}}};function r(e,t=!1){if(!e)return;let n=t?e.status??`complete`:e.status,r={...e,placement:e.placement??`after`};return n?{...r,status:n}:r}function i(e,t){if(!e)return;let n=!1,r=e.map(e=>e.id===t.id?(n=!0,t):e);return n?r:void 0}export{n as t};
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ToolResultPart, A as TurnMetadata, At as SpanResult, B as Citation, C as ProviderToolAction, Ct as LLMRequest, Dt as SpanData, E as ThinkingPart, Et as Span, F as AxleAssistantMessage, Ft as TraceWriter, G as ContentPartFile, H as CitationSource, I as AxleMessage, J as ContentPartThinking, K as ContentPartProviderTool, L as AxleToolCallMessage, M as TurnStatus, Mt as SpanType, N as CompactionRecord, Nt as TokenUsage, O as ToolAction, Ot as SpanEvent, P as validateCompactedMessages, Pt as ToolResult, Q as ThinkingContinuity, R as AxleToolCallResult, S as FilePart, St as EventLevel, T as TextPart, Tt as LLMResult, U as ContentPart, V as CitationOutputSpan, W as ContentPartCitation, X as DocumentLocator, Y as ContentPartToolCall, Z as MessageMetadata, _ as Annotation, _t as ResolvedFileSource, at as ModelResult, b as CitationPart, bt as TokenStats, c as ToolContext, ct as ResolvedProviderTool, d as ToolRegistry, dt as FileInfo, et as AIProvider, f as AnnotationEvent, ft as FileKind, g as ActionResult, gt as FileResolver, h as ActionPart, ht as FileResolveRequest, i as TurnAccumulatorState, it as ModelError, j as TurnPart, jt as SpanStatus, k as Turn, kt as SpanOptions, l as ToolDefinition, lt as ToolChoice, m as TurnEvent, mt as FileResolveFormat, n as TurnAccumulator, nt as AxleStopReason, o as ExecutableTool, ot as ProviderClientOptions, p as AnnotationTarget, pt as FileProviderId, q as ContentPartText, r as TurnAccumulatorResult, rt as ContextUsage, s as ProviderTool, st as ProviderOptions, t as AccumulatableEvent, tt as AxleModelRequestOptions, u as ToolProgressChunk, ut as DeferredFileInfo, v as AnnotationPlacement, vt as loadFileContent, w as SubagentAction, wt as LLMResponse, x as CompactionPart, xt as UsageEntry, y as AnnotationStatus, yt as Stats, z as AxleUserMessage } from "./accumulator-BQ_1i4qv.js";
1
+ import { $ as ToolResultPart, A as TurnMetadata, At as SpanResult, B as Citation, C as ProviderToolAction, Ct as LLMRequest, Dt as SpanData, E as ThinkingPart, Et as Span, F as AxleAssistantMessage, Ft as TraceWriter, G as ContentPartFile, H as CitationSource, I as AxleMessage, J as ContentPartThinking, K as ContentPartProviderTool, L as AxleToolCallMessage, M as TurnStatus, Mt as SpanType, N as CompactionRecord, Nt as TokenUsage, O as ToolAction, Ot as SpanEvent, P as validateCompactedMessages, Pt as ToolResult, Q as ThinkingContinuity, R as AxleToolCallResult, S as FilePart, St as EventLevel, T as TextPart, Tt as LLMResult, U as ContentPart, V as CitationOutputSpan, W as ContentPartCitation, X as DocumentLocator, Y as ContentPartToolCall, Z as MessageMetadata, _ as Annotation, _t as ResolvedFileSource, at as ModelResult, b as CitationPart, bt as TokenStats, c as ToolContext, ct as ResolvedProviderTool, d as ToolRegistry, dt as FileInfo, et as AIProvider, f as AnnotationEvent, ft as FileKind, g as ActionResult, gt as FileResolver, h as ActionPart, ht as FileResolveRequest, i as TurnAccumulatorState, it as ModelError, j as TurnPart, jt as SpanStatus, k as Turn, kt as SpanOptions, l as ToolDefinition, lt as ToolChoice, m as TurnEvent, mt as FileResolveFormat, n as TurnAccumulator, nt as AxleStopReason, o as ExecutableTool, ot as ProviderClientOptions, p as AnnotationTarget, pt as FileProviderId, q as ContentPartText, r as TurnAccumulatorResult, rt as ContextUsage, s as ProviderTool, st as ProviderOptions, t as AccumulatableEvent, tt as AxleModelRequestOptions, u as ToolProgressChunk, ut as DeferredFileInfo, v as AnnotationPlacement, vt as loadFileContent, w as SubagentAction, wt as LLMResponse, x as CompactionPart, xt as UsageEntry, y as AnnotationStatus, yt as Stats, z as AxleUserMessage } from "./accumulator-B2Zr6tOY.js";
2
2
  import * as z$2 from "zod";
3
3
  import { ZodObject, z } from "zod";
4
4
 
@@ -360,25 +360,30 @@ type ToolCallResult = {
360
360
  };
361
361
  };
362
362
  type ToolCallCallback = (name: string, parameters: Record<string, unknown>, ctx: ToolContext) => Promise<ToolCallResult | null | undefined>;
363
- type GenerateError = {
363
+ type AxleFailure = {
364
364
  kind: "model";
365
365
  error: ModelError;
366
+ message: string;
366
367
  } | {
367
368
  kind: "tool";
368
369
  error: {
369
370
  name: string;
370
371
  message: string;
371
372
  };
373
+ message: string;
372
374
  } | {
373
375
  kind: "parse";
374
376
  error: unknown;
375
377
  message: string;
376
378
  };
379
+ /** @deprecated Use AxleFailure. */
380
+ type GenerateError = AxleFailure;
377
381
  type GenerateResult<TResponse = AxleAssistantMessage> = {
378
382
  ok: true;
379
383
  response: TResponse;
380
384
  messages: AxleMessage[];
381
385
  final: AxleAssistantMessage;
386
+ error?: undefined;
382
387
  usage?: Stats;
383
388
  /**
384
389
  * Present when a configured limit ended the tool loop at a request
@@ -392,7 +397,7 @@ type GenerateResult<TResponse = AxleAssistantMessage> = {
392
397
  response?: undefined;
393
398
  final?: AxleAssistantMessage;
394
399
  messages: AxleMessage[];
395
- error: GenerateError;
400
+ error: AxleFailure;
396
401
  usage?: Stats;
397
402
  /**
398
403
  * Present on a `parse` error when a loop limit ended an Instruct call
@@ -580,13 +585,14 @@ interface SavedAgent<TAnnotation extends Annotation = Annotation> {
580
585
  interface AgentResult<T = string> {
581
586
  ok: true;
582
587
  response: T;
588
+ error?: undefined;
583
589
  turn: Turn;
584
590
  usage: Stats;
585
591
  }
586
592
  interface AgentErrorResult {
587
593
  ok: false;
588
594
  response?: undefined;
589
- error: GenerateError;
595
+ error: AxleFailure;
590
596
  turn: Turn | undefined;
591
597
  usage: Stats;
592
598
  }
@@ -779,31 +785,6 @@ declare class TaskError extends AxleError {
779
785
  //#region src/providers/anthropic/provider.d.ts
780
786
  declare function anthropic(apiKey: string, options?: ProviderClientOptions): AIProvider;
781
787
  //#endregion
782
- //#region src/providers/anthropic/index.d.ts
783
- declare const Anthropic: {
784
- readonly Models: {
785
- readonly CLAUDE_SONNET_5: "claude-sonnet-5";
786
- readonly CLAUDE_FABLE_5: "claude-fable-5";
787
- readonly CLAUDE_OPUS_4_8: "claude-opus-4-8";
788
- readonly CLAUDE_OPUS_4_7: "claude-opus-4-7";
789
- readonly CLAUDE_SONNET_4_6: "claude-sonnet-4-6";
790
- readonly CLAUDE_OPUS_4_6: "claude-opus-4-6";
791
- readonly CLAUDE_OPUS_4_5_20251101: "claude-opus-4-5-20251101";
792
- readonly CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101";
793
- readonly CLAUDE_SONNET_4_5_20250929: "claude-sonnet-4-5-20250929";
794
- readonly CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929";
795
- readonly CLAUDE_HAIKU_4_5_20251001: "claude-haiku-4-5-20251001";
796
- readonly CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001";
797
- readonly CLAUDE_OPUS_4_1_20250805: "claude-opus-4-1-20250805";
798
- readonly CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805";
799
- readonly CLAUDE_OPUS_4_20250514: "claude-opus-4-20250514";
800
- readonly CLAUDE_OPUS_4: "claude-opus-4-20250514";
801
- readonly CLAUDE_SONNET_4_20250514: "claude-sonnet-4-20250514";
802
- readonly CLAUDE_SONNET_4: "claude-sonnet-4-20250514";
803
- };
804
- readonly DefaultModel: "claude-haiku-4-5-20251001";
805
- };
806
- //#endregion
807
788
  //#region src/providers/chatcompletions/utils.d.ts
808
789
  type ChatCompletionsVendor = "openrouter" | "together";
809
790
  //#endregion
@@ -830,34 +811,6 @@ declare function estimateContextUsage(input: ContextEstimateInput): ContextUsage
830
811
  //#region src/providers/gemini/provider.d.ts
831
812
  declare function gemini(apiKey: string, options?: ProviderClientOptions): AIProvider;
832
813
  //#endregion
833
- //#region src/providers/gemini/index.d.ts
834
- declare const Gemini: {
835
- readonly Models: {
836
- readonly GEMINI_3_5_PRO: "gemini-3.5-pro";
837
- readonly GEMINI_3_5_FLASH: "gemini-3.5-flash";
838
- readonly GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview";
839
- readonly GEMINI_3_1_PRO: "gemini-3.1-pro-preview";
840
- readonly GEMINI_3_1_PRO_PREVIEW_CUSTOMTOOLS: "gemini-3.1-pro-preview-customtools";
841
- readonly GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview";
842
- readonly GEMINI_3_1_FLASH_LITE: "gemini-3.1-flash-lite-preview";
843
- readonly GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview";
844
- readonly GEMINI_3_PRO: "gemini-3-pro-preview";
845
- readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
846
- readonly GEMINI_3_FLASH: "gemini-3-flash-preview";
847
- readonly GEMINI_2_5_PRO: "gemini-2.5-pro";
848
- readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
849
- readonly GEMINI_2_5_FLASH_LITE: "gemini-2.5-flash-lite";
850
- readonly GEMINI_2_0_FLASH: "gemini-2.0-flash";
851
- readonly GEMINI_2_0_FLASH_001: "gemini-2.0-flash-001";
852
- readonly GEMINI_2_0_FLASH_LITE: "gemini-2.0-flash-lite";
853
- readonly GEMINI_2_0_FLASH_LITE_001: "gemini-2.0-flash-lite-001";
854
- readonly GEMINI_FLASH_LATEST: "gemini-flash-latest";
855
- readonly GEMINI_FLASH_LITE_LATEST: "gemini-flash-lite-latest";
856
- readonly GEMINI_PRO_LATEST: "gemini-pro-latest";
857
- };
858
- readonly DefaultModel: "gemini-3.5-flash";
859
- };
860
- //#endregion
861
814
  //#region src/providers/generate.d.ts
862
815
  interface GenerateParams extends AxleModelRequestOptions {
863
816
  provider: AIProvider;
@@ -1000,7 +953,7 @@ type StreamEvent = {
1000
953
  output?: unknown;
1001
954
  } | {
1002
955
  type: "error";
1003
- error: GenerateError;
956
+ error: AxleFailure;
1004
957
  };
1005
958
  type StreamEventCallback = (event: StreamEvent) => void;
1006
959
  interface StreamParams extends AxleModelRequestOptions {
@@ -1043,61 +996,6 @@ declare function stream(options: StreamParams): StreamHandle;
1043
996
  //#region src/providers/openai/provider.d.ts
1044
997
  declare function openai(apiKey: string, options?: ProviderClientOptions): AIProvider;
1045
998
  //#endregion
1046
- //#region src/providers/openai/index.d.ts
1047
- declare const OpenAI: {
1048
- readonly Models: {
1049
- readonly GPT_5_5_2026_04_23: "gpt-5.5-2026-04-23";
1050
- readonly GPT_5_5: "gpt-5.5";
1051
- readonly GPT_5_5_PRO_2026_04_23: "gpt-5.5-pro-2026-04-23";
1052
- readonly GPT_5_5_PRO: "gpt-5.5-pro";
1053
- readonly GPT_5_4_2026_03_05: "gpt-5.4-2026-03-05";
1054
- readonly GPT_5_4: "gpt-5.4";
1055
- readonly GPT_5_4_PRO_2026_03_05: "gpt-5.4-pro-2026-03-05";
1056
- readonly GPT_5_4_PRO: "gpt-5.4-pro";
1057
- readonly GPT_5_4_MINI_2026_03_17: "gpt-5.4-mini-2026-03-17";
1058
- readonly GPT_5_4_MINI: "gpt-5.4-mini";
1059
- readonly GPT_5_4_NANO_2026_03_17: "gpt-5.4-nano-2026-03-17";
1060
- readonly GPT_5_4_NANO: "gpt-5.4-nano";
1061
- readonly GPT_5_3_CHAT_LATEST: "gpt-5.3-chat-latest";
1062
- readonly GPT_5_2_2025_12_11: "gpt-5.2-2025-12-11";
1063
- readonly GPT_5_2: "gpt-5.2";
1064
- readonly GPT_5_2_CHAT_LATEST: "gpt-5.2-chat-latest";
1065
- readonly GPT_5_2_PRO_2025_12_11: "gpt-5.2-pro-2025-12-11";
1066
- readonly GPT_5_2_PRO: "gpt-5.2-pro";
1067
- readonly GPT_5_1_2025_11_13: "gpt-5.1-2025-11-13";
1068
- readonly GPT_5_1: "gpt-5.1";
1069
- readonly GPT_5_1_CHAT_LATEST: "gpt-5.1-chat-latest";
1070
- readonly GPT_5_2025_08_07: "gpt-5-2025-08-07";
1071
- readonly GPT_5: "gpt-5";
1072
- readonly GPT_5_CHAT_LATEST: "gpt-5-chat-latest";
1073
- readonly GPT_5_PRO_2025_10_06: "gpt-5-pro-2025-10-06";
1074
- readonly GPT_5_PRO: "gpt-5-pro";
1075
- readonly GPT_5_MINI_2025_08_07: "gpt-5-mini-2025-08-07";
1076
- readonly GPT_5_MINI: "gpt-5-mini";
1077
- readonly GPT_5_NANO_2025_08_07: "gpt-5-nano-2025-08-07";
1078
- readonly GPT_5_NANO: "gpt-5-nano";
1079
- readonly GPT_4_1_2025_04_14: "gpt-4.1-2025-04-14";
1080
- readonly GPT_4_1: "gpt-4.1";
1081
- readonly GPT_4_1_MINI_2025_04_14: "gpt-4.1-mini-2025-04-14";
1082
- readonly GPT_4_1_MINI: "gpt-4.1-mini";
1083
- readonly GPT_4_1_NANO_2025_04_14: "gpt-4.1-nano-2025-04-14";
1084
- readonly GPT_4_1_NANO: "gpt-4.1-nano";
1085
- readonly GPT_4O_2024_11_20: "gpt-4o-2024-11-20";
1086
- readonly GPT_4O: "gpt-4o";
1087
- readonly GPT_4O_MINI_2024_07_18: "gpt-4o-mini-2024-07-18";
1088
- readonly GPT_4O_MINI: "gpt-4o-mini";
1089
- readonly O4_MINI_2025_04_16: "o4-mini-2025-04-16";
1090
- readonly O4_MINI: "o4-mini";
1091
- readonly O3_2025_04_16: "o3-2025-04-16";
1092
- readonly O3: "o3";
1093
- readonly O3_PRO_2025_06_10: "o3-pro-2025-06-10";
1094
- readonly O3_PRO: "o3-pro";
1095
- readonly O3_MINI_2025_01_31: "o3-mini-2025-01-31";
1096
- readonly O3_MINI: "o3-mini";
1097
- };
1098
- readonly DefaultModel: "gpt-5.4-mini";
1099
- };
1100
- //#endregion
1101
999
  //#region src/tools/agentTool.d.ts
1102
1000
  interface CreateAgentToolOptions<TSchema extends ZodObject<any>> {
1103
1001
  name: string;
@@ -1240,4 +1138,4 @@ declare function createStats(): Stats;
1240
1138
  declare function addStats(total: Stats, usage?: Stats): void;
1241
1139
  declare function mergeStats(...usages: Array<Stats | undefined>): Stats;
1242
1140
  //#endregion
1243
- export { type AIProvider, type AccumulatableEvent, type ActionPart, type ActionResult, Agent, type AgentConfig, type AgentDefinition, type AgentDefinitionRequestOptions, type AgentDefinitionResolver, type AgentErrorResult, type AgentHandle, type AgentMemory, type AgentResult, type AgentSession, type Annotation, type AnnotationEvent, type AnnotationPlacement, type AnnotationStatus, type AnnotationTarget, Anthropic, AxleAbortError, AxleAgentAbortError, type AxleAssistantMessage, type AxleConfiguration, AxleError, type AxleMessage, type AxleModelRequestOptions, AxleStopReason, type AxleToolCallMessage, type AxleToolCallResult, AxleToolFatalError, type AxleUserMessage, type BraveWebSearchOptions, type ChatCompletionsOptions, type ChatCompletionsVendor, type Citation, type CitationOutputSpan, type CitationPart, type CitationSource, type CompactionCallback, type CompactionPart, type CompactionRecord, type ContentPart, type ContentPartCitation, type ContentPartFile, type ContentPartProviderTool, type ContentPartText, type ContentPartThinking, type ContentPartToolCall, type ContextUsage, type CreateAgentToolOptions, type DeferredFileInfo, type DocumentLocator, 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 InstructContextSection, type InstructInputs, type InstructOptions, type InstructResponse, InstructVariableError, type InstructVarsMode, type LLMRequest, type LLMResponse, type LLMResult, type LogEntry, type LogFn, LogWriter, MCP, type MCPConfig, type MCPHttpConfig, type MCPStdioConfig, type MaybePromise, type MemoryContext, type MessageMetadata, type ObservabilityOptions, OpenAI, type OutputSchema, type ParallelToolResult, type ParallelizeOptions, type ParsedSchema, type ProviderClientOptions, type ProviderDefinition, type ProviderOptions, type ProviderTool, type ProviderToolAction, type ProviderToolDefinitionRef, type RecallResult, type ResolvedAgentDefinition, type ResolvedFileSource, type SavedAgent, type SendMessageOptions, SimpleWriter, type SimpleWriterOptions, type Span, type SpanData, type SpanEvent, type SpanOptions, type SpanResult, type SpanStatus, type SpanType, type Stats, type StreamEvent, type StreamEventCallback, type StreamHandle, type StreamInstructHandle, type StreamInstructParams, type StreamInstructResult, type StreamParams, type StreamResult, type SubagentAction, TaskError, type TextPart, type ThinkingContinuity, type ThinkingPart, type TokenStats, type TokenUsage, type ToolAction, type ToolChoice, type ToolContext, type ToolDefinition, type ToolDefinitionRef, type ToolProgressChunk, ToolRegistry, type ToolResult, type ToolResultPart, type TraceWriter, Tracer, type TracerOptions, type Turn, TurnAccumulator, type TurnAccumulatorResult, type TurnAccumulatorState, type TurnEvent, TurnEventBuilder, type TurnEventCallback, type TurnMetadata, type TurnPart, type TurnStatus, type UsageEntry, type WebSearchBackend, type WebSearchBackendContext, type WebSearchRequest, type WebSearchResponse, type WebSearchResult, addStats, anthropic, braveWebSearch, chatCompletions, configureAxle, createAgentConfig, createAgentTool, createStats, estimateContextUsage, gemini, generate, generateTurn, loadFileContent, mergeStats, openai, parallelize, parseResponse, stream, validateCompactedMessages };
1141
+ export { type AIProvider, type AccumulatableEvent, type ActionPart, type ActionResult, Agent, type AgentConfig, type AgentDefinition, type AgentDefinitionRequestOptions, type AgentDefinitionResolver, type AgentErrorResult, type AgentHandle, type AgentMemory, type AgentResult, type AgentSession, type Annotation, type AnnotationEvent, type AnnotationPlacement, type AnnotationStatus, type AnnotationTarget, AxleAbortError, AxleAgentAbortError, type AxleAssistantMessage, type AxleConfiguration, AxleError, type AxleFailure, type AxleMessage, type AxleModelRequestOptions, AxleStopReason, type AxleToolCallMessage, type AxleToolCallResult, AxleToolFatalError, type AxleUserMessage, type BraveWebSearchOptions, type ChatCompletionsOptions, type ChatCompletionsVendor, type Citation, type CitationOutputSpan, type CitationPart, type CitationSource, type CompactionCallback, type CompactionPart, type CompactionRecord, type ContentPart, type ContentPartCitation, type ContentPartFile, type ContentPartProviderTool, type ContentPartText, type ContentPartThinking, type ContentPartToolCall, type ContextUsage, type CreateAgentToolOptions, type DeferredFileInfo, type DocumentLocator, type EventLevel, type ExecutableTool, type FileInfo, type FileKind, type FilePart, type FileProviderId, type FileResolveFormat, type FileResolveRequest, type FileResolver, type FileStore, type GenerateError, type GenerateInstructParams, type GenerateInstructResult, type GenerateParams, type GenerateResult, type Handle, History, Instruct, type InstructContextSection, type InstructInputs, type InstructOptions, type InstructResponse, InstructVariableError, type InstructVarsMode, type LLMRequest, type LLMResponse, type LLMResult, type LogEntry, type LogFn, LogWriter, MCP, type MCPConfig, type MCPHttpConfig, type MCPStdioConfig, type MaybePromise, type MemoryContext, type MessageMetadata, type ObservabilityOptions, type OutputSchema, type ParallelToolResult, type ParallelizeOptions, type ParsedSchema, type ProviderClientOptions, type ProviderDefinition, type ProviderOptions, type ProviderTool, type ProviderToolAction, type ProviderToolDefinitionRef, type RecallResult, type ResolvedAgentDefinition, type ResolvedFileSource, type SavedAgent, type SendMessageOptions, SimpleWriter, type SimpleWriterOptions, type Span, type SpanData, type SpanEvent, type SpanOptions, type SpanResult, type SpanStatus, type SpanType, type Stats, type StreamEvent, type StreamEventCallback, type StreamHandle, type StreamInstructHandle, type StreamInstructParams, type StreamInstructResult, type StreamParams, type StreamResult, type SubagentAction, TaskError, type TextPart, type ThinkingContinuity, type ThinkingPart, type TokenStats, type TokenUsage, type ToolAction, type ToolChoice, type ToolContext, type ToolDefinition, type ToolDefinitionRef, type ToolProgressChunk, ToolRegistry, type ToolResult, type ToolResultPart, type TraceWriter, Tracer, type TracerOptions, type Turn, TurnAccumulator, type TurnAccumulatorResult, type TurnAccumulatorState, type TurnEvent, TurnEventBuilder, type TurnEventCallback, type TurnMetadata, type TurnPart, type TurnStatus, type UsageEntry, type WebSearchBackend, type WebSearchBackendContext, type WebSearchRequest, type WebSearchResponse, type WebSearchResult, addStats, anthropic, braveWebSearch, chatCompletions, configureAxle, createAgentConfig, createAgentTool, createStats, estimateContextUsage, gemini, generate, generateTurn, loadFileContent, mergeStats, openai, parallelize, parseResponse, stream, validateCompactedMessages };