llm-cli-gateway 2.6.0 → 2.7.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.
package/dist/resources.js CHANGED
@@ -2,6 +2,7 @@ import { CLI_TYPES, PROVIDER_TYPES } from "./session-manager.js";
2
2
  import { getAvailableCliInfo } from "./model-registry.js";
3
3
  import { computeGlobalCacheStats, computePrefixCacheStats, computeSessionCacheStats, computeTtlRemaining, } from "./cache-stats.js";
4
4
  import { buildProviderSubcommandsCompactCatalog, getCliSubcommandContract, serializeCliSubcommandContract, } from "./upstream-contracts.js";
5
+ import { getOneProviderToolCapabilities, getProviderToolCapabilities, providerCapabilityIds, } from "./provider-tool-capabilities.js";
5
6
  export class ResourceProvider {
6
7
  sessionManager;
7
8
  performanceMetrics;
@@ -176,6 +177,28 @@ export class ResourceProvider {
176
177
  priority: 0.7,
177
178
  },
178
179
  },
180
+ {
181
+ uri: "provider-tools://catalog",
182
+ name: "Provider Tool Capabilities Catalog",
183
+ title: "Provider Tool Capabilities Catalog",
184
+ description: "Read-only catalog of gateway tool controls and discovered provider skills",
185
+ mimeType: "application/json",
186
+ annotations: {
187
+ audience: ["user", "assistant"],
188
+ priority: 0.8,
189
+ },
190
+ },
191
+ ...providerCapabilityIds().map(cli => ({
192
+ uri: `provider-tools://${cli}`,
193
+ name: `${cli} Tool Capabilities`,
194
+ title: `${cli} Tool Capabilities`,
195
+ description: `Gateway tool controls and discovered local skills for ${cli}`,
196
+ mimeType: "application/json",
197
+ annotations: {
198
+ audience: ["user", "assistant"],
199
+ priority: 0.8,
200
+ },
201
+ })),
179
202
  ];
180
203
  }
181
204
  async readResource(uri) {
@@ -320,6 +343,21 @@ export class ResourceProvider {
320
343
  text: JSON.stringify(buildProviderSubcommandsCompactCatalog()),
321
344
  };
322
345
  }
346
+ if (uri === "provider-tools://catalog" || uri === "provider_tools://catalog") {
347
+ return {
348
+ uri,
349
+ mimeType: "application/json",
350
+ text: JSON.stringify(getProviderToolCapabilities(), null, 2),
351
+ };
352
+ }
353
+ const providerToolsResource = parseProviderToolsUri(uri);
354
+ if (providerToolsResource) {
355
+ return {
356
+ uri,
357
+ mimeType: "application/json",
358
+ text: JSON.stringify(getOneProviderToolCapabilities(providerToolsResource.provider), null, 2),
359
+ };
360
+ }
323
361
  const subcommandResource = parseProviderSubcommandUri(uri);
324
362
  if (subcommandResource) {
325
363
  const contract = getCliSubcommandContract(subcommandResource.provider, subcommandResource.commandPath);
@@ -354,3 +392,16 @@ function parseProviderSubcommandUri(uri) {
354
392
  commandPath: pathParts.map(part => decodeURIComponent(part)).filter(Boolean),
355
393
  };
356
394
  }
395
+ function parseProviderToolsUri(uri) {
396
+ const prefix = uri.startsWith("provider-tools://")
397
+ ? "provider-tools://"
398
+ : uri.startsWith("provider_tools://")
399
+ ? "provider_tools://"
400
+ : null;
401
+ if (!prefix || uri === `${prefix}catalog`)
402
+ return null;
403
+ const provider = uri.slice(prefix.length);
404
+ if (!providerCapabilityIds().includes(provider))
405
+ return null;
406
+ return { provider: provider };
407
+ }
@@ -36,8 +36,20 @@ function subcommand(commandPath, summary, risk, flags = [], options = {}) {
36
36
  tokenCost: options.tokenCost ?? "small",
37
37
  summary,
38
38
  conformanceFixtures: options.fixtures ?? [],
39
+ acknowledgedUpstreamFlags: options.acknowledgedUpstreamFlags ?? [],
39
40
  };
40
41
  }
42
+ function acknowledgeSubcommandFlags(subcommands, flags) {
43
+ return Object.fromEntries(Object.entries(subcommands).map(([name, contract]) => [
44
+ name,
45
+ {
46
+ ...contract,
47
+ acknowledgedUpstreamFlags: Array.from(new Set([...(contract.acknowledgedUpstreamFlags ?? []), ...flags])),
48
+ children: acknowledgeSubcommandFlags(contract.children ?? {}, flags),
49
+ },
50
+ ]));
51
+ }
52
+ const GROK_DEBUG_HELP_FLAGS = ["--debug", "--debug-file"];
41
53
  export const UPSTREAM_CLI_CONTRACTS = {
42
54
  claude: {
43
55
  cli: "claude",
@@ -903,7 +915,7 @@ export const UPSTREAM_CLI_CONTRACTS = {
903
915
  watchCategories: ["flags", "permission-modes", "session-resume", "sandbox", "output-formats"],
904
916
  },
905
917
  helpArgs: [["--help"]],
906
- subcommands: {
918
+ subcommands: acknowledgeSubcommandFlags({
907
919
  agent: subcommand(["agent"], "Run Grok agent service helpers.", "executes_agent", [
908
920
  "--agent-profile",
909
921
  "--always-approve",
@@ -935,6 +947,7 @@ export const UPSTREAM_CLI_CONTRACTS = {
935
947
  "--leader-socket",
936
948
  "--no-auto-update",
937
949
  "--no-exit-on-disconnect",
950
+ "--relay-on-demand",
938
951
  ], { exposure: "not_exposed" }),
939
952
  },
940
953
  }),
@@ -981,11 +994,10 @@ export const UPSTREAM_CLI_CONTRACTS = {
981
994
  "--version",
982
995
  ], { exposure: "not_exposed" }),
983
996
  version: subcommand(["version"], "Print Grok version information.", "read_only", ["--json", "--leader-socket"], { tier: "diagnostic" }),
984
- worktree: subcommand(["worktree"], "Manage Grok worktree sessions.", "writes_local_config", [
985
- "--leader-socket",
986
- ]),
987
- },
997
+ worktree: subcommand(["worktree"], "Manage Grok worktree sessions.", "writes_local_config", ["--leader-socket"]),
998
+ }, GROK_DEBUG_HELP_FLAGS),
988
999
  maxPositionals: 0,
1000
+ acknowledgedUpstreamFlags: GROK_DEBUG_HELP_FLAGS,
989
1001
  mcpTools: ["grok_request", "grok_request_async"],
990
1002
  mcpParameters: [
991
1003
  "prompt",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "llm-cli-gateway",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "llm-cli-gateway",
9
- "version": "2.6.0",
9
+ "version": "2.7.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/sdk": "^1.29.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-cli-gateway",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
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",
@@ -16,6 +16,7 @@
16
16
  "endpoint_exposure",
17
17
  "client_config",
18
18
  "cache_awareness",
19
+ "provider_capabilities",
19
20
  "upstream",
20
21
  "next_actions"
21
22
  ],
@@ -289,12 +290,7 @@
289
290
  },
290
291
  "vibe_session_logging": {
291
292
  "type": "object",
292
- "required": [
293
- "config_path",
294
- "config_present",
295
- "session_logging_enabled",
296
- "note"
297
- ],
293
+ "required": ["config_path", "config_present", "session_logging_enabled", "note"],
298
294
  "properties": {
299
295
  "config_path": { "type": "string" },
300
296
  "config_present": { "type": "boolean" },
@@ -344,6 +340,71 @@
344
340
  },
345
341
  "additionalProperties": false
346
342
  },
343
+ "provider_capabilities": {
344
+ "type": "object",
345
+ "required": ["schema_version", "tool", "resources", "cache_ttl_ms", "providers"],
346
+ "properties": {
347
+ "schema_version": { "const": "provider-tool-capabilities.v2" },
348
+ "tool": { "const": "provider_tool_capabilities" },
349
+ "resources": {
350
+ "type": "object",
351
+ "required": ["catalog", "providers"],
352
+ "properties": {
353
+ "catalog": { "const": "provider-tools://catalog" },
354
+ "providers": {
355
+ "type": "object",
356
+ "required": ["claude", "codex", "gemini", "grok", "grok_api", "mistral"],
357
+ "additionalProperties": { "type": "string" }
358
+ }
359
+ },
360
+ "additionalProperties": false
361
+ },
362
+ "cache_ttl_ms": { "type": "integer", "minimum": 0 },
363
+ "providers": {
364
+ "type": "object",
365
+ "required": ["claude", "codex", "gemini", "grok", "grok_api", "mistral"],
366
+ "additionalProperties": {
367
+ "type": "object",
368
+ "required": [
369
+ "provider_kind",
370
+ "cli_available",
371
+ "gateway_request_tools",
372
+ "supported_features",
373
+ "unsupported_inputs",
374
+ "config_surface_count",
375
+ "discovered_skill_count",
376
+ "discovered_provider_tool_count",
377
+ "warnings"
378
+ ],
379
+ "properties": {
380
+ "provider_kind": { "enum": ["cli", "api"] },
381
+ "cli_available": { "type": "boolean" },
382
+ "gateway_request_tools": {
383
+ "type": "array",
384
+ "items": { "type": "string" }
385
+ },
386
+ "supported_features": {
387
+ "type": "array",
388
+ "items": { "type": "string" }
389
+ },
390
+ "unsupported_inputs": {
391
+ "type": "array",
392
+ "items": { "type": "string" }
393
+ },
394
+ "config_surface_count": { "type": "integer", "minimum": 0 },
395
+ "discovered_skill_count": { "type": "integer", "minimum": 0 },
396
+ "discovered_provider_tool_count": { "type": "integer", "minimum": 0 },
397
+ "warnings": {
398
+ "type": "array",
399
+ "items": { "type": "string" }
400
+ }
401
+ },
402
+ "additionalProperties": false
403
+ }
404
+ }
405
+ },
406
+ "additionalProperties": false
407
+ },
347
408
  "upstream": {
348
409
  "type": "object",
349
410
  "required": [
package/socket.yml CHANGED
@@ -35,6 +35,28 @@ version: 2
35
35
  # release security audit now hard-fails if any of those packages re-enter
36
36
  # the prod graph (and still blocks the flagged tar-stream 2.x versions).
37
37
  #
38
+ # shrinkwrap
39
+ # The published npm package intentionally includes npm-shrinkwrap.json. It
40
+ # is not an install-script bypass or a hidden dependency surface; it is a
41
+ # prod-only projection generated from package-lock.json by
42
+ # scripts/make-prod-shrinkwrap.mjs so registry consumers resolve the same
43
+ # audited tree we release. scripts/release-security-audit.sh regenerates
44
+ # that projection and hard-fails on mismatch, and
45
+ # scripts/verify-registry-install.sh publishes to a temporary registry and
46
+ # verifies a fresh consumer install has no better-sqlite3, prebuild-install,
47
+ # tar-fs, or tar-stream production chain.
48
+ #
49
+ # This is the npm-documented narrow use case for shrinkwrap: applications,
50
+ # daemons, and command-line tools published through the registry for global
51
+ # installs or devDependency use. llm-cli-gateway is a CLI/MCP appliance, not
52
+ # a library whose users need unpinned transitive dependency control.
53
+ #
54
+ # Historical note: releases that previously reported healthy public Socket
55
+ # scores, including 2.3.0, 2.4.0, and 2.5.0, also shipped
56
+ # npm-shrinkwrap.json. The same socket.yml shellAccess policy was present
57
+ # there too. A public package-page alert on 2.6.x therefore reflects Socket
58
+ # scoring/rescan behavior, not a newly introduced shrinkwrap or shell path.
59
+ #
38
60
  # shellAccess
39
61
  # This alert fires on every module that imports node:child_process, and
40
62
  # because spawning provider CLIs and git is the entire purpose of the package
@@ -93,8 +115,9 @@ issueRules:
93
115
  didYouMean: true
94
116
  installScripts: true
95
117
  telemetry: true
96
- hasNativeCode: true # devDependency-only as of 2.0.0 (better-sqlite3); prod artifact has no native code
97
- shellAccess: false # reviewed gateway capability; see rationale above
118
+ hasNativeCode: true # devDependency-only as of 2.0.0 (better-sqlite3); prod artifact has no native code
119
+ shrinkwrap: false # reviewed published CLI lockfile; see rationale above
120
+ shellAccess: false # reviewed gateway capability; see rationale above
98
121
  shellScriptOverride: true
99
122
  gitDependency: true
100
123
  httpDependency: true