UNPKG

agentfootprint

Version:

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

40 lines • 2.46 kB
"use strict"; /** * selfExplainHost — the trace toolpack's binding of the agent builder's * `.selfExplain()` port, and the module the root door takes `Agent` and * `AgentBuilder` from. * * Pattern: Plugin registration (the `devWarnHost.ts` precedent). * Role: trace-toolpack (layer L10, above the agent). The agent builder * names only `core/agent/selfExplainPort.ts`; this file hands it the * three pieces `selfExplain.ts` builds — the binding, the skill and * the provider — at load, before any builder can reach `build()`. * Emits: nothing. * * WHY THE CLASSES ARE RE-EXPORTED HERE. The root barrel and every other door * are flagged side-effect-free (package.json `sideEffects`), and a bundler is * then free to skip a barrel and link `import { Agent }` straight to the module * that declares it. A registration placed in the barrel would be skipped with * it: webpack and rolldown both drop it (measured on a minimal package, both * bundlers, while this file was written). So the root door re-exports `Agent` and * `AgentBuilder` FROM this module, which IS flagged as having side effects — * whoever imports the agent through a door runs this file first, and a bundle * that never names the agent does not carry it. `traceDebugAgent.ts` builds * its agent from the same import, so `agentfootprint/observe`, the other door * whose graph reaches the builder, registers too. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.AgentBuilder = exports.Agent = exports.selfExplainExtension = void 0; const selfExplainPort_js_1 = require("../core/agent/selfExplainPort.js"); const selfExplain_js_1 = require("./selfExplain.js"); /** The toolpack's half of the port, exactly what the builder called before the port existed. */ exports.selfExplainExtension = { binding: (options) => new selfExplain_js_1.SelfExplainBinding(options.include, options.maxEvents), skill: selfExplain_js_1.buildSelfExplainSkill, toolProvider: selfExplain_js_1.buildSelfExplainToolProvider, }; (0, selfExplainPort_js_1.registerSelfExplain)(exports.selfExplainExtension); var Agent_js_1 = require("../core/Agent.js"); Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } }); Object.defineProperty(exports, "AgentBuilder", { enumerable: true, get: function () { return Agent_js_1.AgentBuilder; } }); //# sourceMappingURL=selfExplainHost.js.map