@lovrabet/cli 1.3.3 → 1.3.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-execa.js +1 -0
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -1
- package/lib/i18n/hooks.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/i18n/locales/en-US.js +1 -1
- package/lib/i18n/locales/zh-CN.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +4 -1
- package/templates/README.md +10 -55
- package/lib/add-page/input-page-router.js +0 -1
- package/lib/add-page/main.js +0 -1
- package/lib/add-page/select-page-template.js +0 -1
- package/lib/utils/router-updater.js +0 -1
- package/templates/pages/blank/index.tsx.tpl +0 -13
- package/templates/pages/sdk-fetch/index.tsx.tpl +0 -80
package/lib/mcp/McpInstallUI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4cd04d,_0x26c745){const _0x41ca81=a58_0xe1c4,_0x41920d=_0x4cd04d();while(!![]){try{const _0x2921b2=-parseInt(_0x41ca81(0xd6))/0x1*(parseInt(_0x41ca81(0xc9))/0x2)+-parseInt(_0x41ca81(0xb1))/0x3+parseInt(_0x41ca81(0xe0))/0x4*(-parseInt(_0x41ca81(0xdc))/0x5)+-parseInt(_0x41ca81(0xb4))/0x6+parseInt(_0x41ca81(0xc0))/0x7*(parseInt(_0x41ca81(0xe6))/0x8)+parseInt(_0x41ca81(0xd1))/0x9+parseInt(_0x41ca81(0xb8))/0xa;if(_0x2921b2===_0x26c745)break;else _0x41920d['push'](_0x41920d['shift']());}catch(_0x224729){_0x41920d['push'](_0x41920d['shift']());}}}(a58_0x300f,0x6323e));import{jsx as a58_0x1ed9e2,jsxs as a58_0x1ee3d0,Fragment as a58_0x4c337f}from'react/jsx-runtime';import{useState,useEffect,useMemo}from'react';import{Text,Box,useInput,useApp}from'ink';import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';import{IDESelector,useIDESelection}from'../ui/IDESelector.js';import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';import{useI18n}from'../i18n/hooks.js';import a58_0x3d3e37 from'../i18n/index.js';function a58_0x300f(){const _0x408026=['mcp.ui.otherIDEDescription','20lNgkrm','gray','ide','success','470836jXgdzW','size','error','needsManualAction','cwd','message','16kYwEMG','done','mcp.ui.selectAtLeastOne','1573641GYjMeD','description','\x20\x20✓','328176hHDqGH','\x20\x20⚠️','push','other','12318100SjAKfG','getSelectedIDEs','from','name','cursor','some','claude','value','1883805AeZSsj','status','mcp.ui.unsupportedIDE','\x20\x20✗','return','yellow','white','map','selectedIndexes','18ElpxcY','mcp.ui.title','column','find','selecting','mcp.ui.configuring','red','manual','2416482juRZrC','mcp.ui.count','mcp.ui.pressAnyKeyToExit','mcp.ui.selectedIDE','green','64709JyfpbY','mcp.ui.completed','configuring','key','mcp.ui.partialManual'];a58_0x300f=function(){return _0x408026;};return a58_0x300f();}export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x2bfaed=a58_0xe1c4,{t:_0x3c75b4}=useI18n(),{exit:_0x5e9521}=useApp(),[_0x5ef8f1,_0x365273]=useState(_0x2bfaed(0xcd)),[_0x58aee6,_0x15a751]=useState([]),[_0x322524,_0x58d0e1]=useState([]),_0x43b2d8=useMemo(()=>[...Array[_0x2bfaed(0xba)](MCP_IDES)['map'](_0xbfe41=>({'key':_0xbfe41,'name':IDE_CONFIGS[_0xbfe41][_0x2bfaed(0xbb)],'description':IDE_CONFIGS[_0xbfe41][_0x2bfaed(0xb2)]})),{'key':_0x2bfaed(0xb7),'name':_0x3c75b4('mcp.ui.otherIDE'),'description':_0x3c75b4(_0x2bfaed(0xdb))}],[_0x3c75b4]),_0x348c94=useIDESelection({'ideList':_0x43b2d8,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x15d219=_0x2bfaed;preselectedIDEs['length']>0x0&&_0x348c94[_0x15d219(0xc8)][_0x15d219(0xe1)]>0x0&&_0x30e20c();},[]),useInput((_0x596d88,_0x16c820)=>{const _0x5ab432=_0x2bfaed;if(_0x5ef8f1===_0x5ab432(0xcd)){if(_0x596d88==='q'||_0x596d88==='Q'){_0x5e9521();return;}if(_0x16c820[_0x5ab432(0xc4)]){if(_0x348c94[_0x5ab432(0xc8)][_0x5ab432(0xe1)]===0x0){_0x348c94['setErrorMsg'](_0x3c75b4(_0x5ab432(0xb0)));return;}_0x30e20c();return;}_0x348c94['handleKeyDown'](_0x596d88,_0x16c820);}_0x5ef8f1===_0x5ab432(0xe7)&&_0x5e9521();});async function _0x30e20c(){const _0x1c33db=_0x2bfaed,_0x21df5d=_0x348c94[_0x1c33db(0xb9)]();_0x15a751([{'label':_0x3c75b4(_0x1c33db(0xd4)),'value':_0x3c75b4(_0x1c33db(0xd2),{'count':_0x348c94[_0x1c33db(0xc8)][_0x1c33db(0xe1)]})}]),_0x365273('configuring');const _0x40c54d=[];for(const _0x42c821 of _0x21df5d){try{const _0x2f2681=await configureMcp(_0x42c821);_0x40c54d[_0x1c33db(0xb6)]({'ide':_0x43b2d8[_0x1c33db(0xcc)](_0x4eeaf5=>_0x4eeaf5['key']===_0x42c821)?.[_0x1c33db(0xbb)]||_0x42c821,'status':_0x2f2681[_0x1c33db(0xe3)]?'manual':_0x2f2681[_0x1c33db(0xdf)]?_0x1c33db(0xdf):_0x1c33db(0xe2),'message':_0x2f2681[_0x1c33db(0xe5)]});}catch(_0x1a0a00){_0x40c54d['push']({'ide':_0x43b2d8[_0x1c33db(0xcc)](_0xcfffac=>_0xcfffac[_0x1c33db(0xd9)]===_0x42c821)?.['name']||_0x42c821,'status':'error','message':_0x1a0a00 instanceof Error?_0x1a0a00[_0x1c33db(0xe5)]:String(_0x1a0a00)});}}_0x58d0e1(_0x40c54d),_0x365273(_0x1c33db(0xe7)),setTimeout(()=>{_0x5e9521();},0x1388);}return a58_0x1ee3d0(Box,{'flexDirection':_0x2bfaed(0xcb),'marginTop':0x1,'children':[_0x5ef8f1==='selecting'&&a58_0x1ed9e2(IDESelector,{'ideList':_0x43b2d8,'title':_0x3c75b4(_0x2bfaed(0xca)),'selection':_0x348c94}),_0x5ef8f1===_0x2bfaed(0xd8)&&a58_0x1ee3d0(a58_0x4c337f,{'children':[_0x58aee6[_0x2bfaed(0xc7)]((_0x54fdb2,_0x29befc)=>a58_0x1ee3d0(Box,{'children':[a58_0x1ee3d0(Text,{'color':_0x2bfaed(0xd5),'children':['√\x20',_0x54fdb2['label'],':\x20']}),a58_0x1ed9e2(Text,{'color':'cyan','children':_0x54fdb2[_0x2bfaed(0xbf)]})]},_0x29befc)),a58_0x1ed9e2(Box,{'marginTop':0x1,'children':a58_0x1ed9e2(Text,{'children':_0x3c75b4(_0x2bfaed(0xce))})})]}),_0x5ef8f1===_0x2bfaed(0xe7)&&a58_0x1ed9e2(DoneStep,{'configResults':_0x322524})]});}function DoneStep({configResults:_0x45bdc1}){const _0x41e61e=a58_0xe1c4,{t:_0x596baf}=useI18n(),_0x2e31b4=_0x45bdc1['every'](_0xc475ed=>_0xc475ed['status']===_0x41e61e(0xdf)),_0x32849f=_0x45bdc1[_0x41e61e(0xbd)](_0x422dee=>_0x422dee[_0x41e61e(0xc1)]==='manual'),_0x30d8b2=_0x45bdc1[_0x41e61e(0xbd)](_0x151e98=>_0x151e98[_0x41e61e(0xc1)]==='error');return a58_0x1ee3d0(a58_0x4c337f,{'children':[a58_0x1ed9e2(Box,{'children':_0x2e31b4?a58_0x1ed9e2(Text,{'color':_0x41e61e(0xd5),'children':_0x596baf(_0x41e61e(0xd7))}):_0x32849f?a58_0x1ed9e2(Text,{'color':'yellow','children':_0x596baf(_0x41e61e(0xda))}):_0x30d8b2?a58_0x1ed9e2(Text,{'color':'red','children':_0x596baf('mcp.ui.failed')}):a58_0x1ed9e2(Text,{'color':_0x41e61e(0xc5),'children':_0x596baf('mcp.ui.manualRequired')})}),_0x45bdc1['map']((_0x108a03,_0x28aa3f)=>a58_0x1ee3d0(Box,{'flexDirection':_0x41e61e(0xcb),'children':[a58_0x1ee3d0(Text,{'color':_0x108a03[_0x41e61e(0xc1)]==='success'?_0x41e61e(0xd5):_0x108a03[_0x41e61e(0xc1)]===_0x41e61e(0xd0)?_0x41e61e(0xc5):_0x41e61e(0xcf),'children':[_0x108a03[_0x41e61e(0xc1)]===_0x41e61e(0xdf)?_0x41e61e(0xb3):_0x108a03[_0x41e61e(0xc1)]===_0x41e61e(0xd0)?_0x41e61e(0xb5):_0x41e61e(0xc3),'\x20',_0x108a03[_0x41e61e(0xde)],':']}),a58_0x1ed9e2(Text,{'color':_0x108a03[_0x41e61e(0xc1)]===_0x41e61e(0xdf)?_0x41e61e(0xc6):_0x108a03[_0x41e61e(0xc1)]==='manual'?_0x41e61e(0xc5):'red','children':_0x108a03[_0x41e61e(0xe5)]})]},_0x28aa3f)),a58_0x1ed9e2(Box,{'marginTop':0x1,'children':a58_0x1ed9e2(Text,{'color':_0x41e61e(0xdd),'children':_0x596baf(_0x41e61e(0xd3))})})]});}function a58_0xe1c4(_0x3566e5,_0x5889ec){_0x3566e5=_0x3566e5-0xb0;const _0x300fa8=a58_0x300f();let _0xe1c46a=_0x300fa8[_0x3566e5];return _0xe1c46a;}async function configureMcp(_0x2d727a){const _0x2a34d5=a58_0xe1c4,_0x3b05b3=process[_0x2a34d5(0xe4)]();switch(_0x2d727a){case _0x2a34d5(0xbc):return configureCursorMcp(_0x3b05b3);case _0x2a34d5(0xbe):return configureClaudeMcp(_0x3b05b3);case _0x2a34d5(0xb7):return showOtherMcpGuide(_0x3b05b3);default:throw new Error(a58_0x3d3e37['t'](_0x2a34d5(0xc2),{'ide':_0x2d727a}));}}
|
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40adac,_0x3fb41b){const _0x426f9f=a59_0x2662,_0xe73772=_0x40adac();while(!![]){try{const _0x50a629=parseInt(_0x426f9f(0xd5))/0x1*(parseInt(_0x426f9f(0xc5))/0x2)+parseInt(_0x426f9f(0xd0))/0x3*(-parseInt(_0x426f9f(0xcf))/0x4)+-parseInt(_0x426f9f(0xca))/0x5+-parseInt(_0x426f9f(0xcd))/0x6*(-parseInt(_0x426f9f(0xcc))/0x7)+parseInt(_0x426f9f(0xd4))/0x8+-parseInt(_0x426f9f(0xc8))/0x9*(parseInt(_0x426f9f(0xd2))/0xa)+parseInt(_0x426f9f(0xc9))/0xb;if(_0x50a629===_0x3fb41b)break;else _0xe73772['push'](_0xe73772['shift']());}catch(_0x26abb8){_0xe73772['push'](_0xe73772['shift']());}}}(a59_0x2f7e,0x41a2b));function a59_0x2f7e(){const _0x8a401e=['log','260740lIaMGt','3vzXGPR','mcp.claudeConfig.error','10GKKMLr','message','887800TXkQge','2fJmwjb','36420gGofSS','exit','cwd','1065429XYScLX','3783043rInqZq','482410xWrdDG','success','4529vTiHnP','534rnfTVL'];a59_0x2f7e=function(){return _0x8a401e;};return a59_0x2f7e();}function a59_0x2662(_0x2ec207,_0x1cb8dc){_0x2ec207=_0x2ec207-0xc5;const _0x2f7e3b=a59_0x2f7e();let _0x2662ef=_0x2f7e3b[_0x2ec207];return _0x2662ef;}import{configureClaudeMcp as a59_0x3754ad}from'./mcp-installer.js';import a59_0x4183a6 from'../i18n/index.js';export async function configureClaudeMcp(){const _0x3c63f6=a59_0x2662,_0x27fc5c=process[_0x3c63f6(0xc7)](),_0x2ea1df=a59_0x3754ad(_0x27fc5c);_0x2ea1df[_0x3c63f6(0xcb)]?(console[_0x3c63f6(0xce)]('\x0a📋\x20'+_0x2ea1df[_0x3c63f6(0xd3)]+'\x0a'),process[_0x3c63f6(0xc6)](0x0)):(console['error'](a59_0x4183a6['t'](_0x3c63f6(0xd1),{'error':_0x2ea1df[_0x3c63f6(0xd3)]})),process[_0x3c63f6(0xc6)](0x1));}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x10dda3,_0x481f31){const _0x225ba4=a60_0x15c9,_0x4e8b53=_0x10dda3();while(!![]){try{const _0x50d458=parseInt(_0x225ba4(0x1e8))/0x1+parseInt(_0x225ba4(0x1e4))/0x2+-parseInt(_0x225ba4(0x1e0))/0x3*(parseInt(_0x225ba4(0x1ec))/0x4)+-parseInt(_0x225ba4(0x1de))/0x5*(-parseInt(_0x225ba4(0x1e3))/0x6)+-parseInt(_0x225ba4(0x1e5))/0x7+parseInt(_0x225ba4(0x1e7))/0x8+-parseInt(_0x225ba4(0x1e6))/0x9;if(_0x50d458===_0x481f31)break;else _0x4e8b53['push'](_0x4e8b53['shift']());}catch(_0xa8537){_0x4e8b53['push'](_0x4e8b53['shift']());}}}(a60_0x2304,0xaf6b0));import{configureCursorMcp as a60_0x8d8fb8}from'./mcp-installer.js';import a60_0x3aded2 from'../i18n/index.js';export async function configureCursorMcp(){const _0x150ef4=a60_0x15c9,_0x5237d8=process[_0x150ef4(0x1ea)](),_0x3fa935=await a60_0x8d8fb8(_0x5237d8);_0x3fa935[_0x150ef4(0x1df)]?(console[_0x150ef4(0x1ee)](a60_0x3aded2['t'](_0x150ef4(0x1e1))),console[_0x150ef4(0x1ee)](a60_0x3aded2['t'](_0x150ef4(0x1ed))),console[_0x150ef4(0x1ee)]('\x20\x20'+_0x3fa935['message']+'\x0a'),console[_0x150ef4(0x1ee)](a60_0x3aded2['t']('mcp.cursorConfig.usageHint')),console[_0x150ef4(0x1ee)](a60_0x3aded2['t'](_0x150ef4(0x1e2))),process[_0x150ef4(0x1dd)](0x0)):(console[_0x150ef4(0x1e9)](a60_0x3aded2['t']('mcp.cursorConfig.error',{'error':_0x3fa935[_0x150ef4(0x1eb)]})),process[_0x150ef4(0x1dd)](0x1));}function a60_0x15c9(_0x4593b8,_0x335378){_0x4593b8=_0x4593b8-0x1dd;const _0x23049e=a60_0x2304();let _0x15c9e7=_0x23049e[_0x4593b8];return _0x15c9e7;}function a60_0x2304(){const _0x3571bb=['mcp.cursorConfig.configInfo','log','exit','1165WuaFLS','success','39FXeqNv','mcp.cursorConfig.success','mcp.cursorConfig.restartRequired','22182nabWAa','1022914yvyTcv','2245488Cahtvt','2979450VKPYem','2890984WwoRqE','101866xvDotw','error','cwd','message','143308OsUNAF'];a60_0x2304=function(){return _0x3571bb;};return a60_0x2304();}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1efb3e,_0x156e6a){const _0x176358=a61_0x4489,_0x48c0b1=_0x1efb3e();while(!![]){try{const _0x3e3423=-parseInt(_0x176358(0x1e9))/0x1+parseInt(_0x176358(0x202))/0x2*(parseInt(_0x176358(0x205))/0x3)+parseInt(_0x176358(0x1da))/0x4*(-parseInt(_0x176358(0x20e))/0x5)+parseInt(_0x176358(0x208))/0x6+-parseInt(_0x176358(0x1de))/0x7*(parseInt(_0x176358(0x1e0))/0x8)+-parseInt(_0x176358(0x20b))/0x9+-parseInt(_0x176358(0x1f6))/0xa*(-parseInt(_0x176358(0x1ee))/0xb);if(_0x3e3423===_0x156e6a)break;else _0x48c0b1['push'](_0x48c0b1['shift']());}catch(_0x388da6){_0x48c0b1['push'](_0x48c0b1['shift']());}}}(a61_0x1ec8,0x305b6));import{configureCursorMcp}from'./cursor.js';function a61_0x4489(_0x4d7ed8,_0x10ef71){_0x4d7ed8=_0x4d7ed8-0x1da;const _0x1ec8c4=a61_0x1ec8();let _0x448908=_0x1ec8c4[_0x4d7ed8];return _0x448908;}import{configureClaudeMcp}from'./claude.js';function a61_0x1ec8(){const _0x309c4f=['cursor','help','345386HylvyE','map','mcp.help.exampleInstallCursorHint','6ELnxlH','mcp.help.configGuide','mcp.help.supportedIDEs','672864OUVkAy','length','mcp-install','1897281uEAttT','mcp.select.cancel','mcp.help.configMethodsDirect','4955iIeEwc','name','message','mcp.help.examples','\x0a\x20\x20https://help.yuntoo.com/mcp/config-guide\x0a','toLowerCase','--help','forEach','944QyolnN','description','mcp.help.usage.help','from','2534567gMNqjy','close','8nmLPym','error','join','mcp.help.usage.install','mcp.select.prompt','mcp.error.unsupportedCommand','quit','mcp.help.configMethodsDirectCursor','mcp.help.exampleInstallCursor','356667jQiPrB','\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x0a','mcp.help.configMethodsDirectClaude','trim','install','6853xyoqpA','mcp.help.exampleInstall','log','question','mcp.help.usage.installClaude','mcp.help.command.install','mcp.help.configMethods','stdin','14510STyswY','setLogPath','mcp.select.chooseIDE','mcpClaude','mcp.installFlow.error','mcp.select.enterNumber','mcp.help.exampleInstallHint','claude','exit','mcp.installFlow.configuring'];a61_0x1ec8=function(){return _0x309c4f;};return a61_0x1ec8();}import{logger}from'../utils/logger.js';import{createInterface}from'node:readline';import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';import a61_0x1776fd from'../i18n/index.js';export async function mcpCommand(_0x2c325a,_0x398556,_0x190dcd){const _0x1a62e3=a61_0x4489;logger[_0x1a62e3(0x1f7)](process['cwd']());if(_0x190dcd?.[_0x1a62e3(0x201)]||_0x2c325a===_0x1a62e3(0x214)){showHelp();return;}_0x2c325a!==_0x1a62e3(0x1ed)&&(console[_0x1a62e3(0x1e1)](a61_0x1776fd['t']('mcp.error.unsupportedCommand',{'cmd':_0x2c325a||'-'})),console['log'](a61_0x1776fd['t']('mcp.help.availableCommands')),console[_0x1a62e3(0x1f0)](a61_0x1776fd['t'](_0x1a62e3(0x1f3))),console[_0x1a62e3(0x1f0)](a61_0x1776fd['t']('mcp.help.command.help')),logger['error']('mcp',a61_0x1776fd['t'](_0x1a62e3(0x1e5),{'cmd':_0x2c325a||'-'})),process[_0x1a62e3(0x1fe)](0x1));let _0x50bbd6;if(_0x190dcd?.['mcpCursor'])_0x50bbd6=_0x1a62e3(0x200);else{if(_0x190dcd?.[_0x1a62e3(0x1f9)])_0x50bbd6=_0x1a62e3(0x1fd);else{if(_0x398556?.[0x0]){const _0x1dc680=_0x398556[0x0][_0x1a62e3(0x213)]();MCP_IDES['has'](_0x1dc680)&&(_0x50bbd6=_0x1dc680);}}}await installMcp(_0x50bbd6);}function showHelp(){const _0x280d16=a61_0x4489;console['log']('\x0a'+a61_0x1776fd['t']('mcp.help.title')+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x1dc))+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x1e3))+'\x0a'+a61_0x1776fd['t']('mcp.help.usage.installCursor')+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x1f2))+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x1f4))+'\x0a'+a61_0x1776fd['t']('mcp.help.configMethodsInteractive')+_0x280d16(0x1ea)+a61_0x1776fd['t']('mcp.help.configMethodsInteractiveHint')+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x20d))+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x1e7))+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x1eb))+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x207))+'\x0a'+Array['from'](MCP_IDES)[_0x280d16(0x203)]((_0x54bee3,_0x1f8b51)=>'\x20\x20'+(_0x1f8b51+0x1)+'.\x20'+IDE_CONFIGS[_0x54bee3]['name']+'\x20-\x20'+IDE_CONFIGS[_0x54bee3][_0x280d16(0x1db)])[_0x280d16(0x1e2)]('\x0a')+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x211))+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x1ef))+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x1fc))+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x1e8))+'\x0a'+a61_0x1776fd['t'](_0x280d16(0x204))+'\x0a\x0a'+a61_0x1776fd['t'](_0x280d16(0x206))+_0x280d16(0x212));}async function selectIDE(){const _0x1f6fe8=a61_0x4489;console[_0x1f6fe8(0x1f0)](a61_0x1776fd['t'](_0x1f6fe8(0x1f8)));const _0x469592=Array[_0x1f6fe8(0x1dd)](MCP_IDES);return _0x469592[_0x1f6fe8(0x215)]((_0x51f3e5,_0x535c0b)=>{const _0x44c7b4=_0x1f6fe8;console[_0x44c7b4(0x1f0)]('\x20\x20'+(_0x535c0b+0x1)+'.\x20'+IDE_CONFIGS[_0x51f3e5][_0x44c7b4(0x20f)]+'\x20-\x20'+IDE_CONFIGS[_0x51f3e5][_0x44c7b4(0x1db)]);}),console[_0x1f6fe8(0x1f0)](a61_0x1776fd['t'](_0x1f6fe8(0x20c))),console['log'](a61_0x1776fd['t'](_0x1f6fe8(0x1fb))),new Promise(_0x1490e7=>{const _0x2669b2=_0x1f6fe8,_0x3b3d0c=createInterface({'input':process[_0x2669b2(0x1f5)],'output':process['stdout']});_0x3b3d0c[_0x2669b2(0x1f1)](a61_0x1776fd['t'](_0x2669b2(0x1e4)),_0x469dc1=>{const _0x2b76d2=_0x2669b2;_0x3b3d0c[_0x2b76d2(0x1df)]();const _0x50904c=_0x469dc1[_0x2b76d2(0x1ec)]()[_0x2b76d2(0x213)]();(_0x50904c==='q'||_0x50904c===_0x2b76d2(0x1e6)||_0x50904c===_0x2b76d2(0x1fe))&&(console['log'](a61_0x1776fd['t']('mcp.select.cancelled')),process[_0x2b76d2(0x1fe)](0x0));const _0x4e0eea=parseInt(_0x50904c,0xa);if(!isNaN(_0x4e0eea)&&_0x4e0eea>=0x1&&_0x4e0eea<=_0x469592[_0x2b76d2(0x209)]){const _0x2ae323=_0x469592[_0x4e0eea-0x1];_0x2ae323&&_0x1490e7(_0x2ae323);return;}console[_0x2b76d2(0x1f0)](a61_0x1776fd['t']('mcp.select.invalidChoice',{'count':_0x469592[_0x2b76d2(0x209)]})),process[_0x2b76d2(0x1fe)](0x1);});});}async function installMcp(_0x25655e){const _0x4c40f4=a61_0x4489;let _0x2dba47;!_0x25655e?_0x2dba47=await selectIDE():_0x2dba47=_0x25655e;try{const _0x49282f=IDE_CONFIGS[_0x2dba47];console[_0x4c40f4(0x1f0)](a61_0x1776fd['t'](_0x4c40f4(0x1ff),{'name':_0x49282f['name']}));switch(_0x2dba47){case _0x4c40f4(0x200):await configureCursorMcp();break;case _0x4c40f4(0x1fd):await configureClaudeMcp();break;}}catch(_0x540acc){logger['error'](_0x4c40f4(0x20a),a61_0x1776fd['t']('mcp.installFlow.error',{'error':_0x540acc instanceof Error?_0x540acc['message']:String(_0x540acc)}),{'error':_0x540acc instanceof Error?_0x540acc[_0x4c40f4(0x210)]:String(_0x540acc)}),console[_0x4c40f4(0x1e1)](a61_0x1776fd['t'](_0x4c40f4(0x1fa),{'error':_0x540acc instanceof Error?_0x540acc[_0x4c40f4(0x210)]:String(_0x540acc)})),process['exit'](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x437fed=a62_0x4357;(function(_0x277b9a,_0x3178bd){const _0x4dfce9=a62_0x4357,_0x5a616c=_0x277b9a();while(!![]){try{const _0x5b1eab=-parseInt(_0x4dfce9(0xbb))/0x1*(parseInt(_0x4dfce9(0xd0))/0x2)+parseInt(_0x4dfce9(0xc1))/0x3+parseInt(_0x4dfce9(0xc3))/0x4*(-parseInt(_0x4dfce9(0xb7))/0x5)+-parseInt(_0x4dfce9(0xcb))/0x6+parseInt(_0x4dfce9(0xca))/0x7*(parseInt(_0x4dfce9(0xd1))/0x8)+parseInt(_0x4dfce9(0xc5))/0x9*(-parseInt(_0x4dfce9(0xc0))/0xa)+parseInt(_0x4dfce9(0xb6))/0xb;if(_0x5b1eab===_0x3178bd)break;else _0x5a616c['push'](_0x5a616c['shift']());}catch(_0x2991fa){_0x5a616c['push'](_0x5a616c['shift']());}}}(a62_0x47f8,0x8e4d7));function a62_0x4357(_0xca4c63,_0x421b9d){_0xca4c63=_0xca4c63-0xb5;const _0x47f8b8=a62_0x47f8();let _0x435700=_0x47f8b8[_0xca4c63];return _0x435700;}import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';import{logger}from'../utils/logger.js';import a62_0x4d6f4f from'../i18n/index.js';export async function installMcpNonInteractive(_0x19bf01,_0x464555=process[a62_0x437fed(0xc6)]()){const _0x3532c7=a62_0x437fed;logger[_0x3532c7(0xc7)](_0x464555),logger[_0x3532c7(0xd4)]('mcp-install-non-interactive',a62_0x4d6f4f['t']('mcp.install.starting'),{'ides':_0x19bf01});const _0x1ed090=[];for(const _0x1f2667 of _0x19bf01){try{let _0x119caa;switch(_0x1f2667){case _0x3532c7(0xbd):_0x119caa=await configureCursorMcp(_0x464555);break;case _0x3532c7(0xb5):_0x119caa=configureClaudeMcp(_0x464555);break;case _0x3532c7(0xc4):_0x119caa=showOtherMcpGuide(_0x464555);break;default:_0x119caa={'success':![],'message':a62_0x4d6f4f['t'](_0x3532c7(0xc2),{'ide':_0x1f2667})};}_0x1ed090[_0x3532c7(0xcf)](_0x119caa);if(_0x119caa['success']){const _0xf342ac=_0x1f2667===_0x3532c7(0xbd)?a62_0x4d6f4f['t'](_0x3532c7(0xd3)):_0x1f2667===_0x3532c7(0xb5)?a62_0x4d6f4f['t'](_0x3532c7(0xb8)):a62_0x4d6f4f['t'](_0x3532c7(0xba));console['log'](a62_0x4d6f4f['t'](_0x3532c7(0xcc),{'ide':_0xf342ac})),console[_0x3532c7(0xbc)]('\x20\x20'+_0x119caa[_0x3532c7(0xcd)]);}else console[_0x3532c7(0xd2)](a62_0x4d6f4f['t'](_0x3532c7(0xb9),{'ide':_0x1f2667==='cursor'?a62_0x4d6f4f['t'](_0x3532c7(0xd3)):_0x1f2667===_0x3532c7(0xb5)?a62_0x4d6f4f['t'](_0x3532c7(0xb8)):a62_0x4d6f4f['t'](_0x3532c7(0xba)),'error':_0x119caa[_0x3532c7(0xcd)]}));}catch(_0x7b8086){console[_0x3532c7(0xd2)](a62_0x4d6f4f['t'](_0x3532c7(0xb9),{'ide':_0x1f2667==='cursor'?a62_0x4d6f4f['t'](_0x3532c7(0xd3)):_0x1f2667===_0x3532c7(0xb5)?a62_0x4d6f4f['t'](_0x3532c7(0xb8)):a62_0x4d6f4f['t'](_0x3532c7(0xba)),'error':_0x7b8086 instanceof Error?_0x7b8086['message']:String(_0x7b8086)}));}}const _0x289f4d=_0x1ed090[_0x3532c7(0xbf)](_0x44a182=>_0x44a182[_0x3532c7(0xbe)])[_0x3532c7(0xce)],_0x1fa1c8=_0x1ed090['length'];console[_0x3532c7(0xbc)](a62_0x4d6f4f['t']('mcp.install.completed',{'successCount':_0x289f4d,'totalCount':_0x1fa1c8}));const _0xe87556=_0x1ed090[_0x3532c7(0xc8)](_0x5a950=>_0x5a950['needsManualAction']);_0xe87556&&console['log'](a62_0x4d6f4f['t'](_0x3532c7(0xc9)));}function a62_0x47f8(){const _0xc6078b=['21498631szfEaf','5oYWvzP','mcp.claude','mcp.install.failed','mcp.install.otherIDE','11347qpmsaa','log','cursor','success','filter','646580IEkryF','1029045nKeyat','mcp.install.unknownIDE','2832732qeqBhq','other','27YsnQZA','cwd','setLogPath','some','mcp.install.manualActionRequired','2191vZboAy','4006194DBkzWq','mcp.install.success','message','length','push','66dHLIeA','5872Prjvaj','error','mcp.cursor','info','claude'];a62_0x47f8=function(){return _0xc6078b;};return a62_0x47f8();}
|
package/lib/mcp/mcp-installer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a63_0x2cd968=a63_0x2121;(function(_0x41968c,_0x2448ef){const _0x1f94e6=a63_0x2121,_0xe637e2=_0x41968c();while(!![]){try{const _0x4b8232=-parseInt(_0x1f94e6(0x150))/0x1+-parseInt(_0x1f94e6(0x149))/0x2*(-parseInt(_0x1f94e6(0x11e))/0x3)+-parseInt(_0x1f94e6(0x121))/0x4*(parseInt(_0x1f94e6(0x13e))/0x5)+-parseInt(_0x1f94e6(0x132))/0x6+parseInt(_0x1f94e6(0x120))/0x7+-parseInt(_0x1f94e6(0x119))/0x8+parseInt(_0x1f94e6(0x14d))/0x9;if(_0x4b8232===_0x2448ef)break;else _0xe637e2['push'](_0xe637e2['shift']());}catch(_0x32639d){_0xe637e2['push'](_0xe637e2['shift']());}}}(a63_0x46b3,0xf38d9));import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{getRulesContent}from'../utils/rules-cdn.js';import a63_0x123d1a from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url));function a63_0x46b3(){const _0x281aed=['mcp-claude','mcp.claudeConfig.restartRequired','mcp.other.configGuide','mcp.claudeConfig.error','mcp.other.guideShown','mcp-cursor','stringify','11500KAIzZL','mcp.cursorConfig.rules.exists','mcp.other.configInfo','mcp.cursorConfig.written','AppCode:\x20','.cursor','app','map','message','info','mcpServers','4CQJlqC','mcp.cursorConfig.rules.created','lovrabet-dataset','LOVRABET_ENV','10814301lEcHeU','claude\x20mcp\x20add\x20','mcp.claudeConfig.configInfo','17901LJPWno','\x20-e\x20LOVRABET_APP_CODE=','mcp.cursorConfig.success','rules','online','mcp.cursorConfig.updateExisting','\x20\x20\x20\x20\x20\x20}','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,','12025488CHxbpu','utf8','mcp.config.env','push','mcp.cursorConfig.error','2245932ZXvEdQ','\x20\x20}','13324612hQNGAv','1240SlXdfc','error','\x20-e\x20LOVRABET_ENV=','\x20\x20\x20\x20}','\x22LOVRABET_APP_CODE\x22:\x20\x22','utf-8','mcp.claudeConfig.manualCommand','mcp.cursorConfig.rules.copyFailed','\x20\x20\x20\x20\x20\x20\x20\x20','join','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[\x22@lovrabet/dataset-mcp-server@latest\x22],','\x20\x20\x22mcpServers\x22:\x20{','mcp-install','parse','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','agents.md','appcode','8224278axpZCt','\x0a\x20\x20','mcp.json','lovrabet_rules.mdc','@lovrabet/dataset-mcp-server@latest'];a63_0x46b3=function(){return _0x281aed;};return a63_0x46b3();}export const MCP_SERVER_NAME=a63_0x2cd968(0x14b);export const MCP_COMMAND='npx';export const MCP_ARGS=[a63_0x2cd968(0x136)];export function getAppConfig(){const _0x1f6f5c=a63_0x2cd968,_0x4ef85d=readConfig(),_0x36a3c7=_0x4ef85d[_0x1f6f5c(0x131)]||_0x4ef85d[_0x1f6f5c(0x144)],_0x27f29f=_0x4ef85d['env']||_0x1f6f5c(0x154);if(!_0x36a3c7)throw new Error(a63_0x123d1a['t']('mcp.error.missingAppcode'));return{'appcode':String(_0x36a3c7),'env':_0x27f29f};}export function buildMcpEnv(_0x39646f,_0x3d2cd6){const _0x20a3da=a63_0x2cd968,_0x3790b9={'LOVRABET_APP_CODE':_0x39646f};return _0x3d2cd6!=='online'&&(_0x3790b9[_0x20a3da(0x14c)]=_0x3d2cd6),_0x3790b9;}export function buildMcpServerConfig(_0x30ba73,_0x1b20c9){return{'command':MCP_COMMAND,'args':MCP_ARGS,'env':buildMcpEnv(_0x30ba73,_0x1b20c9)};}export function buildClaudeMcpCommand(_0x54bcc5,_0x44b38b){const _0x308e26=a63_0x2cd968,_0x215cf8=_0x308e26(0x14e)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x308e26(0x12a)]('\x20')+_0x308e26(0x151)+_0x54bcc5,_0x41110c=_0x44b38b!==_0x308e26(0x154)?_0x308e26(0x123)+_0x44b38b:'';return''+_0x215cf8+_0x41110c;}function a63_0x2121(_0x3c9fed,_0x2a9fcf){_0x3c9fed=_0x3c9fed-0x117;const _0x46b369=a63_0x46b3();let _0x2121ba=_0x46b369[_0x3c9fed];return _0x2121ba;}export async function copyCursorRules(_0x1856b9){const _0x1d6be8=a63_0x2cd968,_0x4fe608=join(_0x1856b9,_0x1d6be8(0x143)),_0x483753=join(_0x4fe608,_0x1d6be8(0x153)),_0x4f8aa8=join(_0x483753,_0x1d6be8(0x135));if(existsSync(_0x4f8aa8))return logger[_0x1d6be8(0x147)]('mcp-install',a63_0x123d1a['t'](_0x1d6be8(0x13f)),{'path':_0x4f8aa8}),![];try{ensureDir(_0x483753);const _0x5d38c5=await getRulesContent();return writeFileSync(_0x4f8aa8,_0x5d38c5,_0x1d6be8(0x126)),logger[_0x1d6be8(0x147)](_0x1d6be8(0x12d),a63_0x123d1a['t'](_0x1d6be8(0x14a)),{'to':_0x4f8aa8}),!![];}catch(_0x18878f){return logger[_0x1d6be8(0x122)](_0x1d6be8(0x12d),a63_0x123d1a['t'](_0x1d6be8(0x128)),{'error':_0x18878f instanceof Error?_0x18878f[_0x1d6be8(0x146)]:String(_0x18878f)}),![];}}export async function copyAgentsMd(_0x193ae6){const _0x412ba4=a63_0x2cd968,_0x26c144=join(_0x193ae6,_0x412ba4(0x130));if(existsSync(_0x26c144))return logger[_0x412ba4(0x147)](_0x412ba4(0x12d),a63_0x123d1a['t']('mcp.claudeConfig.agents.exists'),{'path':_0x26c144}),![];try{const _0x2a7d36=await getRulesContent();return writeFileSync(_0x26c144,_0x2a7d36,_0x412ba4(0x126)),logger[_0x412ba4(0x147)](_0x412ba4(0x12d),a63_0x123d1a['t']('mcp.claudeConfig.agents.created'),{'to':_0x26c144}),!![];}catch(_0x4bc61f){return logger[_0x412ba4(0x122)](_0x412ba4(0x12d),a63_0x123d1a['t']('mcp.claudeConfig.agents.copyFailed'),{'error':_0x4bc61f instanceof Error?_0x4bc61f[_0x412ba4(0x146)]:String(_0x4bc61f)}),![];}}export async function configureCursorMcp(_0x1d9694){const _0x2b8602=a63_0x2cd968;try{const {appcode:_0x235001,env:_0x21bb46}=getAppConfig(),_0x34e959=join(_0x1d9694,_0x2b8602(0x143)),_0x218ff5=join(_0x34e959,_0x2b8602(0x134));ensureDir(_0x34e959);const _0x4acbab=buildMcpServerConfig(_0x235001,_0x21bb46);let _0x3b0902;if(existsSync(_0x218ff5)){const _0x322ed1=readFileSync(_0x218ff5,_0x2b8602(0x11a));_0x3b0902=JSON[_0x2b8602(0x12e)](_0x322ed1),!_0x3b0902[_0x2b8602(0x148)]&&(_0x3b0902[_0x2b8602(0x148)]={}),logger[_0x2b8602(0x147)](_0x2b8602(0x13c),a63_0x123d1a['t'](_0x2b8602(0x155)),{'path':_0x218ff5,'appcode':_0x235001,'env':_0x21bb46});}else _0x3b0902={'mcpServers':{}},logger[_0x2b8602(0x147)](_0x2b8602(0x13c),a63_0x123d1a['t']('mcp.cursorConfig.createNew'),{'path':_0x218ff5,'appcode':_0x235001,'env':_0x21bb46});_0x3b0902['mcpServers'][MCP_SERVER_NAME]=_0x4acbab,writeFileSync(_0x218ff5,JSON[_0x2b8602(0x13d)](_0x3b0902,null,0x2),{'encoding':_0x2b8602(0x11a)});const _0x5ea3e1=await copyCursorRules(_0x1d9694),_0x13f0fd=[a63_0x123d1a['t'](_0x2b8602(0x141)),_0x2b8602(0x142)+_0x235001];return _0x21bb46!==_0x2b8602(0x154)&&_0x13f0fd[_0x2b8602(0x11c)](a63_0x123d1a['t']('mcp.config.env',{'env':_0x21bb46})),_0x13f0fd[_0x2b8602(0x11c)](a63_0x123d1a['t']('mcp.cursorConfig.restartRequired')),_0x5ea3e1&&_0x13f0fd['push'](a63_0x123d1a['t'](_0x2b8602(0x14a))),logger[_0x2b8602(0x147)]('mcp-cursor',a63_0x123d1a['t'](_0x2b8602(0x152)),{'appcode':_0x235001,'env':_0x21bb46,'configPath':_0x218ff5}),{'success':!![],'message':_0x13f0fd[_0x2b8602(0x12a)](_0x2b8602(0x133))};}catch(_0x2bc39e){return logger[_0x2b8602(0x122)]('mcp-cursor',a63_0x123d1a['t'](_0x2b8602(0x11d),{'error':_0x2bc39e instanceof Error?_0x2bc39e[_0x2b8602(0x146)]:String(_0x2bc39e)}),{'error':_0x2bc39e instanceof Error?_0x2bc39e[_0x2b8602(0x146)]:String(_0x2bc39e)}),{'success':![],'message':_0x2bc39e instanceof Error?_0x2bc39e['message']:String(_0x2bc39e)};}}export function configureClaudeMcp(_0x2efda6){const _0x1dc753=a63_0x2cd968;try{const {appcode:_0x145a73,env:_0x606dc3}=getAppConfig();copyAgentsMd(_0x2efda6);const _0x567fbe=buildClaudeMcpCommand(_0x145a73,_0x606dc3),_0xe63f69=[a63_0x123d1a['t'](_0x1dc753(0x127)),''+_0x567fbe,a63_0x123d1a['t'](_0x1dc753(0x14f)),_0x1dc753(0x142)+_0x145a73];return _0x606dc3!==_0x1dc753(0x154)&&_0xe63f69[_0x1dc753(0x11c)](a63_0x123d1a['t'](_0x1dc753(0x11b),{'env':_0x606dc3})),_0xe63f69[_0x1dc753(0x11c)](a63_0x123d1a['t'](_0x1dc753(0x138))),logger['info']('mcp-claude',a63_0x123d1a['t']('mcp.claudeConfig.commandGenerated'),{'appcode':_0x145a73,'env':_0x606dc3,'command':_0x567fbe}),{'success':!![],'message':_0xe63f69[_0x1dc753(0x12a)](_0x1dc753(0x133)),'needsManualAction':!![]};}catch(_0x4ce488){return logger[_0x1dc753(0x122)](_0x1dc753(0x137),a63_0x123d1a['t'](_0x1dc753(0x13a),{'error':_0x4ce488 instanceof Error?_0x4ce488[_0x1dc753(0x146)]:String(_0x4ce488)}),{'error':_0x4ce488 instanceof Error?_0x4ce488['message']:String(_0x4ce488)}),{'success':![],'message':_0x4ce488 instanceof Error?_0x4ce488[_0x1dc753(0x146)]:String(_0x4ce488)};}}export function showOtherMcpGuide(_0x3077b0){const _0x56b08c=a63_0x2cd968;try{const {appcode:_0x26aac9,env:_0x316f04}=getAppConfig(),_0x427c7a=buildMcpServerConfig(_0x26aac9,_0x316f04),_0x13247f=[_0x56b08c(0x125)+_0x26aac9+'\x22'];_0x316f04!=='online'&&_0x13247f[_0x56b08c(0x11c)]('\x22LOVRABET_ENV\x22:\x20\x22'+_0x316f04+'\x22');const _0x2f4e79=[a63_0x123d1a['t'](_0x56b08c(0x140),{'appcode':_0x26aac9,'env':_0x316f04}),'{',_0x56b08c(0x12c),'\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{',_0x56b08c(0x118),_0x56b08c(0x12b),_0x56b08c(0x12f),..._0x13247f[_0x56b08c(0x145)](_0xd365ef=>_0x56b08c(0x129)+_0xd365ef+','),_0x56b08c(0x117),_0x56b08c(0x124),_0x56b08c(0x11f),'}',a63_0x123d1a['t'](_0x56b08c(0x139))];return logger[_0x56b08c(0x147)]('mcp-install',a63_0x123d1a['t'](_0x56b08c(0x13b)),{'appcode':_0x26aac9,'env':_0x316f04}),{'success':!![],'message':_0x2f4e79['join']('\x0a'),'needsManualAction':!![]};}catch(_0x1142e3){return{'success':![],'message':_0x1142e3 instanceof Error?_0x1142e3[_0x56b08c(0x146)]:String(_0x1142e3)};}}function ensureDir(_0x57acdc){!existsSync(_0x57acdc)&&mkdirSync(_0x57acdc,{'recursive':!![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x2bd9a9=a64_0x2e5f;(function(_0x3b4e94,_0x10c8f6){const _0x2d2e68=a64_0x2e5f,_0x11efa1=_0x3b4e94();while(!![]){try{const _0x4b75ee=-parseInt(_0x2d2e68(0x17f))/0x1*(-parseInt(_0x2d2e68(0x15b))/0x2)+-parseInt(_0x2d2e68(0x15e))/0x3+-parseInt(_0x2d2e68(0x179))/0x4+-parseInt(_0x2d2e68(0x159))/0x5+parseInt(_0x2d2e68(0x15f))/0x6*(-parseInt(_0x2d2e68(0x155))/0x7)+-parseInt(_0x2d2e68(0x158))/0x8*(-parseInt(_0x2d2e68(0x156))/0x9)+parseInt(_0x2d2e68(0x174))/0xa;if(_0x4b75ee===_0x10c8f6)break;else _0x11efa1['push'](_0x11efa1['shift']());}catch(_0x4f57b3){_0x11efa1['push'](_0x11efa1['shift']());}}}(a64_0x3781,0x8e900));import{jsx as a64_0x34650d,jsxs as a64_0x286dea,Fragment as a64_0x2fc0b6}from'react/jsx-runtime';import{useState,useEffect}from'react';function a64_0x3781(){const _0x357235=['skill.installing.installed','error','description','skill.cdn.fetchFailed','installing','utf-8','gray','skill.installing.title','setLogPath','handleKeyDown','message','308MItPwi','261zGXTYa','stringify','103288QNLNXt','3523380tzEZQv','skill.cdn.fetchingExtend','16076HGbXVS','.lovrabet/skill-manifest.json','info','2300061bqgwlR','11772cVNgHL','.lovrabet/skill/.shared/guides','selectedIndexes','map','green','skill.done.pressAnyKey','getSelectedIDEs','skill.select.count','keys','log','toISOString','value','guides','skill.done.successInline','warn','setErrorMsg','skill.cdn.fetchSuccess','length','return','name','cwd','15043250PPdcgr','done','skill-install','skill.cdn.fetching','size','1713540xrhzsZ','selecting','../../cdn-source/skills','安装成功','column','2.0.0','86rqsohN'];a64_0x3781=function(){return _0x357235;};return a64_0x3781();}function a64_0x2e5f(_0x474a99,_0x163003){_0x474a99=_0x474a99-0x14e;const _0x37818f=a64_0x3781();let _0x2e5fe9=_0x37818f[_0x474a99];return _0x2e5fe9;}import{Text,Box,useInput,useApp}from'ink';import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';import{logger}from'../utils/logger.js';import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,IDE_LIST}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{IDESelector,useIDESelection}from'../ui/IDESelector.js';import{useI18n}from'../i18n/hooks.js';const __dirname=dirname(fileURLToPath(import.meta.url)),UI_IDE_LIST=IDE_LIST[a64_0x2bd9a9(0x162)](_0x1f55b8=>({'key':_0x1f55b8,'name':IDE_CONFIGS[_0x1f55b8][a64_0x2bd9a9(0x172)],'description':IDE_CONFIGS[_0x1f55b8][a64_0x2bd9a9(0x182)]}));export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[],providedFlags:_0x5039f5}){const _0x1c373b=a64_0x2bd9a9,{exit:_0x17b2ae}=useApp(),{t:_0x1b8241}=useI18n(),[_0x954fad,_0x5c34a8]=useState(_0x1c373b(0x17a)),[_0x4c1146,_0x367ed2]=useState([]),[_0x58cf71,_0x3f8527]=useState([]),[_0x3f9e24,_0x16468f]=useState(0x0),_0x124ddd=useIDESelection({'ideList':UI_IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{preselectedIDEs['length']>0x0&&_0x124ddd['selectedIndexes']['size']>0x0&&_0x419c47();},[]),useInput((_0x329527,_0xb8d045)=>{const _0x314e55=_0x1c373b;if(_0x954fad===_0x314e55(0x17a)){if(_0x329527==='q'||_0x329527==='Q'){_0x17b2ae();return;}if(_0xb8d045[_0x314e55(0x171)]){if(_0x124ddd[_0x314e55(0x161)][_0x314e55(0x178)]===0x0){_0x124ddd[_0x314e55(0x16e)](_0x1b8241('skill.error.selectAtLeastOne'));return;}_0x419c47();return;}_0x124ddd[_0x314e55(0x153)](_0x329527,_0xb8d045);}_0x954fad===_0x314e55(0x175)&&_0x17b2ae();});async function _0x419c47(){const _0x2dcfc8=_0x1c373b,_0x497b97=_0x124ddd[_0x2dcfc8(0x165)]();_0x3f8527(_0x497b97),_0x367ed2([{'label':_0x1b8241('skill.select.selectedIDE'),'value':_0x1b8241(_0x2dcfc8(0x166),{'count':_0x124ddd[_0x2dcfc8(0x161)][_0x2dcfc8(0x178)]})}]),_0x5c34a8(_0x2dcfc8(0x14e)),await _0x4bb4da(_0x497b97);}async function _0x4bb4da(_0x8ce940){const _0x2445a6=_0x1c373b,_0x4d4dfd=process[_0x2445a6(0x173)](),_0xeffe42=resolve(__dirname,_0x2445a6(0x17b));logger[_0x2445a6(0x152)](_0x4d4dfd);const _0x1d9f58=_0x5039f5&&_0x5039f5[_0x2445a6(0x170)]>0x0;console['log'](_0x1d9f58?_0x1b8241(_0x2445a6(0x15a)):_0x1b8241(_0x2445a6(0x177)));let _0x16ca34;try{_0x16ca34=await fetchGuidesFromCDN(_0x1d9f58),console[_0x2445a6(0x168)](_0x1b8241(_0x2445a6(0x16f),{'count':Object[_0x2445a6(0x167)](_0x16ca34[_0x2445a6(0x16b)])['length']}));}catch(_0xec4ad8){console[_0x2445a6(0x16d)](_0x1b8241(_0x2445a6(0x183),{'error':_0xec4ad8 instanceof Error?_0xec4ad8['message']:String(_0xec4ad8)}));}let _0x178206=0x0;for(const _0x2d5197 of _0x8ce940){try{const _0xabab9f=IDE_CONFIGS[_0x2d5197],_0x2b8d7f=await installSingleIDE(_0x2d5197,_0xabab9f,_0x4d4dfd,_0xeffe42,_0x16ca34,_0x5039f5);_0x178206+=_0x2b8d7f,_0x16468f(_0x178206);}catch(_0x5310fe){console[_0x2445a6(0x181)](_0x1b8241('skill.error.installFailed',{'ide':_0x2d5197,'error':_0x5310fe instanceof Error?_0x5310fe[_0x2445a6(0x154)]:String(_0x5310fe)}));}}_0x16ca34&&writeGuidesToProject(_0x16ca34,_0x4d4dfd,_0x2445a6(0x160),_0x5039f5);const _0x21991e={'version':_0x2445a6(0x17e),'installedAt':new Date()[_0x2445a6(0x169)](),'platforms':_0x8ce940},_0x30f47a=join(_0x4d4dfd,_0x2445a6(0x15c)),_0x30c0b4=join(_0x4d4dfd,'.lovrabet');await copyDir(_0x30c0b4,_0x30c0b4),writeFileSync(_0x30f47a,JSON[_0x2445a6(0x157)](_0x21991e,null,0x2),_0x2445a6(0x14f)),logger[_0x2445a6(0x15d)](_0x2445a6(0x176),_0x2445a6(0x17c),{'projectRoot':_0x4d4dfd,'ides':_0x8ce940,'foldersCount':_0x178206}),_0x5c34a8(_0x2445a6(0x175)),setTimeout(()=>{_0x17b2ae();},0x3e8);}return a64_0x286dea(Box,{'flexDirection':_0x1c373b(0x17d),'marginTop':0x1,'children':[_0x954fad===_0x1c373b(0x17a)&&a64_0x34650d(IDESelector,{'ideList':UI_IDE_LIST,'title':_0x1b8241(_0x1c373b(0x151)),'selection':_0x124ddd}),_0x954fad===_0x1c373b(0x14e)&&a64_0x34650d(InstallingStep,{'completedSteps':_0x4c1146,'installingIDEs':_0x58cf71,'installedCount':_0x3f9e24}),_0x954fad===_0x1c373b(0x175)&&a64_0x34650d(DoneStep,{'installedCount':_0x3f9e24})]});}function InstallingStep({completedSteps:_0x50f14f,installingIDEs:_0x56437b,installedCount:_0x5ba366}){const _0x4c300f=a64_0x2bd9a9,{t:_0x37879e}=useI18n();return a64_0x286dea(a64_0x2fc0b6,{'children':[_0x50f14f[_0x4c300f(0x162)]((_0x558b6d,_0xaeb284)=>a64_0x286dea(Box,{'children':[a64_0x286dea(Text,{'color':_0x4c300f(0x163),'children':['√\x20',_0x558b6d['label'],':\x20']}),a64_0x34650d(Text,{'color':'cyan','children':_0x558b6d[_0x4c300f(0x16a)]})]},_0xaeb284)),a64_0x34650d(Box,{'marginTop':0x1,'children':a64_0x34650d(Text,{'children':_0x37879e('skill.installing.progress')})}),_0x56437b[_0x4c300f(0x162)](_0x2a7f74=>a64_0x286dea(Box,{'children':[a64_0x34650d(Text,{'color':_0x4c300f(0x163),'children':'\x20✓\x20'}),a64_0x34650d(Text,{'children':IDE_CONFIGS[_0x2a7f74]?.[_0x4c300f(0x172)]||_0x2a7f74})]},_0x2a7f74)),a64_0x34650d(Box,{'marginTop':0x1,'children':a64_0x34650d(Text,{'color':_0x4c300f(0x150),'children':_0x37879e(_0x4c300f(0x180),{'count':_0x5ba366})})})]});}function DoneStep({installedCount:_0x5ea59b}){const _0x3b51f1=a64_0x2bd9a9,{t:_0x1f847a}=useI18n();return a64_0x286dea(a64_0x2fc0b6,{'children':[a64_0x34650d(Box,{'children':a64_0x34650d(Text,{'color':_0x3b51f1(0x163),'children':_0x1f847a(_0x3b51f1(0x16c),{'count':_0x5ea59b})})}),a64_0x34650d(Box,{'marginTop':0x1,'children':a64_0x34650d(Text,{'color':_0x3b51f1(0x150),'children':_0x1f847a('skill.done.guidesPathInline')})}),a64_0x34650d(Box,{'marginTop':0x1,'children':a64_0x34650d(Text,{'color':_0x3b51f1(0x150),'children':_0x1f847a(_0x3b51f1(0x164))})})]});}async function copyDirIfNeeded(_0x369400,_0x38be0b){try{return await copyDir(_0x369400,_0x38be0b),!![];}catch{return![];}}
|
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x182307,_0x5c1f31){const _0x28f8f0=a67_0x4572,_0x2b7e44=_0x182307();while(!![]){try{const _0x61fe80=parseInt(_0x28f8f0(0x246))/0x1*(parseInt(_0x28f8f0(0x207))/0x2)+parseInt(_0x28f8f0(0x1ea))/0x3*(parseInt(_0x28f8f0(0x22c))/0x4)+-parseInt(_0x28f8f0(0x200))/0x5*(parseInt(_0x28f8f0(0x256))/0x6)+parseInt(_0x28f8f0(0x1fe))/0x7+parseInt(_0x28f8f0(0x241))/0x8*(-parseInt(_0x28f8f0(0x1fd))/0x9)+-parseInt(_0x28f8f0(0x1ed))/0xa+parseInt(_0x28f8f0(0x1ef))/0xb;if(_0x61fe80===_0x5c1f31)break;else _0x2b7e44['push'](_0x2b7e44['shift']());}catch(_0x21f00a){_0x2b7e44['push'](_0x2b7e44['shift']());}}}(a67_0x3e68,0x5fa88));import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,CORE_IDE_LIST,ALL_CORE_IDES}from'../utils/ai_config.js';function a67_0x3e68(){const _0x18611b=['skill.help.exampleBffDesc','skill.help.bffWorkflow','toLowerCase','question','trim','\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','name','split','skill.generic','path','30MZolqg','skill.help.options','\x20-\x20','skill.select.title','agent','\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.installing.createdDir','969taUyJF','skill.help.installAll','skill.error.noValidIDE','2707660ygpMlp','skill.help.interactiveKeys','2398561TcExUl','-$1','skill.error.unsupportedCommand','skill.select.cancelled','includes','\x0a\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20q.\x20','skill.help.skillContentsList','skill-install','skill.help.installMethods','skill.select.cancel','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20','some','skill.installing.createdManifest','1198413QwFIFc','1464190jyRfwS','skill.help.title','130745bVeeoU','--help','stdin','skill.select.inputFormat','\x20\x200.\x20','from','error','1160MGfLUD','skill.cdn.fetchSuccess','\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','log','utf-8','\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20','skill.select.prompt','skill.help.interactiveSelect','length','folders','filter','skill.help.supportedIDEs','cwd','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a','skill.errorHint.installDirect','skill.done.success','stringify','skill.errorHint.exampleInteractive','skill.help.allDesc','\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(empty)','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a','../../cdn-source/skills','2.0.0','skill.errorHint.usageExamples','skill.error.unknownPlatform','help','close','skill.help.exampleInteractive','skill.help.installDirect','安装成功','setLogPath','skill.cdn.fetching','\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a','toISOString','skill.cdn.fetchFailed','skill.help.examples','7988oRNFzO','startsWith','skill.cdn.fetchingExtend','skill.errorHint.availableCommands','skill.done.guidesLocation','all','skill.select.installAll','push','exit','guides','skill.help.exampleAllDesc','skill.help.afterInstall','skill.select.inputHint','skill.help.directInstall','skill.help.guidesLocationTitle','skill.help.bffOption','skill.help.skillContents','skill.help.afterInstallList','message','skill.installing.ide','stdout','40dnhOhl','skill.help.showHelp','forEach','replace','keys','667iXRqRC','files','.lovrabet','不支持的命令:\x20','skill.help.usage','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a'];a67_0x3e68=function(){return _0x18611b;};return a67_0x3e68();}import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a67_0x4a68b5 from'../i18n/index.js';const t=a67_0x4a68b5['t']['bind'](a67_0x4a68b5),__dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x3aeb88){const _0x47c707=a67_0x4572,_0x4f60a0=[];for(const [_0x16b7a1,_0x52507c]of Object['entries'](_0x3aeb88)){if(_0x52507c===!![]){const _0x1dccc6=_0x16b7a1[_0x47c707(0x244)](/([A-Z])/g,_0x47c707(0x1f0))[_0x47c707(0x24e)]();_0x4f60a0[_0x47c707(0x233)](_0x1dccc6);}}return _0x4f60a0;}export function parseDynamicFlags(){const _0x68a713=a67_0x4572,_0x1ee975=[];for(let _0x11530f=0x3;_0x11530f<process['argv']['length'];_0x11530f++){const _0xd67f71=process['argv'][_0x11530f];if(_0xd67f71&&_0xd67f71[_0x68a713(0x22d)]('--')){const _0x5d613a=_0xd67f71['slice'](0x2);_0x5d613a&&!_0x5d613a['includes']('=')&&_0x1ee975[_0x68a713(0x233)](_0x5d613a);}}return _0x1ee975;}function a67_0x4572(_0x23fb40,_0x5f2f55){_0x23fb40=_0x23fb40-0x1e7;const _0x3e68f5=a67_0x3e68();let _0x45727a=_0x3e68f5[_0x23fb40];return _0x45727a;}export function getAllProvidedFlags(_0x181cf5){const _0xb19c40=a67_0x4572,_0xf1b880=camelCaseFlagsToKebab(_0x181cf5),_0x3d3055=parseDynamicFlags(),_0x47b7c4=new Set([..._0xf1b880,..._0x3d3055]);return Array[_0xb19c40(0x205)](_0x47b7c4);}export async function skillsCommand(_0x4f6179,_0x1cb7ce,_0x33c41e){const _0xce33f6=a67_0x4572;logger[_0xce33f6(0x226)](process[_0xce33f6(0x213)]());if(_0x33c41e?.[_0xce33f6(0x221)]||_0x4f6179===_0xce33f6(0x201)){showHelp();return;}_0x4f6179!=='install'&&(console[_0xce33f6(0x206)](t(_0xce33f6(0x1f1),{'cmd':_0x4f6179||_0xce33f6(0x21b)})),console[_0xce33f6(0x20a)](t(_0xce33f6(0x22f))),console[_0xce33f6(0x20a)](t('skill.errorHint.installInteractive')),console['log'](t(_0xce33f6(0x215))),console[_0xce33f6(0x20a)](t('skill.errorHint.showHelp')),console[_0xce33f6(0x20a)](t(_0xce33f6(0x21f))),console['log'](t(_0xce33f6(0x218))),console['log'](t('skill.errorHint.exampleDirect')),logger[_0xce33f6(0x206)]('skill',_0xce33f6(0x249)+_0x4f6179),process[_0xce33f6(0x234)](0x1));let _0x2f4b2b=_0x1cb7ce?.[0x0];const _0x33b780=getAllProvidedFlags(_0x33c41e??{});_0x2f4b2b?.[_0xce33f6(0x22d)]('--')&&(_0x2f4b2b=undefined),await installSkill(_0x2f4b2b??'agent',_0x33b780);}async function selectIDEs(){const _0x5b1b85=a67_0x4572;return console[_0x5b1b85(0x20a)](t(_0x5b1b85(0x259))),CORE_IDE_LIST[_0x5b1b85(0x243)]((_0x70d0db,_0x65c938)=>{const _0x1b9daf=_0x5b1b85;console['log']('\x20\x20'+(_0x65c938+0x1)+'.\x20'+IDE_CONFIGS[_0x70d0db]['name']+_0x1b9daf(0x258)+IDE_CONFIGS[_0x70d0db]['description']);}),console['log'](_0x5b1b85(0x204)+t(_0x5b1b85(0x232))),console[_0x5b1b85(0x20a)](_0x5b1b85(0x1f5)+t(_0x5b1b85(0x1f9))+'\x0a'),console[_0x5b1b85(0x20a)](t(_0x5b1b85(0x203))),console[_0x5b1b85(0x20a)](t(_0x5b1b85(0x238))),new Promise(_0x2527cb=>{const _0x3069ae=_0x5b1b85,_0x411cf7=createInterface({'input':process[_0x3069ae(0x202)],'output':process[_0x3069ae(0x240)]});_0x411cf7[_0x3069ae(0x24f)](t(_0x3069ae(0x20d)),_0xc2264d=>{const _0xd8c1db=_0x3069ae;_0x411cf7[_0xd8c1db(0x222)]();const _0x1f315a=_0xc2264d[_0xd8c1db(0x250)]()[_0xd8c1db(0x24e)]();(_0x1f315a==='q'||_0x1f315a==='quit'||_0x1f315a==='exit')&&(console['log'](t(_0xd8c1db(0x1f2))),process[_0xd8c1db(0x234)](0x0));if(_0x1f315a==='0'||_0x1f315a===_0xd8c1db(0x231)){_0x2527cb(['all']);return;}const _0x1bd212=_0x1f315a[_0xd8c1db(0x253)](/\s+/)[_0xd8c1db(0x211)](Boolean),_0x1e6870=[];for(const _0x3bc25d of _0x1bd212){const _0x3fdfca=parseInt(_0x3bc25d,0xa);if(!isNaN(_0x3fdfca)&&_0x3fdfca>=0x1&&_0x3fdfca<=CORE_IDE_LIST['length']){const _0x4342c7=CORE_IDE_LIST[_0x3fdfca-0x1];_0x4342c7&&!_0x1e6870[_0xd8c1db(0x1f3)](_0x4342c7)&&_0x1e6870[_0xd8c1db(0x233)](_0x4342c7);}}_0x1e6870['length']===0x0&&(console['log'](t('skill.select.noneSelected')),process[_0xd8c1db(0x234)](0x0)),_0x2527cb(_0x1e6870);});});}function showHelp(){const _0x5a255b=a67_0x4572;console[_0x5a255b(0x20a)]('\x0a'+t(_0x5a255b(0x1ff))+'\x0a\x0a'+t(_0x5a255b(0x24a))+'\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t(_0x5a255b(0x242))+_0x5a255b(0x1f4)+t('skill.help.installInteractive')+_0x5a255b(0x209)+t(_0x5a255b(0x224))+_0x5a255b(0x1e8)+t(_0x5a255b(0x1eb))+_0x5a255b(0x20c)+t('skill.help.installWithBff')+'\x0a\x0a'+t(_0x5a255b(0x1f8))+'\x0a'+t(_0x5a255b(0x20e))+'\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a'+t(_0x5a255b(0x1ee))+'\x0a\x0a'+t(_0x5a255b(0x239))+_0x5a255b(0x1fa)+t(_0x5a255b(0x224))+'\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20'+t('skill.help.installAll')+_0x5a255b(0x251)+t('skill.help.installAll')+'\x0a\x0a'+t(_0x5a255b(0x24d))+'\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20cursor\x20--dangerously-bff-save\x0a\x0a'+t(_0x5a255b(0x212))+'\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--cline\x20\x20\x20\x20\x20\x20\x20\x20Cline\x20IDE\x20(.cline/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'+t('skill.help.agentDesc')+_0x5a255b(0x21a)+t(_0x5a255b(0x219))+'\x0a\x0a'+t(_0x5a255b(0x257))+'\x0a'+t(_0x5a255b(0x23b))+'\x0a\x0a'+t(_0x5a255b(0x23c))+'\x0a'+t(_0x5a255b(0x1f6))+'\x0a\x0a'+t(_0x5a255b(0x22b))+_0x5a255b(0x228)+t(_0x5a255b(0x223))+_0x5a255b(0x214)+t('skill.help.exampleDirectDesc')+_0x5a255b(0x21c)+t(_0x5a255b(0x24c))+_0x5a255b(0x24b)+t(_0x5a255b(0x236))+'\x0a\x0a'+t(_0x5a255b(0x237))+'\x0a'+t(_0x5a255b(0x23d))+'\x0a\x0a'+t(_0x5a255b(0x23a))+'\x0a\x20\x20.lovrabet/skill/.shared/guides/01-typescript-sdk/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/04-troubleshooting/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 installSkill(_0x365166,_0x3fd79b){const _0x14d77e=a67_0x4572,_0x5724ea=process['cwd'](),_0x313282=resolve(__dirname,_0x14d77e(0x21d));let _0xf74c28=[];!_0x365166?_0xf74c28=await selectIDEs():_0xf74c28=[_0x365166];_0xf74c28[_0x14d77e(0x1f3)](_0x14d77e(0x231))&&(_0xf74c28=[...ALL_CORE_IDES,_0x14d77e(0x1e7)]);const _0x10aeb0=[];for(const _0x2bc55e of _0xf74c28){if(_0x2bc55e===_0x14d77e(0x1e7))_0x10aeb0[_0x14d77e(0x233)]('agent');else{if(_0x2bc55e==='all')continue;else IDE_CONFIGS[_0x2bc55e]?_0x10aeb0['push'](_0x2bc55e):(console[_0x14d77e(0x20a)](t(_0x14d77e(0x220),{'ide':_0x2bc55e})),_0x10aeb0[_0x14d77e(0x233)](_0x14d77e(0x1e7)));}}_0x10aeb0[_0x14d77e(0x20f)]===0x0&&(console['log'](t(_0x14d77e(0x1ec))),process[_0x14d77e(0x234)](0x0));const _0xb3eb60=_0x3fd79b&&_0x3fd79b[_0x14d77e(0x20f)]>0x0;console[_0x14d77e(0x20a)](_0xb3eb60?t(_0x14d77e(0x22e)):t(_0x14d77e(0x227)));let _0x4da2d6;try{_0x4da2d6=await fetchGuidesFromCDN(_0xb3eb60),console[_0x14d77e(0x20a)](t(_0x14d77e(0x208),{'count':Object[_0x14d77e(0x245)](_0x4da2d6[_0x14d77e(0x235)])[_0x14d77e(0x20f)]}));}catch(_0x101772){console['warn'](t(_0x14d77e(0x22a),{'error':_0x101772 instanceof Error?_0x101772[_0x14d77e(0x23e)]:String(_0x101772)}));}let _0x16a04e=0x0;for(const _0x446805 of _0x10aeb0){try{const _0x381c1b=_0x446805===_0x14d77e(0x1e7)?t(_0x14d77e(0x254)):IDE_CONFIGS[_0x446805]?.[_0x14d77e(0x252)]||_0x446805;console[_0x14d77e(0x20a)](t(_0x14d77e(0x23f),{'name':_0x381c1b}));const _0xf35e5e=_0x446805===_0x14d77e(0x1e7)?undefined:IDE_CONFIGS[_0x446805],_0x2615e2=await installSingleIDE(_0x446805,_0xf35e5e,_0x5724ea,_0x313282,_0x4da2d6,_0x3fd79b);_0x16a04e+=_0x2615e2;if(_0xf35e5e?.[_0x14d77e(0x210)])for(const _0x3b123e of _0xf35e5e[_0x14d77e(0x210)]){const _0x15a417=_0xf35e5e[_0x14d77e(0x247)]?.[_0x14d77e(0x1fb)](_0x3b8a2c=>_0x3b8a2c[_0x14d77e(0x255)][_0x14d77e(0x22d)](_0x3b123e+'/'))??![];_0x15a417?console['log'](t(_0x14d77e(0x1e9),{'path':_0x3b123e})):console[_0x14d77e(0x20a)](t('skill.installing.created',{'path':_0x3b123e}));}if(_0xf35e5e?.[_0x14d77e(0x247)])for(const _0x5b7e0b of _0xf35e5e['files']){console['log'](t('skill.installing.created',{'path':_0x5b7e0b[_0x14d77e(0x255)]}));}}catch(_0x429215){console[_0x14d77e(0x206)](t('skill.error.installFailed',{'ide':_0x446805,'error':_0x429215 instanceof Error?_0x429215['message']:String(_0x429215)}));}}_0x4da2d6&&writeGuidesToProject(_0x4da2d6,_0x5724ea,'.lovrabet/skill/.shared/guides',_0x3fd79b);const _0x542256={'version':_0x14d77e(0x21e),'installedAt':new Date()[_0x14d77e(0x229)](),'platforms':_0x10aeb0},_0x2df489=join(_0x5724ea,'.lovrabet/skill-manifest.json'),_0x6544f4=join(_0x5724ea,_0x14d77e(0x248));await copyDir(_0x6544f4,_0x6544f4),writeFileSync(_0x2df489,JSON[_0x14d77e(0x217)](_0x542256,null,0x2),_0x14d77e(0x20b)),console[_0x14d77e(0x20a)](t(_0x14d77e(0x1fc))),console[_0x14d77e(0x20a)](t(_0x14d77e(0x216),{'count':_0x16a04e})),console[_0x14d77e(0x20a)](t(_0x14d77e(0x230))),console['log'](t('skill.done.guidesPath')),logger['info'](_0x14d77e(0x1f7),_0x14d77e(0x225),{'projectRoot':_0x5724ea,'ides':_0x10aeb0,'foldersCount':_0x16a04e});}
|
|
1
|
+
(function(_0x4f9735,_0x605349){const _0x595209=a65_0x3990,_0x5868d6=_0x4f9735();while(!![]){try{const _0x5a0237=parseInt(_0x595209(0x1fc))/0x1*(-parseInt(_0x595209(0x212))/0x2)+parseInt(_0x595209(0x21d))/0x3+parseInt(_0x595209(0x1db))/0x4*(parseInt(_0x595209(0x20c))/0x5)+parseInt(_0x595209(0x1f0))/0x6+-parseInt(_0x595209(0x223))/0x7*(parseInt(_0x595209(0x1cd))/0x8)+-parseInt(_0x595209(0x1e2))/0x9*(-parseInt(_0x595209(0x1dc))/0xa)+-parseInt(_0x595209(0x1f6))/0xb;if(_0x5a0237===_0x605349)break;else _0x5868d6['push'](_0x5868d6['shift']());}catch(_0x63784b){_0x5868d6['push'](_0x5868d6['shift']());}}}(a65_0x59df,0x23a05));import{writeFileSync}from'node:fs';function a65_0x59df(){const _0x5e4718=['skill.done.success','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a','toISOString','skill.error.noValidIDE','798204oGliyP','10spnpwZ','安装成功','setLogPath','不支持的命令:\x20','argv','agent','1188081exLdRg','--help','log','split','skill.help.examples','\x20\x200.\x20','skill.installing.createdDir','some','\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.installing.ide','.lovrabet/skill-manifest.json','skill.installing.createdManifest','skill.generic','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20','1108938hzImGV','skill.help.skillContents','exit','folders','skill.help.guidesLocationTitle','2.0.0','1290355aBqMsN','(empty)','skill','description','skill.select.installAll','skill.errorHint.exampleInteractive','1tkXnhH','skill.errorHint.exampleDirect','trim','skill.cdn.fetchSuccess','name','skill.help.showHelp','../../cdn-source/skills','forEach','skill.cdn.fetchFailed','skill.error.installFailed','skill.help.afterInstallList','skill.installing.created','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a','\x0a\x20\x20.lovrabet/skill/.shared/guides/01-typescript-sdk/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/04-troubleshooting/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','skill.select.cancel','skill.errorHint.installDirect','5RQwwdJ','skill.select.cancelled','skill.help.title','skill.errorHint.showHelp','skill.select.noneSelected','-$1','490954vxoCRR','cwd','files','skill.help.bffWorkflow','\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20','length','stdin','\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','push','skill.help.installMethods','skill.help.agentDesc','36864kEoJPi','skill.help.interactiveKeys','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a','\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--cline\x20\x20\x20\x20\x20\x20\x20\x20Cline\x20IDE\x20(.cline/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','skill-install','skill.done.guidesLocation','161yPykRP','\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','entries','path','all','skill.help.bffOption','.lovrabet','from','includes','skill.help.afterInstall','skill.select.title','skill.select.inputHint','close','stdout','skill.help.options','.lovrabet/skill/.shared/guides','replace','quit','skill.errorHint.installInteractive','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20cursor\x20--dangerously-bff-save\x0a\x0a','message','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20','startsWith','skill.help.installAll','skill.help.usage','skill.help.exampleInteractive','skill.help.installWithBff','skill.error.unsupportedCommand','\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.help.skillContentsList','6944kAMJNY','skill.help.exampleAllDesc','error','\x20\x20q.\x20','slice','skill.help.allDesc','help','skill.help.installDirect','skill.errorHint.availableCommands','warn'];a65_0x59df=function(){return _0x5e4718;};return a65_0x59df();}import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,CORE_IDE_LIST,ALL_CORE_IDES}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a65_0x380d23 from'../i18n/index.js';const t=a65_0x380d23['t']['bind'](a65_0x380d23),__dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x3e140a){const _0x1a494f=a65_0x3990,_0x1704e3=[];for(const [_0x10ae57,_0x5bb84e]of Object[_0x1a494f(0x225)](_0x3e140a)){if(_0x5bb84e===!![]){const _0x34b2ab=_0x10ae57[_0x1a494f(0x233)](/([A-Z])/g,_0x1a494f(0x211))['toLowerCase']();_0x1704e3[_0x1a494f(0x21a)](_0x34b2ab);}}return _0x1704e3;}export function parseDynamicFlags(){const _0x439d4c=a65_0x3990,_0x23bc56=[];for(let _0x32e7fe=0x3;_0x32e7fe<process[_0x439d4c(0x1e0)][_0x439d4c(0x217)];_0x32e7fe++){const _0x57b28f=process[_0x439d4c(0x1e0)][_0x32e7fe];if(_0x57b28f&&_0x57b28f[_0x439d4c(0x1c5)]('--')){const _0x12cb03=_0x57b28f[_0x439d4c(0x1d1)](0x2);_0x12cb03&&!_0x12cb03[_0x439d4c(0x22b)]('=')&&_0x23bc56['push'](_0x12cb03);}}return _0x23bc56;}export function getAllProvidedFlags(_0x65727){const _0x233542=a65_0x3990,_0x178c9f=camelCaseFlagsToKebab(_0x65727),_0xc7be38=parseDynamicFlags(),_0x3faff5=new Set([..._0x178c9f,..._0xc7be38]);return Array[_0x233542(0x22a)](_0x3faff5);}export async function skillsCommand(_0x4f6967,_0x59a5fb,_0x4fe376){const _0x3c9402=a65_0x3990;logger[_0x3c9402(0x1de)](process[_0x3c9402(0x213)]());if(_0x4fe376?.[_0x3c9402(0x1d3)]||_0x4f6967===_0x3c9402(0x1e3)){showHelp();return;}_0x4f6967!=='install'&&(console['error'](t(_0x3c9402(0x1ca),{'cmd':_0x4f6967||_0x3c9402(0x1f7)})),console['log'](t(_0x3c9402(0x1d5))),console[_0x3c9402(0x1e4)](t(_0x3c9402(0x1c1))),console[_0x3c9402(0x1e4)](t(_0x3c9402(0x20b))),console[_0x3c9402(0x1e4)](t(_0x3c9402(0x20f))),console[_0x3c9402(0x1e4)](t('skill.errorHint.usageExamples')),console[_0x3c9402(0x1e4)](t(_0x3c9402(0x1fb))),console[_0x3c9402(0x1e4)](t(_0x3c9402(0x1fd))),logger[_0x3c9402(0x1cf)](_0x3c9402(0x1f8),_0x3c9402(0x1df)+_0x4f6967),process['exit'](0x1));let _0x230f63=_0x59a5fb?.[0x0];const _0x2f5efb=getAllProvidedFlags(_0x4fe376??{});_0x230f63?.[_0x3c9402(0x1c5)]('--')&&(_0x230f63=undefined),await installSkill(_0x230f63??_0x3c9402(0x1e1),_0x2f5efb);}async function selectIDEs(){const _0xda4233=a65_0x3990;return console[_0xda4233(0x1e4)](t(_0xda4233(0x22d))),CORE_IDE_LIST[_0xda4233(0x203)]((_0x494d7d,_0x4baad6)=>{const _0x3392f8=_0xda4233;console[_0x3392f8(0x1e4)]('\x20\x20'+(_0x4baad6+0x1)+'.\x20'+IDE_CONFIGS[_0x494d7d][_0x3392f8(0x200)]+'\x20-\x20'+IDE_CONFIGS[_0x494d7d][_0x3392f8(0x1f9)]);}),console[_0xda4233(0x1e4)](_0xda4233(0x1e7)+t(_0xda4233(0x1fa))),console[_0xda4233(0x1e4)](_0xda4233(0x1d0)+t(_0xda4233(0x20a))+'\x0a'),console['log'](t('skill.select.inputFormat')),console['log'](t(_0xda4233(0x22e))),new Promise(_0x3cf075=>{const _0x4bc9e0=_0xda4233,_0x266ec3=createInterface({'input':process[_0x4bc9e0(0x218)],'output':process[_0x4bc9e0(0x230)]});_0x266ec3['question'](t('skill.select.prompt'),_0x2f40e0=>{const _0x4adcf7=_0x4bc9e0;_0x266ec3[_0x4adcf7(0x22f)]();const _0x401c57=_0x2f40e0[_0x4adcf7(0x1fe)]()['toLowerCase']();(_0x401c57==='q'||_0x401c57===_0x4adcf7(0x1c0)||_0x401c57==='exit')&&(console[_0x4adcf7(0x1e4)](t(_0x4adcf7(0x20d))),process[_0x4adcf7(0x1f2)](0x0));if(_0x401c57==='0'||_0x401c57===_0x4adcf7(0x227)){_0x3cf075([_0x4adcf7(0x227)]);return;}const _0x179391=_0x401c57[_0x4adcf7(0x1e5)](/\s+/)['filter'](Boolean),_0x58e2b7=[];for(const _0x266115 of _0x179391){const _0x1ff47b=parseInt(_0x266115,0xa);if(!isNaN(_0x1ff47b)&&_0x1ff47b>=0x1&&_0x1ff47b<=CORE_IDE_LIST[_0x4adcf7(0x217)]){const _0x28b9a8=CORE_IDE_LIST[_0x1ff47b-0x1];_0x28b9a8&&!_0x58e2b7['includes'](_0x28b9a8)&&_0x58e2b7['push'](_0x28b9a8);}}_0x58e2b7[_0x4adcf7(0x217)]===0x0&&(console[_0x4adcf7(0x1e4)](t(_0x4adcf7(0x210))),process[_0x4adcf7(0x1f2)](0x0)),_0x3cf075(_0x58e2b7);});});}function showHelp(){const _0x4e706b=a65_0x3990;console['log']('\x0a'+t(_0x4e706b(0x20e))+'\x0a\x0a'+t(_0x4e706b(0x1c7))+_0x4e706b(0x224)+t(_0x4e706b(0x201))+'\x0a\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t('skill.help.installInteractive')+_0x4e706b(0x1cb)+t(_0x4e706b(0x1d4))+_0x4e706b(0x1ea)+t(_0x4e706b(0x1c6))+_0x4e706b(0x216)+t(_0x4e706b(0x1c9))+'\x0a\x0a'+t(_0x4e706b(0x21b))+'\x0a'+t('skill.help.interactiveSelect')+_0x4e706b(0x1d8)+t(_0x4e706b(0x21e))+'\x0a\x0a'+t('skill.help.directInstall')+_0x4e706b(0x1ef)+t('skill.help.installDirect')+_0x4e706b(0x1c4)+t('skill.help.installAll')+'\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'+t('skill.help.installAll')+'\x0a\x0a'+t(_0x4e706b(0x215))+_0x4e706b(0x1c2)+t('skill.help.supportedIDEs')+_0x4e706b(0x220)+t(_0x4e706b(0x21c))+_0x4e706b(0x219)+t(_0x4e706b(0x1d2))+'\x0a\x0a'+t(_0x4e706b(0x231))+'\x0a'+t(_0x4e706b(0x228))+'\x0a\x0a'+t(_0x4e706b(0x1f1))+'\x0a'+t(_0x4e706b(0x1cc))+'\x0a\x0a'+t(_0x4e706b(0x1e6))+'\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a'+t(_0x4e706b(0x1c8))+_0x4e706b(0x208)+t('skill.help.exampleDirectDesc')+_0x4e706b(0x21f)+t('skill.help.exampleBffDesc')+'\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a'+t(_0x4e706b(0x1ce))+'\x0a\x0a'+t(_0x4e706b(0x22c))+'\x0a'+t(_0x4e706b(0x206))+'\x0a\x0a'+t(_0x4e706b(0x1f4))+_0x4e706b(0x209));}function a65_0x3990(_0x296632,_0x360361){_0x296632=_0x296632-0x1c0;const _0x59df5f=a65_0x59df();let _0x39900f=_0x59df5f[_0x296632];return _0x39900f;}async function installSkill(_0x365c29,_0x26ed1f){const _0x52d6a8=a65_0x3990,_0x428742=process[_0x52d6a8(0x213)](),_0x1e6c7d=resolve(__dirname,_0x52d6a8(0x202));let _0x38f7df=[];!_0x365c29?_0x38f7df=await selectIDEs():_0x38f7df=[_0x365c29];_0x38f7df[_0x52d6a8(0x22b)](_0x52d6a8(0x227))&&(_0x38f7df=[...ALL_CORE_IDES,_0x52d6a8(0x1e1)]);const _0x4abc46=[];for(const _0x2db4e4 of _0x38f7df){if(_0x2db4e4===_0x52d6a8(0x1e1))_0x4abc46[_0x52d6a8(0x21a)]('agent');else{if(_0x2db4e4===_0x52d6a8(0x227))continue;else IDE_CONFIGS[_0x2db4e4]?_0x4abc46[_0x52d6a8(0x21a)](_0x2db4e4):(console[_0x52d6a8(0x1e4)](t('skill.error.unknownPlatform',{'ide':_0x2db4e4})),_0x4abc46['push']('agent'));}}_0x4abc46['length']===0x0&&(console['log'](t(_0x52d6a8(0x1da))),process['exit'](0x0));const _0x2a5f9c=_0x26ed1f&&_0x26ed1f[_0x52d6a8(0x217)]>0x0;console[_0x52d6a8(0x1e4)](_0x2a5f9c?t('skill.cdn.fetchingExtend'):t('skill.cdn.fetching'));let _0x237eed;try{_0x237eed=await fetchGuidesFromCDN(_0x2a5f9c),console[_0x52d6a8(0x1e4)](t(_0x52d6a8(0x1ff),{'count':Object['keys'](_0x237eed['guides'])[_0x52d6a8(0x217)]}));}catch(_0x4e09fe){console[_0x52d6a8(0x1d6)](t(_0x52d6a8(0x204),{'error':_0x4e09fe instanceof Error?_0x4e09fe['message']:String(_0x4e09fe)}));}let _0x9eced1=0x0;for(const _0x3c6227 of _0x4abc46){try{const _0x47211a=_0x3c6227===_0x52d6a8(0x1e1)?t(_0x52d6a8(0x1ee)):IDE_CONFIGS[_0x3c6227]?.['name']||_0x3c6227;console[_0x52d6a8(0x1e4)](t(_0x52d6a8(0x1eb),{'name':_0x47211a}));const _0x52480a=_0x3c6227===_0x52d6a8(0x1e1)?undefined:IDE_CONFIGS[_0x3c6227],_0x17a272=await installSingleIDE(_0x3c6227,_0x52480a,_0x428742,_0x1e6c7d,_0x237eed,_0x26ed1f);_0x9eced1+=_0x17a272;if(_0x52480a?.[_0x52d6a8(0x1f3)])for(const _0x3584df of _0x52480a['folders']){const _0x521318=_0x52480a[_0x52d6a8(0x214)]?.[_0x52d6a8(0x1e9)](_0x4ccb74=>_0x4ccb74['path']['startsWith'](_0x3584df+'/'))??![];_0x521318?console[_0x52d6a8(0x1e4)](t(_0x52d6a8(0x1e8),{'path':_0x3584df})):console[_0x52d6a8(0x1e4)](t('skill.installing.created',{'path':_0x3584df}));}if(_0x52480a?.[_0x52d6a8(0x214)])for(const _0x55ec08 of _0x52480a['files']){console['log'](t(_0x52d6a8(0x207),{'path':_0x55ec08[_0x52d6a8(0x226)]}));}}catch(_0x28214b){console['error'](t(_0x52d6a8(0x205),{'ide':_0x3c6227,'error':_0x28214b instanceof Error?_0x28214b[_0x52d6a8(0x1c3)]:String(_0x28214b)}));}}_0x237eed&&writeGuidesToProject(_0x237eed,_0x428742,_0x52d6a8(0x232),_0x26ed1f);const _0x4049ef={'version':_0x52d6a8(0x1f5),'installedAt':new Date()[_0x52d6a8(0x1d9)](),'platforms':_0x4abc46},_0x587274=join(_0x428742,_0x52d6a8(0x1ec)),_0x1b6cb4=join(_0x428742,_0x52d6a8(0x229));await copyDir(_0x1b6cb4,_0x1b6cb4),writeFileSync(_0x587274,JSON['stringify'](_0x4049ef,null,0x2),'utf-8'),console[_0x52d6a8(0x1e4)](t(_0x52d6a8(0x1ed))),console['log'](t(_0x52d6a8(0x1d7),{'count':_0x9eced1})),console[_0x52d6a8(0x1e4)](t(_0x52d6a8(0x222))),console[_0x52d6a8(0x1e4)](t('skill.done.guidesPath')),logger['info'](_0x52d6a8(0x221),_0x52d6a8(0x1dd),{'projectRoot':_0x428742,'ides':_0x4abc46,'foldersCount':_0x9eced1});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x3459c2=a66_0x4722;(function(_0x1e507d,_0x426cf8){const _0x4a156d=a66_0x4722,_0x214810=_0x1e507d();while(!![]){try{const _0x4aa8e1=parseInt(_0x4a156d(0xe2))/0x1+-parseInt(_0x4a156d(0xe8))/0x2+parseInt(_0x4a156d(0xd8))/0x3*(-parseInt(_0x4a156d(0xcc))/0x4)+-parseInt(_0x4a156d(0xe4))/0x5+parseInt(_0x4a156d(0xdc))/0x6*(-parseInt(_0x4a156d(0xeb))/0x7)+-parseInt(_0x4a156d(0xe1))/0x8+parseInt(_0x4a156d(0xd2))/0x9;if(_0x4aa8e1===_0x426cf8)break;else _0x214810['push'](_0x214810['shift']());}catch(_0x41b457){_0x214810['push'](_0x214810['shift']());}}}(a66_0x440c,0x7e795));import{writeFileSync,existsSync,mkdirSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';function a66_0x4722(_0x3894df,_0x511862){_0x3894df=_0x3894df-0xcc;const _0x440c45=a66_0x440c();let _0x4722ca=_0x440c45[_0x3894df];return _0x4722ca;}import{dirname}from'node:path';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';function a66_0x440c(){const _0x551985=['2044086UnqRPY','2.0.0','\x20\x20✓\x20','message','skill.error.installFailed','972360ttdreZ','882188iwZFaJ','skill-install-non-interactive','2510335NJBjQo','toISOString','cwd','.lovrabet/skill-manifest.json','563928bCkfoB','length','skill.error.unknownIDE','14zlSXzN','431180ZOLcJq','skill.cdn.fetchFailed','skill.done.success','setLogPath','warn','bind','15855858XYzxFX','安装成功','../../cdn-source/skills','skill.cdn.fetching','skill.done.guidesPathInline','log','15IejNEO','开始安装技能包','info','utf-8'];a66_0x440c=function(){return _0x551985;};return a66_0x440c();}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a66_0x12ef09 from'../i18n/index.js';const t=a66_0x12ef09['t'][a66_0x3459c2(0xd1)](a66_0x12ef09),__dirname=dirname(fileURLToPath(import.meta.url));export async function installSkillsNonInteractive(_0x549108,_0x5c09c8,_0x471746=process[a66_0x3459c2(0xe6)]()){const _0x3e6485=a66_0x3459c2,_0xf128a9=resolve(__dirname,_0x3e6485(0xd4));logger[_0x3e6485(0xcf)](_0x471746),logger[_0x3e6485(0xda)](_0x3e6485(0xe3),_0x3e6485(0xd9),{'ides':_0x549108});const _0x59e099=join(_0x471746,'.lovrabet');!existsSync(_0x59e099)&&mkdirSync(_0x59e099,{'recursive':!![]});const _0x32aebd=_0x5c09c8&&_0x5c09c8[_0x3e6485(0xe9)]>0x0;console[_0x3e6485(0xd7)](_0x32aebd?t('skill.cdn.fetchingExtend'):t(_0x3e6485(0xd5)));let _0x42ed5c;try{_0x42ed5c=await fetchGuidesFromCDN(_0x32aebd),console[_0x3e6485(0xd7)](t('skill.cdn.fetchSuccess',{'count':Object['keys'](_0x42ed5c['guides'])[_0x3e6485(0xe9)]}));}catch(_0x121a6a){console[_0x3e6485(0xd0)](t(_0x3e6485(0xcd),{'error':_0x121a6a instanceof Error?_0x121a6a[_0x3e6485(0xdf)]:String(_0x121a6a)}));}let _0xda623a=0x0;for(const _0x41e1dd of _0x549108){try{const _0x24546c=IDE_CONFIGS[_0x41e1dd];if(!_0x24546c){console[_0x3e6485(0xd0)](t(_0x3e6485(0xea),{'ide':_0x41e1dd}));continue;}const _0x255ff0=await installSingleIDE(_0x41e1dd,_0x24546c,_0x471746,_0xf128a9,_0x42ed5c,_0x5c09c8);_0xda623a+=_0x255ff0,console[_0x3e6485(0xd7)](_0x3e6485(0xde)+(_0x24546c['name']||_0x41e1dd));}catch(_0x1309e9){console['error'](t(_0x3e6485(0xe0),{'ide':_0x41e1dd,'error':_0x1309e9 instanceof Error?_0x1309e9[_0x3e6485(0xdf)]:String(_0x1309e9)}));}}_0x42ed5c&&writeGuidesToProject(_0x42ed5c,_0x471746,'.lovrabet/skill/.shared/guides',_0x5c09c8);const _0x3be265={'version':_0x3e6485(0xdd),'installedAt':new Date()[_0x3e6485(0xe5)](),'platforms':_0x549108},_0x157af5=join(_0x471746,_0x3e6485(0xe7));writeFileSync(_0x157af5,JSON['stringify'](_0x3be265,null,0x2),_0x3e6485(0xdb)),logger[_0x3e6485(0xda)](_0x3e6485(0xe3),_0x3e6485(0xd3),{'projectRoot':_0x471746,'ides':_0x549108,'foldersCount':_0xda623a}),console[_0x3e6485(0xd7)](t(_0x3e6485(0xce),{'count':_0xda623a})),console['log'](t(_0x3e6485(0xd6)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa157b5,_0x3331d1){const _0x53a5d4=a67_0x46bf,_0x2a5ba8=_0xa157b5();while(!![]){try{const _0x5e943b=-parseInt(_0x53a5d4(0x87))/0x1+-parseInt(_0x53a5d4(0x81))/0x2+-parseInt(_0x53a5d4(0x97))/0x3*(-parseInt(_0x53a5d4(0x8d))/0x4)+parseInt(_0x53a5d4(0x85))/0x5*(parseInt(_0x53a5d4(0x7c))/0x6)+-parseInt(_0x53a5d4(0x89))/0x7+parseInt(_0x53a5d4(0x91))/0x8+-parseInt(_0x53a5d4(0x90))/0x9*(-parseInt(_0x53a5d4(0x8e))/0xa);if(_0x5e943b===_0x3331d1)break;else _0x2a5ba8['push'](_0x2a5ba8['shift']());}catch(_0x4b3cbc){_0x2a5ba8['push'](_0x2a5ba8['shift']());}}}(a67_0x50ec,0x1beee));import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{dirname,join}from'node:path';import{writeSkillFile,appendExtendContents}from'../utils/guides-cdn.js';export async function installSingleIDE(_0x106772,_0x37c3bf,_0xbc366f,_0xf29ab0,_0x43d19d,_0x4bccab){const _0x4e80bc=a67_0x46bf;let _0x3e6cba=0x0;const _0x349c53=_0x37c3bf?.['folders']??['.'+_0x106772];for(const _0x10b96e of _0x349c53){const _0x24a763=join(_0xbc366f,_0x10b96e),_0x181d78=_0x37c3bf?.[_0x4e80bc(0x7f)]?.['some'](_0x27224c=>_0x27224c[_0x4e80bc(0x84)][_0x4e80bc(0x98)](_0x10b96e+'/'))??![];_0x181d78?!existsSync(_0x24a763)&&(mkdirSync(_0x24a763,{'recursive':!![]}),_0x3e6cba++):!existsSync(_0x24a763)&&(writeFileSync(_0x24a763,'',_0x4e80bc(0x8c)),_0x3e6cba++);}if(_0x37c3bf?.[_0x4e80bc(0x7f)]){const _0x5aa6c7=_0x37c3bf[_0x4e80bc(0x93)]||_0x106772;for(const _0x4d40f9 of _0x37c3bf[_0x4e80bc(0x7f)]){const _0x247928=join(_0xbc366f,_0x4d40f9[_0x4e80bc(0x84)]);await createFileFromTemplate(_0x4d40f9,_0x247928,_0x5aa6c7,_0xf29ab0,_0x43d19d,_0x4bccab),_0x3e6cba++;}}return _0x3e6cba;}export async function createFileFromTemplate(_0x4144ad,_0x8b62b8,_0x2a8c25,_0xb5f4fe,_0x42a739,_0x1ae88b){const _0x15cdc0=a67_0x46bf,_0x5b9156=dirname(_0x8b62b8);!existsSync(_0x5b9156)&&mkdirSync(_0x5b9156,{'recursive':!![]});const _0x1fc22f=_0x4144ad[_0x15cdc0(0x83)]===_0x15cdc0(0x95);if(existsSync(_0x8b62b8)&&!_0x1fc22f)return;if(_0x4144ad[_0x15cdc0(0x83)]){const _0x1f9237=join(_0xb5f4fe,_0x4144ad['template']);if(existsSync(_0x1f9237)){let _0xb4d991=readFileSync(_0x1f9237,_0x15cdc0(0x8c));_0xb4d991=_0xb4d991[_0x15cdc0(0x8f)](/\{\{IDE_NAME\}\}/g,_0x2a8c25);_0x42a739&&_0x1fc22f&&(_0xb4d991=insertGuidesSection(_0xb4d991,_0x42a739,_0x1ae88b),_0xb4d991=appendExtendContents(_0xb4d991,_0x42a739,_0x1ae88b));writeFileSync(_0x8b62b8,_0xb4d991,_0x15cdc0(0x8c));return;}if(_0x42a739&&_0x1fc22f)try{writeSkillFile(_0x42a739,_0x8b62b8,_0x2a8c25,_0x1ae88b);return;}catch{}}writeFileSync(_0x8b62b8,'',_0x15cdc0(0x8c));}function insertGuidesSection(_0x31be29,_0x50a651,_0x97a226){const _0x2ef5dc=a67_0x46bf,_0x841ca5=_0x2ef5dc(0x8a),_0x20dc26=_0x31be29[_0x2ef5dc(0x88)](_0x841ca5);if(_0x20dc26===-0x1)return _0x31be29;const _0x504118=[],_0x267daa=Object['keys'](_0x50a651['guides'])[_0x2ef5dc(0x8b)]();for(const _0x4c4761 of _0x267daa){const _0x32ed17=_0x50a651[_0x2ef5dc(0x82)][_0x4c4761];if(!_0x32ed17)continue;if(/^0[1-6]-/[_0x2ef5dc(0x94)](_0x4c4761))continue;if(_0x32ed17[_0x2ef5dc(0x80)]&&_0x32ed17['requireFlags'][_0x2ef5dc(0x96)]>0x0){const _0x4b4619=_0x32ed17[_0x2ef5dc(0x80)]['some'](_0x3b3dd6=>_0x97a226?.[_0x2ef5dc(0x7e)](_0x3b3dd6));if(!_0x4b4619)continue;}const _0x494207=_0x32ed17['path'][_0x2ef5dc(0x8f)](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x504118[_0x2ef5dc(0x7d)]('|\x20`'+_0x494207+_0x2ef5dc(0x86)+_0x32ed17[_0x2ef5dc(0x92)]+'\x20|');}if(_0x504118['length']===0x0)return _0x31be29[_0x2ef5dc(0x8f)](_0x841ca5,'<!--\x20GUIDES_APPEND\x20-->');const _0x346d26=_0x504118['join']('\x0a');return _0x31be29['replace'](_0x841ca5,_0x346d26+'\x0a<!--\x20GUIDES_APPEND\x20-->');}function a67_0x46bf(_0x49b043,_0x4136ca){_0x49b043=_0x49b043-0x7c;const _0x50ec85=a67_0x50ec();let _0x46bf43=_0x50ec85[_0x49b043];return _0x46bf43;}function a67_0x50ec(){const _0x1045d5=['name','test','SKILL.md.tpl','length','483AnRKmr','startsWith','8940VtVRBw','push','includes','files','requireFlags','355524uOmfEz','guides','template','path','760NpCHaE','`\x20|\x20','83724NwfYev','indexOf','1170386opVKEv','<!--\x20GUIDES_APPEND\x20-->','sort','utf-8','3340OcnOIl','50qNHzvj','replace','3537pirbZW','1441744tlvbXq','title'];a67_0x50ec=function(){return _0x1045d5;};return a67_0x50ec();}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1217fa,_0x51814d){const _0x8244e7=a69_0x271e,_0x3be4f8=_0x1217fa();while(!![]){try{const _0x5bc0e2=parseInt(_0x8244e7(0xb4))/0x1*(-parseInt(_0x8244e7(0xa6))/0x2)+parseInt(_0x8244e7(0xaf))/0x3+-parseInt(_0x8244e7(0xad))/0x4+-parseInt(_0x8244e7(0xb6))/0x5*(parseInt(_0x8244e7(0xae))/0x6)+-parseInt(_0x8244e7(0xa1))/0x7*(parseInt(_0x8244e7(0xa2))/0x8)+parseInt(_0x8244e7(0xa5))/0x9+parseInt(_0x8244e7(0xa7))/0xa*(parseInt(_0x8244e7(0xb5))/0xb);if(_0x5bc0e2===_0x51814d)break;else _0x3be4f8['push'](_0x3be4f8['shift']());}catch(_0x18ef9d){_0x3be4f8['push'](_0x3be4f8['shift']());}}}(a69_0x1704,0x4f651));import{jsxs as a69_0x3a9dda,jsx as a69_0x1d5928}from'react/jsx-runtime';function a69_0x271e(_0x94468e,_0x374705){_0x94468e=_0x94468e-0xa1;const _0x1704df=a69_0x1704();let _0x271e91=_0x1704df[_0x94468e];return _0x271e91;}import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';export function IDESelector({ideList:_0x4f068d,title:_0x23abb9,selection:_0x2b1037}){const _0x3df494=a69_0x271e,{t:_0x2b7c5d}=useI18n(),{selectedIndexes:_0x23f9db,highlightIndex:_0x236af1,errorMsg:_0x5c0430}=_0x2b1037;return a69_0x3a9dda(Box,{'flexDirection':'column','marginTop':0x1,'children':[a69_0x1d5928(Box,{'children':a69_0x3a9dda(Text,{'color':_0x3df494(0xa4),'children':['*\x20',_0x23abb9]})}),_0x5c0430&&a69_0x1d5928(Box,{'marginTop':0x1,'children':a69_0x3a9dda(Text,{'color':'red','children':['✗\x20',_0x5c0430]})}),a69_0x3a9dda(Box,{'marginTop':0x1,'flexDirection':_0x3df494(0xab),'children':[a69_0x3a9dda(Text,{'bold':!![],'children':['*\x20',_0x2b7c5d('ui.ideSelector.title')]}),_0x4f068d['map']((_0x25d7a9,_0x56f338)=>{const _0x1fd840=_0x3df494,_0x21259d=_0x236af1===_0x56f338,_0x3afba3=_0x23f9db[_0x1fd840(0xb0)](_0x56f338);return a69_0x1d5928(Box,{'children':a69_0x3a9dda(Text,{'backgroundColor':_0x21259d?_0x1fd840(0xac):undefined,'color':_0x21259d?'white':undefined,'children':['\x20\x20',_0x3afba3?_0x1fd840(0xa9):'[\x20]','\x20',_0x25d7a9[_0x1fd840(0xa8)],'\x20',a69_0x3a9dda(Text,{'color':_0x21259d?_0x1fd840(0xaa):_0x1fd840(0xb1),'dimColor':!_0x21259d,'children':['-\x20',_0x25d7a9[_0x1fd840(0xb3)]]})]})},_0x25d7a9[_0x1fd840(0xa3)]);}),a69_0x1d5928(Box,{'marginTop':0x1,'children':a69_0x3a9dda(Text,{'color':_0x3df494(0xb1),'children':['\x20',_0x2b7c5d(_0x3df494(0xb2))]})})]})]});}export{useIDESelection}from'./useIDESelection.js';function a69_0x1704(){const _0x5437be=['5ShsWuD','7gyfHfB','4054224oAbpVb','key','cyan','2851911NPLsim','2eyWaMb','50nTwaMl','name','[✓]','white','column','blue','157516tAZDxQ','1633614XhNXGi','1618800hWooDh','has','gray','ui.ideSelector.hotkeys','description','272567VIEMSV','1231373ZGyrcu'];a69_0x1704=function(){return _0x5437be;};return a69_0x1704();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37fffd,_0x1513fa){const _0x48844e=a70_0x3d6c,_0x336b1b=_0x37fffd();while(!![]){try{const _0x31692d=-parseInt(_0x48844e(0xb4))/0x1*(-parseInt(_0x48844e(0xa8))/0x2)+-parseInt(_0x48844e(0xaf))/0x3+-parseInt(_0x48844e(0xae))/0x4+parseInt(_0x48844e(0xa9))/0x5*(parseInt(_0x48844e(0xb2))/0x6)+-parseInt(_0x48844e(0xad))/0x7+-parseInt(_0x48844e(0xac))/0x8+parseInt(_0x48844e(0xa7))/0x9;if(_0x31692d===_0x1513fa)break;else _0x336b1b['push'](_0x336b1b['shift']());}catch(_0x179872){_0x336b1b['push'](_0x336b1b['shift']());}}}(a70_0x309c,0xb1d67));import{useState,useCallback}from'react';function a70_0x309c(){const _0xc55be7=['1EYTaDb','map','has','key','filter','size','add','14435820nxrHvD','1860092jLHhZB','9705qqXlxs','delete','upArrow','5738136gzOORb','6220942BGzquO','1977044FFZwkb','3291198IIUlhQ','from','downArrow','4302HMwvuA','length'];a70_0x309c=function(){return _0xc55be7;};return a70_0x309c();}function a70_0x3d6c(_0x37c3c4,_0x2e3a13){_0x37c3c4=_0x37c3c4-0xa6;const _0x309c4f=a70_0x309c();let _0x3d6c1b=_0x309c4f[_0x37c3c4];return _0x3d6c1b;}export function useIDESelection({ideList:_0x14de8e,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x598df5=a70_0x3d6c,[_0x2e8e4a,_0x3ad35d]=useState(new Set(preselectedIDEs[_0x598df5(0xb5)](_0x24a39e=>_0x14de8e['findIndex'](_0x3d856b=>_0x3d856b[_0x598df5(0xb7)]===_0x24a39e))[_0x598df5(0xb8)](_0x3edca1=>_0x3edca1>=0x0))),[_0x3aff53,_0xcee33]=useState(0x0),[_0x26890a,_0x49aa07]=useState(''),_0x2aa974=useCallback(()=>{const _0x4cc409=_0x598df5;_0xcee33(_0x548fb4=>_0x548fb4>0x0?_0x548fb4-0x1:_0x14de8e[_0x4cc409(0xb3)]-0x1);},[_0x14de8e[_0x598df5(0xb3)]]),_0x105682=useCallback(()=>{_0xcee33(_0x6e93d5=>_0x6e93d5<_0x14de8e['length']-0x1?_0x6e93d5+0x1:0x0);},[_0x14de8e[_0x598df5(0xb3)]]),_0x24a25f=useCallback(()=>{if(!multiSelect){_0x3ad35d(new Set([_0x3aff53]));return;}_0x3ad35d(_0x10e897=>{const _0x385be6=a70_0x3d6c,_0x12e354=new Set(_0x10e897);return _0x12e354[_0x385be6(0xb6)](_0x3aff53)?_0x12e354[_0x385be6(0xaa)](_0x3aff53):_0x12e354[_0x385be6(0xa6)](_0x3aff53),_0x12e354;});},[_0x3aff53,multiSelect]),_0x4ed88a=useCallback(()=>{const _0x1bde63=_0x598df5;_0x3ad35d(new Set(_0x14de8e[_0x1bde63(0xb5)]((_0x5da2f1,_0x212d82)=>_0x212d82)));},[_0x14de8e]),_0x317dc3=useCallback(()=>{_0x3ad35d(_0x70796b=>{const _0x17fcd5=a70_0x3d6c,_0x249538=new Set();for(let _0xe082a3=0x0;_0xe082a3<_0x14de8e['length'];_0xe082a3++){!_0x70796b[_0x17fcd5(0xb6)](_0xe082a3)&&_0x249538[_0x17fcd5(0xa6)](_0xe082a3);}return _0x249538;});},[_0x14de8e]),_0x7a6bb2=useCallback(()=>{const _0x33c568=_0x598df5;return Array[_0x33c568(0xb0)](_0x2e8e4a)['map'](_0x493f51=>_0x14de8e[_0x493f51]?.['key'])[_0x33c568(0xb8)](_0x3b95f7=>_0x3b95f7!==undefined);},[_0x2e8e4a,_0x14de8e]),_0xf17c3=useCallback(()=>{const _0x5b7f4f=_0x598df5;return _0x2e8e4a[_0x5b7f4f(0xb9)]===_0x14de8e[_0x5b7f4f(0xb3)];},[_0x2e8e4a,_0x14de8e]),_0x1cd669=useCallback((_0x47e26a,_0x5897d3)=>{const _0x31e567=_0x598df5;if(_0x5897d3[_0x31e567(0xab)])return _0x2aa974(),!![];if(_0x5897d3[_0x31e567(0xb1)])return _0x105682(),!![];if(_0x47e26a==='\x20')return _0x24a25f(),!![];if(_0x47e26a==='a'||_0x47e26a==='A')return _0x4ed88a(),!![];if(_0x47e26a==='i'||_0x47e26a==='I'||_0x47e26a==='r'||_0x47e26a==='R')return _0x317dc3(),!![];return![];},[_0x2aa974,_0x105682,_0x24a25f,_0x4ed88a,_0x317dc3]);return{'selectedIndexes':_0x2e8e4a,'highlightIndex':_0x3aff53,'errorMsg':_0x26890a,'setErrorMsg':_0x49aa07,'handleKeyDown':_0x1cd669,'getSelectedIDEs':_0x7a6bb2,'isAllSelected':_0xf17c3,'toggleSelection':_0x24a25f,'selectAll':_0x4ed88a,'invertSelection':_0x317dc3,'moveHighlightUp':_0x2aa974,'moveHighlightDown':_0x105682};}
|