/** * Auto-forward of an agent's final assistant text (narrow safety net). * * Agents frequently write a substantive answer as plain assistant text and then * call remote_copilot_wait_for_instructions to go idle — WITHOUT ever calling an * operator-facing send tool (report_progress / send_voice / send_file / * send_sticker / send_message_to_thread). That plain text goes to the Claude * CLI's stdout log, which the operator never sees, so the agent appears silent. * * This module reads the agent's stdout log (stream-json, written by the spawn in * claude-spawn.service.ts) and, when a turn ended with NO operator-facing send, * forwards the final assistant text to the operator's Telegram topic. * * The stdout log is tailed by byte offset, so each boundary only sees the bytes * appended during the just-ended turn. Guards (minimize false positives): * - Never in autonomous mode (no operator attached). * - Only when zero operator-facing sends happened during the just-ended turn. * - Only when there is genuine non-trivial final assistant text in that slice. */ import type { TelegramClient } from "../../services/telegram.js"; /** * If the just-ended turn produced final assistant text but no operator-facing * send, forward that text to the operator's Telegram topic. * * @param operatorSendsThisTurn number of operator-facing sends during the turn. * @param autonomousMode true when no operator is attached (skip entirely). * Returns true if a message was forwarded, false otherwise. */ export declare function maybeAutoForwardFinalText(opts: { threadId: number; telegram: TelegramClient; telegramChatId: string; operatorSendsThisTurn: number; autonomousMode: boolean; }): Promise; //# sourceMappingURL=auto-forward.d.ts.map