import type { PluginService } from "../service.ts"; import type { PluginContext } from "../context.ts"; /** Result returned by triggerReload() so callers (tools, tests) can report status accurately. */ export interface HotReloadResult { success: boolean; /** Set when hot reload is disabled via env var (not an error). */ disabled?: boolean; /** Error message when success is false (and not disabled). */ error?: string; /** Number of roles discovered on disk. */ discovered?: number; /** Number of roles successfully resolved. */ resolved?: number; /** Number of discovered roles that failed to resolve. */ skipped?: number; } export declare class HotReloadService implements PluginService { readonly name = "hot-reload-service"; readonly dependencies: string[]; private watchers; private debounceTimer; private ctx; private disabled; private reloadSuppressUntil; private initTimer; private isReloading; /** Tracks the list of file changes since last reload for incremental path selection. */ private pendingChanges; /** Cache of role.yaml content hashes for detecting which roles actually changed. */ private roleHashCache; init(ctx: PluginContext): Promise; private startWatchers; private scheduleReload; /** * Public trigger to force a hot reload. If disabled, returns a resolved promise * with `success: false` and `disabled: true`. * Useful for P2 tools to programmatically trigger a reload and report status. */ triggerReload(): Promise; private performReload; /** * Fast path: Only skill files changed within a single role. * Re-resolves skills for that role, rebuilds the agent prompt, * updates the agent registry, and syncs skill symlinks. * Does NOT restart dispatch-service. */ private performFastReload; /** * Full/medium path: Re-discovers and re-resolves all roles. * This is the existing full reload behavior with added hash cache refresh. */ private performFullReload; /** Record a file change and schedule a reload. */ private onFileChange; private recordChange; /** * Classify accumulated changes to determine the best reload path. * Returns: * { type: "full", roleIds: [] } — global skills/config changed, need full reload * { type: "medium", roleIds: [...] } — role.yaml changed * { type: "fast", roleIds: [...] } — only skill files changed */ private classifyChanges; /** Compute a content-addressable hash string from role.yaml content. * Only compared in-process (roleHashCache) — NOT persisted. * Changed from Bun.hash to node:crypto sha1-hex for Node portability; * format differs but in-process comparison is self-consistent. */ private hashContent; /** Read each role.yaml and update the hash cache for incremental detection. */ private refreshRoleHashCache; dispose(): Promise; health(): { status: "healthy" | "degraded" | "unhealthy"; detail?: string; }; } //# sourceMappingURL=hot-reload-service.d.ts.map