@lovrabet/cli 1.3.2-beta.0 → 1.3.2
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 -1
- 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
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5c1f6f,_0x40cb47){const _0xfd5c42=a44_0x4577,_0x113bed=_0x5c1f6f();while(!![]){try{const _0x31657b=parseInt(_0xfd5c42(0x86))/0x1*(-parseInt(_0xfd5c42(0x7d))/0x2)+-parseInt(_0xfd5c42(0x81))/0x3+-parseInt(_0xfd5c42(0x95))/0x4+-parseInt(_0xfd5c42(0xa0))/0x5*(parseInt(_0xfd5c42(0x8a))/0x6)+-parseInt(_0xfd5c42(0xc9))/0x7+-parseInt(_0xfd5c42(0x90))/0x8+parseInt(_0xfd5c42(0x8f))/0x9*(parseInt(_0xfd5c42(0x6e))/0xa);if(_0x31657b===_0x40cb47)break;else _0x113bed['push'](_0x113bed['shift']());}catch(_0x551fa8){_0x113bed['push'](_0x113bed['shift']());}}}(a44_0x5d60,0x2e3ed));import{jsx as a44_0x38635c,Fragment as a44_0x430e68,jsxs as a44_0x41552b}from'react/jsx-runtime';function a44_0x5d60(){const _0xce88d9=['message','170MFEqJk','doTask','green','log','red','×\x20无法在当前目录创建项目,请检查目录权限','\x20&&\x20lovrabet\x20start','currentVersion','3.\x20','env','*\x20正在拉取\x20API\x20配置...','length','version','配置应用AppCode:\x20','repeat','119542LeBytA','cyan','stableVersion','description','437793NNaIBz','resolve','filter','mcp','cwd','1yRKefv','cursor','readFileSync','info','5844ACkdGB','skill','\x20MCP\x20','success','*\x20清理失败的项目目录:\x20','525816dPpwpb','1116288xUEwrh','W_OK','existsSync','×\x20项目目录\x20','error','1095448FljKYq','projectName','toLocaleString','../..','create','name','\x20已存在,请使用其他项目名','yellow','white','API\x20配置拉取异常','1.\x20','590haKJLf','Claude\x20Code','配置AppCode:\x20','gray','✓\x20Skill\x20安装完成:','×\x20项目名不能为空','rmSync','mcp-','.lovrabetrc','更新\x20package.json\x20失败','*\x20正在配置\x20Lovrabet\x20MCP\x20和\x20Skill...','pullApi','2.\x20','warn','stringify','启动项目:\x20','parse','dirname','√\x20package.json\x20已更新:\x20name=','trim','*\x20正在为项目\x20','API\x20配置拉取失败:\x20','utf8','test','online','\x20\x20•\x20Skill:\x20','×\x20项目名过长,最多支持\x20100\x20个字符','更新\x20package.json\x20name','needsUpgrade','map','1.0.0','selectedIDEs','column','√\x20配置文件已创建,应用AppCode:\x20','skill-','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','项目名称:\x20','\x20Generated\x20by\x20lovrabet\x20cli\x20','string','\x20\x20•\x20MCP\x20服务器:\x20','appCode','488285GvCMrX','清理项目目录失败:\x20','✓\x20MCP\x20服务器配置完成:','Cursor','cd\x20','\x20Skill\x20','🚀\x20接下来:','status','项目创建失败:\x20','writeFileSync','manual','拉取API配置:\x20','lovrabet\x20config\x20set\x20appcode\x20[app-code]','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','package.json','\x20创建配置文件','push','projectCode','ide','\x20√\x20','\x20\x20✗\x20MCP\x20','join','√\x20Lovrabet\x20MCP\x20和\x20Skill\x20配置完成','×\x20项目创建失败:\x20','\x20|\x20应用AppCode:\x20','lovrabet\x20api\x20pull'];a44_0x5d60=function(){return _0xce88d9;};return a44_0x5d60();}import a44_0x114825 from'path';import a44_0x5379d5 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{configureMcp,copySharedSkills,installSkill,createSkillManifest}from'../ai-setup/config.js';function a44_0x4577(_0xda5274,_0x1ba0f9){_0xda5274=_0xda5274-0x67;const _0x5d606c=a44_0x5d60();let _0x4577d8=_0x5d606c[_0xda5274];return _0x4577d8;}import{MCP_IDES}from'../utils/ai_config.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export function CreateApp(_0x2a9a6f){const _0x906934=a44_0x4577,[_0x146472,_0x5db085]=useState(![]),[_0xe36d94,_0x35d6cd]=useState(![]),[_0x28737a,_0x21d0d6]=useState(null),[_0xfe05d7,_0x14b7ea]=useState(null),_0x2d7dea=useCopyProjectTemplate(),_0x205ff7=useInstallDependencies(),_0x1704fe=useFormatCode();useEffect(()=>{checkCliVersion()['then'](_0x10bb6a=>{const _0x5bf35e=a44_0x4577;_0x10bb6a[_0x5bf35e(0xbc)]&&(printCliUpgradeWarning(_0x10bb6a),logger[_0x5bf35e(0x89)](_0x5bf35e(0x99),'CLI\x20版本检查',{'currentVersion':_0x10bb6a[_0x5bf35e(0x75)],'stableVersion':_0x10bb6a[_0x5bf35e(0x7f)],'needsUpgrade':_0x10bb6a[_0x5bf35e(0xbc)]}));});},[]);const _0x463cb5=async _0x51e0c1=>{const _0x33053d=a44_0x4577;if(!_0x51e0c1[_0x33053d(0x96)]||_0x51e0c1[_0x33053d(0x96)][_0x33053d(0xb3)]()===''){console[_0x33053d(0x94)](_0x33053d(0xa5));return;}const _0xe0c01a=/[<>:"|?*\x00-\x1f\x7f]/;if(_0xe0c01a[_0x33053d(0xb7)](_0x51e0c1[_0x33053d(0x96)])){console[_0x33053d(0x94)](_0x33053d(0xc3));return;}if(_0x51e0c1['projectName'][_0x33053d(0x79)]>0x64){console['error'](_0x33053d(0xba));return;}const _0x531352=a44_0x114825['resolve'](process[_0x33053d(0x85)](),_0x51e0c1['projectName']);if(a44_0x5379d5['existsSync'](_0x531352)){console[_0x33053d(0x94)](_0x33053d(0x93)+_0x51e0c1[_0x33053d(0x96)]+_0x33053d(0x9b));return;}try{const _0x2932f7=a44_0x114825[_0x33053d(0xb1)](_0x531352);a44_0x5379d5['accessSync'](_0x2932f7,a44_0x5379d5['constants'][_0x33053d(0x91)]);}catch(_0x121149){console[_0x33053d(0x94)](_0x33053d(0x73));return;}_0x21d0d6(_0x51e0c1),_0x5db085(!![]),logger['setLogPath'](_0x531352),logger['info'](_0x33053d(0x99),'开始创建项目:\x20'+_0x51e0c1[_0x33053d(0x96)],{'projectDir':_0x531352,'appCode':_0x51e0c1[_0x33053d(0xc8)]});try{await _0x2d7dea[_0x33053d(0x6f)](_0x51e0c1[_0x33053d(0x96)]),await _0x278af5(_0x51e0c1[_0x33053d(0x96)]),await _0x205ff7['doTask'](_0x51e0c1[_0x33053d(0x96)]),await _0x1704fe[_0x33053d(0x6f)](_0x51e0c1[_0x33053d(0x96)]),await _0x5bc9b5(_0x51e0c1[_0x33053d(0x96)],_0x51e0c1[_0x33053d(0xc8)]||'',_0x51e0c1[_0x33053d(0x77)]);if(_0x51e0c1[_0x33053d(0xab)]&&_0x51e0c1[_0x33053d(0xc8)]){console[_0x33053d(0x71)](_0x33053d(0x78));try{const _0x3c6d7e=await pullApiSilent(_0x51e0c1[_0x33053d(0xc8)],undefined,_0x531352,_0x51e0c1[_0x33053d(0x77)]);_0x3c6d7e?(console[_0x33053d(0x71)]('√\x20API\x20配置拉取完成'),logger[_0x33053d(0x89)](_0x33053d(0x99),'API\x20配置拉取成功:\x20'+_0x51e0c1[_0x33053d(0xc8)])):(console[_0x33053d(0x71)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x33053d(0xad)]('create',_0x33053d(0xb5)+_0x51e0c1[_0x33053d(0xc8)]));}catch(_0x3b21a6){console[_0x33053d(0x71)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x33053d(0xad)](_0x33053d(0x99),_0x33053d(0x9e),{'error':_0x3b21a6 instanceof Error?_0x3b21a6[_0x33053d(0x6d)]:String(_0x3b21a6)});}}if(_0x51e0c1['aiSetup']&&_0x51e0c1['selectedIDEs']&&_0x51e0c1[_0x33053d(0xbf)][_0x33053d(0x79)]>0x0&&_0x51e0c1[_0x33053d(0xc8)]){console[_0x33053d(0x71)](_0x33053d(0xaa));const _0x2b3a9a=[],_0x3107b2=[],_0x3fae47=_0x51e0c1[_0x33053d(0xbf)][_0x33053d(0x83)](_0x506e5d=>MCP_IDES['has'](_0x506e5d)),_0x1bda31=_0x51e0c1[_0x33053d(0xbf)];for(const _0x194afc of _0x3fae47){try{const _0x4501c6=await configureMcp(_0x194afc,_0x531352);_0x2b3a9a['push']({'ide':_0x194afc===_0x33053d(0x87)?_0x33053d(0xcc):_0x33053d(0xa1),'status':_0x4501c6['status'],'message':_0x4501c6[_0x33053d(0x6d)]}),console[_0x33053d(0x71)]('\x20\x20'+(_0x4501c6[_0x33053d(0xd0)]===_0x33053d(0x8d)?'✓':_0x4501c6[_0x33053d(0xd0)]===_0x33053d(0xd3)?'⚠️':'✗')+_0x33053d(0x8c)+_0x194afc+':\x20'+_0x4501c6[_0x33053d(0x6d)]);}catch(_0x5309d9){_0x2b3a9a[_0x33053d(0xd9)]({'ide':_0x194afc===_0x33053d(0x87)?_0x33053d(0xcc):_0x33053d(0xa1),'status':_0x33053d(0x94),'message':_0x5309d9 instanceof Error?_0x5309d9['message']:String(_0x5309d9)}),console[_0x33053d(0x71)](_0x33053d(0x67)+_0x194afc+':\x20'+(_0x5309d9 instanceof Error?_0x5309d9['message']:String(_0x5309d9)));}}await copySharedSkills(_0x531352);for(const _0x55f40f of _0x1bda31){try{const _0x5236d5=await installSkill(_0x55f40f,_0x531352);_0x3107b2[_0x33053d(0xd9)]({'ide':_0x5236d5[_0x33053d(0xdb)],'status':_0x5236d5[_0x33053d(0xd0)],'message':_0x5236d5[_0x33053d(0x6d)]}),console[_0x33053d(0x71)]('\x20\x20'+(_0x5236d5[_0x33053d(0xd0)]===_0x33053d(0x8d)?'✓':'✗')+_0x33053d(0xce)+_0x5236d5[_0x33053d(0xdb)]+':\x20'+_0x5236d5[_0x33053d(0x6d)]);}catch(_0x4cb4d5){_0x3107b2[_0x33053d(0xd9)]({'ide':_0x55f40f,'status':'error','message':_0x4cb4d5 instanceof Error?_0x4cb4d5['message']:String(_0x4cb4d5)}),console['log']('\x20\x20✗\x20Skill\x20'+_0x55f40f+':\x20'+(_0x4cb4d5 instanceof Error?_0x4cb4d5[_0x33053d(0x6d)]:String(_0x4cb4d5)));}}if(_0x3107b2[_0x33053d(0x79)]>0x0){const _0xb2972f=_0x3107b2[_0x33053d(0x83)](_0x852bf3=>_0x852bf3[_0x33053d(0xd0)]==='success')['map'](_0x323a9d=>_0x323a9d[_0x33053d(0xdb)]);_0xb2972f[_0x33053d(0x79)]>0x0&&createSkillManifest(_0x531352,_0xb2972f);}_0x14b7ea({'mcp':_0x2b3a9a,'skill':_0x3107b2}),console[_0x33053d(0x71)](_0x33053d(0x69));}logger[_0x33053d(0x8d)]('create','项目创建完成:\x20'+_0x51e0c1['projectName']),_0x35d6cd(!![]),_0x5db085(![]);}catch(_0x4ac13a){logger['error']('create',_0x33053d(0xd1)+_0x51e0c1[_0x33053d(0x96)],{'error':_0x4ac13a instanceof Error?_0x4ac13a[_0x33053d(0x6d)]:String(_0x4ac13a)});try{a44_0x5379d5[_0x33053d(0x92)](_0x531352)&&(console[_0x33053d(0x71)](_0x33053d(0x8e)+_0x531352),a44_0x5379d5[_0x33053d(0xa6)](_0x531352,{'recursive':!![],'force':!![]}));}catch(_0x31abe2){logger[_0x33053d(0xad)](_0x33053d(0x99),_0x33053d(0xca)+_0x531352);}_0x5db085(![]),console[_0x33053d(0x94)](_0x33053d(0x6a)+(_0x4ac13a instanceof Error?_0x4ac13a[_0x33053d(0x6d)]:String(_0x4ac13a)));}},_0x42d63a=async _0x3c5007=>{const _0x35a598=a44_0x4577;await _0x463cb5({'projectName':_0x3c5007,'env':_0x2a9a6f[_0x35a598(0x77)]});},_0x278af5=async _0x57a51b=>{const _0x4f537f=a44_0x4577,_0x48c944=a44_0x114825[_0x4f537f(0x82)](process['cwd'](),_0x57a51b),_0xcfa1dc=a44_0x114825[_0x4f537f(0x68)](_0x48c944,'package.json');try{console[_0x4f537f(0x71)]('*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段');const _0xde3e37=fileURLToPath(import.meta.url),_0x1fed6d=a44_0x114825['resolve'](a44_0x114825['dirname'](_0xde3e37),_0x4f537f(0x98)),_0x47ad69=a44_0x114825[_0x4f537f(0x68)](_0x1fed6d,_0x4f537f(0xd7));let _0x522f13=_0x4f537f(0xbe);try{const _0x39be66=JSON[_0x4f537f(0xb0)](a44_0x5379d5[_0x4f537f(0x88)](_0x47ad69,'utf8'));_0x522f13=_0x39be66[_0x4f537f(0x7a)]||_0x4f537f(0xbe);}catch(_0x14021f){}const _0x2eee47=a44_0x5379d5[_0x4f537f(0x88)](_0xcfa1dc,_0x4f537f(0xb6)),_0x29b161=JSON['parse'](_0x2eee47);_0x29b161[_0x4f537f(0x9a)]=_0x57a51b,_0x29b161[_0x4f537f(0x80)]=_0x57a51b+_0x4f537f(0xc5)+_0x522f13,a44_0x5379d5[_0x4f537f(0xd2)](_0xcfa1dc,JSON[_0x4f537f(0xae)](_0x29b161,null,0x2)+'\x0a','utf8'),console[_0x4f537f(0x71)](_0x4f537f(0xb2)+_0x57a51b),logger[_0x4f537f(0x89)](_0x4f537f(0x99),_0x4f537f(0xbb));}catch(_0x1360a3){logger[_0x4f537f(0x94)](_0x4f537f(0x99),_0x4f537f(0xa9));throw _0x1360a3;}},_0x5bc9b5=async(_0x43f591,_0x6712d8,_0x15abbe)=>{const _0x10af85=a44_0x4577,_0x5db5c1=a44_0x114825[_0x10af85(0x82)](process[_0x10af85(0x85)](),_0x43f591),_0x13170b=a44_0x114825[_0x10af85(0x68)](_0x5db5c1,_0x10af85(0xa8));try{_0x6712d8?console[_0x10af85(0x71)](_0x10af85(0xb4)+_0x43f591+'\x20配置应用AppCode:\x20'+_0x6712d8):console[_0x10af85(0x71)]('*\x20正在为项目\x20'+_0x43f591+_0x10af85(0xd8));const _0x535944=fileURLToPath(import.meta.url),_0x285957=a44_0x114825['resolve'](a44_0x114825[_0x10af85(0xb1)](_0x535944),_0x10af85(0x98)),_0x18c3ed=a44_0x114825[_0x10af85(0x68)](_0x285957,_0x10af85(0xd7));let _0x1dbcaa='1.0.0';try{const _0x1f0727=JSON['parse'](a44_0x5379d5[_0x10af85(0x88)](_0x18c3ed,'utf8'));_0x1dbcaa=_0x1f0727[_0x10af85(0x7a)]||_0x10af85(0xbe);}catch(_0x177117){}const _0x19f91c=readConfig(),_0x33eb10=typeof _0x19f91c[_0x10af85(0x77)]===_0x10af85(0xc6)?_0x19f91c[_0x10af85(0x77)]:undefined,{app:_0x570791,appcode:_0x58af66,..._0x56c5e5}=_0x19f91c,_0x35b028={..._0x56c5e5,'appcode':_0x6712d8||'','env':_0x15abbe||_0x33eb10||_0x10af85(0xb8),'createdAt':new Date()[_0x10af85(0x97)](),'version':_0x1dbcaa};a44_0x5379d5[_0x10af85(0xd2)](_0x13170b,JSON['stringify'](_0x35b028,null,0x2),_0x10af85(0xb6)),_0x6712d8?console[_0x10af85(0x71)](_0x10af85(0xc1)+_0x6712d8):console[_0x10af85(0x71)](_0x10af85(0xd6)),logger[_0x10af85(0x89)](_0x10af85(0x99),_0x10af85(0x7b)+_0x6712d8);}catch(_0x647b2d){logger[_0x10af85(0x94)]('create','配置应用AppCode失败');}};useEffect(()=>{const _0x532db4=a44_0x4577;_0x2a9a6f[_0x532db4(0xda)]&&_0x42d63a(_0x2a9a6f[_0x532db4(0xda)]);},[_0x2a9a6f[_0x906934(0xda)]]);if(!_0x146472&&!_0xe36d94&&!_0x2a9a6f[_0x906934(0xda)])return a44_0x38635c(EnhancedGuidedCreate,{'onCreate':_0x463cb5,'env':_0x2a9a6f['env']});if(_0x146472)return a44_0x41552b(a44_0x430e68,{'children':[a44_0x41552b(Box,{'marginTop':0x1,'children':[a44_0x38635c(Box,{'width':'1'}),a44_0x38635c(Text,{'color':_0x906934(0x70),'children':'\x20√\x20'}),a44_0x38635c(Text,{'children':_0x906934(0xc4)}),a44_0x38635c(Text,{'color':_0x906934(0x70),'children':_0x28737a?.[_0x906934(0x96)]}),_0x28737a?.[_0x906934(0xc8)]&&a44_0x41552b(a44_0x430e68,{'children':[a44_0x38635c(Text,{'children':_0x906934(0x6b)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'children':_0x28737a[_0x906934(0xc8)]})]})]}),a44_0x38635c(TaskRunning,{..._0x2d7dea}),a44_0x38635c(TaskRunning,{..._0x205ff7}),a44_0x38635c(TaskRunning,{..._0x1704fe})]});if(_0xe36d94){const _0x1e9c88=_0xfe05d7&&(_0xfe05d7[_0x906934(0x84)][_0x906934(0x79)]>0x0||_0xfe05d7[_0x906934(0x8b)][_0x906934(0x79)]>0x0);return a44_0x41552b(a44_0x430e68,{'children':[a44_0x41552b(Box,{'marginTop':0x1,'children':[a44_0x38635c(Box,{'width':'1'}),a44_0x38635c(Text,{'color':_0x906934(0x70),'children':_0x906934(0xdc)}),a44_0x38635c(Text,{'children':_0x906934(0xc4)}),a44_0x38635c(Text,{'color':_0x906934(0x70),'children':_0x28737a?.[_0x906934(0x96)]}),_0x28737a?.[_0x906934(0xc8)]&&a44_0x41552b(a44_0x430e68,{'children':[a44_0x38635c(Text,{'children':_0x906934(0x6b)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'children':_0x28737a[_0x906934(0xc8)]})]})]}),a44_0x38635c(TaskFinished,{..._0x2d7dea}),a44_0x38635c(TaskFinished,{..._0x205ff7}),a44_0x38635c(TaskFinished,{..._0x1704fe}),a44_0x38635c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x38635c(Text,{'color':_0x906934(0x70),'children':'─'['repeat'](0x3c)})}),_0x1e9c88&&a44_0x41552b(a44_0x430e68,{'children':[_0xfe05d7[_0x906934(0x84)][_0x906934(0x79)]>0x0&&a44_0x41552b(a44_0x430e68,{'children':[a44_0x38635c(Box,{'marginTop':0x1,'children':a44_0x38635c(Text,{'color':_0x906934(0x70),'bold':!![],'children':_0x906934(0xcb)})}),_0xfe05d7[_0x906934(0x84)]['map']((_0x930230,_0x13a8c0)=>a44_0x38635c(Box,{'marginLeft':0x2,'children':a44_0x41552b(Text,{'color':_0x930230['status']==='success'?_0x906934(0x9d):_0x930230[_0x906934(0xd0)]==='manual'?_0x906934(0x9c):_0x906934(0x72),'children':[_0x930230['ide'],':\x20',_0x930230[_0x906934(0x6d)]]})},_0x906934(0xa7)+_0x13a8c0))]}),_0xfe05d7[_0x906934(0x8b)][_0x906934(0x79)]>0x0&&a44_0x41552b(a44_0x430e68,{'children':[a44_0x38635c(Box,{'marginTop':_0xfe05d7['mcp'][_0x906934(0x79)]>0x0?0x1:0x0,'children':a44_0x38635c(Text,{'color':_0x906934(0x70),'bold':!![],'children':_0x906934(0xa4)})}),_0xfe05d7[_0x906934(0x8b)][_0x906934(0xbd)]((_0x5c3f2d,_0x3d083a)=>a44_0x38635c(Box,{'marginLeft':0x2,'children':a44_0x41552b(Text,{'color':_0x5c3f2d[_0x906934(0xd0)]===_0x906934(0x8d)?'white':_0x906934(0x72),'children':[_0x5c3f2d[_0x906934(0xdb)],':\x20',_0x5c3f2d[_0x906934(0x6d)]]})},_0x906934(0xc2)+_0x3d083a))]}),a44_0x38635c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x38635c(Text,{'color':_0x906934(0x70),'children':'─'['repeat'](0x3c)})})]}),a44_0x38635c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':_0x906934(0xcf)})}),a44_0x41552b(Box,{'marginLeft':0x2,'flexDirection':_0x906934(0xc0),'children':[_0x1e9c88?a44_0x41552b(a44_0x430e68,{'children':[a44_0x41552b(Box,{'children':[a44_0x38635c(Text,{'color':_0x906934(0x70),'children':_0x906934(0x9f)}),a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':_0x906934(0xaf)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':_0x906934(0xcd)+_0x28737a?.[_0x906934(0x96)]+_0x906934(0x74)})]}),_0x28737a?.[_0x906934(0xc8)]&&!_0x28737a?.[_0x906934(0xab)]&&a44_0x41552b(Box,{'children':[a44_0x38635c(Text,{'color':_0x906934(0x9c),'children':_0x906934(0xac)}),a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':'拉取API配置:\x20'}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':_0x906934(0x6c)})]})]}):a44_0x41552b(a44_0x430e68,{'children':[a44_0x38635c(Box,{'children':a44_0x38635c(Text,{'color':_0x906934(0x9c),'bold':!![],'children':'1.\x20配置\x20Lovrabet\x20MCP\x20和\x20Skill'})}),a44_0x41552b(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':_0x906934(0xb9)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':'lovrabet\x20skill\x20install'})]}),a44_0x41552b(Box,{'marginLeft':0x2,'children':[a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':_0x906934(0xc7)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':'lovrabet\x20mcp\x20install'})]}),a44_0x41552b(Box,{'marginTop':0x1,'children':[a44_0x38635c(Text,{'color':_0x906934(0x70),'children':'2.\x20'}),a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':_0x906934(0xaf)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':_0x906934(0xcd)+_0x28737a?.['projectName']+_0x906934(0x74)})]}),_0x28737a?.[_0x906934(0xc8)]&&!_0x28737a?.[_0x906934(0xab)]&&a44_0x41552b(Box,{'children':[a44_0x38635c(Text,{'color':_0x906934(0x9c),'children':_0x906934(0x76)}),a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':'拉取API配置:\x20'}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':_0x906934(0x6c)})]})]}),!_0x28737a?.[_0x906934(0xc8)]&&a44_0x41552b(a44_0x430e68,{'children':[a44_0x41552b(Box,{'children':[a44_0x38635c(Text,{'color':_0x906934(0xa3),'children':_0x906934(0xac)}),a44_0x38635c(Text,{'color':_0x906934(0x9d),'children':_0x906934(0xa2)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':_0x906934(0xd5)})]}),a44_0x41552b(Box,{'children':[a44_0x38635c(Text,{'color':'gray','children':_0x906934(0x76)}),a44_0x38635c(Text,{'color':'white','children':_0x906934(0xd4)}),a44_0x38635c(Text,{'color':_0x906934(0x7e),'bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a44_0x38635c(Box,{'marginTop':0x1,'children':a44_0x38635c(Text,{'color':'green','children':'─'[_0x906934(0x7c)](0x3c)})})]});}return null;}
|
|
1
|
+
(function(_0x556f76,_0x581e98){const _0x48b0d0=a44_0x3c97,_0x18301e=_0x556f76();while(!![]){try{const _0x1d4303=parseInt(_0x48b0d0(0x132))/0x1+parseInt(_0x48b0d0(0x13e))/0x2+-parseInt(_0x48b0d0(0x143))/0x3+-parseInt(_0x48b0d0(0x151))/0x4+-parseInt(_0x48b0d0(0x13d))/0x5*(parseInt(_0x48b0d0(0x17e))/0x6)+-parseInt(_0x48b0d0(0x170))/0x7*(parseInt(_0x48b0d0(0x172))/0x8)+parseInt(_0x48b0d0(0x12f))/0x9;if(_0x1d4303===_0x581e98)break;else _0x18301e['push'](_0x18301e['shift']());}catch(_0x2616ba){_0x18301e['push'](_0x18301e['shift']());}}}(a44_0x4dee,0xeba14));import{jsx as a44_0x47b470,Fragment as a44_0x5e98d8,jsxs as a44_0x28b5d1}from'react/jsx-runtime';import a44_0x2f616d from'path';import a44_0x18f95e from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a44_0x3c97(_0x67306f,_0x40e2c3){_0x67306f=_0x67306f-0x112;const _0x4dee99=a44_0x4dee();let _0x3c97c7=_0x4dee99[_0x67306f];return _0x3c97c7;}import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';function a44_0x4dee(){const _0x3b1adc=['更新\x20package.json\x20失败','Claude\x20Code','warn','needsUpgrade','map','API\x20配置拉取成功:\x20','../..','push','*\x20清理失败的项目目录:\x20','projectName','配置AppCode:\x20','online','cyan','\x20\x20✗\x20Skill\x20','\x20\x20•\x20Skill:\x20','lovrabet\x20skill\x20install','currentVersion','\x20&&\x20lovrabet\x20start','\x20MCP\x20','√\x20API\x20配置拉取完成','stableVersion','√\x20package.json\x20已更新:\x20name=','description','\x20已存在,请使用其他项目名','21729789eyERoR','yellow','W_OK','1438471qvAIJN','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','cd\x20','CLI\x20版本检查','*\x20正在为项目\x20','name','manual','\x20|\x20应用AppCode:\x20','doTask','gray','create','5777405TEVfhL','3074758YJxbgw','1.\x20配置\x20Lovrabet\x20MCP\x20和\x20Skill','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','\x20Generated\x20by\x20lovrabet\x20cli\x20','toLocaleString','2425569VuJxLu','writeFileSync','cursor','更新\x20package.json\x20name','projectCode','项目创建失败:\x20','trim','开始创建项目:\x20','skill-','utf8','status','log','join','×\x20项目创建失败:\x20','6387236nfIBEH','拉取API配置:\x20','✓\x20MCP\x20服务器配置完成:','API\x20配置拉取失败:\x20','green','×\x20项目名不能为空','启动项目:\x20','version','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','dirname','message','appCode','1.0.0','cwd','selectedIDEs','error','repeat','parse','\x20√\x20','ide','red','mcp','env','2.\x20','√\x20配置文件已创建,应用AppCode:\x20','\x20Skill\x20','skill','white','配置应用AppCode失败','\x20\x20✗\x20MCP\x20','info','42nNxLXE','existsSync','1152424OesSMq','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','lovrabet\x20config\x20set\x20appcode\x20[app-code]','stringify','*\x20正在配置\x20Lovrabet\x20MCP\x20和\x20Skill...','\x20配置应用AppCode:\x20','🚀\x20接下来:','Cursor','then','lovrabet\x20mcp\x20install','length','lovrabet\x20api\x20pull','6YGboiL','resolve','*\x20正在拉取\x20API\x20配置...','×\x20无法在当前目录创建项目,请检查目录权限','readFileSync','package.json','清理项目目录失败:\x20','pullApi','filter','\x20创建配置文件','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','setLogPath','项目名称:\x20','\x20\x20•\x20MCP\x20服务器:\x20','success','3.\x20','×\x20项目名过长,最多支持\x20100\x20个字符','.lovrabetrc'];a44_0x4dee=function(){return _0x3b1adc;};return a44_0x4dee();}import{configureMcp,copySharedSkills,installSkill,createSkillManifest}from'../ai-setup/config.js';import{MCP_IDES}from'../utils/ai_config.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export function CreateApp(_0x2c38c8){const _0x1b4b59=a44_0x3c97,[_0x4079cb,_0x5edd57]=useState(![]),[_0x5bc5df,_0x3f332c]=useState(![]),[_0x44113c,_0x2417c1]=useState(null),[_0x585443,_0x53b016]=useState(null),_0x216194=useCopyProjectTemplate(),_0x273e90=useInstallDependencies(),_0x4a4446=useFormatCode();useEffect(()=>{const _0x4b7b33=a44_0x3c97;checkCliVersion()[_0x4b7b33(0x17a)](_0x57e9c6=>{const _0x11fd71=_0x4b7b33;_0x57e9c6[_0x11fd71(0x11a)]&&(printCliUpgradeWarning(_0x57e9c6),logger[_0x11fd71(0x16f)](_0x11fd71(0x13c),_0x11fd71(0x135),{'currentVersion':_0x57e9c6[_0x11fd71(0x127)],'stableVersion':_0x57e9c6[_0x11fd71(0x12b)],'needsUpgrade':_0x57e9c6[_0x11fd71(0x11a)]}));});},[]);const _0xe31ece=async _0x153e74=>{const _0x3d016f=a44_0x3c97;if(!_0x153e74[_0x3d016f(0x120)]||_0x153e74['projectName'][_0x3d016f(0x149)]()===''){console[_0x3d016f(0x160)](_0x3d016f(0x156));return;}const _0x34f591=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x34f591['test'](_0x153e74['projectName'])){console[_0x3d016f(0x160)](_0x3d016f(0x173));return;}if(_0x153e74[_0x3d016f(0x120)][_0x3d016f(0x17c)]>0x64){console[_0x3d016f(0x160)](_0x3d016f(0x115));return;}const _0x4d45a6=a44_0x2f616d[_0x3d016f(0x17f)](process['cwd'](),_0x153e74[_0x3d016f(0x120)]);if(a44_0x18f95e[_0x3d016f(0x171)](_0x4d45a6)){console[_0x3d016f(0x160)]('×\x20项目目录\x20'+_0x153e74[_0x3d016f(0x120)]+_0x3d016f(0x12e));return;}try{const _0x250248=a44_0x2f616d[_0x3d016f(0x15a)](_0x4d45a6);a44_0x18f95e['accessSync'](_0x250248,a44_0x18f95e['constants'][_0x3d016f(0x131)]);}catch(_0x3cb1ba){console['error'](_0x3d016f(0x181));return;}_0x2417c1(_0x153e74),_0x5edd57(!![]),logger[_0x3d016f(0x18a)](_0x4d45a6),logger['info'](_0x3d016f(0x13c),_0x3d016f(0x14a)+_0x153e74[_0x3d016f(0x120)],{'projectDir':_0x4d45a6,'appCode':_0x153e74[_0x3d016f(0x15c)]});try{await _0x216194['doTask'](_0x153e74[_0x3d016f(0x120)]),await _0x13f58d(_0x153e74[_0x3d016f(0x120)]),await _0x273e90[_0x3d016f(0x13a)](_0x153e74[_0x3d016f(0x120)]),await _0x4a4446[_0x3d016f(0x13a)](_0x153e74['projectName']),await _0x3e9432(_0x153e74['projectName'],_0x153e74[_0x3d016f(0x15c)]||'',_0x153e74[_0x3d016f(0x167)]);if(_0x153e74['pullApi']&&_0x153e74['appCode']){console[_0x3d016f(0x14e)](_0x3d016f(0x180));try{const _0x3d4fd4=await pullApiSilent(_0x153e74[_0x3d016f(0x15c)],undefined,_0x4d45a6,_0x153e74[_0x3d016f(0x167)]);_0x3d4fd4?(console[_0x3d016f(0x14e)](_0x3d016f(0x12a)),logger['info']('create',_0x3d016f(0x11c)+_0x153e74[_0x3d016f(0x15c)])):(console['log'](_0x3d016f(0x159)),logger[_0x3d016f(0x119)](_0x3d016f(0x13c),_0x3d016f(0x154)+_0x153e74[_0x3d016f(0x15c)]));}catch(_0x2e45df){console['log'](_0x3d016f(0x188)),logger[_0x3d016f(0x119)](_0x3d016f(0x13c),'API\x20配置拉取异常',{'error':_0x2e45df instanceof Error?_0x2e45df[_0x3d016f(0x15b)]:String(_0x2e45df)});}}if(_0x153e74['aiSetup']&&_0x153e74[_0x3d016f(0x15f)]&&_0x153e74[_0x3d016f(0x15f)][_0x3d016f(0x17c)]>0x0&&_0x153e74['appCode']){console[_0x3d016f(0x14e)](_0x3d016f(0x176));const _0x31db9e=[],_0x242b9d=[],_0x51311a=_0x153e74[_0x3d016f(0x15f)][_0x3d016f(0x186)](_0x201596=>MCP_IDES['has'](_0x201596)),_0xbf32bd=_0x153e74[_0x3d016f(0x15f)];for(const _0x5789b8 of _0x51311a){try{const _0x5ed53f=await configureMcp(_0x5789b8,_0x4d45a6);_0x31db9e[_0x3d016f(0x11e)]({'ide':_0x5789b8===_0x3d016f(0x145)?_0x3d016f(0x179):'Claude\x20Code','status':_0x5ed53f['status'],'message':_0x5ed53f['message']}),console[_0x3d016f(0x14e)]('\x20\x20'+(_0x5ed53f[_0x3d016f(0x14d)]===_0x3d016f(0x113)?'✓':_0x5ed53f[_0x3d016f(0x14d)]===_0x3d016f(0x138)?'⚠️':'✗')+_0x3d016f(0x129)+_0x5789b8+':\x20'+_0x5ed53f[_0x3d016f(0x15b)]);}catch(_0x298156){_0x31db9e['push']({'ide':_0x5789b8===_0x3d016f(0x145)?'Cursor':_0x3d016f(0x118),'status':_0x3d016f(0x160),'message':_0x298156 instanceof Error?_0x298156[_0x3d016f(0x15b)]:String(_0x298156)}),console[_0x3d016f(0x14e)](_0x3d016f(0x16e)+_0x5789b8+':\x20'+(_0x298156 instanceof Error?_0x298156[_0x3d016f(0x15b)]:String(_0x298156)));}}await copySharedSkills(_0x4d45a6);for(const _0x29b629 of _0xbf32bd){try{const _0x5c10d0=await installSkill(_0x29b629,_0x4d45a6);_0x242b9d['push']({'ide':_0x5c10d0[_0x3d016f(0x164)],'status':_0x5c10d0[_0x3d016f(0x14d)],'message':_0x5c10d0[_0x3d016f(0x15b)]}),console[_0x3d016f(0x14e)]('\x20\x20'+(_0x5c10d0[_0x3d016f(0x14d)]===_0x3d016f(0x113)?'✓':'✗')+_0x3d016f(0x16a)+_0x5c10d0[_0x3d016f(0x164)]+':\x20'+_0x5c10d0[_0x3d016f(0x15b)]);}catch(_0xefabf0){_0x242b9d['push']({'ide':_0x29b629,'status':_0x3d016f(0x160),'message':_0xefabf0 instanceof Error?_0xefabf0['message']:String(_0xefabf0)}),console['log'](_0x3d016f(0x124)+_0x29b629+':\x20'+(_0xefabf0 instanceof Error?_0xefabf0[_0x3d016f(0x15b)]:String(_0xefabf0)));}}if(_0x242b9d[_0x3d016f(0x17c)]>0x0){const _0x3e764d=_0x242b9d[_0x3d016f(0x186)](_0x770db9=>_0x770db9[_0x3d016f(0x14d)]===_0x3d016f(0x113))[_0x3d016f(0x11b)](_0x334f4f=>_0x334f4f[_0x3d016f(0x164)]);_0x3e764d[_0x3d016f(0x17c)]>0x0&&createSkillManifest(_0x4d45a6,_0x3e764d);}_0x53b016({'mcp':_0x31db9e,'skill':_0x242b9d}),console[_0x3d016f(0x14e)]('√\x20Lovrabet\x20MCP\x20和\x20Skill\x20配置完成');}logger['success'](_0x3d016f(0x13c),'项目创建完成:\x20'+_0x153e74[_0x3d016f(0x120)]),_0x3f332c(!![]),_0x5edd57(![]);}catch(_0x1d535b){logger['error'](_0x3d016f(0x13c),_0x3d016f(0x148)+_0x153e74[_0x3d016f(0x120)],{'error':_0x1d535b instanceof Error?_0x1d535b['message']:String(_0x1d535b)});try{a44_0x18f95e[_0x3d016f(0x171)](_0x4d45a6)&&(console[_0x3d016f(0x14e)](_0x3d016f(0x11f)+_0x4d45a6),a44_0x18f95e['rmSync'](_0x4d45a6,{'recursive':!![],'force':!![]}));}catch(_0x577955){logger[_0x3d016f(0x119)](_0x3d016f(0x13c),_0x3d016f(0x184)+_0x4d45a6);}_0x5edd57(![]),console[_0x3d016f(0x160)](_0x3d016f(0x150)+(_0x1d535b instanceof Error?_0x1d535b[_0x3d016f(0x15b)]:String(_0x1d535b)));}},_0x5c241a=async _0xb365e9=>{const _0x1667db=a44_0x3c97;await _0xe31ece({'projectName':_0xb365e9,'env':_0x2c38c8[_0x1667db(0x167)]});},_0x13f58d=async _0x1753f3=>{const _0x3860c=a44_0x3c97,_0x1bfa1b=a44_0x2f616d['resolve'](process[_0x3860c(0x15e)](),_0x1753f3),_0x44309b=a44_0x2f616d[_0x3860c(0x14f)](_0x1bfa1b,_0x3860c(0x183));try{console[_0x3860c(0x14e)](_0x3860c(0x189));const _0x172a4e=fileURLToPath(import.meta.url),_0x25de95=a44_0x2f616d['resolve'](a44_0x2f616d['dirname'](_0x172a4e),_0x3860c(0x11d)),_0x14eac9=a44_0x2f616d['join'](_0x25de95,'package.json');let _0x551cf3='1.0.0';try{const _0x3aaaa8=JSON[_0x3860c(0x162)](a44_0x18f95e[_0x3860c(0x182)](_0x14eac9,'utf8'));_0x551cf3=_0x3aaaa8[_0x3860c(0x158)]||_0x3860c(0x15d);}catch(_0x1e7079){}const _0x26fd25=a44_0x18f95e[_0x3860c(0x182)](_0x44309b,'utf8'),_0x14b1d8=JSON[_0x3860c(0x162)](_0x26fd25);_0x14b1d8[_0x3860c(0x137)]=_0x1753f3,_0x14b1d8[_0x3860c(0x12d)]=_0x1753f3+_0x3860c(0x141)+_0x551cf3,a44_0x18f95e[_0x3860c(0x144)](_0x44309b,JSON[_0x3860c(0x175)](_0x14b1d8,null,0x2)+'\x0a',_0x3860c(0x14c)),console[_0x3860c(0x14e)](_0x3860c(0x12c)+_0x1753f3),logger[_0x3860c(0x16f)]('create',_0x3860c(0x146));}catch(_0x3ad5c2){logger['error'](_0x3860c(0x13c),_0x3860c(0x117));throw _0x3ad5c2;}},_0x3e9432=async(_0x2a2646,_0x5c54a0,_0x33a3cf)=>{const _0x25e493=a44_0x3c97,_0x454ba9=a44_0x2f616d['resolve'](process[_0x25e493(0x15e)](),_0x2a2646),_0x1ae573=a44_0x2f616d[_0x25e493(0x14f)](_0x454ba9,_0x25e493(0x116));try{_0x5c54a0?console[_0x25e493(0x14e)]('*\x20正在为项目\x20'+_0x2a2646+_0x25e493(0x177)+_0x5c54a0):console[_0x25e493(0x14e)](_0x25e493(0x136)+_0x2a2646+_0x25e493(0x187));const _0x517044=fileURLToPath(import.meta.url),_0x40a2b0=a44_0x2f616d[_0x25e493(0x17f)](a44_0x2f616d[_0x25e493(0x15a)](_0x517044),_0x25e493(0x11d)),_0x33a33f=a44_0x2f616d[_0x25e493(0x14f)](_0x40a2b0,_0x25e493(0x183));let _0x4a0f5a='1.0.0';try{const _0x327153=JSON['parse'](a44_0x18f95e[_0x25e493(0x182)](_0x33a33f,_0x25e493(0x14c)));_0x4a0f5a=_0x327153[_0x25e493(0x158)]||_0x25e493(0x15d);}catch(_0x3dc150){}const _0x193cd6=readConfig(),_0x1780f4=typeof _0x193cd6[_0x25e493(0x167)]==='string'?_0x193cd6[_0x25e493(0x167)]:undefined,{app:_0x3ff52b,appcode:_0x22d1de,..._0x12778a}=_0x193cd6,_0x45c576={..._0x12778a,'appcode':_0x5c54a0||'','env':_0x33a3cf||_0x1780f4||_0x25e493(0x122),'createdAt':new Date()[_0x25e493(0x142)](),'version':_0x4a0f5a};a44_0x18f95e[_0x25e493(0x144)](_0x1ae573,JSON[_0x25e493(0x175)](_0x45c576,null,0x2),'utf8'),_0x5c54a0?console[_0x25e493(0x14e)](_0x25e493(0x169)+_0x5c54a0):console['log'](_0x25e493(0x140)),logger['info'](_0x25e493(0x13c),'配置应用AppCode:\x20'+_0x5c54a0);}catch(_0x5752e2){logger[_0x25e493(0x160)](_0x25e493(0x13c),_0x25e493(0x16d));}};useEffect(()=>{const _0x2a7ddc=a44_0x3c97;_0x2c38c8[_0x2a7ddc(0x147)]&&_0x5c241a(_0x2c38c8[_0x2a7ddc(0x147)]);},[_0x2c38c8[_0x1b4b59(0x147)]]);if(!_0x4079cb&&!_0x5bc5df&&!_0x2c38c8[_0x1b4b59(0x147)])return a44_0x47b470(EnhancedGuidedCreate,{'onCreate':_0xe31ece,'env':_0x2c38c8['env']});if(_0x4079cb)return a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'marginTop':0x1,'children':[a44_0x47b470(Box,{'width':'1'}),a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':'\x20√\x20'}),a44_0x47b470(Text,{'children':_0x1b4b59(0x18b)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':_0x44113c?.['projectName']}),_0x44113c?.['appCode']&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Text,{'children':_0x1b4b59(0x139)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'children':_0x44113c[_0x1b4b59(0x15c)]})]})]}),a44_0x47b470(TaskRunning,{..._0x216194}),a44_0x47b470(TaskRunning,{..._0x273e90}),a44_0x47b470(TaskRunning,{..._0x4a4446})]});if(_0x5bc5df){const _0x1d883b=_0x585443&&(_0x585443[_0x1b4b59(0x166)][_0x1b4b59(0x17c)]>0x0||_0x585443[_0x1b4b59(0x16b)][_0x1b4b59(0x17c)]>0x0);return a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'marginTop':0x1,'children':[a44_0x47b470(Box,{'width':'1'}),a44_0x47b470(Text,{'color':'green','children':_0x1b4b59(0x163)}),a44_0x47b470(Text,{'children':_0x1b4b59(0x18b)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':_0x44113c?.['projectName']}),_0x44113c?.[_0x1b4b59(0x15c)]&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Text,{'children':_0x1b4b59(0x139)}),a44_0x47b470(Text,{'color':'cyan','children':_0x44113c['appCode']})]})]}),a44_0x47b470(TaskFinished,{..._0x216194}),a44_0x47b470(TaskFinished,{..._0x273e90}),a44_0x47b470(TaskFinished,{..._0x4a4446}),a44_0x47b470(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x47b470(Text,{'color':'green','children':'─'[_0x1b4b59(0x161)](0x3c)})}),_0x1d883b&&a44_0x28b5d1(a44_0x5e98d8,{'children':[_0x585443['mcp'][_0x1b4b59(0x17c)]>0x0&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Box,{'marginTop':0x1,'children':a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'bold':!![],'children':_0x1b4b59(0x153)})}),_0x585443[_0x1b4b59(0x166)][_0x1b4b59(0x11b)]((_0x4922c2,_0x1e3c50)=>a44_0x47b470(Box,{'marginLeft':0x2,'children':a44_0x28b5d1(Text,{'color':_0x4922c2[_0x1b4b59(0x14d)]===_0x1b4b59(0x113)?_0x1b4b59(0x16c):_0x4922c2[_0x1b4b59(0x14d)]===_0x1b4b59(0x138)?_0x1b4b59(0x130):_0x1b4b59(0x165),'children':[_0x4922c2[_0x1b4b59(0x164)],':\x20',_0x4922c2[_0x1b4b59(0x15b)]]})},'mcp-'+_0x1e3c50))]}),_0x585443['skill']['length']>0x0&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Box,{'marginTop':_0x585443[_0x1b4b59(0x166)][_0x1b4b59(0x17c)]>0x0?0x1:0x0,'children':a44_0x47b470(Text,{'color':'green','bold':!![],'children':'✓\x20Skill\x20安装完成:'})}),_0x585443['skill']['map']((_0x1ca311,_0x14f59d)=>a44_0x47b470(Box,{'marginLeft':0x2,'children':a44_0x28b5d1(Text,{'color':_0x1ca311[_0x1b4b59(0x14d)]===_0x1b4b59(0x113)?_0x1b4b59(0x16c):'red','children':[_0x1ca311[_0x1b4b59(0x164)],':\x20',_0x1ca311[_0x1b4b59(0x15b)]]})},_0x1b4b59(0x14b)+_0x14f59d))]}),a44_0x47b470(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x47b470(Text,{'color':'green','children':'─'[_0x1b4b59(0x161)](0x3c)})})]}),a44_0x47b470(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x178)})}),a44_0x28b5d1(Box,{'marginLeft':0x2,'flexDirection':'column','children':[_0x1d883b?a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':'1.\x20'}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x157)}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':'cd\x20'+_0x44113c?.[_0x1b4b59(0x120)]+_0x1b4b59(0x128)})]}),_0x44113c?.[_0x1b4b59(0x15c)]&&!_0x44113c?.[_0x1b4b59(0x185)]&&a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x130),'children':_0x1b4b59(0x168)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x152)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x17d)})]})]}):a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Box,{'children':a44_0x47b470(Text,{'color':'yellow','bold':!![],'children':_0x1b4b59(0x13f)})}),a44_0x28b5d1(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x125)}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':_0x1b4b59(0x126)})]}),a44_0x28b5d1(Box,{'marginLeft':0x2,'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x112)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x17b)})]}),a44_0x28b5d1(Box,{'marginTop':0x1,'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':_0x1b4b59(0x168)}),a44_0x47b470(Text,{'color':'white','children':'启动项目:\x20'}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':_0x1b4b59(0x134)+_0x44113c?.[_0x1b4b59(0x120)]+_0x1b4b59(0x128)})]}),_0x44113c?.[_0x1b4b59(0x15c)]&&!_0x44113c?.[_0x1b4b59(0x185)]&&a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x130),'children':_0x1b4b59(0x114)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x152)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x17d)})]})]}),!_0x44113c?.[_0x1b4b59(0x15c)]&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x13b),'children':_0x1b4b59(0x168)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x121)}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':_0x1b4b59(0x174)})]}),a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x13b),'children':_0x1b4b59(0x114)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x152)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x133)})]})]})]}),a44_0x47b470(Box,{'marginTop':0x1,'children':a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':'─'[_0x1b4b59(0x161)](0x3c)})})]});}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23bb9b,_0x1dcdd3){const _0x2d5b1d=a45_0xce4b,_0x1ef077=_0x23bb9b();while(!![]){try{const _0x45f7d6=parseInt(_0x2d5b1d(0x119))/0x1+parseInt(_0x2d5b1d(0x113))/0x2*(parseInt(_0x2d5b1d(0x126))/0x3)+parseInt(_0x2d5b1d(0x124))/0x4*(-parseInt(_0x2d5b1d(0x133))/0x5)+parseInt(_0x2d5b1d(0x115))/0x6+-parseInt(_0x2d5b1d(0x116))/0x7+-parseInt(_0x2d5b1d(0x117))/0x8+parseInt(_0x2d5b1d(0x131))/0x9;if(_0x45f7d6===_0x1dcdd3)break;else _0x1ef077['push'](_0x1ef077['shift']());}catch(_0x54ebc7){_0x1ef077['push'](_0x1ef077['shift']());}}}(a45_0x199a,0xccadb));import a45_0x4859b0 from'path';function a45_0xce4b(_0x29e192,_0x26cc6a){_0x29e192=_0x29e192-0x103;const _0x199ad7=a45_0x199a();let _0xce4b58=_0x199ad7[_0x29e192];return _0xce4b58;}import{fileURLToPath}from'url';import a45_0x122170 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';function a45_0x199a(){const _0x4957a6=['×\x20项目名不能为空','join','W_OK','1419508TFNKBY','\x20\x20正在安装依赖...','249nJnfrj','\x0a√\x20项目\x20','\x20\x20√\x20代码已格式化','length','\x20\x20√\x20依赖安装跳过(非交互模式)','\x20\x20lovrabet\x20start\x0a','×\x20项目目录\x20','readFile','needsUpgrade','access','resolve','14677587GKMGec','lovrabet.config.json','5NYrINt','log','error','stringify','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','\x20\x20√\x20项目模板已创建','description','dirname','cwd','package.json','exit','bun','test','npm','bun\x20--version','\x0a\x20\x20cd\x20','parse','writeFile','22112uqotVi','../../templates/projects/sub-app-react-demo','3040650OXYKVD','8520904Qxiese','10079440bGHGXA','\x20\x20√\x20环境配置完成','615176SHfIiO','\x20\x20√\x20package.json\x20已更新','trim','\x20创建成功!','constants','env','×\x20项目创建失败:\x20','message'];a45_0x199a=function(){return _0x4957a6;};return a45_0x199a();}const execAsync=promisify(exec);function getTemplateDir(){const _0x927f35=a45_0xce4b,_0x409f4b=fileURLToPath(import.meta.url),_0x5dd3ad=a45_0x4859b0['dirname'](_0x409f4b);return a45_0x4859b0['resolve'](_0x5dd3ad,_0x927f35(0x114));}export async function createProjectNonInteractive(_0x306dd8,_0xc10da1){const _0x27fe3d=a45_0xce4b,_0x3c13e9=await checkCliVersion();_0x3c13e9[_0x27fe3d(0x12e)]&&printCliUpgradeWarning(_0x3c13e9);(!_0x306dd8||_0x306dd8[_0x27fe3d(0x11b)]()==='')&&(console['error'](_0x27fe3d(0x121)),process[_0x27fe3d(0x10b)](0x1));const _0x1102b1=/[<>:"|?*\x00-\x1f\x7f]/;_0x1102b1[_0x27fe3d(0x10d)](_0x306dd8)&&(console[_0x27fe3d(0x135)](_0x27fe3d(0x105)),process['exit'](0x1));_0x306dd8[_0x27fe3d(0x129)]>0x64&&(console['error']('×\x20项目名过长,最多支持\x20100\x20个字符'),process[_0x27fe3d(0x10b)](0x1));const _0x443f6f=a45_0x4859b0[_0x27fe3d(0x130)](process[_0x27fe3d(0x109)](),_0x306dd8);existsSync(_0x443f6f)&&(console[_0x27fe3d(0x135)](_0x27fe3d(0x12c)+_0x306dd8+'\x20已存在,请使用其他项目名'),process[_0x27fe3d(0x10b)](0x1));try{const _0xf38548=a45_0x4859b0[_0x27fe3d(0x108)](_0x443f6f);await a45_0x122170[_0x27fe3d(0x12f)](_0xf38548,a45_0x122170[_0x27fe3d(0x11d)][_0x27fe3d(0x123)]);}catch(_0xeeddfa){console[_0x27fe3d(0x135)]('×\x20无法在当前目录创建项目,请检查目录权限'),process[_0x27fe3d(0x10b)](0x1);}try{console[_0x27fe3d(0x134)]('*\x20正在创建项目\x20'+_0x306dd8+'...');const _0x25f01c=getTemplateDir();await copyDirectory(_0x25f01c,_0x443f6f),console[_0x27fe3d(0x134)](_0x27fe3d(0x106)),await updatePackageJsonName(_0x306dd8),console['log'](_0x27fe3d(0x11a)),console[_0x27fe3d(0x134)](_0x27fe3d(0x125)),console[_0x27fe3d(0x134)](_0x27fe3d(0x12a)),await formatCode(_0x443f6f),console[_0x27fe3d(0x134)](_0x27fe3d(0x128)),await configureAppEnv(_0x306dd8,_0xc10da1),console[_0x27fe3d(0x134)](_0x27fe3d(0x118)),console['log'](_0x27fe3d(0x127)+_0x306dd8+_0x27fe3d(0x11c)),console[_0x27fe3d(0x134)](_0x27fe3d(0x110)+_0x306dd8),console[_0x27fe3d(0x134)](_0x27fe3d(0x12b));}catch(_0x1a0902){const _0x38c9e5=_0x1a0902 instanceof Error?_0x1a0902[_0x27fe3d(0x120)]:String(_0x1a0902);try{existsSync(_0x443f6f)&&await a45_0x122170['rm'](_0x443f6f,{'recursive':!![],'force':!![]});}catch{}console['error'](_0x27fe3d(0x11f)+_0x38c9e5),process[_0x27fe3d(0x10b)](0x1);}}async function updatePackageJsonName(_0x3470cd){const _0x16922e=a45_0xce4b,_0x7b7abd=a45_0x4859b0['resolve'](process['cwd'](),_0x3470cd),_0x345ca7=a45_0x4859b0['join'](_0x7b7abd,_0x16922e(0x10a)),_0x2e277b=await a45_0x122170[_0x16922e(0x12d)](_0x345ca7,'utf-8'),_0x54242f=JSON[_0x16922e(0x111)](_0x2e277b);_0x54242f['name']=_0x3470cd,_0x54242f[_0x16922e(0x107)]=_0x16922e(0x104),await a45_0x122170[_0x16922e(0x112)](_0x345ca7,JSON[_0x16922e(0x103)](_0x54242f,null,0x2)+'\x0a');}async function installDependencies(_0x8b1d26){const _0x88f7a0=detectPackageManager(),_0x41371c=_0x88f7a0+'\x20install';try{await execAsync(_0x41371c,{'cwd':_0x8b1d26});}catch(_0x29469d){throw new Error('依赖安装失败:\x20'+_0x29469d);}}function detectPackageManager(){const _0x38ae6a=a45_0xce4b;try{return execAsync(_0x38ae6a(0x10f),{}),_0x38ae6a(0x10c);}catch{return _0x38ae6a(0x10e);}}async function formatCode(_0x5253c0){try{await execAsync('bun\x20run\x20format',{'cwd':_0x5253c0});}catch{}}async function configureAppEnv(_0xea5aad,_0xbc7221){const _0x5a394a=a45_0xce4b,_0xbe5dba=a45_0x4859b0[_0x5a394a(0x130)](process[_0x5a394a(0x109)](),_0xea5aad),_0x5938fc=a45_0x4859b0[_0x5a394a(0x122)](_0xbe5dba,_0x5a394a(0x132));let _0x318e82={};if(existsSync(_0x5938fc)){const _0x343075=await a45_0x122170[_0x5a394a(0x12d)](_0x5938fc,'utf-8');_0x318e82=JSON[_0x5a394a(0x111)](_0x343075);}_0xbc7221&&(_0x318e82[_0x5a394a(0x11e)]=_0xbc7221),await a45_0x122170[_0x5a394a(0x112)](_0x5938fc,JSON[_0x5a394a(0x103)](_0x318e82,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x401941,_0x4a47a8){var _0x30ea6c=a46_0x239b,_0x43a263=_0x401941();while(!![]){try{var _0x1b078b=-parseInt(_0x30ea6c(0x1d6))/0x1+parseInt(_0x30ea6c(0x1da))/0x2*(-parseInt(_0x30ea6c(0x1d7))/0x3)+-parseInt(_0x30ea6c(0x1db))/0x4*(-parseInt(_0x30ea6c(0x1dc))/0x5)+-parseInt(_0x30ea6c(0x1d9))/0x6*(-parseInt(_0x30ea6c(0x1d3))/0x7)+-parseInt(_0x30ea6c(0x1d5))/0x8+parseInt(_0x30ea6c(0x1dd))/0x9*(parseInt(_0x30ea6c(0x1de))/0xa)+parseInt(_0x30ea6c(0x1d8))/0xb;if(_0x1b078b===_0x4a47a8)break;else _0x43a263['push'](_0x43a263['shift']());}catch(_0x41eaac){_0x43a263['push'](_0x43a263['shift']());}}}(a46_0x43b7,0x4e147));function a46_0x43b7(){var _0x238c1a=['568675fMsooZ','45174xZIDpB','11930963GpTnsz','6klqitv','78eLGqno','8yrJmBW','255545GFjciK','614682lVNhhL','60fZwvJg','taskName','19264TeEqVC','elapsed','989112BKcMfm'];a46_0x43b7=function(){return _0x238c1a;};return a46_0x43b7();}function a46_0x239b(_0x5d7104,_0xc54cd){_0x5d7104=_0x5d7104-0x1d3;var _0x43b7c5=a46_0x43b7();var _0x239ba9=_0x43b7c5[_0x5d7104];return _0x239ba9;}import{jsx as a46_0x251b1b,jsxs as a46_0x445dcf}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x3a7f86){var _0x3de75a=a46_0x239b;return a46_0x445dcf(Box,{'children':[a46_0x251b1b(Box,{'width':'1'}),a46_0x251b1b(Text,{'color':'green','children':'\x20√\x20'}),a46_0x251b1b(Text,{'children':_0x3a7f86[_0x3de75a(0x1df)]}),a46_0x251b1b(TaskTime,{'elapsed':_0x3a7f86[_0x3de75a(0x1d4)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x414f(_0x56961b,_0x19278a){_0x56961b=_0x56961b-0x17d;var _0x1eb982=a47_0x1eb9();var _0x414f0b=_0x1eb982[_0x56961b];return _0x414f0b;}function a47_0x1eb9(){var _0x5dba18=['58976qGGbaI','62757pSdmml','889504VrTwVe','10947699fdyVaB','6416934gAHOwq','\x20√\x20','12mjrNmK','464410nijBpk','green','loading','dots','4384qbiqYe','1515995RRAxOb'];a47_0x1eb9=function(){return _0x5dba18;};return a47_0x1eb9();}(function(_0x3f8c0e,_0x146754){var _0x58596c=a47_0x414f,_0x5136a7=_0x3f8c0e();while(!![]){try{var _0x263db0=-parseInt(_0x58596c(0x184))/0x1+-parseInt(_0x58596c(0x189))/0x2*(-parseInt(_0x58596c(0x188))/0x3)+-parseInt(_0x58596c(0x182))/0x4+-parseInt(_0x58596c(0x181))/0x5+-parseInt(_0x58596c(0x186))/0x6+-parseInt(_0x58596c(0x185))/0x7+-parseInt(_0x58596c(0x180))/0x8*(-parseInt(_0x58596c(0x183))/0x9);if(_0x263db0===_0x146754)break;else _0x5136a7['push'](_0x5136a7['shift']());}catch(_0x3b2294){_0x5136a7['push'](_0x5136a7['shift']());}}}(a47_0x1eb9,0xddf4b));import{jsx as a47_0x1f3338,jsxs as a47_0x1ac878}from'react/jsx-runtime';import{Text}from'ink';import a47_0x25bbae from'ink-spinner';export function TaskLoading(_0x59eccf){var _0x17a058=a47_0x414f;if(_0x59eccf['finished'])return a47_0x1f3338(Text,{'color':_0x17a058(0x17d),'children':_0x17a058(0x187)});if(_0x59eccf[_0x17a058(0x17e)])return a47_0x1ac878(Text,{'color':'green','children':['\x20',a47_0x1f3338(a47_0x25bbae,{'type':_0x17a058(0x17f)}),'\x20']});return a47_0x1f3338(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x158d23,_0x599dae){var _0x2a0f18=a48_0x3122,_0x31cd3a=_0x158d23();while(!![]){try{var _0x416e8c=parseInt(_0x2a0f18(0x19b))/0x1+-parseInt(_0x2a0f18(0x1a3))/0x2+-parseInt(_0x2a0f18(0x1a1))/0x3*(parseInt(_0x2a0f18(0x19e))/0x4)+-parseInt(_0x2a0f18(0x1a2))/0x5*(-parseInt(_0x2a0f18(0x19a))/0x6)+parseInt(_0x2a0f18(0x199))/0x7+parseInt(_0x2a0f18(0x19f))/0x8*(-parseInt(_0x2a0f18(0x1a0))/0x9)+parseInt(_0x2a0f18(0x19c))/0xa;if(_0x416e8c===_0x599dae)break;else _0x31cd3a['push'](_0x31cd3a['shift']());}catch(_0x102622){_0x31cd3a['push'](_0x31cd3a['shift']());}}}(a48_0xeb3a,0x92684));function a48_0xeb3a(){var _0xf7a5c9=['5176311EYkLuL','6QAXRdn','900829srZjet','6071430IqJarG','taskName','1722652HQLqLb','60184bSjWMm','1017zrwaRF','3yRThYs','925655lkjYAP','1104260PRvRTW'];a48_0xeb3a=function(){return _0xf7a5c9;};return a48_0xeb3a();}import{jsx as a48_0x58564c,jsxs as a48_0x45d702}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';function a48_0x3122(_0x3cda09,_0x30bd62){_0x3cda09=_0x3cda09-0x199;var _0xeb3a08=a48_0xeb3a();var _0x312217=_0xeb3a08[_0x3cda09];return _0x312217;}import{TaskTime}from'./task-time.js';export function TaskRunning(_0xbb52c9){var _0x2176e8=a48_0x3122;return a48_0x45d702(Box,{'children':[a48_0x58564c(Box,{'width':'1'}),a48_0x58564c(TaskLoading,{..._0xbb52c9}),a48_0x58564c(Text,{'children':_0xbb52c9[_0x2176e8(0x19d)]}),a48_0x58564c(TaskTime,{'elapsed':_0xbb52c9['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x11ad80,_0x2fd3ed){var _0x16270e=a49_0x3c95,_0x237046=_0x11ad80();while(!![]){try{var _0xbbd5a6=-parseInt(_0x16270e(0x101))/0x1*(-parseInt(_0x16270e(0xfa))/0x2)+-parseInt(_0x16270e(0xfc))/0x3*(parseInt(_0x16270e(0xfe))/0x4)+-parseInt(_0x16270e(0xff))/0x5+-parseInt(_0x16270e(0xf9))/0x6+-parseInt(_0x16270e(0x102))/0x7+parseInt(_0x16270e(0x100))/0x8+-parseInt(_0x16270e(0xfb))/0x9*(-parseInt(_0x16270e(0x103))/0xa);if(_0xbbd5a6===_0x2fd3ed)break;else _0x237046['push'](_0x237046['shift']());}catch(_0x95d08d){_0x237046['push'](_0x237046['shift']());}}}(a49_0x55c8,0xbd933));function a49_0x3c95(_0x578734,_0x25f323){_0x578734=_0x578734-0xf9;var _0x55c834=a49_0x55c8();var _0x3c957f=_0x55c834[_0x578734];return _0x3c957f;}import{jsx as a49_0x3e2ead,Fragment as a49_0x2cc830,jsxs as a49_0x267d75}from'react/jsx-runtime';function a49_0x55c8(){var _0x4fd80e=['gray','18876BOFUVU','117262vnmIcC','682218tkkQqU','9cqVrEi','elapsed','1289844WjnwyL','7243690nUzpxe','12194624XcSuKg','16vShChF','2295202eqjkmc','140NyFfzm'];a49_0x55c8=function(){return _0x4fd80e;};return a49_0x55c8();}import{Text}from'ink';export function TaskTime(_0x1140ad){var _0x3cdee9=a49_0x3c95;if(_0x1140ad['elapsed'])return a49_0x267d75(a49_0x2cc830,{'children':[a49_0x3e2ead(Text,{'color':_0x3cdee9(0x104),'children':'\x20['}),a49_0x3e2ead(Text,{'color':_0x3cdee9(0x104),'bold':!![],'children':_0x1140ad[_0x3cdee9(0xfd)]}),a49_0x3e2ead(Text,{'color':'gray','children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x17f384=a50_0x1097;(function(_0x2f00ee,_0x34fa8a){const _0x395e13=a50_0x1097,_0x247fd0=_0x2f00ee();while(!![]){try{const _0x371468=-parseInt(_0x395e13(0xec))/0x1*(parseInt(_0x395e13(0xf6))/0x2)+parseInt(_0x395e13(0xed))/0x3+-parseInt(_0x395e13(0xf9))/0x4*(parseInt(_0x395e13(0xf7))/0x5)+parseInt(_0x395e13(0xef))/0x6+parseInt(_0x395e13(0xfa))/0x7*(parseInt(_0x395e13(0xfd))/0x8)+-parseInt(_0x395e13(0xfb))/0x9*(-parseInt(_0x395e13(0xf0))/0xa)+-parseInt(_0x395e13(0xf3))/0xb*(parseInt(_0x395e13(0xfc))/0xc);if(_0x371468===_0x34fa8a)break;else _0x247fd0['push'](_0x247fd0['shift']());}catch(_0x235b29){_0x247fd0['push'](_0x247fd0['shift']());}}}(a50_0x4bba,0x48134));function a50_0x1097(_0x3f9481,_0x1d6d6d){_0x3f9481=_0x3f9481-0xe9;const _0x4bba04=a50_0x4bba();let _0x1097c3=_0x4bba04[_0x3f9481];return _0x1097c3;}import a50_0xba9b24 from'node:path';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_0xba9b24[a50_0x17f384(0xf1)](fileURLToPath(import.meta.url)),templateDir=a50_0xba9b24['resolve'](__dirname,a50_0x17f384(0xeb));function a50_0x4bba(){const _0x2355d5=['1507168LzCxBG','开始复制项目模板','message','复制项目文件','../../templates/projects/sub-app-react-demo','32FgODHh','87252xxkHuf','info','1785726xAlzWT','10AdMtjA','dirname','error','176NHdcSw','copy','cwd','17720DNUZIm','1670UXjNPX','项目模板复制完成','3748mvbTXB','7wfIoRb','5168925lClBUD','148296rshcaX'];a50_0x4bba=function(){return _0x2355d5;};return a50_0x4bba();}export function useCopyProjectTemplate(){const _0x1de869=a50_0x17f384,[_0x2f70b3,_0x54b08c]=useState(![]),[_0x152e75,_0x31aa3c]=useState(![]),[_0x24c91f,_0x10adf9]=useState(''),_0x534e62=useCallback(async _0x14056a=>{const _0x33f680=a50_0x1097,_0x3c9df8=Date['now'](),_0x1a844d=a50_0xba9b24['resolve'](process[_0x33f680(0xf5)](),_0x14056a);_0x54b08c(!![]);try{logger[_0x33f680(0xee)](_0x33f680(0xf4),_0x33f680(0xfe),{'projectCode':_0x14056a,'templateDir':templateDir}),await copyDirectory(templateDir,_0x1a844d);const _0x57e206=Date['now']()-_0x3c9df8;logger['success']('copy',_0x33f680(0xf8),_0x57e206,{'projectCode':_0x14056a});}catch(_0x3a42da){const _0x26de23=Date['now']()-_0x3c9df8;logger[_0x33f680(0xf2)](_0x33f680(0xf4),'项目模板复制失败',{'projectCode':_0x14056a,'error':_0x3a42da instanceof Error?_0x3a42da[_0x33f680(0xe9)]:String(_0x3a42da),'duration':_0x26de23});throw _0x3a42da;}finally{_0x54b08c(![]),_0x31aa3c(!![]),_0x10adf9(formatElapsed(_0x3c9df8));}},[]);return{'taskName':_0x1de869(0xea),'finished':_0x152e75,'loading':_0x2f70b3,'elapsed':_0x24c91f,'doTask':_0x534e62};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x232869,_0x22bfd7){const _0x5def9=a51_0x42cc,_0x51c86e=_0x232869();while(!![]){try{const _0x95a9e9=parseInt(_0x5def9(0x189))/0x1*(parseInt(_0x5def9(0x188))/0x2)+-parseInt(_0x5def9(0x187))/0x3*(-parseInt(_0x5def9(0x18c))/0x4)+parseInt(_0x5def9(0x183))/0x5+-parseInt(_0x5def9(0x18b))/0x6*(-parseInt(_0x5def9(0x191))/0x7)+parseInt(_0x5def9(0x18e))/0x8+parseInt(_0x5def9(0x196))/0x9+-parseInt(_0x5def9(0x193))/0xa;if(_0x95a9e9===_0x22bfd7)break;else _0x51c86e['push'](_0x51c86e['shift']());}catch(_0x1c4462){_0x51c86e['push'](_0x51c86e['shift']());}}}(a51_0x2eb2,0x5b885));import a51_0x12d7a from'node:path';import{useCallback,useState}from'react';function a51_0x2eb2(){const _0x504841=['608368qdjVzt','message','npx','581nrNpri','代码格式化失败','22395930nGHrrh','now','prettier','4709718GRnbdv','代码格式化完成','开始格式化代码','resolve','2599120hxzmYP','error','format','success','60MiyjUg','96RQlCcM','14167wXTMpr','格式化代码','31524XPTSLv','75848NDLSOT','--write'];a51_0x2eb2=function(){return _0x504841;};return a51_0x2eb2();}import{execa}from'execa';function a51_0x42cc(_0x2c3e36,_0x4dcfb6){_0x2c3e36=_0x2c3e36-0x181;const _0x2eb27b=a51_0x2eb2();let _0x42cc36=_0x2eb27b[_0x2c3e36];return _0x42cc36;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x3bc183=a51_0x42cc,[_0x47bc67,_0x3f6042]=useState(![]),[_0x2730ec,_0x4abfab]=useState(![]),[_0x1e3fa3,_0x332725]=useState(''),_0x5df7b7=useCallback(async _0x38a39b=>{const _0x42f607=a51_0x42cc,_0x5b844e=Date['now'](),_0x457ffa=a51_0x12d7a[_0x42f607(0x182)](process['cwd'](),_0x38a39b);_0x3f6042(!![]);try{logger['info'](_0x42f607(0x185),_0x42f607(0x181),{'projectCode':_0x38a39b}),await execa(_0x42f607(0x190),[_0x42f607(0x195),_0x42f607(0x18d),'.'],{'cwd':_0x457ffa});const _0x40064e=Date[_0x42f607(0x194)]()-_0x5b844e;logger[_0x42f607(0x186)](_0x42f607(0x185),_0x42f607(0x197),_0x40064e,{'projectCode':_0x38a39b});}catch(_0x1ccde1){const _0x4adfa5=Date[_0x42f607(0x194)]()-_0x5b844e;logger[_0x42f607(0x184)](_0x42f607(0x185),_0x42f607(0x192),{'projectCode':_0x38a39b,'error':_0x1ccde1 instanceof Error?_0x1ccde1[_0x42f607(0x18f)]:String(_0x1ccde1),'duration':_0x4adfa5});throw _0x1ccde1;}finally{_0x3f6042(![]),_0x4abfab(!![]),_0x332725(formatElapsed(_0x5b844e));}},[]);return{'taskName':_0x3bc183(0x18a),'finished':_0x2730ec,'loading':_0x47bc67,'elapsed':_0x1e3fa3,'doTask':_0x5df7b7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a52_0x466e(_0x38986b,_0x53730d){_0x38986b=_0x38986b-0x1a7;const _0x4cb69b=a52_0x4cb6();let _0x466e4a=_0x4cb69b[_0x38986b];return _0x466e4a;}(function(_0x1116ee,_0x320029){const _0x3106ff=a52_0x466e,_0x49951b=_0x1116ee();while(!![]){try{const _0x400619=-parseInt(_0x3106ff(0x1be))/0x1*(-parseInt(_0x3106ff(0x1af))/0x2)+parseInt(_0x3106ff(0x1b4))/0x3+parseInt(_0x3106ff(0x1a8))/0x4*(parseInt(_0x3106ff(0x1aa))/0x5)+parseInt(_0x3106ff(0x1bd))/0x6*(-parseInt(_0x3106ff(0x1b3))/0x7)+parseInt(_0x3106ff(0x1bb))/0x8+parseInt(_0x3106ff(0x1ab))/0x9*(parseInt(_0x3106ff(0x1b6))/0xa)+parseInt(_0x3106ff(0x1b7))/0xb*(-parseInt(_0x3106ff(0x1b1))/0xc);if(_0x400619===_0x320029)break;else _0x49951b['push'](_0x49951b['shift']());}catch(_0x1f8240){_0x49951b['push'](_0x49951b['shift']());}}}(a52_0x4cb6,0xbf13f));function a52_0x4cb6(){const _0x519bdb=['35128404qltPsc','info','8848742cwIcHv','2237034yvVeez','依赖安装完成','9365590uPZhLR','11AvbKwA','resolve','开始安装依赖','--registry','10633192hocOew','error','6ThNEBj','1pQoZyc','install','2812SLPfiV','cwd','6765UsRLRK','9wuFnmr','now','https://registry.npmmirror.com','依赖安装失败','2023166qfRBWS','安装依赖'];a52_0x4cb6=function(){return _0x519bdb;};return a52_0x4cb6();}import a52_0x4ad9a1 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 _0x556355=a52_0x466e,[_0x224105,_0x3e8549]=useState(![]),[_0x1f0de6,_0x5a0ff9]=useState(![]),[_0x18df3f,_0x5db64a]=useState(''),_0x47924e=useCallback(async _0xb5e1d2=>{const _0x416eef=a52_0x466e,_0x49a5d0=Date['now'](),_0x1b9241=a52_0x4ad9a1[_0x416eef(0x1b8)](process[_0x416eef(0x1a9)](),_0xb5e1d2);_0x3e8549(!![]),_0x5a0ff9(![]);const _0x3a03ff=async(_0x415343,_0x99578b)=>{await execa(_0x415343,_0x99578b,{'cwd':_0x1b9241});};try{logger[_0x416eef(0x1b2)](_0x416eef(0x1a7),_0x416eef(0x1b9),{'projectCode':_0xb5e1d2,'registry':_0x416eef(0x1ad)}),await _0x3a03ff('npm',['install',_0x416eef(0x1ba),_0x416eef(0x1ad)]);const _0x5c3ccc=Date[_0x416eef(0x1ac)]()-_0x49a5d0;logger['success'](_0x416eef(0x1a7),_0x416eef(0x1b5),_0x5c3ccc,{'projectCode':_0xb5e1d2});}catch(_0x488856){const _0x362cd5=Date[_0x416eef(0x1ac)]()-_0x49a5d0;logger[_0x416eef(0x1bc)](_0x416eef(0x1a7),_0x416eef(0x1ae),{'projectCode':_0xb5e1d2,'error':_0x488856 instanceof Error?_0x488856['message']:String(_0x488856),'duration':_0x362cd5});throw _0x488856;}finally{_0x3e8549(![]),_0x5a0ff9(!![]),_0x5db64a(formatElapsed(_0x49a5d0));}},[]);return{'taskName':_0x556355(0x1b0),'finished':_0x1f0de6,'loading':_0x224105,'elapsed':_0x18df3f,'doTask':_0x47924e};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x128a86,_0x253876){var _0x13709e=a53_0x49f7,_0x20c37a=_0x128a86();while(!![]){try{var _0x1b5b55=-parseInt(_0x13709e(0xfc))/0x1*(-parseInt(_0x13709e(0x101))/0x2)+-parseInt(_0x13709e(0xf7))/0x3+parseInt(_0x13709e(0x102))/0x4*(-parseInt(_0x13709e(0xf8))/0x5)+parseInt(_0x13709e(0xfe))/0x6+-parseInt(_0x13709e(0xfa))/0x7*(-parseInt(_0x13709e(0x100))/0x8)+-parseInt(_0x13709e(0xf6))/0x9+parseInt(_0x13709e(0xfb))/0xa*(parseInt(_0x13709e(0xf9))/0xb);if(_0x1b5b55===_0x253876)break;else _0x20c37a['push'](_0x20c37a['shift']());}catch(_0x2d3640){_0x20c37a['push'](_0x20c37a['shift']());}}}(a53_0x3e02,0xd8add));function a53_0x49f7(_0x31664c,_0x151de3){_0x31664c=_0x31664c-0xf6;var _0x3e0290=a53_0x3e02();var _0x49f7c6=_0x3e0290[_0x31664c];return _0x49f7c6;}function a53_0x3e02(){var _0x1cb057=['27748886nHoedu','1722728ibhoSp','10XvwxlC','7989sfyKcG','green','2107914DXOyMy','查看可用命令。','8xBbrIb','282vEGcWL','466016ROCZha','9514341zTqemm','2012328VFqJjI','70psKqBZ'];a53_0x3e02=function(){return _0x1cb057;};return a53_0x3e02();}import{jsx as a53_0x13712f,jsxs as a53_0x104e19}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x3928ed=a53_0x49f7;return a53_0x104e19(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a53_0x104e19(Box,{'children':[a53_0x13712f(Box,{'width':'1'}),a53_0x13712f(Text,{'children':'!\x20请指定一个有效的命令。'})]}),a53_0x104e19(Box,{'marginTop':0x1,'children':[a53_0x13712f(Box,{'width':'1'}),a53_0x104e19(Text,{'children':['\x20\x20','使用']}),a53_0x104e19(Text,{'bold':!![],'color':_0x3928ed(0xfd),'children':['\x20','lovrabet\x20--help','\x20']}),a53_0x13712f(Text,{'children':_0x3928ed(0xff)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a54_0x2b13(_0xd47a83,_0x3bf15f){_0xd47a83=_0xd47a83-0xcf;const _0x2bd2fc=a54_0x2bd2();let _0x2b1370=_0x2bd2fc[_0xd47a83];return _0x2b1370;}(function(_0x5fa100,_0x30b7cc){const _0x1253c4=a54_0x2b13,_0x5d3cae=_0x5fa100();while(!![]){try{const _0x5901b3=parseInt(_0x1253c4(0xcf))/0x1*(-parseInt(_0x1253c4(0xdd))/0x2)+parseInt(_0x1253c4(0xe6))/0x3*(parseInt(_0x1253c4(0xde))/0x4)+-parseInt(_0x1253c4(0xf6))/0x5+parseInt(_0x1253c4(0xdb))/0x6+parseInt(_0x1253c4(0xe4))/0x7+-parseInt(_0x1253c4(0xeb))/0x8+parseInt(_0x1253c4(0xfa))/0x9;if(_0x5901b3===_0x30b7cc)break;else _0x5d3cae['push'](_0x5d3cae['shift']());}catch(_0x567563){_0x5d3cae['push'](_0x5d3cae['shift']());}}}(a54_0x2bd2,0x9c538));import{jsxs as a54_0x4a3373,jsx as a54_0x5f43cb}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';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a54_0x2bd2(){const _0x4e1802=['5171296KuQCXx','version','column','应用代码不合法','error','当前目录已存在\x20.lovrabetrc\x20文件','green','AppCode:\x20','parse','创建配置文件失败','cyan','2672340bWHeuE','test','online','slice','10229184zqAdis','应用代码不能为空','red','utf8','\x20←\x20','toLocaleString','1dabOgx','message','.lovrabetrc','setLogPath','trim','init','backspace','delete','gray','创建配置文件失败:\x20','1.0.0','stringify','4465464FwCaZm','请输入应用代码\x20(AppCode):\x20','1802028vOPqow','4BXFXDg','应用代码只能包含字母、数字、-\x20和\x20_','cwd','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','env','return','3806824uSnoUt','应用代码长度不能超过\x20100\x20个字符','892662FVqUNN','exit','length','package.json','info'];a54_0x2bd2=function(){return _0x4e1802;};return a54_0x2bd2();}export function Init({appcode:_0x2f42ce,env:_0x36af32}){const _0x537f1f=a54_0x2b13,[_0x14e036,_0xbb154a]=useState(null),[_0x4b2a8b,_0x1f06d1]=useState(![]),[_0x1cb47f,_0x2dab61]=useState(!_0x2f42ce),[_0x137ae6,_0x1ee4b2]=useState(''),[_0x46710f,_0x1260a1]=useState(''),[_0x4eefea,_0x2f9260]=useState(_0x2f42ce||''),[_0x4e25c0]=useState(_0x36af32);function _0x5997a8(_0x7c9d8){const _0x3d539d=a54_0x2b13;if(_0x7c9d8['length']===0x0)return{'valid':![],'message':''};if(_0x7c9d8[_0x3d539d(0xe8)]>0x64)return{'valid':![],'message':_0x3d539d(0xe5)};const _0x521fc2=/^[A-Za-z0-9_-]+$/;if(!_0x521fc2[_0x3d539d(0xf7)](_0x7c9d8))return{'valid':![],'message':_0x3d539d(0xdf)};return{'valid':!![]};}useInput((_0x4962aa,_0x4e7a15)=>{const _0x5e6049=a54_0x2b13;if(!_0x1cb47f)return;if(_0x4e7a15[_0x5e6049(0xe3)]){if(_0x46710f||!_0x137ae6[_0x5e6049(0xd3)]()){_0x1260a1(_0x5e6049(0xfb));return;}const _0x316c55=_0x137ae6[_0x5e6049(0xd3)](),{valid:_0x51e37a,message:_0x3e0e8a}=_0x5997a8(_0x316c55);if(!_0x51e37a){_0x1260a1(_0x3e0e8a||_0x5e6049(0xee));return;}_0x2f9260(_0x316c55),_0x2dab61(![]);}else{if(_0x4e7a15[_0x5e6049(0xd5)]||_0x4e7a15[_0x5e6049(0xd6)])_0x1ee4b2(_0x187f97=>{const _0x2a6592=_0x5e6049,_0x333449=_0x187f97[_0x2a6592(0xf9)](0x0,-0x1);if(_0x333449[_0x2a6592(0xe8)]===0x0)_0x1260a1('');else{const {valid:_0xb94431,message:_0x474d2a}=_0x5997a8(_0x333449);_0x1260a1(_0xb94431?'':_0x474d2a||_0x2a6592(0xee));}return _0x333449;});else _0x4e7a15['ctrl']&&_0x4962aa==='c'?process[_0x5e6049(0xe7)](0x0):_0x1ee4b2(_0x2fbca9=>{const _0x3624d8=_0x5e6049,_0x26e01c=_0x2fbca9+_0x4962aa,{valid:_0x14934d,message:_0x6e2307}=_0x5997a8(_0x26e01c);return _0x1260a1(_0x14934d?'':_0x6e2307||_0x3624d8(0xee)),_0x26e01c;});}},{'isActive':_0x1cb47f}),useEffect(()=>{const _0x2e5387=a54_0x2b13;if(!_0x4eefea||_0x1cb47f)return;const _0xa145d2=resolve(process[_0x2e5387(0xe0)](),_0x2e5387(0xd1));if(existsSync(_0xa145d2)){_0xbb154a(_0x2e5387(0xf0)),setTimeout(()=>process[_0x2e5387(0xe7)](0x1),0x64);return;}try{const _0x21a14f=fileURLToPath(import.meta.url),_0x90fba2=resolve(dirname(_0x21a14f),'../..'),_0x3b7f91=join(_0x90fba2,_0x2e5387(0xe9));let _0x37a4b8=_0x2e5387(0xd9);try{const _0x214ea1=JSON[_0x2e5387(0xf3)](readFileSync(_0x3b7f91,_0x2e5387(0xfd)));_0x37a4b8=_0x214ea1['version']||'1.0.0';}catch(_0x3ee0c2){}const _0x18eb8e=readConfig(),_0x581aff=typeof _0x18eb8e['env']==='string'?_0x18eb8e[_0x2e5387(0xe2)]:undefined,{app:_0x4aecde,appcode:_0x2ffbbd,..._0x37f06b}=_0x18eb8e,_0x3b75e1={..._0x37f06b,'appcode':_0x4eefea,'env':_0x4e25c0||_0x581aff||_0x2e5387(0xf8),'createdAt':new Date()[_0x2e5387(0xff)](),'version':_0x37a4b8};writeFileSync(_0xa145d2,JSON[_0x2e5387(0xda)](_0x3b75e1,null,0x2),{'encoding':_0x2e5387(0xfd),'mode':0x180}),logger[_0x2e5387(0xd2)](process[_0x2e5387(0xe0)]()),logger[_0x2e5387(0xea)](_0x2e5387(0xd4),'初始化项目配置文件成功',{'appcode':_0x4eefea,'env':_0x3b75e1[_0x2e5387(0xe2)],'version':_0x3b75e1[_0x2e5387(0xec)],'configPath':_0xa145d2}),_0x1f06d1(!![]),setTimeout(()=>process[_0x2e5387(0xe7)](0x0),0x64);}catch(_0x501e50){logger[_0x2e5387(0xef)](_0x2e5387(0xd4),_0x2e5387(0xf4),{'error':_0x501e50 instanceof Error?_0x501e50[_0x2e5387(0xd0)]:String(_0x501e50)}),_0xbb154a(_0x2e5387(0xd8)+(_0x501e50 instanceof Error?_0x501e50['message']:String(_0x501e50))),setTimeout(()=>process[_0x2e5387(0xe7)](0x1),0x64);}},[_0x4eefea,_0x1cb47f,_0x4e25c0]);if(_0x14e036)return a54_0x5f43cb(Box,{'flexDirection':_0x537f1f(0xed),'children':a54_0x4a3373(Text,{'color':_0x537f1f(0xfc),'children':['✗\x20',_0x14e036]})});if(_0x1cb47f)return a54_0x4a3373(Box,{'flexDirection':_0x537f1f(0xed),'children':[a54_0x4a3373(Box,{'children':[a54_0x5f43cb(Text,{'color':'cyan','children':_0x537f1f(0xdc)}),_0x137ae6?a54_0x5f43cb(Text,{'color':_0x537f1f(0xf1),'children':_0x137ae6}):a54_0x5f43cb(Text,{'color':_0x537f1f(0xd7),'children':'_'}),_0x46710f&&a54_0x4a3373(Text,{'color':_0x537f1f(0xfc),'children':[_0x537f1f(0xfe),_0x46710f]})]}),!_0x46710f&&!_0x137ae6&&a54_0x5f43cb(Box,{'children':a54_0x5f43cb(Text,{'color':'gray','children':_0x537f1f(0xe1)})})]});if(_0x4b2a8b)return a54_0x4a3373(Box,{'flexDirection':_0x537f1f(0xed),'children':[a54_0x5f43cb(Text,{'color':_0x537f1f(0xf1),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a54_0x4a3373(Text,{'color':_0x537f1f(0xf5),'children':[_0x537f1f(0xf2),_0x4eefea]}),a54_0x5f43cb(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a54_0x5f43cb(Box,{'children':a54_0x5f43cb(Text,{'children':'正在初始化配置文件...'})});}
|
package/lib/mcp/McpInstallUI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x33242a=a55_0x35c7;(function(_0x51d884,_0x5b2b88){const _0x28ce64=a55_0x35c7,_0x4c1fc9=_0x51d884();while(!![]){try{const _0x254f2d=parseInt(_0x28ce64(0xf7))/0x1+parseInt(_0x28ce64(0xfc))/0x2*(-parseInt(_0x28ce64(0xfe))/0x3)+-parseInt(_0x28ce64(0x10f))/0x4*(parseInt(_0x28ce64(0x114))/0x5)+-parseInt(_0x28ce64(0xe0))/0x6*(parseInt(_0x28ce64(0xed))/0x7)+parseInt(_0x28ce64(0x104))/0x8+parseInt(_0x28ce64(0x10b))/0x9*(parseInt(_0x28ce64(0xf0))/0xa)+parseInt(_0x28ce64(0xe2))/0xb*(parseInt(_0x28ce64(0xdf))/0xc);if(_0x254f2d===_0x5b2b88)break;else _0x4c1fc9['push'](_0x4c1fc9['shift']());}catch(_0x596361){_0x4c1fc9['push'](_0x4c1fc9['shift']());}}}(a55_0x283f,0x5bc98));function a55_0x283f(){const _0x35e8be=['white','✓\x20MCP\x20配置完成!','message','cyan','425584lUlQOy','label','done','ide','name','success','green','36648pgJyut','description','cwd','red','1022668gVBTki','error','setErrorMsg','other','manual','5MKyYgk','gray','push','\x20\x20⚠️','map','82956MsVTWy','187356OzJigj','status','1496jyLpuA','selectedIndexes','不支持的\x20IDE:\x20','value','yellow','every','column','请至少选择一个\x20IDE','configuring','length','\x20\x20✓','105ZMTVlw','cursor','selecting','30LMadoo','⚠️\x20部分配置需要手动完成','已选择\x20IDE','return','claude','其他\x20IDE','\x20\x20✗','190023ZKsfTo','key','handleKeyDown','配置\x20Lovrabet\x20MCP\x20服务器','from','191176xfnlJG','some','3nDMmiM','find'];a55_0x283f=function(){return _0x35e8be;};return a55_0x283f();}function a55_0x35c7(_0x40d985,_0x5d3af2){_0x40d985=_0x40d985-0xdb;const _0x283f8a=a55_0x283f();let _0x35c730=_0x283f8a[_0x40d985];return _0x35c730;}import{jsx as a55_0x3f71b2,jsxs as a55_0x34c836,Fragment as a55_0x1d077f}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';import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';const IDE_LIST=[...Array[a55_0x33242a(0xfb)](MCP_IDES)[a55_0x33242a(0xde)](_0x18e845=>({'key':_0x18e845,'name':IDE_CONFIGS[_0x18e845][a55_0x33242a(0x108)],'description':IDE_CONFIGS[_0x18e845][a55_0x33242a(0x10c)]})),{'key':a55_0x33242a(0x112),'name':a55_0x33242a(0xf5),'description':'其他\x20IDE\x20配置指引'}];export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x58e348=a55_0x33242a,{exit:_0x4653d6}=useApp(),[_0x40a10a,_0x983f8]=useState(_0x58e348(0xef)),[_0x4a510a,_0x297670]=useState([]),[_0x1c146f,_0x330c11]=useState([]),_0x53eabc=useIDESelection({'ideList':IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x585855=_0x58e348;preselectedIDEs[_0x585855(0xeb)]>0x0&&_0x53eabc[_0x585855(0xe3)]['size']>0x0&&_0x2876a5();},[]),useInput((_0x44e870,_0x1d8182)=>{const _0x226570=_0x58e348;if(_0x40a10a===_0x226570(0xef)){if(_0x44e870==='q'||_0x44e870==='Q'){_0x4653d6();return;}if(_0x1d8182[_0x226570(0xf3)]){if(_0x53eabc[_0x226570(0xe3)]['size']===0x0){_0x53eabc[_0x226570(0x111)](_0x226570(0xe9));return;}_0x2876a5();return;}_0x53eabc[_0x226570(0xf9)](_0x44e870,_0x1d8182);}_0x40a10a===_0x226570(0x106)&&_0x4653d6();});async function _0x2876a5(){const _0x5e9b9c=_0x58e348,_0x58fdca=_0x53eabc['getSelectedIDEs']();_0x297670([{'label':_0x5e9b9c(0xf2),'value':_0x53eabc[_0x5e9b9c(0xe3)]['size']+'\x20个'}]),_0x983f8(_0x5e9b9c(0xea));const _0xb2dd38=[];for(const _0x1dba7e of _0x58fdca){try{const _0x31b473=await configureMcp(_0x1dba7e);_0xb2dd38[_0x5e9b9c(0xdc)]({'ide':IDE_LIST[_0x5e9b9c(0xff)](_0x559f3b=>_0x559f3b[_0x5e9b9c(0xf8)]===_0x1dba7e)?.[_0x5e9b9c(0x108)]||_0x1dba7e,'status':_0x31b473['needsManualAction']?'manual':_0x31b473[_0x5e9b9c(0x109)]?_0x5e9b9c(0x109):'error','message':_0x31b473[_0x5e9b9c(0x102)]});}catch(_0xd9a734){_0xb2dd38[_0x5e9b9c(0xdc)]({'ide':IDE_LIST['find'](_0x46dd41=>_0x46dd41['key']===_0x1dba7e)?.[_0x5e9b9c(0x108)]||_0x1dba7e,'status':_0x5e9b9c(0x110),'message':_0xd9a734 instanceof Error?_0xd9a734[_0x5e9b9c(0x102)]:String(_0xd9a734)});}}_0x330c11(_0xb2dd38),_0x983f8('done'),setTimeout(()=>{_0x4653d6();},0x1388);}return a55_0x34c836(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x40a10a==='selecting'&&a55_0x3f71b2(IDESelector,{'ideList':IDE_LIST,'title':_0x58e348(0xfa),'selection':_0x53eabc}),_0x40a10a===_0x58e348(0xea)&&a55_0x34c836(a55_0x1d077f,{'children':[_0x4a510a['map']((_0x447b19,_0x5a94c4)=>a55_0x34c836(Box,{'children':[a55_0x34c836(Text,{'color':'green','children':['√\x20',_0x447b19[_0x58e348(0x105)],':\x20']}),a55_0x3f71b2(Text,{'color':_0x58e348(0x103),'children':_0x447b19[_0x58e348(0xe5)]})]},_0x5a94c4)),a55_0x3f71b2(Box,{'marginTop':0x1,'children':a55_0x3f71b2(Text,{'children':'正在配置\x20MCP\x20服务器...'})})]}),_0x40a10a===_0x58e348(0x106)&&a55_0x3f71b2(DoneStep,{'configResults':_0x1c146f})]});}function DoneStep({configResults:_0x43c5a4}){const _0xc9a5b6=a55_0x33242a,_0x5b1a06=_0x43c5a4[_0xc9a5b6(0xe7)](_0x4b9fd5=>_0x4b9fd5[_0xc9a5b6(0xe1)]==='success'),_0x1ca0c6=_0x43c5a4[_0xc9a5b6(0xfd)](_0xdb669=>_0xdb669[_0xc9a5b6(0xe1)]===_0xc9a5b6(0x113)),_0x41c072=_0x43c5a4[_0xc9a5b6(0xfd)](_0xfc8d=>_0xfc8d[_0xc9a5b6(0xe1)]===_0xc9a5b6(0x110));return a55_0x34c836(a55_0x1d077f,{'children':[a55_0x3f71b2(Box,{'children':_0x5b1a06?a55_0x3f71b2(Text,{'color':_0xc9a5b6(0x10a),'children':_0xc9a5b6(0x101)}):_0x1ca0c6?a55_0x3f71b2(Text,{'color':_0xc9a5b6(0xe6),'children':_0xc9a5b6(0xf1)}):_0x41c072?a55_0x3f71b2(Text,{'color':_0xc9a5b6(0x10e),'children':'✗\x20配置失败'}):a55_0x3f71b2(Text,{'color':'yellow','children':'⚠️\x20配置需要手动完成'})}),_0x43c5a4['map']((_0x532de4,_0x2d8835)=>a55_0x34c836(Box,{'flexDirection':_0xc9a5b6(0xe8),'children':[a55_0x34c836(Text,{'color':_0x532de4[_0xc9a5b6(0xe1)]===_0xc9a5b6(0x109)?'green':_0x532de4[_0xc9a5b6(0xe1)]==='manual'?'yellow':_0xc9a5b6(0x10e),'children':[_0x532de4[_0xc9a5b6(0xe1)]===_0xc9a5b6(0x109)?_0xc9a5b6(0xec):_0x532de4[_0xc9a5b6(0xe1)]===_0xc9a5b6(0x113)?_0xc9a5b6(0xdd):_0xc9a5b6(0xf6),'\x20',_0x532de4[_0xc9a5b6(0x107)],':']}),a55_0x3f71b2(Text,{'color':_0x532de4[_0xc9a5b6(0xe1)]===_0xc9a5b6(0x109)?_0xc9a5b6(0x100):_0x532de4['status']===_0xc9a5b6(0x113)?'yellow':_0xc9a5b6(0x10e),'children':_0x532de4[_0xc9a5b6(0x102)]})]},_0x2d8835)),a55_0x3f71b2(Box,{'marginTop':0x1,'children':a55_0x3f71b2(Text,{'color':_0xc9a5b6(0xdb),'children':'按任意键退出...'})})]});}async function configureMcp(_0x146189){const _0x5c2ea6=a55_0x33242a,_0x491575=process[_0x5c2ea6(0x10d)]();switch(_0x146189){case _0x5c2ea6(0xee):return configureCursorMcp(_0x491575);case _0x5c2ea6(0xf4):return configureClaudeMcp(_0x491575);case _0x5c2ea6(0x112):return showOtherMcpGuide(_0x491575);default:throw new Error(_0x5c2ea6(0xe4)+_0x146189);}}
|
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35de3f,_0x478a66){const _0x26ab21=a56_0x133a,_0x26ef81=_0x35de3f();while(!![]){try{const _0x2a1cb9=-parseInt(_0x26ab21(0x1d5))/0x1*(parseInt(_0x26ab21(0x1d7))/0x2)+-parseInt(_0x26ab21(0x1d1))/0x3*(-parseInt(_0x26ab21(0x1cf))/0x4)+-parseInt(_0x26ab21(0x1cd))/0x5+-parseInt(_0x26ab21(0x1d3))/0x6*(-parseInt(_0x26ab21(0x1da))/0x7)+-parseInt(_0x26ab21(0x1d8))/0x8+-parseInt(_0x26ab21(0x1d0))/0x9+parseInt(_0x26ab21(0x1ce))/0xa;if(_0x2a1cb9===_0x478a66)break;else _0x26ef81['push'](_0x26ef81['shift']());}catch(_0x141037){_0x26ef81['push'](_0x26ef81['shift']());}}}(a56_0x1792,0x36a77));function a56_0x133a(_0x22d94b,_0xf74a0c){_0x22d94b=_0x22d94b-0x1cd;const _0x17923d=a56_0x1792();let _0x133aad=_0x17923d[_0x22d94b];return _0x133aad;}import{configureClaudeMcp as a56_0x580a34}from'./mcp-installer.js';export async function configureClaudeMcp(){const _0x3695c3=a56_0x133a,_0x19c56c=process['cwd'](),_0x146dbf=a56_0x580a34(_0x19c56c);_0x146dbf[_0x3695c3(0x1db)]?(console[_0x3695c3(0x1d2)](_0x3695c3(0x1dc)+_0x146dbf[_0x3695c3(0x1d6)]+'\x0a'),process[_0x3695c3(0x1d4)](0x0)):(console[_0x3695c3(0x1d9)]('\x0a错误:\x20配置失败\x20-\x20'+_0x146dbf[_0x3695c3(0x1d6)]+'\x0a'),process[_0x3695c3(0x1d4)](0x1));}function a56_0x1792(){const _0x1175ae=['message','10HpYWaU','2943080RREljs','error','560245UIGJiu','success','\x0a📋\x20','940475XzPCjU','6944200VtYrbi','32792vTFcYS','2271177VAMDtn','126wQwuRJ','log','6WFGEfe','exit','17315evUyzX'];a56_0x1792=function(){return _0x1175ae;};return a56_0x1792();}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a57_0x31d3(_0x1f8e26,_0xd61d8e){_0x1f8e26=_0x1f8e26-0x1d6;const _0x3932a1=a57_0x3932();let _0x31d3b7=_0x3932a1[_0x1f8e26];return _0x31d3b7;}function a57_0x3932(){const _0x16bf2e=['5564785BcEMfc','8obxWhP','exit','success','11770398APUEgE','8pQaOhB','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','message','1179066Vytnvk','现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','error','1130082CMKVdC','308951lkMuaP','5702610uTTREJ','cwd','9053373gCQigI','配置信息:','\x0a✓\x20Cursor\x20MCP\x20配置成功!\x0a','log'];a57_0x3932=function(){return _0x16bf2e;};return a57_0x3932();}(function(_0x1b3c7c,_0x5e3678){const _0x436d34=a57_0x31d3,_0x1283ac=_0x1b3c7c();while(!![]){try{const _0x331ca5=parseInt(_0x436d34(0x1d6))/0x1+-parseInt(_0x436d34(0x1e5))/0x2+-parseInt(_0x436d34(0x1e8))/0x3*(-parseInt(_0x436d34(0x1de))/0x4)+parseInt(_0x436d34(0x1dd))/0x5+-parseInt(_0x436d34(0x1d7))/0x6+-parseInt(_0x436d34(0x1d9))/0x7+-parseInt(_0x436d34(0x1e2))/0x8*(-parseInt(_0x436d34(0x1e1))/0x9);if(_0x331ca5===_0x5e3678)break;else _0x1283ac['push'](_0x1283ac['shift']());}catch(_0x179c44){_0x1283ac['push'](_0x1283ac['shift']());}}}(a57_0x3932,0x9ea53));import{configureCursorMcp as a57_0x15a779}from'./mcp-installer.js';export async function configureCursorMcp(){const _0x192e4d=a57_0x31d3,_0x48c36d=process[_0x192e4d(0x1d8)](),_0x4c1331=await a57_0x15a779(_0x48c36d);_0x4c1331[_0x192e4d(0x1e0)]?(console[_0x192e4d(0x1dc)](_0x192e4d(0x1db)),console[_0x192e4d(0x1dc)](_0x192e4d(0x1da)),console[_0x192e4d(0x1dc)]('\x20\x20'+_0x4c1331[_0x192e4d(0x1e4)]+'\x0a'),console[_0x192e4d(0x1dc)](_0x192e4d(0x1e6)),console[_0x192e4d(0x1dc)](_0x192e4d(0x1e3)),process[_0x192e4d(0x1df)](0x0)):(console[_0x192e4d(0x1e7)]('\x0a错误:\x20配置失败\x20-\x20'+_0x4c1331['message']+'\x0a'),process['exit'](0x1));}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5605d1,_0x1f3dc6){const _0x3a40e8=a58_0x44e6,_0x33d6a7=_0x5605d1();while(!![]){try{const _0xe8b7d7=-parseInt(_0x3a40e8(0x1e5))/0x1+-parseInt(_0x3a40e8(0x1f0))/0x2+parseInt(_0x3a40e8(0x1d2))/0x3+-parseInt(_0x3a40e8(0x1eb))/0x4+parseInt(_0x3a40e8(0x1d0))/0x5+parseInt(_0x3a40e8(0x1ce))/0x6+parseInt(_0x3a40e8(0x1d1))/0x7;if(_0xe8b7d7===_0x1f3dc6)break;else _0x33d6a7['push'](_0x33d6a7['shift']());}catch(_0x1008e7){_0x33d6a7['push'](_0x33d6a7['shift']());}}}(a58_0x4db6,0x58381));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';import{createInterface}from'node:readline';function a58_0x44e6(_0x9f9b52,_0x49994e){_0x9f9b52=_0x9f9b52-0x1cd;const _0x4db6f3=a58_0x4db6();let _0x44e674=_0x4db6f3[_0x9f9b52];return _0x44e674;}function a58_0x4db6(){const _0x3b9497=['has','\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','不支持的命令:\x20','\x0a📦\x20正在配置\x20','请输入编号选择\x20IDE:\x0a','length','1787898ZGxmds','description','1865175UCQYxe','2036629IftuUA','795903NpxYzx','exit','(空)','from','\x0a已取消配置\x0a','\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','error','help','\x0a请选择要配置\x20MCP\x20的\x20IDE:\x0a','mcp-install','mcpClaude','\x20之间的数字\x0a','claude','join','stdin','stdout','message','请选择:\x20','quit','219577OnPbWj','forEach','cursor','close','配置失败','name','1355148BtksrB','错误:\x20不支持的命令:\x20','toLowerCase','log','cwd','615114MwCdqp','trim','mcp','question','install','map','\x20-\x20','--help'];a58_0x4db6=function(){return _0x3b9497;};return a58_0x4db6();}import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';export async function mcpCommand(_0x2ed278,_0xf3b409,_0x2fcab8){const _0x51fd1e=a58_0x44e6;logger['setLogPath'](process[_0x51fd1e(0x1ef)]());if(_0x2fcab8?.[_0x51fd1e(0x1d9)]||_0x2ed278===_0x51fd1e(0x1f7)){showHelp();return;}_0x2ed278!==_0x51fd1e(0x1f4)&&(console[_0x51fd1e(0x1d8)](_0x51fd1e(0x1ec)+(_0x2ed278||_0x51fd1e(0x1d4))),console[_0x51fd1e(0x1ee)]('\x0a可用命令:'),console[_0x51fd1e(0x1ee)]('\x20\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并配置\x20MCP'),console['log']('\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a'),logger[_0x51fd1e(0x1d8)](_0x51fd1e(0x1f2),_0x51fd1e(0x1fa)+_0x2ed278),process[_0x51fd1e(0x1d3)](0x1));let _0x2b2e15;if(_0x2fcab8?.['mcpCursor'])_0x2b2e15='cursor';else{if(_0x2fcab8?.[_0x51fd1e(0x1dc)])_0x2b2e15=_0x51fd1e(0x1de);else{if(_0xf3b409?.[0x0]){const _0x2a83d1=_0xf3b409[0x0][_0x51fd1e(0x1ed)]();MCP_IDES[_0x51fd1e(0x1f8)](_0x2a83d1)&&(_0x2b2e15=_0x2a83d1);}}}await installMcp(_0x2b2e15);}function showHelp(){const _0x3c2d9f=a58_0x44e6;console['log'](_0x3c2d9f(0x1d7)+Array[_0x3c2d9f(0x1d5)](MCP_IDES)[_0x3c2d9f(0x1f5)]((_0x5abcd5,_0x570baa)=>'\x20\x20'+(_0x570baa+0x1)+'.\x20'+IDE_CONFIGS[_0x5abcd5][_0x3c2d9f(0x1ea)]+_0x3c2d9f(0x1f6)+IDE_CONFIGS[_0x5abcd5][_0x3c2d9f(0x1cf)])[_0x3c2d9f(0x1df)]('\x0a')+_0x3c2d9f(0x1f9));}async function selectIDE(){const _0x40543b=a58_0x44e6;console[_0x40543b(0x1ee)](_0x40543b(0x1da));const _0x3bf265=Array[_0x40543b(0x1d5)](MCP_IDES);return _0x3bf265[_0x40543b(0x1e6)]((_0xd5fab6,_0x26bd18)=>{const _0x468d3d=_0x40543b;console[_0x468d3d(0x1ee)]('\x20\x20'+(_0x26bd18+0x1)+'.\x20'+IDE_CONFIGS[_0xd5fab6]['name']+_0x468d3d(0x1f6)+IDE_CONFIGS[_0xd5fab6]['description']);}),console[_0x40543b(0x1ee)]('\x20\x20q.\x20取消\x0a'),console[_0x40543b(0x1ee)](_0x40543b(0x1fc)),new Promise(_0x3bed1e=>{const _0x351c33=_0x40543b,_0x16653f=createInterface({'input':process[_0x351c33(0x1e0)],'output':process[_0x351c33(0x1e1)]});_0x16653f[_0x351c33(0x1f3)](_0x351c33(0x1e3),_0x43677e=>{const _0x1737c9=_0x351c33;_0x16653f[_0x1737c9(0x1e8)]();const _0x1eda65=_0x43677e[_0x1737c9(0x1f1)]()['toLowerCase']();(_0x1eda65==='q'||_0x1eda65===_0x1737c9(0x1e4)||_0x1eda65===_0x1737c9(0x1d3))&&(console['log'](_0x1737c9(0x1d6)),process[_0x1737c9(0x1d3)](0x0));const _0xa2b32e=parseInt(_0x1eda65,0xa);if(!isNaN(_0xa2b32e)&&_0xa2b32e>=0x1&&_0xa2b32e<=_0x3bf265['length']){const _0x5bae03=_0x3bf265[_0xa2b32e-0x1];_0x5bae03&&_0x3bed1e(_0x5bae03);return;}console[_0x1737c9(0x1ee)]('\x0a无效的选择,请输入\x201-'+_0x3bf265[_0x1737c9(0x1cd)]+_0x1737c9(0x1dd)),process[_0x1737c9(0x1d3)](0x1);});});}async function installMcp(_0x5aaa63){const _0x44a620=a58_0x44e6;let _0x1d620e;!_0x5aaa63?_0x1d620e=await selectIDE():_0x1d620e=_0x5aaa63;try{const _0xeb878a=IDE_CONFIGS[_0x1d620e];console[_0x44a620(0x1ee)](_0x44a620(0x1fb)+_0xeb878a[_0x44a620(0x1ea)]+'\x20MCP...\x0a');switch(_0x1d620e){case _0x44a620(0x1e7):await configureCursorMcp();break;case _0x44a620(0x1de):await configureClaudeMcp();break;}}catch(_0x21aacb){logger[_0x44a620(0x1d8)](_0x44a620(0x1db),_0x44a620(0x1e9),{'error':_0x21aacb instanceof Error?_0x21aacb[_0x44a620(0x1e2)]:String(_0x21aacb)}),console[_0x44a620(0x1d8)]('\x0a错误:\x20配置失败\x20-\x20'+(_0x21aacb instanceof Error?_0x21aacb['message']:String(_0x21aacb))+'\x0a'),process[_0x44a620(0x1d3)](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x29cac8,_0x1b3bac){const _0x39ce64=a59_0x4fea,_0xc5df02=_0x29cac8();while(!![]){try{const _0x5d83e6=-parseInt(_0x39ce64(0xa4))/0x1*(-parseInt(_0x39ce64(0xa8))/0x2)+parseInt(_0x39ce64(0xa5))/0x3+-parseInt(_0x39ce64(0xa7))/0x4+parseInt(_0x39ce64(0x9e))/0x5*(-parseInt(_0x39ce64(0x97))/0x6)+parseInt(_0x39ce64(0xa2))/0x7*(-parseInt(_0x39ce64(0x9d))/0x8)+parseInt(_0x39ce64(0x99))/0x9+-parseInt(_0x39ce64(0xa6))/0xa*(-parseInt(_0x39ce64(0x9b))/0xb);if(_0x5d83e6===_0x1b3bac)break;else _0xc5df02['push'](_0xc5df02['shift']());}catch(_0x953745){_0xc5df02['push'](_0xc5df02['shift']());}}}(a59_0x784c,0x2bb04));import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';import{logger}from'../utils/logger.js';function a59_0x784c(){const _0x5d7dba=['\x20成功)','setLogPath','35TVHVSQ','message','2wOexdM','460980FGvKom','190AUuibf','427424DJtRbD','169256SJQtIW','length','info','其他\x20IDE','needsManualAction','\x20MCP\x20配置成功','error','success','other','some','\x0a✗\x20','\x0a✓\x20','\x20MCP\x20配置失败:\x20','33438QzBuQL','cursor','481599eVqmOf','filter','249238flsYeo','mcp-install-non-interactive','387960brXyYn','250FJruId','log'];a59_0x784c=function(){return _0x5d7dba;};return a59_0x784c();}function a59_0x4fea(_0x353005,_0x4d4a7e){_0x353005=_0x353005-0x91;const _0x784c5f=a59_0x784c();let _0x4fea50=_0x784c5f[_0x353005];return _0x4fea50;}export async function installMcpNonInteractive(_0x4d0972,_0x3f04e6=process['cwd']()){const _0x147331=a59_0x4fea;logger[_0x147331(0xa1)](_0x3f04e6),logger[_0x147331(0xaa)](_0x147331(0x9c),'开始配置\x20MCP',{'ides':_0x4d0972});const _0x2682eb=[];for(const _0x509da4 of _0x4d0972){try{let _0x236ce6;switch(_0x509da4){case'cursor':_0x236ce6=await configureCursorMcp(_0x3f04e6);break;case'claude':_0x236ce6=configureClaudeMcp(_0x3f04e6);break;case _0x147331(0x92):_0x236ce6=showOtherMcpGuide(_0x3f04e6);break;default:_0x236ce6={'success':![],'message':'未知的\x20IDE:\x20'+_0x509da4};}_0x2682eb['push'](_0x236ce6);if(_0x236ce6[_0x147331(0x91)]){const _0x1386f8=_0x509da4===_0x147331(0x98)?'Cursor':_0x509da4==='claude'?'Claude\x20Code':_0x147331(0xab);console[_0x147331(0x9f)](_0x147331(0x95)+_0x1386f8+_0x147331(0xad)),console['log']('\x20\x20'+_0x236ce6[_0x147331(0xa3)]);}else console[_0x147331(0xae)]('\x0a✗\x20'+_0x509da4+_0x147331(0x96)+_0x236ce6[_0x147331(0xa3)]);}catch(_0x5ee7c6){console[_0x147331(0xae)](_0x147331(0x94)+_0x509da4+_0x147331(0x96)+(_0x5ee7c6 instanceof Error?_0x5ee7c6[_0x147331(0xa3)]:String(_0x5ee7c6)));}}const _0x4d8db1=_0x2682eb[_0x147331(0x9a)](_0x1a2da5=>_0x1a2da5['success'])[_0x147331(0xa9)],_0xe05d6c=_0x2682eb[_0x147331(0xa9)];console['log']('\x0a✓\x20MCP\x20配置完成\x20('+_0x4d8db1+'/'+_0xe05d6c+_0x147331(0xa0));const _0x5bfc37=_0x2682eb[_0x147331(0x93)](_0x1acfae=>_0x1acfae[_0x147331(0xac)]);_0x5bfc37&&console[_0x147331(0x9f)]('\x0a注意:部分配置需要手动执行命令,请按照上述说明操作');}
|