/** * Template substitution utility * Placeholder replacement and agent-conditional expansion for skillset content */ import type { AgentName } from "./agentNames.js"; /** Path placeholders recognised in skillset markdown. */ export declare const TEMPLATE_PLACEHOLDER_NAMES: readonly ["skills_dir", "profiles_dir", "commands_dir", "install_dir"]; type TemplateWarning = (args: { message: string; }) => void; /** * Keep only the content that applies to the target agent. * * Inline form: `use the {{claude-code TaskCreate}}{{codex update_plan}}{{else your plan tool}} now` * Block form: `{{#claude-code}} ... {{else codex}} ... {{else}} ... {{/}}` * * Tags naming anything other than a registered agent are left untouched. Tags * inside fenced code blocks are expanded like any other: both passes treat the * document uniformly, so wrap a tag in backticks to keep it literal. * * @param args - Arguments object * @param args.agentName - Agent being installed for; null leaves content as-is * @param args.content - The content to expand * @param args.onWarning - Called for authoring mistakes worth surfacing * * @returns Content with non-matching variants removed */ export declare const expandAgentConditionals: (args: { agentName?: AgentName | null; content: string; onWarning?: TemplateWarning | null; }) => string; /** * Substitute template placeholders in content with actual paths, and resolve * any agent conditionals for the target agent. * * Supported placeholders: * - {{skills_dir}} - Path to the installed skills directory * - {{profiles_dir}} - Path to profiles directory (~/.nori/profiles) * - {{commands_dir}} - Path to the installed commands directory * - {{install_dir}} - Path to install root (parent of agent config dir) * * Placeholders are substituted everywhere, including inside fenced code * blocks, because published skillsets put runnable commands in fences. Wrap a * placeholder in backticks to keep it literal. Agent conditionals follow the * same rule, so the two passes never disagree about what a fence means. * * @param args - Arguments object * @param args.agentName - Agent being installed for; enables conditionals * @param args.content - The content with placeholders * @param args.installDir - The agent config directory path (e.g. .claude dir) * @param args.commandsDir - Optional installed commands directory override * @param args.onWarning - Called for conditional authoring mistakes * @param args.skillsDir - Optional installed skills directory override * * @returns Content with placeholders replaced */ export declare const substituteTemplatePaths: (args: { agentName?: AgentName | null; commandsDir?: string | null; content: string; installDir: string; onWarning?: TemplateWarning | null; skillsDir?: string | null; }) => string; export {}; //# sourceMappingURL=template.d.ts.map