import { type DebugToolDetails } from "@oh-my-pi/pi-tui/tools/debug"; import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolApprovalDecision } from "@oh-my-pi/pi-agent-core"; import type { ToolExample } from "@oh-my-pi/pi-ai"; import { type DapBreakpointRecord, type DapContinueOutcome, type DapDataBreakpointInfoResponse, type DapDataBreakpointRecord, type DapDisassembledInstruction, type DapEvaluateResponse, type DapFunctionBreakpointRecord, type DapInstructionBreakpointRecord, type DapModule, type DapScope, type DapSessionSummary, type DapSource, type DapStackFrame, type DapThread, type DapVariable } from "../dap/index.js"; import type { ToolSession } from "./index.js"; import type { OutputMeta } from "@oh-my-pi/pi-tui/tools/output-meta"; /** * DAP debug actions that only read program state (no mutation, no execution). * Execution-side actions (`launch`, `attach`, `continue`, `step_*`, `pause`, * `evaluate`, breakpoint mutations, memory writes) are exec-tier. */ export declare const DEBUG_READONLY_ACTIONS: ReadonlySet; declare const debugSchema: import("@oh-my-pi/omptype").FluentType<{ access_type?: "read" | "readWrite" | "write" | undefined; action: "attach" | "continue" | "custom_request" | "data_breakpoint_info" | "disassemble" | "evaluate" | "launch" | "loaded_sources" | "modules" | "output" | "pause" | "read_memory" | "remove_breakpoint" | "remove_data_breakpoint" | "remove_instruction_breakpoint" | "scopes" | "sessions" | "set_breakpoint" | "set_data_breakpoint" | "set_instruction_breakpoint" | "stack_trace" | "step_in" | "step_out" | "step_over" | "terminate" | "threads" | "variables" | "write_memory"; adapter?: string | undefined; allow_partial?: boolean | undefined; args?: string[] | undefined; arguments?: Record | undefined; command?: string | undefined; condition?: string | undefined; context?: string | undefined; count?: number | undefined; cwd?: string | undefined; data?: string | undefined; data_id?: string | undefined; expression?: string | undefined; file?: string | undefined; frame_id?: number | undefined; function?: string | undefined; hit_condition?: string | undefined; host?: string | undefined; instruction_count?: number | undefined; instruction_offset?: number | undefined; instruction_reference?: string | undefined; levels?: number | undefined; line?: number | undefined; memory_reference?: string | undefined; module_count?: number | undefined; name?: string | undefined; offset?: number | undefined; pid?: number | undefined; port?: number | undefined; program?: string | undefined; resolve_symbols?: boolean | undefined; scope_id?: number | undefined; start_module?: number | undefined; timeout?: number | undefined; variable_ref?: number | undefined; }, { access_type?: "read" | "readWrite" | "write" | undefined; action: "attach" | "continue" | "custom_request" | "data_breakpoint_info" | "disassemble" | "evaluate" | "launch" | "loaded_sources" | "modules" | "output" | "pause" | "read_memory" | "remove_breakpoint" | "remove_data_breakpoint" | "remove_instruction_breakpoint" | "scopes" | "sessions" | "set_breakpoint" | "set_data_breakpoint" | "set_instruction_breakpoint" | "stack_trace" | "step_in" | "step_out" | "step_over" | "terminate" | "threads" | "variables" | "write_memory"; adapter?: string | undefined; allow_partial?: boolean | undefined; args?: string[] | undefined; arguments?: Record | undefined; command?: string | undefined; condition?: string | undefined; context?: string | undefined; count?: number | undefined; cwd?: string | undefined; data?: string | undefined; data_id?: string | undefined; expression?: string | undefined; file?: string | undefined; frame_id?: number | undefined; function?: string | undefined; hit_condition?: string | undefined; host?: string | undefined; instruction_count?: number | undefined; instruction_offset?: number | undefined; instruction_reference?: string | undefined; levels?: number | undefined; line?: number | undefined; memory_reference?: string | undefined; module_count?: number | undefined; name?: string | undefined; offset?: number | undefined; pid?: number | undefined; port?: number | undefined; program?: string | undefined; resolve_symbols?: boolean | undefined; scope_id?: number | undefined; start_module?: number | undefined; timeout?: number | undefined; variable_ref?: number | undefined; }>; export type DebugParams = typeof debugSchema.infer; export type DebugAction = DebugParams["action"]; interface DebugExecutionDetails extends DebugToolDetails { action: DebugAction; success: boolean; snapshot?: DapSessionSummary; sessions?: DapSessionSummary[]; stackFrames?: DapStackFrame[]; threads?: DapThread[]; scopes?: DapScope[]; variables?: DapVariable[]; sources?: DapSource[]; modules?: DapModule[]; evaluation?: DapEvaluateResponse; breakpoints?: DapBreakpointRecord[]; functionBreakpoints?: DapFunctionBreakpointRecord[]; instructionBreakpoints?: DapInstructionBreakpointRecord[]; dataBreakpoints?: DapDataBreakpointRecord[]; dataBreakpointInfo?: DapDataBreakpointInfoResponse; disassembly?: DapDisassembledInstruction[]; memoryAddress?: string; memoryData?: string; unreadableBytes?: number; bytesWritten?: number; customBody?: unknown; output?: string; adapter?: string; state?: DapContinueOutcome["state"]; timedOut?: boolean; meta?: OutputMeta; } export declare class DebugTool implements AgentTool { private readonly session; readonly name = "debug"; readonly approval: (args: unknown) => ToolApprovalDecision; readonly formatApprovalDetails: (args: unknown) => string[]; readonly label = "Debug"; readonly summary = "Debug a running process with DAP (debugger adapter protocol)"; readonly description: string; readonly parameters: import("@oh-my-pi/omptype").FluentType<{ access_type?: "read" | "readWrite" | "write" | undefined; action: "attach" | "continue" | "custom_request" | "data_breakpoint_info" | "disassemble" | "evaluate" | "launch" | "loaded_sources" | "modules" | "output" | "pause" | "read_memory" | "remove_breakpoint" | "remove_data_breakpoint" | "remove_instruction_breakpoint" | "scopes" | "sessions" | "set_breakpoint" | "set_data_breakpoint" | "set_instruction_breakpoint" | "stack_trace" | "step_in" | "step_out" | "step_over" | "terminate" | "threads" | "variables" | "write_memory"; adapter?: string | undefined; allow_partial?: boolean | undefined; args?: string[] | undefined; arguments?: Record | undefined; command?: string | undefined; condition?: string | undefined; context?: string | undefined; count?: number | undefined; cwd?: string | undefined; data?: string | undefined; data_id?: string | undefined; expression?: string | undefined; file?: string | undefined; frame_id?: number | undefined; function?: string | undefined; hit_condition?: string | undefined; host?: string | undefined; instruction_count?: number | undefined; instruction_offset?: number | undefined; instruction_reference?: string | undefined; levels?: number | undefined; line?: number | undefined; memory_reference?: string | undefined; module_count?: number | undefined; name?: string | undefined; offset?: number | undefined; pid?: number | undefined; port?: number | undefined; program?: string | undefined; resolve_symbols?: boolean | undefined; scope_id?: number | undefined; start_module?: number | undefined; timeout?: number | undefined; variable_ref?: number | undefined; }, { access_type?: "read" | "readWrite" | "write" | undefined; action: "attach" | "continue" | "custom_request" | "data_breakpoint_info" | "disassemble" | "evaluate" | "launch" | "loaded_sources" | "modules" | "output" | "pause" | "read_memory" | "remove_breakpoint" | "remove_data_breakpoint" | "remove_instruction_breakpoint" | "scopes" | "sessions" | "set_breakpoint" | "set_data_breakpoint" | "set_instruction_breakpoint" | "stack_trace" | "step_in" | "step_out" | "step_over" | "terminate" | "threads" | "variables" | "write_memory"; adapter?: string | undefined; allow_partial?: boolean | undefined; args?: string[] | undefined; arguments?: Record | undefined; command?: string | undefined; condition?: string | undefined; context?: string | undefined; count?: number | undefined; cwd?: string | undefined; data?: string | undefined; data_id?: string | undefined; expression?: string | undefined; file?: string | undefined; frame_id?: number | undefined; function?: string | undefined; hit_condition?: string | undefined; host?: string | undefined; instruction_count?: number | undefined; instruction_offset?: number | undefined; instruction_reference?: string | undefined; levels?: number | undefined; line?: number | undefined; memory_reference?: string | undefined; module_count?: number | undefined; name?: string | undefined; offset?: number | undefined; pid?: number | undefined; port?: number | undefined; program?: string | undefined; resolve_symbols?: boolean | undefined; scope_id?: number | undefined; start_module?: number | undefined; timeout?: number | undefined; variable_ref?: number | undefined; }>; readonly strict = true; readonly examples: readonly ToolExample[]; readonly concurrency = "exclusive"; readonly loadMode = "discoverable"; constructor(session: ToolSession); static createIf(session: ToolSession): DebugTool | null; execute(_toolCallId: string, params: DebugParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } export {};