llm-cli-gateway 1.4.0 → 1.5.13

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +135 -1
  2. package/README.md +358 -15
  3. package/dist/approval-manager.d.ts +1 -1
  4. package/dist/async-job-manager.d.ts +32 -2
  5. package/dist/async-job-manager.js +101 -16
  6. package/dist/auth.d.ts +15 -0
  7. package/dist/auth.js +46 -0
  8. package/dist/cli-updater.d.ts +19 -2
  9. package/dist/cli-updater.js +110 -7
  10. package/dist/codex-json-parser.d.ts +34 -0
  11. package/dist/codex-json-parser.js +105 -0
  12. package/dist/config.d.ts +30 -0
  13. package/dist/config.js +167 -0
  14. package/dist/doctor.d.ts +110 -0
  15. package/dist/doctor.js +280 -0
  16. package/dist/endpoint-exposure.d.ts +22 -0
  17. package/dist/endpoint-exposure.js +231 -0
  18. package/dist/entrypoint-url.d.ts +1 -0
  19. package/dist/entrypoint-url.js +5 -0
  20. package/dist/executor.d.ts +9 -1
  21. package/dist/executor.js +52 -17
  22. package/dist/flight-recorder.d.ts +3 -1
  23. package/dist/flight-recorder.js +31 -2
  24. package/dist/gateway-server.d.ts +2 -0
  25. package/dist/gateway-server.js +1 -0
  26. package/dist/gemini-json-parser.d.ts +21 -0
  27. package/dist/gemini-json-parser.js +47 -0
  28. package/dist/health.d.ts +7 -0
  29. package/dist/health.js +22 -0
  30. package/dist/http-transport.d.ts +22 -0
  31. package/dist/http-transport.js +164 -0
  32. package/dist/index.d.ts +186 -2
  33. package/dist/index.js +2761 -1454
  34. package/dist/job-store.d.ts +118 -2
  35. package/dist/job-store.js +176 -5
  36. package/dist/logger.d.ts +9 -0
  37. package/dist/logger.js +14 -0
  38. package/dist/model-registry.js +40 -6
  39. package/dist/provider-login-guidance.d.ts +21 -0
  40. package/dist/provider-login-guidance.js +98 -0
  41. package/dist/provider-status.d.ts +41 -0
  42. package/dist/provider-status.js +203 -0
  43. package/dist/request-helpers.d.ts +484 -4
  44. package/dist/request-helpers.js +613 -0
  45. package/dist/resources.js +44 -0
  46. package/dist/session-manager-pg.js +1 -0
  47. package/dist/session-manager.d.ts +1 -1
  48. package/dist/session-manager.js +2 -1
  49. package/dist/upstream-contracts.d.ts +62 -0
  50. package/dist/upstream-contracts.js +620 -0
  51. package/dist/validation-normalizer.d.ts +23 -0
  52. package/dist/validation-normalizer.js +79 -0
  53. package/dist/validation-orchestrator.d.ts +47 -0
  54. package/dist/validation-orchestrator.js +145 -0
  55. package/dist/validation-prompts.d.ts +15 -0
  56. package/dist/validation-prompts.js +52 -0
  57. package/dist/validation-report.d.ts +57 -0
  58. package/dist/validation-report.js +129 -0
  59. package/dist/validation-tools.d.ts +7 -0
  60. package/dist/validation-tools.js +198 -0
  61. package/package.json +25 -10
  62. package/setup/status.schema.json +271 -0
@@ -4,6 +4,7 @@ const DEFAULT_SESSION_DESCRIPTIONS = {
4
4
  codex: "Codex Session",
5
5
  gemini: "Gemini Session",
6
6
  grok: "Grok Session",
7
+ mistral: "Mistral Session",
7
8
  };
8
9
  /**
9
10
  * PostgreSQL-backed session manager with Redis caching
@@ -1,7 +1,7 @@
1
1
  import type { Config } from "./config.js";
2
2
  import type { DatabaseConnection } from "./db.js";
3
3
  import type { Logger } from "./logger.js";
4
- export declare const CLI_TYPES: readonly ["claude", "codex", "gemini", "grok"];
4
+ export declare const CLI_TYPES: readonly ["claude", "codex", "gemini", "grok", "mistral"];
5
5
  export type CliType = (typeof CLI_TYPES)[number];
6
6
  export interface Session {
7
7
  id: string;
@@ -4,13 +4,14 @@ import { join, dirname } from "path";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync, openSync, fsyncSync, closeSync, chmodSync, } from "fs";
5
5
  import { DEFAULT_SESSION_TTL_SECONDS } from "./config.js";
6
6
  import { noopLogger } from "./logger.js";
7
- export const CLI_TYPES = ["claude", "codex", "gemini", "grok"];
7
+ export const CLI_TYPES = ["claude", "codex", "gemini", "grok", "mistral"];
8
8
  const createEmptyActiveSessions = () => Object.fromEntries(CLI_TYPES.map(cli => [cli, null]));
9
9
  const DEFAULT_SESSION_DESCRIPTIONS = {
10
10
  claude: "Claude Session",
11
11
  codex: "Codex Session",
12
12
  gemini: "Gemini Session",
13
13
  grok: "Grok Session",
14
+ mistral: "Mistral Session",
14
15
  };
15
16
  export class FileSessionManager {
16
17
  storagePath;
@@ -0,0 +1,62 @@
1
+ import type { CliType } from "./session-manager.js";
2
+ export type CliFlagArity = "none" | "one" | "variadic";
3
+ export interface CliFlagContract {
4
+ arity: CliFlagArity;
5
+ values?: readonly string[];
6
+ pattern?: RegExp;
7
+ description: string;
8
+ }
9
+ export interface CliContract {
10
+ cli: CliType;
11
+ executable: string;
12
+ upstream: string;
13
+ helpArgs: string[][];
14
+ flags: Record<string, CliFlagContract>;
15
+ env?: Record<string, CliFlagContract>;
16
+ mcpTools: readonly string[];
17
+ mcpParameters: readonly string[];
18
+ conformanceFixtures: readonly CliContractFixture[];
19
+ command?: {
20
+ requiredFirstArg: string;
21
+ optionalSecondArg?: string;
22
+ };
23
+ maxPositionals: number;
24
+ resumeMaxPositionals?: number;
25
+ resumeOnlyFlags?: readonly string[];
26
+ resumeForbiddenFlags?: readonly string[];
27
+ }
28
+ export interface CliContractFixture {
29
+ id: string;
30
+ description: string;
31
+ args: readonly string[];
32
+ env?: Record<string, string>;
33
+ expect: "pass" | "fail";
34
+ }
35
+ export interface ContractViolation {
36
+ cli: CliType;
37
+ arg?: string;
38
+ index?: number;
39
+ message: string;
40
+ }
41
+ export interface ContractValidationResult {
42
+ ok: boolean;
43
+ violations: ContractViolation[];
44
+ }
45
+ export declare const UPSTREAM_CLI_CONTRACTS: Record<CliType, CliContract>;
46
+ export declare function validateUpstreamCliArgs(cli: CliType, args: readonly string[]): ContractValidationResult;
47
+ export declare function assertUpstreamCliArgs(cli: CliType, args: readonly string[]): void;
48
+ export declare function validateUpstreamCliEnv(cli: CliType, env: Record<string, string> | undefined): ContractValidationResult;
49
+ export declare function assertUpstreamCliEnv(cli: CliType, env: Record<string, string> | undefined): void;
50
+ export interface InstalledCliContractProbe {
51
+ cli: CliType;
52
+ executable: string;
53
+ available: boolean;
54
+ checkedHelpCommands: string[][];
55
+ missingFlags: string[];
56
+ warnings: string[];
57
+ }
58
+ export declare function probeInstalledCliContract(cli: CliType, timeoutMs?: number): InstalledCliContractProbe;
59
+ export declare function buildUpstreamContractReport(options?: {
60
+ cli?: CliType;
61
+ probeInstalled?: boolean;
62
+ }): Record<string, unknown>;