@infersec/conduit 1.29.0 → 1.31.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;
@@ -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-CyERvKjg.js';
9
+ import { a as asError, s as startInferenceAgent } from './start-CC3HzuZU.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-CyERvKjg.js';
8
+ import { s as startInferenceAgent, a as asError } from './start-CC3HzuZU.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: {
@@ -15433,6 +15452,22 @@ const ServerToClientAPIRequestSchema = APIRequestSchema.extend({
15433
15452
 
15434
15453
  _enum(["inf-end", "inf-src", "storage"]);
15435
15454
 
15455
+ const PlanSlugSchema = _enum(["basic", "business", "free-trial", "open", "team"]);
15456
+ object({
15457
+ href: string$1(),
15458
+ limits: object({
15459
+ endpoints: number$1().int().nonnegative(),
15460
+ sources: number$1().int().nonnegative(),
15461
+ users: number$1().int().nonnegative()
15462
+ }),
15463
+ monthlyCostEUR: number$1().int().nonnegative(),
15464
+ name: string$1(),
15465
+ slug: PlanSlugSchema,
15466
+ trialDays: number$1().int().positive().nullable(),
15467
+ websiteFeatures: array(string$1()),
15468
+ websiteIconPath: string$1()
15469
+ });
15470
+
15436
15471
  function readEnvString(name) {
15437
15472
  if (typeof process.env[name] !== "string") {
15438
15473
  throw new Error(`Expected environment variable was not present: ${name}`);
@@ -98292,6 +98327,21 @@ function createAPIClient({ apiKey, apiURL, inferenceSourceID, logger }) {
98292
98327
  reference: API_SERVICE_CONDUIT_API_REFERENCE,
98293
98328
  route: "/conduit/api/v1/source/:sourceID/metrics/llm"
98294
98329
  });
98330
+ },
98331
+ updateMachineStatus: async (status) => {
98332
+ await fetchByReference({
98333
+ baseURL: apiURL,
98334
+ body: {
98335
+ lastSeen: status.lastSeen.toISOString()
98336
+ },
98337
+ fetch: fetchWithAPIKey,
98338
+ method: "POST",
98339
+ parameters: {
98340
+ sourceID: inferenceSourceID
98341
+ },
98342
+ reference: API_SERVICE_CONDUIT_API_REFERENCE,
98343
+ route: "/conduit/api/v1/source/:sourceID/machine/status"
98344
+ });
98295
98345
  }
98296
98346
  };
98297
98347
  }
@@ -109908,6 +109958,17 @@ class ConduitStateReportManager {
109908
109958
  try {
109909
109959
  await this.apiClient.reportConduitState(this.conduitStateManager.touch());
109910
109960
  this.lastConduitStateReportAt = Date.now();
109961
+ try {
109962
+ await this.apiClient.updateMachineStatus({
109963
+ lastSeen: new Date()
109964
+ });
109965
+ this.logger.debug("Updated machine last-seen time");
109966
+ }
109967
+ catch (error) {
109968
+ this.logger.error("Failed to update machine last-seen", {
109969
+ error: asError(error)
109970
+ });
109971
+ }
109911
109972
  }
109912
109973
  catch (error) {
109913
109974
  this.logger.error("Conduit state update failed", {
@@ -119170,8 +119231,9 @@ async function createApplication({ abortController, apiClient, configuration, lo
119170
119231
  logger.info("Received configuration", {
119171
119232
  modelID: conduitConfiguration.targetModel.id
119172
119233
  });
119234
+ let machine = null;
119173
119235
  try {
119174
- const machine = await collectMachineMetadata();
119236
+ machine = await collectMachineMetadata();
119175
119237
  await apiClient.reportMachineMetadata({
119176
119238
  machine
119177
119239
  });
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.29.0",
4
+ "version": "1.31.0",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },