import { type RefResolver } from './template-validate.js'; import type { AgentDefinition, ThreadTemplate } from '../../core/types/thread-types.js'; /** Directory-based config root (preferred). Exported for the write path. */ export declare const CONFIG_TEMPLATES_DIR: string; export declare const FILE_REF_PREFIX = "file:"; export declare function setAdminNotifier(fn: (text: string) => void): void; /** Resolve a "file:" reference for a given field. Returns value unchanged if not a file ref. * Exported so prompt-builder.ts can resolve file refs on per-template agent overrides. */ export declare function resolveFileRef(field: string, value: string | undefined): string | undefined; /** Resolve a plugin directory path. Absolute paths are returned as-is; * relative paths are resolved against DATA_DIR (plugins live under DATA_DIR/plugins/). */ export declare function resolvePluginDir(dir: string): string; /** * Merge the shipped defaults thread-templates directory into the user's config directory with * per-file copy-if-missing semantics (aligned with plugin-sync): a defaults entity file that the * user does not yet have is copied in; existing user files are never overwritten. Runs at startup * so new default agents/templates/shells (e.g. a new shell definition) reach existing installs. * * @returns true if any file was written, false otherwise. */ export declare function mergeThreadTemplates(defaultsDir: string, userDir: string): boolean; /** * One-time startup migration: if the legacy single file exists and the directory does not, * split the single file into per-entity files under CONFIG_TEMPLATES_DIR (one file per agent / * template / shell) and rename the old file to `thread-templates.json.migrated-bak` (content * preserved, never deleted). Idempotent: no-op once the directory exists or the file is gone. * * @returns true if a migration was performed. */ export declare function migrateThreadTemplatesToDir(): boolean; /** Filesystem probes for the validator's `file:` ref and pluginDirs existence checks. */ export declare function loaderRefResolver(): RefResolver; export declare function loadConfig(): { agents: Record; templates: Record; }; export declare function startConfigWatcher(): void; export declare function stopConfigWatcher(): void; export declare function getAgent(name: string): AgentDefinition | null; export declare function listAgents(): AgentDefinition[]; export declare function getTemplate(name: string): ThreadTemplate | null; export declare function listTemplates(): ThreadTemplate[]; export declare function listTemplateNames(): string[];