/** * @fileoverview Shared output pieces for CDE `type=totals` breakdown tools: the scope/window echo, * category-count map schemas, markdown count tables and number cells, the all-zero and all-null * checks, the all-zero notice, and the code-to-label listing that makes an opaque selector enum * readable in its description. * @module mcp-server/tools/cde-totals */ import { z } from '@cyanheads/mcp-ts-core'; import type { ResolvedScopedRange } from './cde-scoped-range.js'; import type { CdeScope } from '../../services/fbi-api/types.js'; /** Category label to count; null means CDE sent no value, never zero. */ export type CountMap = Record; /** Output fields echoing the applied scope, normalized identifier, and summed window. */ export declare const scopeEchoFields: { scope: z.ZodEnum<{ agency: "agency"; national: "national"; state: "state"; }>; state_abbr: z.ZodOptional; ori: z.ZodOptional; from: z.ZodString; to: z.ZodString; }; /** The echo fields for a resolved range, carrying only the identifier its scope uses. */ export declare function scopeEcho(range: ResolvedScopedRange): { scope: "agency" | "national" | "state"; state_abbr?: string; ori?: string; from: string; to: string; }; /** Output schema for one CDE dimension: every category CDE sent, zeros and nulls as sent. */ export declare function countMap(description: string): z.ZodRecord>; /** `"11 Anti-White; 12 …"` — every code with its label, for a selector's `.describe()`. */ export declare function codeListing(labels: Readonly>): string; /** A table cell for a number CDE may not have sent: en-US digits, or `—` for null. */ export declare const formatNumber: (value: number | null) => string; /** {@link formatNumber} for a percentage. */ export declare const formatPercent: (value: number | null) => string; /** `the nation`, `state TX`, or `agency CA0010400`, for no-data messages. */ export declare function scopeLabel(range: CdeScope): string; /** Escape CDE-authored text for markdown; structured output keeps it verbatim. */ export declare function escapeMarkdown(text: string): string; /** The scope fields of any tool output, whether its `scope` is an enum or a plain string. */ interface ScopeEcho { ori?: string | undefined; scope: string; state_abbr?: string | undefined; } /** Heading suffix for a scope: `National`, the state abbreviation, or `ORI: …`. */ export declare function scopeHeading(echo: ScopeEcho): string; /** `**Scope:** state | **State:** TX` — the scope line every breakdown format opens with. */ export declare function scopeLine(echo: ScopeEcho): string; /** One markdown table for a dimension: every category in CDE's order, null rendered `—`. */ export declare function countTable(heading: string, counts: CountMap): string[]; /** True when the maps hold at least one count and every count is exactly zero. */ export declare function allCountsZero(maps: readonly CountMap[]): boolean; /** True when the maps hold at least one count and every count is null. */ export declare function allCountsNull(maps: readonly CountMap[]): boolean; /** * What CDE's `type=counts` view says about the scoped state or ORI: `unchecked` when the counts * view was not requested, `unrecognized` when it names no series for the identifier, `unreported` * when it names one but no month of the window has a participating population. */ export type IdentifierCheck = 'unchecked' | 'recognized' | 'unreported' | 'unrecognized'; /** * Notice for an all-zero payload. Below national scope the totals view alone cannot tell no * reports from an unknown identifier; the counts view's {@link IdentifierCheck} settles it. */ export declare function zeroCountsNotice(scope: ResolvedScopedRange['scope'], check: IdentifierCheck): string; export {}; //# sourceMappingURL=cde-totals.d.ts.map