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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/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 -1
  5. package/lib/ai-setup/config.js +1 -1
  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 -1
  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 -1
  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
@@ -1 +1 @@
1
- (function(_0xd3bbf1,_0x491146){var _0x1fa251=a46_0x5517,_0x4f95e4=_0xd3bbf1();while(!![]){try{var _0x2b3471=-parseInt(_0x1fa251(0x1c5))/0x1*(-parseInt(_0x1fa251(0x1c9))/0x2)+parseInt(_0x1fa251(0x1cf))/0x3*(-parseInt(_0x1fa251(0x1c3))/0x4)+-parseInt(_0x1fa251(0x1ce))/0x5*(parseInt(_0x1fa251(0x1c8))/0x6)+parseInt(_0x1fa251(0x1c4))/0x7*(parseInt(_0x1fa251(0x1cd))/0x8)+parseInt(_0x1fa251(0x1cb))/0x9*(-parseInt(_0x1fa251(0x1c6))/0xa)+parseInt(_0x1fa251(0x1d0))/0xb*(parseInt(_0x1fa251(0x1c7))/0xc)+parseInt(_0x1fa251(0x1ca))/0xd;if(_0x2b3471===_0x491146)break;else _0x4f95e4['push'](_0x4f95e4['shift']());}catch(_0x207cc3){_0x4f95e4['push'](_0x4f95e4['shift']());}}}(a46_0x35fe,0xb1e2f));function a46_0x5517(_0x456148,_0x1ede7a){_0x456148=_0x456148-0x1c3;var _0x35febd=a46_0x35fe();var _0x5517fb=_0x35febd[_0x456148];return _0x5517fb;}import{jsx as a46_0x22afdc,jsxs as a46_0x35e6fe}from'react/jsx-runtime';function a46_0x35fe(){var _0x9dd928=['12541419ZOLzUU','taskName','8WBKVJh','9625caeAPr','298761dzrdcC','1408CIDHzp','elapsed','4EUUpKR','1177799TlqQBq','7KImHCE','10ycGZqE','81132TpFLqB','4254wGNCXS','171910pXVMhp','25365288xkDPMD'];a46_0x35fe=function(){return _0x9dd928;};return a46_0x35fe();}import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x456f28){var _0x375c53=a46_0x5517;return a46_0x35e6fe(Box,{'children':[a46_0x22afdc(Box,{'width':'1'}),a46_0x22afdc(TaskLoading,{..._0x456f28}),a46_0x22afdc(Text,{'children':_0x456f28[_0x375c53(0x1cc)]}),a46_0x22afdc(TaskTime,{'elapsed':_0x456f28[_0x375c53(0x1d1)]})]});}
1
+ (function(_0x3b6690,_0x4ee1d7){var _0x263608=a46_0x5bc9,_0x2f444b=_0x3b6690();while(!![]){try{var _0x48bbe2=parseInt(_0x263608(0xe5))/0x1*(-parseInt(_0x263608(0xee))/0x2)+parseInt(_0x263608(0xe8))/0x3+parseInt(_0x263608(0xf0))/0x4*(-parseInt(_0x263608(0xef))/0x5)+parseInt(_0x263608(0xea))/0x6*(parseInt(_0x263608(0xeb))/0x7)+parseInt(_0x263608(0xe7))/0x8+-parseInt(_0x263608(0xec))/0x9+-parseInt(_0x263608(0xed))/0xa*(parseInt(_0x263608(0xe6))/0xb);if(_0x48bbe2===_0x4ee1d7)break;else _0x2f444b['push'](_0x2f444b['shift']());}catch(_0x4accd8){_0x2f444b['push'](_0x2f444b['shift']());}}}(a46_0x1283,0x85e61));import{jsx as a46_0x383bcb,jsxs as a46_0xae9926}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a46_0x1283(){var _0xc390cd=['257jzZqdy','22yVkjiV','4022632xiQnCt','3059697yTyyEh','taskName','6fBqrrd','5824945wTuSQu','3384135MLaTzv','3553020lIvXpO','2092RjMibt','5buqmAO','1803892EGUMMF'];a46_0x1283=function(){return _0xc390cd;};return a46_0x1283();}function a46_0x5bc9(_0x2a7cb6,_0x2e9a92){_0x2a7cb6=_0x2a7cb6-0xe5;var _0x1283ef=a46_0x1283();var _0x5bc969=_0x1283ef[_0x2a7cb6];return _0x5bc969;}export function TaskRunning(_0x5627d3){var _0x1c3e93=a46_0x5bc9;return a46_0xae9926(Box,{'children':[a46_0x383bcb(Box,{'width':'1'}),a46_0x383bcb(TaskLoading,{..._0x5627d3}),a46_0x383bcb(Text,{'children':_0x5627d3[_0x1c3e93(0xe9)]}),a46_0x383bcb(TaskTime,{'elapsed':_0x5627d3['elapsed']})]});}
@@ -1 +1 @@
1
- function a47_0x1ec7(_0x26ce4f,_0x3644fc){_0x26ce4f=_0x26ce4f-0x74;var _0x5ac745=a47_0x5ac7();var _0x1ec74b=_0x5ac745[_0x26ce4f];return _0x1ec74b;}function a47_0x5ac7(){var _0x71926b=['222770UHVzKe','604vDdUFT','478733aVpBXB','168ukzOAU','164680xLZLGY','24ZzfGbe','elapsed','2589tJdtGB','459335ILoWFH','177264uTyvXN','231ZjjLOo','165067HpuGJM','gray'];a47_0x5ac7=function(){return _0x71926b;};return a47_0x5ac7();}(function(_0xa587,_0x345931){var _0xc512fb=a47_0x1ec7,_0x6d4da8=_0xa587();while(!![]){try{var _0x4eaa30=parseInt(_0xc512fb(0x74))/0x1+parseInt(_0xc512fb(0x76))/0x2+parseInt(_0xc512fb(0x79))/0x3*(parseInt(_0xc512fb(0x80))/0x4)+-parseInt(_0xc512fb(0x7a))/0x5*(parseInt(_0xc512fb(0x77))/0x6)+-parseInt(_0xc512fb(0x7d))/0x7*(parseInt(_0xc512fb(0x75))/0x8)+-parseInt(_0xc512fb(0x7b))/0x9+-parseInt(_0xc512fb(0x7f))/0xa*(-parseInt(_0xc512fb(0x7c))/0xb);if(_0x4eaa30===_0x345931)break;else _0x6d4da8['push'](_0x6d4da8['shift']());}catch(_0x5620d4){_0x6d4da8['push'](_0x6d4da8['shift']());}}}(a47_0x5ac7,0x43966));import{jsx as a47_0x60f824,Fragment as a47_0x2db969,jsxs as a47_0x524a15}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x4612f6){var _0x4eefa0=a47_0x1ec7;if(_0x4612f6[_0x4eefa0(0x78)])return a47_0x524a15(a47_0x2db969,{'children':[a47_0x60f824(Text,{'color':_0x4eefa0(0x7e),'children':'\x20['}),a47_0x60f824(Text,{'color':_0x4eefa0(0x7e),'bold':!![],'children':_0x4612f6['elapsed']}),a47_0x60f824(Text,{'color':_0x4eefa0(0x7e),'children':']'})]});return null;}
1
+ function a47_0x59f4(_0x2810cf,_0x2aa529){_0x2810cf=_0x2810cf-0x183;var _0x481734=a47_0x4817();var _0x59f441=_0x481734[_0x2810cf];return _0x59f441;}function a47_0x4817(){var _0x4860f8=['gray','251685UVFYoU','6730497hGivdO','2060495YLnYoe','110753xRcyDv','6YLxJfD','1160940oFmIbe','2gSQujG','21659790SoYZMJ','elapsed','128Lzybms','2733705BNpNUY'];a47_0x4817=function(){return _0x4860f8;};return a47_0x4817();}(function(_0x38b52d,_0x52e662){var _0xd70bb8=a47_0x59f4,_0x528e33=_0x38b52d();while(!![]){try{var _0x5db7fb=-parseInt(_0xd70bb8(0x18b))/0x1*(-parseInt(_0xd70bb8(0x18e))/0x2)+-parseInt(_0xd70bb8(0x186))/0x3+-parseInt(_0xd70bb8(0x18d))/0x4+-parseInt(_0xd70bb8(0x18a))/0x5*(parseInt(_0xd70bb8(0x18c))/0x6)+-parseInt(_0xd70bb8(0x188))/0x7*(-parseInt(_0xd70bb8(0x185))/0x8)+-parseInt(_0xd70bb8(0x189))/0x9+parseInt(_0xd70bb8(0x183))/0xa;if(_0x5db7fb===_0x52e662)break;else _0x528e33['push'](_0x528e33['shift']());}catch(_0x21c941){_0x528e33['push'](_0x528e33['shift']());}}}(a47_0x4817,0x77c72));import{jsx as a47_0x360f43,Fragment as a47_0x5c4f4f,jsxs as a47_0x5eb653}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x55d857){var _0x2dda8b=a47_0x59f4;if(_0x55d857[_0x2dda8b(0x184)])return a47_0x5eb653(a47_0x5c4f4f,{'children':[a47_0x360f43(Text,{'color':_0x2dda8b(0x187),'children':'\x20['}),a47_0x360f43(Text,{'color':_0x2dda8b(0x187),'bold':!![],'children':_0x55d857['elapsed']}),a47_0x360f43(Text,{'color':_0x2dda8b(0x187),'children':']'})]});return null;}
@@ -1 +1 @@
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
+ const a48_0x577f24=a48_0x432a;(function(_0x1a42b1,_0x35d2ff){const _0x4d4f86=a48_0x432a,_0x7c0323=_0x1a42b1();while(!![]){try{const _0x364faa=parseInt(_0x4d4f86(0x179))/0x1+parseInt(_0x4d4f86(0x174))/0x2+parseInt(_0x4d4f86(0x169))/0x3*(parseInt(_0x4d4f86(0x16b))/0x4)+parseInt(_0x4d4f86(0x171))/0x5+-parseInt(_0x4d4f86(0x16e))/0x6*(parseInt(_0x4d4f86(0x175))/0x7)+-parseInt(_0x4d4f86(0x16c))/0x8*(parseInt(_0x4d4f86(0x166))/0x9)+parseInt(_0x4d4f86(0x176))/0xa*(parseInt(_0x4d4f86(0x16f))/0xb);if(_0x364faa===_0x35d2ff)break;else _0x7c0323['push'](_0x7c0323['shift']());}catch(_0x4ed645){_0x7c0323['push'](_0x7c0323['shift']());}}}(a48_0x4f21,0x6f3fa));import a48_0x17c859 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';function a48_0x4f21(){const _0x8e24da=['572532jPatky','3179920uQXCpa','复制项目文件','52236OzyjAf','629915deMrDL','info','4231975ZRdQlh','dirname','resolve','308346dSBjgZ','539ROpFJV','10bBuvOX','success','copy','36294BHqieb','now','error','开始复制项目模板','9DYVdzy','cwd','项目模板复制失败','9HogKGE','../../templates/projects/sub-app-react-demo'];a48_0x4f21=function(){return _0x8e24da;};return a48_0x4f21();}function a48_0x432a(_0x13c199,_0x19263f){_0x13c199=_0x13c199-0x165;const _0x4f21f7=a48_0x4f21();let _0x432aaa=_0x4f21f7[_0x13c199];return _0x432aaa;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a48_0x17c859[a48_0x577f24(0x172)](fileURLToPath(import.meta.url)),templateDir=a48_0x17c859['resolve'](__dirname,a48_0x577f24(0x16a));export function useCopyProjectTemplate(){const _0x5744ad=a48_0x577f24,[_0x1d5f63,_0x4d79fb]=useState(![]),[_0x396e81,_0x1a1cae]=useState(![]),[_0x1ae028,_0x3f32a6]=useState(''),_0xcdb1c=useCallback(async _0x443115=>{const _0x2660f2=a48_0x432a,_0x279793=Date[_0x2660f2(0x17a)](),_0x3b3736=a48_0x17c859[_0x2660f2(0x173)](process[_0x2660f2(0x167)](),_0x443115);_0x4d79fb(!![]);try{logger[_0x2660f2(0x170)](_0x2660f2(0x178),_0x2660f2(0x165),{'projectCode':_0x443115,'templateDir':templateDir}),await copyDirectory(templateDir,_0x3b3736);const _0x3c54fb=Date[_0x2660f2(0x17a)]()-_0x279793;logger[_0x2660f2(0x177)](_0x2660f2(0x178),'项目模板复制完成',_0x3c54fb,{'projectCode':_0x443115});}catch(_0x473fa2){const _0x106a2e=Date[_0x2660f2(0x17a)]()-_0x279793;logger[_0x2660f2(0x17b)]('copy',_0x2660f2(0x168),{'projectCode':_0x443115,'error':_0x473fa2 instanceof Error?_0x473fa2['message']:String(_0x473fa2),'duration':_0x106a2e});throw _0x473fa2;}finally{_0x4d79fb(![]),_0x1a1cae(!![]),_0x3f32a6(formatElapsed(_0x279793));}},[]);return{'taskName':_0x5744ad(0x16d),'finished':_0x396e81,'loading':_0x1d5f63,'elapsed':_0x1ae028,'doTask':_0xcdb1c};}
@@ -1 +1 @@
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
+ function a49_0x3e61(){const _0x38c20f=['10YfVXGT','message','format','19179TCIVLk','4792fjaslL','3235dorUCd','1264GDmeIN','info','success','5577774APwWiO','error','25462aRUdGa','--write','43zlkfmU','npx','16573623UwbYll','格式化代码','代码格式化完成','开始格式化代码','771777dlqRzv','resolve','1738226OFfsms'];a49_0x3e61=function(){return _0x38c20f;};return a49_0x3e61();}(function(_0x33d516,_0x5747d8){const _0x230e43=a49_0x312e,_0x475e8c=_0x33d516();while(!![]){try{const _0x188c3b=-parseInt(_0x230e43(0x168))/0x1*(parseInt(_0x230e43(0x166))/0x2)+parseInt(_0x230e43(0x16e))/0x3+parseInt(_0x230e43(0x15f))/0x4*(parseInt(_0x230e43(0x160))/0x5)+-parseInt(_0x230e43(0x164))/0x6+-parseInt(_0x230e43(0x170))/0x7+-parseInt(_0x230e43(0x161))/0x8*(parseInt(_0x230e43(0x15e))/0x9)+parseInt(_0x230e43(0x171))/0xa*(parseInt(_0x230e43(0x16a))/0xb);if(_0x188c3b===_0x5747d8)break;else _0x475e8c['push'](_0x475e8c['shift']());}catch(_0x1aa4a1){_0x475e8c['push'](_0x475e8c['shift']());}}}(a49_0x3e61,0x74734));import a49_0x41900f from'node:path';import{useCallback,useState}from'react';function a49_0x312e(_0x5d8d70,_0x502ea5){_0x5d8d70=_0x5d8d70-0x15e;const _0x3e61e6=a49_0x3e61();let _0x312e5c=_0x3e61e6[_0x5d8d70];return _0x312e5c;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x4e9242=a49_0x312e,[_0x121cb,_0x3235ed]=useState(![]),[_0x5943e0,_0x40afc2]=useState(![]),[_0x2d6c60,_0x80faeb]=useState(''),_0x5845f2=useCallback(async _0x37e79d=>{const _0x3cbaf0=a49_0x312e,_0x27421b=Date['now'](),_0x59e067=a49_0x41900f[_0x3cbaf0(0x16f)](process['cwd'](),_0x37e79d);_0x3235ed(!![]);try{logger[_0x3cbaf0(0x162)](_0x3cbaf0(0x173),_0x3cbaf0(0x16d),{'projectCode':_0x37e79d}),await execa(_0x3cbaf0(0x169),['prettier',_0x3cbaf0(0x167),'.'],{'cwd':_0x59e067});const _0x5c9d79=Date['now']()-_0x27421b;logger[_0x3cbaf0(0x163)]('format',_0x3cbaf0(0x16c),_0x5c9d79,{'projectCode':_0x37e79d});}catch(_0x59af3b){const _0xd9bb93=Date['now']()-_0x27421b;logger[_0x3cbaf0(0x165)]('format','代码格式化失败',{'projectCode':_0x37e79d,'error':_0x59af3b instanceof Error?_0x59af3b[_0x3cbaf0(0x172)]:String(_0x59af3b),'duration':_0xd9bb93});throw _0x59af3b;}finally{_0x3235ed(![]),_0x40afc2(!![]),_0x80faeb(formatElapsed(_0x27421b));}},[]);return{'taskName':_0x4e9242(0x16b),'finished':_0x5943e0,'loading':_0x121cb,'elapsed':_0x2d6c60,'doTask':_0x5845f2};}
@@ -1 +1 @@
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};}
1
+ function a50_0x3249(){const _0x3227c8=['1717508UjlUql','10555356laGMXY','resolve','success','2002555ZTqSED','安装依赖','now','157368qPAwtd','依赖安装完成','npm','3054330yYutaR','install','84itIjjC','依赖安装失败','5891008QoAEcP','cwd','https://registry.npmmirror.com','message','开始安装依赖','933999oDBxhp'];a50_0x3249=function(){return _0x3227c8;};return a50_0x3249();}(function(_0x4a637b,_0x17d2cb){const _0x220785=a50_0x2419,_0x55dddb=_0x4a637b();while(!![]){try{const _0x1bbff4=-parseInt(_0x220785(0x17b))/0x1+-parseInt(_0x220785(0x17c))/0x2+parseInt(_0x220785(0x174))/0x3*(parseInt(_0x220785(0x16f))/0x4)+parseInt(_0x220785(0x16c))/0x5+parseInt(_0x220785(0x172))/0x6+parseInt(_0x220785(0x17d))/0x7+-parseInt(_0x220785(0x176))/0x8;if(_0x1bbff4===_0x17d2cb)break;else _0x55dddb['push'](_0x55dddb['shift']());}catch(_0x1185e7){_0x55dddb['push'](_0x55dddb['shift']());}}}(a50_0x3249,0xf1ae1));import a50_0x3ca48f from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a50_0x2419(_0x54d16f,_0x2e78bb){_0x54d16f=_0x54d16f-0x16a;const _0x324917=a50_0x3249();let _0x2419b5=_0x324917[_0x54d16f];return _0x2419b5;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x5e5db3=a50_0x2419,[_0x695b25,_0x25289a]=useState(![]),[_0x403f6d,_0x3e5f19]=useState(![]),[_0x3a5b9a,_0x101d61]=useState(''),_0x56c361=useCallback(async _0x43b458=>{const _0x5b8046=a50_0x2419,_0x5a13f8=Date[_0x5b8046(0x16e)](),_0x19c4a5=a50_0x3ca48f[_0x5b8046(0x16a)](process[_0x5b8046(0x177)](),_0x43b458);_0x25289a(!![]),_0x3e5f19(![]);const _0xc30e0=async(_0x4842e7,_0x45c60d)=>{await execa(_0x4842e7,_0x45c60d,{'cwd':_0x19c4a5});};try{logger['info'](_0x5b8046(0x173),_0x5b8046(0x17a),{'projectCode':_0x43b458,'registry':_0x5b8046(0x178)}),await _0xc30e0(_0x5b8046(0x171),[_0x5b8046(0x173),'--registry','https://registry.npmmirror.com']);const _0x595eaf=Date[_0x5b8046(0x16e)]()-_0x5a13f8;logger[_0x5b8046(0x16b)](_0x5b8046(0x173),_0x5b8046(0x170),_0x595eaf,{'projectCode':_0x43b458});}catch(_0x44d268){const _0x223d32=Date[_0x5b8046(0x16e)]()-_0x5a13f8;logger['error'](_0x5b8046(0x173),_0x5b8046(0x175),{'projectCode':_0x43b458,'error':_0x44d268 instanceof Error?_0x44d268[_0x5b8046(0x179)]:String(_0x44d268),'duration':_0x223d32});throw _0x44d268;}finally{_0x25289a(![]),_0x3e5f19(!![]),_0x101d61(formatElapsed(_0x5a13f8));}},[]);return{'taskName':_0x5e5db3(0x16d),'finished':_0x403f6d,'loading':_0x695b25,'elapsed':_0x3a5b9a,'doTask':_0x56c361};}
package/lib/help.js CHANGED
@@ -1 +1 @@
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)})]})]});}
1
+ (function(_0xf477eb,_0x2612b3){var _0x23656a=a51_0x521b,_0x38c6f3=_0xf477eb();while(!![]){try{var _0x4f0456=-parseInt(_0x23656a(0x103))/0x1+parseInt(_0x23656a(0x107))/0x2+parseInt(_0x23656a(0x109))/0x3+parseInt(_0x23656a(0x108))/0x4+-parseInt(_0x23656a(0x102))/0x5*(-parseInt(_0x23656a(0x105))/0x6)+parseInt(_0x23656a(0x101))/0x7+-parseInt(_0x23656a(0x104))/0x8;if(_0x4f0456===_0x2612b3)break;else _0x38c6f3['push'](_0x38c6f3['shift']());}catch(_0x306aaa){_0x38c6f3['push'](_0x38c6f3['shift']());}}}(a51_0x548e,0xdbe68));function a51_0x521b(_0x206133,_0x410b09){_0x206133=_0x206133-0x100;var _0x548efa=a51_0x548e();var _0x521bf7=_0x548efa[_0x206133];return _0x521bf7;}function a51_0x548e(){var _0x5896ad=['green','7486045CoktGN','5dmbcsg','563295uSZqnu','18993152nrigMF','9894774cDymig','!\x20请指定一个有效的命令。','912256gylyhJ','1336844EYRvVd','987744jNPLZq','lovrabet\x20--help'];a51_0x548e=function(){return _0x5896ad;};return a51_0x548e();}import{jsx as a51_0x3e2322,jsxs as a51_0x40377f}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x51b2d3=a51_0x521b;return a51_0x40377f(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a51_0x40377f(Box,{'children':[a51_0x3e2322(Box,{'width':'1'}),a51_0x3e2322(Text,{'children':_0x51b2d3(0x106)})]}),a51_0x40377f(Box,{'marginTop':0x1,'children':[a51_0x3e2322(Box,{'width':'1'}),a51_0x40377f(Text,{'children':['\x20\x20','使用']}),a51_0x40377f(Text,{'bold':!![],'color':_0x51b2d3(0x100),'children':['\x20',_0x51b2d3(0x10a),'\x20']}),a51_0x3e2322(Text,{'children':'查看可用命令。'})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
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)})});}
1
+ function a52_0x309c(){const _0x4fd82c=['应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','online','backspace','414031enJoZi','应用代码不合法','green','cyan','delete','应用代码长度不能超过\x20100\x20个字符','14701480GupZIT','length','AppCode:\x20','exit','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','97932SyeGsD','env','utf8','\x20←\x20','1260780qfaYZR','2985740gDDFUF','red','1230831CxVruP','78cSiZzH','请输入应用代码\x20(AppCode):\x20','stringify','初始化项目配置文件成功','slice','9yDuTLQ','setLogPath','return','version','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','1.0.0','../..','package.json','trim','1858072tpxRiM','gray','正在初始化配置文件...','应用代码只能包含字母、数字、-\x20和\x20_','2hwxZVI','cwd','error','column','info','应用代码不能为空','ctrl','创建配置文件失败','message','创建配置文件失败:\x20'];a52_0x309c=function(){return _0x4fd82c;};return a52_0x309c();}(function(_0x52b0fd,_0x337995){const _0x4cdd66=a52_0x1aac,_0x493a7c=_0x52b0fd();while(!![]){try{const _0x1a8be3=parseInt(_0x4cdd66(0xee))/0x1*(parseInt(_0x4cdd66(0xe1))/0x2)+parseInt(_0x4cdd66(0x101))/0x3*(parseInt(_0x4cdd66(0xf9))/0x4)+parseInt(_0x4cdd66(0xfe))/0x5+parseInt(_0x4cdd66(0xfd))/0x6+-parseInt(_0x4cdd66(0x100))/0x7+parseInt(_0x4cdd66(0xdd))/0x8*(parseInt(_0x4cdd66(0x106))/0x9)+-parseInt(_0x4cdd66(0xf4))/0xa;if(_0x1a8be3===_0x337995)break;else _0x493a7c['push'](_0x493a7c['shift']());}catch(_0x54009c){_0x493a7c['push'](_0x493a7c['shift']());}}}(a52_0x309c,0x6c6f1));import{jsxs as a52_0x4ff1ac,jsx as a52_0x1f1558}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';function a52_0x1aac(_0x24f8e3,_0x55fb36){_0x24f8e3=_0x24f8e3-0xda;const _0x309c93=a52_0x309c();let _0x1aacca=_0x309c93[_0x24f8e3];return _0x1aacca;}import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x7d1330,env:_0x26fbdd}){const _0x4da5b9=a52_0x1aac,[_0x146d02,_0x3eb3eb]=useState(null),[_0x306ebe,_0xc3edf9]=useState(![]),[_0x3d803c,_0x348780]=useState(!_0x7d1330),[_0x290150,_0x602cf4]=useState(''),[_0x4162f6,_0x248ba6]=useState(''),[_0x18d880,_0x3608fe]=useState(_0x7d1330||''),[_0x14797a]=useState(_0x26fbdd);function _0x41332a(_0x3f0d22){const _0x55a8c0=a52_0x1aac;if(_0x3f0d22['length']===0x0)return{'valid':![],'message':''};if(_0x3f0d22[_0x55a8c0(0xf5)]>0x64)return{'valid':![],'message':_0x55a8c0(0xf3)};const _0x4f14c2=/^[A-Za-z0-9_-]+$/;if(!_0x4f14c2['test'](_0x3f0d22))return{'valid':![],'message':_0x55a8c0(0xe0)};return{'valid':!![]};}useInput((_0x454ba4,_0x2c333b)=>{const _0xfd2847=a52_0x1aac;if(!_0x3d803c)return;if(_0x2c333b[_0xfd2847(0x108)]){if(_0x4162f6||!_0x290150['trim']()){_0x248ba6(_0xfd2847(0xe6));return;}const _0x31b0a8=_0x290150[_0xfd2847(0xdc)](),{valid:_0xafd2ac,message:_0x23bb73}=_0x41332a(_0x31b0a8);if(!_0xafd2ac){_0x248ba6(_0x23bb73||_0xfd2847(0xef));return;}_0x3608fe(_0x31b0a8),_0x348780(![]);}else{if(_0x2c333b[_0xfd2847(0xed)]||_0x2c333b[_0xfd2847(0xf2)])_0x602cf4(_0x47f705=>{const _0x44ee13=_0xfd2847,_0x5c2ade=_0x47f705[_0x44ee13(0x105)](0x0,-0x1);if(_0x5c2ade[_0x44ee13(0xf5)]===0x0)_0x248ba6('');else{const {valid:_0x30c655,message:_0x4300a6}=_0x41332a(_0x5c2ade);_0x248ba6(_0x30c655?'':_0x4300a6||'应用代码不合法');}return _0x5c2ade;});else _0x2c333b[_0xfd2847(0xe7)]&&_0x454ba4==='c'?process[_0xfd2847(0xf7)](0x0):_0x602cf4(_0x27c05e=>{const _0x55345f=_0xfd2847,_0xc072a=_0x27c05e+_0x454ba4,{valid:_0x51ea6,message:_0x175efa}=_0x41332a(_0xc072a);return _0x248ba6(_0x51ea6?'':_0x175efa||_0x55345f(0xef)),_0xc072a;});}},{'isActive':_0x3d803c}),useEffect(()=>{const _0x57d5d8=a52_0x1aac;if(!_0x18d880||_0x3d803c)return;const _0x421cab=resolve(process[_0x57d5d8(0xe2)](),'.lovrabetrc');if(existsSync(_0x421cab)){_0x3eb3eb('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process[_0x57d5d8(0xf7)](0x1),0x64);return;}try{const _0x1551f8=fileURLToPath(import.meta.url),_0x2076bd=resolve(dirname(_0x1551f8),_0x57d5d8(0xda)),_0x2e1fbf=join(_0x2076bd,_0x57d5d8(0xdb));let _0x123c53=_0x57d5d8(0x10b);try{const _0x4ad5bc=JSON['parse'](readFileSync(_0x2e1fbf,_0x57d5d8(0xfb)));_0x123c53=_0x4ad5bc[_0x57d5d8(0x109)]||'1.0.0';}catch(_0x448737){}const _0x599261=readConfig(),_0x140fd8=typeof _0x599261[_0x57d5d8(0xfa)]==='string'?_0x599261['env']:undefined,{app:_0x5a87cf,appcode:_0x5c88ac,..._0x3fd6a6}=_0x599261,_0x36d823={..._0x3fd6a6,'appcode':_0x18d880,'env':_0x14797a||_0x140fd8||_0x57d5d8(0xec),'createdAt':new Date()['toLocaleString'](),'version':_0x123c53};writeFileSync(_0x421cab,JSON[_0x57d5d8(0x103)](_0x36d823,null,0x2),{'encoding':_0x57d5d8(0xfb),'mode':0x180}),logger[_0x57d5d8(0x107)](process[_0x57d5d8(0xe2)]()),logger[_0x57d5d8(0xe5)]('init',_0x57d5d8(0x104),{'appcode':_0x18d880,'env':_0x36d823[_0x57d5d8(0xfa)],'version':_0x36d823[_0x57d5d8(0x109)],'configPath':_0x421cab}),_0xc3edf9(!![]),setTimeout(()=>process[_0x57d5d8(0xf7)](0x0),0x64);}catch(_0xf4dadd){logger[_0x57d5d8(0xe3)]('init',_0x57d5d8(0xe8),{'error':_0xf4dadd instanceof Error?_0xf4dadd[_0x57d5d8(0xe9)]:String(_0xf4dadd)}),_0x3eb3eb(_0x57d5d8(0xea)+(_0xf4dadd instanceof Error?_0xf4dadd[_0x57d5d8(0xe9)]:String(_0xf4dadd))),setTimeout(()=>process['exit'](0x1),0x64);}},[_0x18d880,_0x3d803c,_0x14797a]);if(_0x146d02)return a52_0x1f1558(Box,{'flexDirection':'column','children':a52_0x4ff1ac(Text,{'color':'red','children':['✗\x20',_0x146d02]})});if(_0x3d803c)return a52_0x4ff1ac(Box,{'flexDirection':_0x4da5b9(0xe4),'children':[a52_0x4ff1ac(Box,{'children':[a52_0x1f1558(Text,{'color':_0x4da5b9(0xf1),'children':_0x4da5b9(0x102)}),_0x290150?a52_0x1f1558(Text,{'color':_0x4da5b9(0xf0),'children':_0x290150}):a52_0x1f1558(Text,{'color':_0x4da5b9(0xde),'children':'_'}),_0x4162f6&&a52_0x4ff1ac(Text,{'color':_0x4da5b9(0xff),'children':[_0x4da5b9(0xfc),_0x4162f6]})]}),!_0x4162f6&&!_0x290150&&a52_0x1f1558(Box,{'children':a52_0x1f1558(Text,{'color':_0x4da5b9(0xde),'children':_0x4da5b9(0xeb)})})]});if(_0x306ebe)return a52_0x4ff1ac(Box,{'flexDirection':_0x4da5b9(0xe4),'children':[a52_0x1f1558(Text,{'color':_0x4da5b9(0xf0),'children':_0x4da5b9(0xf8)}),a52_0x4ff1ac(Text,{'color':_0x4da5b9(0xf1),'children':[_0x4da5b9(0xf6),_0x18d880]}),a52_0x1f1558(Text,{'children':_0x4da5b9(0x10a)})]});return a52_0x1f1558(Box,{'children':a52_0x1f1558(Text,{'children':_0x4da5b9(0xdf)})});}
@@ -1 +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);}
1
+ const a53_0x118ca4=a53_0x51a0;function a53_0x5f55(){const _0x3f7280=['message','\x20\x20\x20\x20\x22','1505786mbFnjV','npx','agents.md','configuring','⚠️\x20\x20未找到\x20appcode\x20配置','done','upArrow','red','app','✓\x20已写入\x20.cursor/mcp.json','\x20\x20}','Claude\x20Code','every','downArrow','19180746MJEsqv','return','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','utf-8','other','6676943zGUwgW','配置信息:','3575520cPidzG','column','has','@lovrabet/dataset-mcp-server@latest','Claude\x20Code\x20CLI','../../templates/rules/lovrabet_rules.mdc.tpl','\x20\x20\x20请先运行\x20\x27lovrabet\x20init\x20--appcode\x20<your-app-code>\x27\x20初始化项目配置\x0a','\x20\x20⚠️','warn','mcp.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','复制\x20Cursor\x20Rules\x20文件失败','请手动执行上述命令','\x22:\x20{','配置信息:\x20appcode=','195bjcwIY','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','info','2925072rAllXU','name','yellow','filter','rules','selecting','cyan','delete','复制\x20agents.md\x20文件失败','正在配置\x20MCP\x20服务器...','size','按任意键退出...','\x20\x20\x20\x20\x20\x20}','配置指引已显示','*\x20请选择要配置的\x20IDE:','indexOf','appcode','lovrabet-dataset','\x20\x20✓','mcp-install','claude','需要先配置\x20appcode','add','log','其他\x20IDE\x20配置指引已显示','LOVRABET_ENV','parse','env','lovrabet_rules.mdc','\x20\x20AppCode:\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认',',\x20env=','manual','已写入\x20.cursor/mcp.json','gray','\x20\x20环境:\x20','\x20\x20重启\x20Cursor\x20后生效\x0a','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','join','已选择\x20IDE','\x20\x20Cursor\x20Rules\x20文件已存在,跳过\x0a','cwd','[\x20]','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','description','length','mcpServers','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','9956FQINYb','\x20-e\x20LOVRABET_ENV=','⚠️\x20部分配置需要手动完成','white','Claude\x20Code\x20MCP\x20命令已生成','includes','\x20\x20agents.md\x20已存在,跳过\x0a','\x0a📋\x20Lovrabet\x20MCP\x20服务器配置\x0a','创建\x20agents.md\x20文件','Cursor\x20Rules\x20模板文件不存在','✓\x20创建\x20agents.md\x20到项目根目录\x0a','请手动执行','.cursor','green','error','其他\x20IDE','map','ide','未找到\x20appcode\x20配置','3410271MSdqHM','push','claude\x20mcp\x20add\x20','success','online','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','agents.md\x20模板文件不存在','1yPvxZM','📚\x20详细配置指南:\x20https://help.yuntoo.com/mcp/config-guide\x0a','cursor','\x20\x20\x22mcpServers\x22:\x20{','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','Cursor','some','status','不支持的\x20IDE:\x20','✓\x20MCP\x20配置完成!'];a53_0x5f55=function(){return _0x3f7280;};return a53_0x5f55();}(function(_0x4b64dc,_0x45aa79){const _0x390850=a53_0x51a0,_0x29f0d9=_0x4b64dc();while(!![]){try{const _0x2e31e3=-parseInt(_0x390850(0xe3))/0x1*(-parseInt(_0x390850(0xef))/0x2)+-parseInt(_0x390850(0xdc))/0x3+-parseInt(_0x390850(0x146))/0x4*(parseInt(_0x390850(0x113))/0x5)+-parseInt(_0x390850(0x116))/0x6+-parseInt(_0x390850(0x102))/0x7+parseInt(_0x390850(0x104))/0x8+parseInt(_0x390850(0xfd))/0x9;if(_0x2e31e3===_0x45aa79)break;else _0x29f0d9['push'](_0x29f0d9['shift']());}catch(_0x344e4f){_0x29f0d9['push'](_0x29f0d9['shift']());}}}(a53_0x5f55,0xa01de));import{jsx as a53_0x19a9a2,jsxs as a53_0x275275,Fragment as a53_0x5b3226}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';function a53_0x51a0(_0x2a0208,_0x138709){_0x2a0208=_0x2a0208-0xd8;const _0x5f5539=a53_0x5f55();let _0x51a0ef=_0x5f5539[_0x2a0208];return _0x51a0ef;}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a53_0x118ca4(0xe8),'description':'Cursor\x20IDE'},'claude':{'name':a53_0x118ca4(0xfa),'description':a53_0x118ca4(0x108)},'other':{'name':a53_0x118ca4(0xd8),'description':'其他\x20IDE\x20配置指引'}},IDE_LIST=[a53_0x118ca4(0xe5),'claude',a53_0x118ca4(0x101)],MCP_SERVER_NAME=a53_0x118ca4(0x127),MCP_COMMAND=a53_0x118ca4(0xf0),MCP_ARGS=[a53_0x118ca4(0x107)];export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x372885=a53_0x118ca4,{exit:_0x2cdc05}=useApp(),[_0x5e5bce,_0x5a1dd6]=useState(_0x372885(0x11b)),[_0x180e48,_0x16a7de]=useState(new Set(preselectedIDEs[_0x372885(0xd9)](_0x17710c=>IDE_LIST[_0x372885(0x125)](_0x17710c))[_0x372885(0x119)](_0xdb866=>_0xdb866>=0x0))),[_0x301999,_0x3a4826]=useState(0x0),[_0x43090a,_0x21f037]=useState([]),[_0x3437f4,_0x2c326e]=useState([]),[_0x3c6f04,_0xf6e3f3]=useState('');useEffect(()=>{const _0x2ec654=_0x372885;preselectedIDEs[_0x2ec654(0x143)]>0x0&&_0x180e48[_0x2ec654(0x120)]>0x0&&_0x50f831();},[]),useInput((_0x149236,_0x380da0)=>{const _0x3f417f=_0x372885;if(_0x5e5bce===_0x3f417f(0x11b)){if(_0x380da0[_0x3f417f(0xf5)]){_0x3a4826(_0x3f8887=>_0x3f8887>0x0?_0x3f8887-0x1:IDE_LIST[_0x3f417f(0x143)]-0x1);return;}if(_0x380da0[_0x3f417f(0xfc)]){_0x3a4826(_0x38791d=>_0x38791d<IDE_LIST[_0x3f417f(0x143)]-0x1?_0x38791d+0x1:0x0);return;}if(_0x149236==='\x20'){_0x16a7de(_0x1bfdcb=>{const _0x46ffb3=_0x3f417f,_0x456b68=new Set(_0x1bfdcb);return _0x456b68[_0x46ffb3(0x106)](_0x301999)?_0x456b68[_0x46ffb3(0x11d)](_0x301999):_0x456b68[_0x46ffb3(0x12c)](_0x301999),_0x456b68;});return;}if(_0x149236==='a'||_0x149236==='A'){_0x16a7de(new Set(IDE_LIST[_0x3f417f(0xd9)]((_0x135543,_0xfac4df)=>_0xfac4df)));return;}if(_0x149236==='i'||_0x149236==='I'||_0x149236==='r'||_0x149236==='R'){_0x16a7de(_0x4fe4d5=>{const _0x59f67a=_0x3f417f,_0x30006b=new Set();for(let _0x2dd9d4=0x0;_0x2dd9d4<IDE_LIST[_0x59f67a(0x143)];_0x2dd9d4++){!_0x4fe4d5['has'](_0x2dd9d4)&&_0x30006b[_0x59f67a(0x12c)](_0x2dd9d4);}return _0x30006b;});return;}if(_0x149236==='q'||_0x149236==='Q'){_0x2cdc05();return;}if(_0x380da0[_0x3f417f(0xfe)]){if(_0x180e48[_0x3f417f(0x120)]===0x0){_0xf6e3f3('请至少选择一个\x20IDE');return;}_0x50f831();return;}}if(_0x5e5bce===_0x3f417f(0xf4)){_0x2cdc05();return;}});async function _0x50f831(){const _0x4c6de4=_0x372885,_0x4e511d=Array['from'](_0x180e48)[_0x4c6de4(0xd9)](_0x1b8b33=>IDE_LIST[_0x1b8b33])[_0x4c6de4(0x119)](_0xa964b9=>_0xa964b9!==undefined);_0x21f037([{'label':_0x4c6de4(0x13d),'value':_0x180e48[_0x4c6de4(0x120)]+'\x20个'}]),_0x5a1dd6(_0x4c6de4(0xf2));const _0x51bcac=[];for(const _0x5f260e of _0x4e511d){try{const _0x592747=await configureMcp(_0x5f260e),_0x3c8a8f=_0x592747[_0x4c6de4(0x14b)](_0x4c6de4(0x151));_0x51bcac[_0x4c6de4(0xdd)]({'ide':IDE_CONFIGS[_0x5f260e]['name'],'status':_0x3c8a8f?_0x4c6de4(0x136):_0x4c6de4(0xdf),'message':_0x592747});}catch(_0x509c2){_0x51bcac[_0x4c6de4(0xdd)]({'ide':IDE_CONFIGS[_0x5f260e][_0x4c6de4(0x117)],'status':_0x4c6de4(0x154),'message':_0x509c2 instanceof Error?_0x509c2[_0x4c6de4(0xed)]:String(_0x509c2)});}}_0x2c326e(_0x51bcac),_0x5a1dd6(_0x4c6de4(0xf4)),setTimeout(()=>{_0x2cdc05();},0x1388);}return a53_0x275275(Box,{'flexDirection':_0x372885(0x105),'marginTop':0x1,'children':[_0x5e5bce===_0x372885(0x11b)&&a53_0x275275(a53_0x5b3226,{'children':[a53_0x19a9a2(Box,{'children':a53_0x19a9a2(Text,{'color':_0x372885(0x11c),'children':'*\x20配置\x20Lovrabet\x20MCP\x20服务器'})}),_0x3c6f04&&a53_0x19a9a2(Box,{'marginTop':0x1,'children':a53_0x275275(Text,{'color':_0x372885(0xf6),'children':['✗\x20',_0x3c6f04]})}),a53_0x275275(Box,{'marginTop':0x1,'flexDirection':_0x372885(0x105),'children':[a53_0x19a9a2(Text,{'bold':!![],'children':_0x372885(0x124)}),IDE_LIST['map']((_0xf5f087,_0x37162e)=>{const _0x551fbb=_0x372885,_0x51b484=_0x301999===_0x37162e,_0x29958f=_0x180e48['has'](_0x37162e);return a53_0x19a9a2(Box,{'children':a53_0x275275(Text,{'backgroundColor':_0x51b484?'blue':undefined,'color':_0x51b484?'white':undefined,'children':['\x20\x20',_0x29958f?'[✓]':_0x551fbb(0x140),'\x20',IDE_CONFIGS[_0xf5f087][_0x551fbb(0x117)],'\x20',a53_0x275275(Text,{'color':_0x51b484?_0x551fbb(0x149):'gray','dimColor':!_0x51b484,'children':['-\x20',IDE_CONFIGS[_0xf5f087][_0x551fbb(0x142)]]})]})},_0xf5f087);}),a53_0x19a9a2(Box,{'marginTop':0x1,'children':a53_0x275275(Text,{'color':_0x372885(0x138),'children':['\x20',_0x372885(0x134)]})})]})]}),_0x5e5bce==='configuring'&&a53_0x275275(a53_0x5b3226,{'children':[_0x43090a['map']((_0xe2bd8d,_0x4f801e)=>a53_0x275275(Box,{'children':[a53_0x275275(Text,{'color':_0x372885(0x153),'children':['√\x20',_0xe2bd8d['label'],':\x20']}),a53_0x19a9a2(Text,{'color':_0x372885(0x11c),'children':_0xe2bd8d['value']})]},_0x4f801e)),a53_0x19a9a2(Box,{'marginTop':0x1,'children':a53_0x19a9a2(Text,{'children':_0x372885(0x11f)})})]}),_0x5e5bce==='done'&&a53_0x275275(a53_0x5b3226,{'children':[a53_0x19a9a2(Box,{'children':_0x3437f4[_0x372885(0xfb)](_0x5a4e6d=>_0x5a4e6d[_0x372885(0xea)]==='success')?a53_0x19a9a2(Text,{'color':'green','children':_0x372885(0xec)}):_0x3437f4[_0x372885(0xe9)](_0x45540e=>_0x45540e[_0x372885(0xea)]==='success')?a53_0x19a9a2(Text,{'color':'yellow','children':_0x372885(0x148)}):a53_0x19a9a2(Text,{'color':_0x372885(0x118),'children':'⚠️\x20配置需要手动完成'})}),_0x3437f4[_0x372885(0xd9)]((_0x20d859,_0x27815c)=>a53_0x275275(Box,{'children':[a53_0x275275(Text,{'color':_0x20d859[_0x372885(0xea)]===_0x372885(0xdf)?_0x372885(0x153):_0x20d859['status']==='manual'?_0x372885(0x118):'red','children':[_0x20d859[_0x372885(0xea)]==='success'?_0x372885(0x128):_0x20d859[_0x372885(0xea)]===_0x372885(0x136)?_0x372885(0x10b):'\x20\x20✗','\x20',_0x20d859[_0x372885(0xda)],':','\x20']}),a53_0x19a9a2(Text,{'color':_0x20d859['status']===_0x372885(0xdf)?_0x372885(0x149):_0x20d859[_0x372885(0xea)]===_0x372885(0x136)?_0x372885(0x118):_0x372885(0xf6),'children':_0x20d859[_0x372885(0xed)]})]},_0x27815c)),a53_0x19a9a2(Box,{'marginTop':0x1,'children':a53_0x19a9a2(Text,{'color':_0x372885(0x138),'children':_0x372885(0x121)})})]})]});}async function configureMcp(_0x280e9c){const _0x22095d=a53_0x118ca4;switch(_0x280e9c){case _0x22095d(0xe5):return await configureCursorMcp();case _0x22095d(0x12a):return await configureClaudeMcp();case'other':return await showOtherGuide();default:throw new Error(_0x22095d(0xeb)+_0x280e9c);}}async function configureCursorMcp(){const _0x537b56=a53_0x118ca4,_0x4e4e69=readConfig(),_0x1042b5=_0x4e4e69[_0x537b56(0x126)]||_0x4e4e69[_0x537b56(0xf7)],_0x1212fb=_0x4e4e69[_0x537b56(0x131)]||_0x537b56(0xe0);if(!_0x1042b5)return console[_0x537b56(0x12d)](_0x537b56(0xf3)),console[_0x537b56(0x12d)](_0x537b56(0x10a)),logger[_0x537b56(0x10c)](_0x537b56(0x129),_0x537b56(0xdb)),_0x537b56(0x12b);const _0x2c726f={'LOVRABET_APP_CODE':String(_0x1042b5)};_0x1212fb!==_0x537b56(0xe0)&&(_0x2c726f[_0x537b56(0x12f)]=String(_0x1212fb));const _0x572fd7={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x2c726f},_0x15f29b=join(process['cwd'](),_0x537b56(0x152),_0x537b56(0x10d)),_0x3a206f=join(process[_0x537b56(0x13f)](),_0x537b56(0x152));!existsSync(_0x3a206f)&&mkdirSync(_0x3a206f,{'recursive':!![]});let _0x260b9d={'mcpServers':{}};if(existsSync(_0x15f29b))try{const _0x5c572c=readFileSync(_0x15f29b,_0x537b56(0x100));_0x260b9d=JSON[_0x537b56(0x130)](_0x5c572c);}catch{}(!_0x260b9d['mcpServers']||typeof _0x260b9d[_0x537b56(0x144)]!=='object')&&(_0x260b9d['mcpServers']={});_0x260b9d[_0x537b56(0x144)][MCP_SERVER_NAME]=_0x572fd7,writeFileSync(_0x15f29b,JSON['stringify'](_0x260b9d,null,0x2),_0x537b56(0x100)),logger['info']('mcp-install','Cursor\x20MCP\x20配置成功',{'appcode':_0x1042b5,'env':_0x1212fb,'path':_0x15f29b}),console['log'](_0x537b56(0xf8)),console['log'](_0x537b56(0x133)+_0x1042b5);_0x1212fb!=='online'&&console[_0x537b56(0x12d)](_0x537b56(0x139)+_0x1212fb);console['log'](_0x537b56(0x13a));const _0x4932f1=join(_0x3a206f,_0x537b56(0x11a)),_0x34eec0=join(_0x4932f1,_0x537b56(0x132));if(!existsSync(_0x34eec0))try{!existsSync(_0x4932f1)&&mkdirSync(_0x4932f1,{'recursive':!![]});const _0xa98b3f=resolve(__dirname,_0x537b56(0x109));existsSync(_0xa98b3f)?(copyFileSync(_0xa98b3f,_0x34eec0),logger[_0x537b56(0x115)]('mcp-install','创建\x20Cursor\x20Rules\x20文件',{'from':_0xa98b3f,'to':_0x34eec0}),console[_0x537b56(0x12d)](_0x537b56(0x114))):logger[_0x537b56(0x10c)](_0x537b56(0x129),_0x537b56(0x14f),{'templatePath':_0xa98b3f});}catch(_0x12f136){logger[_0x537b56(0x154)](_0x537b56(0x129),_0x537b56(0x10f),{'error':_0x12f136 instanceof Error?_0x12f136[_0x537b56(0xed)]:String(_0x12f136)});}else console['log'](_0x537b56(0x13e));return _0x537b56(0x137);}async function configureClaudeMcp(){const _0x275ac5=a53_0x118ca4,_0x238742=readConfig(),_0x284b3f=_0x238742[_0x275ac5(0x126)]||_0x238742[_0x275ac5(0xf7)],_0x2cf0dd=_0x238742[_0x275ac5(0x131)]||_0x275ac5(0xe0);if(!_0x284b3f)return console[_0x275ac5(0x12d)](_0x275ac5(0xf3)),console[_0x275ac5(0x12d)]('\x20\x20\x20请先运行\x20\x27lovrabet\x20init\x20--appcode\x20<your-app-code>\x27\x20初始化项目配置\x0a'),logger[_0x275ac5(0x10c)](_0x275ac5(0x129),_0x275ac5(0xdb)),_0x275ac5(0x12b);let _0x3ddd07=_0x275ac5(0xde)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x275ac5(0x13c)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x284b3f;_0x2cf0dd!==_0x275ac5(0xe0)&&(_0x3ddd07+=_0x275ac5(0x147)+_0x2cf0dd);console[_0x275ac5(0x12d)](_0x275ac5(0x13b)),console[_0x275ac5(0x12d)]('\x20\x20'+_0x3ddd07+'\x0a'),console[_0x275ac5(0x12d)](_0x275ac5(0x103)),console[_0x275ac5(0x12d)]('\x20\x20AppCode:\x20'+_0x284b3f);_0x2cf0dd!=='online'&&console[_0x275ac5(0x12d)](_0x275ac5(0x139)+_0x2cf0dd);console[_0x275ac5(0x12d)](_0x275ac5(0x145)),logger['info'](_0x275ac5(0x129),_0x275ac5(0x14a),{'command':_0x3ddd07,'appcode':_0x284b3f,'env':_0x2cf0dd});const _0x6d54f2=join(process[_0x275ac5(0x13f)](),_0x275ac5(0xf1));if(!existsSync(_0x6d54f2))try{const _0x465adc=resolve(__dirname,_0x275ac5(0x109));if(existsSync(_0x465adc)){const _0x43727f=readFileSync(_0x465adc,'utf-8');writeFileSync(_0x6d54f2,_0x43727f,'utf-8'),logger[_0x275ac5(0x115)](_0x275ac5(0x129),_0x275ac5(0x14e),{'from':_0x465adc,'to':_0x6d54f2}),console[_0x275ac5(0x12d)](_0x275ac5(0x150));}else logger[_0x275ac5(0x10c)](_0x275ac5(0x129),_0x275ac5(0xe2),{'templatePath':_0x465adc});}catch(_0x262dfc){logger[_0x275ac5(0x154)](_0x275ac5(0x129),_0x275ac5(0x11e),{'error':_0x262dfc instanceof Error?_0x262dfc[_0x275ac5(0xed)]:String(_0x262dfc)});}else console[_0x275ac5(0x12d)](_0x275ac5(0x14c));return _0x275ac5(0x110);}async function showOtherGuide(){const _0x46615f=a53_0x118ca4,_0x3c7c3a=readConfig(),_0x57d257=_0x3c7c3a[_0x46615f(0x126)]||_0x3c7c3a[_0x46615f(0xf7)],_0x12b180=_0x3c7c3a[_0x46615f(0x131)]||_0x46615f(0xe0);if(!_0x57d257)return console[_0x46615f(0x12d)](_0x46615f(0xf3)),console[_0x46615f(0x12d)](_0x46615f(0x10a)),logger[_0x46615f(0x10c)](_0x46615f(0x129),_0x46615f(0xdb)),_0x46615f(0x12b);return console['log'](_0x46615f(0x14d)),console['log'](_0x46615f(0x112)+_0x57d257+_0x46615f(0x135)+_0x12b180+'\x0a'),console[_0x46615f(0x12d)]('{'),console['log'](_0x46615f(0xe6)),console[_0x46615f(0x12d)](_0x46615f(0xee)+MCP_SERVER_NAME+_0x46615f(0x111)),console[_0x46615f(0x12d)](_0x46615f(0xff)+MCP_COMMAND+'\x22,'),console[_0x46615f(0x12d)](_0x46615f(0x141)+MCP_ARGS[_0x46615f(0xd9)](_0x34a183=>'\x22'+_0x34a183+'\x22')[_0x46615f(0x13c)](',\x20')+'],'),console[_0x46615f(0x12d)](_0x46615f(0xe1)),console[_0x46615f(0x12d)](_0x46615f(0x10e)+_0x57d257+'\x22,'),_0x12b180!==_0x46615f(0xe0)&&console['log'](_0x46615f(0xe7)+_0x12b180+'\x22,'),console[_0x46615f(0x12d)](_0x46615f(0x122)),console['log']('\x20\x20\x20\x20}'),console[_0x46615f(0x12d)](_0x46615f(0xf9)),console['log']('}\x0a'),console[_0x46615f(0x12d)](_0x46615f(0xe4)),logger[_0x46615f(0x115)](_0x46615f(0x129),_0x46615f(0x12e),{'appcode':_0x57d257,'env':_0x12b180}),_0x46615f(0x123);}
package/lib/mcp/claude.js CHANGED
@@ -1 +1 @@
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);}}
1
+ (function(_0xaac7fd,_0x575f3c){const _0x1847a1=a54_0x1fc2,_0x375e43=_0xaac7fd();while(!![]){try{const _0x44e8fd=-parseInt(_0x1847a1(0x1d0))/0x1+parseInt(_0x1847a1(0x1d2))/0x2*(-parseInt(_0x1847a1(0x1d8))/0x3)+parseInt(_0x1847a1(0x1e5))/0x4*(parseInt(_0x1847a1(0x1e3))/0x5)+parseInt(_0x1847a1(0x1d1))/0x6+parseInt(_0x1847a1(0x1c7))/0x7*(-parseInt(_0x1847a1(0x1dc))/0x8)+parseInt(_0x1847a1(0x1d6))/0x9+parseInt(_0x1847a1(0x1ca))/0xa;if(_0x44e8fd===_0x575f3c)break;else _0x375e43['push'](_0x375e43['shift']());}catch(_0x467c7a){_0x375e43['push'](_0x375e43['shift']());}}}(a54_0x40a0,0x6a373));function a54_0x40a0(){const _0x26bf65=['872OFNiNU','app','claude\x20mcp\x20add\x20lovrabet-dataset\x20npx\x20@lovrabet/dataset-mcp-server@latest','-e\x20LOVRABET_ENV=daily','7jqoLWR','error','配置完成后:\x0a','891020WMPITa','📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','info','env','\x20\x202.\x20在\x20claude\x20code\x20中确认\x20lovrabet-dataset\x20MCP\x20服务器已加载\x0a','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','223020REnwSA','2735652AZFoGG','82vspunX','配置信息:','\x20\x20-\x20AppCode:\x20','exit','1007001AXzscA','daily','48525gPgAnE','log','online','mcp-claude','1645736GZTfoY','appcode','未找到\x20appcode\x20配置','trim','message','错误:\x20配置失败\x20-\x20','配置失败','19955UymfLF','-e\x20LOVRABET_APP_CODE='];a54_0x40a0=function(){return _0x26bf65;};return a54_0x40a0();}function a54_0x1fc2(_0x3b35fb,_0x403f58){_0x3b35fb=_0x3b35fb-0x1c7;const _0x40a07e=a54_0x40a0();let _0x1fc25a=_0x40a07e[_0x3b35fb];return _0x1fc25a;}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureClaudeMcp(){const _0x1ccf8e=a54_0x1fc2;try{const _0x7850b4=readConfig(),_0x497d8b=_0x7850b4[_0x1ccf8e(0x1dd)]||_0x7850b4[_0x1ccf8e(0x1e6)],_0x3e6a4c=_0x7850b4[_0x1ccf8e(0x1cd)]||_0x1ccf8e(0x1da);!_0x497d8b&&(console[_0x1ccf8e(0x1c8)](_0x1ccf8e(0x1cf)),logger[_0x1ccf8e(0x1c8)](_0x1ccf8e(0x1db),_0x1ccf8e(0x1de)),process[_0x1ccf8e(0x1d5)](0x1));console[_0x1ccf8e(0x1d9)](_0x1ccf8e(0x1d3)),console[_0x1ccf8e(0x1d9)](_0x1ccf8e(0x1d4)+_0x497d8b),console[_0x1ccf8e(0x1d9)]('\x20\x20-\x20环境:\x20'+_0x3e6a4c+'\x0a');const _0x2112e1=_0x1ccf8e(0x1e7),_0x4b0c14=_0x1ccf8e(0x1e4)+_0x497d8b,_0x5b71f2=_0x3e6a4c===_0x1ccf8e(0x1d7)?_0x1ccf8e(0x1e8):'',_0x260343=(_0x2112e1+'\x20'+_0x4b0c14+'\x20'+_0x5b71f2)[_0x1ccf8e(0x1df)]();console[_0x1ccf8e(0x1d9)](_0x1ccf8e(0x1cb)),console['log']('\x20\x20'+_0x260343+'\x0a'),console[_0x1ccf8e(0x1d9)](_0x1ccf8e(0x1c9)),console[_0x1ccf8e(0x1d9)]('\x20\x201.\x20重启\x20claude\x20code'),console[_0x1ccf8e(0x1d9)](_0x1ccf8e(0x1ce)),logger[_0x1ccf8e(0x1cc)](_0x1ccf8e(0x1db),'生成配置命令',{'appcode':_0x497d8b,'env':_0x3e6a4c}),process[_0x1ccf8e(0x1d5)](0x0);}catch(_0xdd3afd){logger['error'](_0x1ccf8e(0x1db),_0x1ccf8e(0x1e2),{'error':_0xdd3afd instanceof Error?_0xdd3afd[_0x1ccf8e(0x1e0)]:String(_0xdd3afd)}),console['error'](_0x1ccf8e(0x1e1)+(_0xdd3afd instanceof Error?_0xdd3afd[_0x1ccf8e(0x1e0)]:String(_0xdd3afd))),process[_0x1ccf8e(0x1d5)](0x1);}}
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
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);}}
1
+ function a55_0xff33(){const _0x440dbb=['4182792VUfxLX','Cursor\x20Rules\x20模板文件不存在','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','更新现有\x20mcp.json\x20配置','复制\x20Cursor\x20Rules\x20文件','\x20\x20-\x20AppCode:\x20','2778312VeiYAE','message','配置\x20Cursor\x20MCP\x20失败','mcp.json','\x20\x20-\x20配置文件:\x20','创建\x20.cursor\x20目录','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','app','Cursor\x20Rules\x20文件已存在,跳过','parse','cwd','../../templates/rules/lovrabet_rules.mdc.tpl','\x0a✓\x20Cursor\x20MCP\x20配置成功!','mcpServers','7659882vKmwzZ','rules','\x20\x20-\x20环境:\x20','7397688yhojWH','10700466WqeDrq','1075735PPFbJD','warn','7274JYGpph','exit','log','npx','✓\x20创建\x20.cursor\x20目录:\x20','366gMdwKa','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','解析现有\x20mcp.json\x20失败','✓\x20创建\x20mcp.json\x20配置文件','utf8','错误:\x20解析现有\x20mcp.json\x20失败:\x20','online','配置\x20Cursor\x20MCP\x20成功','错误:\x20配置失败:\x20','@lovrabet/dataset-mcp-server','.cursor','\x0a配置信息:','lovrabet-dataset','✓\x20更新\x20mcp.json\x20配置','appcode','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','error','mcp-cursor','info','创建\x20.cursor/rules\x20目录','lovrabet_rules.mdc'];a55_0xff33=function(){return _0x440dbb;};return a55_0xff33();}function a55_0x3436(_0x2245a9,_0x1c74a9){_0x2245a9=_0x2245a9-0xfe;const _0xff33d9=a55_0xff33();let _0x343617=_0xff33d9[_0x2245a9];return _0x343617;}(function(_0x1a3585,_0x3c81a7){const _0x20352d=a55_0x3436,_0x2599cb=_0x1a3585();while(!![]){try{const _0x234bc5=-parseInt(_0x20352d(0x122))/0x1*(parseInt(_0x20352d(0x11d))/0x2)+-parseInt(_0x20352d(0x108))/0x3+parseInt(_0x20352d(0x102))/0x4+parseInt(_0x20352d(0x11b))/0x5+parseInt(_0x20352d(0x116))/0x6+parseInt(_0x20352d(0x11a))/0x7+-parseInt(_0x20352d(0x119))/0x8;if(_0x234bc5===_0x3c81a7)break;else _0x2599cb['push'](_0x2599cb['shift']());}catch(_0x2f3750){_0x2599cb['push'](_0x2599cb['shift']());}}}(a55_0xff33,0xd7dcd));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 _0x3a173e=a55_0x3436;try{const _0x44c1e5=process[_0x3a173e(0x112)](),_0x331f07=resolve(_0x44c1e5,_0x3a173e(0x12c)),_0x592534=resolve(_0x331f07,_0x3a173e(0x10b)),_0x425ebc=readConfig(),_0x579d8f=_0x425ebc[_0x3a173e(0x130)]||_0x425ebc[_0x3a173e(0x10f)],_0x17cb54=_0x425ebc['env']||_0x3a173e(0x128);!_0x579d8f&&(console[_0x3a173e(0x132)](_0x3a173e(0x10e)),logger[_0x3a173e(0x132)](_0x3a173e(0xfe),'未找到\x20appcode\x20配置'),process['exit'](0x1));!existsSync(_0x331f07)&&(mkdirSync(_0x331f07,{'recursive':!![]}),logger[_0x3a173e(0xff)]('mcp-cursor',_0x3a173e(0x10d),{'path':_0x331f07}),console['log'](_0x3a173e(0x121)+_0x331f07));const _0x4b3ed8={'command':_0x3a173e(0x120),'args':['-y',_0x3a173e(0x12b)],'env':{'LOVRABET_APP_CODE':String(_0x579d8f),'LOVRABET_ENV':String(_0x17cb54)}};let _0x5f2151;if(existsSync(_0x592534))try{const _0x2a5b6c=readFileSync(_0x592534,'utf8');_0x5f2151=JSON[_0x3a173e(0x111)](_0x2a5b6c),!_0x5f2151[_0x3a173e(0x115)]&&(_0x5f2151['mcpServers']={}),_0x5f2151[_0x3a173e(0x115)][_0x3a173e(0x12e)]=_0x4b3ed8,logger[_0x3a173e(0xff)](_0x3a173e(0xfe),_0x3a173e(0x105),{'path':_0x592534,'appcode':_0x579d8f,'env':_0x17cb54}),console[_0x3a173e(0x11f)](_0x3a173e(0x12f));}catch(_0x43a9d6){logger[_0x3a173e(0x132)]('mcp-cursor',_0x3a173e(0x124),{'error':_0x43a9d6 instanceof Error?_0x43a9d6['message']:String(_0x43a9d6)}),console[_0x3a173e(0x132)](_0x3a173e(0x127)+(_0x43a9d6 instanceof Error?_0x43a9d6[_0x3a173e(0x109)]:String(_0x43a9d6))),process[_0x3a173e(0x11e)](0x1);}else _0x5f2151={'mcpServers':{'lovrabet-dataset':_0x4b3ed8}},logger['info'](_0x3a173e(0xfe),'创建新的\x20mcp.json\x20配置',{'path':_0x592534,'appcode':_0x579d8f,'env':_0x17cb54}),console[_0x3a173e(0x11f)](_0x3a173e(0x125));writeFileSync(_0x592534,JSON['stringify'](_0x5f2151,null,0x2),{'encoding':_0x3a173e(0x126)});const _0x523d9f=resolve(_0x331f07,_0x3a173e(0x117)),_0x15ccca=resolve(_0x523d9f,_0x3a173e(0x101));if(!existsSync(_0x15ccca))try{!existsSync(_0x523d9f)&&(mkdirSync(_0x523d9f,{'recursive':!![]}),logger[_0x3a173e(0xff)](_0x3a173e(0xfe),_0x3a173e(0x100),{'path':_0x523d9f}));const _0x47f66c=fileURLToPath(import.meta.url),_0x1d9809=dirname(_0x47f66c),_0x3c094f=resolve(_0x1d9809,_0x3a173e(0x113));existsSync(_0x3c094f)?(copyFileSync(_0x3c094f,_0x15ccca),logger[_0x3a173e(0xff)](_0x3a173e(0xfe),_0x3a173e(0x106),{'from':_0x3c094f,'to':_0x15ccca}),console[_0x3a173e(0x11f)]('✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc')):logger[_0x3a173e(0x11c)]('mcp-cursor',_0x3a173e(0x103),{'templatePath':_0x3c094f});}catch(_0x55f440){logger['error']('mcp-cursor','复制\x20Cursor\x20Rules\x20文件失败',{'error':_0x55f440 instanceof Error?_0x55f440[_0x3a173e(0x109)]:String(_0x55f440)}),console['warn'](_0x3a173e(0x123)+(_0x55f440 instanceof Error?_0x55f440[_0x3a173e(0x109)]:String(_0x55f440)));}else console[_0x3a173e(0x11f)](_0x3a173e(0x131)),logger['info'](_0x3a173e(0xfe),_0x3a173e(0x110),{'path':_0x15ccca});console['log'](_0x3a173e(0x114)),console[_0x3a173e(0x11f)](_0x3a173e(0x12d)),console['log'](_0x3a173e(0x107)+_0x579d8f),console[_0x3a173e(0x11f)](_0x3a173e(0x118)+_0x17cb54),console[_0x3a173e(0x11f)](_0x3a173e(0x10c)+_0x592534),console['log']('\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。'),console[_0x3a173e(0x11f)](_0x3a173e(0x104)),logger[_0x3a173e(0xff)](_0x3a173e(0xfe),_0x3a173e(0x129),{'appcode':_0x579d8f,'env':_0x17cb54,'configPath':_0x592534}),process[_0x3a173e(0x11e)](0x0);}catch(_0x2faf72){logger[_0x3a173e(0x132)](_0x3a173e(0xfe),_0x3a173e(0x10a),{'error':_0x2faf72 instanceof Error?_0x2faf72[_0x3a173e(0x109)]:String(_0x2faf72)}),console['error'](_0x3a173e(0x12a)+(_0x2faf72 instanceof Error?_0x2faf72[_0x3a173e(0x109)]:String(_0x2faf72))),process[_0x3a173e(0x11e)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
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);}}
1
+ const a56_0x267242=a56_0xdfc9;(function(_0x2546bb,_0x289d90){const _0x1865cf=a56_0xdfc9,_0x27a367=_0x2546bb();while(!![]){try{const _0x38ba38=-parseInt(_0x1865cf(0x116))/0x1+parseInt(_0x1865cf(0x139))/0x2*(-parseInt(_0x1865cf(0x12e))/0x3)+parseInt(_0x1865cf(0x128))/0x4*(parseInt(_0x1865cf(0x120))/0x5)+parseInt(_0x1865cf(0x126))/0x6+parseInt(_0x1865cf(0x11b))/0x7+parseInt(_0x1865cf(0x13b))/0x8*(parseInt(_0x1865cf(0x11d))/0x9)+-parseInt(_0x1865cf(0x11e))/0xa*(parseInt(_0x1865cf(0x130))/0xb);if(_0x38ba38===_0x289d90)break;else _0x27a367['push'](_0x27a367['shift']());}catch(_0x3b2239){_0x27a367['push'](_0x27a367['shift']());}}}(a56_0x9e25,0x61eee));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';function a56_0xdfc9(_0x1da573,_0x193976){_0x1da573=_0x1da573-0x116;const _0x9e2563=a56_0x9e25();let _0xdfc9f7=_0x9e2563[_0x1da573];return _0xdfc9f7;}function a56_0x9e25(){const _0x1a639c=['40sAmBkd','配置失败','1085CYWQVG','(空)','--help','mcp-install','\x0a📦\x20正在配置\x20','\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','4473774LfjkYb','mcp','9732zHmlxa','\x20\x20lovrabet\x20mcp\x20install\x20cursor\x20\x20\x20\x20#\x20Cursor\x20IDE','claude\x20code','\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','\x0a可用命令:','message','17991YoZtGM','错误:\x20不支持的命令:\x20','1620586zaRCIA','name','\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a','支持的平台:','\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE','不支持的命令:\x20','setLogPath','error','exit','154Gdkkoc','help','2271144ctiQQk','\x20\x20lovrabet\x20mcp\x20install\x20<ide>\x20\x20\x20\x20#\x20安装\x20MCP\x20配置','\x0a错误:\x20配置失败\x20-\x20','452467boFlCr','\x0a支持的平台:\x20cursor,\x20claude\x0a','错误:\x20不支持的平台:\x20','claude','\x0a请指定要配置的平台:\x0a','443086HCghhK','log','18tdGXPf'];a56_0x9e25=function(){return _0x1a639c;};return a56_0x9e25();}const IDE_CONFIGS={'cursor':{'name':'Cursor','description':'Cursor\x20IDE'},'claude':{'name':a56_0x267242(0x12a),'description':a56_0x267242(0x12a)}};export async function mcpCommand(_0x23fcea,_0x1c268d,_0xc2077d){const _0x295c9e=a56_0x267242;logger[_0x295c9e(0x136)](process['cwd']());if(_0xc2077d?.[_0x295c9e(0x13a)]||_0x23fcea===_0x295c9e(0x122)){showHelp();return;}_0x23fcea!=='install'&&(console[_0x295c9e(0x137)](_0x295c9e(0x12f)+(_0x23fcea||_0x295c9e(0x121))),console[_0x295c9e(0x11c)](_0x295c9e(0x12c)),console[_0x295c9e(0x11c)](_0x295c9e(0x13c)),console[_0x295c9e(0x11c)](_0x295c9e(0x12b)),console['log'](_0x295c9e(0x133)),console[_0x295c9e(0x11c)](_0x295c9e(0x134)),console['log'](_0x295c9e(0x132)),logger[_0x295c9e(0x137)](_0x295c9e(0x127),_0x295c9e(0x135)+_0x23fcea),process[_0x295c9e(0x138)](0x1)),await installMcp(_0x1c268d?.[0x0]);}function showHelp(){const _0x4ce5ff=a56_0x267242;console[_0x4ce5ff(0x11c)](_0x4ce5ff(0x125));}async function installMcp(_0x45cff9){const _0x2741f8=a56_0x267242;!_0x45cff9&&(console[_0x2741f8(0x11c)](_0x2741f8(0x11a)),console[_0x2741f8(0x11c)](_0x2741f8(0x129)),console['log']('\x20\x20lovrabet\x20mcp\x20install\x20claude\x20\x20\x20\x20#\x20claude\x20code\x0a'),process[_0x2741f8(0x138)](0x1));const _0x10718c=_0x45cff9['toLowerCase']();!IDE_CONFIGS[_0x10718c]&&(console[_0x2741f8(0x137)](_0x2741f8(0x118)+_0x45cff9),console[_0x2741f8(0x11c)](_0x2741f8(0x117)),process[_0x2741f8(0x138)](0x1));try{console[_0x2741f8(0x11c)](_0x2741f8(0x124)+IDE_CONFIGS[_0x10718c][_0x2741f8(0x131)]+'\x20MCP...\x0a');switch(_0x10718c){case'cursor':await configureCursorMcp();break;case _0x2741f8(0x119):await configureClaudeMcp();break;}}catch(_0x106c8e){logger['error'](_0x2741f8(0x123),_0x2741f8(0x11f),{'error':_0x106c8e instanceof Error?_0x106c8e[_0x2741f8(0x12d)]:String(_0x106c8e)}),console['error'](_0x2741f8(0x13d)+(_0x106c8e instanceof Error?_0x106c8e[_0x2741f8(0x12d)]:String(_0x106c8e))+'\x0a'),process[_0x2741f8(0x138)](0x1);}}
@@ -1 +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
+ const a57_0x2c9d14=a57_0x2f3b;(function(_0x5b641f,_0x41ec9b){const _0x31c9b3=a57_0x2f3b,_0x3f8a3c=_0x5b641f();while(!![]){try{const _0x186c86=-parseInt(_0x31c9b3(0x1d4))/0x1*(parseInt(_0x31c9b3(0x1db))/0x2)+-parseInt(_0x31c9b3(0x1e4))/0x3+parseInt(_0x31c9b3(0x197))/0x4*(parseInt(_0x31c9b3(0x1d2))/0x5)+-parseInt(_0x31c9b3(0x1c6))/0x6+-parseInt(_0x31c9b3(0x1ab))/0x7+parseInt(_0x31c9b3(0x1a5))/0x8*(parseInt(_0x31c9b3(0x19c))/0x9)+parseInt(_0x31c9b3(0x1dd))/0xa;if(_0x186c86===_0x41ec9b)break;else _0x3f8a3c['push'](_0x3f8a3c['shift']());}catch(_0x509b83){_0x3f8a3c['push'](_0x3f8a3c['shift']());}}}(a57_0x14cd,0x1ea51));import{jsx as a57_0x1006e4,jsxs as a57_0x48c961,Fragment as a57_0x15dedf}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';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':'Cursor','description':a57_0x2c9d14(0x1d8),'folders':[a57_0x2c9d14(0x1a3),a57_0x2c9d14(0x1c7)]},'windsurf':{'name':a57_0x2c9d14(0x19e),'description':a57_0x2c9d14(0x19b),'folders':['.windsurf']},'claude':{'name':a57_0x2c9d14(0x1a7),'description':a57_0x2c9d14(0x1df),'folders':['.claude']},'codex':{'name':a57_0x2c9d14(0x1ce),'description':'Codex\x20IDE\x20(.codex/skills/)','folders':['.codex']},'opencode':{'name':'OpenCode','description':a57_0x2c9d14(0x1da),'folders':['.opencode']},'qoder':{'name':'Qoder','description':a57_0x2c9d14(0x1be),'folders':[a57_0x2c9d14(0x1b0)]},'codebuddy':{'name':a57_0x2c9d14(0x1d5),'description':a57_0x2c9d14(0x19f),'folders':[a57_0x2c9d14(0x1bb)]},'trae':{'name':'Trae','description':a57_0x2c9d14(0x1bc),'folders':[a57_0x2c9d14(0x1a6)]},'agent':{'name':a57_0x2c9d14(0x1a1),'description':a57_0x2c9d14(0x1bd),'folders':[a57_0x2c9d14(0x19d)]},'antigravity':{'name':'Antigravity','description':a57_0x2c9d14(0x1ca),'folders':[a57_0x2c9d14(0x19d)]}},IDE_LIST=[a57_0x2c9d14(0x1e1),a57_0x2c9d14(0x1b2),'codebuddy',a57_0x2c9d14(0x191),'cursor',a57_0x2c9d14(0x1ae),a57_0x2c9d14(0x198),a57_0x2c9d14(0x1d0),a57_0x2c9d14(0x1d3),a57_0x2c9d14(0x193)];export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0xb5176b=a57_0x2c9d14,{exit:_0x54cffa}=useApp(),[_0x3108b6,_0x3b211e]=useState(_0xb5176b(0x1de)),[_0x12e1ea,_0x27363e]=useState(new Set(preselectedIDEs[_0xb5176b(0x1b4)](_0x47cce6=>IDE_LIST['indexOf'](_0x47cce6))[_0xb5176b(0x1b6)](_0xac678a=>_0xac678a>=0x0))),[_0x51848b,_0x1c7e12]=useState(0x0),[_0x1b4d17,_0x1b86e2]=useState([]),[_0x27eed8,_0x613cda]=useState([]),[_0x3514fe,_0x1b5d00]=useState(0x0),[_0x49bb28,_0x24e37d]=useState('');useEffect(()=>{const _0x7dc20d=_0xb5176b;preselectedIDEs[_0x7dc20d(0x1b1)]>0x0&&_0x12e1ea['size']>0x0&&_0x2fa4be();},[]),useInput((_0x5d2650,_0x29c3c0)=>{const _0x5e5c8e=_0xb5176b;if(_0x3108b6===_0x5e5c8e(0x1de)){if(_0x29c3c0[_0x5e5c8e(0x194)]){_0x1c7e12(_0x241146=>_0x241146>0x0?_0x241146-0x1:IDE_LIST[_0x5e5c8e(0x1b1)]-0x1);return;}if(_0x29c3c0['downArrow']){_0x1c7e12(_0x4c4bfb=>_0x4c4bfb<IDE_LIST['length']-0x1?_0x4c4bfb+0x1:0x0);return;}if(_0x5d2650==='\x20'){_0x27363e(_0x205507=>{const _0x1f7e34=_0x5e5c8e,_0x29c865=new Set(_0x205507);return _0x29c865[_0x1f7e34(0x1b8)](_0x51848b)?_0x29c865[_0x1f7e34(0x1dc)](_0x51848b):_0x29c865[_0x1f7e34(0x1cd)](_0x51848b),_0x29c865;});return;}if(_0x5d2650==='a'||_0x5d2650==='A'){const _0x55701c=new Set(IDE_LIST[_0x5e5c8e(0x1b4)]((_0xd40a52,_0x260629)=>_0x260629));_0x27363e(_0x55701c);return;}if(_0x5d2650==='i'||_0x5d2650==='I'||_0x5d2650==='r'||_0x5d2650==='R'){_0x27363e(_0x4c49d3=>{const _0x5f14db=_0x5e5c8e,_0x1f390e=new Set();for(let _0x5280a9=0x0;_0x5280a9<IDE_LIST[_0x5f14db(0x1b1)];_0x5280a9++){!_0x4c49d3[_0x5f14db(0x1b8)](_0x5280a9)&&_0x1f390e[_0x5f14db(0x1cd)](_0x5280a9);}return _0x1f390e;});return;}if(_0x5d2650==='q'||_0x5d2650==='Q'){_0x54cffa();return;}if(_0x29c3c0[_0x5e5c8e(0x1b7)]){if(_0x12e1ea[_0x5e5c8e(0x1a0)]===0x0){_0x24e37d(_0x5e5c8e(0x1d9));return;}_0x2fa4be();return;}}if(_0x3108b6===_0x5e5c8e(0x196)){_0x54cffa();return;}});async function _0x2fa4be(){const _0x1322c0=_0xb5176b,_0x1faab9=Array[_0x1322c0(0x1c3)](_0x12e1ea)[_0x1322c0(0x1b4)](_0x260cdf=>IDE_LIST[_0x260cdf])[_0x1322c0(0x1b6)](_0x33d2ba=>_0x33d2ba!==undefined);_0x613cda(_0x1faab9),_0x1b86e2([{'label':'已选择\x20IDE','value':_0x12e1ea[_0x1322c0(0x1a0)]+'\x20个'}]),_0x3b211e(_0x1322c0(0x1c8)),await _0x1aa159(_0x1faab9);}async function _0x1aa159(_0x319c0c){const _0x39b9f5=_0xb5176b,_0x3d7097=process[_0x39b9f5(0x1e0)](),_0x1ae83a=resolve(__dirname,_0x39b9f5(0x1a2));logger['setLogPath'](_0x3d7097);const _0x5009a2=join(_0x1ae83a,'.shared'),_0x6b1bb2=join(_0x3d7097,'.lovrabet/skill/.shared');existsSync(_0x5009a2)&&await copyDir(_0x5009a2,_0x6b1bb2);let _0x17b524=0x1;for(const _0x342240 of _0x319c0c){try{const _0x36e504=await installSingleIDE(_0x342240,_0x3d7097,_0x1ae83a);_0x17b524+=_0x36e504,_0x1b5d00(_0x17b524);}catch(_0xc8a19e){console['error'](_0x39b9f5(0x19a)+_0x342240+_0x39b9f5(0x1bf)+(_0xc8a19e instanceof Error?_0xc8a19e[_0x39b9f5(0x1b9)]:String(_0xc8a19e)));}}const _0xa3e72f={'version':_0x39b9f5(0x1aa),'installedAt':new Date()[_0x39b9f5(0x1b3)](),'platforms':_0x319c0c},_0x257a53=join(_0x3d7097,_0x39b9f5(0x1ba));!existsSync(join(_0x3d7097,'.lovrabet'))&&mkdirSync(join(_0x3d7097,_0x39b9f5(0x192)),{'recursive':!![]}),writeFileSync(_0x257a53,JSON[_0x39b9f5(0x195)](_0xa3e72f,null,0x2),_0x39b9f5(0x1b5)),logger['info'](_0x39b9f5(0x1af),_0x39b9f5(0x1c0),{'projectRoot':_0x3d7097,'ides':_0x319c0c,'foldersCount':_0x17b524}),_0x3b211e(_0x39b9f5(0x196)),setTimeout(()=>{_0x54cffa();},0x3e8);}return a57_0x48c961(Box,{'flexDirection':_0xb5176b(0x1e5),'marginTop':0x1,'children':[_0x3108b6===_0xb5176b(0x1de)&&a57_0x48c961(a57_0x15dedf,{'children':[a57_0x1006e4(Box,{'children':a57_0x1006e4(Text,{'color':_0xb5176b(0x1cc),'children':_0xb5176b(0x1a8)})}),_0x49bb28&&a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x48c961(Text,{'color':_0xb5176b(0x1e3),'children':['✗\x20',_0x49bb28]})}),a57_0x48c961(Box,{'marginTop':0x1,'flexDirection':_0xb5176b(0x1e5),'children':[a57_0x1006e4(Text,{'bold':!![],'children':_0xb5176b(0x1a9)}),IDE_LIST[_0xb5176b(0x1b4)]((_0x5b511f,_0xf71ae9)=>{const _0x36929d=_0xb5176b,_0x4009da=_0x51848b===_0xf71ae9,_0x13baef=_0x12e1ea[_0x36929d(0x1b8)](_0xf71ae9);return a57_0x1006e4(Box,{'children':a57_0x48c961(Text,{'backgroundColor':_0x4009da?_0x36929d(0x1d1):undefined,'color':_0x4009da?_0x36929d(0x1ac):undefined,'children':['\x20\x20',_0x13baef?'[✓]':_0x36929d(0x1e2),'\x20',IDE_CONFIGS[_0x5b511f]['name'],'\x20',a57_0x48c961(Text,{'color':_0x4009da?'white':_0x36929d(0x1c4),'dimColor':!_0x4009da,'children':['-\x20',IDE_CONFIGS[_0x5b511f][_0x36929d(0x1cf)]]})]})},_0x5b511f);}),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x48c961(Text,{'color':_0xb5176b(0x1c4),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认']})})]})]}),_0x3108b6==='installing'&&a57_0x48c961(a57_0x15dedf,{'children':[_0x1b4d17[_0xb5176b(0x1b4)]((_0x3d3221,_0x5c57d7)=>a57_0x48c961(Box,{'children':[a57_0x48c961(Text,{'color':_0xb5176b(0x199),'children':['√\x20',_0x3d3221[_0xb5176b(0x1ad)],':\x20']}),a57_0x1006e4(Text,{'color':'cyan','children':_0x3d3221[_0xb5176b(0x1c5)]})]},_0x5c57d7)),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x1006e4(Text,{'children':_0xb5176b(0x1d6)})}),_0x27eed8[_0xb5176b(0x1b4)](_0x59018a=>a57_0x48c961(Box,{'children':[a57_0x1006e4(Text,{'color':_0xb5176b(0x199),'children':_0xb5176b(0x1c9)}),a57_0x1006e4(Text,{'children':IDE_CONFIGS[_0x59018a]?.['name']||_0x59018a})]},_0x59018a)),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x48c961(Text,{'color':_0xb5176b(0x1c4),'children':[_0xb5176b(0x1c1),_0x3514fe,'\x20个目录']})})]}),_0x3108b6===_0xb5176b(0x196)&&a57_0x48c961(a57_0x15dedf,{'children':[a57_0x1006e4(Box,{'children':a57_0x48c961(Text,{'color':_0xb5176b(0x199),'children':[_0xb5176b(0x1d7),_0x3514fe,'\x20个目录']})}),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x1006e4(Text,{'color':_0xb5176b(0x1c4),'children':_0xb5176b(0x1a4)})}),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x1006e4(Text,{'color':_0xb5176b(0x1c4),'children':_0xb5176b(0x1c2)})})]})]});}function a57_0x14cd(){const _0x5eee0a=['Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','\x20失败:\x20','安装成功','已安装\x20','按任意键退出...','from','gray','value','283302vTqZkc','.cursor','installing','\x20\x20✓\x20','Antigravity\x20IDE\x20(.agent/skills/)','folders','cyan','add','Codex','description','trae','blue','576395PGBYcy','windsurf','53mEgwvq','CodeBuddy','正在安装技能包...','✓\x20技能包安装成功!共安装\x20','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','请至少选择一个\x20IDE','OpenCode\x20IDE\x20(.opencode/skills/)','2678wBOeMB','delete','3047690FwheMC','selecting','Claude\x20Code\x20(.claude/skills/)','cwd','antigravity','[\x20]','red','391938IFqgen','column','codex','.lovrabet','agent','upArrow','stringify','done','4RDRNUg','qoder','green','\x20\x20✗\x20安装\x20','Windsurf\x20IDE\x20(.windsurf/workflows/)','9uAbltJ','.agent','Windsurf','CodeBuddy\x20IDE\x20(.codebuddy/skills/)','size','其他\x20(通用模板)','../../templates/skills','.cursorrules','开发者指南位置:\x20.lovrabet/skill/.shared/guides/','878792GcyICA','.trae','Claude\x20Code','*\x20安装\x20Lovrabet\x20技能包\x20-\x20选择\x20IDE','*\x20请选择要安装的\x20IDE:','2.0.0','1088822bRQXPF','white','label','opencode','skill-install','.qoder','length','claude','toISOString','map','utf-8','filter','return','has','message','.lovrabet/skill-manifest.json','.codebuddy','Trae\x20IDE\x20(.trae/skills/)','通用模板\x20(.agent/skills/)\x20-\x20兜底方案'];a57_0x14cd=function(){return _0x5eee0a;};return a57_0x14cd();}function a57_0x2f3b(_0x12830e,_0xc18938){_0x12830e=_0x12830e-0x191;const _0x14cdc1=a57_0x14cd();let _0x2f3bb8=_0x14cdc1[_0x12830e];return _0x2f3bb8;}async function copyDir(_0x391205,_0x530ee9){const _0x26848c=statSync(_0x391205);if(_0x26848c['isDirectory']()){!existsSync(_0x530ee9)&&mkdirSync(_0x530ee9,{'recursive':!![]});const _0x291a1b=readdirSync(_0x391205);for(const _0x28b647 of _0x291a1b){await copyDir(join(_0x391205,_0x28b647),join(_0x530ee9,_0x28b647));}}else copyFileSync(_0x391205,_0x530ee9);}async function installSingleIDE(_0xbcc5ff,_0xfbd06c,_0x350ccd){const _0x476140=a57_0x2c9d14,_0x19b60c=_0xbcc5ff!==_0x476140(0x193)&&IDE_CONFIGS[_0xbcc5ff]!==undefined,_0x551126=_0xbcc5ff==='agent'||!_0x19b60c,_0xe52e73=_0x551126?[_0x476140(0x19d)]:_0x19b60c?IDE_CONFIGS[_0xbcc5ff][_0x476140(0x1cb)]:[_0x476140(0x19d)];let _0x49603c=0x0;for(const _0xfb81cb of _0xe52e73){const _0x1ed58e=join(_0x350ccd,_0xfb81cb),_0x5e3c09=join(_0xfbd06c,_0xfb81cb);if(!existsSync(_0x1ed58e))continue;await copyDir(_0x1ed58e,_0x5e3c09),_0x49603c++;}return _0x49603c;}
@@ -1 +1 @@
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
+ const a58_0x140986=a58_0x5d23;(function(_0x2eeee1,_0x2d1693){const _0xb341a8=a58_0x5d23,_0x4d89fd=_0x2eeee1();while(!![]){try{const _0xaaec07=parseInt(_0xb341a8(0x1de))/0x1*(parseInt(_0xb341a8(0x1fc))/0x2)+-parseInt(_0xb341a8(0x208))/0x3+parseInt(_0xb341a8(0x1ec))/0x4+-parseInt(_0xb341a8(0x1ed))/0x5*(-parseInt(_0xb341a8(0x1b4))/0x6)+-parseInt(_0xb341a8(0x1f5))/0x7*(-parseInt(_0xb341a8(0x1ea))/0x8)+-parseInt(_0xb341a8(0x205))/0x9+-parseInt(_0xb341a8(0x1b9))/0xa;if(_0xaaec07===_0x2d1693)break;else _0x4d89fd['push'](_0x4d89fd['shift']());}catch(_0xbdaecd){_0x4d89fd['push'](_0x4d89fd['shift']());}}}(a58_0x3ffe,0xedc75));import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';function a58_0x3ffe(){const _0x1bc5d0=['\x20\x20✗\x20安装\x20','1435113iHBvrz','help','.cursorrules','不支持的命令:\x20','...\x0a','Windsurf\x20IDE\x20(.windsurf/workflows/)','\x0a已取消安装\x0a','.qoder','qoder','⚠️\x20\x20未知的平台:\x20','\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','.windsurf','24TZXNMJ','split','5748780DurLra','3935620fBNNfQ','claude\x20code\x20(.claude/skills/)','使用示例:','.lovrabet/skill/.shared/','includes','log','codebuddy','\x20个目录\x0a','2799503xATYNq','2.0.0','claude\x20code','请选择:\x20','all','toISOString','.lovrabet','2DctijY','输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)','.lovrabet/skill-manifest.json','OpenCode','Cursor','agent','info','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','\x20-\x20','12149118TyfDrx','stdin','Windsurf','5071956ZrugKJ','.cursor','安装成功','trim','Codex\x20IDE\x20(.codex/skills/)','folders','\x0a错误:\x20安装失败\x20-\x20','OpenCode\x20IDE\x20(.opencode/skills/)','windsurf','CodeBuddy','输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a','cursor','(空)','.agent','Qoder','error','setLogPath','cwd','.trae','stdout','--help','\x0a未选择任何\x20IDE,安装取消\x0a','通用模板','Trae\x20IDE\x20(.trae/skills/)','6tCrlJW','name','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a','\x0a✓\x20技能包安装成功!共安装\x20','Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','8447240NWbnEJ','skill-install','exit','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包','opencode','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包','模板不存在:\x20','claude','.lovrabet/skill/.shared','codex','isDirectory','trae','toLowerCase','length','question','\x20\x20q.\x20取消\x0a','✓\x20复制\x20.lovrabet/skill/.shared/','forEach','stringify','\x0a📦\x20正在安装\x20','push',',使用通用模板','错误:\x20不支持的命令:\x20','filter','\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a','\x20\x20✓\x20复制\x20','\x20失败:\x20','message','安装失败','✓\x20创建\x20.lovrabet/skill-manifest.json','.claude','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','.opencode','description','.shared','开发者指南位置:'];a58_0x3ffe=function(){return _0x1bc5d0;};return a58_0x3ffe();}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_0x140986(0x200),'description':a58_0x140986(0x203),'folders':[a58_0x140986(0x1e0),a58_0x140986(0x209)]},'windsurf':{'name':a58_0x140986(0x207),'description':a58_0x140986(0x1e3),'folders':[a58_0x140986(0x1e9)]},'claude':{'name':a58_0x140986(0x1f7),'description':a58_0x140986(0x1ee),'folders':[a58_0x140986(0x1d7)]},'codex':{'name':'Codex','description':a58_0x140986(0x20c),'folders':['.codex']},'opencode':{'name':a58_0x140986(0x1ff),'description':a58_0x140986(0x20f),'folders':[a58_0x140986(0x1d9)]},'qoder':{'name':a58_0x140986(0x216),'description':a58_0x140986(0x1b8),'folders':[a58_0x140986(0x1e5)]},'codebuddy':{'name':a58_0x140986(0x211),'description':'CodeBuddy\x20IDE\x20(.codebuddy/skills/)','folders':['.codebuddy']},'trae':{'name':'Trae','description':a58_0x140986(0x21f),'folders':[a58_0x140986(0x21a)]}};export async function skillsCommand(_0x594c1d,_0x31a868,_0x211ca7){const _0xa208b0=a58_0x140986;logger[_0xa208b0(0x218)](process[_0xa208b0(0x219)]());if(_0x211ca7?.[_0xa208b0(0x1df)]||_0x594c1d===_0xa208b0(0x21c)){showHelp();return;}_0x594c1d!=='install'&&(console['error'](_0xa208b0(0x1cf)+(_0x594c1d||_0xa208b0(0x214))),console[_0xa208b0(0x1f2)]('\x0a可用命令:'),console[_0xa208b0(0x1f2)](_0xa208b0(0x1be)),console[_0xa208b0(0x1f2)](_0xa208b0(0x1bc)),console[_0xa208b0(0x1f2)](_0xa208b0(0x1e8)),console[_0xa208b0(0x1f2)](_0xa208b0(0x1ef)),console[_0xa208b0(0x1f2)]('\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE'),console[_0xa208b0(0x1f2)](_0xa208b0(0x1b6)),logger['error']('skill',_0xa208b0(0x1e1)+_0x594c1d),process[_0xa208b0(0x1bb)](0x1)),await installSkill(_0x31a868?.[0x0]);}async function selectIDEs(){const _0x3139c0=a58_0x140986,_0x4f4f01=[_0x3139c0(0x213),_0x3139c0(0x210),'claude',_0x3139c0(0x1c2),_0x3139c0(0x1bd),_0x3139c0(0x1e6),_0x3139c0(0x1f3),_0x3139c0(0x1c4)];return console[_0x3139c0(0x1f2)](_0x3139c0(0x1d1)),_0x4f4f01[_0x3139c0(0x1ca)]((_0x138c8b,_0x5c7d02)=>{const _0x28e58f=_0x3139c0;console[_0x28e58f(0x1f2)]('\x20\x20'+(_0x5c7d02+0x1)+'.\x20'+IDE_CONFIGS[_0x138c8b][_0x28e58f(0x1b5)]+_0x28e58f(0x204)+IDE_CONFIGS[_0x138c8b][_0x28e58f(0x1da)]);}),console[_0x3139c0(0x1f2)]('\x20\x200.\x20全部安装'),console[_0x3139c0(0x1f2)](_0x3139c0(0x1c8)),console[_0x3139c0(0x1f2)](_0x3139c0(0x1fd)),console[_0x3139c0(0x1f2)](_0x3139c0(0x212)),new Promise(_0x189920=>{const _0x3e5868=_0x3139c0,_0x2232ea=createInterface({'input':process[_0x3e5868(0x206)],'output':process[_0x3e5868(0x21b)]});_0x2232ea[_0x3e5868(0x1c7)](_0x3e5868(0x1f8),_0x29fb4d=>{const _0x8d9ab0=_0x3e5868;_0x2232ea['close']();const _0x5ae550=_0x29fb4d[_0x8d9ab0(0x20b)]()[_0x8d9ab0(0x1c5)]();(_0x5ae550==='q'||_0x5ae550==='quit'||_0x5ae550==='exit')&&(console[_0x8d9ab0(0x1f2)](_0x8d9ab0(0x1e4)),process[_0x8d9ab0(0x1bb)](0x0));if(_0x5ae550==='0'||_0x5ae550==='all'){_0x189920(['all']);return;}const _0x40af6f=_0x5ae550[_0x8d9ab0(0x1eb)](/\s+/)[_0x8d9ab0(0x1d0)](Boolean),_0xc64537=[];for(const _0x478821 of _0x40af6f){const _0x4b7a45=parseInt(_0x478821,0xa);if(!isNaN(_0x4b7a45)&&_0x4b7a45>=0x1&&_0x4b7a45<=_0x4f4f01[_0x8d9ab0(0x1c6)]){const _0x374094=_0x4f4f01[_0x4b7a45-0x1];_0x374094&&!_0xc64537[_0x8d9ab0(0x1f1)](_0x374094)&&_0xc64537[_0x8d9ab0(0x1cd)](_0x374094);}}_0xc64537[_0x8d9ab0(0x1c6)]===0x0&&(console[_0x8d9ab0(0x1f2)](_0x8d9ab0(0x21d)),process[_0x8d9ab0(0x1bb)](0x0)),_0x189920(_0xc64537);});});}function showHelp(){const _0x1748c4=a58_0x140986;console[_0x1748c4(0x1f2)]('\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');}function a58_0x5d23(_0x28e35c,_0x1acffa){_0x28e35c=_0x28e35c-0x1b4;const _0x3ffe15=a58_0x3ffe();let _0x5d2371=_0x3ffe15[_0x28e35c];return _0x5d2371;}async function copyDir(_0x2d149e,_0x54feef){const _0x513be5=a58_0x140986,_0x356d26=statSync(_0x2d149e);if(_0x356d26[_0x513be5(0x1c3)]()){!existsSync(_0x54feef)&&mkdirSync(_0x54feef,{'recursive':!![]});const _0x74ed41=readdirSync(_0x2d149e);for(const _0x3ea542 of _0x74ed41){await copyDir(join(_0x2d149e,_0x3ea542),join(_0x54feef,_0x3ea542));}}else copyFileSync(_0x2d149e,_0x54feef);}async function installSingleIDE(_0x32366b,_0x227d3c,_0xff5ef4){const _0x2c5b46=a58_0x140986,_0x14f030=_0x32366b!==_0x2c5b46(0x201)&&IDE_CONFIGS[_0x32366b]!==undefined,_0x9e741=_0x32366b===_0x2c5b46(0x201)||!_0x14f030,_0x50b53c=_0x9e741?_0x2c5b46(0x21e):_0x14f030?IDE_CONFIGS[_0x32366b]['name']:_0x32366b;console['log'](_0x2c5b46(0x1cc)+_0x50b53c+_0x2c5b46(0x1e2));let _0x21fb23=0x0;const _0x1d85c3=_0x9e741?['.agent']:_0x14f030?IDE_CONFIGS[_0x32366b][_0x2c5b46(0x20d)]:[_0x2c5b46(0x215)];for(const _0x5df295 of _0x1d85c3){const _0x1b46f9=join(_0xff5ef4,_0x5df295),_0x5b5a40=join(_0x227d3c,_0x5df295);if(!existsSync(_0x1b46f9)){logger['warn'](_0x2c5b46(0x1ba),_0x2c5b46(0x1bf)+_0x1b46f9);continue;}await copyDir(_0x1b46f9,_0x5b5a40),_0x21fb23++,console[_0x2c5b46(0x1f2)](_0x2c5b46(0x1d2)+_0x5df295+'/');}return _0x21fb23;}async function installSkill(_0x63c703){const _0x5b872f=a58_0x140986,_0x38f117=process[_0x5b872f(0x219)](),_0x1d3772=resolve(__dirname,'../../templates/skills');let _0x2a38a2=[];!_0x63c703?_0x2a38a2=await selectIDEs():_0x2a38a2=[_0x63c703];_0x2a38a2[_0x5b872f(0x1f1)](_0x5b872f(0x1f9))&&(_0x2a38a2=['cursor',_0x5b872f(0x210),_0x5b872f(0x1c0),'codex',_0x5b872f(0x1bd),_0x5b872f(0x1e6),_0x5b872f(0x1f3),_0x5b872f(0x1c4),_0x5b872f(0x201)]);const _0x16e3e9=[];for(const _0x1e7a52 of _0x2a38a2){if(_0x1e7a52===_0x5b872f(0x201))_0x16e3e9[_0x5b872f(0x1cd)](_0x5b872f(0x201));else{if(_0x1e7a52===_0x5b872f(0x1f9))continue;else IDE_CONFIGS[_0x1e7a52]?_0x16e3e9[_0x5b872f(0x1cd)](_0x1e7a52):(console[_0x5b872f(0x1f2)](_0x5b872f(0x1e7)+_0x1e7a52+_0x5b872f(0x1ce)),_0x16e3e9[_0x5b872f(0x1cd)](_0x5b872f(0x201)));}}_0x16e3e9[_0x5b872f(0x1c6)]===0x0&&(console[_0x5b872f(0x1f2)]('\x0a没有有效的\x20IDE\x20需要安装\x0a'),process[_0x5b872f(0x1bb)](0x0));const _0x20068e=join(_0x1d3772,'.shared'),_0x2659d5=join(_0x38f117,_0x5b872f(0x1c1));existsSync(_0x20068e)&&(await copyDir(_0x20068e,_0x2659d5),console['log'](_0x5b872f(0x1c9)));let _0x39f1f9=0x0;for(const _0x2bd667 of _0x16e3e9){try{const _0x568064=await installSingleIDE(_0x2bd667,_0x38f117,_0x1d3772);_0x39f1f9+=_0x568064;}catch(_0x4ed813){console[_0x5b872f(0x217)](_0x5b872f(0x1dd)+_0x2bd667+_0x5b872f(0x1d3)+(_0x4ed813 instanceof Error?_0x4ed813[_0x5b872f(0x1d4)]:String(_0x4ed813)));}}const _0x106492={'version':_0x5b872f(0x1f6),'installedAt':new Date()[_0x5b872f(0x1fa)](),'platforms':_0x16e3e9};try{const _0x3369ff=join(_0x1d3772,_0x5b872f(0x1db)),_0xb772ba=join(_0x38f117,_0x5b872f(0x1f0));existsSync(_0x3369ff)&&(await copyDir(_0x3369ff,_0xb772ba),console['log'](_0x5b872f(0x1c9)));let _0x3b075e=0x0;for(const _0x1e5f33 of _0x16e3e9){try{const _0x3fea09=await installSingleIDE(_0x1e5f33,_0x38f117,_0x1d3772);_0x3b075e+=_0x3fea09;}catch(_0x2ebb83){console[_0x5b872f(0x217)](_0x5b872f(0x1dd)+_0x1e5f33+_0x5b872f(0x1d3)+(_0x2ebb83 instanceof Error?_0x2ebb83[_0x5b872f(0x1d4)]:String(_0x2ebb83)));}}const _0x33a37c={'version':_0x5b872f(0x1f6),'installedAt':new Date()[_0x5b872f(0x1fa)](),'platforms':_0x16e3e9},_0x33371c=join(_0x38f117,_0x5b872f(0x1fe));!existsSync(join(_0x38f117,_0x5b872f(0x1fb)))&&mkdirSync(join(_0x38f117,_0x5b872f(0x1fb)),{'recursive':!![]}),writeFileSync(_0x33371c,JSON[_0x5b872f(0x1cb)](_0x33a37c,null,0x2),'utf-8'),console[_0x5b872f(0x1f2)](_0x5b872f(0x1d6)),console[_0x5b872f(0x1f2)](_0x5b872f(0x1b7)+_0x3b075e+_0x5b872f(0x1f4)),console[_0x5b872f(0x1f2)](_0x5b872f(0x1dc)),console[_0x5b872f(0x1f2)](_0x5b872f(0x1d8)),logger[_0x5b872f(0x202)]('skill-install',_0x5b872f(0x20a),{'projectRoot':_0x38f117,'ides':_0x16e3e9,'foldersCount':_0x3b075e});}catch(_0x439a1e){logger[_0x5b872f(0x217)](_0x5b872f(0x1ba),_0x5b872f(0x1d5),{'error':_0x439a1e instanceof Error?_0x439a1e[_0x5b872f(0x1d4)]:String(_0x439a1e)}),console[_0x5b872f(0x217)](_0x5b872f(0x20e)+(_0x439a1e instanceof Error?_0x439a1e[_0x5b872f(0x1d4)]:String(_0x439a1e))+'\x0a'),process[_0x5b872f(0x1bb)](0x1);}}