@infersec/conduit 1.20.2 → 1.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ const __dirname = __pathDirname(__filename);
6
6
 
7
7
  import { parseArgs } from 'node:util';
8
8
  import 'node:crypto';
9
- import { a as asError, s as startInferenceAgent } from './start-CopKwPN6.js';
9
+ import { a as asError, s as startInferenceAgent } from './start-mkMX6VEU.js';
10
10
  import 'argon2';
11
11
  import 'node:child_process';
12
12
  import 'node:stream';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ const __filename = __fileURLToPath(import.meta.url);
5
5
  const __dirname = __pathDirname(__filename);
6
6
 
7
7
  import 'node:crypto';
8
- import { s as startInferenceAgent, a as asError } from './start-CopKwPN6.js';
8
+ import { s as startInferenceAgent, a as asError } from './start-mkMX6VEU.js';
9
9
  import 'argon2';
10
10
  import 'node:child_process';
11
11
  import 'node:stream';
@@ -15775,6 +15775,9 @@ function joinURL(...parts) {
15775
15775
  .replace("&", "?");
15776
15776
  }
15777
15777
 
15778
+ function isTerminatedError(error) {
15779
+ return error instanceof Error && error.message === "terminated" && error.name === "TypeError";
15780
+ }
15778
15781
  async function connectSSE(url, options) {
15779
15782
  const response = await fetch(url, {
15780
15783
  headers: {
@@ -108349,18 +108352,23 @@ async function handleSSERequests({ apiURL, configuration, logger, modelID, onReq
108349
108352
  if (signal?.aborted) {
108350
108353
  return;
108351
108354
  }
108352
- logger.error("SSE connection failed", {
108353
- error: asError(error)
108354
- });
108355
- }
108356
- if (signal?.aborted) {
108357
- return;
108355
+ const isTerminated = isTerminatedError(error);
108356
+ if (!isTerminated) {
108357
+ logger.error("SSE connection failed", {
108358
+ error: asError(error)
108359
+ });
108360
+ }
108361
+ if (signal?.aborted) {
108362
+ return;
108363
+ }
108364
+ if (!isTerminated) {
108365
+ const connectionDurationMs = Date.now() - connectionStartedAt;
108366
+ reconnectAttempt = connectionDurationMs > 10000 ? 0 : reconnectAttempt + 1;
108367
+ const reconnectDelayMs = Math.min(maxReconnectDelayMs, Math.max(1000, 1000 * 2 ** Math.min(6, reconnectAttempt)));
108368
+ logger.warn("SSE disconnected, retrying");
108369
+ await sleep(reconnectDelayMs);
108370
+ }
108358
108371
  }
108359
- const connectionDurationMs = Date.now() - connectionStartedAt;
108360
- reconnectAttempt = connectionDurationMs > 10000 ? 0 : reconnectAttempt + 1;
108361
- const reconnectDelayMs = Math.min(maxReconnectDelayMs, Math.max(1000, 1000 * 2 ** Math.min(6, reconnectAttempt)));
108362
- logger.warn("SSE disconnected, retrying");
108363
- await sleep(reconnectDelayMs);
108364
108372
  }
108365
108373
  }
108366
108374
  async function handleRequest({ apiURL, configuration, logger, modelID, onRequest, onRequestEnd, onRequestStart, reportMetrics, request }) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infersec/conduit",
3
3
  "description": "End user conduit agent for connecting local LLMs to the cloud.",
4
- "version": "1.20.2",
4
+ "version": "1.20.3",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },