@sema-agent/core
Version:
Stateless, task-oriented AI agent core
82 lines (81 loc) • 2.67 kB
TypeScript
import type { BandId, OverlayOp } from "./catalog/schema.js";
/** A `prompt.assembled` manifest (v3) as explain reads it: the frame's own members. */
export interface ExplainInput {
identity: {
artifact: string;
layers: {
center?: string;
deploy?: string;
task?: string;
};
epoch: number;
activatedBy: string;
};
selectors: {
binding?: string;
traits: readonly string[];
host: {
role: string;
form: string;
};
};
blocks: ReadonlyArray<{
id: string;
chars: number;
hash: string;
}>;
sections: ReadonlyArray<{
id: string;
band: string;
variant?: string;
chars: number;
locale: string;
contentHash: string;
chain: ReadonlyArray<{
source: string;
overlay?: string;
op?: string;
superseded?: true;
}>;
}>;
superseded?: ReadonlyArray<{
id: string;
source: string;
by: string;
target: string;
supersededBy: string;
}>;
tools?: ReadonlyArray<{
wireName: string;
contractId: string;
cardId: string;
shapeDigest: string;
}>;
}
/** Render a `prompt.assembled` manifest as a readable report: which prompt (identity, its layers, the selector values),
* what composed it, and where each section's text came from. */
export declare function explainPromptAssembly(input: ExplainInput): string;
/**
* The CENTER-facing read-only description of the bundled catalog: each section's id, band, rank and what each overlay
* source class may do to it (the band's three op columns — a center editor reads `ops.center`; an empty column for
* every class is a platform-managed section), plus the default role-base TEXT (the append-mode compile skeleton the web
* UI prepends to a user's "Role details"). No other section texts. Programmatic — a static copy in the web tier would
* drift the moment the catalog changes.
*/
export interface CatalogDescription {
catalogId: string;
/** The catalog-default role base (append-mode skeleton). */
roleBaseText: string;
sections: Array<{
id: string;
band: BandId;
rank: number;
/** The band's op columns: what a center artifact, a deployment's mods and a task may do to this section. */
ops: {
center: readonly OverlayOp[];
deploy: readonly OverlayOp[];
task: readonly OverlayOp[];
};
}>;
}
export declare function describeCatalog(): CatalogDescription;