import type { ChangeSize, ExecutionMode, FileArea, TaskType, ToolName } from "./config.js";
import { type SearchGuidance } from "./guidance.js";
import type { CurrentFocusRecord } from "./memory.js";
export type PhaseStatus = "in-progress" | "complete" | "blocked";
export interface PhaseRoutingSummary {
    taskType: TaskType;
    primaryTool: ToolName;
    reviewTool: ToolName;
    riskLevel: "low" | "medium" | "high";
    fileArea: FileArea;
    changeSize: ChangeSize;
    requiredRoles: string[];
}
export interface ChangedFilesSummary {
    isGitRepo: boolean;
    branch?: string;
    stagedCount: number;
    unstagedCount: number;
    untrackedCount: number;
    changedFiles: string[];
}
export interface PhaseRecord {
    artifactType: "shrey-junior/current-phase";
    version: 3;
    timestamp: string;
    phaseId: string;
    label: string;
    goal: string;
    profile: string;
    mode: ExecutionMode;
    tool?: ToolName;
    status: PhaseStatus;
    routingSummary: PhaseRoutingSummary;
    authorityFiles: string[];
    changedFilesSummary?: ChangedFilesSummary;
    validationsRun: string[];
    warnings: string[];
    openIssues: string[];
    latestMemoryFocus: string;
    nextRecommendedSpecialist: string;
    nextSuggestedMcpPack: string;
    nextRecommendedStep: string;
    previousTool?: ToolName;
    previousPhaseId?: string;
}
export interface ActiveRoleHintsRecord {
    artifactType: "shrey-junior/active-role-hints";
    version: 2;
    updatedAt: string;
    activeRole: string;
    supportingRoles: string[];
    authoritySource: string;
    projectType: string;
    readNext: string[];
    nextFileToRead: string;
    nextSuggestedCommand: string;
    writeTargets: string[];
    checksToRun: string[];
    stopConditions: string[];
    nextAction: string;
    nextRecommendedSpecialist: string;
    nextSuggestedMcpPack: string;
    searchGuidance: SearchGuidance;
    latestMemoryFocus: string | null;
    latestCheckpoint: string | null;
    latestTaskPacket: string | null;
    latestHandoff: string | null;
    latestDispatchManifest: string | null;
    latestReconcile: string | null;
}
export interface CheckpointDirtyState {
    isGitRepo: boolean;
    clean: boolean;
    branch?: string;
    stagedCount: number;
    unstagedCount: number;
    untrackedCount: number;
}
export interface CheckpointTaskContext {
    goal: string;
    taskType: TaskType;
    fileArea: FileArea;
    changeSize: ChangeSize;
    riskLevel: "low" | "medium" | "high";
    primaryTool?: ToolName;
    reviewTool?: ToolName;
}
export interface CheckpointRecord {
    artifactType: "shrey-junior/checkpoint";
    schemaVersion: 1;
    createdAt: string;
    checkpointId: string;
    phase: string;
    activeRole: string;
    supportingRoles: string[];
    authoritySource: string;
    summary: string;
    taskContext: CheckpointTaskContext;
    filesTouched: string[];
    filesCreated: string[];
    filesDeleted: string[];
    checksRun: string[];
    checksPassed: string[];
    checksFailed: string[];
    gitBranch: string | null;
    gitCommitBefore: string | null;
    gitCommitAfter: string | null;
    dirtyState: CheckpointDirtyState;
    stagedFiles: string[];
    relatedTaskPacket: string | null;
    relatedHandoff: string | null;
    relatedReconcile: string | null;
    latestMemoryFocus: string | null;
    nextRecommendedSpecialist: string;
    nextSuggestedMcpPack: string;
    nextRecommendedAction: string;
    nextSuggestedCommand: string;
}
export interface HandoffRecord {
    artifactType: "shrey-junior/handoff";
    version: 2;
    createdAt: string;
    toTool: ToolName;
    fromRole: string;
    toRole: string;
    taskId: string;
    fromPhaseId?: string;
    previousTool?: ToolName;
    summary: string;
    goal: string;
    profile: string;
    mode: ExecutionMode;
    workCompleted: string[];
    filesTouched: string[];
    checksRun: string[];
    checksPassed: string[];
    checksFailed: string[];
    evidence: string[];
    openQuestions: string[];
    risks: string[];
    nextFile: string;
    nextCommand: string;
    recommendedMcpPack: string;
    checkpointPointer: string | null;
    readFirst: string[];
    writeTargets: string[];
    checksToRun: string[];
    stopConditions: string[];
    searchGuidance: SearchGuidance;
    whatChanged: string[];
    validationsPending: string[];
    risksRemaining: string[];
    latestCheckpoint?: string;
    checkpointSummary?: string;
    nextStep: string;
    status: "ready" | "blocked";
}
export interface PacketDirectorySummary {
    name: string;
    relativePath: string;
    fileCount: number;
}
export interface LatestTaskPacketSet {
    artifactType: "shrey-junior/latest-task-packets";
    version: number;
    createdAt: string;
    packetSet: string;
    files: string[];
}
export interface ContinuitySnapshot {
    latestPhase: PhaseRecord | null;
    latestHandoff: HandoffRecord | null;
    latestCheckpoint: CheckpointRecord | null;
    currentFocus: CurrentFocusRecord | null;
}
export declare function getStatePaths(targetRoot: string): {
    root: string;
    currentPhase: string;
    activeRoleHints: string;
    historyDir: string;
    checkpointsDir: string;
    latestCheckpointJson: string;
    latestCheckpointMarkdown: string;
    handoffDir: string;
    latestTaskPackets: string;
};
export declare function ensureStateLayout(targetRoot: string): Promise<ReturnType<typeof getStatePaths>>;
export declare function buildPhaseId(label: string, timestamp: string): string;
export declare function writePhaseRecord(targetRoot: string, record: PhaseRecord): Promise<{
    currentPhasePath: string;
    historyPath: string;
}>;
export declare function loadCurrentPhase(targetRoot: string): Promise<PhaseRecord | null>;
export declare function loadActiveRoleHints(targetRoot: string): Promise<ActiveRoleHintsRecord | null>;
export declare function writeActiveRoleHints(targetRoot: string, record: ActiveRoleHintsRecord): Promise<string>;
export declare function updateActiveRoleHints(targetRoot: string, patch: Partial<ActiveRoleHintsRecord> & Pick<ActiveRoleHintsRecord, "activeRole" | "authoritySource" | "projectType">): Promise<string>;
export declare function loadLatestCheckpoint(targetRoot: string): Promise<CheckpointRecord | null>;
export declare function writeCheckpointArtifacts(targetRoot: string, record: CheckpointRecord): Promise<{
    jsonPath: string;
    latestJsonPath: string;
    latestMarkdownPath: string;
}>;
export declare function loadLatestHandoff(targetRoot: string, toTool?: ToolName): Promise<HandoffRecord | null>;
export declare function writeHandoffArtifacts(targetRoot: string, baseName: string, handoff: HandoffRecord, markdown: string, brief: string): Promise<{
    markdownPath: string;
    jsonPath: string;
    briefPath: string;
}>;
export declare function writeLatestTaskPacketSet(targetRoot: string, files: string[]): Promise<string | null>;
export declare function listTaskPacketDirectories(targetRoot: string): Promise<PacketDirectorySummary[]>;
export declare function loadLatestTaskPacketSet(targetRoot: string): Promise<LatestTaskPacketSet | null>;
export declare function loadContinuitySnapshot(targetRoot: string, toTool?: ToolName): Promise<ContinuitySnapshot>;
export declare function parseCsvFlag(value: string | undefined): string[];
export declare function renderCheckpointMarkdown(record: CheckpointRecord): string;
//# sourceMappingURL=state.d.ts.map