@infersec/conduit 1.28.2 → 1.30.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.
|
@@ -6,6 +6,9 @@ export interface APIClient {
|
|
|
6
6
|
reportConduitState: (state: ConduitState) => Promise<void>;
|
|
7
7
|
reportMachineMetadata: (payload: InferenceAgentMachineReportPayload) => Promise<void>;
|
|
8
8
|
reportPromptMetrics: (payload: InferenceAgentLLMMetricsPayload) => Promise<void>;
|
|
9
|
+
updateMachineStatus: (status: {
|
|
10
|
+
lastSeen: Date;
|
|
11
|
+
}) => Promise<void>;
|
|
9
12
|
}
|
|
10
13
|
export declare function createAPIClient({ apiKey, apiURL, inferenceSourceID, logger }: {
|
|
11
14
|
apiKey: string;
|
package/dist/application.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Application } from "express";
|
|
2
|
-
import { Logger } from "@infersec/logger";
|
|
3
2
|
import { APIClient } from "./apiClient/index.js";
|
|
4
3
|
import { Configuration } from "./configuration.js";
|
|
4
|
+
import { Logger } from "@infersec/logger";
|
|
5
5
|
export declare function createApplication({ abortController, apiClient, configuration, logger }: {
|
|
6
6
|
abortController: AbortController;
|
|
7
7
|
apiClient: APIClient;
|
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-3r2ov9qj.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-3r2ov9qj.js';
|
|
9
9
|
import 'argon2';
|
|
10
10
|
import 'node:child_process';
|
|
11
11
|
import 'node:stream';
|
|
@@ -14883,6 +14883,25 @@ const API_SERVICE_CONDUIT_API_REFERENCE = {
|
|
|
14883
14883
|
}
|
|
14884
14884
|
}
|
|
14885
14885
|
},
|
|
14886
|
+
"/conduit/api/v1/source/:sourceID/machine/status": {
|
|
14887
|
+
POST: {
|
|
14888
|
+
auth: {
|
|
14889
|
+
type: "api-key"
|
|
14890
|
+
},
|
|
14891
|
+
body: object({
|
|
14892
|
+
lastSeen: string$1()
|
|
14893
|
+
}),
|
|
14894
|
+
parameters: {
|
|
14895
|
+
sourceID: ULIDSchema
|
|
14896
|
+
},
|
|
14897
|
+
response: {
|
|
14898
|
+
schema: object({
|
|
14899
|
+
acknowledged: literal(true)
|
|
14900
|
+
}),
|
|
14901
|
+
type: "rest"
|
|
14902
|
+
}
|
|
14903
|
+
}
|
|
14904
|
+
},
|
|
14886
14905
|
"/conduit/api/v1/source/:sourceID/state": {
|
|
14887
14906
|
POST: {
|
|
14888
14907
|
auth: {
|
|
@@ -98292,6 +98311,21 @@ function createAPIClient({ apiKey, apiURL, inferenceSourceID, logger }) {
|
|
|
98292
98311
|
reference: API_SERVICE_CONDUIT_API_REFERENCE,
|
|
98293
98312
|
route: "/conduit/api/v1/source/:sourceID/metrics/llm"
|
|
98294
98313
|
});
|
|
98314
|
+
},
|
|
98315
|
+
updateMachineStatus: async (status) => {
|
|
98316
|
+
await fetchByReference({
|
|
98317
|
+
baseURL: apiURL,
|
|
98318
|
+
body: {
|
|
98319
|
+
lastSeen: status.lastSeen.toISOString()
|
|
98320
|
+
},
|
|
98321
|
+
fetch: fetchWithAPIKey,
|
|
98322
|
+
method: "POST",
|
|
98323
|
+
parameters: {
|
|
98324
|
+
sourceID: inferenceSourceID
|
|
98325
|
+
},
|
|
98326
|
+
reference: API_SERVICE_CONDUIT_API_REFERENCE,
|
|
98327
|
+
route: "/conduit/api/v1/source/:sourceID/machine/status"
|
|
98328
|
+
});
|
|
98295
98329
|
}
|
|
98296
98330
|
};
|
|
98297
98331
|
}
|
|
@@ -109908,6 +109942,17 @@ class ConduitStateReportManager {
|
|
|
109908
109942
|
try {
|
|
109909
109943
|
await this.apiClient.reportConduitState(this.conduitStateManager.touch());
|
|
109910
109944
|
this.lastConduitStateReportAt = Date.now();
|
|
109945
|
+
try {
|
|
109946
|
+
await this.apiClient.updateMachineStatus({
|
|
109947
|
+
lastSeen: new Date()
|
|
109948
|
+
});
|
|
109949
|
+
this.logger.debug("Updated machine last-seen time");
|
|
109950
|
+
}
|
|
109951
|
+
catch (error) {
|
|
109952
|
+
this.logger.error("Failed to update machine last-seen", {
|
|
109953
|
+
error: asError(error)
|
|
109954
|
+
});
|
|
109955
|
+
}
|
|
109911
109956
|
}
|
|
109912
109957
|
catch (error) {
|
|
109913
109958
|
this.logger.error("Conduit state update failed", {
|
|
@@ -119170,8 +119215,9 @@ async function createApplication({ abortController, apiClient, configuration, lo
|
|
|
119170
119215
|
logger.info("Received configuration", {
|
|
119171
119216
|
modelID: conduitConfiguration.targetModel.id
|
|
119172
119217
|
});
|
|
119218
|
+
let machine = null;
|
|
119173
119219
|
try {
|
|
119174
|
-
|
|
119220
|
+
machine = await collectMachineMetadata();
|
|
119175
119221
|
await apiClient.reportMachineMetadata({
|
|
119176
119222
|
machine
|
|
119177
119223
|
});
|