@infersec/conduit 1.4.2 → 1.5.1

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/README.md CHANGED
@@ -5,25 +5,36 @@ Conduit agent for connecting local LLMs to the Infersec cloud.
5
5
  ## Usage
6
6
 
7
7
  ```bash
8
- npx @infersec/conduit --source <source-id> --key <api-key>
8
+ npx @infersec/conduit --engine <type> --key <api-key> --source <source-id>
9
9
  ```
10
10
 
11
- Optional flags:
11
+ ### Flags
12
12
 
13
- ```bash
14
- --api-url <url> API base URL
15
- --engine <type> Engine type
16
- --port <number> Port to listen on
17
- --root <path> Root directory
18
- ```
13
+ | Flag | Required | Default | Notes |
14
+ | ----------- | -------- | ------------------------------ | ------------------------------------------ |
15
+ | `--engine` | Yes | - | Engine type (matches `ENGINE`). |
16
+ | `--key` | Yes | - | API key (matches `API_KEY`). |
17
+ | `--source` | Yes | - | Inference source ID (matches `SOURCE`). |
18
+ | `--api-url` | No | `https://api.infersec.ai` | API base URL (matches `API_URL`). |
19
+ | `--port` | No | `9505` | Port to listen on (matches `PORT`). |
20
+ | `--root` | No | `$HOME/.cache/infersec/iagent` | Root directory (matches `ROOT_DIRECTORY`). |
21
+
22
+ ### Examples
23
+
24
+ | Scenario | Command |
25
+ | ---------------- | ------------------------------------------------------------------------------------------------------------ |
26
+ | Required only | `npx @infersec/conduit --engine vllm --key <api-key> --source <source-id>` |
27
+ | Custom root/port | `npx @infersec/conduit --engine vllm --key <api-key> --source <source-id> --root /data/infersec --port 9506` |
19
28
 
20
29
  ## Environment variables
21
30
 
22
- - AGENT_ENGINE_TYPE
23
- - API_KEY
24
- - API_URL
25
- - INFERENCE_SOURCE_ID
26
- - PORT
27
- - ROOT_DIRECTORY
31
+ | Variable | Required | Default | Notes |
32
+ | ---------------- | -------- | ------------------------------ | ----------------------------------------- |
33
+ | `ENGINE` | Yes | - | Engine type (matches `--engine`). |
34
+ | `API_KEY` | Yes | - | API key (matches `--key`). |
35
+ | `SOURCE` | Yes | - | Inference source ID (matches `--source`). |
36
+ | `API_URL` | No | `https://api.infersec.ai` | API base URL (matches `--api-url`). |
37
+ | `PORT` | No | `9505` | Port to listen on (matches `--port`). |
38
+ | `ROOT_DIRECTORY` | No | `$HOME/.cache/infersec/iagent` | Root directory (matches `--root`). |
28
39
 
29
40
  CLI flags override environment variables when both are provided.
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ const __dirname = dirname(__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-BmI1Iw_1.js';
9
+ import { a as asError, s as startInferenceAgent } from './start-Cs0zWiJW.js';
10
10
  import 'argon2';
11
11
  import 'node:child_process';
12
12
  import 'node:stream';
@@ -61,12 +61,13 @@ import 'systeminformation';
61
61
  const USAGE = `Usage: npx @infersec/conduit --source <id> --key <key> [options]
62
62
 
63
63
  Options:
64
- --api-url <url> API base URL (or API_URL)
65
- --engine <type> Engine type (or AGENT_ENGINE_TYPE)
66
- --key <value> API key (or API_KEY)
67
- --port <number> Port to listen on (or PORT)
68
- --root <path> Root directory (or ROOT_DIRECTORY)
69
- --source <id> Inference source ID (or INFERENCE_SOURCE_ID)
64
+ --api-key <value> API key (or API_KEY)
65
+ --api-url <url> API base URL (or API_URL)
66
+ --engine <type> Engine type (or ENGINE)
67
+ --key <value> API key (or API_KEY)
68
+ --port <number> Port to listen on (or PORT)
69
+ --root <path> Root directory (or ROOT_DIRECTORY)
70
+ --source <id> Inference source ID (or SOURCE)
70
71
  -h, --help Show this help message
71
72
  `;
72
73
  async function run() {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ const __filename = __fileURLToPath(import.meta.url);
5
5
  const __dirname = dirname(__filename);
6
6
 
7
7
  import 'node:crypto';
8
- import { s as startInferenceAgent, a as asError } from './start-BmI1Iw_1.js';
8
+ import { s as startInferenceAgent, a as asError } from './start-Cs0zWiJW.js';
9
9
  import 'argon2';
10
10
  import 'node:child_process';
11
11
  import 'node:stream';
@@ -5676,19 +5676,18 @@ object({
5676
5676
 
5677
5677
  _enum(["inf-end", "inf-src", "storage"]);
5678
5678
 
5679
- function readEnvInteger(name) {
5680
- const str = readEnvString(name).trim();
5681
- if (!/^\d+$/.test(str)) {
5682
- throw new Error(`Invalid integer value for environment variable '${name}': ${str}`);
5683
- }
5684
- return parseInt(str, 10);
5685
- }
5686
5679
  function readEnvString(name) {
5687
5680
  if (typeof process.env[name] !== "string") {
5688
5681
  throw new Error(`Expected environment variable was not present: ${name}`);
5689
5682
  }
5690
5683
  return process.env[name];
5691
5684
  }
5685
+ function readEnvStringOptional(name, defaultValue) {
5686
+ if (typeof process.env[name] !== "string") {
5687
+ return defaultValue;
5688
+ }
5689
+ return process.env[name];
5690
+ }
5692
5691
 
5693
5692
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5694
5693
 
@@ -104876,13 +104875,18 @@ async function createApplication({ abortController, apiClient, configuration, lo
104876
104875
  }
104877
104876
 
104878
104877
  function getConfiguration({ overrides } = {}) {
104879
- const agentEngineTypeValue = overrides?.agentEngineType ?? readEnvString("AGENT_ENGINE_TYPE");
104878
+ const agentEngineTypeValue = overrides?.agentEngineType ?? readEnvString("ENGINE");
104880
104879
  const agentEngineType = LLMEngineSchema.parse(agentEngineTypeValue);
104881
104880
  const apiKey = overrides?.apiKey ?? readEnvString("API_KEY");
104882
- const apiURL = overrides?.apiURL ?? readEnvString("API_URL");
104883
- const inferenceSourceID = overrides?.inferenceSourceID ?? readEnvString("INFERENCE_SOURCE_ID");
104884
- const port = overrides?.port ?? readEnvInteger("PORT");
104885
- const rootDirectory = overrides?.rootDirectory ?? readEnvString("ROOT_DIRECTORY");
104881
+ const apiURL = overrides?.apiURL ?? readEnvStringOptional("API_URL", "https://api.infersec.ai");
104882
+ const inferenceSourceID = overrides?.inferenceSourceID ?? readEnvString("SOURCE");
104883
+ const portValue = overrides?.port ?? readEnvStringOptional("PORT", "9505");
104884
+ const port = Number.parseInt(String(portValue), 10);
104885
+ if (Number.isNaN(port)) {
104886
+ throw new Error(`Invalid port: ${portValue}`);
104887
+ }
104888
+ const defaultRootDirectory = join(process.env.HOME ?? "/tmp", ".cache", "infersec", "iagent");
104889
+ const rootDirectory = overrides?.rootDirectory ?? readEnvStringOptional("ROOT_DIRECTORY", defaultRootDirectory);
104886
104890
  return {
104887
104891
  agentEngineType,
104888
104892
  apiKey,
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.4.2",
4
+ "version": "1.5.1",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },