@sema-agent/core
Version:
Stateless, task-oriented AI agent core
26 lines (25 loc) • 1.42 kB
TypeScript
/**
* The `tool_end` output/structured projection, verbatim from
* `runtask.ts`'s runLocked R4 phase. Pure functions over the harness `AgentToolResult`: zero closure
* state, zero runtask coupling — the ONLY module-level input is the size cap below. Event-sequence
* snapshot pin (recorded before/after the move, byte-equal) guards the projection semantics.
*/
export declare const toolOutputFrom: (result: unknown) => {
output: unknown;
truncated: boolean;
totalChars?: number;
} | undefined;
/** The `tool_end.structured` projection over a harness tool result: the CC card when `details.type` names a card
* the leg admits, else undefined. Minted per leg by {@link createStructuredProjector}; every body projection takes it
* as a parameter — there is no module-level card set to fall back to. */
export type StructuredProjector = (result: unknown) => unknown;
/**
* L4's run-time half: a per-leg projector — the engine card set plus the leg's declared
* caller cards — that DROPS an undeclared `details.type` and announces it ONCE per leg
* (`config.tool_card_undeclared`, audience operator). With no options it is the engine set alone, unannounced —
* the shape a caller outside a leg (a test, a fixture) uses.
*/
export declare function createStructuredProjector(opts?: {
declaredCards?: Iterable<string>;
onUndeclared?: (type: string) => void;
}): StructuredProjector;