@lovrabet/cli 1.1.20 → 1.1.22

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 (69) 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 +2 -2
  54. package/templates/README.md +28 -1
  55. package/templates/projects/sub-app-react-demo/CHANGELOG.md +16 -0
  56. package/templates/projects/sub-app-react-demo/README.md +163 -54
  57. package/templates/projects/sub-app-react-demo/package-lock.json +1347 -149
  58. package/templates/projects/sub-app-react-demo/package.json +2 -2
  59. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +286 -55
  60. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +526 -0
  61. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +942 -87
  62. package/templates/projects/sub-app-react-demo/src/pages/intro/index.tsx +560 -0
  63. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +113 -118
  64. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +469 -0
  65. package/templates/projects/sub-app-react-demo/src/style.css +39 -0
  66. package/templates/rules/README.md +178 -0
  67. package/templates/rules/example-project-setup.md +276 -0
  68. package/templates/rules/lovrabet_rules.mdc.tpl +425 -0
  69. package/templates/projects/sub-app-react-demo/bun.lock +0 -600
@@ -1 +1 @@
1
- (function(_0x2d7537,_0x1c6aae){const _0x450907=a32_0x4b57,_0x1d93ab=_0x2d7537();while(!![]){try{const _0x574d1b=parseInt(_0x450907(0x1e7))/0x1+parseInt(_0x450907(0x1b6))/0x2*(parseInt(_0x450907(0x1ba))/0x3)+parseInt(_0x450907(0x1f0))/0x4+parseInt(_0x450907(0x1cb))/0x5*(-parseInt(_0x450907(0x1d5))/0x6)+parseInt(_0x450907(0x1b2))/0x7+parseInt(_0x450907(0x1c1))/0x8*(parseInt(_0x450907(0x1eb))/0x9)+-parseInt(_0x450907(0x1bd))/0xa;if(_0x574d1b===_0x1c6aae)break;else _0x1d93ab['push'](_0x1d93ab['shift']());}catch(_0x52cfe0){_0x1d93ab['push'](_0x1d93ab['shift']());}}}(a32_0x142c,0xcda00));import{jsx as a32_0x40f6d4,jsxs as a32_0x48e955,Fragment as a32_0x167a84}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';function a32_0x4b57(_0x1ad83e,_0x1d7c96){const _0x142c38=a32_0x142c();return a32_0x4b57=function(_0x4b5781,_0xcc82a4){_0x4b5781=_0x4b5781-0x1b1;let _0x118261=_0x142c38[_0x4b5781];return _0x118261;},a32_0x4b57(_0x1ad83e,_0x1d7c96);}import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x418b46){const _0x44738d=a32_0x4b57,{onCreate:_0x2f71f8,env:_0x2599e0}=_0x418b46,[_0x466ece,_0x59504d]=useState('project-name'),[_0x1a2137,_0xd6a489]=useState(''),[_0x1d0cf6,_0x1e6926]=useState(''),[_0x538ee9,_0x131caf]=useState(''),[_0x440658,_0x539827]=useState(''),[_0x2cee4a,_0x4f335c]=useState([]),[_0x27fc39,_0x424b83]=useState(null),[_0x456c2b,_0x2df3ef]=useState(![]),[_0x45c3da,_0x2cdf75]=useState(![]),[_0x6346f3,_0xb77ea7]=useState(![]),[_0x183452,_0x185aff]=useState(0x0),[_0x49896f,_0x2fafbf]=useState(0x0),_0x56024f=_0x44738d(0x1c9),_0x30d323=readConfig(),_0x21b3f9=typeof _0x30d323[_0x44738d(0x1bf)]===_0x44738d(0x1ec)?_0x30d323[_0x44738d(0x1bf)]:undefined;function _0x28aa6b(_0x3c1928){const _0x461888=_0x44738d;if(_0x3c1928[_0x461888(0x1c8)]>0x32)return{'valid':![],'message':_0x461888(0x1c2)};const _0xa763a0=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3c1928?.[_0x461888(0x1e4)]()&&!_0xa763a0[_0x461888(0x1cc)](_0x3c1928))return{'valid':![],'message':_0x461888(0x1e1)};return{'valid':!![]};}function _0x25d87d(_0x43cb97){const _0x201672=_0x44738d;if(!_0x43cb97[_0x201672(0x1e4)]())return{'valid':!![]};if(_0x43cb97['length']>0x64)return{'valid':![],'message':_0x201672(0x1de)};const _0x59a103=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x59a103[_0x201672(0x1cc)](_0x43cb97))return{'valid':![],'message':'应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头'};return{'valid':!![]};}async function _0x480812(){_0x2df3ef(!![]);try{const _0x3be5be=await getIsSessionValid();return _0x424b83(_0x3be5be),_0x3be5be;}catch(_0x2aa205){return _0x424b83(![]),![];}finally{_0x2df3ef(![]);}}async function _0x34cd30(){_0x2cdf75(!![]);try{const _0x42e891=await authServer({'silent':!![]});return _0x424b83(_0x42e891),_0x42e891;}catch(_0x47b84){return _0x424b83(![]),![];}finally{_0x2cdf75(![]);}}return useInput(async(_0x217e04,_0x1560c3)=>{const _0x2767fc=_0x44738d;if(_0x1560c3[_0x2767fc(0x1e5)]||_0x1560c3['rightArrow']){if(_0x466ece===_0x2767fc(0x1d4)){_0x185aff(_0x2e5417=>_0x2e5417===0x0?0x1:0x0);return;}if(_0x466ece===_0x2767fc(0x1ee)){_0x2fafbf(_0x479b10=>_0x479b10===0x0?0x1:0x0);return;}}if(_0x1560c3['return']){if(_0x466ece===_0x2767fc(0x1d0)){const _0xd01c84=_0x538ee9[_0x2767fc(0x1e4)]()||_0x56024f;if(_0x440658)return;_0xd6a489(_0xd01c84),_0x4f335c([{'step':_0x2767fc(0x1d0),'label':_0x2767fc(0x1ed),'value':_0xd01c84}]),_0x131caf(''),_0x539827(''),_0x59504d('app-code');return;}if(_0x466ece===_0x2767fc(0x1c5)){if(_0x440658)return;const _0xa713c4=_0x538ee9['trim']();_0x1e6926(_0xa713c4),_0x4f335c(_0x31b9ba=>[..._0x31b9ba,{'step':_0x2767fc(0x1c5),'label':_0x2767fc(0x1d3),'value':_0xa713c4||_0x2767fc(0x1c6)}]),_0x131caf(''),_0x539827('');if(_0xa713c4){_0x59504d('login-check');const _0x33cac9=await _0x480812();_0x33cac9?_0x59504d(_0x2767fc(0x1d4)):_0x59504d(_0x2767fc(0x1ee));}else{const _0x344f9f=_0x2599e0||_0x21b3f9||_0x2767fc(0x1ea);_0x2f71f8({'projectName':_0x1a2137,'appCode':undefined,'pullApi':![],'env':_0x344f9f}),_0x59504d(_0x2767fc(0x1e0));}return;}if(_0x466ece==='confirm-api-pull'){const _0x27a14e=_0x183452===0x0;_0xb77ea7(_0x27a14e),_0x4f335c(_0x319744=>[..._0x319744,{'step':_0x2767fc(0x1b1),'label':_0x2767fc(0x1e9),'value':_0x27a14e?'是':'否'}]);const _0xfec375=_0x2599e0||_0x21b3f9||'online';_0x2f71f8({'projectName':_0x1a2137,'appCode':_0x1d0cf6,'pullApi':_0x27a14e,'env':_0xfec375}),_0x59504d('creating');return;}if(_0x466ece===_0x2767fc(0x1ee)){const _0x164163=_0x49896f===0x0;if(_0x164163){_0x59504d(_0x2767fc(0x1df));const _0x2bd73a=await _0x34cd30();if(_0x2bd73a)_0x4f335c(_0x22cf0b=>[..._0x22cf0b,{'step':_0x2767fc(0x1d8),'label':'登录状态','value':_0x2767fc(0x1e8)}]),_0x59504d(_0x2767fc(0x1d4));else{_0x4f335c(_0x50775d=>[..._0x50775d,{'step':_0x2767fc(0x1d8),'label':_0x2767fc(0x1d2),'value':_0x2767fc(0x1b7)}]);const _0xf53b85=_0x2599e0||_0x21b3f9||_0x2767fc(0x1ea);_0x2f71f8({'projectName':_0x1a2137,'appCode':_0x1d0cf6,'pullApi':![],'env':_0xf53b85}),_0x59504d('creating');}}else{_0x4f335c(_0x55489d=>[..._0x55489d,{'step':_0x2767fc(0x1d8),'label':_0x2767fc(0x1d2),'value':_0x2767fc(0x1cf)}]);const _0x5095ce=_0x2599e0||_0x21b3f9||_0x2767fc(0x1ea);_0x2f71f8({'projectName':_0x1a2137,'appCode':_0x1d0cf6,'pullApi':![],'env':_0x5095ce}),_0x59504d(_0x2767fc(0x1e0));}return;}}if(_0x1560c3[_0x2767fc(0x1b9)]||_0x1560c3[_0x2767fc(0x1da)]){_0x131caf(_0x1fa920=>{const _0x316153=_0x2767fc,_0x42eaf3=_0x1fa920[_0x316153(0x1ce)](0x0,-0x1);if(_0x466ece===_0x316153(0x1d0)){const {valid:_0x2db9f8,message:_0x2dd540}=_0x28aa6b(_0x42eaf3);_0x539827(_0x2db9f8?'':_0x2dd540||'项目名不合法');}else{if(_0x466ece===_0x316153(0x1c5)){const {valid:_0x182960,message:_0x30b2c8}=_0x25d87d(_0x42eaf3);_0x539827(_0x182960?'':_0x30b2c8||_0x316153(0x1b5));}}return _0x42eaf3;});return;}if([_0x2767fc(0x1e0),_0x2767fc(0x1f1),_0x2767fc(0x1df)]['includes'](_0x466ece))return;if(_0x466ece===_0x2767fc(0x1d4)||_0x466ece===_0x2767fc(0x1ee))return;_0x131caf(_0x2bd87d=>{const _0x4709ca=_0x2767fc,_0x4d98e8=_0x2bd87d+_0x217e04;if(_0x466ece===_0x4709ca(0x1d0)){const {valid:_0x4882e4,message:_0x408960}=_0x28aa6b(_0x4d98e8);_0x539827(_0x4882e4?'':_0x408960||_0x4709ca(0x1e2));}else{if(_0x466ece==='app-code'){const {valid:_0x41e538,message:_0x5479f4}=_0x25d87d(_0x4d98e8);_0x539827(_0x41e538?'':_0x5479f4||_0x4709ca(0x1b5));}}return _0x4d98e8;});}),a32_0x48e955(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x2cee4a[_0x44738d(0x1c8)]===0x0&&a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':'cyan','children':'*\x20创建新项目'})}),_0x2cee4a[_0x44738d(0x1b8)](_0x289cb6=>a32_0x48e955(Box,{'children':[a32_0x48e955(Text,{'color':'green','children':['√\x20',_0x289cb6[_0x44738d(0x1ca)],':\x20']}),a32_0x40f6d4(Text,{'color':_0x44738d(0x1db),'children':_0x289cb6[_0x44738d(0x1ef)]})]},_0x289cb6['step'])),_0x466ece===_0x44738d(0x1d0)&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':_0x44738d(0x1e6)}),_0x538ee9?a32_0x40f6d4(Text,{'color':_0x44738d(0x1d7),'children':_0x538ee9}):a32_0x40f6d4(Text,{'color':_0x44738d(0x1dd),'children':_0x56024f}),_0x440658&&a32_0x48e955(Text,{'color':_0x44738d(0x1c3),'children':[_0x44738d(0x1bc),_0x440658]})]}),!_0x440658&&!_0x538ee9&&a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':'gray','children':_0x44738d(0x1b3)})})]}),_0x466ece===_0x44738d(0x1c5)&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':'*\x20应用AppCode\x20'}),a32_0x40f6d4(Text,{'color':'gray','children':'[可选]:\x20'}),a32_0x40f6d4(Text,{'color':_0x44738d(0x1d7),'children':_0x538ee9}),_0x440658&&a32_0x48e955(Text,{'color':_0x44738d(0x1c3),'children':[_0x44738d(0x1bc),_0x440658]})]}),!_0x440658&&a32_0x40f6d4(Box,{'children':a32_0x48e955(Text,{'color':_0x44738d(0x1dd),'children':['\x20',_0x44738d(0x1d9)]})})]}),_0x466ece===_0x44738d(0x1f1)&&a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':_0x44738d(0x1d6)}),_0x456c2b&&a32_0x40f6d4(Text,{'color':'gray','children':'\x20检查中...'})]}),_0x466ece==='confirm-api-pull'&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1d7),'children':_0x44738d(0x1dc)})}),a32_0x40f6d4(Box,{'marginTop':0x1,'children':a32_0x40f6d4(Text,{'children':_0x44738d(0x1cd)})}),a32_0x48e955(Box,{'marginLeft':0x2,'children':[a32_0x48e955(Text,{'color':_0x183452===0x0?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x183452===0x0?'▶\x20':'\x20\x20','Yes']}),a32_0x40f6d4(Text,{'children':'\x20'}),a32_0x48e955(Text,{'color':_0x183452===0x1?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x183452===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1dd),'children':_0x44738d(0x1d1)})}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1b4),'children':_0x44738d(0x1be)})})]}),_0x466ece==='login-prompt'&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1b4),'children':'!\x20未检测到有效登录'})}),a32_0x40f6d4(Box,{'marginTop':0x1,'children':a32_0x40f6d4(Text,{'children':_0x44738d(0x1c4)})}),a32_0x48e955(Box,{'marginLeft':0x2,'children':[a32_0x48e955(Text,{'color':_0x49896f===0x0?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x49896f===0x0?'▶\x20':'\x20\x20',_0x44738d(0x1c7)]}),a32_0x40f6d4(Text,{'children':'\x20'}),a32_0x48e955(Text,{'color':_0x49896f===0x1?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x49896f===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1dd),'children':_0x44738d(0x1d1)})}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1b4),'children':_0x44738d(0x1c0)})})]}),_0x466ece===_0x44738d(0x1df)&&a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':_0x44738d(0x1bb)}),_0x45c3da&&a32_0x40f6d4(Text,{'color':'gray','children':_0x44738d(0x1e3)})]})]});}function a32_0x142c(){const _0x51b858=['length','my-app','label','4737245WjazLo','test','*\x20是否要自动拉取\x20API\x20配置?','slice','跳过登录','project-name','\x20\x20使用\x20←→\x20选择,回车确认','登录状态','应用AppCode','confirm-api-pull','6DVxgpk','*\x20正在检查登录状态...','green','login','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','delete','cyan','√\x20检测到有效登录状态','gray','应用AppCode长度不能超过\x20100\x20个字符','login-process','creating','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','项目名不合法','\x20登录中...','trim','leftArrow','*\x20项目名:\x20','725847UcGUDZ','已登录','拉取API配置','online','1242KvDHni','string','项目名','login-prompt','value','5061156eNLfaD','login-check','api-pull','3258241oFCkxK','\x20直接回车确认,或输入自定义名称','yellow','应用AppCode不合法','112956BgYTKi','登录失败','map','backspace','6tNhBkY','*\x20正在登录,请前往浏览器完成登录...','\x20←\x20','9980440xKmUFC','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','env','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','12648xPlmYf','项目名长度不能超过\x2050\x20个字符','red','*\x20是否要先登录以便拉取\x20API\x20配置?','app-code','未设置','Yes'];a32_0x142c=function(){return _0x51b858;};return a32_0x142c();}
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 +1 @@
1
- function a33_0x3418(_0x2a2194,_0x38f26a){const _0x23ad8a=a33_0x23ad();return a33_0x3418=function(_0x34187c,_0x12198f){_0x34187c=_0x34187c-0x1c4;let _0x1442eb=_0x23ad8a[_0x34187c];return _0x1442eb;},a33_0x3418(_0x2a2194,_0x38f26a);}(function(_0x18af93,_0x50f3ad){const _0x5016ff=a33_0x3418,_0x16abf0=_0x18af93();while(!![]){try{const _0x5d0a0d=parseInt(_0x5016ff(0x1c7))/0x1+parseInt(_0x5016ff(0x1cc))/0x2+-parseInt(_0x5016ff(0x1c9))/0x3*(parseInt(_0x5016ff(0x1ca))/0x4)+-parseInt(_0x5016ff(0x1cb))/0x5+parseInt(_0x5016ff(0x1c4))/0x6+-parseInt(_0x5016ff(0x1c6))/0x7+parseInt(_0x5016ff(0x1c8))/0x8;if(_0x5d0a0d===_0x50f3ad)break;else _0x16abf0['push'](_0x16abf0['shift']());}catch(_0x71cff){_0x16abf0['push'](_0x16abf0['shift']());}}}(a33_0x23ad,0x68bac));export function formatElapsed(_0x208911){const _0xc17832=a33_0x3418,_0x4b8691=Date['now']()-_0x208911;if(_0x4b8691<0x3e8)return _0x4b8691+'ms';const _0x457a7d=(_0x4b8691/0x3e8)['toFixed'](0x2),_0x58cec9=_0x457a7d[_0xc17832(0x1c5)](/\.?0+$/u,'');return _0x58cec9+'s';}function a33_0x23ad(){const _0x200640=['1068864Bzxjpo','replace','2996154uSzUNk','195390yCFVqW','5588200UDTDjn','30qsVuZj','46204fsHpCv','3993480ypwmJB','1398282MAdoLw'];a33_0x23ad=function(){return _0x200640;};return a33_0x23ad();}
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 +1 @@
1
- (function(_0x48fc96,_0x268c19){const _0x5301bc=a34_0xea0e,_0xa973d2=_0x48fc96();while(!![]){try{const _0x4e31fa=-parseInt(_0x5301bc(0x1fc))/0x1+-parseInt(_0x5301bc(0x206))/0x2*(parseInt(_0x5301bc(0x24a))/0x3)+parseInt(_0x5301bc(0x1f6))/0x4+-parseInt(_0x5301bc(0x233))/0x5+parseInt(_0x5301bc(0x216))/0x6*(-parseInt(_0x5301bc(0x21d))/0x7)+parseInt(_0x5301bc(0x234))/0x8+parseInt(_0x5301bc(0x227))/0x9;if(_0x4e31fa===_0x268c19)break;else _0xa973d2['push'](_0xa973d2['shift']());}catch(_0x28dd4a){_0xa973d2['push'](_0xa973d2['shift']());}}}(a34_0x5e8f,0xb7372));import{jsx as a34_0x32fa6e,Fragment as a34_0x3e4173,jsxs as a34_0x5563e9}from'react/jsx-runtime';function a34_0xea0e(_0x336889,_0x5b4fe0){const _0x5e8f9c=a34_0x5e8f();return a34_0xea0e=function(_0xea0e10,_0x3c96da){_0xea0e10=_0xea0e10-0x1f2;let _0x3a4578=_0x5e8f9c[_0xea0e10];return _0x3a4578;},a34_0xea0e(_0x336889,_0x5b4fe0);}import a34_0xc9fe69 from'node:path';import a34_0xf6a424 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';function a34_0x5e8f(){const _0x40bee3=['error','cd\x20','×\x20无法在当前目录创建项目,请检查目录权限','package.json','\x20√\x20','cwd','项目创建完成:\x20','*\x20正在拉取\x20API\x20配置...','projectCode','stringify',',\x20description=','\x20配置应用AppCode:\x20','message','string','info','×\x20项目名不能为空','white','21tHTqWu','\x20&&\x20lovrabet\x20start','\x20已存在,请使用其他项目名','cyan','W_OK','√\x20package.json\x20已更新:\x20name=','开始创建项目:\x20','column','5234088ZZwZyC','配置应用AppCode:\x20','url','📁\x20项目名称:\x20','lovrabet\x20config\x20set\x20appcode\x20[app-code]','更新\x20package.json\x20name\x20和\x20description\x20字段','232722IIrMqx','\x20|\x20应用AppCode:\x20','create','*\x20清理失败的项目目录:\x20','已自动拉取\x20✓','pullApi','toLocaleString','1.0.0','resolve','更新\x20package.json\x20失败:\x20','181402kbQeRF','utf8','accessSync','×\x20项目目录\x20','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','doTask','success','warn','name','trim','env','projectName','yellow','.lovrabetrc','\x20创建配置文件','version','1818CMpvzR','📦\x20API配置:\x20','repeat','√\x20配置文件已创建,应用AppCode:\x20','existsSync','parse','setLogPath','15533zXybgS','writeFileSync','🚀\x20接下来可以:','green','join','appCode','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','项目名称:\x20','../..','readFileSync','9191628CXplul','log','拉取API配置:\x20','启动项目:\x20','rmSync','gray','*\x20正在为项目\x20','test','description','需手动拉取','*\x20配置文件路径:\x20','dirname','1300395ciqbLo','1765608dkijVg','lovrabet\x20api\x20pull','2.\x20','1.\x20','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置'];a34_0x5e8f=function(){return _0x40bee3;};return a34_0x5e8f();}import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x4c5024){const _0x19ee52=a34_0xea0e,[_0xc115bf,_0x2b8984]=useState(![]),[_0x4c2ed1,_0x58a43f]=useState(![]),[_0x242982,_0x179f71]=useState(null),_0x114491=useCopyProjectTemplate(),_0x1daefb=useInstallDependencies(),_0x4478f5=useFormatCode(),_0x1517f3=async _0xb5f2b6=>{const _0x204348=a34_0xea0e;if(!_0xb5f2b6[_0x204348(0x211)]||_0xb5f2b6[_0x204348(0x211)][_0x204348(0x20f)]()===''){console[_0x204348(0x239)](_0x204348(0x248));return;}const _0x36b904=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x36b904[_0x204348(0x22e)](_0xb5f2b6[_0x204348(0x211)])){console[_0x204348(0x239)](_0x204348(0x20a));return;}if(_0xb5f2b6[_0x204348(0x211)]['length']>0x64){console[_0x204348(0x239)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x59b74c=a34_0xc9fe69['resolve'](process[_0x204348(0x23e)](),_0xb5f2b6[_0x204348(0x211)]);if(a34_0xf6a424[_0x204348(0x21a)](_0x59b74c)){console[_0x204348(0x239)](_0x204348(0x209)+_0xb5f2b6[_0x204348(0x211)]+_0x204348(0x24c));return;}try{const _0x34f235=a34_0xc9fe69[_0x204348(0x232)](_0x59b74c);a34_0xf6a424[_0x204348(0x208)](_0x34f235,a34_0xf6a424['constants'][_0x204348(0x1f2)]);}catch(_0x45ac47){console[_0x204348(0x239)](_0x204348(0x23b));return;}_0x179f71(_0xb5f2b6),_0x2b8984(!![]),logger[_0x204348(0x21c)](_0x59b74c),logger[_0x204348(0x247)]('create',_0x204348(0x1f4)+_0xb5f2b6[_0x204348(0x211)],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)]});try{await _0x114491[_0x204348(0x20b)](_0xb5f2b6[_0x204348(0x211)]),await _0xff116(_0xb5f2b6[_0x204348(0x211)]),await _0x1daefb[_0x204348(0x20b)](_0xb5f2b6[_0x204348(0x211)]),await _0x4478f5[_0x204348(0x20b)](_0xb5f2b6[_0x204348(0x211)]),await _0x33a8bf(_0xb5f2b6[_0x204348(0x211)],_0xb5f2b6['appCode']||'',_0xb5f2b6['env']);if(_0xb5f2b6[_0x204348(0x201)]&&_0xb5f2b6[_0x204348(0x222)]){console[_0x204348(0x228)](_0x204348(0x240));try{const _0x39b553=await pullApiSilent(_0xb5f2b6[_0x204348(0x222)],undefined,_0x59b74c,_0xb5f2b6[_0x204348(0x210)]);_0x39b553?(console[_0x204348(0x228)]('√\x20API\x20配置拉取完成'),logger[_0x204348(0x247)](_0x204348(0x1fe),'API\x20配置拉取成功:\x20'+_0xb5f2b6[_0x204348(0x222)],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)],'env':_0xb5f2b6['env']})):(console[_0x204348(0x228)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x204348(0x20d)](_0x204348(0x1fe),'API\x20配置拉取失败:\x20'+_0xb5f2b6[_0x204348(0x222)],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)],'env':_0xb5f2b6[_0x204348(0x210)]}));}catch(_0x184e31){console[_0x204348(0x228)](_0x204348(0x223)),logger[_0x204348(0x20d)](_0x204348(0x1fe),'API\x20配置拉取异常:\x20'+_0xb5f2b6['appCode'],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)],'env':_0xb5f2b6['env'],'error':_0x184e31 instanceof Error?_0x184e31[_0x204348(0x245)]:String(_0x184e31)});}}logger[_0x204348(0x20c)](_0x204348(0x1fe),_0x204348(0x23f)+_0xb5f2b6['projectName']),_0x58a43f(!![]),_0x2b8984(![]);}catch(_0x4940d9){logger[_0x204348(0x239)](_0x204348(0x1fe),'项目创建失败:\x20'+_0xb5f2b6[_0x204348(0x211)],{'error':_0x4940d9 instanceof Error?_0x4940d9[_0x204348(0x245)]:String(_0x4940d9)});try{a34_0xf6a424[_0x204348(0x21a)](_0x59b74c)&&(console[_0x204348(0x228)](_0x204348(0x1ff)+_0x59b74c),a34_0xf6a424[_0x204348(0x22b)](_0x59b74c,{'recursive':!![],'force':!![]}));}catch(_0x418d65){logger[_0x204348(0x20d)]('create','清理项目目录失败:\x20'+_0x59b74c,{'error':_0x418d65 instanceof Error?_0x418d65[_0x204348(0x245)]:String(_0x418d65)});}_0x2b8984(![]),console[_0x204348(0x239)]('×\x20项目创建失败:\x20'+(_0x4940d9 instanceof Error?_0x4940d9[_0x204348(0x245)]:String(_0x4940d9)));}},_0x14ff4a=async _0x9d5c31=>{await _0x1517f3({'projectName':_0x9d5c31,'env':_0x4c5024['env']});},_0xff116=async _0x47f6ad=>{const _0x548a13=a34_0xea0e,_0x882b76=a34_0xc9fe69[_0x548a13(0x204)](process[_0x548a13(0x23e)](),_0x47f6ad),_0x27a2e1=a34_0xc9fe69[_0x548a13(0x221)](_0x882b76,_0x548a13(0x23c));try{console[_0x548a13(0x228)]('*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段');const _0x1802aa=fileURLToPath(import.meta[_0x548a13(0x1f8)]),_0xddd894=a34_0xc9fe69[_0x548a13(0x204)](a34_0xc9fe69[_0x548a13(0x232)](_0x1802aa),_0x548a13(0x225)),_0x7b9b60=a34_0xc9fe69[_0x548a13(0x221)](_0xddd894,_0x548a13(0x23c));let _0x2fd61a='1.0.0';try{const _0x5cf7f6=JSON['parse'](a34_0xf6a424[_0x548a13(0x226)](_0x7b9b60,_0x548a13(0x207)));_0x2fd61a=_0x5cf7f6[_0x548a13(0x215)]||_0x548a13(0x203);}catch(_0xa6544b){}const _0x3ea1c0=a34_0xf6a424['readFileSync'](_0x27a2e1,_0x548a13(0x207)),_0x3591d2=JSON['parse'](_0x3ea1c0);_0x3591d2[_0x548a13(0x20e)]=_0x47f6ad,_0x3591d2[_0x548a13(0x22f)]=_0x47f6ad+'\x20Generated\x20by\x20lovrabet\x20cli\x20'+_0x2fd61a,a34_0xf6a424[_0x548a13(0x21e)](_0x27a2e1,JSON[_0x548a13(0x242)](_0x3591d2,null,0x2)+'\x0a',_0x548a13(0x207)),console[_0x548a13(0x228)](_0x548a13(0x1f3)+_0x47f6ad+_0x548a13(0x243)+_0x3591d2['description']),logger[_0x548a13(0x247)](_0x548a13(0x1fe),_0x548a13(0x1fb),{'projectName':_0x47f6ad,'description':_0x3591d2[_0x548a13(0x22f)],'cliVersion':_0x2fd61a,'packageJsonPath':_0x548a13(0x23c)});}catch(_0x34e018){logger[_0x548a13(0x239)](_0x548a13(0x1fe),_0x548a13(0x205)+_0x47f6ad,{'projectName':_0x47f6ad,'error':_0x34e018 instanceof Error?_0x34e018[_0x548a13(0x245)]:String(_0x34e018)});throw _0x34e018;}},_0x33a8bf=async(_0x4eb648,_0x37d337,_0x57cc45)=>{const _0x34d31b=a34_0xea0e,_0xa6d911=a34_0xc9fe69[_0x34d31b(0x204)](process[_0x34d31b(0x23e)](),_0x4eb648),_0x22b096=a34_0xc9fe69[_0x34d31b(0x221)](_0xa6d911,_0x34d31b(0x213));try{_0x37d337?console[_0x34d31b(0x228)]('*\x20正在为项目\x20'+_0x4eb648+_0x34d31b(0x244)+_0x37d337):console['log'](_0x34d31b(0x22d)+_0x4eb648+_0x34d31b(0x214));console[_0x34d31b(0x228)](_0x34d31b(0x231)+_0x22b096);const _0x15cfe0=fileURLToPath(import.meta[_0x34d31b(0x1f8)]),_0x97f925=a34_0xc9fe69[_0x34d31b(0x204)](a34_0xc9fe69[_0x34d31b(0x232)](_0x15cfe0),_0x34d31b(0x225)),_0x456ce3=a34_0xc9fe69[_0x34d31b(0x221)](_0x97f925,_0x34d31b(0x23c));let _0x56034a=_0x34d31b(0x203);try{const _0x303661=JSON[_0x34d31b(0x21b)](a34_0xf6a424[_0x34d31b(0x226)](_0x456ce3,_0x34d31b(0x207)));_0x56034a=_0x303661[_0x34d31b(0x215)]||'1.0.0';}catch(_0x3ac041){}const _0x3fd9c9=readConfig(),_0x386396=typeof _0x3fd9c9['env']===_0x34d31b(0x246)?_0x3fd9c9['env']:undefined,{app:_0x1798fb,appcode:_0x33b87e,..._0x3ed767}=_0x3fd9c9,_0x59a94b={..._0x3ed767,'appcode':_0x37d337||'','env':_0x57cc45||_0x386396||'online','createdAt':new Date()[_0x34d31b(0x202)](),'version':_0x56034a};a34_0xf6a424[_0x34d31b(0x21e)](_0x22b096,JSON['stringify'](_0x59a94b,null,0x2),'utf8'),_0x37d337?console[_0x34d31b(0x228)](_0x34d31b(0x219)+_0x37d337):console[_0x34d31b(0x228)](_0x34d31b(0x238)),logger[_0x34d31b(0x247)]('create',_0x34d31b(0x1f7)+_0x37d337,{'projectName':_0x4eb648,'configFile':_0x34d31b(0x213)});}catch(_0x4902a3){logger[_0x34d31b(0x239)]('create','配置应用AppCode失败:\x20'+_0x37d337,{'projectName':_0x4eb648,'error':_0x4902a3 instanceof Error?_0x4902a3[_0x34d31b(0x245)]:String(_0x4902a3)});}};useEffect(()=>{const _0x27e927=a34_0xea0e;_0x4c5024[_0x27e927(0x241)]&&_0x14ff4a(_0x4c5024[_0x27e927(0x241)]);},[_0x4c5024[_0x19ee52(0x241)]]);if(!_0xc115bf&&!_0x4c2ed1&&!_0x4c5024[_0x19ee52(0x241)])return a34_0x32fa6e(EnhancedGuidedCreate,{'onCreate':_0x1517f3,'env':_0x4c5024['env']});if(_0xc115bf)return a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x5563e9(Box,{'marginTop':0x1,'children':[a34_0x32fa6e(Box,{'width':'1'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':'\x20√\x20'}),a34_0x32fa6e(Text,{'children':'项目名称:\x20'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':_0x242982?.[_0x19ee52(0x211)]}),_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x32fa6e(Text,{'children':_0x19ee52(0x1fd)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'children':_0x242982[_0x19ee52(0x222)]})]})]}),a34_0x32fa6e(TaskRunning,{..._0x114491}),a34_0x32fa6e(TaskRunning,{..._0x1daefb}),a34_0x32fa6e(TaskRunning,{..._0x4478f5})]});if(_0x4c2ed1)return a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x5563e9(Box,{'marginTop':0x1,'children':[a34_0x32fa6e(Box,{'width':'1'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':_0x19ee52(0x23d)}),a34_0x32fa6e(Text,{'children':_0x19ee52(0x224)}),a34_0x32fa6e(Text,{'color':'green','children':_0x242982?.[_0x19ee52(0x211)]}),_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x32fa6e(Text,{'children':_0x19ee52(0x1fd)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'children':_0x242982[_0x19ee52(0x222)]})]})]}),a34_0x32fa6e(TaskFinished,{..._0x114491}),a34_0x32fa6e(TaskFinished,{..._0x1daefb}),a34_0x32fa6e(TaskFinished,{..._0x4478f5}),a34_0x32fa6e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':'─'[_0x19ee52(0x218)](0x3c)})}),a34_0x32fa6e(Box,{'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'bold':!![],'children':'🎉\x20项目创建成功!'})}),a34_0x5563e9(Box,{'marginTop':0x1,'flexDirection':_0x19ee52(0x1f5),'children':[a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'cyan','children':_0x19ee52(0x1f9)}),a34_0x32fa6e(Text,{'color':'white','bold':!![],'children':_0x242982?.[_0x19ee52(0x211)]})]}),_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'cyan','children':'🔗\x20应用AppCode:\x20'}),a34_0x32fa6e(Text,{'color':'white','bold':!![],'children':_0x242982[_0x19ee52(0x222)]})]}),a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'children':_0x19ee52(0x217)}),_0x242982?.[_0x19ee52(0x201)]?a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'bold':!![],'children':_0x19ee52(0x200)}):_0x242982?.['appCode']?a34_0x32fa6e(Text,{'color':_0x19ee52(0x212),'bold':!![],'children':_0x19ee52(0x230)}):a34_0x32fa6e(Text,{'color':'gray','bold':!![],'children':'未配置'})]})]}),a34_0x32fa6e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x21f)})}),a34_0x5563e9(Box,{'marginLeft':0x2,'flexDirection':_0x19ee52(0x1f5),'children':[a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'green','children':_0x19ee52(0x237)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x249),'children':_0x19ee52(0x22a)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x23a)+_0x242982?.[_0x19ee52(0x211)]+_0x19ee52(0x24b)})]}),_0x242982?.['appCode']&&!_0x242982?.[_0x19ee52(0x201)]&&a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'yellow','children':_0x19ee52(0x236)}),a34_0x32fa6e(Text,{'color':'white','children':_0x19ee52(0x229)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x235)})]}),!_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':_0x19ee52(0x22c),'children':_0x19ee52(0x236)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x249),'children':'配置AppCode:\x20'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x1fa)})]}),a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':_0x19ee52(0x22c),'children':'3.\x20'}),a34_0x32fa6e(Text,{'color':'white','children':_0x19ee52(0x229)}),a34_0x32fa6e(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a34_0x32fa6e(Box,{'marginTop':0x1,'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':'─'[_0x19ee52(0x218)](0x3c)})})]});return null;}
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 +1 @@
1
- (function(_0x3b1d2e,_0x33c06b){var _0x1c83df=a35_0x2752,_0x69ebc4=_0x3b1d2e();while(!![]){try{var _0x2fab7e=-parseInt(_0x1c83df(0x18b))/0x1*(-parseInt(_0x1c83df(0x187))/0x2)+parseInt(_0x1c83df(0x184))/0x3*(parseInt(_0x1c83df(0x183))/0x4)+-parseInt(_0x1c83df(0x17f))/0x5*(-parseInt(_0x1c83df(0x185))/0x6)+parseInt(_0x1c83df(0x18a))/0x7*(parseInt(_0x1c83df(0x18c))/0x8)+parseInt(_0x1c83df(0x17e))/0x9+-parseInt(_0x1c83df(0x188))/0xa*(-parseInt(_0x1c83df(0x180))/0xb)+-parseInt(_0x1c83df(0x186))/0xc;if(_0x2fab7e===_0x33c06b)break;else _0x69ebc4['push'](_0x69ebc4['shift']());}catch(_0x439c5c){_0x69ebc4['push'](_0x69ebc4['shift']());}}}(a35_0x1093,0x35361));function a35_0x1093(){var _0x1bfd97=['1096PsZdPV','473877IGTGkQ','10kblFzC','11YkMUwe','elapsed','\x20√\x20','4rssudO','207507rMuXcP','587094cOBZXw','11166804sDmJkm','2jlSJvb','2224990SYSlwT','green','15589xVsycX','303402kxmxyW'];a35_0x1093=function(){return _0x1bfd97;};return a35_0x1093();}function a35_0x2752(_0x4a0ee3,_0x1ecedf){var _0x1093b5=a35_0x1093();return a35_0x2752=function(_0x2752ba,_0x103cb0){_0x2752ba=_0x2752ba-0x17e;var _0x3bb069=_0x1093b5[_0x2752ba];return _0x3bb069;},a35_0x2752(_0x4a0ee3,_0x1ecedf);}import{jsx as a35_0x19545d,jsxs as a35_0x461e4e}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x20510d){var _0x537bcc=a35_0x2752;return a35_0x461e4e(Box,{'children':[a35_0x19545d(Box,{'width':'1'}),a35_0x19545d(Text,{'color':_0x537bcc(0x189),'children':_0x537bcc(0x182)}),a35_0x19545d(Text,{'children':_0x20510d['taskName']}),a35_0x19545d(TaskTime,{'elapsed':_0x20510d[_0x537bcc(0x181)]})]});}
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 +1 @@
1
- function a36_0x3f5c(){var _0x66a938=['21gUejqb','399900MDvNGZ','green','506550uAFXxk','2652376fYvhAy','224248CewiQB','finished','110xTQDdN','\x20\x20\x20','1306080AzpjYK','15357vEBIbj','20HeRKTC','164592KVfTny'];a36_0x3f5c=function(){return _0x66a938;};return a36_0x3f5c();}(function(_0xade21b,_0x1bd0f8){var _0x54aa38=a36_0x1ef1,_0x13c2f0=_0xade21b();while(!![]){try{var _0x22984a=parseInt(_0x54aa38(0x1f0))/0x1+parseInt(_0x54aa38(0x1f2))/0x2*(parseInt(_0x54aa38(0x1f5))/0x3)+-parseInt(_0x54aa38(0x1f7))/0x4+-parseInt(_0x54aa38(0x1f9))/0x5+parseInt(_0x54aa38(0x1ee))/0x6*(-parseInt(_0x54aa38(0x1f8))/0x7)+parseInt(_0x54aa38(0x1ef))/0x8+parseInt(_0x54aa38(0x1f4))/0x9*(-parseInt(_0x54aa38(0x1f6))/0xa);if(_0x22984a===_0x1bd0f8)break;else _0x13c2f0['push'](_0x13c2f0['shift']());}catch(_0x36d2be){_0x13c2f0['push'](_0x13c2f0['shift']());}}}(a36_0x3f5c,0x2a299));import{jsx as a36_0x4620b9,jsxs as a36_0x4a9919}from'react/jsx-runtime';import{Text}from'ink';import a36_0x26d888 from'ink-spinner';function a36_0x1ef1(_0x333645,_0x504a5a){var _0x3f5c7c=a36_0x3f5c();return a36_0x1ef1=function(_0x1ef1a4,_0x179efd){_0x1ef1a4=_0x1ef1a4-0x1ee;var _0x401f44=_0x3f5c7c[_0x1ef1a4];return _0x401f44;},a36_0x1ef1(_0x333645,_0x504a5a);}export function TaskLoading(_0x52fff4){var _0x518693=a36_0x1ef1;if(_0x52fff4[_0x518693(0x1f1)])return a36_0x4620b9(Text,{'color':_0x518693(0x1fa),'children':'\x20√\x20'});if(_0x52fff4['loading'])return a36_0x4a9919(Text,{'color':_0x518693(0x1fa),'children':['\x20',a36_0x4620b9(a36_0x26d888,{'type':'dots'}),'\x20']});return a36_0x4620b9(Text,{'children':_0x518693(0x1f3)});}
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 +1 @@
1
- (function(_0x4a1e3d,_0x264620){var _0x3c800c=a37_0xbcb0,_0x2870cf=_0x4a1e3d();while(!![]){try{var _0x48bf25=parseInt(_0x3c800c(0x1c7))/0x1*(parseInt(_0x3c800c(0x1c5))/0x2)+parseInt(_0x3c800c(0x1ce))/0x3*(parseInt(_0x3c800c(0x1d0))/0x4)+-parseInt(_0x3c800c(0x1c9))/0x5+-parseInt(_0x3c800c(0x1c6))/0x6*(-parseInt(_0x3c800c(0x1cc))/0x7)+-parseInt(_0x3c800c(0x1c4))/0x8*(parseInt(_0x3c800c(0x1cb))/0x9)+-parseInt(_0x3c800c(0x1cf))/0xa*(-parseInt(_0x3c800c(0x1cd))/0xb)+-parseInt(_0x3c800c(0x1d1))/0xc*(parseInt(_0x3c800c(0x1ca))/0xd);if(_0x48bf25===_0x264620)break;else _0x2870cf['push'](_0x2870cf['shift']());}catch(_0x52d8e1){_0x2870cf['push'](_0x2870cf['shift']());}}}(a37_0x12ea,0x207e5));function a37_0x12ea(){var _0x514e42=['45171sHWmxL','168GjQXJy','3839rHieZf','93oKHLok','170gAaAxN','6056aJqfIS','12rmJqOH','112gMsqSI','24014xRmFcd','65334OePqFd','17pFDjtk','elapsed','546170GIaqiQ','2674477kuQgNT'];a37_0x12ea=function(){return _0x514e42;};return a37_0x12ea();}function a37_0xbcb0(_0x4a231b,_0x280ced){var _0x12eadd=a37_0x12ea();return a37_0xbcb0=function(_0xbcb078,_0x240890){_0xbcb078=_0xbcb078-0x1c4;var _0x134527=_0x12eadd[_0xbcb078];return _0x134527;},a37_0xbcb0(_0x4a231b,_0x280ced);}import{jsx as a37_0x86dea1,jsxs as a37_0x5dccc1}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x2878ab){var _0x2820f5=a37_0xbcb0;return a37_0x5dccc1(Box,{'children':[a37_0x86dea1(Box,{'width':'1'}),a37_0x86dea1(TaskLoading,{..._0x2878ab}),a37_0x86dea1(Text,{'children':_0x2878ab['taskName']}),a37_0x86dea1(TaskTime,{'elapsed':_0x2878ab[_0x2820f5(0x1c8)]})]});}
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 +1 @@
1
- (function(_0x58c24,_0x75a13d){var _0x28256f=a38_0x395f,_0x4a16c8=_0x58c24();while(!![]){try{var _0x8aa3d9=-parseInt(_0x28256f(0x1e3))/0x1*(-parseInt(_0x28256f(0x1e8))/0x2)+parseInt(_0x28256f(0x1eb))/0x3+parseInt(_0x28256f(0x1e2))/0x4+-parseInt(_0x28256f(0x1e4))/0x5+-parseInt(_0x28256f(0x1ea))/0x6+-parseInt(_0x28256f(0x1e5))/0x7*(parseInt(_0x28256f(0x1e7))/0x8)+-parseInt(_0x28256f(0x1e9))/0x9;if(_0x8aa3d9===_0x75a13d)break;else _0x4a16c8['push'](_0x4a16c8['shift']());}catch(_0x1daaaa){_0x4a16c8['push'](_0x4a16c8['shift']());}}}(a38_0x5e98,0xf0d21));function a38_0x395f(_0x3cdc09,_0x3a7226){var _0x5e981e=a38_0x5e98();return a38_0x395f=function(_0x395f8b,_0x539158){_0x395f8b=_0x395f8b-0x1e2;var _0x2abe9f=_0x5e981e[_0x395f8b];return _0x2abe9f;},a38_0x395f(_0x3cdc09,_0x3a7226);}function a38_0x5e98(){var _0x22c9dd=['gray','2233224ffIyJj','16916BNdEAB','11517552oNgprA','6697608XEXQqx','4101753pczlur','7287228pJLpVd','173XHosDa','4953710VfsjLz','7RTHlRS'];a38_0x5e98=function(){return _0x22c9dd;};return a38_0x5e98();}import{jsx as a38_0x30671f,Fragment as a38_0xb05826,jsxs as a38_0x3a8b5d}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x156e0c){var _0x2177b9=a38_0x395f;if(_0x156e0c['elapsed'])return a38_0x3a8b5d(a38_0xb05826,{'children':[a38_0x30671f(Text,{'color':_0x2177b9(0x1e6),'children':'\x20['}),a38_0x30671f(Text,{'color':'gray','bold':!![],'children':_0x156e0c['elapsed']}),a38_0x30671f(Text,{'color':_0x2177b9(0x1e6),'children':']'})]});return null;}
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 +1 @@
1
- const a39_0x2bf17a=a39_0x3322;function a39_0x3322(_0x3230a3,_0x5467c6){const _0x46b155=a39_0x46b1();return a39_0x3322=function(_0x332280,_0x5c0d38){_0x332280=_0x332280-0x192;let _0x550b45=_0x46b155[_0x332280];return _0x550b45;},a39_0x3322(_0x3230a3,_0x5467c6);}function a39_0x46b1(){const _0x5d942e=['项目模板复制完成','error','项目模板复制失败','1888440JhzYqq','开始复制项目模板','复制项目文件','35215lJLVcM','url','888oypRaI','1127083FXRkQs','cwd','460029aCWjnt','success','resolve','info','copy','../../templates/projects/sub-app-react-demo','35zpJkaU','656714WlzUFA','9349950iZUXiB','now','8JNIMuw','5387742YKhRim'];a39_0x46b1=function(){return _0x5d942e;};return a39_0x46b1();}(function(_0x3b25c5,_0x356703){const _0x1b9b93=a39_0x3322,_0x977c2a=_0x3b25c5();while(!![]){try{const _0x35af5a=parseInt(_0x1b9b93(0x1a8))/0x1+-parseInt(_0x1b9b93(0x19a))/0x2+-parseInt(_0x1b9b93(0x193))/0x3*(-parseInt(_0x1b9b93(0x19d))/0x4)+parseInt(_0x1b9b93(0x1a5))/0x5*(parseInt(_0x1b9b93(0x1a7))/0x6)+parseInt(_0x1b9b93(0x199))/0x7*(-parseInt(_0x1b9b93(0x1a2))/0x8)+parseInt(_0x1b9b93(0x19e))/0x9+-parseInt(_0x1b9b93(0x19b))/0xa;if(_0x35af5a===_0x356703)break;else _0x977c2a['push'](_0x977c2a['shift']());}catch(_0x380b21){_0x977c2a['push'](_0x977c2a['shift']());}}}(a39_0x46b1,0x9a168));import a39_0x1a35e2 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a39_0x1a35e2['dirname'](fileURLToPath(import.meta[a39_0x2bf17a(0x1a6)])),templateDir=a39_0x1a35e2['resolve'](__dirname,a39_0x2bf17a(0x198));export function useCopyProjectTemplate(){const _0x2b73aa=a39_0x2bf17a,[_0x5c85b9,_0x36186a]=useState(![]),[_0x3c462b,_0x3a23fc]=useState(![]),[_0x323aca,_0x435f30]=useState(''),_0x2937ee=useCallback(async _0x275b56=>{const _0x3ad000=a39_0x3322,_0x490be9=Date[_0x3ad000(0x19c)](),_0x4b64fd=a39_0x1a35e2[_0x3ad000(0x195)](process[_0x3ad000(0x192)](),_0x275b56);_0x36186a(!![]);try{logger[_0x3ad000(0x196)](_0x3ad000(0x197),_0x3ad000(0x1a3),{'projectCode':_0x275b56,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4b64fd);const _0x1e8687=Date['now']()-_0x490be9;logger[_0x3ad000(0x194)]('copy',_0x3ad000(0x19f),_0x1e8687,{'projectCode':_0x275b56});}catch(_0x1234af){const _0x4193e1=Date['now']()-_0x490be9;logger[_0x3ad000(0x1a0)](_0x3ad000(0x197),_0x3ad000(0x1a1),{'projectCode':_0x275b56,'error':_0x1234af instanceof Error?_0x1234af['message']:String(_0x1234af),'duration':_0x4193e1});throw _0x1234af;}finally{_0x36186a(![]),_0x3a23fc(!![]),_0x435f30(formatElapsed(_0x490be9));}},[]);return{'taskName':_0x2b73aa(0x1a4),'finished':_0x3c462b,'loading':_0x5c85b9,'elapsed':_0x323aca,'doTask':_0x2937ee};}
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 +1 @@
1
- (function(_0x4b7030,_0x35032a){const _0xd75b71=a40_0x2fb6,_0x14cdf0=_0x4b7030();while(!![]){try{const _0x3311ba=-parseInt(_0xd75b71(0x1b6))/0x1*(parseInt(_0xd75b71(0x1c8))/0x2)+parseInt(_0xd75b71(0x1c3))/0x3*(-parseInt(_0xd75b71(0x1c4))/0x4)+-parseInt(_0xd75b71(0x1c1))/0x5+parseInt(_0xd75b71(0x1cb))/0x6+parseInt(_0xd75b71(0x1c7))/0x7+parseInt(_0xd75b71(0x1be))/0x8*(parseInt(_0xd75b71(0x1ca))/0x9)+parseInt(_0xd75b71(0x1b8))/0xa;if(_0x3311ba===_0x35032a)break;else _0x14cdf0['push'](_0x14cdf0['shift']());}catch(_0xe38c39){_0x14cdf0['push'](_0x14cdf0['shift']());}}}(a40_0x5ec3,0x59f3b));function a40_0x2fb6(_0x1bfac0,_0x4a3bdf){const _0x5ec34e=a40_0x5ec3();return a40_0x2fb6=function(_0x2fb674,_0x4af346){_0x2fb674=_0x2fb674-0x1b6;let _0x6331cf=_0x5ec34e[_0x2fb674];return _0x6331cf;},a40_0x2fb6(_0x1bfac0,_0x4a3bdf);}import a40_0x80604d from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a40_0x5ec3(){const _0x166ed9=['resolve','160QKoxwJ','error','message','37245IToGza','--write','3IdmiIk','2627556UXzGhq','format','开始格式化代码','2636473zxKRza','248592GzduGw','格式化代码','252630gLsTAJ','2197836ghbtVD','3yLxbxu','success','1013240pZVLta','now','info','代码格式化失败','prettier'];a40_0x5ec3=function(){return _0x166ed9;};return a40_0x5ec3();}import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x5485a4=a40_0x2fb6,[_0x104bb5,_0x39c30e]=useState(![]),[_0x27d3aa,_0xb38687]=useState(![]),[_0x3d6979,_0x5e3415]=useState(''),_0x55fb02=useCallback(async _0x508bda=>{const _0xd5b648=a40_0x2fb6,_0x4c9561=Date[_0xd5b648(0x1b9)](),_0x4d23ec=a40_0x80604d[_0xd5b648(0x1bd)](process['cwd'](),_0x508bda);_0x39c30e(!![]);try{logger[_0xd5b648(0x1ba)](_0xd5b648(0x1c5),_0xd5b648(0x1c6),{'projectCode':_0x508bda}),await execa('npx',[_0xd5b648(0x1bc),_0xd5b648(0x1c2),'.'],{'cwd':_0x4d23ec});const _0x141a78=Date[_0xd5b648(0x1b9)]()-_0x4c9561;logger[_0xd5b648(0x1b7)](_0xd5b648(0x1c5),'代码格式化完成',_0x141a78,{'projectCode':_0x508bda});}catch(_0x59fbd9){const _0x5dedab=Date[_0xd5b648(0x1b9)]()-_0x4c9561;logger[_0xd5b648(0x1bf)](_0xd5b648(0x1c5),_0xd5b648(0x1bb),{'projectCode':_0x508bda,'error':_0x59fbd9 instanceof Error?_0x59fbd9[_0xd5b648(0x1c0)]:String(_0x59fbd9),'duration':_0x5dedab});throw _0x59fbd9;}finally{_0x39c30e(![]),_0xb38687(!![]),_0x5e3415(formatElapsed(_0x4c9561));}},[]);return{'taskName':_0x5485a4(0x1c9),'finished':_0x27d3aa,'loading':_0x104bb5,'elapsed':_0x3d6979,'doTask':_0x55fb02};}
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 +1 @@
1
- (function(_0x20c0ad,_0x5cd297){const _0x404892=a41_0x15c3,_0x1074e0=_0x20c0ad();while(!![]){try{const _0x7aabab=-parseInt(_0x404892(0xe5))/0x1+parseInt(_0x404892(0xdf))/0x2*(parseInt(_0x404892(0xee))/0x3)+parseInt(_0x404892(0xdd))/0x4+-parseInt(_0x404892(0xdb))/0x5+-parseInt(_0x404892(0xe0))/0x6*(-parseInt(_0x404892(0xe9))/0x7)+-parseInt(_0x404892(0xe1))/0x8+-parseInt(_0x404892(0xe4))/0x9*(-parseInt(_0x404892(0xeb))/0xa);if(_0x7aabab===_0x5cd297)break;else _0x1074e0['push'](_0x1074e0['shift']());}catch(_0x4c0b5b){_0x1074e0['push'](_0x1074e0['shift']());}}}(a41_0x45b5,0xbf346));function a41_0x45b5(){const _0x510be1=['cwd','2366285JPvpmr','message','6061544jBxYuz','success','2Whbdgl','138uGcXZx','4683920NjXELG','info','安装依赖','9tsoLzT','142674xzeisu','error','依赖安装完成','now','57071wFWrdC','开始安装依赖','84790QViSVa','npm','https://registry.npmmirror.com','819633mdxIQl','install'];a41_0x45b5=function(){return _0x510be1;};return a41_0x45b5();}import a41_0x3a0de1 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a41_0x15c3(_0x465c06,_0x5bd30b){const _0x45b55e=a41_0x45b5();return a41_0x15c3=function(_0x15c3f1,_0x387df4){_0x15c3f1=_0x15c3f1-0xd9;let _0x3f5a7f=_0x45b55e[_0x15c3f1];return _0x3f5a7f;},a41_0x15c3(_0x465c06,_0x5bd30b);}export function useInstallDependencies(){const _0x1ecd07=a41_0x15c3,[_0x20bcc1,_0xb8892b]=useState(![]),[_0x2196a6,_0x481cb9]=useState(![]),[_0x25a6d5,_0x43e8e4]=useState(''),_0x317bf1=useCallback(async _0x435919=>{const _0x3219f3=a41_0x15c3,_0x43da6e=Date[_0x3219f3(0xe8)](),_0x4bf060=a41_0x3a0de1['resolve'](process[_0x3219f3(0xda)](),_0x435919);_0xb8892b(!![]),_0x481cb9(![]);const _0x3fdc08=async(_0x421073,_0x1434ef)=>{await execa(_0x421073,_0x1434ef,{'cwd':_0x4bf060});};try{logger[_0x3219f3(0xe2)](_0x3219f3(0xd9),_0x3219f3(0xea),{'projectCode':_0x435919,'registry':_0x3219f3(0xed)}),await _0x3fdc08(_0x3219f3(0xec),[_0x3219f3(0xd9),'--registry',_0x3219f3(0xed)]);const _0x4df681=Date[_0x3219f3(0xe8)]()-_0x43da6e;logger[_0x3219f3(0xde)](_0x3219f3(0xd9),_0x3219f3(0xe7),_0x4df681,{'projectCode':_0x435919});}catch(_0x28d9b3){const _0xba33d8=Date[_0x3219f3(0xe8)]()-_0x43da6e;logger[_0x3219f3(0xe6)](_0x3219f3(0xd9),'依赖安装失败',{'projectCode':_0x435919,'error':_0x28d9b3 instanceof Error?_0x28d9b3[_0x3219f3(0xdc)]:String(_0x28d9b3),'duration':_0xba33d8});throw _0x28d9b3;}finally{_0xb8892b(![]),_0x481cb9(!![]),_0x43e8e4(formatElapsed(_0x43da6e));}},[]);return{'taskName':_0x1ecd07(0xe3),'finished':_0x2196a6,'loading':_0x20bcc1,'elapsed':_0x25a6d5,'doTask':_0x317bf1};}
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};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x28ebce,_0x292c57){var _0x40481c=a42_0x166a,_0x28ec43=_0x28ebce();while(!![]){try{var _0xd6fd2d=parseInt(_0x40481c(0x13a))/0x1*(-parseInt(_0x40481c(0x145))/0x2)+-parseInt(_0x40481c(0x13d))/0x3+parseInt(_0x40481c(0x140))/0x4*(-parseInt(_0x40481c(0x146))/0x5)+-parseInt(_0x40481c(0x13e))/0x6*(-parseInt(_0x40481c(0x142))/0x7)+parseInt(_0x40481c(0x13b))/0x8*(-parseInt(_0x40481c(0x143))/0x9)+parseInt(_0x40481c(0x13c))/0xa+-parseInt(_0x40481c(0x141))/0xb*(-parseInt(_0x40481c(0x13f))/0xc);if(_0xd6fd2d===_0x292c57)break;else _0x28ec43['push'](_0x28ec43['shift']());}catch(_0x2463a9){_0x28ec43['push'](_0x28ec43['shift']());}}}(a42_0x4d99,0x2cf62));import{jsx as a42_0x402e1c,jsxs as a42_0x23b9c5}from'react/jsx-runtime';import{Box,Text}from'ink';function a42_0x4d99(){var _0xad4448=['9428124esvBOR','37300jPPZGo','11tJDHif','1475551zcocCX','81krMQrT','查看可用命令。','250NgNOYE','155LYrers','lovrabet\x20--help','!\x20请指定一个有效的命令。','1949ZgpBUK','239528zNIPin','181150HsxjaN','84762YorZNJ','6QCVMUR'];a42_0x4d99=function(){return _0xad4448;};return a42_0x4d99();}function a42_0x166a(_0x391c2d,_0x2aa8cb){var _0x4d9906=a42_0x4d99();return a42_0x166a=function(_0x166a50,_0x108793){_0x166a50=_0x166a50-0x139;var _0xedf03b=_0x4d9906[_0x166a50];return _0xedf03b;},a42_0x166a(_0x391c2d,_0x2aa8cb);}export function Help(){var _0x596576=a42_0x166a;return a42_0x23b9c5(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a42_0x23b9c5(Box,{'children':[a42_0x402e1c(Box,{'width':'1'}),a42_0x402e1c(Text,{'children':_0x596576(0x139)})]}),a42_0x23b9c5(Box,{'marginTop':0x1,'children':[a42_0x402e1c(Box,{'width':'1'}),a42_0x23b9c5(Text,{'children':['\x20\x20','使用']}),a42_0x23b9c5(Text,{'bold':!![],'color':'green','children':['\x20',_0x596576(0x147),'\x20']}),a42_0x402e1c(Text,{'children':_0x596576(0x144)})]})]});}
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':'查看可用命令。'})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1e3a0f,_0x3ad853){const _0x4f4aa3=a43_0x2413,_0x4aeadc=_0x1e3a0f();while(!![]){try{const _0x5d831c=-parseInt(_0x4f4aa3(0x9e))/0x1+parseInt(_0x4f4aa3(0x85))/0x2*(-parseInt(_0x4f4aa3(0xa8))/0x3)+parseInt(_0x4f4aa3(0xa7))/0x4+-parseInt(_0x4f4aa3(0x81))/0x5*(-parseInt(_0x4f4aa3(0x87))/0x6)+-parseInt(_0x4f4aa3(0x9a))/0x7*(parseInt(_0x4f4aa3(0x9d))/0x8)+-parseInt(_0x4f4aa3(0x9b))/0x9+-parseInt(_0x4f4aa3(0xac))/0xa*(-parseInt(_0x4f4aa3(0x96))/0xb);if(_0x5d831c===_0x3ad853)break;else _0x4aeadc['push'](_0x4aeadc['shift']());}catch(_0x2427b7){_0x4aeadc['push'](_0x4aeadc['shift']());}}}(a43_0x5bc5,0xb4b3d));import{jsxs as a43_0x5abd3d,jsx as a43_0x23cf56}from'react/jsx-runtime';import{useState,useEffect}from'react';function a43_0x2413(_0x4c633c,_0x247fdf){const _0x5bc56e=a43_0x5bc5();return a43_0x2413=function(_0x2413d3,_0x5d2e2b){_0x2413d3=_0x2413d3-0x80;let _0x2ecbb8=_0x5bc56e[_0x2413d3];return _0x2ecbb8;},a43_0x2413(_0x4c633c,_0x247fdf);}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:_0x18691c,env:_0x58696e}){const _0x3d80db=a43_0x2413,[_0x505d6a,_0x7fa292]=useState(null),[_0x1723a7,_0x83588d]=useState(![]),[_0x3fed88,_0x17d2c9]=useState(!_0x18691c),[_0x2549d3,_0x3949b5]=useState(''),[_0x13fc88,_0x87c9f]=useState(''),[_0x1be1ee,_0xeb4528]=useState(_0x18691c||''),[_0x4370e1]=useState(_0x58696e);function _0x1e5c97(_0x30fc76){const _0x1fdedf=a43_0x2413;if(_0x30fc76['length']===0x0)return{'valid':![],'message':''};if(_0x30fc76['length']>0x64)return{'valid':![],'message':_0x1fdedf(0xab)};const _0x312c50=/^[A-Za-z0-9_-]+$/;if(!_0x312c50['test'](_0x30fc76))return{'valid':![],'message':_0x1fdedf(0xa6)};return{'valid':!![]};}useInput((_0x1600df,_0x4f61cd)=>{const _0x30f6de=a43_0x2413;if(!_0x3fed88)return;if(_0x4f61cd[_0x30f6de(0x92)]){if(_0x13fc88||!_0x2549d3[_0x30f6de(0x9f)]()){_0x87c9f('应用代码不能为空');return;}const _0x78ee72=_0x2549d3[_0x30f6de(0x9f)](),{valid:_0x397476,message:_0x2fe8f0}=_0x1e5c97(_0x78ee72);if(!_0x397476){_0x87c9f(_0x2fe8f0||_0x30f6de(0x8e));return;}_0xeb4528(_0x78ee72),_0x17d2c9(![]);}else{if(_0x4f61cd['backspace']||_0x4f61cd[_0x30f6de(0x9c)])_0x3949b5(_0x17b154=>{const _0x19fd7b=_0x30f6de,_0x17873c=_0x17b154[_0x19fd7b(0x99)](0x0,-0x1);if(_0x17873c['length']===0x0)_0x87c9f('');else{const {valid:_0x3ceeea,message:_0x1fbc0c}=_0x1e5c97(_0x17873c);_0x87c9f(_0x3ceeea?'':_0x1fbc0c||'应用代码不合法');}return _0x17873c;});else _0x4f61cd[_0x30f6de(0x94)]&&_0x1600df==='c'?process[_0x30f6de(0xa9)](0x0):_0x3949b5(_0x6aeeee=>{const _0x38dabe=_0x30f6de,_0x2b97ff=_0x6aeeee+_0x1600df,{valid:_0x4adf21,message:_0x1c3039}=_0x1e5c97(_0x2b97ff);return _0x87c9f(_0x4adf21?'':_0x1c3039||_0x38dabe(0x8e)),_0x2b97ff;});}},{'isActive':_0x3fed88}),useEffect(()=>{const _0x23d586=a43_0x2413;if(!_0x1be1ee||_0x3fed88)return;const _0x31c386=resolve(process[_0x23d586(0x95)](),_0x23d586(0x8a));if(existsSync(_0x31c386)){_0x7fa292('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process['exit'](0x1),0x64);return;}try{const _0x43f0d9=fileURLToPath(import.meta[_0x23d586(0x8f)]),_0x1e34ee=resolve(dirname(_0x43f0d9),'../..'),_0x53317a=join(_0x1e34ee,_0x23d586(0x86));let _0x2d3d3c=_0x23d586(0xa1);try{const _0x203c3d=JSON['parse'](readFileSync(_0x53317a,_0x23d586(0x83)));_0x2d3d3c=_0x203c3d[_0x23d586(0xa3)]||_0x23d586(0xa1);}catch(_0x31b6dc){}const _0x25f2bb=readConfig(),_0x532482=typeof _0x25f2bb['env']===_0x23d586(0x97)?_0x25f2bb[_0x23d586(0x8b)]:undefined,{app:_0x2bad05,appcode:_0x1cb3bf,..._0x5313f8}=_0x25f2bb,_0x70c612={..._0x5313f8,'appcode':_0x1be1ee,'env':_0x4370e1||_0x532482||_0x23d586(0x93),'createdAt':new Date()[_0x23d586(0x80)](),'version':_0x2d3d3c};writeFileSync(_0x31c386,JSON[_0x23d586(0x8c)](_0x70c612,null,0x2),{'encoding':_0x23d586(0x83),'mode':0x180}),logger['setLogPath'](process[_0x23d586(0x95)]()),logger[_0x23d586(0xa5)](_0x23d586(0xaa),'初始化项目配置文件成功',{'appcode':_0x1be1ee,'env':_0x70c612[_0x23d586(0x8b)],'version':_0x70c612[_0x23d586(0xa3)],'configPath':_0x31c386}),_0x83588d(!![]),setTimeout(()=>process[_0x23d586(0xa9)](0x0),0x64);}catch(_0xa78a71){logger[_0x23d586(0x82)]('init',_0x23d586(0x84),{'error':_0xa78a71 instanceof Error?_0xa78a71[_0x23d586(0x8d)]:String(_0xa78a71)}),_0x7fa292(_0x23d586(0xa2)+(_0xa78a71 instanceof Error?_0xa78a71[_0x23d586(0x8d)]:String(_0xa78a71))),setTimeout(()=>process[_0x23d586(0xa9)](0x1),0x64);}},[_0x1be1ee,_0x3fed88,_0x4370e1]);if(_0x505d6a)return a43_0x23cf56(Box,{'flexDirection':_0x3d80db(0x90),'children':a43_0x5abd3d(Text,{'color':_0x3d80db(0x89),'children':['✗\x20',_0x505d6a]})});if(_0x3fed88)return a43_0x5abd3d(Box,{'flexDirection':_0x3d80db(0x90),'children':[a43_0x5abd3d(Box,{'children':[a43_0x23cf56(Text,{'color':_0x3d80db(0xa0),'children':'请输入应用代码\x20(AppCode):\x20'}),_0x2549d3?a43_0x23cf56(Text,{'color':_0x3d80db(0xa4),'children':_0x2549d3}):a43_0x23cf56(Text,{'color':_0x3d80db(0x91),'children':'_'}),_0x13fc88&&a43_0x5abd3d(Text,{'color':_0x3d80db(0x89),'children':['\x20←\x20',_0x13fc88]})]}),!_0x13fc88&&!_0x2549d3&&a43_0x23cf56(Box,{'children':a43_0x23cf56(Text,{'color':_0x3d80db(0x91),'children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x1723a7)return a43_0x5abd3d(Box,{'flexDirection':'column','children':[a43_0x23cf56(Text,{'color':_0x3d80db(0xa4),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a43_0x5abd3d(Text,{'color':_0x3d80db(0xa0),'children':['AppCode:\x20',_0x1be1ee]}),a43_0x23cf56(Text,{'children':_0x3d80db(0x98)})]});return a43_0x23cf56(Box,{'children':a43_0x23cf56(Text,{'children':_0x3d80db(0x88)})});}function a43_0x5bc5(){const _0x10a336=['cyan','1.0.0','创建配置文件失败:\x20','version','green','info','应用代码只能包含字母、数字、-\x20和\x20_','2191432VXQJYZ','156VORsDO','exit','init','应用代码长度不能超过\x20100\x20个字符','151590LzHyRl','toLocaleString','2105630dtPmjH','error','utf8','创建配置文件失败','10502aaiWJW','package.json','12QlORBX','正在初始化配置文件...','red','.lovrabetrc','env','stringify','message','应用代码不合法','url','column','gray','return','online','ctrl','cwd','1661sTYzcR','string','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','slice','136885vrZAgl','10360026tWoTpR','delete','64khoCHM','1358356ICrZIe','trim'];a43_0x5bc5=function(){return _0x10a336;};return a43_0x5bc5();}
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)})});}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- (function(_0x4448b3,_0x27b558){const _0x148259=a44_0x7751,_0x291762=_0x4448b3();while(!![]){try{const _0x2ea905=-parseInt(_0x148259(0x137))/0x1+-parseInt(_0x148259(0x126))/0x2+-parseInt(_0x148259(0x122))/0x3*(parseInt(_0x148259(0x11e))/0x4)+parseInt(_0x148259(0x13d))/0x5*(parseInt(_0x148259(0x121))/0x6)+-parseInt(_0x148259(0x120))/0x7*(parseInt(_0x148259(0x141))/0x8)+parseInt(_0x148259(0x136))/0x9*(parseInt(_0x148259(0x125))/0xa)+parseInt(_0x148259(0x127))/0xb*(parseInt(_0x148259(0x140))/0xc);if(_0x2ea905===_0x27b558)break;else _0x291762['push'](_0x291762['shift']());}catch(_0x853cf6){_0x291762['push'](_0x291762['shift']());}}}(a44_0x3cab,0x4f586));import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a44_0x7751(_0x545c36,_0x18d287){const _0x3cab1e=a44_0x3cab();return a44_0x7751=function(_0x775157,_0x25d490){_0x775157=_0x775157-0x114;let _0x27280b=_0x3cab1e[_0x775157];return _0x27280b;},a44_0x7751(_0x545c36,_0x18d287);}export async function configureCursorMcp(){const _0x24064f=a44_0x7751;try{const _0x4119f6=process[_0x24064f(0x13a)](),_0x45be58=resolve(_0x4119f6,'.cursor'),_0x5c93a2=resolve(_0x45be58,_0x24064f(0x139)),_0x1d7cc3=readConfig(),_0x18361b=_0x1d7cc3[_0x24064f(0x13f)]||_0x1d7cc3[_0x24064f(0x12c)],_0x3749b0=_0x1d7cc3[_0x24064f(0x13b)]||_0x24064f(0x133);if(!_0x18361b){console[_0x24064f(0x13e)](_0x24064f(0x134)),logger[_0x24064f(0x13e)](_0x24064f(0x11c),_0x24064f(0x116)),process[_0x24064f(0x114)](0x1);return;}!existsSync(_0x45be58)&&(mkdirSync(_0x45be58,{'recursive':!![]}),logger[_0x24064f(0x123)](_0x24064f(0x11c),_0x24064f(0x132),{'path':_0x45be58}),console[_0x24064f(0x12f)]('✓\x20创建\x20.cursor\x20目录:\x20'+_0x45be58));const _0x450c8b={'command':_0x24064f(0x115),'args':['-y','@lovrabet/dataset-mcp-server'],'env':{'LOVRABET_APP_CODE':String(_0x18361b),'LOVRABET_ENV':String(_0x3749b0)}};let _0x60dc3b;if(existsSync(_0x5c93a2))try{const _0x2c85da=readFileSync(_0x5c93a2,_0x24064f(0x142));_0x60dc3b=JSON[_0x24064f(0x11d)](_0x2c85da),!_0x60dc3b[_0x24064f(0x12e)]&&(_0x60dc3b['mcpServers']={}),_0x60dc3b[_0x24064f(0x12e)][_0x24064f(0x119)]=_0x450c8b,logger[_0x24064f(0x123)](_0x24064f(0x11c),'更新现有\x20mcp.json\x20配置',{'path':_0x5c93a2,'appcode':_0x18361b,'env':_0x3749b0}),console['log'](_0x24064f(0x124));}catch(_0x1a44ba){logger[_0x24064f(0x13e)](_0x24064f(0x11c),_0x24064f(0x12d),{'error':_0x1a44ba instanceof Error?_0x1a44ba['message']:String(_0x1a44ba)}),console[_0x24064f(0x13e)](_0x24064f(0x12b)+(_0x1a44ba instanceof Error?_0x1a44ba[_0x24064f(0x135)]:String(_0x1a44ba))),process[_0x24064f(0x114)](0x1);return;}else _0x60dc3b={'mcpServers':{'lovrabet-dataset':_0x450c8b}},logger[_0x24064f(0x123)](_0x24064f(0x11c),_0x24064f(0x11a),{'path':_0x5c93a2,'appcode':_0x18361b,'env':_0x3749b0}),console[_0x24064f(0x12f)](_0x24064f(0x11b));writeFileSync(_0x5c93a2,JSON[_0x24064f(0x130)](_0x60dc3b,null,0x2),{'encoding':_0x24064f(0x142)}),console[_0x24064f(0x12f)](_0x24064f(0x131)),console[_0x24064f(0x12f)](_0x24064f(0x13c)),console[_0x24064f(0x12f)](_0x24064f(0x138)+_0x18361b),console[_0x24064f(0x12f)](_0x24064f(0x129)+_0x3749b0),console[_0x24064f(0x12f)](_0x24064f(0x118)+_0x5c93a2),console[_0x24064f(0x12f)](_0x24064f(0x143)),console['log'](_0x24064f(0x12a)),logger[_0x24064f(0x123)](_0x24064f(0x11c),_0x24064f(0x117),{'appcode':_0x18361b,'env':_0x3749b0,'configPath':_0x5c93a2}),process['exit'](0x0);}catch(_0x2a60b5){logger[_0x24064f(0x13e)]('mcp-cursor',_0x24064f(0x128),{'error':_0x2a60b5 instanceof Error?_0x2a60b5[_0x24064f(0x135)]:String(_0x2a60b5)}),console['error'](_0x24064f(0x11f)+(_0x2a60b5 instanceof Error?_0x2a60b5[_0x24064f(0x135)]:String(_0x2a60b5))),process[_0x24064f(0x114)](0x1);}}function a44_0x3cab(){const _0x33c95f=['\x20\x20-\x20环境:\x20','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','错误:\x20解析现有\x20mcp.json\x20失败:\x20','app','解析现有\x20mcp.json\x20失败','mcpServers','log','stringify','\x0a✓\x20Cursor\x20MCP\x20配置成功!','创建\x20.cursor\x20目录','online','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','message','1658025HUbDXV','43803Iebhwu','\x20\x20-\x20AppCode:\x20','mcp.json','cwd','env','\x0a配置信息:','497440eUFOgn','error','appcode','4260mZBJtY','16oVPAZR','utf8','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','exit','npx','未找到\x20appcode\x20配置','配置\x20Cursor\x20MCP\x20成功','\x20\x20-\x20配置文件:\x20','lovrabet-dataset','创建新的\x20mcp.json\x20配置','✓\x20创建\x20mcp.json\x20配置文件','mcp-cursor','parse','3188qcCEbc','错误:\x20配置失败:\x20','1091195yVtlAc','30nVyFYo','6FUQoET','info','✓\x20更新\x20mcp.json\x20配置','10HMOIoX','797750nvobjP','12375SRNNDB','配置\x20Cursor\x20MCP\x20失败'];a44_0x3cab=function(){return _0x33c95f;};return a44_0x3cab();}
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();}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- function a45_0x729a(_0x325476,_0x1aa21c){var _0xc1bc7c=a45_0xc1bc();return a45_0x729a=function(_0x729ab1,_0x436b94){_0x729ab1=_0x729ab1-0x153;var _0x21e208=_0xc1bc7c[_0x729ab1];return _0x21e208;},a45_0x729a(_0x325476,_0x1aa21c);}function a45_0xc1bc(){var _0x2379be=['107133VhuLxz','22AetpNJ','\x0a使用方法:','1280930hdnvFj','cursor','log','error','5KDXpmr','51180PzyQFF','2862JozimC','5555552qXedfR','info','5468240vMGOJZ','不支持的\x20IDE\x20类型:\x20','mcp','\x0a当前支持的\x20IDE:','setLogPath','264087Rousan','exit','未指定\x20IDE\x20类型','\x0a示例:','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','错误:\x20不支持的\x20IDE\x20类型:\x20','执行配置\x20Cursor\x20MCP\x20命令','10371150xtxGaZ'];a45_0xc1bc=function(){return _0x2379be;};return a45_0xc1bc();}(function(_0x122676,_0x34c972){var _0x2c9bbc=a45_0x729a,_0x4cdd58=_0x122676();while(!![]){try{var _0x2359b6=-parseInt(_0x2c9bbc(0x15d))/0x1+-parseInt(_0x2c9bbc(0x15e))/0x2*(parseInt(_0x2c9bbc(0x155))/0x3)+parseInt(_0x2c9bbc(0x167))/0x4*(parseInt(_0x2c9bbc(0x164))/0x5)+parseInt(_0x2c9bbc(0x15c))/0x6+-parseInt(_0x2c9bbc(0x160))/0x7+parseInt(_0x2c9bbc(0x169))/0x8+parseInt(_0x2c9bbc(0x166))/0x9*(-parseInt(_0x2c9bbc(0x165))/0xa);if(_0x2359b6===_0x34c972)break;else _0x4cdd58['push'](_0x4cdd58['shift']());}catch(_0x77d144){_0x4cdd58['push'](_0x4cdd58['shift']());}}}(a45_0xc1bc,0xdf621));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x2fe748){var _0x273377=a45_0x729a;logger[_0x273377(0x154)](process['cwd']());if(!_0x2fe748){console[_0x273377(0x163)]('错误:\x20请指定\x20IDE\x20类型'),console['log'](_0x273377(0x15f)),console[_0x273377(0x162)](_0x273377(0x159)),console['log'](_0x273377(0x158)),console[_0x273377(0x162)]('\x20\x20lovrabet\x20mcp\x20cursor'),logger[_0x273377(0x163)](_0x273377(0x16b),_0x273377(0x157)),process[_0x273377(0x156)](0x1);return;}switch(_0x2fe748['toLowerCase']()){case _0x273377(0x161):logger[_0x273377(0x168)](_0x273377(0x16b),_0x273377(0x15b)),await configureCursorMcp();break;default:console['error'](_0x273377(0x15a)+_0x2fe748),console[_0x273377(0x162)](_0x273377(0x153)),console[_0x273377(0x162)]('\x20\x20-\x20cursor'),logger[_0x273377(0x163)](_0x273377(0x16b),_0x273377(0x16a)+_0x2fe748),process[_0x273377(0x156)](0x1);break;}}
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 +1 @@
1
- const a46_0x3fdbda=a46_0x5ed2;(function(_0x454d58,_0x37745c){const _0x20a22d=a46_0x5ed2,_0x488042=_0x454d58();while(!![]){try{const _0x4e6acb=parseInt(_0x20a22d(0xc0))/0x1*(parseInt(_0x20a22d(0xc3))/0x2)+-parseInt(_0x20a22d(0xb3))/0x3*(parseInt(_0x20a22d(0xbb))/0x4)+parseInt(_0x20a22d(0xc6))/0x5*(-parseInt(_0x20a22d(0xba))/0x6)+-parseInt(_0x20a22d(0xb4))/0x7*(-parseInt(_0x20a22d(0xbe))/0x8)+parseInt(_0x20a22d(0xb8))/0x9+parseInt(_0x20a22d(0xb5))/0xa*(parseInt(_0x20a22d(0xbd))/0xb)+-parseInt(_0x20a22d(0xc4))/0xc*(parseInt(_0x20a22d(0xc1))/0xd);if(_0x4e6acb===_0x37745c)break;else _0x488042['push'](_0x488042['shift']());}catch(_0x50fa77){_0x488042['push'](_0x488042['shift']());}}}(a46_0x4ce5,0xb4b2a));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a46_0x3fdbda(0xbf));export const globalConfigPath=resolve(homedir(),a46_0x3fdbda(0xbf));function a46_0x5ed2(_0x268989,_0x5f2828){const _0x4ce56c=a46_0x4ce5();return a46_0x5ed2=function(_0x5ed2b6,_0x522830){_0x5ed2b6=_0x5ed2b6-0xb3;let _0x23582d=_0x4ce56c[_0x5ed2b6];return _0x23582d;},a46_0x5ed2(_0x268989,_0x5f2828);}export function readConfig(){const _0x94e5ef=a46_0x3fdbda;let _0x1b5342={};try{if(existsSync(globalConfigPath)){const _0x23ccaa=readFileSync(globalConfigPath,{'encoding':_0x94e5ef(0xc5)});_0x23ccaa&&(_0x1b5342=JSON['parse'](_0x23ccaa));}}catch(_0xa0122e){}try{if(existsSync(projectConfigPath)){const _0x3c3ec=readFileSync(projectConfigPath,{'encoding':_0x94e5ef(0xc5)});if(_0x3c3ec){const _0x406206=JSON[_0x94e5ef(0xc2)](_0x3c3ec);_0x1b5342={..._0x1b5342,..._0x406206};}}}catch(_0x48c5ae){}return _0x1b5342;}export function getConfigAppCode(){const _0x6e5cd8=a46_0x3fdbda;let _0x19c0c1={},_0x43d1a5={};try{if(existsSync(globalConfigPath)){const _0x4db3f1=readFileSync(globalConfigPath,{'encoding':_0x6e5cd8(0xc5)});_0x4db3f1&&(_0x43d1a5=JSON['parse'](_0x4db3f1));}}catch(_0x7a1886){}try{if(existsSync(projectConfigPath)){const _0x60a6cf=readFileSync(projectConfigPath,{'encoding':_0x6e5cd8(0xc5)});_0x60a6cf&&(_0x19c0c1=JSON[_0x6e5cd8(0xc2)](_0x60a6cf));}}catch(_0x17abb4){}let _0x21b48d;if('appcode'in _0x19c0c1)_0x21b48d=_0x19c0c1[_0x6e5cd8(0xb6)];else{if(_0x6e5cd8(0xb9)in _0x19c0c1)_0x21b48d=_0x19c0c1['app'];else{if('appcode'in _0x43d1a5)_0x21b48d=_0x43d1a5['appcode'];else _0x6e5cd8(0xb9)in _0x43d1a5&&(_0x21b48d=_0x43d1a5[_0x6e5cd8(0xb9)]);}}if(typeof _0x21b48d!==_0x6e5cd8(0xb7)||_0x21b48d[_0x6e5cd8(0xbc)]()==='')return undefined;return _0x21b48d;}export function isInProject(){return existsSync(projectConfigPath);}function a46_0x4ce5(){const _0x114955=['99Belcou','656lUQfWB','.lovrabetrc','1asSdVX','1469VWWJmN','parse','1879602unFttC','192864UyUAKR','utf8','5cAqlSg','4710wRzzoG','6377qjxWNd','1254100QQDCCl','appcode','string','11183922NWqUEV','app','4647762XyrsOr','140rmwrRR','trim'];a46_0x4ce5=function(){return _0x114955;};return a46_0x4ce5();}
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 +1 @@
1
- (function(_0x517e73,_0x14a949){const _0x3553ad=a47_0x5c0e,_0x48a93f=_0x517e73();while(!![]){try{const _0xc1d047=-parseInt(_0x3553ad(0x148))/0x1+-parseInt(_0x3553ad(0x152))/0x2*(parseInt(_0x3553ad(0x145))/0x3)+-parseInt(_0x3553ad(0x14d))/0x4*(parseInt(_0x3553ad(0x14e))/0x5)+-parseInt(_0x3553ad(0x14a))/0x6*(parseInt(_0x3553ad(0x14c))/0x7)+parseInt(_0x3553ad(0x153))/0x8*(parseInt(_0x3553ad(0x154))/0x9)+parseInt(_0x3553ad(0x147))/0xa+parseInt(_0x3553ad(0x143))/0xb*(parseInt(_0x3553ad(0x150))/0xc);if(_0xc1d047===_0x14a949)break;else _0x48a93f['push'](_0x48a93f['shift']());}catch(_0x3bbad0){_0x48a93f['push'](_0x48a93f['shift']());}}}(a47_0x3811,0x70047));import a47_0xef0ef0 from'node:path';function a47_0x5c0e(_0x46695f,_0x218dfd){const _0x381106=a47_0x3811();return a47_0x5c0e=function(_0x5c0e2e,_0x197de0){_0x5c0e2e=_0x5c0e2e-0x143;let _0x2e4983=_0x381106[_0x5c0e2e];return _0x2e4983;},a47_0x5c0e(_0x46695f,_0x218dfd);}import a47_0x365bd9 from'node:fs';export async function copyDirectory(_0x2e6ee5,_0x387276){const _0x47b63a=a47_0x5c0e;try{const _0x223461=a47_0x365bd9[_0x47b63a(0x149)](_0x2e6ee5,{'withFileTypes':!![]});a47_0x365bd9['mkdirSync'](_0x387276,{'recursive':!![]});for(const _0x4ccaf6 of _0x223461){const _0x23bacb=a47_0xef0ef0[_0x47b63a(0x146)](_0x2e6ee5,_0x4ccaf6[_0x47b63a(0x14b)]),_0x1b8e04=a47_0xef0ef0['join'](_0x387276,_0x4ccaf6[_0x47b63a(0x14b)]);_0x4ccaf6[_0x47b63a(0x151)]()?await copyDirectory(_0x23bacb,_0x1b8e04):a47_0x365bd9[_0x47b63a(0x14f)](_0x23bacb,_0x1b8e04);}}catch(_0x12e8bd){console[_0x47b63a(0x144)]('复制目录时出错:',_0x12e8bd);}}function a47_0x3811(){const _0x446d98=['readdirSync','6oiyouv','name','4093369IKqsmz','7568ivkClB','1350CgGpCS','copyFileSync','3342996QshhdS','isDirectory','2aFnxir','120uDwlRz','72054zFhXMu','55xXciEt','error','139446wArdkp','join','6537420uXHMhs','565835zkLjzB'];a47_0x3811=function(){return _0x446d98;};return a47_0x3811();}
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 +1 @@
1
- (function(_0x45b8ae,_0x2d60d8){const _0x1a0fac=a48_0xb158,_0x1ff62d=_0x45b8ae();while(!![]){try{const _0x18a9de=-parseInt(_0x1a0fac(0xa5))/0x1*(parseInt(_0x1a0fac(0x9f))/0x2)+-parseInt(_0x1a0fac(0x8d))/0x3*(parseInt(_0x1a0fac(0xa3))/0x4)+-parseInt(_0x1a0fac(0x95))/0x5+parseInt(_0x1a0fac(0xa4))/0x6*(-parseInt(_0x1a0fac(0x84))/0x7)+parseInt(_0x1a0fac(0x85))/0x8+-parseInt(_0x1a0fac(0x96))/0x9*(parseInt(_0x1a0fac(0xa0))/0xa)+-parseInt(_0x1a0fac(0x91))/0xb*(-parseInt(_0x1a0fac(0x97))/0xc);if(_0x18a9de===_0x2d60d8)break;else _0x1ff62d['push'](_0x1ff62d['shift']());}catch(_0x50de36){_0x1ff62d['push'](_0x1ff62d['shift']());}}}(a48_0xe8f7,0x609aa));export async function httpRequest(_0x7e7570,_0xaf8c6a={}){const _0x218f19=a48_0xb158,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0xaf8c6a;let _0x4760dd=null;for(let _0x75769b=0x0;_0x75769b<=retries;_0x75769b++){try{const _0xadd018=new AbortController(),_0x2230e9=setTimeout(()=>_0xadd018[_0x218f19(0x9a)](),timeout),_0x115555=await fetch(_0x7e7570,{'headers':headers,'signal':_0xadd018[_0x218f19(0x93)]});clearTimeout(_0x2230e9);let _0x25e283;const _0x496d19=_0x115555[_0x218f19(0x89)][_0x218f19(0x99)]('content-type');return _0x496d19?.['includes'](_0x218f19(0xa2))?_0x25e283=await _0x115555[_0x218f19(0x9c)]():_0x25e283=await _0x115555['text'](),{'ok':_0x115555['ok'],'status':_0x115555[_0x218f19(0x9b)],'statusText':_0x115555[_0x218f19(0x8a)],'data':_0x25e283,'headers':_0x115555[_0x218f19(0x89)],'url':_0x115555['url'],'text':()=>_0x115555[_0x218f19(0x88)]()};}catch(_0x170739){_0x4760dd=_0x170739 instanceof Error?_0x170739:new Error(String(_0x170739));if(_0x75769b===retries)break;if(shouldRetry(_0x170739)){console[_0x218f19(0x8e)](_0x218f19(0x98)+retryDelay+_0x218f19(0x90)+(_0x75769b+0x1)+_0x218f19(0x86)),await sleep(retryDelay);continue;}else break;}}throw _0x4760dd||new Error(_0x218f19(0x92));}function shouldRetry(_0x559474){const _0x2f1e18=a48_0xb158;if(_0x559474 instanceof Error){if(_0x559474[_0x2f1e18(0x9d)]===_0x2f1e18(0x87))return![];if(_0x559474[_0x2f1e18(0x9d)]===_0x2f1e18(0x9e)&&_0x559474['message'][_0x2f1e18(0x8b)](_0x2f1e18(0x94)))return!![];if(_0x559474[_0x2f1e18(0x8c)][_0x2f1e18(0x8b)](_0x2f1e18(0xa1)))return!![];if(_0x559474[_0x2f1e18(0x8c)][_0x2f1e18(0x8b)](_0x2f1e18(0x8f)))return![];}return![];}function a48_0xe8f7(){const _0x370ead=['headers','statusText','includes','message','309qzqEUN','log','ENOTFOUND','ms\x20后进行第\x20','325765TCKdtU','Request\x20failed','signal','fetch','745285YFurxl','18MtcANh','876ZStPFC','*\x20请求失败,','get','abort','status','json','name','TypeError','17188FhyZmQ','1660970olQeKQ','ECONNRESET','application/json','1388YpULRv','359130hIlVoU','74PFNdOm','91GOpnHU','1318864piTWuf','\x20次重试...','AbortError','text'];a48_0xe8f7=function(){return _0x370ead;};return a48_0xe8f7();}function sleep(_0x13cb61){return new Promise(_0x3584b2=>setTimeout(_0x3584b2,_0x13cb61));}function a48_0xb158(_0x343883,_0x1f251a){const _0xe8f743=a48_0xe8f7();return a48_0xb158=function(_0xb1580b,_0x517e78){_0xb1580b=_0xb1580b-0x84;let _0x1cf5a3=_0xe8f743[_0xb1580b];return _0x1cf5a3;},a48_0xb158(_0x343883,_0x1f251a);}export function validateUrl(_0x3a6c08){try{return new URL(_0x3a6c08),!![];}catch{return![];}}
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![];}}