@openclaw/ai 2026.11.5-beta.3 → 2026.11.5
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/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +1 -1
- package/dist/{anthropic-DEKgalVg.mjs → anthropic-CNEzO12C.mjs} +6 -5
- package/dist/{anthropic-payload-policy-CXCJ5Pmj.d.mts → anthropic-payload-policy-DVk38bnY.d.mts} +1 -1
- package/dist/{anthropic-stream-lifecycle-DF2qVvg1.mjs → anthropic-stream-lifecycle-DJUtasDB.mjs} +43 -24
- package/dist/{anthropic-tool-projection-D5DyrL6C.d.mts → anthropic-tool-projection-DKAlondV.d.mts} +1 -1
- package/dist/{anthropic-tool-projection-dGRfr4iT.mjs → anthropic-tool-projection-DcvsDiyX.mjs} +1 -1
- package/dist/{assistant-output-CD4kY9gu.mjs → assistant-output-C3czmoN4.mjs} +1 -1
- package/dist/{azure-openai-responses-Bk50gJpw.mjs → azure-openai-responses-DRkduRmW.mjs} +4 -5
- package/dist/{google-B1g82bn4.mjs → google-DqG05iBa.mjs} +2 -2
- package/dist/{google-interactions-tNr_ybcX.mjs → google-interactions-BE7cxFPc.mjs} +10 -10
- package/dist/{google-messages-A-9d3y5V.mjs → google-messages-p2iBzsAp.mjs} +3 -3
- package/dist/{google-provider-stream-CNVh4gpm.mjs → google-provider-stream-DZ6tqteU.mjs} +6 -6
- package/dist/{google-shared-WNM86ZcW.mjs → google-shared-BMYt1xSI.mjs} +5 -5
- package/dist/{google-vertex-CXjleC6g.mjs → google-vertex-CAq2q1Ln.mjs} +2 -2
- package/dist/{host-DX7ORpeH.mjs → host-DqX-64Pb.mjs} +45 -10
- package/dist/{host-policy-jCZebuXx.mjs → host-policy-Bk85E9ue.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +13 -3
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/google.mjs +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +2 -2
- package/dist/internal/openai-responses-payload-policy.mjs +1 -1
- package/dist/internal/openai.d.mts +3 -3
- package/dist/internal/openai.mjs +7 -7
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +1 -1
- 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-CjHkvsqR.mjs → mistral-DIGInqJI.mjs} +8 -8
- package/dist/{openai-chatgpt-responses-3QCEMfkF.mjs → openai-chatgpt-responses-C6rEZcsZ.mjs} +12 -17
- package/dist/{openai-completions-D7IYrF6d.mjs → openai-completions-B93R3N3b.mjs} +3 -3
- package/dist/{openai-completions-compat-CstlTQuF.mjs → openai-completions-compat-CS3dlDBR.mjs} +1 -1
- package/dist/{openai-completions-transport-CRJKV7wI.mjs → openai-completions-transport-DHTFq-BM.mjs} +19 -25
- package/dist/{openai-prompt-cache-CgDoFhO0.mjs → openai-prompt-cache-3H_Fz0ya.mjs} +1 -1
- package/dist/{openai-responses-BooFYPKe.mjs → openai-responses-DSxPKV0U.mjs} +6 -7
- package/dist/{openai-responses-compaction-replay-CNHk6k53.d.mts → openai-responses-compaction-replay-DXF5BjD2.d.mts} +2 -2
- package/dist/{openai-responses-contracts-BXMcvO7F.d.mts → openai-responses-contracts-Cb1IIRRG.d.mts} +1 -1
- package/dist/{openai-responses-endpoint-DCkURKS0.mjs → openai-responses-endpoint-CqO3ejTe.mjs} +12 -1
- package/dist/{openai-responses-payload-policy-DyE30gdD.d.mts → openai-responses-payload-policy-BsQaD-gD.d.mts} +4 -1
- package/dist/{openai-responses-request-lifecycle-DH3gtX6N.mjs → openai-responses-request-lifecycle-C_3FKkl7.mjs} +5 -5
- package/dist/{openai-responses-shared-B7TJU5wu.mjs → openai-responses-shared-En3Jf0Vg.mjs} +15 -23
- package/dist/{openai-tool-schema-Cx2QfbBC.mjs → openai-tool-schema-CvxySRyf.mjs} +1 -1
- package/dist/{otel-Buswj0Mf.mjs → otel-B2u5HGvm.mjs} +1 -1
- package/dist/{provider-options-Mo8NM5d1.d.mts → provider-options-BQ2Msop2.d.mts} +6 -0
- package/dist/{provider-replay-context-xyU7-CiT.mjs → provider-replay-context--QGWotXx.mjs} +3 -4
- package/dist/{provider-transcript-transform-DtaxNcC1.mjs → provider-transcript-transform-Hr1kCoMX.mjs} +1 -1
- package/dist/{provider-transport-turn-state-C-eRLEjC.mjs → provider-transport-turn-state-DyaOKAYm.mjs} +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-tLSeECry.mjs → simple-options-CQNPKCEb.mjs} +2 -2
- package/dist/{stream-DrtAWu7c.mjs → stream-DM-q0y5H.mjs} +1 -1
- package/dist/{telemetry-CvK1yQg7.mjs → telemetry-DJibfNKZ.mjs} +2 -2
- package/dist/{tool-schema-json-projection-BQpiJlXJ.mjs → tool-schema-json-projection-BSHb4gaJ.mjs} +1 -1
- package/dist/{transport-stream-shared-D2uFMhMc.mjs → transport-stream-shared-CBVh6QEc.mjs} +1 -1
- package/dist/{transport-utils-Da_39MYi.mjs → transport-utils-rxOHnq9y.mjs} +2 -2
- package/dist/transports.d.mts +6 -7
- package/dist/transports.mjs +12 -12
- package/package.json +1 -1
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { s as readAssistantThinkingAppend } from "../event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import {
|
|
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-DqX-64Pb.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 { f as iterateSseFrames } from "../transport-stream-shared-
|
|
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-CQNPKCEb.mjs";
|
|
7
|
+
import { f as iterateSseFrames } from "../transport-stream-shared-CBVh6QEc.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-BQ2Msop2.mjs";
|
|
2
|
+
import { a as prepareAnthropicInputSchema } from "../anthropic-tool-projection-DKAlondV.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 cleanSchemaForLlamacppGbnf, a as resolveOpenAIProjectedToolsStrictToolFlag, b as cleanSchemaForGemini, c as normalizeOpenAIStrictCompatSchema, d as resolveUnsupportedToolSchemaKeywords, f as shouldOmitEmptyArrayItems, g as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, h as stripUnsupportedSchemaKeywords, i as normalizeStrictOpenAIJsonSchema, l as extractToolSchemaModelCompat, n as isStrictOpenAIJsonSchemaCompatible, o as findCompatClosedObjectPaths, r as normalizeOpenAIStrictToolParameters, s as findOpenAIStrictSchemaViolations, t as findOpenAIStrictToolProjectionDiagnostics, u as normalizeToolParameterSchema, v as findLlamacppGbnfSchemaViolations, x as prepareOpenAIFunctionTool, y as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS } from "../openai-tool-schema-
|
|
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-BSHb4gaJ.mjs";
|
|
2
|
+
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-DcvsDiyX.mjs";
|
|
3
|
+
import { _ as cleanSchemaForLlamacppGbnf, a as resolveOpenAIProjectedToolsStrictToolFlag, b as cleanSchemaForGemini, c as normalizeOpenAIStrictCompatSchema, d as resolveUnsupportedToolSchemaKeywords, f as shouldOmitEmptyArrayItems, g as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, h as stripUnsupportedSchemaKeywords, i as normalizeStrictOpenAIJsonSchema, l as extractToolSchemaModelCompat, n as isStrictOpenAIJsonSchemaCompatible, o as findCompatClosedObjectPaths, r as normalizeOpenAIStrictToolParameters, s as findOpenAIStrictSchemaViolations, t as findOpenAIStrictToolProjectionDiagnostics, u as normalizeToolParameterSchema, v as findLlamacppGbnfSchemaViolations, x as prepareOpenAIFunctionTool, y as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS } from "../openai-tool-schema-CvxySRyf.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,15 +2,15 @@ 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 {
|
|
5
|
+
import { I as isImageWithMediaPayload, M as clampThinkingLevel, j as calculateCost, r as getAiTransportHost } from "./host-DqX-64Pb.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 { A as parseStreamingJson, D as shortHash, O as createToolArgumentPreviewSchedule, h as notifyProviderHttpResponse, l as finalizeTerminalToolCallArguments, n as assignTransportErrorDetails, p as mergeTransportHeaders, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
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-CQNPKCEb.mjs";
|
|
9
|
+
import { A as parseStreamingJson, D as shortHash, O as createToolArgumentPreviewSchedule, h as notifyProviderHttpResponse, l as finalizeTerminalToolCallArguments, n as assignTransportErrorDetails, p as mergeTransportHeaders, u as finalizeTransportStream } from "./transport-stream-shared-CBVh6QEc.mjs";
|
|
10
|
+
import { t as getPublishedRuntimeToolInputSchema } from "./tool-schema-json-projection-BSHb4gaJ.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-Hr1kCoMX.mjs";
|
|
13
|
+
import { t as createAssistantOutput } from "./assistant-output-C3czmoN4.mjs";
|
|
14
14
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
15
15
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
16
16
|
import { t as requireApiKey } from "./required-api-key-2zZTkmsi.mjs";
|
|
@@ -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-B2u5HGvm.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-DJibfNKZ.mjs");
|
|
2446
2446
|
} catch {
|
|
2447
2447
|
telemetryModule = null;
|
|
2448
2448
|
}
|
package/dist/{openai-chatgpt-responses-3QCEMfkF.mjs → openai-chatgpt-responses-C6rEZcsZ.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 {
|
|
7
|
+
import { a as resolveAiTransportHeaderSentinels, k as headersToRecord, r as getAiTransportHost } from "./host-DqX-64Pb.mjs";
|
|
8
8
|
import { N as supportsOpenAITemperature, v as responsesPromptObserver } from "./openai-responses-contracts-xU-n9AJJ.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-3H_Fz0ya.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-rxOHnq9y.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 { C as withProviderResponseHook, g as notifyProviderStreamOpened, n as assignTransportErrorDetails, p as mergeTransportHeaders, x as transportAbortError } from "./transport-stream-shared-
|
|
19
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
20
|
-
import { C as isInvalidEncryptedContentError, D as ResponsesStreamFailure, Dt as createResponseModelTracker, E as resolveNextResponsesEncryptedContentAttempt, Et as createOpenAIResponseHook, F as convertProviderResponsesMessages, Tt as createOpenAIProviderAcceptanceHook, _t as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, ot as suppressOpenAIResponsesCompaction, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, vt as resolveOpenAISimpleReasoningEffort, x as commitResponsesEncryptedContentAttempt } from "./openai-responses-shared-
|
|
15
|
+
import { u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-CS3dlDBR.mjs";
|
|
16
|
+
import { n as buildManagedModelFetch } from "./host-policy-Bk85E9ue.mjs";
|
|
17
|
+
import { n as buildBaseOptions, y as prepareSystemPrompt } from "./simple-options-CQNPKCEb.mjs";
|
|
18
|
+
import { C as withProviderResponseHook, g as notifyProviderStreamOpened, n as assignTransportErrorDetails, p as mergeTransportHeaders, x as transportAbortError } from "./transport-stream-shared-CBVh6QEc.mjs";
|
|
19
|
+
import { t as createAssistantOutput } from "./assistant-output-C3czmoN4.mjs";
|
|
20
|
+
import { C as isInvalidEncryptedContentError, D as ResponsesStreamFailure, Dt as createResponseModelTracker, E as resolveNextResponsesEncryptedContentAttempt, Et as createOpenAIResponseHook, F as convertProviderResponsesMessages, Tt as createOpenAIProviderAcceptanceHook, _t as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, ot as suppressOpenAIResponsesCompaction, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, vt as resolveOpenAISimpleReasoningEffort, x as commitResponsesEncryptedContentAttempt } from "./openai-responses-shared-En3Jf0Vg.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-C_3FKkl7.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
|
|
@@ -184,7 +184,6 @@ function buildRequestBody(model, context, allowedToolCallProviders, options, rep
|
|
|
184
184
|
includeSystemPrompt: false,
|
|
185
185
|
replayResponsesItemIds: false,
|
|
186
186
|
sessionId: options?.sessionId,
|
|
187
|
-
authProfileId: options?.authProfileId,
|
|
188
187
|
mutableInput: Boolean(options?.onPayload),
|
|
189
188
|
replayMode,
|
|
190
189
|
retainUserProvenance
|
|
@@ -424,10 +423,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
424
423
|
abortFirstEventStream: firstEventAbort?.abort,
|
|
425
424
|
onFirstEventTimeout: getFirstStreamEventTimeoutHandler(streamOptions),
|
|
426
425
|
signal: activitySignal ?? streamOptions?.signal,
|
|
427
|
-
reasoningReplayMetadata: buildOpenAIResponsesReasoningReplayMetadata(model, {
|
|
428
|
-
sessionId: streamOptions?.sessionId,
|
|
429
|
-
authProfileId: streamOptions?.authProfileId
|
|
430
|
-
}),
|
|
426
|
+
reasoningReplayMetadata: buildOpenAIResponsesReasoningReplayMetadata(model, { sessionId: streamOptions?.sessionId }),
|
|
431
427
|
resolveServiceTier: resolveCodexServiceTier,
|
|
432
428
|
applyServiceTierPricing: (usage, serviceTier) => applyResponsesServiceTierPricing(usage, serviceTier, model)
|
|
433
429
|
});
|
|
@@ -979,8 +975,7 @@ async function processWebSocketStream(state, authority, body, output, stream, mo
|
|
|
979
975
|
const responseItems = convertProviderResponsesMessages(model, { messages: [output] }, CODEX_TOOL_CALL_PROVIDERS, {
|
|
980
976
|
includeSystemPrompt: false,
|
|
981
977
|
replayResponsesItemIds: false,
|
|
982
|
-
sessionId: options?.sessionId
|
|
983
|
-
authProfileId: options?.authProfileId
|
|
978
|
+
sessionId: options?.sessionId
|
|
984
979
|
}).filter((item) => item.type !== "function_call_output");
|
|
985
980
|
entry.continuation = {
|
|
986
981
|
lastRequestBody: body,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { n as streamOpenAICompletionsRequest, s as convertMessages } from "./openai-completions-transport-
|
|
2
|
+
import { M as clampThinkingLevel } from "./host-DqX-64Pb.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-CQNPKCEb.mjs";
|
|
4
|
+
import { n as streamOpenAICompletionsRequest, s as convertMessages } from "./openai-completions-transport-DHTFq-BM.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-CstlTQuF.mjs → openai-completions-compat-CS3dlDBR.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
3
|
import { A as resolveOpenAIReasoningEffortMapping, M as supportsOpenAIReasoningEffort } from "./openai-responses-contracts-xU-n9AJJ.mjs";
|
|
4
|
-
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-
|
|
4
|
+
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-Bk85E9ue.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-CRJKV7wI.mjs → openai-completions-transport-DHTFq-BM.mjs}
RENAMED
|
@@ -6,44 +6,44 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
6
6
|
import { i as asOptionalRecord, o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-BQaoiN3r.mjs";
|
|
7
7
|
import { c as readNonEmptyStringPreservingWhitespace, t as hasNonEmptyString } from "./string-coerce-BCuWMIrk.mjs";
|
|
8
8
|
import { n as asNonNegativeFiniteNumber, r as asPositiveFiniteNumber } from "./number-coercion-C7HsBgUL.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { I as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, j as calculateCost, r as getAiTransportHost } from "./host-DqX-64Pb.mjs";
|
|
10
10
|
import { E as isOpenAIGpt6Model, N as supportsOpenAITemperature, R as resolveOpenAIThinkingApi, S as applyOpenAICompletionsToolReasoning, _ as parseOpenAIResponsesWebSocketServerError, b as isResponsesServiceTierRejection, d as OpenAIResponsesWebSocketPreDispatchError, f as OpenAIResponsesWebSocketSafeRetryError, g as isResponsesTerminalEventType, 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-xU-n9AJJ.mjs";
|
|
11
11
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
12
12
|
import { c as truncateUtf16Safe } from "./provider-error-DD-fo4Rz.mjs";
|
|
13
13
|
import { t as estimateStringChars } from "./src-BUsVkrNt.mjs";
|
|
14
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
14
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-3H_Fz0ya.mjs";
|
|
15
15
|
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";
|
|
16
|
-
import { o as supportsModelTools } from "./transport-utils-
|
|
16
|
+
import { o as supportsModelTools } from "./transport-utils-rxOHnq9y.mjs";
|
|
17
17
|
import { t as stableStringify } from "./stable-stringify-CchQEmeA.mjs";
|
|
18
18
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
19
|
-
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-
|
|
20
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
19
|
+
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-CS3dlDBR.mjs";
|
|
20
|
+
import { t as buildGuardedModelFetch } from "./host-policy-Bk85E9ue.mjs";
|
|
21
21
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-BJ2_Xabx.mjs";
|
|
22
22
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
23
23
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-w-ICeyOI.mjs";
|
|
24
|
-
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-
|
|
25
|
-
import { A as parseStreamingJson, C as withProviderResponseHook, D as shortHash, N as racePromiseWithAbortSignal, O as createToolArgumentPreviewSchedule, b as throwIfModelStreamAborted, c as failTransportStream, d as iterateModelStream, g as notifyProviderStreamOpened, l as finalizeTerminalToolCallArguments, o as createWritableTransportEventStream, u as finalizeTransportStream, x as transportAbortError } from "./transport-stream-shared-
|
|
26
|
-
import { C as sha256Hex, S as redactIdentifier } from "./tool-schema-json-projection-
|
|
24
|
+
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-CQNPKCEb.mjs";
|
|
25
|
+
import { A as parseStreamingJson, C as withProviderResponseHook, D as shortHash, N as racePromiseWithAbortSignal, O as createToolArgumentPreviewSchedule, b as throwIfModelStreamAborted, c as failTransportStream, d as iterateModelStream, g as notifyProviderStreamOpened, l as finalizeTerminalToolCallArguments, o as createWritableTransportEventStream, u as finalizeTransportStream, x as transportAbortError } from "./transport-stream-shared-CBVh6QEc.mjs";
|
|
26
|
+
import { C as sha256Hex, S as redactIdentifier } from "./tool-schema-json-projection-BSHb4gaJ.mjs";
|
|
27
27
|
import { n as getEnvApiKey } from "./env-api-keys-BuHc86ya.mjs";
|
|
28
28
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-DzaHoRAU.mjs";
|
|
29
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context
|
|
30
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
29
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context--QGWotXx.mjs";
|
|
30
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-Hr1kCoMX.mjs";
|
|
31
31
|
import { prepareModelRequestBody } from "./internal/model-request-body.mjs";
|
|
32
32
|
import { PROVIDER_MODEL_INPUT, resolveProviderContext } from "./provider-types.mjs";
|
|
33
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
33
|
+
import { t as createAssistantOutput } from "./assistant-output-C3czmoN4.mjs";
|
|
34
34
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
35
35
|
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
36
36
|
import "./types.mjs";
|
|
37
|
-
import { $ as isConfigurationUpdate, A as summarizeResponsesPayload, At as log, B as recordResponsesInputReplay, C as isInvalidEncryptedContentError, Ct as toOpenAIResponsesToolChoice, Dt as createResponseModelTracker, E as resolveNextResponsesEncryptedContentAttempt, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationPrefixFingerprint, H as claimOpenAIResponsesHttpContinuation, I as convertResponsesMessages, It as resolvePromptCacheKey, K as responsesContinuationRequestFingerprint, Lt as withOpenAIErrorResponseHook, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as observeResponsesTransportFailure, Ot as detachPartialSnapshot, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, S as createResponsesStreamWithRecovery, St as reconcileOpenAIResponsesToolChoice, T as resolveAzureOpenAIApiVersion, Tt as createOpenAIProviderAcceptanceHook, U as recordResponsesContinuationState, V as responsesInputFingerprint, W as resolveResponsesContinuationRequest, _t as resolveOpenAIRequestReasoning, a as prepareResponsesTools, bt as projectOpenAITools, c as observeResponsesStream, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, et as replayResponsesReasoningUpdates, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as safeDebugValue, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkClientOptions, n as applyResponsesServiceTierPricing, ot as suppressOpenAIResponsesCompaction, pt as getCompat, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, st as assertCodeModeResponsesToolSurface, tt as supportsResponsesReasoningUpdate, ut as buildOpenAISdkRequestOptions, vt as resolveOpenAISimpleReasoningEffort, w as readResponsesRecoveryEvent, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, xt as reconcileOpenAICompletionsToolChoice, yt as prepareOpenAITools, z as readResponsesInputReplayState } from "./openai-responses-shared-
|
|
38
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
37
|
+
import { $ as isConfigurationUpdate, A as summarizeResponsesPayload, At as log, B as recordResponsesInputReplay, C as isInvalidEncryptedContentError, Ct as toOpenAIResponsesToolChoice, Dt as createResponseModelTracker, E as resolveNextResponsesEncryptedContentAttempt, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationPrefixFingerprint, H as claimOpenAIResponsesHttpContinuation, I as convertResponsesMessages, It as resolvePromptCacheKey, K as responsesContinuationRequestFingerprint, Lt as withOpenAIErrorResponseHook, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as observeResponsesTransportFailure, Ot as detachPartialSnapshot, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, S as createResponsesStreamWithRecovery, St as reconcileOpenAIResponsesToolChoice, T as resolveAzureOpenAIApiVersion, Tt as createOpenAIProviderAcceptanceHook, U as recordResponsesContinuationState, V as responsesInputFingerprint, W as resolveResponsesContinuationRequest, _t as resolveOpenAIRequestReasoning, a as prepareResponsesTools, bt as projectOpenAITools, c as observeResponsesStream, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, et as replayResponsesReasoningUpdates, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as safeDebugValue, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkClientOptions, n as applyResponsesServiceTierPricing, ot as suppressOpenAIResponsesCompaction, pt as getCompat, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, st as assertCodeModeResponsesToolSurface, tt as supportsResponsesReasoningUpdate, ut as buildOpenAISdkRequestOptions, vt as resolveOpenAISimpleReasoningEffort, w as readResponsesRecoveryEvent, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, xt as reconcileOpenAICompletionsToolChoice, yt as prepareOpenAITools, z as readResponsesInputReplayState } from "./openai-responses-shared-En3Jf0Vg.mjs";
|
|
38
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-DyaOKAYm.mjs";
|
|
39
39
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B7RcufAV.mjs";
|
|
40
40
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
41
|
-
import { m as withPreparedToolSchemaNormalization, p as normalizeToolSchema, r as normalizeOpenAIStrictToolParameters, x as prepareOpenAIFunctionTool } from "./openai-tool-schema-
|
|
41
|
+
import { m as withPreparedToolSchemaNormalization, p as normalizeToolSchema, r as normalizeOpenAIStrictToolParameters, x as prepareOpenAIFunctionTool } from "./openai-tool-schema-CvxySRyf.mjs";
|
|
42
42
|
import { t as requiresReasoningContentReplay } from "./openai-completions-reasoning-replay-BwT1xwRI.mjs";
|
|
43
43
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
44
44
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
45
|
-
import { a as isOpenAIResponsesCompactionOutput, c as sanitizeResponsesImagePayload,
|
|
46
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
45
|
+
import { a as isOpenAIResponsesCompactionOutput, c as sanitizeResponsesImagePayload, i as getOpenAIResponsesCompactionOutputError, l as applyOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, p as resolveOpenAIResponsesPayloadPolicy, r as createBoundedOpenAIResponsesCompactionFetch, t as isOfficialOpenAIResponsesBaseUrl, u as enforceOpenAIResponsesCompactionReplayStorage } from "./openai-responses-endpoint-CqO3ejTe.mjs";
|
|
46
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-C_3FKkl7.mjs";
|
|
47
47
|
import { randomUUID } from "node:crypto";
|
|
48
48
|
import { isDeepStrictEqual } from "node:util";
|
|
49
49
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
@@ -1894,7 +1894,6 @@ function buildOpenAIResponsesParams(model, context, options, metadata, replayMod
|
|
|
1894
1894
|
const messages = convertResponsesMessages(model, context, OPENAI_RESPONSES_TOOL_CALL_PROVIDERS, {
|
|
1895
1895
|
includeSystemPrompt: !payloadPolicy.usesInstructionsField,
|
|
1896
1896
|
replayResponsesItemIds,
|
|
1897
|
-
authProfileId: options?.authProfileId,
|
|
1898
1897
|
mutableInput: Boolean(options?.onPayload),
|
|
1899
1898
|
sessionId: options?.sessionId,
|
|
1900
1899
|
replayMode,
|
|
@@ -2011,10 +2010,7 @@ async function postOpenAIResponsesCompaction(params) {
|
|
|
2011
2010
|
usage,
|
|
2012
2011
|
modelUsage,
|
|
2013
2012
|
model: params.model,
|
|
2014
|
-
replayMetadata: buildOpenAIResponsesReasoningReplayMetadata(params.model, {
|
|
2015
|
-
authProfileId: params.options?.authProfileId,
|
|
2016
|
-
sessionId: params.options?.sessionId
|
|
2017
|
-
})
|
|
2013
|
+
replayMetadata: buildOpenAIResponsesReasoningReplayMetadata(params.model, { sessionId: params.options?.sessionId })
|
|
2018
2014
|
};
|
|
2019
2015
|
}
|
|
2020
2016
|
//#endregion
|
|
@@ -2709,6 +2705,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
2709
2705
|
const preserveUsers = v2Compaction?.preserveUsers(request.input ?? []);
|
|
2710
2706
|
const nextParams = await options?.onPayload?.(params, model);
|
|
2711
2707
|
if (nextParams !== void 0) params = nextParams;
|
|
2708
|
+
enforceOpenAIResponsesCompactionReplayStorage(params, resolveOpenAIResponsesPayloadPolicy(model, { storeMode: "preserve" }));
|
|
2712
2709
|
if (preserveUsers) params = {
|
|
2713
2710
|
...params,
|
|
2714
2711
|
input: preserveUsers(params.input ?? [])
|
|
@@ -2903,10 +2900,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
2903
2900
|
abortFirstEventStream: firstEvent.abort,
|
|
2904
2901
|
onFirstEventTimeout: getFirstStreamEventTimeoutHandler(options),
|
|
2905
2902
|
signal: options?.signal,
|
|
2906
|
-
reasoningReplayMetadata: buildOpenAIResponsesReasoningReplayMetadata(model, {
|
|
2907
|
-
authProfileId: responsesOptions?.authProfileId,
|
|
2908
|
-
sessionId: options?.sessionId
|
|
2909
|
-
}),
|
|
2903
|
+
reasoningReplayMetadata: buildOpenAIResponsesReasoningReplayMetadata(model, { sessionId: options?.sessionId }),
|
|
2910
2904
|
asyncToolExecution: asyncTools,
|
|
2911
2905
|
...responseModelTracker.terminalOptions
|
|
2912
2906
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { r as isNativeOpenAIEndpoint } from "./openai-completions-compat-CS3dlDBR.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,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-3H_Fz0ya.mjs";
|
|
4
|
+
import { a as resolveOpenAICompletionsCompat } from "./openai-completions-compat-CS3dlDBR.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-CQNPKCEb.mjs";
|
|
7
7
|
import { n as getEnvApiKey } from "./env-api-keys-BuHc86ya.mjs";
|
|
8
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
9
|
-
import { F as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
10
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
8
|
+
import { t as createAssistantOutput } from "./assistant-output-C3czmoN4.mjs";
|
|
9
|
+
import { F as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-En3Jf0Vg.mjs";
|
|
10
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-DyaOKAYm.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({
|
|
@@ -47,7 +47,6 @@ const streamOpenAIResponses = (model, context, options) => {
|
|
|
47
47
|
const messages = convertProviderResponsesMessages(model, context, OPENAI_TOOL_CALL_PROVIDERS, {
|
|
48
48
|
replayResponsesItemIds: options?.replayResponsesItemIds ?? false,
|
|
49
49
|
sessionId: options?.sessionId,
|
|
50
|
-
authProfileId: options?.authProfileId,
|
|
51
50
|
mutableInput: Boolean(options?.onPayload),
|
|
52
51
|
replayMode
|
|
53
52
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as AssistantMessage, k as Model } from "./types-BVdTf0YV.mjs";
|
|
2
2
|
import "./index-Bczt0MnO.mjs";
|
|
3
|
-
import "./provider-options-
|
|
4
|
-
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-
|
|
3
|
+
import "./provider-options-BQ2Msop2.mjs";
|
|
4
|
+
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-Cb1IIRRG.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, outputTokens?: number): void;
|
package/dist/{openai-responses-contracts-BXMcvO7F.d.mts → openai-responses-contracts-Cb1IIRRG.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { N as ModelThinkingLevel, k as Model, n as Api } from "./types-BVdTf0YV.mjs";
|
|
2
2
|
import "./index-Bczt0MnO.mjs";
|
|
3
3
|
import "./types-Cb3-5WM9.mjs";
|
|
4
|
-
import { a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort } from "./provider-options-
|
|
4
|
+
import { a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort } from "./provider-options-BQ2Msop2.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-endpoint-DCkURKS0.mjs → openai-responses-endpoint-CqO3ejTe.mjs}
RENAMED
|
@@ -70,6 +70,7 @@ function resolveOpenAIResponsesPayloadCapabilities(model) {
|
|
|
70
70
|
allowsOpenAIServiceTier: provider === "openai" && (api === "openai-responses" || api === "openclaw-openai-responses-transport") || isOpenAIProvider && (api === "openai-chatgpt-responses" || api === "openclaw-openai-chatgpt-responses-transport") && endpointClass === "openai",
|
|
71
71
|
allowsResponsesStore: supportsResponsesStoreField && api !== "openai-chatgpt-responses" && api !== "openclaw-openai-chatgpt-responses-transport" && provider !== void 0 && OPENAI_RESPONSES_PROVIDERS.has(provider) && usesKnownNativeOpenAIEndpoint,
|
|
72
72
|
explicitContinuationOptIn,
|
|
73
|
+
requiresStatelessCompactionReplay: endpointClass === "openai-public" || isOpenAIProvider && endpointClass === "default",
|
|
73
74
|
shouldStripResponsesPromptCache,
|
|
74
75
|
supportsResponsesStoreField,
|
|
75
76
|
usesKnownNativeOpenAIRoute,
|
|
@@ -156,6 +157,7 @@ function resolveOpenAIResponsesPayloadPolicy(model, options = {}) {
|
|
|
156
157
|
defaultManagedReasoningEffort: capabilities.usesKnownNativeOpenAIRoute && !shouldStripDisabledReasoningPayload && model.provider !== "github-copilot" ? "none" : void 0,
|
|
157
158
|
explicitContinuationOptIn: capabilities.explicitContinuationOptIn,
|
|
158
159
|
explicitStore,
|
|
160
|
+
requiresStatelessCompactionReplay: capabilities.requiresStatelessCompactionReplay,
|
|
159
161
|
shouldStripDisabledReasoningPayload,
|
|
160
162
|
shouldStripInputStatus,
|
|
161
163
|
shouldStripPromptCache: options.enablePromptCacheStripping === true && capabilities.shouldStripResponsesPromptCache,
|
|
@@ -164,10 +166,19 @@ function resolveOpenAIResponsesPayloadPolicy(model, options = {}) {
|
|
|
164
166
|
usesInstructionsField
|
|
165
167
|
};
|
|
166
168
|
}
|
|
169
|
+
/** Enforce replay storage on the final input, including items introduced by payload hooks. */
|
|
170
|
+
function enforceOpenAIResponsesCompactionReplayStorage(payloadObj, policy) {
|
|
171
|
+
if (policy.requiresStatelessCompactionReplay && Array.isArray(payloadObj.input) && payloadObj.input.some((item) => isRecord(item) && item.type === "compaction")) {
|
|
172
|
+
if (policy.shouldStripStore) delete payloadObj.store;
|
|
173
|
+
else payloadObj.store = false;
|
|
174
|
+
delete payloadObj.previous_response_id;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
167
177
|
/** Mutate a Responses request payload according to the resolved endpoint policy. */
|
|
168
178
|
function applyOpenAIResponsesPayloadPolicy(payloadObj, policy) {
|
|
169
179
|
if (policy.explicitStore !== void 0) payloadObj.store = policy.explicitStore;
|
|
170
180
|
if (policy.shouldStripStore) delete payloadObj.store;
|
|
181
|
+
enforceOpenAIResponsesCompactionReplayStorage(payloadObj, policy);
|
|
171
182
|
if (policy.shouldStripPromptCache) {
|
|
172
183
|
delete payloadObj.prompt_cache_key;
|
|
173
184
|
delete payloadObj.prompt_cache_retention;
|
|
@@ -444,4 +455,4 @@ function supportsNativeOpenAIResponsesEndpoint(params) {
|
|
|
444
455
|
return params.provider.trim().toLowerCase() === "openai" && params.api === "openai-responses" && isOfficialOpenAIResponsesBaseUrl(params.baseUrl);
|
|
445
456
|
}
|
|
446
457
|
//#endregion
|
|
447
|
-
export { isOpenAIResponsesCompactionOutput as a, sanitizeResponsesImagePayload as c,
|
|
458
|
+
export { isOpenAIResponsesCompactionOutput as a, sanitizeResponsesImagePayload as c, normalizeOpenAIServiceTier as d, resolveOpenAIResponsesCompactEndpointPlan as f, resolveOpenAIResponsesServerCompactionPlan as h, getOpenAIResponsesCompactionOutputError as i, applyOpenAIResponsesPayloadPolicy as l, resolveOpenAIResponsesRequestContextTokens as m, supportsNativeOpenAIResponsesEndpoint as n, readOpenAIResponsesCompactionWindow as o, resolveOpenAIResponsesPayloadPolicy as p, createBoundedOpenAIResponsesCompactionFetch as r, buildResponsesInputImage as s, isOfficialOpenAIResponsesBaseUrl as t, enforceOpenAIResponsesCompactionReplayStorage as u };
|
|
@@ -15,6 +15,7 @@ type OpenAIResponsesPayloadPolicy = {
|
|
|
15
15
|
defaultManagedReasoningEffort: "none" | undefined;
|
|
16
16
|
explicitContinuationOptIn: boolean;
|
|
17
17
|
explicitStore: boolean | undefined;
|
|
18
|
+
requiresStatelessCompactionReplay: boolean;
|
|
18
19
|
shouldStripDisabledReasoningPayload: boolean;
|
|
19
20
|
shouldStripInputStatus: boolean;
|
|
20
21
|
shouldStripPromptCache: boolean;
|
|
@@ -44,7 +45,9 @@ declare function resolveOpenAIResponsesPayloadPolicy(model: OpenAIResponsesPaylo
|
|
|
44
45
|
enablePromptCacheStripping?: boolean;
|
|
45
46
|
enableServerCompaction?: boolean;
|
|
46
47
|
}): OpenAIResponsesPayloadPolicy;
|
|
48
|
+
/** Enforce replay storage on the final input, including items introduced by payload hooks. */
|
|
49
|
+
declare function enforceOpenAIResponsesCompactionReplayStorage(payloadObj: Record<string, unknown>, policy: Pick<OpenAIResponsesPayloadPolicy, "requiresStatelessCompactionReplay" | "shouldStripStore">): void;
|
|
47
50
|
/** Mutate a Responses request payload according to the resolved endpoint policy. */
|
|
48
51
|
declare function applyOpenAIResponsesPayloadPolicy(payloadObj: Record<string, unknown>, policy: OpenAIResponsesPayloadPolicy): void;
|
|
49
52
|
//#endregion
|
|
50
|
-
export {
|
|
53
|
+
export { resolveOpenAIResponsesCompactEndpointPlan as a, resolveOpenAIResponsesServerCompactionPlan as c, normalizeOpenAIServiceTier as i, applyOpenAIResponsesPayloadPolicy as n, resolveOpenAIResponsesPayloadPolicy as o, enforceOpenAIResponsesCompactionReplayStorage as r, resolveOpenAIResponsesRequestContextTokens as s, OpenAIServiceTier as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-BQaoiN3r.mjs";
|
|
2
2
|
import { p as RESPONSES_RETAINED_USER, v as responsesPromptObserver } from "./openai-responses-contracts-xU-n9AJJ.mjs";
|
|
3
3
|
import { n as estimateTokensFromChars, t as estimateStringChars } from "./src-BUsVkrNt.mjs";
|
|
4
|
-
import "./transport-utils-
|
|
4
|
+
import "./transport-utils-rxOHnq9y.mjs";
|
|
5
5
|
import { t as stableStringify } from "./stable-stringify-CchQEmeA.mjs";
|
|
6
|
-
import { y as prepareSystemPrompt } from "./simple-options-
|
|
7
|
-
import { C as sha256Hex } from "./tool-schema-json-projection-
|
|
8
|
-
import { rt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-
|
|
9
|
-
import { a as isOpenAIResponsesCompactionOutput, c as sanitizeResponsesImagePayload } from "./openai-responses-endpoint-
|
|
6
|
+
import { y as prepareSystemPrompt } from "./simple-options-CQNPKCEb.mjs";
|
|
7
|
+
import { C as sha256Hex } from "./tool-schema-json-projection-BSHb4gaJ.mjs";
|
|
8
|
+
import { rt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-En3Jf0Vg.mjs";
|
|
9
|
+
import { a as isOpenAIResponsesCompactionOutput, c as sanitizeResponsesImagePayload } from "./openai-responses-endpoint-CqO3ejTe.mjs";
|
|
10
10
|
//#region packages/ai/src/transports/openai-responses-compact-request.ts
|
|
11
11
|
const COMPACT_REQUEST = Symbol("openaiResponsesCompactRequest");
|
|
12
12
|
function claimResponsesCompactRequest(options) {
|
|
@@ -6,30 +6,30 @@ import { i as asOptionalRecord, o as isRecord, s as isStringArray } from "./reco
|
|
|
6
6
|
import { l as readStringValue, o as normalizeOptionalString, r as normalizeLowercaseStringOrEmpty, s as normalizeStringifiedOptionalString } from "./string-coerce-BCuWMIrk.mjs";
|
|
7
7
|
import { t as asFiniteNumber } from "./number-coercion-C7HsBgUL.mjs";
|
|
8
8
|
import { t as observeAsyncIterator } from "./observe-async-iterator-DgmegcZR.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { A as applyProviderReportedUsageCost, I as isImageWithMediaPayload, M as clampThinkingLevel, a as resolveAiTransportHeaderSentinels, j as calculateCost, k as headersToRecord, r as getAiTransportHost } from "./host-DqX-64Pb.mjs";
|
|
10
10
|
import { A as resolveOpenAIReasoningEffortMapping, D as normalizeOpenAIReasoningEffort, F as MODEL_CATALOG_THINKING_LEVELS, M as supportsOpenAIReasoningEffort, N as supportsOpenAITemperature, O as resolveOpenAIModelReasoningEfforts, P as resolveOpenAIReasoningEffortMap, R as resolveOpenAIThinkingApi, a as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, b as isResponsesServiceTierRejection, c as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, g as isResponsesTerminalEventType, h as isPreviousResponseRejection, i as OPENAI_RESPONSES_APIS, k as resolveOpenAIReasoningEffortForModel, l as OPENAI_RESPONSES_TOOL_CALL_PROVIDERS, m as RESPONSE_FAILED_NO_DETAILS_MESSAGE, o as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, p as RESPONSES_RETAINED_USER, s as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY, x as nextResponsesServiceTier, y as responsesServiceTierObserver } from "./openai-responses-contracts-xU-n9AJJ.mjs";
|
|
11
11
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
12
12
|
import { r as readTransportDiagnosticLabel } from "./provider-error-DD-fo4Rz.mjs";
|
|
13
13
|
import "./src-BUsVkrNt.mjs";
|
|
14
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
14
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-3H_Fz0ya.mjs";
|
|
15
15
|
import { a as resolveModelPayloadDebugMode, b as resolveResponsesTerminalStopReason, d as ResponsesOutputIdentityError, f as countToolCallTrailingWhitespace, g as applyResponsesCacheWritePricing, i as emitModelTransportError, m as isResponsesProviderTool, p as hasOnlyResponsesFunctionTools, r as emitModelTransportDebug, v as mapResponsesTerminalUsage, y as readResponsesReasoningTokens } from "./diagnostics-CloVGQiK.mjs";
|
|
16
|
-
import { n as isCodeModeModelVisibleToolName } from "./transport-utils-
|
|
16
|
+
import { n as isCodeModeModelVisibleToolName } from "./transport-utils-rxOHnq9y.mjs";
|
|
17
17
|
import { t as stableStringify } from "./stable-stringify-CchQEmeA.mjs";
|
|
18
|
-
import { a as resolveOpenAICompletionsCompat, n as isKnownOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-
|
|
19
|
-
import { r as resolveModelRequestTimeoutMs } from "./host-policy-
|
|
18
|
+
import { a as resolveOpenAICompletionsCompat, n as isKnownOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, u as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-CS3dlDBR.mjs";
|
|
19
|
+
import { r as resolveModelRequestTimeoutMs } from "./host-policy-Bk85E9ue.mjs";
|
|
20
20
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-w-ICeyOI.mjs";
|
|
21
|
-
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, f as preparedRequestSuffix, r as clampMaxTokensToModel, s as extractToolResultBlockText, u as codeModeToolSurfaceObserver, y as prepareSystemPrompt } from "./simple-options-
|
|
22
|
-
import { A as parseStreamingJson, C as withProviderResponseHook, D as shortHash, O as createToolArgumentPreviewSchedule, _ as parseTerminalToolCallArguments, c as failTransportStream, d as iterateModelStream, h as notifyProviderHttpResponse, s as decodeSseFrames, t as IncompleteToolCallError, u as finalizeTransportStream, w as parseJsonObjectPreservingUnsafeIntegers, x as transportAbortError, y as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
23
|
-
import { C as sha256Hex, S as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256StableValue } from "./tool-schema-json-projection-
|
|
21
|
+
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, f as preparedRequestSuffix, r as clampMaxTokensToModel, s as extractToolResultBlockText, u as codeModeToolSurfaceObserver, y as prepareSystemPrompt } from "./simple-options-CQNPKCEb.mjs";
|
|
22
|
+
import { A as parseStreamingJson, C as withProviderResponseHook, D as shortHash, O as createToolArgumentPreviewSchedule, _ as parseTerminalToolCallArguments, c as failTransportStream, d as iterateModelStream, h as notifyProviderHttpResponse, s as decodeSseFrames, t as IncompleteToolCallError, u as finalizeTransportStream, w as parseJsonObjectPreservingUnsafeIntegers, x as transportAbortError, y as sanitizeTransportPayloadText } from "./transport-stream-shared-CBVh6QEc.mjs";
|
|
23
|
+
import { C as sha256Hex, S as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256StableValue } from "./tool-schema-json-projection-BSHb4gaJ.mjs";
|
|
24
24
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-DzaHoRAU.mjs";
|
|
25
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context
|
|
26
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
25
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context--QGWotXx.mjs";
|
|
26
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-Hr1kCoMX.mjs";
|
|
27
27
|
import { prepareModelRequestBody } from "./internal/model-request-body.mjs";
|
|
28
|
-
import "./assistant-output-
|
|
28
|
+
import "./assistant-output-C3czmoN4.mjs";
|
|
29
29
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
30
30
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B7RcufAV.mjs";
|
|
31
|
-
import { a as resolveOpenAIProjectedToolsStrictToolFlag, m as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics, x as prepareOpenAIFunctionTool } from "./openai-tool-schema-
|
|
32
|
-
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, s as buildResponsesInputImage } from "./openai-responses-endpoint-
|
|
31
|
+
import { a as resolveOpenAIProjectedToolsStrictToolFlag, m as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics, x as prepareOpenAIFunctionTool } from "./openai-tool-schema-CvxySRyf.mjs";
|
|
32
|
+
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, s as buildResponsesInputImage } from "./openai-responses-endpoint-CqO3ejTe.mjs";
|
|
33
33
|
import { randomUUID } from "node:crypto";
|
|
34
34
|
import { isDeepStrictEqual } from "node:util";
|
|
35
35
|
import { isProxy } from "node:util/types";
|
|
@@ -801,7 +801,6 @@ function captureOpenAIResponsesCompaction(output, item, boundary, model, capture
|
|
|
801
801
|
model: metadata.model,
|
|
802
802
|
baseUrlHash: metadata.baseUrlHash,
|
|
803
803
|
...metadata.sessionHash ? { sessionHash: metadata.sessionHash } : {},
|
|
804
|
-
...metadata.authProfileHash ? { authProfileHash: metadata.authProfileHash } : {},
|
|
805
804
|
...compactedOutput ? { compactedWindow: {
|
|
806
805
|
state: "ready",
|
|
807
806
|
output: JSON.stringify(compactedOutput),
|
|
@@ -1624,10 +1623,7 @@ function convertResponsesMessagesWithStyle(model, context, allowedToolCallProvid
|
|
|
1624
1623
|
const messages = [];
|
|
1625
1624
|
const providerStyle = conversionStyle === "provider";
|
|
1626
1625
|
const shouldReplayResponsesItemIds = options?.replayResponsesItemIds ?? true;
|
|
1627
|
-
const replayContext = buildProviderReplayContext(model, {
|
|
1628
|
-
sessionId: options?.sessionId,
|
|
1629
|
-
authProfileId: options?.authProfileId
|
|
1630
|
-
});
|
|
1626
|
+
const replayContext = buildProviderReplayContext(model, { sessionId: options?.sessionId });
|
|
1631
1627
|
const shouldNormalizeSameModelToolCallIds = model.provider === "github-copilot";
|
|
1632
1628
|
const sanitizeIdPart = (part) => {
|
|
1633
1629
|
const sanitized = part.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
@@ -1655,7 +1651,6 @@ function convertResponsesMessagesWithStyle(model, context, allowedToolCallProvid
|
|
|
1655
1651
|
};
|
|
1656
1652
|
const replayPlan = buildOpenAIResponsesCompactionReplayPlan(context.messages, model, {
|
|
1657
1653
|
sessionId: options?.sessionId,
|
|
1658
|
-
authProfileId: options?.authProfileId,
|
|
1659
1654
|
mode: options?.replayMode
|
|
1660
1655
|
});
|
|
1661
1656
|
const transformMessages = (source) => providerStyle ? transformProviderMessages(source, model, normalizeToolCallId) : getAiTransportHost().transformTransportMessages(source, model, normalizeToolCallId, {
|
|
@@ -3731,10 +3726,7 @@ async function runResponsesStreamLifecycle(params) {
|
|
|
3731
3726
|
resolveServiceTier: (responseTier, originalTier) => responseTier ?? (requestedTier === "priority" || requestedTier === "default" ? requestedTier : originalTier),
|
|
3732
3727
|
onServiceTier: (responseTier, response) => responsesServiceTierObserver.observe(options, requestedTier, responseTier, response),
|
|
3733
3728
|
canRetryIdentityConflict: () => hasOnlyResponsesFunctionTools(admittedRequest),
|
|
3734
|
-
reasoningReplayMetadata: buildOpenAIResponsesReasoningReplayMetadata(model, {
|
|
3735
|
-
sessionId: options?.sessionId,
|
|
3736
|
-
authProfileId: options?.authProfileId
|
|
3737
|
-
})
|
|
3729
|
+
reasoningReplayMetadata: buildOpenAIResponsesReasoningReplayMetadata(model, { sessionId: options?.sessionId })
|
|
3738
3730
|
});
|
|
3739
3731
|
if (terminal && admittedRequest && !options?.signal?.aborted) recordResponsesContextUsage(output, model, options, admittedRequest, terminal.output, "provider");
|
|
3740
3732
|
finalizeTransportStream({
|
|
@@ -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-BSHb4gaJ.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-function-tool.ts
|
|
7
7
|
function prepareOpenAIFunctionTool(name, description, parameters, strict, mutableParameters = false) {
|
|
8
8
|
const descriptor = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as registerTracerProvider, i as getRegisteredTracerProvider, n as completionChunkFromJSON, r as UsageInfo$outboundSchema } from "./mistral-
|
|
1
|
+
import { a as registerTracerProvider, i as getRegisteredTracerProvider, n as completionChunkFromJSON, r as UsageInfo$outboundSchema } from "./mistral-DIGInqJI.mjs";
|
|
2
2
|
import { SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
3
3
|
import { ATTR_ERROR_TYPE, ATTR_GEN_AI_AGENT_DESCRIPTION, ATTR_GEN_AI_AGENT_ID, ATTR_GEN_AI_AGENT_NAME, ATTR_GEN_AI_CONVERSATION_ID, ATTR_GEN_AI_INPUT_MESSAGES, ATTR_GEN_AI_OPERATION_NAME, ATTR_GEN_AI_OUTPUT_MESSAGES, ATTR_GEN_AI_PROVIDER_NAME, ATTR_GEN_AI_REQUEST_CHOICE_COUNT, ATTR_GEN_AI_REQUEST_ENCODING_FORMATS, ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY, ATTR_GEN_AI_REQUEST_MAX_TOKENS, ATTR_GEN_AI_REQUEST_MODEL, ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY, ATTR_GEN_AI_REQUEST_SEED, ATTR_GEN_AI_REQUEST_STOP_SEQUENCES, ATTR_GEN_AI_REQUEST_TEMPERATURE, ATTR_GEN_AI_REQUEST_TOP_K, ATTR_GEN_AI_REQUEST_TOP_P, ATTR_GEN_AI_RESPONSE_FINISH_REASONS, ATTR_GEN_AI_RESPONSE_ID, ATTR_GEN_AI_RESPONSE_MODEL, ATTR_GEN_AI_SYSTEM_INSTRUCTIONS, ATTR_GEN_AI_TOOL_CALL_ARGUMENTS, ATTR_GEN_AI_TOOL_CALL_ID, ATTR_GEN_AI_TOOL_CALL_RESULT, ATTR_GEN_AI_TOOL_DEFINITIONS, ATTR_GEN_AI_TOOL_NAME, ATTR_GEN_AI_TOOL_TYPE, ATTR_GEN_AI_USAGE_INPUT_TOKENS, ATTR_GEN_AI_USAGE_OUTPUT_TOKENS, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, GEN_AI_OPERATION_NAME_VALUE_CHAT, GEN_AI_OPERATION_NAME_VALUE_CREATE_AGENT, GEN_AI_OPERATION_NAME_VALUE_EMBEDDINGS, GEN_AI_OPERATION_NAME_VALUE_EXECUTE_TOOL, GEN_AI_OPERATION_NAME_VALUE_GENERATE_CONTENT, GEN_AI_OPERATION_NAME_VALUE_INVOKE_AGENT, GEN_AI_OPERATION_NAME_VALUE_TEXT_COMPLETION, GEN_AI_PROVIDER_NAME_VALUE_MISTRAL_AI } from "@opentelemetry/semantic-conventions/incubating";
|
|
4
4
|
//#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/extra/observability/formatting.js
|
|
@@ -143,6 +143,12 @@ type AnthropicContextManagementOptions = {
|
|
|
143
143
|
};
|
|
144
144
|
/** Provider options shared by the Anthropic provider and canonical transport. */
|
|
145
145
|
interface AnthropicOptions extends StreamOptions, AnthropicContextManagementOptions {
|
|
146
|
+
/**
|
|
147
|
+
* Called when Anthropic rejected an OAuth request with claude_code_version_too_old
|
|
148
|
+
* and the transport adopted the version it named. Owners persist it so the next
|
|
149
|
+
* process starts at that version instead of being rejected again.
|
|
150
|
+
*/
|
|
151
|
+
onClaudeCodeVersionRequired?: (version: string) => void;
|
|
146
152
|
/**
|
|
147
153
|
* Enable extended thinking.
|
|
148
154
|
* For Opus 4.6+ and Sonnet 4.6: uses adaptive thinking (model decides when/how much to think).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-BQaoiN3r.mjs";
|
|
2
|
-
import { D as shortHash } from "./transport-stream-shared-
|
|
2
|
+
import { D as shortHash } from "./transport-stream-shared-CBVh6QEc.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/provider-replay-context.ts
|
|
4
4
|
function isProviderReplayContext(value) {
|
|
5
5
|
return isRecord(value) && typeof value.provider === "string" && typeof value.api === "string" && typeof value.model === "string" && (value.baseUrlHash === void 0 || typeof value.baseUrlHash === "string") && (value.sessionHash === void 0 || typeof value.sessionHash === "string") && (value.authProfileHash === void 0 || typeof value.authProfileHash === "string");
|
|
@@ -14,12 +14,11 @@ function buildProviderReplayContext(model, options) {
|
|
|
14
14
|
api: model.api,
|
|
15
15
|
model: model.id,
|
|
16
16
|
baseUrlHash: hashReplayContextValue(model.baseUrl),
|
|
17
|
-
sessionHash: hashReplayContextValue(options?.sessionId)
|
|
18
|
-
authProfileHash: hashReplayContextValue(options?.authProfileId)
|
|
17
|
+
sessionHash: hashReplayContextValue(options?.sessionId)
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
function providerReplayContextMatches(state, context) {
|
|
22
|
-
return state.provider === context.provider && state.api === context.api && state.
|
|
21
|
+
return state.provider === context.provider && state.api === context.api && state.baseUrlHash === context.baseUrlHash && state.sessionHash === context.sessionHash;
|
|
23
22
|
}
|
|
24
23
|
//#endregion
|
|
25
24
|
export { isProviderReplayContext as n, providerReplayContextMatches as r, buildProviderReplayContext as t };
|