import { INSTALL_ROOT, DEFAULTS_DIR, PACKAGE_ROOT, SERVER_ROOT, REPO_ROOT, DATA_DIR, CONFIG_DIR, STORE_DIR, CONTEXT_DIR, PROJECTS_DIR, WORKSPACE_DIR, resolveWorkspaceRelPath, PLUGINS_DIR, PROMPTS_DIR, HOOKS_DIR } from './paths.js'; /** Directories to skip during recursive filesystem scans */ declare const SKIP_DIRS: Set; declare function moduleDir(importMetaUrl: any): string; declare function isMainModule(importMetaUrl: any): boolean; declare function readableTimestamp(): string; /** Split text into chunks of maxChunk chars, breaking at line boundaries. * When hrSplitEvery > 0, also force a new chunk before the Nth horizontal * rule (---) to avoid Slack's "Show full message" truncation. */ declare function chunkText(text: any, maxChunk?: number, hrSplitEvery?: number): any[]; /** Format seconds as compact human-readable duration (e.g. "5s", "2m 30s", "1m") */ declare function formatDurationCompact(seconds: any): string; /** Today's date as ISO string (YYYY-MM-DD) */ declare function todayISO(): string; /** * List subdirectories of PROJECTS_DIR that look like project folders. * * Filters out: * - non-directories (e.g. top-level files like CORTEX.md, AGENTS.md that * some users keep next to their projects/ tree) * - dotfiles (.git, .obsidian, etc.) * * Returns [] if the directory does not exist or is unreadable. * Use this everywhere instead of `fs.readdirSync(PROJECTS_DIR)` to avoid * treating stray files as projects (would surface as ghost projects in * `cortex-task lock-status`, `stats`, id-assignment, etc.). */ declare function listProjectDirs(projectsDir?: string): string[]; /** * Resolve the npm global prefix that an installed CLI actually lives under. * * `npm install/update -g` targets npm's *configured* prefix. When Cortex was installed * with an explicit `--prefix ~/.npm-global` but no `prefix=` line was written to .npmrc, * npm falls back to the system prefix (/usr/lib/node_modules), which is root-owned: * self-update then dies with EACCES, and version probes report the package as missing. * * The installed binary is the ground truth — npm places it at `/bin/` * next to `/lib/node_modules`. Walk PATH, find the binary, derive the prefix. * `CORTEX_NPM_PREFIX` overrides. Returns null when nothing matches, so callers fall * back to a plain `-g` (npm's own resolution). */ declare function resolveNpmGlobalPrefix(binName: string, opts?: { pathEnv?: string; override?: string; exists?: (p: string) => boolean; }): string | null; /** Append `--prefix ` to an npm argv when a prefix could be resolved. */ declare function withNpmPrefix(args: string[], binName: string): string[]; /** * Sentinel ANTHROPIC_API_KEY value set when the gateway is healthy but no real key exists. * Its only purpose is to satisfy Claude Code's startup credential check on machines without * OAuth login — upstream auth is handled by the gateway's own configured keys. Anything that * treats ANTHROPIC_API_KEY as a real credential (gateway-generator discovery, saved-env * snapshots) must ignore this value. */ declare const GATEWAY_MANAGED_KEY_PLACEHOLDER = "cortex-gateway-managed"; export { INSTALL_ROOT, DEFAULTS_DIR, PACKAGE_ROOT, SERVER_ROOT, REPO_ROOT, DATA_DIR, CONFIG_DIR, STORE_DIR, CONTEXT_DIR, PROJECTS_DIR, WORKSPACE_DIR, resolveWorkspaceRelPath, PLUGINS_DIR, PROMPTS_DIR, HOOKS_DIR, SKIP_DIRS, GATEWAY_MANAGED_KEY_PLACEHOLDER, moduleDir, isMainModule, readableTimestamp, chunkText, formatDurationCompact, todayISO, listProjectDirs, resolveNpmGlobalPrefix, withNpmPrefix };