import { type MessageListenerConfig } from '../bot-registry.js'; export type MessageListenerUpdate = { enabled: boolean; name?: string; replyCardTitle?: string; workingDir?: string; prompt: string; senderPolicy?: MessageListenerConfig['senderPolicy']; messagePolicy?: MessageListenerConfig['messagePolicy']; }; export declare function sanitizeMessageListenerUpdate(raw: unknown): MessageListenerUpdate | undefined; export declare function validateMessageListenerUpdate(update: MessageListenerUpdate | undefined): { ok: true; } | { ok: false; reason: string; }; export declare function getMessageListenerConfig(larkAppId: string, chatId: string): MessageListenerConfig | null; /** * Build the persisted config for a listener update, or `null` when the update * carries nothing worth keeping (→ delete the entry). * * A DISABLED listener with a non-empty prompt is a valid *draft*: it is * persisted with `enabled:false` so the operator can turn it on later without * retyping. Previously any disabled update was collapsed to `null` (deleted * outright), so a draft saved while the toggle was off vanished on the next * reload — the exact bug this fixes. Only a disabled update with a BLANK prompt * is a true clear (this is also what the DELETE route sends: `{enabled:false, * prompt:''}`). Enabled updates always carry a prompt * (validateMessageListenerUpdate guarantees it), so they always build a config. * * Runtime is unaffected by a persisted draft: findMessageListenerForChat and * enabledMessageListenerChatIds both require `enabled===true`, so an off draft * never matches messages — it only survives for the dashboard editor. */ export declare function messageListenerConfigFromUpdate(patch: MessageListenerUpdate): MessageListenerConfig | null; export declare function updateMessageListenerConfig(larkAppId: string, chatId: string, patch: MessageListenerUpdate): Promise<{ ok: true; listener: MessageListenerConfig | null; } | { ok: false; reason: string; }>; //# sourceMappingURL=message-listener-store.d.ts.map