import type { BashExecutionRequest, BashHookResult } from "./bash-types.js"; import type { FileChange, HookMap, HostAdapter } from "./types.js"; export { buildPathMatchContext } from "./runtime/path-filter.js"; export interface ToolExecuteBeforeInput { readonly tool: string; readonly sessionID?: string; readonly callID: string; } export interface ToolExecuteBeforeOutput { readonly args?: Record; } export interface ToolExecuteAfterInput { readonly tool: string; readonly sessionID?: string; readonly callID: string; readonly args?: Record; } export interface RuntimeEventEnvelope { readonly event: { readonly type: string; readonly properties?: Record; }; } export interface RuntimeActionContext { readonly files?: readonly string[]; readonly changes?: readonly FileChange[]; readonly toolName?: string; readonly toolArgs?: Record; readonly sourceSessionID?: string; readonly targetSessionID?: string; readonly pathMatchContext?: PathMatchContext; } export interface PathMatchContext { readonly changedPaths: readonly string[]; readonly hasCodeFiles: boolean; } export interface HookExecutionResult { readonly blocked: boolean; readonly blockReason?: string; readonly stopSession?: boolean; } export interface HookMatchDecision { readonly matched: boolean; readonly reason: string; readonly changedPaths: readonly string[]; readonly details?: Record; } type ExecuteBashHook = (request: BashExecutionRequest) => Promise; export interface HooksRuntime { readonly "tool.execute.before": (input: ToolExecuteBeforeInput, output: ToolExecuteBeforeOutput) => Promise; readonly "tool.execute.after": (input: ToolExecuteAfterInput, output?: unknown) => Promise; readonly "user.bash.before": (input: ToolExecuteBeforeInput, output: ToolExecuteBeforeOutput) => Promise; readonly event: (envelope: RuntimeEventEnvelope) => Promise; } export interface CreateHooksRuntimeOptions { readonly directory: string; readonly hooks?: HookMap; readonly initialSignature?: string; readonly reloadDiscoveredHooks?: boolean; readonly executeBash?: ExecuteBashHook; } export declare function createHooksRuntime(host: HostAdapter, options: CreateHooksRuntimeOptions): HooksRuntime;