/** * Path discovery for the AgenticROS CLI. * * The CLI can be invoked three ways: * 1. Workspace mode - from a cloned monorepo. Scripts live under * /scripts/, ros2 sources under /ros2_ws/src/, and * built MCP under /packages/agenticros-claude-code/dist/. * 2. Installed mode - after `npx agenticros init` has copied the bundled * snapshot into ~/agenticros (the install dir). Same layout as workspace * mode but rooted at the install dir. This is the "post-init" steady state. * 3. Bundle mode - first invocation of `npx agenticros` before init has run. * Paths point into the package's own runtime/ directory, populated at * publish time by scripts/pack-runtime.mjs. Only read-only tools (doctor, * version, --help) are guaranteed to work in bundle mode. * * Workspace mode is preferred when detected so contributors see their live edits. * Installed mode is preferred over bundle mode so that init-time builds (which * write dist artifacts into ~/agenticros) are honoured on subsequent invocations. */ export type CliMode = "workspace" | "installed" | "bundle"; export interface CliPaths { /** Discovered execution mode. */ mode: CliMode; /** Backwards-compat alias for code that just wants the workspace/installed branch. */ workspaceMode: boolean; /** Directory containing the agenticros CLI package (where runtime/ would live). */ pkgDir: string; /** * Active "repo root" the CLI is operating against. For workspace mode this is * the cloned monorepo. For installed mode this is the install dir. For bundle * mode this is undefined (no writable repo root yet). */ repoRoot: string | undefined; /** Directory where AgenticROS user data lives ($HOME/.agenticros). */ userDataDir: string; /** Default install directory written by `agenticros init` (~/agenticros). */ installDir: string; /** Path to the scripts/ directory (live workspace or bundled snapshot). */ scriptsDir: string; /** Path to ros2_ws/src/ source root (live workspace or bundled snapshot). */ ros2WsSrcDir: string; /** Path to the MCP server build directory (agenticros-claude-code/dist or runtime/mcp). */ mcpDistDir: string; /** Path to bundled sample configs (only meaningful in npm mode; falls back to repo docs/). */ configsDir: string; /** * Path to the bundled snapshot of the monorepo (only set in bundle mode and * for `agenticros init` in installed mode where it's the source-of-truth for * the initial copy). Undefined in workspace mode. */ bundleDir: string | undefined; } /** * True when `dir` looks like an AgenticROS monorepo root (live or installed * snapshot): its package.json is `agenticros-monorepo`. * * Exported so `agenticros init` can use the same predicate `getCliPaths()` * does when deciding whether an existing install dir is complete enough to * skip a re-copy. Keeping the two checks in sync avoids "skipped copy but * still detected as bundle mode -> CLI bug" loops after a crashed previous * install left a half-empty target dir behind. */ export declare function isAgenticrosMonorepo(dir: string): boolean; export declare function getCliPaths(): CliPaths; /** For tests / dev — reset cached path detection. */ export declare function resetPathsCache(): void; /** * Resolve a script under scripts/ (or a relative path like `sim/run_sim.sh`). * Prefers the active workspace/install scriptsDir; if the file is missing * there (stale ~/agenticros from before a CLI upgrade), falls back to the * published package's runtime/scripts snapshot. */ export declare function resolveScriptPath(name: string): string; //# sourceMappingURL=paths.d.ts.map