@lovrabet/cli 1.1.26-beta.9 → 1.1.26

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 (61) 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/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
  19. package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -1
  20. package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
  21. package/lib/app-menu-update-cdn/current-content.js +1 -0
  22. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -0
  23. package/lib/app-menu-update-cdn/main.js +1 -0
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/cursor.js +1 -1
  53. package/lib/mcp/main.js +1 -1
  54. package/lib/utils/config.js +1 -1
  55. package/lib/utils/copy-directory.js +1 -1
  56. package/lib/utils/http-client.js +1 -1
  57. package/lib/utils/logger.js +1 -1
  58. package/lib/utils/router-updater.js +1 -1
  59. package/lib/utils/sleep.js +1 -1
  60. package/lib/utils/template-replacer.js +1 -1
  61. package/package.json +1 -1
package/lib/init/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x109e9a,_0x219a7f){const _0x37ebea=a49_0x2d15,_0x4bc9f4=_0x109e9a();while(!![]){try{const _0x510fc9=parseInt(_0x37ebea(0x1cd))/0x1*(-parseInt(_0x37ebea(0x1c6))/0x2)+parseInt(_0x37ebea(0x1bc))/0x3+parseInt(_0x37ebea(0x1ba))/0x4*(-parseInt(_0x37ebea(0x1b8))/0x5)+parseInt(_0x37ebea(0x1a9))/0x6+parseInt(_0x37ebea(0x1bf))/0x7+-parseInt(_0x37ebea(0x1a4))/0x8+-parseInt(_0x37ebea(0x1a6))/0x9*(-parseInt(_0x37ebea(0x1ab))/0xa);if(_0x510fc9===_0x219a7f)break;else _0x4bc9f4['push'](_0x4bc9f4['shift']());}catch(_0x1fd7ee){_0x4bc9f4['push'](_0x4bc9f4['shift']());}}}(a49_0x5a48,0x39beb));import{jsxs as a49_0x5ed453,jsx as a49_0x44aeb5}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';function a49_0x2d15(_0x4dcea1,_0x18181c){const _0x5a4877=a49_0x5a48();return a49_0x2d15=function(_0x2d151b,_0x12ecbd){_0x2d151b=_0x2d151b-0x19f;let _0x58ed7f=_0x5a4877[_0x2d151b];return _0x58ed7f;},a49_0x2d15(_0x4dcea1,_0x18181c);}import{resolve,join,dirname}from'node:path';function a49_0x5a48(){const _0x9faf67=['trim','utf8','toLocaleString','column','正在初始化配置文件...','message','应用代码只能包含字母、数字、-\x20和\x20_','cwd','.lovrabetrc','return','../..','init','15SWoHPa','1.0.0','556164lWVyPn','parse','76296McYcKK','green','test','2713648lKQmKW','length','env','AppCode:\x20','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','\x20←\x20','应用代码不能为空','126878MhRUAn','gray','ctrl','red','请输入应用代码\x20(AppCode):\x20','cyan','应用代码不合法','5TzWlns','version','当前目录已存在\x20.lovrabetrc\x20文件','delete','exit','url','199704ENkaiw','应用代码长度不能超过\x20100\x20个字符','320391mQKesS','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','string','2641872GPNCZz','创建配置文件失败','40RiNsbm'];a49_0x5a48=function(){return _0x9faf67;};return a49_0x5a48();}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x3eca48,env:_0x193c78}){const _0x34d3a9=a49_0x2d15,[_0x20d9da,_0x39cd2]=useState(null),[_0x3c9785,_0x5dbc2a]=useState(![]),[_0x5770e2,_0xffd527]=useState(!_0x3eca48),[_0x3124b6,_0x107987]=useState(''),[_0xb0908b,_0x4daa3b]=useState(''),[_0x1a5684,_0xd10440]=useState(_0x3eca48||''),[_0x247cd8]=useState(_0x193c78);function _0x4a5c50(_0x4d38fd){const _0x160ecb=a49_0x2d15;if(_0x4d38fd[_0x160ecb(0x1c0)]===0x0)return{'valid':![],'message':''};if(_0x4d38fd[_0x160ecb(0x1c0)]>0x64)return{'valid':![],'message':_0x160ecb(0x1a5)};const _0x4be6b4=/^[A-Za-z0-9_-]+$/;if(!_0x4be6b4[_0x160ecb(0x1be)](_0x4d38fd))return{'valid':![],'message':_0x160ecb(0x1b2)};return{'valid':!![]};}useInput((_0x58222f,_0x53ea4f)=>{const _0xe1c6d7=a49_0x2d15;if(!_0x5770e2)return;if(_0x53ea4f[_0xe1c6d7(0x1b5)]){if(_0xb0908b||!_0x3124b6[_0xe1c6d7(0x1ac)]()){_0x4daa3b(_0xe1c6d7(0x1c5));return;}const _0xbd61ba=_0x3124b6['trim'](),{valid:_0x1e9c3f,message:_0x4f0977}=_0x4a5c50(_0xbd61ba);if(!_0x1e9c3f){_0x4daa3b(_0x4f0977||_0xe1c6d7(0x1cc));return;}_0xd10440(_0xbd61ba),_0xffd527(![]);}else{if(_0x53ea4f['backspace']||_0x53ea4f[_0xe1c6d7(0x1a1)])_0x107987(_0x4f20d7=>{const _0x37ba2d=_0xe1c6d7,_0x24a65a=_0x4f20d7['slice'](0x0,-0x1);if(_0x24a65a[_0x37ba2d(0x1c0)]===0x0)_0x4daa3b('');else{const {valid:_0x3238ac,message:_0xfb477f}=_0x4a5c50(_0x24a65a);_0x4daa3b(_0x3238ac?'':_0xfb477f||_0x37ba2d(0x1cc));}return _0x24a65a;});else _0x53ea4f[_0xe1c6d7(0x1c8)]&&_0x58222f==='c'?process['exit'](0x0):_0x107987(_0x16356a=>{const _0x589ff2=_0xe1c6d7,_0x25dbe3=_0x16356a+_0x58222f,{valid:_0x3fdec4,message:_0x4491eb}=_0x4a5c50(_0x25dbe3);return _0x4daa3b(_0x3fdec4?'':_0x4491eb||_0x589ff2(0x1cc)),_0x25dbe3;});}},{'isActive':_0x5770e2}),useEffect(()=>{const _0x5db40d=a49_0x2d15;if(!_0x1a5684||_0x5770e2)return;const _0x26d8ed=resolve(process[_0x5db40d(0x1b3)](),_0x5db40d(0x1b4));if(existsSync(_0x26d8ed)){_0x39cd2(_0x5db40d(0x1a0)),setTimeout(()=>process[_0x5db40d(0x1a2)](0x1),0x64);return;}try{const _0xf6e752=fileURLToPath(import.meta[_0x5db40d(0x1a3)]),_0xf41a17=resolve(dirname(_0xf6e752),_0x5db40d(0x1b6)),_0x167e7f=join(_0xf41a17,'package.json');let _0x5b12b7=_0x5db40d(0x1b9);try{const _0x4a7803=JSON[_0x5db40d(0x1bb)](readFileSync(_0x167e7f,'utf8'));_0x5b12b7=_0x4a7803[_0x5db40d(0x19f)]||'1.0.0';}catch(_0x43aa23){}const _0x1cd17e=readConfig(),_0x5ea81c=typeof _0x1cd17e['env']===_0x5db40d(0x1a8)?_0x1cd17e[_0x5db40d(0x1c1)]:undefined,{app:_0x536806,appcode:_0x170e13,..._0x330ff8}=_0x1cd17e,_0x1c772d={..._0x330ff8,'appcode':_0x1a5684,'env':_0x247cd8||_0x5ea81c||'online','createdAt':new Date()[_0x5db40d(0x1ae)](),'version':_0x5b12b7};writeFileSync(_0x26d8ed,JSON['stringify'](_0x1c772d,null,0x2),{'encoding':_0x5db40d(0x1ad),'mode':0x180}),logger['setLogPath'](process[_0x5db40d(0x1b3)]()),logger['info'](_0x5db40d(0x1b7),'初始化项目配置文件成功',{'appcode':_0x1a5684,'env':_0x1c772d[_0x5db40d(0x1c1)],'version':_0x1c772d['version'],'configPath':_0x26d8ed}),_0x5dbc2a(!![]),setTimeout(()=>process[_0x5db40d(0x1a2)](0x0),0x64);}catch(_0x2e8023){logger['error'](_0x5db40d(0x1b7),_0x5db40d(0x1aa),{'error':_0x2e8023 instanceof Error?_0x2e8023[_0x5db40d(0x1b1)]:String(_0x2e8023)}),_0x39cd2('创建配置文件失败:\x20'+(_0x2e8023 instanceof Error?_0x2e8023[_0x5db40d(0x1b1)]:String(_0x2e8023))),setTimeout(()=>process[_0x5db40d(0x1a2)](0x1),0x64);}},[_0x1a5684,_0x5770e2,_0x247cd8]);if(_0x20d9da)return a49_0x44aeb5(Box,{'flexDirection':'column','children':a49_0x5ed453(Text,{'color':_0x34d3a9(0x1c9),'children':['✗\x20',_0x20d9da]})});if(_0x5770e2)return a49_0x5ed453(Box,{'flexDirection':'column','children':[a49_0x5ed453(Box,{'children':[a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1cb),'children':_0x34d3a9(0x1ca)}),_0x3124b6?a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1bd),'children':_0x3124b6}):a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1c7),'children':'_'}),_0xb0908b&&a49_0x5ed453(Text,{'color':_0x34d3a9(0x1c9),'children':[_0x34d3a9(0x1c4),_0xb0908b]})]}),!_0xb0908b&&!_0x3124b6&&a49_0x44aeb5(Box,{'children':a49_0x44aeb5(Text,{'color':'gray','children':_0x34d3a9(0x1a7)})})]});if(_0x3c9785)return a49_0x5ed453(Box,{'flexDirection':_0x34d3a9(0x1af),'children':[a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1bd),'children':_0x34d3a9(0x1c3)}),a49_0x5ed453(Text,{'color':_0x34d3a9(0x1cb),'children':[_0x34d3a9(0x1c2),_0x1a5684]}),a49_0x44aeb5(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a49_0x44aeb5(Box,{'children':a49_0x44aeb5(Text,{'children':_0x34d3a9(0x1b0)})});}
1
+ (function(_0x1bd822,_0x2717eb){const _0x544a77=a52_0x1ce1,_0x6b040a=_0x1bd822();while(!![]){try{const _0x2f8a2a=-parseInt(_0x544a77(0x1cc))/0x1*(parseInt(_0x544a77(0x1d1))/0x2)+-parseInt(_0x544a77(0x1c9))/0x3+parseInt(_0x544a77(0x1b9))/0x4+parseInt(_0x544a77(0x1d4))/0x5*(-parseInt(_0x544a77(0x1b7))/0x6)+parseInt(_0x544a77(0x1b6))/0x7*(-parseInt(_0x544a77(0x1e0))/0x8)+parseInt(_0x544a77(0x1bb))/0x9+parseInt(_0x544a77(0x1bd))/0xa*(parseInt(_0x544a77(0x1d6))/0xb);if(_0x2f8a2a===_0x2717eb)break;else _0x6b040a['push'](_0x6b040a['shift']());}catch(_0x32be5b){_0x6b040a['push'](_0x6b040a['shift']());}}}(a52_0x24cf,0x684ae));import{jsxs as a52_0x576fae,jsx as a52_0x5c3efd}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a52_0x1ce1(_0x4c2c14,_0x2ceca3){_0x4c2c14=_0x4c2c14-0x1b6;const _0x24cfd8=a52_0x24cf();let _0x1ce1c5=_0x24cfd8[_0x4c2c14];return _0x1ce1c5;}function a52_0x24cf(){const _0xe8ad9c=['stringify','length','当前目录已存在\x20.lovrabetrc\x20文件','version','cyan','393747cotsOf','应用代码不合法','gray','7tcQxIQ','backspace','.lovrabetrc','toLocaleString','test','61158AKpmIl','创建配置文件失败:\x20','green','327885IZJpxK','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','110JQIlEY','../..','delete','utf8','应用代码长度不能超过\x20100\x20个字符','red','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','string','请输入应用代码\x20(AppCode):\x20','\x20←\x20','8fUxpOp','env','创建配置文件失败','init','return','初始化项目配置文件成功','4196325OYLpWr','24wJxrBZ','message','3149000rjaMyL','应用代码只能包含字母、数字、-\x20和\x20_','3763863bxYJzn','应用代码不能为空','428810tnNrwJ','setLogPath','trim','exit','column','slice','online'];a52_0x24cf=function(){return _0xe8ad9c;};return a52_0x24cf();}export function Init({appcode:_0x48f0c1,env:_0x238b7d}){const _0x46f2de=a52_0x1ce1,[_0x511fc7,_0x43dbc1]=useState(null),[_0x2fd988,_0x351930]=useState(![]),[_0x395db1,_0x4940d1]=useState(!_0x48f0c1),[_0x372fef,_0x533ad4]=useState(''),[_0x2fc943,_0x41fcee]=useState(''),[_0x196492,_0x2b66c3]=useState(_0x48f0c1||''),[_0x1c67e1]=useState(_0x238b7d);function _0x53372b(_0x377ac5){const _0x3c6f6a=a52_0x1ce1;if(_0x377ac5[_0x3c6f6a(0x1c5)]===0x0)return{'valid':![],'message':''};if(_0x377ac5[_0x3c6f6a(0x1c5)]>0x64)return{'valid':![],'message':_0x3c6f6a(0x1da)};const _0x1889a4=/^[A-Za-z0-9_-]+$/;if(!_0x1889a4[_0x3c6f6a(0x1d0)](_0x377ac5))return{'valid':![],'message':_0x3c6f6a(0x1ba)};return{'valid':!![]};}useInput((_0x425ea2,_0x8aab5a)=>{const _0x46be7c=a52_0x1ce1;if(!_0x395db1)return;if(_0x8aab5a[_0x46be7c(0x1e4)]){if(_0x2fc943||!_0x372fef['trim']()){_0x41fcee(_0x46be7c(0x1bc));return;}const _0x1ef932=_0x372fef[_0x46be7c(0x1bf)](),{valid:_0x599f60,message:_0x175421}=_0x53372b(_0x1ef932);if(!_0x599f60){_0x41fcee(_0x175421||_0x46be7c(0x1ca));return;}_0x2b66c3(_0x1ef932),_0x4940d1(![]);}else{if(_0x8aab5a[_0x46be7c(0x1cd)]||_0x8aab5a[_0x46be7c(0x1d8)])_0x533ad4(_0x287ea0=>{const _0xd1e212=_0x46be7c,_0x2d203d=_0x287ea0[_0xd1e212(0x1c2)](0x0,-0x1);if(_0x2d203d[_0xd1e212(0x1c5)]===0x0)_0x41fcee('');else{const {valid:_0x5b2634,message:_0x20bcd2}=_0x53372b(_0x2d203d);_0x41fcee(_0x5b2634?'':_0x20bcd2||_0xd1e212(0x1ca));}return _0x2d203d;});else _0x8aab5a['ctrl']&&_0x425ea2==='c'?process[_0x46be7c(0x1c0)](0x0):_0x533ad4(_0x27d29f=>{const _0x12b239=_0x46be7c,_0x29a0f7=_0x27d29f+_0x425ea2,{valid:_0x25a63b,message:_0x5b7f2d}=_0x53372b(_0x29a0f7);return _0x41fcee(_0x25a63b?'':_0x5b7f2d||_0x12b239(0x1ca)),_0x29a0f7;});}},{'isActive':_0x395db1}),useEffect(()=>{const _0x15e916=a52_0x1ce1;if(!_0x196492||_0x395db1)return;const _0x3af9d5=resolve(process['cwd'](),_0x15e916(0x1ce));if(existsSync(_0x3af9d5)){_0x43dbc1(_0x15e916(0x1c6)),setTimeout(()=>process['exit'](0x1),0x64);return;}try{const _0x2c9865=fileURLToPath(import.meta.url),_0x91f2da=resolve(dirname(_0x2c9865),_0x15e916(0x1d7)),_0x18a6be=join(_0x91f2da,'package.json');let _0x298bbf='1.0.0';try{const _0xb25836=JSON['parse'](readFileSync(_0x18a6be,_0x15e916(0x1d9)));_0x298bbf=_0xb25836[_0x15e916(0x1c7)]||'1.0.0';}catch(_0x3be608){}const _0x56ecb9=readConfig(),_0x3703f5=typeof _0x56ecb9[_0x15e916(0x1e1)]===_0x15e916(0x1dd)?_0x56ecb9[_0x15e916(0x1e1)]:undefined,{app:_0x13d9c9,appcode:_0x2001bb,..._0x3edeb0}=_0x56ecb9,_0x428b59={..._0x3edeb0,'appcode':_0x196492,'env':_0x1c67e1||_0x3703f5||_0x15e916(0x1c3),'createdAt':new Date()[_0x15e916(0x1cf)](),'version':_0x298bbf};writeFileSync(_0x3af9d5,JSON[_0x15e916(0x1c4)](_0x428b59,null,0x2),{'encoding':_0x15e916(0x1d9),'mode':0x180}),logger[_0x15e916(0x1be)](process['cwd']()),logger['info'](_0x15e916(0x1e3),_0x15e916(0x1e5),{'appcode':_0x196492,'env':_0x428b59[_0x15e916(0x1e1)],'version':_0x428b59['version'],'configPath':_0x3af9d5}),_0x351930(!![]),setTimeout(()=>process[_0x15e916(0x1c0)](0x0),0x64);}catch(_0x1f1706){logger['error'](_0x15e916(0x1e3),_0x15e916(0x1e2),{'error':_0x1f1706 instanceof Error?_0x1f1706[_0x15e916(0x1b8)]:String(_0x1f1706)}),_0x43dbc1(_0x15e916(0x1d2)+(_0x1f1706 instanceof Error?_0x1f1706[_0x15e916(0x1b8)]:String(_0x1f1706))),setTimeout(()=>process[_0x15e916(0x1c0)](0x1),0x64);}},[_0x196492,_0x395db1,_0x1c67e1]);if(_0x511fc7)return a52_0x5c3efd(Box,{'flexDirection':_0x46f2de(0x1c1),'children':a52_0x576fae(Text,{'color':_0x46f2de(0x1db),'children':['✗\x20',_0x511fc7]})});if(_0x395db1)return a52_0x576fae(Box,{'flexDirection':_0x46f2de(0x1c1),'children':[a52_0x576fae(Box,{'children':[a52_0x5c3efd(Text,{'color':_0x46f2de(0x1c8),'children':_0x46f2de(0x1de)}),_0x372fef?a52_0x5c3efd(Text,{'color':_0x46f2de(0x1d3),'children':_0x372fef}):a52_0x5c3efd(Text,{'color':_0x46f2de(0x1cb),'children':'_'}),_0x2fc943&&a52_0x576fae(Text,{'color':_0x46f2de(0x1db),'children':[_0x46f2de(0x1df),_0x2fc943]})]}),!_0x2fc943&&!_0x372fef&&a52_0x5c3efd(Box,{'children':a52_0x5c3efd(Text,{'color':_0x46f2de(0x1cb),'children':_0x46f2de(0x1dc)})})]});if(_0x2fd988)return a52_0x576fae(Box,{'flexDirection':_0x46f2de(0x1c1),'children':[a52_0x5c3efd(Text,{'color':_0x46f2de(0x1d3),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a52_0x576fae(Text,{'color':_0x46f2de(0x1c8),'children':['AppCode:\x20',_0x196492]}),a52_0x5c3efd(Text,{'children':_0x46f2de(0x1d5)})]});return a52_0x5c3efd(Box,{'children':a52_0x5c3efd(Text,{'children':'正在初始化配置文件...'})});}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- (function(_0x45d277,_0x12a1a8){const _0x1598e8=a50_0x5ba7,_0x32163c=_0x45d277();while(!![]){try{const _0x170079=-parseInt(_0x1598e8(0x97))/0x1+-parseInt(_0x1598e8(0x9e))/0x2*(parseInt(_0x1598e8(0x84))/0x3)+-parseInt(_0x1598e8(0x7a))/0x4*(-parseInt(_0x1598e8(0x9a))/0x5)+parseInt(_0x1598e8(0x9d))/0x6*(parseInt(_0x1598e8(0x90))/0x7)+parseInt(_0x1598e8(0xa1))/0x8*(-parseInt(_0x1598e8(0x73))/0x9)+-parseInt(_0x1598e8(0x8e))/0xa+parseInt(_0x1598e8(0x7d))/0xb;if(_0x170079===_0x12a1a8)break;else _0x32163c['push'](_0x32163c['shift']());}catch(_0x367fef){_0x32163c['push'](_0x32163c['shift']());}}}(a50_0x456f,0x64588));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';function a50_0x5ba7(_0x34ff9f,_0x281f70){const _0x456f36=a50_0x456f();return a50_0x5ba7=function(_0x5ba7d7,_0x5d0979){_0x5ba7d7=_0x5ba7d7-0x72;let _0xc67d4=_0x456f36[_0x5ba7d7];return _0xc67d4;},a50_0x5ba7(_0x34ff9f,_0x281f70);}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a50_0x456f(){const _0x33f5b5=['npx','utf8','9pPEGKk','message','lovrabet-dataset','✓\x20创建\x20mcp.json\x20配置文件','../../templates/rules/lovrabet_rules.mdc.tpl','info','parse','4ktqrnu','error','warn','4427434JjyHZX','未找到\x20appcode\x20配置','解析现有\x20mcp.json\x20失败','配置\x20Cursor\x20MCP\x20失败','复制\x20Cursor\x20Rules\x20文件','mcp-cursor','创建\x20.cursor/rules\x20目录','21lMlfbY','复制\x20Cursor\x20Rules\x20文件失败','配置\x20Cursor\x20MCP\x20成功','✓\x20更新\x20mcp.json\x20配置','\x0a✓\x20Cursor\x20MCP\x20配置成功!','url','appcode','env','mcp.json','错误:\x20配置失败:\x20','2578030GJcBLF','rules','154lPZcsY','\x20\x20-\x20AppCode:\x20','cwd','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','创建\x20.cursor\x20目录','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','157920jVFtNl','✓\x20创建\x20.cursor\x20目录:\x20','online','1644795itVJDM','.cursor','log','196446KXONBf','150954JhvxYG','lovrabet_rules.mdc','\x0a配置信息:','773416uOUPhH','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','exit','mcpServers'];a50_0x456f=function(){return _0x33f5b5;};return a50_0x456f();}import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x41d4fe=a50_0x5ba7;try{const _0x296c70=process[_0x41d4fe(0x92)](),_0xc94bb5=resolve(_0x296c70,_0x41d4fe(0x9b)),_0x4ac284=resolve(_0xc94bb5,_0x41d4fe(0x8c)),_0x3cf17e=readConfig(),_0x1e7e4b=_0x3cf17e[_0x41d4fe(0x8a)]||_0x3cf17e['app'],_0x439480=_0x3cf17e[_0x41d4fe(0x8b)]||_0x41d4fe(0x99);!_0x1e7e4b&&(console['error']('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x41d4fe(0x7b)](_0x41d4fe(0x82),_0x41d4fe(0x7e)),process['exit'](0x1));!existsSync(_0xc94bb5)&&(mkdirSync(_0xc94bb5,{'recursive':!![]}),logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),_0x41d4fe(0x95),{'path':_0xc94bb5}),console['log'](_0x41d4fe(0x98)+_0xc94bb5));const _0xfa794c={'command':_0x41d4fe(0xa5),'args':['-y','@lovrabet/dataset-mcp-server'],'env':{'LOVRABET_APP_CODE':String(_0x1e7e4b),'LOVRABET_ENV':String(_0x439480)}};let _0xd8fa7c;if(existsSync(_0x4ac284))try{const _0x640df7=readFileSync(_0x4ac284,_0x41d4fe(0x72));_0xd8fa7c=JSON[_0x41d4fe(0x79)](_0x640df7),!_0xd8fa7c[_0x41d4fe(0xa4)]&&(_0xd8fa7c[_0x41d4fe(0xa4)]={}),_0xd8fa7c['mcpServers'][_0x41d4fe(0x75)]=_0xfa794c,logger[_0x41d4fe(0x78)]('mcp-cursor','更新现有\x20mcp.json\x20配置',{'path':_0x4ac284,'appcode':_0x1e7e4b,'env':_0x439480}),console['log'](_0x41d4fe(0x87));}catch(_0x248522){logger[_0x41d4fe(0x7b)]('mcp-cursor',_0x41d4fe(0x7f),{'error':_0x248522 instanceof Error?_0x248522['message']:String(_0x248522)}),console[_0x41d4fe(0x7b)]('错误:\x20解析现有\x20mcp.json\x20失败:\x20'+(_0x248522 instanceof Error?_0x248522['message']:String(_0x248522))),process[_0x41d4fe(0xa3)](0x1);}else _0xd8fa7c={'mcpServers':{'lovrabet-dataset':_0xfa794c}},logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),'创建新的\x20mcp.json\x20配置',{'path':_0x4ac284,'appcode':_0x1e7e4b,'env':_0x439480}),console[_0x41d4fe(0x9c)](_0x41d4fe(0x76));writeFileSync(_0x4ac284,JSON['stringify'](_0xd8fa7c,null,0x2),{'encoding':'utf8'});const _0x1f7750=resolve(_0xc94bb5,_0x41d4fe(0x8f)),_0x38d606=resolve(_0x1f7750,_0x41d4fe(0x9f));if(!existsSync(_0x38d606))try{!existsSync(_0x1f7750)&&(mkdirSync(_0x1f7750,{'recursive':!![]}),logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),_0x41d4fe(0x83),{'path':_0x1f7750}));const _0xbccd02=fileURLToPath(import.meta[_0x41d4fe(0x89)]),_0x1e81cb=dirname(_0xbccd02),_0x1decac=resolve(_0x1e81cb,_0x41d4fe(0x77));existsSync(_0x1decac)?(copyFileSync(_0x1decac,_0x38d606),logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),_0x41d4fe(0x81),{'from':_0x1decac,'to':_0x38d606}),console['log'](_0x41d4fe(0x94))):logger[_0x41d4fe(0x7c)](_0x41d4fe(0x82),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x1decac});}catch(_0x4d09d5){logger[_0x41d4fe(0x7b)](_0x41d4fe(0x82),_0x41d4fe(0x85),{'error':_0x4d09d5 instanceof Error?_0x4d09d5[_0x41d4fe(0x74)]:String(_0x4d09d5)}),console[_0x41d4fe(0x7c)]('警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20'+(_0x4d09d5 instanceof Error?_0x4d09d5[_0x41d4fe(0x74)]:String(_0x4d09d5)));}else console[_0x41d4fe(0x9c)](_0x41d4fe(0x96)),logger[_0x41d4fe(0x78)]('mcp-cursor','Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x38d606});console[_0x41d4fe(0x9c)](_0x41d4fe(0x88)),console[_0x41d4fe(0x9c)](_0x41d4fe(0xa0)),console[_0x41d4fe(0x9c)](_0x41d4fe(0x91)+_0x1e7e4b),console[_0x41d4fe(0x9c)]('\x20\x20-\x20环境:\x20'+_0x439480),console[_0x41d4fe(0x9c)]('\x20\x20-\x20配置文件:\x20'+_0x4ac284),console[_0x41d4fe(0x9c)](_0x41d4fe(0x93)),console[_0x41d4fe(0x9c)](_0x41d4fe(0xa2)),logger[_0x41d4fe(0x78)]('mcp-cursor',_0x41d4fe(0x86),{'appcode':_0x1e7e4b,'env':_0x439480,'configPath':_0x4ac284}),process['exit'](0x0);}catch(_0x8f3d3c){logger[_0x41d4fe(0x7b)](_0x41d4fe(0x82),_0x41d4fe(0x80),{'error':_0x8f3d3c instanceof Error?_0x8f3d3c[_0x41d4fe(0x74)]:String(_0x8f3d3c)}),console[_0x41d4fe(0x7b)](_0x41d4fe(0x8d)+(_0x8f3d3c instanceof Error?_0x8f3d3c['message']:String(_0x8f3d3c))),process[_0x41d4fe(0xa3)](0x1);}}
1
+ (function(_0x5298e4,_0x1742d2){const _0x3f57ab=a53_0x35a8,_0x3f8755=_0x5298e4();while(!![]){try{const _0x5c71b5=-parseInt(_0x3f57ab(0x15e))/0x1*(-parseInt(_0x3f57ab(0x16f))/0x2)+-parseInt(_0x3f57ab(0x16d))/0x3+parseInt(_0x3f57ab(0x173))/0x4+-parseInt(_0x3f57ab(0x18a))/0x5*(parseInt(_0x3f57ab(0x16c))/0x6)+parseInt(_0x3f57ab(0x184))/0x7*(parseInt(_0x3f57ab(0x158))/0x8)+parseInt(_0x3f57ab(0x16b))/0x9+-parseInt(_0x3f57ab(0x161))/0xa;if(_0x5c71b5===_0x1742d2)break;else _0x3f8755['push'](_0x3f8755['shift']());}catch(_0x1f68c6){_0x3f8755['push'](_0x3f8755['shift']());}}}(a53_0x3166,0xa6e6a));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';function a53_0x35a8(_0x29a6d6,_0x3fb2bb){_0x29a6d6=_0x29a6d6-0x156;const _0x316624=a53_0x3166();let _0x35a811=_0x316624[_0x29a6d6];return _0x35a811;}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a53_0x3166(){const _0x4df10e=['创建\x20.cursor/rules\x20目录','错误:\x20解析现有\x20mcp.json\x20失败:\x20','4993312tBkIyR','env','lovrabet-dataset','.cursor','npx','复制\x20Cursor\x20Rules\x20文件失败','warn','创建\x20.cursor\x20目录','rules','更新现有\x20mcp.json\x20配置','stringify','✓\x20创建\x20.cursor\x20目录:\x20','mcp-cursor','创建新的\x20mcp.json\x20配置','utf8','appcode','未找到\x20appcode\x20配置','133ccGbXn','parse','✓\x20更新\x20mcp.json\x20配置','exit','\x20\x20-\x20配置文件:\x20','@lovrabet/dataset-mcp-server','709015urmKeT','\x20\x20-\x20环境:\x20','online','配置\x20Cursor\x20MCP\x20成功','555400yoFHWu','mcp.json','\x20\x20-\x20AppCode:\x20','message','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','17pjIcqH','log','info','17972590fdBrKJ','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','lovrabet_rules.mdc','../../templates/rules/lovrabet_rules.mdc.tpl','Cursor\x20Rules\x20模板文件不存在','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','Cursor\x20Rules\x20文件已存在,跳过','app','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','mcpServers','10425780KLzJYE','42WIxqYu','2945667ZRkfug','error','85832ERkiVL','\x0a✓\x20Cursor\x20MCP\x20配置成功!'];a53_0x3166=function(){return _0x4df10e;};return a53_0x3166();}export async function configureCursorMcp(){const _0x3473b1=a53_0x35a8;try{const _0x47092e=process['cwd'](),_0x10fb3b=resolve(_0x47092e,_0x3473b1(0x176)),_0x5a4afc=resolve(_0x10fb3b,_0x3473b1(0x159)),_0x5a8c0e=readConfig(),_0x2a3a4c=_0x5a8c0e[_0x3473b1(0x182)]||_0x5a8c0e[_0x3473b1(0x168)],_0x3aa184=_0x5a8c0e[_0x3473b1(0x174)]||_0x3473b1(0x156);!_0x2a3a4c&&(console[_0x3473b1(0x16e)](_0x3473b1(0x15d)),logger[_0x3473b1(0x16e)](_0x3473b1(0x17f),_0x3473b1(0x183)),process[_0x3473b1(0x187)](0x1));!existsSync(_0x10fb3b)&&(mkdirSync(_0x10fb3b,{'recursive':!![]}),logger[_0x3473b1(0x160)](_0x3473b1(0x17f),_0x3473b1(0x17a),{'path':_0x10fb3b}),console[_0x3473b1(0x15f)](_0x3473b1(0x17e)+_0x10fb3b));const _0x345c40={'command':_0x3473b1(0x177),'args':['-y',_0x3473b1(0x189)],'env':{'LOVRABET_APP_CODE':String(_0x2a3a4c),'LOVRABET_ENV':String(_0x3aa184)}};let _0x2e90eb;if(existsSync(_0x5a4afc))try{const _0x1a2627=readFileSync(_0x5a4afc,_0x3473b1(0x181));_0x2e90eb=JSON[_0x3473b1(0x185)](_0x1a2627),!_0x2e90eb[_0x3473b1(0x16a)]&&(_0x2e90eb[_0x3473b1(0x16a)]={}),_0x2e90eb[_0x3473b1(0x16a)][_0x3473b1(0x175)]=_0x345c40,logger[_0x3473b1(0x160)](_0x3473b1(0x17f),_0x3473b1(0x17c),{'path':_0x5a4afc,'appcode':_0x2a3a4c,'env':_0x3aa184}),console[_0x3473b1(0x15f)](_0x3473b1(0x186));}catch(_0xca39c8){logger[_0x3473b1(0x16e)](_0x3473b1(0x17f),'解析现有\x20mcp.json\x20失败',{'error':_0xca39c8 instanceof Error?_0xca39c8['message']:String(_0xca39c8)}),console[_0x3473b1(0x16e)](_0x3473b1(0x172)+(_0xca39c8 instanceof Error?_0xca39c8[_0x3473b1(0x15b)]:String(_0xca39c8))),process[_0x3473b1(0x187)](0x1);}else _0x2e90eb={'mcpServers':{'lovrabet-dataset':_0x345c40}},logger['info'](_0x3473b1(0x17f),_0x3473b1(0x180),{'path':_0x5a4afc,'appcode':_0x2a3a4c,'env':_0x3aa184}),console['log']('✓\x20创建\x20mcp.json\x20配置文件');writeFileSync(_0x5a4afc,JSON[_0x3473b1(0x17d)](_0x2e90eb,null,0x2),{'encoding':_0x3473b1(0x181)});const _0x4abdff=resolve(_0x10fb3b,_0x3473b1(0x17b)),_0x57373e=resolve(_0x4abdff,_0x3473b1(0x163));if(!existsSync(_0x57373e))try{!existsSync(_0x4abdff)&&(mkdirSync(_0x4abdff,{'recursive':!![]}),logger['info']('mcp-cursor',_0x3473b1(0x171),{'path':_0x4abdff}));const _0x4d657a=fileURLToPath(import.meta.url),_0x32c7f0=dirname(_0x4d657a),_0xeda35=resolve(_0x32c7f0,_0x3473b1(0x164));existsSync(_0xeda35)?(copyFileSync(_0xeda35,_0x57373e),logger[_0x3473b1(0x160)](_0x3473b1(0x17f),'复制\x20Cursor\x20Rules\x20文件',{'from':_0xeda35,'to':_0x57373e}),console[_0x3473b1(0x15f)](_0x3473b1(0x166))):logger[_0x3473b1(0x179)](_0x3473b1(0x17f),_0x3473b1(0x165),{'templatePath':_0xeda35});}catch(_0x2a6bc3){logger[_0x3473b1(0x16e)](_0x3473b1(0x17f),_0x3473b1(0x178),{'error':_0x2a6bc3 instanceof Error?_0x2a6bc3[_0x3473b1(0x15b)]:String(_0x2a6bc3)}),console[_0x3473b1(0x179)]('警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20'+(_0x2a6bc3 instanceof Error?_0x2a6bc3[_0x3473b1(0x15b)]:String(_0x2a6bc3)));}else console['log'](_0x3473b1(0x169)),logger[_0x3473b1(0x160)](_0x3473b1(0x17f),_0x3473b1(0x167),{'path':_0x57373e});console[_0x3473b1(0x15f)](_0x3473b1(0x170)),console['log']('\x0a配置信息:'),console['log'](_0x3473b1(0x15a)+_0x2a3a4c),console[_0x3473b1(0x15f)](_0x3473b1(0x18b)+_0x3aa184),console[_0x3473b1(0x15f)](_0x3473b1(0x188)+_0x5a4afc),console[_0x3473b1(0x15f)](_0x3473b1(0x15c)),console['log'](_0x3473b1(0x162)),logger[_0x3473b1(0x160)]('mcp-cursor',_0x3473b1(0x157),{'appcode':_0x2a3a4c,'env':_0x3aa184,'configPath':_0x5a4afc}),process[_0x3473b1(0x187)](0x0);}catch(_0x50ae2e){logger[_0x3473b1(0x16e)](_0x3473b1(0x17f),'配置\x20Cursor\x20MCP\x20失败',{'error':_0x50ae2e instanceof Error?_0x50ae2e[_0x3473b1(0x15b)]:String(_0x50ae2e)}),console[_0x3473b1(0x16e)]('错误:\x20配置失败:\x20'+(_0x50ae2e instanceof Error?_0x50ae2e[_0x3473b1(0x15b)]:String(_0x50ae2e))),process[_0x3473b1(0x187)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- function a51_0x1df5(){var _0x359eaf=['info','6223008munVAS','log','4410732BohUgQ','\x0a使用方法:','227046bMzGHo','3OjLNcj','\x0a示例:','执行配置\x20Cursor\x20MCP\x20命令','错误:\x20不支持的\x20IDE\x20类型:\x20','2809570viGcbq','cwd','8941572NzNwhw','3WKTmcW','\x0a当前支持的\x20IDE:','未指定\x20IDE\x20类型','\x20\x20lovrabet\x20mcp\x20cursor','mcp','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','不支持的\x20IDE\x20类型:\x20','\x20\x20-\x20cursor','36582670uhwAwy','error','setLogPath','错误:\x20请指定\x20IDE\x20类型','exit','8238072UMppdy','7mUNGyc'];a51_0x1df5=function(){return _0x359eaf;};return a51_0x1df5();}(function(_0x1d9e33,_0x189c81){var _0x826eb1=a51_0x4866,_0x44c3a6=_0x1d9e33();while(!![]){try{var _0x3d34d0=parseInt(_0x826eb1(0x135))/0x1*(parseInt(_0x826eb1(0x149))/0x2)+parseInt(_0x826eb1(0x14a))/0x3*(-parseInt(_0x826eb1(0x147))/0x4)+-parseInt(_0x826eb1(0x132))/0x5+-parseInt(_0x826eb1(0x142))/0x6*(parseInt(_0x826eb1(0x143))/0x7)+parseInt(_0x826eb1(0x145))/0x8+-parseInt(_0x826eb1(0x134))/0x9+parseInt(_0x826eb1(0x13d))/0xa;if(_0x3d34d0===_0x189c81)break;else _0x44c3a6['push'](_0x44c3a6['shift']());}catch(_0x432b1c){_0x44c3a6['push'](_0x44c3a6['shift']());}}}(a51_0x1df5,0xb607b));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';function a51_0x4866(_0x3c1e39,_0x5a21e7){var _0x1df5a5=a51_0x1df5();return a51_0x4866=function(_0x48669d,_0x504468){_0x48669d=_0x48669d-0x132;var _0x4f3ba9=_0x1df5a5[_0x48669d];return _0x4f3ba9;},a51_0x4866(_0x3c1e39,_0x5a21e7);}export async function mcpCommand(_0xc82282){var _0x321367=a51_0x4866;logger[_0x321367(0x13f)](process[_0x321367(0x133)]());if(!_0xc82282){console['error'](_0x321367(0x140)),console[_0x321367(0x146)](_0x321367(0x148)),console[_0x321367(0x146)](_0x321367(0x13a)),console[_0x321367(0x146)](_0x321367(0x14b)),console[_0x321367(0x146)](_0x321367(0x138)),logger[_0x321367(0x13e)](_0x321367(0x139),_0x321367(0x137)),process[_0x321367(0x141)](0x1);return;}switch(_0xc82282['toLowerCase']()){case'cursor':logger[_0x321367(0x144)](_0x321367(0x139),_0x321367(0x14c)),await configureCursorMcp();break;default:console[_0x321367(0x13e)](_0x321367(0x14d)+_0xc82282),console[_0x321367(0x146)](_0x321367(0x136)),console[_0x321367(0x146)](_0x321367(0x13c)),logger['error'](_0x321367(0x139),_0x321367(0x13b)+_0xc82282),process['exit'](0x1);break;}}
1
+ (function(_0xc779a6,_0x10b224){var _0x2058a4=a54_0x5b52,_0x209c82=_0xc779a6();while(!![]){try{var _0x411a77=-parseInt(_0x2058a4(0x16e))/0x1+parseInt(_0x2058a4(0x170))/0x2*(-parseInt(_0x2058a4(0x171))/0x3)+-parseInt(_0x2058a4(0x163))/0x4+parseInt(_0x2058a4(0x165))/0x5+-parseInt(_0x2058a4(0x172))/0x6+-parseInt(_0x2058a4(0x166))/0x7+parseInt(_0x2058a4(0x16d))/0x8;if(_0x411a77===_0x10b224)break;else _0x209c82['push'](_0x209c82['shift']());}catch(_0x1dc5d2){_0x209c82['push'](_0x209c82['shift']());}}}(a54_0x20a8,0xb7c4b));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';function a54_0x5b52(_0x36bb6b,_0x1bdfb0){_0x36bb6b=_0x36bb6b-0x15b;var _0x20a8b3=a54_0x20a8();var _0x5b52aa=_0x20a8b3[_0x36bb6b];return _0x5b52aa;}function a54_0x20a8(){var _0x196097=['\x20\x20-\x20cursor','错误:\x20请指定\x20IDE\x20类型','25216432OslkPR','696136ObLSDW','setLogPath','2rdmoPW','864471ggazhn','5102184AZjUgI','toLowerCase','mcp','\x0a使用方法:','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','cursor','log','\x0a示例:','执行配置\x20Cursor\x20MCP\x20命令','885988oRGqgD','\x0a当前支持的\x20IDE:','1784085dOWDcz','4900014AnPDlF','error','错误:\x20不支持的\x20IDE\x20类型:\x20','cwd','exit'];a54_0x20a8=function(){return _0x196097;};return a54_0x20a8();}export async function mcpCommand(_0xcdc4ec){var _0x55b8cb=a54_0x5b52;logger[_0x55b8cb(0x16f)](process[_0x55b8cb(0x169)]());if(!_0xcdc4ec){console['error'](_0x55b8cb(0x16c)),console[_0x55b8cb(0x160)](_0x55b8cb(0x15d)),console[_0x55b8cb(0x160)](_0x55b8cb(0x15e)),console['log'](_0x55b8cb(0x161)),console[_0x55b8cb(0x160)]('\x20\x20lovrabet\x20mcp\x20cursor'),logger['error'](_0x55b8cb(0x15c),'未指定\x20IDE\x20类型'),process['exit'](0x1);return;}switch(_0xcdc4ec[_0x55b8cb(0x15b)]()){case _0x55b8cb(0x15f):logger['info']('mcp',_0x55b8cb(0x162)),await configureCursorMcp();break;default:console['error'](_0x55b8cb(0x168)+_0xcdc4ec),console[_0x55b8cb(0x160)](_0x55b8cb(0x164)),console['log'](_0x55b8cb(0x16b)),logger[_0x55b8cb(0x167)]('mcp','不支持的\x20IDE\x20类型:\x20'+_0xcdc4ec),process[_0x55b8cb(0x16a)](0x1);break;}}
@@ -1 +1 @@
1
- const a52_0x2d8895=a52_0x1e57;function a52_0x1a15(){const _0x159f3c=['string','8lYbNEk','942957ryrAas','279823SlhORo','utf8','242242kXOERr','1347311apLJul','trim','482988QpPRqs','cwd','appcode','.lovrabetrc','app','123130MsMiSz','822984nqwENC','64wXygLQ','parse'];a52_0x1a15=function(){return _0x159f3c;};return a52_0x1a15();}(function(_0x219422,_0x1aa7a8){const _0x5f07b6=a52_0x1e57,_0x229e98=_0x219422();while(!![]){try{const _0x18f5f1=-parseInt(_0x5f07b6(0xbc))/0x1+-parseInt(_0x5f07b6(0xbe))/0x2+-parseInt(_0x5f07b6(0xc1))/0x3+-parseInt(_0x5f07b6(0xba))/0x4*(parseInt(_0x5f07b6(0xc6))/0x5)+parseInt(_0x5f07b6(0xc7))/0x6+-parseInt(_0x5f07b6(0xbf))/0x7+-parseInt(_0x5f07b6(0xc8))/0x8*(-parseInt(_0x5f07b6(0xbb))/0x9);if(_0x18f5f1===_0x1aa7a8)break;else _0x229e98['push'](_0x229e98['shift']());}catch(_0x47aa93){_0x229e98['push'](_0x229e98['shift']());}}}(a52_0x1a15,0x29ea3));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a52_0x2d8895(0xc2)](),a52_0x2d8895(0xc4));function a52_0x1e57(_0x1a00a4,_0x131c9c){const _0x1a158a=a52_0x1a15();return a52_0x1e57=function(_0x1e5763,_0x15de03){_0x1e5763=_0x1e5763-0xb9;let _0x2cf158=_0x1a158a[_0x1e5763];return _0x2cf158;},a52_0x1e57(_0x1a00a4,_0x131c9c);}export const globalConfigPath=resolve(homedir(),a52_0x2d8895(0xc4));export function readConfig(){const _0x4d18c8=a52_0x2d8895;let _0x1e77d8={};try{if(existsSync(globalConfigPath)){const _0xe7cb4e=readFileSync(globalConfigPath,{'encoding':_0x4d18c8(0xbd)});_0xe7cb4e&&(_0x1e77d8=JSON[_0x4d18c8(0xc9)](_0xe7cb4e));}}catch(_0x360e78){}try{if(existsSync(projectConfigPath)){const _0x48972c=readFileSync(projectConfigPath,{'encoding':_0x4d18c8(0xbd)});if(_0x48972c){const _0x4a00f2=JSON[_0x4d18c8(0xc9)](_0x48972c);_0x1e77d8={..._0x1e77d8,..._0x4a00f2};}}}catch(_0x3e0762){}return _0x1e77d8;}export function getConfigAppCode(){const _0x246255=a52_0x2d8895;let _0x18961b={},_0x2231a5={};try{if(existsSync(globalConfigPath)){const _0x1cfa58=readFileSync(globalConfigPath,{'encoding':_0x246255(0xbd)});_0x1cfa58&&(_0x2231a5=JSON['parse'](_0x1cfa58));}}catch(_0x1a33dd){}try{if(existsSync(projectConfigPath)){const _0x4db060=readFileSync(projectConfigPath,{'encoding':_0x246255(0xbd)});_0x4db060&&(_0x18961b=JSON[_0x246255(0xc9)](_0x4db060));}}catch(_0x4eedb4){}let _0x99b77c;if(_0x246255(0xc3)in _0x18961b)_0x99b77c=_0x18961b[_0x246255(0xc3)];else{if('app'in _0x18961b)_0x99b77c=_0x18961b[_0x246255(0xc5)];else{if(_0x246255(0xc3)in _0x2231a5)_0x99b77c=_0x2231a5[_0x246255(0xc3)];else _0x246255(0xc5)in _0x2231a5&&(_0x99b77c=_0x2231a5[_0x246255(0xc5)]);}}if(typeof _0x99b77c!==_0x246255(0xb9)||_0x99b77c[_0x246255(0xc0)]()==='')return undefined;return _0x99b77c;}export function isInProject(){return existsSync(projectConfigPath);}
1
+ const a55_0x5c4024=a55_0x5f1f;(function(_0xbce278,_0x3353a6){const _0xe7654a=a55_0x5f1f,_0x516ddd=_0xbce278();while(!![]){try{const _0x2618ce=-parseInt(_0xe7654a(0x162))/0x1+-parseInt(_0xe7654a(0x167))/0x2+parseInt(_0xe7654a(0x16a))/0x3+-parseInt(_0xe7654a(0x161))/0x4*(-parseInt(_0xe7654a(0x168))/0x5)+parseInt(_0xe7654a(0x15d))/0x6+-parseInt(_0xe7654a(0x15e))/0x7*(-parseInt(_0xe7654a(0x16d))/0x8)+-parseInt(_0xe7654a(0x160))/0x9;if(_0x2618ce===_0x3353a6)break;else _0x516ddd['push'](_0x516ddd['shift']());}catch(_0x138463){_0x516ddd['push'](_0x516ddd['shift']());}}}(a55_0x2eab,0xcca31));function a55_0x2eab(){const _0x588488=['2719338BAyjod','appcode','trim','5743336gUBFKG','9996822GgYjLC','14WEizcA','.lovrabetrc','33088581oaEZIb','572MieoRA','108443sgBsRe','parse','string','utf8','cwd','1496410tOLxZl','47655pTfzmt','app'];a55_0x2eab=function(){return _0x588488;};return a55_0x2eab();}function a55_0x5f1f(_0x2cfabf,_0x5b8fd3){_0x2cfabf=_0x2cfabf-0x15d;const _0x2eabe7=a55_0x2eab();let _0x5f1f53=_0x2eabe7[_0x2cfabf];return _0x5f1f53;}import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x5c4024(0x166)](),a55_0x5c4024(0x15f));export const globalConfigPath=resolve(homedir(),a55_0x5c4024(0x15f));export function readConfig(){const _0x42c106=a55_0x5c4024;let _0x52fe02={};try{if(existsSync(globalConfigPath)){const _0x4e8388=readFileSync(globalConfigPath,{'encoding':_0x42c106(0x165)});_0x4e8388&&(_0x52fe02=JSON[_0x42c106(0x163)](_0x4e8388));}}catch(_0x5e94f0){}try{if(existsSync(projectConfigPath)){const _0x1cc181=readFileSync(projectConfigPath,{'encoding':_0x42c106(0x165)});if(_0x1cc181){const _0x34465a=JSON['parse'](_0x1cc181);_0x52fe02={..._0x52fe02,..._0x34465a};}}}catch(_0x40e10a){}return _0x52fe02;}export function getConfigAppCode(){const _0x3606c0=a55_0x5c4024;let _0x534bb8={},_0x56606c={};try{if(existsSync(globalConfigPath)){const _0x499f01=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x499f01&&(_0x56606c=JSON['parse'](_0x499f01));}}catch(_0x3f777a){}try{if(existsSync(projectConfigPath)){const _0x3f107b=readFileSync(projectConfigPath,{'encoding':_0x3606c0(0x165)});_0x3f107b&&(_0x534bb8=JSON[_0x3606c0(0x163)](_0x3f107b));}}catch(_0x22c0bc){}let _0x476353;if(_0x3606c0(0x16b)in _0x534bb8)_0x476353=_0x534bb8[_0x3606c0(0x16b)];else{if('app'in _0x534bb8)_0x476353=_0x534bb8[_0x3606c0(0x169)];else{if(_0x3606c0(0x16b)in _0x56606c)_0x476353=_0x56606c[_0x3606c0(0x16b)];else _0x3606c0(0x169)in _0x56606c&&(_0x476353=_0x56606c[_0x3606c0(0x169)]);}}if(typeof _0x476353!==_0x3606c0(0x164)||_0x476353[_0x3606c0(0x16c)]()==='')return undefined;return _0x476353;}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- (function(_0x59526f,_0x52f3f9){const _0x32442b=a53_0x3185,_0x23f3d7=_0x59526f();while(!![]){try{const _0x20342e=-parseInt(_0x32442b(0x1fd))/0x1+-parseInt(_0x32442b(0x1f5))/0x2+-parseInt(_0x32442b(0x1f9))/0x3*(-parseInt(_0x32442b(0x1f3))/0x4)+-parseInt(_0x32442b(0x1ef))/0x5*(-parseInt(_0x32442b(0x200))/0x6)+-parseInt(_0x32442b(0x1f4))/0x7+-parseInt(_0x32442b(0x1fa))/0x8*(parseInt(_0x32442b(0x1fb))/0x9)+parseInt(_0x32442b(0x1f8))/0xa*(parseInt(_0x32442b(0x1f0))/0xb);if(_0x20342e===_0x52f3f9)break;else _0x23f3d7['push'](_0x23f3d7['shift']());}catch(_0x4787b5){_0x23f3d7['push'](_0x23f3d7['shift']());}}}(a53_0x33d8,0xcb21e));function a53_0x3185(_0x129f89,_0x477458){const _0x33d8fe=a53_0x33d8();return a53_0x3185=function(_0x318553,_0x87f576){_0x318553=_0x318553-0x1ef;let _0x191f30=_0x33d8fe[_0x318553];return _0x191f30;},a53_0x3185(_0x129f89,_0x477458);}import a53_0x2b36ba from'node:path';function a53_0x33d8(){const _0xd9742f=['213RbaQwW','139256FkUAbb','36wQTRPS','readdirSync','1281571ZUJmgT','copyFileSync','isDirectory','24918izlYZu','error','1400lnRISe','9911JVLMWi','name','mkdirSync','344KSiYer','10862838pgXjBF','2380304mYHRET','复制目录时出错:','join','41690sdDCyL'];a53_0x33d8=function(){return _0xd9742f;};return a53_0x33d8();}import a53_0x1455b7 from'node:fs';export async function copyDirectory(_0xa8f157,_0x3874b6){const _0x2d3ecd=a53_0x3185;try{const _0x50dcc1=a53_0x1455b7[_0x2d3ecd(0x1fc)](_0xa8f157,{'withFileTypes':!![]});a53_0x1455b7[_0x2d3ecd(0x1f2)](_0x3874b6,{'recursive':!![]});for(const _0x424ec6 of _0x50dcc1){const _0x42a5ca=a53_0x2b36ba[_0x2d3ecd(0x1f7)](_0xa8f157,_0x424ec6[_0x2d3ecd(0x1f1)]),_0x54227b=a53_0x2b36ba[_0x2d3ecd(0x1f7)](_0x3874b6,_0x424ec6['name']);_0x424ec6[_0x2d3ecd(0x1ff)]()?await copyDirectory(_0x42a5ca,_0x54227b):a53_0x1455b7[_0x2d3ecd(0x1fe)](_0x42a5ca,_0x54227b);}}catch(_0x54df75){console[_0x2d3ecd(0x201)](_0x2d3ecd(0x1f6),_0x54df75);}}
1
+ (function(_0x53c933,_0x101871){const _0x1dd7a2=a56_0x2321,_0x3764a8=_0x53c933();while(!![]){try{const _0x5468f5=-parseInt(_0x1dd7a2(0xac))/0x1*(-parseInt(_0x1dd7a2(0xa5))/0x2)+parseInt(_0x1dd7a2(0xa7))/0x3*(-parseInt(_0x1dd7a2(0x9f))/0x4)+-parseInt(_0x1dd7a2(0xa6))/0x5*(-parseInt(_0x1dd7a2(0xa3))/0x6)+-parseInt(_0x1dd7a2(0xa0))/0x7*(parseInt(_0x1dd7a2(0x9d))/0x8)+-parseInt(_0x1dd7a2(0xa9))/0x9*(-parseInt(_0x1dd7a2(0x9c))/0xa)+-parseInt(_0x1dd7a2(0xab))/0xb+-parseInt(_0x1dd7a2(0xa8))/0xc;if(_0x5468f5===_0x101871)break;else _0x3764a8['push'](_0x3764a8['shift']());}catch(_0x4d9a5e){_0x3764a8['push'](_0x3764a8['shift']());}}}(a56_0x2cf9,0x4e4c9));import a56_0x38720f from'node:path';function a56_0x2cf9(){const _0x3569eb=['2992794vLuMtC','复制目录时出错:','copyFileSync','84PmhJQN','name','6sxEQKO','7675bTGILk','178749aRpJyi','1395588KfXutW','111114TxqlRP','join','698676XMrQgy','179986nVluTw','error','readdirSync','490pUsDcz','8XPsphQ','isDirectory','16NJVuNV'];a56_0x2cf9=function(){return _0x3569eb;};return a56_0x2cf9();}function a56_0x2321(_0x27d6f7,_0xd5ffce){_0x27d6f7=_0x27d6f7-0x9c;const _0x2cf9dd=a56_0x2cf9();let _0x23210f=_0x2cf9dd[_0x27d6f7];return _0x23210f;}import a56_0x3ee209 from'node:fs';export async function copyDirectory(_0x222e83,_0x2a00a2){const _0x2f8f6f=a56_0x2321;try{const _0x27c28e=a56_0x3ee209[_0x2f8f6f(0xae)](_0x222e83,{'withFileTypes':!![]});a56_0x3ee209['mkdirSync'](_0x2a00a2,{'recursive':!![]});for(const _0x5a4801 of _0x27c28e){const _0x5a917a=a56_0x38720f[_0x2f8f6f(0xaa)](_0x222e83,_0x5a4801['name']),_0x227e34=a56_0x38720f[_0x2f8f6f(0xaa)](_0x2a00a2,_0x5a4801[_0x2f8f6f(0xa4)]);_0x5a4801[_0x2f8f6f(0x9e)]()?await copyDirectory(_0x5a917a,_0x227e34):a56_0x3ee209[_0x2f8f6f(0xa2)](_0x5a917a,_0x227e34);}}catch(_0x4694a2){console[_0x2f8f6f(0xad)](_0x2f8f6f(0xa1),_0x4694a2);}}
@@ -1 +1 @@
1
- (function(_0x3e3e75,_0x5adace){const _0x5dc82c=a54_0x24e0,_0xcbd41=_0x3e3e75();while(!![]){try{const _0x39311c=-parseInt(_0x5dc82c(0xc2))/0x1+parseInt(_0x5dc82c(0xcc))/0x2+parseInt(_0x5dc82c(0xc5))/0x3+-parseInt(_0x5dc82c(0xc1))/0x4*(-parseInt(_0x5dc82c(0xd6))/0x5)+-parseInt(_0x5dc82c(0xc7))/0x6*(-parseInt(_0x5dc82c(0xce))/0x7)+parseInt(_0x5dc82c(0xc3))/0x8+-parseInt(_0x5dc82c(0xcf))/0x9;if(_0x39311c===_0x5adace)break;else _0xcbd41['push'](_0xcbd41['shift']());}catch(_0x5c0add){_0xcbd41['push'](_0xcbd41['shift']());}}}(a54_0x3ca5,0x3547f));function a54_0x3ca5(){const _0x20a1ff=['150702vKHwJL','fetch','name','url','*\x20请求失败,','594882fEpVhC','get','70pAJqEo','8012457bCmWUl','text','abort','headers','AbortError','content-type','TypeError','1031170kIofwh','ENOTFOUND','signal','message','application/json','log','\x20次重试...','includes','4QWUBvb','248580JfYKGl','2085144eOwdHj','json','1024812YmIwva','Request\x20failed'];a54_0x3ca5=function(){return _0x20a1ff;};return a54_0x3ca5();}export async function httpRequest(_0x207c59,_0x155a43={}){const _0x521055=a54_0x24e0,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x155a43;let _0x40e4fc=null;for(let _0x4d7b77=0x0;_0x4d7b77<=retries;_0x4d7b77++){try{const _0x1e8b06=new AbortController(),_0x275009=setTimeout(()=>_0x1e8b06[_0x521055(0xd1)](),timeout),_0x41a349=await fetch(_0x207c59,{'headers':headers,'signal':_0x1e8b06[_0x521055(0xbb)]});clearTimeout(_0x275009);let _0x1b46db;const _0x479d1e=_0x41a349[_0x521055(0xd2)][_0x521055(0xcd)](_0x521055(0xd4));return _0x479d1e?.['includes'](_0x521055(0xbd))?_0x1b46db=await _0x41a349[_0x521055(0xc4)]():_0x1b46db=await _0x41a349[_0x521055(0xd0)](),{'ok':_0x41a349['ok'],'status':_0x41a349['status'],'statusText':_0x41a349['statusText'],'data':_0x1b46db,'headers':_0x41a349['headers'],'url':_0x41a349[_0x521055(0xca)],'text':()=>_0x41a349[_0x521055(0xd0)]()};}catch(_0x55392b){_0x40e4fc=_0x55392b instanceof Error?_0x55392b:new Error(String(_0x55392b));if(_0x4d7b77===retries)break;if(shouldRetry(_0x55392b)){console[_0x521055(0xbe)](_0x521055(0xcb)+retryDelay+'ms\x20后进行第\x20'+(_0x4d7b77+0x1)+_0x521055(0xbf)),await sleep(retryDelay);continue;}else break;}}throw _0x40e4fc||new Error(_0x521055(0xc6));}function shouldRetry(_0x302331){const _0x133572=a54_0x24e0;if(_0x302331 instanceof Error){if(_0x302331[_0x133572(0xc9)]===_0x133572(0xd3))return![];if(_0x302331[_0x133572(0xc9)]===_0x133572(0xd5)&&_0x302331[_0x133572(0xbc)][_0x133572(0xc0)](_0x133572(0xc8)))return!![];if(_0x302331[_0x133572(0xbc)][_0x133572(0xc0)]('ECONNRESET'))return!![];if(_0x302331[_0x133572(0xbc)]['includes'](_0x133572(0xd7)))return![];}return![];}function sleep(_0x117449){return new Promise(_0x21f3d3=>setTimeout(_0x21f3d3,_0x117449));}function a54_0x24e0(_0x430ee3,_0x199917){const _0x3ca509=a54_0x3ca5();return a54_0x24e0=function(_0x24e039,_0x3adef3){_0x24e039=_0x24e039-0xbb;let _0x23b1bc=_0x3ca509[_0x24e039];return _0x23b1bc;},a54_0x24e0(_0x430ee3,_0x199917);}export function validateUrl(_0x1e3ee8){try{return new URL(_0x1e3ee8),!![];}catch{return![];}}
1
+ (function(_0x3de174,_0x16f3a6){const _0x5ba4ef=a57_0x5b0b,_0x35f827=_0x3de174();while(!![]){try{const _0x44154b=parseInt(_0x5ba4ef(0x16d))/0x1+-parseInt(_0x5ba4ef(0x173))/0x2+parseInt(_0x5ba4ef(0x160))/0x3+parseInt(_0x5ba4ef(0x174))/0x4+-parseInt(_0x5ba4ef(0x16f))/0x5+-parseInt(_0x5ba4ef(0x167))/0x6*(-parseInt(_0x5ba4ef(0x165))/0x7)+-parseInt(_0x5ba4ef(0x15a))/0x8*(parseInt(_0x5ba4ef(0x177))/0x9);if(_0x44154b===_0x16f3a6)break;else _0x35f827['push'](_0x35f827['shift']());}catch(_0x4c2062){_0x35f827['push'](_0x35f827['shift']());}}}(a57_0x19e3,0x8988f));export async function httpRequest(_0x205858,_0x1fbe88={}){const _0x576432=a57_0x5b0b,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x1fbe88;let _0x6f4d89=null;for(let _0x47f194=0x0;_0x47f194<=retries;_0x47f194++){try{const _0x27492d=new AbortController(),_0x534946=setTimeout(()=>_0x27492d[_0x576432(0x16a)](),timeout),_0x32bfc1=await fetch(_0x205858,{'headers':headers,'signal':_0x27492d[_0x576432(0x162)]});clearTimeout(_0x534946);let _0x152805;const _0x33e070=_0x32bfc1[_0x576432(0x163)][_0x576432(0x172)](_0x576432(0x15e));return _0x33e070?.[_0x576432(0x170)](_0x576432(0x178))?_0x152805=await _0x32bfc1[_0x576432(0x16c)]():_0x152805=await _0x32bfc1[_0x576432(0x171)](),{'ok':_0x32bfc1['ok'],'status':_0x32bfc1[_0x576432(0x164)],'statusText':_0x32bfc1[_0x576432(0x16e)],'data':_0x152805,'headers':_0x32bfc1[_0x576432(0x163)],'url':_0x32bfc1[_0x576432(0x166)],'text':()=>_0x32bfc1['text']()};}catch(_0x2442eb){_0x6f4d89=_0x2442eb instanceof Error?_0x2442eb:new Error(String(_0x2442eb));if(_0x47f194===retries)break;if(shouldRetry(_0x2442eb)){console[_0x576432(0x15f)](_0x576432(0x16b)+retryDelay+'ms\x20后进行第\x20'+(_0x47f194+0x1)+_0x576432(0x15c)),await sleep(retryDelay);continue;}else break;}}throw _0x6f4d89||new Error(_0x576432(0x168));}function a57_0x19e3(){const _0x12f266=['get','1362016woFsAs','747364PzTKFx','TypeError','fetch','3216249YlCjgy','application/json','16PBtGcp','AbortError','\x20次重试...','name','content-type','log','2334336ZmUPGq','ECONNRESET','signal','headers','status','42yRJeAe','url','829698kCigVT','Request\x20failed','message','abort','*\x20请求失败,','json','1039508vGVTvG','statusText','4375430tlpIgH','includes','text'];a57_0x19e3=function(){return _0x12f266;};return a57_0x19e3();}function a57_0x5b0b(_0xba4fd2,_0x1383eb){_0xba4fd2=_0xba4fd2-0x15a;const _0x19e355=a57_0x19e3();let _0x5b0bb1=_0x19e355[_0xba4fd2];return _0x5b0bb1;}function shouldRetry(_0x4148b7){const _0x765b4b=a57_0x5b0b;if(_0x4148b7 instanceof Error){if(_0x4148b7[_0x765b4b(0x15d)]===_0x765b4b(0x15b))return![];if(_0x4148b7[_0x765b4b(0x15d)]===_0x765b4b(0x175)&&_0x4148b7[_0x765b4b(0x169)][_0x765b4b(0x170)](_0x765b4b(0x176)))return!![];if(_0x4148b7[_0x765b4b(0x169)][_0x765b4b(0x170)](_0x765b4b(0x161)))return!![];if(_0x4148b7['message']['includes']('ENOTFOUND'))return![];}return![];}function sleep(_0x54cf8e){return new Promise(_0x255563=>setTimeout(_0x255563,_0x54cf8e));}export function validateUrl(_0x292f73){try{return new URL(_0x292f73),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a55_0x5b468f=a55_0x67d9;(function(_0x350aa0,_0x3d6f7b){const _0x52de3b=a55_0x67d9,_0x4d5aaa=_0x350aa0();while(!![]){try{const _0x91bbbc=-parseInt(_0x52de3b(0x1a0))/0x1+-parseInt(_0x52de3b(0x1bb))/0x2+-parseInt(_0x52de3b(0x197))/0x3+-parseInt(_0x52de3b(0x1a2))/0x4+parseInt(_0x52de3b(0x18f))/0x5+parseInt(_0x52de3b(0x19b))/0x6*(-parseInt(_0x52de3b(0x1ac))/0x7)+parseInt(_0x52de3b(0x1c3))/0x8*(parseInt(_0x52de3b(0x18c))/0x9);if(_0x91bbbc===_0x3d6f7b)break;else _0x4d5aaa['push'](_0x4d5aaa['shift']());}catch(_0x4fd68c){_0x4d5aaa['push'](_0x4d5aaa['shift']());}}}(a55_0x1594,0xd24f7));import a55_0xeafb44 from'winston';import a55_0x584492 from'node:fs';import a55_0x1ec65a from'node:path';class Logger{[a55_0x5b468f(0x1ae)];[a55_0x5b468f(0x1a6)];[a55_0x5b468f(0x1b2)]='';constructor(){const _0x427dd3=a55_0x5b468f;this[_0x427dd3(0x1a6)]='';}[a55_0x5b468f(0x191)](_0x28891e){const _0x55f1bf=a55_0x5b468f;this[_0x55f1bf(0x1b2)]=_0x28891e;}[a55_0x5b468f(0x1a5)](){const _0xdd44e0=a55_0x5b468f,_0x5d2303=a55_0x1ec65a['dirname'](this[_0xdd44e0(0x1a6)]);!a55_0x584492['existsSync'](_0x5d2303)&&a55_0x584492[_0xdd44e0(0x198)](_0x5d2303,{'recursive':!![]});const _0x27e85b=a55_0xeafb44[_0xdd44e0(0x1b0)]['combine'](a55_0xeafb44['format'][_0xdd44e0(0x1b4)](),a55_0xeafb44[_0xdd44e0(0x1b0)]['errors']({'stack':!![]}),a55_0xeafb44[_0xdd44e0(0x1b0)][_0xdd44e0(0x19f)](_0x41d7ce=>{const _0x59730f=_0xdd44e0,_0x5d8afc={'timestamp':_0x41d7ce[_0x59730f(0x1b4)]||new Date()[_0x59730f(0x1c1)](),'level':_0x41d7ce[_0x59730f(0x1bd)]||'info','command':_0x41d7ce[_0x59730f(0x195)]||'unknown','rawCommand':_0x41d7ce[_0x59730f(0x1ab)]||this[_0x59730f(0x1b2)]||undefined,'message':_0x41d7ce[_0x59730f(0x19e)]||'','duration':_0x41d7ce['duration']||undefined,'details':_0x41d7ce[_0x59730f(0x1a1)]||undefined};return JSON[_0x59730f(0x19a)](_0x5d8afc);}));this[_0xdd44e0(0x1ae)]=a55_0xeafb44[_0xdd44e0(0x19d)]({'level':_0xdd44e0(0x1b9),'format':_0x27e85b,'transports':[new a55_0xeafb44[(_0xdd44e0(0x1c0))][(_0xdd44e0(0x1a4))]({'filename':this[_0xdd44e0(0x1a6)],'level':_0xdd44e0(0x1b9)})],'silent':![]}),a55_0xeafb44[_0xdd44e0(0x199)]({'success':_0xdd44e0(0x193),'error':_0xdd44e0(0x1b3),'warn':_0xdd44e0(0x1a3),'info':_0xdd44e0(0x18e)});}['setLogPath'](_0x674dc4){const _0x2b02d1=a55_0x5b468f;this[_0x2b02d1(0x1a6)]=a55_0x1ec65a[_0x2b02d1(0x1b5)](_0x674dc4,_0x2b02d1(0x1aa)),this[_0x2b02d1(0x1ae)]&&this[_0x2b02d1(0x1ae)][_0x2b02d1(0x1a8)](),this[_0x2b02d1(0x1a5)]();}[a55_0x5b468f(0x1b9)](_0x33582b,_0x272066,_0x507ce1){const _0x86ffbc=a55_0x5b468f;if(!this[_0x86ffbc(0x1a6)]||!this[_0x86ffbc(0x1ae)])return;this[_0x86ffbc(0x1ae)]['info'](_0x272066,{'command':_0x33582b,'details':_0x507ce1});}[a55_0x5b468f(0x194)](_0x261e89,_0x3c9f5c,_0x2b95e5,_0x15a50b){const _0x5b0f5f=a55_0x5b468f;if(!this[_0x5b0f5f(0x1a6)]||!this[_0x5b0f5f(0x1ae)])return;this[_0x5b0f5f(0x1ae)]['log']('info',_0x3c9f5c,{'level':'success','command':_0x261e89,'duration':_0x2b95e5,'details':_0x15a50b});}[a55_0x5b468f(0x1a9)](_0x58698d,_0x30c17a,_0x2d6903){const _0x8168e1=a55_0x5b468f;if(!this[_0x8168e1(0x1a6)]||!this[_0x8168e1(0x1ae)])return;this[_0x8168e1(0x1ae)][_0x8168e1(0x1a9)](_0x30c17a,{'command':_0x58698d,'details':_0x2d6903});}[a55_0x5b468f(0x1b8)](_0xe1b828,_0x5b1245,_0x2ee204){const _0xfa4b5d=a55_0x5b468f;if(!this['logFilePath']||!this[_0xfa4b5d(0x1ae)])return;this[_0xfa4b5d(0x1ae)][_0xfa4b5d(0x1b8)](_0x5b1245,{'command':_0xe1b828,'details':_0x2ee204});}async[a55_0x5b468f(0x1ba)](_0x26a711,_0x5714c6,_0x357bf0){const _0x1d562d=a55_0x5b468f,_0x46e4d5=Date[_0x1d562d(0x1b6)]();this[_0x1d562d(0x1b9)](_0x26a711,'开始执行:\x20'+_0x5714c6);try{const _0x5725bf=await _0x357bf0(),_0x3dcc44=Date[_0x1d562d(0x1b6)]()-_0x46e4d5;return this[_0x1d562d(0x194)](_0x26a711,_0x1d562d(0x190)+_0x5714c6,_0x3dcc44),_0x5725bf;}catch(_0x4e425f){const _0xb7524=Date[_0x1d562d(0x1b6)]()-_0x46e4d5;this[_0x1d562d(0x1a9)](_0x26a711,'失败:\x20'+_0x5714c6,{'error':_0x4e425f instanceof Error?_0x4e425f[_0x1d562d(0x19e)]:String(_0x4e425f),'duration':_0xb7524});throw _0x4e425f;}}[a55_0x5b468f(0x1b7)](){const _0x361e01=a55_0x5b468f;try{if(!a55_0x584492[_0x361e01(0x192)](this['logFilePath']))return[];const _0x21513a=a55_0x584492[_0x361e01(0x19c)](this['logFilePath'],_0x361e01(0x1a7));return _0x21513a[_0x361e01(0x18d)]('\x0a')[_0x361e01(0x1ad)](_0x4a9940=>_0x4a9940['trim']())[_0x361e01(0x1b1)](_0x2628fc=>JSON[_0x361e01(0x1be)](_0x2628fc));}catch(_0x1be175){return console[_0x361e01(0x1b8)](_0x361e01(0x196),_0x1be175),[];}}[a55_0x5b468f(0x1bc)](){const _0x5bcb63=a55_0x5b468f;try{a55_0x584492[_0x5bcb63(0x192)](this[_0x5bcb63(0x1a6)])&&a55_0x584492[_0x5bcb63(0x1c2)](this[_0x5bcb63(0x1a6)],'',_0x5bcb63(0x1a7));}catch(_0x5ef1e8){console[_0x5bcb63(0x1b8)](_0x5bcb63(0x1af),_0x5ef1e8);}}[a55_0x5b468f(0x1bf)](){return this['winstonLogger'];}}function a55_0x1594(){const _0x57a489=['3962368Vgbkji','yellow','File','initWinstonLogger','logFilePath','utf8','clear','error','.lovrabet.log','rawCommand','49hSWJgh','filter','winstonLogger','Failed\x20to\x20clear\x20logs:','format','map','currentRawCommand','red','timestamp','join','now','readLogs','warn','info','logTask','2396524ojKkTr','clearLogs','level','parse','getWinstonInstance','transports','toISOString','writeFileSync','112wjmQiP','3797487yqYcfa','split','blue','5002735luaOQd','完成:\x20','setRawCommand','existsSync','green','success','command','Failed\x20to\x20read\x20logs:','5015379vtJEhV','mkdirSync','addColors','stringify','449214ebFHTR','readFileSync','createLogger','message','printf','1661588FfABNi','details'];a55_0x1594=function(){return _0x57a489;};return a55_0x1594();}function a55_0x67d9(_0x1c44f4,_0x5f213f){const _0x159434=a55_0x1594();return a55_0x67d9=function(_0x67d973,_0x1c647d){_0x67d973=_0x67d973-0x18c;let _0x5cc295=_0x159434[_0x67d973];return _0x5cc295;},a55_0x67d9(_0x1c44f4,_0x5f213f);}export const logger=new Logger();
1
+ function a58_0x1d0d(){const _0x2eee49=['12932944iRDnog','readLogs','timestamp','error','File','warn','2298bnPUNW','toISOString','clear','transports','2334812yyemCL','stringify','Failed\x20to\x20clear\x20logs:','now','blue','existsSync','yellow','success','level','winstonLogger','errors','filter','format','2620770IrzLnY','rawCommand','utf8','Failed\x20to\x20read\x20logs:','clearLogs','createLogger','logFilePath','.lovrabet.log','duration','info','unknown','logTask','initWinstonLogger','mkdirSync','printf','red','setRawCommand','9935JFInGF','green','2yNZgUa','parse','split','215089ZDukrr','addColors','currentRawCommand','combine','message','6066263HCOpwS','5629275ZGxxIi'];a58_0x1d0d=function(){return _0x2eee49;};return a58_0x1d0d();}const a58_0x953178=a58_0x2394;(function(_0x124e55,_0x4f41d3){const _0x1a646e=a58_0x2394,_0x5f2430=_0x124e55();while(!![]){try{const _0xc8af0e=parseInt(_0x1a646e(0x101))/0x1+-parseInt(_0x1a646e(0xfe))/0x2*(parseInt(_0x1a646e(0xeb))/0x3)+parseInt(_0x1a646e(0xde))/0x4+parseInt(_0x1a646e(0xfc))/0x5*(parseInt(_0x1a646e(0xda))/0x6)+-parseInt(_0x1a646e(0x106))/0x7+parseInt(_0x1a646e(0x108))/0x8+-parseInt(_0x1a646e(0x107))/0x9;if(_0xc8af0e===_0x4f41d3)break;else _0x5f2430['push'](_0x5f2430['shift']());}catch(_0x2e5b68){_0x5f2430['push'](_0x5f2430['shift']());}}}(a58_0x1d0d,0xc5f05));import a58_0x7b3a29 from'winston';function a58_0x2394(_0x20bb12,_0x68ff40){_0x20bb12=_0x20bb12-0xd5;const _0x1d0de9=a58_0x1d0d();let _0x239425=_0x1d0de9[_0x20bb12];return _0x239425;}import a58_0x5584da from'node:fs';import a58_0x1135e9 from'node:path';class Logger{[a58_0x953178(0xe7)];[a58_0x953178(0xf1)];['currentRawCommand']='';constructor(){const _0x59380e=a58_0x953178;this[_0x59380e(0xf1)]='';}[a58_0x953178(0xfb)](_0x1ea822){const _0x4f970d=a58_0x953178;this[_0x4f970d(0x103)]=_0x1ea822;}['initWinstonLogger'](){const _0x486c82=a58_0x953178,_0x400b56=a58_0x1135e9['dirname'](this[_0x486c82(0xf1)]);!a58_0x5584da['existsSync'](_0x400b56)&&a58_0x5584da[_0x486c82(0xf8)](_0x400b56,{'recursive':!![]});const _0x5325b3=a58_0x7b3a29[_0x486c82(0xea)][_0x486c82(0x104)](a58_0x7b3a29[_0x486c82(0xea)][_0x486c82(0xd6)](),a58_0x7b3a29[_0x486c82(0xea)][_0x486c82(0xe8)]({'stack':!![]}),a58_0x7b3a29['format'][_0x486c82(0xf9)](_0x371550=>{const _0x21c73e=_0x486c82,_0x4b70d0={'timestamp':_0x371550['timestamp']||new Date()[_0x21c73e(0xdb)](),'level':_0x371550[_0x21c73e(0xe6)]||_0x21c73e(0xf4),'command':_0x371550['command']||_0x21c73e(0xf5),'rawCommand':_0x371550[_0x21c73e(0xec)]||this[_0x21c73e(0x103)]||undefined,'message':_0x371550[_0x21c73e(0x105)]||'','duration':_0x371550[_0x21c73e(0xf3)]||undefined,'details':_0x371550['details']||undefined};return JSON[_0x21c73e(0xdf)](_0x4b70d0);}));this['winstonLogger']=a58_0x7b3a29[_0x486c82(0xf0)]({'level':_0x486c82(0xf4),'format':_0x5325b3,'transports':[new a58_0x7b3a29[(_0x486c82(0xdd))][(_0x486c82(0xd8))]({'filename':this[_0x486c82(0xf1)],'level':_0x486c82(0xf4)})],'silent':![]}),a58_0x7b3a29[_0x486c82(0x102)]({'success':_0x486c82(0xfd),'error':_0x486c82(0xfa),'warn':_0x486c82(0xe4),'info':_0x486c82(0xe2)});}['setLogPath'](_0x1b8246){const _0x382ece=a58_0x953178;this[_0x382ece(0xf1)]=a58_0x1135e9['join'](_0x1b8246,_0x382ece(0xf2)),this['winstonLogger']&&this[_0x382ece(0xe7)][_0x382ece(0xdc)](),this[_0x382ece(0xf7)]();}[a58_0x953178(0xf4)](_0x165340,_0x5d471c,_0x432800){const _0x5a28bc=a58_0x953178;if(!this[_0x5a28bc(0xf1)]||!this[_0x5a28bc(0xe7)])return;this[_0x5a28bc(0xe7)][_0x5a28bc(0xf4)](_0x5d471c,{'command':_0x165340,'details':_0x432800});}[a58_0x953178(0xe5)](_0x1031bd,_0x1ce318,_0x5ac448,_0x154ce5){const _0x2c680f=a58_0x953178;if(!this['logFilePath']||!this[_0x2c680f(0xe7)])return;this[_0x2c680f(0xe7)]['log'](_0x2c680f(0xf4),_0x1ce318,{'level':_0x2c680f(0xe5),'command':_0x1031bd,'duration':_0x5ac448,'details':_0x154ce5});}[a58_0x953178(0xd7)](_0x25153d,_0x51cb73,_0x4ae6c4){const _0x30cc47=a58_0x953178;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x30cc47(0xe7)]['error'](_0x51cb73,{'command':_0x25153d,'details':_0x4ae6c4});}[a58_0x953178(0xd9)](_0x31a036,_0x5d0ecf,_0x5d8f46){const _0x52b765=a58_0x953178;if(!this['logFilePath']||!this[_0x52b765(0xe7)])return;this['winstonLogger']['warn'](_0x5d0ecf,{'command':_0x31a036,'details':_0x5d8f46});}async[a58_0x953178(0xf6)](_0x52d520,_0x1a9249,_0x59f5da){const _0xbef1b9=a58_0x953178,_0xc6eb77=Date[_0xbef1b9(0xe1)]();this[_0xbef1b9(0xf4)](_0x52d520,'开始执行:\x20'+_0x1a9249);try{const _0x36c04a=await _0x59f5da(),_0x21b55f=Date[_0xbef1b9(0xe1)]()-_0xc6eb77;return this[_0xbef1b9(0xe5)](_0x52d520,'完成:\x20'+_0x1a9249,_0x21b55f),_0x36c04a;}catch(_0x1c773c){const _0x46fdb5=Date['now']()-_0xc6eb77;this[_0xbef1b9(0xd7)](_0x52d520,'失败:\x20'+_0x1a9249,{'error':_0x1c773c instanceof Error?_0x1c773c[_0xbef1b9(0x105)]:String(_0x1c773c),'duration':_0x46fdb5});throw _0x1c773c;}}[a58_0x953178(0xd5)](){const _0xacb5d=a58_0x953178;try{if(!a58_0x5584da['existsSync'](this['logFilePath']))return[];const _0x48a592=a58_0x5584da['readFileSync'](this[_0xacb5d(0xf1)],'utf8');return _0x48a592[_0xacb5d(0x100)]('\x0a')[_0xacb5d(0xe9)](_0x5e1078=>_0x5e1078['trim']())['map'](_0x58fe40=>JSON[_0xacb5d(0xff)](_0x58fe40));}catch(_0x394915){return console['warn'](_0xacb5d(0xee),_0x394915),[];}}[a58_0x953178(0xef)](){const _0x2ddec5=a58_0x953178;try{a58_0x5584da[_0x2ddec5(0xe3)](this['logFilePath'])&&a58_0x5584da['writeFileSync'](this[_0x2ddec5(0xf1)],'',_0x2ddec5(0xed));}catch(_0x5231ce){console[_0x2ddec5(0xd9)](_0x2ddec5(0xe0),_0x5231ce);}}['getWinstonInstance'](){const _0x3394c4=a58_0x953178;return this[_0x3394c4(0xe7)];}}export const logger=new Logger();
@@ -1 +1 @@
1
- const a56_0x2ef250=a56_0x3cdd;function a56_0x4b61(){const _0x40a68f=['readFile','530360ttgLOG','promises','6bFKLWQ','22978EAEybN','existsSync','error','addImport','routerFilePath','now','toUpperCase','2pMGAMZ','map','addRoute','toComponentName','toLowerCase','\x20from\x20\x22../pages/','utf8','921305mXhSGl','match','路由配置更新完成','50TTClCv','charAt','split','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','addPageRoute','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','import\x20','success','885447lCUrPq','开始更新路由配置','377856rVBGqh','join','路由文件不存在:\x20','slice','路由配置更新失败','previewChanges','length','includes','未找到路由配置的\x20children\x20数组','1045268wpxinM','src','router','index','483606QEYJgq'];a56_0x4b61=function(){return _0x40a68f;};return a56_0x4b61();}(function(_0x4bd976,_0x4512f9){const _0x55ca12=a56_0x3cdd,_0x4c93a5=_0x4bd976();while(!![]){try{const _0x2dd701=-parseInt(_0x55ca12(0x17c))/0x1*(-parseInt(_0x55ca12(0x175))/0x2)+-parseInt(_0x55ca12(0x170))/0x3+parseInt(_0x55ca12(0x172))/0x4+-parseInt(_0x55ca12(0x183))/0x5*(parseInt(_0x55ca12(0x174))/0x6)+-parseInt(_0x55ca12(0x16c))/0x7+-parseInt(_0x55ca12(0x163))/0x8+-parseInt(_0x55ca12(0x161))/0x9*(-parseInt(_0x55ca12(0x186))/0xa);if(_0x2dd701===_0x4512f9)break;else _0x4c93a5['push'](_0x4c93a5['shift']());}catch(_0x49efa2){_0x4c93a5['push'](_0x4c93a5['shift']());}}}(a56_0x4b61,0x19bf8));import a56_0x34d8a5 from'node:fs';import a56_0x3b0fe6 from'node:path';function a56_0x3cdd(_0x32732d,_0x243854){const _0x4b61bd=a56_0x4b61();return a56_0x3cdd=function(_0x3cdd21,_0x27e9c4){_0x3cdd21=_0x3cdd21-0x161;let _0x528e31=_0x4b61bd[_0x3cdd21];return _0x528e31;},a56_0x3cdd(_0x32732d,_0x243854);}import{logger}from'./logger.js';export class RouterUpdater{[a56_0x2ef250(0x179)];constructor(_0x36edfb){const _0x4ba485=a56_0x2ef250;this[_0x4ba485(0x179)]=a56_0x3b0fe6[_0x4ba485(0x164)](_0x36edfb,_0x4ba485(0x16d),_0x4ba485(0x16e),'index.tsx');}async[a56_0x2ef250(0x18a)](_0x5dcd98,_0x1e9edb){const _0x4ca219=a56_0x2ef250;if(!a56_0x34d8a5['existsSync'](this[_0x4ca219(0x179)]))throw new Error(_0x4ca219(0x165)+this[_0x4ca219(0x179)]);const _0x2c5ef6=Date[_0x4ca219(0x17a)]();logger['info'](_0x4ca219(0x16e),_0x4ca219(0x162),{'pageName':_0x5dcd98,'routePath':_0x1e9edb,'file':this[_0x4ca219(0x179)]});try{const _0x1176bb=await a56_0x34d8a5['promises'][_0x4ca219(0x171)](this['routerFilePath'],_0x4ca219(0x182)),_0x15e490=this[_0x4ca219(0x17f)](_0x5dcd98),_0x25e8a1=this[_0x4ca219(0x178)](_0x1176bb,_0x15e490,_0x5dcd98),_0x105a74=this['addRoute'](_0x25e8a1,_0x1e9edb,_0x15e490);await a56_0x34d8a5[_0x4ca219(0x173)]['writeFile'](this[_0x4ca219(0x179)],_0x105a74,_0x4ca219(0x182));const _0xe3b378=Date[_0x4ca219(0x17a)]()-_0x2c5ef6;logger[_0x4ca219(0x18d)]('router',_0x4ca219(0x185),_0xe3b378,{'pageName':_0x5dcd98,'routePath':_0x1e9edb,'componentName':_0x15e490});}catch(_0x585414){const _0x1abd06=Date[_0x4ca219(0x17a)]()-_0x2c5ef6;logger[_0x4ca219(0x177)](_0x4ca219(0x16e),_0x4ca219(0x167),{'pageName':_0x5dcd98,'routePath':_0x1e9edb,'error':_0x585414 instanceof Error?_0x585414['message']:String(_0x585414),'duration':_0x1abd06});throw _0x585414;}}[a56_0x2ef250(0x17f)](_0x32456f){const _0x3480cc=a56_0x2ef250;return _0x32456f[_0x3480cc(0x188)]('-')[_0x3480cc(0x17d)](_0xe7d78e=>_0xe7d78e[_0x3480cc(0x187)](0x0)[_0x3480cc(0x17b)]()+_0xe7d78e[_0x3480cc(0x166)](0x1)[_0x3480cc(0x180)]())[_0x3480cc(0x164)]('');}[a56_0x2ef250(0x178)](_0x271fab,_0x35d8cb,_0x14fe2a){const _0x4b8a9b=a56_0x2ef250,_0x550fb0=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x110379=_0x271fab[_0x4b8a9b(0x184)](_0x550fb0)||[],_0x484181=_0x4b8a9b(0x18c)+_0x35d8cb+_0x4b8a9b(0x181)+_0x14fe2a+'\x22;';if(_0x271fab[_0x4b8a9b(0x16a)](_0x484181))return _0x271fab;if(_0x110379['length']>0x0){const _0x243cdb=_0x110379[_0x110379['length']-0x1];if(_0x243cdb){const _0x342de3=_0x271fab['lastIndexOf'](_0x243cdb),_0x44c822=_0x342de3+_0x243cdb[_0x4b8a9b(0x169)];return _0x271fab[_0x4b8a9b(0x166)](0x0,_0x44c822)+_0x484181+'\x0a'+_0x271fab['slice'](_0x44c822);}}const _0x371386=_0x271fab['match'](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x371386&&_0x371386[_0x4b8a9b(0x16f)]!==undefined){const _0x9f5b0a=_0x371386[_0x4b8a9b(0x16f)]+_0x371386[0x0][_0x4b8a9b(0x169)];return _0x271fab['slice'](0x0,_0x9f5b0a)+_0x484181+'\x0a'+_0x271fab[_0x4b8a9b(0x166)](_0x9f5b0a);}return _0x271fab;}['addRoute'](_0x1a0206,_0x5ed083,_0xea23b){const _0x32c754=a56_0x2ef250,_0x555e13=_0x32c754(0x18b)+_0x5ed083+_0x32c754(0x189)+_0xea23b+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x1a0206['includes']('path:\x20\x22'+_0x5ed083+'\x22'))return _0x1a0206;const _0x1c324c=/children:\s*\[([\s\S]*?)\]/,_0x2c91c1=_0x1a0206[_0x32c754(0x184)](_0x1c324c);if(!_0x2c91c1||_0x2c91c1[_0x32c754(0x16f)]===undefined)throw new Error(_0x32c754(0x16b));const _0x1bf9dc=_0x2c91c1[0x1],_0x12b966=_0x2c91c1[_0x32c754(0x16f)]+_0x2c91c1[0x0]['indexOf']('[')+0x1,_0x1a3b8b=_0x1bf9dc?.[_0x32c754(0x184)](/\{[\s\S]*?\},/g)||[];if(_0x1a3b8b['length']>0x0){const _0x277fe6=_0x1a3b8b[_0x1a3b8b[_0x32c754(0x169)]-0x1];if(_0x277fe6){const _0x39b19d=_0x1a0206['lastIndexOf'](_0x277fe6),_0x17365a=_0x39b19d+_0x277fe6[_0x32c754(0x169)];return _0x1a0206[_0x32c754(0x166)](0x0,_0x17365a)+'\x0a'+_0x555e13+_0x1a0206[_0x32c754(0x166)](_0x17365a);}}return _0x1a0206[_0x32c754(0x166)](0x0,_0x12b966)+'\x0a'+_0x555e13+_0x1a0206[_0x32c754(0x166)](_0x12b966);}async[a56_0x2ef250(0x168)](_0x18e045,_0x4c5385){const _0x12a6cf=a56_0x2ef250;if(!a56_0x34d8a5[_0x12a6cf(0x176)](this[_0x12a6cf(0x179)]))throw new Error('路由文件不存在:\x20'+this[_0x12a6cf(0x179)]);const _0xae884e=await a56_0x34d8a5[_0x12a6cf(0x173)][_0x12a6cf(0x171)](this['routerFilePath'],_0x12a6cf(0x182)),_0x74fa0d=this[_0x12a6cf(0x17f)](_0x18e045);let _0x47f4af=this[_0x12a6cf(0x178)](_0xae884e,_0x74fa0d,_0x18e045);return _0x47f4af=this[_0x12a6cf(0x17e)](_0x47f4af,_0x4c5385,_0x74fa0d),_0x47f4af;}}
1
+ const a59_0x41f042=a59_0x9b4e;(function(_0x5fc06a,_0x500537){const _0x420abb=a59_0x9b4e,_0x4ef3e0=_0x5fc06a();while(!![]){try{const _0x5d14d6=-parseInt(_0x420abb(0x1a4))/0x1+parseInt(_0x420abb(0x1c8))/0x2*(parseInt(_0x420abb(0x1c4))/0x3)+parseInt(_0x420abb(0x1bc))/0x4+parseInt(_0x420abb(0x1b6))/0x5*(-parseInt(_0x420abb(0x1b2))/0x6)+parseInt(_0x420abb(0x1aa))/0x7*(-parseInt(_0x420abb(0x1a9))/0x8)+parseInt(_0x420abb(0x1ac))/0x9*(parseInt(_0x420abb(0x1b4))/0xa)+-parseInt(_0x420abb(0x1ad))/0xb*(-parseInt(_0x420abb(0x1a5))/0xc);if(_0x5d14d6===_0x500537)break;else _0x4ef3e0['push'](_0x4ef3e0['shift']());}catch(_0x4e525c){_0x4ef3e0['push'](_0x4ef3e0['shift']());}}}(a59_0x453f,0x28c88));function a59_0x9b4e(_0x3694bf,_0x3dcd30){_0x3694bf=_0x3694bf-0x19e;const _0x453f41=a59_0x453f();let _0x9b4e15=_0x453f41[_0x3694bf];return _0x9b4e15;}import a59_0x28bed2 from'node:fs';function a59_0x453f(){const _0x4bba51=['index.tsx','path:\x20\x22','toComponentName','charAt','indexOf','146888QyZSnr','3852aGNTlP','utf8','promises','开始更新路由配置','344VgehxI','2863QpYPDj','readFile','10305uNodsM','1804KxyuZE','lastIndexOf','map','router','import\x20','6kTIHxb','includes','2330THgERO','existsSync','529145wAXgfN','match','routerFilePath','addPageRoute','info','addRoute','414212wIrdJt','\x20from\x20\x22../pages/','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','路由文件不存在:\x20','length','slice','split','join','6fByYXK','index','error','previewChanges','14370ZQMbpm','未找到路由配置的\x20children\x20数组','now','addImport'];a59_0x453f=function(){return _0x4bba51;};return a59_0x453f();}import a59_0x58b2c7 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x41f042(0x1b8)];constructor(_0x437c42){const _0x3c49e8=a59_0x41f042;this[_0x3c49e8(0x1b8)]=a59_0x58b2c7['join'](_0x437c42,'src','router',_0x3c49e8(0x19f));}async[a59_0x41f042(0x1b9)](_0x2e49cb,_0x17167c){const _0x21d59a=a59_0x41f042;if(!a59_0x28bed2[_0x21d59a(0x1b5)](this[_0x21d59a(0x1b8)]))throw new Error('路由文件不存在:\x20'+this[_0x21d59a(0x1b8)]);const _0x1dfd7f=Date[_0x21d59a(0x1ca)]();logger[_0x21d59a(0x1ba)](_0x21d59a(0x1b0),_0x21d59a(0x1a8),{'pageName':_0x2e49cb,'routePath':_0x17167c,'file':this[_0x21d59a(0x1b8)]});try{const _0x343a81=await a59_0x28bed2[_0x21d59a(0x1a7)][_0x21d59a(0x1ab)](this[_0x21d59a(0x1b8)],_0x21d59a(0x1a6)),_0x59a424=this[_0x21d59a(0x1a1)](_0x2e49cb),_0x31d6b4=this[_0x21d59a(0x19e)](_0x343a81,_0x59a424,_0x2e49cb),_0x1a6290=this[_0x21d59a(0x1bb)](_0x31d6b4,_0x17167c,_0x59a424);await a59_0x28bed2[_0x21d59a(0x1a7)]['writeFile'](this[_0x21d59a(0x1b8)],_0x1a6290,_0x21d59a(0x1a6));const _0xc89b1e=Date[_0x21d59a(0x1ca)]()-_0x1dfd7f;logger['success'](_0x21d59a(0x1b0),'路由配置更新完成',_0xc89b1e,{'pageName':_0x2e49cb,'routePath':_0x17167c,'componentName':_0x59a424});}catch(_0x419a76){const _0x1ebb63=Date['now']()-_0x1dfd7f;logger[_0x21d59a(0x1c6)](_0x21d59a(0x1b0),'路由配置更新失败',{'pageName':_0x2e49cb,'routePath':_0x17167c,'error':_0x419a76 instanceof Error?_0x419a76['message']:String(_0x419a76),'duration':_0x1ebb63});throw _0x419a76;}}[a59_0x41f042(0x1a1)](_0x4c22cd){const _0x366f26=a59_0x41f042;return _0x4c22cd[_0x366f26(0x1c2)]('-')[_0x366f26(0x1af)](_0x5af8a6=>_0x5af8a6[_0x366f26(0x1a2)](0x0)['toUpperCase']()+_0x5af8a6[_0x366f26(0x1c1)](0x1)['toLowerCase']())[_0x366f26(0x1c3)]('');}[a59_0x41f042(0x19e)](_0x183622,_0x3370df,_0xf8dd9e){const _0x400391=a59_0x41f042,_0x538360=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x3f9419=_0x183622['match'](_0x538360)||[],_0x5bf19a=_0x400391(0x1b1)+_0x3370df+_0x400391(0x1bd)+_0xf8dd9e+'\x22;';if(_0x183622['includes'](_0x5bf19a))return _0x183622;if(_0x3f9419[_0x400391(0x1c0)]>0x0){const _0x4c2361=_0x3f9419[_0x3f9419[_0x400391(0x1c0)]-0x1];if(_0x4c2361){const _0xa94818=_0x183622['lastIndexOf'](_0x4c2361),_0x35302a=_0xa94818+_0x4c2361[_0x400391(0x1c0)];return _0x183622[_0x400391(0x1c1)](0x0,_0x35302a)+_0x5bf19a+'\x0a'+_0x183622['slice'](_0x35302a);}}const _0x50779b=_0x183622[_0x400391(0x1b7)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x50779b&&_0x50779b[_0x400391(0x1c5)]!==undefined){const _0x27c17f=_0x50779b['index']+_0x50779b[0x0][_0x400391(0x1c0)];return _0x183622['slice'](0x0,_0x27c17f)+_0x5bf19a+'\x0a'+_0x183622[_0x400391(0x1c1)](_0x27c17f);}return _0x183622;}['addRoute'](_0x4191fe,_0x299d1e,_0x3871ed){const _0x279dda=a59_0x41f042,_0x1b45e6='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x299d1e+_0x279dda(0x1be)+_0x3871ed+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x4191fe[_0x279dda(0x1b3)](_0x279dda(0x1a0)+_0x299d1e+'\x22'))return _0x4191fe;const _0x54edb8=/children:\s*\[([\s\S]*?)\]/,_0x157e60=_0x4191fe[_0x279dda(0x1b7)](_0x54edb8);if(!_0x157e60||_0x157e60[_0x279dda(0x1c5)]===undefined)throw new Error(_0x279dda(0x1c9));const _0x31d323=_0x157e60[0x1],_0x5a8643=_0x157e60['index']+_0x157e60[0x0][_0x279dda(0x1a3)]('[')+0x1,_0x12a4e8=_0x31d323?.[_0x279dda(0x1b7)](/\{[\s\S]*?\},/g)||[];if(_0x12a4e8[_0x279dda(0x1c0)]>0x0){const _0x956e27=_0x12a4e8[_0x12a4e8[_0x279dda(0x1c0)]-0x1];if(_0x956e27){const _0x3da0cd=_0x4191fe[_0x279dda(0x1ae)](_0x956e27),_0x15e307=_0x3da0cd+_0x956e27[_0x279dda(0x1c0)];return _0x4191fe[_0x279dda(0x1c1)](0x0,_0x15e307)+'\x0a'+_0x1b45e6+_0x4191fe[_0x279dda(0x1c1)](_0x15e307);}}return _0x4191fe['slice'](0x0,_0x5a8643)+'\x0a'+_0x1b45e6+_0x4191fe['slice'](_0x5a8643);}async[a59_0x41f042(0x1c7)](_0xd40fa9,_0x4b210d){const _0x5edeba=a59_0x41f042;if(!a59_0x28bed2['existsSync'](this[_0x5edeba(0x1b8)]))throw new Error(_0x5edeba(0x1bf)+this[_0x5edeba(0x1b8)]);const _0x1ad5e0=await a59_0x28bed2[_0x5edeba(0x1a7)][_0x5edeba(0x1ab)](this['routerFilePath'],_0x5edeba(0x1a6)),_0x3e0e14=this[_0x5edeba(0x1a1)](_0xd40fa9);let _0x5df666=this[_0x5edeba(0x19e)](_0x1ad5e0,_0x3e0e14,_0xd40fa9);return _0x5df666=this['addRoute'](_0x5df666,_0x4b210d,_0x3e0e14),_0x5df666;}}
@@ -1 +1 @@
1
- export function sleep(_0x5db0ba){return new Promise(_0x57dcc2=>setTimeout(_0x57dcc2,_0x5db0ba));}
1
+ export function sleep(_0x4e0c91){return new Promise(_0x56f103=>setTimeout(_0x56f103,_0x4e0c91));}
@@ -1 +1 @@
1
- const a58_0x181f98=a58_0x1412;function a58_0xbd26(){const _0x2342d8=['360580kPkiML','3BCeyws','模板内容替换完成','replaceApiContent','toLocaleDateString','78Yaxjer','mkdir','includes','.css','toLowerCase','keys','map','48zWCCJl','toDisplayTitle','6019536OmXJSI','join','4420uEYdwd','processTemplate','extname','.ts','api','2-digit','charAt','14113ZtgpZP','copyFile','readFile','utf8','writeFile','promises','replaceContent','name','toISOString','toLocaleString','196RXeorg','1YTPETR','toComponentName','YourModel','isFile','processDirectory','template','toLocaleTimeString','718442ljyUNF','slice','开始处理模板内容替换','toUpperCase','7488207KuxbWU','.jsx','success','isDirectory','numeric','137024vpOWfD','replace','.scss','endsWith','.json','3362356jiRDhG','split','now','.tpl','default','.tsx'];a58_0xbd26=function(){return _0x2342d8;};return a58_0xbd26();}function a58_0x1412(_0x24690f,_0x51a050){const _0xbd2689=a58_0xbd26();return a58_0x1412=function(_0x1412df,_0x3824a2){_0x1412df=_0x1412df-0xc1;let _0x205ddc=_0xbd2689[_0x1412df];return _0x205ddc;},a58_0x1412(_0x24690f,_0x51a050);}(function(_0x127b7f,_0x33459f){const _0x594653=a58_0x1412,_0x460dc0=_0x127b7f();while(!![]){try{const _0x472312=-parseInt(_0x594653(0xe9))/0x1*(parseInt(_0x594653(0xf0))/0x2)+parseInt(_0x594653(0xc8))/0x3*(-parseInt(_0x594653(0xc1))/0x4)+-parseInt(_0x594653(0xc7))/0x5*(-parseInt(_0x594653(0xd3))/0x6)+-parseInt(_0x594653(0xe8))/0x7*(parseInt(_0x594653(0xf9))/0x8)+-parseInt(_0x594653(0xf4))/0x9+parseInt(_0x594653(0xd7))/0xa*(-parseInt(_0x594653(0xde))/0xb)+-parseInt(_0x594653(0xd5))/0xc*(-parseInt(_0x594653(0xcc))/0xd);if(_0x472312===_0x33459f)break;else _0x460dc0['push'](_0x460dc0['shift']());}catch(_0x4a7790){_0x460dc0['push'](_0x460dc0['shift']());}}}(a58_0xbd26,0x7c121));import a58_0x25dcdd from'node:fs';import a58_0x54732c from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a58_0x181f98(0xea)](_0xb10a98){const _0x84af53=a58_0x181f98,_0x288f22=_0xb10a98[_0x84af53(0xc2)]('/')['pop']()||_0xb10a98;return _0x288f22[_0x84af53(0xc2)]('-')[_0x84af53(0xd2)](_0x3dd413=>_0x3dd413[_0x84af53(0xdd)](0x0)[_0x84af53(0xf3)]()+_0x3dd413['slice'](0x1)['toLowerCase']())['join']('');}static[a58_0x181f98(0xd4)](_0x268320){const _0x23b53c=a58_0x181f98,_0x2fcc75=_0x268320[_0x23b53c(0xc2)]('/')['pop']()||_0x268320;return _0x2fcc75[_0x23b53c(0xc2)]('-')[_0x23b53c(0xd2)](_0x399d05=>_0x399d05[_0x23b53c(0xdd)](0x0)[_0x23b53c(0xf3)]()+_0x399d05[_0x23b53c(0xf1)](0x1)[_0x23b53c(0xd0)]())[_0x23b53c(0xd6)]('\x20');}static[a58_0x181f98(0xe4)](_0x39f6c0,_0x165853,_0x40bcc0){const _0x2c89f6=a58_0x181f98,_0x5eb135=this['toComponentName'](_0x165853),_0x3e2b15=this[_0x2c89f6(0xd4)](_0x165853),_0x1609d3=new Date(),_0x4050b5=_0x1609d3[_0x2c89f6(0xe7)](undefined,{'year':_0x2c89f6(0xf8),'month':_0x2c89f6(0xdc),'day':_0x2c89f6(0xdc),'hour':_0x2c89f6(0xdc),'minute':'2-digit','second':'2-digit','hour12':![]})[_0x2c89f6(0xfa)](/\//g,'-'),_0x2be554=_0x1609d3[_0x2c89f6(0xcb)](undefined,{'year':_0x2c89f6(0xf8),'month':'2-digit','day':_0x2c89f6(0xdc)})[_0x2c89f6(0xfa)](/\//g,'-'),_0x2e404f=_0x1609d3[_0x2c89f6(0xef)](undefined,{'hour12':![]});let _0x53b098=_0x39f6c0[_0x2c89f6(0xfa)](/\{ComponentName\}/g,_0x5eb135)[_0x2c89f6(0xfa)](/\{DisplayTitle\}/g,_0x3e2b15)['replace'](/\{PageName\}/g,_0x165853)[_0x2c89f6(0xfa)](/\{TemplateName\}/g,_0x40bcc0)[_0x2c89f6(0xfa)](/\{CreatedAt\}/g,_0x4050b5)[_0x2c89f6(0xfa)](/\{CreatedDate\}/g,_0x2be554)[_0x2c89f6(0xfa)](/\{CreatedTime\}/g,_0x2e404f);return _0x53b098;}static[a58_0x181f98(0xca)](_0x24ff00,_0x1291a0,_0x141819,_0x3a7002,_0x1fe726,_0x21f7da,_0x5ee31b){const _0x5c038a=a58_0x181f98,_0x36115b=new Date(),_0x2fe14f=_0x36115b[_0x5c038a(0xe6)](),_0x3c1d3e=JSON['stringify'](_0x141819,null,0x2)[_0x5c038a(0xc2)]('\x0a')[_0x5c038a(0xf1)](0x1,-0x1)[_0x5c038a(0xd2)](_0x1f8a03=>_0x1f8a03[_0x5c038a(0xfa)](/^ /,'\x20\x20\x20\x20'))[_0x5c038a(0xd6)]('\x0a'),_0xb6eed9=_0x3a7002||Object[_0x5c038a(0xd1)](_0x141819)[0x0]||_0x5c038a(0xeb);let _0x403b88=_0x24ff00[_0x5c038a(0xfa)](/\{AppCode\}/g,_0x1291a0)[_0x5c038a(0xfa)](/\{ModelConfigs\}/g,_0x3c1d3e)['replace'](/\{ExampleModelName\}/g,_0xb6eed9)[_0x5c038a(0xfa)](/\{ApiFileName\}/g,_0x1fe726||_0x5c038a(0xdb))[_0x5c038a(0xfa)](/\{ConfigName\}/g,_0x21f7da||_0x5c038a(0xc5))[_0x5c038a(0xfa)](/\{ClientConfigParam\}/g,_0x5ee31b||'')['replace'](/\{CreatedAt\}/g,_0x2fe14f);return _0x403b88;}static async[a58_0x181f98(0xd8)](_0x58aa1c,_0x3e8664,_0x8ef161,_0x354e37,_0x515424=!![]){const _0x12fdc7=a58_0x181f98,_0x4742fa=Date[_0x12fdc7(0xc3)]();try{_0x515424&&logger['info'](_0x12fdc7(0xee),_0x12fdc7(0xf2),{'templatePath':_0x58aa1c,'targetPath':_0x3e8664,'pageName':_0x8ef161,'templateName':_0x354e37});await a58_0x25dcdd[_0x12fdc7(0xe3)][_0x12fdc7(0xcd)](_0x3e8664,{'recursive':!![]}),await this['processDirectory'](_0x58aa1c,_0x3e8664,_0x8ef161,_0x354e37);if(_0x515424){const _0x42678e=Date[_0x12fdc7(0xc3)]()-_0x4742fa;logger[_0x12fdc7(0xf6)](_0x12fdc7(0xee),_0x12fdc7(0xc9),_0x42678e,{'pageName':_0x8ef161,'templateName':_0x354e37});}}catch(_0x1d980f){if(_0x515424){const _0x1a1f8e=Date[_0x12fdc7(0xc3)]()-_0x4742fa;logger['error'](_0x12fdc7(0xee),'模板内容替换失败',{'templatePath':_0x58aa1c,'targetPath':_0x3e8664,'pageName':_0x8ef161,'templateName':_0x354e37,'error':_0x1d980f instanceof Error?_0x1d980f['message']:String(_0x1d980f),'duration':_0x1a1f8e});}throw _0x1d980f;}}static async['processDirectory'](_0x5e14be,_0x4f66f6,_0x2de6aa,_0x5c24ec){const _0x39b757=a58_0x181f98,_0x470e41=await a58_0x25dcdd[_0x39b757(0xe3)]['readdir'](_0x5e14be,{'withFileTypes':!![]});for(const _0xa676f6 of _0x470e41){const _0xed0925=a58_0x54732c[_0x39b757(0xd6)](_0x5e14be,_0xa676f6[_0x39b757(0xe5)]);let _0x423ed9=a58_0x54732c['join'](_0x4f66f6,_0xa676f6['name']);_0xa676f6[_0x39b757(0xe5)][_0x39b757(0xfc)](_0x39b757(0xc4))&&(_0x423ed9=a58_0x54732c[_0x39b757(0xd6)](_0x4f66f6,_0xa676f6[_0x39b757(0xe5)][_0x39b757(0xfa)](/\.tpl$/,'')));if(_0xa676f6[_0x39b757(0xf7)]())await a58_0x25dcdd[_0x39b757(0xe3)]['mkdir'](_0x423ed9,{'recursive':!![]}),await this[_0x39b757(0xed)](_0xed0925,_0x423ed9,_0x2de6aa,_0x5c24ec);else _0xa676f6[_0x39b757(0xec)]()&&await this['processFile'](_0xed0925,_0x423ed9,_0x2de6aa,_0x5c24ec);}}static async['processFile'](_0x13a1ea,_0x368a94,_0x432c15,_0x2f4c4f){const _0x4c50c4=a58_0x181f98,_0x31387c=a58_0x54732c[_0x4c50c4(0xd9)](_0x13a1ea)['toLowerCase']();_0x13a1ea[_0x4c50c4(0xfc)](_0x4c50c4(0xc4))&&(_0x368a94=_0x368a94[_0x4c50c4(0xfa)](/\.tpl$/,''));const _0x27af83=[_0x4c50c4(0xc6),_0x4c50c4(0xda),_0x4c50c4(0xf5),'.js',_0x4c50c4(0xfd),'.md',_0x4c50c4(0xcf),_0x4c50c4(0xfb),'.tpl'];if(_0x27af83[_0x4c50c4(0xce)](_0x31387c)||_0x13a1ea['endsWith'](_0x4c50c4(0xc4))){const _0x5e86fe=await a58_0x25dcdd[_0x4c50c4(0xe3)][_0x4c50c4(0xe0)](_0x13a1ea,'utf8'),_0x79540=this[_0x4c50c4(0xe4)](_0x5e86fe,_0x432c15,_0x2f4c4f);await a58_0x25dcdd['promises'][_0x4c50c4(0xe2)](_0x368a94,_0x79540,_0x4c50c4(0xe1));}else await a58_0x25dcdd[_0x4c50c4(0xe3)][_0x4c50c4(0xdf)](_0x13a1ea,_0x368a94);}}
1
+ const a61_0x4ec784=a61_0x4b0b;(function(_0x4510b9,_0x15adc2){const _0x51e0d1=a61_0x4b0b,_0x1bcaa8=_0x4510b9();while(!![]){try{const _0x3f3544=parseInt(_0x51e0d1(0x1fc))/0x1*(-parseInt(_0x51e0d1(0x1cc))/0x2)+parseInt(_0x51e0d1(0x1f4))/0x3+-parseInt(_0x51e0d1(0x1ef))/0x4+parseInt(_0x51e0d1(0x1ec))/0x5*(parseInt(_0x51e0d1(0x202))/0x6)+parseInt(_0x51e0d1(0x1d6))/0x7+parseInt(_0x51e0d1(0x205))/0x8*(-parseInt(_0x51e0d1(0x1f3))/0x9)+-parseInt(_0x51e0d1(0x1ed))/0xa*(-parseInt(_0x51e0d1(0x1d1))/0xb);if(_0x3f3544===_0x15adc2)break;else _0x1bcaa8['push'](_0x1bcaa8['shift']());}catch(_0x4e7758){_0x1bcaa8['push'](_0x1bcaa8['shift']());}}}(a61_0x6a65,0xa6dbc));import a61_0x3a1d2f from'node:fs';function a61_0x4b0b(_0x507da3,_0x47fa97){_0x507da3=_0x507da3-0x1cc;const _0x6a6532=a61_0x6a65();let _0x4b0b66=_0x6a6532[_0x507da3];return _0x4b0b66;}import a61_0x423fc8 from'node:path';function a61_0x6a65(){const _0x250f19=['endsWith','now','toLocaleDateString','error','mkdir','.ts','.jsx','numeric','map','pop','.tpl','extname','开始处理模板内容替换','replaceContent','join','toComponentName','processDirectory','promises','2646305BZBUvb','570ljDlEw','.scss','518284mfHfUh','.js','template','isFile','203382SzwYKi','2689521usEUTG','utf8','.tsx','api','toDisplayTitle','message','info','charAt','490558oYXFLk','readdir','toLowerCase','replace','processTemplate','toISOString','6dYxLXM','.json','processFile','80lEjQMP','4cKGBRw','stringify','2-digit','name','slice','12419OCbxwR','copyFile','replaceApiContent','readFile','isDirectory','3709986OkXoWd','split','includes','toUpperCase'];a61_0x6a65=function(){return _0x250f19;};return a61_0x6a65();}import{logger}from'./logger.js';export class TemplateReplacer{static[a61_0x4ec784(0x1e9)](_0x596544){const _0x92a19a=a61_0x4ec784,_0x24fded=_0x596544[_0x92a19a(0x1d7)]('/')['pop']()||_0x596544;return _0x24fded['split']('-')[_0x92a19a(0x1e2)](_0x5b5a65=>_0x5b5a65[_0x92a19a(0x1fb)](0x0)[_0x92a19a(0x1d9)]()+_0x5b5a65['slice'](0x1)[_0x92a19a(0x1fe)]())[_0x92a19a(0x1e8)]('');}static['toDisplayTitle'](_0x2431bc){const _0x16b32e=a61_0x4ec784,_0x2ed14e=_0x2431bc[_0x16b32e(0x1d7)]('/')[_0x16b32e(0x1e3)]()||_0x2431bc;return _0x2ed14e[_0x16b32e(0x1d7)]('-')[_0x16b32e(0x1e2)](_0x2d700f=>_0x2d700f['charAt'](0x0)[_0x16b32e(0x1d9)]()+_0x2d700f[_0x16b32e(0x1d0)](0x1)['toLowerCase']())['join']('\x20');}static[a61_0x4ec784(0x1e7)](_0x140777,_0x2f73d8,_0x54bdb8){const _0x2e7b76=a61_0x4ec784,_0x4cc83a=this['toComponentName'](_0x2f73d8),_0x44d40e=this[_0x2e7b76(0x1f8)](_0x2f73d8),_0x5ac308=new Date(),_0x312e0c=_0x5ac308['toLocaleString'](undefined,{'year':_0x2e7b76(0x1e1),'month':'2-digit','day':'2-digit','hour':_0x2e7b76(0x1ce),'minute':_0x2e7b76(0x1ce),'second':_0x2e7b76(0x1ce),'hour12':![]})['replace'](/\//g,'-'),_0x365cca=_0x5ac308[_0x2e7b76(0x1dc)](undefined,{'year':_0x2e7b76(0x1e1),'month':_0x2e7b76(0x1ce),'day':_0x2e7b76(0x1ce)})[_0x2e7b76(0x1ff)](/\//g,'-'),_0x397f2b=_0x5ac308['toLocaleTimeString'](undefined,{'hour12':![]});let _0x41f245=_0x140777[_0x2e7b76(0x1ff)](/\{ComponentName\}/g,_0x4cc83a)[_0x2e7b76(0x1ff)](/\{DisplayTitle\}/g,_0x44d40e)[_0x2e7b76(0x1ff)](/\{PageName\}/g,_0x2f73d8)[_0x2e7b76(0x1ff)](/\{TemplateName\}/g,_0x54bdb8)['replace'](/\{CreatedAt\}/g,_0x312e0c)['replace'](/\{CreatedDate\}/g,_0x365cca)[_0x2e7b76(0x1ff)](/\{CreatedTime\}/g,_0x397f2b);return _0x41f245;}static[a61_0x4ec784(0x1d3)](_0x5b2a0a,_0x323a08,_0x243c7a,_0xa7046,_0x5c6411,_0x4d03c2,_0x59cb6d){const _0x24c247=a61_0x4ec784,_0x1b7398=new Date(),_0x5c439d=_0x1b7398[_0x24c247(0x201)](),_0x8671c0=JSON[_0x24c247(0x1cd)](_0x243c7a,null,0x2)[_0x24c247(0x1d7)]('\x0a')[_0x24c247(0x1d0)](0x1,-0x1)['map'](_0x50b290=>_0x50b290[_0x24c247(0x1ff)](/^ /,'\x20\x20\x20\x20'))['join']('\x0a'),_0xe6a53a=_0xa7046||Object['keys'](_0x243c7a)[0x0]||'YourModel';let _0xb330f6=_0x5b2a0a['replace'](/\{AppCode\}/g,_0x323a08)['replace'](/\{ModelConfigs\}/g,_0x8671c0)['replace'](/\{ExampleModelName\}/g,_0xe6a53a)[_0x24c247(0x1ff)](/\{ApiFileName\}/g,_0x5c6411||_0x24c247(0x1f7))[_0x24c247(0x1ff)](/\{ConfigName\}/g,_0x4d03c2||'default')['replace'](/\{ClientConfigParam\}/g,_0x59cb6d||'')[_0x24c247(0x1ff)](/\{CreatedAt\}/g,_0x5c439d);return _0xb330f6;}static async[a61_0x4ec784(0x200)](_0x3f2138,_0x35be8c,_0x1458b4,_0x533cca,_0xfc1d46=!![]){const _0x4c1d0c=a61_0x4ec784,_0x4442a5=Date[_0x4c1d0c(0x1db)]();try{_0xfc1d46&&logger[_0x4c1d0c(0x1fa)]('template',_0x4c1d0c(0x1e6),{'templatePath':_0x3f2138,'targetPath':_0x35be8c,'pageName':_0x1458b4,'templateName':_0x533cca});await a61_0x3a1d2f[_0x4c1d0c(0x1eb)][_0x4c1d0c(0x1de)](_0x35be8c,{'recursive':!![]}),await this[_0x4c1d0c(0x1ea)](_0x3f2138,_0x35be8c,_0x1458b4,_0x533cca);if(_0xfc1d46){const _0x7e91b5=Date[_0x4c1d0c(0x1db)]()-_0x4442a5;logger['success'](_0x4c1d0c(0x1f1),'模板内容替换完成',_0x7e91b5,{'pageName':_0x1458b4,'templateName':_0x533cca});}}catch(_0x57ff9a){if(_0xfc1d46){const _0x16ef3f=Date[_0x4c1d0c(0x1db)]()-_0x4442a5;logger[_0x4c1d0c(0x1dd)](_0x4c1d0c(0x1f1),'模板内容替换失败',{'templatePath':_0x3f2138,'targetPath':_0x35be8c,'pageName':_0x1458b4,'templateName':_0x533cca,'error':_0x57ff9a instanceof Error?_0x57ff9a[_0x4c1d0c(0x1f9)]:String(_0x57ff9a),'duration':_0x16ef3f});}throw _0x57ff9a;}}static async[a61_0x4ec784(0x1ea)](_0x55945c,_0x17fa40,_0x56923a,_0xda387c){const _0x50edb5=a61_0x4ec784,_0x42de76=await a61_0x3a1d2f[_0x50edb5(0x1eb)][_0x50edb5(0x1fd)](_0x55945c,{'withFileTypes':!![]});for(const _0x3552a6 of _0x42de76){const _0x578527=a61_0x423fc8[_0x50edb5(0x1e8)](_0x55945c,_0x3552a6[_0x50edb5(0x1cf)]);let _0x136381=a61_0x423fc8[_0x50edb5(0x1e8)](_0x17fa40,_0x3552a6[_0x50edb5(0x1cf)]);_0x3552a6['name'][_0x50edb5(0x1da)](_0x50edb5(0x1e4))&&(_0x136381=a61_0x423fc8[_0x50edb5(0x1e8)](_0x17fa40,_0x3552a6[_0x50edb5(0x1cf)][_0x50edb5(0x1ff)](/\.tpl$/,'')));if(_0x3552a6[_0x50edb5(0x1d5)]())await a61_0x3a1d2f[_0x50edb5(0x1eb)]['mkdir'](_0x136381,{'recursive':!![]}),await this[_0x50edb5(0x1ea)](_0x578527,_0x136381,_0x56923a,_0xda387c);else _0x3552a6[_0x50edb5(0x1f2)]()&&await this[_0x50edb5(0x204)](_0x578527,_0x136381,_0x56923a,_0xda387c);}}static async['processFile'](_0x3b9bc8,_0x3849e0,_0xecdd0f,_0x5105fa){const _0x45626d=a61_0x4ec784,_0xb3f945=a61_0x423fc8[_0x45626d(0x1e5)](_0x3b9bc8)[_0x45626d(0x1fe)]();_0x3b9bc8[_0x45626d(0x1da)](_0x45626d(0x1e4))&&(_0x3849e0=_0x3849e0[_0x45626d(0x1ff)](/\.tpl$/,''));const _0x5edeed=[_0x45626d(0x1f6),_0x45626d(0x1df),_0x45626d(0x1e0),_0x45626d(0x1f0),_0x45626d(0x203),'.md','.css',_0x45626d(0x1ee),_0x45626d(0x1e4)];if(_0x5edeed[_0x45626d(0x1d8)](_0xb3f945)||_0x3b9bc8[_0x45626d(0x1da)](_0x45626d(0x1e4))){const _0x18972a=await a61_0x3a1d2f[_0x45626d(0x1eb)][_0x45626d(0x1d4)](_0x3b9bc8,_0x45626d(0x1f5)),_0x1bba86=this[_0x45626d(0x1e7)](_0x18972a,_0xecdd0f,_0x5105fa);await a61_0x3a1d2f[_0x45626d(0x1eb)]['writeFile'](_0x3849e0,_0x1bba86,'utf8');}else await a61_0x3a1d2f[_0x45626d(0x1eb)][_0x45626d(0x1d2)](_0x3b9bc8,_0x3849e0);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.1.26-beta.9",
3
+ "version": "1.1.26",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"