/** * Plain-text formatter for `aft_zoom` responses. * * Both @cortexkit/aft-opencode and @cortexkit/aft-pi consume the same Rust * zoom command response shape — keep one formatter so both hosts produce * byte-identical output. * * The previous output was JSON.stringify of the raw response, which left * the agent decoding `\n` and `\"` escapes to read the source. The new * format inlines content with line numbers and only renders annotation * sections when non-empty. * * Output shape (single symbol): * * src/foo.ts:8-43 [function resolveParentContext] * * 5: import { resolveMessageContext } from "..."; * 6: import { getSessionAgent } from "..."; * 7: * 8: export async function resolveParentContext( * 9: ctx: ToolContextWithMetadata, * ... * 43: } * * ──── calls_out * resolveMessageContext (line 13) * getSessionAgent (line 16) * * ──── called_by * handleTaskRequest (line 87) * * Annotation sections are omitted when empty. Context-before/after lines are * included when present (their line numbers continue the gutter). */ interface RangeShape { start_line: number; end_line: number; start_col?: number; end_col?: number; } interface CallRefShape { name: string; line: number; extra_count?: number; } interface AnnotationsShape { calls_out?: CallRefShape[]; called_by?: CallRefShape[]; } /** * Subset of the Rust ZoomResponse shape this formatter cares about. Extra * fields (id, command, success, ...) are ignored. */ export interface ZoomResponseLike { name?: string; kind?: string; range?: RangeShape; content?: string; context_before?: string[]; context_after?: string[]; annotations?: AnnotationsShape; } /** * Format a single Rust zoom response as plain text. * * `targetLabel` is what the agent passed in (filePath or url) — used for the * header. Avoids leaking internal cache paths when the agent zoomed into a URL. */ export declare function formatZoomText(targetLabel: string, response: ZoomResponseLike): string; /** * Per-target entry for {@link formatZoomMultiTargetResult}. * * `targetLabel` is what the agent passed in (filePath or url) and is used for * the per-section header. * `name` is the symbol the agent asked for (used in the failure-line wording). * `response` is the Rust zoom response (may be `success: false` on failure). */ export interface ZoomMultiTargetEntry { targetLabel: string; name: string; response: { success?: boolean; message?: unknown; } & Record; } /** Single rendered entry from a multi-target zoom call. */ export interface ZoomMultiTargetSymbolResult { targetLabel: string; name: string; success: boolean; content?: string; error?: string; } /** Aggregate result of a multi-target zoom call. */ export interface ZoomMultiTargetResult { complete: boolean; entries: ZoomMultiTargetSymbolResult[]; text: string; } /** * Format multi-target zoom results as plain text. Each successful entry uses * {@link formatZoomText} with its OWN `targetLabel` (so cross-file batches * still show the right file path in each section). Failures render as * `Symbol "name" not found in : `. * * Sections are blank-line separated and output is byte-identical across hosts. */ export declare function formatZoomMultiTargetResult(entries: ZoomMultiTargetEntry[]): ZoomMultiTargetResult; /** One entry in a Rust-side multi-symbol zoom batch (`zoom_batch_symbols`). */ export interface RustZoomBatchEntry { name: string; response: { success?: boolean; message?: unknown; } & Record; } /** * True when the bridge returned the Rust batch envelope from a single zoom request * (e.g. whitespace-split `symbol` on a code file). */ export declare function isRustZoomBatchEnvelope(response: Record): response is Record & { symbols: RustZoomBatchEntry[]; }; /** * Unwrap a Rust batch envelope into parallel name/response arrays for * {@link formatZoomBatchResult} (plugin-local) or the same shaping in hosts. */ export declare function unwrapRustZoomBatchEnvelope(response: Record): { names: string[]; responses: Record[]; } | null; export {}; //# sourceMappingURL=zoom-format.d.ts.map