/** * @fileoverview Path resolution for opensip-tools project + user state. * * Per-project state lives at: * * /opensip-tools.config.yml ← TRACKED — project config * /opensip-tools/ ← TRACKED — user-authored * fit/checks/<*.mjs> ← custom fitness checks * fit/recipes/<*.mjs> ← custom fitness recipes * sim/scenarios/<*.mjs> ← custom sim scenarios * sim/recipes/<*.mjs> ← custom sim recipes * .runtime/ ← GITIGNORED — runtime state * sessions/ ← run history * reports/ ← dashboard HTML * logs/ ← structured JSONL logs * datastore.sqlite ← sessions, baselines, catalog * cache/ ← AST + prewarm caches * plugins//node_modules/ ← npm-installed plugins * * ~/.opensip-tools/ ← USER-LEVEL (cross-project) * config.yml ← cloud API key, defaults * plugins/tool/node_modules/ ← user-global Tool plugins * (whole subcommands; * available in every project) * * Every consumer (logger, persistence/store, gate, plugin loader, * configure command, uninstall command) constructs paths through this * resolver instead of using inline string concatenation, so a future * change to the layout is a single-file edit. */ import type { ToolShortId } from '../tools/ids.js'; /** Per-project paths produced by `resolveProjectPaths(projectDir)`. */ export interface ProjectPaths { /** Absolute path to the project root (== input). */ readonly projectDir: string; /** /opensip-tools.config.yml */ readonly configFile: string; /** /opensip-tools — user-authored content root. */ readonly userSourceDir: string; /** * `/opensip-tools//` — a tool's user-authored * plugin source dir (e.g. `userPluginDir('fit', 'checks')`). Generic * over (domain, kind) so the kernel carries no fit/sim vocabulary * (ADR-0009 corollary 1); the layout's `userSubdirs` supply the kinds. */ readonly userPluginDir: (domain: string, kind: string) => string; /** /opensip-tools/.runtime — gitignored runtime state. */ readonly runtimeDir: string; /** /opensip-tools/.runtime/sessions */ readonly sessionsDir: string; /** /opensip-tools/.runtime/reports */ readonly reportsDir: string; /** /opensip-tools/.runtime/logs */ readonly logsDir: string; /** /opensip-tools/.runtime/cache */ readonly cacheDir: string; /** /opensip-tools/.runtime/cache/graph — graph-tool catalog cache root. */ readonly graphCacheDir: string; /** /opensip-tools/.runtime/plugins/ — npm-installed plugins. */ readonly pluginsDir: (domain: string) => string; } /** * Path-resolver domain set for FIRST-PARTY tools — the storage/path * discriminator (`'fit' | 'sim' | 'graph'`). Aliased to `ToolShortId` * from the central registry (audit-round-3 Finding H) so first-party * path/storage sites stay in sync. * * Note this is tool *identity*, a separate concern from plugin * *discovery*: `pluginsDir` / `userPluginDir` take a plain `string` so * third-party tools can host project-local plugins without being listed * here (ADR-0009 corollary 1). */ export type PathDomain = ToolShortId; /** Resolve the project path layout for a given project directory. */ export declare function resolveProjectPaths(projectDir: string): ProjectPaths; /** User-level paths in `~/.opensip-tools/`. */ export interface UserPaths { /** ~/.opensip-tools — root for all user-level state. */ readonly userHomeDir: string; /** ~/.opensip-tools/config.yml — cloud API key + per-user defaults. */ readonly configFile: string; /** * `~/.opensip-tools/plugins/` — user-global (cross-project) * npm-installed plugins. Used today by the `tool` domain: a Tool plugin * is a whole subcommand, so a user-global install makes it available in * every project (like `npm i -g`), unlike fit/sim packs which are * project-committed. Generic over domain for symmetry with * `ProjectPaths.pluginsDir`. */ readonly pluginsDir: (domain: string) => string; /** * ~/.opensip-tools/update-state.json — tool-generated cache of the * last-known newer published version, so the "update available" notice can * persist across runs instead of showing once. NOT user-authored: written * by the update notifier, cleared automatically once the running version * catches up. Distinct from `configFile`, which holds user-authored config. */ readonly updateStateFile: string; } /** Resolve the user-level path layout. */ export declare function resolveUserPaths(): UserPaths; //# sourceMappingURL=paths.d.ts.map