UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

31 lines • 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AnswerValidationError = void 0; /** * An enforcing validation refused delivery; diagnostic metadata only, never * content. Served by a hosting door, it is a refusal, not a failure: HTTP 422 * with code `ERR_ANSWER_VALIDATION` (on a stream, the closing error frame * carries the same code). It withholds the answer only — tools the turn * already called have run, and nothing undoes them. */ class AnswerValidationError extends Error { code = 'ERR_ANSWER_VALIDATION'; report; constructor(report) { super(`The answer was withheld: answer validation '${report.validatorId}' did not pass ` + `(${report.status}).`); this.name = 'AnswerValidationError'; this.report = Object.freeze({ ...report, checks: Object.freeze(report.checks.map((check) => Object.freeze({ ...check, ...(check.evidenceRefs !== undefined && { evidenceRefs: Object.freeze([...check.evidenceRefs]), }), }))), resolvedRefs: Object.freeze([...report.resolvedRefs]), }); } } exports.AnswerValidationError = AnswerValidationError; //# sourceMappingURL=types.js.map