/** * Feishu/Lark channel adapter: long-connection (WebSocket) event intake via the * official SDK's high-level `createLarkChannel`, normalized message routing into * `dsh-connect`, and streaming replies back to Feishu. * @module dsh-connect/feishu */ import type { Context } from "@deepseek-ai/cordis"; import z from "@deepseek-ai/schemastery"; import { type FeishuConfig } from "./adapter.js"; import { onboardFeishu } from "./onboard.js"; export { FeishuAdapter } from "./adapter.js"; export type { FeishuConfig } from "./adapter.js"; export { padLabels, buildButtonGrid, buildSelectMenu, buildChoiceElements, sanitizeFileName, extractErrorDetail, classifyFeishuFile } from "./adapter.js"; export { encodeChatKey, decodeChatKey } from "../../chat-key.js"; export { loadCredentials, onboardFeishu, saveCredentials } from "./onboard.js"; export type { FeishuCredentials } from "./onboard.js"; /** Plugin config; secrets may come from config, the FEISHU_* environment, or one-click onboarding. */ export declare const Config: z; appSecret: z; transport: z<"websocket" | "webhook", "websocket" | "webhook", "plain">; verificationToken: z; encryptKey: z; webhookPort: z; webhookPath: z; requireMention: z; dmMode: z<"disabled" | "open" | "allowlist" | "pair", "disabled" | "open" | "allowlist" | "pair", "plain">; threadIsolation: z; language: z<"zh" | "en", "zh" | "en", "plain">; /** Set false to never enter the interactive one-click onboarding flow. */ onboarding: z; /** * Access control for *this* channel. Identifiers are channel-specific — a * Feishu `ou_…` open id means nothing to Telegram, whose user ids are * numeric — so each channel carries its own lists. Empty means "everyone", * and absent means "fall back to the top-level `allowUsers`/`allowChats`". */ allowUsers: z; allowChats: z; }>>, Schemastery.ObjectT; appSecret: z; transport: z<"websocket" | "webhook", "websocket" | "webhook", "plain">; verificationToken: z; encryptKey: z; webhookPort: z; webhookPath: z; requireMention: z; dmMode: z<"disabled" | "open" | "allowlist" | "pair", "disabled" | "open" | "allowlist" | "pair", "plain">; threadIsolation: z; language: z<"zh" | "en", "zh" | "en", "plain">; /** Set false to never enter the interactive one-click onboarding flow. */ onboarding: z; /** * Access control for *this* channel. Identifiers are channel-specific — a * Feishu `ou_…` open id means nothing to Telegram, whose user ids are * numeric — so each channel carries its own lists. Empty means "everyone", * and absent means "fall back to the top-level `allowUsers`/`allowChats`". */ allowUsers: z; allowChats: z; }>>, "plain">; interface ConnectLike { registerAdapter(adapter: unknown): void; /** Allowlist gate usable by adapters before they download message resources. */ isChatAllowed?(channel: string, chatKey: string, senderKey: string): boolean; } /** What `register` needs beyond the config, injected by the merged entry. */ export interface FeishuRegisterOptions { /** * The DSH credential store. Onboarding results are written here as well as to * the legacy JSON file, so the pane's 「已配置凭据」 badge reflects the app that * was actually just created instead of staying permanently unconfigured. */ credentialStore?: { save(channel: "feishu", values: Record): Promise; }; /** * Whether an interactive onboarding flow is acceptable. Defaults to whether * stdout is a TTY; tests pass it explicitly. */ interactive?: boolean; /** * The onboarding flow itself. Defaults to {@link onboardFeishu}, which drives * the real device-authorization QR flow — a network round trip to Feishu that * a test cannot perform. Injecting one lets the *reporting* be exercised, which * is the part that used to lie. */ onboard?: typeof onboardFeishu; } /** * Register and start the Feishu adapter. `connect` is the already-constructed * `ConnectService` instance (passed from the merged entry, not resolved via * `ctx.get` — that returns undefined during the same plugin's `apply`). When no * credentials are configured, the plugin enters one-click onboarding (scan a QR / * open a link) and connects with the credentials the flow returns. */ export declare function register(connect: ConnectLike, config: (FeishuConfig | null) | undefined, ctx: Context, options?: FeishuRegisterOptions): void; /** * Compatibility shell for the old split-plugin registration path (when `connect` * is an already-active, separate plugin). The merged entry calls `register` * directly instead, because `ctx.get("connect")` returns undefined inside this * plugin's own `apply`. */ export declare function apply(ctx: Context, config?: FeishuConfig | null): void; //# sourceMappingURL=index.d.ts.map