/**
 * WikiChatSubscriberService — listens on chat-v2's `chat_message` event
 * and fires `WikiIngestService.ingest` for every user-authored message.
 *
 * Phase A (rules-only routing):
 *   senderType === 'user' → ingest into the Crewly project vault.
 *   senderType === 'agent' | 'system' → skip.
 *
 * Phase B (per spec §4.5) will replace the project-only routing with an
 * LLM-driven gate that picks team / project / global per source.
 *
 * Failure mode is FIRE-AND-FORGET: a malformed message, missing schema,
 * or filesystem error MUST NOT block the live chat flow. Errors are
 * logged at warn-level and swallowed.
 *
 * @module services/wiki/wiki-chat-subscriber.service
 */
import type { ChatV2Service } from '../chat-v2/chat-v2.service.js';
import { WikiIngestService } from './wiki-ingest.service.js';
/**
 * Shape we consume from chat-v2's `chat_message` payload. Kept narrow so
 * we don't take a heavy structural dep on the wire DTO; matches the
 * fields produced by `toMessageDTO` (chat-v2.service.ts:1537).
 */
interface MinimalChatMessageDTO {
    id: string;
    channelId: string;
    senderType: 'user' | 'agent' | 'system';
    senderId: string;
    content: string;
    contentType: string;
    createdAt: string | number;
}
export interface WikiChatSubscriberOptions {
    /** chat-v2 singleton — `getChatV2Service()` at composition root. */
    chatService: ChatV2Service;
    /** Absolute path to the project vault. Default falls back to env / well-known location. */
    projectVaultPath?: string;
    /** Optional override for tests. */
    ingestService?: WikiIngestService;
}
/**
 * Process-singleton subscriber. Call `start()` once at server boot,
 * `stop()` at shutdown.
 */
export declare class WikiChatSubscriberService {
    private readonly logger;
    private readonly chatService;
    private readonly projectVaultPath;
    private readonly ingestService;
    private boundHandler;
    private started;
    constructor(opts: WikiChatSubscriberOptions);
    /**
     * Subscribe to `chat_message`. Idempotent — calling start() twice
     * leaves a single listener.
     */
    start(): void;
    /** Detach. Safe to call when not started. */
    stop(): void;
    /**
     * Handle a single chat message. Public for tests.
     */
    handle(dto: MinimalChatMessageDTO): Promise<void>;
    /**
     * Decide whether a chat-v2 message should drive a wiki write.
     * Public for tests; logic is conservative — only ingest user-authored
     * text messages, skip agents/system, mentions-only pings, and slash
     * commands.
     */
    isIngestable(dto: MinimalChatMessageDTO): boolean;
}
export {};
//# sourceMappingURL=wiki-chat-subscriber.service.d.ts.map