@openclaw/ai 2026.8.2 → 2026.9.1
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-compaction-replay-CKCDrZJv.mjs → anthropic-compaction-replay-OMJZ0uyo.mjs} +5 -5
- package/dist/{anthropic-DTGZ4VMY.mjs → anthropic-hk7F7ptG.mjs} +16 -13
- package/dist/{anthropic-payload-policy-BTzmNC14.d.mts → anthropic-payload-policy-DBT1itQ-.d.mts} +2 -2
- package/dist/{api-registry-BbUHEKER.d.mts → api-registry-Cs6HGNqY.d.mts} +2 -2
- package/dist/{azure-openai-responses-BmqaDXM1.mjs → azure-openai-responses-CN4Fy5zV.mjs} +6 -4
- package/dist/{diagnostics-COpOtRwq.mjs → diagnostics-CPeq9F7y.mjs} +5 -1
- package/dist/{diagnostics-BaTA9eVl.d.mts → diagnostics-DnPnOui6.d.mts} +5 -1
- package/dist/diagnostics-KhXK-QJI.mjs +136 -0
- package/dist/diagnostics.d.mts +7 -2
- package/dist/diagnostics.mjs +4 -3
- package/dist/event-stream-DeDhbCc5.d.mts +1 -0
- package/dist/{event-stream-DcvAPSBe.d.mts → event-stream-vK_7r3bj.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-CqjVZMwo.mjs → google-CC-nrwXg.mjs} +2 -2
- package/dist/{google-shared-Bnqni5j3.mjs → google-shared-CjPY0hZM.mjs} +2 -2
- package/dist/{google-vertex-D_WREEJi.mjs → google-vertex-DCr0pyzQ.mjs} +2 -2
- package/dist/{host-DKFUAmCn.d.mts → host-BztR4tQj.d.mts} +3 -3
- package/dist/{index-CefaUGSS.d.mts → index-AfaxKT8w.d.mts} +5 -5
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +8 -8
- package/dist/internal/anthropic.mjs +2 -2
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai.d.mts +5 -5
- package/dist/internal/openai.mjs +6 -6
- package/dist/internal/runtime.d.mts +5 -5
- package/dist/internal/runtime.mjs +6 -4
- package/dist/internal/shared.d.mts +2 -2
- package/dist/internal/shared.mjs +93 -2
- package/dist/{mistral-C24jVd6f.mjs → mistral-B7etBd_H.mjs} +5 -6
- package/dist/{openai-chatgpt-responses-Czum0oXz.mjs → openai-chatgpt-responses-BAJ4gq3i.mjs} +51 -111
- package/dist/{openai-completions-BfFwac6f.mjs → openai-completions-D0QZ0AyB.mjs} +9 -10
- package/dist/{openai-completions-compat-SZhi0Lf4.d.mts → openai-completions-compat-4IjSBpr6.d.mts} +5 -5
- package/dist/{openai-completions-stream-DGOvau4J.mjs → openai-completions-stream-DZjwK8vp.mjs} +14 -11
- package/dist/{openai-responses-BAryVEJM.mjs → openai-responses-BEUlxfDu.mjs} +4 -3
- package/dist/{openai-responses-contracts-BthRXano.d.mts → openai-responses-contracts-bPzSN_Ba.d.mts} +3 -3
- package/dist/{openai-responses-prompt-observer-internal--R0kZLOZ.mjs → openai-responses-prompt-observer-internal-C7x4IK7r.mjs} +3 -17
- package/dist/{openai-responses-shared-CxgdGBvm.mjs → openai-responses-shared-DiAdpNAM.mjs} +82 -89
- package/dist/{openai-tool-schema-CSMh5e9O.mjs → openai-tool-schema-BMiHFH36.mjs} +1 -1
- package/dist/{provider-error-BI8kIViN.mjs → provider-error-B6EGq6gg.mjs} +1 -0
- package/dist/{provider-options-DJd_9euj.d.mts → provider-options-CxFPtvh7.d.mts} +2 -2
- package/dist/provider-types.d.mts +7 -7
- package/dist/providers.d.mts +1 -1
- package/dist/providers.mjs +9 -9
- package/dist/{reasoning-tag-text-partitioner-BsUX44Tq.mjs → reasoning-tag-text-partitioner-C-4uedDb.mjs} +63 -57
- package/dist/{simple-options-rdOPzr7Z.mjs → simple-options-0PLDyJ-d.mjs} +1 -2
- package/dist/{transport-stream-shared-BbG7PThh.d.mts → transport-stream-shared-BrvFTkoO.d.mts} +5 -5
- package/dist/{transport-stream-shared-D8nQWCUo.mjs → transport-stream-shared-CytPVLIg.mjs} +17 -4
- package/dist/transports.d.mts +11 -11
- package/dist/transports.mjs +26 -30
- package/dist/types-B5EFUmXs.d.mts +1 -0
- package/dist/{types-Beemor2E.d.mts → types-DbrhszyQ.d.mts} +3 -6
- package/dist/types.d.mts +7 -7
- package/dist/types.mjs +2 -2
- package/dist/{validation-CC6s7Smp.d.mts → validation-BOwtcl9X.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/package.json +1 -1
- package/dist/event-stream-pXT3FI6X.d.mts +0 -1
- package/dist/tls-certificate-errors-DXSpluKI.mjs +0 -93
- package/dist/types-COdhCX0U.d.mts +0 -1
package/dist/{openai-completions-stream-DGOvau4J.mjs → openai-completions-stream-DZjwK8vp.mjs}
RENAMED
|
@@ -2,17 +2,17 @@ import { c as normalizeLowercaseStringOrEmpty, i as asOptionalObjectRecord, o as
|
|
|
2
2
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-S6binQG-.mjs";
|
|
3
3
|
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, n as getAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
4
4
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-mZTCdRPo.mjs";
|
|
5
|
-
import { d as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
5
|
+
import { d as stripSystemPromptCacheBoundary } from "./simple-options-0PLDyJ-d.mjs";
|
|
6
6
|
import { o as resolveProviderRequestCapabilities, r as resolveModelRequestTimeoutMs, s as resolveProviderRequestPolicyConfig } from "./tool-schema-json-projection-BtZiml7r.mjs";
|
|
7
7
|
import { i as isCodeModeModelVisibleToolName, p as sha256Hex } from "./transport-utils-CtuS1Upe.mjs";
|
|
8
|
-
import { s as finalizeTerminalToolCallArguments } from "./transport-stream-shared-
|
|
8
|
+
import { s as finalizeTerminalToolCallArguments } from "./transport-stream-shared-CytPVLIg.mjs";
|
|
9
9
|
import { r as parseStreamingJson, t as createToolArgumentPreviewSchedule } from "./json-parse-BuAJEbdW.mjs";
|
|
10
10
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
11
|
-
import { A as readOpenAICompletionsReasoningBatch, D as measureUtf8AppendBytes, N as throwIfModelStreamAborted, O as parseOpenAICompletionsUsage, S as createModelStreamCooperativeScheduler, T as isOpenAICompletionsThinkingEnabled, a as resolveOpenAIProjectedToolsStrictToolFlag, k as readOpenAICompletionsContentDeltas, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-
|
|
11
|
+
import { A as readOpenAICompletionsReasoningBatch, D as measureUtf8AppendBytes, N as throwIfModelStreamAborted, O as parseOpenAICompletionsUsage, S as createModelStreamCooperativeScheduler, T as isOpenAICompletionsThinkingEnabled, a as resolveOpenAIProjectedToolsStrictToolFlag, k as readOpenAICompletionsContentDeltas, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-BMiHFH36.mjs";
|
|
12
12
|
import { a as withFirstStreamEventTimeout } from "./stream-first-event-timeout-DcNjoFQE.mjs";
|
|
13
13
|
import { t as transformProviderMessages } from "./provider-transcript-transform-WvJmFUAf.mjs";
|
|
14
14
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-Drnn_6Qj.mjs";
|
|
15
|
-
import { t as createReasoningTagTextPartitioner } from "./reasoning-tag-text-partitioner-
|
|
15
|
+
import { t as createReasoningTagTextPartitioner } from "./reasoning-tag-text-partitioner-C-4uedDb.mjs";
|
|
16
16
|
import { randomUUID } from "node:crypto";
|
|
17
17
|
//#region packages/ai/src/utils/assistant-text-phase.ts
|
|
18
18
|
const EMPTY_ASSISTANT_TEXT_BLOCK_SET = /* @__PURE__ */ new Set();
|
|
@@ -34,7 +34,7 @@ function tagUnphasedText(content, phase, idPrefix) {
|
|
|
34
34
|
const tagged = /* @__PURE__ */ new Map();
|
|
35
35
|
for (const block of textBlocks) {
|
|
36
36
|
if (block.text.trim().length === 0 || block.textSignature !== void 0) continue;
|
|
37
|
-
const signature = encodeAssistantTextSignatureV1(`${idPrefix}-${phaseIndex}`, phase);
|
|
37
|
+
const signature = encodeAssistantTextSignatureV1(`${idPrefix}-${phaseIndex}-${randomUUID().replaceAll("-", "").slice(0, 24)}`, phase);
|
|
38
38
|
block.textSignature = signature;
|
|
39
39
|
tagged.set(block, signature);
|
|
40
40
|
phaseIndex += 1;
|
|
@@ -220,7 +220,7 @@ function resolveOpenAICompletionsCompatDefaults(input) {
|
|
|
220
220
|
const isTogether = knownProviderFamily === "together" || input.baseUrl?.includes("api.together.ai") === true || input.baseUrl?.includes("api.together.xyz") === true || isDefaultRoute && isDefaultRouteProvider(input.provider, "together");
|
|
221
221
|
const isCloudflareAiGateway = provider === "cloudflare-ai-gateway" || input.baseUrl?.includes("gateway.ai.cloudflare.com") === true;
|
|
222
222
|
const isXiaomi = endpointClass === "xiaomi-native" || isDefaultRoute && isDefaultRouteProvider(input.provider, "xiaomi");
|
|
223
|
-
const isNonStandard = endpointClass === "cerebras-native" || endpointClass === "chutes-native" || endpointClass === "deepseek-native" || endpointClass === "mistral-public" || endpointClass === "opencode-native" || endpointClass === "xai-native" || isXiaomi || isZai || isDefaultRoute && isDefaultRouteProvider(input.provider, "cerebras", "chutes", "deepseek", "opencode", "xai");
|
|
223
|
+
const isNonStandard = endpointClass === "cerebras-native" || endpointClass === "chutes-native" || endpointClass === "deepseek-native" || endpointClass === "mistral-public" || endpointClass === "opencode-native" || endpointClass === "opencode-go-native" || endpointClass === "xai-native" || isXiaomi || isZai || isDefaultRoute && isDefaultRouteProvider(input.provider, "cerebras", "chutes", "deepseek", "opencode", "xai");
|
|
224
224
|
const isOpenRouterLike = input.provider === "openrouter" || endpointClass === "openrouter";
|
|
225
225
|
const isLocalEndpoint = endpointClass === "local";
|
|
226
226
|
const usesMaxTokens = endpointClass === "chutes-native" || endpointClass === "mistral-public" || knownProviderFamily === "mistral" || isMoonshot || isCloudflareAiGateway || isZai || isTogether || isDefaultRoute && isDefaultRouteProvider(provider, "chutes");
|
|
@@ -236,9 +236,9 @@ function resolveOpenAICompletionsCompatDefaults(input) {
|
|
|
236
236
|
supportsJsonSchemaResponseFormat: (endpointClass === "openai-public" || isDefaultRoute && isDefaultRouteProvider(provider, "openai")) && isKnownOpenAIJsonSchemaModelId(modelId),
|
|
237
237
|
requiresReasoningContentOnAssistantMessages: isDeepSeek || isXiaomi,
|
|
238
238
|
requiresNonEmptyUserOrAssistantMessage: isModelStudioLike,
|
|
239
|
-
cacheControlFormat: provider === "openrouter" && modelId?.startsWith("anthropic/") === true ? "anthropic" : void 0,
|
|
239
|
+
cacheControlFormat: isModelStudioLike && endpointClass !== "custom" || provider === "openrouter" && modelId?.startsWith("anthropic/") === true ? "anthropic" : void 0,
|
|
240
240
|
sessionAffinityFormat: isOpenRouterLike ? "openrouter" : "openai",
|
|
241
|
-
supportsLongCacheRetention: provider !== "cloudflare-workers-ai" && provider !== "cloudflare-ai-gateway" && knownProviderFamily !== "together" && !input.baseUrl?.includes("api.cloudflare.com") && !input.baseUrl?.includes("gateway.ai.cloudflare.com") && !input.baseUrl?.includes("api.together.ai") && !input.baseUrl?.includes("api.together.xyz")
|
|
241
|
+
supportsLongCacheRetention: !isModelStudioLike && provider !== "cloudflare-workers-ai" && provider !== "cloudflare-ai-gateway" && knownProviderFamily !== "together" && !input.baseUrl?.includes("api.cloudflare.com") && !input.baseUrl?.includes("gateway.ai.cloudflare.com") && !input.baseUrl?.includes("api.together.ai") && !input.baseUrl?.includes("api.together.xyz")
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
function resolveOpenAICompletionsCompatDefaultsFromCapabilities(input) {
|
|
@@ -876,17 +876,20 @@ function resolveOpenAISdkTimeoutMs(model, timeoutMs) {
|
|
|
876
876
|
}
|
|
877
877
|
function buildOpenAISdkClientOptions(model) {
|
|
878
878
|
const timeout = resolveOpenAISdkTimeoutMs(model);
|
|
879
|
-
return
|
|
879
|
+
return {
|
|
880
|
+
...timeout === void 0 ? {} : { timeout },
|
|
881
|
+
maxRetries: 0
|
|
882
|
+
};
|
|
880
883
|
}
|
|
881
884
|
function buildOpenAISdkRequestOptions(model, signal, options) {
|
|
882
885
|
const timeout = resolveOpenAISdkTimeoutMs(model, options?.timeoutMs);
|
|
883
886
|
const headers = options?.stream === true && usesNativeOpenAICodexResponsesBackend(model) ? { Accept: "text/event-stream" } : void 0;
|
|
884
|
-
if (timeout === void 0 &&
|
|
887
|
+
if (timeout === void 0 && !signal && !headers) return;
|
|
885
888
|
return {
|
|
886
889
|
...headers ? { headers } : {},
|
|
887
890
|
...signal ? { signal } : {},
|
|
888
891
|
...timeout !== void 0 ? { timeout } : {},
|
|
889
|
-
|
|
892
|
+
maxRetries: 0
|
|
890
893
|
};
|
|
891
894
|
}
|
|
892
895
|
function getCompat(model) {
|
|
@@ -3,10 +3,10 @@ import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
|
3
3
|
import { n as getAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
4
4
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-mZTCdRPo.mjs";
|
|
5
5
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-0PLDyJ-d.mjs";
|
|
7
7
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
8
|
-
import { a as resolveResponsesReasoningEffort, i as createResponsesAssistantOutput, n as applyResponsesServiceTierPricing, o as runResponsesStreamLifecycle, r as convertResponsesMessages, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
9
|
-
import { j as resolveOpenAIClientBaseUrl } from "./openai-tool-schema-
|
|
8
|
+
import { a as resolveResponsesReasoningEffort, i as createResponsesAssistantOutput, n as applyResponsesServiceTierPricing, o as runResponsesStreamLifecycle, r as convertResponsesMessages, t as applyCommonResponsesParams } from "./openai-responses-shared-DiAdpNAM.mjs";
|
|
9
|
+
import { j as resolveOpenAIClientBaseUrl } from "./openai-tool-schema-BMiHFH36.mjs";
|
|
10
10
|
import { A as supportsOpenAITemperature } from "./openai-responses-compaction-window-DO7yV7az.mjs";
|
|
11
11
|
import { i as resolveCloudflareBaseUrl, n as hasCopilotVisionInput, r as isCloudflareProvider, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-NCJtz9i0.mjs";
|
|
12
12
|
import OpenAI from "openai";
|
|
@@ -89,6 +89,7 @@ function createClient(model, context, apiKey, optionsHeaders, sessionId) {
|
|
|
89
89
|
baseURL: resolveOpenAIClientBaseUrl(model, baseUrl),
|
|
90
90
|
dangerouslyAllowBrowser: true,
|
|
91
91
|
defaultHeaders,
|
|
92
|
+
maxRetries: 0,
|
|
92
93
|
fetch: getAiTransportHost().buildModelFetch(model)
|
|
93
94
|
});
|
|
94
95
|
}
|
package/dist/{openai-responses-contracts-BthRXano.d.mts → openai-responses-contracts-bPzSN_Ba.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model, n as Api } from "./types-
|
|
3
|
-
import { g as OpenAIReasoningEffort, h as OpenAIApiReasoningEffort, i as BaseOpenAIStreamOptions } from "./provider-options-
|
|
1
|
+
import "./index-AfaxKT8w.mjs";
|
|
2
|
+
import { D as Model, n as Api } from "./types-DbrhszyQ.mjs";
|
|
3
|
+
import { g as OpenAIReasoningEffort, h as OpenAIApiReasoningEffort, i as BaseOpenAIStreamOptions } from "./provider-options-CxFPtvh7.mjs";
|
|
4
4
|
import { FunctionTool, ResponseCompactionItem, ResponseCreateParamsStreaming, ResponseInput, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
5
5
|
//#region packages/ai/src/transports/openai-responses-compaction-window.d.ts
|
|
6
6
|
type OpenAIResponsesCompactionOutput = Array<ResponseInputItem.Message | ReplayableResponseCompactionItem>;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { d as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
2
|
-
import { g as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
1
|
+
import { d as stripSystemPromptCacheBoundary } from "./simple-options-0PLDyJ-d.mjs";
|
|
2
|
+
import { g as sanitizeTransportPayloadText } from "./transport-stream-shared-CytPVLIg.mjs";
|
|
3
3
|
import { S as responsesPromptObserver } from "./openai-responses-compaction-window-DO7yV7az.mjs";
|
|
4
|
-
//#region packages/normalization-core/src/error-coercion.ts
|
|
5
|
-
/**
|
|
6
|
-
* Normalizes an unknown thrown value into an Error. Non-Error objects become
|
|
7
|
-
* the `cause` and have their enumerable fields copied so structured details
|
|
8
|
-
* (codes, statuses) survive the coercion.
|
|
9
|
-
*/
|
|
10
|
-
function toErrorObject(value, fallbackMessage) {
|
|
11
|
-
if (value instanceof Error) return value;
|
|
12
|
-
if (typeof value === "string") return new Error(value);
|
|
13
|
-
const error = new Error(fallbackMessage, { cause: value });
|
|
14
|
-
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
15
|
-
return error;
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
4
|
//#region packages/ai/src/transports/openai-responses-prompt-observer-internal.ts
|
|
19
5
|
function readFinalResponsesPrompt(request) {
|
|
20
6
|
if (typeof request.instructions === "string") return ["instructions", request.instructions];
|
|
@@ -43,4 +29,4 @@ function createResponsesPromptEgressObserver(options, assembledPrompt) {
|
|
|
43
29
|
};
|
|
44
30
|
}
|
|
45
31
|
//#endregion
|
|
46
|
-
export {
|
|
32
|
+
export { createResponsesPromptEgressObserver as t };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { c as normalizeLowercaseStringOrEmpty, d as normalizeOptionalString, o as isRecord, t as truncateUtf16Safe } from "./utf16-slice-qz3nsy87.mjs";
|
|
2
2
|
import { i as clampThinkingLevel, r as calculateCost } from "./sanitize-unicode-S6binQG-.mjs";
|
|
3
3
|
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, n as getAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
4
|
-
import { n as projectProviderError } from "./provider-error-BI8kIViN.mjs";
|
|
5
4
|
import { r as asFiniteNumber } from "./base64-CEFBpSkN.mjs";
|
|
6
|
-
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName } from "./simple-options-
|
|
5
|
+
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName } from "./simple-options-0PLDyJ-d.mjs";
|
|
7
6
|
import { c as transformTransportMessages } from "./tool-schema-json-projection-BtZiml7r.mjs";
|
|
8
7
|
import { d as redactSensitiveText, u as redactIdentifier } from "./transport-utils-CtuS1Upe.mjs";
|
|
9
|
-
import { _ as transportAbortError, g as sanitizeTransportPayloadText, h as sanitizeNonEmptyTransportPayloadText, m as parseTerminalToolCallArguments, y as withProviderResponseHook } from "./transport-stream-shared-
|
|
8
|
+
import { _ as transportAbortError, c as finalizeTransportStream, g as sanitizeTransportPayloadText, h as sanitizeNonEmptyTransportPayloadText, m as parseTerminalToolCallArguments, o as failTransportStream, y as withProviderResponseHook } from "./transport-stream-shared-CytPVLIg.mjs";
|
|
10
9
|
import { r as parseStreamingJson, t as createToolArgumentPreviewSchedule } from "./json-parse-BuAJEbdW.mjs";
|
|
11
10
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
12
11
|
import { t as shortHash } from "./hash-CHgqbJmD.mjs";
|
|
13
|
-
import { C as createOpenAIProviderAcceptanceHook, E as log, S as createModelStreamCooperativeScheduler, a as resolveOpenAIProjectedToolsStrictToolFlag, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics, v as projectOpenAITools } from "./openai-tool-schema-
|
|
12
|
+
import { C as createOpenAIProviderAcceptanceHook, E as log, S as createModelStreamCooperativeScheduler, a as resolveOpenAIProjectedToolsStrictToolFlag, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics, v as projectOpenAITools } from "./openai-tool-schema-BMiHFH36.mjs";
|
|
14
13
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-DcNjoFQE.mjs";
|
|
15
14
|
import { t as transformProviderMessages } from "./provider-transcript-transform-WvJmFUAf.mjs";
|
|
16
15
|
import { A as supportsOpenAITemperature, D as resolveOpenAIReasoningEffortForModel, b as RESPONSE_FAILED_NO_DETAILS_MESSAGE, g as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, h as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY, k as supportsOpenAIReasoningEffort, m as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, n as isOpenAIResponsesCompactionOutput, p as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, r as readOpenAIResponsesCompactionWindow } from "./openai-responses-compaction-window-DO7yV7az.mjs";
|
|
@@ -620,84 +619,83 @@ async function resolveNextResponsesEncryptedContentAttempt(attempt, error, optio
|
|
|
620
619
|
};
|
|
621
620
|
}
|
|
622
621
|
async function createResponsesStreamWithEncryptedContentRetry(params) {
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
622
|
+
const send = async (initialAttempt) => {
|
|
623
|
+
let attempt = initialAttempt;
|
|
624
|
+
for (;;) {
|
|
625
|
+
params.observePrompt?.(attempt.request, {
|
|
626
|
+
egress: "responses-sdk",
|
|
627
|
+
payloadVariant: attempt.kind
|
|
628
|
+
});
|
|
629
|
+
try {
|
|
630
|
+
const { data, response } = await params.client.responses.create(attempt.request, params.requestOptions).withResponse();
|
|
631
|
+
commitResponsesEncryptedContentAttempt(attempt, (checkpoint) => {
|
|
632
|
+
if (checkpoint) params.onCompactionRejected?.(checkpoint);
|
|
633
|
+
});
|
|
634
|
+
if (!isAsyncIterable(data)) throw new Error("OpenAI Responses streaming request returned a non-stream response");
|
|
635
|
+
return {
|
|
636
|
+
stream: data,
|
|
637
|
+
response,
|
|
638
|
+
attempt
|
|
639
|
+
};
|
|
640
|
+
} catch (error) {
|
|
641
|
+
let nextAttempt = await resolveNextResponsesEncryptedContentAttempt(attempt, error, { buildFullHistoryRequest: params.buildFullHistoryRequest });
|
|
642
|
+
if (!nextAttempt && attempt.request.previous_response_id && error && typeof error === "object" && typeof error.status === "number" && error.code === "previous_response_not_found") {
|
|
643
|
+
const request = { ...params.buildFullHistoryRequest ? await params.buildFullHistoryRequest() : attempt.request };
|
|
644
|
+
delete request.previous_response_id;
|
|
645
|
+
nextAttempt = {
|
|
646
|
+
kind: "continuation-rejected",
|
|
647
|
+
request
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
if (!nextAttempt) throw error;
|
|
651
|
+
const retryDescription = nextAttempt.kind === "reasoning-stripped" ? "without encrypted reasoning content" : nextAttempt.kind === "compaction-stripped" ? "without encrypted compaction content" : "full history after rejected previous_response_id";
|
|
652
|
+
log.warn(`[responses] retrying ${retryDescription} provider=${params.model.provider} api=${params.model.api} model=${params.model.id}`);
|
|
653
|
+
attempt = nextAttempt;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
634
656
|
};
|
|
635
|
-
|
|
657
|
+
const result = await send({
|
|
636
658
|
kind: params.initialAttemptKind ?? "initial",
|
|
637
659
|
request: params.request,
|
|
638
660
|
...params.initialRejectedCompaction ? { rejectedCompaction: params.initialRejectedCompaction } : {}
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
const message = typeof failure.message === "string" ? failure.message : "";
|
|
658
|
-
throw Object.assign(new Error(message), {
|
|
659
|
-
code: failure.code,
|
|
660
|
-
status: failure.status
|
|
661
|
-
});
|
|
662
|
-
}
|
|
661
|
+
});
|
|
662
|
+
return {
|
|
663
|
+
...result,
|
|
664
|
+
stream: { async *[Symbol.asyncIterator]() {
|
|
665
|
+
let current = result;
|
|
666
|
+
for (;;) {
|
|
667
|
+
let rejectedEvent;
|
|
668
|
+
try {
|
|
669
|
+
for await (const event of params.wrapStream?.(current) ?? current.stream) {
|
|
670
|
+
if (isRecord(event)) {
|
|
671
|
+
const failure = event.type === "response.failed" && isRecord(event.response) ? event.response.error : event.type === "error" ? event.error ?? event : void 0;
|
|
672
|
+
if (isRecord(failure) && params.canRetryStream?.() === true && isInvalidEncryptedContentError(failure)) {
|
|
673
|
+
rejectedEvent = event;
|
|
674
|
+
const message = typeof failure.message === "string" ? failure.message : "";
|
|
675
|
+
throw Object.assign(new Error(message), {
|
|
676
|
+
code: failure.code,
|
|
677
|
+
status: failure.status
|
|
678
|
+
});
|
|
663
679
|
}
|
|
664
|
-
yield event;
|
|
665
680
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
681
|
+
yield event;
|
|
682
|
+
}
|
|
683
|
+
return;
|
|
684
|
+
} catch (error) {
|
|
685
|
+
const nextAttempt = params.canRetryStream?.() === true && !params.requestOptions?.signal?.aborted ? await resolveNextResponsesEncryptedContentAttempt(current.attempt, error, { buildFullHistoryRequest: params.buildFullHistoryRequest }) : void 0;
|
|
686
|
+
if (!nextAttempt) {
|
|
687
|
+
if (rejectedEvent !== void 0) {
|
|
688
|
+
yield rejectedEvent;
|
|
689
|
+
return;
|
|
674
690
|
}
|
|
675
|
-
|
|
676
|
-
yield* (await createResponsesStreamWithEncryptedContentRetry({
|
|
677
|
-
...params,
|
|
678
|
-
request: nextAttempt.request,
|
|
679
|
-
initialAttemptKind: nextAttempt.kind,
|
|
680
|
-
initialRejectedCompaction: nextAttempt.rejectedCompaction
|
|
681
|
-
})).stream;
|
|
691
|
+
throw error;
|
|
682
692
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
let nextAttempt = await resolveNextResponsesEncryptedContentAttempt(attempt, error, { buildFullHistoryRequest: params.buildFullHistoryRequest });
|
|
687
|
-
if (!nextAttempt && attempt.request.previous_response_id && error && typeof error === "object" && typeof error.status === "number" && error.code === "previous_response_not_found") {
|
|
688
|
-
const request = { ...params.buildFullHistoryRequest ? await params.buildFullHistoryRequest() : attempt.request };
|
|
689
|
-
delete request.previous_response_id;
|
|
690
|
-
nextAttempt = {
|
|
691
|
-
kind: "continuation-rejected",
|
|
692
|
-
request
|
|
693
|
-
};
|
|
693
|
+
log.warn(`[responses] retrying streamed encrypted content provider=${params.model.provider} api=${params.model.api} model=${params.model.id}`);
|
|
694
|
+
current = await send(nextAttempt);
|
|
695
|
+
}
|
|
694
696
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
log.warn(`[responses] retrying ${retryDescription} provider=${params.model.provider} api=${params.model.api} model=${params.model.id}`);
|
|
698
|
-
attempt = nextAttempt;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
697
|
+
} }
|
|
698
|
+
};
|
|
701
699
|
}
|
|
702
700
|
function resolveAzureOpenAIApiVersion(env = process.env) {
|
|
703
701
|
return env.AZURE_OPENAI_API_VERSION?.trim() || "preview";
|
|
@@ -2130,7 +2128,7 @@ function buildResponsesRequestOptions(options) {
|
|
|
2130
2128
|
return {
|
|
2131
2129
|
...options?.signal ? { signal: options.signal } : {},
|
|
2132
2130
|
...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
|
|
2133
|
-
maxRetries:
|
|
2131
|
+
maxRetries: 0
|
|
2134
2132
|
};
|
|
2135
2133
|
}
|
|
2136
2134
|
function cleanStreamingScratchBuffers(output) {
|
|
@@ -2197,24 +2195,19 @@ async function runResponsesStreamLifecycle(params) {
|
|
|
2197
2195
|
authProfileId: options?.authProfileId
|
|
2198
2196
|
})
|
|
2199
2197
|
});
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
reason: output.stopReason,
|
|
2205
|
-
message: output
|
|
2198
|
+
finalizeTransportStream({
|
|
2199
|
+
stream,
|
|
2200
|
+
output,
|
|
2201
|
+
signal: options?.signal
|
|
2206
2202
|
});
|
|
2207
|
-
stream.end();
|
|
2208
2203
|
} catch (error) {
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
error: output
|
|
2204
|
+
failTransportStream({
|
|
2205
|
+
stream,
|
|
2206
|
+
output,
|
|
2207
|
+
signal: options?.signal,
|
|
2208
|
+
error,
|
|
2209
|
+
cleanup: () => cleanStreamingScratchBuffers(output)
|
|
2216
2210
|
});
|
|
2217
|
-
stream.end();
|
|
2218
2211
|
} finally {
|
|
2219
2212
|
firstEventAbort?.dispose();
|
|
2220
2213
|
}
|
|
@@ -4,7 +4,7 @@ import { n as getAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
|
4
4
|
import { r as uniqueValues, t as normalizeStringEntries } from "./string-normalization--fwJ4S2q.mjs";
|
|
5
5
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-mZTCdRPo.mjs";
|
|
6
6
|
import { t as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-BtZiml7r.mjs";
|
|
7
|
-
import { C as headersToRecord, _ as transportAbortError, f as notifyProviderHttpResponse } from "./transport-stream-shared-
|
|
7
|
+
import { C as headersToRecord, _ as transportAbortError, f as notifyProviderHttpResponse } from "./transport-stream-shared-CytPVLIg.mjs";
|
|
8
8
|
//#region packages/ai/src/transports/openai-transport-shared.ts
|
|
9
9
|
/** Shared options, usage shape, cache identity, ordering, and stream scheduling for OpenAI APIs. */
|
|
10
10
|
const MODEL_STREAM_COOPERATIVE_YIELD_INTERVAL_MS = 12;
|
|
@@ -215,6 +215,7 @@ function projectDiagnosticValue(value, policy = {}, seen = /* @__PURE__ */ new W
|
|
|
215
215
|
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
216
216
|
if (!("value" in descriptor) || !descriptor.enumerable && (policy.propertyScope === "enumerable" || ![
|
|
217
217
|
"cause",
|
|
218
|
+
"errors",
|
|
218
219
|
"message",
|
|
219
220
|
"name",
|
|
220
221
|
"stack"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as StreamOptions } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { J as StreamOptions } from "./types-DbrhszyQ.mjs";
|
|
2
|
+
import "./types-B5EFUmXs.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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as index_d_exports, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./index-
|
|
2
|
-
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-
|
|
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-
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as index_d_exports, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./index-AfaxKT8w.mjs";
|
|
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-DbrhszyQ.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-vK_7r3bj.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-BOwtcl9X.mjs";
|
|
6
|
+
import "./types-B5EFUmXs.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, 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, 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,4 +1,4 @@
|
|
|
1
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
1
|
+
import { n as ApiRegistry } from "./api-registry-Cs6HGNqY.mjs";
|
|
2
2
|
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-2uo_1OR1.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/register-builtins.d.ts
|
|
4
4
|
/** Source id used for built-in API provider registrations. */
|
package/dist/providers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
2
|
-
import { n as projectProviderError } from "./provider-error-
|
|
2
|
+
import { n as projectProviderError } from "./provider-error-B6EGq6gg.mjs";
|
|
3
3
|
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-mZTCdRPo.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
5
5
|
/** Source id used for built-in API provider registrations. */
|
|
@@ -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-hk7F7ptG.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-D0QZ0AyB.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-B7etBd_H.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-BEUlxfDu.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-CN4Fy5zV.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-BAJ4gq3i.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-CC-nrwXg.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-DCr0pyzQ.mjs"), (module) => ({
|
|
94
94
|
stream: module.streamGoogleVertex,
|
|
95
95
|
streamSimple: module.streamSimpleGoogleVertex
|
|
96
96
|
}))
|