agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
33 lines • 1.52 kB
JavaScript
;
/**
* ReliabilityRecorder — forwards `agentfootprint.reliability.*` emits to
* the dispatcher.
*
* Pattern: Factory (GoF) returning an EmitBridge instance.
* Role: Bridges the rules-based reliability loop's telemetry
* (`reliability.fail_fast` / `reliability.retried` /
* `reliability.recovered`, emitted from `executeWithReliability`
* via `typedEmit`) to the EventDispatcher so typed consumer
* listeners (`agent.on('agentfootprint.reliability.retried', …)`)
* fire. Without this bridge those emits hit the footprintjs emit
* channel but never reach the dispatcher.
* Emits: agentfootprint.reliability.fail_fast / retried / recovered
*
* NOTE: this is the RULES-LOOP family. The generic `error.retried` /
* `error.recovered` events are reserved for the standalone provider
* decorators (withRetry/withFallback) and are NOT bridged here — see
* docs/MENTAL_MODEL.md §14.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.reliabilityRecorder = void 0;
const EmitBridge_js_1 = require("./EmitBridge.js");
function reliabilityRecorder(options) {
return new EmitBridge_js_1.EmitBridge({
id: options.id ?? 'agentfootprint.reliability-recorder',
prefix: 'agentfootprint.reliability.',
dispatcher: options.dispatcher,
getRunContext: options.getRunContext,
});
}
exports.reliabilityRecorder = reliabilityRecorder;
//# sourceMappingURL=ReliabilityRecorder.js.map