/** * CAAMP injection management — manages agent instruction file injection. * * Extracted from init.ts to enable shared use across init, upgrade, and doctor. * * Handles: * 1. Injecting @AGENTS.md into provider instruction files (CLAUDE.md, GEMINI.md, etc.) * 2. Injecting CLEO protocol content into AGENTS.md itself * 3. Installing CLEO-INJECTION.md to global templates directory * 4. Creating global ~/.agents/AGENTS.md hub * 5. Stripping legacy CLEO blocks and removing deprecated files * 6. Checking injection health (CAAMP markers, @ reference resolution) * * @task T4682 */ import type { ScaffoldResult } from '@cleocode/contracts/scaffold-diagnostics'; export type { ScaffoldResult } from '@cleocode/contracts/scaffold-diagnostics'; /** Structural alias of {@link CheckResult} used by injection health checks. */ export interface InjectionCheckResult { id: string; category: string; status: 'passed' | 'failed' | 'warning' | 'info'; message: string; details: Record; fix: string | null; } /** * Get the CLEO-INJECTION.md template content from the package templates/ directory. * Returns null if the template file is not found. */ export declare function getInjectionTemplateContent(): string | null; /** * Strip hardcoded `...` blocks * from AGENTS.md. These blocks are replaced by the `@.cleo/nexus-bridge.md` * reference which contains auto-generated code intelligence content (T552). * * Also strips any other known vendor marker blocks using the same pattern * (e.g. `...`). * * @param filePath - Absolute path to the file to strip * @returns True if the file was modified, false otherwise */ export declare function stripGitNexusBlocks(filePath: string): Promise; /** * Full injection refresh: strip legacy blocks, inject CAAMP content, * install global template, create hub. * * Replaces initInjection from init.ts with a ScaffoldResult return type. * * Target architecture: * CLAUDE.md/GEMINI.md -> @AGENTS.md (via injectAll) * AGENTS.md -> @~/.agents/AGENTS.md + @.cleo/project-context.json + @.cleo/memory-bridge.md + @.cleo/nexus-bridge.md * * @task T4682 */ export declare function ensureInjection(projectRoot: string): Promise; /** * Build a smart, contextual contributor block for AGENTS.md injection. * Returns null if this is not a contributor project. * * The block is INFORMATIONAL, not prescriptive. It tells agents: * - This is the CLEO source repo (contributor project) * - cleo-dev is available (or not, with reason) * - Prefer cleo-dev for unreleased features, but fall back to cleo if * the dev build is broken or unavailable * * This avoids the trap where a hardcoded "ALWAYS use cleo-dev" instruction * sends agents into a loop when the dev build has compile errors. */ export declare function buildContributorInjectionBlock(projectRoot: string): string | null; /** * Verify injection health: AGENTS.md exists, has CAAMP markers, * markers are balanced, and @ references resolve. * * Combines logic from doctor/checks.ts checkAgentsMdHub, * checkCaampMarkerIntegrity, and checkAtReferenceTargetExists. */ export declare function checkInjection(projectRoot: string): InjectionCheckResult; //# sourceMappingURL=injection.d.ts.map