llm-cli-gateway 1.5.13 → 1.5.15

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/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to the llm-cli-gateway project.
4
4
 
5
+ ## [1.5.15] - 2026-05-24
6
+
7
+ ### Fixed
8
+
9
+ - Make the desktop bootstrapper `upgrade` command discover the latest GitHub release bundle and SHA256SUMS itself, so `llm-cli-gateway upgrade` no longer depends on stale `RVWR_GATEWAY_BUNDLE_URL` / `RVWR_GATEWAY_BUNDLE_SHA256` shell state.
10
+ - Add desktop bootstrapper `--version`, `version`, `--help`, `-help`, and `/?` handling, and report the real release version in `doctor` instead of `"bootstrapper"`.
11
+ - Normalize bundle checksum comparison and include expected/actual hashes when verification fails.
12
+
13
+ ### Changed
14
+
15
+ - Move `pg` and `ioredis` out of the default production install path and into optional peer dependencies, while keeping them as dev dependencies for PostgreSQL/Redis tests and development.
16
+
17
+ ## [1.5.14] - 2026-05-24
18
+
19
+ ### Fixed
20
+
21
+ - Remove the Redis Lua `eval` lock-release path from production source and replace it with Redis `WATCH`/`MULTI` compare-and-delete semantics.
22
+ - Add exact direct production dependencies for `content-type@1.0.5` and `type-is@2.0.1` so packed consumer installs do not resolve the Socket-flagged `content-type@2.0.0` / `type-is@2.1.0` versions.
23
+
24
+ ### Added
25
+
26
+ - Add `npm run security:audit` as a CI/release gate covering `npm audit --omit=dev`, production source dynamic-execution scanning, blocked dependency-version checks, and a packed consumer install policy check.
27
+
5
28
  ## [1.5.13] - 2026-05-24
6
29
 
7
30
  ### Fixed
package/dist/db.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Pool } from "pg";
2
- import { Redis } from "ioredis";
1
+ import type { Pool } from "pg";
2
+ import type { Redis } from "ioredis";
3
3
  import { Config } from "./config.js";
4
4
  import type { Logger } from "./logger.js";
5
5
  export interface HealthCheckResult {
package/dist/db.js CHANGED
@@ -1,5 +1,3 @@
1
- import { Pool } from "pg";
2
- import { Redis } from "ioredis";
3
1
  import { noopLogger } from "./logger.js";
4
2
  /**
5
3
  * Database connection manager for PostgreSQL and Redis
@@ -20,6 +18,8 @@ export class DatabaseConnection {
20
18
  * Initialize connections to PostgreSQL and Redis
21
19
  */
22
20
  async connect() {
21
+ const { Pool } = await importOptionalPg();
22
+ const Redis = await importOptionalRedis();
23
23
  // Initialize PostgreSQL pool
24
24
  const poolConfig = {
25
25
  connectionString: this.config.database.connectionString,
@@ -160,6 +160,29 @@ export class DatabaseConnection {
160
160
  return this.redis;
161
161
  }
162
162
  }
163
+ async function importOptionalPg() {
164
+ try {
165
+ return await import("pg");
166
+ }
167
+ catch (error) {
168
+ if (error?.code === "ERR_MODULE_NOT_FOUND" || error?.code === "MODULE_NOT_FOUND") {
169
+ throw new Error("PostgreSQL sessions require optional peer dependency 'pg'. Install it alongside llm-cli-gateway to use DATABASE_URL/REDIS_URL-backed sessions.");
170
+ }
171
+ throw error;
172
+ }
173
+ }
174
+ async function importOptionalRedis() {
175
+ try {
176
+ const mod = await import("ioredis");
177
+ return mod.Redis ?? mod.default;
178
+ }
179
+ catch (error) {
180
+ if (error?.code === "ERR_MODULE_NOT_FOUND" || error?.code === "MODULE_NOT_FOUND") {
181
+ throw new Error("PostgreSQL sessions require optional peer dependency 'ioredis'. Install it alongside llm-cli-gateway to use DATABASE_URL/REDIS_URL-backed sessions.");
182
+ }
183
+ throw error;
184
+ }
185
+ }
163
186
  /**
164
187
  * Factory function to create and connect DatabaseConnection
165
188
  */
package/dist/migrate.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { Pool } from "pg";
3
2
  import { readFileSync, readdirSync } from "fs";
4
3
  import { join, dirname } from "path";
5
4
  import { fileURLToPath } from "url";
@@ -68,6 +67,7 @@ async function main() {
68
67
  console.error("ERROR: DATABASE_URL environment variable not set");
69
68
  process.exit(1);
70
69
  }
70
+ const { Pool } = await importOptionalPg();
71
71
  const pool = new Pool({ connectionString: databaseUrl });
72
72
  try {
73
73
  // Load migrations
@@ -97,4 +97,15 @@ async function main() {
97
97
  await pool.end();
98
98
  }
99
99
  }
100
+ async function importOptionalPg() {
101
+ try {
102
+ return await import("pg");
103
+ }
104
+ catch (error) {
105
+ if (error?.code === "ERR_MODULE_NOT_FOUND" || error?.code === "MODULE_NOT_FOUND") {
106
+ throw new Error("PostgreSQL migrations require optional peer dependency 'pg'. Install it alongside llm-cli-gateway before running migrate.");
107
+ }
108
+ throw error;
109
+ }
110
+ }
100
111
  main();
@@ -1,4 +1,4 @@
1
- import { Pool } from "pg";
1
+ import type { Pool } from "pg";
2
2
  import type { Redis } from "ioredis";
3
3
  import { Session, CliType } from "./session-manager.js";
4
4
  import { CacheTtl } from "./config.js";
@@ -24,8 +24,9 @@ export declare class PostgreSQLSessionManager {
24
24
  */
25
25
  private acquireLockWithRetry;
26
26
  /**
27
- * Release distributed lock using Lua script for atomic compare-and-delete
28
- * Only releases if lockValue matches (prevents releasing another process's lock)
27
+ * Release distributed lock with optimistic Redis transaction semantics.
28
+ * Only releases if lockValue matches, which prevents releasing another
29
+ * process's lock after expiry/reacquire.
29
30
  */
30
31
  private releaseLock;
31
32
  /**
@@ -52,20 +52,25 @@ export class PostgreSQLSessionManager {
52
52
  }
53
53
  }
54
54
  /**
55
- * Release distributed lock using Lua script for atomic compare-and-delete
56
- * Only releases if lockValue matches (prevents releasing another process's lock)
55
+ * Release distributed lock with optimistic Redis transaction semantics.
56
+ * Only releases if lockValue matches, which prevents releasing another
57
+ * process's lock after expiry/reacquire.
57
58
  */
58
59
  async releaseLock(key, lockValue) {
59
60
  const lockKey = `lock:${key}`;
60
- // Lua script for atomic compare-and-delete
61
- const script = `
62
- if redis.call("get", KEYS[1]) == ARGV[1] then
63
- return redis.call("del", KEYS[1])
64
- else
65
- return 0
66
- end
67
- `;
68
- await this.redis.eval(script, 1, lockKey, lockValue);
61
+ await this.redis.watch(lockKey);
62
+ try {
63
+ const currentValue = await this.redis.get(lockKey);
64
+ if (currentValue !== lockValue) {
65
+ await this.redis.unwatch();
66
+ return;
67
+ }
68
+ await this.redis.multi().del(lockKey).exec();
69
+ }
70
+ catch (error) {
71
+ await this.redis.unwatch().catch(() => undefined);
72
+ throw error;
73
+ }
69
74
  }
70
75
  /**
71
76
  * Invalidate session cache
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "llm-cli-gateway",
3
- "version": "1.5.13",
3
+ "version": "1.5.15",
4
4
  "mcpName": "io.github.verivus-oss/llm-cli-gateway",
5
5
  "description": "MCP server providing unified access to Claude Code, Codex, Gemini, Grok, and Mistral Vibe CLIs with session management, retry logic, async job orchestration, durable job results, and cross-LLM validation.",
6
6
  "license": "MIT",
7
- "author": {
8
- "name": "VerivusAI Labs",
9
- "url": "https://github.com/verivus-oss"
10
- },
7
+ "author": "VerivusAI Labs (https://github.com/verivus-oss)",
11
8
  "repository": {
12
9
  "type": "git",
13
10
  "url": "git+https://github.com/verivus-oss/llm-cli-gateway.git"
@@ -76,7 +73,8 @@
76
73
  "lint:fix": "eslint src/**/*.ts --fix",
77
74
  "format": "prettier --write 'src/**/*.ts'",
78
75
  "format:check": "prettier --check 'src/**/*.ts'",
79
- "check": "npm run build && npm run lint && npm test",
76
+ "security:audit": "bash scripts/release-security-audit.sh",
77
+ "check": "npm run build && npm run lint && npm test && npm run security:audit",
80
78
  "release:build": "bash installer/build-release.sh",
81
79
  "release:checksums": "cd installer/dist && sha256sum --check SHA256SUMS",
82
80
  "release:docker": "docker compose -f docker-compose.personal.yml build"
@@ -84,11 +82,23 @@
84
82
  "dependencies": {
85
83
  "@modelcontextprotocol/sdk": "^1.29.0",
86
84
  "better-sqlite3": "^12.10.0",
87
- "ioredis": "^5.4.1",
88
- "pg": "^8.12.0",
85
+ "content-type": "1.0.5",
89
86
  "toml": "^3.0.0",
87
+ "type-is": "2.0.1",
90
88
  "zod": "^3.23.0"
91
89
  },
90
+ "peerDependencies": {
91
+ "ioredis": "^5.4.1",
92
+ "pg": "^8.12.0"
93
+ },
94
+ "peerDependenciesMeta": {
95
+ "ioredis": {
96
+ "optional": true
97
+ },
98
+ "pg": {
99
+ "optional": true
100
+ }
101
+ },
92
102
  "devDependencies": {
93
103
  "@types/better-sqlite3": "^7.6.0",
94
104
  "@types/node": "^20.19.30",
@@ -98,6 +108,8 @@
98
108
  "@vitest/coverage-v8": "^4.1.2",
99
109
  "eslint": "^8.57.1",
100
110
  "eslint-config-prettier": "^9.0.0",
111
+ "ioredis": "^5.4.1",
112
+ "pg": "^8.12.0",
101
113
  "prettier": "^3.0.0",
102
114
  "typescript": "^5.0.0",
103
115
  "vitest": "^4.0.18"
@@ -105,5 +117,9 @@
105
117
  "overrides": {
106
118
  "type-is": "2.0.1",
107
119
  "content-type": "1.0.5"
108
- }
120
+ },
121
+ "directories": {
122
+ "doc": "docs"
123
+ },
124
+ "types": "./dist/index.d.ts"
109
125
  }