import type { ExchangeAdapter } from "./exchanges/index.js"; export type PlanAction = "market_order" | "limit_order" | "stop_order" | "cancel_order" | "cancel_all" | "set_leverage" | "close_position" | "wait" | "check_balance" | "check_position"; export interface PlanStep { id: string; action: PlanAction; params: Record; onFailure?: "abort" | "skip" | "rollback"; dependsOn?: string; clientId?: string; } export interface ExecutionPlan { version: "1.0"; exchange?: string; description?: string; steps: PlanStep[]; } export interface StepResult { stepId: string; action: PlanAction; status: "success" | "failed" | "skipped" | "rolled_back" | "dry_run"; result?: unknown; error?: { code: string; message: string; }; durationMs: number; } export interface PlanResult { planId: string; status: "completed" | "partial" | "failed" | "dry_run"; steps: StepResult[]; totalDurationMs: number; timestamp: string; } /** * Validate a plan structure without executing it. */ export declare function validatePlan(plan: unknown): { valid: boolean; errors: string[]; }; /** * Execute a plan step by step. */ export declare function executePlan(adapter: ExchangeAdapter, plan: ExecutionPlan, opts?: { dryRun?: boolean; log?: (msg: string) => void; }): Promise;