export declare const SENAI_DIR = ".IDE_Plans/pi-senai"; export declare const STATE_FILE = "state.json"; export declare const RUNS_DIR = "runs"; export declare const ARCHITECT_STATE_DIR = ".pi/architect"; export declare const ARCHITECT_MAP_DIR = ".IDE_Plans/architect-map"; export declare const CADENCE_FILE = "spawn-cadence.json"; /** Lock directory name under SENAI_DIR. Holds `meta.json` while a Senai * command holds the run lock. The directory itself is the lock primitive * on POSIX (`mkdir` is atomic); the file inside carries holder metadata. */ export declare const LOCK_DIR_NAME = ".lock"; export declare const LOCK_FILE_NAME = "meta.json"; export type Stage = "none" | "planning" | "planned" | "implementing" | "implemented" | "documenting" | "documented" | "delivering" | "delivered"; export declare const STAGES: Stage[]; /** Numeric rank of each stage so checks can compare "is this stage at or past X?". * Kept in lock-step with STAGES above. */ export declare const STAGE_RANK: Record; /** Valid stage transitions. Each key lists the stages that may follow it. */ export declare const STAGE_TRANSITIONS: Record; export interface StageArtifactPaths { runDir: string; planDir: string; planScoutsDir: string; planReviewsDir: string; implementDir: string; documentDir: string; deliverDir: string; plan: string; planOverview: string; discussionNotes: string; scoutAngle1: string; scoutAngle2: string; scoutAngle3: string; scoutAngle4: string; reviewCorrectness: string; reviewSecurity: string; reviewTests: string; reviewArchitecture: string; manifestDiffReport: string; archRulesReport: string; frameworkRulesReport: string; securityReport: string; deliverSummary: string; } export declare function getSenaiDir(cwd: string): string; /** Absolute path to the adaptive spawn cadence state file. Lives next to * state.json; the cadence tracks which dispatch tier (A/B/C/D) the Plan * stage should use. */ export declare function getCadencePath(cwd: string): string; export declare function getLockDir(cwd: string): string; export declare function getLockPath(cwd: string): string; export declare function getArchitectStateDir(cwd: string): string; export declare function getArchitectMapDir(cwd: string): string; export declare function getStatePath(cwd: string): string; export declare function getRunDir(cwd: string, runId: string): string; export declare const PRE_RUN_DISCUSSION_DIR = ".IDE_Plans/pi-senai/discussions/pre-run"; /** Brainstorm folder root. Brainstorm always owns its own run-id and writes * to .IDE_Plans/pi-senai/Brainstorm//. When /senai-plan * adopts a brainstorm run id, it copies the brief into the matching * .IDE_Plans/pi-senai/runs// folder for the rest of the pipeline. * This prevents the "multiple brainstorms for one project" conflict that * the single shared pre-run/ folder used to create. */ export declare const BRAINSTORM_DIR_NAME = "Brainstorm"; /** Absolute path to the legacy pre-run discussion directory. Kept for * backward-compat reads of old briefs; new writes go to the brainstorm * folder. Will be removed after the next migration pass. */ export declare function getPreRunDiscussionDir(cwd: string): string; /** Absolute path to a brainstorm folder. The brainstorm command creates this * on entry and persists the id in state.json. */ export declare function getBrainstormDir(cwd: string, brainstormRunId: string): string; /** Absolute path to the brainstorm mission-brief.md. */ export declare function getBrainstormMissionBriefPath(cwd: string, brainstormRunId: string): string; /** Absolute path to the brainstorm discussion folder. Each brainstorm run id * has its own discussion folder, so multiple brainstorms for the same * project never overwrite each other. */ export declare function getBrainstormDiscussionDir(cwd: string, brainstormRunId: string): string; /** Absolute path to the brainstorm dispatch audit log. Filled by the audit * layer (Phase 5). Created on demand; never required for brainstorm to * start. */ export declare function getBrainstormDispatchLogPath(cwd: string, brainstormRunId: string): string; /** Absolute path to a run's discussion directory. Created on demand by the * discussion command; never created by /senai-plan. */ export declare function getRunDiscussionsDir(cwd: string, runId: string): string; /** Absolute path to the active run's mission-brief.md. Lives at the run * root (sibling of plan/, implement/, document/, deliver/, discussions/), * matching the spec-kit in-place integration. */ export declare function getRunMissionBriefPath(cwd: string, runId: string): string; /** Absolute path to a pre-run mission-brief.md. Legacy; new writes go to * the brainstorm folder via getBrainstormMissionBriefPath. */ export declare function getPreRunMissionBriefPath(cwd: string): string; /** Directory that holds the cross-run community-research cache. Lives * next to state.json under SENAI_DIR. Project-local, never global. */ export declare const COMMUNITY_RESEARCH_CACHE_DIR = ".cache/community-research"; export declare const COMMUNITY_RESEARCH_CACHE_CAP = 50; /** Absolute path to the cross-run community-research cache directory. */ export declare function getCommunityResearchCacheDir(cwd: string): string; /** Absolute path to a single cache file keyed by content hash. */ export declare function getCommunityResearchCachePath(cwd: string, hash: string): string; /** Absolute path to a run-scoped community-research transcript. Created on * demand by the discussion handler. */ export declare function getRunCommunityResearchTranscriptPath(cwd: string, runId: string, sequence: string, slug: string): string; /** Absolute path to a pre-run community-research transcript. */ export declare function getPreRunCommunityResearchTranscriptPath(cwd: string, sequence: string, slug: string): string; export declare function getArtifactPaths(cwd: string, runId: string): StageArtifactPaths; export interface StageArtifactEntry { /** Run-relative label shown in reports, e.g. "plan/scouts/scout-angle_1.md". */ label: string; path: string; } /** The single plan-stage artifact manifest (11 entries: plan, overview, * discussion notes, 4 scouts, 4 reviews). Both the approve command's * missing-artifact check and doctor's run-artifact audit read this list so * they can never disagree about what the plan stage must produce. */ export declare function planStageArtifactManifest(cwd: string, runId: string): StageArtifactEntry[]; export declare function getDefaultArtifactPaths(): StageArtifactPaths; export declare function makeRunId(mission: string): string; export declare function formatStageStatus(state: { currentStage: Stage; mission?: string; runId?: string; }): string;