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:
Allen Hutchison
2025-11-03 15:41:00 -08:00
committed by GitHub
parent 60d2c2cc90
commit ffc5e4d048
35 changed files with 1357 additions and 2156 deletions
+4 -16
View File
@@ -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));
}
};