"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildCodexBrowserMcpOverrides = exports.getCodexBrowserMcpServerName = void 0;
const CODEX_BROWSER_MCP_SERVER_NAME = 'ccs_browser';
const DEFAULT_BROWSER_TOOL_TIMEOUT_SEC = 30;
const PLAYWRIGHT_MCP_PACKAGE = '@playwright/mcp@0.0.70';
function formatTomlString(value) {
    return JSON.stringify(value);
}
function formatTomlArray(values) {
    return JSON.stringify(values);
}
function getNpxCommand() {
    return process.platform === 'win32' ? 'npx.cmd' : 'npx';
}
function getCodexBrowserMcpServerName() {
    return CODEX_BROWSER_MCP_SERVER_NAME;
}
exports.getCodexBrowserMcpServerName = getCodexBrowserMcpServerName;
function buildCodexBrowserMcpOverrides() {
    return [
        `mcp_servers.${CODEX_BROWSER_MCP_SERVER_NAME}.command=${formatTomlString(getNpxCommand())}`,
        `mcp_servers.${CODEX_BROWSER_MCP_SERVER_NAME}.args=${formatTomlArray(['-y', PLAYWRIGHT_MCP_PACKAGE])}`,
        `mcp_servers.${CODEX_BROWSER_MCP_SERVER_NAME}.enabled=true`,
        `mcp_servers.${CODEX_BROWSER_MCP_SERVER_NAME}.tool_timeout_sec=${DEFAULT_BROWSER_TOOL_TIMEOUT_SEC}`,
    ];
}
exports.buildCodexBrowserMcpOverrides = buildCodexBrowserMcpOverrides;
//# sourceMappingURL=browser-codex-overrides.js.map