/** * @fileoverview Framing helpers for upstream-controlled free text rendered into * `content[]` markdown. Socrata dataset names, descriptions, column descriptions, * and row values are portal-author-controlled — these helpers give them an * explicit data boundary (labeled blockquotes, escaped table cells, breakout-proof * JSON fences) so upstream text reads as quoted data, never as instructions. * `structuredContent` is untouched — framing applies only to the rendered twin. * @module mcp-server/tools/upstream-text */ /** Character cap for a blockquoted dataset description. */ export declare const UPSTREAM_BLOCK_MAX_CHARS = 2000; /** Character cap for a table-cell description. */ export declare const UPSTREAM_CELL_MAX_CHARS = 400; /** Character cap for an inline-rendered name. */ export declare const UPSTREAM_INLINE_MAX_CHARS = 200; /** * Render upstream text as inline data: whitespace runs (including newlines) * collapse to single spaces so the value cannot break out of its line, then * truncate. Use for names and other short fields interpolated into prose. */ export declare function inlineUpstream(text: string, maxChars?: number): string; /** * Escape upstream text for a markdown table cell: newlines collapse to spaces * (a raw newline ends the row), and backslashes then pipes are backslash-escaped * (a raw pipe splits the cell; GFM pairs `\` with the following character during * cell splitting, so an upstream `\|` would otherwise re-arm the pipe as a * delimiter). Optionally truncates long cell content. */ export declare function escapeTableCell(value: string, maxChars?: number): string; /** * Frame upstream free text as a labeled blockquote — the data boundary for * multi-line descriptions. Normalizes CRLF, truncates, and prefixes every line * with `> ` so the whole block reads as quoted upstream data. */ export declare function upstreamBlockquote(label: string, text: string, maxChars?: number): string[]; /** * Wrap a JSON payload in a fenced code block whose fence is always longer than * any backtick run inside the payload, so upstream values containing ``` cannot * break out of the fence. */ export declare function fencedJson(payload: string): string[]; //# sourceMappingURL=upstream-text.d.ts.map