@openclaw/ai 2026.8.1-beta.1 → 2026.8.1-beta.3

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.
Files changed (88) hide show
  1. package/dist/{anthropic-CE-7SkF6.mjs → anthropic-B8KwTtlb.mjs} +62 -37
  2. package/dist/{anthropic-SrGtwsJu.d.mts → anthropic-BECQCNdF.d.mts} +0 -2
  3. package/dist/{src-QkygScBs.mjs → anthropic-BQXQudmA.mjs} +0 -2
  4. package/dist/{anthropic-usage-Ma4iX6uG.mjs → anthropic-compaction-replay-4Zx7-aCr.mjs} +225 -103
  5. package/dist/anthropic-payload-policy-CSx7MoKH.d.mts +50 -0
  6. package/dist/{api-registry-EpJoVwM1.d.mts → api-registry-DFxSnFqG.d.mts} +1 -1
  7. package/dist/{azure-openai-responses-Cc_kasye.mjs → azure-openai-responses-Aa4mVcYG.mjs} +23 -29
  8. package/dist/diagnostics.d.mts +24 -1
  9. package/dist/diagnostics.mjs +2 -1
  10. package/dist/event-stream-BVVgDSdq.d.mts +1 -0
  11. package/dist/{event-stream-DRmDMRHH.d.mts → event-stream-D91-ohD_.d.mts} +3 -1
  12. package/dist/{event-stream-CEV9t6da.mjs → event-stream-uSMZJ3FA.mjs} +16 -3
  13. package/dist/event-stream.d.mts +1 -1
  14. package/dist/event-stream.mjs +1 -1
  15. package/dist/{google-shared-Cq2UKx1l.mjs → google-shared-M1dl64nz.mjs} +17 -19
  16. package/dist/google-thinking-level-C-V3tecN.mjs +9 -0
  17. package/dist/{google-vertex-CusxWzvE.mjs → google-vertex-DCJHM_a5.mjs} +5 -4
  18. package/dist/{google-CGQu21aw.mjs → google-yDRnipeq.mjs} +4 -4
  19. package/dist/host-DF_yxOsA.mjs +477 -0
  20. package/dist/{host-Dn4_SZI2.d.mts → host-DJq_FGcz.d.mts} +13 -8
  21. package/dist/index.d.mts +7 -7
  22. package/dist/index.mjs +7 -5
  23. package/dist/internal/anthropic.d.mts +21 -7
  24. package/dist/internal/anthropic.mjs +5 -5
  25. package/dist/internal/openai-responses-payload-policy.d.mts +3 -0
  26. package/dist/internal/openai-responses-payload-policy.mjs +3 -0
  27. package/dist/internal/openai.d.mts +6 -6
  28. package/dist/internal/openai.mjs +9 -7
  29. package/dist/internal/runtime.d.mts +19 -5
  30. package/dist/internal/runtime.mjs +85 -72
  31. package/dist/internal/shared.d.mts +17 -8
  32. package/dist/internal/shared.mjs +4 -5
  33. package/dist/{json-parse-BvXNt1-7.mjs → json-parse-CDnesDM_.mjs} +4 -6
  34. package/dist/{mistral-Dx6VzNjf.mjs → mistral-D6hRXI7A.mjs} +67 -72
  35. package/dist/{number-coercion-1Miyb5MO.mjs → number-coercion-H9qHik3g.mjs} +7 -2
  36. package/dist/openai-chatgpt-jwt-KWcgd0d_.mjs +19 -0
  37. package/dist/{openai-chatgpt-responses-SC9m0FSf.mjs → openai-chatgpt-responses-C339VIfT.mjs} +235 -146
  38. package/dist/{openai-completions-BaIpl93j.mjs → openai-completions-D88orSJ9.mjs} +88 -67
  39. package/dist/openai-completions-compat-B0KTleXp.d.mts +43 -0
  40. package/dist/{openai-responses-Bdx3V_Yu.mjs → openai-responses-BXEcr-Tp.mjs} +17 -24
  41. package/dist/openai-responses-contracts-CD75pQ0m.d.mts +68 -0
  42. package/dist/openai-responses-contracts-DvILoqBk.mjs +247 -0
  43. package/dist/openai-responses-payload-policy-BDo8CQsx.mjs +208 -0
  44. package/dist/openai-responses-payload-policy-CNGFT9zr.d.mts +41 -0
  45. package/dist/{openai-responses-prompt-observer-internal-DDZPxRfr.mjs → openai-responses-prompt-observer-internal-BG-1AsBI.mjs} +2 -3
  46. package/dist/{openai-responses-stream-internal-Bl8YyVtF.mjs → openai-responses-shared-Cvt5MgEm.mjs} +1287 -1039
  47. package/dist/{openai-reasoning-compat-DKebnIBL.mjs → openai-stop-reason-9OONKyAm.mjs} +222 -180
  48. package/dist/{openai-transport-shared-Cipt7egQ.mjs → openai-tool-projection-CHGLt03m.mjs} +239 -128
  49. package/dist/provider-error-C8mBRJDl.mjs +424 -0
  50. package/dist/provider-error-CzNw4BWX.d.mts +12 -0
  51. package/dist/provider-options-AvldWZt8.mjs +21 -0
  52. package/dist/{provider-options-C5kYML7i.d.mts → provider-options-Cc5ZQ6Aa.d.mts} +19 -3
  53. package/dist/provider-transcript-transform--gtf0ZbR.mjs +32 -0
  54. package/dist/provider-types.d.mts +31 -0
  55. package/dist/provider-types.mjs +8 -0
  56. package/dist/providers.d.mts +1 -1
  57. package/dist/providers.mjs +17 -19
  58. package/dist/{reasoning-tag-text-partitioner-CGDyLWUR.mjs → reasoning-tag-text-partitioner-5ygO2rZc.mjs} +17 -8
  59. package/dist/record-coerce-DdXsgUd_.mjs +23 -0
  60. package/dist/{model-utils-Dau5dlgm.mjs → sanitize-unicode-BP7HLLZn.mjs} +28 -2
  61. package/dist/session-resources-CkR4WWy1.mjs +21 -0
  62. package/dist/simple-options-oqsXB6U3.mjs +450 -0
  63. package/dist/src-D2H6yKkH.mjs +2 -0
  64. package/dist/{stream-first-event-timeout-BIBomOGq.mjs → stream-first-event-timeout-MK28puvq.mjs} +2 -2
  65. package/dist/string-coerce-fsri9iCu.mjs +34 -0
  66. package/dist/{tool-schema-json-projection-B1b-XCn5.mjs → tool-schema-json-projection-FEr-jOoZ.mjs} +20 -13
  67. package/dist/transport-utils-Bv0FHkd0.mjs +138 -0
  68. package/dist/transports.d.mts +199 -209
  69. package/dist/transports.mjs +1842 -1364
  70. package/dist/types-BDdaOVi2.mjs +6 -0
  71. package/dist/{types-CH7ReIcU.d.mts → types-DTAP49HF.d.mts} +35 -2
  72. package/dist/types.d.mts +5 -5
  73. package/dist/types.mjs +6 -4
  74. package/dist/utf16-slice-CvGodqok.mjs +29 -0
  75. package/dist/{validation-DAa_yFOM.mjs → validation-B61OhAio.mjs} +6 -6
  76. package/dist/{validation-CcPcuEbR.d.mts → validation-DYNNrU9u.d.mts} +1 -1
  77. package/dist/validation.d.mts +1 -1
  78. package/dist/validation.mjs +1 -1
  79. package/package.json +15 -1
  80. package/dist/host-Bl7Kgddo.mjs +0 -407
  81. package/dist/openai-chatgpt-jwt-DhAAzLkj.mjs +0 -39
  82. package/dist/openai-responses-contracts-BBKBfAqR.d.mts +0 -116
  83. package/dist/openai-responses-shared-CCyMvg7M.mjs +0 -403
  84. package/dist/provider-error-DI0Ts28U.mjs +0 -47
  85. package/dist/sanitize-unicode-DT5o51ur.mjs +0 -26
  86. package/dist/tool-result-text-Dvkp2Dus.mjs +0 -274
  87. package/dist/transform-messages-DfjpNXNQ.mjs +0 -2
  88. package/dist/transport-stream-shared-CPNv7A3r.mjs +0 -297
@@ -0,0 +1,424 @@
1
+ import { o as normalizeStringifiedOptionalString } from "./string-coerce-fsri9iCu.mjs";
2
+ import { i as asOptionalRecord } from "./record-coerce-DdXsgUd_.mjs";
3
+ import { t as truncateUtf16Safe } from "./utf16-slice-CvGodqok.mjs";
4
+ import "./number-coercion-H9qHik3g.mjs";
5
+ //#region packages/normalization-core/src/balanced-json.ts
6
+ function isJsonOpeningDelimiter(char, openers) {
7
+ return (char === "{" || char === "[") && openers.includes(char);
8
+ }
9
+ /** Extracts the first balanced JSON object/array from text. */
10
+ function extractBalancedJsonPrefix(raw, opts = {}) {
11
+ const openers = opts.openers ?? ["{", "["];
12
+ let start = 0;
13
+ while (start < raw.length && !isJsonOpeningDelimiter(raw[start], openers)) start += 1;
14
+ const stack = [];
15
+ let inString = false;
16
+ let escaped = false;
17
+ for (let index = start; index < raw.length; index += 1) {
18
+ const char = raw[index];
19
+ if (inString) {
20
+ if (escaped) escaped = false;
21
+ else if (char === "\\") escaped = true;
22
+ else if (char === "\"") inString = false;
23
+ } else if (char === "\"") inString = true;
24
+ else if (isJsonOpeningDelimiter(char, openers)) stack.push(char);
25
+ else if (stack.length > 0 && char === (stack.at(-1) === "{" ? "}" : "]")) {
26
+ stack.pop();
27
+ if (stack.length === 0) return {
28
+ json: raw.slice(start, index + 1),
29
+ startIndex: start,
30
+ endIndex: index
31
+ };
32
+ }
33
+ }
34
+ return null;
35
+ }
36
+ /** Extracts every balanced JSON object/array fragment from arbitrary text. */
37
+ function extractBalancedJsonFragments(raw, opts = {}) {
38
+ const fragments = [];
39
+ for (let offset = 0; offset < raw.length;) {
40
+ const fragment = extractBalancedJsonPrefix(raw.slice(offset), opts);
41
+ if (!fragment) break;
42
+ fragments.push({
43
+ json: fragment.json,
44
+ startIndex: offset + fragment.startIndex,
45
+ endIndex: offset + fragment.endIndex
46
+ });
47
+ offset += fragment.endIndex + 1;
48
+ }
49
+ return fragments;
50
+ }
51
+ //#endregion
52
+ //#region packages/normalization-core/src/stable-stringify.ts
53
+ const preserveString = (value) => value;
54
+ /** Deterministically stringifies values, optionally normalizing strings before key ordering. */
55
+ function stableStringify(value, normalizeString = preserveString) {
56
+ return stringifyStableValue(value, /* @__PURE__ */ new WeakSet(), normalizeString);
57
+ }
58
+ function stringifyStableValue(value, stack, normalizeString) {
59
+ if (value === null || value === void 0) return String(value);
60
+ if (typeof value === "number" && !Number.isFinite(value)) return JSON.stringify(String(value));
61
+ if (typeof value === "bigint") return JSON.stringify(value.toString());
62
+ if (typeof value === "string") return JSON.stringify(normalizeString(value));
63
+ if (typeof value !== "object") return JSON.stringify(value) ?? "null";
64
+ if (stack.has(value)) return JSON.stringify("[Circular]");
65
+ stack.add(value);
66
+ try {
67
+ return stringifyObjectValue(value, stack, normalizeString);
68
+ } finally {
69
+ stack.delete(value);
70
+ }
71
+ }
72
+ function stringifyObjectValue(value, stack, normalizeString) {
73
+ if (value instanceof Error) return stringifyStableValue({
74
+ name: value.name,
75
+ message: value.message,
76
+ stack: value.stack
77
+ }, stack, normalizeString);
78
+ if (value instanceof Uint8Array) return stringifyStableValue({
79
+ type: "Uint8Array",
80
+ data: encodeBase64(value)
81
+ }, stack, normalizeString);
82
+ if (Array.isArray(value)) {
83
+ const serializedEntries = [];
84
+ for (const entry of value) serializedEntries.push(stringifyStableValue(entry, stack, normalizeString));
85
+ return `[${serializedEntries.join(",")}]`;
86
+ }
87
+ const record = value;
88
+ const entries = Object.keys(record).map((key) => ({
89
+ key,
90
+ normalizedKey: normalizeString(key)
91
+ })).toSorted((left, right) => {
92
+ return compareStableStrings(left.normalizedKey, right.normalizedKey) || compareStableStrings(left.key, right.key);
93
+ });
94
+ const serializedFields = [];
95
+ for (const { key, normalizedKey } of entries) serializedFields.push(`${JSON.stringify(normalizedKey)}:${stringifyStableValue(record[key], stack, normalizeString)}`);
96
+ return `{${serializedFields.join(",")}}`;
97
+ }
98
+ function encodeBase64(value) {
99
+ let binary = "";
100
+ for (const byte of value) binary += String.fromCharCode(byte);
101
+ return btoa(binary);
102
+ }
103
+ function compareStableStrings(left, right) {
104
+ return left < right ? -1 : left > right ? 1 : 0;
105
+ }
106
+ //#endregion
107
+ //#region packages/media-core/src/base64.ts
108
+ /** Estimates decoded bytes without allocating a cleaned copy of the base64 payload. */
109
+ function estimateBase64DecodedBytes(base64) {
110
+ let effectiveLen = 0;
111
+ for (let i = 0; i < base64.length; i += 1) {
112
+ if (base64.charCodeAt(i) <= 32) continue;
113
+ effectiveLen += 1;
114
+ }
115
+ if (effectiveLen === 0) return 0;
116
+ let padding = 0;
117
+ let end = base64.length - 1;
118
+ while (end >= 0 && base64.charCodeAt(end) <= 32) end -= 1;
119
+ if (end >= 0 && base64[end] === "=") {
120
+ padding = 1;
121
+ end -= 1;
122
+ while (end >= 0 && base64.charCodeAt(end) <= 32) end -= 1;
123
+ if (end >= 0 && base64[end] === "=") padding = 2;
124
+ }
125
+ const estimated = Math.floor(effectiveLen * 3 / 4) - padding;
126
+ return Math.max(0, estimated);
127
+ }
128
+ function isBase64DataChar(code) {
129
+ return code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 47;
130
+ }
131
+ function base64DataValue(code) {
132
+ if (code >= 65 && code <= 90) return code - 65;
133
+ if (code >= 97 && code <= 122) return code - 97 + 26;
134
+ if (code >= 48 && code <= 57) return code - 48 + 52;
135
+ return code === 43 ? 62 : 63;
136
+ }
137
+ /**
138
+ * Normalizes and validates a base64 string, returning canonical no-whitespace
139
+ * base64 only when the input has valid alphabet, padding, and length.
140
+ */
141
+ function canonicalizeBase64(base64) {
142
+ let out;
143
+ let outLen = 0;
144
+ let padding = 0;
145
+ let sawPadding = false;
146
+ let lastDataCode = 0;
147
+ for (let i = 0; i < base64.length; i += 1) {
148
+ const code = base64.charCodeAt(i);
149
+ if (code <= 32) {
150
+ if (out === void 0) {
151
+ out = Buffer.allocUnsafe(base64.length - 1);
152
+ for (let j = 0; j < i; j += 1) out[j] = base64.charCodeAt(j);
153
+ outLen = i;
154
+ }
155
+ continue;
156
+ }
157
+ if (code === 61) {
158
+ padding += 1;
159
+ if (padding > 2) return;
160
+ sawPadding = true;
161
+ } else if (sawPadding || !isBase64DataChar(code)) return;
162
+ else lastDataCode = code;
163
+ if (out !== void 0) {
164
+ out[outLen] = code;
165
+ outLen += 1;
166
+ }
167
+ }
168
+ const cleanedLength = out === void 0 ? base64.length : outLen;
169
+ if (cleanedLength === 0) return;
170
+ const remainder = cleanedLength % 4;
171
+ if (remainder !== 0 && (sawPadding || remainder === 1)) return;
172
+ const effectivePadding = remainder === 0 ? padding : 4 - remainder;
173
+ const padBitMask = effectivePadding === 2 ? 15 : effectivePadding === 1 ? 3 : 0;
174
+ if (padBitMask !== 0 && (base64DataValue(lastDataCode) & padBitMask) !== 0) return;
175
+ const cleaned = out === void 0 ? base64 : out.subarray(0, outLen).toString("latin1");
176
+ return remainder === 0 ? cleaned : cleaned + "=".repeat(4 - remainder);
177
+ }
178
+ //#endregion
179
+ //#region packages/ai/src/utils/credential-redaction.ts
180
+ const NON_CREDENTIAL_FIELD_NAMES = /* @__PURE__ */ new Set([
181
+ "passwordfile",
182
+ "tokenbudget",
183
+ "tokencount",
184
+ "tokenfield",
185
+ "tokenlimit",
186
+ "tokens"
187
+ ]);
188
+ const CREDENTIAL_FIELD_SUFFIX_RE = /(?:apikey|cookie|credential|passphrase|passwd|password|privatekey|secret|secret(?:access)?key|signingkey|token)$/u;
189
+ const MEDIA_PAYLOAD_SUFFIXES = "base64|blob|buffer|bytes|data|delta|frames?|output|result|(?:file|media|source)?(?:uri|url)";
190
+ const MEDIA_FIELD_NAME_RE = new RegExp(`^(?:input|output)?(?:audio|image|video)s?(?:${MEDIA_PAYLOAD_SUFFIXES})*$`, "u");
191
+ const MEDIA_PAYLOAD_SUFFIX_RE = new RegExp(`^(?:${MEDIA_PAYLOAD_SUFFIXES})$`, "u");
192
+ const MEDIA_WRAPPER_NAME_RE = /^(?:input_|output_)?(?:audio|image|video)s?(?:_|$)/iu;
193
+ const AUTHORIZATION_VALUE_RE = /\b(Bearer|Basic)\s+[A-Za-z0-9+/._~=-]{8,}/giu;
194
+ const JWT_VALUE_RE = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/gu;
195
+ const COOKIE_HEADER_RE = /\b((?:set-)?cookie\s*:\s*)([^\r\n]+)/giu;
196
+ const QUOTED_CREDENTIAL_HEADER_RE = /(["'])((?:[A-Za-z][A-Za-z0-9_.-]*[_.-])?(?:api[_.-]?key|authorization|passphrase|passwd|password|private[_.-]?key|secret(?:[_.-]?access)?[_.-]?key|signing[_.-]?key|token))\1\s*:\s*([^,}\r\n]+)/giu;
197
+ const CREDENTIAL_HEADER_RE = /\b((?:[A-Za-z][A-Za-z0-9_.-]*[_.-])?(?:api[_.-]?key|authorization|passphrase|passwd|password|private[_.-]?key|secret(?:[_.-]?access)?[_.-]?key|signing[_.-]?key|token))\s*:\s*([^\r\n]+)/giu;
198
+ const LOOSE_QUOTED_CREDENTIAL_PAIR_RE = /\b((?!(?:api|endpoint|method|model|provider|status|type)=)[A-Za-z][A-Za-z0-9_.-]{0,64})=(["'])([A-Za-z0-9+/._~%=-]{16,})\2/giu;
199
+ const LOOSE_CREDENTIAL_PAIR_RE = /\b((?!(?:api|endpoint|method|model|provider|status|type)=)[A-Za-z][A-Za-z0-9_.-]{0,64})=([A-Za-z0-9+/._~%=-]{16,})(?=[;&#'"\s]|$)/giu;
200
+ const MEDIA_DATA_URL_RE = /data:(?:audio|image|video)\/[a-z0-9.+-]+(?:;[^,;\s]+)*;base64,[ \t]*(?:\r?\n[ \t]*)?[a-z0-9+/_=-]+(?:[ \t]*\r?\n[ \t]*[a-z0-9+/_=-]+)*/giu;
201
+ const MAX_DIAGNOSTIC_JSON_LENGTH = 16 * 1024;
202
+ const PLAIN_BRACKET_TAG_RE = /^\[[A-Za-z0-9][A-Za-z0-9 _.-]*\]$/u;
203
+ const JSON_ARRAY_START_RE = /\[\s*(?:[{"\d\]-]|true\b|false\b|null\b)/u;
204
+ const MALFORMED_JSON_RE = /\{|(?:"[^"]+"|\b(?:b64_json|data|(?:input|output)?(?:audio|image|video)[\w-]*))\s*:/iu;
205
+ function looksLikeDiagnosticJson(value) {
206
+ return JSON_ARRAY_START_RE.test(value) || MALFORMED_JSON_RE.test(value);
207
+ }
208
+ function normalizeDiagnosticFieldName(value) {
209
+ return value.toLowerCase().replaceAll(/[^a-z0-9]/g, "");
210
+ }
211
+ function isCredentialFieldName(key) {
212
+ const normalized = normalizeDiagnosticFieldName(key);
213
+ if (!normalized || NON_CREDENTIAL_FIELD_NAMES.has(normalized)) return false;
214
+ return normalized === "authorization" || normalized === "proxyauthorization" || CREDENTIAL_FIELD_SUFFIX_RE.test(normalized);
215
+ }
216
+ function redactCredentialText(value) {
217
+ return value.replace(AUTHORIZATION_VALUE_RE, "$1 <redacted>").replace(JWT_VALUE_RE, "<redacted-jwt>").replace(COOKIE_HEADER_RE, "$1<redacted>").replace(QUOTED_CREDENTIAL_HEADER_RE, "$1$2$1: <redacted>").replace(CREDENTIAL_HEADER_RE, "$1: <redacted>").replace(LOOSE_QUOTED_CREDENTIAL_PAIR_RE, "$1=$2<redacted>$2").replace(LOOSE_CREDENTIAL_PAIR_RE, "$1=<redacted>");
218
+ }
219
+ function diagnosticBytes(value, numericArrays = false) {
220
+ return value instanceof ArrayBuffer ? new Uint8Array(value) : ArrayBuffer.isView(value) ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) : numericArrays && Array.isArray(value) && value.every((byte) => Number.isInteger(byte) && byte >= 0 && byte <= 255) ? Uint8Array.from(value) : void 0;
221
+ }
222
+ function isDiagnosticMediaPayload(descriptors) {
223
+ const type = descriptors.type?.value;
224
+ return typeof type === "string" && /^(?:input|output)?(?:audio|image|video)/u.test(normalizeDiagnosticFieldName(type)) || [
225
+ "mimeType",
226
+ "mime_type",
227
+ "mediaType",
228
+ "media_type",
229
+ "contentType",
230
+ "content_type"
231
+ ].some((key) => {
232
+ const mime = descriptors[key]?.value;
233
+ return typeof mime === "string" && /^(?:audio|image|video)\//iu.test(mime);
234
+ });
235
+ }
236
+ function extractDiagnosticMediaField(key, value, parentMedia) {
237
+ const normalized = normalizeDiagnosticFieldName(key);
238
+ const privateField = normalized === "b64json";
239
+ const mediaField = MEDIA_FIELD_NAME_RE.test(normalized) || MEDIA_WRAPPER_NAME_RE.test(key);
240
+ const contextualPayload = parentMedia && MEDIA_PAYLOAD_SUFFIX_RE.test(normalized);
241
+ if (!privateField && !mediaField && !contextualPayload) {
242
+ const nestedMedia = value !== null && (typeof value === "object" || /^(?:0|[1-9]\d*)$/u.test(key));
243
+ return parentMedia && nestedMedia ? { kind: "context" } : void 0;
244
+ }
245
+ if (/(?:uri|url)$/u.test(normalized)) return { kind: "redacted" };
246
+ const encoded = diagnosticBytes(value, true) ?? (typeof value === "string" ? value : void 0);
247
+ if (encoded === void 0) return { kind: privateField || Array.isArray(value) ? "redacted" : "context" };
248
+ return {
249
+ kind: "redacted",
250
+ bytes: typeof encoded === "string" ? estimateBase64DecodedBytes(encoded) : encoded.byteLength,
251
+ source: encoded
252
+ };
253
+ }
254
+ function projectDiagnosticValue(value, policy = {}, seen = /* @__PURE__ */ new WeakSet(), mediaPayload = false, state = {
255
+ changed: false,
256
+ nodesRemaining: 64
257
+ }) {
258
+ try {
259
+ if (typeof value === "string") {
260
+ const projected = redactDiagnosticText(value);
261
+ state.changed ||= projected !== value;
262
+ return projected;
263
+ }
264
+ if (!value || typeof value !== "object") return value;
265
+ const binary = diagnosticBytes(value);
266
+ if (binary) {
267
+ state.changed = true;
268
+ return policy.projectBinary?.(binary) ?? {
269
+ redacted: "<redacted>",
270
+ bytes: binary.byteLength
271
+ };
272
+ }
273
+ if (seen.has(value)) return "[Circular]";
274
+ if (state.nodesRemaining-- <= 0) {
275
+ state.changed = true;
276
+ return "[Truncated]";
277
+ }
278
+ const keys = Reflect.ownKeys(value).slice(0, 65);
279
+ const descriptors = Object.fromEntries(keys.slice(0, 64).flatMap((key) => {
280
+ const descriptor = typeof key === "string" && Object.getOwnPropertyDescriptor(value, key);
281
+ return descriptor ? [[key, descriptor]] : [];
282
+ }));
283
+ state.changed ||= keys.length > 64;
284
+ seen.add(value);
285
+ const out = Array.isArray(value) ? [] : {};
286
+ const rawName = typeof descriptors.name?.value === "string" ? descriptors.name.value : descriptors.key?.value;
287
+ const redactValueField = keys.length > 64 || typeof rawName === "string" && isCredentialFieldName(rawName);
288
+ const redactMedia = mediaPayload || keys.length > 64 || isDiagnosticMediaPayload(descriptors);
289
+ for (const [key, descriptor] of Object.entries(descriptors)) {
290
+ if (!("value" in descriptor) || !descriptor.enumerable && (policy.propertyScope === "enumerable" || ![
291
+ "cause",
292
+ "message",
293
+ "name",
294
+ "stack"
295
+ ].includes(key)) || key === "length") continue;
296
+ const child = descriptor.value;
297
+ if (policy.omitField?.(key) || isCredentialFieldName(key)) {
298
+ state.changed = true;
299
+ continue;
300
+ }
301
+ if (redactValueField && key === "value") {
302
+ out[key] = "<redacted>";
303
+ state.changed = true;
304
+ continue;
305
+ }
306
+ const media = extractDiagnosticMediaField(key, child, redactMedia);
307
+ if (media?.kind === "redacted") {
308
+ const redacted = media.bytes === void 0 ? "<redacted>" : {
309
+ redacted: "<redacted>",
310
+ bytes: media.bytes
311
+ };
312
+ Object.assign(out, policy.projectMedia?.(key, media) ?? { [key]: redacted });
313
+ state.changed = true;
314
+ continue;
315
+ }
316
+ out[key] = projectDiagnosticValue(child, policy, seen, media?.kind === "context", state);
317
+ }
318
+ return out;
319
+ } catch {
320
+ state.changed = true;
321
+ return "[Unserializable]";
322
+ }
323
+ }
324
+ /** Redacts bounded structured JSON while preserving harmless diagnostic text byte-for-byte. */
325
+ function redactDiagnosticText(value) {
326
+ const text = redactCredentialText(value).replace(MEDIA_DATA_URL_RE, "<redacted>");
327
+ if (!looksLikeDiagnosticJson(text)) return text;
328
+ if (text.length > MAX_DIAGNOSTIC_JSON_LENGTH) return "[Oversized diagnostic JSON redacted]";
329
+ let cursor = 0;
330
+ let redacted = "";
331
+ let unstructured = "";
332
+ for (const fragment of extractBalancedJsonFragments(text)) {
333
+ const plainText = text.slice(cursor, fragment.startIndex);
334
+ unstructured += plainText;
335
+ redacted += plainText;
336
+ try {
337
+ const state = {
338
+ changed: false,
339
+ nodesRemaining: 64
340
+ };
341
+ const projected = projectDiagnosticValue(JSON.parse(fragment.json), {}, /* @__PURE__ */ new WeakSet(), false, state);
342
+ redacted += state.changed ? stableStringify(projected) : fragment.json;
343
+ } catch {
344
+ if (!PLAIN_BRACKET_TAG_RE.test(fragment.json) || JSON_ARRAY_START_RE.test(fragment.json)) return "[Malformed diagnostic JSON redacted]";
345
+ redacted += fragment.json;
346
+ }
347
+ cursor = fragment.endIndex + 1;
348
+ }
349
+ const remainder = text.slice(cursor);
350
+ return looksLikeDiagnosticJson(unstructured + remainder) ? "[Malformed diagnostic JSON redacted]" : redacted + remainder;
351
+ }
352
+ //#endregion
353
+ //#region packages/ai/src/utils/provider-error.ts
354
+ const MAX_ERROR_BODY_LENGTH = 4e3;
355
+ let providerErrorRedactor;
356
+ function configureProviderErrorRedactor(redactor) {
357
+ const previous = providerErrorRedactor;
358
+ providerErrorRedactor = redactor;
359
+ return previous;
360
+ }
361
+ function readProviderErrorField(record, key) {
362
+ const value = record?.[key];
363
+ return typeof value === "string" || typeof value === "number" && Number.isFinite(value) ? normalizeStringifiedOptionalString(value) : void 0;
364
+ }
365
+ function readCauseCode(error) {
366
+ const seen = /* @__PURE__ */ new Set();
367
+ for (let cause = asOptionalRecord(error.cause); cause && seen.size < 8 && !seen.has(cause); cause = asOptionalRecord(cause.cause)) {
368
+ seen.add(cause);
369
+ const code = readProviderErrorField(cause, "code");
370
+ if (code) return code;
371
+ }
372
+ }
373
+ function stringifyField(value, maxLength) {
374
+ if (value === void 0 || value === null) return;
375
+ const text = redactDiagnosticText((typeof value === "string" ? value : stableStringify(value)).trim());
376
+ if (!text) return;
377
+ return text.length <= maxLength ? text : `${truncateUtf16Safe(text, maxLength)}... [truncated]`;
378
+ }
379
+ function buildProjection(snapshot, signal) {
380
+ const error = asOptionalRecord(snapshot);
381
+ const nestedError = asOptionalRecord(error?.error);
382
+ const response = asOptionalRecord(error?.response);
383
+ const status = [
384
+ error?.status,
385
+ error?.statusCode,
386
+ response?.status,
387
+ response?.statusCode
388
+ ].find((value) => typeof value === "number" && Number.isFinite(value));
389
+ const bodyValue = error?.errorBody ?? error?.body ?? response?.body ?? response?.data ?? nestedError;
390
+ const body = stringifyField(bodyValue, MAX_ERROR_BODY_LENGTH);
391
+ const originalMessage = (typeof snapshot === "string" ? snapshot : void 0) ?? readProviderErrorField(error, "message") ?? readProviderErrorField(nestedError, "message");
392
+ const genericMessage = originalMessage === `${status} status code (no body)`;
393
+ let errorMessage = status !== void 0 && body && (!originalMessage || genericMessage) ? `${status}: ${body}` : originalMessage ?? body ?? stringifyField(snapshot, MAX_ERROR_BODY_LENGTH) ?? "Unknown provider error";
394
+ if (status !== void 0 && !body && originalMessage && !originalMessage.startsWith(String(status))) errorMessage = `${status}: ${errorMessage}`;
395
+ const rawMetadata = stringifyField(asOptionalRecord(nestedError?.metadata)?.raw, MAX_ERROR_BODY_LENGTH);
396
+ if (rawMetadata && !errorMessage.includes(rawMetadata)) errorMessage += `\n${rawMetadata}`;
397
+ const errorCode = readProviderErrorField(error, "errorCode") ?? readProviderErrorField(error, "code") ?? readProviderErrorField(nestedError, "code") ?? (error ? readCauseCode(error) : void 0) ?? (status === void 0 ? void 0 : String(status));
398
+ const errorType = readProviderErrorField(error, "errorType") ?? readProviderErrorField(error, "type") ?? readProviderErrorField(nestedError, "type");
399
+ return {
400
+ stopReason: signal?.aborted ? "aborted" : "error",
401
+ errorMessage: stringifyField(errorMessage, 4096) ?? "Unknown provider error",
402
+ ...errorCode ? { errorCode: truncateUtf16Safe(errorCode, 256) } : {},
403
+ ...errorType ? { errorType: truncateUtf16Safe(errorType, 256) } : {},
404
+ ...body ? { errorBody: stringifyField(bodyValue, 500) } : {}
405
+ };
406
+ }
407
+ /** Projects one hostile provider throw into final, bounded assistant terminal fields. */
408
+ function projectProviderError(error, signal) {
409
+ try {
410
+ const localSnapshot = projectDiagnosticValue(error);
411
+ let snapshot = localSnapshot;
412
+ try {
413
+ snapshot = providerErrorRedactor?.(localSnapshot) ?? localSnapshot;
414
+ } catch {}
415
+ return buildProjection(snapshot, signal);
416
+ } catch {
417
+ return {
418
+ stopReason: signal?.aborted ? "aborted" : "error",
419
+ errorMessage: "Unknown provider error"
420
+ };
421
+ }
422
+ }
423
+ //#endregion
424
+ export { estimateBase64DecodedBytes as a, canonicalizeBase64 as i, projectProviderError as n, stableStringify as o, projectDiagnosticValue as r, configureProviderErrorRedactor as t };
@@ -0,0 +1,12 @@
1
+ //#region packages/ai/src/utils/provider-error.d.ts
2
+ type ProviderErrorProjection = {
3
+ stopReason: "aborted" | "error";
4
+ errorMessage: string;
5
+ errorCode?: string;
6
+ errorType?: string;
7
+ errorBody?: string;
8
+ };
9
+ type ProviderErrorRedactor = (value: unknown) => unknown;
10
+ declare function configureProviderErrorRedactor(redactor: ProviderErrorRedactor | undefined): ProviderErrorRedactor | undefined;
11
+ //#endregion
12
+ export { ProviderErrorRedactor as n, configureProviderErrorRedactor as r, ProviderErrorProjection as t };
@@ -0,0 +1,21 @@
1
+ //#region packages/ai/src/provider-options.ts
2
+ const CODE_MODE_TOOL_SURFACE_OBSERVER = Symbol("openaiCodeModeToolSurfaceObserver");
3
+ const CODE_MODE_TOOL_SURFACE_COLLECTOR = Symbol("openaiCodeModeToolSurfaceCollector");
4
+ const codeModeToolSurfaceObserver = {
5
+ set(options, observer, collector) {
6
+ Reflect.set(options, CODE_MODE_TOOL_SURFACE_OBSERVER, observer);
7
+ if (collector) Reflect.set(options, CODE_MODE_TOOL_SURFACE_COLLECTOR, collector);
8
+ },
9
+ get(options) {
10
+ if (!options) return;
11
+ const observer = Reflect.get(options, CODE_MODE_TOOL_SURFACE_OBSERVER);
12
+ return typeof observer === "function" ? (observation) => observer(observation) : void 0;
13
+ },
14
+ getCollector(options) {
15
+ if (!options) return;
16
+ const collector = Reflect.get(options, CODE_MODE_TOOL_SURFACE_COLLECTOR);
17
+ return typeof collector === "function" ? (observation) => collector(observation) : void 0;
18
+ }
19
+ };
20
+ //#endregion
21
+ export { codeModeToolSurfaceObserver as t };
@@ -1,4 +1,4 @@
1
- import { z as StreamOptions } from "./types-CH7ReIcU.mjs";
1
+ import { U as StreamOptions } from "./types-DTAP49HF.mjs";
2
2
  import OpenAI from "openai";
3
3
  import Anthropic from "@anthropic-ai/sdk";
4
4
  import { ResponseCreateParamsStreaming } from "openai/resources/responses/responses.js";
@@ -73,6 +73,20 @@ declare function reconcileOpenAIResponsesToolChoice(choice: OpenAIResponsesToolC
73
73
  declare function reconcileOpenAICompletionsToolChoice(choice: OpenAICompletionsSdkToolChoice, projection: OpenAIToolProjection): OpenAICompletionsSdkToolChoice | undefined;
74
74
  //#endregion
75
75
  //#region packages/ai/src/provider-options.d.ts
76
+ type OpenAIResponsesCompactionRejection = {
77
+ data: string;
78
+ id?: string;
79
+ };
80
+ type CodeModeToolSurfaceObservation = {
81
+ beforeToolIdentities: readonly string[];
82
+ afterToolIdentities: readonly string[];
83
+ };
84
+ type CodeModeToolSurfaceObserver = (observation: CodeModeToolSurfaceObservation) => void;
85
+ declare const codeModeToolSurfaceObserver: {
86
+ set(options: object, observer: CodeModeToolSurfaceObserver, collector?: CodeModeToolSurfaceObserver): void;
87
+ get(options: object | undefined): CodeModeToolSurfaceObserver | undefined;
88
+ getCollector(options: object | undefined): CodeModeToolSurfaceObserver | undefined;
89
+ };
76
90
  type AnthropicEffort = "low" | "medium" | "high" | "xhigh" | "max";
77
91
  type AnthropicThinkingDisplay = "summarized" | "omitted";
78
92
  /** Provider options shared by the Anthropic provider and canonical transport. */
@@ -128,8 +142,10 @@ type BaseOpenAIStreamOptions = StreamOptions & {
128
142
  topP?: number;
129
143
  authProfileId?: string;
130
144
  firstEventTimeoutMs?: number;
131
- onFirstEventTimeout?: (reason: Error) => void;
145
+ onFirstEventTimeout?: (reason: Error) => void; /** Internal owner notification after a server rejects a persisted compaction checkpoint. */
146
+ onCompactionRejected?: (checkpoint: OpenAIResponsesCompactionRejection) => void;
132
147
  openclawCodeModeToolSurface?: boolean;
148
+ openclawCodeModeAllowedHostedToolTypes?: Set<string>;
133
149
  frequencyPenalty?: number;
134
150
  presencePenalty?: number;
135
151
  seed?: number;
@@ -141,4 +157,4 @@ type OpenAICompletionsOptions = BaseOpenAIStreamOptions & {
141
157
  reasoningEffort?: OpenAIReasoningEffort;
142
158
  };
143
159
  //#endregion
144
- export { resolveOpenAIReasoningEffortForModel as _, OpenAICompletionsOptions as a, supportsOpenAITemperature as b, projectOpenAITools as c, OpenAIApiReasoningEffort as d, OpenAIReasoningEffort as f, normalizeOpenAIReasoningEffort as g, isOpenAIGpt56Model as h, BaseOpenAIStreamOptions as i, reconcileOpenAICompletionsToolChoice as l, isOpenAIGpt55Model as m, AnthropicOptions as n, OpenAICompletionsToolChoice as o, isOpenAIGpt54MiniModel as p, AnthropicThinkingDisplay as r, OpenAIToolProjection as s, AnthropicEffort as t, reconcileOpenAIResponsesToolChoice as u, resolveOpenAISupportedReasoningEfforts as v, supportsOpenAIReasoningEffort as y };
160
+ export { supportsOpenAITemperature as C, supportsOpenAIReasoningEffort as S, isOpenAIGpt55Model as _, CodeModeToolSurfaceObservation as a, resolveOpenAIReasoningEffortForModel as b, codeModeToolSurfaceObserver as c, projectOpenAITools as d, reconcileOpenAICompletionsToolChoice as f, isOpenAIGpt54MiniModel as g, OpenAIReasoningEffort as h, BaseOpenAIStreamOptions as i, OpenAICompletionsToolChoice as l, OpenAIApiReasoningEffort as m, AnthropicOptions as n, OpenAICompletionsOptions as o, reconcileOpenAIResponsesToolChoice as p, AnthropicThinkingDisplay as r, OpenAIResponsesCompactionRejection as s, AnthropicEffort as t, OpenAIToolProjection as u, isOpenAIGpt56Model as v, resolveOpenAISupportedReasoningEfforts as x, normalizeOpenAIReasoningEffort as y };
@@ -0,0 +1,32 @@
1
+ import { i as transformMessages } from "./host-DF_yxOsA.mjs";
2
+ //#region packages/ai/src/provider-transcript-transform.ts
3
+ const IMAGE_OMISSION = "(image omitted: model does not support images)";
4
+ const VIDEO_OMISSION = "(video omitted: provider does not support video input)";
5
+ function projectUserMediaForTransport(content, supportsImages, supportsVideo) {
6
+ const result = [];
7
+ for (const block of content) {
8
+ if (block.type === "text" || block.type === "image" && supportsImages || block.type === "video" && supportsVideo) {
9
+ result.push(block);
10
+ continue;
11
+ }
12
+ const text = block.type === "video" ? VIDEO_OMISSION : IMAGE_OMISSION;
13
+ const previous = result.at(-1);
14
+ if (block.data.trim() && !(previous?.type === "text" && previous.text === text)) result.push({
15
+ type: "text",
16
+ text
17
+ });
18
+ }
19
+ return result;
20
+ }
21
+ function transformProviderMessages(messages, model, normalizeToolCallId) {
22
+ const target = {
23
+ ...model,
24
+ input: model.input.filter((type) => type !== "video")
25
+ };
26
+ return transformMessages(messages.map((message) => {
27
+ if (message.role !== "user" || !Array.isArray(message.content)) return message;
28
+ return Object.assign({}, message, { content: projectUserMediaForTransport(message.content, model.input.includes("image"), model.api === "openai-completions" && model.input.includes("video")) });
29
+ }), target, normalizeToolCallId);
30
+ }
31
+ //#endregion
32
+ export { transformProviderMessages as t };
@@ -0,0 +1,31 @@
1
+ import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./anthropic-BECQCNdF.mjs";
2
+ import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
3
+ import { $ as Transport, A as OpenAIResponsesCompat, B as StopReason, C as KnownImagesApi, D as Model, F as ProviderImagesOptions, G as TextSignatureV1, I as ProviderReplayState, J as ThinkingLevel, K as ThinkingBudgets, L as ProviderResponse, M as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, N as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, O as ModelThinkingLevel, P as Provider, Q as ToolResultMessage, S as KnownApi, T as MaybePromise, U as StreamOptions, V as StreamFn, W as TextContent, X as Tool, Y as ThinkingLevelMap, Z as ToolCall, _ as ImagesModel, a as AssistantMessage, b as ImagesProvider, c as AssistantMessageEventStreamLike, d as Context, et as Usage, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, j as OpenRouterRouting, k as OpenAICompletionsCompat, l as CacheRetention, m as ImagesContext, n as Api, nt as ValidateToolArgumentsFn, o as AssistantMessageEvent, p as ImagesApi, q as ThinkingContent, r as AssistantDeliveryTtsFacts, rt as VercelGatewayRouting, s as AssistantMessageEventStreamContract, t as AnthropicMessagesCompat, tt as UserMessage, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as SimpleStreamOptions } from "./types-DTAP49HF.mjs";
4
+ import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-D91-ohD_.mjs";
5
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-DYNNrU9u.mjs";
6
+ //#region packages/ai/src/provider-types.d.ts
7
+ declare const PROVIDER_CONTEXT_HANDOFF: unique symbol;
8
+ type VideoContent = Omit<ImageContent, "type"> & {
9
+ type: "video";
10
+ };
11
+ type MediaContent = ImageContent | VideoContent;
12
+ type ModelInputContent = TextContent | MediaContent;
13
+ type ProviderUserMessage = Omit<UserMessage, "content"> & {
14
+ content: string | ModelInputContent[];
15
+ };
16
+ type ProviderMessage = ProviderUserMessage | AssistantMessage | ToolResultMessage;
17
+ type ProviderContext = Omit<Context, "messages"> & {
18
+ messages: ProviderMessage[];
19
+ };
20
+ type ProviderModel<TApi extends Api = Api> = Omit<Model<TApi>, "input"> & {
21
+ input: ModelInputContent["type"][];
22
+ };
23
+ type ProviderContextHandoff = () => Promise<ProviderContext>;
24
+ type ProviderStreamOptions = StreamOptions & {
25
+ [PROVIDER_CONTEXT_HANDOFF]?: ProviderContextHandoff;
26
+ };
27
+ type ProviderStreamFunction<TApi extends Api = Api, TOptions extends StreamOptions = ProviderStreamOptions> = (model: ProviderModel<TApi>, context: ProviderContext, options?: TOptions) => AssistantMessageEventStreamContract;
28
+ /** Resolves provider-only context without widening the canonical call contract. */
29
+ declare function resolveProviderContext(context: Context | ProviderContext, options?: ProviderStreamOptions): Promise<ProviderContext>;
30
+ //#endregion
31
+ 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_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, 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 MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, 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 Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, 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 createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type extractDiagnosticError, type formatThrownValue, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type validateToolArguments, type validateToolCall };
@@ -0,0 +1,8 @@
1
+ //#region packages/ai/src/provider-types.ts
2
+ const PROVIDER_CONTEXT_HANDOFF = Symbol("providerContextHandoff");
3
+ /** Resolves provider-only context without widening the canonical call contract. */
4
+ async function resolveProviderContext(context, options) {
5
+ return options?.[PROVIDER_CONTEXT_HANDOFF]?.() ?? context;
6
+ }
7
+ //#endregion
8
+ export { PROVIDER_CONTEXT_HANDOFF, resolveProviderContext };
@@ -1,4 +1,4 @@
1
- import { n as ApiRegistry } from "./api-registry-EpJoVwM1.mjs";
1
+ import { n as ApiRegistry } from "./api-registry-DFxSnFqG.mjs";
2
2
  import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-2uo_1OR1.mjs";
3
3
 
4
4
  //#region packages/ai/src/providers/register-builtins.d.ts