@lovrabet/cli 1.3.4-beta.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 -1
- 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 +1 -1
package/lib/mcp/McpInstallUI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24cc30,_0x13dd43){const _0x1132e3=a58_0x18e1,_0x2692ab=_0x24cc30();while(!![]){try{const _0x5a8093=parseInt(_0x1132e3(0x141))/0x1*(parseInt(_0x1132e3(0x13d))/0x2)+parseInt(_0x1132e3(0x13a))/0x3+-parseInt(_0x1132e3(0x13c))/0x4*(parseInt(_0x1132e3(0x15f))/0x5)+-parseInt(_0x1132e3(0x153))/0x6+parseInt(_0x1132e3(0x14f))/0x7*(parseInt(_0x1132e3(0x150))/0x8)+parseInt(_0x1132e3(0x140))/0x9+-parseInt(_0x1132e3(0x15c))/0xa;if(_0x5a8093===_0x13dd43)break;else _0x2692ab['push'](_0x2692ab['shift']());}catch(_0x4bad6d){_0x2692ab['push'](_0x2692ab['shift']());}}}(a58_0x1c9a,0x8c49c));import{jsx as a58_0x54e072,jsxs as a58_0x552cf8,Fragment as a58_0x3d058b}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';function a58_0x18e1(_0x30b08a,_0xfd2e44){_0x30b08a=_0x30b08a-0x135;const _0x1c9a56=a58_0x1c9a();let _0x18e1a2=_0x1c9a56[_0x30b08a];return _0x18e1a2;}import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';import{useI18n}from'../i18n/hooks.js';import a58_0x15bdc3 from'../i18n/index.js';export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x27c327=a58_0x18e1,{t:_0x96d810}=useI18n(),{exit:_0x1b9536}=useApp(),[_0x116dbb,_0x31235b]=useState(_0x27c327(0x16b)),[_0x479570,_0xb96b2d]=useState([]),[_0x327306,_0x1a4426]=useState([]),_0x4a15a8=useMemo(()=>[...Array[_0x27c327(0x14c)](MCP_IDES)['map'](_0x530167=>({'key':_0x530167,'name':IDE_CONFIGS[_0x530167][_0x27c327(0x14d)],'description':IDE_CONFIGS[_0x530167][_0x27c327(0x166)]})),{'key':'other','name':_0x96d810('mcp.ui.otherIDE'),'description':_0x96d810('mcp.ui.otherIDEDescription')}],[_0x96d810]),_0x3e4ebe=useIDESelection({'ideList':_0x4a15a8,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x5b7b74=_0x27c327;preselectedIDEs[_0x5b7b74(0x157)]>0x0&&_0x3e4ebe[_0x5b7b74(0x135)][_0x5b7b74(0x149)]>0x0&&_0x3cf7e1();},[]),useInput((_0x6bfc0f,_0x3c08e5)=>{const _0x442d28=_0x27c327;if(_0x116dbb===_0x442d28(0x16b)){if(_0x6bfc0f==='q'||_0x6bfc0f==='Q'){_0x1b9536();return;}if(_0x3c08e5[_0x442d28(0x168)]){if(_0x3e4ebe[_0x442d28(0x135)][_0x442d28(0x149)]===0x0){_0x3e4ebe[_0x442d28(0x136)](_0x96d810(_0x442d28(0x14a)));return;}_0x3cf7e1();return;}_0x3e4ebe[_0x442d28(0x163)](_0x6bfc0f,_0x3c08e5);}_0x116dbb===_0x442d28(0x15b)&&_0x1b9536();});async function _0x3cf7e1(){const _0xa73e5b=_0x27c327,_0x348e19=_0x3e4ebe[_0xa73e5b(0x154)]();_0xb96b2d([{'label':_0x96d810(_0xa73e5b(0x146)),'value':_0x96d810(_0xa73e5b(0x159),{'count':_0x3e4ebe['selectedIndexes'][_0xa73e5b(0x149)]})}]),_0x31235b(_0xa73e5b(0x161));const _0x48f44a=[];for(const _0x45de81 of _0x348e19){try{const _0x714f99=await configureMcp(_0x45de81);_0x48f44a[_0xa73e5b(0x151)]({'ide':_0x4a15a8[_0xa73e5b(0x158)](_0x2a8b7a=>_0x2a8b7a[_0xa73e5b(0x13f)]===_0x45de81)?.['name']||_0x45de81,'status':_0x714f99[_0xa73e5b(0x156)]?_0xa73e5b(0x15a):_0x714f99[_0xa73e5b(0x16a)]?_0xa73e5b(0x16a):_0xa73e5b(0x15d),'message':_0x714f99[_0xa73e5b(0x165)]});}catch(_0x368a39){_0x48f44a[_0xa73e5b(0x151)]({'ide':_0x4a15a8['find'](_0x1e4e6e=>_0x1e4e6e[_0xa73e5b(0x13f)]===_0x45de81)?.[_0xa73e5b(0x14d)]||_0x45de81,'status':_0xa73e5b(0x15d),'message':_0x368a39 instanceof Error?_0x368a39['message']:String(_0x368a39)});}}_0x1a4426(_0x48f44a),_0x31235b(_0xa73e5b(0x15b)),setTimeout(()=>{_0x1b9536();},0x1388);}return a58_0x552cf8(Box,{'flexDirection':_0x27c327(0x13b),'marginTop':0x1,'children':[_0x116dbb===_0x27c327(0x16b)&&a58_0x54e072(IDESelector,{'ideList':_0x4a15a8,'title':_0x96d810(_0x27c327(0x144)),'selection':_0x3e4ebe}),_0x116dbb===_0x27c327(0x161)&&a58_0x552cf8(a58_0x3d058b,{'children':[_0x479570['map']((_0xdff5f5,_0x3d857d)=>a58_0x552cf8(Box,{'children':[a58_0x552cf8(Text,{'color':_0x27c327(0x167),'children':['√\x20',_0xdff5f5[_0x27c327(0x14b)],':\x20']}),a58_0x54e072(Text,{'color':'cyan','children':_0xdff5f5[_0x27c327(0x162)]})]},_0x3d857d)),a58_0x54e072(Box,{'marginTop':0x1,'children':a58_0x54e072(Text,{'children':_0x96d810(_0x27c327(0x169))})})]}),_0x116dbb===_0x27c327(0x15b)&&a58_0x54e072(DoneStep,{'configResults':_0x327306})]});}function a58_0x1c9a(){const _0xb7dd6e=['432gYqbNB','push','mcp.ui.pressAnyKeyToExit','1851522BuRUxm','getSelectedIDEs','cwd','needsManualAction','length','find','mcp.ui.count','manual','done','5209900fBHjaQ','error','mcp.ui.completed','80845WnLsnK','yellow','configuring','value','handleKeyDown','white','message','description','green','return','mcp.ui.configuring','success','selecting','status','mcp.ui.partialManual','mcp.ui.unsupportedIDE','selectedIndexes','setErrorMsg','\x20\x20⚠️','cursor','other','3326304LebiPy','column','248PqgVFx','1362ISbAmM','red','key','6417297FlzTqI','540ShNkeU','\x20\x20✓','some','mcp.ui.title','gray','mcp.ui.selectedIDE','map','mcp.ui.manualRequired','size','mcp.ui.selectAtLeastOne','label','from','name','ide','28147IumMbf'];a58_0x1c9a=function(){return _0xb7dd6e;};return a58_0x1c9a();}function DoneStep({configResults:_0x30fba7}){const _0x13e53f=a58_0x18e1,{t:_0x94d390}=useI18n(),_0xdb9504=_0x30fba7['every'](_0x599b2a=>_0x599b2a[_0x13e53f(0x16c)]==='success'),_0x24f8b4=_0x30fba7[_0x13e53f(0x143)](_0x1df9c0=>_0x1df9c0[_0x13e53f(0x16c)]===_0x13e53f(0x15a)),_0x38085b=_0x30fba7[_0x13e53f(0x143)](_0x3da8e8=>_0x3da8e8[_0x13e53f(0x16c)]===_0x13e53f(0x15d));return a58_0x552cf8(a58_0x3d058b,{'children':[a58_0x54e072(Box,{'children':_0xdb9504?a58_0x54e072(Text,{'color':'green','children':_0x94d390(_0x13e53f(0x15e))}):_0x24f8b4?a58_0x54e072(Text,{'color':_0x13e53f(0x160),'children':_0x94d390(_0x13e53f(0x16d))}):_0x38085b?a58_0x54e072(Text,{'color':_0x13e53f(0x13e),'children':_0x94d390('mcp.ui.failed')}):a58_0x54e072(Text,{'color':_0x13e53f(0x160),'children':_0x94d390(_0x13e53f(0x148))})}),_0x30fba7[_0x13e53f(0x147)]((_0x2ec30b,_0x2c868a)=>a58_0x552cf8(Box,{'flexDirection':_0x13e53f(0x13b),'children':[a58_0x552cf8(Text,{'color':_0x2ec30b[_0x13e53f(0x16c)]===_0x13e53f(0x16a)?_0x13e53f(0x167):_0x2ec30b[_0x13e53f(0x16c)]==='manual'?_0x13e53f(0x160):_0x13e53f(0x13e),'children':[_0x2ec30b[_0x13e53f(0x16c)]===_0x13e53f(0x16a)?_0x13e53f(0x142):_0x2ec30b[_0x13e53f(0x16c)]===_0x13e53f(0x15a)?_0x13e53f(0x137):'\x20\x20✗','\x20',_0x2ec30b[_0x13e53f(0x14e)],':']}),a58_0x54e072(Text,{'color':_0x2ec30b[_0x13e53f(0x16c)]===_0x13e53f(0x16a)?_0x13e53f(0x164):_0x2ec30b['status']===_0x13e53f(0x15a)?_0x13e53f(0x160):_0x13e53f(0x13e),'children':_0x2ec30b[_0x13e53f(0x165)]})]},_0x2c868a)),a58_0x54e072(Box,{'marginTop':0x1,'children':a58_0x54e072(Text,{'color':_0x13e53f(0x145),'children':_0x94d390(_0x13e53f(0x152))})})]});}async function configureMcp(_0xcbf66f){const _0x35ae2c=a58_0x18e1,_0x3df87f=process[_0x35ae2c(0x155)]();switch(_0xcbf66f){case _0x35ae2c(0x138):return configureCursorMcp(_0x3df87f);case'claude':return configureClaudeMcp(_0x3df87f);case _0x35ae2c(0x139):return showOtherMcpGuide(_0x3df87f);default:throw new Error(a58_0x15bdc3['t'](_0x35ae2c(0x16e),{'ide':_0xcbf66f}));}}
|
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a59_0x5cd9(_0x601ed8,_0x17fcda){_0x601ed8=_0x601ed8-0x181;const _0x4392b1=a59_0x4392();let _0x5cd91b=_0x4392b1[_0x601ed8];return _0x5cd91b;}function a59_0x4392(){const _0x11ca6c=['1027iFHyow','628KaeDHb','6fAbEVs','1768355iunvre','4348696jAstHy','440772WXWYwc','6200XeNTKk','success','17067dSWzKm','600488MHBDBj','\x0a📋\x20','81ykAKBk','error','mcp.claudeConfig.error','20pzhEcD','5377463NMxoGI','exit','message','157YKksga'];a59_0x4392=function(){return _0x11ca6c;};return a59_0x4392();}(function(_0xf6f3e0,_0x143d35){const _0x5207d9=a59_0x5cd9,_0x2873ae=_0xf6f3e0();while(!![]){try{const _0x21da78=-parseInt(_0x5207d9(0x184))/0x1*(parseInt(_0x5207d9(0x18b))/0x2)+parseInt(_0x5207d9(0x18d))/0x3*(-parseInt(_0x5207d9(0x186))/0x4)+-parseInt(_0x5207d9(0x188))/0x5+parseInt(_0x5207d9(0x187))/0x6*(parseInt(_0x5207d9(0x181))/0x7)+parseInt(_0x5207d9(0x18e))/0x8*(-parseInt(_0x5207d9(0x190))/0x9)+-parseInt(_0x5207d9(0x193))/0xa*(parseInt(_0x5207d9(0x189))/0xb)+-parseInt(_0x5207d9(0x18a))/0xc*(-parseInt(_0x5207d9(0x185))/0xd);if(_0x21da78===_0x143d35)break;else _0x2873ae['push'](_0x2873ae['shift']());}catch(_0x5d2dc6){_0x2873ae['push'](_0x2873ae['shift']());}}}(a59_0x4392,0x72cb1));import{configureClaudeMcp as a59_0x3e91cd}from'./mcp-installer.js';import a59_0x443b47 from'../i18n/index.js';export async function configureClaudeMcp(){const _0x4a3e11=a59_0x5cd9,_0x1c97b7=process['cwd'](),_0x23bd70=a59_0x3e91cd(_0x1c97b7);_0x23bd70[_0x4a3e11(0x18c)]?(console['log'](_0x4a3e11(0x18f)+_0x23bd70[_0x4a3e11(0x183)]+'\x0a'),process[_0x4a3e11(0x182)](0x0)):(console[_0x4a3e11(0x191)](a59_0x443b47['t'](_0x4a3e11(0x192),{'error':_0x23bd70[_0x4a3e11(0x183)]})),process[_0x4a3e11(0x182)](0x1));}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a60_0x4f7b(_0x547704,_0x3ee0b5){_0x547704=_0x547704-0xba;const _0x3d3dd8=a60_0x3d3d();let _0x4f7b10=_0x3d3dd8[_0x547704];return _0x4f7b10;}(function(_0x57c1cf,_0x4ddf6e){const _0x1c6307=a60_0x4f7b,_0x55e5af=_0x57c1cf();while(!![]){try{const _0xe07828=-parseInt(_0x1c6307(0xbd))/0x1+parseInt(_0x1c6307(0xbb))/0x2*(-parseInt(_0x1c6307(0xbe))/0x3)+parseInt(_0x1c6307(0xc1))/0x4*(-parseInt(_0x1c6307(0xc9))/0x5)+parseInt(_0x1c6307(0xc8))/0x6+parseInt(_0x1c6307(0xcb))/0x7*(parseInt(_0x1c6307(0xbc))/0x8)+-parseInt(_0x1c6307(0xc2))/0x9*(-parseInt(_0x1c6307(0xcc))/0xa)+-parseInt(_0x1c6307(0xbf))/0xb;if(_0xe07828===_0x4ddf6e)break;else _0x55e5af['push'](_0x55e5af['shift']());}catch(_0x4acc63){_0x55e5af['push'](_0x55e5af['shift']());}}}(a60_0x3d3d,0x1cd44));function a60_0x3d3d(){const _0x3b3e51=['147470gcIdLa','log','2sIdNVy','56pqCDiY','56429PqkNxY','137238Ovouqb','492294ASGzJM','mcp.cursorConfig.success','4vzwVGN','27FGiVVJ','exit','message','mcp.cursorConfig.error','success','cwd','1214958IZFmbu','1034590OSykWw','mcp.cursorConfig.configInfo','225197BVWtmX'];a60_0x3d3d=function(){return _0x3b3e51;};return a60_0x3d3d();}import{configureCursorMcp as a60_0x1d0f1a}from'./mcp-installer.js';import a60_0x187b21 from'../i18n/index.js';export async function configureCursorMcp(){const _0x394898=a60_0x4f7b,_0x2165cb=process[_0x394898(0xc7)](),_0x21d46e=await a60_0x1d0f1a(_0x2165cb);_0x21d46e[_0x394898(0xc6)]?(console[_0x394898(0xba)](a60_0x187b21['t'](_0x394898(0xc0))),console['log'](a60_0x187b21['t'](_0x394898(0xca))),console[_0x394898(0xba)]('\x20\x20'+_0x21d46e[_0x394898(0xc4)]+'\x0a'),console['log'](a60_0x187b21['t']('mcp.cursorConfig.usageHint')),console['log'](a60_0x187b21['t']('mcp.cursorConfig.restartRequired')),process[_0x394898(0xc3)](0x0)):(console['error'](a60_0x187b21['t'](_0x394898(0xc5),{'error':_0x21d46e[_0x394898(0xc4)]})),process[_0x394898(0xc3)](0x1));}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x529aa6,_0x8f1e47){const _0x571922=a61_0xe605,_0x29d121=_0x529aa6();while(!![]){try{const _0x258fd9=parseInt(_0x571922(0x228))/0x1+-parseInt(_0x571922(0x210))/0x2+parseInt(_0x571922(0x22a))/0x3+-parseInt(_0x571922(0x1fd))/0x4*(-parseInt(_0x571922(0x225))/0x5)+-parseInt(_0x571922(0x223))/0x6+-parseInt(_0x571922(0x214))/0x7*(parseInt(_0x571922(0x222))/0x8)+parseInt(_0x571922(0x205))/0x9*(parseInt(_0x571922(0x20e))/0xa);if(_0x258fd9===_0x8f1e47)break;else _0x29d121['push'](_0x29d121['shift']());}catch(_0x4740d3){_0x29d121['push'](_0x29d121['shift']());}}}(a61_0x24c2,0xb5bfd));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';import{createInterface}from'node:readline';import{MCP_IDES,IDE_CONFIGS}from'../utils/ai_config.js';function a61_0x24c2(){const _0x48625d=['error','question','mcp.select.chooseIDE','mcp.help.exampleInstallHint','map','mcp.help.title','from','mcp.select.prompt','claude','mcp.help.command.help','stdout','5352xBIcCm','3151398lgZoIg','mcp.help.availableCommands','39885ObTLzB','cwd','mcpClaude','236767XgndIL','\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x0a','2780397pnWBhk','mcp.installFlow.error','mcp.help.configMethodsDirect','mcp.select.cancelled','\x20-\x20','mcp.help.configMethodsDirectClaude','stdin','has','mcp.help.exampleInstallCursor','cursor','mcp.help.configMethods','mcp','name','mcp.installFlow.configuring','mcp.help.configMethodsInteractiveHint','740NJQgYh','mcp.help.configMethodsDirectCursor','help','mcp.help.exampleInstallCursorHint','description','join','mcp.help.usage.installCursor','setLogPath','386874uDdXin','log','mcp.help.usage.help','install','close','mcp.select.enterNumber','message','toLowerCase','mcp.help.configMethodsInteractive','20PfhPtj','mcp.select.invalidChoice','1082164TWLzwn','exit','mcpCursor','mcp.error.unsupportedCommand','9569YWetqA','length','quit'];a61_0x24c2=function(){return _0x48625d;};return a61_0x24c2();}import a61_0x253b0e from'../i18n/index.js';export async function mcpCommand(_0x4ed170,_0x5a1f7e,_0x5dab40){const _0x2dbef4=a61_0xe605;logger[_0x2dbef4(0x204)](process[_0x2dbef4(0x226)]());if(_0x5dab40?.[_0x2dbef4(0x1ff)]||_0x4ed170==='--help'){showHelp();return;}_0x4ed170!==_0x2dbef4(0x208)&&(console['error'](a61_0x253b0e['t'](_0x2dbef4(0x213),{'cmd':_0x4ed170||'-'})),console['log'](a61_0x253b0e['t'](_0x2dbef4(0x224))),console['log'](a61_0x253b0e['t']('mcp.help.command.install')),console[_0x2dbef4(0x206)](a61_0x253b0e['t'](_0x2dbef4(0x220))),logger[_0x2dbef4(0x217)](_0x2dbef4(0x1f9),a61_0x253b0e['t'](_0x2dbef4(0x213),{'cmd':_0x4ed170||'-'})),process[_0x2dbef4(0x211)](0x1));let _0x16c05d;if(_0x5dab40?.[_0x2dbef4(0x212)])_0x16c05d='cursor';else{if(_0x5dab40?.[_0x2dbef4(0x227)])_0x16c05d=_0x2dbef4(0x21f);else{if(_0x5a1f7e?.[0x0]){const _0x4cf1ca=_0x5a1f7e[0x0][_0x2dbef4(0x20c)]();MCP_IDES[_0x2dbef4(0x1f5)](_0x4cf1ca)&&(_0x16c05d=_0x4cf1ca);}}}await installMcp(_0x16c05d);}function a61_0xe605(_0x88b7ec,_0x917bc8){_0x88b7ec=_0x88b7ec-0x1f2;const _0x24c2e4=a61_0x24c2();let _0xe605da=_0x24c2e4[_0x88b7ec];return _0xe605da;}function showHelp(){const _0x33ee94=a61_0xe605;console[_0x33ee94(0x206)]('\x0a'+a61_0x253b0e['t'](_0x33ee94(0x21c))+'\x0a\x0a'+a61_0x253b0e['t'](_0x33ee94(0x207))+'\x0a'+a61_0x253b0e['t']('mcp.help.usage.install')+'\x0a'+a61_0x253b0e['t'](_0x33ee94(0x203))+'\x0a'+a61_0x253b0e['t']('mcp.help.usage.installClaude')+'\x0a\x0a'+a61_0x253b0e['t'](_0x33ee94(0x1f8))+'\x0a'+a61_0x253b0e['t'](_0x33ee94(0x20d))+_0x33ee94(0x229)+a61_0x253b0e['t'](_0x33ee94(0x1fc))+'\x0a\x0a'+a61_0x253b0e['t'](_0x33ee94(0x22c))+'\x0a'+a61_0x253b0e['t'](_0x33ee94(0x1fe))+'\x0a'+a61_0x253b0e['t'](_0x33ee94(0x1f3))+'\x0a\x0a'+a61_0x253b0e['t']('mcp.help.supportedIDEs')+'\x0a'+Array['from'](MCP_IDES)[_0x33ee94(0x21b)]((_0x1dcad5,_0x3d252e)=>'\x20\x20'+(_0x3d252e+0x1)+'.\x20'+IDE_CONFIGS[_0x1dcad5][_0x33ee94(0x1fa)]+_0x33ee94(0x1f2)+IDE_CONFIGS[_0x1dcad5]['description'])[_0x33ee94(0x202)]('\x0a')+'\x0a\x0a'+a61_0x253b0e['t']('mcp.help.examples')+'\x0a'+a61_0x253b0e['t']('mcp.help.exampleInstall')+'\x0a'+a61_0x253b0e['t'](_0x33ee94(0x21a))+'\x0a\x0a'+a61_0x253b0e['t'](_0x33ee94(0x1f6))+'\x0a'+a61_0x253b0e['t'](_0x33ee94(0x200))+'\x0a\x0a'+a61_0x253b0e['t']('mcp.help.configGuide')+'\x0a\x20\x20https://help.yuntoo.com/mcp/config-guide\x0a');}async function selectIDE(){const _0x2ecc5c=a61_0xe605;console['log'](a61_0x253b0e['t'](_0x2ecc5c(0x219)));const _0x24c0fa=Array[_0x2ecc5c(0x21d)](MCP_IDES);return _0x24c0fa['forEach']((_0x143f1f,_0x58c12d)=>{const _0x1cf8a7=_0x2ecc5c;console[_0x1cf8a7(0x206)]('\x20\x20'+(_0x58c12d+0x1)+'.\x20'+IDE_CONFIGS[_0x143f1f][_0x1cf8a7(0x1fa)]+_0x1cf8a7(0x1f2)+IDE_CONFIGS[_0x143f1f][_0x1cf8a7(0x201)]);}),console[_0x2ecc5c(0x206)](a61_0x253b0e['t']('mcp.select.cancel')),console[_0x2ecc5c(0x206)](a61_0x253b0e['t'](_0x2ecc5c(0x20a))),new Promise(_0x23f6c3=>{const _0x39b7c3=_0x2ecc5c,_0xa1bccc=createInterface({'input':process[_0x39b7c3(0x1f4)],'output':process[_0x39b7c3(0x221)]});_0xa1bccc[_0x39b7c3(0x218)](a61_0x253b0e['t'](_0x39b7c3(0x21e)),_0x182f46=>{const _0x1ec725=_0x39b7c3;_0xa1bccc[_0x1ec725(0x209)]();const _0x171745=_0x182f46['trim']()[_0x1ec725(0x20c)]();(_0x171745==='q'||_0x171745===_0x1ec725(0x216)||_0x171745===_0x1ec725(0x211))&&(console[_0x1ec725(0x206)](a61_0x253b0e['t'](_0x1ec725(0x22d))),process['exit'](0x0));const _0x4595f5=parseInt(_0x171745,0xa);if(!isNaN(_0x4595f5)&&_0x4595f5>=0x1&&_0x4595f5<=_0x24c0fa[_0x1ec725(0x215)]){const _0x522ad1=_0x24c0fa[_0x4595f5-0x1];_0x522ad1&&_0x23f6c3(_0x522ad1);return;}console[_0x1ec725(0x206)](a61_0x253b0e['t'](_0x1ec725(0x20f),{'count':_0x24c0fa[_0x1ec725(0x215)]})),process['exit'](0x1);});});}async function installMcp(_0x1a7ed5){const _0x156c0c=a61_0xe605;let _0x5f2263;!_0x1a7ed5?_0x5f2263=await selectIDE():_0x5f2263=_0x1a7ed5;try{const _0x53abeb=IDE_CONFIGS[_0x5f2263];console['log'](a61_0x253b0e['t'](_0x156c0c(0x1fb),{'name':_0x53abeb[_0x156c0c(0x1fa)]}));switch(_0x5f2263){case _0x156c0c(0x1f7):await configureCursorMcp();break;case _0x156c0c(0x21f):await configureClaudeMcp();break;}}catch(_0x43090a){logger[_0x156c0c(0x217)]('mcp-install',a61_0x253b0e['t'](_0x156c0c(0x22b),{'error':_0x43090a instanceof Error?_0x43090a['message']:String(_0x43090a)}),{'error':_0x43090a instanceof Error?_0x43090a['message']:String(_0x43090a)}),console[_0x156c0c(0x217)](a61_0x253b0e['t'](_0x156c0c(0x22b),{'error':_0x43090a instanceof Error?_0x43090a[_0x156c0c(0x20b)]:String(_0x43090a)})),process['exit'](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x31094e=a62_0x2aa1;(function(_0x495a7c,_0x5b824e){const _0xebbf7b=a62_0x2aa1,_0x4da1d4=_0x495a7c();while(!![]){try{const _0x277039=parseInt(_0xebbf7b(0x209))/0x1+-parseInt(_0xebbf7b(0x1f2))/0x2+-parseInt(_0xebbf7b(0x204))/0x3+-parseInt(_0xebbf7b(0x1f7))/0x4+-parseInt(_0xebbf7b(0x206))/0x5+parseInt(_0xebbf7b(0x200))/0x6*(parseInt(_0xebbf7b(0x202))/0x7)+-parseInt(_0xebbf7b(0x1f0))/0x8*(-parseInt(_0xebbf7b(0x1fa))/0x9);if(_0x277039===_0x5b824e)break;else _0x4da1d4['push'](_0x4da1d4['shift']());}catch(_0x2fd87b){_0x4da1d4['push'](_0x4da1d4['shift']());}}}(a62_0x4b81,0xb9fa5));import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';function a62_0x2aa1(_0x1029c5,_0x31b2aa){_0x1029c5=_0x1029c5-0x1ef;const _0x4b818c=a62_0x4b81();let _0x2aa111=_0x4b818c[_0x1029c5];return _0x2aa111;}import{logger}from'../utils/logger.js';import a62_0x455520 from'../i18n/index.js';function a62_0x4b81(){const _0x1d415a=['985996tOIcky','mcp.install.manualActionRequired','mcp.install.success','mcp.install.completed','some','3056644CMrTov','needsManualAction','setLogPath','18077058gvllkY','claude','other','cwd','mcp-install-non-interactive','mcp.install.failed','1194BfMzBI','log','43141kIXsUo','mcp.install.otherIDE','3205020mioscy','error','2751390yPxQQL','mcp.cursor','cursor','402543nyTdpP','length','mcp.claude','push','success','8RMMZto','message'];a62_0x4b81=function(){return _0x1d415a;};return a62_0x4b81();}export async function installMcpNonInteractive(_0x4103b7,_0x193585=process[a62_0x31094e(0x1fd)]()){const _0xd98f7d=a62_0x31094e;logger[_0xd98f7d(0x1f9)](_0x193585),logger['info'](_0xd98f7d(0x1fe),a62_0x455520['t']('mcp.install.starting'),{'ides':_0x4103b7});const _0x35b21b=[];for(const _0x1e3445 of _0x4103b7){try{let _0x37441d;switch(_0x1e3445){case'cursor':_0x37441d=await configureCursorMcp(_0x193585);break;case _0xd98f7d(0x1fb):_0x37441d=configureClaudeMcp(_0x193585);break;case _0xd98f7d(0x1fc):_0x37441d=showOtherMcpGuide(_0x193585);break;default:_0x37441d={'success':![],'message':a62_0x455520['t']('mcp.install.unknownIDE',{'ide':_0x1e3445})};}_0x35b21b[_0xd98f7d(0x20c)](_0x37441d);if(_0x37441d[_0xd98f7d(0x1ef)]){const _0x1c7ae2=_0x1e3445===_0xd98f7d(0x208)?a62_0x455520['t'](_0xd98f7d(0x207)):_0x1e3445===_0xd98f7d(0x1fb)?a62_0x455520['t'](_0xd98f7d(0x20b)):a62_0x455520['t'](_0xd98f7d(0x203));console['log'](a62_0x455520['t'](_0xd98f7d(0x1f4),{'ide':_0x1c7ae2})),console[_0xd98f7d(0x201)]('\x20\x20'+_0x37441d[_0xd98f7d(0x1f1)]);}else console[_0xd98f7d(0x205)](a62_0x455520['t'](_0xd98f7d(0x1ff),{'ide':_0x1e3445===_0xd98f7d(0x208)?a62_0x455520['t']('mcp.cursor'):_0x1e3445===_0xd98f7d(0x1fb)?a62_0x455520['t']('mcp.claude'):a62_0x455520['t'](_0xd98f7d(0x203)),'error':_0x37441d['message']}));}catch(_0x405d5e){console['error'](a62_0x455520['t']('mcp.install.failed',{'ide':_0x1e3445===_0xd98f7d(0x208)?a62_0x455520['t'](_0xd98f7d(0x207)):_0x1e3445===_0xd98f7d(0x1fb)?a62_0x455520['t']('mcp.claude'):a62_0x455520['t'](_0xd98f7d(0x203)),'error':_0x405d5e instanceof Error?_0x405d5e[_0xd98f7d(0x1f1)]:String(_0x405d5e)}));}}const _0x1a5f5e=_0x35b21b['filter'](_0x61f5cd=>_0x61f5cd[_0xd98f7d(0x1ef)])[_0xd98f7d(0x20a)],_0x3476be=_0x35b21b[_0xd98f7d(0x20a)];console[_0xd98f7d(0x201)](a62_0x455520['t'](_0xd98f7d(0x1f5),{'successCount':_0x1a5f5e,'totalCount':_0x3476be}));const _0x3b6f09=_0x35b21b[_0xd98f7d(0x1f6)](_0x51d1c5=>_0x51d1c5[_0xd98f7d(0x1f8)]);_0x3b6f09&&console[_0xd98f7d(0x201)](a62_0x455520['t'](_0xd98f7d(0x1f3)));}
|
package/lib/mcp/mcp-installer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x28c0b8=a63_0x19dc;function a63_0x19dc(_0x22d3d4,_0x553c0d){_0x22d3d4=_0x22d3d4-0x1be;const _0x3cca98=a63_0x3cca();let _0x19dcec=_0x3cca98[_0x22d3d4];return _0x19dcec;}(function(_0x36ba09,_0x2d09c5){const _0x3ca706=a63_0x19dc,_0xa29aac=_0x36ba09();while(!![]){try{const _0x1277a5=-parseInt(_0x3ca706(0x1dc))/0x1*(-parseInt(_0x3ca706(0x1e7))/0x2)+-parseInt(_0x3ca706(0x1c0))/0x3*(-parseInt(_0x3ca706(0x1e8))/0x4)+parseInt(_0x3ca706(0x1be))/0x5+parseInt(_0x3ca706(0x1fc))/0x6*(-parseInt(_0x3ca706(0x1f2))/0x7)+-parseInt(_0x3ca706(0x1f0))/0x8+parseInt(_0x3ca706(0x1c3))/0x9*(parseInt(_0x3ca706(0x1eb))/0xa)+parseInt(_0x3ca706(0x1e0))/0xb*(-parseInt(_0x3ca706(0x1cb))/0xc);if(_0x1277a5===_0x2d09c5)break;else _0xa29aac['push'](_0xa29aac['shift']());}catch(_0x434393){_0xa29aac['push'](_0xa29aac['shift']());}}}(a63_0x3cca,0x4a643));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_0x53f532 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url));export const MCP_SERVER_NAME='lovrabet-dataset';export const MCP_COMMAND=a63_0x28c0b8(0x1ca);export const MCP_ARGS=[a63_0x28c0b8(0x1e3)];export function getAppConfig(){const _0x196d1b=a63_0x28c0b8,_0xe11415=readConfig(),_0x509a69=_0xe11415[_0x196d1b(0x1d5)]||_0xe11415[_0x196d1b(0x1ec)],_0x3dbfb2=_0xe11415[_0x196d1b(0x1f5)]||_0x196d1b(0x1dd);if(!_0x509a69)throw new Error(a63_0x53f532['t'](_0x196d1b(0x1d2)));return{'appcode':String(_0x509a69),'env':_0x3dbfb2};}export function buildMcpEnv(_0x2a75d6,_0x232297){const _0xe4f6de=a63_0x28c0b8,_0x2bcf75={'LOVRABET_APP_CODE':_0x2a75d6};return _0x232297!==_0xe4f6de(0x1dd)&&(_0x2bcf75[_0xe4f6de(0x1bf)]=_0x232297),_0x2bcf75;}function a63_0x3cca(){const _0x1cf5bb=['message','mcp-cursor','mcp.other.guideShown','852240BidCLr','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,','1199625nIGhyH','lovrabet_rules.mdc','mcp.cursorConfig.rules.created','env','\x0a\x20\x20','\x20\x20\x20\x20\x20\x20\x20\x20','mcp.config.env','mcp-claude','claude\x20mcp\x20add\x20','.cursor','6DdKcdb','utf8','\x20\x20}','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','2827565jfdtqr','LOVRABET_ENV','185220iSbhaK','mcp.other.configInfo','mcpServers','405171XRXiUS','mcp.cursorConfig.success','push','AppCode:\x20','mcp.claudeConfig.configInfo','\x20\x20\x20\x20}','stringify','npx','555372WLWkkg','\x22LOVRABET_ENV\x22:\x20\x22','mcp.cursorConfig.error','parse','mcp.claudeConfig.manualCommand','mcp.cursorConfig.updateExisting','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[\x22@lovrabet/dataset-mcp-server@latest\x22],','mcp.error.missingAppcode','info','error','appcode','mcp.cursorConfig.restartRequired','mcp.claudeConfig.agents.copyFailed','mcp.cursorConfig.rules.copyFailed','agents.md','join','mcp.claudeConfig.agents.exists','1qvdjKt','online','mcp-install','rules','231kqzrNN','mcp.other.configGuide','utf-8','@lovrabet/dataset-mcp-server@latest','\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{','\x20\x20\x20\x20\x20\x20}','mcp.claudeConfig.agents.created','684026OVtzJr','4mqsTxq','\x20-e\x20LOVRABET_APP_CODE=','mcp.claudeConfig.restartRequired','130ZFCUlO','app'];a63_0x3cca=function(){return _0x1cf5bb;};return a63_0x3cca();}export function buildMcpServerConfig(_0x28745b,_0x54e20a){return{'command':MCP_COMMAND,'args':MCP_ARGS,'env':buildMcpEnv(_0x28745b,_0x54e20a)};}export function buildClaudeMcpCommand(_0x176af0,_0x3b660d){const _0x2db7cd=a63_0x28c0b8,_0x27322a=_0x2db7cd(0x1fa)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x2db7cd(0x1da)]('\x20')+_0x2db7cd(0x1e9)+_0x176af0,_0xd34ec5=_0x3b660d!=='online'?'\x20-e\x20LOVRABET_ENV='+_0x3b660d:'';return''+_0x27322a+_0xd34ec5;}export async function copyCursorRules(_0x113115){const _0x5e3102=a63_0x28c0b8,_0x1c861e=join(_0x113115,_0x5e3102(0x1fb)),_0x772466=join(_0x1c861e,_0x5e3102(0x1df)),_0xfa52b7=join(_0x772466,_0x5e3102(0x1f3));if(existsSync(_0xfa52b7))return logger[_0x5e3102(0x1d3)](_0x5e3102(0x1de),a63_0x53f532['t']('mcp.cursorConfig.rules.exists'),{'path':_0xfa52b7}),![];try{ensureDir(_0x772466);const _0x952c91=await getRulesContent();return writeFileSync(_0xfa52b7,_0x952c91,_0x5e3102(0x1e2)),logger[_0x5e3102(0x1d3)](_0x5e3102(0x1de),a63_0x53f532['t'](_0x5e3102(0x1f4)),{'to':_0xfa52b7}),!![];}catch(_0x542cb2){return logger[_0x5e3102(0x1d4)](_0x5e3102(0x1de),a63_0x53f532['t'](_0x5e3102(0x1d8)),{'error':_0x542cb2 instanceof Error?_0x542cb2[_0x5e3102(0x1ed)]:String(_0x542cb2)}),![];}}export async function copyAgentsMd(_0x31acda){const _0x4ed5de=a63_0x28c0b8,_0x3a78f1=join(_0x31acda,_0x4ed5de(0x1d9));if(existsSync(_0x3a78f1))return logger[_0x4ed5de(0x1d3)]('mcp-install',a63_0x53f532['t'](_0x4ed5de(0x1db)),{'path':_0x3a78f1}),![];try{const _0x54b004=await getRulesContent();return writeFileSync(_0x3a78f1,_0x54b004,_0x4ed5de(0x1e2)),logger[_0x4ed5de(0x1d3)](_0x4ed5de(0x1de),a63_0x53f532['t'](_0x4ed5de(0x1e6)),{'to':_0x3a78f1}),!![];}catch(_0x3b320e){return logger[_0x4ed5de(0x1d4)]('mcp-install',a63_0x53f532['t'](_0x4ed5de(0x1d7)),{'error':_0x3b320e instanceof Error?_0x3b320e[_0x4ed5de(0x1ed)]:String(_0x3b320e)}),![];}}export async function configureCursorMcp(_0x1bb9c2){const _0xcd1349=a63_0x28c0b8;try{const {appcode:_0x5189d2,env:_0xabb212}=getAppConfig(),_0x27ec4b=join(_0x1bb9c2,_0xcd1349(0x1fb)),_0x2bb72f=join(_0x27ec4b,'mcp.json');ensureDir(_0x27ec4b);const _0xf43442=buildMcpServerConfig(_0x5189d2,_0xabb212);let _0x5ae0e3;if(existsSync(_0x2bb72f)){const _0x37698b=readFileSync(_0x2bb72f,_0xcd1349(0x1fd));_0x5ae0e3=JSON[_0xcd1349(0x1ce)](_0x37698b),!_0x5ae0e3[_0xcd1349(0x1c2)]&&(_0x5ae0e3[_0xcd1349(0x1c2)]={}),logger['info'](_0xcd1349(0x1ee),a63_0x53f532['t'](_0xcd1349(0x1d0)),{'path':_0x2bb72f,'appcode':_0x5189d2,'env':_0xabb212});}else _0x5ae0e3={'mcpServers':{}},logger['info']('mcp-cursor',a63_0x53f532['t']('mcp.cursorConfig.createNew'),{'path':_0x2bb72f,'appcode':_0x5189d2,'env':_0xabb212});_0x5ae0e3[_0xcd1349(0x1c2)][MCP_SERVER_NAME]=_0xf43442,writeFileSync(_0x2bb72f,JSON[_0xcd1349(0x1c9)](_0x5ae0e3,null,0x2),{'encoding':'utf8'});const _0x5da489=await copyCursorRules(_0x1bb9c2),_0x3a0d43=[a63_0x53f532['t']('mcp.cursorConfig.written'),'AppCode:\x20'+_0x5189d2];return _0xabb212!=='online'&&_0x3a0d43['push'](a63_0x53f532['t'](_0xcd1349(0x1f8),{'env':_0xabb212})),_0x3a0d43[_0xcd1349(0x1c5)](a63_0x53f532['t'](_0xcd1349(0x1d6))),_0x5da489&&_0x3a0d43[_0xcd1349(0x1c5)](a63_0x53f532['t']('mcp.cursorConfig.rules.created')),logger[_0xcd1349(0x1d3)](_0xcd1349(0x1ee),a63_0x53f532['t'](_0xcd1349(0x1c4)),{'appcode':_0x5189d2,'env':_0xabb212,'configPath':_0x2bb72f}),{'success':!![],'message':_0x3a0d43[_0xcd1349(0x1da)](_0xcd1349(0x1f6))};}catch(_0x427761){return logger[_0xcd1349(0x1d4)](_0xcd1349(0x1ee),a63_0x53f532['t'](_0xcd1349(0x1cd),{'error':_0x427761 instanceof Error?_0x427761[_0xcd1349(0x1ed)]:String(_0x427761)}),{'error':_0x427761 instanceof Error?_0x427761['message']:String(_0x427761)}),{'success':![],'message':_0x427761 instanceof Error?_0x427761[_0xcd1349(0x1ed)]:String(_0x427761)};}}export function configureClaudeMcp(_0x43b757){const _0x4be626=a63_0x28c0b8;try{const {appcode:_0x2419e,env:_0x38dde3}=getAppConfig();copyAgentsMd(_0x43b757);const _0x14f228=buildClaudeMcpCommand(_0x2419e,_0x38dde3),_0x313715=[a63_0x53f532['t'](_0x4be626(0x1cf)),''+_0x14f228,a63_0x53f532['t'](_0x4be626(0x1c7)),_0x4be626(0x1c6)+_0x2419e];return _0x38dde3!==_0x4be626(0x1dd)&&_0x313715[_0x4be626(0x1c5)](a63_0x53f532['t'](_0x4be626(0x1f8),{'env':_0x38dde3})),_0x313715['push'](a63_0x53f532['t'](_0x4be626(0x1ea))),logger['info'](_0x4be626(0x1f9),a63_0x53f532['t']('mcp.claudeConfig.commandGenerated'),{'appcode':_0x2419e,'env':_0x38dde3,'command':_0x14f228}),{'success':!![],'message':_0x313715['join'](_0x4be626(0x1f6)),'needsManualAction':!![]};}catch(_0x384971){return logger[_0x4be626(0x1d4)](_0x4be626(0x1f9),a63_0x53f532['t']('mcp.claudeConfig.error',{'error':_0x384971 instanceof Error?_0x384971[_0x4be626(0x1ed)]:String(_0x384971)}),{'error':_0x384971 instanceof Error?_0x384971[_0x4be626(0x1ed)]:String(_0x384971)}),{'success':![],'message':_0x384971 instanceof Error?_0x384971[_0x4be626(0x1ed)]:String(_0x384971)};}}export function showOtherMcpGuide(_0x17b455){const _0xc6f5ff=a63_0x28c0b8;try{const {appcode:_0x11d677,env:_0x4b68fc}=getAppConfig(),_0x756f24=buildMcpServerConfig(_0x11d677,_0x4b68fc),_0xf3a28a=['\x22LOVRABET_APP_CODE\x22:\x20\x22'+_0x11d677+'\x22'];_0x4b68fc!==_0xc6f5ff(0x1dd)&&_0xf3a28a[_0xc6f5ff(0x1c5)](_0xc6f5ff(0x1cc)+_0x4b68fc+'\x22');const _0x563943=[a63_0x53f532['t'](_0xc6f5ff(0x1c1),{'appcode':_0x11d677,'env':_0x4b68fc}),'{','\x20\x20\x22mcpServers\x22:\x20{',_0xc6f5ff(0x1e4),_0xc6f5ff(0x1f1),_0xc6f5ff(0x1d1),_0xc6f5ff(0x1ff),..._0xf3a28a['map'](_0x16f549=>_0xc6f5ff(0x1f7)+_0x16f549+','),_0xc6f5ff(0x1e5),_0xc6f5ff(0x1c8),_0xc6f5ff(0x1fe),'}',a63_0x53f532['t'](_0xc6f5ff(0x1e1))];return logger[_0xc6f5ff(0x1d3)](_0xc6f5ff(0x1de),a63_0x53f532['t'](_0xc6f5ff(0x1ef)),{'appcode':_0x11d677,'env':_0x4b68fc}),{'success':!![],'message':_0x563943[_0xc6f5ff(0x1da)]('\x0a'),'needsManualAction':!![]};}catch(_0x207243){return{'success':![],'message':_0x207243 instanceof Error?_0x207243['message']:String(_0x207243)};}}function ensureDir(_0x3ff991){!existsSync(_0x3ff991)&&mkdirSync(_0x3ff991,{'recursive':!![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x36eb1f=a64_0x3dbc;(function(_0x24bece,_0x190f1e){const _0x1d2118=a64_0x3dbc,_0x5ad2ee=_0x24bece();while(!![]){try{const _0x2cf583=-parseInt(_0x1d2118(0x1c1))/0x1+parseInt(_0x1d2118(0x19d))/0x2*(-parseInt(_0x1d2118(0x1b7))/0x3)+parseInt(_0x1d2118(0x1a8))/0x4+-parseInt(_0x1d2118(0x1bf))/0x5+-parseInt(_0x1d2118(0x1b0))/0x6+-parseInt(_0x1d2118(0x1a6))/0x7+parseInt(_0x1d2118(0x1a5))/0x8*(parseInt(_0x1d2118(0x19e))/0x9);if(_0x2cf583===_0x190f1e)break;else _0x5ad2ee['push'](_0x5ad2ee['shift']());}catch(_0x35af08){_0x5ad2ee['push'](_0x5ad2ee['shift']());}}}(a64_0x11b8,0x9117d));function a64_0x11b8(){const _0x456711=['size','skill.cdn.fetchingExtend','message','map','selecting','info','54naHPgg','25537626mGdSZx','2.0.0','selectedIndexes','gray','warn','skill.installing.installed','skill.select.selectedIDE','8obtWIX','5730438vDnelf','.lovrabet/skill-manifest.json','1015572UemSKb','return','skill.done.guidesPathInline','../../cdn-source/skills','\x20✓\x20','length','installing','skill.done.pressAnyKey','3324588juxjHB','setLogPath','log','skill.installing.title','setErrorMsg','toISOString','skill.done.successInline','39009VCNYwI','skill-install','guides','error','name','skill.cdn.fetching','skill.cdn.fetchSuccess','keys','31955PFuyPR','utf-8','766902bzoKgw','green','done','.lovrabet','cyan','skill.select.count'];a64_0x11b8=function(){return _0x456711;};return a64_0x11b8();}import{jsx as a64_0x36aafd,jsxs as a64_0x5e55a8,Fragment as a64_0x4d6ee0}from'react/jsx-runtime';import{useState,useEffect}from'react';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';function a64_0x3dbc(_0x3f6a33,_0x395236){_0x3f6a33=_0x3f6a33-0x192;const _0x11b809=a64_0x11b8();let _0x3dbc03=_0x11b809[_0x3f6a33];return _0x3dbc03;}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_0x36eb1f(0x19a)](_0x265a5a=>({'key':_0x265a5a,'name':IDE_CONFIGS[_0x265a5a][a64_0x36eb1f(0x1bb)],'description':IDE_CONFIGS[_0x265a5a]['description']}));export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[],providedFlags:_0x143ef0}){const _0x141e64=a64_0x36eb1f,{exit:_0x58b441}=useApp(),{t:_0x1ea8d2}=useI18n(),[_0x136be4,_0x5c5b2b]=useState(_0x141e64(0x19b)),[_0x302a79,_0x17acbb]=useState([]),[_0x9475d,_0x219ec0]=useState([]),[_0x2fc810,_0x4c5b55]=useState(0x0),_0x24878e=useIDESelection({'ideList':UI_IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x2bd925=_0x141e64;preselectedIDEs[_0x2bd925(0x1ad)]>0x0&&_0x24878e['selectedIndexes'][_0x2bd925(0x197)]>0x0&&_0x3d2810();},[]),useInput((_0xa714a,_0x4bd792)=>{const _0x400d8d=_0x141e64;if(_0x136be4===_0x400d8d(0x19b)){if(_0xa714a==='q'||_0xa714a==='Q'){_0x58b441();return;}if(_0x4bd792[_0x400d8d(0x1a9)]){if(_0x24878e[_0x400d8d(0x1a0)][_0x400d8d(0x197)]===0x0){_0x24878e[_0x400d8d(0x1b4)](_0x1ea8d2('skill.error.selectAtLeastOne'));return;}_0x3d2810();return;}_0x24878e['handleKeyDown'](_0xa714a,_0x4bd792);}_0x136be4===_0x400d8d(0x193)&&_0x58b441();});async function _0x3d2810(){const _0x2f2a3f=_0x141e64,_0x3c1355=_0x24878e['getSelectedIDEs']();_0x219ec0(_0x3c1355),_0x17acbb([{'label':_0x1ea8d2(_0x2f2a3f(0x1a4)),'value':_0x1ea8d2(_0x2f2a3f(0x196),{'count':_0x24878e['selectedIndexes'][_0x2f2a3f(0x197)]})}]),_0x5c5b2b(_0x2f2a3f(0x1ae)),await _0x4ae6e1(_0x3c1355);}async function _0x4ae6e1(_0x5156e2){const _0x46d983=_0x141e64,_0x4aec39=process['cwd'](),_0x174a52=resolve(__dirname,_0x46d983(0x1ab));logger[_0x46d983(0x1b1)](_0x4aec39);const _0x88d256=_0x143ef0&&_0x143ef0['length']>0x0;console[_0x46d983(0x1b2)](_0x88d256?_0x1ea8d2(_0x46d983(0x198)):_0x1ea8d2(_0x46d983(0x1bc)));let _0x485701;try{_0x485701=await fetchGuidesFromCDN(_0x88d256),console[_0x46d983(0x1b2)](_0x1ea8d2(_0x46d983(0x1bd),{'count':Object[_0x46d983(0x1be)](_0x485701[_0x46d983(0x1b9)])[_0x46d983(0x1ad)]}));}catch(_0x7acf8f){console[_0x46d983(0x1a2)](_0x1ea8d2('skill.cdn.fetchFailed',{'error':_0x7acf8f instanceof Error?_0x7acf8f[_0x46d983(0x199)]:String(_0x7acf8f)}));}let _0x4a14bd=0x0;for(const _0x55b03c of _0x5156e2){try{const _0x1e5390=IDE_CONFIGS[_0x55b03c],_0x189df7=await installSingleIDE(_0x55b03c,_0x1e5390,_0x4aec39,_0x174a52,_0x485701,_0x143ef0);_0x4a14bd+=_0x189df7,_0x4c5b55(_0x4a14bd);}catch(_0xf9d0ad){console[_0x46d983(0x1ba)](_0x1ea8d2('skill.error.installFailed',{'ide':_0x55b03c,'error':_0xf9d0ad instanceof Error?_0xf9d0ad[_0x46d983(0x199)]:String(_0xf9d0ad)}));}}_0x485701&&writeGuidesToProject(_0x485701,_0x4aec39,'.lovrabet/skill/.shared/guides',_0x143ef0);const _0x28c30d={'version':_0x46d983(0x19f),'installedAt':new Date()[_0x46d983(0x1b5)](),'platforms':_0x5156e2},_0x15ca3a=join(_0x4aec39,_0x46d983(0x1a7)),_0x6ae277=join(_0x4aec39,_0x46d983(0x194));await copyDir(_0x6ae277,_0x6ae277),writeFileSync(_0x15ca3a,JSON['stringify'](_0x28c30d,null,0x2),_0x46d983(0x1c0)),logger[_0x46d983(0x19c)](_0x46d983(0x1b8),'安装成功',{'projectRoot':_0x4aec39,'ides':_0x5156e2,'foldersCount':_0x4a14bd}),_0x5c5b2b('done'),setTimeout(()=>{_0x58b441();},0x3e8);}return a64_0x5e55a8(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x136be4===_0x141e64(0x19b)&&a64_0x36aafd(IDESelector,{'ideList':UI_IDE_LIST,'title':_0x1ea8d2(_0x141e64(0x1b3)),'selection':_0x24878e}),_0x136be4===_0x141e64(0x1ae)&&a64_0x36aafd(InstallingStep,{'completedSteps':_0x302a79,'installingIDEs':_0x9475d,'installedCount':_0x2fc810}),_0x136be4===_0x141e64(0x193)&&a64_0x36aafd(DoneStep,{'installedCount':_0x2fc810})]});}function InstallingStep({completedSteps:_0xb6a701,installingIDEs:_0x420d0d,installedCount:_0x106096}){const _0x41879b=a64_0x36eb1f,{t:_0x179a05}=useI18n();return a64_0x5e55a8(a64_0x4d6ee0,{'children':[_0xb6a701[_0x41879b(0x19a)]((_0x3cea40,_0x58210d)=>a64_0x5e55a8(Box,{'children':[a64_0x5e55a8(Text,{'color':_0x41879b(0x192),'children':['√\x20',_0x3cea40['label'],':\x20']}),a64_0x36aafd(Text,{'color':_0x41879b(0x195),'children':_0x3cea40['value']})]},_0x58210d)),a64_0x36aafd(Box,{'marginTop':0x1,'children':a64_0x36aafd(Text,{'children':_0x179a05('skill.installing.progress')})}),_0x420d0d['map'](_0x8a6ce1=>a64_0x5e55a8(Box,{'children':[a64_0x36aafd(Text,{'color':'green','children':_0x41879b(0x1ac)}),a64_0x36aafd(Text,{'children':IDE_CONFIGS[_0x8a6ce1]?.['name']||_0x8a6ce1})]},_0x8a6ce1)),a64_0x36aafd(Box,{'marginTop':0x1,'children':a64_0x36aafd(Text,{'color':_0x41879b(0x1a1),'children':_0x179a05(_0x41879b(0x1a3),{'count':_0x106096})})})]});}function DoneStep({installedCount:_0x518b95}){const _0x425c88=a64_0x36eb1f,{t:_0x2fe0c2}=useI18n();return a64_0x5e55a8(a64_0x4d6ee0,{'children':[a64_0x36aafd(Box,{'children':a64_0x36aafd(Text,{'color':_0x425c88(0x192),'children':_0x2fe0c2(_0x425c88(0x1b6),{'count':_0x518b95})})}),a64_0x36aafd(Box,{'marginTop':0x1,'children':a64_0x36aafd(Text,{'color':'gray','children':_0x2fe0c2(_0x425c88(0x1aa))})}),a64_0x36aafd(Box,{'marginTop':0x1,'children':a64_0x36aafd(Text,{'color':_0x425c88(0x1a1),'children':_0x2fe0c2(_0x425c88(0x1af))})})]});}async function copyDirIfNeeded(_0x2c88d7,_0x32d485){try{return await copyDir(_0x2c88d7,_0x32d485),!![];}catch{return![];}}
|
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x38ecd9,_0x1683ed){const _0x1cd370=a65_0x40d4,_0xb62da7=_0x38ecd9();while(!![]){try{const _0x5c1607=-parseInt(_0x1cd370(0x201))/0x1*(-parseInt(_0x1cd370(0x1cf))/0x2)+parseInt(_0x1cd370(0x1f8))/0x3+-parseInt(_0x1cd370(0x1e9))/0x4+-parseInt(_0x1cd370(0x204))/0x5+parseInt(_0x1cd370(0x21f))/0x6+parseInt(_0x1cd370(0x1eb))/0x7+parseInt(_0x1cd370(0x1ea))/0x8;if(_0x5c1607===_0x1683ed)break;else _0xb62da7['push'](_0xb62da7['shift']());}catch(_0x4ce202){_0xb62da7['push'](_0xb62da7['shift']());}}}(a65_0x5b24,0x1e9b3));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';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a65_0x4ab914 from'../i18n/index.js';function a65_0x40d4(_0x43e7ef,_0xfd5a42){_0x43e7ef=_0x43e7ef-0x1ce;const _0x5b243b=a65_0x5b24();let _0x40d474=_0x5b243b[_0x43e7ef];return _0x40d474;}const t=a65_0x4ab914['t']['bind'](a65_0x4ab914),__dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x3ad2cb){const _0x564032=a65_0x40d4,_0x46fb80=[];for(const [_0x296062,_0x4c0888]of Object[_0x564032(0x208)](_0x3ad2cb)){if(_0x4c0888===!![]){const _0x804810=_0x296062['replace'](/([A-Z])/g,_0x564032(0x1da))[_0x564032(0x228)]();_0x46fb80[_0x564032(0x230)](_0x804810);}}return _0x46fb80;}export function parseDynamicFlags(){const _0x4de534=a65_0x40d4,_0x4c7543=[];for(let _0x196fe1=0x3;_0x196fe1<process[_0x4de534(0x1e4)][_0x4de534(0x1ce)];_0x196fe1++){const _0x4f79c4=process[_0x4de534(0x1e4)][_0x196fe1];if(_0x4f79c4&&_0x4f79c4[_0x4de534(0x22b)]('--')){const _0x504477=_0x4f79c4[_0x4de534(0x1fe)](0x2);_0x504477&&!_0x504477['includes']('=')&&_0x4c7543[_0x4de534(0x230)](_0x504477);}}return _0x4c7543;}function a65_0x5b24(){const _0x1c7f2a=['quit','\x20-\x20','toLowerCase','skill.generic','skill.help.installInteractive','startsWith','\x20\x20q.\x20','skill.select.installAll','skill.error.installFailed','exit','push','skill.errorHint.showHelp','log','toISOString','warn','--help','stringify','\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','skill.help.installDirect','skill.done.guidesPath','skill.help.allDesc','skill.select.noneSelected','length','2HIaUBI','skill.select.cancel','skill.help.supportedIDEs','skill.help.exampleDirectDesc','skill.help.exampleAllDesc','skill-install','安装成功','skill.help.afterInstallList','skill.installing.createdDir','skill.errorHint.installInteractive','\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','-$1','skill.help.skillContents','cwd','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a','question','skill.select.title','skill.help.interactiveKeys','skill.cdn.fetchSuccess','install','skill.cdn.fetchingExtend','argv','description','skill.help.options','help','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a','499272rwNymu','727832XPbfil','22008KnTCgV','\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\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.help.examples','guides','skill.help.exampleInteractive','skill.installing.createdManifest','some','skill.select.inputHint','error','stdin','skill','files','94428tNINyA','\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','all','.lovrabet/skill/.shared/guides','skill.help.interactiveSelect','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20','slice','skill.done.guidesLocation','skill.help.installWithBff','60184hgClYK','skill.installing.created','skill.help.directInstall','317075EaTWDH','\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.installing.ide','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a','entries','../../cdn-source/skills','message','info','split','name','setLogPath','skill.help.installAll','skill.select.inputFormat','forEach','utf-8','skill.help.agentDesc','includes','skill.select.prompt','skill.help.exampleBffDesc','agent','skill.errorHint.installDirect','\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a','skill.errorHint.exampleInteractive','close','\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20','folders','stdout','766878tnTvLr','\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','keys','\x20\x200.\x20','skill.errorHint.exampleDirect','skill.help.afterInstall','skill.help.guidesLocationTitle'];a65_0x5b24=function(){return _0x1c7f2a;};return a65_0x5b24();}export function getAllProvidedFlags(_0xd0882d){const _0x11e0ab=camelCaseFlagsToKebab(_0xd0882d),_0x8ebfbd=parseDynamicFlags(),_0x3a2e51=new Set([..._0x11e0ab,..._0x8ebfbd]);return Array['from'](_0x3a2e51);}export async function skillsCommand(_0x3268d7,_0x5dbef6,_0x5c59d8){const _0x138ff2=a65_0x40d4;logger[_0x138ff2(0x20e)](process[_0x138ff2(0x1dc)]());if(_0x5c59d8?.[_0x138ff2(0x1e7)]||_0x3268d7===_0x138ff2(0x235)){showHelp();return;}_0x3268d7!==_0x138ff2(0x1e2)&&(console[_0x138ff2(0x1f4)](t('skill.error.unsupportedCommand',{'cmd':_0x3268d7||'(empty)'})),console[_0x138ff2(0x232)](t('skill.errorHint.availableCommands')),console[_0x138ff2(0x232)](t(_0x138ff2(0x1d8))),console[_0x138ff2(0x232)](t(_0x138ff2(0x218))),console[_0x138ff2(0x232)](t(_0x138ff2(0x231))),console['log'](t('skill.errorHint.usageExamples')),console[_0x138ff2(0x232)](t(_0x138ff2(0x21a))),console[_0x138ff2(0x232)](t(_0x138ff2(0x223))),logger['error'](_0x138ff2(0x1f6),'不支持的命令:\x20'+_0x3268d7),process[_0x138ff2(0x22f)](0x1));let _0x5c8bf2=_0x5dbef6?.[0x0];const _0x358341=getAllProvidedFlags(_0x5c59d8??{});_0x5c8bf2?.[_0x138ff2(0x22b)]('--')&&(_0x5c8bf2=undefined),await installSkill(_0x5c8bf2??_0x138ff2(0x217),_0x358341);}async function selectIDEs(){const _0xeedb16=a65_0x40d4;return console[_0xeedb16(0x232)](t(_0xeedb16(0x1df))),CORE_IDE_LIST[_0xeedb16(0x211)]((_0x11b1e2,_0x513aea)=>{const _0x25790b=_0xeedb16;console['log']('\x20\x20'+(_0x513aea+0x1)+'.\x20'+IDE_CONFIGS[_0x11b1e2]['name']+_0x25790b(0x227)+IDE_CONFIGS[_0x11b1e2][_0x25790b(0x1e5)]);}),console['log'](_0xeedb16(0x222)+t(_0xeedb16(0x22d))),console[_0xeedb16(0x232)](_0xeedb16(0x22c)+t(_0xeedb16(0x1d0))+'\x0a'),console[_0xeedb16(0x232)](t(_0xeedb16(0x210))),console[_0xeedb16(0x232)](t(_0xeedb16(0x1f3))),new Promise(_0x1de1f1=>{const _0x2c7625=_0xeedb16,_0x227f92=createInterface({'input':process[_0x2c7625(0x1f5)],'output':process[_0x2c7625(0x21e)]});_0x227f92[_0x2c7625(0x1de)](t(_0x2c7625(0x215)),_0x5e0d82=>{const _0x487453=_0x2c7625;_0x227f92[_0x487453(0x21b)]();const _0x2e7bfc=_0x5e0d82['trim']()[_0x487453(0x228)]();(_0x2e7bfc==='q'||_0x2e7bfc===_0x487453(0x226)||_0x2e7bfc===_0x487453(0x22f))&&(console['log'](t('skill.select.cancelled')),process[_0x487453(0x22f)](0x0));if(_0x2e7bfc==='0'||_0x2e7bfc===_0x487453(0x1fa)){_0x1de1f1([_0x487453(0x1fa)]);return;}const _0x455843=_0x2e7bfc[_0x487453(0x20c)](/\s+/)['filter'](Boolean),_0x18e340=[];for(const _0x559d76 of _0x455843){const _0xc7a3f0=parseInt(_0x559d76,0xa);if(!isNaN(_0xc7a3f0)&&_0xc7a3f0>=0x1&&_0xc7a3f0<=CORE_IDE_LIST[_0x487453(0x1ce)]){const _0x2bb988=CORE_IDE_LIST[_0xc7a3f0-0x1];_0x2bb988&&!_0x18e340['includes'](_0x2bb988)&&_0x18e340['push'](_0x2bb988);}}_0x18e340[_0x487453(0x1ce)]===0x0&&(console['log'](t(_0x487453(0x23b))),process[_0x487453(0x22f)](0x0)),_0x1de1f1(_0x18e340);});});}function showHelp(){const _0x3f9e5e=a65_0x40d4;console[_0x3f9e5e(0x232)]('\x0a'+t('skill.help.title')+'\x0a\x0a'+t('skill.help.usage')+'\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('skill.help.showHelp')+_0x3f9e5e(0x220)+t(_0x3f9e5e(0x22a))+_0x3f9e5e(0x205)+t(_0x3f9e5e(0x238))+_0x3f9e5e(0x1f9)+t('skill.help.installAll')+_0x3f9e5e(0x21c)+t(_0x3f9e5e(0x200))+'\x0a\x0a'+t('skill.help.installMethods')+'\x0a'+t(_0x3f9e5e(0x1fc))+'\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a'+t(_0x3f9e5e(0x1e0))+'\x0a\x0a'+t(_0x3f9e5e(0x203))+'\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20'+t(_0x3f9e5e(0x238))+_0x3f9e5e(0x1fd)+t(_0x3f9e5e(0x20f))+'\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('skill.help.bffWorkflow')+_0x3f9e5e(0x237)+t(_0x3f9e5e(0x1d1))+_0x3f9e5e(0x1d9)+t(_0x3f9e5e(0x213))+_0x3f9e5e(0x1ec)+t(_0x3f9e5e(0x23a))+'\x0a\x0a'+t(_0x3f9e5e(0x1e6))+'\x0a'+t('skill.help.bffOption')+'\x0a\x0a'+t(_0x3f9e5e(0x1db))+'\x0a'+t('skill.help.skillContentsList')+'\x0a\x0a'+t(_0x3f9e5e(0x1ee))+_0x3f9e5e(0x219)+t(_0x3f9e5e(0x1f0))+_0x3f9e5e(0x207)+t(_0x3f9e5e(0x1d2))+_0x3f9e5e(0x1e8)+t(_0x3f9e5e(0x216))+_0x3f9e5e(0x1dd)+t(_0x3f9e5e(0x1d3))+'\x0a\x0a'+t(_0x3f9e5e(0x224))+'\x0a'+t(_0x3f9e5e(0x1d6))+'\x0a\x0a'+t(_0x3f9e5e(0x225))+_0x3f9e5e(0x1ed));}async function installSkill(_0x3aa39e,_0x3b237d){const _0x4ed4ba=a65_0x40d4,_0xfd4d62=process[_0x4ed4ba(0x1dc)](),_0x43687c=resolve(__dirname,_0x4ed4ba(0x209));let _0x5a4a19=[];!_0x3aa39e?_0x5a4a19=await selectIDEs():_0x5a4a19=[_0x3aa39e];_0x5a4a19[_0x4ed4ba(0x214)]('all')&&(_0x5a4a19=[...ALL_CORE_IDES,_0x4ed4ba(0x217)]);const _0x5f004e=[];for(const _0x3af9c5 of _0x5a4a19){if(_0x3af9c5===_0x4ed4ba(0x217))_0x5f004e['push']('agent');else{if(_0x3af9c5===_0x4ed4ba(0x1fa))continue;else IDE_CONFIGS[_0x3af9c5]?_0x5f004e['push'](_0x3af9c5):(console[_0x4ed4ba(0x232)](t('skill.error.unknownPlatform',{'ide':_0x3af9c5})),_0x5f004e[_0x4ed4ba(0x230)](_0x4ed4ba(0x217)));}}_0x5f004e[_0x4ed4ba(0x1ce)]===0x0&&(console[_0x4ed4ba(0x232)](t('skill.error.noValidIDE')),process[_0x4ed4ba(0x22f)](0x0));const _0x5b3df5=_0x3b237d&&_0x3b237d[_0x4ed4ba(0x1ce)]>0x0;console[_0x4ed4ba(0x232)](_0x5b3df5?t(_0x4ed4ba(0x1e3)):t('skill.cdn.fetching'));let _0x337839;try{_0x337839=await fetchGuidesFromCDN(_0x5b3df5),console[_0x4ed4ba(0x232)](t(_0x4ed4ba(0x1e1),{'count':Object[_0x4ed4ba(0x221)](_0x337839[_0x4ed4ba(0x1ef)])['length']}));}catch(_0x461652){console[_0x4ed4ba(0x234)](t('skill.cdn.fetchFailed',{'error':_0x461652 instanceof Error?_0x461652[_0x4ed4ba(0x20a)]:String(_0x461652)}));}let _0x8b20a7=0x0;for(const _0x4075d4 of _0x5f004e){try{const _0x509cdf=_0x4075d4===_0x4ed4ba(0x217)?t(_0x4ed4ba(0x229)):IDE_CONFIGS[_0x4075d4]?.[_0x4ed4ba(0x20d)]||_0x4075d4;console[_0x4ed4ba(0x232)](t(_0x4ed4ba(0x206),{'name':_0x509cdf}));const _0x34f136=_0x4075d4===_0x4ed4ba(0x217)?undefined:IDE_CONFIGS[_0x4075d4],_0x26de01=await installSingleIDE(_0x4075d4,_0x34f136,_0xfd4d62,_0x43687c,_0x337839,_0x3b237d);_0x8b20a7+=_0x26de01;if(_0x34f136?.[_0x4ed4ba(0x21d)])for(const _0x27960f of _0x34f136[_0x4ed4ba(0x21d)]){const _0x11300d=_0x34f136['files']?.[_0x4ed4ba(0x1f2)](_0x549d0c=>_0x549d0c['path'][_0x4ed4ba(0x22b)](_0x27960f+'/'))??![];_0x11300d?console[_0x4ed4ba(0x232)](t(_0x4ed4ba(0x1d7),{'path':_0x27960f})):console[_0x4ed4ba(0x232)](t('skill.installing.created',{'path':_0x27960f}));}if(_0x34f136?.[_0x4ed4ba(0x1f7)])for(const _0x125297 of _0x34f136[_0x4ed4ba(0x1f7)]){console[_0x4ed4ba(0x232)](t(_0x4ed4ba(0x202),{'path':_0x125297['path']}));}}catch(_0x524004){console[_0x4ed4ba(0x1f4)](t(_0x4ed4ba(0x22e),{'ide':_0x4075d4,'error':_0x524004 instanceof Error?_0x524004[_0x4ed4ba(0x20a)]:String(_0x524004)}));}}_0x337839&&writeGuidesToProject(_0x337839,_0xfd4d62,_0x4ed4ba(0x1fb),_0x3b237d);const _0x2e22ff={'version':'2.0.0','installedAt':new Date()[_0x4ed4ba(0x233)](),'platforms':_0x5f004e},_0x45de4f=join(_0xfd4d62,'.lovrabet/skill-manifest.json'),_0x54da5b=join(_0xfd4d62,'.lovrabet');await copyDir(_0x54da5b,_0x54da5b),writeFileSync(_0x45de4f,JSON[_0x4ed4ba(0x236)](_0x2e22ff,null,0x2),_0x4ed4ba(0x212)),console[_0x4ed4ba(0x232)](t(_0x4ed4ba(0x1f1))),console[_0x4ed4ba(0x232)](t('skill.done.success',{'count':_0x8b20a7})),console['log'](t(_0x4ed4ba(0x1ff))),console[_0x4ed4ba(0x232)](t(_0x4ed4ba(0x239))),logger[_0x4ed4ba(0x20b)](_0x4ed4ba(0x1d4),_0x4ed4ba(0x1d5),{'projectRoot':_0xfd4d62,'ides':_0x5f004e,'foldersCount':_0x8b20a7});}
|
|
1
|
+
function a65_0x458c(_0x399e5e,_0x2274d8){_0x399e5e=_0x399e5e-0xcc;const _0x20160f=a65_0x2016();let _0x458c18=_0x20160f[_0x399e5e];return _0x458c18;}const a65_0x252c0b=a65_0x458c;(function(_0x54d9bf,_0x8d6c0b){const _0xa852d9=a65_0x458c,_0x368c09=_0x54d9bf();while(!![]){try{const _0x401b3b=-parseInt(_0xa852d9(0xf1))/0x1+-parseInt(_0xa852d9(0xd5))/0x2*(parseInt(_0xa852d9(0x11a))/0x3)+parseInt(_0xa852d9(0xd4))/0x4*(parseInt(_0xa852d9(0x13a))/0x5)+-parseInt(_0xa852d9(0x133))/0x6+parseInt(_0xa852d9(0x11b))/0x7+-parseInt(_0xa852d9(0x10a))/0x8*(-parseInt(_0xa852d9(0x127))/0x9)+-parseInt(_0xa852d9(0x13e))/0xa*(-parseInt(_0xa852d9(0xdc))/0xb);if(_0x401b3b===_0x8d6c0b)break;else _0x368c09['push'](_0x368c09['shift']());}catch(_0x10a9c2){_0x368c09['push'](_0x368c09['shift']());}}}(a65_0x2016,0xcf84a));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';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a65_0x3aefc9 from'../i18n/index.js';const t=a65_0x3aefc9['t'][a65_0x252c0b(0xe8)](a65_0x3aefc9),__dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x304a24){const _0x46419a=a65_0x252c0b,_0x42e88f=[];for(const [_0x1b1ef5,_0x582dbb]of Object[_0x46419a(0x138)](_0x304a24)){if(_0x582dbb===!![]){const _0x16388e=_0x1b1ef5[_0x46419a(0x13f)](/([A-Z])/g,'-$1')[_0x46419a(0x105)]();_0x42e88f['push'](_0x16388e);}}return _0x42e88f;}export function parseDynamicFlags(){const _0x3a533c=a65_0x252c0b,_0x54fca8=[];for(let _0x2bf905=0x3;_0x2bf905<process[_0x3a533c(0x118)][_0x3a533c(0xf0)];_0x2bf905++){const _0x247af6=process[_0x3a533c(0x118)][_0x2bf905];if(_0x247af6&&_0x247af6[_0x3a533c(0xd1)]('--')){const _0x44e77a=_0x247af6[_0x3a533c(0x137)](0x2);_0x44e77a&&!_0x44e77a['includes']('=')&&_0x54fca8['push'](_0x44e77a);}}return _0x54fca8;}export function getAllProvidedFlags(_0x57d693){const _0x1c292d=a65_0x252c0b,_0x442dfb=camelCaseFlagsToKebab(_0x57d693),_0x6fa608=parseDynamicFlags(),_0x25fe53=new Set([..._0x442dfb,..._0x6fa608]);return Array[_0x1c292d(0x126)](_0x25fe53);}export async function skillsCommand(_0x5be5d2,_0x170ade,_0x535ec2){const _0x55d55f=a65_0x252c0b;logger['setLogPath'](process[_0x55d55f(0x11f)]());if(_0x535ec2?.['help']||_0x5be5d2===_0x55d55f(0xd3)){showHelp();return;}_0x5be5d2!==_0x55d55f(0x101)&&(console[_0x55d55f(0xcd)](t(_0x55d55f(0xdb),{'cmd':_0x5be5d2||_0x55d55f(0xec)})),console[_0x55d55f(0xd2)](t(_0x55d55f(0xe6))),console[_0x55d55f(0xd2)](t('skill.errorHint.installInteractive')),console[_0x55d55f(0xd2)](t(_0x55d55f(0xfc))),console[_0x55d55f(0xd2)](t(_0x55d55f(0xf5))),console[_0x55d55f(0xd2)](t(_0x55d55f(0x131))),console[_0x55d55f(0xd2)](t(_0x55d55f(0xf3))),console[_0x55d55f(0xd2)](t('skill.errorHint.exampleDirect')),logger[_0x55d55f(0xcd)]('skill','不支持的命令:\x20'+_0x5be5d2),process[_0x55d55f(0x128)](0x1));let _0x5c2053=_0x170ade?.[0x0];const _0x46230c=getAllProvidedFlags(_0x535ec2??{});_0x5c2053?.[_0x55d55f(0xd1)]('--')&&(_0x5c2053=undefined),await installSkill(_0x5c2053??_0x55d55f(0x13b),_0x46230c);}function a65_0x2016(){const _0x210a9f=['.lovrabet/skill-manifest.json','16504fHXtWk','skill.help.installWithBff','close','skill.select.inputFormat','name','question','skill.done.success','toISOString','skill.help.supportedIDEs','skill.help.installInteractive','trim','skill.help.installDirect','skill.help.title','folders','argv','skill.cdn.fetchSuccess','5283WuVFNO','1736903ilurdb','skill.help.installMethods','skill.help.afterInstall','skill.help.guidesLocationTitle','cwd','安装成功','split','\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','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a','skill.help.skillContents','skill.help.afterInstallList','from','5760ShKMfP','exit','skill.cdn.fetchingExtend','skill.generic','skill.help.bffOption','keys','stringify','\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','\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20','\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','skill.errorHint.usageExamples','skill.help.interactiveKeys','9998082DsFRkS','files','includes','../../cdn-source/skills','slice','entries','skill.installing.createdDir','5tJhyYt','agent','skill.select.inputHint','skill.cdn.fetchFailed','40VOCgKM','replace','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20','error','\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a','all','.lovrabet','startsWith','log','--help','4151276KDEkCj','566nOtWqd','skill.help.installAll','skill.help.exampleBffDesc','skill.select.prompt','skill.installing.created','stdout','skill.error.unsupportedCommand','4347101dWCbpo','message','skill.help.showHelp','2.0.0','\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','filter','skill.help.exampleDirectDesc','path','skill.done.guidesLocation','skill-install','skill.errorHint.availableCommands','skill.help.directInstall','bind','skill.help.examples','description','\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','(empty)','guides','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20','skill.error.noValidIDE','length','1172328QnsjXx','skill.help.exampleInteractive','skill.errorHint.exampleInteractive','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a','skill.errorHint.showHelp','some','skill.select.noneSelected','skill.select.cancel','skill.done.guidesPath','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a','skill.error.unknownPlatform','skill.errorHint.installDirect','skill.cdn.fetching','skill.help.agentDesc','skill.error.installFailed','\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','install','\x20\x20q.\x20','skill.select.installAll','push','toLowerCase','warn','skill.help.bffWorkflow','skill.select.cancelled'];a65_0x2016=function(){return _0x210a9f;};return a65_0x2016();}async function selectIDEs(){const _0x399590=a65_0x252c0b;return console[_0x399590(0xd2)](t('skill.select.title')),CORE_IDE_LIST['forEach']((_0x2d33e8,_0xb08512)=>{const _0x59ebd6=_0x399590;console['log']('\x20\x20'+(_0xb08512+0x1)+'.\x20'+IDE_CONFIGS[_0x2d33e8][_0x59ebd6(0x10e)]+'\x20-\x20'+IDE_CONFIGS[_0x2d33e8][_0x59ebd6(0xea)]);}),console[_0x399590(0xd2)]('\x20\x200.\x20'+t(_0x399590(0x103))),console['log'](_0x399590(0x102)+t(_0x399590(0xf8))+'\x0a'),console[_0x399590(0xd2)](t(_0x399590(0x10d))),console[_0x399590(0xd2)](t(_0x399590(0x13c))),new Promise(_0x454123=>{const _0x1e7f8c=_0x399590,_0xb75891=createInterface({'input':process['stdin'],'output':process[_0x1e7f8c(0xda)]});_0xb75891[_0x1e7f8c(0x10f)](t(_0x1e7f8c(0xd8)),_0x4eb30b=>{const _0x56f10c=_0x1e7f8c;_0xb75891[_0x56f10c(0x10c)]();const _0x501279=_0x4eb30b[_0x56f10c(0x114)]()[_0x56f10c(0x105)]();(_0x501279==='q'||_0x501279==='quit'||_0x501279===_0x56f10c(0x128))&&(console[_0x56f10c(0xd2)](t(_0x56f10c(0x108))),process['exit'](0x0));if(_0x501279==='0'||_0x501279==='all'){_0x454123(['all']);return;}const _0x558a01=_0x501279[_0x56f10c(0x121)](/\s+/)[_0x56f10c(0xe1)](Boolean),_0x12d5d7=[];for(const _0x1b6749 of _0x558a01){const _0xfb3230=parseInt(_0x1b6749,0xa);if(!isNaN(_0xfb3230)&&_0xfb3230>=0x1&&_0xfb3230<=CORE_IDE_LIST[_0x56f10c(0xf0)]){const _0x19c468=CORE_IDE_LIST[_0xfb3230-0x1];_0x19c468&&!_0x12d5d7[_0x56f10c(0x135)](_0x19c468)&&_0x12d5d7[_0x56f10c(0x104)](_0x19c468);}}_0x12d5d7[_0x56f10c(0xf0)]===0x0&&(console[_0x56f10c(0xd2)](t(_0x56f10c(0xf7))),process[_0x56f10c(0x128)](0x0)),_0x454123(_0x12d5d7);});});}function showHelp(){const _0x1229da=a65_0x252c0b;console[_0x1229da(0xd2)]('\x0a'+t(_0x1229da(0x116))+'\x0a\x0a'+t('skill.help.usage')+_0x1229da(0x130)+t(_0x1229da(0xde))+_0x1229da(0xeb)+t(_0x1229da(0x113))+_0x1229da(0xe0)+t(_0x1229da(0x115))+'\x0a\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')+_0x1229da(0x12f)+t(_0x1229da(0x10b))+'\x0a\x0a'+t(_0x1229da(0x11c))+'\x0a'+t('skill.help.interactiveSelect')+_0x1229da(0x123)+t(_0x1229da(0x132))+'\x0a\x0a'+t(_0x1229da(0xe7))+_0x1229da(0xee)+t(_0x1229da(0x115))+_0x1229da(0xcc)+t(_0x1229da(0xd6))+_0x1229da(0x100)+t(_0x1229da(0xd6))+'\x0a\x0a'+t(_0x1229da(0x107))+_0x1229da(0x122)+t(_0x1229da(0x112))+'\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(_0x1229da(0xfe))+'\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t('skill.help.allDesc')+'\x0a\x0a'+t('skill.help.options')+'\x0a'+t(_0x1229da(0x12b))+'\x0a\x0a'+t(_0x1229da(0x124))+'\x0a'+t('skill.help.skillContentsList')+'\x0a\x0a'+t(_0x1229da(0xe9))+_0x1229da(0xce)+t(_0x1229da(0xf2))+_0x1229da(0xfa)+t(_0x1229da(0xe2))+_0x1229da(0xf4)+t(_0x1229da(0xd7))+'\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a'+t('skill.help.exampleAllDesc')+'\x0a\x0a'+t(_0x1229da(0x11d))+'\x0a'+t(_0x1229da(0x125))+'\x0a\x0a'+t(_0x1229da(0x11e))+_0x1229da(0x12e));}async function installSkill(_0x17d1dc,_0x485a42){const _0x1a9224=a65_0x252c0b,_0x59a894=process[_0x1a9224(0x11f)](),_0x1cad86=resolve(__dirname,_0x1a9224(0x136));let _0x2b8cfe=[];!_0x17d1dc?_0x2b8cfe=await selectIDEs():_0x2b8cfe=[_0x17d1dc];_0x2b8cfe[_0x1a9224(0x135)](_0x1a9224(0xcf))&&(_0x2b8cfe=[...ALL_CORE_IDES,'agent']);const _0xf4e21b=[];for(const _0x4b3dbd of _0x2b8cfe){if(_0x4b3dbd===_0x1a9224(0x13b))_0xf4e21b['push'](_0x1a9224(0x13b));else{if(_0x4b3dbd===_0x1a9224(0xcf))continue;else IDE_CONFIGS[_0x4b3dbd]?_0xf4e21b['push'](_0x4b3dbd):(console['log'](t(_0x1a9224(0xfb),{'ide':_0x4b3dbd})),_0xf4e21b[_0x1a9224(0x104)](_0x1a9224(0x13b)));}}_0xf4e21b[_0x1a9224(0xf0)]===0x0&&(console[_0x1a9224(0xd2)](t(_0x1a9224(0xef))),process[_0x1a9224(0x128)](0x0));const _0x22c4d6=_0x485a42&&_0x485a42[_0x1a9224(0xf0)]>0x0;console[_0x1a9224(0xd2)](_0x22c4d6?t(_0x1a9224(0x129)):t(_0x1a9224(0xfd)));let _0x16cf83;try{_0x16cf83=await fetchGuidesFromCDN(_0x22c4d6),console[_0x1a9224(0xd2)](t(_0x1a9224(0x119),{'count':Object[_0x1a9224(0x12c)](_0x16cf83[_0x1a9224(0xed)])[_0x1a9224(0xf0)]}));}catch(_0x48b8e0){console[_0x1a9224(0x106)](t(_0x1a9224(0x13d),{'error':_0x48b8e0 instanceof Error?_0x48b8e0[_0x1a9224(0xdd)]:String(_0x48b8e0)}));}let _0x1ad78f=0x0;for(const _0x28e468 of _0xf4e21b){try{const _0x37da53=_0x28e468===_0x1a9224(0x13b)?t(_0x1a9224(0x12a)):IDE_CONFIGS[_0x28e468]?.[_0x1a9224(0x10e)]||_0x28e468;console[_0x1a9224(0xd2)](t('skill.installing.ide',{'name':_0x37da53}));const _0x332d03=_0x28e468==='agent'?undefined:IDE_CONFIGS[_0x28e468],_0x2015b2=await installSingleIDE(_0x28e468,_0x332d03,_0x59a894,_0x1cad86,_0x16cf83,_0x485a42);_0x1ad78f+=_0x2015b2;if(_0x332d03?.[_0x1a9224(0x117)])for(const _0x22985d of _0x332d03[_0x1a9224(0x117)]){const _0x34606a=_0x332d03['files']?.[_0x1a9224(0xf6)](_0x33864d=>_0x33864d['path']['startsWith'](_0x22985d+'/'))??![];_0x34606a?console[_0x1a9224(0xd2)](t(_0x1a9224(0x139),{'path':_0x22985d})):console[_0x1a9224(0xd2)](t(_0x1a9224(0xd9),{'path':_0x22985d}));}if(_0x332d03?.[_0x1a9224(0x134)])for(const _0x52e3fb of _0x332d03[_0x1a9224(0x134)]){console[_0x1a9224(0xd2)](t(_0x1a9224(0xd9),{'path':_0x52e3fb[_0x1a9224(0xe3)]}));}}catch(_0x3b7a37){console['error'](t(_0x1a9224(0xff),{'ide':_0x28e468,'error':_0x3b7a37 instanceof Error?_0x3b7a37[_0x1a9224(0xdd)]:String(_0x3b7a37)}));}}_0x16cf83&&writeGuidesToProject(_0x16cf83,_0x59a894,'.lovrabet/skill/.shared/guides',_0x485a42);const _0x58f30c={'version':_0x1a9224(0xdf),'installedAt':new Date()[_0x1a9224(0x111)](),'platforms':_0xf4e21b},_0x185961=join(_0x59a894,_0x1a9224(0x109)),_0x38a554=join(_0x59a894,_0x1a9224(0xd0));await copyDir(_0x38a554,_0x38a554),writeFileSync(_0x185961,JSON[_0x1a9224(0x12d)](_0x58f30c,null,0x2),'utf-8'),console[_0x1a9224(0xd2)](t('skill.installing.createdManifest')),console[_0x1a9224(0xd2)](t(_0x1a9224(0x110),{'count':_0x1ad78f})),console[_0x1a9224(0xd2)](t(_0x1a9224(0xe4))),console[_0x1a9224(0xd2)](t(_0x1a9224(0xf9))),logger['info'](_0x1a9224(0xe5),_0x1a9224(0x120),{'projectRoot':_0x59a894,'ides':_0xf4e21b,'foldersCount':_0x1ad78f});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x9a1fc3=a66_0x50f6;(function(_0x2216b3,_0x3d54f6){const _0x489047=a66_0x50f6,_0x29ea7f=_0x2216b3();while(!![]){try{const _0x24710b=parseInt(_0x489047(0x1f7))/0x1+parseInt(_0x489047(0x1ea))/0x2+-parseInt(_0x489047(0x1fa))/0x3+parseInt(_0x489047(0x1e7))/0x4+-parseInt(_0x489047(0x1f6))/0x5+-parseInt(_0x489047(0x1f0))/0x6+parseInt(_0x489047(0x1f5))/0x7;if(_0x24710b===_0x3d54f6)break;else _0x29ea7f['push'](_0x29ea7f['shift']());}catch(_0x4b614f){_0x29ea7f['push'](_0x29ea7f['shift']());}}}(a66_0x4c1f,0xb7451));import{writeFileSync,existsSync,mkdirSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';function a66_0x50f6(_0x31ca09,_0x939480){_0x31ca09=_0x31ca09-0x1de;const _0x4c1f2d=a66_0x4c1f();let _0x50f6b2=_0x4c1f2d[_0x31ca09];return _0x50f6b2;}import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';function a66_0x4c1f(){const _0x6666cc=['2496562lZZLKC','message','skill.error.unknownIDE','warn','skill.cdn.fetchSuccess','skill.error.installFailed','3527898zRemUj','keys','utf-8','length','\x20\x20✓\x20','6698398qSghTj','3873120NFYlHm','488479nqPCuu','toISOString','name','2847639OopHET','log','.lovrabet/skill/.shared/guides','skill.done.guidesPathInline','skill-install-non-interactive','info','bind','2.0.0','stringify','开始安装技能包','1475276Ciutgg','.lovrabet','.lovrabet/skill-manifest.json'];a66_0x4c1f=function(){return _0x6666cc;};return a66_0x4c1f();}import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a66_0x5ab4fb from'../i18n/index.js';const t=a66_0x5ab4fb['t'][a66_0x9a1fc3(0x1e3)](a66_0x5ab4fb),__dirname=dirname(fileURLToPath(import.meta.url));export async function installSkillsNonInteractive(_0x73547a,_0x2f66c8,_0x761dc0=process['cwd']()){const _0x24207f=a66_0x9a1fc3,_0x727615=resolve(__dirname,'../../cdn-source/skills');logger['setLogPath'](_0x761dc0),logger[_0x24207f(0x1e2)](_0x24207f(0x1e1),_0x24207f(0x1e6),{'ides':_0x73547a});const _0x3bfd1e=join(_0x761dc0,_0x24207f(0x1e8));!existsSync(_0x3bfd1e)&&mkdirSync(_0x3bfd1e,{'recursive':!![]});const _0x52449a=_0x2f66c8&&_0x2f66c8[_0x24207f(0x1f3)]>0x0;console[_0x24207f(0x1de)](_0x52449a?t('skill.cdn.fetchingExtend'):t('skill.cdn.fetching'));let _0xb8c12b;try{_0xb8c12b=await fetchGuidesFromCDN(_0x52449a),console[_0x24207f(0x1de)](t(_0x24207f(0x1ee),{'count':Object[_0x24207f(0x1f1)](_0xb8c12b['guides'])[_0x24207f(0x1f3)]}));}catch(_0x2c05ef){console[_0x24207f(0x1ed)](t('skill.cdn.fetchFailed',{'error':_0x2c05ef instanceof Error?_0x2c05ef[_0x24207f(0x1eb)]:String(_0x2c05ef)}));}let _0x1eb29f=0x0;for(const _0x53f00d of _0x73547a){try{const _0x82067c=IDE_CONFIGS[_0x53f00d];if(!_0x82067c){console[_0x24207f(0x1ed)](t(_0x24207f(0x1ec),{'ide':_0x53f00d}));continue;}const _0x4f8a94=await installSingleIDE(_0x53f00d,_0x82067c,_0x761dc0,_0x727615,_0xb8c12b,_0x2f66c8);_0x1eb29f+=_0x4f8a94,console[_0x24207f(0x1de)](_0x24207f(0x1f4)+(_0x82067c[_0x24207f(0x1f9)]||_0x53f00d));}catch(_0x202e01){console['error'](t(_0x24207f(0x1ef),{'ide':_0x53f00d,'error':_0x202e01 instanceof Error?_0x202e01[_0x24207f(0x1eb)]:String(_0x202e01)}));}}_0xb8c12b&&writeGuidesToProject(_0xb8c12b,_0x761dc0,_0x24207f(0x1df),_0x2f66c8);const _0x42314c={'version':_0x24207f(0x1e4),'installedAt':new Date()[_0x24207f(0x1f8)](),'platforms':_0x73547a},_0x263c7b=join(_0x761dc0,_0x24207f(0x1e9));writeFileSync(_0x263c7b,JSON[_0x24207f(0x1e5)](_0x42314c,null,0x2),_0x24207f(0x1f2)),logger[_0x24207f(0x1e2)]('skill-install-non-interactive','安装成功',{'projectRoot':_0x761dc0,'ides':_0x73547a,'foldersCount':_0x1eb29f}),console[_0x24207f(0x1de)](t('skill.done.success',{'count':_0x1eb29f})),console[_0x24207f(0x1de)](t(_0x24207f(0x1e0)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x16bf18,_0x2717b4){const _0x2435f7=a67_0x432b,_0x41e098=_0x16bf18();while(!![]){try{const _0x1f68a7=parseInt(_0x2435f7(0xb0))/0x1+parseInt(_0x2435f7(0xa2))/0x2+-parseInt(_0x2435f7(0xb4))/0x3+parseInt(_0x2435f7(0xa6))/0x4*(parseInt(_0x2435f7(0xb1))/0x5)+-parseInt(_0x2435f7(0x9d))/0x6+-parseInt(_0x2435f7(0xb6))/0x7+-parseInt(_0x2435f7(0xac))/0x8*(parseInt(_0x2435f7(0xae))/0x9);if(_0x1f68a7===_0x2717b4)break;else _0x41e098['push'](_0x41e098['shift']());}catch(_0x24227c){_0x41e098['push'](_0x41e098['shift']());}}}(a67_0x3606,0x6cf65));function a67_0x3606(){const _0x32809f=['606972AfNhoq','replace','startsWith','folders','sort','title','8puWAsW','template','1720161qOTiYv','includes','763033yJZazm','25cBAVKi','|\x20`','name','1491465CXWVUX','\x0a<!--\x20GUIDES_APPEND\x20-->','5925955RvNRAW','utf-8','guides','requireFlags','indexOf','files','<!--\x20GUIDES_APPEND\x20-->','2243940MVZgyX','push','keys','length','join','1666800uZagUE','test','path','some'];a67_0x3606=function(){return _0x32809f;};return a67_0x3606();}import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';function a67_0x432b(_0x1eb2ed,_0x28354a){_0x1eb2ed=_0x1eb2ed-0x9b;const _0x360675=a67_0x3606();let _0x432b53=_0x360675[_0x1eb2ed];return _0x432b53;}import{dirname,join}from'node:path';import{writeSkillFile,appendExtendContents}from'../utils/guides-cdn.js';export async function installSingleIDE(_0x4a9bf8,_0x1cd044,_0x397df5,_0x1021e7,_0x7895d,_0x473b2a){const _0xfd90d5=a67_0x432b;let _0x2fc06f=0x0;const _0x35e9b7=_0x1cd044?.[_0xfd90d5(0xa9)]??['.'+_0x4a9bf8];for(const _0x4fcf22 of _0x35e9b7){const _0x354dac=join(_0x397df5,_0x4fcf22),_0xc94900=_0x1cd044?.[_0xfd90d5(0x9b)]?.[_0xfd90d5(0xa5)](_0x3ffaa1=>_0x3ffaa1[_0xfd90d5(0xa4)][_0xfd90d5(0xa8)](_0x4fcf22+'/'))??![];_0xc94900?!existsSync(_0x354dac)&&(mkdirSync(_0x354dac,{'recursive':!![]}),_0x2fc06f++):!existsSync(_0x354dac)&&(writeFileSync(_0x354dac,'',_0xfd90d5(0xb7)),_0x2fc06f++);}if(_0x1cd044?.[_0xfd90d5(0x9b)]){const _0x50938b=_0x1cd044[_0xfd90d5(0xb3)]||_0x4a9bf8;for(const _0x530e25 of _0x1cd044[_0xfd90d5(0x9b)]){const _0x2f5249=join(_0x397df5,_0x530e25['path']);await createFileFromTemplate(_0x530e25,_0x2f5249,_0x50938b,_0x1021e7,_0x7895d,_0x473b2a),_0x2fc06f++;}}return _0x2fc06f;}export async function createFileFromTemplate(_0x109b98,_0x4a267c,_0x4fb381,_0x24032d,_0xfa0e68,_0x383e75){const _0x22bd5e=a67_0x432b,_0x3938bf=dirname(_0x4a267c);!existsSync(_0x3938bf)&&mkdirSync(_0x3938bf,{'recursive':!![]});const _0x1c9aae=_0x109b98[_0x22bd5e(0xad)]==='SKILL.md.tpl';if(existsSync(_0x4a267c)&&!_0x1c9aae)return;if(_0x109b98[_0x22bd5e(0xad)]){const _0x69d4c3=join(_0x24032d,_0x109b98[_0x22bd5e(0xad)]);if(existsSync(_0x69d4c3)){let _0x56b990=readFileSync(_0x69d4c3,_0x22bd5e(0xb7));_0x56b990=_0x56b990['replace'](/\{\{IDE_NAME\}\}/g,_0x4fb381);_0xfa0e68&&_0x1c9aae&&(_0x56b990=insertGuidesSection(_0x56b990,_0xfa0e68,_0x383e75),_0x56b990=appendExtendContents(_0x56b990,_0xfa0e68,_0x383e75));writeFileSync(_0x4a267c,_0x56b990,'utf-8');return;}if(_0xfa0e68&&_0x1c9aae)try{writeSkillFile(_0xfa0e68,_0x4a267c,_0x4fb381,_0x383e75);return;}catch{}}writeFileSync(_0x4a267c,'','utf-8');}function insertGuidesSection(_0x1c7101,_0x42c160,_0x5f225e){const _0x1efd2a=a67_0x432b,_0x2df87b='<!--\x20GUIDES_APPEND\x20-->',_0x295064=_0x1c7101[_0x1efd2a(0xba)](_0x2df87b);if(_0x295064===-0x1)return _0x1c7101;const _0x4ffd30=[],_0xbbc1b=Object[_0x1efd2a(0x9f)](_0x42c160[_0x1efd2a(0xb8)])[_0x1efd2a(0xaa)]();for(const _0x14ec3c of _0xbbc1b){const _0x19bc56=_0x42c160[_0x1efd2a(0xb8)][_0x14ec3c];if(!_0x19bc56)continue;if(/^0[1-6]-/[_0x1efd2a(0xa3)](_0x14ec3c))continue;if(_0x19bc56[_0x1efd2a(0xb9)]&&_0x19bc56['requireFlags'][_0x1efd2a(0xa0)]>0x0){const _0x369d0e=_0x19bc56[_0x1efd2a(0xb9)]['some'](_0x1a266d=>_0x5f225e?.[_0x1efd2a(0xaf)](_0x1a266d));if(!_0x369d0e)continue;}const _0x5586eb=_0x19bc56[_0x1efd2a(0xa4)][_0x1efd2a(0xa7)](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x4ffd30[_0x1efd2a(0x9e)](_0x1efd2a(0xb2)+_0x5586eb+'`\x20|\x20'+_0x19bc56[_0x1efd2a(0xab)]+'\x20|');}if(_0x4ffd30[_0x1efd2a(0xa0)]===0x0)return _0x1c7101[_0x1efd2a(0xa7)](_0x2df87b,_0x1efd2a(0x9c));const _0x113d9f=_0x4ffd30[_0x1efd2a(0xa1)]('\x0a');return _0x1c7101[_0x1efd2a(0xa7)](_0x2df87b,_0x113d9f+_0x1efd2a(0xb5));}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3728e2,_0x2e2abb){const _0x16c03a=a69_0x275e,_0x528d86=_0x3728e2();while(!![]){try{const _0x5a4757=parseInt(_0x16c03a(0xde))/0x1*(-parseInt(_0x16c03a(0xe9))/0x2)+parseInt(_0x16c03a(0xe7))/0x3*(-parseInt(_0x16c03a(0xe4))/0x4)+-parseInt(_0x16c03a(0xe2))/0x5+parseInt(_0x16c03a(0xed))/0x6+parseInt(_0x16c03a(0xe1))/0x7+-parseInt(_0x16c03a(0xef))/0x8*(parseInt(_0x16c03a(0xdc))/0x9)+parseInt(_0x16c03a(0xea))/0xa;if(_0x5a4757===_0x2e2abb)break;else _0x528d86['push'](_0x528d86['shift']());}catch(_0x1b0a3e){_0x528d86['push'](_0x528d86['shift']());}}}(a69_0x2d3f,0x741c5));import{jsxs as a69_0xf581b,jsx as a69_0x3e2796}from'react/jsx-runtime';import{Text,Box}from'ink';function a69_0x275e(_0x563b59,_0x217408){_0x563b59=_0x563b59-0xdc;const _0x2d3f96=a69_0x2d3f();let _0x275e39=_0x2d3f96[_0x563b59];return _0x275e39;}import{useI18n}from'../i18n/hooks.js';export function IDESelector({ideList:_0x238cb9,title:_0x43ae59,selection:_0x1e6700}){const _0x22955c=a69_0x275e,{t:_0x3bc33d}=useI18n(),{selectedIndexes:_0xa345c6,highlightIndex:_0x277aba,errorMsg:_0xd80045}=_0x1e6700;return a69_0xf581b(Box,{'flexDirection':_0x22955c(0xee),'marginTop':0x1,'children':[a69_0x3e2796(Box,{'children':a69_0xf581b(Text,{'color':_0x22955c(0xdf),'children':['*\x20',_0x43ae59]})}),_0xd80045&&a69_0x3e2796(Box,{'marginTop':0x1,'children':a69_0xf581b(Text,{'color':'red','children':['✗\x20',_0xd80045]})}),a69_0xf581b(Box,{'marginTop':0x1,'flexDirection':'column','children':[a69_0xf581b(Text,{'bold':!![],'children':['*\x20',_0x3bc33d('ui.ideSelector.title')]}),_0x238cb9[_0x22955c(0xe6)]((_0x567643,_0x1d2d04)=>{const _0x190f63=_0x22955c,_0x98f7e8=_0x277aba===_0x1d2d04,_0x11aded=_0xa345c6[_0x190f63(0xf1)](_0x1d2d04);return a69_0x3e2796(Box,{'children':a69_0xf581b(Text,{'backgroundColor':_0x98f7e8?_0x190f63(0xdd):undefined,'color':_0x98f7e8?_0x190f63(0xe8):undefined,'children':['\x20\x20',_0x11aded?_0x190f63(0xe0):_0x190f63(0xf0),'\x20',_0x567643['name'],'\x20',a69_0xf581b(Text,{'color':_0x98f7e8?_0x190f63(0xe8):_0x190f63(0xe5),'dimColor':!_0x98f7e8,'children':['-\x20',_0x567643[_0x190f63(0xeb)]]})]})},_0x567643[_0x190f63(0xec)]);}),a69_0x3e2796(Box,{'marginTop':0x1,'children':a69_0xf581b(Text,{'color':_0x22955c(0xe5),'children':['\x20',_0x3bc33d(_0x22955c(0xe3))]})})]})]});}function a69_0x2d3f(){const _0xc7f107=['22782aCOEdO','column','8euieUZ','[\x20]','has','1073178ZHzScm','blue','1uiNnar','cyan','[✓]','4629079UkXmLE','220045sytACk','ui.ideSelector.hotkeys','5732vNncOv','gray','map','1176YsKSuN','white','1108694nwViHN','10898290gIIxtj','description','key'];a69_0x2d3f=function(){return _0xc7f107;};return a69_0x2d3f();}export{useIDESelection}from'./useIDESelection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a70_0x35c1(_0x4bfbea,_0x54db81){_0x4bfbea=_0x4bfbea-0x12d;const _0x49d69b=a70_0x49d6();let _0x35c140=_0x49d69b[_0x4bfbea];return _0x35c140;}(function(_0x4e6812,_0x4440a0){const _0x2758ff=a70_0x35c1,_0x2d6b51=_0x4e6812();while(!![]){try{const _0x63fac3=parseInt(_0x2758ff(0x134))/0x1*(-parseInt(_0x2758ff(0x132))/0x2)+parseInt(_0x2758ff(0x133))/0x3+-parseInt(_0x2758ff(0x13e))/0x4+parseInt(_0x2758ff(0x12d))/0x5+-parseInt(_0x2758ff(0x13b))/0x6+parseInt(_0x2758ff(0x139))/0x7+-parseInt(_0x2758ff(0x131))/0x8;if(_0x63fac3===_0x4440a0)break;else _0x2d6b51['push'](_0x2d6b51['shift']());}catch(_0xa3736b){_0x2d6b51['push'](_0x2d6b51['shift']());}}}(a70_0x49d6,0xc50e8));import{useState,useCallback}from'react';export function useIDESelection({ideList:_0x1e339d,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x501d7f=a70_0x35c1,[_0x2d2a34,_0x47a133]=useState(new Set(preselectedIDEs['map'](_0x3d59c3=>_0x1e339d[_0x501d7f(0x140)](_0x2811c2=>_0x2811c2[_0x501d7f(0x12f)]===_0x3d59c3))[_0x501d7f(0x130)](_0x3a5655=>_0x3a5655>=0x0))),[_0x384393,_0xbb2a1f]=useState(0x0),[_0x3c476a,_0x5b7e9b]=useState(''),_0xd3daca=useCallback(()=>{_0xbb2a1f(_0x73c40f=>_0x73c40f>0x0?_0x73c40f-0x1:_0x1e339d['length']-0x1);},[_0x1e339d[_0x501d7f(0x138)]]),_0x11c30e=useCallback(()=>{_0xbb2a1f(_0x313365=>_0x313365<_0x1e339d['length']-0x1?_0x313365+0x1:0x0);},[_0x1e339d[_0x501d7f(0x138)]]),_0x1e2e91=useCallback(()=>{if(!multiSelect){_0x47a133(new Set([_0x384393]));return;}_0x47a133(_0x37a5d3=>{const _0x3e920e=a70_0x35c1,_0x244610=new Set(_0x37a5d3);return _0x244610[_0x3e920e(0x13a)](_0x384393)?_0x244610[_0x3e920e(0x13f)](_0x384393):_0x244610[_0x3e920e(0x12e)](_0x384393),_0x244610;});},[_0x384393,multiSelect]),_0x50e089=useCallback(()=>{const _0x18577b=_0x501d7f;_0x47a133(new Set(_0x1e339d[_0x18577b(0x136)]((_0x189fff,_0x4d21f3)=>_0x4d21f3)));},[_0x1e339d]),_0x28f1f4=useCallback(()=>{_0x47a133(_0x46ba55=>{const _0x1a617a=a70_0x35c1,_0x37ccd7=new Set();for(let _0x3cf883=0x0;_0x3cf883<_0x1e339d[_0x1a617a(0x138)];_0x3cf883++){!_0x46ba55[_0x1a617a(0x13a)](_0x3cf883)&&_0x37ccd7[_0x1a617a(0x12e)](_0x3cf883);}return _0x37ccd7;});},[_0x1e339d]),_0x266864=useCallback(()=>{const _0x2db634=_0x501d7f;return Array[_0x2db634(0x137)](_0x2d2a34)[_0x2db634(0x136)](_0x5e9aec=>_0x1e339d[_0x5e9aec]?.[_0x2db634(0x12f)])[_0x2db634(0x130)](_0x468ac9=>_0x468ac9!==undefined);},[_0x2d2a34,_0x1e339d]),_0x41387a=useCallback(()=>{const _0x518990=_0x501d7f;return _0x2d2a34[_0x518990(0x13d)]===_0x1e339d[_0x518990(0x138)];},[_0x2d2a34,_0x1e339d]),_0x499b00=useCallback((_0x24e366,_0x18c47d)=>{const _0x16d378=_0x501d7f;if(_0x18c47d[_0x16d378(0x135)])return _0xd3daca(),!![];if(_0x18c47d[_0x16d378(0x13c)])return _0x11c30e(),!![];if(_0x24e366==='\x20')return _0x1e2e91(),!![];if(_0x24e366==='a'||_0x24e366==='A')return _0x50e089(),!![];if(_0x24e366==='i'||_0x24e366==='I'||_0x24e366==='r'||_0x24e366==='R')return _0x28f1f4(),!![];return![];},[_0xd3daca,_0x11c30e,_0x1e2e91,_0x50e089,_0x28f1f4]);return{'selectedIndexes':_0x2d2a34,'highlightIndex':_0x384393,'errorMsg':_0x3c476a,'setErrorMsg':_0x5b7e9b,'handleKeyDown':_0x499b00,'getSelectedIDEs':_0x266864,'isAllSelected':_0x41387a,'toggleSelection':_0x1e2e91,'selectAll':_0x50e089,'invertSelection':_0x28f1f4,'moveHighlightUp':_0xd3daca,'moveHighlightDown':_0x11c30e};}function a70_0x49d6(){const _0x34ba3c=['6639860YxNioJ','add','key','filter','5142176BXYCyQ','1921072yGiydt','2611134SYcoyu','1HsobiG','upArrow','map','from','length','10775611HUXbVX','has','1246182OAvEWh','downArrow','size','4478296foSnMs','delete','findIndex'];a70_0x49d6=function(){return _0x34ba3c;};return a70_0x49d6();}
|