@lovrabet/cli 1.2.3 → 1.2.4

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/README.md +33 -17
  2. package/lib/add-page/input-page-router.js +1 -1
  3. package/lib/add-page/main.js +1 -1
  4. package/lib/add-page/select-page-template.js +1 -1
  5. package/lib/api/api-doc-ui.js +1 -1
  6. package/lib/api/api-doc.js +1 -1
  7. package/lib/api/api-pull-ui.js +1 -1
  8. package/lib/api/fetch-model-list.js +1 -1
  9. package/lib/api/generate-api-file.js +1 -1
  10. package/lib/api/main.js +1 -1
  11. package/lib/api/pull-silent.js +1 -1
  12. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  13. package/lib/app-menu/create-menu.js +1 -1
  14. package/lib/app-menu/get-local-pages.js +1 -1
  15. package/lib/app-menu/get-online-menu-list.js +1 -1
  16. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  17. package/lib/app-menu/utils.js +1 -1
  18. package/lib/app-menu/valid-url.js +1 -1
  19. package/lib/app-menu-update-cdn/current-content.js +1 -1
  20. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  21. package/lib/app-menu-update-cdn/main.js +1 -1
  22. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  23. package/lib/auth/auth-server-ui.js +1 -1
  24. package/lib/auth/auth-server.js +1 -1
  25. package/lib/auth/constant.js +1 -1
  26. package/lib/auth/get-cookie.js +1 -1
  27. package/lib/auth/is-session-valid.js +1 -1
  28. package/lib/auth/logout.js +1 -1
  29. package/lib/cli.js +1 -1
  30. package/lib/cmd/build-watch.js +1 -1
  31. package/lib/cmd/build.js +1 -1
  32. package/lib/cmd/logs.js +1 -1
  33. package/lib/cmd/preview.js +1 -1
  34. package/lib/cmd/start.js +1 -1
  35. package/lib/config/config-help.js +1 -1
  36. package/lib/config/main.js +1 -1
  37. package/lib/constant/domain.js +1 -1
  38. package/lib/constant/env.js +1 -1
  39. package/lib/create-app/enhanced-guided-create.js +1 -1
  40. package/lib/create-app/format-elapsed.js +1 -1
  41. package/lib/create-app/main.js +1 -1
  42. package/lib/create-app/task-finished.js +1 -1
  43. package/lib/create-app/task-loading.js +1 -1
  44. package/lib/create-app/task-running.js +1 -1
  45. package/lib/create-app/task-time.js +1 -1
  46. package/lib/create-app/use-copy-project-template.js +1 -1
  47. package/lib/create-app/use-format-code.js +1 -1
  48. package/lib/create-app/use-install-dependencies.js +1 -1
  49. package/lib/help.js +1 -1
  50. package/lib/init/main.js +1 -1
  51. package/lib/mcp/cursor.js +1 -1
  52. package/lib/mcp/main.js +1 -1
  53. package/lib/utils/check-sdk-version.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
@@ -1 +1 @@
1
- (function(_0x59ee40,_0x55b4c9){const _0x1f4cbe=a47_0x9aee,_0x2d8720=_0x59ee40();while(!![]){try{const _0x120317=-parseInt(_0x1f4cbe(0x1dc))/0x1+-parseInt(_0x1f4cbe(0x1e2))/0x2*(parseInt(_0x1f4cbe(0x1df))/0x3)+parseInt(_0x1f4cbe(0x1da))/0x4*(parseInt(_0x1f4cbe(0x1db))/0x5)+-parseInt(_0x1f4cbe(0x1d2))/0x6*(-parseInt(_0x1f4cbe(0x1d1))/0x7)+-parseInt(_0x1f4cbe(0x1d4))/0x8+parseInt(_0x1f4cbe(0x1dd))/0x9*(-parseInt(_0x1f4cbe(0x1d3))/0xa)+parseInt(_0x1f4cbe(0x1de))/0xb;if(_0x120317===_0x55b4c9)break;else _0x2d8720['push'](_0x2d8720['shift']());}catch(_0x315eb9){_0x2d8720['push'](_0x2d8720['shift']());}}}(a47_0x2d46,0x613e6));function a47_0x2d46(){const _0x2e50e0=['246nqdGzF','3152810dWpiMR','3468928aMdjar','--write','cwd','now','开始格式化代码','info','1800808vwGEfS','5akpEkC','691151VhfHMa','9mfgrjF','14893296XPGHKX','70383haHTIG','npx','error','58mFzGzS','format','prettier','resolve','代码格式化失败','代码格式化完成','122003UFUAjH'];a47_0x2d46=function(){return _0x2e50e0;};return a47_0x2d46();}import a47_0x4e3826 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a47_0x9aee(_0x221ac2,_0x53978d){_0x221ac2=_0x221ac2-0x1cc;const _0x2d46c7=a47_0x2d46();let _0x9aeec3=_0x2d46c7[_0x221ac2];return _0x9aeec3;}export function useFormatCode(){const [_0xf3481e,_0xe616bc]=useState(![]),[_0x5191af,_0x14f206]=useState(![]),[_0x29134f,_0x533b49]=useState(''),_0x5b1d53=useCallback(async _0x16e74a=>{const _0x464034=a47_0x9aee,_0x533dce=Date[_0x464034(0x1d7)](),_0x5a8bc3=a47_0x4e3826[_0x464034(0x1ce)](process[_0x464034(0x1d6)](),_0x16e74a);_0xe616bc(!![]);try{logger[_0x464034(0x1d9)](_0x464034(0x1cc),_0x464034(0x1d8),{'projectCode':_0x16e74a}),await execa(_0x464034(0x1e0),[_0x464034(0x1cd),_0x464034(0x1d5),'.'],{'cwd':_0x5a8bc3});const _0x3d6d1b=Date[_0x464034(0x1d7)]()-_0x533dce;logger['success'](_0x464034(0x1cc),_0x464034(0x1d0),_0x3d6d1b,{'projectCode':_0x16e74a});}catch(_0x546a24){const _0x424efd=Date[_0x464034(0x1d7)]()-_0x533dce;logger[_0x464034(0x1e1)](_0x464034(0x1cc),_0x464034(0x1cf),{'projectCode':_0x16e74a,'error':_0x546a24 instanceof Error?_0x546a24['message']:String(_0x546a24),'duration':_0x424efd});throw _0x546a24;}finally{_0xe616bc(![]),_0x14f206(!![]),_0x533b49(formatElapsed(_0x533dce));}},[]);return{'taskName':'格式化代码','finished':_0x5191af,'loading':_0xf3481e,'elapsed':_0x29134f,'doTask':_0x5b1d53};}
1
+ (function(_0x421506,_0x39ef5d){const _0x30d60f=a47_0x11aa,_0x2e9c64=_0x421506();while(!![]){try{const _0x2e02de=-parseInt(_0x30d60f(0x1e5))/0x1+parseInt(_0x30d60f(0x1d5))/0x2+parseInt(_0x30d60f(0x1e0))/0x3*(parseInt(_0x30d60f(0x1ec))/0x4)+parseInt(_0x30d60f(0x1e2))/0x5*(-parseInt(_0x30d60f(0x1e4))/0x6)+parseInt(_0x30d60f(0x1dc))/0x7*(-parseInt(_0x30d60f(0x1e7))/0x8)+-parseInt(_0x30d60f(0x1e9))/0x9+parseInt(_0x30d60f(0x1ea))/0xa*(parseInt(_0x30d60f(0x1eb))/0xb);if(_0x2e02de===_0x39ef5d)break;else _0x2e9c64['push'](_0x2e9c64['shift']());}catch(_0x32c081){_0x2e9c64['push'](_0x2e9c64['shift']());}}}(a47_0x81bc,0x91440));import a47_0x5cdfe0 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a47_0x11aa(_0x55119a,_0x7b12db){_0x55119a=_0x55119a-0x1d5;const _0x81bccf=a47_0x81bc();let _0x11aa62=_0x81bccf[_0x55119a];return _0x11aa62;}function a47_0x81bc(){const _0x104c9c=['6637734MOrQKA','554721cvsnDR','success','1530688iSZVzR','cwd','2229480TCwBOy','620xKNExU','247445alFHbW','824540sTsYCX','2158900EuEYIp','npx','--write','format','info','prettier','代码格式化完成','14yPksYd','开始格式化代码','message','now','6XKDGzA','格式化代码','5osxuCS','error'];a47_0x81bc=function(){return _0x104c9c;};return a47_0x81bc();}import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x2928d7=a47_0x11aa,[_0x271757,_0x3e855e]=useState(![]),[_0x5b1da2,_0x1651f5]=useState(![]),[_0x1d42b2,_0x424c76]=useState(''),_0x462d78=useCallback(async _0x328e89=>{const _0x44c011=a47_0x11aa,_0x2818b5=Date['now'](),_0x1cbc7c=a47_0x5cdfe0['resolve'](process[_0x44c011(0x1e8)](),_0x328e89);_0x3e855e(!![]);try{logger[_0x44c011(0x1d9)](_0x44c011(0x1d8),_0x44c011(0x1dd),{'projectCode':_0x328e89}),await execa(_0x44c011(0x1d6),[_0x44c011(0x1da),_0x44c011(0x1d7),'.'],{'cwd':_0x1cbc7c});const _0xbf10fc=Date['now']()-_0x2818b5;logger[_0x44c011(0x1e6)](_0x44c011(0x1d8),_0x44c011(0x1db),_0xbf10fc,{'projectCode':_0x328e89});}catch(_0x253928){const _0x3b3a34=Date[_0x44c011(0x1df)]()-_0x2818b5;logger[_0x44c011(0x1e3)](_0x44c011(0x1d8),'代码格式化失败',{'projectCode':_0x328e89,'error':_0x253928 instanceof Error?_0x253928[_0x44c011(0x1de)]:String(_0x253928),'duration':_0x3b3a34});throw _0x253928;}finally{_0x3e855e(![]),_0x1651f5(!![]),_0x424c76(formatElapsed(_0x2818b5));}},[]);return{'taskName':_0x2928d7(0x1e1),'finished':_0x5b1da2,'loading':_0x271757,'elapsed':_0x1d42b2,'doTask':_0x462d78};}
@@ -1 +1 @@
1
- (function(_0x14c44e,_0x48b813){const _0x877424=a48_0xd91a,_0x1b217f=_0x14c44e();while(!![]){try{const _0x96600a=-parseInt(_0x877424(0x1ef))/0x1+parseInt(_0x877424(0x1f3))/0x2*(parseInt(_0x877424(0x1ec))/0x3)+-parseInt(_0x877424(0x1f6))/0x4*(parseInt(_0x877424(0x1e8))/0x5)+-parseInt(_0x877424(0x1ed))/0x6+parseInt(_0x877424(0x1ea))/0x7+parseInt(_0x877424(0x1e9))/0x8*(parseInt(_0x877424(0x1e6))/0x9)+-parseInt(_0x877424(0x1f4))/0xa*(-parseInt(_0x877424(0x1f7))/0xb);if(_0x96600a===_0x48b813)break;else _0x1b217f['push'](_0x1b217f['shift']());}catch(_0x531993){_0x1b217f['push'](_0x1b217f['shift']());}}}(a48_0x5534,0x9fe5e));import a48_0x428d3e from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x21980d=a48_0xd91a,[_0x79cc1,_0x57dec3]=useState(![]),[_0x553b12,_0x598b1b]=useState(![]),[_0x10a28c,_0x2edc23]=useState(''),_0x202f2a=useCallback(async _0x1229bd=>{const _0x4d02a4=a48_0xd91a,_0x3bb906=Date[_0x4d02a4(0x1e5)](),_0x241af5=a48_0x428d3e[_0x4d02a4(0x1eb)](process['cwd'](),_0x1229bd);_0x57dec3(!![]),_0x598b1b(![]);const _0x5b5b33=async(_0xc78dd4,_0x35e5d2)=>{await execa(_0xc78dd4,_0x35e5d2,{'cwd':_0x241af5});};try{logger[_0x4d02a4(0x1f2)](_0x4d02a4(0x1f0),'开始安装依赖',{'projectCode':_0x1229bd,'registry':_0x4d02a4(0x1e7)}),await _0x5b5b33('npm',[_0x4d02a4(0x1f0),_0x4d02a4(0x1f5),'https://registry.npmmirror.com']);const _0xe1e7e1=Date[_0x4d02a4(0x1e5)]()-_0x3bb906;logger['success'](_0x4d02a4(0x1f0),'依赖安装完成',_0xe1e7e1,{'projectCode':_0x1229bd});}catch(_0x111bd6){const _0x3b3daa=Date[_0x4d02a4(0x1e5)]()-_0x3bb906;logger['error']('install',_0x4d02a4(0x1ee),{'projectCode':_0x1229bd,'error':_0x111bd6 instanceof Error?_0x111bd6['message']:String(_0x111bd6),'duration':_0x3b3daa});throw _0x111bd6;}finally{_0x57dec3(![]),_0x598b1b(!![]),_0x2edc23(formatElapsed(_0x3bb906));}},[]);return{'taskName':_0x21980d(0x1f1),'finished':_0x553b12,'loading':_0x79cc1,'elapsed':_0x10a28c,'doTask':_0x202f2a};}function a48_0xd91a(_0x59125a,_0x12d92c){_0x59125a=_0x59125a-0x1e5;const _0x55344c=a48_0x5534();let _0xd91a48=_0x55344c[_0x59125a];return _0xd91a48;}function a48_0x5534(){const _0x458883=['94761ilVZpZ','https://registry.npmmirror.com','1275iUAzbL','272ewoKMH','5154877jyDITp','resolve','3ENWNvC','7221450DDsLzW','依赖安装失败','1227248OLEdqd','install','安装依赖','info','1409502zEInkY','10mEJIQh','--registry','14664veiZjl','24435917hrQIbC','now'];a48_0x5534=function(){return _0x458883;};return a48_0x5534();}
1
+ (function(_0xce7c30,_0x228d62){const _0x286f3b=a48_0x1285,_0x5e8718=_0xce7c30();while(!![]){try{const _0x4c822c=parseInt(_0x286f3b(0x173))/0x1+-parseInt(_0x286f3b(0x166))/0x2+-parseInt(_0x286f3b(0x167))/0x3*(parseInt(_0x286f3b(0x16b))/0x4)+-parseInt(_0x286f3b(0x172))/0x5*(parseInt(_0x286f3b(0x16e))/0x6)+parseInt(_0x286f3b(0x168))/0x7+parseInt(_0x286f3b(0x178))/0x8+parseInt(_0x286f3b(0x16c))/0x9;if(_0x4c822c===_0x228d62)break;else _0x5e8718['push'](_0x5e8718['shift']());}catch(_0x510268){_0x5e8718['push'](_0x5e8718['shift']());}}}(a48_0x50b2,0xd091d));import a48_0x3ac5a7 from'node:path';function a48_0x50b2(){const _0x453997=['5205795PdbOYJ','npm','开始安装依赖','3407252YbWoZE','26850798UdxXFx','https://registry.npmmirror.com','1398coNBHd','依赖安装完成','install','success','34000FWTcco','139665eERzpG','info','cwd','now','resolve','9048232euXPNp','--registry','message','error','3414574PLBBAr','3jjYbHG'];a48_0x50b2=function(){return _0x453997;};return a48_0x50b2();}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a48_0x1285(_0x342246,_0x5beff2){_0x342246=_0x342246-0x164;const _0x50b2dd=a48_0x50b2();let _0x128566=_0x50b2dd[_0x342246];return _0x128566;}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const [_0x188be2,_0x19ba2e]=useState(![]),[_0x2684a5,_0x8d116b]=useState(![]),[_0x70cc21,_0x3a98b6]=useState(''),_0x278586=useCallback(async _0x28a99e=>{const _0x26e64c=a48_0x1285,_0x15e06d=Date['now'](),_0x32cdc2=a48_0x3ac5a7[_0x26e64c(0x177)](process[_0x26e64c(0x175)](),_0x28a99e);_0x19ba2e(!![]),_0x8d116b(![]);const _0x34a5d5=async(_0x3ff29b,_0x11befc)=>{await execa(_0x3ff29b,_0x11befc,{'cwd':_0x32cdc2});};try{logger[_0x26e64c(0x174)](_0x26e64c(0x170),_0x26e64c(0x16a),{'projectCode':_0x28a99e,'registry':_0x26e64c(0x16d)}),await _0x34a5d5(_0x26e64c(0x169),[_0x26e64c(0x170),_0x26e64c(0x179),_0x26e64c(0x16d)]);const _0x1a08dd=Date[_0x26e64c(0x176)]()-_0x15e06d;logger[_0x26e64c(0x171)]('install',_0x26e64c(0x16f),_0x1a08dd,{'projectCode':_0x28a99e});}catch(_0x63a587){const _0x29ab1a=Date[_0x26e64c(0x176)]()-_0x15e06d;logger[_0x26e64c(0x165)](_0x26e64c(0x170),'依赖安装失败',{'projectCode':_0x28a99e,'error':_0x63a587 instanceof Error?_0x63a587[_0x26e64c(0x164)]:String(_0x63a587),'duration':_0x29ab1a});throw _0x63a587;}finally{_0x19ba2e(![]),_0x8d116b(!![]),_0x3a98b6(formatElapsed(_0x15e06d));}},[]);return{'taskName':'安装依赖','finished':_0x2684a5,'loading':_0x188be2,'elapsed':_0x70cc21,'doTask':_0x278586};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x585448,_0x4548ed){var _0x2a6271=a49_0x5a83,_0x2de0ab=_0x585448();while(!![]){try{var _0x3a0106=parseInt(_0x2a6271(0x194))/0x1*(-parseInt(_0x2a6271(0x197))/0x2)+-parseInt(_0x2a6271(0x18f))/0x3*(-parseInt(_0x2a6271(0x18e))/0x4)+parseInt(_0x2a6271(0x19a))/0x5*(-parseInt(_0x2a6271(0x18c))/0x6)+parseInt(_0x2a6271(0x18d))/0x7+parseInt(_0x2a6271(0x192))/0x8+parseInt(_0x2a6271(0x195))/0x9*(parseInt(_0x2a6271(0x196))/0xa)+-parseInt(_0x2a6271(0x191))/0xb*(-parseInt(_0x2a6271(0x190))/0xc);if(_0x3a0106===_0x4548ed)break;else _0x2de0ab['push'](_0x2de0ab['shift']());}catch(_0x3852e7){_0x2de0ab['push'](_0x2de0ab['shift']());}}}(a49_0x5426,0x9c958));import{jsx as a49_0x5e1dea,jsxs as a49_0x38f6fa}from'react/jsx-runtime';function a49_0x5426(){var _0x5591f8=['lovrabet\x20--help','6uWiAmg','1497069LZGunc','8PBurYW','1804569SiAoTR','685284rhHCWQ','11BXZIvY','2077016bEQhFm','green','2nKdnVe','4419kzRICb','8350uMckVe','504066AjQqfS','查看可用命令。','column','4990990cOyiTO'];a49_0x5426=function(){return _0x5591f8;};return a49_0x5426();}import{Box,Text}from'ink';function a49_0x5a83(_0x7afe7d,_0x4d7416){_0x7afe7d=_0x7afe7d-0x18b;var _0x542600=a49_0x5426();var _0x5a83b9=_0x542600[_0x7afe7d];return _0x5a83b9;}export function Help(){var _0x468d93=a49_0x5a83;return a49_0x38f6fa(Box,{'flexDirection':_0x468d93(0x199),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x38f6fa(Box,{'children':[a49_0x5e1dea(Box,{'width':'1'}),a49_0x5e1dea(Text,{'children':'!\x20请指定一个有效的命令。'})]}),a49_0x38f6fa(Box,{'marginTop':0x1,'children':[a49_0x5e1dea(Box,{'width':'1'}),a49_0x38f6fa(Text,{'children':['\x20\x20','使用']}),a49_0x38f6fa(Text,{'bold':!![],'color':_0x468d93(0x193),'children':['\x20',_0x468d93(0x18b),'\x20']}),a49_0x5e1dea(Text,{'children':_0x468d93(0x198)})]})]});}
1
+ function a49_0x2eeb(){var _0x108530=['3518008ibFFCH','62936gPHgBo','4179810TvyFLJ','23110lKkybt','21Xeavnb','33066GJlVjo','!\x20请指定一个有效的命令。','129LnrhMp','查看可用命令。','362UfcUgX','1617546JmKUnj','4145Lhxvbl'];a49_0x2eeb=function(){return _0x108530;};return a49_0x2eeb();}(function(_0x54e74b,_0x1298ba){var _0xfbdf1b=a49_0x353b,_0x392249=_0x54e74b();while(!![]){try{var _0x42bf7e=-parseInt(_0xfbdf1b(0xd8))/0x1*(-parseInt(_0xfbdf1b(0xd6))/0x2)+parseInt(_0xfbdf1b(0xd4))/0x3*(parseInt(_0xfbdf1b(0xda))/0x4)+parseInt(_0xfbdf1b(0xd0))/0x5+-parseInt(_0xfbdf1b(0xd7))/0x6*(parseInt(_0xfbdf1b(0xd1))/0x7)+-parseInt(_0xfbdf1b(0xd9))/0x8+-parseInt(_0xfbdf1b(0xd2))/0x9+parseInt(_0xfbdf1b(0xcf))/0xa;if(_0x42bf7e===_0x1298ba)break;else _0x392249['push'](_0x392249['shift']());}catch(_0x29cd78){_0x392249['push'](_0x392249['shift']());}}}(a49_0x2eeb,0x91cdc));import{jsx as a49_0x498689,jsxs as a49_0x2bac0e}from'react/jsx-runtime';import{Box,Text}from'ink';function a49_0x353b(_0x303a51,_0x3433b2){_0x303a51=_0x303a51-0xcf;var _0x2eeb34=a49_0x2eeb();var _0x353b57=_0x2eeb34[_0x303a51];return _0x353b57;}export function Help(){var _0x2918f9=a49_0x353b;return a49_0x2bac0e(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a49_0x2bac0e(Box,{'children':[a49_0x498689(Box,{'width':'1'}),a49_0x498689(Text,{'children':_0x2918f9(0xd3)})]}),a49_0x2bac0e(Box,{'marginTop':0x1,'children':[a49_0x498689(Box,{'width':'1'}),a49_0x2bac0e(Text,{'children':['\x20\x20','使用']}),a49_0x2bac0e(Text,{'bold':!![],'color':'green','children':['\x20','lovrabet\x20--help','\x20']}),a49_0x498689(Text,{'children':_0x2918f9(0xd5)})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5c9a07,_0x56fa91){const _0xc87679=a50_0x7b5f,_0x43e33b=_0x5c9a07();while(!![]){try{const _0x5c38c5=-parseInt(_0xc87679(0x1dd))/0x1*(-parseInt(_0xc87679(0x1f8))/0x2)+-parseInt(_0xc87679(0x1e3))/0x3*(-parseInt(_0xc87679(0x1ee))/0x4)+parseInt(_0xc87679(0x1ed))/0x5+-parseInt(_0xc87679(0x1fa))/0x6*(parseInt(_0xc87679(0x1db))/0x7)+parseInt(_0xc87679(0x1fb))/0x8*(-parseInt(_0xc87679(0x1f1))/0x9)+parseInt(_0xc87679(0x1df))/0xa*(parseInt(_0xc87679(0x1ec))/0xb)+-parseInt(_0xc87679(0x1d1))/0xc*(parseInt(_0xc87679(0x1c8))/0xd);if(_0x5c38c5===_0x56fa91)break;else _0x43e33b['push'](_0x43e33b['shift']());}catch(_0x4a255a){_0x43e33b['push'](_0x43e33b['shift']());}}}(a50_0x486c,0x3d07b));import{jsxs as a50_0x22e97c,jsx as a50_0x278143}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';function a50_0x486c(){const _0x20d112=['error','初始化项目配置文件成功','column','189cfJMnT','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','158kZgGGo','backspace','40JzdoiN','slice','setLogPath','red','880788eEBApd','stringify','应用代码不合法','请输入应用代码\x20(AppCode):\x20','trim','green','env','delete','1.0.0','987646UsmJQv','2185040ymqGMO','4jpXQFF','AppCode:\x20','cwd','152127ncZRzD','info','cyan','message','parse','version','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','1592LSikwL','应用代码只能包含字母、数字、-\x20和\x20_','31230yvjcHm','16dnkWwo','length','13sjDuUU','package.json','utf8','exit','../..','string','ctrl','当前目录已存在\x20.lovrabetrc\x20文件','创建配置文件失败:\x20','9494352TXtCeS','test','online','return','应用代码长度不能超过\x20100\x20个字符','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','toLocaleString'];a50_0x486c=function(){return _0x20d112;};return a50_0x486c();}import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';function a50_0x7b5f(_0x528159,_0x3b909a){_0x528159=_0x528159-0x1c7;const _0x486cb3=a50_0x486c();let _0x7b5ff8=_0x486cb3[_0x528159];return _0x7b5ff8;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x10523b,env:_0xb8665a}){const _0x2e86d0=a50_0x7b5f,[_0x338301,_0x64b9cc]=useState(null),[_0x5c1663,_0xb3849e]=useState(![]),[_0x187fc1,_0x3e5fc8]=useState(!_0x10523b),[_0x5c0a81,_0x59de4f]=useState(''),[_0x17e47d,_0x2469a5]=useState(''),[_0x25f684,_0x4c80cb]=useState(_0x10523b||''),[_0x4d8314]=useState(_0xb8665a);function _0x253392(_0x4a7edd){const _0x1c503c=a50_0x7b5f;if(_0x4a7edd[_0x1c503c(0x1c7)]===0x0)return{'valid':![],'message':''};if(_0x4a7edd[_0x1c503c(0x1c7)]>0x64)return{'valid':![],'message':_0x1c503c(0x1d5)};const _0x3a13e4=/^[A-Za-z0-9_-]+$/;if(!_0x3a13e4[_0x1c503c(0x1d2)](_0x4a7edd))return{'valid':![],'message':_0x1c503c(0x1f9)};return{'valid':!![]};}useInput((_0x1cf96c,_0x5d70a0)=>{const _0x4631aa=a50_0x7b5f;if(!_0x187fc1)return;if(_0x5d70a0[_0x4631aa(0x1d4)]){if(_0x17e47d||!_0x5c0a81[_0x4631aa(0x1e7)]()){_0x2469a5('应用代码不能为空');return;}const _0x4bf084=_0x5c0a81[_0x4631aa(0x1e7)](),{valid:_0x10acbb,message:_0x451c82}=_0x253392(_0x4bf084);if(!_0x10acbb){_0x2469a5(_0x451c82||'应用代码不合法');return;}_0x4c80cb(_0x4bf084),_0x3e5fc8(![]);}else{if(_0x5d70a0[_0x4631aa(0x1de)]||_0x5d70a0[_0x4631aa(0x1ea)])_0x59de4f(_0x9f7a7a=>{const _0x165f52=_0x4631aa,_0x12b1d4=_0x9f7a7a[_0x165f52(0x1e0)](0x0,-0x1);if(_0x12b1d4['length']===0x0)_0x2469a5('');else{const {valid:_0x28a5a4,message:_0x50a63f}=_0x253392(_0x12b1d4);_0x2469a5(_0x28a5a4?'':_0x50a63f||_0x165f52(0x1e5));}return _0x12b1d4;});else _0x5d70a0[_0x4631aa(0x1ce)]&&_0x1cf96c==='c'?process[_0x4631aa(0x1cb)](0x0):_0x59de4f(_0x25091f=>{const _0x4c2407=_0x25091f+_0x1cf96c,{valid:_0x3f6816,message:_0x410bee}=_0x253392(_0x4c2407);return _0x2469a5(_0x3f6816?'':_0x410bee||'应用代码不合法'),_0x4c2407;});}},{'isActive':_0x187fc1}),useEffect(()=>{const _0x5279d4=a50_0x7b5f;if(!_0x25f684||_0x187fc1)return;const _0x15b874=resolve(process[_0x5279d4(0x1f0)](),'.lovrabetrc');if(existsSync(_0x15b874)){_0x64b9cc(_0x5279d4(0x1cf)),setTimeout(()=>process[_0x5279d4(0x1cb)](0x1),0x64);return;}try{const _0x477d5a=fileURLToPath(import.meta.url),_0x586de9=resolve(dirname(_0x477d5a),_0x5279d4(0x1cc)),_0x1018e9=join(_0x586de9,_0x5279d4(0x1c9));let _0x6dc5f0=_0x5279d4(0x1eb);try{const _0x47e579=JSON[_0x5279d4(0x1f5)](readFileSync(_0x1018e9,_0x5279d4(0x1ca)));_0x6dc5f0=_0x47e579['version']||_0x5279d4(0x1eb);}catch(_0x418c0a){}const _0x24f5cf=readConfig(),_0x20e93f=typeof _0x24f5cf[_0x5279d4(0x1e9)]===_0x5279d4(0x1cd)?_0x24f5cf[_0x5279d4(0x1e9)]:undefined,{app:_0x35763a,appcode:_0x368a08,..._0x4e559b}=_0x24f5cf,_0x3c3bb9={..._0x4e559b,'appcode':_0x25f684,'env':_0x4d8314||_0x20e93f||_0x5279d4(0x1d3),'createdAt':new Date()[_0x5279d4(0x1d7)](),'version':_0x6dc5f0};writeFileSync(_0x15b874,JSON[_0x5279d4(0x1e4)](_0x3c3bb9,null,0x2),{'encoding':_0x5279d4(0x1ca),'mode':0x180}),logger[_0x5279d4(0x1e1)](process[_0x5279d4(0x1f0)]()),logger[_0x5279d4(0x1f2)]('init',_0x5279d4(0x1d9),{'appcode':_0x25f684,'env':_0x3c3bb9[_0x5279d4(0x1e9)],'version':_0x3c3bb9[_0x5279d4(0x1f6)],'configPath':_0x15b874}),_0xb3849e(!![]),setTimeout(()=>process[_0x5279d4(0x1cb)](0x0),0x64);}catch(_0x2fb2b7){logger[_0x5279d4(0x1d8)]('init','创建配置文件失败',{'error':_0x2fb2b7 instanceof Error?_0x2fb2b7['message']:String(_0x2fb2b7)}),_0x64b9cc(_0x5279d4(0x1d0)+(_0x2fb2b7 instanceof Error?_0x2fb2b7[_0x5279d4(0x1f4)]:String(_0x2fb2b7))),setTimeout(()=>process[_0x5279d4(0x1cb)](0x1),0x64);}},[_0x25f684,_0x187fc1,_0x4d8314]);if(_0x338301)return a50_0x278143(Box,{'flexDirection':_0x2e86d0(0x1da),'children':a50_0x22e97c(Text,{'color':'red','children':['✗\x20',_0x338301]})});if(_0x187fc1)return a50_0x22e97c(Box,{'flexDirection':_0x2e86d0(0x1da),'children':[a50_0x22e97c(Box,{'children':[a50_0x278143(Text,{'color':_0x2e86d0(0x1f3),'children':_0x2e86d0(0x1e6)}),_0x5c0a81?a50_0x278143(Text,{'color':_0x2e86d0(0x1e8),'children':_0x5c0a81}):a50_0x278143(Text,{'color':'gray','children':'_'}),_0x17e47d&&a50_0x22e97c(Text,{'color':_0x2e86d0(0x1e2),'children':['\x20←\x20',_0x17e47d]})]}),!_0x17e47d&&!_0x5c0a81&&a50_0x278143(Box,{'children':a50_0x278143(Text,{'color':'gray','children':_0x2e86d0(0x1d6)})})]});if(_0x5c1663)return a50_0x22e97c(Box,{'flexDirection':'column','children':[a50_0x278143(Text,{'color':'green','children':_0x2e86d0(0x1f7)}),a50_0x22e97c(Text,{'color':_0x2e86d0(0x1f3),'children':[_0x2e86d0(0x1ef),_0x25f684]}),a50_0x278143(Text,{'children':_0x2e86d0(0x1dc)})]});return a50_0x278143(Box,{'children':a50_0x278143(Text,{'children':'正在初始化配置文件...'})});}
1
+ function a50_0x4ce0(_0x207432,_0xcedafe){_0x207432=_0x207432-0xdc;const _0x5bb071=a50_0x5bb0();let _0x4ce093=_0x5bb071[_0x207432];return _0x4ce093;}(function(_0x4adec9,_0x564bf0){const _0x1e6402=a50_0x4ce0,_0x3517a3=_0x4adec9();while(!![]){try{const _0x17993c=-parseInt(_0x1e6402(0xee))/0x1*(parseInt(_0x1e6402(0xdc))/0x2)+-parseInt(_0x1e6402(0xef))/0x3*(-parseInt(_0x1e6402(0xe7))/0x4)+-parseInt(_0x1e6402(0xed))/0x5*(-parseInt(_0x1e6402(0x108))/0x6)+parseInt(_0x1e6402(0x10a))/0x7*(-parseInt(_0x1e6402(0xde))/0x8)+-parseInt(_0x1e6402(0xea))/0x9+-parseInt(_0x1e6402(0xeb))/0xa+parseInt(_0x1e6402(0x102))/0xb;if(_0x17993c===_0x564bf0)break;else _0x3517a3['push'](_0x3517a3['shift']());}catch(_0x51ca6a){_0x3517a3['push'](_0x3517a3['shift']());}}}(a50_0x5bb0,0x75364));import{jsxs as a50_0x3636f9,jsx as a50_0x226d0a}from'react/jsx-runtime';import{useState,useEffect}from'react';function a50_0x5bb0(){const _0x57a33e=['创建配置文件失败','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','cyan','stringify','13370fYMUys','online','9840lpFYzR','info','delete','message','length','请输入应用代码\x20(AppCode):\x20','cwd','red','utf8','1009708wvHZKG','slice','trim','5135967OwlMPw','2527200MEObWV','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','215vgNQSI','5QFVsSF','6wgeVPF','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','string','env','应用代码长度不能超过\x20100\x20个字符','gray','1.0.0','.lovrabetrc','初始化项目配置文件成功','backspace','return','package.json','column','\x20←\x20','toLocaleString','green','setLogPath','正在初始化配置文件...','当前目录已存在\x20.lovrabetrc\x20文件','5754573FSEpsV','version','AppCode:\x20','应用代码不能为空','parse','应用代码不合法','80862BJiXrc','exit','1540zWyVds','init'];a50_0x5bb0=function(){return _0x57a33e;};return a50_0x5bb0();}import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x1b92a1,env:_0x21073a}){const _0x23bb6a=a50_0x4ce0,[_0x12a48a,_0x2d21d8]=useState(null),[_0xe9a599,_0x11f04e]=useState(![]),[_0xb81174,_0x22ab8f]=useState(!_0x1b92a1),[_0x1dc62b,_0x617a3d]=useState(''),[_0x477ca8,_0x10c5e2]=useState(''),[_0x3712c7,_0xad30b3]=useState(_0x1b92a1||''),[_0x370e15]=useState(_0x21073a);function _0x16803b(_0x1ba0d9){const _0x517809=a50_0x4ce0;if(_0x1ba0d9[_0x517809(0xe2)]===0x0)return{'valid':![],'message':''};if(_0x1ba0d9[_0x517809(0xe2)]>0x64)return{'valid':![],'message':_0x517809(0xf3)};const _0x59aef8=/^[A-Za-z0-9_-]+$/;if(!_0x59aef8['test'](_0x1ba0d9))return{'valid':![],'message':'应用代码只能包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}useInput((_0x550954,_0x39257d)=>{const _0x23ef45=a50_0x4ce0;if(!_0xb81174)return;if(_0x39257d[_0x23ef45(0xf9)]){if(_0x477ca8||!_0x1dc62b[_0x23ef45(0xe9)]()){_0x10c5e2(_0x23ef45(0x105));return;}const _0x65a89b=_0x1dc62b[_0x23ef45(0xe9)](),{valid:_0xe477e9,message:_0x380629}=_0x16803b(_0x65a89b);if(!_0xe477e9){_0x10c5e2(_0x380629||_0x23ef45(0x107));return;}_0xad30b3(_0x65a89b),_0x22ab8f(![]);}else{if(_0x39257d[_0x23ef45(0xf8)]||_0x39257d[_0x23ef45(0xe0)])_0x617a3d(_0x4d7020=>{const _0x41fbaa=_0x23ef45,_0x2a49b1=_0x4d7020[_0x41fbaa(0xe8)](0x0,-0x1);if(_0x2a49b1[_0x41fbaa(0xe2)]===0x0)_0x10c5e2('');else{const {valid:_0x14875,message:_0x29fd5f}=_0x16803b(_0x2a49b1);_0x10c5e2(_0x14875?'':_0x29fd5f||_0x41fbaa(0x107));}return _0x2a49b1;});else _0x39257d['ctrl']&&_0x550954==='c'?process[_0x23ef45(0x109)](0x0):_0x617a3d(_0xcb30b=>{const _0x59e886=_0x23ef45,_0xf33075=_0xcb30b+_0x550954,{valid:_0x428d02,message:_0x1dc379}=_0x16803b(_0xf33075);return _0x10c5e2(_0x428d02?'':_0x1dc379||_0x59e886(0x107)),_0xf33075;});}},{'isActive':_0xb81174}),useEffect(()=>{const _0x3eb439=a50_0x4ce0;if(!_0x3712c7||_0xb81174)return;const _0x1c124f=resolve(process[_0x3eb439(0xe4)](),_0x3eb439(0xf6));if(existsSync(_0x1c124f)){_0x2d21d8(_0x3eb439(0x101)),setTimeout(()=>process[_0x3eb439(0x109)](0x1),0x64);return;}try{const _0x129db3=fileURLToPath(import.meta.url),_0x12aa72=resolve(dirname(_0x129db3),'../..'),_0x277f06=join(_0x12aa72,_0x3eb439(0xfa));let _0x2688c6=_0x3eb439(0xf5);try{const _0x2fe043=JSON[_0x3eb439(0x106)](readFileSync(_0x277f06,'utf8'));_0x2688c6=_0x2fe043[_0x3eb439(0x103)]||_0x3eb439(0xf5);}catch(_0x43e6c8){}const _0x1626d7=readConfig(),_0x118d0a=typeof _0x1626d7['env']===_0x3eb439(0xf1)?_0x1626d7['env']:undefined,{app:_0x41cdec,appcode:_0x4db007,..._0x35c513}=_0x1626d7,_0x2f3cf7={..._0x35c513,'appcode':_0x3712c7,'env':_0x370e15||_0x118d0a||_0x3eb439(0xdd),'createdAt':new Date()[_0x3eb439(0xfd)](),'version':_0x2688c6};writeFileSync(_0x1c124f,JSON[_0x3eb439(0x10f)](_0x2f3cf7,null,0x2),{'encoding':_0x3eb439(0xe6),'mode':0x180}),logger[_0x3eb439(0xff)](process[_0x3eb439(0xe4)]()),logger[_0x3eb439(0xdf)](_0x3eb439(0x10b),_0x3eb439(0xf7),{'appcode':_0x3712c7,'env':_0x2f3cf7[_0x3eb439(0xf2)],'version':_0x2f3cf7[_0x3eb439(0x103)],'configPath':_0x1c124f}),_0x11f04e(!![]),setTimeout(()=>process[_0x3eb439(0x109)](0x0),0x64);}catch(_0x24f06a){logger['error']('init',_0x3eb439(0x10c),{'error':_0x24f06a instanceof Error?_0x24f06a['message']:String(_0x24f06a)}),_0x2d21d8('创建配置文件失败:\x20'+(_0x24f06a instanceof Error?_0x24f06a[_0x3eb439(0xe1)]:String(_0x24f06a))),setTimeout(()=>process['exit'](0x1),0x64);}},[_0x3712c7,_0xb81174,_0x370e15]);if(_0x12a48a)return a50_0x226d0a(Box,{'flexDirection':_0x23bb6a(0xfb),'children':a50_0x3636f9(Text,{'color':_0x23bb6a(0xe5),'children':['✗\x20',_0x12a48a]})});if(_0xb81174)return a50_0x3636f9(Box,{'flexDirection':_0x23bb6a(0xfb),'children':[a50_0x3636f9(Box,{'children':[a50_0x226d0a(Text,{'color':_0x23bb6a(0x10e),'children':_0x23bb6a(0xe3)}),_0x1dc62b?a50_0x226d0a(Text,{'color':_0x23bb6a(0xfe),'children':_0x1dc62b}):a50_0x226d0a(Text,{'color':'gray','children':'_'}),_0x477ca8&&a50_0x3636f9(Text,{'color':'red','children':[_0x23bb6a(0xfc),_0x477ca8]})]}),!_0x477ca8&&!_0x1dc62b&&a50_0x226d0a(Box,{'children':a50_0x226d0a(Text,{'color':_0x23bb6a(0xf4),'children':_0x23bb6a(0xec)})})]});if(_0xe9a599)return a50_0x3636f9(Box,{'flexDirection':_0x23bb6a(0xfb),'children':[a50_0x226d0a(Text,{'color':'green','children':_0x23bb6a(0x10d)}),a50_0x3636f9(Text,{'color':_0x23bb6a(0x10e),'children':[_0x23bb6a(0x104),_0x3712c7]}),a50_0x226d0a(Text,{'children':_0x23bb6a(0xf0)})]});return a50_0x226d0a(Box,{'children':a50_0x226d0a(Text,{'children':_0x23bb6a(0x100)})});}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- function a51_0x6ac4(_0x52fe34,_0xdfbd21){_0x52fe34=_0x52fe34-0x13b;const _0x2d44f1=a51_0x2d44();let _0x6ac4b2=_0x2d44f1[_0x52fe34];return _0x6ac4b2;}(function(_0x5ccd05,_0x145365){const _0x2e48aa=a51_0x6ac4,_0x3677cd=_0x5ccd05();while(!![]){try{const _0x37c80a=parseInt(_0x2e48aa(0x170))/0x1+-parseInt(_0x2e48aa(0x160))/0x2*(-parseInt(_0x2e48aa(0x16e))/0x3)+-parseInt(_0x2e48aa(0x144))/0x4*(-parseInt(_0x2e48aa(0x16b))/0x5)+-parseInt(_0x2e48aa(0x15d))/0x6*(parseInt(_0x2e48aa(0x13e))/0x7)+-parseInt(_0x2e48aa(0x157))/0x8*(-parseInt(_0x2e48aa(0x14e))/0x9)+parseInt(_0x2e48aa(0x13c))/0xa*(parseInt(_0x2e48aa(0x145))/0xb)+-parseInt(_0x2e48aa(0x14c))/0xc;if(_0x37c80a===_0x145365)break;else _0x3677cd['push'](_0x3677cd['shift']());}catch(_0x9cfe78){_0x3677cd['push'](_0x3677cd['shift']());}}}(a51_0x2d44,0x587c7));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a51_0x2d44(){const _0x1ff478=['npx','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','✓\x20创建\x20.cursor\x20目录:\x20','lovrabet-dataset','未找到\x20appcode\x20配置','app','\x20\x20-\x20配置文件:\x20','配置\x20Cursor\x20MCP\x20成功','250MwGQSc','\x0a配置信息:','创建\x20.cursor\x20目录','193416SDfYPD','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','216150YgPEMd','info','parse','exit','更新现有\x20mcp.json\x20配置','33410yvYeBw','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','1029TfARDL','配置\x20Cursor\x20MCP\x20失败','online','\x20\x20-\x20环境:\x20','rules','mcp.json','42424pHDZVI','2233NeYUuL','复制\x20Cursor\x20Rules\x20文件','@lovrabet/dataset-mcp-server','Cursor\x20Rules\x20模板文件不存在','error','错误:\x20配置失败:\x20','复制\x20Cursor\x20Rules\x20文件失败','19297152FXDpoQ','mcpServers','18FNdPOB','log','cwd','utf8','.cursor','../../templates/rules/lovrabet_rules.mdc.tpl','env','\x20\x20-\x20AppCode:\x20','✓\x20创建\x20mcp.json\x20配置文件','2409672Oobuzo','解析现有\x20mcp.json\x20失败','stringify','mcp-cursor','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','message','25992ApGXal','warn','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','18OoSomE','创建\x20.cursor/rules\x20目录','错误:\x20解析现有\x20mcp.json\x20失败:\x20'];a51_0x2d44=function(){return _0x1ff478;};return a51_0x2d44();}export async function configureCursorMcp(){const _0x8c541=a51_0x6ac4;try{const _0x4f866a=process[_0x8c541(0x150)](),_0x34671d=resolve(_0x4f866a,_0x8c541(0x152)),_0x5aa6e6=resolve(_0x34671d,_0x8c541(0x143)),_0x280c2e=readConfig(),_0x1567d0=_0x280c2e['appcode']||_0x280c2e[_0x8c541(0x168)],_0x411a75=_0x280c2e[_0x8c541(0x154)]||_0x8c541(0x140);!_0x1567d0&&(console['error']('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x8c541(0x149)]('mcp-cursor',_0x8c541(0x167)),process[_0x8c541(0x173)](0x1));!existsSync(_0x34671d)&&(mkdirSync(_0x34671d,{'recursive':!![]}),logger['info'](_0x8c541(0x15a),_0x8c541(0x16d),{'path':_0x34671d}),console[_0x8c541(0x14f)](_0x8c541(0x165)+_0x34671d));const _0x40b1c5={'command':_0x8c541(0x163),'args':['-y',_0x8c541(0x147)],'env':{'LOVRABET_APP_CODE':String(_0x1567d0),'LOVRABET_ENV':String(_0x411a75)}};let _0xeeb35b;if(existsSync(_0x5aa6e6))try{const _0xe50029=readFileSync(_0x5aa6e6,_0x8c541(0x151));_0xeeb35b=JSON[_0x8c541(0x172)](_0xe50029),!_0xeeb35b[_0x8c541(0x14d)]&&(_0xeeb35b['mcpServers']={}),_0xeeb35b['mcpServers'][_0x8c541(0x166)]=_0x40b1c5,logger[_0x8c541(0x171)](_0x8c541(0x15a),_0x8c541(0x13b),{'path':_0x5aa6e6,'appcode':_0x1567d0,'env':_0x411a75}),console[_0x8c541(0x14f)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x4e87a3){logger[_0x8c541(0x149)](_0x8c541(0x15a),_0x8c541(0x158),{'error':_0x4e87a3 instanceof Error?_0x4e87a3[_0x8c541(0x15c)]:String(_0x4e87a3)}),console['error'](_0x8c541(0x162)+(_0x4e87a3 instanceof Error?_0x4e87a3[_0x8c541(0x15c)]:String(_0x4e87a3))),process[_0x8c541(0x173)](0x1);}else _0xeeb35b={'mcpServers':{'lovrabet-dataset':_0x40b1c5}},logger[_0x8c541(0x171)](_0x8c541(0x15a),'创建新的\x20mcp.json\x20配置',{'path':_0x5aa6e6,'appcode':_0x1567d0,'env':_0x411a75}),console[_0x8c541(0x14f)](_0x8c541(0x156));writeFileSync(_0x5aa6e6,JSON[_0x8c541(0x159)](_0xeeb35b,null,0x2),{'encoding':_0x8c541(0x151)});const _0x3fd4ec=resolve(_0x34671d,_0x8c541(0x142)),_0x5a743f=resolve(_0x3fd4ec,'lovrabet_rules.mdc');if(!existsSync(_0x5a743f))try{!existsSync(_0x3fd4ec)&&(mkdirSync(_0x3fd4ec,{'recursive':!![]}),logger[_0x8c541(0x171)]('mcp-cursor',_0x8c541(0x161),{'path':_0x3fd4ec}));const _0x2481df=fileURLToPath(import.meta.url),_0xa5e827=dirname(_0x2481df),_0x2abaf9=resolve(_0xa5e827,_0x8c541(0x153));existsSync(_0x2abaf9)?(copyFileSync(_0x2abaf9,_0x5a743f),logger[_0x8c541(0x171)]('mcp-cursor',_0x8c541(0x146),{'from':_0x2abaf9,'to':_0x5a743f}),console[_0x8c541(0x14f)](_0x8c541(0x164))):logger[_0x8c541(0x15e)](_0x8c541(0x15a),_0x8c541(0x148),{'templatePath':_0x2abaf9});}catch(_0x4424f0){logger['error']('mcp-cursor',_0x8c541(0x14b),{'error':_0x4424f0 instanceof Error?_0x4424f0[_0x8c541(0x15c)]:String(_0x4424f0)}),console['warn'](_0x8c541(0x15f)+(_0x4424f0 instanceof Error?_0x4424f0[_0x8c541(0x15c)]:String(_0x4424f0)));}else console[_0x8c541(0x14f)](_0x8c541(0x15b)),logger[_0x8c541(0x171)](_0x8c541(0x15a),'Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x5a743f});console[_0x8c541(0x14f)]('\x0a✓\x20Cursor\x20MCP\x20配置成功!'),console[_0x8c541(0x14f)](_0x8c541(0x16c)),console[_0x8c541(0x14f)](_0x8c541(0x155)+_0x1567d0),console[_0x8c541(0x14f)](_0x8c541(0x141)+_0x411a75),console[_0x8c541(0x14f)](_0x8c541(0x169)+_0x5aa6e6),console['log'](_0x8c541(0x16f)),console[_0x8c541(0x14f)](_0x8c541(0x13d)),logger['info'](_0x8c541(0x15a),_0x8c541(0x16a),{'appcode':_0x1567d0,'env':_0x411a75,'configPath':_0x5aa6e6}),process[_0x8c541(0x173)](0x0);}catch(_0xe5a76f){logger[_0x8c541(0x149)](_0x8c541(0x15a),_0x8c541(0x13f),{'error':_0xe5a76f instanceof Error?_0xe5a76f[_0x8c541(0x15c)]:String(_0xe5a76f)}),console[_0x8c541(0x149)](_0x8c541(0x14a)+(_0xe5a76f instanceof Error?_0xe5a76f[_0x8c541(0x15c)]:String(_0xe5a76f))),process[_0x8c541(0x173)](0x1);}}
1
+ (function(_0x38de81,_0x19d807){const _0x2a2025=a51_0x2118,_0x5bbc05=_0x38de81();while(!![]){try{const _0x4121f9=-parseInt(_0x2a2025(0xec))/0x1+-parseInt(_0x2a2025(0xf2))/0x2+-parseInt(_0x2a2025(0xfa))/0x3+parseInt(_0x2a2025(0xf8))/0x4+parseInt(_0x2a2025(0x10d))/0x5+parseInt(_0x2a2025(0x10c))/0x6*(-parseInt(_0x2a2025(0xfd))/0x7)+-parseInt(_0x2a2025(0x10a))/0x8*(-parseInt(_0x2a2025(0x100))/0x9);if(_0x4121f9===_0x19d807)break;else _0x5bbc05['push'](_0x5bbc05['shift']());}catch(_0x476042){_0x5bbc05['push'](_0x5bbc05['shift']());}}}(a51_0x96b9,0xbfe63));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';function a51_0x2118(_0x2f0414,_0x41433d){_0x2f0414=_0x2f0414-0xe0;const _0x96b94c=a51_0x96b9();let _0x21189c=_0x96b94c[_0x2f0414];return _0x21189c;}function a51_0x96b9(){const _0xe13d90=['114811UgSLxX','env','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','app','exit','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','3107862YWJCEH','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','online','appcode','错误:\x20解析现有\x20mcp.json\x20失败:\x20','4357136geqHjj','message','3279864wvdUlT','parse','✓\x20更新\x20mcp.json\x20配置','7SOgKMH','log','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','18ABNeOj','复制\x20Cursor\x20Rules\x20文件失败','../../templates/rules/lovrabet_rules.mdc.tpl','创建新的\x20mcp.json\x20配置','配置\x20Cursor\x20MCP\x20失败','warn','info','stringify','@lovrabet/dataset-mcp-server','\x0a配置信息:','10581136PNoRaG','\x20\x20-\x20环境:\x20','8250126ZzBTFn','5942510XXIPXK','未找到\x20appcode\x20配置','解析现有\x20mcp.json\x20失败','utf8','\x20\x20-\x20配置文件:\x20','mcp.json','mcp-cursor','更新现有\x20mcp.json\x20配置','error','mcpServers','lovrabet-dataset','cwd','复制\x20Cursor\x20Rules\x20文件','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','npx'];a51_0x96b9=function(){return _0xe13d90;};return a51_0x96b9();}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x5be386=a51_0x2118;try{const _0x3daf76=process[_0x5be386(0xe8)](),_0x3c4ed8=resolve(_0x3daf76,'.cursor'),_0xf60c04=resolve(_0x3c4ed8,_0x5be386(0xe2)),_0x3a38ff=readConfig(),_0x403e2f=_0x3a38ff[_0x5be386(0xf6)]||_0x3a38ff[_0x5be386(0xef)],_0x3c4ef6=_0x3a38ff[_0x5be386(0xed)]||_0x5be386(0xf5);!_0x403e2f&&(console[_0x5be386(0xe5)](_0x5be386(0xee)),logger[_0x5be386(0xe5)]('mcp-cursor',_0x5be386(0x10e)),process[_0x5be386(0xf0)](0x1));!existsSync(_0x3c4ed8)&&(mkdirSync(_0x3c4ed8,{'recursive':!![]}),logger[_0x5be386(0x106)]('mcp-cursor','创建\x20.cursor\x20目录',{'path':_0x3c4ed8}),console['log']('✓\x20创建\x20.cursor\x20目录:\x20'+_0x3c4ed8));const _0x27173e={'command':_0x5be386(0xeb),'args':['-y',_0x5be386(0x108)],'env':{'LOVRABET_APP_CODE':String(_0x403e2f),'LOVRABET_ENV':String(_0x3c4ef6)}};let _0x5e3c2c;if(existsSync(_0xf60c04))try{const _0x344e49=readFileSync(_0xf60c04,_0x5be386(0xe0));_0x5e3c2c=JSON[_0x5be386(0xfb)](_0x344e49),!_0x5e3c2c[_0x5be386(0xe6)]&&(_0x5e3c2c[_0x5be386(0xe6)]={}),_0x5e3c2c[_0x5be386(0xe6)][_0x5be386(0xe7)]=_0x27173e,logger['info'](_0x5be386(0xe3),_0x5be386(0xe4),{'path':_0xf60c04,'appcode':_0x403e2f,'env':_0x3c4ef6}),console[_0x5be386(0xfe)](_0x5be386(0xfc));}catch(_0x116af8){logger[_0x5be386(0xe5)](_0x5be386(0xe3),_0x5be386(0x10f),{'error':_0x116af8 instanceof Error?_0x116af8[_0x5be386(0xf9)]:String(_0x116af8)}),console[_0x5be386(0xe5)](_0x5be386(0xf7)+(_0x116af8 instanceof Error?_0x116af8[_0x5be386(0xf9)]:String(_0x116af8))),process[_0x5be386(0xf0)](0x1);}else _0x5e3c2c={'mcpServers':{'lovrabet-dataset':_0x27173e}},logger[_0x5be386(0x106)](_0x5be386(0xe3),_0x5be386(0x103),{'path':_0xf60c04,'appcode':_0x403e2f,'env':_0x3c4ef6}),console[_0x5be386(0xfe)]('✓\x20创建\x20mcp.json\x20配置文件');writeFileSync(_0xf60c04,JSON[_0x5be386(0x107)](_0x5e3c2c,null,0x2),{'encoding':_0x5be386(0xe0)});const _0x1dd168=resolve(_0x3c4ed8,'rules'),_0xe43ab9=resolve(_0x1dd168,'lovrabet_rules.mdc');if(!existsSync(_0xe43ab9))try{!existsSync(_0x1dd168)&&(mkdirSync(_0x1dd168,{'recursive':!![]}),logger[_0x5be386(0x106)](_0x5be386(0xe3),'创建\x20.cursor/rules\x20目录',{'path':_0x1dd168}));const _0x1f081c=fileURLToPath(import.meta.url),_0x2a04e1=dirname(_0x1f081c),_0x908fc0=resolve(_0x2a04e1,_0x5be386(0x102));existsSync(_0x908fc0)?(copyFileSync(_0x908fc0,_0xe43ab9),logger[_0x5be386(0x106)](_0x5be386(0xe3),_0x5be386(0xe9),{'from':_0x908fc0,'to':_0xe43ab9}),console[_0x5be386(0xfe)](_0x5be386(0xff))):logger[_0x5be386(0x105)](_0x5be386(0xe3),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x908fc0});}catch(_0x4b0b61){logger[_0x5be386(0xe5)](_0x5be386(0xe3),_0x5be386(0x101),{'error':_0x4b0b61 instanceof Error?_0x4b0b61['message']:String(_0x4b0b61)}),console[_0x5be386(0x105)](_0x5be386(0xea)+(_0x4b0b61 instanceof Error?_0x4b0b61[_0x5be386(0xf9)]:String(_0x4b0b61)));}else console[_0x5be386(0xfe)](_0x5be386(0xf1)),logger[_0x5be386(0x106)]('mcp-cursor','Cursor\x20Rules\x20文件已存在,跳过',{'path':_0xe43ab9});console[_0x5be386(0xfe)]('\x0a✓\x20Cursor\x20MCP\x20配置成功!'),console[_0x5be386(0xfe)](_0x5be386(0x109)),console[_0x5be386(0xfe)]('\x20\x20-\x20AppCode:\x20'+_0x403e2f),console[_0x5be386(0xfe)](_0x5be386(0x10b)+_0x3c4ef6),console['log'](_0x5be386(0xe1)+_0xf60c04),console[_0x5be386(0xfe)](_0x5be386(0xf3)),console[_0x5be386(0xfe)](_0x5be386(0xf4)),logger[_0x5be386(0x106)](_0x5be386(0xe3),'配置\x20Cursor\x20MCP\x20成功',{'appcode':_0x403e2f,'env':_0x3c4ef6,'configPath':_0xf60c04}),process[_0x5be386(0xf0)](0x0);}catch(_0x50310a){logger[_0x5be386(0xe5)]('mcp-cursor',_0x5be386(0x104),{'error':_0x50310a instanceof Error?_0x50310a[_0x5be386(0xf9)]:String(_0x50310a)}),console[_0x5be386(0xe5)]('错误:\x20配置失败:\x20'+(_0x50310a instanceof Error?_0x50310a[_0x5be386(0xf9)]:String(_0x50310a))),process[_0x5be386(0xf0)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- function a52_0x4fd6(_0x3e2e1c,_0x84a91a){_0x3e2e1c=_0x3e2e1c-0x1a3;var _0x4542b6=a52_0x4542();var _0x4fd603=_0x4542b6[_0x3e2e1c];return _0x4fd603;}(function(_0x4561d1,_0x407706){var _0x3c2a12=a52_0x4fd6,_0x43c0b5=_0x4561d1();while(!![]){try{var _0x2b7f78=-parseInt(_0x3c2a12(0x1aa))/0x1+parseInt(_0x3c2a12(0x1ae))/0x2*(parseInt(_0x3c2a12(0x1b5))/0x3)+parseInt(_0x3c2a12(0x1b8))/0x4*(parseInt(_0x3c2a12(0x1a3))/0x5)+-parseInt(_0x3c2a12(0x1a7))/0x6*(parseInt(_0x3c2a12(0x1af))/0x7)+parseInt(_0x3c2a12(0x1bc))/0x8+parseInt(_0x3c2a12(0x1b3))/0x9*(-parseInt(_0x3c2a12(0x1b4))/0xa)+parseInt(_0x3c2a12(0x1a9))/0xb*(parseInt(_0x3c2a12(0x1b2))/0xc);if(_0x2b7f78===_0x407706)break;else _0x43c0b5['push'](_0x43c0b5['shift']());}catch(_0x5c6405){_0x43c0b5['push'](_0x43c0b5['shift']());}}}(a52_0x4542,0x2752e));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x16fe18){var _0x156513=a52_0x4fd6;logger[_0x156513(0x1ad)](process['cwd']());if(!_0x16fe18){console['error']('错误:\x20请指定\x20IDE\x20类型'),console[_0x156513(0x1a4)](_0x156513(0x1b6)),console[_0x156513(0x1a4)]('\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP'),console[_0x156513(0x1a4)]('\x0a示例:'),console[_0x156513(0x1a4)](_0x156513(0x1b1)),logger[_0x156513(0x1a6)](_0x156513(0x1bb),_0x156513(0x1ba)),process['exit'](0x1);return;}switch(_0x16fe18[_0x156513(0x1ab)]()){case _0x156513(0x1b0):logger['info'](_0x156513(0x1bb),_0x156513(0x1b9)),await configureCursorMcp();break;default:console[_0x156513(0x1a6)](_0x156513(0x1a5)+_0x16fe18),console['log'](_0x156513(0x1bd)),console[_0x156513(0x1a4)](_0x156513(0x1b7)),logger[_0x156513(0x1a6)]('mcp',_0x156513(0x1ac)+_0x16fe18),process[_0x156513(0x1a8)](0x1);break;}}function a52_0x4542(){var _0x5677f8=['\x20\x20lovrabet\x20mcp\x20cursor','640368jlgYBN','47106lxkTWg','590KjQehb','891045mXHygN','\x0a使用方法:','\x20\x20-\x20cursor','1940sBqrLK','执行配置\x20Cursor\x20MCP\x20命令','未指定\x20IDE\x20类型','mcp','1161704uHqRir','\x0a当前支持的\x20IDE:','2275ADkcTB','log','错误:\x20不支持的\x20IDE\x20类型:\x20','error','16314LPDvhs','exit','33lHsGkp','276987RcurxE','toLowerCase','不支持的\x20IDE\x20类型:\x20','setLogPath','2WdbvUw','196wCxcOS','cursor'];a52_0x4542=function(){return _0x5677f8;};return a52_0x4542();}
1
+ (function(_0x4e21ad,_0x361a27){var _0x471ddb=a52_0xc902,_0x4d9c54=_0x4e21ad();while(!![]){try{var _0x14a055=-parseInt(_0x471ddb(0xed))/0x1*(-parseInt(_0x471ddb(0xdc))/0x2)+-parseInt(_0x471ddb(0xde))/0x3+-parseInt(_0x471ddb(0xe9))/0x4*(parseInt(_0x471ddb(0xe3))/0x5)+-parseInt(_0x471ddb(0xe0))/0x6+parseInt(_0x471ddb(0xe2))/0x7*(-parseInt(_0x471ddb(0xdd))/0x8)+parseInt(_0x471ddb(0xd8))/0x9*(-parseInt(_0x471ddb(0xd6))/0xa)+parseInt(_0x471ddb(0xee))/0xb;if(_0x14a055===_0x361a27)break;else _0x4d9c54['push'](_0x4d9c54['shift']());}catch(_0x17c798){_0x4d9c54['push'](_0x4d9c54['shift']());}}}(a52_0x3857,0xa04da));function a52_0x3857(){var _0xc8ee90=['3490712hnNqen','error','\x20\x20-\x20cursor','未指定\x20IDE\x20类型','11437Romehl','32174714XtoLNK','log','mcp','不支持的\x20IDE\x20类型:\x20','120KMvmVw','\x0a示例:','40374MPdtyB','\x0a当前支持的\x20IDE:','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','\x0a使用方法:','134ONWojP','3144EbqWTN','3602415mzylnu','info','1534452zJNeiW','exit','11606GvEtbq','5GEJvYP','cwd','执行配置\x20Cursor\x20MCP\x20命令','setLogPath','错误:\x20请指定\x20IDE\x20类型','cursor'];a52_0x3857=function(){return _0xc8ee90;};return a52_0x3857();}function a52_0xc902(_0x7d293f,_0x1994bc){_0x7d293f=_0x7d293f-0xd3;var _0x385784=a52_0x3857();var _0xc9027a=_0x385784[_0x7d293f];return _0xc9027a;}import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x4634b4){var _0x586a74=a52_0xc902;logger[_0x586a74(0xe6)](process[_0x586a74(0xe4)]());if(!_0x4634b4){console[_0x586a74(0xea)](_0x586a74(0xe7)),console[_0x586a74(0xd3)](_0x586a74(0xdb)),console[_0x586a74(0xd3)](_0x586a74(0xda)),console[_0x586a74(0xd3)](_0x586a74(0xd7)),console['log']('\x20\x20lovrabet\x20mcp\x20cursor'),logger['error'](_0x586a74(0xd4),_0x586a74(0xec)),process[_0x586a74(0xe1)](0x1);return;}switch(_0x4634b4['toLowerCase']()){case _0x586a74(0xe8):logger[_0x586a74(0xdf)]('mcp',_0x586a74(0xe5)),await configureCursorMcp();break;default:console[_0x586a74(0xea)]('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x4634b4),console[_0x586a74(0xd3)](_0x586a74(0xd9)),console[_0x586a74(0xd3)](_0x586a74(0xeb)),logger['error']('mcp',_0x586a74(0xd5)+_0x4634b4),process['exit'](0x1);break;}}
@@ -1 +1 @@
1
- (function(_0x32ec17,_0x2062a2){const _0x313310=a54_0x7a51,_0x102e86=_0x32ec17();while(!![]){try{const _0x8df29f=-parseInt(_0x313310(0x19c))/0x1+parseInt(_0x313310(0x18d))/0x2*(-parseInt(_0x313310(0x188))/0x3)+parseInt(_0x313310(0x193))/0x4+parseInt(_0x313310(0x18e))/0x5*(-parseInt(_0x313310(0x199))/0x6)+parseInt(_0x313310(0x19a))/0x7+parseInt(_0x313310(0x18f))/0x8+-parseInt(_0x313310(0x184))/0x9*(-parseInt(_0x313310(0x194))/0xa);if(_0x8df29f===_0x2062a2)break;else _0x102e86['push'](_0x102e86['shift']());}catch(_0x59ebb1){_0x102e86['push'](_0x102e86['shift']());}}}(a54_0x50f1,0xaa0bd));import a54_0x5e0061 from'node:fs';import a54_0x389c03 from'node:path';import a54_0x47cc88 from'semver';const MIN_SDK_VERSION='1.2.0';export function checkSdkVersion(_0x1339b9){const _0x52d90a=a54_0x7a51,_0xad50c4=a54_0x389c03[_0x52d90a(0x183)](_0x1339b9,_0x52d90a(0x186));if(!a54_0x5e0061['existsSync'](_0xad50c4))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x2795c9=JSON[_0x52d90a(0x195)](a54_0x5e0061[_0x52d90a(0x19b)](_0xad50c4,_0x52d90a(0x192))),_0x2e4011=_0x2795c9['dependencies']||{},_0xb4b2e2=_0x2795c9['devDependencies']||{},_0x521011=_0x2e4011[_0x52d90a(0x185)]||_0xb4b2e2[_0x52d90a(0x185)];if(!_0x521011)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x5229a0=a54_0x47cc88[_0x52d90a(0x18a)](_0x521011),_0x2ff145=_0x5229a0?a54_0x47cc88['lt'](_0x5229a0,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x521011,'needsUpgrade':_0x2ff145,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}function a54_0x7a51(_0x18176a,_0x169987){_0x18176a=_0x18176a-0x180;const _0x50f1bb=a54_0x50f1();let _0x7a519e=_0x50f1bb[_0x18176a];return _0x7a519e;}function a54_0x50f1(){const _0x2f2c77=['7464656jsVruP','\x1b[0m','needsUpgrade','utf8','2050728ZeELar','10TZHJCt','parse','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','\x1b[1m','\x20\x20\x20请升级\x20SDK\x20至\x20','404292KsWyGJ','3376975FaFtAd','readFileSync','729794UEQgho','log','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','minVersion','join','9060372BhqSGx','@lovrabet/sdk','package.json','version','12brCVxU','\x1b[33m','coerce','\x20不支持新协议。','⚠️\x20\x20SDK\x20版本不兼容','585842oOQZBe','25YjWwyA'];a54_0x50f1=function(){return _0x2f2c77;};return a54_0x50f1();}export function printSdkUpgradeWarning(_0x5d779a){const _0x5d528f=a54_0x7a51;if(!_0x5d779a[_0x5d528f(0x191)])return;const _0x55e97c=_0x5d528f(0x189),_0x220d57=_0x5d528f(0x190),_0x1d10c4=_0x5d528f(0x197);console[_0x5d528f(0x180)](),console[_0x5d528f(0x180)](''+_0x55e97c+_0x1d10c4+_0x5d528f(0x18c)+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x181)+_0x5d779a[_0x5d528f(0x187)]+_0x5d528f(0x18b)+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x198)+_0x5d779a[_0x5d528f(0x182)]+'\x20或更高版本:'+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+'\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest'+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x196)+_0x220d57),console['log']();}
1
+ function a54_0x22b1(){const _0x1962da=['coerce','needsUpgrade','527712UxKhRT','\x1b[33m','2663358kKkCXg','\x20或更高版本:','minVersion','dependencies','@lovrabet/sdk','⚠️\x20\x20SDK\x20版本不兼容','583256LdZBvL','8596vxwJSU','readFileSync','log','join','2286450jmauPo','241605ktFGvK','utf8','existsSync','\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest','1bxZsCn','\x20\x20\x20请升级\x20SDK\x20至\x20','\x20不支持新协议。','\x1b[1m','95bfIdRl','version','639266ZMJTap','\x1b[0m','72zIMWHY','package.json'];a54_0x22b1=function(){return _0x1962da;};return a54_0x22b1();}(function(_0x5aa622,_0x288c64){const _0x19857f=a54_0x4afc,_0x1cf419=_0x5aa622();while(!![]){try{const _0x5318f4=parseInt(_0x19857f(0x12a))/0x1*(-parseInt(_0x19857f(0x112))/0x2)+-parseInt(_0x19857f(0x118))/0x3+parseInt(_0x19857f(0x121))/0x4*(-parseInt(_0x19857f(0x110))/0x5)+parseInt(_0x19857f(0x11a))/0x6+parseInt(_0x19857f(0x126))/0x7+parseInt(_0x19857f(0x120))/0x8*(parseInt(_0x19857f(0x114))/0x9)+-parseInt(_0x19857f(0x125))/0xa;if(_0x5318f4===_0x288c64)break;else _0x1cf419['push'](_0x1cf419['shift']());}catch(_0x35f341){_0x1cf419['push'](_0x1cf419['shift']());}}}(a54_0x22b1,0x486cb));import a54_0x578bf4 from'node:fs';import a54_0x298cac from'node:path';function a54_0x4afc(_0x3fa1d7,_0x2eaa3c){_0x3fa1d7=_0x3fa1d7-0x10d;const _0x22b14a=a54_0x22b1();let _0x4afcef=_0x22b14a[_0x3fa1d7];return _0x4afcef;}import a54_0x13e235 from'semver';const MIN_SDK_VERSION='1.2.0';export function checkSdkVersion(_0x160a9e){const _0x1f6fea=a54_0x4afc,_0x2eaa5c=a54_0x298cac[_0x1f6fea(0x124)](_0x160a9e,_0x1f6fea(0x115));if(!a54_0x578bf4[_0x1f6fea(0x128)](_0x2eaa5c))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x5d4fa9=JSON['parse'](a54_0x578bf4[_0x1f6fea(0x122)](_0x2eaa5c,_0x1f6fea(0x127))),_0x17477d=_0x5d4fa9[_0x1f6fea(0x11d)]||{},_0x240864=_0x5d4fa9['devDependencies']||{},_0x66c79c=_0x17477d['@lovrabet/sdk']||_0x240864[_0x1f6fea(0x11e)];if(!_0x66c79c)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x251e8e=a54_0x13e235[_0x1f6fea(0x116)](_0x66c79c),_0x5c263a=_0x251e8e?a54_0x13e235['lt'](_0x251e8e,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x66c79c,'needsUpgrade':_0x5c263a,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x4317b2){const _0x96136b=a54_0x4afc;if(!_0x4317b2[_0x96136b(0x117)])return;const _0xa78cfa=_0x96136b(0x119),_0x18201b=_0x96136b(0x113),_0x426e87=_0x96136b(0x10f);console[_0x96136b(0x123)](),console[_0x96136b(0x123)](''+_0xa78cfa+_0x426e87+_0x96136b(0x11f)+_0x18201b),console[_0x96136b(0x123)](_0xa78cfa+'\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20'+_0x4317b2[_0x96136b(0x111)]+_0x96136b(0x10e)+_0x18201b),console['log'](_0xa78cfa+_0x96136b(0x10d)+_0x4317b2[_0x96136b(0x11c)]+_0x96136b(0x11b)+_0x18201b),console[_0x96136b(0x123)](_0xa78cfa+_0x96136b(0x129)+_0x18201b),console[_0x96136b(0x123)](_0xa78cfa+'\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk'+_0x18201b),console[_0x96136b(0x123)]();}
@@ -1 +1 @@
1
- function a55_0x48b2(_0xe41f23,_0x202c62){_0xe41f23=_0xe41f23-0x110;const _0xa87468=a55_0xa874();let _0x48b23f=_0xa87468[_0xe41f23];return _0x48b23f;}const a55_0x103815=a55_0x48b2;(function(_0x498b41,_0x12721f){const _0x1fa2b1=a55_0x48b2,_0x5ca312=_0x498b41();while(!![]){try{const _0x35ef3d=parseInt(_0x1fa2b1(0x112))/0x1+parseInt(_0x1fa2b1(0x110))/0x2*(parseInt(_0x1fa2b1(0x121))/0x3)+parseInt(_0x1fa2b1(0x114))/0x4*(parseInt(_0x1fa2b1(0x118))/0x5)+parseInt(_0x1fa2b1(0x111))/0x6+-parseInt(_0x1fa2b1(0x117))/0x7*(parseInt(_0x1fa2b1(0x11c))/0x8)+parseInt(_0x1fa2b1(0x119))/0x9*(-parseInt(_0x1fa2b1(0x113))/0xa)+-parseInt(_0x1fa2b1(0x11e))/0xb*(parseInt(_0x1fa2b1(0x122))/0xc);if(_0x35ef3d===_0x12721f)break;else _0x5ca312['push'](_0x5ca312['shift']());}catch(_0x120280){_0x5ca312['push'](_0x5ca312['shift']());}}}(a55_0xa874,0x74e6d));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x103815(0x115)](),a55_0x103815(0x116));export const globalConfigPath=resolve(homedir(),a55_0x103815(0x116));export function readConfig(){const _0x4bdf14=a55_0x103815;let _0x5882ee={};try{if(existsSync(globalConfigPath)){const _0x592981=readFileSync(globalConfigPath,{'encoding':_0x4bdf14(0x11a)});_0x592981&&(_0x5882ee=JSON[_0x4bdf14(0x11d)](_0x592981));}}catch(_0x427194){}try{if(existsSync(projectConfigPath)){const _0x44a853=readFileSync(projectConfigPath,{'encoding':_0x4bdf14(0x11a)});if(_0x44a853){const _0x45edb4=JSON['parse'](_0x44a853);_0x5882ee={..._0x5882ee,..._0x45edb4};}}}catch(_0x45e479){}return _0x5882ee;}export function getConfigAppCode(){const _0x2d97e3=a55_0x103815;let _0x4763f4={},_0x2c1331={};try{if(existsSync(globalConfigPath)){const _0x11d2df=readFileSync(globalConfigPath,{'encoding':_0x2d97e3(0x11a)});_0x11d2df&&(_0x2c1331=JSON['parse'](_0x11d2df));}}catch(_0x342806){}try{if(existsSync(projectConfigPath)){const _0x5f3c10=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x5f3c10&&(_0x4763f4=JSON[_0x2d97e3(0x11d)](_0x5f3c10));}}catch(_0x5256a6){}let _0x4dfd26;if(_0x2d97e3(0x11f)in _0x4763f4)_0x4dfd26=_0x4763f4[_0x2d97e3(0x11f)];else{if(_0x2d97e3(0x11b)in _0x4763f4)_0x4dfd26=_0x4763f4[_0x2d97e3(0x11b)];else{if(_0x2d97e3(0x11f)in _0x2c1331)_0x4dfd26=_0x2c1331[_0x2d97e3(0x11f)];else _0x2d97e3(0x11b)in _0x2c1331&&(_0x4dfd26=_0x2c1331[_0x2d97e3(0x11b)]);}}if(typeof _0x4dfd26!=='string'||_0x4dfd26[_0x2d97e3(0x120)]()==='')return undefined;return _0x4dfd26;}export function isInProject(){return existsSync(projectConfigPath);}function a55_0xa874(){const _0x38ac78=['2946696guHWIe','765035AqEpiW','22030TdHWVa','4CQYSYv','cwd','.lovrabetrc','35BqEqsv','3650645gmHXWp','3501kwrasl','utf8','app','685936sixqTr','parse','2710741InuGbP','appcode','trim','6LhWLdt','24YbfqEq','271088ZMMQsk'];a55_0xa874=function(){return _0x38ac78;};return a55_0xa874();}
1
+ const a55_0x34f64c=a55_0x40bd;(function(_0x382056,_0x2bf82a){const _0x41c8d7=a55_0x40bd,_0x4a5c58=_0x382056();while(!![]){try{const _0x481b41=parseInt(_0x41c8d7(0xda))/0x1+-parseInt(_0x41c8d7(0xde))/0x2*(parseInt(_0x41c8d7(0xe2))/0x3)+parseInt(_0x41c8d7(0xdc))/0x4*(-parseInt(_0x41c8d7(0xd8))/0x5)+parseInt(_0x41c8d7(0xd7))/0x6+-parseInt(_0x41c8d7(0xdd))/0x7+-parseInt(_0x41c8d7(0xe3))/0x8+parseInt(_0x41c8d7(0xd3))/0x9;if(_0x481b41===_0x2bf82a)break;else _0x4a5c58['push'](_0x4a5c58['shift']());}catch(_0x2db822){_0x4a5c58['push'](_0x4a5c58['shift']());}}}(a55_0x2279,0x210e9));import{existsSync,readFileSync}from'node:fs';function a55_0x2279(){const _0x224660=['utf8','app','.lovrabetrc','3YIztLP','2068520XrhTMv','5455035xZIsPU','appcode','string','trim','548154jisXrs','10YLfbSF','parse','222579iEtzrs','cwd','432692CDtUxI','1601726avqdFy','161846OOhLlb'];a55_0x2279=function(){return _0x224660;};return a55_0x2279();}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x34f64c(0xdb)](),a55_0x34f64c(0xe1));export const globalConfigPath=resolve(homedir(),a55_0x34f64c(0xe1));function a55_0x40bd(_0x45df4f,_0x4ecfb6){_0x45df4f=_0x45df4f-0xd3;const _0x2279f1=a55_0x2279();let _0x40bd18=_0x2279f1[_0x45df4f];return _0x40bd18;}export function readConfig(){const _0x263016=a55_0x34f64c;let _0x3f7644={};try{if(existsSync(globalConfigPath)){const _0xca0f06=readFileSync(globalConfigPath,{'encoding':'utf8'});_0xca0f06&&(_0x3f7644=JSON['parse'](_0xca0f06));}}catch(_0x4cb0f9){}try{if(existsSync(projectConfigPath)){const _0x48d350=readFileSync(projectConfigPath,{'encoding':_0x263016(0xdf)});if(_0x48d350){const _0x19b950=JSON[_0x263016(0xd9)](_0x48d350);_0x3f7644={..._0x3f7644,..._0x19b950};}}}catch(_0xffe1d7){}return _0x3f7644;}export function getConfigAppCode(){const _0x4ca59c=a55_0x34f64c;let _0x179f31={},_0x2f56c3={};try{if(existsSync(globalConfigPath)){const _0xfc5337=readFileSync(globalConfigPath,{'encoding':_0x4ca59c(0xdf)});_0xfc5337&&(_0x2f56c3=JSON['parse'](_0xfc5337));}}catch(_0x230eb5){}try{if(existsSync(projectConfigPath)){const _0x262657=readFileSync(projectConfigPath,{'encoding':_0x4ca59c(0xdf)});_0x262657&&(_0x179f31=JSON[_0x4ca59c(0xd9)](_0x262657));}}catch(_0x1c97f4){}let _0xa65a43;if(_0x4ca59c(0xd4)in _0x179f31)_0xa65a43=_0x179f31[_0x4ca59c(0xd4)];else{if(_0x4ca59c(0xe0)in _0x179f31)_0xa65a43=_0x179f31[_0x4ca59c(0xe0)];else{if(_0x4ca59c(0xd4)in _0x2f56c3)_0xa65a43=_0x2f56c3[_0x4ca59c(0xd4)];else _0x4ca59c(0xe0)in _0x2f56c3&&(_0xa65a43=_0x2f56c3[_0x4ca59c(0xe0)]);}}if(typeof _0xa65a43!==_0x4ca59c(0xd5)||_0xa65a43[_0x4ca59c(0xd6)]()==='')return undefined;return _0xa65a43;}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- (function(_0x8e3141,_0x4994ca){const _0x1b4383=a56_0xd61c,_0x22701a=_0x8e3141();while(!![]){try{const _0x93673c=parseInt(_0x1b4383(0x129))/0x1+parseInt(_0x1b4383(0x124))/0x2+parseInt(_0x1b4383(0x123))/0x3+-parseInt(_0x1b4383(0x127))/0x4+parseInt(_0x1b4383(0x126))/0x5*(parseInt(_0x1b4383(0x12a))/0x6)+-parseInt(_0x1b4383(0x12d))/0x7+parseInt(_0x1b4383(0x11f))/0x8*(-parseInt(_0x1b4383(0x12c))/0x9);if(_0x93673c===_0x4994ca)break;else _0x22701a['push'](_0x22701a['shift']());}catch(_0x322b43){_0x22701a['push'](_0x22701a['shift']());}}}(a56_0x833a,0x199dc));function a56_0xd61c(_0x18cdf3,_0x1c88aa){_0x18cdf3=_0x18cdf3-0x11f;const _0x833a5f=a56_0x833a();let _0xd61c86=_0x833a5f[_0x18cdf3];return _0xd61c86;}function a56_0x833a(){const _0xb2e75f=['复制目录时出错:','error','isDirectory','196497iYbvSZ','291634pkPaXl','readdirSync','236915gtOctp','503900OqnUuL','join','115103loiuZh','6CAjFIQ','name','9JWBOVi','80220UupVNa','1051544tqgPFB'];a56_0x833a=function(){return _0xb2e75f;};return a56_0x833a();}import a56_0x1f1ef4 from'node:path';import a56_0x2e2d9f from'node:fs';export async function copyDirectory(_0x36c210,_0x2bb111){const _0x33c299=a56_0xd61c;try{const _0x39d895=a56_0x2e2d9f[_0x33c299(0x125)](_0x36c210,{'withFileTypes':!![]});a56_0x2e2d9f['mkdirSync'](_0x2bb111,{'recursive':!![]});for(const _0x649af5 of _0x39d895){const _0x26627c=a56_0x1f1ef4['join'](_0x36c210,_0x649af5[_0x33c299(0x12b)]),_0x5020ff=a56_0x1f1ef4[_0x33c299(0x128)](_0x2bb111,_0x649af5[_0x33c299(0x12b)]);_0x649af5[_0x33c299(0x122)]()?await copyDirectory(_0x26627c,_0x5020ff):a56_0x2e2d9f['copyFileSync'](_0x26627c,_0x5020ff);}}catch(_0x2cf030){console[_0x33c299(0x121)](_0x33c299(0x120),_0x2cf030);}}
1
+ (function(_0x19b8e1,_0x4ee520){const _0x596e00=a56_0x2c0a,_0x2920d3=_0x19b8e1();while(!![]){try{const _0x23bfce=parseInt(_0x596e00(0x91))/0x1+parseInt(_0x596e00(0x84))/0x2*(-parseInt(_0x596e00(0x88))/0x3)+-parseInt(_0x596e00(0x94))/0x4+-parseInt(_0x596e00(0x8c))/0x5*(parseInt(_0x596e00(0x92))/0x6)+-parseInt(_0x596e00(0x86))/0x7*(-parseInt(_0x596e00(0x8f))/0x8)+-parseInt(_0x596e00(0x8a))/0x9+-parseInt(_0x596e00(0x90))/0xa*(-parseInt(_0x596e00(0x8b))/0xb);if(_0x23bfce===_0x4ee520)break;else _0x2920d3['push'](_0x2920d3['shift']());}catch(_0x51360f){_0x2920d3['push'](_0x2920d3['shift']());}}}(a56_0x366c,0x3c985));function a56_0x366c(){const _0x4fb226=['36dMIvqB','error','1676824UsdQww','796122UpWlNN','isDirectory','106988iLJmad','join','3tEYSVX','mkdirSync','2051892fVXFIl','7058612lnIUZm','26035ASJHKr','name','copyFileSync','216BCHKRz','10ynQxUo','270334iIYfVb'];a56_0x366c=function(){return _0x4fb226;};return a56_0x366c();}import a56_0x396895 from'node:path';function a56_0x2c0a(_0x74ae5a,_0x38ec96){_0x74ae5a=_0x74ae5a-0x84;const _0x366ce0=a56_0x366c();let _0x2c0a97=_0x366ce0[_0x74ae5a];return _0x2c0a97;}import a56_0x1f0842 from'node:fs';export async function copyDirectory(_0x1e5ba8,_0x156f2e){const _0x284c41=a56_0x2c0a;try{const _0x5d12c7=a56_0x1f0842['readdirSync'](_0x1e5ba8,{'withFileTypes':!![]});a56_0x1f0842[_0x284c41(0x89)](_0x156f2e,{'recursive':!![]});for(const _0x5f0551 of _0x5d12c7){const _0xf15dff=a56_0x396895[_0x284c41(0x87)](_0x1e5ba8,_0x5f0551[_0x284c41(0x8d)]),_0x1cf1c1=a56_0x396895[_0x284c41(0x87)](_0x156f2e,_0x5f0551[_0x284c41(0x8d)]);_0x5f0551[_0x284c41(0x85)]()?await copyDirectory(_0xf15dff,_0x1cf1c1):a56_0x1f0842[_0x284c41(0x8e)](_0xf15dff,_0x1cf1c1);}}catch(_0x5a01e5){console[_0x284c41(0x93)]('复制目录时出错:',_0x5a01e5);}}
@@ -1 +1 @@
1
- (function(_0x4f5b9a,_0x24b535){const _0x158598=a57_0x53f1,_0x3b6b88=_0x4f5b9a();while(!![]){try{const _0x132c22=parseInt(_0x158598(0x201))/0x1+-parseInt(_0x158598(0x1e4))/0x2*(-parseInt(_0x158598(0x1e9))/0x3)+-parseInt(_0x158598(0x1ef))/0x4*(parseInt(_0x158598(0x1ee))/0x5)+parseInt(_0x158598(0x1fc))/0x6*(parseInt(_0x158598(0x1f2))/0x7)+parseInt(_0x158598(0x1fa))/0x8+-parseInt(_0x158598(0x1f0))/0x9+-parseInt(_0x158598(0x1eb))/0xa;if(_0x132c22===_0x24b535)break;else _0x3b6b88['push'](_0x3b6b88['shift']());}catch(_0x260ca5){_0x3b6b88['push'](_0x3b6b88['shift']());}}}(a57_0x59fe,0xa83a0));export async function httpRequest(_0x4748f5,_0x18438a={}){const _0x52f5a3=a57_0x53f1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x18438a;let _0xa1825e=null;for(let _0x7b4a7=0x0;_0x7b4a7<=retries;_0x7b4a7++){try{const _0x468a2b=new AbortController(),_0xcabd75=setTimeout(()=>_0x468a2b[_0x52f5a3(0x1ec)](),timeout),_0xfb766e=await fetch(_0x4748f5,{'headers':headers,'signal':_0x468a2b[_0x52f5a3(0x1e7)]});clearTimeout(_0xcabd75);let _0x2b78d7;const _0x3da151=_0xfb766e['headers'][_0x52f5a3(0x1e8)](_0x52f5a3(0x1e3));return _0x3da151?.[_0x52f5a3(0x1fe)](_0x52f5a3(0x1f7))?_0x2b78d7=await _0xfb766e[_0x52f5a3(0x1e6)]():_0x2b78d7=await _0xfb766e[_0x52f5a3(0x1fd)](),{'ok':_0xfb766e['ok'],'status':_0xfb766e[_0x52f5a3(0x1f3)],'statusText':_0xfb766e[_0x52f5a3(0x1ff)],'data':_0x2b78d7,'headers':_0xfb766e[_0x52f5a3(0x200)],'url':_0xfb766e[_0x52f5a3(0x1ea)],'text':()=>_0xfb766e[_0x52f5a3(0x1fd)]()};}catch(_0x43fb66){_0xa1825e=_0x43fb66 instanceof Error?_0x43fb66:new Error(String(_0x43fb66));if(_0x7b4a7===retries)break;if(shouldRetry(_0x43fb66)){console[_0x52f5a3(0x1e1)](_0x52f5a3(0x1e2)+retryDelay+_0x52f5a3(0x1f6)+(_0x7b4a7+0x1)+_0x52f5a3(0x1ed)),await sleep(retryDelay);continue;}else break;}}throw _0xa1825e||new Error(_0x52f5a3(0x1f1));}function shouldRetry(_0x25b0b1){const _0x677873=a57_0x53f1;if(_0x25b0b1 instanceof Error){if(_0x25b0b1[_0x677873(0x1f5)]===_0x677873(0x1f4))return![];if(_0x25b0b1[_0x677873(0x1f5)]===_0x677873(0x1f9)&&_0x25b0b1['message']['includes'](_0x677873(0x1fb)))return!![];if(_0x25b0b1[_0x677873(0x1f8)][_0x677873(0x1fe)]('ECONNRESET'))return!![];if(_0x25b0b1[_0x677873(0x1f8)][_0x677873(0x1fe)](_0x677873(0x1e5)))return![];}return![];}function a57_0x53f1(_0x3c420d,_0x2c7665){_0x3c420d=_0x3c420d-0x1e1;const _0x59feda=a57_0x59fe();let _0x53f134=_0x59feda[_0x3c420d];return _0x53f134;}function a57_0x59fe(){const _0x51d742=['2wKuaio','ENOTFOUND','json','signal','get','751974zvayGb','url','12667390AtIKOH','abort','\x20次重试...','160315kOYzVY','88PUvcgG','2099556AkHMer','Request\x20failed','4363793uAUfZY','status','AbortError','name','ms\x20后进行第\x20','application/json','message','TypeError','10738928LOTKZE','fetch','6eNSFhW','text','includes','statusText','headers','678042tjuIGQ','log','*\x20请求失败,','content-type'];a57_0x59fe=function(){return _0x51d742;};return a57_0x59fe();}function sleep(_0x109a5a){return new Promise(_0x302918=>setTimeout(_0x302918,_0x109a5a));}export function validateUrl(_0x26ea57){try{return new URL(_0x26ea57),!![];}catch{return![];}}
1
+ function a57_0x3b80(){const _0x2c43ae=['application/json','log','ms\x20后进行第\x20','*\x20请求失败,','4701880QdBwPO','1hTCoMC','statusText','\x20次重试...','url','884439hTddng','9ZtQweg','494396fuAXdd','116455RTHkrZ','message','name','abort','3051774lNxmTX','status','fetch','get','content-type','Request\x20failed','includes','json','4sfIxbh','3878192wBwoJm','36gpDGnF','6kwIInN','text','headers','signal','AbortError','4200945WOJRQH'];a57_0x3b80=function(){return _0x2c43ae;};return a57_0x3b80();}(function(_0x477d87,_0x5ea9a6){const _0x24b112=a57_0x14d4,_0x20af0b=_0x477d87();while(!![]){try{const _0x3f01ab=-parseInt(_0x24b112(0xd3))/0x1*(-parseInt(_0x24b112(0xd9))/0x2)+parseInt(_0x24b112(0xd7))/0x3*(-parseInt(_0x24b112(0xe6))/0x4)+-parseInt(_0x24b112(0xda))/0x5+parseInt(_0x24b112(0xe9))/0x6*(parseInt(_0x24b112(0xcd))/0x7)+parseInt(_0x24b112(0xe7))/0x8*(-parseInt(_0x24b112(0xd8))/0x9)+-parseInt(_0x24b112(0xd2))/0xa+parseInt(_0x24b112(0xde))/0xb*(parseInt(_0x24b112(0xe8))/0xc);if(_0x3f01ab===_0x5ea9a6)break;else _0x20af0b['push'](_0x20af0b['shift']());}catch(_0x24b424){_0x20af0b['push'](_0x20af0b['shift']());}}}(a57_0x3b80,0x63429));export async function httpRequest(_0x2544ce,_0x5613d0={}){const _0x510a05=a57_0x14d4,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x5613d0;let _0x373262=null;for(let _0x56a74d=0x0;_0x56a74d<=retries;_0x56a74d++){try{const _0x4ef90b=new AbortController(),_0xc3c6fe=setTimeout(()=>_0x4ef90b[_0x510a05(0xdd)](),timeout),_0x9001aa=await fetch(_0x2544ce,{'headers':headers,'signal':_0x4ef90b[_0x510a05(0xec)]});clearTimeout(_0xc3c6fe);let _0x1e6684;const _0x681e6f=_0x9001aa[_0x510a05(0xeb)][_0x510a05(0xe1)](_0x510a05(0xe2));return _0x681e6f?.['includes'](_0x510a05(0xce))?_0x1e6684=await _0x9001aa[_0x510a05(0xe5)]():_0x1e6684=await _0x9001aa[_0x510a05(0xea)](),{'ok':_0x9001aa['ok'],'status':_0x9001aa[_0x510a05(0xdf)],'statusText':_0x9001aa[_0x510a05(0xd4)],'data':_0x1e6684,'headers':_0x9001aa[_0x510a05(0xeb)],'url':_0x9001aa[_0x510a05(0xd6)],'text':()=>_0x9001aa[_0x510a05(0xea)]()};}catch(_0x13686b){_0x373262=_0x13686b instanceof Error?_0x13686b:new Error(String(_0x13686b));if(_0x56a74d===retries)break;if(shouldRetry(_0x13686b)){console[_0x510a05(0xcf)](_0x510a05(0xd1)+retryDelay+_0x510a05(0xd0)+(_0x56a74d+0x1)+_0x510a05(0xd5)),await sleep(retryDelay);continue;}else break;}}throw _0x373262||new Error(_0x510a05(0xe3));}function shouldRetry(_0x16d5e3){const _0x49dee8=a57_0x14d4;if(_0x16d5e3 instanceof Error){if(_0x16d5e3[_0x49dee8(0xdc)]===_0x49dee8(0xed))return![];if(_0x16d5e3[_0x49dee8(0xdc)]==='TypeError'&&_0x16d5e3['message'][_0x49dee8(0xe4)](_0x49dee8(0xe0)))return!![];if(_0x16d5e3['message'][_0x49dee8(0xe4)]('ECONNRESET'))return!![];if(_0x16d5e3[_0x49dee8(0xdb)][_0x49dee8(0xe4)]('ENOTFOUND'))return![];}return![];}function sleep(_0xd99393){return new Promise(_0x22aee6=>setTimeout(_0x22aee6,_0xd99393));}function a57_0x14d4(_0x55ae09,_0x38d8be){_0x55ae09=_0x55ae09-0xcd;const _0x3b803a=a57_0x3b80();let _0x14d4c6=_0x3b803a[_0x55ae09];return _0x14d4c6;}export function validateUrl(_0xf6c19c){try{return new URL(_0xf6c19c),!![];}catch{return![];}}
@@ -1 +1 @@
1
- function a58_0x1b0a(){const _0x241cb1=['7831117nPYAXk','.lovrabet.log','logTask','setLogPath','toISOString','initWinstonLogger','now','writeFileSync','info','2067626gQcBiM','success','command','readFileSync','currentRawCommand','1307913YgMyNq','blue','log','开始执行:\x20','errors','190552neZEVQ','10uBdiOW','2012838lnZXDX','mkdirSync','details','transports','format','timestamp','green','combine','message','trim','失败:\x20','level','getWinstonInstance','rawCommand','duration','dirname','split','parse','完成:\x20','filter','3567084FwPYFo','winstonLogger','utf8','existsSync','error','logFilePath','File','warn','createLogger','261IcylTF','clear','1023668pTZZNT'];a58_0x1b0a=function(){return _0x241cb1;};return a58_0x1b0a();}const a58_0x23c6b9=a58_0x1635;(function(_0x279a1d,_0x320e86){const _0x27b449=a58_0x1635,_0x5a9f53=_0x279a1d();while(!![]){try{const _0x2b367d=parseInt(_0x27b449(0x190))/0x1+-parseInt(_0x27b449(0x18b))/0x2+-parseInt(_0x27b449(0x176))/0x3+-parseInt(_0x27b449(0x181))/0x4*(parseInt(_0x27b449(0x196))/0x5)+parseInt(_0x27b449(0x197))/0x6+parseInt(_0x27b449(0x182))/0x7+parseInt(_0x27b449(0x195))/0x8*(parseInt(_0x27b449(0x17f))/0x9);if(_0x2b367d===_0x320e86)break;else _0x5a9f53['push'](_0x5a9f53['shift']());}catch(_0x22d2e7){_0x5a9f53['push'](_0x5a9f53['shift']());}}}(a58_0x1b0a,0xaf571));function a58_0x1635(_0x31846b,_0x5b68c7){_0x31846b=_0x31846b-0x164;const _0x1b0a3c=a58_0x1b0a();let _0x163584=_0x1b0a3c[_0x31846b];return _0x163584;}import a58_0x3a147f from'winston';import a58_0x518647 from'node:fs';import a58_0x166cba from'node:path';class Logger{[a58_0x23c6b9(0x177)];['logFilePath'];[a58_0x23c6b9(0x18f)]='';constructor(){const _0xc28815=a58_0x23c6b9;this[_0xc28815(0x17b)]='';}['setRawCommand'](_0x160de0){const _0x520c70=a58_0x23c6b9;this[_0x520c70(0x18f)]=_0x160de0;}[a58_0x23c6b9(0x187)](){const _0x89c12c=a58_0x23c6b9,_0x1f1ef3=a58_0x166cba[_0x89c12c(0x171)](this[_0x89c12c(0x17b)]);!a58_0x518647[_0x89c12c(0x179)](_0x1f1ef3)&&a58_0x518647[_0x89c12c(0x198)](_0x1f1ef3,{'recursive':!![]});const _0x4083de=a58_0x3a147f[_0x89c12c(0x166)][_0x89c12c(0x169)](a58_0x3a147f['format'][_0x89c12c(0x167)](),a58_0x3a147f['format'][_0x89c12c(0x194)]({'stack':!![]}),a58_0x3a147f[_0x89c12c(0x166)]['printf'](_0x54f549=>{const _0x424d29=_0x89c12c,_0x33eca6={'timestamp':_0x54f549[_0x424d29(0x167)]||new Date()[_0x424d29(0x186)](),'level':_0x54f549[_0x424d29(0x16d)]||_0x424d29(0x18a),'command':_0x54f549[_0x424d29(0x18d)]||'unknown','rawCommand':_0x54f549[_0x424d29(0x16f)]||this[_0x424d29(0x18f)]||undefined,'message':_0x54f549[_0x424d29(0x16a)]||'','duration':_0x54f549[_0x424d29(0x170)]||undefined,'details':_0x54f549[_0x424d29(0x164)]||undefined};return JSON['stringify'](_0x33eca6);}));this[_0x89c12c(0x177)]=a58_0x3a147f[_0x89c12c(0x17e)]({'level':_0x89c12c(0x18a),'format':_0x4083de,'transports':[new a58_0x3a147f[(_0x89c12c(0x165))][(_0x89c12c(0x17c))]({'filename':this['logFilePath'],'level':_0x89c12c(0x18a)})],'silent':![]}),a58_0x3a147f['addColors']({'success':_0x89c12c(0x168),'error':'red','warn':'yellow','info':_0x89c12c(0x191)});}[a58_0x23c6b9(0x185)](_0x3631cf){const _0x4515a9=a58_0x23c6b9;this[_0x4515a9(0x17b)]=a58_0x166cba['join'](_0x3631cf,_0x4515a9(0x183)),this['winstonLogger']&&this[_0x4515a9(0x177)][_0x4515a9(0x180)](),this[_0x4515a9(0x187)]();}['info'](_0x1f7d3d,_0x4e22de,_0x1699ff){const _0xeed1f5=a58_0x23c6b9;if(!this[_0xeed1f5(0x17b)]||!this[_0xeed1f5(0x177)])return;this[_0xeed1f5(0x177)][_0xeed1f5(0x18a)](_0x4e22de,{'command':_0x1f7d3d,'details':_0x1699ff});}[a58_0x23c6b9(0x18c)](_0x56de7c,_0x5f0233,_0x4d41c6,_0x40151d){const _0x262f45=a58_0x23c6b9;if(!this[_0x262f45(0x17b)]||!this[_0x262f45(0x177)])return;this['winstonLogger'][_0x262f45(0x192)](_0x262f45(0x18a),_0x5f0233,{'level':_0x262f45(0x18c),'command':_0x56de7c,'duration':_0x4d41c6,'details':_0x40151d});}[a58_0x23c6b9(0x17a)](_0x20b7cd,_0x2ffbca,_0x43c1f1){const _0x496952=a58_0x23c6b9;if(!this[_0x496952(0x17b)]||!this[_0x496952(0x177)])return;this[_0x496952(0x177)][_0x496952(0x17a)](_0x2ffbca,{'command':_0x20b7cd,'details':_0x43c1f1});}[a58_0x23c6b9(0x17d)](_0x520ce4,_0x3b59d8,_0x54b515){const _0x399509=a58_0x23c6b9;if(!this[_0x399509(0x17b)]||!this[_0x399509(0x177)])return;this[_0x399509(0x177)][_0x399509(0x17d)](_0x3b59d8,{'command':_0x520ce4,'details':_0x54b515});}async[a58_0x23c6b9(0x184)](_0x359927,_0x24c13e,_0x7fb011){const _0x4789b3=a58_0x23c6b9,_0x40f322=Date['now']();this['info'](_0x359927,_0x4789b3(0x193)+_0x24c13e);try{const _0x3f0066=await _0x7fb011(),_0x2f4903=Date[_0x4789b3(0x188)]()-_0x40f322;return this[_0x4789b3(0x18c)](_0x359927,_0x4789b3(0x174)+_0x24c13e,_0x2f4903),_0x3f0066;}catch(_0x53dc44){const _0x4feae4=Date[_0x4789b3(0x188)]()-_0x40f322;this[_0x4789b3(0x17a)](_0x359927,_0x4789b3(0x16c)+_0x24c13e,{'error':_0x53dc44 instanceof Error?_0x53dc44[_0x4789b3(0x16a)]:String(_0x53dc44),'duration':_0x4feae4});throw _0x53dc44;}}['readLogs'](){const _0x26472a=a58_0x23c6b9;try{if(!a58_0x518647[_0x26472a(0x179)](this[_0x26472a(0x17b)]))return[];const _0x37028e=a58_0x518647[_0x26472a(0x18e)](this['logFilePath'],_0x26472a(0x178));return _0x37028e[_0x26472a(0x172)]('\x0a')[_0x26472a(0x175)](_0x54dd62=>_0x54dd62[_0x26472a(0x16b)]())['map'](_0x3ae384=>JSON[_0x26472a(0x173)](_0x3ae384));}catch(_0x168f6b){return console[_0x26472a(0x17d)]('Failed\x20to\x20read\x20logs:',_0x168f6b),[];}}['clearLogs'](){const _0x4cf70c=a58_0x23c6b9;try{a58_0x518647[_0x4cf70c(0x179)](this['logFilePath'])&&a58_0x518647[_0x4cf70c(0x189)](this[_0x4cf70c(0x17b)],'','utf8');}catch(_0x2d1038){console[_0x4cf70c(0x17d)]('Failed\x20to\x20clear\x20logs:',_0x2d1038);}}[a58_0x23c6b9(0x16e)](){const _0x42814c=a58_0x23c6b9;return this[_0x42814c(0x177)];}}export const logger=new Logger();
1
+ const a58_0x532f51=a58_0x4aa3;(function(_0x3d97bd,_0x35091b){const _0x41328a=a58_0x4aa3,_0x234414=_0x3d97bd();while(!![]){try{const _0x5d4a16=-parseInt(_0x41328a(0x164))/0x1*(parseInt(_0x41328a(0x151))/0x2)+-parseInt(_0x41328a(0x140))/0x3+-parseInt(_0x41328a(0x15f))/0x4*(-parseInt(_0x41328a(0x136))/0x5)+-parseInt(_0x41328a(0x148))/0x6*(parseInt(_0x41328a(0x15e))/0x7)+-parseInt(_0x41328a(0x14e))/0x8*(-parseInt(_0x41328a(0x147))/0x9)+parseInt(_0x41328a(0x13b))/0xa+parseInt(_0x41328a(0x132))/0xb;if(_0x5d4a16===_0x35091b)break;else _0x234414['push'](_0x234414['shift']());}catch(_0x312f7d){_0x234414['push'](_0x234414['shift']());}}}(a58_0x2946,0x2411a));import a58_0x142455 from'winston';function a58_0x2946(){const _0x3af443=['2292620WZAHcT','winstonLogger','unknown','rawCommand','addColors','512079eLFUBg','transports','initWinstonLogger','stringify','toISOString','info','join','190467CLunfl','3954ttDohh','level','currentRawCommand','createLogger','green','dirname','88ildLqE','logFilePath','utf8','491608UJwtlv','existsSync','yellow','map','File','setLogPath','开始执行:\x20','duration','mkdirSync','printf','filter','.lovrabet.log','warn','1827NTdMaE','665092PLMxCy','log','clear','失败:\x20','details','1LehumE','format','success','timestamp','combine','readFileSync','1186966lJIpVb','message','now','parse','5GHeNri','blue','完成:\x20','error','Failed\x20to\x20clear\x20logs:'];a58_0x2946=function(){return _0x3af443;};return a58_0x2946();}import a58_0x177fec from'node:fs';import a58_0x5e54dc from'node:path';class Logger{['winstonLogger'];['logFilePath'];[a58_0x532f51(0x14a)]='';constructor(){const _0x1678fe=a58_0x532f51;this[_0x1678fe(0x14f)]='';}['setRawCommand'](_0x4a775b){const _0x14ff8d=a58_0x532f51;this[_0x14ff8d(0x14a)]=_0x4a775b;}[a58_0x532f51(0x142)](){const _0x35f440=a58_0x532f51,_0x5054b8=a58_0x5e54dc[_0x35f440(0x14d)](this['logFilePath']);!a58_0x177fec[_0x35f440(0x152)](_0x5054b8)&&a58_0x177fec[_0x35f440(0x159)](_0x5054b8,{'recursive':!![]});const _0x379a53=a58_0x142455[_0x35f440(0x165)][_0x35f440(0x168)](a58_0x142455[_0x35f440(0x165)][_0x35f440(0x167)](),a58_0x142455[_0x35f440(0x165)]['errors']({'stack':!![]}),a58_0x142455['format'][_0x35f440(0x15a)](_0x1a497e=>{const _0x4cea76=_0x35f440,_0x349b4e={'timestamp':_0x1a497e[_0x4cea76(0x167)]||new Date()[_0x4cea76(0x144)](),'level':_0x1a497e[_0x4cea76(0x149)]||'info','command':_0x1a497e['command']||_0x4cea76(0x13d),'rawCommand':_0x1a497e[_0x4cea76(0x13e)]||this[_0x4cea76(0x14a)]||undefined,'message':_0x1a497e['message']||'','duration':_0x1a497e[_0x4cea76(0x158)]||undefined,'details':_0x1a497e[_0x4cea76(0x163)]||undefined};return JSON[_0x4cea76(0x143)](_0x349b4e);}));this[_0x35f440(0x13c)]=a58_0x142455[_0x35f440(0x14b)]({'level':_0x35f440(0x145),'format':_0x379a53,'transports':[new a58_0x142455[(_0x35f440(0x141))][(_0x35f440(0x155))]({'filename':this[_0x35f440(0x14f)],'level':_0x35f440(0x145)})],'silent':![]}),a58_0x142455[_0x35f440(0x13f)]({'success':_0x35f440(0x14c),'error':'red','warn':_0x35f440(0x153),'info':_0x35f440(0x137)});}[a58_0x532f51(0x156)](_0x5ca2fc){const _0x33840f=a58_0x532f51;this[_0x33840f(0x14f)]=a58_0x5e54dc[_0x33840f(0x146)](_0x5ca2fc,_0x33840f(0x15c)),this[_0x33840f(0x13c)]&&this[_0x33840f(0x13c)][_0x33840f(0x161)](),this[_0x33840f(0x142)]();}[a58_0x532f51(0x145)](_0x23873c,_0x1d29ca,_0x5984b7){const _0x194c56=a58_0x532f51;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x194c56(0x13c)][_0x194c56(0x145)](_0x1d29ca,{'command':_0x23873c,'details':_0x5984b7});}['success'](_0x38773e,_0x42cc27,_0xda38c0,_0x187129){const _0x48088a=a58_0x532f51;if(!this[_0x48088a(0x14f)]||!this[_0x48088a(0x13c)])return;this['winstonLogger'][_0x48088a(0x160)](_0x48088a(0x145),_0x42cc27,{'level':_0x48088a(0x166),'command':_0x38773e,'duration':_0xda38c0,'details':_0x187129});}[a58_0x532f51(0x139)](_0x1eb821,_0x505e2c,_0x33adc3){const _0xdc916f=a58_0x532f51;if(!this[_0xdc916f(0x14f)]||!this['winstonLogger'])return;this[_0xdc916f(0x13c)][_0xdc916f(0x139)](_0x505e2c,{'command':_0x1eb821,'details':_0x33adc3});}[a58_0x532f51(0x15d)](_0x4e041d,_0x4a4500,_0x246d9a){const _0x32f361=a58_0x532f51;if(!this['logFilePath']||!this[_0x32f361(0x13c)])return;this[_0x32f361(0x13c)][_0x32f361(0x15d)](_0x4a4500,{'command':_0x4e041d,'details':_0x246d9a});}async['logTask'](_0x443f64,_0x23d76c,_0x1b5ae2){const _0x56fa=a58_0x532f51,_0x3dbdbd=Date[_0x56fa(0x134)]();this['info'](_0x443f64,_0x56fa(0x157)+_0x23d76c);try{const _0x3995e3=await _0x1b5ae2(),_0xc86ac9=Date['now']()-_0x3dbdbd;return this['success'](_0x443f64,_0x56fa(0x138)+_0x23d76c,_0xc86ac9),_0x3995e3;}catch(_0x4ca1f0){const _0x31d475=Date[_0x56fa(0x134)]()-_0x3dbdbd;this[_0x56fa(0x139)](_0x443f64,_0x56fa(0x162)+_0x23d76c,{'error':_0x4ca1f0 instanceof Error?_0x4ca1f0[_0x56fa(0x133)]:String(_0x4ca1f0),'duration':_0x31d475});throw _0x4ca1f0;}}['readLogs'](){const _0x5c8600=a58_0x532f51;try{if(!a58_0x177fec[_0x5c8600(0x152)](this['logFilePath']))return[];const _0x51c08c=a58_0x177fec[_0x5c8600(0x169)](this['logFilePath'],_0x5c8600(0x150));return _0x51c08c['split']('\x0a')[_0x5c8600(0x15b)](_0x33b134=>_0x33b134['trim']())[_0x5c8600(0x154)](_0xc176e4=>JSON[_0x5c8600(0x135)](_0xc176e4));}catch(_0x15837b){return console[_0x5c8600(0x15d)]('Failed\x20to\x20read\x20logs:',_0x15837b),[];}}['clearLogs'](){const _0xeb71d2=a58_0x532f51;try{a58_0x177fec['existsSync'](this[_0xeb71d2(0x14f)])&&a58_0x177fec['writeFileSync'](this[_0xeb71d2(0x14f)],'','utf8');}catch(_0x5b2487){console['warn'](_0xeb71d2(0x13a),_0x5b2487);}}['getWinstonInstance'](){const _0x1b929f=a58_0x532f51;return this[_0x1b929f(0x13c)];}}function a58_0x4aa3(_0x202db9,_0x1b8d1c){_0x202db9=_0x202db9-0x132;const _0x294689=a58_0x2946();let _0x4aa303=_0x294689[_0x202db9];return _0x4aa303;}export const logger=new Logger();
@@ -1 +1 @@
1
- function a59_0x24aa(_0x50aa27,_0xcd01f1){_0x50aa27=_0x50aa27-0x73;const _0x12fb4a=a59_0x12fb();let _0x24aad7=_0x12fb4a[_0x50aa27];return _0x24aad7;}const a59_0x232dda=a59_0x24aa;(function(_0x235a12,_0x163446){const _0x3e7c42=a59_0x24aa,_0x40b00b=_0x235a12();while(!![]){try{const _0x2000c1=parseInt(_0x3e7c42(0x7c))/0x1*(-parseInt(_0x3e7c42(0x86))/0x2)+parseInt(_0x3e7c42(0x79))/0x3+parseInt(_0x3e7c42(0x98))/0x4*(-parseInt(_0x3e7c42(0x7b))/0x5)+parseInt(_0x3e7c42(0xa3))/0x6*(parseInt(_0x3e7c42(0x92))/0x7)+-parseInt(_0x3e7c42(0x90))/0x8+parseInt(_0x3e7c42(0x89))/0x9*(-parseInt(_0x3e7c42(0x83))/0xa)+-parseInt(_0x3e7c42(0x75))/0xb*(-parseInt(_0x3e7c42(0x94))/0xc);if(_0x2000c1===_0x163446)break;else _0x40b00b['push'](_0x40b00b['shift']());}catch(_0x1cce04){_0x40b00b['push'](_0x40b00b['shift']());}}}(a59_0x12fb,0x83b3d));function a59_0x12fb(){const _0x23574a=['addImport','655920XTITEs','charAt','1227085SRdnwb','4FRzRFV','match','length','toLowerCase','\x20from\x20\x22../pages/','路由配置更新失败','src','7757110QHkaVW','index','lastIndexOf','287744cYawoZ','message','previewChanges','9kKaspj','indexOf','utf8','join','index.tsx','error','split','3112616oeWygy','includes','959HpTdYd','slice','24KBvDkL','import\x20','map','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','12uUHxxn','addRoute','writeFile','toComponentName','success','existsSync','routerFilePath','promises','路由文件不存在:\x20','未找到路由配置的\x20children\x20数组','开始更新路由配置','35772lQodFy','now','router','10893003oYVCcQ','readFile','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'];a59_0x12fb=function(){return _0x23574a;};return a59_0x12fb();}import a59_0x382a27 from'node:fs';import a59_0x3a9eb3 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x232dda(0x9e)];constructor(_0x2c0100){const _0x2170f2=a59_0x232dda;this[_0x2170f2(0x9e)]=a59_0x3a9eb3[_0x2170f2(0x8c)](_0x2c0100,_0x2170f2(0x82),'router',_0x2170f2(0x8d));}async['addPageRoute'](_0x454c21,_0x14fa4a){const _0x1ddbe1=a59_0x232dda;if(!a59_0x382a27[_0x1ddbe1(0x9d)](this['routerFilePath']))throw new Error(_0x1ddbe1(0xa0)+this[_0x1ddbe1(0x9e)]);const _0x543bb4=Date[_0x1ddbe1(0x73)]();logger['info'](_0x1ddbe1(0x74),_0x1ddbe1(0xa2),{'pageName':_0x454c21,'routePath':_0x14fa4a,'file':this[_0x1ddbe1(0x9e)]});try{const _0x192a07=await a59_0x382a27['promises'][_0x1ddbe1(0x76)](this[_0x1ddbe1(0x9e)],'utf8'),_0xca1ecf=this[_0x1ddbe1(0x9b)](_0x454c21),_0x25b9bc=this['addImport'](_0x192a07,_0xca1ecf,_0x454c21),_0x4c6761=this[_0x1ddbe1(0x99)](_0x25b9bc,_0x14fa4a,_0xca1ecf);await a59_0x382a27['promises'][_0x1ddbe1(0x9a)](this[_0x1ddbe1(0x9e)],_0x4c6761,'utf8');const _0x3e45a9=Date[_0x1ddbe1(0x73)]()-_0x543bb4;logger[_0x1ddbe1(0x9c)](_0x1ddbe1(0x74),'路由配置更新完成',_0x3e45a9,{'pageName':_0x454c21,'routePath':_0x14fa4a,'componentName':_0xca1ecf});}catch(_0x4f385e){const _0x42adb6=Date[_0x1ddbe1(0x73)]()-_0x543bb4;logger[_0x1ddbe1(0x8e)](_0x1ddbe1(0x74),_0x1ddbe1(0x81),{'pageName':_0x454c21,'routePath':_0x14fa4a,'error':_0x4f385e instanceof Error?_0x4f385e[_0x1ddbe1(0x87)]:String(_0x4f385e),'duration':_0x42adb6});throw _0x4f385e;}}[a59_0x232dda(0x9b)](_0x2d3057){const _0x124a7f=a59_0x232dda;return _0x2d3057[_0x124a7f(0x8f)]('-')[_0x124a7f(0x96)](_0x2bd6c1=>_0x2bd6c1[_0x124a7f(0x7a)](0x0)['toUpperCase']()+_0x2bd6c1['slice'](0x1)[_0x124a7f(0x7f)]())[_0x124a7f(0x8c)]('');}['addImport'](_0x13f1e5,_0x394b7b,_0x13f07e){const _0x2cc666=a59_0x232dda,_0x44232f=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x245fff=_0x13f1e5['match'](_0x44232f)||[],_0xb4b31f=_0x2cc666(0x95)+_0x394b7b+_0x2cc666(0x80)+_0x13f07e+'\x22;';if(_0x13f1e5[_0x2cc666(0x91)](_0xb4b31f))return _0x13f1e5;if(_0x245fff[_0x2cc666(0x7e)]>0x0){const _0x25f2f6=_0x245fff[_0x245fff[_0x2cc666(0x7e)]-0x1];if(_0x25f2f6){const _0x22f949=_0x13f1e5[_0x2cc666(0x85)](_0x25f2f6),_0x410862=_0x22f949+_0x25f2f6['length'];return _0x13f1e5[_0x2cc666(0x93)](0x0,_0x410862)+_0xb4b31f+'\x0a'+_0x13f1e5[_0x2cc666(0x93)](_0x410862);}}const _0x286f47=_0x13f1e5[_0x2cc666(0x7d)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x286f47&&_0x286f47['index']!==undefined){const _0x19b998=_0x286f47[_0x2cc666(0x84)]+_0x286f47[0x0]['length'];return _0x13f1e5['slice'](0x0,_0x19b998)+_0xb4b31f+'\x0a'+_0x13f1e5['slice'](_0x19b998);}return _0x13f1e5;}[a59_0x232dda(0x99)](_0x5b19ba,_0x6e8554,_0x45903f){const _0x49f50d=a59_0x232dda,_0x1b09b8=_0x49f50d(0x77)+_0x6e8554+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x45903f+_0x49f50d(0x97);if(_0x5b19ba[_0x49f50d(0x91)]('path:\x20\x22'+_0x6e8554+'\x22'))return _0x5b19ba;const _0xe12f0=/children:\s*\[([\s\S]*?)\]/,_0x14d6e7=_0x5b19ba[_0x49f50d(0x7d)](_0xe12f0);if(!_0x14d6e7||_0x14d6e7['index']===undefined)throw new Error(_0x49f50d(0xa1));const _0x41b66a=_0x14d6e7[0x1],_0x4d9c21=_0x14d6e7['index']+_0x14d6e7[0x0][_0x49f50d(0x8a)]('[')+0x1,_0x427c43=_0x41b66a?.[_0x49f50d(0x7d)](/\{[\s\S]*?\},/g)||[];if(_0x427c43[_0x49f50d(0x7e)]>0x0){const _0x11b689=_0x427c43[_0x427c43[_0x49f50d(0x7e)]-0x1];if(_0x11b689){const _0x505e0f=_0x5b19ba[_0x49f50d(0x85)](_0x11b689),_0x221a4a=_0x505e0f+_0x11b689[_0x49f50d(0x7e)];return _0x5b19ba[_0x49f50d(0x93)](0x0,_0x221a4a)+'\x0a'+_0x1b09b8+_0x5b19ba[_0x49f50d(0x93)](_0x221a4a);}}return _0x5b19ba['slice'](0x0,_0x4d9c21)+'\x0a'+_0x1b09b8+_0x5b19ba[_0x49f50d(0x93)](_0x4d9c21);}async[a59_0x232dda(0x88)](_0x48b930,_0x442e82){const _0x5aea1a=a59_0x232dda;if(!a59_0x382a27[_0x5aea1a(0x9d)](this[_0x5aea1a(0x9e)]))throw new Error(_0x5aea1a(0xa0)+this[_0x5aea1a(0x9e)]);const _0xa58333=await a59_0x382a27[_0x5aea1a(0x9f)][_0x5aea1a(0x76)](this[_0x5aea1a(0x9e)],_0x5aea1a(0x8b)),_0x39250c=this[_0x5aea1a(0x9b)](_0x48b930);let _0x24e740=this[_0x5aea1a(0x78)](_0xa58333,_0x39250c,_0x48b930);return _0x24e740=this[_0x5aea1a(0x99)](_0x24e740,_0x442e82,_0x39250c),_0x24e740;}}
1
+ const a59_0xb9b545=a59_0x226d;(function(_0x3d09d6,_0x3562c0){const _0x4319ec=a59_0x226d,_0xfed9e1=_0x3d09d6();while(!![]){try{const _0x491127=parseInt(_0x4319ec(0x169))/0x1+parseInt(_0x4319ec(0x189))/0x2*(-parseInt(_0x4319ec(0x170))/0x3)+parseInt(_0x4319ec(0x186))/0x4*(parseInt(_0x4319ec(0x18d))/0x5)+parseInt(_0x4319ec(0x182))/0x6+-parseInt(_0x4319ec(0x18e))/0x7*(-parseInt(_0x4319ec(0x191))/0x8)+parseInt(_0x4319ec(0x174))/0x9+parseInt(_0x4319ec(0x18c))/0xa*(-parseInt(_0x4319ec(0x168))/0xb);if(_0x491127===_0x3562c0)break;else _0xfed9e1['push'](_0xfed9e1['shift']());}catch(_0x101abc){_0xfed9e1['push'](_0xfed9e1['shift']());}}}(a59_0x4d0d,0x1cba5));import a59_0x425149 from'node:fs';import a59_0x11bb0d from'node:path';function a59_0x226d(_0x445678,_0x2fbb7f){_0x445678=_0x445678-0x168;const _0x4d0dc9=a59_0x4d0d();let _0x226d2c=_0x4d0dc9[_0x445678];return _0x226d2c;}import{logger}from'./logger.js';export class RouterUpdater{[a59_0xb9b545(0x16c)];constructor(_0x109b0c){const _0x4f052c=a59_0xb9b545;this[_0x4f052c(0x16c)]=a59_0x11bb0d['join'](_0x109b0c,_0x4f052c(0x17d),_0x4f052c(0x16e),'index.tsx');}async['addPageRoute'](_0x1cd5b1,_0x2c89d4){const _0x22bee0=a59_0xb9b545;if(!a59_0x425149[_0x22bee0(0x178)](this[_0x22bee0(0x16c)]))throw new Error('路由文件不存在:\x20'+this['routerFilePath']);const _0xeb9d13=Date[_0x22bee0(0x18b)]();logger['info'](_0x22bee0(0x16e),'开始更新路由配置',{'pageName':_0x1cd5b1,'routePath':_0x2c89d4,'file':this['routerFilePath']});try{const _0x3b0a78=await a59_0x425149['promises']['readFile'](this[_0x22bee0(0x16c)],'utf8'),_0x3820c5=this['toComponentName'](_0x1cd5b1),_0x41f3fc=this[_0x22bee0(0x17b)](_0x3b0a78,_0x3820c5,_0x1cd5b1),_0x30cd6e=this[_0x22bee0(0x17e)](_0x41f3fc,_0x2c89d4,_0x3820c5);await a59_0x425149[_0x22bee0(0x17f)][_0x22bee0(0x16f)](this[_0x22bee0(0x16c)],_0x30cd6e,_0x22bee0(0x185));const _0x5b3e17=Date[_0x22bee0(0x18b)]()-_0xeb9d13;logger[_0x22bee0(0x171)](_0x22bee0(0x16e),_0x22bee0(0x187),_0x5b3e17,{'pageName':_0x1cd5b1,'routePath':_0x2c89d4,'componentName':_0x3820c5});}catch(_0x53bd7b){const _0x113ee7=Date['now']()-_0xeb9d13;logger['error'](_0x22bee0(0x16e),_0x22bee0(0x173),{'pageName':_0x1cd5b1,'routePath':_0x2c89d4,'error':_0x53bd7b instanceof Error?_0x53bd7b[_0x22bee0(0x172)]:String(_0x53bd7b),'duration':_0x113ee7});throw _0x53bd7b;}}[a59_0xb9b545(0x16d)](_0x426070){const _0x55087f=a59_0xb9b545;return _0x426070[_0x55087f(0x16a)]('-')['map'](_0x348d47=>_0x348d47[_0x55087f(0x18a)](0x0)['toUpperCase']()+_0x348d47[_0x55087f(0x179)](0x1)['toLowerCase']())['join']('');}['addImport'](_0x1e0e4a,_0x5e9287,_0x5f256c){const _0x14322b=a59_0xb9b545,_0x957dde=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x5d3c1f=_0x1e0e4a[_0x14322b(0x180)](_0x957dde)||[],_0x46cfe5=_0x14322b(0x184)+_0x5e9287+_0x14322b(0x183)+_0x5f256c+'\x22;';if(_0x1e0e4a[_0x14322b(0x18f)](_0x46cfe5))return _0x1e0e4a;if(_0x5d3c1f[_0x14322b(0x188)]>0x0){const _0x185ee6=_0x5d3c1f[_0x5d3c1f['length']-0x1];if(_0x185ee6){const _0x17300c=_0x1e0e4a[_0x14322b(0x176)](_0x185ee6),_0x364c8f=_0x17300c+_0x185ee6[_0x14322b(0x188)];return _0x1e0e4a[_0x14322b(0x179)](0x0,_0x364c8f)+_0x46cfe5+'\x0a'+_0x1e0e4a[_0x14322b(0x179)](_0x364c8f);}}const _0xa0d562=_0x1e0e4a[_0x14322b(0x180)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0xa0d562&&_0xa0d562['index']!==undefined){const _0x230ded=_0xa0d562[_0x14322b(0x175)]+_0xa0d562[0x0][_0x14322b(0x188)];return _0x1e0e4a[_0x14322b(0x179)](0x0,_0x230ded)+_0x46cfe5+'\x0a'+_0x1e0e4a[_0x14322b(0x179)](_0x230ded);}return _0x1e0e4a;}[a59_0xb9b545(0x17e)](_0x350069,_0x202586,_0x192df0){const _0x52f791=a59_0xb9b545,_0x2996aa='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x202586+_0x52f791(0x17c)+_0x192df0+_0x52f791(0x181);if(_0x350069[_0x52f791(0x18f)](_0x52f791(0x16b)+_0x202586+'\x22'))return _0x350069;const _0x523e40=/children:\s*\[([\s\S]*?)\]/,_0x56323e=_0x350069[_0x52f791(0x180)](_0x523e40);if(!_0x56323e||_0x56323e[_0x52f791(0x175)]===undefined)throw new Error(_0x52f791(0x17a));const _0x240a11=_0x56323e[0x1],_0x2aff5f=_0x56323e[_0x52f791(0x175)]+_0x56323e[0x0]['indexOf']('[')+0x1,_0x35697d=_0x240a11?.[_0x52f791(0x180)](/\{[\s\S]*?\},/g)||[];if(_0x35697d[_0x52f791(0x188)]>0x0){const _0x14471e=_0x35697d[_0x35697d[_0x52f791(0x188)]-0x1];if(_0x14471e){const _0x102ba4=_0x350069[_0x52f791(0x176)](_0x14471e),_0x2394da=_0x102ba4+_0x14471e[_0x52f791(0x188)];return _0x350069[_0x52f791(0x179)](0x0,_0x2394da)+'\x0a'+_0x2996aa+_0x350069[_0x52f791(0x179)](_0x2394da);}}return _0x350069[_0x52f791(0x179)](0x0,_0x2aff5f)+'\x0a'+_0x2996aa+_0x350069[_0x52f791(0x179)](_0x2aff5f);}async['previewChanges'](_0x5e287f,_0x49c897){const _0x53d402=a59_0xb9b545;if(!a59_0x425149[_0x53d402(0x178)](this[_0x53d402(0x16c)]))throw new Error(_0x53d402(0x177)+this[_0x53d402(0x16c)]);const _0x2ce5e2=await a59_0x425149['promises'][_0x53d402(0x190)](this['routerFilePath'],_0x53d402(0x185)),_0x461536=this[_0x53d402(0x16d)](_0x5e287f);let _0x5b6825=this[_0x53d402(0x17b)](_0x2ce5e2,_0x461536,_0x5e287f);return _0x5b6825=this[_0x53d402(0x17e)](_0x5b6825,_0x49c897,_0x461536),_0x5b6825;}}function a59_0x4d0d(){const _0x33ced3=['258648aDQssD','11LXOCoo','157564Bqqtsf','split','path:\x20\x22','routerFilePath','toComponentName','router','writeFile','9SpRmQa','success','message','路由配置更新失败','430263diVsUL','index','lastIndexOf','路由文件不存在:\x20','existsSync','slice','未找到路由配置的\x20children\x20数组','addImport','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','src','addRoute','promises','match','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','116586EDyhgd','\x20from\x20\x22../pages/','import\x20','utf8','12HdSGhX','路由配置更新完成','length','94088mZWJTX','charAt','now','2915610cqkwRr','219290WoyrOp','42yQVKbn','includes','readFile'];a59_0x4d0d=function(){return _0x33ced3;};return a59_0x4d0d();}
@@ -1 +1 @@
1
- export function sleep(_0x35fc7f){return new Promise(_0x1b05fe=>setTimeout(_0x1b05fe,_0x35fc7f));}
1
+ export function sleep(_0x4c4e42){return new Promise(_0x549bde=>setTimeout(_0x549bde,_0x4c4e42));}
@@ -1 +1 @@
1
- const a61_0x175b81=a61_0x5c82;function a61_0x14bf(){const _0x35ad9b=['toUpperCase','default','mkdir','.css','message','45573ZCiCXO','toLocaleTimeString','slice','map','info','4BdYhyN','toISOString','replace','endsWith','push','split','readdir','copyFile','isDirectory','charAt','toDisplayTitle','.tsx','.md','template','readFile','toLocaleString','.jsx','\x20},','promises','8mMdoxA','\x0a\x20\x20\x20\x20{\x20','6ivbnKv','name','4400118PMMCGc','error','alias','模板内容替换完成','writeFile','toComponentName','11668TCNeqT','api','.tpl','extname','1049240DzNGve','now','264aJkmsX','pop','numeric','tableName:\x20\x22','join','809150RlmdmI','toLowerCase','YourModel','tableName','replaceApiContent','processFile','toLocaleDateString','alias:\x20\x22','processDirectory','46838xBKAVL','4QVAJLV','utf8','replaceContent','.ts','1016813FmUlAx','2-digit','datasetCode'];a61_0x14bf=function(){return _0x35ad9b;};return a61_0x14bf();}function a61_0x5c82(_0x25e0df,_0x1fe6a4){_0x25e0df=_0x25e0df-0xb7;const _0x14bf12=a61_0x14bf();let _0x5c82e7=_0x14bf12[_0x25e0df];return _0x5c82e7;}(function(_0x55a172,_0x3dbc16){const _0x2b87ce=a61_0x5c82,_0x20c2c0=_0x55a172();while(!![]){try{const _0x55fb33=-parseInt(_0x2b87ce(0xf4))/0x1*(-parseInt(_0x2b87ce(0xdf))/0x2)+parseInt(_0x2b87ce(0xbd))/0x3+-parseInt(_0x2b87ce(0xc2))/0x4*(parseInt(_0x2b87ce(0xea))/0x5)+-parseInt(_0x2b87ce(0xd7))/0x6*(parseInt(_0x2b87ce(0xf8))/0x7)+parseInt(_0x2b87ce(0xd5))/0x8*(parseInt(_0x2b87ce(0xd9))/0x9)+parseInt(_0x2b87ce(0xe3))/0xa+parseInt(_0x2b87ce(0xf3))/0xb*(parseInt(_0x2b87ce(0xe5))/0xc);if(_0x55fb33===_0x3dbc16)break;else _0x20c2c0['push'](_0x20c2c0['shift']());}catch(_0x5f5a14){_0x20c2c0['push'](_0x20c2c0['shift']());}}}(a61_0x14bf,0x6647c));import a61_0x526b22 from'node:fs';import a61_0x19ab8c from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a61_0x175b81(0xde)](_0x177d36){const _0x13aa32=a61_0x175b81,_0x5501c8=_0x177d36[_0x13aa32(0xc7)]('/')['pop']()||_0x177d36;return _0x5501c8[_0x13aa32(0xc7)]('-')[_0x13aa32(0xc0)](_0x1c8461=>_0x1c8461[_0x13aa32(0xcb)](0x0)[_0x13aa32(0xb8)]()+_0x1c8461[_0x13aa32(0xbf)](0x1)[_0x13aa32(0xeb)]())['join']('');}static['toDisplayTitle'](_0x59969b){const _0x2c117b=a61_0x175b81,_0xf63132=_0x59969b[_0x2c117b(0xc7)]('/')[_0x2c117b(0xe6)]()||_0x59969b;return _0xf63132[_0x2c117b(0xc7)]('-')[_0x2c117b(0xc0)](_0x5d3d1d=>_0x5d3d1d[_0x2c117b(0xcb)](0x0)['toUpperCase']()+_0x5d3d1d[_0x2c117b(0xbf)](0x1)[_0x2c117b(0xeb)]())[_0x2c117b(0xe9)]('\x20');}static['replaceContent'](_0x5911fd,_0x2b9ea0,_0xd02018){const _0x207905=a61_0x175b81,_0x9bdf47=this[_0x207905(0xde)](_0x2b9ea0),_0x83e5e5=this[_0x207905(0xcc)](_0x2b9ea0),_0x1c6429=new Date(),_0x3f7b2c=_0x1c6429[_0x207905(0xd1)](undefined,{'year':_0x207905(0xe7),'month':_0x207905(0xf9),'day':'2-digit','hour':'2-digit','minute':_0x207905(0xf9),'second':_0x207905(0xf9),'hour12':![]})['replace'](/\//g,'-'),_0x5bc2ef=_0x1c6429[_0x207905(0xf0)](undefined,{'year':_0x207905(0xe7),'month':_0x207905(0xf9),'day':'2-digit'})[_0x207905(0xc4)](/\//g,'-'),_0x1be29e=_0x1c6429[_0x207905(0xbe)](undefined,{'hour12':![]});let _0x120a41=_0x5911fd[_0x207905(0xc4)](/\{ComponentName\}/g,_0x9bdf47)[_0x207905(0xc4)](/\{DisplayTitle\}/g,_0x83e5e5)[_0x207905(0xc4)](/\{PageName\}/g,_0x2b9ea0)[_0x207905(0xc4)](/\{TemplateName\}/g,_0xd02018)[_0x207905(0xc4)](/\{CreatedAt\}/g,_0x3f7b2c)[_0x207905(0xc4)](/\{CreatedDate\}/g,_0x5bc2ef)[_0x207905(0xc4)](/\{CreatedTime\}/g,_0x1be29e);return _0x120a41;}static[a61_0x175b81(0xee)](_0x1bb119,_0x595bb3,_0x16ffa7,_0x233b5a,_0x2e4cf6,_0x19aab3,_0x2ac58d){const _0xfd0422=a61_0x175b81,_0x56abcb=new Date(),_0x32106a=_0x56abcb[_0xfd0422(0xc3)](),_0x105fae=_0x16ffa7[_0xfd0422(0xc0)](_0x16f9e6=>{const _0x526313=_0xfd0422,_0x2111d4=['datasetCode:\x20\x22'+_0x16f9e6[_0x526313(0xb7)]+'\x22',_0x526313(0xe8)+_0x16f9e6[_0x526313(0xed)]+'\x22','name:\x20\x22'+_0x16f9e6[_0x526313(0xd8)]+'\x22'];return _0x16f9e6['alias']&&_0x2111d4[_0x526313(0xc6)](_0x526313(0xf1)+_0x16f9e6[_0x526313(0xdb)]+'\x22'),_0x526313(0xd6)+_0x2111d4[_0x526313(0xe9)](',\x20')+_0x526313(0xd3);})[_0xfd0422(0xe9)](''),_0x673f81=_0x233b5a||_0x16ffa7[0x0]?.[_0xfd0422(0xdb)]||_0xfd0422(0xec);let _0xd9eeba=_0x1bb119[_0xfd0422(0xc4)](/\{AppCode\}/g,_0x595bb3)[_0xfd0422(0xc4)](/\{ModelConfigs\}/g,_0x105fae)[_0xfd0422(0xc4)](/\{ExampleModelName\}/g,_0x673f81)[_0xfd0422(0xc4)](/\{ApiFileName\}/g,_0x2e4cf6||_0xfd0422(0xe0))[_0xfd0422(0xc4)](/\{ConfigName\}/g,_0x19aab3||_0xfd0422(0xb9))['replace'](/\{ClientConfigParam\}/g,_0x2ac58d||'')[_0xfd0422(0xc4)](/\{CreatedAt\}/g,_0x32106a);return _0xd9eeba;}static async['processTemplate'](_0x2c1076,_0x3ef750,_0x4f8def,_0x1e556c,_0x1119e1=!![]){const _0x36932b=a61_0x175b81,_0x2e4fab=Date[_0x36932b(0xe4)]();try{_0x1119e1&&logger[_0x36932b(0xc1)](_0x36932b(0xcf),'开始处理模板内容替换',{'templatePath':_0x2c1076,'targetPath':_0x3ef750,'pageName':_0x4f8def,'templateName':_0x1e556c});await a61_0x526b22[_0x36932b(0xd4)][_0x36932b(0xba)](_0x3ef750,{'recursive':!![]}),await this[_0x36932b(0xf2)](_0x2c1076,_0x3ef750,_0x4f8def,_0x1e556c);if(_0x1119e1){const _0xfbe0cd=Date[_0x36932b(0xe4)]()-_0x2e4fab;logger['success']('template',_0x36932b(0xdc),_0xfbe0cd,{'pageName':_0x4f8def,'templateName':_0x1e556c});}}catch(_0x4d2c6f){if(_0x1119e1){const _0xab3850=Date[_0x36932b(0xe4)]()-_0x2e4fab;logger[_0x36932b(0xda)](_0x36932b(0xcf),'模板内容替换失败',{'templatePath':_0x2c1076,'targetPath':_0x3ef750,'pageName':_0x4f8def,'templateName':_0x1e556c,'error':_0x4d2c6f instanceof Error?_0x4d2c6f[_0x36932b(0xbc)]:String(_0x4d2c6f),'duration':_0xab3850});}throw _0x4d2c6f;}}static async['processDirectory'](_0x114351,_0x3740b3,_0x299265,_0x5e04ba){const _0xf1a15c=a61_0x175b81,_0x4d6ad1=await a61_0x526b22['promises'][_0xf1a15c(0xc8)](_0x114351,{'withFileTypes':!![]});for(const _0x5229ae of _0x4d6ad1){const _0x410d91=a61_0x19ab8c[_0xf1a15c(0xe9)](_0x114351,_0x5229ae[_0xf1a15c(0xd8)]);let _0x19ece2=a61_0x19ab8c['join'](_0x3740b3,_0x5229ae['name']);_0x5229ae[_0xf1a15c(0xd8)]['endsWith'](_0xf1a15c(0xe1))&&(_0x19ece2=a61_0x19ab8c['join'](_0x3740b3,_0x5229ae[_0xf1a15c(0xd8)][_0xf1a15c(0xc4)](/\.tpl$/,'')));if(_0x5229ae[_0xf1a15c(0xca)]())await a61_0x526b22[_0xf1a15c(0xd4)][_0xf1a15c(0xba)](_0x19ece2,{'recursive':!![]}),await this[_0xf1a15c(0xf2)](_0x410d91,_0x19ece2,_0x299265,_0x5e04ba);else _0x5229ae['isFile']()&&await this[_0xf1a15c(0xef)](_0x410d91,_0x19ece2,_0x299265,_0x5e04ba);}}static async[a61_0x175b81(0xef)](_0x4fadc9,_0x352a89,_0x514b3b,_0x3c62a1){const _0x5afe50=a61_0x175b81,_0xbe5603=a61_0x19ab8c[_0x5afe50(0xe2)](_0x4fadc9)[_0x5afe50(0xeb)]();_0x4fadc9['endsWith']('.tpl')&&(_0x352a89=_0x352a89[_0x5afe50(0xc4)](/\.tpl$/,''));const _0xce8d62=[_0x5afe50(0xcd),_0x5afe50(0xf7),_0x5afe50(0xd2),'.js','.json',_0x5afe50(0xce),_0x5afe50(0xbb),'.scss','.tpl'];if(_0xce8d62['includes'](_0xbe5603)||_0x4fadc9[_0x5afe50(0xc5)](_0x5afe50(0xe1))){const _0x2342ae=await a61_0x526b22['promises'][_0x5afe50(0xd0)](_0x4fadc9,_0x5afe50(0xf5)),_0x1ccbe1=this[_0x5afe50(0xf6)](_0x2342ae,_0x514b3b,_0x3c62a1);await a61_0x526b22[_0x5afe50(0xd4)][_0x5afe50(0xdd)](_0x352a89,_0x1ccbe1,_0x5afe50(0xf5));}else await a61_0x526b22[_0x5afe50(0xd4)][_0x5afe50(0xc9)](_0x4fadc9,_0x352a89);}}
1
+ const a61_0x576e79=a61_0x1416;(function(_0x3af480,_0x3d37b5){const _0x3a2aba=a61_0x1416,_0x596259=_0x3af480();while(!![]){try{const _0x2f9205=-parseInt(_0x3a2aba(0x10c))/0x1*(parseInt(_0x3a2aba(0xf3))/0x2)+parseInt(_0x3a2aba(0xe8))/0x3+parseInt(_0x3a2aba(0xe9))/0x4*(-parseInt(_0x3a2aba(0xe0))/0x5)+parseInt(_0x3a2aba(0x11b))/0x6*(-parseInt(_0x3a2aba(0x104))/0x7)+-parseInt(_0x3a2aba(0xff))/0x8+parseInt(_0x3a2aba(0xde))/0x9+parseInt(_0x3a2aba(0x117))/0xa;if(_0x2f9205===_0x3d37b5)break;else _0x596259['push'](_0x596259['shift']());}catch(_0x277053){_0x596259['push'](_0x596259['shift']());}}}(a61_0x383a,0x98f7c));import a61_0x232249 from'node:fs';function a61_0x383a(){const _0x3156e4=['split','1958406DNFNLp','8wJElMb','processFile','message','charAt','模板内容替换完成','replaceContent','\x0a\x20\x20\x20\x20{\x20','toLocaleString','datasetCode','pop','36424yFcwjh','toISOString','toUpperCase','.tsx','copyFile','readFile','name','now','map','alias','toLocaleDateString','promises','4712272akIyfT','模板内容替换失败','numeric','template','endsWith','181328advwAP','replaceApiContent','tableName','\x20},','isDirectory','.md','.jsx','success','3kKTGUc','name:\x20\x22','api','slice','replace','toComponentName','YourModel','error','toDisplayTitle','utf8','.ts','14771940lrShOQ','includes','.tpl','extname','12jgCnLJ','toLowerCase','.js','2-digit','672336sXPhXn','push','2206665yiuuEC','mkdir','processDirectory','processTemplate','join','tableName:\x20\x22','info'];a61_0x383a=function(){return _0x3156e4;};return a61_0x383a();}function a61_0x1416(_0x35aefa,_0x445eaf){_0x35aefa=_0x35aefa-0xdb;const _0x383a05=a61_0x383a();let _0x1416a0=_0x383a05[_0x35aefa];return _0x1416a0;}import a61_0x50ac12 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a61_0x576e79(0x111)](_0x13ff6d){const _0xe6046=a61_0x576e79,_0x1e70ef=_0x13ff6d[_0xe6046(0xe7)]('/')[_0xe6046(0xf2)]()||_0x13ff6d;return _0x1e70ef['split']('-')[_0xe6046(0xfb)](_0x3c80b5=>_0x3c80b5['charAt'](0x0)[_0xe6046(0xf5)]()+_0x3c80b5[_0xe6046(0x10f)](0x1)[_0xe6046(0xdb)]())[_0xe6046(0xe4)]('');}static[a61_0x576e79(0x114)](_0x53cc70){const _0x24ff1c=a61_0x576e79,_0xeb4702=_0x53cc70[_0x24ff1c(0xe7)]('/')[_0x24ff1c(0xf2)]()||_0x53cc70;return _0xeb4702[_0x24ff1c(0xe7)]('-')[_0x24ff1c(0xfb)](_0x31759d=>_0x31759d[_0x24ff1c(0xec)](0x0)[_0x24ff1c(0xf5)]()+_0x31759d[_0x24ff1c(0x10f)](0x1)[_0x24ff1c(0xdb)]())['join']('\x20');}static[a61_0x576e79(0xee)](_0x32a2a0,_0x3792e1,_0x3be0e1){const _0x56a206=a61_0x576e79,_0x37fa6f=this['toComponentName'](_0x3792e1),_0x1ae854=this[_0x56a206(0x114)](_0x3792e1),_0x57fec9=new Date(),_0x2b07fa=_0x57fec9[_0x56a206(0xf0)](undefined,{'year':_0x56a206(0x101),'month':_0x56a206(0xdd),'day':_0x56a206(0xdd),'hour':_0x56a206(0xdd),'minute':'2-digit','second':_0x56a206(0xdd),'hour12':![]})[_0x56a206(0x110)](/\//g,'-'),_0x385eb4=_0x57fec9[_0x56a206(0xfd)](undefined,{'year':_0x56a206(0x101),'month':'2-digit','day':_0x56a206(0xdd)})['replace'](/\//g,'-'),_0x19cd69=_0x57fec9['toLocaleTimeString'](undefined,{'hour12':![]});let _0x1b2ef0=_0x32a2a0[_0x56a206(0x110)](/\{ComponentName\}/g,_0x37fa6f)['replace'](/\{DisplayTitle\}/g,_0x1ae854)[_0x56a206(0x110)](/\{PageName\}/g,_0x3792e1)[_0x56a206(0x110)](/\{TemplateName\}/g,_0x3be0e1)['replace'](/\{CreatedAt\}/g,_0x2b07fa)[_0x56a206(0x110)](/\{CreatedDate\}/g,_0x385eb4)['replace'](/\{CreatedTime\}/g,_0x19cd69);return _0x1b2ef0;}static[a61_0x576e79(0x105)](_0x4bd226,_0x50e60b,_0x4696ea,_0x57f216,_0x48d79b,_0x510a43,_0x325132){const _0x139c6a=a61_0x576e79,_0x498873=new Date(),_0x389c6b=_0x498873[_0x139c6a(0xf4)](),_0x5233d4=_0x4696ea['map'](_0x5111e8=>{const _0x1a51b4=_0x139c6a,_0x25dc1e=['datasetCode:\x20\x22'+_0x5111e8[_0x1a51b4(0xf1)]+'\x22',_0x1a51b4(0xe5)+_0x5111e8[_0x1a51b4(0x106)]+'\x22',_0x1a51b4(0x10d)+_0x5111e8[_0x1a51b4(0xf9)]+'\x22'];return _0x5111e8[_0x1a51b4(0xfc)]&&_0x25dc1e[_0x1a51b4(0xdf)]('alias:\x20\x22'+_0x5111e8['alias']+'\x22'),_0x1a51b4(0xef)+_0x25dc1e['join'](',\x20')+_0x1a51b4(0x107);})[_0x139c6a(0xe4)](''),_0x38d31a=_0x57f216||_0x4696ea[0x0]?.[_0x139c6a(0xfc)]||_0x139c6a(0x112);let _0x2c4aca=_0x4bd226[_0x139c6a(0x110)](/\{AppCode\}/g,_0x50e60b)[_0x139c6a(0x110)](/\{ModelConfigs\}/g,_0x5233d4)['replace'](/\{ExampleModelName\}/g,_0x38d31a)[_0x139c6a(0x110)](/\{ApiFileName\}/g,_0x48d79b||_0x139c6a(0x10e))[_0x139c6a(0x110)](/\{ConfigName\}/g,_0x510a43||'default')[_0x139c6a(0x110)](/\{ClientConfigParam\}/g,_0x325132||'')[_0x139c6a(0x110)](/\{CreatedAt\}/g,_0x389c6b);return _0x2c4aca;}static async[a61_0x576e79(0xe3)](_0x5de584,_0x36c221,_0x253b23,_0xddca65,_0x1e29e0=!![]){const _0x305994=a61_0x576e79,_0xdd105e=Date[_0x305994(0xfa)]();try{_0x1e29e0&&logger[_0x305994(0xe6)](_0x305994(0x102),'开始处理模板内容替换',{'templatePath':_0x5de584,'targetPath':_0x36c221,'pageName':_0x253b23,'templateName':_0xddca65});await a61_0x232249[_0x305994(0xfe)][_0x305994(0xe1)](_0x36c221,{'recursive':!![]}),await this[_0x305994(0xe2)](_0x5de584,_0x36c221,_0x253b23,_0xddca65);if(_0x1e29e0){const _0x35e326=Date['now']()-_0xdd105e;logger[_0x305994(0x10b)]('template',_0x305994(0xed),_0x35e326,{'pageName':_0x253b23,'templateName':_0xddca65});}}catch(_0x57a27a){if(_0x1e29e0){const _0x55ee05=Date[_0x305994(0xfa)]()-_0xdd105e;logger[_0x305994(0x113)]('template',_0x305994(0x100),{'templatePath':_0x5de584,'targetPath':_0x36c221,'pageName':_0x253b23,'templateName':_0xddca65,'error':_0x57a27a instanceof Error?_0x57a27a[_0x305994(0xeb)]:String(_0x57a27a),'duration':_0x55ee05});}throw _0x57a27a;}}static async['processDirectory'](_0x591e19,_0xeaeb3e,_0x13622d,_0x535d20){const _0x3c158c=a61_0x576e79,_0x275b89=await a61_0x232249[_0x3c158c(0xfe)]['readdir'](_0x591e19,{'withFileTypes':!![]});for(const _0x403e38 of _0x275b89){const _0x54b537=a61_0x50ac12[_0x3c158c(0xe4)](_0x591e19,_0x403e38[_0x3c158c(0xf9)]);let _0x2c939b=a61_0x50ac12[_0x3c158c(0xe4)](_0xeaeb3e,_0x403e38[_0x3c158c(0xf9)]);_0x403e38[_0x3c158c(0xf9)]['endsWith'](_0x3c158c(0x119))&&(_0x2c939b=a61_0x50ac12[_0x3c158c(0xe4)](_0xeaeb3e,_0x403e38[_0x3c158c(0xf9)][_0x3c158c(0x110)](/\.tpl$/,'')));if(_0x403e38[_0x3c158c(0x108)]())await a61_0x232249[_0x3c158c(0xfe)][_0x3c158c(0xe1)](_0x2c939b,{'recursive':!![]}),await this[_0x3c158c(0xe2)](_0x54b537,_0x2c939b,_0x13622d,_0x535d20);else _0x403e38['isFile']()&&await this[_0x3c158c(0xea)](_0x54b537,_0x2c939b,_0x13622d,_0x535d20);}}static async[a61_0x576e79(0xea)](_0x1020a4,_0xbf9908,_0x395c2b,_0x56d80f){const _0x403562=a61_0x576e79,_0x54f9ea=a61_0x50ac12[_0x403562(0x11a)](_0x1020a4)['toLowerCase']();_0x1020a4[_0x403562(0x103)](_0x403562(0x119))&&(_0xbf9908=_0xbf9908[_0x403562(0x110)](/\.tpl$/,''));const _0x5d32e0=[_0x403562(0xf6),_0x403562(0x116),_0x403562(0x10a),_0x403562(0xdc),'.json',_0x403562(0x109),'.css','.scss',_0x403562(0x119)];if(_0x5d32e0[_0x403562(0x118)](_0x54f9ea)||_0x1020a4[_0x403562(0x103)](_0x403562(0x119))){const _0x53a6ca=await a61_0x232249[_0x403562(0xfe)][_0x403562(0xf8)](_0x1020a4,_0x403562(0x115)),_0x4282c8=this[_0x403562(0xee)](_0x53a6ca,_0x395c2b,_0x56d80f);await a61_0x232249[_0x403562(0xfe)]['writeFile'](_0xbf9908,_0x4282c8,_0x403562(0x115));}else await a61_0x232249[_0x403562(0xfe)][_0x403562(0xf7)](_0x1020a4,_0xbf9908);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"