agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
26 lines (25 loc) • 1.07 kB
TypeScript
/**
* @internal — not part of the public agentfootprint API. Imported only
* by RunStepRecorder. Subject to change without notice.
*
* ActorArrowClassifier — classifies the next `llm.start` as
* `'user→llm'` (no pending tool result) vs `'tool→llm'` (after a
* tool result), and the next `llm.end` as `'llm→tool'` vs `'llm→user'`
* based on the call's `toolCallCount`.
*
* Extracted from RunStepRecorder per Convention 1. Keeps a single
* boolean of state — `prevLLMEndHadTools` — and consumes-then-resets
* it on each `llm.start`.
*/
export type StartArrow = 'user→llm' | 'tool→llm';
export type EndArrow = 'llm→tool' | 'llm→user';
export declare class ActorArrowClassifier {
private prevLLMEndHadTools;
/** Classify the next `llm.start`. Consumes + resets the pending
* flag after returning. */
classifyStart(): StartArrow;
/** Classify an `llm.end` based on its tool-call count, and update
* the pending flag for the NEXT llm.start. */
classifyEnd(toolCallCount: number): EndArrow;
clear(): void;
}