/** * context.ts — Extract parent conversation context for subagent inheritance. */ import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; /** * Extract plain text from a message content block array. * * Filters for objects with `type: "text"` and joins their `text` fields. * Non-text blocks (images, tool calls, etc.) are silently skipped. * * Single-pass loop instead of `.filter().map().join("\n")` — avoids * 3 intermediate array allocations per call. Called once per assistant * message in `buildParentContext`, so for a 200-message conversation * that's 200 × 3 = 600 fewer intermediate arrays. * * @param content - Array of message content blocks (typically from assistant messages) * @returns Concatenated text of all text blocks, joined by newlines */ export declare function extractText(content: unknown[]): string; /** * Build a text representation of the parent conversation context. * Used when inherit_context is true to give the subagent visibility * into what has been discussed/done so far. */ export declare function buildParentContext(ctx: ExtensionContext): string;