mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 19:14:33 -07:00
Refactor PolicyEngine to Core Package (#12325)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -78,11 +78,7 @@ import { AgentRegistry } from '../agents/registry.js';
|
||||
import { setGlobalProxy } from '../utils/fetch.js';
|
||||
import { SubagentToolWrapper } from '../agents/subagent-tool-wrapper.js';
|
||||
|
||||
export enum ApprovalMode {
|
||||
DEFAULT = 'default',
|
||||
AUTO_EDIT = 'autoEdit',
|
||||
YOLO = 'yolo',
|
||||
}
|
||||
import { ApprovalMode } from '../policy/types.js';
|
||||
|
||||
export interface AccessibilitySettings {
|
||||
disableLoadingPhrases?: boolean;
|
||||
@@ -152,7 +148,7 @@ import {
|
||||
DEFAULT_FILE_FILTERING_OPTIONS,
|
||||
DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,
|
||||
} from './constants.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
import {
|
||||
type ExtensionLoader,
|
||||
SimpleExtensionLoader,
|
||||
@@ -1243,19 +1239,11 @@ export class Config {
|
||||
// This first implementation is only focused on the general case of
|
||||
// the tool registry.
|
||||
const messageBusEnabled = this.getEnableMessageBusIntegration();
|
||||
if (this.debugMode && messageBusEnabled) {
|
||||
debugLogger.log(
|
||||
`[DEBUG] enableMessageBusIntegration setting: ${messageBusEnabled}`,
|
||||
);
|
||||
}
|
||||
|
||||
const toolArgs = messageBusEnabled
|
||||
? [...args, this.getMessageBus()]
|
||||
: args;
|
||||
if (this.debugMode && messageBusEnabled) {
|
||||
debugLogger.log(
|
||||
`[DEBUG] Registering ${className} with messageBus: ${messageBusEnabled ? 'YES' : 'NO'}`,
|
||||
);
|
||||
}
|
||||
|
||||
registry.registerTool(new ToolClass(...toolArgs));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user