Sync upstream Gemini-CLI v0.8.2 (#838)

This commit is contained in:
tanzhenxin
2025-10-23 09:27:04 +08:00
committed by GitHub
parent 096fabb5d6
commit eb95c131be
644 changed files with 70389 additions and 23709 deletions

View File

@@ -63,8 +63,12 @@ const TomlCommandDefSchema = z.object({
*/
export class FileCommandLoader implements ICommandLoader {
private readonly projectRoot: string;
private readonly folderTrustEnabled: boolean;
private readonly folderTrust: boolean;
constructor(private readonly config: Config | null) {
this.folderTrustEnabled = !!config?.getFolderTrustFeature();
this.folderTrust = !!config?.getFolderTrust();
this.projectRoot = config?.getProjectRoot() || process.cwd();
}
@@ -97,6 +101,10 @@ export class FileCommandLoader implements ICommandLoader {
cwd: dirInfo.path,
});
if (this.folderTrustEnabled && !this.folderTrust) {
return [];
}
const commandPromises = files.map((file) =>
this.parseAndAdaptFile(
path.join(dirInfo.path, file),