@sema-agent/core
Version:
Stateless, task-oriented AI agent core
17 lines (16 loc) • 1.5 kB
TypeScript
import { callerText, dataKind } from "@sema-agent/primitives";
export { callerText, dataKind };
/** The most characters of a member name a sentence prints ({@link callerKey}), escapes counted; a longer name is cut and its size said. */
export declare const CALLER_KEY_MAX = 80;
/**
* THE one shape the name of a member a door does not take has in a judge's sentence (author (a') of {@link callerText}): the name as
* the caller wrote it, JSON-quoted, on one line and at most {@link CALLER_KEY_MAX} characters of the name between the quotes, JSON escapes
* counted (a name of backslashes is cut where its escaped spelling reaches the bound), the truncation mark a cut adds coming after them. The line is the sanitized echo's fold
* ({@link inlineUntrusted}: control, format and separator characters become one space, an envelope tag is defused); a cut ends in the
* truncation mark; and when what is shown is not the whole name — folded, defused or cut — its size in UTF-16 units follows it
* (`"zz…" (200 UTF-16 units)`). A symbol key is `Symbol("<description>")`, the description quoted, folded and cut by the same function (a `)`
* in it cannot close the parenthesis: it sits inside the quotes). A key that is neither a string nor a symbol is named by its kind
* ({@link dataKind}). The work is bounded by {@link CALLER_KEY_READ}, whatever the size of the name; the function throws for no input and
* spells no value.
*/
export declare function callerKey(key: unknown): string;