/** * Represents how poe-code should be invoked */ export interface ExecutionCommand { /** The binary/command to run */ command: string; /** Arguments to pass (excludes the subcommand) */ args: string[]; } export type ExecutionMode = "global" | "npx" | "npx-latest" | "development"; interface ExecutionContext { mode: ExecutionMode; command: ExecutionCommand; } interface DetectionInput { argv: string[]; env: Record; moduleUrl: string; } /** * Detects how poe-code is being executed and returns the appropriate * command format for spawning it again (e.g., for MCP server config) */ export declare function detectExecutionContext(input: DetectionInput): ExecutionContext; /** * Converts an ExecutionCommand to the format expected by different MCP clients */ export declare function toMcpServerCommand(execCommand: ExecutionCommand, subcommand: string): { command: string; args: string[]; }; /** * Converts an ExecutionCommand to OpenCode's MCP format (command as array) */ export declare function toOpenCodeMcpCommand(execCommand: ExecutionCommand, subcommand: string): string[]; export declare function formatCliHelpCommand(context: { mode: ExecutionMode; command: ExecutionCommand; }, args: string[]): string; export declare function formatCliUsageCommand(context: { mode: ExecutionMode; command: ExecutionCommand; }): string; /** * Get the current execution context using process globals */ export declare function getCurrentExecutionContext(moduleUrl: string): ExecutionContext; export {};