/** * Filter for an in-process agent's final turn text before it is posted to a * person (chat, Slack DM). * * Incident 2026-09-26 (owner's Slack DM with the orchestrator): after each * turn the owner got an English meta report — "I've sent the reply. Here's * my status: *What the user asked* … *What I did* … *Next step* … *Note on * the ticket instruction*". Several turns in a row had made no tool call at * all and still said "I generated a fresh link and sent it via reply-chat": * nothing had been sent. Both kinds of text are noise at best and false at * worst, so they are not posted: * * - {@link isMetaStatusReport}: the text reports on the turn instead of * answering ("Here's my status", or self-referential section headers such * as "What I did" plus another report header). * - {@link claimsSentReply} with no reply tool call in the turn: the text * says a reply / link was sent to the person, but nothing sent one. Text * that carries a URL itself is kept — posting it delivers what it claims. * * A genuine answer — even one mentioning "next steps" or "I sent the task * to Joe" — passes. * * @module utils/agent-reply-filter */ /** The slice of a tool call record the filter reads. */ export interface TurnToolCall { toolName: string; args?: Record; } /** Why a turn's text was not posted. */ export type SuppressedReplyReason = 'meta_status_report' | 'unsent_reply_claim'; /** Result of {@link filterAgentTurnReply}. */ export interface FilteredTurnReply { /** Text to post ('' when suppressed) */ text: string; /** Why it was suppressed, or null when it passes */ suppressed: SuppressedReplyReason | null; } /** * Whether a tool call sent a reply to a person. * * @param call - Tool call record * @returns True for a reply tool, or a shell call that runs a reply skill */ export declare function isReplyToolCall(call: TurnToolCall): boolean; /** * Whether a text is a report on the turn rather than an answer. * * @param text - Final turn text * @returns True for "Here's my status" openers, or a self-report header plus * at least one more report header * * @example * ```ts * isMetaStatusReport("I've sent the reply. Here's my status:\n**What I did:** …"); // true * isMetaStatusReport('部署好了:https://ce.example.com'); // false * ``` */ export declare function isMetaStatusReport(text: string): boolean; /** * Whether a text claims a reply, link or message was sent to the person. * * @param text - Final turn text * @returns True for "I've sent the link", "The link has been sent", 「链接已经发给你了」 … */ export declare function claimsSentReply(text: string): boolean; /** * Decide whether an in-process agent's final text may be posted. * * @param text - Final turn text (already stripped of tool-call markup) * @param toolCalls - The turn's tool calls * @returns The text to post, or '' with the reason it was suppressed */ export declare function filterAgentTurnReply(text: string, toolCalls: readonly TurnToolCall[] | undefined): FilteredTurnReply; //# sourceMappingURL=agent-reply-filter.utils.d.ts.map