/** * Path layout. All developer-level state lives in ~/.wrongstack/. * Per-project state is keyed by the canonical project root under * ~/.wrongstack/projects//. Linked Git worktrees resolve to their main * checkout so coordination and durable state are shared across worktrees. * * The ONLY thing inside the project tree is the optional * .wrongstack/AGENTS.md (committed) and .wrongstack/skills/ (committed). */ export interface WstackPaths { /** ~/.wrongstack — global root. */ globalRoot: string; /** Active profile name resolved from the bootstrap config. */ profileName: string; /** ~/.wrongstack/profiles/ — active user-profile root. */ profileDir: string; /** Absolute project root. */ projectRoot: string; /** Home directory (~) — base for foreign tool state (~/.codex, ~/.agents, …). */ homeDir: string; /** * ~/.wrongstack/profiles/ — directory for profile-scoped * user state (mode.json, statusline.json, custom-context-modes.json, …). */ configDir: string; /** ~/.wrongstack/config.json — bootstrap config (activeProfile + version). */ globalConfig: string; /** * ~/.wrongstack/profiles — directory containing per-profile configs. * Each profile has its own subdirectory with a config.json. */ profilesDir: string; /** * Resolve the config path for a named profile. * Returns ~/.wrongstack/profiles//config.json. */ profileConfig: (name: string) => string; /** Resolve ~/.wrongstack/profiles//statusline.json */ profileStatuslineConfig: (name: string) => string; /** Resolve ~/.wrongstack/profiles//mode.json */ profileModeConfig: (name: string) => string; /** Resolve ~/.wrongstack/profiles//provider-status.json */ profileProviderStatus: (name: string) => string; /** Resolve ~/.wrongstack/profiles//update-cache.json */ profileUpdateCache: (name: string) => string; /** ~/.wrongstack/.key — 32 random bytes, mode 0600, AES-GCM key for the secret vault. */ secretsKey: string; /** ~/.wrongstack/profiles//memory.md — profile memory. */ globalMemory: string; /** ~/.wrongstack/profiles//skills — profile skills. */ globalSkills: string; /** ~/.claude/skills — user-global skills from foreign coding agents (Claude Code, Codex, …). Read-only. */ globalClaudeSkills: string; /** ~/.wrongstack/profiles//design-kits — profile Design Studio kits. */ globalDesignKits: string; /** ~/.wrongstack/profiles//prompts — profile prompt library. */ globalPrompts: string; /** ~/.wrongstack/profiles//instructions — profile instruction overrides. */ globalInstructions: string; /** ~/.wrongstack/profiles//prompt-usage.json — prompt usage. */ promptUsage: string; /** ~/.wrongstack/cache — fetched data (models.dev, etc.). */ cacheDir: string; /** ~/.wrongstack/cache/models.dev.json */ modelsCache: string; /** ~/.wrongstack/cache/models-overlay.json — cached curated overlay. */ modelsOverlayCache: string; /** * Per-project codebase symbol index (SQLite). Lives under the global project * dir — NOT inside the repo — so it never clutters the working tree or needs * gitignoring. `~/.wrongstack/projects//codebase-index`. */ projectCodebaseIndex: string; /** ~/.wrongstack/profiles//history — REPL line history. */ historyFile: string; /** ~/.wrongstack/logs/wrongstack.log */ logFile: string; /** ~/.wrongstack/projects/ */ projectDir: string; /** ~/.wrongstack/projects//memory.md */ projectMemory: string; /** ~/.wrongstack/projects//sessions */ projectSessions: string; /** ~/.wrongstack/projects//trust.json */ projectTrust: string; /** ~/.wrongstack/projects//meta.json */ projectMeta: string; /** ~/.wrongstack/projects//config.local.json — optional override */ projectLocalConfig: string; /** /.wrongstack/config.json — per-project settings (safe fields only). * This lives inside the project root so it can be gitignored or shared. */ inProjectConfig: string; /** /.wrongstack/AGENTS.md — committed project memory. */ inProjectAgentsFile: string; /** /.wrongstack/skills — committed project skills. */ inProjectSkills: string; /** /.claude/skills — project skills authored for foreign coding agents (Claude Code, …). Read-only. */ inProjectClaudeSkills: string; /** /.wrongstack/prompts — committed project prompt library. */ inProjectPrompts: string; /** /.wrongstack/instructions — committed project instruction overrides. */ inProjectInstructions: string; /** /.wrongstack/design-kits — committed project Design Studio kits. */ inProjectDesignKits: string; /** /.wrongstack/worktrees — git worktrees for per-phase isolation (gitignored). */ inProjectWorktrees: string; /** Stable hash for the canonical project root (shared by linked Git worktrees). */ projectHash: string; /** Human-readable canonical project slug, shared by linked Git worktrees. */ projectSlug: string; /** ~/.wrongstack/projects//goal.json — goal persistence */ projectGoal: string; /** ~/.wrongstack/projects//input-history.json — TUI prompt input history */ projectInputHistory: string; /** ~/.wrongstack/projects//specs — SDD spec files */ projectSpecs: string; /** ~/.wrongstack/projects//task-graphs — SDD task graphs */ projectTaskGraphs: string; /** ~/.wrongstack/projects//sdd-session.json — SDD session state */ projectSddSession: string; /** ~/.wrongstack/projects//plan.json — plan persistence */ projectPlan: string; /** ~/.wrongstack/projects//autophase — Goal phase-graph JSON files (dir name kept for backward compat) */ projectAutophase: string; /** ~/.wrongstack/projects//sdd-boards — live SDD board snapshots + JSONL event logs */ projectSddBoards: string; /** ~/.wrongstack/profiles//sync.json — CloudSync configuration */ syncConfig: string; /** ~/.wrongstack/config-history — timestamped backups on every config write */ configHistoryDir: string; /** Function to get the status.json path for a project given its hash. */ projectStatus: (projectHash: string) => string; } /** * Resolve the stable project identity root used by global WrongStack state. * * A linked Git worktree has its own checkout path and a `.git` *file* that * points into `
/.git/worktrees/`. Its `commondir` points back to * the main checkout's `.git` directory. Treating the linked checkout path as * the project identity would split one repository into multiple session, * registry, and mailbox directories — agents in different worktrees would be * unable to see or message each other. * * Project-local paths still use the caller's actual checkout. Only global * state identity is canonicalized. Non-Git projects, normal checkouts, Git * submodules, and separate-git-dir layouts keep their existing identity. */ export declare function canonicalProjectRoot(absRoot: string): string; export declare function projectHash(absRoot: string): string; /** * Human-readable project directory name: slugified folder name + short hash * suffix for uniqueness. e.g. `wrongstack-a1b2c3` instead of `3024e5e6fa58`. */ export declare function projectSlug(absRoot: string): string; export interface WstackPathOptions { userHome?: string | undefined; projectRoot: string; /** Override the global root (e.g. for tests). Default: `${userHome}/.wrongstack`. */ globalRoot?: string | undefined; /** Explicit profile override. Otherwise read from the root bootstrap config. */ profileName?: string | undefined; } /** Make an untrusted profile name safe for use as one path segment. */ export declare function safeProfileName(name: string | undefined): string; /** * Resolve the selected profile from ~/.wrongstack/config.json. The root file * is bootstrap metadata only; a missing/corrupt bootstrap selects `default`. */ export declare function activeProfileName(globalRoot: string): string; /** * The global `~/.wrongstack` root, honoring the `WRONGSTACK_HOME` env * override. The override exists so tests (and sandboxed runs) can redirect * ALL global state — config, secrets, logs, projects/, mailboxes — away from * the real user home. Before it existed, `pnpm test` booted runtimes against * the real `~/.wrongstack`: it read the user's real config.json (starting a * second live Telegram poller), appended to the real wrongstack.log, and left * ~20k orphaned fixture dirs under projects/. * * Every code path that wants the global dir must come through here (or * through `resolveWstackPaths`) instead of `path.join(os.homedir(), '.wrongstack')`. */ export declare function wstackGlobalRoot(): string; export declare function resolveWstackPaths(opts: WstackPathOptions): WstackPaths; //# sourceMappingURL=wstack-paths.d.ts.map