@openclaw/ai 2026.10.10 → 2026.11.2
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-B54Ts1tV.mjs → anthropic-CUVqVXTe.mjs} +6 -6
- package/dist/{anthropic-stream-reducer-C__ByTq1.mjs → anthropic-stream-reducer-yWDb5Cct.mjs} +8 -8
- package/dist/{anthropic-tool-projection-DA_KeluM.mjs → anthropic-tool-projection-DZOKfAmL.mjs} +1 -1
- package/dist/{assistant-output-DbgdWAhJ.mjs → assistant-output-BnQm3fov.mjs} +3 -3
- package/dist/{azure-openai-responses-DHzTwi-y.mjs → azure-openai-responses-I97-HnAv.mjs} +4 -4
- package/dist/{diagnostics-Cv7cW3pS.mjs → diagnostics-v7oVEW59.mjs} +17 -1
- package/dist/diagnostics.mjs +1 -1
- package/dist/{google-CZ6uGVkV.mjs → google-Cpi_cLKZ.mjs} +2 -2
- package/dist/{google-interactions-qd4flmND.mjs → google-interactions-BYRQ49MR.mjs} +91 -30
- package/dist/{google-messages-B-svbJuN.mjs → google-messages-DQMgG5yG.mjs} +9 -3
- package/dist/{google-provider-stream-DlhaCvCf.mjs → google-provider-stream-BHd0cST9.mjs} +16 -11
- package/dist/{google-shared-Cif7nve-.mjs → google-shared-vtag8bj5.mjs} +6 -5
- package/dist/{google-vertex-BZTcYnWU.mjs → google-vertex-eKoUnW7N.mjs} +2 -2
- package/dist/google-video-slots-D8tPH8wX.mjs +29 -0
- package/dist/{host-rCxf5Tjd.mjs → host-CWt55nnF.mjs} +12 -8
- package/dist/{host-policy-Ci1cKluf.mjs → host-policy-Dm7PM6AD.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +2 -2
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-completions-compat.d.mts +4 -0
- package/dist/internal/openai-completions-compat.mjs +3 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.mjs +9 -9
- package/dist/internal/retry-after.d.mts +2 -2
- package/dist/internal/retry-after.mjs +75 -1
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.mjs +2 -2
- package/dist/internal/tool-schema.mjs +3 -3
- package/dist/{mistral-C_ImzxlK.mjs → mistral-CQ7aoWg2.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-iGYDPbmc.mjs → openai-chatgpt-responses-DgDVhpUI.mjs} +12 -12
- package/dist/{openai-completions-CDy5u1mv.mjs → openai-completions-BdfBhFjx.mjs} +3 -3
- package/dist/{openai-completions-compat-CJ0OXZgi.mjs → openai-completions-compat-bNQXF1y9.mjs} +2 -2
- package/dist/openai-completions-reasoning-replay-BwT1xwRI.mjs +45 -0
- package/dist/{openai-completions-transport-DLrm5EWi.mjs → openai-completions-transport-CnFaKYO-.mjs} +21 -64
- package/dist/{openai-prompt-cache-h8vXRiaH.mjs → openai-prompt-cache-B9AvdoEo.mjs} +1 -1
- package/dist/{openai-responses-Cp2QPq7K.mjs → openai-responses-5KI4v8DN.mjs} +6 -6
- package/dist/{openai-responses-contracts-DCG51Us0.mjs → openai-responses-contracts-B5mGAbR6.mjs} +1 -1
- package/dist/{openai-responses-endpoint-JbBT8IDv.mjs → openai-responses-endpoint-CfKR6N5f.mjs} +1 -1
- package/dist/{openai-responses-request-lifecycle-DuMpdA6y.mjs → openai-responses-request-lifecycle-WKXjj_th.mjs} +7 -7
- package/dist/{openai-responses-shared-CNfHudFg.mjs → openai-responses-shared-iWBHb0Sq.mjs} +48 -17
- package/dist/{openai-tool-schema-CGhEl7ao.mjs → openai-tool-schema-BTEU2xmN.mjs} +2 -2
- package/dist/{provider-replay-context-BC23HyZo.mjs → provider-replay-context-4vxI7p4V.mjs} +1 -1
- package/dist/{provider-transport-turn-state-B11rmZpv.mjs → provider-transport-turn-state-BbaD56A1.mjs} +2 -2
- package/dist/{provider-types-ODq57rG_.d.mts → provider-types-CWl4VXvE.d.mts} +3 -1
- package/dist/provider-types.d.mts +2 -2
- package/dist/provider-types.mjs +2 -1
- package/dist/providers.mjs +10 -10
- package/dist/retry-after-BrmTv0jL.d.mts +25 -0
- package/dist/{simple-options-BdJJbzZk.mjs → simple-options-xJkqrG_E.mjs} +3 -3
- package/dist/{stream-DQqGjhbq.mjs → stream-C4YDqhFj.mjs} +1 -1
- package/dist/{tool-schema-json-projection-Cvq69Ajp.mjs → tool-schema-json-projection-B1sTYwfH.mjs} +1 -1
- package/dist/{transport-stream-shared-DdnJGEj0.mjs → transport-stream-shared-lhgkTOz3.mjs} +2 -2
- package/dist/{transport-utils-CcCAuFVS.mjs → transport-utils-DwOpuTjL.mjs} +2 -2
- package/dist/transports.d.mts +11 -2
- package/dist/transports.mjs +16 -15
- package/package.json +1 -1
- package/dist/retry-after-sw-XX8aC.d.mts +0 -15
|
@@ -5,26 +5,26 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
5
5
|
import { o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
6
6
|
import { l as readStringValue, o as normalizeOptionalString, r as normalizeLowercaseStringOrEmpty, s as normalizeStringifiedOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
7
7
|
import { t as asFiniteNumber } from "./number-coercion-37gmNkuA.mjs";
|
|
8
|
-
import { D as applyProviderReportedUsageCost, E as headersToRecord, N as isImageWithMediaPayload, O as calculateCost, a as resolveAiTransportHeaderSentinels, k as clampThinkingLevel, r as getAiTransportHost } from "./host-
|
|
9
|
-
import { A as supportsOpenAIReasoningEffort, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts,
|
|
8
|
+
import { D as applyProviderReportedUsageCost, E as headersToRecord, N as isImageWithMediaPayload, O as calculateCost, a as resolveAiTransportHeaderSentinels, k as clampThinkingLevel, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
9
|
+
import { A as supportsOpenAIReasoningEffort, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, L as resolveOpenAIThinkingApi, O as resolveOpenAIReasoningEffortMapping, P as MODEL_CATALOG_THINKING_LEVELS, T as normalizeOpenAIReasoningEffort, _ as responsesServiceTierObserver, a as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, c as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, f as RESPONSES_RETAINED_USER, i as OPENAI_RESPONSES_APIS, j as supportsOpenAITemperature, m as isPreviousResponseRejection, o as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, p as RESPONSE_FAILED_NO_DETAILS_MESSAGE, s as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY, v as isResponsesServiceTierRejection, y as nextResponsesServiceTier } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
10
10
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
12
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
13
|
-
import { _ as
|
|
14
|
-
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-
|
|
15
|
-
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-
|
|
16
|
-
import { r as resolveModelRequestTimeoutMs } from "./host-policy-
|
|
12
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
13
|
+
import { _ as mapResponsesTerminalUsage, a as resolveModelPayloadDebugMode, d as ResponsesOutputIdentityError, f as countToolCallTrailingWhitespace, m as isResponsesProviderTool, p as hasOnlyResponsesFunctionTools, r as emitModelTransportDebug, v as readResponsesReasoningTokens, y as resolveResponsesTerminalStopReason } from "./diagnostics-v7oVEW59.mjs";
|
|
14
|
+
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-DwOpuTjL.mjs";
|
|
15
|
+
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
16
|
+
import { r as resolveModelRequestTimeoutMs } from "./host-policy-Dm7PM6AD.mjs";
|
|
17
17
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
18
|
-
import { d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
19
|
-
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, m as notifyProviderHttpResponse, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
20
|
-
import { C as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256Hex } from "./tool-schema-json-projection-
|
|
21
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
22
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
18
|
+
import { d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
19
|
+
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, m as notifyProviderHttpResponse, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
20
|
+
import { C as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256Hex } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
21
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-4vxI7p4V.mjs";
|
|
22
|
+
import { n as transformProviderMessages } from "./assistant-output-BnQm3fov.mjs";
|
|
23
23
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
24
24
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
25
25
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D_TfJHRJ.mjs";
|
|
26
|
-
import { a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-
|
|
27
|
-
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow } from "./openai-responses-endpoint-
|
|
26
|
+
import { a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-BTEU2xmN.mjs";
|
|
27
|
+
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow } from "./openai-responses-endpoint-CfKR6N5f.mjs";
|
|
28
28
|
import { randomUUID } from "node:crypto";
|
|
29
29
|
import { Stream } from "openai/core/streaming";
|
|
30
30
|
//#region packages/ai/src/transports/openai-transport-shared.ts
|
|
@@ -2085,11 +2085,11 @@ function summarizeResponsesPayload(params) {
|
|
|
2085
2085
|
if (resolveModelPayloadDebugMode() === "full-redacted") parts.push(`payload=${stringifyRedactedPayload(record)}`);
|
|
2086
2086
|
return parts.join(" ");
|
|
2087
2087
|
}
|
|
2088
|
-
function summarizeOpenAITransportError(error) {
|
|
2088
|
+
function summarizeOpenAITransportError(error, signal) {
|
|
2089
2089
|
if (!error || typeof error !== "object") return `type=${typeof error} message=${safeDebugValue(error)}`;
|
|
2090
2090
|
const record = error;
|
|
2091
2091
|
const cause = record.cause && typeof record.cause === "object" ? record.cause : void 0;
|
|
2092
|
-
|
|
2092
|
+
const parts = [
|
|
2093
2093
|
`name=${safeDebugValue(record.name)}`,
|
|
2094
2094
|
`status=${safeDebugValue(record.status)}`,
|
|
2095
2095
|
`code=${safeDebugValue(record.code)}`,
|
|
@@ -2097,7 +2097,35 @@ function summarizeOpenAITransportError(error) {
|
|
|
2097
2097
|
`causeName=${safeDebugValue(cause?.name)}`,
|
|
2098
2098
|
`causeCode=${safeDebugValue(cause?.code)}`,
|
|
2099
2099
|
`message=${error instanceof Error ? error.message : safeDebugValue(error)}`
|
|
2100
|
-
]
|
|
2100
|
+
];
|
|
2101
|
+
if (signal?.aborted) {
|
|
2102
|
+
const reason = isRecord(signal.reason) ? signal.reason : void 0;
|
|
2103
|
+
let abortReason = reason?.name === "TimeoutError" ? "request_deadline" : "caller_abort";
|
|
2104
|
+
switch (reason?.code ?? reason?.name) {
|
|
2105
|
+
case "LlmIdleTimeoutError":
|
|
2106
|
+
abortReason = "idle_timeout";
|
|
2107
|
+
break;
|
|
2108
|
+
case "LlmNoProgressError":
|
|
2109
|
+
abortReason = "no_progress";
|
|
2110
|
+
break;
|
|
2111
|
+
case "FirstStreamEventTimeoutError":
|
|
2112
|
+
abortReason = "first_event_timeout";
|
|
2113
|
+
break;
|
|
2114
|
+
case "OPENCLAW_SESSION_WATCHDOG":
|
|
2115
|
+
abortReason = "session_watchdog";
|
|
2116
|
+
break;
|
|
2117
|
+
case "degenerate_output":
|
|
2118
|
+
abortReason = "degenerate_output";
|
|
2119
|
+
break;
|
|
2120
|
+
case "OPENCLAW_RESTART_ABORT":
|
|
2121
|
+
case "ERR_STALE_GATEWAY_LIFECYCLE":
|
|
2122
|
+
abortReason = "restart";
|
|
2123
|
+
break;
|
|
2124
|
+
case "AGENT_RUN_SUPERSEDED_ABORT": abortReason = "superseded";
|
|
2125
|
+
}
|
|
2126
|
+
parts.push(`abortReason=${abortReason}`);
|
|
2127
|
+
}
|
|
2128
|
+
return parts.join(" ");
|
|
2101
2129
|
}
|
|
2102
2130
|
//#endregion
|
|
2103
2131
|
//#region packages/ai/src/transports/openai-responses-replay-internal.ts
|
|
@@ -3104,6 +3132,7 @@ async function processResponsesStream(openaiStream, output, sink, model, options
|
|
|
3104
3132
|
argumentStreamReliable: true,
|
|
3105
3133
|
argumentsStreamed: false,
|
|
3106
3134
|
previewSchedule: createToolArgumentPreviewSchedule(),
|
|
3135
|
+
trailingWhitespaceChars: countToolCallTrailingWhitespace(toolCallBlock.partialJson),
|
|
3107
3136
|
...readResponsesToolCallItemIdentity(item)
|
|
3108
3137
|
};
|
|
3109
3138
|
streamingToolCalls.register(event, toolCallState);
|
|
@@ -3178,6 +3207,7 @@ async function processResponsesStream(openaiStream, output, sink, model, options
|
|
|
3178
3207
|
}
|
|
3179
3208
|
let delta;
|
|
3180
3209
|
if (event.type === "response.function_call_arguments.delta") {
|
|
3210
|
+
toolCall.trailingWhitespaceChars = countToolCallTrailingWhitespace(event.delta, toolCall.trailingWhitespaceChars);
|
|
3181
3211
|
toolCall.block.partialJson += event.delta;
|
|
3182
3212
|
toolCall.argumentsStreamed = true;
|
|
3183
3213
|
if (toolCall.previewSchedule(toolCall.block.partialJson.length)) toolCall.block.arguments = parseStreamingJson(toolCall.block.partialJson);
|
|
@@ -3186,6 +3216,7 @@ async function processResponsesStream(openaiStream, output, sink, model, options
|
|
|
3186
3216
|
const previousPartialJson = toolCall.block.partialJson;
|
|
3187
3217
|
const doneArguments = typeof event.arguments === "string" ? event.arguments : void 0;
|
|
3188
3218
|
if (doneArguments !== void 0 && (doneArguments.length > 0 || previousPartialJson === "")) {
|
|
3219
|
+
toolCall.trailingWhitespaceChars = countToolCallTrailingWhitespace(doneArguments);
|
|
3189
3220
|
toolCall.block.partialJson = doneArguments;
|
|
3190
3221
|
toolCall.block.arguments = parseStreamingJson(toolCall.block.partialJson);
|
|
3191
3222
|
toolCall.argumentStreamReliable = true;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-9FSkE8T-.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { M as normalizeStringEntries,
|
|
5
|
-
import { S as walkSchemaValue, _ as SCHEMA_MAP_KEYS, a as SCHEMA_LITERAL_KEYS, b as evaluateSchemaWalk, c as inlineLocalToolSchemaRefs, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, l as setOwnSchemaProperty, m as truncateToolSchemaDepth, o as canPreserveRootSchemaRefs, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_NESTED_KEYS, x as walkSchemaArray, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-
|
|
4
|
+
import { M as normalizeStringEntries, N as uniqueValues } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
5
|
+
import { S as walkSchemaValue, _ as SCHEMA_MAP_KEYS, a as SCHEMA_LITERAL_KEYS, b as evaluateSchemaWalk, c as inlineLocalToolSchemaRefs, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, l as setOwnSchemaProperty, m as truncateToolSchemaDepth, o as canPreserveRootSchemaRefs, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_NESTED_KEYS, x as walkSchemaArray, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-function-tool.ts
|
|
7
7
|
const preparedTools = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
const MAX_DESCRIPTOR_VARIANTS = 8;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { A as shortHash } from "./transport-stream-shared-
|
|
2
|
+
import { A as shortHash } from "./transport-stream-shared-lhgkTOz3.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");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
2
2
|
import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-Dttf8jKq.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
|
-
import { It as resolveOpenAIClientBaseUrl, Rt as withOpenAIErrorResponseHook } from "./openai-responses-shared-
|
|
4
|
+
import { It as resolveOpenAIClientBaseUrl, Rt as withOpenAIErrorResponseHook } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import OpenAI from "openai";
|
|
7
7
|
//#region packages/ai/src/providers/openai-provider-client.ts
|
|
@@ -3,6 +3,7 @@ import { a as AssistantMessage, d as Context, dt as ToolResultMessage, k as Mode
|
|
|
3
3
|
import "./types-CBJthzJX.mjs";
|
|
4
4
|
//#region packages/ai/src/provider-types.d.ts
|
|
5
5
|
declare const PROVIDER_CONTEXT_HANDOFF: unique symbol;
|
|
6
|
+
declare const PROVIDER_MODEL_INPUT: unique symbol;
|
|
6
7
|
type VideoContent = Omit<ImageContent, "type"> & {
|
|
7
8
|
type: "video";
|
|
8
9
|
};
|
|
@@ -21,9 +22,10 @@ type ProviderModel<TApi extends Api = Api> = Omit<Model<TApi>, "input"> & {
|
|
|
21
22
|
type ProviderContextHandoff = () => Promise<ProviderContext>;
|
|
22
23
|
type ProviderStreamOptions = StreamOptions & {
|
|
23
24
|
[PROVIDER_CONTEXT_HANDOFF]?: ProviderContextHandoff;
|
|
25
|
+
[PROVIDER_MODEL_INPUT]?: ProviderModel["input"];
|
|
24
26
|
};
|
|
25
27
|
type ProviderStreamFunction<TApi extends Api = Api, TOptions extends StreamOptions = ProviderStreamOptions> = (model: ProviderModel<TApi>, context: ProviderContext, options?: TOptions) => AssistantMessageEventStreamContract;
|
|
26
28
|
/** Resolves provider-only context without widening the canonical call contract. */
|
|
27
29
|
declare function resolveProviderContext(context: Context | ProviderContext, options?: ProviderStreamOptions): Promise<ProviderContext>;
|
|
28
30
|
//#endregion
|
|
29
|
-
export {
|
|
31
|
+
export { ProviderContext as a, ProviderModel as c, ProviderUserMessage as d, VideoContent as f, PROVIDER_MODEL_INPUT as i, ProviderStreamFunction as l, ModelInputContent as n, ProviderContextHandoff as o, resolveProviderContext as p, PROVIDER_CONTEXT_HANDOFF as r, ProviderMessage as s, MediaContent as t, ProviderStreamOptions as u };
|
|
@@ -2,5 +2,5 @@ import { A as supportsClaudeInHistorySystemMessages, C as resolveClaudeOpus55Mod
|
|
|
2
2
|
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-CVYzKrMl.mjs";
|
|
3
3
|
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CzpE1g_o.mjs";
|
|
4
4
|
import { n as validateToolCall, t as validateToolArguments } from "./validation-BQ5u20Ru.mjs";
|
|
5
|
-
import { a as
|
|
6
|
-
export { type AnthropicMessagesCompat, type Api, type AssistantDeliveryTtsFacts, type AssistantImages, type AssistantMessage, type AssistantMessageDiagnostic, type AssistantMessageEvent, type AssistantMessageEventStream, type AssistantMessageEventStreamContract, type AssistantMessageEventStreamLike, type CLAUDE_FABLE_5_THINKING_PROFILE, type CLAUDE_HAIKU_55_THINKING_PROFILE, type CLAUDE_OPUS_55_THINKING_PROFILE, type CLAUDE_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_55_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, type DEFAULT_MISSING_TOOL_RESULT_TEXT, type DiagnosticErrorInfo, type EventStream, type ImageContent, type ImagesApi, type ImagesContext, type ImagesFunction, type ImagesInputContent, type ImagesModel, type ImagesOptions, type ImagesOutputContent, type ImagesProvider, type ImagesStopReason, type KnownApi, type KnownImagesApi, type KnownImagesProvider, type MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, type MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, type ModelCostConfig, type ModelCostRates, ModelInputContent, type ModelThinkingLevel, type OpenAICompletionsCompat, type OpenAIResponsesCompat, type OpenRouterRouting, PROVIDER_CONTEXT_HANDOFF, type PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, type PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, type PricingTier, type Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderRefusalReview, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, type RUNTIME_CONTEXT_BEGIN_MARKER, type RUNTIME_CONTEXT_CUSTOM_TYPE, type RUNTIME_CONTEXT_END_MARKER, type RUNTIME_CONTEXT_FOOTER, type RUNTIME_CONTEXT_HEADER, type RawModelCostConfig, type RawPricingTier, type RuntimeContextMessage, type SimpleStreamOptions, type StopReason, type StreamFn, type StreamOptions, type TextContent, type TextSignatureV1, type ThinkingBudgets, type ThinkingContent, type ThinkingLevel, type ThinkingLevelMap, type Tool, type ToolCall, type ToolResultMessage, type Transport, type Usage, type UserMessage, type ValidateToolArgumentsFn, type VercelGatewayRouting, VideoContent, type appendAssistantMessageDiagnostic, type appendTextDeltaToAssistantMessage, type bindsClaudeThinkingPrefix, type calculateUsageCost, type createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type escapeRuntimeContextFooter, type extractDiagnosticError, type formatThrownValue, type hasLegacyRuntimeContextEnvelope, type hasRuntimeContextMarker, type isProviderRefusalAssistantError, type isRuntimeContextMessage, type labelRuntimeContextContent, type labelRuntimeContextText, type normalizeModelCostConfig, type normalizeResolvedPricing, type readProviderRefusalReview, type readRuntimeContextMetadata, type requiresClaudeBetweenToolsThinking, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeHaiku55ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus55ModelIdentity, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet55ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type runtimeContextContentToText, type setRuntimeContextRetention, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeInHistorySystemMessages, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type supportsClaudeServerCompaction, type validateToolArguments, type validateToolCall };
|
|
5
|
+
import { a as ProviderContext, c as ProviderModel, d as ProviderUserMessage, f as VideoContent, i as PROVIDER_MODEL_INPUT, l as ProviderStreamFunction, n as ModelInputContent, o as ProviderContextHandoff, p as resolveProviderContext, r as PROVIDER_CONTEXT_HANDOFF, s as ProviderMessage, t as MediaContent, u as ProviderStreamOptions } from "./provider-types-CWl4VXvE.mjs";
|
|
6
|
+
export { type AnthropicMessagesCompat, type Api, type AssistantDeliveryTtsFacts, type AssistantImages, type AssistantMessage, type AssistantMessageDiagnostic, type AssistantMessageEvent, type AssistantMessageEventStream, type AssistantMessageEventStreamContract, type AssistantMessageEventStreamLike, type CLAUDE_FABLE_5_THINKING_PROFILE, type CLAUDE_HAIKU_55_THINKING_PROFILE, type CLAUDE_OPUS_55_THINKING_PROFILE, type CLAUDE_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_55_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, type DEFAULT_MISSING_TOOL_RESULT_TEXT, type DiagnosticErrorInfo, type EventStream, type ImageContent, type ImagesApi, type ImagesContext, type ImagesFunction, type ImagesInputContent, type ImagesModel, type ImagesOptions, type ImagesOutputContent, type ImagesProvider, type ImagesStopReason, type KnownApi, type KnownImagesApi, type KnownImagesProvider, type MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, type MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, type ModelCostConfig, type ModelCostRates, ModelInputContent, type ModelThinkingLevel, type OpenAICompletionsCompat, type OpenAIResponsesCompat, type OpenRouterRouting, PROVIDER_CONTEXT_HANDOFF, type PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_MODEL_INPUT, type PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, type PricingTier, type Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderRefusalReview, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, type RUNTIME_CONTEXT_BEGIN_MARKER, type RUNTIME_CONTEXT_CUSTOM_TYPE, type RUNTIME_CONTEXT_END_MARKER, type RUNTIME_CONTEXT_FOOTER, type RUNTIME_CONTEXT_HEADER, type RawModelCostConfig, type RawPricingTier, type RuntimeContextMessage, type SimpleStreamOptions, type StopReason, type StreamFn, type StreamOptions, type TextContent, type TextSignatureV1, type ThinkingBudgets, type ThinkingContent, type ThinkingLevel, type ThinkingLevelMap, type Tool, type ToolCall, type ToolResultMessage, type Transport, type Usage, type UserMessage, type ValidateToolArgumentsFn, type VercelGatewayRouting, VideoContent, type appendAssistantMessageDiagnostic, type appendTextDeltaToAssistantMessage, type bindsClaudeThinkingPrefix, type calculateUsageCost, type createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type escapeRuntimeContextFooter, type extractDiagnosticError, type formatThrownValue, type hasLegacyRuntimeContextEnvelope, type hasRuntimeContextMarker, type isProviderRefusalAssistantError, type isRuntimeContextMessage, type labelRuntimeContextContent, type labelRuntimeContextText, type normalizeModelCostConfig, type normalizeResolvedPricing, type readProviderRefusalReview, type readRuntimeContextMetadata, type requiresClaudeBetweenToolsThinking, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeHaiku55ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus55ModelIdentity, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet55ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type runtimeContextContentToText, type setRuntimeContextRetention, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeInHistorySystemMessages, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type supportsClaudeServerCompaction, type validateToolArguments, type validateToolCall };
|
package/dist/provider-types.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
//#region packages/ai/src/provider-types.ts
|
|
2
2
|
const PROVIDER_CONTEXT_HANDOFF = Symbol("providerContextHandoff");
|
|
3
|
+
const PROVIDER_MODEL_INPUT = Symbol("providerModelInput");
|
|
3
4
|
/** Resolves provider-only context without widening the canonical call contract. */
|
|
4
5
|
async function resolveProviderContext(context, options) {
|
|
5
6
|
return options?.[PROVIDER_CONTEXT_HANDOFF]?.() ?? context;
|
|
6
7
|
}
|
|
7
8
|
//#endregion
|
|
8
|
-
export { PROVIDER_CONTEXT_HANDOFF, resolveProviderContext };
|
|
9
|
+
export { PROVIDER_CONTEXT_HANDOFF, PROVIDER_MODEL_INPUT, resolveProviderContext };
|
package/dist/providers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { n as projectProviderError } from "./provider-error-qtZD2inE.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
4
4
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
5
5
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
6
6
|
/** Source id used for built-in API provider registrations. */
|
|
@@ -50,39 +50,39 @@ function createLazyRegistration(api, importModule, select) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
const registerBuiltIns = [
|
|
53
|
-
createLazyRegistration("anthropic-messages", () => import("./anthropic-
|
|
53
|
+
createLazyRegistration("anthropic-messages", () => import("./anthropic-CUVqVXTe.mjs").then((n) => n.t), (module) => ({
|
|
54
54
|
stream: module.streamAnthropic,
|
|
55
55
|
streamSimple: module.streamSimpleAnthropic
|
|
56
56
|
})),
|
|
57
|
-
createLazyRegistration("openai-completions", () => import("./openai-completions-
|
|
57
|
+
createLazyRegistration("openai-completions", () => import("./openai-completions-BdfBhFjx.mjs").then((n) => n.t), (module) => ({
|
|
58
58
|
stream: module.streamOpenAICompletions,
|
|
59
59
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
60
60
|
})),
|
|
61
|
-
createLazyRegistration("mistral-conversations", () => import("./mistral-
|
|
61
|
+
createLazyRegistration("mistral-conversations", () => import("./mistral-CQ7aoWg2.mjs"), (module) => ({
|
|
62
62
|
stream: module.streamMistral,
|
|
63
63
|
streamSimple: module.streamSimpleMistral
|
|
64
64
|
})),
|
|
65
|
-
createLazyRegistration("openai-responses", () => import("./openai-responses-
|
|
65
|
+
createLazyRegistration("openai-responses", () => import("./openai-responses-5KI4v8DN.mjs").then((n) => n.t), (module) => ({
|
|
66
66
|
stream: module.streamOpenAIResponses,
|
|
67
67
|
streamSimple: module.streamSimpleOpenAIResponses
|
|
68
68
|
})),
|
|
69
|
-
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-
|
|
69
|
+
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-I97-HnAv.mjs"), (module) => ({
|
|
70
70
|
stream: module.streamAzureOpenAIResponses,
|
|
71
71
|
streamSimple: module.streamSimpleAzureOpenAIResponses
|
|
72
72
|
})),
|
|
73
|
-
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-
|
|
73
|
+
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-DgDVhpUI.mjs"), (module) => ({
|
|
74
74
|
stream: module.streamOpenAICodexResponses,
|
|
75
75
|
streamSimple: module.streamSimpleOpenAICodexResponses
|
|
76
76
|
})),
|
|
77
|
-
createLazyRegistration("google-generative-ai", () => import("./google-
|
|
77
|
+
createLazyRegistration("google-generative-ai", () => import("./google-Cpi_cLKZ.mjs"), (module) => ({
|
|
78
78
|
stream: module.streamGoogle,
|
|
79
79
|
streamSimple: module.streamSimpleGoogle
|
|
80
80
|
})),
|
|
81
|
-
createLazyRegistration("google-interactions", () => import("./google-interactions-
|
|
81
|
+
createLazyRegistration("google-interactions", () => import("./google-interactions-BYRQ49MR.mjs"), (module) => ({
|
|
82
82
|
stream: module.streamGoogleInteractions,
|
|
83
83
|
streamSimple: module.streamSimpleGoogleInteractions
|
|
84
84
|
})),
|
|
85
|
-
createLazyRegistration("google-vertex", () => import("./google-vertex-
|
|
85
|
+
createLazyRegistration("google-vertex", () => import("./google-vertex-eKoUnW7N.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamGoogleVertex,
|
|
87
87
|
streamSimple: module.streamSimpleGoogleVertex
|
|
88
88
|
}))
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region packages/ai/src/internal/retry-after.d.ts
|
|
2
|
+
type HttpDateInstant = {
|
|
3
|
+
timestampMs: number;
|
|
4
|
+
leapSecond: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** Reads only retry timing metadata, without invoking provider getters or serialization hooks. */
|
|
7
|
+
declare function parseRetryAfterHeadersSeconds(headers: unknown, nowMs?: number, status?: number): number | undefined;
|
|
8
|
+
/** SDK errors carry native response headers separately from their error body. */
|
|
9
|
+
declare function parseRetryAfterErrorSeconds(error: unknown, nowMs?: number): number | undefined;
|
|
10
|
+
/** Provider prose such as "Please try again in 6s", "retry in 32s" or "Retry-After: 7". */
|
|
11
|
+
declare const RETRY_AFTER_TEXT_RE: RegExp;
|
|
12
|
+
/** Seconds named by a captured retry-text value: a number with an optional time unit, or an HTTP-date. */
|
|
13
|
+
declare function parseRetryAfterTextSeconds(valueText: string, nowMs?: number): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Reads google.rpc.RetryInfo delays from raw error text or a google.rpc.Status-shaped body
|
|
16
|
+
* in any key order, with a fixed number of descriptor reads and no getters. Pass the
|
|
17
|
+
* untruncated body: Gemini puts RetryInfo after its QuotaFailure details.
|
|
18
|
+
*/
|
|
19
|
+
declare function parseGoogleRetryDelaySeconds(value: unknown): number | undefined;
|
|
20
|
+
/** Round leap seconds forward for Retry-After so an unrepresentable instant cannot retry early. */
|
|
21
|
+
declare function parseRetryAfterHttpDateMs(value: string, nowMs?: number): number | undefined;
|
|
22
|
+
/** Parse all three HTTP-date forms while retaining leap-second ordering. */
|
|
23
|
+
declare function parseHttpDateInstant(value: string, nowMs?: number): HttpDateInstant | undefined;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { parseRetryAfterHeadersSeconds as a, parseRetryAfterErrorSeconds as i, parseGoogleRetryDelaySeconds as n, parseRetryAfterHttpDateMs as o, parseHttpDateInstant as r, parseRetryAfterTextSeconds as s, RETRY_AFTER_TEXT_RE as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { M as hasMediaPayload } from "./host-
|
|
3
|
-
import { _ as responsesServiceTierObserver } from "./openai-responses-contracts-
|
|
2
|
+
import { M as hasMediaPayload } from "./host-CWt55nnF.mjs";
|
|
3
|
+
import { _ as responsesServiceTierObserver } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
4
4
|
import { s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
6
6
|
import { n as normalizeStructuredPromptSection } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
7
|
-
import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
7
|
+
import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
8
8
|
//#region packages/ai/src/utils/system-prompt-cache-boundary.ts
|
|
9
9
|
const SYSTEM_PROMPT_CACHE_BOUNDARY = "\n<!-- OPENCLAW_CACHE_BOUNDARY -->\n";
|
|
10
10
|
/** Producer-delimited Runtime facts; instructions must remain outside this region. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as bindAssistantMessageEventStream, o as getEventStreamCompletion } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-
|
|
2
|
+
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-CWt55nnF.mjs";
|
|
3
3
|
import { t as cleanupSessionResources } from "./session-resources-vKvGIE3J.mjs";
|
|
4
4
|
//#region packages/ai/src/api-registry.ts
|
|
5
5
|
function wrapStream(api, stream) {
|
package/dist/{tool-schema-json-projection-Cvq69Ajp.mjs → tool-schema-json-projection-B1sTYwfH.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as asRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-9FSkE8T-.mjs";
|
|
3
3
|
import { o as normalizeOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { r as getAiTransportHost } from "./host-
|
|
4
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
5
|
import { hash } from "node:crypto";
|
|
6
6
|
import { types } from "node:util";
|
|
7
7
|
//#region packages/normalization-core/src/node-crypto.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { a as createAssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
3
|
import { i as asOptionalRecord, n as asNullableRecord, t as asNonArrayRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { E as headersToRecord, r as getAiTransportHost } from "./host-
|
|
4
|
+
import { E as headersToRecord, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
5
|
import { a as projectDiagnosticValue, n as projectProviderError } from "./provider-error-qtZD2inE.mjs";
|
|
6
|
-
import { l as isTransientNetworkError } from "./diagnostics-
|
|
6
|
+
import { l as isTransientNetworkError } from "./diagnostics-v7oVEW59.mjs";
|
|
7
7
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
8
8
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
9
9
|
import { parse } from "partial-json";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
2
2
|
import { s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
3
3
|
import "./internal/retry-after.mjs";
|
|
4
|
-
import { N as raceWithTimeout } from "./transport-stream-shared-
|
|
4
|
+
import { N as raceWithTimeout } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
5
5
|
import "./positive-integer-Bb4Evc7L.mjs";
|
|
6
6
|
//#region packages/normalization-core/src/response-bytes.ts
|
|
7
7
|
async function consumeResponseBytes(options) {
|
package/dist/transports.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ import { a as resolveOpenAIResponsesPayloadPolicy, i as resolveOpenAIResponsesCo
|
|
|
11
11
|
import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-DUBbsfku.mjs";
|
|
12
12
|
import { C as withProviderAcceptanceObserver, S as transportAbortError, _ as notifyProviderStreamOpened, a as coerceTransportToolCallArguments, b as sanitizeTransportPayloadText, c as createModelStreamCooperativeScheduler, d as finalizeTerminalToolCallArguments, f as finalizeTransportStream, g as notifyProviderHttpResponse, h as notifyProviderHttpMetadata, i as assignTransportErrorDetails, l as createWritableTransportEventStream, m as mergeTransportHeaders, n as ProviderAcceptance, o as copyProviderAcceptanceObserver, p as iterateModelStream, r as WritableTransportStream, s as createEmptyTransportUsage, t as IncompleteToolCallError, u as failTransportStream, v as parseTerminalToolCallArguments, w as withProviderResponseHook, x as throwIfModelStreamAborted, y as sanitizeNonEmptyTransportPayloadText } from "./transport-stream-shared-8ru8eX4s.mjs";
|
|
13
13
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-Cwcjv_fx.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { a as ProviderContext, c as ProviderModel, f as VideoContent } from "./provider-types-CWl4VXvE.mjs";
|
|
15
15
|
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./model-transport-url-BrsjjdjR.mjs";
|
|
16
16
|
import OpenAI from "openai";
|
|
17
17
|
import { Part } from "@google/genai";
|
|
@@ -450,4 +450,13 @@ export declare function convertGoogleTools(tools: Tool[]): {
|
|
|
450
450
|
functionDeclarations: Record<string, unknown>[];
|
|
451
451
|
}[] | undefined;
|
|
452
452
|
//#endregion
|
|
453
|
-
|
|
453
|
+
//#region packages/ai/src/providers/google-video-slots.d.ts
|
|
454
|
+
export declare const GOOGLE_VIDEO_SLOT_OMISSION = "(video omitted: native video slot unavailable)";
|
|
455
|
+
type GoogleVideoSlots = Map<Record<string, unknown>, VideoContent>;
|
|
456
|
+
export declare function createGoogleVideoPlaceholder<T extends {
|
|
457
|
+
text: string;
|
|
458
|
+
}>(video: VideoContent, slots: GoogleVideoSlots | undefined, placeholder: T): T;
|
|
459
|
+
/** Only original slot identities may recover private bytes after mutable payload hooks. */
|
|
460
|
+
export declare function materializeGoogleVideoSlots(payload: unknown, slots: GoogleVideoSlots, materialize: (slot: Record<string, unknown>, video: VideoContent) => void, omitInjected: (part: Record<string, unknown>) => void): void;
|
|
461
|
+
//#endregion
|
|
462
|
+
export { CompactionReplayRefreshRequiredError, type CompactionReplayRejection, type GoogleStreamChunk, type GoogleVideoSlots, IncompleteToolCallError, type OpenAICompletionsOptions, type OpenAIResponsesCompactionRejection, OpenAIServiceTier, ProviderAcceptance, ResolvedOpenAICompletionsCompat, WritableTransportStream, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyOpenAIResponsesPayloadPolicy, assignTransportErrorDetails, buildAnthropicSystemBlocks, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, copyProviderAcceptanceObserver, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createWritableTransportEventStream, detectOpenAICompletionsCompat, emitModelTransportDebug, emitModelTransportError, failTransportStream, finalizeTerminalToolCallArguments, finalizeTransportStream, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, isAnthropicServerToolClearingEnabled, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, iterateModelStream, logAnthropicContextEdits, mergeTransportHeaders, normalizeOpenAIServiceTier, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseTerminalToolCallArguments, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, sanitizeNonEmptyTransportPayloadText, sanitizeTransportPayloadText, sortPromptCacheToolsByName as sortTransportToolsByName, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withProviderAcceptanceObserver, withProviderResponseHook };
|
package/dist/transports.mjs
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { w as supportsClaudeAdaptiveThinking } from "./src-CyA0zJnt.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-
|
|
5
|
-
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-
|
|
4
|
+
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
|
+
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
6
6
|
import { o as redactDiagnosticText, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
7
|
-
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl,
|
|
8
|
-
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
-
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
10
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
11
|
-
import { A as resolveAnthropicCacheOptions, C as applyAnthropicEphemeralCacheControlMarkers, D as isAnthropicServerToolClearingEnabled, E as buildAnthropicSystemBlocks, F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, M as resolveAnthropicPayloadPolicy, N as resolveAnthropicRequestBetaHeader, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, S as applyAnthropicContextManagementToRequest, T as applyAnthropicRequestCacheControl, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, b as resolveNewestAnthropicCompaction, f as resolveAnthropicTransportOptions, j as resolveAnthropicEphemeralCacheControl, k as logAnthropicContextEdits, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, w as applyAnthropicPayloadPolicyToParams, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-
|
|
7
|
+
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, x as toErrorObject } from "./diagnostics-v7oVEW59.mjs";
|
|
8
|
+
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DwOpuTjL.mjs";
|
|
9
|
+
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
10
|
+
import { t as buildGuardedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
|
|
11
|
+
import { A as resolveAnthropicCacheOptions, C as applyAnthropicEphemeralCacheControlMarkers, D as isAnthropicServerToolClearingEnabled, E as buildAnthropicSystemBlocks, F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, M as resolveAnthropicPayloadPolicy, N as resolveAnthropicRequestBetaHeader, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, S as applyAnthropicContextManagementToRequest, T as applyAnthropicRequestCacheControl, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, b as resolveNewestAnthropicCompaction, f as resolveAnthropicTransportOptions, j as resolveAnthropicEphemeralCacheControl, k as logAnthropicContextEdits, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, w as applyAnthropicPayloadPolicyToParams, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-yWDb5Cct.mjs";
|
|
12
12
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
13
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, j as createAbortError$1, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
13
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, j as createAbortError$1, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
14
14
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
15
15
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
16
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
16
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
17
17
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
18
|
-
import { c as flattenCompletionMessagesToStringContent, d as hasOpenAICompatibleConversationTurn, f as canonicalizeMaxTokensParam, i as createOpenAIResponsesTransportStreamFn, l as stripCompletionMessagesToRoleContent, m as createDeepSeekTextFilter, o as buildOpenAICompletionsParams, p as resolveMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, t as createOpenAICompletionsTransportStreamFn, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-transport-
|
|
19
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
20
|
-
import { At as isOpenAICompletionsThinkingEnabled, Dt as createOpenAIResponseHook, Et as createOpenAIProviderAcceptanceHook, Ft as readOpenAICompletionsReasoningBatch, It as resolveOpenAIClientBaseUrl, J as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, L as normalizeOpenAIResponsesReasoningReplayItem, Lt as resolvePromptCacheKey, M as resolveResponsesContextUsageBoundary, Mt as measureUtf8AppendBytes, Nt as parseOpenAICompletionsUsage, Ot as createResponseModelTracker, Pt as readOpenAICompletionsContentDeltas, Q as splitOpenAIFunctionCallPairing, R as resolveReplayableResponsesMessageId, Rt as withOpenAIErrorResponseHook, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, X as normalizeOpenAIResponsesFunctionCallId, Y as OPENAI_RESPONSES_ID_MAX_LENGTH, Z as shouldNormalizeOpenAIResponsesToolCallId, at as resolveNewestOpenAIResponsesCompactionReplay, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, ft as filterCodeModePayloadTools, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, it as captureOpenAIResponsesCompaction, jt as log, kt as detachPartialSnapshot, lt as buildOpenAISdkClientOptions, mt as readCodeModePayloadToolName, nt as CompactionReplayRefreshRequiredError, pt as getCompat, q as OPENAI_RESPONSES_CALL_ID_RE, st as assertCodeModeResponsesToolSurface, ut as buildOpenAISdkRequestOptions, yt as resolveOpenAIReasoningEffortMap } from "./openai-responses-shared-
|
|
21
|
-
import { c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, p as resolveOpenAIResponsesServerCompactionPlan, s as sanitizeResponsesImagePayload, u as resolveOpenAIResponsesCompactEndpointPlan } from "./openai-responses-endpoint-
|
|
22
|
-
import { c as requestPreparedOpenAIResponsesCompaction } from "./openai-responses-request-lifecycle-
|
|
18
|
+
import { c as flattenCompletionMessagesToStringContent, d as hasOpenAICompatibleConversationTurn, f as canonicalizeMaxTokensParam, i as createOpenAIResponsesTransportStreamFn, l as stripCompletionMessagesToRoleContent, m as createDeepSeekTextFilter, o as buildOpenAICompletionsParams, p as resolveMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, t as createOpenAICompletionsTransportStreamFn, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-transport-CnFaKYO-.mjs";
|
|
19
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-DQMgG5yG.mjs";
|
|
20
|
+
import { At as isOpenAICompletionsThinkingEnabled, Dt as createOpenAIResponseHook, Et as createOpenAIProviderAcceptanceHook, Ft as readOpenAICompletionsReasoningBatch, It as resolveOpenAIClientBaseUrl, J as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, L as normalizeOpenAIResponsesReasoningReplayItem, Lt as resolvePromptCacheKey, M as resolveResponsesContextUsageBoundary, Mt as measureUtf8AppendBytes, Nt as parseOpenAICompletionsUsage, Ot as createResponseModelTracker, Pt as readOpenAICompletionsContentDeltas, Q as splitOpenAIFunctionCallPairing, R as resolveReplayableResponsesMessageId, Rt as withOpenAIErrorResponseHook, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, X as normalizeOpenAIResponsesFunctionCallId, Y as OPENAI_RESPONSES_ID_MAX_LENGTH, Z as shouldNormalizeOpenAIResponsesToolCallId, at as resolveNewestOpenAIResponsesCompactionReplay, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, ft as filterCodeModePayloadTools, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, it as captureOpenAIResponsesCompaction, jt as log, kt as detachPartialSnapshot, lt as buildOpenAISdkClientOptions, mt as readCodeModePayloadToolName, nt as CompactionReplayRefreshRequiredError, pt as getCompat, q as OPENAI_RESPONSES_CALL_ID_RE, st as assertCodeModeResponsesToolSurface, ut as buildOpenAISdkRequestOptions, yt as resolveOpenAIReasoningEffortMap } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
21
|
+
import { c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, p as resolveOpenAIResponsesServerCompactionPlan, s as sanitizeResponsesImagePayload, u as resolveOpenAIResponsesCompactEndpointPlan } from "./openai-responses-endpoint-CfKR6N5f.mjs";
|
|
22
|
+
import { c as requestPreparedOpenAIResponsesCompaction } from "./openai-responses-request-lifecycle-WKXjj_th.mjs";
|
|
23
|
+
import { n as createGoogleVideoPlaceholder, r as materializeGoogleVideoSlots, t as GOOGLE_VIDEO_SLOT_OMISSION } from "./google-video-slots-D8tPH8wX.mjs";
|
|
23
24
|
import { randomUUID } from "node:crypto";
|
|
24
25
|
//#region packages/ai/src/transports/anthropic-transport-stream.ts
|
|
25
26
|
const ANTHROPIC_MESSAGES_ERROR_BODY_MAX_BYTES = 8192;
|
|
@@ -698,4 +699,4 @@ function prepareModelForSimpleCompletion(params) {
|
|
|
698
699
|
return wrap(model);
|
|
699
700
|
}
|
|
700
701
|
//#endregion
|
|
701
|
-
export { CompactionReplayRefreshRequiredError, GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, IncompleteToolCallError, MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, OPENAI_RESPONSES_CALL_ID_RE, OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, OPENAI_RESPONSES_ID_MAX_LENGTH, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyCompletionsAnthropicCacheControl, applyOpenAIResponsesPayloadPolicy, assertCodeModeResponsesToolSurface, assignTransportErrorDetails, buildAnthropicSystemBlocks, buildOpenAIClientHeaders, buildOpenAICompletionsParams, buildOpenAISdkClientOptions, buildOpenAISdkRequestOptions, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, createTransportAwareStreamFnForModel, canonicalizeMaxTokensParam, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, consumeGoogleGenerateContentStream, convertGoogleTools, copyProviderAcceptanceObserver, createAnthropicMessagesTransportStreamFn, createAzureOpenAIResponsesTransportStreamFn, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createDeepSeekTextFilter, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createOpenAICompletionsTransportStreamFn, createOpenAIProviderAcceptanceHook, createOpenAIResponseHook, createOpenAIResponsesTransportStreamFn, createResponseModelTracker, createWritableTransportEventStream, detachPartialSnapshot, detectOpenAICompletionsCompat, emitModelTransportDebug, emitModelTransportError, enforceCodeModeResponsesToolSurface, failTransportStream, filterCodeModePayloadTools, finalizeTerminalToolCallArguments, finalizeTransportStream, flattenCompletionMessagesToStringContent, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, getCompat, googleFlashSupportsMinimalThinking, hasOpenAICompatibleConversationTurn, isAnthropicServerToolClearingEnabled, isCodeModeModelVisibleToolName, isCompactionReplayCheckpoint, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, isOpenAICompletionsThinkingEnabled, iterateModelStream, log, logAnthropicContextEdits, measureUtf8AppendBytes, mergeTransportHeaders, normalizeCodexResponsesBaseUrlForOpenAISdk, normalizeOpenAIResponsesFunctionCallId, normalizeOpenAIResponsesReasoningReplayItem, normalizeOpenAIServiceTier, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseJsonObjectPreservingUnsafeIntegers, parseJsonPreservingUnsafeIntegers, parseOpenAICompletionsUsage, parseTerminalToolCallArguments, prepareHeadersForSimpleCompletion, prepareModelForSimpleCompletion, prepareTransportAwareSimpleModel, preserveCompactionReplayWindow, projectGoogleMessages, quoteUnsafeIntegerLiterals, readCodeModePayloadToolName, readOpenAICompletionsContentDeltas, readOpenAICompletionsReasoningBatch, replaceCompactionReplayOwnerContent, requestPreparedOpenAIResponsesCompaction, requiresCompactionReplayRefresh, requiresGoogleToolCallId, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicMessagesUrl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveCodeModeResponsesVisibleToolNames, resolveCompactionReplayEligibility, resolveCompactionReplayPressure, resolveCompletionTokenReservation, resolveMaxTokensParam, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAIClientBaseUrl, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIReasoningEffortMap, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, resolveOpenAIStrictToolFlagWithDiagnostics, resolvePromptCacheKey, resolveReplayableResponsesMessageId, resolveTransportAwareSimpleApi, sanitizeNonEmptyTransportPayloadText, sanitizeResponsesImagePayload, sanitizeTransportPayloadText, shouldNormalizeOpenAIResponsesToolCallId, sortPromptCacheToolsByName as sortTransportToolsByName, splitOpenAIFunctionCallPairing, stripCompactionReplayCheckpoint, stripCompactionReplayCheckpointInPlace, stripCompletionMessagesToRoleContent, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withOpenAIErrorResponseHook, withProviderAcceptanceObserver, withProviderResponseHook };
|
|
702
|
+
export { CompactionReplayRefreshRequiredError, GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, GOOGLE_VIDEO_SLOT_OMISSION, IncompleteToolCallError, MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, OPENAI_RESPONSES_CALL_ID_RE, OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, OPENAI_RESPONSES_ID_MAX_LENGTH, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyCompletionsAnthropicCacheControl, applyOpenAIResponsesPayloadPolicy, assertCodeModeResponsesToolSurface, assignTransportErrorDetails, buildAnthropicSystemBlocks, buildOpenAIClientHeaders, buildOpenAICompletionsParams, buildOpenAISdkClientOptions, buildOpenAISdkRequestOptions, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, createTransportAwareStreamFnForModel, canonicalizeMaxTokensParam, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, consumeGoogleGenerateContentStream, convertGoogleTools, copyProviderAcceptanceObserver, createAnthropicMessagesTransportStreamFn, createAzureOpenAIResponsesTransportStreamFn, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createDeepSeekTextFilter, createEmptyTransportUsage, createGoogleVideoPlaceholder, createModelStreamCooperativeScheduler, createOpenAICompletionsTransportStreamFn, createOpenAIProviderAcceptanceHook, createOpenAIResponseHook, createOpenAIResponsesTransportStreamFn, createResponseModelTracker, createWritableTransportEventStream, detachPartialSnapshot, detectOpenAICompletionsCompat, emitModelTransportDebug, emitModelTransportError, enforceCodeModeResponsesToolSurface, failTransportStream, filterCodeModePayloadTools, finalizeTerminalToolCallArguments, finalizeTransportStream, flattenCompletionMessagesToStringContent, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, getCompat, googleFlashSupportsMinimalThinking, hasOpenAICompatibleConversationTurn, isAnthropicServerToolClearingEnabled, isCodeModeModelVisibleToolName, isCompactionReplayCheckpoint, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, isOpenAICompletionsThinkingEnabled, iterateModelStream, log, logAnthropicContextEdits, materializeGoogleVideoSlots, measureUtf8AppendBytes, mergeTransportHeaders, normalizeCodexResponsesBaseUrlForOpenAISdk, normalizeOpenAIResponsesFunctionCallId, normalizeOpenAIResponsesReasoningReplayItem, normalizeOpenAIServiceTier, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseJsonObjectPreservingUnsafeIntegers, parseJsonPreservingUnsafeIntegers, parseOpenAICompletionsUsage, parseTerminalToolCallArguments, prepareHeadersForSimpleCompletion, prepareModelForSimpleCompletion, prepareTransportAwareSimpleModel, preserveCompactionReplayWindow, projectGoogleMessages, quoteUnsafeIntegerLiterals, readCodeModePayloadToolName, readOpenAICompletionsContentDeltas, readOpenAICompletionsReasoningBatch, replaceCompactionReplayOwnerContent, requestPreparedOpenAIResponsesCompaction, requiresCompactionReplayRefresh, requiresGoogleToolCallId, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicMessagesUrl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveCodeModeResponsesVisibleToolNames, resolveCompactionReplayEligibility, resolveCompactionReplayPressure, resolveCompletionTokenReservation, resolveMaxTokensParam, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAIClientBaseUrl, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIReasoningEffortMap, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, resolveOpenAIStrictToolFlagWithDiagnostics, resolvePromptCacheKey, resolveReplayableResponsesMessageId, resolveTransportAwareSimpleApi, sanitizeNonEmptyTransportPayloadText, sanitizeResponsesImagePayload, sanitizeTransportPayloadText, shouldNormalizeOpenAIResponsesToolCallId, sortPromptCacheToolsByName as sortTransportToolsByName, splitOpenAIFunctionCallPairing, stripCompactionReplayCheckpoint, stripCompactionReplayCheckpointInPlace, stripCompletionMessagesToRoleContent, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withOpenAIErrorResponseHook, withProviderAcceptanceObserver, withProviderResponseHook };
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region packages/ai/src/internal/retry-after.d.ts
|
|
2
|
-
type HttpDateInstant = {
|
|
3
|
-
timestampMs: number;
|
|
4
|
-
leapSecond: boolean;
|
|
5
|
-
};
|
|
6
|
-
/** Reads only retry timing metadata, without invoking provider getters or serialization hooks. */
|
|
7
|
-
declare function parseRetryAfterHeadersSeconds(headers: unknown, nowMs?: number, status?: number): number | undefined;
|
|
8
|
-
/** SDK errors carry native response headers separately from their error body. */
|
|
9
|
-
declare function parseRetryAfterErrorSeconds(error: unknown, nowMs?: number): number | undefined;
|
|
10
|
-
/** Round leap seconds forward for Retry-After so an unrepresentable instant cannot retry early. */
|
|
11
|
-
declare function parseRetryAfterHttpDateMs(value: string, nowMs?: number): number | undefined;
|
|
12
|
-
/** Parse all three HTTP-date forms while retaining leap-second ordering. */
|
|
13
|
-
declare function parseHttpDateInstant(value: string, nowMs?: number): HttpDateInstant | undefined;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { parseRetryAfterHttpDateMs as i, parseRetryAfterErrorSeconds as n, parseRetryAfterHeadersSeconds as r, parseHttpDateInstant as t };
|