agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
51 lines • 2.07 kB
TypeScript
/**
* MockThinkingHandler — canonical example for the v2.14 ThinkingHandler
* contract. Used by:
*
* 1. Tests — drives the shared contract test (every shipped handler
* MUST satisfy the same invariants this mock demonstrates).
* 2. Future provider authors — reference implementation showing how
* to handle BOTH Anthropic-shape inputs (signed blocks, possibly
* redacted) and OpenAI-shape inputs (multi-block summary). The
* pattern of "discriminate by shape, normalize each branch" is
* reusable across providers.
* 3. The MockProvider for end-to-end tests of the framework wiring
* without depending on a real LLM SDK.
*
* Defaults are deliberately sensitive-data-free — no fake PII, no
* fake-signature material that could be confused for real cryptography,
* no internal-looking IDs. Sets the example for consumer-authored
* handlers.
*/
import type { ThinkingHandler } from './types.js';
/** Shape the mock recognizes for Anthropic-style raw inputs. */
interface MockAnthropicRaw {
readonly kind: 'anthropic';
readonly blocks: ReadonlyArray<{
readonly type: 'thinking' | 'redacted_thinking';
readonly thinking?: string;
readonly signature?: string;
}>;
}
/** Shape the mock recognizes for OpenAI-style raw inputs. */
interface MockOpenAIRaw {
readonly kind: 'openai';
readonly summarySteps: readonly string[];
}
/**
* Build an Anthropic-style raw input for tests. Signature is a marker
* string — real Anthropic signatures are opaque base64.
*/
export declare function mockAnthropicRaw(blocks: readonly {
content: string;
signature?: string;
redacted?: boolean;
}[]): MockAnthropicRaw;
/**
* Build an OpenAI-style raw input for tests — one summary step per
* string. Each step becomes a separate ThinkingBlock with `summary: true`.
*/
export declare function mockOpenAIRaw(summarySteps: readonly string[]): MockOpenAIRaw;
export declare const mockThinkingHandler: ThinkingHandler;
export {};
//# sourceMappingURL=MockThinkingHandler.d.ts.map