/**
 * Shared file-path + URL constants for `olam memory` subcommands.
 *
 * memory-service-as-docker-peripheral Phase C C4 dropped `OLAM_BIN_DIR` and
 * `III_BINARY_PATH` (no consumers after Phase B replaced the host-process
 * substrate with `MemoryServiceContainerController`). `MEMORY_PID_PATH` +
 * `MEMORY_LOG_PATH` are retained for the legacy-state migration helper —
 * upgraders from the pre-Phase-B substrate still need cleanup of these
 * artefacts on first new-substrate `olam memory start`.
 *
 * `MEMORY_SERVICE_CANDIDATES` is retained for `bridge.ts` (a separate
 * Cloudflare-bridging subcommand that resolves `packages/memory-service/`
 * for its `local-bridge-server.mjs`). Phase C also dropped the
 * `memory-service-bundle/` candidate — that bundle no longer ships in the
 * @pleri/olam-cli tarball.
 */
import { homedir } from 'node:os';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
export const OLAM_HOME = join(homedir(), '.olam');
export const MEMORY_PID_PATH = join(OLAM_HOME, 'memory.pid');
export const MEMORY_LOG_PATH = join(OLAM_HOME, 'memory-service.log');
export const MEMORY_DATA_DIR = join(OLAM_HOME, 'memory-data');
/** REST + stream ports per upstream iii-config. */
export const MEMORY_REST_PORT = 3111;
export const MEMORY_LIVEZ_URL = `http://localhost:${MEMORY_REST_PORT}/agentmemory/livez`;
/**
 * Resolve packages/memory-service/ from the CLI source location.
 *
 * Two layouts (Phase C removed the bundled-CLI candidate):
 *
 * 1. **Workspace dev (built)** — `packages/cli/dist/commands/memory/_paths.js`
 *    runs in the monorepo. Sibling: `packages/memory-service/`.
 *
 * 2. **Workspace bundled** — `packages/cli/dist/index.js` is the esbuild
 *    bundle (workspace dev path). Sibling: `packages/memory-service/`.
 *
 * 3. **CWD fallback** — operator runs from a repo checkout;
 *    `./packages/memory-service` exists.
 *
 * In a published @pleri/olam-cli tarball, `packages/memory-service/` does
 * NOT ship — operators consume memory-service via the
 * `ghcr.io/pleri/olam-memory-service:latest` Docker image instead. `bridge.ts`
 * is the only remaining consumer of this list; it requires the operator to
 * run from a checkout when invoking `olam memory bridge serve --local`.
 */
const here = dirname(fileURLToPath(import.meta.url));
const candidates = [
    // 1. Workspace dev (built): packages/cli/dist/commands/memory/_paths.js → packages/cli → packages/memory-service
    join(here, '..', '..', '..', '..', 'memory-service'),
    // 2. Workspace bundled: packages/cli/dist/index.js → packages/cli → packages/memory-service
    join(here, '..', '..', 'memory-service'),
    // 3. CWD fallback
    join(process.cwd(), 'packages', 'memory-service'),
];
export const MEMORY_SERVICE_CANDIDATES = candidates;
//# sourceMappingURL=_paths.js.map