@lovrabet/cli 1.3.2 → 1.3.4-beta.0
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 -0
- package/lib/i18n/hooks.js +1 -0
- package/lib/i18n/index.js +1 -0
- package/lib/i18n/locales/en-US.js +1 -0
- package/lib/i18n/locales/zh-CN.js +1 -0
- 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 +6 -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
|
-
|
|
1
|
+
(function(_0x45452b,_0x1afb90){const _0xdd148=a58_0x3b6a,_0x331321=_0x45452b();while(!![]){try{const _0x3e2345=parseInt(_0xdd148(0x14e))/0x1*(parseInt(_0xdd148(0x135))/0x2)+-parseInt(_0xdd148(0x15c))/0x3*(-parseInt(_0xdd148(0x151))/0x4)+-parseInt(_0xdd148(0x13d))/0x5+-parseInt(_0xdd148(0x14c))/0x6+parseInt(_0xdd148(0x152))/0x7+parseInt(_0xdd148(0x13e))/0x8*(parseInt(_0xdd148(0x14a))/0x9)+parseInt(_0xdd148(0x154))/0xa*(-parseInt(_0xdd148(0x14f))/0xb);if(_0x3e2345===_0x1afb90)break;else _0x331321['push'](_0x331321['shift']());}catch(_0x55386f){_0x331321['push'](_0x331321['shift']());}}}(a58_0x5081,0x8e8a5));import{jsx as a58_0x2f18c8,jsxs as a58_0x4a5d70,Fragment as a58_0x374f57}from'react/jsx-runtime';function a58_0x3b6a(_0x115c83,_0x48d4dc){_0x115c83=_0x115c83-0x131;const _0x508179=a58_0x5081();let _0x3b6a08=_0x508179[_0x115c83];return _0x3b6a08;}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_0x4331e8 from'../i18n/index.js';export function McpInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x1122bc=a58_0x3b6a,{t:_0x2e11b2}=useI18n(),{exit:_0x3a01f1}=useApp(),[_0x27dec0,_0x2c23db]=useState(_0x1122bc(0x162)),[_0xa732e3,_0x385b2d]=useState([]),[_0x50df5e,_0x17337a]=useState([]),_0x4c08f4=useMemo(()=>[...Array['from'](MCP_IDES)[_0x1122bc(0x13b)](_0x112edd=>({'key':_0x112edd,'name':IDE_CONFIGS[_0x112edd][_0x1122bc(0x148)],'description':IDE_CONFIGS[_0x112edd][_0x1122bc(0x145)]})),{'key':_0x1122bc(0x141),'name':_0x2e11b2(_0x1122bc(0x131)),'description':_0x2e11b2(_0x1122bc(0x143))}],[_0x2e11b2]),_0x3a00ec=useIDESelection({'ideList':_0x4c08f4,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0x24bd5b=_0x1122bc;preselectedIDEs[_0x24bd5b(0x13c)]>0x0&&_0x3a00ec['selectedIndexes']['size']>0x0&&_0xf41e24();},[]),useInput((_0x1d3b70,_0x21e3fc)=>{const _0x553655=_0x1122bc;if(_0x27dec0===_0x553655(0x162)){if(_0x1d3b70==='q'||_0x1d3b70==='Q'){_0x3a01f1();return;}if(_0x21e3fc[_0x553655(0x133)]){if(_0x3a00ec[_0x553655(0x165)][_0x553655(0x153)]===0x0){_0x3a00ec['setErrorMsg'](_0x2e11b2(_0x553655(0x13a)));return;}_0xf41e24();return;}_0x3a00ec[_0x553655(0x134)](_0x1d3b70,_0x21e3fc);}_0x27dec0===_0x553655(0x15d)&&_0x3a01f1();});async function _0xf41e24(){const _0x32416b=_0x1122bc,_0x1f7731=_0x3a00ec['getSelectedIDEs']();_0x385b2d([{'label':_0x2e11b2(_0x32416b(0x13f)),'value':_0x2e11b2(_0x32416b(0x157),{'count':_0x3a00ec[_0x32416b(0x165)]['size']})}]),_0x2c23db(_0x32416b(0x159));const _0x14a640=[];for(const _0x29e2bf of _0x1f7731){try{const _0x354158=await configureMcp(_0x29e2bf);_0x14a640[_0x32416b(0x15f)]({'ide':_0x4c08f4[_0x32416b(0x14d)](_0x3465c2=>_0x3465c2['key']===_0x29e2bf)?.[_0x32416b(0x148)]||_0x29e2bf,'status':_0x354158[_0x32416b(0x139)]?_0x32416b(0x167):_0x354158[_0x32416b(0x138)]?_0x32416b(0x138):'error','message':_0x354158['message']});}catch(_0x10df87){_0x14a640[_0x32416b(0x15f)]({'ide':_0x4c08f4[_0x32416b(0x14d)](_0x439153=>_0x439153[_0x32416b(0x163)]===_0x29e2bf)?.['name']||_0x29e2bf,'status':'error','message':_0x10df87 instanceof Error?_0x10df87[_0x32416b(0x158)]:String(_0x10df87)});}}_0x17337a(_0x14a640),_0x2c23db(_0x32416b(0x15d)),setTimeout(()=>{_0x3a01f1();},0x1388);}return a58_0x4a5d70(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x27dec0===_0x1122bc(0x162)&&a58_0x2f18c8(IDESelector,{'ideList':_0x4c08f4,'title':_0x2e11b2(_0x1122bc(0x160)),'selection':_0x3a00ec}),_0x27dec0===_0x1122bc(0x159)&&a58_0x4a5d70(a58_0x374f57,{'children':[_0xa732e3[_0x1122bc(0x13b)]((_0x4edf2d,_0x57d9a3)=>a58_0x4a5d70(Box,{'children':[a58_0x4a5d70(Text,{'color':_0x1122bc(0x147),'children':['√\x20',_0x4edf2d[_0x1122bc(0x144)],':\x20']}),a58_0x2f18c8(Text,{'color':_0x1122bc(0x164),'children':_0x4edf2d[_0x1122bc(0x156)]})]},_0x57d9a3)),a58_0x2f18c8(Box,{'marginTop':0x1,'children':a58_0x2f18c8(Text,{'children':_0x2e11b2('mcp.ui.configuring')})})]}),_0x27dec0===_0x1122bc(0x15d)&&a58_0x2f18c8(DoneStep,{'configResults':_0x50df5e})]});}function DoneStep({configResults:_0x99d5a3}){const _0x3ae246=a58_0x3b6a,{t:_0x231acc}=useI18n(),_0x2aac29=_0x99d5a3[_0x3ae246(0x15a)](_0xbb67eb=>_0xbb67eb[_0x3ae246(0x142)]===_0x3ae246(0x138)),_0x50d8a1=_0x99d5a3['some'](_0x12e70d=>_0x12e70d[_0x3ae246(0x142)]==='manual'),_0x25fe08=_0x99d5a3[_0x3ae246(0x149)](_0x5f0759=>_0x5f0759[_0x3ae246(0x142)]==='error');return a58_0x4a5d70(a58_0x374f57,{'children':[a58_0x2f18c8(Box,{'children':_0x2aac29?a58_0x2f18c8(Text,{'color':_0x3ae246(0x147),'children':_0x231acc('mcp.ui.completed')}):_0x50d8a1?a58_0x2f18c8(Text,{'color':'yellow','children':_0x231acc(_0x3ae246(0x132))}):_0x25fe08?a58_0x2f18c8(Text,{'color':'red','children':_0x231acc(_0x3ae246(0x150))}):a58_0x2f18c8(Text,{'color':_0x3ae246(0x161),'children':_0x231acc(_0x3ae246(0x155))})}),_0x99d5a3[_0x3ae246(0x13b)]((_0x7bf2e8,_0x4b376d)=>a58_0x4a5d70(Box,{'flexDirection':_0x3ae246(0x166),'children':[a58_0x4a5d70(Text,{'color':_0x7bf2e8[_0x3ae246(0x142)]===_0x3ae246(0x138)?_0x3ae246(0x147):_0x7bf2e8[_0x3ae246(0x142)]===_0x3ae246(0x167)?_0x3ae246(0x161):_0x3ae246(0x137),'children':[_0x7bf2e8[_0x3ae246(0x142)]==='success'?_0x3ae246(0x168):_0x7bf2e8[_0x3ae246(0x142)]===_0x3ae246(0x167)?'\x20\x20⚠️':_0x3ae246(0x15e),'\x20',_0x7bf2e8['ide'],':']}),a58_0x2f18c8(Text,{'color':_0x7bf2e8[_0x3ae246(0x142)]===_0x3ae246(0x138)?_0x3ae246(0x140):_0x7bf2e8['status']==='manual'?_0x3ae246(0x161):'red','children':_0x7bf2e8['message']})]},_0x4b376d)),a58_0x2f18c8(Box,{'marginTop':0x1,'children':a58_0x2f18c8(Text,{'color':_0x3ae246(0x146),'children':_0x231acc(_0x3ae246(0x136))})})]});}async function configureMcp(_0x5d567a){const _0x5c5cb7=a58_0x3b6a,_0x31aa56=process[_0x5c5cb7(0x15b)]();switch(_0x5d567a){case _0x5c5cb7(0x14b):return configureCursorMcp(_0x31aa56);case'claude':return configureClaudeMcp(_0x31aa56);case'other':return showOtherMcpGuide(_0x31aa56);default:throw new Error(a58_0x4331e8['t']('mcp.ui.unsupportedIDE',{'ide':_0x5d567a}));}}function a58_0x5081(){const _0x25fdc6=['gray','green','name','some','38079HeAlno','cursor','2714040rIYQFS','find','346837gsIfcv','1562429VhSeRT','mcp.ui.failed','1396cuJlus','1087555tyjScN','size','70QVFmZx','mcp.ui.manualRequired','value','mcp.ui.count','message','configuring','every','cwd','3369IegoEc','done','\x20\x20✗','push','mcp.ui.title','yellow','selecting','key','cyan','selectedIndexes','column','manual','\x20\x20✓','mcp.ui.otherIDE','mcp.ui.partialManual','return','handleKeyDown','6bQtVBy','mcp.ui.pressAnyKeyToExit','red','success','needsManualAction','mcp.ui.selectAtLeastOne','map','length','938820WfdiNP','1192PjSWHy','mcp.ui.selectedIDE','white','other','status','mcp.ui.otherIDEDescription','label','description'];a58_0x5081=function(){return _0x25fdc6;};return a58_0x5081();}
|
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a59_0xc931(_0x5de158,_0x5c175b){_0x5de158=_0x5de158-0x1b2;const _0xa87c8a=a59_0xa87c();let _0xc9312b=_0xa87c8a[_0x5de158];return _0xc9312b;}(function(_0x57491b,_0x13b060){const _0x3d13f3=a59_0xc931,_0x58b9f2=_0x57491b();while(!![]){try{const _0x4020bb=-parseInt(_0x3d13f3(0x1bc))/0x1+-parseInt(_0x3d13f3(0x1ba))/0x2+-parseInt(_0x3d13f3(0x1c0))/0x3+-parseInt(_0x3d13f3(0x1be))/0x4*(parseInt(_0x3d13f3(0x1bf))/0x5)+-parseInt(_0x3d13f3(0x1b5))/0x6*(parseInt(_0x3d13f3(0x1b9))/0x7)+parseInt(_0x3d13f3(0x1b3))/0x8+parseInt(_0x3d13f3(0x1bb))/0x9;if(_0x4020bb===_0x13b060)break;else _0x58b9f2['push'](_0x58b9f2['shift']());}catch(_0xbcf229){_0x58b9f2['push'](_0x58b9f2['shift']());}}}(a59_0xa87c,0x21663));import{configureClaudeMcp as a59_0x5f3721}from'./mcp-installer.js';import a59_0x5a9743 from'../i18n/index.js';function a59_0xa87c(){const _0x304f44=['log','exit','\x0a📋\x20','7WfYjBC','79528bqmFxB','7900803epAtLK','3651qQIXSY','cwd','4PuMDjp','1172450ioMdbH','668127pCVfpc','mcp.claudeConfig.error','success','158096YGTxMO','message','1561272QXIwMh'];a59_0xa87c=function(){return _0x304f44;};return a59_0xa87c();}export async function configureClaudeMcp(){const _0x2efdfe=a59_0xc931,_0x4f3441=process[_0x2efdfe(0x1bd)](),_0xe597b5=a59_0x5f3721(_0x4f3441);_0xe597b5[_0x2efdfe(0x1b2)]?(console[_0x2efdfe(0x1b6)](_0x2efdfe(0x1b8)+_0xe597b5[_0x2efdfe(0x1b4)]+'\x0a'),process[_0x2efdfe(0x1b7)](0x0)):(console['error'](a59_0x5a9743['t'](_0x2efdfe(0x1c1),{'error':_0xe597b5['message']})),process[_0x2efdfe(0x1b7)](0x1));}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x73d82d,_0x22863a){const _0x26685a=a60_0x5836,_0x2418b1=_0x73d82d();while(!![]){try{const _0x1c465f=parseInt(_0x26685a(0x134))/0x1+-parseInt(_0x26685a(0x12f))/0x2*(-parseInt(_0x26685a(0x12b))/0x3)+parseInt(_0x26685a(0x131))/0x4+-parseInt(_0x26685a(0x12e))/0x5*(parseInt(_0x26685a(0x12c))/0x6)+-parseInt(_0x26685a(0x12d))/0x7*(-parseInt(_0x26685a(0x132))/0x8)+parseInt(_0x26685a(0x133))/0x9+parseInt(_0x26685a(0x130))/0xa*(-parseInt(_0x26685a(0x127))/0xb);if(_0x1c465f===_0x22863a)break;else _0x2418b1['push'](_0x2418b1['shift']());}catch(_0x5686b1){_0x2418b1['push'](_0x2418b1['shift']());}}}(a60_0x5c8f,0x6d1ea));function a60_0x5836(_0x35711e,_0x5c4793){_0x35711e=_0x35711e-0x127;const _0x5c8f38=a60_0x5c8f();let _0x5836a6=_0x5c8f38[_0x35711e];return _0x5836a6;}import{configureCursorMcp as a60_0x2424ff}from'./mcp-installer.js';import a60_0x3afeee from'../i18n/index.js';function a60_0x5c8f(){const _0x9a6bf0=['3486yNKXnx','25iMitch','1466jBTzhW','10nqQXUu','165884YKVNnD','10232WTyjIW','7060077avCJYo','186801nmXZQe','mcp.cursorConfig.restartRequired','cwd','exit','message','mcp.cursorConfig.success','mcp.cursorConfig.configInfo','21842579NFXPqd','log','success','error','3561oSqTDI','104514AhBIrC'];a60_0x5c8f=function(){return _0x9a6bf0;};return a60_0x5c8f();}export async function configureCursorMcp(){const _0x158a6a=a60_0x5836,_0x236b3c=process[_0x158a6a(0x136)](),_0x14e79e=await a60_0x2424ff(_0x236b3c);_0x14e79e[_0x158a6a(0x129)]?(console[_0x158a6a(0x128)](a60_0x3afeee['t'](_0x158a6a(0x139))),console[_0x158a6a(0x128)](a60_0x3afeee['t'](_0x158a6a(0x13a))),console['log']('\x20\x20'+_0x14e79e['message']+'\x0a'),console[_0x158a6a(0x128)](a60_0x3afeee['t']('mcp.cursorConfig.usageHint')),console[_0x158a6a(0x128)](a60_0x3afeee['t'](_0x158a6a(0x135))),process[_0x158a6a(0x137)](0x0)):(console[_0x158a6a(0x12a)](a60_0x3afeee['t']('mcp.cursorConfig.error',{'error':_0x14e79e[_0x158a6a(0x138)]})),process['exit'](0x1));}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cf7f4,_0x1766dc){const _0x34e680=a61_0x564f,_0x55767c=_0x1cf7f4();while(!![]){try{const _0x35483e=-parseInt(_0x34e680(0x127))/0x1*(-parseInt(_0x34e680(0x10c))/0x2)+parseInt(_0x34e680(0x123))/0x3*(-parseInt(_0x34e680(0x112))/0x4)+parseInt(_0x34e680(0x11f))/0x5+parseInt(_0x34e680(0x11c))/0x6+-parseInt(_0x34e680(0xfe))/0x7+-parseInt(_0x34e680(0x120))/0x8+parseInt(_0x34e680(0xfb))/0x9;if(_0x35483e===_0x1766dc)break;else _0x55767c['push'](_0x55767c['shift']());}catch(_0x209606){_0x55767c['push'](_0x55767c['shift']());}}}(a61_0x5e67,0x46b3e));function a61_0x564f(_0x37078e,_0x188286){_0x37078e=_0x37078e-0xfa;const _0x5e6725=a61_0x5e67();let _0x564fe0=_0x5e6725[_0x37078e];return _0x564fe0;}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_0x5e67(){const _0x8285f8=['mcp.help.command.help','mcp-install','3iibGXa','quit','mcp.help.exampleInstallCursor','mcp.help.configMethodsDirect','202667cmFymj','close','description','mcp.help.examples','message','mcp.help.configMethodsDirectCursor','mcp.select.prompt','mcp.help.availableCommands','name','mcp.help.exampleInstallHint','mcp.help.usage.install','\x0a\x20\x20https://help.yuntoo.com/mcp/config-guide\x0a','setLogPath','mcp.help.command.install','claude','mcp.help.usage.installClaude','stdout','from','4493889mMfLnt','--help','mcp.help.configMethods','3251353ZOIyde','map','has','cursor','mcp.help.configGuide','mcp.help.title','mcp.installFlow.configuring','trim','mcp.help.configMethodsInteractiveHint','mcp.select.cancelled','log','install','help','mcp.help.usage.installCursor','2fhKpcd','mcp.help.exampleInstallCursorHint','mcp.help.exampleInstall','error','mcpClaude','mcp.help.supportedIDEs','550980LlEVvo','exit','mcp.help.configMethodsDirectClaude','length','\x20-\x20','mcpCursor','question','mcp.error.unsupportedCommand','\x0a\x20\x20\x20\x20$\x20lovrabet\x20mcp\x20install\x0a','mcp.help.configMethodsInteractive','1125750mbwVAA','toLowerCase','mcp.select.chooseIDE','2618830UaknKS','4172456cRcjsT'];a61_0x5e67=function(){return _0x8285f8;};return a61_0x5e67();}import a61_0x4e7020 from'../i18n/index.js';export async function mcpCommand(_0x5ad899,_0x1ed12b,_0x3c06ed){const _0x5add2d=a61_0x564f;logger[_0x5add2d(0x133)](process['cwd']());if(_0x3c06ed?.[_0x5add2d(0x10a)]||_0x5ad899===_0x5add2d(0xfc)){showHelp();return;}_0x5ad899!==_0x5add2d(0x109)&&(console['error'](a61_0x4e7020['t']('mcp.error.unsupportedCommand',{'cmd':_0x5ad899||'-'})),console['log'](a61_0x4e7020['t'](_0x5add2d(0x12e))),console[_0x5add2d(0x108)](a61_0x4e7020['t'](_0x5add2d(0x134))),console['log'](a61_0x4e7020['t'](_0x5add2d(0x121))),logger[_0x5add2d(0x10f)]('mcp',a61_0x4e7020['t'](_0x5add2d(0x119),{'cmd':_0x5ad899||'-'})),process[_0x5add2d(0x113)](0x1));let _0x4c983b;if(_0x3c06ed?.[_0x5add2d(0x117)])_0x4c983b=_0x5add2d(0x101);else{if(_0x3c06ed?.[_0x5add2d(0x110)])_0x4c983b=_0x5add2d(0x135);else{if(_0x1ed12b?.[0x0]){const _0x49ba37=_0x1ed12b[0x0][_0x5add2d(0x11d)]();MCP_IDES[_0x5add2d(0x100)](_0x49ba37)&&(_0x4c983b=_0x49ba37);}}}await installMcp(_0x4c983b);}function showHelp(){const _0x1101da=a61_0x564f;console[_0x1101da(0x108)]('\x0a'+a61_0x4e7020['t'](_0x1101da(0x103))+'\x0a\x0a'+a61_0x4e7020['t']('mcp.help.usage.help')+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x131))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x10b))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x136))+'\x0a\x0a'+a61_0x4e7020['t'](_0x1101da(0xfd))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x11b))+_0x1101da(0x11a)+a61_0x4e7020['t'](_0x1101da(0x106))+'\x0a\x0a'+a61_0x4e7020['t'](_0x1101da(0x126))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x12c))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x114))+'\x0a\x0a'+a61_0x4e7020['t'](_0x1101da(0x111))+'\x0a'+Array['from'](MCP_IDES)[_0x1101da(0xff)]((_0x5dff2e,_0x23d281)=>'\x20\x20'+(_0x23d281+0x1)+'.\x20'+IDE_CONFIGS[_0x5dff2e]['name']+_0x1101da(0x116)+IDE_CONFIGS[_0x5dff2e][_0x1101da(0x129)])['join']('\x0a')+'\x0a\x0a'+a61_0x4e7020['t'](_0x1101da(0x12a))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x10e))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x130))+'\x0a\x0a'+a61_0x4e7020['t'](_0x1101da(0x125))+'\x0a'+a61_0x4e7020['t'](_0x1101da(0x10d))+'\x0a\x0a'+a61_0x4e7020['t'](_0x1101da(0x102))+_0x1101da(0x132));}async function selectIDE(){const _0x28e3b5=a61_0x564f;console['log'](a61_0x4e7020['t'](_0x28e3b5(0x11e)));const _0x47f706=Array[_0x28e3b5(0xfa)](MCP_IDES);return _0x47f706['forEach']((_0x5cfc13,_0x42065c)=>{const _0xed3a08=_0x28e3b5;console[_0xed3a08(0x108)]('\x20\x20'+(_0x42065c+0x1)+'.\x20'+IDE_CONFIGS[_0x5cfc13][_0xed3a08(0x12f)]+_0xed3a08(0x116)+IDE_CONFIGS[_0x5cfc13][_0xed3a08(0x129)]);}),console[_0x28e3b5(0x108)](a61_0x4e7020['t']('mcp.select.cancel')),console['log'](a61_0x4e7020['t']('mcp.select.enterNumber')),new Promise(_0x1067b2=>{const _0x9b38c7=_0x28e3b5,_0x13deb7=createInterface({'input':process['stdin'],'output':process[_0x9b38c7(0x137)]});_0x13deb7[_0x9b38c7(0x118)](a61_0x4e7020['t'](_0x9b38c7(0x12d)),_0x2a51c7=>{const _0x380662=_0x9b38c7;_0x13deb7[_0x380662(0x128)]();const _0x12fe89=_0x2a51c7[_0x380662(0x105)]()[_0x380662(0x11d)]();(_0x12fe89==='q'||_0x12fe89===_0x380662(0x124)||_0x12fe89===_0x380662(0x113))&&(console[_0x380662(0x108)](a61_0x4e7020['t'](_0x380662(0x107))),process[_0x380662(0x113)](0x0));const _0xa5d735=parseInt(_0x12fe89,0xa);if(!isNaN(_0xa5d735)&&_0xa5d735>=0x1&&_0xa5d735<=_0x47f706[_0x380662(0x115)]){const _0x4598af=_0x47f706[_0xa5d735-0x1];_0x4598af&&_0x1067b2(_0x4598af);return;}console['log'](a61_0x4e7020['t']('mcp.select.invalidChoice',{'count':_0x47f706[_0x380662(0x115)]})),process[_0x380662(0x113)](0x1);});});}async function installMcp(_0x52156e){const _0x3c097f=a61_0x564f;let _0x5cb8c0;!_0x52156e?_0x5cb8c0=await selectIDE():_0x5cb8c0=_0x52156e;try{const _0x5dad71=IDE_CONFIGS[_0x5cb8c0];console['log'](a61_0x4e7020['t'](_0x3c097f(0x104),{'name':_0x5dad71[_0x3c097f(0x12f)]}));switch(_0x5cb8c0){case _0x3c097f(0x101):await configureCursorMcp();break;case _0x3c097f(0x135):await configureClaudeMcp();break;}}catch(_0x59e515){logger['error'](_0x3c097f(0x122),a61_0x4e7020['t']('mcp.installFlow.error',{'error':_0x59e515 instanceof Error?_0x59e515[_0x3c097f(0x12b)]:String(_0x59e515)}),{'error':_0x59e515 instanceof Error?_0x59e515[_0x3c097f(0x12b)]:String(_0x59e515)}),console[_0x3c097f(0x10f)](a61_0x4e7020['t']('mcp.installFlow.error',{'error':_0x59e515 instanceof Error?_0x59e515[_0x3c097f(0x12b)]:String(_0x59e515)})),process[_0x3c097f(0x113)](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a62_0x23132a=a62_0x5716;(function(_0x78de52,_0x57df87){const _0x50a44e=a62_0x5716,_0x26f164=_0x78de52();while(!![]){try{const _0x1b752d=-parseInt(_0x50a44e(0xa2))/0x1+-parseInt(_0x50a44e(0xa5))/0x2+-parseInt(_0x50a44e(0x96))/0x3*(parseInt(_0x50a44e(0x95))/0x4)+parseInt(_0x50a44e(0xa1))/0x5*(parseInt(_0x50a44e(0x94))/0x6)+parseInt(_0x50a44e(0x9d))/0x7+parseInt(_0x50a44e(0x9a))/0x8*(parseInt(_0x50a44e(0x8d))/0x9)+parseInt(_0x50a44e(0x8a))/0xa*(-parseInt(_0x50a44e(0x93))/0xb);if(_0x1b752d===_0x57df87)break;else _0x26f164['push'](_0x26f164['shift']());}catch(_0xf20495){_0x26f164['push'](_0x26f164['shift']());}}}(a62_0x39aa,0xd7946));import{configureCursorMcp,configureClaudeMcp,showOtherMcpGuide}from'./mcp-installer.js';function a62_0x5716(_0x23f4c5,_0x30a2cc){_0x23f4c5=_0x23f4c5-0x87;const _0x39aa15=a62_0x39aa();let _0x571637=_0x39aa15[_0x23f4c5];return _0x571637;}import{logger}from'../utils/logger.js';function a62_0x39aa(){const _0xfd2b72=['mcp.claude','1128638tIVflR','mcp.install.manualActionRequired','mcp.install.success','claude','3668815JlDgnI','463843DBtGof','error','push','840454sogVRa','mcp.install.unknownIDE','mcp.cursor','mcp.install.failed','mcp.install.starting','log','735890VLNApt','message','some','136341bXiPza','length','filter','needsManualAction','success','other','33CnKtww','6vpityq','220768pTdbqY','18OCOedj','cwd','mcp.install.otherIDE','cursor','752BJsSnk','setLogPath'];a62_0x39aa=function(){return _0xfd2b72;};return a62_0x39aa();}import a62_0x5778c2 from'../i18n/index.js';export async function installMcpNonInteractive(_0xf5023f,_0x5088c7=process[a62_0x23132a(0x97)]()){const _0x3f883c=a62_0x23132a;logger[_0x3f883c(0x9b)](_0x5088c7),logger['info']('mcp-install-non-interactive',a62_0x5778c2['t'](_0x3f883c(0x88)),{'ides':_0xf5023f});const _0x3487aa=[];for(const _0x44dcc0 of _0xf5023f){try{let _0x50b6c9;switch(_0x44dcc0){case _0x3f883c(0x99):_0x50b6c9=await configureCursorMcp(_0x5088c7);break;case _0x3f883c(0xa0):_0x50b6c9=configureClaudeMcp(_0x5088c7);break;case _0x3f883c(0x92):_0x50b6c9=showOtherMcpGuide(_0x5088c7);break;default:_0x50b6c9={'success':![],'message':a62_0x5778c2['t'](_0x3f883c(0xa6),{'ide':_0x44dcc0})};}_0x3487aa[_0x3f883c(0xa4)](_0x50b6c9);if(_0x50b6c9['success']){const _0x37e4f8=_0x44dcc0===_0x3f883c(0x99)?a62_0x5778c2['t'](_0x3f883c(0xa7)):_0x44dcc0===_0x3f883c(0xa0)?a62_0x5778c2['t'](_0x3f883c(0x9c)):a62_0x5778c2['t']('mcp.install.otherIDE');console[_0x3f883c(0x89)](a62_0x5778c2['t'](_0x3f883c(0x9f),{'ide':_0x37e4f8})),console[_0x3f883c(0x89)]('\x20\x20'+_0x50b6c9[_0x3f883c(0x8b)]);}else console[_0x3f883c(0xa3)](a62_0x5778c2['t'](_0x3f883c(0x87),{'ide':_0x44dcc0===_0x3f883c(0x99)?a62_0x5778c2['t']('mcp.cursor'):_0x44dcc0==='claude'?a62_0x5778c2['t'](_0x3f883c(0x9c)):a62_0x5778c2['t'](_0x3f883c(0x98)),'error':_0x50b6c9[_0x3f883c(0x8b)]}));}catch(_0x506010){console[_0x3f883c(0xa3)](a62_0x5778c2['t'](_0x3f883c(0x87),{'ide':_0x44dcc0===_0x3f883c(0x99)?a62_0x5778c2['t']('mcp.cursor'):_0x44dcc0===_0x3f883c(0xa0)?a62_0x5778c2['t'](_0x3f883c(0x9c)):a62_0x5778c2['t']('mcp.install.otherIDE'),'error':_0x506010 instanceof Error?_0x506010[_0x3f883c(0x8b)]:String(_0x506010)}));}}const _0x5c0858=_0x3487aa[_0x3f883c(0x8f)](_0x37caed=>_0x37caed[_0x3f883c(0x91)])[_0x3f883c(0x8e)],_0xe73c77=_0x3487aa['length'];console[_0x3f883c(0x89)](a62_0x5778c2['t']('mcp.install.completed',{'successCount':_0x5c0858,'totalCount':_0xe73c77}));const _0x3e15c2=_0x3487aa[_0x3f883c(0x8c)](_0x25591e=>_0x25591e[_0x3f883c(0x90)]);_0x3e15c2&&console['log'](a62_0x5778c2['t'](_0x3f883c(0x9e)));}
|
package/lib/mcp/mcp-installer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x38c251=a63_0x5bad;(function(_0x128dbe,_0x9db07d){const _0x4f88a2=a63_0x5bad,_0x56537c=_0x128dbe();while(!![]){try{const _0x30ec64=parseInt(_0x4f88a2(0x19a))/0x1*(-parseInt(_0x4f88a2(0x19e))/0x2)+parseInt(_0x4f88a2(0x1b2))/0x3+-parseInt(_0x4f88a2(0x188))/0x4+-parseInt(_0x4f88a2(0x18b))/0x5+parseInt(_0x4f88a2(0x18c))/0x6*(-parseInt(_0x4f88a2(0x1a2))/0x7)+-parseInt(_0x4f88a2(0x18a))/0x8*(parseInt(_0x4f88a2(0x1a7))/0x9)+parseInt(_0x4f88a2(0x1b0))/0xa*(parseInt(_0x4f88a2(0x190))/0xb);if(_0x30ec64===_0x9db07d)break;else _0x56537c['push'](_0x56537c['shift']());}catch(_0x58ff43){_0x56537c['push'](_0x56537c['shift']());}}}(a63_0x1ab9,0x9a5b3));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_0x40f47f from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url));export const MCP_SERVER_NAME=a63_0x38c251(0x193);export const MCP_COMMAND=a63_0x38c251(0x19b);export const MCP_ARGS=[a63_0x38c251(0x192)];function a63_0x5bad(_0x5f5930,_0x20ce68){_0x5f5930=_0x5f5930-0x187;const _0x1ab903=a63_0x1ab9();let _0x5badac=_0x1ab903[_0x5f5930];return _0x5badac;}export function getAppConfig(){const _0x365f18=a63_0x38c251,_0x2f4da7=readConfig(),_0x4b1fca=_0x2f4da7['appcode']||_0x2f4da7['app'],_0x1b5ee3=_0x2f4da7['env']||_0x365f18(0x1a8);if(!_0x4b1fca)throw new Error(a63_0x40f47f['t'](_0x365f18(0x197)));return{'appcode':String(_0x4b1fca),'env':_0x1b5ee3};}export function buildMcpEnv(_0x2b0414,_0x327fe8){const _0x3c2f25=a63_0x38c251,_0x2f9433={'LOVRABET_APP_CODE':_0x2b0414};return _0x327fe8!==_0x3c2f25(0x1a8)&&(_0x2f9433[_0x3c2f25(0x1b1)]=_0x327fe8),_0x2f9433;}function a63_0x1ab9(){const _0x24bb75=['mcp.cursorConfig.success','mcp.claudeConfig.commandGenerated','mcp.error.missingAppcode','push','mcp.cursorConfig.rules.copyFailed','599ZGgCvB','npx','\x20-e\x20LOVRABET_ENV=','mcp-install','2222jqppwY','info','rules','.cursor','7NwkBEn','mcp.other.configInfo','error','mcp.cursorConfig.rules.created','parse','27vywLpH','online','\x20\x20\x20\x20\x20\x20\x20\x20','lovrabet_rules.mdc','\x0a\x20\x20','mcp.claudeConfig.error','\x22LOVRABET_ENV\x22:\x20\x22','mcp.cursorConfig.updateExisting','mcp-claude','30ILXXTx','LOVRABET_ENV','3535434vWehQo','message','mcp.cursorConfig.written','agents.md','utf8','AppCode:\x20','mcp.cursorConfig.rules.exists','mcp.cursorConfig.error','mcp-cursor','\x20-e\x20LOVRABET_APP_CODE=','mcp.claudeConfig.restartRequired','mcp.claudeConfig.agents.copyFailed','mcp.claudeConfig.manualCommand','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[\x22@lovrabet/dataset-mcp-server@latest\x22],','mcp.cursorConfig.restartRequired','mcpServers','stringify','2344120HWUZqm','\x22LOVRABET_APP_CODE\x22:\x20\x22','1057768MxwOSR','3068495TSfclB','510426KfdtZm','join','claude\x20mcp\x20add\x20','\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{','6602629ewvyQC','mcp.claudeConfig.agents.created','@lovrabet/dataset-mcp-server@latest','lovrabet-dataset','mcp.config.env'];a63_0x1ab9=function(){return _0x24bb75;};return a63_0x1ab9();}export function buildMcpServerConfig(_0x793a13,_0x7ac3f6){return{'command':MCP_COMMAND,'args':MCP_ARGS,'env':buildMcpEnv(_0x793a13,_0x7ac3f6)};}export function buildClaudeMcpCommand(_0x23c1f2,_0x2d8990){const _0x5162ac=a63_0x38c251,_0x5d974f=_0x5162ac(0x18e)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x5162ac(0x18d)]('\x20')+_0x5162ac(0x1bb)+_0x23c1f2,_0x330628=_0x2d8990!==_0x5162ac(0x1a8)?_0x5162ac(0x19c)+_0x2d8990:'';return''+_0x5d974f+_0x330628;}export async function copyCursorRules(_0x1aa43b){const _0xb35a79=a63_0x38c251,_0x12683c=join(_0x1aa43b,_0xb35a79(0x1a1)),_0x140fa4=join(_0x12683c,_0xb35a79(0x1a0)),_0x3b27ee=join(_0x140fa4,_0xb35a79(0x1aa));if(existsSync(_0x3b27ee))return logger[_0xb35a79(0x19f)](_0xb35a79(0x19d),a63_0x40f47f['t'](_0xb35a79(0x1b8)),{'path':_0x3b27ee}),![];try{ensureDir(_0x140fa4);const _0x294bf1=await getRulesContent();return writeFileSync(_0x3b27ee,_0x294bf1,'utf-8'),logger['info'](_0xb35a79(0x19d),a63_0x40f47f['t'](_0xb35a79(0x1a5)),{'to':_0x3b27ee}),!![];}catch(_0x56daf2){return logger[_0xb35a79(0x1a4)](_0xb35a79(0x19d),a63_0x40f47f['t'](_0xb35a79(0x199)),{'error':_0x56daf2 instanceof Error?_0x56daf2[_0xb35a79(0x1b3)]:String(_0x56daf2)}),![];}}export async function copyAgentsMd(_0x35d3d0){const _0x5a6fa7=a63_0x38c251,_0x235121=join(_0x35d3d0,_0x5a6fa7(0x1b5));if(existsSync(_0x235121))return logger[_0x5a6fa7(0x19f)](_0x5a6fa7(0x19d),a63_0x40f47f['t']('mcp.claudeConfig.agents.exists'),{'path':_0x235121}),![];try{const _0x3973fb=await getRulesContent();return writeFileSync(_0x235121,_0x3973fb,'utf-8'),logger['info'](_0x5a6fa7(0x19d),a63_0x40f47f['t'](_0x5a6fa7(0x191)),{'to':_0x235121}),!![];}catch(_0x5e9c2c){return logger[_0x5a6fa7(0x1a4)]('mcp-install',a63_0x40f47f['t'](_0x5a6fa7(0x1bd)),{'error':_0x5e9c2c instanceof Error?_0x5e9c2c[_0x5a6fa7(0x1b3)]:String(_0x5e9c2c)}),![];}}export async function configureCursorMcp(_0x2d18e0){const _0x1d3af3=a63_0x38c251;try{const {appcode:_0x570a05,env:_0x39aaa0}=getAppConfig(),_0x3f9884=join(_0x2d18e0,_0x1d3af3(0x1a1)),_0x3b40ea=join(_0x3f9884,'mcp.json');ensureDir(_0x3f9884);const _0x3ed614=buildMcpServerConfig(_0x570a05,_0x39aaa0);let _0x309ba9;if(existsSync(_0x3b40ea)){const _0x26cff5=readFileSync(_0x3b40ea,_0x1d3af3(0x1b6));_0x309ba9=JSON[_0x1d3af3(0x1a6)](_0x26cff5),!_0x309ba9[_0x1d3af3(0x1c1)]&&(_0x309ba9[_0x1d3af3(0x1c1)]={}),logger['info']('mcp-cursor',a63_0x40f47f['t'](_0x1d3af3(0x1ae)),{'path':_0x3b40ea,'appcode':_0x570a05,'env':_0x39aaa0});}else _0x309ba9={'mcpServers':{}},logger[_0x1d3af3(0x19f)](_0x1d3af3(0x1ba),a63_0x40f47f['t']('mcp.cursorConfig.createNew'),{'path':_0x3b40ea,'appcode':_0x570a05,'env':_0x39aaa0});_0x309ba9['mcpServers'][MCP_SERVER_NAME]=_0x3ed614,writeFileSync(_0x3b40ea,JSON[_0x1d3af3(0x187)](_0x309ba9,null,0x2),{'encoding':'utf8'});const _0x6b33c4=await copyCursorRules(_0x2d18e0),_0x4c7479=[a63_0x40f47f['t'](_0x1d3af3(0x1b4)),'AppCode:\x20'+_0x570a05];return _0x39aaa0!==_0x1d3af3(0x1a8)&&_0x4c7479[_0x1d3af3(0x198)](a63_0x40f47f['t'](_0x1d3af3(0x194),{'env':_0x39aaa0})),_0x4c7479['push'](a63_0x40f47f['t'](_0x1d3af3(0x1c0))),_0x6b33c4&&_0x4c7479[_0x1d3af3(0x198)](a63_0x40f47f['t']('mcp.cursorConfig.rules.created')),logger[_0x1d3af3(0x19f)](_0x1d3af3(0x1ba),a63_0x40f47f['t'](_0x1d3af3(0x195)),{'appcode':_0x570a05,'env':_0x39aaa0,'configPath':_0x3b40ea}),{'success':!![],'message':_0x4c7479[_0x1d3af3(0x18d)](_0x1d3af3(0x1ab))};}catch(_0x5b231b){return logger[_0x1d3af3(0x1a4)](_0x1d3af3(0x1ba),a63_0x40f47f['t'](_0x1d3af3(0x1b9),{'error':_0x5b231b instanceof Error?_0x5b231b['message']:String(_0x5b231b)}),{'error':_0x5b231b instanceof Error?_0x5b231b[_0x1d3af3(0x1b3)]:String(_0x5b231b)}),{'success':![],'message':_0x5b231b instanceof Error?_0x5b231b[_0x1d3af3(0x1b3)]:String(_0x5b231b)};}}export function configureClaudeMcp(_0x55fc2e){const _0x344bf8=a63_0x38c251;try{const {appcode:_0x45e70e,env:_0x58d939}=getAppConfig();copyAgentsMd(_0x55fc2e);const _0x2a5e9e=buildClaudeMcpCommand(_0x45e70e,_0x58d939),_0x216372=[a63_0x40f47f['t'](_0x344bf8(0x1be)),''+_0x2a5e9e,a63_0x40f47f['t']('mcp.claudeConfig.configInfo'),_0x344bf8(0x1b7)+_0x45e70e];return _0x58d939!==_0x344bf8(0x1a8)&&_0x216372[_0x344bf8(0x198)](a63_0x40f47f['t']('mcp.config.env',{'env':_0x58d939})),_0x216372['push'](a63_0x40f47f['t'](_0x344bf8(0x1bc))),logger[_0x344bf8(0x19f)](_0x344bf8(0x1af),a63_0x40f47f['t'](_0x344bf8(0x196)),{'appcode':_0x45e70e,'env':_0x58d939,'command':_0x2a5e9e}),{'success':!![],'message':_0x216372[_0x344bf8(0x18d)]('\x0a\x20\x20'),'needsManualAction':!![]};}catch(_0x5c0089){return logger[_0x344bf8(0x1a4)](_0x344bf8(0x1af),a63_0x40f47f['t'](_0x344bf8(0x1ac),{'error':_0x5c0089 instanceof Error?_0x5c0089[_0x344bf8(0x1b3)]:String(_0x5c0089)}),{'error':_0x5c0089 instanceof Error?_0x5c0089['message']:String(_0x5c0089)}),{'success':![],'message':_0x5c0089 instanceof Error?_0x5c0089[_0x344bf8(0x1b3)]:String(_0x5c0089)};}}export function showOtherMcpGuide(_0x119979){const _0xd4fcf0=a63_0x38c251;try{const {appcode:_0x3e8ccc,env:_0x25432a}=getAppConfig(),_0x14ff6c=buildMcpServerConfig(_0x3e8ccc,_0x25432a),_0x3802f6=[_0xd4fcf0(0x189)+_0x3e8ccc+'\x22'];_0x25432a!==_0xd4fcf0(0x1a8)&&_0x3802f6[_0xd4fcf0(0x198)](_0xd4fcf0(0x1ad)+_0x25432a+'\x22');const _0x192005=[a63_0x40f47f['t'](_0xd4fcf0(0x1a3),{'appcode':_0x3e8ccc,'env':_0x25432a}),'{','\x20\x20\x22mcpServers\x22:\x20{',_0xd4fcf0(0x18f),'\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,',_0xd4fcf0(0x1bf),'\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{',..._0x3802f6['map'](_0x85433d=>_0xd4fcf0(0x1a9)+_0x85433d+','),'\x20\x20\x20\x20\x20\x20}','\x20\x20\x20\x20}','\x20\x20}','}',a63_0x40f47f['t']('mcp.other.configGuide')];return logger[_0xd4fcf0(0x19f)](_0xd4fcf0(0x19d),a63_0x40f47f['t']('mcp.other.guideShown'),{'appcode':_0x3e8ccc,'env':_0x25432a}),{'success':!![],'message':_0x192005['join']('\x0a'),'needsManualAction':!![]};}catch(_0x3bcf27){return{'success':![],'message':_0x3bcf27 instanceof Error?_0x3bcf27[_0xd4fcf0(0x1b3)]:String(_0x3bcf27)};}}function ensureDir(_0x3c0eb4){!existsSync(_0x3c0eb4)&&mkdirSync(_0x3c0eb4,{'recursive':!![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x4cd267=a64_0x2583;(function(_0x7ff148,_0xfd296b){const _0xa103b6=a64_0x2583,_0x546e4f=_0x7ff148();while(!![]){try{const _0x24e0bb=parseInt(_0xa103b6(0x1d8))/0x1+parseInt(_0xa103b6(0x1bc))/0x2+parseInt(_0xa103b6(0x1e2))/0x3+-parseInt(_0xa103b6(0x1d0))/0x4*(parseInt(_0xa103b6(0x1be))/0x5)+parseInt(_0xa103b6(0x1d5))/0x6+parseInt(_0xa103b6(0x1ba))/0x7*(-parseInt(_0xa103b6(0x1b6))/0x8)+parseInt(_0xa103b6(0x1bf))/0x9;if(_0x24e0bb===_0xfd296b)break;else _0x546e4f['push'](_0x546e4f['shift']());}catch(_0x318a9a){_0x546e4f['push'](_0x546e4f['shift']());}}}(a64_0x3426,0xc0770));function a64_0x3426(){const _0x4b6b57=['log','.lovrabet/skill-manifest.json','gray','安装成功','../../cdn-source/skills','8943568jzcscM','length','selectedIndexes','cwd','7OYsxhz','description','415134gWmyXd','skill.installing.progress','770405DmJlLf','984528LUdBlE','skill.error.selectAtLeastOne','setErrorMsg','skill.installing.title','.lovrabet','installing','\x20✓\x20','getSelectedIDEs','skill.done.pressAnyKey','info','map','selecting','skill.error.installFailed','done','skill.cdn.fetchingExtend','column','value','4lTDzHX','green','skill.done.successInline','handleKeyDown','2.0.0','1368540auyWSx','message','skill.select.selectedIDE','561391jACyOb','skill.cdn.fetchFailed','stringify','warn','setLogPath','return','size','keys','skill.installing.installed','skill.cdn.fetching','2861769ArlEqV','toISOString','utf-8','label','skill.done.guidesPathInline','skill.select.count'];a64_0x3426=function(){return _0x4b6b57;};return a64_0x3426();}import{jsx as a64_0x46bfa0,jsxs as a64_0x3815cc,Fragment as a64_0x2ff17f}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';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{IDESelector,useIDESelection}from'../ui/IDESelector.js';import{useI18n}from'../i18n/hooks.js';function a64_0x2583(_0x37c89a,_0x2d065d){_0x37c89a=_0x37c89a-0x1ad;const _0x34263d=a64_0x3426();let _0x2583a4=_0x34263d[_0x37c89a];return _0x2583a4;}const __dirname=dirname(fileURLToPath(import.meta.url)),UI_IDE_LIST=IDE_LIST[a64_0x4cd267(0x1c9)](_0x37ecdf=>({'key':_0x37ecdf,'name':IDE_CONFIGS[_0x37ecdf]['name'],'description':IDE_CONFIGS[_0x37ecdf][a64_0x4cd267(0x1bb)]}));export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[],providedFlags:_0x12da60}){const _0x12e5ae=a64_0x4cd267,{exit:_0x3b6d19}=useApp(),{t:_0x4562ec}=useI18n(),[_0x5ee1b8,_0x4fbe05]=useState(_0x12e5ae(0x1ca)),[_0x2534f3,_0x153d66]=useState([]),[_0x5f2951,_0x5df356]=useState([]),[_0x3e5469,_0x20c7b6]=useState(0x0),_0x4ff374=useIDESelection({'ideList':UI_IDE_LIST,'preselectedIDEs':preselectedIDEs,'multiSelect':!![]});useEffect(()=>{const _0xd9457a=_0x12e5ae;preselectedIDEs[_0xd9457a(0x1b7)]>0x0&&_0x4ff374['selectedIndexes'][_0xd9457a(0x1de)]>0x0&&_0x33e818();},[]),useInput((_0x50c524,_0xe98a8b)=>{const _0x2f0d75=_0x12e5ae;if(_0x5ee1b8===_0x2f0d75(0x1ca)){if(_0x50c524==='q'||_0x50c524==='Q'){_0x3b6d19();return;}if(_0xe98a8b[_0x2f0d75(0x1dd)]){if(_0x4ff374[_0x2f0d75(0x1b8)][_0x2f0d75(0x1de)]===0x0){_0x4ff374[_0x2f0d75(0x1c1)](_0x4562ec(_0x2f0d75(0x1c0)));return;}_0x33e818();return;}_0x4ff374[_0x2f0d75(0x1d3)](_0x50c524,_0xe98a8b);}_0x5ee1b8===_0x2f0d75(0x1cc)&&_0x3b6d19();});async function _0x33e818(){const _0xbc2bff=_0x12e5ae,_0x401067=_0x4ff374[_0xbc2bff(0x1c6)]();_0x5df356(_0x401067),_0x153d66([{'label':_0x4562ec(_0xbc2bff(0x1d7)),'value':_0x4562ec(_0xbc2bff(0x1b0),{'count':_0x4ff374[_0xbc2bff(0x1b8)]['size']})}]),_0x4fbe05(_0xbc2bff(0x1c4)),await _0x504533(_0x401067);}async function _0x504533(_0x3071ac){const _0x4a1223=_0x12e5ae,_0x336c8e=process[_0x4a1223(0x1b9)](),_0x2bdafb=resolve(__dirname,_0x4a1223(0x1b5));logger[_0x4a1223(0x1dc)](_0x336c8e);const _0x17ef42=_0x12da60&&_0x12da60[_0x4a1223(0x1b7)]>0x0;console['log'](_0x17ef42?_0x4562ec(_0x4a1223(0x1cd)):_0x4562ec(_0x4a1223(0x1e1)));let _0x44177;try{_0x44177=await fetchGuidesFromCDN(_0x17ef42),console[_0x4a1223(0x1b1)](_0x4562ec('skill.cdn.fetchSuccess',{'count':Object[_0x4a1223(0x1df)](_0x44177['guides'])[_0x4a1223(0x1b7)]}));}catch(_0x7a4ef1){console[_0x4a1223(0x1db)](_0x4562ec(_0x4a1223(0x1d9),{'error':_0x7a4ef1 instanceof Error?_0x7a4ef1['message']:String(_0x7a4ef1)}));}let _0x1ce675=0x0;for(const _0x33b622 of _0x3071ac){try{const _0x36493e=IDE_CONFIGS[_0x33b622],_0x1b0b7b=await installSingleIDE(_0x33b622,_0x36493e,_0x336c8e,_0x2bdafb,_0x44177,_0x12da60);_0x1ce675+=_0x1b0b7b,_0x20c7b6(_0x1ce675);}catch(_0x3e0747){console['error'](_0x4562ec(_0x4a1223(0x1cb),{'ide':_0x33b622,'error':_0x3e0747 instanceof Error?_0x3e0747[_0x4a1223(0x1d6)]:String(_0x3e0747)}));}}_0x44177&&writeGuidesToProject(_0x44177,_0x336c8e,'.lovrabet/skill/.shared/guides',_0x12da60);const _0x4b0aae={'version':_0x4a1223(0x1d4),'installedAt':new Date()[_0x4a1223(0x1e3)](),'platforms':_0x3071ac},_0x4e2bec=join(_0x336c8e,_0x4a1223(0x1b2)),_0x5c116b=join(_0x336c8e,_0x4a1223(0x1c3));await copyDir(_0x5c116b,_0x5c116b),writeFileSync(_0x4e2bec,JSON[_0x4a1223(0x1da)](_0x4b0aae,null,0x2),_0x4a1223(0x1ad)),logger[_0x4a1223(0x1c8)]('skill-install',_0x4a1223(0x1b4),{'projectRoot':_0x336c8e,'ides':_0x3071ac,'foldersCount':_0x1ce675}),_0x4fbe05(_0x4a1223(0x1cc)),setTimeout(()=>{_0x3b6d19();},0x3e8);}return a64_0x3815cc(Box,{'flexDirection':_0x12e5ae(0x1ce),'marginTop':0x1,'children':[_0x5ee1b8===_0x12e5ae(0x1ca)&&a64_0x46bfa0(IDESelector,{'ideList':UI_IDE_LIST,'title':_0x4562ec(_0x12e5ae(0x1c2)),'selection':_0x4ff374}),_0x5ee1b8==='installing'&&a64_0x46bfa0(InstallingStep,{'completedSteps':_0x2534f3,'installingIDEs':_0x5f2951,'installedCount':_0x3e5469}),_0x5ee1b8===_0x12e5ae(0x1cc)&&a64_0x46bfa0(DoneStep,{'installedCount':_0x3e5469})]});}function InstallingStep({completedSteps:_0x37db61,installingIDEs:_0x21f6e8,installedCount:_0x1ff7c2}){const _0x2e17ad=a64_0x4cd267,{t:_0x117ccf}=useI18n();return a64_0x3815cc(a64_0x2ff17f,{'children':[_0x37db61[_0x2e17ad(0x1c9)]((_0x16bdf3,_0x2f1c58)=>a64_0x3815cc(Box,{'children':[a64_0x3815cc(Text,{'color':_0x2e17ad(0x1d1),'children':['√\x20',_0x16bdf3[_0x2e17ad(0x1ae)],':\x20']}),a64_0x46bfa0(Text,{'color':'cyan','children':_0x16bdf3[_0x2e17ad(0x1cf)]})]},_0x2f1c58)),a64_0x46bfa0(Box,{'marginTop':0x1,'children':a64_0x46bfa0(Text,{'children':_0x117ccf(_0x2e17ad(0x1bd))})}),_0x21f6e8[_0x2e17ad(0x1c9)](_0x3744fe=>a64_0x3815cc(Box,{'children':[a64_0x46bfa0(Text,{'color':_0x2e17ad(0x1d1),'children':_0x2e17ad(0x1c5)}),a64_0x46bfa0(Text,{'children':IDE_CONFIGS[_0x3744fe]?.['name']||_0x3744fe})]},_0x3744fe)),a64_0x46bfa0(Box,{'marginTop':0x1,'children':a64_0x46bfa0(Text,{'color':'gray','children':_0x117ccf(_0x2e17ad(0x1e0),{'count':_0x1ff7c2})})})]});}function DoneStep({installedCount:_0x4cf0f9}){const _0x4d6681=a64_0x4cd267,{t:_0x1bec5b}=useI18n();return a64_0x3815cc(a64_0x2ff17f,{'children':[a64_0x46bfa0(Box,{'children':a64_0x46bfa0(Text,{'color':_0x4d6681(0x1d1),'children':_0x1bec5b(_0x4d6681(0x1d2),{'count':_0x4cf0f9})})}),a64_0x46bfa0(Box,{'marginTop':0x1,'children':a64_0x46bfa0(Text,{'color':_0x4d6681(0x1b3),'children':_0x1bec5b(_0x4d6681(0x1af))})}),a64_0x46bfa0(Box,{'marginTop':0x1,'children':a64_0x46bfa0(Text,{'color':_0x4d6681(0x1b3),'children':_0x1bec5b(_0x4d6681(0x1c7))})})]});}async function copyDirIfNeeded(_0x2d4115,_0x360d05){try{return await copyDir(_0x2d4115,_0x360d05),!![];}catch{return![];}}
|
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x14d620,_0x50cb45){const _0x1a6a09=a62_0x5a00,_0x29aa22=_0x14d620();while(!![]){try{const _0x173768=-parseInt(_0x1a6a09(0xfb))/0x1*(parseInt(_0x1a6a09(0x149))/0x2)+-parseInt(_0x1a6a09(0x14a))/0x3+parseInt(_0x1a6a09(0x11e))/0x4+parseInt(_0x1a6a09(0x144))/0x5*(parseInt(_0x1a6a09(0x11c))/0x6)+-parseInt(_0x1a6a09(0x124))/0x7+parseInt(_0x1a6a09(0x100))/0x8*(-parseInt(_0x1a6a09(0x10a))/0x9)+parseInt(_0x1a6a09(0x11f))/0xa*(parseInt(_0x1a6a09(0x106))/0xb);if(_0x173768===_0x50cb45)break;else _0x29aa22['push'](_0x29aa22['shift']());}catch(_0x2ce8ab){_0x29aa22['push'](_0x29aa22['shift']());}}}(a62_0x17da,0x49bfe));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';function a62_0x5a00(_0x2e5a79,_0x7aedc5){_0x2e5a79=_0x2e5a79-0xf4;const _0x17da48=a62_0x17da();let _0x5a0078=_0x17da48[_0x2e5a79];return _0x5a0078;}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';function a62_0x17da(){const _0x4ea346=['from','.lovrabet/skill/.shared/guides','输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)','✓\x20创建\x20.lovrabet/skill-manifest.json','--help','keys','\x20\x20!\x20CDN\x20拉取失败,跳过指南安装:\x20','8286AiMvgO','stdout','path','✓\x20拉取\x20','stdin','2128dcFIqq','\x20\x20✓\x20创建\x20','includes','entries','⚠️\x20\x20未知的平台:\x20','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE','924TrHiKV','\x20\x20q.\x20取消\x0a','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包','argv','2925pIoPSJ','错误:\x20不支持的命令:\x20','guides','some','warn','slice','skill-install','stringify','\x20个目录\x0a','trim','(含扩展)','\x20\x20✗\x20安装\x20','setLogPath','log','exit','-$1','.lovrabet','utf-8','159516TvOHDx','不支持的命令:\x20','913828hcbKYR','75410BIeFal','info','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a',',使用通用模板','\x0a没有有效的\x20IDE\x20需要安装\x0a','1615978lRCQfv','\x0a📦\x20正在安装\x20','description','length','\x0a✓\x20技能包安装成功!共安装\x20','install','message','startsWith','...\x0a','使用示例:','\x0a未选择任何\x20IDE,安装取消\x0a','\x20个开发者指南','\x0aLovrabet\x20Skill\x20-\x20开发者技能包安装工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互式选择并安装技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20直接安装指定\x20IDE\x20的技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20安装所有技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20包含\x20Backend\x20Function\x20同步工作流\x0a\x0a安装方式:\x0a\x20\x20\x20交互式选择\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20显示\x20IDE\x20列表供选择,支持多选\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20使用\x20↑↓\x20移动光标,空格选中/取消,Enter\x20确认\x0a\x20\x20\x20\x20→\x20按\x20a\x20全选,按\x20i/r\x20反选,按\x20q\x20退出\x0a\x0a\x20\x20直接安装指定\x20IDE\x20(支持多个)\x20\x20\x20\x20\x20\x20\x20-\x20使用\x20--ide\x20标志直接安装\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装\x20Cursor\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20安装多个\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装全部\x0a\x0a\x20\x20包含\x20Backend\x20Function\x20同步工作流\x20\x20\x20-\x20使用\x20--dangerously-bff-save\x20标志\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支持的\x20IDE:\x0a\x20\x20--cursor\x20\x20\x20\x20\x20\x20\x20Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)\x0a\x20\x20--windsurf\x20\x20\x20\x20\x20Windsurf\x20IDE\x20(.windsurf/workflows/)\x0a\x20\x20--claude\x20\x20\x20\x20\x20\x20\x20Claude\x20Code\x20(.claude/skills/)\x0a\x20\x20--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其他\x20(通用模板)\x20(.agent/skills/)\x20-\x20兜底方案\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20安装所有\x20IDE\x20技能包(包括通用模板)\x0a\x0a选项:\x0a\x20\x20--dangerously-bff-save\x20\x20\x20\x20包含\x20Backend\x20Function\x20同步工作流指南\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(需要\x20MCP\x20服务器启用相应\x20tools)\x0a\x0a技能包内容包括:\x0a\x20\x20-\x20Filter\x20查询构建规范\x20(10\x20种常见错误对照)\x0a\x20\x20-\x20MCP\x20SQL\x20创建工作流\x20(5\x20步强制流程)\x0a\x20\x20-\x20AntD\x20UI\x20开发规范\x20(禁止\x20AI\x20味道)\x0a\x20\x20-\x20API\x20集成指南\x20(lovrabet\x20api\x20pull\x20流程)\x0a\x20\x20-\x20菜单管理指南\x20(menu\x20sync/update\x20流程)\x0a\x20\x20-\x20Backend\x20Function\x20脚本编写规范\x20(权限过滤、数据脱敏、业务逻辑)\x0a\x20\x20-\x20Backend\x20Function\x20同步工作流\x20(需\x20--dangerously-bff-save\x20启用)\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20交互式选择\x20IDE\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a\x20\x20\x20\x20→\x20直接安装\x20Cursor\x20和\x20claude\x20code\x20技能包\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a\x20\x20\x20\x20→\x20安装技能包并包含\x20Backend\x20Function\x20同步工作流\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a\x20\x20\x20\x20→\x20安装所有\x20IDE\x20技能包\x0a\x0a安装后会在项目中创建:\x0a\x20\x20-\x20IDE\x20特定配置文件\x20(.cursorrules,\x20.windsurf/,\x20.claude/,\x20.cline/,\x20.codex/,\x20.opencode/,\x20.qoder/,\x20.codebuddy/,\x20.trae/)\x0a\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20\x20-\x20开发者技能指南\x0a\x0a开发者指南位置:\x0a\x20\x20.lovrabet/skill/.shared/guides/01-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','help','split','replace','正在从\x20CDN\x20拉取开发者指南','.lovrabet/skill-manifest.json','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a','...','../../cdn-source/skills','push','toLowerCase','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包','quit','\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','folders','agent','files','forEach','cwd','close','30MNkvGS','开发者指南位置:','question','name','all','2OIQPqK','1181247sxuUHO'];a62_0x17da=function(){return _0x4ea346;};return a62_0x17da();}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x17e27f){const _0x1aea06=a62_0x5a00,_0x562a82=[];for(const [_0x1fcfcb,_0x52afc9]of Object[_0x1aea06(0x103)](_0x17e27f)){if(_0x52afc9===!![]){const _0x30491e=_0x1fcfcb[_0x1aea06(0x133)](/([A-Z])/g,_0x1aea06(0x119))[_0x1aea06(0x13a)]();_0x562a82[_0x1aea06(0x139)](_0x30491e);}}return _0x562a82;}export function parseDynamicFlags(){const _0x166ede=a62_0x5a00,_0x38bcee=[];for(let _0x2a55fc=0x3;_0x2a55fc<process[_0x166ede(0x109)]['length'];_0x2a55fc++){const _0x1f67b1=process[_0x166ede(0x109)][_0x2a55fc];if(_0x1f67b1&&_0x1f67b1[_0x166ede(0x12b)]('--')){const _0x17a4b8=_0x1f67b1[_0x166ede(0x10f)](0x2);_0x17a4b8&&!_0x17a4b8[_0x166ede(0x102)]('=')&&_0x38bcee[_0x166ede(0x139)](_0x17a4b8);}}return _0x38bcee;}export function getAllProvidedFlags(_0x9287b1){const _0x2e1988=a62_0x5a00,_0xe18e8d=camelCaseFlagsToKebab(_0x9287b1),_0x131dcb=parseDynamicFlags(),_0x3ff72b=new Set([..._0xe18e8d,..._0x131dcb]);return Array[_0x2e1988(0xf4)](_0x3ff72b);}export async function skillsCommand(_0x4d47e0,_0x47d6b7,_0x3bb52d){const _0x2fff7b=a62_0x5a00;logger[_0x2fff7b(0x116)](process[_0x2fff7b(0x142)]());if(_0x3bb52d?.[_0x2fff7b(0x131)]||_0x4d47e0===_0x2fff7b(0xf8)){showHelp();return;}_0x4d47e0!==_0x2fff7b(0x129)&&(console['error'](_0x2fff7b(0x10b)+(_0x4d47e0||'(空)')),console[_0x2fff7b(0x117)]('\x0a可用命令:'),console['log'](_0x2fff7b(0x13b)),console[_0x2fff7b(0x117)](_0x2fff7b(0x108)),console[_0x2fff7b(0x117)](_0x2fff7b(0x13d)),console[_0x2fff7b(0x117)](_0x2fff7b(0x12d)),console[_0x2fff7b(0x117)](_0x2fff7b(0x105)),console[_0x2fff7b(0x117)](_0x2fff7b(0x136)),logger['error']('skill',_0x2fff7b(0x11d)+_0x4d47e0),process[_0x2fff7b(0x118)](0x1));let _0x4c5a1a=_0x47d6b7?.[0x0];const _0x4b11b6=getAllProvidedFlags(_0x3bb52d??{});_0x4c5a1a?.[_0x2fff7b(0x12b)]('--')&&(_0x4c5a1a=undefined),await installSkill(_0x4c5a1a??'agent',_0x4b11b6);}async function selectIDEs(){const _0x119d24=a62_0x5a00;return console[_0x119d24(0x117)]('\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a'),CORE_IDE_LIST[_0x119d24(0x141)]((_0x453c26,_0x5af22d)=>{const _0x8a0b99=_0x119d24;console[_0x8a0b99(0x117)]('\x20\x20'+(_0x5af22d+0x1)+'.\x20'+IDE_CONFIGS[_0x453c26]['name']+'\x20-\x20'+IDE_CONFIGS[_0x453c26][_0x8a0b99(0x126)]);}),console['log']('\x20\x200.\x20全部安装'),console[_0x119d24(0x117)](_0x119d24(0x107)),console[_0x119d24(0x117)](_0x119d24(0xf6)),console[_0x119d24(0x117)]('输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a'),new Promise(_0x528e46=>{const _0x59cf48=_0x119d24,_0x21bdbe=createInterface({'input':process[_0x59cf48(0xff)],'output':process[_0x59cf48(0xfc)]});_0x21bdbe[_0x59cf48(0x146)]('请选择:\x20',_0x4661a8=>{const _0x3e23e8=_0x59cf48;_0x21bdbe[_0x3e23e8(0x143)]();const _0x5e3c2f=_0x4661a8[_0x3e23e8(0x113)]()[_0x3e23e8(0x13a)]();(_0x5e3c2f==='q'||_0x5e3c2f===_0x3e23e8(0x13c)||_0x5e3c2f===_0x3e23e8(0x118))&&(console[_0x3e23e8(0x117)]('\x0a已取消安装\x0a'),process[_0x3e23e8(0x118)](0x0));if(_0x5e3c2f==='0'||_0x5e3c2f==='all'){_0x528e46([_0x3e23e8(0x148)]);return;}const _0x488a65=_0x5e3c2f[_0x3e23e8(0x132)](/\s+/)['filter'](Boolean),_0x435031=[];for(const _0x52f14e of _0x488a65){const _0xab3a90=parseInt(_0x52f14e,0xa);if(!isNaN(_0xab3a90)&&_0xab3a90>=0x1&&_0xab3a90<=CORE_IDE_LIST[_0x3e23e8(0x127)]){const _0x358b93=CORE_IDE_LIST[_0xab3a90-0x1];_0x358b93&&!_0x435031['includes'](_0x358b93)&&_0x435031['push'](_0x358b93);}}_0x435031[_0x3e23e8(0x127)]===0x0&&(console[_0x3e23e8(0x117)](_0x3e23e8(0x12e)),process['exit'](0x0)),_0x528e46(_0x435031);});});}function showHelp(){const _0x50cf9b=a62_0x5a00;console[_0x50cf9b(0x117)](_0x50cf9b(0x130));}async function installSkill(_0x3bf829,_0x2abdd8){const _0x5dfb9b=a62_0x5a00,_0x2e4696=process[_0x5dfb9b(0x142)](),_0x284b3c=resolve(__dirname,_0x5dfb9b(0x138));let _0x5404ca=[];!_0x3bf829?_0x5404ca=await selectIDEs():_0x5404ca=[_0x3bf829];_0x5404ca[_0x5dfb9b(0x102)](_0x5dfb9b(0x148))&&(_0x5404ca=[...ALL_CORE_IDES,_0x5dfb9b(0x13f)]);const _0x59bd93=[];for(const _0x2408a7 of _0x5404ca){if(_0x2408a7==='agent')_0x59bd93['push'](_0x5dfb9b(0x13f));else{if(_0x2408a7===_0x5dfb9b(0x148))continue;else IDE_CONFIGS[_0x2408a7]?_0x59bd93[_0x5dfb9b(0x139)](_0x2408a7):(console[_0x5dfb9b(0x117)](_0x5dfb9b(0x104)+_0x2408a7+_0x5dfb9b(0x122)),_0x59bd93[_0x5dfb9b(0x139)](_0x5dfb9b(0x13f)));}}_0x59bd93['length']===0x0&&(console[_0x5dfb9b(0x117)](_0x5dfb9b(0x123)),process[_0x5dfb9b(0x118)](0x0));const _0x2e67fd=_0x2abdd8&&_0x2abdd8['length']>0x0;console[_0x5dfb9b(0x117)](_0x5dfb9b(0x134)+(_0x2e67fd?_0x5dfb9b(0x114):'')+_0x5dfb9b(0x137));let _0x427263;try{_0x427263=await fetchGuidesFromCDN(_0x2e67fd),console[_0x5dfb9b(0x117)](_0x5dfb9b(0xfe)+Object[_0x5dfb9b(0xf9)](_0x427263[_0x5dfb9b(0x10c)])['length']+_0x5dfb9b(0x12f));}catch(_0x1d9ce0){console[_0x5dfb9b(0x10e)](_0x5dfb9b(0xfa)+(_0x1d9ce0 instanceof Error?_0x1d9ce0[_0x5dfb9b(0x12a)]:String(_0x1d9ce0)));}let _0x5a4f98=0x0;for(const _0x4ce9dc of _0x59bd93){try{const _0x1f1209=_0x4ce9dc==='agent'?'通用模板':IDE_CONFIGS[_0x4ce9dc]?.[_0x5dfb9b(0x147)]||_0x4ce9dc;console[_0x5dfb9b(0x117)](_0x5dfb9b(0x125)+_0x1f1209+_0x5dfb9b(0x12c));const _0x3a29de=_0x4ce9dc===_0x5dfb9b(0x13f)?undefined:IDE_CONFIGS[_0x4ce9dc],_0x3e74ad=await installSingleIDE(_0x4ce9dc,_0x3a29de,_0x2e4696,_0x284b3c,_0x427263,_0x2abdd8);_0x5a4f98+=_0x3e74ad;if(_0x3a29de?.[_0x5dfb9b(0x13e)])for(const _0x14add5 of _0x3a29de[_0x5dfb9b(0x13e)]){const _0x1966f7=_0x3a29de[_0x5dfb9b(0x140)]?.[_0x5dfb9b(0x10d)](_0x4f369d=>_0x4f369d['path'][_0x5dfb9b(0x12b)](_0x14add5+'/'))??![];_0x1966f7?console[_0x5dfb9b(0x117)](_0x5dfb9b(0x101)+_0x14add5+'/'):console[_0x5dfb9b(0x117)]('\x20\x20✓\x20创建\x20'+_0x14add5);}if(_0x3a29de?.[_0x5dfb9b(0x140)])for(const _0x119c25 of _0x3a29de[_0x5dfb9b(0x140)]){console[_0x5dfb9b(0x117)](_0x5dfb9b(0x101)+_0x119c25[_0x5dfb9b(0xfd)]);}}catch(_0x5edf24){console['error'](_0x5dfb9b(0x115)+_0x4ce9dc+'\x20失败:\x20'+(_0x5edf24 instanceof Error?_0x5edf24[_0x5dfb9b(0x12a)]:String(_0x5edf24)));}}_0x427263&&writeGuidesToProject(_0x427263,_0x2e4696,_0x5dfb9b(0xf5),_0x2abdd8);const _0x351367={'version':'2.0.0','installedAt':new Date()['toISOString'](),'platforms':_0x59bd93},_0x11a5eb=join(_0x2e4696,_0x5dfb9b(0x135)),_0x4c0a4b=join(_0x2e4696,_0x5dfb9b(0x11a));await copyDir(_0x4c0a4b,_0x4c0a4b),writeFileSync(_0x11a5eb,JSON[_0x5dfb9b(0x111)](_0x351367,null,0x2),_0x5dfb9b(0x11b)),console[_0x5dfb9b(0x117)](_0x5dfb9b(0xf7)),console[_0x5dfb9b(0x117)](_0x5dfb9b(0x128)+_0x5a4f98+_0x5dfb9b(0x112)),console[_0x5dfb9b(0x117)](_0x5dfb9b(0x145)),console[_0x5dfb9b(0x117)](_0x5dfb9b(0x121)),logger[_0x5dfb9b(0x120)](_0x5dfb9b(0x110),'安装成功',{'projectRoot':_0x2e4696,'ides':_0x59bd93,'foldersCount':_0x5a4f98});}
|
|
1
|
+
const a65_0x5a5c0d=a65_0x2f81;(function(_0x110200,_0x16a7b8){const _0x4ec2bc=a65_0x2f81,_0x33ac09=_0x110200();while(!![]){try{const _0x4bb4c0=-parseInt(_0x4ec2bc(0xfd))/0x1+parseInt(_0x4ec2bc(0x107))/0x2*(parseInt(_0x4ec2bc(0x10d))/0x3)+-parseInt(_0x4ec2bc(0xf5))/0x4+-parseInt(_0x4ec2bc(0x117))/0x5*(-parseInt(_0x4ec2bc(0xe5))/0x6)+-parseInt(_0x4ec2bc(0xbd))/0x7*(parseInt(_0x4ec2bc(0xfa))/0x8)+parseInt(_0x4ec2bc(0x106))/0x9+parseInt(_0x4ec2bc(0xcc))/0xa*(parseInt(_0x4ec2bc(0x120))/0xb);if(_0x4bb4c0===_0x16a7b8)break;else _0x33ac09['push'](_0x33ac09['shift']());}catch(_0x21d525){_0x33ac09['push'](_0x33ac09['shift']());}}}(a65_0x2e8d,0x84cf9));import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';function a65_0x2e8d(){const _0x2dc67b=['all','--help','14680aqcUUu','skill.errorHint.installDirect','argv','434440AnKZcQ','split','toLowerCase','skill.help.bffOption','stdin','skill.error.unsupportedCommand','startsWith','skill.help.title','skill.done.guidesLocation','2461455TecPcI','44LYGStB','不支持的命令:\x20','exit','skill.help.installInteractive','question','\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','105177WQUWbu','error','skill.help.showHelp','.lovrabet','\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','trim','replace','skill.select.inputFormat','\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a','skill.help.afterInstallList','5406955POHrrY','\x20\x20q.\x20','skill.help.installDirect','cwd','skill.help.exampleInteractive','name','skill.help.guidesLocationTitle','.lovrabet/skill/.shared/guides','skill.help.options','319cJQPJo','skill.error.installFailed','stringify','skill.error.unknownPlatform','message','skill.select.inputHint','path','安装成功','bind','\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.installing.created','skill.generic','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a','skill.cdn.fetchSuccess','files','forEach','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20','../../cdn-source/skills','3143MbZzzV','skill.select.cancel','skill.help.exampleAllDesc','skill.errorHint.showHelp','\x20\x200.\x20','warn','skill.help.usage','skill.help.installAll','skill.help.skillContentsList','skill.select.title','skill.cdn.fetchFailed','skill.done.guidesPath','skill-install','setLogPath','\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','12350iDbtbv','help','(empty)','includes','skill.help.skillContents','skill.errorHint.exampleDirect','guides','skill.help.exampleBffDesc','skill.help.interactiveKeys','skill.help.exampleDirectDesc','-$1','skill.help.examples','\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.installing.createdManifest','skill.cdn.fetching','info','\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.installInteractive','skill.installing.ide','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20','length','skill.errorHint.usageExamples','push','install','skill.help.afterInstall','6XIoTBY','skill.help.directInstall','close','folders','skill.help.installMethods','skill','entries','filter','skill.installing.createdDir','utf-8','\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','agent','skill.help.agentDesc','stdout','\x20-\x20','.lovrabet/skill-manifest.json','1438604uMPUVx','slice','log'];a65_0x2e8d=function(){return _0x2dc67b;};return a65_0x2e8d();}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_0x213355 from'../i18n/index.js';const t=a65_0x213355['t'][a65_0x5a5c0d(0x128)](a65_0x213355),__dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x2ac50b){const _0x2563db=a65_0x5a5c0d,_0x438fd2=[];for(const [_0xd000f9,_0x384482]of Object[_0x2563db(0xeb)](_0x2ac50b)){if(_0x384482===!![]){const _0x221d89=_0xd000f9[_0x2563db(0x113)](/([A-Z])/g,_0x2563db(0xd6))[_0x2563db(0xff)]();_0x438fd2[_0x2563db(0xe2)](_0x221d89);}}return _0x438fd2;}export function parseDynamicFlags(){const _0x50d73b=a65_0x5a5c0d,_0x5a65e1=[];for(let _0xe199bf=0x3;_0xe199bf<process['argv'][_0x50d73b(0xe0)];_0xe199bf++){const _0x130cf9=process[_0x50d73b(0xfc)][_0xe199bf];if(_0x130cf9&&_0x130cf9['startsWith']('--')){const _0x49a73b=_0x130cf9[_0x50d73b(0xf6)](0x2);_0x49a73b&&!_0x49a73b[_0x50d73b(0xcf)]('=')&&_0x5a65e1[_0x50d73b(0xe2)](_0x49a73b);}}return _0x5a65e1;}function a65_0x2f81(_0x2a80c1,_0x172fcb){_0x2a80c1=_0x2a80c1-0xbd;const _0x2e8d6d=a65_0x2e8d();let _0x2f8113=_0x2e8d6d[_0x2a80c1];return _0x2f8113;}export function getAllProvidedFlags(_0x523eb6){const _0x3e3252=camelCaseFlagsToKebab(_0x523eb6),_0x3c6db3=parseDynamicFlags(),_0x37e135=new Set([..._0x3e3252,..._0x3c6db3]);return Array['from'](_0x37e135);}export async function skillsCommand(_0x34aeed,_0x368392,_0x230f2b){const _0x37ed33=a65_0x5a5c0d;logger[_0x37ed33(0xca)](process[_0x37ed33(0x11a)]());if(_0x230f2b?.[_0x37ed33(0xcd)]||_0x34aeed===_0x37ed33(0xf9)){showHelp();return;}_0x34aeed!==_0x37ed33(0xe3)&&(console[_0x37ed33(0x10e)](t(_0x37ed33(0x102),{'cmd':_0x34aeed||_0x37ed33(0xce)})),console[_0x37ed33(0xf7)](t('skill.errorHint.availableCommands')),console[_0x37ed33(0xf7)](t(_0x37ed33(0xdd))),console[_0x37ed33(0xf7)](t(_0x37ed33(0xfb))),console[_0x37ed33(0xf7)](t(_0x37ed33(0xc0))),console[_0x37ed33(0xf7)](t(_0x37ed33(0xe1))),console[_0x37ed33(0xf7)](t('skill.errorHint.exampleInteractive')),console[_0x37ed33(0xf7)](t(_0x37ed33(0xd1))),logger['error'](_0x37ed33(0xea),_0x37ed33(0x108)+_0x34aeed),process[_0x37ed33(0x109)](0x1));let _0x4fc536=_0x368392?.[0x0];const _0x313af2=getAllProvidedFlags(_0x230f2b??{});_0x4fc536?.[_0x37ed33(0x103)]('--')&&(_0x4fc536=undefined),await installSkill(_0x4fc536??_0x37ed33(0xf0),_0x313af2);}async function selectIDEs(){const _0x5d9c1c=a65_0x5a5c0d;return console[_0x5d9c1c(0xf7)](t(_0x5d9c1c(0xc6))),CORE_IDE_LIST[_0x5d9c1c(0x12f)]((_0x1d79a5,_0x44135e)=>{const _0x71c6db=_0x5d9c1c;console[_0x71c6db(0xf7)]('\x20\x20'+(_0x44135e+0x1)+'.\x20'+IDE_CONFIGS[_0x1d79a5]['name']+_0x71c6db(0xf3)+IDE_CONFIGS[_0x1d79a5]['description']);}),console[_0x5d9c1c(0xf7)](_0x5d9c1c(0xc1)+t('skill.select.installAll')),console[_0x5d9c1c(0xf7)](_0x5d9c1c(0x118)+t(_0x5d9c1c(0xbe))+'\x0a'),console[_0x5d9c1c(0xf7)](t(_0x5d9c1c(0x114))),console[_0x5d9c1c(0xf7)](t(_0x5d9c1c(0x125))),new Promise(_0x287e33=>{const _0x1b2a38=_0x5d9c1c,_0x2a0bad=createInterface({'input':process[_0x1b2a38(0x101)],'output':process[_0x1b2a38(0xf2)]});_0x2a0bad[_0x1b2a38(0x10b)](t('skill.select.prompt'),_0x22285c=>{const _0x57ad2f=_0x1b2a38;_0x2a0bad[_0x57ad2f(0xe7)]();const _0x3c4b84=_0x22285c[_0x57ad2f(0x112)]()[_0x57ad2f(0xff)]();(_0x3c4b84==='q'||_0x3c4b84==='quit'||_0x3c4b84===_0x57ad2f(0x109))&&(console[_0x57ad2f(0xf7)](t('skill.select.cancelled')),process[_0x57ad2f(0x109)](0x0));if(_0x3c4b84==='0'||_0x3c4b84===_0x57ad2f(0xf8)){_0x287e33([_0x57ad2f(0xf8)]);return;}const _0x34875c=_0x3c4b84[_0x57ad2f(0xfe)](/\s+/)[_0x57ad2f(0xec)](Boolean),_0x3dcfd7=[];for(const _0x3c632e of _0x34875c){const _0x3308c1=parseInt(_0x3c632e,0xa);if(!isNaN(_0x3308c1)&&_0x3308c1>=0x1&&_0x3308c1<=CORE_IDE_LIST['length']){const _0x238c2=CORE_IDE_LIST[_0x3308c1-0x1];_0x238c2&&!_0x3dcfd7[_0x57ad2f(0xcf)](_0x238c2)&&_0x3dcfd7[_0x57ad2f(0xe2)](_0x238c2);}}_0x3dcfd7[_0x57ad2f(0xe0)]===0x0&&(console[_0x57ad2f(0xf7)](t('skill.select.noneSelected')),process[_0x57ad2f(0x109)](0x0)),_0x287e33(_0x3dcfd7);});});}function showHelp(){const _0x18d4fc=a65_0x5a5c0d;console[_0x18d4fc(0xf7)]('\x0a'+t(_0x18d4fc(0x104))+'\x0a\x0a'+t(_0x18d4fc(0xc3))+_0x18d4fc(0xdc)+t(_0x18d4fc(0x10f))+'\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(_0x18d4fc(0x10a))+_0x18d4fc(0x129)+t(_0x18d4fc(0x119))+_0x18d4fc(0xd8)+t(_0x18d4fc(0xc4))+'\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20'+t('skill.help.installWithBff')+'\x0a\x0a'+t(_0x18d4fc(0xe9))+'\x0a'+t('skill.help.interactiveSelect')+'\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a'+t(_0x18d4fc(0xd4))+'\x0a\x0a'+t(_0x18d4fc(0xe6))+_0x18d4fc(0x130)+t('skill.help.installDirect')+_0x18d4fc(0xdf)+t(_0x18d4fc(0xc4))+_0x18d4fc(0xef)+t(_0x18d4fc(0xc4))+'\x0a\x0a'+t('skill.help.bffWorkflow')+_0x18d4fc(0x111)+t('skill.help.supportedIDEs')+_0x18d4fc(0x10c)+t(_0x18d4fc(0xf1))+'\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(_0x18d4fc(0x11f))+'\x0a'+t(_0x18d4fc(0x100))+'\x0a\x0a'+t(_0x18d4fc(0xd0))+'\x0a'+t(_0x18d4fc(0xc5))+'\x0a\x0a'+t(_0x18d4fc(0xd7))+_0x18d4fc(0x115)+t(_0x18d4fc(0x11b))+_0x18d4fc(0x12c)+t(_0x18d4fc(0xd5))+'\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a'+t(_0x18d4fc(0xd3))+'\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a'+t(_0x18d4fc(0xbf))+'\x0a\x0a'+t(_0x18d4fc(0xe4))+'\x0a'+t(_0x18d4fc(0x116))+'\x0a\x0a'+t(_0x18d4fc(0x11d))+_0x18d4fc(0xcb));}async function installSkill(_0x51f979,_0x2d09dc){const _0x511045=a65_0x5a5c0d,_0x55b853=process['cwd'](),_0x130f7e=resolve(__dirname,_0x511045(0x131));let _0x48dd10=[];!_0x51f979?_0x48dd10=await selectIDEs():_0x48dd10=[_0x51f979];_0x48dd10[_0x511045(0xcf)](_0x511045(0xf8))&&(_0x48dd10=[...ALL_CORE_IDES,_0x511045(0xf0)]);const _0x3788e5=[];for(const _0x592e5e of _0x48dd10){if(_0x592e5e==='agent')_0x3788e5[_0x511045(0xe2)](_0x511045(0xf0));else{if(_0x592e5e===_0x511045(0xf8))continue;else IDE_CONFIGS[_0x592e5e]?_0x3788e5[_0x511045(0xe2)](_0x592e5e):(console[_0x511045(0xf7)](t(_0x511045(0x123),{'ide':_0x592e5e})),_0x3788e5[_0x511045(0xe2)](_0x511045(0xf0)));}}_0x3788e5['length']===0x0&&(console[_0x511045(0xf7)](t('skill.error.noValidIDE')),process[_0x511045(0x109)](0x0));const _0xb2f7d4=_0x2d09dc&&_0x2d09dc[_0x511045(0xe0)]>0x0;console['log'](_0xb2f7d4?t('skill.cdn.fetchingExtend'):t(_0x511045(0xda)));let _0x41a741;try{_0x41a741=await fetchGuidesFromCDN(_0xb2f7d4),console[_0x511045(0xf7)](t(_0x511045(0x12d),{'count':Object['keys'](_0x41a741[_0x511045(0xd2)])[_0x511045(0xe0)]}));}catch(_0x26dcd0){console[_0x511045(0xc2)](t(_0x511045(0xc7),{'error':_0x26dcd0 instanceof Error?_0x26dcd0[_0x511045(0x124)]:String(_0x26dcd0)}));}let _0x5290be=0x0;for(const _0x554160 of _0x3788e5){try{const _0x838e5c=_0x554160===_0x511045(0xf0)?t(_0x511045(0x12b)):IDE_CONFIGS[_0x554160]?.[_0x511045(0x11c)]||_0x554160;console['log'](t(_0x511045(0xde),{'name':_0x838e5c}));const _0x44414a=_0x554160===_0x511045(0xf0)?undefined:IDE_CONFIGS[_0x554160],_0x351c85=await installSingleIDE(_0x554160,_0x44414a,_0x55b853,_0x130f7e,_0x41a741,_0x2d09dc);_0x5290be+=_0x351c85;if(_0x44414a?.[_0x511045(0xe8)])for(const _0x11e89e of _0x44414a['folders']){const _0x1fef50=_0x44414a[_0x511045(0x12e)]?.['some'](_0x2a26cf=>_0x2a26cf['path'][_0x511045(0x103)](_0x11e89e+'/'))??![];_0x1fef50?console[_0x511045(0xf7)](t(_0x511045(0xed),{'path':_0x11e89e})):console[_0x511045(0xf7)](t(_0x511045(0x12a),{'path':_0x11e89e}));}if(_0x44414a?.[_0x511045(0x12e)])for(const _0x39d599 of _0x44414a['files']){console[_0x511045(0xf7)](t(_0x511045(0x12a),{'path':_0x39d599[_0x511045(0x126)]}));}}catch(_0x5a9b8e){console[_0x511045(0x10e)](t(_0x511045(0x121),{'ide':_0x554160,'error':_0x5a9b8e instanceof Error?_0x5a9b8e[_0x511045(0x124)]:String(_0x5a9b8e)}));}}_0x41a741&&writeGuidesToProject(_0x41a741,_0x55b853,_0x511045(0x11e),_0x2d09dc);const _0x1bde02={'version':'2.0.0','installedAt':new Date()['toISOString'](),'platforms':_0x3788e5},_0x168736=join(_0x55b853,_0x511045(0xf4)),_0x31f1da=join(_0x55b853,_0x511045(0x110));await copyDir(_0x31f1da,_0x31f1da),writeFileSync(_0x168736,JSON[_0x511045(0x122)](_0x1bde02,null,0x2),_0x511045(0xee)),console[_0x511045(0xf7)](t(_0x511045(0xd9))),console['log'](t('skill.done.success',{'count':_0x5290be})),console[_0x511045(0xf7)](t(_0x511045(0x105))),console[_0x511045(0xf7)](t(_0x511045(0xc8))),logger[_0x511045(0xdb)](_0x511045(0xc9),_0x511045(0x127),{'projectRoot':_0x55b853,'ides':_0x3788e5,'foldersCount':_0x5290be});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x50ff57=a66_0x34e4;(function(_0x1dfbcb,_0x460aae){const _0x3c4957=a66_0x34e4,_0x4399c6=_0x1dfbcb();while(!![]){try{const _0x1990f5=-parseInt(_0x3c4957(0xd1))/0x1+-parseInt(_0x3c4957(0xef))/0x2*(-parseInt(_0x3c4957(0xec))/0x3)+parseInt(_0x3c4957(0xf7))/0x4*(-parseInt(_0x3c4957(0xd2))/0x5)+parseInt(_0x3c4957(0xf3))/0x6*(-parseInt(_0x3c4957(0xe3))/0x7)+-parseInt(_0x3c4957(0xe2))/0x8+-parseInt(_0x3c4957(0xd8))/0x9*(parseInt(_0x3c4957(0xf1))/0xa)+-parseInt(_0x3c4957(0xda))/0xb*(-parseInt(_0x3c4957(0xd5))/0xc);if(_0x1990f5===_0x460aae)break;else _0x4399c6['push'](_0x4399c6['shift']());}catch(_0x39fc36){_0x4399c6['push'](_0x4399c6['shift']());}}}(a66_0x305f,0xa0983));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_0x305f(){const _0x97f72b=['skill.cdn.fetchSuccess','28579804fAHwiv','skill.cdn.fetching','skill.error.unknownIDE','setLogPath','stringify','info','skill-install-non-interactive','guides','4183352BnlOaZ','35IQDGvf','skill.cdn.fetchingExtend','keys','log','skill.error.installFailed','安装成功','../../cdn-source/skills','.lovrabet/skill-manifest.json','.lovrabet','386898PuqOow','toISOString','skill.done.guidesPathInline','12xjsudJ','name','100970XlApei','\x20\x20✓\x20','304224crEfWB','length','skill.cdn.fetchFailed','cwd','196036ItXgCO','226369zIgPXL','120RZOqEq','message','skill.done.success','12CsefJN','warn','error','477nnVQcY'];a66_0x305f=function(){return _0x97f72b;};return a66_0x305f();}import{logger}from'../utils/logger.js';function a66_0x34e4(_0x4e59ec,_0x56cfd9){_0x4e59ec=_0x4e59ec-0xd1;const _0x305f50=a66_0x305f();let _0x34e4e0=_0x305f50[_0x4e59ec];return _0x34e4e0;}import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a66_0x38203c from'../i18n/index.js';const t=a66_0x38203c['t']['bind'](a66_0x38203c),__dirname=dirname(fileURLToPath(import.meta.url));export async function installSkillsNonInteractive(_0x3e0ef6,_0xabb323,_0x1a253a=process[a66_0x50ff57(0xf6)]()){const _0x1cf6aa=a66_0x50ff57,_0x1775bc=resolve(__dirname,_0x1cf6aa(0xe9));logger[_0x1cf6aa(0xdd)](_0x1a253a),logger[_0x1cf6aa(0xdf)](_0x1cf6aa(0xe0),'开始安装技能包',{'ides':_0x3e0ef6});const _0x5317a8=join(_0x1a253a,_0x1cf6aa(0xeb));!existsSync(_0x5317a8)&&mkdirSync(_0x5317a8,{'recursive':!![]});const _0x4f07c8=_0xabb323&&_0xabb323[_0x1cf6aa(0xf4)]>0x0;console['log'](_0x4f07c8?t(_0x1cf6aa(0xe4)):t(_0x1cf6aa(0xdb)));let _0x4a3f57;try{_0x4a3f57=await fetchGuidesFromCDN(_0x4f07c8),console[_0x1cf6aa(0xe6)](t(_0x1cf6aa(0xd9),{'count':Object[_0x1cf6aa(0xe5)](_0x4a3f57[_0x1cf6aa(0xe1)])[_0x1cf6aa(0xf4)]}));}catch(_0x1053b7){console[_0x1cf6aa(0xd6)](t(_0x1cf6aa(0xf5),{'error':_0x1053b7 instanceof Error?_0x1053b7[_0x1cf6aa(0xd3)]:String(_0x1053b7)}));}let _0x1bd994=0x0;for(const _0x54423e of _0x3e0ef6){try{const _0x3b5d31=IDE_CONFIGS[_0x54423e];if(!_0x3b5d31){console[_0x1cf6aa(0xd6)](t(_0x1cf6aa(0xdc),{'ide':_0x54423e}));continue;}const _0x2c8576=await installSingleIDE(_0x54423e,_0x3b5d31,_0x1a253a,_0x1775bc,_0x4a3f57,_0xabb323);_0x1bd994+=_0x2c8576,console['log'](_0x1cf6aa(0xf2)+(_0x3b5d31[_0x1cf6aa(0xf0)]||_0x54423e));}catch(_0x45a5f8){console[_0x1cf6aa(0xd7)](t(_0x1cf6aa(0xe7),{'ide':_0x54423e,'error':_0x45a5f8 instanceof Error?_0x45a5f8[_0x1cf6aa(0xd3)]:String(_0x45a5f8)}));}}_0x4a3f57&&writeGuidesToProject(_0x4a3f57,_0x1a253a,'.lovrabet/skill/.shared/guides',_0xabb323);const _0x241d21={'version':'2.0.0','installedAt':new Date()[_0x1cf6aa(0xed)](),'platforms':_0x3e0ef6},_0x3f4861=join(_0x1a253a,_0x1cf6aa(0xea));writeFileSync(_0x3f4861,JSON[_0x1cf6aa(0xde)](_0x241d21,null,0x2),'utf-8'),logger[_0x1cf6aa(0xdf)]('skill-install-non-interactive',_0x1cf6aa(0xe8),{'projectRoot':_0x1a253a,'ides':_0x3e0ef6,'foldersCount':_0x1bd994}),console['log'](t(_0x1cf6aa(0xd4),{'count':_0x1bd994})),console['log'](t(_0x1cf6aa(0xee)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a67_0x5afd(_0xc385d1,_0x58a828){_0xc385d1=_0xc385d1-0x1ac;const _0x2a8461=a67_0x2a84();let _0x5afd1e=_0x2a8461[_0xc385d1];return _0x5afd1e;}(function(_0x22f880,_0x166e16){const _0x4e2ba4=a67_0x5afd,_0x2b1cb3=_0x22f880();while(!![]){try{const _0x2e4532=-parseInt(_0x4e2ba4(0x1b1))/0x1+-parseInt(_0x4e2ba4(0x1ac))/0x2*(-parseInt(_0x4e2ba4(0x1b4))/0x3)+-parseInt(_0x4e2ba4(0x1bd))/0x4+-parseInt(_0x4e2ba4(0x1b5))/0x5*(-parseInt(_0x4e2ba4(0x1c2))/0x6)+-parseInt(_0x4e2ba4(0x1ca))/0x7*(-parseInt(_0x4e2ba4(0x1c7))/0x8)+-parseInt(_0x4e2ba4(0x1b9))/0x9*(parseInt(_0x4e2ba4(0x1b7))/0xa)+parseInt(_0x4e2ba4(0x1c9))/0xb;if(_0x2e4532===_0x166e16)break;else _0x2b1cb3['push'](_0x2b1cb3['shift']());}catch(_0xf48b27){_0x2b1cb3['push'](_0x2b1cb3['shift']());}}}(a67_0x2a84,0xb0600));function a67_0x2a84(){const _0x3df326=['\x0a<!--\x20GUIDES_APPEND\x20-->','`\x20|\x20','name','710915lYvicH','requireFlags','push','3351IFpScQ','220655iQWefg','path','1074440zxrXPX','includes','81DPWlan','files','title','test','3746876WZIMPn','SKILL.md.tpl','keys','some','indexOf','54RBmCUr','template','<!--\x20GUIDES_APPEND\x20-->','guides','length','8aeawBz','startsWith','15147407cBHDWx','8703688eKGVNO','sort','utf-8','572xPVrCf','replace'];a67_0x2a84=function(){return _0x3df326;};return a67_0x2a84();}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(_0x50a502,_0x11ec5c,_0x181c94,_0xccdd2d,_0x5f0995,_0x248df3){const _0x5a2902=a67_0x5afd;let _0x5152b8=0x0;const _0x4c9097=_0x11ec5c?.['folders']??['.'+_0x50a502];for(const _0x269b31 of _0x4c9097){const _0x47cf7c=join(_0x181c94,_0x269b31),_0x2b7ffa=_0x11ec5c?.[_0x5a2902(0x1ba)]?.[_0x5a2902(0x1c0)](_0x1932fb=>_0x1932fb['path'][_0x5a2902(0x1c8)](_0x269b31+'/'))??![];_0x2b7ffa?!existsSync(_0x47cf7c)&&(mkdirSync(_0x47cf7c,{'recursive':!![]}),_0x5152b8++):!existsSync(_0x47cf7c)&&(writeFileSync(_0x47cf7c,'',_0x5a2902(0x1cc)),_0x5152b8++);}if(_0x11ec5c?.[_0x5a2902(0x1ba)]){const _0x581a7b=_0x11ec5c[_0x5a2902(0x1b0)]||_0x50a502;for(const _0x4f7e6c of _0x11ec5c[_0x5a2902(0x1ba)]){const _0x5a4981=join(_0x181c94,_0x4f7e6c[_0x5a2902(0x1b6)]);await createFileFromTemplate(_0x4f7e6c,_0x5a4981,_0x581a7b,_0xccdd2d,_0x5f0995,_0x248df3),_0x5152b8++;}}return _0x5152b8;}export async function createFileFromTemplate(_0x11f582,_0x5300a2,_0x52a4f7,_0x59172b,_0x6ec6ad,_0x55666d){const _0x4aa271=a67_0x5afd,_0xf1a1a4=dirname(_0x5300a2);!existsSync(_0xf1a1a4)&&mkdirSync(_0xf1a1a4,{'recursive':!![]});const _0x10d190=_0x11f582[_0x4aa271(0x1c3)]===_0x4aa271(0x1be);if(existsSync(_0x5300a2)&&!_0x10d190)return;if(_0x11f582[_0x4aa271(0x1c3)]){const _0x130f82=join(_0x59172b,_0x11f582[_0x4aa271(0x1c3)]);if(existsSync(_0x130f82)){let _0x43a718=readFileSync(_0x130f82,_0x4aa271(0x1cc));_0x43a718=_0x43a718[_0x4aa271(0x1ad)](/\{\{IDE_NAME\}\}/g,_0x52a4f7);_0x6ec6ad&&_0x10d190&&(_0x43a718=insertGuidesSection(_0x43a718,_0x6ec6ad,_0x55666d),_0x43a718=appendExtendContents(_0x43a718,_0x6ec6ad,_0x55666d));writeFileSync(_0x5300a2,_0x43a718,'utf-8');return;}if(_0x6ec6ad&&_0x10d190)try{writeSkillFile(_0x6ec6ad,_0x5300a2,_0x52a4f7,_0x55666d);return;}catch{}}writeFileSync(_0x5300a2,'',_0x4aa271(0x1cc));}function insertGuidesSection(_0x40ffe9,_0x3d0fd7,_0x52ed5b){const _0x4d4f02=a67_0x5afd,_0x294faf='<!--\x20GUIDES_APPEND\x20-->',_0x69d706=_0x40ffe9[_0x4d4f02(0x1c1)](_0x294faf);if(_0x69d706===-0x1)return _0x40ffe9;const _0x46bfe7=[],_0x5c6f44=Object[_0x4d4f02(0x1bf)](_0x3d0fd7[_0x4d4f02(0x1c5)])[_0x4d4f02(0x1cb)]();for(const _0x4390fd of _0x5c6f44){const _0x3ea54b=_0x3d0fd7['guides'][_0x4390fd];if(!_0x3ea54b)continue;if(/^0[1-6]-/[_0x4d4f02(0x1bc)](_0x4390fd))continue;if(_0x3ea54b['requireFlags']&&_0x3ea54b[_0x4d4f02(0x1b2)][_0x4d4f02(0x1c6)]>0x0){const _0x5f157b=_0x3ea54b[_0x4d4f02(0x1b2)]['some'](_0x4d6f35=>_0x52ed5b?.[_0x4d4f02(0x1b8)](_0x4d6f35));if(!_0x5f157b)continue;}const _0x133c85=_0x3ea54b[_0x4d4f02(0x1b6)][_0x4d4f02(0x1ad)](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x46bfe7[_0x4d4f02(0x1b3)]('|\x20`'+_0x133c85+_0x4d4f02(0x1af)+_0x3ea54b[_0x4d4f02(0x1bb)]+'\x20|');}if(_0x46bfe7['length']===0x0)return _0x40ffe9[_0x4d4f02(0x1ad)](_0x294faf,_0x4d4f02(0x1c4));const _0x48b3b5=_0x46bfe7['join']('\x0a');return _0x40ffe9[_0x4d4f02(0x1ad)](_0x294faf,_0x48b3b5+_0x4d4f02(0x1ae));}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x36c524,_0x29099d){const _0x2da573=a69_0x23b4,_0x29cc39=_0x36c524();while(!![]){try{const _0x45a589=parseInt(_0x2da573(0x1b5))/0x1*(-parseInt(_0x2da573(0x1bd))/0x2)+parseInt(_0x2da573(0x1b8))/0x3*(-parseInt(_0x2da573(0x1b6))/0x4)+-parseInt(_0x2da573(0x1c7))/0x5+-parseInt(_0x2da573(0x1c2))/0x6+parseInt(_0x2da573(0x1c4))/0x7+-parseInt(_0x2da573(0x1b4))/0x8*(-parseInt(_0x2da573(0x1c0))/0x9)+parseInt(_0x2da573(0x1bb))/0xa;if(_0x45a589===_0x29099d)break;else _0x29cc39['push'](_0x29cc39['shift']());}catch(_0x594e67){_0x29cc39['push'](_0x29cc39['shift']());}}}(a69_0x26e1,0x65950));function a69_0x23b4(_0x248744,_0xdb16c9){_0x248744=_0x248744-0x1b4;const _0x26e1d8=a69_0x26e1();let _0x23b458=_0x26e1d8[_0x248744];return _0x23b458;}import{jsxs as a69_0x2c076a,jsx as a69_0x4d8f9a}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';export function IDESelector({ideList:_0x46cdd4,title:_0x1f7b5d,selection:_0x405974}){const _0x10b6d0=a69_0x23b4,{t:_0x4f15a9}=useI18n(),{selectedIndexes:_0x47f703,highlightIndex:_0xdec414,errorMsg:_0x2579ac}=_0x405974;return a69_0x2c076a(Box,{'flexDirection':_0x10b6d0(0x1bf),'marginTop':0x1,'children':[a69_0x4d8f9a(Box,{'children':a69_0x2c076a(Text,{'color':_0x10b6d0(0x1bc),'children':['*\x20',_0x1f7b5d]})}),_0x2579ac&&a69_0x4d8f9a(Box,{'marginTop':0x1,'children':a69_0x2c076a(Text,{'color':'red','children':['✗\x20',_0x2579ac]})}),a69_0x2c076a(Box,{'marginTop':0x1,'flexDirection':_0x10b6d0(0x1bf),'children':[a69_0x2c076a(Text,{'bold':!![],'children':['*\x20',_0x4f15a9(_0x10b6d0(0x1c3))]}),_0x46cdd4[_0x10b6d0(0x1c5)]((_0x2a11bc,_0x498979)=>{const _0x2ff1e0=_0x10b6d0,_0x2b7078=_0xdec414===_0x498979,_0x5705f9=_0x47f703[_0x2ff1e0(0x1c1)](_0x498979);return a69_0x4d8f9a(Box,{'children':a69_0x2c076a(Text,{'backgroundColor':_0x2b7078?'blue':undefined,'color':_0x2b7078?_0x2ff1e0(0x1ba):undefined,'children':['\x20\x20',_0x5705f9?_0x2ff1e0(0x1b7):_0x2ff1e0(0x1c8),'\x20',_0x2a11bc[_0x2ff1e0(0x1b9)],'\x20',a69_0x2c076a(Text,{'color':_0x2b7078?_0x2ff1e0(0x1ba):_0x2ff1e0(0x1c9),'dimColor':!_0x2b7078,'children':['-\x20',_0x2a11bc['description']]})]})},_0x2a11bc[_0x2ff1e0(0x1be)]);}),a69_0x4d8f9a(Box,{'marginTop':0x1,'children':a69_0x2c076a(Text,{'color':'gray','children':['\x20',_0x4f15a9(_0x10b6d0(0x1c6))]})})]})]});}export{useIDESelection}from'./useIDESelection.js';function a69_0x26e1(){const _0x553bbd=['white','6945590iKGiVd','cyan','302990ecHEyj','key','column','9lyMfhn','has','475932AYNTll','ui.ideSelector.title','1156414TTFPkG','map','ui.ideSelector.hotkeys','1046815GAfBCe','[\x20]','gray','4208848wwAazw','1AqKlOp','4zxqQnD','[✓]','1588821bLBsbQ','name'];a69_0x26e1=function(){return _0x553bbd;};return a69_0x26e1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51d6f9,_0x7a88a1){const _0x15b07f=a70_0xf209,_0x3fda35=_0x51d6f9();while(!![]){try{const _0x4c51a4=parseInt(_0x15b07f(0x1d6))/0x1+parseInt(_0x15b07f(0x1d1))/0x2*(parseInt(_0x15b07f(0x1d9))/0x3)+-parseInt(_0x15b07f(0x1ce))/0x4+parseInt(_0x15b07f(0x1ca))/0x5+-parseInt(_0x15b07f(0x1cf))/0x6+parseInt(_0x15b07f(0x1d4))/0x7+-parseInt(_0x15b07f(0x1d8))/0x8;if(_0x4c51a4===_0x7a88a1)break;else _0x3fda35['push'](_0x3fda35['shift']());}catch(_0x55e198){_0x3fda35['push'](_0x3fda35['shift']());}}}(a70_0x476d,0x81196));import{useState,useCallback}from'react';function a70_0x476d(){const _0x20d3f0=['from','map','68724VsoTep','3559800PeJHse','length','1131938zouPsu','has','upArrow','904687onNpVv','key','730655eihjqH','findIndex','2762960ostYjg','3SnYeyE','filter','delete','293880vumUsW','add'];a70_0x476d=function(){return _0x20d3f0;};return a70_0x476d();}function a70_0xf209(_0x2c6a62,_0x694b27){_0x2c6a62=_0x2c6a62-0x1ca;const _0x476db5=a70_0x476d();let _0xf2090e=_0x476db5[_0x2c6a62];return _0xf2090e;}export function useIDESelection({ideList:_0x26c8d7,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x18a4e0=a70_0xf209,[_0x4cb1ce,_0x1db266]=useState(new Set(preselectedIDEs['map'](_0x409b96=>_0x26c8d7[_0x18a4e0(0x1d7)](_0x1b2de0=>_0x1b2de0['key']===_0x409b96))[_0x18a4e0(0x1da)](_0x34dd13=>_0x34dd13>=0x0))),[_0x27e6db,_0x2bf967]=useState(0x0),[_0x50eac0,_0x3d70cf]=useState(''),_0x45a37d=useCallback(()=>{const _0x50d205=_0x18a4e0;_0x2bf967(_0x30073d=>_0x30073d>0x0?_0x30073d-0x1:_0x26c8d7[_0x50d205(0x1d0)]-0x1);},[_0x26c8d7[_0x18a4e0(0x1d0)]]),_0x1fc321=useCallback(()=>{const _0x1fe636=_0x18a4e0;_0x2bf967(_0x4b7ada=>_0x4b7ada<_0x26c8d7[_0x1fe636(0x1d0)]-0x1?_0x4b7ada+0x1:0x0);},[_0x26c8d7[_0x18a4e0(0x1d0)]]),_0x4cb598=useCallback(()=>{if(!multiSelect){_0x1db266(new Set([_0x27e6db]));return;}_0x1db266(_0x4cb09e=>{const _0x54ea27=a70_0xf209,_0xa18fd9=new Set(_0x4cb09e);return _0xa18fd9[_0x54ea27(0x1d2)](_0x27e6db)?_0xa18fd9[_0x54ea27(0x1db)](_0x27e6db):_0xa18fd9[_0x54ea27(0x1cb)](_0x27e6db),_0xa18fd9;});},[_0x27e6db,multiSelect]),_0x550708=useCallback(()=>{const _0x29759e=_0x18a4e0;_0x1db266(new Set(_0x26c8d7[_0x29759e(0x1cd)]((_0x531eb4,_0x1df408)=>_0x1df408)));},[_0x26c8d7]),_0x559d7b=useCallback(()=>{_0x1db266(_0x351000=>{const _0x4b4872=a70_0xf209,_0x1ed262=new Set();for(let _0x21a270=0x0;_0x21a270<_0x26c8d7[_0x4b4872(0x1d0)];_0x21a270++){!_0x351000[_0x4b4872(0x1d2)](_0x21a270)&&_0x1ed262['add'](_0x21a270);}return _0x1ed262;});},[_0x26c8d7]),_0x513cc8=useCallback(()=>{const _0x4d85ea=_0x18a4e0;return Array[_0x4d85ea(0x1cc)](_0x4cb1ce)[_0x4d85ea(0x1cd)](_0x551028=>_0x26c8d7[_0x551028]?.[_0x4d85ea(0x1d5)])[_0x4d85ea(0x1da)](_0x23cc2b=>_0x23cc2b!==undefined);},[_0x4cb1ce,_0x26c8d7]),_0x2841ce=useCallback(()=>{const _0x244045=_0x18a4e0;return _0x4cb1ce['size']===_0x26c8d7[_0x244045(0x1d0)];},[_0x4cb1ce,_0x26c8d7]),_0x4159d9=useCallback((_0x4dfffc,_0x4ab97c)=>{const _0x513446=_0x18a4e0;if(_0x4ab97c[_0x513446(0x1d3)])return _0x45a37d(),!![];if(_0x4ab97c['downArrow'])return _0x1fc321(),!![];if(_0x4dfffc==='\x20')return _0x4cb598(),!![];if(_0x4dfffc==='a'||_0x4dfffc==='A')return _0x550708(),!![];if(_0x4dfffc==='i'||_0x4dfffc==='I'||_0x4dfffc==='r'||_0x4dfffc==='R')return _0x559d7b(),!![];return![];},[_0x45a37d,_0x1fc321,_0x4cb598,_0x550708,_0x559d7b]);return{'selectedIndexes':_0x4cb1ce,'highlightIndex':_0x27e6db,'errorMsg':_0x50eac0,'setErrorMsg':_0x3d70cf,'handleKeyDown':_0x4159d9,'getSelectedIDEs':_0x513cc8,'isAllSelected':_0x2841ce,'toggleSelection':_0x4cb598,'selectAll':_0x550708,'invertSelection':_0x559d7b,'moveHighlightUp':_0x45a37d,'moveHighlightDown':_0x1fc321};}
|