/** * @license * Copyright 2025 OSAgent OC * SPDX-License-Identifier: Apache-2.0 */ import type { SubagentHooks } from './subagent-hooks.js'; /** * Global registry for subagent hooks. * * This allows different parts of the system to register hooks that * will be called during subagent execution. Hooks are combined and * all registered handlers are called for each event. * * Usage: * // Register hooks from UI or other modules * subagentHooksRegistry.register('ui', { * onStart: (p) => console.log('Subagent started:', p.name), * postToolUse: (p) => trackToolUsage(p), * }); * * // Get combined hooks for subagent creation * const hooks = subagentHooksRegistry.getCombinedHooks(); */ declare class SubagentHooksRegistry { private hooks; private combinedHooksCache; /** * Register hooks with a unique identifier. * If hooks with the same id exist, they will be replaced. */ register(id: string, hooks: SubagentHooks): void; /** * Unregister hooks by id. */ unregister(id: string): boolean; /** * Get all registered hooks combined into a single object. * Results are cached until hooks are modified. */ getCombinedHooks(): SubagentHooks; /** * Check if any hooks are registered. */ hasHooks(): boolean; /** * Get registered hook IDs. */ getRegisteredIds(): string[]; /** * Clear all registered hooks. */ clear(): void; } /** * Global singleton instance of the hooks registry. */ export declare const subagentHooksRegistry: SubagentHooksRegistry; export {};