/** * @fileoverview Payload shaping for itemized Schedule A/B/E rows. OpenFEC embeds * a full ~40-field committee object in every row; when the query is scoped to a * single committee that object is identical across the page, so it is hoisted * out once instead of being shipped per row. * @module src/mcp-server/tools/definitions/utils/trim-schedule-row */ import { z } from '@cyanheads/mcp-ts-core'; export interface TrimScheduleRowsOptions { /** Row keys to delete outright — sub-objects fully covered by a flat field. */ drop?: readonly string[]; /** * Whether the caller scoped the query to one committee_id. Hoisting is only * correct then — an unscoped Schedule E query spans several committees, and * lifting one of them to the top level would misattribute the other rows. */ hoistCommittee: boolean; } export interface TrimmedSchedulePage { /** The shared committee, present only when it was hoisted out of every row. */ committee?: Record; results: Record[]; } /** * Hoist the shared committee object out of itemized schedule rows and drop * duplicated sub-objects. The hoist requires both a single-committee query * scope and agreement across the returned rows; when either fails the rows are * returned with their own committee object intact. */ export declare function trimScheduleRows(rows: readonly Record[], options: TrimScheduleRowsOptions): TrimmedSchedulePage; /** Reusable output field for the hoisted committee. */ export declare const HoistedCommitteeSchema: z.ZodOptional>; /** Render the hoisted committee as a short header block for format(). */ export declare function formatHoistedCommittee(committee: Record | undefined): string[]; //# sourceMappingURL=trim-schedule-row.d.ts.map