import { loadConfig, type BotConfig } from "../config.js"; import { ensureLarkProfile, installLarkCli, larkAutoInstallEnabled, readLarkCliVersion, shouldAttemptLarkInstall } from "../platform/lark-cli.js"; export type FeishuCreds = { botId: string; appId: string; appSecret: string; platformBotId?: string; }; export declare function resolveCurrentBot(bots: BotConfig[], opts: { botName?: string; botProfilePath?: string; dbPath?: string; }): BotConfig; export declare function formatFeishuCreds(creds: FeishuCreds): string; export declare function handleFeishu(args: string[], env: { botName?: string; botProfilePath?: string; dbPath?: string; platformBotId?: string; }, io?: { log: (text: string) => void; error: (text: string) => void; exit: (code: number) => void; }, load?: typeof loadConfig): void; /** 当前 Bot 执行 lark-cli 时需要的身份环境变量(只在本进程内传给子进程)。 */ export declare function larkCliIdentityEnv(botId: string): Record; export type LarkCliExec = (args: string[], env: NodeJS.ProcessEnv) => Promise; /** * 调用参数里显式带上 `--profile `。 * * 不依赖 lark-cli 是否读取 LARKSUITE_CLI_PROFILE(不同版本行为不一致), * 也避免它静默回落到配置文件里的默认 profile(多 Bot 同机时默认 profile 可能属于别人)。 * 调用方自己传了 `--profile` 时以调用方为准。 */ export declare function larkCliProfileArgs(args: string[], botId: string): string[]; /** 默认执行器:参数透传给 lark-cli,stdio 继承(保留交互与实时输出)。 */ export declare function execLarkCli(args: string[], env: NodeJS.ProcessEnv): Promise; export interface FeishuRunDeps { load?: typeof loadConfig; readVersion?: typeof readLarkCliVersion; install?: typeof installLarkCli; ensureProfile?: typeof ensureLarkProfile; autoInstallEnabled?: typeof larkAutoInstallEnabled; shouldAttemptInstall?: typeof shouldAttemptLarkInstall; exec?: LarkCliExec; homeDir?: string; } /** * `nbt feishu `:确保 lark-cli 可用、当前 Bot 的身份已就绪, * 然后以该身份执行官方 CLI;退出码透传。 */ export declare function handleFeishuRun(args: string[], env: { botName?: string; botProfilePath?: string; dbPath?: string; }, io?: { log: (text: string) => void; error: (text: string) => void; exit: (code: number) => void; }, deps?: FeishuRunDeps): Promise;