@fifthrevision/axle 0.31.0 → 0.32.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/models.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  //#region src/models.d.ts
2
- interface ModelMetadata {
2
+ export interface ModelMetadata {
3
3
  contextWindow?: number;
4
4
  maxOutputTokens?: number;
5
5
  multimodal: boolean;
6
6
  }
7
- declare const Models: {
7
+ export declare const Models: {
8
8
  readonly Anthropic: {
9
9
  readonly CLAUDE_FABLE_5: "anthropic/claude-fable-5";
10
10
  readonly CLAUDE_FABLE_5_1: "anthropic/claude-fable-5-1";
@@ -31,7 +31,8 @@ declare const Models: {
31
31
  readonly GEMINI_2_5_FLASH_LITE: "google/gemini-2.5-flash-lite";
32
32
  readonly GEMINI_2_5_PRO: "google/gemini-2.5-pro";
33
33
  readonly GEMINI_3_FLASH_PREVIEW: "google/gemini-3-flash-preview";
34
- readonly GEMINI_3_1_FLASH_LITE: "google/gemini-3.1-flash-lite"; /** @deprecated Deprecated by its publisher. */
34
+ readonly GEMINI_3_1_FLASH_LITE: "google/gemini-3.1-flash-lite";
35
+ /** @deprecated Deprecated by its publisher. */
35
36
  readonly GEMINI_3_1_FLASH_LITE_PREVIEW: "google/gemini-3.1-flash-lite-preview";
36
37
  readonly GEMINI_3_1_PRO_PREVIEW: "google/gemini-3.1-pro-preview";
37
38
  readonly GEMINI_3_1_PRO_PREVIEW_CUSTOMTOOLS: "google/gemini-3.1-pro-preview-customtools";
@@ -67,7 +68,8 @@ declare const Models: {
67
68
  };
68
69
  readonly OpenAI: {
69
70
  readonly GPT_4_1: "openai/gpt-4.1";
70
- readonly GPT_4_1_MINI: "openai/gpt-4.1-mini"; /** @deprecated Deprecated by its publisher. */
71
+ readonly GPT_4_1_MINI: "openai/gpt-4.1-mini";
72
+ /** @deprecated Deprecated by its publisher. */
71
73
  readonly GPT_4_1_NANO: "openai/gpt-4.1-nano";
72
74
  readonly GPT_4O_2024_08_06: "openai/gpt-4o-2024-08-06";
73
75
  readonly GPT_4O_2024_11_20: "openai/gpt-4o-2024-11-20";
@@ -77,9 +79,11 @@ declare const Models: {
77
79
  readonly GPT_5_NANO: "openai/gpt-5-nano";
78
80
  readonly GPT_5_PRO: "openai/gpt-5-pro";
79
81
  readonly GPT_5_1: "openai/gpt-5.1";
80
- readonly GPT_5_2: "openai/gpt-5.2"; /** @deprecated Deprecated by its publisher. */
82
+ readonly GPT_5_2: "openai/gpt-5.2";
83
+ /** @deprecated Deprecated by its publisher. */
81
84
  readonly GPT_5_2_CHAT_LATEST: "openai/gpt-5.2-chat-latest";
82
- readonly GPT_5_2_PRO: "openai/gpt-5.2-pro"; /** @deprecated Deprecated by its publisher. */
85
+ readonly GPT_5_2_PRO: "openai/gpt-5.2-pro";
86
+ /** @deprecated Deprecated by its publisher. */
83
87
  readonly GPT_5_3_CHAT_LATEST: "openai/gpt-5.3-chat-latest";
84
88
  readonly GPT_5_3_CODEX: "openai/gpt-5.3-codex";
85
89
  readonly GPT_5_3_CODEX_SPARK: "openai/gpt-5.3-codex-spark";
@@ -92,12 +96,16 @@ declare const Models: {
92
96
  readonly GPT_5_6: "openai/gpt-5.6";
93
97
  readonly GPT_5_6_LUNA: "openai/gpt-5.6-luna";
94
98
  readonly GPT_5_6_SOL: "openai/gpt-5.6-sol";
95
- readonly GPT_5_6_TERRA: "openai/gpt-5.6-terra"; /** @deprecated Deprecated by its publisher. */
96
- readonly O1: "openai/o1"; /** @deprecated Deprecated by its publisher. */
99
+ readonly GPT_5_6_TERRA: "openai/gpt-5.6-terra";
100
+ /** @deprecated Deprecated by its publisher. */
101
+ readonly O1: "openai/o1";
102
+ /** @deprecated Deprecated by its publisher. */
97
103
  readonly O1_PRO: "openai/o1-pro";
98
- readonly O3: "openai/o3"; /** @deprecated Deprecated by its publisher. */
104
+ readonly O3: "openai/o3";
105
+ /** @deprecated Deprecated by its publisher. */
99
106
  readonly O3_MINI: "openai/o3-mini";
100
- readonly O3_PRO: "openai/o3-pro"; /** @deprecated Deprecated by its publisher. */
107
+ readonly O3_PRO: "openai/o3-pro";
108
+ /** @deprecated Deprecated by its publisher. */
101
109
  readonly O4_MINI: "openai/o4-mini";
102
110
  };
103
111
  readonly Qwen: {
@@ -129,6 +137,5 @@ declare const Models: {
129
137
  readonly GLM_5_3_FLASH: "zai/glm-5.3-flash";
130
138
  };
131
139
  };
132
- declare const ModelInfo: Readonly<Record<string, ModelMetadata>>;
133
- //#endregion
134
- export { ModelInfo, ModelMetadata, Models };
140
+ export declare const ModelInfo: Readonly<Record<string, ModelMetadata>>;
141
+ //#endregion
@@ -0,0 +1 @@
1
+ const e=new Set(Object.keys({"turn:user":!0,"turn:start":!0,"turn:end":!0,"compaction:update":!0,"compaction:complete":!0,"compaction:error":!0,"part:start":!0,"text:delta":!0,"text:citation":!0,"thinking:raw-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{_turns;constructor(e=[]){this._turns=[...e]}get turns(){return this._turns}getTurn(e){return this._turns.find(t=>t.id===e)}apply(e){return t(e)?this.applyTurnEvent(e):{handled:!1,event:e}}applyTurnEvent(t){switch(t.type){case`compaction:update`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`compaction`?{...e,...t.update.summary===void 0?{}:{summary:t.update.summary},...t.update.progress===void 0?{}:{progress:t.update.progress}}:e);case`compaction:complete`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`compaction`?{...e,status:`complete`,progress:1,...t.summary===void 0?{}:{summary:t.summary},timing:t.timing??e.timing}:e);case`compaction:error`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`compaction`?{...e,status:`error`,error:t.error,timing:t.timing??e.timing}:e);case`turn:user`:return this.replaceTurns([...this._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._turns,e],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:raw-delta`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`thinking`?{...e,raw:(e.raw??``)+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.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(n.detail.children);return r.apply(t.event),{...n,detail:{...n.detail,children:[...r.turns]}}});default:return this.handled(t)}}replaceTurns(e,t){return this._turns=e,this.handled(t)}updateTurn(e,t,n){let r=!1,i=this._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===`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);return a?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}):this.handled(e)}handled(e){return{handled:!0,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,5 +1,4 @@
1
- import { ZodObject, z } from "zod";
2
-
1
+ import { ZodObject, z as z$1 } from "zod";
3
2
  //#region src/observability/types.d.ts
4
3
  type SpanStatus = "ok" | "error" | "cancelled";
5
4
  type EventLevel = "trace" | "debug" | "info" | "warn" | "error";
@@ -116,7 +115,7 @@ interface Stats extends TokenStats {
116
115
  //#endregion
117
116
  //#region src/messages/stream.d.ts
118
117
  interface StreamChunk {
119
- type: "start" | "text-start" | "text-delta" | "text-citation" | "citation" | "text-complete" | "tool-call-start" | "tool-call-args-delta" | "tool-call-complete" | "thinking-start" | "thinking-delta" | "thinking-summary-delta" | "thinking-metadata" | "thinking-complete" | "provider-tool-start" | "provider-tool-complete" | "complete" | "error";
118
+ type: "start" | "text-start" | "text-delta" | "text-citation" | "citation" | "text-complete" | "tool-call-start" | "tool-call-args-delta" | "tool-call-complete" | "thinking-start" | "thinking-raw-delta" | "thinking-summary-delta" | "thinking-metadata" | "thinking-complete" | "provider-tool-start" | "provider-tool-complete" | "complete" | "error";
120
119
  id?: string;
121
120
  data?: any;
122
121
  }
@@ -188,8 +187,8 @@ interface StreamThinkingStartChunk extends StreamChunk {
188
187
  providerMetadata?: Record<string, unknown>;
189
188
  };
190
189
  }
191
- interface StreamThinkingDeltaChunk extends StreamChunk {
192
- type: "thinking-delta";
190
+ interface StreamThinkingRawDeltaChunk extends StreamChunk {
191
+ type: "thinking-raw-delta";
193
192
  data: {
194
193
  index: number;
195
194
  text: string;
@@ -267,7 +266,7 @@ interface StreamProviderToolCompleteChunk extends StreamChunk {
267
266
  output?: unknown;
268
267
  };
269
268
  }
270
- type AnyStreamChunk = StreamStartChunk | StreamCompleteChunk | StreamErrorChunk | StreamTextStartChunk | StreamTextDeltaChunk | StreamTextCitationChunk | StreamCitationChunk | StreamTextCompleteChunk | StreamThinkingStartChunk | StreamThinkingDeltaChunk | StreamThinkingSummaryDeltaChunk | StreamThinkingMetadataChunk | StreamThinkingCompleteChunk | StreamToolCallStartChunk | StreamToolCallArgsDeltaChunk | StreamToolCallCompleteChunk | StreamProviderToolStartChunk | StreamProviderToolCompleteChunk;
269
+ type AnyStreamChunk = StreamStartChunk | StreamCompleteChunk | StreamErrorChunk | StreamTextStartChunk | StreamTextDeltaChunk | StreamTextCitationChunk | StreamCitationChunk | StreamTextCompleteChunk | StreamThinkingStartChunk | StreamThinkingRawDeltaChunk | StreamThinkingSummaryDeltaChunk | StreamThinkingMetadataChunk | StreamThinkingCompleteChunk | StreamToolCallStartChunk | StreamToolCallArgsDeltaChunk | StreamToolCallCompleteChunk | StreamProviderToolStartChunk | StreamProviderToolCompleteChunk;
271
270
  //#endregion
272
271
  //#region src/utils/file.d.ts
273
272
  type FileKind = "image" | "document" | "text";
@@ -371,13 +370,21 @@ declare function loadFileContent(filePath: string, encoding: "base64"): Promise<
371
370
  * token spend across models.
372
371
  */
373
372
  type ReasoningEffort = "low" | "medium" | "high";
373
+ /**
374
+ * Whether the provider should disclose its thinking. The form that comes
375
+ * back (summary or raw) is the model's, not the caller's.
376
+ */
377
+ type ReasoningDisplay = "visible" | "hidden";
374
378
  /**
375
379
  * Provider-portable reasoning control. `"default"` (or omission) sends no
376
380
  * reasoning fields; `"off"` sends the provider's explicit disable shape;
377
- * `"on"` is `{ effort: "medium" }`. Normative in docs/architecture/reasoning.md.
381
+ * `"on"` is `{ effort: "medium" }`. `display` (default `"visible"`) asks the
382
+ * provider to disclose its thinking wherever a request field exists.
383
+ * Normative in docs/architecture/reasoning.md.
378
384
  */
379
385
  type ReasoningSetting = "default" | "off" | "on" | {
380
386
  effort: ReasoningEffort;
387
+ display?: ReasoningDisplay;
381
388
  };
382
389
  //#endregion
383
390
  //#region src/providers/types.d.ts
@@ -417,7 +424,8 @@ interface AxleModelRequestOptions {
417
424
  /**
418
425
  * Portable reasoning control: `"default"` inherits the model's behavior,
419
426
  * `"off"` sends the provider's explicit disable, `"on"` is medium effort,
420
- * `{ effort }` picks a named level or legacy budget preset.
427
+ * `{ effort, display? }` picks a named level or legacy budget preset and
428
+ * whether the provider should disclose its thinking (default `"visible"`).
421
429
  */
422
430
  reasoning?: ReasoningSetting;
423
431
  /** Maximum output tokens to request from the model. */
@@ -448,17 +456,15 @@ interface AIProvider {
448
456
  */
449
457
  resolveProviderToolName?(name: string, model: string): string | undefined;
450
458
  /** @internal */
451
- createGenerationRequest(model: string, params: ProviderGenerationParams): Promise<ModelResult>;
452
- /** @internal */
453
459
  createStreamingRequest(model: string, params: ProviderStreamParams): AsyncGenerator<AnyStreamChunk, void, unknown>;
454
460
  }
455
461
  interface ResolvedProviderTool extends ProviderTool {
456
462
  nativeName?: string;
457
463
  }
458
464
  /**
459
- * Parameters passed to provider adapters for one non-streaming generation call.
465
+ * Parameters passed to provider adapters for one streaming generation call.
460
466
  */
461
- interface ProviderGenerationParams extends AxleModelRequestOptions {
467
+ interface ProviderStreamParams extends AxleModelRequestOptions {
462
468
  /** Conversation messages to send to the provider. */
463
469
  messages: Array<AxleMessage>;
464
470
  /** Optional system/developer instruction for the request. */
@@ -470,21 +476,6 @@ interface ProviderGenerationParams extends AxleModelRequestOptions {
470
476
  /** Internal services available during provider request creation. */
471
477
  runtime: ProviderRuntime;
472
478
  }
473
- /**
474
- * Parameters passed to provider adapters for one streaming generation call.
475
- */
476
- interface ProviderStreamParams extends ProviderGenerationParams {}
477
- interface ModelResponse {
478
- type: "success";
479
- role: "assistant";
480
- id: string;
481
- model: string;
482
- text: string;
483
- content: Array<ContentPartText | ContentPartThinking | ContentPartToolCall | ContentPartCitation>;
484
- finishReason: AxleStopReason;
485
- usage: Stats;
486
- raw: any;
487
- }
488
479
  interface ModelError {
489
480
  type: "error";
490
481
  error: {
@@ -494,7 +485,6 @@ interface ModelError {
494
485
  usage?: Stats;
495
486
  raw?: any;
496
487
  }
497
- type ModelResult = ModelResponse | ModelError;
498
488
  interface ContextUsage {
499
489
  total: number;
500
490
  system: number;
@@ -649,11 +639,11 @@ interface ContentPartThinking {
649
639
  type: "thinking";
650
640
  /** Provider thinking block id, when supplied. */
651
641
  id?: string;
652
- /** Renderable reasoning text content, when the provider exposes it. */
642
+ /** The provider's block content as sent, echoed back verbatim under its signature. */
653
643
  text?: string;
654
- /** Optional provider-supplied reasoning summary. */
644
+ /** The provider's reasoning summary, echoed back where the provider accepts it. */
655
645
  summary?: string;
656
- /** Whether the provider redacted the reasoning content. */
646
+ /** The provider substituted an opaque payload for the content and wants it echoed. */
657
647
  redacted?: boolean;
658
648
  /** Provider continuity payload that should be preserved for future requests. */
659
649
  continuity?: ThinkingContinuity;
@@ -746,6 +736,14 @@ type ThinkingContinuity = {
746
736
  } | {
747
737
  provider: "gemini";
748
738
  thoughtSignature: string;
739
+ } | {
740
+ provider: "openrouter";
741
+ type: string;
742
+ id?: string;
743
+ format?: string;
744
+ index?: number;
745
+ signature?: string;
746
+ data?: string;
749
747
  };
750
748
  /**
751
749
  * Axle-managed tool call request emitted by the assistant.
@@ -947,12 +945,10 @@ interface ThinkingPart<TAnnotation extends Annotation = Annotation> {
947
945
  id: string;
948
946
  /** Part discriminator. */
949
947
  type: "thinking";
950
- /** Accumulated renderable thinking text, when the provider exposes it. */
951
- text?: string;
952
- /** Optional provider-supplied summary. */
948
+ /** The provider's condensed account of its reasoning, when it disclosed one. */
953
949
  summary?: string;
954
- /** Whether the provider marked the thinking content as redacted. */
955
- redacted?: boolean;
950
+ /** The chain of thought itself; effectively open-weight models only. */
951
+ raw?: string;
956
952
  /** Provider continuity payload that should be preserved for future requests. */
957
953
  continuity?: ThinkingContinuity;
958
954
  /** Provider-specific metadata that is not part of Axle's normalized contract. */
@@ -1030,9 +1026,13 @@ interface ToolAction<TAnnotation extends Annotation = Annotation> extends Action
1030
1026
  kind: "tool";
1031
1027
  /** Tool display and execution details. */
1032
1028
  detail: {
1033
- /** Tool name. */name: string; /** Parsed tool parameters once execution starts. */
1034
- parameters: Record<string, unknown>; /** Accumulated JSON argument text before parameters are parsed. */
1035
- pendingArgs?: string; /** Tool result or in-progress output. */
1029
+ /** Tool name. */
1030
+ name: string;
1031
+ /** Parsed tool parameters once execution starts. */
1032
+ parameters: Record<string, unknown>;
1033
+ /** Accumulated JSON argument text before parameters are parsed. */
1034
+ pendingArgs?: string;
1035
+ /** Tool result or in-progress output. */
1036
1036
  result?: ActionResult;
1037
1037
  };
1038
1038
  }
@@ -1044,9 +1044,13 @@ interface SubagentAction<TAnnotation extends Annotation = Annotation> extends Ac
1044
1044
  kind: "agent";
1045
1045
  /** Subagent display and result details. */
1046
1046
  detail: {
1047
- /** Subagent name. */name: string; /** Optional subagent configuration shown to renderers. */
1048
- config?: Record<string, unknown>; /** Child turns produced by the subagent. */
1049
- children: Turn<TAnnotation>[]; /** Final subagent result, when available. */
1047
+ /** Subagent name. */
1048
+ name: string;
1049
+ /** Optional subagent configuration shown to renderers. */
1050
+ config?: Record<string, unknown>;
1051
+ /** Child turns produced by the subagent. */
1052
+ children: Turn<TAnnotation>[];
1053
+ /** Final subagent result, when available. */
1050
1054
  result?: ActionResult;
1051
1055
  };
1052
1056
  }
@@ -1059,8 +1063,11 @@ interface ProviderToolAction<TAnnotation extends Annotation = Annotation> extend
1059
1063
  kind: "provider-tool";
1060
1064
  /** Provider tool display and result details. */
1061
1065
  detail: {
1062
- /** Provider tool name. */name: string; /** Provider-specific input, when surfaced. */
1063
- input?: unknown; /** Provider tool result, when surfaced. */
1066
+ /** Provider tool name. */
1067
+ name: string;
1068
+ /** Provider-specific input, when surfaced. */
1069
+ input?: unknown;
1070
+ /** Provider tool result, when surfaced. */
1064
1071
  result?: ActionResult;
1065
1072
  };
1066
1073
  }
@@ -1152,7 +1159,7 @@ type TurnEvent<TAnnotation extends Annotation = Annotation> = {
1152
1159
  partId: string;
1153
1160
  citation: Citation;
1154
1161
  } | {
1155
- type: "thinking:delta";
1162
+ type: "thinking:raw-delta";
1156
1163
  turnId: string;
1157
1164
  partId: string;
1158
1165
  delta: string;
@@ -1165,7 +1172,6 @@ type TurnEvent<TAnnotation extends Annotation = Annotation> = {
1165
1172
  type: "thinking:update";
1166
1173
  turnId: string;
1167
1174
  partId: string;
1168
- redacted?: boolean;
1169
1175
  continuity?: ThinkingContinuity;
1170
1176
  providerMetadata?: Record<string, unknown>;
1171
1177
  } | {
@@ -1269,9 +1275,9 @@ interface ExecutableTool<TSchema extends ZodObject<any> = ZodObject<any>> {
1269
1275
  name: string;
1270
1276
  description: string;
1271
1277
  schema: TSchema;
1272
- execute(input: z.infer<TSchema>, ctx: ToolContext): Promise<string | ToolResultPart[]>;
1278
+ execute(input: z$1.infer<TSchema>, ctx: ToolContext): Promise<string | ToolResultPart[]>;
1273
1279
  configure?(config: Record<string, any>): void;
1274
- summarize?(input: z.infer<TSchema>): string;
1280
+ summarize?(input: z$1.infer<TSchema>): string;
1275
1281
  }
1276
1282
  interface ProviderTool {
1277
1283
  type: "provider";
@@ -1346,4 +1352,4 @@ declare class Transcript<TAnnotation extends Annotation = Annotation, THostEvent
1346
1352
  private handled;
1347
1353
  }
1348
1354
  //#endregion
1349
- export { ThinkingContinuity as $, TimingInfo as A, SpanData as At, AxleUserMessage as B, CompactionPart as C, TokenStats as Ct, SubagentAction as D, LLMResponse as Dt, ProviderToolAction as E, LLMRequest as Et, TurnStatus as F, SpanType as Ft, ContentPartCitation as G, CitationOutputSpan as H, AxleAssistantMessage as I, TokenUsage as It, ContentPartText as J, ContentPartFile as K, AxleMessage as L, ToolResult as Lt, Turn as M, SpanOptions as Mt, TurnMetadata as N, SpanResult as Nt, TextPart as O, LLMResult as Ot, TurnPart as P, SpanStatus as Pt, MessageMetadata as Q, AxleToolCallMessage as R, TraceWriter as Rt, CitationPart as S, Stats as St, FilePart as T, EventLevel as Tt, CitationSource as U, Citation as V, ContentPart as W, ContentPartToolCall as X, ContentPartThinking as Y, DocumentLocator as Z, ActionPart as _, FileResolveFormat as _t, CompactionStamp as a, ModelError as at, AnnotationPlacement as b, ResolvedFileSource as bt, ExecutableTool as c, ProviderOptions as ct, ToolDefinition as d, ReasoningEffort as dt, ToolResultPart as et, ToolProgressChunk as f, ReasoningSetting as ft, TurnEvent as g, FileProviderId as gt, AnnotationTarget as h, FileKind as ht, UnknownEvent as i, ContextUsage as it, ToolAction as j, SpanEvent as jt, ThinkingPart as k, Span as kt, ProviderTool as l, ResolvedProviderTool as lt, AnnotationEvent as m, FileInfo as mt, TranscriptApplyResult as n, AxleModelRequestOptions as nt, getCompactionStamp as o, ModelResult as ot, ToolRegistry as p, DeferredFileInfo as pt, ContentPartProviderTool as q, TranscriptInput as r, AxleStopReason as rt, validateCompactedMessages as s, ProviderClientOptions as st, Transcript as t, AIProvider as tt, ToolContext as u, ToolChoice as ut, ActionResult as v, FileResolveRequest as vt, CompactionUpdate as w, UsageEntry as wt, AnnotationStatus as x, loadFileContent as xt, Annotation as y, FileResolver as yt, AxleToolCallResult as z };
1355
+ export { ThinkingContinuity as $, TimingInfo as A, SpanOptions as At, AxleUserMessage as B, CompactionPart as C, EventLevel as Ct, SubagentAction as D, Span as Dt, ProviderToolAction as E, LLMResult as Et, TurnStatus as F, ToolResult as Ft, ContentPartCitation as G, CitationOutputSpan as H, AxleAssistantMessage as I, TraceWriter as It, ContentPartText as J, ContentPartFile as K, AxleMessage as L, Turn as M, SpanStatus as Mt, TurnMetadata as N, SpanType as Nt, TextPart as O, SpanData as Ot, TurnPart as P, TokenUsage as Pt, MessageMetadata as Q, AxleToolCallMessage as R, CitationPart as S, UsageEntry as St, FilePart as T, LLMResponse as Tt, CitationSource as U, Citation as V, ContentPart as W, ContentPartToolCall as X, ContentPartThinking as Y, DocumentLocator as Z, ActionPart as _, FileResolver as _t, CompactionStamp as a, ModelError as at, AnnotationPlacement as b, Stats as bt, ExecutableTool as c, ToolChoice as ct, ToolDefinition as d, DeferredFileInfo as dt, ToolResultPart as et, ToolProgressChunk as f, FileInfo as ft, TurnEvent as g, FileResolveRequest as gt, AnnotationTarget as h, FileResolveFormat as ht, UnknownEvent as i, ContextUsage as it, ToolAction as j, SpanResult as jt, ThinkingPart as k, SpanEvent as kt, ProviderTool as l, ReasoningEffort as lt, AnnotationEvent as m, FileProviderId as mt, TranscriptApplyResult as n, AxleModelRequestOptions as nt, getCompactionStamp as o, ProviderClientOptions as ot, ToolRegistry as p, FileKind as pt, ContentPartProviderTool as q, TranscriptInput as r, AxleStopReason as rt, validateCompactedMessages as s, ProviderOptions as st, Transcript as t, AIProvider as tt, ToolContext as u, ReasoningSetting as ut, ActionResult as v, ResolvedFileSource as vt, CompactionUpdate as w, LLMRequest as wt, AnnotationStatus as x, TokenStats as xt, Annotation as y, loadFileContent as yt, AxleToolCallResult as z };
package/dist/ui.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as ThinkingContinuity, A as TimingInfo, C as CompactionPart, Ct as TokenStats, D as SubagentAction, E as ProviderToolAction, F as TurnStatus, H as CitationOutputSpan, M as Turn, N as TurnMetadata, O as TextPart, P as TurnPart, S as CitationPart, St as Stats, T as FilePart, U as CitationSource, V as Citation, Z as DocumentLocator, _ as ActionPart, a as CompactionStamp, b as AnnotationPlacement, g as TurnEvent, h as AnnotationTarget, i as UnknownEvent, j as ToolAction, k as ThinkingPart, m as AnnotationEvent, mt as FileInfo, n as TranscriptApplyResult, r as TranscriptInput, t as Transcript, v as ActionResult, w as CompactionUpdate, wt as UsageEntry, x as AnnotationStatus, y as Annotation } from "./transcript-BuUBiQX6.js";
1
+ import { $ as ThinkingContinuity, A as TimingInfo, C as CompactionPart, D as SubagentAction, E as ProviderToolAction, F as TurnStatus, H as CitationOutputSpan, M as Turn, N as TurnMetadata, O as TextPart, P as TurnPart, S as CitationPart, St as UsageEntry, T as FilePart, U as CitationSource, V as Citation, Z as DocumentLocator, _ as ActionPart, a as CompactionStamp, b as AnnotationPlacement, bt as Stats, ft as FileInfo, g as TurnEvent, h as AnnotationTarget, i as UnknownEvent, j as ToolAction, k as ThinkingPart, m as AnnotationEvent, n as TranscriptApplyResult, r as TranscriptInput, t as Transcript, v as ActionResult, w as CompactionUpdate, x as AnnotationStatus, xt as TokenStats, y as Annotation } from "./transcript-IlzS5MWE.js";
2
2
  export { type ActionPart, type ActionResult, type Annotation, type AnnotationEvent, type AnnotationPlacement, type AnnotationStatus, type AnnotationTarget, type Citation, type CitationOutputSpan, type CitationPart, type CitationSource, type CompactionPart, type CompactionStamp, type CompactionUpdate, type DocumentLocator, type FileInfo, type FilePart, type ProviderToolAction, type Stats, type SubagentAction, type TextPart, type ThinkingContinuity, type ThinkingPart, type TimingInfo, type TokenStats, type ToolAction, Transcript, type TranscriptApplyResult, type TranscriptInput, type Turn, type TurnEvent, type TurnMetadata, type TurnPart, type TurnStatus, type UnknownEvent, type UsageEntry };
package/dist/ui.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./transcript-BzpiXJtU.js";export{e as Transcript};
1
+ import{t as e}from"./transcript-DUuis-20.js";export{e as Transcript};
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@fifthrevision/axle",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/johncch/axle.git"
7
7
  },
8
8
  "description": "Axle core runtime for building agentic LLM applications.",
9
9
  "type": "module",
10
+ "engines": {
11
+ "node": ">=22"
12
+ },
10
13
  "exports": {
11
14
  ".": {
12
15
  "types": "./dist/index.d.ts",
@@ -27,20 +30,20 @@
27
30
  "author": "Chong Han Chua",
28
31
  "license": "ISC",
29
32
  "dependencies": {
30
- "@anthropic-ai/sdk": "^0.98.0",
31
- "@google/genai": "^2.6.0",
32
- "@modelcontextprotocol/sdk": "^1.29.0",
33
- "chalk": "^5.6.2",
33
+ "@anthropic-ai/sdk": "^0.125.0",
34
+ "@google/genai": "^2.22.0",
35
+ "@modelcontextprotocol/sdk": "^1.30.0",
36
+ "chalk": "^6.0.0",
34
37
  "glob": "^13.0.6",
35
- "marked": "^18.0.4",
38
+ "marked": "^18.0.12",
36
39
  "mime": "^4.1.0",
37
- "openai": "^6.39.0",
38
- "zod": "^4.4.3"
40
+ "openai": "^7.15.0",
41
+ "zod": "^4.6.2"
39
42
  },
40
43
  "devDependencies": {
41
- "@arethetypeswrong/core": "^0.18.2",
42
- "publint": "^0.3.21",
43
- "tsdown": "^0.22.0",
44
+ "@arethetypeswrong/core": "^0.18.5",
45
+ "publint": "^0.3.24",
46
+ "tsdown": "^0.23.0",
44
47
  "typescript": "^6.0.3"
45
48
  },
46
49
  "scripts": {
@@ -1 +0,0 @@
1
- const e=new Set(Object.keys({"turn:user":!0,"turn:start":!0,"turn:end":!0,"compaction:update":!0,"compaction:complete":!0,"compaction:error":!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{_turns;constructor(e=[]){this._turns=[...e]}get turns(){return this._turns}getTurn(e){return this._turns.find(t=>t.id===e)}apply(e){return t(e)?this.applyTurnEvent(e):{handled:!1,event:e}}applyTurnEvent(t){switch(t.type){case`compaction:update`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`compaction`?{...e,...t.update.summary===void 0?{}:{summary:t.update.summary},...t.update.progress===void 0?{}:{progress:t.update.progress}}:e);case`compaction:complete`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`compaction`?{...e,status:`complete`,progress:1,...t.summary===void 0?{}:{summary:t.summary},timing:t.timing??e.timing}:e);case`compaction:error`:return this.updatePart(t.turnId,t.partId,t,e=>e.type===`compaction`?{...e,status:`error`,error:t.error,timing:t.timing??e.timing}:e);case`turn:user`:return this.replaceTurns([...this._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._turns,e],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(n.detail.children);return r.apply(t.event),{...n,detail:{...n.detail,children:[...r.turns]}}});default:return this.handled(t)}}replaceTurns(e,t){return this._turns=e,this.handled(t)}updateTurn(e,t,n){let r=!1,i=this._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===`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);return a?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}):this.handled(e)}handled(e){return{handled:!0,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};