{"version":3,"sources":["jsdelivr-header.js","/npm/skilled-feishu-mcp@1.1.0/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,gBAAmB,yBACrB,WAAY,2BACV,kBAAqB,MAE9B,QAAQ,MAAM,SAEd,QAAQ,GAAG,qBAAsB,IAC7B,OAAO,MAAM,sBAAuB,EAAM,IAI9C,QAAQ,GAAG,sBAAsB,CAAC,EAAQ,KACtC,OAAO,MAAM,0BAA2B,EAAS,UAAW,EAAO,WAOhE,eAAe,UAAU,GAAW,GACvC,IACI,OAAO,KAAK,sCAEZ,MAAM,EAAQ,QAAQ,IAAI,cACpB,EAAY,QAAQ,IAAI,kBAC9B,IAAK,IAAU,EAGX,MAFA,OAAO,MAAM,4EAEP,IAAI,MAAM,8BAGN,8BAAV,GAAuD,oCAAd,GACzC,OAAO,KAAK,2DAEV,YAAY,EACtB,CACA,MAAO,GAGH,MAFA,OAAO,MAAM,wBAAyB,CAAE,UAElC,CACV,CACJ,CAGA,IAEyB,QAAQ,KAAK,KAC7B,QAAQ,KAAK,KAAO,0BAA0B,MAC3C,QAAQ,KAAK,GAAG,SAAS,kBACzB,QAAQ,KAAK,GAAG,SAAS,qBAG7B,YAAY,OAAM,IACd,OAAO,MAAM,0BAA2B,EAAM,GAI1D,CACA,MAAO,GAEH,OAAO,MAAM,6CAA8C,EAC/D","file":"/npm/skilled-feishu-mcp@1.1.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/skilled-feishu-mcp@1.1.0/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","import { startServer } from './mcp/server.js';\nimport logger from './utils/logger.js';\nimport { fileURLToPath } from 'url';\n// 保持进程活动，避免意外退出\nprocess.stdin.resume();\n// 处理未捕获的异常，防止进程崩溃\nprocess.on('uncaughtException', (error) => {\n    logger.error('Uncaught exception:', error);\n    // 不退出进程，但记录错误\n});\n// 处理未处理的 promise rejection\nprocess.on('unhandledRejection', (reason, promise) => {\n    logger.error('Unhandled Rejection at:', promise, 'reason:', reason);\n    // 不退出进程，但记录错误\n});\n/**\n * 运行MCP服务器\n * @param useStdio 是否使用stdio模式\n */\nexport async function runServer(useStdio = true) {\n    try {\n        logger.info('Starting Skilled Feishu MCP server');\n        // 检查必要的凭据\n        const appId = process.env.FEISHU_APP_ID;\n        const appSecret = process.env.FEISHU_APP_SECRET;\n        if (!appId || !appSecret) {\n            logger.error('Missing required Feishu credentials: FEISHU_APP_ID and FEISHU_APP_SECRET');\n            // 不立即退出，让错误由调用者处理\n            throw new Error('Missing Feishu credentials');\n        }\n        // 在开发模式下提供更友好的警告\n        if (appId === 'cli_test_9e11c52b0e1c500e' && appSecret === 'test_app_secret_for_development') {\n            logger.info('Running in DEVELOPMENT mode with test credentials');\n        }\n        await startServer(useStdio);\n    }\n    catch (error) {\n        logger.error('Error starting server', { error });\n        // 不退出进程，抛出错误让调用者处理\n        throw error;\n    }\n}\n// 检查是否直接执行此文件的兼容方法\n// 避免使用 import.meta.url，它在某些环境中可能会有问题\ntry {\n    // 如果是通过 node xxx.js 直接执行\n    const isMainModule = process.argv[1] &&\n        (process.argv[1] === fileURLToPath(import.meta.url) ||\n            process.argv[1].endsWith('/src/index.js') ||\n            process.argv[1].endsWith('\\\\src\\\\index.js'));\n    if (isMainModule) {\n        // 直接执行此文件时，自动启动服务器，但捕获错误不退出\n        runServer().catch(error => {\n            logger.error('Failed to start server:', error);\n            // 不退出进程，保持运行状态\n        });\n    }\n}\ncatch (err) {\n    // 忽略可能发生的错误，确保不会中断进程\n    logger.debug('Error checking if this is the main module:', err);\n}\n"]}