import { type ConstitutionUpdate, type ConstitutionUpdateSummary, type StandardsConstitution } from './standards-constitution.js'; export { renderUiLibraryPriorityRule } from './standards-render.js'; /** * Typed error raised when a planned `peaks standards` write target would * land outside `projectRoot` (or collide with the user-level baseline * under `/.claude/**`). Surfaced as a stable error code so CLI * callers can map it to a recoverable hint. */ export type ProjectStandardsWriteTargetReason = 'outside-project-root' | 'resolves-to-homedir-claude'; export declare class ProjectStandardsWriteTargetError extends Error { readonly code: "PROJECT_STANDARDS_WRITE_TARGET_OUTSIDE_ROOT"; readonly filePath: string; readonly projectRoot: string; readonly reason: ProjectStandardsWriteTargetReason; constructor(input: { readonly filePath: string; readonly projectRoot: string; readonly reason: ProjectStandardsWriteTargetReason; }); } export type StandardsLanguage = 'generic' | 'typescript' | 'javascript' | 'python' | 'go' | 'rust'; export type StandardsWriteStatus = 'planned' | 'existing' | 'written' | 'appended' | 'review'; export type StandardsWrite = { readonly relativePath: string; readonly filePath: string; readonly content: string; readonly status: StandardsWriteStatus; }; export type ProjectStandardsSource = { readonly sourceId: 'everything-claude-code'; readonly url: 'https://github.com/affaan-m/everything-claude-code'; readonly usage: 'curated-baseline-reference'; }; export type StandardsSkillPreflight = { readonly appliesTo: readonly ['peaks-rd', 'peaks-qa', 'peaks-code']; readonly summary: string; }; export type ProjectStandardsInitPlan = { readonly apply: boolean; readonly projectRoot: string; readonly language: StandardsLanguage; readonly source: ProjectStandardsSource; readonly skillPreflight: StandardsSkillPreflight; /** Which instruction files this project owns, and where its standards live. */ readonly constitution: StandardsConstitution; /** The directory the project's standards files live in. */ readonly rulesRoot: string; /** The four-state constitution write plan, shared by `init` and `update`. */ readonly constitutionUpdate: ConstitutionUpdate; readonly plannedWrites: StandardsWrite[]; }; export type ProjectStandardsInitResult = ProjectStandardsInitPlan & { readonly writtenFiles: string[]; /** Why a constitution file was left for a human, when one was. */ readonly reviewSuggestions: string[]; }; export type ProjectStandardsInitSummary = { readonly apply: boolean; readonly projectRoot: string; readonly language: StandardsLanguage; readonly source: ProjectStandardsSource; readonly skillPreflight: StandardsSkillPreflight; readonly plannedWrites: Array>; readonly writtenFiles: string[]; readonly skippedFiles: string[]; readonly reviewSuggestions: string[]; }; /** * The update plan — the init plan, which already carries the constitution * write plan the update applies. */ export type ProjectStandardsUpdatePlan = ProjectStandardsInitPlan; export type ProjectStandardsUpdateResult = ProjectStandardsUpdatePlan & { readonly writtenFiles: string[]; readonly appendedFiles: string[]; readonly reviewSuggestions: string[]; }; export type ProjectStandardsUpdateSummary = { readonly apply: boolean; readonly projectRoot: string; readonly language: StandardsLanguage; readonly source: ProjectStandardsSource; readonly skillPreflight: StandardsSkillPreflight; readonly plannedWrites: Array>; readonly writtenFiles: string[]; readonly appendedFiles: string[]; readonly skippedFiles: string[]; readonly reviewSuggestions: string[]; readonly constitutionUpdate: ConstitutionUpdateSummary; }; export type ProjectStandardsInitOptions = { readonly projectRoot: string; readonly language?: string; readonly apply?: boolean; /** * Test seam: override the homedir resolver used by the * write-target containment guard. Defaults to `os.homedir()`. * Production callers should NOT pass this — it exists so unit * tests can simulate the "projectRoot === homedir" trap without * mutating global Node state (which is read-only). */ readonly resolveHomedir?: () => string; /** * Which instruction files this project owns. Defaults to * {@link DEFAULT_CONSTITUTION} — the body file plus the pointer that * imports it. The IDE-aware layer narrows it for IDEs that read the body * file directly and need no pointer. */ readonly constitution?: StandardsConstitution; }; /** * Public alias for `detectLanguageInternal` so callers outside this * auto-detect path) can ask the same heuristic without re-implementing * the file-probe logic. */ export declare function detectLanguage(projectRoot: string): StandardsLanguage; export declare function createProjectStandardsInitPlan(options: ProjectStandardsInitOptions): ProjectStandardsInitPlan; export declare function createProjectStandardsUpdatePlan(options: ProjectStandardsInitOptions): ProjectStandardsUpdatePlan; export declare function executeProjectStandardsInit(options: ProjectStandardsInitOptions): ProjectStandardsInitResult; export declare function executeProjectStandardsUpdate(options: ProjectStandardsInitOptions): ProjectStandardsUpdateResult; export declare function summarizeProjectStandardsInitResult(result: ProjectStandardsInitResult): ProjectStandardsInitSummary; export declare function summarizeProjectStandardsUpdateResult(result: ProjectStandardsUpdateResult): ProjectStandardsUpdateSummary;