@google/gemini-cli-core 0.70.0 → 0.71.0-nightly.20261121.geecccfcd5
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/docs/changelogs/index.md +46 -0
- package/dist/docs/changelogs/latest.md +82 -100
- package/dist/docs/changelogs/preview.md +82 -115
- package/dist/google-gemini-cli-core-0.71.0-nightly.20261118.g615d6bc8c.tgz +0 -0
- package/dist/src/confirmation-bus/types.d.ts +1 -0
- package/dist/src/confirmation-bus/types.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/policy/policy-engine.d.ts +1 -0
- package/dist/src/policy/policy-engine.js +15 -6
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/sandbox/utils/commandUtils.js +35 -25
- package/dist/src/sandbox/utils/commandUtils.js.map +1 -1
- package/dist/src/sandbox/windows/WindowsSandboxManager.d.ts +1 -0
- package/dist/src/sandbox/windows/WindowsSandboxManager.js +9 -2
- package/dist/src/sandbox/windows/WindowsSandboxManager.js.map +1 -1
- package/dist/src/sandbox/windows/commandSafety.js +4 -2
- package/dist/src/sandbox/windows/commandSafety.js.map +1 -1
- package/dist/src/scheduler/policy.js +6 -0
- package/dist/src/scheduler/policy.js.map +1 -1
- package/dist/src/scheduler/scheduler.js +79 -59
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.test.js +15 -0
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
- package/dist/src/tools/shell-powershell-parsing.integration.test.d.ts +6 -0
- package/dist/src/tools/shell-powershell-parsing.integration.test.js +576 -0
- package/dist/src/tools/shell-powershell-parsing.integration.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +6 -1
- package/dist/src/tools/shell.js +281 -189
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/tools.d.ts +1 -0
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.js +33 -1
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.test.js +32 -0
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/ignorePathUtils.d.ts +1 -1
- package/dist/src/utils/ignorePathUtils.js +3 -2
- package/dist/src/utils/ignorePathUtils.js.map +1 -1
- package/dist/src/utils/ignorePathUtils.test.js +8 -0
- package/dist/src/utils/ignorePathUtils.test.js.map +1 -1
- package/dist/src/utils/shell-parse-cache.d.ts +37 -0
- package/dist/src/utils/shell-parse-cache.js +55 -0
- package/dist/src/utils/shell-parse-cache.js.map +1 -0
- package/dist/src/utils/shell-parse-cache.test.d.ts +6 -0
- package/dist/src/utils/shell-parse-cache.test.js +478 -0
- package/dist/src/utils/shell-parse-cache.test.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +27 -29
- package/dist/src/utils/shell-utils.js +385 -89
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/untrustedContextTracker.d.ts +2 -6
- package/dist/src/utils/untrustedContextTracker.js +65 -27
- package/dist/src/utils/untrustedContextTracker.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type ParseEntry } from 'shell-quote';
|
|
7
7
|
import { type SpawnOptionsWithoutStdio } from 'node:child_process';
|
|
8
|
+
import { CommandParseCache, getActiveCommandParseCache, runWithCommandParseCache, type CommandParseResult, type ParsedCommandDetail } from './shell-parse-cache.js';
|
|
9
|
+
export { CommandParseCache, getActiveCommandParseCache, runWithCommandParseCache, type CommandParseResult, type ParsedCommandDetail, };
|
|
8
10
|
/**
|
|
9
11
|
* Extracts the primary command name from a potentially wrapped shell command.
|
|
10
12
|
* Strips shell wrappers and handles shopt/set/etc.
|
|
@@ -44,18 +46,6 @@ export interface ShellConfiguration {
|
|
|
44
46
|
}
|
|
45
47
|
export declare function resolveExecutable(exe: string): string | undefined;
|
|
46
48
|
export declare function initializeShellParsers(): Promise<void>;
|
|
47
|
-
export interface ParsedCommandDetail {
|
|
48
|
-
name: string;
|
|
49
|
-
text: string;
|
|
50
|
-
startIndex: number;
|
|
51
|
-
args?: string[];
|
|
52
|
-
}
|
|
53
|
-
interface CommandParseResult {
|
|
54
|
-
details: ParsedCommandDetail[];
|
|
55
|
-
hasError: boolean;
|
|
56
|
-
hasRedirection?: boolean;
|
|
57
|
-
hasCommandSubstitution?: boolean;
|
|
58
|
-
}
|
|
59
49
|
export declare const REDIRECTION_NAMES: Set<string>;
|
|
60
50
|
/**
|
|
61
51
|
* Normalizes a command name for sandbox policy lookups.
|
|
@@ -66,7 +56,9 @@ export declare const REDIRECTION_NAMES: Set<string>;
|
|
|
66
56
|
*/
|
|
67
57
|
export declare function normalizeCommand(commandName: string): string;
|
|
68
58
|
export declare function parseBashCommandDetails(command: string): CommandParseResult | null;
|
|
69
|
-
export declare function parseCommandDetails(command: string): CommandParseResult | null;
|
|
59
|
+
export declare function parseCommandDetails(command: string, cache?: CommandParseCache): CommandParseResult | null;
|
|
60
|
+
export declare function parseCommandDetailsAsync(command: string, cache?: CommandParseCache, signal?: AbortSignal): Promise<CommandParseResult | null>;
|
|
61
|
+
export declare function isDefaultParseCommandDetails(fn: unknown): boolean;
|
|
70
62
|
/**
|
|
71
63
|
* Determines the appropriate shell configuration for the current platform.
|
|
72
64
|
*
|
|
@@ -97,17 +89,8 @@ export declare const isWindows: () => boolean;
|
|
|
97
89
|
* @returns The shell-escaped string.
|
|
98
90
|
*/
|
|
99
91
|
export declare function escapeShellArg(arg: string, shell: ShellType): string;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
* This is used to separate chained commands (e.g., using &&, ||, ;).
|
|
103
|
-
* @param command The shell command string to parse
|
|
104
|
-
* @returns An array of individual command strings
|
|
105
|
-
*/
|
|
106
|
-
/**
|
|
107
|
-
* Checks if a command contains redirection operators.
|
|
108
|
-
* Uses shell-specific parsers where possible, falling back to a broad regex check.
|
|
109
|
-
*/
|
|
110
|
-
export declare function hasRedirection(command: string): boolean;
|
|
92
|
+
export declare function hasRedirection(command: string, cache?: CommandParseCache): boolean;
|
|
93
|
+
export declare function hasRedirectionAsync(command: string, cache?: CommandParseCache, signal?: AbortSignal): Promise<boolean>;
|
|
111
94
|
/**
|
|
112
95
|
* Checks whether bash would rewrite the arguments of a command before running
|
|
113
96
|
* it, so the unexpanded text doesn't describe what runs. This covers brace
|
|
@@ -121,7 +104,8 @@ export declare function hasRedirection(command: string): boolean;
|
|
|
121
104
|
* bash.
|
|
122
105
|
*/
|
|
123
106
|
export declare function hasUnresolvedShellExpansion(command: string): boolean;
|
|
124
|
-
export declare function splitCommands(command: string): string[];
|
|
107
|
+
export declare function splitCommands(command: string, cache?: CommandParseCache): string[];
|
|
108
|
+
export declare function splitCommandsAsync(command: string, cache?: CommandParseCache, signal?: AbortSignal): Promise<string[]>;
|
|
125
109
|
/**
|
|
126
110
|
* Extracts the root command from a given shell command string.
|
|
127
111
|
* This is used to identify the base command for permission checks.
|
|
@@ -130,8 +114,13 @@ export declare function splitCommands(command: string): string[];
|
|
|
130
114
|
* @example getCommandRoot("ls -la /tmp") returns "ls"
|
|
131
115
|
* @example getCommandRoot("git status && npm test") returns "git"
|
|
132
116
|
*/
|
|
133
|
-
export declare function getCommandRoot(command: string): string | undefined;
|
|
134
|
-
export declare function
|
|
117
|
+
export declare function getCommandRoot(command: string, cache?: CommandParseCache): string | undefined;
|
|
118
|
+
export declare function getCommandRootAsync(command: string, cache?: CommandParseCache, signal?: AbortSignal): Promise<string | undefined>;
|
|
119
|
+
export declare function getCommandRoots(command: string, cache?: CommandParseCache): string[];
|
|
120
|
+
export declare function getCommandRootsAsync(command: string, cache?: CommandParseCache, signal?: AbortSignal): Promise<string[]>;
|
|
121
|
+
export declare function isDefaultHasRedirection(fn: unknown): boolean;
|
|
122
|
+
export declare function isDefaultSplitCommands(fn: unknown): boolean;
|
|
123
|
+
export declare function isDefaultGetCommandRoots(fn: unknown): boolean;
|
|
135
124
|
export declare function stripShellWrapper(command: string): string;
|
|
136
125
|
/**
|
|
137
126
|
* Detects command substitution patterns in a shell command, following bash quoting rules:
|
|
@@ -172,10 +161,19 @@ export declare function execStreaming(command: string, args: string[], options?:
|
|
|
172
161
|
sandboxManager?: SandboxManager;
|
|
173
162
|
}): AsyncGenerator<string, void, void>;
|
|
174
163
|
export declare function detectCommandSubstitution(command: string): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Performs purely in-process checks for interactive `gemini` commands without
|
|
166
|
+
* spawning any external shell parser. Returns `false` when the command cannot
|
|
167
|
+
* invoke `gemini`, `true` when synchronous segment tokenization already detects
|
|
168
|
+
* an interactive `gemini` invocation, or `undefined` when AST command splitting
|
|
169
|
+
* is still required to disambiguate.
|
|
170
|
+
*/
|
|
171
|
+
export declare function isKnownInteractiveGeminiCommandSync(command: string): boolean | undefined;
|
|
175
172
|
/**
|
|
176
173
|
* Checks whether a shell command string attempts to invoke an interactive
|
|
177
174
|
* `gemini` CLI session or an invalid management subcommand such as
|
|
178
175
|
* `gemini config ...`.
|
|
179
176
|
*/
|
|
180
|
-
export declare function isInteractiveGeminiCommand(command: string): boolean;
|
|
181
|
-
export
|
|
177
|
+
export declare function isInteractiveGeminiCommand(command: string, cache?: CommandParseCache): boolean;
|
|
178
|
+
export declare function isInteractiveGeminiCommandAsync(command: string, cache?: CommandParseCache, signal?: AbortSignal): Promise<boolean>;
|
|
179
|
+
export declare function isDefaultIsInteractiveGeminiCommand(fn: unknown): boolean;
|