@lovrabet/cli 1.2.3 → 1.2.5-beta.1

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 (89) 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/claude.js +1 -0
  52. package/lib/mcp/cursor.js +1 -1
  53. package/lib/mcp/main.js +1 -1
  54. package/lib/skills/main.js +1 -0
  55. package/lib/utils/check-sdk-version.js +1 -1
  56. package/lib/utils/config.js +1 -1
  57. package/lib/utils/copy-directory.js +1 -1
  58. package/lib/utils/http-client.js +1 -1
  59. package/lib/utils/logger.js +1 -1
  60. package/lib/utils/router-updater.js +1 -1
  61. package/lib/utils/sleep.js +1 -1
  62. package/lib/utils/template-replacer.js +1 -1
  63. package/package.json +1 -1
  64. package/templates/projects/sub-app-react-demo/index.html +22 -34
  65. package/templates/projects/sub-app-react-demo/public/logo.svg +1 -0
  66. package/templates/projects/sub-app-react-demo/src/api/api.ts +1 -1
  67. package/templates/projects/sub-app-react-demo/src/api/client.ts +1 -1
  68. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +44 -71
  69. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +387 -927
  70. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +1 -1
  71. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +293 -0
  72. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +100 -414
  73. package/templates/projects/sub-app-react-demo/src/style.css +21 -15
  74. package/templates/projects/sub-app-react-demo/vite.config.ts +18 -13
  75. package/templates/rules/lovrabet_rules.mdc.tpl +636 -43
  76. package/templates/skills/.claude/skills/lovrabet/SKILL.md +257 -0
  77. package/templates/skills/.cursor/commands/lovrabet.md +247 -0
  78. package/templates/skills/.cursorrules +109 -0
  79. package/templates/skills/.shared/README.md +45 -0
  80. package/templates/skills/.shared/guides/01-filter-query/guide.md +300 -0
  81. package/templates/skills/.shared/guides/02-mcp-sql-workflow/guide.md +272 -0
  82. package/templates/skills/.shared/guides/03-antd-style/guide.md +227 -0
  83. package/templates/skills/.shared/guides/04-troubleshooting/guide.md +426 -0
  84. package/templates/skills/.shared/guides/05-api-integration/guide.md +327 -0
  85. package/templates/skills/.shared/guides/06-menu-management/guide.md +305 -0
  86. package/templates/skills/.windsurf/workflows/lovrabet.md +256 -0
  87. package/templates/projects/sub-app-react-demo/.vscode/extensions.json +0 -3
  88. package/templates/projects/sub-app-react-demo/.vscode/settings.json +0 -57
  89. package/templates/projects/sub-app-react-demo/src/pages/intro/index.tsx +0 -560
@@ -1 +1 @@
1
- (function(_0x59ee40,_0x55b4c9){const _0x1f4cbe=a47_0x9aee,_0x2d8720=_0x59ee40();while(!![]){try{const _0x120317=-parseInt(_0x1f4cbe(0x1dc))/0x1+-parseInt(_0x1f4cbe(0x1e2))/0x2*(parseInt(_0x1f4cbe(0x1df))/0x3)+parseInt(_0x1f4cbe(0x1da))/0x4*(parseInt(_0x1f4cbe(0x1db))/0x5)+-parseInt(_0x1f4cbe(0x1d2))/0x6*(-parseInt(_0x1f4cbe(0x1d1))/0x7)+-parseInt(_0x1f4cbe(0x1d4))/0x8+parseInt(_0x1f4cbe(0x1dd))/0x9*(-parseInt(_0x1f4cbe(0x1d3))/0xa)+parseInt(_0x1f4cbe(0x1de))/0xb;if(_0x120317===_0x55b4c9)break;else _0x2d8720['push'](_0x2d8720['shift']());}catch(_0x315eb9){_0x2d8720['push'](_0x2d8720['shift']());}}}(a47_0x2d46,0x613e6));function a47_0x2d46(){const _0x2e50e0=['246nqdGzF','3152810dWpiMR','3468928aMdjar','--write','cwd','now','开始格式化代码','info','1800808vwGEfS','5akpEkC','691151VhfHMa','9mfgrjF','14893296XPGHKX','70383haHTIG','npx','error','58mFzGzS','format','prettier','resolve','代码格式化失败','代码格式化完成','122003UFUAjH'];a47_0x2d46=function(){return _0x2e50e0;};return a47_0x2d46();}import a47_0x4e3826 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a47_0x9aee(_0x221ac2,_0x53978d){_0x221ac2=_0x221ac2-0x1cc;const _0x2d46c7=a47_0x2d46();let _0x9aeec3=_0x2d46c7[_0x221ac2];return _0x9aeec3;}export function useFormatCode(){const [_0xf3481e,_0xe616bc]=useState(![]),[_0x5191af,_0x14f206]=useState(![]),[_0x29134f,_0x533b49]=useState(''),_0x5b1d53=useCallback(async _0x16e74a=>{const _0x464034=a47_0x9aee,_0x533dce=Date[_0x464034(0x1d7)](),_0x5a8bc3=a47_0x4e3826[_0x464034(0x1ce)](process[_0x464034(0x1d6)](),_0x16e74a);_0xe616bc(!![]);try{logger[_0x464034(0x1d9)](_0x464034(0x1cc),_0x464034(0x1d8),{'projectCode':_0x16e74a}),await execa(_0x464034(0x1e0),[_0x464034(0x1cd),_0x464034(0x1d5),'.'],{'cwd':_0x5a8bc3});const _0x3d6d1b=Date[_0x464034(0x1d7)]()-_0x533dce;logger['success'](_0x464034(0x1cc),_0x464034(0x1d0),_0x3d6d1b,{'projectCode':_0x16e74a});}catch(_0x546a24){const _0x424efd=Date[_0x464034(0x1d7)]()-_0x533dce;logger[_0x464034(0x1e1)](_0x464034(0x1cc),_0x464034(0x1cf),{'projectCode':_0x16e74a,'error':_0x546a24 instanceof Error?_0x546a24['message']:String(_0x546a24),'duration':_0x424efd});throw _0x546a24;}finally{_0xe616bc(![]),_0x14f206(!![]),_0x533b49(formatElapsed(_0x533dce));}},[]);return{'taskName':'格式化代码','finished':_0x5191af,'loading':_0xf3481e,'elapsed':_0x29134f,'doTask':_0x5b1d53};}
1
+ (function(_0x52f54f,_0x53c5b2){const _0x398ef6=a47_0x5096,_0x469e00=_0x52f54f();while(!![]){try{const _0x357345=parseInt(_0x398ef6(0x10e))/0x1*(-parseInt(_0x398ef6(0x10b))/0x2)+-parseInt(_0x398ef6(0x113))/0x3*(-parseInt(_0x398ef6(0x108))/0x4)+parseInt(_0x398ef6(0x119))/0x5+parseInt(_0x398ef6(0x10f))/0x6*(-parseInt(_0x398ef6(0x107))/0x7)+parseInt(_0x398ef6(0x109))/0x8*(-parseInt(_0x398ef6(0x11b))/0x9)+parseInt(_0x398ef6(0x114))/0xa+parseInt(_0x398ef6(0x10d))/0xb;if(_0x357345===_0x53c5b2)break;else _0x469e00['push'](_0x469e00['shift']());}catch(_0x5a25a6){_0x469e00['push'](_0x469e00['shift']());}}}(a47_0x1b97,0xdf8c8));import a47_0x1a6787 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a47_0x1b97(){const _0x1d5d4c=['8778qQkStL','message','开始格式化代码','prettier','127215khndIR','3638590EmHFtI','npx','success','cwd','now','3272240PsxfPo','resolve','5957613Vaxwhs','--write','代码格式化失败','error','format','5810MjnAxa','100KqKTAA','8NgVEEW','info','2258FGOhEe','格式化代码','25048496LodrBV','1385YBVxIe'];a47_0x1b97=function(){return _0x1d5d4c;};return a47_0x1b97();}function a47_0x5096(_0xd692aa,_0x5ea60b){_0xd692aa=_0xd692aa-0x106;const _0x1b9765=a47_0x1b97();let _0x509671=_0x1b9765[_0xd692aa];return _0x509671;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0xe70e3d=a47_0x5096,[_0x443bb9,_0x2516ff]=useState(![]),[_0x3af2c5,_0x20c355]=useState(![]),[_0x17295f,_0x20232f]=useState(''),_0x1c4208=useCallback(async _0xcc2248=>{const _0x17ea71=a47_0x5096,_0x188c8a=Date[_0x17ea71(0x118)](),_0x5136fb=a47_0x1a6787[_0x17ea71(0x11a)](process[_0x17ea71(0x117)](),_0xcc2248);_0x2516ff(!![]);try{logger[_0x17ea71(0x10a)](_0x17ea71(0x106),_0x17ea71(0x111),{'projectCode':_0xcc2248}),await execa(_0x17ea71(0x115),[_0x17ea71(0x112),_0x17ea71(0x11c),'.'],{'cwd':_0x5136fb});const _0x5306df=Date[_0x17ea71(0x118)]()-_0x188c8a;logger[_0x17ea71(0x116)]('format','代码格式化完成',_0x5306df,{'projectCode':_0xcc2248});}catch(_0x101476){const _0x27253c=Date['now']()-_0x188c8a;logger[_0x17ea71(0x11e)](_0x17ea71(0x106),_0x17ea71(0x11d),{'projectCode':_0xcc2248,'error':_0x101476 instanceof Error?_0x101476[_0x17ea71(0x110)]:String(_0x101476),'duration':_0x27253c});throw _0x101476;}finally{_0x2516ff(![]),_0x20c355(!![]),_0x20232f(formatElapsed(_0x188c8a));}},[]);return{'taskName':_0xe70e3d(0x10c),'finished':_0x3af2c5,'loading':_0x443bb9,'elapsed':_0x17295f,'doTask':_0x1c4208};}
@@ -1 +1 @@
1
- (function(_0x14c44e,_0x48b813){const _0x877424=a48_0xd91a,_0x1b217f=_0x14c44e();while(!![]){try{const _0x96600a=-parseInt(_0x877424(0x1ef))/0x1+parseInt(_0x877424(0x1f3))/0x2*(parseInt(_0x877424(0x1ec))/0x3)+-parseInt(_0x877424(0x1f6))/0x4*(parseInt(_0x877424(0x1e8))/0x5)+-parseInt(_0x877424(0x1ed))/0x6+parseInt(_0x877424(0x1ea))/0x7+parseInt(_0x877424(0x1e9))/0x8*(parseInt(_0x877424(0x1e6))/0x9)+-parseInt(_0x877424(0x1f4))/0xa*(-parseInt(_0x877424(0x1f7))/0xb);if(_0x96600a===_0x48b813)break;else _0x1b217f['push'](_0x1b217f['shift']());}catch(_0x531993){_0x1b217f['push'](_0x1b217f['shift']());}}}(a48_0x5534,0x9fe5e));import a48_0x428d3e from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x21980d=a48_0xd91a,[_0x79cc1,_0x57dec3]=useState(![]),[_0x553b12,_0x598b1b]=useState(![]),[_0x10a28c,_0x2edc23]=useState(''),_0x202f2a=useCallback(async _0x1229bd=>{const _0x4d02a4=a48_0xd91a,_0x3bb906=Date[_0x4d02a4(0x1e5)](),_0x241af5=a48_0x428d3e[_0x4d02a4(0x1eb)](process['cwd'](),_0x1229bd);_0x57dec3(!![]),_0x598b1b(![]);const _0x5b5b33=async(_0xc78dd4,_0x35e5d2)=>{await execa(_0xc78dd4,_0x35e5d2,{'cwd':_0x241af5});};try{logger[_0x4d02a4(0x1f2)](_0x4d02a4(0x1f0),'开始安装依赖',{'projectCode':_0x1229bd,'registry':_0x4d02a4(0x1e7)}),await _0x5b5b33('npm',[_0x4d02a4(0x1f0),_0x4d02a4(0x1f5),'https://registry.npmmirror.com']);const _0xe1e7e1=Date[_0x4d02a4(0x1e5)]()-_0x3bb906;logger['success'](_0x4d02a4(0x1f0),'依赖安装完成',_0xe1e7e1,{'projectCode':_0x1229bd});}catch(_0x111bd6){const _0x3b3daa=Date[_0x4d02a4(0x1e5)]()-_0x3bb906;logger['error']('install',_0x4d02a4(0x1ee),{'projectCode':_0x1229bd,'error':_0x111bd6 instanceof Error?_0x111bd6['message']:String(_0x111bd6),'duration':_0x3b3daa});throw _0x111bd6;}finally{_0x57dec3(![]),_0x598b1b(!![]),_0x2edc23(formatElapsed(_0x3bb906));}},[]);return{'taskName':_0x21980d(0x1f1),'finished':_0x553b12,'loading':_0x79cc1,'elapsed':_0x10a28c,'doTask':_0x202f2a};}function a48_0xd91a(_0x59125a,_0x12d92c){_0x59125a=_0x59125a-0x1e5;const _0x55344c=a48_0x5534();let _0xd91a48=_0x55344c[_0x59125a];return _0xd91a48;}function a48_0x5534(){const _0x458883=['94761ilVZpZ','https://registry.npmmirror.com','1275iUAzbL','272ewoKMH','5154877jyDITp','resolve','3ENWNvC','7221450DDsLzW','依赖安装失败','1227248OLEdqd','install','安装依赖','info','1409502zEInkY','10mEJIQh','--registry','14664veiZjl','24435917hrQIbC','now'];a48_0x5534=function(){return _0x458883;};return a48_0x5534();}
1
+ (function(_0x52dcdd,_0x1d89d8){const _0x4cc6c5=a48_0xccf7,_0x13cce5=_0x52dcdd();while(!![]){try{const _0x4ac923=parseInt(_0x4cc6c5(0x1b4))/0x1+parseInt(_0x4cc6c5(0x1b0))/0x2*(-parseInt(_0x4cc6c5(0x1af))/0x3)+parseInt(_0x4cc6c5(0x1a4))/0x4*(-parseInt(_0x4cc6c5(0x1a5))/0x5)+parseInt(_0x4cc6c5(0x1a6))/0x6*(parseInt(_0x4cc6c5(0x1aa))/0x7)+parseInt(_0x4cc6c5(0x1a2))/0x8+parseInt(_0x4cc6c5(0x1b2))/0x9*(parseInt(_0x4cc6c5(0x1a1))/0xa)+parseInt(_0x4cc6c5(0x1ae))/0xb*(-parseInt(_0x4cc6c5(0x1b5))/0xc);if(_0x4ac923===_0x1d89d8)break;else _0x13cce5['push'](_0x13cce5['shift']());}catch(_0x44e8a1){_0x13cce5['push'](_0x13cce5['shift']());}}}(a48_0x51ff,0xda0ee));import a48_0x43ae5d from'node:path';import{useCallback,useState}from'react';function a48_0x51ff(){const _0x1cd3ac=['npm','resolve','140eLmGjs','13172960hiDamR','安装依赖','1656cvGanu','19325skkwsu','1316118ZZfSOw','依赖安装失败','https://registry.npmmirror.com','install','56VgUtui','info','now','--registry','24753069CTDDTX','793857gRnMpj','6WSrFfh','message','535239ZslfSv','依赖安装完成','1303374lFooYW','12frOQvT','cwd','error'];a48_0x51ff=function(){return _0x1cd3ac;};return a48_0x51ff();}import{execa}from'execa';function a48_0xccf7(_0x5a231f,_0x4f80fe){_0x5a231f=_0x5a231f-0x19f;const _0x51ff80=a48_0x51ff();let _0xccf7bd=_0x51ff80[_0x5a231f];return _0xccf7bd;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x585428=a48_0xccf7,[_0x514835,_0x1d7f06]=useState(![]),[_0x1d88ee,_0x5c2d2b]=useState(![]),[_0x3da556,_0x104a20]=useState(''),_0x25bca8=useCallback(async _0xcef933=>{const _0x436822=a48_0xccf7,_0x3c602e=Date[_0x436822(0x1ac)](),_0x3258b2=a48_0x43ae5d[_0x436822(0x1a0)](process[_0x436822(0x1b6)](),_0xcef933);_0x1d7f06(!![]),_0x5c2d2b(![]);const _0x2316e0=async(_0xf1a88c,_0x337e5b)=>{await execa(_0xf1a88c,_0x337e5b,{'cwd':_0x3258b2});};try{logger[_0x436822(0x1ab)](_0x436822(0x1a9),'开始安装依赖',{'projectCode':_0xcef933,'registry':_0x436822(0x1a8)}),await _0x2316e0(_0x436822(0x19f),[_0x436822(0x1a9),_0x436822(0x1ad),_0x436822(0x1a8)]);const _0x22cd3d=Date[_0x436822(0x1ac)]()-_0x3c602e;logger['success'](_0x436822(0x1a9),_0x436822(0x1b3),_0x22cd3d,{'projectCode':_0xcef933});}catch(_0x33cdf5){const _0x172342=Date[_0x436822(0x1ac)]()-_0x3c602e;logger[_0x436822(0x1b7)](_0x436822(0x1a9),_0x436822(0x1a7),{'projectCode':_0xcef933,'error':_0x33cdf5 instanceof Error?_0x33cdf5[_0x436822(0x1b1)]:String(_0x33cdf5),'duration':_0x172342});throw _0x33cdf5;}finally{_0x1d7f06(![]),_0x5c2d2b(!![]),_0x104a20(formatElapsed(_0x3c602e));}},[]);return{'taskName':_0x585428(0x1a3),'finished':_0x1d88ee,'loading':_0x514835,'elapsed':_0x3da556,'doTask':_0x25bca8};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x585448,_0x4548ed){var _0x2a6271=a49_0x5a83,_0x2de0ab=_0x585448();while(!![]){try{var _0x3a0106=parseInt(_0x2a6271(0x194))/0x1*(-parseInt(_0x2a6271(0x197))/0x2)+-parseInt(_0x2a6271(0x18f))/0x3*(-parseInt(_0x2a6271(0x18e))/0x4)+parseInt(_0x2a6271(0x19a))/0x5*(-parseInt(_0x2a6271(0x18c))/0x6)+parseInt(_0x2a6271(0x18d))/0x7+parseInt(_0x2a6271(0x192))/0x8+parseInt(_0x2a6271(0x195))/0x9*(parseInt(_0x2a6271(0x196))/0xa)+-parseInt(_0x2a6271(0x191))/0xb*(-parseInt(_0x2a6271(0x190))/0xc);if(_0x3a0106===_0x4548ed)break;else _0x2de0ab['push'](_0x2de0ab['shift']());}catch(_0x3852e7){_0x2de0ab['push'](_0x2de0ab['shift']());}}}(a49_0x5426,0x9c958));import{jsx as a49_0x5e1dea,jsxs as a49_0x38f6fa}from'react/jsx-runtime';function a49_0x5426(){var _0x5591f8=['lovrabet\x20--help','6uWiAmg','1497069LZGunc','8PBurYW','1804569SiAoTR','685284rhHCWQ','11BXZIvY','2077016bEQhFm','green','2nKdnVe','4419kzRICb','8350uMckVe','504066AjQqfS','查看可用命令。','column','4990990cOyiTO'];a49_0x5426=function(){return _0x5591f8;};return a49_0x5426();}import{Box,Text}from'ink';function a49_0x5a83(_0x7afe7d,_0x4d7416){_0x7afe7d=_0x7afe7d-0x18b;var _0x542600=a49_0x5426();var _0x5a83b9=_0x542600[_0x7afe7d];return _0x5a83b9;}export function Help(){var _0x468d93=a49_0x5a83;return a49_0x38f6fa(Box,{'flexDirection':_0x468d93(0x199),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x38f6fa(Box,{'children':[a49_0x5e1dea(Box,{'width':'1'}),a49_0x5e1dea(Text,{'children':'!\x20请指定一个有效的命令。'})]}),a49_0x38f6fa(Box,{'marginTop':0x1,'children':[a49_0x5e1dea(Box,{'width':'1'}),a49_0x38f6fa(Text,{'children':['\x20\x20','使用']}),a49_0x38f6fa(Text,{'bold':!![],'color':_0x468d93(0x193),'children':['\x20',_0x468d93(0x18b),'\x20']}),a49_0x5e1dea(Text,{'children':_0x468d93(0x198)})]})]});}
1
+ function a49_0x1ace(){var _0x32a4fa=['1019007qpOYQx','20850HMDYnD','column','green','13755ZJPmMN','180824WfLIQy','312CyElun','查看可用命令。','121918jvKMwv','!\x20请指定一个有效的命令。','310248HbsdMJ','175JdxIqy','34195giCiNI'];a49_0x1ace=function(){return _0x32a4fa;};return a49_0x1ace();}(function(_0x476816,_0xe6de9c){var _0x1da622=a49_0x205b,_0x4fa3a9=_0x476816();while(!![]){try{var _0x1b0e2e=parseInt(_0x1da622(0x1bc))/0x1+parseInt(_0x1da622(0x1be))/0x2+-parseInt(_0x1da622(0x1b8))/0x3+parseInt(_0x1da622(0x1b9))/0x4+parseInt(_0x1da622(0x1bf))/0x5*(-parseInt(_0x1da622(0x1b5))/0x6)+-parseInt(_0x1da622(0x1c0))/0x7*(parseInt(_0x1da622(0x1ba))/0x8)+parseInt(_0x1da622(0x1b4))/0x9;if(_0x1b0e2e===_0xe6de9c)break;else _0x4fa3a9['push'](_0x4fa3a9['shift']());}catch(_0x1a83b0){_0x4fa3a9['push'](_0x4fa3a9['shift']());}}}(a49_0x1ace,0x1cfda));function a49_0x205b(_0x57986e,_0x42a739){_0x57986e=_0x57986e-0x1b4;var _0x1ace73=a49_0x1ace();var _0x205b52=_0x1ace73[_0x57986e];return _0x205b52;}import{jsx as a49_0x1dfd37,jsxs as a49_0x505200}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x2de393=a49_0x205b;return a49_0x505200(Box,{'flexDirection':_0x2de393(0x1b6),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x505200(Box,{'children':[a49_0x1dfd37(Box,{'width':'1'}),a49_0x1dfd37(Text,{'children':_0x2de393(0x1bd)})]}),a49_0x505200(Box,{'marginTop':0x1,'children':[a49_0x1dfd37(Box,{'width':'1'}),a49_0x505200(Text,{'children':['\x20\x20','使用']}),a49_0x505200(Text,{'bold':!![],'color':_0x2de393(0x1b7),'children':['\x20','lovrabet\x20--help','\x20']}),a49_0x1dfd37(Text,{'children':_0x2de393(0x1bb)})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5c9a07,_0x56fa91){const _0xc87679=a50_0x7b5f,_0x43e33b=_0x5c9a07();while(!![]){try{const _0x5c38c5=-parseInt(_0xc87679(0x1dd))/0x1*(-parseInt(_0xc87679(0x1f8))/0x2)+-parseInt(_0xc87679(0x1e3))/0x3*(-parseInt(_0xc87679(0x1ee))/0x4)+parseInt(_0xc87679(0x1ed))/0x5+-parseInt(_0xc87679(0x1fa))/0x6*(parseInt(_0xc87679(0x1db))/0x7)+parseInt(_0xc87679(0x1fb))/0x8*(-parseInt(_0xc87679(0x1f1))/0x9)+parseInt(_0xc87679(0x1df))/0xa*(parseInt(_0xc87679(0x1ec))/0xb)+-parseInt(_0xc87679(0x1d1))/0xc*(parseInt(_0xc87679(0x1c8))/0xd);if(_0x5c38c5===_0x56fa91)break;else _0x43e33b['push'](_0x43e33b['shift']());}catch(_0x4a255a){_0x43e33b['push'](_0x43e33b['shift']());}}}(a50_0x486c,0x3d07b));import{jsxs as a50_0x22e97c,jsx as a50_0x278143}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';function a50_0x486c(){const _0x20d112=['error','初始化项目配置文件成功','column','189cfJMnT','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','158kZgGGo','backspace','40JzdoiN','slice','setLogPath','red','880788eEBApd','stringify','应用代码不合法','请输入应用代码\x20(AppCode):\x20','trim','green','env','delete','1.0.0','987646UsmJQv','2185040ymqGMO','4jpXQFF','AppCode:\x20','cwd','152127ncZRzD','info','cyan','message','parse','version','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','1592LSikwL','应用代码只能包含字母、数字、-\x20和\x20_','31230yvjcHm','16dnkWwo','length','13sjDuUU','package.json','utf8','exit','../..','string','ctrl','当前目录已存在\x20.lovrabetrc\x20文件','创建配置文件失败:\x20','9494352TXtCeS','test','online','return','应用代码长度不能超过\x20100\x20个字符','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','toLocaleString'];a50_0x486c=function(){return _0x20d112;};return a50_0x486c();}import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';function a50_0x7b5f(_0x528159,_0x3b909a){_0x528159=_0x528159-0x1c7;const _0x486cb3=a50_0x486c();let _0x7b5ff8=_0x486cb3[_0x528159];return _0x7b5ff8;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x10523b,env:_0xb8665a}){const _0x2e86d0=a50_0x7b5f,[_0x338301,_0x64b9cc]=useState(null),[_0x5c1663,_0xb3849e]=useState(![]),[_0x187fc1,_0x3e5fc8]=useState(!_0x10523b),[_0x5c0a81,_0x59de4f]=useState(''),[_0x17e47d,_0x2469a5]=useState(''),[_0x25f684,_0x4c80cb]=useState(_0x10523b||''),[_0x4d8314]=useState(_0xb8665a);function _0x253392(_0x4a7edd){const _0x1c503c=a50_0x7b5f;if(_0x4a7edd[_0x1c503c(0x1c7)]===0x0)return{'valid':![],'message':''};if(_0x4a7edd[_0x1c503c(0x1c7)]>0x64)return{'valid':![],'message':_0x1c503c(0x1d5)};const _0x3a13e4=/^[A-Za-z0-9_-]+$/;if(!_0x3a13e4[_0x1c503c(0x1d2)](_0x4a7edd))return{'valid':![],'message':_0x1c503c(0x1f9)};return{'valid':!![]};}useInput((_0x1cf96c,_0x5d70a0)=>{const _0x4631aa=a50_0x7b5f;if(!_0x187fc1)return;if(_0x5d70a0[_0x4631aa(0x1d4)]){if(_0x17e47d||!_0x5c0a81[_0x4631aa(0x1e7)]()){_0x2469a5('应用代码不能为空');return;}const _0x4bf084=_0x5c0a81[_0x4631aa(0x1e7)](),{valid:_0x10acbb,message:_0x451c82}=_0x253392(_0x4bf084);if(!_0x10acbb){_0x2469a5(_0x451c82||'应用代码不合法');return;}_0x4c80cb(_0x4bf084),_0x3e5fc8(![]);}else{if(_0x5d70a0[_0x4631aa(0x1de)]||_0x5d70a0[_0x4631aa(0x1ea)])_0x59de4f(_0x9f7a7a=>{const _0x165f52=_0x4631aa,_0x12b1d4=_0x9f7a7a[_0x165f52(0x1e0)](0x0,-0x1);if(_0x12b1d4['length']===0x0)_0x2469a5('');else{const {valid:_0x28a5a4,message:_0x50a63f}=_0x253392(_0x12b1d4);_0x2469a5(_0x28a5a4?'':_0x50a63f||_0x165f52(0x1e5));}return _0x12b1d4;});else _0x5d70a0[_0x4631aa(0x1ce)]&&_0x1cf96c==='c'?process[_0x4631aa(0x1cb)](0x0):_0x59de4f(_0x25091f=>{const _0x4c2407=_0x25091f+_0x1cf96c,{valid:_0x3f6816,message:_0x410bee}=_0x253392(_0x4c2407);return _0x2469a5(_0x3f6816?'':_0x410bee||'应用代码不合法'),_0x4c2407;});}},{'isActive':_0x187fc1}),useEffect(()=>{const _0x5279d4=a50_0x7b5f;if(!_0x25f684||_0x187fc1)return;const _0x15b874=resolve(process[_0x5279d4(0x1f0)](),'.lovrabetrc');if(existsSync(_0x15b874)){_0x64b9cc(_0x5279d4(0x1cf)),setTimeout(()=>process[_0x5279d4(0x1cb)](0x1),0x64);return;}try{const _0x477d5a=fileURLToPath(import.meta.url),_0x586de9=resolve(dirname(_0x477d5a),_0x5279d4(0x1cc)),_0x1018e9=join(_0x586de9,_0x5279d4(0x1c9));let _0x6dc5f0=_0x5279d4(0x1eb);try{const _0x47e579=JSON[_0x5279d4(0x1f5)](readFileSync(_0x1018e9,_0x5279d4(0x1ca)));_0x6dc5f0=_0x47e579['version']||_0x5279d4(0x1eb);}catch(_0x418c0a){}const _0x24f5cf=readConfig(),_0x20e93f=typeof _0x24f5cf[_0x5279d4(0x1e9)]===_0x5279d4(0x1cd)?_0x24f5cf[_0x5279d4(0x1e9)]:undefined,{app:_0x35763a,appcode:_0x368a08,..._0x4e559b}=_0x24f5cf,_0x3c3bb9={..._0x4e559b,'appcode':_0x25f684,'env':_0x4d8314||_0x20e93f||_0x5279d4(0x1d3),'createdAt':new Date()[_0x5279d4(0x1d7)](),'version':_0x6dc5f0};writeFileSync(_0x15b874,JSON[_0x5279d4(0x1e4)](_0x3c3bb9,null,0x2),{'encoding':_0x5279d4(0x1ca),'mode':0x180}),logger[_0x5279d4(0x1e1)](process[_0x5279d4(0x1f0)]()),logger[_0x5279d4(0x1f2)]('init',_0x5279d4(0x1d9),{'appcode':_0x25f684,'env':_0x3c3bb9[_0x5279d4(0x1e9)],'version':_0x3c3bb9[_0x5279d4(0x1f6)],'configPath':_0x15b874}),_0xb3849e(!![]),setTimeout(()=>process[_0x5279d4(0x1cb)](0x0),0x64);}catch(_0x2fb2b7){logger[_0x5279d4(0x1d8)]('init','创建配置文件失败',{'error':_0x2fb2b7 instanceof Error?_0x2fb2b7['message']:String(_0x2fb2b7)}),_0x64b9cc(_0x5279d4(0x1d0)+(_0x2fb2b7 instanceof Error?_0x2fb2b7[_0x5279d4(0x1f4)]:String(_0x2fb2b7))),setTimeout(()=>process[_0x5279d4(0x1cb)](0x1),0x64);}},[_0x25f684,_0x187fc1,_0x4d8314]);if(_0x338301)return a50_0x278143(Box,{'flexDirection':_0x2e86d0(0x1da),'children':a50_0x22e97c(Text,{'color':'red','children':['✗\x20',_0x338301]})});if(_0x187fc1)return a50_0x22e97c(Box,{'flexDirection':_0x2e86d0(0x1da),'children':[a50_0x22e97c(Box,{'children':[a50_0x278143(Text,{'color':_0x2e86d0(0x1f3),'children':_0x2e86d0(0x1e6)}),_0x5c0a81?a50_0x278143(Text,{'color':_0x2e86d0(0x1e8),'children':_0x5c0a81}):a50_0x278143(Text,{'color':'gray','children':'_'}),_0x17e47d&&a50_0x22e97c(Text,{'color':_0x2e86d0(0x1e2),'children':['\x20←\x20',_0x17e47d]})]}),!_0x17e47d&&!_0x5c0a81&&a50_0x278143(Box,{'children':a50_0x278143(Text,{'color':'gray','children':_0x2e86d0(0x1d6)})})]});if(_0x5c1663)return a50_0x22e97c(Box,{'flexDirection':'column','children':[a50_0x278143(Text,{'color':'green','children':_0x2e86d0(0x1f7)}),a50_0x22e97c(Text,{'color':_0x2e86d0(0x1f3),'children':[_0x2e86d0(0x1ef),_0x25f684]}),a50_0x278143(Text,{'children':_0x2e86d0(0x1dc)})]});return a50_0x278143(Box,{'children':a50_0x278143(Text,{'children':'正在初始化配置文件...'})});}
1
+ (function(_0x41c373,_0x17e9a4){const _0x156235=a50_0x1c4f,_0x2de3da=_0x41c373();while(!![]){try{const _0x1e53ac=parseInt(_0x156235(0xe1))/0x1+parseInt(_0x156235(0xd4))/0x2+-parseInt(_0x156235(0xec))/0x3*(-parseInt(_0x156235(0xfa))/0x4)+-parseInt(_0x156235(0xed))/0x5*(-parseInt(_0x156235(0xd8))/0x6)+-parseInt(_0x156235(0xd5))/0x7+-parseInt(_0x156235(0xfb))/0x8*(-parseInt(_0x156235(0xe6))/0x9)+-parseInt(_0x156235(0xe5))/0xa;if(_0x1e53ac===_0x17e9a4)break;else _0x2de3da['push'](_0x2de3da['shift']());}catch(_0x32d5a4){_0x2de3da['push'](_0x2de3da['shift']());}}}(a50_0xe11a,0x62586));import{jsxs as a50_0x592919,jsx as a50_0x4a9b44}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';function a50_0x1c4f(_0x3a5679,_0x5f192b){_0x3a5679=_0x3a5679-0xd2;const _0xe11aca=a50_0xe11a();let _0x1c4fa0=_0xe11aca[_0x3a5679];return _0x1c4fa0;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a50_0xe11a(){const _0x46c022=['当前目录已存在\x20.lovrabetrc\x20文件','stringify','893328liPcPT','3194660BEsyeV','gray','创建配置文件失败:\x20','144588FNuwZK','delete','column','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','\x20←\x20','../..','green','cwd','AppCode:\x20','396690dfRMUo','backspace','setLogPath','error','11559140pkcwCm','72ZBmtHt','请输入应用代码\x20(AppCode):\x20','应用代码长度不能超过\x20100\x20个字符','.lovrabetrc','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','red','732flsXDf','115sRQybR','version','正在初始化配置文件...','init','env','return','length','string','应用代码不合法','slice','exit','1.0.0','应用代码只能包含字母、数字、-\x20和\x20_','7764dYqWGI','143904CVhAAG','utf8','message','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','trim','cyan','应用代码不能为空','创建配置文件失败','初始化项目配置文件成功','parse','ctrl'];a50_0xe11a=function(){return _0x46c022;};return a50_0xe11a();}export function Init({appcode:_0x555ae2,env:_0x1af77a}){const _0x5c870d=a50_0x1c4f,[_0x257101,_0x49e1b9]=useState(null),[_0x59022e,_0x1633e4]=useState(![]),[_0x1d947b,_0x4497d7]=useState(!_0x555ae2),[_0x135e99,_0x3e52a4]=useState(''),[_0x503653,_0x5750e3]=useState(''),[_0x45b86d,_0x481d19]=useState(_0x555ae2||''),[_0x20a8a0]=useState(_0x1af77a);function _0x4af332(_0x383c90){const _0x50671d=a50_0x1c4f;if(_0x383c90[_0x50671d(0xf3)]===0x0)return{'valid':![],'message':''};if(_0x383c90['length']>0x64)return{'valid':![],'message':_0x50671d(0xe8)};const _0x2ee9ba=/^[A-Za-z0-9_-]+$/;if(!_0x2ee9ba['test'](_0x383c90))return{'valid':![],'message':_0x50671d(0xf9)};return{'valid':!![]};}useInput((_0x39c248,_0x52329e)=>{const _0x2c101d=a50_0x1c4f;if(!_0x1d947b)return;if(_0x52329e[_0x2c101d(0xf2)]){if(_0x503653||!_0x135e99[_0x2c101d(0xff)]()){_0x5750e3(_0x2c101d(0x101));return;}const _0x254735=_0x135e99[_0x2c101d(0xff)](),{valid:_0x168a63,message:_0x4384c5}=_0x4af332(_0x254735);if(!_0x168a63){_0x5750e3(_0x4384c5||_0x2c101d(0xf5));return;}_0x481d19(_0x254735),_0x4497d7(![]);}else{if(_0x52329e[_0x2c101d(0xe2)]||_0x52329e[_0x2c101d(0xd9)])_0x3e52a4(_0x56084c=>{const _0x351ad7=_0x2c101d,_0x20956c=_0x56084c[_0x351ad7(0xf6)](0x0,-0x1);if(_0x20956c[_0x351ad7(0xf3)]===0x0)_0x5750e3('');else{const {valid:_0x546129,message:_0xc98727}=_0x4af332(_0x20956c);_0x5750e3(_0x546129?'':_0xc98727||_0x351ad7(0xf5));}return _0x20956c;});else _0x52329e[_0x2c101d(0x105)]&&_0x39c248==='c'?process['exit'](0x0):_0x3e52a4(_0x2c035a=>{const _0x25c42c=_0x2c035a+_0x39c248,{valid:_0x59b87c,message:_0x759b73}=_0x4af332(_0x25c42c);return _0x5750e3(_0x59b87c?'':_0x759b73||'应用代码不合法'),_0x25c42c;});}},{'isActive':_0x1d947b}),useEffect(()=>{const _0x56c904=a50_0x1c4f;if(!_0x45b86d||_0x1d947b)return;const _0xe58eb8=resolve(process[_0x56c904(0xdf)](),_0x56c904(0xe9));if(existsSync(_0xe58eb8)){_0x49e1b9(_0x56c904(0xd2)),setTimeout(()=>process[_0x56c904(0xf7)](0x1),0x64);return;}try{const _0x177181=fileURLToPath(import.meta.url),_0x56f697=resolve(dirname(_0x177181),_0x56c904(0xdd)),_0x446c7d=join(_0x56f697,'package.json');let _0x300ebd=_0x56c904(0xf8);try{const _0x545fac=JSON[_0x56c904(0x104)](readFileSync(_0x446c7d,_0x56c904(0xfc)));_0x300ebd=_0x545fac[_0x56c904(0xee)]||_0x56c904(0xf8);}catch(_0x172335){}const _0x332882=readConfig(),_0x1aeeb5=typeof _0x332882[_0x56c904(0xf1)]===_0x56c904(0xf4)?_0x332882['env']:undefined,{app:_0x45e5fe,appcode:_0x2a0f4c,..._0x561c89}=_0x332882,_0x5964a7={..._0x561c89,'appcode':_0x45b86d,'env':_0x20a8a0||_0x1aeeb5||'online','createdAt':new Date()['toLocaleString'](),'version':_0x300ebd};writeFileSync(_0xe58eb8,JSON[_0x56c904(0xd3)](_0x5964a7,null,0x2),{'encoding':_0x56c904(0xfc),'mode':0x180}),logger[_0x56c904(0xe3)](process[_0x56c904(0xdf)]()),logger['info'](_0x56c904(0xf0),_0x56c904(0x103),{'appcode':_0x45b86d,'env':_0x5964a7[_0x56c904(0xf1)],'version':_0x5964a7[_0x56c904(0xee)],'configPath':_0xe58eb8}),_0x1633e4(!![]),setTimeout(()=>process[_0x56c904(0xf7)](0x0),0x64);}catch(_0x2eea2f){logger[_0x56c904(0xe4)](_0x56c904(0xf0),_0x56c904(0x102),{'error':_0x2eea2f instanceof Error?_0x2eea2f['message']:String(_0x2eea2f)}),_0x49e1b9(_0x56c904(0xd7)+(_0x2eea2f instanceof Error?_0x2eea2f[_0x56c904(0xfd)]:String(_0x2eea2f))),setTimeout(()=>process[_0x56c904(0xf7)](0x1),0x64);}},[_0x45b86d,_0x1d947b,_0x20a8a0]);if(_0x257101)return a50_0x4a9b44(Box,{'flexDirection':_0x5c870d(0xda),'children':a50_0x592919(Text,{'color':_0x5c870d(0xeb),'children':['✗\x20',_0x257101]})});if(_0x1d947b)return a50_0x592919(Box,{'flexDirection':_0x5c870d(0xda),'children':[a50_0x592919(Box,{'children':[a50_0x4a9b44(Text,{'color':_0x5c870d(0x100),'children':_0x5c870d(0xe7)}),_0x135e99?a50_0x4a9b44(Text,{'color':_0x5c870d(0xde),'children':_0x135e99}):a50_0x4a9b44(Text,{'color':_0x5c870d(0xd6),'children':'_'}),_0x503653&&a50_0x592919(Text,{'color':_0x5c870d(0xeb),'children':[_0x5c870d(0xdc),_0x503653]})]}),!_0x503653&&!_0x135e99&&a50_0x4a9b44(Box,{'children':a50_0x4a9b44(Text,{'color':_0x5c870d(0xd6),'children':_0x5c870d(0xea)})})]});if(_0x59022e)return a50_0x592919(Box,{'flexDirection':_0x5c870d(0xda),'children':[a50_0x4a9b44(Text,{'color':_0x5c870d(0xde),'children':_0x5c870d(0xfe)}),a50_0x592919(Text,{'color':_0x5c870d(0x100),'children':[_0x5c870d(0xe0),_0x45b86d]}),a50_0x4a9b44(Text,{'children':_0x5c870d(0xdb)})]});return a50_0x4a9b44(Box,{'children':a50_0x4a9b44(Text,{'children':_0x5c870d(0xef)})});}
@@ -0,0 +1 @@
1
+ (function(_0x459c6d,_0x195118){const _0xfbdaaf=a51_0x5db7,_0x342b6d=_0x459c6d();while(!![]){try{const _0x2e2468=parseInt(_0xfbdaaf(0x145))/0x1*(-parseInt(_0xfbdaaf(0x141))/0x2)+-parseInt(_0xfbdaaf(0x148))/0x3+parseInt(_0xfbdaaf(0x137))/0x4*(parseInt(_0xfbdaaf(0x134))/0x5)+parseInt(_0xfbdaaf(0x12e))/0x6*(-parseInt(_0xfbdaaf(0x140))/0x7)+parseInt(_0xfbdaaf(0x142))/0x8*(-parseInt(_0xfbdaaf(0x135))/0x9)+parseInt(_0xfbdaaf(0x13e))/0xa*(parseInt(_0xfbdaaf(0x13a))/0xb)+parseInt(_0xfbdaaf(0x147))/0xc*(parseInt(_0xfbdaaf(0x12f))/0xd);if(_0x2e2468===_0x195118)break;else _0x342b6d['push'](_0x342b6d['shift']());}catch(_0x226662){_0x342b6d['push'](_0x342b6d['shift']());}}}(a51_0x1142,0x2413b));function a51_0x5db7(_0xb8b484,_0x2ea1cb){_0xb8b484=_0xb8b484-0x12d;const _0x11425c=a51_0x1142();let _0x5db777=_0x11425c[_0xb8b484];return _0x5db777;}import{readConfig}from'../utils/config.js';function a51_0x1142(){const _0x1306d4=['1107012JZheie','2960893ArZjLw','appcode','\x20\x20-\x20AppCode:\x20','log','online','5QufIEe','9NGpqHL','exit','1004728YmfDzz','\x20\x20-\x20环境:\x20','生成\x20claude\x20MCP\x20配置命令','803FaJzsk','message','错误:\x20配置失败\x20-\x20','error','37180gXoIYl','claude\x20mcp\x20add\x20lovrabet-dataset\x20npx\x20@lovrabet/dataset-mcp-server@latest','7UfaHvY','140558GdxJqp','237192TaKxri','daily','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','2oZajzR','请在终端中执行以下命令来配置\x20claude\x20code\x20MCP:\x0a','12ZXNgaG','743631vwAzJC','未找到\x20appcode\x20配置','-e\x20LOVRABET_ENV=daily','配置信息:','info','配置完成后:\x0a','mcp-claude'];a51_0x1142=function(){return _0x1306d4;};return a51_0x1142();}import{logger}from'../utils/logger.js';export async function configureClaudeMcp(){const _0x416dfe=a51_0x5db7;try{const _0x39c265=readConfig(),_0x33bb87=_0x39c265[_0x416dfe(0x130)]||_0x39c265['app'],_0x26c9b9=_0x39c265['env']||_0x416dfe(0x133);!_0x33bb87&&(console['error'](_0x416dfe(0x144)),logger['error'](_0x416dfe(0x12d),_0x416dfe(0x149)),process['exit'](0x1));console[_0x416dfe(0x132)](_0x416dfe(0x14b)),console[_0x416dfe(0x132)](_0x416dfe(0x131)+_0x33bb87),console['log'](_0x416dfe(0x138)+_0x26c9b9+'\x0a');const _0xe14278=_0x416dfe(0x13f),_0x2e0373='-e\x20LOVRABET_APP_CODE='+_0x33bb87,_0x2a6e89=_0x26c9b9===_0x416dfe(0x143)?_0x416dfe(0x14a):'',_0x34e8e0=(_0xe14278+'\x20'+_0x2e0373+'\x20'+_0x2a6e89)['trim']();console[_0x416dfe(0x132)](_0x416dfe(0x146)),console['log']('\x20\x20'+_0x34e8e0+'\x0a'),console['log'](_0x416dfe(0x14d)),console[_0x416dfe(0x132)]('\x20\x201.\x20重启\x20claude\x20code'),console[_0x416dfe(0x132)]('\x20\x202.\x20在\x20claude\x20code\x20中确认\x20lovrabet-dataset\x20MCP\x20服务器已加载\x0a'),logger[_0x416dfe(0x14c)](_0x416dfe(0x12d),_0x416dfe(0x139),{'appcode':_0x33bb87,'env':_0x26c9b9}),process[_0x416dfe(0x136)](0x0);}catch(_0x1092a7){logger['error'](_0x416dfe(0x12d),'配置失败',{'error':_0x1092a7 instanceof Error?_0x1092a7[_0x416dfe(0x13b)]:String(_0x1092a7)}),console[_0x416dfe(0x13d)](_0x416dfe(0x13c)+(_0x1092a7 instanceof Error?_0x1092a7['message']:String(_0x1092a7))),process[_0x416dfe(0x136)](0x1);}}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- function a51_0x6ac4(_0x52fe34,_0xdfbd21){_0x52fe34=_0x52fe34-0x13b;const _0x2d44f1=a51_0x2d44();let _0x6ac4b2=_0x2d44f1[_0x52fe34];return _0x6ac4b2;}(function(_0x5ccd05,_0x145365){const _0x2e48aa=a51_0x6ac4,_0x3677cd=_0x5ccd05();while(!![]){try{const _0x37c80a=parseInt(_0x2e48aa(0x170))/0x1+-parseInt(_0x2e48aa(0x160))/0x2*(-parseInt(_0x2e48aa(0x16e))/0x3)+-parseInt(_0x2e48aa(0x144))/0x4*(-parseInt(_0x2e48aa(0x16b))/0x5)+-parseInt(_0x2e48aa(0x15d))/0x6*(parseInt(_0x2e48aa(0x13e))/0x7)+-parseInt(_0x2e48aa(0x157))/0x8*(-parseInt(_0x2e48aa(0x14e))/0x9)+parseInt(_0x2e48aa(0x13c))/0xa*(parseInt(_0x2e48aa(0x145))/0xb)+-parseInt(_0x2e48aa(0x14c))/0xc;if(_0x37c80a===_0x145365)break;else _0x3677cd['push'](_0x3677cd['shift']());}catch(_0x9cfe78){_0x3677cd['push'](_0x3677cd['shift']());}}}(a51_0x2d44,0x587c7));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a51_0x2d44(){const _0x1ff478=['npx','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','✓\x20创建\x20.cursor\x20目录:\x20','lovrabet-dataset','未找到\x20appcode\x20配置','app','\x20\x20-\x20配置文件:\x20','配置\x20Cursor\x20MCP\x20成功','250MwGQSc','\x0a配置信息:','创建\x20.cursor\x20目录','193416SDfYPD','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','216150YgPEMd','info','parse','exit','更新现有\x20mcp.json\x20配置','33410yvYeBw','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','1029TfARDL','配置\x20Cursor\x20MCP\x20失败','online','\x20\x20-\x20环境:\x20','rules','mcp.json','42424pHDZVI','2233NeYUuL','复制\x20Cursor\x20Rules\x20文件','@lovrabet/dataset-mcp-server','Cursor\x20Rules\x20模板文件不存在','error','错误:\x20配置失败:\x20','复制\x20Cursor\x20Rules\x20文件失败','19297152FXDpoQ','mcpServers','18FNdPOB','log','cwd','utf8','.cursor','../../templates/rules/lovrabet_rules.mdc.tpl','env','\x20\x20-\x20AppCode:\x20','✓\x20创建\x20mcp.json\x20配置文件','2409672Oobuzo','解析现有\x20mcp.json\x20失败','stringify','mcp-cursor','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','message','25992ApGXal','warn','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','18OoSomE','创建\x20.cursor/rules\x20目录','错误:\x20解析现有\x20mcp.json\x20失败:\x20'];a51_0x2d44=function(){return _0x1ff478;};return a51_0x2d44();}export async function configureCursorMcp(){const _0x8c541=a51_0x6ac4;try{const _0x4f866a=process[_0x8c541(0x150)](),_0x34671d=resolve(_0x4f866a,_0x8c541(0x152)),_0x5aa6e6=resolve(_0x34671d,_0x8c541(0x143)),_0x280c2e=readConfig(),_0x1567d0=_0x280c2e['appcode']||_0x280c2e[_0x8c541(0x168)],_0x411a75=_0x280c2e[_0x8c541(0x154)]||_0x8c541(0x140);!_0x1567d0&&(console['error']('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x8c541(0x149)]('mcp-cursor',_0x8c541(0x167)),process[_0x8c541(0x173)](0x1));!existsSync(_0x34671d)&&(mkdirSync(_0x34671d,{'recursive':!![]}),logger['info'](_0x8c541(0x15a),_0x8c541(0x16d),{'path':_0x34671d}),console[_0x8c541(0x14f)](_0x8c541(0x165)+_0x34671d));const _0x40b1c5={'command':_0x8c541(0x163),'args':['-y',_0x8c541(0x147)],'env':{'LOVRABET_APP_CODE':String(_0x1567d0),'LOVRABET_ENV':String(_0x411a75)}};let _0xeeb35b;if(existsSync(_0x5aa6e6))try{const _0xe50029=readFileSync(_0x5aa6e6,_0x8c541(0x151));_0xeeb35b=JSON[_0x8c541(0x172)](_0xe50029),!_0xeeb35b[_0x8c541(0x14d)]&&(_0xeeb35b['mcpServers']={}),_0xeeb35b['mcpServers'][_0x8c541(0x166)]=_0x40b1c5,logger[_0x8c541(0x171)](_0x8c541(0x15a),_0x8c541(0x13b),{'path':_0x5aa6e6,'appcode':_0x1567d0,'env':_0x411a75}),console[_0x8c541(0x14f)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x4e87a3){logger[_0x8c541(0x149)](_0x8c541(0x15a),_0x8c541(0x158),{'error':_0x4e87a3 instanceof Error?_0x4e87a3[_0x8c541(0x15c)]:String(_0x4e87a3)}),console['error'](_0x8c541(0x162)+(_0x4e87a3 instanceof Error?_0x4e87a3[_0x8c541(0x15c)]:String(_0x4e87a3))),process[_0x8c541(0x173)](0x1);}else _0xeeb35b={'mcpServers':{'lovrabet-dataset':_0x40b1c5}},logger[_0x8c541(0x171)](_0x8c541(0x15a),'创建新的\x20mcp.json\x20配置',{'path':_0x5aa6e6,'appcode':_0x1567d0,'env':_0x411a75}),console[_0x8c541(0x14f)](_0x8c541(0x156));writeFileSync(_0x5aa6e6,JSON[_0x8c541(0x159)](_0xeeb35b,null,0x2),{'encoding':_0x8c541(0x151)});const _0x3fd4ec=resolve(_0x34671d,_0x8c541(0x142)),_0x5a743f=resolve(_0x3fd4ec,'lovrabet_rules.mdc');if(!existsSync(_0x5a743f))try{!existsSync(_0x3fd4ec)&&(mkdirSync(_0x3fd4ec,{'recursive':!![]}),logger[_0x8c541(0x171)]('mcp-cursor',_0x8c541(0x161),{'path':_0x3fd4ec}));const _0x2481df=fileURLToPath(import.meta.url),_0xa5e827=dirname(_0x2481df),_0x2abaf9=resolve(_0xa5e827,_0x8c541(0x153));existsSync(_0x2abaf9)?(copyFileSync(_0x2abaf9,_0x5a743f),logger[_0x8c541(0x171)]('mcp-cursor',_0x8c541(0x146),{'from':_0x2abaf9,'to':_0x5a743f}),console[_0x8c541(0x14f)](_0x8c541(0x164))):logger[_0x8c541(0x15e)](_0x8c541(0x15a),_0x8c541(0x148),{'templatePath':_0x2abaf9});}catch(_0x4424f0){logger['error']('mcp-cursor',_0x8c541(0x14b),{'error':_0x4424f0 instanceof Error?_0x4424f0[_0x8c541(0x15c)]:String(_0x4424f0)}),console['warn'](_0x8c541(0x15f)+(_0x4424f0 instanceof Error?_0x4424f0[_0x8c541(0x15c)]:String(_0x4424f0)));}else console[_0x8c541(0x14f)](_0x8c541(0x15b)),logger[_0x8c541(0x171)](_0x8c541(0x15a),'Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x5a743f});console[_0x8c541(0x14f)]('\x0a✓\x20Cursor\x20MCP\x20配置成功!'),console[_0x8c541(0x14f)](_0x8c541(0x16c)),console[_0x8c541(0x14f)](_0x8c541(0x155)+_0x1567d0),console[_0x8c541(0x14f)](_0x8c541(0x141)+_0x411a75),console[_0x8c541(0x14f)](_0x8c541(0x169)+_0x5aa6e6),console['log'](_0x8c541(0x16f)),console[_0x8c541(0x14f)](_0x8c541(0x13d)),logger['info'](_0x8c541(0x15a),_0x8c541(0x16a),{'appcode':_0x1567d0,'env':_0x411a75,'configPath':_0x5aa6e6}),process[_0x8c541(0x173)](0x0);}catch(_0xe5a76f){logger[_0x8c541(0x149)](_0x8c541(0x15a),_0x8c541(0x13f),{'error':_0xe5a76f instanceof Error?_0xe5a76f[_0x8c541(0x15c)]:String(_0xe5a76f)}),console[_0x8c541(0x149)](_0x8c541(0x14a)+(_0xe5a76f instanceof Error?_0xe5a76f[_0x8c541(0x15c)]:String(_0xe5a76f))),process[_0x8c541(0x173)](0x1);}}
1
+ (function(_0x2d921f,_0x43410b){const _0x4068dc=a52_0x3571,_0x26b710=_0x2d921f();while(!![]){try{const _0x537b85=-parseInt(_0x4068dc(0x97))/0x1*(-parseInt(_0x4068dc(0x7e))/0x2)+parseInt(_0x4068dc(0x81))/0x3*(parseInt(_0x4068dc(0xa1))/0x4)+-parseInt(_0x4068dc(0xa5))/0x5+-parseInt(_0x4068dc(0x9e))/0x6*(-parseInt(_0x4068dc(0x7f))/0x7)+-parseInt(_0x4068dc(0x8a))/0x8+parseInt(_0x4068dc(0x87))/0x9*(parseInt(_0x4068dc(0xa4))/0xa)+parseInt(_0x4068dc(0x7b))/0xb*(-parseInt(_0x4068dc(0x90))/0xc);if(_0x537b85===_0x43410b)break;else _0x26b710['push'](_0x26b710['shift']());}catch(_0x49bd9f){_0x26b710['push'](_0x26b710['shift']());}}}(a52_0x2641,0x4a8a0));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';function a52_0x2641(){const _0x54b14d=['lovrabet_rules.mdc','✓\x20更新\x20mcp.json\x20配置','9ZqxaIT','rules','appcode','592928dfJLpm','\x0a✓\x20Cursor\x20MCP\x20配置成功!','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','Cursor\x20Rules\x20模板文件不存在','exit','更新现有\x20mcp.json\x20配置','30684OfKTGL','复制\x20Cursor\x20Rules\x20文件','错误:\x20配置失败:\x20','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','utf8','\x0a配置信息:','解析现有\x20mcp.json\x20失败','142271XqVCRW','\x20\x20-\x20环境:\x20','创建新的\x20mcp.json\x20配置','cwd','✓\x20创建\x20.cursor\x20目录:\x20','stringify','app','50574GysWCe','未找到\x20appcode\x20配置','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','4KeWLrn','online','warn','1110300NlpwPl','920550bhXEzD','parse','✓\x20创建\x20mcp.json\x20配置文件','error','log','message','info','复制\x20Cursor\x20Rules\x20文件失败','mcp-cursor','创建\x20.cursor/rules\x20目录','创建\x20.cursor\x20目录','Cursor\x20Rules\x20文件已存在,跳过','配置\x20Cursor\x20MCP\x20成功','2123PQaZTc','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','4aeLdux','476EjfUbJ','.cursor','264885kQzcvf','错误:\x20解析现有\x20mcp.json\x20失败:\x20','mcp.json','\x20\x20-\x20配置文件:\x20'];a52_0x2641=function(){return _0x54b14d;};return a52_0x2641();}import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a52_0x3571(_0x5a5397,_0x16de00){_0x5a5397=_0x5a5397-0x7a;const _0x2641d5=a52_0x2641();let _0x357173=_0x2641d5[_0x5a5397];return _0x357173;}import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x3501a2=a52_0x3571;try{const _0x35dfc5=process[_0x3501a2(0x9a)](),_0x52ba1e=resolve(_0x35dfc5,_0x3501a2(0x80)),_0x265e68=resolve(_0x52ba1e,_0x3501a2(0x83)),_0x464a92=readConfig(),_0x5daa91=_0x464a92[_0x3501a2(0x89)]||_0x464a92[_0x3501a2(0x9d)],_0x4383ce=_0x464a92['env']||_0x3501a2(0xa2);!_0x5daa91&&(console[_0x3501a2(0xa8)]('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger['error'](_0x3501a2(0xad),_0x3501a2(0x9f)),process[_0x3501a2(0x8e)](0x1));!existsSync(_0x52ba1e)&&(mkdirSync(_0x52ba1e,{'recursive':!![]}),logger[_0x3501a2(0xab)](_0x3501a2(0xad),_0x3501a2(0xaf),{'path':_0x52ba1e}),console[_0x3501a2(0xa9)](_0x3501a2(0x9b)+_0x52ba1e));const _0x5c0ab2={'command':'npx','args':['-y','@lovrabet/dataset-mcp-server'],'env':{'LOVRABET_APP_CODE':String(_0x5daa91),'LOVRABET_ENV':String(_0x4383ce)}};let _0x1a4f37;if(existsSync(_0x265e68))try{const _0x72ad08=readFileSync(_0x265e68,_0x3501a2(0x94));_0x1a4f37=JSON[_0x3501a2(0xa6)](_0x72ad08),!_0x1a4f37['mcpServers']&&(_0x1a4f37['mcpServers']={}),_0x1a4f37['mcpServers']['lovrabet-dataset']=_0x5c0ab2,logger[_0x3501a2(0xab)]('mcp-cursor',_0x3501a2(0x8f),{'path':_0x265e68,'appcode':_0x5daa91,'env':_0x4383ce}),console[_0x3501a2(0xa9)](_0x3501a2(0x86));}catch(_0x4c5e4c){logger[_0x3501a2(0xa8)]('mcp-cursor',_0x3501a2(0x96),{'error':_0x4c5e4c instanceof Error?_0x4c5e4c['message']:String(_0x4c5e4c)}),console[_0x3501a2(0xa8)](_0x3501a2(0x82)+(_0x4c5e4c instanceof Error?_0x4c5e4c[_0x3501a2(0xaa)]:String(_0x4c5e4c))),process[_0x3501a2(0x8e)](0x1);}else _0x1a4f37={'mcpServers':{'lovrabet-dataset':_0x5c0ab2}},logger['info']('mcp-cursor',_0x3501a2(0x99),{'path':_0x265e68,'appcode':_0x5daa91,'env':_0x4383ce}),console[_0x3501a2(0xa9)](_0x3501a2(0xa7));writeFileSync(_0x265e68,JSON[_0x3501a2(0x9c)](_0x1a4f37,null,0x2),{'encoding':_0x3501a2(0x94)});const _0x51797e=resolve(_0x52ba1e,_0x3501a2(0x88)),_0x56417c=resolve(_0x51797e,_0x3501a2(0x85));if(!existsSync(_0x56417c))try{!existsSync(_0x51797e)&&(mkdirSync(_0x51797e,{'recursive':!![]}),logger[_0x3501a2(0xab)]('mcp-cursor',_0x3501a2(0xae),{'path':_0x51797e}));const _0x31c0d3=fileURLToPath(import.meta.url),_0x42c6cb=dirname(_0x31c0d3),_0x3c44b6=resolve(_0x42c6cb,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x3c44b6)?(copyFileSync(_0x3c44b6,_0x56417c),logger[_0x3501a2(0xab)](_0x3501a2(0xad),_0x3501a2(0x91),{'from':_0x3c44b6,'to':_0x56417c}),console[_0x3501a2(0xa9)](_0x3501a2(0x7c))):logger[_0x3501a2(0xa3)](_0x3501a2(0xad),_0x3501a2(0x8d),{'templatePath':_0x3c44b6});}catch(_0x3c7ddf){logger[_0x3501a2(0xa8)](_0x3501a2(0xad),_0x3501a2(0xac),{'error':_0x3c7ddf instanceof Error?_0x3c7ddf[_0x3501a2(0xaa)]:String(_0x3c7ddf)}),console[_0x3501a2(0xa3)](_0x3501a2(0xa0)+(_0x3c7ddf instanceof Error?_0x3c7ddf[_0x3501a2(0xaa)]:String(_0x3c7ddf)));}else console[_0x3501a2(0xa9)](_0x3501a2(0x8c)),logger[_0x3501a2(0xab)]('mcp-cursor',_0x3501a2(0xb0),{'path':_0x56417c});console[_0x3501a2(0xa9)](_0x3501a2(0x8b)),console[_0x3501a2(0xa9)](_0x3501a2(0x95)),console[_0x3501a2(0xa9)]('\x20\x20-\x20AppCode:\x20'+_0x5daa91),console[_0x3501a2(0xa9)](_0x3501a2(0x98)+_0x4383ce),console[_0x3501a2(0xa9)](_0x3501a2(0x84)+_0x265e68),console['log'](_0x3501a2(0x7d)),console[_0x3501a2(0xa9)](_0x3501a2(0x93)),logger[_0x3501a2(0xab)]('mcp-cursor',_0x3501a2(0x7a),{'appcode':_0x5daa91,'env':_0x4383ce,'configPath':_0x265e68}),process[_0x3501a2(0x8e)](0x0);}catch(_0x16a135){logger[_0x3501a2(0xa8)](_0x3501a2(0xad),'配置\x20Cursor\x20MCP\x20失败',{'error':_0x16a135 instanceof Error?_0x16a135[_0x3501a2(0xaa)]:String(_0x16a135)}),console[_0x3501a2(0xa8)](_0x3501a2(0x92)+(_0x16a135 instanceof Error?_0x16a135[_0x3501a2(0xaa)]:String(_0x16a135))),process[_0x3501a2(0x8e)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- function a52_0x4fd6(_0x3e2e1c,_0x84a91a){_0x3e2e1c=_0x3e2e1c-0x1a3;var _0x4542b6=a52_0x4542();var _0x4fd603=_0x4542b6[_0x3e2e1c];return _0x4fd603;}(function(_0x4561d1,_0x407706){var _0x3c2a12=a52_0x4fd6,_0x43c0b5=_0x4561d1();while(!![]){try{var _0x2b7f78=-parseInt(_0x3c2a12(0x1aa))/0x1+parseInt(_0x3c2a12(0x1ae))/0x2*(parseInt(_0x3c2a12(0x1b5))/0x3)+parseInt(_0x3c2a12(0x1b8))/0x4*(parseInt(_0x3c2a12(0x1a3))/0x5)+-parseInt(_0x3c2a12(0x1a7))/0x6*(parseInt(_0x3c2a12(0x1af))/0x7)+parseInt(_0x3c2a12(0x1bc))/0x8+parseInt(_0x3c2a12(0x1b3))/0x9*(-parseInt(_0x3c2a12(0x1b4))/0xa)+parseInt(_0x3c2a12(0x1a9))/0xb*(parseInt(_0x3c2a12(0x1b2))/0xc);if(_0x2b7f78===_0x407706)break;else _0x43c0b5['push'](_0x43c0b5['shift']());}catch(_0x5c6405){_0x43c0b5['push'](_0x43c0b5['shift']());}}}(a52_0x4542,0x2752e));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x16fe18){var _0x156513=a52_0x4fd6;logger[_0x156513(0x1ad)](process['cwd']());if(!_0x16fe18){console['error']('错误:\x20请指定\x20IDE\x20类型'),console[_0x156513(0x1a4)](_0x156513(0x1b6)),console[_0x156513(0x1a4)]('\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP'),console[_0x156513(0x1a4)]('\x0a示例:'),console[_0x156513(0x1a4)](_0x156513(0x1b1)),logger[_0x156513(0x1a6)](_0x156513(0x1bb),_0x156513(0x1ba)),process['exit'](0x1);return;}switch(_0x16fe18[_0x156513(0x1ab)]()){case _0x156513(0x1b0):logger['info'](_0x156513(0x1bb),_0x156513(0x1b9)),await configureCursorMcp();break;default:console[_0x156513(0x1a6)](_0x156513(0x1a5)+_0x16fe18),console['log'](_0x156513(0x1bd)),console[_0x156513(0x1a4)](_0x156513(0x1b7)),logger[_0x156513(0x1a6)]('mcp',_0x156513(0x1ac)+_0x16fe18),process[_0x156513(0x1a8)](0x1);break;}}function a52_0x4542(){var _0x5677f8=['\x20\x20lovrabet\x20mcp\x20cursor','640368jlgYBN','47106lxkTWg','590KjQehb','891045mXHygN','\x0a使用方法:','\x20\x20-\x20cursor','1940sBqrLK','执行配置\x20Cursor\x20MCP\x20命令','未指定\x20IDE\x20类型','mcp','1161704uHqRir','\x0a当前支持的\x20IDE:','2275ADkcTB','log','错误:\x20不支持的\x20IDE\x20类型:\x20','error','16314LPDvhs','exit','33lHsGkp','276987RcurxE','toLowerCase','不支持的\x20IDE\x20类型:\x20','setLogPath','2WdbvUw','196wCxcOS','cursor'];a52_0x4542=function(){return _0x5677f8;};return a52_0x4542();}
1
+ function a53_0xfebb(_0x8fa39c,_0x504b2d){_0x8fa39c=_0x8fa39c-0x10b;const _0x58204d=a53_0x5820();let _0xfebbb2=_0x58204d[_0x8fa39c];return _0xfebbb2;}const a53_0x37d05b=a53_0xfebb;(function(_0x42230e,_0x2ff8ef){const _0x4550f3=a53_0xfebb,_0x61a6ef=_0x42230e();while(!![]){try{const _0x5de5fd=parseInt(_0x4550f3(0x112))/0x1*(parseInt(_0x4550f3(0x132))/0x2)+parseInt(_0x4550f3(0x11f))/0x3+parseInt(_0x4550f3(0x133))/0x4+parseInt(_0x4550f3(0x11b))/0x5*(-parseInt(_0x4550f3(0x126))/0x6)+parseInt(_0x4550f3(0x10d))/0x7*(parseInt(_0x4550f3(0x131))/0x8)+parseInt(_0x4550f3(0x10e))/0x9*(-parseInt(_0x4550f3(0x122))/0xa)+parseInt(_0x4550f3(0x12d))/0xb*(-parseInt(_0x4550f3(0x115))/0xc);if(_0x5de5fd===_0x2ff8ef)break;else _0x61a6ef['push'](_0x61a6ef['shift']());}catch(_0x17c8c6){_0x61a6ef['push'](_0x61a6ef['shift']());}}}(a53_0x5820,0x1a9e3));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';const IDE_CONFIGS={'cursor':{'name':a53_0x37d05b(0x12f),'description':'Cursor\x20IDE'},'claude':{'name':'claude\x20code','description':a53_0x37d05b(0x10f)}};function a53_0x5820(){const _0x8f15f=['cursor','1OtcDjE','(空)','\x0a可用命令:','9156sQgytR','install','log','\x0a📦\x20正在配置\x20','claude','\x20\x20lovrabet\x20mcp\x20install\x20<ide>\x20\x20\x20\x20#\x20安装\x20MCP\x20配置','5jfjWwz','mcp-install','name','\x0a支持的平台:\x20cursor,\x20claude\x0a','594360muYkzK','help','错误:\x20不支持的平台:\x20','20YNumpM','message','\x0a请指定要配置的平台:\x0a','error','544218AFMGlD','\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE','错误:\x20不支持的命令:\x20','setLogPath','不支持的命令:\x20','exit','支持的平台:','4565Aalrii','cwd','Cursor','--help','40248asNpMz','93038GCmARR','627244IZmgFz','\x0aLovrabet\x20MCP\x20-\x20MCP\x20服务器配置工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x0a安装\x20MCP\x20配置:\x0a\x20\x20lovrabet\x20mcp\x20install\x20<ide>\x20\x20\x20\x20\x20\x20\x20安装\x20MCP\x20配置到\x20IDE\x0a\x0a支持的平台:\x0a\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE\x0a\x20\x20\x20\x20└──\x20自动配置\x20.cursor/mcp.json\x0a\x0a\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a\x20\x20\x20\x20└──\x20输出手动配置命令(需手动执行)\x0a\x0a示例:\x0a\x20\x20lovrabet\x20mcp\x20install\x20cursor\x20\x20\x20\x20\x20\x20\x20#\x20配置\x20Cursor\x20的\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20claude\x20\x20\x20\x20\x20\x20\x20#\x20输出\x20claude\x20code\x20的\x20MCP\x20配置命令\x0a\x0a配置后:\x0a\x20\x20-\x20Cursor:\x20重启\x20IDE\x20即可使用\x0a\x20\x20-\x20claude\x20code:\x20手动执行输出的命令\x0a','toLowerCase','273oyHGms','365778EhsJMn','claude\x20code','\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a'];a53_0x5820=function(){return _0x8f15f;};return a53_0x5820();}export async function mcpCommand(_0x45cb87,_0x1e2cac,_0x5d2c09){const _0xe9b0d8=a53_0x37d05b;logger[_0xe9b0d8(0x129)](process[_0xe9b0d8(0x12e)]());if(_0x5d2c09?.[_0xe9b0d8(0x120)]||_0x45cb87===_0xe9b0d8(0x130)){showHelp();return;}_0x45cb87!==_0xe9b0d8(0x116)&&(console[_0xe9b0d8(0x125)](_0xe9b0d8(0x128)+(_0x45cb87||_0xe9b0d8(0x113))),console[_0xe9b0d8(0x117)](_0xe9b0d8(0x114)),console[_0xe9b0d8(0x117)](_0xe9b0d8(0x11a)),console[_0xe9b0d8(0x117)](_0xe9b0d8(0x110)),console[_0xe9b0d8(0x117)](_0xe9b0d8(0x12c)),console[_0xe9b0d8(0x117)](_0xe9b0d8(0x127)),console[_0xe9b0d8(0x117)]('\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a'),logger[_0xe9b0d8(0x125)]('mcp',_0xe9b0d8(0x12a)+_0x45cb87),process[_0xe9b0d8(0x12b)](0x1)),await installMcp(_0x1e2cac?.[0x0]);}function showHelp(){const _0x239db9=a53_0x37d05b;console[_0x239db9(0x117)](_0x239db9(0x10b));}async function installMcp(_0x28f28){const _0x457751=a53_0x37d05b;!_0x28f28&&(console[_0x457751(0x117)](_0x457751(0x124)),console[_0x457751(0x117)]('\x20\x20lovrabet\x20mcp\x20install\x20cursor\x20\x20\x20\x20#\x20Cursor\x20IDE'),console[_0x457751(0x117)]('\x20\x20lovrabet\x20mcp\x20install\x20claude\x20\x20\x20\x20#\x20claude\x20code\x0a'),process[_0x457751(0x12b)](0x1));const _0x510ded=_0x28f28[_0x457751(0x10c)]();!IDE_CONFIGS[_0x510ded]&&(console[_0x457751(0x125)](_0x457751(0x121)+_0x28f28),console[_0x457751(0x117)](_0x457751(0x11e)),process[_0x457751(0x12b)](0x1));try{console[_0x457751(0x117)](_0x457751(0x118)+IDE_CONFIGS[_0x510ded][_0x457751(0x11d)]+'\x20MCP...\x0a');switch(_0x510ded){case _0x457751(0x111):await configureCursorMcp();break;case _0x457751(0x119):await configureClaudeMcp();break;}}catch(_0x40690d){logger[_0x457751(0x125)](_0x457751(0x11c),'配置失败',{'error':_0x40690d instanceof Error?_0x40690d[_0x457751(0x123)]:String(_0x40690d)}),console[_0x457751(0x125)]('\x0a错误:\x20配置失败\x20-\x20'+(_0x40690d instanceof Error?_0x40690d[_0x457751(0x123)]:String(_0x40690d))+'\x0a'),process[_0x457751(0x12b)](0x1);}}
@@ -0,0 +1 @@
1
+ const a54_0x201853=a54_0x1fe4;(function(_0xec7c9,_0x55f6c8){const _0x4061a0=a54_0x1fe4,_0x52fa14=_0xec7c9();while(!![]){try{const _0x97296e=parseInt(_0x4061a0(0xb6))/0x1*(-parseInt(_0x4061a0(0xb7))/0x2)+-parseInt(_0x4061a0(0xa8))/0x3+parseInt(_0x4061a0(0xb8))/0x4*(-parseInt(_0x4061a0(0xc5))/0x5)+-parseInt(_0x4061a0(0xb5))/0x6+parseInt(_0x4061a0(0xba))/0x7+parseInt(_0x4061a0(0xa4))/0x8+parseInt(_0x4061a0(0xc8))/0x9*(parseInt(_0x4061a0(0xb3))/0xa);if(_0x97296e===_0x55f6c8)break;else _0x52fa14['push'](_0x52fa14['shift']());}catch(_0x10b02a){_0x52fa14['push'](_0x52fa14['shift']());}}}(a54_0xd5d9,0xcc60a));import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';function a54_0xd5d9(){const _0x1a9a00=['cursor','.lovrabet/skill-manifest.json','\x0a可用命令:','exit','claude\x20code\x20(.claude/skills/)','支持的平台:','\x0a请指定要安装的平台:\x0a','Cursor','开发者指南位置:','install','isDirectory','不支持的命令:\x20','\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a','(空)','安装成功','13291120btHmOg','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20#\x20安装技能包到项目','.claude','错误:\x20不支持的平台:\x20','4391685XowHmD','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20#\x20Cursor\x20IDE','\x0a📦\x20正在安装\x20Lovrabet\x20技能包...\x0a','目标平台:\x20','message','\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','info','.lovrabet','.cursorrules','2.0.0','10CANneu','.cursor','5490162XDdvTm','8BQFOtf','51566sLWrxi','1900STdkhh','\x20\x20lovrabet\x20skill\x20install\x20windsurf\x20#\x20Windsurf\x20IDE','805714aQLNKO','\x20\x20-\x20.windsurf/workflows/lovrabet.md\x20文件已安装\x0a','.shared','skill-install','claude','\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE','folders','cwd','log','help','\x20\x20windsurf\x20-\x20Windsurf\x20IDE','7415mnpOOO','name','setLogPath','21152241SmZAyu','warn','.lovrabet/skill/.shared','\x20\x20-\x20.cursorrules\x20文件已创建,Cursor\x20会自动读取','windsurf','claude\x20code','Windsurf\x20使用说明:','\x0aLovrabet\x20Skill\x20-\x20开发者技能包安装工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x0a安装技能包:\x0a\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20安装技能包到项目\x0a\x0a支持的平台:\x0a\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE\x0a\x20\x20\x20\x20└──\x20安装\x20.cursorrules\x20和\x20.cursor/commands/\x0a\x0a\x20\x20windsurf\x20-\x20Windsurf\x20IDE\x0a\x20\x20\x20\x20└──\x20安装\x20.windsurf/workflows/\x0a\x0a\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a\x20\x20\x20\x20└──\x20安装\x20.claude/skills/\x0a\x0a技能包内容包括:\x0a\x20\x20-\x20Filter\x20查询构建规范\x20(10\x20种常见错误对照)\x0a\x20\x20-\x20MCP\x20SQL\x20创建工作流\x20(5\x20步强制流程)\x0a\x20\x20-\x20AntD\x20UI\x20开发规范\x20(禁止\x20AI\x20味道)\x0a\x20\x20-\x20API\x20集成指南\x20(lovrabet\x20api\x20pull\x20流程)\x0a\x20\x20-\x20菜单管理指南\x20(menu\x20sync/update\x20流程)\x0a\x0a示例:\x0a\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20#\x20安装\x20Cursor\x20规则\x0a\x20\x20lovrabet\x20skill\x20install\x20windsurf\x20#\x20安装\x20Windsurf\x20规则\x0a\x20\x20lovrabet\x20skill\x20install\x20claude\x20\x20\x20#\x20安装\x20claude\x20code\x20规则\x0a\x0a安装后会在项目中创建:\x0a\x20\x20-\x20.cursorrules\x20或\x20.windsurf/workflows/\x20或\x20.claude/skills/\x0a\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20\x20-\x20开发者技能指南\x0a\x0a开发者指南位置:\x0a\x20\x20.lovrabet/skill/.shared/guides/01-filter-query/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/02-mcp-sql-workflow/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/03-antd-style/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/05-api-integration/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/06-menu-management/guide.md\x0a\x20\x20','\x0a错误:\x20安装失败\x20-\x20','\x0a✓\x20技能包安装成功!\x0a','../../templates/skills','error','utf-8','✓\x20复制\x20','\x20\x20lovrabet\x20skill\x20install\x20claude\x20\x20\x20#\x20claude\x20code\x0a','✓\x20复制\x20.lovrabet/skill/.shared/'];a54_0xd5d9=function(){return _0x1a9a00;};return a54_0xd5d9();}const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a54_0x201853(0x9c),'description':a54_0x201853(0xae),'folders':[a54_0x201853(0xb1),a54_0x201853(0xb4)]},'windsurf':{'name':'Windsurf','description':'Windsurf\x20IDE\x20(.windsurf/workflows/)','folders':['.windsurf']},'claude':{'name':a54_0x201853(0x8a),'description':a54_0x201853(0x99),'folders':[a54_0x201853(0xa6)]}};export async function skillsCommand(_0x284b4f,_0x531be3,_0x3b5a88){const _0x5c05f9=a54_0x201853;logger[_0x5c05f9(0xc7)](process[_0x5c05f9(0xc1)]());if(_0x3b5a88?.[_0x5c05f9(0xc3)]||_0x284b4f==='--help'){showHelp();return;}_0x284b4f!==_0x5c05f9(0x9e)&&(console[_0x5c05f9(0x90)]('错误:\x20不支持的命令:\x20'+(_0x284b4f||_0x5c05f9(0xa2))),console[_0x5c05f9(0xc2)](_0x5c05f9(0x97)),console['log'](_0x5c05f9(0xa5)),console[_0x5c05f9(0xc2)]('\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a'),console['log'](_0x5c05f9(0x9a)),console[_0x5c05f9(0xc2)](_0x5c05f9(0xbf)),console[_0x5c05f9(0xc2)](_0x5c05f9(0xc4)),console[_0x5c05f9(0xc2)](_0x5c05f9(0xa1)),logger['error']('skill',_0x5c05f9(0xa0)+_0x284b4f),process['exit'](0x1)),await installSkill(_0x531be3?.[0x0]);}function a54_0x1fe4(_0x26f65b,_0x4ecfee){_0x26f65b=_0x26f65b-0x86;const _0xd5d9ee=a54_0xd5d9();let _0x1fe42c=_0xd5d9ee[_0x26f65b];return _0x1fe42c;}function showHelp(){const _0x252f99=a54_0x201853;console[_0x252f99(0xc2)](_0x252f99(0x8c));}async function copyDir(_0x54db74,_0x2d146c){const _0x4443cd=a54_0x201853,_0x1263d4=statSync(_0x54db74);if(_0x1263d4[_0x4443cd(0x9f)]()){!existsSync(_0x2d146c)&&mkdirSync(_0x2d146c,{'recursive':!![]});const _0x285a36=readdirSync(_0x54db74);for(const _0x5093fc of _0x285a36){await copyDir(join(_0x54db74,_0x5093fc),join(_0x2d146c,_0x5093fc));}}else copyFileSync(_0x54db74,_0x2d146c);}async function installSkill(_0x7262fc){const _0x160468=a54_0x201853,_0x15ba86=process[_0x160468(0xc1)]();!_0x7262fc&&(console[_0x160468(0xc2)](_0x160468(0x9b)),console['log'](_0x160468(0xa9)),console[_0x160468(0xc2)](_0x160468(0xb9)),console['log'](_0x160468(0x93)),process[_0x160468(0x98)](0x1));!IDE_CONFIGS[_0x7262fc]&&(console[_0x160468(0x90)](_0x160468(0xa7)+_0x7262fc),console['log']('\x0a支持的平台:\x20cursor,\x20windsurf,\x20claude\x0a'),process[_0x160468(0x98)](0x1));try{console[_0x160468(0xc2)](_0x160468(0xaa)),console['log'](_0x160468(0xab)+IDE_CONFIGS[_0x7262fc][_0x160468(0xc6)]+'\x0a');const _0x107453=resolve(__dirname,_0x160468(0x8f));let _0x10c2dc=0x0;for(const _0x2d583b of IDE_CONFIGS[_0x7262fc][_0x160468(0xc0)]){const _0x5a00cc=join(_0x107453,_0x2d583b),_0x1f2d14=join(_0x15ba86,_0x2d583b);if(!existsSync(_0x5a00cc)){logger[_0x160468(0x86)](_0x160468(0xbd),'模板不存在:\x20'+_0x5a00cc);continue;}await copyDir(_0x5a00cc,_0x1f2d14),_0x10c2dc++,console[_0x160468(0xc2)](_0x160468(0x92)+_0x2d583b+'/');}const _0x55502f=join(_0x107453,_0x160468(0xbc)),_0x400ff6=join(_0x15ba86,_0x160468(0x87));existsSync(_0x55502f)&&(await copyDir(_0x55502f,_0x400ff6),_0x10c2dc++,console[_0x160468(0xc2)](_0x160468(0x94)));const _0x27efaa={'version':_0x160468(0xb2),'installedAt':new Date()['toISOString'](),'platform':_0x7262fc},_0xe26693=join(_0x15ba86,_0x160468(0x96));!existsSync(join(_0x15ba86,_0x160468(0xb0)))&&mkdirSync(join(_0x15ba86,_0x160468(0xb0)),{'recursive':!![]});writeFileSync(_0xe26693,JSON['stringify'](_0x27efaa,null,0x2),_0x160468(0x91)),console['log']('✓\x20创建\x20.lovrabet/skill-manifest.json'),console['log'](_0x160468(0x8e));switch(_0x7262fc){case _0x160468(0x95):console[_0x160468(0xc2)]('Cursor\x20使用说明:'),console[_0x160468(0xc2)](_0x160468(0x88)),console[_0x160468(0xc2)]('\x20\x20-\x20.cursor/commands/lovrabet.md\x20也已安装,可通过\x20@lovrabet\x20直接调用\x0a'),console['log'](_0x160468(0x9d)),console[_0x160468(0xc2)](_0x160468(0xad));break;case _0x160468(0x89):console[_0x160468(0xc2)](_0x160468(0x8b)),console[_0x160468(0xc2)](_0x160468(0xbb)),console[_0x160468(0xc2)]('开发者指南位置:'),console[_0x160468(0xc2)]('\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a');break;case _0x160468(0xbe):console['log']('claude\x20code\x20使用说明:'),console['log']('\x20\x20-\x20.claude/skills/lovrabet/SKILL.md\x20文件已安装'),console[_0x160468(0xc2)]('\x20\x20-\x20在\x20claude\x20code\x20设置中添加此技能,即可使用\x0a'),console[_0x160468(0xc2)](_0x160468(0x9d)),console[_0x160468(0xc2)](_0x160468(0xad));break;}logger[_0x160468(0xaf)](_0x160468(0xbd),_0x160468(0xa3),{'projectRoot':_0x15ba86,'ide':_0x7262fc,'foldersCount':_0x10c2dc});}catch(_0x3f0182){logger[_0x160468(0x90)](_0x160468(0xbd),'安装失败',{'error':_0x3f0182 instanceof Error?_0x3f0182[_0x160468(0xac)]:String(_0x3f0182)}),console[_0x160468(0x90)](_0x160468(0x8d)+(_0x3f0182 instanceof Error?_0x3f0182[_0x160468(0xac)]:String(_0x3f0182))+'\x0a'),process['exit'](0x1);}}
@@ -1 +1 @@
1
- (function(_0x32ec17,_0x2062a2){const _0x313310=a54_0x7a51,_0x102e86=_0x32ec17();while(!![]){try{const _0x8df29f=-parseInt(_0x313310(0x19c))/0x1+parseInt(_0x313310(0x18d))/0x2*(-parseInt(_0x313310(0x188))/0x3)+parseInt(_0x313310(0x193))/0x4+parseInt(_0x313310(0x18e))/0x5*(-parseInt(_0x313310(0x199))/0x6)+parseInt(_0x313310(0x19a))/0x7+parseInt(_0x313310(0x18f))/0x8+-parseInt(_0x313310(0x184))/0x9*(-parseInt(_0x313310(0x194))/0xa);if(_0x8df29f===_0x2062a2)break;else _0x102e86['push'](_0x102e86['shift']());}catch(_0x59ebb1){_0x102e86['push'](_0x102e86['shift']());}}}(a54_0x50f1,0xaa0bd));import a54_0x5e0061 from'node:fs';import a54_0x389c03 from'node:path';import a54_0x47cc88 from'semver';const MIN_SDK_VERSION='1.2.0';export function checkSdkVersion(_0x1339b9){const _0x52d90a=a54_0x7a51,_0xad50c4=a54_0x389c03[_0x52d90a(0x183)](_0x1339b9,_0x52d90a(0x186));if(!a54_0x5e0061['existsSync'](_0xad50c4))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x2795c9=JSON[_0x52d90a(0x195)](a54_0x5e0061[_0x52d90a(0x19b)](_0xad50c4,_0x52d90a(0x192))),_0x2e4011=_0x2795c9['dependencies']||{},_0xb4b2e2=_0x2795c9['devDependencies']||{},_0x521011=_0x2e4011[_0x52d90a(0x185)]||_0xb4b2e2[_0x52d90a(0x185)];if(!_0x521011)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x5229a0=a54_0x47cc88[_0x52d90a(0x18a)](_0x521011),_0x2ff145=_0x5229a0?a54_0x47cc88['lt'](_0x5229a0,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x521011,'needsUpgrade':_0x2ff145,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}function a54_0x7a51(_0x18176a,_0x169987){_0x18176a=_0x18176a-0x180;const _0x50f1bb=a54_0x50f1();let _0x7a519e=_0x50f1bb[_0x18176a];return _0x7a519e;}function a54_0x50f1(){const _0x2f2c77=['7464656jsVruP','\x1b[0m','needsUpgrade','utf8','2050728ZeELar','10TZHJCt','parse','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','\x1b[1m','\x20\x20\x20请升级\x20SDK\x20至\x20','404292KsWyGJ','3376975FaFtAd','readFileSync','729794UEQgho','log','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','minVersion','join','9060372BhqSGx','@lovrabet/sdk','package.json','version','12brCVxU','\x1b[33m','coerce','\x20不支持新协议。','⚠️\x20\x20SDK\x20版本不兼容','585842oOQZBe','25YjWwyA'];a54_0x50f1=function(){return _0x2f2c77;};return a54_0x50f1();}export function printSdkUpgradeWarning(_0x5d779a){const _0x5d528f=a54_0x7a51;if(!_0x5d779a[_0x5d528f(0x191)])return;const _0x55e97c=_0x5d528f(0x189),_0x220d57=_0x5d528f(0x190),_0x1d10c4=_0x5d528f(0x197);console[_0x5d528f(0x180)](),console[_0x5d528f(0x180)](''+_0x55e97c+_0x1d10c4+_0x5d528f(0x18c)+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x181)+_0x5d779a[_0x5d528f(0x187)]+_0x5d528f(0x18b)+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x198)+_0x5d779a[_0x5d528f(0x182)]+'\x20或更高版本:'+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+'\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest'+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x196)+_0x220d57),console['log']();}
1
+ const a56_0x428672=a56_0x2401;(function(_0x4ac2ae,_0x5cd08d){const _0x2040a3=a56_0x2401,_0x369bf8=_0x4ac2ae();while(!![]){try{const _0x53bf19=-parseInt(_0x2040a3(0x14e))/0x1*(parseInt(_0x2040a3(0x154))/0x2)+-parseInt(_0x2040a3(0x160))/0x3+parseInt(_0x2040a3(0x14c))/0x4*(-parseInt(_0x2040a3(0x15f))/0x5)+-parseInt(_0x2040a3(0x155))/0x6+parseInt(_0x2040a3(0x164))/0x7*(-parseInt(_0x2040a3(0x15c))/0x8)+-parseInt(_0x2040a3(0x161))/0x9*(-parseInt(_0x2040a3(0x151))/0xa)+-parseInt(_0x2040a3(0x15e))/0xb*(-parseInt(_0x2040a3(0x150))/0xc);if(_0x53bf19===_0x5cd08d)break;else _0x369bf8['push'](_0x369bf8['shift']());}catch(_0x532f97){_0x369bf8['push'](_0x369bf8['shift']());}}}(a56_0x2043,0x9c444));import a56_0xb09cb6 from'node:fs';import a56_0x1e45d7 from'node:path';function a56_0x2401(_0x595e90,_0x362a26){_0x595e90=_0x595e90-0x14c;const _0x2043e7=a56_0x2043();let _0x2401ce=_0x2043e7[_0x595e90];return _0x2401ce;}import a56_0x11fc07 from'semver';const MIN_SDK_VERSION=a56_0x428672(0x163);export function checkSdkVersion(_0x5a5c75){const _0x4ad59c=a56_0x428672,_0x1deff4=a56_0x1e45d7['join'](_0x5a5c75,_0x4ad59c(0x158));if(!a56_0xb09cb6[_0x4ad59c(0x165)](_0x1deff4))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x13e2ff=JSON['parse'](a56_0xb09cb6['readFileSync'](_0x1deff4,_0x4ad59c(0x168))),_0x50059f=_0x13e2ff[_0x4ad59c(0x14f)]||{},_0xb9daf3=_0x13e2ff[_0x4ad59c(0x159)]||{},_0x5329ed=_0x50059f[_0x4ad59c(0x167)]||_0xb9daf3['@lovrabet/sdk'];if(!_0x5329ed)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x1a8aab=a56_0x11fc07[_0x4ad59c(0x157)](_0x5329ed),_0x5c11d0=_0x1a8aab?a56_0x11fc07['lt'](_0x1a8aab,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x5329ed,'needsUpgrade':_0x5c11d0,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x4c4039){const _0x1ff53a=a56_0x428672;if(!_0x4c4039[_0x1ff53a(0x15a)])return;const _0x4b0c51=_0x1ff53a(0x153),_0x15d97e=_0x1ff53a(0x15d),_0x187538='\x1b[1m';console[_0x1ff53a(0x14d)](),console[_0x1ff53a(0x14d)](''+_0x4b0c51+_0x187538+_0x1ff53a(0x15b)+_0x15d97e),console[_0x1ff53a(0x14d)](_0x4b0c51+_0x1ff53a(0x152)+_0x4c4039[_0x1ff53a(0x156)]+_0x1ff53a(0x162)+_0x15d97e),console['log'](_0x4b0c51+'\x20\x20\x20请升级\x20SDK\x20至\x20'+_0x4c4039['minVersion']+_0x1ff53a(0x166)+_0x15d97e),console['log'](_0x4b0c51+'\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest'+_0x15d97e),console[_0x1ff53a(0x14d)](_0x4b0c51+'\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk'+_0x15d97e),console['log']();}function a56_0x2043(){const _0x53a9b0=['3560343qunvTU','63TDRaiw','\x20不支持新协议。','1.2.0','4530561GOjogj','existsSync','\x20或更高版本:','@lovrabet/sdk','utf8','1863012tdcLGE','log','37613NDPUGe','dependencies','60WpkBbH','606070eWuyTt','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','\x1b[33m','58PlYfgW','2265714jpVRLs','version','coerce','package.json','devDependencies','needsUpgrade','⚠️\x20\x20SDK\x20版本不兼容','8kLYfXS','\x1b[0m','9789395uSazsU','10XtkbrY'];a56_0x2043=function(){return _0x53a9b0;};return a56_0x2043();}
@@ -1 +1 @@
1
- function a55_0x48b2(_0xe41f23,_0x202c62){_0xe41f23=_0xe41f23-0x110;const _0xa87468=a55_0xa874();let _0x48b23f=_0xa87468[_0xe41f23];return _0x48b23f;}const a55_0x103815=a55_0x48b2;(function(_0x498b41,_0x12721f){const _0x1fa2b1=a55_0x48b2,_0x5ca312=_0x498b41();while(!![]){try{const _0x35ef3d=parseInt(_0x1fa2b1(0x112))/0x1+parseInt(_0x1fa2b1(0x110))/0x2*(parseInt(_0x1fa2b1(0x121))/0x3)+parseInt(_0x1fa2b1(0x114))/0x4*(parseInt(_0x1fa2b1(0x118))/0x5)+parseInt(_0x1fa2b1(0x111))/0x6+-parseInt(_0x1fa2b1(0x117))/0x7*(parseInt(_0x1fa2b1(0x11c))/0x8)+parseInt(_0x1fa2b1(0x119))/0x9*(-parseInt(_0x1fa2b1(0x113))/0xa)+-parseInt(_0x1fa2b1(0x11e))/0xb*(parseInt(_0x1fa2b1(0x122))/0xc);if(_0x35ef3d===_0x12721f)break;else _0x5ca312['push'](_0x5ca312['shift']());}catch(_0x120280){_0x5ca312['push'](_0x5ca312['shift']());}}}(a55_0xa874,0x74e6d));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x103815(0x115)](),a55_0x103815(0x116));export const globalConfigPath=resolve(homedir(),a55_0x103815(0x116));export function readConfig(){const _0x4bdf14=a55_0x103815;let _0x5882ee={};try{if(existsSync(globalConfigPath)){const _0x592981=readFileSync(globalConfigPath,{'encoding':_0x4bdf14(0x11a)});_0x592981&&(_0x5882ee=JSON[_0x4bdf14(0x11d)](_0x592981));}}catch(_0x427194){}try{if(existsSync(projectConfigPath)){const _0x44a853=readFileSync(projectConfigPath,{'encoding':_0x4bdf14(0x11a)});if(_0x44a853){const _0x45edb4=JSON['parse'](_0x44a853);_0x5882ee={..._0x5882ee,..._0x45edb4};}}}catch(_0x45e479){}return _0x5882ee;}export function getConfigAppCode(){const _0x2d97e3=a55_0x103815;let _0x4763f4={},_0x2c1331={};try{if(existsSync(globalConfigPath)){const _0x11d2df=readFileSync(globalConfigPath,{'encoding':_0x2d97e3(0x11a)});_0x11d2df&&(_0x2c1331=JSON['parse'](_0x11d2df));}}catch(_0x342806){}try{if(existsSync(projectConfigPath)){const _0x5f3c10=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x5f3c10&&(_0x4763f4=JSON[_0x2d97e3(0x11d)](_0x5f3c10));}}catch(_0x5256a6){}let _0x4dfd26;if(_0x2d97e3(0x11f)in _0x4763f4)_0x4dfd26=_0x4763f4[_0x2d97e3(0x11f)];else{if(_0x2d97e3(0x11b)in _0x4763f4)_0x4dfd26=_0x4763f4[_0x2d97e3(0x11b)];else{if(_0x2d97e3(0x11f)in _0x2c1331)_0x4dfd26=_0x2c1331[_0x2d97e3(0x11f)];else _0x2d97e3(0x11b)in _0x2c1331&&(_0x4dfd26=_0x2c1331[_0x2d97e3(0x11b)]);}}if(typeof _0x4dfd26!=='string'||_0x4dfd26[_0x2d97e3(0x120)]()==='')return undefined;return _0x4dfd26;}export function isInProject(){return existsSync(projectConfigPath);}function a55_0xa874(){const _0x38ac78=['2946696guHWIe','765035AqEpiW','22030TdHWVa','4CQYSYv','cwd','.lovrabetrc','35BqEqsv','3650645gmHXWp','3501kwrasl','utf8','app','685936sixqTr','parse','2710741InuGbP','appcode','trim','6LhWLdt','24YbfqEq','271088ZMMQsk'];a55_0xa874=function(){return _0x38ac78;};return a55_0xa874();}
1
+ const a57_0x4944d9=a57_0x3c4b;(function(_0x32e554,_0xa9da7b){const _0x553c81=a57_0x3c4b,_0x48eaeb=_0x32e554();while(!![]){try{const _0x4fc27b=parseInt(_0x553c81(0x97))/0x1+parseInt(_0x553c81(0xa0))/0x2+parseInt(_0x553c81(0x93))/0x3*(parseInt(_0x553c81(0x9f))/0x4)+parseInt(_0x553c81(0x9e))/0x5*(-parseInt(_0x553c81(0x94))/0x6)+-parseInt(_0x553c81(0xa1))/0x7*(-parseInt(_0x553c81(0x9d))/0x8)+parseInt(_0x553c81(0x9c))/0x9+parseInt(_0x553c81(0x96))/0xa*(-parseInt(_0x553c81(0x95))/0xb);if(_0x4fc27b===_0xa9da7b)break;else _0x48eaeb['push'](_0x48eaeb['shift']());}catch(_0x647703){_0x48eaeb['push'](_0x48eaeb['shift']());}}}(a57_0x29f3,0x77e95));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a57_0x4944d9(0x98)](),'.lovrabetrc');function a57_0x3c4b(_0xd70231,_0x306fad){_0xd70231=_0xd70231-0x92;const _0x29f33a=a57_0x29f3();let _0x3c4bcb=_0x29f33a[_0xd70231];return _0x3c4bcb;}export const globalConfigPath=resolve(homedir(),a57_0x4944d9(0x9b));export function readConfig(){const _0x537d0d=a57_0x4944d9;let _0x62af4b={};try{if(existsSync(globalConfigPath)){const _0x36a466=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x36a466&&(_0x62af4b=JSON[_0x537d0d(0x9a)](_0x36a466));}}catch(_0x37706e){}try{if(existsSync(projectConfigPath)){const _0x2abfea=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x2abfea){const _0x253020=JSON[_0x537d0d(0x9a)](_0x2abfea);_0x62af4b={..._0x62af4b,..._0x253020};}}}catch(_0x5e3c4c){}return _0x62af4b;}export function getConfigAppCode(){const _0x3e0c90=a57_0x4944d9;let _0x489d8e={},_0x59f8d3={};try{if(existsSync(globalConfigPath)){const _0x33ca25=readFileSync(globalConfigPath,{'encoding':_0x3e0c90(0xa3)});_0x33ca25&&(_0x59f8d3=JSON[_0x3e0c90(0x9a)](_0x33ca25));}}catch(_0x1638c9){}try{if(existsSync(projectConfigPath)){const _0x4ab502=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x4ab502&&(_0x489d8e=JSON[_0x3e0c90(0x9a)](_0x4ab502));}}catch(_0x1ee0b4){}let _0x4c80e2;if(_0x3e0c90(0xa2)in _0x489d8e)_0x4c80e2=_0x489d8e['appcode'];else{if(_0x3e0c90(0x92)in _0x489d8e)_0x4c80e2=_0x489d8e[_0x3e0c90(0x92)];else{if(_0x3e0c90(0xa2)in _0x59f8d3)_0x4c80e2=_0x59f8d3[_0x3e0c90(0xa2)];else _0x3e0c90(0x92)in _0x59f8d3&&(_0x4c80e2=_0x59f8d3[_0x3e0c90(0x92)]);}}if(typeof _0x4c80e2!=='string'||_0x4c80e2[_0x3e0c90(0x99)]()==='')return undefined;return _0x4c80e2;}function a57_0x29f3(){const _0x4019bc=['685700RnZsLQ','14BCOmNl','appcode','utf8','app','765vUkTVy','2532JgeUkN','364309omDlpf','580qZQhNF','201502LMEMTd','cwd','trim','parse','.lovrabetrc','6433596rnWUQN','3137168oHXwjF','5685wBppZA','13308nAnstO'];a57_0x29f3=function(){return _0x4019bc;};return a57_0x29f3();}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- (function(_0x8e3141,_0x4994ca){const _0x1b4383=a56_0xd61c,_0x22701a=_0x8e3141();while(!![]){try{const _0x93673c=parseInt(_0x1b4383(0x129))/0x1+parseInt(_0x1b4383(0x124))/0x2+parseInt(_0x1b4383(0x123))/0x3+-parseInt(_0x1b4383(0x127))/0x4+parseInt(_0x1b4383(0x126))/0x5*(parseInt(_0x1b4383(0x12a))/0x6)+-parseInt(_0x1b4383(0x12d))/0x7+parseInt(_0x1b4383(0x11f))/0x8*(-parseInt(_0x1b4383(0x12c))/0x9);if(_0x93673c===_0x4994ca)break;else _0x22701a['push'](_0x22701a['shift']());}catch(_0x322b43){_0x22701a['push'](_0x22701a['shift']());}}}(a56_0x833a,0x199dc));function a56_0xd61c(_0x18cdf3,_0x1c88aa){_0x18cdf3=_0x18cdf3-0x11f;const _0x833a5f=a56_0x833a();let _0xd61c86=_0x833a5f[_0x18cdf3];return _0xd61c86;}function a56_0x833a(){const _0xb2e75f=['复制目录时出错:','error','isDirectory','196497iYbvSZ','291634pkPaXl','readdirSync','236915gtOctp','503900OqnUuL','join','115103loiuZh','6CAjFIQ','name','9JWBOVi','80220UupVNa','1051544tqgPFB'];a56_0x833a=function(){return _0xb2e75f;};return a56_0x833a();}import a56_0x1f1ef4 from'node:path';import a56_0x2e2d9f from'node:fs';export async function copyDirectory(_0x36c210,_0x2bb111){const _0x33c299=a56_0xd61c;try{const _0x39d895=a56_0x2e2d9f[_0x33c299(0x125)](_0x36c210,{'withFileTypes':!![]});a56_0x2e2d9f['mkdirSync'](_0x2bb111,{'recursive':!![]});for(const _0x649af5 of _0x39d895){const _0x26627c=a56_0x1f1ef4['join'](_0x36c210,_0x649af5[_0x33c299(0x12b)]),_0x5020ff=a56_0x1f1ef4[_0x33c299(0x128)](_0x2bb111,_0x649af5[_0x33c299(0x12b)]);_0x649af5[_0x33c299(0x122)]()?await copyDirectory(_0x26627c,_0x5020ff):a56_0x2e2d9f['copyFileSync'](_0x26627c,_0x5020ff);}}catch(_0x2cf030){console[_0x33c299(0x121)](_0x33c299(0x120),_0x2cf030);}}
1
+ (function(_0x7938a3,_0x35f3da){const _0x5cce9c=a58_0x3f24,_0x1c00e5=_0x7938a3();while(!![]){try{const _0x3ad14b=parseInt(_0x5cce9c(0x105))/0x1*(parseInt(_0x5cce9c(0x10a))/0x2)+parseInt(_0x5cce9c(0x108))/0x3+-parseInt(_0x5cce9c(0x102))/0x4*(-parseInt(_0x5cce9c(0xfe))/0x5)+-parseInt(_0x5cce9c(0xff))/0x6+parseInt(_0x5cce9c(0x103))/0x7+parseInt(_0x5cce9c(0x106))/0x8*(-parseInt(_0x5cce9c(0x101))/0x9)+-parseInt(_0x5cce9c(0x10d))/0xa;if(_0x3ad14b===_0x35f3da)break;else _0x1c00e5['push'](_0x1c00e5['shift']());}catch(_0x10beb9){_0x1c00e5['push'](_0x1c00e5['shift']());}}}(a58_0x8217,0xccf56));function a58_0x3f24(_0x122739,_0x1d07f5){_0x122739=_0x122739-0xfe;const _0x8217c9=a58_0x8217();let _0x3f24ff=_0x8217c9[_0x122739];return _0x3f24ff;}import a58_0x24180c from'node:path';function a58_0x8217(){const _0x2cf2a3=['44UrOskG','354753vMwbKN','mkdirSync','2rXFuac','6711304IArWxX','error','3639879eOlzyh','readdirSync','1055762eIhcMO','isDirectory','name','7051630xnTznl','640015zFBkAj','8065086mcVrfX','join','9wsOHwX'];a58_0x8217=function(){return _0x2cf2a3;};return a58_0x8217();}import a58_0x3795ec from'node:fs';export async function copyDirectory(_0x57dfac,_0x53d8d9){const _0x40a5fc=a58_0x3f24;try{const _0x45eb84=a58_0x3795ec[_0x40a5fc(0x109)](_0x57dfac,{'withFileTypes':!![]});a58_0x3795ec[_0x40a5fc(0x104)](_0x53d8d9,{'recursive':!![]});for(const _0xa04a66 of _0x45eb84){const _0x2bd87b=a58_0x24180c[_0x40a5fc(0x100)](_0x57dfac,_0xa04a66[_0x40a5fc(0x10c)]),_0x2df885=a58_0x24180c[_0x40a5fc(0x100)](_0x53d8d9,_0xa04a66[_0x40a5fc(0x10c)]);_0xa04a66[_0x40a5fc(0x10b)]()?await copyDirectory(_0x2bd87b,_0x2df885):a58_0x3795ec['copyFileSync'](_0x2bd87b,_0x2df885);}}catch(_0x17ee2c){console[_0x40a5fc(0x107)]('复制目录时出错:',_0x17ee2c);}}
@@ -1 +1 @@
1
- (function(_0x4f5b9a,_0x24b535){const _0x158598=a57_0x53f1,_0x3b6b88=_0x4f5b9a();while(!![]){try{const _0x132c22=parseInt(_0x158598(0x201))/0x1+-parseInt(_0x158598(0x1e4))/0x2*(-parseInt(_0x158598(0x1e9))/0x3)+-parseInt(_0x158598(0x1ef))/0x4*(parseInt(_0x158598(0x1ee))/0x5)+parseInt(_0x158598(0x1fc))/0x6*(parseInt(_0x158598(0x1f2))/0x7)+parseInt(_0x158598(0x1fa))/0x8+-parseInt(_0x158598(0x1f0))/0x9+-parseInt(_0x158598(0x1eb))/0xa;if(_0x132c22===_0x24b535)break;else _0x3b6b88['push'](_0x3b6b88['shift']());}catch(_0x260ca5){_0x3b6b88['push'](_0x3b6b88['shift']());}}}(a57_0x59fe,0xa83a0));export async function httpRequest(_0x4748f5,_0x18438a={}){const _0x52f5a3=a57_0x53f1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x18438a;let _0xa1825e=null;for(let _0x7b4a7=0x0;_0x7b4a7<=retries;_0x7b4a7++){try{const _0x468a2b=new AbortController(),_0xcabd75=setTimeout(()=>_0x468a2b[_0x52f5a3(0x1ec)](),timeout),_0xfb766e=await fetch(_0x4748f5,{'headers':headers,'signal':_0x468a2b[_0x52f5a3(0x1e7)]});clearTimeout(_0xcabd75);let _0x2b78d7;const _0x3da151=_0xfb766e['headers'][_0x52f5a3(0x1e8)](_0x52f5a3(0x1e3));return _0x3da151?.[_0x52f5a3(0x1fe)](_0x52f5a3(0x1f7))?_0x2b78d7=await _0xfb766e[_0x52f5a3(0x1e6)]():_0x2b78d7=await _0xfb766e[_0x52f5a3(0x1fd)](),{'ok':_0xfb766e['ok'],'status':_0xfb766e[_0x52f5a3(0x1f3)],'statusText':_0xfb766e[_0x52f5a3(0x1ff)],'data':_0x2b78d7,'headers':_0xfb766e[_0x52f5a3(0x200)],'url':_0xfb766e[_0x52f5a3(0x1ea)],'text':()=>_0xfb766e[_0x52f5a3(0x1fd)]()};}catch(_0x43fb66){_0xa1825e=_0x43fb66 instanceof Error?_0x43fb66:new Error(String(_0x43fb66));if(_0x7b4a7===retries)break;if(shouldRetry(_0x43fb66)){console[_0x52f5a3(0x1e1)](_0x52f5a3(0x1e2)+retryDelay+_0x52f5a3(0x1f6)+(_0x7b4a7+0x1)+_0x52f5a3(0x1ed)),await sleep(retryDelay);continue;}else break;}}throw _0xa1825e||new Error(_0x52f5a3(0x1f1));}function shouldRetry(_0x25b0b1){const _0x677873=a57_0x53f1;if(_0x25b0b1 instanceof Error){if(_0x25b0b1[_0x677873(0x1f5)]===_0x677873(0x1f4))return![];if(_0x25b0b1[_0x677873(0x1f5)]===_0x677873(0x1f9)&&_0x25b0b1['message']['includes'](_0x677873(0x1fb)))return!![];if(_0x25b0b1[_0x677873(0x1f8)][_0x677873(0x1fe)]('ECONNRESET'))return!![];if(_0x25b0b1[_0x677873(0x1f8)][_0x677873(0x1fe)](_0x677873(0x1e5)))return![];}return![];}function a57_0x53f1(_0x3c420d,_0x2c7665){_0x3c420d=_0x3c420d-0x1e1;const _0x59feda=a57_0x59fe();let _0x53f134=_0x59feda[_0x3c420d];return _0x53f134;}function a57_0x59fe(){const _0x51d742=['2wKuaio','ENOTFOUND','json','signal','get','751974zvayGb','url','12667390AtIKOH','abort','\x20次重试...','160315kOYzVY','88PUvcgG','2099556AkHMer','Request\x20failed','4363793uAUfZY','status','AbortError','name','ms\x20后进行第\x20','application/json','message','TypeError','10738928LOTKZE','fetch','6eNSFhW','text','includes','statusText','headers','678042tjuIGQ','log','*\x20请求失败,','content-type'];a57_0x59fe=function(){return _0x51d742;};return a57_0x59fe();}function sleep(_0x109a5a){return new Promise(_0x302918=>setTimeout(_0x302918,_0x109a5a));}export function validateUrl(_0x26ea57){try{return new URL(_0x26ea57),!![];}catch{return![];}}
1
+ (function(_0x4accd1,_0x328d22){const _0x2811b8=a59_0x1840,_0x4ce3c9=_0x4accd1();while(!![]){try{const _0x5f0647=parseInt(_0x2811b8(0x189))/0x1+-parseInt(_0x2811b8(0x185))/0x2+-parseInt(_0x2811b8(0x18d))/0x3*(-parseInt(_0x2811b8(0x192))/0x4)+-parseInt(_0x2811b8(0x188))/0x5+-parseInt(_0x2811b8(0x183))/0x6*(parseInt(_0x2811b8(0x17a))/0x7)+parseInt(_0x2811b8(0x180))/0x8+parseInt(_0x2811b8(0x17d))/0x9*(-parseInt(_0x2811b8(0x191))/0xa);if(_0x5f0647===_0x328d22)break;else _0x4ce3c9['push'](_0x4ce3c9['shift']());}catch(_0x32104e){_0x4ce3c9['push'](_0x4ce3c9['shift']());}}}(a59_0x4157,0xafed2));export async function httpRequest(_0x1d3c8e,_0xc1cd77={}){const _0x563685=a59_0x1840,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0xc1cd77;let _0x45cb33=null;for(let _0xaab801=0x0;_0xaab801<=retries;_0xaab801++){try{const _0x5bc3a6=new AbortController(),_0x7c5ee1=setTimeout(()=>_0x5bc3a6['abort'](),timeout),_0x2488ac=await fetch(_0x1d3c8e,{'headers':headers,'signal':_0x5bc3a6[_0x563685(0x179)]});clearTimeout(_0x7c5ee1);let _0x3a046b;const _0x3df26e=_0x2488ac['headers'][_0x563685(0x178)](_0x563685(0x18e));return _0x3df26e?.['includes']('application/json')?_0x3a046b=await _0x2488ac[_0x563685(0x187)]():_0x3a046b=await _0x2488ac[_0x563685(0x18f)](),{'ok':_0x2488ac['ok'],'status':_0x2488ac[_0x563685(0x17e)],'statusText':_0x2488ac['statusText'],'data':_0x3a046b,'headers':_0x2488ac[_0x563685(0x18b)],'url':_0x2488ac['url'],'text':()=>_0x2488ac[_0x563685(0x18f)]()};}catch(_0x40d124){_0x45cb33=_0x40d124 instanceof Error?_0x40d124:new Error(String(_0x40d124));if(_0xaab801===retries)break;if(shouldRetry(_0x40d124)){console[_0x563685(0x18c)](_0x563685(0x17f)+retryDelay+_0x563685(0x184)+(_0xaab801+0x1)+_0x563685(0x186)),await sleep(retryDelay);continue;}else break;}}throw _0x45cb33||new Error(_0x563685(0x182));}function shouldRetry(_0x484e58){const _0x18ce07=a59_0x1840;if(_0x484e58 instanceof Error){if(_0x484e58[_0x18ce07(0x181)]===_0x18ce07(0x18a))return![];if(_0x484e58['name']==='TypeError'&&_0x484e58['message']['includes'](_0x18ce07(0x17b)))return!![];if(_0x484e58[_0x18ce07(0x190)]['includes']('ECONNRESET'))return!![];if(_0x484e58[_0x18ce07(0x190)][_0x18ce07(0x193)](_0x18ce07(0x17c)))return![];}return![];}function sleep(_0x4833bf){return new Promise(_0x54fad0=>setTimeout(_0x54fad0,_0x4833bf));}function a59_0x1840(_0x2eb52b,_0x295bca){_0x2eb52b=_0x2eb52b-0x178;const _0x4157d3=a59_0x4157();let _0x18401b=_0x4157d3[_0x2eb52b];return _0x18401b;}function a59_0x4157(){const _0x4c6441=['fetch','ENOTFOUND','18bojUiR','status','*\x20请求失败,','5534800zyqVEE','name','Request\x20failed','5495106nJjOYS','ms\x20后进行第\x20','1567058YMLUVf','\x20次重试...','json','892115aRQcsL','1183300gtcyEw','AbortError','headers','log','3bncbme','content-type','text','message','1826160emtsUb','4353916rBHSKs','includes','get','signal','7rxmkdk'];a59_0x4157=function(){return _0x4c6441;};return a59_0x4157();}export function validateUrl(_0x3f94e4){try{return new URL(_0x3f94e4),!![];}catch{return![];}}
@@ -1 +1 @@
1
- function a58_0x1b0a(){const _0x241cb1=['7831117nPYAXk','.lovrabet.log','logTask','setLogPath','toISOString','initWinstonLogger','now','writeFileSync','info','2067626gQcBiM','success','command','readFileSync','currentRawCommand','1307913YgMyNq','blue','log','开始执行:\x20','errors','190552neZEVQ','10uBdiOW','2012838lnZXDX','mkdirSync','details','transports','format','timestamp','green','combine','message','trim','失败:\x20','level','getWinstonInstance','rawCommand','duration','dirname','split','parse','完成:\x20','filter','3567084FwPYFo','winstonLogger','utf8','existsSync','error','logFilePath','File','warn','createLogger','261IcylTF','clear','1023668pTZZNT'];a58_0x1b0a=function(){return _0x241cb1;};return a58_0x1b0a();}const a58_0x23c6b9=a58_0x1635;(function(_0x279a1d,_0x320e86){const _0x27b449=a58_0x1635,_0x5a9f53=_0x279a1d();while(!![]){try{const _0x2b367d=parseInt(_0x27b449(0x190))/0x1+-parseInt(_0x27b449(0x18b))/0x2+-parseInt(_0x27b449(0x176))/0x3+-parseInt(_0x27b449(0x181))/0x4*(parseInt(_0x27b449(0x196))/0x5)+parseInt(_0x27b449(0x197))/0x6+parseInt(_0x27b449(0x182))/0x7+parseInt(_0x27b449(0x195))/0x8*(parseInt(_0x27b449(0x17f))/0x9);if(_0x2b367d===_0x320e86)break;else _0x5a9f53['push'](_0x5a9f53['shift']());}catch(_0x22d2e7){_0x5a9f53['push'](_0x5a9f53['shift']());}}}(a58_0x1b0a,0xaf571));function a58_0x1635(_0x31846b,_0x5b68c7){_0x31846b=_0x31846b-0x164;const _0x1b0a3c=a58_0x1b0a();let _0x163584=_0x1b0a3c[_0x31846b];return _0x163584;}import a58_0x3a147f from'winston';import a58_0x518647 from'node:fs';import a58_0x166cba from'node:path';class Logger{[a58_0x23c6b9(0x177)];['logFilePath'];[a58_0x23c6b9(0x18f)]='';constructor(){const _0xc28815=a58_0x23c6b9;this[_0xc28815(0x17b)]='';}['setRawCommand'](_0x160de0){const _0x520c70=a58_0x23c6b9;this[_0x520c70(0x18f)]=_0x160de0;}[a58_0x23c6b9(0x187)](){const _0x89c12c=a58_0x23c6b9,_0x1f1ef3=a58_0x166cba[_0x89c12c(0x171)](this[_0x89c12c(0x17b)]);!a58_0x518647[_0x89c12c(0x179)](_0x1f1ef3)&&a58_0x518647[_0x89c12c(0x198)](_0x1f1ef3,{'recursive':!![]});const _0x4083de=a58_0x3a147f[_0x89c12c(0x166)][_0x89c12c(0x169)](a58_0x3a147f['format'][_0x89c12c(0x167)](),a58_0x3a147f['format'][_0x89c12c(0x194)]({'stack':!![]}),a58_0x3a147f[_0x89c12c(0x166)]['printf'](_0x54f549=>{const _0x424d29=_0x89c12c,_0x33eca6={'timestamp':_0x54f549[_0x424d29(0x167)]||new Date()[_0x424d29(0x186)](),'level':_0x54f549[_0x424d29(0x16d)]||_0x424d29(0x18a),'command':_0x54f549[_0x424d29(0x18d)]||'unknown','rawCommand':_0x54f549[_0x424d29(0x16f)]||this[_0x424d29(0x18f)]||undefined,'message':_0x54f549[_0x424d29(0x16a)]||'','duration':_0x54f549[_0x424d29(0x170)]||undefined,'details':_0x54f549[_0x424d29(0x164)]||undefined};return JSON['stringify'](_0x33eca6);}));this[_0x89c12c(0x177)]=a58_0x3a147f[_0x89c12c(0x17e)]({'level':_0x89c12c(0x18a),'format':_0x4083de,'transports':[new a58_0x3a147f[(_0x89c12c(0x165))][(_0x89c12c(0x17c))]({'filename':this['logFilePath'],'level':_0x89c12c(0x18a)})],'silent':![]}),a58_0x3a147f['addColors']({'success':_0x89c12c(0x168),'error':'red','warn':'yellow','info':_0x89c12c(0x191)});}[a58_0x23c6b9(0x185)](_0x3631cf){const _0x4515a9=a58_0x23c6b9;this[_0x4515a9(0x17b)]=a58_0x166cba['join'](_0x3631cf,_0x4515a9(0x183)),this['winstonLogger']&&this[_0x4515a9(0x177)][_0x4515a9(0x180)](),this[_0x4515a9(0x187)]();}['info'](_0x1f7d3d,_0x4e22de,_0x1699ff){const _0xeed1f5=a58_0x23c6b9;if(!this[_0xeed1f5(0x17b)]||!this[_0xeed1f5(0x177)])return;this[_0xeed1f5(0x177)][_0xeed1f5(0x18a)](_0x4e22de,{'command':_0x1f7d3d,'details':_0x1699ff});}[a58_0x23c6b9(0x18c)](_0x56de7c,_0x5f0233,_0x4d41c6,_0x40151d){const _0x262f45=a58_0x23c6b9;if(!this[_0x262f45(0x17b)]||!this[_0x262f45(0x177)])return;this['winstonLogger'][_0x262f45(0x192)](_0x262f45(0x18a),_0x5f0233,{'level':_0x262f45(0x18c),'command':_0x56de7c,'duration':_0x4d41c6,'details':_0x40151d});}[a58_0x23c6b9(0x17a)](_0x20b7cd,_0x2ffbca,_0x43c1f1){const _0x496952=a58_0x23c6b9;if(!this[_0x496952(0x17b)]||!this[_0x496952(0x177)])return;this[_0x496952(0x177)][_0x496952(0x17a)](_0x2ffbca,{'command':_0x20b7cd,'details':_0x43c1f1});}[a58_0x23c6b9(0x17d)](_0x520ce4,_0x3b59d8,_0x54b515){const _0x399509=a58_0x23c6b9;if(!this[_0x399509(0x17b)]||!this[_0x399509(0x177)])return;this[_0x399509(0x177)][_0x399509(0x17d)](_0x3b59d8,{'command':_0x520ce4,'details':_0x54b515});}async[a58_0x23c6b9(0x184)](_0x359927,_0x24c13e,_0x7fb011){const _0x4789b3=a58_0x23c6b9,_0x40f322=Date['now']();this['info'](_0x359927,_0x4789b3(0x193)+_0x24c13e);try{const _0x3f0066=await _0x7fb011(),_0x2f4903=Date[_0x4789b3(0x188)]()-_0x40f322;return this[_0x4789b3(0x18c)](_0x359927,_0x4789b3(0x174)+_0x24c13e,_0x2f4903),_0x3f0066;}catch(_0x53dc44){const _0x4feae4=Date[_0x4789b3(0x188)]()-_0x40f322;this[_0x4789b3(0x17a)](_0x359927,_0x4789b3(0x16c)+_0x24c13e,{'error':_0x53dc44 instanceof Error?_0x53dc44[_0x4789b3(0x16a)]:String(_0x53dc44),'duration':_0x4feae4});throw _0x53dc44;}}['readLogs'](){const _0x26472a=a58_0x23c6b9;try{if(!a58_0x518647[_0x26472a(0x179)](this[_0x26472a(0x17b)]))return[];const _0x37028e=a58_0x518647[_0x26472a(0x18e)](this['logFilePath'],_0x26472a(0x178));return _0x37028e[_0x26472a(0x172)]('\x0a')[_0x26472a(0x175)](_0x54dd62=>_0x54dd62[_0x26472a(0x16b)]())['map'](_0x3ae384=>JSON[_0x26472a(0x173)](_0x3ae384));}catch(_0x168f6b){return console[_0x26472a(0x17d)]('Failed\x20to\x20read\x20logs:',_0x168f6b),[];}}['clearLogs'](){const _0x4cf70c=a58_0x23c6b9;try{a58_0x518647[_0x4cf70c(0x179)](this['logFilePath'])&&a58_0x518647[_0x4cf70c(0x189)](this[_0x4cf70c(0x17b)],'','utf8');}catch(_0x2d1038){console[_0x4cf70c(0x17d)]('Failed\x20to\x20clear\x20logs:',_0x2d1038);}}[a58_0x23c6b9(0x16e)](){const _0x42814c=a58_0x23c6b9;return this[_0x42814c(0x177)];}}export const logger=new Logger();
1
+ const a60_0x932ba7=a60_0x1be5;(function(_0x1b9475,_0x596604){const _0x10cfc3=a60_0x1be5,_0x33107f=_0x1b9475();while(!![]){try{const _0x1b079a=parseInt(_0x10cfc3(0x1a0))/0x1*(parseInt(_0x10cfc3(0x1ad))/0x2)+-parseInt(_0x10cfc3(0x1cf))/0x3*(parseInt(_0x10cfc3(0x1c3))/0x4)+-parseInt(_0x10cfc3(0x1a1))/0x5*(parseInt(_0x10cfc3(0x1c2))/0x6)+parseInt(_0x10cfc3(0x1bc))/0x7+parseInt(_0x10cfc3(0x1aa))/0x8*(parseInt(_0x10cfc3(0x1c0))/0x9)+-parseInt(_0x10cfc3(0x1d6))/0xa+parseInt(_0x10cfc3(0x1cc))/0xb;if(_0x1b079a===_0x596604)break;else _0x33107f['push'](_0x33107f['shift']());}catch(_0x260383){_0x33107f['push'](_0x33107f['shift']());}}}(a60_0x2d54,0x1dd5f));import a60_0x46e6d2 from'winston';import a60_0x2cb398 from'node:fs';function a60_0x1be5(_0x58ea7e,_0x96f4ba){_0x58ea7e=_0x58ea7e-0x1a0;const _0x2d54b7=a60_0x2d54();let _0x1be599=_0x2d54b7[_0x58ea7e];return _0x1be599;}function a60_0x2d54(){const _0x1041d5=['1042770xqcXdw','348NzAKSp','setLogPath','完成:\x20','join','失败:\x20','map','File','stringify','level','4958932PRueAX','logFilePath','duration','6522FaBwff','error','setRawCommand','existsSync','now','logTask','message','1487750WKyiFM','47876RrGjJa','5DFDVkx','addColors','Failed\x20to\x20clear\x20logs:','trim','currentRawCommand','split','parse','green','errors','16dJmVka','command','readLogs','2ZxiNMN','success','writeFileSync','mkdirSync','utf8','info','winstonLogger','details','Failed\x20to\x20read\x20logs:','warn','format','initWinstonLogger','clearLogs','yellow','blue','544383clryjE','开始执行:\x20','readFileSync','toISOString','258561JZwSSB','unknown'];a60_0x2d54=function(){return _0x1041d5;};return a60_0x2d54();}import a60_0x34638d from'node:path';class Logger{['winstonLogger'];[a60_0x932ba7(0x1cd)];['currentRawCommand']='';constructor(){const _0x5197e9=a60_0x932ba7;this[_0x5197e9(0x1cd)]='';}[a60_0x932ba7(0x1d1)](_0xfd52f7){this['currentRawCommand']=_0xfd52f7;}[a60_0x932ba7(0x1b8)](){const _0x50b982=a60_0x932ba7,_0x4edf2b=a60_0x34638d['dirname'](this[_0x50b982(0x1cd)]);!a60_0x2cb398['existsSync'](_0x4edf2b)&&a60_0x2cb398[_0x50b982(0x1b0)](_0x4edf2b,{'recursive':!![]});const _0x16703c=a60_0x46e6d2[_0x50b982(0x1b7)]['combine'](a60_0x46e6d2[_0x50b982(0x1b7)]['timestamp'](),a60_0x46e6d2['format'][_0x50b982(0x1a9)]({'stack':!![]}),a60_0x46e6d2[_0x50b982(0x1b7)]['printf'](_0x582723=>{const _0x4fc4a5=_0x50b982,_0x56bdf={'timestamp':_0x582723['timestamp']||new Date()[_0x4fc4a5(0x1bf)](),'level':_0x582723[_0x4fc4a5(0x1cb)]||'info','command':_0x582723[_0x4fc4a5(0x1ab)]||_0x4fc4a5(0x1c1),'rawCommand':_0x582723['rawCommand']||this[_0x4fc4a5(0x1a5)]||undefined,'message':_0x582723['message']||'','duration':_0x582723[_0x4fc4a5(0x1ce)]||undefined,'details':_0x582723[_0x4fc4a5(0x1b4)]||undefined};return JSON[_0x4fc4a5(0x1ca)](_0x56bdf);}));this['winstonLogger']=a60_0x46e6d2['createLogger']({'level':_0x50b982(0x1b2),'format':_0x16703c,'transports':[new a60_0x46e6d2['transports'][(_0x50b982(0x1c9))]({'filename':this['logFilePath'],'level':_0x50b982(0x1b2)})],'silent':![]}),a60_0x46e6d2[_0x50b982(0x1a2)]({'success':_0x50b982(0x1a8),'error':'red','warn':_0x50b982(0x1ba),'info':_0x50b982(0x1bb)});}[a60_0x932ba7(0x1c4)](_0x385021){const _0x9c99de=a60_0x932ba7;this[_0x9c99de(0x1cd)]=a60_0x34638d[_0x9c99de(0x1c6)](_0x385021,'.lovrabet.log'),this[_0x9c99de(0x1b3)]&&this['winstonLogger']['clear'](),this['initWinstonLogger']();}[a60_0x932ba7(0x1b2)](_0x282ed9,_0x3fc2c7,_0x229a7e){const _0x1df4ca=a60_0x932ba7;if(!this['logFilePath']||!this[_0x1df4ca(0x1b3)])return;this['winstonLogger']['info'](_0x3fc2c7,{'command':_0x282ed9,'details':_0x229a7e});}['success'](_0x211d5a,_0x4f5524,_0x5897a6,_0x43f6f6){const _0x52609b=a60_0x932ba7;if(!this[_0x52609b(0x1cd)]||!this[_0x52609b(0x1b3)])return;this[_0x52609b(0x1b3)]['log'](_0x52609b(0x1b2),_0x4f5524,{'level':_0x52609b(0x1ae),'command':_0x211d5a,'duration':_0x5897a6,'details':_0x43f6f6});}[a60_0x932ba7(0x1d0)](_0x4de4f1,_0x338657,_0x2d341d){const _0x43cbdc=a60_0x932ba7;if(!this[_0x43cbdc(0x1cd)]||!this[_0x43cbdc(0x1b3)])return;this[_0x43cbdc(0x1b3)][_0x43cbdc(0x1d0)](_0x338657,{'command':_0x4de4f1,'details':_0x2d341d});}[a60_0x932ba7(0x1b6)](_0x36b23f,_0x295fad,_0x1c606d){const _0x57c477=a60_0x932ba7;if(!this['logFilePath']||!this[_0x57c477(0x1b3)])return;this[_0x57c477(0x1b3)]['warn'](_0x295fad,{'command':_0x36b23f,'details':_0x1c606d});}async[a60_0x932ba7(0x1d4)](_0x2bb0cf,_0x18580e,_0x24d76f){const _0x28eebb=a60_0x932ba7,_0x17c570=Date[_0x28eebb(0x1d3)]();this['info'](_0x2bb0cf,_0x28eebb(0x1bd)+_0x18580e);try{const _0x350309=await _0x24d76f(),_0x39fae0=Date[_0x28eebb(0x1d3)]()-_0x17c570;return this[_0x28eebb(0x1ae)](_0x2bb0cf,_0x28eebb(0x1c5)+_0x18580e,_0x39fae0),_0x350309;}catch(_0x5b125a){const _0x4e637b=Date[_0x28eebb(0x1d3)]()-_0x17c570;this[_0x28eebb(0x1d0)](_0x2bb0cf,_0x28eebb(0x1c7)+_0x18580e,{'error':_0x5b125a instanceof Error?_0x5b125a[_0x28eebb(0x1d5)]:String(_0x5b125a),'duration':_0x4e637b});throw _0x5b125a;}}[a60_0x932ba7(0x1ac)](){const _0x1a6307=a60_0x932ba7;try{if(!a60_0x2cb398[_0x1a6307(0x1d2)](this['logFilePath']))return[];const _0x4e80cc=a60_0x2cb398[_0x1a6307(0x1be)](this[_0x1a6307(0x1cd)],_0x1a6307(0x1b1));return _0x4e80cc[_0x1a6307(0x1a6)]('\x0a')['filter'](_0x4d26d3=>_0x4d26d3[_0x1a6307(0x1a4)]())[_0x1a6307(0x1c8)](_0x590b0b=>JSON[_0x1a6307(0x1a7)](_0x590b0b));}catch(_0x1cf5dc){return console[_0x1a6307(0x1b6)](_0x1a6307(0x1b5),_0x1cf5dc),[];}}[a60_0x932ba7(0x1b9)](){const _0x29bc5f=a60_0x932ba7;try{a60_0x2cb398[_0x29bc5f(0x1d2)](this[_0x29bc5f(0x1cd)])&&a60_0x2cb398[_0x29bc5f(0x1af)](this[_0x29bc5f(0x1cd)],'',_0x29bc5f(0x1b1));}catch(_0xb626b8){console[_0x29bc5f(0x1b6)](_0x29bc5f(0x1a3),_0xb626b8);}}['getWinstonInstance'](){const _0x5ebfe8=a60_0x932ba7;return this[_0x5ebfe8(0x1b3)];}}export const logger=new Logger();
@@ -1 +1 @@
1
- function a59_0x24aa(_0x50aa27,_0xcd01f1){_0x50aa27=_0x50aa27-0x73;const _0x12fb4a=a59_0x12fb();let _0x24aad7=_0x12fb4a[_0x50aa27];return _0x24aad7;}const a59_0x232dda=a59_0x24aa;(function(_0x235a12,_0x163446){const _0x3e7c42=a59_0x24aa,_0x40b00b=_0x235a12();while(!![]){try{const _0x2000c1=parseInt(_0x3e7c42(0x7c))/0x1*(-parseInt(_0x3e7c42(0x86))/0x2)+parseInt(_0x3e7c42(0x79))/0x3+parseInt(_0x3e7c42(0x98))/0x4*(-parseInt(_0x3e7c42(0x7b))/0x5)+parseInt(_0x3e7c42(0xa3))/0x6*(parseInt(_0x3e7c42(0x92))/0x7)+-parseInt(_0x3e7c42(0x90))/0x8+parseInt(_0x3e7c42(0x89))/0x9*(-parseInt(_0x3e7c42(0x83))/0xa)+-parseInt(_0x3e7c42(0x75))/0xb*(-parseInt(_0x3e7c42(0x94))/0xc);if(_0x2000c1===_0x163446)break;else _0x40b00b['push'](_0x40b00b['shift']());}catch(_0x1cce04){_0x40b00b['push'](_0x40b00b['shift']());}}}(a59_0x12fb,0x83b3d));function a59_0x12fb(){const _0x23574a=['addImport','655920XTITEs','charAt','1227085SRdnwb','4FRzRFV','match','length','toLowerCase','\x20from\x20\x22../pages/','路由配置更新失败','src','7757110QHkaVW','index','lastIndexOf','287744cYawoZ','message','previewChanges','9kKaspj','indexOf','utf8','join','index.tsx','error','split','3112616oeWygy','includes','959HpTdYd','slice','24KBvDkL','import\x20','map','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','12uUHxxn','addRoute','writeFile','toComponentName','success','existsSync','routerFilePath','promises','路由文件不存在:\x20','未找到路由配置的\x20children\x20数组','开始更新路由配置','35772lQodFy','now','router','10893003oYVCcQ','readFile','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'];a59_0x12fb=function(){return _0x23574a;};return a59_0x12fb();}import a59_0x382a27 from'node:fs';import a59_0x3a9eb3 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x232dda(0x9e)];constructor(_0x2c0100){const _0x2170f2=a59_0x232dda;this[_0x2170f2(0x9e)]=a59_0x3a9eb3[_0x2170f2(0x8c)](_0x2c0100,_0x2170f2(0x82),'router',_0x2170f2(0x8d));}async['addPageRoute'](_0x454c21,_0x14fa4a){const _0x1ddbe1=a59_0x232dda;if(!a59_0x382a27[_0x1ddbe1(0x9d)](this['routerFilePath']))throw new Error(_0x1ddbe1(0xa0)+this[_0x1ddbe1(0x9e)]);const _0x543bb4=Date[_0x1ddbe1(0x73)]();logger['info'](_0x1ddbe1(0x74),_0x1ddbe1(0xa2),{'pageName':_0x454c21,'routePath':_0x14fa4a,'file':this[_0x1ddbe1(0x9e)]});try{const _0x192a07=await a59_0x382a27['promises'][_0x1ddbe1(0x76)](this[_0x1ddbe1(0x9e)],'utf8'),_0xca1ecf=this[_0x1ddbe1(0x9b)](_0x454c21),_0x25b9bc=this['addImport'](_0x192a07,_0xca1ecf,_0x454c21),_0x4c6761=this[_0x1ddbe1(0x99)](_0x25b9bc,_0x14fa4a,_0xca1ecf);await a59_0x382a27['promises'][_0x1ddbe1(0x9a)](this[_0x1ddbe1(0x9e)],_0x4c6761,'utf8');const _0x3e45a9=Date[_0x1ddbe1(0x73)]()-_0x543bb4;logger[_0x1ddbe1(0x9c)](_0x1ddbe1(0x74),'路由配置更新完成',_0x3e45a9,{'pageName':_0x454c21,'routePath':_0x14fa4a,'componentName':_0xca1ecf});}catch(_0x4f385e){const _0x42adb6=Date[_0x1ddbe1(0x73)]()-_0x543bb4;logger[_0x1ddbe1(0x8e)](_0x1ddbe1(0x74),_0x1ddbe1(0x81),{'pageName':_0x454c21,'routePath':_0x14fa4a,'error':_0x4f385e instanceof Error?_0x4f385e[_0x1ddbe1(0x87)]:String(_0x4f385e),'duration':_0x42adb6});throw _0x4f385e;}}[a59_0x232dda(0x9b)](_0x2d3057){const _0x124a7f=a59_0x232dda;return _0x2d3057[_0x124a7f(0x8f)]('-')[_0x124a7f(0x96)](_0x2bd6c1=>_0x2bd6c1[_0x124a7f(0x7a)](0x0)['toUpperCase']()+_0x2bd6c1['slice'](0x1)[_0x124a7f(0x7f)]())[_0x124a7f(0x8c)]('');}['addImport'](_0x13f1e5,_0x394b7b,_0x13f07e){const _0x2cc666=a59_0x232dda,_0x44232f=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x245fff=_0x13f1e5['match'](_0x44232f)||[],_0xb4b31f=_0x2cc666(0x95)+_0x394b7b+_0x2cc666(0x80)+_0x13f07e+'\x22;';if(_0x13f1e5[_0x2cc666(0x91)](_0xb4b31f))return _0x13f1e5;if(_0x245fff[_0x2cc666(0x7e)]>0x0){const _0x25f2f6=_0x245fff[_0x245fff[_0x2cc666(0x7e)]-0x1];if(_0x25f2f6){const _0x22f949=_0x13f1e5[_0x2cc666(0x85)](_0x25f2f6),_0x410862=_0x22f949+_0x25f2f6['length'];return _0x13f1e5[_0x2cc666(0x93)](0x0,_0x410862)+_0xb4b31f+'\x0a'+_0x13f1e5[_0x2cc666(0x93)](_0x410862);}}const _0x286f47=_0x13f1e5[_0x2cc666(0x7d)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x286f47&&_0x286f47['index']!==undefined){const _0x19b998=_0x286f47[_0x2cc666(0x84)]+_0x286f47[0x0]['length'];return _0x13f1e5['slice'](0x0,_0x19b998)+_0xb4b31f+'\x0a'+_0x13f1e5['slice'](_0x19b998);}return _0x13f1e5;}[a59_0x232dda(0x99)](_0x5b19ba,_0x6e8554,_0x45903f){const _0x49f50d=a59_0x232dda,_0x1b09b8=_0x49f50d(0x77)+_0x6e8554+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x45903f+_0x49f50d(0x97);if(_0x5b19ba[_0x49f50d(0x91)]('path:\x20\x22'+_0x6e8554+'\x22'))return _0x5b19ba;const _0xe12f0=/children:\s*\[([\s\S]*?)\]/,_0x14d6e7=_0x5b19ba[_0x49f50d(0x7d)](_0xe12f0);if(!_0x14d6e7||_0x14d6e7['index']===undefined)throw new Error(_0x49f50d(0xa1));const _0x41b66a=_0x14d6e7[0x1],_0x4d9c21=_0x14d6e7['index']+_0x14d6e7[0x0][_0x49f50d(0x8a)]('[')+0x1,_0x427c43=_0x41b66a?.[_0x49f50d(0x7d)](/\{[\s\S]*?\},/g)||[];if(_0x427c43[_0x49f50d(0x7e)]>0x0){const _0x11b689=_0x427c43[_0x427c43[_0x49f50d(0x7e)]-0x1];if(_0x11b689){const _0x505e0f=_0x5b19ba[_0x49f50d(0x85)](_0x11b689),_0x221a4a=_0x505e0f+_0x11b689[_0x49f50d(0x7e)];return _0x5b19ba[_0x49f50d(0x93)](0x0,_0x221a4a)+'\x0a'+_0x1b09b8+_0x5b19ba[_0x49f50d(0x93)](_0x221a4a);}}return _0x5b19ba['slice'](0x0,_0x4d9c21)+'\x0a'+_0x1b09b8+_0x5b19ba[_0x49f50d(0x93)](_0x4d9c21);}async[a59_0x232dda(0x88)](_0x48b930,_0x442e82){const _0x5aea1a=a59_0x232dda;if(!a59_0x382a27[_0x5aea1a(0x9d)](this[_0x5aea1a(0x9e)]))throw new Error(_0x5aea1a(0xa0)+this[_0x5aea1a(0x9e)]);const _0xa58333=await a59_0x382a27[_0x5aea1a(0x9f)][_0x5aea1a(0x76)](this[_0x5aea1a(0x9e)],_0x5aea1a(0x8b)),_0x39250c=this[_0x5aea1a(0x9b)](_0x48b930);let _0x24e740=this[_0x5aea1a(0x78)](_0xa58333,_0x39250c,_0x48b930);return _0x24e740=this[_0x5aea1a(0x99)](_0x24e740,_0x442e82,_0x39250c),_0x24e740;}}
1
+ const a61_0x48a835=a61_0x6c53;(function(_0xbd9581,_0x27b735){const _0x1dc7f9=a61_0x6c53,_0xf501cd=_0xbd9581();while(!![]){try{const _0x5ee14b=-parseInt(_0x1dc7f9(0x108))/0x1*(-parseInt(_0x1dc7f9(0x124))/0x2)+parseInt(_0x1dc7f9(0x110))/0x3*(parseInt(_0x1dc7f9(0x105))/0x4)+parseInt(_0x1dc7f9(0x121))/0x5*(-parseInt(_0x1dc7f9(0x12e))/0x6)+-parseInt(_0x1dc7f9(0x12f))/0x7*(-parseInt(_0x1dc7f9(0x125))/0x8)+parseInt(_0x1dc7f9(0x120))/0x9*(-parseInt(_0x1dc7f9(0x129))/0xa)+parseInt(_0x1dc7f9(0x12a))/0xb+-parseInt(_0x1dc7f9(0x119))/0xc;if(_0x5ee14b===_0x27b735)break;else _0xf501cd['push'](_0xf501cd['shift']());}catch(_0x3e1d1c){_0xf501cd['push'](_0xf501cd['shift']());}}}(a61_0xf221,0xded52));import a61_0x467ff9 from'node:fs';import a61_0x51c4fe from'node:path';function a61_0xf221(){const _0x4fdcca=['197721BbrPEr','5ChYTCc','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','addImport','22dBsoMT','218872nDqAYU','join','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','length','410ygIFYv','19484058JdsKHq','previewChanges','addPageRoute','toComponentName','7245606azfoUy','21crPiJN','index.tsx','error','import\x20','未找到路由配置的\x20children\x20数组','5982832nJQiti','promises','路由文件不存在:\x20','78941cULWdu','routerFilePath','路由配置更新失败','lastIndexOf','slice','\x20from\x20\x22../pages/','indexOf','info','3ThKZVZ','utf8','index','message','now','match','toUpperCase','开始更新路由配置','path:\x20\x22','14356344pxcXyw','includes','readFile','addRoute','router','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','existsSync'];a61_0xf221=function(){return _0x4fdcca;};return a61_0xf221();}import{logger}from'./logger.js';function a61_0x6c53(_0x4fe2e0,_0x5713cf){_0x4fe2e0=_0x4fe2e0-0x102;const _0xf22140=a61_0xf221();let _0x6c5395=_0xf22140[_0x4fe2e0];return _0x6c5395;}export class RouterUpdater{[a61_0x48a835(0x109)];constructor(_0x4ac22e){const _0x3ba283=a61_0x48a835;this[_0x3ba283(0x109)]=a61_0x51c4fe[_0x3ba283(0x126)](_0x4ac22e,'src',_0x3ba283(0x11d),_0x3ba283(0x130));}async[a61_0x48a835(0x12c)](_0x1a6397,_0x5dfa37){const _0x3544db=a61_0x48a835;if(!a61_0x467ff9[_0x3544db(0x11f)](this[_0x3544db(0x109)]))throw new Error('路由文件不存在:\x20'+this[_0x3544db(0x109)]);const _0x565c6a=Date[_0x3544db(0x114)]();logger[_0x3544db(0x10f)](_0x3544db(0x11d),_0x3544db(0x117),{'pageName':_0x1a6397,'routePath':_0x5dfa37,'file':this['routerFilePath']});try{const _0x325079=await a61_0x467ff9[_0x3544db(0x106)][_0x3544db(0x11b)](this[_0x3544db(0x109)],_0x3544db(0x111)),_0x4c03f2=this['toComponentName'](_0x1a6397),_0xe8c4d2=this[_0x3544db(0x123)](_0x325079,_0x4c03f2,_0x1a6397),_0x558265=this[_0x3544db(0x11c)](_0xe8c4d2,_0x5dfa37,_0x4c03f2);await a61_0x467ff9[_0x3544db(0x106)]['writeFile'](this[_0x3544db(0x109)],_0x558265,_0x3544db(0x111));const _0x15d933=Date[_0x3544db(0x114)]()-_0x565c6a;logger['success'](_0x3544db(0x11d),'路由配置更新完成',_0x15d933,{'pageName':_0x1a6397,'routePath':_0x5dfa37,'componentName':_0x4c03f2});}catch(_0x462631){const _0x428cb4=Date['now']()-_0x565c6a;logger[_0x3544db(0x102)](_0x3544db(0x11d),_0x3544db(0x10a),{'pageName':_0x1a6397,'routePath':_0x5dfa37,'error':_0x462631 instanceof Error?_0x462631[_0x3544db(0x113)]:String(_0x462631),'duration':_0x428cb4});throw _0x462631;}}['toComponentName'](_0x4ce3b7){const _0x14a1ef=a61_0x48a835;return _0x4ce3b7['split']('-')['map'](_0x3a52c0=>_0x3a52c0['charAt'](0x0)[_0x14a1ef(0x116)]()+_0x3a52c0[_0x14a1ef(0x10c)](0x1)['toLowerCase']())['join']('');}[a61_0x48a835(0x123)](_0x100998,_0x51c959,_0x1a23ea){const _0x442f80=a61_0x48a835,_0x15f32f=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x458b92=_0x100998['match'](_0x15f32f)||[],_0x53f5f2=_0x442f80(0x103)+_0x51c959+_0x442f80(0x10d)+_0x1a23ea+'\x22;';if(_0x100998[_0x442f80(0x11a)](_0x53f5f2))return _0x100998;if(_0x458b92[_0x442f80(0x128)]>0x0){const _0x38ebd8=_0x458b92[_0x458b92[_0x442f80(0x128)]-0x1];if(_0x38ebd8){const _0x3d1de9=_0x100998[_0x442f80(0x10b)](_0x38ebd8),_0x162090=_0x3d1de9+_0x38ebd8[_0x442f80(0x128)];return _0x100998[_0x442f80(0x10c)](0x0,_0x162090)+_0x53f5f2+'\x0a'+_0x100998[_0x442f80(0x10c)](_0x162090);}}const _0x492119=_0x100998['match'](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x492119&&_0x492119[_0x442f80(0x112)]!==undefined){const _0xd40819=_0x492119[_0x442f80(0x112)]+_0x492119[0x0]['length'];return _0x100998[_0x442f80(0x10c)](0x0,_0xd40819)+_0x53f5f2+'\x0a'+_0x100998[_0x442f80(0x10c)](_0xd40819);}return _0x100998;}[a61_0x48a835(0x11c)](_0x24b5a6,_0x4a68e0,_0xb7c183){const _0x98097=a61_0x48a835,_0x4595e0=_0x98097(0x127)+_0x4a68e0+_0x98097(0x11e)+_0xb7c183+_0x98097(0x122);if(_0x24b5a6[_0x98097(0x11a)](_0x98097(0x118)+_0x4a68e0+'\x22'))return _0x24b5a6;const _0x32c511=/children:\s*\[([\s\S]*?)\]/,_0x3451db=_0x24b5a6['match'](_0x32c511);if(!_0x3451db||_0x3451db['index']===undefined)throw new Error(_0x98097(0x104));const _0x189406=_0x3451db[0x1],_0x568b67=_0x3451db[_0x98097(0x112)]+_0x3451db[0x0][_0x98097(0x10e)]('[')+0x1,_0x2886b0=_0x189406?.[_0x98097(0x115)](/\{[\s\S]*?\},/g)||[];if(_0x2886b0[_0x98097(0x128)]>0x0){const _0x504325=_0x2886b0[_0x2886b0[_0x98097(0x128)]-0x1];if(_0x504325){const _0x5eda47=_0x24b5a6[_0x98097(0x10b)](_0x504325),_0x4d7996=_0x5eda47+_0x504325[_0x98097(0x128)];return _0x24b5a6['slice'](0x0,_0x4d7996)+'\x0a'+_0x4595e0+_0x24b5a6[_0x98097(0x10c)](_0x4d7996);}}return _0x24b5a6['slice'](0x0,_0x568b67)+'\x0a'+_0x4595e0+_0x24b5a6[_0x98097(0x10c)](_0x568b67);}async[a61_0x48a835(0x12b)](_0x391e97,_0x228e0f){const _0x4158b2=a61_0x48a835;if(!a61_0x467ff9['existsSync'](this[_0x4158b2(0x109)]))throw new Error(_0x4158b2(0x107)+this[_0x4158b2(0x109)]);const _0x10d3df=await a61_0x467ff9[_0x4158b2(0x106)][_0x4158b2(0x11b)](this['routerFilePath'],_0x4158b2(0x111)),_0x1c1879=this[_0x4158b2(0x12d)](_0x391e97);let _0x18b120=this[_0x4158b2(0x123)](_0x10d3df,_0x1c1879,_0x391e97);return _0x18b120=this[_0x4158b2(0x11c)](_0x18b120,_0x228e0f,_0x1c1879),_0x18b120;}}
@@ -1 +1 @@
1
- export function sleep(_0x35fc7f){return new Promise(_0x1b05fe=>setTimeout(_0x1b05fe,_0x35fc7f));}
1
+ export function sleep(_0x289687){return new Promise(_0x288681=>setTimeout(_0x288681,_0x289687));}
@@ -1 +1 @@
1
- const a61_0x175b81=a61_0x5c82;function a61_0x14bf(){const _0x35ad9b=['toUpperCase','default','mkdir','.css','message','45573ZCiCXO','toLocaleTimeString','slice','map','info','4BdYhyN','toISOString','replace','endsWith','push','split','readdir','copyFile','isDirectory','charAt','toDisplayTitle','.tsx','.md','template','readFile','toLocaleString','.jsx','\x20},','promises','8mMdoxA','\x0a\x20\x20\x20\x20{\x20','6ivbnKv','name','4400118PMMCGc','error','alias','模板内容替换完成','writeFile','toComponentName','11668TCNeqT','api','.tpl','extname','1049240DzNGve','now','264aJkmsX','pop','numeric','tableName:\x20\x22','join','809150RlmdmI','toLowerCase','YourModel','tableName','replaceApiContent','processFile','toLocaleDateString','alias:\x20\x22','processDirectory','46838xBKAVL','4QVAJLV','utf8','replaceContent','.ts','1016813FmUlAx','2-digit','datasetCode'];a61_0x14bf=function(){return _0x35ad9b;};return a61_0x14bf();}function a61_0x5c82(_0x25e0df,_0x1fe6a4){_0x25e0df=_0x25e0df-0xb7;const _0x14bf12=a61_0x14bf();let _0x5c82e7=_0x14bf12[_0x25e0df];return _0x5c82e7;}(function(_0x55a172,_0x3dbc16){const _0x2b87ce=a61_0x5c82,_0x20c2c0=_0x55a172();while(!![]){try{const _0x55fb33=-parseInt(_0x2b87ce(0xf4))/0x1*(-parseInt(_0x2b87ce(0xdf))/0x2)+parseInt(_0x2b87ce(0xbd))/0x3+-parseInt(_0x2b87ce(0xc2))/0x4*(parseInt(_0x2b87ce(0xea))/0x5)+-parseInt(_0x2b87ce(0xd7))/0x6*(parseInt(_0x2b87ce(0xf8))/0x7)+parseInt(_0x2b87ce(0xd5))/0x8*(parseInt(_0x2b87ce(0xd9))/0x9)+parseInt(_0x2b87ce(0xe3))/0xa+parseInt(_0x2b87ce(0xf3))/0xb*(parseInt(_0x2b87ce(0xe5))/0xc);if(_0x55fb33===_0x3dbc16)break;else _0x20c2c0['push'](_0x20c2c0['shift']());}catch(_0x5f5a14){_0x20c2c0['push'](_0x20c2c0['shift']());}}}(a61_0x14bf,0x6647c));import a61_0x526b22 from'node:fs';import a61_0x19ab8c from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a61_0x175b81(0xde)](_0x177d36){const _0x13aa32=a61_0x175b81,_0x5501c8=_0x177d36[_0x13aa32(0xc7)]('/')['pop']()||_0x177d36;return _0x5501c8[_0x13aa32(0xc7)]('-')[_0x13aa32(0xc0)](_0x1c8461=>_0x1c8461[_0x13aa32(0xcb)](0x0)[_0x13aa32(0xb8)]()+_0x1c8461[_0x13aa32(0xbf)](0x1)[_0x13aa32(0xeb)]())['join']('');}static['toDisplayTitle'](_0x59969b){const _0x2c117b=a61_0x175b81,_0xf63132=_0x59969b[_0x2c117b(0xc7)]('/')[_0x2c117b(0xe6)]()||_0x59969b;return _0xf63132[_0x2c117b(0xc7)]('-')[_0x2c117b(0xc0)](_0x5d3d1d=>_0x5d3d1d[_0x2c117b(0xcb)](0x0)['toUpperCase']()+_0x5d3d1d[_0x2c117b(0xbf)](0x1)[_0x2c117b(0xeb)]())[_0x2c117b(0xe9)]('\x20');}static['replaceContent'](_0x5911fd,_0x2b9ea0,_0xd02018){const _0x207905=a61_0x175b81,_0x9bdf47=this[_0x207905(0xde)](_0x2b9ea0),_0x83e5e5=this[_0x207905(0xcc)](_0x2b9ea0),_0x1c6429=new Date(),_0x3f7b2c=_0x1c6429[_0x207905(0xd1)](undefined,{'year':_0x207905(0xe7),'month':_0x207905(0xf9),'day':'2-digit','hour':'2-digit','minute':_0x207905(0xf9),'second':_0x207905(0xf9),'hour12':![]})['replace'](/\//g,'-'),_0x5bc2ef=_0x1c6429[_0x207905(0xf0)](undefined,{'year':_0x207905(0xe7),'month':_0x207905(0xf9),'day':'2-digit'})[_0x207905(0xc4)](/\//g,'-'),_0x1be29e=_0x1c6429[_0x207905(0xbe)](undefined,{'hour12':![]});let _0x120a41=_0x5911fd[_0x207905(0xc4)](/\{ComponentName\}/g,_0x9bdf47)[_0x207905(0xc4)](/\{DisplayTitle\}/g,_0x83e5e5)[_0x207905(0xc4)](/\{PageName\}/g,_0x2b9ea0)[_0x207905(0xc4)](/\{TemplateName\}/g,_0xd02018)[_0x207905(0xc4)](/\{CreatedAt\}/g,_0x3f7b2c)[_0x207905(0xc4)](/\{CreatedDate\}/g,_0x5bc2ef)[_0x207905(0xc4)](/\{CreatedTime\}/g,_0x1be29e);return _0x120a41;}static[a61_0x175b81(0xee)](_0x1bb119,_0x595bb3,_0x16ffa7,_0x233b5a,_0x2e4cf6,_0x19aab3,_0x2ac58d){const _0xfd0422=a61_0x175b81,_0x56abcb=new Date(),_0x32106a=_0x56abcb[_0xfd0422(0xc3)](),_0x105fae=_0x16ffa7[_0xfd0422(0xc0)](_0x16f9e6=>{const _0x526313=_0xfd0422,_0x2111d4=['datasetCode:\x20\x22'+_0x16f9e6[_0x526313(0xb7)]+'\x22',_0x526313(0xe8)+_0x16f9e6[_0x526313(0xed)]+'\x22','name:\x20\x22'+_0x16f9e6[_0x526313(0xd8)]+'\x22'];return _0x16f9e6['alias']&&_0x2111d4[_0x526313(0xc6)](_0x526313(0xf1)+_0x16f9e6[_0x526313(0xdb)]+'\x22'),_0x526313(0xd6)+_0x2111d4[_0x526313(0xe9)](',\x20')+_0x526313(0xd3);})[_0xfd0422(0xe9)](''),_0x673f81=_0x233b5a||_0x16ffa7[0x0]?.[_0xfd0422(0xdb)]||_0xfd0422(0xec);let _0xd9eeba=_0x1bb119[_0xfd0422(0xc4)](/\{AppCode\}/g,_0x595bb3)[_0xfd0422(0xc4)](/\{ModelConfigs\}/g,_0x105fae)[_0xfd0422(0xc4)](/\{ExampleModelName\}/g,_0x673f81)[_0xfd0422(0xc4)](/\{ApiFileName\}/g,_0x2e4cf6||_0xfd0422(0xe0))[_0xfd0422(0xc4)](/\{ConfigName\}/g,_0x19aab3||_0xfd0422(0xb9))['replace'](/\{ClientConfigParam\}/g,_0x2ac58d||'')[_0xfd0422(0xc4)](/\{CreatedAt\}/g,_0x32106a);return _0xd9eeba;}static async['processTemplate'](_0x2c1076,_0x3ef750,_0x4f8def,_0x1e556c,_0x1119e1=!![]){const _0x36932b=a61_0x175b81,_0x2e4fab=Date[_0x36932b(0xe4)]();try{_0x1119e1&&logger[_0x36932b(0xc1)](_0x36932b(0xcf),'开始处理模板内容替换',{'templatePath':_0x2c1076,'targetPath':_0x3ef750,'pageName':_0x4f8def,'templateName':_0x1e556c});await a61_0x526b22[_0x36932b(0xd4)][_0x36932b(0xba)](_0x3ef750,{'recursive':!![]}),await this[_0x36932b(0xf2)](_0x2c1076,_0x3ef750,_0x4f8def,_0x1e556c);if(_0x1119e1){const _0xfbe0cd=Date[_0x36932b(0xe4)]()-_0x2e4fab;logger['success']('template',_0x36932b(0xdc),_0xfbe0cd,{'pageName':_0x4f8def,'templateName':_0x1e556c});}}catch(_0x4d2c6f){if(_0x1119e1){const _0xab3850=Date[_0x36932b(0xe4)]()-_0x2e4fab;logger[_0x36932b(0xda)](_0x36932b(0xcf),'模板内容替换失败',{'templatePath':_0x2c1076,'targetPath':_0x3ef750,'pageName':_0x4f8def,'templateName':_0x1e556c,'error':_0x4d2c6f instanceof Error?_0x4d2c6f[_0x36932b(0xbc)]:String(_0x4d2c6f),'duration':_0xab3850});}throw _0x4d2c6f;}}static async['processDirectory'](_0x114351,_0x3740b3,_0x299265,_0x5e04ba){const _0xf1a15c=a61_0x175b81,_0x4d6ad1=await a61_0x526b22['promises'][_0xf1a15c(0xc8)](_0x114351,{'withFileTypes':!![]});for(const _0x5229ae of _0x4d6ad1){const _0x410d91=a61_0x19ab8c[_0xf1a15c(0xe9)](_0x114351,_0x5229ae[_0xf1a15c(0xd8)]);let _0x19ece2=a61_0x19ab8c['join'](_0x3740b3,_0x5229ae['name']);_0x5229ae[_0xf1a15c(0xd8)]['endsWith'](_0xf1a15c(0xe1))&&(_0x19ece2=a61_0x19ab8c['join'](_0x3740b3,_0x5229ae[_0xf1a15c(0xd8)][_0xf1a15c(0xc4)](/\.tpl$/,'')));if(_0x5229ae[_0xf1a15c(0xca)]())await a61_0x526b22[_0xf1a15c(0xd4)][_0xf1a15c(0xba)](_0x19ece2,{'recursive':!![]}),await this[_0xf1a15c(0xf2)](_0x410d91,_0x19ece2,_0x299265,_0x5e04ba);else _0x5229ae['isFile']()&&await this[_0xf1a15c(0xef)](_0x410d91,_0x19ece2,_0x299265,_0x5e04ba);}}static async[a61_0x175b81(0xef)](_0x4fadc9,_0x352a89,_0x514b3b,_0x3c62a1){const _0x5afe50=a61_0x175b81,_0xbe5603=a61_0x19ab8c[_0x5afe50(0xe2)](_0x4fadc9)[_0x5afe50(0xeb)]();_0x4fadc9['endsWith']('.tpl')&&(_0x352a89=_0x352a89[_0x5afe50(0xc4)](/\.tpl$/,''));const _0xce8d62=[_0x5afe50(0xcd),_0x5afe50(0xf7),_0x5afe50(0xd2),'.js','.json',_0x5afe50(0xce),_0x5afe50(0xbb),'.scss','.tpl'];if(_0xce8d62['includes'](_0xbe5603)||_0x4fadc9[_0x5afe50(0xc5)](_0x5afe50(0xe1))){const _0x2342ae=await a61_0x526b22['promises'][_0x5afe50(0xd0)](_0x4fadc9,_0x5afe50(0xf5)),_0x1ccbe1=this[_0x5afe50(0xf6)](_0x2342ae,_0x514b3b,_0x3c62a1);await a61_0x526b22[_0x5afe50(0xd4)][_0x5afe50(0xdd)](_0x352a89,_0x1ccbe1,_0x5afe50(0xf5));}else await a61_0x526b22[_0x5afe50(0xd4)][_0x5afe50(0xc9)](_0x4fadc9,_0x352a89);}}
1
+ function a63_0x3fb1(){const _0x391c16=['alias:\x20\x22','replaceContent','.tpl','.md','91YRLdoF','processTemplate','readdir','pop','.css','\x0a\x20\x20\x20\x20{\x20','split','promises','default','3957NjJMZH','mkdir','toComponentName','339018aWAPYp','2943964vkLjMd','template','name:\x20\x22','utf8','success','开始处理模板内容替换','10FxnrXK','name','slice','.jsx','error','join','.json','8736696SfCJUv','toISOString','map','80VOjPHQ','now','模板内容替换完成','replace','charAt','toUpperCase','api','isFile','isDirectory','1688208rARtki','.tsx','toLowerCase','datasetCode:\x20\x22','tableName:\x20\x22','processDirectory','toDisplayTitle','2-digit','6500456RDtxtX','replaceApiContent','writeFile','toLocaleDateString','extname','includes','alias','endsWith','processFile','info','copyFile','.ts','readFile','numeric','10kmMyMJ','4416159xNXVMa'];a63_0x3fb1=function(){return _0x391c16;};return a63_0x3fb1();}const a63_0x393cb3=a63_0x3abc;(function(_0x3826ed,_0x271382){const _0x25b21d=a63_0x3abc,_0xc9f895=_0x3826ed();while(!![]){try{const _0x39a6e0=parseInt(_0x25b21d(0x11e))/0x1*(-parseInt(_0x25b21d(0x132))/0x2)+parseInt(_0x25b21d(0x13b))/0x3+parseInt(_0x25b21d(0x122))/0x4*(parseInt(_0x25b21d(0x10f))/0x5)+-parseInt(_0x25b21d(0x121))/0x6*(parseInt(_0x25b21d(0x115))/0x7)+-parseInt(_0x25b21d(0x101))/0x8+parseInt(_0x25b21d(0x12f))/0x9+-parseInt(_0x25b21d(0x128))/0xa*(parseInt(_0x25b21d(0x110))/0xb);if(_0x39a6e0===_0x271382)break;else _0xc9f895['push'](_0xc9f895['shift']());}catch(_0x3c38a0){_0xc9f895['push'](_0xc9f895['shift']());}}}(a63_0x3fb1,0xdb639));import a63_0x4b419c from'node:fs';function a63_0x3abc(_0x41e548,_0x5aeb29){_0x41e548=_0x41e548-0xfd;const _0x3fb1ae=a63_0x3fb1();let _0x3abcb0=_0x3fb1ae[_0x41e548];return _0x3abcb0;}import a63_0x4c46f8 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static['toComponentName'](_0x3fae40){const _0x22b910=a63_0x3abc,_0x125d3f=_0x3fae40['split']('/')[_0x22b910(0x118)]()||_0x3fae40;return _0x125d3f[_0x22b910(0x11b)]('-')[_0x22b910(0x131)](_0x344b84=>_0x344b84['charAt'](0x0)[_0x22b910(0x137)]()+_0x344b84[_0x22b910(0x12a)](0x1)[_0x22b910(0x13d)]())[_0x22b910(0x12d)]('');}static[a63_0x393cb3(0xff)](_0x527dbf){const _0x362654=a63_0x393cb3,_0x9460ea=_0x527dbf['split']('/')[_0x362654(0x118)]()||_0x527dbf;return _0x9460ea['split']('-')[_0x362654(0x131)](_0x16e66a=>_0x16e66a[_0x362654(0x136)](0x0)[_0x362654(0x137)]()+_0x16e66a[_0x362654(0x12a)](0x1)[_0x362654(0x13d)]())['join']('\x20');}static[a63_0x393cb3(0x112)](_0x37e67d,_0x1f41eb,_0x21b04e){const _0x5f13ae=a63_0x393cb3,_0x3d76dd=this[_0x5f13ae(0x120)](_0x1f41eb),_0x5087da=this[_0x5f13ae(0xff)](_0x1f41eb),_0x3c09db=new Date(),_0x3a3b65=_0x3c09db['toLocaleString'](undefined,{'year':'numeric','month':_0x5f13ae(0x100),'day':_0x5f13ae(0x100),'hour':_0x5f13ae(0x100),'minute':_0x5f13ae(0x100),'second':'2-digit','hour12':![]})['replace'](/\//g,'-'),_0x3119bb=_0x3c09db[_0x5f13ae(0x104)](undefined,{'year':_0x5f13ae(0x10e),'month':_0x5f13ae(0x100),'day':'2-digit'})[_0x5f13ae(0x135)](/\//g,'-'),_0x176078=_0x3c09db['toLocaleTimeString'](undefined,{'hour12':![]});let _0x43d324=_0x37e67d['replace'](/\{ComponentName\}/g,_0x3d76dd)['replace'](/\{DisplayTitle\}/g,_0x5087da)[_0x5f13ae(0x135)](/\{PageName\}/g,_0x1f41eb)[_0x5f13ae(0x135)](/\{TemplateName\}/g,_0x21b04e)['replace'](/\{CreatedAt\}/g,_0x3a3b65)['replace'](/\{CreatedDate\}/g,_0x3119bb)[_0x5f13ae(0x135)](/\{CreatedTime\}/g,_0x176078);return _0x43d324;}static[a63_0x393cb3(0x102)](_0x2212f3,_0x30beac,_0x3e7df7,_0x52ab73,_0x438fec,_0x272388,_0x468382){const _0x2f72ad=a63_0x393cb3,_0x5524aa=new Date(),_0x458af2=_0x5524aa[_0x2f72ad(0x130)](),_0x160528=_0x3e7df7[_0x2f72ad(0x131)](_0x3cef13=>{const _0x20b55a=_0x2f72ad,_0x4f3b92=[_0x20b55a(0x13e)+_0x3cef13['datasetCode']+'\x22',_0x20b55a(0xfd)+_0x3cef13['tableName']+'\x22',_0x20b55a(0x124)+_0x3cef13['name']+'\x22'];return _0x3cef13[_0x20b55a(0x107)]&&_0x4f3b92['push'](_0x20b55a(0x111)+_0x3cef13[_0x20b55a(0x107)]+'\x22'),_0x20b55a(0x11a)+_0x4f3b92[_0x20b55a(0x12d)](',\x20')+'\x20},';})[_0x2f72ad(0x12d)](''),_0x3b2b33=_0x52ab73||_0x3e7df7[0x0]?.[_0x2f72ad(0x107)]||'YourModel';let _0x30727c=_0x2212f3['replace'](/\{AppCode\}/g,_0x30beac)[_0x2f72ad(0x135)](/\{ModelConfigs\}/g,_0x160528)[_0x2f72ad(0x135)](/\{ExampleModelName\}/g,_0x3b2b33)[_0x2f72ad(0x135)](/\{ApiFileName\}/g,_0x438fec||_0x2f72ad(0x138))['replace'](/\{ConfigName\}/g,_0x272388||_0x2f72ad(0x11d))[_0x2f72ad(0x135)](/\{ClientConfigParam\}/g,_0x468382||'')['replace'](/\{CreatedAt\}/g,_0x458af2);return _0x30727c;}static async[a63_0x393cb3(0x116)](_0x543e33,_0x320dd1,_0x3bf00c,_0x17cb1b,_0x1d8b3a=!![]){const _0x3e1b66=a63_0x393cb3,_0x1d7a15=Date[_0x3e1b66(0x133)]();try{_0x1d8b3a&&logger[_0x3e1b66(0x10a)](_0x3e1b66(0x123),_0x3e1b66(0x127),{'templatePath':_0x543e33,'targetPath':_0x320dd1,'pageName':_0x3bf00c,'templateName':_0x17cb1b});await a63_0x4b419c[_0x3e1b66(0x11c)][_0x3e1b66(0x11f)](_0x320dd1,{'recursive':!![]}),await this[_0x3e1b66(0xfe)](_0x543e33,_0x320dd1,_0x3bf00c,_0x17cb1b);if(_0x1d8b3a){const _0x47830a=Date['now']()-_0x1d7a15;logger[_0x3e1b66(0x126)](_0x3e1b66(0x123),_0x3e1b66(0x134),_0x47830a,{'pageName':_0x3bf00c,'templateName':_0x17cb1b});}}catch(_0x1c8506){if(_0x1d8b3a){const _0x5924f7=Date['now']()-_0x1d7a15;logger[_0x3e1b66(0x12c)](_0x3e1b66(0x123),'模板内容替换失败',{'templatePath':_0x543e33,'targetPath':_0x320dd1,'pageName':_0x3bf00c,'templateName':_0x17cb1b,'error':_0x1c8506 instanceof Error?_0x1c8506['message']:String(_0x1c8506),'duration':_0x5924f7});}throw _0x1c8506;}}static async['processDirectory'](_0xbed977,_0x514d21,_0x125e7e,_0x311d53){const _0x6b6e16=a63_0x393cb3,_0x2c9773=await a63_0x4b419c['promises'][_0x6b6e16(0x117)](_0xbed977,{'withFileTypes':!![]});for(const _0x14f9c3 of _0x2c9773){const _0x5782c5=a63_0x4c46f8[_0x6b6e16(0x12d)](_0xbed977,_0x14f9c3['name']);let _0x45f91c=a63_0x4c46f8[_0x6b6e16(0x12d)](_0x514d21,_0x14f9c3[_0x6b6e16(0x129)]);_0x14f9c3['name'][_0x6b6e16(0x108)](_0x6b6e16(0x113))&&(_0x45f91c=a63_0x4c46f8[_0x6b6e16(0x12d)](_0x514d21,_0x14f9c3[_0x6b6e16(0x129)][_0x6b6e16(0x135)](/\.tpl$/,'')));if(_0x14f9c3[_0x6b6e16(0x13a)]())await a63_0x4b419c[_0x6b6e16(0x11c)]['mkdir'](_0x45f91c,{'recursive':!![]}),await this[_0x6b6e16(0xfe)](_0x5782c5,_0x45f91c,_0x125e7e,_0x311d53);else _0x14f9c3[_0x6b6e16(0x139)]()&&await this[_0x6b6e16(0x109)](_0x5782c5,_0x45f91c,_0x125e7e,_0x311d53);}}static async[a63_0x393cb3(0x109)](_0x2c4d82,_0x4e716c,_0x1a5c89,_0x1b3c1f){const _0x6601b6=a63_0x393cb3,_0x145d2c=a63_0x4c46f8[_0x6601b6(0x105)](_0x2c4d82)[_0x6601b6(0x13d)]();_0x2c4d82[_0x6601b6(0x108)](_0x6601b6(0x113))&&(_0x4e716c=_0x4e716c[_0x6601b6(0x135)](/\.tpl$/,''));const _0x144f9d=[_0x6601b6(0x13c),_0x6601b6(0x10c),_0x6601b6(0x12b),'.js',_0x6601b6(0x12e),_0x6601b6(0x114),_0x6601b6(0x119),'.scss',_0x6601b6(0x113)];if(_0x144f9d[_0x6601b6(0x106)](_0x145d2c)||_0x2c4d82[_0x6601b6(0x108)](_0x6601b6(0x113))){const _0x41d246=await a63_0x4b419c['promises'][_0x6601b6(0x10d)](_0x2c4d82,_0x6601b6(0x125)),_0xb1f18d=this['replaceContent'](_0x41d246,_0x1a5c89,_0x1b3c1f);await a63_0x4b419c[_0x6601b6(0x11c)][_0x6601b6(0x103)](_0x4e716c,_0xb1f18d,_0x6601b6(0x125));}else await a63_0x4b419c[_0x6601b6(0x11c)][_0x6601b6(0x10b)](_0x2c4d82,_0x4e716c);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.2.3",
3
+ "version": "1.2.5-beta.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"