@sema-agent/core
Version:
Stateless, task-oriented AI agent core
19 lines (18 loc) • 1.52 kB
TypeScript
import { type CatalogMessage, type PromptCatalog } from "./schema.js";
export declare const SEMA_DEFAULT_CATALOG: PromptCatalog;
/** The digest a locale row binds: the variant text it was written from, in the package's one `sha256:` text form. */
export declare function sourceDigestOf(text: string): string;
/**
* Structural validation (fail loud, never a silent skip): unique message ids and variant ids, unique section ids and
* ranks, every section's band declared, every referenced message present, every renderer known — and every locale's
* rendering in lockstep with the text it renders: the locale set is exactly the catalog's rendered locales; each holds
* one non-blank rendering of every variant of every message and nothing else; each rendering is bound to its variant's
* current text; and it keeps that text's lines — the same count, blank where the source is blank, and line for line the
* same `{{name}}` placeholders (a template renders its sections by line, so a placeholder moved to another line would
* drop a section silently).
*/
export declare function validateCatalog(catalog: PromptCatalog): void;
/** The bundled message with this id (throws on an unknown id — a typo here is an engine defect). */
export declare function catalogMessage(id: string, catalog?: PromptCatalog): CatalogMessage;
/** A bundled message's text: the named variant, else its first. The exported prompt constants read this. */
export declare function catalogText(id: string, variantId?: string): string;