agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
24 lines • 928 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProseWorkBudget = exports.ProseWorkLimit = void 0;
/** Internal control flow, translated to the existing input-limit observation. */
class ProseWorkLimit extends Error {
}
exports.ProseWorkLimit = ProseWorkLimit;
/** Tokens visited and characters prepared/compared share the same allowance.
* The runtime shares one instance across all fields; pure callers default to
* one per text. There is no process cache or application-configurable bypass. */
function createProseWorkBudget() {
let remaining = 8_000_000;
return {
charge(units) {
if (remaining < 0 || units > remaining) {
remaining = -1;
throw new ProseWorkLimit();
}
remaining -= units;
},
};
}
exports.createProseWorkBudget = createProseWorkBudget;
//# sourceMappingURL=work.js.map