import { type SessionQuarantine } from "./session-validation"; import { type GjcPluginScope } from "./types"; /** * Constrained plugin-hook loader. * * Third-party plugin hooks are NOT given the broad first-party HookAPI. They * receive a restricted API that can only register a handler for their declared * event; every session-mutation / command / shell capability throws * security_policy. After the factory runs we verify it registered exactly the * declared event (and nothing else), or the hook is quarantined. */ export interface ConstrainedPluginHook { plugin: string; event: string; target?: string; phase?: "before" | "after"; handler: (...args: any[]) => unknown; } export interface ConstrainedHookLoadResult { hooks: ConstrainedPluginHook[]; quarantine: SessionQuarantine[]; } export interface DeclaredHook { plugin: string; scope: GjcPluginScope; event: string; target?: string; phase?: "before" | "after"; relativePath: string; implementationHash?: string; } /** Lazy declaration for one constrained hook. Importing this descriptor is metadata-only. */ export declare class ConstrainedPluginHookDescriptor { readonly plugin: string; readonly scope: GjcPluginScope; readonly event: string; readonly target?: string; readonly phase?: "before" | "after"; readonly relativePath: string; readonly implementationHash?: string; constructor(input: DeclaredHook); load(): Promise; } /** * Load all always-on constrained plugin hooks for the effective registry at * `cwd`, applying hash-drift + collision quarantine first. Returns empty when * no plugins are installed. */ export declare function loadConstrainedPluginHooks(input: { cwd: string; }): Promise;