@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/README.md +27 -18
- package/dist/index.d.ts +59 -89
- package/dist/index.js +21 -21
- package/dist/models.d.ts +20 -13
- package/dist/transcript-DUuis-20.js +1 -0
- package/dist/{transcript-BuUBiQX6.d.ts → transcript-IlzS5MWE.d.ts} +55 -49
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +14 -11
- package/dist/transcript-BzpiXJtU.js +0 -1
package/README.md
CHANGED
|
@@ -164,8 +164,10 @@ const result = await handle.final;
|
|
|
164
164
|
if (!result.ok) throw new Error(result.error.kind);
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
`generate()`
|
|
168
|
-
directly as a promise
|
|
167
|
+
`generate()` is the same request and the same tool loop with the non-streaming
|
|
168
|
+
return shape: it resolves the handle's `final` directly as a promise. The
|
|
169
|
+
transport underneath is always streaming, so the two never differ in what
|
|
170
|
+
they send or what they return:
|
|
169
171
|
|
|
170
172
|
```typescript
|
|
171
173
|
import { generate } from "@fifthrevision/axle";
|
|
@@ -224,29 +226,36 @@ conversation and start a new call. Non-positive limits throw at call time.
|
|
|
224
226
|
accepted by `Agent`, `generate()`, `stream()`, and `PromptCompactor`:
|
|
225
227
|
|
|
226
228
|
```typescript
|
|
227
|
-
type ReasoningSetting =
|
|
229
|
+
type ReasoningSetting =
|
|
230
|
+
"default" | "off" | "on" | { effort: "low" | "medium" | "high"; display?: "visible" | "hidden" };
|
|
228
231
|
|
|
229
232
|
await generate({ provider, model, messages, reasoning: { effort: "high" } });
|
|
230
233
|
```
|
|
231
234
|
|
|
232
|
-
| Setting | Meaning
|
|
233
|
-
| --------------------- |
|
|
234
|
-
| omitted / `"default"` | No reasoning fields are sent; the model runs at its provider default
|
|
235
|
-
| `"off"` | The provider's explicit disable. Models that cannot turn thinking off (Fable, Gemini 3, Gemini 2.5 Pro) reject the request
|
|
236
|
-
| `"on"` | Same as `{ effort: "medium" }`
|
|
237
|
-
| `{ effort }` | A named level on modern models, or a fixed token budget (2,048 / 8,192 / 16,384) on models that only accept budgets
|
|
235
|
+
| Setting | Meaning |
|
|
236
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
237
|
+
| omitted / `"default"` | No reasoning fields are sent; the model runs at its provider default |
|
|
238
|
+
| `"off"` | The provider's explicit disable. Models that cannot turn thinking off (Fable, Gemini 3, Gemini 2.5 Pro) reject the request |
|
|
239
|
+
| `"on"` | Same as `{ effort: "medium" }` |
|
|
240
|
+
| `{ effort }` | A named level on modern models, or a fixed token budget (2,048 / 8,192 / 16,384) on models that only accept budgets |
|
|
241
|
+
| `{ effort, display }` | `"visible"` (default) asks the provider to disclose its thinking; `"hidden"` asks it not to, and Axle withholds thinking from the transcript on every provider. On Anthropic the server also skips streaming thinking tokens, improving time to first text token |
|
|
238
242
|
|
|
239
243
|
Effort is relative within a model, not comparable across models. `"on"`
|
|
240
244
|
enables reasoning but does not guarantee a visible thinking block on every
|
|
241
|
-
response.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
response. `display` controls whether thinking is disclosed, not its form:
|
|
246
|
+
Anthropic, OpenAI, and Gemini return a summary, open-weight models return
|
|
247
|
+
raw text, and chat-completions endpoints have no request field for it;
|
|
248
|
+
under `"hidden"` their thinking stays on the message but never reaches the
|
|
249
|
+
transcript. Axle does not validate support: an unsupported
|
|
250
|
+
combination comes back as a provider error. Anything beyond these levels,
|
|
251
|
+
such as `xhigh`, an exact budget, or an OpenAI summary length, goes through
|
|
252
|
+
`providerOptions`, which is applied after the portable mapping and overrides
|
|
253
|
+
it.
|
|
245
254
|
|
|
246
255
|
Anthropic needs an output cap on every request. When you don't pass
|
|
247
|
-
`maxOutputTokens`,
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
`maxOutputTokens`, Axle uses the model's registry ceiling, else 64,000, on
|
|
257
|
+
`stream()`, `generate()`, and `Agent` alike. The per-provider translation is
|
|
258
|
+
documented in `docs/architecture/reasoning.md`.
|
|
250
259
|
|
|
251
260
|
### Results
|
|
252
261
|
|
|
@@ -717,7 +726,7 @@ try {
|
|
|
717
726
|
```
|
|
718
727
|
|
|
719
728
|
`TurnEvent` types: `turn:user`, `turn:start`, `turn:end`, `part:start`,
|
|
720
|
-
`part:end`, `text:delta`, `text:citation`, `thinking:delta`,
|
|
729
|
+
`part:end`, `text:delta`, `text:citation`, `thinking:raw-delta`,
|
|
721
730
|
`thinking:summary-delta`, `thinking:update`, `action:args-delta`,
|
|
722
731
|
`action:running`, `action:progress`, `action:complete`, `action:error`,
|
|
723
732
|
`action:child-event`, `compaction:update`, `compaction:complete`,
|
|
@@ -854,7 +863,7 @@ and completion.
|
|
|
854
863
|
|
|
855
864
|
`StreamEvent` types: `step:start`, `step:complete`, `tool-results:start`,
|
|
856
865
|
`tool-results:complete`, `text:start`, `text:delta`, `text:citation`,
|
|
857
|
-
`text:end`, `citation`, `thinking:start`, `thinking:delta`,
|
|
866
|
+
`text:end`, `citation`, `thinking:start`, `thinking:raw-delta`,
|
|
858
867
|
`thinking:summary-delta`, `thinking:update`, `thinking:end`, `tool:request`,
|
|
859
868
|
`tool:args-delta`, `tool:exec-start`, `tool:exec-delta`, `tool:exec-complete`,
|
|
860
869
|
`tool:exec-error`, `provider-tool:start`, `provider-tool:complete`, `error`.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { $ as ThinkingContinuity, At as
|
|
1
|
+
import { $ as ThinkingContinuity, At as SpanOptions, B as AxleUserMessage, C as CompactionPart, Ct as EventLevel, D as SubagentAction, Dt as Span, E as ProviderToolAction, Et as LLMResult, F as TurnStatus, Ft as ToolResult, G as ContentPartCitation, H as CitationOutputSpan, I as AxleAssistantMessage, It as TraceWriter, J as ContentPartText, K as ContentPartFile, L as AxleMessage, M as Turn, Mt as SpanStatus, N as TurnMetadata, Nt as SpanType, O as TextPart, Ot as SpanData, P as TurnPart, Pt as TokenUsage, Q as MessageMetadata, R as AxleToolCallMessage, S as CitationPart, St as UsageEntry, T as FilePart, Tt as LLMResponse, U as CitationSource, V as Citation, W as ContentPart, X as ContentPartToolCall, Y as ContentPartThinking, Z as DocumentLocator, _ as ActionPart, _t as FileResolver, a as CompactionStamp, at as ModelError, b as AnnotationPlacement, bt as Stats, c as ExecutableTool, ct as ToolChoice, d as ToolDefinition, dt as DeferredFileInfo, et as ToolResultPart, f as ToolProgressChunk, ft as FileInfo, g as TurnEvent, gt as FileResolveRequest, h as AnnotationTarget, ht as FileResolveFormat, it as ContextUsage, j as ToolAction, jt as SpanResult, k as ThinkingPart, kt as SpanEvent, l as ProviderTool, lt as ReasoningEffort, m as AnnotationEvent, mt as FileProviderId, n as TranscriptApplyResult, nt as AxleModelRequestOptions, o as getCompactionStamp, ot as ProviderClientOptions, p as ToolRegistry, pt as FileKind, q as ContentPartProviderTool, r as TranscriptInput, rt as AxleStopReason, s as validateCompactedMessages, st as ProviderOptions, t as Transcript, tt as AIProvider, u as ToolContext, ut as ReasoningSetting, v as ActionResult, vt as ResolvedFileSource, w as CompactionUpdate, wt as LLMRequest, x as AnnotationStatus, xt as TokenStats, y as Annotation, yt as loadFileContent, z as AxleToolCallResult } from "./transcript-IlzS5MWE.js";
|
|
2
2
|
import * as z$2 from "zod";
|
|
3
|
-
import { ZodObject, z } from "zod";
|
|
4
|
-
|
|
3
|
+
import { ZodObject, z as z$1 } from "zod";
|
|
5
4
|
//#region src/tools/webSearch.d.ts
|
|
6
5
|
interface WebSearchRequest {
|
|
7
6
|
query: string;
|
|
@@ -37,13 +36,13 @@ interface BraveWebSearchOptions {
|
|
|
37
36
|
freshness?: "pd" | "pw" | "pm" | "py" | `${string}to${string}`;
|
|
38
37
|
timeoutMs?: number;
|
|
39
38
|
}
|
|
40
|
-
declare function braveWebSearch(options: BraveWebSearchOptions): WebSearchBackend;
|
|
39
|
+
export declare function braveWebSearch(options: BraveWebSearchOptions): WebSearchBackend;
|
|
41
40
|
//#endregion
|
|
42
41
|
//#region src/config.d.ts
|
|
43
42
|
interface AxleConfiguration {
|
|
44
43
|
webSearchFallback?: WebSearchBackend;
|
|
45
44
|
}
|
|
46
|
-
declare function configureAxle(options: AxleConfiguration): void;
|
|
45
|
+
export declare function configureAxle(options: AxleConfiguration): void;
|
|
47
46
|
//#endregion
|
|
48
47
|
//#region src/mcp/MCP.d.ts
|
|
49
48
|
interface MCPStdioConfig {
|
|
@@ -60,7 +59,7 @@ interface MCPHttpConfig {
|
|
|
60
59
|
headers?: Record<string, string>;
|
|
61
60
|
}
|
|
62
61
|
type MCPConfig = MCPStdioConfig | MCPHttpConfig;
|
|
63
|
-
declare class MCP {
|
|
62
|
+
export declare class MCP {
|
|
64
63
|
private config;
|
|
65
64
|
private client;
|
|
66
65
|
private transport;
|
|
@@ -94,7 +93,7 @@ declare class MCP {
|
|
|
94
93
|
//#region src/core/parse.d.ts
|
|
95
94
|
type OutputSchema = z$2.ZodTypeAny;
|
|
96
95
|
type ParsedSchema<T extends OutputSchema> = z$2.output<T>;
|
|
97
|
-
declare function parseResponse<T extends OutputSchema>(rawValue: string, schema?: T): ParsedSchema<T> | string;
|
|
96
|
+
export declare function parseResponse<T extends OutputSchema>(rawValue: string, schema?: T): ParsedSchema<T> | string;
|
|
98
97
|
//#endregion
|
|
99
98
|
//#region src/core/Instruct.d.ts
|
|
100
99
|
type InstructInputs = Record<string, unknown>;
|
|
@@ -113,7 +112,7 @@ interface InstructOptions<TSchema extends OutputSchema | undefined = OutputSchem
|
|
|
113
112
|
vars?: InstructVarsMode;
|
|
114
113
|
metadata?: MessageMetadata;
|
|
115
114
|
}
|
|
116
|
-
declare class Instruct<TSchema extends OutputSchema | undefined = undefined> {
|
|
115
|
+
export declare class Instruct<TSchema extends OutputSchema | undefined = undefined> {
|
|
117
116
|
prompt: string;
|
|
118
117
|
inputs: InstructInputs;
|
|
119
118
|
files: FileInfo[];
|
|
@@ -161,7 +160,7 @@ type LogFn = (entry: LogEntry) => void;
|
|
|
161
160
|
* reconstruct the trace skeleton from the log stream alone. The full span tree
|
|
162
161
|
* also reaches a real span exporter via a separate writer.
|
|
163
162
|
*/
|
|
164
|
-
declare class LogWriter implements TraceWriter {
|
|
163
|
+
export declare class LogWriter implements TraceWriter {
|
|
165
164
|
private readonly log;
|
|
166
165
|
constructor(log: LogFn);
|
|
167
166
|
onSpanStart(): void;
|
|
@@ -174,7 +173,7 @@ interface TracerOptions {
|
|
|
174
173
|
minLevel?: EventLevel;
|
|
175
174
|
writers?: TraceWriter[];
|
|
176
175
|
}
|
|
177
|
-
declare class Tracer {
|
|
176
|
+
export declare class Tracer {
|
|
178
177
|
private rec;
|
|
179
178
|
constructor(options?: TracerOptions);
|
|
180
179
|
get minLevel(): EventLevel;
|
|
@@ -186,7 +185,7 @@ declare class Tracer {
|
|
|
186
185
|
}
|
|
187
186
|
//#endregion
|
|
188
187
|
//#region src/errors/AxleError.d.ts
|
|
189
|
-
declare class AxleError extends Error {
|
|
188
|
+
export declare class AxleError extends Error {
|
|
190
189
|
readonly code: string;
|
|
191
190
|
readonly id?: string;
|
|
192
191
|
readonly details?: Record<string, any>;
|
|
@@ -207,7 +206,7 @@ declare class AxleError extends Error {
|
|
|
207
206
|
}
|
|
208
207
|
//#endregion
|
|
209
208
|
//#region src/errors/AxleAbortError.d.ts
|
|
210
|
-
declare class AxleAbortError extends AxleError {
|
|
209
|
+
export declare class AxleAbortError extends AxleError {
|
|
211
210
|
readonly reason: unknown;
|
|
212
211
|
readonly messages?: AxleMessage[];
|
|
213
212
|
readonly partial?: AxleAssistantMessage;
|
|
@@ -233,7 +232,7 @@ declare class AxleAbortError extends AxleError {
|
|
|
233
232
|
}
|
|
234
233
|
//#endregion
|
|
235
234
|
//#region src/errors/AxleToolFatalError.d.ts
|
|
236
|
-
declare class AxleToolFatalError extends AxleError {
|
|
235
|
+
export declare class AxleToolFatalError extends AxleError {
|
|
237
236
|
readonly toolName?: string;
|
|
238
237
|
readonly messages?: AxleMessage[];
|
|
239
238
|
readonly partial?: AxleAssistantMessage;
|
|
@@ -291,7 +290,7 @@ type AxleFailure = {
|
|
|
291
290
|
};
|
|
292
291
|
/** @deprecated Use AxleFailure. */
|
|
293
292
|
type GenerateError = AxleFailure;
|
|
294
|
-
type
|
|
293
|
+
type StreamResult<TResponse = AxleAssistantMessage> = {
|
|
295
294
|
ok: true;
|
|
296
295
|
response: TResponse;
|
|
297
296
|
messages: AxleMessage[];
|
|
@@ -319,7 +318,7 @@ type GenerateResult<TResponse = AxleAssistantMessage> = {
|
|
|
319
318
|
*/
|
|
320
319
|
stopped?: "max-steps" | "token-limit";
|
|
321
320
|
};
|
|
322
|
-
type
|
|
321
|
+
type GenerateResult<TResponse = AxleAssistantMessage> = StreamResult<TResponse>;
|
|
323
322
|
//#endregion
|
|
324
323
|
//#region src/utils/utils.d.ts
|
|
325
324
|
interface Handle<T> {
|
|
@@ -541,8 +540,10 @@ type CompactionCallback = (state: {
|
|
|
541
540
|
}, context: {
|
|
542
541
|
usage: ContextUsage;
|
|
543
542
|
signal?: AbortSignal;
|
|
544
|
-
trigger: CompactionTrigger;
|
|
545
|
-
|
|
543
|
+
trigger: CompactionTrigger;
|
|
544
|
+
/** Engine-generated id for this compaction; the emitted part shares it. */
|
|
545
|
+
id: string;
|
|
546
|
+
/** Update transient reader-facing state on the running part. */
|
|
546
547
|
emit: (update: CompactionUpdate) => void;
|
|
547
548
|
}) => MaybePromise<{
|
|
548
549
|
messages: AxleMessage[];
|
|
@@ -574,7 +575,7 @@ interface SendMessageOptions extends AxleModelRequestOptions {
|
|
|
574
575
|
}
|
|
575
576
|
//#endregion
|
|
576
577
|
//#region src/core/agent/Agent.d.ts
|
|
577
|
-
declare class Agent {
|
|
578
|
+
export declare class Agent {
|
|
578
579
|
readonly provider: AIProvider;
|
|
579
580
|
readonly model: string;
|
|
580
581
|
readonly name?: string;
|
|
@@ -686,7 +687,7 @@ declare class Agent {
|
|
|
686
687
|
* tools, and MCP clients. Harness runtime services such as file resolvers
|
|
687
688
|
* should be layered onto the returned config by the host.
|
|
688
689
|
*/
|
|
689
|
-
declare function createAgentConfig(definition: AgentDefinition, resolver: AgentDefinitionResolver): Promise<AgentConfig>;
|
|
690
|
+
export declare function createAgentConfig(definition: AgentDefinition, resolver: AgentDefinitionResolver): Promise<AgentConfig>;
|
|
690
691
|
//#endregion
|
|
691
692
|
//#region src/compaction/PromptCompactor.d.ts
|
|
692
693
|
interface PromptCompactorOptions {
|
|
@@ -718,7 +719,7 @@ interface PromptCompactorOptions {
|
|
|
718
719
|
*
|
|
719
720
|
* @experimental Compaction is under active design and may change in any release.
|
|
720
721
|
*/
|
|
721
|
-
declare class PromptCompactor {
|
|
722
|
+
export declare class PromptCompactor {
|
|
722
723
|
private readonly provider;
|
|
723
724
|
private readonly model;
|
|
724
725
|
private readonly prompt;
|
|
@@ -734,7 +735,7 @@ declare class PromptCompactor {
|
|
|
734
735
|
}
|
|
735
736
|
//#endregion
|
|
736
737
|
//#region src/errors/AxleAgentAbortError.d.ts
|
|
737
|
-
declare class AxleAgentAbortError extends AxleAbortError {
|
|
738
|
+
export declare class AxleAgentAbortError extends AxleAbortError {
|
|
738
739
|
readonly turn?: Turn;
|
|
739
740
|
constructor(message?: string, options?: {
|
|
740
741
|
reason?: unknown;
|
|
@@ -759,7 +760,7 @@ declare class AxleAgentAbortError extends AxleAbortError {
|
|
|
759
760
|
}
|
|
760
761
|
//#endregion
|
|
761
762
|
//#region src/errors/InstructVariableError.d.ts
|
|
762
|
-
declare class InstructVariableError extends AxleError {
|
|
763
|
+
export declare class InstructVariableError extends AxleError {
|
|
763
764
|
readonly missingVariables: string[];
|
|
764
765
|
constructor(missingVariables: string[]);
|
|
765
766
|
toJSON(): {
|
|
@@ -774,7 +775,7 @@ declare class InstructVariableError extends AxleError {
|
|
|
774
775
|
}
|
|
775
776
|
//#endregion
|
|
776
777
|
//#region src/errors/TaskError.d.ts
|
|
777
|
-
declare class TaskError extends AxleError {
|
|
778
|
+
export declare class TaskError extends AxleError {
|
|
778
779
|
constructor(message: string, options?: {
|
|
779
780
|
id?: string;
|
|
780
781
|
taskType?: string;
|
|
@@ -785,7 +786,7 @@ declare class TaskError extends AxleError {
|
|
|
785
786
|
}
|
|
786
787
|
//#endregion
|
|
787
788
|
//#region src/providers/anthropic/provider.d.ts
|
|
788
|
-
declare function anthropic(apiKey: string, options?: ProviderClientOptions): AIProvider;
|
|
789
|
+
export declare function anthropic(apiKey: string, options?: ProviderClientOptions): AIProvider;
|
|
789
790
|
//#endregion
|
|
790
791
|
//#region src/providers/chatcompletions/utils.d.ts
|
|
791
792
|
type ChatCompletionsVendor = "openrouter" | "together";
|
|
@@ -795,9 +796,9 @@ interface ChatCompletionsOptions extends ProviderClientOptions {
|
|
|
795
796
|
apiKey?: string;
|
|
796
797
|
vendor?: ChatCompletionsVendor;
|
|
797
798
|
}
|
|
798
|
-
declare function chatCompletions(baseUrl: string, options?: ChatCompletionsOptions): AIProvider;
|
|
799
|
-
declare function chatCompletions(baseUrl: string, apiKey?: string): AIProvider;
|
|
800
|
-
declare function chatCompletions(baseUrl: string, apiKey: string, options?: Omit<ChatCompletionsOptions, "apiKey">): AIProvider;
|
|
799
|
+
export declare function chatCompletions(baseUrl: string, options?: ChatCompletionsOptions): AIProvider;
|
|
800
|
+
export declare function chatCompletions(baseUrl: string, apiKey?: string): AIProvider;
|
|
801
|
+
export declare function chatCompletions(baseUrl: string, apiKey: string, options?: Omit<ChatCompletionsOptions, "apiKey">): AIProvider;
|
|
801
802
|
//#endregion
|
|
802
803
|
//#region src/providers/context.d.ts
|
|
803
804
|
interface ContextEstimateInput {
|
|
@@ -808,52 +809,10 @@ interface ContextEstimateInput {
|
|
|
808
809
|
messages: AxleMessage[];
|
|
809
810
|
limit?: number;
|
|
810
811
|
}
|
|
811
|
-
declare function estimateContextUsage(input: ContextEstimateInput): ContextUsage;
|
|
812
|
+
export declare function estimateContextUsage(input: ContextEstimateInput): ContextUsage;
|
|
812
813
|
//#endregion
|
|
813
814
|
//#region src/providers/gemini/provider.d.ts
|
|
814
|
-
declare function gemini(apiKey: string, options?: ProviderClientOptions): AIProvider;
|
|
815
|
-
//#endregion
|
|
816
|
-
//#region src/providers/generate.d.ts
|
|
817
|
-
interface GenerateParams extends AxleModelRequestOptions {
|
|
818
|
-
provider: AIProvider;
|
|
819
|
-
model: string;
|
|
820
|
-
messages: Array<AxleMessage>;
|
|
821
|
-
system?: string;
|
|
822
|
-
tools?: ExecutableTool[];
|
|
823
|
-
providerTools?: ProviderTool[];
|
|
824
|
-
registry?: ToolRegistry;
|
|
825
|
-
onToolCall?: ToolCallCallback;
|
|
826
|
-
maxSteps?: number;
|
|
827
|
-
/**
|
|
828
|
-
* Context budget for the tool loop, in tokens. Checked at each request
|
|
829
|
-
* boundary against the previous model call's reported usage (effective
|
|
830
|
-
* input + output); when crossed, the loop returns `stopped: "token-limit"`
|
|
831
|
-
* with everything accumulated so far.
|
|
832
|
-
*/
|
|
833
|
-
maxContextTokens?: number;
|
|
834
|
-
span?: Span;
|
|
835
|
-
fileResolver?: FileResolver;
|
|
836
|
-
}
|
|
837
|
-
interface GenerateInstructParams<TSchema extends OutputSchema | undefined> extends Omit<GenerateParams, "messages"> {
|
|
838
|
-
messages?: Array<AxleMessage>;
|
|
839
|
-
instruct: Instruct<TSchema>;
|
|
840
|
-
}
|
|
841
|
-
type GenerateInstructResult<TSchema extends OutputSchema | undefined> = GenerateResult<InstructResponse<TSchema>>;
|
|
842
|
-
declare function generate<TSchema extends OutputSchema | undefined>(options: GenerateInstructParams<TSchema>): Promise<GenerateInstructResult<TSchema>>;
|
|
843
|
-
declare function generate(options: GenerateParams): Promise<GenerateResult>;
|
|
844
|
-
//#endregion
|
|
845
|
-
//#region src/providers/generateStep.d.ts
|
|
846
|
-
interface GenerateStepParams extends AxleModelRequestOptions {
|
|
847
|
-
provider: AIProvider;
|
|
848
|
-
model: string;
|
|
849
|
-
messages: Array<AxleMessage>;
|
|
850
|
-
system?: string;
|
|
851
|
-
tools?: Array<ToolDefinition>;
|
|
852
|
-
providerTools?: Array<ResolvedProviderTool>;
|
|
853
|
-
span?: Span;
|
|
854
|
-
fileResolver?: FileResolver;
|
|
855
|
-
}
|
|
856
|
-
declare function generateStep(props: GenerateStepParams): Promise<ModelResult>;
|
|
815
|
+
export declare function gemini(apiKey: string, options?: ProviderClientOptions): AIProvider;
|
|
857
816
|
//#endregion
|
|
858
817
|
//#region src/providers/stream.d.ts
|
|
859
818
|
type StreamEvent = {
|
|
@@ -889,11 +848,10 @@ type StreamEvent = {
|
|
|
889
848
|
providerMetadata?: Record<string, unknown>;
|
|
890
849
|
} | {
|
|
891
850
|
type: "thinking:start";
|
|
892
|
-
redacted?: boolean;
|
|
893
851
|
continuity?: ThinkingContinuity;
|
|
894
852
|
providerMetadata?: Record<string, unknown>;
|
|
895
853
|
} | {
|
|
896
|
-
type: "thinking:delta";
|
|
854
|
+
type: "thinking:raw-delta";
|
|
897
855
|
delta: string;
|
|
898
856
|
accumulated: string;
|
|
899
857
|
} | {
|
|
@@ -902,12 +860,12 @@ type StreamEvent = {
|
|
|
902
860
|
accumulated: string;
|
|
903
861
|
} | {
|
|
904
862
|
type: "thinking:update";
|
|
905
|
-
redacted?: boolean;
|
|
906
863
|
continuity?: ThinkingContinuity;
|
|
907
864
|
providerMetadata?: Record<string, unknown>;
|
|
908
865
|
} | {
|
|
909
866
|
type: "thinking:end";
|
|
910
|
-
|
|
867
|
+
summary?: string;
|
|
868
|
+
raw?: string;
|
|
911
869
|
} | {
|
|
912
870
|
type: "tool:request";
|
|
913
871
|
id: string;
|
|
@@ -994,11 +952,23 @@ type StreamInstructResult<TSchema extends OutputSchema | undefined> = StreamResu
|
|
|
994
952
|
interface StreamInstructHandle<TSchema extends OutputSchema | undefined> extends Omit<StreamHandle, "final"> {
|
|
995
953
|
readonly final: Promise<StreamInstructResult<TSchema>>;
|
|
996
954
|
}
|
|
997
|
-
declare function stream<TSchema extends OutputSchema | undefined>(options: StreamInstructParams<TSchema>): StreamInstructHandle<TSchema>;
|
|
998
|
-
declare function stream(options: StreamParams): StreamHandle;
|
|
955
|
+
export declare function stream<TSchema extends OutputSchema | undefined>(options: StreamInstructParams<TSchema>): StreamInstructHandle<TSchema>;
|
|
956
|
+
export declare function stream(options: StreamParams): StreamHandle;
|
|
957
|
+
export declare function stream(options: StreamParams | StreamInstructParams<any>): StreamHandle;
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region src/providers/generate.d.ts
|
|
960
|
+
type GenerateParams = StreamParams;
|
|
961
|
+
type GenerateInstructParams<TSchema extends OutputSchema | undefined> = StreamInstructParams<TSchema>;
|
|
962
|
+
type GenerateInstructResult<TSchema extends OutputSchema | undefined> = StreamInstructResult<TSchema>;
|
|
963
|
+
/**
|
|
964
|
+
* The non-streaming return shape of `stream()`: the same request, the same
|
|
965
|
+
* tool loop, and the same result, resolved as a promise instead of a handle.
|
|
966
|
+
*/
|
|
967
|
+
export declare function generate<TSchema extends OutputSchema | undefined>(options: GenerateInstructParams<TSchema>): Promise<GenerateInstructResult<TSchema>>;
|
|
968
|
+
export declare function generate(options: GenerateParams): Promise<GenerateResult>;
|
|
999
969
|
//#endregion
|
|
1000
970
|
//#region src/providers/openai/provider.d.ts
|
|
1001
|
-
declare function openai(apiKey: string, options?: ProviderClientOptions): AIProvider;
|
|
971
|
+
export declare function openai(apiKey: string, options?: ProviderClientOptions): AIProvider;
|
|
1002
972
|
//#endregion
|
|
1003
973
|
//#region src/tools/agentTool.d.ts
|
|
1004
974
|
interface CreateAgentToolOptions<TSchema extends ZodObject<any>> {
|
|
@@ -1006,12 +976,12 @@ interface CreateAgentToolOptions<TSchema extends ZodObject<any>> {
|
|
|
1006
976
|
description: string;
|
|
1007
977
|
schema: TSchema;
|
|
1008
978
|
/** Create the child agent for this tool call. Fresh agents are recommended. */
|
|
1009
|
-
createAgent: (input: z.infer<TSchema>, ctx: ToolContext) => MaybePromise<Agent>;
|
|
979
|
+
createAgent: (input: z$1.infer<TSchema>, ctx: ToolContext) => MaybePromise<Agent>;
|
|
1010
980
|
/**
|
|
1011
981
|
* Convert tool input into the child-agent user prompt. Defaults to a compact
|
|
1012
982
|
* JSON task payload.
|
|
1013
983
|
*/
|
|
1014
|
-
prompt?: string | ((input: z.infer<TSchema>) => string);
|
|
984
|
+
prompt?: string | ((input: z$1.infer<TSchema>) => string);
|
|
1015
985
|
/** Per-send request overrides for the child agent. */
|
|
1016
986
|
request?: AxleModelRequestOptions;
|
|
1017
987
|
}
|
|
@@ -1026,7 +996,7 @@ interface CreateAgentToolOptions<TSchema extends ZodObject<any>> {
|
|
|
1026
996
|
* @experimental Shapes related to subagent rendering may change in a minor
|
|
1027
997
|
* release.
|
|
1028
998
|
*/
|
|
1029
|
-
declare function createAgentTool<TSchema extends ZodObject<any>>(options: CreateAgentToolOptions<TSchema>): ExecutableTool<TSchema>;
|
|
999
|
+
export declare function createAgentTool<TSchema extends ZodObject<any>>(options: CreateAgentToolOptions<TSchema>): ExecutableTool<TSchema>;
|
|
1030
1000
|
//#endregion
|
|
1031
1001
|
//#region src/tools/parallelize.d.ts
|
|
1032
1002
|
interface ParallelizeOptions {
|
|
@@ -1062,12 +1032,12 @@ interface ParallelToolResult<TInput = unknown> {
|
|
|
1062
1032
|
* @experimental The generated tool's result parts (`ParallelToolResult`) may
|
|
1063
1033
|
* change in a minor release.
|
|
1064
1034
|
*/
|
|
1065
|
-
declare function parallelize<TSchema extends ZodObject<any>>(tool: ExecutableTool<TSchema>, options?: ParallelizeOptions): ExecutableTool<ZodObject<{
|
|
1066
|
-
items: z.ZodArray<TSchema>;
|
|
1035
|
+
export declare function parallelize<TSchema extends ZodObject<any>>(tool: ExecutableTool<TSchema>, options?: ParallelizeOptions): ExecutableTool<ZodObject<{
|
|
1036
|
+
items: z$1.ZodArray<TSchema>;
|
|
1067
1037
|
}>>;
|
|
1068
1038
|
//#endregion
|
|
1069
1039
|
//#region src/turns/eventBuilder.d.ts
|
|
1070
|
-
declare class TurnEventBuilder {
|
|
1040
|
+
export declare class TurnEventBuilder {
|
|
1071
1041
|
private currentTurnId;
|
|
1072
1042
|
private currentTurnTiming;
|
|
1073
1043
|
private currentTextPart;
|
|
@@ -1098,7 +1068,7 @@ interface SimpleWriterOptions {
|
|
|
1098
1068
|
/** Custom output function (default: console.log) */
|
|
1099
1069
|
output?: (line: string) => void;
|
|
1100
1070
|
}
|
|
1101
|
-
declare class SimpleWriter implements TraceWriter {
|
|
1071
|
+
export declare class SimpleWriter implements TraceWriter {
|
|
1102
1072
|
private minLevel;
|
|
1103
1073
|
private showInternal;
|
|
1104
1074
|
private showTimestamp;
|
|
@@ -1132,8 +1102,8 @@ declare class SimpleWriter implements TraceWriter {
|
|
|
1132
1102
|
}
|
|
1133
1103
|
//#endregion
|
|
1134
1104
|
//#region src/utils/stats.d.ts
|
|
1135
|
-
declare function createStats(): Stats;
|
|
1136
|
-
declare function addStats(total: Stats, usage?: Stats): void;
|
|
1137
|
-
declare function mergeStats(...usages: Array<Stats | undefined>): Stats;
|
|
1105
|
+
export declare function createStats(): Stats;
|
|
1106
|
+
export declare function addStats(total: Stats, usage?: Stats): void;
|
|
1107
|
+
export declare function mergeStats(...usages: Array<Stats | undefined>): Stats;
|
|
1138
1108
|
//#endregion
|
|
1139
|
-
export { type AIProvider, type ActionPart, type ActionResult,
|
|
1109
|
+
export { type AIProvider, type ActionPart, type ActionResult, type AgentConfig, type AgentDefinition, type AgentDefinitionRequestOptions, type AgentDefinitionResolver, type AgentErrorResult, type AgentHandle, type AgentResult, type AgentSession, type Annotation, type AnnotationEvent, type AnnotationPlacement, type AnnotationStatus, type AnnotationTarget, type AutomaticCompactionTrigger, type AxleAssistantMessage, type AxleConfiguration, type AxleFailure, type AxleMessage, type AxleModelRequestOptions, AxleStopReason, type AxleToolCallMessage, type AxleToolCallResult, type AxleUserMessage, type BraveWebSearchOptions, type ChatCompletionsOptions, type ChatCompletionsVendor, type Citation, type CitationOutputSpan, type CitationPart, type CitationSource, type CompactionCallback, type CompactionConfig, type CompactionPart, type CompactionStamp, type CompactionTrigger, type CompactionUpdate, 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 GenerateError, type GenerateInstructParams, type GenerateInstructResult, type GenerateParams, type GenerateResult, type Handle, type InstructContextSection, type InstructInputs, type InstructOptions, type InstructRenderOptions, type InstructResponse, type InstructVarsMode, type LLMRequest, type LLMResponse, type LLMResult, type LogEntry, type LogFn, type MCPConfig, type MCPHttpConfig, type MCPStdioConfig, type MaybePromise, type MessageMetadata, type ObservabilityOptions, type OutputSchema, type ParallelToolResult, type ParallelizeOptions, type ParsedSchema, type PromptCompactorOptions, type ProviderClientOptions, type ProviderDefinition, type ProviderOptions, type ProviderTool, type ProviderToolAction, type ProviderToolDefinitionRef, type ReasoningEffort, type ReasoningSetting, type ResolvedAgentDefinition, type ResolvedFileSource, type SavedAgent, type SendMessageOptions, type ShouldCompactOnTriggerCallback, 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, type TextPart, type ThinkingContinuity, type ThinkingPart, type TokenStats, type TokenUsage, type ToolAction, type ToolBatchCompleteCallback, type ToolChoice, type ToolContext, type ToolDefinition, type ToolDefinitionRef, type ToolProgressChunk, ToolRegistry, type ToolResult, type ToolResultPart, type TraceWriter, type TracerOptions, Transcript, type TranscriptApplyResult, type TranscriptInput, type Turn, type TurnEvent, type TurnEventCallback, type TurnMetadata, type TurnPart, type TurnStatus, type UsageEntry, type WebSearchBackend, type WebSearchBackendContext, type WebSearchRequest, type WebSearchResponse, type WebSearchResult, getCompactionStamp, loadFileContent, validateCompactedMessages };
|