@lovrabet/cli 1.2.5-beta.1 → 1.2.5-beta.3

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 (81) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -0
  5. package/lib/ai-setup/config.js +1 -0
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/McpInstallUI.js +1 -0
  53. package/lib/mcp/claude.js +1 -1
  54. package/lib/mcp/cursor.js +1 -1
  55. package/lib/mcp/main.js +1 -1
  56. package/lib/skills/SkillInstallUI.js +1 -0
  57. package/lib/skills/main.js +1 -1
  58. package/lib/utils/check-sdk-version.js +1 -1
  59. package/lib/utils/config.js +1 -1
  60. package/lib/utils/copy-directory.js +1 -1
  61. package/lib/utils/http-client.js +1 -1
  62. package/lib/utils/logger.js +1 -1
  63. package/lib/utils/router-updater.js +1 -1
  64. package/lib/utils/sleep.js +1 -1
  65. package/lib/utils/template-replacer.js +1 -1
  66. package/package.json +1 -1
  67. package/templates/pages/blank/index.tsx.tpl +1 -2
  68. package/templates/pages/sdk-fetch/index.tsx.tpl +1 -2
  69. package/templates/rules/lovrabet_rules.mdc.tpl +109 -0
  70. package/templates/skills/.agent/skills/lovrabet/SKILL.md +258 -0
  71. package/templates/skills/.claude/skills/lovrabet/SKILL.md +1 -0
  72. package/templates/skills/.codebuddy/skills/lovrabet/SKILL.md +258 -0
  73. package/templates/skills/.codex/skills/lovrabet/SKILL.md +258 -0
  74. package/templates/skills/.cursor/commands/lovrabet.md +1 -0
  75. package/templates/skills/.opencode/skills/lovrabet/SKILL.md +258 -0
  76. package/templates/skills/.qoder/rules/lovrabet.md +258 -0
  77. package/templates/skills/.qoder/skills/lovrabet.md +258 -0
  78. package/templates/skills/.shared/guides/03-antd-style/guide.md +42 -0
  79. package/templates/skills/.shared/guides/07-backend-function/guide.md +679 -0
  80. package/templates/skills/.trae/skills/lovrabet/SKILL.md +258 -0
  81. package/templates/skills/.windsurf/workflows/lovrabet.md +1 -0
@@ -1 +1 @@
1
- const a46_0x578a88=a46_0x41d6;function a46_0x3233(){const _0x16de52=['now','3224649syPOkQ','message','29216ywRcNH','copy','4058978NcxWZL','12664496mgfabB','50gVglnx','复制项目文件','1027918gniTQU','开始复制项目模板','1419040vKmTNB','项目模板复制失败','resolve','info','success','343290ibvQCj','项目模板复制完成','../../templates/projects/sub-app-react-demo'];a46_0x3233=function(){return _0x16de52;};return a46_0x3233();}(function(_0x1f06b7,_0x6568c9){const _0x27a144=a46_0x41d6,_0x28d84d=_0x1f06b7();while(!![]){try{const _0x373826=parseInt(_0x27a144(0xe1))/0x1+parseInt(_0x27a144(0xdf))/0x2+parseInt(_0x27a144(0xea))/0x3+parseInt(_0x27a144(0xec))/0x4*(parseInt(_0x27a144(0xdd))/0x5)+-parseInt(_0x27a144(0xe6))/0x6+-parseInt(_0x27a144(0xdb))/0x7+-parseInt(_0x27a144(0xdc))/0x8;if(_0x373826===_0x6568c9)break;else _0x28d84d['push'](_0x28d84d['shift']());}catch(_0x1332f1){_0x28d84d['push'](_0x28d84d['shift']());}}}(a46_0x3233,0xd2277));import a46_0x75aae from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';function a46_0x41d6(_0x3f2826,_0x5f3936){_0x3f2826=_0x3f2826-0xdb;const _0x32333b=a46_0x3233();let _0x41d60a=_0x32333b[_0x3f2826];return _0x41d60a;}import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a46_0x75aae['dirname'](fileURLToPath(import.meta.url)),templateDir=a46_0x75aae[a46_0x578a88(0xe3)](__dirname,a46_0x578a88(0xe8));export function useCopyProjectTemplate(){const _0x2d3a5d=a46_0x578a88,[_0x1c406c,_0x6db95f]=useState(![]),[_0x419865,_0x27f718]=useState(![]),[_0x56f544,_0x3cf3b3]=useState(''),_0x5e47c7=useCallback(async _0x6f5133=>{const _0x1fe45b=a46_0x41d6,_0x15d83c=Date['now'](),_0xd52e9c=a46_0x75aae[_0x1fe45b(0xe3)](process['cwd'](),_0x6f5133);_0x6db95f(!![]);try{logger[_0x1fe45b(0xe4)](_0x1fe45b(0xed),_0x1fe45b(0xe0),{'projectCode':_0x6f5133,'templateDir':templateDir}),await copyDirectory(templateDir,_0xd52e9c);const _0x43cf74=Date[_0x1fe45b(0xe9)]()-_0x15d83c;logger[_0x1fe45b(0xe5)](_0x1fe45b(0xed),_0x1fe45b(0xe7),_0x43cf74,{'projectCode':_0x6f5133});}catch(_0x9b7f1d){const _0x1b89a4=Date['now']()-_0x15d83c;logger['error'](_0x1fe45b(0xed),_0x1fe45b(0xe2),{'projectCode':_0x6f5133,'error':_0x9b7f1d instanceof Error?_0x9b7f1d[_0x1fe45b(0xeb)]:String(_0x9b7f1d),'duration':_0x1b89a4});throw _0x9b7f1d;}finally{_0x6db95f(![]),_0x27f718(!![]),_0x3cf3b3(formatElapsed(_0x15d83c));}},[]);return{'taskName':_0x2d3a5d(0xde),'finished':_0x419865,'loading':_0x1c406c,'elapsed':_0x56f544,'doTask':_0x5e47c7};}
1
+ const a48_0x3beb79=a48_0x1786;(function(_0x34d1fa,_0x29e528){const _0x10f44b=a48_0x1786,_0x46b00d=_0x34d1fa();while(!![]){try{const _0x42ecef=parseInt(_0x10f44b(0x95))/0x1+-parseInt(_0x10f44b(0x8e))/0x2+parseInt(_0x10f44b(0x9d))/0x3*(-parseInt(_0x10f44b(0x99))/0x4)+parseInt(_0x10f44b(0x9b))/0x5+parseInt(_0x10f44b(0x96))/0x6*(parseInt(_0x10f44b(0x97))/0x7)+-parseInt(_0x10f44b(0x9a))/0x8*(parseInt(_0x10f44b(0x8f))/0x9)+parseInt(_0x10f44b(0x9c))/0xa;if(_0x42ecef===_0x29e528)break;else _0x46b00d['push'](_0x46b00d['shift']());}catch(_0x4ce07e){_0x46b00d['push'](_0x46b00d['shift']());}}}(a48_0x161b,0x3828a));function a48_0x1786(_0x18e31f,_0x345458){_0x18e31f=_0x18e31f-0x8b;const _0x161b8b=a48_0x161b();let _0x1786a5=_0x161b8b[_0x18e31f];return _0x1786a5;}function a48_0x161b(){const _0x36b81d=['2520510EeUWhM','2211oWZDTt','now','../../templates/projects/sub-app-react-demo','resolve','46062UDbIuy','655128nFWZuv','开始复制项目模板','dirname','info','error','copy','273543myKisg','1986XyvJfC','1799kScOXr','success','1908VVmKtS','48TQsRuI','2153485MUkPiU'];a48_0x161b=function(){return _0x36b81d;};return a48_0x161b();}import a48_0x32c69c from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a48_0x32c69c[a48_0x3beb79(0x91)](fileURLToPath(import.meta.url)),templateDir=a48_0x32c69c[a48_0x3beb79(0x8d)](__dirname,a48_0x3beb79(0x8c));export function useCopyProjectTemplate(){const [_0x4e4e80,_0x3e0206]=useState(![]),[_0x1765f5,_0x147f90]=useState(![]),[_0x3a989b,_0x48b6c7]=useState(''),_0x1f8e3d=useCallback(async _0x33c29b=>{const _0x454410=a48_0x1786,_0x5ec90e=Date[_0x454410(0x8b)](),_0x3db0c6=a48_0x32c69c[_0x454410(0x8d)](process['cwd'](),_0x33c29b);_0x3e0206(!![]);try{logger[_0x454410(0x92)]('copy',_0x454410(0x90),{'projectCode':_0x33c29b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x3db0c6);const _0x1c25de=Date[_0x454410(0x8b)]()-_0x5ec90e;logger[_0x454410(0x98)](_0x454410(0x94),'项目模板复制完成',_0x1c25de,{'projectCode':_0x33c29b});}catch(_0x2523d6){const _0x4e70d7=Date[_0x454410(0x8b)]()-_0x5ec90e;logger[_0x454410(0x93)]('copy','项目模板复制失败',{'projectCode':_0x33c29b,'error':_0x2523d6 instanceof Error?_0x2523d6['message']:String(_0x2523d6),'duration':_0x4e70d7});throw _0x2523d6;}finally{_0x3e0206(![]),_0x147f90(!![]),_0x48b6c7(formatElapsed(_0x5ec90e));}},[]);return{'taskName':'复制项目文件','finished':_0x1765f5,'loading':_0x4e4e80,'elapsed':_0x3a989b,'doTask':_0x1f8e3d};}
@@ -1 +1 @@
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
+ function a49_0x3c97(){const _0x19a10d=['info','代码格式化完成','开始格式化代码','success','1972098wcpIjm','193FylXDc','格式化代码','5COsujJ','759022bTAQIP','3030SYMoFd','resolve','now','10926DJyOSC','6iQyyUa','message','prettier','3402lUSVuC','代码格式化失败','2481344KJGDnm','npx','2549449EIGxAX','format','56728uUIcuw'];a49_0x3c97=function(){return _0x19a10d;};return a49_0x3c97();}(function(_0x2a5748,_0x3b26b2){const _0x3ce412=a49_0x3285,_0x352cc1=_0x2a5748();while(!![]){try{const _0x53ca60=parseInt(_0x3ce412(0x1b4))/0x1*(-parseInt(_0x3ce412(0x1bf))/0x2)+parseInt(_0x3ce412(0x1bc))/0x3*(parseInt(_0x3ce412(0x1ae))/0x4)+parseInt(_0x3ce412(0x1b6))/0x5*(parseInt(_0x3ce412(0x1b3))/0x6)+parseInt(_0x3ce412(0x1c3))/0x7+parseInt(_0x3ce412(0x1c1))/0x8+parseInt(_0x3ce412(0x1bb))/0x9*(-parseInt(_0x3ce412(0x1b8))/0xa)+-parseInt(_0x3ce412(0x1b7))/0xb;if(_0x53ca60===_0x3b26b2)break;else _0x352cc1['push'](_0x352cc1['shift']());}catch(_0x2fb77f){_0x352cc1['push'](_0x352cc1['shift']());}}}(a49_0x3c97,0x4102d));import a49_0x2df782 from'node:path';import{useCallback,useState}from'react';function a49_0x3285(_0x4462b5,_0x2b98f5){_0x4462b5=_0x4462b5-0x1ad;const _0x3c9710=a49_0x3c97();let _0x3285c9=_0x3c9710[_0x4462b5];return _0x3285c9;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x5d2667=a49_0x3285,[_0x52a43f,_0x4ff965]=useState(![]),[_0x38bff8,_0x4f7e81]=useState(![]),[_0x50bf1f,_0x146a57]=useState(''),_0x4adc02=useCallback(async _0x4ad5c8=>{const _0x440844=a49_0x3285,_0x5b27f9=Date[_0x440844(0x1ba)](),_0x4aff78=a49_0x2df782[_0x440844(0x1b9)](process['cwd'](),_0x4ad5c8);_0x4ff965(!![]);try{logger[_0x440844(0x1af)](_0x440844(0x1ad),_0x440844(0x1b1),{'projectCode':_0x4ad5c8}),await execa(_0x440844(0x1c2),[_0x440844(0x1be),'--write','.'],{'cwd':_0x4aff78});const _0x17f0fe=Date[_0x440844(0x1ba)]()-_0x5b27f9;logger[_0x440844(0x1b2)](_0x440844(0x1ad),_0x440844(0x1b0),_0x17f0fe,{'projectCode':_0x4ad5c8});}catch(_0x4b32f9){const _0xdbb494=Date[_0x440844(0x1ba)]()-_0x5b27f9;logger['error'](_0x440844(0x1ad),_0x440844(0x1c0),{'projectCode':_0x4ad5c8,'error':_0x4b32f9 instanceof Error?_0x4b32f9[_0x440844(0x1bd)]:String(_0x4b32f9),'duration':_0xdbb494});throw _0x4b32f9;}finally{_0x4ff965(![]),_0x4f7e81(!![]),_0x146a57(formatElapsed(_0x5b27f9));}},[]);return{'taskName':_0x5d2667(0x1b5),'finished':_0x38bff8,'loading':_0x52a43f,'elapsed':_0x50bf1f,'doTask':_0x4adc02};}
@@ -1 +1 @@
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};}
1
+ function a50_0x29ea(){const _0x496575=['2430664HfCfqA','175gLzGku','安装依赖','145776CfynKU','429FnBzGo','依赖安装失败','1089MtHosR','info','resolve','383720MZLiDt','message','18534loizjY','npm','now','--registry','2PibcIz','3118256pGQtqb','65080BRuyvK','21jUeiTb','install','error','1370070SVcUUf','依赖安装完成','https://registry.npmmirror.com'];a50_0x29ea=function(){return _0x496575;};return a50_0x29ea();}(function(_0x2d67a0,_0x3fc961){const _0x1c60cd=a50_0x3f97,_0x40e3ef=_0x2d67a0();while(!![]){try{const _0x50bddb=parseInt(_0x1c60cd(0x17b))/0x1+-parseInt(_0x1c60cd(0x181))/0x2*(-parseInt(_0x1c60cd(0x187))/0x3)+-parseInt(_0x1c60cd(0x182))/0x4+-parseInt(_0x1c60cd(0x18b))/0x5*(parseInt(_0x1c60cd(0x17d))/0x6)+parseInt(_0x1c60cd(0x184))/0x7*(parseInt(_0x1c60cd(0x18a))/0x8)+-parseInt(_0x1c60cd(0x178))/0x9*(parseInt(_0x1c60cd(0x183))/0xa)+parseInt(_0x1c60cd(0x176))/0xb*(parseInt(_0x1c60cd(0x18d))/0xc);if(_0x50bddb===_0x3fc961)break;else _0x40e3ef['push'](_0x40e3ef['shift']());}catch(_0x2ac455){_0x40e3ef['push'](_0x40e3ef['shift']());}}}(a50_0x29ea,0x86686));function a50_0x3f97(_0x2e29b2,_0x46352c){_0x2e29b2=_0x2e29b2-0x176;const _0x29ea7d=a50_0x29ea();let _0x3f97c4=_0x29ea7d[_0x2e29b2];return _0x3f97c4;}import a50_0x17484c 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 _0x157613=a50_0x3f97,[_0x7860a7,_0x36aaa0]=useState(![]),[_0x50b0e2,_0x2d264c]=useState(![]),[_0x26167b,_0x2ac126]=useState(''),_0x4f73f9=useCallback(async _0x52cd1d=>{const _0x33af1a=a50_0x3f97,_0x263963=Date[_0x33af1a(0x17f)](),_0x191194=a50_0x17484c[_0x33af1a(0x17a)](process['cwd'](),_0x52cd1d);_0x36aaa0(!![]),_0x2d264c(![]);const _0x2fc1de=async(_0x3159b7,_0x156099)=>{await execa(_0x3159b7,_0x156099,{'cwd':_0x191194});};try{logger[_0x33af1a(0x179)](_0x33af1a(0x185),'开始安装依赖',{'projectCode':_0x52cd1d,'registry':_0x33af1a(0x189)}),await _0x2fc1de(_0x33af1a(0x17e),['install',_0x33af1a(0x180),'https://registry.npmmirror.com']);const _0x21543e=Date[_0x33af1a(0x17f)]()-_0x263963;logger['success']('install',_0x33af1a(0x188),_0x21543e,{'projectCode':_0x52cd1d});}catch(_0x58c1c5){const _0x3c42a2=Date[_0x33af1a(0x17f)]()-_0x263963;logger[_0x33af1a(0x186)](_0x33af1a(0x185),_0x33af1a(0x177),{'projectCode':_0x52cd1d,'error':_0x58c1c5 instanceof Error?_0x58c1c5[_0x33af1a(0x17c)]:String(_0x58c1c5),'duration':_0x3c42a2});throw _0x58c1c5;}finally{_0x36aaa0(![]),_0x2d264c(!![]),_0x2ac126(formatElapsed(_0x263963));}},[]);return{'taskName':_0x157613(0x18c),'finished':_0x50b0e2,'loading':_0x7860a7,'elapsed':_0x26167b,'doTask':_0x4f73f9};}
package/lib/help.js CHANGED
@@ -1 +1 @@
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)})]})]});}
1
+ (function(_0x3bc0d0,_0x351db0){var _0x99d394=a51_0x1508,_0x439137=_0x3bc0d0();while(!![]){try{var _0x338385=parseInt(_0x99d394(0xcf))/0x1+parseInt(_0x99d394(0xca))/0x2+-parseInt(_0x99d394(0xce))/0x3+parseInt(_0x99d394(0xc7))/0x4+-parseInt(_0x99d394(0xc6))/0x5+-parseInt(_0x99d394(0xcb))/0x6+-parseInt(_0x99d394(0xcc))/0x7*(-parseInt(_0x99d394(0xd0))/0x8);if(_0x338385===_0x351db0)break;else _0x439137['push'](_0x439137['shift']());}catch(_0x19941e){_0x439137['push'](_0x439137['shift']());}}}(a51_0x2662,0x74b92));function a51_0x1508(_0x4ad80c,_0x202894){_0x4ad80c=_0x4ad80c-0xc6;var _0x26626a=a51_0x2662();var _0x1508d9=_0x26626a[_0x4ad80c];return _0x1508d9;}import{jsx as a51_0x791eca,jsxs as a51_0x566ace}from'react/jsx-runtime';function a51_0x2662(){var _0x11dcd5=['1176385MABksz','!\x20请指定一个有效的命令。','1522977CZVIgc','356575ujschF','40ZNbuyH','查看可用命令。','1775170pFTVqQ','1188288fphoKa','lovrabet\x20--help','column','1523894lopWkL','5490468ioUaav'];a51_0x2662=function(){return _0x11dcd5;};return a51_0x2662();}import{Box,Text}from'ink';export function Help(){var _0x35d26e=a51_0x1508;return a51_0x566ace(Box,{'flexDirection':_0x35d26e(0xc9),'marginTop':0x1,'marginBottom':0x1,'children':[a51_0x566ace(Box,{'children':[a51_0x791eca(Box,{'width':'1'}),a51_0x791eca(Text,{'children':_0x35d26e(0xcd)})]}),a51_0x566ace(Box,{'marginTop':0x1,'children':[a51_0x791eca(Box,{'width':'1'}),a51_0x566ace(Text,{'children':['\x20\x20','使用']}),a51_0x566ace(Text,{'bold':!![],'color':'green','children':['\x20',_0x35d26e(0xc8),'\x20']}),a51_0x791eca(Text,{'children':_0x35d26e(0xd1)})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
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)})});}
1
+ (function(_0x14539f,_0x38e7ef){const _0x443af0=a52_0xf997,_0x3b6f7d=_0x14539f();while(!![]){try{const _0x4b93ea=-parseInt(_0x443af0(0x1e4))/0x1*(-parseInt(_0x443af0(0x1d5))/0x2)+-parseInt(_0x443af0(0x1e3))/0x3*(parseInt(_0x443af0(0x1e8))/0x4)+parseInt(_0x443af0(0x1e6))/0x5*(-parseInt(_0x443af0(0x1cf))/0x6)+-parseInt(_0x443af0(0x1bf))/0x7+parseInt(_0x443af0(0x1c9))/0x8+-parseInt(_0x443af0(0x1e2))/0x9+parseInt(_0x443af0(0x1e5))/0xa;if(_0x4b93ea===_0x38e7ef)break;else _0x3b6f7d['push'](_0x3b6f7d['shift']());}catch(_0x29acb0){_0x3b6f7d['push'](_0x3b6f7d['shift']());}}}(a52_0x1f4c,0xed96b));import{jsxs as a52_0x3846f4,jsx as a52_0x21e8f2}from'react/jsx-runtime';function a52_0x1f4c(){const _0x4c2554=['cyan','gray','当前目录已存在\x20.lovrabetrc\x20文件','\x20←\x20','online','ctrl','parse','length','13235238vKorOv','6pKvrpj','163935KRVuWb','48407400EyltIx','2690785WDkZVd','message','3369416oloiVY','cwd','应用代码只能包含字母、数字、-\x20和\x20_','init','setLogPath','package.json','应用代码长度不能超过\x20100\x20个字符','1.0.0','env','8133853pJDFms','utf8','return','创建配置文件失败:\x20','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','请输入应用代码\x20(AppCode):\x20','version','trim','slice','应用代码不合法','2087024YBATFI','初始化项目配置文件成功','应用代码不能为空','AppCode:\x20','exit','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','18oAskCe','../..','正在初始化配置文件...','delete','column','test','22PlrejR','.lovrabetrc','green','info','error'];a52_0x1f4c=function(){return _0x4c2554;};return a52_0x1f4c();}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 a52_0xf997(_0x2ddc69,_0x485df1){_0x2ddc69=_0x2ddc69-0x1be;const _0x1f4cdf=a52_0x1f4c();let _0xf997be=_0x1f4cdf[_0x2ddc69];return _0xf997be;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x1c9724,env:_0x2f2e2a}){const _0x5306fa=a52_0xf997,[_0x1dbeec,_0x5a4175]=useState(null),[_0x5a0282,_0x3b8818]=useState(![]),[_0x393e04,_0x18a162]=useState(!_0x1c9724),[_0x4755bb,_0x2d6ee0]=useState(''),[_0x393994,_0x1aadfa]=useState(''),[_0x52848b,_0x4fc40b]=useState(_0x1c9724||''),[_0x459fd6]=useState(_0x2f2e2a);function _0x25b2f9(_0x265513){const _0x57b6b4=a52_0xf997;if(_0x265513[_0x57b6b4(0x1e1)]===0x0)return{'valid':![],'message':''};if(_0x265513[_0x57b6b4(0x1e1)]>0x64)return{'valid':![],'message':_0x57b6b4(0x1ee)};const _0x393def=/^[A-Za-z0-9_-]+$/;if(!_0x393def[_0x57b6b4(0x1d4)](_0x265513))return{'valid':![],'message':_0x57b6b4(0x1ea)};return{'valid':!![]};}useInput((_0x48ab39,_0x186b0d)=>{const _0x414baa=a52_0xf997;if(!_0x393e04)return;if(_0x186b0d[_0x414baa(0x1c1)]){if(_0x393994||!_0x4755bb[_0x414baa(0x1c6)]()){_0x1aadfa(_0x414baa(0x1cb));return;}const _0x283a0b=_0x4755bb[_0x414baa(0x1c6)](),{valid:_0x3439e4,message:_0x469bea}=_0x25b2f9(_0x283a0b);if(!_0x3439e4){_0x1aadfa(_0x469bea||_0x414baa(0x1c8));return;}_0x4fc40b(_0x283a0b),_0x18a162(![]);}else{if(_0x186b0d['backspace']||_0x186b0d[_0x414baa(0x1d2)])_0x2d6ee0(_0x545997=>{const _0x412b2e=_0x414baa,_0x4801b2=_0x545997[_0x412b2e(0x1c7)](0x0,-0x1);if(_0x4801b2['length']===0x0)_0x1aadfa('');else{const {valid:_0x2e2fa7,message:_0x4369a4}=_0x25b2f9(_0x4801b2);_0x1aadfa(_0x2e2fa7?'':_0x4369a4||_0x412b2e(0x1c8));}return _0x4801b2;});else _0x186b0d[_0x414baa(0x1df)]&&_0x48ab39==='c'?process[_0x414baa(0x1cd)](0x0):_0x2d6ee0(_0x55b458=>{const _0x356d1f=_0x414baa,_0x2e4924=_0x55b458+_0x48ab39,{valid:_0x53ed96,message:_0x22a019}=_0x25b2f9(_0x2e4924);return _0x1aadfa(_0x53ed96?'':_0x22a019||_0x356d1f(0x1c8)),_0x2e4924;});}},{'isActive':_0x393e04}),useEffect(()=>{const _0x3dbc9d=a52_0xf997;if(!_0x52848b||_0x393e04)return;const _0xb5ec7c=resolve(process[_0x3dbc9d(0x1e9)](),_0x3dbc9d(0x1d6));if(existsSync(_0xb5ec7c)){_0x5a4175(_0x3dbc9d(0x1dc)),setTimeout(()=>process[_0x3dbc9d(0x1cd)](0x1),0x64);return;}try{const _0x5a5b84=fileURLToPath(import.meta.url),_0x5a489c=resolve(dirname(_0x5a5b84),_0x3dbc9d(0x1d0)),_0xd62996=join(_0x5a489c,_0x3dbc9d(0x1ed));let _0x10435a='1.0.0';try{const _0x2bbb42=JSON[_0x3dbc9d(0x1e0)](readFileSync(_0xd62996,_0x3dbc9d(0x1c0)));_0x10435a=_0x2bbb42[_0x3dbc9d(0x1c5)]||_0x3dbc9d(0x1ef);}catch(_0x1fcdaa){}const _0xb4e889=readConfig(),_0x47cdaa=typeof _0xb4e889[_0x3dbc9d(0x1be)]==='string'?_0xb4e889[_0x3dbc9d(0x1be)]:undefined,{app:_0x148fd1,appcode:_0x204875,..._0x2884f5}=_0xb4e889,_0x4740f9={..._0x2884f5,'appcode':_0x52848b,'env':_0x459fd6||_0x47cdaa||_0x3dbc9d(0x1de),'createdAt':new Date()['toLocaleString'](),'version':_0x10435a};writeFileSync(_0xb5ec7c,JSON['stringify'](_0x4740f9,null,0x2),{'encoding':_0x3dbc9d(0x1c0),'mode':0x180}),logger[_0x3dbc9d(0x1ec)](process[_0x3dbc9d(0x1e9)]()),logger[_0x3dbc9d(0x1d8)](_0x3dbc9d(0x1eb),_0x3dbc9d(0x1ca),{'appcode':_0x52848b,'env':_0x4740f9[_0x3dbc9d(0x1be)],'version':_0x4740f9[_0x3dbc9d(0x1c5)],'configPath':_0xb5ec7c}),_0x3b8818(!![]),setTimeout(()=>process[_0x3dbc9d(0x1cd)](0x0),0x64);}catch(_0x4d4b00){logger[_0x3dbc9d(0x1d9)](_0x3dbc9d(0x1eb),'创建配置文件失败',{'error':_0x4d4b00 instanceof Error?_0x4d4b00['message']:String(_0x4d4b00)}),_0x5a4175(_0x3dbc9d(0x1c2)+(_0x4d4b00 instanceof Error?_0x4d4b00[_0x3dbc9d(0x1e7)]:String(_0x4d4b00))),setTimeout(()=>process[_0x3dbc9d(0x1cd)](0x1),0x64);}},[_0x52848b,_0x393e04,_0x459fd6]);if(_0x1dbeec)return a52_0x21e8f2(Box,{'flexDirection':_0x5306fa(0x1d3),'children':a52_0x3846f4(Text,{'color':'red','children':['✗\x20',_0x1dbeec]})});if(_0x393e04)return a52_0x3846f4(Box,{'flexDirection':'column','children':[a52_0x3846f4(Box,{'children':[a52_0x21e8f2(Text,{'color':_0x5306fa(0x1da),'children':_0x5306fa(0x1c4)}),_0x4755bb?a52_0x21e8f2(Text,{'color':'green','children':_0x4755bb}):a52_0x21e8f2(Text,{'color':_0x5306fa(0x1db),'children':'_'}),_0x393994&&a52_0x3846f4(Text,{'color':'red','children':[_0x5306fa(0x1dd),_0x393994]})]}),!_0x393994&&!_0x4755bb&&a52_0x21e8f2(Box,{'children':a52_0x21e8f2(Text,{'color':_0x5306fa(0x1db),'children':_0x5306fa(0x1c3)})})]});if(_0x5a0282)return a52_0x3846f4(Box,{'flexDirection':'column','children':[a52_0x21e8f2(Text,{'color':_0x5306fa(0x1d7),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a52_0x3846f4(Text,{'color':_0x5306fa(0x1da),'children':[_0x5306fa(0x1cc),_0x52848b]}),a52_0x21e8f2(Text,{'children':_0x5306fa(0x1ce)})]});return a52_0x21e8f2(Box,{'children':a52_0x21e8f2(Text,{'children':_0x5306fa(0x1d1)})});}
@@ -0,0 +1 @@
1
+ const a53_0x26e317=a53_0x4753;(function(_0x4ab9d6,_0x5ac830){const _0x4e1adc=a53_0x4753,_0x5ded75=_0x4ab9d6();while(!![]){try{const _0x1aa05e=-parseInt(_0x4e1adc(0xf4))/0x1*(parseInt(_0x4e1adc(0x102))/0x2)+-parseInt(_0x4e1adc(0xec))/0x3+parseInt(_0x4e1adc(0xcc))/0x4+parseInt(_0x4e1adc(0xc4))/0x5+-parseInt(_0x4e1adc(0xd2))/0x6*(-parseInt(_0x4e1adc(0xe2))/0x7)+parseInt(_0x4e1adc(0x11b))/0x8*(parseInt(_0x4e1adc(0xdd))/0x9)+parseInt(_0x4e1adc(0xf5))/0xa;if(_0x1aa05e===_0x5ac830)break;else _0x5ded75['push'](_0x5ded75['shift']());}catch(_0x36aaf4){_0x5ded75['push'](_0x5ded75['shift']());}}}(a53_0x383c,0x82089));import{jsx as a53_0x40ce12,jsxs as a53_0x244792,Fragment as a53_0x52d9da}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';function a53_0x383c(){const _0x59afd4=['\x20\x20AppCode:\x20','\x20-e\x20LOVRABET_ENV=','\x20-e\x20LOVRABET_APP_CODE=','.cursor','object','configuring','*\x20请选择要配置的\x20IDE:','\x20\x20⚠️','add','Cursor','复制\x20Cursor\x20Rules\x20文件失败','agents.md\x20模板文件不存在','\x20\x20}','warn','upArrow','按任意键退出...','cwd','delete','appcode','已选择\x20IDE','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','claude\x20mcp\x20add\x20','正在配置\x20MCP\x20服务器...','has','未找到\x20appcode\x20配置','其他\x20IDE\x20配置指引','⚠️\x20\x20未找到\x20appcode\x20配置','message','blue','25805koWXEa','error','size','agents.md','mcp.json','../../templates/rules/lovrabet_rules.mdc.tpl','length','description','706852hEtTLm','\x20\x20\x20请先运行\x20\x27lovrabet\x20init\x20--appcode\x20<your-app-code>\x27\x20初始化项目配置\x0a','label','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','manual','66SqYPmU','info','some','\x20\x20重启\x20Cursor\x20后生效\x0a','success','请至少选择一个\x20IDE','复制\x20agents.md\x20文件失败','\x20\x20\x22mcpServers\x22:\x20{','filter','cursor','env','70299zrVOqS','white','mcp-install','online','\x20\x20环境:\x20','1246bFvIKK','其他\x20IDE','claude','includes','parse','✓\x20MCP\x20配置完成!','done','\x20\x20✓','[\x20]','@lovrabet/dataset-mcp-server@latest','1666854DnPvAG','return','status','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','\x20\x20Cursor\x20Rules\x20文件已存在,跳过\x0a','*\x20配置\x20Lovrabet\x20MCP\x20服务器','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20✗','103qJjXYL','14994470DrjByb',',\x20env=','every','已写入\x20.cursor/mcp.json','cyan','rules','其他\x20IDE\x20配置指引已显示','column','请手动执行','配置指引已显示','npx','gray','ide','15346zDZjVM','⚠️\x20配置需要手动完成','stringify','utf-8','yellow','请手动执行上述命令','Cursor\x20IDE','\x22:\x20{','join','mcpServers','app','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认','log','[✓]','lovrabet_rules.mdc','Claude\x20Code\x20MCP\x20命令已生成','Claude\x20Code\x20CLI','value','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','✓\x20创建\x20agents.md\x20到项目根目录\x0a','other','\x20\x20agents.md\x20已存在,跳过\x0a','green','name','需要先配置\x20appcode','200wlsElH','selecting','📚\x20详细配置指南:\x20https://help.yuntoo.com/mcp/config-guide\x0a','from','Cursor\x20Rules\x20模板文件不存在','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','map','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20['];a53_0x383c=function(){return _0x59afd4;};return a53_0x383c();}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';function a53_0x4753(_0x108ecd,_0x2d21ac){_0x108ecd=_0x108ecd-0xa8;const _0x383c9f=a53_0x383c();let _0x4753d7=_0x383c9f[_0x108ecd];return _0x4753d7;}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a53_0x26e317(0xb0),'description':a53_0x26e317(0x108)},'claude':{'name':'Claude\x20Code','description':a53_0x26e317(0x112)},'other':{'name':a53_0x26e317(0xe3),'description':a53_0x26e317(0xc0)}},IDE_LIST=[a53_0x26e317(0xdb),a53_0x26e317(0xe4),'other'],MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a53_0x26e317(0xff),MCP_ARGS=[a53_0x26e317(0xeb)];export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x51227d=a53_0x26e317,{exit:_0x232a7e}=useApp(),[_0x11259f,_0x17268b]=useState(_0x51227d(0x11c)),[_0x1aef9a,_0xb91f20]=useState(new Set(preselectedIDEs[_0x51227d(0x121)](_0x2e3dc2=>IDE_LIST['indexOf'](_0x2e3dc2))['filter'](_0x17a276=>_0x17a276>=0x0))),[_0x48f653,_0x41befe]=useState(0x0),[_0x1bf2bd,_0x50eeb8]=useState([]),[_0x107bee,_0x2f1544]=useState([]),[_0x3c44a1,_0x3697e6]=useState('');useEffect(()=>{const _0x1b5dae=_0x51227d;preselectedIDEs[_0x1b5dae(0xca)]>0x0&&_0x1aef9a[_0x1b5dae(0xc6)]>0x0&&_0x24757d();},[]),useInput((_0x207bc4,_0x2930d0)=>{const _0x341a48=_0x51227d;if(_0x11259f===_0x341a48(0x11c)){if(_0x2930d0[_0x341a48(0xb5)]){_0x41befe(_0x417dad=>_0x417dad>0x0?_0x417dad-0x1:IDE_LIST[_0x341a48(0xca)]-0x1);return;}if(_0x2930d0['downArrow']){_0x41befe(_0x38a3b9=>_0x38a3b9<IDE_LIST[_0x341a48(0xca)]-0x1?_0x38a3b9+0x1:0x0);return;}if(_0x207bc4==='\x20'){_0xb91f20(_0x1bbbed=>{const _0x195f2f=_0x341a48,_0x591e3b=new Set(_0x1bbbed);return _0x591e3b[_0x195f2f(0xbe)](_0x48f653)?_0x591e3b[_0x195f2f(0xb8)](_0x48f653):_0x591e3b[_0x195f2f(0xaf)](_0x48f653),_0x591e3b;});return;}if(_0x207bc4==='a'||_0x207bc4==='A'){_0xb91f20(new Set(IDE_LIST[_0x341a48(0x121)]((_0x55a137,_0x449c67)=>_0x449c67)));return;}if(_0x207bc4==='i'||_0x207bc4==='I'||_0x207bc4==='r'||_0x207bc4==='R'){_0xb91f20(_0xbeb1cb=>{const _0x535c0e=_0x341a48,_0x562c71=new Set();for(let _0x3316fa=0x0;_0x3316fa<IDE_LIST[_0x535c0e(0xca)];_0x3316fa++){!_0xbeb1cb[_0x535c0e(0xbe)](_0x3316fa)&&_0x562c71[_0x535c0e(0xaf)](_0x3316fa);}return _0x562c71;});return;}if(_0x207bc4==='q'||_0x207bc4==='Q'){_0x232a7e();return;}if(_0x2930d0[_0x341a48(0xed)]){if(_0x1aef9a[_0x341a48(0xc6)]===0x0){_0x3697e6(_0x341a48(0xd7));return;}_0x24757d();return;}}if(_0x11259f==='done'){_0x232a7e();return;}});async function _0x24757d(){const _0xeeac6f=_0x51227d,_0x53eace=Array[_0xeeac6f(0x11e)](_0x1aef9a)[_0xeeac6f(0x121)](_0x17cb1b=>IDE_LIST[_0x17cb1b])[_0xeeac6f(0xda)](_0x57a8d0=>_0x57a8d0!==undefined);_0x50eeb8([{'label':_0xeeac6f(0xba),'value':_0x1aef9a[_0xeeac6f(0xc6)]+'\x20个'}]),_0x17268b('configuring');const _0x3d1603=[];for(const _0x1bff3c of _0x53eace){try{const _0xa6d16a=await configureMcp(_0x1bff3c),_0x542428=_0xa6d16a[_0xeeac6f(0xe5)](_0xeeac6f(0xfd));_0x3d1603['push']({'ide':IDE_CONFIGS[_0x1bff3c][_0xeeac6f(0x119)],'status':_0x542428?_0xeeac6f(0xd1):_0xeeac6f(0xd6),'message':_0xa6d16a});}catch(_0x377b29){_0x3d1603['push']({'ide':IDE_CONFIGS[_0x1bff3c][_0xeeac6f(0x119)],'status':_0xeeac6f(0xc5),'message':_0x377b29 instanceof Error?_0x377b29[_0xeeac6f(0xc2)]:String(_0x377b29)});}}_0x2f1544(_0x3d1603),_0x17268b('done'),setTimeout(()=>{_0x232a7e();},0x1388);}return a53_0x244792(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x11259f===_0x51227d(0x11c)&&a53_0x244792(a53_0x52d9da,{'children':[a53_0x40ce12(Box,{'children':a53_0x40ce12(Text,{'color':_0x51227d(0xf9),'children':_0x51227d(0xf1)})}),_0x3c44a1&&a53_0x40ce12(Box,{'marginTop':0x1,'children':a53_0x244792(Text,{'color':'red','children':['✗\x20',_0x3c44a1]})}),a53_0x244792(Box,{'marginTop':0x1,'flexDirection':_0x51227d(0xfc),'children':[a53_0x40ce12(Text,{'bold':!![],'children':_0x51227d(0xad)}),IDE_LIST[_0x51227d(0x121)]((_0x17ed64,_0x19f2d8)=>{const _0x2553f4=_0x51227d,_0x3a2738=_0x48f653===_0x19f2d8,_0x4cbb55=_0x1aef9a[_0x2553f4(0xbe)](_0x19f2d8);return a53_0x40ce12(Box,{'children':a53_0x244792(Text,{'backgroundColor':_0x3a2738?_0x2553f4(0xc3):undefined,'color':_0x3a2738?'white':undefined,'children':['\x20\x20',_0x4cbb55?_0x2553f4(0x10f):_0x2553f4(0xea),'\x20',IDE_CONFIGS[_0x17ed64]['name'],'\x20',a53_0x244792(Text,{'color':_0x3a2738?'white':'gray','dimColor':!_0x3a2738,'children':['-\x20',IDE_CONFIGS[_0x17ed64][_0x2553f4(0xcb)]]})]})},_0x17ed64);}),a53_0x40ce12(Box,{'marginTop':0x1,'children':a53_0x244792(Text,{'color':_0x51227d(0x100),'children':['\x20',_0x51227d(0x10d)]})})]})]}),_0x11259f===_0x51227d(0xac)&&a53_0x244792(a53_0x52d9da,{'children':[_0x1bf2bd[_0x51227d(0x121)]((_0xf57130,_0x1bed18)=>a53_0x244792(Box,{'children':[a53_0x244792(Text,{'color':'green','children':['√\x20',_0xf57130[_0x51227d(0xce)],':\x20']}),a53_0x40ce12(Text,{'color':_0x51227d(0xf9),'children':_0xf57130[_0x51227d(0x113)]})]},_0x1bed18)),a53_0x40ce12(Box,{'marginTop':0x1,'children':a53_0x40ce12(Text,{'children':_0x51227d(0xbd)})})]}),_0x11259f===_0x51227d(0xe8)&&a53_0x244792(a53_0x52d9da,{'children':[a53_0x40ce12(Box,{'children':_0x107bee[_0x51227d(0xf7)](_0x22b918=>_0x22b918[_0x51227d(0xee)]===_0x51227d(0xd6))?a53_0x40ce12(Text,{'color':_0x51227d(0x118),'children':_0x51227d(0xe7)}):_0x107bee[_0x51227d(0xd4)](_0x3a7d99=>_0x3a7d99[_0x51227d(0xee)]==='success')?a53_0x40ce12(Text,{'color':_0x51227d(0x106),'children':'⚠️\x20部分配置需要手动完成'}):a53_0x40ce12(Text,{'color':_0x51227d(0x106),'children':_0x51227d(0x103)})}),_0x107bee['map']((_0x119ccd,_0x588ecc)=>a53_0x244792(Box,{'children':[a53_0x244792(Text,{'color':_0x119ccd[_0x51227d(0xee)]==='success'?_0x51227d(0x118):_0x119ccd[_0x51227d(0xee)]===_0x51227d(0xd1)?'yellow':'red','children':[_0x119ccd['status']===_0x51227d(0xd6)?_0x51227d(0xe9):_0x119ccd[_0x51227d(0xee)]===_0x51227d(0xd1)?_0x51227d(0xae):_0x51227d(0xf3),'\x20',_0x119ccd[_0x51227d(0x101)],':','\x20']}),a53_0x40ce12(Text,{'color':_0x119ccd[_0x51227d(0xee)]==='success'?_0x51227d(0xde):_0x119ccd[_0x51227d(0xee)]==='manual'?'yellow':'red','children':_0x119ccd[_0x51227d(0xc2)]})]},_0x588ecc)),a53_0x40ce12(Box,{'marginTop':0x1,'children':a53_0x40ce12(Text,{'color':_0x51227d(0x100),'children':_0x51227d(0xb6)})})]})]});}async function configureMcp(_0x5cacda){const _0x32b753=a53_0x26e317;switch(_0x5cacda){case'cursor':return await configureCursorMcp();case _0x32b753(0xe4):return await configureClaudeMcp();case _0x32b753(0x116):return await showOtherGuide();default:throw new Error('不支持的\x20IDE:\x20'+_0x5cacda);}}async function configureCursorMcp(){const _0x3ac656=a53_0x26e317,_0x2458be=readConfig(),_0x117539=_0x2458be[_0x3ac656(0xb9)]||_0x2458be[_0x3ac656(0x10c)],_0x52376c=_0x2458be[_0x3ac656(0xdc)]||_0x3ac656(0xe0);if(!_0x117539)return console[_0x3ac656(0x10e)](_0x3ac656(0xc1)),console[_0x3ac656(0x10e)](_0x3ac656(0xcd)),logger['warn'](_0x3ac656(0xdf),_0x3ac656(0xbf)),_0x3ac656(0x11a);const _0x4ddac8={'LOVRABET_APP_CODE':String(_0x117539)};_0x52376c!==_0x3ac656(0xe0)&&(_0x4ddac8['LOVRABET_ENV']=String(_0x52376c));const _0x3b0a41={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x4ddac8},_0x55a447=join(process[_0x3ac656(0xb7)](),'.cursor',_0x3ac656(0xc8)),_0x5589e4=join(process['cwd'](),_0x3ac656(0xaa));!existsSync(_0x5589e4)&&mkdirSync(_0x5589e4,{'recursive':!![]});let _0x3bac4f={'mcpServers':{}};if(existsSync(_0x55a447))try{const _0x231d4f=readFileSync(_0x55a447,_0x3ac656(0x105));_0x3bac4f=JSON[_0x3ac656(0xe6)](_0x231d4f);}catch{}(!_0x3bac4f[_0x3ac656(0x10b)]||typeof _0x3bac4f['mcpServers']!==_0x3ac656(0xab))&&(_0x3bac4f[_0x3ac656(0x10b)]={});_0x3bac4f['mcpServers'][MCP_SERVER_NAME]=_0x3b0a41,writeFileSync(_0x55a447,JSON[_0x3ac656(0x104)](_0x3bac4f,null,0x2),_0x3ac656(0x105)),logger['info'](_0x3ac656(0xdf),'Cursor\x20MCP\x20配置成功',{'appcode':_0x117539,'env':_0x52376c,'path':_0x55a447}),console[_0x3ac656(0x10e)]('✓\x20已写入\x20.cursor/mcp.json'),console[_0x3ac656(0x10e)](_0x3ac656(0x123)+_0x117539);_0x52376c!==_0x3ac656(0xe0)&&console[_0x3ac656(0x10e)](_0x3ac656(0xe1)+_0x52376c);console[_0x3ac656(0x10e)](_0x3ac656(0xd5));const _0x2b5730=join(_0x5589e4,_0x3ac656(0xfa)),_0x2afb4d=join(_0x2b5730,_0x3ac656(0x110));if(!existsSync(_0x2afb4d))try{!existsSync(_0x2b5730)&&mkdirSync(_0x2b5730,{'recursive':!![]});const _0x1a95d6=resolve(__dirname,_0x3ac656(0xc9));existsSync(_0x1a95d6)?(copyFileSync(_0x1a95d6,_0x2afb4d),logger[_0x3ac656(0xd3)](_0x3ac656(0xdf),'创建\x20Cursor\x20Rules\x20文件',{'from':_0x1a95d6,'to':_0x2afb4d}),console[_0x3ac656(0x10e)](_0x3ac656(0xef))):logger[_0x3ac656(0xb4)](_0x3ac656(0xdf),_0x3ac656(0x11f),{'templatePath':_0x1a95d6});}catch(_0x1a0af2){logger[_0x3ac656(0xc5)](_0x3ac656(0xdf),_0x3ac656(0xb1),{'error':_0x1a0af2 instanceof Error?_0x1a0af2[_0x3ac656(0xc2)]:String(_0x1a0af2)});}else console[_0x3ac656(0x10e)](_0x3ac656(0xf0));return _0x3ac656(0xf8);}async function configureClaudeMcp(){const _0x34486d=a53_0x26e317,_0x4fcd02=readConfig(),_0x532a9f=_0x4fcd02[_0x34486d(0xb9)]||_0x4fcd02[_0x34486d(0x10c)],_0x10a64e=_0x4fcd02['env']||_0x34486d(0xe0);if(!_0x532a9f)return console[_0x34486d(0x10e)](_0x34486d(0xc1)),console[_0x34486d(0x10e)](_0x34486d(0xcd)),logger[_0x34486d(0xb4)]('mcp-install','未找到\x20appcode\x20配置'),_0x34486d(0x11a);let _0x153cbc=_0x34486d(0xbc)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x34486d(0x10a)]('\x20')+_0x34486d(0xa9)+_0x532a9f;_0x10a64e!=='online'&&(_0x153cbc+=_0x34486d(0xa8)+_0x10a64e);console[_0x34486d(0x10e)](_0x34486d(0xf2)),console[_0x34486d(0x10e)]('\x20\x20'+_0x153cbc+'\x0a'),console[_0x34486d(0x10e)]('配置信息:'),console[_0x34486d(0x10e)](_0x34486d(0x123)+_0x532a9f);_0x10a64e!==_0x34486d(0xe0)&&console[_0x34486d(0x10e)]('\x20\x20环境:\x20'+_0x10a64e);console['log'](_0x34486d(0xcf)),logger[_0x34486d(0xd3)](_0x34486d(0xdf),_0x34486d(0x111),{'command':_0x153cbc,'appcode':_0x532a9f,'env':_0x10a64e});const _0xc0c27d=join(process[_0x34486d(0xb7)](),_0x34486d(0xc7));if(!existsSync(_0xc0c27d))try{const _0x41f255=resolve(__dirname,_0x34486d(0xc9));if(existsSync(_0x41f255)){const _0x5d3405=readFileSync(_0x41f255,_0x34486d(0x105));writeFileSync(_0xc0c27d,_0x5d3405,_0x34486d(0x105)),logger['info'](_0x34486d(0xdf),'创建\x20agents.md\x20文件',{'from':_0x41f255,'to':_0xc0c27d}),console['log'](_0x34486d(0x115));}else logger[_0x34486d(0xb4)](_0x34486d(0xdf),_0x34486d(0xb2),{'templatePath':_0x41f255});}catch(_0x2a19fc){logger[_0x34486d(0xc5)](_0x34486d(0xdf),_0x34486d(0xd8),{'error':_0x2a19fc instanceof Error?_0x2a19fc['message']:String(_0x2a19fc)});}else console[_0x34486d(0x10e)](_0x34486d(0x117));return _0x34486d(0x107);}async function showOtherGuide(){const _0xae9238=a53_0x26e317,_0x44a207=readConfig(),_0xbc013c=_0x44a207[_0xae9238(0xb9)]||_0x44a207['app'],_0x2d7b82=_0x44a207[_0xae9238(0xdc)]||_0xae9238(0xe0);if(!_0xbc013c)return console[_0xae9238(0x10e)]('⚠️\x20\x20未找到\x20appcode\x20配置'),console['log'](_0xae9238(0xcd)),logger['warn'](_0xae9238(0xdf),_0xae9238(0xbf)),_0xae9238(0x11a);return console['log']('\x0a📋\x20Lovrabet\x20MCP\x20服务器配置\x0a'),console[_0xae9238(0x10e)]('配置信息:\x20appcode='+_0xbc013c+_0xae9238(0xf6)+_0x2d7b82+'\x0a'),console['log']('{'),console[_0xae9238(0x10e)](_0xae9238(0xd9)),console[_0xae9238(0x10e)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0xae9238(0x109)),console[_0xae9238(0x10e)](_0xae9238(0x120)+MCP_COMMAND+'\x22,'),console['log'](_0xae9238(0x122)+MCP_ARGS[_0xae9238(0x121)](_0x2bde39=>'\x22'+_0x2bde39+'\x22')[_0xae9238(0x10a)](',\x20')+'],'),console[_0xae9238(0x10e)](_0xae9238(0x114)),console[_0xae9238(0x10e)](_0xae9238(0xd0)+_0xbc013c+'\x22,'),_0x2d7b82!=='online'&&console['log'](_0xae9238(0xbb)+_0x2d7b82+'\x22,'),console['log']('\x20\x20\x20\x20\x20\x20}'),console[_0xae9238(0x10e)]('\x20\x20\x20\x20}'),console[_0xae9238(0x10e)](_0xae9238(0xb3)),console['log']('}\x0a'),console[_0xae9238(0x10e)](_0xae9238(0x11d)),logger[_0xae9238(0xd3)](_0xae9238(0xdf),_0xae9238(0xfb),{'appcode':_0xbc013c,'env':_0x2d7b82}),_0xae9238(0xfe);}
package/lib/mcp/claude.js CHANGED
@@ -1 +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);}}
1
+ (function(_0x10bd96,_0x4c6a64){const _0x59bd7c=a54_0x5ca5,_0x123cd7=_0x10bd96();while(!![]){try{const _0x3aabb1=-parseInt(_0x59bd7c(0x147))/0x1+parseInt(_0x59bd7c(0x14d))/0x2+-parseInt(_0x59bd7c(0x157))/0x3+parseInt(_0x59bd7c(0x142))/0x4+parseInt(_0x59bd7c(0x15d))/0x5*(-parseInt(_0x59bd7c(0x140))/0x6)+-parseInt(_0x59bd7c(0x158))/0x7*(-parseInt(_0x59bd7c(0x13f))/0x8)+parseInt(_0x59bd7c(0x15a))/0x9*(-parseInt(_0x59bd7c(0x15b))/0xa);if(_0x3aabb1===_0x4c6a64)break;else _0x123cd7['push'](_0x123cd7['shift']());}catch(_0x3e5125){_0x123cd7['push'](_0x123cd7['shift']());}}}(a54_0x5d1f,0x5095a));function a54_0x5ca5(_0x17fbfb,_0x5e2b51){_0x17fbfb=_0x17fbfb-0x13f;const _0x5d1f66=a54_0x5d1f();let _0x5ca5b1=_0x5d1f66[_0x17fbfb];return _0x5ca5b1;}function a54_0x5d1f(){const _0x15f748=['-e\x20LOVRABET_ENV=daily','info','错误:\x20配置失败\x20-\x20','\x20\x202.\x20在\x20claude\x20code\x20中确认\x20lovrabet-dataset\x20MCP\x20服务器已加载\x0a','221460YNWeVP','配置失败','log','配置完成后:\x0a','error','未找到\x20appcode\x20配置','1302084maMaIi','生成配置命令','daily','\x20\x20-\x20环境:\x20','配置信息:','online','appcode','mcp-claude','message','\x20\x20-\x20AppCode:\x20','781245yTPPbD','3871XbTkyi','exit','69138zpslZz','200OwHwGo','trim','468610baIQLL','📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','claude\x20mcp\x20add\x20lovrabet-dataset\x20npx\x20@lovrabet/dataset-mcp-server@latest','680jWeJma','24AxlZHO','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','2569720BMRurM'];a54_0x5d1f=function(){return _0x15f748;};return a54_0x5d1f();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureClaudeMcp(){const _0x438116=a54_0x5ca5;try{const _0x1d072c=readConfig(),_0x4adabe=_0x1d072c[_0x438116(0x153)]||_0x1d072c['app'],_0xe825d0=_0x1d072c['env']||_0x438116(0x152);!_0x4adabe&&(console[_0x438116(0x14b)](_0x438116(0x141)),logger[_0x438116(0x14b)]('mcp-claude',_0x438116(0x14c)),process[_0x438116(0x159)](0x1));console[_0x438116(0x149)](_0x438116(0x151)),console[_0x438116(0x149)](_0x438116(0x156)+_0x4adabe),console[_0x438116(0x149)](_0x438116(0x150)+_0xe825d0+'\x0a');const _0x2574e7=_0x438116(0x15f),_0x4c4b70='-e\x20LOVRABET_APP_CODE='+_0x4adabe,_0x1fb8c1=_0xe825d0===_0x438116(0x14f)?_0x438116(0x143):'',_0x37ca46=(_0x2574e7+'\x20'+_0x4c4b70+'\x20'+_0x1fb8c1)[_0x438116(0x15c)]();console[_0x438116(0x149)](_0x438116(0x15e)),console[_0x438116(0x149)]('\x20\x20'+_0x37ca46+'\x0a'),console[_0x438116(0x149)](_0x438116(0x14a)),console[_0x438116(0x149)]('\x20\x201.\x20重启\x20claude\x20code'),console[_0x438116(0x149)](_0x438116(0x146)),logger[_0x438116(0x144)](_0x438116(0x154),_0x438116(0x14e),{'appcode':_0x4adabe,'env':_0xe825d0}),process[_0x438116(0x159)](0x0);}catch(_0x2e2bc4){logger[_0x438116(0x14b)](_0x438116(0x154),_0x438116(0x148),{'error':_0x2e2bc4 instanceof Error?_0x2e2bc4[_0x438116(0x155)]:String(_0x2e2bc4)}),console[_0x438116(0x14b)](_0x438116(0x145)+(_0x2e2bc4 instanceof Error?_0x2e2bc4['message']:String(_0x2e2bc4))),process[_0x438116(0x159)](0x1);}}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
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);}}
1
+ function a55_0x8ed9(){const _0x45a828=['错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','配置\x20Cursor\x20MCP\x20失败','13891nhllyP','创建\x20.cursor/rules\x20目录','解析现有\x20mcp.json\x20失败','517QvMvdF','log','exit','29418pcFtIh','info','复制\x20Cursor\x20Rules\x20文件','mcp.json','parse','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','message','cwd','✓\x20创建\x20mcp.json\x20配置文件','配置\x20Cursor\x20MCP\x20成功','\x0a✓\x20Cursor\x20MCP\x20配置成功!','2216uZlAfg','npx','error','stringify','10rxFclA','596rvyJkN','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','Cursor\x20Rules\x20文件已存在,跳过','appcode','env','4280660BDyIxd','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','warn','\x20\x20-\x20配置文件:\x20','1129092nEPmjV','创建\x20.cursor\x20目录','错误:\x20配置失败:\x20','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','../../templates/rules/lovrabet_rules.mdc.tpl','rules','37751jEsXcl','online','mcp-cursor','复制\x20Cursor\x20Rules\x20文件失败','7517598sXvNht','mcpServers','\x0a配置信息:','.cursor','@lovrabet/dataset-mcp-server','130QVcsrV','\x20\x20-\x20环境:\x20','错误:\x20解析现有\x20mcp.json\x20失败:\x20','utf8','5978061QqUAEk','更新现有\x20mcp.json\x20配置','app'];a55_0x8ed9=function(){return _0x45a828;};return a55_0x8ed9();}function a55_0x96e5(_0x3c4c6b,_0x17e40d){_0x3c4c6b=_0x3c4c6b-0x1b2;const _0x8ed9ec=a55_0x8ed9();let _0x96e5e2=_0x8ed9ec[_0x3c4c6b];return _0x96e5e2;}(function(_0x2cd088,_0x1026f6){const _0x32c47c=a55_0x96e5,_0x3d2f99=_0x2cd088();while(!![]){try{const _0x2fc749=parseInt(_0x32c47c(0x1d4))/0x1*(parseInt(_0x32c47c(0x1cb))/0x2)+parseInt(_0x32c47c(0x1da))/0x3*(parseInt(_0x32c47c(0x1b3))/0x4)+parseInt(_0x32c47c(0x1b8))/0x5+parseInt(_0x32c47c(0x1c6))/0x6+parseInt(_0x32c47c(0x1c2))/0x7*(parseInt(_0x32c47c(0x1e5))/0x8)+-parseInt(_0x32c47c(0x1cf))/0x9*(parseInt(_0x32c47c(0x1b2))/0xa)+parseInt(_0x32c47c(0x1d7))/0xb*(-parseInt(_0x32c47c(0x1bc))/0xc);if(_0x2fc749===_0x1026f6)break;else _0x3d2f99['push'](_0x3d2f99['shift']());}catch(_0x443f54){_0x3d2f99['push'](_0x3d2f99['shift']());}}}(a55_0x8ed9,0xd6f2d));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x16f6fd=a55_0x96e5;try{const _0x21c58c=process[_0x16f6fd(0x1e1)](),_0x2d04bc=resolve(_0x21c58c,_0x16f6fd(0x1c9)),_0x1b817c=resolve(_0x2d04bc,_0x16f6fd(0x1dd)),_0x413646=readConfig(),_0x34d7b1=_0x413646[_0x16f6fd(0x1b6)]||_0x413646[_0x16f6fd(0x1d1)],_0x102c95=_0x413646[_0x16f6fd(0x1b7)]||_0x16f6fd(0x1c3);!_0x34d7b1&&(console[_0x16f6fd(0x1e7)](_0x16f6fd(0x1d2)),logger[_0x16f6fd(0x1e7)]('mcp-cursor','未找到\x20appcode\x20配置'),process[_0x16f6fd(0x1d9)](0x1));!existsSync(_0x2d04bc)&&(mkdirSync(_0x2d04bc,{'recursive':!![]}),logger[_0x16f6fd(0x1db)](_0x16f6fd(0x1c4),_0x16f6fd(0x1bd),{'path':_0x2d04bc}),console[_0x16f6fd(0x1d8)]('✓\x20创建\x20.cursor\x20目录:\x20'+_0x2d04bc));const _0x158adc={'command':_0x16f6fd(0x1e6),'args':['-y',_0x16f6fd(0x1ca)],'env':{'LOVRABET_APP_CODE':String(_0x34d7b1),'LOVRABET_ENV':String(_0x102c95)}};let _0x336d14;if(existsSync(_0x1b817c))try{const _0x48edf4=readFileSync(_0x1b817c,_0x16f6fd(0x1ce));_0x336d14=JSON[_0x16f6fd(0x1de)](_0x48edf4),!_0x336d14['mcpServers']&&(_0x336d14[_0x16f6fd(0x1c7)]={}),_0x336d14[_0x16f6fd(0x1c7)]['lovrabet-dataset']=_0x158adc,logger[_0x16f6fd(0x1db)](_0x16f6fd(0x1c4),_0x16f6fd(0x1d0),{'path':_0x1b817c,'appcode':_0x34d7b1,'env':_0x102c95}),console[_0x16f6fd(0x1d8)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x10c661){logger[_0x16f6fd(0x1e7)](_0x16f6fd(0x1c4),_0x16f6fd(0x1d6),{'error':_0x10c661 instanceof Error?_0x10c661[_0x16f6fd(0x1e0)]:String(_0x10c661)}),console[_0x16f6fd(0x1e7)](_0x16f6fd(0x1cd)+(_0x10c661 instanceof Error?_0x10c661[_0x16f6fd(0x1e0)]:String(_0x10c661))),process[_0x16f6fd(0x1d9)](0x1);}else _0x336d14={'mcpServers':{'lovrabet-dataset':_0x158adc}},logger[_0x16f6fd(0x1db)](_0x16f6fd(0x1c4),'创建新的\x20mcp.json\x20配置',{'path':_0x1b817c,'appcode':_0x34d7b1,'env':_0x102c95}),console['log'](_0x16f6fd(0x1e2));writeFileSync(_0x1b817c,JSON[_0x16f6fd(0x1e8)](_0x336d14,null,0x2),{'encoding':'utf8'});const _0x5f4de0=resolve(_0x2d04bc,_0x16f6fd(0x1c1)),_0x468538=resolve(_0x5f4de0,'lovrabet_rules.mdc');if(!existsSync(_0x468538))try{!existsSync(_0x5f4de0)&&(mkdirSync(_0x5f4de0,{'recursive':!![]}),logger[_0x16f6fd(0x1db)](_0x16f6fd(0x1c4),_0x16f6fd(0x1d5),{'path':_0x5f4de0}));const _0x5bd990=fileURLToPath(import.meta.url),_0x42972a=dirname(_0x5bd990),_0xb2c415=resolve(_0x42972a,_0x16f6fd(0x1c0));existsSync(_0xb2c415)?(copyFileSync(_0xb2c415,_0x468538),logger[_0x16f6fd(0x1db)](_0x16f6fd(0x1c4),_0x16f6fd(0x1dc),{'from':_0xb2c415,'to':_0x468538}),console[_0x16f6fd(0x1d8)](_0x16f6fd(0x1b9))):logger[_0x16f6fd(0x1ba)]('mcp-cursor','Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0xb2c415});}catch(_0x1f6275){logger[_0x16f6fd(0x1e7)](_0x16f6fd(0x1c4),_0x16f6fd(0x1c5),{'error':_0x1f6275 instanceof Error?_0x1f6275[_0x16f6fd(0x1e0)]:String(_0x1f6275)}),console['warn'](_0x16f6fd(0x1df)+(_0x1f6275 instanceof Error?_0x1f6275['message']:String(_0x1f6275)));}else console['log'](_0x16f6fd(0x1b4)),logger[_0x16f6fd(0x1db)]('mcp-cursor',_0x16f6fd(0x1b5),{'path':_0x468538});console[_0x16f6fd(0x1d8)](_0x16f6fd(0x1e4)),console[_0x16f6fd(0x1d8)](_0x16f6fd(0x1c8)),console[_0x16f6fd(0x1d8)]('\x20\x20-\x20AppCode:\x20'+_0x34d7b1),console[_0x16f6fd(0x1d8)](_0x16f6fd(0x1cc)+_0x102c95),console['log'](_0x16f6fd(0x1bb)+_0x1b817c),console[_0x16f6fd(0x1d8)](_0x16f6fd(0x1bf)),console[_0x16f6fd(0x1d8)]('请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。'),logger['info'](_0x16f6fd(0x1c4),_0x16f6fd(0x1e3),{'appcode':_0x34d7b1,'env':_0x102c95,'configPath':_0x1b817c}),process[_0x16f6fd(0x1d9)](0x0);}catch(_0x24d7ce){logger[_0x16f6fd(0x1e7)]('mcp-cursor',_0x16f6fd(0x1d3),{'error':_0x24d7ce instanceof Error?_0x24d7ce[_0x16f6fd(0x1e0)]:String(_0x24d7ce)}),console[_0x16f6fd(0x1e7)](_0x16f6fd(0x1be)+(_0x24d7ce instanceof Error?_0x24d7ce['message']:String(_0x24d7ce))),process[_0x16f6fd(0x1d9)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
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);}}
1
+ const a56_0x4184e6=a56_0x131a;(function(_0x4876ab,_0x44e182){const _0x17a06a=a56_0x131a,_0x31f732=_0x4876ab();while(!![]){try{const _0x596537=-parseInt(_0x17a06a(0x148))/0x1*(parseInt(_0x17a06a(0x14d))/0x2)+-parseInt(_0x17a06a(0x15a))/0x3+-parseInt(_0x17a06a(0x14f))/0x4+-parseInt(_0x17a06a(0x156))/0x5+-parseInt(_0x17a06a(0x15f))/0x6+-parseInt(_0x17a06a(0x13d))/0x7+-parseInt(_0x17a06a(0x154))/0x8*(-parseInt(_0x17a06a(0x146))/0x9);if(_0x596537===_0x44e182)break;else _0x31f732['push'](_0x31f732['shift']());}catch(_0x4051cf){_0x31f732['push'](_0x31f732['shift']());}}}(a56_0x2ef6,0x7a763));function a56_0x131a(_0x3f97c8,_0x3ab3f8){_0x3f97c8=_0x3f97c8-0x13a;const _0x2ef650=a56_0x2ef6();let _0x131a03=_0x2ef650[_0x3f97c8];return _0x131a03;}function a56_0x2ef6(){const _0x4eaf05=['cwd','错误:\x20不支持的命令:\x20','\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','40ZOcrKB','\x20\x20lovrabet\x20mcp\x20install\x20claude\x20\x20\x20\x20#\x20claude\x20code\x0a','783165JmjSvW','\x0a支持的平台:\x20cursor,\x20claude\x0a','\x20\x20lovrabet\x20mcp\x20install\x20cursor\x20\x20\x20\x20#\x20Cursor\x20IDE','log','2409765PRWXgw','message','claude\x20code','help','\x0a请指定要配置的平台:\x0a','1320360nKTwks','Cursor','setLogPath','\x0a📦\x20正在配置\x20','不支持的命令:\x20','3874276USxaRA','支持的平台:','\x20MCP...\x0a','--help','错误:\x20不支持的平台:\x20','\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a','toLowerCase','error','\x0a可用命令:','6007131faHHJH','claude','952317irCJlU','\x0a错误:\x20配置失败\x20-\x20','install','name','\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\x20\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互式选择并配置\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20直接配置\x20Cursor\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20--claude\x20\x20\x20\x20直接配置\x20Claude\x20Code\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20--other\x20\x20\x20\x20\x20显示其他\x20IDE\x20配置指引\x0a\x0a配置方式:\x0a\x20\x20\x20交互式选择\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20显示\x20IDE\x20列表供选择,支持多选\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x0a\x20\x20\x20\x20→\x20使用\x20↑↓\x20移动光标,空格选中/取消,Enter\x20确认\x0a\x20\x20\x20\x20→\x20按\x20a\x20全选,按\x20i/r\x20反选,按\x20q\x20退出\x0a\x0a\x20\x20直接配置指定\x20IDE\x20(支持多个)\x20\x20\x20\x20\x20-\x20使用\x20--ide\x20标志直接配置\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20配置\x20Cursor\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20--claude\x20\x20#\x20配置多个\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x20--other\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示其他\x20IDE\x20配置指引\x0a\x0a支持的\x20IDE:\x0a\x20\x20--cursor\x20\x20\x20\x20\x20\x20\x20Cursor\x20\x20\x20\x20\x20-\x20自动写入\x20.cursor/mcp.json,重启\x20IDE\x20后生效\x0a\x20\x20--claude\x20\x20\x20\x20\x20\x20\x20Claude\x20Code\x20-\x20输出配置命令供手动执行\x0a\x20\x20--other\x20\x20\x20\x20\x20\x20\x20\x20其他\x20IDE\x20\x20\x20\x20-\x20显示各\x20IDE\x20的配置指引(Antigravity/Codex/Copilot/OpenCode/Qoder/Windsurf\x20等)\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20mcp\x20install\x0a\x20\x20\x20\x20→\x20交互式选择\x20IDE\x0a\x0a\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x0a\x20\x20\x20\x20→\x20自动配置\x20Cursor\x20MCP\x20(写入\x20.cursor/mcp.json)\x0a\x0a\x20\x20$\x20lovrabet\x20mcp\x20install\x20--claude\x0a\x20\x20\x20\x20→\x20输出\x20Claude\x20Code\x20MCP\x20配置命令\x0a\x0a\x20\x20$\x20lovrabet\x20mcp\x20install\x20--other\x0a\x20\x20\x20\x20→\x20显示其他\x20IDE\x20的配置指引\x0a\x0a配置指南:\x0a\x20\x20https://help.yuntoo.com/mcp/config-guide\x0a','2yOtCWK','exit','599836wGpCoO','(空)'];a56_0x2ef6=function(){return _0x4eaf05;};return a56_0x2ef6();}import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';const IDE_CONFIGS={'cursor':{'name':a56_0x4184e6(0x160),'description':'Cursor\x20IDE'},'claude':{'name':a56_0x4184e6(0x15c),'description':a56_0x4184e6(0x15c)}};export async function mcpCommand(_0x461cc5,_0x3ba786,_0x357f30){const _0x408017=a56_0x4184e6;logger[_0x408017(0x13a)](process[_0x408017(0x151)]());if(_0x357f30?.[_0x408017(0x15d)]||_0x461cc5===_0x408017(0x140)){showHelp();return;}_0x461cc5!==_0x408017(0x14a)&&(console['error'](_0x408017(0x152)+(_0x461cc5||_0x408017(0x150))),console[_0x408017(0x159)](_0x408017(0x145)),console[_0x408017(0x159)]('\x20\x20lovrabet\x20mcp\x20install\x20<ide>\x20\x20\x20\x20#\x20安装\x20MCP\x20配置'),console[_0x408017(0x159)](_0x408017(0x153)),console[_0x408017(0x159)](_0x408017(0x13e)),console['log']('\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE'),console[_0x408017(0x159)](_0x408017(0x142)),logger[_0x408017(0x144)]('mcp',_0x408017(0x13c)+_0x461cc5),process[_0x408017(0x14e)](0x1)),await installMcp(_0x3ba786?.[0x0]);}function showHelp(){const _0x2d7f90=a56_0x4184e6;console[_0x2d7f90(0x159)](_0x2d7f90(0x14c));}async function installMcp(_0x3c8a09){const _0x2ebc93=a56_0x4184e6;!_0x3c8a09&&(console[_0x2ebc93(0x159)](_0x2ebc93(0x15e)),console[_0x2ebc93(0x159)](_0x2ebc93(0x158)),console[_0x2ebc93(0x159)](_0x2ebc93(0x155)),process[_0x2ebc93(0x14e)](0x1));const _0x4269bd=_0x3c8a09[_0x2ebc93(0x143)]();!IDE_CONFIGS[_0x4269bd]&&(console[_0x2ebc93(0x144)](_0x2ebc93(0x141)+_0x3c8a09),console[_0x2ebc93(0x159)](_0x2ebc93(0x157)),process[_0x2ebc93(0x14e)](0x1));try{console[_0x2ebc93(0x159)](_0x2ebc93(0x13b)+IDE_CONFIGS[_0x4269bd][_0x2ebc93(0x14b)]+_0x2ebc93(0x13f));switch(_0x4269bd){case'cursor':await configureCursorMcp();break;case _0x2ebc93(0x147):await configureClaudeMcp();break;}}catch(_0x1eaee6){logger['error']('mcp-install','配置失败',{'error':_0x1eaee6 instanceof Error?_0x1eaee6[_0x2ebc93(0x15b)]:String(_0x1eaee6)}),console[_0x2ebc93(0x144)](_0x2ebc93(0x149)+(_0x1eaee6 instanceof Error?_0x1eaee6[_0x2ebc93(0x15b)]:String(_0x1eaee6))+'\x0a'),process[_0x2ebc93(0x14e)](0x1);}}
@@ -0,0 +1 @@
1
+ const a57_0x3c8635=a57_0x39b6;(function(_0x44c7da,_0xb56838){const _0x58a4ed=a57_0x39b6,_0x1327fd=_0x44c7da();while(!![]){try{const _0x4ffca7=-parseInt(_0x58a4ed(0x155))/0x1+parseInt(_0x58a4ed(0x12c))/0x2*(parseInt(_0x58a4ed(0x149))/0x3)+-parseInt(_0x58a4ed(0x157))/0x4*(parseInt(_0x58a4ed(0x143))/0x5)+-parseInt(_0x58a4ed(0x158))/0x6+parseInt(_0x58a4ed(0x132))/0x7*(-parseInt(_0x58a4ed(0x169))/0x8)+parseInt(_0x58a4ed(0x14a))/0x9*(-parseInt(_0x58a4ed(0x175))/0xa)+parseInt(_0x58a4ed(0x148))/0xb;if(_0x4ffca7===_0xb56838)break;else _0x1327fd['push'](_0x1327fd['shift']());}catch(_0xb5632b){_0x1327fd['push'](_0x1327fd['shift']());}}}(a57_0xdf53,0x8ac25));import{jsx as a57_0x201771,jsxs as a57_0x1f6342,Fragment as a57_0x48d05f}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';function a57_0xdf53(){const _0x379dd9=['length','../../templates/skills','qoder','stringify','开发者指南位置:\x20.lovrabet/skill/.shared/guides/','white','OpenCode','.lovrabet/skill-manifest.json','.claude','.lovrabet','102734bzLtQD','info','2.0.0','toISOString','Cursor','\x20\x20✓\x20','7627977hfijFb','description','.codex','add','selecting','upArrow','Qoder','已安装\x20','delete','name','其他\x20(通用模板)','value','utf-8','通用模板\x20(.agent/skills/)\x20-\x20兜底方案','.windsurf','\x20\x20✗\x20安装\x20','map','15dSFKwZ','OpenCode\x20IDE\x20(.opencode/skills/)','.agent','.trae','Codex\x20IDE\x20(.codex/skills/)','35448402LPQsHC','57lZYcXf','72GORSJf','*\x20安装\x20Lovrabet\x20技能包\x20-\x20选择\x20IDE','trae','installing','green','正在安装技能包...','[\x20]','gray','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','setLogPath','cursor','378893fRakWo','codex','1512492qxfcHd','3752694WyistM','downArrow','.opencode','CodeBuddy','CodeBuddy\x20IDE\x20(.codebuddy/skills/)','\x20个目录','agent','按任意键退出...','size','claude','[✓]','label','Trae','.lovrabet/skill/.shared','cyan','Windsurf\x20IDE\x20(.windsurf/workflows/)','.shared','8jQVict','Antigravity','cwd','Claude\x20Code\x20(.claude/skills/)','安装成功','return','Antigravity\x20IDE\x20(.agent/skills/)','windsurf','from','done','red','.cursor','502220PWIkSD','antigravity','error','has','.qoder','column','filter','folders'];a57_0xdf53=function(){return _0x379dd9;};return a57_0xdf53();}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a57_0x3c8635(0x130),'description':a57_0x3c8635(0x152),'folders':['.cursorrules',a57_0x3c8635(0x174)]},'windsurf':{'name':'Windsurf','description':a57_0x3c8635(0x167),'folders':[a57_0x3c8635(0x140)]},'claude':{'name':'Claude\x20Code','description':a57_0x3c8635(0x16c),'folders':[a57_0x3c8635(0x12a)]},'codex':{'name':'Codex','description':a57_0x3c8635(0x147),'folders':[a57_0x3c8635(0x134)]},'opencode':{'name':a57_0x3c8635(0x128),'description':a57_0x3c8635(0x144),'folders':[a57_0x3c8635(0x15a)]},'qoder':{'name':a57_0x3c8635(0x138),'description':'Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','folders':[a57_0x3c8635(0x179)]},'codebuddy':{'name':a57_0x3c8635(0x15b),'description':a57_0x3c8635(0x15c),'folders':['.codebuddy']},'trae':{'name':a57_0x3c8635(0x164),'description':'Trae\x20IDE\x20(.trae/skills/)','folders':[a57_0x3c8635(0x146)]},'agent':{'name':a57_0x3c8635(0x13c),'description':a57_0x3c8635(0x13f),'folders':[a57_0x3c8635(0x145)]},'antigravity':{'name':a57_0x3c8635(0x16a),'description':a57_0x3c8635(0x16f),'folders':[a57_0x3c8635(0x145)]}},IDE_LIST=[a57_0x3c8635(0x176),a57_0x3c8635(0x161),'codebuddy',a57_0x3c8635(0x156),a57_0x3c8635(0x154),'opencode',a57_0x3c8635(0x17f),a57_0x3c8635(0x14c),a57_0x3c8635(0x170),a57_0x3c8635(0x15e)];function a57_0x39b6(_0x10c417,_0x4dee3d){_0x10c417=_0x10c417-0x127;const _0xdf5361=a57_0xdf53();let _0x39b683=_0xdf5361[_0x10c417];return _0x39b683;}export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0xd41561=a57_0x3c8635,{exit:_0x23a83b}=useApp(),[_0x264a11,_0x18030d]=useState(_0xd41561(0x136)),[_0x5a9ef2,_0x5c95ce]=useState(new Set(preselectedIDEs['map'](_0x2d49c8=>IDE_LIST['indexOf'](_0x2d49c8))[_0xd41561(0x17b)](_0x3e3ab6=>_0x3e3ab6>=0x0))),[_0x137dd0,_0x1df98e]=useState(0x0),[_0x559fa0,_0x21bb06]=useState([]),[_0x1dae14,_0x2ea52b]=useState([]),[_0x49fdba,_0x20b0e1]=useState(0x0),[_0x4803ae,_0x5b6091]=useState('');useEffect(()=>{const _0x1db811=_0xd41561;preselectedIDEs[_0x1db811(0x17d)]>0x0&&_0x5a9ef2[_0x1db811(0x160)]>0x0&&_0x34cca1();},[]),useInput((_0x7d6d7d,_0x487a32)=>{const _0x25d7db=_0xd41561;if(_0x264a11===_0x25d7db(0x136)){if(_0x487a32[_0x25d7db(0x137)]){_0x1df98e(_0x271c98=>_0x271c98>0x0?_0x271c98-0x1:IDE_LIST[_0x25d7db(0x17d)]-0x1);return;}if(_0x487a32[_0x25d7db(0x159)]){_0x1df98e(_0x5f2cea=>_0x5f2cea<IDE_LIST[_0x25d7db(0x17d)]-0x1?_0x5f2cea+0x1:0x0);return;}if(_0x7d6d7d==='\x20'){_0x5c95ce(_0x389e10=>{const _0x38386d=_0x25d7db,_0x4fdab0=new Set(_0x389e10);return _0x4fdab0['has'](_0x137dd0)?_0x4fdab0[_0x38386d(0x13a)](_0x137dd0):_0x4fdab0[_0x38386d(0x135)](_0x137dd0),_0x4fdab0;});return;}if(_0x7d6d7d==='a'||_0x7d6d7d==='A'){const _0x32003a=new Set(IDE_LIST[_0x25d7db(0x142)]((_0x2b856f,_0x273b47)=>_0x273b47));_0x5c95ce(_0x32003a);return;}if(_0x7d6d7d==='i'||_0x7d6d7d==='I'||_0x7d6d7d==='r'||_0x7d6d7d==='R'){_0x5c95ce(_0x1e45e8=>{const _0x2c058c=_0x25d7db,_0x21147d=new Set();for(let _0x4e39b4=0x0;_0x4e39b4<IDE_LIST[_0x2c058c(0x17d)];_0x4e39b4++){!_0x1e45e8[_0x2c058c(0x178)](_0x4e39b4)&&_0x21147d['add'](_0x4e39b4);}return _0x21147d;});return;}if(_0x7d6d7d==='q'||_0x7d6d7d==='Q'){_0x23a83b();return;}if(_0x487a32[_0x25d7db(0x16e)]){if(_0x5a9ef2[_0x25d7db(0x160)]===0x0){_0x5b6091('请至少选择一个\x20IDE');return;}_0x34cca1();return;}}if(_0x264a11===_0x25d7db(0x172)){_0x23a83b();return;}});async function _0x34cca1(){const _0x23be61=_0xd41561,_0xcad4fa=Array[_0x23be61(0x171)](_0x5a9ef2)[_0x23be61(0x142)](_0x5f296b=>IDE_LIST[_0x5f296b])[_0x23be61(0x17b)](_0x217734=>_0x217734!==undefined);_0x2ea52b(_0xcad4fa),_0x21bb06([{'label':'已选择\x20IDE','value':_0x5a9ef2['size']+'\x20个'}]),_0x18030d(_0x23be61(0x14d)),await _0x1700dc(_0xcad4fa);}async function _0x1700dc(_0x5e2519){const _0x25c459=_0xd41561,_0x19038f=process[_0x25c459(0x16b)](),_0xc89747=resolve(__dirname,_0x25c459(0x17e));logger[_0x25c459(0x153)](_0x19038f);const _0x348f89=join(_0xc89747,_0x25c459(0x168)),_0x177ae4=join(_0x19038f,_0x25c459(0x165));existsSync(_0x348f89)&&await copyDir(_0x348f89,_0x177ae4);let _0x26f82e=0x1;for(const _0x182b89 of _0x5e2519){try{const _0x370ea5=await installSingleIDE(_0x182b89,_0x19038f,_0xc89747);_0x26f82e+=_0x370ea5,_0x20b0e1(_0x26f82e);}catch(_0x203775){console[_0x25c459(0x177)](_0x25c459(0x141)+_0x182b89+'\x20失败:\x20'+(_0x203775 instanceof Error?_0x203775['message']:String(_0x203775)));}}const _0x14c123={'version':_0x25c459(0x12e),'installedAt':new Date()[_0x25c459(0x12f)](),'platforms':_0x5e2519},_0x556a72=join(_0x19038f,_0x25c459(0x129));!existsSync(join(_0x19038f,_0x25c459(0x12b)))&&mkdirSync(join(_0x19038f,_0x25c459(0x12b)),{'recursive':!![]}),writeFileSync(_0x556a72,JSON[_0x25c459(0x180)](_0x14c123,null,0x2),_0x25c459(0x13e)),logger[_0x25c459(0x12d)]('skill-install',_0x25c459(0x16d),{'projectRoot':_0x19038f,'ides':_0x5e2519,'foldersCount':_0x26f82e}),_0x18030d(_0x25c459(0x172)),setTimeout(()=>{_0x23a83b();},0x3e8);}return a57_0x1f6342(Box,{'flexDirection':_0xd41561(0x17a),'marginTop':0x1,'children':[_0x264a11===_0xd41561(0x136)&&a57_0x1f6342(a57_0x48d05f,{'children':[a57_0x201771(Box,{'children':a57_0x201771(Text,{'color':_0xd41561(0x166),'children':_0xd41561(0x14b)})}),_0x4803ae&&a57_0x201771(Box,{'marginTop':0x1,'children':a57_0x1f6342(Text,{'color':_0xd41561(0x173),'children':['✗\x20',_0x4803ae]})}),a57_0x1f6342(Box,{'marginTop':0x1,'flexDirection':_0xd41561(0x17a),'children':[a57_0x201771(Text,{'bold':!![],'children':'*\x20请选择要安装的\x20IDE:'}),IDE_LIST[_0xd41561(0x142)]((_0x25f488,_0x29075d)=>{const _0x5976dc=_0xd41561,_0x35d5e9=_0x137dd0===_0x29075d,_0x56468c=_0x5a9ef2['has'](_0x29075d);return a57_0x201771(Box,{'children':a57_0x1f6342(Text,{'backgroundColor':_0x35d5e9?'blue':undefined,'color':_0x35d5e9?_0x5976dc(0x127):undefined,'children':['\x20\x20',_0x56468c?_0x5976dc(0x162):_0x5976dc(0x150),'\x20',IDE_CONFIGS[_0x25f488][_0x5976dc(0x13b)],'\x20',a57_0x1f6342(Text,{'color':_0x35d5e9?_0x5976dc(0x127):_0x5976dc(0x151),'dimColor':!_0x35d5e9,'children':['-\x20',IDE_CONFIGS[_0x25f488][_0x5976dc(0x133)]]})]})},_0x25f488);}),a57_0x201771(Box,{'marginTop':0x1,'children':a57_0x1f6342(Text,{'color':_0xd41561(0x151),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认']})})]})]}),_0x264a11===_0xd41561(0x14d)&&a57_0x1f6342(a57_0x48d05f,{'children':[_0x559fa0[_0xd41561(0x142)]((_0x5c8455,_0x1cc182)=>a57_0x1f6342(Box,{'children':[a57_0x1f6342(Text,{'color':_0xd41561(0x14e),'children':['√\x20',_0x5c8455[_0xd41561(0x163)],':\x20']}),a57_0x201771(Text,{'color':'cyan','children':_0x5c8455[_0xd41561(0x13d)]})]},_0x1cc182)),a57_0x201771(Box,{'marginTop':0x1,'children':a57_0x201771(Text,{'children':_0xd41561(0x14f)})}),_0x1dae14[_0xd41561(0x142)](_0x350dee=>a57_0x1f6342(Box,{'children':[a57_0x201771(Text,{'color':_0xd41561(0x14e),'children':_0xd41561(0x131)}),a57_0x201771(Text,{'children':IDE_CONFIGS[_0x350dee]?.[_0xd41561(0x13b)]||_0x350dee})]},_0x350dee)),a57_0x201771(Box,{'marginTop':0x1,'children':a57_0x1f6342(Text,{'color':_0xd41561(0x151),'children':[_0xd41561(0x139),_0x49fdba,_0xd41561(0x15d)]})})]}),_0x264a11===_0xd41561(0x172)&&a57_0x1f6342(a57_0x48d05f,{'children':[a57_0x201771(Box,{'children':a57_0x1f6342(Text,{'color':_0xd41561(0x14e),'children':['✓\x20技能包安装成功!共安装\x20',_0x49fdba,_0xd41561(0x15d)]})}),a57_0x201771(Box,{'marginTop':0x1,'children':a57_0x201771(Text,{'color':_0xd41561(0x151),'children':_0xd41561(0x181)})}),a57_0x201771(Box,{'marginTop':0x1,'children':a57_0x201771(Text,{'color':_0xd41561(0x151),'children':_0xd41561(0x15f)})})]})]});}async function copyDir(_0xc96b09,_0x50fc3b){const _0x28408a=statSync(_0xc96b09);if(_0x28408a['isDirectory']()){!existsSync(_0x50fc3b)&&mkdirSync(_0x50fc3b,{'recursive':!![]});const _0xcf6e26=readdirSync(_0xc96b09);for(const _0x58e779 of _0xcf6e26){await copyDir(join(_0xc96b09,_0x58e779),join(_0x50fc3b,_0x58e779));}}else copyFileSync(_0xc96b09,_0x50fc3b);}async function installSingleIDE(_0x40d21c,_0x16eae9,_0xdda1f0){const _0x1809a0=a57_0x3c8635,_0x143d4d=_0x40d21c!==_0x1809a0(0x15e)&&IDE_CONFIGS[_0x40d21c]!==undefined,_0x26318d=_0x40d21c===_0x1809a0(0x15e)||!_0x143d4d,_0xaf4474=_0x26318d?['.agent']:_0x143d4d?IDE_CONFIGS[_0x40d21c][_0x1809a0(0x17c)]:[_0x1809a0(0x145)];let _0x17d8a9=0x0;for(const _0xfe1a78 of _0xaf4474){const _0x39f296=join(_0xdda1f0,_0xfe1a78),_0x1ac3e2=join(_0x16eae9,_0xfe1a78);if(!existsSync(_0x39f296))continue;await copyDir(_0x39f296,_0x1ac3e2),_0x17d8a9++;}return _0x17d8a9;}
@@ -1 +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
+ const a58_0x5c78f2=a58_0x31f7;(function(_0x333f04,_0x11135d){const _0x1043a1=a58_0x31f7,_0x528ee2=_0x333f04();while(!![]){try{const _0x4a960c=-parseInt(_0x1043a1(0xd1))/0x1*(parseInt(_0x1043a1(0xe4))/0x2)+-parseInt(_0x1043a1(0xc6))/0x3+parseInt(_0x1043a1(0xfa))/0x4*(parseInt(_0x1043a1(0xd0))/0x5)+parseInt(_0x1043a1(0xb1))/0x6*(parseInt(_0x1043a1(0xec))/0x7)+parseInt(_0x1043a1(0xd4))/0x8*(parseInt(_0x1043a1(0xc0))/0x9)+-parseInt(_0x1043a1(0x106))/0xa+-parseInt(_0x1043a1(0x108))/0xb;if(_0x4a960c===_0x11135d)break;else _0x528ee2['push'](_0x528ee2['shift']());}catch(_0x5aff62){_0x528ee2['push'](_0x528ee2['shift']());}}}(a58_0x148b,0xdb571));import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';import{fileURLToPath}from'node:url';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a58_0x5c78f2(0xf5),'description':a58_0x5c78f2(0xd9),'folders':[a58_0x5c78f2(0xc2),a58_0x5c78f2(0xd5)]},'windsurf':{'name':a58_0x5c78f2(0xcc),'description':a58_0x5c78f2(0x111),'folders':[a58_0x5c78f2(0xf9)]},'claude':{'name':a58_0x5c78f2(0xbd),'description':a58_0x5c78f2(0xad),'folders':[a58_0x5c78f2(0xaa)]},'codex':{'name':a58_0x5c78f2(0xae),'description':a58_0x5c78f2(0x10e),'folders':[a58_0x5c78f2(0xdb)]},'opencode':{'name':a58_0x5c78f2(0xba),'description':a58_0x5c78f2(0xaf),'folders':[a58_0x5c78f2(0xb7)]},'qoder':{'name':'Qoder','description':a58_0x5c78f2(0xfb),'folders':[a58_0x5c78f2(0xc7)]},'codebuddy':{'name':a58_0x5c78f2(0xe6),'description':'CodeBuddy\x20IDE\x20(.codebuddy/skills/)','folders':['.codebuddy']},'trae':{'name':a58_0x5c78f2(0xd3),'description':a58_0x5c78f2(0xe0),'folders':[a58_0x5c78f2(0xca)]}};function a58_0x148b(){const _0x1dc8e6=['\x20-\x20','使用示例:','utf-8','.windsurf','479008GAiOmz','Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','\x20\x200.\x20全部安装','stdout','skill','\x0a未选择任何\x20IDE,安装取消\x0a','warn','\x20失败:\x20','.agent','claude','opencode','log','11964260LPbTZc','info','11983818rtYaMx','\x0a可用命令:','trae','安装失败','开发者指南位置:','trim','Codex\x20IDE\x20(.codex/skills/)','.lovrabet','quit','Windsurf\x20IDE\x20(.windsurf/workflows/)','exit','.claude','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包','includes','claude\x20code\x20(.claude/skills/)','Codex','OpenCode\x20IDE\x20(.opencode/skills/)','windsurf','6wAWCro','.lovrabet/skill/.shared/','error','⚠️\x20\x20未知的平台:\x20','\x0a✓\x20技能包安装成功!共安装\x20','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','.opencode','\x0a错误:\x20安装失败\x20-\x20','description','OpenCode','../../templates/skills','cwd','claude\x20code','stdin','\x0a没有有效的\x20IDE\x20需要安装\x0a','199593BeuIbl','错误:\x20不支持的命令:\x20','.cursorrules','message','\x0a已取消安装\x0a','不支持的命令:\x20','394872BiJOrQ','.qoder','codebuddy','agent','.trae','输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a','Windsurf','请选择:\x20','cursor','\x20\x20✗\x20安装\x20','40WQGjbj','397355QOlGjD','✓\x20创建\x20.lovrabet/skill-manifest.json','Trae','360oJtYCZ','.cursor','安装成功','install','folders','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','.codex','\x20\x20q.\x20取消\x0a','length','\x20个目录\x0a','--help','Trae\x20IDE\x20(.trae/skills/)','skill-install','setLogPath','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a','2tfJmCl','codex','CodeBuddy','name','all','qoder','.shared','(空)','12300953UenWeG','模板不存在:\x20','\x0a📦\x20正在安装\x20','toLowerCase','通用模板','✓\x20复制\x20.lovrabet/skill/.shared/','\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a','close','push','Cursor'];a58_0x148b=function(){return _0x1dc8e6;};return a58_0x148b();}export async function skillsCommand(_0x3662d7,_0x16b4f0,_0x221512){const _0x3a7846=a58_0x5c78f2;logger[_0x3a7846(0xe2)](process['cwd']());if(_0x221512?.['help']||_0x3662d7===_0x3a7846(0xdf)){showHelp();return;}_0x3662d7!==_0x3a7846(0xd7)&&(console[_0x3a7846(0xb3)](_0x3a7846(0xc1)+(_0x3662d7||_0x3a7846(0xeb))),console[_0x3a7846(0x105)](_0x3a7846(0x109)),console['log']('\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包'),console[_0x3a7846(0x105)](_0x3a7846(0xab)),console[_0x3a7846(0x105)](_0x3a7846(0xda)),console['log'](_0x3a7846(0xf7)),console[_0x3a7846(0x105)]('\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE'),console['log'](_0x3a7846(0xe3)),logger[_0x3a7846(0xb3)](_0x3a7846(0xfe),_0x3a7846(0xc5)+_0x3662d7),process[_0x3a7846(0x112)](0x1)),await installSkill(_0x16b4f0?.[0x0]);}async function selectIDEs(){const _0x11c9e4=a58_0x5c78f2,_0x248625=[_0x11c9e4(0xce),'windsurf','claude','codex',_0x11c9e4(0x104),_0x11c9e4(0xe9),_0x11c9e4(0xc8),_0x11c9e4(0x10a)];return console[_0x11c9e4(0x105)](_0x11c9e4(0xf2)),_0x248625['forEach']((_0x6fcefe,_0x53bd3a)=>{const _0x3ba0e1=_0x11c9e4;console[_0x3ba0e1(0x105)]('\x20\x20'+(_0x53bd3a+0x1)+'.\x20'+IDE_CONFIGS[_0x6fcefe][_0x3ba0e1(0xe7)]+_0x3ba0e1(0xf6)+IDE_CONFIGS[_0x6fcefe][_0x3ba0e1(0xb9)]);}),console[_0x11c9e4(0x105)](_0x11c9e4(0xfc)),console[_0x11c9e4(0x105)](_0x11c9e4(0xdc)),console['log']('输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)'),console[_0x11c9e4(0x105)](_0x11c9e4(0xcb)),new Promise(_0x4ccde5=>{const _0x38e9fa=_0x11c9e4,_0x3fe0b2=createInterface({'input':process[_0x38e9fa(0xbe)],'output':process[_0x38e9fa(0xfd)]});_0x3fe0b2['question'](_0x38e9fa(0xcd),_0x2c2edd=>{const _0x3a5648=_0x38e9fa;_0x3fe0b2[_0x3a5648(0xf3)]();const _0x4cf5f4=_0x2c2edd[_0x3a5648(0x10d)]()[_0x3a5648(0xef)]();(_0x4cf5f4==='q'||_0x4cf5f4===_0x3a5648(0x110)||_0x4cf5f4===_0x3a5648(0x112))&&(console[_0x3a5648(0x105)](_0x3a5648(0xc4)),process[_0x3a5648(0x112)](0x0));if(_0x4cf5f4==='0'||_0x4cf5f4==='all'){_0x4ccde5([_0x3a5648(0xe8)]);return;}const _0x120201=_0x4cf5f4['split'](/\s+/)['filter'](Boolean),_0x2bad50=[];for(const _0x358f9b of _0x120201){const _0x3423d2=parseInt(_0x358f9b,0xa);if(!isNaN(_0x3423d2)&&_0x3423d2>=0x1&&_0x3423d2<=_0x248625[_0x3a5648(0xdd)]){const _0x8c8f96=_0x248625[_0x3423d2-0x1];_0x8c8f96&&!_0x2bad50[_0x3a5648(0xac)](_0x8c8f96)&&_0x2bad50['push'](_0x8c8f96);}}_0x2bad50[_0x3a5648(0xdd)]===0x0&&(console[_0x3a5648(0x105)](_0x3a5648(0xff)),process[_0x3a5648(0x112)](0x0)),_0x4ccde5(_0x2bad50);});});}function a58_0x31f7(_0xd7d5b8,_0x577bdc){_0xd7d5b8=_0xd7d5b8-0xaa;const _0x148b9b=a58_0x148b();let _0x31f72e=_0x148b9b[_0xd7d5b8];return _0x31f72e;}function showHelp(){console['log']('\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\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互式选择并安装技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20直接安装指定\x20IDE\x20的技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20安装所有技能包\x0a\x0a安装方式:\x0a\x20\x20\x20交互式选择\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20显示\x20IDE\x20列表供选择,支持多选\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20使用\x20↑↓\x20移动光标,空格选中/取消,Enter\x20确认\x0a\x20\x20\x20\x20→\x20按\x20a\x20全选,按\x20i/r\x20反选,按\x20q\x20退出\x0a\x0a\x20\x20直接安装指定\x20IDE\x20(支持多个)\x20\x20\x20\x20\x20\x20\x20-\x20使用\x20--ide\x20标志直接安装\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装\x20Cursor\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20安装多个\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装全部\x0a\x0a支持的\x20IDE:\x0a\x20\x20--cursor\x20\x20\x20\x20\x20\x20\x20Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)\x0a\x20\x20--windsurf\x20\x20\x20\x20\x20Windsurf\x20IDE\x20(.windsurf/workflows/)\x0a\x20\x20--claude\x20\x20\x20\x20\x20\x20\x20Claude\x20Code\x20(.claude/skills/)\x0a\x20\x20--codex\x20\x20\x20\x20\x20\x20\x20\x20Codex\x20IDE\x20(.codex/skills/)\x0a\x20\x20--opencode\x20\x20\x20\x20\x20OpenCode\x20IDE\x20(.opencode/skills/)\x0a\x20\x20--qoder\x20\x20\x20\x20\x20\x20\x20\x20Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)\x0a\x20\x20--codebuddy\x20\x20\x20\x20CodeBuddy\x20IDE\x20(.codebuddy/skills/)\x0a\x20\x20--trae\x20\x20\x20\x20\x20\x20\x20\x20\x20Trae\x20IDE\x20(.trae/skills/)\x0a\x20\x20--agent\x20\x20\x20\x20\x20\x20\x20\x20其他\x20(通用模板)\x20(.agent/skills/)\x20-\x20兜底方案\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20安装所有\x20IDE\x20技能包(包括通用模板)\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\x20\x20-\x20Backend\x20Function\x20脚本编写规范\x20(权限过滤、数据脱敏、业务逻辑)\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20交互式选择\x20IDE\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a\x20\x20\x20\x20→\x20直接安装\x20Cursor\x20和\x20claude\x20code\x20技能包\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a\x20\x20\x20\x20→\x20安装所有\x20IDE\x20技能包\x0a\x0a安装后会在项目中创建:\x0a\x20\x20-\x20IDE\x20特定配置文件\x20(.cursorrules,\x20.windsurf/,\x20.claude/,\x20.codex/,\x20.opencode/,\x20.qoder/,\x20.codebuddy/,\x20.trae/)\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.lovrabet/skill/.shared/guides/07-backend-function/guide.md\x0a\x20\x20');}async function copyDir(_0x4bfe4c,_0xb299d8){const _0x23a122=statSync(_0x4bfe4c);if(_0x23a122['isDirectory']()){!existsSync(_0xb299d8)&&mkdirSync(_0xb299d8,{'recursive':!![]});const _0x2f0dd1=readdirSync(_0x4bfe4c);for(const _0x37d0d2 of _0x2f0dd1){await copyDir(join(_0x4bfe4c,_0x37d0d2),join(_0xb299d8,_0x37d0d2));}}else copyFileSync(_0x4bfe4c,_0xb299d8);}async function installSingleIDE(_0x299b67,_0x26a89c,_0x4d4af2){const _0x219e3a=a58_0x5c78f2,_0x518ad4=_0x299b67!==_0x219e3a(0xc9)&&IDE_CONFIGS[_0x299b67]!==undefined,_0x5d40ca=_0x299b67===_0x219e3a(0xc9)||!_0x518ad4,_0x56aa9f=_0x5d40ca?_0x219e3a(0xf0):_0x518ad4?IDE_CONFIGS[_0x299b67][_0x219e3a(0xe7)]:_0x299b67;console['log'](_0x219e3a(0xee)+_0x56aa9f+'...\x0a');let _0x4a5898=0x0;const _0x5dce38=_0x5d40ca?[_0x219e3a(0x102)]:_0x518ad4?IDE_CONFIGS[_0x299b67][_0x219e3a(0xd8)]:['.agent'];for(const _0x507459 of _0x5dce38){const _0x280351=join(_0x4d4af2,_0x507459),_0x3744b2=join(_0x26a89c,_0x507459);if(!existsSync(_0x280351)){logger[_0x219e3a(0x100)](_0x219e3a(0xe1),_0x219e3a(0xed)+_0x280351);continue;}await copyDir(_0x280351,_0x3744b2),_0x4a5898++,console['log']('\x20\x20✓\x20复制\x20'+_0x507459+'/');}return _0x4a5898;}async function installSkill(_0x4ea200){const _0x39ac8e=a58_0x5c78f2,_0x53c13b=process[_0x39ac8e(0xbc)](),_0x468965=resolve(__dirname,_0x39ac8e(0xbb));let _0x161bfd=[];!_0x4ea200?_0x161bfd=await selectIDEs():_0x161bfd=[_0x4ea200];_0x161bfd['includes']('all')&&(_0x161bfd=[_0x39ac8e(0xce),_0x39ac8e(0xb0),_0x39ac8e(0x103),_0x39ac8e(0xe5),_0x39ac8e(0x104),_0x39ac8e(0xe9),_0x39ac8e(0xc8),'trae',_0x39ac8e(0xc9)]);const _0x844801=[];for(const _0x1a6d05 of _0x161bfd){if(_0x1a6d05===_0x39ac8e(0xc9))_0x844801['push'](_0x39ac8e(0xc9));else{if(_0x1a6d05===_0x39ac8e(0xe8))continue;else IDE_CONFIGS[_0x1a6d05]?_0x844801[_0x39ac8e(0xf4)](_0x1a6d05):(console[_0x39ac8e(0x105)](_0x39ac8e(0xb4)+_0x1a6d05+',使用通用模板'),_0x844801[_0x39ac8e(0xf4)](_0x39ac8e(0xc9)));}}_0x844801[_0x39ac8e(0xdd)]===0x0&&(console[_0x39ac8e(0x105)](_0x39ac8e(0xbf)),process[_0x39ac8e(0x112)](0x0));const _0x7c67ea=join(_0x468965,_0x39ac8e(0xea)),_0x5ad3f9=join(_0x53c13b,'.lovrabet/skill/.shared');existsSync(_0x7c67ea)&&(await copyDir(_0x7c67ea,_0x5ad3f9),console[_0x39ac8e(0x105)](_0x39ac8e(0xf1)));let _0x429fd4=0x0;for(const _0x142427 of _0x844801){try{const _0x1dcfae=await installSingleIDE(_0x142427,_0x53c13b,_0x468965);_0x429fd4+=_0x1dcfae;}catch(_0x5a6f02){console[_0x39ac8e(0xb3)]('\x20\x20✗\x20安装\x20'+_0x142427+_0x39ac8e(0x101)+(_0x5a6f02 instanceof Error?_0x5a6f02[_0x39ac8e(0xc3)]:String(_0x5a6f02)));}}const _0x494d9a={'version':'2.0.0','installedAt':new Date()['toISOString'](),'platforms':_0x844801};try{const _0x21f53b=join(_0x468965,_0x39ac8e(0xea)),_0x2dd7de=join(_0x53c13b,_0x39ac8e(0xb2));existsSync(_0x21f53b)&&(await copyDir(_0x21f53b,_0x2dd7de),console[_0x39ac8e(0x105)](_0x39ac8e(0xf1)));let _0x3a0179=0x0;for(const _0x215f5d of _0x844801){try{const _0x2fa0a5=await installSingleIDE(_0x215f5d,_0x53c13b,_0x468965);_0x3a0179+=_0x2fa0a5;}catch(_0x117c21){console[_0x39ac8e(0xb3)](_0x39ac8e(0xcf)+_0x215f5d+_0x39ac8e(0x101)+(_0x117c21 instanceof Error?_0x117c21[_0x39ac8e(0xc3)]:String(_0x117c21)));}}const _0x1d8431={'version':'2.0.0','installedAt':new Date()['toISOString'](),'platforms':_0x844801},_0x555365=join(_0x53c13b,'.lovrabet/skill-manifest.json');!existsSync(join(_0x53c13b,_0x39ac8e(0x10f)))&&mkdirSync(join(_0x53c13b,_0x39ac8e(0x10f)),{'recursive':!![]}),writeFileSync(_0x555365,JSON['stringify'](_0x1d8431,null,0x2),_0x39ac8e(0xf8)),console[_0x39ac8e(0x105)](_0x39ac8e(0xd2)),console['log'](_0x39ac8e(0xb5)+_0x3a0179+_0x39ac8e(0xde)),console['log'](_0x39ac8e(0x10c)),console[_0x39ac8e(0x105)](_0x39ac8e(0xb6)),logger[_0x39ac8e(0x107)](_0x39ac8e(0xe1),_0x39ac8e(0xd6),{'projectRoot':_0x53c13b,'ides':_0x844801,'foldersCount':_0x3a0179});}catch(_0x479686){logger[_0x39ac8e(0xb3)]('skill-install',_0x39ac8e(0x10b),{'error':_0x479686 instanceof Error?_0x479686[_0x39ac8e(0xc3)]:String(_0x479686)}),console[_0x39ac8e(0xb3)](_0x39ac8e(0xb8)+(_0x479686 instanceof Error?_0x479686[_0x39ac8e(0xc3)]:String(_0x479686))+'\x0a'),process[_0x39ac8e(0x112)](0x1);}}
@@ -1 +1 @@
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
+ const a60_0x92acf0=a60_0x3133;function a60_0x2669(){const _0x48cee1=['\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','16185110OnJose','existsSync','\x20或更高版本:','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','578589tnZTTP','\x20\x20\x20请升级\x20SDK\x20至\x20','package.json','coerce','482ZggtHa','needsUpgrade','\x1b[1m','log','utf8','\x1b[0m','version','2907795vhRndi','1107naaaXr','@lovrabet/sdk','13329hEvmZT','parse','devDependencies','1190567EwjxHP','368920NuNlGe','1.2.0','readFileSync','dependencies','12ctzkcf','944VTUbXG','\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest','join','\x1b[33m'];a60_0x2669=function(){return _0x48cee1;};return a60_0x2669();}(function(_0x1885d5,_0x5f45ae){const _0x4ab4be=a60_0x3133,_0x19728f=_0x1885d5();while(!![]){try{const _0x6f5a16=-parseInt(_0x4ab4be(0x141))/0x1+parseInt(_0x4ab4be(0x145))/0x2*(-parseInt(_0x4ab4be(0x14d))/0x3)+parseInt(_0x4ab4be(0x153))/0x4+-parseInt(_0x4ab4be(0x14c))/0x5+parseInt(_0x4ab4be(0x137))/0x6*(-parseInt(_0x4ab4be(0x152))/0x7)+parseInt(_0x4ab4be(0x138))/0x8*(parseInt(_0x4ab4be(0x14f))/0x9)+parseInt(_0x4ab4be(0x13d))/0xa;if(_0x6f5a16===_0x5f45ae)break;else _0x19728f['push'](_0x19728f['shift']());}catch(_0x10706a){_0x19728f['push'](_0x19728f['shift']());}}}(a60_0x2669,0x48544));function a60_0x3133(_0x35a403,_0x46b938){_0x35a403=_0x35a403-0x137;const _0x2669cf=a60_0x2669();let _0x313312=_0x2669cf[_0x35a403];return _0x313312;}import a60_0x1d1287 from'node:fs';import a60_0x3fb59b from'node:path';import a60_0x175ccf from'semver';const MIN_SDK_VERSION=a60_0x92acf0(0x154);export function checkSdkVersion(_0xcc8ee1){const _0x216c48=a60_0x92acf0,_0x214123=a60_0x3fb59b[_0x216c48(0x13a)](_0xcc8ee1,_0x216c48(0x143));if(!a60_0x1d1287[_0x216c48(0x13e)](_0x214123))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x4c4367=JSON[_0x216c48(0x150)](a60_0x1d1287[_0x216c48(0x155)](_0x214123,_0x216c48(0x149))),_0x2bfd0b=_0x4c4367[_0x216c48(0x156)]||{},_0x3781ad=_0x4c4367[_0x216c48(0x151)]||{},_0x1c1822=_0x2bfd0b[_0x216c48(0x14e)]||_0x3781ad[_0x216c48(0x14e)];if(!_0x1c1822)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x5752fb=a60_0x175ccf[_0x216c48(0x144)](_0x1c1822),_0x2b336e=_0x5752fb?a60_0x175ccf['lt'](_0x5752fb,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x1c1822,'needsUpgrade':_0x2b336e,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x32e53a){const _0x307f95=a60_0x92acf0;if(!_0x32e53a[_0x307f95(0x146)])return;const _0x4e6cb8=_0x307f95(0x13b),_0x789dba=_0x307f95(0x14a),_0x41f438=_0x307f95(0x147);console[_0x307f95(0x148)](),console['log'](''+_0x4e6cb8+_0x41f438+'⚠️\x20\x20SDK\x20版本不兼容'+_0x789dba),console[_0x307f95(0x148)](_0x4e6cb8+_0x307f95(0x140)+_0x32e53a[_0x307f95(0x14b)]+'\x20不支持新协议。'+_0x789dba),console[_0x307f95(0x148)](_0x4e6cb8+_0x307f95(0x142)+_0x32e53a['minVersion']+_0x307f95(0x13f)+_0x789dba),console['log'](_0x4e6cb8+_0x307f95(0x139)+_0x789dba),console[_0x307f95(0x148)](_0x4e6cb8+_0x307f95(0x13c)+_0x789dba),console[_0x307f95(0x148)]();}
@@ -1 +1 @@
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
+ const a61_0x30bb26=a61_0x4487;(function(_0x35347e,_0x547a96){const _0x174935=a61_0x4487,_0x27155b=_0x35347e();while(!![]){try{const _0x260bb4=-parseInt(_0x174935(0x10f))/0x1*(parseInt(_0x174935(0x112))/0x2)+parseInt(_0x174935(0x10a))/0x3*(parseInt(_0x174935(0x116))/0x4)+parseInt(_0x174935(0x114))/0x5+parseInt(_0x174935(0x118))/0x6*(parseInt(_0x174935(0x119))/0x7)+-parseInt(_0x174935(0x108))/0x8+parseInt(_0x174935(0x10b))/0x9+-parseInt(_0x174935(0x117))/0xa;if(_0x260bb4===_0x547a96)break;else _0x27155b['push'](_0x27155b['shift']());}catch(_0x2cbc22){_0x27155b['push'](_0x27155b['shift']());}}}(a61_0x2d04,0x89c08));import{existsSync,readFileSync}from'node:fs';function a61_0x4487(_0x2d1a1f,_0x3e94a5){_0x2d1a1f=_0x2d1a1f-0x108;const _0x2d041a=a61_0x2d04();let _0x44871a=_0x2d041a[_0x2d1a1f];return _0x44871a;}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a61_0x30bb26(0x10e)](),a61_0x30bb26(0x10c));export const globalConfigPath=resolve(homedir(),a61_0x30bb26(0x10c));export function readConfig(_0x5168b6){const _0xb71429=a61_0x30bb26;let _0xaa2547={};try{if(existsSync(globalConfigPath)){const _0xccd70d=readFileSync(globalConfigPath,{'encoding':_0xb71429(0x109)});_0xccd70d&&(_0xaa2547=JSON[_0xb71429(0x111)](_0xccd70d));}}catch(_0x391d25){}try{const _0x50614f=_0x5168b6?resolve(_0x5168b6,_0xb71429(0x10c)):projectConfigPath;if(existsSync(_0x50614f)){const _0x528364=readFileSync(_0x50614f,{'encoding':_0xb71429(0x109)});if(_0x528364){const _0x1617d0=JSON[_0xb71429(0x111)](_0x528364);_0xaa2547={..._0xaa2547,..._0x1617d0};}}}catch(_0x65d61b){}return _0xaa2547;}export function getConfigAppCode(){const _0x1a70d9=a61_0x30bb26;let _0x5d61a3={},_0x4a826d={};try{if(existsSync(globalConfigPath)){const _0x93bb52=readFileSync(globalConfigPath,{'encoding':_0x1a70d9(0x109)});_0x93bb52&&(_0x4a826d=JSON[_0x1a70d9(0x111)](_0x93bb52));}}catch(_0x5d910c){}try{if(existsSync(projectConfigPath)){const _0x38a449=readFileSync(projectConfigPath,{'encoding':_0x1a70d9(0x109)});_0x38a449&&(_0x5d61a3=JSON['parse'](_0x38a449));}}catch(_0x11fd5e){}let _0x239fbc;if(_0x1a70d9(0x10d)in _0x5d61a3)_0x239fbc=_0x5d61a3[_0x1a70d9(0x10d)];else{if(_0x1a70d9(0x115)in _0x5d61a3)_0x239fbc=_0x5d61a3['app'];else{if(_0x1a70d9(0x10d)in _0x4a826d)_0x239fbc=_0x4a826d['appcode'];else _0x1a70d9(0x115)in _0x4a826d&&(_0x239fbc=_0x4a826d['app']);}}if(typeof _0x239fbc!==_0x1a70d9(0x113)||_0x239fbc[_0x1a70d9(0x110)]()==='')return undefined;return _0x239fbc;}function a61_0x2d04(){const _0x38e695=['1102219InjGoM','trim','parse','2JxGfra','string','4883965GXouRY','app','3950908mFFAwb','2791810qyCEpo','17274Ydzhar','1113uDuFDO','6211584FYqnWx','utf8','3wbYlET','2698191BMayTn','.lovrabetrc','appcode','cwd'];a61_0x2d04=function(){return _0x38e695;};return a61_0x2d04();}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
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
+ (function(_0xe42b38,_0x5e3a3b){const _0x58b9f5=a62_0x4bc8,_0x32376b=_0xe42b38();while(!![]){try{const _0x4056d9=-parseInt(_0x58b9f5(0x136))/0x1+parseInt(_0x58b9f5(0x12b))/0x2+parseInt(_0x58b9f5(0x133))/0x3+-parseInt(_0x58b9f5(0x12a))/0x4*(-parseInt(_0x58b9f5(0x129))/0x5)+-parseInt(_0x58b9f5(0x12e))/0x6+-parseInt(_0x58b9f5(0x130))/0x7+parseInt(_0x58b9f5(0x12f))/0x8;if(_0x4056d9===_0x5e3a3b)break;else _0x32376b['push'](_0x32376b['shift']());}catch(_0xc7e4bd){_0x32376b['push'](_0x32376b['shift']());}}}(a62_0x5a4a,0xf4104));function a62_0x4bc8(_0x1cfb69,_0x672319){_0x1cfb69=_0x1cfb69-0x129;const _0x5a4af7=a62_0x5a4a();let _0x4bc835=_0x5a4af7[_0x1cfb69];return _0x4bc835;}import a62_0x22ad02 from'node:path';import a62_0x152844 from'node:fs';function a62_0x5a4a(){const _0x271329=['1238512nrOVVP','readdirSync','copyFileSync','6391842oFzEbN','7070376sEArYS','708043JFUFVO','isDirectory','name','2248806hyqjSD','复制目录时出错:','error','702988wWPAvw','mkdirSync','31135eOGJpI','396JwvXsd'];a62_0x5a4a=function(){return _0x271329;};return a62_0x5a4a();}export async function copyDirectory(_0x5624e1,_0x5f5443){const _0x42d2dc=a62_0x4bc8;try{const _0x38b749=a62_0x152844[_0x42d2dc(0x12c)](_0x5624e1,{'withFileTypes':!![]});a62_0x152844[_0x42d2dc(0x137)](_0x5f5443,{'recursive':!![]});for(const _0x4cccb4 of _0x38b749){const _0x32f070=a62_0x22ad02['join'](_0x5624e1,_0x4cccb4[_0x42d2dc(0x132)]),_0x1ff003=a62_0x22ad02['join'](_0x5f5443,_0x4cccb4[_0x42d2dc(0x132)]);_0x4cccb4[_0x42d2dc(0x131)]()?await copyDirectory(_0x32f070,_0x1ff003):a62_0x152844[_0x42d2dc(0x12d)](_0x32f070,_0x1ff003);}}catch(_0x43bb38){console[_0x42d2dc(0x135)](_0x42d2dc(0x134),_0x43bb38);}}
@@ -1 +1 @@
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
+ (function(_0x324266,_0x27a704){const _0xfa40f8=a63_0x5cf1,_0x430bb8=_0x324266();while(!![]){try{const _0x3892f1=-parseInt(_0xfa40f8(0x147))/0x1+-parseInt(_0xfa40f8(0x148))/0x2*(-parseInt(_0xfa40f8(0x15b))/0x3)+parseInt(_0xfa40f8(0x14f))/0x4*(-parseInt(_0xfa40f8(0x153))/0x5)+parseInt(_0xfa40f8(0x14a))/0x6+-parseInt(_0xfa40f8(0x149))/0x7*(parseInt(_0xfa40f8(0x158))/0x8)+-parseInt(_0xfa40f8(0x15c))/0x9+parseInt(_0xfa40f8(0x157))/0xa;if(_0x3892f1===_0x27a704)break;else _0x430bb8['push'](_0x430bb8['shift']());}catch(_0x511aad){_0x430bb8['push'](_0x430bb8['shift']());}}}(a63_0x2df2,0xbaa9c));export async function httpRequest(_0x514309,_0x4a6550={}){const _0x44a89d=a63_0x5cf1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x4a6550;let _0x774cf1=null;for(let _0x13ed64=0x0;_0x13ed64<=retries;_0x13ed64++){try{const _0x4d40d9=new AbortController(),_0x1556b9=setTimeout(()=>_0x4d40d9['abort'](),timeout),_0x5c210b=await fetch(_0x514309,{'headers':headers,'signal':_0x4d40d9[_0x44a89d(0x156)]});clearTimeout(_0x1556b9);let _0x9dfe0;const _0x208f6d=_0x5c210b[_0x44a89d(0x146)]['get'](_0x44a89d(0x14c));return _0x208f6d?.['includes']('application/json')?_0x9dfe0=await _0x5c210b[_0x44a89d(0x14d)]():_0x9dfe0=await _0x5c210b[_0x44a89d(0x152)](),{'ok':_0x5c210b['ok'],'status':_0x5c210b['status'],'statusText':_0x5c210b[_0x44a89d(0x15a)],'data':_0x9dfe0,'headers':_0x5c210b[_0x44a89d(0x146)],'url':_0x5c210b[_0x44a89d(0x159)],'text':()=>_0x5c210b[_0x44a89d(0x152)]()};}catch(_0x5557aa){_0x774cf1=_0x5557aa instanceof Error?_0x5557aa:new Error(String(_0x5557aa));if(_0x13ed64===retries)break;if(shouldRetry(_0x5557aa)){console['log']('*\x20请求失败,'+retryDelay+_0x44a89d(0x15d)+(_0x13ed64+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x774cf1||new Error(_0x44a89d(0x154));}function a63_0x5cf1(_0x7a1b70,_0x5857fa){_0x7a1b70=_0x7a1b70-0x146;const _0x2df238=a63_0x2df2();let _0x5cf192=_0x2df238[_0x7a1b70];return _0x5cf192;}function shouldRetry(_0x52d16a){const _0x17228f=a63_0x5cf1;if(_0x52d16a instanceof Error){if(_0x52d16a[_0x17228f(0x155)]===_0x17228f(0x14b))return![];if(_0x52d16a[_0x17228f(0x155)]==='TypeError'&&_0x52d16a[_0x17228f(0x150)]['includes']('fetch'))return!![];if(_0x52d16a['message'][_0x17228f(0x151)](_0x17228f(0x14e)))return!![];if(_0x52d16a[_0x17228f(0x150)][_0x17228f(0x151)]('ENOTFOUND'))return![];}return![];}function sleep(_0x582c9c){return new Promise(_0x5a13d7=>setTimeout(_0x5a13d7,_0x582c9c));}function a63_0x2df2(){const _0x28f65b=['message','includes','text','240YcosUe','Request\x20failed','name','signal','11487140dRYEwD','16VflseK','url','statusText','462UbDPLy','609183xXDGei','ms\x20后进行第\x20','headers','303249XRiokt','5312cxLApa','1623587WfXPvK','2368152QkgDfW','AbortError','content-type','json','ECONNRESET','29420frEZof'];a63_0x2df2=function(){return _0x28f65b;};return a63_0x2df2();}export function validateUrl(_0xf819a7){try{return new URL(_0xf819a7),!![];}catch{return![];}}