@alfe.ai/gateway 0.0.41 → 0.0.42

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 (2) hide show
  1. package/dist/health.js +268 -136
  2. package/package.json +3 -3
package/dist/health.js CHANGED
@@ -4058,6 +4058,7 @@ var ReconciliationEngine = class {
4058
4058
  if (local.status === "error") {
4059
4059
  if (desired.reinstallRequestedAt && local.installedAt && desired.reinstallRequestedAt > local.installedAt) {
4060
4060
  log$2.info(`Reinstalling ${id} from error state (requested: ${desired.reinstallRequestedAt}, installed: ${local.installedAt})`);
4061
+ this.manager.resetReinstallAttempts(id);
4061
4062
  if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
4062
4063
  report.installed.push(id);
4063
4064
  report.activated.push(id);
@@ -4069,9 +4070,26 @@ var ReconciliationEngine = class {
4069
4070
  return;
4070
4071
  }
4071
4072
  if (!await this.manager.isInstallIntact(id)) {
4072
- log$2.info(`Auto-reinstalling ${id} — install directory is corrupted or missing`);
4073
+ const attempts = this.manager.getReinstallAttempts(id);
4074
+ if (attempts >= 3) {
4075
+ log$2.error(`Auto-reinstall blocked for ${id} — ${String(attempts)} consecutive failures. Manual reinstall required.`);
4076
+ report.errors.push({
4077
+ integrationId: id,
4078
+ error: `Max auto-reinstall attempts (${String(attempts)}) reached`
4079
+ });
4080
+ report.results.push({
4081
+ integrationId: id,
4082
+ action: "error",
4083
+ actualStatus: "error",
4084
+ errorMessage: `Max auto-reinstall attempts (${String(attempts)}) reached — manual reinstall required`
4085
+ });
4086
+ return;
4087
+ }
4088
+ log$2.info(`Auto-reinstalling ${id} — install directory is corrupted or missing (attempt ${String(attempts + 1)}/3)`);
4089
+ this.manager.incrementReinstallAttempts(id);
4073
4090
  try {
4074
4091
  if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
4092
+ this.manager.resetReinstallAttempts(id);
4075
4093
  report.installed.push(id);
4076
4094
  report.activated.push(id);
4077
4095
  report.results.push({
@@ -4121,6 +4139,7 @@ var ReconciliationEngine = class {
4121
4139
  }
4122
4140
  if (desired.reinstallRequestedAt && local.installedAt && desired.reinstallRequestedAt > local.installedAt) {
4123
4141
  log$2.info(`Reinstall requested for ${id} (requested: ${desired.reinstallRequestedAt}, installed: ${local.installedAt})`);
4142
+ this.manager.resetReinstallAttempts(id);
4124
4143
  if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
4125
4144
  report.installed.push(id);
4126
4145
  report.activated.push(id);
@@ -5916,7 +5935,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
5916
5935
  __exportStar(require_types(), exports);
5917
5936
  }));
5918
5937
  //#endregion
5919
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/bind.js
5938
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/bind.js
5920
5939
  /**
5921
5940
  * Create a bound version of a function with a specified `this` context
5922
5941
  *
@@ -5930,7 +5949,7 @@ function bind(fn, thisArg) {
5930
5949
  };
5931
5950
  }
5932
5951
  //#endregion
5933
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/utils.js
5952
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/utils.js
5934
5953
  const { toString } = Object.prototype;
5935
5954
  const { getPrototypeOf } = Object;
5936
5955
  const { iterator, toStringTag } = Symbol;
@@ -6626,7 +6645,7 @@ var utils_default = {
6626
6645
  isIterable
6627
6646
  };
6628
6647
  //#endregion
6629
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/AxiosError.js
6648
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/AxiosError.js
6630
6649
  var AxiosError$1 = class AxiosError$1 extends Error {
6631
6650
  static from(error, code, config, request, response, customProps) {
6632
6651
  const axiosError = new AxiosError$1(error.message, code || error.code, config, request, response);
@@ -15283,7 +15302,7 @@ var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
15283
15302
  module.exports = FormData;
15284
15303
  })))(), 1)).default;
15285
15304
  //#endregion
15286
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/toFormData.js
15305
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/toFormData.js
15287
15306
  /**
15288
15307
  * Determines if the given thing is a array or js object.
15289
15308
  *
@@ -15431,7 +15450,7 @@ function toFormData$1(obj, formData, options) {
15431
15450
  return formData;
15432
15451
  }
15433
15452
  //#endregion
15434
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
15453
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
15435
15454
  /**
15436
15455
  * It encodes a string by replacing all characters that are not in the unreserved set with
15437
15456
  * their percent-encoded equivalents
@@ -15479,10 +15498,10 @@ prototype.toString = function toString(encoder) {
15479
15498
  }, "").join("&");
15480
15499
  };
15481
15500
  //#endregion
15482
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/buildURL.js
15501
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/buildURL.js
15483
15502
  /**
15484
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
15485
- * URI encoded counterparts
15503
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15504
+ * their plain counterparts (`:`, `$`, `,`, `+`).
15486
15505
  *
15487
15506
  * @param {string} val The value to be encoded.
15488
15507
  *
@@ -15516,7 +15535,7 @@ function buildURL(url, params, options) {
15516
15535
  return url;
15517
15536
  }
15518
15537
  //#endregion
15519
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/InterceptorManager.js
15538
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/InterceptorManager.js
15520
15539
  var InterceptorManager = class {
15521
15540
  constructor() {
15522
15541
  this.handlers = [];
@@ -15574,7 +15593,7 @@ var InterceptorManager = class {
15574
15593
  }
15575
15594
  };
15576
15595
  //#endregion
15577
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/defaults/transitional.js
15596
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/defaults/transitional.js
15578
15597
  var transitional_default = {
15579
15598
  silentJSONParsing: true,
15580
15599
  forcedJSONParsing: true,
@@ -15582,10 +15601,10 @@ var transitional_default = {
15582
15601
  legacyInterceptorReqResOrdering: true
15583
15602
  };
15584
15603
  //#endregion
15585
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
15604
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
15586
15605
  var URLSearchParams_default = url.URLSearchParams;
15587
15606
  //#endregion
15588
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/node/index.js
15607
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/node/index.js
15589
15608
  const ALPHA = "abcdefghijklmnopqrstuvwxyz";
15590
15609
  const DIGIT = "0123456789";
15591
15610
  const ALPHABET = {
@@ -15618,7 +15637,7 @@ var node_default = {
15618
15637
  ]
15619
15638
  };
15620
15639
  //#endregion
15621
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/common/utils.js
15640
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/common/utils.js
15622
15641
  var utils_exports = /* @__PURE__ */ __exportAll({
15623
15642
  hasBrowserEnv: () => hasBrowserEnv,
15624
15643
  hasStandardBrowserEnv: () => hasStandardBrowserEnv,
@@ -15662,13 +15681,13 @@ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [
15662
15681
  const hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
15663
15682
  const origin = hasBrowserEnv && window.location.href || "http://localhost";
15664
15683
  //#endregion
15665
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/index.js
15684
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/index.js
15666
15685
  var platform_default = {
15667
15686
  ...utils_exports,
15668
15687
  ...node_default
15669
15688
  };
15670
15689
  //#endregion
15671
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/toURLEncodedForm.js
15690
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
15672
15691
  function toURLEncodedForm(data, options) {
15673
15692
  return toFormData$1(data, new platform_default.classes.URLSearchParams(), {
15674
15693
  visitor: function(value, key, path, helpers) {
@@ -15682,7 +15701,7 @@ function toURLEncodedForm(data, options) {
15682
15701
  });
15683
15702
  }
15684
15703
  //#endregion
15685
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/formDataToJSON.js
15704
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/formDataToJSON.js
15686
15705
  /**
15687
15706
  * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
15688
15707
  *
@@ -15747,7 +15766,7 @@ function formDataToJSON(formData) {
15747
15766
  return null;
15748
15767
  }
15749
15768
  //#endregion
15750
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/defaults/index.js
15769
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/defaults/index.js
15751
15770
  /**
15752
15771
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
15753
15772
  * of the input
@@ -15846,7 +15865,7 @@ utils_default.forEach([
15846
15865
  defaults.headers[method] = {};
15847
15866
  });
15848
15867
  //#endregion
15849
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/parseHeaders.js
15868
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseHeaders.js
15850
15869
  const ignoreDuplicateOf = utils_default.toObjectSet([
15851
15870
  "age",
15852
15871
  "authorization",
@@ -15897,14 +15916,32 @@ var parseHeaders_default = (rawHeaders) => {
15897
15916
  return parsed;
15898
15917
  };
15899
15918
  //#endregion
15900
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/AxiosHeaders.js
15919
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/AxiosHeaders.js
15901
15920
  const $internals = Symbol("internals");
15921
+ const isValidHeaderValue = (value) => !/[\r\n]/.test(value);
15922
+ function assertValidHeaderValue(value, header) {
15923
+ if (value === false || value == null) return;
15924
+ if (utils_default.isArray(value)) {
15925
+ value.forEach((v) => assertValidHeaderValue(v, header));
15926
+ return;
15927
+ }
15928
+ if (!isValidHeaderValue(String(value))) throw new Error(`Invalid character in header content ["${header}"]`);
15929
+ }
15902
15930
  function normalizeHeader(header) {
15903
15931
  return header && String(header).trim().toLowerCase();
15904
15932
  }
15933
+ function stripTrailingCRLF(str) {
15934
+ let end = str.length;
15935
+ while (end > 0) {
15936
+ const charCode = str.charCodeAt(end - 1);
15937
+ if (charCode !== 10 && charCode !== 13) break;
15938
+ end -= 1;
15939
+ }
15940
+ return end === str.length ? str : str.slice(0, end);
15941
+ }
15905
15942
  function normalizeValue(value) {
15906
15943
  if (value === false || value == null) return value;
15907
- return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
15944
+ return utils_default.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
15908
15945
  }
15909
15946
  function parseTokens(str) {
15910
15947
  const tokens = Object.create(null);
@@ -15951,7 +15988,10 @@ var AxiosHeaders$1 = class {
15951
15988
  const lHeader = normalizeHeader(_header);
15952
15989
  if (!lHeader) throw new Error("header name must be a non-empty string");
15953
15990
  const key = utils_default.findKey(self, lHeader);
15954
- if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value);
15991
+ if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) {
15992
+ assertValidHeaderValue(_value, _header);
15993
+ self[key || _header] = normalizeValue(_value);
15994
+ }
15955
15995
  }
15956
15996
  const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15957
15997
  if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite);
@@ -16098,7 +16138,7 @@ utils_default.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
16098
16138
  });
16099
16139
  utils_default.freezeMethods(AxiosHeaders$1);
16100
16140
  //#endregion
16101
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/transformData.js
16141
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/transformData.js
16102
16142
  /**
16103
16143
  * Transform the data for a request or a response
16104
16144
  *
@@ -16119,12 +16159,12 @@ function transformData(fns, response) {
16119
16159
  return data;
16120
16160
  }
16121
16161
  //#endregion
16122
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/cancel/isCancel.js
16162
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/isCancel.js
16123
16163
  function isCancel$1(value) {
16124
16164
  return !!(value && value.__CANCEL__);
16125
16165
  }
16126
16166
  //#endregion
16127
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/cancel/CanceledError.js
16167
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/CanceledError.js
16128
16168
  var CanceledError$1 = class extends AxiosError$1 {
16129
16169
  /**
16130
16170
  * A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -16142,7 +16182,7 @@ var CanceledError$1 = class extends AxiosError$1 {
16142
16182
  }
16143
16183
  };
16144
16184
  //#endregion
16145
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/settle.js
16185
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/settle.js
16146
16186
  /**
16147
16187
  * Resolve or reject a Promise based on response status.
16148
16188
  *
@@ -16158,7 +16198,7 @@ function settle(resolve, reject, response) {
16158
16198
  else reject(new AxiosError$1("Request failed with status code " + response.status, [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
16159
16199
  }
16160
16200
  //#endregion
16161
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isAbsoluteURL.js
16201
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isAbsoluteURL.js
16162
16202
  /**
16163
16203
  * Determines whether the specified URL is absolute
16164
16204
  *
@@ -16171,7 +16211,7 @@ function isAbsoluteURL(url) {
16171
16211
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
16172
16212
  }
16173
16213
  //#endregion
16174
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/combineURLs.js
16214
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/combineURLs.js
16175
16215
  /**
16176
16216
  * Creates a new URL by combining the specified URLs
16177
16217
  *
@@ -16184,7 +16224,7 @@ function combineURLs(baseURL, relativeURL) {
16184
16224
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
16185
16225
  }
16186
16226
  //#endregion
16187
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/buildFullPath.js
16227
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/buildFullPath.js
16188
16228
  /**
16189
16229
  * Creates a new URL by combining the baseURL with the requestedURL,
16190
16230
  * only when the requestedURL is not already an absolute URL.
@@ -16201,74 +16241,75 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
16201
16241
  return requestedURL;
16202
16242
  }
16203
16243
  //#endregion
16204
- //#region ../../node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js
16205
- var require_proxy_from_env = /* @__PURE__ */ __commonJSMin(((exports) => {
16206
- var parseUrl = __require("url").parse;
16207
- var DEFAULT_PORTS = {
16208
- ftp: 21,
16209
- gopher: 70,
16210
- http: 80,
16211
- https: 443,
16212
- ws: 80,
16213
- wss: 443
16214
- };
16215
- var stringEndsWith = String.prototype.endsWith || function(s) {
16216
- return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
16217
- };
16218
- /**
16219
- * @param {string|object} url - The URL, or the result from url.parse.
16220
- * @return {string} The URL of the proxy that should handle the request to the
16221
- * given URL. If no proxy is set, this will be an empty string.
16222
- */
16223
- function getProxyForUrl(url) {
16224
- var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {};
16225
- var proto = parsedUrl.protocol;
16226
- var hostname = parsedUrl.host;
16227
- var port = parsedUrl.port;
16228
- if (typeof hostname !== "string" || !hostname || typeof proto !== "string") return "";
16229
- proto = proto.split(":", 1)[0];
16230
- hostname = hostname.replace(/:\d*$/, "");
16231
- port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
16232
- if (!shouldProxy(hostname, port)) return "";
16233
- var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
16234
- if (proxy && proxy.indexOf("://") === -1) proxy = proto + "://" + proxy;
16235
- return proxy;
16236
- }
16237
- /**
16238
- * Determines whether a given URL should be proxied.
16239
- *
16240
- * @param {string} hostname - The host name of the URL.
16241
- * @param {number} port - The effective port of the URL.
16242
- * @returns {boolean} Whether the given URL should be proxied.
16243
- * @private
16244
- */
16245
- function shouldProxy(hostname, port) {
16246
- var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
16247
- if (!NO_PROXY) return true;
16248
- if (NO_PROXY === "*") return false;
16249
- return NO_PROXY.split(/[,\s]/).every(function(proxy) {
16250
- if (!proxy) return true;
16251
- var parsedProxy = proxy.match(/^(.+):(\d+)$/);
16252
- var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
16253
- var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
16254
- if (parsedProxyPort && parsedProxyPort !== port) return true;
16255
- if (!/^[.*]/.test(parsedProxyHostname)) return hostname !== parsedProxyHostname;
16256
- if (parsedProxyHostname.charAt(0) === "*") parsedProxyHostname = parsedProxyHostname.slice(1);
16257
- return !stringEndsWith.call(hostname, parsedProxyHostname);
16258
- });
16259
- }
16260
- /**
16261
- * Get the value for an environment variable.
16262
- *
16263
- * @param {string} key - The name of the environment variable.
16264
- * @return {string} The value of the environment variable.
16265
- * @private
16266
- */
16267
- function getEnv(key) {
16268
- return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
16244
+ //#region ../../node_modules/.pnpm/proxy-from-env@2.1.0/node_modules/proxy-from-env/index.js
16245
+ var DEFAULT_PORTS$1 = {
16246
+ ftp: 21,
16247
+ gopher: 70,
16248
+ http: 80,
16249
+ https: 443,
16250
+ ws: 80,
16251
+ wss: 443
16252
+ };
16253
+ function parseUrl(urlString) {
16254
+ try {
16255
+ return new URL(urlString);
16256
+ } catch {
16257
+ return null;
16269
16258
  }
16270
- exports.getProxyForUrl = getProxyForUrl;
16271
- }));
16259
+ }
16260
+ /**
16261
+ * @param {string|object|URL} url - The URL as a string or URL instance, or a
16262
+ * compatible object (such as the result from legacy url.parse).
16263
+ * @return {string} The URL of the proxy that should handle the request to the
16264
+ * given URL. If no proxy is set, this will be an empty string.
16265
+ */
16266
+ function getProxyForUrl(url) {
16267
+ var parsedUrl = (typeof url === "string" ? parseUrl(url) : url) || {};
16268
+ var proto = parsedUrl.protocol;
16269
+ var hostname = parsedUrl.host;
16270
+ var port = parsedUrl.port;
16271
+ if (typeof hostname !== "string" || !hostname || typeof proto !== "string") return "";
16272
+ proto = proto.split(":", 1)[0];
16273
+ hostname = hostname.replace(/:\d*$/, "");
16274
+ port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0;
16275
+ if (!shouldProxy(hostname, port)) return "";
16276
+ var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy");
16277
+ if (proxy && proxy.indexOf("://") === -1) proxy = proto + "://" + proxy;
16278
+ return proxy;
16279
+ }
16280
+ /**
16281
+ * Determines whether a given URL should be proxied.
16282
+ *
16283
+ * @param {string} hostname - The host name of the URL.
16284
+ * @param {number} port - The effective port of the URL.
16285
+ * @returns {boolean} Whether the given URL should be proxied.
16286
+ * @private
16287
+ */
16288
+ function shouldProxy(hostname, port) {
16289
+ var NO_PROXY = getEnv("no_proxy").toLowerCase();
16290
+ if (!NO_PROXY) return true;
16291
+ if (NO_PROXY === "*") return false;
16292
+ return NO_PROXY.split(/[,\s]/).every(function(proxy) {
16293
+ if (!proxy) return true;
16294
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
16295
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
16296
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
16297
+ if (parsedProxyPort && parsedProxyPort !== port) return true;
16298
+ if (!/^[.*]/.test(parsedProxyHostname)) return hostname !== parsedProxyHostname;
16299
+ if (parsedProxyHostname.charAt(0) === "*") parsedProxyHostname = parsedProxyHostname.slice(1);
16300
+ return !hostname.endsWith(parsedProxyHostname);
16301
+ });
16302
+ }
16303
+ /**
16304
+ * Get the value for an environment variable.
16305
+ *
16306
+ * @param {string} key - The name of the environment variable.
16307
+ * @return {string} The value of the environment variable.
16308
+ * @private
16309
+ */
16310
+ function getEnv(key) {
16311
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
16312
+ }
16272
16313
  //#endregion
16273
16314
  //#region ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
16274
16315
  var require_ms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -17527,16 +17568,16 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17527
17568
  module.exports.wrap = wrap;
17528
17569
  }));
17529
17570
  //#endregion
17530
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/env/data.js
17531
- const VERSION$1 = "1.13.6";
17571
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/env/data.js
17572
+ const VERSION$1 = "1.15.0";
17532
17573
  //#endregion
17533
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/parseProtocol.js
17574
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseProtocol.js
17534
17575
  function parseProtocol(url) {
17535
17576
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
17536
17577
  return match && match[1] || "";
17537
17578
  }
17538
17579
  //#endregion
17539
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/fromDataURI.js
17580
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/fromDataURI.js
17540
17581
  const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
17541
17582
  /**
17542
17583
  * Parse data uri to a Buffer or Blob
@@ -17569,7 +17610,7 @@ function fromDataURI(uri, asBlob, options) {
17569
17610
  throw new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_NOT_SUPPORT);
17570
17611
  }
17571
17612
  //#endregion
17572
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/AxiosTransformStream.js
17613
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/AxiosTransformStream.js
17573
17614
  const kInternals = Symbol("internals");
17574
17615
  var AxiosTransformStream = class extends stream.Transform {
17575
17616
  constructor(options) {
@@ -17663,7 +17704,7 @@ var AxiosTransformStream = class extends stream.Transform {
17663
17704
  }
17664
17705
  };
17665
17706
  //#endregion
17666
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/readBlob.js
17707
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/readBlob.js
17667
17708
  const { asyncIterator } = Symbol;
17668
17709
  const readBlob = async function* (blob) {
17669
17710
  if (blob.stream) yield* blob.stream();
@@ -17672,7 +17713,7 @@ const readBlob = async function* (blob) {
17672
17713
  else yield blob;
17673
17714
  };
17674
17715
  //#endregion
17675
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/formDataToStream.js
17716
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/formDataToStream.js
17676
17717
  const BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
17677
17718
  const textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.TextEncoder();
17678
17719
  const CRLF = "\r\n";
@@ -17732,7 +17773,7 @@ const formDataToStream = (form, headersHandler, options) => {
17732
17773
  })());
17733
17774
  };
17734
17775
  //#endregion
17735
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
17776
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
17736
17777
  var ZlibHeaderTransformStream = class extends stream.Transform {
17737
17778
  __transform(chunk, encoding, callback) {
17738
17779
  this.push(chunk);
@@ -17752,7 +17793,7 @@ var ZlibHeaderTransformStream = class extends stream.Transform {
17752
17793
  }
17753
17794
  };
17754
17795
  //#endregion
17755
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/callbackify.js
17796
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/callbackify.js
17756
17797
  const callbackify = (fn, reducer) => {
17757
17798
  return utils_default.isAsyncFn(fn) ? function(...args) {
17758
17799
  const cb = args.pop();
@@ -17766,7 +17807,64 @@ const callbackify = (fn, reducer) => {
17766
17807
  } : fn;
17767
17808
  };
17768
17809
  //#endregion
17769
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/speedometer.js
17810
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/shouldBypassProxy.js
17811
+ const DEFAULT_PORTS = {
17812
+ http: 80,
17813
+ https: 443,
17814
+ ws: 80,
17815
+ wss: 443,
17816
+ ftp: 21
17817
+ };
17818
+ const parseNoProxyEntry = (entry) => {
17819
+ let entryHost = entry;
17820
+ let entryPort = 0;
17821
+ if (entryHost.charAt(0) === "[") {
17822
+ const bracketIndex = entryHost.indexOf("]");
17823
+ if (bracketIndex !== -1) {
17824
+ const host = entryHost.slice(1, bracketIndex);
17825
+ const rest = entryHost.slice(bracketIndex + 1);
17826
+ if (rest.charAt(0) === ":" && /^\d+$/.test(rest.slice(1))) entryPort = Number.parseInt(rest.slice(1), 10);
17827
+ return [host, entryPort];
17828
+ }
17829
+ }
17830
+ const firstColon = entryHost.indexOf(":");
17831
+ const lastColon = entryHost.lastIndexOf(":");
17832
+ if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
17833
+ entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
17834
+ entryHost = entryHost.slice(0, lastColon);
17835
+ }
17836
+ return [entryHost, entryPort];
17837
+ };
17838
+ const normalizeNoProxyHost = (hostname) => {
17839
+ if (!hostname) return hostname;
17840
+ if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") hostname = hostname.slice(1, -1);
17841
+ return hostname.replace(/\.+$/, "");
17842
+ };
17843
+ function shouldBypassProxy(location) {
17844
+ let parsed;
17845
+ try {
17846
+ parsed = new URL(location);
17847
+ } catch (_err) {
17848
+ return false;
17849
+ }
17850
+ const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").toLowerCase();
17851
+ if (!noProxy) return false;
17852
+ if (noProxy === "*") return true;
17853
+ const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(":", 1)[0]] || 0;
17854
+ const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
17855
+ return noProxy.split(/[\s,]+/).some((entry) => {
17856
+ if (!entry) return false;
17857
+ let [entryHost, entryPort] = parseNoProxyEntry(entry);
17858
+ entryHost = normalizeNoProxyHost(entryHost);
17859
+ if (!entryHost) return false;
17860
+ if (entryPort && entryPort !== port) return false;
17861
+ if (entryHost.charAt(0) === "*") entryHost = entryHost.slice(1);
17862
+ if (entryHost.charAt(0) === ".") return hostname.endsWith(entryHost);
17863
+ return hostname === entryHost;
17864
+ });
17865
+ }
17866
+ //#endregion
17867
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/speedometer.js
17770
17868
  /**
17771
17869
  * Calculate data maxRate
17772
17870
  * @param {Number} [samplesCount= 10]
@@ -17801,7 +17899,7 @@ function speedometer(samplesCount, min) {
17801
17899
  };
17802
17900
  }
17803
17901
  //#endregion
17804
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/throttle.js
17902
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/throttle.js
17805
17903
  /**
17806
17904
  * Throttle decorator
17807
17905
  * @param {Function} fn
@@ -17838,7 +17936,7 @@ function throttle(fn, freq) {
17838
17936
  return [throttled, flush];
17839
17937
  }
17840
17938
  //#endregion
17841
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/progressEventReducer.js
17939
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/progressEventReducer.js
17842
17940
  const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
17843
17941
  let bytesNotified = 0;
17844
17942
  const _speedometer = speedometer(50, 250);
@@ -17872,7 +17970,7 @@ const progressEventDecorator = (total, throttled) => {
17872
17970
  };
17873
17971
  const asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
17874
17972
  //#endregion
17875
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
17973
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
17876
17974
  /**
17877
17975
  * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
17878
17976
  * - For base64: compute exact decoded size using length and padding;
@@ -17922,8 +18020,7 @@ function estimateDataURLDecodedBytes(url) {
17922
18020
  return Buffer.byteLength(body, "utf8");
17923
18021
  }
17924
18022
  //#endregion
17925
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/adapters/http.js
17926
- var import_proxy_from_env = /* @__PURE__ */ __toESM(require_proxy_from_env(), 1);
18023
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/http.js
17927
18024
  var import_follow_redirects = /* @__PURE__ */ __toESM(require_follow_redirects(), 1);
17928
18025
  const zlibOptions = {
17929
18026
  flush: zlib.constants.Z_SYNC_FLUSH,
@@ -17966,6 +18063,7 @@ var Http2Sessions = class {
17966
18063
  while (i--) if (entries[i][0] === session) {
17967
18064
  if (len === 1) delete this.sessions[authority];
17968
18065
  else entries.splice(i, 1);
18066
+ if (!session.closed) session.close();
17969
18067
  return;
17970
18068
  }
17971
18069
  };
@@ -18021,8 +18119,10 @@ function dispatchBeforeRedirect(options, responseDetails) {
18021
18119
  function setProxy(options, configProxy, location) {
18022
18120
  let proxy = configProxy;
18023
18121
  if (!proxy && proxy !== false) {
18024
- const proxyUrl = import_proxy_from_env.getProxyForUrl(location);
18025
- if (proxyUrl) proxy = new URL(proxyUrl);
18122
+ const proxyUrl = getProxyForUrl(location);
18123
+ if (proxyUrl) {
18124
+ if (!shouldBypassProxy(location)) proxy = new URL(proxyUrl);
18125
+ }
18026
18126
  }
18027
18127
  if (proxy) {
18028
18128
  if (proxy.username) proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
@@ -18189,7 +18289,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
18189
18289
  }
18190
18290
  if (supportedProtocols.indexOf(protocol) === -1) return reject(new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_BAD_REQUEST, config));
18191
18291
  const headers = AxiosHeaders$1.from(config.headers).normalize();
18192
- headers.set("User-Agent", "axios/1.13.6", false);
18292
+ headers.set("User-Agent", "axios/1.15.0", false);
18193
18293
  const { onUploadProgress, onDownloadProgress } = config;
18194
18294
  const maxRate = config.maxRate;
18195
18295
  let maxUploadRate = void 0;
@@ -18199,7 +18299,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
18199
18299
  data = formDataToStream(data, (formHeaders) => {
18200
18300
  headers.set(formHeaders);
18201
18301
  }, {
18202
- tag: `axios-1.13.6-boundary`,
18302
+ tag: `axios-1.15.0-boundary`,
18203
18303
  boundary: userBoundary && userBoundary[1] || void 0
18204
18304
  });
18205
18305
  } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
@@ -18419,13 +18519,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
18419
18519
  });
18420
18520
  };
18421
18521
  //#endregion
18422
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isURLSameOrigin.js
18522
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isURLSameOrigin.js
18423
18523
  var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
18424
18524
  url = new URL(url, platform_default.origin);
18425
18525
  return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
18426
18526
  })(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
18427
18527
  //#endregion
18428
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/cookies.js
18528
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/cookies.js
18429
18529
  var cookies_default = platform_default.hasStandardBrowserEnv ? {
18430
18530
  write(name, value, expires, path, domain, secure, sameSite) {
18431
18531
  if (typeof document === "undefined") return;
@@ -18453,7 +18553,7 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? {
18453
18553
  remove() {}
18454
18554
  };
18455
18555
  //#endregion
18456
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/mergeConfig.js
18556
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/mergeConfig.js
18457
18557
  const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
18458
18558
  /**
18459
18559
  * Config-specific merge-function which creates a new config-object
@@ -18531,7 +18631,7 @@ function mergeConfig$1(config1, config2) {
18531
18631
  return config;
18532
18632
  }
18533
18633
  //#endregion
18534
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/resolveConfig.js
18634
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/resolveConfig.js
18535
18635
  var resolveConfig_default = (config) => {
18536
18636
  const newConfig = mergeConfig$1({}, config);
18537
18637
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
@@ -18652,7 +18752,7 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) {
18652
18752
  });
18653
18753
  };
18654
18754
  //#endregion
18655
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/composeSignals.js
18755
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/composeSignals.js
18656
18756
  const composeSignals = (signals, timeout) => {
18657
18757
  const { length } = signals = signals ? signals.filter(Boolean) : [];
18658
18758
  if (timeout || length) {
@@ -18687,7 +18787,7 @@ const composeSignals = (signals, timeout) => {
18687
18787
  }
18688
18788
  };
18689
18789
  //#endregion
18690
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/trackStream.js
18790
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/trackStream.js
18691
18791
  const streamChunk = function* (chunk, chunkSize) {
18692
18792
  let len = chunk.byteLength;
18693
18793
  if (!chunkSize || len < chunkSize) {
@@ -18755,7 +18855,7 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
18755
18855
  }, { highWaterMark: 2 });
18756
18856
  };
18757
18857
  //#endregion
18758
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/adapters/fetch.js
18858
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/fetch.js
18759
18859
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
18760
18860
  const { isFunction } = utils_default;
18761
18861
  const globalFetchAPI = (({ Request, Response }) => ({
@@ -18781,14 +18881,16 @@ const factory = (env) => {
18781
18881
  const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
18782
18882
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
18783
18883
  let duplexAccessed = false;
18884
+ const body = new ReadableStream$1();
18784
18885
  const hasContentType = new Request(platform_default.origin, {
18785
- body: new ReadableStream$1(),
18886
+ body,
18786
18887
  method: "POST",
18787
18888
  get duplex() {
18788
18889
  duplexAccessed = true;
18789
18890
  return "half";
18790
18891
  }
18791
18892
  }).headers.has("Content-Type");
18893
+ body.cancel();
18792
18894
  return duplexAccessed && !hasContentType;
18793
18895
  });
18794
18896
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
@@ -18915,7 +19017,7 @@ const getFetch = (config) => {
18915
19017
  };
18916
19018
  getFetch();
18917
19019
  //#endregion
18918
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/adapters/adapters.js
19020
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/adapters.js
18919
19021
  /**
18920
19022
  * Known adapters mapping.
18921
19023
  * Provides environment-specific adapters for Axios:
@@ -18993,7 +19095,7 @@ var adapters_default = {
18993
19095
  adapters: knownAdapters
18994
19096
  };
18995
19097
  //#endregion
18996
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/dispatchRequest.js
19098
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/dispatchRequest.js
18997
19099
  /**
18998
19100
  * Throws a `CanceledError` if cancellation has been requested.
18999
19101
  *
@@ -19038,7 +19140,7 @@ function dispatchRequest(config) {
19038
19140
  });
19039
19141
  }
19040
19142
  //#endregion
19041
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/validator.js
19143
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/validator.js
19042
19144
  const validators$1 = {};
19043
19145
  [
19044
19146
  "object",
@@ -19111,7 +19213,7 @@ var validator_default = {
19111
19213
  validators: validators$1
19112
19214
  };
19113
19215
  //#endregion
19114
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/Axios.js
19216
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/Axios.js
19115
19217
  const validators = validator_default.validators;
19116
19218
  /**
19117
19219
  * Create a new instance of Axios
@@ -19143,10 +19245,19 @@ var Axios$1 = class {
19143
19245
  if (err instanceof Error) {
19144
19246
  let dummy = {};
19145
19247
  Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = /* @__PURE__ */ new Error();
19146
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
19248
+ const stack = (() => {
19249
+ if (!dummy.stack) return "";
19250
+ const firstNewlineIndex = dummy.stack.indexOf("\n");
19251
+ return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
19252
+ })();
19147
19253
  try {
19148
19254
  if (!err.stack) err.stack = stack;
19149
- else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) err.stack += "\n" + stack;
19255
+ else if (stack) {
19256
+ const firstNewlineIndex = stack.indexOf("\n");
19257
+ const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
19258
+ const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
19259
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) err.stack += "\n" + stack;
19260
+ }
19150
19261
  } catch (e) {}
19151
19262
  }
19152
19263
  throw err;
@@ -19275,7 +19386,7 @@ utils_default.forEach([
19275
19386
  Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
19276
19387
  });
19277
19388
  //#endregion
19278
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/cancel/CancelToken.js
19389
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/CancelToken.js
19279
19390
  /**
19280
19391
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
19281
19392
  *
@@ -19363,7 +19474,7 @@ var CancelToken$1 = class CancelToken$1 {
19363
19474
  }
19364
19475
  };
19365
19476
  //#endregion
19366
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/spread.js
19477
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/spread.js
19367
19478
  /**
19368
19479
  * Syntactic sugar for invoking a function and expanding an array for arguments.
19369
19480
  *
@@ -19391,7 +19502,7 @@ function spread$1(callback) {
19391
19502
  };
19392
19503
  }
19393
19504
  //#endregion
19394
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isAxiosError.js
19505
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isAxiosError.js
19395
19506
  /**
19396
19507
  * Determines whether the payload is an error thrown by Axios
19397
19508
  *
@@ -19403,7 +19514,7 @@ function isAxiosError$1(payload) {
19403
19514
  return utils_default.isObject(payload) && payload.isAxiosError === true;
19404
19515
  }
19405
19516
  //#endregion
19406
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/HttpStatusCode.js
19517
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/HttpStatusCode.js
19407
19518
  const HttpStatusCode$1 = {
19408
19519
  Continue: 100,
19409
19520
  SwitchingProtocols: 101,
@@ -19479,7 +19590,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
19479
19590
  HttpStatusCode$1[value] = key;
19480
19591
  });
19481
19592
  //#endregion
19482
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/axios.js
19593
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/axios.js
19483
19594
  /**
19484
19595
  * Create an instance of Axios
19485
19596
  *
@@ -19518,10 +19629,10 @@ axios.getAdapter = adapters_default.getAdapter;
19518
19629
  axios.HttpStatusCode = HttpStatusCode$1;
19519
19630
  axios.default = axios;
19520
19631
  //#endregion
19521
- //#region ../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/index.js
19632
+ //#region ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/index.js
19522
19633
  const { Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig } = axios;
19523
19634
  //#endregion
19524
- //#region ../../node_modules/.pnpm/@auriclabs+logger@0.1.1_@auriclabs+env@0.0.4_zod@4.3.6__axios@1.13.6_pino-lambda@4.4.1_pino@9.14.0__sst@4.5.1/node_modules/@auriclabs/logger/dist/index.mjs
19635
+ //#region ../../node_modules/.pnpm/@auriclabs+logger@0.1.1_@auriclabs+env@0.0.4_zod@4.3.6__axios@1.15.0_pino-lambda@4.4.1_pino@9.14.0__sst@4.5.1/node_modules/@auriclabs/logger/dist/index.mjs
19525
19636
  var import_dist = require_dist();
19526
19637
  const createBrowserTransport = () => {
19527
19638
  return { write: (obj) => {
@@ -20833,6 +20944,27 @@ async function handleCloudCommand(command) {
20833
20944
  }
20834
20945
  };
20835
20946
  }
20947
+ if (command.command === "runtime.restart") {
20948
+ if (!runtimeProcess) return {
20949
+ type: "COMMAND_ACK",
20950
+ commandId: command.commandId,
20951
+ status: "error",
20952
+ result: {
20953
+ code: "NO_RUNTIME",
20954
+ message: "No runtime process configured"
20955
+ }
20956
+ };
20957
+ logger$1.info("Restarting runtime process");
20958
+ runtimeProcess.restart().catch((err) => {
20959
+ logger$1.error({ err: err instanceof Error ? err.message : String(err) }, "Runtime restart failed");
20960
+ });
20961
+ return {
20962
+ type: "COMMAND_ACK",
20963
+ commandId: command.commandId,
20964
+ status: "ok",
20965
+ result: { restarted: true }
20966
+ };
20967
+ }
20836
20968
  if (command.command === "integration.status") {
20837
20969
  const payload = command.payload;
20838
20970
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "Alfe local gateway daemon — persistent control plane for agent integrations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,8 +24,8 @@
24
24
  "ws": "^8.18.0",
25
25
  "@alfe.ai/ai-proxy-local": "^0.0.7",
26
26
  "@alfe.ai/config": "^0.0.7",
27
- "@alfe.ai/integration-manifest": "^0.0.9",
28
- "@alfe.ai/integrations": "^0.0.27"
27
+ "@alfe.ai/integration-manifest": "^0.0.10",
28
+ "@alfe.ai/integrations": "^0.0.28"
29
29
  },
30
30
  "license": "UNLICENSED",
31
31
  "scripts": {