@infersec/conduit 1.16.1 → 1.17.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.
|
@@ -5,7 +5,7 @@ export interface APIClient {
|
|
|
5
5
|
reportMachineMetadata: (payload: InferenceAgentMachineReportPayload) => Promise<void>;
|
|
6
6
|
reportPromptMetrics: (payload: InferenceAgentLLMMetricsPayload) => Promise<void>;
|
|
7
7
|
}
|
|
8
|
-
export declare function createAPIClient({ apiURL, inferenceSourceID }: {
|
|
8
|
+
export declare function createAPIClient({ apiKey, apiURL, inferenceSourceID }: {
|
|
9
9
|
apiKey: string;
|
|
10
10
|
apiURL: string;
|
|
11
11
|
inferenceSourceID: ULID;
|
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-CCmUbFoS.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-CCmUbFoS.js';
|
|
9
9
|
import 'argon2';
|
|
10
10
|
import 'node:child_process';
|
|
11
11
|
import 'node:stream';
|
|
@@ -52625,6 +52625,19 @@ function requireUndici () {
|
|
|
52625
52625
|
|
|
52626
52626
|
var undiciExports = requireUndici();
|
|
52627
52627
|
|
|
52628
|
+
function createFetchWithHeaders({ fetchFn = undiciExports.fetch, headers }) {
|
|
52629
|
+
function fetchWithHeaders(url, options) {
|
|
52630
|
+
const mergedHeaders = new Headers(options.headers);
|
|
52631
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
52632
|
+
mergedHeaders.set(key, value);
|
|
52633
|
+
}
|
|
52634
|
+
return fetchFn(url, {
|
|
52635
|
+
...options,
|
|
52636
|
+
headers: mergedHeaders
|
|
52637
|
+
});
|
|
52638
|
+
}
|
|
52639
|
+
return fetchWithHeaders;
|
|
52640
|
+
}
|
|
52628
52641
|
async function fetchByReference(options) {
|
|
52629
52642
|
const { baseURL, body, fetch: fetchFn = undiciExports.fetch, parameters = {}, query = {}, reference, route, method } = options;
|
|
52630
52643
|
if (!reference[route]) {
|
|
@@ -97906,11 +97919,17 @@ function implementAPIReference({ api, logger, mount, reference }) {
|
|
|
97906
97919
|
}
|
|
97907
97920
|
}
|
|
97908
97921
|
|
|
97909
|
-
function createAPIClient({ apiURL, inferenceSourceID }) {
|
|
97922
|
+
function createAPIClient({ apiKey, apiURL, inferenceSourceID }) {
|
|
97923
|
+
const fetchWithAPIKey = createFetchWithHeaders({
|
|
97924
|
+
headers: {
|
|
97925
|
+
"x-api-key": apiKey
|
|
97926
|
+
}
|
|
97927
|
+
});
|
|
97910
97928
|
return {
|
|
97911
97929
|
getConduitConfiguration: async () => {
|
|
97912
97930
|
const result = await fetchByReference({
|
|
97913
97931
|
baseURL: apiURL,
|
|
97932
|
+
fetch: fetchWithAPIKey,
|
|
97914
97933
|
reference: API_SERVICE_CONDUIT_API_REFERENCE,
|
|
97915
97934
|
route: "/conduit/api/v1/source/:sourceID/configuration",
|
|
97916
97935
|
method: "GET",
|
|
@@ -97924,6 +97943,7 @@ function createAPIClient({ apiURL, inferenceSourceID }) {
|
|
|
97924
97943
|
await fetchByReference({
|
|
97925
97944
|
baseURL: apiURL,
|
|
97926
97945
|
body: payload,
|
|
97946
|
+
fetch: fetchWithAPIKey,
|
|
97927
97947
|
method: "POST",
|
|
97928
97948
|
parameters: {
|
|
97929
97949
|
sourceID: inferenceSourceID
|
|
@@ -97936,6 +97956,7 @@ function createAPIClient({ apiURL, inferenceSourceID }) {
|
|
|
97936
97956
|
await fetchByReference({
|
|
97937
97957
|
baseURL: apiURL,
|
|
97938
97958
|
body: state,
|
|
97959
|
+
fetch: fetchWithAPIKey,
|
|
97939
97960
|
method: "POST",
|
|
97940
97961
|
parameters: {
|
|
97941
97962
|
sourceID: inferenceSourceID
|
|
@@ -97948,6 +97969,7 @@ function createAPIClient({ apiURL, inferenceSourceID }) {
|
|
|
97948
97969
|
await fetchByReference({
|
|
97949
97970
|
baseURL: apiURL,
|
|
97950
97971
|
body: payload,
|
|
97972
|
+
fetch: fetchWithAPIKey,
|
|
97951
97973
|
method: "POST",
|
|
97952
97974
|
parameters: {
|
|
97953
97975
|
sourceID: inferenceSourceID
|
|
@@ -118203,6 +118225,7 @@ async function startInferenceAgent({ configurationOverrides }) {
|
|
|
118203
118225
|
agentEngineType: configuration.agentEngineType
|
|
118204
118226
|
});
|
|
118205
118227
|
const apiClient = createAPIClient({
|
|
118228
|
+
apiKey: configuration.apiKey,
|
|
118206
118229
|
apiURL: configuration.apiURL,
|
|
118207
118230
|
inferenceSourceID: configuration.inferenceSourceID
|
|
118208
118231
|
});
|