import { VercelSandboxConfig } from "../types/executionContext.js";
import { FunctionToolConfig } from "./NativeSandboxExecutor.js";

//#region src/domains/run/tools/VercelSandboxExecutor.d.ts
interface ExecutionResult {
  success: boolean;
  result?: unknown;
  error?: string;
  logs?: string[];
  executionTime?: number;
}
/**
 * Vercel Sandbox Executor with pooling/reuse
 * Executes function tools in isolated Vercel Sandbox MicroVMs
 * Caches and reuses sandboxes based on dependencies to improve performance
 */
declare class VercelSandboxExecutor {
  private config;
  private sandboxPool;
  private cleanupInterval;
  private sandboxInitPromises;
  constructor(config: VercelSandboxConfig);
  private getOrCreateSandbox;
  /**
   * Generate a hash for dependencies to use as cache key
   */
  private generateDependencyHash;
  /**
   * Get a cached sandbox if available and still valid
   */
  private getCachedSandbox;
  /**
   * Add sandbox to pool
   */
  private addToPool;
  /**
   * Increment use count for a sandbox
   */
  private incrementUseCount;
  /**
   * Remove and clean up a sandbox
   */
  private removeSandbox;
  /**
   * Start periodic cleanup of expired sandboxes
   */
  private startPoolCleanup;
  /**
   * Cleanup all sandboxes and stop cleanup interval
   */
  cleanup(): Promise<void>;
  /**
   * Extract environment variable names from code
   * Matches patterns like process.env.VAR_NAME or process.env['VAR_NAME']
   */
  private extractEnvVars;
  /**
   * Execute a function tool in Vercel Sandbox with pooling
   */
  executeFunctionTool(functionId: string, args: Record<string, unknown>, toolConfig: FunctionToolConfig): Promise<ExecutionResult>;
}
//#endregion
export { ExecutionResult, VercelSandboxExecutor };