/** * PhotonContext — Single source of truth for all path resolution. * * Replaces the scattered mix of DEFAULT_PHOTON_DIR, DEFAULT_WORKING_DIR, * process.env.PHOTON_DIR, and per-constructor baseDir parameters. * * Design: * - All runtime data lives under {baseDir}/.data/ * - Daemon socket/pid/log ALWAYS resolve to ~/.photon/.data/ (one global daemon) * - baseDir/dataDir/cacheDir/configFile respect PHOTON_DIR env var overrides * - Immutable after creation — no runtime mutations */ import { type ListedPhoton } from '@portel/photon-core'; export interface PhotonContext { /** Base directory for photon files (~/.photon or PHOTON_DIR override) */ readonly baseDir: string; /** Root of all runtime data — ALWAYS ~/.photon/.data (canonical, never cwd-relative) */ readonly dataDir: string; /** Cache directory — ALWAYS ~/.photon/.data/.cache */ readonly cacheDir: string; /** Config file path (baseDir/config.json) — committable, not inside .data */ readonly configFile: string; /** Daemon socket — ALWAYS ~/.photon/.data/daemon.sock (global daemon) */ readonly socketPath: string; /** Daemon PID file — ALWAYS ~/.photon/.data/daemon.pid */ readonly pidFile: string; /** Daemon log file — ALWAYS ~/.photon/.data/daemon.log */ readonly logFile: string; } /** * Get the default PhotonContext. * Priority: cwd (if it contains .photon.ts files) > PHOTON_DIR env var > ~/.photon. * * Not cached — env var may change between calls (e.g. tests). */ export declare function getDefaultContext(): PhotonContext; /** * Get the local workspace directory if cwd or PHOTON_DIR points to a * photon/marketplace folder that isn't ~/.photon itself. * * Priority: PHOTON_DIR (explicit override) > cwd (implicit detection). * Returns null when no extra workspace applies. */ export declare function getLocalWorkspace(): string | null; /** * Discover photons from all sources, merged with correct priority: * 1. PHOTON_DIR / cwd marketplace — highest priority (same name wins) * 2. ~/.photon (global installed photons) * * This ensures that when you're in a marketplace folder (or PHOTON_DIR * is set), those photons overlay the global ones for development/testing. */ export declare function discoverPhotons(): Promise; /** * Discover photons from baseDir only — no global merge. * Used by Beam to scope the sidebar to the current project. * Relies on PHOTON_DIR being set at the entry point. */ export declare function discoverLocalPhotons(): Promise; /** * Resolve a photon by name across all discovery sources. * Priority: PHOTON_DIR / local workspace > ~/.photon > null. * * When a local file shadows an installed photon of the same name we warn * to stderr. The local and installed versions have SEPARATE memory stores * (different namespaces / different baseDir), so silent shadowing is a * frequent source of "my state disappeared" reports. */ export declare function resolvePhotonFromAllSources(name: string): Promise; //# sourceMappingURL=context.d.ts.map