/**
 * COM execute_code executor — local XLL-backed execution lifecycle.
 *
 * Owns the COM-specific execution flow:
 * 1. Send code to the local XLL via xllFetch
 * 2. Parse and validate the response
 * 3. Run the approval / revert / cleanup flow
 *
 * Used by:
 * - `createExcelExecTool()` (COM ToolDefinition wrapper)
 */
import { type ApprovalChoice, type ApprovalGate, type ApprovalRequest } from '../../../approvals/types.js';
import type { ExtensionContext } from '../../../extensions/index.js';
import { type LocalExcelHttpUrl } from '../../../xll/http-url.js';
import type { ExcelApprovalPayload } from './approval-payload.js';
import { type DiffPayload } from './diff.js';
import { type EditModeRetryTiming } from './edit-mode-retry.js';
export interface ComExecResult {
    ok: boolean;
    output?: string;
    error?: string;
    diff?: DiffPayload;
    cfTxId?: string;
    editMode?: boolean;
}
export type ApprovalOutcome = 'accepted' | 'failed' | 'reverted' | 'revert-failed' | 'rejected';
export interface LocalExecResult {
    result: ComExecResult;
    outcome: ApprovalOutcome;
    approvalSummaries?: string[];
}
export interface ExcelExecApprovalObservability {
    onRequested?: (request: ApprovalRequest<ExcelApprovalPayload>) => void;
    onAccepted?: (request: ApprovalRequest<ExcelApprovalPayload>, choice: ApprovalChoice) => void;
    onRejected?: (request: ApprovalRequest<ExcelApprovalPayload>) => void;
    onReverted?: (request: ApprovalRequest<ExcelApprovalPayload>) => void;
    onRevertFailed?: (request: ApprovalRequest<ExcelApprovalPayload>) => void;
}
interface ApprovalResolution {
    outcome: ApprovalOutcome;
    approvalSummaries?: string[];
}
/** Validate that a parsed JSON value has the COM execute result shape. */
export declare function isComExecResult(v: unknown): v is ComExecResult;
/**
 * Resolve approval for cell changes: show UI if needed, then revert or cleanup.
 */
export declare function resolveApproval(result: ComExecResult, approval: ApprovalGate<ExcelApprovalPayload> | undefined, postControl: (body: object) => Promise<Response>, ctx: ExtensionContext, observability?: ExcelExecApprovalObservability, priorApprovalSummaries?: string[]): Promise<ApprovalResolution>;
/**
 * Execute code against the local XLL and run approval.
 *
 * This is the reusable core for desktop-local COM execution.
 * The XLL endpoint (`httpUrl`) is always local to the machine running the agent.
 */
export declare function executeComLocally(excelHttpUrl: LocalExcelHttpUrl | undefined, code: string, options?: {
    approval?: ApprovalGate<ExcelApprovalPayload>;
    ctx?: ExtensionContext;
    signal?: AbortSignal;
    observability?: ExcelExecApprovalObservability;
    editModeTiming?: Partial<EditModeRetryTiming>;
}): Promise<LocalExecResult>;
export {};
//# sourceMappingURL=executor.d.ts.map