agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
25 lines (24 loc) • 1.66 kB
TypeScript
/** One explicit JSON-answer validation; the runner owns when to invoke it. */
import { type OutputSchemaParser } from './outputSchema.js';
import type { ArtifactScope, ArtifactStore } from '../artifacts/types.js';
import type { AnswerToolCallsView, AnswerCheck, AnswerValidationOptions, AnswerValidationReport, ResolvedAnswerValidation } from './types.js';
/** Validate and snapshot an authored contract once, before running an agent. */
export declare function resolveAnswerValidation<T = unknown>(options: AnswerValidationOptions<T>): ResolvedAnswerValidation;
/**
* Validate once. Content is present only when delivery is permitted by this
* contract. It is the exact JSON string whose detached value was checked;
* callers must not reparse through a transforming schema or rewrite afterward.
*/
export declare function executeAnswerValidation(raw: string, parser: OutputSchemaParser<unknown>, config: ResolvedAnswerValidation, store: ArtifactStore | undefined, scope: ArtifactScope, signal?: AbortSignal, toolCalls?: AnswerToolCallsView,
/**
* Builds the rows of the agent's own checks that `config.agentChecks` lists
* (`agentChecks.ts`) from the candidate this validation delivers: the same
* frozen value the validator receives, and its canonical JSON — the exact
* text that would be delivered. Synchronous library code: a throw, a
* listed check with no builder, or a row that claims `checked-pass` (an
* agent row never verifies) makes the report `unverified` — never a pass.
*/
buildAgentRows?: (candidate: unknown, canonical: string) => readonly AnswerCheck[]): Promise<{
report: AnswerValidationReport;
content?: string;
}>;