@lovrabet/cli 1.3.0 → 1.3.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -0
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cb5fc,_0x3142cd){const _0x3d47f9=a45_0x4e2b,_0x189f6d=_0x1cb5fc();while(!![]){try{const _0x3864a3=parseInt(_0x3d47f9(0x199))/0x1+-parseInt(_0x3d47f9(0x1a3))/0x2*(-parseInt(_0x3d47f9(0x1bd))/0x3)+parseInt(_0x3d47f9(0x1b6))/0x4*(parseInt(_0x3d47f9(0x1bb))/0x5)+parseInt(_0x3d47f9(0x1a1))/0x6+parseInt(_0x3d47f9(0x198))/0x7*(parseInt(_0x3d47f9(0x19c))/0x8)+-parseInt(_0x3d47f9(0x197))/0x9+-parseInt(_0x3d47f9(0x1a8))/0xa;if(_0x3864a3===_0x3142cd)break;else _0x189f6d['push'](_0x189f6d['shift']());}catch(_0x3dd825){_0x189f6d['push'](_0x189f6d['shift']());}}}(a45_0x31a0,0x8127d));import a45_0x11883d from'path';import{fileURLToPath}from'url';import a45_0x2850ee from'fs/promises';function a45_0x4e2b(_0x435fcd,_0x11405f){_0x435fcd=_0x435fcd-0x18d;const _0x31a0a9=a45_0x31a0();let _0x4e2b15=_0x31a0a9[_0x435fcd];return _0x4e2b15;}import{existsSync}from'fs';import{copyDirectory}from'../utils/copy-directory.js';import{exec}from'child_process';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';const execAsync=promisify(exec);function getTemplateDir(){const _0x528c3d=a45_0x4e2b,_0x246af3=fileURLToPath(import.meta.url),_0x23b363=a45_0x11883d[_0x528c3d(0x1a9)](_0x246af3);return a45_0x11883d[_0x528c3d(0x1b9)](_0x23b363,'../../templates/projects/sub-app-react-demo');}export async function createProjectNonInteractive(_0x12e986,_0x6a246a){const _0x47cbdf=a45_0x4e2b,_0x4c1cba=await checkCliVersion();_0x4c1cba[_0x47cbdf(0x1af)]&&printCliUpgradeWarning(_0x4c1cba);(!_0x12e986||_0x12e986['trim']()==='')&&(console[_0x47cbdf(0x1ab)](_0x47cbdf(0x1a6)),process[_0x47cbdf(0x191)](0x1));const _0x463761=/[<>:"|?*\x00-\x1f\x7f]/;_0x463761[_0x47cbdf(0x196)](_0x12e986)&&(console[_0x47cbdf(0x1ab)](_0x47cbdf(0x192)),process[_0x47cbdf(0x191)](0x1));_0x12e986[_0x47cbdf(0x1aa)]>0x64&&(console[_0x47cbdf(0x1ab)](_0x47cbdf(0x1a0)),process['exit'](0x1));const _0x789da8=a45_0x11883d[_0x47cbdf(0x1b9)](process[_0x47cbdf(0x1a2)](),_0x12e986);existsSync(_0x789da8)&&(console[_0x47cbdf(0x1ab)](_0x47cbdf(0x19a)+_0x12e986+_0x47cbdf(0x1b0)),process[_0x47cbdf(0x191)](0x1));try{const _0x975c36=a45_0x11883d[_0x47cbdf(0x1a9)](_0x789da8);await a45_0x2850ee['access'](_0x975c36,a45_0x2850ee[_0x47cbdf(0x1a7)][_0x47cbdf(0x1c2)]);}catch(_0x5d5cd2){console[_0x47cbdf(0x1ab)](_0x47cbdf(0x19d)),process[_0x47cbdf(0x191)](0x1);}try{console[_0x47cbdf(0x1b1)](_0x47cbdf(0x18f)+_0x12e986+_0x47cbdf(0x193));const _0x523a01=getTemplateDir();await copyDirectory(_0x523a01,_0x789da8),console[_0x47cbdf(0x1b1)]('\x20\x20√\x20项目模板已创建'),await updatePackageJsonName(_0x12e986),console[_0x47cbdf(0x1b1)](_0x47cbdf(0x19e)),console['log'](_0x47cbdf(0x1be)),console[_0x47cbdf(0x1b1)](_0x47cbdf(0x1ba)),await formatCode(_0x789da8),console[_0x47cbdf(0x1b1)](_0x47cbdf(0x1b4)),await configureAppEnv(_0x12e986,_0x6a246a),console[_0x47cbdf(0x1b1)]('\x20\x20√\x20环境配置完成'),console[_0x47cbdf(0x1b1)](_0x47cbdf(0x195)+_0x12e986+_0x47cbdf(0x1ad)),console[_0x47cbdf(0x1b1)](_0x47cbdf(0x18e)+_0x12e986),console[_0x47cbdf(0x1b1)](_0x47cbdf(0x19b));}catch(_0xde17a7){const _0x20d5fb=_0xde17a7 instanceof Error?_0xde17a7[_0x47cbdf(0x1b5)]:String(_0xde17a7);try{existsSync(_0x789da8)&&await a45_0x2850ee['rm'](_0x789da8,{'recursive':!![],'force':!![]});}catch{}console['error']('×\x20项目创建失败:\x20'+_0x20d5fb),process[_0x47cbdf(0x191)](0x1);}}async function updatePackageJsonName(_0x246ce0){const _0x4c893b=a45_0x4e2b,_0x281266=a45_0x11883d[_0x4c893b(0x1b9)](process[_0x4c893b(0x1a2)](),_0x246ce0),_0x4e805b=a45_0x11883d[_0x4c893b(0x1a5)](_0x281266,_0x4c893b(0x1a4)),_0x1b8f95=await a45_0x2850ee['readFile'](_0x4e805b,'utf-8'),_0xf90eee=JSON[_0x4c893b(0x1b2)](_0x1b8f95);_0xf90eee[_0x4c893b(0x1bf)]=_0x246ce0,_0xf90eee[_0x4c893b(0x1b7)]=_0x4c893b(0x194),await a45_0x2850ee['writeFile'](_0x4e805b,JSON[_0x4c893b(0x1bc)](_0xf90eee,null,0x2)+'\x0a');}async function installDependencies(_0x455e37){const _0x272293=a45_0x4e2b,_0x55692d=detectPackageManager(),_0x388b9f=_0x55692d+_0x272293(0x19f);try{await execAsync(_0x388b9f,{'cwd':_0x455e37});}catch(_0x29cb01){throw new Error('依赖安装失败:\x20'+_0x29cb01);}}function detectPackageManager(){const _0xd48597=a45_0x4e2b;try{return execAsync(_0xd48597(0x190),{}),_0xd48597(0x1ac);}catch{return _0xd48597(0x1b3);}}async function formatCode(_0x252c7a){const _0x5ea6a9=a45_0x4e2b;try{await execAsync(_0x5ea6a9(0x1b8),{'cwd':_0x252c7a});}catch{}}async function configureAppEnv(_0x43592d,_0x517cff){const _0x32ba89=a45_0x4e2b,_0x3d625d=a45_0x11883d['resolve'](process[_0x32ba89(0x1a2)](),_0x43592d),_0x4c16ea=a45_0x11883d[_0x32ba89(0x1a5)](_0x3d625d,_0x32ba89(0x1c1));let _0x284c73={};if(existsSync(_0x4c16ea)){const _0x3610d0=await a45_0x2850ee[_0x32ba89(0x18d)](_0x4c16ea,'utf-8');_0x284c73=JSON[_0x32ba89(0x1b2)](_0x3610d0);}_0x517cff&&(_0x284c73[_0x32ba89(0x1ae)]=_0x517cff),await a45_0x2850ee[_0x32ba89(0x1c0)](_0x4c16ea,JSON[_0x32ba89(0x1bc)](_0x284c73,null,0x2)+'\x0a');}function a45_0x31a0(){const _0x1a52f1=['×\x20项目名过长,最多支持\x20100\x20个字符','3159576xEjCtu','cwd','3324QEheKD','package.json','join','×\x20项目名不能为空','constants','21152350SqIcUM','dirname','length','error','bun','\x20创建成功!','env','needsUpgrade','\x20已存在,请使用其他项目名','log','parse','npm','\x20\x20√\x20代码已格式化','message','4ztcEor','description','bun\x20run\x20format','resolve','\x20\x20√\x20依赖安装跳过(非交互模式)','4882505NjsCWg','stringify','111OABJDb','\x20\x20正在安装依赖...','name','writeFile','lovrabet.config.json','W_OK','readFile','\x0a\x20\x20cd\x20','*\x20正在创建项目\x20','bun\x20--version','exit','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','...','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x0a√\x20项目\x20','test','2736783sQOQfp','1687RWvirL','612311VzMAoK','×\x20项目目录\x20','\x20\x20lovrabet\x20start\x0a','25608KVpyuB','×\x20无法在当前目录创建项目,请检查目录权限','\x20\x20√\x20package.json\x20已更新','\x20install'];a45_0x31a0=function(){return _0x1a52f1;};return a45_0x31a0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x42f73e,_0x2176b9){var _0x581601=a46_0x34d8,_0x5c9019=_0x42f73e();while(!![]){try{var _0x530a61=parseInt(_0x581601(0xa6))/0x1+-parseInt(_0x581601(0xa5))/0x2*(parseInt(_0x581601(0xa2))/0x3)+parseInt(_0x581601(0xa4))/0x4+parseInt(_0x581601(0xa9))/0x5*(-parseInt(_0x581601(0xa7))/0x6)+-parseInt(_0x581601(0x9c))/0x7*(parseInt(_0x581601(0xa0))/0x8)+parseInt(_0x581601(0x9f))/0x9*(parseInt(_0x581601(0xa3))/0xa)+parseInt(_0x581601(0x9e))/0xb;if(_0x530a61===_0x2176b9)break;else _0x5c9019['push'](_0x5c9019['shift']());}catch(_0x3e77ea){_0x5c9019['push'](_0x5c9019['shift']());}}}(a46_0x4dbe,0xe9de3));import{jsx as a46_0x29f619,jsxs as a46_0x27c3df}from'react/jsx-runtime';function a46_0x34d8(_0x140db5,_0x587275){_0x140db5=_0x140db5-0x9c;var _0x4dbe67=a46_0x4dbe();var _0x34d82c=_0x4dbe67[_0x140db5];return _0x34d82c;}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x322603){var _0x48a087=a46_0x34d8;return a46_0x27c3df(Box,{'children':[a46_0x29f619(Box,{'width':'1'}),a46_0x29f619(Text,{'color':_0x48a087(0xa8),'children':_0x48a087(0xa1)}),a46_0x29f619(Text,{'children':_0x322603[_0x48a087(0x9d)]}),a46_0x29f619(TaskTime,{'elapsed':_0x322603['elapsed']})]});}function a46_0x4dbe(){var _0x2213e4=['4679616CpjzGC','2tVpVJo','419322xqcrAu','898998IcxncG','green','5ypPCaT','1183tJhNbW','taskName','6625894loagBl','268389lTWGAl','7496hKrjFs','\x20√\x20','4207821PzRReX','160BYTSkW'];a46_0x4dbe=function(){return _0x2213e4;};return a46_0x4dbe();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27b535,_0x51555c){var _0x34bf49=a47_0x212d,_0x55f224=_0x27b535();while(!![]){try{var _0x17579b=parseInt(_0x34bf49(0x81))/0x1*(-parseInt(_0x34bf49(0x87))/0x2)+-parseInt(_0x34bf49(0x85))/0x3+-parseInt(_0x34bf49(0x82))/0x4+parseInt(_0x34bf49(0x7c))/0x5*(-parseInt(_0x34bf49(0x89))/0x6)+-parseInt(_0x34bf49(0x88))/0x7*(parseInt(_0x34bf49(0x80))/0x8)+-parseInt(_0x34bf49(0x84))/0x9+parseInt(_0x34bf49(0x83))/0xa*(parseInt(_0x34bf49(0x7e))/0xb);if(_0x17579b===_0x51555c)break;else _0x55f224['push'](_0x55f224['shift']());}catch(_0x59ab22){_0x55f224['push'](_0x55f224['shift']());}}}(a47_0x1b37,0xd5ea1));import{jsx as a47_0x5ccd30,jsxs as a47_0x30bf69}from'react/jsx-runtime';import{Text}from'ink';import a47_0x18db96 from'ink-spinner';function a47_0x212d(_0x5a556e,_0x39ceac){_0x5a556e=_0x5a556e-0x7c;var _0x1b37b6=a47_0x1b37();var _0x212d9f=_0x1b37b6[_0x5a556e];return _0x212d9f;}export function TaskLoading(_0x66c260){var _0x17a5e8=a47_0x212d;if(_0x66c260[_0x17a5e8(0x8b)])return a47_0x5ccd30(Text,{'color':'green','children':_0x17a5e8(0x7f)});if(_0x66c260[_0x17a5e8(0x7d)])return a47_0x30bf69(Text,{'color':_0x17a5e8(0x86),'children':['\x20',a47_0x5ccd30(a47_0x18db96,{'type':'dots'}),'\x20']});return a47_0x5ccd30(Text,{'children':_0x17a5e8(0x8a)});}function a47_0x1b37(){var _0x2f7a11=['91690yJcAsR','4815603rHPXsv','3035343UbGYpo','green','18344CgUhZT','1561399QpxcOw','408XFGaMh','\x20\x20\x20','finished','116365kfsdPE','loading','5379kJZaMz','\x20√\x20','8UzzdHd','2xFHJTn','946540dSblxq'];a47_0x1b37=function(){return _0x2f7a11;};return a47_0x1b37();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x558d42,_0x490ccb){var _0x1bc379=a48_0x2133,_0x38f034=_0x558d42();while(!![]){try{var _0x28528b=parseInt(_0x1bc379(0x14d))/0x1*(-parseInt(_0x1bc379(0x155))/0x2)+-parseInt(_0x1bc379(0x14c))/0x3*(parseInt(_0x1bc379(0x150))/0x4)+-parseInt(_0x1bc379(0x149))/0x5*(-parseInt(_0x1bc379(0x151))/0x6)+-parseInt(_0x1bc379(0x14b))/0x7*(parseInt(_0x1bc379(0x146))/0x8)+-parseInt(_0x1bc379(0x14e))/0x9*(-parseInt(_0x1bc379(0x154))/0xa)+parseInt(_0x1bc379(0x14f))/0xb*(-parseInt(_0x1bc379(0x147))/0xc)+-parseInt(_0x1bc379(0x153))/0xd*(-parseInt(_0x1bc379(0x14a))/0xe);if(_0x28528b===_0x490ccb)break;else _0x38f034['push'](_0x38f034['shift']());}catch(_0x434e3c){_0x38f034['push'](_0x38f034['shift']());}}}(a48_0x5dea,0x2ffc6));import{jsx as a48_0x360db4,jsxs as a48_0x5358e4}from'react/jsx-runtime';function a48_0x2133(_0x36ba3e,_0x5cf80d){_0x36ba3e=_0x36ba3e-0x146;var _0x5dea0c=a48_0x5dea();var _0x21336a=_0x5dea0c[_0x36ba3e];return _0x21336a;}function a48_0x5dea(){var _0x1953bf=['elapsed','860240DIyPJm','7737996TbJjST','238fEWfFq','551505deCjrp','235259QQiuZZ','135YHdpHm','29777oIFexA','4kYWhoV','6ZAqwgX','taskName','13JnmKcp','143830pIKNmZ','2xajShC','26120IAZaSy','948gYREjr'];a48_0x5dea=function(){return _0x1953bf;};return a48_0x5dea();}import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x21396a){var _0x2334cd=a48_0x2133;return a48_0x5358e4(Box,{'children':[a48_0x360db4(Box,{'width':'1'}),a48_0x360db4(TaskLoading,{..._0x21396a}),a48_0x360db4(Text,{'children':_0x21396a[_0x2334cd(0x152)]}),a48_0x360db4(TaskTime,{'elapsed':_0x21396a[_0x2334cd(0x148)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5bc5cc,_0x1d8b72){var _0x383f60=a49_0x5419,_0x6a7caa=_0x5bc5cc();while(!![]){try{var _0x113959=-parseInt(_0x383f60(0x10a))/0x1+-parseInt(_0x383f60(0x10e))/0x2*(parseInt(_0x383f60(0x110))/0x3)+parseInt(_0x383f60(0x10d))/0x4+-parseInt(_0x383f60(0x111))/0x5*(parseInt(_0x383f60(0x10b))/0x6)+-parseInt(_0x383f60(0x10f))/0x7+parseInt(_0x383f60(0x108))/0x8+-parseInt(_0x383f60(0x112))/0x9*(-parseInt(_0x383f60(0x109))/0xa);if(_0x113959===_0x1d8b72)break;else _0x6a7caa['push'](_0x6a7caa['shift']());}catch(_0x8990e6){_0x6a7caa['push'](_0x6a7caa['shift']());}}}(a49_0x3c2f,0xb8719));import{jsx as a49_0x4a3b6a,Fragment as a49_0x382d75,jsxs as a49_0x5445d7}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x332bc1){var _0x4924d1=a49_0x5419;if(_0x332bc1[_0x4924d1(0x10c)])return a49_0x5445d7(a49_0x382d75,{'children':[a49_0x4a3b6a(Text,{'color':'gray','children':'\x20['}),a49_0x4a3b6a(Text,{'color':'gray','bold':!![],'children':_0x332bc1[_0x4924d1(0x10c)]}),a49_0x4a3b6a(Text,{'color':_0x4924d1(0x113),'children':']'})]});return null;}function a49_0x5419(_0x710bf4,_0x30c835){_0x710bf4=_0x710bf4-0x108;var _0x3c2fb1=a49_0x3c2f();var _0x5419be=_0x3c2fb1[_0x710bf4];return _0x5419be;}function a49_0x3c2f(){var _0xe074a9=['elapsed','3563300UwOEHR','65778KxrTDP','4949441htWCIK','57ALCdbA','44510vqNvbp','9ACStCA','gray','88736VjsKzc','27590540OliSrW','1368790OPWWSw','138yeCLWN'];a49_0x3c2f=function(){return _0xe074a9;};return a49_0x3c2f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x106fd3=a50_0x4818;(function(_0x369d0b,_0x45ec6d){const _0x589296=a50_0x4818,_0x1b3851=_0x369d0b();while(!![]){try{const _0x3a72b3=parseInt(_0x589296(0x18f))/0x1*(-parseInt(_0x589296(0x19d))/0x2)+-parseInt(_0x589296(0x192))/0x3*(parseInt(_0x589296(0x19e))/0x4)+-parseInt(_0x589296(0x18d))/0x5*(parseInt(_0x589296(0x18c))/0x6)+parseInt(_0x589296(0x199))/0x7+parseInt(_0x589296(0x196))/0x8*(parseInt(_0x589296(0x195))/0x9)+parseInt(_0x589296(0x19f))/0xa*(parseInt(_0x589296(0x191))/0xb)+-parseInt(_0x589296(0x190))/0xc;if(_0x3a72b3===_0x45ec6d)break;else _0x1b3851['push'](_0x1b3851['shift']());}catch(_0x486c14){_0x1b3851['push'](_0x1b3851['shift']());}}}(a50_0x1fc1,0x3139c));import a50_0x19cc5a from'node:path';function a50_0x1fc1(){const _0x4c3ec0=['111912UMpyiO','50cDQAeZ','复制项目文件','606iyUivA','9515OPRJYI','项目模板复制失败','3JpViqR','489972xpIbUV','352319cRBbyY','9ksbbLc','copy','dirname','1737567mcflLd','8rBcOGc','success','error','1372819IIkXue','resolve','cwd','now','20486wdOPgb'];a50_0x1fc1=function(){return _0x4c3ec0;};return a50_0x1fc1();}function a50_0x4818(_0xaf74c1,_0xb22491){_0xaf74c1=_0xaf74c1-0x18b;const _0x1fc17e=a50_0x1fc1();let _0x4818ec=_0x1fc17e[_0xaf74c1];return _0x4818ec;}import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a50_0x19cc5a[a50_0x106fd3(0x194)](fileURLToPath(import.meta.url)),templateDir=a50_0x19cc5a[a50_0x106fd3(0x19a)](__dirname,'../../templates/projects/sub-app-react-demo');export function useCopyProjectTemplate(){const _0x2b84b0=a50_0x106fd3,[_0x159249,_0x208725]=useState(![]),[_0x4ba99a,_0x1ff1b2]=useState(![]),[_0x424dbc,_0x204fb2]=useState(''),_0x1fec61=useCallback(async _0x424bcc=>{const _0x110f58=a50_0x4818,_0x1ff850=Date[_0x110f58(0x19c)](),_0x74b9fa=a50_0x19cc5a[_0x110f58(0x19a)](process[_0x110f58(0x19b)](),_0x424bcc);_0x208725(!![]);try{logger['info']('copy','开始复制项目模板',{'projectCode':_0x424bcc,'templateDir':templateDir}),await copyDirectory(templateDir,_0x74b9fa);const _0x5bdd45=Date[_0x110f58(0x19c)]()-_0x1ff850;logger[_0x110f58(0x197)](_0x110f58(0x193),'项目模板复制完成',_0x5bdd45,{'projectCode':_0x424bcc});}catch(_0x2a4ae3){const _0x3aa1c4=Date[_0x110f58(0x19c)]()-_0x1ff850;logger[_0x110f58(0x198)]('copy',_0x110f58(0x18e),{'projectCode':_0x424bcc,'error':_0x2a4ae3 instanceof Error?_0x2a4ae3['message']:String(_0x2a4ae3),'duration':_0x3aa1c4});throw _0x2a4ae3;}finally{_0x208725(![]),_0x1ff1b2(!![]),_0x204fb2(formatElapsed(_0x1ff850));}},[]);return{'taskName':_0x2b84b0(0x18b),'finished':_0x4ba99a,'loading':_0x159249,'elapsed':_0x424dbc,'doTask':_0x1fec61};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c51c3,_0x2fcbed){const _0xfa432e=a51_0x1edd,_0x51fb96=_0x5c51c3();while(!![]){try{const _0xedad4e=-parseInt(_0xfa432e(0x111))/0x1+parseInt(_0xfa432e(0x107))/0x2*(parseInt(_0xfa432e(0x10f))/0x3)+-parseInt(_0xfa432e(0x113))/0x4*(parseInt(_0xfa432e(0x11a))/0x5)+parseInt(_0xfa432e(0x109))/0x6*(parseInt(_0xfa432e(0x112))/0x7)+-parseInt(_0xfa432e(0x116))/0x8*(-parseInt(_0xfa432e(0x119))/0x9)+parseInt(_0xfa432e(0x118))/0xa*(parseInt(_0xfa432e(0x114))/0xb)+-parseInt(_0xfa432e(0x117))/0xc;if(_0xedad4e===_0x2fcbed)break;else _0x51fb96['push'](_0x51fb96['shift']());}catch(_0x278929){_0x51fb96['push'](_0x51fb96['shift']());}}}(a51_0x299e,0x3ffed));import a51_0x4ce548 from'node:path';import{useCallback,useState}from'react';function a51_0x1edd(_0x24ec06,_0x11843a){_0x24ec06=_0x24ec06-0x105;const _0x299e57=a51_0x299e();let _0x1edd78=_0x299e57[_0x24ec06];return _0x1edd78;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a51_0x299e(){const _0x1e3de3=['开始格式化代码','格式化代码','cwd','720794WYVHFK','error','6cIrIzV','代码格式化完成','format','success','prettier','now','3ZSTfya','info','113773CnlUkG','822241Yoyoli','44FlUXVp','1375fXdXuV','resolve','1350616GxEtSI','854172gcJZBS','12150Dmyjbt','9IohyTy','159765JvrNIK','代码格式化失败'];a51_0x299e=function(){return _0x1e3de3;};return a51_0x299e();}import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x43f02e=a51_0x1edd,[_0x39befb,_0x144bfb]=useState(![]),[_0x174774,_0x4f290f]=useState(![]),[_0x4d35b8,_0x5e2b7a]=useState(''),_0x387f2e=useCallback(async _0x2a3d51=>{const _0x20b9e8=a51_0x1edd,_0x21fb15=Date[_0x20b9e8(0x10e)](),_0x368da5=a51_0x4ce548[_0x20b9e8(0x115)](process[_0x20b9e8(0x106)](),_0x2a3d51);_0x144bfb(!![]);try{logger[_0x20b9e8(0x110)]('format',_0x20b9e8(0x11c),{'projectCode':_0x2a3d51}),await execa('npx',[_0x20b9e8(0x10d),'--write','.'],{'cwd':_0x368da5});const _0x143495=Date['now']()-_0x21fb15;logger[_0x20b9e8(0x10c)]('format',_0x20b9e8(0x10a),_0x143495,{'projectCode':_0x2a3d51});}catch(_0x4ddb05){const _0x2820d7=Date[_0x20b9e8(0x10e)]()-_0x21fb15;logger[_0x20b9e8(0x108)](_0x20b9e8(0x10b),_0x20b9e8(0x11b),{'projectCode':_0x2a3d51,'error':_0x4ddb05 instanceof Error?_0x4ddb05['message']:String(_0x4ddb05),'duration':_0x2820d7});throw _0x4ddb05;}finally{_0x144bfb(![]),_0x4f290f(!![]),_0x5e2b7a(formatElapsed(_0x21fb15));}},[]);return{'taskName':_0x43f02e(0x105),'finished':_0x174774,'loading':_0x39befb,'elapsed':_0x4d35b8,'doTask':_0x387f2e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a52_0x4f72(_0x567ba6,_0x5cee40){_0x567ba6=_0x567ba6-0x76;const _0x408dc7=a52_0x408d();let _0x4f72a5=_0x408dc7[_0x567ba6];return _0x4f72a5;}function a52_0x408d(){const _0x2fe3ce=['4784733JLEESK','8135zYuFyU','3IRVnVs','1287090cqzJpR','依赖安装完成','https://registry.npmmirror.com','cwd','3888610hoagtE','2776aDYDkL','4207xQXIWv','依赖安装失败','开始安装依赖','install','158OjCOUA','48YUyVtP','10FDmLcf','3226284kRsVgX','npm','error','resolve','3334859GvnTOn','--registry','message','now','info'];a52_0x408d=function(){return _0x2fe3ce;};return a52_0x408d();}(function(_0x31484d,_0xe57b67){const _0x88774b=a52_0x4f72,_0x387860=_0x31484d();while(!![]){try{const _0xe19adb=-parseInt(_0x88774b(0x7b))/0x1*(parseInt(_0x88774b(0x87))/0x2)+parseInt(_0x88774b(0x7c))/0x3*(parseInt(_0x88774b(0x8a))/0x4)+parseInt(_0x88774b(0x89))/0x5*(parseInt(_0x88774b(0x7d))/0x6)+parseInt(_0x88774b(0x83))/0x7*(parseInt(_0x88774b(0x82))/0x8)+parseInt(_0x88774b(0x7a))/0x9+parseInt(_0x88774b(0x81))/0xa+parseInt(_0x88774b(0x8e))/0xb*(-parseInt(_0x88774b(0x88))/0xc);if(_0xe19adb===_0xe57b67)break;else _0x387860['push'](_0x387860['shift']());}catch(_0x9b9993){_0x387860['push'](_0x387860['shift']());}}}(a52_0x408d,0x7c579));import a52_0x19c3a9 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const [_0x44461c,_0x1449e5]=useState(![]),[_0x2c9b8d,_0x5f59d5]=useState(![]),[_0x5e0080,_0x5e0413]=useState(''),_0x10310c=useCallback(async _0x1983ef=>{const _0x5ede31=a52_0x4f72,_0x17c7f8=Date[_0x5ede31(0x78)](),_0x469be6=a52_0x19c3a9[_0x5ede31(0x8d)](process[_0x5ede31(0x80)](),_0x1983ef);_0x1449e5(!![]),_0x5f59d5(![]);const _0x4de673=async(_0x440865,_0x189c55)=>{await execa(_0x440865,_0x189c55,{'cwd':_0x469be6});};try{logger[_0x5ede31(0x79)]('install',_0x5ede31(0x85),{'projectCode':_0x1983ef,'registry':_0x5ede31(0x7f)}),await _0x4de673(_0x5ede31(0x8b),[_0x5ede31(0x86),_0x5ede31(0x76),_0x5ede31(0x7f)]);const _0x49b6dd=Date['now']()-_0x17c7f8;logger['success']('install',_0x5ede31(0x7e),_0x49b6dd,{'projectCode':_0x1983ef});}catch(_0x22615c){const _0x4d8da9=Date[_0x5ede31(0x78)]()-_0x17c7f8;logger[_0x5ede31(0x8c)](_0x5ede31(0x86),_0x5ede31(0x84),{'projectCode':_0x1983ef,'error':_0x22615c instanceof Error?_0x22615c[_0x5ede31(0x77)]:String(_0x22615c),'duration':_0x4d8da9});throw _0x22615c;}finally{_0x1449e5(![]),_0x5f59d5(!![]),_0x5e0413(formatElapsed(_0x17c7f8));}},[]);return{'taskName':'安装依赖','finished':_0x2c9b8d,'loading':_0x44461c,'elapsed':_0x5e0080,'doTask':_0x10310c};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a53_0xb511(){var _0x58310b=['9WBOmpc','column','查看可用命令。','1585704bmNcUV','green','380XEjSIu','1064200ZNDtZI','21378xDxSoN','2kKDAwH','14050dVMcTn','920310YBRoqp','!\x20请指定一个有效的命令。','555069HueCgH','173516IWZUYQ'];a53_0xb511=function(){return _0x58310b;};return a53_0xb511();}function a53_0xf195(_0x426f58,_0x105890){_0x426f58=_0x426f58-0x125;var _0xb51147=a53_0xb511();var _0xf19590=_0xb51147[_0x426f58];return _0xf19590;}(function(_0x13583a,_0x43da38){var _0x22ea3c=a53_0xf195,_0xd648f8=_0x13583a();while(!![]){try{var _0x310d5f=parseInt(_0x22ea3c(0x127))/0x1+parseInt(_0x22ea3c(0x126))/0x2*(-parseInt(_0x22ea3c(0x12a))/0x3)+-parseInt(_0x22ea3c(0x132))/0x4+-parseInt(_0x22ea3c(0x131))/0x5*(-parseInt(_0x22ea3c(0x125))/0x6)+parseInt(_0x22ea3c(0x12b))/0x7+parseInt(_0x22ea3c(0x12f))/0x8+parseInt(_0x22ea3c(0x12c))/0x9*(parseInt(_0x22ea3c(0x128))/0xa);if(_0x310d5f===_0x43da38)break;else _0xd648f8['push'](_0xd648f8['shift']());}catch(_0x784673){_0xd648f8['push'](_0xd648f8['shift']());}}}(a53_0xb511,0x2453d));import{jsx as a53_0x586890,jsxs as a53_0x255d74}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x5f4ec5=a53_0xf195;return a53_0x255d74(Box,{'flexDirection':_0x5f4ec5(0x12d),'marginTop':0x1,'marginBottom':0x1,'children':[a53_0x255d74(Box,{'children':[a53_0x586890(Box,{'width':'1'}),a53_0x586890(Text,{'children':_0x5f4ec5(0x129)})]}),a53_0x255d74(Box,{'marginTop':0x1,'children':[a53_0x586890(Box,{'width':'1'}),a53_0x255d74(Text,{'children':['\x20\x20','使用']}),a53_0x255d74(Text,{'bold':!![],'color':_0x5f4ec5(0x130),'children':['\x20','lovrabet\x20--help','\x20']}),a53_0x586890(Text,{'children':_0x5f4ec5(0x12e)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d9a62,_0x521e0d){const _0x1195be=a54_0x416b,_0x2e71f9=_0x5d9a62();while(!![]){try{const _0x2935b0=-parseInt(_0x1195be(0x166))/0x1+parseInt(_0x1195be(0x180))/0x2*(-parseInt(_0x1195be(0x17b))/0x3)+parseInt(_0x1195be(0x194))/0x4*(parseInt(_0x1195be(0x17a))/0x5)+-parseInt(_0x1195be(0x192))/0x6*(-parseInt(_0x1195be(0x174))/0x7)+parseInt(_0x1195be(0x193))/0x8*(-parseInt(_0x1195be(0x16f))/0x9)+parseInt(_0x1195be(0x172))/0xa+parseInt(_0x1195be(0x17c))/0xb*(parseInt(_0x1195be(0x171))/0xc);if(_0x2935b0===_0x521e0d)break;else _0x2e71f9['push'](_0x2e71f9['shift']());}catch(_0xf8cd6){_0x2e71f9['push'](_0x2e71f9['shift']());}}}(a54_0x274b,0x8383c));import{jsxs as a54_0x463336,jsx as a54_0x14a77e}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';function a54_0x416b(_0x34db3b,_0x237182){_0x34db3b=_0x34db3b-0x164;const _0x274b17=a54_0x274b();let _0x416b30=_0x274b17[_0x34db3b];return _0x416b30;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';function a54_0x274b(){const _0x47818b=['return','red','.lovrabetrc','初始化项目配置文件成功','utf8','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','34542TMXemQ','24iOeVpY','83908oiZLjn','正在初始化配置文件...','parse','应用代码只能包含字母、数字、-\x20和\x20_','toLocaleString','666822OZSbud','trim','message','gray','delete','exit','cwd','应用代码不合法','length','2036511XLeWme','stringify','204NkFTWu','9244330TgxBeH','info','721weARVg','init','当前目录已存在\x20.lovrabetrc\x20文件','请输入应用代码\x20(AppCode):\x20','string','column','70eQPcJc','303SaBEfo','294569ScEKKn','env','ctrl','创建配置文件失败','7564BOZRAD','\x20←\x20','slice','package.json','setLogPath','green','1.0.0','error','AppCode:\x20','创建配置文件失败:\x20','version','cyan'];a54_0x274b=function(){return _0x47818b;};return a54_0x274b();}import{readConfig}from'../utils/config.js';export function Init({appcode:_0x1e0b83,env:_0x458f52}){const _0x2119e9=a54_0x416b,[_0x15ecf0,_0x21500c]=useState(null),[_0x70a0aa,_0x33f52a]=useState(![]),[_0x284226,_0x2372f9]=useState(!_0x1e0b83),[_0x2ef08a,_0x4b2e91]=useState(''),[_0x139ba1,_0x2a0637]=useState(''),[_0x1cda33,_0x3b5e07]=useState(_0x1e0b83||''),[_0x5d4dcc]=useState(_0x458f52);function _0x4b709f(_0x3fe120){const _0x304467=a54_0x416b;if(_0x3fe120[_0x304467(0x16e)]===0x0)return{'valid':![],'message':''};if(_0x3fe120['length']>0x64)return{'valid':![],'message':'应用代码长度不能超过\x20100\x20个字符'};const _0x3959b9=/^[A-Za-z0-9_-]+$/;if(!_0x3959b9['test'](_0x3fe120))return{'valid':![],'message':_0x304467(0x164)};return{'valid':!![]};}useInput((_0x29cead,_0x3583d0)=>{const _0x23ddb1=a54_0x416b;if(!_0x284226)return;if(_0x3583d0[_0x23ddb1(0x18c)]){if(_0x139ba1||!_0x2ef08a[_0x23ddb1(0x167)]()){_0x2a0637('应用代码不能为空');return;}const _0x17d85c=_0x2ef08a['trim'](),{valid:_0x162b70,message:_0x3e35f2}=_0x4b709f(_0x17d85c);if(!_0x162b70){_0x2a0637(_0x3e35f2||_0x23ddb1(0x16d));return;}_0x3b5e07(_0x17d85c),_0x2372f9(![]);}else{if(_0x3583d0['backspace']||_0x3583d0[_0x23ddb1(0x16a)])_0x4b2e91(_0x546c0c=>{const _0x5ca81c=_0x23ddb1,_0x1506c1=_0x546c0c[_0x5ca81c(0x182)](0x0,-0x1);if(_0x1506c1[_0x5ca81c(0x16e)]===0x0)_0x2a0637('');else{const {valid:_0x3c56c7,message:_0x48f2d3}=_0x4b709f(_0x1506c1);_0x2a0637(_0x3c56c7?'':_0x48f2d3||_0x5ca81c(0x16d));}return _0x1506c1;});else _0x3583d0[_0x23ddb1(0x17e)]&&_0x29cead==='c'?process[_0x23ddb1(0x16b)](0x0):_0x4b2e91(_0xa72ffb=>{const _0x324d53=_0x23ddb1,_0x17d67b=_0xa72ffb+_0x29cead,{valid:_0x3da788,message:_0x5b2b0e}=_0x4b709f(_0x17d67b);return _0x2a0637(_0x3da788?'':_0x5b2b0e||_0x324d53(0x16d)),_0x17d67b;});}},{'isActive':_0x284226}),useEffect(()=>{const _0x2cf69e=a54_0x416b;if(!_0x1cda33||_0x284226)return;const _0x3ed9ce=resolve(process[_0x2cf69e(0x16c)](),_0x2cf69e(0x18e));if(existsSync(_0x3ed9ce)){_0x21500c(_0x2cf69e(0x176)),setTimeout(()=>process[_0x2cf69e(0x16b)](0x1),0x64);return;}try{const _0x142068=fileURLToPath(import.meta.url),_0x4627bf=resolve(dirname(_0x142068),'../..'),_0x5d2c39=join(_0x4627bf,_0x2cf69e(0x183));let _0x25eac3=_0x2cf69e(0x186);try{const _0x46be38=JSON[_0x2cf69e(0x196)](readFileSync(_0x5d2c39,'utf8'));_0x25eac3=_0x46be38[_0x2cf69e(0x18a)]||'1.0.0';}catch(_0x26f2ab){}const _0x2f5375=readConfig(),_0xefa6ae=typeof _0x2f5375[_0x2cf69e(0x17d)]===_0x2cf69e(0x178)?_0x2f5375[_0x2cf69e(0x17d)]:undefined,{app:_0x493596,appcode:_0x4a1c9f,..._0x3147c8}=_0x2f5375,_0x27cf0a={..._0x3147c8,'appcode':_0x1cda33,'env':_0x5d4dcc||_0xefa6ae||'online','createdAt':new Date()[_0x2cf69e(0x165)](),'version':_0x25eac3};writeFileSync(_0x3ed9ce,JSON[_0x2cf69e(0x170)](_0x27cf0a,null,0x2),{'encoding':_0x2cf69e(0x190),'mode':0x180}),logger[_0x2cf69e(0x184)](process['cwd']()),logger[_0x2cf69e(0x173)](_0x2cf69e(0x175),_0x2cf69e(0x18f),{'appcode':_0x1cda33,'env':_0x27cf0a[_0x2cf69e(0x17d)],'version':_0x27cf0a[_0x2cf69e(0x18a)],'configPath':_0x3ed9ce}),_0x33f52a(!![]),setTimeout(()=>process['exit'](0x0),0x64);}catch(_0x50e428){logger[_0x2cf69e(0x187)]('init',_0x2cf69e(0x17f),{'error':_0x50e428 instanceof Error?_0x50e428[_0x2cf69e(0x168)]:String(_0x50e428)}),_0x21500c(_0x2cf69e(0x189)+(_0x50e428 instanceof Error?_0x50e428['message']:String(_0x50e428))),setTimeout(()=>process['exit'](0x1),0x64);}},[_0x1cda33,_0x284226,_0x5d4dcc]);if(_0x15ecf0)return a54_0x14a77e(Box,{'flexDirection':_0x2119e9(0x179),'children':a54_0x463336(Text,{'color':_0x2119e9(0x18d),'children':['✗\x20',_0x15ecf0]})});if(_0x284226)return a54_0x463336(Box,{'flexDirection':'column','children':[a54_0x463336(Box,{'children':[a54_0x14a77e(Text,{'color':_0x2119e9(0x18b),'children':_0x2119e9(0x177)}),_0x2ef08a?a54_0x14a77e(Text,{'color':_0x2119e9(0x185),'children':_0x2ef08a}):a54_0x14a77e(Text,{'color':_0x2119e9(0x169),'children':'_'}),_0x139ba1&&a54_0x463336(Text,{'color':_0x2119e9(0x18d),'children':[_0x2119e9(0x181),_0x139ba1]})]}),!_0x139ba1&&!_0x2ef08a&&a54_0x14a77e(Box,{'children':a54_0x14a77e(Text,{'color':_0x2119e9(0x169),'children':_0x2119e9(0x191)})})]});if(_0x70a0aa)return a54_0x463336(Box,{'flexDirection':_0x2119e9(0x179),'children':[a54_0x14a77e(Text,{'color':_0x2119e9(0x185),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a54_0x463336(Text,{'color':'cyan','children':[_0x2119e9(0x188),_0x1cda33]}),a54_0x14a77e(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a54_0x14a77e(Box,{'children':a54_0x14a77e(Text,{'children':_0x2119e9(0x195)})});}
|
package/lib/mcp/McpInstallUI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x45c977=a55_0x43d5;(function(_0x2b9340,_0x1e2b3e){const _0x243fe5=a55_0x43d5,_0x3be7b9=_0x2b9340();while(!![]){try{const _0x55bca9=-parseInt(_0x243fe5(0x90))/0x1*(parseInt(_0x243fe5(0x88))/0x2)+-parseInt(_0x243fe5(0x89))/0x3*(parseInt(_0x243fe5(0xa5))/0x4)+parseInt(_0x243fe5(0x79))/0x5*(-parseInt(_0x243fe5(0x70))/0x6)+-parseInt(_0x243fe5(0x83))/0x7*(parseInt(_0x243fe5(0x78))/0x8)+-parseInt(_0x243fe5(0x7a))/0x9+-parseInt(_0x243fe5(0x7d))/0xa+parseInt(_0x243fe5(0x7e))/0xb;if(_0x55bca9===_0x1e2b3e)break;else _0x3be7b9['push'](_0x3be7b9['shift']());}catch(_0x36749d){_0x3be7b9['push'](_0x3be7b9['shift']());}}}(a55_0xa842,0x8162d));function a55_0xa842(){const _0x440cdb=['column','ide','selectedIndexes','find','✗\x20配置失败','green','white','message','selecting','已选择\x20IDE','cwd','⚠️\x20配置需要手动完成','claude','red','不支持的\x20IDE:\x20','请至少选择一个\x20IDE','error','size','description','1053508GocXnR','setErrorMsg','cursor','正在配置\x20MCP\x20服务器...','2984874oUrNNK','cyan','其他\x20IDE','return','\x20\x20⚠️','success','label','yellow','4760NCHdJK','5VLdbyC','4317624IpTtAX','handleKeyDown','⚠️\x20部分配置需要手动完成','2813070TbKsdm','40508611krFeLi','length','done','manual','gray','5705gxjBgD','some','every','配置\x20Lovrabet\x20MCP\x20服务器','name','74wBXoHw','12mdlSqV','map','✓\x20MCP\x20配置完成!','按任意键退出...','status','other','\x20\x20✗','9613qlXDOT','configuring'];a55_0xa842=function(){return _0x440cdb;};return a55_0xa842();}import{jsx as a55_0x4c13bc,jsxs as a55_0x1ed093,Fragment as a55_0x2cc5c9}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';import{IDESelector,useIDESelection}from'../ui/IDESelector.js';function a55_0x43d5(_0xe0c8da,_0x11baa5){_0xe0c8da=_0xe0c8da-0x6f;const _0xa84239=a55_0xa842();let _0x43d57f=_0xa84239[_0xe0c8da];return _0x43d57f;}import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';const IDE_LIST=[...Array['from'](MCP_IDES)[a55_0x45c977(0x8a)](_0x1079a1=>({'key':_0x1079a1,'name':IDE_CONFIGS[_0x1079a1][a55_0x45c977(0x87)],'description':IDE_CONFIGS[_0x1079a1][a55_0x45c977(0xa4)]})),{'key':a55_0x45c977(0x8e),'name':a55_0x45c977(0x72),'description':'其他\x20IDE\x20配置指引'}];export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x5eddcb=a55_0x45c977,{exit:_0x188ce3}=useApp(),[_0x49caca,_0x26d842]=useState(_0x5eddcb(0x9a)),[_0x4d0fb1,_0x1c4061]=useState([]),[_0x3be192,_0x409d15]=useState([]),_0x44d05e=useIDESelection({'ideList':IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x158726=_0x5eddcb;preselectedIDEs[_0x158726(0x7f)]>0x0&&_0x44d05e[_0x158726(0x94)][_0x158726(0xa3)]>0x0&&_0x414c28();},[]),useInput((_0x4ba23f,_0x3b49c9)=>{const _0x24cb09=_0x5eddcb;if(_0x49caca==='selecting'){if(_0x4ba23f==='q'||_0x4ba23f==='Q'){_0x188ce3();return;}if(_0x3b49c9[_0x24cb09(0x73)]){if(_0x44d05e[_0x24cb09(0x94)]['size']===0x0){_0x44d05e[_0x24cb09(0xa6)](_0x24cb09(0xa1));return;}_0x414c28();return;}_0x44d05e[_0x24cb09(0x7b)](_0x4ba23f,_0x3b49c9);}_0x49caca===_0x24cb09(0x80)&&_0x188ce3();});async function _0x414c28(){const _0xc95680=_0x5eddcb,_0x5c4aa9=_0x44d05e['getSelectedIDEs']();_0x1c4061([{'label':_0xc95680(0x9b),'value':_0x44d05e['selectedIndexes'][_0xc95680(0xa3)]+'\x20个'}]),_0x26d842('configuring');const _0x49849b=[];for(const _0x3a29db of _0x5c4aa9){try{const _0x1346b7=await configureMcp(_0x3a29db);_0x49849b['push']({'ide':IDE_LIST['find'](_0x46e5f8=>_0x46e5f8['key']===_0x3a29db)?.[_0xc95680(0x87)]||_0x3a29db,'status':_0x1346b7['needsManualAction']?_0xc95680(0x81):_0x1346b7[_0xc95680(0x75)]?'success':_0xc95680(0xa2),'message':_0x1346b7[_0xc95680(0x99)]});}catch(_0x23c6b8){_0x49849b['push']({'ide':IDE_LIST[_0xc95680(0x95)](_0x4c1d68=>_0x4c1d68['key']===_0x3a29db)?.[_0xc95680(0x87)]||_0x3a29db,'status':_0xc95680(0xa2),'message':_0x23c6b8 instanceof Error?_0x23c6b8[_0xc95680(0x99)]:String(_0x23c6b8)});}}_0x409d15(_0x49849b),_0x26d842(_0xc95680(0x80)),setTimeout(()=>{_0x188ce3();},0x1388);}return a55_0x1ed093(Box,{'flexDirection':_0x5eddcb(0x92),'marginTop':0x1,'children':[_0x49caca===_0x5eddcb(0x9a)&&a55_0x4c13bc(IDESelector,{'ideList':IDE_LIST,'title':_0x5eddcb(0x86),'selection':_0x44d05e}),_0x49caca===_0x5eddcb(0x91)&&a55_0x1ed093(a55_0x2cc5c9,{'children':[_0x4d0fb1[_0x5eddcb(0x8a)]((_0x42d1c3,_0x495234)=>a55_0x1ed093(Box,{'children':[a55_0x1ed093(Text,{'color':_0x5eddcb(0x97),'children':['√\x20',_0x42d1c3[_0x5eddcb(0x76)],':\x20']}),a55_0x4c13bc(Text,{'color':_0x5eddcb(0x71),'children':_0x42d1c3['value']})]},_0x495234)),a55_0x4c13bc(Box,{'marginTop':0x1,'children':a55_0x4c13bc(Text,{'children':_0x5eddcb(0x6f)})})]}),_0x49caca===_0x5eddcb(0x80)&&a55_0x4c13bc(DoneStep,{'configResults':_0x3be192})]});}function DoneStep({configResults:_0x2b9afe}){const _0x28f842=a55_0x45c977,_0xa91388=_0x2b9afe[_0x28f842(0x85)](_0x2d9979=>_0x2d9979['status']===_0x28f842(0x75)),_0x4ba256=_0x2b9afe['some'](_0x2d9134=>_0x2d9134[_0x28f842(0x8d)]===_0x28f842(0x81)),_0x258670=_0x2b9afe[_0x28f842(0x84)](_0x1cd261=>_0x1cd261[_0x28f842(0x8d)]===_0x28f842(0xa2));return a55_0x1ed093(a55_0x2cc5c9,{'children':[a55_0x4c13bc(Box,{'children':_0xa91388?a55_0x4c13bc(Text,{'color':'green','children':_0x28f842(0x8b)}):_0x4ba256?a55_0x4c13bc(Text,{'color':_0x28f842(0x77),'children':_0x28f842(0x7c)}):_0x258670?a55_0x4c13bc(Text,{'color':_0x28f842(0x9f),'children':_0x28f842(0x96)}):a55_0x4c13bc(Text,{'color':_0x28f842(0x77),'children':_0x28f842(0x9d)})}),_0x2b9afe[_0x28f842(0x8a)]((_0x385516,_0x279523)=>a55_0x1ed093(Box,{'flexDirection':_0x28f842(0x92),'children':[a55_0x1ed093(Text,{'color':_0x385516[_0x28f842(0x8d)]===_0x28f842(0x75)?_0x28f842(0x97):_0x385516[_0x28f842(0x8d)]==='manual'?_0x28f842(0x77):_0x28f842(0x9f),'children':[_0x385516[_0x28f842(0x8d)]===_0x28f842(0x75)?'\x20\x20✓':_0x385516[_0x28f842(0x8d)]===_0x28f842(0x81)?_0x28f842(0x74):_0x28f842(0x8f),'\x20',_0x385516[_0x28f842(0x93)],':']}),a55_0x4c13bc(Text,{'color':_0x385516['status']===_0x28f842(0x75)?_0x28f842(0x98):_0x385516['status']===_0x28f842(0x81)?'yellow':_0x28f842(0x9f),'children':_0x385516[_0x28f842(0x99)]})]},_0x279523)),a55_0x4c13bc(Box,{'marginTop':0x1,'children':a55_0x4c13bc(Text,{'color':_0x28f842(0x82),'children':_0x28f842(0x8c)})})]});}async function configureMcp(_0x1b3b08){const _0x230ab2=a55_0x45c977,_0x16e42e=process[_0x230ab2(0x9c)]();switch(_0x1b3b08){case _0x230ab2(0xa7):return configureCursorMcp(_0x16e42e);case _0x230ab2(0x9e):return configureClaudeMcp(_0x16e42e);case _0x230ab2(0x8e):return showOtherMcpGuide(_0x16e42e);default:throw new Error(_0x230ab2(0xa0)+_0x1b3b08);}}
|
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3253e0,_0x5137ef){const _0x531bb4=a56_0x308e,_0x259049=_0x3253e0();while(!![]){try{const _0x5ac05c=parseInt(_0x531bb4(0x199))/0x1*(-parseInt(_0x531bb4(0x1a7))/0x2)+-parseInt(_0x531bb4(0x1a6))/0x3*(-parseInt(_0x531bb4(0x195))/0x4)+parseInt(_0x531bb4(0x1a2))/0x5*(parseInt(_0x531bb4(0x1a5))/0x6)+parseInt(_0x531bb4(0x19e))/0x7*(parseInt(_0x531bb4(0x19f))/0x8)+-parseInt(_0x531bb4(0x198))/0x9+-parseInt(_0x531bb4(0x19d))/0xa*(parseInt(_0x531bb4(0x19b))/0xb)+parseInt(_0x531bb4(0x1a4))/0xc;if(_0x5ac05c===_0x5137ef)break;else _0x259049['push'](_0x259049['shift']());}catch(_0x1ee4a2){_0x259049['push'](_0x259049['shift']());}}}(a56_0x1430,0x9bf13));function a56_0x308e(_0x5b1cdb,_0x5e446c){_0x5b1cdb=_0x5b1cdb-0x194;const _0x1430d1=a56_0x1430();let _0x308ef5=_0x1430d1[_0x5b1cdb];return _0x308ef5;}import{configureClaudeMcp as a56_0x52cc93}from'./mcp-installer.js';export async function configureClaudeMcp(){const _0x225a9f=a56_0x308e,_0x2f0de2=process[_0x225a9f(0x196)](),_0x2c8d55=a56_0x52cc93(_0x2f0de2);_0x2c8d55[_0x225a9f(0x19a)]?(console[_0x225a9f(0x19c)](_0x225a9f(0x1a3)+_0x2c8d55[_0x225a9f(0x197)]+'\x0a'),process[_0x225a9f(0x194)](0x0)):(console[_0x225a9f(0x1a0)](_0x225a9f(0x1a1)+_0x2c8d55[_0x225a9f(0x197)]+'\x0a'),process[_0x225a9f(0x194)](0x1));}function a56_0x1430(){const _0x422346=['exit','2313604epXlfO','cwd','message','4315599JJHGCW','13PRvlJA','success','442211vMbBkC','log','160NQuNJI','9051DUrNdK','1168IUzQFz','error','\x0a错误:\x20配置失败\x20-\x20','10jevlxt','\x0a📋\x20','23193744OmvNSn','664278lBtbAt','3yICefA','178454IlqVnq'];a56_0x1430=function(){return _0x422346;};return a56_0x1430();}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x497959,_0x3c17af){const _0x4b41fc=a57_0x41de,_0x2df7fc=_0x497959();while(!![]){try{const _0xd65bf1=-parseInt(_0x4b41fc(0x1af))/0x1+parseInt(_0x4b41fc(0x1bc))/0x2*(parseInt(_0x4b41fc(0x1bf))/0x3)+-parseInt(_0x4b41fc(0x1b2))/0x4*(-parseInt(_0x4b41fc(0x1be))/0x5)+parseInt(_0x4b41fc(0x1ba))/0x6*(parseInt(_0x4b41fc(0x1b5))/0x7)+-parseInt(_0x4b41fc(0x1bb))/0x8+parseInt(_0x4b41fc(0x1b8))/0x9*(-parseInt(_0x4b41fc(0x1b0))/0xa)+parseInt(_0x4b41fc(0x1b1))/0xb;if(_0xd65bf1===_0x3c17af)break;else _0x2df7fc['push'](_0x2df7fc['shift']());}catch(_0x9f7c79){_0x2df7fc['push'](_0x2df7fc['shift']());}}}(a57_0x59bc,0xefb5e));import{configureCursorMcp as a57_0x3505c8}from'./mcp-installer.js';function a57_0x41de(_0x399014,_0x5d72e9){_0x399014=_0x399014-0x1ae;const _0x59bc4f=a57_0x59bc();let _0x41defb=_0x59bc4f[_0x399014];return _0x41defb;}export async function configureCursorMcp(){const _0x23187c=a57_0x41de,_0x452865=process[_0x23187c(0x1c0)](),_0x320cf6=await a57_0x3505c8(_0x452865);_0x320cf6[_0x23187c(0x1b4)]?(console['log']('\x0a✓\x20Cursor\x20MCP\x20配置成功!\x0a'),console[_0x23187c(0x1ae)]('配置信息:'),console[_0x23187c(0x1ae)]('\x20\x20'+_0x320cf6[_0x23187c(0x1b3)]+'\x0a'),console[_0x23187c(0x1ae)](_0x23187c(0x1b6)),console[_0x23187c(0x1ae)](_0x23187c(0x1b9)),process[_0x23187c(0x1bd)](0x0)):(console[_0x23187c(0x1b7)]('\x0a错误:\x20配置失败\x20-\x20'+_0x320cf6[_0x23187c(0x1b3)]+'\x0a'),process[_0x23187c(0x1bd)](0x1));}function a57_0x59bc(){const _0x2ce800=['1747936CriSEn','2RhgbdQ','exit','15IyUQmL','1668246MxsJch','cwd','log','1241362oREEqo','32060VRMWbv','9594244IPbbsq','2345676dnEgIn','message','success','38605FtkkRV','现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','error','2295VKFXoi','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','78MkrTbP'];a57_0x59bc=function(){return _0x2ce800;};return a57_0x59bc();}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c04aa,_0x2b681d){const _0x49dc7a=a58_0x24c0,_0xac0fd7=_0x2c04aa();while(!![]){try{const _0xd8fd50=parseInt(_0x49dc7a(0xe1))/0x1+parseInt(_0x49dc7a(0xec))/0x2*(-parseInt(_0x49dc7a(0xc1))/0x3)+-parseInt(_0x49dc7a(0xc3))/0x4*(-parseInt(_0x49dc7a(0xf0))/0x5)+parseInt(_0x49dc7a(0xee))/0x6+-parseInt(_0x49dc7a(0xe2))/0x7*(-parseInt(_0x49dc7a(0xd9))/0x8)+-parseInt(_0x49dc7a(0xbd))/0x9*(parseInt(_0x49dc7a(0xed))/0xa)+parseInt(_0x49dc7a(0xbe))/0xb;if(_0xd8fd50===_0x2b681d)break;else _0xac0fd7['push'](_0xac0fd7['shift']());}catch(_0x443994){_0xac0fd7['push'](_0xac0fd7['shift']());}}}(a58_0x337d,0x28753));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';import{createInterface}from'node:readline';import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';export async function mcpCommand(_0xb81054,_0x52b1a1,_0x478449){const _0x4d5bc2=a58_0x24c0;logger[_0x4d5bc2(0xdd)](process[_0x4d5bc2(0xd8)]());if(_0x478449?.[_0x4d5bc2(0xdf)]||_0xb81054===_0x4d5bc2(0xe4)){showHelp();return;}_0xb81054!=='install'&&(console[_0x4d5bc2(0xe9)](_0x4d5bc2(0xc2)+(_0xb81054||_0x4d5bc2(0xd7))),console[_0x4d5bc2(0xd1)](_0x4d5bc2(0xeb)),console[_0x4d5bc2(0xd1)](_0x4d5bc2(0xbc)),console['log']('\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a'),logger[_0x4d5bc2(0xe9)]('mcp',_0x4d5bc2(0xcc)+_0xb81054),process[_0x4d5bc2(0xe7)](0x1));let _0xdc965d;if(_0x478449?.[_0x4d5bc2(0xc6)])_0xdc965d='cursor';else{if(_0x478449?.[_0x4d5bc2(0xd2)])_0xdc965d='claude';else{if(_0x52b1a1?.[0x0]){const _0x32670d=_0x52b1a1[0x0][_0x4d5bc2(0xdb)]();MCP_IDES['has'](_0x32670d)&&(_0xdc965d=_0x32670d);}}}await installMcp(_0xdc965d);}function showHelp(){const _0x24119c=a58_0x24c0;console[_0x24119c(0xd1)](_0x24119c(0xf1)+Array[_0x24119c(0xc4)](MCP_IDES)[_0x24119c(0xcd)]((_0x2d3752,_0x247868)=>'\x20\x20'+(_0x247868+0x1)+'.\x20'+IDE_CONFIGS[_0x2d3752][_0x24119c(0xea)]+_0x24119c(0xde)+IDE_CONFIGS[_0x2d3752][_0x24119c(0xc5)])[_0x24119c(0xcf)]('\x0a')+_0x24119c(0xd0));}function a58_0x24c0(_0x51ccf5,_0x133b93){_0x51ccf5=_0x51ccf5-0xbc;const _0x337dfb=a58_0x337d();let _0x24c07c=_0x337dfb[_0x51ccf5];return _0x24c07c;}async function selectIDE(){const _0x9eecaa=a58_0x24c0;console[_0x9eecaa(0xd1)](_0x9eecaa(0xda));const _0x284e8e=Array[_0x9eecaa(0xc4)](MCP_IDES);return _0x284e8e[_0x9eecaa(0xc8)]((_0x50db25,_0x224db0)=>{const _0x32671d=_0x9eecaa;console[_0x32671d(0xd1)]('\x20\x20'+(_0x224db0+0x1)+'.\x20'+IDE_CONFIGS[_0x50db25][_0x32671d(0xea)]+_0x32671d(0xde)+IDE_CONFIGS[_0x50db25][_0x32671d(0xc5)]);}),console[_0x9eecaa(0xd1)](_0x9eecaa(0xe5)),console[_0x9eecaa(0xd1)](_0x9eecaa(0xce)),new Promise(_0x1203f8=>{const _0x4f09c5=_0x9eecaa,_0x3ed57f=createInterface({'input':process[_0x4f09c5(0xc9)],'output':process[_0x4f09c5(0xbf)]});_0x3ed57f[_0x4f09c5(0xdc)]('请选择:\x20',_0x2d95a6=>{const _0x1dd8cd=_0x4f09c5;_0x3ed57f[_0x1dd8cd(0xd6)]();const _0x1a155c=_0x2d95a6[_0x1dd8cd(0xe8)]()[_0x1dd8cd(0xdb)]();(_0x1a155c==='q'||_0x1a155c===_0x1dd8cd(0xef)||_0x1a155c===_0x1dd8cd(0xe7))&&(console[_0x1dd8cd(0xd1)](_0x1dd8cd(0xca)),process[_0x1dd8cd(0xe7)](0x0));const _0x9480ff=parseInt(_0x1a155c,0xa);if(!isNaN(_0x9480ff)&&_0x9480ff>=0x1&&_0x9480ff<=_0x284e8e[_0x1dd8cd(0xd3)]){const _0x4bcf0e=_0x284e8e[_0x9480ff-0x1];_0x4bcf0e&&_0x1203f8(_0x4bcf0e);return;}console[_0x1dd8cd(0xd1)](_0x1dd8cd(0xcb)+_0x284e8e[_0x1dd8cd(0xd3)]+_0x1dd8cd(0xe0)),process[_0x1dd8cd(0xe7)](0x1);});});}function a58_0x337d(){const _0x1dc353=['7LvLxfi','message','--help','\x20\x20q.\x20取消\x0a','claude','exit','trim','error','name','\x0a可用命令:','20IBCxzI','920590GZVuMr','1061016zCCkPL','quit','4570glCyrR','\x0aLovrabet\x20MCP\x20-\x20MCP\x20服务器配置工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x20\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互式选择并配置\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20直接配置\x20Cursor\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20--claude\x20\x20\x20\x20直接配置\x20Claude\x20Code\x20MCP\x0a\x0a配置方式:\x0a\x20\x20\x20交互式选择\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20显示\x20IDE\x20列表供选择\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x0a\x20\x20\x20\x20→\x20输入编号选择\x20IDE\x0a\x0a\x20\x20直接配置指定\x20IDE\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20使用\x20--ide\x20标志直接配置\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20配置\x20Cursor\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x20--claude\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20配置\x20Claude\x20Code\x0a\x0a支持的\x20IDE:\x0a','cursor','\x20\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并配置\x20MCP','9qKbeAV','433158wWauvY','stdout','mcp-install','37149HdUmmC','错误:\x20不支持的命令:\x20','428MdQtCD','from','description','mcpCursor','\x20MCP...\x0a','forEach','stdin','\x0a已取消配置\x0a','\x0a无效的选择,请输入\x201-','不支持的命令:\x20','map','请输入编号选择\x20IDE:\x0a','join','\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20mcp\x20install\x0a\x20\x20\x20\x20→\x20交互式选择\x20IDE\x0a\x0a\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x0a\x20\x20\x20\x20→\x20直接配置\x20Cursor\x20MCP\x20(写入\x20.cursor/mcp.json)\x0a\x0a配置指南:\x0a\x20\x20https://help.yuntoo.com/mcp/config-guide\x0a','log','mcpClaude','length','\x0a错误:\x20配置失败\x20-\x20','配置失败','close','(空)','cwd','116168OphGwU','\x0a请选择要配置\x20MCP\x20的\x20IDE:\x0a','toLowerCase','question','setLogPath','\x20-\x20','help','\x20之间的数字\x0a','53071uFGWHb'];a58_0x337d=function(){return _0x1dc353;};return a58_0x337d();}async function installMcp(_0x221140){const _0x2252af=a58_0x24c0;let _0x9fca6e;!_0x221140?_0x9fca6e=await selectIDE():_0x9fca6e=_0x221140;try{const _0x311657=IDE_CONFIGS[_0x9fca6e];console[_0x2252af(0xd1)]('\x0a📦\x20正在配置\x20'+_0x311657[_0x2252af(0xea)]+_0x2252af(0xc7));switch(_0x9fca6e){case _0x2252af(0xf2):await configureCursorMcp();break;case _0x2252af(0xe6):await configureClaudeMcp();break;}}catch(_0x728e13){logger['error'](_0x2252af(0xc0),_0x2252af(0xd5),{'error':_0x728e13 instanceof Error?_0x728e13[_0x2252af(0xe3)]:String(_0x728e13)}),console['error'](_0x2252af(0xd4)+(_0x728e13 instanceof Error?_0x728e13[_0x2252af(0xe3)]:String(_0x728e13))+'\x0a'),process['exit'](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a59_0x43f2(){const _0x5c2c0f=['32825468OzBdss','\x20MCP\x20配置成功','log','\x0a✗\x20','error','success','mcp-install-non-interactive','claude','20UQLmNV','push','filter','20Phextl','12zjTKtb','1403fwBMLn','\x20MCP\x20配置失败:\x20','282amubMo','3856779Nuyhdd','683916csFHeu','579944KHqkZw','\x0a注意:部分配置需要手动执行命令,请按照上述说明操作','91vcdlvo','其他\x20IDE','1366VexTkg','124365LKTkjS','message','Cursor','cwd','cursor','length','Claude\x20Code','18996791diQOUL','开始配置\x20MCP','other','some','未知的\x20IDE:\x20','\x0a✓\x20MCP\x20配置完成\x20(','setLogPath'];a59_0x43f2=function(){return _0x5c2c0f;};return a59_0x43f2();}const a59_0x3184f7=a59_0x5610;(function(_0x944d11,_0x5499fa){const _0x2e4b99=a59_0x5610,_0x1f4126=_0x944d11();while(!![]){try{const _0x4210c5=-parseInt(_0x2e4b99(0xd9))/0x1*(parseInt(_0x2e4b99(0xe2))/0x2)+-parseInt(_0x2e4b99(0xdd))/0x3*(parseInt(_0x2e4b99(0xd7))/0x4)+parseInt(_0x2e4b99(0xe3))/0x5*(-parseInt(_0x2e4b99(0xdb))/0x6)+-parseInt(_0x2e4b99(0xe0))/0x7*(parseInt(_0x2e4b99(0xde))/0x8)+parseInt(_0x2e4b99(0xdc))/0x9*(parseInt(_0x2e4b99(0xd4))/0xa)+-parseInt(_0x2e4b99(0xc5))/0xb*(-parseInt(_0x2e4b99(0xd8))/0xc)+parseInt(_0x2e4b99(0xcc))/0xd;if(_0x4210c5===_0x5499fa)break;else _0x1f4126['push'](_0x1f4126['shift']());}catch(_0x1e8880){_0x1f4126['push'](_0x1f4126['shift']());}}}(a59_0x43f2,0xdb9ca));function a59_0x5610(_0x43e2fc,_0x49ba23){_0x43e2fc=_0x43e2fc-0xc2;const _0x43f201=a59_0x43f2();let _0x5610da=_0x43f201[_0x43e2fc];return _0x5610da;}import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';import{logger}from'../utils/logger.js';export async function installMcpNonInteractive(_0x42e615,_0x290813=process[a59_0x3184f7(0xe6)]()){const _0x3e9dd4=a59_0x3184f7;logger[_0x3e9dd4(0xcb)](_0x290813),logger['info'](_0x3e9dd4(0xd2),_0x3e9dd4(0xc6),{'ides':_0x42e615});const _0x667b04=[];for(const _0x2ab665 of _0x42e615){try{let _0x4adb2b;switch(_0x2ab665){case _0x3e9dd4(0xc2):_0x4adb2b=await configureCursorMcp(_0x290813);break;case _0x3e9dd4(0xd3):_0x4adb2b=configureClaudeMcp(_0x290813);break;case _0x3e9dd4(0xc7):_0x4adb2b=showOtherMcpGuide(_0x290813);break;default:_0x4adb2b={'success':![],'message':_0x3e9dd4(0xc9)+_0x2ab665};}_0x667b04[_0x3e9dd4(0xd5)](_0x4adb2b);if(_0x4adb2b[_0x3e9dd4(0xd1)]){const _0x3df3e6=_0x2ab665===_0x3e9dd4(0xc2)?_0x3e9dd4(0xe5):_0x2ab665==='claude'?_0x3e9dd4(0xc4):_0x3e9dd4(0xe1);console[_0x3e9dd4(0xce)]('\x0a✓\x20'+_0x3df3e6+_0x3e9dd4(0xcd)),console[_0x3e9dd4(0xce)]('\x20\x20'+_0x4adb2b[_0x3e9dd4(0xe4)]);}else console[_0x3e9dd4(0xd0)](_0x3e9dd4(0xcf)+_0x2ab665+_0x3e9dd4(0xda)+_0x4adb2b[_0x3e9dd4(0xe4)]);}catch(_0x42414f){console[_0x3e9dd4(0xd0)](_0x3e9dd4(0xcf)+_0x2ab665+_0x3e9dd4(0xda)+(_0x42414f instanceof Error?_0x42414f[_0x3e9dd4(0xe4)]:String(_0x42414f)));}}const _0xf8c17c=_0x667b04[_0x3e9dd4(0xd6)](_0x217ea4=>_0x217ea4[_0x3e9dd4(0xd1)])[_0x3e9dd4(0xc3)],_0x1b8bf9=_0x667b04[_0x3e9dd4(0xc3)];console[_0x3e9dd4(0xce)](_0x3e9dd4(0xca)+_0xf8c17c+'/'+_0x1b8bf9+'\x20成功)');const _0x4cf7af=_0x667b04[_0x3e9dd4(0xc8)](_0x34f86b=>_0x34f86b['needsManualAction']);_0x4cf7af&&console[_0x3e9dd4(0xce)](_0x3e9dd4(0xdf));}
|
package/lib/mcp/mcp-installer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x50cfbc=a60_0x2052;(function(_0x5d08c4,_0xac7570){const _0x29ab09=a60_0x2052,_0x248424=_0x5d08c4();while(!![]){try{const _0x59137d=-parseInt(_0x29ab09(0x141))/0x1+parseInt(_0x29ab09(0x15c))/0x2+parseInt(_0x29ab09(0x154))/0x3*(parseInt(_0x29ab09(0x158))/0x4)+parseInt(_0x29ab09(0x135))/0x5*(-parseInt(_0x29ab09(0x134))/0x6)+parseInt(_0x29ab09(0x12a))/0x7+parseInt(_0x29ab09(0x162))/0x8*(-parseInt(_0x29ab09(0x12e))/0x9)+parseInt(_0x29ab09(0x152))/0xa;if(_0x59137d===_0xac7570)break;else _0x248424['push'](_0x248424['shift']());}catch(_0x7ec85c){_0x248424['push'](_0x248424['shift']());}}}(a60_0x5202,0xafeb8));import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export const MCP_SERVER_NAME=a60_0x50cfbc(0x128);function a60_0x2052(_0x29c05a,_0xa199b8){_0x29c05a=_0x29c05a-0x128;const _0x520240=a60_0x5202();let _0x20524e=_0x520240[_0x29c05a];return _0x20524e;}export const MCP_COMMAND=a60_0x50cfbc(0x157);export const MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];export function getAppConfig(){const _0x54fd14=a60_0x50cfbc,_0x1ba315=readConfig(),_0x59d207=_0x1ba315[_0x54fd14(0x142)]||_0x1ba315[_0x54fd14(0x160)],_0x21561d=_0x1ba315[_0x54fd14(0x15f)]||'online';if(!_0x59d207)throw new Error(_0x54fd14(0x143));return{'appcode':String(_0x59d207),'env':_0x21561d};}export function buildMcpEnv(_0x1cf738,_0x3c950a){const _0x3980da=a60_0x50cfbc,_0xfae599={'LOVRABET_APP_CODE':_0x1cf738};return _0x3c950a!==_0x3980da(0x148)&&(_0xfae599[_0x3980da(0x165)]=_0x3c950a),_0xfae599;}function a60_0x5202(){const _0x1a2fcc=['AppCode:\x20',',\x20env=','7848qbgbel','\x22LOVRABET_APP_CODE\x22:\x20\x22','配置失败','配置信息:','环境:\x20','claude\x20mcp\x20add\x20','2748858nQNWvq','5WHuJwJ','创建新的\x20mcp.json\x20配置','mcp-cursor','创建\x20Cursor\x20Rules\x20文件','\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{','push','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[\x22@lovrabet/dataset-mcp-server@latest\x22],','\x20-e\x20LOVRABET_ENV=','\x22LOVRABET_ENV\x22:\x20\x22','\x0a\x20\x20','lovrabet_rules.mdc','utf8','592712KEBMCJ','appcode','未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,','复制\x20agents.md\x20文件失败','message','重启\x20Cursor\x20后生效','online','join','\x20\x20}','Cursor\x20Rules\x20文件已存在,跳过','stringify','mcpServers','.cursor','parse','\x20\x20\x20\x20\x20\x20}','创建\x20agents.md\x20文件','11545330IaIvjj','info','9ttYzgG','复制\x20Cursor\x20Rules\x20文件失败','error','npx','1177716eyVkVW','重启\x20Claude\x20Code\x20后生效','mcp-install','utf-8','874092Hqnkeh','配置\x20Cursor\x20MCP\x20失败','mcp.json','env','app','map','12896LShWDx','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','agents.md','LOVRABET_ENV','更新现有\x20mcp.json\x20配置','mcp-claude','配置信息:\x20appcode=','详细配置指南:\x20https://help.yuntoo.com/mcp/config-guide','agents.md\x20文件已存在,跳过','lovrabet-dataset','\x20\x20\x20\x20}','4915547TbzyLG','配置\x20Cursor\x20MCP\x20成功'];a60_0x5202=function(){return _0x1a2fcc;};return a60_0x5202();}export function buildMcpServerConfig(_0x6d09e0,_0x670345){return{'command':MCP_COMMAND,'args':MCP_ARGS,'env':buildMcpEnv(_0x6d09e0,_0x670345)};}export function buildClaudeMcpCommand(_0x587f5f,_0xf8a6b0){const _0x20dcfa=a60_0x50cfbc,_0x2d4827=_0x20dcfa(0x133)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS['join']('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x587f5f,_0xa50d26=_0xf8a6b0!=='online'?_0x20dcfa(0x13c)+_0xf8a6b0:'';return''+_0x2d4827+_0xa50d26;}export async function copyCursorRules(_0x258746){const _0x521657=a60_0x50cfbc,_0x42f07e=join(_0x258746,_0x521657(0x14e)),_0x4ae98f=join(_0x42f07e,'rules'),_0x2d6b06=join(_0x4ae98f,_0x521657(0x13f));if(existsSync(_0x2d6b06))return logger[_0x521657(0x153)](_0x521657(0x15a),_0x521657(0x14b),{'path':_0x2d6b06}),![];try{ensureDir(_0x4ae98f);const _0x4bc750=await getRulesContent();return writeFileSync(_0x2d6b06,_0x4bc750,_0x521657(0x15b)),logger['info'](_0x521657(0x15a),_0x521657(0x138),{'to':_0x2d6b06}),!![];}catch(_0x3e65d9){return logger[_0x521657(0x156)]('mcp-install',_0x521657(0x155),{'error':_0x3e65d9 instanceof Error?_0x3e65d9[_0x521657(0x146)]:String(_0x3e65d9)}),![];}}export async function copyAgentsMd(_0xba27ab){const _0x1ae9e0=a60_0x50cfbc,_0x4f800b=join(_0xba27ab,_0x1ae9e0(0x164));if(existsSync(_0x4f800b))return logger[_0x1ae9e0(0x153)](_0x1ae9e0(0x15a),_0x1ae9e0(0x16a),{'path':_0x4f800b}),![];try{const _0x4111dc=await getRulesContent();return writeFileSync(_0x4f800b,_0x4111dc,_0x1ae9e0(0x15b)),logger[_0x1ae9e0(0x153)](_0x1ae9e0(0x15a),_0x1ae9e0(0x151),{'to':_0x4f800b}),!![];}catch(_0x3c3fee){return logger[_0x1ae9e0(0x156)]('mcp-install',_0x1ae9e0(0x145),{'error':_0x3c3fee instanceof Error?_0x3c3fee[_0x1ae9e0(0x146)]:String(_0x3c3fee)}),![];}}export async function configureCursorMcp(_0x17f844){const _0x3b13d6=a60_0x50cfbc;try{const {appcode:_0x2db09d,env:_0x5607b0}=getAppConfig(),_0x4fe846=join(_0x17f844,'.cursor'),_0xa18f93=join(_0x4fe846,_0x3b13d6(0x15e));ensureDir(_0x4fe846);const _0x4bdf17=buildMcpServerConfig(_0x2db09d,_0x5607b0);let _0x45693f;if(existsSync(_0xa18f93)){const _0x554ad4=readFileSync(_0xa18f93,_0x3b13d6(0x140));_0x45693f=JSON[_0x3b13d6(0x14f)](_0x554ad4),!_0x45693f[_0x3b13d6(0x14d)]&&(_0x45693f[_0x3b13d6(0x14d)]={}),logger[_0x3b13d6(0x153)](_0x3b13d6(0x137),_0x3b13d6(0x166),{'path':_0xa18f93,'appcode':_0x2db09d,'env':_0x5607b0});}else _0x45693f={'mcpServers':{}},logger[_0x3b13d6(0x153)](_0x3b13d6(0x137),_0x3b13d6(0x136),{'path':_0xa18f93,'appcode':_0x2db09d,'env':_0x5607b0});_0x45693f[_0x3b13d6(0x14d)][MCP_SERVER_NAME]=_0x4bdf17,writeFileSync(_0xa18f93,JSON[_0x3b13d6(0x14c)](_0x45693f,null,0x2),{'encoding':_0x3b13d6(0x140)});const _0x195d30=await copyCursorRules(_0x17f844),_0x40c7b3=['已写入\x20.cursor/mcp.json',_0x3b13d6(0x12c)+_0x2db09d];return _0x5607b0!==_0x3b13d6(0x148)&&_0x40c7b3[_0x3b13d6(0x13a)](_0x3b13d6(0x132)+_0x5607b0),_0x40c7b3['push'](_0x3b13d6(0x147)),_0x195d30&&_0x40c7b3[_0x3b13d6(0x13a)]('已创建\x20Cursor\x20Rules\x20文件'),logger[_0x3b13d6(0x153)](_0x3b13d6(0x137),_0x3b13d6(0x12b),{'appcode':_0x2db09d,'env':_0x5607b0,'configPath':_0xa18f93}),{'success':!![],'message':_0x40c7b3['join'](_0x3b13d6(0x13e))};}catch(_0x413fa7){return logger[_0x3b13d6(0x156)]('mcp-cursor',_0x3b13d6(0x15d),{'error':_0x413fa7 instanceof Error?_0x413fa7['message']:String(_0x413fa7)}),{'success':![],'message':_0x413fa7 instanceof Error?_0x413fa7[_0x3b13d6(0x146)]:String(_0x413fa7)};}}export function configureClaudeMcp(_0x483b32){const _0x3dbb2e=a60_0x50cfbc;try{const {appcode:_0x3f4b72,env:_0xc16ba7}=getAppConfig();copyAgentsMd(_0x483b32);const _0x1caeb0=buildClaudeMcpCommand(_0x3f4b72,_0xc16ba7),_0x110dab=['请执行以下命令配置\x20Claude\x20Code\x20MCP:',''+_0x1caeb0,_0x3dbb2e(0x131),_0x3dbb2e(0x12c)+_0x3f4b72];return _0xc16ba7!==_0x3dbb2e(0x148)&&_0x110dab['push'](_0x3dbb2e(0x132)+_0xc16ba7),_0x110dab[_0x3dbb2e(0x13a)](_0x3dbb2e(0x159)),logger[_0x3dbb2e(0x153)](_0x3dbb2e(0x167),'生成配置命令',{'appcode':_0x3f4b72,'env':_0xc16ba7,'command':_0x1caeb0}),{'success':!![],'message':_0x110dab['join']('\x0a\x20\x20'),'needsManualAction':!![]};}catch(_0x415a70){return logger[_0x3dbb2e(0x156)](_0x3dbb2e(0x167),_0x3dbb2e(0x130),{'error':_0x415a70 instanceof Error?_0x415a70[_0x3dbb2e(0x146)]:String(_0x415a70)}),{'success':![],'message':_0x415a70 instanceof Error?_0x415a70[_0x3dbb2e(0x146)]:String(_0x415a70)};}}export function showOtherMcpGuide(_0x54d6c3){const _0x37bbf2=a60_0x50cfbc;try{const {appcode:_0x3d597b,env:_0x27af48}=getAppConfig(),_0x2bc280=buildMcpServerConfig(_0x3d597b,_0x27af48),_0xe117ec=[_0x37bbf2(0x12f)+_0x3d597b+'\x22'];_0x27af48!==_0x37bbf2(0x148)&&_0xe117ec[_0x37bbf2(0x13a)](_0x37bbf2(0x13d)+_0x27af48+'\x22');const _0x10238f=[_0x37bbf2(0x168)+_0x3d597b+_0x37bbf2(0x12d)+_0x27af48,'{','\x20\x20\x22mcpServers\x22:\x20{',_0x37bbf2(0x139),_0x37bbf2(0x144),_0x37bbf2(0x13b),_0x37bbf2(0x163),..._0xe117ec[_0x37bbf2(0x161)](_0x4dd2fd=>'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4dd2fd+','),_0x37bbf2(0x150),_0x37bbf2(0x129),_0x37bbf2(0x14a),'}',_0x37bbf2(0x169)];return logger['info'](_0x37bbf2(0x15a),'其他\x20IDE\x20配置指引已显示',{'appcode':_0x3d597b,'env':_0x27af48}),{'success':!![],'message':_0x10238f[_0x37bbf2(0x149)]('\x0a'),'needsManualAction':!![]};}catch(_0x28342c){return{'success':![],'message':_0x28342c instanceof Error?_0x28342c[_0x37bbf2(0x146)]:String(_0x28342c)};}}function ensureDir(_0x23f6b8){!existsSync(_0x23f6b8)&&mkdirSync(_0x23f6b8,{'recursive':!![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x5a5309=a61_0x2af6;(function(_0x18d5fe,_0x116973){const _0x4f9cb0=a61_0x2af6,_0x3047bc=_0x18d5fe();while(!![]){try{const _0x261058=-parseInt(_0x4f9cb0(0xd0))/0x1*(-parseInt(_0x4f9cb0(0xc8))/0x2)+parseInt(_0x4f9cb0(0xa4))/0x3+-parseInt(_0x4f9cb0(0xbc))/0x4+parseInt(_0x4f9cb0(0xc7))/0x5+-parseInt(_0x4f9cb0(0xb5))/0x6+-parseInt(_0x4f9cb0(0xbb))/0x7*(parseInt(_0x4f9cb0(0xa9))/0x8)+-parseInt(_0x4f9cb0(0xbf))/0x9*(parseInt(_0x4f9cb0(0xb8))/0xa);if(_0x261058===_0x116973)break;else _0x3047bc['push'](_0x3047bc['shift']());}catch(_0x5f5acf){_0x3047bc['push'](_0x3047bc['shift']());}}}(a61_0x512f,0x80727));import{jsx as a61_0x3c92e8,jsxs as a61_0x43864a,Fragment as a61_0x3bb50e}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';import{logger}from'../utils/logger.js';import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,IDE_LIST}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';function a61_0x512f(){const _0x1c95e2=['column','已安装\x20','2332290vHAdCA','安装成功','done','20hrpoZU','按任意键退出...','length','7eHqpKX','68940EEBqeo','skill-install','selecting','1123749qaWQaJ','keys','error','\x20个目录','utf-8','正在安装技能包...','cwd','selectedIndexes','5036815cEdScz','14pNwbLD','log','description','return','.lovrabet','正在从\x20CDN\x20拉取开发者指南','cyan','.lovrabet/skill-manifest.json','52007MUEbOG','green','setErrorMsg','\x20失败:\x20','请至少选择一个\x20IDE','\x20\x20✗\x20安装\x20','✓\x20技能包安装成功!共安装\x20','.lovrabet/skill/.shared/guides','...','262098tvmipT','installing','message','size','✓\x20拉取\x20','2215896hLHkRf','value','\x20个开发者指南','gray','name','开发者指南位置:\x20.lovrabet/skill/.shared/guides/','info','已选择\x20IDE','2.0.0','map'];a61_0x512f=function(){return _0x1c95e2;};return a61_0x512f();}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{IDESelector,useIDESelection}from'../ui/IDESelector.js';const __dirname=dirname(fileURLToPath(import.meta.url)),UI_IDE_LIST=IDE_LIST[a61_0x5a5309(0xb2)](_0x3e5bbe=>({'key':_0x3e5bbe,'name':IDE_CONFIGS[_0x3e5bbe][a61_0x5a5309(0xad)],'description':IDE_CONFIGS[_0x3e5bbe][a61_0x5a5309(0xca)]}));export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[],providedFlags:_0x72ae11}){const _0x2a09c4=a61_0x5a5309,{exit:_0x11ef2d}=useApp(),[_0x538b5c,_0x1151ff]=useState(_0x2a09c4(0xbe)),[_0xe9747b,_0x2066e7]=useState([]),[_0x4045f4,_0x58d699]=useState([]),[_0x48c59b,_0x110e3a]=useState(0x0),_0x24e5bf=useIDESelection({'ideList':UI_IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x41e1b0=_0x2a09c4;preselectedIDEs[_0x41e1b0(0xba)]>0x0&&_0x24e5bf['selectedIndexes'][_0x41e1b0(0xa7)]>0x0&&_0x25d85e();},[]),useInput((_0x17f914,_0x4c1ac2)=>{const _0x334aac=_0x2a09c4;if(_0x538b5c===_0x334aac(0xbe)){if(_0x17f914==='q'||_0x17f914==='Q'){_0x11ef2d();return;}if(_0x4c1ac2[_0x334aac(0xcb)]){if(_0x24e5bf['selectedIndexes'][_0x334aac(0xa7)]===0x0){_0x24e5bf[_0x334aac(0x9d)](_0x334aac(0x9f));return;}_0x25d85e();return;}_0x24e5bf['handleKeyDown'](_0x17f914,_0x4c1ac2);}_0x538b5c==='done'&&_0x11ef2d();});async function _0x25d85e(){const _0x2e77eb=_0x2a09c4,_0x520159=_0x24e5bf['getSelectedIDEs']();_0x58d699(_0x520159),_0x2066e7([{'label':_0x2e77eb(0xb0),'value':_0x24e5bf[_0x2e77eb(0xc6)]['size']+'\x20个'}]),_0x1151ff(_0x2e77eb(0xa5)),await _0x26a691(_0x520159);}async function _0x26a691(_0x8f00ed){const _0x572278=_0x2a09c4,_0x3a15fc=process[_0x572278(0xc5)](),_0x5b151c=resolve(__dirname,'../../cdn-source/skills');logger['setLogPath'](_0x3a15fc);const _0x34e2c5=_0x72ae11&&_0x72ae11[_0x572278(0xba)]>0x0;console[_0x572278(0xc9)](_0x572278(0xcd)+(_0x34e2c5?'(含扩展)':'')+_0x572278(0xa3));let _0x493a2b;try{_0x493a2b=await fetchGuidesFromCDN(_0x34e2c5),console[_0x572278(0xc9)](_0x572278(0xa8)+Object[_0x572278(0xc0)](_0x493a2b['guides'])[_0x572278(0xba)]+_0x572278(0xab));}catch(_0x477704){console['warn']('\x20\x20!\x20CDN\x20拉取失败,跳过指南安装:\x20'+(_0x477704 instanceof Error?_0x477704[_0x572278(0xa6)]:String(_0x477704)));}let _0x1de9e8=0x0;for(const _0x1db772 of _0x8f00ed){try{const _0x20181d=IDE_CONFIGS[_0x1db772],_0x45bd06=await installSingleIDE(_0x1db772,_0x20181d,_0x3a15fc,_0x5b151c,_0x493a2b,_0x72ae11);_0x1de9e8+=_0x45bd06,_0x110e3a(_0x1de9e8);}catch(_0x2d9957){console[_0x572278(0xc1)](_0x572278(0xa0)+_0x1db772+_0x572278(0x9e)+(_0x2d9957 instanceof Error?_0x2d9957[_0x572278(0xa6)]:String(_0x2d9957)));}}_0x493a2b&&writeGuidesToProject(_0x493a2b,_0x3a15fc,_0x572278(0xa2),_0x72ae11);const _0xb17d14={'version':_0x572278(0xb1),'installedAt':new Date()['toISOString'](),'platforms':_0x8f00ed},_0x56eb4a=join(_0x3a15fc,_0x572278(0xcf)),_0x590832=join(_0x3a15fc,_0x572278(0xcc));await copyDir(_0x590832,_0x590832),writeFileSync(_0x56eb4a,JSON['stringify'](_0xb17d14,null,0x2),_0x572278(0xc3)),logger[_0x572278(0xaf)](_0x572278(0xbd),_0x572278(0xb6),{'projectRoot':_0x3a15fc,'ides':_0x8f00ed,'foldersCount':_0x1de9e8}),_0x1151ff(_0x572278(0xb7)),setTimeout(()=>{_0x11ef2d();},0x3e8);}return a61_0x43864a(Box,{'flexDirection':_0x2a09c4(0xb3),'marginTop':0x1,'children':[_0x538b5c===_0x2a09c4(0xbe)&&a61_0x3c92e8(IDESelector,{'ideList':UI_IDE_LIST,'title':'安装\x20Lovrabet\x20技能包\x20-\x20选择\x20IDE','selection':_0x24e5bf}),_0x538b5c==='installing'&&a61_0x3c92e8(InstallingStep,{'completedSteps':_0xe9747b,'installingIDEs':_0x4045f4,'installedCount':_0x48c59b}),_0x538b5c===_0x2a09c4(0xb7)&&a61_0x3c92e8(DoneStep,{'installedCount':_0x48c59b})]});}function InstallingStep({completedSteps:_0x461329,installingIDEs:_0x568e25,installedCount:_0xe08016}){const _0x4fa097=a61_0x5a5309;return a61_0x43864a(a61_0x3bb50e,{'children':[_0x461329[_0x4fa097(0xb2)]((_0x3dd9f2,_0x2161d0)=>a61_0x43864a(Box,{'children':[a61_0x43864a(Text,{'color':_0x4fa097(0x9c),'children':['√\x20',_0x3dd9f2['label'],':\x20']}),a61_0x3c92e8(Text,{'color':_0x4fa097(0xce),'children':_0x3dd9f2[_0x4fa097(0xaa)]})]},_0x2161d0)),a61_0x3c92e8(Box,{'marginTop':0x1,'children':a61_0x3c92e8(Text,{'children':_0x4fa097(0xc4)})}),_0x568e25[_0x4fa097(0xb2)](_0x38d615=>a61_0x43864a(Box,{'children':[a61_0x3c92e8(Text,{'color':'green','children':'\x20\x20✓\x20'}),a61_0x3c92e8(Text,{'children':IDE_CONFIGS[_0x38d615]?.[_0x4fa097(0xad)]||_0x38d615})]},_0x38d615)),a61_0x3c92e8(Box,{'marginTop':0x1,'children':a61_0x43864a(Text,{'color':_0x4fa097(0xac),'children':[_0x4fa097(0xb4),_0xe08016,'\x20个目录']})})]});}function a61_0x2af6(_0x31e929,_0x59704c){_0x31e929=_0x31e929-0x9c;const _0x512ff7=a61_0x512f();let _0x2af6d7=_0x512ff7[_0x31e929];return _0x2af6d7;}function DoneStep({installedCount:_0x372e9e}){const _0x3e8715=a61_0x5a5309;return a61_0x43864a(a61_0x3bb50e,{'children':[a61_0x3c92e8(Box,{'children':a61_0x43864a(Text,{'color':_0x3e8715(0x9c),'children':[_0x3e8715(0xa1),_0x372e9e,_0x3e8715(0xc2)]})}),a61_0x3c92e8(Box,{'marginTop':0x1,'children':a61_0x3c92e8(Text,{'color':_0x3e8715(0xac),'children':_0x3e8715(0xae)})}),a61_0x3c92e8(Box,{'marginTop':0x1,'children':a61_0x3c92e8(Text,{'color':_0x3e8715(0xac),'children':_0x3e8715(0xb9)})})]});}async function copyDirIfNeeded(_0x5d7265,_0x7198f6){try{return await copyDir(_0x5d7265,_0x7198f6),!![];}catch{return![];}}
|