The plan approval system now has enforcement at the tool execution level: - After modifying more than 2 files, the agent MUST use plan_approval - File-modifying tools (write, edit, delete, etc.) are blocked until an approved plan exists - Clear error message guides agent to create and submit a plan This ensures agents can't bypass plan approval instructions.
32 lines
919 B
TypeScript
32 lines
919 B
TypeScript
/**
|
|
* Agent Options Interface
|
|
*/
|
|
|
|
import type { ProviderName } from "@/types/providers";
|
|
import type { ToolCall, ToolResult } from "@/types/tools";
|
|
|
|
export interface AgentOptions {
|
|
provider: ProviderName;
|
|
model?: string;
|
|
maxIterations?: number;
|
|
onToolCall?: (call: ToolCall) => void;
|
|
onToolResult?: (callId: string, result: ToolResult) => void;
|
|
onText?: (text: string) => void;
|
|
onThinking?: (text: string) => void;
|
|
onError?: (error: string) => void;
|
|
onWarning?: (warning: string) => void;
|
|
verbose?: boolean;
|
|
autoApprove?: boolean;
|
|
/** Chat mode - only read-only tools, no file modifications */
|
|
chatMode?: boolean;
|
|
/** Enforce plan approval for multi-file modifications (default: true) */
|
|
enforcePlanApproval?: boolean;
|
|
/** Model-specific parameters from tier detection */
|
|
modelParams?: {
|
|
temperature?: number;
|
|
topP?: number;
|
|
topK?: number;
|
|
maxTokens?: number;
|
|
};
|
|
}
|