import type { registerApp } from '@larksuiteoapi/node-sdk'; import type { HookWireSpec } from './patch-config.js'; /** Feishu config dir: credentials + the stable copy of the notify script. */ export declare const FEISHU_CONFIG_DIR: string; export declare const FEISHU_CONFIG_PATH: string; /** Card content truncation length written by setup (notify script default). */ export declare const FEISHU_RESULT_MAX_CHARS_DEFAULT = 300; /** UI-accepted truncation range (characters). */ export declare const FEISHU_RESULT_MAX_CHARS_MIN = 50; export declare const FEISHU_RESULT_MAX_CHARS_MAX = 5000; /** Injectable file paths, so tests (and the web routes) stay off the real home. */ export interface FeishuSetupPaths { /** Credential file (default ~/.dsh/dsh-hooks/feishu-config.json). */ configPath?: string; /** Profile patch file (default ~/.dsh/profiles//cordis.patch.yml). */ patchFile?: string; /** * Legacy stable notify-script location. The setup no longer copies or * references a script (hooks use the built-in `feishu` channel); kept so * {@link stableScriptPath} callers and older tests still resolve. */ notifyScript?: string; } export interface FeishuQRCodeInfo { url: string; /** Seconds until the QR authorization expires. */ expireIn: number; } export interface RunFeishuSetupOptions { /** Profile whose cordis.patch.yml receives the dsh-hooks config block. */ profile?: string; /** Overrides the real registerApp (tests). */ registerAppFn?: typeof registerApp; print?: (line: string) => void; printErr?: (line: string) => void; /** Called when the QR authorization is ready (CLI prints it; web renders it). */ onQRCodeReady?: (qr: FeishuQRCodeInfo) => void | Promise; /** Abort the scan wait (web cancel). */ signal?: AbortSignal; /** Card content truncation length written into the credential file. */ resultMaxChars?: number; paths?: FeishuSetupPaths; } export interface FeishuSetupResult { appId: string; ownerOpenId: string; } /** * Profile patch file for a profile name. * * Validates the name and contains the path under `~/.dsh/profiles` — the Feishu * setup writes the profile's hook list, so an unchecked name here would be a * second traversal route beside `patchFilePath`. */ export declare function patchPath(profile: string): string; /** * Render a script path for a generated hook command. * * @deprecated The setup no longer generates `run:` commands at all — it writes * the built-in `notify: { channel: 'feishu' }` hooks (see {@link setupHooks}), * so no path has to be escaped into YAML. Kept for hand-written config helpers. */ export declare function hookCommandPath(scriptPath: string): string; /** * Which hooks the setup installs into the profile: five built-in `feishu` * channel notifications. * * The setup used to copy `notify-feishu.mjs` beside the credentials and write * five `run: node