@lovrabet/cli 1.2.5-beta.4 → 1.2.5-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- 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.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.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/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/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/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a57_0x3f831d=a57_0x8cfa;(function(_0xc855c6,_0x105b1d){const _0x213dfd=a57_0x8cfa,_0x545079=_0xc855c6();while(!![]){try{const _0x556dfb=parseInt(_0x213dfd(0x188))/0x1*(-parseInt(_0x213dfd(0x151))/0x2)+-parseInt(_0x213dfd(0x177))/0x3+parseInt(_0x213dfd(0x183))/0x4*(parseInt(_0x213dfd(0x17b))/0x5)+-parseInt(_0x213dfd(0x169))/0x6*(parseInt(_0x213dfd(0x181))/0x7)+-parseInt(_0x213dfd(0x19d))/0x8+-parseInt(_0x213dfd(0x178))/0x9*(parseInt(_0x213dfd(0x150))/0xa)+parseInt(_0x213dfd(0x19c))/0xb;if(_0x556dfb===_0x105b1d)break;else _0x545079['push'](_0x545079['shift']());}catch(_0x51f597){_0x545079['push'](_0x545079['shift']());}}}(a57_0x47ee,0xec09c));function a57_0x8cfa(_0x362238,_0x303dc0){_0x362238=_0x362238-0x147;const _0x47ee3b=a57_0x47ee();let _0x8cfade=_0x47ee3b[_0x362238];return _0x8cfade;}import{jsx as a57_0x203c53,jsxs as a57_0x1937e0,Fragment as a57_0x27a5db}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';function a57_0x47ee(){const _0xe8d753=['../../templates/skills','value','upArrow','agent','.lovrabet','codebuddy','opencode','1022142rtuSuy','9146484mSqWal','[\x20]','\x20\x20✓\x20','4735345FJYBiR','OpenCode','name','info','\x20失败:\x20','.codebuddy','7RnoGlI','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认','4wfnpos','请至少选择一个\x20IDE','Trae','Windsurf\x20IDE\x20(.windsurf/workflows/)','column','961yhQGXv','cursor','按任意键退出...','error','green','size','downArrow','from','antigravity','CodeBuddy','.agent','return','Claude\x20Code','gray','blue','cwd','.opencode','通用模板\x20(.agent/skills/)\x20-\x20兜底方案','.lovrabet/skill/.shared','installing','32035553afSPdv','2680816fdnRwn','has','Windsurf','\x20\x20✗\x20安装\x20','white','已安装\x20','delete','codex','Claude\x20Code\x20(.claude/skills/)','.lovrabet/skill-manifest.json','skill-install','.trae','10QgRDvg','1910mLWJQS','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','windsurf','\x20个目录','OpenCode\x20IDE\x20(.opencode/skills/)','2.0.0','map','Trae\x20IDE\x20(.trae/skills/)','CodeBuddy\x20IDE\x20(.codebuddy/skills/)','.windsurf','add','label','length','Cursor','开发者指南位置:\x20.lovrabet/skill/.shared/guides/','claude','.codex','正在安装技能包...','cyan','selecting','done','isDirectory','folders','toISOString','1696398rIFwoP','Codex\x20IDE\x20(.codex/skills/)','Codex','Antigravity\x20IDE\x20(.agent/skills/)','indexOf','.qoder','其他\x20(通用模板)'];a57_0x47ee=function(){return _0xe8d753;};return a57_0x47ee();}import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a57_0x3f831d(0x15e),'description':a57_0x3f831d(0x152),'folders':['.cursorrules','.cursor']},'windsurf':{'name':a57_0x3f831d(0x19f),'description':a57_0x3f831d(0x186),'folders':[a57_0x3f831d(0x15a)]},'claude':{'name':a57_0x3f831d(0x194),'description':a57_0x3f831d(0x14c),'folders':['.claude']},'codex':{'name':a57_0x3f831d(0x16b),'description':a57_0x3f831d(0x16a),'folders':[a57_0x3f831d(0x161)]},'opencode':{'name':a57_0x3f831d(0x17c),'description':a57_0x3f831d(0x155),'folders':[a57_0x3f831d(0x198)]},'qoder':{'name':'Qoder','description':'Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','folders':[a57_0x3f831d(0x16e)]},'codebuddy':{'name':a57_0x3f831d(0x191),'description':a57_0x3f831d(0x159),'folders':[a57_0x3f831d(0x180)]},'trae':{'name':a57_0x3f831d(0x185),'description':a57_0x3f831d(0x158),'folders':[a57_0x3f831d(0x14f)]},'agent':{'name':a57_0x3f831d(0x16f),'description':a57_0x3f831d(0x199),'folders':[a57_0x3f831d(0x192)]},'antigravity':{'name':'Antigravity','description':a57_0x3f831d(0x16c),'folders':[a57_0x3f831d(0x192)]}},IDE_LIST=[a57_0x3f831d(0x190),a57_0x3f831d(0x160),a57_0x3f831d(0x175),a57_0x3f831d(0x14b),a57_0x3f831d(0x189),a57_0x3f831d(0x176),'qoder','trae',a57_0x3f831d(0x153),a57_0x3f831d(0x173)];export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0x43f7f6=a57_0x3f831d,{exit:_0x268608}=useApp(),[_0x1b71a7,_0x25af7c]=useState(_0x43f7f6(0x164)),[_0x2219d5,_0x4eb260]=useState(new Set(preselectedIDEs['map'](_0x399d12=>IDE_LIST[_0x43f7f6(0x16d)](_0x399d12))['filter'](_0x4ddb0e=>_0x4ddb0e>=0x0))),[_0x3bbaec,_0x3a2205]=useState(0x0),[_0x3fb6b5,_0x330649]=useState([]),[_0x31a5c6,_0x46e43e]=useState([]),[_0x3f1f10,_0x3f5d56]=useState(0x0),[_0xf60ed,_0x2239cd]=useState('');useEffect(()=>{const _0x88c34d=_0x43f7f6;preselectedIDEs[_0x88c34d(0x15d)]>0x0&&_0x2219d5[_0x88c34d(0x18d)]>0x0&&_0xdbb1b4();},[]),useInput((_0x24085c,_0x2acb32)=>{const _0x2372f1=_0x43f7f6;if(_0x1b71a7==='selecting'){if(_0x2acb32[_0x2372f1(0x172)]){_0x3a2205(_0x4a67be=>_0x4a67be>0x0?_0x4a67be-0x1:IDE_LIST[_0x2372f1(0x15d)]-0x1);return;}if(_0x2acb32[_0x2372f1(0x18e)]){_0x3a2205(_0x2e2a36=>_0x2e2a36<IDE_LIST['length']-0x1?_0x2e2a36+0x1:0x0);return;}if(_0x24085c==='\x20'){_0x4eb260(_0x392b53=>{const _0x38b8ad=_0x2372f1,_0x2d397b=new Set(_0x392b53);return _0x2d397b[_0x38b8ad(0x19e)](_0x3bbaec)?_0x2d397b[_0x38b8ad(0x14a)](_0x3bbaec):_0x2d397b[_0x38b8ad(0x15b)](_0x3bbaec),_0x2d397b;});return;}if(_0x24085c==='a'||_0x24085c==='A'){const _0x1c127d=new Set(IDE_LIST[_0x2372f1(0x157)]((_0x3cff6e,_0x23f4b1)=>_0x23f4b1));_0x4eb260(_0x1c127d);return;}if(_0x24085c==='i'||_0x24085c==='I'||_0x24085c==='r'||_0x24085c==='R'){_0x4eb260(_0x46bc67=>{const _0x5b2a64=_0x2372f1,_0x5598f2=new Set();for(let _0x47436b=0x0;_0x47436b<IDE_LIST['length'];_0x47436b++){!_0x46bc67[_0x5b2a64(0x19e)](_0x47436b)&&_0x5598f2['add'](_0x47436b);}return _0x5598f2;});return;}if(_0x24085c==='q'||_0x24085c==='Q'){_0x268608();return;}if(_0x2acb32[_0x2372f1(0x193)]){if(_0x2219d5['size']===0x0){_0x2239cd(_0x2372f1(0x184));return;}_0xdbb1b4();return;}}if(_0x1b71a7==='done'){_0x268608();return;}});async function _0xdbb1b4(){const _0x39817a=_0x43f7f6,_0x3cf7e8=Array[_0x39817a(0x18f)](_0x2219d5)[_0x39817a(0x157)](_0x2bfc76=>IDE_LIST[_0x2bfc76])['filter'](_0xf5872=>_0xf5872!==undefined);_0x46e43e(_0x3cf7e8),_0x330649([{'label':'已选择\x20IDE','value':_0x2219d5[_0x39817a(0x18d)]+'\x20个'}]),_0x25af7c('installing'),await _0x53beae(_0x3cf7e8);}async function _0x53beae(_0x378ae4){const _0x2672cd=_0x43f7f6,_0x245a71=process[_0x2672cd(0x197)](),_0x1b13c4=resolve(__dirname,_0x2672cd(0x170));logger['setLogPath'](_0x245a71);const _0xfc8a94=join(_0x1b13c4,'.shared'),_0x2f254a=join(_0x245a71,_0x2672cd(0x19a));existsSync(_0xfc8a94)&&await copyDir(_0xfc8a94,_0x2f254a);let _0x455d42=0x1;for(const _0x59c264 of _0x378ae4){try{const _0x5a6f00=await installSingleIDE(_0x59c264,_0x245a71,_0x1b13c4);_0x455d42+=_0x5a6f00,_0x3f5d56(_0x455d42);}catch(_0x4dbb6e){console[_0x2672cd(0x18b)](_0x2672cd(0x147)+_0x59c264+_0x2672cd(0x17f)+(_0x4dbb6e instanceof Error?_0x4dbb6e['message']:String(_0x4dbb6e)));}}const _0x4840d4={'version':_0x2672cd(0x156),'installedAt':new Date()[_0x2672cd(0x168)](),'platforms':_0x378ae4},_0x39a4ca=join(_0x245a71,_0x2672cd(0x14d));!existsSync(join(_0x245a71,_0x2672cd(0x174)))&&mkdirSync(join(_0x245a71,'.lovrabet'),{'recursive':!![]}),writeFileSync(_0x39a4ca,JSON['stringify'](_0x4840d4,null,0x2),'utf-8'),logger[_0x2672cd(0x17e)](_0x2672cd(0x14e),'安装成功',{'projectRoot':_0x245a71,'ides':_0x378ae4,'foldersCount':_0x455d42}),_0x25af7c('done'),setTimeout(()=>{_0x268608();},0x3e8);}return a57_0x1937e0(Box,{'flexDirection':_0x43f7f6(0x187),'marginTop':0x1,'children':[_0x1b71a7==='selecting'&&a57_0x1937e0(a57_0x27a5db,{'children':[a57_0x203c53(Box,{'children':a57_0x203c53(Text,{'color':_0x43f7f6(0x163),'children':'*\x20安装\x20Lovrabet\x20技能包\x20-\x20选择\x20IDE'})}),_0xf60ed&&a57_0x203c53(Box,{'marginTop':0x1,'children':a57_0x1937e0(Text,{'color':'red','children':['✗\x20',_0xf60ed]})}),a57_0x1937e0(Box,{'marginTop':0x1,'flexDirection':'column','children':[a57_0x203c53(Text,{'bold':!![],'children':'*\x20请选择要安装的\x20IDE:'}),IDE_LIST['map']((_0xa3a5e3,_0x3286ce)=>{const _0x31e2c4=_0x43f7f6,_0x230ce3=_0x3bbaec===_0x3286ce,_0x5554fe=_0x2219d5['has'](_0x3286ce);return a57_0x203c53(Box,{'children':a57_0x1937e0(Text,{'backgroundColor':_0x230ce3?_0x31e2c4(0x196):undefined,'color':_0x230ce3?_0x31e2c4(0x148):undefined,'children':['\x20\x20',_0x5554fe?'[✓]':_0x31e2c4(0x179),'\x20',IDE_CONFIGS[_0xa3a5e3][_0x31e2c4(0x17d)],'\x20',a57_0x1937e0(Text,{'color':_0x230ce3?_0x31e2c4(0x148):_0x31e2c4(0x195),'dimColor':!_0x230ce3,'children':['-\x20',IDE_CONFIGS[_0xa3a5e3]['description']]})]})},_0xa3a5e3);}),a57_0x203c53(Box,{'marginTop':0x1,'children':a57_0x1937e0(Text,{'color':_0x43f7f6(0x195),'children':['\x20',_0x43f7f6(0x182)]})})]})]}),_0x1b71a7===_0x43f7f6(0x19b)&&a57_0x1937e0(a57_0x27a5db,{'children':[_0x3fb6b5['map']((_0x2d6ffe,_0x5bdae9)=>a57_0x1937e0(Box,{'children':[a57_0x1937e0(Text,{'color':'green','children':['√\x20',_0x2d6ffe[_0x43f7f6(0x15c)],':\x20']}),a57_0x203c53(Text,{'color':'cyan','children':_0x2d6ffe[_0x43f7f6(0x171)]})]},_0x5bdae9)),a57_0x203c53(Box,{'marginTop':0x1,'children':a57_0x203c53(Text,{'children':_0x43f7f6(0x162)})}),_0x31a5c6[_0x43f7f6(0x157)](_0x263dad=>a57_0x1937e0(Box,{'children':[a57_0x203c53(Text,{'color':_0x43f7f6(0x18c),'children':_0x43f7f6(0x17a)}),a57_0x203c53(Text,{'children':IDE_CONFIGS[_0x263dad]?.[_0x43f7f6(0x17d)]||_0x263dad})]},_0x263dad)),a57_0x203c53(Box,{'marginTop':0x1,'children':a57_0x1937e0(Text,{'color':'gray','children':[_0x43f7f6(0x149),_0x3f1f10,'\x20个目录']})})]}),_0x1b71a7===_0x43f7f6(0x165)&&a57_0x1937e0(a57_0x27a5db,{'children':[a57_0x203c53(Box,{'children':a57_0x1937e0(Text,{'color':_0x43f7f6(0x18c),'children':['✓\x20技能包安装成功!共安装\x20',_0x3f1f10,_0x43f7f6(0x154)]})}),a57_0x203c53(Box,{'marginTop':0x1,'children':a57_0x203c53(Text,{'color':_0x43f7f6(0x195),'children':_0x43f7f6(0x15f)})}),a57_0x203c53(Box,{'marginTop':0x1,'children':a57_0x203c53(Text,{'color':_0x43f7f6(0x195),'children':_0x43f7f6(0x18a)})})]})]});}async function copyDir(_0x5228d0,_0x1caeee){const _0x102080=a57_0x3f831d,_0x455d19=statSync(_0x5228d0);if(_0x455d19[_0x102080(0x166)]()){!existsSync(_0x1caeee)&&mkdirSync(_0x1caeee,{'recursive':!![]});const _0x21b92a=readdirSync(_0x5228d0);for(const _0x299556 of _0x21b92a){await copyDir(join(_0x5228d0,_0x299556),join(_0x1caeee,_0x299556));}}else copyFileSync(_0x5228d0,_0x1caeee);}async function installSingleIDE(_0x2378b3,_0x5cbe7e,_0x1a9dd7){const _0x7030e6=a57_0x3f831d,_0x4285b4=_0x2378b3!=='agent'&&IDE_CONFIGS[_0x2378b3]!==undefined,_0x1fb675=_0x2378b3===_0x7030e6(0x173)||!_0x4285b4,_0x3339fb=_0x1fb675?[_0x7030e6(0x192)]:_0x4285b4?IDE_CONFIGS[_0x2378b3][_0x7030e6(0x167)]:[_0x7030e6(0x192)];let _0x2f314d=0x0;for(const _0x2756b9 of _0x3339fb){const _0x5e6bcf=join(_0x1a9dd7,_0x2756b9),_0x4368e3=join(_0x5cbe7e,_0x2756b9);if(!existsSync(_0x5e6bcf))continue;await copyDir(_0x5e6bcf,_0x4368e3),_0x2f314d++;}return _0x2f314d;}
|
|
1
|
+
const a57_0x2c9d14=a57_0x2f3b;(function(_0x5b641f,_0x41ec9b){const _0x31c9b3=a57_0x2f3b,_0x3f8a3c=_0x5b641f();while(!![]){try{const _0x186c86=-parseInt(_0x31c9b3(0x1d4))/0x1*(parseInt(_0x31c9b3(0x1db))/0x2)+-parseInt(_0x31c9b3(0x1e4))/0x3+parseInt(_0x31c9b3(0x197))/0x4*(parseInt(_0x31c9b3(0x1d2))/0x5)+-parseInt(_0x31c9b3(0x1c6))/0x6+-parseInt(_0x31c9b3(0x1ab))/0x7+parseInt(_0x31c9b3(0x1a5))/0x8*(parseInt(_0x31c9b3(0x19c))/0x9)+parseInt(_0x31c9b3(0x1dd))/0xa;if(_0x186c86===_0x41ec9b)break;else _0x3f8a3c['push'](_0x3f8a3c['shift']());}catch(_0x509b83){_0x3f8a3c['push'](_0x3f8a3c['shift']());}}}(a57_0x14cd,0x1ea51));import{jsx as a57_0x1006e4,jsxs as a57_0x48c961,Fragment as a57_0x15dedf}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput,useApp}from'ink';import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':'Cursor','description':a57_0x2c9d14(0x1d8),'folders':[a57_0x2c9d14(0x1a3),a57_0x2c9d14(0x1c7)]},'windsurf':{'name':a57_0x2c9d14(0x19e),'description':a57_0x2c9d14(0x19b),'folders':['.windsurf']},'claude':{'name':a57_0x2c9d14(0x1a7),'description':a57_0x2c9d14(0x1df),'folders':['.claude']},'codex':{'name':a57_0x2c9d14(0x1ce),'description':'Codex\x20IDE\x20(.codex/skills/)','folders':['.codex']},'opencode':{'name':'OpenCode','description':a57_0x2c9d14(0x1da),'folders':['.opencode']},'qoder':{'name':'Qoder','description':a57_0x2c9d14(0x1be),'folders':[a57_0x2c9d14(0x1b0)]},'codebuddy':{'name':a57_0x2c9d14(0x1d5),'description':a57_0x2c9d14(0x19f),'folders':[a57_0x2c9d14(0x1bb)]},'trae':{'name':'Trae','description':a57_0x2c9d14(0x1bc),'folders':[a57_0x2c9d14(0x1a6)]},'agent':{'name':a57_0x2c9d14(0x1a1),'description':a57_0x2c9d14(0x1bd),'folders':[a57_0x2c9d14(0x19d)]},'antigravity':{'name':'Antigravity','description':a57_0x2c9d14(0x1ca),'folders':[a57_0x2c9d14(0x19d)]}},IDE_LIST=[a57_0x2c9d14(0x1e1),a57_0x2c9d14(0x1b2),'codebuddy',a57_0x2c9d14(0x191),'cursor',a57_0x2c9d14(0x1ae),a57_0x2c9d14(0x198),a57_0x2c9d14(0x1d0),a57_0x2c9d14(0x1d3),a57_0x2c9d14(0x193)];export function SkillInstallUI({preselectedIDEs:preselectedIDEs=[]}){const _0xb5176b=a57_0x2c9d14,{exit:_0x54cffa}=useApp(),[_0x3108b6,_0x3b211e]=useState(_0xb5176b(0x1de)),[_0x12e1ea,_0x27363e]=useState(new Set(preselectedIDEs[_0xb5176b(0x1b4)](_0x47cce6=>IDE_LIST['indexOf'](_0x47cce6))[_0xb5176b(0x1b6)](_0xac678a=>_0xac678a>=0x0))),[_0x51848b,_0x1c7e12]=useState(0x0),[_0x1b4d17,_0x1b86e2]=useState([]),[_0x27eed8,_0x613cda]=useState([]),[_0x3514fe,_0x1b5d00]=useState(0x0),[_0x49bb28,_0x24e37d]=useState('');useEffect(()=>{const _0x7dc20d=_0xb5176b;preselectedIDEs[_0x7dc20d(0x1b1)]>0x0&&_0x12e1ea['size']>0x0&&_0x2fa4be();},[]),useInput((_0x5d2650,_0x29c3c0)=>{const _0x5e5c8e=_0xb5176b;if(_0x3108b6===_0x5e5c8e(0x1de)){if(_0x29c3c0[_0x5e5c8e(0x194)]){_0x1c7e12(_0x241146=>_0x241146>0x0?_0x241146-0x1:IDE_LIST[_0x5e5c8e(0x1b1)]-0x1);return;}if(_0x29c3c0['downArrow']){_0x1c7e12(_0x4c4bfb=>_0x4c4bfb<IDE_LIST['length']-0x1?_0x4c4bfb+0x1:0x0);return;}if(_0x5d2650==='\x20'){_0x27363e(_0x205507=>{const _0x1f7e34=_0x5e5c8e,_0x29c865=new Set(_0x205507);return _0x29c865[_0x1f7e34(0x1b8)](_0x51848b)?_0x29c865[_0x1f7e34(0x1dc)](_0x51848b):_0x29c865[_0x1f7e34(0x1cd)](_0x51848b),_0x29c865;});return;}if(_0x5d2650==='a'||_0x5d2650==='A'){const _0x55701c=new Set(IDE_LIST[_0x5e5c8e(0x1b4)]((_0xd40a52,_0x260629)=>_0x260629));_0x27363e(_0x55701c);return;}if(_0x5d2650==='i'||_0x5d2650==='I'||_0x5d2650==='r'||_0x5d2650==='R'){_0x27363e(_0x4c49d3=>{const _0x5f14db=_0x5e5c8e,_0x1f390e=new Set();for(let _0x5280a9=0x0;_0x5280a9<IDE_LIST[_0x5f14db(0x1b1)];_0x5280a9++){!_0x4c49d3[_0x5f14db(0x1b8)](_0x5280a9)&&_0x1f390e[_0x5f14db(0x1cd)](_0x5280a9);}return _0x1f390e;});return;}if(_0x5d2650==='q'||_0x5d2650==='Q'){_0x54cffa();return;}if(_0x29c3c0[_0x5e5c8e(0x1b7)]){if(_0x12e1ea[_0x5e5c8e(0x1a0)]===0x0){_0x24e37d(_0x5e5c8e(0x1d9));return;}_0x2fa4be();return;}}if(_0x3108b6===_0x5e5c8e(0x196)){_0x54cffa();return;}});async function _0x2fa4be(){const _0x1322c0=_0xb5176b,_0x1faab9=Array[_0x1322c0(0x1c3)](_0x12e1ea)[_0x1322c0(0x1b4)](_0x260cdf=>IDE_LIST[_0x260cdf])[_0x1322c0(0x1b6)](_0x33d2ba=>_0x33d2ba!==undefined);_0x613cda(_0x1faab9),_0x1b86e2([{'label':'已选择\x20IDE','value':_0x12e1ea[_0x1322c0(0x1a0)]+'\x20个'}]),_0x3b211e(_0x1322c0(0x1c8)),await _0x1aa159(_0x1faab9);}async function _0x1aa159(_0x319c0c){const _0x39b9f5=_0xb5176b,_0x3d7097=process[_0x39b9f5(0x1e0)](),_0x1ae83a=resolve(__dirname,_0x39b9f5(0x1a2));logger['setLogPath'](_0x3d7097);const _0x5009a2=join(_0x1ae83a,'.shared'),_0x6b1bb2=join(_0x3d7097,'.lovrabet/skill/.shared');existsSync(_0x5009a2)&&await copyDir(_0x5009a2,_0x6b1bb2);let _0x17b524=0x1;for(const _0x342240 of _0x319c0c){try{const _0x36e504=await installSingleIDE(_0x342240,_0x3d7097,_0x1ae83a);_0x17b524+=_0x36e504,_0x1b5d00(_0x17b524);}catch(_0xc8a19e){console['error'](_0x39b9f5(0x19a)+_0x342240+_0x39b9f5(0x1bf)+(_0xc8a19e instanceof Error?_0xc8a19e[_0x39b9f5(0x1b9)]:String(_0xc8a19e)));}}const _0xa3e72f={'version':_0x39b9f5(0x1aa),'installedAt':new Date()[_0x39b9f5(0x1b3)](),'platforms':_0x319c0c},_0x257a53=join(_0x3d7097,_0x39b9f5(0x1ba));!existsSync(join(_0x3d7097,'.lovrabet'))&&mkdirSync(join(_0x3d7097,_0x39b9f5(0x192)),{'recursive':!![]}),writeFileSync(_0x257a53,JSON[_0x39b9f5(0x195)](_0xa3e72f,null,0x2),_0x39b9f5(0x1b5)),logger['info'](_0x39b9f5(0x1af),_0x39b9f5(0x1c0),{'projectRoot':_0x3d7097,'ides':_0x319c0c,'foldersCount':_0x17b524}),_0x3b211e(_0x39b9f5(0x196)),setTimeout(()=>{_0x54cffa();},0x3e8);}return a57_0x48c961(Box,{'flexDirection':_0xb5176b(0x1e5),'marginTop':0x1,'children':[_0x3108b6===_0xb5176b(0x1de)&&a57_0x48c961(a57_0x15dedf,{'children':[a57_0x1006e4(Box,{'children':a57_0x1006e4(Text,{'color':_0xb5176b(0x1cc),'children':_0xb5176b(0x1a8)})}),_0x49bb28&&a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x48c961(Text,{'color':_0xb5176b(0x1e3),'children':['✗\x20',_0x49bb28]})}),a57_0x48c961(Box,{'marginTop':0x1,'flexDirection':_0xb5176b(0x1e5),'children':[a57_0x1006e4(Text,{'bold':!![],'children':_0xb5176b(0x1a9)}),IDE_LIST[_0xb5176b(0x1b4)]((_0x5b511f,_0xf71ae9)=>{const _0x36929d=_0xb5176b,_0x4009da=_0x51848b===_0xf71ae9,_0x13baef=_0x12e1ea[_0x36929d(0x1b8)](_0xf71ae9);return a57_0x1006e4(Box,{'children':a57_0x48c961(Text,{'backgroundColor':_0x4009da?_0x36929d(0x1d1):undefined,'color':_0x4009da?_0x36929d(0x1ac):undefined,'children':['\x20\x20',_0x13baef?'[✓]':_0x36929d(0x1e2),'\x20',IDE_CONFIGS[_0x5b511f]['name'],'\x20',a57_0x48c961(Text,{'color':_0x4009da?'white':_0x36929d(0x1c4),'dimColor':!_0x4009da,'children':['-\x20',IDE_CONFIGS[_0x5b511f][_0x36929d(0x1cf)]]})]})},_0x5b511f);}),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x48c961(Text,{'color':_0xb5176b(0x1c4),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认']})})]})]}),_0x3108b6==='installing'&&a57_0x48c961(a57_0x15dedf,{'children':[_0x1b4d17[_0xb5176b(0x1b4)]((_0x3d3221,_0x5c57d7)=>a57_0x48c961(Box,{'children':[a57_0x48c961(Text,{'color':_0xb5176b(0x199),'children':['√\x20',_0x3d3221[_0xb5176b(0x1ad)],':\x20']}),a57_0x1006e4(Text,{'color':'cyan','children':_0x3d3221[_0xb5176b(0x1c5)]})]},_0x5c57d7)),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x1006e4(Text,{'children':_0xb5176b(0x1d6)})}),_0x27eed8[_0xb5176b(0x1b4)](_0x59018a=>a57_0x48c961(Box,{'children':[a57_0x1006e4(Text,{'color':_0xb5176b(0x199),'children':_0xb5176b(0x1c9)}),a57_0x1006e4(Text,{'children':IDE_CONFIGS[_0x59018a]?.['name']||_0x59018a})]},_0x59018a)),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x48c961(Text,{'color':_0xb5176b(0x1c4),'children':[_0xb5176b(0x1c1),_0x3514fe,'\x20个目录']})})]}),_0x3108b6===_0xb5176b(0x196)&&a57_0x48c961(a57_0x15dedf,{'children':[a57_0x1006e4(Box,{'children':a57_0x48c961(Text,{'color':_0xb5176b(0x199),'children':[_0xb5176b(0x1d7),_0x3514fe,'\x20个目录']})}),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x1006e4(Text,{'color':_0xb5176b(0x1c4),'children':_0xb5176b(0x1a4)})}),a57_0x1006e4(Box,{'marginTop':0x1,'children':a57_0x1006e4(Text,{'color':_0xb5176b(0x1c4),'children':_0xb5176b(0x1c2)})})]})]});}function a57_0x14cd(){const _0x5eee0a=['Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','\x20失败:\x20','安装成功','已安装\x20','按任意键退出...','from','gray','value','283302vTqZkc','.cursor','installing','\x20\x20✓\x20','Antigravity\x20IDE\x20(.agent/skills/)','folders','cyan','add','Codex','description','trae','blue','576395PGBYcy','windsurf','53mEgwvq','CodeBuddy','正在安装技能包...','✓\x20技能包安装成功!共安装\x20','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','请至少选择一个\x20IDE','OpenCode\x20IDE\x20(.opencode/skills/)','2678wBOeMB','delete','3047690FwheMC','selecting','Claude\x20Code\x20(.claude/skills/)','cwd','antigravity','[\x20]','red','391938IFqgen','column','codex','.lovrabet','agent','upArrow','stringify','done','4RDRNUg','qoder','green','\x20\x20✗\x20安装\x20','Windsurf\x20IDE\x20(.windsurf/workflows/)','9uAbltJ','.agent','Windsurf','CodeBuddy\x20IDE\x20(.codebuddy/skills/)','size','其他\x20(通用模板)','../../templates/skills','.cursorrules','开发者指南位置:\x20.lovrabet/skill/.shared/guides/','878792GcyICA','.trae','Claude\x20Code','*\x20安装\x20Lovrabet\x20技能包\x20-\x20选择\x20IDE','*\x20请选择要安装的\x20IDE:','2.0.0','1088822bRQXPF','white','label','opencode','skill-install','.qoder','length','claude','toISOString','map','utf-8','filter','return','has','message','.lovrabet/skill-manifest.json','.codebuddy','Trae\x20IDE\x20(.trae/skills/)','通用模板\x20(.agent/skills/)\x20-\x20兜底方案'];a57_0x14cd=function(){return _0x5eee0a;};return a57_0x14cd();}function a57_0x2f3b(_0x12830e,_0xc18938){_0x12830e=_0x12830e-0x191;const _0x14cdc1=a57_0x14cd();let _0x2f3bb8=_0x14cdc1[_0x12830e];return _0x2f3bb8;}async function copyDir(_0x391205,_0x530ee9){const _0x26848c=statSync(_0x391205);if(_0x26848c['isDirectory']()){!existsSync(_0x530ee9)&&mkdirSync(_0x530ee9,{'recursive':!![]});const _0x291a1b=readdirSync(_0x391205);for(const _0x28b647 of _0x291a1b){await copyDir(join(_0x391205,_0x28b647),join(_0x530ee9,_0x28b647));}}else copyFileSync(_0x391205,_0x530ee9);}async function installSingleIDE(_0xbcc5ff,_0xfbd06c,_0x350ccd){const _0x476140=a57_0x2c9d14,_0x19b60c=_0xbcc5ff!==_0x476140(0x193)&&IDE_CONFIGS[_0xbcc5ff]!==undefined,_0x551126=_0xbcc5ff==='agent'||!_0x19b60c,_0xe52e73=_0x551126?[_0x476140(0x19d)]:_0x19b60c?IDE_CONFIGS[_0xbcc5ff][_0x476140(0x1cb)]:[_0x476140(0x19d)];let _0x49603c=0x0;for(const _0xfb81cb of _0xe52e73){const _0x1ed58e=join(_0x350ccd,_0xfb81cb),_0x5e3c09=join(_0xfbd06c,_0xfb81cb);if(!existsSync(_0x1ed58e))continue;await copyDir(_0x1ed58e,_0x5e3c09),_0x49603c++;}return _0x49603c;}
|
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a58_0x2c6c58=a58_0x40cc;function a58_0x40cc(_0x8bf14a,_0x3b8fbd){_0x8bf14a=_0x8bf14a-0xa1;const _0xaebbd9=a58_0xaebb();let _0x40cc43=_0xaebbd9[_0x8bf14a];return _0x40cc43;}(function(_0x3f37ea,_0x2cd5fa){const _0x272808=a58_0x40cc,_0x5efbb3=_0x3f37ea();while(!![]){try{const _0x336b26=parseInt(_0x272808(0xb3))/0x1+parseInt(_0x272808(0x104))/0x2*(parseInt(_0x272808(0xed))/0x3)+-parseInt(_0x272808(0xdd))/0x4+-parseInt(_0x272808(0xff))/0x5*(parseInt(_0x272808(0xd7))/0x6)+parseInt(_0x272808(0xa5))/0x7+parseInt(_0x272808(0xb6))/0x8+-parseInt(_0x272808(0xc5))/0x9*(parseInt(_0x272808(0xd5))/0xa);if(_0x336b26===_0x2cd5fa)break;else _0x5efbb3['push'](_0x5efbb3['shift']());}catch(_0x1cad71){_0x5efbb3['push'](_0x5efbb3['shift']());}}}(a58_0xaebb,0xf0696));import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';function a58_0xaebb(){const _0x18439c=['.opencode','.agent','10754360wEmwtr','toISOString','.codex','\x0a未选择任何\x20IDE,安装取消\x0a','\x0a📦\x20正在安装\x20','codebuddy','stdout','filter','输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a','.windsurf','\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','skill-install','description','agent','使用示例:','63tFiVkg','isDirectory','setLogPath','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包','.cursor','通用模板','Qoder','\x20\x20q.\x20取消\x0a','close','question','(空)','\x0aLovrabet\x20Skill\x20-\x20开发者技能包安装工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互式选择并安装技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20直接安装指定\x20IDE\x20的技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20安装所有技能包\x0a\x0a安装方式:\x0a\x20\x20\x20交互式选择\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20显示\x20IDE\x20列表供选择,支持多选\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20使用\x20↑↓\x20移动光标,空格选中/取消,Enter\x20确认\x0a\x20\x20\x20\x20→\x20按\x20a\x20全选,按\x20i/r\x20反选,按\x20q\x20退出\x0a\x0a\x20\x20直接安装指定\x20IDE\x20(支持多个)\x20\x20\x20\x20\x20\x20\x20-\x20使用\x20--ide\x20标志直接安装\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装\x20Cursor\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20安装多个\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装全部\x0a\x0a支持的\x20IDE:\x0a\x20\x20--cursor\x20\x20\x20\x20\x20\x20\x20Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)\x0a\x20\x20--windsurf\x20\x20\x20\x20\x20Windsurf\x20IDE\x20(.windsurf/workflows/)\x0a\x20\x20--claude\x20\x20\x20\x20\x20\x20\x20Claude\x20Code\x20(.claude/skills/)\x0a\x20\x20--codex\x20\x20\x20\x20\x20\x20\x20\x20Codex\x20IDE\x20(.codex/skills/)\x0a\x20\x20--opencode\x20\x20\x20\x20\x20OpenCode\x20IDE\x20(.opencode/skills/)\x0a\x20\x20--qoder\x20\x20\x20\x20\x20\x20\x20\x20Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)\x0a\x20\x20--codebuddy\x20\x20\x20\x20CodeBuddy\x20IDE\x20(.codebuddy/skills/)\x0a\x20\x20--trae\x20\x20\x20\x20\x20\x20\x20\x20\x20Trae\x20IDE\x20(.trae/skills/)\x0a\x20\x20--agent\x20\x20\x20\x20\x20\x20\x20\x20其他\x20(通用模板)\x20(.agent/skills/)\x20-\x20兜底方案\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20安装所有\x20IDE\x20技能包(包括通用模板)\x0a\x0a技能包内容包括:\x0a\x20\x20-\x20Filter\x20查询构建规范\x20(10\x20种常见错误对照)\x0a\x20\x20-\x20MCP\x20SQL\x20创建工作流\x20(5\x20步强制流程)\x0a\x20\x20-\x20AntD\x20UI\x20开发规范\x20(禁止\x20AI\x20味道)\x0a\x20\x20-\x20API\x20集成指南\x20(lovrabet\x20api\x20pull\x20流程)\x0a\x20\x20-\x20菜单管理指南\x20(menu\x20sync/update\x20流程)\x0a\x20\x20-\x20Backend\x20Function\x20脚本编写规范\x20(权限过滤、数据脱敏、业务逻辑)\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20交互式选择\x20IDE\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a\x20\x20\x20\x20→\x20直接安装\x20Cursor\x20和\x20claude\x20code\x20技能包\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a\x20\x20\x20\x20→\x20安装所有\x20IDE\x20技能包\x0a\x0a安装后会在项目中创建:\x0a\x20\x20-\x20IDE\x20特定配置文件\x20(.cursorrules,\x20.windsurf/,\x20.claude/,\x20.codex/,\x20.opencode/,\x20.qoder/,\x20.codebuddy/,\x20.trae/)\x0a\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20\x20-\x20开发者技能指南\x0a\x0a开发者指南位置:\x0a\x20\x20.lovrabet/skill/.shared/guides/01-filter-query/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/02-mcp-sql-workflow/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/03-antd-style/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/05-api-integration/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/06-menu-management/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/07-backend-function/guide.md\x0a\x20\x20',',使用通用模板','.lovrabet/skill/.shared/','--help','help','2671630epNWmN','exit','6306AMpNoJ','install','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','Trae','\x20-\x20','.lovrabet/skill-manifest.json','6106412EGKvxw','includes','OpenCode\x20IDE\x20(.opencode/skills/)','cursor','quit','toLowerCase','Trae\x20IDE\x20(.trae/skills/)','log','claude\x20code\x20(.claude/skills/)','安装成功','\x0a✓\x20技能包安装成功!共安装\x20','name','OpenCode','all','\x20\x20✗\x20安装\x20','push','5173107WOQXqJ','folders','Windsurf\x20IDE\x20(.windsurf/workflows/)','cwd','错误:\x20不支持的命令:\x20','codex','\x0a错误:\x20安装失败\x20-\x20','\x20个目录\x0a','\x0a已取消安装\x0a','CodeBuddy\x20IDE\x20(.codebuddy/skills/)','stringify','opencode','输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)','...\x0a','utf-8','✓\x20创建\x20.lovrabet/skill-manifest.json','.lovrabet/skill/.shared','Codex\x20IDE\x20(.codex/skills/)','3085QXwoEz','请选择:\x20','windsurf','trim','\x20失败:\x20','2xZFENa','length','2.0.0','✓\x20复制\x20.lovrabet/skill/.shared/','.qoder','7148687LIJNRF','.claude','安装失败','skill','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','error','.cursorrules','.lovrabet','message','.shared','不支持的命令:\x20','claude','\x0a可用命令:','Cursor','940032LliGhH'];a58_0xaebb=function(){return _0x18439c;};return a58_0xaebb();}import{fileURLToPath}from'node:url';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a58_0x2c6c58(0xb2),'description':a58_0x2c6c58(0xd9),'folders':[a58_0x2c6c58(0xab),a58_0x2c6c58(0xc9)]},'windsurf':{'name':'Windsurf','description':a58_0x2c6c58(0xef),'folders':[a58_0x2c6c58(0xbf)]},'claude':{'name':'claude\x20code','description':a58_0x2c6c58(0xe5),'folders':[a58_0x2c6c58(0xa6)]},'codex':{'name':'Codex','description':a58_0x2c6c58(0xfe),'folders':[a58_0x2c6c58(0xb8)]},'opencode':{'name':a58_0x2c6c58(0xe9),'description':a58_0x2c6c58(0xdf),'folders':[a58_0x2c6c58(0xb4)]},'qoder':{'name':a58_0x2c6c58(0xcb),'description':'Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','folders':[a58_0x2c6c58(0xa4)]},'codebuddy':{'name':'CodeBuddy','description':a58_0x2c6c58(0xf6),'folders':['.codebuddy']},'trae':{'name':a58_0x2c6c58(0xda),'description':a58_0x2c6c58(0xe3),'folders':['.trae']}};export async function skillsCommand(_0x6c5d33,_0x24a157,_0x451bee){const _0x1aeac6=a58_0x2c6c58;logger[_0x1aeac6(0xc7)](process['cwd']());if(_0x451bee?.[_0x1aeac6(0xd4)]||_0x6c5d33===_0x1aeac6(0xd3)){showHelp();return;}_0x6c5d33!==_0x1aeac6(0xd8)&&(console[_0x1aeac6(0xaa)](_0x1aeac6(0xf1)+(_0x6c5d33||_0x1aeac6(0xcf))),console[_0x1aeac6(0xe4)](_0x1aeac6(0xb1)),console[_0x1aeac6(0xe4)]('\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包'),console[_0x1aeac6(0xe4)](_0x1aeac6(0xc8)),console['log'](_0x1aeac6(0xc0)),console[_0x1aeac6(0xe4)](_0x1aeac6(0xc4)),console[_0x1aeac6(0xe4)]('\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE'),console[_0x1aeac6(0xe4)]('\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a'),logger[_0x1aeac6(0xaa)](_0x1aeac6(0xa8),_0x1aeac6(0xaf)+_0x6c5d33),process[_0x1aeac6(0xd6)](0x1)),await installSkill(_0x24a157?.[0x0]);}async function selectIDEs(){const _0x4004c6=a58_0x2c6c58,_0x382e1b=['cursor',_0x4004c6(0x101),_0x4004c6(0xb0),_0x4004c6(0xf2),_0x4004c6(0xf8),'qoder',_0x4004c6(0xbb),'trae'];return console[_0x4004c6(0xe4)]('\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a'),_0x382e1b['forEach']((_0x30d2e6,_0xdfa144)=>{const _0x56e9d8=_0x4004c6;console[_0x56e9d8(0xe4)]('\x20\x20'+(_0xdfa144+0x1)+'.\x20'+IDE_CONFIGS[_0x30d2e6][_0x56e9d8(0xe8)]+_0x56e9d8(0xdb)+IDE_CONFIGS[_0x30d2e6][_0x56e9d8(0xc2)]);}),console['log']('\x20\x200.\x20全部安装'),console[_0x4004c6(0xe4)](_0x4004c6(0xcc)),console[_0x4004c6(0xe4)](_0x4004c6(0xf9)),console['log'](_0x4004c6(0xbe)),new Promise(_0x150b26=>{const _0x2ba211=_0x4004c6,_0x275c3b=createInterface({'input':process['stdin'],'output':process[_0x2ba211(0xbc)]});_0x275c3b[_0x2ba211(0xce)](_0x2ba211(0x100),_0x9d5101=>{const _0x1555a2=_0x2ba211;_0x275c3b[_0x1555a2(0xcd)]();const _0x414235=_0x9d5101[_0x1555a2(0x102)]()[_0x1555a2(0xe2)]();(_0x414235==='q'||_0x414235===_0x1555a2(0xe1)||_0x414235===_0x1555a2(0xd6))&&(console['log'](_0x1555a2(0xf5)),process['exit'](0x0));if(_0x414235==='0'||_0x414235==='all'){_0x150b26([_0x1555a2(0xea)]);return;}const _0x39523b=_0x414235['split'](/\s+/)[_0x1555a2(0xbd)](Boolean),_0x4641d2=[];for(const _0x53c01b of _0x39523b){const _0x30567b=parseInt(_0x53c01b,0xa);if(!isNaN(_0x30567b)&&_0x30567b>=0x1&&_0x30567b<=_0x382e1b[_0x1555a2(0xa1)]){const _0x482c5f=_0x382e1b[_0x30567b-0x1];_0x482c5f&&!_0x4641d2[_0x1555a2(0xde)](_0x482c5f)&&_0x4641d2['push'](_0x482c5f);}}_0x4641d2[_0x1555a2(0xa1)]===0x0&&(console['log'](_0x1555a2(0xb9)),process[_0x1555a2(0xd6)](0x0)),_0x150b26(_0x4641d2);});});}function showHelp(){const _0x2778d7=a58_0x2c6c58;console['log'](_0x2778d7(0xd0));}async function copyDir(_0x3aa335,_0x572c25){const _0x45697=a58_0x2c6c58,_0x31b3e1=statSync(_0x3aa335);if(_0x31b3e1[_0x45697(0xc6)]()){!existsSync(_0x572c25)&&mkdirSync(_0x572c25,{'recursive':!![]});const _0x4a7dfc=readdirSync(_0x3aa335);for(const _0x44dea6 of _0x4a7dfc){await copyDir(join(_0x3aa335,_0x44dea6),join(_0x572c25,_0x44dea6));}}else copyFileSync(_0x3aa335,_0x572c25);}async function installSingleIDE(_0xd42776,_0xc4195e,_0x2175af){const _0x5ef2d4=a58_0x2c6c58,_0x52d90c=_0xd42776!==_0x5ef2d4(0xc3)&&IDE_CONFIGS[_0xd42776]!==undefined,_0x205975=_0xd42776==='agent'||!_0x52d90c,_0x3943ee=_0x205975?_0x5ef2d4(0xca):_0x52d90c?IDE_CONFIGS[_0xd42776][_0x5ef2d4(0xe8)]:_0xd42776;console['log'](_0x5ef2d4(0xba)+_0x3943ee+_0x5ef2d4(0xfa));let _0x3c7902=0x0;const _0x4d167c=_0x205975?[_0x5ef2d4(0xb5)]:_0x52d90c?IDE_CONFIGS[_0xd42776][_0x5ef2d4(0xee)]:[_0x5ef2d4(0xb5)];for(const _0x47064a of _0x4d167c){const _0x597044=join(_0x2175af,_0x47064a),_0x5249fa=join(_0xc4195e,_0x47064a);if(!existsSync(_0x597044)){logger['warn']('skill-install','模板不存在:\x20'+_0x597044);continue;}await copyDir(_0x597044,_0x5249fa),_0x3c7902++,console[_0x5ef2d4(0xe4)]('\x20\x20✓\x20复制\x20'+_0x47064a+'/');}return _0x3c7902;}async function installSkill(_0x29ed15){const _0x5dd3e4=a58_0x2c6c58,_0x47a94e=process[_0x5dd3e4(0xf0)](),_0xbb48ac=resolve(__dirname,'../../templates/skills');let _0x205432=[];!_0x29ed15?_0x205432=await selectIDEs():_0x205432=[_0x29ed15];_0x205432[_0x5dd3e4(0xde)]('all')&&(_0x205432=[_0x5dd3e4(0xe0),'windsurf','claude',_0x5dd3e4(0xf2),_0x5dd3e4(0xf8),'qoder','codebuddy','trae',_0x5dd3e4(0xc3)]);const _0x3553ff=[];for(const _0x4f6edd of _0x205432){if(_0x4f6edd===_0x5dd3e4(0xc3))_0x3553ff[_0x5dd3e4(0xec)](_0x5dd3e4(0xc3));else{if(_0x4f6edd==='all')continue;else IDE_CONFIGS[_0x4f6edd]?_0x3553ff[_0x5dd3e4(0xec)](_0x4f6edd):(console[_0x5dd3e4(0xe4)]('⚠️\x20\x20未知的平台:\x20'+_0x4f6edd+_0x5dd3e4(0xd1)),_0x3553ff[_0x5dd3e4(0xec)](_0x5dd3e4(0xc3)));}}_0x3553ff[_0x5dd3e4(0xa1)]===0x0&&(console[_0x5dd3e4(0xe4)]('\x0a没有有效的\x20IDE\x20需要安装\x0a'),process[_0x5dd3e4(0xd6)](0x0));const _0xee4aca=join(_0xbb48ac,_0x5dd3e4(0xae)),_0x32a812=join(_0x47a94e,_0x5dd3e4(0xfd));existsSync(_0xee4aca)&&(await copyDir(_0xee4aca,_0x32a812),console['log']('✓\x20复制\x20.lovrabet/skill/.shared/'));let _0x4fb05b=0x0;for(const _0x3b3650 of _0x3553ff){try{const _0x103055=await installSingleIDE(_0x3b3650,_0x47a94e,_0xbb48ac);_0x4fb05b+=_0x103055;}catch(_0x4ed40c){console['error'](_0x5dd3e4(0xeb)+_0x3b3650+_0x5dd3e4(0x103)+(_0x4ed40c instanceof Error?_0x4ed40c[_0x5dd3e4(0xad)]:String(_0x4ed40c)));}}const _0x4187b0={'version':_0x5dd3e4(0xa2),'installedAt':new Date()[_0x5dd3e4(0xb7)](),'platforms':_0x3553ff};try{const _0x5882ff=join(_0xbb48ac,_0x5dd3e4(0xae)),_0x5c47ac=join(_0x47a94e,_0x5dd3e4(0xd2));existsSync(_0x5882ff)&&(await copyDir(_0x5882ff,_0x5c47ac),console[_0x5dd3e4(0xe4)](_0x5dd3e4(0xa3)));let _0x64234d=0x0;for(const _0x45b28a of _0x3553ff){try{const _0x361b16=await installSingleIDE(_0x45b28a,_0x47a94e,_0xbb48ac);_0x64234d+=_0x361b16;}catch(_0x4c8d5f){console[_0x5dd3e4(0xaa)](_0x5dd3e4(0xeb)+_0x45b28a+_0x5dd3e4(0x103)+(_0x4c8d5f instanceof Error?_0x4c8d5f[_0x5dd3e4(0xad)]:String(_0x4c8d5f)));}}const _0x16c1d1={'version':_0x5dd3e4(0xa2),'installedAt':new Date()[_0x5dd3e4(0xb7)](),'platforms':_0x3553ff},_0xdd6bf5=join(_0x47a94e,_0x5dd3e4(0xdc));!existsSync(join(_0x47a94e,_0x5dd3e4(0xac)))&&mkdirSync(join(_0x47a94e,'.lovrabet'),{'recursive':!![]}),writeFileSync(_0xdd6bf5,JSON[_0x5dd3e4(0xf7)](_0x16c1d1,null,0x2),_0x5dd3e4(0xfb)),console['log'](_0x5dd3e4(0xfc)),console['log'](_0x5dd3e4(0xe7)+_0x64234d+_0x5dd3e4(0xf4)),console[_0x5dd3e4(0xe4)]('开发者指南位置:'),console[_0x5dd3e4(0xe4)](_0x5dd3e4(0xa9)),logger['info'](_0x5dd3e4(0xc1),_0x5dd3e4(0xe6),{'projectRoot':_0x47a94e,'ides':_0x3553ff,'foldersCount':_0x64234d});}catch(_0x33515b){logger[_0x5dd3e4(0xaa)](_0x5dd3e4(0xc1),_0x5dd3e4(0xa7),{'error':_0x33515b instanceof Error?_0x33515b['message']:String(_0x33515b)}),console[_0x5dd3e4(0xaa)](_0x5dd3e4(0xf3)+(_0x33515b instanceof Error?_0x33515b[_0x5dd3e4(0xad)]:String(_0x33515b))+'\x0a'),process[_0x5dd3e4(0xd6)](0x1);}}
|
|
1
|
+
const a58_0x140986=a58_0x5d23;(function(_0x2eeee1,_0x2d1693){const _0xb341a8=a58_0x5d23,_0x4d89fd=_0x2eeee1();while(!![]){try{const _0xaaec07=parseInt(_0xb341a8(0x1de))/0x1*(parseInt(_0xb341a8(0x1fc))/0x2)+-parseInt(_0xb341a8(0x208))/0x3+parseInt(_0xb341a8(0x1ec))/0x4+-parseInt(_0xb341a8(0x1ed))/0x5*(-parseInt(_0xb341a8(0x1b4))/0x6)+-parseInt(_0xb341a8(0x1f5))/0x7*(-parseInt(_0xb341a8(0x1ea))/0x8)+-parseInt(_0xb341a8(0x205))/0x9+-parseInt(_0xb341a8(0x1b9))/0xa;if(_0xaaec07===_0x2d1693)break;else _0x4d89fd['push'](_0x4d89fd['shift']());}catch(_0xbdaecd){_0x4d89fd['push'](_0x4d89fd['shift']());}}}(a58_0x3ffe,0xedc75));import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';function a58_0x3ffe(){const _0x1bc5d0=['\x20\x20✗\x20安装\x20','1435113iHBvrz','help','.cursorrules','不支持的命令:\x20','...\x0a','Windsurf\x20IDE\x20(.windsurf/workflows/)','\x0a已取消安装\x0a','.qoder','qoder','⚠️\x20\x20未知的平台:\x20','\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','.windsurf','24TZXNMJ','split','5748780DurLra','3935620fBNNfQ','claude\x20code\x20(.claude/skills/)','使用示例:','.lovrabet/skill/.shared/','includes','log','codebuddy','\x20个目录\x0a','2799503xATYNq','2.0.0','claude\x20code','请选择:\x20','all','toISOString','.lovrabet','2DctijY','输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)','.lovrabet/skill-manifest.json','OpenCode','Cursor','agent','info','Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','\x20-\x20','12149118TyfDrx','stdin','Windsurf','5071956ZrugKJ','.cursor','安装成功','trim','Codex\x20IDE\x20(.codex/skills/)','folders','\x0a错误:\x20安装失败\x20-\x20','OpenCode\x20IDE\x20(.opencode/skills/)','windsurf','CodeBuddy','输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a','cursor','(空)','.agent','Qoder','error','setLogPath','cwd','.trae','stdout','--help','\x0a未选择任何\x20IDE,安装取消\x0a','通用模板','Trae\x20IDE\x20(.trae/skills/)','6tCrlJW','name','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a','\x0a✓\x20技能包安装成功!共安装\x20','Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)','8447240NWbnEJ','skill-install','exit','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包','opencode','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包','模板不存在:\x20','claude','.lovrabet/skill/.shared','codex','isDirectory','trae','toLowerCase','length','question','\x20\x20q.\x20取消\x0a','✓\x20复制\x20.lovrabet/skill/.shared/','forEach','stringify','\x0a📦\x20正在安装\x20','push',',使用通用模板','错误:\x20不支持的命令:\x20','filter','\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a','\x20\x20✓\x20复制\x20','\x20失败:\x20','message','安装失败','✓\x20创建\x20.lovrabet/skill-manifest.json','.claude','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','.opencode','description','.shared','开发者指南位置:'];a58_0x3ffe=function(){return _0x1bc5d0;};return a58_0x3ffe();}import{fileURLToPath}from'node:url';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a58_0x140986(0x200),'description':a58_0x140986(0x203),'folders':[a58_0x140986(0x1e0),a58_0x140986(0x209)]},'windsurf':{'name':a58_0x140986(0x207),'description':a58_0x140986(0x1e3),'folders':[a58_0x140986(0x1e9)]},'claude':{'name':a58_0x140986(0x1f7),'description':a58_0x140986(0x1ee),'folders':[a58_0x140986(0x1d7)]},'codex':{'name':'Codex','description':a58_0x140986(0x20c),'folders':['.codex']},'opencode':{'name':a58_0x140986(0x1ff),'description':a58_0x140986(0x20f),'folders':[a58_0x140986(0x1d9)]},'qoder':{'name':a58_0x140986(0x216),'description':a58_0x140986(0x1b8),'folders':[a58_0x140986(0x1e5)]},'codebuddy':{'name':a58_0x140986(0x211),'description':'CodeBuddy\x20IDE\x20(.codebuddy/skills/)','folders':['.codebuddy']},'trae':{'name':'Trae','description':a58_0x140986(0x21f),'folders':[a58_0x140986(0x21a)]}};export async function skillsCommand(_0x594c1d,_0x31a868,_0x211ca7){const _0xa208b0=a58_0x140986;logger[_0xa208b0(0x218)](process[_0xa208b0(0x219)]());if(_0x211ca7?.[_0xa208b0(0x1df)]||_0x594c1d===_0xa208b0(0x21c)){showHelp();return;}_0x594c1d!=='install'&&(console['error'](_0xa208b0(0x1cf)+(_0x594c1d||_0xa208b0(0x214))),console[_0xa208b0(0x1f2)]('\x0a可用命令:'),console[_0xa208b0(0x1f2)](_0xa208b0(0x1be)),console[_0xa208b0(0x1f2)](_0xa208b0(0x1bc)),console[_0xa208b0(0x1f2)](_0xa208b0(0x1e8)),console[_0xa208b0(0x1f2)](_0xa208b0(0x1ef)),console[_0xa208b0(0x1f2)]('\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE'),console[_0xa208b0(0x1f2)](_0xa208b0(0x1b6)),logger['error']('skill',_0xa208b0(0x1e1)+_0x594c1d),process[_0xa208b0(0x1bb)](0x1)),await installSkill(_0x31a868?.[0x0]);}async function selectIDEs(){const _0x3139c0=a58_0x140986,_0x4f4f01=[_0x3139c0(0x213),_0x3139c0(0x210),'claude',_0x3139c0(0x1c2),_0x3139c0(0x1bd),_0x3139c0(0x1e6),_0x3139c0(0x1f3),_0x3139c0(0x1c4)];return console[_0x3139c0(0x1f2)](_0x3139c0(0x1d1)),_0x4f4f01[_0x3139c0(0x1ca)]((_0x138c8b,_0x5c7d02)=>{const _0x28e58f=_0x3139c0;console[_0x28e58f(0x1f2)]('\x20\x20'+(_0x5c7d02+0x1)+'.\x20'+IDE_CONFIGS[_0x138c8b][_0x28e58f(0x1b5)]+_0x28e58f(0x204)+IDE_CONFIGS[_0x138c8b][_0x28e58f(0x1da)]);}),console[_0x3139c0(0x1f2)]('\x20\x200.\x20全部安装'),console[_0x3139c0(0x1f2)](_0x3139c0(0x1c8)),console[_0x3139c0(0x1f2)](_0x3139c0(0x1fd)),console[_0x3139c0(0x1f2)](_0x3139c0(0x212)),new Promise(_0x189920=>{const _0x3e5868=_0x3139c0,_0x2232ea=createInterface({'input':process[_0x3e5868(0x206)],'output':process[_0x3e5868(0x21b)]});_0x2232ea[_0x3e5868(0x1c7)](_0x3e5868(0x1f8),_0x29fb4d=>{const _0x8d9ab0=_0x3e5868;_0x2232ea['close']();const _0x5ae550=_0x29fb4d[_0x8d9ab0(0x20b)]()[_0x8d9ab0(0x1c5)]();(_0x5ae550==='q'||_0x5ae550==='quit'||_0x5ae550==='exit')&&(console[_0x8d9ab0(0x1f2)](_0x8d9ab0(0x1e4)),process[_0x8d9ab0(0x1bb)](0x0));if(_0x5ae550==='0'||_0x5ae550==='all'){_0x189920(['all']);return;}const _0x40af6f=_0x5ae550[_0x8d9ab0(0x1eb)](/\s+/)[_0x8d9ab0(0x1d0)](Boolean),_0xc64537=[];for(const _0x478821 of _0x40af6f){const _0x4b7a45=parseInt(_0x478821,0xa);if(!isNaN(_0x4b7a45)&&_0x4b7a45>=0x1&&_0x4b7a45<=_0x4f4f01[_0x8d9ab0(0x1c6)]){const _0x374094=_0x4f4f01[_0x4b7a45-0x1];_0x374094&&!_0xc64537[_0x8d9ab0(0x1f1)](_0x374094)&&_0xc64537[_0x8d9ab0(0x1cd)](_0x374094);}}_0xc64537[_0x8d9ab0(0x1c6)]===0x0&&(console[_0x8d9ab0(0x1f2)](_0x8d9ab0(0x21d)),process[_0x8d9ab0(0x1bb)](0x0)),_0x189920(_0xc64537);});});}function showHelp(){const _0x1748c4=a58_0x140986;console[_0x1748c4(0x1f2)]('\x0aLovrabet\x20Skill\x20-\x20开发者技能包安装工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互式选择并安装技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20直接安装指定\x20IDE\x20的技能包\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20安装所有技能包\x0a\x0a安装方式:\x0a\x20\x20\x20交互式选择\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20显示\x20IDE\x20列表供选择,支持多选\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20使用\x20↑↓\x20移动光标,空格选中/取消,Enter\x20确认\x0a\x20\x20\x20\x20→\x20按\x20a\x20全选,按\x20i/r\x20反选,按\x20q\x20退出\x0a\x0a\x20\x20直接安装指定\x20IDE\x20(支持多个)\x20\x20\x20\x20\x20\x20\x20-\x20使用\x20--ide\x20标志直接安装\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装\x20Cursor\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20安装多个\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20安装全部\x0a\x0a支持的\x20IDE:\x0a\x20\x20--cursor\x20\x20\x20\x20\x20\x20\x20Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)\x0a\x20\x20--windsurf\x20\x20\x20\x20\x20Windsurf\x20IDE\x20(.windsurf/workflows/)\x0a\x20\x20--claude\x20\x20\x20\x20\x20\x20\x20Claude\x20Code\x20(.claude/skills/)\x0a\x20\x20--codex\x20\x20\x20\x20\x20\x20\x20\x20Codex\x20IDE\x20(.codex/skills/)\x0a\x20\x20--opencode\x20\x20\x20\x20\x20OpenCode\x20IDE\x20(.opencode/skills/)\x0a\x20\x20--qoder\x20\x20\x20\x20\x20\x20\x20\x20Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)\x0a\x20\x20--codebuddy\x20\x20\x20\x20CodeBuddy\x20IDE\x20(.codebuddy/skills/)\x0a\x20\x20--trae\x20\x20\x20\x20\x20\x20\x20\x20\x20Trae\x20IDE\x20(.trae/skills/)\x0a\x20\x20--agent\x20\x20\x20\x20\x20\x20\x20\x20其他\x20(通用模板)\x20(.agent/skills/)\x20-\x20兜底方案\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20安装所有\x20IDE\x20技能包(包括通用模板)\x0a\x0a技能包内容包括:\x0a\x20\x20-\x20Filter\x20查询构建规范\x20(10\x20种常见错误对照)\x0a\x20\x20-\x20MCP\x20SQL\x20创建工作流\x20(5\x20步强制流程)\x0a\x20\x20-\x20AntD\x20UI\x20开发规范\x20(禁止\x20AI\x20味道)\x0a\x20\x20-\x20API\x20集成指南\x20(lovrabet\x20api\x20pull\x20流程)\x0a\x20\x20-\x20菜单管理指南\x20(menu\x20sync/update\x20流程)\x0a\x20\x20-\x20Backend\x20Function\x20脚本编写规范\x20(权限过滤、数据脱敏、业务逻辑)\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a\x20\x20\x20\x20→\x20交互式选择\x20IDE\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a\x20\x20\x20\x20→\x20直接安装\x20Cursor\x20和\x20claude\x20code\x20技能包\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a\x20\x20\x20\x20→\x20安装所有\x20IDE\x20技能包\x0a\x0a安装后会在项目中创建:\x0a\x20\x20-\x20IDE\x20特定配置文件\x20(.cursorrules,\x20.windsurf/,\x20.claude/,\x20.codex/,\x20.opencode/,\x20.qoder/,\x20.codebuddy/,\x20.trae/)\x0a\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20\x20-\x20开发者技能指南\x0a\x0a开发者指南位置:\x0a\x20\x20.lovrabet/skill/.shared/guides/01-filter-query/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/02-mcp-sql-workflow/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/03-antd-style/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/05-api-integration/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/06-menu-management/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/07-backend-function/guide.md\x0a\x20\x20');}function a58_0x5d23(_0x28e35c,_0x1acffa){_0x28e35c=_0x28e35c-0x1b4;const _0x3ffe15=a58_0x3ffe();let _0x5d2371=_0x3ffe15[_0x28e35c];return _0x5d2371;}async function copyDir(_0x2d149e,_0x54feef){const _0x513be5=a58_0x140986,_0x356d26=statSync(_0x2d149e);if(_0x356d26[_0x513be5(0x1c3)]()){!existsSync(_0x54feef)&&mkdirSync(_0x54feef,{'recursive':!![]});const _0x74ed41=readdirSync(_0x2d149e);for(const _0x3ea542 of _0x74ed41){await copyDir(join(_0x2d149e,_0x3ea542),join(_0x54feef,_0x3ea542));}}else copyFileSync(_0x2d149e,_0x54feef);}async function installSingleIDE(_0x32366b,_0x227d3c,_0xff5ef4){const _0x2c5b46=a58_0x140986,_0x14f030=_0x32366b!==_0x2c5b46(0x201)&&IDE_CONFIGS[_0x32366b]!==undefined,_0x9e741=_0x32366b===_0x2c5b46(0x201)||!_0x14f030,_0x50b53c=_0x9e741?_0x2c5b46(0x21e):_0x14f030?IDE_CONFIGS[_0x32366b]['name']:_0x32366b;console['log'](_0x2c5b46(0x1cc)+_0x50b53c+_0x2c5b46(0x1e2));let _0x21fb23=0x0;const _0x1d85c3=_0x9e741?['.agent']:_0x14f030?IDE_CONFIGS[_0x32366b][_0x2c5b46(0x20d)]:[_0x2c5b46(0x215)];for(const _0x5df295 of _0x1d85c3){const _0x1b46f9=join(_0xff5ef4,_0x5df295),_0x5b5a40=join(_0x227d3c,_0x5df295);if(!existsSync(_0x1b46f9)){logger['warn'](_0x2c5b46(0x1ba),_0x2c5b46(0x1bf)+_0x1b46f9);continue;}await copyDir(_0x1b46f9,_0x5b5a40),_0x21fb23++,console[_0x2c5b46(0x1f2)](_0x2c5b46(0x1d2)+_0x5df295+'/');}return _0x21fb23;}async function installSkill(_0x63c703){const _0x5b872f=a58_0x140986,_0x38f117=process[_0x5b872f(0x219)](),_0x1d3772=resolve(__dirname,'../../templates/skills');let _0x2a38a2=[];!_0x63c703?_0x2a38a2=await selectIDEs():_0x2a38a2=[_0x63c703];_0x2a38a2[_0x5b872f(0x1f1)](_0x5b872f(0x1f9))&&(_0x2a38a2=['cursor',_0x5b872f(0x210),_0x5b872f(0x1c0),'codex',_0x5b872f(0x1bd),_0x5b872f(0x1e6),_0x5b872f(0x1f3),_0x5b872f(0x1c4),_0x5b872f(0x201)]);const _0x16e3e9=[];for(const _0x1e7a52 of _0x2a38a2){if(_0x1e7a52===_0x5b872f(0x201))_0x16e3e9[_0x5b872f(0x1cd)](_0x5b872f(0x201));else{if(_0x1e7a52===_0x5b872f(0x1f9))continue;else IDE_CONFIGS[_0x1e7a52]?_0x16e3e9[_0x5b872f(0x1cd)](_0x1e7a52):(console[_0x5b872f(0x1f2)](_0x5b872f(0x1e7)+_0x1e7a52+_0x5b872f(0x1ce)),_0x16e3e9[_0x5b872f(0x1cd)](_0x5b872f(0x201)));}}_0x16e3e9[_0x5b872f(0x1c6)]===0x0&&(console[_0x5b872f(0x1f2)]('\x0a没有有效的\x20IDE\x20需要安装\x0a'),process[_0x5b872f(0x1bb)](0x0));const _0x20068e=join(_0x1d3772,'.shared'),_0x2659d5=join(_0x38f117,_0x5b872f(0x1c1));existsSync(_0x20068e)&&(await copyDir(_0x20068e,_0x2659d5),console['log'](_0x5b872f(0x1c9)));let _0x39f1f9=0x0;for(const _0x2bd667 of _0x16e3e9){try{const _0x568064=await installSingleIDE(_0x2bd667,_0x38f117,_0x1d3772);_0x39f1f9+=_0x568064;}catch(_0x4ed813){console[_0x5b872f(0x217)](_0x5b872f(0x1dd)+_0x2bd667+_0x5b872f(0x1d3)+(_0x4ed813 instanceof Error?_0x4ed813[_0x5b872f(0x1d4)]:String(_0x4ed813)));}}const _0x106492={'version':_0x5b872f(0x1f6),'installedAt':new Date()[_0x5b872f(0x1fa)](),'platforms':_0x16e3e9};try{const _0x3369ff=join(_0x1d3772,_0x5b872f(0x1db)),_0xb772ba=join(_0x38f117,_0x5b872f(0x1f0));existsSync(_0x3369ff)&&(await copyDir(_0x3369ff,_0xb772ba),console['log'](_0x5b872f(0x1c9)));let _0x3b075e=0x0;for(const _0x1e5f33 of _0x16e3e9){try{const _0x3fea09=await installSingleIDE(_0x1e5f33,_0x38f117,_0x1d3772);_0x3b075e+=_0x3fea09;}catch(_0x2ebb83){console[_0x5b872f(0x217)](_0x5b872f(0x1dd)+_0x1e5f33+_0x5b872f(0x1d3)+(_0x2ebb83 instanceof Error?_0x2ebb83[_0x5b872f(0x1d4)]:String(_0x2ebb83)));}}const _0x33a37c={'version':_0x5b872f(0x1f6),'installedAt':new Date()[_0x5b872f(0x1fa)](),'platforms':_0x16e3e9},_0x33371c=join(_0x38f117,_0x5b872f(0x1fe));!existsSync(join(_0x38f117,_0x5b872f(0x1fb)))&&mkdirSync(join(_0x38f117,_0x5b872f(0x1fb)),{'recursive':!![]}),writeFileSync(_0x33371c,JSON[_0x5b872f(0x1cb)](_0x33a37c,null,0x2),'utf-8'),console[_0x5b872f(0x1f2)](_0x5b872f(0x1d6)),console[_0x5b872f(0x1f2)](_0x5b872f(0x1b7)+_0x3b075e+_0x5b872f(0x1f4)),console[_0x5b872f(0x1f2)](_0x5b872f(0x1dc)),console[_0x5b872f(0x1f2)](_0x5b872f(0x1d8)),logger[_0x5b872f(0x202)]('skill-install',_0x5b872f(0x20a),{'projectRoot':_0x38f117,'ides':_0x16e3e9,'foldersCount':_0x3b075e});}catch(_0x439a1e){logger[_0x5b872f(0x217)](_0x5b872f(0x1ba),_0x5b872f(0x1d5),{'error':_0x439a1e instanceof Error?_0x439a1e[_0x5b872f(0x1d4)]:String(_0x439a1e)}),console[_0x5b872f(0x217)](_0x5b872f(0x20e)+(_0x439a1e instanceof Error?_0x439a1e[_0x5b872f(0x1d4)]:String(_0x439a1e))+'\x0a'),process[_0x5b872f(0x1bb)](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a60_0x59e3(_0x2e5ac6,_0x2dcae3){_0x2e5ac6=_0x2e5ac6-0x10e;const _0xaeca9a=a60_0xaeca();let _0x59e33c=_0xaeca9a[_0x2e5ac6];return _0x59e33c;}function a60_0xaeca(){const _0x7a6337=['dependencies','@lovrabet/sdk','12wblSsE','utf8','\x1b[33m','join','devDependencies','⚠️\x20\x20SDK\x20版本不兼容','3380232LNfHMv','\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest','2peLfhX','version','349902dylvsJ','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','\x20\x20\x20请升级\x20SDK\x20至\x20','log','22AtdfjM','minVersion','423973xGeLiZ','package.json','188190CIaPTv','needsUpgrade','3085983oovqBA','204HzGPsh','\x20或更高版本:','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','parse','8dwffIG','919615CFUHqr','readFileSync','\x1b[1m','\x1b[0m','10209SeaARo','existsSync'];a60_0xaeca=function(){return _0x7a6337;};return a60_0xaeca();}(function(_0x3b18df,_0x563438){const _0x1bfdd8=a60_0x59e3,_0x2a162a=_0x3b18df();while(!![]){try{const _0x510f02=parseInt(_0x1bfdd8(0x125))/0x1*(-parseInt(_0x1bfdd8(0x11d))/0x2)+parseInt(_0x1bfdd8(0x111))/0x3*(parseInt(_0x1bfdd8(0x12a))/0x4)+-parseInt(_0x1bfdd8(0x12f))/0x5*(parseInt(_0x1bfdd8(0x115))/0x6)+-parseInt(_0x1bfdd8(0x11f))/0x7*(parseInt(_0x1bfdd8(0x12e))/0x8)+parseInt(_0x1bfdd8(0x129))/0x9+-parseInt(_0x1bfdd8(0x127))/0xa+parseInt(_0x1bfdd8(0x123))/0xb*(parseInt(_0x1bfdd8(0x11b))/0xc);if(_0x510f02===_0x563438)break;else _0x2a162a['push'](_0x2a162a['shift']());}catch(_0x3d96e7){_0x2a162a['push'](_0x2a162a['shift']());}}}(a60_0xaeca,0x35834));import a60_0xcb869b from'node:fs';import a60_0x4c442a from'node:path';import a60_0x516152 from'semver';const MIN_SDK_VERSION='1.2.0';export function checkSdkVersion(_0x5e8176){const _0x3cefff=a60_0x59e3,_0x32a6b2=a60_0x4c442a[_0x3cefff(0x118)](_0x5e8176,_0x3cefff(0x126));if(!a60_0xcb869b[_0x3cefff(0x112)](_0x32a6b2))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x1a990e=JSON[_0x3cefff(0x12d)](a60_0xcb869b[_0x3cefff(0x10e)](_0x32a6b2,_0x3cefff(0x116))),_0x3d7522=_0x1a990e[_0x3cefff(0x113)]||{},_0x3168b9=_0x1a990e[_0x3cefff(0x119)]||{},_0x4efc85=_0x3d7522[_0x3cefff(0x114)]||_0x3168b9[_0x3cefff(0x114)];if(!_0x4efc85)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x41da87=a60_0x516152['coerce'](_0x4efc85),_0x48fa2c=_0x41da87?a60_0x516152['lt'](_0x41da87,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x4efc85,'needsUpgrade':_0x48fa2c,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x5e97cf){const _0x24fe75=a60_0x59e3;if(!_0x5e97cf[_0x24fe75(0x128)])return;const _0x2848bc=_0x24fe75(0x117),_0x3d6118=_0x24fe75(0x110),_0x5e7a8d=_0x24fe75(0x10f);console[_0x24fe75(0x122)](),console[_0x24fe75(0x122)](''+_0x2848bc+_0x5e7a8d+_0x24fe75(0x11a)+_0x3d6118),console['log'](_0x2848bc+_0x24fe75(0x12c)+_0x5e97cf[_0x24fe75(0x11e)]+'\x20不支持新协议。'+_0x3d6118),console[_0x24fe75(0x122)](_0x2848bc+_0x24fe75(0x121)+_0x5e97cf[_0x24fe75(0x124)]+_0x24fe75(0x12b)+_0x3d6118),console[_0x24fe75(0x122)](_0x2848bc+_0x24fe75(0x11c)+_0x3d6118),console['log'](_0x2848bc+_0x24fe75(0x120)+_0x3d6118),console[_0x24fe75(0x122)]();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a61_0x54bd(){const _0x1cda84=['parse','3773182hBJzJZ','string','32418OpQoXb','trim','4UEIktg','3svhOXn','9042385ELQfCt','.lovrabetrc','cwd','app','utf8','9204576rcOaZa','env','110332DRpUrl','3860wylGiw','appcode','2354012wkoNBJ','24PBljRQ','845200eYSgNd'];a61_0x54bd=function(){return _0x1cda84;};return a61_0x54bd();}const a61_0x3237fe=a61_0xc33f;(function(_0xef358c,_0x4521ff){const _0x530408=a61_0xc33f,_0x368dba=_0xef358c();while(!![]){try{const _0x54aa48=-parseInt(_0x530408(0x147))/0x1*(-parseInt(_0x530408(0x152))/0x2)+parseInt(_0x530408(0x153))/0x3*(-parseInt(_0x530408(0x14a))/0x4)+-parseInt(_0x530408(0x14c))/0x5*(-parseInt(_0x530408(0x14b))/0x6)+-parseInt(_0x530408(0x14e))/0x7+-parseInt(_0x530408(0x145))/0x8+parseInt(_0x530408(0x150))/0x9*(parseInt(_0x530408(0x148))/0xa)+parseInt(_0x530408(0x154))/0xb;if(_0x54aa48===_0x4521ff)break;else _0x368dba['push'](_0x368dba['shift']());}catch(_0x36fa76){_0x368dba['push'](_0x368dba['shift']());}}}(a61_0x54bd,0xcae9a));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a61_0xc33f(_0x4cab1d,_0x55daa6){_0x4cab1d=_0x4cab1d-0x142;const _0x54bd84=a61_0x54bd();let _0xc33f9e=_0x54bd84[_0x4cab1d];return _0xc33f9e;}import{homedir}from'node:os';import{initEnv}from'../constant/env.js';export const projectConfigPath=resolve(process[a61_0x3237fe(0x142)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a61_0x3237fe(0x155));export function readConfig(_0x356583){const _0x111d5e=a61_0x3237fe;let _0x32f880={};try{if(existsSync(globalConfigPath)){const _0x2166d3=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x2166d3&&(_0x32f880=JSON[_0x111d5e(0x14d)](_0x2166d3));}}catch(_0x3743c2){}try{const _0x3d501e=_0x356583?resolve(_0x356583,_0x111d5e(0x155)):projectConfigPath;if(existsSync(_0x3d501e)){const _0x1bc271=readFileSync(_0x3d501e,{'encoding':_0x111d5e(0x144)});if(_0x1bc271){const _0x38a53f=JSON[_0x111d5e(0x14d)](_0x1bc271);_0x32f880={..._0x32f880,..._0x38a53f};}}}catch(_0x2565d0){}return _0x32f880[_0x111d5e(0x146)]&&typeof _0x32f880[_0x111d5e(0x146)]===_0x111d5e(0x14f)&&initEnv(_0x32f880[_0x111d5e(0x146)]),_0x32f880;}export function getConfigAppCode(){const _0x2180c6=a61_0x3237fe;let _0x2b676a={},_0x3b2720={};try{if(existsSync(globalConfigPath)){const _0x59cd74=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x59cd74&&(_0x3b2720=JSON['parse'](_0x59cd74));}}catch(_0x2c3db7){}try{if(existsSync(projectConfigPath)){const _0x119ae1=readFileSync(projectConfigPath,{'encoding':_0x2180c6(0x144)});_0x119ae1&&(_0x2b676a=JSON[_0x2180c6(0x14d)](_0x119ae1));}}catch(_0x1e7fea){}let _0x4b7854;if(_0x2180c6(0x149)in _0x2b676a)_0x4b7854=_0x2b676a[_0x2180c6(0x149)];else{if(_0x2180c6(0x143)in _0x2b676a)_0x4b7854=_0x2b676a[_0x2180c6(0x143)];else{if(_0x2180c6(0x149)in _0x3b2720)_0x4b7854=_0x3b2720[_0x2180c6(0x149)];else _0x2180c6(0x143)in _0x3b2720&&(_0x4b7854=_0x3b2720['app']);}}if(typeof _0x4b7854!==_0x2180c6(0x14f)||_0x4b7854[_0x2180c6(0x151)]()==='')return undefined;return _0x4b7854;}export function isInProject(){return existsSync(projectConfigPath);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4a5448,_0xf6a3f3){const _0x582771=a62_0x3103,_0x37b5ab=_0x4a5448();while(!![]){try{const _0x502673=parseInt(_0x582771(0x189))/0x1+parseInt(_0x582771(0x18d))/0x2+-parseInt(_0x582771(0x184))/0x3+-parseInt(_0x582771(0x187))/0x4+parseInt(_0x582771(0x190))/0x5*(-parseInt(_0x582771(0x18c))/0x6)+parseInt(_0x582771(0x185))/0x7+-parseInt(_0x582771(0x18b))/0x8*(parseInt(_0x582771(0x18e))/0x9);if(_0x502673===_0xf6a3f3)break;else _0x37b5ab['push'](_0x37b5ab['shift']());}catch(_0x3c2a1e){_0x37b5ab['push'](_0x37b5ab['shift']());}}}(a62_0x11f5,0xe1d84));function a62_0x11f5(){const _0x898915=['2104mWiPYA','3791574GfdRQQ','2694718kPDMaG','45612hJJXor','join','5sQlvpR','复制目录时出错:','mkdirSync','error','995904Cjzktt','12540010ywuKae','readdirSync','1532364ENFENe','isDirectory','466143XLZOCM','name'];a62_0x11f5=function(){return _0x898915;};return a62_0x11f5();}function a62_0x3103(_0x54f5dd,_0x3a2eb0){_0x54f5dd=_0x54f5dd-0x181;const _0x11f58c=a62_0x11f5();let _0x31033a=_0x11f58c[_0x54f5dd];return _0x31033a;}import a62_0x3a7b12 from'node:path';import a62_0x2858fa from'node:fs';export async function copyDirectory(_0xa2bcff,_0x51f9c5){const _0x2456ec=a62_0x3103;try{const _0x3a182e=a62_0x2858fa[_0x2456ec(0x186)](_0xa2bcff,{'withFileTypes':!![]});a62_0x2858fa[_0x2456ec(0x182)](_0x51f9c5,{'recursive':!![]});for(const _0x516ffe of _0x3a182e){const _0x52c56c=a62_0x3a7b12[_0x2456ec(0x18f)](_0xa2bcff,_0x516ffe[_0x2456ec(0x18a)]),_0x46b638=a62_0x3a7b12['join'](_0x51f9c5,_0x516ffe[_0x2456ec(0x18a)]);_0x516ffe[_0x2456ec(0x188)]()?await copyDirectory(_0x52c56c,_0x46b638):a62_0x2858fa['copyFileSync'](_0x52c56c,_0x46b638);}}catch(_0x4f4e3b){console[_0x2456ec(0x183)](_0x2456ec(0x181),_0x4f4e3b);}}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b5e2b,_0x5a548a){const _0x1f555b=a63_0x535c,_0x267a24=_0x3b5e2b();while(!![]){try{const _0x173bd2=-parseInt(_0x1f555b(0x1c1))/0x1+-parseInt(_0x1f555b(0x1b1))/0x2*(parseInt(_0x1f555b(0x1b7))/0x3)+-parseInt(_0x1f555b(0x1c0))/0x4*(parseInt(_0x1f555b(0x1bc))/0x5)+parseInt(_0x1f555b(0x1ad))/0x6*(parseInt(_0x1f555b(0x1b9))/0x7)+parseInt(_0x1f555b(0x1ac))/0x8+-parseInt(_0x1f555b(0x1af))/0x9*(-parseInt(_0x1f555b(0x1ab))/0xa)+parseInt(_0x1f555b(0x1c4))/0xb;if(_0x173bd2===_0x5a548a)break;else _0x267a24['push'](_0x267a24['shift']());}catch(_0x2276dc){_0x267a24['push'](_0x267a24['shift']());}}}(a63_0x1693,0xa7298));function a63_0x535c(_0x229b38,_0xf0a1af){_0x229b38=_0x229b38-0x1aa;const _0x169325=a63_0x1693();let _0x535cf1=_0x169325[_0x229b38];return _0x535cf1;}export async function httpRequest(_0x27186f,_0x219710={}){const _0x548eb1=a63_0x535c,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x219710;let _0x5566a6=null;for(let _0x229343=0x0;_0x229343<=retries;_0x229343++){try{const _0xe4dfef=new AbortController(),_0x66845f=setTimeout(()=>_0xe4dfef[_0x548eb1(0x1ae)](),timeout),_0x2e1ab7=await fetch(_0x27186f,{'headers':headers,'signal':_0xe4dfef[_0x548eb1(0x1c2)]});clearTimeout(_0x66845f);let _0x3752d8;const _0x478a0f=_0x2e1ab7[_0x548eb1(0x1b4)][_0x548eb1(0x1aa)]('content-type');return _0x478a0f?.[_0x548eb1(0x1c8)]('application/json')?_0x3752d8=await _0x2e1ab7[_0x548eb1(0x1c3)]():_0x3752d8=await _0x2e1ab7[_0x548eb1(0x1bb)](),{'ok':_0x2e1ab7['ok'],'status':_0x2e1ab7['status'],'statusText':_0x2e1ab7[_0x548eb1(0x1bf)],'data':_0x3752d8,'headers':_0x2e1ab7[_0x548eb1(0x1b4)],'url':_0x2e1ab7[_0x548eb1(0x1bd)],'text':()=>_0x2e1ab7[_0x548eb1(0x1bb)]()};}catch(_0x18986d){_0x5566a6=_0x18986d instanceof Error?_0x18986d:new Error(String(_0x18986d));if(_0x229343===retries)break;if(shouldRetry(_0x18986d)){console[_0x548eb1(0x1c7)](_0x548eb1(0x1b6)+retryDelay+_0x548eb1(0x1b2)+(_0x229343+0x1)+_0x548eb1(0x1b8)),await sleep(retryDelay);continue;}else break;}}throw _0x5566a6||new Error(_0x548eb1(0x1b3));}function shouldRetry(_0x5adce4){const _0x369d94=a63_0x535c;if(_0x5adce4 instanceof Error){if(_0x5adce4[_0x369d94(0x1be)]==='AbortError')return![];if(_0x5adce4[_0x369d94(0x1be)]===_0x369d94(0x1ba)&&_0x5adce4[_0x369d94(0x1c5)][_0x369d94(0x1c8)](_0x369d94(0x1c6)))return!![];if(_0x5adce4[_0x369d94(0x1c5)][_0x369d94(0x1c8)](_0x369d94(0x1b0)))return!![];if(_0x5adce4[_0x369d94(0x1c5)][_0x369d94(0x1c8)](_0x369d94(0x1b5)))return![];}return![];}function sleep(_0x2cf52b){return new Promise(_0x58a0ac=>setTimeout(_0x58a0ac,_0x2cf52b));}function a63_0x1693(){const _0x1eb16f=['name','statusText','18544gNNOWa','418550IbQLaK','signal','json','12728925IpnODs','message','fetch','log','includes','get','10TpQxRv','8520552eQEHFv','2723898YTGBIC','abort','3660948rRMZhL','ECONNRESET','15810cujNoL','ms\x20后进行第\x20','Request\x20failed','headers','ENOTFOUND','*\x20请求失败,','315aZLTxh','\x20次重试...','7VmVsAK','TypeError','text','1240izuZWq','url'];a63_0x1693=function(){return _0x1eb16f;};return a63_0x1693();}export function validateUrl(_0x1ef3bc){try{return new URL(_0x1ef3bc),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x453932=a64_0xec13;(function(_0x4627b6,_0x220a92){const _0x35d7eb=a64_0xec13,_0x4e4c35=_0x4627b6();while(!![]){try{const _0x3a0ec5=parseInt(_0x35d7eb(0x18f))/0x1+-parseInt(_0x35d7eb(0x16f))/0x2*(parseInt(_0x35d7eb(0x195))/0x3)+parseInt(_0x35d7eb(0x190))/0x4+parseInt(_0x35d7eb(0x197))/0x5+-parseInt(_0x35d7eb(0x174))/0x6+parseInt(_0x35d7eb(0x18b))/0x7+parseInt(_0x35d7eb(0x180))/0x8*(parseInt(_0x35d7eb(0x17d))/0x9);if(_0x3a0ec5===_0x220a92)break;else _0x4e4c35['push'](_0x4e4c35['shift']());}catch(_0x3a740f){_0x4e4c35['push'](_0x4e4c35['shift']());}}}(a64_0x5927,0x35610));import a64_0x2c14ce from'winston';import a64_0x446458 from'node:fs';function a64_0xec13(_0x33d2a0,_0x41d49c){_0x33d2a0=_0x33d2a0-0x16c;const _0x5927d7=a64_0x5927();let _0xec13f5=_0x5927d7[_0x33d2a0];return _0xec13f5;}import a64_0x5c283d from'node:path';class Logger{[a64_0x453932(0x177)];[a64_0x453932(0x189)];['currentRawCommand']='';constructor(){const _0x26eb3c=a64_0x453932;this[_0x26eb3c(0x189)]='';}[a64_0x453932(0x18a)](_0x23faa8){this['currentRawCommand']=_0x23faa8;}[a64_0x453932(0x170)](){const _0x2ae3e2=a64_0x453932,_0x46a816=a64_0x5c283d['dirname'](this[_0x2ae3e2(0x189)]);!a64_0x446458['existsSync'](_0x46a816)&&a64_0x446458['mkdirSync'](_0x46a816,{'recursive':!![]});const _0x282a2b=a64_0x2c14ce['format'][_0x2ae3e2(0x176)](a64_0x2c14ce['format']['timestamp'](),a64_0x2c14ce[_0x2ae3e2(0x17a)]['errors']({'stack':!![]}),a64_0x2c14ce[_0x2ae3e2(0x17a)][_0x2ae3e2(0x173)](_0x1c399c=>{const _0x57cf36=_0x2ae3e2,_0x238e74={'timestamp':_0x1c399c['timestamp']||new Date()['toISOString'](),'level':_0x1c399c[_0x57cf36(0x19c)]||'info','command':_0x1c399c[_0x57cf36(0x17b)]||_0x57cf36(0x18e),'rawCommand':_0x1c399c[_0x57cf36(0x196)]||this['currentRawCommand']||undefined,'message':_0x1c399c[_0x57cf36(0x17c)]||'','duration':_0x1c399c['duration']||undefined,'details':_0x1c399c[_0x57cf36(0x1a0)]||undefined};return JSON[_0x57cf36(0x188)](_0x238e74);}));this[_0x2ae3e2(0x177)]=a64_0x2c14ce[_0x2ae3e2(0x17e)]({'level':_0x2ae3e2(0x19a),'format':_0x282a2b,'transports':[new a64_0x2c14ce[(_0x2ae3e2(0x181))][(_0x2ae3e2(0x191))]({'filename':this[_0x2ae3e2(0x189)],'level':_0x2ae3e2(0x19a)})],'silent':![]}),a64_0x2c14ce[_0x2ae3e2(0x17f)]({'success':_0x2ae3e2(0x192),'error':_0x2ae3e2(0x186),'warn':_0x2ae3e2(0x18c),'info':_0x2ae3e2(0x19b)});}[a64_0x453932(0x19e)](_0x543359){const _0x3b3409=a64_0x453932;this[_0x3b3409(0x189)]=a64_0x5c283d[_0x3b3409(0x175)](_0x543359,_0x3b3409(0x185)),this['winstonLogger']&&this[_0x3b3409(0x177)]['clear'](),this[_0x3b3409(0x170)]();}[a64_0x453932(0x19a)](_0x241b72,_0xabf34a,_0xd439f5){const _0x1d0138=a64_0x453932;if(!this[_0x1d0138(0x189)]||!this[_0x1d0138(0x177)])return;this['winstonLogger'][_0x1d0138(0x19a)](_0xabf34a,{'command':_0x241b72,'details':_0xd439f5});}[a64_0x453932(0x198)](_0x119d1b,_0x31b401,_0x5c384d,_0x5c519e){const _0xbdc479=a64_0x453932;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0xbdc479(0x177)]['log']('info',_0x31b401,{'level':'success','command':_0x119d1b,'duration':_0x5c384d,'details':_0x5c519e});}['error'](_0x1673c5,_0x287fca,_0x1f6e54){const _0x2418b9=a64_0x453932;if(!this[_0x2418b9(0x189)]||!this[_0x2418b9(0x177)])return;this[_0x2418b9(0x177)]['error'](_0x287fca,{'command':_0x1673c5,'details':_0x1f6e54});}[a64_0x453932(0x16e)](_0x273dfd,_0x565679,_0x1192a6){const _0x573295=a64_0x453932;if(!this[_0x573295(0x189)]||!this[_0x573295(0x177)])return;this['winstonLogger']['warn'](_0x565679,{'command':_0x273dfd,'details':_0x1192a6});}async[a64_0x453932(0x18d)](_0x3c53df,_0x57ee39,_0x51e451){const _0x3d0597=a64_0x453932,_0x2a26d6=Date[_0x3d0597(0x172)]();this[_0x3d0597(0x19a)](_0x3c53df,'开始执行:\x20'+_0x57ee39);try{const _0x343e8e=await _0x51e451(),_0x568cb2=Date[_0x3d0597(0x172)]()-_0x2a26d6;return this[_0x3d0597(0x198)](_0x3c53df,_0x3d0597(0x194)+_0x57ee39,_0x568cb2),_0x343e8e;}catch(_0x36c72e){const _0x35f16f=Date[_0x3d0597(0x172)]()-_0x2a26d6;this['error'](_0x3c53df,_0x3d0597(0x19d)+_0x57ee39,{'error':_0x36c72e instanceof Error?_0x36c72e['message']:String(_0x36c72e),'duration':_0x35f16f});throw _0x36c72e;}}[a64_0x453932(0x182)](){const _0x33b2de=a64_0x453932;try{if(!a64_0x446458[_0x33b2de(0x178)](this[_0x33b2de(0x189)]))return[];const _0x3c68b2=a64_0x446458[_0x33b2de(0x16d)](this[_0x33b2de(0x189)],'utf8');return _0x3c68b2['split']('\x0a')[_0x33b2de(0x16c)](_0x4d53f6=>_0x4d53f6['trim']())[_0x33b2de(0x187)](_0x2a9f2a=>JSON[_0x33b2de(0x19f)](_0x2a9f2a));}catch(_0x4eb847){return console[_0x33b2de(0x16e)](_0x33b2de(0x171),_0x4eb847),[];}}[a64_0x453932(0x179)](){const _0x5c30a7=a64_0x453932;try{a64_0x446458[_0x5c30a7(0x178)](this['logFilePath'])&&a64_0x446458[_0x5c30a7(0x193)](this[_0x5c30a7(0x189)],'',_0x5c30a7(0x199));}catch(_0x4208bc){console['warn'](_0x5c30a7(0x184),_0x4208bc);}}[a64_0x453932(0x183)](){const _0x43b4b0=a64_0x453932;return this[_0x43b4b0(0x177)];}}export const logger=new Logger();function a64_0x5927(){const _0xf0af71=['readLogs','getWinstonInstance','Failed\x20to\x20clear\x20logs:','.lovrabet.log','red','map','stringify','logFilePath','setRawCommand','1260840iqcxET','yellow','logTask','unknown','127629BmdMou','210784ZcCShv','File','green','writeFileSync','完成:\x20','630621VvtrVh','rawCommand','1454510NeVXHJ','success','utf8','info','blue','level','失败:\x20','setLogPath','parse','details','filter','readFileSync','warn','4RUpcqY','initWinstonLogger','Failed\x20to\x20read\x20logs:','now','printf','839820XtyhtM','join','combine','winstonLogger','existsSync','clearLogs','format','command','message','1971MItGwS','createLogger','addColors','4664gBzUCc','transports'];a64_0x5927=function(){return _0xf0af71;};return a64_0x5927();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x593a3e=a65_0x17f0;(function(_0x25ad1f,_0x23317c){const _0x919930=a65_0x17f0,_0x9931e4=_0x25ad1f();while(!![]){try{const _0x35e181=-parseInt(_0x919930(0x93))/0x1+-parseInt(_0x919930(0x83))/0x2*(-parseInt(_0x919930(0x7e))/0x3)+-parseInt(_0x919930(0x99))/0x4*(-parseInt(_0x919930(0x82))/0x5)+parseInt(_0x919930(0x7c))/0x6+parseInt(_0x919930(0x95))/0x7+parseInt(_0x919930(0x80))/0x8+-parseInt(_0x919930(0x79))/0x9;if(_0x35e181===_0x23317c)break;else _0x9931e4['push'](_0x9931e4['shift']());}catch(_0x1b98bc){_0x9931e4['push'](_0x9931e4['shift']());}}}(a65_0x5ee2,0xaba6e));import a65_0x3a194f from'node:fs';import a65_0x105dab from'node:path';function a65_0x17f0(_0x250548,_0x528595){_0x250548=_0x250548-0x72;const _0x5ee2c9=a65_0x5ee2();let _0x17f0f4=_0x5ee2c9[_0x250548];return _0x17f0f4;}import{logger}from'./logger.js';function a65_0x5ee2(){const _0x10fcec=['routerFilePath','error','path:\x20\x22','indexOf','211032fmaODl','promises','7854784EBmbiI','src','\x20from\x20\x22../pages/','join','8wpVikJ','writeFile','router','index.tsx','未找到路由配置的\x20children\x20数组','length','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','slice','路由配置更新失败','now','previewChanges','readFile','toComponentName','开始更新路由配置','27155439YwRLpC','addRoute','toLowerCase','926106IQVCGi','路由配置更新完成','237777aWDztZ','match','3385016oMNmop','import\x20','3003580zgadZg','26xYvzCo','message','index','lastIndexOf','includes','utf8','split','charAt','addImport','info','addPageRoute','existsSync'];a65_0x5ee2=function(){return _0x10fcec;};return a65_0x5ee2();}export class RouterUpdater{[a65_0x593a3e(0x8f)];constructor(_0x284f5a){const _0x429b6f=a65_0x593a3e;this[_0x429b6f(0x8f)]=a65_0x105dab['join'](_0x284f5a,_0x429b6f(0x96),_0x429b6f(0x9b),_0x429b6f(0x9c));}async[a65_0x593a3e(0x8d)](_0x576c48,_0x424be){const _0x55d82d=a65_0x593a3e;if(!a65_0x3a194f[_0x55d82d(0x8e)](this[_0x55d82d(0x8f)]))throw new Error('路由文件不存在:\x20'+this[_0x55d82d(0x8f)]);const _0xc9d4e7=Date[_0x55d82d(0x74)]();logger[_0x55d82d(0x8c)](_0x55d82d(0x9b),_0x55d82d(0x78),{'pageName':_0x576c48,'routePath':_0x424be,'file':this['routerFilePath']});try{const _0x2e0a80=await a65_0x3a194f[_0x55d82d(0x94)][_0x55d82d(0x76)](this[_0x55d82d(0x8f)],_0x55d82d(0x88)),_0x18bc4b=this['toComponentName'](_0x576c48),_0x3d8846=this[_0x55d82d(0x8b)](_0x2e0a80,_0x18bc4b,_0x576c48),_0x1fcaf2=this['addRoute'](_0x3d8846,_0x424be,_0x18bc4b);await a65_0x3a194f[_0x55d82d(0x94)][_0x55d82d(0x9a)](this[_0x55d82d(0x8f)],_0x1fcaf2,'utf8');const _0xaae57c=Date[_0x55d82d(0x74)]()-_0xc9d4e7;logger['success']('router',_0x55d82d(0x7d),_0xaae57c,{'pageName':_0x576c48,'routePath':_0x424be,'componentName':_0x18bc4b});}catch(_0x3b2dc2){const _0x5e2471=Date[_0x55d82d(0x74)]()-_0xc9d4e7;logger[_0x55d82d(0x90)](_0x55d82d(0x9b),_0x55d82d(0x73),{'pageName':_0x576c48,'routePath':_0x424be,'error':_0x3b2dc2 instanceof Error?_0x3b2dc2[_0x55d82d(0x84)]:String(_0x3b2dc2),'duration':_0x5e2471});throw _0x3b2dc2;}}[a65_0x593a3e(0x77)](_0xfdd01c){const _0x2c6475=a65_0x593a3e;return _0xfdd01c[_0x2c6475(0x89)]('-')['map'](_0x32e95e=>_0x32e95e[_0x2c6475(0x8a)](0x0)['toUpperCase']()+_0x32e95e[_0x2c6475(0x72)](0x1)[_0x2c6475(0x7b)]())[_0x2c6475(0x98)]('');}['addImport'](_0x47d000,_0x5da588,_0x16ee5e){const _0x5b4afc=a65_0x593a3e,_0x208c1f=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x7dfbdd=_0x47d000[_0x5b4afc(0x7f)](_0x208c1f)||[],_0xe16149=_0x5b4afc(0x81)+_0x5da588+_0x5b4afc(0x97)+_0x16ee5e+'\x22;';if(_0x47d000[_0x5b4afc(0x87)](_0xe16149))return _0x47d000;if(_0x7dfbdd[_0x5b4afc(0x9e)]>0x0){const _0x2fde4b=_0x7dfbdd[_0x7dfbdd['length']-0x1];if(_0x2fde4b){const _0x76aec5=_0x47d000[_0x5b4afc(0x86)](_0x2fde4b),_0x5cf95a=_0x76aec5+_0x2fde4b[_0x5b4afc(0x9e)];return _0x47d000[_0x5b4afc(0x72)](0x0,_0x5cf95a)+_0xe16149+'\x0a'+_0x47d000[_0x5b4afc(0x72)](_0x5cf95a);}}const _0xf58860=_0x47d000[_0x5b4afc(0x7f)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0xf58860&&_0xf58860[_0x5b4afc(0x85)]!==undefined){const _0x55b0a4=_0xf58860[_0x5b4afc(0x85)]+_0xf58860[0x0][_0x5b4afc(0x9e)];return _0x47d000[_0x5b4afc(0x72)](0x0,_0x55b0a4)+_0xe16149+'\x0a'+_0x47d000[_0x5b4afc(0x72)](_0x55b0a4);}return _0x47d000;}['addRoute'](_0x559080,_0x4a28bc,_0x319fe7){const _0x69e84d=a65_0x593a3e,_0x5c56d0='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x4a28bc+_0x69e84d(0x9f)+_0x319fe7+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x559080['includes'](_0x69e84d(0x91)+_0x4a28bc+'\x22'))return _0x559080;const _0x467cad=/children:\s*\[([\s\S]*?)\]/,_0x330255=_0x559080[_0x69e84d(0x7f)](_0x467cad);if(!_0x330255||_0x330255[_0x69e84d(0x85)]===undefined)throw new Error(_0x69e84d(0x9d));const _0x513936=_0x330255[0x1],_0x296901=_0x330255[_0x69e84d(0x85)]+_0x330255[0x0][_0x69e84d(0x92)]('[')+0x1,_0x48f8f5=_0x513936?.[_0x69e84d(0x7f)](/\{[\s\S]*?\},/g)||[];if(_0x48f8f5[_0x69e84d(0x9e)]>0x0){const _0x546e76=_0x48f8f5[_0x48f8f5[_0x69e84d(0x9e)]-0x1];if(_0x546e76){const _0x56b4a4=_0x559080[_0x69e84d(0x86)](_0x546e76),_0x3e8e06=_0x56b4a4+_0x546e76['length'];return _0x559080[_0x69e84d(0x72)](0x0,_0x3e8e06)+'\x0a'+_0x5c56d0+_0x559080['slice'](_0x3e8e06);}}return _0x559080[_0x69e84d(0x72)](0x0,_0x296901)+'\x0a'+_0x5c56d0+_0x559080['slice'](_0x296901);}async[a65_0x593a3e(0x75)](_0x5f25fe,_0x13f577){const _0x3230e8=a65_0x593a3e;if(!a65_0x3a194f[_0x3230e8(0x8e)](this[_0x3230e8(0x8f)]))throw new Error('路由文件不存在:\x20'+this[_0x3230e8(0x8f)]);const _0x14d8b0=await a65_0x3a194f['promises'][_0x3230e8(0x76)](this[_0x3230e8(0x8f)],_0x3230e8(0x88)),_0x6f1368=this[_0x3230e8(0x77)](_0x5f25fe);let _0x517eba=this[_0x3230e8(0x8b)](_0x14d8b0,_0x6f1368,_0x5f25fe);return _0x517eba=this[_0x3230e8(0x7a)](_0x517eba,_0x13f577,_0x6f1368),_0x517eba;}}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x49de81){return new Promise(_0x54edc2=>setTimeout(_0x54edc2,_0x49de81));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x4d5938=a67_0x518b;function a67_0x5752(){const _0x5d9c1d=['success','processDirectory','toLocaleTimeString','.scss','name','902334TVajNJ','utf8','datasetCode:\x20\x22','.css','toDisplayTitle','.js','5017560HbYYVM','\x0a\x20\x20\x20\x20{\x20','extname','335WnTFcY','info','numeric','pop','api','tableName:\x20\x22','106680Hsmsqe','version','mkdir','map','9392aQwFQi','alias','.tpl','template','toComponentName','.json','toLowerCase','name:\x20\x22','isFile','6ilnRGV','processFile','now','11115KaIwEn','YourModel','readdir','5957532hnngwy','.jsx','datasetCode','endsWith','toLocaleDateString','processTemplate','charAt','toUpperCase','default','16969579fdhIGb','toISOString','split','1355712zRhrkF','replaceContent','slice','join','isDirectory','promises','\x20},','2-digit','2qDtCko','alias:\x20\x22','replace'];a67_0x5752=function(){return _0x5d9c1d;};return a67_0x5752();}function a67_0x518b(_0x486882,_0x3e339c){_0x486882=_0x486882-0x188;const _0x5752ea=a67_0x5752();let _0x518bc9=_0x5752ea[_0x486882];return _0x518bc9;}(function(_0xae1919,_0x4ebb2d){const _0x4b0f74=a67_0x518b,_0x3f34dc=_0xae1919();while(!![]){try{const _0x4acaf8=-parseInt(_0x4b0f74(0x1a0))/0x1+-parseInt(_0x4b0f74(0x1a8))/0x2*(-parseInt(_0x4b0f74(0x1b0))/0x3)+-parseInt(_0x4b0f74(0x1bf))/0x4*(-parseInt(_0x4b0f74(0x1b9))/0x5)+parseInt(_0x4b0f74(0x18e))/0x6*(parseInt(_0x4b0f74(0x194))/0x7)+-parseInt(_0x4b0f74(0x1c3))/0x8*(-parseInt(_0x4b0f74(0x191))/0x9)+-parseInt(_0x4b0f74(0x1b6))/0xa+-parseInt(_0x4b0f74(0x19d))/0xb;if(_0x4acaf8===_0x4ebb2d)break;else _0x3f34dc['push'](_0x3f34dc['shift']());}catch(_0x50cb20){_0x3f34dc['push'](_0x3f34dc['shift']());}}}(a67_0x5752,0xf153d));import a67_0x1ef214 from'node:fs';import a67_0x4569ea from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require('../../package.json')[a67_0x4d5938(0x1c0)];export class TemplateReplacer{static[a67_0x4d5938(0x189)](_0x1660b4){const _0x1d8208=a67_0x4d5938,_0x5c2dd6=_0x1660b4[_0x1d8208(0x19f)]('/')[_0x1d8208(0x1bc)]()||_0x1660b4;return _0x5c2dd6[_0x1d8208(0x19f)]('-')[_0x1d8208(0x1c2)](_0x359774=>_0x359774['charAt'](0x0)['toUpperCase']()+_0x359774[_0x1d8208(0x1a2)](0x1)[_0x1d8208(0x18b)]())[_0x1d8208(0x1a3)]('');}static[a67_0x4d5938(0x1b4)](_0x979c8a){const _0x595dcb=a67_0x4d5938,_0x2c3943=_0x979c8a['split']('/')[_0x595dcb(0x1bc)]()||_0x979c8a;return _0x2c3943['split']('-')[_0x595dcb(0x1c2)](_0x5113ca=>_0x5113ca[_0x595dcb(0x19a)](0x0)[_0x595dcb(0x19b)]()+_0x5113ca['slice'](0x1)[_0x595dcb(0x18b)]())[_0x595dcb(0x1a3)]('\x20');}static['replaceContent'](_0x19b416,_0x41a5d6,_0x3438c3){const _0x2906f1=a67_0x4d5938,_0x49c648=this[_0x2906f1(0x189)](_0x41a5d6),_0x3deb6c=this[_0x2906f1(0x1b4)](_0x41a5d6),_0x30beae=new Date(),_0x352a1a=_0x30beae['toLocaleString'](undefined,{'year':_0x2906f1(0x1bb),'month':_0x2906f1(0x1a7),'day':_0x2906f1(0x1a7),'hour':_0x2906f1(0x1a7),'minute':_0x2906f1(0x1a7),'second':_0x2906f1(0x1a7),'hour12':![]})[_0x2906f1(0x1aa)](/\//g,'-'),_0x327d7b=_0x30beae[_0x2906f1(0x198)](undefined,{'year':'numeric','month':_0x2906f1(0x1a7),'day':'2-digit'})[_0x2906f1(0x1aa)](/\//g,'-'),_0x4d226e=_0x30beae[_0x2906f1(0x1ad)](undefined,{'hour12':![]});let _0x21eeca=_0x19b416[_0x2906f1(0x1aa)](/\{CliVersion\}/g,CLI_VERSION)[_0x2906f1(0x1aa)](/\{ComponentName\}/g,_0x49c648)[_0x2906f1(0x1aa)](/\{DisplayTitle\}/g,_0x3deb6c)[_0x2906f1(0x1aa)](/\{PageName\}/g,_0x41a5d6)[_0x2906f1(0x1aa)](/\{TemplateName\}/g,_0x3438c3)[_0x2906f1(0x1aa)](/\{CreatedAt\}/g,_0x352a1a)[_0x2906f1(0x1aa)](/\{CreatedDate\}/g,_0x327d7b)[_0x2906f1(0x1aa)](/\{CreatedTime\}/g,_0x4d226e);return _0x21eeca;}static['replaceApiContent'](_0x25ab33,_0x26967c,_0x462fda,_0x15d1d4,_0x43bf98,_0x4a9098,_0x884cf3){const _0x1d0ab5=a67_0x4d5938,_0x498108=new Date(),_0x2b9aff=_0x498108[_0x1d0ab5(0x19e)](),_0x587c50=_0x462fda['map'](_0x117f2b=>{const _0x111acd=_0x1d0ab5,_0x3ed05f=[_0x111acd(0x1b2)+_0x117f2b[_0x111acd(0x196)]+'\x22',_0x111acd(0x1be)+_0x117f2b['tableName']+'\x22',_0x111acd(0x18c)+_0x117f2b[_0x111acd(0x1af)]+'\x22'];return _0x117f2b['alias']&&_0x3ed05f['push'](_0x111acd(0x1a9)+_0x117f2b[_0x111acd(0x1c4)]+'\x22'),_0x111acd(0x1b7)+_0x3ed05f[_0x111acd(0x1a3)](',\x20')+_0x111acd(0x1a6);})[_0x1d0ab5(0x1a3)](''),_0x33e6b3=_0x15d1d4||_0x462fda[0x0]?.[_0x1d0ab5(0x1c4)]||_0x1d0ab5(0x192);let _0x2ee52d=_0x25ab33[_0x1d0ab5(0x1aa)](/\{AppCode\}/g,_0x26967c)[_0x1d0ab5(0x1aa)](/\{ModelConfigs\}/g,_0x587c50)[_0x1d0ab5(0x1aa)](/\{ExampleModelName\}/g,_0x33e6b3)[_0x1d0ab5(0x1aa)](/\{ApiFileName\}/g,_0x43bf98||_0x1d0ab5(0x1bd))[_0x1d0ab5(0x1aa)](/\{ConfigName\}/g,_0x4a9098||_0x1d0ab5(0x19c))['replace'](/\{ClientConfigParam\}/g,_0x884cf3||'')[_0x1d0ab5(0x1aa)](/\{CreatedAt\}/g,_0x2b9aff);return _0x2ee52d;}static async[a67_0x4d5938(0x199)](_0x270eeb,_0x1bd18e,_0x2ad467,_0x429a07,_0x5ad26a=!![]){const _0x32c14c=a67_0x4d5938,_0x46db20=Date['now']();try{_0x5ad26a&&logger[_0x32c14c(0x1ba)](_0x32c14c(0x188),'开始处理模板内容替换',{'templatePath':_0x270eeb,'targetPath':_0x1bd18e,'pageName':_0x2ad467,'templateName':_0x429a07});await a67_0x1ef214[_0x32c14c(0x1a5)][_0x32c14c(0x1c1)](_0x1bd18e,{'recursive':!![]}),await this[_0x32c14c(0x1ac)](_0x270eeb,_0x1bd18e,_0x2ad467,_0x429a07);if(_0x5ad26a){const _0x10ad78=Date[_0x32c14c(0x190)]()-_0x46db20;logger[_0x32c14c(0x1ab)]('template','模板内容替换完成',_0x10ad78,{'pageName':_0x2ad467,'templateName':_0x429a07});}}catch(_0x4c3072){if(_0x5ad26a){const _0x264b8c=Date['now']()-_0x46db20;logger['error'](_0x32c14c(0x188),'模板内容替换失败',{'templatePath':_0x270eeb,'targetPath':_0x1bd18e,'pageName':_0x2ad467,'templateName':_0x429a07,'error':_0x4c3072 instanceof Error?_0x4c3072['message']:String(_0x4c3072),'duration':_0x264b8c});}throw _0x4c3072;}}static async[a67_0x4d5938(0x1ac)](_0x24e2b7,_0x2f69e1,_0x2c1e71,_0xd1bce6){const _0x1afdd8=a67_0x4d5938,_0x3f9186=await a67_0x1ef214[_0x1afdd8(0x1a5)][_0x1afdd8(0x193)](_0x24e2b7,{'withFileTypes':!![]});for(const _0x3183a3 of _0x3f9186){const _0x5cf19a=a67_0x4569ea[_0x1afdd8(0x1a3)](_0x24e2b7,_0x3183a3[_0x1afdd8(0x1af)]);let _0x4fcf0f=a67_0x4569ea['join'](_0x2f69e1,_0x3183a3[_0x1afdd8(0x1af)]);_0x3183a3['name'][_0x1afdd8(0x197)](_0x1afdd8(0x1c5))&&(_0x4fcf0f=a67_0x4569ea[_0x1afdd8(0x1a3)](_0x2f69e1,_0x3183a3[_0x1afdd8(0x1af)]['replace'](/\.tpl$/,'')));if(_0x3183a3[_0x1afdd8(0x1a4)]())await a67_0x1ef214[_0x1afdd8(0x1a5)][_0x1afdd8(0x1c1)](_0x4fcf0f,{'recursive':!![]}),await this[_0x1afdd8(0x1ac)](_0x5cf19a,_0x4fcf0f,_0x2c1e71,_0xd1bce6);else _0x3183a3[_0x1afdd8(0x18d)]()&&await this[_0x1afdd8(0x18f)](_0x5cf19a,_0x4fcf0f,_0x2c1e71,_0xd1bce6);}}static async[a67_0x4d5938(0x18f)](_0x5c6cfa,_0x5ecbf1,_0x201766,_0x5808d2){const _0xb76a3e=a67_0x4d5938,_0x593945=a67_0x4569ea[_0xb76a3e(0x1b8)](_0x5c6cfa)['toLowerCase']();_0x5c6cfa[_0xb76a3e(0x197)](_0xb76a3e(0x1c5))&&(_0x5ecbf1=_0x5ecbf1['replace'](/\.tpl$/,''));const _0x37759f=['.tsx','.ts',_0xb76a3e(0x195),_0xb76a3e(0x1b5),_0xb76a3e(0x18a),'.md',_0xb76a3e(0x1b3),_0xb76a3e(0x1ae),_0xb76a3e(0x1c5)];if(_0x37759f['includes'](_0x593945)||_0x5c6cfa[_0xb76a3e(0x197)](_0xb76a3e(0x1c5))){const _0x2efde5=await a67_0x1ef214[_0xb76a3e(0x1a5)]['readFile'](_0x5c6cfa,_0xb76a3e(0x1b1)),_0x547373=this[_0xb76a3e(0x1a1)](_0x2efde5,_0x201766,_0x5808d2);await a67_0x1ef214[_0xb76a3e(0x1a5)]['writeFile'](_0x5ecbf1,_0x547373,_0xb76a3e(0x1b1));}else await a67_0x1ef214[_0xb76a3e(0x1a5)]['copyFile'](_0x5c6cfa,_0x5ecbf1);}}
|