@lovrabet/cli 1.2.1-beta.4 → 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 (66) 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 +3 -3
  62. package/templates/projects/sub-app-react-demo/package.json +2 -2
  63. package/templates/projects/sub-app-react-demo/src/api/api.ts +42 -25
  64. package/templates/projects/sub-app-react-demo/src/api/client.ts +11 -10
  65. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +72 -19
  66. package/templates/projects/sub-app-react-demo/package-lock.json +0 -4062
@@ -1 +1 @@
1
- (function(_0x54e5db,_0x3004cf){const _0x591a7b=a47_0x4d12,_0x1edbf1=_0x54e5db();while(!![]){try{const _0x3860ea=parseInt(_0x591a7b(0x159))/0x1*(parseInt(_0x591a7b(0x14c))/0x2)+parseInt(_0x591a7b(0x154))/0x3+parseInt(_0x591a7b(0x144))/0x4*(parseInt(_0x591a7b(0x14a))/0x5)+parseInt(_0x591a7b(0x14f))/0x6+-parseInt(_0x591a7b(0x14b))/0x7*(-parseInt(_0x591a7b(0x151))/0x8)+-parseInt(_0x591a7b(0x143))/0x9*(parseInt(_0x591a7b(0x146))/0xa)+parseInt(_0x591a7b(0x145))/0xb*(-parseInt(_0x591a7b(0x158))/0xc);if(_0x3860ea===_0x3004cf)break;else _0x1edbf1['push'](_0x1edbf1['shift']());}catch(_0x323b3d){_0x1edbf1['push'](_0x1edbf1['shift']());}}}(a47_0x3f83,0x57f4e));import a47_0x41ef3a from'node:path';function a47_0x3f83(){const _0x12eea7=['17286012orYztH','2882AWqKoN','18pwkbWf','52hZTIGi','11VHxlSx','87430Tggwxj','开始格式化代码','format','message','117835hZcMUJ','7763fQwtSX','366SswMCc','代码格式化完成','代码格式化失败','598038kPWQdh','格式化代码','3368RRzZzb','error','npx','1253754RhIKFT','info','prettier','now'];a47_0x3f83=function(){return _0x12eea7;};return a47_0x3f83();}import{useCallback,useState}from'react';function a47_0x4d12(_0xd0d6e0,_0x4d858c){_0xd0d6e0=_0xd0d6e0-0x143;const _0x3f83d3=a47_0x3f83();let _0x4d12c8=_0x3f83d3[_0xd0d6e0];return _0x4d12c8;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x3d3bfc=a47_0x4d12,[_0x28f787,_0x4d118f]=useState(![]),[_0x3c11fe,_0x3dd6e6]=useState(![]),[_0x319d68,_0x31b0bc]=useState(''),_0x41bec0=useCallback(async _0x3da2e6=>{const _0x5bedc6=a47_0x4d12,_0x5bd0c7=Date[_0x5bedc6(0x157)](),_0x7b4799=a47_0x41ef3a['resolve'](process['cwd'](),_0x3da2e6);_0x4d118f(!![]);try{logger[_0x5bedc6(0x155)](_0x5bedc6(0x148),_0x5bedc6(0x147),{'projectCode':_0x3da2e6}),await execa(_0x5bedc6(0x153),[_0x5bedc6(0x156),'--write','.'],{'cwd':_0x7b4799});const _0x8dec23=Date[_0x5bedc6(0x157)]()-_0x5bd0c7;logger['success']('format',_0x5bedc6(0x14d),_0x8dec23,{'projectCode':_0x3da2e6});}catch(_0x5407c9){const _0x28e82e=Date[_0x5bedc6(0x157)]()-_0x5bd0c7;logger[_0x5bedc6(0x152)](_0x5bedc6(0x148),_0x5bedc6(0x14e),{'projectCode':_0x3da2e6,'error':_0x5407c9 instanceof Error?_0x5407c9[_0x5bedc6(0x149)]:String(_0x5407c9),'duration':_0x28e82e});throw _0x5407c9;}finally{_0x4d118f(![]),_0x3dd6e6(!![]),_0x31b0bc(formatElapsed(_0x5bd0c7));}},[]);return{'taskName':_0x3d3bfc(0x150),'finished':_0x3c11fe,'loading':_0x28f787,'elapsed':_0x319d68,'doTask':_0x41bec0};}
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(_0x14a509,_0x1b0190){const _0x41a21e=a48_0x5e41,_0x398c65=_0x14a509();while(!![]){try{const _0x3d459=-parseInt(_0x41a21e(0x1c2))/0x1+parseInt(_0x41a21e(0x1cf))/0x2+parseInt(_0x41a21e(0x1be))/0x3*(-parseInt(_0x41a21e(0x1c6))/0x4)+-parseInt(_0x41a21e(0x1ce))/0x5*(-parseInt(_0x41a21e(0x1c3))/0x6)+parseInt(_0x41a21e(0x1c1))/0x7+-parseInt(_0x41a21e(0x1b9))/0x8*(parseInt(_0x41a21e(0x1bf))/0x9)+parseInt(_0x41a21e(0x1cc))/0xa;if(_0x3d459===_0x1b0190)break;else _0x398c65['push'](_0x398c65['shift']());}catch(_0x4ca193){_0x398c65['push'](_0x398c65['shift']());}}}(a48_0x3210,0x6c8be));import a48_0x4de047 from'node:path';function a48_0x5e41(_0x119f4c,_0x22ab21){_0x119f4c=_0x119f4c-0x1b9;const _0x3210c3=a48_0x3210();let _0x5e41d0=_0x3210c3[_0x119f4c];return _0x5e41d0;}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a48_0x3210(){const _0x3949ff=['https://registry.npmmirror.com','1500490ksgBAT','开始安装依赖','5Okjfec','1090172jMcEQV','376BTLRzI','依赖安装失败','cwd','now','error','27zrhmJx','111969HUPJLb','依赖安装完成','5400150zSgVkD','488853yeCTkR','3229602STJvUR','resolve','--registry','216296NUcZDl','success','安装依赖','install','info'];a48_0x3210=function(){return _0x3949ff;};return a48_0x3210();}export function useInstallDependencies(){const _0x4f779c=a48_0x5e41,[_0x28998c,_0x5eb0ef]=useState(![]),[_0x2f2980,_0x567a40]=useState(![]),[_0x2bd953,_0x541f0d]=useState(''),_0x1f1e47=useCallback(async _0x179609=>{const _0x341ae7=a48_0x5e41,_0x17b0a0=Date[_0x341ae7(0x1bc)](),_0x109705=a48_0x4de047[_0x341ae7(0x1c4)](process[_0x341ae7(0x1bb)](),_0x179609);_0x5eb0ef(!![]),_0x567a40(![]);const _0x28a69d=async(_0x383286,_0x235ccd)=>{await execa(_0x383286,_0x235ccd,{'cwd':_0x109705});};try{logger[_0x341ae7(0x1ca)](_0x341ae7(0x1c9),_0x341ae7(0x1cd),{'projectCode':_0x179609,'registry':_0x341ae7(0x1cb)}),await _0x28a69d('npm',[_0x341ae7(0x1c9),_0x341ae7(0x1c5),_0x341ae7(0x1cb)]);const _0xe3ca38=Date[_0x341ae7(0x1bc)]()-_0x17b0a0;logger[_0x341ae7(0x1c7)](_0x341ae7(0x1c9),_0x341ae7(0x1c0),_0xe3ca38,{'projectCode':_0x179609});}catch(_0x2fb77d){const _0x2cf783=Date['now']()-_0x17b0a0;logger[_0x341ae7(0x1bd)]('install',_0x341ae7(0x1ba),{'projectCode':_0x179609,'error':_0x2fb77d instanceof Error?_0x2fb77d['message']:String(_0x2fb77d),'duration':_0x2cf783});throw _0x2fb77d;}finally{_0x5eb0ef(![]),_0x567a40(!![]),_0x541f0d(formatElapsed(_0x17b0a0));}},[]);return{'taskName':_0x4f779c(0x1c8),'finished':_0x2f2980,'loading':_0x28998c,'elapsed':_0x2bd953,'doTask':_0x1f1e47};}
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(_0x7a5025,_0x58e11b){var _0x9788d7=a49_0x3ab8,_0x2add21=_0x7a5025();while(!![]){try{var _0x162893=parseInt(_0x9788d7(0x13e))/0x1+parseInt(_0x9788d7(0x145))/0x2*(-parseInt(_0x9788d7(0x13b))/0x3)+parseInt(_0x9788d7(0x141))/0x4+parseInt(_0x9788d7(0x148))/0x5*(parseInt(_0x9788d7(0x142))/0x6)+-parseInt(_0x9788d7(0x14a))/0x7*(parseInt(_0x9788d7(0x140))/0x8)+parseInt(_0x9788d7(0x146))/0x9*(parseInt(_0x9788d7(0x14b))/0xa)+-parseInt(_0x9788d7(0x13c))/0xb*(parseInt(_0x9788d7(0x13d))/0xc);if(_0x162893===_0x58e11b)break;else _0x2add21['push'](_0x2add21['shift']());}catch(_0x10e8c5){_0x2add21['push'](_0x2add21['shift']());}}}(a49_0x20d8,0x6b093));import{jsx as a49_0x1c0335,jsxs as a49_0x4f756f}from'react/jsx-runtime';function a49_0x20d8(){var _0x1a8ade=['81907FTVHzY','130bXiGgb','3zOdqLD','11TWVrFF','9431592WFfNSs','746846PzGaCU','查看可用命令。','32VpHKZs','1004244DoEbHV','1279716BnhWBW','lovrabet\x20--help','!\x20请指定一个有效的命令。','867514UpjCRN','341829WukyNO','green','5UDhBnU','column'];a49_0x20d8=function(){return _0x1a8ade;};return a49_0x20d8();}function a49_0x3ab8(_0xe67aef,_0x5e89e4){_0xe67aef=_0xe67aef-0x13b;var _0x20d823=a49_0x20d8();var _0x3ab847=_0x20d823[_0xe67aef];return _0x3ab847;}import{Box,Text}from'ink';export function Help(){var _0x4505db=a49_0x3ab8;return a49_0x4f756f(Box,{'flexDirection':_0x4505db(0x149),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x4f756f(Box,{'children':[a49_0x1c0335(Box,{'width':'1'}),a49_0x1c0335(Text,{'children':_0x4505db(0x144)})]}),a49_0x4f756f(Box,{'marginTop':0x1,'children':[a49_0x1c0335(Box,{'width':'1'}),a49_0x4f756f(Text,{'children':['\x20\x20','使用']}),a49_0x4f756f(Text,{'bold':!![],'color':_0x4505db(0x147),'children':['\x20',_0x4505db(0x143),'\x20']}),a49_0x1c0335(Text,{'children':_0x4505db(0x13f)})]})]});}
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(_0x2b0b17,_0x9582e7){const _0x787ba7=a50_0x26a2,_0x374139=_0x2b0b17();while(!![]){try{const _0x59fb06=-parseInt(_0x787ba7(0x7e))/0x1*(parseInt(_0x787ba7(0xa3))/0x2)+parseInt(_0x787ba7(0x9a))/0x3+-parseInt(_0x787ba7(0x7c))/0x4+parseInt(_0x787ba7(0x87))/0x5+-parseInt(_0x787ba7(0x9b))/0x6+-parseInt(_0x787ba7(0x93))/0x7+parseInt(_0x787ba7(0x81))/0x8*(parseInt(_0x787ba7(0x9e))/0x9);if(_0x59fb06===_0x9582e7)break;else _0x374139['push'](_0x374139['shift']());}catch(_0x30897e){_0x374139['push'](_0x374139['shift']());}}}(a50_0x3526,0x3d27c));import{jsxs as a50_0x1315c1,jsx as a50_0x39652d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a50_0x26a2(_0x5f3bef,_0x10ea7f){_0x5f3bef=_0x5f3bef-0x79;const _0x352698=a50_0x3526();let _0x26a2cc=_0x352698[_0x5f3bef];return _0x26a2cc;}function a50_0x3526(){const _0xc80ffd=['message','version','green','初始化项目配置文件成功','string','676396ZvGePq','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','12469KISDnN','cyan','online','720bTJYeA','env','test','应用代码只能包含字母、数字、-\x20和\x20_','error','info','1829260eWdUUK','cwd','trim','AppCode:\x20','应用代码不合法','ctrl','.lovrabetrc','创建配置文件失败','slice','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','exit','red','1422596NFlSIx','请输入应用代码\x20(AppCode):\x20','column','stringify','length','创建配置文件失败:\x20','1.0.0','26733veXCHb','367272cDBBqi','setLogPath','正在初始化配置文件...','78309wZXcay','utf8','backspace','gray','package.json','76sYXELb','../..'];a50_0x3526=function(){return _0xc80ffd;};return a50_0x3526();}export function Init({appcode:_0xc7f4ec,env:_0x4f4fe5}){const _0x3e4a80=a50_0x26a2,[_0x15337f,_0x40d148]=useState(null),[_0x5a9440,_0x28b82f]=useState(![]),[_0x5c24ba,_0x2704df]=useState(!_0xc7f4ec),[_0x2f5592,_0x3ba9f0]=useState(''),[_0x733738,_0x578530]=useState(''),[_0x5e23d2,_0x3b9dc8]=useState(_0xc7f4ec||''),[_0x2158af]=useState(_0x4f4fe5);function _0x40f0f8(_0x11b8d7){const _0x391325=a50_0x26a2;if(_0x11b8d7[_0x391325(0x97)]===0x0)return{'valid':![],'message':''};if(_0x11b8d7[_0x391325(0x97)]>0x64)return{'valid':![],'message':'应用代码长度不能超过\x20100\x20个字符'};const _0x404b44=/^[A-Za-z0-9_-]+$/;if(!_0x404b44[_0x391325(0x83)](_0x11b8d7))return{'valid':![],'message':_0x391325(0x84)};return{'valid':!![]};}useInput((_0x18e822,_0x6673df)=>{const _0x14c1c1=a50_0x26a2;if(!_0x5c24ba)return;if(_0x6673df['return']){if(_0x733738||!_0x2f5592['trim']()){_0x578530('应用代码不能为空');return;}const _0x5edbc2=_0x2f5592[_0x14c1c1(0x89)](),{valid:_0xa4f7a4,message:_0x1e1bb2}=_0x40f0f8(_0x5edbc2);if(!_0xa4f7a4){_0x578530(_0x1e1bb2||'应用代码不合法');return;}_0x3b9dc8(_0x5edbc2),_0x2704df(![]);}else{if(_0x6673df[_0x14c1c1(0xa0)]||_0x6673df['delete'])_0x3ba9f0(_0x3debea=>{const _0x2cf3b7=_0x14c1c1,_0x3842fb=_0x3debea[_0x2cf3b7(0x8f)](0x0,-0x1);if(_0x3842fb[_0x2cf3b7(0x97)]===0x0)_0x578530('');else{const {valid:_0x54b41f,message:_0x50702f}=_0x40f0f8(_0x3842fb);_0x578530(_0x54b41f?'':_0x50702f||_0x2cf3b7(0x8b));}return _0x3842fb;});else _0x6673df[_0x14c1c1(0x8c)]&&_0x18e822==='c'?process['exit'](0x0):_0x3ba9f0(_0xc76aa8=>{const _0x39942f=_0x14c1c1,_0x31e64a=_0xc76aa8+_0x18e822,{valid:_0x4bbe47,message:_0x100c02}=_0x40f0f8(_0x31e64a);return _0x578530(_0x4bbe47?'':_0x100c02||_0x39942f(0x8b)),_0x31e64a;});}},{'isActive':_0x5c24ba}),useEffect(()=>{const _0x307840=a50_0x26a2;if(!_0x5e23d2||_0x5c24ba)return;const _0xebeea=resolve(process['cwd'](),_0x307840(0x8d));if(existsSync(_0xebeea)){_0x40d148('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process[_0x307840(0x91)](0x1),0x64);return;}try{const _0x233345=fileURLToPath(import.meta.url),_0x394c9b=resolve(dirname(_0x233345),_0x307840(0xa4)),_0x5cc395=join(_0x394c9b,_0x307840(0xa2));let _0x540bae=_0x307840(0x99);try{const _0x5d2634=JSON['parse'](readFileSync(_0x5cc395,_0x307840(0x9f)));_0x540bae=_0x5d2634[_0x307840(0xa6)]||'1.0.0';}catch(_0x340eda){}const _0x33e968=readConfig(),_0x3a6f71=typeof _0x33e968['env']===_0x307840(0x7b)?_0x33e968['env']:undefined,{app:_0x395939,appcode:_0x32b8a1,..._0x2e6436}=_0x33e968,_0x1cc1ee={..._0x2e6436,'appcode':_0x5e23d2,'env':_0x2158af||_0x3a6f71||_0x307840(0x80),'createdAt':new Date()['toLocaleString'](),'version':_0x540bae};writeFileSync(_0xebeea,JSON[_0x307840(0x96)](_0x1cc1ee,null,0x2),{'encoding':'utf8','mode':0x180}),logger[_0x307840(0x9c)](process[_0x307840(0x88)]()),logger[_0x307840(0x86)]('init',_0x307840(0x7a),{'appcode':_0x5e23d2,'env':_0x1cc1ee[_0x307840(0x82)],'version':_0x1cc1ee[_0x307840(0xa6)],'configPath':_0xebeea}),_0x28b82f(!![]),setTimeout(()=>process[_0x307840(0x91)](0x0),0x64);}catch(_0x4301c3){logger[_0x307840(0x85)]('init',_0x307840(0x8e),{'error':_0x4301c3 instanceof Error?_0x4301c3[_0x307840(0xa5)]:String(_0x4301c3)}),_0x40d148(_0x307840(0x98)+(_0x4301c3 instanceof Error?_0x4301c3[_0x307840(0xa5)]:String(_0x4301c3))),setTimeout(()=>process[_0x307840(0x91)](0x1),0x64);}},[_0x5e23d2,_0x5c24ba,_0x2158af]);if(_0x15337f)return a50_0x39652d(Box,{'flexDirection':_0x3e4a80(0x95),'children':a50_0x1315c1(Text,{'color':_0x3e4a80(0x92),'children':['✗\x20',_0x15337f]})});if(_0x5c24ba)return a50_0x1315c1(Box,{'flexDirection':'column','children':[a50_0x1315c1(Box,{'children':[a50_0x39652d(Text,{'color':_0x3e4a80(0x7f),'children':_0x3e4a80(0x94)}),_0x2f5592?a50_0x39652d(Text,{'color':'green','children':_0x2f5592}):a50_0x39652d(Text,{'color':_0x3e4a80(0xa1),'children':'_'}),_0x733738&&a50_0x1315c1(Text,{'color':'red','children':['\x20←\x20',_0x733738]})]}),!_0x733738&&!_0x2f5592&&a50_0x39652d(Box,{'children':a50_0x39652d(Text,{'color':_0x3e4a80(0xa1),'children':_0x3e4a80(0x7d)})})]});if(_0x5a9440)return a50_0x1315c1(Box,{'flexDirection':_0x3e4a80(0x95),'children':[a50_0x39652d(Text,{'color':_0x3e4a80(0x79),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a50_0x1315c1(Text,{'color':_0x3e4a80(0x7f),'children':[_0x3e4a80(0x8a),_0x5e23d2]}),a50_0x39652d(Text,{'children':_0x3e4a80(0x90)})]});return a50_0x39652d(Box,{'children':a50_0x39652d(Text,{'children':_0x3e4a80(0x9d)})});}
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(_0x52d065,_0x1bbace){const _0x5a2556=a51_0x51df,_0x304114=_0x52d065();while(!![]){try{const _0x513b40=parseInt(_0x5a2556(0xf8))/0x1+parseInt(_0x5a2556(0xd6))/0x2+parseInt(_0x5a2556(0xd8))/0x3*(parseInt(_0x5a2556(0xfd))/0x4)+parseInt(_0x5a2556(0x105))/0x5+parseInt(_0x5a2556(0xe7))/0x6*(parseInt(_0x5a2556(0xed))/0x7)+parseInt(_0x5a2556(0x107))/0x8+-parseInt(_0x5a2556(0xfa))/0x9*(parseInt(_0x5a2556(0xe2))/0xa);if(_0x513b40===_0x1bbace)break;else _0x304114['push'](_0x304114['shift']());}catch(_0x498c1d){_0x304114['push'](_0x304114['shift']());}}}(a51_0x5a83,0x7a009));function a51_0x5a83(){const _0xdf798c=['复制\x20Cursor\x20Rules\x20文件失败','env','错误:\x20配置失败:\x20','创建新的\x20mcp.json\x20配置','配置\x20Cursor\x20MCP\x20成功','622416HuPLSc','lovrabet-dataset','261SZKuyH','配置\x20Cursor\x20MCP\x20失败','../../templates/rules/lovrabet_rules.mdc.tpl','184TeHwnA','error','.cursor','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','app','\x20\x20-\x20配置文件:\x20','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','warn','242460WBEyAI','npx','6897232MuzcIz','online','1637418xazlqu','解析现有\x20mcp.json\x20失败','33105iqKedV','✓\x20更新\x20mcp.json\x20配置','utf8','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','parse','lovrabet_rules.mdc','错误:\x20解析现有\x20mcp.json\x20失败:\x20','message','log','\x0a✓\x20Cursor\x20MCP\x20配置成功!','1056070YKyOTS','Cursor\x20Rules\x20文件已存在,跳过','info','exit','rules','4217658xGacTB','未找到\x20appcode\x20配置','更新现有\x20mcp.json\x20配置','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','stringify','\x20\x20-\x20环境:\x20','7JjLOad','mcpServers','mcp.json','mcp-cursor','@lovrabet/dataset-mcp-server','appcode'];a51_0x5a83=function(){return _0xdf798c;};return a51_0x5a83();}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_0x51df(_0x27a85e,_0x40ab44){_0x27a85e=_0x27a85e-0xd6;const _0x5a83bf=a51_0x5a83();let _0x51dfa4=_0x5a83bf[_0x27a85e];return _0x51dfa4;}export async function configureCursorMcp(){const _0x113a4f=a51_0x51df;try{const _0x45ac82=process['cwd'](),_0x23dc27=resolve(_0x45ac82,_0x113a4f(0xff)),_0x3c74b1=resolve(_0x23dc27,_0x113a4f(0xef)),_0x2ba695=readConfig(),_0x3ff866=_0x2ba695[_0x113a4f(0xf2)]||_0x2ba695[_0x113a4f(0x101)],_0x567b1a=_0x2ba695[_0x113a4f(0xf4)]||_0x113a4f(0x108);!_0x3ff866&&(console[_0x113a4f(0xfe)](_0x113a4f(0x103)),logger[_0x113a4f(0xfe)](_0x113a4f(0xf0),_0x113a4f(0xe8)),process[_0x113a4f(0xe5)](0x1));!existsSync(_0x23dc27)&&(mkdirSync(_0x23dc27,{'recursive':!![]}),logger['info']('mcp-cursor','创建\x20.cursor\x20目录',{'path':_0x23dc27}),console[_0x113a4f(0xe0)]('✓\x20创建\x20.cursor\x20目录:\x20'+_0x23dc27));const _0x4ee1ca={'command':_0x113a4f(0x106),'args':['-y',_0x113a4f(0xf1)],'env':{'LOVRABET_APP_CODE':String(_0x3ff866),'LOVRABET_ENV':String(_0x567b1a)}};let _0x5790c1;if(existsSync(_0x3c74b1))try{const _0x3ab350=readFileSync(_0x3c74b1,'utf8');_0x5790c1=JSON[_0x113a4f(0xdc)](_0x3ab350),!_0x5790c1[_0x113a4f(0xee)]&&(_0x5790c1[_0x113a4f(0xee)]={}),_0x5790c1[_0x113a4f(0xee)][_0x113a4f(0xf9)]=_0x4ee1ca,logger[_0x113a4f(0xe4)]('mcp-cursor',_0x113a4f(0xe9),{'path':_0x3c74b1,'appcode':_0x3ff866,'env':_0x567b1a}),console['log'](_0x113a4f(0xd9));}catch(_0x5937f7){logger[_0x113a4f(0xfe)](_0x113a4f(0xf0),_0x113a4f(0xd7),{'error':_0x5937f7 instanceof Error?_0x5937f7['message']:String(_0x5937f7)}),console[_0x113a4f(0xfe)](_0x113a4f(0xde)+(_0x5937f7 instanceof Error?_0x5937f7['message']:String(_0x5937f7))),process['exit'](0x1);}else _0x5790c1={'mcpServers':{'lovrabet-dataset':_0x4ee1ca}},logger['info'](_0x113a4f(0xf0),_0x113a4f(0xf6),{'path':_0x3c74b1,'appcode':_0x3ff866,'env':_0x567b1a}),console['log']('✓\x20创建\x20mcp.json\x20配置文件');writeFileSync(_0x3c74b1,JSON[_0x113a4f(0xeb)](_0x5790c1,null,0x2),{'encoding':_0x113a4f(0xda)});const _0x2c91d6=resolve(_0x23dc27,_0x113a4f(0xe6)),_0x4e9677=resolve(_0x2c91d6,_0x113a4f(0xdd));if(!existsSync(_0x4e9677))try{!existsSync(_0x2c91d6)&&(mkdirSync(_0x2c91d6,{'recursive':!![]}),logger['info'](_0x113a4f(0xf0),'创建\x20.cursor/rules\x20目录',{'path':_0x2c91d6}));const _0x52acc3=fileURLToPath(import.meta.url),_0x3c1ac3=dirname(_0x52acc3),_0x31b9cc=resolve(_0x3c1ac3,_0x113a4f(0xfc));existsSync(_0x31b9cc)?(copyFileSync(_0x31b9cc,_0x4e9677),logger[_0x113a4f(0xe4)](_0x113a4f(0xf0),'复制\x20Cursor\x20Rules\x20文件',{'from':_0x31b9cc,'to':_0x4e9677}),console[_0x113a4f(0xe0)]('✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc')):logger[_0x113a4f(0x104)](_0x113a4f(0xf0),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x31b9cc});}catch(_0x358acf){logger[_0x113a4f(0xfe)]('mcp-cursor',_0x113a4f(0xf3),{'error':_0x358acf instanceof Error?_0x358acf[_0x113a4f(0xdf)]:String(_0x358acf)}),console[_0x113a4f(0x104)](_0x113a4f(0x100)+(_0x358acf instanceof Error?_0x358acf[_0x113a4f(0xdf)]:String(_0x358acf)));}else console[_0x113a4f(0xe0)](_0x113a4f(0xdb)),logger['info'](_0x113a4f(0xf0),_0x113a4f(0xe3),{'path':_0x4e9677});console[_0x113a4f(0xe0)](_0x113a4f(0xe1)),console[_0x113a4f(0xe0)]('\x0a配置信息:'),console[_0x113a4f(0xe0)]('\x20\x20-\x20AppCode:\x20'+_0x3ff866),console['log'](_0x113a4f(0xec)+_0x567b1a),console[_0x113a4f(0xe0)](_0x113a4f(0x102)+_0x3c74b1),console['log'](_0x113a4f(0xea)),console[_0x113a4f(0xe0)]('请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。'),logger[_0x113a4f(0xe4)]('mcp-cursor',_0x113a4f(0xf7),{'appcode':_0x3ff866,'env':_0x567b1a,'configPath':_0x3c74b1}),process[_0x113a4f(0xe5)](0x0);}catch(_0x582f73){logger['error'](_0x113a4f(0xf0),_0x113a4f(0xfb),{'error':_0x582f73 instanceof Error?_0x582f73[_0x113a4f(0xdf)]:String(_0x582f73)}),console[_0x113a4f(0xfe)](_0x113a4f(0xf5)+(_0x582f73 instanceof Error?_0x582f73[_0x113a4f(0xdf)]:String(_0x582f73))),process[_0x113a4f(0xe5)](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(_0x120b04,_0x227d39){var _0x4640dc=a52_0x4a8f,_0x105c0e=_0x120b04();while(!![]){try{var _0x4a4171=-parseInt(_0x4640dc(0x18c))/0x1+-parseInt(_0x4640dc(0x198))/0x2*(parseInt(_0x4640dc(0x18e))/0x3)+parseInt(_0x4640dc(0x192))/0x4+-parseInt(_0x4640dc(0x194))/0x5+-parseInt(_0x4640dc(0x19b))/0x6+parseInt(_0x4640dc(0x19a))/0x7*(-parseInt(_0x4640dc(0x1a3))/0x8)+parseInt(_0x4640dc(0x1a1))/0x9;if(_0x4a4171===_0x227d39)break;else _0x105c0e['push'](_0x105c0e['shift']());}catch(_0x4f7c37){_0x105c0e['push'](_0x105c0e['shift']());}}}(a52_0x2803,0x89bd8));function a52_0x4a8f(_0xcf110f,_0xe5a8aa){_0xcf110f=_0xcf110f-0x18b;var _0x28034a=a52_0x2803();var _0x4a8f42=_0x28034a[_0xcf110f];return _0x4a8f42;}import{configureCursorMcp}from'./cursor.js';function a52_0x2803(){var _0x30a48e=['error','info','\x0a当前支持的\x20IDE:','未指定\x20IDE\x20类型','mcp','33791832mJGrzG','\x0a示例:','48WlcDTR','toLowerCase','787500oXyoTg','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','821823TbvhDi','log','exit','cwd','100476mtGcHg','执行配置\x20Cursor\x20MCP\x20命令','1157780mMeWEs','\x20\x20lovrabet\x20mcp\x20cursor','cursor','不支持的\x20IDE\x20类型:\x20','6PpvkDL','\x0a使用方法:','988043jiWFKZ','3166860LmPnwZ'];a52_0x2803=function(){return _0x30a48e;};return a52_0x2803();}import{logger}from'../utils/logger.js';export async function mcpCommand(_0x59badc){var _0x5483d2=a52_0x4a8f;logger['setLogPath'](process[_0x5483d2(0x191)]());if(!_0x59badc){console[_0x5483d2(0x19c)]('错误:\x20请指定\x20IDE\x20类型'),console['log'](_0x5483d2(0x199)),console[_0x5483d2(0x18f)](_0x5483d2(0x18d)),console[_0x5483d2(0x18f)](_0x5483d2(0x1a2)),console[_0x5483d2(0x18f)](_0x5483d2(0x195)),logger[_0x5483d2(0x19c)](_0x5483d2(0x1a0),_0x5483d2(0x19f)),process[_0x5483d2(0x190)](0x1);return;}switch(_0x59badc[_0x5483d2(0x18b)]()){case _0x5483d2(0x196):logger[_0x5483d2(0x19d)](_0x5483d2(0x1a0),_0x5483d2(0x193)),await configureCursorMcp();break;default:console[_0x5483d2(0x19c)]('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x59badc),console[_0x5483d2(0x18f)](_0x5483d2(0x19e)),console[_0x5483d2(0x18f)]('\x20\x20-\x20cursor'),logger[_0x5483d2(0x19c)](_0x5483d2(0x1a0),_0x5483d2(0x197)+_0x59badc),process[_0x5483d2(0x190)](0x1);break;}}
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
- const a54_0x3614f6=a54_0x5854;(function(_0x5bfeb5,_0x5954b8){const _0xaf1da1=a54_0x5854,_0x32740f=_0x5bfeb5();while(!![]){try{const _0x2a9c9b=parseInt(_0xaf1da1(0x187))/0x1+parseInt(_0xaf1da1(0x179))/0x2*(parseInt(_0xaf1da1(0x192))/0x3)+-parseInt(_0xaf1da1(0x194))/0x4+-parseInt(_0xaf1da1(0x18d))/0x5*(parseInt(_0xaf1da1(0x183))/0x6)+-parseInt(_0xaf1da1(0x180))/0x7+-parseInt(_0xaf1da1(0x195))/0x8*(parseInt(_0xaf1da1(0x18c))/0x9)+-parseInt(_0xaf1da1(0x178))/0xa*(-parseInt(_0xaf1da1(0x177))/0xb);if(_0x2a9c9b===_0x5954b8)break;else _0x32740f['push'](_0x32740f['shift']());}catch(_0x205962){_0x32740f['push'](_0x32740f['shift']());}}}(a54_0x5ad1,0x62eac));import a54_0x16e228 from'node:fs';function a54_0x5854(_0x3b8e76,_0x46e109){_0x3b8e76=_0x3b8e76-0x177;const _0x5ad135=a54_0x5ad1();let _0x58545e=_0x5ad135[_0x3b8e76];return _0x58545e;}import a54_0x4a8a38 from'node:path';import a54_0x462b61 from'semver';function a54_0x5ad1(){const _0x5bb55f=['9330992xJEfRY','10REZGyL','98xLsAxg','⚠️\x20\x20SDK\x20版本不兼容','minVersion','\x1b[33m','1.2.0','needsUpgrade','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','2404150GvKBzh','\x1b[1m','parse','2130SqTPUy','@lovrabet/sdk','package.json','version','82899BfRLQj','readFileSync','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','\x1b[0m','utf8','59337oxOIvQ','890eAIlky','dependencies','devDependencies','join','log','26124FQuuKS','\x20不支持新协议。','2078748tUdDER','32xqTqWR'];a54_0x5ad1=function(){return _0x5bb55f;};return a54_0x5ad1();}const MIN_SDK_VERSION=a54_0x3614f6(0x17d);export function checkSdkVersion(_0x272c19){const _0x2d7ecf=a54_0x3614f6,_0x55f12a=a54_0x4a8a38[_0x2d7ecf(0x190)](_0x272c19,_0x2d7ecf(0x185));if(!a54_0x16e228['existsSync'](_0x55f12a))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x3cc1f9=JSON[_0x2d7ecf(0x182)](a54_0x16e228[_0x2d7ecf(0x188)](_0x55f12a,_0x2d7ecf(0x18b))),_0x27dfb0=_0x3cc1f9[_0x2d7ecf(0x18e)]||{},_0x537bf7=_0x3cc1f9[_0x2d7ecf(0x18f)]||{},_0x563f19=_0x27dfb0['@lovrabet/sdk']||_0x537bf7[_0x2d7ecf(0x184)];if(!_0x563f19)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x480359=a54_0x462b61['coerce'](_0x563f19),_0x1fade4=_0x480359?a54_0x462b61['lt'](_0x480359,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x563f19,'needsUpgrade':_0x1fade4,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x121f14){const _0x457ea3=a54_0x3614f6;if(!_0x121f14[_0x457ea3(0x17e)])return;const _0x2972d0=_0x457ea3(0x17c),_0x45b9c5=_0x457ea3(0x18a),_0x4217bd=_0x457ea3(0x181);console['log'](),console[_0x457ea3(0x191)](''+_0x2972d0+_0x4217bd+_0x457ea3(0x17a)+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+_0x457ea3(0x189)+_0x121f14[_0x457ea3(0x186)]+_0x457ea3(0x193)+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+'\x20\x20\x20请升级\x20SDK\x20至\x20'+_0x121f14[_0x457ea3(0x17b)]+'\x20或更高版本:'+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+'\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest'+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+_0x457ea3(0x17f)+_0x45b9c5),console[_0x457ea3(0x191)]();}
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
- const a55_0x2efdbe=a55_0x2b5f;(function(_0x157429,_0x1e1b0c){const _0xc4032f=a55_0x2b5f,_0x3c35fa=_0x157429();while(!![]){try{const _0x43e39c=parseInt(_0xc4032f(0x1ef))/0x1+parseInt(_0xc4032f(0x1ee))/0x2*(parseInt(_0xc4032f(0x1f0))/0x3)+parseInt(_0xc4032f(0x1eb))/0x4+parseInt(_0xc4032f(0x1e4))/0x5+-parseInt(_0xc4032f(0x1ec))/0x6+-parseInt(_0xc4032f(0x1e7))/0x7*(parseInt(_0xc4032f(0x1e2))/0x8)+-parseInt(_0xc4032f(0x1ea))/0x9*(parseInt(_0xc4032f(0x1f1))/0xa);if(_0x43e39c===_0x1e1b0c)break;else _0x3c35fa['push'](_0x3c35fa['shift']());}catch(_0x206346){_0x3c35fa['push'](_0x3c35fa['shift']());}}}(a55_0x30b2,0xc262f));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x2efdbe(0x1f3)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a55_0x2efdbe(0x1f2));export function readConfig(){const _0x4149c2=a55_0x2efdbe;let _0xe34012={};try{if(existsSync(globalConfigPath)){const _0x1b4db7=readFileSync(globalConfigPath,{'encoding':_0x4149c2(0x1e3)});_0x1b4db7&&(_0xe34012=JSON[_0x4149c2(0x1e8)](_0x1b4db7));}}catch(_0x2f8cb5){}try{if(existsSync(projectConfigPath)){const _0x1dcdfe=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x1dcdfe){const _0x69b420=JSON[_0x4149c2(0x1e8)](_0x1dcdfe);_0xe34012={..._0xe34012,..._0x69b420};}}}catch(_0x36f408){}return _0xe34012;}function a55_0x2b5f(_0x409e28,_0x291789){_0x409e28=_0x409e28-0x1e2;const _0x30b2ff=a55_0x30b2();let _0x2b5fe6=_0x30b2ff[_0x409e28];return _0x2b5fe6;}function a55_0x30b2(){const _0x492267=['parse','appcode','771354duYyZB','1111232GOOogM','2868702PERxzr','app','52zGtvlW','586764WxxugM','34677ciibNe','50AxTCDx','.lovrabetrc','cwd','73384SbBrhy','utf8','3514310QNaoMU','trim','string','126ZkpfPT'];a55_0x30b2=function(){return _0x492267;};return a55_0x30b2();}export function getConfigAppCode(){const _0x112a77=a55_0x2efdbe;let _0x2566ab={},_0x25866f={};try{if(existsSync(globalConfigPath)){const _0x1760ae=readFileSync(globalConfigPath,{'encoding':_0x112a77(0x1e3)});_0x1760ae&&(_0x25866f=JSON[_0x112a77(0x1e8)](_0x1760ae));}}catch(_0x7f0a32){}try{if(existsSync(projectConfigPath)){const _0x295456=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x295456&&(_0x2566ab=JSON['parse'](_0x295456));}}catch(_0x4137e5){}let _0x15f74b;if(_0x112a77(0x1e9)in _0x2566ab)_0x15f74b=_0x2566ab[_0x112a77(0x1e9)];else{if(_0x112a77(0x1ed)in _0x2566ab)_0x15f74b=_0x2566ab[_0x112a77(0x1ed)];else{if('appcode'in _0x25866f)_0x15f74b=_0x25866f['appcode'];else _0x112a77(0x1ed)in _0x25866f&&(_0x15f74b=_0x25866f[_0x112a77(0x1ed)]);}}if(typeof _0x15f74b!==_0x112a77(0x1e6)||_0x15f74b[_0x112a77(0x1e5)]()==='')return undefined;return _0x15f74b;}export function isInProject(){return existsSync(projectConfigPath);}
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 a56_0x30ad(){const _0x852030=['3795390KRaBPv','20OWBEsl','1315529hlQWug','163968BQGuAM','5177528CMnIwh','isDirectory','7266216PkeheH','2028670paZRjB','copyFileSync','48422nSJTOw','name','36kJDdMj','复制目录时出错:','readdirSync','7lOiBTY'];a56_0x30ad=function(){return _0x852030;};return a56_0x30ad();}(function(_0x303bb1,_0x1e98e1){const _0x3b9445=a56_0x526b,_0x2ac182=_0x303bb1();while(!![]){try{const _0x2aa6f4=parseInt(_0x3b9445(0x17d))/0x1+parseInt(_0x3b9445(0x175))/0x2*(parseInt(_0x3b9445(0x177))/0x3)+parseInt(_0x3b9445(0x17f))/0x4+-parseInt(_0x3b9445(0x182))/0x5+parseInt(_0x3b9445(0x17e))/0x6+parseInt(_0x3b9445(0x17a))/0x7*(-parseInt(_0x3b9445(0x181))/0x8)+parseInt(_0x3b9445(0x17b))/0x9*(-parseInt(_0x3b9445(0x17c))/0xa);if(_0x2aa6f4===_0x1e98e1)break;else _0x2ac182['push'](_0x2ac182['shift']());}catch(_0x1b782d){_0x2ac182['push'](_0x2ac182['shift']());}}}(a56_0x30ad,0xbc124));import a56_0x131899 from'node:path';function a56_0x526b(_0x3b6a37,_0x5e2f64){_0x3b6a37=_0x3b6a37-0x175;const _0x30ad12=a56_0x30ad();let _0x526b27=_0x30ad12[_0x3b6a37];return _0x526b27;}import a56_0x2c9b0d from'node:fs';export async function copyDirectory(_0x22d9c3,_0x4aaf16){const _0x4c8487=a56_0x526b;try{const _0x4a0e83=a56_0x2c9b0d[_0x4c8487(0x179)](_0x22d9c3,{'withFileTypes':!![]});a56_0x2c9b0d['mkdirSync'](_0x4aaf16,{'recursive':!![]});for(const _0x1a5369 of _0x4a0e83){const _0x2024a1=a56_0x131899['join'](_0x22d9c3,_0x1a5369[_0x4c8487(0x176)]),_0x57caba=a56_0x131899['join'](_0x4aaf16,_0x1a5369[_0x4c8487(0x176)]);_0x1a5369[_0x4c8487(0x180)]()?await copyDirectory(_0x2024a1,_0x57caba):a56_0x2c9b0d[_0x4c8487(0x183)](_0x2024a1,_0x57caba);}}catch(_0x52baf8){console['error'](_0x4c8487(0x178),_0x52baf8);}}
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(_0x4df7e4,_0x2a0e57){const _0x36232b=a57_0x1642,_0x5a8254=_0x4df7e4();while(!![]){try{const _0x35bb5b=-parseInt(_0x36232b(0xb6))/0x1*(parseInt(_0x36232b(0xc0))/0x2)+parseInt(_0x36232b(0xb1))/0x3*(-parseInt(_0x36232b(0xad))/0x4)+-parseInt(_0x36232b(0xb2))/0x5*(parseInt(_0x36232b(0xbe))/0x6)+parseInt(_0x36232b(0xb8))/0x7+parseInt(_0x36232b(0xaf))/0x8+-parseInt(_0x36232b(0xb4))/0x9+parseInt(_0x36232b(0xc7))/0xa;if(_0x35bb5b===_0x2a0e57)break;else _0x5a8254['push'](_0x5a8254['shift']());}catch(_0x4c8017){_0x5a8254['push'](_0x5a8254['shift']());}}}(a57_0x3664,0x36e26));export async function httpRequest(_0x205565,_0x18703e={}){const _0x1f9b31=a57_0x1642,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x18703e;let _0x8c299f=null;for(let _0x446255=0x0;_0x446255<=retries;_0x446255++){try{const _0x18c3ba=new AbortController(),_0x24df53=setTimeout(()=>_0x18c3ba[_0x1f9b31(0xc1)](),timeout),_0x2a1bfd=await fetch(_0x205565,{'headers':headers,'signal':_0x18c3ba[_0x1f9b31(0xcb)]});clearTimeout(_0x24df53);let _0x2cd8e0;const _0x2f3e82=_0x2a1bfd['headers'][_0x1f9b31(0xc6)](_0x1f9b31(0xac));return _0x2f3e82?.[_0x1f9b31(0xbf)](_0x1f9b31(0xbb))?_0x2cd8e0=await _0x2a1bfd[_0x1f9b31(0xb5)]():_0x2cd8e0=await _0x2a1bfd['text'](),{'ok':_0x2a1bfd['ok'],'status':_0x2a1bfd[_0x1f9b31(0xc4)],'statusText':_0x2a1bfd[_0x1f9b31(0xb0)],'data':_0x2cd8e0,'headers':_0x2a1bfd[_0x1f9b31(0xc5)],'url':_0x2a1bfd[_0x1f9b31(0xb3)],'text':()=>_0x2a1bfd[_0x1f9b31(0xc8)]()};}catch(_0x3adc95){_0x8c299f=_0x3adc95 instanceof Error?_0x3adc95:new Error(String(_0x3adc95));if(_0x446255===retries)break;if(shouldRetry(_0x3adc95)){console[_0x1f9b31(0xb9)](_0x1f9b31(0xc2)+retryDelay+_0x1f9b31(0xca)+(_0x446255+0x1)+_0x1f9b31(0xc3)),await sleep(retryDelay);continue;}else break;}}throw _0x8c299f||new Error('Request\x20failed');}function shouldRetry(_0x3b63db){const _0x40c512=a57_0x1642;if(_0x3b63db instanceof Error){if(_0x3b63db['name']===_0x40c512(0xc9))return![];if(_0x3b63db[_0x40c512(0xae)]===_0x40c512(0xba)&&_0x3b63db['message'][_0x40c512(0xbf)](_0x40c512(0xbc)))return!![];if(_0x3b63db['message'][_0x40c512(0xbf)](_0x40c512(0xbd)))return!![];if(_0x3b63db[_0x40c512(0xb7)]['includes']('ENOTFOUND'))return![];}return![];}function a57_0x1642(_0x356c54,_0x5d7624){_0x356c54=_0x356c54-0xac;const _0x36644a=a57_0x3664();let _0x1642d4=_0x36644a[_0x356c54];return _0x1642d4;}function a57_0x3664(){const _0x579d99=['includes','114vAugrj','abort','*\x20请求失败,','\x20次重试...','status','headers','get','9315510nCWrBQ','text','AbortError','ms\x20后进行第\x20','signal','content-type','8RMomLS','name','784976VxXdpX','statusText','168261toOAUI','965ewOWwG','url','1004229ulOGDO','json','7448UXJvLD','message','1604617yfayOm','log','TypeError','application/json','fetch','ECONNRESET','11994XWuEFu'];a57_0x3664=function(){return _0x579d99;};return a57_0x3664();}function sleep(_0x45176e){return new Promise(_0x2b2c6f=>setTimeout(_0x2b2c6f,_0x45176e));}export function validateUrl(_0x3e6a4a){try{return new URL(_0x3e6a4a),!![];}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
- const a58_0x51a0ff=a58_0x4e64;function a58_0x26af(){const _0xc40c5=['existsSync','details','initWinstonLogger','parse','16374RYvNht','49AkELfp','clear','logTask','clearLogs','addColors','logFilePath','setRawCommand','message','Failed\x20to\x20clear\x20logs:','mkdirSync','join','utf8','timestamp','Failed\x20to\x20read\x20logs:','toISOString','开始执行:\x20','log','writeFileSync','完成:\x20','command','blue','790860frdDUu','396bekoys','errors','stringify','6720525EFFwXm','success','error','green','info','52410879HuuUxA','readFileSync','1579024KBTvyc','filter','rawCommand','format','unknown','readLogs','transports','2242314DQyVGN','10NTNhCt','trim','winstonLogger','currentRawCommand','map','now','.lovrabet.log','red','level','warn','195700vxhmkA'];a58_0x26af=function(){return _0xc40c5;};return a58_0x26af();}(function(_0x42304a,_0x2d764b){const _0x2bb5cc=a58_0x4e64,_0x50b9a0=_0x42304a();while(!![]){try{const _0x5f1322=-parseInt(_0x2bb5cc(0xc1))/0x1+parseInt(_0x2bb5cc(0xab))/0x2*(-parseInt(_0x2bb5cc(0xc2))/0x3)+parseInt(_0x2bb5cc(0xa6))/0x4+-parseInt(_0x2bb5cc(0xc5))/0x5+-parseInt(_0x2bb5cc(0xd3))/0x6+parseInt(_0x2bb5cc(0xac))/0x7*(-parseInt(_0x2bb5cc(0xcc))/0x8)+-parseInt(_0x2bb5cc(0xca))/0x9*(-parseInt(_0x2bb5cc(0xd4))/0xa);if(_0x5f1322===_0x2d764b)break;else _0x50b9a0['push'](_0x50b9a0['shift']());}catch(_0x32f710){_0x50b9a0['push'](_0x50b9a0['shift']());}}}(a58_0x26af,0xdc0de));import a58_0x2d6691 from'winston';import a58_0x2ba5f2 from'node:fs';import a58_0x2dbf15 from'node:path';function a58_0x4e64(_0x2dd866,_0x2137a3){_0x2dd866=_0x2dd866-0xa6;const _0x26af2e=a58_0x26af();let _0x4e64ae=_0x26af2e[_0x2dd866];return _0x4e64ae;}class Logger{[a58_0x51a0ff(0xd6)];[a58_0x51a0ff(0xb1)];[a58_0x51a0ff(0xd7)]='';constructor(){const _0x2f8aca=a58_0x51a0ff;this[_0x2f8aca(0xb1)]='';}[a58_0x51a0ff(0xb2)](_0x334c85){const _0x19edd5=a58_0x51a0ff;this[_0x19edd5(0xd7)]=_0x334c85;}[a58_0x51a0ff(0xa9)](){const _0x37175f=a58_0x51a0ff,_0xb1d58b=a58_0x2dbf15['dirname'](this[_0x37175f(0xb1)]);!a58_0x2ba5f2[_0x37175f(0xa7)](_0xb1d58b)&&a58_0x2ba5f2[_0x37175f(0xb5)](_0xb1d58b,{'recursive':!![]});const _0x266820=a58_0x2d6691[_0x37175f(0xcf)]['combine'](a58_0x2d6691[_0x37175f(0xcf)][_0x37175f(0xb8)](),a58_0x2d6691[_0x37175f(0xcf)][_0x37175f(0xc3)]({'stack':!![]}),a58_0x2d6691[_0x37175f(0xcf)]['printf'](_0x18b0cb=>{const _0x281676=_0x37175f,_0x5e399a={'timestamp':_0x18b0cb[_0x281676(0xb8)]||new Date()[_0x281676(0xba)](),'level':_0x18b0cb[_0x281676(0xdc)]||'info','command':_0x18b0cb[_0x281676(0xbf)]||_0x281676(0xd0),'rawCommand':_0x18b0cb[_0x281676(0xce)]||this['currentRawCommand']||undefined,'message':_0x18b0cb[_0x281676(0xb3)]||'','duration':_0x18b0cb['duration']||undefined,'details':_0x18b0cb[_0x281676(0xa8)]||undefined};return JSON[_0x281676(0xc4)](_0x5e399a);}));this[_0x37175f(0xd6)]=a58_0x2d6691['createLogger']({'level':_0x37175f(0xc9),'format':_0x266820,'transports':[new a58_0x2d6691[(_0x37175f(0xd2))]['File']({'filename':this['logFilePath'],'level':'info'})],'silent':![]}),a58_0x2d6691[_0x37175f(0xb0)]({'success':_0x37175f(0xc8),'error':_0x37175f(0xdb),'warn':'yellow','info':_0x37175f(0xc0)});}['setLogPath'](_0x2ed224){const _0x16546d=a58_0x51a0ff;this[_0x16546d(0xb1)]=a58_0x2dbf15[_0x16546d(0xb6)](_0x2ed224,_0x16546d(0xda)),this[_0x16546d(0xd6)]&&this['winstonLogger'][_0x16546d(0xad)](),this[_0x16546d(0xa9)]();}[a58_0x51a0ff(0xc9)](_0x2e3f19,_0x2bb197,_0x36b01d){const _0x9ea903=a58_0x51a0ff;if(!this[_0x9ea903(0xb1)]||!this[_0x9ea903(0xd6)])return;this[_0x9ea903(0xd6)][_0x9ea903(0xc9)](_0x2bb197,{'command':_0x2e3f19,'details':_0x36b01d});}['success'](_0x283ca0,_0x54c2c2,_0x2c1108,_0x2f81ed){const _0x1a9fd4=a58_0x51a0ff;if(!this[_0x1a9fd4(0xb1)]||!this[_0x1a9fd4(0xd6)])return;this[_0x1a9fd4(0xd6)][_0x1a9fd4(0xbc)](_0x1a9fd4(0xc9),_0x54c2c2,{'level':_0x1a9fd4(0xc6),'command':_0x283ca0,'duration':_0x2c1108,'details':_0x2f81ed});}[a58_0x51a0ff(0xc7)](_0x8a0c62,_0x4f16de,_0x38689f){const _0x14a0a4=a58_0x51a0ff;if(!this['logFilePath']||!this[_0x14a0a4(0xd6)])return;this[_0x14a0a4(0xd6)][_0x14a0a4(0xc7)](_0x4f16de,{'command':_0x8a0c62,'details':_0x38689f});}[a58_0x51a0ff(0xdd)](_0x2769a0,_0x13c0c8,_0x1226c6){const _0x3e3c2b=a58_0x51a0ff;if(!this[_0x3e3c2b(0xb1)]||!this[_0x3e3c2b(0xd6)])return;this['winstonLogger'][_0x3e3c2b(0xdd)](_0x13c0c8,{'command':_0x2769a0,'details':_0x1226c6});}async[a58_0x51a0ff(0xae)](_0x32e76d,_0x5aa709,_0x187be4){const _0x1be019=a58_0x51a0ff,_0x496479=Date[_0x1be019(0xd9)]();this[_0x1be019(0xc9)](_0x32e76d,_0x1be019(0xbb)+_0x5aa709);try{const _0x43c931=await _0x187be4(),_0x5047a0=Date['now']()-_0x496479;return this[_0x1be019(0xc6)](_0x32e76d,_0x1be019(0xbe)+_0x5aa709,_0x5047a0),_0x43c931;}catch(_0x3a0c6c){const _0x30b4e2=Date[_0x1be019(0xd9)]()-_0x496479;this[_0x1be019(0xc7)](_0x32e76d,'失败:\x20'+_0x5aa709,{'error':_0x3a0c6c instanceof Error?_0x3a0c6c[_0x1be019(0xb3)]:String(_0x3a0c6c),'duration':_0x30b4e2});throw _0x3a0c6c;}}[a58_0x51a0ff(0xd1)](){const _0x56e526=a58_0x51a0ff;try{if(!a58_0x2ba5f2[_0x56e526(0xa7)](this[_0x56e526(0xb1)]))return[];const _0x34dc81=a58_0x2ba5f2[_0x56e526(0xcb)](this['logFilePath'],_0x56e526(0xb7));return _0x34dc81['split']('\x0a')[_0x56e526(0xcd)](_0x1a5548=>_0x1a5548[_0x56e526(0xd5)]())[_0x56e526(0xd8)](_0x4e1cfc=>JSON[_0x56e526(0xaa)](_0x4e1cfc));}catch(_0x286211){return console[_0x56e526(0xdd)](_0x56e526(0xb9),_0x286211),[];}}[a58_0x51a0ff(0xaf)](){const _0x9695b1=a58_0x51a0ff;try{a58_0x2ba5f2[_0x9695b1(0xa7)](this[_0x9695b1(0xb1)])&&a58_0x2ba5f2[_0x9695b1(0xbd)](this[_0x9695b1(0xb1)],'',_0x9695b1(0xb7));}catch(_0x2a5488){console[_0x9695b1(0xdd)](_0x9695b1(0xb4),_0x2a5488);}}['getWinstonInstance'](){return this['winstonLogger'];}}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
- const a59_0x4eaa72=a59_0x4f39;(function(_0x10b5b6,_0x3cb5b1){const _0x1c778f=a59_0x4f39,_0x4826d2=_0x10b5b6();while(!![]){try{const _0x44313f=parseInt(_0x1c778f(0x131))/0x1*(-parseInt(_0x1c778f(0x111))/0x2)+-parseInt(_0x1c778f(0x134))/0x3*(-parseInt(_0x1c778f(0x12b))/0x4)+parseInt(_0x1c778f(0x11c))/0x5*(parseInt(_0x1c778f(0x108))/0x6)+parseInt(_0x1c778f(0x123))/0x7*(parseInt(_0x1c778f(0x11d))/0x8)+parseInt(_0x1c778f(0x10a))/0x9+-parseInt(_0x1c778f(0x10c))/0xa+-parseInt(_0x1c778f(0x12c))/0xb*(parseInt(_0x1c778f(0x118))/0xc);if(_0x44313f===_0x3cb5b1)break;else _0x4826d2['push'](_0x4826d2['shift']());}catch(_0x1305a1){_0x4826d2['push'](_0x4826d2['shift']());}}}(a59_0x3faf,0x88eba));import a59_0x1b1004 from'node:fs';function a59_0x3faf(){const _0x57020a=['4658950ieXtaw','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','charAt','toLowerCase','split','790882XFleIj','info','indexOf','previewChanges','error','readFile','路由配置更新完成','34717008RkOuqr','existsSync','import\x20','路由配置更新失败','1525fGiTBQ','8917624jEEMmg','promises','\x20from\x20\x22../pages/','path:\x20\x22','writeFile','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','7NFLEeY','success','未找到路由配置的\x20children\x20数组','router','lastIndexOf','message','now','slice','24576TPZbIx','11rKNcka','map','addRoute','match','src','1qOXyWd','addPageRoute','index','492hnCOTc','routerFilePath','toComponentName','join','addImport','路由文件不存在:\x20','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','index.tsx','21462NDQpvj','length','9917478mFgEOx','utf8'];a59_0x3faf=function(){return _0x57020a;};return a59_0x3faf();}function a59_0x4f39(_0x5aeab8,_0x4452f2){_0x5aeab8=_0x5aeab8-0x105;const _0x3faff3=a59_0x3faf();let _0x4f39a3=_0x3faff3[_0x5aeab8];return _0x4f39a3;}import a59_0x7bc5af from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x4eaa72(0x135)];constructor(_0x5ba225){const _0x52eeb1=a59_0x4eaa72;this['routerFilePath']=a59_0x7bc5af[_0x52eeb1(0x137)](_0x5ba225,_0x52eeb1(0x130),_0x52eeb1(0x126),_0x52eeb1(0x107));}async[a59_0x4eaa72(0x132)](_0x51ea4e,_0x47213d){const _0x3c2d76=a59_0x4eaa72;if(!a59_0x1b1004[_0x3c2d76(0x119)](this[_0x3c2d76(0x135)]))throw new Error(_0x3c2d76(0x105)+this[_0x3c2d76(0x135)]);const _0x510a7c=Date['now']();logger[_0x3c2d76(0x112)](_0x3c2d76(0x126),'开始更新路由配置',{'pageName':_0x51ea4e,'routePath':_0x47213d,'file':this[_0x3c2d76(0x135)]});try{const _0x1eba44=await a59_0x1b1004['promises'][_0x3c2d76(0x116)](this[_0x3c2d76(0x135)],_0x3c2d76(0x10b)),_0x38b478=this['toComponentName'](_0x51ea4e),_0x1b68b8=this[_0x3c2d76(0x138)](_0x1eba44,_0x38b478,_0x51ea4e),_0x335249=this[_0x3c2d76(0x12e)](_0x1b68b8,_0x47213d,_0x38b478);await a59_0x1b1004[_0x3c2d76(0x11e)][_0x3c2d76(0x121)](this[_0x3c2d76(0x135)],_0x335249,'utf8');const _0x2e4fa2=Date[_0x3c2d76(0x129)]()-_0x510a7c;logger[_0x3c2d76(0x124)](_0x3c2d76(0x126),_0x3c2d76(0x117),_0x2e4fa2,{'pageName':_0x51ea4e,'routePath':_0x47213d,'componentName':_0x38b478});}catch(_0x5e4361){const _0x994ad8=Date['now']()-_0x510a7c;logger[_0x3c2d76(0x115)](_0x3c2d76(0x126),_0x3c2d76(0x11b),{'pageName':_0x51ea4e,'routePath':_0x47213d,'error':_0x5e4361 instanceof Error?_0x5e4361[_0x3c2d76(0x128)]:String(_0x5e4361),'duration':_0x994ad8});throw _0x5e4361;}}[a59_0x4eaa72(0x136)](_0x5a0687){const _0x524d6b=a59_0x4eaa72;return _0x5a0687[_0x524d6b(0x110)]('-')[_0x524d6b(0x12d)](_0x4ada2a=>_0x4ada2a[_0x524d6b(0x10e)](0x0)['toUpperCase']()+_0x4ada2a[_0x524d6b(0x12a)](0x1)[_0x524d6b(0x10f)]())['join']('');}[a59_0x4eaa72(0x138)](_0x18f245,_0x43ece7,_0x234455){const _0x3d2329=a59_0x4eaa72,_0x464ee0=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x14d525=_0x18f245[_0x3d2329(0x12f)](_0x464ee0)||[],_0x4c18f9=_0x3d2329(0x11a)+_0x43ece7+_0x3d2329(0x11f)+_0x234455+'\x22;';if(_0x18f245['includes'](_0x4c18f9))return _0x18f245;if(_0x14d525[_0x3d2329(0x109)]>0x0){const _0x291d47=_0x14d525[_0x14d525[_0x3d2329(0x109)]-0x1];if(_0x291d47){const _0x36a729=_0x18f245[_0x3d2329(0x127)](_0x291d47),_0x1170be=_0x36a729+_0x291d47[_0x3d2329(0x109)];return _0x18f245['slice'](0x0,_0x1170be)+_0x4c18f9+'\x0a'+_0x18f245[_0x3d2329(0x12a)](_0x1170be);}}const _0x55e386=_0x18f245[_0x3d2329(0x12f)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x55e386&&_0x55e386[_0x3d2329(0x133)]!==undefined){const _0x33bc46=_0x55e386[_0x3d2329(0x133)]+_0x55e386[0x0][_0x3d2329(0x109)];return _0x18f245[_0x3d2329(0x12a)](0x0,_0x33bc46)+_0x4c18f9+'\x0a'+_0x18f245[_0x3d2329(0x12a)](_0x33bc46);}return _0x18f245;}[a59_0x4eaa72(0x12e)](_0x35f63e,_0x332b25,_0x49b46a){const _0x4c8642=a59_0x4eaa72,_0x37da2d=_0x4c8642(0x122)+_0x332b25+_0x4c8642(0x106)+_0x49b46a+_0x4c8642(0x10d);if(_0x35f63e['includes'](_0x4c8642(0x120)+_0x332b25+'\x22'))return _0x35f63e;const _0x12c26a=/children:\s*\[([\s\S]*?)\]/,_0x5d1e04=_0x35f63e[_0x4c8642(0x12f)](_0x12c26a);if(!_0x5d1e04||_0x5d1e04[_0x4c8642(0x133)]===undefined)throw new Error(_0x4c8642(0x125));const _0x27e26c=_0x5d1e04[0x1],_0x4889c9=_0x5d1e04[_0x4c8642(0x133)]+_0x5d1e04[0x0][_0x4c8642(0x113)]('[')+0x1,_0x3d6575=_0x27e26c?.[_0x4c8642(0x12f)](/\{[\s\S]*?\},/g)||[];if(_0x3d6575['length']>0x0){const _0x294bb5=_0x3d6575[_0x3d6575['length']-0x1];if(_0x294bb5){const _0x13546b=_0x35f63e['lastIndexOf'](_0x294bb5),_0x33707a=_0x13546b+_0x294bb5[_0x4c8642(0x109)];return _0x35f63e[_0x4c8642(0x12a)](0x0,_0x33707a)+'\x0a'+_0x37da2d+_0x35f63e['slice'](_0x33707a);}}return _0x35f63e[_0x4c8642(0x12a)](0x0,_0x4889c9)+'\x0a'+_0x37da2d+_0x35f63e[_0x4c8642(0x12a)](_0x4889c9);}async[a59_0x4eaa72(0x114)](_0x41710d,_0x1b9c59){const _0x4f0f13=a59_0x4eaa72;if(!a59_0x1b1004[_0x4f0f13(0x119)](this[_0x4f0f13(0x135)]))throw new Error(_0x4f0f13(0x105)+this[_0x4f0f13(0x135)]);const _0x349a70=await a59_0x1b1004[_0x4f0f13(0x11e)]['readFile'](this[_0x4f0f13(0x135)],'utf8'),_0x53e2dc=this[_0x4f0f13(0x136)](_0x41710d);let _0xb0a517=this['addImport'](_0x349a70,_0x53e2dc,_0x41710d);return _0xb0a517=this['addRoute'](_0xb0a517,_0x1b9c59,_0x53e2dc),_0xb0a517;}}
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(_0x5833bf){return new Promise(_0x1da612=>setTimeout(_0x1da612,_0x5833bf));}
1
+ export function sleep(_0x4c4e42){return new Promise(_0x549bde=>setTimeout(_0x549bde,_0x4c4e42));}
@@ -1 +1 @@
1
- const a61_0x3f88ec=a61_0x15e0;(function(_0x446378,_0x517609){const _0xa1375=a61_0x15e0,_0x2d0df3=_0x446378();while(!![]){try{const _0x269f00=-parseInt(_0xa1375(0x12c))/0x1+-parseInt(_0xa1375(0x149))/0x2+parseInt(_0xa1375(0x144))/0x3+-parseInt(_0xa1375(0x135))/0x4+-parseInt(_0xa1375(0x156))/0x5+parseInt(_0xa1375(0x169))/0x6*(-parseInt(_0xa1375(0x14f))/0x7)+parseInt(_0xa1375(0x13c))/0x8;if(_0x269f00===_0x517609)break;else _0x2d0df3['push'](_0x2d0df3['shift']());}catch(_0x2917f8){_0x2d0df3['push'](_0x2d0df3['shift']());}}}(a61_0x3f8a,0x95b4f));function a61_0x15e0(_0x123da7,_0x51a41b){_0x123da7=_0x123da7-0x129;const _0x3f8a84=a61_0x3f8a();let _0x15e09e=_0x3f8a84[_0x123da7];return _0x15e09e;}import a61_0x236b12 from'node:fs';import a61_0x1d9dcd from'node:path';import{logger}from'./logger.js';function a61_0x3f8a(){const _0x5b91a3=['.ts','datasetCode:\x20\x22','toUpperCase','extname','2271195rrufEN','toDisplayTitle','api','split','2-digit','name','now','.js','copyFile','slice','template','.jsx','processDirectory','.css','endsWith','push','tableName','mkdir','.tpl','30BxrbCb','\x0a\x20\x20\x20\x20{\x20','toComponentName','info','.md','1057223lvsnTQ','.json','map','toLowerCase','alias','readFile','readdir','toISOString','utf8','505492WLtHwN','replaceContent','pop','isFile','charAt','default','toLocaleTimeString','22724256iYAFFf','includes','writeFile','toLocaleDateString','name:\x20\x22','YourModel','promises','replace','3655326eKwtCv','alias:\x20\x22','模板内容替换完成','processTemplate','numeric','2440250mjdnZH','isDirectory','tableName:\x20\x22','replaceApiContent','\x20},','message','822941siniHl','join','.scss'];a61_0x3f8a=function(){return _0x5b91a3;};return a61_0x3f8a();}export class TemplateReplacer{static[a61_0x3f88ec(0x129)](_0x20a093){const _0x3496ec=a61_0x3f88ec,_0x178099=_0x20a093[_0x3496ec(0x159)]('/')[_0x3496ec(0x137)]()||_0x20a093;return _0x178099[_0x3496ec(0x159)]('-')[_0x3496ec(0x12e)](_0x3ceebe=>_0x3ceebe[_0x3496ec(0x139)](0x0)[_0x3496ec(0x154)]()+_0x3ceebe['slice'](0x1)[_0x3496ec(0x12f)]())[_0x3496ec(0x150)]('');}static['toDisplayTitle'](_0x29ab1f){const _0x14041b=a61_0x3f88ec,_0x526c26=_0x29ab1f[_0x14041b(0x159)]('/')[_0x14041b(0x137)]()||_0x29ab1f;return _0x526c26[_0x14041b(0x159)]('-')[_0x14041b(0x12e)](_0x3c6d5b=>_0x3c6d5b[_0x14041b(0x139)](0x0)['toUpperCase']()+_0x3c6d5b[_0x14041b(0x15f)](0x1)[_0x14041b(0x12f)]())['join']('\x20');}static[a61_0x3f88ec(0x136)](_0x237b98,_0x1e6cf6,_0x5de7b1){const _0x593c7f=a61_0x3f88ec,_0x193084=this[_0x593c7f(0x129)](_0x1e6cf6),_0x37b6aa=this[_0x593c7f(0x157)](_0x1e6cf6),_0x30434d=new Date(),_0x2042a5=_0x30434d['toLocaleString'](undefined,{'year':_0x593c7f(0x148),'month':_0x593c7f(0x15a),'day':_0x593c7f(0x15a),'hour':_0x593c7f(0x15a),'minute':_0x593c7f(0x15a),'second':_0x593c7f(0x15a),'hour12':![]})[_0x593c7f(0x143)](/\//g,'-'),_0x1442cf=_0x30434d[_0x593c7f(0x13f)](undefined,{'year':_0x593c7f(0x148),'month':_0x593c7f(0x15a),'day':_0x593c7f(0x15a)})['replace'](/\//g,'-'),_0x1b18a0=_0x30434d[_0x593c7f(0x13b)](undefined,{'hour12':![]});let _0x5299d2=_0x237b98[_0x593c7f(0x143)](/\{ComponentName\}/g,_0x193084)['replace'](/\{DisplayTitle\}/g,_0x37b6aa)['replace'](/\{PageName\}/g,_0x1e6cf6)['replace'](/\{TemplateName\}/g,_0x5de7b1)[_0x593c7f(0x143)](/\{CreatedAt\}/g,_0x2042a5)[_0x593c7f(0x143)](/\{CreatedDate\}/g,_0x1442cf)[_0x593c7f(0x143)](/\{CreatedTime\}/g,_0x1b18a0);return _0x5299d2;}static[a61_0x3f88ec(0x14c)](_0x51fa68,_0x368528,_0x110031,_0x2b2b0e,_0x5af683,_0x54ab9b,_0x539924){const _0x1077c1=a61_0x3f88ec,_0x32b86d=new Date(),_0x17ec22=_0x32b86d[_0x1077c1(0x133)](),_0xa447c1=_0x110031[_0x1077c1(0x12e)](_0x1eaae8=>{const _0xcf0261=_0x1077c1,_0x344300=[_0xcf0261(0x153)+_0x1eaae8['datasetCode']+'\x22',_0xcf0261(0x14b)+_0x1eaae8[_0xcf0261(0x166)]+'\x22',_0xcf0261(0x140)+_0x1eaae8[_0xcf0261(0x15b)]+'\x22'];return _0x1eaae8[_0xcf0261(0x130)]&&_0x344300[_0xcf0261(0x165)](_0xcf0261(0x145)+_0x1eaae8[_0xcf0261(0x130)]+'\x22'),_0xcf0261(0x16a)+_0x344300['join'](',\x20')+_0xcf0261(0x14d);})[_0x1077c1(0x150)](''),_0x4eae98=_0x2b2b0e||_0x110031[0x0]?.[_0x1077c1(0x130)]||_0x1077c1(0x141);let _0x463c26=_0x51fa68[_0x1077c1(0x143)](/\{AppCode\}/g,_0x368528)[_0x1077c1(0x143)](/\{ModelConfigs\}/g,_0xa447c1)['replace'](/\{ExampleModelName\}/g,_0x4eae98)[_0x1077c1(0x143)](/\{ApiFileName\}/g,_0x5af683||_0x1077c1(0x158))[_0x1077c1(0x143)](/\{ConfigName\}/g,_0x54ab9b||_0x1077c1(0x13a))['replace'](/\{ClientConfigParam\}/g,_0x539924||'')[_0x1077c1(0x143)](/\{CreatedAt\}/g,_0x17ec22);return _0x463c26;}static async[a61_0x3f88ec(0x147)](_0x1d9db6,_0x22cd82,_0x773e14,_0x5b01f4,_0x175862=!![]){const _0x40dde6=a61_0x3f88ec,_0x5939f2=Date[_0x40dde6(0x15c)]();try{_0x175862&&logger[_0x40dde6(0x12a)](_0x40dde6(0x160),'开始处理模板内容替换',{'templatePath':_0x1d9db6,'targetPath':_0x22cd82,'pageName':_0x773e14,'templateName':_0x5b01f4});await a61_0x236b12['promises'][_0x40dde6(0x167)](_0x22cd82,{'recursive':!![]}),await this[_0x40dde6(0x162)](_0x1d9db6,_0x22cd82,_0x773e14,_0x5b01f4);if(_0x175862){const _0x1b569f=Date[_0x40dde6(0x15c)]()-_0x5939f2;logger['success'](_0x40dde6(0x160),_0x40dde6(0x146),_0x1b569f,{'pageName':_0x773e14,'templateName':_0x5b01f4});}}catch(_0x34d9fa){if(_0x175862){const _0x3b30c3=Date['now']()-_0x5939f2;logger['error']('template','模板内容替换失败',{'templatePath':_0x1d9db6,'targetPath':_0x22cd82,'pageName':_0x773e14,'templateName':_0x5b01f4,'error':_0x34d9fa instanceof Error?_0x34d9fa[_0x40dde6(0x14e)]:String(_0x34d9fa),'duration':_0x3b30c3});}throw _0x34d9fa;}}static async[a61_0x3f88ec(0x162)](_0x5f5247,_0x861e1e,_0x38bd1a,_0x5d5bfd){const _0x3e5778=a61_0x3f88ec,_0x3efc3c=await a61_0x236b12[_0x3e5778(0x142)][_0x3e5778(0x132)](_0x5f5247,{'withFileTypes':!![]});for(const _0x52db2a of _0x3efc3c){const _0xbc3917=a61_0x1d9dcd[_0x3e5778(0x150)](_0x5f5247,_0x52db2a[_0x3e5778(0x15b)]);let _0x1d2f5f=a61_0x1d9dcd[_0x3e5778(0x150)](_0x861e1e,_0x52db2a[_0x3e5778(0x15b)]);_0x52db2a[_0x3e5778(0x15b)][_0x3e5778(0x164)](_0x3e5778(0x168))&&(_0x1d2f5f=a61_0x1d9dcd[_0x3e5778(0x150)](_0x861e1e,_0x52db2a[_0x3e5778(0x15b)][_0x3e5778(0x143)](/\.tpl$/,'')));if(_0x52db2a[_0x3e5778(0x14a)]())await a61_0x236b12['promises'][_0x3e5778(0x167)](_0x1d2f5f,{'recursive':!![]}),await this['processDirectory'](_0xbc3917,_0x1d2f5f,_0x38bd1a,_0x5d5bfd);else _0x52db2a[_0x3e5778(0x138)]()&&await this['processFile'](_0xbc3917,_0x1d2f5f,_0x38bd1a,_0x5d5bfd);}}static async['processFile'](_0x18d1ac,_0x2c1ad5,_0x3e5998,_0x26fdb2){const _0x17a627=a61_0x3f88ec,_0x3de55a=a61_0x1d9dcd[_0x17a627(0x155)](_0x18d1ac)[_0x17a627(0x12f)]();_0x18d1ac[_0x17a627(0x164)](_0x17a627(0x168))&&(_0x2c1ad5=_0x2c1ad5['replace'](/\.tpl$/,''));const _0x29ec97=['.tsx',_0x17a627(0x152),_0x17a627(0x161),_0x17a627(0x15d),_0x17a627(0x12d),_0x17a627(0x12b),_0x17a627(0x163),_0x17a627(0x151),_0x17a627(0x168)];if(_0x29ec97[_0x17a627(0x13d)](_0x3de55a)||_0x18d1ac[_0x17a627(0x164)](_0x17a627(0x168))){const _0x80f78f=await a61_0x236b12[_0x17a627(0x142)][_0x17a627(0x131)](_0x18d1ac,_0x17a627(0x134)),_0x4b1a3a=this[_0x17a627(0x136)](_0x80f78f,_0x3e5998,_0x26fdb2);await a61_0x236b12['promises'][_0x17a627(0x13e)](_0x2c1ad5,_0x4b1a3a,'utf8');}else await a61_0x236b12[_0x17a627(0x142)][_0x17a627(0x15e)](_0x18d1ac,_0x2c1ad5);}}
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.1-beta.4",
3
+ "version": "1.2.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"
@@ -43,14 +43,14 @@
43
43
  "listr": "^0.14.3",
44
44
  "meow": "^13.2.0",
45
45
  "prettier": "^3.6.2",
46
- "react": "^19.1.1",
46
+ "react": "^19.2.0",
47
47
  "semver": "^7.7.3",
48
48
  "winston": "^3.17.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/listr": "^0.14.9",
52
52
  "@types/node": "^24.5.2",
53
- "@types/react": "^19.1.12",
53
+ "@types/react": "^19.2.0",
54
54
  "@types/semver": "^7.7.1",
55
55
  "@vitest/coverage-v8": "^3.2.4",
56
56
  "@vitest/ui": "^3.2.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sub-app-react-demo",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@ant-design/icons": "^6.0.0",
13
13
  "@ice/stark-app": "^1.5.0",
14
- "@lovrabet/sdk": "^1.1.24",
14
+ "@lovrabet/sdk": "latest",
15
15
  "antd": "^5.26.7",
16
16
  "echarts": "^5.6.0",
17
17
  "echarts-for-react": "^3.0.2",