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AK,OAAS,GAEtB,EAAW,KAAK,8BACV,EAAI,WAAW,QAAQ,QAAQ,KAAK,MAAM,IAChD,EAAW,KAAK,6BAIhB,EAAW,KAAK,iCACV,cACN,EAAW,KAAK,yBAExB,CAEI,QAAQ,OAAS,QACjB,OAAO,OAAO,IACV,YAAY,MAAM,kCAAmC,GACrD,QAAQ,KAAK,EAAE,IAGvB,aAAa,QAAQ,yBAA0B,SAC/C,IAAI,oBAAsB,QAAQ,6BAClC,OAAO,eAAe,QAAS,UAAW,CAAE,YAAY,EAAM,IAAK,WAAc,OAAO,oBAAoB,OAAS,IACrH,OAAO,eAAe,QAAS,eAAgB,CAAE,YAAY,EAAM,IAAK,WAAc,OAAO,oBAAoB,YAAc,IAC/H,OAAO,eAAe,QAAS,WAAY,CAAE,YAAY,EAAM,IAAK,WAAc,OAAO,oBAAoB,QAAU","file":"/npm/@mseep/mcp-server-atlassian-bitbucket@1.20.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@mseep/mcp-server-atlassian-bitbucket@1.20.1/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CLI_NAME = exports.PACKAGE_NAME = exports.VERSION = exports.config = exports.Logger = void 0;\nexports.startServer = startServer;\nconst mcp_js_1 = require(\"@modelcontextprotocol/sdk/server/mcp.js\");\nconst stdio_js_1 = require(\"@modelcontextprotocol/sdk/server/stdio.js\");\nconst logger_util_js_1 = require(\"./utils/logger.util.js\");\nObject.defineProperty(exports, \"Logger\", { enumerable: true, get: function () { return logger_util_js_1.Logger; } });\nconst config_util_js_1 = require(\"./utils/config.util.js\");\nObject.defineProperty(exports, \"config\", { enumerable: true, get: function () { return config_util_js_1.config; } });\nconst error_util_js_1 = require(\"./utils/error.util.js\");\nconst constants_util_js_1 = require(\"./utils/constants.util.js\");\nconst index_js_1 = require(\"./cli/index.js\");\n// Import Bitbucket-specific tools\nconst atlassian_workspaces_tool_js_1 = __importDefault(require(\"./tools/atlassian.workspaces.tool.js\"));\nconst atlassian_repositories_tool_js_1 = __importDefault(require(\"./tools/atlassian.repositories.tool.js\"));\nconst atlassian_pullrequests_tool_js_1 = __importDefault(require(\"./tools/atlassian.pullrequests.tool.js\"));\nconst atlassian_search_tool_js_1 = __importDefault(require(\"./tools/atlassian.search.tool.js\"));\n// Create a contextualized logger for this file\nconst indexLogger = logger_util_js_1.Logger.forContext('index.ts');\n// Log initialization at debug level\nindexLogger.debug('Bitbucket MCP server module loaded');\nlet serverInstance = null;\nlet transportInstance = null;\n/**\n * Start the MCP server with the specified transport mode\n *\n * @param mode The transport mode to use (stdio or sse)\n * @returns Promise that resolves to the server instance when started successfully\n */\nasync function startServer(mode = 'stdio') {\n    // Create method-level logger with more specific context\n    const serverLogger = logger_util_js_1.Logger.forContext('index.ts', 'startServer');\n    // Load configuration\n    serverLogger.info('Starting MCP server initialization...');\n    config_util_js_1.config.load();\n    serverLogger.info('Configuration loaded successfully');\n    // Enable debug logging if DEBUG is set to true\n    if (config_util_js_1.config.getBoolean('DEBUG')) {\n        serverLogger.debug('Debug mode enabled');\n    }\n    // Log debug configuration settings at debug level\n    serverLogger.debug(`DEBUG environment variable: ${process.env.DEBUG}`);\n    serverLogger.debug(`ATLASSIAN_API_TOKEN exists: ${Boolean(process.env.ATLASSIAN_API_TOKEN)}`);\n    serverLogger.debug(`Config DEBUG value: ${config_util_js_1.config.get('DEBUG')}`);\n    serverLogger.info(`Initializing Bitbucket MCP server v${constants_util_js_1.VERSION}`);\n    serverInstance = new mcp_js_1.McpServer({\n        name: constants_util_js_1.PACKAGE_NAME,\n        version: constants_util_js_1.VERSION,\n    });\n    if (mode === 'stdio') {\n        serverLogger.info('Using STDIO transport for MCP communication');\n        transportInstance = new stdio_js_1.StdioServerTransport();\n    }\n    else {\n        throw (0, error_util_js_1.createUnexpectedError)('SSE mode is not supported yet');\n    }\n    // Register tools\n    serverLogger.info('Registering MCP tools...');\n    atlassian_workspaces_tool_js_1.default.registerTools(serverInstance);\n    serverLogger.debug('Registered Workspaces tools');\n    atlassian_repositories_tool_js_1.default.registerTools(serverInstance);\n    serverLogger.debug('Registered Repositories tools');\n    atlassian_pullrequests_tool_js_1.default.registerTools(serverInstance);\n    serverLogger.debug('Registered Pull requests tools');\n    atlassian_search_tool_js_1.default.registerTools(serverInstance);\n    serverLogger.debug('Registered Search tools');\n    serverLogger.info('All tools registered successfully');\n    try {\n        serverLogger.info(`Connecting to ${mode.toUpperCase()} transport...`);\n        await serverInstance.connect(transportInstance);\n        serverLogger.info('MCP server started successfully and ready to process requests');\n        return serverInstance;\n    }\n    catch (err) {\n        serverLogger.error(`Failed to start server`, err);\n        process.exit(1);\n    }\n}\n/**\n * Main entry point - this will run when executed directly\n * Determines whether to run in CLI or server mode based on command-line arguments\n */\nasync function main() {\n    // Create method-level logger with more specific context\n    const mainLogger = logger_util_js_1.Logger.forContext('index.ts', 'main');\n    // Load configuration\n    config_util_js_1.config.load();\n    // Check if arguments are provided (CLI mode)\n    if (process.argv.length > 2) {\n        // CLI mode: Pass arguments to CLI runner\n        mainLogger.info('Starting in CLI mode');\n        await (0, index_js_1.runCli)(process.argv.slice(2));\n        mainLogger.info('CLI execution completed');\n    }\n    else {\n        // MCP Server mode: Start server with default STDIO\n        mainLogger.info('Starting in server mode');\n        await startServer();\n        mainLogger.info('Server is now running');\n    }\n}\n// If this file is being executed directly (not imported), run the main function\nif (require.main === module) {\n    main().catch((err) => {\n        indexLogger.error('Unhandled error in main process', err);\n        process.exit(1);\n    });\n}\n__exportStar(require(\"./utils/error.util.js\"), exports);\nvar constants_util_js_2 = require(\"./utils/constants.util.js\");\nObject.defineProperty(exports, \"VERSION\", { enumerable: true, get: function () { return constants_util_js_2.VERSION; } });\nObject.defineProperty(exports, \"PACKAGE_NAME\", { enumerable: true, get: function () { return constants_util_js_2.PACKAGE_NAME; } });\nObject.defineProperty(exports, \"CLI_NAME\", { enumerable: true, get: function () { return constants_util_js_2.CLI_NAME; } });\n"]}