@openclaw/ai 2026.11.6 → 2026.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +1 -1
- package/dist/{anthropic-BNkSFJGp.mjs → anthropic-OsxZVxT3.mjs} +5 -5
- package/dist/{anthropic-payload-policy-DxijyMFH.d.mts → anthropic-payload-policy-CcIAtAos.d.mts} +3 -3
- package/dist/{anthropic-stream-lifecycle-Dp5TblwC.mjs → anthropic-stream-lifecycle-BA3FkIQn.mjs} +10 -10
- package/dist/{anthropic-tool-projection-DX_igbpX.d.mts → anthropic-tool-projection-DFvJiCQy.d.mts} +1 -1
- package/dist/{anthropic-tool-projection-DpN77rtb.mjs → anthropic-tool-projection-DP6R_sBq.mjs} +1 -1
- package/dist/{api-registry-CCdcCPSA.d.mts → api-registry-CvAtt60P.d.mts} +2 -2
- package/dist/{assistant-output-BEE6TWdj.mjs → assistant-output-ByrQmF0P.mjs} +1 -1
- package/dist/{azure-openai-responses-BjX0owXR.mjs → azure-openai-responses-NfpppzMN.mjs} +4 -4
- package/dist/diagnostics.d.mts +3 -3
- package/dist/event-stream-C1QKiamS.d.mts +1 -0
- package/dist/{event-stream-CDyUvxkI.d.mts → event-stream-DSHjzUpL.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-BJwjWpAX.mjs → google-DkwM8MvM.mjs} +2 -2
- package/dist/{google-interactions-BEOEOp0d.mjs → google-interactions-BUXAmg4x.mjs} +10 -10
- package/dist/{google-messages-Bja86PP8.mjs → google-messages-ClSK5R7R.mjs} +3 -3
- package/dist/{google-provider-stream-GYgtu60C.mjs → google-provider-stream-BiDLtKTp.mjs} +6 -6
- package/dist/{google-shared-7sAuYDNq.mjs → google-shared-Bny3gZ6L.mjs} +5 -5
- package/dist/{google-vertex-2zavNJkj.mjs → google-vertex-DQ3ErTAp.mjs} +2 -2
- package/dist/{host-DZ29cEYd.mjs → host-BVynqwGC.mjs} +40 -28
- package/dist/{host-C2_6_j-L.d.mts → host-bx8W0SER.d.mts} +3 -3
- package/dist/{host-policy-DqFgGiV6.mjs → host-policy-C1VDPJqb.mjs} +1 -1
- package/dist/{index-DkF8J4yH.d.mts → index-DqIreoGH.d.mts} +3 -3
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +6 -6
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/google.d.mts +3 -3
- package/dist/internal/google.mjs +1 -1
- 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-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +10 -10
- package/dist/internal/openai.mjs +9 -9
- package/dist/internal/runtime.d.mts +8 -8
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +10 -10
- package/dist/internal/shared.mjs +3 -3
- package/dist/internal/tool-schema.d.mts +2 -2
- package/dist/internal/tool-schema.mjs +3 -3
- package/dist/{mistral-CjTsnfIz.mjs → mistral-C_S0gC58.mjs} +9 -9
- package/dist/{openai-chatgpt-responses-BinD_u6y.mjs → openai-chatgpt-responses-Dzj5zqW6.mjs} +11 -11
- package/dist/{openai-completions-B380Vg0n.mjs → openai-completions-7jTg6B6X.mjs} +3 -3
- package/dist/{openai-completions-compat-CEj778te.d.mts → openai-completions-compat-C26ajk4r.d.mts} +3 -3
- package/dist/{openai-completions-compat-CmyT3piu.mjs → openai-completions-compat-CDNGOoQn.mjs} +2 -2
- package/dist/{openai-completions-transport-BGoKrb3z.mjs → openai-completions-transport-DKSeBBXY.mjs} +28 -28
- package/dist/{openai-function-tool-DUT14vv6.mjs → openai-function-tool-8ION6Su5.mjs} +1 -1
- package/dist/{openai-prompt-cache-DV1t-7dP.mjs → openai-prompt-cache-CZSWH8rC.mjs} +1 -1
- package/dist/{openai-prompt-cache-C_XCgsDn.d.mts → openai-prompt-cache-rhVEVVcq.d.mts} +2 -2
- package/dist/{openai-responses-ClgomgWG.mjs → openai-responses-Dn3ad3e-.mjs} +6 -6
- package/dist/{openai-responses-compaction-replay-6MNmDBBu.d.mts → openai-responses-compaction-replay-DpVAOvpR.d.mts} +4 -4
- package/dist/{openai-responses-contracts-D-saZnr_.d.mts → openai-responses-contracts-D6OypGUv.d.mts} +4 -4
- package/dist/{openai-responses-contracts-BpyK1Ygq.mjs → openai-responses-contracts-YlVzpuW_.mjs} +1 -1
- package/dist/{openai-responses-endpoint-BGwjxesS.mjs → openai-responses-endpoint-D8fhfY4d.mjs} +1 -1
- package/dist/{openai-responses-request-lifecycle-pjoJ2KB8.mjs → openai-responses-request-lifecycle-BRnD7G5s.mjs} +6 -6
- package/dist/{openai-responses-shared-BE2zSjin.mjs → openai-responses-shared-CNBWb5iO.mjs} +14 -14
- package/dist/{openai-responses-terminal-usage-CuXS9TCK.d.mts → openai-responses-terminal-usage-B9dUhNQJ.d.mts} +2 -2
- package/dist/{openai-responses-websocket-Bzo4ykRX.mjs → openai-responses-websocket-BbTCvD64.mjs} +8 -8
- package/dist/{openai-stop-reason-8s70vDXj.mjs → openai-stop-reason-CpYv2sZh.mjs} +3 -1
- package/dist/{otel-VKlSbm9p.mjs → otel-Cmspirtq.mjs} +1 -1
- package/dist/{provider-options-Bo0XJEeK.d.mts → provider-options-2vKAAn7G.d.mts} +3 -3
- package/dist/{provider-replay-context-BAwe7OIR.mjs → provider-replay-context-CeMMMu55.mjs} +1 -1
- package/dist/{provider-transcript-transform-BA4B0NIr.mjs → provider-transcript-transform-C99cDpZV.mjs} +1 -1
- package/dist/{provider-transport-turn-state-BU7KCpkK.mjs → provider-transport-turn-state-DIis-pzH.mjs} +3 -3
- package/dist/{provider-types-wHqA9oSz.d.mts → provider-types-C8GKdM8d.d.mts} +4 -4
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{sanitize-unicode-D0B2CDXP.d.mts → sanitize-unicode-DzL-LjLt.d.mts} +3 -3
- package/dist/{simple-options-BPzChce1.mjs → simple-options-M4Ngy-Ej.mjs} +3 -3
- package/dist/{stream-WbisbzUF.mjs → stream-Dm0EMT-0.mjs} +1 -1
- package/dist/{telemetry-BS2h0FVa.mjs → telemetry-X9oIHyf3.mjs} +2 -2
- package/dist/{tool-schema-json-projection-C9KSjPuG.mjs → tool-schema-json-projection-BIs0pwdB.mjs} +1 -1
- package/dist/{transport-stream-shared-DtOk207K.mjs → transport-stream-shared-CBr4U0TY.mjs} +4 -3
- package/dist/{transport-stream-shared-Cwd9ZIqy.d.mts → transport-stream-shared-CMWWoyy5.d.mts} +6 -5
- package/dist/{transport-utils-Czu6bnbQ.mjs → transport-utils-DSJQf0i_.mjs} +2 -2
- package/dist/transports.d.mts +19 -15
- package/dist/transports.mjs +21 -13
- package/dist/{types-DrqxFIh9.d.mts → types-B6vvn8is.d.mts} +10 -2
- package/dist/types-a4Eg5L2z.d.mts +1 -0
- package/dist/types.d.mts +6 -6
- package/dist/{validation-ByHJvdN2.d.mts → validation-B3VZTKei.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/package.json +1 -1
- package/dist/event-stream-X0f18GAs.d.mts +0 -1
- package/dist/types-g3molYjD.d.mts +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-CDNGOoQn.mjs";
|
|
2
2
|
import { t as requiresReasoningContentReplay } from "../openai-completions-reasoning-replay-BwT1xwRI.mjs";
|
|
3
3
|
export { requiresReasoningContentReplay, resolveOpenAICompletionsCompat };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS, u as OpenAIResponsesCompactionOutput } from "../openai-responses-contracts-
|
|
1
|
+
import { d as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS, u as OpenAIResponsesCompactionOutput } from "../openai-responses-contracts-D6OypGUv.mjs";
|
|
2
2
|
import { c as resolveOpenAIResponsesServerCompactionPlan, i as normalizeOpenAIServiceTier, o as resolveOpenAIResponsesPayloadPolicy, s as resolveOpenAIResponsesRequestContextTokens, t as OpenAIServiceTier } from "../openai-responses-payload-policy-BsQaD-gD.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/openai-responses-endpoint.d.ts
|
|
4
4
|
export declare function supportsNativeOpenAIResponsesEndpoint(params: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import { d as normalizeOpenAIServiceTier, h as resolveOpenAIResponsesServerCompactionPlan, m as resolveOpenAIResponsesRequestContextTokens, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-endpoint-
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-YlVzpuW_.mjs";
|
|
2
|
+
import { d as normalizeOpenAIServiceTier, h as resolveOpenAIResponsesServerCompactionPlan, m as resolveOpenAIResponsesRequestContextTokens, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-endpoint-D8fhfY4d.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, normalizeOpenAIServiceTier, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, supportsNativeOpenAIResponsesEndpoint };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-
|
|
3
|
-
import "../types-
|
|
4
|
-
import { a as ProviderContext, c as ProviderModel } from "../provider-types-
|
|
5
|
-
import { A as resolveOpenAISupportedReasoningEfforts, C as isOpenAIGpt55Model, D as resolveOpenAIModelReasoningEfforts, E as normalizeOpenAIReasoningEffort, M as supportsOpenAITemperature, O as resolveOpenAIReasoningEffortForModel, S as isOpenAIGpt54MiniModel, T as isOpenAIGpt6Model, _ as reconcileOpenAICompletionsToolChoice, a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort, c as OpenAICompletionsOptions, d as measuredRequestPressure, g as projectOpenAITools, h as OpenAIToolProjection, j as supportsOpenAIReasoningEffort, k as resolveOpenAIReasoningEffortMapping, m as OpenAICompletionsToolChoice, o as CodeModeToolSurfaceObservation, p as reasoningTagTextPolicy, u as codeModeToolSurfaceObserver, v as reconcileOpenAIResponsesToolChoice, w as isOpenAIGpt56Model, x as applyOpenAICompletionsToolReasoning, y as OpenAIApiReasoningEffort } from "../provider-options-
|
|
6
|
-
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
7
|
-
import { c as responsesPromptObserver, f as OpenAIRequestReasoningEffort, l as responsesServiceTierObserver, o as ResponsesPromptObservation, s as ResponsesServiceTierObservation } from "../openai-responses-contracts-
|
|
8
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
9
|
-
import { a as readResponsesReasoningTokens, i as mapResponsesTerminalUsage, n as applyResponsesCacheWritePricing, o as resolveResponsesTerminalStopReason, r as isResponsesOutputLimitToolCallError, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-
|
|
10
|
-
import "../openai-responses-compaction-replay-
|
|
1
|
+
import { f as Context, it as StopReason, ot as StreamFunction, rt as SimpleStreamOptions } from "../types-B6vvn8is.mjs";
|
|
2
|
+
import "../index-DqIreoGH.mjs";
|
|
3
|
+
import "../types-a4Eg5L2z.mjs";
|
|
4
|
+
import { a as ProviderContext, c as ProviderModel } from "../provider-types-C8GKdM8d.mjs";
|
|
5
|
+
import { A as resolveOpenAISupportedReasoningEfforts, C as isOpenAIGpt55Model, D as resolveOpenAIModelReasoningEfforts, E as normalizeOpenAIReasoningEffort, M as supportsOpenAITemperature, O as resolveOpenAIReasoningEffortForModel, S as isOpenAIGpt54MiniModel, T as isOpenAIGpt6Model, _ as reconcileOpenAICompletionsToolChoice, a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort, c as OpenAICompletionsOptions, d as measuredRequestPressure, g as projectOpenAITools, h as OpenAIToolProjection, j as supportsOpenAIReasoningEffort, k as resolveOpenAIReasoningEffortMapping, m as OpenAICompletionsToolChoice, o as CodeModeToolSurfaceObservation, p as reasoningTagTextPolicy, u as codeModeToolSurfaceObserver, v as reconcileOpenAIResponsesToolChoice, w as isOpenAIGpt56Model, x as applyOpenAICompletionsToolReasoning, y as OpenAIApiReasoningEffort } from "../provider-options-2vKAAn7G.mjs";
|
|
6
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-C26ajk4r.mjs";
|
|
7
|
+
import { c as responsesPromptObserver, f as OpenAIRequestReasoningEffort, l as responsesServiceTierObserver, o as ResponsesPromptObservation, s as ResponsesServiceTierObservation } from "../openai-responses-contracts-D6OypGUv.mjs";
|
|
8
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-rhVEVVcq.mjs";
|
|
9
|
+
import { a as readResponsesReasoningTokens, i as mapResponsesTerminalUsage, n as applyResponsesCacheWritePricing, o as resolveResponsesTerminalStopReason, r as isResponsesOutputLimitToolCallError, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-B9dUhNQJ.mjs";
|
|
10
|
+
import "../openai-responses-compaction-replay-DpVAOvpR.mjs";
|
|
11
11
|
import { encodedModelRequestBodyStream, modelRequestBodyState } from "./model-request-body.mjs";
|
|
12
12
|
import { ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
13
13
|
import { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as resolveOpenAIReasoningEffortMapping, C as isOpenAIGpt54MiniModel, D as normalizeOpenAIReasoningEffort, E as isOpenAIGpt6Model, M as supportsOpenAIReasoningEffort, N as supportsOpenAITemperature, O as resolveOpenAIModelReasoningEfforts, S as applyOpenAICompletionsToolReasoning, T as isOpenAIGpt56Model, j as resolveOpenAISupportedReasoningEfforts, k as resolveOpenAIReasoningEffortForModel, v as responsesPromptObserver, w as isOpenAIGpt55Model, y as responsesServiceTierObserver } from "../openai-responses-contracts-
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
1
|
+
import { A as resolveOpenAIReasoningEffortMapping, C as isOpenAIGpt54MiniModel, D as normalizeOpenAIReasoningEffort, E as isOpenAIGpt6Model, M as supportsOpenAIReasoningEffort, N as supportsOpenAITemperature, O as resolveOpenAIModelReasoningEfforts, S as applyOpenAICompletionsToolReasoning, T as isOpenAIGpt56Model, j as resolveOpenAISupportedReasoningEfforts, k as resolveOpenAIReasoningEffortForModel, v as responsesPromptObserver, w as isOpenAIGpt55Model, y as responsesServiceTierObserver } from "../openai-responses-contracts-YlVzpuW_.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-CZSWH8rC.mjs";
|
|
3
3
|
import { _ as isResponsesOutputLimitToolCallError, b as resolveResponsesTerminalStopReason, g as applyResponsesCacheWritePricing, v as mapResponsesTerminalUsage, y as readResponsesReasoningTokens } from "../diagnostics-CloVGQiK.mjs";
|
|
4
|
-
import { d as measuredRequestPressure, p as reasoningTagTextPolicy, u as codeModeToolSurfaceObserver } from "../simple-options-
|
|
4
|
+
import { d as measuredRequestPressure, p as reasoningTagTextPolicy, u as codeModeToolSurfaceObserver } from "../simple-options-M4Ngy-Ej.mjs";
|
|
5
5
|
import { encodedModelRequestBodyStream, modelRequestBodyState } from "./model-request-body.mjs";
|
|
6
|
-
import { l as convertMessages, s as hasResponsesWebSearchTool } from "../openai-completions-transport-
|
|
7
|
-
import { G as reconcileOpenAICompletionsToolChoice, K as reconcileOpenAIResponsesToolChoice, W as projectOpenAITools, _ as isAzureResponsesTextDeltaEventType, b as resolveResponsesMessageSnapshotCollapse, f as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, ft as bindResponsesInputMessage, g as isAzureResponsesTextDeltaEvent, h as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, p as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextContentPartType, y as isResponsesTextDeltaEventType } from "../openai-responses-shared-
|
|
6
|
+
import { l as convertMessages, s as hasResponsesWebSearchTool } from "../openai-completions-transport-DKSeBBXY.mjs";
|
|
7
|
+
import { G as reconcileOpenAICompletionsToolChoice, K as reconcileOpenAIResponsesToolChoice, W as projectOpenAITools, _ as isAzureResponsesTextDeltaEventType, b as resolveResponsesMessageSnapshotCollapse, f as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, ft as bindResponsesInputMessage, g as isAzureResponsesTextDeltaEvent, h as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, p as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextContentPartType, y as isResponsesTextDeltaEventType } from "../openai-responses-shared-CNBWb5iO.mjs";
|
|
8
8
|
import { n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-a5PrPIdL.mjs";
|
|
9
|
-
import { t as mapOpenAIStopReason } from "../openai-stop-reason-
|
|
9
|
+
import { t as mapOpenAIStopReason } from "../openai-stop-reason-CpYv2sZh.mjs";
|
|
10
10
|
import { n as resolveAzureDeploymentNameFromMap, t as parseAzureDeploymentNameMap } from "../azure-deployment-map-DKJ8Xc4c.mjs";
|
|
11
|
-
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-
|
|
12
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
13
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
11
|
+
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-BRnD7G5s.mjs";
|
|
12
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-7jTg6B6X.mjs";
|
|
13
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-Dn3ad3e-.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, applyOpenAICompletionsToolReasoning, applyResponsesCacheWritePricing, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, independentResponsesRequest, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, measuredRequestPressure, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-
|
|
3
|
-
import { i as getEventStreamCompletion } from "../event-stream-
|
|
4
|
-
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-
|
|
5
|
-
import { m as getDefaultAiTransportHost } from "../host-
|
|
6
|
-
import "../types-
|
|
7
|
-
import { n as isContextOverflow, t as sanitizeSurrogates } from "../sanitize-unicode-
|
|
8
|
-
import {
|
|
1
|
+
import { F as ModelThinkingLevel, c as AssistantMessageEventStreamContract, f as Context, j as Model, n as Api, o as AssistantMessage, q as ProviderStreamOptions, rt as SimpleStreamOptions, st as StreamOptions, vt as Usage } from "../types-B6vvn8is.mjs";
|
|
2
|
+
import "../index-DqIreoGH.mjs";
|
|
3
|
+
import { i as getEventStreamCompletion } from "../event-stream-DSHjzUpL.mjs";
|
|
4
|
+
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-CvAtt60P.mjs";
|
|
5
|
+
import { m as getDefaultAiTransportHost } from "../host-bx8W0SER.mjs";
|
|
6
|
+
import "../types-a4Eg5L2z.mjs";
|
|
7
|
+
import { n as isContextOverflow, t as sanitizeSurrogates } from "../sanitize-unicode-DzL-LjLt.mjs";
|
|
8
|
+
import { b as parseTerminalToolCallArguments } from "../transport-stream-shared-CMWWoyy5.mjs";
|
|
9
9
|
//#region packages/ai/src/internal/default-runtime.d.ts
|
|
10
10
|
export declare const defaultApiRegistry: {
|
|
11
11
|
registerApiProvider: <TApi extends Api, TOptions extends StreamOptions>(provider: ApiProvider<TApi, TOptions>, sourceId?: string) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as getEventStreamCompletion } from "../event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-
|
|
3
|
-
import { A as applyProviderReportedUsageCost, M as clampThinkingLevel, N as getSupportedThinkingLevels, P as modelsAreEqual, j as calculateCost, k as headersToRecord } from "../host-
|
|
2
|
+
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-Dm0EMT-0.mjs";
|
|
3
|
+
import { A as applyProviderReportedUsageCost, M as clampThinkingLevel, N as getSupportedThinkingLevels, P as modelsAreEqual, j as calculateCost, k as headersToRecord } from "../host-BVynqwGC.mjs";
|
|
4
4
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-vKvGIE3J.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CRGuMONI.mjs";
|
|
6
|
-
import { A as
|
|
6
|
+
import { A as parseJsonWithRepair, M as repairJson, O as shortHash, j as parseStreamingJson, k as createToolArgumentPreviewSchedule, v as parseTerminalToolCallArguments } from "../transport-stream-shared-CBr4U0TY.mjs";
|
|
7
7
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-BuHc86ya.mjs";
|
|
8
8
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-tIGkTkTm.mjs";
|
|
9
9
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-DzaHoRAU.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-
|
|
3
|
-
import { a as readAssistantThinkingAppend } from "../event-stream-
|
|
4
|
-
import "../types-
|
|
5
|
-
import { u as ProviderStreamOptions } from "../provider-types-
|
|
6
|
-
import { f as preparedRequestSuffix } from "../provider-options-
|
|
1
|
+
import { A as Message, V as PreparedSystemPrompt, f as Context, ft as ThinkingLevel, i as AssistantHistoryMessage, j as Model, n as Api, rt as SimpleStreamOptions, ut as ThinkingBudgets } from "../types-B6vvn8is.mjs";
|
|
2
|
+
import "../index-DqIreoGH.mjs";
|
|
3
|
+
import { a as readAssistantThinkingAppend } from "../event-stream-DSHjzUpL.mjs";
|
|
4
|
+
import "../types-a4Eg5L2z.mjs";
|
|
5
|
+
import { u as ProviderStreamOptions } from "../provider-types-C8GKdM8d.mjs";
|
|
6
|
+
import { f as preparedRequestSuffix } from "../provider-options-2vKAAn7G.mjs";
|
|
7
7
|
import { serializeModelRequestBody } from "./model-request-body.mjs";
|
|
8
|
-
import { r as matchesContextOverflowMessage, t as sanitizeSurrogates } from "../sanitize-unicode-
|
|
8
|
+
import { r as matchesContextOverflowMessage, t as sanitizeSurrogates } from "../sanitize-unicode-DzL-LjLt.mjs";
|
|
9
9
|
import { i as projectProviderError } from "../provider-error-CnaWYTRY.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { h as iterateSseFrames } from "../transport-stream-shared-CMWWoyy5.mjs";
|
|
11
11
|
import { i as projectPreparedDiagnosticValue, n as isCredentialFieldName } from "../credential-redaction-DrgndwTJ.mjs";
|
|
12
12
|
import { n as normalizeStructuredPromptSection, r as sortPromptCacheToolsByName, t as normalizePromptCapabilityIds } from "../prompt-cache-stability-Cwcjv_fx.mjs";
|
|
13
13
|
//#region packages/ai/src/providers/simple-options.d.ts
|
|
@@ -55,7 +55,7 @@ export declare function isImageWithMediaPayload<T>(block: T): block is T & {
|
|
|
55
55
|
};
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region packages/ai/src/transcript-transform.d.ts
|
|
58
|
-
export declare function transformMessages<TApi extends Api>(messages: Message[], model: Model<TApi>, normalizeToolCallId?: (id: string, model: Model<TApi>, source:
|
|
58
|
+
export declare function transformMessages<TApi extends Api>(messages: Message[], model: Model<TApi>, normalizeToolCallId?: (id: string, model: Model<TApi>, source: AssistantHistoryMessage) => string): Message[];
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region packages/ai/src/replay-turn-classification.d.ts
|
|
61
61
|
type AssistantTurnLike = {
|
|
@@ -107,7 +107,7 @@ export declare function prependSystemPromptAdditionAfterCacheBoundary(params: {
|
|
|
107
107
|
/** Request facts shared by Copilot transports; identity headers remain plugin-owned. */
|
|
108
108
|
export declare function projectCopilotRequestFacts(messages: readonly {
|
|
109
109
|
role: string;
|
|
110
|
-
content
|
|
110
|
+
content?: unknown;
|
|
111
111
|
runtimeContext?: unknown;
|
|
112
112
|
runtimeContextCarrier?: unknown;
|
|
113
113
|
}[], contentMode: "direct" | "nested", hasImages?: boolean): {
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { s as readAssistantThinkingAppend } from "../event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { F as hasMediaPayload, I as isImageWithMediaPayload, c as transformMessages, d as hasOnlyAssistantReasoningContent, f as isReasoningOnlyLengthAssistantTurn, l as FAILED_ASSISTANT_REPLAY_TEXT, m as resolveFailedAssistantReplay, p as isStreamErrorFallbackContent, u as STREAM_ERROR_FALLBACK_TEXT } from "../host-
|
|
2
|
+
import { F as hasMediaPayload, I as isImageWithMediaPayload, c as transformMessages, d as hasOnlyAssistantReasoningContent, f as isReasoningOnlyLengthAssistantTurn, l as FAILED_ASSISTANT_REPLAY_TEXT, m as resolveFailedAssistantReplay, p as isStreamErrorFallbackContent, u as STREAM_ERROR_FALLBACK_TEXT } from "../host-BVynqwGC.mjs";
|
|
3
3
|
import { i as isCredentialFieldName, n as projectProviderError, o as projectPreparedDiagnosticValue } from "../provider-error-DD-fo4Rz.mjs";
|
|
4
4
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CRGuMONI.mjs";
|
|
5
5
|
import { n as normalizeStructuredPromptSection, r as sortPromptCacheToolsByName, t as normalizePromptCapabilityIds } from "../prompt-cache-stability-w-ICeyOI.mjs";
|
|
6
|
-
import { C as stripSystemPromptCacheBoundary, S as splitSystemPromptRelocatableBoundary, _ as createSystemPromptCacheBoundaryStripper, a as describeToolResultMediaPlaceholder, b as prependSystemPromptAdditionAfterCacheBoundary, c as extractToolResultText, f as preparedRequestSuffix, g as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, h as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, i as clampReasoning, l as formatToolResultText, m as SYSTEM_PROMPT_CACHE_BOUNDARY, n as buildBaseOptions, o as describeUnsupportedToolResultMedia, r as clampMaxTokensToModel, s as extractToolResultBlockText, t as adjustMaxTokensForThinking, v as ensureSystemPromptCacheBoundary, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as prepareSystemPrompt } from "../simple-options-
|
|
7
|
-
import {
|
|
6
|
+
import { C as stripSystemPromptCacheBoundary, S as splitSystemPromptRelocatableBoundary, _ as createSystemPromptCacheBoundaryStripper, a as describeToolResultMediaPlaceholder, b as prependSystemPromptAdditionAfterCacheBoundary, c as extractToolResultText, f as preparedRequestSuffix, g as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, h as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, i as clampReasoning, l as formatToolResultText, m as SYSTEM_PROMPT_CACHE_BOUNDARY, n as buildBaseOptions, o as describeUnsupportedToolResultMedia, r as clampMaxTokensToModel, s as extractToolResultBlockText, t as adjustMaxTokensForThinking, v as ensureSystemPromptCacheBoundary, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as prepareSystemPrompt } from "../simple-options-M4Ngy-Ej.mjs";
|
|
7
|
+
import { p as iterateSseFrames } from "../transport-stream-shared-CBr4U0TY.mjs";
|
|
8
8
|
import { serializeModelRequestBody } from "./model-request-body.mjs";
|
|
9
9
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-BZ_EMo7X.mjs";
|
|
10
10
|
import { n as matchesContextOverflowMessage } from "../overflow-CpApyjG2.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as OpenAIToolProjection } from "../provider-options-
|
|
2
|
-
import { a as prepareAnthropicInputSchema } from "../anthropic-tool-projection-
|
|
1
|
+
import { h as OpenAIToolProjection } from "../provider-options-2vKAAn7G.mjs";
|
|
2
|
+
import { a as prepareAnthropicInputSchema } from "../anthropic-tool-projection-DFvJiCQy.mjs";
|
|
3
3
|
import { TSchema } from "typebox";
|
|
4
4
|
//#region packages/ai/src/providers/agent-tools-parameter-schema.d.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as MAX_TOOL_SCHEMA_DEPTH, f as inheritToolSchemaTruncation, g as wasToolSchemaTruncated, h as truncateToolSchemaDepth, i as publishRuntimeToolInputSchema, m as toolSchemaChildPosition, p as reportToolSchemaTruncation, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_MAP_KEYS, y as SCHEMA_NESTED_KEYS } from "../tool-schema-json-projection-
|
|
2
|
-
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-
|
|
3
|
-
import { _ as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, a as normalizeStrictOpenAIJsonSchema, b as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, c as findOpenAIStrictSchemaViolations, d as normalizeToolParameterSchema, f as resolveUnsupportedToolSchemaKeywords, g as stripUnsupportedSchemaKeywords, i as normalizeOpenAIStrictToolParameters, l as normalizeOpenAIStrictCompatSchema, n as findOpenAIStrictToolProjectionDiagnostics, o as resolveOpenAIProjectedToolsStrictToolFlag, p as shouldOmitEmptyArrayItems, r as isStrictOpenAIJsonSchemaCompatible, s as findCompatClosedObjectPaths, t as prepareOpenAIFunctionTool, u as extractToolSchemaModelCompat, v as cleanSchemaForLlamacppGbnf, x as cleanSchemaForGemini, y as findLlamacppGbnfSchemaViolations } from "../openai-function-tool-
|
|
1
|
+
import { d as MAX_TOOL_SCHEMA_DEPTH, f as inheritToolSchemaTruncation, g as wasToolSchemaTruncated, h as truncateToolSchemaDepth, i as publishRuntimeToolInputSchema, m as toolSchemaChildPosition, p as reportToolSchemaTruncation, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_MAP_KEYS, y as SCHEMA_NESTED_KEYS } from "../tool-schema-json-projection-BIs0pwdB.mjs";
|
|
2
|
+
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-DP6R_sBq.mjs";
|
|
3
|
+
import { _ as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, a as normalizeStrictOpenAIJsonSchema, b as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, c as findOpenAIStrictSchemaViolations, d as normalizeToolParameterSchema, f as resolveUnsupportedToolSchemaKeywords, g as stripUnsupportedSchemaKeywords, i as normalizeOpenAIStrictToolParameters, l as normalizeOpenAIStrictCompatSchema, n as findOpenAIStrictToolProjectionDiagnostics, o as resolveOpenAIProjectedToolsStrictToolFlag, p as shouldOmitEmptyArrayItems, r as isStrictOpenAIJsonSchemaCompatible, s as findCompatClosedObjectPaths, t as prepareOpenAIFunctionTool, u as extractToolSchemaModelCompat, v as cleanSchemaForLlamacppGbnf, x as cleanSchemaForGemini, y as findLlamacppGbnfSchemaViolations } from "../openai-function-tool-8ION6Su5.mjs";
|
|
4
4
|
export { GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, MAX_TOOL_SCHEMA_DEPTH, SCHEMA_MAP_KEYS, SCHEMA_NESTED_KEYS, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, extractToolSchemaModelCompat, findCompatClosedObjectPaths, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, getPublishedRuntimeToolInputSchema, inheritToolSchemaTruncation, isStrictOpenAIJsonSchemaCompatible, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, prepareAnthropicInputSchema, prepareOpenAIFunctionTool, projectRuntimeToolInputSchema, publishRuntimeToolInputSchema, reportToolSchemaTruncation, resolveOpenAIProjectedToolsStrictToolFlag, resolveUnsupportedToolSchemaKeywords, shouldOmitEmptyArrayItems, stripUnsupportedSchemaKeywords, toolSchemaChildPosition, truncateToolSchemaDepth, wasToolSchemaTruncated };
|
|
@@ -2,17 +2,17 @@ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
|
2
2
|
import "./src-CQ7nH2mL.mjs";
|
|
3
3
|
import { t as omitNullRequestHeaders } from "./request-headers-DO4Mqhw1.mjs";
|
|
4
4
|
import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
5
|
-
import { I as isImageWithMediaPayload, M as clampThinkingLevel, j as calculateCost, r as getAiTransportHost } from "./host-
|
|
5
|
+
import { I as isImageWithMediaPayload, M as clampThinkingLevel, j as calculateCost, r as getAiTransportHost } from "./host-BVynqwGC.mjs";
|
|
6
6
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
7
7
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-w-ICeyOI.mjs";
|
|
8
|
-
import { C as stripSystemPromptCacheBoundary, a as describeToolResultMediaPlaceholder, c as extractToolResultText, l as formatToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
9
|
-
import {
|
|
10
|
-
import { t as getPublishedRuntimeToolInputSchema } from "./tool-schema-json-projection-
|
|
8
|
+
import { C as stripSystemPromptCacheBoundary, a as describeToolResultMediaPlaceholder, c as extractToolResultText, l as formatToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-M4Ngy-Ej.mjs";
|
|
9
|
+
import { O as shortHash, d as finalizeTransportStream, g as notifyProviderHttpResponse, j as parseStreamingJson, k as createToolArgumentPreviewSchedule, m as mergeTransportHeaders, n as assignTransportErrorDetails, u as finalizeTerminalToolCallArguments } from "./transport-stream-shared-CBr4U0TY.mjs";
|
|
10
|
+
import { t as getPublishedRuntimeToolInputSchema } from "./tool-schema-json-projection-BIs0pwdB.mjs";
|
|
11
11
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-DzaHoRAU.mjs";
|
|
12
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
13
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
12
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-C99cDpZV.mjs";
|
|
13
|
+
import { t as createAssistantOutput } from "./assistant-output-ByrQmF0P.mjs";
|
|
14
14
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
15
|
-
import { t as mapOpenAIStopReason } from "./openai-stop-reason-
|
|
15
|
+
import { t as mapOpenAIStopReason } from "./openai-stop-reason-CpYv2sZh.mjs";
|
|
16
16
|
import { t as requireApiKey } from "./required-api-key-2zZTkmsi.mjs";
|
|
17
17
|
import { randomUUID } from "node:crypto";
|
|
18
18
|
import * as z$1 from "zod/v4";
|
|
@@ -2433,7 +2433,7 @@ let telemetryModule;
|
|
|
2433
2433
|
async function getObservabilityModule() {
|
|
2434
2434
|
if (observabilityModule !== void 0) return observabilityModule;
|
|
2435
2435
|
try {
|
|
2436
|
-
observabilityModule = await import("./otel-
|
|
2436
|
+
observabilityModule = await import("./otel-Cmspirtq.mjs");
|
|
2437
2437
|
} catch {
|
|
2438
2438
|
observabilityModule = null;
|
|
2439
2439
|
}
|
|
@@ -2442,7 +2442,7 @@ async function getObservabilityModule() {
|
|
|
2442
2442
|
async function getTelemetryModule() {
|
|
2443
2443
|
if (telemetryModule !== void 0) return telemetryModule;
|
|
2444
2444
|
try {
|
|
2445
|
-
telemetryModule = await import("./telemetry-
|
|
2445
|
+
telemetryModule = await import("./telemetry-X9oIHyf3.mjs");
|
|
2446
2446
|
} catch {
|
|
2447
2447
|
telemetryModule = null;
|
|
2448
2448
|
}
|
package/dist/{openai-chatgpt-responses-BinD_u6y.mjs → openai-chatgpt-responses-Dzj5zqW6.mjs}
RENAMED
|
@@ -4,22 +4,22 @@ import { t as omitNullRequestHeaders } from "./request-headers-DO4Mqhw1.mjs";
|
|
|
4
4
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
5
5
|
import { o as isRecord } from "./record-coerce-BQaoiN3r.mjs";
|
|
6
6
|
import { i as clampPositiveTimerTimeoutMs } from "./number-coercion-C7HsBgUL.mjs";
|
|
7
|
-
import { a as resolveAiTransportHeaderSentinels, k as headersToRecord, r as getAiTransportHost } from "./host-
|
|
8
|
-
import { N as supportsOpenAITemperature, v as responsesPromptObserver } from "./openai-responses-contracts-
|
|
7
|
+
import { a as resolveAiTransportHeaderSentinels, k as headersToRecord, r as getAiTransportHost } from "./host-BVynqwGC.mjs";
|
|
8
|
+
import { N as supportsOpenAITemperature, v as responsesPromptObserver } from "./openai-responses-contracts-YlVzpuW_.mjs";
|
|
9
9
|
import { r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
10
10
|
import "./src-BUsVkrNt.mjs";
|
|
11
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
11
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-CZSWH8rC.mjs";
|
|
12
12
|
import { S as toErrorObject, s as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, x as extractErrorCodeOrErrno } from "./diagnostics-CloVGQiK.mjs";
|
|
13
|
-
import { a as streamFragmentError, s as consumeResponseBytes, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
13
|
+
import { a as streamFragmentError, s as consumeResponseBytes, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DSJQf0i_.mjs";
|
|
14
14
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
15
|
-
import { u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-
|
|
16
|
-
import { n as buildManagedModelFetch } from "./host-policy-
|
|
17
|
-
import { n as buildBaseOptions, y as prepareSystemPrompt } from "./simple-options-
|
|
18
|
-
import {
|
|
19
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
20
|
-
import { At as createOpenAIResponseHook, Ct as buildOpenAIResponsesReasoningReplayMetadata, Dt as suppressOpenAIResponsesCompaction, H as resolveOpenAISimpleReasoningEffort, T as recordResponsesContextUsage, V as resolveOpenAIRequestReasoning, dt as resolveNextResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, it as commitResponsesEncryptedContentAttempt, jt as createResponseModelTracker, kt as createOpenAIProviderAcceptanceHook, mt as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, s as processResponsesStream, st as isInvalidEncryptedContentError, x as ResponsesStreamFailure } from "./openai-responses-shared-
|
|
15
|
+
import { u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-CDNGOoQn.mjs";
|
|
16
|
+
import { n as buildManagedModelFetch } from "./host-policy-C1VDPJqb.mjs";
|
|
17
|
+
import { n as buildBaseOptions, y as prepareSystemPrompt } from "./simple-options-M4Ngy-Ej.mjs";
|
|
18
|
+
import { S as transportAbortError, _ as notifyProviderStreamOpened, m as mergeTransportHeaders, n as assignTransportErrorDetails, w as withProviderResponseHook } from "./transport-stream-shared-CBr4U0TY.mjs";
|
|
19
|
+
import { t as createAssistantOutput } from "./assistant-output-ByrQmF0P.mjs";
|
|
20
|
+
import { At as createOpenAIResponseHook, Ct as buildOpenAIResponsesReasoningReplayMetadata, Dt as suppressOpenAIResponsesCompaction, H as resolveOpenAISimpleReasoningEffort, T as recordResponsesContextUsage, V as resolveOpenAIRequestReasoning, dt as resolveNextResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, it as commitResponsesEncryptedContentAttempt, jt as createResponseModelTracker, kt as createOpenAIProviderAcceptanceHook, mt as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, s as processResponsesStream, st as isInvalidEncryptedContentError, x as ResponsesStreamFailure } from "./openai-responses-shared-CNBWb5iO.mjs";
|
|
21
21
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B7RcufAV.mjs";
|
|
22
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, s as copyResponsesCompactRequest, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
22
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, s as copyResponsesCompactRequest, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-BRnD7G5s.mjs";
|
|
23
23
|
import { t as requireApiKey } from "./required-api-key-2zZTkmsi.mjs";
|
|
24
24
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
25
25
|
//#region packages/ai/src/providers/openai-chatgpt-request-headers.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { M as clampThinkingLevel } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { l as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-
|
|
2
|
+
import { M as clampThinkingLevel } from "./host-BVynqwGC.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-M4Ngy-Ej.mjs";
|
|
4
|
+
import { l as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-DKSeBBXY.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-2zZTkmsi.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-completions-compat-CEj778te.d.mts → openai-completions-compat-C26ajk4r.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-
|
|
1
|
+
import { I as OpenAICompletionsCompat, j as Model } from "./types-B6vvn8is.mjs";
|
|
2
|
+
import "./index-DqIreoGH.mjs";
|
|
3
|
+
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-bx8W0SER.mjs";
|
|
4
4
|
//#region packages/ai/src/transports/openai-completions-compat.d.ts
|
|
5
5
|
type OpenAICompletionsSessionAffinity = "none" | "openai" | "openrouter";
|
|
6
6
|
type OpenAICompletionsCompatDefaults = {
|
package/dist/{openai-completions-compat-CmyT3piu.mjs → openai-completions-compat-CDNGOoQn.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-BQaoiN3r.mjs";
|
|
2
2
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-BCuWMIrk.mjs";
|
|
3
|
-
import { A as resolveOpenAIReasoningEffortMapping, M as supportsOpenAIReasoningEffort } from "./openai-responses-contracts-
|
|
4
|
-
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-
|
|
3
|
+
import { A as resolveOpenAIReasoningEffortMapping, M as supportsOpenAIReasoningEffort } from "./openai-responses-contracts-YlVzpuW_.mjs";
|
|
4
|
+
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-C1VDPJqb.mjs";
|
|
5
5
|
//#region packages/model-catalog-core/src/provider-model-id-normalize.ts
|
|
6
6
|
function normalizeOpenRouterModelFamilyId(modelId) {
|
|
7
7
|
if (typeof modelId !== "string") return;
|
package/dist/{openai-completions-transport-BGoKrb3z.mjs → openai-completions-transport-DKSeBBXY.mjs}
RENAMED
|
@@ -4,43 +4,43 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
4
4
|
import { i as asOptionalRecord, o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-BQaoiN3r.mjs";
|
|
5
5
|
import { c as readNonEmptyStringPreservingWhitespace, t as hasNonEmptyString } from "./string-coerce-BCuWMIrk.mjs";
|
|
6
6
|
import { n as asNonNegativeFiniteNumber, r as asPositiveFiniteNumber } from "./number-coercion-C7HsBgUL.mjs";
|
|
7
|
-
import { I as isImageWithMediaPayload, j as calculateCost, r as getAiTransportHost } from "./host-
|
|
8
|
-
import { E as isOpenAIGpt6Model, N as supportsOpenAITemperature, R as resolveOpenAIThinkingApi, S as applyOpenAICompletionsToolReasoning, b as isResponsesServiceTierRejection, d as OpenAIResponsesWebSocketPreDispatchError, f as OpenAIResponsesWebSocketSafeRetryError, l as OPENAI_RESPONSES_TOOL_CALL_PROVIDERS, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS, t as AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS, u as OpenAIResponsesWebSocketPostDispatchError, x as nextResponsesServiceTier, y as responsesServiceTierObserver } from "./openai-responses-contracts-
|
|
7
|
+
import { I as isImageWithMediaPayload, j as calculateCost, r as getAiTransportHost } from "./host-BVynqwGC.mjs";
|
|
8
|
+
import { E as isOpenAIGpt6Model, N as supportsOpenAITemperature, R as resolveOpenAIThinkingApi, S as applyOpenAICompletionsToolReasoning, b as isResponsesServiceTierRejection, d as OpenAIResponsesWebSocketPreDispatchError, f as OpenAIResponsesWebSocketSafeRetryError, l as OPENAI_RESPONSES_TOOL_CALL_PROVIDERS, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS, t as AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS, u as OpenAIResponsesWebSocketPostDispatchError, x as nextResponsesServiceTier, y as responsesServiceTierObserver } from "./openai-responses-contracts-YlVzpuW_.mjs";
|
|
9
9
|
import { c as truncateUtf16Safe } from "./provider-error-DD-fo4Rz.mjs";
|
|
10
10
|
import { t as estimateStringChars } from "./src-BUsVkrNt.mjs";
|
|
11
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
11
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-CZSWH8rC.mjs";
|
|
12
12
|
import { g as applyResponsesCacheWritePricing, p as hasOnlyResponsesFunctionTools, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, u as DegenerateToolCallArgumentsError, v as mapResponsesTerminalUsage, y as readResponsesReasoningTokens } from "./diagnostics-CloVGQiK.mjs";
|
|
13
|
-
import { o as supportsModelTools } from "./transport-utils-
|
|
13
|
+
import { o as supportsModelTools } from "./transport-utils-DSJQf0i_.mjs";
|
|
14
14
|
import { t as stableStringify } from "./stable-stringify-CchQEmeA.mjs";
|
|
15
15
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
16
|
-
import { a as resolveOpenAICompletionsCompat, c as isAzureOpenAICompatibleHost, d as shouldOmitOllamaCompatResponseFormat, i as isOpenAICodexResponsesModel, l as resolveOpenAICompletionsResponseFormat, n as isKnownOpenAIEndpoint, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as detectOpenAICompletionsCompat, u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-
|
|
17
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
16
|
+
import { a as resolveOpenAICompletionsCompat, c as isAzureOpenAICompatibleHost, d as shouldOmitOllamaCompatResponseFormat, i as isOpenAICodexResponsesModel, l as resolveOpenAICompletionsResponseFormat, n as isKnownOpenAIEndpoint, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as detectOpenAICompletionsCompat, u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-CDNGOoQn.mjs";
|
|
17
|
+
import { t as buildGuardedModelFetch } from "./host-policy-C1VDPJqb.mjs";
|
|
18
18
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-BJ2_Xabx.mjs";
|
|
19
19
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
20
20
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-w-ICeyOI.mjs";
|
|
21
|
-
import { C as stripSystemPromptCacheBoundary, S as splitSystemPromptRelocatableBoundary, a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as measuredRequestPressure, f as preparedRequestSuffix, p as reasoningTagTextPolicy, r as clampMaxTokensToModel, u as codeModeToolSurfaceObserver, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as prepareSystemPrompt } from "./simple-options-
|
|
22
|
-
import {
|
|
23
|
-
import { S as redactIdentifier } from "./tool-schema-json-projection-
|
|
21
|
+
import { C as stripSystemPromptCacheBoundary, S as splitSystemPromptRelocatableBoundary, a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as measuredRequestPressure, f as preparedRequestSuffix, p as reasoningTagTextPolicy, r as clampMaxTokensToModel, u as codeModeToolSurfaceObserver, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as prepareSystemPrompt } from "./simple-options-M4Ngy-Ej.mjs";
|
|
22
|
+
import { O as shortHash, S as transportAbortError, _ as notifyProviderStreamOpened, d as finalizeTransportStream, f as iterateModelStream, j as parseStreamingJson, k as createToolArgumentPreviewSchedule, l as failTransportStream, r as awaitProviderLifecycleCallback, s as createWritableTransportEventStream, u as finalizeTerminalToolCallArguments, w as withProviderResponseHook, x as throwIfModelStreamAborted } from "./transport-stream-shared-CBr4U0TY.mjs";
|
|
23
|
+
import { S as redactIdentifier } from "./tool-schema-json-projection-BIs0pwdB.mjs";
|
|
24
24
|
import { n as getEnvApiKey } from "./env-api-keys-BuHc86ya.mjs";
|
|
25
25
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-DzaHoRAU.mjs";
|
|
26
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
27
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
26
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-CeMMMu55.mjs";
|
|
27
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-C99cDpZV.mjs";
|
|
28
28
|
import { prepareModelRequestBody } from "./internal/model-request-body.mjs";
|
|
29
29
|
import { PROVIDER_MODEL_INPUT, resolveProviderContext } from "./provider-types.mjs";
|
|
30
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
30
|
+
import { t as createAssistantOutput } from "./assistant-output-ByrQmF0P.mjs";
|
|
31
31
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
32
32
|
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
33
33
|
import "./types.mjs";
|
|
34
|
-
import { A as responsesContinuationPrefixFingerprint, B as supportsResponsesReasoningUpdate, Bt as resolvePromptCacheKey, C as safeDebugValue, Ct as buildOpenAIResponsesReasoningReplayMetadata, D as claimOpenAIResponsesHttpContinuation, Dt as suppressOpenAIResponsesCompaction, Ft as measureUtf8AppendBytes, G as reconcileOpenAICompletionsToolChoice, H as resolveOpenAISimpleReasoningEffort, It as parseOpenAICompletionsUsage, J as assertCodeModeResponsesToolSurface, K as reconcileOpenAIResponsesToolChoice, Lt as readOpenAICompletionsContentDeltas, Mt as detachPartialSnapshot, Nt as isOpenAICompletionsThinkingEnabled, Ot as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, Pt as log, Q as enforceCodeModeResponsesToolSurface, R as isConfigurationUpdate, Rt as readOpenAICompletionsReasoningBatch, S as observeResponsesTransportFailure, T as recordResponsesContextUsage, U as prepareOpenAITools, V as resolveOpenAIRequestReasoning, Vt as withOpenAIErrorResponseHook, W as projectOpenAITools, X as buildOpenAISdkClientOptions, Y as buildOpenAIClientHeaders, Z as buildOpenAISdkRequestOptions, a as prepareResponsesTools, at as createResponsesItemConflictRecovery, bt as recordResponsesInputReplay, c as observeResponsesStream, ct as isResponsesItemConflict, dt as resolveNextResponsesEncryptedContentAttempt, et as getCompat, ht as convertResponsesMessages, j as responsesContinuationRequestFingerprint, jt as createResponseModelTracker, kt as createOpenAIProviderAcceptanceHook, lt as readResponsesRecoveryEvent, n as applyResponsesServiceTierPricing, nt as resolveCodeModeResponsesVisibleToolNames, ot as createResponsesStreamWithRecovery, pt as buildResponsesInputMessage, q as toOpenAIResponsesToolChoice, rt as resolveOpenAIStrictToolFlagWithDiagnostics, s as processResponsesStream, st as isInvalidEncryptedContentError, w as summarizeResponsesPayload, yt as readResponsesInputReplayState, z as replayResponsesReasoningUpdates, zt as resolveOpenAIClientBaseUrl } from "./openai-responses-shared-
|
|
34
|
+
import { A as responsesContinuationPrefixFingerprint, B as supportsResponsesReasoningUpdate, Bt as resolvePromptCacheKey, C as safeDebugValue, Ct as buildOpenAIResponsesReasoningReplayMetadata, D as claimOpenAIResponsesHttpContinuation, Dt as suppressOpenAIResponsesCompaction, Ft as measureUtf8AppendBytes, G as reconcileOpenAICompletionsToolChoice, H as resolveOpenAISimpleReasoningEffort, It as parseOpenAICompletionsUsage, J as assertCodeModeResponsesToolSurface, K as reconcileOpenAIResponsesToolChoice, Lt as readOpenAICompletionsContentDeltas, Mt as detachPartialSnapshot, Nt as isOpenAICompletionsThinkingEnabled, Ot as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, Pt as log, Q as enforceCodeModeResponsesToolSurface, R as isConfigurationUpdate, Rt as readOpenAICompletionsReasoningBatch, S as observeResponsesTransportFailure, T as recordResponsesContextUsage, U as prepareOpenAITools, V as resolveOpenAIRequestReasoning, Vt as withOpenAIErrorResponseHook, W as projectOpenAITools, X as buildOpenAISdkClientOptions, Y as buildOpenAIClientHeaders, Z as buildOpenAISdkRequestOptions, a as prepareResponsesTools, at as createResponsesItemConflictRecovery, bt as recordResponsesInputReplay, c as observeResponsesStream, ct as isResponsesItemConflict, dt as resolveNextResponsesEncryptedContentAttempt, et as getCompat, ht as convertResponsesMessages, j as responsesContinuationRequestFingerprint, jt as createResponseModelTracker, kt as createOpenAIProviderAcceptanceHook, lt as readResponsesRecoveryEvent, n as applyResponsesServiceTierPricing, nt as resolveCodeModeResponsesVisibleToolNames, ot as createResponsesStreamWithRecovery, pt as buildResponsesInputMessage, q as toOpenAIResponsesToolChoice, rt as resolveOpenAIStrictToolFlagWithDiagnostics, s as processResponsesStream, st as isInvalidEncryptedContentError, w as summarizeResponsesPayload, yt as readResponsesInputReplayState, z as replayResponsesReasoningUpdates, zt as resolveOpenAIClientBaseUrl } from "./openai-responses-shared-CNBWb5iO.mjs";
|
|
35
35
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
36
|
-
import { a as isOpenAIResponsesCompactionOutput, c as sanitizeResponsesImagePayload, i as getOpenAIResponsesCompactionOutputError, l as applyOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, p as resolveOpenAIResponsesPayloadPolicy, r as createBoundedOpenAIResponsesCompactionFetch, u as enforceOpenAIResponsesCompactionReplayStorage } from "./openai-responses-endpoint-
|
|
37
|
-
import { h as withPreparedToolSchemaNormalization, i as normalizeOpenAIStrictToolParameters, m as normalizeToolSchema, t as prepareOpenAIFunctionTool } from "./openai-function-tool-
|
|
38
|
-
import { a as createOpenAIProviderClient, i as createAzureOpenAIClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
36
|
+
import { a as isOpenAIResponsesCompactionOutput, c as sanitizeResponsesImagePayload, i as getOpenAIResponsesCompactionOutputError, l as applyOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, p as resolveOpenAIResponsesPayloadPolicy, r as createBoundedOpenAIResponsesCompactionFetch, u as enforceOpenAIResponsesCompactionReplayStorage } from "./openai-responses-endpoint-D8fhfY4d.mjs";
|
|
37
|
+
import { h as withPreparedToolSchemaNormalization, i as normalizeOpenAIStrictToolParameters, m as normalizeToolSchema, t as prepareOpenAIFunctionTool } from "./openai-function-tool-8ION6Su5.mjs";
|
|
38
|
+
import { a as createOpenAIProviderClient, i as createAzureOpenAIClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-DIis-pzH.mjs";
|
|
39
|
+
import { t as mapOpenAIStopReason } from "./openai-stop-reason-CpYv2sZh.mjs";
|
|
39
40
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B7RcufAV.mjs";
|
|
40
41
|
import { t as requiresReasoningContentReplay } from "./openai-completions-reasoning-replay-BwT1xwRI.mjs";
|
|
41
|
-
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
42
42
|
import { n as resolveAzureDeploymentNameFromMap } from "./azure-deployment-map-DKJ8Xc4c.mjs";
|
|
43
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
43
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-BRnD7G5s.mjs";
|
|
44
44
|
import { randomUUID } from "node:crypto";
|
|
45
45
|
import { isDeepStrictEqual } from "node:util";
|
|
46
46
|
import OpenAI from "openai";
|
|
@@ -721,9 +721,9 @@ function hasGoogleCompatThoughtSignatureTruncationFootprint(value) {
|
|
|
721
721
|
return GOOGLE_COMPAT_THOUGHT_SIGNATURE_ELLIPSIS_RE.test(value) || GOOGLE_COMPAT_THOUGHT_SIGNATURE_BASE64_RE.test(value) && value.length % 4 !== 0;
|
|
722
722
|
}
|
|
723
723
|
function injectToolCallThoughtSignatures(outgoingMessages, context, model) {
|
|
724
|
-
|
|
724
|
+
const google = isGoogleOpenAICompatModel(model);
|
|
725
725
|
const sigById = /* @__PURE__ */ new Map();
|
|
726
|
-
const fallbackSig = isGoogleGemini3ThinkingLevelModel(model.id) ? GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP : void 0;
|
|
726
|
+
const fallbackSig = google && isGoogleGemini3ThinkingLevelModel(model.id) ? GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP : void 0;
|
|
727
727
|
for (const msg of context.messages ?? []) {
|
|
728
728
|
if (msg.role !== "assistant") continue;
|
|
729
729
|
if (!Array.isArray(msg.content)) continue;
|
|
@@ -733,7 +733,7 @@ function injectToolCallThoughtSignatures(outgoingMessages, context, model) {
|
|
|
733
733
|
const sig = block.thoughtSignature;
|
|
734
734
|
if (typeof id === "string" && typeof sig === "string" && sig.length > 0) {
|
|
735
735
|
const isSameRoute = msg.api === model.api && msg.provider === model.provider && msg.model === model.id;
|
|
736
|
-
if (!isSameRoute && !fallbackSig) continue;
|
|
736
|
+
if (!isSameRoute && !fallbackSig || !google && sig.trimStart().startsWith("{")) continue;
|
|
737
737
|
sigById.set(id, isSameRoute ? sig : fallbackSig ?? sig);
|
|
738
738
|
}
|
|
739
739
|
}
|
|
@@ -748,7 +748,7 @@ function injectToolCallThoughtSignatures(outgoingMessages, context, model) {
|
|
|
748
748
|
if (hasGoogleCompatThoughtSignatureTruncationFootprint(sig.trim())) sig = fallbackSig;
|
|
749
749
|
}
|
|
750
750
|
if (!sig) continue;
|
|
751
|
-
Object.assign(toolCall, { extra_content: { google: { thought_signature: sig } } });
|
|
751
|
+
Object.assign(toolCall, google ? { extra_content: { google: { thought_signature: sig } } } : { provider_specific_fields: { thought_signature: sig } });
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
}
|
|
@@ -940,8 +940,8 @@ function buildOpenAICompletionsRequest(model, context, options, policy) {
|
|
|
940
940
|
if (params.stream && compat.supportsUsageInStreaming) params.stream_options = { include_usage: true };
|
|
941
941
|
if (compat.supportsStore) params.store = false;
|
|
942
942
|
if (policy.mode === "direct" || compat.supportsPromptCacheKey && promptCacheKey) params.prompt_cache_key = compat.supportsPromptCacheKey ? promptCacheKey : void 0;
|
|
943
|
-
if (options?.temperature !== void 0) params.temperature = options.temperature;
|
|
944
|
-
if (policy.mode === "managed" && options?.topP !== void 0) params.top_p = options.topP;
|
|
943
|
+
if (options?.temperature !== void 0 && supportsOpenAITemperature(model)) params.temperature = options.temperature;
|
|
944
|
+
if (policy.mode === "managed" && options?.topP !== void 0 && !isOpenAIGpt6Model(model)) params.top_p = options.topP;
|
|
945
945
|
const requestedResponseFormat = options?.responseFormat;
|
|
946
946
|
const responseFormat = policy.mode === "direct" && requestedResponseFormat === void 0 ? void 0 : resolveOpenAICompletionsResponseFormat(shouldOmitOllamaCompatResponseFormat({
|
|
947
947
|
provider: model.provider,
|
|
@@ -1418,7 +1418,7 @@ function extractToolCallThoughtSignature(toolCall) {
|
|
|
1418
1418
|
const tc = toolCall;
|
|
1419
1419
|
if (!tc) return;
|
|
1420
1420
|
const extra = tc.extra_content?.google;
|
|
1421
|
-
return readNonEmptyStringPreservingWhitespace(extra?.thought_signature) ?? readNonEmptyStringPreservingWhitespace(tc.function?.thought_signature) ?? readNonEmptyStringPreservingWhitespace(tc.thought_signature);
|
|
1421
|
+
return readNonEmptyStringPreservingWhitespace(extra?.thought_signature) ?? readNonEmptyStringPreservingWhitespace(tc.function?.thought_signature) ?? readNonEmptyStringPreservingWhitespace(tc.thought_signature) ?? readNonEmptyStringPreservingWhitespace(asOptionalRecord(tc.provider_specific_fields)?.thought_signature);
|
|
1422
1422
|
}
|
|
1423
1423
|
async function* observeOpenAICompletionsProgress(responseStream, signal) {
|
|
1424
1424
|
const maxUsageTokens = {
|
|
@@ -2474,7 +2474,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
2474
2474
|
if (websocketMode) {
|
|
2475
2475
|
requestSignal = websocketSignal;
|
|
2476
2476
|
try {
|
|
2477
|
-
const { createOpenAIResponsesWebSocketStream } = await import("./openai-responses-websocket-
|
|
2477
|
+
const { createOpenAIResponsesWebSocketStream } = await import("./openai-responses-websocket-BbTCvD64.mjs");
|
|
2478
2478
|
if (websocketSignal.aborted) throw transportAbortError(websocketSignal);
|
|
2479
2479
|
const websocket = createOpenAIResponsesWebSocketStream({
|
|
2480
2480
|
client,
|
|
@@ -2857,7 +2857,7 @@ function streamOpenAICompletionsRequest(model, context, options, mode) {
|
|
|
2857
2857
|
const builtParams = buildOpenAICompletionsRequest(model, requestContext, options, policy);
|
|
2858
2858
|
let params = builtParams;
|
|
2859
2859
|
const encodeBody = prepareModelRequestBody(options);
|
|
2860
|
-
const nextParams = await options?.onPayload?.(params, model);
|
|
2860
|
+
const nextParams = await awaitProviderLifecycleCallback(options?.onPayload ? () => options.onPayload?.(params, model) : void 0, options?.signal);
|
|
2861
2861
|
if (nextParams !== void 0) params = nextParams;
|
|
2862
2862
|
if (mode === "managed") {
|
|
2863
2863
|
if (options?.openclawCodeModeToolSurface === true) {
|
|
@@ -2939,7 +2939,7 @@ function streamOpenAICompletionsRequest(model, context, options, mode) {
|
|
|
2939
2939
|
chunks.push(chunk);
|
|
2940
2940
|
bufferedBytes += chunkBytes;
|
|
2941
2941
|
const chunkFinishReason = chunk?.choices?.[0]?.finish_reason;
|
|
2942
|
-
if (chunkFinishReason) finishReason = chunkFinishReason;
|
|
2942
|
+
if (chunkFinishReason) finishReason = mapOpenAIStopReason(chunkFinishReason).stopReason;
|
|
2943
2943
|
options?.signal?.throwIfAborted();
|
|
2944
2944
|
}
|
|
2945
2945
|
} catch (error) {
|
|
@@ -2,7 +2,7 @@ import { o as isRecord, s as isStringArray } from "./record-coerce-BQaoiN3r.mjs"
|
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-DGXqfvkj.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-BCuWMIrk.mjs";
|
|
4
4
|
import { i as uniqueValues, n as normalizeStringEntries, t as filterStringEntries } from "./string-normalization-B8TDDBX_.mjs";
|
|
5
|
-
import { _ as SCHEMA_ARRAY_KEYS, a as SCHEMA_LITERAL_KEYS, b as SCHEMA_OBJECT_KEYS, c as extendSchemaDefs, f as inheritToolSchemaTruncation, g as wasToolSchemaTruncated, h as truncateToolSchemaDepth, i as publishRuntimeToolInputSchema, l as inlineLocalToolSchemaRefs, o as canPreserveRootSchemaRefs, p as reportToolSchemaTruncation, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, u as setOwnSchemaProperty, v as SCHEMA_MAP_KEYS, x as walkSchemaValue, y as SCHEMA_NESTED_KEYS } from "./tool-schema-json-projection-
|
|
5
|
+
import { _ as SCHEMA_ARRAY_KEYS, a as SCHEMA_LITERAL_KEYS, b as SCHEMA_OBJECT_KEYS, c as extendSchemaDefs, f as inheritToolSchemaTruncation, g as wasToolSchemaTruncated, h as truncateToolSchemaDepth, i as publishRuntimeToolInputSchema, l as inlineLocalToolSchemaRefs, o as canPreserveRootSchemaRefs, p as reportToolSchemaTruncation, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, u as setOwnSchemaProperty, v as SCHEMA_MAP_KEYS, x as walkSchemaValue, y as SCHEMA_NESTED_KEYS } from "./tool-schema-json-projection-BIs0pwdB.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/clean-for-gemini.ts
|
|
7
7
|
const GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
8
8
|
"~optional",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { r as isNativeOpenAIEndpoint } from "./openai-completions-compat-CDNGOoQn.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 {
|
|
2
|
-
import "./types-
|
|
1
|
+
import { I as OpenAICompletionsCompat, j as Model, st as StreamOptions, u as CacheRetention } from "./types-B6vvn8is.mjs";
|
|
2
|
+
import "./types-a4Eg5L2z.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">>, promptCacheTtl?: StreamOptions["promptCacheTtl"]): {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
4
|
-
import { a as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-CZSWH8rC.mjs";
|
|
4
|
+
import { a as resolveOpenAICompletionsCompat } from "./openai-completions-compat-CDNGOoQn.mjs";
|
|
5
5
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-BJ2_Xabx.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-M4Ngy-Ej.mjs";
|
|
7
7
|
import { n as getEnvApiKey } from "./env-api-keys-BuHc86ya.mjs";
|
|
8
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
9
|
-
import { H as resolveOpenAISimpleReasoningEffort, mt as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
10
|
-
import { a as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
8
|
+
import { t as createAssistantOutput } from "./assistant-output-ByrQmF0P.mjs";
|
|
9
|
+
import { H as resolveOpenAISimpleReasoningEffort, mt as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-CNBWb5iO.mjs";
|
|
10
|
+
import { a as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-DIis-pzH.mjs";
|
|
11
11
|
import { t as requireApiKey } from "./required-api-key-2zZTkmsi.mjs";
|
|
12
12
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
13
13
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import "./provider-options-
|
|
4
|
-
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-
|
|
1
|
+
import { G as ProviderReplayState, j as Model, o as AssistantMessage } from "./types-B6vvn8is.mjs";
|
|
2
|
+
import "./index-DqIreoGH.mjs";
|
|
3
|
+
import "./provider-options-2vKAAn7G.mjs";
|
|
4
|
+
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-D6OypGUv.mjs";
|
|
5
5
|
import "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/transports/openai-responses-compaction-replay.d.ts
|
|
7
7
|
declare function readOpenAIResponsesItemRecoveryAnchor(replay: ProviderReplayState | undefined): string | undefined;
|
package/dist/{openai-responses-contracts-D-saZnr_.d.mts → openai-responses-contracts-D6OypGUv.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import "./types-
|
|
4
|
-
import { a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort } from "./provider-options-
|
|
1
|
+
import { F as ModelThinkingLevel, j as Model, n as Api } from "./types-B6vvn8is.mjs";
|
|
2
|
+
import "./index-DqIreoGH.mjs";
|
|
3
|
+
import "./types-a4Eg5L2z.mjs";
|
|
4
|
+
import { a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort } from "./provider-options-2vKAAn7G.mjs";
|
|
5
5
|
import { Response, ResponseCompactionItem, ResponseCreateParamsStreaming, ResponseInputItem, ResponseOutputMessage, ResponseReasoningItem } from "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/providers/openai-request-reasoning.d.ts
|
|
7
7
|
type OpenAIRequestReasoningEffort = ModelThinkingLevel | "none";
|
package/dist/{openai-responses-contracts-BpyK1Ygq.mjs → openai-responses-contracts-YlVzpuW_.mjs}
RENAMED
|
@@ -162,7 +162,7 @@ const CANONICAL_REASONING_EFFORTS = /* @__PURE__ */ new Set([
|
|
|
162
162
|
"off"
|
|
163
163
|
]);
|
|
164
164
|
function normalizeModelId(id) {
|
|
165
|
-
return normalizeLowercaseStringOrEmpty(id ?? "").replace(/-\d{4}-\d{2}-\d{2}$/u, "");
|
|
165
|
+
return normalizeLowercaseStringOrEmpty(id ?? "").replace(/^openai\//u, "").replace(/-\d{4}-\d{2}-\d{2}$/u, "");
|
|
166
166
|
}
|
|
167
167
|
/** Return whether a model is the GPT-5.4 mini family. */
|
|
168
168
|
function isOpenAIGpt54MiniModel(model) {
|