@openclaw/ai 2026.9.1 → 2026.9.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/dist/{anthropic-hk7F7ptG.mjs → anthropic-BDdqdVLK.mjs} +208 -205
- package/dist/{anthropic-compaction-replay-OMJZ0uyo.mjs → anthropic-compaction-replay-DB2FGLQc.mjs} +130 -41
- package/dist/{anthropic-payload-policy-DBT1itQ-.d.mts → anthropic-payload-policy-d46X2pR0.d.mts} +27 -3
- package/dist/{api-registry-Cs6HGNqY.d.mts → api-registry-DWtPjzyn.d.mts} +2 -2
- package/dist/{azure-openai-responses-CN4Fy5zV.mjs → azure-openai-responses-C5bZRfAP.mjs} +5 -5
- package/dist/{diagnostics-KhXK-QJI.mjs → diagnostics-DfFyKeX_.mjs} +1 -1
- package/dist/diagnostics.mjs +2 -2
- package/dist/{event-stream-uSMZJ3FA.mjs → event-stream-BgDvQeum.mjs} +3 -9
- package/dist/{event-stream-vK_7r3bj.d.mts → event-stream-BhT5T1Ay.d.mts} +1 -1
- package/dist/event-stream-zctLx0yr.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/{google-CC-nrwXg.mjs → google-4qeuE8iX.mjs} +4 -4
- package/dist/{google-shared-CjPY0hZM.mjs → google-shared-CWeG8RIl.mjs} +7 -5
- package/dist/{google-vertex-DCr0pyzQ.mjs → google-vertex-O9BcnB6X.mjs} +4 -4
- package/dist/{host-BIaiBURL.mjs → host-CEvLw30U.mjs} +54 -9
- package/dist/{host-BztR4tQj.d.mts → host-DjzGmdZ2.d.mts} +3 -3
- package/dist/{index-AfaxKT8w.d.mts → index-FnHM2FcI.d.mts} +11 -5
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/internal/anthropic.d.mts +12 -9
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +1 -1
- package/dist/internal/openai.d.mts +7 -7
- package/dist/internal/openai.mjs +10 -10
- package/dist/internal/runtime.d.mts +5 -5
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +2 -2
- package/dist/internal/shared.mjs +3 -3
- package/dist/{mistral-B7etBd_H.mjs → mistral-Tb6oalqH.mjs} +10 -8
- package/dist/{openai-chatgpt-responses-BAJ4gq3i.mjs → openai-chatgpt-responses-yUXjPNfu.mjs} +26 -28
- package/dist/{openai-completions-D0QZ0AyB.mjs → openai-completions-BIUV3RDT.mjs} +8 -8
- package/dist/{openai-completions-compat-4IjSBpr6.d.mts → openai-completions-compat-CpjYUArk.d.mts} +3 -3
- package/dist/{openai-completions-stream-DZjwK8vp.mjs → openai-completions-stream-BsrBe3Gg.mjs} +16 -16
- package/dist/openai-prompt-cache-CGnVB74a.mjs +21 -0
- package/dist/openai-prompt-cache-CNoIfHYC.d.mts +16 -0
- package/dist/{openai-responses-BEUlxfDu.mjs → openai-responses-CCL41ALM.mjs} +8 -11
- package/dist/{openai-responses-compaction-window-DO7yV7az.mjs → openai-responses-compaction-window-BMVHFOtq.mjs} +18 -7
- package/dist/{openai-responses-contracts-bPzSN_Ba.d.mts → openai-responses-contracts-rF5DDRNS.d.mts} +12 -4
- package/dist/{openai-responses-prompt-observer-internal-C7x4IK7r.mjs → openai-responses-prompt-observer-internal-D0bhBfgL.mjs} +3 -3
- package/dist/{openai-responses-shared-DiAdpNAM.mjs → openai-responses-shared-Bmma_3Qc.mjs} +185 -109
- package/dist/{openai-tool-schema-BMiHFH36.mjs → openai-tool-schema-_pTAJqKF.mjs} +20 -32
- package/dist/{provider-error-B6EGq6gg.mjs → provider-error-9TraxGvt.mjs} +6 -7
- package/dist/{provider-options-CxFPtvh7.d.mts → provider-options-Bcc_p-TU.d.mts} +18 -6
- package/dist/provider-replay-context-BuSUaAk5.mjs +21 -0
- package/dist/{provider-transcript-transform-WvJmFUAf.mjs → provider-transcript-transform-BaMbI1hr.mjs} +1 -1
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +11 -11
- package/dist/{reasoning-tag-text-partitioner-C-4uedDb.mjs → reasoning-tag-text-partitioner-DLCNXki6.mjs} +72 -24
- package/dist/{sanitize-unicode-S6binQG-.mjs → sanitize-unicode-D6xUvZaS.mjs} +1 -1
- package/dist/{simple-options-0PLDyJ-d.mjs → simple-options-BjHCCh4v.mjs} +2 -2
- package/dist/{src-C8U7lkoa.mjs → src-2qBGKg8O.mjs} +9 -1
- package/dist/{tool-schema-json-projection-BtZiml7r.mjs → tool-schema-json-projection-mJhXDcyz.mjs} +1 -1
- package/dist/{transport-stream-shared-CytPVLIg.mjs → transport-stream-shared-CZqMhfIw.mjs} +4 -4
- package/dist/{transport-stream-shared-BrvFTkoO.d.mts → transport-stream-shared-xnaqxmbP.d.mts} +4 -4
- package/dist/{transport-utils-CtuS1Upe.mjs → transport-utils-7il795_9.mjs} +1 -1
- package/dist/transports.d.mts +11 -10
- package/dist/transports.mjs +567 -253
- package/dist/types-3Lnm-QSJ.d.mts +1 -0
- package/dist/{types-DbrhszyQ.d.mts → types-CJ1-Ht7A.d.mts} +29 -7
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +3 -3
- package/dist/{validation-BOwtcl9X.d.mts → validation-AKZBDGQd.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/package.json +2 -2
- package/dist/event-stream-DeDhbCc5.d.mts +0 -1
- package/dist/openai-prompt-cache-2uo_1OR1.d.mts +0 -7
- package/dist/openai-prompt-cache-mZTCdRPo.mjs +0 -12
- package/dist/types-B5EFUmXs.d.mts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as StreamOptions } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { J as StreamOptions } from "./types-CJ1-Ht7A.mjs";
|
|
2
|
+
import "./types-3Lnm-QSJ.mjs";
|
|
3
3
|
import OpenAI from "openai";
|
|
4
4
|
import Anthropic from "@anthropic-ai/sdk";
|
|
5
5
|
import { ResponseCreateParamsStreaming } from "openai/resources/responses/responses.js";
|
|
@@ -24,9 +24,11 @@ declare function isOpenAIGpt56Model(model: OpenAIReasoningModel): boolean;
|
|
|
24
24
|
declare function normalizeOpenAIReasoningEffort(effort: string): string;
|
|
25
25
|
/** Resolve the reasoning efforts accepted by a specific OpenAI-compatible model. */
|
|
26
26
|
declare function resolveOpenAISupportedReasoningEfforts(model: OpenAIReasoningModel): readonly OpenAIApiReasoningEffort[];
|
|
27
|
+
/** Read a declared or known model contract, leaving unknown compatible models unspecified. */
|
|
28
|
+
declare function resolveOpenAIModelReasoningEfforts(model: OpenAIReasoningModel): readonly OpenAIApiReasoningEffort[] | undefined;
|
|
27
29
|
/**
|
|
28
|
-
* Return whether a model accepts
|
|
29
|
-
*
|
|
30
|
+
* Return whether a model accepts temperature. GPT-5.6 and GPT-6 Astra
|
|
31
|
+
* reject it with a 400; catalog compat can override per model.
|
|
30
32
|
*/
|
|
31
33
|
declare function supportsOpenAITemperature(model: OpenAIReasoningModel): boolean;
|
|
32
34
|
/** Return whether a model accepts a requested reasoning effort. */
|
|
@@ -97,8 +99,18 @@ declare const reasoningTagTextPolicy: {
|
|
|
97
99
|
};
|
|
98
100
|
type AnthropicEffort = "low" | "medium" | "high" | "xhigh" | "max";
|
|
99
101
|
type AnthropicThinkingDisplay = "summarized" | "omitted";
|
|
102
|
+
type AnthropicContextManagementOptions = {
|
|
103
|
+
anthropicServerCompaction?: boolean;
|
|
104
|
+
anthropicCompactThreshold?: number;
|
|
105
|
+
cacheTtlPruning?: {
|
|
106
|
+
tools?: {
|
|
107
|
+
allow?: string[];
|
|
108
|
+
deny?: string[];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
100
112
|
/** Provider options shared by the Anthropic provider and canonical transport. */
|
|
101
|
-
interface AnthropicOptions extends StreamOptions {
|
|
113
|
+
interface AnthropicOptions extends StreamOptions, AnthropicContextManagementOptions {
|
|
102
114
|
/**
|
|
103
115
|
* Enable extended thinking.
|
|
104
116
|
* For Opus 4.6+ and Sonnet 4.6: uses adaptive thinking (model decides when/how much to think).
|
|
@@ -166,4 +178,4 @@ type OpenAICompletionsOptions = BaseOpenAIStreamOptions & {
|
|
|
166
178
|
reasoningEffort?: OpenAIReasoningEffort;
|
|
167
179
|
};
|
|
168
180
|
//#endregion
|
|
169
|
-
export {
|
|
181
|
+
export { resolveOpenAIReasoningEffortForModel as C, supportsOpenAITemperature as E, resolveOpenAIModelReasoningEfforts as S, supportsOpenAIReasoningEffort as T, OpenAIReasoningEffort as _, BaseOpenAIStreamOptions as a, isOpenAIGpt56Model as b, OpenAIResponsesCompactionRejection as c, OpenAICompletionsToolChoice as d, OpenAIToolProjection as f, OpenAIApiReasoningEffort as g, reconcileOpenAIResponsesToolChoice as h, AnthropicThinkingDisplay as i, codeModeToolSurfaceObserver as l, reconcileOpenAICompletionsToolChoice as m, AnthropicEffort as n, CodeModeToolSurfaceObservation as o, projectOpenAITools as p, AnthropicOptions as r, OpenAICompletionsOptions as s, AnthropicContextManagementOptions as t, reasoningTagTextPolicy as u, isOpenAIGpt54MiniModel as v, resolveOpenAISupportedReasoningEfforts as w, normalizeOpenAIReasoningEffort as x, isOpenAIGpt55Model as y };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as shortHash } from "./hash-CHgqbJmD.mjs";
|
|
2
|
+
//#region packages/ai/src/transports/provider-replay-context.ts
|
|
3
|
+
function hashReplayContextValue(value) {
|
|
4
|
+
const normalized = value?.trim();
|
|
5
|
+
return normalized ? shortHash(normalized) : void 0;
|
|
6
|
+
}
|
|
7
|
+
function buildProviderReplayContext(model, options) {
|
|
8
|
+
return {
|
|
9
|
+
provider: model.provider,
|
|
10
|
+
api: model.api,
|
|
11
|
+
model: model.id,
|
|
12
|
+
baseUrlHash: hashReplayContextValue(model.baseUrl),
|
|
13
|
+
sessionHash: hashReplayContextValue(options?.sessionId),
|
|
14
|
+
authProfileHash: hashReplayContextValue(options?.authProfileId)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function providerReplayContextMatches(state, context) {
|
|
18
|
+
return state.provider === context.provider && state.api === context.api && state.model === context.model && state.baseUrlHash === context.baseUrlHash && state.sessionHash === context.sessionHash && state.authProfileHash === context.authProfileHash;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { providerReplayContextMatches as n, buildProviderReplayContext as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformMessages } from "./host-
|
|
1
|
+
import { i as transformMessages } from "./host-CEvLw30U.mjs";
|
|
2
2
|
//#region packages/ai/src/provider-transcript-transform.ts
|
|
3
3
|
const IMAGE_OMISSION = "(image omitted: model does not support images)";
|
|
4
4
|
const VIDEO_OMISSION = "(video omitted: provider does not support video input)";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as supportsClaude1MContext, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as index_d_exports, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./index-FnHM2FcI.mjs";
|
|
2
2
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, s as isProviderRefusalAssistantError, t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
|
|
3
|
-
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-
|
|
4
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import "./types-
|
|
3
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-CJ1-Ht7A.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BhT5T1Ay.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-AKZBDGQd.mjs";
|
|
6
|
+
import "./types-3Lnm-QSJ.mjs";
|
|
7
7
|
//#region packages/ai/src/provider-types.d.ts
|
|
8
8
|
export declare const PROVIDER_CONTEXT_HANDOFF: unique symbol;
|
|
9
9
|
export type VideoContent = Omit<ImageContent, "type"> & {
|
|
@@ -29,4 +29,4 @@ export type ProviderStreamFunction<TApi extends Api = Api, TOptions extends Stre
|
|
|
29
29
|
/** Resolves provider-only context without widening the canonical call contract. */
|
|
30
30
|
export declare function resolveProviderContext(context: Context | ProviderContext, options?: ProviderStreamOptions): Promise<ProviderContext>;
|
|
31
31
|
//#endregion
|
|
32
|
-
export type { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, ProviderContext as Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, ProviderMessage as Message, ProviderModel as Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamFunction as StreamFunction, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
32
|
+
export type { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, ProviderContext as Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, ProviderMessage as Message, ProviderModel as Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamFunction as StreamFunction, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/providers.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
1
|
+
import { n as ApiRegistry } from "./api-registry-DWtPjzyn.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-CNoIfHYC.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/register-builtins.d.ts
|
|
4
4
|
/** Source id used for built-in API provider registrations. */
|
|
5
5
|
export declare const BUILT_IN_API_PROVIDER_SOURCE_ID = "core:built-in";
|
package/dist/providers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
2
|
-
import { n as projectProviderError } from "./provider-error-
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
1
|
+
import { t as AssistantMessageEventStream } from "./event-stream-BgDvQeum.mjs";
|
|
2
|
+
import { n as projectProviderError } from "./provider-error-9TraxGvt.mjs";
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-CGnVB74a.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
5
5
|
/** Source id used for built-in API provider registrations. */
|
|
6
6
|
const BUILT_IN_API_PROVIDER_SOURCE_ID = "core:built-in";
|
|
@@ -62,35 +62,35 @@ function createLazyRegistration(api, importModule, select) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
const registerBuiltIns = [
|
|
65
|
-
createLazyRegistration("anthropic-messages", () => import("./anthropic-
|
|
65
|
+
createLazyRegistration("anthropic-messages", () => import("./anthropic-BDdqdVLK.mjs").then((n) => n.t), (module) => ({
|
|
66
66
|
stream: module.streamAnthropic,
|
|
67
67
|
streamSimple: module.streamSimpleAnthropic
|
|
68
68
|
})),
|
|
69
|
-
createLazyRegistration("openai-completions", () => import("./openai-completions-
|
|
69
|
+
createLazyRegistration("openai-completions", () => import("./openai-completions-BIUV3RDT.mjs").then((n) => n.t), (module) => ({
|
|
70
70
|
stream: module.streamOpenAICompletions,
|
|
71
71
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
72
72
|
})),
|
|
73
|
-
createLazyRegistration("mistral-conversations", () => import("./mistral-
|
|
73
|
+
createLazyRegistration("mistral-conversations", () => import("./mistral-Tb6oalqH.mjs"), (module) => ({
|
|
74
74
|
stream: module.streamMistral,
|
|
75
75
|
streamSimple: module.streamSimpleMistral
|
|
76
76
|
})),
|
|
77
|
-
createLazyRegistration("openai-responses", () => import("./openai-responses-
|
|
77
|
+
createLazyRegistration("openai-responses", () => import("./openai-responses-CCL41ALM.mjs").then((n) => n.t), (module) => ({
|
|
78
78
|
stream: module.streamOpenAIResponses,
|
|
79
79
|
streamSimple: module.streamSimpleOpenAIResponses
|
|
80
80
|
})),
|
|
81
|
-
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-
|
|
81
|
+
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-C5bZRfAP.mjs"), (module) => ({
|
|
82
82
|
stream: module.streamAzureOpenAIResponses,
|
|
83
83
|
streamSimple: module.streamSimpleAzureOpenAIResponses
|
|
84
84
|
})),
|
|
85
|
-
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-
|
|
85
|
+
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-yUXjPNfu.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamOpenAICodexResponses,
|
|
87
87
|
streamSimple: module.streamSimpleOpenAICodexResponses
|
|
88
88
|
})),
|
|
89
|
-
createLazyRegistration("google-generative-ai", () => import("./google-
|
|
89
|
+
createLazyRegistration("google-generative-ai", () => import("./google-4qeuE8iX.mjs"), (module) => ({
|
|
90
90
|
stream: module.streamGoogle,
|
|
91
91
|
streamSimple: module.streamSimpleGoogle
|
|
92
92
|
})),
|
|
93
|
-
createLazyRegistration("google-vertex", () => import("./google-vertex-
|
|
93
|
+
createLazyRegistration("google-vertex", () => import("./google-vertex-O9BcnB6X.mjs"), (module) => ({
|
|
94
94
|
stream: module.streamGoogleVertex,
|
|
95
95
|
streamSimple: module.streamSimpleGoogleVertex
|
|
96
96
|
}))
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
+
import "./provider-error-9TraxGvt.mjs";
|
|
3
|
+
//#region packages/normalization-core/src/expect.ts
|
|
4
|
+
/** Returns the value or throws with the named context; use for genuine invariants only. */
|
|
5
|
+
function expectDefined(value, context) {
|
|
6
|
+
if (value === null || value === void 0) throw new Error("expected " + context + " to be defined");
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
2
10
|
//#region node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
3
11
|
/**
|
|
4
12
|
* @typedef {import('mdast').Nodes} Nodes
|
|
@@ -11687,41 +11695,81 @@ function findNextLineEnding(text, start) {
|
|
|
11687
11695
|
if (carriageReturn === -1) return lineFeed;
|
|
11688
11696
|
return lineFeed === -1 ? carriageReturn : Math.min(carriageReturn, lineFeed);
|
|
11689
11697
|
}
|
|
11690
|
-
function
|
|
11698
|
+
function captureInlineSources(text, sources) {
|
|
11699
|
+
const observe = function(token) {
|
|
11700
|
+
const start = this.stack.findLast((entry) => entry.type === "inlineCode")?.position?.start.offset;
|
|
11701
|
+
if (start === void 0) return;
|
|
11702
|
+
let source = sources.get(start);
|
|
11703
|
+
if (!source) {
|
|
11704
|
+
const inlineBlock = this.stack.findLast((entry) => entry.type === "paragraph" || entry.type === "heading");
|
|
11705
|
+
const begin = inlineBlock?.children[0]?.position?.start.offset;
|
|
11706
|
+
const containers = this.stack.filter((entry) => entry.type === "listItem" || entry.type === "blockquote");
|
|
11707
|
+
const prefixEnd = begin !== void 0 && containers.length ? begin : start;
|
|
11708
|
+
const prefixStart = containers.length ? Math.max(text.lastIndexOf("\n", prefixEnd - 1), text.lastIndexOf("\r", prefixEnd - 1)) + 1 : start;
|
|
11709
|
+
const prefix = containers.map((entry) => text.slice(entry.position?.start.offset, entry.children[0]?.position?.start.offset)).join("");
|
|
11710
|
+
source = {
|
|
11711
|
+
prefix: {
|
|
11712
|
+
start: prefixStart,
|
|
11713
|
+
end: prefixEnd,
|
|
11714
|
+
ownerStart: containers[0]?.position?.start.offset ?? start,
|
|
11715
|
+
text: prefix + (containers.length && inlineBlock?.type === "heading" ? text.slice(inlineBlock.position?.start.offset, begin) : "")
|
|
11716
|
+
},
|
|
11717
|
+
value: "",
|
|
11718
|
+
offsets: []
|
|
11719
|
+
};
|
|
11720
|
+
sources.set(start, source);
|
|
11721
|
+
}
|
|
11722
|
+
const value = this.sliceSerialize(token);
|
|
11723
|
+
const extra = value.length - (token.end.offset - token.start.offset);
|
|
11724
|
+
for (let cursor = start + source.offsets.length; cursor < token.end.offset; cursor += 1) {
|
|
11725
|
+
const consumed = cursor - token.start.offset;
|
|
11726
|
+
source.offsets.push(source.value.length + (consumed > 0 ? consumed + extra : 0));
|
|
11727
|
+
}
|
|
11728
|
+
source.value += value;
|
|
11729
|
+
};
|
|
11730
|
+
return { enter: {
|
|
11731
|
+
codeTextData(token) {
|
|
11732
|
+
observe.call(this, token);
|
|
11733
|
+
expectDefined(this.config.enter.data, "Markdown data handler").call(this, token);
|
|
11734
|
+
},
|
|
11735
|
+
lineEnding: observe
|
|
11736
|
+
} };
|
|
11737
|
+
}
|
|
11738
|
+
function parseMarkdownOwnership(text, options) {
|
|
11691
11739
|
if (!text) return {
|
|
11692
|
-
|
|
11740
|
+
regions: [],
|
|
11693
11741
|
codeSpans: [],
|
|
11694
11742
|
retainStart: 0
|
|
11695
11743
|
};
|
|
11744
|
+
const sources = /* @__PURE__ */ new Map();
|
|
11745
|
+
const tables = options?.syntax !== "commonmark";
|
|
11696
11746
|
const tree = fromMarkdown(text, {
|
|
11697
|
-
extensions: [DISABLE_HTML_MARKDOWN, gfmTable()],
|
|
11698
|
-
mdastExtensions: [gfmTableFromMarkdown()]
|
|
11747
|
+
extensions: [DISABLE_HTML_MARKDOWN, ...tables ? [gfmTable()] : []],
|
|
11748
|
+
mdastExtensions: [...tables ? [gfmTableFromMarkdown()] : [], ...options?.includeSource ? [captureInlineSources(text, sources)] : []]
|
|
11699
11749
|
});
|
|
11700
|
-
const
|
|
11701
|
-
const blockSpans = [];
|
|
11750
|
+
const regions = [];
|
|
11702
11751
|
const pending = [tree];
|
|
11703
11752
|
while (pending.length > 0) {
|
|
11704
|
-
const node = pending.pop();
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
const
|
|
11709
|
-
if (
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
const child = children[index];
|
|
11717
|
-
if (child) pending.push(child);
|
|
11753
|
+
const node = expectDefined(pending.pop(), "Markdown ownership node");
|
|
11754
|
+
const start = node.position?.start?.offset;
|
|
11755
|
+
const end = node.position?.end?.offset;
|
|
11756
|
+
if ((node.type === "code" || node.type === "inlineCode") && start !== void 0 && end !== void 0) {
|
|
11757
|
+
const source = sources.get(start);
|
|
11758
|
+
if (source) while (source.offsets.length <= end - start) source.offsets.push(source.value.length);
|
|
11759
|
+
regions.push({
|
|
11760
|
+
start,
|
|
11761
|
+
end,
|
|
11762
|
+
block: node.type === "code",
|
|
11763
|
+
...source ? { source } : {}
|
|
11764
|
+
});
|
|
11718
11765
|
}
|
|
11766
|
+
for (const child of node.children?.toReversed() ?? []) pending.push(child);
|
|
11719
11767
|
}
|
|
11720
|
-
|
|
11768
|
+
regions.sort((left, right) => left.start - right.start);
|
|
11721
11769
|
return {
|
|
11722
|
-
|
|
11723
|
-
codeSpans:
|
|
11724
|
-
retainStart:
|
|
11770
|
+
regions,
|
|
11771
|
+
codeSpans: regions.map(({ start, end }) => [start, end]),
|
|
11772
|
+
retainStart: tree.children?.at(-1)?.position?.start?.offset ?? text.length
|
|
11725
11773
|
};
|
|
11726
11774
|
}
|
|
11727
11775
|
function isInsideCode(index, spans) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as requiresClaudeMandatoryAdaptiveThinking, p as resolveClaudeNativeThinkingLevelMap, t as calculateUsageCost } from "./src-2qBGKg8O.mjs";
|
|
2
2
|
//#region packages/ai/src/model-utils.ts
|
|
3
3
|
/** Calculates and stores model cost fields from token usage and per-million pricing. */
|
|
4
4
|
function calculateCost(model, usage) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as normalizeLowercaseStringOrEmpty } from "./utf16-slice-qz3nsy87.mjs";
|
|
2
|
-
import { t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
3
|
-
import { r as copyProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
2
|
+
import { t as sanitizeSurrogates } from "./sanitize-unicode-D6xUvZaS.mjs";
|
|
3
|
+
import { r as copyProviderAcceptanceObserver } from "./transport-stream-shared-CZqMhfIw.mjs";
|
|
4
4
|
//#region packages/ai/src/utils/prompt-cache-stability.ts
|
|
5
5
|
/**
|
|
6
6
|
* Prompt-cache normalization helpers. They keep generated prompt sections
|
|
@@ -51,6 +51,14 @@ function resolveClaudeMythos5ModelIdentity(ref) {
|
|
|
51
51
|
if (!match) return;
|
|
52
52
|
return normalized.slice((match.index ?? 0) + (match[0].startsWith("-") ? 1 : 0));
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Anthropic binds thinking to the conversation prefix starting with Fable 5.1 and
|
|
56
|
+
* plans to enforce it on later models. Extend only with live replay proof for the
|
|
57
|
+
* new model (Mythos 5.1 is unregistered here and unproven).
|
|
58
|
+
*/
|
|
59
|
+
function bindsClaudeThinkingPrefix(ref) {
|
|
60
|
+
return /^claude-fable-5-1(?=$|[^a-z0-9])/.test(resolveClaudeModelIdentity(ref));
|
|
61
|
+
}
|
|
54
62
|
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
55
63
|
function requiresClaudeMandatoryAdaptiveThinking(ref) {
|
|
56
64
|
const modelId = resolveClaudeModelIdentity(ref);
|
|
@@ -187,4 +195,4 @@ function calculateUsageCost(usage, pricing) {
|
|
|
187
195
|
return cost;
|
|
188
196
|
}
|
|
189
197
|
//#endregion
|
|
190
|
-
export {
|
|
198
|
+
export { supportsClaudeAdaptiveThinking as _, CLAUDE_OPUS_5_THINKING_PROFILE as a, supportsClaudeNativeXhighEffort as b, requiresClaudeDefaultSampling as c, resolveClaudeModelIdentity as d, resolveClaudeMythos5ModelIdentity as f, supportsClaude1MContext as g, resolveClaudeSonnet5ModelIdentity as h, CLAUDE_FABLE_5_THINKING_PROFILE as i, requiresClaudeMandatoryAdaptiveThinking as l, resolveClaudeOpus5ModelIdentity as m, normalizeModelCostConfig as n, CLAUDE_SONNET_5_THINKING_PROFILE as o, resolveClaudeNativeThinkingLevelMap as p, normalizeResolvedPricing as r, bindsClaudeThinkingPrefix as s, calculateUsageCost as t, resolveClaudeFable5ModelIdentity as u, supportsClaudeFastMode as v, supportsClaudeNativeMaxEffort as y };
|
package/dist/{tool-schema-json-projection-BtZiml7r.mjs → tool-schema-json-projection-mJhXDcyz.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./utf16-slice-qz3nsy87.mjs";
|
|
2
|
-
import { n as getAiTransportHost } from "./host-
|
|
2
|
+
import { n as getAiTransportHost } from "./host-CEvLw30U.mjs";
|
|
3
3
|
import { types } from "node:util";
|
|
4
4
|
//#region packages/ai/src/transports/host-policy.ts
|
|
5
5
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-CPeq9F7y.mjs";
|
|
2
|
-
import { r as createAssistantMessageEventStream } from "./event-stream-
|
|
2
|
+
import { r as createAssistantMessageEventStream } from "./event-stream-BgDvQeum.mjs";
|
|
3
3
|
import { a as asOptionalRecord, n as asNonArrayRecord, r as asNullableRecord } from "./utf16-slice-qz3nsy87.mjs";
|
|
4
|
-
import { t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
5
|
-
import { n as projectProviderError, r as projectDiagnosticValue } from "./provider-error-
|
|
6
|
-
import { n as isTransientNetworkError } from "./diagnostics-
|
|
4
|
+
import { t as sanitizeSurrogates } from "./sanitize-unicode-D6xUvZaS.mjs";
|
|
5
|
+
import { n as projectProviderError, r as projectDiagnosticValue } from "./provider-error-9TraxGvt.mjs";
|
|
6
|
+
import { n as isTransientNetworkError } from "./diagnostics-DfFyKeX_.mjs";
|
|
7
7
|
//#region packages/ai/src/utils/headers.ts
|
|
8
8
|
/** Converts a Headers object to a plain record for provider request handling. */
|
|
9
9
|
function headersToRecord(headers) {
|
package/dist/{transport-stream-shared-BrvFTkoO.d.mts → transport-stream-shared-xnaqxmbP.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { B as ProviderResponse, D as Model, J as StreamOptions, a as AssistantMessage, at as Usage } from "./types-
|
|
3
|
-
import { r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import "./event-stream-
|
|
1
|
+
import "./index-FnHM2FcI.mjs";
|
|
2
|
+
import { B as ProviderResponse, D as Model, J as StreamOptions, a as AssistantMessage, at as Usage } from "./types-CJ1-Ht7A.mjs";
|
|
3
|
+
import { r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BhT5T1Ay.mjs";
|
|
4
|
+
import "./event-stream-zctLx0yr.mjs";
|
|
5
5
|
import { t as ProviderErrorProjection } from "./provider-error-CzNw4BWX.mjs";
|
|
6
6
|
//#region packages/ai/src/utils/stream-first-event-timeout.d.ts
|
|
7
7
|
type StreamStage = "responses" | "completions";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as normalizeOptionalString, t as truncateUtf16Safe } from "./utf16-slice-qz3nsy87.mjs";
|
|
2
|
-
import { n as getAiTransportHost } from "./host-
|
|
2
|
+
import { n as getAiTransportHost } from "./host-CEvLw30U.mjs";
|
|
3
3
|
import { c as parseStrictNonNegativeInteger, i as asFiniteNumberInRange, l as parseStrictPositiveInteger, s as parseStrictFiniteNumber } from "./base64-CEFBpSkN.mjs";
|
|
4
4
|
import { parseRetryAfterHttpDateMs } from "./internal/retry-after.mjs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
package/dist/transports.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model, K as StreamFn, Q as ThinkingContent, Y as TextContent, a as AssistantMessage, at as Usage, d as Context, j as OpenAICompletionsCompat, n as Api, nt as ToolCall, o as AssistantMessageEvent, z as ProviderReplayState } from "./types-
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
4
|
-
import { a as
|
|
5
|
-
import "./types-
|
|
6
|
-
import { a as
|
|
7
|
-
import { a as ReplayableResponseCompactionItem, c as OpenAIResponsesCompactionOutput, i as OpenAIResponsesRequestParams, n as OpenAIResponsesOptions, o as ResponsesPromptObservation, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-
|
|
1
|
+
import "./index-FnHM2FcI.mjs";
|
|
2
|
+
import { D as Model, K as StreamFn, Q as ThinkingContent, Y as TextContent, a as AssistantMessage, at as Usage, d as Context, j as OpenAICompletionsCompat, n as Api, nt as ToolCall, o as AssistantMessageEvent, z as ProviderReplayState } from "./types-CJ1-Ht7A.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-DWtPjzyn.mjs";
|
|
4
|
+
import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, f as OpenAIToolProjection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-Bcc_p-TU.mjs";
|
|
5
|
+
import "./types-3Lnm-QSJ.mjs";
|
|
6
|
+
import { a as isAnthropicServerToolClearingEnabled, c as resolveAnthropicContextManagementBetaHeader, d as resolveAnthropicServerCompactionPlan, i as applyAnthropicPayloadPolicyToParams, l as resolveAnthropicEphemeralCacheControl, n as applyAnthropicContextManagementToRequest, o as isDirectAnthropicModel, r as applyAnthropicEphemeralCacheControlMarkers, s as logAnthropicContextEdits, t as applyAnthropicCacheControlToMessages, u as resolveAnthropicPayloadPolicy } from "./anthropic-payload-policy-d46X2pR0.mjs";
|
|
7
|
+
import { a as ReplayableResponseCompactionItem, c as OpenAIResponsesCompactionOutput, i as OpenAIResponsesRequestParams, n as OpenAIResponsesOptions, o as ResponsesPromptObservation, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-rF5DDRNS.mjs";
|
|
8
8
|
import { i as resolveOpenAIResponsesServerCompactionPlan, n as resolveOpenAIResponsesCompactEndpointPlan, r as resolveOpenAIResponsesPayloadPolicy, t as applyOpenAIResponsesPayloadPolicy } from "./openai-responses-payload-policy-rLRPsSmB.mjs";
|
|
9
|
-
import { n as detectOpenAICompletionsCompat, r as resolveOpenAICompletionsCompat, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
10
|
-
import { C as FirstStreamEventInternalOptions, _ as sanitizeNonEmptyTransportPayloadText, a as copyProviderAcceptanceObserver, b as withProviderAcceptanceObserver, c as failTransportStream, d as mergeTransportHeaders, f as mergeTransportMetadata, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as coerceTransportToolCallArguments, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as WritableTransportStream, o as createEmptyTransportUsage, p as notifyProviderHttpMetadata, r as assignTransportErrorDetails, s as createWritableTransportEventStream, t as ProviderAcceptance, u as finalizeTransportStream, v as sanitizeTransportPayloadText, x as withProviderResponseHook, y as transportAbortError } from "./transport-stream-shared-
|
|
9
|
+
import { n as detectOpenAICompletionsCompat, r as resolveOpenAICompletionsCompat, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-CpjYUArk.mjs";
|
|
10
|
+
import { C as FirstStreamEventInternalOptions, _ as sanitizeNonEmptyTransportPayloadText, a as copyProviderAcceptanceObserver, b as withProviderAcceptanceObserver, c as failTransportStream, d as mergeTransportHeaders, f as mergeTransportMetadata, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as coerceTransportToolCallArguments, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as WritableTransportStream, o as createEmptyTransportUsage, p as notifyProviderHttpMetadata, r as assignTransportErrorDetails, s as createWritableTransportEventStream, t as ProviderAcceptance, u as finalizeTransportStream, v as sanitizeTransportPayloadText, x as withProviderResponseHook, y as transportAbortError } from "./transport-stream-shared-xnaqxmbP.mjs";
|
|
11
11
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-Cwcjv_fx.mjs";
|
|
12
12
|
import OpenAI from "openai";
|
|
13
13
|
import { ResponseCreateParamsStreaming, ResponseInput, ResponseInputItem as ResponseInputItem$1 } from "openai/resources/responses/responses.js";
|
|
@@ -285,6 +285,7 @@ type ResponsesEventSink = {
|
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region packages/ai/src/transports/openai-responses-stream-types-internal.d.ts
|
|
287
287
|
type ResponsesStreamOptions = FirstStreamEventInternalOptions & {
|
|
288
|
+
asyncToolExecution?: boolean;
|
|
288
289
|
serviceTier?: ResponseCreateParamsStreaming["service_tier"];
|
|
289
290
|
resolveServiceTier?: (responseServiceTier: ResponseCreateParamsStreaming["service_tier"] | undefined, requestServiceTier: ResponseCreateParamsStreaming["service_tier"] | undefined) => ResponseCreateParamsStreaming["service_tier"] | undefined;
|
|
290
291
|
applyServiceTierPricing?: (usage: Usage, serviceTier: ResponseCreateParamsStreaming["service_tier"] | undefined) => void;
|
|
@@ -469,4 +470,4 @@ export declare function prepareModelForSimpleCompletion<TApi extends Api>(params
|
|
|
469
470
|
export declare const MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE = "OpenClaw transport error: malformed_streaming_fragment";
|
|
470
471
|
export declare function isCodeModeModelVisibleToolName(name: string, visibleToolNames: ReadonlySet<string>): boolean;
|
|
471
472
|
//#endregion
|
|
472
|
-
export { type OpenAICompletionsOptions, type OpenAIResponsesCompactionRejection, ProviderAcceptance, ResolvedOpenAICompletionsCompat, WritableTransportStream, applyAnthropicCacheControlToMessages, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyOpenAIResponsesPayloadPolicy, assignTransportErrorDetails, coerceTransportToolCallArguments, copyProviderAcceptanceObserver, createEmptyTransportUsage, createWritableTransportEventStream, detectOpenAICompletionsCompat, failTransportStream, finalizeTerminalToolCallArguments, finalizeTransportStream, mergeTransportHeaders, mergeTransportMetadata, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseTerminalToolCallArguments, resolveAnthropicEphemeralCacheControl, resolveAnthropicPayloadPolicy, resolveAnthropicServerCompactionPlan, resolveOpenAICompletionsCompat, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, sanitizeNonEmptyTransportPayloadText, sanitizeTransportPayloadText, sortPromptCacheToolsByName as sortTransportToolsByName, transportAbortError, withProviderAcceptanceObserver, withProviderResponseHook };
|
|
473
|
+
export { type OpenAICompletionsOptions, type OpenAIResponsesCompactionRejection, ProviderAcceptance, ResolvedOpenAICompletionsCompat, WritableTransportStream, applyAnthropicCacheControlToMessages, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyOpenAIResponsesPayloadPolicy, assignTransportErrorDetails, coerceTransportToolCallArguments, copyProviderAcceptanceObserver, createEmptyTransportUsage, createWritableTransportEventStream, detectOpenAICompletionsCompat, failTransportStream, finalizeTerminalToolCallArguments, finalizeTransportStream, isAnthropicServerToolClearingEnabled, isDirectAnthropicModel, logAnthropicContextEdits, mergeTransportHeaders, mergeTransportMetadata, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseTerminalToolCallArguments, resolveAnthropicContextManagementBetaHeader, resolveAnthropicEphemeralCacheControl, resolveAnthropicPayloadPolicy, resolveAnthropicServerCompactionPlan, resolveOpenAICompletionsCompat, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, sanitizeNonEmptyTransportPayloadText, sanitizeTransportPayloadText, sortPromptCacheToolsByName as sortTransportToolsByName, transportAbortError, withProviderAcceptanceObserver, withProviderResponseHook };
|