@fifthrevision/axle 0.18.0 → 0.19.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
@@ -1,23 +1,7 @@
1
+ import { A as FileResolveRequest, B as TracingContext, C as TurnStatus, D as FileKind, E as FileInfo, F as SpanData, I as SpanEvent, L as SpanOptions, M as ResolvedFileSource, N as loadFileContent, O as FileProviderId, P as EventLevel, R as SpanType, S as TurnPart, T as DeferredFileInfo, V as Stats, _ as TextPart, b as ToolAction, c as TurnEvent, d as Annotation, f as AnnotationPlacement, g as SubagentAction, h as ProviderToolAction, i as TurnAccumulatorState, j as FileResolver, k as FileResolveFormat, l as ActionPart, m as FilePart, n as TurnAccumulator, o as AnnotationEvent, p as AnnotationStatus, r as TurnAccumulatorResult, s as AnnotationTarget, t as AccumulatableEvent, u as ActionResult, v as ThinkingPart, w as ConcreteFileInfo, x as Turn, z as TraceWriter } from "./accumulator-D2NgIGxp.js";
1
2
  import * as z$2 from "zod";
2
3
  import { ZodObject, z } from "zod";
3
4
 
4
- //#region src/types.d.ts
5
- /**
6
- * Token usage reported by a provider response.
7
- */
8
- interface Stats {
9
- /** Total effective input tokens. Includes `cachedIn` and `cacheWriteIn` when reported. */
10
- in: number;
11
- /** Total output tokens. Includes `reasoningOut` when reported. */
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;
19
- }
20
- //#endregion
21
5
  //#region src/messages/stream.d.ts
22
6
  interface StreamChunk {
23
7
  type: "start" | "text-start" | "text-delta" | "text-complete" | "tool-call-start" | "tool-call-args-delta" | "tool-call-complete" | "thinking-start" | "thinking-delta" | "thinking-summary-delta" | "thinking-complete" | "provider-tool-start" | "provider-tool-complete" | "complete" | "error";
@@ -143,191 +127,6 @@ interface StreamProviderToolCompleteChunk extends StreamChunk {
143
127
  }
144
128
  type AnyStreamChunk = StreamStartChunk | StreamCompleteChunk | StreamErrorChunk | StreamTextStartChunk | StreamTextDeltaChunk | StreamTextCompleteChunk | StreamThinkingStartChunk | StreamThinkingDeltaChunk | StreamThinkingSummaryDeltaChunk | StreamThinkingCompleteChunk | StreamToolCallStartChunk | StreamToolCallArgsDeltaChunk | StreamToolCallCompleteChunk | StreamProviderToolStartChunk | StreamProviderToolCompleteChunk;
145
129
  //#endregion
146
- //#region src/tracer/types.d.ts
147
- type SpanStatus = "ok" | "error";
148
- type EventLevel = "debug" | "info" | "warn" | "error";
149
- type SpanType = string;
150
- interface SpanEvent {
151
- name: string;
152
- timestamp: number;
153
- level: EventLevel;
154
- attributes?: Record<string, unknown>;
155
- }
156
- interface SpanData {
157
- traceId: string;
158
- spanId: string;
159
- parentSpanId?: string;
160
- name: string;
161
- type?: SpanType;
162
- startTime: number;
163
- endTime?: number;
164
- status: SpanStatus;
165
- attributes: Record<string, unknown>;
166
- events: SpanEvent[];
167
- result?: SpanResult;
168
- }
169
- interface SpanOptions {
170
- type?: SpanType;
171
- }
172
- type SpanResult = LLMResult | ToolResult;
173
- interface LLMResult {
174
- kind: "llm";
175
- model: string;
176
- request: LLMRequest;
177
- response: LLMResponse;
178
- usage?: TokenUsage;
179
- finishReason?: string;
180
- }
181
- interface LLMRequest {
182
- messages: unknown[];
183
- system?: string;
184
- tools?: unknown[];
185
- }
186
- interface LLMResponse {
187
- content: unknown;
188
- }
189
- interface TokenUsage {
190
- inputTokens?: number;
191
- outputTokens?: number;
192
- totalTokens?: number;
193
- cachedInputTokens?: number;
194
- cacheWriteInputTokens?: number;
195
- reasoningOutputTokens?: number;
196
- }
197
- interface ToolResult {
198
- kind: "tool";
199
- name: string;
200
- input: unknown;
201
- output: unknown;
202
- }
203
- interface TraceWriter {
204
- onSpanStart(span: SpanData): void;
205
- onSpanUpdate?(span: SpanData): void;
206
- onSpanEnd(span: SpanData): void;
207
- onEvent?(span: SpanData, event: SpanEvent): void;
208
- flush?(): Promise<void>;
209
- }
210
- /**
211
- * Tracing context for a span. Created by Tracer.startSpan().
212
- * Can create child spans and log events within the span's scope.
213
- */
214
- interface TracingContext {
215
- startSpan(name: string, options?: SpanOptions): TracingContext;
216
- end(status?: SpanStatus): void;
217
- debug(message: string, attributes?: Record<string, unknown>): void;
218
- info(message: string, attributes?: Record<string, unknown>): void;
219
- warn(message: string, attributes?: Record<string, unknown>): void;
220
- error(message: string, attributes?: Record<string, unknown>): void;
221
- setAttribute(key: string, value: unknown): void;
222
- setAttributes(attributes: Record<string, unknown>): void;
223
- setResult(result: SpanResult): void;
224
- }
225
- //#endregion
226
- //#region src/utils/file.d.ts
227
- type FileKind = "image" | "document" | "text";
228
- type TextSource = {
229
- type: "text";
230
- content: string;
231
- } | {
232
- type: "url";
233
- url: string;
234
- } | {
235
- type: "ref";
236
- ref: unknown;
237
- };
238
- type BinarySource = {
239
- type: "base64";
240
- data: string;
241
- } | {
242
- type: "url";
243
- url: string;
244
- } | {
245
- type: "ref";
246
- ref: unknown;
247
- };
248
- interface BaseFile {
249
- mimeType: string;
250
- name: string;
251
- size?: number;
252
- }
253
- type TextFileInfo = BaseFile & {
254
- kind: "text";
255
- source: TextSource;
256
- };
257
- type BinaryFileInfo = BaseFile & {
258
- kind: "image" | "document";
259
- source: BinarySource;
260
- };
261
- type FileInfo = TextFileInfo | BinaryFileInfo;
262
- type InlineTextFile = TextFileInfo & {
263
- source: {
264
- type: "text";
265
- content: string;
266
- };
267
- };
268
- type InlineBinaryFile = BinaryFileInfo & {
269
- source: {
270
- type: "base64";
271
- data: string;
272
- };
273
- };
274
- type DeferredFileInfo = FileInfo & {
275
- source: {
276
- type: "ref";
277
- ref: unknown;
278
- };
279
- };
280
- type ConcreteFileInfo = FileInfo & {
281
- source: {
282
- type: "text";
283
- } | {
284
- type: "base64";
285
- } | {
286
- type: "url";
287
- };
288
- };
289
- type FileProviderId = "anthropic" | "openai" | "gemini" | "chatcompletions";
290
- type FileResolveFormat = "base64" | "url" | "text" | "gemini-file-uri";
291
- type ResolvedFileSource = {
292
- type: "base64";
293
- data: string;
294
- mimeType?: string;
295
- name?: string;
296
- } | {
297
- type: "url";
298
- url: string;
299
- mimeType?: string;
300
- name?: string;
301
- } | {
302
- type: "text";
303
- content: string;
304
- mimeType?: string;
305
- name?: string;
306
- } | {
307
- type: "gemini-file-uri";
308
- uri: string;
309
- mimeType?: string;
310
- name?: string;
311
- };
312
- interface FileResolveRequest {
313
- file: DeferredFileInfo;
314
- ref: unknown;
315
- provider: FileProviderId;
316
- model: string;
317
- accepted: FileResolveFormat[];
318
- signal?: AbortSignal;
319
- }
320
- type FileResolver = (request: FileResolveRequest) => Promise<ResolvedFileSource>;
321
- /**
322
- * Load a file with the specified encoding or auto-detect based on file extension
323
- * @param filePath - Path to the file
324
- * @param encoding - How to load the file: "utf-8" for text, "base64" for binary, or omit for auto-detection
325
- * @returns FileInfo object with appropriate content based on encoding
326
- */
327
- declare function loadFileContent(filePath: string): Promise<FileInfo>;
328
- declare function loadFileContent(filePath: string, encoding: "utf-8"): Promise<InlineTextFile>;
329
- declare function loadFileContent(filePath: string, encoding: "base64"): Promise<InlineBinaryFile>;
330
- //#endregion
331
130
  //#region src/providers/types.d.ts
332
131
  /**
333
132
  * Internal services available to provider adapters while executing a model request.
@@ -677,167 +476,6 @@ type GenerateResult<TResponse = AxleAssistantMessage> = {
677
476
  };
678
477
  type StreamResult<TResponse = AxleAssistantMessage> = GenerateResult<TResponse>;
679
478
  //#endregion
680
- //#region src/turns/types.d.ts
681
- type TurnStatus = "streaming" | "complete" | "cancelled" | "error";
682
- interface TimingInfo {
683
- start: string;
684
- end?: string;
685
- }
686
- interface Turn {
687
- id: string;
688
- owner: "user" | "agent";
689
- parts: TurnPart[];
690
- status: TurnStatus;
691
- timing?: TimingInfo;
692
- usage?: Stats;
693
- }
694
- type TurnPart = TextPart | FilePart | ThinkingPart | ActionPart;
695
- interface TextPart {
696
- id: string;
697
- type: "text";
698
- text: string;
699
- timing?: TimingInfo;
700
- }
701
- interface FilePart {
702
- id: string;
703
- type: "file";
704
- file: FileInfo;
705
- timing?: TimingInfo;
706
- }
707
- interface ThinkingPart {
708
- id: string;
709
- type: "thinking";
710
- text: string;
711
- summary?: string;
712
- redacted?: boolean;
713
- timing?: TimingInfo;
714
- }
715
- interface ActionPartBase {
716
- id: string;
717
- type: "action";
718
- kind: string;
719
- status: "pending" | "running" | "complete" | "cancelled" | "error";
720
- timing?: TimingInfo;
721
- }
722
- interface ToolAction extends ActionPartBase {
723
- kind: "tool";
724
- detail: {
725
- name: string;
726
- parameters: Record<string, unknown>;
727
- pendingArgs?: string;
728
- result?: ActionResult;
729
- };
730
- }
731
- interface SubagentAction extends ActionPartBase {
732
- kind: "agent";
733
- detail: {
734
- name: string;
735
- config?: Record<string, unknown>;
736
- children: Turn[];
737
- result?: ActionResult;
738
- };
739
- }
740
- interface ProviderToolAction extends ActionPartBase {
741
- kind: "provider-tool";
742
- detail: {
743
- name: string;
744
- input?: unknown;
745
- result?: ActionResult;
746
- };
747
- }
748
- type ActionPart = ToolAction | SubagentAction | ProviderToolAction;
749
- type ActionResult = {
750
- type: "in-progress";
751
- content: string;
752
- } | {
753
- type: "success";
754
- content: unknown;
755
- } | {
756
- type: "error";
757
- error: {
758
- type: string;
759
- message: string;
760
- };
761
- };
762
- //#endregion
763
- //#region src/turns/events.d.ts
764
- type AgentEvent = {
765
- type: "session:restore";
766
- turns: Turn[];
767
- config?: Record<string, unknown>;
768
- } | {
769
- type: "turn:user";
770
- turn: Turn;
771
- } | {
772
- type: "turn:start";
773
- turnId: string;
774
- } | {
775
- type: "turn:end";
776
- turnId: string;
777
- status: TurnStatus;
778
- usage: Stats;
779
- timing?: TimingInfo;
780
- } | {
781
- type: "part:start";
782
- turnId: string;
783
- part: TurnPart;
784
- } | {
785
- type: "text:delta";
786
- turnId: string;
787
- partId: string;
788
- delta: string;
789
- } | {
790
- type: "thinking:delta";
791
- turnId: string;
792
- partId: string;
793
- delta: string;
794
- } | {
795
- type: "part:end";
796
- turnId: string;
797
- partId: string;
798
- timing?: TimingInfo;
799
- } | {
800
- type: "action:args-delta";
801
- turnId: string;
802
- partId: string;
803
- delta: string;
804
- accumulated: string;
805
- } | {
806
- type: "action:running";
807
- turnId: string;
808
- partId: string;
809
- parameters?: Record<string, unknown>;
810
- } | {
811
- type: "action:progress";
812
- turnId: string;
813
- partId: string;
814
- chunk: string;
815
- } | {
816
- type: "action:complete";
817
- turnId: string;
818
- partId: string;
819
- result: ActionResult;
820
- } | {
821
- type: "action:error";
822
- turnId: string;
823
- partId: string;
824
- error: {
825
- type: string;
826
- message: string;
827
- };
828
- } | {
829
- type: "action:child-event";
830
- turnId: string;
831
- partId: string;
832
- event: AgentEvent;
833
- } | {
834
- type: "error";
835
- error: {
836
- type: string;
837
- message: string;
838
- };
839
- };
840
- //#endregion
841
479
  //#region src/utils/utils.d.ts
842
480
  interface Handle<T> {
843
481
  cancel(reason?: unknown): void;
@@ -865,6 +503,7 @@ declare class History {
865
503
  get turns(): Turn[];
866
504
  get log(): AxleMessage[];
867
505
  addTurn(turn: Turn): void;
506
+ replaceTurns(turns: Turn[]): void;
868
507
  appendToLog(messages: AxleMessage | AxleMessage[]): void;
869
508
  latestTurn(): Turn | undefined;
870
509
  toString(): string;
@@ -936,7 +575,7 @@ interface AgentErrorResult {
936
575
  usage: Stats;
937
576
  }
938
577
  type AgentHandle<T = string> = Handle<AgentResult<T> | AgentErrorResult>;
939
- type AgentEventCallback = (event: AgentEvent) => void;
578
+ type TurnEventCallback = (event: TurnEvent) => void;
940
579
  interface SendMessageOptions extends AxleModelRequestOptions {
941
580
  fileResolver?: FileResolver;
942
581
  }
@@ -961,7 +600,7 @@ declare class Agent {
961
600
  addMcp(mcp: MCP): void;
962
601
  addMcps(mcps: MCP[]): void;
963
602
  hasTools(): boolean;
964
- on(callback: AgentEventCallback): void;
603
+ on(callback: TurnEventCallback): void;
965
604
  context(): ContextUsage;
966
605
  send(message: string | Instruct<undefined>, options?: SendMessageOptions): AgentHandle<string>;
967
606
  send<TSchema extends OutputSchema>(instruct: Instruct<TSchema>, options?: SendMessageOptions): AgentHandle<ParsedSchema<TSchema>>;
@@ -1032,7 +671,7 @@ declare class AxleAgentAbortError extends AxleAbortError {
1032
671
  usage?: Stats;
1033
672
  });
1034
673
  toJSON(): {
1035
- turn?: Turn | undefined;
674
+ turn?: Turn<Annotation<unknown, string>> | undefined;
1036
675
  usage?: Stats | undefined;
1037
676
  partial?: AxleAssistantMessage | undefined;
1038
677
  messages?: AxleMessage[] | undefined;
@@ -1127,6 +766,17 @@ declare const Anthropic: {
1127
766
  //#region src/providers/chatcompletions/provider.d.ts
1128
767
  declare function chatCompletions(baseUrl: string, apiKey?: string): AIProvider;
1129
768
  //#endregion
769
+ //#region src/providers/context.d.ts
770
+ interface ContextEstimateInput {
771
+ system?: string;
772
+ tools?: ToolDefinition[];
773
+ providerTools?: ProviderTool[];
774
+ mcpTools?: ToolDefinition[];
775
+ messages: AxleMessage[];
776
+ limit?: number;
777
+ }
778
+ declare function estimateContextUsage(input: ContextEstimateInput): ContextUsage;
779
+ //#endregion
1130
780
  //#region src/providers/gemini/provider.d.ts
1131
781
  declare function gemini(apiKey: string): AIProvider;
1132
782
  //#endregion
@@ -1364,17 +1014,6 @@ declare const OpenAI: {
1364
1014
  readonly DefaultModel: "gpt-5.4-mini";
1365
1015
  };
1366
1016
  //#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
1378
1017
  //#region src/cli/configs/schemas.d.ts
1379
1018
  declare const BraveProviderConfigSchema: z.ZodObject<{
1380
1019
  "api-key": z.ZodString;
@@ -1463,25 +1102,21 @@ declare const writeFileSchema: z.ZodObject<{
1463
1102
  }, z.core.$strip>;
1464
1103
  declare const writeFileTool: ExecutableTool<typeof writeFileSchema>;
1465
1104
  //#endregion
1466
- //#region src/turns/builder.d.ts
1467
- declare class TurnBuilder {
1468
- private currentTurn;
1105
+ //#region src/turns/eventBuilder.d.ts
1106
+ declare class TurnEventBuilder {
1107
+ private currentTurnId;
1108
+ private currentTurnTiming;
1469
1109
  private currentTextPart;
1470
1110
  private currentThinkingPart;
1471
1111
  private toolIdMap;
1472
1112
  private accumulatedUsage;
1473
- createUserTurn(message: AxleUserMessage): {
1474
- turn: Turn;
1475
- events: AgentEvent[];
1476
- };
1477
- startAgentTurn(): {
1478
- turn: Turn;
1479
- events: AgentEvent[];
1480
- };
1481
- handleStreamEvent(event: StreamEvent): AgentEvent[];
1482
- finalizeTurn(outcome?: "complete" | "cancelled" | "error"): AgentEvent[];
1113
+ createUserTurn(message: AxleUserMessage): TurnEvent[];
1114
+ startAgentTurn(): Extract<TurnEvent, {
1115
+ type: "turn:start";
1116
+ }>;
1117
+ handleStreamEvent(event: StreamEvent): TurnEvent[];
1118
+ finalizeTurn(outcome?: "complete" | "cancelled" | "error"): TurnEvent[];
1483
1119
  private closeOpenParts;
1484
- private findActionPart;
1485
1120
  }
1486
1121
  //#endregion
1487
1122
  //#region src/tracer/tracer.d.ts
@@ -1591,4 +1226,4 @@ declare class LocalFileStore implements FileStore {
1591
1226
  write(path: string, content: string): Promise<void>;
1592
1227
  }
1593
1228
  //#endregion
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 };
1229
+ export { type AIProvider, type AccumulatableEvent, type ActionPart, type ActionResult, Agent, type AgentConfig, type AgentHandle, type AgentMemory, type AgentResult, type Annotation, type AnnotationEvent, type AnnotationPlacement, type AnnotationStatus, type AnnotationTarget, 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, TurnAccumulator, type TurnAccumulatorResult, type TurnAccumulatorState, type TurnEvent, TurnEventBuilder, type TurnEventCallback, 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{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};
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-CNxHj5B2.js";import{t as N}from"./accumulator-vmmD3pxt.js";import{i as P,o as F,r as I,s as L,t as R,u as z}from"./models-C7fdWvZ6.js";import"./models-Bp_jVWHN.js";var B=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 V={Models:z,DefaultModel:L},H={Models:F,DefaultModel:P},U={Models:I,DefaultModel:R};export{j as Agent,V as Anthropic,r as AxleAbortError,c as AxleAgentAbortError,i as AxleError,t as AxleStopReason,o as AxleToolFatalError,H as Gemini,l as History,M as Instruct,p as InstructVariableError,u as LocalFileStore,y as MCP,U as OpenAI,O as ProceduralMemory,C as SimpleWriter,B as TaskError,s as ToolRegistry,E as Tracer,N as TurnAccumulator,A as TurnEventBuilder,_ 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};
@@ -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-CEgbBKiL.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-Whj6ZP3l.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-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};
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-C7fdWvZ6.js";import{n as l,r as u,t as d}from"../models-Bp_jVWHN.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/dist/ui.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { C as TurnStatus, E as FileInfo, S as TurnPart, V as Stats, _ as TextPart, a as UnknownEvent, b as ToolAction, c as TurnEvent, d as Annotation, f as AnnotationPlacement, g as SubagentAction, h as ProviderToolAction, i as TurnAccumulatorState, l as ActionPart, m as FilePart, n as TurnAccumulator, o as AnnotationEvent, p as AnnotationStatus, r as TurnAccumulatorResult, s as AnnotationTarget, t as AccumulatableEvent, u as ActionResult, v as ThinkingPart, x as Turn, y as TimingInfo } from "./accumulator-D2NgIGxp.js";
2
+ export { type AccumulatableEvent, type ActionPart, type ActionResult, type Annotation, type AnnotationEvent, type AnnotationPlacement, type AnnotationStatus, type AnnotationTarget, type FileInfo, type FilePart, type ProviderToolAction, type Stats, type SubagentAction, type TextPart, type ThinkingPart, type TimingInfo, type ToolAction, type Turn, TurnAccumulator, type TurnAccumulatorResult, type TurnAccumulatorState, type TurnEvent, type TurnPart, type TurnStatus, type UnknownEvent };
package/dist/ui.js ADDED
@@ -0,0 +1 @@
1
+ import{t as e}from"./accumulator-vmmD3pxt.js";export{e as TurnAccumulator};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fifthrevision/axle",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/johncch/axle.git"
@@ -12,6 +12,10 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "import": "./dist/index.js"
14
14
  },
15
+ "./ui": {
16
+ "types": "./dist/ui.d.ts",
17
+ "import": "./dist/ui.js"
18
+ },
15
19
  "./models": {
16
20
  "types": "./dist/providers/models.d.ts",
17
21
  "import": "./dist/providers/models.js"
@@ -39,29 +43,29 @@
39
43
  "author": "Chong Han Chua",
40
44
  "license": "ISC",
41
45
  "dependencies": {
42
- "@anthropic-ai/sdk": "^0.91.0",
46
+ "@anthropic-ai/sdk": "^0.98.0",
43
47
  "@commander-js/extra-typings": "^14.0.0",
44
- "@google/genai": "^1.50.1",
48
+ "@google/genai": "^2.6.0",
45
49
  "@modelcontextprotocol/sdk": "^1.29.0",
46
50
  "chalk": "^5.6.2",
47
51
  "commander": "^14.0.3",
48
52
  "glob": "^13.0.6",
49
- "marked": "^18.0.2",
53
+ "marked": "^18.0.4",
50
54
  "mime": "^4.1.0",
51
- "openai": "^6.34.0",
55
+ "openai": "^6.39.0",
52
56
  "serialize-error": "^13.0.1",
53
- "yaml": "^2.8.3",
54
- "zod": "^4.3.6"
57
+ "yaml": "^2.9.0",
58
+ "zod": "^4.4.3"
55
59
  },
56
60
  "devDependencies": {
57
61
  "@arethetypeswrong/core": "^0.18.2",
58
62
  "dotenv": "^17.4.2",
59
63
  "prettier": "^3.8.3",
60
64
  "prettier-plugin-organize-imports": "^4.3.0",
61
- "publint": "^0.3.18",
62
- "tsdown": "^0.21.10",
63
- "tsx": "^4.21.0",
65
+ "publint": "^0.3.21",
66
+ "tsdown": "^0.22.0",
67
+ "tsx": "^4.22.3",
64
68
  "typescript": "^6.0.3",
65
- "vitest": "^4.1.5"
69
+ "vitest": "^4.1.7"
66
70
  }
67
71
  }