import type { AwarenessPlugin, PluginConfig, PluginState } from './types.ts'; export interface PolicyConfig { maxCharsSessionStart?: number; maxCharsPrompt?: number; showPluginNames?: boolean; } /** * Config resolution order per plugin: * 1. Plugin built-in defaults * 2. Package defaults (config/default.json → plugins.) * 3. User global (~/.config/agent-awareness/plugins.d/.json) * 4. Rig/project override ($AGENT_AWARENESS_CONFIG/plugins.d/.json) * 5. Legacy monolithic config.json (backward compat, lowest priority user layer) * * System config (non-plugin settings) comes from config.json files only. */ interface TriggeredPlugin { plugin: AwarenessPlugin; trigger: string; } export declare class Registry { #private; register(plugin: AwarenessPlugin): void; clear(): void; pluginNames(): string[]; loadConfig(defaultConfigPath: string): Promise; /** * Reload config if stale (older than configTtl). * Call this before accessing config in long-running processes (ticker, MCP). * No-op if config was loaded recently or loadConfig() was never called. */ refreshConfigIfStale(): Promise; getPluginConfig(name: string): PluginConfig | null; isEnabled(name: string): boolean; getEnabledPlugins(): AwarenessPlugin[]; /** * Determine which plugins should fire for a given event. * Returns [{ plugin, trigger }] — the matched trigger so plugins * can vary their output (e.g. 'full' vs 'compact'). */ getTriggeredPlugins(event: string, state: PluginState): TriggeredPlugin[]; getPolicyConfig(): PolicyConfig; getPlugin(name: string): AwarenessPlugin | undefined; /** Call onStart() on all enabled plugins. Errors are logged, not thrown. */ startPlugins(): Promise; /** Call onStop() on all enabled plugins. Errors are logged, not thrown. */ stopPlugins(): Promise; /** Call onInstall() on a specific plugin. */ installPlugin(name: string): Promise; /** Call onUninstall() on a specific plugin. */ uninstallPlugin(name: string): Promise; } export {};