@axlsdk/axl 0.25.0 → 0.25.2
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 +14 -15
- package/dist/index.cjs +831 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +106 -19
- package/dist/index.d.ts +106 -19
- package/dist/index.js +816 -143
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -392,9 +392,8 @@ type ToolDefinition = {
|
|
|
392
392
|
/**
|
|
393
393
|
* Unified effort level controlling how thoroughly the model responds.
|
|
394
394
|
*
|
|
395
|
-
* - `'none'` — Disable thinking/reasoning.
|
|
396
|
-
*
|
|
397
|
-
* fully disables reasoning.
|
|
395
|
+
* - `'none'` — Disable thinking/reasoning where supported. Gemini 3.x and
|
|
396
|
+
* always-on Claude models clamp to their minimum thinking level.
|
|
398
397
|
* - `'low'` through `'max'` — Increasing levels of reasoning depth and token spend.
|
|
399
398
|
* - `'xhigh'` — Extra-high tier between `'high'` and `'max'`. Supported natively on
|
|
400
399
|
* Anthropic Opus 4.7 (`output_config.effort: 'xhigh'`) and OpenAI gpt-5.2+
|
|
@@ -461,7 +460,8 @@ type ChatOptions = {
|
|
|
461
460
|
* thinking/reasoning allocation. On Anthropic 4.6, `effort` still controls output quality
|
|
462
461
|
* independently. On all other providers, `thinkingBudget` fully overrides `effort` for
|
|
463
462
|
* reasoning behavior. Set to 0 to disable thinking while keeping effort for output control
|
|
464
|
-
* (Anthropic-specific optimization; on other providers,
|
|
463
|
+
* where the model permits it (Anthropic-specific optimization; on other providers,
|
|
464
|
+
* simply disables reasoning). Claude Opus 5.5 and Fable 5.1 cannot disable thinking. */
|
|
465
465
|
thinkingBudget?: number;
|
|
466
466
|
/** Show reasoning summaries in responses (thinking_content / thinking_delta).
|
|
467
467
|
* Supported on OpenAI Responses API and Gemini. No-op on Anthropic. */
|
|
@@ -527,6 +527,10 @@ type StreamChunk = {
|
|
|
527
527
|
costProvenance?: 'provider_reported' | 'price_table_estimate';
|
|
528
528
|
/** Provider-specific opaque metadata (e.g. raw Gemini parts with thought signatures). */
|
|
529
529
|
providerMetadata?: Record<string, unknown>;
|
|
530
|
+
/** Safe per-call provider diagnostics, in parity with ProviderResponse. */
|
|
531
|
+
diagnostics?: {
|
|
532
|
+
reasoningContextReset?: ReasoningContextReset;
|
|
533
|
+
};
|
|
530
534
|
/**
|
|
531
535
|
* Per-call latency breakdown. The `done` chunk is the only channel a
|
|
532
536
|
* stream has back to the runtime, so every terminal `done` must carry it
|
|
@@ -865,7 +869,9 @@ type AgentCallParams = {
|
|
|
865
869
|
* for completion.
|
|
866
870
|
*/
|
|
867
871
|
type AgentCallStartData = {
|
|
868
|
-
/**
|
|
872
|
+
/** Context-management summarizer call, separate from the ask's tool loop. */
|
|
873
|
+
purpose?: 'summary';
|
|
874
|
+
/** Original ask prompt, or summarized history when `purpose === 'summary'`. */
|
|
869
875
|
prompt: string;
|
|
870
876
|
/** Bounded rich-input shape; omitted for legacy string calls. */
|
|
871
877
|
input?: ModelInputDescriptor;
|
|
@@ -873,7 +879,9 @@ type AgentCallStartData = {
|
|
|
873
879
|
system?: string;
|
|
874
880
|
/** Resolved model parameters sent to the provider for this call. */
|
|
875
881
|
params?: AgentCallParams;
|
|
876
|
-
/** 1-indexed iteration of the tool-calling loop for this `ctx.ask()` call
|
|
882
|
+
/** 1-indexed iteration of the tool-calling loop for this `ctx.ask()` call;
|
|
883
|
+
* `0` for a context-management summary call (`purpose: 'summary'`), which
|
|
884
|
+
* runs before and outside that loop. */
|
|
877
885
|
turn: number;
|
|
878
886
|
/** When set, this call is a retry triggered by a failed gate check on the previous turn. */
|
|
879
887
|
retryReason?: 'schema' | 'validate' | 'guardrail';
|
|
@@ -901,11 +909,14 @@ type AgentCallStartData = {
|
|
|
901
909
|
* (top-level on the event) when partial usage is available.
|
|
902
910
|
*/
|
|
903
911
|
type AgentCallEndData = {
|
|
912
|
+
/** Mirrors `agent_call_start.data.purpose` for cost attribution without a join. */
|
|
913
|
+
purpose?: 'summary';
|
|
904
914
|
/** Final LLM response content for this turn. Empty string on error. */
|
|
905
915
|
response: string;
|
|
906
916
|
/** Reasoning/thinking content returned by the provider, when available. */
|
|
907
917
|
thinking?: string;
|
|
908
|
-
/** 1-indexed iteration of the tool-calling loop
|
|
918
|
+
/** 1-indexed iteration of the tool-calling loop (`0` for a summary call).
|
|
919
|
+
* Mirrors the matching `agent_call_start.data.turn`. */
|
|
909
920
|
turn: number;
|
|
910
921
|
/** Mirrors `agent_call_start.data.retryReason` so cost-attribution consumers
|
|
911
922
|
* reading `agent_call_end` (cost lives here) can bucket without joining. */
|
|
@@ -1208,6 +1219,17 @@ type SchemaDiagnosticData = {
|
|
|
1208
1219
|
* The union is `kind`-discriminated so later provider cliffs can join without a
|
|
1209
1220
|
* new event type.
|
|
1210
1221
|
*/
|
|
1222
|
+
type ReasoningContextReset = {
|
|
1223
|
+
/** Number of thinking blocks dropped from this call's input. */
|
|
1224
|
+
droppedBlocks: number;
|
|
1225
|
+
/**
|
|
1226
|
+
* Documented Anthropic reasons, `client_prefix_rewrite` when Axl itself
|
|
1227
|
+
* removed thinking because an `AgentConfig.maxContext` summary rewrote the
|
|
1228
|
+
* prefix those blocks were signed against, and a safe bucket for future
|
|
1229
|
+
* reasons; no paths or signed content.
|
|
1230
|
+
*/
|
|
1231
|
+
reasons: Partial<Record<'prefix_binding_mismatch' | 'model_binding_mismatch' | 'organization_binding_mismatch' | 'end_user_binding_mismatch' | 'client_prefix_rewrite' | 'other', number>>;
|
|
1232
|
+
};
|
|
1211
1233
|
type ProviderDiagnosticData = {
|
|
1212
1234
|
kind: 'effort_clamped';
|
|
1213
1235
|
/** Provider name (`provider.name`), when the adapter exposes one. */
|
|
@@ -1217,6 +1239,12 @@ type ProviderDiagnosticData = {
|
|
|
1217
1239
|
requested: Effort;
|
|
1218
1240
|
effective: string;
|
|
1219
1241
|
cause: string;
|
|
1242
|
+
} | {
|
|
1243
|
+
kind: 'reasoning_context_reset';
|
|
1244
|
+
provider?: string;
|
|
1245
|
+
model: string;
|
|
1246
|
+
droppedBlocks: number;
|
|
1247
|
+
reasons: ReasoningContextReset['reasons'];
|
|
1220
1248
|
};
|
|
1221
1249
|
/** Data shape for legacy `guardrail` events. Replaced by `pipeline` in PR 2. */
|
|
1222
1250
|
type GuardrailData = {
|
|
@@ -1464,7 +1492,8 @@ type LegacyAxlEventPayloadV1 = (AxlEventBase & {
|
|
|
1464
1492
|
type: 'agent_call_start';
|
|
1465
1493
|
agent: string;
|
|
1466
1494
|
model: string;
|
|
1467
|
-
/** 1-indexed tool-calling loop iteration within the ask
|
|
1495
|
+
/** 1-indexed tool-calling loop iteration within the ask; `0` for a
|
|
1496
|
+
* context-management summary call (`data.purpose: 'summary'`). */
|
|
1468
1497
|
turn: number;
|
|
1469
1498
|
/** Request-side payload — prompt, system, params, messages, retry context. */
|
|
1470
1499
|
data: AgentCallStartData;
|
|
@@ -2031,6 +2060,10 @@ type ProviderResponse = {
|
|
|
2031
2060
|
costProvenance?: 'provider_reported' | 'price_table_estimate';
|
|
2032
2061
|
/** Provider-specific opaque metadata that needs to round-trip through conversation history. */
|
|
2033
2062
|
providerMetadata?: Record<string, unknown>;
|
|
2063
|
+
/** Safe per-call provider diagnostics, excluding raw provider content. */
|
|
2064
|
+
diagnostics?: {
|
|
2065
|
+
reasoningContextReset?: ReasoningContextReset;
|
|
2066
|
+
};
|
|
2034
2067
|
/** Per-call latency breakdown. Absent on providers that don't instrument it. */
|
|
2035
2068
|
timing?: CallTiming;
|
|
2036
2069
|
};
|
|
@@ -2058,6 +2091,19 @@ declare class UnsupportedModelInputError extends AxlError {
|
|
|
2058
2091
|
feature?: string;
|
|
2059
2092
|
});
|
|
2060
2093
|
}
|
|
2094
|
+
/** Thrown before dispatch when a model or endpoint cannot accept an option or operation. */
|
|
2095
|
+
declare class UnsupportedModelOptionError extends AxlError {
|
|
2096
|
+
readonly provider: string;
|
|
2097
|
+
readonly model: string;
|
|
2098
|
+
readonly option: string;
|
|
2099
|
+
readonly remediation: string;
|
|
2100
|
+
constructor(options: {
|
|
2101
|
+
provider: string;
|
|
2102
|
+
model: string;
|
|
2103
|
+
option: string;
|
|
2104
|
+
remediation: string;
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2061
2107
|
/** Thrown when the public transcription request contains unsupported or unsafe input. */
|
|
2062
2108
|
declare class InvalidTranscriptionInputError extends AxlError {
|
|
2063
2109
|
constructor(message: string);
|
|
@@ -3636,6 +3682,8 @@ declare class OpenAICompatibleProvider implements Provider {
|
|
|
3636
3682
|
stream(messages: ChatMessage[], options: ChatOptions): AsyncGenerator<StreamChunk>;
|
|
3637
3683
|
protected buildHeaders(apiKey: string): Record<string, string>;
|
|
3638
3684
|
protected buildRequestBody(messages: ChatMessage[], options: ChatOptions, stream: boolean): Record<string, unknown>;
|
|
3685
|
+
/** Native subclasses may reject model-invalid fields after providerOptions merge. */
|
|
3686
|
+
protected validateFinalRequestBody(_body: Record<string, unknown>): void;
|
|
3639
3687
|
protected formatMessage(msg: ChatMessage, model: string): Record<string, unknown>;
|
|
3640
3688
|
protected extractErrorMessage(body: string, status: number): string;
|
|
3641
3689
|
private requestModel;
|
|
@@ -4737,7 +4785,14 @@ declare class WorkflowContext<TInput = unknown> {
|
|
|
4737
4785
|
* suppresses late branch events after bounded finalization. */
|
|
4738
4786
|
private readonly workflowLifecycleState;
|
|
4739
4787
|
private signal?;
|
|
4740
|
-
|
|
4788
|
+
/** Durable summary of messages removed by Session.history.maxMessages. */
|
|
4789
|
+
private sessionSummary?;
|
|
4790
|
+
/** Per-agent `maxContext` summaries, keyed by agent name. `null` records a
|
|
4791
|
+
* store lookup that found nothing. Mirrored to session metadata
|
|
4792
|
+
* (`askSummary:<agent>`) when this execution belongs to a session, so a
|
|
4793
|
+
* later execution can reuse the same exact-prefix boundary. Never the
|
|
4794
|
+
* durable `sessionSummary`. */
|
|
4795
|
+
private readonly askSummaries;
|
|
4741
4796
|
/** Consecutive provider calls with promptCache on that wrote to the cache
|
|
4742
4797
|
* without reading from it (prefix changes per call), and consecutive calls
|
|
4743
4798
|
* with no cache activity at all (prefix below the model's minimum, which
|
|
@@ -4924,9 +4979,20 @@ declare class WorkflowContext<TInput = unknown> {
|
|
|
4924
4979
|
*/
|
|
4925
4980
|
private emitProviderDiagnostics;
|
|
4926
4981
|
private buildToolDefs;
|
|
4927
|
-
/**
|
|
4928
|
-
*
|
|
4929
|
-
|
|
4982
|
+
/** Session id for session-scoped ask-summary persistence, when this
|
|
4983
|
+
* execution belongs to a session and has a store to persist into. */
|
|
4984
|
+
private askSummarySessionId;
|
|
4985
|
+
/** This agent's ask summary: the in-memory copy first, else the session's
|
|
4986
|
+
* persisted record (read once per execution). */
|
|
4987
|
+
private loadAskSummary;
|
|
4988
|
+
private saveAskSummary;
|
|
4989
|
+
/**
|
|
4990
|
+
* Project `history` into `availableTokens` for one agent's request: a summary
|
|
4991
|
+
* of an exact covered prefix followed by every later message. Reuses the
|
|
4992
|
+
* agent's cached boundary (in memory or persisted for the session) while the
|
|
4993
|
+
* covered prefix, durable session summary, and summary model are unchanged
|
|
4994
|
+
* and the whole tail fits; otherwise generates a new summary. Also reports how
|
|
4995
|
+
* many Anthropic thinking blocks the projection removed from carried turns.
|
|
4930
4996
|
*/
|
|
4931
4997
|
private summarizeHistory;
|
|
4932
4998
|
/**
|
|
@@ -6459,8 +6525,14 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
6459
6525
|
/**
|
|
6460
6526
|
* Summarize a list of chat messages into a concise summary string.
|
|
6461
6527
|
* Used by Session to summarize dropped messages when history.summarize is enabled.
|
|
6462
|
-
|
|
6463
|
-
|
|
6528
|
+
* `previousSummary` is folded in so a rolling summary never loses what it
|
|
6529
|
+
* alone still carries. Shares its prompt and provider call with the
|
|
6530
|
+
* `AgentConfig.maxContext` summarizer (see `compaction.ts`). It runs outside
|
|
6531
|
+
* any workflow execution, so it emits no ask-scoped events.
|
|
6532
|
+
*/
|
|
6533
|
+
summarizeMessages(messages: ChatMessage[], modelUri: string, options?: {
|
|
6534
|
+
previousSummary?: string;
|
|
6535
|
+
}): Promise<string>;
|
|
6464
6536
|
/** Get the state store (for testing and advanced use cases). */
|
|
6465
6537
|
getStateStore(): StateStore;
|
|
6466
6538
|
/**
|
|
@@ -7315,10 +7387,10 @@ type DirectOpenAIPricingContext = {
|
|
|
7315
7387
|
*/
|
|
7316
7388
|
declare function estimateOpenAICost(model: string, promptTokens: number, completionTokens: number, cachedTokens?: number): number | undefined;
|
|
7317
7389
|
/**
|
|
7318
|
-
* OpenAI Chat Completions reasoning emit. Computes `reasoning_effort`
|
|
7319
|
-
*
|
|
7320
|
-
*
|
|
7321
|
-
*
|
|
7390
|
+
* OpenAI Chat Completions reasoning emit. Computes `reasoning_effort` from the
|
|
7391
|
+
* unified effort/thinkingBudget knobs and signals when to strip the portable
|
|
7392
|
+
* `temperature`, both from the model's {@link OpenAIModelDescriptor}.
|
|
7393
|
+
* Non-reasoning models get neither.
|
|
7322
7394
|
*/
|
|
7323
7395
|
declare const openaiReasoningEmit: ReasoningEmit;
|
|
7324
7396
|
/** Canonical OpenAI Chat Completions profile. */
|
|
@@ -7340,6 +7412,7 @@ declare class OpenAIProvider extends OpenAICompatibleProvider {
|
|
|
7340
7412
|
/** Report a clamped `effort` — Chat Completions caps `'max'` at `'xhigh'` and
|
|
7341
7413
|
* rejects `'none'` before gpt-5.1 (clamped to `'minimal'`). */
|
|
7342
7414
|
effortResolution(options: Pick<ChatOptions, 'model' | 'effort' | 'thinkingBudget' | 'includeThoughts' | 'providerOptions'>): EffortResolution | undefined;
|
|
7415
|
+
protected validateFinalRequestBody(body: Record<string, unknown>): void;
|
|
7343
7416
|
protected computeCost(model: string, usage: ProviderResponse['usage'], _reportedCost: number | undefined, context?: DirectOpenAIPricingContext): number | undefined;
|
|
7344
7417
|
}
|
|
7345
7418
|
|
|
@@ -7461,6 +7534,20 @@ declare class AnthropicProvider implements Provider {
|
|
|
7461
7534
|
chat(messages: ChatMessage[], options: ChatOptions): Promise<ProviderResponse>;
|
|
7462
7535
|
stream(messages: ChatMessage[], options: ChatOptions): AsyncGenerator<StreamChunk>;
|
|
7463
7536
|
private buildHeaders;
|
|
7537
|
+
/**
|
|
7538
|
+
* Whether the final body needs the binding beta header. Runs after
|
|
7539
|
+
* `validateAndBindFinalBody`, which has already injected `block_binding`
|
|
7540
|
+
* wherever it applies, so the header follows the final body rather than
|
|
7541
|
+
* re-deriving the injection rule.
|
|
7542
|
+
*/
|
|
7543
|
+
private requiresBindingBeta;
|
|
7544
|
+
/**
|
|
7545
|
+
* Validate the final body (after `providerOptions`) against the effective
|
|
7546
|
+
* model's capability, then inject `block_binding` where it applies. Every
|
|
7547
|
+
* rule is gated on its own capability field and is a no-op when unset, so a
|
|
7548
|
+
* model only gets the guards its provider contract calls for.
|
|
7549
|
+
*/
|
|
7550
|
+
private validateAndBindFinalBody;
|
|
7464
7551
|
/** Extract a human-readable message from an API error response body. */
|
|
7465
7552
|
private extractErrorMessage;
|
|
7466
7553
|
private buildRequestBody;
|
|
@@ -8335,4 +8422,4 @@ declare class NoopSpanManager implements SpanManager {
|
|
|
8335
8422
|
*/
|
|
8336
8423
|
declare function createSpanManager(config?: TelemetryConfig): Promise<SpanManager>;
|
|
8337
8424
|
|
|
8338
|
-
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedMessage, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationReport, FileDiagnosticArtifactStore, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, RedisStore, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, extractJson, extractThinkTags, findConfig, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
|
8425
|
+
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedMessage, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationReport, FileDiagnosticArtifactStore, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningContextReset, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, RedisStore, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedModelOptionError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, extractJson, extractThinkTags, findConfig, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -392,9 +392,8 @@ type ToolDefinition = {
|
|
|
392
392
|
/**
|
|
393
393
|
* Unified effort level controlling how thoroughly the model responds.
|
|
394
394
|
*
|
|
395
|
-
* - `'none'` — Disable thinking/reasoning.
|
|
396
|
-
*
|
|
397
|
-
* fully disables reasoning.
|
|
395
|
+
* - `'none'` — Disable thinking/reasoning where supported. Gemini 3.x and
|
|
396
|
+
* always-on Claude models clamp to their minimum thinking level.
|
|
398
397
|
* - `'low'` through `'max'` — Increasing levels of reasoning depth and token spend.
|
|
399
398
|
* - `'xhigh'` — Extra-high tier between `'high'` and `'max'`. Supported natively on
|
|
400
399
|
* Anthropic Opus 4.7 (`output_config.effort: 'xhigh'`) and OpenAI gpt-5.2+
|
|
@@ -461,7 +460,8 @@ type ChatOptions = {
|
|
|
461
460
|
* thinking/reasoning allocation. On Anthropic 4.6, `effort` still controls output quality
|
|
462
461
|
* independently. On all other providers, `thinkingBudget` fully overrides `effort` for
|
|
463
462
|
* reasoning behavior. Set to 0 to disable thinking while keeping effort for output control
|
|
464
|
-
* (Anthropic-specific optimization; on other providers,
|
|
463
|
+
* where the model permits it (Anthropic-specific optimization; on other providers,
|
|
464
|
+
* simply disables reasoning). Claude Opus 5.5 and Fable 5.1 cannot disable thinking. */
|
|
465
465
|
thinkingBudget?: number;
|
|
466
466
|
/** Show reasoning summaries in responses (thinking_content / thinking_delta).
|
|
467
467
|
* Supported on OpenAI Responses API and Gemini. No-op on Anthropic. */
|
|
@@ -527,6 +527,10 @@ type StreamChunk = {
|
|
|
527
527
|
costProvenance?: 'provider_reported' | 'price_table_estimate';
|
|
528
528
|
/** Provider-specific opaque metadata (e.g. raw Gemini parts with thought signatures). */
|
|
529
529
|
providerMetadata?: Record<string, unknown>;
|
|
530
|
+
/** Safe per-call provider diagnostics, in parity with ProviderResponse. */
|
|
531
|
+
diagnostics?: {
|
|
532
|
+
reasoningContextReset?: ReasoningContextReset;
|
|
533
|
+
};
|
|
530
534
|
/**
|
|
531
535
|
* Per-call latency breakdown. The `done` chunk is the only channel a
|
|
532
536
|
* stream has back to the runtime, so every terminal `done` must carry it
|
|
@@ -865,7 +869,9 @@ type AgentCallParams = {
|
|
|
865
869
|
* for completion.
|
|
866
870
|
*/
|
|
867
871
|
type AgentCallStartData = {
|
|
868
|
-
/**
|
|
872
|
+
/** Context-management summarizer call, separate from the ask's tool loop. */
|
|
873
|
+
purpose?: 'summary';
|
|
874
|
+
/** Original ask prompt, or summarized history when `purpose === 'summary'`. */
|
|
869
875
|
prompt: string;
|
|
870
876
|
/** Bounded rich-input shape; omitted for legacy string calls. */
|
|
871
877
|
input?: ModelInputDescriptor;
|
|
@@ -873,7 +879,9 @@ type AgentCallStartData = {
|
|
|
873
879
|
system?: string;
|
|
874
880
|
/** Resolved model parameters sent to the provider for this call. */
|
|
875
881
|
params?: AgentCallParams;
|
|
876
|
-
/** 1-indexed iteration of the tool-calling loop for this `ctx.ask()` call
|
|
882
|
+
/** 1-indexed iteration of the tool-calling loop for this `ctx.ask()` call;
|
|
883
|
+
* `0` for a context-management summary call (`purpose: 'summary'`), which
|
|
884
|
+
* runs before and outside that loop. */
|
|
877
885
|
turn: number;
|
|
878
886
|
/** When set, this call is a retry triggered by a failed gate check on the previous turn. */
|
|
879
887
|
retryReason?: 'schema' | 'validate' | 'guardrail';
|
|
@@ -901,11 +909,14 @@ type AgentCallStartData = {
|
|
|
901
909
|
* (top-level on the event) when partial usage is available.
|
|
902
910
|
*/
|
|
903
911
|
type AgentCallEndData = {
|
|
912
|
+
/** Mirrors `agent_call_start.data.purpose` for cost attribution without a join. */
|
|
913
|
+
purpose?: 'summary';
|
|
904
914
|
/** Final LLM response content for this turn. Empty string on error. */
|
|
905
915
|
response: string;
|
|
906
916
|
/** Reasoning/thinking content returned by the provider, when available. */
|
|
907
917
|
thinking?: string;
|
|
908
|
-
/** 1-indexed iteration of the tool-calling loop
|
|
918
|
+
/** 1-indexed iteration of the tool-calling loop (`0` for a summary call).
|
|
919
|
+
* Mirrors the matching `agent_call_start.data.turn`. */
|
|
909
920
|
turn: number;
|
|
910
921
|
/** Mirrors `agent_call_start.data.retryReason` so cost-attribution consumers
|
|
911
922
|
* reading `agent_call_end` (cost lives here) can bucket without joining. */
|
|
@@ -1208,6 +1219,17 @@ type SchemaDiagnosticData = {
|
|
|
1208
1219
|
* The union is `kind`-discriminated so later provider cliffs can join without a
|
|
1209
1220
|
* new event type.
|
|
1210
1221
|
*/
|
|
1222
|
+
type ReasoningContextReset = {
|
|
1223
|
+
/** Number of thinking blocks dropped from this call's input. */
|
|
1224
|
+
droppedBlocks: number;
|
|
1225
|
+
/**
|
|
1226
|
+
* Documented Anthropic reasons, `client_prefix_rewrite` when Axl itself
|
|
1227
|
+
* removed thinking because an `AgentConfig.maxContext` summary rewrote the
|
|
1228
|
+
* prefix those blocks were signed against, and a safe bucket for future
|
|
1229
|
+
* reasons; no paths or signed content.
|
|
1230
|
+
*/
|
|
1231
|
+
reasons: Partial<Record<'prefix_binding_mismatch' | 'model_binding_mismatch' | 'organization_binding_mismatch' | 'end_user_binding_mismatch' | 'client_prefix_rewrite' | 'other', number>>;
|
|
1232
|
+
};
|
|
1211
1233
|
type ProviderDiagnosticData = {
|
|
1212
1234
|
kind: 'effort_clamped';
|
|
1213
1235
|
/** Provider name (`provider.name`), when the adapter exposes one. */
|
|
@@ -1217,6 +1239,12 @@ type ProviderDiagnosticData = {
|
|
|
1217
1239
|
requested: Effort;
|
|
1218
1240
|
effective: string;
|
|
1219
1241
|
cause: string;
|
|
1242
|
+
} | {
|
|
1243
|
+
kind: 'reasoning_context_reset';
|
|
1244
|
+
provider?: string;
|
|
1245
|
+
model: string;
|
|
1246
|
+
droppedBlocks: number;
|
|
1247
|
+
reasons: ReasoningContextReset['reasons'];
|
|
1220
1248
|
};
|
|
1221
1249
|
/** Data shape for legacy `guardrail` events. Replaced by `pipeline` in PR 2. */
|
|
1222
1250
|
type GuardrailData = {
|
|
@@ -1464,7 +1492,8 @@ type LegacyAxlEventPayloadV1 = (AxlEventBase & {
|
|
|
1464
1492
|
type: 'agent_call_start';
|
|
1465
1493
|
agent: string;
|
|
1466
1494
|
model: string;
|
|
1467
|
-
/** 1-indexed tool-calling loop iteration within the ask
|
|
1495
|
+
/** 1-indexed tool-calling loop iteration within the ask; `0` for a
|
|
1496
|
+
* context-management summary call (`data.purpose: 'summary'`). */
|
|
1468
1497
|
turn: number;
|
|
1469
1498
|
/** Request-side payload — prompt, system, params, messages, retry context. */
|
|
1470
1499
|
data: AgentCallStartData;
|
|
@@ -2031,6 +2060,10 @@ type ProviderResponse = {
|
|
|
2031
2060
|
costProvenance?: 'provider_reported' | 'price_table_estimate';
|
|
2032
2061
|
/** Provider-specific opaque metadata that needs to round-trip through conversation history. */
|
|
2033
2062
|
providerMetadata?: Record<string, unknown>;
|
|
2063
|
+
/** Safe per-call provider diagnostics, excluding raw provider content. */
|
|
2064
|
+
diagnostics?: {
|
|
2065
|
+
reasoningContextReset?: ReasoningContextReset;
|
|
2066
|
+
};
|
|
2034
2067
|
/** Per-call latency breakdown. Absent on providers that don't instrument it. */
|
|
2035
2068
|
timing?: CallTiming;
|
|
2036
2069
|
};
|
|
@@ -2058,6 +2091,19 @@ declare class UnsupportedModelInputError extends AxlError {
|
|
|
2058
2091
|
feature?: string;
|
|
2059
2092
|
});
|
|
2060
2093
|
}
|
|
2094
|
+
/** Thrown before dispatch when a model or endpoint cannot accept an option or operation. */
|
|
2095
|
+
declare class UnsupportedModelOptionError extends AxlError {
|
|
2096
|
+
readonly provider: string;
|
|
2097
|
+
readonly model: string;
|
|
2098
|
+
readonly option: string;
|
|
2099
|
+
readonly remediation: string;
|
|
2100
|
+
constructor(options: {
|
|
2101
|
+
provider: string;
|
|
2102
|
+
model: string;
|
|
2103
|
+
option: string;
|
|
2104
|
+
remediation: string;
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2061
2107
|
/** Thrown when the public transcription request contains unsupported or unsafe input. */
|
|
2062
2108
|
declare class InvalidTranscriptionInputError extends AxlError {
|
|
2063
2109
|
constructor(message: string);
|
|
@@ -3636,6 +3682,8 @@ declare class OpenAICompatibleProvider implements Provider {
|
|
|
3636
3682
|
stream(messages: ChatMessage[], options: ChatOptions): AsyncGenerator<StreamChunk>;
|
|
3637
3683
|
protected buildHeaders(apiKey: string): Record<string, string>;
|
|
3638
3684
|
protected buildRequestBody(messages: ChatMessage[], options: ChatOptions, stream: boolean): Record<string, unknown>;
|
|
3685
|
+
/** Native subclasses may reject model-invalid fields after providerOptions merge. */
|
|
3686
|
+
protected validateFinalRequestBody(_body: Record<string, unknown>): void;
|
|
3639
3687
|
protected formatMessage(msg: ChatMessage, model: string): Record<string, unknown>;
|
|
3640
3688
|
protected extractErrorMessage(body: string, status: number): string;
|
|
3641
3689
|
private requestModel;
|
|
@@ -4737,7 +4785,14 @@ declare class WorkflowContext<TInput = unknown> {
|
|
|
4737
4785
|
* suppresses late branch events after bounded finalization. */
|
|
4738
4786
|
private readonly workflowLifecycleState;
|
|
4739
4787
|
private signal?;
|
|
4740
|
-
|
|
4788
|
+
/** Durable summary of messages removed by Session.history.maxMessages. */
|
|
4789
|
+
private sessionSummary?;
|
|
4790
|
+
/** Per-agent `maxContext` summaries, keyed by agent name. `null` records a
|
|
4791
|
+
* store lookup that found nothing. Mirrored to session metadata
|
|
4792
|
+
* (`askSummary:<agent>`) when this execution belongs to a session, so a
|
|
4793
|
+
* later execution can reuse the same exact-prefix boundary. Never the
|
|
4794
|
+
* durable `sessionSummary`. */
|
|
4795
|
+
private readonly askSummaries;
|
|
4741
4796
|
/** Consecutive provider calls with promptCache on that wrote to the cache
|
|
4742
4797
|
* without reading from it (prefix changes per call), and consecutive calls
|
|
4743
4798
|
* with no cache activity at all (prefix below the model's minimum, which
|
|
@@ -4924,9 +4979,20 @@ declare class WorkflowContext<TInput = unknown> {
|
|
|
4924
4979
|
*/
|
|
4925
4980
|
private emitProviderDiagnostics;
|
|
4926
4981
|
private buildToolDefs;
|
|
4927
|
-
/**
|
|
4928
|
-
*
|
|
4929
|
-
|
|
4982
|
+
/** Session id for session-scoped ask-summary persistence, when this
|
|
4983
|
+
* execution belongs to a session and has a store to persist into. */
|
|
4984
|
+
private askSummarySessionId;
|
|
4985
|
+
/** This agent's ask summary: the in-memory copy first, else the session's
|
|
4986
|
+
* persisted record (read once per execution). */
|
|
4987
|
+
private loadAskSummary;
|
|
4988
|
+
private saveAskSummary;
|
|
4989
|
+
/**
|
|
4990
|
+
* Project `history` into `availableTokens` for one agent's request: a summary
|
|
4991
|
+
* of an exact covered prefix followed by every later message. Reuses the
|
|
4992
|
+
* agent's cached boundary (in memory or persisted for the session) while the
|
|
4993
|
+
* covered prefix, durable session summary, and summary model are unchanged
|
|
4994
|
+
* and the whole tail fits; otherwise generates a new summary. Also reports how
|
|
4995
|
+
* many Anthropic thinking blocks the projection removed from carried turns.
|
|
4930
4996
|
*/
|
|
4931
4997
|
private summarizeHistory;
|
|
4932
4998
|
/**
|
|
@@ -6459,8 +6525,14 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
6459
6525
|
/**
|
|
6460
6526
|
* Summarize a list of chat messages into a concise summary string.
|
|
6461
6527
|
* Used by Session to summarize dropped messages when history.summarize is enabled.
|
|
6462
|
-
|
|
6463
|
-
|
|
6528
|
+
* `previousSummary` is folded in so a rolling summary never loses what it
|
|
6529
|
+
* alone still carries. Shares its prompt and provider call with the
|
|
6530
|
+
* `AgentConfig.maxContext` summarizer (see `compaction.ts`). It runs outside
|
|
6531
|
+
* any workflow execution, so it emits no ask-scoped events.
|
|
6532
|
+
*/
|
|
6533
|
+
summarizeMessages(messages: ChatMessage[], modelUri: string, options?: {
|
|
6534
|
+
previousSummary?: string;
|
|
6535
|
+
}): Promise<string>;
|
|
6464
6536
|
/** Get the state store (for testing and advanced use cases). */
|
|
6465
6537
|
getStateStore(): StateStore;
|
|
6466
6538
|
/**
|
|
@@ -7315,10 +7387,10 @@ type DirectOpenAIPricingContext = {
|
|
|
7315
7387
|
*/
|
|
7316
7388
|
declare function estimateOpenAICost(model: string, promptTokens: number, completionTokens: number, cachedTokens?: number): number | undefined;
|
|
7317
7389
|
/**
|
|
7318
|
-
* OpenAI Chat Completions reasoning emit. Computes `reasoning_effort`
|
|
7319
|
-
*
|
|
7320
|
-
*
|
|
7321
|
-
*
|
|
7390
|
+
* OpenAI Chat Completions reasoning emit. Computes `reasoning_effort` from the
|
|
7391
|
+
* unified effort/thinkingBudget knobs and signals when to strip the portable
|
|
7392
|
+
* `temperature`, both from the model's {@link OpenAIModelDescriptor}.
|
|
7393
|
+
* Non-reasoning models get neither.
|
|
7322
7394
|
*/
|
|
7323
7395
|
declare const openaiReasoningEmit: ReasoningEmit;
|
|
7324
7396
|
/** Canonical OpenAI Chat Completions profile. */
|
|
@@ -7340,6 +7412,7 @@ declare class OpenAIProvider extends OpenAICompatibleProvider {
|
|
|
7340
7412
|
/** Report a clamped `effort` — Chat Completions caps `'max'` at `'xhigh'` and
|
|
7341
7413
|
* rejects `'none'` before gpt-5.1 (clamped to `'minimal'`). */
|
|
7342
7414
|
effortResolution(options: Pick<ChatOptions, 'model' | 'effort' | 'thinkingBudget' | 'includeThoughts' | 'providerOptions'>): EffortResolution | undefined;
|
|
7415
|
+
protected validateFinalRequestBody(body: Record<string, unknown>): void;
|
|
7343
7416
|
protected computeCost(model: string, usage: ProviderResponse['usage'], _reportedCost: number | undefined, context?: DirectOpenAIPricingContext): number | undefined;
|
|
7344
7417
|
}
|
|
7345
7418
|
|
|
@@ -7461,6 +7534,20 @@ declare class AnthropicProvider implements Provider {
|
|
|
7461
7534
|
chat(messages: ChatMessage[], options: ChatOptions): Promise<ProviderResponse>;
|
|
7462
7535
|
stream(messages: ChatMessage[], options: ChatOptions): AsyncGenerator<StreamChunk>;
|
|
7463
7536
|
private buildHeaders;
|
|
7537
|
+
/**
|
|
7538
|
+
* Whether the final body needs the binding beta header. Runs after
|
|
7539
|
+
* `validateAndBindFinalBody`, which has already injected `block_binding`
|
|
7540
|
+
* wherever it applies, so the header follows the final body rather than
|
|
7541
|
+
* re-deriving the injection rule.
|
|
7542
|
+
*/
|
|
7543
|
+
private requiresBindingBeta;
|
|
7544
|
+
/**
|
|
7545
|
+
* Validate the final body (after `providerOptions`) against the effective
|
|
7546
|
+
* model's capability, then inject `block_binding` where it applies. Every
|
|
7547
|
+
* rule is gated on its own capability field and is a no-op when unset, so a
|
|
7548
|
+
* model only gets the guards its provider contract calls for.
|
|
7549
|
+
*/
|
|
7550
|
+
private validateAndBindFinalBody;
|
|
7464
7551
|
/** Extract a human-readable message from an API error response body. */
|
|
7465
7552
|
private extractErrorMessage;
|
|
7466
7553
|
private buildRequestBody;
|
|
@@ -8335,4 +8422,4 @@ declare class NoopSpanManager implements SpanManager {
|
|
|
8335
8422
|
*/
|
|
8336
8423
|
declare function createSpanManager(config?: TelemetryConfig): Promise<SpanManager>;
|
|
8337
8424
|
|
|
8338
|
-
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedMessage, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationReport, FileDiagnosticArtifactStore, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, RedisStore, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, extractJson, extractThinkTags, findConfig, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
|
8425
|
+
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedMessage, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationReport, FileDiagnosticArtifactStore, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningContextReset, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, RedisStore, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedModelOptionError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, extractJson, extractThinkTags, findConfig, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|