@openclaw/ai 2026.9.9 → 2026.9.34
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-DfsDsNJl.mjs → anthropic-BL3z3SiB.mjs} +7 -7
- package/dist/{anthropic-payload-policy-BVcxWtQD.d.mts → anthropic-payload-policy-CFbalbbU.d.mts} +3 -3
- package/dist/{anthropic-stream-reducer-CiVXqWLP.mjs → anthropic-stream-reducer-XCL_L8KJ.mjs} +7 -7
- package/dist/{api-registry-pGjnPg1z.d.mts → api-registry-BLbq15N5.d.mts} +2 -2
- package/dist/{azure-openai-responses-DUQuNQL6.mjs → azure-openai-responses-DqXyjyTC.mjs} +6 -6
- package/dist/diagnostics.d.mts +4 -4
- package/dist/env-api-keys-BR0MUYYD.d.mts +17 -0
- package/dist/event-stream-B0vjWzHd.d.mts +1 -0
- package/dist/{event-stream-DOPFYVqs.d.mts → event-stream-CiaHxSK0.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-CyeM7l4M.mjs → google-D9zpPelZ.mjs} +5 -5
- package/dist/{google-interactions-BvbVUFzr.mjs → google-interactions-Br_n4tZB.mjs} +19 -16
- package/dist/{google-messages-BAiONu4V.mjs → google-messages-pvt0rKfN.mjs} +6 -4
- package/dist/{google-shared-tpqMugao.mjs → google-shared-DPeR7LLA.mjs} +13 -18
- package/dist/{google-vertex-BTwRIP8v.mjs → google-vertex-D4Qde9Qq.mjs} +4 -4
- package/dist/{host-COwfRiSL.d.mts → host-BhpDO5Sy.d.mts} +3 -3
- package/dist/{host-l5VGgsa2.mjs → host-DqhMLv8J.mjs} +1 -1
- package/dist/{host-policy-D8HBI2Pv.mjs → host-policy-B3DuH3Le.mjs} +1 -1
- package/dist/{index-DHeFfpcz.d.mts → index-Iw8l620S.d.mts} +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +3 -3
- package/dist/internal/anthropic.d.mts +5 -5
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/env-api-keys.d.mts +2 -0
- package/dist/internal/env-api-keys.mjs +2 -0
- package/dist/internal/google-model-family.d.mts +2 -0
- package/dist/internal/google-model-family.mjs +6 -2
- package/dist/internal/openai-completions-compat.d.mts +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai.d.mts +9 -9
- package/dist/internal/openai.mjs +7 -7
- package/dist/internal/runtime.d.mts +8 -23
- package/dist/internal/runtime.mjs +2 -2
- package/dist/internal/shared.d.mts +3 -3
- package/dist/internal/shared.mjs +3 -3
- package/dist/internal/tool-schema.mjs +1 -1
- package/dist/{mistral-Cxbukk9d.mjs → mistral-ytNCcQhM.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-CUuh4TkA.mjs → openai-chatgpt-responses-CHluxZ0P.mjs} +66 -56
- package/dist/{openai-completions-CVwOQW-U.mjs → openai-completions-D0f28olp.mjs} +9 -9
- package/dist/{openai-completions-compat-CqWP1fn5.d.mts → openai-completions-compat-CQbGsPt0.d.mts} +3 -3
- package/dist/{openai-completions-compat-W0ykoT4z.mjs → openai-completions-compat-D1q02qdx.mjs} +1 -1
- package/dist/{openai-completions-stream-Crkc597h.mjs → openai-completions-stream-iagLwGz6.mjs} +26 -31
- package/dist/{openai-prompt-cache-YTmJ_iMS.d.mts → openai-prompt-cache-CuY5QDIc.d.mts} +2 -2
- package/dist/{openai-prompt-cache-D0e4t5-3.mjs → openai-prompt-cache-DHxMpeRz.mjs} +1 -1
- package/dist/{openai-provider-client-evrjHyOl.mjs → openai-provider-client-Bcjj6_fK.mjs} +2 -2
- package/dist/{openai-responses-cNWyKDF8.mjs → openai-responses-D2ElJYAb.mjs} +8 -8
- package/dist/{openai-responses-compaction-replay-CQHR2isp.d.mts → openai-responses-compaction-replay-DiGjwK4d.d.mts} +4 -4
- package/dist/{openai-responses-contracts-C2H8pffb.d.mts → openai-responses-contracts-CYScOS7J.d.mts} +4 -4
- package/dist/{openai-responses-prompt-observer-internal-Do_oXZf7.mjs → openai-responses-prompt-observer-internal-CWhVpkYl.mjs} +8 -8
- package/dist/{openai-responses-shared-6QypGhvL.mjs → openai-responses-shared-BUaK4Pb3.mjs} +508 -16
- package/dist/{openai-responses-terminal-usage-D0WZQlIF.d.mts → openai-responses-terminal-usage-CLzeNWqW.d.mts} +2 -2
- package/dist/{openai-tool-schema-vsl-cE-n.mjs → openai-tool-schema-DSAxYnHW.mjs} +18 -1
- package/dist/{openai-transport-params-a_8s6k6d.mjs → openai-transport-params-CqLxK93q.mjs} +20 -8
- package/dist/{provider-options-yDbWMoEr.d.mts → provider-options-CFiaIG4K.d.mts} +2 -2
- package/dist/{provider-replay-context-Cy7RdZ2C.mjs → provider-replay-context-BwVRJUQZ.mjs} +1 -1
- package/dist/{provider-transcript-transform-B-bAzjo8.mjs → provider-transcript-transform-Cg-36VSt.mjs} +2 -2
- package/dist/{provider-transport-turn-state-CE0dp-UO.mjs → provider-transport-turn-state-CUUfdJPN.mjs} +1 -1
- package/dist/{provider-types-CHsKHBBD.d.mts → provider-types-Bx_6hBmK.d.mts} +3 -3
- package/dist/provider-types.d.mts +5 -5
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-ueGsZ3Rz.mjs → simple-options-B9u6-CF3.mjs} +2 -2
- package/dist/{src-Dw59CBue.mjs → src-Dq6VRdeL.mjs} +1 -1
- package/dist/{transport-stream-shared-CYLM2HEK.d.mts → transport-stream-shared-B_REuIea.d.mts} +4 -4
- package/dist/{transport-stream-shared-Bz9YwuQ0.mjs → transport-stream-shared-Dt7VrJFd.mjs} +1 -1
- package/dist/{transport-utils-CEKSacZh.mjs → transport-utils-B11GlmDO.mjs} +6 -2
- package/dist/transports.d.mts +14 -13
- package/dist/transports.mjs +26 -511
- package/dist/{types-CLLR3eB4.d.mts → types-B89w6ly2.d.mts} +11 -0
- package/dist/types-DbmNRKvK.d.mts +1 -0
- package/dist/types.d.mts +5 -5
- package/dist/types.mjs +2 -2
- package/dist/{validation-Cat2wQsc.d.mts → validation-DblQWSRA.d.mts} +1 -1
- package/dist/{validation-BFZc40Ig.mjs → validation-Fe6RtKI6.mjs} +1 -6
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +6 -1
- package/dist/event-stream-CMQfX_yr.d.mts +0 -1
- package/dist/types-CoL-LJ7j.d.mts +0 -1
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as normalizeOpenAIReasoningEffort, c as resolveOpenAIReasoningEffortMapping, d as supportsOpenAITemperature, i as isOpenAIGpt6Model, l as resolveOpenAISupportedReasoningEfforts, n as isOpenAIGpt55Model, o as resolveOpenAIModelReasoningEfforts, r as isOpenAIGpt56Model, s as resolveOpenAIReasoningEffortForModel, t as isOpenAIGpt54MiniModel, u as supportsOpenAIReasoningEffort } from "../openai-reasoning-effort-C_0p3psG.mjs";
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-DHxMpeRz.mjs";
|
|
3
3
|
import { g as resolveResponsesTerminalStopReason, h as readResponsesReasoningTokens, m as mapResponsesTerminalUsage, p as isResponsesOutputLimitToolCallError } from "../diagnostics-CJaB6g8J.mjs";
|
|
4
|
-
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-
|
|
5
|
-
import { f as projectOpenAITools, m as reconcileOpenAIResponsesToolChoice, p as reconcileOpenAICompletionsToolChoice } from "../openai-transport-params-
|
|
6
|
-
import { a as convertMessages } from "../openai-completions-stream-
|
|
4
|
+
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-B9u6-CF3.mjs";
|
|
5
|
+
import { f as projectOpenAITools, m as reconcileOpenAIResponsesToolChoice, p as reconcileOpenAICompletionsToolChoice } from "../openai-transport-params-CqLxK93q.mjs";
|
|
6
|
+
import { a as convertMessages } from "../openai-completions-stream-iagLwGz6.mjs";
|
|
7
7
|
import { h as responsesPromptObserver } from "../openai-responses-contracts-CLxnqS9p.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
9
|
-
import { M as bindResponsesInputMessage, _ as isResponsesTextContentPartType, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-
|
|
9
|
+
import { M as bindResponsesInputMessage, _ as isResponsesTextContentPartType, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-BUaK4Pb3.mjs";
|
|
10
10
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
11
11
|
import { t as responsesRequestLifecycle } from "../openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
12
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
13
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
12
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-D0f28olp.mjs";
|
|
13
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-D2ElJYAb.mjs";
|
|
14
14
|
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { G as SimpleStreamOptions, H as ProviderStreamOptions, O as Model, Y as StreamOptions, a as AssistantMessage, d as Context, j as ModelThinkingLevel, n as Api, ot as Usage, s as AssistantMessageEventStreamContract } from "../types-
|
|
3
|
-
import { i as getEventStreamCompletion } from "../event-stream-
|
|
4
|
-
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-
|
|
5
|
-
import "../types-
|
|
1
|
+
import "../index-Iw8l620S.mjs";
|
|
2
|
+
import { G as SimpleStreamOptions, H as ProviderStreamOptions, O as Model, Y as StreamOptions, a as AssistantMessage, d as Context, j as ModelThinkingLevel, n as Api, ot as Usage, s as AssistantMessageEventStreamContract } from "../types-B89w6ly2.mjs";
|
|
3
|
+
import { i as getEventStreamCompletion } from "../event-stream-CiaHxSK0.mjs";
|
|
4
|
+
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-BLbq15N5.mjs";
|
|
5
|
+
import "../types-DbmNRKvK.mjs";
|
|
6
|
+
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-BR0MUYYD.mjs";
|
|
6
7
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-BZiVbGwK.mjs";
|
|
7
|
-
import { v as parseTerminalToolCallArguments } from "../transport-stream-shared-
|
|
8
|
+
import { v as parseTerminalToolCallArguments } from "../transport-stream-shared-B_REuIea.mjs";
|
|
8
9
|
//#region packages/ai/src/internal/default-runtime.d.ts
|
|
9
10
|
export declare const defaultApiRegistry: {
|
|
10
11
|
registerApiProvider: <TApi extends Api, TOptions extends StreamOptions>(provider: ApiProvider<TApi, TOptions>, sourceId?: string) => void;
|
|
@@ -48,22 +49,6 @@ declare const { stream, complete, streamSimple, completeSimple }: {
|
|
|
48
49
|
completeSimple: <TApi extends Api>(model: Model<TApi>, context: Context, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
49
50
|
};
|
|
50
51
|
//#endregion
|
|
51
|
-
//#region packages/ai/src/env-api-keys.d.ts
|
|
52
|
-
/**
|
|
53
|
-
* Find configured environment variables that can provide an API key for a provider.
|
|
54
|
-
*
|
|
55
|
-
* This only reports actual API key variables. It intentionally excludes ambient
|
|
56
|
-
* credential sources such as AWS profiles, AWS IAM credentials, and Google
|
|
57
|
-
* Application Default Credentials.
|
|
58
|
-
*/
|
|
59
|
-
export declare function findEnvKeys(provider: string): string[] | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Get API key for provider from known environment variables, e.g. OPENAI_API_KEY.
|
|
62
|
-
*
|
|
63
|
-
* Will not return API keys for providers that require OAuth tokens.
|
|
64
|
-
*/
|
|
65
|
-
export declare function getEnvApiKey(provider: string): string | undefined;
|
|
66
|
-
//#endregion
|
|
67
52
|
//#region packages/ai/src/model-utils.d.ts
|
|
68
53
|
/** Calculates and stores model cost fields from token usage and per-million pricing. */
|
|
69
54
|
export declare function calculateCost<TApi extends Api>(model: Model<TApi>, usage: Usage): Usage["cost"];
|
|
@@ -241,4 +226,4 @@ export type SseByteGuard = {
|
|
|
241
226
|
};
|
|
242
227
|
export declare function createSseByteGuard(reader: ReadableStreamDefaultReader<Uint8Array>, opts: ReadSseStreamWithLimitOptions): SseByteGuard;
|
|
243
228
|
//#endregion
|
|
244
|
-
export { type ReasoningTagTextDelta, type ReasoningTagTextPartitioner, complete, completeSimple, getApiProvider, getApiProviders, getEventStreamCompletion, parseTerminalToolCallArguments, sanitizeSurrogates, stream, streamSimple };
|
|
229
|
+
export { type ReasoningTagTextDelta, type ReasoningTagTextPartitioner, complete, completeSimple, findEnvKeys, getApiProvider, getApiProviders, getEnvApiKey, getEventStreamCompletion, parseTerminalToolCallArguments, sanitizeSurrogates, stream, streamSimple };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as isProviderRefusalAssistantError } from "../diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { a as getEventStreamCompletion } from "../event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { n as createApiRegistry, t as createLlmRuntime } from "../stream-DDsCBgd-.mjs";
|
|
4
|
-
import { C as applyProviderReportedUsageCost, D as modelsAreEqual, E as getSupportedThinkingLevels, S as headersToRecord, T as clampThinkingLevel, w as calculateCost } from "../host-
|
|
5
|
-
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, j as sanitizeSurrogates, k as repairJson } from "../transport-stream-shared-
|
|
4
|
+
import { C as applyProviderReportedUsageCost, D as modelsAreEqual, E as getSupportedThinkingLevels, S as headersToRecord, T as clampThinkingLevel, w as calculateCost } from "../host-DqhMLv8J.mjs";
|
|
5
|
+
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, j as sanitizeSurrogates, k as repairJson } from "../transport-stream-shared-Dt7VrJFd.mjs";
|
|
6
6
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-CyX4VKGO.mjs";
|
|
7
7
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
8
8
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-BjtkplhG.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as Message, G as SimpleStreamOptions, O as Model, Q as ThinkingBudgets, Y as StreamOptions, a as AssistantMessage, et as ThinkingLevel, n as Api } from "../types-
|
|
2
|
-
import { a as readAssistantThinkingAppend } from "../event-stream-
|
|
3
|
-
import "../types-
|
|
1
|
+
import { D as Message, G as SimpleStreamOptions, O as Model, Q as ThinkingBudgets, Y as StreamOptions, a as AssistantMessage, et as ThinkingLevel, n as Api } from "../types-B89w6ly2.mjs";
|
|
2
|
+
import { a as readAssistantThinkingAppend } from "../event-stream-CiaHxSK0.mjs";
|
|
3
|
+
import "../types-DbmNRKvK.mjs";
|
|
4
4
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-BZiVbGwK.mjs";
|
|
5
5
|
import { i as projectProviderError } from "../provider-error-xumb1V3F.mjs";
|
|
6
6
|
import { n as createDiagnosticRecord } from "../credential-redaction-BKv49aiv.mjs";
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as readAssistantThinkingAppend } from "../event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { O as hasMediaPayload, a as FAILED_ASSISTANT_REPLAY_TEXT, c as isReasoningOnlyLengthAssistantTurn, i as transformMessages, k as isImageWithMediaPayload, l as isStreamErrorFallbackContent, o as STREAM_ERROR_FALLBACK_TEXT, s as hasOnlyAssistantReasoningContent, u as resolveFailedAssistantReplay } from "../host-
|
|
2
|
+
import { O as hasMediaPayload, a as FAILED_ASSISTANT_REPLAY_TEXT, c as isReasoningOnlyLengthAssistantTurn, i as transformMessages, k as isImageWithMediaPayload, l as isStreamErrorFallbackContent, o as STREAM_ERROR_FALLBACK_TEXT, s as hasOnlyAssistantReasoningContent, u as resolveFailedAssistantReplay } from "../host-DqhMLv8J.mjs";
|
|
3
3
|
import { n as projectProviderError, r as createDiagnosticRecord } from "../provider-error-CwT_j2v0.mjs";
|
|
4
|
-
import { j as sanitizeSurrogates } from "../transport-stream-shared-
|
|
5
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, E as normalizeStructuredPromptSection, S as splitSystemPromptRelocatableBoundary, T as normalizePromptCapabilityIds, _ as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, b as prependSystemPromptAdditionAfterCacheBoundary, d as describeToolResultMediaPlaceholder, f as describeUnsupportedToolResultMedia, g as SYSTEM_PROMPT_CACHE_BOUNDARY, h as formatToolResultText, i as clampReasoning, m as extractToolResultText, n as buildBaseOptions, p as extractToolResultBlockText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as ensureSystemPromptCacheBoundary } from "../simple-options-
|
|
4
|
+
import { j as sanitizeSurrogates } from "../transport-stream-shared-Dt7VrJFd.mjs";
|
|
5
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, E as normalizeStructuredPromptSection, S as splitSystemPromptRelocatableBoundary, T as normalizePromptCapabilityIds, _ as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, b as prependSystemPromptAdditionAfterCacheBoundary, d as describeToolResultMediaPlaceholder, f as describeUnsupportedToolResultMedia, g as SYSTEM_PROMPT_CACHE_BOUNDARY, h as formatToolResultText, i as clampReasoning, m as extractToolResultText, n as buildBaseOptions, p as extractToolResultBlockText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as ensureSystemPromptCacheBoundary } from "../simple-options-B9u6-CF3.mjs";
|
|
6
6
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-BTEBMeOv.mjs";
|
|
7
7
|
//#region packages/ai/src/utils/tls-certificate-errors.ts
|
|
8
8
|
const HOSTNAME_MISMATCH_CODES = /* @__PURE__ */ new Set(["ERR_TLS_CERT_ALTNAME_INVALID", "HOSTNAME_MISMATCH"]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as projectRuntimeToolInputSchema } from "../tool-schema-json-projection-Ct8SeBeJ.mjs";
|
|
2
|
-
import { _ as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, a as resolveOpenAIProjectedToolsStrictToolFlag, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, g as findLlamacppGbnfSchemaViolations, h as cleanSchemaForLlamacppGbnf, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, p as stripUnsupportedSchemaKeywords, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as cleanSchemaForGemini } from "../openai-tool-schema-
|
|
2
|
+
import { _ as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, a as resolveOpenAIProjectedToolsStrictToolFlag, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, g as findLlamacppGbnfSchemaViolations, h as cleanSchemaForLlamacppGbnf, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, p as stripUnsupportedSchemaKeywords, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as cleanSchemaForGemini } from "../openai-tool-schema-DSAxYnHW.mjs";
|
|
3
3
|
export { GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, extractToolSchemaModelCompat, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, isStrictOpenAIJsonSchemaCompatible, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, projectRuntimeToolInputSchema, resolveOpenAIProjectedToolsStrictToolFlag, resolveUnsupportedToolSchemaKeywords, shouldOmitEmptyArrayItems, stripUnsupportedSchemaKeywords };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { T as clampThinkingLevel, k as isImageWithMediaPayload, n as getAiTransportHost, w as calculateCost } from "./host-
|
|
3
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
4
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, h as formatToolResultText, m as extractToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
2
|
+
import { T as clampThinkingLevel, k as isImageWithMediaPayload, n as getAiTransportHost, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
3
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
4
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, h as formatToolResultText, m as extractToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-B9u6-CF3.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
6
6
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
7
|
-
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-
|
|
7
|
+
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
9
9
|
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
package/dist/{openai-chatgpt-responses-CUuh4TkA.mjs → openai-chatgpt-responses-CHluxZ0P.mjs}
RENAMED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { S as headersToRecord, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
+
import { S as headersToRecord, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-DqhMLv8J.mjs";
|
|
5
5
|
import { d as supportsOpenAITemperature } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
6
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
6
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
7
7
|
import { _ as extractErrorCodeOrErrno, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as toErrorObject } from "./diagnostics-CJaB6g8J.mjs";
|
|
8
8
|
import { s as resolveTimerTimeoutMs } from "./base64-C1PsYcRQ.mjs";
|
|
9
|
-
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
+
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-B11GlmDO.mjs";
|
|
10
10
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
11
|
-
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
12
|
-
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-
|
|
13
|
-
import { b as createOpenAIResponseHook, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
11
|
+
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
12
|
+
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
13
|
+
import { b as createOpenAIResponseHook, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-CqLxK93q.mjs";
|
|
14
14
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
15
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
15
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
16
16
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
17
17
|
import { h as responsesPromptObserver } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
18
|
-
import { A as recordResponsesContextUsage, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Z as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, q as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, w as resolveNextResponsesEncryptedContentAttempt } from "./openai-responses-shared-
|
|
19
|
-
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
|
18
|
+
import { A as recordResponsesContextUsage, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Z as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, q as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, w as resolveNextResponsesEncryptedContentAttempt } from "./openai-responses-shared-BUaK4Pb3.mjs";
|
|
20
19
|
import { n as registerSessionResourceCleanup } from "./session-resources-CkR4WWy1.mjs";
|
|
21
|
-
import { i as resolveOpenAIResponsesTextFormat, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-
|
|
20
|
+
import { i as resolveOpenAIResponsesTextFormat, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-CWhVpkYl.mjs";
|
|
22
21
|
import { n as withResponsesRequestAcceptance, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
23
22
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
24
23
|
//#region packages/ai/src/providers/openai-chatgpt-responses-events.ts
|
|
@@ -83,7 +82,7 @@ function normalizeCodexStatus(status) {
|
|
|
83
82
|
}
|
|
84
83
|
//#endregion
|
|
85
84
|
//#region packages/ai/src/providers/openai-chatgpt-responses-protocol.ts
|
|
86
|
-
const
|
|
85
|
+
const OPENAI_CHATGPT_RESPONSES_SSE_FRAME_MAX_BYTES = 16777216;
|
|
87
86
|
var CodexProtocolError = class extends Error {
|
|
88
87
|
constructor(message, options) {
|
|
89
88
|
super(message);
|
|
@@ -95,44 +94,53 @@ var CodexProtocolError = class extends Error {
|
|
|
95
94
|
async function* parseOpenAIChatGptResponsesSse(response) {
|
|
96
95
|
if (!response.body) return;
|
|
97
96
|
const reader = response.body.getReader();
|
|
98
|
-
const guard = createSseByteGuard(reader, {
|
|
99
|
-
maxBytes: OPENAI_CHATGPT_RESPONSES_SUCCESS_BODY_MAX_BYTES,
|
|
100
|
-
onOverflow: ({ size, maxBytes }) => /* @__PURE__ */ new Error(`OpenAI ChatGPT Responses success body exceeded ${maxBytes} bytes (received ${size})`)
|
|
101
|
-
});
|
|
102
97
|
const decoder = new TextDecoder();
|
|
103
|
-
let buffer =
|
|
98
|
+
let buffer = /* @__PURE__ */ new Uint8Array(1024);
|
|
99
|
+
let size = 0;
|
|
100
|
+
let lineEmpty = true;
|
|
101
|
+
let skipLf = false;
|
|
102
|
+
let cancelReason;
|
|
104
103
|
try {
|
|
105
104
|
while (true) {
|
|
106
|
-
const { done, value } = await
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
event = JSON.parse(data);
|
|
122
|
-
} catch (cause) {
|
|
123
|
-
if (!(cause instanceof SyntaxError)) throw cause;
|
|
124
|
-
throw new CodexProtocolError(MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, { cause });
|
|
125
|
-
}
|
|
126
|
-
yield event;
|
|
105
|
+
const { done, value } = await reader.read();
|
|
106
|
+
for (let index = 0; index < (value?.length ?? 0) + (done ? 1 : 0); index++) {
|
|
107
|
+
const byte = value?.[index];
|
|
108
|
+
if (byte !== void 0) {
|
|
109
|
+
const crlf = skipLf && byte === 10;
|
|
110
|
+
skipLf = byte === 13;
|
|
111
|
+
const lineEnding = byte === 10 || byte === 13;
|
|
112
|
+
const boundary = !crlf && lineEnding && lineEmpty;
|
|
113
|
+
lineEmpty = lineEnding;
|
|
114
|
+
if (crlf && size === 0) continue;
|
|
115
|
+
if (size >= OPENAI_CHATGPT_RESPONSES_SSE_FRAME_MAX_BYTES) throw new Error(`OpenAI ChatGPT Responses SSE frame exceeded ${OPENAI_CHATGPT_RESPONSES_SSE_FRAME_MAX_BYTES} bytes`);
|
|
116
|
+
if (size === buffer.length) {
|
|
117
|
+
const grown = new Uint8Array(Math.min(buffer.length * 2, OPENAI_CHATGPT_RESPONSES_SSE_FRAME_MAX_BYTES));
|
|
118
|
+
grown.set(buffer);
|
|
119
|
+
buffer = grown;
|
|
127
120
|
}
|
|
121
|
+
buffer[size++] = byte;
|
|
122
|
+
if (!boundary) continue;
|
|
123
|
+
}
|
|
124
|
+
const chunk = decoder.decode(buffer.subarray(0, size), { stream: !done });
|
|
125
|
+
size = 0;
|
|
126
|
+
const data = chunk.split(/\r\n|\r|\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trim()).join("\n").trim();
|
|
127
|
+
if (!data || data === "[DONE]") continue;
|
|
128
|
+
let event;
|
|
129
|
+
try {
|
|
130
|
+
event = JSON.parse(data);
|
|
131
|
+
} catch (cause) {
|
|
132
|
+
if (!(cause instanceof SyntaxError)) throw cause;
|
|
133
|
+
throw new CodexProtocolError(MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, { cause });
|
|
128
134
|
}
|
|
135
|
+
yield event;
|
|
129
136
|
}
|
|
130
137
|
if (done) break;
|
|
131
138
|
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
cancelReason = error;
|
|
141
|
+
throw error;
|
|
132
142
|
} finally {
|
|
133
|
-
|
|
134
|
-
await guard.cancel();
|
|
135
|
-
} catch {}
|
|
143
|
+
reader.cancel(cancelReason).catch(() => void 0);
|
|
136
144
|
try {
|
|
137
145
|
reader.releaseLock();
|
|
138
146
|
} catch {}
|
|
@@ -150,7 +158,8 @@ const DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
|
150
158
|
const REQUEST_COMPRESSION_ZSTD_LEVEL = 3;
|
|
151
159
|
const CODEX_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set(["openai", "opencode"]);
|
|
152
160
|
const WEBSOCKET_TRANSPORT_ERROR_CODE = "ERR_WEBSOCKET_TRANSPORT";
|
|
153
|
-
const
|
|
161
|
+
const RETRYABLE_CLOSE_CODES = /* @__PURE__ */ new Set([
|
|
162
|
+
1e3,
|
|
154
163
|
1001,
|
|
155
164
|
1005,
|
|
156
165
|
1006,
|
|
@@ -162,6 +171,7 @@ const RETRYABLE_WEBSOCKET_CLOSE_CODES = /* @__PURE__ */ new Set([
|
|
|
162
171
|
]);
|
|
163
172
|
const WEBSOCKET_MESSAGE_TOO_BIG_CLOSE_CODE = 1009;
|
|
164
173
|
const WEBSOCKET_CONNECTION_LIMIT_REACHED_CODE = "websocket_connection_limit_reached";
|
|
174
|
+
const WEBSOCKET_REPLAY_REJECTION = "Codex error: Persisted response contains hosted-tool, compaction, or unverifiable hidden reasoning state that Rustponses cannot replay. Start a new response or use the Python Responses service for this continuation.";
|
|
165
175
|
const OPENAI_CHATGPT_RESPONSES_ERROR_BODY_MAX_BYTES = 16384;
|
|
166
176
|
function resolveRequestTimeoutMs(options) {
|
|
167
177
|
const timeoutMs = options?.timeoutMs;
|
|
@@ -240,19 +250,18 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
240
250
|
if (transport !== "sse" && !websocketDisabledForSession) {
|
|
241
251
|
const websocketHeaders = buildWebSocketHeaders(modelHeaders, optionHeaders, accountId, apiKey, sessionId || createCodexRequestId());
|
|
242
252
|
let websocketStarted = false;
|
|
243
|
-
let
|
|
244
|
-
let retriedWebSocketConnectionLimit = false;
|
|
253
|
+
let retriedWebSocketRejection = false;
|
|
245
254
|
while (true) {
|
|
246
255
|
const activeAttempt = semanticAttempt;
|
|
256
|
+
const dispatch = {};
|
|
247
257
|
websocketStarted = false;
|
|
248
|
-
websocketRequestSent = false;
|
|
249
258
|
try {
|
|
250
259
|
const terminal = await processWebSocketStream(resolveCodexWebSocketUrl(model.baseUrl), activeAttempt.request, websocketHeaders, output, stream, model, () => {
|
|
251
260
|
websocketStarted = true;
|
|
252
261
|
}, () => {
|
|
253
262
|
commitSemanticAttempt(activeAttempt);
|
|
254
|
-
}, requestOptions, firstEventAbort.abort, observePromptEgress, activeAttempt.kind, () => {
|
|
255
|
-
|
|
263
|
+
}, requestOptions, firstEventAbort.abort, observePromptEgress, activeAttempt.kind, (request) => {
|
|
264
|
+
dispatch.request = request;
|
|
256
265
|
}, options?.signal);
|
|
257
266
|
if (activeSignal?.aborted) throw transportAbortError(activeSignal);
|
|
258
267
|
if (output.stopReason === "aborted" || output.stopReason === "error") throw new CodexApiError(output.errorMessage ?? "An unknown error occurred");
|
|
@@ -266,19 +275,20 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
266
275
|
return;
|
|
267
276
|
} catch (error) {
|
|
268
277
|
const aborted = activeSignal?.aborted;
|
|
269
|
-
const nextSemanticAttempt = !aborted &&
|
|
278
|
+
const nextSemanticAttempt = !aborted && dispatch.request && !websocketStarted && error instanceof CodexApiError && isInvalidEncryptedContentError(error) ? await resolveNextResponsesEncryptedContentAttempt(activeAttempt, error, { buildFullHistoryRequest: () => buildBody("full-history") }) : void 0;
|
|
270
279
|
if (nextSemanticAttempt) {
|
|
271
280
|
semanticAttempt = nextSemanticAttempt;
|
|
272
|
-
|
|
281
|
+
retriedWebSocketRejection = false;
|
|
273
282
|
continue;
|
|
274
283
|
}
|
|
275
|
-
const
|
|
276
|
-
if (!aborted &&
|
|
277
|
-
|
|
284
|
+
const reconnectBeforeStart = !websocketStarted && isWebSocketConnectionLimitReachedError(error) || !websocketStarted && dispatch.request?.previous_response_id && error instanceof CodexApiError && error.message === WEBSOCKET_REPLAY_REJECTION;
|
|
285
|
+
if (!aborted && reconnectBeforeStart && !retriedWebSocketRejection) {
|
|
286
|
+
retriedWebSocketRejection = true;
|
|
278
287
|
continue;
|
|
279
288
|
}
|
|
280
|
-
|
|
281
|
-
|
|
289
|
+
const transportError = isWebSocketConnectionLimitReachedError(error) ? Object.assign(new Error(error.message, { cause: error }), { code: WEBSOCKET_TRANSPORT_ERROR_CODE }) : error;
|
|
290
|
+
if (aborted || isCodexNonTransportError(transportError)) throw transportError;
|
|
291
|
+
appendAssistantMessageDiagnostic(output, createAssistantMessageDiagnostic("provider_transport_failure", transportError, {
|
|
282
292
|
configuredTransport: transport,
|
|
283
293
|
fallbackTransport: transport === "auto" && !websocketStarted ? "sse" : void 0,
|
|
284
294
|
eventsEmitted: websocketStarted,
|
|
@@ -286,7 +296,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
286
296
|
requestBytes: new TextEncoder().encode(JSON.stringify(activeAttempt.request)).byteLength
|
|
287
297
|
}));
|
|
288
298
|
if (transport === "auto" && options?.sessionId) websocketSseFallbackSessions.add(options.sessionId);
|
|
289
|
-
if (websocketStarted || transport !== "auto") throw
|
|
299
|
+
if (websocketStarted || transport !== "auto") throw transportError;
|
|
290
300
|
break;
|
|
291
301
|
}
|
|
292
302
|
}
|
|
@@ -763,7 +773,7 @@ function extractWebSocketCloseError(event) {
|
|
|
763
773
|
let reasonText = typeof reason === "string" && reason.length > 0 ? ` ${reason}` : "";
|
|
764
774
|
if (!reasonText && code === WEBSOCKET_MESSAGE_TOO_BIG_CLOSE_CODE) reasonText = " message too big";
|
|
765
775
|
const message = `WebSocket closed${codeText}${reasonText}`;
|
|
766
|
-
const error = typeof code === "number" &&
|
|
776
|
+
const error = typeof code === "number" && RETRYABLE_CLOSE_CODES.has(code) ? createWebSocketTransportError(message) : Object.assign(new Error(message), { code: WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE });
|
|
767
777
|
return Object.assign(error, {
|
|
768
778
|
name: "WebSocketCloseError",
|
|
769
779
|
closeCode: typeof code === "number" ? code : void 0,
|
|
@@ -925,7 +935,7 @@ async function processWebSocketStream(url, body, headers, output, stream, model,
|
|
|
925
935
|
type: "response.create",
|
|
926
936
|
...requestBody
|
|
927
937
|
}));
|
|
928
|
-
onRequestSent?.();
|
|
938
|
+
onRequestSent?.(requestBody);
|
|
929
939
|
const terminal = await processResponsesStream(startWebSocketOutputOnFirstEvent(mapCodexEvents(parseWebSocket(socket, options?.signal), void 0, options), output, stream, onFirstProviderEvent, () => notifyProviderStreamOpened({
|
|
930
940
|
options,
|
|
931
941
|
cancelStream: () => {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
3
|
-
import { T as clampThinkingLevel } from "./host-
|
|
4
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
3
|
+
import { T as clampThinkingLevel } from "./host-DqhMLv8J.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
5
5
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
-
import { S as withProviderResponseHook, b as transportAbortError, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
7
|
-
import { n as buildBaseOptions, s as prepareModelRequestBody, u as reasoningTagTextPolicy } from "./simple-options-
|
|
8
|
-
import {
|
|
6
|
+
import { S as withProviderResponseHook, b as transportAbortError, n as assignTransportErrorDetails } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
7
|
+
import { n as buildBaseOptions, s as prepareModelRequestBody, u as reasoningTagTextPolicy } from "./simple-options-B9u6-CF3.mjs";
|
|
8
|
+
import { C as isOpenAICompletionsThinkingEnabled, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-CqLxK93q.mjs";
|
|
9
9
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
10
10
|
import { a as tagUnresolvedTextAsCommentary, t as clearPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
11
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
12
|
-
import { a as convertMessages, i as buildOpenAICompletionsRequest, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream } from "./openai-completions-stream-
|
|
11
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
12
|
+
import { a as convertMessages, i as buildOpenAICompletionsRequest, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream } from "./openai-completions-stream-iagLwGz6.mjs";
|
|
13
13
|
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
14
|
-
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
14
|
+
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-CUUfdJPN.mjs";
|
|
15
15
|
import { n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
16
|
-
import { t as createOpenAIProviderClient } from "./openai-provider-client-
|
|
16
|
+
import { t as createOpenAIProviderClient } from "./openai-provider-client-Bcjj6_fK.mjs";
|
|
17
17
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
18
18
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
|
19
19
|
convertMessages: () => convertMessages,
|
package/dist/{openai-completions-compat-CqWP1fn5.d.mts → openai-completions-compat-CQbGsPt0.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { M as OpenAICompletionsCompat, O as Model } from "./types-
|
|
3
|
-
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-
|
|
1
|
+
import "./index-Iw8l620S.mjs";
|
|
2
|
+
import { M as OpenAICompletionsCompat, O as Model } from "./types-B89w6ly2.mjs";
|
|
3
|
+
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-BhpDO5Sy.mjs";
|
|
4
4
|
//#region packages/ai/src/transports/openai-completions-compat.d.ts
|
|
5
5
|
type ProviderRequestCapabilities = AiProviderRequestCapabilities;
|
|
6
6
|
type OpenAICompletionsSessionAffinity = "none" | "openai" | "openrouter";
|
package/dist/{openai-completions-compat-W0ykoT4z.mjs → openai-completions-compat-D1q02qdx.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { i as resolveProviderRequestCapabilities } from "./host-policy-
|
|
2
|
+
import { i as resolveProviderRequestCapabilities } from "./host-policy-B3DuH3Le.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/openai-response-format.ts
|
|
4
4
|
const JSON_SCHEMA_RESPONSE_FORMAT_NAME = "openclaw_response";
|
|
5
5
|
const OLLAMA_CLOUD_ORIGIN = "https://ollama.com";
|
package/dist/{openai-completions-stream-Crkc597h.mjs → openai-completions-stream-iagLwGz6.mjs}
RENAMED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { r as appendAssistantThinking } from "./event-stream-vd9UnCAU.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
|
-
import { k as isImageWithMediaPayload, n as getAiTransportHost } from "./host-
|
|
3
|
+
import { k as isImageWithMediaPayload, n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
4
4
|
import { n as isOpenAIGpt55Model, r as isOpenAIGpt56Model, t as isOpenAIGpt54MiniModel } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
5
5
|
import { r as uniqueStrings } from "./string-normalization-J9ZiLfGO.mjs";
|
|
6
6
|
import { o as truncateUtf16Safe } from "./provider-error-CwT_j2v0.mjs";
|
|
7
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
7
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
8
8
|
import { r as emitModelTransportDebug } from "./diagnostics-CJaB6g8J.mjs";
|
|
9
9
|
import { i as asNonNegativeFiniteNumber } from "./base64-C1PsYcRQ.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import { c as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
12
|
-
import { r as resolveProviderEndpoint } from "./host-policy-
|
|
10
|
+
import { l as supportsModelTools, r as estimateStringChars } from "./transport-utils-B11GlmDO.mjs";
|
|
11
|
+
import { c as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
12
|
+
import { r as resolveProviderEndpoint } from "./host-policy-B3DuH3Le.mjs";
|
|
13
13
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
14
|
-
import { E as createToolArgumentPreviewSchedule, O as parseStreamingJson, d as iterateModelStream, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
15
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, m as extractToolResultText, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
16
|
-
import { C as
|
|
14
|
+
import { E as createToolArgumentPreviewSchedule, O as parseStreamingJson, d as iterateModelStream, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, y as throwIfModelStreamAborted } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
15
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, m as extractToolResultText, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-B9u6-CF3.mjs";
|
|
16
|
+
import { A as resolvePromptCacheKey, C as isOpenAICompletionsThinkingEnabled, D as readOpenAICompletionsContentDeltas, E as parseOpenAICompletionsUsage, O as readOpenAICompletionsReasoningBatch, S as detachPartialSnapshot, T as measureUtf8AppendBytes, d as prepareOpenAITools, f as projectOpenAITools, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, p as reconcileOpenAICompletionsToolChoice, s as getCompat, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as log } from "./openai-transport-params-CqLxK93q.mjs";
|
|
17
17
|
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
18
18
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
19
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
19
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
20
|
+
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
20
21
|
import { a as withFirstStreamEventTimeout } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
21
|
-
import { f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-
|
|
22
|
-
import { isGoogleGemini3FlashModel, isGoogleGemini3ProModel } from "./internal/google-model-family.mjs";
|
|
22
|
+
import { f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-DSAxYnHW.mjs";
|
|
23
23
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
24
24
|
import { t as createReasoningTagTextPartitioner } from "./reasoning-tag-text-partitioner-B6FIIBt6.mjs";
|
|
25
25
|
import { randomUUID } from "node:crypto";
|
|
@@ -28,7 +28,13 @@ const DEEPSEEK_DSML_MARKERS = [
|
|
|
28
28
|
"|",
|
|
29
29
|
"|",
|
|
30
30
|
"||"
|
|
31
|
-
].
|
|
31
|
+
].flatMap((bar) => [`${bar}DSML${bar}`, `${bar}DSML${bar} `]);
|
|
32
|
+
const DEEPSEEK_DSML_TOOL_OPEN_TOKENS = DEEPSEEK_DSML_MARKERS.flatMap((marker) => [
|
|
33
|
+
"calls",
|
|
34
|
+
"tool_calls",
|
|
35
|
+
"tool_call",
|
|
36
|
+
"function_calls"
|
|
37
|
+
].map((kind) => `<${marker}${kind}>`));
|
|
32
38
|
const DEEPSEEK_DSML_MARKER_PATTERN = `(${DEEPSEEK_DSML_MARKERS.map((marker) => marker.replaceAll("|", "\\|")).join("|")})`;
|
|
33
39
|
function findEarliestDsmlToken(text, tokens, fromIndex = 0) {
|
|
34
40
|
let best = null;
|
|
@@ -56,13 +62,7 @@ function longestDsmlTokenPrefixSuffixLength(text, tokens, maxTokenLength) {
|
|
|
56
62
|
* Removes provider-emitted DSML tool markup while buffering split tag prefixes
|
|
57
63
|
* across streamed chunks.
|
|
58
64
|
*/
|
|
59
|
-
const
|
|
60
|
-
"tool_use_error",
|
|
61
|
-
"tool_calls",
|
|
62
|
-
"tool_call",
|
|
63
|
-
"function_calls"
|
|
64
|
-
];
|
|
65
|
-
const DSML_OPEN_TOKENS = DEEPSEEK_DSML_MARKERS.flatMap((marker) => DSML_KINDS.map((kind) => `<${marker}${kind}>`));
|
|
65
|
+
const DSML_OPEN_TOKENS = [...DEEPSEEK_DSML_TOOL_OPEN_TOKENS, ...DEEPSEEK_DSML_MARKERS.map((marker) => `<${marker}tool_use_error>`)];
|
|
66
66
|
const MAX_OPEN_TOKEN_LEN = Math.max(...DSML_OPEN_TOKENS.map((token) => token.length));
|
|
67
67
|
/** Create an incremental text filter that strips DeepSeek DSML tool blocks. */
|
|
68
68
|
function createDeepSeekTextFilter() {
|
|
@@ -685,7 +685,7 @@ function isGoogleOpenAICompatModel(model) {
|
|
|
685
685
|
return model.provider === "google" || endpointClass === "google-generative-ai" || endpointClass === "google-vertex";
|
|
686
686
|
}
|
|
687
687
|
function requiresGoogleCompatToolCallThoughtSignature(model) {
|
|
688
|
-
return
|
|
688
|
+
return isGoogleGemini3ThinkingLevelModel(model.id);
|
|
689
689
|
}
|
|
690
690
|
const GOOGLE_COMPAT_THOUGHT_SIGNATURE_ELLIPSIS_RE = /[\u2026]|\.\.\./;
|
|
691
691
|
const GOOGLE_COMPAT_THOUGHT_SIGNATURE_BASE64_RE = /^[A-Za-z0-9+/=]+$/;
|
|
@@ -1111,12 +1111,6 @@ function buildOpenAICompletionsRequest(model, context, options, policy) {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
//#endregion
|
|
1113
1113
|
//#region packages/ai/src/transports/openai-completions-dsml.ts
|
|
1114
|
-
const DEEPSEEK_DSML_TOOL_KINDS = [
|
|
1115
|
-
"tool_calls",
|
|
1116
|
-
"tool_call",
|
|
1117
|
-
"function_calls"
|
|
1118
|
-
];
|
|
1119
|
-
const DEEPSEEK_DSML_TOOL_OPEN_TOKENS = DEEPSEEK_DSML_MARKERS.flatMap((marker) => DEEPSEEK_DSML_TOOL_KINDS.map((kind) => `<${marker}${kind}>`));
|
|
1120
1114
|
const DEEPSEEK_DSML_INVOKE_OPEN_PREFIXES = DEEPSEEK_DSML_MARKERS.map((marker) => `<${marker}invoke`);
|
|
1121
1115
|
const DEEPSEEK_DSML_INVOKE_OPEN_TAG = new RegExp(`^<${DEEPSEEK_DSML_MARKER_PATTERN}invoke\\b[^<>]*>$`);
|
|
1122
1116
|
const DEEPSEEK_DSML_TOOL_MAX_OPEN_TOKEN_LEN = Math.max(...DEEPSEEK_DSML_TOOL_OPEN_TOKENS.map((token) => token.length));
|
|
@@ -1374,9 +1368,9 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1374
1368
|
const emitReasoning = options?.emitReasoning ?? true;
|
|
1375
1369
|
const compat = getCompat(model);
|
|
1376
1370
|
const visibleReasoningDetailTypes = new Set(compat.visibleReasoningDetailTypes);
|
|
1377
|
-
const shouldFilterDeepSeekDsmlText =
|
|
1371
|
+
const shouldFilterDeepSeekDsmlText = compat.thinkingFormat === "deepseek";
|
|
1378
1372
|
const deepSeekTextFilter = shouldFilterDeepSeekDsmlText ? createDeepSeekTextFilter() : null;
|
|
1379
|
-
const deepSeekToolCallRecoverer = shouldFilterDeepSeekDsmlText ? createDsmlRecoverer() : null;
|
|
1373
|
+
const deepSeekToolCallRecoverer = !directMode && shouldFilterDeepSeekDsmlText ? createDsmlRecoverer() : null;
|
|
1380
1374
|
const reasoningTagTextPartitioner = createReasoningTagTextPartitioner();
|
|
1381
1375
|
if (options?.strictReasoningTags) reasoningTagTextPartitioner.markStrict();
|
|
1382
1376
|
let currentBlock = null;
|
|
@@ -1403,7 +1397,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1403
1397
|
let chunkPushedEvent = false;
|
|
1404
1398
|
const pushStreamEvent = (event) => {
|
|
1405
1399
|
chunkPushedEvent = true;
|
|
1406
|
-
stream.push(event);
|
|
1400
|
+
stream.push(detachPartialSnapshot(event));
|
|
1407
1401
|
};
|
|
1408
1402
|
const queuePostToolCallDelta = (next) => {
|
|
1409
1403
|
const nextBytes = Buffer.byteLength(next.text, "utf8");
|
|
@@ -1576,7 +1570,8 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1576
1570
|
if (latestBlock?.type === "text" || latestBlock?.type === "toolCall") return;
|
|
1577
1571
|
appendThinkingDelta({ text: "" });
|
|
1578
1572
|
};
|
|
1579
|
-
const flushReasoningTagTextPartitioner = () => {
|
|
1573
|
+
const flushReasoningTagTextPartitioner = (allowRecovery = true) => {
|
|
1574
|
+
if (!(allowRecovery && output.stopReason !== "length" && output.stopReason !== "error" && output.stopReason !== "aborted")) reasoningTagTextPartitioner.markStrict();
|
|
1580
1575
|
for (const delta of reasoningTagTextPartitioner.flush()) appendPartitionedVisibleDelta(delta);
|
|
1581
1576
|
};
|
|
1582
1577
|
const sealTextBeforeReasoning = () => {
|
|
@@ -1668,7 +1663,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1668
1663
|
const toolCallDeltas = normalizedDelta.toolCalls;
|
|
1669
1664
|
if (toolCallDeltas.length > 0) {
|
|
1670
1665
|
sawNativeToolCallDelta = true;
|
|
1671
|
-
flushReasoningTagTextPartitioner();
|
|
1666
|
+
flushReasoningTagTextPartitioner(false);
|
|
1672
1667
|
rememberPendingCommentaryTags(provisionalCommentaryTags, tagPendingCommentaryText(output.content));
|
|
1673
1668
|
for (const toolCall of toolCallDeltas) {
|
|
1674
1669
|
const streamIndex = typeof toolCall.index === "number" ? toolCall.index : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as OpenAICompletionsCompat, O as Model, l as CacheRetention } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { M as OpenAICompletionsCompat, O as Model, l as CacheRetention } from "./types-B89w6ly2.mjs";
|
|
2
|
+
import "./types-DbmNRKvK.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/openai-prompt-cache.d.ts
|
|
4
4
|
/** Selects documented lifetime fields shared by Responses and Chat Completions. */
|
|
5
5
|
declare function resolveOpenAIPromptCacheParams(model: Pick<Model, "id" | "provider" | "baseUrl">, cacheRetention: CacheRetention, compat: Required<Pick<OpenAICompletionsCompat, "supportsPromptCacheKey" | "supportsLongCacheRetention">>): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
2
2
|
//#region packages/normalization-core/src/code-points.ts
|
|
3
3
|
/** Truncates to a nonnegative code-point budget; grapheme clusters may be split. */
|
|
4
4
|
function truncateCodePoints(text, maxCodePoints) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
2
|
-
import {
|
|
1
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
2
|
+
import { k as resolveOpenAIClientBaseUrl } from "./openai-transport-params-CqLxK93q.mjs";
|
|
3
3
|
import { i as resolveCloudflareBaseUrl, r as isCloudflareProvider } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
4
4
|
import OpenAI from "openai";
|
|
5
5
|
//#region packages/ai/src/providers/openai-provider-client.ts
|