@lovrabet/cli 1.1.26-beta.8 → 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(_0x3c5a95,_0x4aec1b){const _0x1bf6df=a49_0x43a4,_0x41fd24=_0x3c5a95();while(!![]){try{const _0x205a9f=parseInt(_0x1bf6df(0x11c))/0x1*(-parseInt(_0x1bf6df(0x101))/0x2)+parseInt(_0x1bf6df(0xf9))/0x3+parseInt(_0x1bf6df(0xf3))/0x4*(-parseInt(_0x1bf6df(0xfa))/0x5)+parseInt(_0x1bf6df(0x114))/0x6*(parseInt(_0x1bf6df(0xf2))/0x7)+-parseInt(_0x1bf6df(0xec))/0x8+-parseInt(_0x1bf6df(0x100))/0x9*(-parseInt(_0x1bf6df(0x113))/0xa)+parseInt(_0x1bf6df(0x11b))/0xb;if(_0x205a9f===_0x4aec1b)break;else _0x41fd24['push'](_0x41fd24['shift']());}catch(_0x2003ea){_0x41fd24['push'](_0x41fd24['shift']());}}}(a49_0xb5e8,0xb02b4));import{jsxs as a49_0x2b5ea5,jsx as a49_0xab992}from'react/jsx-runtime';function a49_0x43a4(_0x1c54f1,_0x3c7401){const _0xb5e873=a49_0xb5e8();return a49_0x43a4=function(_0x43a44f,_0x2b1b45){_0x43a44f=_0x43a44f-0xea;let _0x54a573=_0xb5e873[_0x43a44f];return _0x54a573;},a49_0x43a4(_0x1c54f1,_0x3c7401);}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';function a49_0xb5e8(){const _0x24a224=['utf8','应用代码只能包含字母、数字、-\x20和\x20_','setLogPath','1314006oflDcm','5eYKBVi','toLocaleString','1.0.0','slice','length','green','405UvXIVa','1996hjdfoj','创建配置文件失败','message','应用代码不能为空','cyan','version','../..','.lovrabetrc','return','string','gray','exit','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','\x20←\x20','AppCode:\x20','stringify','正在初始化配置文件...','red','245510CZqUBp','702cbXmQF','init','env','请输入应用代码\x20(AppCode):\x20','应用代码不合法','初始化项目配置文件成功','test','16490606fjxMUl','1097bjYBPY','cwd','trim','5690416wwZiDa','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','column','online','url','error','9709zrzLis','2706104iEtVDa','创建配置文件失败:\x20','应用代码长度不能超过\x20100\x20个字符'];a49_0xb5e8=function(){return _0x24a224;};return a49_0xb5e8();}import{readConfig}from'../utils/config.js';export function Init({appcode:_0x46bf6d,env:_0x577454}){const _0x3322b6=a49_0x43a4,[_0x3ea506,_0x1aef1e]=useState(null),[_0x488d78,_0x50cd4d]=useState(![]),[_0x319234,_0x29cc75]=useState(!_0x46bf6d),[_0x1228e1,_0x574ed7]=useState(''),[_0x1e36c8,_0x1a1b6a]=useState(''),[_0x45cc42,_0x3e0432]=useState(_0x46bf6d||''),[_0x1d7a1e]=useState(_0x577454);function _0x9a9fff(_0x64b7cc){const _0x33918d=a49_0x43a4;if(_0x64b7cc['length']===0x0)return{'valid':![],'message':''};if(_0x64b7cc[_0x33918d(0xfe)]>0x64)return{'valid':![],'message':_0x33918d(0xf5)};const _0x33bfb1=/^[A-Za-z0-9_-]+$/;if(!_0x33bfb1[_0x33918d(0x11a)](_0x64b7cc))return{'valid':![],'message':_0x33918d(0xf7)};return{'valid':!![]};}useInput((_0xe0aa0b,_0x2f8f18)=>{const _0x1e6a21=a49_0x43a4;if(!_0x319234)return;if(_0x2f8f18[_0x1e6a21(0x109)]){if(_0x1e36c8||!_0x1228e1['trim']()){_0x1a1b6a(_0x1e6a21(0x104));return;}const _0x3e93ac=_0x1228e1[_0x1e6a21(0xeb)](),{valid:_0x48bed6,message:_0xe60878}=_0x9a9fff(_0x3e93ac);if(!_0x48bed6){_0x1a1b6a(_0xe60878||_0x1e6a21(0x118));return;}_0x3e0432(_0x3e93ac),_0x29cc75(![]);}else{if(_0x2f8f18['backspace']||_0x2f8f18['delete'])_0x574ed7(_0x3aad10=>{const _0x1e43c2=_0x1e6a21,_0x2f4abf=_0x3aad10[_0x1e43c2(0xfd)](0x0,-0x1);if(_0x2f4abf[_0x1e43c2(0xfe)]===0x0)_0x1a1b6a('');else{const {valid:_0x1a30c1,message:_0x54a621}=_0x9a9fff(_0x2f4abf);_0x1a1b6a(_0x1a30c1?'':_0x54a621||_0x1e43c2(0x118));}return _0x2f4abf;});else _0x2f8f18['ctrl']&&_0xe0aa0b==='c'?process[_0x1e6a21(0x10c)](0x0):_0x574ed7(_0x26e92b=>{const _0x1a93bf=_0x1e6a21,_0x5467e7=_0x26e92b+_0xe0aa0b,{valid:_0x560fe2,message:_0x3af56d}=_0x9a9fff(_0x5467e7);return _0x1a1b6a(_0x560fe2?'':_0x3af56d||_0x1a93bf(0x118)),_0x5467e7;});}},{'isActive':_0x319234}),useEffect(()=>{const _0x1ba65a=a49_0x43a4;if(!_0x45cc42||_0x319234)return;const _0xcb6170=resolve(process[_0x1ba65a(0xea)](),_0x1ba65a(0x108));if(existsSync(_0xcb6170)){_0x1aef1e('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process[_0x1ba65a(0x10c)](0x1),0x64);return;}try{const _0x7e144a=fileURLToPath(import.meta[_0x1ba65a(0xf0)]),_0x356ed0=resolve(dirname(_0x7e144a),_0x1ba65a(0x107)),_0x81ea1=join(_0x356ed0,'package.json');let _0x5a63bf=_0x1ba65a(0xfc);try{const _0x27a19d=JSON['parse'](readFileSync(_0x81ea1,'utf8'));_0x5a63bf=_0x27a19d['version']||_0x1ba65a(0xfc);}catch(_0xe2588){}const _0x2bbe0b=readConfig(),_0x2db779=typeof _0x2bbe0b['env']===_0x1ba65a(0x10a)?_0x2bbe0b[_0x1ba65a(0x116)]:undefined,{app:_0x2c6e76,appcode:_0x6d517d,..._0x821a92}=_0x2bbe0b,_0x1eb73c={..._0x821a92,'appcode':_0x45cc42,'env':_0x1d7a1e||_0x2db779||_0x1ba65a(0xef),'createdAt':new Date()[_0x1ba65a(0xfb)](),'version':_0x5a63bf};writeFileSync(_0xcb6170,JSON[_0x1ba65a(0x110)](_0x1eb73c,null,0x2),{'encoding':_0x1ba65a(0xf6),'mode':0x180}),logger[_0x1ba65a(0xf8)](process[_0x1ba65a(0xea)]()),logger['info'](_0x1ba65a(0x115),_0x1ba65a(0x119),{'appcode':_0x45cc42,'env':_0x1eb73c[_0x1ba65a(0x116)],'version':_0x1eb73c[_0x1ba65a(0x106)],'configPath':_0xcb6170}),_0x50cd4d(!![]),setTimeout(()=>process['exit'](0x0),0x64);}catch(_0x33e0cc){logger[_0x1ba65a(0xf1)](_0x1ba65a(0x115),_0x1ba65a(0x102),{'error':_0x33e0cc instanceof Error?_0x33e0cc[_0x1ba65a(0x103)]:String(_0x33e0cc)}),_0x1aef1e(_0x1ba65a(0xf4)+(_0x33e0cc instanceof Error?_0x33e0cc[_0x1ba65a(0x103)]:String(_0x33e0cc))),setTimeout(()=>process[_0x1ba65a(0x10c)](0x1),0x64);}},[_0x45cc42,_0x319234,_0x1d7a1e]);if(_0x3ea506)return a49_0xab992(Box,{'flexDirection':_0x3322b6(0xee),'children':a49_0x2b5ea5(Text,{'color':_0x3322b6(0x112),'children':['✗\x20',_0x3ea506]})});if(_0x319234)return a49_0x2b5ea5(Box,{'flexDirection':'column','children':[a49_0x2b5ea5(Box,{'children':[a49_0xab992(Text,{'color':_0x3322b6(0x105),'children':_0x3322b6(0x117)}),_0x1228e1?a49_0xab992(Text,{'color':_0x3322b6(0xff),'children':_0x1228e1}):a49_0xab992(Text,{'color':_0x3322b6(0x10b),'children':'_'}),_0x1e36c8&&a49_0x2b5ea5(Text,{'color':_0x3322b6(0x112),'children':[_0x3322b6(0x10e),_0x1e36c8]})]}),!_0x1e36c8&&!_0x1228e1&&a49_0xab992(Box,{'children':a49_0xab992(Text,{'color':_0x3322b6(0x10b),'children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x488d78)return a49_0x2b5ea5(Box,{'flexDirection':_0x3322b6(0xee),'children':[a49_0xab992(Text,{'color':_0x3322b6(0xff),'children':_0x3322b6(0x10d)}),a49_0x2b5ea5(Text,{'color':'cyan','children':[_0x3322b6(0x10f),_0x45cc42]}),a49_0xab992(Text,{'children':_0x3322b6(0xed)})]});return a49_0xab992(Box,{'children':a49_0xab992(Text,{'children':_0x3322b6(0x111)})});}
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 a50_0x40b3(){const _0x10e9a6=['9rLnmSI','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','96agaPcH','stringify','message','未找到\x20appcode\x20配置','配置\x20Cursor\x20MCP\x20成功','390nYajgF','@lovrabet/dataset-mcp-server','.cursor','解析现有\x20mcp.json\x20失败','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','750982vILSSQ','mcp-cursor','cwd','utf8','lovrabet-dataset','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','7273648AoPWBN','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','7056sJhsaO','1092WtVKDQ','npx','创建\x20.cursor\x20目录','online','✓\x20创建\x20.cursor\x20目录:\x20','log','9756DOFURq','\x20\x20-\x20环境:\x20','创建\x20.cursor/rules\x20目录','warn','2381710DMEDPA','appcode','url','mcp.json','✓\x20创建\x20mcp.json\x20配置文件','error','lovrabet_rules.mdc','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','\x20\x20-\x20配置文件:\x20','创建新的\x20mcp.json\x20配置','mcpServers','3172050lkJQTq','1SKgeNy','\x0a配置信息:','复制\x20Cursor\x20Rules\x20文件失败','exit','复制\x20Cursor\x20Rules\x20文件','info','136620BCHPeY','rules','app','更新现有\x20mcp.json\x20配置','parse'];a50_0x40b3=function(){return _0x10e9a6;};return a50_0x40b3();}(function(_0x56e075,_0xcf27e){const _0x5e6195=a50_0x975b,_0x3b5d69=_0x56e075();while(!![]){try{const _0x36bc29=-parseInt(_0x5e6195(0x1ff))/0x1*(-parseInt(_0x5e6195(0x1e0))/0x2)+parseInt(_0x5e6195(0x1e8))/0x3*(parseInt(_0x5e6195(0x1d6))/0x4)+-parseInt(_0x5e6195(0x1db))/0x5*(-parseInt(_0x5e6195(0x1ef))/0x6)+parseInt(_0x5e6195(0x1fe))/0x7+parseInt(_0x5e6195(0x1e6))/0x8+-parseInt(_0x5e6195(0x1d4))/0x9*(parseInt(_0x5e6195(0x1f3))/0xa)+parseInt(_0x5e6195(0x1cf))/0xb*(-parseInt(_0x5e6195(0x1e9))/0xc);if(_0x36bc29===_0xcf27e)break;else _0x3b5d69['push'](_0x3b5d69['shift']());}catch(_0x580b1d){_0x3b5d69['push'](_0x3b5d69['shift']());}}}(a50_0x40b3,0x86f1c));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';function a50_0x975b(_0x120a12,_0x456532){const _0x40b3c1=a50_0x40b3();return a50_0x975b=function(_0x975b74,_0x97bba3){_0x975b74=_0x975b74-0x1cf;let _0x45d6e8=_0x40b3c1[_0x975b74];return _0x45d6e8;},a50_0x975b(_0x120a12,_0x456532);}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 _0xd98c51=a50_0x975b;try{const _0x45a9ec=process[_0xd98c51(0x1e2)](),_0x38ae95=resolve(_0x45a9ec,_0xd98c51(0x1dd)),_0x150d6d=resolve(_0x38ae95,_0xd98c51(0x1f6)),_0x46cc6d=readConfig(),_0x36ba09=_0x46cc6d[_0xd98c51(0x1f4)]||_0x46cc6d[_0xd98c51(0x1d1)],_0x31e23e=_0x46cc6d['env']||_0xd98c51(0x1ec);!_0x36ba09&&(console[_0xd98c51(0x1f8)](_0xd98c51(0x1e5)),logger['error'](_0xd98c51(0x1e1),_0xd98c51(0x1d9)),process['exit'](0x1));!existsSync(_0x38ae95)&&(mkdirSync(_0x38ae95,{'recursive':!![]}),logger['info']('mcp-cursor',_0xd98c51(0x1eb),{'path':_0x38ae95}),console[_0xd98c51(0x1ee)](_0xd98c51(0x1ed)+_0x38ae95));const _0x357343={'command':_0xd98c51(0x1ea),'args':['-y',_0xd98c51(0x1dc)],'env':{'LOVRABET_APP_CODE':String(_0x36ba09),'LOVRABET_ENV':String(_0x31e23e)}};let _0x1c5aa8;if(existsSync(_0x150d6d))try{const _0x223ad3=readFileSync(_0x150d6d,'utf8');_0x1c5aa8=JSON[_0xd98c51(0x1d3)](_0x223ad3),!_0x1c5aa8['mcpServers']&&(_0x1c5aa8[_0xd98c51(0x1fd)]={}),_0x1c5aa8['mcpServers'][_0xd98c51(0x1e4)]=_0x357343,logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),_0xd98c51(0x1d2),{'path':_0x150d6d,'appcode':_0x36ba09,'env':_0x31e23e}),console[_0xd98c51(0x1ee)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x449771){logger[_0xd98c51(0x1f8)]('mcp-cursor',_0xd98c51(0x1de),{'error':_0x449771 instanceof Error?_0x449771['message']:String(_0x449771)}),console[_0xd98c51(0x1f8)]('错误:\x20解析现有\x20mcp.json\x20失败:\x20'+(_0x449771 instanceof Error?_0x449771[_0xd98c51(0x1d8)]:String(_0x449771))),process['exit'](0x1);}else _0x1c5aa8={'mcpServers':{'lovrabet-dataset':_0x357343}},logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),_0xd98c51(0x1fc),{'path':_0x150d6d,'appcode':_0x36ba09,'env':_0x31e23e}),console['log'](_0xd98c51(0x1f7));writeFileSync(_0x150d6d,JSON[_0xd98c51(0x1d7)](_0x1c5aa8,null,0x2),{'encoding':_0xd98c51(0x1e3)});const _0x938784=resolve(_0x38ae95,_0xd98c51(0x1d0)),_0x3e379e=resolve(_0x938784,_0xd98c51(0x1f9));if(!existsSync(_0x3e379e))try{!existsSync(_0x938784)&&(mkdirSync(_0x938784,{'recursive':!![]}),logger['info'](_0xd98c51(0x1e1),_0xd98c51(0x1f1),{'path':_0x938784}));const _0x51135c=fileURLToPath(import.meta[_0xd98c51(0x1f5)]),_0x47e72a=dirname(_0x51135c),_0x5a5459=resolve(_0x47e72a,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x5a5459)?(copyFileSync(_0x5a5459,_0x3e379e),logger['info']('mcp-cursor',_0xd98c51(0x203),{'from':_0x5a5459,'to':_0x3e379e}),console[_0xd98c51(0x1ee)](_0xd98c51(0x1df))):logger[_0xd98c51(0x1f2)](_0xd98c51(0x1e1),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x5a5459});}catch(_0x92e259){logger['error'](_0xd98c51(0x1e1),_0xd98c51(0x201),{'error':_0x92e259 instanceof Error?_0x92e259['message']:String(_0x92e259)}),console[_0xd98c51(0x1f2)](_0xd98c51(0x1e7)+(_0x92e259 instanceof Error?_0x92e259[_0xd98c51(0x1d8)]:String(_0x92e259)));}else console[_0xd98c51(0x1ee)](_0xd98c51(0x1d5)),logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),'Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x3e379e});console[_0xd98c51(0x1ee)]('\x0a✓\x20Cursor\x20MCP\x20配置成功!'),console['log'](_0xd98c51(0x200)),console[_0xd98c51(0x1ee)]('\x20\x20-\x20AppCode:\x20'+_0x36ba09),console[_0xd98c51(0x1ee)](_0xd98c51(0x1f0)+_0x31e23e),console[_0xd98c51(0x1ee)](_0xd98c51(0x1fb)+_0x150d6d),console[_0xd98c51(0x1ee)]('\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。'),console[_0xd98c51(0x1ee)](_0xd98c51(0x1fa)),logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),_0xd98c51(0x1da),{'appcode':_0x36ba09,'env':_0x31e23e,'configPath':_0x150d6d}),process[_0xd98c51(0x202)](0x0);}catch(_0x32b8bd){logger[_0xd98c51(0x1f8)]('mcp-cursor','配置\x20Cursor\x20MCP\x20失败',{'error':_0x32b8bd instanceof Error?_0x32b8bd[_0xd98c51(0x1d8)]:String(_0x32b8bd)}),console[_0xd98c51(0x1f8)]('错误:\x20配置失败:\x20'+(_0x32b8bd instanceof Error?_0x32b8bd['message']:String(_0x32b8bd))),process[_0xd98c51(0x202)](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(_0x3252e6,_0x18316c){var _0x564726=a51_0x46d0,_0x33388b=_0x3252e6();while(!![]){try{var _0x1de46c=parseInt(_0x564726(0x1c3))/0x1*(parseInt(_0x564726(0x1c0))/0x2)+-parseInt(_0x564726(0x1c6))/0x3+-parseInt(_0x564726(0x1b5))/0x4+-parseInt(_0x564726(0x1b0))/0x5*(parseInt(_0x564726(0x1b2))/0x6)+-parseInt(_0x564726(0x1ca))/0x7*(parseInt(_0x564726(0x1af))/0x8)+-parseInt(_0x564726(0x1c9))/0x9+parseInt(_0x564726(0x1c1))/0xa*(parseInt(_0x564726(0x1b7))/0xb);if(_0x1de46c===_0x18316c)break;else _0x33388b['push'](_0x33388b['shift']());}catch(_0x3a727b){_0x33388b['push'](_0x33388b['shift']());}}}(a51_0x2cdf,0xec13d));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x42cdd7){var _0x2d81cf=a51_0x46d0;logger[_0x2d81cf(0x1c8)](process[_0x2d81cf(0x1c5)]());if(!_0x42cdd7){console['error'](_0x2d81cf(0x1bd)),console[_0x2d81cf(0x1be)]('\x0a使用方法:'),console['log'](_0x2d81cf(0x1bc)),console[_0x2d81cf(0x1be)](_0x2d81cf(0x1b3)),console['log'](_0x2d81cf(0x1c4)),logger[_0x2d81cf(0x1bb)](_0x2d81cf(0x1b8),'未指定\x20IDE\x20类型'),process[_0x2d81cf(0x1bf)](0x1);return;}switch(_0x42cdd7[_0x2d81cf(0x1b4)]()){case _0x2d81cf(0x1b9):logger[_0x2d81cf(0x1b6)]('mcp',_0x2d81cf(0x1b1)),await configureCursorMcp();break;default:console['error']('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x42cdd7),console['log'](_0x2d81cf(0x1c7)),console[_0x2d81cf(0x1be)](_0x2d81cf(0x1ba)),logger[_0x2d81cf(0x1bb)](_0x2d81cf(0x1b8),_0x2d81cf(0x1c2)+_0x42cdd7),process[_0x2d81cf(0x1bf)](0x1);break;}}function a51_0x46d0(_0x782191,_0x459071){var _0x2cdf89=a51_0x2cdf();return a51_0x46d0=function(_0x46d003,_0x3675b0){_0x46d003=_0x46d003-0x1af;var _0x28c810=_0x2cdf89[_0x46d003];return _0x28c810;},a51_0x46d0(_0x782191,_0x459071);}function a51_0x2cdf(){var _0x2c01a6=['10cRArPa','不支持的\x20IDE\x20类型:\x20','1901HbcIRe','\x20\x20lovrabet\x20mcp\x20cursor','cwd','5056026zGzLov','\x0a当前支持的\x20IDE:','setLogPath','12625011RbXhHZ','42yKKzzm','225944iCQXxl','230dNKjWj','执行配置\x20Cursor\x20MCP\x20命令','120918jJPipN','\x0a示例:','toLowerCase','2771828XVaqcw','info','53855428gXymuz','mcp','cursor','\x20\x20-\x20cursor','error','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','错误:\x20请指定\x20IDE\x20类型','log','exit','998OfeJwK'];a51_0x2cdf=function(){return _0x2c01a6;};return a51_0x2cdf();}
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_0x4a3ee8=a52_0x3f76;(function(_0x5690ed,_0x1fb010){const _0x3c7d02=a52_0x3f76,_0x3e3cbd=_0x5690ed();while(!![]){try{const _0x36e8d5=-parseInt(_0x3c7d02(0x183))/0x1*(-parseInt(_0x3c7d02(0x18d))/0x2)+parseInt(_0x3c7d02(0x185))/0x3+parseInt(_0x3c7d02(0x182))/0x4+parseInt(_0x3c7d02(0x184))/0x5*(parseInt(_0x3c7d02(0x188))/0x6)+parseInt(_0x3c7d02(0x186))/0x7+-parseInt(_0x3c7d02(0x18b))/0x8+parseInt(_0x3c7d02(0x18a))/0x9*(-parseInt(_0x3c7d02(0x18c))/0xa);if(_0x36e8d5===_0x1fb010)break;else _0x3e3cbd['push'](_0x3e3cbd['shift']());}catch(_0x28cf43){_0x3e3cbd['push'](_0x3e3cbd['shift']());}}}(a52_0x4dcf,0x88fd6));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a52_0x4a3ee8(0x18f));function a52_0x4dcf(){const _0x12e885=['647658RkFLcv','2222661inJihz','app','6kvIlPH','utf8','18fFrNNL','6213792UGXcqh','5981770EPsCeb','2PziUyZ','parse','.lovrabetrc','trim','appcode','3623876TJeDtU','778761NGuEwq','1580245mWiGRQ'];a52_0x4dcf=function(){return _0x12e885;};return a52_0x4dcf();}export const globalConfigPath=resolve(homedir(),a52_0x4a3ee8(0x18f));export function readConfig(){const _0x3ac7e4=a52_0x4a3ee8;let _0x540368={};try{if(existsSync(globalConfigPath)){const _0x5b896b=readFileSync(globalConfigPath,{'encoding':_0x3ac7e4(0x189)});_0x5b896b&&(_0x540368=JSON[_0x3ac7e4(0x18e)](_0x5b896b));}}catch(_0x17ddd6){}try{if(existsSync(projectConfigPath)){const _0x2b9c89=readFileSync(projectConfigPath,{'encoding':_0x3ac7e4(0x189)});if(_0x2b9c89){const _0x2a670f=JSON[_0x3ac7e4(0x18e)](_0x2b9c89);_0x540368={..._0x540368,..._0x2a670f};}}}catch(_0x2409e8){}return _0x540368;}export function getConfigAppCode(){const _0x36bd69=a52_0x4a3ee8;let _0x45df0c={},_0x383650={};try{if(existsSync(globalConfigPath)){const _0x1a99ee=readFileSync(globalConfigPath,{'encoding':_0x36bd69(0x189)});_0x1a99ee&&(_0x383650=JSON['parse'](_0x1a99ee));}}catch(_0x1f6b36){}try{if(existsSync(projectConfigPath)){const _0x58fec8=readFileSync(projectConfigPath,{'encoding':_0x36bd69(0x189)});_0x58fec8&&(_0x45df0c=JSON[_0x36bd69(0x18e)](_0x58fec8));}}catch(_0xe59f21){}let _0x3cc60f;if(_0x36bd69(0x181)in _0x45df0c)_0x3cc60f=_0x45df0c['appcode'];else{if(_0x36bd69(0x187)in _0x45df0c)_0x3cc60f=_0x45df0c[_0x36bd69(0x187)];else{if('appcode'in _0x383650)_0x3cc60f=_0x383650[_0x36bd69(0x181)];else _0x36bd69(0x187)in _0x383650&&(_0x3cc60f=_0x383650[_0x36bd69(0x187)]);}}if(typeof _0x3cc60f!=='string'||_0x3cc60f[_0x36bd69(0x180)]()==='')return undefined;return _0x3cc60f;}function a52_0x3f76(_0x15a0fe,_0x47c9ee){const _0x4dcfac=a52_0x4dcf();return a52_0x3f76=function(_0x3f7652,_0x1cda85){_0x3f7652=_0x3f7652-0x180;let _0x1ea398=_0x4dcfac[_0x3f7652];return _0x1ea398;},a52_0x3f76(_0x15a0fe,_0x47c9ee);}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 a53_0x3438(_0x1e1cd2,_0x1028c6){const _0x513e09=a53_0x513e();return a53_0x3438=function(_0x34380e,_0x52810e){_0x34380e=_0x34380e-0x104;let _0x19e446=_0x513e09[_0x34380e];return _0x19e446;},a53_0x3438(_0x1e1cd2,_0x1028c6);}(function(_0x4ee964,_0xf242f){const _0x436ff4=a53_0x3438,_0x5de93b=_0x4ee964();while(!![]){try{const _0x3be472=-parseInt(_0x436ff4(0x104))/0x1*(parseInt(_0x436ff4(0x107))/0x2)+parseInt(_0x436ff4(0x10d))/0x3*(parseInt(_0x436ff4(0x106))/0x4)+-parseInt(_0x436ff4(0x115))/0x5*(-parseInt(_0x436ff4(0x114))/0x6)+-parseInt(_0x436ff4(0x109))/0x7*(parseInt(_0x436ff4(0x10a))/0x8)+-parseInt(_0x436ff4(0x113))/0x9+parseInt(_0x436ff4(0x10f))/0xa*(-parseInt(_0x436ff4(0x116))/0xb)+parseInt(_0x436ff4(0x10e))/0xc;if(_0x3be472===_0xf242f)break;else _0x5de93b['push'](_0x5de93b['shift']());}catch(_0x5dff87){_0x5de93b['push'](_0x5de93b['shift']());}}}(a53_0x513e,0x1b37e));function a53_0x513e(){const _0x391a61=['mkdirSync','isDirectory','2811XLQsKS','3498168MFNuuR','60uMCYIk','error','复制目录时出错:','name','422505BWbNXy','8688scZlVD','30hWayTP','193072ZJSqhS','1KlOKwo','readdirSync','484jLyOvF','211604GheMcU','join','7518uhQKyT','328crDIMw'];a53_0x513e=function(){return _0x391a61;};return a53_0x513e();}import a53_0x5816aa from'node:path';import a53_0x4e9fb2 from'node:fs';export async function copyDirectory(_0x8d4e6e,_0x1a49d8){const _0x2b82b6=a53_0x3438;try{const _0x56cce9=a53_0x4e9fb2[_0x2b82b6(0x105)](_0x8d4e6e,{'withFileTypes':!![]});a53_0x4e9fb2[_0x2b82b6(0x10b)](_0x1a49d8,{'recursive':!![]});for(const _0x492976 of _0x56cce9){const _0x2ff874=a53_0x5816aa[_0x2b82b6(0x108)](_0x8d4e6e,_0x492976[_0x2b82b6(0x112)]),_0x6de0bf=a53_0x5816aa[_0x2b82b6(0x108)](_0x1a49d8,_0x492976[_0x2b82b6(0x112)]);_0x492976[_0x2b82b6(0x10c)]()?await copyDirectory(_0x2ff874,_0x6de0bf):a53_0x4e9fb2['copyFileSync'](_0x2ff874,_0x6de0bf);}}catch(_0x2c5a7d){console[_0x2b82b6(0x110)](_0x2b82b6(0x111),_0x2c5a7d);}}
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(_0x40a2b8,_0x3d5b0b){const _0x3e73be=a54_0x3fe0,_0x5aee11=_0x40a2b8();while(!![]){try{const _0x4c614d=parseInt(_0x3e73be(0x16e))/0x1*(-parseInt(_0x3e73be(0x174))/0x2)+parseInt(_0x3e73be(0x17e))/0x3+-parseInt(_0x3e73be(0x178))/0x4+parseInt(_0x3e73be(0x188))/0x5+parseInt(_0x3e73be(0x189))/0x6+-parseInt(_0x3e73be(0x184))/0x7+parseInt(_0x3e73be(0x171))/0x8;if(_0x4c614d===_0x3d5b0b)break;else _0x5aee11['push'](_0x5aee11['shift']());}catch(_0x4573e7){_0x5aee11['push'](_0x5aee11['shift']());}}}(a54_0x2887,0x4608a));export async function httpRequest(_0x183edb,_0x2cd472={}){const _0x52cc47=a54_0x3fe0,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x2cd472;let _0x1d2104=null;for(let _0x2d2530=0x0;_0x2d2530<=retries;_0x2d2530++){try{const _0x55d370=new AbortController(),_0xba4e05=setTimeout(()=>_0x55d370[_0x52cc47(0x183)](),timeout),_0x27ea28=await fetch(_0x183edb,{'headers':headers,'signal':_0x55d370[_0x52cc47(0x185)]});clearTimeout(_0xba4e05);let _0x494287;const _0x43a31a=_0x27ea28[_0x52cc47(0x176)]['get'](_0x52cc47(0x186));return _0x43a31a?.[_0x52cc47(0x182)](_0x52cc47(0x180))?_0x494287=await _0x27ea28[_0x52cc47(0x181)]():_0x494287=await _0x27ea28[_0x52cc47(0x16d)](),{'ok':_0x27ea28['ok'],'status':_0x27ea28[_0x52cc47(0x17b)],'statusText':_0x27ea28[_0x52cc47(0x17a)],'data':_0x494287,'headers':_0x27ea28['headers'],'url':_0x27ea28[_0x52cc47(0x16f)],'text':()=>_0x27ea28[_0x52cc47(0x16d)]()};}catch(_0x4c6774){_0x1d2104=_0x4c6774 instanceof Error?_0x4c6774:new Error(String(_0x4c6774));if(_0x2d2530===retries)break;if(shouldRetry(_0x4c6774)){console[_0x52cc47(0x177)](_0x52cc47(0x170)+retryDelay+_0x52cc47(0x17d)+(_0x2d2530+0x1)+_0x52cc47(0x17f)),await sleep(retryDelay);continue;}else break;}}throw _0x1d2104||new Error('Request\x20failed');}function a54_0x3fe0(_0x47ad38,_0x147190){const _0x2887c3=a54_0x2887();return a54_0x3fe0=function(_0x3fe0b1,_0x19632a){_0x3fe0b1=_0x3fe0b1-0x16d;let _0x17bb55=_0x2887c3[_0x3fe0b1];return _0x17bb55;},a54_0x3fe0(_0x47ad38,_0x147190);}function shouldRetry(_0x17825a){const _0x193e1e=a54_0x3fe0;if(_0x17825a instanceof Error){if(_0x17825a[_0x193e1e(0x17c)]===_0x193e1e(0x187))return![];if(_0x17825a[_0x193e1e(0x17c)]===_0x193e1e(0x173)&&_0x17825a[_0x193e1e(0x175)][_0x193e1e(0x182)](_0x193e1e(0x172)))return!![];if(_0x17825a[_0x193e1e(0x175)][_0x193e1e(0x182)](_0x193e1e(0x18a)))return!![];if(_0x17825a[_0x193e1e(0x175)][_0x193e1e(0x182)](_0x193e1e(0x179)))return![];}return![];}function sleep(_0x3521ab){return new Promise(_0x598c0a=>setTimeout(_0x598c0a,_0x3521ab));}function a54_0x2887(){const _0x173619=['44326cGxUFt','url','*\x20请求失败,','5022136wjVOaH','fetch','TypeError','10zDTSVl','message','headers','log','1167468TuURrg','ENOTFOUND','statusText','status','name','ms\x20后进行第\x20','1697955vujxbe','\x20次重试...','application/json','json','includes','abort','3429090fWBaxL','signal','content-type','AbortError','147865dvvKTE','401400qoPOBl','ECONNRESET','text'];a54_0x2887=function(){return _0x173619;};return a54_0x2887();}export function validateUrl(_0x3a9a84){try{return new URL(_0x3a9a84),!![];}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_0x39fda6=a55_0x5935;function a55_0x5935(_0x2fb947,_0x655493){const _0x15ff39=a55_0x15ff();return a55_0x5935=function(_0x593518,_0x5a7352){_0x593518=_0x593518-0x170;let _0xeed034=_0x15ff39[_0x593518];return _0xeed034;},a55_0x5935(_0x2fb947,_0x655493);}(function(_0x35b772,_0x18c64e){const _0x147b1b=a55_0x5935,_0x1c47fa=_0x35b772();while(!![]){try{const _0x1820d1=-parseInt(_0x147b1b(0x187))/0x1+-parseInt(_0x147b1b(0x188))/0x2*(parseInt(_0x147b1b(0x1a3))/0x3)+parseInt(_0x147b1b(0x178))/0x4*(-parseInt(_0x147b1b(0x177))/0x5)+parseInt(_0x147b1b(0x1a7))/0x6*(parseInt(_0x147b1b(0x1a5))/0x7)+-parseInt(_0x147b1b(0x19e))/0x8*(-parseInt(_0x147b1b(0x1a6))/0x9)+parseInt(_0x147b1b(0x1a1))/0xa+parseInt(_0x147b1b(0x19d))/0xb*(parseInt(_0x147b1b(0x172))/0xc);if(_0x1820d1===_0x18c64e)break;else _0x1c47fa['push'](_0x1c47fa['shift']());}catch(_0xae69e2){_0x1c47fa['push'](_0x1c47fa['shift']());}}}(a55_0x15ff,0x2ebf3));import a55_0x3499d5 from'winston';import a55_0x26280f from'node:fs';import a55_0x41b3b3 from'node:path';function a55_0x15ff(){const _0x532d0f=['rawCommand','Failed\x20to\x20clear\x20logs:','transports','errors','readFileSync','.lovrabet.log','unknown','level','logFilePath','209727muDGJG','2eaeVTD','initWinstonLogger','timestamp','Failed\x20to\x20read\x20logs:','logTask','format','log','dirname','success','now','split','duration','info','File','yellow','trim','winstonLogger','filter','writeFileSync','parse','warn','330mfJylP','1160104OSLziu','addColors','开始执行:\x20','2523610RRNQfu','blue','658311IQsgki','utf8','7eVAxFL','9TmlSwc','1855758JccdOz','readLogs','existsSync','5892QJQKix','error','完成:\x20','stringify','clearLogs','105Oeskcv','19192PJxZdn','message','combine','失败:\x20','createLogger','currentRawCommand'];a55_0x15ff=function(){return _0x532d0f;};return a55_0x15ff();}class Logger{['winstonLogger'];[a55_0x39fda6(0x186)];[a55_0x39fda6(0x17d)]='';constructor(){const _0x13cb88=a55_0x39fda6;this[_0x13cb88(0x186)]='';}['setRawCommand'](_0x2fab2c){const _0x2f622f=a55_0x39fda6;this[_0x2f622f(0x17d)]=_0x2fab2c;}[a55_0x39fda6(0x189)](){const _0x200416=a55_0x39fda6,_0xa7f1ba=a55_0x41b3b3[_0x200416(0x18f)](this[_0x200416(0x186)]);!a55_0x26280f[_0x200416(0x171)](_0xa7f1ba)&&a55_0x26280f['mkdirSync'](_0xa7f1ba,{'recursive':!![]});const _0x55a9ea=a55_0x3499d5['format'][_0x200416(0x17a)](a55_0x3499d5[_0x200416(0x18d)][_0x200416(0x18a)](),a55_0x3499d5[_0x200416(0x18d)][_0x200416(0x181)]({'stack':!![]}),a55_0x3499d5[_0x200416(0x18d)]['printf'](_0x1da62a=>{const _0x1dbcbd=_0x200416,_0x3cfd65={'timestamp':_0x1da62a['timestamp']||new Date()['toISOString'](),'level':_0x1da62a[_0x1dbcbd(0x185)]||_0x1dbcbd(0x194),'command':_0x1da62a['command']||_0x1dbcbd(0x184),'rawCommand':_0x1da62a[_0x1dbcbd(0x17e)]||this[_0x1dbcbd(0x17d)]||undefined,'message':_0x1da62a[_0x1dbcbd(0x179)]||'','duration':_0x1da62a[_0x1dbcbd(0x193)]||undefined,'details':_0x1da62a['details']||undefined};return JSON[_0x1dbcbd(0x175)](_0x3cfd65);}));this[_0x200416(0x198)]=a55_0x3499d5[_0x200416(0x17c)]({'level':'info','format':_0x55a9ea,'transports':[new a55_0x3499d5[(_0x200416(0x180))][(_0x200416(0x195))]({'filename':this[_0x200416(0x186)],'level':_0x200416(0x194)})],'silent':![]}),a55_0x3499d5[_0x200416(0x19f)]({'success':'green','error':'red','warn':_0x200416(0x196),'info':_0x200416(0x1a2)});}['setLogPath'](_0x296603){const _0x1330c7=a55_0x39fda6;this[_0x1330c7(0x186)]=a55_0x41b3b3['join'](_0x296603,_0x1330c7(0x183)),this[_0x1330c7(0x198)]&&this[_0x1330c7(0x198)]['clear'](),this[_0x1330c7(0x189)]();}[a55_0x39fda6(0x194)](_0x2e308b,_0x43cd32,_0x71c37e){const _0x4e590e=a55_0x39fda6;if(!this[_0x4e590e(0x186)]||!this[_0x4e590e(0x198)])return;this['winstonLogger'][_0x4e590e(0x194)](_0x43cd32,{'command':_0x2e308b,'details':_0x71c37e});}[a55_0x39fda6(0x190)](_0x1634b9,_0x3fd718,_0xa0cecd,_0x26b3be){const _0x582141=a55_0x39fda6;if(!this[_0x582141(0x186)]||!this[_0x582141(0x198)])return;this[_0x582141(0x198)][_0x582141(0x18e)](_0x582141(0x194),_0x3fd718,{'level':'success','command':_0x1634b9,'duration':_0xa0cecd,'details':_0x26b3be});}[a55_0x39fda6(0x173)](_0x461cbf,_0x1f0597,_0x1082d0){const _0x2d207e=a55_0x39fda6;if(!this[_0x2d207e(0x186)]||!this[_0x2d207e(0x198)])return;this[_0x2d207e(0x198)][_0x2d207e(0x173)](_0x1f0597,{'command':_0x461cbf,'details':_0x1082d0});}[a55_0x39fda6(0x19c)](_0x415ce1,_0x26abc9,_0x1ed147){const _0x34d34c=a55_0x39fda6;if(!this[_0x34d34c(0x186)]||!this['winstonLogger'])return;this[_0x34d34c(0x198)][_0x34d34c(0x19c)](_0x26abc9,{'command':_0x415ce1,'details':_0x1ed147});}async[a55_0x39fda6(0x18c)](_0x4eb6e2,_0x4e78bd,_0x1ef15c){const _0x49c7d5=a55_0x39fda6,_0x493b1e=Date[_0x49c7d5(0x191)]();this[_0x49c7d5(0x194)](_0x4eb6e2,_0x49c7d5(0x1a0)+_0x4e78bd);try{const _0x5b6133=await _0x1ef15c(),_0x5c7d51=Date['now']()-_0x493b1e;return this[_0x49c7d5(0x190)](_0x4eb6e2,_0x49c7d5(0x174)+_0x4e78bd,_0x5c7d51),_0x5b6133;}catch(_0x482286){const _0x5b5b0e=Date[_0x49c7d5(0x191)]()-_0x493b1e;this['error'](_0x4eb6e2,_0x49c7d5(0x17b)+_0x4e78bd,{'error':_0x482286 instanceof Error?_0x482286['message']:String(_0x482286),'duration':_0x5b5b0e});throw _0x482286;}}[a55_0x39fda6(0x170)](){const _0x4482fc=a55_0x39fda6;try{if(!a55_0x26280f[_0x4482fc(0x171)](this[_0x4482fc(0x186)]))return[];const _0x531b62=a55_0x26280f[_0x4482fc(0x182)](this[_0x4482fc(0x186)],_0x4482fc(0x1a4));return _0x531b62[_0x4482fc(0x192)]('\x0a')[_0x4482fc(0x199)](_0x23bcac=>_0x23bcac[_0x4482fc(0x197)]())['map'](_0x4c8656=>JSON[_0x4482fc(0x19b)](_0x4c8656));}catch(_0x2d71f0){return console[_0x4482fc(0x19c)](_0x4482fc(0x18b),_0x2d71f0),[];}}[a55_0x39fda6(0x176)](){const _0x5757fb=a55_0x39fda6;try{a55_0x26280f[_0x5757fb(0x171)](this[_0x5757fb(0x186)])&&a55_0x26280f[_0x5757fb(0x19a)](this[_0x5757fb(0x186)],'','utf8');}catch(_0xde8e46){console[_0x5757fb(0x19c)](_0x5757fb(0x17f),_0xde8e46);}}['getWinstonInstance'](){const _0x3566ff=a55_0x39fda6;return this[_0x3566ff(0x198)];}}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_0x1effa4=a56_0x372d;(function(_0x1ac1c0,_0x37d0ff){const _0x348b8e=a56_0x372d,_0x276b91=_0x1ac1c0();while(!![]){try{const _0x55663b=-parseInt(_0x348b8e(0x168))/0x1*(parseInt(_0x348b8e(0x170))/0x2)+parseInt(_0x348b8e(0x16b))/0x3+parseInt(_0x348b8e(0x157))/0x4+parseInt(_0x348b8e(0x16f))/0x5+parseInt(_0x348b8e(0x17f))/0x6*(-parseInt(_0x348b8e(0x155))/0x7)+parseInt(_0x348b8e(0x15b))/0x8*(parseInt(_0x348b8e(0x17b))/0x9)+parseInt(_0x348b8e(0x161))/0xa;if(_0x55663b===_0x37d0ff)break;else _0x276b91['push'](_0x276b91['shift']());}catch(_0x11679f){_0x276b91['push'](_0x276b91['shift']());}}}(a56_0x33bf,0xdb645));import a56_0x79d525 from'node:fs';import a56_0x5b6d26 from'node:path';import{logger}from'./logger.js';function a56_0x372d(_0xe746fc,_0x4480df){const _0x33bf33=a56_0x33bf();return a56_0x372d=function(_0x372d54,_0x1d0f78){_0x372d54=_0x372d54-0x153;let _0x33c46e=_0x33bf33[_0x372d54];return _0x33c46e;},a56_0x372d(_0xe746fc,_0x4480df);}function a56_0x33bf(){const _0xa3df62=['\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','2750384NhnSZW','\x20from\x20\x22../pages/','match','toUpperCase','5067064EfWimW','开始更新路由配置','index','import\x20','未找到路由配置的\x20children\x20数组','previewChanges','5766350NCpIjd','now','utf8','success','路由配置更新完成','charAt','writeFile','538wIiAqI','path:\x20\x22','existsSync','4235694bLMEEC','split','message','readFile','1751770IcFWvT','5270malKGT','error','lastIndexOf','includes','join','toLowerCase','slice','addRoute','addPageRoute','toComponentName','index.tsx','9YhNgIj','promises','map','addImport','1062TWwbmy','indexOf','路由文件不存在:\x20','length','router','routerFilePath','53137hlWIpe'];a56_0x33bf=function(){return _0xa3df62;};return a56_0x33bf();}export class RouterUpdater{['routerFilePath'];constructor(_0x6d9311){const _0x3fd142=a56_0x372d;this[_0x3fd142(0x154)]=a56_0x5b6d26[_0x3fd142(0x174)](_0x6d9311,'src',_0x3fd142(0x153),_0x3fd142(0x17a));}async[a56_0x1effa4(0x178)](_0x4bde01,_0x380d9c){const _0x5a2d42=a56_0x1effa4;if(!a56_0x79d525[_0x5a2d42(0x16a)](this[_0x5a2d42(0x154)]))throw new Error('路由文件不存在:\x20'+this[_0x5a2d42(0x154)]);const _0x4a4a32=Date[_0x5a2d42(0x162)]();logger['info']('router',_0x5a2d42(0x15c),{'pageName':_0x4bde01,'routePath':_0x380d9c,'file':this[_0x5a2d42(0x154)]});try{const _0x1998f9=await a56_0x79d525['promises']['readFile'](this['routerFilePath'],'utf8'),_0xef967d=this[_0x5a2d42(0x179)](_0x4bde01),_0x4c2702=this[_0x5a2d42(0x17e)](_0x1998f9,_0xef967d,_0x4bde01),_0x173a64=this[_0x5a2d42(0x177)](_0x4c2702,_0x380d9c,_0xef967d);await a56_0x79d525[_0x5a2d42(0x17c)][_0x5a2d42(0x167)](this[_0x5a2d42(0x154)],_0x173a64,_0x5a2d42(0x163));const _0x9327f8=Date[_0x5a2d42(0x162)]()-_0x4a4a32;logger[_0x5a2d42(0x164)](_0x5a2d42(0x153),_0x5a2d42(0x165),_0x9327f8,{'pageName':_0x4bde01,'routePath':_0x380d9c,'componentName':_0xef967d});}catch(_0x4be98a){const _0xbcd566=Date[_0x5a2d42(0x162)]()-_0x4a4a32;logger[_0x5a2d42(0x171)](_0x5a2d42(0x153),'路由配置更新失败',{'pageName':_0x4bde01,'routePath':_0x380d9c,'error':_0x4be98a instanceof Error?_0x4be98a[_0x5a2d42(0x16d)]:String(_0x4be98a),'duration':_0xbcd566});throw _0x4be98a;}}[a56_0x1effa4(0x179)](_0x208f8d){const _0x234ff5=a56_0x1effa4;return _0x208f8d[_0x234ff5(0x16c)]('-')[_0x234ff5(0x17d)](_0x252c77=>_0x252c77[_0x234ff5(0x166)](0x0)[_0x234ff5(0x15a)]()+_0x252c77[_0x234ff5(0x176)](0x1)[_0x234ff5(0x175)]())[_0x234ff5(0x174)]('');}[a56_0x1effa4(0x17e)](_0x9b99b5,_0x19309c,_0x2f63e7){const _0x3ce751=a56_0x1effa4,_0x5f5837=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x2af001=_0x9b99b5[_0x3ce751(0x159)](_0x5f5837)||[],_0xc349cb=_0x3ce751(0x15e)+_0x19309c+_0x3ce751(0x158)+_0x2f63e7+'\x22;';if(_0x9b99b5['includes'](_0xc349cb))return _0x9b99b5;if(_0x2af001[_0x3ce751(0x182)]>0x0){const _0x48f439=_0x2af001[_0x2af001['length']-0x1];if(_0x48f439){const _0x4892e4=_0x9b99b5[_0x3ce751(0x172)](_0x48f439),_0x3df430=_0x4892e4+_0x48f439[_0x3ce751(0x182)];return _0x9b99b5[_0x3ce751(0x176)](0x0,_0x3df430)+_0xc349cb+'\x0a'+_0x9b99b5[_0x3ce751(0x176)](_0x3df430);}}const _0x3a576e=_0x9b99b5[_0x3ce751(0x159)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x3a576e&&_0x3a576e[_0x3ce751(0x15d)]!==undefined){const _0x59b2b9=_0x3a576e[_0x3ce751(0x15d)]+_0x3a576e[0x0][_0x3ce751(0x182)];return _0x9b99b5[_0x3ce751(0x176)](0x0,_0x59b2b9)+_0xc349cb+'\x0a'+_0x9b99b5[_0x3ce751(0x176)](_0x59b2b9);}return _0x9b99b5;}['addRoute'](_0x346c29,_0x37d661,_0x56def1){const _0xfd2082=a56_0x1effa4,_0x258aa8='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x37d661+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x56def1+_0xfd2082(0x156);if(_0x346c29[_0xfd2082(0x173)](_0xfd2082(0x169)+_0x37d661+'\x22'))return _0x346c29;const _0x5ec5cc=/children:\s*\[([\s\S]*?)\]/,_0x126f72=_0x346c29[_0xfd2082(0x159)](_0x5ec5cc);if(!_0x126f72||_0x126f72[_0xfd2082(0x15d)]===undefined)throw new Error(_0xfd2082(0x15f));const _0x274ccc=_0x126f72[0x1],_0x28f189=_0x126f72[_0xfd2082(0x15d)]+_0x126f72[0x0][_0xfd2082(0x180)]('[')+0x1,_0x59ab76=_0x274ccc?.[_0xfd2082(0x159)](/\{[\s\S]*?\},/g)||[];if(_0x59ab76[_0xfd2082(0x182)]>0x0){const _0xf21d5c=_0x59ab76[_0x59ab76[_0xfd2082(0x182)]-0x1];if(_0xf21d5c){const _0x40a22b=_0x346c29['lastIndexOf'](_0xf21d5c),_0x15291b=_0x40a22b+_0xf21d5c['length'];return _0x346c29[_0xfd2082(0x176)](0x0,_0x15291b)+'\x0a'+_0x258aa8+_0x346c29[_0xfd2082(0x176)](_0x15291b);}}return _0x346c29['slice'](0x0,_0x28f189)+'\x0a'+_0x258aa8+_0x346c29[_0xfd2082(0x176)](_0x28f189);}async[a56_0x1effa4(0x160)](_0x48784a,_0x3c5cce){const _0x2cdad9=a56_0x1effa4;if(!a56_0x79d525[_0x2cdad9(0x16a)](this['routerFilePath']))throw new Error(_0x2cdad9(0x181)+this[_0x2cdad9(0x154)]);const _0x389a5d=await a56_0x79d525['promises'][_0x2cdad9(0x16e)](this[_0x2cdad9(0x154)],_0x2cdad9(0x163)),_0x4a9f00=this[_0x2cdad9(0x179)](_0x48784a);let _0x577df0=this[_0x2cdad9(0x17e)](_0x389a5d,_0x4a9f00,_0x48784a);return _0x577df0=this[_0x2cdad9(0x177)](_0x577df0,_0x3c5cce,_0x4a9f00),_0x577df0;}}
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(_0x271e98){return new Promise(_0x820baa=>setTimeout(_0x820baa,_0x271e98));}
1
+ export function sleep(_0x4e0c91){return new Promise(_0x56f103=>setTimeout(_0x56f103,_0x4e0c91));}
@@ -1 +1 @@
1
- const a58_0x3a6a16=a58_0x2968;(function(_0x1174bf,_0x35e45b){const _0x3e6eea=a58_0x2968,_0x51ce77=_0x1174bf();while(!![]){try{const _0x4d0558=parseInt(_0x3e6eea(0xa7))/0x1+parseInt(_0x3e6eea(0xb1))/0x2+-parseInt(_0x3e6eea(0xc2))/0x3+parseInt(_0x3e6eea(0x97))/0x4*(parseInt(_0x3e6eea(0xad))/0x5)+-parseInt(_0x3e6eea(0x9f))/0x6+-parseInt(_0x3e6eea(0xb0))/0x7+-parseInt(_0x3e6eea(0xa0))/0x8;if(_0x4d0558===_0x35e45b)break;else _0x51ce77['push'](_0x51ce77['shift']());}catch(_0x27b6a4){_0x51ce77['push'](_0x51ce77['shift']());}}}(a58_0x3040,0x1f77b));import a58_0x4b588b from'node:fs';function a58_0x2968(_0xa0eee8,_0x26dd1a){const _0x3040e5=a58_0x3040();return a58_0x2968=function(_0x296890,_0x507967){_0x296890=_0x296890-0x92;let _0x1e7312=_0x3040e5[_0x296890];return _0x1e7312;},a58_0x2968(_0xa0eee8,_0x26dd1a);}import a58_0x245482 from'node:path';function a58_0x3040(){const _0x1f5aae=['toComponentName','slice','keys','.scss','map','toUpperCase','236537XymFRc','toDisplayTitle','模板内容替换失败','replace','now','.jsx','15byKQeM','processDirectory','toLocaleTimeString','177499pTNGDl','275916XwFlPx','charAt','info','.tsx','readdir','2-digit','endsWith','stringify','toLowerCase','isDirectory','.css','join','replaceApiContent','pop','error','split','promises','173580GQNEZN','success','toISOString','.tpl','processFile','name','api','模板内容替换完成','default','replaceContent','155468XiSVCU','toLocaleString','utf8','mkdir','processTemplate','numeric','template','extname','1293684YGDISU','506992QMLZlr'];a58_0x3040=function(){return _0x1f5aae;};return a58_0x3040();}import{logger}from'./logger.js';export class TemplateReplacer{static[a58_0x3a6a16(0xa1)](_0x37c744){const _0x180a37=a58_0x3a6a16,_0x13cb33=_0x37c744['split']('/')[_0x180a37(0xbe)]()||_0x37c744;return _0x13cb33[_0x180a37(0xc0)]('-')[_0x180a37(0xa5)](_0x19bd82=>_0x19bd82[_0x180a37(0xb2)](0x0)['toUpperCase']()+_0x19bd82[_0x180a37(0xa2)](0x1)[_0x180a37(0xb9)]())[_0x180a37(0xbc)]('');}static[a58_0x3a6a16(0xa8)](_0x5f8384){const _0x45584e=a58_0x3a6a16,_0x17b6e3=_0x5f8384[_0x45584e(0xc0)]('/')[_0x45584e(0xbe)]()||_0x5f8384;return _0x17b6e3[_0x45584e(0xc0)]('-')['map'](_0x2246c8=>_0x2246c8[_0x45584e(0xb2)](0x0)[_0x45584e(0xa6)]()+_0x2246c8[_0x45584e(0xa2)](0x1)['toLowerCase']())[_0x45584e(0xbc)]('\x20');}static['replaceContent'](_0x17ad59,_0x2f1303,_0x53d424){const _0x3afc1d=a58_0x3a6a16,_0x531934=this[_0x3afc1d(0xa1)](_0x2f1303),_0x134a90=this[_0x3afc1d(0xa8)](_0x2f1303),_0x5f2e53=new Date(),_0x127edf=_0x5f2e53[_0x3afc1d(0x98)](undefined,{'year':'numeric','month':_0x3afc1d(0xb6),'day':'2-digit','hour':_0x3afc1d(0xb6),'minute':'2-digit','second':_0x3afc1d(0xb6),'hour12':![]})[_0x3afc1d(0xaa)](/\//g,'-'),_0x3fd00c=_0x5f2e53['toLocaleDateString'](undefined,{'year':_0x3afc1d(0x9c),'month':_0x3afc1d(0xb6),'day':'2-digit'})[_0x3afc1d(0xaa)](/\//g,'-'),_0x33a900=_0x5f2e53[_0x3afc1d(0xaf)](undefined,{'hour12':![]});let _0x4688af=_0x17ad59['replace'](/\{ComponentName\}/g,_0x531934)[_0x3afc1d(0xaa)](/\{DisplayTitle\}/g,_0x134a90)[_0x3afc1d(0xaa)](/\{PageName\}/g,_0x2f1303)[_0x3afc1d(0xaa)](/\{TemplateName\}/g,_0x53d424)[_0x3afc1d(0xaa)](/\{CreatedAt\}/g,_0x127edf)[_0x3afc1d(0xaa)](/\{CreatedDate\}/g,_0x3fd00c)[_0x3afc1d(0xaa)](/\{CreatedTime\}/g,_0x33a900);return _0x4688af;}static[a58_0x3a6a16(0xbd)](_0x306c2a,_0x312b25,_0x42edc1,_0xccb6ff,_0x1dc03c,_0x3d9661,_0x2baf6d){const _0x13fadb=a58_0x3a6a16,_0x2a0025=new Date(),_0x11eb77=_0x2a0025[_0x13fadb(0xc4)](),_0x5e7132=JSON[_0x13fadb(0xb8)](_0x42edc1,null,0x2)['split']('\x0a')['slice'](0x1,-0x1)[_0x13fadb(0xa5)](_0x57f5f5=>_0x57f5f5[_0x13fadb(0xaa)](/^ /,'\x20\x20\x20\x20'))[_0x13fadb(0xbc)]('\x0a'),_0x68043e=_0xccb6ff||Object[_0x13fadb(0xa3)](_0x42edc1)[0x0]||'YourModel';let _0x40d1df=_0x306c2a[_0x13fadb(0xaa)](/\{AppCode\}/g,_0x312b25)['replace'](/\{ModelConfigs\}/g,_0x5e7132)[_0x13fadb(0xaa)](/\{ExampleModelName\}/g,_0x68043e)[_0x13fadb(0xaa)](/\{ApiFileName\}/g,_0x1dc03c||_0x13fadb(0x93))[_0x13fadb(0xaa)](/\{ConfigName\}/g,_0x3d9661||_0x13fadb(0x95))[_0x13fadb(0xaa)](/\{ClientConfigParam\}/g,_0x2baf6d||'')[_0x13fadb(0xaa)](/\{CreatedAt\}/g,_0x11eb77);return _0x40d1df;}static async[a58_0x3a6a16(0x9b)](_0xc77d47,_0x2d0093,_0x257604,_0x3d5d79,_0x354d4b=!![]){const _0x4cb2dc=a58_0x3a6a16,_0x2e430d=Date[_0x4cb2dc(0xab)]();try{_0x354d4b&&logger[_0x4cb2dc(0xb3)](_0x4cb2dc(0x9d),'开始处理模板内容替换',{'templatePath':_0xc77d47,'targetPath':_0x2d0093,'pageName':_0x257604,'templateName':_0x3d5d79});await a58_0x4b588b[_0x4cb2dc(0xc1)][_0x4cb2dc(0x9a)](_0x2d0093,{'recursive':!![]}),await this[_0x4cb2dc(0xae)](_0xc77d47,_0x2d0093,_0x257604,_0x3d5d79);if(_0x354d4b){const _0x49ff89=Date['now']()-_0x2e430d;logger[_0x4cb2dc(0xc3)]('template',_0x4cb2dc(0x94),_0x49ff89,{'pageName':_0x257604,'templateName':_0x3d5d79});}}catch(_0x28e20e){if(_0x354d4b){const _0x3ae020=Date[_0x4cb2dc(0xab)]()-_0x2e430d;logger[_0x4cb2dc(0xbf)](_0x4cb2dc(0x9d),_0x4cb2dc(0xa9),{'templatePath':_0xc77d47,'targetPath':_0x2d0093,'pageName':_0x257604,'templateName':_0x3d5d79,'error':_0x28e20e instanceof Error?_0x28e20e['message']:String(_0x28e20e),'duration':_0x3ae020});}throw _0x28e20e;}}static async[a58_0x3a6a16(0xae)](_0x11cb43,_0x22d091,_0x1ea08a,_0x35c5ce){const _0x5a13e8=a58_0x3a6a16,_0x59939e=await a58_0x4b588b[_0x5a13e8(0xc1)][_0x5a13e8(0xb5)](_0x11cb43,{'withFileTypes':!![]});for(const _0x5408b5 of _0x59939e){const _0x4ec497=a58_0x245482[_0x5a13e8(0xbc)](_0x11cb43,_0x5408b5[_0x5a13e8(0x92)]);let _0x3fdf84=a58_0x245482[_0x5a13e8(0xbc)](_0x22d091,_0x5408b5[_0x5a13e8(0x92)]);_0x5408b5[_0x5a13e8(0x92)][_0x5a13e8(0xb7)](_0x5a13e8(0xc5))&&(_0x3fdf84=a58_0x245482[_0x5a13e8(0xbc)](_0x22d091,_0x5408b5[_0x5a13e8(0x92)]['replace'](/\.tpl$/,'')));if(_0x5408b5[_0x5a13e8(0xba)]())await a58_0x4b588b[_0x5a13e8(0xc1)]['mkdir'](_0x3fdf84,{'recursive':!![]}),await this[_0x5a13e8(0xae)](_0x4ec497,_0x3fdf84,_0x1ea08a,_0x35c5ce);else _0x5408b5['isFile']()&&await this[_0x5a13e8(0xc6)](_0x4ec497,_0x3fdf84,_0x1ea08a,_0x35c5ce);}}static async[a58_0x3a6a16(0xc6)](_0x853eea,_0x351c2f,_0x3e062e,_0x1c38b6){const _0xeda825=a58_0x3a6a16,_0x31d15a=a58_0x245482[_0xeda825(0x9e)](_0x853eea)[_0xeda825(0xb9)]();_0x853eea[_0xeda825(0xb7)]('.tpl')&&(_0x351c2f=_0x351c2f[_0xeda825(0xaa)](/\.tpl$/,''));const _0x1d14ee=[_0xeda825(0xb4),'.ts',_0xeda825(0xac),'.js','.json','.md',_0xeda825(0xbb),_0xeda825(0xa4),_0xeda825(0xc5)];if(_0x1d14ee['includes'](_0x31d15a)||_0x853eea[_0xeda825(0xb7)](_0xeda825(0xc5))){const _0x229baa=await a58_0x4b588b[_0xeda825(0xc1)]['readFile'](_0x853eea,_0xeda825(0x99)),_0x2470b7=this[_0xeda825(0x96)](_0x229baa,_0x3e062e,_0x1c38b6);await a58_0x4b588b[_0xeda825(0xc1)]['writeFile'](_0x351c2f,_0x2470b7,_0xeda825(0x99));}else await a58_0x4b588b[_0xeda825(0xc1)]['copyFile'](_0x853eea,_0x351c2f);}}
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.8",
3
+ "version": "1.1.26",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"