export interface BridgeNoticeApi { addComment(dto: { taskId?: string; documentId?: string; whiteboardId?: string; body: string; clientRequestId?: string; }): Promise; } export type NoticeOutcome = 'posted' | 'collapsed' | 'failed'; export interface PostNoticeOpts { api: BridgeNoticeApi | null | undefined; /** * STABLE identity of the logical notice. Examples: * `working-on-task:` | `working-on-plan:` * `git-unavailable::::` * `work-stopped::` */ noticeKey: string; body: string; scope?: { taskId?: string; documentId?: string; whiteboardId?: string; }; log?: (message: string) => void; } export declare function noticeClientRequestId(noticeKey: string): string; /** * Post a notification exactly once per `noticeKey`. * * Never throws: a notification failing must never fail the run that produced it, * because the run's actual work is already done or already doomed. But it is * ALWAYS reported - the caller decides whether a failure deserves a diagnostic, * and silence is what let eight duplicates go unnoticed. */ export declare function postBridgeNotice(opts: PostNoticeOpts): Promise; /** * A one-shot key for "something happened once, ever, for this subject". * * Used where a notice must never repeat even across separate runs - a stop * notice for one stopped tree, for instance. Distinct from a plain stable key: * this one is for notices where a SECOND occurrence would itself be the bug. */ export declare function oneShotKey(...parts: Array): string; /** Random suffix, for the rare case where a notice is genuinely per-attempt. */ export declare function perAttemptKey(prefix: string): string; /** * Identity for the "could not start this task" notice (2026-10-22). * * The old key ended in `reason.slice(0, 60)`, which is IDENTICAL on every * retry of the same stuck tree - so the second, third and fourth human * "retry" all collapsed into the first comment and the task looked dead. * The triggering mention/comment/message is the per-attempt identity: one * human comment is one AgentMention, so a NEW comment gets a NEW answer, * while redeliveries of the SAME wake keep collapsing onto the one row. * Wakes with no mention identity at all (a bare task.run press) keep the * old reason-sliced key, because there duplicate deliveries of one press * are the common case and must still collapse. */ export declare function isolationNoticeKey(parts: { agentId: string; projectId: string; taskId: string; mentionId?: string | null; commentId?: string; messageId?: string; reason: string; }): string; /** * Acknowledgement bodies, shared so every surface says the same thing and so a * change is one edit rather than five (2026-10). */ export declare const WORKING_ON_TASK_BODY = "Working on this task - I'll reply when done."; export declare const WORKING_ON_PLAN_BODY = "Working on the plan for this task - I'll reply when done."; export declare const WORKING_ON_DOC_BODY = "Working on this - I'll reply when done."; export declare const WORKING_ON_BOARD_BODY = "Working on this - I'll reply when done.";