/**
 * The pluggable result-summarizer registry.
 *
 * When a remote operation returns, the bridge wants *one short line* describing
 * what came back — for a log entry, a status header, or a glance in the tool list.
 * Different toolkits want different one-liners: a mail send is best summarized by
 * its recipient, a list endpoint by its row count, a search by its top hit. Rather
 * than bake a tower of `if (toolkit === …)` branches into one formatter, the choice
 * is a lookup: {@link SUMMARIZERS} maps a toolkit slug (or a `prefix:*` glob) to a
 * `(result) => string`, and {@link summarizeResult} picks the most specific match,
 * falling back to a generic compact JSON preview.
 *
 * The default summarizer is the interesting one. It produces a short preview of the
 * payload while **deduping repeated blobs**: large structured responses often carry
 * the same nested object many times (the same author on every row, the same schema
 * on every field), and naively previewing them buries the signal. So the default
 * walks the payload *iteratively* — an explicit stack, never recursion, so a deep or
 * cyclic response can never blow the call stack — content-hashes every object and
 * array it meets, and replaces any repeat with a back-reference to where it first
 * appeared. The result is a compact, de-duplicated sketch of the shape.
 */
import type { RemoteResult } from "../core/port";
/**
 * A function that renders one {@link RemoteResult} into a single human-readable
 * line. Registered against a toolkit slug or a `prefix:*` pattern in
 * {@link SUMMARIZERS} and selected by {@link summarizeResult}.
 */
export type Summarizer = (result: RemoteResult) => string;
/**
 * The toolkit slug a `<toolkit>_<operation>` (or `<toolkit>.<operation>`) tool name
 * implies, lower-cased. Plain names with no separator are returned whole. This is
 * what {@link summarizeResult} keys the registry lookup on.
 */
export declare function toolkitOf(toolName: string): string;
/**
 * The fallback summarizer used when no toolkit-specific entry matches.
 *
 * A failure renders as its error line; a success renders as a deduped JSON preview
 * of its payload (see {@link previewPayload}). The line is always length-clamped.
 */
export declare function defaultSummarizer(result: RemoteResult): string;
/**
 * The summarizer registry: toolkit slug (or `prefix:*` glob) → {@link Summarizer}.
 *
 * Exact slugs win over globs, and globs win over the built-in default. Entries are
 * added here (or at runtime via the exported map) to teach the bridge how to phrase
 * a given product's results. The starter rows below are illustrative, declarative
 * data — extend the table, don't fork the formatter.
 */
export declare const SUMMARIZERS: Map<string, Summarizer>;
/**
 * Summarize one operation's result in a single line.
 *
 * Selection is most-specific-first: an exact toolkit-slug entry, then a `prefix:*`
 * glob whose prefix the slug starts with (longest prefix wins), then the built-in
 * {@link defaultSummarizer}. The chosen summarizer is handed the raw result.
 */
export declare function summarizeResult(toolName: string, result: RemoteResult): string;
