@openclaw/ai 2026.11.5 → 2026.11.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/{anthropic-CNEzO12C.mjs → anthropic-CBz5v2U3.mjs} +16 -15
- package/dist/{anthropic-payload-policy-DVk38bnY.d.mts → anthropic-payload-policy-BTrHSS_v.d.mts} +4 -8
- package/dist/{anthropic-stream-lifecycle-DJUtasDB.mjs → anthropic-stream-lifecycle-96vq-4V9.mjs} +154 -88
- package/dist/{anthropic-tool-projection-DcvsDiyX.mjs → anthropic-tool-projection-A9GceDnD.mjs} +4 -5
- package/dist/{anthropic-tool-projection-DKAlondV.d.mts → anthropic-tool-projection-DCOX8qai.d.mts} +1 -3
- package/dist/{api-registry-DY2MLUyg.d.mts → api-registry-DUEK-a3o.d.mts} +2 -4
- package/dist/{assistant-message-events-CHMJgbhs.mjs → assistant-message-events-DtSjIQmB.mjs} +1 -2
- package/dist/{assistant-output-C3czmoN4.mjs → assistant-output-kYOaiso5.mjs} +2 -3
- package/dist/{azure-openai-responses-client-compat-D0dvJMbZ.mjs → azure-deployment-map-hwDQc3uL.mjs} +2 -16
- package/dist/{azure-openai-responses-DRkduRmW.mjs → azure-openai-responses-CZheDTt_.mjs} +12 -12
- package/dist/azure-openai-responses-client-compat-DLsS6V6z.mjs +13 -0
- package/dist/{base64-C8CdcsjU.mjs → base64-FdymvxN9.mjs} +1 -2
- package/dist/cloudflare-BCLfDuew.mjs +15 -0
- package/dist/{credential-redaction-DrgndwTJ.d.mts → credential-redaction-BNv5SWQz.d.mts} +0 -2
- package/dist/{deferred-event-buffer-tIGkTkTm.mjs → deferred-event-buffer-BgT1IIfq.mjs} +1 -2
- package/dist/{diagnostics-CloVGQiK.mjs → diagnostics-BNlb1zlT.mjs} +12 -19
- package/dist/{diagnostics-o1PrVNQb.mjs → diagnostics-DP1SXgAW.mjs} +1 -2
- package/dist/diagnostics.d.mts +6 -10
- package/dist/diagnostics.mjs +3 -3
- package/dist/{env-api-keys-BuHc86ya.mjs → env-api-keys-DlUbTgKq.mjs} +1 -2
- package/dist/{event-stream-BYmtRe8-.d.mts → event-stream-BJS9Q8G_.d.mts} +1 -3
- package/dist/{event-stream-X2gmsUWv.mjs → event-stream-Bf6cK7-d.mjs} +1 -2
- package/dist/event-stream-CPiqa8PI.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/{expect-lbe3Hgrh.mjs → expect-DqyhV9d8.mjs} +1 -2
- package/dist/github-copilot-headers-CqLRrd-i.mjs +22 -0
- package/dist/{github-copilot-request-facts-BZ_EMo7X.mjs → github-copilot-request-facts-BxuLEdNF.mjs} +2 -3
- package/dist/{google-DqG05iBa.mjs → google-BUgkXPYL.mjs} +6 -7
- package/dist/{google-interactions-BE7cxFPc.mjs → google-interactions-84f0xFly.mjs} +36 -25
- package/dist/{google-messages-p2iBzsAp.mjs → google-messages-Dip5zphv.mjs} +16 -20
- package/dist/{google-provider-stream-DZ6tqteU.mjs → google-provider-stream-COaKMdQv.mjs} +14 -15
- package/dist/{google-shared-BMYt1xSI.mjs → google-shared-Dooy5JJL.mjs} +11 -14
- package/dist/{google-vertex-CAq2q1Ln.mjs → google-vertex--S8AlXUD.mjs} +4 -5
- package/dist/{google-video-slots-Bxt-OXO8.mjs → google-video-slots-CzdrKzrO.mjs} +2 -3
- package/dist/{host-DqX-64Pb.mjs → host-Cf7zb-48.mjs} +73 -89
- package/dist/{host-ccbwPC3A.d.mts → host-Dgpzj407.d.mts} +3 -5
- package/dist/{host-policy-Bk85E9ue.mjs → host-policy-B1qzS7Xe.mjs} +2 -3
- package/dist/{index-Bczt0MnO.d.mts → index-BDF5kurq.d.mts} +10 -10
- package/dist/index.d.mts +8 -10
- package/dist/index.mjs +11 -11
- package/dist/internal/anthropic.d.mts +10 -21
- package/dist/internal/anthropic.mjs +6 -6
- package/dist/internal/google-model-family.d.mts +1 -3
- package/dist/internal/google-model-family.mjs +2 -3
- package/dist/internal/google.d.mts +3 -5
- package/dist/internal/google.mjs +1 -1
- package/dist/internal/model-request-body.d.mts +5 -5
- package/dist/internal/model-request-body.mjs +19 -6
- package/dist/internal/openai-completions-compat.d.mts +1 -3
- package/dist/internal/openai-completions-compat.mjs +2 -2
- package/dist/internal/openai-responses-payload-policy.d.mts +2 -4
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +10 -32
- package/dist/internal/openai.mjs +12 -11
- package/dist/internal/reasoning-tag-text-partitioner.d.mts +0 -4
- package/dist/internal/reasoning-tag-text-partitioner.mjs +64 -125
- package/dist/internal/retry-after.d.mts +1 -1
- package/dist/internal/retry-after.mjs +1 -2
- package/dist/internal/runtime.d.mts +9 -43
- package/dist/internal/runtime.mjs +14 -15
- package/dist/internal/session-resources.d.mts +11 -0
- package/dist/{session-resources-vKvGIE3J.mjs → internal/session-resources.mjs} +2 -3
- package/dist/internal/shared.d.mts +17 -26
- package/dist/internal/shared.mjs +10 -10
- package/dist/internal/tool-schema.d.mts +2 -22
- package/dist/internal/tool-schema.mjs +3 -3
- package/dist/{llm-request-activity-DzaHoRAU.mjs → llm-request-activity-v1liRqNt.mjs} +1 -2
- package/dist/{mistral-DIGInqJI.mjs → mistral-BAps5cN2.mjs} +713 -299
- package/dist/{model-transport-url-BdksnBqu.d.mts → model-transport-url-Dad-sfx2.d.mts} +0 -4
- package/dist/{number-coercion-C7HsBgUL.mjs → number-coercion-BO6bhGm6.mjs} +2 -3
- package/dist/{observe-async-iterator-DgmegcZR.mjs → observe-async-iterator-DdOlbgrr.mjs} +1 -2
- package/dist/{observe-async-iterator-AlARO5wS.d.mts → observe-async-iterator-DeB_Vxes.d.mts} +14 -7
- package/dist/openai-BtJTmLWF.mjs +21460 -0
- package/dist/{openai-chatgpt-jwt-KWcgd0d_.mjs → openai-chatgpt-jwt-v5F5jJmX.mjs} +1 -2
- package/dist/{openai-chatgpt-responses-C6rEZcsZ.mjs → openai-chatgpt-responses-CYXMKG89.mjs} +53 -49
- package/dist/{openai-completions-B93R3N3b.mjs → openai-completions-Bi4Ghg3V.mjs} +6 -7
- package/dist/{openai-completions-compat-CJ-NsDzg.d.mts → openai-completions-compat-BJBQ682M.d.mts} +10 -5
- package/dist/{openai-completions-compat-CS3dlDBR.mjs → openai-completions-compat-DZLGotNt.mjs} +19 -16
- package/dist/{openai-completions-reasoning-replay-BwT1xwRI.mjs → openai-completions-reasoning-replay-DyH5XzNo.mjs} +1 -2
- package/dist/{openai-completions-transport-DHTFq-BM.mjs → openai-completions-transport-otONaRhv.mjs} +160 -527
- package/dist/{openai-prompt-cache-BZGaIWYh.d.mts → openai-prompt-cache-C5rwtmA_.d.mts} +2 -4
- package/dist/{openai-prompt-cache-3H_Fz0ya.mjs → openai-prompt-cache-CJv1bvw0.mjs} +3 -5
- package/dist/openai-provider-client-apBsWo9b.mjs +51 -0
- package/dist/{openai-responses-DSxPKV0U.mjs → openai-responses-CiIAm8fJ.mjs} +14 -14
- package/dist/{openai-responses-compaction-replay-DXF5BjD2.d.mts → openai-responses-compaction-replay-CUw4owu9.d.mts} +6 -7
- package/dist/{openai-responses-contracts-Cb1IIRRG.d.mts → openai-responses-contracts-bYtvXSvv.d.mts} +7 -12
- package/dist/{openai-responses-contracts-xU-n9AJJ.mjs → openai-responses-contracts-eppTI5DQ.mjs} +11 -18
- package/dist/{openai-responses-endpoint-CqO3ejTe.mjs → openai-responses-endpoint-AeVu3HmP.mjs} +80 -34
- package/dist/{openai-responses-payload-policy-BsQaD-gD.d.mts → openai-responses-payload-policy-Cihgy9fC.d.mts} +0 -2
- package/dist/{openai-responses-request-lifecycle-C_3FKkl7.mjs → openai-responses-request-lifecycle-DfE4xNHj.mjs} +120 -20
- package/dist/{openai-responses-shared-En3Jf0Vg.mjs → openai-responses-shared-BAJzOqwt.mjs} +1649 -312
- package/dist/{openai-responses-terminal-usage-D7IhRA6i.d.mts → openai-responses-terminal-usage-BYXQTt9u.d.mts} +2 -4
- package/dist/openai-responses-websocket-DywDiO81.mjs +8143 -0
- package/dist/{openai-stop-reason-8s70vDXj.mjs → openai-stop-reason-cA0GUHlU.mjs} +4 -3
- package/dist/{openai-tool-schema-CvxySRyf.mjs → openai-tool-schema-Ca74_fkR.mjs} +17 -26
- package/dist/openai.LICENSE +201 -0
- package/dist/{otel-B2u5HGvm.mjs → otel-C5Cn7IFQ.mjs} +8 -8
- package/dist/{overflow-CpApyjG2.mjs → overflow-CM0yZomw.mjs} +2 -3
- package/dist/{positive-integer-DiqE5vNi.mjs → positive-integer-AM4ltyhP.mjs} +2 -3
- package/dist/{prompt-cache-stability-w-ICeyOI.mjs → prompt-cache-stability-oTx0nIsh.mjs} +3 -4
- package/dist/{prompt-cache-stability-Cwcjv_fx.d.mts → prompt-cache-stability-xNfkD-3g.d.mts} +0 -2
- package/dist/{provider-error-DD-fo4Rz.mjs → provider-error-B7aKA_dg.mjs} +24 -23
- package/dist/{provider-error-CnaWYTRY.d.mts → provider-error-DZMru0Jv.d.mts} +0 -2
- package/dist/{provider-options-BQ2Msop2.d.mts → provider-options-CR_UfgUE.d.mts} +15 -11
- package/dist/{provider-replay-context--QGWotXx.mjs → provider-replay-context-CHJQzB0n.mjs} +3 -4
- package/dist/{provider-transcript-transform-Hr1kCoMX.mjs → provider-transcript-transform-C-WfgiLJ.mjs} +2 -3
- package/dist/{provider-transport-turn-state-DyaOKAYm.mjs → provider-transport-turn-state-BdMA1v46.mjs} +4 -27
- package/dist/{provider-types-B1e98js5.d.mts → provider-types-CfiTmXyw.d.mts} +3 -5
- package/dist/provider-types.d.mts +7 -7
- package/dist/provider-types.mjs +1 -2
- package/dist/providers.d.mts +2 -4
- package/dist/providers.mjs +14 -15
- package/dist/{record-coerce-BQaoiN3r.mjs → record-coerce-BgUo6bj4.mjs} +1 -2
- package/dist/{request-headers-DO4Mqhw1.mjs → request-headers-DJ4QrMC_.mjs} +1 -2
- package/dist/{required-api-key-2zZTkmsi.mjs → required-api-key-BniLGxy4.mjs} +2 -3
- package/dist/{retry-after-DnHBlFS2.d.mts → retry-after-f3ZIm8TA.d.mts} +0 -2
- package/dist/rolldown-runtime-DYf_mQCB.mjs +34 -0
- package/dist/{sanitize-unicode-CRGuMONI.mjs → sanitize-unicode-B3kUqQ-q.mjs} +1 -2
- package/dist/{sanitize-unicode-BISmUlUv.d.mts → sanitize-unicode-DlVtgmsw.d.mts} +2 -6
- package/dist/{session-affinity-DA4WHv1h.mjs → session-affinity-Czm9tjAm.mjs} +1 -2
- package/dist/{simple-options-CQNPKCEb.mjs → simple-options-D8CTqHvk.mjs} +40 -16
- package/dist/src-CNWvILd1.mjs +2 -0
- package/dist/{src-CQ7nH2mL.mjs → src-CmBmaGOV.mjs} +87 -20
- package/dist/{stable-stringify-CchQEmeA.mjs → stable-stringify-CGB-o900.mjs} +10 -8
- package/dist/{stream-DM-q0y5H.mjs → stream-BEE5qy7Z.mjs} +5 -7
- package/dist/{stream-first-event-timeout-B7RcufAV.mjs → stream-first-event-timeout-CWiv_y--.mjs} +2 -3
- package/dist/{streaming-byte-guard-DBXr1XYn.mjs → streaming-byte-guard-gOcUrHJF.mjs} +1 -2
- package/dist/{string-coerce-BCuWMIrk.mjs → string-coerce-CpcyRbc6.mjs} +1 -2
- package/dist/{string-normalization-B8TDDBX_.mjs → string-normalization-CS77PHD3.mjs} +2 -3
- package/dist/{telemetry-DJibfNKZ.mjs → telemetry-Cd4i-clM.mjs} +6 -8
- package/dist/{tool-schema-json-projection-BSHb4gaJ.mjs → tool-schema-json-projection-C13fPskA.mjs} +11 -16
- package/dist/{transport-stream-shared-CBVh6QEc.mjs → transport-stream-shared-DEpLe9fG.mjs} +24 -30
- package/dist/{transport-stream-shared-D3IAU4jn.d.mts → transport-stream-shared-DW4DoJLv.d.mts} +7 -8
- package/dist/{transport-utils-rxOHnq9y.mjs → transport-utils-Cx9L80PZ.mjs} +6 -8
- package/dist/transports.d.mts +29 -82
- package/dist/transports.mjs +39 -38
- package/dist/{types-BVdTf0YV.d.mts → types-BNp71XKW.d.mts} +11 -6
- package/dist/types-CwcLeW-7.d.mts +1 -0
- package/dist/{types-OVEWUaDh.mjs → types-DIBUKaTM.mjs} +1 -2
- package/dist/types.d.mts +7 -7
- package/dist/types.mjs +9 -9
- package/dist/{usage-CJH5D6Ea.mjs → usage-B8ggJtuG.mjs} +1 -2
- package/dist/{validation-QmyD0E5A.d.mts → validation-BFNWNeUl.d.mts} +1 -3
- package/dist/{validation-DGXqfvkj.mjs → validation-BO7nCOKO.mjs} +5 -8
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/dist/ws.LICENSE +20 -0
- package/dist/x509-transport-state-D4gFbgWG.mjs +40 -0
- package/package.json +13 -7
- package/dist/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +0 -1
- package/dist/cloudflare-BJ2_Xabx.mjs +0 -39
- package/dist/event-stream-B4ZcSvsu.d.mts +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
- package/dist/src-BUsVkrNt.mjs +0 -105
- package/dist/types-Cb3-5WM9.d.mts +0 -1
|
@@ -1,13 +1,117 @@
|
|
|
1
|
-
import { o as isRecord } from "./record-coerce-
|
|
2
|
-
import { p as RESPONSES_RETAINED_USER, v as responsesPromptObserver } from "./openai-responses-contracts-
|
|
3
|
-
import {
|
|
4
|
-
import "./transport-utils-
|
|
5
|
-
import { t as stableStringify } from "./stable-stringify-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { o as isRecord } from "./record-coerce-BgUo6bj4.mjs";
|
|
2
|
+
import { p as RESPONSES_RETAINED_USER, v as responsesPromptObserver } from "./openai-responses-contracts-eppTI5DQ.mjs";
|
|
3
|
+
import { c as truncateUtf16Safe } from "./provider-error-B7aKA_dg.mjs";
|
|
4
|
+
import "./transport-utils-Cx9L80PZ.mjs";
|
|
5
|
+
import { t as stableStringify } from "./stable-stringify-CGB-o900.mjs";
|
|
6
|
+
import "./src-CNWvILd1.mjs";
|
|
7
|
+
import { b as prepareSystemPrompt } from "./simple-options-D8CTqHvk.mjs";
|
|
8
|
+
import { C as sha256Hex } from "./tool-schema-json-projection-C13fPskA.mjs";
|
|
9
|
+
import { Ut as sanitizeResponsesImagePayload, Zt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-BAJzOqwt.mjs";
|
|
10
|
+
import { o as isOpenAIResponsesCompactionOutput } from "./openai-responses-endpoint-AeVu3HmP.mjs";
|
|
11
|
+
const DEFAULT_BUDGET_OPTIONS = {};
|
|
12
|
+
const ASCII_RUN_OR_NON_ASCII_CODE_POINT_RE = /[\p{ASCII}]+|[^\p{ASCII}]/gu;
|
|
13
|
+
const WEIGHTED_CJK_RANGES = [
|
|
14
|
+
[
|
|
15
|
+
[183, 183],
|
|
16
|
+
[12288, 12703],
|
|
17
|
+
[19968, 40869],
|
|
18
|
+
[44032, 55215],
|
|
19
|
+
[65281, 65376]
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
[4352, 4607],
|
|
23
|
+
[11904, 12287],
|
|
24
|
+
[12704, 19967],
|
|
25
|
+
[40870, 40959],
|
|
26
|
+
[40960, 42239],
|
|
27
|
+
[42752, 42759],
|
|
28
|
+
[43360, 43391],
|
|
29
|
+
[55216, 55295],
|
|
30
|
+
[63744, 64255]
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
[711, 711],
|
|
34
|
+
[713, 715],
|
|
35
|
+
[729, 729],
|
|
36
|
+
[746, 747],
|
|
37
|
+
[773, 773],
|
|
38
|
+
[803, 803],
|
|
39
|
+
[65040, 65103],
|
|
40
|
+
[65377, 65500],
|
|
41
|
+
[65504, 65510]
|
|
42
|
+
],
|
|
43
|
+
[[119648, 119665]],
|
|
44
|
+
[
|
|
45
|
+
[94176, 94207],
|
|
46
|
+
[94208, 101647],
|
|
47
|
+
[110576, 110591],
|
|
48
|
+
[110592, 111359],
|
|
49
|
+
[127488, 127743],
|
|
50
|
+
[131072, 195103],
|
|
51
|
+
[196608, 210047]
|
|
52
|
+
]
|
|
53
|
+
];
|
|
54
|
+
const WEIGHTED_CJK_RE = /* @__PURE__ */ (() => new RegExp(`[${WEIGHTED_CJK_RANGES.flatMap((ranges) => ranges.map(([start, end]) => `\\u{${start.toString(16)}}-\\u{${end.toString(16)}}`)).join("")}]`, "u"))();
|
|
55
|
+
const CJK_CATEGORY = /* @__PURE__ */ (() => {
|
|
56
|
+
const maxCodePoint = Math.max(...WEIGHTED_CJK_RANGES.flatMap((ranges) => ranges.map(([, end]) => end)));
|
|
57
|
+
const categories = new Uint8Array(maxCodePoint + 1);
|
|
58
|
+
for (const [bucket, ranges] of WEIGHTED_CJK_RANGES.entries()) for (const [start, end] of ranges) categories.fill(bucket + 1, start, end + 1);
|
|
59
|
+
return categories;
|
|
60
|
+
})();
|
|
61
|
+
function estimateStringChars(text) {
|
|
62
|
+
return estimateStringCharsWithMinimumRawWeight(text);
|
|
63
|
+
}
|
|
64
|
+
/** Apply a raw-text safety floor without multiplying CJK adjustments twice. */
|
|
65
|
+
function estimateStringCharsWithMinimumRawWeight(text, options = DEFAULT_BUDGET_OPTIONS) {
|
|
66
|
+
const minimumRawWeight = Math.max(1, options.minimumRawWeight ?? 1);
|
|
67
|
+
if (minimumRawWeight !== 1 && minimumRawWeight !== 2) {
|
|
68
|
+
let chars = 0;
|
|
69
|
+
for (const match of text.matchAll(ASCII_RUN_OR_NON_ASCII_CODE_POINT_RE)) {
|
|
70
|
+
const segment = match[0];
|
|
71
|
+
const minimumChars = Math.ceil(segment.length * minimumRawWeight);
|
|
72
|
+
chars += segment.charCodeAt(0) <= 127 ? minimumChars : Math.max(estimateStringChars(segment), minimumChars);
|
|
73
|
+
}
|
|
74
|
+
return chars;
|
|
75
|
+
}
|
|
76
|
+
const firstWeighted = text.search(WEIGHTED_CJK_RE);
|
|
77
|
+
if (firstWeighted < 0) return text.length * minimumRawWeight;
|
|
78
|
+
let common = 0;
|
|
79
|
+
let rareBmp = 0;
|
|
80
|
+
let twoToken = 0;
|
|
81
|
+
let threeTokenSupplementary = 0;
|
|
82
|
+
let supplementary = 0;
|
|
83
|
+
for (let index = firstWeighted; index < text.length; index += 1) {
|
|
84
|
+
let codePoint = text.charCodeAt(index);
|
|
85
|
+
if (codePoint < 128) continue;
|
|
86
|
+
if (codePoint >= 55296 && codePoint <= 56319) {
|
|
87
|
+
const low = text.charCodeAt(index + 1);
|
|
88
|
+
if (low >= 56320 && low <= 57343) {
|
|
89
|
+
codePoint = 65536 + (codePoint - 55296) * 1024 + low - 56320;
|
|
90
|
+
index += 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
switch (CJK_CATEGORY[codePoint]) {
|
|
94
|
+
case 1:
|
|
95
|
+
common += 1;
|
|
96
|
+
break;
|
|
97
|
+
case 2:
|
|
98
|
+
rareBmp += 1;
|
|
99
|
+
break;
|
|
100
|
+
case 3:
|
|
101
|
+
twoToken += 1;
|
|
102
|
+
break;
|
|
103
|
+
case 4:
|
|
104
|
+
threeTokenSupplementary += 1;
|
|
105
|
+
break;
|
|
106
|
+
case 5: supplementary += 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return text.length * minimumRawWeight + common * (4 - minimumRawWeight) + rareBmp * (12 - minimumRawWeight) + twoToken * (8 - minimumRawWeight) + threeTokenSupplementary * (12 - 2 * minimumRawWeight) + supplementary * (16 - 2 * minimumRawWeight);
|
|
110
|
+
}
|
|
111
|
+
function estimateTokensFromChars(chars) {
|
|
112
|
+
return Math.ceil(Math.max(0, chars) / 4);
|
|
113
|
+
}
|
|
114
|
+
// packages/ai/src/transports/openai-responses-compact-request.ts
|
|
11
115
|
const COMPACT_REQUEST = Symbol("openaiResponsesCompactRequest");
|
|
12
116
|
function claimResponsesCompactRequest(options) {
|
|
13
117
|
const controller = options ? Reflect.get(options, COMPACT_REQUEST) : void 0;
|
|
@@ -52,8 +156,7 @@ async function requestPreparedOpenAIResponsesCompaction(streamFn, model, context
|
|
|
52
156
|
await stream.result().catch(() => void 0);
|
|
53
157
|
}
|
|
54
158
|
}
|
|
55
|
-
|
|
56
|
-
//#region packages/ai/src/transports/openai-responses-compaction-v2.ts
|
|
159
|
+
// packages/ai/src/transports/openai-responses-compaction-v2.ts
|
|
57
160
|
/** Request-local collection; no partial checkpoint may survive a provider retry. */
|
|
58
161
|
function createResponsesV2CompactionCollector(replayBudget) {
|
|
59
162
|
let count = 0;
|
|
@@ -73,7 +176,7 @@ function createResponsesV2CompactionCollector(replayBudget) {
|
|
|
73
176
|
const sanitized = sanitizeResponsesImagePayload(request);
|
|
74
177
|
sanitized.input?.forEach((inputItem, index) => {
|
|
75
178
|
const source = request.input?.[index];
|
|
76
|
-
if (source && Reflect.get(source, RESPONSES_RETAINED_USER)) Object.assign(inputItem, { [RESPONSES_RETAINED_USER]: true });
|
|
179
|
+
if (source && source !== inputItem && Reflect.get(source, RESPONSES_RETAINED_USER)) Object.assign(inputItem, { [RESPONSES_RETAINED_USER]: true });
|
|
77
180
|
});
|
|
78
181
|
return sanitized;
|
|
79
182
|
},
|
|
@@ -149,7 +252,7 @@ function retainV2Users(input) {
|
|
|
149
252
|
}
|
|
150
253
|
if (low > 0) content.push({
|
|
151
254
|
...part,
|
|
152
|
-
text: part.text
|
|
255
|
+
text: truncateUtf16Safe(part.text, low)
|
|
153
256
|
});
|
|
154
257
|
}
|
|
155
258
|
remaining = 0;
|
|
@@ -167,8 +270,7 @@ function retainV2Users(input) {
|
|
|
167
270
|
}
|
|
168
271
|
return retained.toReversed();
|
|
169
272
|
}
|
|
170
|
-
|
|
171
|
-
//#region packages/ai/src/transports/openai-responses-prompt-observer-internal.ts
|
|
273
|
+
// packages/ai/src/transports/openai-responses-prompt-observer-internal.ts
|
|
172
274
|
function readFinalResponsesPrompt(request) {
|
|
173
275
|
if (typeof request.instructions === "string") return ["instructions", request.instructions];
|
|
174
276
|
const message = (Array.isArray(request.input) ? request.input : []).find((item) => {
|
|
@@ -195,8 +297,7 @@ function createResponsesPromptEgressObserver(options, context) {
|
|
|
195
297
|
});
|
|
196
298
|
};
|
|
197
299
|
}
|
|
198
|
-
|
|
199
|
-
//#region packages/ai/src/transports/openai-responses-request-lifecycle.ts
|
|
300
|
+
// packages/ai/src/transports/openai-responses-request-lifecycle.ts
|
|
200
301
|
const lifecycleKey = Symbol("openclaw.responsesRequestLifecycle");
|
|
201
302
|
const independentRequestKey = Symbol("openclaw.independentResponsesRequest");
|
|
202
303
|
/** A full-input side request must neither consume nor replace a session's continuation. */
|
|
@@ -242,5 +343,4 @@ function withResponsesRequestAcceptance(events, lifecycle, signal) {
|
|
|
242
343
|
}
|
|
243
344
|
} };
|
|
244
345
|
}
|
|
245
|
-
|
|
246
|
-
export { createResponsesV2CompactionCollector as a, requestPreparedOpenAIResponsesCompaction as c, createResponsesPromptEgressObserver as i, responsesRequestLifecycle as n, claimResponsesCompactRequest as o, withResponsesRequestAcceptance as r, copyResponsesCompactRequest as s, independentResponsesRequest as t };
|
|
346
|
+
export { createResponsesV2CompactionCollector as a, requestPreparedOpenAIResponsesCompaction as c, createResponsesPromptEgressObserver as i, estimateStringChars as l, responsesRequestLifecycle as n, claimResponsesCompactRequest as o, withResponsesRequestAcceptance as r, copyResponsesCompactRequest as s, independentResponsesRequest as t };
|