/** * Child session backfill from SDK messages. * * Extracted from EventCapture to reduce module size and enable independent * testing. Handles backfilling turns and lastMessage from OpenCode SDK * messages when a child session completes. * * @module session-tracker/capture/child-backfiller */ import type { OpenCodeClient } from "../../../shared/session-api.js"; import type { ChildWriter } from "../persistence/child-writer.js"; /** * Dependencies for child session backfill operations. */ export interface ChildBackfillerDeps { client: OpenCodeClient; childWriter: ChildWriter; } /** * Handles backfilling turns and lastMessage from OpenCode SDK messages * when a child session completes. * * This is a pure utility class with no mutable state — safe to share * across concurrent child session completions (up to 10 parallel children). */ export declare class ChildBackfiller { private client; private childWriter; constructor(deps: ChildBackfillerDeps); /** * Backfills turns from SDK messages for a completed child session. * * Called from session.idle, session.deleted, and session.error handlers * when the completed session is a child (has parentID). The backfill is * fire-and-forget — errors are logged, never thrown. * * @param parentID - The parent session ID. * @param childSessionID - The completed child session ID. */ backfillChildTurnsFromSdk(parentID: string, childSessionID: string): Promise; /** * Extracts the role from an SDK message object. * Handles both `{ info: { role } }` and `{ role }` shapes. */ messageRole(message: unknown): string | undefined; /** * Extracts text content from an SDK message's parts array. * Handles text parts, thinking parts (optional), and tool-only fallback. */ extractTextFromSdkMessage(message: unknown, includeThinking?: boolean): string | undefined; } //# sourceMappingURL=child-backfiller.d.ts.map