@openclaw/ai 2026.11.3 → 2026.11.5-beta.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.
Files changed (140) hide show
  1. package/README.md +11 -8
  2. package/dist/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +1 -0
  3. package/dist/anthropic-DEKgalVg.mjs +182 -0
  4. package/dist/{anthropic-payload-policy-C0ki72BT.d.mts → anthropic-payload-policy-CXCJ5Pmj.d.mts} +21 -4
  5. package/dist/{anthropic-stream-reducer-yWDb5Cct.mjs → anthropic-stream-lifecycle-DF2qVvg1.mjs} +845 -649
  6. package/dist/{anthropic-tool-projection-C2-d1eZ3.d.mts → anthropic-tool-projection-D5DyrL6C.d.mts} +6 -7
  7. package/dist/{anthropic-tool-projection-DZOKfAmL.mjs → anthropic-tool-projection-dGRfr4iT.mjs} +22 -32
  8. package/dist/{api-registry-gDt0faai.d.mts → api-registry-DY2MLUyg.d.mts} +2 -2
  9. package/dist/assistant-output-CD4kY9gu.mjs +16 -0
  10. package/dist/{azure-openai-responses-BvvXzZbi.mjs → azure-openai-responses-DbQV5RTx.mjs} +47 -53
  11. package/dist/{cloudflare-Dttf8jKq.mjs → cloudflare-BJ2_Xabx.mjs} +1 -1
  12. package/dist/{credential-redaction-XvsPf7Yi.d.mts → credential-redaction-DrgndwTJ.d.mts} +5 -3
  13. package/dist/{deferred-event-buffer-DAvyP7qA.mjs → deferred-event-buffer-tIGkTkTm.mjs} +1 -2
  14. package/dist/{diagnostics-v7oVEW59.mjs → diagnostics-CloVGQiK.mjs} +27 -20
  15. package/dist/{diagnostics-DzrF1h4J.mjs → diagnostics-o1PrVNQb.mjs} +11 -4
  16. package/dist/diagnostics.d.mts +6 -7
  17. package/dist/diagnostics.mjs +4 -4
  18. package/dist/{env-api-keys-Xd8dm_aV.mjs → env-api-keys-BuHc86ya.mjs} +1 -26
  19. package/dist/event-stream-B4ZcSvsu.d.mts +1 -0
  20. package/dist/{event-stream-CzpE1g_o.d.mts → event-stream-BYmtRe8-.d.mts} +1 -1
  21. package/dist/event-stream.d.mts +2 -2
  22. package/dist/event-stream.mjs +1 -2
  23. package/dist/expect-lbe3Hgrh.mjs +8 -0
  24. package/dist/{github-copilot-request-facts-F-EmvkpW.mjs → github-copilot-request-facts-BZ_EMo7X.mjs} +1 -1
  25. package/dist/{google-Cpi_cLKZ.mjs → google-B1g82bn4.mjs} +7 -8
  26. package/dist/{google-interactions-CGINbsjO.mjs → google-interactions-Ckr0Z99Z.mjs} +243 -269
  27. package/dist/{google-messages-DQMgG5yG.mjs → google-messages-A-9d3y5V.mjs} +52 -18
  28. package/dist/{google-provider-stream-BHd0cST9.mjs → google-provider-stream-CNVh4gpm.mjs} +19 -11
  29. package/dist/{google-shared-vtag8bj5.mjs → google-shared-WNM86ZcW.mjs} +72 -42
  30. package/dist/{google-vertex-eKoUnW7N.mjs → google-vertex-CXjleC6g.mjs} +3 -3
  31. package/dist/{google-video-slots-D8tPH8wX.mjs → google-video-slots-Bxt-OXO8.mjs} +1 -1
  32. package/dist/{host-CWt55nnF.mjs → host-DX7ORpeH.mjs} +46 -39
  33. package/dist/{host-jJOffdlW.d.mts → host-ccbwPC3A.d.mts} +17 -9
  34. package/dist/{host-policy-Dm7PM6AD.mjs → host-policy-jCZebuXx.mjs} +2 -2
  35. package/dist/index-Bczt0MnO.d.mts +17 -0
  36. package/dist/index.d.mts +8 -7
  37. package/dist/index.mjs +9 -7
  38. package/dist/internal/anthropic.d.mts +21 -26
  39. package/dist/internal/anthropic.mjs +6 -6
  40. package/dist/internal/google-model-family.mjs +1 -1
  41. package/dist/internal/google.d.mts +15 -0
  42. package/dist/internal/google.mjs +1 -0
  43. package/dist/internal/model-request-body.d.mts +37 -0
  44. package/dist/internal/model-request-body.mjs +106 -0
  45. package/dist/internal/openai-completions-compat.d.mts +1 -1
  46. package/dist/internal/openai-completions-compat.mjs +1 -1
  47. package/dist/internal/openai-responses-payload-policy.d.mts +2 -2
  48. package/dist/internal/openai-responses-payload-policy.mjs +2 -2
  49. package/dist/internal/openai.d.mts +14 -12
  50. package/dist/internal/openai.mjs +11 -10
  51. package/dist/internal/reasoning-tag-text-partitioner.d.mts +26 -0
  52. package/dist/{reasoning-tag-text-partitioner-CU9A4Lg8.mjs → internal/reasoning-tag-text-partitioner.mjs} +313 -111
  53. package/dist/internal/retry-after.d.mts +2 -2
  54. package/dist/internal/retry-after.mjs +96 -32
  55. package/dist/internal/runtime.d.mts +15 -41
  56. package/dist/internal/runtime.mjs +9 -10
  57. package/dist/internal/shared.d.mts +21 -25
  58. package/dist/internal/shared.mjs +9 -98
  59. package/dist/internal/tool-schema.d.mts +10 -10
  60. package/dist/internal/tool-schema.mjs +4 -4
  61. package/dist/{llm-request-activity-CfMuh5cC.mjs → llm-request-activity-DzaHoRAU.mjs} +2 -2
  62. package/dist/mistral-CjHkvsqR.mjs +3741 -0
  63. package/dist/{openai.LICENSE → mistral.LICENSE} +1 -1
  64. package/dist/{model-transport-url-BrsjjdjR.d.mts → model-transport-url-BdksnBqu.d.mts} +6 -8
  65. package/dist/{number-coercion-37gmNkuA.mjs → number-coercion-C7HsBgUL.mjs} +7 -2
  66. package/dist/observe-async-iterator-AlARO5wS.d.mts +178 -0
  67. package/dist/observe-async-iterator-DgmegcZR.mjs +181 -0
  68. package/dist/{openai-chatgpt-responses-BZa3SySh.mjs → openai-chatgpt-responses-CwS5JP7A.mjs} +61 -80
  69. package/dist/{openai-completions-compat-CBvb2eld.d.mts → openai-completions-compat-CJ-NsDzg.d.mts} +12 -6
  70. package/dist/{openai-completions-compat-bNQXF1y9.mjs → openai-completions-compat-CstlTQuF.mjs} +74 -50
  71. package/dist/{openai-completions-CCZ_UHCk.mjs → openai-completions-sj4S-RXQ.mjs} +5 -5
  72. package/dist/openai-completions-transport-BDAIA0_P.mjs +3406 -0
  73. package/dist/{openai-prompt-cache-DgjD-UL5.d.mts → openai-prompt-cache-BZGaIWYh.d.mts} +4 -4
  74. package/dist/{openai-prompt-cache-B9AvdoEo.mjs → openai-prompt-cache-CgDoFhO0.mjs} +5 -4
  75. package/dist/{openai-responses-compaction-replay-_sUXtcwU.d.mts → openai-responses-compaction-replay-CNHk6k53.d.mts} +4 -4
  76. package/dist/{openai-responses-contracts-B1nkeLL6.d.mts → openai-responses-contracts-BXMcvO7F.d.mts} +4 -10
  77. package/dist/{openai-responses-contracts-B5mGAbR6.mjs → openai-responses-contracts-xU-n9AJJ.mjs} +36 -37
  78. package/dist/{openai-responses-endpoint-CfKR6N5f.mjs → openai-responses-endpoint-DCkURKS0.mjs} +55 -8
  79. package/dist/openai-responses-ev_c6oTy.mjs +89 -0
  80. package/dist/{openai-responses-payload-policy-BzM52TTH.d.mts → openai-responses-payload-policy-DyE30gdD.d.mts} +7 -7
  81. package/dist/{openai-responses-request-lifecycle-CTqHc02t.mjs → openai-responses-request-lifecycle-BuOs0mwI.mjs} +12 -26
  82. package/dist/{openai-responses-shared-wx9v1MCn.mjs → openai-responses-shared-BmRQnUPP.mjs} +633 -1493
  83. package/dist/{openai-responses-terminal-usage-CpVjkqn-.d.mts → openai-responses-terminal-usage-D7IhRA6i.d.mts} +9 -3
  84. package/dist/{openai-tool-schema-BTEU2xmN.mjs → openai-tool-schema-CsoYgnWy.mjs} +97 -122
  85. package/dist/otel-Buswj0Mf.mjs +766 -0
  86. package/dist/{overflow-OF3PgPbw.mjs → overflow-CpApyjG2.mjs} +1 -1
  87. package/dist/{positive-integer-Bb4Evc7L.mjs → positive-integer-DiqE5vNi.mjs} +2 -3
  88. package/dist/{prompt-cache-stability-D_MeCQFI.mjs → prompt-cache-stability-w-ICeyOI.mjs} +1 -1
  89. package/dist/{provider-error-qtZD2inE.mjs → provider-error-DD-fo4Rz.mjs} +71 -234
  90. package/dist/{provider-options-DAzsyi49.d.mts → provider-options-Mo8NM5d1.d.mts} +16 -5
  91. package/dist/{provider-replay-context-4vxI7p4V.mjs → provider-replay-context-xyU7-CiT.mjs} +2 -2
  92. package/dist/provider-transcript-transform-DtaxNcC1.mjs +32 -0
  93. package/dist/{provider-transport-turn-state-D_GjPJHe.mjs → provider-transport-turn-state-BIS8maBK.mjs} +4 -4
  94. package/dist/{provider-types-CWl4VXvE.d.mts → provider-types-B1e98js5.d.mts} +3 -3
  95. package/dist/provider-types.d.mts +7 -6
  96. package/dist/providers.d.mts +2 -2
  97. package/dist/providers.mjs +26 -29
  98. package/dist/{record-coerce-CNDovvft.mjs → record-coerce-BQaoiN3r.mjs} +4 -1
  99. package/dist/request-headers-DO4Mqhw1.mjs +10 -0
  100. package/dist/{required-api-key-D088S4Cd.mjs → required-api-key-2zZTkmsi.mjs} +1 -1
  101. package/dist/{retry-after-BrmTv0jL.d.mts → retry-after-DnHBlFS2.d.mts} +21 -1
  102. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  103. package/dist/{sanitize-unicode-ZqVLLEKC.d.mts → sanitize-unicode-BISmUlUv.d.mts} +2 -2
  104. package/dist/{simple-options-xJkqrG_E.mjs → simple-options-tLSeECry.mjs} +108 -82
  105. package/dist/src-BUsVkrNt.mjs +105 -0
  106. package/dist/{src-CyA0zJnt.mjs → src-CQ7nH2mL.mjs} +4 -7
  107. package/dist/stable-stringify-CchQEmeA.mjs +84 -0
  108. package/dist/{stream-C4YDqhFj.mjs → stream-DrtAWu7c.mjs} +2 -6
  109. package/dist/{stream-first-event-timeout-D_TfJHRJ.mjs → stream-first-event-timeout-B7RcufAV.mjs} +16 -13
  110. package/dist/{string-coerce-Cj8sqWHx.mjs → string-coerce-BCuWMIrk.mjs} +1 -1
  111. package/dist/string-normalization-B8TDDBX_.mjs +32 -0
  112. package/dist/telemetry-CvK1yQg7.mjs +582 -0
  113. package/dist/{tool-schema-json-projection-B1sTYwfH.mjs → tool-schema-json-projection-BQpiJlXJ.mjs} +53 -69
  114. package/dist/{transport-stream-shared-lhgkTOz3.mjs → transport-stream-shared-D2uFMhMc.mjs} +177 -93
  115. package/dist/{transport-stream-shared-8ru8eX4s.d.mts → transport-stream-shared-D3IAU4jn.d.mts} +29 -15
  116. package/dist/{transport-utils-DwOpuTjL.mjs → transport-utils-Da_39MYi.mjs} +23 -38
  117. package/dist/transports.d.mts +42 -39
  118. package/dist/transports.mjs +215 -296
  119. package/dist/{types-CVYzKrMl.d.mts → types-BVdTf0YV.d.mts} +38 -3
  120. package/dist/types-Cb3-5WM9.d.mts +1 -0
  121. package/dist/{types-BXd0kI8-.mjs → types-OVEWUaDh.mjs} +3 -1
  122. package/dist/types.d.mts +7 -6
  123. package/dist/types.mjs +7 -5
  124. package/dist/{validation-9FSkE8T-.mjs → validation-DGXqfvkj.mjs} +45 -27
  125. package/dist/{validation-BQ5u20Ru.d.mts → validation-QmyD0E5A.d.mts} +1 -1
  126. package/dist/validation.d.mts +1 -1
  127. package/dist/validation.mjs +1 -2
  128. package/package.json +40 -6
  129. package/dist/anthropic-lueA8LUg.mjs +0 -221
  130. package/dist/assistant-output-BnQm3fov.mjs +0 -47
  131. package/dist/event-stream-CDpFza-M.d.mts +0 -1
  132. package/dist/index-DSprYWaz.d.mts +0 -185
  133. package/dist/mistral-CQ7aoWg2.mjs +0 -512
  134. package/dist/model-request-body-BD5vy4rP.d.mts +0 -17
  135. package/dist/openai-CiRi-nVE.mjs +0 -20077
  136. package/dist/openai-completions-transport-DFvSBbUT.mjs +0 -10881
  137. package/dist/openai-responses-DQsZKUoI.mjs +0 -87
  138. package/dist/rolldown-runtime-B4iAMlE-.mjs +0 -35
  139. package/dist/types-CBJthzJX.d.mts +0 -1
  140. package/dist/ws.LICENSE +0 -20
@@ -0,0 +1,84 @@
1
+ //#region packages/normalization-core/src/stable-stringify.ts
2
+ const preserveString = (value) => value;
3
+ /** Deterministically stringifies values, optionally normalizing strings before key ordering. */
4
+ function stableStringify(value, normalizeString = preserveString) {
5
+ return stringifyStableValue(value, /* @__PURE__ */ new WeakSet(), normalizeString);
6
+ }
7
+ /** Writes the same deterministic text without retaining completed container strings. */
8
+ function writeStableStringify(value, write, normalizeString = preserveString) {
9
+ write(stringifyStableValue(value, /* @__PURE__ */ new WeakSet(), normalizeString, write));
10
+ }
11
+ function stringifyStableValue(value, stack, normalizeString, write) {
12
+ if (value === null || value === void 0) return String(value);
13
+ if (typeof value === "number" && !Number.isFinite(value)) return JSON.stringify(String(value));
14
+ if (typeof value === "bigint") return JSON.stringify(value.toString());
15
+ if (typeof value === "string") return JSON.stringify(normalizeString(value));
16
+ if (typeof value !== "object") return JSON.stringify(value) ?? "null";
17
+ if (stack.has(value)) return JSON.stringify("[Circular]");
18
+ stack.add(value);
19
+ try {
20
+ if (value instanceof Error) return stringifyStableValue({
21
+ name: value.name,
22
+ message: value.message,
23
+ stack: value.stack
24
+ }, stack, normalizeString, write);
25
+ if (value instanceof Uint8Array) return stringifyStableValue({
26
+ type: "Uint8Array",
27
+ data: encodeBase64(value)
28
+ }, stack, normalizeString, write);
29
+ if (Array.isArray(value)) {
30
+ if (write) {
31
+ write("[");
32
+ let separator = "";
33
+ for (const entry of value) {
34
+ write(separator);
35
+ write(stringifyStableValue(entry, stack, normalizeString, write));
36
+ separator = ",";
37
+ }
38
+ write("]");
39
+ return "";
40
+ }
41
+ const serializedEntries = [];
42
+ for (const entry of value) serializedEntries.push(stringifyStableValue(entry, stack, normalizeString));
43
+ return `[${serializedEntries.join(",")}]`;
44
+ }
45
+ const record = value;
46
+ const keys = Object.keys(record);
47
+ const fields = normalizeString === preserveString ? keys.sort() : keys.map((key) => ({
48
+ key,
49
+ normalizedKey: normalizeString(key)
50
+ })).sort((left, right) => {
51
+ return compareStableStrings(left.normalizedKey, right.normalizedKey) || compareStableStrings(left.key, right.key);
52
+ });
53
+ write?.("{");
54
+ const serializedFields = normalizeString === preserveString ? keys : [];
55
+ let separator = "";
56
+ let fieldIndex = 0;
57
+ for (const field of fields) {
58
+ const key = typeof field === "string" ? field : field.key;
59
+ const prefix = `${JSON.stringify(typeof field === "string" ? field : field.normalizedKey)}:`;
60
+ if (write) {
61
+ write(`${separator}${prefix}`);
62
+ write(stringifyStableValue(record[key], stack, normalizeString, write));
63
+ separator = ",";
64
+ } else serializedFields[fieldIndex++] = `${prefix}${stringifyStableValue(record[key], stack, normalizeString)}`;
65
+ }
66
+ if (write) {
67
+ write("}");
68
+ return "";
69
+ }
70
+ return `{${serializedFields.join(",")}}`;
71
+ } finally {
72
+ stack.delete(value);
73
+ }
74
+ }
75
+ function encodeBase64(value) {
76
+ let binary = "";
77
+ for (const byte of value) binary += String.fromCharCode(byte);
78
+ return btoa(binary);
79
+ }
80
+ function compareStableStrings(left, right) {
81
+ return left < right ? -1 : left > right ? 1 : 0;
82
+ }
83
+ //#endregion
84
+ export { writeStableStringify as n, stableStringify as t };
@@ -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-CWt55nnF.mjs";
2
+ import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-DX7ORpeH.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) {
@@ -46,14 +46,10 @@ function retainUnscopedStreamLifetime(stream, runWithHost) {
46
46
  releaseLifetime = resolve;
47
47
  });
48
48
  runWithHost(() => lifetime);
49
- let released = false;
50
49
  let resultSettled = false;
51
50
  let bufferSettled = false;
52
51
  const releaseIfSettled = () => {
53
- if (!released && resultSettled && bufferSettled) {
54
- released = true;
55
- releaseLifetime();
56
- }
52
+ if (resultSettled && bufferSettled) releaseLifetime();
57
53
  };
58
54
  const push = stream.push.bind(stream);
59
55
  const end = stream.end.bind(stream);
@@ -1,4 +1,4 @@
1
- import { a as clampTimerTimeoutMs } from "./number-coercion-37gmNkuA.mjs";
1
+ import { a as clampTimerTimeoutMs } from "./number-coercion-C7HsBgUL.mjs";
2
2
  //#region packages/ai/src/utils/stream-first-event-timeout.ts
3
3
  function getFirstStreamEventTimeoutMs(options) {
4
4
  return options?.firstEventTimeoutMs;
@@ -16,7 +16,7 @@ function createFirstStreamEventTimeoutError(context) {
16
16
  formatOptionalField("api", context.api),
17
17
  formatOptionalField("model", context.model)
18
18
  ].join("");
19
- return /* @__PURE__ */ new Error(`${stage}HTTP stream opened but did not deliver a first SSE event within ${context.timeoutMs}ms after streaming headers (first-event timeout).${details}` + (context.hint ? ` ${context.hint}` : ""));
19
+ return Object.assign(/* @__PURE__ */ new Error(`${stage}HTTP stream opened but did not deliver a first SSE event within ${context.timeoutMs}ms after streaming headers (first-event timeout).${details}` + (context.hint ? ` ${context.hint}` : "")), { name: "FirstStreamEventTimeoutError" });
20
20
  }
21
21
  function createFirstStreamEventAbortController(parentSignal) {
22
22
  const controller = new AbortController();
@@ -47,18 +47,21 @@ function withFirstStreamEventTimeout(stream, context) {
47
47
  let timer;
48
48
  let completed = false;
49
49
  try {
50
- let next = await new Promise((resolve, reject) => {
51
- timer = setTimeout(() => {
52
- const timeoutError = createFirstStreamEventTimeoutError(timeoutContext);
53
- timeoutContext.onTimeout?.(timeoutError);
54
- reject(timeoutError);
55
- timeoutContext.abort?.(timeoutError);
56
- }, timeoutMs);
57
- timer.unref?.();
58
- iterator.next().then(resolve, reject);
59
- }).finally(() => {
50
+ let next;
51
+ try {
52
+ next = await new Promise((resolve, reject) => {
53
+ timer = setTimeout(() => {
54
+ const timeoutError = createFirstStreamEventTimeoutError(timeoutContext);
55
+ timeoutContext.onTimeout?.(timeoutError);
56
+ reject(timeoutError);
57
+ timeoutContext.abort?.(timeoutError);
58
+ }, timeoutMs);
59
+ timer.unref?.();
60
+ iterator.next().then(resolve, reject);
61
+ });
62
+ } finally {
60
63
  if (timer) clearTimeout(timer);
61
- });
64
+ }
62
65
  while (!next.done) {
63
66
  yield next.value;
64
67
  next = await iterator.next();
@@ -52,7 +52,7 @@ function normalizeFastMode(raw) {
52
52
  "enabled",
53
53
  "fast"
54
54
  ].includes(key)) return true;
55
- if (key === "ultrafast") return "ultrafast";
55
+ if (key === "ultrafast" || key === "ultra") return "ultrafast";
56
56
  if (["auto", "automatic"].includes(key)) return "auto";
57
57
  }
58
58
  /** Type guard for strings that remain non-empty after trimming. */
@@ -0,0 +1,32 @@
1
+ import { o as normalizeOptionalString } from "./string-coerce-BCuWMIrk.mjs";
2
+ //#region packages/normalization-core/src/string-normalization.ts
3
+ /** Retains runtime string entries from arrays without normalizing their contents. */
4
+ function filterStringEntries(value) {
5
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
6
+ }
7
+ /** Coerces entries to strings, trims them, and drops empty results. */
8
+ function normalizeStringEntries(list) {
9
+ return (list ?? []).map((entry) => String(entry).trim()).filter(Boolean);
10
+ }
11
+ /** Returns first-seen unique values while preserving insertion order. */
12
+ function uniqueValues(values) {
13
+ return [...new Set(values)];
14
+ }
15
+ /** Returns first-seen unique strings while preserving insertion order. */
16
+ function uniqueStrings(values) {
17
+ return uniqueValues(values);
18
+ }
19
+ /** Normalizes array-backed string lists and rejects non-array input as empty. */
20
+ function normalizeTrimmedStringList(value) {
21
+ if (!Array.isArray(value)) return [];
22
+ return value.flatMap((entry) => {
23
+ const normalized = normalizeOptionalString(entry);
24
+ return normalized ? [normalized] : [];
25
+ });
26
+ }
27
+ /** Normalizes an array-backed string list and removes duplicates. */
28
+ function normalizeUniqueTrimmedStringList(value) {
29
+ return uniqueStrings(normalizeTrimmedStringList(value));
30
+ }
31
+ //#endregion
32
+ export { uniqueValues as i, normalizeStringEntries as n, normalizeUniqueTrimmedStringList as r, filterStringEntries as t };