trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
48 lines • 1.51 kB
TypeScript
/**
* Decision Hook Registry
*
* External agent harnesses register pre/post hooks to enrich decision traces
* with rationale, alternatives, prompt context, etc.
*/
import type { DecisionPreHook, DecisionPostHook, DecisionContext, DecisionEnrichment } from './types.js';
export declare class HookRegistry {
private preHooks;
private postHooks;
/**
* Register a pre-hook that runs before a tool handler.
*/
registerPreHook(hook: DecisionPreHook): void;
/**
* Register a post-hook that runs after a tool handler.
*/
registerPostHook(hook: DecisionPostHook): void;
/**
* Remove a pre-hook by name.
*/
removePreHook(name: string): void;
/**
* Remove a post-hook by name.
*/
removePostHook(name: string): void;
/**
* Get all pre-hooks matching a tool name.
*/
getPreHooks(toolName: string): DecisionPreHook[];
/**
* Get all post-hooks matching a tool name.
*/
getPostHooks(toolName: string): DecisionPostHook[];
/**
* Run all matching pre-hooks and merge their contexts.
*/
runPreHooks(toolName: string, input: Record<string, unknown>): Promise<DecisionContext>;
/**
* Run all matching post-hooks and merge their enrichments.
*/
runPostHooks(toolName: string, input: Record<string, unknown>, output: unknown, preContext: DecisionContext): Promise<DecisionEnrichment>;
/**
* Clear all hooks.
*/
clear(): void;
}
//# sourceMappingURL=hooks.d.ts.map