@lovrabet/cli 1.2.1-beta.3 → 1.2.1-beta.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 (60) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-update-cdn/current-content.js +1 -1
  19. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  20. package/lib/app-menu-update-cdn/main.js +1 -1
  21. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  22. package/lib/auth/auth-server-ui.js +1 -1
  23. package/lib/auth/auth-server.js +1 -1
  24. package/lib/auth/constant.js +1 -1
  25. package/lib/auth/get-cookie.js +1 -1
  26. package/lib/auth/is-session-valid.js +1 -1
  27. package/lib/auth/logout.js +1 -1
  28. package/lib/cli.js +1 -1
  29. package/lib/cmd/build-watch.js +1 -1
  30. package/lib/cmd/build.js +1 -1
  31. package/lib/cmd/logs.js +1 -1
  32. package/lib/cmd/preview.js +1 -1
  33. package/lib/cmd/start.js +1 -1
  34. package/lib/config/config-help.js +1 -1
  35. package/lib/config/main.js +1 -1
  36. package/lib/constant/domain.js +1 -1
  37. package/lib/constant/env.js +1 -1
  38. package/lib/create-app/enhanced-guided-create.js +1 -1
  39. package/lib/create-app/format-elapsed.js +1 -1
  40. package/lib/create-app/main.js +1 -1
  41. package/lib/create-app/task-finished.js +1 -1
  42. package/lib/create-app/task-loading.js +1 -1
  43. package/lib/create-app/task-running.js +1 -1
  44. package/lib/create-app/task-time.js +1 -1
  45. package/lib/create-app/use-copy-project-template.js +1 -1
  46. package/lib/create-app/use-format-code.js +1 -1
  47. package/lib/create-app/use-install-dependencies.js +1 -1
  48. package/lib/help.js +1 -1
  49. package/lib/init/main.js +1 -1
  50. package/lib/mcp/cursor.js +1 -1
  51. package/lib/mcp/main.js +1 -1
  52. package/lib/utils/check-sdk-version.js +1 -1
  53. package/lib/utils/config.js +1 -1
  54. package/lib/utils/copy-directory.js +1 -1
  55. package/lib/utils/http-client.js +1 -1
  56. package/lib/utils/logger.js +1 -1
  57. package/lib/utils/router-updater.js +1 -1
  58. package/lib/utils/sleep.js +1 -1
  59. package/lib/utils/template-replacer.js +1 -1
  60. package/package.json +1 -1
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- function a51_0x58e7(){const _0x541b04=['请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','复制\x20Cursor\x20Rules\x20文件','lovrabet-dataset','\x0a✓\x20Cursor\x20MCP\x20配置成功!','online','配置\x20Cursor\x20MCP\x20成功','utf8','创建新的\x20mcp.json\x20配置','9909330VuuXPt','4332318wZeqxI','✓\x20创建\x20.cursor\x20目录:\x20','mcp-cursor','log','✓\x20创建\x20mcp.json\x20配置文件','\x20\x20-\x20环境:\x20','exit','Cursor\x20Rules\x20文件已存在,跳过','stringify','npx','error','1581905ZWNYut','错误:\x20解析现有\x20mcp.json\x20失败:\x20','5479280SFfXxu','配置\x20Cursor\x20MCP\x20失败','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','message','mcpServers','9356102DJOanI','创建\x20.cursor\x20目录','1lyKYWG','cwd','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','创建\x20.cursor/rules\x20目录','303274CgWFcd','\x20\x20-\x20AppCode:\x20','2731228Xiwzqt','✓\x20更新\x20mcp.json\x20配置','.cursor','复制\x20Cursor\x20Rules\x20文件失败','app','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','info','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','lovrabet_rules.mdc','更新现有\x20mcp.json\x20配置','warn','\x0a配置信息:'];a51_0x58e7=function(){return _0x541b04;};return a51_0x58e7();}(function(_0x2a8886,_0x71719f){const _0x27da31=a51_0x5420,_0x36e2ab=_0x2a8886();while(!![]){try{const _0x41cb87=-parseInt(_0x27da31(0x173))/0x1*(-parseInt(_0x27da31(0x148))/0x2)+parseInt(_0x27da31(0x15f))/0x3+-parseInt(_0x27da31(0x14a))/0x4+parseInt(_0x27da31(0x16a))/0x5+parseInt(_0x27da31(0x15e))/0x6+-parseInt(_0x27da31(0x171))/0x7+-parseInt(_0x27da31(0x16c))/0x8;if(_0x41cb87===_0x71719f)break;else _0x36e2ab['push'](_0x36e2ab['shift']());}catch(_0x49437c){_0x36e2ab['push'](_0x36e2ab['shift']());}}}(a51_0x58e7,0xd1cf0));function a51_0x5420(_0x1a9cb1,_0x1ce972){_0x1a9cb1=_0x1a9cb1-0x147;const _0x58e737=a51_0x58e7();let _0x542099=_0x58e737[_0x1a9cb1];return _0x542099;}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x255bd9=a51_0x5420;try{const _0x32cd8c=process[_0x255bd9(0x174)](),_0x1c1f91=resolve(_0x32cd8c,_0x255bd9(0x14c)),_0x31297a=resolve(_0x1c1f91,'mcp.json'),_0x16a4d0=readConfig(),_0x469726=_0x16a4d0['appcode']||_0x16a4d0[_0x255bd9(0x14e)],_0x148978=_0x16a4d0['env']||_0x255bd9(0x15a);!_0x469726&&(console[_0x255bd9(0x169)](_0x255bd9(0x175)),logger[_0x255bd9(0x169)]('mcp-cursor','未找到\x20appcode\x20配置'),process[_0x255bd9(0x165)](0x1));!existsSync(_0x1c1f91)&&(mkdirSync(_0x1c1f91,{'recursive':!![]}),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x172),{'path':_0x1c1f91}),console[_0x255bd9(0x162)](_0x255bd9(0x160)+_0x1c1f91));const _0x5be5e8={'command':_0x255bd9(0x168),'args':['-y','@lovrabet/dataset-mcp-server'],'env':{'LOVRABET_APP_CODE':String(_0x469726),'LOVRABET_ENV':String(_0x148978)}};let _0x248989;if(existsSync(_0x31297a))try{const _0x365bee=readFileSync(_0x31297a,'utf8');_0x248989=JSON['parse'](_0x365bee),!_0x248989['mcpServers']&&(_0x248989[_0x255bd9(0x170)]={}),_0x248989[_0x255bd9(0x170)][_0x255bd9(0x158)]=_0x5be5e8,logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x153),{'path':_0x31297a,'appcode':_0x469726,'env':_0x148978}),console['log'](_0x255bd9(0x14b));}catch(_0x3619e7){logger[_0x255bd9(0x169)](_0x255bd9(0x161),'解析现有\x20mcp.json\x20失败',{'error':_0x3619e7 instanceof Error?_0x3619e7[_0x255bd9(0x16f)]:String(_0x3619e7)}),console[_0x255bd9(0x169)](_0x255bd9(0x16b)+(_0x3619e7 instanceof Error?_0x3619e7[_0x255bd9(0x16f)]:String(_0x3619e7))),process[_0x255bd9(0x165)](0x1);}else _0x248989={'mcpServers':{'lovrabet-dataset':_0x5be5e8}},logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x15d),{'path':_0x31297a,'appcode':_0x469726,'env':_0x148978}),console['log'](_0x255bd9(0x163));writeFileSync(_0x31297a,JSON[_0x255bd9(0x167)](_0x248989,null,0x2),{'encoding':_0x255bd9(0x15c)});const _0x276d81=resolve(_0x1c1f91,'rules'),_0x2896ce=resolve(_0x276d81,_0x255bd9(0x152));if(!existsSync(_0x2896ce))try{!existsSync(_0x276d81)&&(mkdirSync(_0x276d81,{'recursive':!![]}),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x147),{'path':_0x276d81}));const _0x287955=fileURLToPath(import.meta.url),_0x5e5207=dirname(_0x287955),_0x16c6a2=resolve(_0x5e5207,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x16c6a2)?(copyFileSync(_0x16c6a2,_0x2896ce),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x157),{'from':_0x16c6a2,'to':_0x2896ce}),console[_0x255bd9(0x162)]('✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc')):logger[_0x255bd9(0x154)](_0x255bd9(0x161),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x16c6a2});}catch(_0xe0a568){logger['error'](_0x255bd9(0x161),_0x255bd9(0x14d),{'error':_0xe0a568 instanceof Error?_0xe0a568[_0x255bd9(0x16f)]:String(_0xe0a568)}),console[_0x255bd9(0x154)](_0x255bd9(0x14f)+(_0xe0a568 instanceof Error?_0xe0a568['message']:String(_0xe0a568)));}else console['log'](_0x255bd9(0x151)),logger['info'](_0x255bd9(0x161),_0x255bd9(0x166),{'path':_0x2896ce});console[_0x255bd9(0x162)](_0x255bd9(0x159)),console[_0x255bd9(0x162)](_0x255bd9(0x155)),console[_0x255bd9(0x162)](_0x255bd9(0x149)+_0x469726),console[_0x255bd9(0x162)](_0x255bd9(0x164)+_0x148978),console[_0x255bd9(0x162)]('\x20\x20-\x20配置文件:\x20'+_0x31297a),console['log'](_0x255bd9(0x16e)),console[_0x255bd9(0x162)](_0x255bd9(0x156)),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x15b),{'appcode':_0x469726,'env':_0x148978,'configPath':_0x31297a}),process['exit'](0x0);}catch(_0xd5c64f){logger[_0x255bd9(0x169)](_0x255bd9(0x161),_0x255bd9(0x16d),{'error':_0xd5c64f instanceof Error?_0xd5c64f[_0x255bd9(0x16f)]:String(_0xd5c64f)}),console[_0x255bd9(0x169)]('错误:\x20配置失败:\x20'+(_0xd5c64f instanceof Error?_0xd5c64f[_0x255bd9(0x16f)]:String(_0xd5c64f))),process[_0x255bd9(0x165)](0x1);}}
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);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5f0395,_0x2fb262){var _0x2173ee=a52_0x2a73,_0x202374=_0x5f0395();while(!![]){try{var _0x133ffc=-parseInt(_0x2173ee(0x6e))/0x1*(-parseInt(_0x2173ee(0x71))/0x2)+parseInt(_0x2173ee(0x7a))/0x3+parseInt(_0x2173ee(0x72))/0x4+-parseInt(_0x2173ee(0x78))/0x5*(-parseInt(_0x2173ee(0x6f))/0x6)+-parseInt(_0x2173ee(0x77))/0x7+-parseInt(_0x2173ee(0x81))/0x8*(-parseInt(_0x2173ee(0x70))/0x9)+parseInt(_0x2173ee(0x74))/0xa*(-parseInt(_0x2173ee(0x7e))/0xb);if(_0x133ffc===_0x2fb262)break;else _0x202374['push'](_0x202374['shift']());}catch(_0x353d13){_0x202374['push'](_0x202374['shift']());}}}(a52_0x2858,0xbfe6f));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';function a52_0x2a73(_0x4ce2ac,_0x37a174){_0x4ce2ac=_0x4ce2ac-0x6d;var _0x285806=a52_0x2858();var _0x2a73d3=_0x285806[_0x4ce2ac];return _0x2a73d3;}export async function mcpCommand(_0x418af2){var _0x2de01c=a52_0x2a73;logger['setLogPath'](process[_0x2de01c(0x7c)]());if(!_0x418af2){console[_0x2de01c(0x6d)]('错误:\x20请指定\x20IDE\x20类型'),console[_0x2de01c(0x7b)]('\x0a使用方法:'),console[_0x2de01c(0x7b)]('\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP'),console[_0x2de01c(0x7b)](_0x2de01c(0x79)),console['log']('\x20\x20lovrabet\x20mcp\x20cursor'),logger[_0x2de01c(0x6d)](_0x2de01c(0x7f),_0x2de01c(0x82)),process['exit'](0x1);return;}switch(_0x418af2[_0x2de01c(0x83)]()){case _0x2de01c(0x75):logger[_0x2de01c(0x76)](_0x2de01c(0x7f),'执行配置\x20Cursor\x20MCP\x20命令'),await configureCursorMcp();break;default:console['error']('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x418af2),console[_0x2de01c(0x7b)](_0x2de01c(0x80)),console[_0x2de01c(0x7b)]('\x20\x20-\x20cursor'),logger[_0x2de01c(0x6d)](_0x2de01c(0x7f),_0x2de01c(0x7d)+_0x418af2),process[_0x2de01c(0x73)](0x1);break;}}function a52_0x2858(){var _0x5750a4=['2003uKKTiX','2239788wzfpCF','12113604xtJOhH','398dSRxil','4625984MmUbQl','exit','1560xfbGqJ','cursor','info','8120651rsyHhd','15LxAEdK','\x0a示例:','3693399NzojBI','log','cwd','不支持的\x20IDE\x20类型:\x20','233112wKjVaY','mcp','\x0a当前支持的\x20IDE:','8ilyMMp','未指定\x20IDE\x20类型','toLowerCase','error'];a52_0x2858=function(){return _0x5750a4;};return a52_0x2858();}
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 +1 @@
1
- const a54_0x39d9e7=a54_0x7248;function a54_0x7248(_0x31c9ae,_0x4741c7){_0x31c9ae=_0x31c9ae-0x8c;const _0x22146b=a54_0x2214();let _0x7248df=_0x22146b[_0x31c9ae];return _0x7248df;}(function(_0x426a7a,_0x3498c3){const _0x5345c1=a54_0x7248,_0xfe4abf=_0x426a7a();while(!![]){try{const _0xb43e92=parseInt(_0x5345c1(0x9b))/0x1*(parseInt(_0x5345c1(0xa6))/0x2)+-parseInt(_0x5345c1(0xa5))/0x3*(parseInt(_0x5345c1(0x9e))/0x4)+-parseInt(_0x5345c1(0x93))/0x5*(-parseInt(_0x5345c1(0xa9))/0x6)+parseInt(_0x5345c1(0xa7))/0x7+parseInt(_0x5345c1(0x91))/0x8+-parseInt(_0x5345c1(0x8f))/0x9*(-parseInt(_0x5345c1(0x94))/0xa)+-parseInt(_0x5345c1(0x9d))/0xb;if(_0xb43e92===_0x3498c3)break;else _0xfe4abf['push'](_0xfe4abf['shift']());}catch(_0x414f98){_0xfe4abf['push'](_0xfe4abf['shift']());}}}(a54_0x2214,0xd83bf));import a54_0x1fe313 from'node:fs';import a54_0x182787 from'node:path';function a54_0x2214(){const _0x22da34=['2158452OOMQCz','coerce','6808896Zdvqbc','join','41555TkdjDN','10mAdNeg','@lovrabet/sdk','\x1b[1m','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','\x1b[33m','\x1b[0m','readFileSync','132287StYLui','\x20或更高版本:','12731686QJdNkI','30252OSMEMh','\x20不支持新协议。','parse','log','\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest','⚠️\x20\x20SDK\x20版本不兼容','utf8','207qUpsKt','2LPboeJ','6599691uTfdIm','minVersion','288yVpjpU','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','1.2.0','package.json','version'];a54_0x2214=function(){return _0x22da34;};return a54_0x2214();}import a54_0x4932b4 from'semver';const MIN_SDK_VERSION=a54_0x39d9e7(0x8c);export function checkSdkVersion(_0x25f189){const _0x5194c4=a54_0x39d9e7,_0x290967=a54_0x182787[_0x5194c4(0x92)](_0x25f189,_0x5194c4(0x8d));if(!a54_0x1fe313['existsSync'](_0x290967))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x3bc01c=JSON[_0x5194c4(0xa0)](a54_0x1fe313[_0x5194c4(0x9a)](_0x290967,_0x5194c4(0xa4))),_0x2aadaa=_0x3bc01c['dependencies']||{},_0x200849=_0x3bc01c['devDependencies']||{},_0x101532=_0x2aadaa['@lovrabet/sdk']||_0x200849[_0x5194c4(0x95)];if(!_0x101532)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x3645ae=a54_0x4932b4[_0x5194c4(0x90)](_0x101532),_0x269ef1=_0x3645ae?a54_0x4932b4['lt'](_0x3645ae,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x101532,'needsUpgrade':_0x269ef1,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x1b3410){const _0x3d46e6=a54_0x39d9e7;if(!_0x1b3410['needsUpgrade'])return;const _0x44f064=_0x3d46e6(0x98),_0x180a28=_0x3d46e6(0x99),_0x109e09=_0x3d46e6(0x96);console[_0x3d46e6(0xa1)](),console[_0x3d46e6(0xa1)](''+_0x44f064+_0x109e09+_0x3d46e6(0xa3)+_0x180a28),console[_0x3d46e6(0xa1)](_0x44f064+_0x3d46e6(0x97)+_0x1b3410[_0x3d46e6(0x8e)]+_0x3d46e6(0x9f)+_0x180a28),console[_0x3d46e6(0xa1)](_0x44f064+'\x20\x20\x20请升级\x20SDK\x20至\x20'+_0x1b3410[_0x3d46e6(0xa8)]+_0x3d46e6(0x9c)+_0x180a28),console[_0x3d46e6(0xa1)](_0x44f064+_0x3d46e6(0xa2)+_0x180a28),console[_0x3d46e6(0xa1)](_0x44f064+_0x3d46e6(0xaa)+_0x180a28),console[_0x3d46e6(0xa1)]();}
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 +1 @@
1
- const a55_0x2b3111=a55_0x68aa;(function(_0x3a1fc1,_0x365917){const _0x54f898=a55_0x68aa,_0x82369f=_0x3a1fc1();while(!![]){try{const _0x222136=parseInt(_0x54f898(0x18b))/0x1*(parseInt(_0x54f898(0x183))/0x2)+parseInt(_0x54f898(0x188))/0x3*(parseInt(_0x54f898(0x187))/0x4)+parseInt(_0x54f898(0x184))/0x5+-parseInt(_0x54f898(0x17f))/0x6*(-parseInt(_0x54f898(0x185))/0x7)+-parseInt(_0x54f898(0x181))/0x8+parseInt(_0x54f898(0x17e))/0x9*(parseInt(_0x54f898(0x17b))/0xa)+-parseInt(_0x54f898(0x180))/0xb;if(_0x222136===_0x365917)break;else _0x82369f['push'](_0x82369f['shift']());}catch(_0xfa3075){_0x82369f['push'](_0x82369f['shift']());}}}(a55_0x2bb6,0x648e5));import{existsSync,readFileSync}from'node:fs';function a55_0x68aa(_0x5efb66,_0x1de5d3){_0x5efb66=_0x5efb66-0x17b;const _0x2bb6f3=a55_0x2bb6();let _0x68aa0f=_0x2bb6f3[_0x5efb66];return _0x68aa0f;}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a55_0x2b3111(0x182));export const globalConfigPath=resolve(homedir(),a55_0x2b3111(0x182));export function readConfig(){const _0x42cd20=a55_0x2b3111;let _0x95b6f5={};try{if(existsSync(globalConfigPath)){const _0x3238f0=readFileSync(globalConfigPath,{'encoding':_0x42cd20(0x18a)});_0x3238f0&&(_0x95b6f5=JSON[_0x42cd20(0x17d)](_0x3238f0));}}catch(_0x18c779){}try{if(existsSync(projectConfigPath)){const _0x1038d0=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x1038d0){const _0x2ad0dd=JSON[_0x42cd20(0x17d)](_0x1038d0);_0x95b6f5={..._0x95b6f5,..._0x2ad0dd};}}}catch(_0x3ed847){}return _0x95b6f5;}export function getConfigAppCode(){const _0x3400bf=a55_0x2b3111;let _0x36e05d={},_0x3b1401={};try{if(existsSync(globalConfigPath)){const _0x32deb3=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x32deb3&&(_0x3b1401=JSON[_0x3400bf(0x17d)](_0x32deb3));}}catch(_0x2c85c0){}try{if(existsSync(projectConfigPath)){const _0x4dffdb=readFileSync(projectConfigPath,{'encoding':_0x3400bf(0x18a)});_0x4dffdb&&(_0x36e05d=JSON[_0x3400bf(0x17d)](_0x4dffdb));}}catch(_0x5b39ca){}let _0x5090bf;if('appcode'in _0x36e05d)_0x5090bf=_0x36e05d[_0x3400bf(0x18c)];else{if(_0x3400bf(0x17c)in _0x36e05d)_0x5090bf=_0x36e05d['app'];else{if(_0x3400bf(0x18c)in _0x3b1401)_0x5090bf=_0x3b1401['appcode'];else'app'in _0x3b1401&&(_0x5090bf=_0x3b1401[_0x3400bf(0x17c)]);}}if(typeof _0x5090bf!==_0x3400bf(0x189)||_0x5090bf[_0x3400bf(0x186)]()==='')return undefined;return _0x5090bf;}export function isInProject(){return existsSync(projectConfigPath);}function a55_0x2bb6(){const _0x5e4370=['app','parse','1579077OFYxYj','17250hNXdST','18653426ZXCRzl','5303664erbOLL','.lovrabetrc','65700joEHJr','2455625UfiFWg','1358twxiVn','trim','3162892EvSNmp','3yJqgPR','string','utf8','23KfrQNQ','appcode','10hCjZZp'];a55_0x2bb6=function(){return _0x5e4370;};return a55_0x2bb6();}
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 +1 @@
1
- function a56_0x36b9(){const _0x4b29a7=['365490TKVqWe','4735440OLEVTg','215931qfpveW','511280vVvzUR','23720upuPCo','40TqNJmO','join','copyFileSync','isDirectory','name','1122dETXPL','4852iwpmZn','readdirSync','error','4612338WoGbho','1183pLbIJA'];a56_0x36b9=function(){return _0x4b29a7;};return a56_0x36b9();}(function(_0x537358,_0x1b7110){const _0x4b4be1=a56_0x1f34,_0x16235f=_0x537358();while(!![]){try{const _0x16a8ca=parseInt(_0x4b4be1(0x84))/0x1+parseInt(_0x4b4be1(0x7d))/0x2*(parseInt(_0x4b4be1(0x7c))/0x3)+-parseInt(_0x4b4be1(0x87))/0x4*(parseInt(_0x4b4be1(0x85))/0x5)+parseInt(_0x4b4be1(0x82))/0x6+-parseInt(_0x4b4be1(0x81))/0x7*(-parseInt(_0x4b4be1(0x86))/0x8)+parseInt(_0x4b4be1(0x80))/0x9+-parseInt(_0x4b4be1(0x83))/0xa;if(_0x16a8ca===_0x1b7110)break;else _0x16235f['push'](_0x16235f['shift']());}catch(_0x5e6beb){_0x16235f['push'](_0x16235f['shift']());}}}(a56_0x36b9,0xab4c1));function a56_0x1f34(_0x35e738,_0x2a4e73){_0x35e738=_0x35e738-0x7c;const _0x36b9c8=a56_0x36b9();let _0x1f3450=_0x36b9c8[_0x35e738];return _0x1f3450;}import a56_0xcbb85a from'node:path';import a56_0x739597 from'node:fs';export async function copyDirectory(_0x503fbc,_0x22494c){const _0x4770d4=a56_0x1f34;try{const _0x45ce86=a56_0x739597[_0x4770d4(0x7e)](_0x503fbc,{'withFileTypes':!![]});a56_0x739597['mkdirSync'](_0x22494c,{'recursive':!![]});for(const _0x45187c of _0x45ce86){const _0x41d686=a56_0xcbb85a[_0x4770d4(0x88)](_0x503fbc,_0x45187c[_0x4770d4(0x8b)]),_0x2d8984=a56_0xcbb85a['join'](_0x22494c,_0x45187c[_0x4770d4(0x8b)]);_0x45187c[_0x4770d4(0x8a)]()?await copyDirectory(_0x41d686,_0x2d8984):a56_0x739597[_0x4770d4(0x89)](_0x41d686,_0x2d8984);}}catch(_0x17c2d7){console[_0x4770d4(0x7f)]('复制目录时出错:',_0x17c2d7);}}
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 +1 @@
1
- (function(_0xb529ac,_0x7dbdd5){const _0x4ee4b2=a57_0x3e20,_0x28c3f4=_0xb529ac();while(!![]){try{const _0x42074b=parseInt(_0x4ee4b2(0xa6))/0x1+-parseInt(_0x4ee4b2(0xab))/0x2+parseInt(_0x4ee4b2(0xa0))/0x3*(parseInt(_0x4ee4b2(0x9c))/0x4)+parseInt(_0x4ee4b2(0x9a))/0x5+-parseInt(_0x4ee4b2(0x96))/0x6*(parseInt(_0x4ee4b2(0xa4))/0x7)+-parseInt(_0x4ee4b2(0xaa))/0x8+parseInt(_0x4ee4b2(0x9d))/0x9;if(_0x42074b===_0x7dbdd5)break;else _0x28c3f4['push'](_0x28c3f4['shift']());}catch(_0x23d5d9){_0x28c3f4['push'](_0x28c3f4['shift']());}}}(a57_0x13b3,0x50a15));export async function httpRequest(_0xb7bfc5,_0x244120={}){const _0x4246c4=a57_0x3e20,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x244120;let _0x5a31e4=null;for(let _0x26be9c=0x0;_0x26be9c<=retries;_0x26be9c++){try{const _0x2e8a86=new AbortController(),_0x59b7df=setTimeout(()=>_0x2e8a86[_0x4246c4(0xad)](),timeout),_0x4dad5b=await fetch(_0xb7bfc5,{'headers':headers,'signal':_0x2e8a86[_0x4246c4(0xa2)]});clearTimeout(_0x59b7df);let _0x5998f1;const _0x305a3d=_0x4dad5b[_0x4246c4(0xac)][_0x4246c4(0x98)]('content-type');return _0x305a3d?.[_0x4246c4(0xa9)](_0x4246c4(0x9b))?_0x5998f1=await _0x4dad5b[_0x4246c4(0xae)]():_0x5998f1=await _0x4dad5b[_0x4246c4(0x97)](),{'ok':_0x4dad5b['ok'],'status':_0x4dad5b[_0x4246c4(0x94)],'statusText':_0x4dad5b['statusText'],'data':_0x5998f1,'headers':_0x4dad5b['headers'],'url':_0x4dad5b['url'],'text':()=>_0x4dad5b[_0x4246c4(0x97)]()};}catch(_0x3a51a5){_0x5a31e4=_0x3a51a5 instanceof Error?_0x3a51a5:new Error(String(_0x3a51a5));if(_0x26be9c===retries)break;if(shouldRetry(_0x3a51a5)){console[_0x4246c4(0xa7)](_0x4246c4(0x9e)+retryDelay+_0x4246c4(0xa8)+(_0x26be9c+0x1)+_0x4246c4(0x9f)),await sleep(retryDelay);continue;}else break;}}throw _0x5a31e4||new Error('Request\x20failed');}function shouldRetry(_0x361c61){const _0x2f64bd=a57_0x3e20;if(_0x361c61 instanceof Error){if(_0x361c61[_0x2f64bd(0xa5)]==='AbortError')return![];if(_0x361c61[_0x2f64bd(0xa5)]===_0x2f64bd(0xa3)&&_0x361c61[_0x2f64bd(0x99)][_0x2f64bd(0xa9)](_0x2f64bd(0xa1)))return!![];if(_0x361c61[_0x2f64bd(0x99)][_0x2f64bd(0xa9)](_0x2f64bd(0x95)))return!![];if(_0x361c61[_0x2f64bd(0x99)][_0x2f64bd(0xa9)]('ENOTFOUND'))return![];}return![];}function a57_0x3e20(_0x48e6b2,_0xebb905){_0x48e6b2=_0x48e6b2-0x94;const _0x13b373=a57_0x13b3();let _0x3e2097=_0x13b373[_0x48e6b2];return _0x3e2097;}function sleep(_0x44a0f3){return new Promise(_0x2b6f09=>setTimeout(_0x2b6f09,_0x44a0f3));}export function validateUrl(_0x421110){try{return new URL(_0x421110),!![];}catch{return![];}}function a57_0x13b3(){const _0x5483a4=['status','ECONNRESET','1267902WQFCnK','text','get','message','393945eLjxUV','application/json','596MqXSmH','2529477hGtEJG','*\x20请求失败,','\x20次重试...','5697axKytu','fetch','signal','TypeError','21HhjhSr','name','529322WhJURF','log','ms\x20后进行第\x20','includes','581200dwaVTq','270506PxZmfk','headers','abort','json'];a57_0x13b3=function(){return _0x5483a4;};return a57_0x13b3();}
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 +1 @@
1
- function a58_0x3a32(){const _0x5cd369=['currentRawCommand','createLogger','split','now','rawCommand','filter','green','mkdirSync','.lovrabet.log','existsSync','details','error','winstonLogger','errors','7Nouczp','combine','level','red','2FtoRmU','539899kEidkk','6409341xPVWCQ','3000380CVfQTs','Failed\x20to\x20clear\x20logs:','parse','readLogs','2169670JrLfgc','blue','unknown','trim','logTask','14468700YFUhHa','timestamp','transports','readFileSync','utf8','2026230QJLxkR','logFilePath','printf','map','command','yellow','失败:\x20','success','toISOString','message','开始执行:\x20','warn','log','addColors','duration','6hafSmU','join','format','getWinstonInstance','initWinstonLogger','753952fJUszW','clear','info'];a58_0x3a32=function(){return _0x5cd369;};return a58_0x3a32();}const a58_0x5f3a53=a58_0x2699;(function(_0x1c27af,_0x1b84f0){const _0x32779c=a58_0x2699,_0x118e04=_0x1c27af();while(!![]){try{const _0x5a1ef8=-parseInt(_0x32779c(0x10c))/0x1*(-parseInt(_0x32779c(0x10b))/0x2)+-parseInt(_0x32779c(0x11c))/0x3+parseInt(_0x32779c(0x10e))/0x4+-parseInt(_0x32779c(0x112))/0x5*(-parseInt(_0x32779c(0x12b))/0x6)+-parseInt(_0x32779c(0x107))/0x7*(-parseInt(_0x32779c(0x130))/0x8)+parseInt(_0x32779c(0x10d))/0x9+-parseInt(_0x32779c(0x117))/0xa;if(_0x5a1ef8===_0x1b84f0)break;else _0x118e04['push'](_0x118e04['shift']());}catch(_0x124ee9){_0x118e04['push'](_0x118e04['shift']());}}}(a58_0x3a32,0x639e9));import a58_0x180002 from'winston';import a58_0x3ef3d1 from'node:fs';import a58_0x3a5c2d from'node:path';class Logger{[a58_0x5f3a53(0x105)];[a58_0x5f3a53(0x11d)];[a58_0x5f3a53(0x133)]='';constructor(){const _0x2ccb72=a58_0x5f3a53;this[_0x2ccb72(0x11d)]='';}['setRawCommand'](_0x1baa3a){this['currentRawCommand']=_0x1baa3a;}[a58_0x5f3a53(0x12f)](){const _0x1e8d3f=a58_0x5f3a53,_0x1a5a05=a58_0x3a5c2d['dirname'](this[_0x1e8d3f(0x11d)]);!a58_0x3ef3d1['existsSync'](_0x1a5a05)&&a58_0x3ef3d1[_0x1e8d3f(0x100)](_0x1a5a05,{'recursive':!![]});const _0x64f09f=a58_0x180002[_0x1e8d3f(0x12d)][_0x1e8d3f(0x108)](a58_0x180002[_0x1e8d3f(0x12d)][_0x1e8d3f(0x118)](),a58_0x180002['format'][_0x1e8d3f(0x106)]({'stack':!![]}),a58_0x180002['format'][_0x1e8d3f(0x11e)](_0x4080fa=>{const _0x3cc28e=_0x1e8d3f,_0x27dd66={'timestamp':_0x4080fa['timestamp']||new Date()[_0x3cc28e(0x124)](),'level':_0x4080fa[_0x3cc28e(0x109)]||'info','command':_0x4080fa[_0x3cc28e(0x120)]||_0x3cc28e(0x114),'rawCommand':_0x4080fa[_0x3cc28e(0xfd)]||this['currentRawCommand']||undefined,'message':_0x4080fa[_0x3cc28e(0x125)]||'','duration':_0x4080fa[_0x3cc28e(0x12a)]||undefined,'details':_0x4080fa[_0x3cc28e(0x103)]||undefined};return JSON['stringify'](_0x27dd66);}));this['winstonLogger']=a58_0x180002[_0x1e8d3f(0x134)]({'level':'info','format':_0x64f09f,'transports':[new a58_0x180002[(_0x1e8d3f(0x119))]['File']({'filename':this[_0x1e8d3f(0x11d)],'level':'info'})],'silent':![]}),a58_0x180002[_0x1e8d3f(0x129)]({'success':_0x1e8d3f(0xff),'error':_0x1e8d3f(0x10a),'warn':_0x1e8d3f(0x121),'info':_0x1e8d3f(0x113)});}['setLogPath'](_0x3f89b2){const _0x40e42e=a58_0x5f3a53;this[_0x40e42e(0x11d)]=a58_0x3a5c2d[_0x40e42e(0x12c)](_0x3f89b2,_0x40e42e(0x101)),this[_0x40e42e(0x105)]&&this[_0x40e42e(0x105)][_0x40e42e(0x131)](),this['initWinstonLogger']();}[a58_0x5f3a53(0x132)](_0x345d59,_0x6139b3,_0x50cb75){const _0x50b295=a58_0x5f3a53;if(!this[_0x50b295(0x11d)]||!this[_0x50b295(0x105)])return;this[_0x50b295(0x105)]['info'](_0x6139b3,{'command':_0x345d59,'details':_0x50cb75});}[a58_0x5f3a53(0x123)](_0x14e786,_0x3c063e,_0xd90664,_0x611fa0){const _0x595e68=a58_0x5f3a53;if(!this[_0x595e68(0x11d)]||!this[_0x595e68(0x105)])return;this[_0x595e68(0x105)][_0x595e68(0x128)](_0x595e68(0x132),_0x3c063e,{'level':_0x595e68(0x123),'command':_0x14e786,'duration':_0xd90664,'details':_0x611fa0});}['error'](_0x490530,_0x28858d,_0xb055){const _0x6a62cb=a58_0x5f3a53;if(!this[_0x6a62cb(0x11d)]||!this[_0x6a62cb(0x105)])return;this[_0x6a62cb(0x105)][_0x6a62cb(0x104)](_0x28858d,{'command':_0x490530,'details':_0xb055});}[a58_0x5f3a53(0x127)](_0x5b6459,_0x40b27f,_0x5df843){const _0x8e46cc=a58_0x5f3a53;if(!this[_0x8e46cc(0x11d)]||!this[_0x8e46cc(0x105)])return;this[_0x8e46cc(0x105)]['warn'](_0x40b27f,{'command':_0x5b6459,'details':_0x5df843});}async[a58_0x5f3a53(0x116)](_0x1176d9,_0x4aa8b0,_0x46dd50){const _0x4a59a3=a58_0x5f3a53,_0x1e13dd=Date[_0x4a59a3(0xfc)]();this[_0x4a59a3(0x132)](_0x1176d9,_0x4a59a3(0x126)+_0x4aa8b0);try{const _0x14e6e7=await _0x46dd50(),_0x34e1f8=Date['now']()-_0x1e13dd;return this[_0x4a59a3(0x123)](_0x1176d9,'完成:\x20'+_0x4aa8b0,_0x34e1f8),_0x14e6e7;}catch(_0x19aaf4){const _0x33be44=Date[_0x4a59a3(0xfc)]()-_0x1e13dd;this[_0x4a59a3(0x104)](_0x1176d9,_0x4a59a3(0x122)+_0x4aa8b0,{'error':_0x19aaf4 instanceof Error?_0x19aaf4[_0x4a59a3(0x125)]:String(_0x19aaf4),'duration':_0x33be44});throw _0x19aaf4;}}[a58_0x5f3a53(0x111)](){const _0x3946b3=a58_0x5f3a53;try{if(!a58_0x3ef3d1[_0x3946b3(0x102)](this[_0x3946b3(0x11d)]))return[];const _0x2ed9ae=a58_0x3ef3d1[_0x3946b3(0x11a)](this[_0x3946b3(0x11d)],_0x3946b3(0x11b));return _0x2ed9ae[_0x3946b3(0x135)]('\x0a')[_0x3946b3(0xfe)](_0x9f2df3=>_0x9f2df3[_0x3946b3(0x115)]())[_0x3946b3(0x11f)](_0x1369e6=>JSON[_0x3946b3(0x110)](_0x1369e6));}catch(_0x4fa0e5){return console['warn']('Failed\x20to\x20read\x20logs:',_0x4fa0e5),[];}}['clearLogs'](){const _0x15ce35=a58_0x5f3a53;try{a58_0x3ef3d1['existsSync'](this[_0x15ce35(0x11d)])&&a58_0x3ef3d1['writeFileSync'](this[_0x15ce35(0x11d)],'',_0x15ce35(0x11b));}catch(_0x47e3f6){console[_0x15ce35(0x127)](_0x15ce35(0x10f),_0x47e3f6);}}[a58_0x5f3a53(0x12e)](){const _0x14c53e=a58_0x5f3a53;return this[_0x14c53e(0x105)];}}function a58_0x2699(_0x4a0ec5,_0x113198){_0x4a0ec5=_0x4a0ec5-0xfc;const _0x3a32a6=a58_0x3a32();let _0x269914=_0x3a32a6[_0x4a0ec5];return _0x269914;}export const logger=new Logger();
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 +1 @@
1
- function a59_0x1fc0(){const _0xfcc70a=['path:\x20\x22','187422bZfDEF','promises','utf8','includes','1972491qEzWzN','join','1488236gBBadh','开始更新路由配置','addImport','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','message','src','router','未找到路由配置的\x20children\x20数组','20nidUxG','info','32704OqQTDI','9mqZMuc','addRoute','index','toComponentName','indexOf','\x20from\x20\x22../pages/','charAt','347287Omqklf','2WKlhnU','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','4044210eoGGvN','735evJfMV','2897807qAddhL','routerFilePath','now','路由配置更新失败','success','lastIndexOf','import\x20','index.tsx','map','readFile','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','length','路由配置更新完成','previewChanges','match','路由文件不存在:\x20','addPageRoute','split','slice'];a59_0x1fc0=function(){return _0xfcc70a;};return a59_0x1fc0();}function a59_0x3caf(_0x1616ec,_0x1c692a){_0x1616ec=_0x1616ec-0xff;const _0x1fc0f1=a59_0x1fc0();let _0x3caf16=_0x1fc0f1[_0x1616ec];return _0x3caf16;}const a59_0x348a1c=a59_0x3caf;(function(_0x9412ea,_0x3d9739){const _0xab1243=a59_0x3caf,_0x30b763=_0x9412ea();while(!![]){try{const _0x1160f9=-parseInt(_0xab1243(0x110))/0x1+parseInt(_0xab1243(0x111))/0x2*(-parseInt(_0xab1243(0x12d))/0x3)+parseInt(_0xab1243(0x12f))/0x4+parseInt(_0xab1243(0x106))/0x5*(-parseInt(_0xab1243(0x129))/0x6)+-parseInt(_0xab1243(0x114))/0x7*(-parseInt(_0xab1243(0x108))/0x8)+parseInt(_0xab1243(0x109))/0x9*(parseInt(_0xab1243(0x113))/0xa)+parseInt(_0xab1243(0x115))/0xb;if(_0x1160f9===_0x3d9739)break;else _0x30b763['push'](_0x30b763['shift']());}catch(_0x54638c){_0x30b763['push'](_0x30b763['shift']());}}}(a59_0x1fc0,0x52de1));import a59_0x619160 from'node:fs';import a59_0x3cbd46 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x348a1c(0x116)];constructor(_0x4ef82e){const _0x4f0881=a59_0x348a1c;this[_0x4f0881(0x116)]=a59_0x3cbd46[_0x4f0881(0x12e)](_0x4ef82e,_0x4f0881(0x103),'router',_0x4f0881(0x11c));}async[a59_0x348a1c(0x125)](_0x315f5f,_0x32c660){const _0x53a1b0=a59_0x348a1c;if(!a59_0x619160['existsSync'](this['routerFilePath']))throw new Error(_0x53a1b0(0x124)+this['routerFilePath']);const _0x5653b6=Date['now']();logger[_0x53a1b0(0x107)](_0x53a1b0(0x104),_0x53a1b0(0xff),{'pageName':_0x315f5f,'routePath':_0x32c660,'file':this[_0x53a1b0(0x116)]});try{const _0x35747f=await a59_0x619160[_0x53a1b0(0x12a)]['readFile'](this[_0x53a1b0(0x116)],_0x53a1b0(0x12b)),_0xae0449=this[_0x53a1b0(0x10c)](_0x315f5f),_0x1368cf=this['addImport'](_0x35747f,_0xae0449,_0x315f5f),_0x89dd5b=this[_0x53a1b0(0x10a)](_0x1368cf,_0x32c660,_0xae0449);await a59_0x619160['promises']['writeFile'](this[_0x53a1b0(0x116)],_0x89dd5b,_0x53a1b0(0x12b));const _0x422817=Date[_0x53a1b0(0x117)]()-_0x5653b6;logger[_0x53a1b0(0x119)](_0x53a1b0(0x104),_0x53a1b0(0x121),_0x422817,{'pageName':_0x315f5f,'routePath':_0x32c660,'componentName':_0xae0449});}catch(_0x4b22b5){const _0x39c682=Date['now']()-_0x5653b6;logger['error']('router',_0x53a1b0(0x118),{'pageName':_0x315f5f,'routePath':_0x32c660,'error':_0x4b22b5 instanceof Error?_0x4b22b5[_0x53a1b0(0x102)]:String(_0x4b22b5),'duration':_0x39c682});throw _0x4b22b5;}}[a59_0x348a1c(0x10c)](_0x3b3c8b){const _0x4a6483=a59_0x348a1c;return _0x3b3c8b[_0x4a6483(0x126)]('-')[_0x4a6483(0x11d)](_0x24c474=>_0x24c474[_0x4a6483(0x10f)](0x0)['toUpperCase']()+_0x24c474['slice'](0x1)['toLowerCase']())[_0x4a6483(0x12e)]('');}[a59_0x348a1c(0x100)](_0x191ad4,_0xbd8716,_0x43861b){const _0x418e5d=a59_0x348a1c,_0x3448e6=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x3af816=_0x191ad4[_0x418e5d(0x123)](_0x3448e6)||[],_0x730a93=_0x418e5d(0x11b)+_0xbd8716+_0x418e5d(0x10e)+_0x43861b+'\x22;';if(_0x191ad4[_0x418e5d(0x12c)](_0x730a93))return _0x191ad4;if(_0x3af816[_0x418e5d(0x120)]>0x0){const _0x5453bd=_0x3af816[_0x3af816[_0x418e5d(0x120)]-0x1];if(_0x5453bd){const _0x5c6b21=_0x191ad4[_0x418e5d(0x11a)](_0x5453bd),_0xf8004c=_0x5c6b21+_0x5453bd[_0x418e5d(0x120)];return _0x191ad4[_0x418e5d(0x127)](0x0,_0xf8004c)+_0x730a93+'\x0a'+_0x191ad4[_0x418e5d(0x127)](_0xf8004c);}}const _0x4c611c=_0x191ad4[_0x418e5d(0x123)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x4c611c&&_0x4c611c['index']!==undefined){const _0x153ff5=_0x4c611c[_0x418e5d(0x10b)]+_0x4c611c[0x0][_0x418e5d(0x120)];return _0x191ad4[_0x418e5d(0x127)](0x0,_0x153ff5)+_0x730a93+'\x0a'+_0x191ad4[_0x418e5d(0x127)](_0x153ff5);}return _0x191ad4;}[a59_0x348a1c(0x10a)](_0x50ccb3,_0x2decde,_0x262e73){const _0x527039=a59_0x348a1c,_0xd3ff07=_0x527039(0x101)+_0x2decde+_0x527039(0x112)+_0x262e73+_0x527039(0x11f);if(_0x50ccb3['includes'](_0x527039(0x128)+_0x2decde+'\x22'))return _0x50ccb3;const _0x208db2=/children:\s*\[([\s\S]*?)\]/,_0x433406=_0x50ccb3[_0x527039(0x123)](_0x208db2);if(!_0x433406||_0x433406[_0x527039(0x10b)]===undefined)throw new Error(_0x527039(0x105));const _0x3ffb1f=_0x433406[0x1],_0x38ada4=_0x433406[_0x527039(0x10b)]+_0x433406[0x0][_0x527039(0x10d)]('[')+0x1,_0x7422fa=_0x3ffb1f?.[_0x527039(0x123)](/\{[\s\S]*?\},/g)||[];if(_0x7422fa[_0x527039(0x120)]>0x0){const _0x7397d7=_0x7422fa[_0x7422fa[_0x527039(0x120)]-0x1];if(_0x7397d7){const _0x35ea59=_0x50ccb3[_0x527039(0x11a)](_0x7397d7),_0x1172bc=_0x35ea59+_0x7397d7[_0x527039(0x120)];return _0x50ccb3[_0x527039(0x127)](0x0,_0x1172bc)+'\x0a'+_0xd3ff07+_0x50ccb3['slice'](_0x1172bc);}}return _0x50ccb3[_0x527039(0x127)](0x0,_0x38ada4)+'\x0a'+_0xd3ff07+_0x50ccb3[_0x527039(0x127)](_0x38ada4);}async[a59_0x348a1c(0x122)](_0x47afdd,_0x214b34){const _0x14fea7=a59_0x348a1c;if(!a59_0x619160['existsSync'](this[_0x14fea7(0x116)]))throw new Error('路由文件不存在:\x20'+this['routerFilePath']);const _0x25e22d=await a59_0x619160['promises'][_0x14fea7(0x11e)](this[_0x14fea7(0x116)],_0x14fea7(0x12b)),_0x55fb1d=this[_0x14fea7(0x10c)](_0x47afdd);let _0x3f908d=this[_0x14fea7(0x100)](_0x25e22d,_0x55fb1d,_0x47afdd);return _0x3f908d=this[_0x14fea7(0x10a)](_0x3f908d,_0x214b34,_0x55fb1d),_0x3f908d;}}
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 +1 @@
1
- export function sleep(_0x58abdb){return new Promise(_0x2d5459=>setTimeout(_0x2d5459,_0x58abdb));}
1
+ export function sleep(_0x5833bf){return new Promise(_0x1da612=>setTimeout(_0x1da612,_0x5833bf));}
@@ -1 +1 @@
1
- const a61_0x25e3a7=a61_0x3af9;function a61_0x3af9(_0x2775cf,_0x14c408){_0x2775cf=_0x2775cf-0x1a8;const _0x1fdb36=a61_0x1fdb();let _0x3af912=_0x1fdb36[_0x2775cf];return _0x3af912;}(function(_0x498f44,_0x2d17a8){const _0x54b128=a61_0x3af9,_0xd2e899=_0x498f44();while(!![]){try{const _0x95c4f5=-parseInt(_0x54b128(0x1e2))/0x1*(parseInt(_0x54b128(0x1b2))/0x2)+parseInt(_0x54b128(0x1b6))/0x3+parseInt(_0x54b128(0x1d9))/0x4*(parseInt(_0x54b128(0x1dc))/0x5)+parseInt(_0x54b128(0x1b7))/0x6+parseInt(_0x54b128(0x1ad))/0x7+parseInt(_0x54b128(0x1e3))/0x8+-parseInt(_0x54b128(0x1b4))/0x9*(parseInt(_0x54b128(0x1df))/0xa);if(_0x95c4f5===_0x2d17a8)break;else _0xd2e899['push'](_0xd2e899['shift']());}catch(_0x549726){_0xd2e899['push'](_0xd2e899['shift']());}}}(a61_0x1fdb,0x61fe1));import a61_0x2fee1a from'node:fs';function a61_0x1fdb(){const _0xde54da=['toLocaleDateString','2dPXVwo','4547848oYnSmb','writeFile','includes','toUpperCase','slice','numeric','alias','push','\x20},','.tpl','datasetCode:\x20\x22','error','message','1929746lLHeek','.tsx','name','.md','mkdir','38566FyusHZ','2-digit','1764ZWGpcm','toComponentName','2083932WoAxBA','484620atHqbg','replace','promises','alias:\x20\x22','YourModel','utf8','success','\x0a\x20\x20\x20\x20{\x20','name:\x20\x22','pop','.scss','tableName:\x20\x22','processTemplate','.json','replaceContent','charAt','map','模板内容替换完成','toDisplayTitle','now','开始处理模板内容替换','info','toISOString','processFile','toLowerCase','processDirectory','.ts','endsWith','.jsx','.css','readFile','.js','split','template','24cEtnlS','tableName','datasetCode','140055VDYZOx','toLocaleString','replaceApiContent','68760DvufRW','join'];a61_0x1fdb=function(){return _0xde54da;};return a61_0x1fdb();}import a61_0x24a344 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static['toComponentName'](_0x1e14b3){const _0x2b9d32=a61_0x3af9,_0x3d4dcb=_0x1e14b3[_0x2b9d32(0x1d7)]('/')['pop']()||_0x1e14b3;return _0x3d4dcb[_0x2b9d32(0x1d7)]('-')[_0x2b9d32(0x1c7)](_0x20e8d5=>_0x20e8d5['charAt'](0x0)[_0x2b9d32(0x1e6)]()+_0x20e8d5[_0x2b9d32(0x1e7)](0x1)[_0x2b9d32(0x1cf)]())[_0x2b9d32(0x1e0)]('');}static[a61_0x25e3a7(0x1c9)](_0x2d4583){const _0x5a1b7c=a61_0x25e3a7,_0x3bfaa1=_0x2d4583[_0x5a1b7c(0x1d7)]('/')[_0x5a1b7c(0x1c0)]()||_0x2d4583;return _0x3bfaa1[_0x5a1b7c(0x1d7)]('-')['map'](_0x3ed427=>_0x3ed427[_0x5a1b7c(0x1c6)](0x0)[_0x5a1b7c(0x1e6)]()+_0x3ed427[_0x5a1b7c(0x1e7)](0x1)[_0x5a1b7c(0x1cf)]())[_0x5a1b7c(0x1e0)]('\x20');}static[a61_0x25e3a7(0x1c5)](_0x4bc5de,_0x1736e1,_0x232820){const _0x59207f=a61_0x25e3a7,_0x305f53=this[_0x59207f(0x1b5)](_0x1736e1),_0x494372=this[_0x59207f(0x1c9)](_0x1736e1),_0x119f2a=new Date(),_0x115dd2=_0x119f2a[_0x59207f(0x1dd)](undefined,{'year':_0x59207f(0x1e8),'month':'2-digit','day':_0x59207f(0x1b3),'hour':_0x59207f(0x1b3),'minute':_0x59207f(0x1b3),'second':'2-digit','hour12':![]})[_0x59207f(0x1b8)](/\//g,'-'),_0x206fa9=_0x119f2a[_0x59207f(0x1e1)](undefined,{'year':_0x59207f(0x1e8),'month':'2-digit','day':_0x59207f(0x1b3)})['replace'](/\//g,'-'),_0xe270b5=_0x119f2a['toLocaleTimeString'](undefined,{'hour12':![]});let _0x104761=_0x4bc5de[_0x59207f(0x1b8)](/\{ComponentName\}/g,_0x305f53)[_0x59207f(0x1b8)](/\{DisplayTitle\}/g,_0x494372)[_0x59207f(0x1b8)](/\{PageName\}/g,_0x1736e1)[_0x59207f(0x1b8)](/\{TemplateName\}/g,_0x232820)[_0x59207f(0x1b8)](/\{CreatedAt\}/g,_0x115dd2)[_0x59207f(0x1b8)](/\{CreatedDate\}/g,_0x206fa9)[_0x59207f(0x1b8)](/\{CreatedTime\}/g,_0xe270b5);return _0x104761;}static[a61_0x25e3a7(0x1de)](_0x5065bc,_0x5a113f,_0xafb80a,_0xa64009,_0x527c58,_0x245673,_0x28b0e2){const _0x23d98f=a61_0x25e3a7,_0x5c7416=new Date(),_0x44a28a=_0x5c7416[_0x23d98f(0x1cd)](),_0xde054d=_0xafb80a[_0x23d98f(0x1c7)](_0x3df37c=>{const _0x215c9f=_0x23d98f,_0x1c08ea=[_0x215c9f(0x1aa)+_0x3df37c[_0x215c9f(0x1db)]+'\x22',_0x215c9f(0x1c2)+_0x3df37c[_0x215c9f(0x1da)]+'\x22',_0x215c9f(0x1bf)+_0x3df37c[_0x215c9f(0x1af)]+'\x22'];return _0x3df37c['alias']&&_0x1c08ea[_0x215c9f(0x1ea)](_0x215c9f(0x1ba)+_0x3df37c[_0x215c9f(0x1e9)]+'\x22'),_0x215c9f(0x1be)+_0x1c08ea[_0x215c9f(0x1e0)](',\x20')+_0x215c9f(0x1a8);})[_0x23d98f(0x1e0)](''),_0x54d1d3=_0xa64009||_0xafb80a[0x0]?.[_0x23d98f(0x1e9)]||_0x23d98f(0x1bb);let _0x45fdbb=_0x5065bc[_0x23d98f(0x1b8)](/\{AppCode\}/g,_0x5a113f)[_0x23d98f(0x1b8)](/\{ModelConfigs\}/g,_0xde054d)[_0x23d98f(0x1b8)](/\{ExampleModelName\}/g,_0x54d1d3)['replace'](/\{ApiFileName\}/g,_0x527c58||'api')[_0x23d98f(0x1b8)](/\{ConfigName\}/g,_0x245673||'default')[_0x23d98f(0x1b8)](/\{ClientConfigParam\}/g,_0x28b0e2||'')[_0x23d98f(0x1b8)](/\{CreatedAt\}/g,_0x44a28a);return _0x45fdbb;}static async[a61_0x25e3a7(0x1c3)](_0xa43e3,_0x53743b,_0x3c4381,_0xf2042e,_0x5e7ed1=!![]){const _0xe2ff2d=a61_0x25e3a7,_0x2b603b=Date[_0xe2ff2d(0x1ca)]();try{_0x5e7ed1&&logger[_0xe2ff2d(0x1cc)](_0xe2ff2d(0x1d8),_0xe2ff2d(0x1cb),{'templatePath':_0xa43e3,'targetPath':_0x53743b,'pageName':_0x3c4381,'templateName':_0xf2042e});await a61_0x2fee1a[_0xe2ff2d(0x1b9)]['mkdir'](_0x53743b,{'recursive':!![]}),await this[_0xe2ff2d(0x1d0)](_0xa43e3,_0x53743b,_0x3c4381,_0xf2042e);if(_0x5e7ed1){const _0xede5a2=Date[_0xe2ff2d(0x1ca)]()-_0x2b603b;logger[_0xe2ff2d(0x1bd)](_0xe2ff2d(0x1d8),_0xe2ff2d(0x1c8),_0xede5a2,{'pageName':_0x3c4381,'templateName':_0xf2042e});}}catch(_0x451627){if(_0x5e7ed1){const _0x19c0cf=Date[_0xe2ff2d(0x1ca)]()-_0x2b603b;logger[_0xe2ff2d(0x1ab)](_0xe2ff2d(0x1d8),'模板内容替换失败',{'templatePath':_0xa43e3,'targetPath':_0x53743b,'pageName':_0x3c4381,'templateName':_0xf2042e,'error':_0x451627 instanceof Error?_0x451627[_0xe2ff2d(0x1ac)]:String(_0x451627),'duration':_0x19c0cf});}throw _0x451627;}}static async['processDirectory'](_0x1ae37b,_0x50649d,_0x35276b,_0x2e9b3f){const _0x3473c3=a61_0x25e3a7,_0x56c7c3=await a61_0x2fee1a['promises']['readdir'](_0x1ae37b,{'withFileTypes':!![]});for(const _0x1583af of _0x56c7c3){const _0x3a47cf=a61_0x24a344[_0x3473c3(0x1e0)](_0x1ae37b,_0x1583af['name']);let _0x525a8c=a61_0x24a344[_0x3473c3(0x1e0)](_0x50649d,_0x1583af[_0x3473c3(0x1af)]);_0x1583af[_0x3473c3(0x1af)][_0x3473c3(0x1d2)]('.tpl')&&(_0x525a8c=a61_0x24a344[_0x3473c3(0x1e0)](_0x50649d,_0x1583af[_0x3473c3(0x1af)][_0x3473c3(0x1b8)](/\.tpl$/,'')));if(_0x1583af['isDirectory']())await a61_0x2fee1a[_0x3473c3(0x1b9)][_0x3473c3(0x1b1)](_0x525a8c,{'recursive':!![]}),await this[_0x3473c3(0x1d0)](_0x3a47cf,_0x525a8c,_0x35276b,_0x2e9b3f);else _0x1583af['isFile']()&&await this[_0x3473c3(0x1ce)](_0x3a47cf,_0x525a8c,_0x35276b,_0x2e9b3f);}}static async['processFile'](_0x21efc3,_0x2cb40c,_0x5ac83d,_0x30b11f){const _0x2fc4=a61_0x25e3a7,_0x19fcde=a61_0x24a344['extname'](_0x21efc3)['toLowerCase']();_0x21efc3['endsWith']('.tpl')&&(_0x2cb40c=_0x2cb40c['replace'](/\.tpl$/,''));const _0x34807b=[_0x2fc4(0x1ae),_0x2fc4(0x1d1),_0x2fc4(0x1d3),_0x2fc4(0x1d6),_0x2fc4(0x1c4),_0x2fc4(0x1b0),_0x2fc4(0x1d4),_0x2fc4(0x1c1),_0x2fc4(0x1a9)];if(_0x34807b[_0x2fc4(0x1e5)](_0x19fcde)||_0x21efc3['endsWith']('.tpl')){const _0x4b82d0=await a61_0x2fee1a[_0x2fc4(0x1b9)][_0x2fc4(0x1d5)](_0x21efc3,_0x2fc4(0x1bc)),_0x2c41a6=this[_0x2fc4(0x1c5)](_0x4b82d0,_0x5ac83d,_0x30b11f);await a61_0x2fee1a[_0x2fc4(0x1b9)][_0x2fc4(0x1e4)](_0x2cb40c,_0x2c41a6,'utf8');}else await a61_0x2fee1a[_0x2fc4(0x1b9)]['copyFile'](_0x21efc3,_0x2cb40c);}}
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);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.2.1-beta.3",
3
+ "version": "1.2.1-beta.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"