@sema-agent/core
Version:
Stateless, task-oriented AI agent core
19 lines (18 loc) • 1.4 kB
TypeScript
/**
* The approval card's display sanitizer and size bound — one reading for every value the engine hands an approval
* surface as display metadata: the tool's approval preview at the card's mint, and the card's question as the parked
* row keeps it. A leaf: it imports nothing, so the gate lane and the park twin read the same rule.
*
* Every string leaf is model-, tool- or policy-authored and flows to approval UIs: control characters (terminal
* escapes, CR; `\n` and `\t` kept for legible multi-line detail) become U+2400 here, so no lane forwards a raw escape
* sequence. Markdown / content semantics stay the renderer's contextual-escaping job; these values are advisory and
* never adjudication input.
*/
/** The serialized-size bound (JSON characters) past which a display value is replaced by a truncation account. */
export declare const APPROVAL_DISPLAY_MAX_CHARS = 16384;
/** Neutralize control characters in every string leaf (keys included); a value nested deeper than six levels is
* dropped. Non-string scalars pass unchanged. */
export declare const sanitizeApprovalDisplay: (node: unknown, depth?: number) => unknown;
/** The card's question as a parked row keeps it: sanitized, and past the bound replaced by an account naming the
* size. A non-string or empty value keeps nothing. */
export declare function approvalMessageOf(message: unknown): string | undefined;