import type { OutputStream } from '../platform/index.js'; import type { AgentResult } from '../core/types/agent-types.js'; import type { ContinuationSink } from '../agent-adapter/types.js'; export interface ContinuationSinkDeps { /** The originating turn's OutputStream — continuation text is appended here so the * follow-up merges into the same reply (looks like one turn). */ stream: OutputStream; /** Called when the continuation result still has background tasks pending (chained * tasks): keep the status in a waiting state with the remaining count. */ onWaiting: (pendingCount: number) => void; /** Called when no background tasks remain: seal the status as complete, record the * continuation's cost, and clear the streaming callback + sink. */ onComplete: (result: AgentResult) => void; } /** * Build the session-level continuation sink. Pure dispatch: assistant text is merged * into the originating reply via the shared OutputStream; the terminating result either * holds the waiting status (tasks still pending) or completes the turn (none remain). * Heavy side effects (seal / cost / clear) are injected via onWaiting / onComplete. */ export declare function buildContinuationSink(deps: ContinuationSinkDeps): ContinuationSink; /** Feature gate: background-task continuation is ON by default. Opt out by setting * CORTEX_BG_CONTINUATION to a falsy value (0 / false / off / no). */ export declare function isBgContinuationEnabled(): boolean; /** Scope gate: only interactive user conduits (Slack / Feishu), never thread/dispatch. */ export declare function isInteractiveChannel(channel: string): boolean;