UNPKG

agentfootprint

Version:

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

55 lines • 2.46 kB
"use strict"; /** * agentfootprint/recipes — the declared unit of agent configuration. * * Every capability an agent needs already ships. What did not was a named, * versioned, inspectable unit of CONFIGURATION — so an agent's setup lived as * prose in an example, was copy-pasted into an app, drifted there, and * afterwards nothing on the run could say which composition produced the agent * that answered. * * A recipe is that noun, and it is deliberately thin: a name, a version, and a * function that calls builder methods this library already has. No class, no * registry, nothing to close, nothing deferred — see `AgentRecipe` for why each * of those is a limit rather than an omission. * * Its own door, and not the main barrel, for the reason `/context` and * `/skill-graph` have one: this is authoring-time vocabulary. An app that * consumes a recipe imports the object and calls `.recipe()`; only the code * that DECLARES one needs `defineAgentRecipe`. * * @example declare a composition, then apply it * ```ts * import { Agent } from 'agentfootprint'; * import { defineAgentRecipe } from 'agentfootprint/recipes'; * * export const supportDesk = defineAgentRecipe({ * id: 'support-desk', * version: '1.2.0', * description: 'Order lookup + refund policy, the way support runs it.', * configure: (agent) => { * agent.system('You answer support questions.').tool(lookupOrder); * }, * }); * * const agent = Agent.create({ provider, model }).recipe(supportDesk).build(); * // → the run manifest now carries { id: 'support-desk', version: '1.2.0' } * ``` */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("../recipes/index.js"), exports); //# sourceMappingURL=recipes.js.map