/**
 * Directory & file scaffolding utilities.
 *
 * Shared ensure/check functions extracted from init.ts for reuse
 * by init.ts, upgrade.ts, and doctor health checks.
 *
 * Rules:
 *   - All ensure functions are idempotent (safe to call multiple times)
 *   - All check functions are read-only (no side effects)
 *   - Uses imports from ./paths.js for path resolution
 */
/** Result of an ensure* scaffolding operation. */
export interface ScaffoldResult {
    /** What action was taken: created, repaired, or skipped. */
    action: 'created' | 'repaired' | 'skipped';
    /** Filesystem path that was operated on. */
    path: string;
    /** Human-readable explanation of the result. */
    details?: string;
}
/** Status of a check* diagnostic. */
export type CheckStatus = 'passed' | 'failed' | 'warning' | 'info';
/** Result of a check* diagnostic (compatible with doctor/checks.ts CheckResult). */
export interface CheckResult {
    /** Unique check identifier (e.g. "cleo_structure", "sqlite_db"). */
    id: string;
    /** Category grouping (e.g. "scaffold", "global"). */
    category: string;
    /** Diagnostic outcome: passed, failed, warning, or info. */
    status: CheckStatus;
    /** Human-readable description of the check result. */
    message: string;
    /** Structured metadata about the check (paths, sizes, missing items). */
    details: Record<string, unknown>;
    /** Suggested CLI command to fix the issue, or null if passed. */
    fix: string | null;
}
/** Required subdirectories under .cleo/. */
export declare const REQUIRED_CLEO_SUBDIRS: readonly ["backups/operational", "backups/safety", "agent-outputs", "logs", "rcasd", "adrs"];
/**
 * Embedded fallback for .cleo/.gitignore content (deny-by-default).
 *
 * Must stay in sync with `packages/core/templates/cleo-gitignore`. The
 * template file is the source of truth; this constant is only used when
 * the template file cannot be located at runtime (bundled binary edge
 * cases, air-gapped installs, etc.).
 *
 * ADR-013 §9 (2026-04-07, T5158): config.json / project-info.json are
 * NOT re-included here. Runtime state files (tasks.db, brain.db,
 * config.json, project-info.json) are protected by explicit deny rules
 * so that nested-.gitignore allow rules cannot unignore them at the
 * project repository level.
 */
export declare const CLEO_GITIGNORE_FALLBACK = "# .cleo/.gitignore \u2014 Deny-by-default for CLEO project data\n# Ignore everything, then explicitly allow only tracked files.\n#\n# ADR-013 \u00A79 (2026-04-07, T5158): config.json + project-info.json are\n# runtime snapshots regenerated by `cleo init`, not tracked in git.\n# Recovery for all four runtime files (tasks.db, brain.db, config.json,\n# project-info.json) is provided by `cleo backup add` snapshots under\n# .cleo/backups/. See .cleo/adrs/ADR-013 for the full recovery story.\n\n# Step 1: Ignore everything\n*\n\n# Allow list\n!.gitignore\n!project-context.json\n!setup-otel.sh\n!DATA-SAFETY-IMPLEMENTATION-SUMMARY.md\n!adrs/\n!adrs/**\n!rcasd/\n!rcasd/**\n!agent-outputs/\n!agent-outputs/**\n\n# Explicit deny safety net\n*.db\n*.db-shm\n*.db-wal\n*.db-journal\nconfig.json\nproject-info.json\nlog.json\nbypass-log.json\nqa-log.json\n.deps-cache/\n.context-alert-state.json\n.context-state*.json\ncontext-states/\n.git-checkpoint-state\n.migration-state.json\nmigrations.json\nsync/\nmetrics/\n.backups/\nbackups/\n";
/**
 * Check if a file exists and is readable.
 *
 * @param path - Absolute path to the file to check
 * @returns True if the file exists and is readable, false otherwise
 *
 * @remarks
 * Uses `fs.access` with `R_OK` to verify both existence and read permission.
 * Swallows all errors and returns false on failure.
 *
 * @example
 * ```typescript
 * if (await fileExists('/project/.cleo/config.json')) {
 *   // safe to read
 * }
 * ```
 */
export declare function fileExists(path: string): Promise<boolean>;
/**
 * Strip legacy CLEO:START/CLEO:END blocks from a file.
 * Called before CAAMP injection to prevent competing blocks.
 *
 * @param filePath - Absolute path to the file to strip
 *
 * @remarks
 * Handles both bare markers (`<!-- CLEO:START -->`) and versioned markers
 * (`<!-- CLEO:START v0.53.4 -->`). No-op if the file does not exist or
 * contains no CLEO blocks.
 *
 * @example
 * ```typescript
 * await stripCLEOBlocks('/project/CLAUDE.md');
 * ```
 */
export declare function stripCLEOBlocks(filePath: string): Promise<void>;
/**
 * Remove .cleo/ or .cleo entries from the project root .gitignore.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Whether any lines were removed from the .gitignore
 *
 * @remarks
 * Filters out lines matching `/.cleo/`, `.cleo/`, `.cleo`, etc. from the
 * root-level `.gitignore`. Returns `{ removed: false }` if the file does not
 * exist or contains no matching entries.
 *
 * @example
 * ```typescript
 * const { removed } = await removeCleoFromRootGitignore('/project');
 * if (removed) console.log('.cleo entries cleaned from .gitignore');
 * ```
 */
export declare function removeCleoFromRootGitignore(projectRoot: string): Promise<{
    removed: boolean;
}>;
export { generateProjectHash } from './nexus/hash.js';
/**
 * Resolve the package root directory (where schemas/ and templates/ live).
 * scaffold.ts lives in packages/core/src/, so 1 level up reaches the package root.
 *
 * @returns Absolute path to the @cleocode/core package root
 *
 * @remarks
 * Uses `import.meta.url` to determine the file location at runtime, which
 * works correctly in both development and installed npm package contexts.
 *
 * @example
 * ```typescript
 * const root = getPackageRoot();
 * const schemaPath = join(root, 'schemas', 'config.schema.json');
 * ```
 */
export declare function getPackageRoot(): string;
/**
 * Load the gitignore template from the package's templates/ directory.
 * Falls back to embedded content if file not found.
 *
 * @returns The .cleo/.gitignore template content string
 *
 * @remarks
 * First attempts to read from the package's `templates/cleo-gitignore` file.
 * Falls back to the embedded `CLEO_GITIGNORE_FALLBACK` constant if the
 * template file is missing or unreadable.
 *
 * @example
 * ```typescript
 * const content = getGitignoreContent();
 * await writeFile('.cleo/.gitignore', content);
 * ```
 */
export declare function getGitignoreContent(): string;
/**
 * Read CLEO version from package.json.
 *
 * @returns Semver version string, or "0.0.0" if unavailable
 *
 * @remarks
 * Reads the `version` field from the @cleocode/core package.json at runtime.
 * Returns "0.0.0" if the file cannot be read or parsed.
 *
 * @example
 * ```typescript
 * const version = getCleoVersion(); // "2026.4.0"
 * ```
 */
export declare function getCleoVersion(): string;
/**
 * Create default config.json content.
 *
 * @returns A plain object with the default CLEO configuration structure
 *
 * @remarks
 * Returns a version-stamped config with defaults for output formatting, backup
 * limits, hierarchy depth, session behavior, and lifecycle mode.
 *
 * @example
 * ```typescript
 * const config = createDefaultConfig();
 * await saveJson(configPath, config);
 * ```
 */
export declare function createDefaultConfig(): Record<string, unknown>;
/**
 * Create .cleo/ directory and all required subdirectories.
 * Idempotent: skips directories that already exist.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Scaffold result indicating whether the directory was created or already existed
 *
 * @remarks
 * Refuses to scaffold inside the global CLEO home to prevent pollution.
 * Creates all directories listed in `REQUIRED_CLEO_SUBDIRS`.
 *
 * @example
 * ```typescript
 * const result = await ensureCleoStructure('/my/project');
 * console.log(result.action); // "created" or "skipped"
 * ```
 */
export declare function ensureCleoStructure(projectRoot: string): Promise<ScaffoldResult>;
/**
 * Create or repair .cleo/.gitignore from template.
 * Idempotent: skips if file already exists with correct content.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Scaffold result indicating whether the gitignore was created, repaired, or skipped
 *
 * @remarks
 * Compares normalized content (trimmed, LF line endings) against the template.
 * If the file exists but differs, it is overwritten with the canonical template.
 *
 * @example
 * ```typescript
 * const result = await ensureGitignore('/my/project');
 * if (result.action === 'repaired') console.log('Gitignore updated');
 * ```
 */
export declare function ensureGitignore(projectRoot: string): Promise<ScaffoldResult>;
/**
 * Create default config.json if missing.
 * Idempotent: skips if file already exists.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @param opts - Optional configuration
 * @param opts.force - When true, overwrite the existing config
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * On skip, still checks for and backfills the ADR-029 contributor block
 * if the project is detected as the CLEO source repository.
 *
 * @example
 * ```typescript
 * const result = await ensureConfig('/my/project', { force: true });
 * console.log(result.path);
 * ```
 */
export declare function ensureConfig(projectRoot: string, opts?: {
    force?: boolean;
}): Promise<ScaffoldResult>;
/**
 * Create or refresh project-info.json.
 * Idempotent: skips if file already exists (unless force).
 *
 * @param projectRoot - Absolute path to the project root directory
 * @param opts - Optional configuration
 * @param opts.force - When true, regenerate even if the file exists
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Backfills a `projectId` (UUID) on existing files that lack one (T5333).
 * The generated file includes project hash, CLEO version, schema versions,
 * and initial health/feature flags.
 *
 * @example
 * ```typescript
 * const result = await ensureProjectInfo('/my/project');
 * console.log(result.action); // "created", "repaired", or "skipped"
 * ```
 */
export declare function ensureProjectInfo(projectRoot: string, opts?: {
    force?: boolean;
}): Promise<ScaffoldResult>;
/**
 * No-op. Kept for API compatibility.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Scaffold result with action "skipped"
 *
 * @remarks
 * This function was removed in Phase 2 production readiness but the export
 * is preserved to avoid breaking downstream callers.
 *
 * @example
 * ```typescript
 * const result = await ensureContributorMcp('/my/project');
 * // result.action === 'skipped'
 * ```
 */
export declare function ensureContributorMcp(projectRoot: string): Promise<ScaffoldResult>;
/**
 * Detect and write project-context.json.
 * Idempotent: skips if file exists and is less than staleDays old (default: 30).
 *
 * @param projectRoot - Absolute path to the project root directory
 * @param opts - Optional configuration
 * @param opts.force - When true, regenerate even if the file is fresh
 * @param opts.staleDays - Age threshold in days before regeneration (default: 30)
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Runs project type detection (Node, Python, Rust, etc.) and writes the result.
 * Validates against the project-context schema before writing (best-effort).
 *
 * @example
 * ```typescript
 * const result = await ensureProjectContext('/my/project', { staleDays: 7 });
 * if (result.action === 'repaired') console.log('Context refreshed');
 * ```
 */
export declare function ensureProjectContext(projectRoot: string, opts?: {
    force?: boolean;
    staleDays?: number;
}): Promise<ScaffoldResult>;
/**
 * Initialize isolated .cleo/.git checkpoint repository.
 * Idempotent: skips if .cleo/.git already exists.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Creates an isolated git repository inside .cleo/ for checkpoint tracking.
 * The repo uses `GIT_DIR` and `GIT_WORK_TREE` environment variables to avoid
 * interfering with the project's own git repository.
 *
 * @example
 * ```typescript
 * const result = await ensureCleoGitRepo('/my/project');
 * console.log(result.action); // "created" or "skipped"
 * ```
 */
export declare function ensureCleoGitRepo(projectRoot: string): Promise<ScaffoldResult>;
/**
 * Create SQLite database if missing.
 * Idempotent: skips if tasks.db already exists.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Initializes the tasks.db SQLite database by calling `getDb()` which runs
 * schema migrations. Returns a skipped result with error details if initialization fails.
 *
 * @example
 * ```typescript
 * const result = await ensureSqliteDb('/my/project');
 * if (result.action === 'created') console.log('Database ready');
 * ```
 */
export declare function ensureSqliteDb(projectRoot: string): Promise<ScaffoldResult>;
/**
 * Verify all required .cleo/ subdirectories exist.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result with status and list of any missing subdirectories
 *
 * @remarks
 * Read-only diagnostic. Checks for the .cleo/ directory and all entries
 * in `REQUIRED_CLEO_SUBDIRS`. Reports "failed" if .cleo/ is missing,
 * "warning" if subdirectories are missing, "passed" otherwise.
 *
 * @example
 * ```typescript
 * const check = checkCleoStructure('/my/project');
 * if (check.status === 'failed') console.log(check.fix);
 * ```
 */
export declare function checkCleoStructure(projectRoot: string): CheckResult;
/**
 * Verify .cleo/.gitignore exists and matches template.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating whether the gitignore matches the template
 *
 * @remarks
 * Read-only diagnostic. Normalizes whitespace before comparison.
 * Reports "warning" if the file is missing or drifted from the template.
 *
 * @example
 * ```typescript
 * const check = checkGitignore('/my/project');
 * if (check.status === 'warning') console.log('Gitignore drifted');
 * ```
 */
export declare function checkGitignore(projectRoot: string): CheckResult;
/**
 * Verify config.json exists and is valid JSON.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating whether config.json is present and valid
 *
 * @remarks
 * Read-only diagnostic. Reports "failed" if the file is missing or contains
 * invalid JSON. Does not validate config schema, only JSON syntax.
 *
 * @example
 * ```typescript
 * const check = checkConfig('/my/project');
 * if (check.status === 'passed') console.log('Config OK');
 * ```
 */
export declare function checkConfig(projectRoot: string): CheckResult;
/**
 * Verify project-info.json exists with required fields.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating whether project-info.json is valid
 *
 * @remarks
 * Read-only diagnostic. Checks for presence and required fields: projectHash,
 * cleoVersion, and lastUpdated. Reports "warning" on missing fields, "failed" on
 * missing file or invalid JSON.
 *
 * @example
 * ```typescript
 * const check = checkProjectInfo('/my/project');
 * if (check.status !== 'passed') console.log(check.fix);
 * ```
 */
export declare function checkProjectInfo(projectRoot: string): CheckResult;
/**
 * Verify project-context.json exists and is not stale (default: 30 days).
 *
 * @param projectRoot - Absolute path to the project root directory
 * @param staleDays - Age threshold in days before reporting as stale (default: 30)
 * @returns Check result with freshness assessment
 *
 * @remarks
 * Read-only diagnostic. Checks for the `detectedAt` timestamp and compares
 * its age against the staleness threshold. Reports "warning" if stale or
 * missing, "failed" if the file contains invalid JSON.
 *
 * @example
 * ```typescript
 * const check = checkProjectContext('/my/project', 14);
 * if (check.status === 'warning') console.log('Context is stale');
 * ```
 */
export declare function checkProjectContext(projectRoot: string, staleDays?: number): CheckResult;
/**
 * Verify .cleo/.git checkpoint repository exists.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating whether the checkpoint repo is present
 *
 * @remarks
 * Read-only diagnostic. Reports "warning" if the .cleo/.git directory is missing.
 *
 * @example
 * ```typescript
 * const check = checkCleoGitRepo('/my/project');
 * console.log(check.status); // "passed" or "warning"
 * ```
 */
export declare function checkCleoGitRepo(projectRoot: string): CheckResult;
/**
 * Verify .cleo/tasks.db exists and is non-empty.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result with database existence and size information
 *
 * @remarks
 * Read-only diagnostic. Reports "failed" if the file is missing, "warning" if
 * the file exists but is 0 bytes, "passed" otherwise.
 *
 * @example
 * ```typescript
 * const check = checkSqliteDb('/my/project');
 * if (check.status === 'failed') console.log('No database:', check.fix);
 * ```
 */
export declare function checkSqliteDb(projectRoot: string): CheckResult;
/**
 * Create brain.db if missing.
 * Idempotent: skips if brain.db already exists.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Initializes brain.db with Drizzle schema and eagerly creates FTS5 virtual
 * tables for full-text search (T5698). Also ensures FTS5 tables on pre-existing
 * databases that may lack them.
 *
 * @example
 * ```typescript
 * const result = await ensureBrainDb('/my/project');
 * if (result.action === 'created') console.log('Brain database ready');
 * ```
 */
export declare function ensureBrainDb(projectRoot: string): Promise<ScaffoldResult>;
/**
 * Verify .cleo/brain.db exists and is non-empty.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result with database existence and size information
 *
 * @remarks
 * Read-only diagnostic. Reports "failed" if the file is missing, "warning" if
 * the file exists but is 0 bytes, "passed" otherwise.
 *
 * @example
 * ```typescript
 * const check = checkBrainDb('/my/project');
 * console.log(check.status);
 * ```
 */
export declare function checkBrainDb(projectRoot: string): CheckResult;
/**
 * Verify .cleo/memory-bridge.md exists.
 * Warning level if missing (not failure) -- it is auto-generated.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating presence of the memory bridge file
 *
 * @remarks
 * Read-only diagnostic. The memory bridge is auto-generated from brain.db
 * content, so its absence is only a warning (not a failure).
 *
 * @example
 * ```typescript
 * const check = checkMemoryBridge('/my/project');
 * if (check.status === 'warning') console.log('Run: cleo refresh-memory');
 * ```
 */
export declare function checkMemoryBridge(projectRoot: string): CheckResult;
/**
 * Verify .cleo/nexus-bridge.md exists.
 * Warning level if missing (not failure) — it is auto-generated after `cleo nexus analyze`.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating presence of the nexus bridge file
 *
 * @remarks
 * Read-only diagnostic. The nexus bridge is auto-generated from nexus.db
 * content after `cleo nexus analyze` runs, so its absence is only a warning.
 *
 * @example
 * ```typescript
 * const check = checkNexusBridge('/my/project');
 * if (check.status === 'warning') console.log('Run: cleo nexus analyze');
 * ```
 */
export declare function checkNexusBridge(projectRoot: string): CheckResult;
/**
 * Required subdirectories under the global ~/.cleo/ home.
 * These are infrastructure directories managed by CLEO itself,
 * not project-specific data.
 *
 * Truly global:
 *   - logs      — global log output
 *   - templates — CLEO-INJECTION.md symlink target
 *
 * Note: nexus.db lives directly in ~/.cleo/, not a subdir.
 * Schemas are read at runtime from getPackageRoot()/schemas/ — no copy needed.
 * Project-level dirs (adrs/, rcasd/, agent-outputs/, backups/) live in .cleo/ only.
 */
export declare const REQUIRED_GLOBAL_SUBDIRS: readonly ["logs", "templates", "global-recipes", "pi-extensions", "cant-workflows", "agents"];
/**
 * Stale entries that must NOT exist at the global ~/.cleo/ level.
 * These were project-level artefacts accidentally placed in the global home
 * by old versions of CLEO. They are safe to remove because:
 *   - adrs/, rcasd/, agent-outputs/, backups/ — project-level, live in .cleo/
 *   - sandbox/                                — unused
 *   - tasks.db / tasks.db-shm / tasks.db-wal  — project-level database files
 *   - brain-worker.pid                         — stale PID file
 *   - VERSION                                  — redundant (read from package.json)
 *   - schemas/                                 — now read from npm binary at runtime
 *   - bin/                                     — stale dev symlink directory
 */
export declare const STALE_GLOBAL_ENTRIES: readonly ["adrs", "rcasd", "agent-outputs", "backups", "sandbox", "tasks.db", "tasks.db-shm", "tasks.db-wal", "brain-worker.pid", "VERSION", "schemas", "bin", ".install-state", "templates/templates"];
/**
 * Ensure the global ~/.cleo/ home directory and its required
 * subdirectories exist. Idempotent: skips directories that already exist.
 *
 * Also removes known stale project-level entries that old CLEO versions
 * incorrectly placed at the global level (see STALE_GLOBAL_ENTRIES).
 *
 * This is the SSoT for global home scaffolding, replacing raw mkdirSync
 * calls that were previously scattered across global-bootstrap.ts.
 *
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Also creates a global config.json from template if absent. Cleans up
 * stale entries from both the current and legacy (~/.cleo/) global home paths.
 *
 * @example
 * ```typescript
 * const result = await ensureGlobalHome();
 * console.log(result.action); // "created" or "skipped"
 * ```
 */
export declare function ensureGlobalHome(): Promise<ScaffoldResult>;
/**
 * Ensure the global CLEO injection template is installed.
 * Delegates to injection.ts for the template content, but owns the
 * filesystem write to maintain SSoT for scaffolding.
 *
 * Idempotent: skips if the template already exists with correct content.
 *
 * @returns Scaffold result indicating the action taken
 *
 * @remarks
 * Lazy-imports injection.ts to avoid circular dependencies. Compares file
 * content byte-for-byte; repairs if the installed version differs from the
 * bundled template.
 *
 * @example
 * ```typescript
 * const result = await ensureGlobalTemplates();
 * if (result.action === 'repaired') console.log('Template updated');
 * ```
 */
export declare function ensureGlobalTemplates(): Promise<ScaffoldResult>;
/**
 * Perform a complete global scaffold operation: ensure home and templates
 * are all present and current. This is the single entry point for global
 * infrastructure scaffolding.
 *
 * Schemas are NOT copied here — they are read at runtime from the npm
 * package path (getPackageRoot() + '/schemas/'). Use ensureGlobalSchemas()
 * explicitly from init or upgrade if a copy is needed for a specific workflow.
 *
 * Used by:
 *   - CLI startup (via startupHealthCheck in health.ts)
 *   - init (for first-time global setup)
 *   - upgrade (for global repair)
 *
 * @returns Combined scaffold results for home and templates
 *
 * @remarks
 * Calls ensureGlobalHome and ensureGlobalTemplates in sequence.
 * Schemas are NOT copied here -- they are read at runtime from the npm
 * package path.
 *
 * @example
 * ```typescript
 * const { home, templates } = await ensureGlobalScaffold();
 * console.log(home.action, templates.action);
 * ```
 */
export declare function ensureGlobalScaffold(): Promise<{
    home: ScaffoldResult;
    templates: ScaffoldResult;
    cleoosHub: ScaffoldResult;
}>;
/**
 * Ensure the CleoOS Hub subdirectories exist under the global CLEO home,
 * and seed all bundled hub templates if they are not already present.
 *
 * This is the Phase 1 scaffolding entry point. Idempotent: re-running is
 * safe and will never overwrite a file that already exists — human and
 * agent edits to the installed copies are always preserved.
 *
 * @returns Scaffold result for the CleoOS hub root
 *
 * @remarks
 * The CleoOS hub currently consists of:
 *   - `global-recipes/` (Justfile Hub: justfile + README)
 *   - `pi-extensions/`  (Pi extensions: orchestrator, stage-guide, cant-bridge)
 *   - `cant-workflows/` (CANT workflow library — created empty for agents)
 *   - `agents/`         (Global CANT agent definitions — created empty)
 *
 * Templates are sourced from the `@cleocode/cleo` package's bundled
 * `templates/cleoos-hub/` tree. The directory is resolved at runtime through
 * {@link resolveCleoOsHubTemplateRoot} so the same code path works in the
 * monorepo workspace and in an installed npm package layout.
 *
 * @example
 * ```typescript
 * const result = await ensureCleoOsHub();
 * console.log(result.action); // "created" or "skipped"
 * ```
 */
export declare function ensureCleoOsHub(): Promise<ScaffoldResult>;
/**
 * Ensure the Cleo Prime identity file is deployed to the global XDG path.
 *
 * SSoT architecture (T631): CLEOOS-IDENTITY.md lives ONCE at the global path
 * (`~/.local/share/cleo/CLEOOS-IDENTITY.md`). Per-project override is OPTIONAL —
 * a project may place a customized copy at `.cleo/CLEOOS-IDENTITY.md` and the
 * loader (`cant-context.ts readIdentityFile`) reads project-first then global.
 *
 * Called by both `cleo init` (init.ts deployStarterBundle) and `cleo upgrade`
 * (upgrade.ts) so existing projects self-heal on upgrade if the file is missing
 * or out of date.
 *
 * Idempotent. Always overwrites if `forceRefresh` is true (used by `upgrade
 * --refresh-identity`); otherwise only writes when missing.
 *
 * @param forceRefresh - Overwrite even if the file exists. Default false.
 * @returns ScaffoldResult describing what happened.
 */
export declare function ensureGlobalIdentity(forceRefresh?: boolean): Promise<ScaffoldResult>;
/**
 * Check that the global CLEOOS-IDENTITY.md file is present and non-empty.
 * Read-only diagnostic for `cleo doctor`.
 *
 * @returns Check result with status, path details, and self-heal command.
 *
 * @remarks
 * Used by `cleo doctor` to verify the orchestrator persona is installed.
 * Self-heal: `cleo upgrade --refresh-identity` re-deploys from source.
 */
export declare function checkGlobalIdentity(): CheckResult;
/**
 * Check that the global ~/.cleo/ home and its required subdirectories exist.
 * Read-only: no side effects.
 *
 * @returns Check result with status and missing subdirectory details
 *
 * @remarks
 * Reports "failed" if the home directory itself is absent, "warning" if
 * subdirectories are missing, "passed" if all infrastructure is present.
 *
 * @example
 * ```typescript
 * const check = checkGlobalHome();
 * if (check.status !== 'passed') console.log(check.fix);
 * ```
 */
export declare function checkGlobalHome(): CheckResult;
/**
 * Check that the global injection template is present and current.
 * Read-only: no side effects.
 *
 * @returns Check result with template version and sync status
 *
 * @remarks
 * Also checks for version drift between the XDG-compliant path and the
 * legacy ~/.cleo/templates/ path. Reports "warning" if versions differ.
 *
 * @example
 * ```typescript
 * const check = checkGlobalTemplates();
 * console.log(check.details.version);
 * ```
 */
export declare function checkGlobalTemplates(): CheckResult;
/**
 * Check that the project log directory exists.
 * Read-only: no side effects.
 *
 * @param projectRoot - Absolute path to the project root directory
 * @returns Check result indicating whether .cleo/logs/ is present
 *
 * @remarks
 * Reports "warning" if the log directory is absent, "passed" otherwise.
 *
 * @example
 * ```typescript
 * const check = checkLogDir('/my/project');
 * console.log(check.status);
 * ```
 */
export declare function checkLogDir(projectRoot: string): CheckResult;
//# sourceMappingURL=scaffold.d.ts.map