#!/usr/bin/env node
declare function runCodemachineCli(argv?: string[]): Promise<void>;

interface StartupFlowResult {
    mainMenuDisplayed: boolean;
}
declare function runStartupFlow(specDisplayPath?: string): Promise<StartupFlowResult>;

declare function validateSpecification(specificationPath: string): Promise<void>;

declare const CLI_BUNDLE_DIR: string;
declare const CLI_PACKAGE_ROOT: string | undefined;
declare const CLI_ROOT_CANDIDATES: string[];
declare const AGENT_MODULE_FILENAMES: string[];
declare const SHOULD_DEBUG_BOOTSTRAP: boolean;
declare function debugLog(...args: unknown[]): void;
type AgentDefinition = Record<string, unknown> & {
    mirrorPath?: string;
};
type LoadedAgent = AgentDefinition & {
    id: string;
    source?: 'main' | 'sub' | 'legacy' | 'workflow';
};
declare function loadAgents(candidateRoots: string[], filterIds?: string[]): Promise<{
    allAgents: AgentDefinition[];
    subAgents: AgentDefinition[];
}>;

declare function ensureDir(dirPath: string): Promise<void>;
declare function writeFileIfChanged(filePath: string, content: string): Promise<void>;
declare function ensurePromptFile(filePath: string): Promise<void>;
declare function copyPromptFile(sourcePath: string, targetPath: string): Promise<void>;
declare function slugify(value: unknown): string;
declare function ensureSpecificationsTemplate(inputsDir: string): Promise<void>;
declare function mirrorAgentsToJson(agentsDir: string, agents: AgentDefinition[], searchRoots: string[]): Promise<void>;

type WorkspaceBootstrapOptions = {
    projectRoot?: string;
    cwd?: string;
    templatePath?: string;
};
/**
 * Ensures workspace scaffolding under `.codemachine/` and prepares the working directory.
 * Idempotent and safe to run repeatedly.
 */
declare function bootstrapWorkspace(options?: WorkspaceBootstrapOptions): Promise<void>;

export { AGENT_MODULE_FILENAMES, type AgentDefinition, CLI_BUNDLE_DIR, CLI_PACKAGE_ROOT, CLI_ROOT_CANDIDATES, type LoadedAgent, SHOULD_DEBUG_BOOTSTRAP, type StartupFlowResult, type WorkspaceBootstrapOptions, bootstrapWorkspace, copyPromptFile, debugLog, ensureDir, ensurePromptFile, ensureSpecificationsTemplate, loadAgents, mirrorAgentsToJson, runCodemachineCli, runStartupFlow, slugify, validateSpecification, writeFileIfChanged };
