feat: default to full-access mode with hook-based sensitive guards
This commit is contained in:
+22
-1
@@ -33,6 +33,9 @@ export interface SetupConfig {
|
||||
sandbox?: { enabled?: boolean };
|
||||
pairing?: { enabled?: boolean };
|
||||
tools?: { profile?: string };
|
||||
agents?: {
|
||||
sensitive_mode?: 'deny_without_elevation' | 'confirm_without_elevation';
|
||||
};
|
||||
agent_configs?: Record<string, {
|
||||
model_tier?: 'fast' | 'default' | 'complex' | 'local';
|
||||
tool_profile?: string;
|
||||
@@ -85,10 +88,22 @@ export class ConfigBuilder {
|
||||
models: {},
|
||||
server: { port: 18800, localhost: true },
|
||||
hooks: {
|
||||
confirm: ['shell.*', 'file.write', 'file.patch'],
|
||||
confirm: [
|
||||
'shell.*',
|
||||
'process.start',
|
||||
'process.kill',
|
||||
'browser.*',
|
||||
'message.send',
|
||||
'cron.create',
|
||||
'cron.delete',
|
||||
'file.write',
|
||||
'file.patch',
|
||||
],
|
||||
log: ['web.*', 'file.read'],
|
||||
silent: ['notify'],
|
||||
},
|
||||
tools: { profile: 'full' },
|
||||
agents: { sensitive_mode: 'confirm_without_elevation' },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -171,6 +186,12 @@ export class ConfigBuilder {
|
||||
this.config.tools = { profile };
|
||||
}
|
||||
|
||||
setSensitiveMode(mode: 'deny_without_elevation' | 'confirm_without_elevation'): void {
|
||||
const agents = (this.config.agents ?? {}) as Record<string, unknown>;
|
||||
agents.sensitive_mode = mode;
|
||||
this.config.agents = agents as SetupConfig['agents'];
|
||||
}
|
||||
|
||||
setResearchAgentEnabled(options: ResearchAgentOptions): void {
|
||||
const agentConfigs = (this.config.agent_configs ?? {}) as Record<string, Record<string, unknown>>;
|
||||
const existing = (agentConfigs.research ?? {}) as Record<string, unknown>;
|
||||
|
||||
Reference in New Issue
Block a user