llm-cli-gateway 2.4.0 → 2.6.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/CHANGELOG.md +45 -0
- package/README.md +18 -18
- package/dist/async-job-manager.d.ts +2 -0
- package/dist/async-job-manager.js +43 -3
- package/dist/auth.d.ts +44 -1
- package/dist/auth.js +60 -13
- package/dist/cli-updater.js +22 -13
- package/dist/config.d.ts +2 -0
- package/dist/config.js +151 -0
- package/dist/doctor.d.ts +15 -0
- package/dist/doctor.js +22 -11
- package/dist/executor.d.ts +1 -0
- package/dist/executor.js +7 -0
- package/dist/http-transport.js +74 -12
- package/dist/index.d.ts +16 -1
- package/dist/index.js +643 -306
- package/dist/oauth.d.ts +38 -0
- package/dist/oauth.js +441 -0
- package/dist/provider-codegen.d.ts +27 -0
- package/dist/provider-codegen.js +335 -0
- package/dist/provider-login-guidance.js +9 -9
- package/dist/provider-status.js +5 -5
- package/dist/request-context.d.ts +7 -0
- package/dist/request-context.js +8 -0
- package/dist/request-helpers.js +2 -2
- package/dist/upstream-contracts.js +95 -116
- package/dist/workspace-registry.d.ts +63 -0
- package/dist/workspace-registry.js +417 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/setup/status.schema.json +42 -1
|
@@ -386,7 +386,42 @@ export const UPSTREAM_CLI_CONTRACTS = {
|
|
|
386
386
|
"--skip-git-repo-check",
|
|
387
387
|
"--strict-config",
|
|
388
388
|
"--version",
|
|
389
|
-
]
|
|
389
|
+
], {
|
|
390
|
+
children: {
|
|
391
|
+
resume: subcommand(["exec", "resume"], "Resume Codex sessions from the interactive CLI.", "executes_agent", [
|
|
392
|
+
"--add-dir",
|
|
393
|
+
"--all",
|
|
394
|
+
"--cd",
|
|
395
|
+
"--config",
|
|
396
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
397
|
+
"--dangerously-bypass-hook-trust",
|
|
398
|
+
"--disable",
|
|
399
|
+
"--enable",
|
|
400
|
+
"--image",
|
|
401
|
+
"--include-non-interactive",
|
|
402
|
+
"--last",
|
|
403
|
+
"--local-provider",
|
|
404
|
+
"--model",
|
|
405
|
+
"--no-alt-screen",
|
|
406
|
+
"--oss",
|
|
407
|
+
"--profile",
|
|
408
|
+
"--remote",
|
|
409
|
+
"--remote-auth-token-env",
|
|
410
|
+
"--sandbox",
|
|
411
|
+
"--strict-config",
|
|
412
|
+
]),
|
|
413
|
+
review: subcommand(["exec", "review"], "Run Codex code review workflows.", "executes_agent", [
|
|
414
|
+
"--base",
|
|
415
|
+
"--commit",
|
|
416
|
+
"--config",
|
|
417
|
+
"--disable",
|
|
418
|
+
"--enable",
|
|
419
|
+
"--strict-config",
|
|
420
|
+
"--title",
|
|
421
|
+
"--uncommitted",
|
|
422
|
+
]),
|
|
423
|
+
},
|
|
424
|
+
}),
|
|
390
425
|
review: subcommand(["review"], "Run Codex code review workflows.", "executes_agent", [
|
|
391
426
|
"--base",
|
|
392
427
|
"--commit",
|
|
@@ -457,31 +492,6 @@ export const UPSTREAM_CLI_CONTRACTS = {
|
|
|
457
492
|
], { exposure: "not_exposed" }),
|
|
458
493
|
debug: subcommand(["debug"], "Run Codex debugging utilities.", "read_only", ["--config", "--disable", "--enable"], { tier: "diagnostic" }),
|
|
459
494
|
apply: subcommand(["apply"], "Apply a Codex patch to the workspace.", "destructive", ["--config", "--disable", "--enable"], { exposure: "not_exposed" }),
|
|
460
|
-
resume: subcommand(["resume"], "Resume Codex sessions from the interactive CLI.", "executes_agent", [
|
|
461
|
-
"--add-dir",
|
|
462
|
-
"--all",
|
|
463
|
-
"--ask-for-approval",
|
|
464
|
-
"--cd",
|
|
465
|
-
"--config",
|
|
466
|
-
"--dangerously-bypass-approvals-and-sandbox",
|
|
467
|
-
"--dangerously-bypass-hook-trust",
|
|
468
|
-
"--disable",
|
|
469
|
-
"--enable",
|
|
470
|
-
"--image",
|
|
471
|
-
"--include-non-interactive",
|
|
472
|
-
"--last",
|
|
473
|
-
"--local-provider",
|
|
474
|
-
"--model",
|
|
475
|
-
"--no-alt-screen",
|
|
476
|
-
"--oss",
|
|
477
|
-
"--profile",
|
|
478
|
-
"--remote",
|
|
479
|
-
"--remote-auth-token-env",
|
|
480
|
-
"--sandbox",
|
|
481
|
-
"--search",
|
|
482
|
-
"--strict-config",
|
|
483
|
-
"--version",
|
|
484
|
-
]),
|
|
485
495
|
archive: subcommand(["archive"], "Archive Codex session state.", "writes_local_config", [
|
|
486
496
|
"--add-dir",
|
|
487
497
|
"--cd",
|
|
@@ -769,53 +779,37 @@ export const UPSTREAM_CLI_CONTRACTS = {
|
|
|
769
779
|
},
|
|
770
780
|
gemini: {
|
|
771
781
|
cli: "gemini",
|
|
772
|
-
executable: "
|
|
773
|
-
upstream: "Google
|
|
782
|
+
executable: "agy",
|
|
783
|
+
upstream: "Google Antigravity CLI",
|
|
774
784
|
upstreamMetadata: {
|
|
775
785
|
sourceUrls: [
|
|
776
|
-
"https://
|
|
777
|
-
"https://github.com/google-
|
|
786
|
+
"https://antigravity.google/docs/cli-overview",
|
|
787
|
+
"https://github.com/google-antigravity/antigravity-cli/releases",
|
|
778
788
|
],
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
watchCategories: ["flags", "approval-modes", "output-formats", "session-resume"],
|
|
789
|
+
repo: "https://github.com/google-antigravity/antigravity-cli",
|
|
790
|
+
installDocsUrl: "https://antigravity.google/docs/cli-getting-started",
|
|
791
|
+
releaseChannel: "vendor",
|
|
792
|
+
watchCategories: ["flags", "permissions", "session-resume", "subcommands"],
|
|
784
793
|
},
|
|
785
794
|
helpArgs: [["--help"]],
|
|
786
795
|
subcommands: {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
extensions: subcommand(["extensions"], "Manage Gemini extensions.", "writes_local_config", ["--debug"], {
|
|
791
|
-
aliases: ["extension"],
|
|
792
|
-
flagArities: { "--debug": "none" },
|
|
793
|
-
}),
|
|
794
|
-
extension: subcommand(["extension"], "Alias for Gemini extension management.", "writes_local_config", ["--debug"], {
|
|
795
|
-
aliases: ["extensions"],
|
|
796
|
-
flagArities: { "--debug": "none" },
|
|
797
|
-
}),
|
|
798
|
-
skills: subcommand(["skills"], "Manage Gemini skills.", "writes_local_config", ["--debug"], {
|
|
799
|
-
aliases: ["skill"],
|
|
800
|
-
flagArities: { "--debug": "none" },
|
|
796
|
+
changelog: subcommand(["changelog"], "Show Antigravity CLI changelog and release notes.", "read_only", [], { tokenCost: "small" }),
|
|
797
|
+
install: subcommand(["install"], "Configure Antigravity CLI environment paths and shell settings.", "writes_local_config", ["--dir", "--skip-aliases", "--skip-path"], {
|
|
798
|
+
flagArities: { "--dir": "one", "--skip-aliases": "none", "--skip-path": "none" },
|
|
801
799
|
}),
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
800
|
+
models: subcommand(["models"], "List available Antigravity models.", "read_only", [], {
|
|
801
|
+
exposure: "mcp_readonly",
|
|
802
|
+
tokenCost: "small",
|
|
805
803
|
}),
|
|
806
|
-
|
|
807
|
-
aliases: ["
|
|
808
|
-
flagArities: { "--debug": "none" },
|
|
809
|
-
}),
|
|
810
|
-
hook: subcommand(["hook"], "Alias for Gemini hook management.", "writes_local_config", ["--debug"], {
|
|
811
|
-
aliases: ["hooks"],
|
|
812
|
-
flagArities: { "--debug": "none" },
|
|
804
|
+
plugin: subcommand(["plugin"], "Manage Antigravity plugins.", "writes_local_config", [], {
|
|
805
|
+
aliases: ["plugins"],
|
|
813
806
|
}),
|
|
814
|
-
|
|
815
|
-
|
|
807
|
+
plugins: subcommand(["plugins"], "Alias for Antigravity plugin management.", "writes_local_config", [], {
|
|
808
|
+
aliases: ["plugin"],
|
|
816
809
|
}),
|
|
810
|
+
update: subcommand(["update"], "Update Antigravity CLI to the current release.", "writes_local_config", [], { tokenCost: "small" }),
|
|
817
811
|
},
|
|
818
|
-
maxPositionals:
|
|
812
|
+
maxPositionals: 1,
|
|
819
813
|
mcpTools: ["gemini_request", "gemini_request_async"],
|
|
820
814
|
mcpParameters: [
|
|
821
815
|
"prompt",
|
|
@@ -837,90 +831,63 @@ export const UPSTREAM_CLI_CONTRACTS = {
|
|
|
837
831
|
"yolo",
|
|
838
832
|
],
|
|
839
833
|
flags: {
|
|
840
|
-
"
|
|
834
|
+
"--print": { arity: "none", description: "Run a single prompt non-interactively" },
|
|
835
|
+
"-p": { arity: "none", description: "Short alias for --print" },
|
|
836
|
+
"--prompt": { arity: "none", description: "Alias for --print" },
|
|
841
837
|
"--model": { arity: "one", description: "Model selector" },
|
|
842
|
-
"--
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
description: "Approval mode",
|
|
846
|
-
},
|
|
847
|
-
"--allowed-tools": { arity: "one", description: "Allowed tool" },
|
|
848
|
-
"--allowed-mcp-server-names": { arity: "one", description: "Allowed MCP server" },
|
|
849
|
-
"--include-directories": { arity: "one", description: "Included directory" },
|
|
850
|
-
"-s": { arity: "none", description: "Sandbox mode" },
|
|
851
|
-
"--policy": { arity: "one", description: "Policy file path" },
|
|
852
|
-
"--admin-policy": { arity: "one", description: "Admin policy file path" },
|
|
853
|
-
"-o": {
|
|
854
|
-
arity: "one",
|
|
855
|
-
values: ["json", "stream-json"],
|
|
856
|
-
description: "Output format (Phase 4 slice ε adds stream-json)",
|
|
857
|
-
},
|
|
858
|
-
"--resume": { arity: "one", description: "Resume session" },
|
|
859
|
-
"--skip-trust": {
|
|
838
|
+
"--add-dir": { arity: "one", description: "Additional workspace directory" },
|
|
839
|
+
"--sandbox": { arity: "none", description: "Run with terminal sandbox restrictions" },
|
|
840
|
+
"--dangerously-skip-permissions": {
|
|
860
841
|
arity: "none",
|
|
861
|
-
description: "
|
|
862
|
-
},
|
|
863
|
-
"--yolo": {
|
|
864
|
-
arity: "none",
|
|
865
|
-
description: "Auto-approve all actions (gemini -y/--yolo). Functionally equivalent to --approval-mode yolo; the gateway emits at most one of the two.",
|
|
842
|
+
description: "Auto-approve all tool permission requests without prompting",
|
|
866
843
|
},
|
|
844
|
+
"--conversation": { arity: "one", description: "Resume a previous conversation by ID" },
|
|
845
|
+
"--continue": { arity: "none", description: "Continue the most recent conversation" },
|
|
846
|
+
"-c": { arity: "none", description: "Short alias for --continue" },
|
|
867
847
|
},
|
|
868
848
|
acknowledgedUpstreamFlags: [
|
|
869
|
-
"--accept-raw-output-risk",
|
|
870
|
-
"--acp",
|
|
871
|
-
"--debug",
|
|
872
|
-
"--delete-session",
|
|
873
|
-
"--experimental-acp",
|
|
874
|
-
"--extensions",
|
|
875
|
-
"--list-extensions",
|
|
876
|
-
"--list-sessions",
|
|
877
|
-
"--output-format",
|
|
878
|
-
"--prompt",
|
|
879
849
|
"--prompt-interactive",
|
|
880
|
-
"
|
|
881
|
-
"--
|
|
882
|
-
"--
|
|
883
|
-
"--session-file",
|
|
884
|
-
"--session-id",
|
|
850
|
+
"-i",
|
|
851
|
+
"--print-timeout",
|
|
852
|
+
"--log-file",
|
|
885
853
|
"--version",
|
|
886
|
-
"--worktree",
|
|
887
854
|
],
|
|
888
855
|
env: {},
|
|
889
856
|
conformanceFixtures: [
|
|
890
857
|
{
|
|
891
858
|
id: "gemini-minimal",
|
|
892
|
-
description: "Minimal prompt request",
|
|
893
|
-
args: ["
|
|
859
|
+
description: "Minimal Antigravity print-mode prompt request",
|
|
860
|
+
args: ["--print", "hello"],
|
|
894
861
|
expect: "pass",
|
|
895
862
|
},
|
|
896
863
|
{
|
|
897
864
|
id: "gemini-unsupported-flag",
|
|
898
865
|
description: "Unsupported flag is rejected before spawn",
|
|
899
|
-
args: ["
|
|
866
|
+
args: ["--print", "hello", "--not-a-gemini-flag"],
|
|
900
867
|
expect: "fail",
|
|
901
868
|
},
|
|
902
869
|
{
|
|
903
|
-
id: "gemini-
|
|
904
|
-
description: "
|
|
905
|
-
args: ["
|
|
870
|
+
id: "gemini-antigravity-workspace-flags",
|
|
871
|
+
description: "Antigravity workspace and sandbox flags are accepted",
|
|
872
|
+
args: ["--print", "hello", "--add-dir", "/tmp", "--sandbox"],
|
|
906
873
|
expect: "pass",
|
|
907
874
|
},
|
|
908
875
|
{
|
|
909
876
|
id: "gemini-yolo",
|
|
910
|
-
description: "
|
|
911
|
-
args: ["
|
|
877
|
+
description: "Antigravity permission bypass is accepted",
|
|
878
|
+
args: ["--print", "hello", "--dangerously-skip-permissions"],
|
|
912
879
|
expect: "pass",
|
|
913
880
|
},
|
|
914
881
|
{
|
|
915
|
-
id: "gemini-
|
|
916
|
-
description: "
|
|
917
|
-
args: ["
|
|
882
|
+
id: "gemini-conversation",
|
|
883
|
+
description: "Antigravity conversation resume is accepted",
|
|
884
|
+
args: ["--print", "hello", "--conversation", "user-session"],
|
|
918
885
|
expect: "pass",
|
|
919
886
|
},
|
|
920
887
|
{
|
|
921
|
-
id: "gemini-output-format-
|
|
922
|
-
description: "
|
|
923
|
-
args: ["
|
|
888
|
+
id: "gemini-legacy-output-format-rejected",
|
|
889
|
+
description: "Legacy Gemini JSON output flag is rejected",
|
|
890
|
+
args: ["--print", "hello", "-o", "json"],
|
|
924
891
|
expect: "fail",
|
|
925
892
|
},
|
|
926
893
|
],
|
|
@@ -1253,12 +1220,18 @@ export const UPSTREAM_CLI_CONTRACTS = {
|
|
|
1253
1220
|
"--prompt-json",
|
|
1254
1221
|
"[]",
|
|
1255
1222
|
"--restore-code",
|
|
1223
|
+
"--leader-socket",
|
|
1224
|
+
"/tmp/leader.sock",
|
|
1256
1225
|
"--single",
|
|
1257
1226
|
"single prompt",
|
|
1258
1227
|
"--todo-gate",
|
|
1259
1228
|
"--verbatim",
|
|
1260
1229
|
"--version",
|
|
1261
1230
|
"--worktree",
|
|
1231
|
+
"--compaction-mode",
|
|
1232
|
+
"summary",
|
|
1233
|
+
"--compaction-detail",
|
|
1234
|
+
"balanced",
|
|
1262
1235
|
],
|
|
1263
1236
|
expect: "pass",
|
|
1264
1237
|
},
|
|
@@ -1309,6 +1282,12 @@ export const UPSTREAM_CLI_CONTRACTS = {
|
|
|
1309
1282
|
args: ["-p", "hello", "--leader-socket"],
|
|
1310
1283
|
expect: "fail",
|
|
1311
1284
|
},
|
|
1285
|
+
{
|
|
1286
|
+
id: "grok-0.2.38-agent-surface",
|
|
1287
|
+
description: "Grok 0.2.38: top-level --agent + --leader-socket co-occurrence accepted (dated example using flags current at 0.2.38; the agent subcommand expansion flags e.g. --agent-profile/--reauth/--grok-ws-* are listed in the subcommand contract declaration for --probe-installed drift tracking and are not part of this primary-path fixture's argv)",
|
|
1288
|
+
args: ["-p", "hello", "--agent", "reviewer", "--leader-socket", "/tmp/leader.sock"],
|
|
1289
|
+
expect: "pass",
|
|
1290
|
+
},
|
|
1312
1291
|
],
|
|
1313
1292
|
},
|
|
1314
1293
|
mistral: {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type CliType } from "./session-manager.js";
|
|
2
|
+
import type { Logger } from "./logger.js";
|
|
3
|
+
export interface WorkspaceRepo {
|
|
4
|
+
alias: string;
|
|
5
|
+
path: string;
|
|
6
|
+
providers: CliType[];
|
|
7
|
+
allowWorktree: boolean;
|
|
8
|
+
allowAddDir: boolean;
|
|
9
|
+
kind: "git" | "folder";
|
|
10
|
+
operatorEntry: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkspaceAllowedRoot {
|
|
13
|
+
alias: string;
|
|
14
|
+
path: string;
|
|
15
|
+
allowRegisterExistingGitRepos: boolean;
|
|
16
|
+
allowCreateDirectories: boolean;
|
|
17
|
+
allowInitGitRepos: boolean;
|
|
18
|
+
maxCreateDepth: number;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkspaceRegistry {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
defaultAlias: string | null;
|
|
23
|
+
allowUnregisteredWorkingDir: boolean;
|
|
24
|
+
repos: WorkspaceRepo[];
|
|
25
|
+
allowedRoots: WorkspaceAllowedRoot[];
|
|
26
|
+
sources: {
|
|
27
|
+
configFile: string | null;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface EffectiveWorkspace {
|
|
31
|
+
alias: string;
|
|
32
|
+
root: string;
|
|
33
|
+
cwd: string;
|
|
34
|
+
worktreePath?: string;
|
|
35
|
+
repo: WorkspaceRepo;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateWorkspaceInput {
|
|
38
|
+
alias: string;
|
|
39
|
+
rootAlias: string;
|
|
40
|
+
slug: string;
|
|
41
|
+
kind: "folder" | "git";
|
|
42
|
+
setDefault?: boolean;
|
|
43
|
+
configPath?: string;
|
|
44
|
+
logger?: Logger;
|
|
45
|
+
}
|
|
46
|
+
export declare class WorkspaceRegistryError extends Error {
|
|
47
|
+
constructor(message: string);
|
|
48
|
+
}
|
|
49
|
+
export declare function validateWorkspaceAlias(alias: string): string;
|
|
50
|
+
export declare function loadWorkspaceRegistry(logger?: Logger, configPath?: string): WorkspaceRegistry;
|
|
51
|
+
export declare function getWorkspace(registry: WorkspaceRegistry, alias: string): WorkspaceRepo;
|
|
52
|
+
export declare function resolveWorkspaceForProvider(registry: WorkspaceRegistry, provider: CliType, requestedAlias?: string, sessionMetadata?: Record<string, unknown>): EffectiveWorkspace;
|
|
53
|
+
export declare function validatePathInsideWorkspace(workspace: EffectiveWorkspace, candidate: string, policy: "workingDir" | "addDir"): string;
|
|
54
|
+
export declare function createWorkspace(input: CreateWorkspaceInput): WorkspaceRepo;
|
|
55
|
+
export declare function registerExistingWorkspace(input: {
|
|
56
|
+
alias: string;
|
|
57
|
+
repoPath: string;
|
|
58
|
+
setDefault?: boolean;
|
|
59
|
+
configPath?: string;
|
|
60
|
+
logger?: Logger;
|
|
61
|
+
}): WorkspaceRepo;
|
|
62
|
+
export declare function createTempWorkspaceConfig(contents: string): string;
|
|
63
|
+
export declare function describeWorkspace(repo: WorkspaceRepo): Record<string, unknown>;
|