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 (39 loc) • 2.07 kB
TypeScript
/**
* defineStepsHint — the static advisory half of steps-as-data (9.18.0):
* one system-prompt note that fires exactly while a declared procedure is
* in progress, telling the model HOW the mechanism works — the current
* step leads the matching tool's description, `skip_step` records a
* decline, and the rest of the toolbox stays available.
*
* `defineMenuHint`'s sibling, same division of labor (SG-C): the BODY is
* static instruction; the DATA — which step, which tool, what note — rides
* the tools slot (the step banner + the `skip_step` description), rebuilt
* per iteration from the one source of truth (`scope.stepPointer` + the
* frozen plan). Auto-registered by `AgentBuilder.build()` whenever any
* registered skill declares steps — a narrowed offer with no explanation
* would be sequence enforcement the model was never told about, the
* accepted-and-silently-wrong kind. Zero cost when the trigger is false:
* it reads `ctx.stepPointer`, which only stepped tenures ever populate.
*
* Add your own (custom id or body) with
* `.injection(defineStepsHint({ ... }))` — the auto-registration then
* stands down (it detects the marker, not the id).
*/
import type { Injection } from '../types.js';
export interface StepsHintOptions {
/** Injection id (default `'skill-steps-hint'`). */
readonly id?: string;
/** Override the advisory body. The default names the mechanism (banner in
* the tool description, `skip_step` for declines) and frames the order
* as declared, not caged. */
readonly body?: string;
}
/**
* The metadata marker that says "this injection is the steps advisory"
* (the `MENU_HINT_METADATA_KEY` pattern). AgentBuilder auto-registers a
* default hint only when NO registered injection carries the marker —
* matching on the id would miss every renamed one and would false-positive
* on somebody else's injection of that name.
*/
export declare const STEPS_HINT_METADATA_KEY: "skillStepsHint";
export declare function defineStepsHint(options?: StepsHintOptions): Injection;