"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LINUX_SYSTEMD_USER_DIRECTORY = exports.MACOS_LAUNCH_AGENTS_DIRECTORY = exports.EVENT_HOOKS_LEDGER_FILENAME = exports.EVENT_HOOKS_USER_CONFIG_FILENAME = exports.EVENT_HOOKS_PROJECTS_DIRECTORY_NAME = exports.EVENT_HOOKS_GLOBAL_DIRECTORY_NAME = exports.EVENT_HOOKS_DIRECTORY_NAME = exports.NETWORK_RECOVERY_STATE_FILENAME = exports.SERVICE_REPO_STATE_FILENAME = exports.SERVICE_DRAIN_STATE_FILENAME = exports.SERVICE_PID_FILENAME = exports.REPO_REGISTRY_FILENAME = exports.AUTH_PROFILE_DIRECTORIES_DIRECTORYNAME = exports.AUTH_PROFILE_STATE_FILENAME = exports.AUTH_PROFILES_FILENAME = exports.SYSTEM_CATALOG_DIRECTORY = exports.SYSTEM_WORKFLOW_TEMPLATE_DIRECTORY = exports.CATALOG_REQUIREMENT_EXCLUSIONS_FILENAME = exports.CATALOG_METADATA_FILENAME = exports.MCP_CATALOG_FILENAME = exports.SKILL_CATALOG_FILENAME = exports.CATALOG_DIRECTORY = exports.CODEX_REPO_SKILL_DIRECTORY = exports.CLAUDE_REPO_SKILL_DIRECTORY = exports.getControlPlaneHomePath = exports.CONFIG_FILENAME = void 0;
exports.getPackageRoot = getPackageRoot;
exports.getCanonicalSkillDirectory = getCanonicalSkillDirectory;
exports.getCanonicalSkillPath = getCanonicalSkillPath;
exports.getPackageSystemWorkflowsDirectory = getPackageSystemWorkflowsDirectory;
exports.getPackageSystemCatalogDirectory = getPackageSystemCatalogDirectory;
exports.getPackageSystemPromptsDirectory = getPackageSystemPromptsDirectory;
exports.getPackageSystemSkillCatalogPath = getPackageSystemSkillCatalogPath;
exports.getPackageSystemMcpCatalogPath = getPackageSystemMcpCatalogPath;
exports.getPackageSystemCatalogMetadataPath = getPackageSystemCatalogMetadataPath;
exports.getRepoRegistryPath = getRepoRegistryPath;
exports.getAuthProfilesPath = getAuthProfilesPath;
exports.getAuthProfileStatePath = getAuthProfileStatePath;
exports.getAuthProfileDirectory = getAuthProfileDirectory;
exports.getAuthProfileDirectoriesRootPath = getAuthProfileDirectoriesRootPath;
exports.getCodexHomePath = getCodexHomePath;
exports.getClaudeConfigDirPath = getClaudeConfigDirPath;
exports.getServicePidPath = getServicePidPath;
exports.getServiceDrainStatePath = getServiceDrainStatePath;
exports.getServiceRepoStatePath = getServiceRepoStatePath;
exports.getServiceLogPath = getServiceLogPath;
exports.getNetworkRecoveryStatePath = getNetworkRecoveryStatePath;
exports.getMachineCatalogRequirementExclusionsPath = getMachineCatalogRequirementExclusionsPath;
exports.getEventHooksGlobalConfigPath = getEventHooksGlobalConfigPath;
exports.getEventHooksGlobalLedgerPath = getEventHooksGlobalLedgerPath;
exports.getEventHooksProjectConfigPath = getEventHooksProjectConfigPath;
exports.getEventHooksProjectLedgerPath = getEventHooksProjectLedgerPath;
exports.getMacOsLaunchAgentPath = getMacOsLaunchAgentPath;
exports.getLinuxSystemdUserServicePath = getLinuxSystemdUserServicePath;
const node_os_1 = __importDefault(require("node:os"));
const node_path_1 = __importDefault(require("node:path"));
const branding_1 = require("./branding");
const control_plane_home_1 = require("./control-plane-home");
const global_settings_1 = require("./global-settings");
var branding_2 = require("./branding");
Object.defineProperty(exports, "CONFIG_FILENAME", { enumerable: true, get: function () { return branding_2.CONFIG_FILENAME; } });
var control_plane_home_2 = require("./control-plane-home");
Object.defineProperty(exports, "getControlPlaneHomePath", { enumerable: true, get: function () { return control_plane_home_2.getControlPlaneHomePath; } });
exports.CLAUDE_REPO_SKILL_DIRECTORY = `.claude/skills/${branding_1.REPO_SKILL_NAME}`;
exports.CODEX_REPO_SKILL_DIRECTORY = `.agents/skills/${branding_1.REPO_SKILL_NAME}`;
exports.CATALOG_DIRECTORY = "catalog";
exports.SKILL_CATALOG_FILENAME = "skill.json";
exports.MCP_CATALOG_FILENAME = "mcp.json";
exports.CATALOG_METADATA_FILENAME = "metadata.json";
exports.CATALOG_REQUIREMENT_EXCLUSIONS_FILENAME = "requirement-exclusions.json";
exports.SYSTEM_WORKFLOW_TEMPLATE_DIRECTORY = "__system";
exports.SYSTEM_CATALOG_DIRECTORY = "__system";
exports.AUTH_PROFILES_FILENAME = "auth-profiles.json";
exports.AUTH_PROFILE_STATE_FILENAME = "auth-profile-state.json";
exports.AUTH_PROFILE_DIRECTORIES_DIRECTORYNAME = "auth-profiles";
exports.REPO_REGISTRY_FILENAME = "repos.json";
exports.SERVICE_PID_FILENAME = "service.pid";
exports.SERVICE_DRAIN_STATE_FILENAME = "service-drain-state.json";
exports.SERVICE_REPO_STATE_FILENAME = "service-repo-state.json";
exports.NETWORK_RECOVERY_STATE_FILENAME = "network-recovery.json";
exports.EVENT_HOOKS_DIRECTORY_NAME = "event-hooks";
exports.EVENT_HOOKS_GLOBAL_DIRECTORY_NAME = "global";
exports.EVENT_HOOKS_PROJECTS_DIRECTORY_NAME = "projects";
exports.EVENT_HOOKS_USER_CONFIG_FILENAME = "hooks.json";
exports.EVENT_HOOKS_LEDGER_FILENAME = "ledger.json";
exports.MACOS_LAUNCH_AGENTS_DIRECTORY = node_path_1.default.join("Library", "LaunchAgents");
exports.LINUX_SYSTEMD_USER_DIRECTORY = node_path_1.default.join(".config", "systemd", "user");
function getPackageRoot() {
    return node_path_1.default.resolve(__dirname, "../..");
}
function getCanonicalSkillDirectory() {
    return node_path_1.default.join(getPackageRoot(), "skills", branding_1.REPO_SKILL_NAME);
}
function getCanonicalSkillPath() {
    return node_path_1.default.join(getCanonicalSkillDirectory(), "SKILL.md");
}
function getPackageSystemWorkflowsDirectory() {
    return node_path_1.default.join(getPackageRoot(), "package-assets", "system", "workflows");
}
function getPackageSystemCatalogDirectory() {
    return node_path_1.default.join(getPackageRoot(), "package-assets", "system", exports.CATALOG_DIRECTORY);
}
function getPackageSystemPromptsDirectory() {
    return node_path_1.default.join(getPackageRoot(), "package-assets", "system", "system-prompts");
}
function getPackageSystemSkillCatalogPath() {
    return node_path_1.default.join(getPackageSystemCatalogDirectory(), exports.SKILL_CATALOG_FILENAME);
}
function getPackageSystemMcpCatalogPath() {
    return node_path_1.default.join(getPackageSystemCatalogDirectory(), exports.MCP_CATALOG_FILENAME);
}
function getPackageSystemCatalogMetadataPath() {
    return node_path_1.default.join(getPackageSystemCatalogDirectory(), exports.CATALOG_METADATA_FILENAME);
}
function getRepoRegistryPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.REPO_REGISTRY_FILENAME);
}
function getAuthProfilesPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.AUTH_PROFILES_FILENAME);
}
function getAuthProfileStatePath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.AUTH_PROFILE_STATE_FILENAME);
}
function getAuthProfileDirectory(profileId, homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join(getAuthProfileDirectoriesRootPath(homeDirectory), profileId);
}
function getAuthProfileDirectoriesRootPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.AUTH_PROFILE_DIRECTORIES_DIRECTORYNAME);
}
function getCodexHomePath(profileId, homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join(getAuthProfileDirectory(profileId, homeDirectory), "codex-home");
}
function getClaudeConfigDirPath(profileId, homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join(getAuthProfileDirectory(profileId, homeDirectory), "claude-cli");
}
function getServicePidPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.SERVICE_PID_FILENAME);
}
function getServiceDrainStatePath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.SERVICE_DRAIN_STATE_FILENAME);
}
function getServiceRepoStatePath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.SERVICE_REPO_STATE_FILENAME);
}
function getServiceLogPath(homeDirectory = node_os_1.default.homedir()) {
    return (0, global_settings_1.getServiceLogPath)(homeDirectory);
}
function getNetworkRecoveryStatePath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.NETWORK_RECOVERY_STATE_FILENAME);
}
function getMachineCatalogRequirementExclusionsPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.CATALOG_DIRECTORY, exports.CATALOG_REQUIREMENT_EXCLUSIONS_FILENAME);
}
function getEventHooksGlobalConfigPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.EVENT_HOOKS_DIRECTORY_NAME, exports.EVENT_HOOKS_GLOBAL_DIRECTORY_NAME, exports.EVENT_HOOKS_USER_CONFIG_FILENAME);
}
function getEventHooksGlobalLedgerPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.EVENT_HOOKS_DIRECTORY_NAME, exports.EVENT_HOOKS_GLOBAL_DIRECTORY_NAME, exports.EVENT_HOOKS_LEDGER_FILENAME);
}
function getEventHooksProjectConfigPath(eventHookProjectStorageSegments, homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.EVENT_HOOKS_DIRECTORY_NAME, exports.EVENT_HOOKS_PROJECTS_DIRECTORY_NAME, ...eventHookProjectStorageSegments, exports.EVENT_HOOKS_USER_CONFIG_FILENAME);
}
function getEventHooksProjectLedgerPath(eventHookProjectStorageSegments, homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join((0, control_plane_home_1.getControlPlaneHomePath)(homeDirectory), exports.EVENT_HOOKS_DIRECTORY_NAME, exports.EVENT_HOOKS_PROJECTS_DIRECTORY_NAME, ...eventHookProjectStorageSegments, exports.EVENT_HOOKS_LEDGER_FILENAME);
}
function getMacOsLaunchAgentPath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join(homeDirectory, exports.MACOS_LAUNCH_AGENTS_DIRECTORY, branding_1.MACOS_SERVICE_PLIST_FILENAME);
}
function getLinuxSystemdUserServicePath(homeDirectory = node_os_1.default.homedir()) {
    return node_path_1.default.join(homeDirectory, exports.LINUX_SYSTEMD_USER_DIRECTORY, branding_1.SYSTEMD_UNIT_NAME);
}
