@openclaw/ai 2026.10.1-beta.2 → 2026.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-CZv6XFER.mjs → anthropic-BDfXKgF1.mjs} +8 -8
- package/dist/{anthropic-payload-policy-BhCcgNdm.d.mts → anthropic-payload-policy-BZUAchqb.d.mts} +2 -2
- package/dist/{anthropic-stream-reducer-BQ1tjd7x.mjs → anthropic-stream-reducer-DHt9uFWX.mjs} +11 -11
- package/dist/{api-registry-DpU0Rj-I.d.mts → api-registry-DcEP_o4h.d.mts} +1 -1
- package/dist/{assistant-output-OLm-Oln0.mjs → assistant-output-mJ9cL4Qg.mjs} +2 -2
- package/dist/{assistant-text-phase-Bl1aDCB7.mjs → assistant-text-phase-DAv1BdTm.mjs} +1 -1
- package/dist/{azure-openai-responses-DH7bd3QT.mjs → azure-openai-responses-gn9hMf8x.mjs} +5 -5
- package/dist/diagnostics.d.mts +3 -3
- package/dist/env-api-keys-BR0MUYYD.d.mts +17 -0
- package/dist/{google-1WLOtb8w.mjs → google-CyMz2jF_.mjs} +6 -6
- package/dist/{google-interactions-wrnE6MLw.mjs → google-interactions-DXu4IYGb.mjs} +6 -6
- package/dist/{google-messages-BwPPycw6.mjs → google-messages-Bmheetdg.mjs} +3 -3
- package/dist/{google-shared-Eql1OMPU.mjs → google-shared-DE_ddfsC.mjs} +5 -5
- package/dist/{google-vertex-0LrlRoO3.mjs → google-vertex-BEW0OQIA.mjs} +5 -5
- package/dist/{host-BinBeGcQ.d.mts → host-BjIYEjwT.d.mts} +2 -2
- package/dist/{host-DCW52iHe.mjs → host-JpNulOOs.mjs} +10 -7
- package/dist/{host-policy-B3jc4Rpn.mjs → host-policy-CC5H0iRZ.mjs} +1 -1
- package/dist/{index-a8e_oKnu.d.mts → index-DJrNQnKw.d.mts} +21 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/internal/anthropic.d.mts +5 -5
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/env-api-keys.d.mts +2 -0
- package/dist/internal/env-api-keys.mjs +2 -0
- 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 +8 -8
- package/dist/internal/openai.mjs +7 -7
- package/dist/internal/runtime.d.mts +7 -22
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +1 -1
- package/dist/internal/shared.mjs +3 -3
- package/dist/{mistral-DSt4vQAO.mjs → mistral-1Bnbneg1.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-BC2x0Oqx.mjs → openai-chatgpt-responses-CB1JwNFF.mjs} +22 -21
- package/dist/{openai-completions-DNyHnXKg.mjs → openai-completions-BPadHHKe.mjs} +3 -3
- package/dist/{openai-completions-compat-BYdYpXhU.d.mts → openai-completions-compat-CJ0ktmGy.d.mts} +2 -2
- package/dist/{openai-completions-compat-BdmlhD4u.mjs → openai-completions-compat-D7hWYB0G.mjs} +1 -1
- package/dist/{openai-completions-transport-DWM2mQDB.mjs → openai-completions-transport-DITBEALX.mjs} +121 -18
- package/dist/{openai-prompt-cache-45-AH_xv.d.mts → openai-prompt-cache-C-Q1Ksfs.d.mts} +1 -1
- package/dist/{openai-prompt-cache-I8YQTzf8.mjs → openai-prompt-cache-Dj8qeOHT.mjs} +1 -1
- package/dist/{openai-responses-uZ5oWSp7.mjs → openai-responses-1_TvcWI3.mjs} +7 -7
- package/dist/{openai-responses-compaction-replay-BClApUIf.d.mts → openai-responses-compaction-replay-BB2SWdsx.d.mts} +3 -3
- package/dist/{openai-responses-contracts-Br5IIw_h.d.mts → openai-responses-contracts-sAvdqNjS.d.mts} +3 -3
- package/dist/{openai-responses-prompt-observer-internal-CCg7B6l4.mjs → openai-responses-prompt-observer-internal-CbH84xIS.mjs} +2 -2
- package/dist/{openai-responses-shared-C7oVyjED.mjs → openai-responses-shared-TCJRAoMW.mjs} +9 -9
- package/dist/{openai-responses-terminal-usage-DgImcyJu.d.mts → openai-responses-terminal-usage-BVvyXZ8u.d.mts} +1 -1
- package/dist/{openai-transport-params-JFsnIyto.mjs → openai-transport-params-ildrm49s.mjs} +6 -6
- package/dist/{provider-options-D5ABCV_l.d.mts → provider-options-Dk4PeQV3.d.mts} +1 -1
- package/dist/{provider-replay-context-C7Bmi84a.mjs → provider-replay-context-ywPKKLjL.mjs} +1 -1
- package/dist/{provider-transport-turn-state-_M2kLdUE.mjs → provider-transport-turn-state-8c_Nj2NS.mjs} +2 -2
- package/dist/{provider-types-F8Mqc9Ma.d.mts → provider-types-De8PRdR0.d.mts} +2 -2
- package/dist/provider-types.d.mts +3 -3
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-BkKTXxhp.mjs → simple-options-wW3117Fu.mjs} +2 -2
- package/dist/{src-B0NIt2UK.mjs → src-DWJq14pn.mjs} +17 -7
- package/dist/{stream-DSdzKsDK.mjs → stream-CElngO8h.mjs} +1 -1
- package/dist/{text-signature-MLwfi6fq.mjs → text-signature-rOn31nxc.mjs} +2 -2
- package/dist/{transport-stream-shared-CxXXz_Dd.mjs → transport-stream-shared-C5TAc3U_.mjs} +24 -5
- package/dist/{transport-stream-shared-BcAKh2XH.d.mts → transport-stream-shared-CAxkgOSj.d.mts} +1 -1
- package/dist/transports.d.mts +11 -11
- package/dist/transports.mjs +17 -17
- package/dist/types-Dlz-8qcy.d.mts +1 -0
- package/dist/types.d.mts +3 -3
- package/dist/types.mjs +2 -2
- package/package.json +6 -1
- package/dist/types-BuiEBM3u.d.mts +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../index-
|
|
1
|
+
import "../index-DJrNQnKw.mjs";
|
|
2
2
|
import { $ as StopReason, Q as SimpleStreamOptions, d as Context, k as Model, tt as StreamFunction } from "../types-DvzmWW8J.mjs";
|
|
3
|
-
import { C as supportsOpenAITemperature, S as supportsOpenAIReasoningEffort, _ as normalizeOpenAIReasoningEffort, a as BaseOpenAIStreamOptions, b as resolveOpenAIReasoningEffortMapping, d as OpenAIApiReasoningEffort, f as OpenAIReasoningEffort, g as isOpenAIGpt6Model, h as isOpenAIGpt56Model, l as codeModeToolSurfaceObserver, m as isOpenAIGpt55Model, o as CodeModeToolSurfaceObservation, p as isOpenAIGpt54MiniModel, s as OpenAICompletionsOptions, u as reasoningTagTextPolicy, v as resolveOpenAIModelReasoningEfforts, x as resolveOpenAISupportedReasoningEfforts, y as resolveOpenAIReasoningEffortForModel } from "../provider-options-
|
|
3
|
+
import { C as supportsOpenAITemperature, S as supportsOpenAIReasoningEffort, _ as normalizeOpenAIReasoningEffort, a as BaseOpenAIStreamOptions, b as resolveOpenAIReasoningEffortMapping, d as OpenAIApiReasoningEffort, f as OpenAIReasoningEffort, g as isOpenAIGpt6Model, h as isOpenAIGpt56Model, l as codeModeToolSurfaceObserver, m as isOpenAIGpt55Model, o as CodeModeToolSurfaceObservation, p as isOpenAIGpt54MiniModel, s as OpenAICompletionsOptions, u as reasoningTagTextPolicy, v as resolveOpenAIModelReasoningEfforts, x as resolveOpenAISupportedReasoningEfforts, y as resolveOpenAIReasoningEffortForModel } from "../provider-options-Dk4PeQV3.mjs";
|
|
4
4
|
import { a as reconcileOpenAIResponsesToolChoice, i as reconcileOpenAICompletionsToolChoice, n as OpenAIToolProjection, r as projectOpenAITools, t as OpenAICompletionsToolChoice } from "../openai-tool-projection-793cE3QX.mjs";
|
|
5
|
-
import "../types-
|
|
6
|
-
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
7
|
-
import { a as ResponsesPromptObservation, c as responsesServiceTierObserver, d as OpenAIRequestReasoningEffort, o as ResponsesServiceTierObservation, s as responsesPromptObserver } 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 resolveResponsesTerminalStopReason, i as readResponsesReasoningTokens, n as isResponsesOutputLimitToolCallError, r as mapResponsesTerminalUsage, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-
|
|
10
|
-
import "../openai-responses-compaction-replay-
|
|
5
|
+
import "../types-Dlz-8qcy.mjs";
|
|
6
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-CJ0ktmGy.mjs";
|
|
7
|
+
import { a as ResponsesPromptObservation, c as responsesServiceTierObserver, d as OpenAIRequestReasoningEffort, o as ResponsesServiceTierObservation, s as responsesPromptObserver } from "../openai-responses-contracts-sAvdqNjS.mjs";
|
|
8
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-C-Q1Ksfs.mjs";
|
|
9
|
+
import { a as resolveResponsesTerminalStopReason, i as readResponsesReasoningTokens, n as isResponsesOutputLimitToolCallError, r as mapResponsesTerminalUsage, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-BVvyXZ8u.mjs";
|
|
10
|
+
import "../openai-responses-compaction-replay-BB2SWdsx.mjs";
|
|
11
11
|
import { ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
12
12
|
import { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
|
13
13
|
//#region packages/ai/src/providers/azure-deployment-map.d.ts
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { C as resolveOpenAIReasoningEffortForModel, D as supportsOpenAITemperature, E as supportsOpenAIReasoningEffort, S as resolveOpenAIModelReasoningEfforts, T as resolveOpenAISupportedReasoningEfforts, _ as isOpenAIGpt54MiniModel, b as isOpenAIGpt6Model, g as responsesServiceTierObserver, h as responsesPromptObserver, v as isOpenAIGpt55Model, w as resolveOpenAIReasoningEffortMapping, x as normalizeOpenAIReasoningEffort, y as isOpenAIGpt56Model } from "../openai-responses-contracts-BKu8O7l4.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-Dj8qeOHT.mjs";
|
|
3
3
|
import { g as resolveResponsesTerminalStopReason, h as readResponsesReasoningTokens, m as mapResponsesTerminalUsage, p as isResponsesOutputLimitToolCallError } from "../diagnostics-Caj-4RBA.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 { i as convertMessages } from "../openai-completions-transport-
|
|
4
|
+
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-wW3117Fu.mjs";
|
|
5
|
+
import { f as projectOpenAITools, m as reconcileOpenAIResponsesToolChoice, p as reconcileOpenAICompletionsToolChoice } from "../openai-transport-params-ildrm49s.mjs";
|
|
6
|
+
import { i as convertMessages } from "../openai-completions-transport-DITBEALX.mjs";
|
|
7
7
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
8
|
-
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-
|
|
8
|
+
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-TCJRAoMW.mjs";
|
|
9
9
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
10
10
|
import { t as hasResponsesWebSearchTool } from "../openai-web-search-tools-Cfu0uLyN.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-BPadHHKe.mjs";
|
|
13
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-1_TvcWI3.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, hasResponsesWebSearchTool, 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, responsesServiceTierObserver, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "../index-
|
|
1
|
+
import "../index-DJrNQnKw.mjs";
|
|
2
2
|
import { M as ModelThinkingLevel, Q as SimpleStreamOptions, U as ProviderStreamOptions, a as AssistantMessage, d as Context, k as Model, n as Api, nt as StreamOptions, pt as Usage, s as AssistantMessageEventStreamContract } from "../types-DvzmWW8J.mjs";
|
|
3
3
|
import { i as getEventStreamCompletion } from "../event-stream-DrRM_90c.mjs";
|
|
4
|
-
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-
|
|
5
|
-
import { m as getDefaultAiTransportHost } from "../host-
|
|
6
|
-
import "../types-
|
|
4
|
+
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-DcEP_o4h.mjs";
|
|
5
|
+
import { m as getDefaultAiTransportHost } from "../host-BjIYEjwT.mjs";
|
|
6
|
+
import "../types-Dlz-8qcy.mjs";
|
|
7
|
+
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-BR0MUYYD.mjs";
|
|
7
8
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CjDG6jJx.mjs";
|
|
8
|
-
import { v as parseTerminalToolCallArguments } from "../transport-stream-shared-
|
|
9
|
+
import { v as parseTerminalToolCallArguments } from "../transport-stream-shared-CAxkgOSj.mjs";
|
|
9
10
|
//#region packages/ai/src/internal/default-runtime.d.ts
|
|
10
11
|
export declare const defaultApiRegistry: {
|
|
11
12
|
registerApiProvider: <TApi extends Api, TOptions extends StreamOptions>(provider: ApiProvider<TApi, TOptions>, sourceId?: string) => void;
|
|
@@ -51,22 +52,6 @@ declare const { stream, complete, streamSimple, completeSimple }: {
|
|
|
51
52
|
cleanupSessionResources: (sessionId?: string) => void;
|
|
52
53
|
};
|
|
53
54
|
//#endregion
|
|
54
|
-
//#region packages/ai/src/env-api-keys.d.ts
|
|
55
|
-
/**
|
|
56
|
-
* Find configured environment variables that can provide an API key for a provider.
|
|
57
|
-
*
|
|
58
|
-
* This only reports actual API key variables. It intentionally excludes ambient
|
|
59
|
-
* credential sources such as AWS profiles, AWS IAM credentials, and Google
|
|
60
|
-
* Application Default Credentials.
|
|
61
|
-
*/
|
|
62
|
-
export declare function findEnvKeys(provider: string): string[] | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Get API key for provider from known environment variables, e.g. OPENAI_API_KEY.
|
|
65
|
-
*
|
|
66
|
-
* Will not return API keys for providers that require OAuth tokens.
|
|
67
|
-
*/
|
|
68
|
-
export declare function getEnvApiKey(provider: string): string | undefined;
|
|
69
|
-
//#endregion
|
|
70
55
|
//#region packages/ai/src/model-utils.d.ts
|
|
71
56
|
/** Calculates and stores model cost fields from token usage and per-million pricing. */
|
|
72
57
|
export declare function calculateCost<TApi extends Api>(model: Model<TApi>, usage: Usage): Usage["cost"];
|
|
@@ -250,4 +235,4 @@ export type SseByteGuard = {
|
|
|
250
235
|
};
|
|
251
236
|
export declare function createSseByteGuard(reader: ReadableStreamDefaultReader<Uint8Array>, opts: ReadSseStreamWithLimitOptions): SseByteGuard;
|
|
252
237
|
//#endregion
|
|
253
|
-
export { type ReasoningTagTextDelta, type ReasoningTagTextPartitioner, complete, completeSimple, getApiProvider, getApiProviders, getEventStreamCompletion, parseTerminalToolCallArguments, sanitizeSurrogates, stream, streamSimple };
|
|
238
|
+
export { type ReasoningTagTextDelta, type ReasoningTagTextPartitioner, complete, completeSimple, findEnvKeys, getApiProvider, getApiProviders, getEnvApiKey, getEventStreamCompletion, parseTerminalToolCallArguments, sanitizeSurrogates, stream, streamSimple };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as isProviderRefusalAssistantError } from "../diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { o as getEventStreamCompletion } from "../event-stream-C5AbCAaZ.mjs";
|
|
3
|
-
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-
|
|
4
|
-
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-
|
|
3
|
+
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-CElngO8h.mjs";
|
|
4
|
+
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-JpNulOOs.mjs";
|
|
5
5
|
import { i as registerSessionResourceCleanupObserver, n as getSessionResourceOwnerId, r as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-D1wgDQ8C.mjs";
|
|
6
|
-
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-
|
|
6
|
+
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-C5TAc3U_.mjs";
|
|
7
7
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-CyX4VKGO.mjs";
|
|
8
8
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
9
9
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-D8f_oxHj.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { O as Message, Q as SimpleStreamOptions, a as AssistantMessage, at as ThinkingBudgets, k as Model, n as Api, nt as StreamOptions, st as ThinkingLevel } from "../types-DvzmWW8J.mjs";
|
|
2
2
|
import { a as readAssistantThinkingAppend } from "../event-stream-DrRM_90c.mjs";
|
|
3
|
-
import "../types-
|
|
3
|
+
import "../types-Dlz-8qcy.mjs";
|
|
4
4
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CjDG6jJx.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 { s as readAssistantThinkingAppend } from "../event-stream-C5AbCAaZ.mjs";
|
|
2
|
-
import { M as hasMediaPayload, N 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 { M as hasMediaPayload, N 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-JpNulOOs.mjs";
|
|
3
3
|
import { n as projectProviderError, r as createDiagnosticRecord } from "../provider-error-DQBE1bUQ.mjs";
|
|
4
|
-
import { P 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 { P as sanitizeSurrogates } from "../transport-stream-shared-C5TAc3U_.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-wW3117Fu.mjs";
|
|
6
6
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-DEE6gcB9.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,8 +1,8 @@
|
|
|
1
1
|
import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-C5AbCAaZ.mjs";
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-
|
|
3
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P 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-
|
|
5
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-JpNulOOs.mjs";
|
|
3
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-C5TAc3U_.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-wW3117Fu.mjs";
|
|
5
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-mJ9cL4Qg.mjs";
|
|
6
6
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-D8f_oxHj.mjs";
|
|
7
7
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
8
8
|
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
package/dist/{openai-chatgpt-responses-BC2x0Oqx.mjs → openai-chatgpt-responses-CB1JwNFF.mjs}
RENAMED
|
@@ -2,23 +2,23 @@ import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as app
|
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-C5AbCAaZ.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { r as clampPositiveTimerTimeoutMs } from "./number-coercion-V8-BhME4.mjs";
|
|
5
|
-
import { E as headersToRecord, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
5
|
+
import { E as headersToRecord, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-JpNulOOs.mjs";
|
|
6
6
|
import { D as supportsOpenAITemperature, h as responsesPromptObserver } from "./openai-responses-contracts-BKu8O7l4.mjs";
|
|
7
7
|
import { r as registerSessionResourceCleanup } from "./session-resources-D1wgDQ8C.mjs";
|
|
8
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
8
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-Dj8qeOHT.mjs";
|
|
9
9
|
import { _ as extractErrorCodeOrErrno, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as toErrorObject } from "./diagnostics-Caj-4RBA.mjs";
|
|
10
|
-
import { n as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./text-signature-
|
|
10
|
+
import { n as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./text-signature-rOn31nxc.mjs";
|
|
11
11
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
12
|
-
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-
|
|
13
|
-
import { n as buildManagedModelFetch } from "./host-policy-
|
|
14
|
-
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
15
|
-
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-
|
|
16
|
-
import { b as createOpenAIResponseHook, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
17
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
12
|
+
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-D7hWYB0G.mjs";
|
|
13
|
+
import { n as buildManagedModelFetch } from "./host-policy-CC5H0iRZ.mjs";
|
|
14
|
+
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-C5TAc3U_.mjs";
|
|
15
|
+
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-wW3117Fu.mjs";
|
|
16
|
+
import { b as createOpenAIResponseHook, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-ildrm49s.mjs";
|
|
17
|
+
import { t as createAssistantOutput } from "./assistant-output-mJ9cL4Qg.mjs";
|
|
18
18
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D9ZmL_s9.mjs";
|
|
19
|
-
import { A as recordResponsesContextUsage, J as buildOpenAIResponsesReasoningReplayMetadata, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Z as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, s as processResponsesStream, w as resolveNextResponsesEncryptedContentAttempt } from "./openai-responses-shared-
|
|
19
|
+
import { A as recordResponsesContextUsage, J as buildOpenAIResponsesReasoningReplayMetadata, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Z as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, s as processResponsesStream, w as resolveNextResponsesEncryptedContentAttempt } from "./openai-responses-shared-TCJRAoMW.mjs";
|
|
20
20
|
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
|
21
|
-
import { t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-
|
|
21
|
+
import { t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-CbH84xIS.mjs";
|
|
22
22
|
import { n as withResponsesRequestAcceptance, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
23
23
|
import { t as requireApiKey } from "./required-api-key-D4kn3252.mjs";
|
|
24
24
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
@@ -298,6 +298,7 @@ const RETRYABLE_WEBSOCKET_CLOSE_CODES = /* @__PURE__ */ new Set([
|
|
|
298
298
|
]);
|
|
299
299
|
const WEBSOCKET_MESSAGE_TOO_BIG_CLOSE_CODE = 1009;
|
|
300
300
|
const WEBSOCKET_CONNECTION_LIMIT_REACHED_CODE = "websocket_connection_limit_reached";
|
|
301
|
+
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.";
|
|
301
302
|
const OPENAI_CHATGPT_RESPONSES_ERROR_BODY_MAX_BYTES = 16384;
|
|
302
303
|
function buildRequestSignal(baseSignal, timeoutMs) {
|
|
303
304
|
if (timeoutMs === void 0) return baseSignal;
|
|
@@ -389,19 +390,18 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
389
390
|
const websocketDisabledForSession = transport === "auto" && websocketAuthority !== void 0 && hasCodexWebSocketSseFallback(websocketState.sseFallbacks, options?.sessionId, websocketAuthority);
|
|
390
391
|
if (websocketAuthority && !websocketDisabledForSession) {
|
|
391
392
|
let websocketStarted = false;
|
|
392
|
-
let
|
|
393
|
-
let retriedWebSocketConnectionLimit = false;
|
|
393
|
+
let retriedWebSocketRejection = false;
|
|
394
394
|
while (true) {
|
|
395
395
|
const activeAttempt = semanticAttempt;
|
|
396
|
+
const dispatch = {};
|
|
396
397
|
websocketStarted = false;
|
|
397
|
-
websocketRequestSent = false;
|
|
398
398
|
try {
|
|
399
399
|
const terminal = await processWebSocketStream(websocketState, websocketAuthority, activeAttempt.request, output, stream, model, () => {
|
|
400
400
|
websocketStarted = true;
|
|
401
401
|
}, () => {
|
|
402
402
|
commitSemanticAttempt(activeAttempt);
|
|
403
|
-
}, requestOptions, firstEventAbort.abort, observePromptEgress, activeAttempt.kind, () => {
|
|
404
|
-
|
|
403
|
+
}, requestOptions, firstEventAbort.abort, observePromptEgress, activeAttempt.kind, (request) => {
|
|
404
|
+
dispatch.request = request;
|
|
405
405
|
}, options?.signal);
|
|
406
406
|
if (activeSignal?.aborted) throw transportAbortError(activeSignal);
|
|
407
407
|
if (output.stopReason === "aborted" || output.stopReason === "error") throw new CodexApiError(output.errorMessage ?? "An unknown error occurred");
|
|
@@ -415,15 +415,16 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
415
415
|
return;
|
|
416
416
|
} catch (error) {
|
|
417
417
|
const aborted = activeSignal?.aborted;
|
|
418
|
-
const nextSemanticAttempt = !aborted &&
|
|
418
|
+
const nextSemanticAttempt = !aborted && dispatch.request && !websocketStarted && error instanceof CodexApiError && isInvalidEncryptedContentError(error) ? await resolveNextResponsesEncryptedContentAttempt(activeAttempt, error, { buildFullHistoryRequest: () => buildBody("full-history") }) : void 0;
|
|
419
419
|
if (nextSemanticAttempt) {
|
|
420
420
|
semanticAttempt = nextSemanticAttempt;
|
|
421
|
-
|
|
421
|
+
retriedWebSocketRejection = false;
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
424
424
|
const connectionLimitBeforeStart = !websocketStarted && isWebSocketConnectionLimitReachedError(error);
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
const reconnectBeforeStart = connectionLimitBeforeStart || !websocketStarted && dispatch.request?.previous_response_id && error instanceof CodexApiError && error.message === WEBSOCKET_REPLAY_REJECTION;
|
|
426
|
+
if (!aborted && reconnectBeforeStart && !retriedWebSocketRejection) {
|
|
427
|
+
retriedWebSocketRejection = true;
|
|
427
428
|
continue;
|
|
428
429
|
}
|
|
429
430
|
if (aborted || isCodexNonTransportError(error) && !connectionLimitBeforeStart) throw error;
|
|
@@ -987,7 +988,7 @@ async function processWebSocketStream(state, authority, body, output, stream, mo
|
|
|
987
988
|
type: "response.create",
|
|
988
989
|
...requestBody
|
|
989
990
|
}));
|
|
990
|
-
onRequestSent?.();
|
|
991
|
+
onRequestSent?.(requestBody);
|
|
991
992
|
const terminal = await processResponsesStream(startWebSocketOutputOnFirstEvent(mapCodexEvents(parseWebSocket(socket, options?.signal), void 0, options), output, stream, onFirstProviderEvent, () => notifyProviderStreamOpened({
|
|
992
993
|
options,
|
|
993
994
|
cancelStream: () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import { k as clampThinkingLevel } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { i as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-
|
|
2
|
+
import { k as clampThinkingLevel } from "./host-JpNulOOs.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-wW3117Fu.mjs";
|
|
4
|
+
import { i as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-DITBEALX.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-D4kn3252.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-completions-compat-BYdYpXhU.d.mts → openai-completions-compat-CJ0ktmGy.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-DJrNQnKw.mjs";
|
|
2
2
|
import { N as OpenAICompletionsCompat, k as Model } from "./types-DvzmWW8J.mjs";
|
|
3
|
-
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-
|
|
3
|
+
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-BjIYEjwT.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-BdmlhD4u.mjs → openai-completions-compat-D7hWYB0G.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { a as resolveProviderRequestCapabilities } from "./host-policy-
|
|
2
|
+
import { a as resolveProviderRequestCapabilities } from "./host-policy-CC5H0iRZ.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-transport-DWM2mQDB.mjs → openai-completions-transport-DITBEALX.mjs}
RENAMED
|
@@ -3,26 +3,26 @@ import { r as appendAssistantThinking } from "./event-stream-C5AbCAaZ.mjs";
|
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { s as readNonEmptyStringPreservingWhitespace, t as hasNonEmptyString } from "./string-coerce-CtgOVOSv.mjs";
|
|
5
5
|
import { n as asNonNegativeFiniteNumber } from "./number-coercion-V8-BhME4.mjs";
|
|
6
|
-
import { N as isImageWithMediaPayload, r as getAiTransportHost } from "./host-
|
|
6
|
+
import { N as isImageWithMediaPayload, r as getAiTransportHost } from "./host-JpNulOOs.mjs";
|
|
7
7
|
import { _ as isOpenAIGpt54MiniModel, v as isOpenAIGpt55Model, y as isOpenAIGpt56Model } from "./openai-responses-contracts-BKu8O7l4.mjs";
|
|
8
8
|
import { r as uniqueStrings } from "./string-normalization-PN10hf6d.mjs";
|
|
9
9
|
import { o as truncateUtf16Safe } from "./provider-error-DQBE1bUQ.mjs";
|
|
10
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
10
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-Dj8qeOHT.mjs";
|
|
11
11
|
import { r as emitModelTransportDebug } from "./diagnostics-Caj-4RBA.mjs";
|
|
12
|
-
import { c as supportsModelTools, r as estimateStringChars } from "./text-signature-
|
|
13
|
-
import { i as resolveOpenAICompletionsCompat, l as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
14
|
-
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-
|
|
12
|
+
import { c as supportsModelTools, r as estimateStringChars } from "./text-signature-rOn31nxc.mjs";
|
|
13
|
+
import { i as resolveOpenAICompletionsCompat, l as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-D7hWYB0G.mjs";
|
|
14
|
+
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-CC5H0iRZ.mjs";
|
|
15
15
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
16
|
-
import { E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, S as withProviderResponseHook, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, c as failTransportStream, d as iterateModelStream, l as finalizeTerminalToolCallArguments, s as createWritableTransportEventStream, u as finalizeTransportStream, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
17
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, l as codeModeToolSurfaceObserver, m as extractToolResultText, s as prepareModelRequestBody, u as reasoningTagTextPolicy, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
18
|
-
import { C as log, D as readOpenAICompletionsReasoningBatch, E as readOpenAICompletionsContentDeltas, O as resolveOpenAIClientBaseUrl, S as isOpenAICompletionsThinkingEnabled, T as parseOpenAICompletionsUsage, a as enforceCodeModeResponsesToolSurface, d as prepareOpenAITools, f as projectOpenAITools, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, i as buildOpenAISdkRequestOptions, k as resolvePromptCacheKey, l as resolveCodeModeResponsesVisibleToolNames, n as buildOpenAIClientHeaders, p as reconcileOpenAICompletionsToolChoice, r as buildOpenAISdkClientOptions, s as getCompat, t as assertCodeModeResponsesToolSurface, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as measureUtf8AppendBytes, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
16
|
+
import { E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, S as withProviderResponseHook, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, c as failTransportStream, d as iterateModelStream, l as finalizeTerminalToolCallArguments, s as createWritableTransportEventStream, u as finalizeTransportStream, y as throwIfModelStreamAborted } from "./transport-stream-shared-C5TAc3U_.mjs";
|
|
17
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, l as codeModeToolSurfaceObserver, m as extractToolResultText, s as prepareModelRequestBody, u as reasoningTagTextPolicy, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-wW3117Fu.mjs";
|
|
18
|
+
import { C as log, D as readOpenAICompletionsReasoningBatch, E as readOpenAICompletionsContentDeltas, O as resolveOpenAIClientBaseUrl, S as isOpenAICompletionsThinkingEnabled, T as parseOpenAICompletionsUsage, a as enforceCodeModeResponsesToolSurface, d as prepareOpenAITools, f as projectOpenAITools, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, i as buildOpenAISdkRequestOptions, k as resolvePromptCacheKey, l as resolveCodeModeResponsesVisibleToolNames, n as buildOpenAIClientHeaders, p as reconcileOpenAICompletionsToolChoice, r as buildOpenAISdkClientOptions, s as getCompat, t as assertCodeModeResponsesToolSurface, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as measureUtf8AppendBytes, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-ildrm49s.mjs";
|
|
19
19
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
20
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
21
|
-
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-
|
|
20
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-mJ9cL4Qg.mjs";
|
|
21
|
+
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-DAv1BdTm.mjs";
|
|
22
22
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-D8f_oxHj.mjs";
|
|
23
23
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
24
24
|
import "./types.mjs";
|
|
25
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
25
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-8c_Nj2NS.mjs";
|
|
26
26
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D9ZmL_s9.mjs";
|
|
27
27
|
import { f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-DYNePiF8.mjs";
|
|
28
28
|
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
@@ -1091,14 +1091,11 @@ function buildOpenAICompletionsRequest(model, context, options, policy) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
if (compatDetection?.capabilities.usesExplicitProxyLikeEndpoint && clampedMaxTokens !== void 0 && effectiveContextTokens !== void 0) {
|
|
1093
1093
|
const estimatedInputTokens = estimateOpenAICompletionsInputTokens(params);
|
|
1094
|
-
const remainingBudget = Math.max(
|
|
1094
|
+
const remainingBudget = Math.max(0, effectiveContextTokens - estimatedInputTokens - 1);
|
|
1095
1095
|
if (clampedMaxTokens > remainingBudget) {
|
|
1096
|
+
if (remainingBudget < MIN_USEFUL_OUTPUT_TOKENS) throw Object.assign(/* @__PURE__ */ new Error(`Context window exceeded: estimated input ${estimatedInputTokens} leaves only ${remainingBudget} output tokens within the ${effectiveContextTokens}-token context.`), { code: "context_length_exceeded" });
|
|
1096
1097
|
clampedMaxTokens = remainingBudget;
|
|
1097
1098
|
emitModelTransportDebug(log, `[completions] clamp_max_tokens provider=${model.provider} api=${model.api} model=${model.id} requested=${effectiveMaxTokens} output=${clampedMaxTokens} effectiveContext=${effectiveContextTokens} estimatedInput=${estimatedInputTokens}`);
|
|
1098
|
-
if (remainingBudget < MIN_USEFUL_OUTPUT_TOKENS) {
|
|
1099
|
-
if (model.reasoning && thinkingEnabled !== false) throw Object.assign(/* @__PURE__ */ new Error(`Context window exceeded: estimated input ${estimatedInputTokens} leaves only ${remainingBudget} output tokens within the ${effectiveContextTokens}-token context.`), { code: "context_length_exceeded" });
|
|
1100
|
-
log.warn(`[completions] insufficient_output_budget provider=${model.provider} api=${model.api} model=${model.id} output=${clampedMaxTokens} effectiveContext=${effectiveContextTokens} estimatedInput=${estimatedInputTokens}`);
|
|
1101
|
-
}
|
|
1102
1099
|
}
|
|
1103
1100
|
}
|
|
1104
1101
|
if (policy.mode === "direct" ? options?.maxTokens : clampedMaxTokens) {
|
|
@@ -1383,6 +1380,102 @@ function scanDeepSeekDsmlToolBlock(text, closeToken, contentStartIndex, state) {
|
|
|
1383
1380
|
return { kind: "incomplete" };
|
|
1384
1381
|
}
|
|
1385
1382
|
//#endregion
|
|
1383
|
+
//#region packages/ai/src/transports/openai-completions-gemma.ts
|
|
1384
|
+
const OPEN = "<|tool_call>";
|
|
1385
|
+
const CLOSE = "<tool_call|>";
|
|
1386
|
+
const QUOTE = "<|\"|>";
|
|
1387
|
+
const MAX_RECOVERY_BYTES = 256e3;
|
|
1388
|
+
function recoverGemmaCalls(text) {
|
|
1389
|
+
const parts = [];
|
|
1390
|
+
const opener = /\s*<\|tool_call>\s*call:([\w.-]+)\s*/y;
|
|
1391
|
+
const token = /\s*(<\|"\|>[\s\S]*?<\|"\|>|[\w.+-]+|[{}[\],:])\s*/y;
|
|
1392
|
+
let offset = 0;
|
|
1393
|
+
while (offset < text.length) {
|
|
1394
|
+
if (!text.slice(offset).trim()) {
|
|
1395
|
+
parts.push({
|
|
1396
|
+
kind: "text",
|
|
1397
|
+
text: text.slice(offset)
|
|
1398
|
+
});
|
|
1399
|
+
break;
|
|
1400
|
+
}
|
|
1401
|
+
opener.lastIndex = offset;
|
|
1402
|
+
const head = opener.exec(text);
|
|
1403
|
+
const name = head?.[1];
|
|
1404
|
+
if (!head || !name) return;
|
|
1405
|
+
const leading = /^\s*/.exec(head[0])?.[0] ?? "";
|
|
1406
|
+
if (leading) parts.push({
|
|
1407
|
+
kind: "text",
|
|
1408
|
+
text: leading
|
|
1409
|
+
});
|
|
1410
|
+
token.lastIndex = opener.lastIndex;
|
|
1411
|
+
let depth = 0;
|
|
1412
|
+
const json = [];
|
|
1413
|
+
do {
|
|
1414
|
+
const value = token.exec(text)?.[1];
|
|
1415
|
+
if (!value || json.length === 0 && value !== "{") return;
|
|
1416
|
+
if (value === "{") depth += 1;
|
|
1417
|
+
else if (value === "}") depth -= 1;
|
|
1418
|
+
json.push(value.startsWith(QUOTE) ? JSON.stringify(value.slice(5, -5)) : text[token.lastIndex] === ":" && /^[A-Za-z_][\w.-]*$/.test(value) ? JSON.stringify(value) : value);
|
|
1419
|
+
} while (depth > 0);
|
|
1420
|
+
if (!text.startsWith(CLOSE, token.lastIndex)) return;
|
|
1421
|
+
try {
|
|
1422
|
+
const argumentsValue = JSON.parse(json.join(" "));
|
|
1423
|
+
if (!isRecord(argumentsValue)) return;
|
|
1424
|
+
parts.push({
|
|
1425
|
+
kind: "toolCall",
|
|
1426
|
+
name,
|
|
1427
|
+
arguments: argumentsValue,
|
|
1428
|
+
partialArgs: JSON.stringify(argumentsValue)
|
|
1429
|
+
});
|
|
1430
|
+
} catch {
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
offset = token.lastIndex + 12;
|
|
1434
|
+
}
|
|
1435
|
+
return parts;
|
|
1436
|
+
}
|
|
1437
|
+
/** Buffer only a possible standalone call batch; prose and examples stay text. */
|
|
1438
|
+
function createGemmaToolCallRecoverer() {
|
|
1439
|
+
let buffer = "";
|
|
1440
|
+
let bytes = 0;
|
|
1441
|
+
let highSurrogate = false;
|
|
1442
|
+
let passthrough = false;
|
|
1443
|
+
return {
|
|
1444
|
+
push(text) {
|
|
1445
|
+
if (passthrough) return [{
|
|
1446
|
+
kind: "text",
|
|
1447
|
+
text
|
|
1448
|
+
}];
|
|
1449
|
+
const append = measureUtf8AppendBytes(highSurrogate, text);
|
|
1450
|
+
bytes += append.bytes;
|
|
1451
|
+
highSurrogate = append.endsWithHighSurrogate;
|
|
1452
|
+
buffer += text;
|
|
1453
|
+
const candidate = buffer.trimStart();
|
|
1454
|
+
if (OPEN.startsWith(candidate) || candidate.startsWith(OPEN)) {
|
|
1455
|
+
if (bytes > MAX_RECOVERY_BYTES) throw new Error("Exceeded Gemma tool-call recovery buffer limit");
|
|
1456
|
+
return [];
|
|
1457
|
+
}
|
|
1458
|
+
passthrough = true;
|
|
1459
|
+
const result = [{
|
|
1460
|
+
kind: "text",
|
|
1461
|
+
text: buffer
|
|
1462
|
+
}];
|
|
1463
|
+
buffer = "";
|
|
1464
|
+
return result;
|
|
1465
|
+
},
|
|
1466
|
+
flush(allowRecovery = true) {
|
|
1467
|
+
const text = buffer;
|
|
1468
|
+
buffer = "";
|
|
1469
|
+
passthrough ||= !allowRecovery;
|
|
1470
|
+
const recovered = allowRecovery ? recoverGemmaCalls(text) : void 0;
|
|
1471
|
+
return text ? recovered ?? [{
|
|
1472
|
+
kind: "text",
|
|
1473
|
+
text
|
|
1474
|
+
}] : [];
|
|
1475
|
+
}
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
//#endregion
|
|
1386
1479
|
//#region packages/ai/src/transports/openai-completions-stream.ts
|
|
1387
1480
|
function extractToolCallThoughtSignature(toolCall) {
|
|
1388
1481
|
const tc = toolCall;
|
|
@@ -1399,6 +1492,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1399
1492
|
const shouldFilterDeepSeekDsmlText = !directMode && compat.thinkingFormat === "deepseek";
|
|
1400
1493
|
const deepSeekTextFilter = shouldFilterDeepSeekDsmlText ? createDeepSeekTextFilter() : null;
|
|
1401
1494
|
const deepSeekToolCallRecoverer = shouldFilterDeepSeekDsmlText ? createDsmlRecoverer() : null;
|
|
1495
|
+
const gemmaToolCallRecoverer = !directMode && /gemma-?4/i.test(model.id) ? createGemmaToolCallRecoverer() : null;
|
|
1402
1496
|
const reasoningTagTextPartitioner = createReasoningTagTextPartitioner();
|
|
1403
1497
|
if (options?.strictReasoningTags) reasoningTagTextPartitioner.markStrict();
|
|
1404
1498
|
let currentBlock = null;
|
|
@@ -1601,6 +1695,10 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1601
1695
|
const flushReasoningTagTextPartitioner = () => {
|
|
1602
1696
|
for (const delta of reasoningTagTextPartitioner.flush()) appendPartitionedVisibleDelta(delta);
|
|
1603
1697
|
};
|
|
1698
|
+
const flushGemmaToolCallRecoverer = (allowRecovery = true) => {
|
|
1699
|
+
for (const part of gemmaToolCallRecoverer?.flush(allowRecovery) ?? []) if (part.kind === "toolCall") appendRecoveredToolCall(part);
|
|
1700
|
+
else for (const delta of reasoningTagTextPartitioner.pushVisible(part.text)) appendPartitionedVisibleDelta(delta);
|
|
1701
|
+
};
|
|
1604
1702
|
const sealTextBeforeReasoning = () => {
|
|
1605
1703
|
if (currentBlock?.type !== "text" && !reasoningTagTextPartitioner.hasPending()) return;
|
|
1606
1704
|
flushReasoningTagTextPartitioner();
|
|
@@ -1677,8 +1775,11 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1677
1775
|
appendReasoningDeltas(reasoningDeltas);
|
|
1678
1776
|
}
|
|
1679
1777
|
for (const [contentDeltaIndex, contentDelta] of contentDeltas.entries()) if (contentDelta.kind === "text") {
|
|
1680
|
-
const
|
|
1681
|
-
for (const
|
|
1778
|
+
const parts = gemmaToolCallRecoverer?.push(contentDelta.text) ?? [contentDelta];
|
|
1779
|
+
for (const part of parts) {
|
|
1780
|
+
const routedDeltas = hasReasoningThinking ? reasoningTagTextPartitioner.push(part.text) : reasoningTagTextPartitioner.pushVisible(part.text);
|
|
1781
|
+
for (const routedDelta of routedDeltas) appendPartitionedVisibleDelta(routedDelta);
|
|
1782
|
+
}
|
|
1682
1783
|
} else {
|
|
1683
1784
|
beginReasoning(contentDeltaIndex < lastVisibleTextIndex);
|
|
1684
1785
|
if (emitReasoning) {
|
|
@@ -1689,6 +1790,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1689
1790
|
if (!hasReasoningThinking) appendReasoningDeltas(reasoningDeltas);
|
|
1690
1791
|
const toolCallDeltas = normalizedDelta.toolCalls;
|
|
1691
1792
|
if (toolCallDeltas.length > 0) {
|
|
1793
|
+
flushGemmaToolCallRecoverer(false);
|
|
1692
1794
|
sawNativeToolCallDelta = true;
|
|
1693
1795
|
flushReasoningTagTextPartitioner();
|
|
1694
1796
|
rememberPendingCommentaryTags(provisionalCommentaryTags, tagPendingCommentaryText(output.content));
|
|
@@ -1754,6 +1856,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1754
1856
|
}
|
|
1755
1857
|
throwIfModelStreamAborted(options?.signal);
|
|
1756
1858
|
if (!finishReason && (directMode || options?.sawStreamDONE?.() === false)) throw new Error("Stream ended without finish_reason");
|
|
1859
|
+
flushGemmaToolCallRecoverer();
|
|
1757
1860
|
flushReasoningTagTextPartitioner();
|
|
1758
1861
|
appendRecoveredParts(deepSeekToolCallRecoverer?.flush() ?? []);
|
|
1759
1862
|
for (const part of deepSeekTextFilter?.flush() ?? []) appendVisibleTextDelta(part);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { N as OpenAICompletionsCompat, k as Model, l as CacheRetention } from "./types-DvzmWW8J.mjs";
|
|
2
|
-
import "./types-
|
|
2
|
+
import "./types-Dlz-8qcy.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-D7hWYB0G.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,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-C5AbCAaZ.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
4
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-Dj8qeOHT.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-D7hWYB0G.mjs";
|
|
5
5
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
7
|
-
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-wW3117Fu.mjs";
|
|
7
|
+
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-ildrm49s.mjs";
|
|
8
8
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
9
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
10
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
11
|
-
import { P as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
9
|
+
import { t as createAssistantOutput } from "./assistant-output-mJ9cL4Qg.mjs";
|
|
10
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-8c_Nj2NS.mjs";
|
|
11
|
+
import { P as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-TCJRAoMW.mjs";
|
|
12
12
|
import { t as requireApiKey } from "./required-api-key-D4kn3252.mjs";
|
|
13
13
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
14
14
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-DJrNQnKw.mjs";
|
|
2
2
|
import { a as AssistantMessage, k as Model } from "./types-DvzmWW8J.mjs";
|
|
3
|
-
import "./provider-options-
|
|
4
|
-
import { i as ReplayableResponseCompactionItem, l as OpenAIResponsesCompactionOutput, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-
|
|
3
|
+
import "./provider-options-Dk4PeQV3.mjs";
|
|
4
|
+
import { i as ReplayableResponseCompactionItem, l as OpenAIResponsesCompactionOutput, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-sAvdqNjS.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 captureOpenAIResponsesCompaction(output: Pick<AssistantMessage, "providerReplay">, item: ReplayableResponseCompactionItem, boundary: number | "retained-users", model: Model, captureMetadata?: OpenAIResponsesReasoningReplayMetadata, compactedOutput?: OpenAIResponsesCompactionOutput): void;
|
package/dist/{openai-responses-contracts-Br5IIw_h.d.mts → openai-responses-contracts-sAvdqNjS.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-DJrNQnKw.mjs";
|
|
2
2
|
import { M as ModelThinkingLevel, k as Model, n as Api } from "./types-DvzmWW8J.mjs";
|
|
3
|
-
import { a as BaseOpenAIStreamOptions, f as OpenAIReasoningEffort } from "./provider-options-
|
|
4
|
-
import "./types-
|
|
3
|
+
import { a as BaseOpenAIStreamOptions, f as OpenAIReasoningEffort } from "./provider-options-Dk4PeQV3.mjs";
|
|
4
|
+
import "./types-Dlz-8qcy.mjs";
|
|
5
5
|
import { ResponseCompactionItem, ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/providers/openai-request-reasoning.d.ts
|
|
7
7
|
type OpenAIRequestReasoningEffort = ModelThinkingLevel | "none";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as responsesPromptObserver } from "./openai-responses-contracts-BKu8O7l4.mjs";
|
|
2
|
-
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
3
|
-
import { C as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
2
|
+
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-C5TAc3U_.mjs";
|
|
3
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-wW3117Fu.mjs";
|
|
4
4
|
//#region packages/ai/src/transports/openai-responses-prompt-observer-internal.ts
|
|
5
5
|
function readFinalResponsesPrompt(request) {
|
|
6
6
|
if (typeof request.instructions === "string") return ["instructions", request.instructions];
|