/** * Code Mode Tool * * Transform MCP tools and AI SDK tools into code-mode execution. * Allows writing code to a sandbox FS, importing tools, and running them. */ import type { ToolMetadata, PraisonTool } from '../registry/types'; export declare const CODE_MODE_METADATA: ToolMetadata; export interface CodeModeConfig { /** Allowed tools that can be imported */ allowedTools?: string[]; /** Blocked tools that cannot be imported */ blockedTools?: string[]; /** Enable network access (default: false) */ allowNetwork?: boolean; /** Allowed file paths (glob patterns) */ allowedPaths?: string[]; /** Execution timeout in ms (default: 30000) */ timeoutMs?: number; /** Maximum memory in MB (default: 128) */ maxMemoryMb?: number; } export interface CodeModeInput { /** Code to execute */ code: string; /** Files to write to the sandbox before execution */ files?: Record; /** Environment variables for execution */ env?: Record; } export interface CodeModeResult { /** Execution output */ output: string; /** Standard output */ stdout: string; /** Standard error */ stderr: string; /** Exit code */ exitCode: number; /** Files created/modified during execution */ files?: Record; /** Execution success */ success: boolean; /** Error message if failed */ error?: string; } /** * Create a Code Mode tool */ export declare function codeMode(config?: CodeModeConfig): PraisonTool; /** * Factory function for registry */ export declare function createCodeModeTool(config?: CodeModeConfig): PraisonTool;