/** * @traqr/core — Template Loader * * Bundles template discovery, loading, path mapping, tier-gating, * and the full render pipeline into a portable module. * * Extracted from src/app/api/traqr/render/route.ts so that * @traqr/cli and other consumers can render templates without Next.js. */ import type { TraqrConfig } from './config-schema.js'; /** * Returns absolute path to the bundled templates/ directory. * Works from both src/ (dev) and dist/ (compiled) because templates/ * lives at the package root, one level above either directory. */ export declare function getTemplatesDir(): string; /** * Recursively list all .tmpl files in a directory. * Returns relative paths like "commands/ship.md.tmpl". */ export declare function listTemplates(dir?: string): Promise; /** * Read a single template by relative path. */ export declare function loadTemplate(relativePath: string, dir?: string): Promise; /** * Map template relative path to output path. * e.g. "commands/ship.md.tmpl" -> ".claude/commands/ship.md" * * For global skills, use templateToGlobalOutputPath() instead. */ export declare function templateToOutputPath(templatePath: string, prefix: string, appDir?: string): string; /** * Determine if a template should be included based on tier and feature flags. * * Post-audit skill catalog (13 skills): * - Global (4): ship, sync, resync, inbox * - Project-local (4): status, analyze, slack, doctor (validate-config) * - Traqr infra (4): traqr-init, traqr-setup, traqr-test, bootstrap-skills * * Removed (replaced by MCP tools / plan mode): * startup, context, memory, think, dispatch, draft, verify */ export declare function shouldIncludeTemplate(templatePath: string, tier: number, flags: Record): boolean; /** Result of rendering all templates for a config */ export interface RenderResult { /** Output path -> rendered content (project-local files) */ files: Record; /** Output path -> rendered content (global ~/.claude/commands/ files) */ globalFiles: Record; /** Warnings about unknown template variables, etc. */ warnings: string[]; } /** * Full render pipeline: config -> rendered files. * * Takes a TraqrConfig, discovers all templates, applies tier-gating, * renders each template with config-derived variables, and returns * the complete set of output files split into project-local and global. */ export declare function renderAllTemplates(config: TraqrConfig, templatesDir?: string): Promise; /** * Render only monorepo sub-app templates for a specific app. * Uses buildSubAppTemplateVars for per-app variable resolution. * Returns files keyed by output path relative to monorepo root. */ export declare function renderSubAppTemplates(config: TraqrConfig, appSlug: string, templatesDir?: string): Promise<{ files: Record; warnings: string[]; }>; //# sourceMappingURL=template-loader.d.ts.map