@infersec/conduit 1.22.7 → 1.23.0
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/{start-Cqvc5hOj.js → start-MoDI8K51.js} +10 -15
- package/package.json +1 -1
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-
|
|
9
|
+
import { a as asError, s as startInferenceAgent } from './start-MoDI8K51.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-
|
|
8
|
+
import { s as startInferenceAgent, a as asError } from './start-MoDI8K51.js';
|
|
9
9
|
import 'argon2';
|
|
10
10
|
import 'node:child_process';
|
|
11
11
|
import 'node:stream';
|
|
@@ -14747,9 +14747,7 @@ const InferenceAgentMachineReportPayloadSchema = object({
|
|
|
14747
14747
|
machine: InferenceAgentMachineMetadataSchema
|
|
14748
14748
|
});
|
|
14749
14749
|
const InferenceAgentResponseChunkPayloadSchema = object({
|
|
14750
|
-
data: string$1()
|
|
14751
|
-
.regex(/^data:text\/plain;base64,/)
|
|
14752
|
-
.nullable(),
|
|
14750
|
+
data: string$1().nullable(),
|
|
14753
14751
|
headers: record(string$1(), string$1()).default({}).optional(),
|
|
14754
14752
|
requestID: ULIDSchema,
|
|
14755
14753
|
sequence: number$1().int().nonnegative(),
|
|
@@ -15258,9 +15256,7 @@ object({
|
|
|
15258
15256
|
status: number$1().int().min(100).max(599)
|
|
15259
15257
|
});
|
|
15260
15258
|
const ClientToServerAPIResponseSchema = object({
|
|
15261
|
-
data: string$1()
|
|
15262
|
-
.regex(/^data:text\/plain;base64,/)
|
|
15263
|
-
.nullable(),
|
|
15259
|
+
data: string$1().nullable(),
|
|
15264
15260
|
headers: record(string$1(), string$1()).default({}).optional(),
|
|
15265
15261
|
requestID: ULIDSchema,
|
|
15266
15262
|
status: number$1().int().min(100).max(599).default(200).optional()
|
|
@@ -108436,7 +108432,7 @@ async function handleRequest({ apiURL, configuration, logger, modelID, onRequest
|
|
|
108436
108432
|
apiURL,
|
|
108437
108433
|
configuration,
|
|
108438
108434
|
payload: {
|
|
108439
|
-
data:
|
|
108435
|
+
data: encodeBinaryChunk(Buffer.from(failureMessage)),
|
|
108440
108436
|
sequence: 0,
|
|
108441
108437
|
status: 502
|
|
108442
108438
|
},
|
|
@@ -108481,7 +108477,9 @@ async function streamResponse({ apiURL, configuration, logger, requestID, reques
|
|
|
108481
108477
|
let timeToFirstTokenMs = null;
|
|
108482
108478
|
if (response.body instanceof Readable) {
|
|
108483
108479
|
for await (const chunk of response.body) {
|
|
108484
|
-
const buffer = Buffer.isBuffer(chunk)
|
|
108480
|
+
const buffer = Buffer.isBuffer(chunk)
|
|
108481
|
+
? chunk
|
|
108482
|
+
: Buffer.from(chunk);
|
|
108485
108483
|
if (timeToFirstTokenMs === null) {
|
|
108486
108484
|
timeToFirstTokenMs = Math.max(0, Date.now() - requestStartedAt);
|
|
108487
108485
|
}
|
|
@@ -108490,7 +108488,7 @@ async function streamResponse({ apiURL, configuration, logger, requestID, reques
|
|
|
108490
108488
|
apiURL,
|
|
108491
108489
|
configuration,
|
|
108492
108490
|
payload: {
|
|
108493
|
-
data:
|
|
108491
|
+
data: encodeBinaryChunk(buffer),
|
|
108494
108492
|
sequence,
|
|
108495
108493
|
status: response.status
|
|
108496
108494
|
},
|
|
@@ -108527,7 +108525,7 @@ async function streamResponse({ apiURL, configuration, logger, requestID, reques
|
|
|
108527
108525
|
apiURL,
|
|
108528
108526
|
configuration,
|
|
108529
108527
|
payload: {
|
|
108530
|
-
data:
|
|
108528
|
+
data: encodeBinaryChunk(Buffer.from(responsePayload)),
|
|
108531
108529
|
headers: response.headers,
|
|
108532
108530
|
sequence,
|
|
108533
108531
|
status: response.status
|
|
@@ -108572,11 +108570,8 @@ async function postChunk({ apiURL, configuration, payload, requestID }) {
|
|
|
108572
108570
|
method: "POST"
|
|
108573
108571
|
});
|
|
108574
108572
|
}
|
|
108575
|
-
function
|
|
108576
|
-
|
|
108577
|
-
return `data:text/plain;base64,${chunk.toString("base64")}`;
|
|
108578
|
-
}
|
|
108579
|
-
return `data:text/plain;base64,${Buffer.from(chunk, "utf-8").toString("base64")}`;
|
|
108573
|
+
function encodeBinaryChunk(chunk) {
|
|
108574
|
+
return chunk.toString("base64");
|
|
108580
108575
|
}
|
|
108581
108576
|
function calculateRequestBytes(body) {
|
|
108582
108577
|
if (body === null || body === undefined) {
|