import { type FetchLike } from '../domain/mcp/feishu/user-auth.js'; export interface CliResult { exitCode: number; stdout: string; stderr: string; } /** Injectable seams so the dispatcher is testable without real stdin/network/CONFIG_DIR. */ export interface FeishuCliDeps { env?: NodeJS.ProcessEnv; prompt?: (question: string) => Promise; now?: () => number; tokenFile?: string; fetchImpl?: FetchLike; /** Injectable wait used by the device-flow poll (defaults to setTimeout). */ sleep?: (ms: number) => Promise; /** When true (default), merge CONFIG_DIR/.env into env so credentials are available. */ loadDotenv?: boolean; /** dotenv file that a successful login flips to FEISHU_AUTH_MODE=user (default: CONFIG_DIR/.env). */ envFile?: string; } /** * Idempotently set KEY=value in a dotenv file: rewrite the line if KEY already * exists, append it otherwise, creating the file (and parent dir) when missing. * The rest of the file is preserved so hand-written credentials stay intact. */ export declare function upsertEnvVar(file: string, key: string, value: string): void; export declare function getFeishuHelp(): string; export declare function cmdFeishu(args: string[], deps?: FeishuCliDeps): Promise;