@alfe.ai/gateway 0.0.42 → 0.0.43

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 +27 -3
  2. package/package.json +1 -1
package/dist/health.js CHANGED
@@ -4824,6 +4824,17 @@ var IPCServer = class {
4824
4824
  this.sendResponse(conn, createIPCError(request.id, "PROTOCOL_MISMATCH", `Unsupported protocol version ${String(protocolVersion)}. Server supports v${String(1)}.`));
4825
4825
  return;
4826
4826
  }
4827
+ const staleIds = [];
4828
+ for (const [existingId, existing] of this.connections) if (existingId !== conn.id && existing.info?.name === name) {
4829
+ logger$1.info({
4830
+ staleConnId: existingId,
4831
+ newConnId: conn.id,
4832
+ plugin: name
4833
+ }, "IPC: closing stale duplicate connection");
4834
+ existing.socket.destroy();
4835
+ staleIds.push(existingId);
4836
+ }
4837
+ for (const id of staleIds) this.connections.delete(id);
4827
4838
  conn.info = {
4828
4839
  name,
4829
4840
  version,
@@ -17122,7 +17133,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17122
17133
  else module.exports = require_node();
17123
17134
  }));
17124
17135
  //#endregion
17125
- //#region ../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js
17136
+ //#region ../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js
17126
17137
  var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17127
17138
  var debug;
17128
17139
  module.exports = function() {
@@ -17136,7 +17147,7 @@ var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17136
17147
  };
17137
17148
  }));
17138
17149
  //#endregion
17139
- //#region ../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js
17150
+ //#region ../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/index.js
17140
17151
  var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17141
17152
  var url$1 = __require("url");
17142
17153
  var URL = url$1.URL;
@@ -17158,6 +17169,11 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17158
17169
  } catch (error) {
17159
17170
  useNativeURL = error.code === "ERR_INVALID_URL";
17160
17171
  }
17172
+ var sensitiveHeaders = [
17173
+ "Authorization",
17174
+ "Proxy-Authorization",
17175
+ "Cookie"
17176
+ ];
17161
17177
  var preservedUrlFields = [
17162
17178
  "auth",
17163
17179
  "host",
@@ -17211,6 +17227,7 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17211
17227
  self.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
17212
17228
  }
17213
17229
  };
17230
+ this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i");
17214
17231
  this._performRequest();
17215
17232
  }
17216
17233
  RedirectableRequest.prototype = Object.create(Writable.prototype);
@@ -17334,6 +17351,7 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17334
17351
  });
17335
17352
  RedirectableRequest.prototype._sanitizeOptions = function(options) {
17336
17353
  if (!options.headers) options.headers = {};
17354
+ if (!isArray(options.sensitiveHeaders)) options.sensitiveHeaders = [];
17337
17355
  if (options.host) {
17338
17356
  if (!options.hostname) options.hostname = options.host;
17339
17357
  delete options.host;
@@ -17412,7 +17430,7 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17412
17430
  debug("redirecting to", redirectUrl.href);
17413
17431
  this._isRedirect = true;
17414
17432
  spreadUrlObject(redirectUrl, this._options);
17415
- if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
17433
+ if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) removeMatchingHeaders(this._headerFilter, this._options.headers);
17416
17434
  if (isFunction(beforeRedirect)) {
17417
17435
  var responseDetails = {
17418
17436
  headers: response.headers,
@@ -17549,6 +17567,9 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17549
17567
  var dot = subdomain.length - domain.length - 1;
17550
17568
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
17551
17569
  }
17570
+ function isArray(value) {
17571
+ return value instanceof Array;
17572
+ }
17552
17573
  function isString(value) {
17553
17574
  return typeof value === "string" || value instanceof String;
17554
17575
  }
@@ -17561,6 +17582,9 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
17561
17582
  function isURL(value) {
17562
17583
  return URL && value instanceof URL;
17563
17584
  }
17585
+ function escapeRegex(regex) {
17586
+ return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
17587
+ }
17564
17588
  module.exports = wrap({
17565
17589
  http: http$1,
17566
17590
  https: https$1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Alfe local gateway daemon — persistent control plane for agent integrations",
5
5
  "type": "module",
6
6
  "bin": {