@openclaw/slack 2026.7.2-beta.2 → 2026.7.2-beta.4

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 (161) hide show
  1. package/dist/{account-configured-DzC407uv.js → account-configured-BwfXBo_F.js} +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{account-inspect-Di7ditqZ.js → account-inspect-jn1xLaVi.js} +9 -2
  4. package/dist/account-reply-mode-DrUXogvO.js +14 -0
  5. package/dist/{accounts-BOJJiHSr.js → accounts-BSr252c_.js} +13 -25
  6. package/dist/accounts.runtime-CjULMLTa.js +2 -0
  7. package/dist/{action-runtime-Cee2ih0s.js → action-runtime-CFU52n4W.js} +11 -17
  8. package/dist/action-runtime.runtime-9-17zvKH.js +2 -0
  9. package/dist/{actions-BZiuSTIq.js → actions-D51foiwR.js} +5 -5
  10. package/dist/{actions.runtime-DoD0-gxw.js → actions.runtime-BMJwtf5C.js} +1 -1
  11. package/dist/api.js +15 -15
  12. package/dist/{approval-handler.runtime-CUPtIM4k.js → approval-handler.runtime-3b4-wxMl.js} +2 -2
  13. package/dist/{channel-DaIiGUOp.js → channel-Ds8NKvfr.js} +75 -41
  14. package/dist/channel-config-api.js +1 -1
  15. package/dist/channel-plugin-api.js +1 -1
  16. package/dist/{channel-type-Cfm6_6n1.js → channel-type-DXkUajFP.js} +3 -3
  17. package/dist/{channel.setup-C-mLz50O.js → channel.setup-DOSTEDfA.js} +8 -5
  18. package/dist/{config-schema-xPSnK2VK.js → config-schema-B4j4tCOI.js} +236 -30
  19. package/dist/{directory-config-DRkFujwG.js → directory-config-B08pm5ZT.js} +1 -1
  20. package/dist/directory-contract-api.js +1 -1
  21. package/dist/{directory-live-D_yZhjgp.js → directory-live-DpPKzPrn.js} +2 -2
  22. package/dist/doctor-contract-U6oVntbM.js +173 -0
  23. package/dist/doctor-contract-api.js +1 -1
  24. package/dist/{group-policy-85UWiriS.js → group-policy-CdnQzQBI.js} +98 -125
  25. package/dist/{interactive-replies-BilWUdcI.js → interactive-replies-C3ffk6oN.js} +1 -1
  26. package/dist/interactive-replies-api.js +1 -1
  27. package/dist/{message-tool-api-CA9jZrCY.js → message-tool-api-ByVyIVOh.js} +3 -3
  28. package/dist/message-tool-api.js +1 -1
  29. package/dist/{monitor-CalGciTs.js → monitor-CnB_WKvF.js} +3 -3
  30. package/dist/{outbound-adapter-BiLKcnyH.js → outbound-adapter-DuPz2HHt.js} +49 -5
  31. package/dist/{pipeline.runtime-DofAvTtb.js → pipeline.runtime-5rRYZuX5.js} +490 -345
  32. package/dist/{policy-BVs4LiSa.js → policy-C31RYSuT.js} +1 -1
  33. package/dist/probe-CVRuArHA.js +340 -0
  34. package/dist/{provider-CmeoUiIM.js → provider-htuIJGFD.js} +791 -359
  35. package/dist/{relay-source-DMmgtvg4.js → relay-source-Df9EaiTF.js} +6 -11
  36. package/dist/{replies-CJJCp6qz.js → replies-Cgr2Gli4.js} +3 -3
  37. package/dist/{resolve-channels-Rfts6POK.js → resolve-channels-DodP2TFx.js} +1 -1
  38. package/dist/{resolve-users-y6wAxR8E.js → resolve-users-M9eF8891.js} +1 -1
  39. package/dist/{runtime-api-BGDyOt1D.js → runtime-api-D5XYMMsf.js} +3 -2
  40. package/dist/runtime-api.js +11 -11
  41. package/dist/{scopes-CuxNQZ6v.js → scopes-CJRpHkDC.js} +1 -2
  42. package/dist/{secret-contract-CMohXFWS.js → secret-contract-DxmvbxBF.js} +1 -0
  43. package/dist/secret-contract-api.js +1 -1
  44. package/dist/{security-audit-CikQhBUY.js → security-audit-Cz6erklv.js} +0 -10
  45. package/dist/security-contract-api.js +1 -1
  46. package/dist/{send-DYp8ca-l.js → send-BZ1tPv7-.js} +28 -11
  47. package/dist/send.runtime-a2pilFor.js +2 -0
  48. package/dist/setup-core-tPxMuFez.js +600 -0
  49. package/dist/setup-plugin-api.js +1 -1
  50. package/dist/{setup-surface-oSd3NX9J.js → setup-surface-wV-S1dE_.js} +58 -32
  51. package/dist/{shared-D9yz5Otg.js → shared-BfMskaMx.js} +57 -10
  52. package/dist/{slash-dispatch.runtime-CSja9VuD.js → slash-dispatch.runtime-lfeIsXTX.js} +1 -1
  53. package/node_modules/@types/node/README.md +1 -1
  54. package/node_modules/@types/node/fs/promises.d.ts +16 -6
  55. package/node_modules/@types/node/package.json +2 -2
  56. package/node_modules/agent-base/README.md +145 -0
  57. package/node_modules/agent-base/dist/src/index.d.ts +78 -0
  58. package/node_modules/agent-base/dist/src/index.js +203 -0
  59. package/node_modules/agent-base/dist/src/index.js.map +1 -0
  60. package/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
  61. package/node_modules/agent-base/dist/src/promisify.js +18 -0
  62. package/node_modules/agent-base/dist/src/promisify.js.map +1 -0
  63. package/node_modules/agent-base/package.json +64 -0
  64. package/node_modules/agent-base/src/index.ts +345 -0
  65. package/node_modules/agent-base/src/promisify.ts +33 -0
  66. package/node_modules/axios/CHANGELOG.md +197 -1
  67. package/node_modules/axios/README.md +424 -256
  68. package/node_modules/axios/dist/axios.js +589 -204
  69. package/node_modules/axios/dist/axios.min.js +3 -3
  70. package/node_modules/axios/dist/axios.min.js.map +1 -1
  71. package/node_modules/axios/dist/browser/axios.cjs +630 -185
  72. package/node_modules/axios/dist/esm/axios.js +630 -185
  73. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  74. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  75. package/node_modules/axios/dist/node/axios.cjs +949 -301
  76. package/node_modules/axios/index.d.cts +28 -5
  77. package/node_modules/axios/index.d.ts +24 -3
  78. package/node_modules/axios/lib/adapters/adapters.js +1 -1
  79. package/node_modules/axios/lib/adapters/fetch.js +223 -49
  80. package/node_modules/axios/lib/adapters/http.js +408 -193
  81. package/node_modules/axios/lib/adapters/xhr.js +3 -1
  82. package/node_modules/axios/lib/core/Axios.js +4 -2
  83. package/node_modules/axios/lib/core/AxiosError.js +13 -1
  84. package/node_modules/axios/lib/core/AxiosHeaders.js +13 -42
  85. package/node_modules/axios/lib/core/buildFullPath.js +29 -1
  86. package/node_modules/axios/lib/core/mergeConfig.js +35 -0
  87. package/node_modules/axios/lib/defaults/transitional.js +2 -0
  88. package/node_modules/axios/lib/env/data.js +1 -1
  89. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -3
  90. package/node_modules/axios/lib/helpers/Http2Sessions.js +119 -0
  91. package/node_modules/axios/lib/helpers/buildURL.js +7 -4
  92. package/node_modules/axios/lib/helpers/composeSignals.js +48 -47
  93. package/node_modules/axios/lib/helpers/cookies.js +5 -1
  94. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +16 -11
  95. package/node_modules/axios/lib/helpers/formDataToJSON.js +26 -4
  96. package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
  97. package/node_modules/axios/lib/helpers/fromDataURI.js +20 -5
  98. package/node_modules/axios/lib/helpers/progressEventReducer.js +3 -0
  99. package/node_modules/axios/lib/helpers/resolveConfig.js +26 -13
  100. package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  101. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +33 -1
  102. package/node_modules/axios/lib/helpers/toFormData.js +48 -12
  103. package/node_modules/axios/lib/helpers/validator.js +1 -1
  104. package/node_modules/axios/lib/utils.js +105 -19
  105. package/node_modules/axios/package.json +31 -13
  106. package/node_modules/https-proxy-agent/README.md +137 -0
  107. package/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
  108. package/node_modules/https-proxy-agent/dist/agent.js +177 -0
  109. package/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
  110. package/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
  111. package/node_modules/https-proxy-agent/dist/index.js +14 -0
  112. package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  113. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
  114. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
  115. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  116. package/node_modules/https-proxy-agent/package.json +56 -0
  117. package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
  118. package/node_modules/iconv-lite/encodings/utf32.js +10 -3
  119. package/node_modules/iconv-lite/package.json +2 -2
  120. package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
  121. package/node_modules/path-to-regexp/Readme.md +3 -3
  122. package/node_modules/path-to-regexp/dist/index.js +135 -158
  123. package/node_modules/path-to-regexp/dist/index.js.map +1 -1
  124. package/node_modules/path-to-regexp/package.json +2 -2
  125. package/node_modules/qs/CHANGELOG.md +11 -0
  126. package/node_modules/qs/dist/qs.js +17 -17
  127. package/node_modules/qs/lib/parse.js +19 -8
  128. package/node_modules/qs/lib/utils.js +47 -8
  129. package/node_modules/qs/package.json +6 -5
  130. package/node_modules/qs/test/parse.js +230 -0
  131. package/node_modules/qs/test/utils.js +194 -0
  132. package/node_modules/typebox/build/compile/validator.d.mts +1 -4
  133. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  134. package/node_modules/typebox/build/guard/guard.mjs +5 -2
  135. package/node_modules/typebox/build/guard/string.mjs +16 -4
  136. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  137. package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
  138. package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
  139. package/node_modules/typebox/build/typebox.d.mts +1 -1
  140. package/node_modules/typebox/build/typebox.mjs +1 -1
  141. package/node_modules/typebox/package.json +1 -1
  142. package/node_modules/typebox/readme.md +29 -32
  143. package/node_modules/ws/lib/receiver.js +15 -32
  144. package/node_modules/ws/lib/websocket-server.js +4 -4
  145. package/node_modules/ws/lib/websocket.js +4 -4
  146. package/node_modules/ws/package.json +5 -1
  147. package/npm-shrinkwrap.json +54 -27
  148. package/openclaw.plugin.json +1331 -1424
  149. package/package.json +92 -14
  150. package/dist/accounts.runtime-KvftRRek.js +0 -2
  151. package/dist/action-runtime.runtime-DZfd7IFr.js +0 -2
  152. package/dist/client-WIPAS3Yr.js +0 -160
  153. package/dist/config-api-Df9a1B8C.js +0 -3
  154. package/dist/doctor-contract-DddfkMlF.js +0 -134
  155. package/dist/probe-CN0ssfLN.js +0 -48
  156. package/dist/send.runtime-CJLxAt26.js +0 -2
  157. package/dist/setup-core-CkwVLzFO.js +0 -337
  158. package/node_modules/axios/dist/axios.js.map +0 -1
  159. package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
  160. package/node_modules/axios/dist/esm/axios.js.map +0 -1
  161. package/node_modules/axios/dist/node/axios.cjs.map +0 -1
@@ -4,7 +4,9 @@ import AxiosError from '../core/AxiosError.js';
4
4
  import parseProtocol from './parseProtocol.js';
5
5
  import platform from '../platform/index.js';
6
6
 
7
- const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
7
+ // RFC 2397: data:[<mediatype>][;base64],<data>
8
+ // mediatype = type/subtype followed by optional ;name=value parameters
9
+ const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
8
10
 
9
11
  /**
10
12
  * Parse data uri to a Buffer or Blob
@@ -33,10 +35,23 @@ export default function fromDataURI(uri, asBlob, options) {
33
35
  throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
34
36
  }
35
37
 
36
- const mime = match[1];
37
- const isBase64 = match[2];
38
- const body = match[3];
39
- const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
38
+ const type = match[1];
39
+ const params = match[2];
40
+ const encoding = match[3] ? 'base64' : 'utf8';
41
+ const body = match[4];
42
+
43
+ // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII
44
+ // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec.
45
+ let mime = '';
46
+ if (type) {
47
+ mime = params ? type + params : type;
48
+ } else if (params) {
49
+ mime = 'text/plain' + params;
50
+ }
51
+
52
+ const buffer = encoding === 'base64'
53
+ ? Buffer.from(body, 'base64')
54
+ : Buffer.from(decodeURIComponent(body), encoding);
40
55
 
41
56
  if (asBlob) {
42
57
  if (!_Blob) {
@@ -7,6 +7,9 @@ export const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
7
7
  const _speedometer = speedometer(50, 250);
8
8
 
9
9
  return throttle((e) => {
10
+ if (!e || typeof e.loaded !== 'number') {
11
+ return;
12
+ }
10
13
  const rawLoaded = e.loaded;
11
14
  const total = e.lengthComputable ? e.total : undefined;
12
15
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -1,5 +1,6 @@
1
1
  import platform from '../platform/index.js';
2
2
  import utils from '../utils.js';
3
+ import AxiosError from '../core/AxiosError.js';
3
4
  import isURLSameOrigin from './isURLSameOrigin.js';
4
5
  import cookies from './cookies.js';
5
6
  import buildFullPath from '../core/buildFullPath.js';
@@ -15,7 +16,7 @@ function setFormDataHeaders(headers, formHeaders, policy) {
15
16
  return;
16
17
  }
17
18
 
18
- Object.entries(formHeaders).forEach(([key, val]) => {
19
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
19
20
  if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
20
21
  headers.set(key, val);
21
22
  }
@@ -35,7 +36,7 @@ const encodeUTF8 = (str) =>
35
36
  String.fromCharCode(parseInt(hex, 16))
36
37
  );
37
38
 
38
- export default (config) => {
39
+ function resolveConfig(config) {
39
40
  const newConfig = mergeConfig({}, config);
40
41
 
41
42
  // Read only own properties to prevent prototype pollution gadgets
@@ -55,23 +56,33 @@ export default (config) => {
55
56
  newConfig.headers = headers = AxiosHeaders.from(headers);
56
57
 
57
58
  newConfig.url = buildURL(
58
- buildFullPath(baseURL, url, allowAbsoluteUrls),
59
- config.params,
60
- config.paramsSerializer
59
+ buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
60
+ own('params'),
61
+ own('paramsSerializer')
61
62
  );
62
63
 
63
64
  // HTTP basic authentication
64
65
  if (auth) {
65
- headers.set(
66
- 'Authorization',
67
- 'Basic ' +
68
- btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
69
- );
66
+ const username = utils.getSafeProp(auth, 'username') || '';
67
+ const password = utils.getSafeProp(auth, 'password') || '';
68
+
69
+ try {
70
+ headers.set(
71
+ 'Authorization',
72
+ 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))
73
+ );
74
+ } catch (e) {
75
+ throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
76
+ }
70
77
  }
71
78
 
72
79
  if (utils.isFormData(data)) {
73
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
74
- headers.setContentType(undefined); // browser handles it
80
+ if (
81
+ platform.hasStandardBrowserEnv ||
82
+ platform.hasStandardBrowserWebWorkerEnv ||
83
+ utils.isReactNative(data)
84
+ ) {
85
+ headers.setContentType(undefined); // browser/web worker/RN handles it
75
86
  } else if (utils.isFunction(data.getHeaders)) {
76
87
  // Node.js FormData (like form-data package)
77
88
  setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
@@ -103,4 +114,6 @@ export default (config) => {
103
114
  }
104
115
 
105
116
  return newConfig;
106
- };
117
+ }
118
+
119
+ export default resolveConfig;
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ import utils from '../utils.js';
4
+
5
+ function trimSPorHTAB(str) {
6
+ let start = 0;
7
+ let end = str.length;
8
+
9
+ while (start < end) {
10
+ const code = str.charCodeAt(start);
11
+
12
+ if (code !== 0x09 && code !== 0x20) {
13
+ break;
14
+ }
15
+
16
+ start += 1;
17
+ }
18
+
19
+ while (end > start) {
20
+ const code = str.charCodeAt(end - 1);
21
+
22
+ if (code !== 0x09 && code !== 0x20) {
23
+ break;
24
+ }
25
+
26
+ end -= 1;
27
+ }
28
+
29
+ return start === 0 && end === str.length ? str : str.slice(start, end);
30
+ }
31
+
32
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
33
+ // eslint-disable-next-line no-control-regex
34
+ const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
35
+ // eslint-disable-next-line no-control-regex
36
+ const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
37
+
38
+ function sanitizeValue(value, invalidChars) {
39
+ if (utils.isArray(value)) {
40
+ return value.map((item) => sanitizeValue(item, invalidChars));
41
+ }
42
+
43
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
44
+ }
45
+
46
+ export const sanitizeHeaderValue = (value) =>
47
+ sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
48
+
49
+ export const sanitizeByteStringHeaderValue = (value) =>
50
+ sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
51
+
52
+ export function toByteStringHeaderObject(headers) {
53
+ const byteStringHeaders = Object.create(null);
54
+
55
+ utils.forEach(headers.toJSON(), (value, header) => {
56
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
57
+ });
58
+
59
+ return byteStringHeaders;
60
+ }
@@ -1,4 +1,4 @@
1
- const LOOPBACK_HOSTNAMES = new Set(['localhost']);
1
+ const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']);
2
2
 
3
3
  const isIPv4Loopback = (host) => {
4
4
  const parts = host.split('.');
@@ -7,6 +7,37 @@ const isIPv4Loopback = (host) => {
7
7
  return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
8
8
  };
9
9
 
10
+ const isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group);
11
+
12
+ // The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host
13
+ // for outbound connections, so treat it as loopback-equivalent for NO_PROXY
14
+ // matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed
15
+ // and full IPv6 all-zero forms so both families bypass symmetrically.
16
+ const isIPv6Unspecified = (host) => {
17
+ if (host === '::') return true;
18
+
19
+ const compressionIndex = host.indexOf('::');
20
+
21
+ if (compressionIndex !== -1) {
22
+ if (compressionIndex !== host.lastIndexOf('::')) return false;
23
+
24
+ const left = host.slice(0, compressionIndex);
25
+ const right = host.slice(compressionIndex + 2);
26
+ const leftGroups = left ? left.split(':') : [];
27
+ const rightGroups = right ? right.split(':') : [];
28
+ const explicitGroups = leftGroups.length + rightGroups.length;
29
+
30
+ return (
31
+ explicitGroups < 8 &&
32
+ leftGroups.every(isIPv6ZeroGroup) &&
33
+ rightGroups.every(isIPv6ZeroGroup)
34
+ );
35
+ }
36
+
37
+ const groups = host.split(':');
38
+ return groups.length === 8 && groups.every(isIPv6ZeroGroup);
39
+ };
40
+
10
41
  const isIPv6Loopback = (host) => {
11
42
  // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1
12
43
  // First, strip any leading "::" by normalising with Set lookup of common forms,
@@ -42,6 +73,7 @@ const isLoopback = (host) => {
42
73
  if (!host) return false;
43
74
  if (LOOPBACK_HOSTNAMES.has(host)) return true;
44
75
  if (isIPv4Loopback(host)) return true;
76
+ if (isIPv6Unspecified(host)) return true;
45
77
  return isIPv6Loopback(host);
46
78
  };
47
79
 
@@ -5,6 +5,10 @@ import AxiosError from '../core/AxiosError.js';
5
5
  // temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
6
6
  import PlatformFormData from '../platform/node/classes/FormData.js';
7
7
 
8
+ // Default nesting limit shared with the inverse transform (formDataToJSON) so
9
+ // the FormData <-> JSON round-trip stays symmetric.
10
+ export const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
11
+
8
12
  /**
9
13
  * Determines if the given thing is a array or js object.
10
14
  *
@@ -115,8 +119,9 @@ function toFormData(obj, formData, options) {
115
119
  const dots = options.dots;
116
120
  const indexes = options.indexes;
117
121
  const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
118
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
122
+ const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
119
123
  const useBlob = _Blob && utils.isSpecCompliantForm(formData);
124
+ const stack = [];
120
125
 
121
126
  if (!utils.isFunction(visitor)) {
122
127
  throw new TypeError('visitor must be a function');
@@ -138,12 +143,50 @@ function toFormData(obj, formData, options) {
138
143
  }
139
144
 
140
145
  if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
141
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
146
+ if (useBlob && typeof _Blob === 'function') {
147
+ return new _Blob([value]);
148
+ }
149
+ if (typeof Buffer !== 'undefined') {
150
+ return Buffer.from(value);
151
+ }
152
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);
142
153
  }
143
154
 
144
155
  return value;
145
156
  }
146
157
 
158
+ function throwIfMaxDepthExceeded(depth) {
159
+ if (depth > maxDepth) {
160
+ throw new AxiosError(
161
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
162
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
163
+ );
164
+ }
165
+ }
166
+
167
+ function stringifyWithDepthLimit(value, depth) {
168
+ if (maxDepth === Infinity) {
169
+ return JSON.stringify(value);
170
+ }
171
+
172
+ const ancestors = [];
173
+
174
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
175
+ if (!utils.isObject(currentValue)) {
176
+ return currentValue;
177
+ }
178
+
179
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
180
+ ancestors.pop();
181
+ }
182
+
183
+ ancestors.push(currentValue);
184
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
185
+
186
+ return currentValue;
187
+ });
188
+ }
189
+
147
190
  /**
148
191
  * Default visitor.
149
192
  *
@@ -167,7 +210,7 @@ function toFormData(obj, formData, options) {
167
210
  // eslint-disable-next-line no-param-reassign
168
211
  key = metaTokens ? key : key.slice(0, -2);
169
212
  // eslint-disable-next-line no-param-reassign
170
- value = JSON.stringify(value);
213
+ value = stringifyWithDepthLimit(value, 1);
171
214
  } else if (
172
215
  (utils.isArray(value) && isFlatArray(value)) ||
173
216
  ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))
@@ -200,8 +243,6 @@ function toFormData(obj, formData, options) {
200
243
  return false;
201
244
  }
202
245
 
203
- const stack = [];
204
-
205
246
  const exposedHelpers = Object.assign(predicates, {
206
247
  defaultVisitor,
207
248
  convertValue,
@@ -211,15 +252,10 @@ function toFormData(obj, formData, options) {
211
252
  function build(value, path, depth = 0) {
212
253
  if (utils.isUndefined(value)) return;
213
254
 
214
- if (depth > maxDepth) {
215
- throw new AxiosError(
216
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
217
- AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
218
- );
219
- }
255
+ throwIfMaxDepthExceeded(depth);
220
256
 
221
257
  if (stack.indexOf(value) !== -1) {
222
- throw Error('Circular reference detected in ' + path.join('.'));
258
+ throw new Error('Circular reference detected in ' + path.join('.'));
223
259
  }
224
260
 
225
261
  stack.push(value);
@@ -79,7 +79,7 @@ validators.spelling = function spelling(correctSpelling) {
79
79
  */
80
80
 
81
81
  function assertOptions(options, schema, allowUnknown) {
82
- if (typeof options !== 'object') {
82
+ if (typeof options !== 'object' || options === null) {
83
83
  throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
84
84
  }
85
85
  const keys = Object.keys(options);
@@ -8,6 +8,57 @@ const { toString } = Object.prototype;
8
8
  const { getPrototypeOf } = Object;
9
9
  const { iterator, toStringTag } = Symbol;
10
10
 
11
+ /* Creating a function that will check if an object has a property. */
12
+ const hasOwnProperty = (
13
+ ({ hasOwnProperty }) =>
14
+ (obj, prop) =>
15
+ hasOwnProperty.call(obj, prop)
16
+ )(Object.prototype);
17
+
18
+ /**
19
+ * Walk the prototype chain (excluding the shared Object.prototype) looking for
20
+ * an own `prop`. This distinguishes genuine own/inherited members — including
21
+ * class accessors and template prototypes — from members injected via
22
+ * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which
23
+ * live on Object.prototype itself and are therefore never matched.
24
+ *
25
+ * @param {*} thing The value whose chain to inspect
26
+ * @param {string|symbol} prop The property key to look for
27
+ *
28
+ * @returns {boolean} True when `prop` is owned below Object.prototype
29
+ */
30
+ const hasOwnInPrototypeChain = (thing, prop) => {
31
+ let obj = thing;
32
+ const seen = [];
33
+
34
+ while (obj != null && obj !== Object.prototype) {
35
+ if (seen.indexOf(obj) !== -1) {
36
+ return false;
37
+ }
38
+ seen.push(obj);
39
+
40
+ if (hasOwnProperty(obj, prop)) {
41
+ return true;
42
+ }
43
+ obj = getPrototypeOf(obj);
44
+ }
45
+ return false;
46
+ };
47
+
48
+ /**
49
+ * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
50
+ * properties and members inherited from a non-Object.prototype source (a class
51
+ * instance or template object) are honored; a value reachable only through a
52
+ * polluted Object.prototype is ignored and `undefined` is returned.
53
+ *
54
+ * @param {*} obj The source object
55
+ * @param {string|symbol} prop The property key to read
56
+ *
57
+ * @returns {*} The resolved value, or undefined when unsafe/absent
58
+ */
59
+ const getSafeProp = (obj, prop) =>
60
+ obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
61
+
11
62
  const kindOf = ((cache) => (thing) => {
12
63
  const str = toString.call(thing);
13
64
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -133,7 +184,7 @@ const isBoolean = (thing) => thing === true || thing === false;
133
184
  * @returns {boolean} True if value is a plain Object, otherwise false
134
185
  */
135
186
  const isPlainObject = (val) => {
136
- if (kindOf(val) !== 'object') {
187
+ if (!isObject(val)) {
137
188
  return false;
138
189
  }
139
190
 
@@ -141,9 +192,12 @@ const isPlainObject = (val) => {
141
192
  return (
142
193
  (prototype === null ||
143
194
  prototype === Object.prototype ||
144
- Object.getPrototypeOf(prototype) === null) &&
145
- !(toStringTag in val) &&
146
- !(iterator in val)
195
+ getPrototypeOf(prototype) === null) &&
196
+ // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
197
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
198
+ // than a plain object, while ignoring keys injected onto Object.prototype.
199
+ !hasOwnInPrototypeChain(val, toStringTag) &&
200
+ !hasOwnInPrototypeChain(val, iterator)
147
201
  );
148
202
  };
149
203
 
@@ -412,7 +466,9 @@ function merge(...objs) {
412
466
  return;
413
467
  }
414
468
 
415
- const targetKey = (caseless && findKey(result, key)) || key;
469
+ // findKey lowercases the key, so caseless lookup only applies to strings —
470
+ // symbol keys are identity-matched.
471
+ const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;
416
472
  // Read via own-prop only — a bare `result[targetKey]` walks the prototype
417
473
  // chain, so a polluted Object.prototype value could surface here and get
418
474
  // copied into the merged result.
@@ -429,7 +485,24 @@ function merge(...objs) {
429
485
  };
430
486
 
431
487
  for (let i = 0, l = objs.length; i < l; i++) {
432
- objs[i] && forEach(objs[i], assignValue);
488
+ const source = objs[i];
489
+ if (!source || isBuffer(source)) {
490
+ continue;
491
+ }
492
+
493
+ forEach(source, assignValue);
494
+
495
+ if (typeof source !== 'object' || isArray(source)) {
496
+ continue;
497
+ }
498
+
499
+ const symbols = Object.getOwnPropertySymbols(source);
500
+ for (let j = 0; j < symbols.length; j++) {
501
+ const symbol = symbols[j];
502
+ if (propertyIsEnumerable.call(source, symbol)) {
503
+ assignValue(source[symbol], symbol);
504
+ }
505
+ }
433
506
  }
434
507
  return result;
435
508
  }
@@ -651,12 +724,7 @@ const toCamelCase = (str) => {
651
724
  });
652
725
  };
653
726
 
654
- /* Creating a function that will check if an object has a property. */
655
- const hasOwnProperty = (
656
- ({ hasOwnProperty }) =>
657
- (obj, prop) =>
658
- hasOwnProperty.call(obj, prop)
659
- )(Object.prototype);
727
+ const { propertyIsEnumerable } = Object.prototype;
660
728
 
661
729
  /**
662
730
  * Determine if a value is a RegExp object
@@ -763,11 +831,11 @@ function isSpecCompliantForm(thing) {
763
831
  * @returns {Object} The JSON-compatible object.
764
832
  */
765
833
  const toJSONObject = (obj) => {
766
- const stack = new Array(10);
834
+ const visited = new WeakSet();
767
835
 
768
- const visit = (source, i) => {
836
+ const visit = (source) => {
769
837
  if (isObject(source)) {
770
- if (stack.indexOf(source) >= 0) {
838
+ if (visited.has(source)) {
771
839
  return;
772
840
  }
773
841
 
@@ -777,15 +845,16 @@ const toJSONObject = (obj) => {
777
845
  }
778
846
 
779
847
  if (!('toJSON' in source)) {
780
- stack[i] = source;
848
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
849
+ visited.add(source);
781
850
  const target = isArray(source) ? [] : {};
782
851
 
783
852
  forEach(source, (value, key) => {
784
- const reducedValue = visit(value, i + 1);
853
+ const reducedValue = visit(value);
785
854
  !isUndefined(reducedValue) && (target[key] = reducedValue);
786
855
  });
787
856
 
788
- stack[i] = undefined;
857
+ visited.delete(source);
789
858
 
790
859
  return target;
791
860
  }
@@ -794,7 +863,7 @@ const toJSONObject = (obj) => {
794
863
  return source;
795
864
  };
796
865
 
797
- return visit(obj, 0);
866
+ return visit(obj);
798
867
  };
799
868
 
800
869
  /**
@@ -868,6 +937,20 @@ const asap =
868
937
 
869
938
  const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
870
939
 
940
+ /**
941
+ * Determine if a value is iterable via an iterator that is NOT sourced solely
942
+ * from a polluted Object.prototype. Use this instead of `isIterable` whenever
943
+ * the iterable comes from untrusted input (e.g. user-supplied header sources),
944
+ * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
945
+ * into an attacker-controlled entries iterator.
946
+ *
947
+ * @param {*} thing The value to test
948
+ *
949
+ * @returns {boolean} True if value has a non-polluted iterator
950
+ */
951
+ const isSafeIterable = (thing) =>
952
+ thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
953
+
871
954
  export default {
872
955
  isArray,
873
956
  isArrayBuffer,
@@ -912,6 +995,8 @@ export default {
912
995
  isHTMLForm,
913
996
  hasOwnProperty,
914
997
  hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
998
+ hasOwnInPrototypeChain,
999
+ getSafeProp,
915
1000
  reduceDescriptors,
916
1001
  freezeMethods,
917
1002
  toObjectSet,
@@ -928,4 +1013,5 @@ export default {
928
1013
  setImmediate: _setImmediate,
929
1014
  asap,
930
1015
  isIterable,
1016
+ isSafeIterable,
931
1017
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.16.0",
3
+ "version": "1.18.1",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "./dist/node/axios.cjs",
6
6
  "module": "./index.js",
@@ -86,9 +86,9 @@
86
86
  "Justin Beckwith (https://github.com/JustinBeckwith)",
87
87
  "Martti Laine (https://github.com/codeclown)",
88
88
  "Xianming Zhong (https://github.com/chinesedfan)",
89
- "Willian Agostini (https://github.com/WillianAgostini)",
90
89
  "Shaan Majid (https://github.com/shaanmajid)",
91
90
  "Remco Haszing (https://github.com/remcohaszing)",
91
+ "Willian Agostini (https://github.com/WillianAgostini)",
92
92
  "Rikki Gibson (https://github.com/RikkiGibson)"
93
93
  ],
94
94
  "sideEffects": false,
@@ -97,6 +97,22 @@
97
97
  "url": "https://github.com/axios/axios/issues"
98
98
  },
99
99
  "homepage": "https://axios-http.com",
100
+ "files": [
101
+ "index.js",
102
+ "index.d.ts",
103
+ "index.d.cts",
104
+ "CHANGELOG.md",
105
+ "MIGRATION_GUIDE.md",
106
+ "lib/",
107
+ "dist/axios.js",
108
+ "dist/axios.min.js",
109
+ "dist/axios.min.js.map",
110
+ "dist/esm/axios.js",
111
+ "dist/esm/axios.min.js",
112
+ "dist/esm/axios.min.js.map",
113
+ "dist/browser/axios.cjs",
114
+ "dist/node/axios.cjs"
115
+ ],
100
116
  "scripts": {
101
117
  "build": "gulp clear && cross-env NODE_ENV=production rollup -c -m",
102
118
  "version": "npm run build && git add package.json",
@@ -123,13 +139,14 @@
123
139
  "dependencies": {
124
140
  "follow-redirects": "^1.16.0",
125
141
  "form-data": "^4.0.5",
142
+ "https-proxy-agent": "^5.0.1",
126
143
  "proxy-from-env": "^2.1.0"
127
144
  },
128
145
  "devDependencies": {
129
146
  "@babel/core": "^7.29.0",
130
- "@babel/preset-env": "^7.29.2",
131
- "@commitlint/cli": "^20.5.0",
132
- "@commitlint/config-conventional": "^20.5.0",
147
+ "@babel/preset-env": "^7.29.5",
148
+ "@commitlint/cli": "^21.0.1",
149
+ "@commitlint/config-conventional": "^21.0.1",
133
150
  "@eslint/js": "^10.0.1",
134
151
  "@rollup/plugin-alias": "^6.0.0",
135
152
  "@rollup/plugin-babel": "^7.0.0",
@@ -137,33 +154,34 @@
137
154
  "@rollup/plugin-json": "^6.1.0",
138
155
  "@rollup/plugin-node-resolve": "^16.0.3",
139
156
  "@rollup/plugin-terser": "^1.0.0",
140
- "@vitest/browser": "^4.1.5",
141
- "@vitest/browser-playwright": "^4.1.5",
157
+ "@vitest/browser": "^4.1.7",
158
+ "@vitest/browser-playwright": "^4.1.7",
142
159
  "abortcontroller-polyfill": "^1.7.8",
160
+ "acorn": "^8.16.0",
143
161
  "body-parser": "^2.2.2",
144
162
  "chalk": "^5.6.2",
145
163
  "cross-env": "^10.1.0",
146
164
  "dev-null": "^0.1.1",
147
- "eslint": "^10.2.1",
165
+ "eslint": "^10.4.0",
148
166
  "express": "^5.2.1",
149
167
  "formdata-node": "^6.0.3",
150
168
  "formidable": "^3.5.4",
151
169
  "fs-extra": "^11.3.4",
152
170
  "get-stream": "^9.0.1",
153
- "globals": "^17.5.0",
171
+ "globals": "^17.6.0",
154
172
  "gulp": "^5.0.1",
155
173
  "husky": "^9.1.7",
156
- "lint-staged": "^16.4.0",
174
+ "lint-staged": "^17.0.5",
157
175
  "minimist": "^1.2.8",
158
176
  "multer": "^2.1.1",
159
- "playwright": "^1.59.1",
177
+ "playwright": "^1.60.0",
160
178
  "prettier": "^3.8.3",
161
- "rollup": "^4.60.2",
179
+ "rollup": "^4.60.4",
162
180
  "rollup-plugin-bundle-size": "^1.0.3",
163
181
  "selfsigned": "^5.5.0",
164
182
  "stream-throttle": "^0.1.3",
165
183
  "typescript": "^5.9.3",
166
- "vitest": "^4.1.5"
184
+ "vitest": "^4.1.7"
167
185
  },
168
186
  "commitlint": {
169
187
  "rules": {