@openclaw/ai 2026.7.2-beta.4 → 2026.7.2-beta.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/{anthropic-CrUDIBpM.mjs → anthropic-CQVj3le6.mjs} +53 -19
- package/dist/{anthropic-BoTnz8cv.d.mts → anthropic-SrGtwsJu.d.mts} +27 -1
- package/dist/{api-registry-BMphkFf1.d.mts → api-registry-DlMgPR39.d.mts} +1 -1
- package/dist/{azure-openai-responses-CbrpVeEv.mjs → azure-openai-responses-DIYgsqFM.mjs} +3 -4
- package/dist/error-coercion-DgxlWC0n.mjs +15 -0
- package/dist/{event-stream-Douf9dob.d.mts → event-stream-YjaPW20U.d.mts} +1 -1
- package/dist/event-stream.d.mts +1 -1
- package/dist/{tool-schema-json-projection-BwNu3nDi.mjs → github-copilot-headers-BCoBNmL7.mjs} +48 -1
- package/dist/{google-Cs62KA7t.mjs → google-f-A8xrae.mjs} +2 -2
- package/dist/{google-shared-CMLI-tCZ.mjs → google-shared-J6qvYINH.mjs} +5 -4
- package/dist/{google-vertex-B4SD3U0f.mjs → google-vertex-D3yMVXIY.mjs} +2 -2
- package/dist/{host-WvWBo4h8.d.mts → host-B9GUmcra.d.mts} +2 -2
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +15 -11
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai.d.mts +2 -1
- package/dist/internal/openai.mjs +4 -6
- package/dist/internal/runtime.d.mts +8 -32
- package/dist/internal/runtime.mjs +2 -3
- package/dist/internal/shared.d.mts +13 -8
- package/dist/internal/shared.mjs +2 -2
- package/dist/{mistral-D5Ps7Led.mjs → mistral-CKV-TOQj.mjs} +4 -3
- package/dist/number-coercion-DvG7SNMg.mjs +129 -0
- package/dist/{openai-CoGicoDt.d.mts → openai-BPor_3WI.d.mts} +35 -9
- package/dist/{openai-responses-shared-CzCurmY1.mjs → openai-D3PD6PE-.mjs} +1771 -745
- package/dist/{openai-chatgpt-responses-h0o5yV8Y.mjs → openai-chatgpt-responses-CedIj0hk.mjs} +19 -20
- package/dist/{openai-completions-exO8NFQf.mjs → openai-completions-CiSutyu0.mjs} +366 -227
- package/dist/openai-prompt-cache-2uo_1OR1.d.mts +7 -0
- package/dist/openai-prompt-cache-mZTCdRPo.mjs +12 -0
- package/dist/prompt-cache-stability-Cwcjv_fx.d.mts +13 -0
- package/dist/{provider-error-C4VvV_3t.mjs → provider-error-apVOZI6G.mjs} +8 -2
- package/dist/providers.d.mts +3 -2
- package/dist/providers.mjs +10 -9
- package/dist/{system-prompt-cache-boundary-CbHeV4_l.mjs → shared-CdjNZd35.mjs} +117 -9
- package/dist/{src-CXno1H5g.mjs → src-QkygScBs.mjs} +23 -4
- package/dist/stream-first-event-timeout-C3OgBjIk.mjs +12294 -0
- package/dist/stream-first-event-timeout-DvDeSucC.d.mts +29 -0
- package/dist/transport-stream-shared-BbMELSI4.mjs +297 -0
- package/dist/transports.d.mts +105 -102
- package/dist/transports.mjs +334 -1966
- package/dist/{types-AFwwWium.d.mts → types-bzp5k29J.d.mts} +7 -0
- package/dist/types.d.mts +5 -5
- package/dist/types.mjs +2 -2
- package/dist/{validation-sxvxC8J-.d.mts → validation-B-j7cOYp.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/package.json +1 -2
- package/dist/azure-openai-responses-client-compat-C7K7QfUE.mjs +0 -62
- package/dist/github-copilot-headers-BsH5cqGj.mjs +0 -48
- package/dist/model-utils-1GiZ2_rr.mjs +0 -64
- package/dist/openai-responses-BHpmtUKo.mjs +0 -136
- package/dist/openai-tool-projection-ITOU9bG1.mjs +0 -200
- package/dist/reasoning-tag-text-partitioner-BlVe67g6.mjs +0 -400
- package/dist/stream-first-event-timeout-DP4xEyBY.mjs +0 -150
- package/npm-shrinkwrap.json +0 -638
package/dist/{openai-chatgpt-responses-h0o5yV8Y.mjs → openai-chatgpt-responses-CedIj0hk.mjs}
RENAMED
|
@@ -2,14 +2,17 @@ import { n as getEnvApiKey } from "./env-api-keys-DrgeBuva.mjs";
|
|
|
2
2
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-COpOtRwq.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-D8n2uFee.mjs";
|
|
4
4
|
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-XYGZcgO8.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-mZTCdRPo.mjs";
|
|
6
|
+
import { A as buildBaseOptions, o as stripSystemPromptCacheBoundary, t as inspectTlsCertificateError } from "./shared-CdjNZd35.mjs";
|
|
7
|
+
import { t as toErrorObject } from "./error-coercion-DgxlWC0n.mjs";
|
|
8
|
+
import { n as clampTimerTimeoutMs, o as resolveTimerTimeoutMs } from "./number-coercion-DvG7SNMg.mjs";
|
|
9
|
+
import { parseRetryAfterHttpDateMs } from "./internal/retry-after.mjs";
|
|
10
|
+
import { d as transportAbortError } from "./transport-stream-shared-BbMELSI4.mjs";
|
|
6
11
|
import { t as headersToRecord } from "./headers-B_e4-1J0.mjs";
|
|
7
12
|
import { i as registerSessionResourceCleanup, n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-DhAAzLkj.mjs";
|
|
8
|
-
import {
|
|
13
|
+
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-C3OgBjIk.mjs";
|
|
9
14
|
import { t as createSseByteGuard } from "./streaming-byte-guard-BrbkbwUu.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import { L as supportsOpenAITemperature, a as resolveResponsesReasoningEffort, i as processResponsesStream, n as convertResponsesMessages, s as convertResponsesToolPayload } from "./openai-responses-shared-CzCurmY1.mjs";
|
|
12
|
-
import { a as clampOpenAIPromptCacheKey } from "./openai-tool-projection-ITOU9bG1.mjs";
|
|
15
|
+
import { _t as supportsOpenAITemperature, a as convertResponsesMessages, l as convertResponsesToolPayload, s as resolveResponsesReasoningEffort, y as processResponsesStream } from "./openai-D3PD6PE-.mjs";
|
|
13
16
|
//#region packages/ai/src/internal/retry-sleep.ts
|
|
14
17
|
function sleepWithAbort(ms, signal) {
|
|
15
18
|
return new Promise((resolve, reject) => {
|
|
@@ -167,7 +170,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
167
170
|
await processWebSocketStream(resolveCodexWebSocketUrl(model.baseUrl), body, websocketHeaders, output, stream, model, () => {
|
|
168
171
|
websocketStarted = true;
|
|
169
172
|
}, requestOptions, firstEventAbort.abort);
|
|
170
|
-
if (activeSignal?.aborted) throw
|
|
173
|
+
if (activeSignal?.aborted) throw transportAbortError(activeSignal);
|
|
171
174
|
stream.push({
|
|
172
175
|
type: "done",
|
|
173
176
|
reason: output.stopReason,
|
|
@@ -203,7 +206,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
203
206
|
let lastError;
|
|
204
207
|
const maxRetries = options?.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
205
208
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
206
|
-
if (activeSignal?.aborted) throw
|
|
209
|
+
if (activeSignal?.aborted) throw transportAbortError(activeSignal);
|
|
207
210
|
let attemptResponse;
|
|
208
211
|
let errorText;
|
|
209
212
|
try {
|
|
@@ -226,8 +229,9 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
226
229
|
if (error.name === "AbortError" || error.message === "Request was aborted") throw new Error("Request was aborted", { cause: error });
|
|
227
230
|
if (error.name === "TimeoutError" && requestTimeoutMs !== void 0) throw new Error(`Request timed out after ${requestTimeoutMs}ms`, { cause: error });
|
|
228
231
|
}
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
const tlsCertificateError = inspectTlsCertificateError(error);
|
|
233
|
+
lastError = toErrorObject(error, String(error));
|
|
234
|
+
if (attempt < maxRetries && !lastError.message.includes("usage limit") && !tlsCertificateError) {
|
|
231
235
|
await sleepWithAbort(BASE_DELAY_MS * 2 ** attempt, activeSignal);
|
|
232
236
|
continue;
|
|
233
237
|
}
|
|
@@ -247,7 +251,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
247
251
|
partial: output
|
|
248
252
|
});
|
|
249
253
|
await processStream(response, output, stream, model, options, firstEventAbort.abort);
|
|
250
|
-
if (activeSignal?.aborted) throw
|
|
254
|
+
if (activeSignal?.aborted) throw transportAbortError(activeSignal);
|
|
251
255
|
stream.push({
|
|
252
256
|
type: "done",
|
|
253
257
|
reason: output.stopReason,
|
|
@@ -357,6 +361,7 @@ async function processStream(response, output, stream, model, options, abortFirs
|
|
|
357
361
|
firstEventTimeoutMs: getFirstStreamEventTimeoutMs(options),
|
|
358
362
|
abortFirstEventStream,
|
|
359
363
|
onFirstEventTimeout: getFirstStreamEventTimeoutHandler(options),
|
|
364
|
+
signal: options?.signal,
|
|
360
365
|
resolveServiceTier: resolveCodexServiceTier,
|
|
361
366
|
applyServiceTierPricing: (usage, serviceTier) => applyServiceTierPricing(usage, serviceTier, model)
|
|
362
367
|
});
|
|
@@ -794,7 +799,7 @@ async function* parseWebSocket(socket, signal) {
|
|
|
794
799
|
signal?.addEventListener("abort", onAbort);
|
|
795
800
|
try {
|
|
796
801
|
while (true) {
|
|
797
|
-
if (signal?.aborted) throw
|
|
802
|
+
if (signal?.aborted) throw transportAbortError(signal);
|
|
798
803
|
const next = queue.shift();
|
|
799
804
|
if (next !== void 0) {
|
|
800
805
|
yield next;
|
|
@@ -805,7 +810,7 @@ async function* parseWebSocket(socket, signal) {
|
|
|
805
810
|
pending = resolve;
|
|
806
811
|
});
|
|
807
812
|
}
|
|
808
|
-
if (failed) throw
|
|
813
|
+
if (failed) throw toErrorObject(failed, "Non-Error thrown");
|
|
809
814
|
if (!sawCompletion) throw new Error("WebSocket stream closed before response.completed");
|
|
810
815
|
} finally {
|
|
811
816
|
socket.removeEventListener("message", onMessage);
|
|
@@ -867,7 +872,7 @@ async function processWebSocketStream(url, body, headers, output, stream, model,
|
|
|
867
872
|
const fullBody = body;
|
|
868
873
|
const requestBody = useCachedContext && entry ? buildCachedWebSocketRequestBody(entry, fullBody) : fullBody;
|
|
869
874
|
try {
|
|
870
|
-
if (options?.signal?.aborted) throw
|
|
875
|
+
if (options?.signal?.aborted) throw transportAbortError(options.signal);
|
|
871
876
|
socket.send(JSON.stringify({
|
|
872
877
|
type: "response.create",
|
|
873
878
|
...requestBody
|
|
@@ -877,6 +882,7 @@ async function processWebSocketStream(url, body, headers, output, stream, model,
|
|
|
877
882
|
firstEventTimeoutMs: getFirstStreamEventTimeoutMs(options),
|
|
878
883
|
abortFirstEventStream,
|
|
879
884
|
onFirstEventTimeout: getFirstStreamEventTimeoutHandler(options),
|
|
885
|
+
signal: options?.signal,
|
|
880
886
|
resolveServiceTier: resolveCodexServiceTier,
|
|
881
887
|
applyServiceTierPricing: (usage, serviceTier) => applyServiceTierPricing(usage, serviceTier, model)
|
|
882
888
|
});
|
|
@@ -1000,12 +1006,5 @@ function buildWebSocketHeaders(initHeaders, additionalHeaders, accountId, token,
|
|
|
1000
1006
|
headers.set("session_id", requestId);
|
|
1001
1007
|
return headers;
|
|
1002
1008
|
}
|
|
1003
|
-
function toLintErrorObject(value, fallbackMessage) {
|
|
1004
|
-
if (value instanceof Error) return value;
|
|
1005
|
-
if (typeof value === "string") return new Error(value);
|
|
1006
|
-
const error = new Error(fallbackMessage, { cause: value });
|
|
1007
|
-
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
1008
|
-
return error;
|
|
1009
|
-
}
|
|
1010
1009
|
//#endregion
|
|
1011
1010
|
export { closeOpenAICodexWebSocketSessions, extractOpenAICodexAccountId, parseSSEForTest, resetOpenAICodexWebSocketStateForTest, streamOpenAICodexResponses, streamSimpleOpenAICodexResponses };
|