import type { NormalizedVcMeetingBatch } from './types.js'; /** Minimum lark-cli version that supports `--as bot` for VC meeting commands. */ export declare const MIN_LARK_CLI_VERSION_FOR_VC_BOT = "1.0.66"; export interface LarkCliVersionInfo { /** Raw version string, e.g. "1.0.66". */ version: string; /** True when `version >= MIN_LARK_CLI_VERSION_FOR_VC_BOT`. */ meetsVcBotRequirement: boolean; } /** * Run `lark-cli --version` and parse the result. Returns `null` when lark-cli * is not installed or the version string cannot be parsed. */ export declare function checkLarkCliVersion(): LarkCliVersionInfo | null; export interface LarkCliRunOptions { profile?: string; /** Bound synchronous lark-cli execution so daemon restore cannot hang the * event loop forever when the child process or network stalls. */ timeoutMs?: number; } export interface FetchMeetingEventsOptions extends LarkCliRunOptions { meetingId: string; pageToken?: string; pageSize?: number; pageAll?: boolean; start?: string; end?: string; } export interface JoinMeetingOptions extends LarkCliRunOptions { meetingNumber: string; password?: string; /** Correlation ID forwarded from the invite event (lark-cli >= 1.0.66). */ callId?: string; } export interface SendMeetingMessageOptions extends LarkCliRunOptions { meetingId: string; text: string; uuid?: string; } export declare function runLarkCliJson(args: string[], opts?: { timeoutMs?: number; }): unknown; /** One entry from `lark-cli profile list --format json` (extra fields ignored). */ interface LarkCliProfileEntry { name: string; appId?: string; brand?: string; active?: boolean; } /** Injectable lark-cli surface so provisioning can be unit-tested without a * real lark-cli or `node:child_process` module mock. Production uses spawnSync. */ export interface LarkCliProfileDeps { /** Return the names lark-cli currently knows, or null when it can't be * enumerated (missing binary / non-zero exit / unparseable output). */ listProfileNames(timeoutMs?: number): string[] | null; /** Run `profile add` from the secret (stdin). Returns the raw outcome. */ addProfile(input: { profileName: string; appId: string; appSecret: string; brand: string; timeoutMs?: number; }): { status: number | null; stderr?: string; stdout?: string; }; } /** * List the profiles lark-cli currently knows about. Returns [] when lark-cli * is missing/errors — callers treat "cannot enumerate" the same as "profile * absent" and fall through to a provisioning attempt (which surfaces the real * error) rather than guessing a profile exists. */ export declare function listLarkCliProfiles(opts?: { timeoutMs?: number; }, deps?: LarkCliProfileDeps): LarkCliProfileEntry[]; /** Does lark-cli already have a profile with this exact name? */ export declare function larkCliProfileExists(profileName: string, opts?: { timeoutMs?: number; }, deps?: LarkCliProfileDeps): boolean; export interface EnsureLarkCliBotProfileOptions { profileName: string; appId: string; appSecret: string; brand?: string; timeoutMs?: number; } export type EnsureLarkCliBotProfileResult = { ok: true; created: boolean; } | { ok: false; reason: 'missing_secret' | 'add_failed'; error: string; }; /** * Idempotently ensure a lark-cli bot profile exists for VC meeting join. * * botmux stores each bot's appSecret in its own config, but nothing ever * registered a matching lark-cli profile — so `--as bot --profile ` * failed with "profile not found" and the bot was stuck ringing. This bridges * that gap: when the profile is absent we create it non-interactively from the * stored secret. * * SECRET HANDLING: the secret is passed via `--app-secret-stdin` (never argv, * so it can't leak into `ps`/process listings) and lands only in lark-cli's own * encrypted credential store. This must run in the trusted daemon process, not * inside a sandboxed worker. */ export declare function ensureLarkCliBotProfile(opts: EnsureLarkCliBotProfileOptions, deps?: LarkCliProfileDeps): EnsureLarkCliBotProfileResult; /** Check both lark-cli convenience-command format ({ok:false}) and raw API format ({code:!0}). */ export declare function assertLarkCliJsonOk(raw: unknown, context: string): void; export declare function extractMeetingIdFromJoin(raw: unknown): string | undefined; /** * Join a VC meeting as a bot via `lark-cli vc +meeting-join --as bot`. * Requires lark-cli >= 1.0.66. */ export declare function joinMeetingAsBot(opts: JoinMeetingOptions): { meetingId: string; raw: unknown; }; /** * Fetch VC meeting events via `lark-cli vc +meeting-events --as bot`. * Requires lark-cli >= 1.0.66. */ export declare function fetchMeetingEventsAsBot(opts: FetchMeetingEventsOptions): { raw: unknown; batch: NormalizedVcMeetingBatch; }; /** * Send a text message to a VC meeting via `lark-cli vc +meeting-message-send --as bot`. * Requires lark-cli >= 1.0.66. */ export declare function sendMeetingTextMessageAsBot(opts: SendMeetingMessageOptions): { raw: unknown; }; export {}; //# sourceMappingURL=polling-source.d.ts.map