"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLegacyOpenAICompatProxySessionPath = exports.getLegacyOpenAICompatProxyPidPath = exports.getOpenAICompatProxySessionPath = exports.getOpenAICompatProxyPidPath = exports.getOpenAICompatProxyProfileKey = exports.getOpenAICompatProxyDir = exports.OPENAI_COMPAT_PROXY_SERVICE_NAME = exports.OPENAI_COMPAT_PROXY_DEFAULT_PORT = exports.OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_END = exports.OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_START = exports.OPENAI_COMPAT_PROXY_LEGACY_DEFAULT_PORT = void 0;
const path = __importStar(require("path"));
const config_loader_facade_1 = require("../config/config-loader-facade");
exports.OPENAI_COMPAT_PROXY_LEGACY_DEFAULT_PORT = 3456;
exports.OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_START = 43456;
exports.OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_END = 43555;
exports.OPENAI_COMPAT_PROXY_DEFAULT_PORT = exports.OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_START;
exports.OPENAI_COMPAT_PROXY_SERVICE_NAME = 'ccs-openai-compat-proxy';
function getOpenAICompatProxyDir() {
    return path.join((0, config_loader_facade_1.getCcsDir)(), 'proxy');
}
exports.getOpenAICompatProxyDir = getOpenAICompatProxyDir;
function getOpenAICompatProxyProfileKey(profileName) {
    return encodeURIComponent(profileName.trim());
}
exports.getOpenAICompatProxyProfileKey = getOpenAICompatProxyProfileKey;
function getOpenAICompatProxyPidPath(profileName) {
    return path.join(getOpenAICompatProxyDir(), `${getOpenAICompatProxyProfileKey(profileName)}.daemon.pid`);
}
exports.getOpenAICompatProxyPidPath = getOpenAICompatProxyPidPath;
function getOpenAICompatProxySessionPath(profileName) {
    return path.join(getOpenAICompatProxyDir(), `${getOpenAICompatProxyProfileKey(profileName)}.session.json`);
}
exports.getOpenAICompatProxySessionPath = getOpenAICompatProxySessionPath;
function getLegacyOpenAICompatProxyPidPath() {
    return path.join(getOpenAICompatProxyDir(), 'daemon.pid');
}
exports.getLegacyOpenAICompatProxyPidPath = getLegacyOpenAICompatProxyPidPath;
function getLegacyOpenAICompatProxySessionPath() {
    return path.join(getOpenAICompatProxyDir(), 'session.json');
}
exports.getLegacyOpenAICompatProxySessionPath = getLegacyOpenAICompatProxySessionPath;
//# sourceMappingURL=proxy-daemon-paths.js.map