"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSocketUserDir = getSocketUserDir;
exports.getSocketAppDir = getSocketAppDir;
exports.getSocketCacacheDir = getSocketCacacheDir;
exports.getSocketDlxDir = getSocketDlxDir;
exports.getSocketAppCacheDir = getSocketAppCacheDir;
exports.getSocketAppCacheTtlDir = getSocketAppCacheTtlDir;
exports.getSocketCliDir = getSocketCliDir;
exports.getSocketRegistryDir = getSocketRegistryDir;
exports.getSocketRegistryGithubCacheDir = getSocketRegistryGithubCacheDir;
/**
 * Path utilities for Socket ecosystem directories.
 * Provides platform-aware path resolution for Socket tools' shared directory structure.
 *
 * Directory Structure:
 * ~/.socket/
 * ├── _cacache/           # Content-addressable cache (shared)
 * ├── _dlx/               # DLX tool installations (shared)
 * ├── _socket/            # Socket CLI app directory
 * ├── _registry/          # Socket Registry app directory
 * └── _sfw/               # Socket Firewall app directory
 */
const node_os_1 = require("node:os");
const node_path_1 = require("node:path");
const CACHE_DIR_1 = require("./constants/CACHE_DIR");
const CACHE_GITHUB_DIR_1 = require("./constants/CACHE_GITHUB_DIR");
const CACHE_TTL_DIR_1 = require("./constants/CACHE_TTL_DIR");
const DOT_SOCKET_DIR_1 = require("./constants/DOT_SOCKET_DIR");
const SOCKET_APP_PREFIX_1 = require("./constants/SOCKET_APP_PREFIX");
const SOCKET_CLI_APP_NAME_1 = require("./constants/SOCKET_CLI_APP_NAME");
const SOCKET_DLX_APP_NAME_1 = require("./constants/SOCKET_DLX_APP_NAME");
const SOCKET_REGISTRY_APP_NAME_1 = require("./constants/SOCKET_REGISTRY_APP_NAME");
/**
 * Get the Socket user directory (~/.socket).
 */
function getSocketUserDir() {
    return node_path_1.join(node_os_1.homedir(), DOT_SOCKET_DIR_1);
}
/**
 * Get a Socket app directory (~/.socket/_<appName>).
 */
function getSocketAppDir(appName) {
    return node_path_1.join(getSocketUserDir(), `${SOCKET_APP_PREFIX_1}${appName}`);
}
/**
 * Get the Socket cacache directory (~/.socket/_cacache).
 */
function getSocketCacacheDir() {
    return node_path_1.join(getSocketUserDir(), `${SOCKET_APP_PREFIX_1}cacache`);
}
/**
 * Get the Socket DLX directory (~/.socket/_dlx).
 */
function getSocketDlxDir() {
    return node_path_1.join(getSocketUserDir(), `${SOCKET_APP_PREFIX_1}${SOCKET_DLX_APP_NAME_1}`);
}
/**
 * Get a Socket app cache directory (~/.socket/_<appName>/cache).
 */
function getSocketAppCacheDir(appName) {
    return node_path_1.join(getSocketAppDir(appName), CACHE_DIR_1);
}
/**
 * Get a Socket app TTL cache directory (~/.socket/_<appName>/cache/ttl).
 */
function getSocketAppCacheTtlDir(appName) {
    return node_path_1.join(getSocketAppCacheDir(appName), CACHE_TTL_DIR_1);
}
/**
 * Get the Socket CLI directory (~/.socket/_socket).
 */
function getSocketCliDir() {
    return getSocketAppDir(SOCKET_CLI_APP_NAME_1);
}
/**
 * Get the Socket Registry directory (~/.socket/_registry).
 */
function getSocketRegistryDir() {
    return getSocketAppDir(SOCKET_REGISTRY_APP_NAME_1);
}
/**
 * Get the Socket Registry GitHub cache directory (~/.socket/_registry/cache/ttl/github).
 */
function getSocketRegistryGithubCacheDir() {
    return node_path_1.join(getSocketAppCacheTtlDir(SOCKET_REGISTRY_APP_NAME_1), CACHE_GITHUB_DIR_1);
}
