import type { DMLEvent, LLMUsage, MemoryMessage, DeepClauseSDK } from "deepclause-sdk"; import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { DeepClauseConfig } from "./config.js"; export declare const PI_WORKSPACE_LIST_TOOL = "pi_workspace_list"; export declare const PI_BASH_TOOL = "pi_bash"; export declare const DC_VERIFY_RUN_TOOL = "dc_verify_run"; export declare const DC_APPLY_SNAPSHOT_TOOL = "dc_apply_snapshot"; export declare const DC_APPLY_ACCEPT_TOOL = "dc_apply_accept"; export declare const DC_APPLY_RESTORE_TOOL = "dc_apply_restore"; /** * Record a git snapshot ref, refusing a dirty working tree. If an apply is already * in progress for this change, the existing ref is returned so the run resumes * instead of starting over or rejecting the (intentionally) dirty tree. */ export declare function gitSnapshot(pi: Pick, cwd: string, changeJsonPath: string): Promise; /** Restore the recorded snapshot (hard reset plus clean of untracked files). */ export declare function gitRestore(pi: Pick, cwd: string, changeJsonPath: string): Promise; /** Mark the apply accepted and clear the snapshot. */ export declare function gitAccept(changeJsonPath: string): Promise; export type BashApproval = (command: string, signal: AbortSignal) => Promise; export declare function registerPiRuntimeTools(sdk: DeepClauseSDK, pi: Pick, cwd: string, signal: AbortSignal, approveBash?: BashApproval): void; export interface ExecutionCallbacks { onEvent(event: DMLEvent): void; onInput(prompt: string, signal: AbortSignal): Promise; onDiagnostic?(message: string, details?: unknown): void; } export interface PiAgentStepRequest { instruction: string; tools: string[]; expected: string; skills: string[]; } export interface PiAgentStepResult { success: boolean; summary: string; toolsUsed: string[]; errors: string[]; } export interface ExecutionResult { answer?: string; errors: string[]; usage: LLMUsage; } export declare function executeDml(filePath: string, args: string[], initialMessages: MemoryMessage[], config: DeepClauseConfig & { judgeBackend?: string; }, pi: ExtensionAPI, ctx: ExtensionContext, controller: AbortController, callbacks: ExecutionCallbacks, runPiAgentStep?: (request: PiAgentStepRequest, signal: AbortSignal) => Promise, verifyCommands?: string[], applyChangeJsonPath?: string): Promise;