/** * Where protocol files and sync markers live for a loop. This module is the * single seam that knows the on-disk layout — every other module resolves paths * through a {@link PlanContext} rather than hard-coding `worktree/PLAN.md`. * * Two layouts: * - legacy: protocol files at the worktree root, markers under `.opencode/` * (the pre-named-plans behavior; preserved for existing repos). * - named: protocol files under `//`, markers under * `//.state/` — multiple named plans you can switch between. */ export type PlansConfigInput = { /** Base dir for named plans, e.g. ".ralph-rlm/plans". "" / "." = legacy root. */ dir?: string; /** Default active plan name when no active pointer is set. */ active?: string; }; export type PlansMode = "auto" | "legacy" | "named"; export type ResolvedPlansConfig = { mode: PlansMode; dir: string; active: string; }; export declare const DEFAULT_PLANS_DIR = ".ralph-rlm/plans"; export declare const DEFAULT_PLAN_NAME = "default"; export declare function resolvePlansConfig(raw: PlansConfigInput | undefined): ResolvedPlansConfig; export type PlanContext = { worktree: string; mode: "legacy" | "named"; /** Active plan name; "" in legacy mode. */ planName: string; /** Absolute dir holding PLAN.md, RLM_INSTRUCTIONS.md, … */ protocolDir: string; /** Absolute dir holding loop_attempt.json / pending_input.json. */ stateDir: string; /** protocolDir relative to worktree ("" for legacy root) — for patch prefixes. */ protocolRel: string; }; /** Sanitize a plan name to a safe single path segment (no traversal). */ export declare function normalizePlanName(name: string): string; export declare function readActivePlan(worktree: string, plans: ResolvedPlansConfig): Promise; export declare function writeActivePlan(worktree: string, plans: ResolvedPlansConfig, name: string): Promise; export declare function listPlans(worktree: string, plans: ResolvedPlansConfig): Promise; /** * Resolve the plan context for a worktree. In "auto" mode, an existing root * PLAN.md (a legacy install) keeps legacy paths; otherwise the named layout is * used. An explicit `plans.dir` (or "" for legacy) always wins. */ export declare function resolvePlanContext(worktree: string, plans: ResolvedPlansConfig, planName?: string): Promise; export declare function protocolFilePath(ctx: PlanContext, file: string): string; export declare function stateFilePath(ctx: PlanContext, file: string): string; //# sourceMappingURL=plan-paths.d.ts.map