/** * @param {string} gitRoot * @param {string} changeId */ export declare function changeDirAbs(gitRoot: string, changeId: string): string; /** * Canonical 6-value change lifecycle phases. * Shared truth between the CLI (change status / inferChangePhase) and the * workflow-state plugin (aiws-context.js PHASES). Keep in sync. */ export declare const CHANGE_PHASES: readonly ["intake", "planning", "ready-for-dev", "in-progress", "review", "finished"]; export type ChangePhase = (typeof CHANGE_PHASES)[number]; /** * @param {unknown} v * @returns {v is string} */ export declare function isChangePhase(v: unknown): v is string; /** * Idempotently write `phase` back into .ws-change.json (merge, preserve other fields). * Never throws — a meta write failure must not block change status/advance. * * @param {string} changeDir absolute path to the change dir * @param {string} phase canonical ChangePhase value */ export declare function writeMetaPhase(changeDir: string, phase: string): Promise; export declare const CHANGE_BRANCH_RE: RegExp; export declare const CHANGE_ID_RE: RegExp; /** * @param {string} changeId */ export declare function assertValidChangeId(changeId: string): void; /** * @param {string} branch */ export declare function inferChangeIdFromBranch(branch: string): string; /** * @param {string} text */ export declare function countWsTodo(text: string): number; /** * @param {string} text */ export declare function countPlaceholders(text: string): number; /** * @param {string} templateText * @param {{ changeId: string, title: string, createdAt: string }} vars */ export declare function renderTemplate(templateText: string, vars: any): string; /** * @param {string} s */ export declare function escapeRegExp(s: string): string; /** * @param {string} label * @param {string} text */ export declare function extractId(label: string, text: string): string; /** * @param {string} s */ export declare function splitDeclaredValues(s: string): string[]; /** * Extract bullet lines under a markdown "## ..." heading. * * @param {string} text * @param {RegExp} headingRe * @param {{ max?: number }} [options] * @returns {string[]} trimmed bullet lines like "- foo" */ export declare function extractBulletsUnderHeading(text: string, headingRe: RegExp, options: any): string[]; /** * @param {string} bulletLine */ export declare function isMeaningfulBullet(bulletLine: string): boolean; /** * @returns {string} e.g. 2026-01-28T14:00:26Z */ export declare function nowIsoUtc(): string; /** * @returns {number} unix seconds */ export declare function nowUnixSeconds(): number; /** * @returns {string} e.g. 20260128-140026Z */ export declare function nowStampUtc(): string; /** * @returns {string} e.g. 2026-01-28 (local date) */ export declare function todayLocal(): string; /** * @param {string} filePath * @returns {Promise} */ export declare function sha256FileBytes(filePath: string): Promise; /** * @param {string} gitRoot * @returns {Promise>} */ export declare function snapshotTruthFiles(gitRoot: string): Promise>; /** * @param {string} gitRoot * @returns {Promise>} */ export declare function snapshotTruthShaOnly(gitRoot: string): Promise>; /** * @param {string} entryName * @returns {{ datePrefix: string, changeId: string, stamp: string } | null} */ export declare function parseArchivedChangeDirName(entryName: string): { datePrefix: string; changeId: string; stamp: string; } | null; export declare function resolveGitRoot(absPath: string): Promise; export declare function currentBranch(gitRoot: string): Promise; export declare function hasHeadCommit(gitRoot: string): Promise; export declare function checkGitClean(gitRoot: string): Promise<{ clean: boolean; details?: undefined; } | { clean: boolean; details: string; }>; export declare function ensureTruthFiles(gitRoot: string): Promise; /** * List submodules declared in `.gitmodules` at the repo root. * * @param {string} gitRoot * @param {{ pathExists: (path: string) => Promise, runCommand: typeof import("../exec.js").runCommand }} deps * @returns {Promise>} */ export declare function listSubmodulesFromGitmodules(gitRoot: string, deps: any): Promise<{ name: string; path: string; }[]>; /** * Verify each claimed submodule (from the change's `submodule_branches` * snapshot) is clean and on its target branch. No snapshot → no-op. * * @param {string} gitRoot * @param {string} changeDir * @param {{ pathExists: (path: string) => Promise, readText: (path: string) => Promise, runCommand: typeof import("../exec.js").runCommand, UserError: typeof import("../errors.js").UserError }} deps */ export declare function verifySubmoduleBranches(gitRoot: string, changeDir: string, deps: any): Promise; /** * Detect whether `cwd` is inside a git submodule. * * A submodule's `.git` is a **file** (containing `gitdir: ...` pointing to the * superproject's gitdir), while a normal repo's `.git` is a **directory**. * * Walks up the directory tree until a `.git` entry is found. */ export declare function isInsideSubmodule(cwd: string): boolean;