import type { ProjectScripts } from './project-scripts.js'; import type { StandardsLanguage, StandardsWriteStatus } from './project-standards-service.js'; /** Which instruction files the standards writer owns for one project. */ export type StandardsConstitution = { /** The shared cross-tool body file. */ readonly bodyFile: string; /** * The IDE-native file that imports the body, or `null` when the IDE reads * the body file directly and needs no pointer. */ readonly pointerFile: string | null; }; /** * The default shape: both files. * * `AGENTS.md` is read natively by 20+ coding agents; `CLAUDE.md` is what * Claude Code reads, and it imports the body. Emitting both covers every * reader without a per-tool configuration step. */ export declare const DEFAULT_CONSTITUTION: StandardsConstitution; /** One constitution file's write plan. */ export type ConstitutionFileUpdate = { readonly relativePath: string; readonly filePath: string; readonly status: StandardsWriteStatus; readonly content: string; readonly appendBlock: string; readonly reviewSuggestions: readonly string[]; }; /** The whole constitution's write plan. */ export type ConstitutionUpdate = { readonly body: ConstitutionFileUpdate; readonly pointer: ConstitutionFileUpdate | null; }; /** The JSON shape of a constitution update — one file summary, plus its pointer. */ export type ConstitutionUpdateSummary = { readonly body: { readonly relativePath: string; readonly status: StandardsWriteStatus; readonly reviewSuggestions: readonly string[]; }; readonly pointer: { readonly relativePath: string; readonly status: StandardsWriteStatus; readonly reviewSuggestions: readonly string[]; } | null; }; /** The JSON shape of a constitution update. */ export declare function summarizeConstitutionUpdate(update: ConstitutionUpdate): ConstitutionUpdateSummary; /** True when the relative path names a constitution file the writer owns. */ export declare function isConstitutionPath(relativePath: string): boolean; /** True when `childPath` is `parentPath` or lives under it. */ export declare function isInsidePath(childPath: string, parentPath: string): boolean; /** * The write-target containment guard for a constitution file. * * A symlinked `CLAUDE.md` / `AGENTS.md`, or one that resolves outside the * project root, is a write-target escape attempt and must be rejected before * anything is written. */ export declare function assertSafeConstitutionPath(filePath: string, projectRoot: string): void; /** * The constitution write plan for one project. * * `rulesRoot` is the directory the project's standards actually live in — * `.peaks/standards` for the 2.0 canonical layout, `.claude/rules` for a * project still carrying the 1.x tree — so the body points at the files that * are really there. */ export declare function buildConstitutionUpdate(input: { readonly projectRoot: string; readonly constitution: StandardsConstitution; readonly language: StandardsLanguage; readonly scripts: ProjectScripts; readonly rulesRoot: string; }): ConstitutionUpdate; /** * Create the constitution files that are absent. Never overwrites. * * Used by the layout migration (`standards migrate --from-claude-rules`), * which brings a 1.x project onto the 2.0 canonical layout. */ export declare function scaffoldConstitutionFiles(input: { readonly projectRoot: string; readonly constitution: StandardsConstitution; readonly language: StandardsLanguage; readonly scripts: ProjectScripts; readonly rulesRoot: string; }): readonly string[];