@lovrabet/cli 1.1.22 → 1.1.25

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.
Files changed (56) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/valid-url.js +1 -1
  16. package/lib/auth/auth-server-ui.js +1 -1
  17. package/lib/auth/auth-server.js +1 -1
  18. package/lib/auth/constant.js +1 -1
  19. package/lib/auth/get-cookie.js +1 -1
  20. package/lib/auth/is-session-valid.js +1 -1
  21. package/lib/auth/logout.js +1 -1
  22. package/lib/cli.js +1 -1
  23. package/lib/cmd/build-watch.js +1 -1
  24. package/lib/cmd/build.js +1 -1
  25. package/lib/cmd/logs.js +1 -1
  26. package/lib/cmd/preview.js +1 -1
  27. package/lib/cmd/start.js +1 -1
  28. package/lib/config/config-help.js +1 -1
  29. package/lib/config/main.js +1 -1
  30. package/lib/constant/domain.js +1 -1
  31. package/lib/constant/env.js +1 -1
  32. package/lib/create-app/enhanced-guided-create.js +1 -1
  33. package/lib/create-app/format-elapsed.js +1 -1
  34. package/lib/create-app/main.js +1 -1
  35. package/lib/create-app/task-finished.js +1 -1
  36. package/lib/create-app/task-loading.js +1 -1
  37. package/lib/create-app/task-running.js +1 -1
  38. package/lib/create-app/task-time.js +1 -1
  39. package/lib/create-app/use-copy-project-template.js +1 -1
  40. package/lib/create-app/use-format-code.js +1 -1
  41. package/lib/create-app/use-install-dependencies.js +1 -1
  42. package/lib/help.js +1 -1
  43. package/lib/init/main.js +1 -1
  44. package/lib/mcp/cursor.js +1 -1
  45. package/lib/mcp/main.js +1 -1
  46. package/lib/utils/config.js +1 -1
  47. package/lib/utils/copy-directory.js +1 -1
  48. package/lib/utils/http-client.js +1 -1
  49. package/lib/utils/logger.js +1 -1
  50. package/lib/utils/router-updater.js +1 -1
  51. package/lib/utils/sleep.js +1 -1
  52. package/lib/utils/template-replacer.js +1 -1
  53. package/package.json +1 -1
  54. package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
  55. package/templates/projects/sub-app-react-demo/package.json +1 -1
  56. package/templates/rules/lovrabet_rules.mdc.tpl +181 -115
@@ -1 +1 @@
1
- (function(_0x1dc794,_0x112044){const _0x317916=a32_0x2be4,_0x3ac2ae=_0x1dc794();while(!![]){try{const _0x3ca3cf=-parseInt(_0x317916(0x137))/0x1*(parseInt(_0x317916(0x14a))/0x2)+-parseInt(_0x317916(0x117))/0x3+-parseInt(_0x317916(0x150))/0x4+parseInt(_0x317916(0x12b))/0x5+-parseInt(_0x317916(0x120))/0x6+-parseInt(_0x317916(0x145))/0x7*(-parseInt(_0x317916(0x130))/0x8)+parseInt(_0x317916(0x134))/0x9*(parseInt(_0x317916(0x11d))/0xa);if(_0x3ca3cf===_0x112044)break;else _0x3ac2ae['push'](_0x3ac2ae['shift']());}catch(_0x1f6b04){_0x3ac2ae['push'](_0x3ac2ae['shift']());}}}(a32_0x3763,0x636c0));import{jsx as a32_0x500300,jsxs as a32_0x1febb8,Fragment as a32_0x215995}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';function a32_0x3763(){const _0x14dd80=['登录失败','online','2234964SBFdlm','delete','api-pull','*\x20项目名:\x20','column','test','10YbHvvK','creating','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','582810qnnwgE','red','应用AppCode不合法','[可选]:\x20','login-process','已登录','project-name','项目名不合法','跳过登录','login','my-app','1116570cMUGpp','Yes','label','!\x20未检测到有效登录','string','5136VRhrGJ','\x20登录中...','应用AppCode长度不能超过\x20100\x20个字符','backspace','11335914mGADxP','length','*\x20正在检查登录状态...','249rTYzZj','登录状态','√\x20检测到有效登录状态','项目名','return','cyan','trim','confirm-api-pull','app-code','green','*\x20是否要自动拉取\x20API\x20配置?','\x20检查中...','login-prompt','*\x20是否要先登录以便拉取\x20API\x20配置?','7819jtqOVy','\x20\x20使用\x20←→\x20选择,回车确认','\x20←\x20','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','2328nQbpDH','\x20直接回车确认,或输入自定义名称','value','gray','yellow','env','2643132PMxMZv','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','应用AppCode','step','拉取API配置','login-check','slice','includes','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'];a32_0x3763=function(){return _0x14dd80;};return a32_0x3763();}import{authServer}from'../auth/auth-server.js';function a32_0x2be4(_0x53631b,_0x38bf49){const _0x376331=a32_0x3763();return a32_0x2be4=function(_0x2be41d,_0x55f108){_0x2be41d=_0x2be41d-0x116;let _0x267daf=_0x376331[_0x2be41d];return _0x267daf;},a32_0x2be4(_0x53631b,_0x38bf49);}import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0xfcde){const _0x28bbbf=a32_0x2be4,{onCreate:_0x6e9f8d,env:_0x34af7a}=_0xfcde,[_0x39ec72,_0x2191e8]=useState(_0x28bbbf(0x126)),[_0xe39ab7,_0x103fad]=useState(''),[_0x3b76a2,_0x48b323]=useState(''),[_0x356871,_0x21e417]=useState(''),[_0x3ee369,_0x1c78cb]=useState(''),[_0x47b387,_0x51b3a0]=useState([]),[_0x15f51a,_0x142329]=useState(null),[_0x1fc65f,_0x3bc2a7]=useState(![]),[_0x3ed53d,_0x3cb38e]=useState(![]),[_0x528a11,_0x3ebfc0]=useState(![]),[_0x3fbfb1,_0x527193]=useState(0x0),[_0x15248c,_0x4b9b86]=useState(0x0),_0x2314cf=_0x28bbbf(0x12a),_0x4eae82=readConfig(),_0x2748b6=typeof _0x4eae82[_0x28bbbf(0x14f)]===_0x28bbbf(0x12f)?_0x4eae82[_0x28bbbf(0x14f)]:undefined;function _0xa3b094(_0x458582){const _0x52b868=_0x28bbbf;if(_0x458582[_0x52b868(0x135)]>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x57d914=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x458582?.[_0x52b868(0x13d)]()&&!_0x57d914[_0x52b868(0x11c)](_0x458582))return{'valid':![],'message':_0x52b868(0x149)};return{'valid':!![]};}function _0x416a57(_0x4b9133){const _0x4bab6e=_0x28bbbf;if(!_0x4b9133[_0x4bab6e(0x13d)]())return{'valid':!![]};if(_0x4b9133['length']>0x64)return{'valid':![],'message':_0x4bab6e(0x132)};const _0x4c1adf=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x4c1adf[_0x4bab6e(0x11c)](_0x4b9133))return{'valid':![],'message':_0x4bab6e(0x11f)};return{'valid':!![]};}async function _0x5558b4(){_0x3bc2a7(!![]);try{const _0x584a9a=await getIsSessionValid();return _0x142329(_0x584a9a),_0x584a9a;}catch(_0x1c1f84){return _0x142329(![]),![];}finally{_0x3bc2a7(![]);}}async function _0x3fe4c9(){_0x3cb38e(!![]);try{const _0x16bc61=await authServer({'silent':!![]});return _0x142329(_0x16bc61),_0x16bc61;}catch(_0x56bfb6){return _0x142329(![]),![];}finally{_0x3cb38e(![]);}}return useInput(async(_0x29cea7,_0x1aee79)=>{const _0x5348e3=_0x28bbbf;if(_0x1aee79['leftArrow']||_0x1aee79['rightArrow']){if(_0x39ec72==='confirm-api-pull'){_0x527193(_0x187d79=>_0x187d79===0x0?0x1:0x0);return;}if(_0x39ec72===_0x5348e3(0x143)){_0x4b9b86(_0x145606=>_0x145606===0x0?0x1:0x0);return;}}if(_0x1aee79[_0x5348e3(0x13b)]){if(_0x39ec72===_0x5348e3(0x126)){const _0x56aa62=_0x356871['trim']()||_0x2314cf;if(_0x3ee369)return;_0x103fad(_0x56aa62),_0x51b3a0([{'step':'project-name','label':_0x5348e3(0x13a),'value':_0x56aa62}]),_0x21e417(''),_0x1c78cb(''),_0x2191e8(_0x5348e3(0x13f));return;}if(_0x39ec72==='app-code'){if(_0x3ee369)return;const _0x263e29=_0x356871[_0x5348e3(0x13d)]();_0x48b323(_0x263e29),_0x51b3a0(_0x1152a4=>[..._0x1152a4,{'step':'app-code','label':_0x5348e3(0x152),'value':_0x263e29||'未设置'}]),_0x21e417(''),_0x1c78cb('');if(_0x263e29){_0x2191e8(_0x5348e3(0x155));const _0x271095=await _0x5558b4();_0x271095?_0x2191e8(_0x5348e3(0x13e)):_0x2191e8(_0x5348e3(0x143));}else{const _0x32616b=_0x34af7a||_0x2748b6||'online';_0x6e9f8d({'projectName':_0xe39ab7,'appCode':undefined,'pullApi':![],'env':_0x32616b}),_0x2191e8('creating');}return;}if(_0x39ec72===_0x5348e3(0x13e)){const _0x15aa17=_0x3fbfb1===0x0;_0x3ebfc0(_0x15aa17),_0x51b3a0(_0x54483c=>[..._0x54483c,{'step':_0x5348e3(0x119),'label':_0x5348e3(0x154),'value':_0x15aa17?'是':'否'}]);const _0x583856=_0x34af7a||_0x2748b6||'online';_0x6e9f8d({'projectName':_0xe39ab7,'appCode':_0x3b76a2,'pullApi':_0x15aa17,'env':_0x583856}),_0x2191e8(_0x5348e3(0x11e));return;}if(_0x39ec72===_0x5348e3(0x143)){const _0x3bc47e=_0x15248c===0x0;if(_0x3bc47e){_0x2191e8(_0x5348e3(0x124));const _0x573b72=await _0x3fe4c9();if(_0x573b72)_0x51b3a0(_0x39b075=>[..._0x39b075,{'step':_0x5348e3(0x129),'label':_0x5348e3(0x138),'value':_0x5348e3(0x125)}]),_0x2191e8(_0x5348e3(0x13e));else{_0x51b3a0(_0x5d6543=>[..._0x5d6543,{'step':_0x5348e3(0x129),'label':_0x5348e3(0x138),'value':_0x5348e3(0x159)}]);const _0xf08a18=_0x34af7a||_0x2748b6||'online';_0x6e9f8d({'projectName':_0xe39ab7,'appCode':_0x3b76a2,'pullApi':![],'env':_0xf08a18}),_0x2191e8('creating');}}else{_0x51b3a0(_0x35dc6b=>[..._0x35dc6b,{'step':'login','label':'登录状态','value':_0x5348e3(0x128)}]);const _0x518caf=_0x34af7a||_0x2748b6||_0x5348e3(0x116);_0x6e9f8d({'projectName':_0xe39ab7,'appCode':_0x3b76a2,'pullApi':![],'env':_0x518caf}),_0x2191e8(_0x5348e3(0x11e));}return;}}if(_0x1aee79[_0x5348e3(0x133)]||_0x1aee79[_0x5348e3(0x118)]){_0x21e417(_0x2b62fe=>{const _0x1dbbcd=_0x5348e3,_0x2fb834=_0x2b62fe[_0x1dbbcd(0x156)](0x0,-0x1);if(_0x39ec72===_0x1dbbcd(0x126)){const {valid:_0x182895,message:_0x5e9076}=_0xa3b094(_0x2fb834);_0x1c78cb(_0x182895?'':_0x5e9076||_0x1dbbcd(0x127));}else{if(_0x39ec72===_0x1dbbcd(0x13f)){const {valid:_0x5743eb,message:_0x4ec837}=_0x416a57(_0x2fb834);_0x1c78cb(_0x5743eb?'':_0x4ec837||'应用AppCode不合法');}}return _0x2fb834;});return;}if(['creating','login-check','login-process'][_0x5348e3(0x157)](_0x39ec72))return;if(_0x39ec72===_0x5348e3(0x13e)||_0x39ec72==='login-prompt')return;_0x21e417(_0x4d2192=>{const _0x11ec94=_0x5348e3,_0x2c2d3b=_0x4d2192+_0x29cea7;if(_0x39ec72==='project-name'){const {valid:_0x3b47d5,message:_0x34452a}=_0xa3b094(_0x2c2d3b);_0x1c78cb(_0x3b47d5?'':_0x34452a||'项目名不合法');}else{if(_0x39ec72===_0x11ec94(0x13f)){const {valid:_0x3d76bf,message:_0x32e728}=_0x416a57(_0x2c2d3b);_0x1c78cb(_0x3d76bf?'':_0x32e728||_0x11ec94(0x122));}}return _0x2c2d3b;});}),a32_0x1febb8(Box,{'flexDirection':_0x28bbbf(0x11b),'marginTop':0x1,'children':[_0x47b387[_0x28bbbf(0x135)]===0x0&&a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x13c),'children':'*\x20创建新项目'})}),_0x47b387['map'](_0x1cb5ac=>a32_0x1febb8(Box,{'children':[a32_0x1febb8(Text,{'color':_0x28bbbf(0x140),'children':['√\x20',_0x1cb5ac[_0x28bbbf(0x12d)],':\x20']}),a32_0x500300(Text,{'color':_0x28bbbf(0x13c),'children':_0x1cb5ac[_0x28bbbf(0x14c)]})]},_0x1cb5ac[_0x28bbbf(0x153)])),_0x39ec72===_0x28bbbf(0x126)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':_0x28bbbf(0x11a)}),_0x356871?a32_0x500300(Text,{'color':_0x28bbbf(0x140),'children':_0x356871}):a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x2314cf}),_0x3ee369&&a32_0x1febb8(Text,{'color':_0x28bbbf(0x121),'children':[_0x28bbbf(0x147),_0x3ee369]})]}),!_0x3ee369&&!_0x356871&&a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':'gray','children':_0x28bbbf(0x14b)})})]}),_0x39ec72===_0x28bbbf(0x13f)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':'*\x20应用AppCode\x20'}),a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x123)}),a32_0x500300(Text,{'color':_0x28bbbf(0x140),'children':_0x356871}),_0x3ee369&&a32_0x1febb8(Text,{'color':'red','children':[_0x28bbbf(0x147),_0x3ee369]})]}),!_0x3ee369&&a32_0x500300(Box,{'children':a32_0x1febb8(Text,{'color':_0x28bbbf(0x14d),'children':['\x20',_0x28bbbf(0x148)]})})]}),_0x39ec72===_0x28bbbf(0x155)&&a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':_0x28bbbf(0x136)}),_0x1fc65f&&a32_0x500300(Text,{'color':'gray','children':_0x28bbbf(0x142)})]}),_0x39ec72===_0x28bbbf(0x13e)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x140),'children':_0x28bbbf(0x139)})}),a32_0x500300(Box,{'marginTop':0x1,'children':a32_0x500300(Text,{'children':_0x28bbbf(0x141)})}),a32_0x1febb8(Box,{'marginLeft':0x2,'children':[a32_0x1febb8(Text,{'color':_0x3fbfb1===0x0?_0x28bbbf(0x140):_0x28bbbf(0x14d),'children':[_0x3fbfb1===0x0?'▶\x20':'\x20\x20','Yes']}),a32_0x500300(Text,{'children':'\x20'}),a32_0x1febb8(Text,{'color':_0x3fbfb1===0x1?'green':_0x28bbbf(0x14d),'children':[_0x3fbfb1===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x146)})}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':'yellow','children':_0x28bbbf(0x158)})})]}),_0x39ec72===_0x28bbbf(0x143)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14e),'children':_0x28bbbf(0x12e)})}),a32_0x500300(Box,{'marginTop':0x1,'children':a32_0x500300(Text,{'children':_0x28bbbf(0x144)})}),a32_0x1febb8(Box,{'marginLeft':0x2,'children':[a32_0x1febb8(Text,{'color':_0x15248c===0x0?_0x28bbbf(0x140):_0x28bbbf(0x14d),'children':[_0x15248c===0x0?'▶\x20':'\x20\x20',_0x28bbbf(0x12c)]}),a32_0x500300(Text,{'children':'\x20'}),a32_0x1febb8(Text,{'color':_0x15248c===0x1?'green':'gray','children':[_0x15248c===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x146)})}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14e),'children':_0x28bbbf(0x151)})})]}),_0x39ec72===_0x28bbbf(0x124)&&a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x3ed53d&&a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x131)})]})]});}
1
+ (function(_0x54f243,_0x373c0a){const _0x2f2eab=a32_0x24d3,_0x3458da=_0x54f243();while(!![]){try{const _0x5bca20=parseInt(_0x2f2eab(0x137))/0x1*(parseInt(_0x2f2eab(0x108))/0x2)+parseInt(_0x2f2eab(0x145))/0x3*(parseInt(_0x2f2eab(0x11a))/0x4)+-parseInt(_0x2f2eab(0x143))/0x5+-parseInt(_0x2f2eab(0x136))/0x6*(-parseInt(_0x2f2eab(0x147))/0x7)+-parseInt(_0x2f2eab(0x127))/0x8*(parseInt(_0x2f2eab(0x13e))/0x9)+parseInt(_0x2f2eab(0x110))/0xa+parseInt(_0x2f2eab(0x122))/0xb;if(_0x5bca20===_0x373c0a)break;else _0x3458da['push'](_0x3458da['shift']());}catch(_0x1f3376){_0x3458da['push'](_0x3458da['shift']());}}}(a32_0x9f8d,0xd30f2));import{jsx as a32_0x50de20,jsxs as a32_0x4caf45,Fragment as a32_0xfec4d2}from'react/jsx-runtime';function a32_0x24d3(_0x6abb69,_0x385381){const _0x9f8d15=a32_0x9f8d();return a32_0x24d3=function(_0x24d331,_0x11114f){_0x24d331=_0x24d331-0x107;let _0x3219aa=_0x9f8d15[_0x24d331];return _0x3219aa;},a32_0x24d3(_0x6abb69,_0x385381);}function a32_0x9f8d(){const _0x3a1bb4=['跳过登录','*\x20是否要先登录以便拉取\x20API\x20配置?','project-name','gray','my-app','6038978anwzNn','\x20检查中...','*\x20正在检查登录状态...','应用AppCode不合法','项目名不合法','153776lserIS','trim','未设置','length','√\x20检测到有效登录状态','已登录','slice','登录状态','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','login-check','Yes','creating','test','label','delete','4232310rzEEMv','91193WXLAqu','login-prompt','api-pull','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','cyan','*\x20创建新项目','return','792PnFVCS','column','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','\x20←\x20','includes','6681465yfMIKe','yellow','6507TEBSOS','login','7LojlBM','online','confirm-api-pull','app-code','24VTFNJU','*\x20项目名:\x20','\x20\x20使用\x20←→\x20选择,回车确认','string','!\x20未检测到有效登录','项目名长度不能超过\x2050\x20个字符','leftArrow','\x20登录中...','10903070zKvaTo','login-process','map','green','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','应用AppCode长度不能超过\x20100\x20个字符','拉取API配置','red','*\x20应用AppCode\x20','\x20直接回车确认,或输入自定义名称','836rGjjKQ','env','value'];a32_0x9f8d=function(){return _0x3a1bb4;};return a32_0x9f8d();}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x3363ae){const _0x95e81=a32_0x24d3,{onCreate:_0x57ed31,env:_0x1b57c9}=_0x3363ae,[_0xa8886d,_0x1d5034]=useState(_0x95e81(0x11f)),[_0x317c96,_0x47d84b]=useState(''),[_0x28b4da,_0x1ca873]=useState(''),[_0x44813a,_0x1eb891]=useState(''),[_0x16872b,_0x38e9bd]=useState(''),[_0x465187,_0x551602]=useState([]),[_0x1f5267,_0x47a5e2]=useState(null),[_0x2d44e1,_0x178d8f]=useState(![]),[_0x435157,_0x52c646]=useState(![]),[_0x58b265,_0x29f6a]=useState(![]),[_0x47502b,_0x445869]=useState(0x0),[_0x16b30c,_0xdb4bb6]=useState(0x0),_0x49353a=_0x95e81(0x121),_0x3b0860=readConfig(),_0x14d3c3=typeof _0x3b0860[_0x95e81(0x11b)]===_0x95e81(0x10b)?_0x3b0860[_0x95e81(0x11b)]:undefined;function _0x9388c8(_0x33aba2){const _0x565571=_0x95e81;if(_0x33aba2[_0x565571(0x12a)]>0x32)return{'valid':![],'message':_0x565571(0x10d)};const _0x5bf504=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x33aba2?.[_0x565571(0x128)]()&&!_0x5bf504[_0x565571(0x133)](_0x33aba2))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x4ae30c(_0x1447f){const _0x228e28=_0x95e81;if(!_0x1447f['trim']())return{'valid':!![]};if(_0x1447f[_0x228e28(0x12a)]>0x64)return{'valid':![],'message':_0x228e28(0x115)};const _0x20d47e=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x20d47e[_0x228e28(0x133)](_0x1447f))return{'valid':![],'message':_0x228e28(0x13a)};return{'valid':!![]};}async function _0x125e75(){_0x178d8f(!![]);try{const _0x44d0bd=await getIsSessionValid();return _0x47a5e2(_0x44d0bd),_0x44d0bd;}catch(_0x10ec2f){return _0x47a5e2(![]),![];}finally{_0x178d8f(![]);}}async function _0x5409ac(){_0x52c646(!![]);try{const _0x572263=await authServer({'silent':!![]});return _0x47a5e2(_0x572263),_0x572263;}catch(_0x187627){return _0x47a5e2(![]),![];}finally{_0x52c646(![]);}}return useInput(async(_0x326add,_0xa7b0b2)=>{const _0x2a811b=_0x95e81;if(_0xa7b0b2[_0x2a811b(0x10e)]||_0xa7b0b2['rightArrow']){if(_0xa8886d==='confirm-api-pull'){_0x445869(_0x58e8c9=>_0x58e8c9===0x0?0x1:0x0);return;}if(_0xa8886d===_0x2a811b(0x138)){_0xdb4bb6(_0x49c50b=>_0x49c50b===0x0?0x1:0x0);return;}}if(_0xa7b0b2[_0x2a811b(0x13d)]){if(_0xa8886d==='project-name'){const _0x252cc1=_0x44813a[_0x2a811b(0x128)]()||_0x49353a;if(_0x16872b)return;_0x47d84b(_0x252cc1),_0x551602([{'step':_0x2a811b(0x11f),'label':'项目名','value':_0x252cc1}]),_0x1eb891(''),_0x38e9bd(''),_0x1d5034(_0x2a811b(0x107));return;}if(_0xa8886d===_0x2a811b(0x107)){if(_0x16872b)return;const _0x5889cc=_0x44813a[_0x2a811b(0x128)]();_0x1ca873(_0x5889cc),_0x551602(_0x31e14e=>[..._0x31e14e,{'step':'app-code','label':'应用AppCode','value':_0x5889cc||_0x2a811b(0x129)}]),_0x1eb891(''),_0x38e9bd('');if(_0x5889cc){_0x1d5034(_0x2a811b(0x130));const _0x3d38d1=await _0x125e75();_0x3d38d1?_0x1d5034('confirm-api-pull'):_0x1d5034(_0x2a811b(0x138));}else{const _0x20863d=_0x1b57c9||_0x14d3c3||'online';_0x57ed31({'projectName':_0x317c96,'appCode':undefined,'pullApi':![],'env':_0x20863d}),_0x1d5034(_0x2a811b(0x132));}return;}if(_0xa8886d==='confirm-api-pull'){const _0x3caf7e=_0x47502b===0x0;_0x29f6a(_0x3caf7e),_0x551602(_0x32adfb=>[..._0x32adfb,{'step':_0x2a811b(0x139),'label':_0x2a811b(0x116),'value':_0x3caf7e?'是':'否'}]);const _0x50d024=_0x1b57c9||_0x14d3c3||_0x2a811b(0x148);_0x57ed31({'projectName':_0x317c96,'appCode':_0x28b4da,'pullApi':_0x3caf7e,'env':_0x50d024}),_0x1d5034(_0x2a811b(0x132));return;}if(_0xa8886d===_0x2a811b(0x138)){const _0x11876e=_0x16b30c===0x0;if(_0x11876e){_0x1d5034(_0x2a811b(0x111));const _0x82682c=await _0x5409ac();if(_0x82682c)_0x551602(_0x2a1836=>[..._0x2a1836,{'step':_0x2a811b(0x146),'label':_0x2a811b(0x12e),'value':_0x2a811b(0x12c)}]),_0x1d5034('confirm-api-pull');else{_0x551602(_0x964bad=>[..._0x964bad,{'step':'login','label':_0x2a811b(0x12e),'value':'登录失败'}]);const _0x1fc731=_0x1b57c9||_0x14d3c3||_0x2a811b(0x148);_0x57ed31({'projectName':_0x317c96,'appCode':_0x28b4da,'pullApi':![],'env':_0x1fc731}),_0x1d5034(_0x2a811b(0x132));}}else{_0x551602(_0x1693ef=>[..._0x1693ef,{'step':_0x2a811b(0x146),'label':'登录状态','value':_0x2a811b(0x11d)}]);const _0x11944d=_0x1b57c9||_0x14d3c3||_0x2a811b(0x148);_0x57ed31({'projectName':_0x317c96,'appCode':_0x28b4da,'pullApi':![],'env':_0x11944d}),_0x1d5034('creating');}return;}}if(_0xa7b0b2['backspace']||_0xa7b0b2[_0x2a811b(0x135)]){_0x1eb891(_0x28dfda=>{const _0x2af282=_0x2a811b,_0xb9afa0=_0x28dfda[_0x2af282(0x12d)](0x0,-0x1);if(_0xa8886d===_0x2af282(0x11f)){const {valid:_0x3f7798,message:_0x118a00}=_0x9388c8(_0xb9afa0);_0x38e9bd(_0x3f7798?'':_0x118a00||_0x2af282(0x126));}else{if(_0xa8886d===_0x2af282(0x107)){const {valid:_0x2391a3,message:_0xe6065a}=_0x4ae30c(_0xb9afa0);_0x38e9bd(_0x2391a3?'':_0xe6065a||_0x2af282(0x125));}}return _0xb9afa0;});return;}if(['creating',_0x2a811b(0x130),'login-process'][_0x2a811b(0x142)](_0xa8886d))return;if(_0xa8886d===_0x2a811b(0x149)||_0xa8886d===_0x2a811b(0x138))return;_0x1eb891(_0x2bebe0=>{const _0x15c2b2=_0x2a811b,_0xb0134=_0x2bebe0+_0x326add;if(_0xa8886d==='project-name'){const {valid:_0x3f277f,message:_0x3b6e99}=_0x9388c8(_0xb0134);_0x38e9bd(_0x3f277f?'':_0x3b6e99||_0x15c2b2(0x126));}else{if(_0xa8886d===_0x15c2b2(0x107)){const {valid:_0x12c751,message:_0x48652d}=_0x4ae30c(_0xb0134);_0x38e9bd(_0x12c751?'':_0x48652d||_0x15c2b2(0x125));}}return _0xb0134;});}),a32_0x4caf45(Box,{'flexDirection':_0x95e81(0x13f),'marginTop':0x1,'children':[_0x465187[_0x95e81(0x12a)]===0x0&&a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':'cyan','children':_0x95e81(0x13c)})}),_0x465187[_0x95e81(0x112)](_0xabd4c8=>a32_0x4caf45(Box,{'children':[a32_0x4caf45(Text,{'color':_0x95e81(0x113),'children':['√\x20',_0xabd4c8[_0x95e81(0x134)],':\x20']}),a32_0x50de20(Text,{'color':_0x95e81(0x13b),'children':_0xabd4c8[_0x95e81(0x11c)]})]},_0xabd4c8['step'])),_0xa8886d===_0x95e81(0x11f)&&a32_0x4caf45(a32_0xfec4d2,{'children':[a32_0x4caf45(Box,{'children':[a32_0x50de20(Text,{'children':_0x95e81(0x109)}),_0x44813a?a32_0x50de20(Text,{'color':_0x95e81(0x113),'children':_0x44813a}):a32_0x50de20(Text,{'color':_0x95e81(0x120),'children':_0x49353a}),_0x16872b&&a32_0x4caf45(Text,{'color':_0x95e81(0x117),'children':[_0x95e81(0x141),_0x16872b]})]}),!_0x16872b&&!_0x44813a&&a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':_0x95e81(0x120),'children':_0x95e81(0x119)})})]}),_0xa8886d===_0x95e81(0x107)&&a32_0x4caf45(a32_0xfec4d2,{'children':[a32_0x4caf45(Box,{'children':[a32_0x50de20(Text,{'children':_0x95e81(0x118)}),a32_0x50de20(Text,{'color':'gray','children':'[可选]:\x20'}),a32_0x50de20(Text,{'color':_0x95e81(0x113),'children':_0x44813a}),_0x16872b&&a32_0x4caf45(Text,{'color':'red','children':[_0x95e81(0x141),_0x16872b]})]}),!_0x16872b&&a32_0x50de20(Box,{'children':a32_0x4caf45(Text,{'color':'gray','children':['\x20',_0x95e81(0x114)]})})]}),_0xa8886d===_0x95e81(0x130)&&a32_0x4caf45(Box,{'children':[a32_0x50de20(Text,{'children':_0x95e81(0x124)}),_0x2d44e1&&a32_0x50de20(Text,{'color':_0x95e81(0x120),'children':_0x95e81(0x123)})]}),_0xa8886d===_0x95e81(0x149)&&a32_0x4caf45(a32_0xfec4d2,{'children':[a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':_0x95e81(0x113),'children':_0x95e81(0x12b)})}),a32_0x50de20(Box,{'marginTop':0x1,'children':a32_0x50de20(Text,{'children':'*\x20是否要自动拉取\x20API\x20配置?'})}),a32_0x4caf45(Box,{'marginLeft':0x2,'children':[a32_0x4caf45(Text,{'color':_0x47502b===0x0?'green':_0x95e81(0x120),'children':[_0x47502b===0x0?'▶\x20':'\x20\x20',_0x95e81(0x131)]}),a32_0x50de20(Text,{'children':'\x20'}),a32_0x4caf45(Text,{'color':_0x47502b===0x1?_0x95e81(0x113):_0x95e81(0x120),'children':[_0x47502b===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':_0x95e81(0x120),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':'yellow','children':_0x95e81(0x140)})})]}),_0xa8886d===_0x95e81(0x138)&&a32_0x4caf45(a32_0xfec4d2,{'children':[a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':_0x95e81(0x144),'children':_0x95e81(0x10c)})}),a32_0x50de20(Box,{'marginTop':0x1,'children':a32_0x50de20(Text,{'children':_0x95e81(0x11e)})}),a32_0x4caf45(Box,{'marginLeft':0x2,'children':[a32_0x4caf45(Text,{'color':_0x16b30c===0x0?_0x95e81(0x113):'gray','children':[_0x16b30c===0x0?'▶\x20':'\x20\x20',_0x95e81(0x131)]}),a32_0x50de20(Text,{'children':'\x20'}),a32_0x4caf45(Text,{'color':_0x16b30c===0x1?_0x95e81(0x113):_0x95e81(0x120),'children':[_0x16b30c===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':'gray','children':_0x95e81(0x10a)})}),a32_0x50de20(Box,{'children':a32_0x50de20(Text,{'color':_0x95e81(0x144),'children':_0x95e81(0x12f)})})]}),_0xa8886d===_0x95e81(0x111)&&a32_0x4caf45(Box,{'children':[a32_0x50de20(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x435157&&a32_0x50de20(Text,{'color':_0x95e81(0x120),'children':_0x95e81(0x10f)})]})]});}
@@ -1 +1 @@
1
- (function(_0x417a00,_0x100b47){const _0x4d2671=a33_0x5960,_0x5420a1=_0x417a00();while(!![]){try{const _0x3b42c2=-parseInt(_0x4d2671(0x188))/0x1+-parseInt(_0x4d2671(0x18d))/0x2*(-parseInt(_0x4d2671(0x184))/0x3)+-parseInt(_0x4d2671(0x183))/0x4+parseInt(_0x4d2671(0x185))/0x5+parseInt(_0x4d2671(0x189))/0x6+parseInt(_0x4d2671(0x18c))/0x7*(parseInt(_0x4d2671(0x187))/0x8)+-parseInt(_0x4d2671(0x186))/0x9;if(_0x3b42c2===_0x100b47)break;else _0x5420a1['push'](_0x5420a1['shift']());}catch(_0x1add90){_0x5420a1['push'](_0x5420a1['shift']());}}}(a33_0x5f54,0xa5948));function a33_0x5960(_0x435040,_0x116b93){const _0x5f5498=a33_0x5f54();return a33_0x5960=function(_0x5960ae,_0x2c9ca4){_0x5960ae=_0x5960ae-0x183;let _0x5dce34=_0x5f5498[_0x5960ae];return _0x5dce34;},a33_0x5960(_0x435040,_0x116b93);}function a33_0x5f54(){const _0x2bf94b=['178fWLCoZ','1363776pWgPTA','40344wOfbFj','3862855UyYRPm','6311070SQlQFh','530776uEJBjH','789470TnbgRW','1252092WOGDot','toFixed','replace','35ppUYwK'];a33_0x5f54=function(){return _0x2bf94b;};return a33_0x5f54();}export function formatElapsed(_0x14f705){const _0x3d2934=a33_0x5960,_0xc7b0fc=Date['now']()-_0x14f705;if(_0xc7b0fc<0x3e8)return _0xc7b0fc+'ms';const _0x3aa656=(_0xc7b0fc/0x3e8)[_0x3d2934(0x18a)](0x2),_0x45a09f=_0x3aa656[_0x3d2934(0x18b)](/\.?0+$/u,'');return _0x45a09f+'s';}
1
+ (function(_0x206009,_0x39fe6d){const _0x29ac5d=a33_0x5e77,_0x511783=_0x206009();while(!![]){try{const _0x4f812b=-parseInt(_0x29ac5d(0xa1))/0x1*(-parseInt(_0x29ac5d(0x9c))/0x2)+parseInt(_0x29ac5d(0xa5))/0x3*(-parseInt(_0x29ac5d(0xa8))/0x4)+parseInt(_0x29ac5d(0x9a))/0x5*(parseInt(_0x29ac5d(0x9b))/0x6)+-parseInt(_0x29ac5d(0xa0))/0x7*(parseInt(_0x29ac5d(0x9f))/0x8)+-parseInt(_0x29ac5d(0xa2))/0x9*(-parseInt(_0x29ac5d(0xa3))/0xa)+parseInt(_0x29ac5d(0xa7))/0xb+parseInt(_0x29ac5d(0xa4))/0xc*(-parseInt(_0x29ac5d(0x9d))/0xd);if(_0x4f812b===_0x39fe6d)break;else _0x511783['push'](_0x511783['shift']());}catch(_0x324639){_0x511783['push'](_0x511783['shift']());}}}(a33_0xd98e,0xe191d));function a33_0xd98e(){const _0x478798=['555372oWhhwO','1283642yJDbLx','104hkpHTz','replace','1967744pcKJKV','7FTdfDA','2rIJPGu','18asQzru','1253200ZvFIye','3662328ypnYcb','6dGzdoP','toFixed','16529711TZnVQl','2368416UsODoi','95SCvzAw'];a33_0xd98e=function(){return _0x478798;};return a33_0xd98e();}function a33_0x5e77(_0x3ada5f,_0x3adf37){const _0xd98e1a=a33_0xd98e();return a33_0x5e77=function(_0x5e77d8,_0xcc02e5){_0x5e77d8=_0x5e77d8-0x9a;let _0x4fcbb8=_0xd98e1a[_0x5e77d8];return _0x4fcbb8;},a33_0x5e77(_0x3ada5f,_0x3adf37);}export function formatElapsed(_0x4196ec){const _0x4eca30=a33_0x5e77,_0x16b7a1=Date['now']()-_0x4196ec;if(_0x16b7a1<0x3e8)return _0x16b7a1+'ms';const _0x581a96=(_0x16b7a1/0x3e8)[_0x4eca30(0xa6)](0x2),_0x12ec04=_0x581a96[_0x4eca30(0x9e)](/\.?0+$/u,'');return _0x12ec04+'s';}
@@ -1 +1 @@
1
- (function(_0x3a9b61,_0x13ee8b){const _0x58e31f=a34_0x3c12,_0xc28b24=_0x3a9b61();while(!![]){try{const _0x17769a=parseInt(_0x58e31f(0x83))/0x1+-parseInt(_0x58e31f(0x92))/0x2+parseInt(_0x58e31f(0xa8))/0x3+-parseInt(_0x58e31f(0x82))/0x4+parseInt(_0x58e31f(0xc4))/0x5+parseInt(_0x58e31f(0xd3))/0x6+-parseInt(_0x58e31f(0x97))/0x7;if(_0x17769a===_0x13ee8b)break;else _0xc28b24['push'](_0xc28b24['shift']());}catch(_0x2a1ca7){_0xc28b24['push'](_0xc28b24['shift']());}}}(a34_0x272c,0xe53b8));function a34_0x3c12(_0x3855a4,_0x2befeb){const _0x272c86=a34_0x272c();return a34_0x3c12=function(_0x3c12f0,_0x2ab755){_0x3c12f0=_0x3c12f0-0x82;let _0x2efea9=_0x272c86[_0x3c12f0];return _0x2efea9;},a34_0x3c12(_0x3855a4,_0x2befeb);}import{jsx as a34_0x4ea556,Fragment as a34_0x47651b,jsxs as a34_0x2be763}from'react/jsx-runtime';import a34_0x17f8bf from'node:path';import a34_0x243c10 from'node: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';function a34_0x272c(){const _0x49aeaa=['!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','*\x20配置文件路径:\x20','2.\x20','length','error','create','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','4756836SnMjWo','1.0.0','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','\x20创建配置文件','gray','开始创建项目:\x20','*\x20正在为项目\x20','🎉\x20项目创建成功!','warn','5050668yqkIJy','246840pjCEvg','需手动拉取','*\x20清理失败的项目目录:\x20',',\x20description=','resolve','更新\x20package.json\x20失败:\x20','rmSync','name','message','version','项目名称:\x20','项目创建完成:\x20','appCode','cyan','配置应用AppCode:\x20','2030712QGgnTK','\x20|\x20应用AppCode:\x20','pullApi','projectCode','配置应用AppCode失败:\x20','3230283eCFsge','🚀\x20接下来可以:','setLogPath','\x20Generated\x20by\x20lovrabet\x20cli\x20','string','online','log','info','url','×\x20无法在当前目录创建项目,请检查目录权限','description','projectName','未配置','启动项目:\x20','📦\x20API配置:\x20','\x20√\x20','package.json','3030354oMnmJe','更新\x20package.json\x20name\x20和\x20description\x20字段','parse','API\x20配置拉取成功:\x20','cwd','column','√\x20API\x20配置拉取完成','√\x20配置文件已创建,应用AppCode:\x20','../..','📁\x20项目名称:\x20','accessSync','1.\x20','green','repeat','env','writeFileSync','API\x20配置拉取异常:\x20','W_OK','*\x20正在拉取\x20API\x20配置...','utf8','清理项目目录失败:\x20','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','existsSync','join','dirname','stringify','项目创建失败:\x20','拉取API配置:\x20','8143320bNZSYB','API\x20配置拉取失败:\x20','doTask','constants','×\x20项目名过长,最多支持\x20100\x20个字符','readFileSync','white','cd\x20'];a34_0x272c=function(){return _0x49aeaa;};return a34_0x272c();}import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x5c75ee){const _0x48bf82=a34_0x3c12,[_0x1c4ca3,_0x49ee48]=useState(![]),[_0x197f10,_0x58358d]=useState(![]),[_0x52cc08,_0x26ad68]=useState(null),_0x32307d=useCopyProjectTemplate(),_0x1d2568=useInstallDependencies(),_0x35bf32=useFormatCode(),_0x5f26ea=async _0x651f1f=>{const _0x32da1f=a34_0x3c12;if(!_0x651f1f[_0x32da1f(0xa2)]||_0x651f1f[_0x32da1f(0xa2)]['trim']()===''){console[_0x32da1f(0xd0)]('×\x20项目名不能为空');return;}const _0x51389c=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x51389c['test'](_0x651f1f[_0x32da1f(0xa2)])){console[_0x32da1f(0xd0)]('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0x651f1f['projectName'][_0x32da1f(0xcf)]>0x64){console[_0x32da1f(0xd0)](_0x32da1f(0xc8));return;}const _0x41c6e1=a34_0x17f8bf[_0x32da1f(0x87)](process[_0x32da1f(0xac)](),_0x651f1f[_0x32da1f(0xa2)]);if(a34_0x243c10[_0x32da1f(0xbe)](_0x41c6e1)){console[_0x32da1f(0xd0)]('×\x20项目目录\x20'+_0x651f1f[_0x32da1f(0xa2)]+'\x20已存在,请使用其他项目名');return;}try{const _0x1823a6=a34_0x17f8bf[_0x32da1f(0xc0)](_0x41c6e1);a34_0x243c10[_0x32da1f(0xb2)](_0x1823a6,a34_0x243c10[_0x32da1f(0xc7)][_0x32da1f(0xb9)]);}catch(_0x2268d3){console['error'](_0x32da1f(0xa0));return;}_0x26ad68(_0x651f1f),_0x49ee48(!![]),logger[_0x32da1f(0x99)](_0x41c6e1),logger[_0x32da1f(0x9e)](_0x32da1f(0xd1),_0x32da1f(0xd8)+_0x651f1f['projectName'],{'projectDir':_0x41c6e1,'appCode':_0x651f1f[_0x32da1f(0x8f)]});try{await _0x32307d[_0x32da1f(0xc6)](_0x651f1f[_0x32da1f(0xa2)]),await _0x12f7b1(_0x651f1f['projectName']),await _0x1d2568[_0x32da1f(0xc6)](_0x651f1f['projectName']),await _0x35bf32[_0x32da1f(0xc6)](_0x651f1f[_0x32da1f(0xa2)]),await _0x401260(_0x651f1f[_0x32da1f(0xa2)],_0x651f1f[_0x32da1f(0x8f)]||'',_0x651f1f[_0x32da1f(0xb6)]);if(_0x651f1f[_0x32da1f(0x94)]&&_0x651f1f['appCode']){console[_0x32da1f(0x9d)](_0x32da1f(0xba));try{const _0x26e9ab=await pullApiSilent(_0x651f1f[_0x32da1f(0x8f)],undefined,_0x41c6e1,_0x651f1f[_0x32da1f(0xb6)]);_0x26e9ab?(console['log'](_0x32da1f(0xae)),logger[_0x32da1f(0x9e)](_0x32da1f(0xd1),_0x32da1f(0xab)+_0x651f1f[_0x32da1f(0x8f)],{'projectDir':_0x41c6e1,'appCode':_0x651f1f[_0x32da1f(0x8f)],'env':_0x651f1f['env']})):(console['log'](_0x32da1f(0xcc)),logger[_0x32da1f(0xdb)](_0x32da1f(0xd1),_0x32da1f(0xc5)+_0x651f1f[_0x32da1f(0x8f)],{'projectDir':_0x41c6e1,'appCode':_0x651f1f[_0x32da1f(0x8f)],'env':_0x651f1f[_0x32da1f(0xb6)]}));}catch(_0xc7127a){console[_0x32da1f(0x9d)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x32da1f(0xdb)]('create',_0x32da1f(0xb8)+_0x651f1f[_0x32da1f(0x8f)],{'projectDir':_0x41c6e1,'appCode':_0x651f1f['appCode'],'env':_0x651f1f['env'],'error':_0xc7127a instanceof Error?_0xc7127a[_0x32da1f(0x8b)]:String(_0xc7127a)});}}logger['success'](_0x32da1f(0xd1),_0x32da1f(0x8e)+_0x651f1f[_0x32da1f(0xa2)]),_0x58358d(!![]),_0x49ee48(![]);}catch(_0x46fc5e){logger[_0x32da1f(0xd0)](_0x32da1f(0xd1),_0x32da1f(0xc2)+_0x651f1f[_0x32da1f(0xa2)],{'error':_0x46fc5e instanceof Error?_0x46fc5e[_0x32da1f(0x8b)]:String(_0x46fc5e)});try{a34_0x243c10[_0x32da1f(0xbe)](_0x41c6e1)&&(console[_0x32da1f(0x9d)](_0x32da1f(0x85)+_0x41c6e1),a34_0x243c10[_0x32da1f(0x89)](_0x41c6e1,{'recursive':!![],'force':!![]}));}catch(_0xb41ae2){logger['warn'](_0x32da1f(0xd1),_0x32da1f(0xbc)+_0x41c6e1,{'error':_0xb41ae2 instanceof Error?_0xb41ae2[_0x32da1f(0x8b)]:String(_0xb41ae2)});}_0x49ee48(![]),console[_0x32da1f(0xd0)]('×\x20项目创建失败:\x20'+(_0x46fc5e instanceof Error?_0x46fc5e[_0x32da1f(0x8b)]:String(_0x46fc5e)));}},_0x2a8101=async _0x38cd1a=>{await _0x5f26ea({'projectName':_0x38cd1a,'env':_0x5c75ee['env']});},_0x12f7b1=async _0x6bf197=>{const _0x1347d7=a34_0x3c12,_0x546718=a34_0x17f8bf['resolve'](process[_0x1347d7(0xac)](),_0x6bf197),_0x481902=a34_0x17f8bf[_0x1347d7(0xbf)](_0x546718,'package.json');try{console['log'](_0x1347d7(0xd5));const _0x2b235b=fileURLToPath(import.meta[_0x1347d7(0x9f)]),_0x1f5277=a34_0x17f8bf['resolve'](a34_0x17f8bf['dirname'](_0x2b235b),_0x1347d7(0xb0)),_0x421eba=a34_0x17f8bf[_0x1347d7(0xbf)](_0x1f5277,_0x1347d7(0xa7));let _0x55fdc4=_0x1347d7(0xd4);try{const _0x103eb6=JSON[_0x1347d7(0xaa)](a34_0x243c10[_0x1347d7(0xc9)](_0x421eba,_0x1347d7(0xbb)));_0x55fdc4=_0x103eb6[_0x1347d7(0x8c)]||_0x1347d7(0xd4);}catch(_0x14cb58){}const _0x3285d1=a34_0x243c10[_0x1347d7(0xc9)](_0x481902,_0x1347d7(0xbb)),_0x5a789e=JSON[_0x1347d7(0xaa)](_0x3285d1);_0x5a789e[_0x1347d7(0x8a)]=_0x6bf197,_0x5a789e[_0x1347d7(0xa1)]=_0x6bf197+_0x1347d7(0x9a)+_0x55fdc4,a34_0x243c10['writeFileSync'](_0x481902,JSON[_0x1347d7(0xc1)](_0x5a789e,null,0x2)+'\x0a',_0x1347d7(0xbb)),console['log']('√\x20package.json\x20已更新:\x20name='+_0x6bf197+_0x1347d7(0x86)+_0x5a789e[_0x1347d7(0xa1)]),logger[_0x1347d7(0x9e)](_0x1347d7(0xd1),_0x1347d7(0xa9),{'projectName':_0x6bf197,'description':_0x5a789e[_0x1347d7(0xa1)],'cliVersion':_0x55fdc4,'packageJsonPath':'package.json'});}catch(_0x21199d){logger[_0x1347d7(0xd0)](_0x1347d7(0xd1),_0x1347d7(0x88)+_0x6bf197,{'projectName':_0x6bf197,'error':_0x21199d instanceof Error?_0x21199d[_0x1347d7(0x8b)]:String(_0x21199d)});throw _0x21199d;}},_0x401260=async(_0x586fc3,_0xcdbe67,_0x5c0174)=>{const _0x1ae6a1=a34_0x3c12,_0x19b8ce=a34_0x17f8bf[_0x1ae6a1(0x87)](process['cwd'](),_0x586fc3),_0x1adfc6=a34_0x17f8bf[_0x1ae6a1(0xbf)](_0x19b8ce,'.lovrabetrc');try{_0xcdbe67?console['log'](_0x1ae6a1(0xd9)+_0x586fc3+'\x20配置应用AppCode:\x20'+_0xcdbe67):console['log'](_0x1ae6a1(0xd9)+_0x586fc3+_0x1ae6a1(0xd6));console[_0x1ae6a1(0x9d)](_0x1ae6a1(0xcd)+_0x1adfc6);const _0x3beb3a=fileURLToPath(import.meta[_0x1ae6a1(0x9f)]),_0x294543=a34_0x17f8bf['resolve'](a34_0x17f8bf[_0x1ae6a1(0xc0)](_0x3beb3a),_0x1ae6a1(0xb0)),_0x36a116=a34_0x17f8bf[_0x1ae6a1(0xbf)](_0x294543,_0x1ae6a1(0xa7));let _0x21be7d=_0x1ae6a1(0xd4);try{const _0x5cfe97=JSON[_0x1ae6a1(0xaa)](a34_0x243c10[_0x1ae6a1(0xc9)](_0x36a116,_0x1ae6a1(0xbb)));_0x21be7d=_0x5cfe97[_0x1ae6a1(0x8c)]||_0x1ae6a1(0xd4);}catch(_0x405c8b){}const _0x37e893=readConfig(),_0x3b9e04=typeof _0x37e893[_0x1ae6a1(0xb6)]===_0x1ae6a1(0x9b)?_0x37e893[_0x1ae6a1(0xb6)]:undefined,{app:_0x214817,appcode:_0x3a3ad1,..._0x2b4c02}=_0x37e893,_0x16b09b={..._0x2b4c02,'appcode':_0xcdbe67||'','env':_0x5c0174||_0x3b9e04||_0x1ae6a1(0x9c),'createdAt':new Date()['toLocaleString'](),'version':_0x21be7d};a34_0x243c10[_0x1ae6a1(0xb7)](_0x1adfc6,JSON[_0x1ae6a1(0xc1)](_0x16b09b,null,0x2),_0x1ae6a1(0xbb)),_0xcdbe67?console[_0x1ae6a1(0x9d)](_0x1ae6a1(0xaf)+_0xcdbe67):console[_0x1ae6a1(0x9d)](_0x1ae6a1(0xd2)),logger[_0x1ae6a1(0x9e)](_0x1ae6a1(0xd1),_0x1ae6a1(0x91)+_0xcdbe67,{'projectName':_0x586fc3,'configFile':'.lovrabetrc'});}catch(_0x12e082){logger[_0x1ae6a1(0xd0)](_0x1ae6a1(0xd1),_0x1ae6a1(0x96)+_0xcdbe67,{'projectName':_0x586fc3,'error':_0x12e082 instanceof Error?_0x12e082['message']:String(_0x12e082)});}};useEffect(()=>{const _0x37be3d=a34_0x3c12;_0x5c75ee[_0x37be3d(0x95)]&&_0x2a8101(_0x5c75ee[_0x37be3d(0x95)]);},[_0x5c75ee[_0x48bf82(0x95)]]);if(!_0x1c4ca3&&!_0x197f10&&!_0x5c75ee[_0x48bf82(0x95)])return a34_0x4ea556(EnhancedGuidedCreate,{'onCreate':_0x5f26ea,'env':_0x5c75ee['env']});if(_0x1c4ca3)return a34_0x2be763(a34_0x47651b,{'children':[a34_0x2be763(Box,{'marginTop':0x1,'children':[a34_0x4ea556(Box,{'width':'1'}),a34_0x4ea556(Text,{'color':'green','children':_0x48bf82(0xa6)}),a34_0x4ea556(Text,{'children':_0x48bf82(0x8d)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':_0x52cc08?.[_0x48bf82(0xa2)]}),_0x52cc08?.[_0x48bf82(0x8f)]&&a34_0x2be763(a34_0x47651b,{'children':[a34_0x4ea556(Text,{'children':_0x48bf82(0x93)}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'children':_0x52cc08[_0x48bf82(0x8f)]})]})]}),a34_0x4ea556(TaskRunning,{..._0x32307d}),a34_0x4ea556(TaskRunning,{..._0x1d2568}),a34_0x4ea556(TaskRunning,{..._0x35bf32})]});if(_0x197f10)return a34_0x2be763(a34_0x47651b,{'children':[a34_0x2be763(Box,{'marginTop':0x1,'children':[a34_0x4ea556(Box,{'width':'1'}),a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':_0x48bf82(0xa6)}),a34_0x4ea556(Text,{'children':'项目名称:\x20'}),a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':_0x52cc08?.[_0x48bf82(0xa2)]}),_0x52cc08?.['appCode']&&a34_0x2be763(a34_0x47651b,{'children':[a34_0x4ea556(Text,{'children':_0x48bf82(0x93)}),a34_0x4ea556(Text,{'color':'cyan','children':_0x52cc08['appCode']})]})]}),a34_0x4ea556(TaskFinished,{..._0x32307d}),a34_0x4ea556(TaskFinished,{..._0x1d2568}),a34_0x4ea556(TaskFinished,{..._0x35bf32}),a34_0x4ea556(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':'─'[_0x48bf82(0xb5)](0x3c)})}),a34_0x4ea556(Box,{'children':a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'bold':!![],'children':_0x48bf82(0xda)})}),a34_0x2be763(Box,{'marginTop':0x1,'flexDirection':_0x48bf82(0xad),'children':[a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'cyan','children':_0x48bf82(0xb1)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'bold':!![],'children':_0x52cc08?.[_0x48bf82(0xa2)]})]}),_0x52cc08?.[_0x48bf82(0x8f)]&&a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'cyan','children':'🔗\x20应用AppCode:\x20'}),a34_0x4ea556(Text,{'color':'white','bold':!![],'children':_0x52cc08[_0x48bf82(0x8f)]})]}),a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'cyan','children':_0x48bf82(0xa5)}),_0x52cc08?.[_0x48bf82(0x94)]?a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'bold':!![],'children':'已自动拉取\x20✓'}):_0x52cc08?.[_0x48bf82(0x8f)]?a34_0x4ea556(Text,{'color':'yellow','bold':!![],'children':_0x48bf82(0x84)}):a34_0x4ea556(Text,{'color':_0x48bf82(0xd7),'bold':!![],'children':_0x48bf82(0xa3)})]})]}),a34_0x4ea556(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':_0x48bf82(0x98)})}),a34_0x2be763(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'green','children':_0x48bf82(0xb3)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':_0x48bf82(0xa4)}),a34_0x4ea556(Text,{'color':'cyan','bold':!![],'children':_0x48bf82(0xcb)+_0x52cc08?.['projectName']+'\x20&&\x20lovrabet\x20start'})]}),_0x52cc08?.[_0x48bf82(0x8f)]&&!_0x52cc08?.[_0x48bf82(0x94)]&&a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'yellow','children':_0x48bf82(0xce)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':_0x48bf82(0xc3)}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x52cc08?.[_0x48bf82(0x8f)]&&a34_0x2be763(a34_0x47651b,{'children':[a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':_0x48bf82(0xd7),'children':_0x48bf82(0xce)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':'配置AppCode:\x20'}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'gray','children':'3.\x20'}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':_0x48bf82(0xc3)}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':_0x48bf82(0xbd)})]})]})]}),a34_0x4ea556(Box,{'marginTop':0x1,'children':a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':'─'[_0x48bf82(0xb5)](0x3c)})})]});return null;}
1
+ function a34_0x4eba(){const _0x27d1b7=['info','doTask','W_OK','env','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','1125927zloNPf','constants','需手动拉取','4yUAZnE','pullApi','url','accessSync','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','配置AppCode:\x20','1538031RzhdhD','\x20已存在,请使用其他项目名','setLogPath','appCode','📁\x20项目名称:\x20','readFileSync','项目创建完成:\x20','×\x20项目目录\x20','toLocaleString','cwd','log','success','trim','repeat','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','name','3274896eGOoUq','existsSync','projectCode','yellow','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','cd\x20','resolve','test','message','配置应用AppCode:\x20','1653330biBwVb','utf8','error','×\x20项目名过长,最多支持\x20100\x20个字符','\x20√\x20','cyan','online','6908285oKWldi','parse','配置应用AppCode失败:\x20','create','description','version','项目名称:\x20','*\x20配置文件路径:\x20','155205dwgSSy','\x20配置应用AppCode:\x20','*\x20正在拉取\x20API\x20配置...','column','writeFileSync','dirname','gray','\x20&&\x20lovrabet\x20start','package.json','×\x20无法在当前目录创建项目,请检查目录权限','API\x20配置拉取异常:\x20','\x20|\x20应用AppCode:\x20','1.0.0','green','1.\x20','*\x20正在为项目\x20','stringify','开始创建项目:\x20','2.\x20','lovrabet\x20api\x20pull','启动项目:\x20','2191724UUJQjZ','清理项目目录失败:\x20','🎉\x20项目创建成功!','\x20创建配置文件','../..','更新\x20package.json\x20name\x20和\x20description\x20字段','1128gOmqhD','更新\x20package.json\x20失败:\x20','join','projectName','white','warn','rmSync','×\x20项目创建失败:\x20'];a34_0x4eba=function(){return _0x27d1b7;};return a34_0x4eba();}(function(_0x53a13b,_0x2acd3c){const _0x594111=a34_0x5085,_0x54c8ff=_0x53a13b();while(!![]){try{const _0xac62c9=parseInt(_0x594111(0x1e8))/0x1+parseInt(_0x594111(0x1eb))/0x2*(-parseInt(_0x594111(0x1f1))/0x3)+parseInt(_0x594111(0x22f))/0x4+-parseInt(_0x594111(0x212))/0x5+-parseInt(_0x594111(0x201))/0x6+-parseInt(_0x594111(0x20b))/0x7+parseInt(_0x594111(0x1db))/0x8*(parseInt(_0x594111(0x21a))/0x9);if(_0xac62c9===_0x2acd3c)break;else _0x54c8ff['push'](_0x54c8ff['shift']());}catch(_0x445924){_0x54c8ff['push'](_0x54c8ff['shift']());}}}(a34_0x4eba,0xdfba2));import{jsx as a34_0x50bbe2,Fragment as a34_0x4a47de,jsxs as a34_0x10f8d4}from'react/jsx-runtime';import a34_0x1a7b74 from'node:path';import a34_0x18d356 from'node: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';function a34_0x5085(_0x46ae7e,_0x4f69e6){const _0x4ebab8=a34_0x4eba();return a34_0x5085=function(_0x508535,_0x4ede9d){_0x508535=_0x508535-0x1da;let _0x3b0267=_0x4ebab8[_0x508535];return _0x3b0267;},a34_0x5085(_0x46ae7e,_0x4f69e6);}import{logger}from'../utils/logger.js';export function CreateApp(_0x47c88e){const _0x581fbf=a34_0x5085,[_0x5a676a,_0x5a3780]=useState(![]),[_0x5421b5,_0x4564c0]=useState(![]),[_0x5ac7d7,_0x156001]=useState(null),_0x32a889=useCopyProjectTemplate(),_0x220883=useInstallDependencies(),_0x1b9e34=useFormatCode(),_0x3b511c=async _0x30bba1=>{const _0x412f56=a34_0x5085;if(!_0x30bba1['projectName']||_0x30bba1[_0x412f56(0x1de)][_0x412f56(0x1fd)]()===''){console[_0x412f56(0x20d)]('×\x20项目名不能为空');return;}const _0x41aed2=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x41aed2[_0x412f56(0x208)](_0x30bba1[_0x412f56(0x1de)])){console['error']('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0x30bba1[_0x412f56(0x1de)]['length']>0x64){console[_0x412f56(0x20d)](_0x412f56(0x20e));return;}const _0x4b63a8=a34_0x1a7b74[_0x412f56(0x207)](process[_0x412f56(0x1fa)](),_0x30bba1['projectName']);if(a34_0x18d356[_0x412f56(0x202)](_0x4b63a8)){console[_0x412f56(0x20d)](_0x412f56(0x1f8)+_0x30bba1[_0x412f56(0x1de)]+_0x412f56(0x1f2));return;}try{const _0x3ceaae=a34_0x1a7b74['dirname'](_0x4b63a8);a34_0x18d356[_0x412f56(0x1ee)](_0x3ceaae,a34_0x18d356[_0x412f56(0x1e9)][_0x412f56(0x1e5)]);}catch(_0x155ee6){console['error'](_0x412f56(0x223));return;}_0x156001(_0x30bba1),_0x5a3780(!![]),logger[_0x412f56(0x1f3)](_0x4b63a8),logger[_0x412f56(0x1e3)](_0x412f56(0x215),_0x412f56(0x22b)+_0x30bba1[_0x412f56(0x1de)],{'projectDir':_0x4b63a8,'appCode':_0x30bba1[_0x412f56(0x1f4)]});try{await _0x32a889[_0x412f56(0x1e4)](_0x30bba1[_0x412f56(0x1de)]),await _0x32edfa(_0x30bba1['projectName']),await _0x220883[_0x412f56(0x1e4)](_0x30bba1['projectName']),await _0x1b9e34['doTask'](_0x30bba1[_0x412f56(0x1de)]),await _0x5b5bab(_0x30bba1[_0x412f56(0x1de)],_0x30bba1['appCode']||'',_0x30bba1['env']);if(_0x30bba1[_0x412f56(0x1ec)]&&_0x30bba1[_0x412f56(0x1f4)]){console[_0x412f56(0x1fb)](_0x412f56(0x21c));try{const _0x27c89e=await pullApiSilent(_0x30bba1[_0x412f56(0x1f4)],undefined,_0x4b63a8,_0x30bba1[_0x412f56(0x1e6)]);_0x27c89e?(console[_0x412f56(0x1fb)]('√\x20API\x20配置拉取完成'),logger[_0x412f56(0x1e3)](_0x412f56(0x215),'API\x20配置拉取成功:\x20'+_0x30bba1['appCode'],{'projectDir':_0x4b63a8,'appCode':_0x30bba1['appCode'],'env':_0x30bba1[_0x412f56(0x1e6)]})):(console[_0x412f56(0x1fb)](_0x412f56(0x1ef)),logger['warn'](_0x412f56(0x215),'API\x20配置拉取失败:\x20'+_0x30bba1[_0x412f56(0x1f4)],{'projectDir':_0x4b63a8,'appCode':_0x30bba1[_0x412f56(0x1f4)],'env':_0x30bba1[_0x412f56(0x1e6)]}));}catch(_0x1208f3){console[_0x412f56(0x1fb)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger['warn'](_0x412f56(0x215),_0x412f56(0x224)+_0x30bba1['appCode'],{'projectDir':_0x4b63a8,'appCode':_0x30bba1[_0x412f56(0x1f4)],'env':_0x30bba1[_0x412f56(0x1e6)],'error':_0x1208f3 instanceof Error?_0x1208f3[_0x412f56(0x209)]:String(_0x1208f3)});}}logger[_0x412f56(0x1fc)](_0x412f56(0x215),_0x412f56(0x1f7)+_0x30bba1[_0x412f56(0x1de)]),_0x4564c0(!![]),_0x5a3780(![]);}catch(_0x698b26){logger['error'](_0x412f56(0x215),'项目创建失败:\x20'+_0x30bba1['projectName'],{'error':_0x698b26 instanceof Error?_0x698b26[_0x412f56(0x209)]:String(_0x698b26)});try{a34_0x18d356[_0x412f56(0x202)](_0x4b63a8)&&(console[_0x412f56(0x1fb)]('*\x20清理失败的项目目录:\x20'+_0x4b63a8),a34_0x18d356[_0x412f56(0x1e1)](_0x4b63a8,{'recursive':!![],'force':!![]}));}catch(_0x2a680e){logger[_0x412f56(0x1e0)](_0x412f56(0x215),_0x412f56(0x230)+_0x4b63a8,{'error':_0x2a680e instanceof Error?_0x2a680e[_0x412f56(0x209)]:String(_0x2a680e)});}_0x5a3780(![]),console[_0x412f56(0x20d)](_0x412f56(0x1e2)+(_0x698b26 instanceof Error?_0x698b26[_0x412f56(0x209)]:String(_0x698b26)));}},_0x45fd06=async _0x285f8d=>{const _0x523a7b=a34_0x5085;await _0x3b511c({'projectName':_0x285f8d,'env':_0x47c88e[_0x523a7b(0x1e6)]});},_0x32edfa=async _0x213ae2=>{const _0x7ad160=a34_0x5085,_0xb2912e=a34_0x1a7b74[_0x7ad160(0x207)](process[_0x7ad160(0x1fa)](),_0x213ae2),_0x607a8c=a34_0x1a7b74[_0x7ad160(0x1dd)](_0xb2912e,_0x7ad160(0x222));try{console[_0x7ad160(0x1fb)](_0x7ad160(0x1ff));const _0x559b73=fileURLToPath(import.meta[_0x7ad160(0x1ed)]),_0x4f2f9c=a34_0x1a7b74[_0x7ad160(0x207)](a34_0x1a7b74['dirname'](_0x559b73),_0x7ad160(0x233)),_0x29a9b0=a34_0x1a7b74['join'](_0x4f2f9c,_0x7ad160(0x222));let _0x214de3=_0x7ad160(0x226);try{const _0x357399=JSON[_0x7ad160(0x213)](a34_0x18d356[_0x7ad160(0x1f6)](_0x29a9b0,_0x7ad160(0x20c)));_0x214de3=_0x357399[_0x7ad160(0x217)]||_0x7ad160(0x226);}catch(_0x226bae){}const _0xa804e=a34_0x18d356[_0x7ad160(0x1f6)](_0x607a8c,'utf8'),_0x36ec96=JSON[_0x7ad160(0x213)](_0xa804e);_0x36ec96[_0x7ad160(0x200)]=_0x213ae2,_0x36ec96[_0x7ad160(0x216)]=_0x213ae2+'\x20Generated\x20by\x20lovrabet\x20cli\x20'+_0x214de3,a34_0x18d356[_0x7ad160(0x21e)](_0x607a8c,JSON[_0x7ad160(0x22a)](_0x36ec96,null,0x2)+'\x0a',_0x7ad160(0x20c)),console[_0x7ad160(0x1fb)]('√\x20package.json\x20已更新:\x20name='+_0x213ae2+',\x20description='+_0x36ec96['description']),logger[_0x7ad160(0x1e3)](_0x7ad160(0x215),_0x7ad160(0x1da),{'projectName':_0x213ae2,'description':_0x36ec96[_0x7ad160(0x216)],'cliVersion':_0x214de3,'packageJsonPath':_0x7ad160(0x222)});}catch(_0xf815c3){logger[_0x7ad160(0x20d)](_0x7ad160(0x215),_0x7ad160(0x1dc)+_0x213ae2,{'projectName':_0x213ae2,'error':_0xf815c3 instanceof Error?_0xf815c3['message']:String(_0xf815c3)});throw _0xf815c3;}},_0x5b5bab=async(_0x16f2ee,_0x13626,_0x2ce4df)=>{const _0x2cc2b0=a34_0x5085,_0x203032=a34_0x1a7b74[_0x2cc2b0(0x207)](process[_0x2cc2b0(0x1fa)](),_0x16f2ee),_0x3db5dd=a34_0x1a7b74[_0x2cc2b0(0x1dd)](_0x203032,'.lovrabetrc');try{_0x13626?console['log'](_0x2cc2b0(0x229)+_0x16f2ee+_0x2cc2b0(0x21b)+_0x13626):console[_0x2cc2b0(0x1fb)](_0x2cc2b0(0x229)+_0x16f2ee+_0x2cc2b0(0x232));console[_0x2cc2b0(0x1fb)](_0x2cc2b0(0x219)+_0x3db5dd);const _0x180f54=fileURLToPath(import.meta[_0x2cc2b0(0x1ed)]),_0x42517f=a34_0x1a7b74[_0x2cc2b0(0x207)](a34_0x1a7b74[_0x2cc2b0(0x21f)](_0x180f54),_0x2cc2b0(0x233)),_0x59a9d3=a34_0x1a7b74[_0x2cc2b0(0x1dd)](_0x42517f,_0x2cc2b0(0x222));let _0x4ac654=_0x2cc2b0(0x226);try{const _0x4b4f2d=JSON[_0x2cc2b0(0x213)](a34_0x18d356[_0x2cc2b0(0x1f6)](_0x59a9d3,_0x2cc2b0(0x20c)));_0x4ac654=_0x4b4f2d['version']||_0x2cc2b0(0x226);}catch(_0x3d69e6){}const _0x49d6f4=readConfig(),_0x1869ec=typeof _0x49d6f4['env']==='string'?_0x49d6f4[_0x2cc2b0(0x1e6)]:undefined,{app:_0x35bc6e,appcode:_0x3fcb3b,..._0xba817f}=_0x49d6f4,_0x3a2353={..._0xba817f,'appcode':_0x13626||'','env':_0x2ce4df||_0x1869ec||_0x2cc2b0(0x211),'createdAt':new Date()[_0x2cc2b0(0x1f9)](),'version':_0x4ac654};a34_0x18d356[_0x2cc2b0(0x21e)](_0x3db5dd,JSON[_0x2cc2b0(0x22a)](_0x3a2353,null,0x2),'utf8'),_0x13626?console['log']('√\x20配置文件已创建,应用AppCode:\x20'+_0x13626):console[_0x2cc2b0(0x1fb)](_0x2cc2b0(0x205)),logger[_0x2cc2b0(0x1e3)]('create',_0x2cc2b0(0x20a)+_0x13626,{'projectName':_0x16f2ee,'configFile':'.lovrabetrc'});}catch(_0xa0dfe6){logger['error'](_0x2cc2b0(0x215),_0x2cc2b0(0x214)+_0x13626,{'projectName':_0x16f2ee,'error':_0xa0dfe6 instanceof Error?_0xa0dfe6[_0x2cc2b0(0x209)]:String(_0xa0dfe6)});}};useEffect(()=>{const _0x31ff62=a34_0x5085;_0x47c88e[_0x31ff62(0x203)]&&_0x45fd06(_0x47c88e[_0x31ff62(0x203)]);},[_0x47c88e[_0x581fbf(0x203)]]);if(!_0x5a676a&&!_0x5421b5&&!_0x47c88e['projectCode'])return a34_0x50bbe2(EnhancedGuidedCreate,{'onCreate':_0x3b511c,'env':_0x47c88e[_0x581fbf(0x1e6)]});if(_0x5a676a)return a34_0x10f8d4(a34_0x4a47de,{'children':[a34_0x10f8d4(Box,{'marginTop':0x1,'children':[a34_0x50bbe2(Box,{'width':'1'}),a34_0x50bbe2(Text,{'color':'green','children':_0x581fbf(0x20f)}),a34_0x50bbe2(Text,{'children':_0x581fbf(0x218)}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'children':_0x5ac7d7?.[_0x581fbf(0x1de)]}),_0x5ac7d7?.[_0x581fbf(0x1f4)]&&a34_0x10f8d4(a34_0x4a47de,{'children':[a34_0x50bbe2(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'children':_0x5ac7d7[_0x581fbf(0x1f4)]})]})]}),a34_0x50bbe2(TaskRunning,{..._0x32a889}),a34_0x50bbe2(TaskRunning,{..._0x220883}),a34_0x50bbe2(TaskRunning,{..._0x1b9e34})]});if(_0x5421b5)return a34_0x10f8d4(a34_0x4a47de,{'children':[a34_0x10f8d4(Box,{'marginTop':0x1,'children':[a34_0x50bbe2(Box,{'width':'1'}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'children':_0x581fbf(0x20f)}),a34_0x50bbe2(Text,{'children':_0x581fbf(0x218)}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'children':_0x5ac7d7?.[_0x581fbf(0x1de)]}),_0x5ac7d7?.['appCode']&&a34_0x10f8d4(a34_0x4a47de,{'children':[a34_0x50bbe2(Text,{'children':_0x581fbf(0x225)}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'children':_0x5ac7d7[_0x581fbf(0x1f4)]})]})]}),a34_0x50bbe2(TaskFinished,{..._0x32a889}),a34_0x50bbe2(TaskFinished,{..._0x220883}),a34_0x50bbe2(TaskFinished,{..._0x1b9e34}),a34_0x50bbe2(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'children':'─'[_0x581fbf(0x1fe)](0x3c)})}),a34_0x50bbe2(Box,{'children':a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'bold':!![],'children':_0x581fbf(0x231)})}),a34_0x10f8d4(Box,{'marginTop':0x1,'flexDirection':_0x581fbf(0x21d),'children':[a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':'cyan','children':_0x581fbf(0x1f5)}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x1df),'bold':!![],'children':_0x5ac7d7?.[_0x581fbf(0x1de)]})]}),_0x5ac7d7?.[_0x581fbf(0x1f4)]&&a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'children':'🔗\x20应用AppCode:\x20'}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x1df),'bold':!![],'children':_0x5ac7d7[_0x581fbf(0x1f4)]})]}),a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':'cyan','children':'📦\x20API配置:\x20'}),_0x5ac7d7?.['pullApi']?a34_0x50bbe2(Text,{'color':'green','bold':!![],'children':'已自动拉取\x20✓'}):_0x5ac7d7?.['appCode']?a34_0x50bbe2(Text,{'color':_0x581fbf(0x204),'bold':!![],'children':_0x581fbf(0x1ea)}):a34_0x50bbe2(Text,{'color':_0x581fbf(0x220),'bold':!![],'children':'未配置'})]})]}),a34_0x50bbe2(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'bold':!![],'children':'🚀\x20接下来可以:'})}),a34_0x10f8d4(Box,{'marginLeft':0x2,'flexDirection':_0x581fbf(0x21d),'children':[a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'children':_0x581fbf(0x228)}),a34_0x50bbe2(Text,{'color':'white','children':_0x581fbf(0x22e)}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'bold':!![],'children':_0x581fbf(0x206)+_0x5ac7d7?.['projectName']+_0x581fbf(0x221)})]}),_0x5ac7d7?.[_0x581fbf(0x1f4)]&&!_0x5ac7d7?.['pullApi']&&a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':'yellow','children':_0x581fbf(0x22c)}),a34_0x50bbe2(Text,{'color':'white','children':'拉取API配置:\x20'}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'bold':!![],'children':_0x581fbf(0x22d)})]}),!_0x5ac7d7?.[_0x581fbf(0x1f4)]&&a34_0x10f8d4(a34_0x4a47de,{'children':[a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':'gray','children':_0x581fbf(0x22c)}),a34_0x50bbe2(Text,{'color':'white','children':_0x581fbf(0x1f0)}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a34_0x10f8d4(Box,{'children':[a34_0x50bbe2(Text,{'color':_0x581fbf(0x220),'children':'3.\x20'}),a34_0x50bbe2(Text,{'color':'white','children':'拉取API配置:\x20'}),a34_0x50bbe2(Text,{'color':_0x581fbf(0x210),'bold':!![],'children':_0x581fbf(0x1e7)})]})]})]}),a34_0x50bbe2(Box,{'marginTop':0x1,'children':a34_0x50bbe2(Text,{'color':_0x581fbf(0x227),'children':'─'['repeat'](0x3c)})})]});return null;}
@@ -1 +1 @@
1
- function a35_0x52b1(_0x2c5174,_0xf5f748){var _0x36a5e6=a35_0x36a5();return a35_0x52b1=function(_0x52b164,_0x538ce5){_0x52b164=_0x52b164-0x6c;var _0x6c6914=_0x36a5e6[_0x52b164];return _0x6c6914;},a35_0x52b1(_0x2c5174,_0xf5f748);}(function(_0x5c29e4,_0xdb9922){var _0x528b07=a35_0x52b1,_0x1ecf7c=_0x5c29e4();while(!![]){try{var _0x427c1d=parseInt(_0x528b07(0x77))/0x1+-parseInt(_0x528b07(0x6c))/0x2+parseInt(_0x528b07(0x72))/0x3*(-parseInt(_0x528b07(0x78))/0x4)+-parseInt(_0x528b07(0x74))/0x5+-parseInt(_0x528b07(0x6f))/0x6+-parseInt(_0x528b07(0x6d))/0x7*(parseInt(_0x528b07(0x75))/0x8)+parseInt(_0x528b07(0x71))/0x9*(parseInt(_0x528b07(0x76))/0xa);if(_0x427c1d===_0xdb9922)break;else _0x1ecf7c['push'](_0x1ecf7c['shift']());}catch(_0x368bb1){_0x1ecf7c['push'](_0x1ecf7c['shift']());}}}(a35_0x36a5,0x9b7ce));import{jsx as a35_0x576305,jsxs as a35_0x238025}from'react/jsx-runtime';import{Box,Text}from'ink';function a35_0x36a5(){var _0x570f8c=['5070972BOIInq','2200446njyBXw','91YBCTxt','\x20√\x20','5311458qsyMEY','green','171PuVaEF','3WbHpsE','taskName','602425tsnRgX','406136xdwhIS','2142530xaznUF','599736xFMJRN'];a35_0x36a5=function(){return _0x570f8c;};return a35_0x36a5();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x246f47){var _0x4bed34=a35_0x52b1;return a35_0x238025(Box,{'children':[a35_0x576305(Box,{'width':'1'}),a35_0x576305(Text,{'color':_0x4bed34(0x70),'children':_0x4bed34(0x6e)}),a35_0x576305(Text,{'children':_0x246f47[_0x4bed34(0x73)]}),a35_0x576305(TaskTime,{'elapsed':_0x246f47['elapsed']})]});}
1
+ function a35_0x3649(){var _0x5744c8=['taskName','elapsed','269864IJreyQ','2nIjNHd','9409WJmauJ','465486vYsXOl','55eqEIev','1848624LRiKTI','580035pqJbvq','3186rmcfun','6189201PRCElO','\x20√\x20','green'];a35_0x3649=function(){return _0x5744c8;};return a35_0x3649();}(function(_0x31fa07,_0x4692dc){var _0xf86f09=a35_0x70a0,_0x543d20=_0x31fa07();while(!![]){try{var _0xd12c1c=parseInt(_0xf86f09(0x158))/0x1+-parseInt(_0xf86f09(0x157))/0x2*(parseInt(_0xf86f09(0x15c))/0x3)+-parseInt(_0xf86f09(0x156))/0x4+parseInt(_0xf86f09(0x15a))/0x5*(parseInt(_0xf86f09(0x15d))/0x6)+-parseInt(_0xf86f09(0x159))/0x7+-parseInt(_0xf86f09(0x15b))/0x8+parseInt(_0xf86f09(0x15e))/0x9;if(_0xd12c1c===_0x4692dc)break;else _0x543d20['push'](_0x543d20['shift']());}catch(_0x5006b8){_0x543d20['push'](_0x543d20['shift']());}}}(a35_0x3649,0x234a8));function a35_0x70a0(_0x37700e,_0x4b62e7){var _0x364960=a35_0x3649();return a35_0x70a0=function(_0x70a061,_0x4779fe){_0x70a061=_0x70a061-0x152;var _0x45a1af=_0x364960[_0x70a061];return _0x45a1af;},a35_0x70a0(_0x37700e,_0x4b62e7);}import{jsx as a35_0x4f3283,jsxs as a35_0x5e2263}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0xd9efee){var _0x11ab91=a35_0x70a0;return a35_0x5e2263(Box,{'children':[a35_0x4f3283(Box,{'width':'1'}),a35_0x4f3283(Text,{'color':_0x11ab91(0x153),'children':_0x11ab91(0x152)}),a35_0x4f3283(Text,{'children':_0xd9efee[_0x11ab91(0x154)]}),a35_0x4f3283(TaskTime,{'elapsed':_0xd9efee[_0x11ab91(0x155)]})]});}
@@ -1 +1 @@
1
- function a36_0x1677(){var _0x2ba2b0=['\x20\x20\x20','1005342YgefFo','707nwbOWt','1095310kDLcuL','233069xjMrhp','724207cYVhKm','2480IfvHXm','20gvUCBE','2DFrWmQ','loading','8WwNyqA','215766yRFXLx','finished','green','dots','201327TseRLv'];a36_0x1677=function(){return _0x2ba2b0;};return a36_0x1677();}(function(_0x3f551d,_0x7af75c){var _0x15f50a=a36_0x31e3,_0x4c0040=_0x3f551d();while(!![]){try{var _0x1f87b3=-parseInt(_0x15f50a(0x176))/0x1*(parseInt(_0x15f50a(0x16a))/0x2)+-parseInt(_0x15f50a(0x171))/0x3*(parseInt(_0x15f50a(0x16c))/0x4)+parseInt(_0x15f50a(0x175))/0x5+parseInt(_0x15f50a(0x173))/0x6+-parseInt(_0x15f50a(0x174))/0x7*(-parseInt(_0x15f50a(0x168))/0x8)+parseInt(_0x15f50a(0x16d))/0x9+-parseInt(_0x15f50a(0x169))/0xa*(-parseInt(_0x15f50a(0x167))/0xb);if(_0x1f87b3===_0x7af75c)break;else _0x4c0040['push'](_0x4c0040['shift']());}catch(_0x10b473){_0x4c0040['push'](_0x4c0040['shift']());}}}(a36_0x1677,0x325d2));import{jsx as a36_0x2bac4d,jsxs as a36_0x4d2d44}from'react/jsx-runtime';function a36_0x31e3(_0x4477c9,_0x467e0c){var _0x167737=a36_0x1677();return a36_0x31e3=function(_0x31e359,_0x46b210){_0x31e359=_0x31e359-0x167;var _0x3ec389=_0x167737[_0x31e359];return _0x3ec389;},a36_0x31e3(_0x4477c9,_0x467e0c);}import{Text}from'ink';import a36_0x1a5196 from'ink-spinner';export function TaskLoading(_0x238767){var _0x16a42b=a36_0x31e3;if(_0x238767[_0x16a42b(0x16e)])return a36_0x2bac4d(Text,{'color':'green','children':'\x20√\x20'});if(_0x238767[_0x16a42b(0x16b)])return a36_0x4d2d44(Text,{'color':_0x16a42b(0x16f),'children':['\x20',a36_0x2bac4d(a36_0x1a5196,{'type':_0x16a42b(0x170)}),'\x20']});return a36_0x2bac4d(Text,{'children':_0x16a42b(0x172)});}
1
+ (function(_0x5b2cbc,_0x2c5d8c){var _0x3710ed=a36_0x1c73,_0x236674=_0x5b2cbc();while(!![]){try{var _0xb8591f=-parseInt(_0x3710ed(0x1b0))/0x1+parseInt(_0x3710ed(0x1aa))/0x2*(parseInt(_0x3710ed(0x1ae))/0x3)+-parseInt(_0x3710ed(0x1a7))/0x4+parseInt(_0x3710ed(0x1a8))/0x5+parseInt(_0x3710ed(0x1a9))/0x6+-parseInt(_0x3710ed(0x1ad))/0x7*(-parseInt(_0x3710ed(0x1af))/0x8)+parseInt(_0x3710ed(0x1b2))/0x9*(-parseInt(_0x3710ed(0x1a6))/0xa);if(_0xb8591f===_0x2c5d8c)break;else _0x236674['push'](_0x236674['shift']());}catch(_0x7a1641){_0x236674['push'](_0x236674['shift']());}}}(a36_0x1156,0xbea54));function a36_0x1c73(_0xcb226f,_0x2a8e96){var _0x1156df=a36_0x1156();return a36_0x1c73=function(_0x1c7319,_0x3460f0){_0x1c7319=_0x1c7319-0x1a5;var _0x2c0f23=_0x1156df[_0x1c7319];return _0x2c0f23;},a36_0x1c73(_0xcb226f,_0x2a8e96);}import{jsx as a36_0x361e3c,jsxs as a36_0x3cc325}from'react/jsx-runtime';import{Text}from'ink';import a36_0x4750f0 from'ink-spinner';export function TaskLoading(_0x1e775f){var _0x5904b4=a36_0x1c73;if(_0x1e775f[_0x5904b4(0x1a5)])return a36_0x361e3c(Text,{'color':_0x5904b4(0x1b1),'children':_0x5904b4(0x1ac)});if(_0x1e775f['loading'])return a36_0x3cc325(Text,{'color':_0x5904b4(0x1b1),'children':['\x20',a36_0x361e3c(a36_0x4750f0,{'type':'dots'}),'\x20']});return a36_0x361e3c(Text,{'children':_0x5904b4(0x1ab)});}function a36_0x1156(){var _0x5bb728=['green','851688DwfYoF','finished','210DNkKAD','3719932sGIJWQ','7185205KaqDKu','7364322dwnFcP','2NFGlSv','\x20\x20\x20','\x20√\x20','7mhrJfe','4052691uhGbSu','1149456QAkMkS','460868wqsaSz'];a36_0x1156=function(){return _0x5bb728;};return a36_0x1156();}
@@ -1 +1 @@
1
- (function(_0x89d424,_0x30f220){var _0x5173ad=a37_0x507b,_0x1b1830=_0x89d424();while(!![]){try{var _0x59a849=parseInt(_0x5173ad(0x106))/0x1+parseInt(_0x5173ad(0xfd))/0x2+-parseInt(_0x5173ad(0xff))/0x3*(parseInt(_0x5173ad(0x105))/0x4)+-parseInt(_0x5173ad(0x107))/0x5+-parseInt(_0x5173ad(0x102))/0x6*(parseInt(_0x5173ad(0x101))/0x7)+parseInt(_0x5173ad(0x100))/0x8+parseInt(_0x5173ad(0xfe))/0x9;if(_0x59a849===_0x30f220)break;else _0x1b1830['push'](_0x1b1830['shift']());}catch(_0x44f4d2){_0x1b1830['push'](_0x1b1830['shift']());}}}(a37_0x49d3,0x403ad));import{jsx as a37_0x25cf60,jsxs as a37_0x1bd379}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a37_0x507b(_0x58fbb5,_0x5db6c6){var _0x49d3d2=a37_0x49d3();return a37_0x507b=function(_0x507b21,_0xcaa9c){_0x507b21=_0x507b21-0xfd;var _0x3687e0=_0x49d3d2[_0x507b21];return _0x3687e0;},a37_0x507b(_0x58fbb5,_0x5db6c6);}function a37_0x49d3(){var _0x518c40=['elapsed','taskName','1902452zgfzUf','22066RgddqP','1398830YJidXP','361244Zpzzea','4322583UJYYfv','3kOuOLd','2851328jymFoZ','8617fMFWig','102cmXKrV'];a37_0x49d3=function(){return _0x518c40;};return a37_0x49d3();}export function TaskRunning(_0x1c1362){var _0x5f1eb0=a37_0x507b;return a37_0x1bd379(Box,{'children':[a37_0x25cf60(Box,{'width':'1'}),a37_0x25cf60(TaskLoading,{..._0x1c1362}),a37_0x25cf60(Text,{'children':_0x1c1362[_0x5f1eb0(0x104)]}),a37_0x25cf60(TaskTime,{'elapsed':_0x1c1362[_0x5f1eb0(0x103)]})]});}
1
+ (function(_0x141003,_0xb8b89c){var _0xccbf28=a37_0x5d3e,_0x8c663a=_0x141003();while(!![]){try{var _0x47b941=parseInt(_0xccbf28(0x90))/0x1*(-parseInt(_0xccbf28(0x8e))/0x2)+-parseInt(_0xccbf28(0x95))/0x3+parseInt(_0xccbf28(0x92))/0x4*(parseInt(_0xccbf28(0x8f))/0x5)+parseInt(_0xccbf28(0x91))/0x6*(-parseInt(_0xccbf28(0x94))/0x7)+-parseInt(_0xccbf28(0x8c))/0x8+parseInt(_0xccbf28(0x89))/0x9*(parseInt(_0xccbf28(0x8b))/0xa)+parseInt(_0xccbf28(0x93))/0xb;if(_0x47b941===_0xb8b89c)break;else _0x8c663a['push'](_0x8c663a['shift']());}catch(_0x5cd808){_0x8c663a['push'](_0x8c663a['shift']());}}}(a37_0x4890,0x9a9f3));import{jsx as a37_0xb1dc08,jsxs as a37_0x3708bf}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';function a37_0x5d3e(_0x238bbd,_0x53f767){var _0x489093=a37_0x4890();return a37_0x5d3e=function(_0x5d3e0f,_0x430f95){_0x5d3e0f=_0x5d3e0f-0x89;var _0x11cfc2=_0x489093[_0x5d3e0f];return _0x11cfc2;},a37_0x5d3e(_0x238bbd,_0x53f767);}import{TaskTime}from'./task-time.js';function a37_0x4890(){var _0x19fc20=['75634hQFoDG','1115mDBlGf','19vYVgOj','108GCrKPL','10172imzYjY','30251562ataIHN','98651jVeHcJ','3762363xHLZrR','3321jOcLtU','taskName','4680KyGiBH','5042192PlBZme','elapsed'];a37_0x4890=function(){return _0x19fc20;};return a37_0x4890();}export function TaskRunning(_0x43d18e){var _0x8901e0=a37_0x5d3e;return a37_0x3708bf(Box,{'children':[a37_0xb1dc08(Box,{'width':'1'}),a37_0xb1dc08(TaskLoading,{..._0x43d18e}),a37_0xb1dc08(Text,{'children':_0x43d18e[_0x8901e0(0x8a)]}),a37_0xb1dc08(TaskTime,{'elapsed':_0x43d18e[_0x8901e0(0x8d)]})]});}
@@ -1 +1 @@
1
- function a38_0xbe6e(){var _0x5add25=['3925605BAyWJR','58527WhHRML','1297934DSkOmr','8384kbBnFC','5193ZYHVkT','17325LNJbeb','gray','1pcDmPM','4772290kgClCs','4inXUgp','78tuCTrL','2278515mzMvTG','elapsed'];a38_0xbe6e=function(){return _0x5add25;};return a38_0xbe6e();}(function(_0x182fd6,_0x13d08a){var _0x509f52=a38_0xdd72,_0x34e89d=_0x182fd6();while(!![]){try{var _0x56576e=-parseInt(_0x509f52(0x18d))/0x1*(-parseInt(_0x509f52(0x195))/0x2)+parseInt(_0x509f52(0x191))/0x3+parseInt(_0x509f52(0x18f))/0x4*(-parseInt(_0x509f52(0x193))/0x5)+-parseInt(_0x509f52(0x190))/0x6*(-parseInt(_0x509f52(0x194))/0x7)+parseInt(_0x509f52(0x196))/0x8*(parseInt(_0x509f52(0x197))/0x9)+-parseInt(_0x509f52(0x18e))/0xa+-parseInt(_0x509f52(0x198))/0xb;if(_0x56576e===_0x13d08a)break;else _0x34e89d['push'](_0x34e89d['shift']());}catch(_0x4b6d80){_0x34e89d['push'](_0x34e89d['shift']());}}}(a38_0xbe6e,0xd1750));import{jsx as a38_0x2800bb,Fragment as a38_0x105321,jsxs as a38_0x19a944}from'react/jsx-runtime';function a38_0xdd72(_0x528d69,_0x43996b){var _0xbe6ef9=a38_0xbe6e();return a38_0xdd72=function(_0xdd72fe,_0x5f3251){_0xdd72fe=_0xdd72fe-0x18c;var _0x2cb746=_0xbe6ef9[_0xdd72fe];return _0x2cb746;},a38_0xdd72(_0x528d69,_0x43996b);}import{Text}from'ink';export function TaskTime(_0x121677){var _0x4d5950=a38_0xdd72;if(_0x121677[_0x4d5950(0x192)])return a38_0x19a944(a38_0x105321,{'children':[a38_0x2800bb(Text,{'color':_0x4d5950(0x18c),'children':'\x20['}),a38_0x2800bb(Text,{'color':_0x4d5950(0x18c),'bold':!![],'children':_0x121677['elapsed']}),a38_0x2800bb(Text,{'color':_0x4d5950(0x18c),'children':']'})]});return null;}
1
+ (function(_0x271e09,_0x2885d5){var _0x4f3f51=a38_0x118d,_0x1c2040=_0x271e09();while(!![]){try{var _0x4e49b0=parseInt(_0x4f3f51(0xc4))/0x1+-parseInt(_0x4f3f51(0xcb))/0x2+parseInt(_0x4f3f51(0xc6))/0x3+-parseInt(_0x4f3f51(0xc8))/0x4*(-parseInt(_0x4f3f51(0xc5))/0x5)+-parseInt(_0x4f3f51(0xc9))/0x6+-parseInt(_0x4f3f51(0xcc))/0x7*(parseInt(_0x4f3f51(0xca))/0x8)+-parseInt(_0x4f3f51(0xc2))/0x9*(-parseInt(_0x4f3f51(0xc3))/0xa);if(_0x4e49b0===_0x2885d5)break;else _0x1c2040['push'](_0x1c2040['shift']());}catch(_0x265167){_0x1c2040['push'](_0x1c2040['shift']());}}}(a38_0x3c92,0xd7c33));import{jsx as a38_0x2e14db,Fragment as a38_0xe04662,jsxs as a38_0x5cf46d}from'react/jsx-runtime';function a38_0x118d(_0x31bb89,_0x27f5a8){var _0x3c9297=a38_0x3c92();return a38_0x118d=function(_0x118d29,_0x88f817){_0x118d29=_0x118d29-0xc1;var _0x834e24=_0x3c9297[_0x118d29];return _0x834e24;},a38_0x118d(_0x31bb89,_0x27f5a8);}function a38_0x3c92(){var _0x576247=['10psCaVa','1034835DGPkWq','43465yBZMIw','4959573PpGkoz','elapsed','36ccUJjx','9501732wjsnPs','1229008HEhrPn','651426WXbjeH','49zdEeOl','gray','9919953tsUceM'];a38_0x3c92=function(){return _0x576247;};return a38_0x3c92();}import{Text}from'ink';export function TaskTime(_0x58b45e){var _0x26b83e=a38_0x118d;if(_0x58b45e[_0x26b83e(0xc7)])return a38_0x5cf46d(a38_0xe04662,{'children':[a38_0x2e14db(Text,{'color':_0x26b83e(0xc1),'children':'\x20['}),a38_0x2e14db(Text,{'color':_0x26b83e(0xc1),'bold':!![],'children':_0x58b45e[_0x26b83e(0xc7)]}),a38_0x2e14db(Text,{'color':_0x26b83e(0xc1),'children':']'})]});return null;}
@@ -1 +1 @@
1
- const a39_0x4c2feb=a39_0x34ce;function a39_0x34ce(_0x57dab3,_0x4b1b31){const _0x1a10f0=a39_0x1a10();return a39_0x34ce=function(_0x34ce21,_0x18acce){_0x34ce21=_0x34ce21-0x144;let _0x276676=_0x1a10f0[_0x34ce21];return _0x276676;},a39_0x34ce(_0x57dab3,_0x4b1b31);}(function(_0x4e8167,_0x4380d2){const _0x47c0fb=a39_0x34ce,_0x5d8450=_0x4e8167();while(!![]){try{const _0x58b1e3=parseInt(_0x47c0fb(0x14c))/0x1*(parseInt(_0x47c0fb(0x147))/0x2)+parseInt(_0x47c0fb(0x144))/0x3*(parseInt(_0x47c0fb(0x14d))/0x4)+-parseInt(_0x47c0fb(0x156))/0x5*(parseInt(_0x47c0fb(0x14e))/0x6)+-parseInt(_0x47c0fb(0x152))/0x7+parseInt(_0x47c0fb(0x148))/0x8+parseInt(_0x47c0fb(0x151))/0x9*(-parseInt(_0x47c0fb(0x159))/0xa)+parseInt(_0x47c0fb(0x15a))/0xb;if(_0x58b1e3===_0x4380d2)break;else _0x5d8450['push'](_0x5d8450['shift']());}catch(_0x5c655a){_0x5d8450['push'](_0x5d8450['shift']());}}}(a39_0x1a10,0x4ec20));import a39_0x39837f from'node:path';import{fileURLToPath}from'node:url';function a39_0x1a10(){const _0x5725fb=['732151okvndQ','url','error','now','1455845rmBJsJ','message','resolve','3433530Ucvipb','2261820NTDbCt','107913UiicWp','dirname','success','4YHWBPh','2150808uSfyRa','copy','项目模板复制失败','../../templates/projects/sub-app-react-demo','277333IIXxnI','36poVsEv','12zrlWEj','项目模板复制完成','cwd','9dVuDEX'];a39_0x1a10=function(){return _0x5725fb;};return a39_0x1a10();}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=a39_0x39837f[a39_0x4c2feb(0x145)](fileURLToPath(import.meta[a39_0x4c2feb(0x153)])),templateDir=a39_0x39837f[a39_0x4c2feb(0x158)](__dirname,a39_0x4c2feb(0x14b));export function useCopyProjectTemplate(){const [_0x2d2b9d,_0x4c1cdd]=useState(![]),[_0x2df903,_0x402538]=useState(![]),[_0x4fd175,_0x45fa62]=useState(''),_0xc9716f=useCallback(async _0x45f0d4=>{const _0x5b5af8=a39_0x34ce,_0x4b413d=Date[_0x5b5af8(0x155)](),_0x44ba8e=a39_0x39837f[_0x5b5af8(0x158)](process[_0x5b5af8(0x150)](),_0x45f0d4);_0x4c1cdd(!![]);try{logger['info'](_0x5b5af8(0x149),'开始复制项目模板',{'projectCode':_0x45f0d4,'templateDir':templateDir}),await copyDirectory(templateDir,_0x44ba8e);const _0x28850a=Date[_0x5b5af8(0x155)]()-_0x4b413d;logger[_0x5b5af8(0x146)](_0x5b5af8(0x149),_0x5b5af8(0x14f),_0x28850a,{'projectCode':_0x45f0d4});}catch(_0x4fac3e){const _0xe3a49f=Date[_0x5b5af8(0x155)]()-_0x4b413d;logger[_0x5b5af8(0x154)](_0x5b5af8(0x149),_0x5b5af8(0x14a),{'projectCode':_0x45f0d4,'error':_0x4fac3e instanceof Error?_0x4fac3e[_0x5b5af8(0x157)]:String(_0x4fac3e),'duration':_0xe3a49f});throw _0x4fac3e;}finally{_0x4c1cdd(![]),_0x402538(!![]),_0x45fa62(formatElapsed(_0x4b413d));}},[]);return{'taskName':'复制项目文件','finished':_0x2df903,'loading':_0x2d2b9d,'elapsed':_0x4fd175,'doTask':_0xc9716f};}
1
+ const a39_0x1807b7=a39_0x47e2;function a39_0x5ccd(){const _0x1618bd=['150rQqzVE','47880fBTGKb','2LxkJFq','45598KUiUlu','528RbpvRO','27aZmVSM','复制项目文件','30BuMxEi','项目模板复制失败','error','186453DCMMrv','374945UaBqnG','dirname','copy','url','10105615lAvZGQ','cwd','115896LVgOxa','../../templates/projects/sub-app-react-demo','resolve','message','开始复制项目模板','success','390727fUkkzb','项目模板复制完成','now','632oQayKo'];a39_0x5ccd=function(){return _0x1618bd;};return a39_0x5ccd();}(function(_0x2bd61f,_0x57caa1){const _0x4e7152=a39_0x47e2,_0x10a68a=_0x2bd61f();while(!![]){try{const _0x595daa=-parseInt(_0x4e7152(0x106))/0x1*(-parseInt(_0x4e7152(0x10c))/0x2)+-parseInt(_0x4e7152(0x10f))/0x3*(parseInt(_0x4e7152(0x10b))/0x4)+-parseInt(_0x4e7152(0x115))/0x5*(parseInt(_0x4e7152(0x111))/0x6)+parseInt(_0x4e7152(0x10d))/0x7*(-parseInt(_0x4e7152(0x109))/0x8)+parseInt(_0x4e7152(0x114))/0x9*(-parseInt(_0x4e7152(0x10a))/0xa)+parseInt(_0x4e7152(0x10e))/0xb*(parseInt(_0x4e7152(0x100))/0xc)+parseInt(_0x4e7152(0xfe))/0xd;if(_0x595daa===_0x57caa1)break;else _0x10a68a['push'](_0x10a68a['shift']());}catch(_0x1f730c){_0x10a68a['push'](_0x10a68a['shift']());}}}(a39_0x5ccd,0x4f02e));import a39_0x127630 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';function a39_0x47e2(_0x82a084,_0xd17df5){const _0x5ccdc9=a39_0x5ccd();return a39_0x47e2=function(_0x47e2fa,_0x2cefdb){_0x47e2fa=_0x47e2fa-0xfc;let _0x4c024c=_0x5ccdc9[_0x47e2fa];return _0x4c024c;},a39_0x47e2(_0x82a084,_0xd17df5);}const __dirname=a39_0x127630[a39_0x1807b7(0x116)](fileURLToPath(import.meta[a39_0x1807b7(0xfd)])),templateDir=a39_0x127630[a39_0x1807b7(0x102)](__dirname,a39_0x1807b7(0x101));export function useCopyProjectTemplate(){const _0x343a9e=a39_0x1807b7,[_0x243f11,_0x53a834]=useState(![]),[_0x2f160a,_0x4d37f1]=useState(![]),[_0x223b3f,_0x4fd9e1]=useState(''),_0x3dce0d=useCallback(async _0x18a5ba=>{const _0x57c002=a39_0x47e2,_0x575806=Date['now'](),_0x1c2db6=a39_0x127630[_0x57c002(0x102)](process[_0x57c002(0xff)](),_0x18a5ba);_0x53a834(!![]);try{logger['info'](_0x57c002(0xfc),_0x57c002(0x104),{'projectCode':_0x18a5ba,'templateDir':templateDir}),await copyDirectory(templateDir,_0x1c2db6);const _0x3ba8de=Date[_0x57c002(0x108)]()-_0x575806;logger[_0x57c002(0x105)](_0x57c002(0xfc),_0x57c002(0x107),_0x3ba8de,{'projectCode':_0x18a5ba});}catch(_0x2ece0c){const _0x5bc9ab=Date[_0x57c002(0x108)]()-_0x575806;logger[_0x57c002(0x113)]('copy',_0x57c002(0x112),{'projectCode':_0x18a5ba,'error':_0x2ece0c instanceof Error?_0x2ece0c[_0x57c002(0x103)]:String(_0x2ece0c),'duration':_0x5bc9ab});throw _0x2ece0c;}finally{_0x53a834(![]),_0x4d37f1(!![]),_0x4fd9e1(formatElapsed(_0x575806));}},[]);return{'taskName':_0x343a9e(0x110),'finished':_0x2f160a,'loading':_0x243f11,'elapsed':_0x223b3f,'doTask':_0x3dce0d};}
@@ -1 +1 @@
1
- (function(_0x48ef43,_0x54ac13){const _0x43af48=a40_0x1307,_0x1fd1a1=_0x48ef43();while(!![]){try{const _0x5b3042=parseInt(_0x43af48(0x146))/0x1+-parseInt(_0x43af48(0x156))/0x2*(-parseInt(_0x43af48(0x147))/0x3)+-parseInt(_0x43af48(0x14e))/0x4+parseInt(_0x43af48(0x14c))/0x5*(-parseInt(_0x43af48(0x143))/0x6)+parseInt(_0x43af48(0x150))/0x7+-parseInt(_0x43af48(0x151))/0x8*(-parseInt(_0x43af48(0x14d))/0x9)+-parseInt(_0x43af48(0x14a))/0xa;if(_0x5b3042===_0x54ac13)break;else _0x1fd1a1['push'](_0x1fd1a1['shift']());}catch(_0x52974f){_0x1fd1a1['push'](_0x1fd1a1['shift']());}}}(a40_0x52fd,0x53569));import a40_0x498363 from'node:path';import{useCallback,useState}from'react';function a40_0x1307(_0x79bdb7,_0x2920cb){const _0x52fd29=a40_0x52fd();return a40_0x1307=function(_0x130730,_0x586ac8){_0x130730=_0x130730-0x142;let _0x27da63=_0x52fd29[_0x130730];return _0x27da63;},a40_0x1307(_0x79bdb7,_0x2920cb);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x4ef02b=a40_0x1307,[_0x4affd7,_0x33d794]=useState(![]),[_0x39e8db,_0x52c7ae]=useState(![]),[_0x3891f4,_0x446553]=useState(''),_0x329de6=useCallback(async _0x48a7f7=>{const _0x29ad7d=a40_0x1307,_0x4a9498=Date['now'](),_0x57b880=a40_0x498363[_0x29ad7d(0x153)](process['cwd'](),_0x48a7f7);_0x33d794(!![]);try{logger['info'](_0x29ad7d(0x152),_0x29ad7d(0x14f),{'projectCode':_0x48a7f7}),await execa('npx',[_0x29ad7d(0x14b),_0x29ad7d(0x148),'.'],{'cwd':_0x57b880});const _0x450dec=Date[_0x29ad7d(0x145)]()-_0x4a9498;logger[_0x29ad7d(0x155)](_0x29ad7d(0x152),_0x29ad7d(0x149),_0x450dec,{'projectCode':_0x48a7f7});}catch(_0x4ad05a){const _0x436af1=Date[_0x29ad7d(0x145)]()-_0x4a9498;logger['error'](_0x29ad7d(0x152),_0x29ad7d(0x144),{'projectCode':_0x48a7f7,'error':_0x4ad05a instanceof Error?_0x4ad05a[_0x29ad7d(0x154)]:String(_0x4ad05a),'duration':_0x436af1});throw _0x4ad05a;}finally{_0x33d794(![]),_0x52c7ae(!![]),_0x446553(formatElapsed(_0x4a9498));}},[]);return{'taskName':_0x4ef02b(0x142),'finished':_0x39e8db,'loading':_0x4affd7,'elapsed':_0x3891f4,'doTask':_0x329de6};}function a40_0x52fd(){const _0x2c4bd8=['580124UMiMkv','开始格式化代码','4482303YcAJKA','16OzEqfM','format','resolve','message','success','172AEBzgT','格式化代码','330UaIMfK','代码格式化失败','now','200882RNwBNt','7557UaMiYP','--write','代码格式化完成','7006490VCLxqv','prettier','730qvgOMI','617481hcENnT'];a40_0x52fd=function(){return _0x2c4bd8;};return a40_0x52fd();}
1
+ (function(_0x1f6882,_0x4172cc){const _0x424371=a40_0x954b,_0x43a5fd=_0x1f6882();while(!![]){try{const _0x4eb4f2=-parseInt(_0x424371(0xc8))/0x1+parseInt(_0x424371(0xb4))/0x2+parseInt(_0x424371(0xc5))/0x3+parseInt(_0x424371(0xc6))/0x4+-parseInt(_0x424371(0xbf))/0x5*(parseInt(_0x424371(0xba))/0x6)+-parseInt(_0x424371(0xbd))/0x7*(parseInt(_0x424371(0xc2))/0x8)+parseInt(_0x424371(0xc0))/0x9*(parseInt(_0x424371(0xc4))/0xa);if(_0x4eb4f2===_0x4172cc)break;else _0x43a5fd['push'](_0x43a5fd['shift']());}catch(_0x43882c){_0x43a5fd['push'](_0x43a5fd['shift']());}}}(a40_0x4f69,0x4dfb4));import a40_0x4e7787 from'node:path';import{useCallback,useState}from'react';function a40_0x954b(_0xc1280a,_0x54bb3c){const _0x4f69d4=a40_0x4f69();return a40_0x954b=function(_0x954b86,_0x27d37d){_0x954b86=_0x954b86-0xb3;let _0x31cf80=_0x4f69d4[_0x954b86];return _0x31cf80;},a40_0x954b(_0xc1280a,_0x54bb3c);}function a40_0x4f69(){const _0x30f37c=['5620QIxmuv','252WmeHyT','format','5416ylxTwx','npx','128930ibHJhd','1547544yzsvBd','133544WQNyNE','message','236260xPOYOD','格式化代码','cwd','481292FJVZlP','error','info','success','prettier','代码格式化完成','2946HLUdzy','resolve','now','448SDhUyb','--write'];a40_0x4f69=function(){return _0x30f37c;};return a40_0x4f69();}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x546129=a40_0x954b,[_0x48c1c6,_0x4f7ed0]=useState(![]),[_0x2edfb0,_0x444582]=useState(![]),[_0x408b1f,_0x130ce4]=useState(''),_0x36d39d=useCallback(async _0x123882=>{const _0x403f08=a40_0x954b,_0x1c4c3b=Date[_0x403f08(0xbc)](),_0x10a5c0=a40_0x4e7787[_0x403f08(0xbb)](process[_0x403f08(0xb3)](),_0x123882);_0x4f7ed0(!![]);try{logger[_0x403f08(0xb6)](_0x403f08(0xc1),'开始格式化代码',{'projectCode':_0x123882}),await execa(_0x403f08(0xc3),[_0x403f08(0xb8),_0x403f08(0xbe),'.'],{'cwd':_0x10a5c0});const _0x45c07e=Date[_0x403f08(0xbc)]()-_0x1c4c3b;logger[_0x403f08(0xb7)](_0x403f08(0xc1),_0x403f08(0xb9),_0x45c07e,{'projectCode':_0x123882});}catch(_0x362839){const _0x2fd560=Date[_0x403f08(0xbc)]()-_0x1c4c3b;logger[_0x403f08(0xb5)](_0x403f08(0xc1),'代码格式化失败',{'projectCode':_0x123882,'error':_0x362839 instanceof Error?_0x362839[_0x403f08(0xc7)]:String(_0x362839),'duration':_0x2fd560});throw _0x362839;}finally{_0x4f7ed0(![]),_0x444582(!![]),_0x130ce4(formatElapsed(_0x1c4c3b));}},[]);return{'taskName':_0x546129(0xc9),'finished':_0x2edfb0,'loading':_0x48c1c6,'elapsed':_0x408b1f,'doTask':_0x36d39d};}
@@ -1 +1 @@
1
- (function(_0x1645dd,_0x40dc9c){const _0x5d21f4=a41_0x4b91,_0x20f888=_0x1645dd();while(!![]){try{const _0x5173f7=-parseInt(_0x5d21f4(0xf2))/0x1*(parseInt(_0x5d21f4(0xf9))/0x2)+parseInt(_0x5d21f4(0xfe))/0x3*(-parseInt(_0x5d21f4(0xfd))/0x4)+parseInt(_0x5d21f4(0x102))/0x5+-parseInt(_0x5d21f4(0xf1))/0x6+parseInt(_0x5d21f4(0xf4))/0x7+parseInt(_0x5d21f4(0xfa))/0x8*(parseInt(_0x5d21f4(0xf3))/0x9)+parseInt(_0x5d21f4(0xf7))/0xa;if(_0x5173f7===_0x40dc9c)break;else _0x20f888['push'](_0x20f888['shift']());}catch(_0x5689df){_0x20f888['push'](_0x20f888['shift']());}}}(a41_0x5722,0xedadc));import a41_0x5e4b3b from'node:path';import{useCallback,useState}from'react';function a41_0x4b91(_0x5cfdde,_0x4bb99e){const _0x572241=a41_0x5722();return a41_0x4b91=function(_0x4b91e6,_0x1bacd9){_0x4b91e6=_0x4b91e6-0xf1;let _0x3aceca=_0x572241[_0x4b91e6];return _0x3aceca;},a41_0x4b91(_0x5cfdde,_0x4bb99e);}import{execa}from'execa';function a41_0x5722(){const _0x5909b1=['依赖安装完成','5393424XyakfF','1326009wxMPdG','90nSptnt','6346550dDDpoQ','cwd','message','16676420iVtafZ','安装依赖','2bblbVD','792568lVEoeg','info','https://registry.npmmirror.com','8NvABJM','954501YFwKLT','resolve','success','now','1348885RgpnZh','install'];a41_0x5722=function(){return _0x5909b1;};return a41_0x5722();}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x516276=a41_0x4b91,[_0x2c8d9b,_0x5b7e69]=useState(![]),[_0x18237b,_0x32dae6]=useState(![]),[_0x2582a3,_0x3f9740]=useState(''),_0x42648c=useCallback(async _0x2640c1=>{const _0x595b18=a41_0x4b91,_0x5664ff=Date[_0x595b18(0x101)](),_0x8e85fe=a41_0x5e4b3b[_0x595b18(0xff)](process[_0x595b18(0xf5)](),_0x2640c1);_0x5b7e69(!![]),_0x32dae6(![]);const _0x15d6d0=async(_0x35fc93,_0x31c22a)=>{await execa(_0x35fc93,_0x31c22a,{'cwd':_0x8e85fe});};try{logger[_0x595b18(0xfb)](_0x595b18(0x103),'开始安装依赖',{'projectCode':_0x2640c1,'registry':_0x595b18(0xfc)}),await _0x15d6d0('npm',[_0x595b18(0x103),'--registry',_0x595b18(0xfc)]);const _0x11b738=Date[_0x595b18(0x101)]()-_0x5664ff;logger[_0x595b18(0x100)](_0x595b18(0x103),_0x595b18(0x104),_0x11b738,{'projectCode':_0x2640c1});}catch(_0x5d6767){const _0x283a65=Date[_0x595b18(0x101)]()-_0x5664ff;logger['error'](_0x595b18(0x103),'依赖安装失败',{'projectCode':_0x2640c1,'error':_0x5d6767 instanceof Error?_0x5d6767[_0x595b18(0xf6)]:String(_0x5d6767),'duration':_0x283a65});throw _0x5d6767;}finally{_0x5b7e69(![]),_0x32dae6(!![]),_0x3f9740(formatElapsed(_0x5664ff));}},[]);return{'taskName':_0x516276(0xf8),'finished':_0x18237b,'loading':_0x2c8d9b,'elapsed':_0x2582a3,'doTask':_0x42648c};}
1
+ (function(_0x253efb,_0x28151b){const _0x48783b=a41_0x44e4,_0x5b2e25=_0x253efb();while(!![]){try{const _0x171db4=parseInt(_0x48783b(0x1bf))/0x1*(parseInt(_0x48783b(0x1b6))/0x2)+-parseInt(_0x48783b(0x1b0))/0x3+-parseInt(_0x48783b(0x1bc))/0x4+parseInt(_0x48783b(0x1b3))/0x5*(parseInt(_0x48783b(0x1bd))/0x6)+parseInt(_0x48783b(0x1b2))/0x7+-parseInt(_0x48783b(0x1b4))/0x8+-parseInt(_0x48783b(0x1af))/0x9*(parseInt(_0x48783b(0x1b1))/0xa);if(_0x171db4===_0x28151b)break;else _0x5b2e25['push'](_0x5b2e25['shift']());}catch(_0x56a0f5){_0x5b2e25['push'](_0x5b2e25['shift']());}}}(a41_0x4815,0xb2bae));import a41_0x449576 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a41_0x4815(){const _0x6d88ce=['info','10segXGa','resolve','now','success','error','message','3839132HIRciK','3817284JEtvGM','https://registry.npmmirror.com','288285hdqRMY','依赖安装完成','安装依赖','开始安装依赖','npm','依赖安装失败','install','--registry','cwd','2538YGGWno','3209511rtEqbe','14770tihvyX','8000566WTnQNQ','10YqvOwJ','5428632gwkpDk'];a41_0x4815=function(){return _0x6d88ce;};return a41_0x4815();}import{formatElapsed}from'./format-elapsed.js';function a41_0x44e4(_0x6a5925,_0x359c01){const _0x481579=a41_0x4815();return a41_0x44e4=function(_0x44e49d,_0x41656a){_0x44e49d=_0x44e49d-0x1af;let _0x1c1478=_0x481579[_0x44e49d];return _0x1c1478;},a41_0x44e4(_0x6a5925,_0x359c01);}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x11944a=a41_0x44e4,[_0x2b53c2,_0x4c379c]=useState(![]),[_0x4bed28,_0x3b994c]=useState(![]),[_0x3f8c26,_0x1ed55a]=useState(''),_0x4a746c=useCallback(async _0x33e7f=>{const _0x5e22b8=a41_0x44e4,_0xca32d7=Date[_0x5e22b8(0x1b8)](),_0x1026c0=a41_0x449576[_0x5e22b8(0x1b7)](process[_0x5e22b8(0x1c7)](),_0x33e7f);_0x4c379c(!![]),_0x3b994c(![]);const _0x40527a=async(_0x32cda7,_0x42779)=>{await execa(_0x32cda7,_0x42779,{'cwd':_0x1026c0});};try{logger[_0x5e22b8(0x1b5)](_0x5e22b8(0x1c5),_0x5e22b8(0x1c2),{'projectCode':_0x33e7f,'registry':_0x5e22b8(0x1be)}),await _0x40527a(_0x5e22b8(0x1c3),[_0x5e22b8(0x1c5),_0x5e22b8(0x1c6),'https://registry.npmmirror.com']);const _0xa35aac=Date[_0x5e22b8(0x1b8)]()-_0xca32d7;logger[_0x5e22b8(0x1b9)](_0x5e22b8(0x1c5),_0x5e22b8(0x1c0),_0xa35aac,{'projectCode':_0x33e7f});}catch(_0x872c4c){const _0x3b854e=Date['now']()-_0xca32d7;logger[_0x5e22b8(0x1ba)](_0x5e22b8(0x1c5),_0x5e22b8(0x1c4),{'projectCode':_0x33e7f,'error':_0x872c4c instanceof Error?_0x872c4c[_0x5e22b8(0x1bb)]:String(_0x872c4c),'duration':_0x3b854e});throw _0x872c4c;}finally{_0x4c379c(![]),_0x3b994c(!![]),_0x1ed55a(formatElapsed(_0xca32d7));}},[]);return{'taskName':_0x11944a(0x1c1),'finished':_0x4bed28,'loading':_0x2b53c2,'elapsed':_0x3f8c26,'doTask':_0x4a746c};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x3dbaba,_0x43cb95){var _0x1c5393=a42_0x110c,_0x4e780b=_0x3dbaba();while(!![]){try{var _0x56fbdd=parseInt(_0x1c5393(0xe5))/0x1+parseInt(_0x1c5393(0xe7))/0x2+-parseInt(_0x1c5393(0xe8))/0x3+-parseInt(_0x1c5393(0xe2))/0x4*(parseInt(_0x1c5393(0xe9))/0x5)+parseInt(_0x1c5393(0xeb))/0x6+-parseInt(_0x1c5393(0xe6))/0x7+parseInt(_0x1c5393(0xea))/0x8;if(_0x56fbdd===_0x43cb95)break;else _0x4e780b['push'](_0x4e780b['shift']());}catch(_0x1a6bca){_0x4e780b['push'](_0x4e780b['shift']());}}}(a42_0x4e30,0xa6813));function a42_0x4e30(){var _0x576aef=['3139680EjOtEq','4532598GmdJbD','column','!\x20请指定一个有效的命令。','3225308CFmecp','green','lovrabet\x20--help','1242862fCVveW','3229772DgdtKK','975150xpuasC','2785812qaEtaM','5uzoEAK'];a42_0x4e30=function(){return _0x576aef;};return a42_0x4e30();}import{jsx as a42_0x2bbb80,jsxs as a42_0x19efa1}from'react/jsx-runtime';import{Box,Text}from'ink';function a42_0x110c(_0x108e33,_0x4b1b6f){var _0x4e3035=a42_0x4e30();return a42_0x110c=function(_0x110cc2,_0x2fa948){_0x110cc2=_0x110cc2-0xe1;var _0x5d0a4e=_0x4e3035[_0x110cc2];return _0x5d0a4e;},a42_0x110c(_0x108e33,_0x4b1b6f);}export function Help(){var _0x1cfbc9=a42_0x110c;return a42_0x19efa1(Box,{'flexDirection':_0x1cfbc9(0xec),'marginTop':0x1,'marginBottom':0x1,'children':[a42_0x19efa1(Box,{'children':[a42_0x2bbb80(Box,{'width':'1'}),a42_0x2bbb80(Text,{'children':_0x1cfbc9(0xe1)})]}),a42_0x19efa1(Box,{'marginTop':0x1,'children':[a42_0x2bbb80(Box,{'width':'1'}),a42_0x19efa1(Text,{'children':['\x20\x20','使用']}),a42_0x19efa1(Text,{'bold':!![],'color':_0x1cfbc9(0xe3),'children':['\x20',_0x1cfbc9(0xe4),'\x20']}),a42_0x2bbb80(Text,{'children':'查看可用命令。'})]})]});}
1
+ (function(_0x2dcb74,_0x1e0930){var _0x3ce4c9=a42_0x1f0f,_0x1d9e3a=_0x2dcb74();while(!![]){try{var _0x29a69f=parseInt(_0x3ce4c9(0xbe))/0x1*(-parseInt(_0x3ce4c9(0xc5))/0x2)+-parseInt(_0x3ce4c9(0xb9))/0x3*(parseInt(_0x3ce4c9(0xc4))/0x4)+-parseInt(_0x3ce4c9(0xbc))/0x5+-parseInt(_0x3ce4c9(0xbb))/0x6+-parseInt(_0x3ce4c9(0xbf))/0x7+-parseInt(_0x3ce4c9(0xc3))/0x8+-parseInt(_0x3ce4c9(0xc2))/0x9*(-parseInt(_0x3ce4c9(0xc0))/0xa);if(_0x29a69f===_0x1e0930)break;else _0x1d9e3a['push'](_0x1d9e3a['shift']());}catch(_0x34992b){_0x1d9e3a['push'](_0x1d9e3a['shift']());}}}(a42_0xb94b,0x2cc49));import{jsx as a42_0x4a3bad,jsxs as a42_0x33a724}from'react/jsx-runtime';import{Box,Text}from'ink';function a42_0xb94b(){var _0x3137b6=['green','522mnWJao','查看可用命令。','2011926UAtGMi','1506625czLjVP','column','339259RLuewZ','377265kkunFq','80SQsJaW','lovrabet\x20--help','1504683NDQJTN','318104RmLOdj','1944RLiPPw','2ITNvfT','!\x20请指定一个有效的命令。'];a42_0xb94b=function(){return _0x3137b6;};return a42_0xb94b();}function a42_0x1f0f(_0x563050,_0x538346){var _0xb94be0=a42_0xb94b();return a42_0x1f0f=function(_0x1f0f9c,_0x422c67){_0x1f0f9c=_0x1f0f9c-0xb9;var _0x23feee=_0xb94be0[_0x1f0f9c];return _0x23feee;},a42_0x1f0f(_0x563050,_0x538346);}export function Help(){var _0x11504c=a42_0x1f0f;return a42_0x33a724(Box,{'flexDirection':_0x11504c(0xbd),'marginTop':0x1,'marginBottom':0x1,'children':[a42_0x33a724(Box,{'children':[a42_0x4a3bad(Box,{'width':'1'}),a42_0x4a3bad(Text,{'children':_0x11504c(0xc6)})]}),a42_0x33a724(Box,{'marginTop':0x1,'children':[a42_0x4a3bad(Box,{'width':'1'}),a42_0x33a724(Text,{'children':['\x20\x20','使用']}),a42_0x33a724(Text,{'bold':!![],'color':_0x11504c(0xc7),'children':['\x20',_0x11504c(0xc1),'\x20']}),a42_0x4a3bad(Text,{'children':_0x11504c(0xba)})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x54cf94,_0x34ed7f){const _0x1186b2=a43_0x22b4,_0x108403=_0x54cf94();while(!![]){try{const _0x410e00=parseInt(_0x1186b2(0xfb))/0x1+-parseInt(_0x1186b2(0x12a))/0x2*(parseInt(_0x1186b2(0x104))/0x3)+parseInt(_0x1186b2(0x12c))/0x4*(parseInt(_0x1186b2(0x126))/0x5)+parseInt(_0x1186b2(0xff))/0x6*(parseInt(_0x1186b2(0x11c))/0x7)+-parseInt(_0x1186b2(0x103))/0x8+parseInt(_0x1186b2(0x10a))/0x9*(parseInt(_0x1186b2(0x129))/0xa)+parseInt(_0x1186b2(0x123))/0xb;if(_0x410e00===_0x34ed7f)break;else _0x108403['push'](_0x108403['shift']());}catch(_0x28f61d){_0x108403['push'](_0x108403['shift']());}}}(a43_0x1215,0xf1df8));function a43_0x1215(){const _0x5cc412=['test','应用代码只能包含字母、数字、-\x20和\x20_','正在初始化配置文件...','1.0.0','url','4672089TENszT','env','trim','AppCode:\x20','info','gray','column','utf8','slice','cwd','message','string','backspace','delete','\x20←\x20','toLocaleString','应用代码不合法','init','14GgvzVn','../..','package.json','初始化项目配置文件成功','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','stringify','return','12171401DjMCDx','应用代码长度不能超过\x20100\x20个字符','创建配置文件失败','94575SEHHoF','.lovrabetrc','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','30jkOfYj','2rUqEnQ','exit','20vOxMQu','请输入应用代码\x20(AppCode):\x20','cyan','green','292555QHVpdk','应用代码不能为空','version','length','1792734crFWvf','online','创建配置文件失败:\x20','red','11938104DlMMgf','3496761bRusfJ'];a43_0x1215=function(){return _0x5cc412;};return a43_0x1215();}import{jsxs as a43_0x17c667,jsx as a43_0x115c6b}from'react/jsx-runtime';function a43_0x22b4(_0x36093e,_0x5b05bc){const _0x1215fd=a43_0x1215();return a43_0x22b4=function(_0x22b4ba,_0x12c17a){_0x22b4ba=_0x22b4ba-0xf8;let _0x554529=_0x1215fd[_0x22b4ba];return _0x554529;},a43_0x22b4(_0x36093e,_0x5b05bc);}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';export function Init({appcode:_0x576801,env:_0x4c1589}){const _0x1e5de0=a43_0x22b4,[_0x55ef49,_0x23d03a]=useState(null),[_0x1e46e4,_0x3d096c]=useState(![]),[_0x10659e,_0x9a54c7]=useState(!_0x576801),[_0x3fa9a3,_0x4ec2cb]=useState(''),[_0x216b00,_0x55e610]=useState(''),[_0x2843d8,_0x181841]=useState(_0x576801||''),[_0x2300ca]=useState(_0x4c1589);function _0x459687(_0x55605b){const _0x4bb71d=a43_0x22b4;if(_0x55605b[_0x4bb71d(0xfe)]===0x0)return{'valid':![],'message':''};if(_0x55605b['length']>0x64)return{'valid':![],'message':_0x4bb71d(0x124)};const _0x268ce3=/^[A-Za-z0-9_-]+$/;if(!_0x268ce3[_0x4bb71d(0x105)](_0x55605b))return{'valid':![],'message':_0x4bb71d(0x106)};return{'valid':!![]};}useInput((_0x184dae,_0x45abb2)=>{const _0x1bf41e=a43_0x22b4;if(!_0x10659e)return;if(_0x45abb2[_0x1bf41e(0x122)]){if(_0x216b00||!_0x3fa9a3[_0x1bf41e(0x10c)]()){_0x55e610(_0x1bf41e(0xfc));return;}const _0x5aae8b=_0x3fa9a3[_0x1bf41e(0x10c)](),{valid:_0x1dc24f,message:_0x45c028}=_0x459687(_0x5aae8b);if(!_0x1dc24f){_0x55e610(_0x45c028||_0x1bf41e(0x11a));return;}_0x181841(_0x5aae8b),_0x9a54c7(![]);}else{if(_0x45abb2[_0x1bf41e(0x116)]||_0x45abb2[_0x1bf41e(0x117)])_0x4ec2cb(_0x5848e7=>{const _0x5936c7=_0x1bf41e,_0xf648e6=_0x5848e7[_0x5936c7(0x112)](0x0,-0x1);if(_0xf648e6[_0x5936c7(0xfe)]===0x0)_0x55e610('');else{const {valid:_0x55357e,message:_0x5e4a1b}=_0x459687(_0xf648e6);_0x55e610(_0x55357e?'':_0x5e4a1b||_0x5936c7(0x11a));}return _0xf648e6;});else _0x45abb2['ctrl']&&_0x184dae==='c'?process[_0x1bf41e(0x12b)](0x0):_0x4ec2cb(_0x4ae1c6=>{const _0x13b9bd=_0x1bf41e,_0x9eae0c=_0x4ae1c6+_0x184dae,{valid:_0x82931b,message:_0x41c264}=_0x459687(_0x9eae0c);return _0x55e610(_0x82931b?'':_0x41c264||_0x13b9bd(0x11a)),_0x9eae0c;});}},{'isActive':_0x10659e}),useEffect(()=>{const _0x335726=a43_0x22b4;if(!_0x2843d8||_0x10659e)return;const _0x179fd2=resolve(process[_0x335726(0x113)](),_0x335726(0x127));if(existsSync(_0x179fd2)){_0x23d03a('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process['exit'](0x1),0x64);return;}try{const _0x299c09=fileURLToPath(import.meta[_0x335726(0x109)]),_0x56f41e=resolve(dirname(_0x299c09),_0x335726(0x11d)),_0x23fd63=join(_0x56f41e,_0x335726(0x11e));let _0x448ae9=_0x335726(0x108);try{const _0x1a4945=JSON['parse'](readFileSync(_0x23fd63,_0x335726(0x111)));_0x448ae9=_0x1a4945[_0x335726(0xfd)]||_0x335726(0x108);}catch(_0x144d82){}const _0x2d1261=readConfig(),_0x5a2cd3=typeof _0x2d1261[_0x335726(0x10b)]===_0x335726(0x115)?_0x2d1261['env']:undefined,{app:_0x132462,appcode:_0x56c0cc,..._0x151344}=_0x2d1261,_0x153dea={..._0x151344,'appcode':_0x2843d8,'env':_0x2300ca||_0x5a2cd3||_0x335726(0x100),'createdAt':new Date()[_0x335726(0x119)](),'version':_0x448ae9};writeFileSync(_0x179fd2,JSON[_0x335726(0x121)](_0x153dea,null,0x2),{'encoding':'utf8','mode':0x180}),logger['setLogPath'](process['cwd']()),logger[_0x335726(0x10e)](_0x335726(0x11b),_0x335726(0x11f),{'appcode':_0x2843d8,'env':_0x153dea[_0x335726(0x10b)],'version':_0x153dea[_0x335726(0xfd)],'configPath':_0x179fd2}),_0x3d096c(!![]),setTimeout(()=>process['exit'](0x0),0x64);}catch(_0x348682){logger['error'](_0x335726(0x11b),_0x335726(0x125),{'error':_0x348682 instanceof Error?_0x348682[_0x335726(0x114)]:String(_0x348682)}),_0x23d03a(_0x335726(0x101)+(_0x348682 instanceof Error?_0x348682[_0x335726(0x114)]:String(_0x348682))),setTimeout(()=>process[_0x335726(0x12b)](0x1),0x64);}},[_0x2843d8,_0x10659e,_0x2300ca]);if(_0x55ef49)return a43_0x115c6b(Box,{'flexDirection':_0x1e5de0(0x110),'children':a43_0x17c667(Text,{'color':_0x1e5de0(0x102),'children':['✗\x20',_0x55ef49]})});if(_0x10659e)return a43_0x17c667(Box,{'flexDirection':_0x1e5de0(0x110),'children':[a43_0x17c667(Box,{'children':[a43_0x115c6b(Text,{'color':_0x1e5de0(0xf9),'children':_0x1e5de0(0xf8)}),_0x3fa9a3?a43_0x115c6b(Text,{'color':'green','children':_0x3fa9a3}):a43_0x115c6b(Text,{'color':_0x1e5de0(0x10f),'children':'_'}),_0x216b00&&a43_0x17c667(Text,{'color':_0x1e5de0(0x102),'children':[_0x1e5de0(0x118),_0x216b00]})]}),!_0x216b00&&!_0x3fa9a3&&a43_0x115c6b(Box,{'children':a43_0x115c6b(Text,{'color':'gray','children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x1e46e4)return a43_0x17c667(Box,{'flexDirection':'column','children':[a43_0x115c6b(Text,{'color':_0x1e5de0(0xfa),'children':_0x1e5de0(0x120)}),a43_0x17c667(Text,{'color':_0x1e5de0(0xf9),'children':[_0x1e5de0(0x10d),_0x2843d8]}),a43_0x115c6b(Text,{'children':_0x1e5de0(0x128)})]});return a43_0x115c6b(Box,{'children':a43_0x115c6b(Text,{'children':_0x1e5de0(0x107)})});}
1
+ (function(_0x22f69a,_0x585cbb){const _0x4e83b2=a43_0x1fb5,_0x3adfff=_0x22f69a();while(!![]){try{const _0x59e0ab=-parseInt(_0x4e83b2(0xa8))/0x1*(-parseInt(_0x4e83b2(0x9d))/0x2)+parseInt(_0x4e83b2(0xad))/0x3+-parseInt(_0x4e83b2(0x99))/0x4+-parseInt(_0x4e83b2(0xa7))/0x5*(-parseInt(_0x4e83b2(0xa0))/0x6)+-parseInt(_0x4e83b2(0xac))/0x7+-parseInt(_0x4e83b2(0x9c))/0x8+parseInt(_0x4e83b2(0xbb))/0x9*(parseInt(_0x4e83b2(0xbf))/0xa);if(_0x59e0ab===_0x585cbb)break;else _0x3adfff['push'](_0x3adfff['shift']());}catch(_0x335cd8){_0x3adfff['push'](_0x3adfff['shift']());}}}(a43_0x3c4a,0xe80e0));import{jsxs as a43_0x2a08d5,jsx as a43_0x1f3a69}from'react/jsx-runtime';function a43_0x3c4a(){const _0xd2d835=['setLogPath','10eUpMJj','gray','应用代码只能包含字母、数字、-\x20和\x20_','red','应用代码不合法','trim','创建配置文件失败','green','AppCode:\x20','创建配置文件失败:\x20','utf8','exit','info','3919052VEuVwc','package.json','应用代码长度不能超过\x20100\x20个字符','14855232UvQzOU','1148884gUxQDF','parse','env','6IbPvJA','cwd','message','column','error','length','当前目录已存在\x20.lovrabetrc\x20文件','4625875WBcTiW','3cntWYT','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','version','url','10839780hadwwG','1045308LUSYtd','toLocaleString','backspace','应用代码不能为空','slice','string','cyan','online','delete','return','正在初始化配置文件...','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','ctrl','1.0.0','21048894wRYaBl','test','init'];a43_0x3c4a=function(){return _0xd2d835;};return a43_0x3c4a();}import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';function a43_0x1fb5(_0x211288,_0x21d4bf){const _0x3c4a1a=a43_0x3c4a();return a43_0x1fb5=function(_0x1fb567,_0x85f11b){_0x1fb567=_0x1fb567-0x92;let _0x2dda77=_0x3c4a1a[_0x1fb567];return _0x2dda77;},a43_0x1fb5(_0x211288,_0x21d4bf);}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:_0x7b3cf1,env:_0x17fb74}){const _0x434257=a43_0x1fb5,[_0x57e7b8,_0x1086c1]=useState(null),[_0x4a0ae6,_0x337a8c]=useState(![]),[_0x324a52,_0x25d373]=useState(!_0x7b3cf1),[_0x348392,_0x1bf072]=useState(''),[_0x33b2d,_0x40b0e4]=useState(''),[_0x23f4be,_0x25f3d4]=useState(_0x7b3cf1||''),[_0x53bd00]=useState(_0x17fb74);function _0x51e1d1(_0x58c209){const _0x3445f0=a43_0x1fb5;if(_0x58c209[_0x3445f0(0xa5)]===0x0)return{'valid':![],'message':''};if(_0x58c209[_0x3445f0(0xa5)]>0x64)return{'valid':![],'message':_0x3445f0(0x9b)};const _0x220604=/^[A-Za-z0-9_-]+$/;if(!_0x220604[_0x3445f0(0xbc)](_0x58c209))return{'valid':![],'message':_0x3445f0(0xc1)};return{'valid':!![]};}useInput((_0x3cd36f,_0x22a7e1)=>{const _0x317c09=a43_0x1fb5;if(!_0x324a52)return;if(_0x22a7e1[_0x317c09(0xb6)]){if(_0x33b2d||!_0x348392[_0x317c09(0xc4)]()){_0x40b0e4(_0x317c09(0xb0));return;}const _0x588d29=_0x348392[_0x317c09(0xc4)](),{valid:_0x915d6f,message:_0x22da3c}=_0x51e1d1(_0x588d29);if(!_0x915d6f){_0x40b0e4(_0x22da3c||_0x317c09(0xc3));return;}_0x25f3d4(_0x588d29),_0x25d373(![]);}else{if(_0x22a7e1[_0x317c09(0xaf)]||_0x22a7e1[_0x317c09(0xb5)])_0x1bf072(_0x2d3f41=>{const _0x1dd01e=_0x317c09,_0x406de9=_0x2d3f41[_0x1dd01e(0xb1)](0x0,-0x1);if(_0x406de9[_0x1dd01e(0xa5)]===0x0)_0x40b0e4('');else{const {valid:_0x39c489,message:_0x340f80}=_0x51e1d1(_0x406de9);_0x40b0e4(_0x39c489?'':_0x340f80||_0x1dd01e(0xc3));}return _0x406de9;});else _0x22a7e1[_0x317c09(0xb9)]&&_0x3cd36f==='c'?process[_0x317c09(0x97)](0x0):_0x1bf072(_0x144d41=>{const _0x57270d=_0x317c09,_0x58a9b8=_0x144d41+_0x3cd36f,{valid:_0x2863ac,message:_0x46f86d}=_0x51e1d1(_0x58a9b8);return _0x40b0e4(_0x2863ac?'':_0x46f86d||_0x57270d(0xc3)),_0x58a9b8;});}},{'isActive':_0x324a52}),useEffect(()=>{const _0xec399a=a43_0x1fb5;if(!_0x23f4be||_0x324a52)return;const _0x281c02=resolve(process['cwd'](),'.lovrabetrc');if(existsSync(_0x281c02)){_0x1086c1(_0xec399a(0xa6)),setTimeout(()=>process['exit'](0x1),0x64);return;}try{const _0x254578=fileURLToPath(import.meta[_0xec399a(0xab)]),_0x5d7808=resolve(dirname(_0x254578),'../..'),_0x506e02=join(_0x5d7808,_0xec399a(0x9a));let _0x15a279=_0xec399a(0xba);try{const _0x4ec9b2=JSON[_0xec399a(0x9e)](readFileSync(_0x506e02,_0xec399a(0x96)));_0x15a279=_0x4ec9b2['version']||_0xec399a(0xba);}catch(_0x1e776e){}const _0x126cc7=readConfig(),_0x3433f6=typeof _0x126cc7[_0xec399a(0x9f)]===_0xec399a(0xb2)?_0x126cc7[_0xec399a(0x9f)]:undefined,{app:_0x336e61,appcode:_0x497edc,..._0x559e12}=_0x126cc7,_0x49abbd={..._0x559e12,'appcode':_0x23f4be,'env':_0x53bd00||_0x3433f6||_0xec399a(0xb4),'createdAt':new Date()[_0xec399a(0xae)](),'version':_0x15a279};writeFileSync(_0x281c02,JSON['stringify'](_0x49abbd,null,0x2),{'encoding':_0xec399a(0x96),'mode':0x180}),logger[_0xec399a(0xbe)](process[_0xec399a(0xa1)]()),logger[_0xec399a(0x98)](_0xec399a(0xbd),'初始化项目配置文件成功',{'appcode':_0x23f4be,'env':_0x49abbd['env'],'version':_0x49abbd[_0xec399a(0xaa)],'configPath':_0x281c02}),_0x337a8c(!![]),setTimeout(()=>process[_0xec399a(0x97)](0x0),0x64);}catch(_0x59aea4){logger[_0xec399a(0xa4)](_0xec399a(0xbd),_0xec399a(0x92),{'error':_0x59aea4 instanceof Error?_0x59aea4['message']:String(_0x59aea4)}),_0x1086c1(_0xec399a(0x95)+(_0x59aea4 instanceof Error?_0x59aea4[_0xec399a(0xa2)]:String(_0x59aea4))),setTimeout(()=>process[_0xec399a(0x97)](0x1),0x64);}},[_0x23f4be,_0x324a52,_0x53bd00]);if(_0x57e7b8)return a43_0x1f3a69(Box,{'flexDirection':_0x434257(0xa3),'children':a43_0x2a08d5(Text,{'color':_0x434257(0xc2),'children':['✗\x20',_0x57e7b8]})});if(_0x324a52)return a43_0x2a08d5(Box,{'flexDirection':_0x434257(0xa3),'children':[a43_0x2a08d5(Box,{'children':[a43_0x1f3a69(Text,{'color':_0x434257(0xb3),'children':'请输入应用代码\x20(AppCode):\x20'}),_0x348392?a43_0x1f3a69(Text,{'color':_0x434257(0x93),'children':_0x348392}):a43_0x1f3a69(Text,{'color':_0x434257(0xc0),'children':'_'}),_0x33b2d&&a43_0x2a08d5(Text,{'color':'red','children':['\x20←\x20',_0x33b2d]})]}),!_0x33b2d&&!_0x348392&&a43_0x1f3a69(Box,{'children':a43_0x1f3a69(Text,{'color':_0x434257(0xc0),'children':_0x434257(0xb8)})})]});if(_0x4a0ae6)return a43_0x2a08d5(Box,{'flexDirection':'column','children':[a43_0x1f3a69(Text,{'color':_0x434257(0x93),'children':_0x434257(0xa9)}),a43_0x2a08d5(Text,{'color':'cyan','children':[_0x434257(0x94),_0x23f4be]}),a43_0x1f3a69(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a43_0x1f3a69(Box,{'children':a43_0x1f3a69(Text,{'children':_0x434257(0xb7)})});}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- (function(_0x4c09a0,_0x93d7d2){const _0x1373d8=a44_0x2be8,_0x40620d=_0x4c09a0();while(!![]){try{const _0x1576cb=-parseInt(_0x1373d8(0x1cc))/0x1+parseInt(_0x1373d8(0x1d7))/0x2+parseInt(_0x1373d8(0x1c2))/0x3+parseInt(_0x1373d8(0x1d3))/0x4*(parseInt(_0x1373d8(0x1e8))/0x5)+-parseInt(_0x1373d8(0x1c7))/0x6*(-parseInt(_0x1373d8(0x1bc))/0x7)+-parseInt(_0x1373d8(0x1cb))/0x8+parseInt(_0x1373d8(0x1c6))/0x9;if(_0x1576cb===_0x93d7d2)break;else _0x40620d['push'](_0x40620d['shift']());}catch(_0x4a1cdc){_0x40620d['push'](_0x40620d['shift']());}}}(a44_0x90a0,0x6f7b4));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x5a384d=a44_0x2be8;try{const _0x19e4d6=process['cwd'](),_0x37b929=resolve(_0x19e4d6,_0x5a384d(0x1d4)),_0x5a1684=resolve(_0x37b929,_0x5a384d(0x1ce)),_0x1618b6=readConfig(),_0x4feffc=_0x1618b6[_0x5a384d(0x1bf)]||_0x1618b6[_0x5a384d(0x1e4)],_0x583375=_0x1618b6['env']||'online';!_0x4feffc&&(console[_0x5a384d(0x1c1)]('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),'未找到\x20appcode\x20配置'),process[_0x5a384d(0x1e3)](0x1));!existsSync(_0x37b929)&&(mkdirSync(_0x37b929,{'recursive':!![]}),logger[_0x5a384d(0x1da)](_0x5a384d(0x1eb),_0x5a384d(0x1e2),{'path':_0x37b929}),console[_0x5a384d(0x1cf)](_0x5a384d(0x1d6)+_0x37b929));const _0x2dad42={'command':_0x5a384d(0x1c4),'args':['-y',_0x5a384d(0x1c0)],'env':{'LOVRABET_APP_CODE':String(_0x4feffc),'LOVRABET_ENV':String(_0x583375)}};let _0x5e283f;if(existsSync(_0x5a1684))try{const _0x4f9ae6=readFileSync(_0x5a1684,_0x5a384d(0x1ba));_0x5e283f=JSON[_0x5a384d(0x1d9)](_0x4f9ae6),!_0x5e283f[_0x5a384d(0x1bd)]&&(_0x5e283f['mcpServers']={}),_0x5e283f[_0x5a384d(0x1bd)][_0x5a384d(0x1c8)]=_0x2dad42,logger['info'](_0x5a384d(0x1eb),'更新现有\x20mcp.json\x20配置',{'path':_0x5a1684,'appcode':_0x4feffc,'env':_0x583375}),console['log'](_0x5a384d(0x1d8));}catch(_0x3cda67){logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),_0x5a384d(0x1c5),{'error':_0x3cda67 instanceof Error?_0x3cda67[_0x5a384d(0x1c9)]:String(_0x3cda67)}),console[_0x5a384d(0x1c1)](_0x5a384d(0x1ec)+(_0x3cda67 instanceof Error?_0x3cda67[_0x5a384d(0x1c9)]:String(_0x3cda67))),process[_0x5a384d(0x1e3)](0x1);}else _0x5e283f={'mcpServers':{'lovrabet-dataset':_0x2dad42}},logger[_0x5a384d(0x1da)](_0x5a384d(0x1eb),_0x5a384d(0x1e7),{'path':_0x5a1684,'appcode':_0x4feffc,'env':_0x583375}),console[_0x5a384d(0x1cf)](_0x5a384d(0x1d5));writeFileSync(_0x5a1684,JSON['stringify'](_0x5e283f,null,0x2),{'encoding':'utf8'});const _0x470a67=resolve(_0x37b929,_0x5a384d(0x1cd)),_0x14938a=resolve(_0x470a67,_0x5a384d(0x1c3));if(!existsSync(_0x14938a))try{!existsSync(_0x470a67)&&(mkdirSync(_0x470a67,{'recursive':!![]}),logger['info'](_0x5a384d(0x1eb),'创建\x20.cursor/rules\x20目录',{'path':_0x470a67}));const _0x41ffc3=fileURLToPath(import.meta[_0x5a384d(0x1be)]),_0x114de7=dirname(_0x41ffc3),_0x9a7d9=resolve(_0x114de7,_0x5a384d(0x1ea));existsSync(_0x9a7d9)?(copyFileSync(_0x9a7d9,_0x14938a),logger['info'](_0x5a384d(0x1eb),_0x5a384d(0x1d0),{'from':_0x9a7d9,'to':_0x14938a}),console['log'](_0x5a384d(0x1ca))):logger['warn']('mcp-cursor',_0x5a384d(0x1df),{'templatePath':_0x9a7d9});}catch(_0x6c6fc7){logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),_0x5a384d(0x1dc),{'error':_0x6c6fc7 instanceof Error?_0x6c6fc7[_0x5a384d(0x1c9)]:String(_0x6c6fc7)}),console[_0x5a384d(0x1e6)](_0x5a384d(0x1e1)+(_0x6c6fc7 instanceof Error?_0x6c6fc7[_0x5a384d(0x1c9)]:String(_0x6c6fc7)));}else logger[_0x5a384d(0x1da)](_0x5a384d(0x1eb),_0x5a384d(0x1d2),{'path':_0x14938a});console[_0x5a384d(0x1cf)](_0x5a384d(0x1db)),console[_0x5a384d(0x1cf)]('\x0a配置信息:'),console[_0x5a384d(0x1cf)](_0x5a384d(0x1bb)+_0x4feffc),console['log'](_0x5a384d(0x1e5)+_0x583375),console['log'](_0x5a384d(0x1d1)+_0x5a1684),console[_0x5a384d(0x1cf)](_0x5a384d(0x1de)),console[_0x5a384d(0x1cf)](_0x5a384d(0x1dd)),logger[_0x5a384d(0x1da)]('mcp-cursor','配置\x20Cursor\x20MCP\x20成功',{'appcode':_0x4feffc,'env':_0x583375,'configPath':_0x5a1684}),process[_0x5a384d(0x1e3)](0x0);}catch(_0x2efddf){logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),_0x5a384d(0x1e0),{'error':_0x2efddf instanceof Error?_0x2efddf['message']:String(_0x2efddf)}),console[_0x5a384d(0x1c1)](_0x5a384d(0x1e9)+(_0x2efddf instanceof Error?_0x2efddf[_0x5a384d(0x1c9)]:String(_0x2efddf))),process['exit'](0x1);}}function a44_0x2be8(_0x5757b0,_0x2558e7){const _0x90a093=a44_0x90a0();return a44_0x2be8=function(_0x2be896,_0xc6b1bc){_0x2be896=_0x2be896-0x1ba;let _0x5e1844=_0x90a093[_0x2be896];return _0x5e1844;},a44_0x2be8(_0x5757b0,_0x2558e7);}function a44_0x90a0(){const _0x247cd6=['✓\x20创建\x20mcp.json\x20配置文件','✓\x20创建\x20.cursor\x20目录:\x20','827854btoyPi','✓\x20更新\x20mcp.json\x20配置','parse','info','\x0a✓\x20Cursor\x20MCP\x20配置成功!','复制\x20Cursor\x20Rules\x20文件失败','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','Cursor\x20Rules\x20模板文件不存在','配置\x20Cursor\x20MCP\x20失败','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','创建\x20.cursor\x20目录','exit','app','\x20\x20-\x20环境:\x20','warn','创建新的\x20mcp.json\x20配置','1456905zmrCZm','错误:\x20配置失败:\x20','../../templates/rules/lovrabet_rules.mdc.tpl','mcp-cursor','错误:\x20解析现有\x20mcp.json\x20失败:\x20','utf8','\x20\x20-\x20AppCode:\x20','2807SBYfib','mcpServers','url','appcode','@lovrabet/dataset-mcp-server','error','291060xtbZhB','lovrabet_rules.mdc','npx','解析现有\x20mcp.json\x20失败','3534705DoDcvP','2130HXIiap','lovrabet-dataset','message','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','188472wRVOeQ','857241urBqNL','rules','mcp.json','log','复制\x20Cursor\x20Rules\x20文件','\x20\x20-\x20配置文件:\x20','Cursor\x20Rules\x20文件已存在,跳过','4vXjJcf','.cursor'];a44_0x90a0=function(){return _0x247cd6;};return a44_0x90a0();}
1
+ (function(_0xdb61,_0x155e41){const _0x1c44a1=a44_0x17ae,_0x126114=_0xdb61();while(!![]){try{const _0x18868c=-parseInt(_0x1c44a1(0xe9))/0x1+parseInt(_0x1c44a1(0xe7))/0x2*(parseInt(_0x1c44a1(0xea))/0x3)+-parseInt(_0x1c44a1(0xd3))/0x4*(parseInt(_0x1c44a1(0xe5))/0x5)+-parseInt(_0x1c44a1(0xe4))/0x6*(parseInt(_0x1c44a1(0xd2))/0x7)+-parseInt(_0x1c44a1(0xe2))/0x8*(-parseInt(_0x1c44a1(0xf7))/0x9)+parseInt(_0x1c44a1(0xd0))/0xa*(-parseInt(_0x1c44a1(0xdc))/0xb)+parseInt(_0x1c44a1(0xf2))/0xc;if(_0x18868c===_0x155e41)break;else _0x126114['push'](_0x126114['shift']());}catch(_0x667ea8){_0x126114['push'](_0x126114['shift']());}}}(a44_0x4d4b,0xb75e2));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a44_0x17ae(_0x26ab21,_0x5bc79c){const _0x4d4b03=a44_0x4d4b();return a44_0x17ae=function(_0x17ae92,_0x4207b6){_0x17ae92=_0x17ae92-0xc4;let _0x1c38a6=_0x4d4b03[_0x17ae92];return _0x1c38a6;},a44_0x17ae(_0x26ab21,_0x5bc79c);}import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x526ed3=a44_0x17ae;try{const _0x5136bb=process['cwd'](),_0x3aa489=resolve(_0x5136bb,_0x526ed3(0xd5)),_0x3a91ce=resolve(_0x3aa489,_0x526ed3(0xcc)),_0x510209=readConfig(),_0x35e02f=_0x510209['appcode']||_0x510209[_0x526ed3(0xe8)],_0x33ec84=_0x510209[_0x526ed3(0xc6)]||_0x526ed3(0xf1);!_0x35e02f&&(console[_0x526ed3(0xde)](_0x526ed3(0xeb)),logger['error'](_0x526ed3(0xf0),_0x526ed3(0xda)),process[_0x526ed3(0xc4)](0x1));!existsSync(_0x3aa489)&&(mkdirSync(_0x3aa489,{'recursive':!![]}),logger[_0x526ed3(0xcf)](_0x526ed3(0xf0),'创建\x20.cursor\x20目录',{'path':_0x3aa489}),console['log'](_0x526ed3(0xfb)+_0x3aa489));const _0x4b98de={'command':_0x526ed3(0xcb),'args':['-y',_0x526ed3(0xed)],'env':{'LOVRABET_APP_CODE':String(_0x35e02f),'LOVRABET_ENV':String(_0x33ec84)}};let _0x6c5f8f;if(existsSync(_0x3a91ce))try{const _0x19d327=readFileSync(_0x3a91ce,_0x526ed3(0xef));_0x6c5f8f=JSON[_0x526ed3(0xc8)](_0x19d327),!_0x6c5f8f[_0x526ed3(0xdd)]&&(_0x6c5f8f[_0x526ed3(0xdd)]={}),_0x6c5f8f['mcpServers'][_0x526ed3(0xd4)]=_0x4b98de,logger[_0x526ed3(0xcf)](_0x526ed3(0xf0),_0x526ed3(0xd1),{'path':_0x3a91ce,'appcode':_0x35e02f,'env':_0x33ec84}),console[_0x526ed3(0xe1)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x44a385){logger[_0x526ed3(0xde)](_0x526ed3(0xf0),_0x526ed3(0xf9),{'error':_0x44a385 instanceof Error?_0x44a385[_0x526ed3(0xfd)]:String(_0x44a385)}),console[_0x526ed3(0xde)](_0x526ed3(0xf5)+(_0x44a385 instanceof Error?_0x44a385[_0x526ed3(0xfd)]:String(_0x44a385))),process[_0x526ed3(0xc4)](0x1);}else _0x6c5f8f={'mcpServers':{'lovrabet-dataset':_0x4b98de}},logger[_0x526ed3(0xcf)](_0x526ed3(0xf0),_0x526ed3(0xf4),{'path':_0x3a91ce,'appcode':_0x35e02f,'env':_0x33ec84}),console[_0x526ed3(0xe1)](_0x526ed3(0xec));writeFileSync(_0x3a91ce,JSON[_0x526ed3(0xe6)](_0x6c5f8f,null,0x2),{'encoding':_0x526ed3(0xef)});const _0x2f952f=resolve(_0x3aa489,'rules'),_0x3663ce=resolve(_0x2f952f,_0x526ed3(0xcd));if(!existsSync(_0x3663ce))try{!existsSync(_0x2f952f)&&(mkdirSync(_0x2f952f,{'recursive':!![]}),logger['info'](_0x526ed3(0xf0),'创建\x20.cursor/rules\x20目录',{'path':_0x2f952f}));const _0x22150a=fileURLToPath(import.meta[_0x526ed3(0xd7)]),_0x282c6e=dirname(_0x22150a),_0x3faca0=resolve(_0x282c6e,_0x526ed3(0xfc));existsSync(_0x3faca0)?(copyFileSync(_0x3faca0,_0x3663ce),logger[_0x526ed3(0xcf)](_0x526ed3(0xf0),'复制\x20Cursor\x20Rules\x20文件',{'from':_0x3faca0,'to':_0x3663ce}),console['log'](_0x526ed3(0xc5))):logger[_0x526ed3(0xf8)](_0x526ed3(0xf0),_0x526ed3(0xd9),{'templatePath':_0x3faca0});}catch(_0x3da17d){logger[_0x526ed3(0xde)](_0x526ed3(0xf0),_0x526ed3(0xee),{'error':_0x3da17d instanceof Error?_0x3da17d[_0x526ed3(0xfd)]:String(_0x3da17d)}),console[_0x526ed3(0xf8)](_0x526ed3(0xf6)+(_0x3da17d instanceof Error?_0x3da17d[_0x526ed3(0xfd)]:String(_0x3da17d)));}else console[_0x526ed3(0xe1)](_0x526ed3(0xdf)),logger[_0x526ed3(0xcf)](_0x526ed3(0xf0),_0x526ed3(0xd8),{'path':_0x3663ce});console[_0x526ed3(0xe1)](_0x526ed3(0xe3)),console[_0x526ed3(0xe1)](_0x526ed3(0xfa)),console['log'](_0x526ed3(0xc9)+_0x35e02f),console[_0x526ed3(0xe1)](_0x526ed3(0xe0)+_0x33ec84),console[_0x526ed3(0xe1)](_0x526ed3(0xdb)+_0x3a91ce),console['log'](_0x526ed3(0xc7)),console[_0x526ed3(0xe1)](_0x526ed3(0xca)),logger[_0x526ed3(0xcf)](_0x526ed3(0xf0),_0x526ed3(0xce),{'appcode':_0x35e02f,'env':_0x33ec84,'configPath':_0x3a91ce}),process['exit'](0x0);}catch(_0x199c1c){logger['error'](_0x526ed3(0xf0),_0x526ed3(0xd6),{'error':_0x199c1c instanceof Error?_0x199c1c[_0x526ed3(0xfd)]:String(_0x199c1c)}),console[_0x526ed3(0xde)](_0x526ed3(0xf3)+(_0x199c1c instanceof Error?_0x199c1c[_0x526ed3(0xfd)]:String(_0x199c1c))),process[_0x526ed3(0xc4)](0x1);}}function a44_0x4d4b(){const _0x4cc52b=['Cursor\x20Rules\x20模板文件不存在','未找到\x20appcode\x20配置','\x20\x20-\x20配置文件:\x20','95601xrramZ','mcpServers','error','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','\x20\x20-\x20环境:\x20','log','8VGWWkx','\x0a✓\x20Cursor\x20MCP\x20配置成功!','738wlHuMU','5uKDESy','stringify','4CdvMfJ','app','1217868rfvQvw','1162197NYRIPp','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','✓\x20创建\x20mcp.json\x20配置文件','@lovrabet/dataset-mcp-server','复制\x20Cursor\x20Rules\x20文件失败','utf8','mcp-cursor','online','23707200EXmdmw','错误:\x20配置失败:\x20','创建新的\x20mcp.json\x20配置','错误:\x20解析现有\x20mcp.json\x20失败:\x20','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','5555988iaeSzv','warn','解析现有\x20mcp.json\x20失败','\x0a配置信息:','✓\x20创建\x20.cursor\x20目录:\x20','../../templates/rules/lovrabet_rules.mdc.tpl','message','exit','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','env','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','parse','\x20\x20-\x20AppCode:\x20','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','npx','mcp.json','lovrabet_rules.mdc','配置\x20Cursor\x20MCP\x20成功','info','520YRTGwC','更新现有\x20mcp.json\x20配置','36526IHAnAf','1220168OPtMaE','lovrabet-dataset','.cursor','配置\x20Cursor\x20MCP\x20失败','url','Cursor\x20Rules\x20文件已存在,跳过'];a44_0x4d4b=function(){return _0x4cc52b;};return a44_0x4d4b();}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x55ede4,_0x1c6628){var _0xad6b40=a45_0x432a,_0x5db480=_0x55ede4();while(!![]){try{var _0x265beb=-parseInt(_0xad6b40(0x18c))/0x1*(-parseInt(_0xad6b40(0x1a2))/0x2)+-parseInt(_0xad6b40(0x190))/0x3+-parseInt(_0xad6b40(0x1a0))/0x4*(-parseInt(_0xad6b40(0x198))/0x5)+-parseInt(_0xad6b40(0x19f))/0x6+-parseInt(_0xad6b40(0x192))/0x7+parseInt(_0xad6b40(0x18e))/0x8+parseInt(_0xad6b40(0x18d))/0x9;if(_0x265beb===_0x1c6628)break;else _0x5db480['push'](_0x5db480['shift']());}catch(_0x239f7b){_0x5db480['push'](_0x5db480['shift']());}}}(a45_0x3458,0x9ef23));function a45_0x3458(){var _0x52b031=['不支持的\x20IDE\x20类型:\x20','执行配置\x20Cursor\x20MCP\x20命令','647238mPEBpo','44pviQKs','未指定\x20IDE\x20类型','943864PHBiCx','cwd','错误:\x20不支持的\x20IDE\x20类型:\x20','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','错误:\x20请指定\x20IDE\x20类型','1sJRJgl','4151250OtacBR','1016344yGOUBz','\x0a使用方法:','1357776giweBE','info','2813426hLIFwl','\x0a当前支持的\x20IDE:','log','setLogPath','\x20\x20lovrabet\x20mcp\x20cursor','\x0a示例:','251455rQLThT','error','exit','mcp','toLowerCase'];a45_0x3458=function(){return _0x52b031;};return a45_0x3458();}import{configureCursorMcp}from'./cursor.js';function a45_0x432a(_0x36ff00,_0x3d3d98){var _0x34589a=a45_0x3458();return a45_0x432a=function(_0x432a0b,_0x30459a){_0x432a0b=_0x432a0b-0x18c;var _0x198633=_0x34589a[_0x432a0b];return _0x198633;},a45_0x432a(_0x36ff00,_0x3d3d98);}import{logger}from'../utils/logger.js';export async function mcpCommand(_0x5e7e43){var _0x3a0a07=a45_0x432a;logger[_0x3a0a07(0x195)](process[_0x3a0a07(0x1a3)]());if(!_0x5e7e43){console['error'](_0x3a0a07(0x1a6)),console['log'](_0x3a0a07(0x18f)),console['log'](_0x3a0a07(0x1a5)),console[_0x3a0a07(0x194)](_0x3a0a07(0x197)),console[_0x3a0a07(0x194)](_0x3a0a07(0x196)),logger[_0x3a0a07(0x199)](_0x3a0a07(0x19b),_0x3a0a07(0x1a1)),process[_0x3a0a07(0x19a)](0x1);return;}switch(_0x5e7e43[_0x3a0a07(0x19c)]()){case'cursor':logger[_0x3a0a07(0x191)]('mcp',_0x3a0a07(0x19e)),await configureCursorMcp();break;default:console[_0x3a0a07(0x199)](_0x3a0a07(0x1a4)+_0x5e7e43),console[_0x3a0a07(0x194)](_0x3a0a07(0x193)),console[_0x3a0a07(0x194)]('\x20\x20-\x20cursor'),logger[_0x3a0a07(0x199)](_0x3a0a07(0x19b),_0x3a0a07(0x19d)+_0x5e7e43),process['exit'](0x1);break;}}
1
+ (function(_0x17c6f1,_0xa46248){var _0x1c752a=a45_0x3bd4,_0x2b73b1=_0x17c6f1();while(!![]){try{var _0x56a7d0=parseInt(_0x1c752a(0x1ed))/0x1*(-parseInt(_0x1c752a(0x1ea))/0x2)+parseInt(_0x1c752a(0x201))/0x3+parseInt(_0x1c752a(0x1ee))/0x4+parseInt(_0x1c752a(0x1f6))/0x5+parseInt(_0x1c752a(0x1fc))/0x6*(-parseInt(_0x1c752a(0x200))/0x7)+parseInt(_0x1c752a(0x205))/0x8*(parseInt(_0x1c752a(0x1f8))/0x9)+-parseInt(_0x1c752a(0x1fd))/0xa*(-parseInt(_0x1c752a(0x1f7))/0xb);if(_0x56a7d0===_0xa46248)break;else _0x2b73b1['push'](_0x2b73b1['shift']());}catch(_0x1b78c1){_0x2b73b1['push'](_0x2b73b1['shift']());}}}(a45_0x44f4,0x88dcd));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';function a45_0x3bd4(_0x177098,_0x74f41b){var _0x44f4a3=a45_0x44f4();return a45_0x3bd4=function(_0x3bd482,_0x317bf9){_0x3bd482=_0x3bd482-0x1e9;var _0x72d9e5=_0x44f4a3[_0x3bd482];return _0x72d9e5;},a45_0x3bd4(_0x177098,_0x74f41b);}export async function mcpCommand(_0x2cc079){var _0x3b93a4=a45_0x3bd4;logger[_0x3b93a4(0x1e9)](process[_0x3b93a4(0x1fe)]());if(!_0x2cc079){console[_0x3b93a4(0x203)](_0x3b93a4(0x202)),console[_0x3b93a4(0x1fb)]('\x0a使用方法:'),console['log'](_0x3b93a4(0x1ff)),console[_0x3b93a4(0x1fb)](_0x3b93a4(0x1ef)),console['log'](_0x3b93a4(0x1f1)),logger[_0x3b93a4(0x203)](_0x3b93a4(0x1f5),_0x3b93a4(0x1ec)),process[_0x3b93a4(0x1f4)](0x1);return;}switch(_0x2cc079[_0x3b93a4(0x1eb)]()){case _0x3b93a4(0x1fa):logger[_0x3b93a4(0x1f0)](_0x3b93a4(0x1f5),'执行配置\x20Cursor\x20MCP\x20命令'),await configureCursorMcp();break;default:console[_0x3b93a4(0x203)](_0x3b93a4(0x1f3)+_0x2cc079),console['log'](_0x3b93a4(0x1f9)),console[_0x3b93a4(0x1fb)](_0x3b93a4(0x1f2)),logger[_0x3b93a4(0x203)](_0x3b93a4(0x1f5),_0x3b93a4(0x204)+_0x2cc079),process['exit'](0x1);break;}}function a45_0x44f4(){var _0x31976e=['1510310jYsBeI','399718fLCLEs','2683953yXxnOw','\x0a当前支持的\x20IDE:','cursor','log','942942FyuiJG','190slosXV','cwd','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','49zEPdhG','2251341rtLzkZ','错误:\x20请指定\x20IDE\x20类型','error','不支持的\x20IDE\x20类型:\x20','8KKPdhg','setLogPath','16022okTefY','toLowerCase','未指定\x20IDE\x20类型','53FjsVhL','176492IqeYpu','\x0a示例:','info','\x20\x20lovrabet\x20mcp\x20cursor','\x20\x20-\x20cursor','错误:\x20不支持的\x20IDE\x20类型:\x20','exit','mcp'];a45_0x44f4=function(){return _0x31976e;};return a45_0x44f4();}
@@ -1 +1 @@
1
- const a46_0x554aae=a46_0x9414;(function(_0x115038,_0x283fcb){const _0x3b309f=a46_0x9414,_0x31195f=_0x115038();while(!![]){try{const _0x4deab5=parseInt(_0x3b309f(0x18b))/0x1+-parseInt(_0x3b309f(0x187))/0x2*(-parseInt(_0x3b309f(0x183))/0x3)+parseInt(_0x3b309f(0x185))/0x4+-parseInt(_0x3b309f(0x182))/0x5+parseInt(_0x3b309f(0x186))/0x6+parseInt(_0x3b309f(0x18e))/0x7*(-parseInt(_0x3b309f(0x180))/0x8)+-parseInt(_0x3b309f(0x18d))/0x9;if(_0x4deab5===_0x283fcb)break;else _0x31195f['push'](_0x31195f['shift']());}catch(_0x56fa78){_0x31195f['push'](_0x31195f['shift']());}}}(a46_0x2c60,0x19933));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a46_0x9414(_0x2d4fd1,_0x1c9e86){const _0x2c60ca=a46_0x2c60();return a46_0x9414=function(_0x9414cc,_0x502d40){_0x9414cc=_0x9414cc-0x180;let _0xb55d15=_0x2c60ca[_0x9414cc];return _0xb55d15;},a46_0x9414(_0x2d4fd1,_0x1c9e86);}import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a46_0x554aae(0x189));function a46_0x2c60(){const _0x1288a6=['utf8','24BaxRiI','app','757275ffTVrJ','9489DOFpdj','appcode','277764iwrosr','1195548mWlowc','126RfsSvE','trim','.lovrabetrc','string','35766lSLiDA','parse','345411HgjCzP','488005hoKAhl'];a46_0x2c60=function(){return _0x1288a6;};return a46_0x2c60();}export const globalConfigPath=resolve(homedir(),a46_0x554aae(0x189));export function readConfig(){const _0x9d1f59=a46_0x554aae;let _0x3042b0={};try{if(existsSync(globalConfigPath)){const _0x41ac00=readFileSync(globalConfigPath,{'encoding':_0x9d1f59(0x18f)});_0x41ac00&&(_0x3042b0=JSON[_0x9d1f59(0x18c)](_0x41ac00));}}catch(_0x4aba56){}try{if(existsSync(projectConfigPath)){const _0x48337e=readFileSync(projectConfigPath,{'encoding':_0x9d1f59(0x18f)});if(_0x48337e){const _0x123b97=JSON[_0x9d1f59(0x18c)](_0x48337e);_0x3042b0={..._0x3042b0,..._0x123b97};}}}catch(_0x186029){}return _0x3042b0;}export function getConfigAppCode(){const _0x454c26=a46_0x554aae;let _0x3f7dcc={},_0x391040={};try{if(existsSync(globalConfigPath)){const _0x393956=readFileSync(globalConfigPath,{'encoding':_0x454c26(0x18f)});_0x393956&&(_0x391040=JSON[_0x454c26(0x18c)](_0x393956));}}catch(_0x168898){}try{if(existsSync(projectConfigPath)){const _0x36f6b0=readFileSync(projectConfigPath,{'encoding':_0x454c26(0x18f)});_0x36f6b0&&(_0x3f7dcc=JSON[_0x454c26(0x18c)](_0x36f6b0));}}catch(_0x10811c){}let _0x1abafd;if(_0x454c26(0x184)in _0x3f7dcc)_0x1abafd=_0x3f7dcc[_0x454c26(0x184)];else{if('app'in _0x3f7dcc)_0x1abafd=_0x3f7dcc[_0x454c26(0x181)];else{if('appcode'in _0x391040)_0x1abafd=_0x391040['appcode'];else'app'in _0x391040&&(_0x1abafd=_0x391040['app']);}}if(typeof _0x1abafd!==_0x454c26(0x18a)||_0x1abafd[_0x454c26(0x188)]()==='')return undefined;return _0x1abafd;}export function isInProject(){return existsSync(projectConfigPath);}
1
+ const a46_0x199a35=a46_0x349a;(function(_0x1f1ac7,_0x5a21f1){const _0x58f12c=a46_0x349a,_0x45486a=_0x1f1ac7();while(!![]){try{const _0x36aebb=parseInt(_0x58f12c(0x14d))/0x1+parseInt(_0x58f12c(0x14a))/0x2+-parseInt(_0x58f12c(0x14e))/0x3+parseInt(_0x58f12c(0x153))/0x4+parseInt(_0x58f12c(0x151))/0x5+-parseInt(_0x58f12c(0x149))/0x6*(-parseInt(_0x58f12c(0x152))/0x7)+-parseInt(_0x58f12c(0x148))/0x8;if(_0x36aebb===_0x5a21f1)break;else _0x45486a['push'](_0x45486a['shift']());}catch(_0x5c151f){_0x45486a['push'](_0x45486a['shift']());}}}(a46_0x4c6f,0x44ffd));import{existsSync,readFileSync}from'node:fs';function a46_0x4c6f(){const _0x1b4db8=['appcode','cwd','10686nnXkTv','729942QpKmyW','.lovrabetrc','string','2681435ulAnDL','112aIBqrn','552844nsTGRB','parse','app','utf8','4458424iEqCpT','136842GmKUct','66284cHKEEM'];a46_0x4c6f=function(){return _0x1b4db8;};return a46_0x4c6f();}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a46_0x199a35(0x14c)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a46_0x199a35(0x14f));export function readConfig(){const _0x68fb8a=a46_0x199a35;let _0x2c087d={};try{if(existsSync(globalConfigPath)){const _0x183a49=readFileSync(globalConfigPath,{'encoding':_0x68fb8a(0x147)});_0x183a49&&(_0x2c087d=JSON[_0x68fb8a(0x154)](_0x183a49));}}catch(_0x2a5f11){}try{if(existsSync(projectConfigPath)){const _0x47e351=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x47e351){const _0x4e072e=JSON[_0x68fb8a(0x154)](_0x47e351);_0x2c087d={..._0x2c087d,..._0x4e072e};}}}catch(_0xb82644){}return _0x2c087d;}export function getConfigAppCode(){const _0x13df19=a46_0x199a35;let _0x408222={},_0x120e2c={};try{if(existsSync(globalConfigPath)){const _0x3a27a3=readFileSync(globalConfigPath,{'encoding':_0x13df19(0x147)});_0x3a27a3&&(_0x120e2c=JSON[_0x13df19(0x154)](_0x3a27a3));}}catch(_0x33a06b){}try{if(existsSync(projectConfigPath)){const _0x4a059c=readFileSync(projectConfigPath,{'encoding':_0x13df19(0x147)});_0x4a059c&&(_0x408222=JSON[_0x13df19(0x154)](_0x4a059c));}}catch(_0x12a898){}let _0x41ba9c;if(_0x13df19(0x14b)in _0x408222)_0x41ba9c=_0x408222['appcode'];else{if('app'in _0x408222)_0x41ba9c=_0x408222[_0x13df19(0x155)];else{if(_0x13df19(0x14b)in _0x120e2c)_0x41ba9c=_0x120e2c[_0x13df19(0x14b)];else _0x13df19(0x155)in _0x120e2c&&(_0x41ba9c=_0x120e2c[_0x13df19(0x155)]);}}if(typeof _0x41ba9c!==_0x13df19(0x150)||_0x41ba9c['trim']()==='')return undefined;return _0x41ba9c;}function a46_0x349a(_0x38a247,_0xefded3){const _0x4c6f9b=a46_0x4c6f();return a46_0x349a=function(_0x349a21,_0x5c20ef){_0x349a21=_0x349a21-0x147;let _0x425136=_0x4c6f9b[_0x349a21];return _0x425136;},a46_0x349a(_0x38a247,_0xefded3);}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- (function(_0xbd2d7e,_0x2158e9){const _0x3e1015=a47_0x266a,_0x1bde29=_0xbd2d7e();while(!![]){try{const _0x7b704f=-parseInt(_0x3e1015(0xc8))/0x1+parseInt(_0x3e1015(0xca))/0x2*(-parseInt(_0x3e1015(0xc7))/0x3)+-parseInt(_0x3e1015(0xc5))/0x4*(parseInt(_0x3e1015(0xcb))/0x5)+-parseInt(_0x3e1015(0xc4))/0x6+parseInt(_0x3e1015(0xc9))/0x7+-parseInt(_0x3e1015(0xcc))/0x8*(-parseInt(_0x3e1015(0xc2))/0x9)+parseInt(_0x3e1015(0xbd))/0xa;if(_0x7b704f===_0x2158e9)break;else _0x1bde29['push'](_0x1bde29['shift']());}catch(_0x3d67a9){_0x1bde29['push'](_0x1bde29['shift']());}}}(a47_0x2681,0xa777d));function a47_0x266a(_0x2fef56,_0x340f52){const _0x268168=a47_0x2681();return a47_0x266a=function(_0x266a2e,_0x5cef71){_0x266a2e=_0x266a2e-0xbd;let _0x349e66=_0x268168[_0x266a2e];return _0x349e66;},a47_0x266a(_0x2fef56,_0x340f52);}import a47_0x465103 from'node:path';function a47_0x2681(){const _0x10c87f=['join','9sYRsFe','readdirSync','1924368iiyPse','47076cMvfZy','error','13803OlRKse','1320907OVufsv','303807IKSXmK','502kIUikq','90sGjuAC','1089256QjVvmL','35147190zCJhOV','copyFileSync','复制目录时出错:','isDirectory'];a47_0x2681=function(){return _0x10c87f;};return a47_0x2681();}import a47_0x104fa1 from'node:fs';export async function copyDirectory(_0x20bcb9,_0x56f531){const _0x34caea=a47_0x266a;try{const _0x5f1434=a47_0x104fa1[_0x34caea(0xc3)](_0x20bcb9,{'withFileTypes':!![]});a47_0x104fa1['mkdirSync'](_0x56f531,{'recursive':!![]});for(const _0x11d8dd of _0x5f1434){const _0x45386a=a47_0x465103['join'](_0x20bcb9,_0x11d8dd['name']),_0xc9ebf=a47_0x465103[_0x34caea(0xc1)](_0x56f531,_0x11d8dd['name']);_0x11d8dd[_0x34caea(0xc0)]()?await copyDirectory(_0x45386a,_0xc9ebf):a47_0x104fa1[_0x34caea(0xbe)](_0x45386a,_0xc9ebf);}}catch(_0x44251b){console[_0x34caea(0xc6)](_0x34caea(0xbf),_0x44251b);}}
1
+ (function(_0x396004,_0x3339dd){const _0x1c6d90=a47_0x405b,_0x53fc0a=_0x396004();while(!![]){try{const _0x272b2c=-parseInt(_0x1c6d90(0x154))/0x1*(parseInt(_0x1c6d90(0x14d))/0x2)+parseInt(_0x1c6d90(0x14b))/0x3*(-parseInt(_0x1c6d90(0x148))/0x4)+-parseInt(_0x1c6d90(0x149))/0x5+parseInt(_0x1c6d90(0x151))/0x6*(-parseInt(_0x1c6d90(0x153))/0x7)+parseInt(_0x1c6d90(0x14f))/0x8+-parseInt(_0x1c6d90(0x14e))/0x9*(-parseInt(_0x1c6d90(0x143))/0xa)+-parseInt(_0x1c6d90(0x146))/0xb*(-parseInt(_0x1c6d90(0x152))/0xc);if(_0x272b2c===_0x3339dd)break;else _0x53fc0a['push'](_0x53fc0a['shift']());}catch(_0x576c1f){_0x53fc0a['push'](_0x53fc0a['shift']());}}}(a47_0x13d3,0xdf4ae));function a47_0x13d3(){const _0x4885f5=['10ohVkoe','isDirectory','readdirSync','728475TduEGB','name','55956wROJFd','2878375euVybe','join','72bQZxkr','error','8gzngiB','9420813zExflo','8885544cIjMPF','mkdirSync','1074GQCaDe','12qnvxiS','182mYpHIm','98251IYdJkz','复制目录时出错:','copyFileSync'];a47_0x13d3=function(){return _0x4885f5;};return a47_0x13d3();}import a47_0x55e294 from'node:path';import a47_0x229704 from'node:fs';function a47_0x405b(_0x5a935e,_0x1977ba){const _0x13d3e0=a47_0x13d3();return a47_0x405b=function(_0x405b7e,_0xd5e81f){_0x405b7e=_0x405b7e-0x143;let _0x4bf083=_0x13d3e0[_0x405b7e];return _0x4bf083;},a47_0x405b(_0x5a935e,_0x1977ba);}export async function copyDirectory(_0x4b139d,_0x496937){const _0xeac053=a47_0x405b;try{const _0x4a94fa=a47_0x229704[_0xeac053(0x145)](_0x4b139d,{'withFileTypes':!![]});a47_0x229704[_0xeac053(0x150)](_0x496937,{'recursive':!![]});for(const _0x39f3b2 of _0x4a94fa){const _0x229825=a47_0x55e294['join'](_0x4b139d,_0x39f3b2[_0xeac053(0x147)]),_0x174892=a47_0x55e294[_0xeac053(0x14a)](_0x496937,_0x39f3b2[_0xeac053(0x147)]);_0x39f3b2[_0xeac053(0x144)]()?await copyDirectory(_0x229825,_0x174892):a47_0x229704[_0xeac053(0x156)](_0x229825,_0x174892);}}catch(_0x1e78d2){console[_0xeac053(0x14c)](_0xeac053(0x155),_0x1e78d2);}}
@@ -1 +1 @@
1
- function a48_0x450d(_0x10c978,_0x68cf31){const _0x3f0ab1=a48_0x3f0a();return a48_0x450d=function(_0x450d47,_0x52fdae){_0x450d47=_0x450d47-0x156;let _0x274db8=_0x3f0ab1[_0x450d47];return _0x274db8;},a48_0x450d(_0x10c978,_0x68cf31);}(function(_0x1ae347,_0x3746d1){const _0x1670b1=a48_0x450d,_0x473c1f=_0x1ae347();while(!![]){try{const _0x63cbb7=-parseInt(_0x1670b1(0x16a))/0x1+-parseInt(_0x1670b1(0x158))/0x2*(-parseInt(_0x1670b1(0x168))/0x3)+parseInt(_0x1670b1(0x15d))/0x4*(-parseInt(_0x1670b1(0x163))/0x5)+parseInt(_0x1670b1(0x15a))/0x6+-parseInt(_0x1670b1(0x157))/0x7+-parseInt(_0x1670b1(0x160))/0x8*(-parseInt(_0x1670b1(0x16c))/0x9)+parseInt(_0x1670b1(0x16f))/0xa;if(_0x63cbb7===_0x3746d1)break;else _0x473c1f['push'](_0x473c1f['shift']());}catch(_0x1e9982){_0x473c1f['push'](_0x473c1f['shift']());}}}(a48_0x3f0a,0xe46ba));function a48_0x3f0a(){const _0x213b4a=['application/json','129835kLFKdy','name','content-type','*\x20请求失败,','headers','6vKYQeQ','fetch','1002370GAPdkl','TypeError','275013rxhNPo','abort','AbortError','11255950LSGREM','json','status','10181297zTeVxT','1152722UoHKKa','text','5391972PjalIG','ENOTFOUND','message','28cYWbpU','get','log','104RMIMbe','includes'];a48_0x3f0a=function(){return _0x213b4a;};return a48_0x3f0a();}export async function httpRequest(_0x4d604a,_0x157047={}){const _0x3b5298=a48_0x450d,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x157047;let _0x2d84ac=null;for(let _0x1ef0ba=0x0;_0x1ef0ba<=retries;_0x1ef0ba++){try{const _0xedf8f=new AbortController(),_0x54c03b=setTimeout(()=>_0xedf8f[_0x3b5298(0x16d)](),timeout),_0x4e2316=await fetch(_0x4d604a,{'headers':headers,'signal':_0xedf8f['signal']});clearTimeout(_0x54c03b);let _0x1b438a;const _0x5afe1b=_0x4e2316[_0x3b5298(0x167)][_0x3b5298(0x15e)](_0x3b5298(0x165));return _0x5afe1b?.['includes'](_0x3b5298(0x162))?_0x1b438a=await _0x4e2316[_0x3b5298(0x170)]():_0x1b438a=await _0x4e2316[_0x3b5298(0x159)](),{'ok':_0x4e2316['ok'],'status':_0x4e2316[_0x3b5298(0x156)],'statusText':_0x4e2316['statusText'],'data':_0x1b438a,'headers':_0x4e2316[_0x3b5298(0x167)],'url':_0x4e2316['url'],'text':()=>_0x4e2316['text']()};}catch(_0x3302f7){_0x2d84ac=_0x3302f7 instanceof Error?_0x3302f7:new Error(String(_0x3302f7));if(_0x1ef0ba===retries)break;if(shouldRetry(_0x3302f7)){console[_0x3b5298(0x15f)](_0x3b5298(0x166)+retryDelay+'ms\x20后进行第\x20'+(_0x1ef0ba+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x2d84ac||new Error('Request\x20failed');}function shouldRetry(_0x5dfbc5){const _0x49d888=a48_0x450d;if(_0x5dfbc5 instanceof Error){if(_0x5dfbc5[_0x49d888(0x164)]===_0x49d888(0x16e))return![];if(_0x5dfbc5[_0x49d888(0x164)]===_0x49d888(0x16b)&&_0x5dfbc5[_0x49d888(0x15c)][_0x49d888(0x161)](_0x49d888(0x169)))return!![];if(_0x5dfbc5[_0x49d888(0x15c)][_0x49d888(0x161)]('ECONNRESET'))return!![];if(_0x5dfbc5[_0x49d888(0x15c)]['includes'](_0x49d888(0x15b)))return![];}return![];}function sleep(_0x573574){return new Promise(_0x1db92d=>setTimeout(_0x1db92d,_0x573574));}export function validateUrl(_0x2f931d){try{return new URL(_0x2f931d),!![];}catch{return![];}}
1
+ (function(_0x3fa847,_0xe4f5df){const _0x42a1ef=a48_0x1f64,_0x21f449=_0x3fa847();while(!![]){try{const _0x571afe=-parseInt(_0x42a1ef(0xc1))/0x1+parseInt(_0x42a1ef(0xb7))/0x2+-parseInt(_0x42a1ef(0xba))/0x3+-parseInt(_0x42a1ef(0xbe))/0x4*(-parseInt(_0x42a1ef(0xc0))/0x5)+-parseInt(_0x42a1ef(0xc6))/0x6*(parseInt(_0x42a1ef(0xb0))/0x7)+parseInt(_0x42a1ef(0xbc))/0x8+parseInt(_0x42a1ef(0xc4))/0x9;if(_0x571afe===_0xe4f5df)break;else _0x21f449['push'](_0x21f449['shift']());}catch(_0x246a42){_0x21f449['push'](_0x21f449['shift']());}}}(a48_0x5420,0x3e7fc));export async function httpRequest(_0x26f5f9,_0x51fa5f={}){const _0x4fe253=a48_0x1f64,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x51fa5f;let _0x181e66=null;for(let _0xee7c9a=0x0;_0xee7c9a<=retries;_0xee7c9a++){try{const _0x250cce=new AbortController(),_0x1b3c19=setTimeout(()=>_0x250cce[_0x4fe253(0xc9)](),timeout),_0x562b26=await fetch(_0x26f5f9,{'headers':headers,'signal':_0x250cce[_0x4fe253(0xb3)]});clearTimeout(_0x1b3c19);let _0xb2e27d;const _0xe99d76=_0x562b26[_0x4fe253(0xca)][_0x4fe253(0xbb)](_0x4fe253(0xc8));return _0xe99d76?.[_0x4fe253(0xb1)]('application/json')?_0xb2e27d=await _0x562b26['json']():_0xb2e27d=await _0x562b26[_0x4fe253(0xb9)](),{'ok':_0x562b26['ok'],'status':_0x562b26[_0x4fe253(0xbd)],'statusText':_0x562b26[_0x4fe253(0xb2)],'data':_0xb2e27d,'headers':_0x562b26[_0x4fe253(0xca)],'url':_0x562b26[_0x4fe253(0xc5)],'text':()=>_0x562b26[_0x4fe253(0xb9)]()};}catch(_0x18e03a){_0x181e66=_0x18e03a instanceof Error?_0x18e03a:new Error(String(_0x18e03a));if(_0xee7c9a===retries)break;if(shouldRetry(_0x18e03a)){console['log'](_0x4fe253(0xb8)+retryDelay+'ms\x20后进行第\x20'+(_0xee7c9a+0x1)+_0x4fe253(0xc2)),await sleep(retryDelay);continue;}else break;}}throw _0x181e66||new Error('Request\x20failed');}function shouldRetry(_0x3912c7){const _0x386764=a48_0x1f64;if(_0x3912c7 instanceof Error){if(_0x3912c7['name']===_0x386764(0xb6))return![];if(_0x3912c7[_0x386764(0xc7)]===_0x386764(0xb5)&&_0x3912c7['message']['includes'](_0x386764(0xb4)))return!![];if(_0x3912c7[_0x386764(0xbf)][_0x386764(0xb1)]('ECONNRESET'))return!![];if(_0x3912c7[_0x386764(0xbf)][_0x386764(0xb1)](_0x386764(0xc3)))return![];}return![];}function a48_0x5420(){const _0x21aaac=['name','content-type','abort','headers','2196803kEtIEz','includes','statusText','signal','fetch','TypeError','AbortError','409280nQOItQ','*\x20请求失败,','text','918711DCZuEj','get','1068616wYqZpB','status','544500TKaPcg','message','15PQqLgO','384927cSCMXH','\x20次重试...','ENOTFOUND','4629573mctigS','url','6LxhAaW'];a48_0x5420=function(){return _0x21aaac;};return a48_0x5420();}function sleep(_0x12e32d){return new Promise(_0x3d9472=>setTimeout(_0x3d9472,_0x12e32d));}function a48_0x1f64(_0x244e2a,_0x79ca48){const _0x542032=a48_0x5420();return a48_0x1f64=function(_0x1f6412,_0x4e478e){_0x1f6412=_0x1f6412-0xb0;let _0x14eedd=_0x542032[_0x1f6412];return _0x14eedd;},a48_0x1f64(_0x244e2a,_0x79ca48);}export function validateUrl(_0x566790){try{return new URL(_0x566790),!![];}catch{return![];}}