import type { Destination, PlatformAdapter, MessageRef, IncomingAttachment, RichBlock, OutputStream } from '../platform/index.js'; import type { AgentResult } from '../core/types/agent-types.js'; import type { ExecutionRecord } from '../domain/executions/registry.js'; export { computeElapsed, formatMetricsSuffix, buildSessionTag, buildUserProcessingMessage } from '../core/status-format.js'; /** Feature gate: the "New (quiet)" status button (=!newq, skips the pre-close hook) * is OFF by default. Opt in with CORTEX_STATUS_NEWQ_BUTTON = 1/true/on/yes. */ export declare function isStatusNewqButtonEnabled(): boolean; export declare function resolveExecutionProject({ execution, fallbackMessage }: { execution: ExecutionRecord | null; fallbackMessage: string; }): string; export declare function buildExecutionStatusReport(): string; export declare function finalizeLocalExecution({ executionId, status, result, error, durationS }: { executionId: string | null; status: string; result?: AgentResult | null; error?: { message: string; cancelled?: boolean; } | null; durationS: number; }): ExecutionRecord | null; export declare function makeFallbackNotifier(channel: string, statusMsg: MessageRef | null, adapter: PlatformAdapter): (fromConfig: { model: string; mode?: string; }, toConfig: { model: string; mode?: string; }) => Promise; export declare function runAutoCompoundForScheduledTask({ baseResult, channel, profileName, project, trigger, onAssistantMessage }: { baseResult: AgentResult; channel: string; profileName: string | null; project?: string; trigger?: string; onAssistantMessage?: ((text: string) => void) | null; }): Promise; /** Build a streaming callback that aggregates assistant messages via OutputStream. */ export declare function makeStreamingMessageCallback(adapter: PlatformAdapter, destination: Destination, threadAnchorId?: string | null, onMessagePosted?: ((ref: MessageRef) => void) | null, durable?: import('../platform/types.js').DurableHooks | null): ((text: string) => void) & { stream: OutputStream; }; /** Extract text content from forwarded messages (attachments marked isForwarded by the platform adapter). */ export declare function extractForwardedContent(message: { attachments?: IncomingAttachment[]; }): string | null; export interface StatusBlocksTemplate { channel: string; sessionName: string | null; isDm: boolean; threadId?: string | null; /** Execution-scoped Cancel target for the conversation path (plain user messages that * are no longer wrapped in a thread). When set, the Cancel handler resolves the running * execution via executionId instead of threadId. */ executionId?: string | null; } /** Build richBlocks for the initial "Processing" message (Cancel button included). */ export declare function buildStatusActionBlocks(text: string, template: StatusBlocksTemplate): RichBlock[]; /** Build richBlocks for the sealed message (Cancel button removed). */ export declare function buildSealedStatusActionBlocks(text: string, template: StatusBlocksTemplate): RichBlock[]; /** Store the blocks template for a status message so writeStatus can regenerate richBlocks * with updated text while preserving buttons. */ export declare function initStatusBlocks(ref: MessageRef, template: StatusBlocksTemplate): void; /** * Serialized status update. Drops silently if statusMsg has been sealed. * Regenerates richBlocks from the stored template so buttons persist alongside updated text. * Returns a promise that resolves when this write has landed (or was dropped); * call sites generally ignore it, but tests can await. */ export declare function writeStatus(adapter: PlatformAdapter, ref: MessageRef, text: string): Promise; /** Awaits in-flight writeStatus calls, writes final text, then blocks further writes to this statusMsg. * Uses durable delivery when OutboundQueue is available to survive restarts. */ export declare function sealStatus(adapter: PlatformAdapter, ref: MessageRef, text: string, richBlocks?: RichBlock[]): Promise;