/** * Board injection subsystem for task session manager. * * Handles injecting Background Job Board state into the message stream * and processing synthetic injected completions. * * All injection logic must go through the cache-safe helpers in * ../cache-safe-injection.ts to ensure prompt cache safety. */ import type { BackgroundJobRecord, BackgroundJobStore, ContextFile } from '../../utils'; import type { MessagePart, MessageWithParts } from '../types'; export declare const BACKGROUND_JOB_BOARD_METADATA_KEY = "oh-my-opencode-slim.backgroundJobBoard"; export declare const MAX_PROCESSED_INJECTED_COMPLETIONS = 500; type RetainedBoardSnapshot = { anchorKey: string; id: string; text: string; }; export type RetainedBoardSnapshotState = { snapshots: RetainedBoardSnapshot[]; nextSnapshotSequence: number; realMessageCount: number; firstRealMessageAnchorKey?: string; }; export interface InjectionState { backgroundJobBoard: BackgroundJobStore; strategy: 'latest' | 'checkpoint-compatible'; processedInjectedCompletions: Set; processedInjectedCompletionOrder: string[]; terminalJobsInjectedByParent: Map>; maxProcessedInjectedCompletions: number; metadataKey: string; shouldManageSession: (sessionID: string) => boolean; taskContextTracker: { pendingManagedTaskIds: Set; contextFilesForPrompt(taskId: string): ContextFile[]; prune(board: { taskIDs(): Set; }): void; }; retainedBoardSnapshots: Map; } export declare function updateFromInjectedCompletion(state: InjectionState, part: MessagePart, message: MessageWithParts, _messageIndex: number, partIndex: number): BackgroundJobRecord | undefined; export declare function rememberProcessedInjectedCompletion(state: InjectionState, signature: string): void; export declare function isMissingRememberedSessionError(output: string): boolean; export declare function rememberInjectedTerminalJobs(state: InjectionState, parentSessionID: string): void; export declare function reconcileInjectedTerminalJobs(state: InjectionState, parentSessionID: string): void; export declare function injectBackgroundJobBoard(state: InjectionState, _input: Record, output: { messages?: unknown; }): Promise; export {};