@lovrabet/cli 1.3.1 → 1.3.2-beta.1
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(_0x8f78d7,_0x15889a){const _0x2a2716=a45_0x8891,_0x591491=_0x8f78d7();while(!![]){try{const _0x4f404e=parseInt(_0x2a2716(0x1f6))/0x1*(-parseInt(_0x2a2716(0x21f))/0x2)+parseInt(_0x2a2716(0x1f7))/0x3*(parseInt(_0x2a2716(0x208))/0x4)+parseInt(_0x2a2716(0x213))/0x5+parseInt(_0x2a2716(0x227))/0x6*(parseInt(_0x2a2716(0x21c))/0x7)+parseInt(_0x2a2716(0x20e))/0x8+parseInt(_0x2a2716(0x222))/0x9+-parseInt(_0x2a2716(0x203))/0xa*(parseInt(_0x2a2716(0x20a))/0xb);if(_0x4f404e===_0x15889a)break;else _0x591491['push'](_0x591491['shift']());}catch(_0x8c4470){_0x591491['push'](_0x591491['shift']());}}}(a45_0x5ac0,0x63783));import a45_0x4c24c8 from'path';import{fileURLToPath}from'url';function a45_0x8891(_0x368f4f,_0x3989fc){_0x368f4f=_0x368f4f-0x1f4;const _0x5ac0f7=a45_0x5ac0();let _0x88916d=_0x5ac0f7[_0x368f4f];return _0x88916d;}import a45_0x442cc1 from'fs/promises';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 _0x598461=a45_0x8891,_0x1eecb4=fileURLToPath(import.meta.url),_0x13d011=a45_0x4c24c8[_0x598461(0x1f9)](_0x1eecb4);return a45_0x4c24c8[_0x598461(0x20f)](_0x13d011,_0x598461(0x214));}export async function createProjectNonInteractive(_0x960992,_0x22766e){const _0x5e1854=a45_0x8891,_0x337ea7=await checkCliVersion();_0x337ea7['needsUpgrade']&&printCliUpgradeWarning(_0x337ea7);(!_0x960992||_0x960992[_0x5e1854(0x216)]()==='')&&(console[_0x5e1854(0x229)](_0x5e1854(0x226)),process['exit'](0x1));const _0x40f837=/[<>:"|?*\x00-\x1f\x7f]/;_0x40f837[_0x5e1854(0x20b)](_0x960992)&&(console[_0x5e1854(0x229)](_0x5e1854(0x221)),process[_0x5e1854(0x211)](0x1));_0x960992[_0x5e1854(0x215)]>0x64&&(console['error'](_0x5e1854(0x219)),process[_0x5e1854(0x211)](0x1));const _0x30cc6d=a45_0x4c24c8[_0x5e1854(0x20f)](process['cwd'](),_0x960992);existsSync(_0x30cc6d)&&(console['error'](_0x5e1854(0x220)+_0x960992+_0x5e1854(0x206)),process[_0x5e1854(0x211)](0x1));try{const _0x3df689=a45_0x4c24c8[_0x5e1854(0x1f9)](_0x30cc6d);await a45_0x442cc1[_0x5e1854(0x1fc)](_0x3df689,a45_0x442cc1[_0x5e1854(0x1fe)][_0x5e1854(0x1ff)]);}catch(_0x326b0e){console['error'](_0x5e1854(0x21a)),process[_0x5e1854(0x211)](0x1);}try{console[_0x5e1854(0x21d)](_0x5e1854(0x201)+_0x960992+_0x5e1854(0x20c));const _0x10913d=getTemplateDir();await copyDirectory(_0x10913d,_0x30cc6d),console['log'](_0x5e1854(0x21b)),await updatePackageJsonName(_0x960992),console[_0x5e1854(0x21d)]('\x20\x20√\x20package.json\x20已更新'),console[_0x5e1854(0x21d)](_0x5e1854(0x202)),console[_0x5e1854(0x21d)](_0x5e1854(0x1fa)),await formatCode(_0x30cc6d),console['log'](_0x5e1854(0x224)),await configureAppEnv(_0x960992,_0x22766e),console[_0x5e1854(0x21d)](_0x5e1854(0x223)),console[_0x5e1854(0x21d)](_0x5e1854(0x200)+_0x960992+_0x5e1854(0x205)),console[_0x5e1854(0x21d)](_0x5e1854(0x20d)+_0x960992),console[_0x5e1854(0x21d)]('\x20\x20lovrabet\x20start\x0a');}catch(_0x3cfd5d){const _0x2c728d=_0x3cfd5d instanceof Error?_0x3cfd5d['message']:String(_0x3cfd5d);try{existsSync(_0x30cc6d)&&await a45_0x442cc1['rm'](_0x30cc6d,{'recursive':!![],'force':!![]});}catch{}console[_0x5e1854(0x229)]('×\x20项目创建失败:\x20'+_0x2c728d),process[_0x5e1854(0x211)](0x1);}}async function updatePackageJsonName(_0x53c714){const _0x338863=a45_0x8891,_0x1b3f17=a45_0x4c24c8[_0x338863(0x20f)](process[_0x338863(0x210)](),_0x53c714),_0x50cc09=a45_0x4c24c8[_0x338863(0x204)](_0x1b3f17,'package.json'),_0x43eb9f=await a45_0x442cc1[_0x338863(0x212)](_0x50cc09,'utf-8'),_0x5d1d00=JSON[_0x338863(0x207)](_0x43eb9f);_0x5d1d00[_0x338863(0x1f4)]=_0x53c714,_0x5d1d00[_0x338863(0x21e)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a45_0x442cc1[_0x338863(0x1fd)](_0x50cc09,JSON['stringify'](_0x5d1d00,null,0x2)+'\x0a');}function a45_0x5ac0(){const _0x4766e7=['W_OK','\x0a√\x20项目\x20','*\x20正在创建项目\x20','\x20\x20正在安装依赖...','20lqmEJc','join','\x20创建成功!','\x20已存在,请使用其他项目名','parse','524924qIHFYV','bun','5117607dljpaP','test','...','\x0a\x20\x20cd\x20','2925232nzsUVa','resolve','cwd','exit','readFile','2177590NBjyBy','../../templates/projects/sub-app-react-demo','length','trim','lovrabet.config.json','stringify','×\x20项目名过长,最多支持\x20100\x20个字符','×\x20无法在当前目录创建项目,请检查目录权限','\x20\x20√\x20项目模板已创建','3116561Ciupuq','log','description','214994sPRpyQ','×\x20项目目录\x20','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','396342nJMOad','\x20\x20√\x20环境配置完成','\x20\x20√\x20代码已格式化','env','×\x20项目名不能为空','6ZTcNgP','bun\x20run\x20format','error','utf-8','name','\x20install','2mWtjeO','6sPiosd','npm','dirname','\x20\x20√\x20依赖安装跳过(非交互模式)','依赖安装失败:\x20','access','writeFile','constants'];a45_0x5ac0=function(){return _0x4766e7;};return a45_0x5ac0();}async function installDependencies(_0xd2e888){const _0x113eea=a45_0x8891,_0x2b70af=detectPackageManager(),_0x539181=_0x2b70af+_0x113eea(0x1f5);try{await execAsync(_0x539181,{'cwd':_0xd2e888});}catch(_0x1ee1be){throw new Error(_0x113eea(0x1fb)+_0x1ee1be);}}function detectPackageManager(){const _0x5038c1=a45_0x8891;try{return execAsync('bun\x20--version',{}),_0x5038c1(0x209);}catch{return _0x5038c1(0x1f8);}}async function formatCode(_0x114fa6){const _0x14bc30=a45_0x8891;try{await execAsync(_0x14bc30(0x228),{'cwd':_0x114fa6});}catch{}}async function configureAppEnv(_0xcd1295,_0x363721){const _0x1da7f1=a45_0x8891,_0x271cba=a45_0x4c24c8[_0x1da7f1(0x20f)](process[_0x1da7f1(0x210)](),_0xcd1295),_0x9e08fa=a45_0x4c24c8[_0x1da7f1(0x204)](_0x271cba,_0x1da7f1(0x217));let _0x147698={};if(existsSync(_0x9e08fa)){const _0x16222d=await a45_0x442cc1[_0x1da7f1(0x212)](_0x9e08fa,_0x1da7f1(0x22a));_0x147698=JSON[_0x1da7f1(0x207)](_0x16222d);}_0x363721&&(_0x147698[_0x1da7f1(0x225)]=_0x363721),await a45_0x442cc1[_0x1da7f1(0x1fd)](_0x9e08fa,JSON[_0x1da7f1(0x218)](_0x147698,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x860842,_0x1d25ef){var _0x1b1d0c=a46_0x605f,_0x3bd34b=_0x860842();while(!![]){try{var _0x12731e=-parseInt(_0x1b1d0c(0xc4))/0x1+-parseInt(_0x1b1d0c(0xc6))/0x2*(parseInt(_0x1b1d0c(0xbc))/0x3)+-parseInt(_0x1b1d0c(0xbf))/0x4+parseInt(_0x1b1d0c(0xc9))/0x5*(-parseInt(_0x1b1d0c(0xbb))/0x6)+-parseInt(_0x1b1d0c(0xc7))/0x7*(parseInt(_0x1b1d0c(0xc0))/0x8)+-parseInt(_0x1b1d0c(0xc1))/0x9*(-parseInt(_0x1b1d0c(0xc5))/0xa)+-parseInt(_0x1b1d0c(0xbd))/0xb*(-parseInt(_0x1b1d0c(0xbe))/0xc);if(_0x12731e===_0x1d25ef)break;else _0x3bd34b['push'](_0x3bd34b['shift']());}catch(_0x55ebcb){_0x3bd34b['push'](_0x3bd34b['shift']());}}}(a46_0x1f3b,0xdccc3));import{jsx as a46_0x5bf40f,jsxs as a46_0x4d0cd8}from'react/jsx-runtime';function a46_0x605f(_0xdbbc4e,_0x4540ef){_0xdbbc4e=_0xdbbc4e-0xbb;var _0x1f3be7=a46_0x1f3b();var _0x605fdd=_0x1f3be7[_0xdbbc4e];return _0x605fdd;}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';function a46_0x1f3b(){var _0x348b56=['62tCXjdp','7nQyJqs','\x20√\x20','5718095glgpVM','6XagAAd','128028ZHzWrn','407CTFzYf','2013348HjiryU','5816580IThTHK','10847608vwqeBz','1010673ybVjHg','elapsed','taskName','139062uSXWxg','10Jzdjfy'];a46_0x1f3b=function(){return _0x348b56;};return a46_0x1f3b();}export function TaskFinished(_0x545920){var _0x3a0423=a46_0x605f;return a46_0x4d0cd8(Box,{'children':[a46_0x5bf40f(Box,{'width':'1'}),a46_0x5bf40f(Text,{'color':'green','children':_0x3a0423(0xc8)}),a46_0x5bf40f(Text,{'children':_0x545920[_0x3a0423(0xc3)]}),a46_0x5bf40f(TaskTime,{'elapsed':_0x545920[_0x3a0423(0xc2)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x492f(_0x55c792,_0x209480){_0x55c792=_0x55c792-0x189;var _0x3b6b7b=a47_0x3b6b();var _0x492f7c=_0x3b6b7b[_0x55c792];return _0x492f7c;}(function(_0x4d5e86,_0x779026){var _0x4fd53b=a47_0x492f,_0x3063b5=_0x4d5e86();while(!![]){try{var _0x2d6051=parseInt(_0x4fd53b(0x189))/0x1*(-parseInt(_0x4fd53b(0x193))/0x2)+-parseInt(_0x4fd53b(0x191))/0x3+-parseInt(_0x4fd53b(0x18b))/0x4+parseInt(_0x4fd53b(0x18c))/0x5+-parseInt(_0x4fd53b(0x190))/0x6*(-parseInt(_0x4fd53b(0x194))/0x7)+-parseInt(_0x4fd53b(0x195))/0x8*(-parseInt(_0x4fd53b(0x18d))/0x9)+parseInt(_0x4fd53b(0x196))/0xa*(parseInt(_0x4fd53b(0x197))/0xb);if(_0x2d6051===_0x779026)break;else _0x3063b5['push'](_0x3063b5['shift']());}catch(_0x2f91a){_0x3063b5['push'](_0x3063b5['shift']());}}}(a47_0x3b6b,0x79317));import{jsx as a47_0x49b963,jsxs as a47_0x38dc88}from'react/jsx-runtime';function a47_0x3b6b(){var _0x3d1dfc=['161UsQnyJ','800RKylbi','7970OaEdPE','2959uyzBTW','finished','3823RTskzM','dots','2954504gMAlqg','3633910lhEbFM','22149xYzdJW','loading','\x20√\x20','122508WFXWKt','198951YCQjiR','green','186UAnmWB'];a47_0x3b6b=function(){return _0x3d1dfc;};return a47_0x3b6b();}import{Text}from'ink';import a47_0x2ddb22 from'ink-spinner';export function TaskLoading(_0x18e85c){var _0x3be250=a47_0x492f;if(_0x18e85c[_0x3be250(0x198)])return a47_0x49b963(Text,{'color':_0x3be250(0x192),'children':_0x3be250(0x18f)});if(_0x18e85c[_0x3be250(0x18e)])return a47_0x38dc88(Text,{'color':_0x3be250(0x192),'children':['\x20',a47_0x49b963(a47_0x2ddb22,{'type':_0x3be250(0x18a)}),'\x20']});return a47_0x49b963(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0xb69a(_0x129313,_0x4cb35e){_0x129313=_0x129313-0x74;var _0x1848da=a48_0x1848();var _0xb69a4f=_0x1848da[_0x129313];return _0xb69a4f;}(function(_0x3cd8f5,_0x357a9d){var _0x5ae416=a48_0xb69a,_0x3ee615=_0x3cd8f5();while(!![]){try{var _0x18b117=parseInt(_0x5ae416(0x74))/0x1+-parseInt(_0x5ae416(0x79))/0x2+parseInt(_0x5ae416(0x78))/0x3+-parseInt(_0x5ae416(0x7d))/0x4+parseInt(_0x5ae416(0x77))/0x5+parseInt(_0x5ae416(0x75))/0x6+parseInt(_0x5ae416(0x7c))/0x7*(parseInt(_0x5ae416(0x7a))/0x8);if(_0x18b117===_0x357a9d)break;else _0x3ee615['push'](_0x3ee615['shift']());}catch(_0x58c866){_0x3ee615['push'](_0x3ee615['shift']());}}}(a48_0x1848,0x3748d));import{jsx as a48_0x3895fb,jsxs as a48_0x223b8e}from'react/jsx-runtime';function a48_0x1848(){var _0x19481f=['taskName','14VYGdOY','1481440NQVbtF','243301bInHCL','790566HoLnyF','elapsed','1386995XTYTog','84534gjXxLd','417644cJJvJN','499952FQMtPr'];a48_0x1848=function(){return _0x19481f;};return a48_0x1848();}import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x26d3d3){var _0x53ceee=a48_0xb69a;return a48_0x223b8e(Box,{'children':[a48_0x3895fb(Box,{'width':'1'}),a48_0x3895fb(TaskLoading,{..._0x26d3d3}),a48_0x3895fb(Text,{'children':_0x26d3d3[_0x53ceee(0x7b)]}),a48_0x3895fb(TaskTime,{'elapsed':_0x26d3d3[_0x53ceee(0x76)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a49_0x2a7f(){var _0x504384=['16GbZvOO','1303449nXONjX','260JkOpAc','11721mAczmR','gray','114460yuGLKp','elapsed','490370ARmLcA','434486wQJYar','890fngnmx','3037698Mjivbu','748mAibDy','2584620AFlaAt'];a49_0x2a7f=function(){return _0x504384;};return a49_0x2a7f();}(function(_0x1f5b23,_0x4c29db){var _0x366a32=a49_0x1fb3,_0x1a1354=_0x1f5b23();while(!![]){try{var _0x424c99=-parseInt(_0x366a32(0x120))/0x1+-parseInt(_0x366a32(0x121))/0x2*(parseInt(_0x366a32(0x128))/0x3)+-parseInt(_0x366a32(0x12a))/0x4*(parseInt(_0x366a32(0x127))/0x5)+parseInt(_0x366a32(0x124))/0x6+parseInt(_0x366a32(0x126))/0x7+-parseInt(_0x366a32(0x125))/0x8*(-parseInt(_0x366a32(0x122))/0x9)+parseInt(_0x366a32(0x11f))/0xa*(parseInt(_0x366a32(0x123))/0xb);if(_0x424c99===_0x4c29db)break;else _0x1a1354['push'](_0x1a1354['shift']());}catch(_0x2258e7){_0x1a1354['push'](_0x1a1354['shift']());}}}(a49_0x2a7f,0xebb50));import{jsx as a49_0x576ce4,Fragment as a49_0xa2eb19,jsxs as a49_0x22d59e}from'react/jsx-runtime';function a49_0x1fb3(_0x374e87,_0x216c75){_0x374e87=_0x374e87-0x11e;var _0x2a7f98=a49_0x2a7f();var _0x1fb399=_0x2a7f98[_0x374e87];return _0x1fb399;}import{Text}from'ink';export function TaskTime(_0x2ba0f3){var _0x16f2f3=a49_0x1fb3;if(_0x2ba0f3[_0x16f2f3(0x11e)])return a49_0x22d59e(a49_0xa2eb19,{'children':[a49_0x576ce4(Text,{'color':'gray','children':'\x20['}),a49_0x576ce4(Text,{'color':_0x16f2f3(0x129),'bold':!![],'children':_0x2ba0f3[_0x16f2f3(0x11e)]}),a49_0x576ce4(Text,{'color':_0x16f2f3(0x129),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a50_0x1b88(){const _0x8e6b29=['11466TnSwVk','3969pxLRmG','项目模板复制完成','333016Mugaag','276DqgyjP','37048HeLKTV','50ztepRO','1130iSfHeE','copy','../../templates/projects/sub-app-react-demo','resolve','3732588QPfpPt','now','70fQyojh','228468kyqaOm','2803725gWoMvZ','message','项目模板复制失败','36zfInqN','dirname'];a50_0x1b88=function(){return _0x8e6b29;};return a50_0x1b88();}const a50_0x4411a3=a50_0x3f02;(function(_0x528004,_0x5eafb4){const _0x4969c4=a50_0x3f02,_0x55cb5a=_0x528004();while(!![]){try{const _0x125c91=-parseInt(_0x4969c4(0x99))/0x1*(-parseInt(_0x4969c4(0x96))/0x2)+-parseInt(_0x4969c4(0x98))/0x3*(parseInt(_0x4969c4(0x9c))/0x4)+parseInt(_0x4969c4(0x9e))/0x5*(-parseInt(_0x4969c4(0xa6))/0x6)+-parseInt(_0x4969c4(0xa5))/0x7*(-parseInt(_0x4969c4(0x9b))/0x8)+parseInt(_0x4969c4(0xa7))/0x9+-parseInt(_0x4969c4(0x9f))/0xa*(-parseInt(_0x4969c4(0x9d))/0xb)+-parseInt(_0x4969c4(0xa3))/0xc;if(_0x125c91===_0x5eafb4)break;else _0x55cb5a['push'](_0x55cb5a['shift']());}catch(_0x581e1b){_0x55cb5a['push'](_0x55cb5a['shift']());}}}(a50_0x1b88,0x36c12));import a50_0xd9796f from'node:path';import{fileURLToPath}from'node:url';function a50_0x3f02(_0xbfb189,_0xbbab78){_0xbfb189=_0xbfb189-0x94;const _0x1b8853=a50_0x1b88();let _0x3f0279=_0x1b8853[_0xbfb189];return _0x3f0279;}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_0xd9796f[a50_0x4411a3(0x97)](fileURLToPath(import.meta.url)),templateDir=a50_0xd9796f[a50_0x4411a3(0xa2)](__dirname,a50_0x4411a3(0xa1));export function useCopyProjectTemplate(){const [_0x5eeb75,_0x5e4fc1]=useState(![]),[_0x42d0fc,_0x15266d]=useState(![]),[_0x41ea6a,_0x5b420e]=useState(''),_0x5789ef=useCallback(async _0x978f9f=>{const _0x1f974c=a50_0x3f02,_0x19183f=Date[_0x1f974c(0xa4)](),_0x19a918=a50_0xd9796f[_0x1f974c(0xa2)](process['cwd'](),_0x978f9f);_0x5e4fc1(!![]);try{logger['info']('copy','开始复制项目模板',{'projectCode':_0x978f9f,'templateDir':templateDir}),await copyDirectory(templateDir,_0x19a918);const _0x22550c=Date[_0x1f974c(0xa4)]()-_0x19183f;logger['success'](_0x1f974c(0xa0),_0x1f974c(0x9a),_0x22550c,{'projectCode':_0x978f9f});}catch(_0x5f0c16){const _0x43a422=Date[_0x1f974c(0xa4)]()-_0x19183f;logger['error'](_0x1f974c(0xa0),_0x1f974c(0x95),{'projectCode':_0x978f9f,'error':_0x5f0c16 instanceof Error?_0x5f0c16[_0x1f974c(0x94)]:String(_0x5f0c16),'duration':_0x43a422});throw _0x5f0c16;}finally{_0x5e4fc1(![]),_0x15266d(!![]),_0x5b420e(formatElapsed(_0x19183f));}},[]);return{'taskName':'复制项目文件','finished':_0x42d0fc,'loading':_0x5eeb75,'elapsed':_0x41ea6a,'doTask':_0x5789ef};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a51_0x46dd(){const _0x396268=['853176ZetToL','success','prettier','51774lryzIl','resolve','1187760StYZsv','info','206248pdqAyM','cwd','273clCPoP','格式化代码','format','开始格式化代码','message','npx','2523162DgkGwz','919472dmcHLr','now','4360392xXIzBT','56qerSTF','代码格式化完成','代码格式化失败'];a51_0x46dd=function(){return _0x396268;};return a51_0x46dd();}function a51_0x3146(_0x113072,_0x31cb4d){_0x113072=_0x113072-0xf7;const _0x46dd72=a51_0x46dd();let _0x314618=_0x46dd72[_0x113072];return _0x314618;}(function(_0x25261d,_0x528bdb){const _0x2e9e16=a51_0x3146,_0x508726=_0x25261d();while(!![]){try{const _0x419ba9=-parseInt(_0x2e9e16(0x106))/0x1+-parseInt(_0x2e9e16(0x103))/0x2*(parseInt(_0x2e9e16(0x109))/0x3)+-parseInt(_0x2e9e16(0x100))/0x4+parseInt(_0x2e9e16(0x10b))/0x5+parseInt(_0x2e9e16(0xff))/0x6+parseInt(_0x2e9e16(0xf9))/0x7*(parseInt(_0x2e9e16(0xf7))/0x8)+parseInt(_0x2e9e16(0x102))/0x9;if(_0x419ba9===_0x528bdb)break;else _0x508726['push'](_0x508726['shift']());}catch(_0x1fd799){_0x508726['push'](_0x508726['shift']());}}}(a51_0x46dd,0x8e07e));import a51_0x22192f 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 useFormatCode(){const _0x5e56bd=a51_0x3146,[_0x7cf8b,_0x5361fe]=useState(![]),[_0x4200b9,_0x5c55e0]=useState(![]),[_0x5cb38b,_0x1ef9be]=useState(''),_0x488097=useCallback(async _0x15566f=>{const _0x3a74e5=a51_0x3146,_0x20c9e1=Date[_0x3a74e5(0x101)](),_0x2b233a=a51_0x22192f[_0x3a74e5(0x10a)](process[_0x3a74e5(0xf8)](),_0x15566f);_0x5361fe(!![]);try{logger[_0x3a74e5(0x10c)](_0x3a74e5(0xfb),_0x3a74e5(0xfc),{'projectCode':_0x15566f}),await execa(_0x3a74e5(0xfe),[_0x3a74e5(0x108),'--write','.'],{'cwd':_0x2b233a});const _0x2d72b9=Date[_0x3a74e5(0x101)]()-_0x20c9e1;logger[_0x3a74e5(0x107)]('format',_0x3a74e5(0x104),_0x2d72b9,{'projectCode':_0x15566f});}catch(_0x24f4fe){const _0x4c5dca=Date[_0x3a74e5(0x101)]()-_0x20c9e1;logger['error'](_0x3a74e5(0xfb),_0x3a74e5(0x105),{'projectCode':_0x15566f,'error':_0x24f4fe instanceof Error?_0x24f4fe[_0x3a74e5(0xfd)]:String(_0x24f4fe),'duration':_0x4c5dca});throw _0x24f4fe;}finally{_0x5361fe(![]),_0x5c55e0(!![]),_0x1ef9be(formatElapsed(_0x20c9e1));}},[]);return{'taskName':_0x5e56bd(0xfa),'finished':_0x4200b9,'loading':_0x7cf8b,'elapsed':_0x5cb38b,'doTask':_0x488097};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xdeb836,_0x5bf354){const _0x57d699=a52_0x2171,_0x442fcd=_0xdeb836();while(!![]){try{const _0x85d92d=-parseInt(_0x57d699(0xcc))/0x1*(-parseInt(_0x57d699(0xd9))/0x2)+parseInt(_0x57d699(0xde))/0x3*(parseInt(_0x57d699(0xce))/0x4)+-parseInt(_0x57d699(0xd0))/0x5+parseInt(_0x57d699(0xd1))/0x6+-parseInt(_0x57d699(0xe0))/0x7+parseInt(_0x57d699(0xd5))/0x8*(parseInt(_0x57d699(0xdc))/0x9)+-parseInt(_0x57d699(0xd3))/0xa;if(_0x85d92d===_0x5bf354)break;else _0x442fcd['push'](_0x442fcd['shift']());}catch(_0x3f177a){_0x442fcd['push'](_0x442fcd['shift']());}}}(a52_0xe120,0x84af2));import a52_0x3fcc10 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a52_0xe120(){const _0x36c556=['resolve','5850256CjaMzs','info','npm','cwd','468782pDORsm','message','now','9gRrNnV','error','287895uMODik','--registry','5789679llWSQf','2jeNuVS','https://registry.npmmirror.com','36dwTgOk','安装依赖','830385nqGlVQ','5840748XQWeKp','install','15005590WGEXIY'];a52_0xe120=function(){return _0x36c556;};return a52_0xe120();}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a52_0x2171(_0x1de484,_0x4e4578){_0x1de484=_0x1de484-0xcc;const _0xe120ed=a52_0xe120();let _0x21715a=_0xe120ed[_0x1de484];return _0x21715a;}export function useInstallDependencies(){const _0x4baeb2=a52_0x2171,[_0x12b725,_0x226e15]=useState(![]),[_0x4811dd,_0x43c2b3]=useState(![]),[_0x4a9a08,_0x3df849]=useState(''),_0x3c5463=useCallback(async _0x4e1dd7=>{const _0x171cd5=a52_0x2171,_0x1d6a82=Date[_0x171cd5(0xdb)](),_0x1f8c14=a52_0x3fcc10[_0x171cd5(0xd4)](process[_0x171cd5(0xd8)](),_0x4e1dd7);_0x226e15(!![]),_0x43c2b3(![]);const _0xd36f24=async(_0x150e93,_0x33642e)=>{await execa(_0x150e93,_0x33642e,{'cwd':_0x1f8c14});};try{logger[_0x171cd5(0xd6)]('install','开始安装依赖',{'projectCode':_0x4e1dd7,'registry':_0x171cd5(0xcd)}),await _0xd36f24(_0x171cd5(0xd7),['install',_0x171cd5(0xdf),_0x171cd5(0xcd)]);const _0x41a6a1=Date[_0x171cd5(0xdb)]()-_0x1d6a82;logger['success'](_0x171cd5(0xd2),'依赖安装完成',_0x41a6a1,{'projectCode':_0x4e1dd7});}catch(_0x289486){const _0x426684=Date['now']()-_0x1d6a82;logger[_0x171cd5(0xdd)](_0x171cd5(0xd2),'依赖安装失败',{'projectCode':_0x4e1dd7,'error':_0x289486 instanceof Error?_0x289486[_0x171cd5(0xda)]:String(_0x289486),'duration':_0x426684});throw _0x289486;}finally{_0x226e15(![]),_0x43c2b3(!![]),_0x3df849(formatElapsed(_0x1d6a82));}},[]);return{'taskName':_0x4baeb2(0xcf),'finished':_0x4811dd,'loading':_0x12b725,'elapsed':_0x4a9a08,'doTask':_0x3c5463};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a53_0x3350(){var _0x2ab3ac=['!\x20请指定一个有效的命令。','1422712VRCHov','1164524waWhIz','6LkLqgf','22470mJKRsk','582NtjOGK','2802114tiZspk','16897275ITrIEC','2822784RiCrmi','green','查看可用命令。','288128ZeDAzP'];a53_0x3350=function(){return _0x2ab3ac;};return a53_0x3350();}(function(_0x4d27a6,_0x2a372b){var _0x3df04f=a53_0x2ad9,_0x472b37=_0x4d27a6();while(!![]){try{var _0x440f87=-parseInt(_0x3df04f(0x1b1))/0x1+-parseInt(_0x3df04f(0x1b4))/0x2+parseInt(_0x3df04f(0x1b5))/0x3*(parseInt(_0x3df04f(0x1b3))/0x4)+-parseInt(_0x3df04f(0x1b6))/0x5*(parseInt(_0x3df04f(0x1b7))/0x6)+-parseInt(_0x3df04f(0x1b8))/0x7+-parseInt(_0x3df04f(0x1ae))/0x8+parseInt(_0x3df04f(0x1b9))/0x9;if(_0x440f87===_0x2a372b)break;else _0x472b37['push'](_0x472b37['shift']());}catch(_0xdec56d){_0x472b37['push'](_0x472b37['shift']());}}}(a53_0x3350,0x813dd));import{jsx as a53_0x33e45b,jsxs as a53_0x2ad0cc}from'react/jsx-runtime';import{Box,Text}from'ink';function a53_0x2ad9(_0x1d5c22,_0x427279){_0x1d5c22=_0x1d5c22-0x1ae;var _0x335012=a53_0x3350();var _0x2ad92f=_0x335012[_0x1d5c22];return _0x2ad92f;}export function Help(){var _0x550ee9=a53_0x2ad9;return a53_0x2ad0cc(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a53_0x2ad0cc(Box,{'children':[a53_0x33e45b(Box,{'width':'1'}),a53_0x33e45b(Text,{'children':_0x550ee9(0x1b2)})]}),a53_0x2ad0cc(Box,{'marginTop':0x1,'children':[a53_0x33e45b(Box,{'width':'1'}),a53_0x2ad0cc(Text,{'children':['\x20\x20','使用']}),a53_0x2ad0cc(Text,{'bold':!![],'color':_0x550ee9(0x1af),'children':['\x20','lovrabet\x20--help','\x20']}),a53_0x33e45b(Text,{'children':_0x550ee9(0x1b0)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a54_0x4417(){const _0x39999b=['应用代码不合法','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','cwd','初始化项目配置文件成功','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','应用代码不能为空','.lovrabetrc','backspace','正在初始化配置文件...','1.0.0','column','parse','stringify','1232579dcvqGC','env','init','当前目录已存在\x20.lovrabetrc\x20文件','请输入应用代码\x20(AppCode):\x20','red','../..','应用代码长度不能超过\x20100\x20个字符','\x20←\x20','gray','online','984DeebMX','3895842dFcJVe','cyan','创建配置文件失败','4DJXHPf','trim','message','应用代码只能包含字母、数字、-\x20和\x20_','2616648qSxIFS','exit','setLogPath','AppCode:\x20','toLocaleString','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','utf8','green','return','string','length','26098520rxQHwn','创建配置文件失败:\x20','slice','test','delete','4219855xKjxKm','6nAZfIi','version','80235sbDWwo','5698987XCZEJK','ctrl'];a54_0x4417=function(){return _0x39999b;};return a54_0x4417();}(function(_0x455e5f,_0x4a249e){const _0x483ee0=a54_0x54c8,_0x2f2cb8=_0x455e5f();while(!![]){try{const _0x3ca725=parseInt(_0x483ee0(0x199))/0x1+-parseInt(_0x483ee0(0x1ac))/0x2+-parseInt(_0x483ee0(0x1a5))/0x3+parseInt(_0x483ee0(0x1a8))/0x4*(-parseInt(_0x483ee0(0x186))/0x5)+-parseInt(_0x483ee0(0x187))/0x6*(parseInt(_0x483ee0(0x18a))/0x7)+-parseInt(_0x483ee0(0x1a4))/0x8*(-parseInt(_0x483ee0(0x189))/0x9)+parseInt(_0x483ee0(0x1b7))/0xa;if(_0x3ca725===_0x4a249e)break;else _0x2f2cb8['push'](_0x2f2cb8['shift']());}catch(_0x105f63){_0x2f2cb8['push'](_0x2f2cb8['shift']());}}}(a54_0x4417,0xa4886));import{jsxs as a54_0x37505d,jsx as a54_0x2e658b}from'react/jsx-runtime';import{useState,useEffect}from'react';function a54_0x54c8(_0x26f068,_0x11197e){_0x26f068=_0x26f068-0x184;const _0x44172b=a54_0x4417();let _0x54c8c4=_0x44172b[_0x26f068];return _0x54c8c4;}import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x204469,env:_0x12d19e}){const _0x201d51=a54_0x54c8,[_0x56c07a,_0x5186d8]=useState(null),[_0x4e282f,_0x69dcf1]=useState(![]),[_0x3afa64,_0x59b48d]=useState(!_0x204469),[_0x4b5368,_0x14946c]=useState(''),[_0x4e79d4,_0x2f3ecf]=useState(''),[_0xa85b17,_0x1151b9]=useState(_0x204469||''),[_0xc0b3c2]=useState(_0x12d19e);function _0x13be2e(_0x7d74fe){const _0x1c22d0=a54_0x54c8;if(_0x7d74fe['length']===0x0)return{'valid':![],'message':''};if(_0x7d74fe[_0x1c22d0(0x1b6)]>0x64)return{'valid':![],'message':_0x1c22d0(0x1a0)};const _0x3a48dc=/^[A-Za-z0-9_-]+$/;if(!_0x3a48dc[_0x1c22d0(0x184)](_0x7d74fe))return{'valid':![],'message':_0x1c22d0(0x1ab)};return{'valid':!![]};}useInput((_0x713d99,_0x4b05c0)=>{const _0x305991=a54_0x54c8;if(!_0x3afa64)return;if(_0x4b05c0[_0x305991(0x1b4)]){if(_0x4e79d4||!_0x4b5368[_0x305991(0x1a9)]()){_0x2f3ecf(_0x305991(0x191));return;}const _0x4f0994=_0x4b5368[_0x305991(0x1a9)](),{valid:_0x10d1df,message:_0x4eb2a5}=_0x13be2e(_0x4f0994);if(!_0x10d1df){_0x2f3ecf(_0x4eb2a5||'应用代码不合法');return;}_0x1151b9(_0x4f0994),_0x59b48d(![]);}else{if(_0x4b05c0[_0x305991(0x193)]||_0x4b05c0[_0x305991(0x185)])_0x14946c(_0x149196=>{const _0x580c4d=_0x305991,_0x2bf315=_0x149196[_0x580c4d(0x1b9)](0x0,-0x1);if(_0x2bf315[_0x580c4d(0x1b6)]===0x0)_0x2f3ecf('');else{const {valid:_0x500556,message:_0x305320}=_0x13be2e(_0x2bf315);_0x2f3ecf(_0x500556?'':_0x305320||_0x580c4d(0x18c));}return _0x2bf315;});else _0x4b05c0[_0x305991(0x18b)]&&_0x713d99==='c'?process['exit'](0x0):_0x14946c(_0x2e3458=>{const _0x21e9d3=_0x305991,_0x567373=_0x2e3458+_0x713d99,{valid:_0x27d5e7,message:_0x427969}=_0x13be2e(_0x567373);return _0x2f3ecf(_0x27d5e7?'':_0x427969||_0x21e9d3(0x18c)),_0x567373;});}},{'isActive':_0x3afa64}),useEffect(()=>{const _0x4d081e=a54_0x54c8;if(!_0xa85b17||_0x3afa64)return;const _0xd03989=resolve(process['cwd'](),_0x4d081e(0x192));if(existsSync(_0xd03989)){_0x5186d8(_0x4d081e(0x19c)),setTimeout(()=>process[_0x4d081e(0x1ad)](0x1),0x64);return;}try{const _0x47bd42=fileURLToPath(import.meta.url),_0x279c2a=resolve(dirname(_0x47bd42),_0x4d081e(0x19f)),_0x3ac51e=join(_0x279c2a,'package.json');let _0x35bccb=_0x4d081e(0x195);try{const _0x460f4f=JSON[_0x4d081e(0x197)](readFileSync(_0x3ac51e,_0x4d081e(0x1b2)));_0x35bccb=_0x460f4f[_0x4d081e(0x188)]||'1.0.0';}catch(_0x1b0d08){}const _0xeacbd6=readConfig(),_0x1fd92f=typeof _0xeacbd6['env']===_0x4d081e(0x1b5)?_0xeacbd6['env']:undefined,{app:_0x21ada2,appcode:_0x5e365c,..._0x15d87e}=_0xeacbd6,_0x54bc29={..._0x15d87e,'appcode':_0xa85b17,'env':_0xc0b3c2||_0x1fd92f||_0x4d081e(0x1a3),'createdAt':new Date()[_0x4d081e(0x1b0)](),'version':_0x35bccb};writeFileSync(_0xd03989,JSON[_0x4d081e(0x198)](_0x54bc29,null,0x2),{'encoding':'utf8','mode':0x180}),logger[_0x4d081e(0x1ae)](process[_0x4d081e(0x18e)]()),logger['info'](_0x4d081e(0x19b),_0x4d081e(0x18f),{'appcode':_0xa85b17,'env':_0x54bc29[_0x4d081e(0x19a)],'version':_0x54bc29[_0x4d081e(0x188)],'configPath':_0xd03989}),_0x69dcf1(!![]),setTimeout(()=>process[_0x4d081e(0x1ad)](0x0),0x64);}catch(_0x47a872){logger['error'](_0x4d081e(0x19b),_0x4d081e(0x1a7),{'error':_0x47a872 instanceof Error?_0x47a872[_0x4d081e(0x1aa)]:String(_0x47a872)}),_0x5186d8(_0x4d081e(0x1b8)+(_0x47a872 instanceof Error?_0x47a872[_0x4d081e(0x1aa)]:String(_0x47a872))),setTimeout(()=>process[_0x4d081e(0x1ad)](0x1),0x64);}},[_0xa85b17,_0x3afa64,_0xc0b3c2]);if(_0x56c07a)return a54_0x2e658b(Box,{'flexDirection':_0x201d51(0x196),'children':a54_0x37505d(Text,{'color':_0x201d51(0x19e),'children':['✗\x20',_0x56c07a]})});if(_0x3afa64)return a54_0x37505d(Box,{'flexDirection':'column','children':[a54_0x37505d(Box,{'children':[a54_0x2e658b(Text,{'color':'cyan','children':_0x201d51(0x19d)}),_0x4b5368?a54_0x2e658b(Text,{'color':_0x201d51(0x1b3),'children':_0x4b5368}):a54_0x2e658b(Text,{'color':_0x201d51(0x1a2),'children':'_'}),_0x4e79d4&&a54_0x37505d(Text,{'color':'red','children':[_0x201d51(0x1a1),_0x4e79d4]})]}),!_0x4e79d4&&!_0x4b5368&&a54_0x2e658b(Box,{'children':a54_0x2e658b(Text,{'color':_0x201d51(0x1a2),'children':_0x201d51(0x190)})})]});if(_0x4e282f)return a54_0x37505d(Box,{'flexDirection':_0x201d51(0x196),'children':[a54_0x2e658b(Text,{'color':'green','children':_0x201d51(0x1b1)}),a54_0x37505d(Text,{'color':_0x201d51(0x1a6),'children':[_0x201d51(0x1af),_0xa85b17]}),a54_0x2e658b(Text,{'children':_0x201d51(0x18d)})]});return a54_0x2e658b(Box,{'children':a54_0x2e658b(Text,{'children':_0x201d51(0x194)})});}
|
package/lib/mcp/McpInstallUI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x262c49=a55_0x48bf;(function(_0x3f8334,_0x4238bb){const _0x75b6a5=a55_0x48bf,_0x1fa058=_0x3f8334();while(!![]){try{const _0x3a04e1=parseInt(_0x75b6a5(0xa0))/0x1*(parseInt(_0x75b6a5(0xb0))/0x2)+-parseInt(_0x75b6a5(0xb7))/0x3*(parseInt(_0x75b6a5(0xb4))/0x4)+parseInt(_0x75b6a5(0xae))/0x5+parseInt(_0x75b6a5(0xc4))/0x6*(-parseInt(_0x75b6a5(0xa2))/0x7)+-parseInt(_0x75b6a5(0x9f))/0x8*(parseInt(_0x75b6a5(0xc1))/0x9)+parseInt(_0x75b6a5(0xa6))/0xa*(-parseInt(_0x75b6a5(0xbb))/0xb)+parseInt(_0x75b6a5(0xb5))/0xc*(parseInt(_0x75b6a5(0x9c))/0xd);if(_0x3a04e1===_0x4238bb)break;else _0x1fa058['push'](_0x1fa058['shift']());}catch(_0x3b9317){_0x1fa058['push'](_0x1fa058['shift']());}}}(a55_0x5691,0x6de16));import{jsx as a55_0x3e6686,jsxs as a55_0x32c42b,Fragment as a55_0x37996e}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';function a55_0x48bf(_0x384985,_0x1e84d9){_0x384985=_0x384985-0x97;const _0x56914c=a55_0x5691();let _0x48bf85=_0x56914c[_0x384985];return _0x48bf85;}import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';import{IDESelector,useIDESelection}from'../ui/IDESelector.js';import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';const IDE_LIST=[...Array[a55_0x262c49(0x9a)](MCP_IDES)[a55_0x262c49(0xa8)](_0x420793=>({'key':_0x420793,'name':IDE_CONFIGS[_0x420793][a55_0x262c49(0xcc)],'description':IDE_CONFIGS[_0x420793][a55_0x262c49(0x9d)]})),{'key':a55_0x262c49(0xba),'name':a55_0x262c49(0xc9),'description':a55_0x262c49(0xb9)}];export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x30848e=a55_0x262c49,{exit:_0x45db0c}=useApp(),[_0x173f58,_0x1f53e3]=useState('selecting'),[_0x282d65,_0x7cd36f]=useState([]),[_0x39e05b,_0x2f08b7]=useState([]),_0x1ca392=useIDESelection({'ideList':IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x19d8e4=a55_0x48bf;preselectedIDEs['length']>0x0&&_0x1ca392[_0x19d8e4(0xa5)][_0x19d8e4(0xa9)]>0x0&&_0x5a6620();},[]),useInput((_0x245890,_0x1cd1f1)=>{const _0x3975d9=a55_0x48bf;if(_0x173f58===_0x3975d9(0xb3)){if(_0x245890==='q'||_0x245890==='Q'){_0x45db0c();return;}if(_0x1cd1f1['return']){if(_0x1ca392[_0x3975d9(0xa5)]['size']===0x0){_0x1ca392[_0x3975d9(0xc8)]('请至少选择一个\x20IDE');return;}_0x5a6620();return;}_0x1ca392[_0x3975d9(0xc5)](_0x245890,_0x1cd1f1);}_0x173f58==='done'&&_0x45db0c();});async function _0x5a6620(){const _0x320050=a55_0x48bf,_0x393916=_0x1ca392[_0x320050(0x9e)]();_0x7cd36f([{'label':_0x320050(0x97),'value':_0x1ca392[_0x320050(0xa5)][_0x320050(0xa9)]+'\x20个'}]),_0x1f53e3('configuring');const _0x305d67=[];for(const _0x3cb729 of _0x393916){try{const _0x55d618=await configureMcp(_0x3cb729);_0x305d67['push']({'ide':IDE_LIST['find'](_0x5096f3=>_0x5096f3[_0x320050(0xcd)]===_0x3cb729)?.['name']||_0x3cb729,'status':_0x55d618[_0x320050(0xb1)]?'manual':_0x55d618[_0x320050(0xcb)]?_0x320050(0xcb):_0x320050(0xbd),'message':_0x55d618['message']});}catch(_0x4b89c5){_0x305d67[_0x320050(0xb2)]({'ide':IDE_LIST[_0x320050(0xa3)](_0x528278=>_0x528278[_0x320050(0xcd)]===_0x3cb729)?.[_0x320050(0xcc)]||_0x3cb729,'status':_0x320050(0xbd),'message':_0x4b89c5 instanceof Error?_0x4b89c5[_0x320050(0xc6)]:String(_0x4b89c5)});}}_0x2f08b7(_0x305d67),_0x1f53e3(_0x320050(0xc2)),setTimeout(()=>{_0x45db0c();},0x1388);}return a55_0x32c42b(Box,{'flexDirection':_0x30848e(0xa4),'marginTop':0x1,'children':[_0x173f58===_0x30848e(0xb3)&&a55_0x3e6686(IDESelector,{'ideList':IDE_LIST,'title':'配置\x20Lovrabet\x20MCP\x20服务器','selection':_0x1ca392}),_0x173f58==='configuring'&&a55_0x32c42b(a55_0x37996e,{'children':[_0x282d65[_0x30848e(0xa8)]((_0x5680c5,_0x30729d)=>a55_0x32c42b(Box,{'children':[a55_0x32c42b(Text,{'color':'green','children':['√\x20',_0x5680c5[_0x30848e(0xca)],':\x20']}),a55_0x3e6686(Text,{'color':_0x30848e(0xb6),'children':_0x5680c5[_0x30848e(0xbf)]})]},_0x30729d)),a55_0x3e6686(Box,{'marginTop':0x1,'children':a55_0x3e6686(Text,{'children':_0x30848e(0xa1)})})]}),_0x173f58==='done'&&a55_0x3e6686(DoneStep,{'configResults':_0x39e05b})]});}function DoneStep({configResults:_0xcaed2f}){const _0x298c3f=a55_0x262c49,_0x5351eb=_0xcaed2f[_0x298c3f(0xbc)](_0x19d00f=>_0x19d00f[_0x298c3f(0xb8)]===_0x298c3f(0xcb)),_0x1899eb=_0xcaed2f[_0x298c3f(0xaf)](_0x417d0f=>_0x417d0f[_0x298c3f(0xb8)]===_0x298c3f(0xce)),_0xa58212=_0xcaed2f[_0x298c3f(0xaf)](_0x5c84ac=>_0x5c84ac[_0x298c3f(0xb8)]===_0x298c3f(0xbd));return a55_0x32c42b(a55_0x37996e,{'children':[a55_0x3e6686(Box,{'children':_0x5351eb?a55_0x3e6686(Text,{'color':'green','children':'✓\x20MCP\x20配置完成!'}):_0x1899eb?a55_0x3e6686(Text,{'color':_0x298c3f(0xa7),'children':'⚠️\x20部分配置需要手动完成'}):_0xa58212?a55_0x3e6686(Text,{'color':'red','children':_0x298c3f(0xc3)}):a55_0x3e6686(Text,{'color':_0x298c3f(0xa7),'children':_0x298c3f(0xc0)})}),_0xcaed2f[_0x298c3f(0xa8)]((_0x3969a9,_0xb808a2)=>a55_0x32c42b(Box,{'flexDirection':'column','children':[a55_0x32c42b(Text,{'color':_0x3969a9[_0x298c3f(0xb8)]===_0x298c3f(0xcb)?'green':_0x3969a9[_0x298c3f(0xb8)]==='manual'?_0x298c3f(0xa7):_0x298c3f(0x9b),'children':[_0x3969a9['status']===_0x298c3f(0xcb)?_0x298c3f(0xc7):_0x3969a9[_0x298c3f(0xb8)]===_0x298c3f(0xce)?_0x298c3f(0x99):'\x20\x20✗','\x20',_0x3969a9[_0x298c3f(0xac)],':']}),a55_0x3e6686(Text,{'color':_0x3969a9[_0x298c3f(0xb8)]===_0x298c3f(0xcb)?_0x298c3f(0xad):_0x3969a9[_0x298c3f(0xb8)]==='manual'?_0x298c3f(0xa7):_0x298c3f(0x9b),'children':_0x3969a9[_0x298c3f(0xc6)]})]},_0xb808a2)),a55_0x3e6686(Box,{'marginTop':0x1,'children':a55_0x3e6686(Text,{'color':_0x298c3f(0x98),'children':_0x298c3f(0xab)})})]});}async function configureMcp(_0x33d519){const _0x56b614=a55_0x262c49,_0x2ccce1=process[_0x56b614(0xbe)]();switch(_0x33d519){case _0x56b614(0xaa):return configureCursorMcp(_0x2ccce1);case'claude':return configureClaudeMcp(_0x2ccce1);case _0x56b614(0xba):return showOtherMcpGuide(_0x2ccce1);default:throw new Error('不支持的\x20IDE:\x20'+_0x33d519);}}function a55_0x5691(){const _0x1eb329=['from','red','26407069eiJLuP','description','getSelectedIDEs','8IpUqbd','2092TERnLN','正在配置\x20MCP\x20服务器...','7fkMSka','find','column','selectedIndexes','40gQZdYR','yellow','map','size','cursor','按任意键退出...','ide','white','1553095PFPcyV','some','194tRLqiL','needsManualAction','push','selecting','260rRDdTH','12eVzKJD','cyan','14142eXZkvi','status','其他\x20IDE\x20配置指引','other','2052259yFgPiS','every','error','cwd','value','⚠️\x20配置需要手动完成','3253635pdRvFN','done','✗\x20配置失败','4083510GDjjJZ','handleKeyDown','message','\x20\x20✓','setErrorMsg','其他\x20IDE','label','success','name','key','manual','已选择\x20IDE','gray','\x20\x20⚠️'];a55_0x5691=function(){return _0x1eb329;};return a55_0x5691();}
|
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4c4c57,_0x452334){const _0x2ffdb2=a56_0x449b,_0x53abf0=_0x4c4c57();while(!![]){try{const _0x56d9c3=parseInt(_0x2ffdb2(0xf4))/0x1+parseInt(_0x2ffdb2(0xf1))/0x2+-parseInt(_0x2ffdb2(0xf3))/0x3+-parseInt(_0x2ffdb2(0xf2))/0x4*(parseInt(_0x2ffdb2(0xee))/0x5)+-parseInt(_0x2ffdb2(0xef))/0x6*(-parseInt(_0x2ffdb2(0xeb))/0x7)+parseInt(_0x2ffdb2(0xf6))/0x8+parseInt(_0x2ffdb2(0xed))/0x9;if(_0x56d9c3===_0x452334)break;else _0x53abf0['push'](_0x53abf0['shift']());}catch(_0x49fc33){_0x53abf0['push'](_0x53abf0['shift']());}}}(a56_0x4596,0x86852));function a56_0x4596(){const _0x4183a3=['6cXzfGA','\x0a错误:\x20配置失败\x20-\x20','677464iQYDzt','31316iOHbia','2787648eeJAid','998170wXSZWy','exit','795888ovDgBN','success','message','error','1924195gEaOwZ','log','4473306cmmOLX','465kpJiLW'];a56_0x4596=function(){return _0x4183a3;};return a56_0x4596();}import{configureClaudeMcp as a56_0x320e61}from'./mcp-installer.js';function a56_0x449b(_0xa16bc,_0x504412){_0xa16bc=_0xa16bc-0xeb;const _0x4596f9=a56_0x4596();let _0x449b92=_0x4596f9[_0xa16bc];return _0x449b92;}export async function configureClaudeMcp(){const _0x483d57=a56_0x449b,_0x6c5128=process['cwd'](),_0xd2a113=a56_0x320e61(_0x6c5128);_0xd2a113[_0x483d57(0xf7)]?(console[_0x483d57(0xec)]('\x0a📋\x20'+_0xd2a113[_0x483d57(0xf8)]+'\x0a'),process[_0x483d57(0xf5)](0x0)):(console[_0x483d57(0xf9)](_0x483d57(0xf0)+_0xd2a113['message']+'\x0a'),process[_0x483d57(0xf5)](0x1));}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a57_0x1b94(_0x2c2520,_0x2ddcbb){_0x2c2520=_0x2c2520-0x1f0;const _0x287c60=a57_0x287c();let _0x1b9413=_0x287c60[_0x2c2520];return _0x1b9413;}(function(_0x472195,_0x4a23f6){const _0x3767b1=a57_0x1b94,_0x561e76=_0x472195();while(!![]){try{const _0x2dffbd=parseInt(_0x3767b1(0x1fe))/0x1+parseInt(_0x3767b1(0x1fb))/0x2+-parseInt(_0x3767b1(0x1f3))/0x3+-parseInt(_0x3767b1(0x1f1))/0x4*(-parseInt(_0x3767b1(0x1ff))/0x5)+-parseInt(_0x3767b1(0x1fa))/0x6+-parseInt(_0x3767b1(0x1f7))/0x7+-parseInt(_0x3767b1(0x1f6))/0x8*(-parseInt(_0x3767b1(0x1fc))/0x9);if(_0x2dffbd===_0x4a23f6)break;else _0x561e76['push'](_0x561e76['shift']());}catch(_0x3e83f3){_0x561e76['push'](_0x561e76['shift']());}}}(a57_0x287c,0x9585d));import{configureCursorMcp as a57_0x222bf6}from'./mcp-installer.js';export async function configureCursorMcp(){const _0x2a062a=a57_0x1b94,_0x5a8d6a=process[_0x2a062a(0x1f4)](),_0xb0e70a=await a57_0x222bf6(_0x5a8d6a);_0xb0e70a[_0x2a062a(0x1f2)]?(console['log'](_0x2a062a(0x1f8)),console[_0x2a062a(0x1f5)]('配置信息:'),console[_0x2a062a(0x1f5)]('\x20\x20'+_0xb0e70a[_0x2a062a(0x1f9)]+'\x0a'),console[_0x2a062a(0x1f5)](_0x2a062a(0x1f0)),console[_0x2a062a(0x1f5)]('请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。'),process[_0x2a062a(0x1fd)](0x0)):(console['error']('\x0a错误:\x20配置失败\x20-\x20'+_0xb0e70a[_0x2a062a(0x1f9)]+'\x0a'),process[_0x2a062a(0x1fd)](0x1));}function a57_0x287c(){const _0x302e9b=['1065907UsiWOO','2245rjnvMB','现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','772bqIWnI','success','15561xeddXy','cwd','log','1486984tuwiSW','5918724ENvsao','\x0a✓\x20Cursor\x20MCP\x20配置成功!\x0a','message','3304668DkdmHF','1351010CCnecU','9yQTlbZ','exit'];a57_0x287c=function(){return _0x302e9b;};return a57_0x287c();}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a58_0x19b6(){const _0x1126fa=['\x0a可用命令:','\x0a错误:\x20配置失败\x20-\x20','setLogPath','不支持的命令:\x20','mcpClaude','3WysPAT','mcpCursor','209324mxeVvA','\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','\x0a无效的选择,请输入\x201-','has','\x20MCP...\x0a','\x0a📦\x20正在配置\x20','\x0a请选择要配置\x20MCP\x20的\x20IDE:\x0a','2257624mpsmBL','cursor','stdout','67098VJeiSP','(空)','description','trim','join','name','mcp-install','711206pWXhoa','cwd','\x20-\x20','2181640hJPCiC','exit','\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','install','9NnLpYW','claude','from','请选择:\x20','\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','help','\x20之间的数字\x0a','length','399xaympD','配置失败','mcp','map','log','forEach','error','toLowerCase','3134944hnmsmx','3097555FgjXfv'];a58_0x19b6=function(){return _0x1126fa;};return a58_0x19b6();}(function(_0x58c85e,_0x3814e0){const _0x5f02eb=a58_0x2e0e,_0x1a9428=_0x58c85e();while(!![]){try{const _0x27f0c0=-parseInt(_0x5f02eb(0x8a))/0x1+parseInt(_0x5f02eb(0x9b))/0x2*(-parseInt(_0x5f02eb(0x88))/0x3)+-parseInt(_0x5f02eb(0x81))/0x4+parseInt(_0x5f02eb(0x82))/0x5+-parseInt(_0x5f02eb(0x94))/0x6*(-parseInt(_0x5f02eb(0x79))/0x7)+parseInt(_0x5f02eb(0x91))/0x8*(parseInt(_0x5f02eb(0x71))/0x9)+parseInt(_0x5f02eb(0x6d))/0xa;if(_0x27f0c0===_0x3814e0)break;else _0x1a9428['push'](_0x1a9428['shift']());}catch(_0x5463d3){_0x1a9428['push'](_0x1a9428['shift']());}}}(a58_0x19b6,0x63c46));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';import{createInterface}from'node:readline';function a58_0x2e0e(_0x2ef1a3,_0x3c8ad6){_0x2ef1a3=_0x2ef1a3-0x6d;const _0x19b67a=a58_0x19b6();let _0x2e0ee=_0x19b67a[_0x2ef1a3];return _0x2e0ee;}import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';export async function mcpCommand(_0x27e0dc,_0x531b67,_0x1cc755){const _0xefc186=a58_0x2e0e;logger[_0xefc186(0x85)](process[_0xefc186(0x9c)]());if(_0x1cc755?.[_0xefc186(0x76)]||_0x27e0dc==='--help'){showHelp();return;}_0x27e0dc!==_0xefc186(0x70)&&(console[_0xefc186(0x7f)]('错误:\x20不支持的命令:\x20'+(_0x27e0dc||_0xefc186(0x95))),console[_0xefc186(0x7d)](_0xefc186(0x83)),console[_0xefc186(0x7d)]('\x20\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并配置\x20MCP'),console['log'](_0xefc186(0x75)),logger['error'](_0xefc186(0x7b),_0xefc186(0x86)+_0x27e0dc),process[_0xefc186(0x6e)](0x1));let _0x252f3b;if(_0x1cc755?.[_0xefc186(0x89)])_0x252f3b=_0xefc186(0x92);else{if(_0x1cc755?.[_0xefc186(0x87)])_0x252f3b=_0xefc186(0x72);else{if(_0x531b67?.[0x0]){const _0x48d417=_0x531b67[0x0][_0xefc186(0x80)]();MCP_IDES[_0xefc186(0x8d)](_0x48d417)&&(_0x252f3b=_0x48d417);}}}await installMcp(_0x252f3b);}function showHelp(){const _0x127c92=a58_0x2e0e;console['log'](_0x127c92(0x6f)+Array[_0x127c92(0x73)](MCP_IDES)[_0x127c92(0x7c)]((_0x554248,_0x5ee321)=>'\x20\x20'+(_0x5ee321+0x1)+'.\x20'+IDE_CONFIGS[_0x554248][_0x127c92(0x99)]+_0x127c92(0x9d)+IDE_CONFIGS[_0x554248]['description'])[_0x127c92(0x98)]('\x0a')+_0x127c92(0x8b));}async function selectIDE(){const _0x34e84a=a58_0x2e0e;console['log'](_0x34e84a(0x90));const _0x14c5bc=Array[_0x34e84a(0x73)](MCP_IDES);return _0x14c5bc[_0x34e84a(0x7e)]((_0x2ca4f3,_0x2755b0)=>{const _0x3fc47e=_0x34e84a;console[_0x3fc47e(0x7d)]('\x20\x20'+(_0x2755b0+0x1)+'.\x20'+IDE_CONFIGS[_0x2ca4f3][_0x3fc47e(0x99)]+'\x20-\x20'+IDE_CONFIGS[_0x2ca4f3][_0x3fc47e(0x96)]);}),console['log']('\x20\x20q.\x20取消\x0a'),console[_0x34e84a(0x7d)]('请输入编号选择\x20IDE:\x0a'),new Promise(_0xf94f0a=>{const _0x5d66ad=_0x34e84a,_0x3754c3=createInterface({'input':process['stdin'],'output':process[_0x5d66ad(0x93)]});_0x3754c3['question'](_0x5d66ad(0x74),_0x3b03ba=>{const _0x533360=_0x5d66ad;_0x3754c3['close']();const _0x3b4df1=_0x3b03ba[_0x533360(0x97)]()[_0x533360(0x80)]();(_0x3b4df1==='q'||_0x3b4df1==='quit'||_0x3b4df1==='exit')&&(console[_0x533360(0x7d)]('\x0a已取消配置\x0a'),process['exit'](0x0));const _0x418ea7=parseInt(_0x3b4df1,0xa);if(!isNaN(_0x418ea7)&&_0x418ea7>=0x1&&_0x418ea7<=_0x14c5bc[_0x533360(0x78)]){const _0x2d950f=_0x14c5bc[_0x418ea7-0x1];_0x2d950f&&_0xf94f0a(_0x2d950f);return;}console[_0x533360(0x7d)](_0x533360(0x8c)+_0x14c5bc[_0x533360(0x78)]+_0x533360(0x77)),process['exit'](0x1);});});}async function installMcp(_0x5702c9){const _0x2cd023=a58_0x2e0e;let _0x53dd43;!_0x5702c9?_0x53dd43=await selectIDE():_0x53dd43=_0x5702c9;try{const _0x2b6670=IDE_CONFIGS[_0x53dd43];console['log'](_0x2cd023(0x8f)+_0x2b6670[_0x2cd023(0x99)]+_0x2cd023(0x8e));switch(_0x53dd43){case'cursor':await configureCursorMcp();break;case _0x2cd023(0x72):await configureClaudeMcp();break;}}catch(_0x51d001){logger[_0x2cd023(0x7f)](_0x2cd023(0x9a),_0x2cd023(0x7a),{'error':_0x51d001 instanceof Error?_0x51d001['message']:String(_0x51d001)}),console[_0x2cd023(0x7f)](_0x2cd023(0x84)+(_0x51d001 instanceof Error?_0x51d001['message']:String(_0x51d001))+'\x0a'),process[_0x2cd023(0x6e)](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a59_0x3ba3(){const _0x24406e=['216222HwzeXh','1142372uzkLfs','cursor','\x20成功)','\x20MCP\x20配置失败:\x20','filter','setLogPath','5tycoyl','465NwKFUj','needsManualAction','1383084sFxUhD','info','未知的\x20IDE:\x20','102697CoqYOt','length','error','success','377EzjrVF','other','20VKQiWD','\x0a✓\x20MCP\x20配置完成\x20(','log','7484epsyWZ','10cXJqYS','\x0a✗\x20','12sgkbnx','其他\x20IDE','Cursor','3760xukDrL','开始配置\x20MCP','8muDvAT','34944QTkaHm','claude','Claude\x20Code','\x0a✓\x20','\x20MCP\x20配置成功','some'];a59_0x3ba3=function(){return _0x24406e;};return a59_0x3ba3();}(function(_0xa22231,_0x5c434b){const _0x1e5ec8=a59_0x451d,_0x153e2a=_0xa22231();while(!![]){try{const _0x531dfc=parseInt(_0x1e5ec8(0x15b))/0x1*(parseInt(_0x1e5ec8(0x158))/0x2)+-parseInt(_0x1e5ec8(0x172))/0x3*(-parseInt(_0x1e5ec8(0x161))/0x4)+-parseInt(_0x1e5ec8(0x171))/0x5*(-parseInt(_0x1e5ec8(0x16a))/0x6)+parseInt(_0x1e5ec8(0x177))/0x7*(parseInt(_0x1e5ec8(0x163))/0x8)+-parseInt(_0x1e5ec8(0x174))/0x9*(parseInt(_0x1e5ec8(0x15c))/0xa)+-parseInt(_0x1e5ec8(0x16b))/0xb*(-parseInt(_0x1e5ec8(0x15e))/0xc)+parseInt(_0x1e5ec8(0x156))/0xd*(-parseInt(_0x1e5ec8(0x164))/0xe);if(_0x531dfc===_0x5c434b)break;else _0x153e2a['push'](_0x153e2a['shift']());}catch(_0x560703){_0x153e2a['push'](_0x153e2a['shift']());}}}(a59_0x3ba3,0x24630));import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';function a59_0x451d(_0x161976,_0x402910){_0x161976=_0x161976-0x153;const _0x3ba315=a59_0x3ba3();let _0x451de8=_0x3ba315[_0x161976];return _0x451de8;}import{logger}from'../utils/logger.js';export async function installMcpNonInteractive(_0x54c04a,_0x2c964d=process['cwd']()){const _0x573662=a59_0x451d;logger[_0x573662(0x170)](_0x2c964d),logger[_0x573662(0x175)]('mcp-install-non-interactive',_0x573662(0x162),{'ides':_0x54c04a});const _0x314dd3=[];for(const _0x3f9719 of _0x54c04a){try{let _0x1bb3eb;switch(_0x3f9719){case _0x573662(0x16c):_0x1bb3eb=await configureCursorMcp(_0x2c964d);break;case _0x573662(0x165):_0x1bb3eb=configureClaudeMcp(_0x2c964d);break;case _0x573662(0x157):_0x1bb3eb=showOtherMcpGuide(_0x2c964d);break;default:_0x1bb3eb={'success':![],'message':_0x573662(0x176)+_0x3f9719};}_0x314dd3['push'](_0x1bb3eb);if(_0x1bb3eb[_0x573662(0x155)]){const _0x5e7b2f=_0x3f9719===_0x573662(0x16c)?_0x573662(0x160):_0x3f9719===_0x573662(0x165)?_0x573662(0x166):_0x573662(0x15f);console['log'](_0x573662(0x167)+_0x5e7b2f+_0x573662(0x168)),console[_0x573662(0x15a)]('\x20\x20'+_0x1bb3eb['message']);}else console[_0x573662(0x154)](_0x573662(0x15d)+_0x3f9719+_0x573662(0x16e)+_0x1bb3eb['message']);}catch(_0x1bd34c){console['error'](_0x573662(0x15d)+_0x3f9719+_0x573662(0x16e)+(_0x1bd34c instanceof Error?_0x1bd34c['message']:String(_0x1bd34c)));}}const _0x4796e1=_0x314dd3[_0x573662(0x16f)](_0x3419ce=>_0x3419ce['success'])[_0x573662(0x153)],_0x559dc7=_0x314dd3[_0x573662(0x153)];console[_0x573662(0x15a)](_0x573662(0x159)+_0x4796e1+'/'+_0x559dc7+_0x573662(0x16d));const _0x14d33f=_0x314dd3[_0x573662(0x169)](_0x3af1f4=>_0x3af1f4[_0x573662(0x173)]);_0x14d33f&&console[_0x573662(0x15a)]('\x0a注意:部分配置需要手动执行命令,请按照上述说明操作');}
|
package/lib/mcp/mcp-installer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x49bf17=a60_0x5cf0;(function(_0x1dcfa2,_0x281946){const _0x420099=a60_0x5cf0,_0x10a178=_0x1dcfa2();while(!![]){try{const _0x3f30b6=-parseInt(_0x420099(0x135))/0x1*(-parseInt(_0x420099(0x154))/0x2)+-parseInt(_0x420099(0x131))/0x3+-parseInt(_0x420099(0x16d))/0x4+-parseInt(_0x420099(0x169))/0x5*(-parseInt(_0x420099(0x148))/0x6)+-parseInt(_0x420099(0x132))/0x7*(-parseInt(_0x420099(0x157))/0x8)+-parseInt(_0x420099(0x137))/0x9+parseInt(_0x420099(0x15b))/0xa;if(_0x3f30b6===_0x281946)break;else _0x10a178['push'](_0x10a178['shift']());}catch(_0x309bb8){_0x10a178['push'](_0x10a178['shift']());}}}(a60_0x8168,0x95c38));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_0x49bf17(0x152);export const MCP_COMMAND=a60_0x49bf17(0x14e);export const MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];export function getAppConfig(){const _0x5583da=a60_0x49bf17,_0x1fef91=readConfig(),_0x5d275c=_0x1fef91['appcode']||_0x1fef91[_0x5583da(0x16c)],_0x3e5e90=_0x1fef91[_0x5583da(0x171)]||_0x5583da(0x16a);if(!_0x5d275c)throw new Error(_0x5583da(0x15f));return{'appcode':String(_0x5d275c),'env':_0x3e5e90};}export function buildMcpEnv(_0x344534,_0x481bcc){const _0x399dc5=a60_0x49bf17,_0x3077b7={'LOVRABET_APP_CODE':_0x344534};return _0x481bcc!=='online'&&(_0x3077b7[_0x399dc5(0x15d)]=_0x481bcc),_0x3077b7;}export function buildMcpServerConfig(_0x2a3b24,_0x3ac6ab){return{'command':MCP_COMMAND,'args':MCP_ARGS,'env':buildMcpEnv(_0x2a3b24,_0x3ac6ab)};}function a60_0x8168(){const _0x3c0122=['创建新的\x20mcp.json\x20配置','npx','配置信息:','\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{','agents.md','lovrabet-dataset','push','47078aUThBW','mcp-claude','lovrabet_rules.mdc','6890392SmoBYW','创建\x20Cursor\x20Rules\x20文件','\x20-e\x20LOVRABET_ENV=','mcp-cursor','4604170ebxKcw','utf8','LOVRABET_ENV','复制\x20agents.md\x20文件失败','未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','claude\x20mcp\x20add\x20','agents.md\x20文件已存在,跳过','join','详细配置指南:\x20https://help.yuntoo.com/mcp/config-guide','\x22LOVRABET_APP_CODE\x22:\x20\x22','配置\x20Cursor\x20MCP\x20成功','\x20\x20\x20\x20\x20\x20}','mcpServers','已写入\x20.cursor/mcp.json','10JaqQRW','online','配置失败','app','1697964sOIcTE','\x20\x20\x22mcpServers\x22:\x20{','重启\x20Claude\x20Code\x20后生效','\x0a\x20\x20','env','map','2637576dEWRRU','7orLjSi','\x20\x20\x20\x20}','.cursor','9YQEMXg','环境:\x20','4754412NgumBG','mcp-install','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[\x22@lovrabet/dataset-mcp-server@latest\x22],','\x20\x20}','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,','utf-8','配置\x20Cursor\x20MCP\x20失败','Cursor\x20Rules\x20文件已存在,跳过','parse','stringify','error','生成配置命令','创建\x20agents.md\x20文件',',\x20env=','AppCode:\x20','mcp.json','\x22LOVRABET_ENV\x22:\x20\x22','2735448qLerbE','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20\x20\x20\x20\x20\x20\x20\x20','info','message'];a60_0x8168=function(){return _0x3c0122;};return a60_0x8168();}export function buildClaudeMcpCommand(_0x33b515,_0x5a9035){const _0x470952=a60_0x49bf17,_0x44102f=_0x470952(0x160)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x470952(0x162)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x33b515,_0x1022d8=_0x5a9035!==_0x470952(0x16a)?_0x470952(0x159)+_0x5a9035:'';return''+_0x44102f+_0x1022d8;}export async function copyCursorRules(_0x1f1fc4){const _0x30b62c=a60_0x49bf17,_0x595d5f=join(_0x1f1fc4,_0x30b62c(0x134)),_0x4a163c=join(_0x595d5f,'rules'),_0x582886=join(_0x4a163c,_0x30b62c(0x156));if(existsSync(_0x582886))return logger[_0x30b62c(0x14b)](_0x30b62c(0x138),_0x30b62c(0x13e),{'path':_0x582886}),![];try{ensureDir(_0x4a163c);const _0x598639=await getRulesContent();return writeFileSync(_0x582886,_0x598639,'utf-8'),logger['info'](_0x30b62c(0x138),_0x30b62c(0x158),{'to':_0x582886}),!![];}catch(_0x52d4c7){return logger['error']('mcp-install','复制\x20Cursor\x20Rules\x20文件失败',{'error':_0x52d4c7 instanceof Error?_0x52d4c7['message']:String(_0x52d4c7)}),![];}}export async function copyAgentsMd(_0x39ab72){const _0x4a0afe=a60_0x49bf17,_0x4ff53f=join(_0x39ab72,_0x4a0afe(0x151));if(existsSync(_0x4ff53f))return logger[_0x4a0afe(0x14b)](_0x4a0afe(0x138),_0x4a0afe(0x161),{'path':_0x4ff53f}),![];try{const _0x3bd206=await getRulesContent();return writeFileSync(_0x4ff53f,_0x3bd206,_0x4a0afe(0x13c)),logger[_0x4a0afe(0x14b)](_0x4a0afe(0x138),_0x4a0afe(0x143),{'to':_0x4ff53f}),!![];}catch(_0x97e495){return logger['error'](_0x4a0afe(0x138),_0x4a0afe(0x15e),{'error':_0x97e495 instanceof Error?_0x97e495[_0x4a0afe(0x14c)]:String(_0x97e495)}),![];}}export async function configureCursorMcp(_0x188571){const _0x656063=a60_0x49bf17;try{const {appcode:_0xd22945,env:_0x3aab97}=getAppConfig(),_0x5d2421=join(_0x188571,'.cursor'),_0x3dd901=join(_0x5d2421,_0x656063(0x146));ensureDir(_0x5d2421);const _0x52978c=buildMcpServerConfig(_0xd22945,_0x3aab97);let _0x114969;if(existsSync(_0x3dd901)){const _0x2296dd=readFileSync(_0x3dd901,_0x656063(0x15c));_0x114969=JSON[_0x656063(0x13f)](_0x2296dd),!_0x114969[_0x656063(0x167)]&&(_0x114969[_0x656063(0x167)]={}),logger[_0x656063(0x14b)](_0x656063(0x15a),'更新现有\x20mcp.json\x20配置',{'path':_0x3dd901,'appcode':_0xd22945,'env':_0x3aab97});}else _0x114969={'mcpServers':{}},logger[_0x656063(0x14b)]('mcp-cursor',_0x656063(0x14d),{'path':_0x3dd901,'appcode':_0xd22945,'env':_0x3aab97});_0x114969['mcpServers'][MCP_SERVER_NAME]=_0x52978c,writeFileSync(_0x3dd901,JSON[_0x656063(0x140)](_0x114969,null,0x2),{'encoding':'utf8'});const _0x4edf27=await copyCursorRules(_0x188571),_0x565b5c=[_0x656063(0x168),_0x656063(0x145)+_0xd22945];return _0x3aab97!==_0x656063(0x16a)&&_0x565b5c[_0x656063(0x153)](_0x656063(0x136)+_0x3aab97),_0x565b5c[_0x656063(0x153)]('重启\x20Cursor\x20后生效'),_0x4edf27&&_0x565b5c['push']('已创建\x20Cursor\x20Rules\x20文件'),logger['info'](_0x656063(0x15a),_0x656063(0x165),{'appcode':_0xd22945,'env':_0x3aab97,'configPath':_0x3dd901}),{'success':!![],'message':_0x565b5c['join'](_0x656063(0x170))};}catch(_0x3e0eab){return logger[_0x656063(0x141)](_0x656063(0x15a),_0x656063(0x13d),{'error':_0x3e0eab instanceof Error?_0x3e0eab['message']:String(_0x3e0eab)}),{'success':![],'message':_0x3e0eab instanceof Error?_0x3e0eab[_0x656063(0x14c)]:String(_0x3e0eab)};}}export function configureClaudeMcp(_0x22732a){const _0x7da9c6=a60_0x49bf17;try{const {appcode:_0x28521d,env:_0x129e20}=getAppConfig();copyAgentsMd(_0x22732a);const _0x16f3f9=buildClaudeMcpCommand(_0x28521d,_0x129e20),_0x5344ac=['请执行以下命令配置\x20Claude\x20Code\x20MCP:',''+_0x16f3f9,_0x7da9c6(0x14f),'AppCode:\x20'+_0x28521d];return _0x129e20!==_0x7da9c6(0x16a)&&_0x5344ac['push'](_0x7da9c6(0x136)+_0x129e20),_0x5344ac[_0x7da9c6(0x153)](_0x7da9c6(0x16f)),logger[_0x7da9c6(0x14b)]('mcp-claude',_0x7da9c6(0x142),{'appcode':_0x28521d,'env':_0x129e20,'command':_0x16f3f9}),{'success':!![],'message':_0x5344ac[_0x7da9c6(0x162)](_0x7da9c6(0x170)),'needsManualAction':!![]};}catch(_0x5b7749){return logger['error'](_0x7da9c6(0x155),_0x7da9c6(0x16b),{'error':_0x5b7749 instanceof Error?_0x5b7749[_0x7da9c6(0x14c)]:String(_0x5b7749)}),{'success':![],'message':_0x5b7749 instanceof Error?_0x5b7749['message']:String(_0x5b7749)};}}function a60_0x5cf0(_0x19fc76,_0x257c22){_0x19fc76=_0x19fc76-0x130;const _0x81685c=a60_0x8168();let _0x5cf067=_0x81685c[_0x19fc76];return _0x5cf067;}export function showOtherMcpGuide(_0x200aec){const _0x4e4910=a60_0x49bf17;try{const {appcode:_0x4b56ea,env:_0x98ce0c}=getAppConfig(),_0x5d774a=buildMcpServerConfig(_0x4b56ea,_0x98ce0c),_0x37e09c=[_0x4e4910(0x164)+_0x4b56ea+'\x22'];_0x98ce0c!==_0x4e4910(0x16a)&&_0x37e09c[_0x4e4910(0x153)](_0x4e4910(0x147)+_0x98ce0c+'\x22');const _0x4f8a7a=['配置信息:\x20appcode='+_0x4b56ea+_0x4e4910(0x144)+_0x98ce0c,'{',_0x4e4910(0x16e),_0x4e4910(0x150),_0x4e4910(0x13b),_0x4e4910(0x139),_0x4e4910(0x149),..._0x37e09c[_0x4e4910(0x130)](_0x40def7=>_0x4e4910(0x14a)+_0x40def7+','),_0x4e4910(0x166),_0x4e4910(0x133),_0x4e4910(0x13a),'}',_0x4e4910(0x163)];return logger[_0x4e4910(0x14b)]('mcp-install','其他\x20IDE\x20配置指引已显示',{'appcode':_0x4b56ea,'env':_0x98ce0c}),{'success':!![],'message':_0x4f8a7a[_0x4e4910(0x162)]('\x0a'),'needsManualAction':!![]};}catch(_0x199faf){return{'success':![],'message':_0x199faf instanceof Error?_0x199faf[_0x4e4910(0x14c)]:String(_0x199faf)};}}function ensureDir(_0x544def){!existsSync(_0x544def)&&mkdirSync(_0x544def,{'recursive':!![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x227554=a61_0x3f8a;(function(_0x2fc48e,_0xd3a0c7){const _0x615f3b=a61_0x3f8a,_0x4070b0=_0x2fc48e();while(!![]){try{const _0x4ff987=-parseInt(_0x615f3b(0x14d))/0x1*(-parseInt(_0x615f3b(0x172))/0x2)+-parseInt(_0x615f3b(0x171))/0x3*(parseInt(_0x615f3b(0x165))/0x4)+parseInt(_0x615f3b(0x14b))/0x5+-parseInt(_0x615f3b(0x177))/0x6*(parseInt(_0x615f3b(0x16e))/0x7)+-parseInt(_0x615f3b(0x16c))/0x8*(-parseInt(_0x615f3b(0x15c))/0x9)+parseInt(_0x615f3b(0x16b))/0xa+-parseInt(_0x615f3b(0x150))/0xb;if(_0x4ff987===_0xd3a0c7)break;else _0x4070b0['push'](_0x4070b0['shift']());}catch(_0x366598){_0x4070b0['push'](_0x4070b0['shift']());}}}(a61_0x19c4,0x50a4d));function a61_0x19c4(){const _0x53c387=['warn','setErrorMsg','column','utf-8','info','1458370gpnaUV','8048npeopr','\x20\x20✗\x20安装\x20','14623vjrNeg','../../cdn-source/skills','.lovrabet/skill-manifest.json','32187TaQJtY','134YqgDyV','cwd','.lovrabet','cyan','...','66cazIRv','\x20失败:\x20','\x20个目录','length','stringify','message','2827220lDjQGA','green','5447BhCEXm','keys','selecting','6842297tqMQqq','guides','2.0.0','done','map','按任意键退出...','name','size','description','log','(含扩展)','gray','729UcuKcu','return','✓\x20拉取\x20','安装成功','selectedIndexes','handleKeyDown','value','installing','toISOString','68usBVpw'];a61_0x19c4=function(){return _0x53c387;};return a61_0x19c4();}import{jsx as a61_0x56413c,jsxs as a61_0x344450,Fragment as a61_0x145fb8}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';function a61_0x3f8a(_0x1baeab,_0x2b5e3f){_0x1baeab=_0x1baeab-0x148;const _0x19c47f=a61_0x19c4();let _0x3f8a1a=_0x19c47f[_0x1baeab];return _0x3f8a1a;}import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,IDE_LIST}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';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_0x227554(0x154)](_0x870a82=>({'key':_0x870a82,'name':IDE_CONFIGS[_0x870a82][a61_0x227554(0x156)],'description':IDE_CONFIGS[_0x870a82][a61_0x227554(0x158)]}));export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[],providedFlags:_0x552f52}){const _0x2fa42e=a61_0x227554,{exit:_0x4ffb7e}=useApp(),[_0x2bfd06,_0x3ef163]=useState(_0x2fa42e(0x14f)),[_0x44d6b6,_0xbbecd]=useState([]),[_0x409d11,_0x3638aa]=useState([]),[_0x552863,_0x5bc6fa]=useState(0x0),_0x648a80=useIDESelection({'ideList':UI_IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x28243b=_0x2fa42e;preselectedIDEs[_0x28243b(0x148)]>0x0&&_0x648a80[_0x28243b(0x160)][_0x28243b(0x157)]>0x0&&_0x33587d();},[]),useInput((_0x339e47,_0x1aa020)=>{const _0x46eb86=_0x2fa42e;if(_0x2bfd06===_0x46eb86(0x14f)){if(_0x339e47==='q'||_0x339e47==='Q'){_0x4ffb7e();return;}if(_0x1aa020[_0x46eb86(0x15d)]){if(_0x648a80[_0x46eb86(0x160)]['size']===0x0){_0x648a80[_0x46eb86(0x167)]('请至少选择一个\x20IDE');return;}_0x33587d();return;}_0x648a80[_0x46eb86(0x161)](_0x339e47,_0x1aa020);}_0x2bfd06===_0x46eb86(0x153)&&_0x4ffb7e();});async function _0x33587d(){const _0x948b54=_0x2fa42e,_0x4c0e95=_0x648a80['getSelectedIDEs']();_0x3638aa(_0x4c0e95),_0xbbecd([{'label':'已选择\x20IDE','value':_0x648a80[_0x948b54(0x160)]['size']+'\x20个'}]),_0x3ef163(_0x948b54(0x163)),await _0x25d209(_0x4c0e95);}async function _0x25d209(_0x345406){const _0x54ce38=_0x2fa42e,_0x2b8fa5=process[_0x54ce38(0x173)](),_0xce3a9c=resolve(__dirname,_0x54ce38(0x16f));logger['setLogPath'](_0x2b8fa5);const _0x1e9e73=_0x552f52&&_0x552f52['length']>0x0;console[_0x54ce38(0x159)]('正在从\x20CDN\x20拉取开发者指南'+(_0x1e9e73?_0x54ce38(0x15a):'')+_0x54ce38(0x176));let _0x340c31;try{_0x340c31=await fetchGuidesFromCDN(_0x1e9e73),console[_0x54ce38(0x159)](_0x54ce38(0x15e)+Object[_0x54ce38(0x14e)](_0x340c31[_0x54ce38(0x151)])[_0x54ce38(0x148)]+'\x20个开发者指南');}catch(_0x18bce0){console[_0x54ce38(0x166)]('\x20\x20!\x20CDN\x20拉取失败,跳过指南安装:\x20'+(_0x18bce0 instanceof Error?_0x18bce0[_0x54ce38(0x14a)]:String(_0x18bce0)));}let _0x5f2eb9=0x0;for(const _0x5aa8f2 of _0x345406){try{const _0x59244f=IDE_CONFIGS[_0x5aa8f2],_0x35eec7=await installSingleIDE(_0x5aa8f2,_0x59244f,_0x2b8fa5,_0xce3a9c,_0x340c31,_0x552f52);_0x5f2eb9+=_0x35eec7,_0x5bc6fa(_0x5f2eb9);}catch(_0x5ef879){console['error'](_0x54ce38(0x16d)+_0x5aa8f2+_0x54ce38(0x178)+(_0x5ef879 instanceof Error?_0x5ef879['message']:String(_0x5ef879)));}}_0x340c31&&writeGuidesToProject(_0x340c31,_0x2b8fa5,'.lovrabet/skill/.shared/guides',_0x552f52);const _0x488085={'version':_0x54ce38(0x152),'installedAt':new Date()[_0x54ce38(0x164)](),'platforms':_0x345406},_0x680f53=join(_0x2b8fa5,_0x54ce38(0x170)),_0x435232=join(_0x2b8fa5,_0x54ce38(0x174));await copyDir(_0x435232,_0x435232),writeFileSync(_0x680f53,JSON[_0x54ce38(0x149)](_0x488085,null,0x2),_0x54ce38(0x169)),logger[_0x54ce38(0x16a)]('skill-install',_0x54ce38(0x15f),{'projectRoot':_0x2b8fa5,'ides':_0x345406,'foldersCount':_0x5f2eb9}),_0x3ef163('done'),setTimeout(()=>{_0x4ffb7e();},0x3e8);}return a61_0x344450(Box,{'flexDirection':_0x2fa42e(0x168),'marginTop':0x1,'children':[_0x2bfd06===_0x2fa42e(0x14f)&&a61_0x56413c(IDESelector,{'ideList':UI_IDE_LIST,'title':'安装\x20Lovrabet\x20技能包\x20-\x20选择\x20IDE','selection':_0x648a80}),_0x2bfd06==='installing'&&a61_0x56413c(InstallingStep,{'completedSteps':_0x44d6b6,'installingIDEs':_0x409d11,'installedCount':_0x552863}),_0x2bfd06==='done'&&a61_0x56413c(DoneStep,{'installedCount':_0x552863})]});}function InstallingStep({completedSteps:_0x1c0087,installingIDEs:_0x518708,installedCount:_0x4f1300}){const _0x301290=a61_0x227554;return a61_0x344450(a61_0x145fb8,{'children':[_0x1c0087['map']((_0x22f7d5,_0x4963f4)=>a61_0x344450(Box,{'children':[a61_0x344450(Text,{'color':_0x301290(0x14c),'children':['√\x20',_0x22f7d5['label'],':\x20']}),a61_0x56413c(Text,{'color':_0x301290(0x175),'children':_0x22f7d5[_0x301290(0x162)]})]},_0x4963f4)),a61_0x56413c(Box,{'marginTop':0x1,'children':a61_0x56413c(Text,{'children':'正在安装技能包...'})}),_0x518708['map'](_0xceff9c=>a61_0x344450(Box,{'children':[a61_0x56413c(Text,{'color':'green','children':'\x20\x20✓\x20'}),a61_0x56413c(Text,{'children':IDE_CONFIGS[_0xceff9c]?.[_0x301290(0x156)]||_0xceff9c})]},_0xceff9c)),a61_0x56413c(Box,{'marginTop':0x1,'children':a61_0x344450(Text,{'color':_0x301290(0x15b),'children':['已安装\x20',_0x4f1300,_0x301290(0x179)]})})]});}function DoneStep({installedCount:_0x1c2684}){const _0x240a56=a61_0x227554;return a61_0x344450(a61_0x145fb8,{'children':[a61_0x56413c(Box,{'children':a61_0x344450(Text,{'color':_0x240a56(0x14c),'children':['✓\x20技能包安装成功!共安装\x20',_0x1c2684,_0x240a56(0x179)]})}),a61_0x56413c(Box,{'marginTop':0x1,'children':a61_0x56413c(Text,{'color':_0x240a56(0x15b),'children':'开发者指南位置:\x20.lovrabet/skill/.shared/guides/'})}),a61_0x56413c(Box,{'marginTop':0x1,'children':a61_0x56413c(Text,{'color':_0x240a56(0x15b),'children':_0x240a56(0x155)})})]});}async function copyDirIfNeeded(_0x25e095,_0x5b2f3b){try{return await copyDir(_0x25e095,_0x5b2f3b),!![];}catch{return![];}}
|