/** * Discovery and re-emit for operational skills. * * Re-emit (AC-18) exists so a skill can be packaged for a newly added platform * without rewriting it, and so a content-package update can reach skills generated * earlier. It refreshes the machine-managed verification section and * `content_version`, and leaves every user-authored byte alone — which is how * AC-50 is scoped in the design rather than violated. * * Requirements: AC-17, AC-18, AC-36, AC-50 * * @module */ import type { PlatformId } from '../core/types.js'; import { type OperationalSkill } from './schema.js'; import { type EmitReport } from './emit.js'; /** One discovered skill plus where it came from. */ export interface DiscoveredSkill { skill: OperationalSkill; /** Repo-relative path of the canonical body. */ path: string; } /** A canonical body that exists but could not be parsed. */ export interface DiscoveryProblem { path: string; reason: string; } /** Result of scanning the operational-skills directory. */ export interface DiscoveryResult { skills: DiscoveredSkill[]; /** Unparseable files, surfaced as warnings rather than aborting the scan. */ problems: DiscoveryProblem[]; } /** * Enumerate canonical operational-skill bodies. * * Matches `*.md` exactly and excludes anything containing `.tmp`, so a staged or * abandoned temp file is never mistaken for a skill. * * @param projectRoot - Absolute project root. * @returns Parsed skills plus any files that failed to parse. */ export declare function discoverOperationalSkills(projectRoot: string): DiscoveryResult; /** Load a single operational skill by name. */ export declare function loadOperationalSkill(projectRoot: string, name: string): OperationalSkill | null; /** * Refresh the machine-managed parts of a skill from the content package. * * Replaces only the bytes between the verify-steps delimiters and updates * `content_version`. When the body has no managed region — a hand-authored file, or * one whose markers were removed — the section is appended rather than silently * skipped, so verification is never absent (AC-35). * * @param skill - The skill to refresh. * @param contentRoot - Content package root. * @param contentVersion - Version to stamp. * @returns A new skill; the input is not mutated. */ export declare function refreshManagedSections(skill: OperationalSkill, contentRoot: string, contentVersion: string): OperationalSkill; /** Options for a re-emit run. */ export interface ReEmitOptions { projectRoot: string; contentRoot: string; contentVersion: string; platforms: PlatformId[]; /** Re-emit only this skill; omit for every discovered skill (AC-18 scope). */ name?: string; dryRun?: boolean; } /** Outcome of a re-emit run. */ export interface ReEmitResult { /** Names of skills re-emitted. */ names: string[]; report: EmitReport; problems: DiscoveryProblem[]; } /** * Re-emit one or all operational skills. * * Deliberately overwrites platform-derived files — they are, by definition, this * command's own prior output, which is AC-50's stated exception to AC-10's * no-silent-overwrite rule. * * @param opts - Re-emit options. * @returns Which skills were re-emitted and what changed on disk. * @throws When a named skill does not exist, or a configured platform lacks packaging. */ export declare function reEmit(opts: ReEmitOptions): ReEmitResult; //# sourceMappingURL=discover.d.ts.map