@lovrabet/cli 1.3.1 → 1.3.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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-flags.js +1 -0
- 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/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/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/router-updater.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x10810b,_0xd7223){const _0x1f60ef=a61_0xd72a,_0x279f18=_0x10810b();while(!![]){try{const _0x1f0a52=-parseInt(_0x1f60ef(0x179))/0x1+-parseInt(_0x1f60ef(0x18b))/0x2*(-parseInt(_0x1f60ef(0x19f))/0x3)+parseInt(_0x1f60ef(0x186))/0x4*(-parseInt(_0x1f60ef(0x183))/0x5)+-parseInt(_0x1f60ef(0x1a2))/0x6*(parseInt(_0x1f60ef(0x18c))/0x7)+-parseInt(_0x1f60ef(0x181))/0x8+parseInt(_0x1f60ef(0x17b))/0x9+parseInt(_0x1f60ef(0x176))/0xa;if(_0x1f0a52===_0xd7223)break;else _0x279f18['push'](_0x279f18['shift']());}catch(_0x7fa435){_0x279f18['push'](_0x279f18['shift']());}}}(a61_0xdd68,0x6f346));import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,CORE_IDE_LIST,ALL_CORE_IDES}from'../utils/ai_config.js';function a61_0xd72a(_0x2e3621,_0x2acbab){_0x2e3621=_0x2e3621-0x166;const _0xdd6833=a61_0xdd68();let _0xd72a1f=_0xdd6833[_0x2e3621];return _0xd72a1f;}import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export async function skillsCommand(_0x4792a4,_0x58a6a4,_0x3a7558){const _0x19783f=a61_0xd72a;logger[_0x19783f(0x1a9)](process[_0x19783f(0x170)]());if(_0x3a7558?.['help']||_0x4792a4===_0x19783f(0x16f)){showHelp();return;}_0x4792a4!==_0x19783f(0x19e)&&(console[_0x19783f(0x17d)](_0x19783f(0x191)+(_0x4792a4||_0x19783f(0x17a))),console[_0x19783f(0x182)](_0x19783f(0x194)),console[_0x19783f(0x182)](_0x19783f(0x1ae)),console[_0x19783f(0x182)]('\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包'),console[_0x19783f(0x182)]('\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a'),console[_0x19783f(0x182)]('使用示例:'),console['log'](_0x19783f(0x173)),console[_0x19783f(0x182)](_0x19783f(0x1a1)),logger[_0x19783f(0x17d)](_0x19783f(0x1ad),_0x19783f(0x195)+_0x4792a4),process[_0x19783f(0x16a)](0x1)),await installSkill(_0x58a6a4?.[0x0]);}async function selectIDEs(){const _0x19f528=a61_0xd72a;return console[_0x19f528(0x182)](_0x19f528(0x16c)),CORE_IDE_LIST[_0x19f528(0x19a)]((_0xac9be8,_0x1c8c14)=>{const _0x2bc9cb=_0x19f528;console['log']('\x20\x20'+(_0x1c8c14+0x1)+'.\x20'+IDE_CONFIGS[_0xac9be8]['name']+_0x2bc9cb(0x17f)+IDE_CONFIGS[_0xac9be8][_0x2bc9cb(0x193)]);}),console[_0x19f528(0x182)](_0x19f528(0x199)),console[_0x19f528(0x182)]('\x20\x20q.\x20取消\x0a'),console[_0x19f528(0x182)](_0x19f528(0x16b)),console[_0x19f528(0x182)](_0x19f528(0x19c)),new Promise(_0x5cf151=>{const _0x49d1f2=_0x19f528,_0x413385=createInterface({'input':process['stdin'],'output':process[_0x49d1f2(0x180)]});_0x413385[_0x49d1f2(0x16d)]('请选择:\x20',_0x9286de=>{const _0x7290f0=_0x49d1f2;_0x413385['close']();const _0x56e31c=_0x9286de[_0x7290f0(0x198)]()[_0x7290f0(0x185)]();(_0x56e31c==='q'||_0x56e31c===_0x7290f0(0x167)||_0x56e31c==='exit')&&(console['log']('\x0a已取消安装\x0a'),process[_0x7290f0(0x16a)](0x0));if(_0x56e31c==='0'||_0x56e31c===_0x7290f0(0x1aa)){_0x5cf151([_0x7290f0(0x1aa)]);return;}const _0x5e243e=_0x56e31c[_0x7290f0(0x192)](/\s+/)['filter'](Boolean),_0x2b1e1f=[];for(const _0x52c5e3 of _0x5e243e){const _0x35be82=parseInt(_0x52c5e3,0xa);if(!isNaN(_0x35be82)&&_0x35be82>=0x1&&_0x35be82<=CORE_IDE_LIST[_0x7290f0(0x169)]){const _0x54ff26=CORE_IDE_LIST[_0x35be82-0x1];_0x54ff26&&!_0x2b1e1f[_0x7290f0(0x184)](_0x54ff26)&&_0x2b1e1f[_0x7290f0(0x188)](_0x54ff26);}}_0x2b1e1f['length']===0x0&&(console[_0x7290f0(0x182)](_0x7290f0(0x17c)),process[_0x7290f0(0x16a)](0x0)),_0x5cf151(_0x2b1e1f);});});}function showHelp(){const _0x10744b=a61_0xd72a;console['log'](_0x10744b(0x1ab));}function a61_0xdd68(){const _0x2d6cff=['trim','\x20\x200.\x20全部安装','forEach','some','输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a','2.0.0','install','6GkhLRR','\x20失败:\x20','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a','6GVBFag','message','startsWith','正在从\x20CDN\x20拉取开发者指南...','通用模板','warn','name','setLogPath','all','\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--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-\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.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','✓\x20拉取\x20','skill','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包','开发者指南位置:','quit','安装成功','length','exit','输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)','\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a','question','\x20\x20!\x20CDN\x20拉取失败,跳过指南安装:\x20','--help','cwd','path','info','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE','✓\x20创建\x20.lovrabet/skill-manifest.json','agent','20240340kRjsgs','keys','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','397122HTeDXY','(空)','187119oPImek','\x0a未选择任何\x20IDE,安装取消\x0a','error','files','\x20-\x20','stdout','49096GmXbtP','log','255tLdZGY','includes','toLowerCase','29444hETsvi','\x20\x20✓\x20创建\x20','push','toISOString','\x0a📦\x20正在安装\x20','43144htyXDa','5976635SUJnJI','guides','.lovrabet/skill-manifest.json','folders','../../cdn-source/skills','错误:\x20不支持的命令:\x20','split','description','\x0a可用命令:','不支持的命令:\x20','\x0a没有有效的\x20IDE\x20需要安装\x0a','.lovrabet'];a61_0xdd68=function(){return _0x2d6cff;};return a61_0xdd68();}async function installSkill(_0x5a7e35){const _0x33ee45=a61_0xd72a,_0x471c00=process[_0x33ee45(0x170)](),_0x1d582f=resolve(__dirname,_0x33ee45(0x190));let _0x5b541a=[];!_0x5a7e35?_0x5b541a=await selectIDEs():_0x5b541a=[_0x5a7e35];_0x5b541a[_0x33ee45(0x184)](_0x33ee45(0x1aa))&&(_0x5b541a=[...ALL_CORE_IDES,_0x33ee45(0x175)]);const _0x33b780=[];for(const _0x2c63aa of _0x5b541a){if(_0x2c63aa===_0x33ee45(0x175))_0x33b780[_0x33ee45(0x188)]('agent');else{if(_0x2c63aa===_0x33ee45(0x1aa))continue;else IDE_CONFIGS[_0x2c63aa]?_0x33b780[_0x33ee45(0x188)](_0x2c63aa):(console[_0x33ee45(0x182)]('⚠️\x20\x20未知的平台:\x20'+_0x2c63aa+',使用通用模板'),_0x33b780[_0x33ee45(0x188)](_0x33ee45(0x175)));}}_0x33b780['length']===0x0&&(console[_0x33ee45(0x182)](_0x33ee45(0x196)),process[_0x33ee45(0x16a)](0x0));console[_0x33ee45(0x182)](_0x33ee45(0x1a5));let _0x39690b;try{_0x39690b=await fetchGuidesFromCDN(),console[_0x33ee45(0x182)](_0x33ee45(0x1ac)+Object[_0x33ee45(0x177)](_0x39690b[_0x33ee45(0x18d)])['length']+'\x20个开发者指南');}catch(_0x5ed6de){console[_0x33ee45(0x1a7)](_0x33ee45(0x16e)+(_0x5ed6de instanceof Error?_0x5ed6de[_0x33ee45(0x1a3)]:String(_0x5ed6de)));}let _0x5054ba=0x0;for(const _0x30dda0 of _0x33b780){try{const _0x1bca91=_0x30dda0==='agent'?_0x33ee45(0x1a6):IDE_CONFIGS[_0x30dda0]?.[_0x33ee45(0x1a8)]||_0x30dda0;console[_0x33ee45(0x182)](_0x33ee45(0x18a)+_0x1bca91+'...\x0a');const _0xe70c95=_0x30dda0==='agent'?undefined:IDE_CONFIGS[_0x30dda0],_0x5d4913=await installSingleIDE(_0x30dda0,_0xe70c95,_0x471c00,_0x1d582f,_0x39690b);_0x5054ba+=_0x5d4913;if(_0xe70c95?.[_0x33ee45(0x18f)])for(const _0x1434ca of _0xe70c95[_0x33ee45(0x18f)]){const _0x2307b2=_0xe70c95['files']?.[_0x33ee45(0x19b)](_0x41a9c2=>_0x41a9c2[_0x33ee45(0x171)][_0x33ee45(0x1a4)](_0x1434ca+'/'))??![];_0x2307b2?console[_0x33ee45(0x182)](_0x33ee45(0x187)+_0x1434ca+'/'):console[_0x33ee45(0x182)]('\x20\x20✓\x20创建\x20'+_0x1434ca);}if(_0xe70c95?.[_0x33ee45(0x17e)])for(const _0x10cd94 of _0xe70c95[_0x33ee45(0x17e)]){console[_0x33ee45(0x182)]('\x20\x20✓\x20创建\x20'+_0x10cd94[_0x33ee45(0x171)]);}}catch(_0x256179){console['error']('\x20\x20✗\x20安装\x20'+_0x30dda0+_0x33ee45(0x1a0)+(_0x256179 instanceof Error?_0x256179['message']:String(_0x256179)));}}_0x39690b&&writeGuidesToProject(_0x39690b,_0x471c00);const _0x277a9c={'version':_0x33ee45(0x19d),'installedAt':new Date()[_0x33ee45(0x189)](),'platforms':_0x33b780},_0x2d0cf8=join(_0x471c00,_0x33ee45(0x18e)),_0x563be8=join(_0x471c00,_0x33ee45(0x197));await copyDir(_0x563be8,_0x563be8),writeFileSync(_0x2d0cf8,JSON['stringify'](_0x277a9c,null,0x2),'utf-8'),console[_0x33ee45(0x182)](_0x33ee45(0x174)),console[_0x33ee45(0x182)]('\x0a✓\x20技能包安装成功!共安装\x20'+_0x5054ba+'\x20个目录\x0a'),console['log'](_0x33ee45(0x166)),console[_0x33ee45(0x182)](_0x33ee45(0x178)),logger[_0x33ee45(0x172)]('skill-install',_0x33ee45(0x168),{'projectRoot':_0x471c00,'ides':_0x33b780,'foldersCount':_0x5054ba});}
|
|
1
|
+
(function(_0x2aa9d3,_0x148ec7){const _0x23c919=a62_0x38e0,_0x23af19=_0x2aa9d3();while(!![]){try{const _0x2769ef=parseInt(_0x23c919(0x203))/0x1+-parseInt(_0x23c919(0x1da))/0x2*(-parseInt(_0x23c919(0x1ee))/0x3)+parseInt(_0x23c919(0x1e2))/0x4+-parseInt(_0x23c919(0x207))/0x5*(parseInt(_0x23c919(0x1ed))/0x6)+-parseInt(_0x23c919(0x1d7))/0x7+-parseInt(_0x23c919(0x20c))/0x8+parseInt(_0x23c919(0x215))/0x9*(-parseInt(_0x23c919(0x20f))/0xa);if(_0x2769ef===_0x148ec7)break;else _0x23af19['push'](_0x23af19['shift']());}catch(_0x305303){_0x23af19['push'](_0x23af19['shift']());}}}(a62_0x4d43,0xce022));import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';function a62_0x38e0(_0x1c41b3,_0x764471){_0x1c41b3=_0x1c41b3-0x1c6;const _0x4d4366=a62_0x4d43();let _0x38e000=_0x4d4366[_0x1c41b3];return _0x38e000;}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';function a62_0x4d43(){const _0x351514=['argv','.lovrabet/skill-manifest.json','split','some','-$1','description','filter','forEach','path','utf-8','输入\x200\x20安装所有\x20IDE,输入\x20q\x20取消\x0a','.lovrabet','2.0.0','\x20\x20q.\x20取消\x0a','includes','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\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','warn','1574428EiYxft','from','skill-install','✓\x20拉取\x20','45adsCCe','输入格式:\x20输入编号,用空格分隔\x20(例如:\x201\x203\x205)','message','不支持的命令:\x20','slice','2255224SBRpGm','.lovrabet/skill/.shared/guides','\x0a已取消安装\x0a','20pFdtjy','✓\x20创建\x20.lovrabet/skill-manifest.json','help','exit','\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20#\x20直接安装指定\x20IDE\x20的技能包','\x20-\x20','4442256PGiNbg','agent','install','../../cdn-source/skills','setLogPath','length','keys','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择并安装技能包','\x20个目录\x0a','log','\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20交互式选择\x20IDE','push','...\x0a','\x20\x20✓\x20创建\x20','close','skill','error','\x0a没有有效的\x20IDE\x20需要安装\x0a','\x20个开发者指南','\x20\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','all','567686aIhUdM','\x0a请选择要安装技能包的\x20IDE\x20(可多选):\x0a','\x0a未选择任何\x20IDE,安装取消\x0a','14218ZcHIXC','(含扩展)','files','guides','name','\x0a可用命令:','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20\x20#\x20直接安装\x20Cursor\x20技能包\x0a','replace','930832kTVULT','⚠️\x20\x20未知的平台:\x20','stringify','\x20\x20✗\x20安装\x20','toLowerCase','cwd','stdout','stdin','...','folders','(空)','102294doVflz','228dUFNpe','startsWith'];a62_0x4d43=function(){return _0x351514;};return a62_0x4d43();}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x23a11b){const _0x5a939d=a62_0x38e0,_0x31b451=[];for(const [_0x57ff08,_0x51ce3e]of Object['entries'](_0x23a11b)){if(_0x51ce3e===!![]){const _0x25fc2e=_0x57ff08[_0x5a939d(0x1e1)](/([A-Z])/g,_0x5a939d(0x1f4))[_0x5a939d(0x1e6)]();_0x31b451['push'](_0x25fc2e);}}return _0x31b451;}export function parseDynamicFlags(){const _0x167aa1=a62_0x38e0,_0xb21d78=[];for(let _0x37078f=0x3;_0x37078f<process[_0x167aa1(0x1f0)][_0x167aa1(0x1c7)];_0x37078f++){const _0x3d18a2=process[_0x167aa1(0x1f0)][_0x37078f];if(_0x3d18a2&&_0x3d18a2[_0x167aa1(0x1ef)]('--')){const _0x358338=_0x3d18a2[_0x167aa1(0x20b)](0x2);_0x358338&&!_0x358338[_0x167aa1(0x1fe)]('=')&&_0xb21d78['push'](_0x358338);}}return _0xb21d78;}export function getAllProvidedFlags(_0x2b8514){const _0x42f2ca=a62_0x38e0,_0x1ca3b8=camelCaseFlagsToKebab(_0x2b8514),_0x159f85=parseDynamicFlags(),_0x1bca28=new Set([..._0x1ca3b8,..._0x159f85]);return Array[_0x42f2ca(0x204)](_0x1bca28);}export async function skillsCommand(_0x5f06a9,_0x263688,_0x12ad6c){const _0x58cb86=a62_0x38e0;logger[_0x58cb86(0x1c6)](process[_0x58cb86(0x1e7)]());if(_0x12ad6c?.[_0x58cb86(0x211)]||_0x5f06a9==='--help'){showHelp();return;}_0x5f06a9!==_0x58cb86(0x217)&&(console[_0x58cb86(0x1d2)]('错误:\x20不支持的命令:\x20'+(_0x5f06a9||_0x58cb86(0x1ec))),console[_0x58cb86(0x1cb)](_0x58cb86(0x1df)),console['log'](_0x58cb86(0x1c9)),console[_0x58cb86(0x1cb)](_0x58cb86(0x213)),console['log']('\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a'),console['log']('使用示例:'),console[_0x58cb86(0x1cb)](_0x58cb86(0x1cc)),console['log'](_0x58cb86(0x1e0)),logger['error'](_0x58cb86(0x1d1),_0x58cb86(0x20a)+_0x5f06a9),process[_0x58cb86(0x212)](0x1));let _0x27b03d=_0x263688?.[0x0];const _0x59e44e=getAllProvidedFlags(_0x12ad6c??{});_0x27b03d?.[_0x58cb86(0x1ef)]('--')&&(_0x27b03d=undefined),await installSkill(_0x27b03d??_0x58cb86(0x216),_0x59e44e);}async function selectIDEs(){const _0x3e4e13=a62_0x38e0;return console[_0x3e4e13(0x1cb)](_0x3e4e13(0x1d8)),CORE_IDE_LIST[_0x3e4e13(0x1f7)]((_0x2be655,_0x417683)=>{const _0x4d7fac=_0x3e4e13;console[_0x4d7fac(0x1cb)]('\x20\x20'+(_0x417683+0x1)+'.\x20'+IDE_CONFIGS[_0x2be655]['name']+_0x4d7fac(0x214)+IDE_CONFIGS[_0x2be655][_0x4d7fac(0x1f5)]);}),console[_0x3e4e13(0x1cb)]('\x20\x200.\x20全部安装'),console['log'](_0x3e4e13(0x1fd)),console[_0x3e4e13(0x1cb)](_0x3e4e13(0x208)),console[_0x3e4e13(0x1cb)](_0x3e4e13(0x1fa)),new Promise(_0x40da42=>{const _0x20abf6=_0x3e4e13,_0x3afb89=createInterface({'input':process[_0x20abf6(0x1e9)],'output':process[_0x20abf6(0x1e8)]});_0x3afb89[_0x20abf6(0x1ff)]('请选择:\x20',_0x5a4790=>{const _0x4b1bc2=_0x20abf6;_0x3afb89[_0x4b1bc2(0x1d0)]();const _0x12a465=_0x5a4790['trim']()[_0x4b1bc2(0x1e6)]();(_0x12a465==='q'||_0x12a465==='quit'||_0x12a465===_0x4b1bc2(0x212))&&(console[_0x4b1bc2(0x1cb)](_0x4b1bc2(0x20e)),process[_0x4b1bc2(0x212)](0x0));if(_0x12a465==='0'||_0x12a465===_0x4b1bc2(0x1d6)){_0x40da42(['all']);return;}const _0xa999d1=_0x12a465[_0x4b1bc2(0x1f2)](/\s+/)[_0x4b1bc2(0x1f6)](Boolean),_0x31928f=[];for(const _0x4427cd of _0xa999d1){const _0x48b51d=parseInt(_0x4427cd,0xa);if(!isNaN(_0x48b51d)&&_0x48b51d>=0x1&&_0x48b51d<=CORE_IDE_LIST[_0x4b1bc2(0x1c7)]){const _0x10b0cb=CORE_IDE_LIST[_0x48b51d-0x1];_0x10b0cb&&!_0x31928f[_0x4b1bc2(0x1fe)](_0x10b0cb)&&_0x31928f['push'](_0x10b0cb);}}_0x31928f['length']===0x0&&(console[_0x4b1bc2(0x1cb)](_0x4b1bc2(0x1d9)),process[_0x4b1bc2(0x212)](0x0)),_0x40da42(_0x31928f);});});}function showHelp(){const _0x55d35b=a62_0x38e0;console[_0x55d35b(0x1cb)](_0x55d35b(0x201));}async function installSkill(_0x2c1980,_0x2d0c71){const _0x21ed81=a62_0x38e0,_0x545f59=process[_0x21ed81(0x1e7)](),_0x3e7548=resolve(__dirname,_0x21ed81(0x218));let _0x1ab5c1=[];!_0x2c1980?_0x1ab5c1=await selectIDEs():_0x1ab5c1=[_0x2c1980];_0x1ab5c1[_0x21ed81(0x1fe)](_0x21ed81(0x1d6))&&(_0x1ab5c1=[...ALL_CORE_IDES,_0x21ed81(0x216)]);const _0x31a9a0=[];for(const _0x1344b4 of _0x1ab5c1){if(_0x1344b4===_0x21ed81(0x216))_0x31a9a0[_0x21ed81(0x1cd)](_0x21ed81(0x216));else{if(_0x1344b4==='all')continue;else IDE_CONFIGS[_0x1344b4]?_0x31a9a0[_0x21ed81(0x1cd)](_0x1344b4):(console[_0x21ed81(0x1cb)](_0x21ed81(0x1e3)+_0x1344b4+',使用通用模板'),_0x31a9a0[_0x21ed81(0x1cd)](_0x21ed81(0x216)));}}_0x31a9a0[_0x21ed81(0x1c7)]===0x0&&(console[_0x21ed81(0x1cb)](_0x21ed81(0x1d3)),process['exit'](0x0));const _0x38e333=_0x2d0c71&&_0x2d0c71[_0x21ed81(0x1c7)]>0x0;console[_0x21ed81(0x1cb)]('正在从\x20CDN\x20拉取开发者指南'+(_0x38e333?_0x21ed81(0x1db):'')+_0x21ed81(0x1ea));let _0x405879;try{_0x405879=await fetchGuidesFromCDN(_0x38e333),console['log'](_0x21ed81(0x206)+Object[_0x21ed81(0x1c8)](_0x405879[_0x21ed81(0x1dd)])[_0x21ed81(0x1c7)]+_0x21ed81(0x1d4));}catch(_0x23abf4){console[_0x21ed81(0x202)]('\x20\x20!\x20CDN\x20拉取失败,跳过指南安装:\x20'+(_0x23abf4 instanceof Error?_0x23abf4[_0x21ed81(0x209)]:String(_0x23abf4)));}let _0x52fee0=0x0;for(const _0x20a1bd of _0x31a9a0){try{const _0x56d855=_0x20a1bd===_0x21ed81(0x216)?'通用模板':IDE_CONFIGS[_0x20a1bd]?.[_0x21ed81(0x1de)]||_0x20a1bd;console['log']('\x0a📦\x20正在安装\x20'+_0x56d855+_0x21ed81(0x1ce));const _0x43f7ee=_0x20a1bd===_0x21ed81(0x216)?undefined:IDE_CONFIGS[_0x20a1bd],_0x53c010=await installSingleIDE(_0x20a1bd,_0x43f7ee,_0x545f59,_0x3e7548,_0x405879,_0x2d0c71);_0x52fee0+=_0x53c010;if(_0x43f7ee?.[_0x21ed81(0x1eb)])for(const _0x50709c of _0x43f7ee[_0x21ed81(0x1eb)]){const _0x20dc4c=_0x43f7ee[_0x21ed81(0x1dc)]?.[_0x21ed81(0x1f3)](_0x5bf487=>_0x5bf487[_0x21ed81(0x1f8)][_0x21ed81(0x1ef)](_0x50709c+'/'))??![];_0x20dc4c?console[_0x21ed81(0x1cb)](_0x21ed81(0x1cf)+_0x50709c+'/'):console[_0x21ed81(0x1cb)](_0x21ed81(0x1cf)+_0x50709c);}if(_0x43f7ee?.[_0x21ed81(0x1dc)])for(const _0x745dd6 of _0x43f7ee[_0x21ed81(0x1dc)]){console[_0x21ed81(0x1cb)]('\x20\x20✓\x20创建\x20'+_0x745dd6[_0x21ed81(0x1f8)]);}}catch(_0xa9b58){console[_0x21ed81(0x1d2)](_0x21ed81(0x1e5)+_0x20a1bd+'\x20失败:\x20'+(_0xa9b58 instanceof Error?_0xa9b58[_0x21ed81(0x209)]:String(_0xa9b58)));}}_0x405879&&writeGuidesToProject(_0x405879,_0x545f59,_0x21ed81(0x20d),_0x2d0c71);const _0x3f6011={'version':_0x21ed81(0x1fc),'installedAt':new Date()['toISOString'](),'platforms':_0x31a9a0},_0x578b14=join(_0x545f59,_0x21ed81(0x1f1)),_0x2a32fd=join(_0x545f59,_0x21ed81(0x1fb));await copyDir(_0x2a32fd,_0x2a32fd),writeFileSync(_0x578b14,JSON[_0x21ed81(0x1e4)](_0x3f6011,null,0x2),_0x21ed81(0x1f9)),console[_0x21ed81(0x1cb)](_0x21ed81(0x210)),console[_0x21ed81(0x1cb)]('\x0a✓\x20技能包安装成功!共安装\x20'+_0x52fee0+_0x21ed81(0x1ca)),console['log']('开发者指南位置:'),console[_0x21ed81(0x1cb)](_0x21ed81(0x1d5)),logger['info'](_0x21ed81(0x205),_0x21ed81(0x200),{'projectRoot':_0x545f59,'ides':_0x31a9a0,'foldersCount':_0x52fee0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xba27e,_0xa1181b){const _0xf679d1=a63_0x27bf,_0x3d7af8=_0xba27e();while(!![]){try{const _0x2699ea=-parseInt(_0xf679d1(0x1d0))/0x1+parseInt(_0xf679d1(0x1c7))/0x2*(-parseInt(_0xf679d1(0x1d1))/0x3)+parseInt(_0xf679d1(0x1be))/0x4*(-parseInt(_0xf679d1(0x1de))/0x5)+parseInt(_0xf679d1(0x1d3))/0x6+-parseInt(_0xf679d1(0x1bd))/0x7*(parseInt(_0xf679d1(0x1cc))/0x8)+parseInt(_0xf679d1(0x1c1))/0x9+parseInt(_0xf679d1(0x1cb))/0xa;if(_0x2699ea===_0xa1181b)break;else _0x3d7af8['push'](_0x3d7af8['shift']());}catch(_0x47537d){_0x3d7af8['push'](_0x3d7af8['shift']());}}}(a63_0x49f1,0x63dbf));import{writeFileSync,existsSync,mkdirSync}from'node:fs';import{resolve,join}from'node:path';function a63_0x27bf(_0x4a27b6,_0x36c992){_0x4a27b6=_0x4a27b6-0x1b8;const _0x49f155=a63_0x49f1();let _0x27bf41=_0x49f155[_0x4a27b6];return _0x27bf41;}import{fileURLToPath}from'node:url';import{dirname}from'node:path';function a63_0x49f1(){const _0x409944=['warn','message','\x0a✓\x20技能包安装成功!共安装\x20','2imlPGv','.lovrabet/skill-manifest.json','error','toISOString','265470USlSRt','88CsCEGZ','utf-8','length','\x20\x20✓\x20','110279GTAQul','144708UemCSp','\x20个开发者指南','3486756SfDmLx','../../cdn-source/skills','setLogPath','...','skill-install-non-interactive','\x20\x20✗\x20未知的\x20IDE:\x20','开始安装技能包','log','guides','.lovrabet/skill/.shared/guides','正在从\x20CDN\x20拉取开发者指南','474645ncgIfF','✓\x20拉取\x20','2.0.0','.lovrabet','安装成功','info','217112hpGziH','4gnsmlI','\x20个目录','keys','3563730RKgbuH','name','\x20失败:\x20'];a63_0x49f1=function(){return _0x409944;};return a63_0x49f1();}import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export async function installSkillsNonInteractive(_0x320e71,_0x56166d,_0x57c4b7=process['cwd']()){const _0x4856ef=a63_0x27bf,_0x6e7fc9=resolve(__dirname,_0x4856ef(0x1d4));logger[_0x4856ef(0x1d5)](_0x57c4b7),logger[_0x4856ef(0x1bc)](_0x4856ef(0x1d7),_0x4856ef(0x1d9),{'ides':_0x320e71});const _0x6b7e5d=join(_0x57c4b7,_0x4856ef(0x1ba));!existsSync(_0x6b7e5d)&&mkdirSync(_0x6b7e5d,{'recursive':!![]});const _0x54f824=_0x56166d&&_0x56166d[_0x4856ef(0x1ce)]>0x0;console[_0x4856ef(0x1da)](_0x4856ef(0x1dd)+(_0x54f824?'(含扩展)':'')+_0x4856ef(0x1d6));let _0x1a380b;try{_0x1a380b=await fetchGuidesFromCDN(_0x54f824),console[_0x4856ef(0x1da)](_0x4856ef(0x1b8)+Object[_0x4856ef(0x1c0)](_0x1a380b[_0x4856ef(0x1db)])[_0x4856ef(0x1ce)]+_0x4856ef(0x1d2));}catch(_0x4cd8ec){console[_0x4856ef(0x1c4)]('\x20\x20!\x20CDN\x20拉取失败,跳过指南安装:\x20'+(_0x4cd8ec instanceof Error?_0x4cd8ec[_0x4856ef(0x1c5)]:String(_0x4cd8ec)));}let _0x614edd=0x0;for(const _0x3b2de8 of _0x320e71){try{const _0x3b83b0=IDE_CONFIGS[_0x3b2de8];if(!_0x3b83b0){console[_0x4856ef(0x1c4)](_0x4856ef(0x1d8)+_0x3b2de8);continue;}const _0xbca1b6=await installSingleIDE(_0x3b2de8,_0x3b83b0,_0x57c4b7,_0x6e7fc9,_0x1a380b,_0x56166d);_0x614edd+=_0xbca1b6,console['log'](_0x4856ef(0x1cf)+(_0x3b83b0[_0x4856ef(0x1c2)]||_0x3b2de8));}catch(_0x3494ae){console[_0x4856ef(0x1c9)]('\x20\x20✗\x20安装\x20'+_0x3b2de8+_0x4856ef(0x1c3)+(_0x3494ae instanceof Error?_0x3494ae[_0x4856ef(0x1c5)]:String(_0x3494ae)));}}_0x1a380b&&writeGuidesToProject(_0x1a380b,_0x57c4b7,_0x4856ef(0x1dc),_0x56166d);const _0x481e8d={'version':_0x4856ef(0x1b9),'installedAt':new Date()[_0x4856ef(0x1ca)](),'platforms':_0x320e71},_0x44d6fa=join(_0x57c4b7,_0x4856ef(0x1c8));writeFileSync(_0x44d6fa,JSON['stringify'](_0x481e8d,null,0x2),_0x4856ef(0x1cd)),logger[_0x4856ef(0x1bc)](_0x4856ef(0x1d7),_0x4856ef(0x1bb),{'projectRoot':_0x57c4b7,'ides':_0x320e71,'foldersCount':_0x614edd}),console[_0x4856ef(0x1da)](_0x4856ef(0x1c6)+_0x614edd+_0x4856ef(0x1bf)),console[_0x4856ef(0x1da)]('开发者指南位置:\x20.lovrabet/skill/.shared/guides/');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a64_0x2972(_0x46a7c4,_0x5f3def){_0x46a7c4=_0x46a7c4-0x1ba;const _0x49f4fd=a64_0x49f4();let _0x2972a2=_0x49f4fd[_0x46a7c4];return _0x2972a2;}(function(_0x4928a5,_0x3b02f1){const _0x585e9e=a64_0x2972,_0x5bb854=_0x4928a5();while(!![]){try{const _0x3b7a3a=parseInt(_0x585e9e(0x1c7))/0x1+-parseInt(_0x585e9e(0x1d6))/0x2+-parseInt(_0x585e9e(0x1cf))/0x3*(-parseInt(_0x585e9e(0x1c1))/0x4)+parseInt(_0x585e9e(0x1da))/0x5*(-parseInt(_0x585e9e(0x1c4))/0x6)+parseInt(_0x585e9e(0x1c9))/0x7*(-parseInt(_0x585e9e(0x1cd))/0x8)+parseInt(_0x585e9e(0x1c5))/0x9*(-parseInt(_0x585e9e(0x1c8))/0xa)+parseInt(_0x585e9e(0x1d0))/0xb;if(_0x3b7a3a===_0x3b02f1)break;else _0x5bb854['push'](_0x5bb854['shift']());}catch(_0x325c66){_0x5bb854['push'](_0x5bb854['shift']());}}}(a64_0x49f4,0xc3a37));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(_0x46c198,_0x1ec7b9,_0x2417d1,_0x205c4f,_0xa561a1,_0x4a1f4c){const _0x1c5463=a64_0x2972;let _0x8a2ec2=0x0;const _0x4bf24e=_0x1ec7b9?.[_0x1c5463(0x1d9)]??['.'+_0x46c198];for(const _0x3b3f50 of _0x4bf24e){const _0x5717db=join(_0x2417d1,_0x3b3f50),_0x4980f5=_0x1ec7b9?.[_0x1c5463(0x1d8)]?.[_0x1c5463(0x1bc)](_0x1e16e9=>_0x1e16e9[_0x1c5463(0x1d1)][_0x1c5463(0x1ce)](_0x3b3f50+'/'))??![];_0x4980f5?!existsSync(_0x5717db)&&(mkdirSync(_0x5717db,{'recursive':!![]}),_0x8a2ec2++):!existsSync(_0x5717db)&&(writeFileSync(_0x5717db,'',_0x1c5463(0x1ba)),_0x8a2ec2++);}if(_0x1ec7b9?.['files']){const _0x5c12cc=_0x1ec7b9[_0x1c5463(0x1cb)]||_0x46c198;for(const _0x41a27d of _0x1ec7b9[_0x1c5463(0x1d8)]){const _0x10f8ad=join(_0x2417d1,_0x41a27d[_0x1c5463(0x1d1)]);await createFileFromTemplate(_0x41a27d,_0x10f8ad,_0x5c12cc,_0x205c4f,_0xa561a1,_0x4a1f4c),_0x8a2ec2++;}}return _0x8a2ec2;}export async function createFileFromTemplate(_0x2577d0,_0x5c78eb,_0x3169a7,_0x6ef4f9,_0x2a02b7,_0xcc5a23){const _0x1c0ca2=a64_0x2972,_0x539139=dirname(_0x5c78eb);!existsSync(_0x539139)&&mkdirSync(_0x539139,{'recursive':!![]});const _0x4af5e0=_0x2577d0['template']===_0x1c0ca2(0x1d4);if(existsSync(_0x5c78eb)&&!_0x4af5e0)return;if(_0x2577d0[_0x1c0ca2(0x1d3)]){const _0x107cd3=join(_0x6ef4f9,_0x2577d0[_0x1c0ca2(0x1d3)]);if(existsSync(_0x107cd3)){let _0x533bfa=readFileSync(_0x107cd3,_0x1c0ca2(0x1ba));_0x533bfa=_0x533bfa[_0x1c0ca2(0x1c3)](/\{\{IDE_NAME\}\}/g,_0x3169a7);_0x2a02b7&&_0x4af5e0&&(_0x533bfa=insertGuidesSection(_0x533bfa,_0x2a02b7,_0xcc5a23),_0x533bfa=appendExtendContents(_0x533bfa,_0x2a02b7,_0xcc5a23));writeFileSync(_0x5c78eb,_0x533bfa,_0x1c0ca2(0x1ba));return;}if(_0x2a02b7&&_0x4af5e0)try{writeSkillFile(_0x2a02b7,_0x5c78eb,_0x3169a7,_0xcc5a23);return;}catch{}}writeFileSync(_0x5c78eb,'',_0x1c0ca2(0x1ba));}function a64_0x49f4(){const _0x47aed0=['SKILL.md.tpl','<!--\x20GUIDES_APPEND\x20-->','1759310bASxXu','length','files','folders','93645HDRNef','utf-8','|\x20`','some','\x0a<!--\x20GUIDES_APPEND\x20-->','test','indexOf','`\x20|\x20','200NPizhN','guides','replace','18qGEgpQ','237078STuDIN','requireFlags','1062658NaeJTP','130piEGRK','49nuMqNz','push','name','includes','1159976IMOeUh','startsWith','59061Midavf','11523534IOrZXw','path','keys','template'];a64_0x49f4=function(){return _0x47aed0;};return a64_0x49f4();}function insertGuidesSection(_0x2b5fda,_0x6d0d36,_0x33e698){const _0x35e9d2=a64_0x2972,_0x57af78=_0x35e9d2(0x1d5),_0x33b8ce=_0x2b5fda[_0x35e9d2(0x1bf)](_0x57af78);if(_0x33b8ce===-0x1)return _0x2b5fda;const _0x5efb77=[],_0x1c2957=Object[_0x35e9d2(0x1d2)](_0x6d0d36['guides'])['sort']();for(const _0x149133 of _0x1c2957){const _0x2d976a=_0x6d0d36[_0x35e9d2(0x1c2)][_0x149133];if(!_0x2d976a)continue;if(/^0[1-6]-/[_0x35e9d2(0x1be)](_0x149133))continue;if(_0x2d976a[_0x35e9d2(0x1c6)]&&_0x2d976a['requireFlags'][_0x35e9d2(0x1d7)]>0x0){const _0x33e4f0=_0x2d976a['requireFlags'][_0x35e9d2(0x1bc)](_0x5e19d4=>_0x33e698?.[_0x35e9d2(0x1cc)](_0x5e19d4));if(!_0x33e4f0)continue;}const _0x309ec0=_0x2d976a['path'][_0x35e9d2(0x1c3)](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x5efb77[_0x35e9d2(0x1ca)](_0x35e9d2(0x1bb)+_0x309ec0+_0x35e9d2(0x1c0)+_0x2d976a['title']+'\x20|');}if(_0x5efb77[_0x35e9d2(0x1d7)]===0x0)return _0x2b5fda[_0x35e9d2(0x1c3)](_0x57af78,_0x35e9d2(0x1d5));const _0x24ad27=_0x5efb77['join']('\x0a');return _0x2b5fda['replace'](_0x57af78,_0x24ad27+_0x35e9d2(0x1bd));}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a66_0x1c64(_0x37eda0,_0x254ba7){_0x37eda0=_0x37eda0-0x1dd;const _0xa85062=a66_0xa850();let _0x1c6461=_0xa85062[_0x37eda0];return _0x1c6461;}(function(_0x44e981,_0x2c9e26){const _0x56df2f=a66_0x1c64,_0x596c8c=_0x44e981();while(!![]){try{const _0x5d4726=parseInt(_0x56df2f(0x1de))/0x1*(-parseInt(_0x56df2f(0x1e6))/0x2)+-parseInt(_0x56df2f(0x1ec))/0x3+-parseInt(_0x56df2f(0x1e4))/0x4*(parseInt(_0x56df2f(0x1e1))/0x5)+parseInt(_0x56df2f(0x1ed))/0x6+-parseInt(_0x56df2f(0x1e9))/0x7+-parseInt(_0x56df2f(0x1e5))/0x8*(parseInt(_0x56df2f(0x1ea))/0x9)+parseInt(_0x56df2f(0x1df))/0xa;if(_0x5d4726===_0x2c9e26)break;else _0x596c8c['push'](_0x596c8c['shift']());}catch(_0xb72ef4){_0x596c8c['push'](_0x596c8c['shift']());}}}(a66_0xa850,0x5e2f2));import{jsxs as a66_0x3c3a3e,jsx as a66_0x4a7f9e}from'react/jsx-runtime';import{Text,Box}from'ink';export function IDESelector({ideList:_0x240ba5,title:_0x8d4682,selection:_0x44a0c7}){const _0x350df7=a66_0x1c64,{selectedIndexes:_0x4a5791,highlightIndex:_0x35d123,errorMsg:_0x167d77}=_0x44a0c7;return a66_0x3c3a3e(Box,{'flexDirection':'column','marginTop':0x1,'children':[a66_0x4a7f9e(Box,{'children':a66_0x3c3a3e(Text,{'color':_0x350df7(0x1dd),'children':['*\x20',_0x8d4682]})}),_0x167d77&&a66_0x4a7f9e(Box,{'marginTop':0x1,'children':a66_0x3c3a3e(Text,{'color':'red','children':['✗\x20',_0x167d77]})}),a66_0x3c3a3e(Box,{'marginTop':0x1,'flexDirection':_0x350df7(0x1e3),'children':[a66_0x4a7f9e(Text,{'bold':!![],'children':_0x350df7(0x1ef)}),_0x240ba5[_0x350df7(0x1e2)]((_0x55792d,_0x20dc40)=>{const _0x22d134=_0x350df7,_0x428b7e=_0x35d123===_0x20dc40,_0x4fe309=_0x4a5791['has'](_0x20dc40);return a66_0x4a7f9e(Box,{'children':a66_0x3c3a3e(Text,{'backgroundColor':_0x428b7e?'blue':undefined,'color':_0x428b7e?_0x22d134(0x1e8):undefined,'children':['\x20\x20',_0x4fe309?_0x22d134(0x1f0):_0x22d134(0x1ee),'\x20',_0x55792d[_0x22d134(0x1e7)],'\x20',a66_0x3c3a3e(Text,{'color':_0x428b7e?_0x22d134(0x1e8):'gray','dimColor':!_0x428b7e,'children':['-\x20',_0x55792d[_0x22d134(0x1eb)]]})]})},_0x55792d['key']);}),a66_0x4a7f9e(Box,{'marginTop':0x1,'children':a66_0x3c3a3e(Text,{'color':_0x350df7(0x1e0),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20q:\x20退出\x20Enter:\x20确认']})})]})]});}export{useIDESelection}from'./useIDESelection.js';function a66_0xa850(){const _0x15b510=['cyan','1yxcOQC','19237580EStvOw','gray','5ImuUQA','map','column','2926468sjSAYf','819088GtJVIB','872128zwOruT','name','white','1213744SUlzDv','9nbGUSb','description','413874lLkjJn','260622qMZiBN','[\x20]','*\x20请选择要配置的\x20IDE:','[✓]'];a66_0xa850=function(){return _0x15b510;};return a66_0xa850();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a67_0xba10(_0x387b16,_0x429607){_0x387b16=_0x387b16-0x193;const _0x1715cd=a67_0x1715();let _0xba1076=_0x1715cd[_0x387b16];return _0xba1076;}(function(_0xfbd632,_0x9fd4f4){const _0x1828c2=a67_0xba10,_0x2be6e1=_0xfbd632();while(!![]){try{const _0x29ee4f=parseInt(_0x1828c2(0x19b))/0x1*(parseInt(_0x1828c2(0x1a3))/0x2)+-parseInt(_0x1828c2(0x19d))/0x3*(-parseInt(_0x1828c2(0x198))/0x4)+-parseInt(_0x1828c2(0x1a8))/0x5*(parseInt(_0x1828c2(0x194))/0x6)+-parseInt(_0x1828c2(0x193))/0x7+parseInt(_0x1828c2(0x19c))/0x8+-parseInt(_0x1828c2(0x19f))/0x9*(-parseInt(_0x1828c2(0x19e))/0xa)+parseInt(_0x1828c2(0x196))/0xb;if(_0x29ee4f===_0x9fd4f4)break;else _0x2be6e1['push'](_0x2be6e1['shift']());}catch(_0xde7ce5){_0x2be6e1['push'](_0x2be6e1['shift']());}}}(a67_0x1715,0xa7a22));import{useState,useCallback}from'react';function a67_0x1715(){const _0xb88913=['6bPppBW','length','17225648TsViwv','has','68seIjSX','key','findIndex','1ePPpRx','41776YTizFt','40731sLtVUW','70vrhOCf','450909ekeZFg','downArrow','add','map','939936JnTIEC','size','upArrow','filter','delete','6445895GjdUyq','4528083MZUAEE'];a67_0x1715=function(){return _0xb88913;};return a67_0x1715();}export function useIDESelection({ideList:_0x59eebb,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x4abec4=a67_0xba10,[_0x24c700,_0x182efc]=useState(new Set(preselectedIDEs[_0x4abec4(0x1a2)](_0x465927=>_0x59eebb[_0x4abec4(0x19a)](_0x5540b8=>_0x5540b8[_0x4abec4(0x199)]===_0x465927))[_0x4abec4(0x1a6)](_0x564e3b=>_0x564e3b>=0x0))),[_0x2ba73d,_0x1cf912]=useState(0x0),[_0x4ec0cd,_0x21905b]=useState(''),_0xc7092=useCallback(()=>{_0x1cf912(_0x321f2f=>_0x321f2f>0x0?_0x321f2f-0x1:_0x59eebb['length']-0x1);},[_0x59eebb[_0x4abec4(0x195)]]),_0x3821c9=useCallback(()=>{const _0x2b446a=_0x4abec4;_0x1cf912(_0x5d3d94=>_0x5d3d94<_0x59eebb[_0x2b446a(0x195)]-0x1?_0x5d3d94+0x1:0x0);},[_0x59eebb['length']]),_0x4a1017=useCallback(()=>{if(!multiSelect){_0x182efc(new Set([_0x2ba73d]));return;}_0x182efc(_0x566b1c=>{const _0x2d7b2e=a67_0xba10,_0xaf4760=new Set(_0x566b1c);return _0xaf4760[_0x2d7b2e(0x197)](_0x2ba73d)?_0xaf4760[_0x2d7b2e(0x1a7)](_0x2ba73d):_0xaf4760[_0x2d7b2e(0x1a1)](_0x2ba73d),_0xaf4760;});},[_0x2ba73d,multiSelect]),_0x9f3dea=useCallback(()=>{const _0x8fc95e=_0x4abec4;_0x182efc(new Set(_0x59eebb[_0x8fc95e(0x1a2)]((_0x143979,_0x52ffb7)=>_0x52ffb7)));},[_0x59eebb]),_0x4eebeb=useCallback(()=>{_0x182efc(_0x38457d=>{const _0x302392=a67_0xba10,_0x25580c=new Set();for(let _0x45b799=0x0;_0x45b799<_0x59eebb[_0x302392(0x195)];_0x45b799++){!_0x38457d[_0x302392(0x197)](_0x45b799)&&_0x25580c[_0x302392(0x1a1)](_0x45b799);}return _0x25580c;});},[_0x59eebb]),_0x3f9582=useCallback(()=>{const _0x291e5f=_0x4abec4;return Array['from'](_0x24c700)[_0x291e5f(0x1a2)](_0x6cda8c=>_0x59eebb[_0x6cda8c]?.[_0x291e5f(0x199)])[_0x291e5f(0x1a6)](_0x552341=>_0x552341!==undefined);},[_0x24c700,_0x59eebb]),_0x491436=useCallback(()=>{const _0x3a9e70=_0x4abec4;return _0x24c700[_0x3a9e70(0x1a4)]===_0x59eebb[_0x3a9e70(0x195)];},[_0x24c700,_0x59eebb]),_0xbf506d=useCallback((_0x397111,_0x1e5c13)=>{const _0x3e3ebd=_0x4abec4;if(_0x1e5c13[_0x3e3ebd(0x1a5)])return _0xc7092(),!![];if(_0x1e5c13[_0x3e3ebd(0x1a0)])return _0x3821c9(),!![];if(_0x397111==='\x20')return _0x4a1017(),!![];if(_0x397111==='a'||_0x397111==='A')return _0x9f3dea(),!![];if(_0x397111==='i'||_0x397111==='I'||_0x397111==='r'||_0x397111==='R')return _0x4eebeb(),!![];return![];},[_0xc7092,_0x3821c9,_0x4a1017,_0x9f3dea,_0x4eebeb]);return{'selectedIndexes':_0x24c700,'highlightIndex':_0x2ba73d,'errorMsg':_0x4ec0cd,'setErrorMsg':_0x21905b,'handleKeyDown':_0xbf506d,'getSelectedIDEs':_0x3f9582,'isAllSelected':_0x491436,'toggleSelection':_0x4a1017,'selectAll':_0x9f3dea,'invertSelection':_0x4eebeb,'moveHighlightUp':_0xc7092,'moveHighlightDown':_0x3821c9};}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x3eaae0=a68_0xa63d;function a68_0x1fd8(){const _0x4fe492=['.codex/skills/lovrabet/SKILL.md','file','1264296XWQAgf','SKILL.md.tpl','windsurf','.trae/skills/lovrabet/SKILL.md','.cline','.qoder/skills/lovrabet/SKILL.md','.cursor','Codex','.codex','Cline','38Tamzfp','.claude','cursor','4985323LOAOEq','97989ztRQsX','772068ctWyCG','Claude\x20Code','Cline\x20IDE','其他\x20(通用模板)','Qoder','.trae','.agent','.cursor/skills/lovrabet.md','.cline/skills/lovrabet/SKILL.md','通用模板\x20-\x20兜底方案','trae','Trae\x20IDE','CodeBuddy','claude','.cursorrules','441861uENXPr','Qoder\x20IDE','.agent/skills/lovrabet/SKILL.md','CodeBuddy\x20IDE','4455070cGKAMV','opencode','27FDlMbD','qoder','.opencode/skills/lovrabet/SKILL.md','cline','.windsurf','.qoder/rules/lovrabet.md','3758862pQKtow','OpenCode','codebuddy','agent','.qoder','codex','antigravity','Trae','.codebuddy/skills/lovrabet/SKILL.md'];a68_0x1fd8=function(){return _0x4fe492;};return a68_0x1fd8();}(function(_0x445924,_0x31a89e){const _0x342e20=a68_0xa63d,_0x5b5bc7=_0x445924();while(!![]){try{const _0x328b7e=parseInt(_0x342e20(0x199))/0x1+parseInt(_0x342e20(0x185))/0x2*(-parseInt(_0x342e20(0x189))/0x3)+parseInt(_0x342e20(0x18a))/0x4+parseInt(_0x342e20(0x19d))/0x5+-parseInt(_0x342e20(0x170))/0x6+parseInt(_0x342e20(0x188))/0x7+-parseInt(_0x342e20(0x17b))/0x8*(parseInt(_0x342e20(0x16a))/0x9);if(_0x328b7e===_0x31a89e)break;else _0x5b5bc7['push'](_0x5b5bc7['shift']());}catch(_0x31b520){_0x5b5bc7['push'](_0x5b5bc7['shift']());}}}(a68_0x1fd8,0x7e320));export const CORE_IDE_CONFIGS={'cursor':{'name':'Cursor','description':'Cursor\x20IDE','folders':[a68_0x3eaae0(0x198),a68_0x3eaae0(0x181)],'files':[{'type':'file','path':a68_0x3eaae0(0x191),'template':'SKILL.md.tpl'}]},'windsurf':{'name':'Windsurf','description':'Windsurf\x20IDE','folders':[a68_0x3eaae0(0x16e)],'files':[{'type':'file','path':'.windsurf/workflows/lovrabet.md','template':a68_0x3eaae0(0x17c)}]},'claude':{'name':a68_0x3eaae0(0x18b),'description':a68_0x3eaae0(0x18b),'folders':[a68_0x3eaae0(0x186)],'files':[{'type':'file','path':'.claude/skills/lovrabet/SKILL.md','template':a68_0x3eaae0(0x17c)}]},'cline':{'name':a68_0x3eaae0(0x184),'description':a68_0x3eaae0(0x18c),'folders':[a68_0x3eaae0(0x17f)],'files':[{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x192),'template':a68_0x3eaae0(0x17c)}]},'codex':{'name':a68_0x3eaae0(0x182),'description':'Codex\x20IDE','folders':[a68_0x3eaae0(0x183)],'files':[{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x179),'template':'SKILL.md.tpl'}]},'opencode':{'name':a68_0x3eaae0(0x171),'description':'OpenCode\x20IDE','folders':['.opencode'],'files':[{'type':'file','path':a68_0x3eaae0(0x16c),'template':a68_0x3eaae0(0x17c)}]},'qoder':{'name':a68_0x3eaae0(0x18e),'description':a68_0x3eaae0(0x19a),'folders':[a68_0x3eaae0(0x174)],'files':[{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x16f),'template':a68_0x3eaae0(0x17c)},{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x180),'template':a68_0x3eaae0(0x17c)}]},'codebuddy':{'name':a68_0x3eaae0(0x196),'description':a68_0x3eaae0(0x19c),'folders':['.codebuddy'],'files':[{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x178),'template':a68_0x3eaae0(0x17c)}]},'trae':{'name':a68_0x3eaae0(0x177),'description':a68_0x3eaae0(0x195),'folders':[a68_0x3eaae0(0x18f)],'files':[{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x17e),'template':a68_0x3eaae0(0x17c)}]}};function a68_0xa63d(_0x3447b2,_0x7194b5){_0x3447b2=_0x3447b2-0x169;const _0x1fd840=a68_0x1fd8();let _0xa63d74=_0x1fd840[_0x3447b2];return _0xa63d74;}export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a68_0x3eaae0(0x18d),'description':a68_0x3eaae0(0x193),'folders':[a68_0x3eaae0(0x190)],'files':[{'type':'file','path':'.agent/skills/lovrabet/SKILL.md','template':a68_0x3eaae0(0x17c)}]},'antigravity':{'name':'Antigravity','description':'Antigravity\x20IDE','folders':['.agent'],'files':[{'type':a68_0x3eaae0(0x17a),'path':a68_0x3eaae0(0x19b),'template':a68_0x3eaae0(0x17c)}]}};export const CORE_IDE_LIST=['claude','cline',a68_0x3eaae0(0x172),a68_0x3eaae0(0x175),a68_0x3eaae0(0x187),a68_0x3eaae0(0x169),a68_0x3eaae0(0x16b),a68_0x3eaae0(0x194),a68_0x3eaae0(0x17d)];export const IDE_LIST=[a68_0x3eaae0(0x176),a68_0x3eaae0(0x197),'cline','codebuddy',a68_0x3eaae0(0x175),a68_0x3eaae0(0x187),a68_0x3eaae0(0x169),'qoder','trae',a68_0x3eaae0(0x17d),a68_0x3eaae0(0x173)];export const ALL_CORE_IDES=[a68_0x3eaae0(0x187),a68_0x3eaae0(0x17d),a68_0x3eaae0(0x197),a68_0x3eaae0(0x16d),a68_0x3eaae0(0x175),'opencode','qoder',a68_0x3eaae0(0x172),a68_0x3eaae0(0x194)];export const MCP_IDES=new Set(['cursor','claude']);
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b9b62,_0x172574){const _0x242432=a69_0x5c91,_0x19f9a3=_0x1b9b62();while(!![]){try{const _0x430de8=parseInt(_0x242432(0x1f4))/0x1+-parseInt(_0x242432(0x1f0))/0x2+-parseInt(_0x242432(0x1fd))/0x3*(parseInt(_0x242432(0x1f1))/0x4)+-parseInt(_0x242432(0x1f8))/0x5+parseInt(_0x242432(0x1fa))/0x6*(parseInt(_0x242432(0x1f5))/0x7)+parseInt(_0x242432(0x1f6))/0x8+parseInt(_0x242432(0x1fb))/0x9;if(_0x430de8===_0x172574)break;else _0x19f9a3['push'](_0x19f9a3['shift']());}catch(_0xafbe6d){_0x19f9a3['push'](_0x19f9a3['shift']());}}}(a69_0xef8a,0x2b54d));import{getTemplateBaseUrl}from'./config.js';export async function fetchCdnConfig(){const _0x5a3854=a69_0x5c91;try{const _0x2b68ea=getTemplateBaseUrl(),_0x3168d1=_0x2b68ea+_0x5a3854(0x1fc),_0x21a7d9=await fetch(_0x3168d1,{'headers':{'Accept':'application/json'}});if(!_0x21a7d9['ok'])return null;const _0x47d848=await _0x21a7d9[_0x5a3854(0x1f7)]();if(!_0x47d848[_0x5a3854(0x1fe)]?.[_0x5a3854(0x1f9)]||!_0x47d848['sdk']?.[_0x5a3854(0x1f3)]?.['stableVersion'])return null;return _0x47d848;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;function a69_0xef8a(){const _0x46d626=['105541yFmCZR','830431UxWibS','799800KdyyzA','json','1625925RnmIgj','stableVersion','12tAWlPV','4005954pUncSp','/config.json','866325BIyHAX','cli','192886NSeQWI','4BCYiNF','now','node'];a69_0xef8a=function(){return _0x46d626;};return a69_0xef8a();}function a69_0x5c91(_0x19615d,_0x5acbae){_0x19615d=_0x19615d-0x1f0;const _0xef8a19=a69_0xef8a();let _0x5c91c2=_0xef8a19[_0x19615d];return _0x5c91c2;}const CACHE_TTL=0x5*0x3c*0x3e8;export async function getCdnConfig(){const _0x3742ab=a69_0x5c91,_0x33af06=Date[_0x3742ab(0x1f2)]();if(cachedConfig&&_0x33af06-cacheTime<CACHE_TTL)return cachedConfig;const _0x518fa4=await fetchCdnConfig();return _0x518fa4&&(cachedConfig=_0x518fa4,cacheTime=_0x33af06),_0x518fa4;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a70_0x2553d1=a70_0x1071;(function(_0x303c04,_0x445a1d){const _0x3f0575=a70_0x1071,_0x431396=_0x303c04();while(!![]){try{const _0x21b984=-parseInt(_0x3f0575(0xbd))/0x1*(-parseInt(_0x3f0575(0xaf))/0x2)+-parseInt(_0x3f0575(0xa3))/0x3+parseInt(_0x3f0575(0xb4))/0x4+parseInt(_0x3f0575(0xa5))/0x5*(-parseInt(_0x3f0575(0xa2))/0x6)+-parseInt(_0x3f0575(0x99))/0x7*(parseInt(_0x3f0575(0xb1))/0x8)+-parseInt(_0x3f0575(0xb8))/0x9+parseInt(_0x3f0575(0xa0))/0xa*(parseInt(_0x3f0575(0xb5))/0xb);if(_0x21b984===_0x445a1d)break;else _0x431396['push'](_0x431396['shift']());}catch(_0x39f554){_0x431396['push'](_0x431396['shift']());}}}(a70_0x26f2,0x5ce35));import a70_0x1c2639 from'node:fs';import a70_0x29a409 from'node:path';import a70_0x51aaa4 from'semver';import{getCdnConfig}from'./cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a70_0x2553d1(0xb6);function isNonNumericVersion(_0x41a150){const _0x2d3fbc=a70_0x2553d1,_0x5f07d1=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x5f07d1[_0x2d3fbc(0x9b)](_0x5865e6=>_0x5865e6[_0x2d3fbc(0xb7)](_0x41a150));}function getInstalledVersion(_0x80268f,_0x3e0a14){const _0x1df987=a70_0x2553d1;try{const _0x2fc537=a70_0x29a409[_0x1df987(0xaa)](_0x80268f,_0x1df987(0xa4),_0x3e0a14,'package.json');if(a70_0x1c2639[_0x1df987(0xb9)](_0x2fc537)){const _0x45e396=JSON['parse'](a70_0x1c2639['readFileSync'](_0x2fc537,_0x1df987(0x9c)));return _0x45e396[_0x1df987(0x9e)]||null;}}catch{}return null;}function a70_0x1071(_0x32e5e5,_0x5a3631){_0x32e5e5=_0x32e5e5-0x97;const _0x26f295=a70_0x26f2();let _0x107181=_0x26f295[_0x32e5e5];return _0x107181;}async function getSdkStableVersion(){const _0x43625b=a70_0x2553d1;try{const _0x2ba4c3=await getCdnConfig();return _0x2ba4c3?.[_0x43625b(0x97)]?.['node']?.['stableVersion']||null;}catch{return null;}}async function getSdkPackageName(){const _0x2daf2a=a70_0x2553d1;try{const _0x23446c=await getCdnConfig();return _0x23446c?.['sdk']?.[_0x2daf2a(0xa8)]?.[_0x2daf2a(0xad)]||_0x2daf2a(0xbc);}catch{return'@lovrabet/sdk';}}function a70_0x26f2(){const _0x43ee14=['10ifnQyb','↪\x20SDK\x20版本更新','1375086mMQfPW','1293261HkEDiX','node_modules','15lIyEPD','devDependencies','minVersion','node','\x20\x20\x20当前版本:\x20','join','\x20\x20\x20升级命令:\x20npm\x20install\x20','all','packageName','readFileSync','151860YyKNYN','log','8cAzPOZ','package.json','stableVersion','724268KsmRey','16784845obVaBj','1.2.0','test','6268914KqFpyW','existsSync','coerce','needsUpgrade','@lovrabet/sdk','10dKdPJC','parse','sdk','utf8','1894319TeUFvA','dependencies','some','utf-8','latest','version','\x1b[1m'];a70_0x26f2=function(){return _0x43ee14;};return a70_0x26f2();}export async function checkSdkVersion(_0x2be51f){const _0x26a725=a70_0x2553d1,_0x51059f=a70_0x29a409[_0x26a725(0xaa)](_0x2be51f,'package.json'),[_0x5b908c,_0x4c93b7]=await Promise[_0x26a725(0xac)]([getSdkStableVersion(),getSdkPackageName()]),_0x27c69f=_0x5b908c||FALLBACK_MIN_SDK_VERSION;if(!a70_0x1c2639[_0x26a725(0xb9)](_0x51059f))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x27c69f,'packageName':_0x4c93b7,'stableVersion':_0x5b908c};try{const _0x4adcd2=JSON['parse'](a70_0x1c2639[_0x26a725(0xae)](_0x51059f,'utf8')),_0x3b5876=_0x4adcd2[_0x26a725(0x9a)]||{},_0xdc7ef3=_0x4adcd2[_0x26a725(0xa6)]||{},_0x5bfc5c=_0x3b5876[_0x4c93b7]||_0xdc7ef3[_0x4c93b7];if(!_0x5bfc5c)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x27c69f,'packageName':_0x4c93b7,'stableVersion':_0x5b908c};let _0x4625f6=getInstalledVersion(_0x2be51f,_0x4c93b7);!_0x4625f6&&(_0x4625f6=_0x5bfc5c);if(isNonNumericVersion(_0x5bfc5c))return{'installed':!![],'version':_0x4625f6,'needsUpgrade':![],'minVersion':_0x27c69f,'packageName':_0x4c93b7,'stableVersion':_0x5b908c};const _0xbce94c=a70_0x51aaa4['coerce'](_0x4625f6),_0x30d187=a70_0x51aaa4[_0x26a725(0xba)](_0x27c69f),_0x58c3c5=_0xbce94c&&_0x30d187?a70_0x51aaa4['lt'](_0xbce94c,_0x30d187):![];return{'installed':!![],'version':_0x4625f6,'needsUpgrade':_0x58c3c5,'minVersion':_0x27c69f,'packageName':_0x4c93b7,'stableVersion':_0x5b908c};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x27c69f,'packageName':_0x4c93b7,'stableVersion':_0x5b908c};}}export function checkSdkVersionSync(_0x72189f){const _0x1bfa3a=a70_0x2553d1,_0x559145=a70_0x29a409['join'](_0x72189f,_0x1bfa3a(0xb2)),_0x260e5a='@lovrabet/sdk';if(!a70_0x1c2639['existsSync'](_0x559145))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x260e5a,'stableVersion':null};try{const _0x3bb5b9=JSON[_0x1bfa3a(0xbe)](a70_0x1c2639[_0x1bfa3a(0xae)](_0x559145,_0x1bfa3a(0x98))),_0x3bb1b9=_0x3bb5b9[_0x1bfa3a(0x9a)]||{},_0x24d392=_0x3bb5b9['devDependencies']||{},_0x38edb4=_0x3bb1b9[_0x260e5a]||_0x24d392[_0x260e5a];if(!_0x38edb4)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x260e5a,'stableVersion':null};let _0x204023=getInstalledVersion(_0x72189f,_0x260e5a);!_0x204023&&(_0x204023=_0x38edb4);if(isNonNumericVersion(_0x38edb4))return{'installed':!![],'version':_0x204023,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x260e5a,'stableVersion':null};const _0x420f63=a70_0x51aaa4[_0x1bfa3a(0xba)](_0x204023),_0x3e4ba7=_0x420f63?a70_0x51aaa4['lt'](_0x420f63,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x204023,'needsUpgrade':_0x3e4ba7,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x260e5a,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x260e5a,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x4456ee){const _0x5d5d11=a70_0x2553d1;if(!_0x4456ee[_0x5d5d11(0xbb)])return;const _0x4a53a4='\x1b[33m',_0x460951='\x1b[0m',_0x418475=_0x5d5d11(0x9f),_0xbcfb1a=_0x4456ee['packageName']||'@lovrabet/sdk';console[_0x5d5d11(0xb0)](),console[_0x5d5d11(0xb0)](''+_0x4a53a4+_0x418475+_0x5d5d11(0xa1)+_0x460951),console[_0x5d5d11(0xb0)](_0x4a53a4+_0x5d5d11(0xa9)+_0xbcfb1a+'@'+_0x4456ee['version']+_0x460951),console[_0x5d5d11(0xb0)](_0x4a53a4+'\x20\x20\x20稳定版本:\x20'+(_0x4456ee[_0x5d5d11(0xb3)]||_0x4456ee[_0x5d5d11(0xa7)])+_0x460951),console[_0x5d5d11(0xb0)](_0x4a53a4+_0x5d5d11(0xab)+_0xbcfb1a+'@'+(_0x4456ee['stableVersion']||_0x5d5d11(0x9d))+_0x460951),console['log']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1be858,_0x97e944){const _0x34c1fb=a71_0x5bc2,_0x1f70fb=_0x1be858();while(!![]){try{const _0xd9682a=parseInt(_0x34c1fb(0x9d))/0x1*(-parseInt(_0x34c1fb(0xa4))/0x2)+parseInt(_0x34c1fb(0xa5))/0x3+-parseInt(_0x34c1fb(0xad))/0x4*(parseInt(_0x34c1fb(0xaf))/0x5)+-parseInt(_0x34c1fb(0xaa))/0x6*(-parseInt(_0x34c1fb(0xb5))/0x7)+-parseInt(_0x34c1fb(0xa1))/0x8*(parseInt(_0x34c1fb(0xae))/0x9)+-parseInt(_0x34c1fb(0xa9))/0xa*(-parseInt(_0x34c1fb(0xac))/0xb)+-parseInt(_0x34c1fb(0xb0))/0xc*(-parseInt(_0x34c1fb(0xa7))/0xd);if(_0xd9682a===_0x97e944)break;else _0x1f70fb['push'](_0x1f70fb['shift']());}catch(_0x4cf28b){_0x1f70fb['push'](_0x1f70fb['shift']());}}}(a71_0x4d78,0x45895));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a71_0x3af56f from'semver';import{getCdnConfig}from'./cdn-config.js';function getCurrentCliVersion(){const _0x3d7607=a71_0x5bc2;try{const _0x1202e0=fileURLToPath(import.meta.url),_0xc58779=resolve(dirname(_0x1202e0),_0x3d7607(0xa2)),_0x5aa1d0=resolve(_0xc58779,_0x3d7607(0x9a)),_0xdcb6e0=JSON[_0x3d7607(0xa8)](readFileSync(_0x5aa1d0,_0x3d7607(0x9c)));return _0xdcb6e0['version']||'1.0.0';}catch{return'1.0.0';}}function a71_0x5bc2(_0x766f60,_0x2c570f){_0x766f60=_0x766f60-0x98;const _0x4d78a7=a71_0x4d78();let _0x5bc2f3=_0x4d78a7[_0x766f60];return _0x5bc2f3;}function isNonNumericVersion(_0x301786){const _0x86c135=a71_0x5bc2,_0x204f31=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x204f31[_0x86c135(0x9b)](_0xf22bd=>_0xf22bd[_0x86c135(0xb2)](_0x301786));}export async function checkCliVersion(){const _0x2ea2f5=a71_0x5bc2,_0x5f6abd=getCurrentCliVersion(),_0x165ba9=await getCdnConfig(),_0x2498b8=_0x165ba9?.[_0x2ea2f5(0xb1)]?.[_0x2ea2f5(0xab)]||null;let _0x270d25=![];if(_0x2498b8)try{const _0x2b9556=a71_0x3af56f[_0x2ea2f5(0xb4)](_0x5f6abd),_0x3e0982=a71_0x3af56f[_0x2ea2f5(0xb4)](_0x2498b8);_0x2b9556&&_0x3e0982&&(_0x270d25=a71_0x3af56f['lt'](_0x2b9556,_0x3e0982));}catch{_0x270d25=![];}return{'currentVersion':_0x5f6abd,'stableVersion':_0x2498b8,'needsUpgrade':_0x270d25,'isPreRelease':![]};}export function printCliUpgradeWarning(_0x25621f){const _0x4e95cf=a71_0x5bc2;if(!_0x25621f[_0x4e95cf(0x99)])return;const _0x2d2d2f=_0x4e95cf(0x9f),_0x32d59b=_0x4e95cf(0xb6),_0x10f23e=_0x4e95cf(0x98);console[_0x4e95cf(0xa0)](),console[_0x4e95cf(0xa0)](''+_0x2d2d2f+_0x10f23e+_0x4e95cf(0xa6)+_0x32d59b),console[_0x4e95cf(0xa0)](_0x2d2d2f+'\x20\x20\x20当前\x20CLI\x20版本:\x20'+_0x25621f[_0x4e95cf(0x9e)]+_0x32d59b),console[_0x4e95cf(0xa0)](_0x2d2d2f+_0x4e95cf(0xa3)+_0x25621f['stableVersion']+_0x32d59b),console[_0x4e95cf(0xa0)](_0x2d2d2f+_0x4e95cf(0xb3)+_0x32d59b),console[_0x4e95cf(0xa0)]();}function a71_0x4d78(){const _0x3b3ee9=['10DCUezt','522HmuAXi','stableVersion','555775bOjZxi','1772HerEwv','30663OsRNss','2465faHiwj','192KvFrKg','cli','test','\x20\x20\x20升级命令:\x20npm\x20install\x20-g\x20@lovrabet/cli@latest','coerce','30394vcKEkG','\x1b[0m','\x1b[1m','needsUpgrade','package.json','some','utf-8','219971KfIxFM','currentVersion','\x1b[33m','log','1096PRFypx','../..','\x20\x20\x20稳定版本:\x20','4JWSiZE','1015326mdWfLa','↪\x20新版本可用','522600xLhySd','parse'];a71_0x4d78=function(){return _0x3b3ee9;};return a71_0x4d78();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x144850=a72_0x3e7b;(function(_0x225b1b,_0x5646dd){const _0x3fb9ec=a72_0x3e7b,_0xf2c86b=_0x225b1b();while(!![]){try{const _0x22d16d=-parseInt(_0x3fb9ec(0x169))/0x1*(-parseInt(_0x3fb9ec(0x16b))/0x2)+parseInt(_0x3fb9ec(0x16a))/0x3*(-parseInt(_0x3fb9ec(0x168))/0x4)+-parseInt(_0x3fb9ec(0x177))/0x5*(parseInt(_0x3fb9ec(0x16d))/0x6)+parseInt(_0x3fb9ec(0x164))/0x7+parseInt(_0x3fb9ec(0x16f))/0x8*(-parseInt(_0x3fb9ec(0x170))/0x9)+parseInt(_0x3fb9ec(0x174))/0xa*(parseInt(_0x3fb9ec(0x16e))/0xb)+parseInt(_0x3fb9ec(0x173))/0xc*(-parseInt(_0x3fb9ec(0x17a))/0xd);if(_0x22d16d===_0x5646dd)break;else _0xf2c86b['push'](_0xf2c86b['shift']());}catch(_0x3c9085){_0xf2c86b['push'](_0xf2c86b['shift']());}}}(a72_0x3137,0x5d81b));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';import{initEnv}from'../constant/env.js';function a72_0x3137(){const _0x5b0fc3=['string','trim','278192xuTGqT','1wJsFpG','6EpZixl','580956ZAcemy','replace','6MxoRbT','731434XYSvXq','40rOLxBt','247122DUEmZM','utf8','.lovrabetrc','552204DMDkDt','20ZZikxA','template_base_url','app','382245baJEiG','parse','cwd','65VIEMEw','env','3797199RNlwNn','appcode'];a72_0x3137=function(){return _0x5b0fc3;};return a72_0x3137();}export const projectConfigPath=resolve(process[a72_0x144850(0x179)](),a72_0x144850(0x172));export const globalConfigPath=resolve(homedir(),'.lovrabetrc');export function readConfig(_0x5dbcd0){const _0x41548a=a72_0x144850;let _0x3eee1={};try{if(existsSync(globalConfigPath)){const _0x200c72=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x200c72&&(_0x3eee1=JSON['parse'](_0x200c72));}}catch(_0x5394e5){}try{const _0x504d27=_0x5dbcd0?resolve(_0x5dbcd0,_0x41548a(0x172)):projectConfigPath;if(existsSync(_0x504d27)){const _0x40dd44=readFileSync(_0x504d27,{'encoding':_0x41548a(0x171)});if(_0x40dd44){const _0x2e7b1a=JSON['parse'](_0x40dd44);_0x3eee1={..._0x3eee1,..._0x2e7b1a};}}}catch(_0x338768){}return _0x3eee1[_0x41548a(0x163)]&&typeof _0x3eee1[_0x41548a(0x163)]==='string'&&initEnv(_0x3eee1['env']),_0x3eee1;}export function getConfigAppCode(){const _0x2f4100=a72_0x144850;let _0xbb44eb={},_0x353ff2={};try{if(existsSync(globalConfigPath)){const _0x381075=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x381075&&(_0x353ff2=JSON[_0x2f4100(0x178)](_0x381075));}}catch(_0x12f2b2){}try{if(existsSync(projectConfigPath)){const _0x3ffd3f=readFileSync(projectConfigPath,{'encoding':_0x2f4100(0x171)});_0x3ffd3f&&(_0xbb44eb=JSON[_0x2f4100(0x178)](_0x3ffd3f));}}catch(_0x546e71){}let _0x52da7b;if(_0x2f4100(0x165)in _0xbb44eb)_0x52da7b=_0xbb44eb[_0x2f4100(0x165)];else{if(_0x2f4100(0x176)in _0xbb44eb)_0x52da7b=_0xbb44eb['app'];else{if('appcode'in _0x353ff2)_0x52da7b=_0x353ff2[_0x2f4100(0x165)];else _0x2f4100(0x176)in _0x353ff2&&(_0x52da7b=_0x353ff2[_0x2f4100(0x176)]);}}if(typeof _0x52da7b!==_0x2f4100(0x166)||_0x52da7b[_0x2f4100(0x167)]()==='')return undefined;return _0x52da7b;}export function isInProject(){return existsSync(projectConfigPath);}function a72_0x3e7b(_0x142ce8,_0x339bb3){_0x142ce8=_0x142ce8-0x163;const _0x31375d=a72_0x3137();let _0x3e7b44=_0x31375d[_0x142ce8];return _0x3e7b44;}export function getTemplateBaseUrl(){const _0x37ad2e=a72_0x144850,_0x28bcaf=readConfig();if(_0x28bcaf[_0x37ad2e(0x175)]&&typeof _0x28bcaf[_0x37ad2e(0x175)]==='string')return _0x28bcaf[_0x37ad2e(0x175)][_0x37ad2e(0x16c)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-cli';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d2dbf,_0x4f8280){const _0x395f1d=a73_0x1678,_0x35ee8b=_0x4d2dbf();while(!![]){try{const _0x2685af=parseInt(_0x395f1d(0x157))/0x1*(-parseInt(_0x395f1d(0x152))/0x2)+parseInt(_0x395f1d(0x158))/0x3*(parseInt(_0x395f1d(0x15a))/0x4)+parseInt(_0x395f1d(0x153))/0x5*(parseInt(_0x395f1d(0x150))/0x6)+parseInt(_0x395f1d(0x160))/0x7+parseInt(_0x395f1d(0x155))/0x8*(parseInt(_0x395f1d(0x156))/0x9)+parseInt(_0x395f1d(0x154))/0xa+parseInt(_0x395f1d(0x15f))/0xb*(-parseInt(_0x395f1d(0x15b))/0xc);if(_0x2685af===_0x4f8280)break;else _0x35ee8b['push'](_0x35ee8b['shift']());}catch(_0x507c04){_0x35ee8b['push'](_0x35ee8b['shift']());}}}(a73_0x2221,0xcfe89));function a73_0x2221(){const _0x161247=['isDirectory','4135188ywSbfX','name','6OaTZJX','5tZdUQu','11769700uzGILk','8QmVmvO','1651167Ncivgz','310586XCEOXg','419430rWtLZI','复制目录时出错:','16mFoHNj','1890348sTrAJS','copyFileSync','readdirSync','join','88IfhNvk','3042984zwDNZr','mkdirSync'];a73_0x2221=function(){return _0x161247;};return a73_0x2221();}import a73_0x5e2f40 from'node:path';import a73_0x3c47fa from'node:fs';function a73_0x1678(_0x59233f,_0x9a491b){_0x59233f=_0x59233f-0x150;const _0x222123=a73_0x2221();let _0x167827=_0x222123[_0x59233f];return _0x167827;}export async function copyDirectory(_0x45a22e,_0x4b365e){const _0x15d496=a73_0x1678;try{const _0x52cef2=a73_0x3c47fa[_0x15d496(0x15d)](_0x45a22e,{'withFileTypes':!![]});a73_0x3c47fa[_0x15d496(0x161)](_0x4b365e,{'recursive':!![]});for(const _0x402f9c of _0x52cef2){const _0x57d263=a73_0x5e2f40[_0x15d496(0x15e)](_0x45a22e,_0x402f9c[_0x15d496(0x151)]),_0x2b6a1d=a73_0x5e2f40[_0x15d496(0x15e)](_0x4b365e,_0x402f9c[_0x15d496(0x151)]);_0x402f9c[_0x15d496(0x162)]()?await copyDirectory(_0x57d263,_0x2b6a1d):a73_0x3c47fa[_0x15d496(0x15c)](_0x57d263,_0x2b6a1d);}}catch(_0x31abf8){console['error'](_0x15d496(0x159),_0x31abf8);}}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a74_0x5875(){const _0x58650d=['5643080Xfbuno','645xSGJLD','5452805fmAaSk','32kpdvhg','41935652MVPBzK','isDirectory','13149346VcBgUr','10988ZGngwT','1593lTHQKc','56054XOYJzX','6576PMpLJO','6HWfsrs'];a74_0x5875=function(){return _0x58650d;};return a74_0x5875();}(function(_0x576bfc,_0x1a79d9){const _0x32bdce=a74_0x1fc0,_0x1b9bd4=_0x576bfc();while(!![]){try{const _0x38c6c5=parseInt(_0x32bdce(0x1a6))/0x1*(-parseInt(_0x32bdce(0x1ac))/0x2)+-parseInt(_0x32bdce(0x1a4))/0x3*(-parseInt(_0x32bdce(0x1aa))/0x4)+parseInt(_0x32bdce(0x1a5))/0x5*(-parseInt(_0x32bdce(0x1a2))/0x6)+-parseInt(_0x32bdce(0x1a9))/0x7+-parseInt(_0x32bdce(0x1a1))/0x8*(parseInt(_0x32bdce(0x1ab))/0x9)+parseInt(_0x32bdce(0x1a3))/0xa+parseInt(_0x32bdce(0x1a7))/0xb;if(_0x38c6c5===_0x1a79d9)break;else _0x1b9bd4['push'](_0x1b9bd4['shift']());}catch(_0x57713c){_0x1b9bd4['push'](_0x1b9bd4['shift']());}}}(a74_0x5875,0xe95c8));function a74_0x1fc0(_0x14842d,_0x2d5ccb){_0x14842d=_0x14842d-0x1a1;const _0x58756e=a74_0x5875();let _0x1fc0b8=_0x58756e[_0x14842d];return _0x1fc0b8;}import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x6e5fb9,_0x19d745){const _0x2df0e4=a74_0x1fc0,_0x2f12ba=statSync(_0x6e5fb9);if(_0x2f12ba[_0x2df0e4(0x1a8)]()){!existsSync(_0x19d745)&&mkdirSync(_0x19d745,{'recursive':!![]});const _0x5534b2=readdirSync(_0x6e5fb9);for(const _0x2bd939 of _0x5534b2){await copyDir(join(_0x6e5fb9,_0x2bd939),join(_0x19d745,_0x2bd939));}}else copyFileSync(_0x6e5fb9,_0x19d745);}export function ensureDir(_0x2193d3){!existsSync(_0x2193d3)&&mkdirSync(_0x2193d3,{'recursive':!![]});}export function pathExists(_0x48b6be){return existsSync(_0x48b6be);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a75_0x249fe2=a75_0x4bb1;(function(_0x373af5,_0x2aac71){const _0x4fd947=a75_0x4bb1,_0x17a20d=_0x373af5();while(!![]){try{const _0x4862dd=parseInt(_0x4fd947(0x189))/0x1+parseInt(_0x4fd947(0x190))/0x2+parseInt(_0x4fd947(0x199))/0x3+-parseInt(_0x4fd947(0x1a1))/0x4*(parseInt(_0x4fd947(0x192))/0x5)+-parseInt(_0x4fd947(0x1a6))/0x6+-parseInt(_0x4fd947(0x187))/0x7+parseInt(_0x4fd947(0x18e))/0x8*(-parseInt(_0x4fd947(0x17e))/0x9);if(_0x4862dd===_0x2aac71)break;else _0x17a20d['push'](_0x17a20d['shift']());}catch(_0x3dd11d){_0x17a20d['push'](_0x17a20d['shift']());}}}(a75_0x4cc1,0xee5c6));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x35b183=getTemplateBaseUrl();return _0x35b183+'/skills/guides.json';}function getGuidesExtendCdnUrl(){const _0x10ffbd=a75_0x4bb1,_0x24e306=getTemplateBaseUrl();return _0x24e306+_0x10ffbd(0x197);}function a75_0x4bb1(_0x4dc7bd,_0x5f24ba){_0x4dc7bd=_0x4dc7bd-0x17d;const _0x4cc1c0=a75_0x4cc1();let _0x4bb1c2=_0x4cc1c0[_0x4dc7bd];return _0x4bb1c2;}const CACHE_DIR=join(process['env'][a75_0x249fe2(0x19c)]||process[a75_0x249fe2(0x181)]['USERPROFILE']||'',a75_0x249fe2(0x18a),a75_0x249fe2(0x1a2));export async function fetchGuidesFromCDN(_0x3d62a8=![]){const _0x514f40=a75_0x249fe2,_0x1cd2b1=getGuidesCdnUrl(),_0xab1ffd=await fetch(_0x1cd2b1,{'headers':{'Accept':'application/json'}});if(!_0xab1ffd['ok'])throw new Error(_0x514f40(0x1a3)+_0xab1ffd['status']+'\x20'+_0xab1ffd[_0x514f40(0x17d)]);const _0x390645=await _0xab1ffd['json']();if(!_0x390645['guides']||typeof _0x390645[_0x514f40(0x19a)]!==_0x514f40(0x1a5))throw new Error('CDN\x20返回数据格式错误');if(!_0x3d62a8)return _0x390645;try{const _0x441e3b=getGuidesExtendCdnUrl(),_0x41cb1e=await fetch(_0x441e3b,{'headers':{'Accept':_0x514f40(0x182)}});if(_0x41cb1e['ok']){const _0xb3dd75=await _0x41cb1e[_0x514f40(0x18d)]();_0xb3dd75[_0x514f40(0x19a)]&&typeof _0xb3dd75[_0x514f40(0x19a)]===_0x514f40(0x1a5)&&(_0x390645[_0x514f40(0x19a)]={..._0x390645[_0x514f40(0x19a)],..._0xb3dd75[_0x514f40(0x19a)]});}}catch{}return _0x390645;}export function writeGuidesToProject(_0x1c2c05,_0x217d35,_0x5caf0f=a75_0x249fe2(0x19f),_0x3a42ca){const _0x73e1b3=a75_0x249fe2,_0x45c114=join(_0x217d35,_0x5caf0f);for(const [_0x51bb22,_0xd34003]of Object[_0x73e1b3(0x18f)](_0x1c2c05['guides'])){if(_0xd34003['requireFlags']&&_0xd34003['requireFlags'][_0x73e1b3(0x1a9)]>0x0){const _0x24312c=_0xd34003[_0x73e1b3(0x188)][_0x73e1b3(0x1a8)](_0x26dcc3=>_0x3a42ca?.['includes'](_0x26dcc3));if(!_0x24312c)continue;}const _0x344d48=join(_0x45c114,_0x51bb22);mkdirSync(_0x344d48,{'recursive':!![]});let _0x33b04b=_0xd34003[_0x73e1b3(0x196)];_0xd34003[_0x73e1b3(0x186)]&&(_0x33b04b=appendUpdateTime(_0x33b04b,_0xd34003[_0x73e1b3(0x186)])),writeFileSync(join(_0x344d48,_0x73e1b3(0x1a7)),_0x33b04b,_0x73e1b3(0x18b));}}export function appendUpdateTime(_0x233e74,_0x43d3a2){const _0x1ae999=a75_0x249fe2;return _0x233e74=_0x233e74[_0x1ae999(0x1a0)](/\n*>更新时间:.*$/m,''),_0x233e74['trimEnd']()+('\x0a\x0a>更新时间:'+_0x43d3a2);}export function getSkillTemplate(_0x43b21f){const _0x23d797=a75_0x249fe2;return _0x43b21f[_0x23d797(0x185)]?.[_0x23d797(0x196)]||'';}export function appendExtendContents(_0x8a8e8f,_0x2ecd92,_0x2b4f5a){const _0x4f6580=a75_0x249fe2,_0x315fec=[];for(const [_0x34d10b,_0x795566]of Object['entries'](_0x2ecd92[_0x4f6580(0x19a)])){if(_0x795566[_0x4f6580(0x188)]&&_0x795566[_0x4f6580(0x188)][_0x4f6580(0x1a9)]>0x0){const _0x4ba05b=_0x795566[_0x4f6580(0x188)][_0x4f6580(0x1a8)](_0x244b97=>_0x2b4f5a?.[_0x4f6580(0x193)](_0x244b97));if(!_0x4ba05b)continue;}_0x795566[_0x4f6580(0x184)]&&_0x315fec['push'](_0x795566[_0x4f6580(0x184)][_0x4f6580(0x194)]());}if(_0x315fec['length']===0x0)return _0x8a8e8f;return _0x8a8e8f[_0x4f6580(0x194)]()+'\x0a\x0a'+_0x315fec[_0x4f6580(0x183)]('\x0a\x0a')+'\x0a';}function a75_0x4cc1(){const _0x3eb3c4=['HOME','\x0a<!--\x20GUIDES_APPEND\x20-->','<!--\x20GUIDES_APPEND\x20-->','.lovrabet/skill/.shared/guides','replace','3656476Rjnbgo','cache','CDN\x20请求失败:\x20','sort','object','3237360yEvgse','guide.md','some','length','statusText','9vkzmZC','|\x20`','path','env','application/json','join','extendContent','skillTemplate','lastUpdated','2367421radqbH','requireFlags','705949JsJWoq','.lovrabet','utf-8','keys','json','11936048qFSrpY','entries','3462192msxSkK','title','5lQTnZC','includes','trimEnd','CDN\x20数据中缺少\x20skillTemplate','content','/skills/guides-extend.json','map','5469507tSfkXV','guides','`\x20|\x20'];a75_0x4cc1=function(){return _0x3eb3c4;};return a75_0x4cc1();}export function writeSkillFile(_0x11b078,_0x5294d3,_0x5d9b3b,_0x3cbb43){const _0x993dbb=a75_0x249fe2,_0x52e00f=getSkillTemplate(_0x11b078);if(!_0x52e00f)throw new Error(_0x993dbb(0x195));const _0x29b6d5=dirname(_0x5294d3);mkdirSync(_0x29b6d5,{'recursive':!![]});let _0x5a02c2=_0x52e00f[_0x993dbb(0x1a0)](/\{\{IDE_NAME\}\}/g,_0x5d9b3b);_0x5a02c2=insertGuidesSection(_0x5a02c2,_0x11b078,_0x3cbb43),_0x5a02c2=appendExtendContents(_0x5a02c2,_0x11b078,_0x3cbb43),_0x11b078[_0x993dbb(0x185)]['lastUpdated']&&(_0x5a02c2=appendUpdateTime(_0x5a02c2,_0x11b078[_0x993dbb(0x185)][_0x993dbb(0x186)])),writeFileSync(_0x5294d3,_0x5a02c2,'utf-8');}export function insertGuidesSection(_0x2997d9,_0x1f7bfc,_0x4f9dbc){const _0x4d1664=a75_0x249fe2,_0x1e7747='<!--\x20GUIDES_APPEND\x20-->',_0x56a742=_0x2997d9['indexOf'](_0x1e7747);if(_0x56a742===-0x1)return _0x2997d9;const _0x50e8ba=[],_0x3e048f=Object[_0x4d1664(0x18c)](_0x1f7bfc[_0x4d1664(0x19a)])[_0x4d1664(0x1a4)]();for(const _0xd9d055 of _0x3e048f){const _0x3dc00d=_0x1f7bfc['guides'][_0xd9d055];if(!_0x3dc00d)continue;if(/^0[1-6]-/['test'](_0xd9d055))continue;if(_0x3dc00d[_0x4d1664(0x188)]&&_0x3dc00d[_0x4d1664(0x188)][_0x4d1664(0x1a9)]>0x0){const _0x12b92a=_0x3dc00d['requireFlags']['some'](_0x4f3cbe=>_0x4f9dbc?.['includes'](_0x4f3cbe));if(!_0x12b92a)continue;}const _0x461972=_0x3dc00d[_0x4d1664(0x180)]['replace'](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x50e8ba['push'](_0x4d1664(0x17f)+_0x461972+_0x4d1664(0x19b)+_0x3dc00d[_0x4d1664(0x191)]+'\x20|');}if(_0x50e8ba[_0x4d1664(0x1a9)]===0x0)return _0x2997d9[_0x4d1664(0x1a0)](_0x1e7747,_0x4d1664(0x19e));const _0x1ccefe=_0x50e8ba['join']('\x0a');return _0x2997d9[_0x4d1664(0x1a0)](_0x1e7747,_0x1ccefe+_0x4d1664(0x19d));}export async function installGuides(_0x37e885){const _0x587cb3=a75_0x249fe2,_0x30c406=await fetchGuidesFromCDN();return writeGuidesToProject(_0x30c406,_0x37e885),Object['keys'](_0x30c406[_0x587cb3(0x19a)])[_0x587cb3(0x1a9)];}export function getGuidesSummary(_0x41b643){const _0x1c49c4=a75_0x249fe2;return Object[_0x1c49c4(0x18f)](_0x41b643[_0x1c49c4(0x19a)])[_0x1c49c4(0x198)](([_0x1abfca,_0xe6cfc])=>({'key':_0x1abfca,'title':_0xe6cfc[_0x1c49c4(0x191)],'path':_0xe6cfc[_0x1c49c4(0x180)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2877a2,_0x1ea011){const _0x131eab=a76_0x4e9b,_0x57e0ef=_0x2877a2();while(!![]){try{const _0x587dc8=-parseInt(_0x131eab(0xbc))/0x1*(parseInt(_0x131eab(0xc0))/0x2)+parseInt(_0x131eab(0xbf))/0x3*(-parseInt(_0x131eab(0xc9))/0x4)+parseInt(_0x131eab(0xb7))/0x5+-parseInt(_0x131eab(0xb9))/0x6*(parseInt(_0x131eab(0xc1))/0x7)+parseInt(_0x131eab(0xbe))/0x8*(parseInt(_0x131eab(0xb5))/0x9)+parseInt(_0x131eab(0xce))/0xa+-parseInt(_0x131eab(0xca))/0xb;if(_0x587dc8===_0x1ea011)break;else _0x57e0ef['push'](_0x57e0ef['shift']());}catch(_0x48aadd){_0x57e0ef['push'](_0x57e0ef['shift']());}}}(a76_0x34cb,0x3a383));export async function httpRequest(_0x10027d,_0x4fe644={}){const _0x7052ea=a76_0x4e9b,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x4fe644;let _0x12458c=null;for(let _0x3b61b8=0x0;_0x3b61b8<=retries;_0x3b61b8++){try{const _0x1e25a0=new AbortController(),_0x4d30f0=setTimeout(()=>_0x1e25a0[_0x7052ea(0xb8)](),timeout),_0x18fe3d=await fetch(_0x10027d,{'headers':headers,'signal':_0x1e25a0['signal']});clearTimeout(_0x4d30f0);let _0x572d0c;const _0x3fd040=_0x18fe3d['headers'][_0x7052ea(0xc2)]('content-type');return _0x3fd040?.['includes'](_0x7052ea(0xd0))?_0x572d0c=await _0x18fe3d[_0x7052ea(0xba)]():_0x572d0c=await _0x18fe3d['text'](),{'ok':_0x18fe3d['ok'],'status':_0x18fe3d['status'],'statusText':_0x18fe3d[_0x7052ea(0xc7)],'data':_0x572d0c,'headers':_0x18fe3d[_0x7052ea(0xcb)],'url':_0x18fe3d[_0x7052ea(0xb6)],'text':()=>_0x18fe3d[_0x7052ea(0xc5)]()};}catch(_0x45929c){_0x12458c=_0x45929c instanceof Error?_0x45929c:new Error(String(_0x45929c));if(_0x3b61b8===retries)break;if(shouldRetry(_0x45929c)){console[_0x7052ea(0xd2)](_0x7052ea(0xc4)+retryDelay+_0x7052ea(0xbd)+(_0x3b61b8+0x1)+_0x7052ea(0xc3)),await sleep(retryDelay);continue;}else break;}}throw _0x12458c||new Error(_0x7052ea(0xcc));}function a76_0x34cb(){const _0x419950=['name','2789250CxgLXg','message','application/json','AbortError','log','9lmbnSr','url','1037180lWpNxn','abort','176178ePAdyp','json','includes','48hdGiXS','ms\x20后进行第\x20','3029984CHYAIS','121713GBFwnV','10694gCuqqa','49WZGDJD','get','\x20次重试...','*\x20请求失败,','text','ENOTFOUND','statusText','fetch','12wCxQKM','470052NJcIHA','headers','Request\x20failed'];a76_0x34cb=function(){return _0x419950;};return a76_0x34cb();}function a76_0x4e9b(_0x54aa5f,_0x1a247a){_0x54aa5f=_0x54aa5f-0xb5;const _0x34cb2f=a76_0x34cb();let _0x4e9b44=_0x34cb2f[_0x54aa5f];return _0x4e9b44;}function shouldRetry(_0x3d4d66){const _0xf0d638=a76_0x4e9b;if(_0x3d4d66 instanceof Error){if(_0x3d4d66[_0xf0d638(0xcd)]===_0xf0d638(0xd1))return![];if(_0x3d4d66['name']==='TypeError'&&_0x3d4d66[_0xf0d638(0xcf)][_0xf0d638(0xbb)](_0xf0d638(0xc8)))return!![];if(_0x3d4d66[_0xf0d638(0xcf)][_0xf0d638(0xbb)]('ECONNRESET'))return!![];if(_0x3d4d66[_0xf0d638(0xcf)][_0xf0d638(0xbb)](_0xf0d638(0xc6)))return![];}return![];}function sleep(_0x17765b){return new Promise(_0x3f4e8e=>setTimeout(_0x3f4e8e,_0x17765b));}export function validateUrl(_0x5c6272){try{return new URL(_0x5c6272),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a77_0x183510=a77_0x74ba;(function(_0x44aad2,_0x31849b){const _0x534aa6=a77_0x74ba,_0x15b3b4=_0x44aad2();while(!![]){try{const _0x16c539=parseInt(_0x534aa6(0x1d7))/0x1+parseInt(_0x534aa6(0x201))/0x2*(parseInt(_0x534aa6(0x1e3))/0x3)+-parseInt(_0x534aa6(0x1ea))/0x4+-parseInt(_0x534aa6(0x1f9))/0x5*(-parseInt(_0x534aa6(0x1df))/0x6)+parseInt(_0x534aa6(0x1e4))/0x7+parseInt(_0x534aa6(0x1fb))/0x8+-parseInt(_0x534aa6(0x1d6))/0x9*(parseInt(_0x534aa6(0x1dd))/0xa);if(_0x16c539===_0x31849b)break;else _0x15b3b4['push'](_0x15b3b4['shift']());}catch(_0x58d351){_0x15b3b4['push'](_0x15b3b4['shift']());}}}(a77_0xb454,0x3723a));import a77_0x1439e6 from'winston';import a77_0x2e90c7 from'node:fs';function a77_0xb454(){const _0x2b70b4=['warn','now','setRawCommand','2lBzJFT','trim','logFilePath','log','readFileSync','clearLogs','format','36qPWGIY','320292aebudi','green','Failed\x20to\x20clear\x20logs:','writeFileSync','map','printf','1825410YQasnv','winstonLogger','357438ivwCMJ','info','parse','File','342165jGWNqI','1342278cpSrAJ','join','setLogPath','transports','initWinstonLogger','errors','473080hmpWuU','split','details','logTask','dirname','red','readLogs','level','Failed\x20to\x20read\x20logs:','success','existsSync','getWinstonInstance','error','message','currentRawCommand','10bNHAbO','失败:\x20','2632296uPNBNP','utf8','stringify'];a77_0xb454=function(){return _0x2b70b4;};return a77_0xb454();}function a77_0x74ba(_0x12da8f,_0x2f2569){_0x12da8f=_0x12da8f-0x1d5;const _0xb45424=a77_0xb454();let _0x74bac6=_0xb45424[_0x12da8f];return _0x74bac6;}import a77_0x4c574c from'node:path';class Logger{[a77_0x183510(0x1de)];[a77_0x183510(0x203)];[a77_0x183510(0x1f8)]='';constructor(){const _0x4af998=a77_0x183510;this[_0x4af998(0x203)]='';}[a77_0x183510(0x200)](_0x3f3e2c){const _0x5eb144=a77_0x183510;this[_0x5eb144(0x1f8)]=_0x3f3e2c;}[a77_0x183510(0x1e8)](){const _0x2cba26=a77_0x183510,_0x41dbe8=a77_0x4c574c[_0x2cba26(0x1ee)](this['logFilePath']);!a77_0x2e90c7[_0x2cba26(0x1f4)](_0x41dbe8)&&a77_0x2e90c7['mkdirSync'](_0x41dbe8,{'recursive':!![]});const _0xd42138=a77_0x1439e6[_0x2cba26(0x1d5)]['combine'](a77_0x1439e6['format']['timestamp'](),a77_0x1439e6[_0x2cba26(0x1d5)][_0x2cba26(0x1e9)]({'stack':!![]}),a77_0x1439e6['format'][_0x2cba26(0x1dc)](_0x1a8312=>{const _0x38cbea=_0x2cba26,_0x108ad8={'timestamp':_0x1a8312['timestamp']||new Date()['toISOString'](),'level':_0x1a8312[_0x38cbea(0x1f1)]||_0x38cbea(0x1e0),'command':_0x1a8312['command']||'unknown','rawCommand':_0x1a8312['rawCommand']||this[_0x38cbea(0x1f8)]||undefined,'message':_0x1a8312[_0x38cbea(0x1f7)]||'','duration':_0x1a8312['duration']||undefined,'details':_0x1a8312[_0x38cbea(0x1ec)]||undefined};return JSON[_0x38cbea(0x1fd)](_0x108ad8);}));this['winstonLogger']=a77_0x1439e6['createLogger']({'level':_0x2cba26(0x1e0),'format':_0xd42138,'transports':[new a77_0x1439e6[(_0x2cba26(0x1e7))][(_0x2cba26(0x1e2))]({'filename':this[_0x2cba26(0x203)],'level':'info'})],'silent':![]}),a77_0x1439e6['addColors']({'success':_0x2cba26(0x1d8),'error':_0x2cba26(0x1ef),'warn':'yellow','info':'blue'});}[a77_0x183510(0x1e6)](_0x5d131e){const _0x43d9d9=a77_0x183510;this[_0x43d9d9(0x203)]=a77_0x4c574c[_0x43d9d9(0x1e5)](_0x5d131e,'.lovrabet.log'),this[_0x43d9d9(0x1de)]&&this[_0x43d9d9(0x1de)]['clear'](),this[_0x43d9d9(0x1e8)]();}[a77_0x183510(0x1e0)](_0xfa5046,_0x44f648,_0x41c534){const _0x24085b=a77_0x183510;if(!this['logFilePath']||!this[_0x24085b(0x1de)])return;this['winstonLogger']['info'](_0x44f648,{'command':_0xfa5046,'details':_0x41c534});}[a77_0x183510(0x1f3)](_0xd521c,_0x3c96ed,_0x1224f3,_0x1afccd){const _0x1bd55f=a77_0x183510;if(!this['logFilePath']||!this[_0x1bd55f(0x1de)])return;this[_0x1bd55f(0x1de)][_0x1bd55f(0x204)]('info',_0x3c96ed,{'level':'success','command':_0xd521c,'duration':_0x1224f3,'details':_0x1afccd});}[a77_0x183510(0x1f6)](_0x4654b4,_0x350100,_0x342900){const _0x57b364=a77_0x183510;if(!this[_0x57b364(0x203)]||!this[_0x57b364(0x1de)])return;this[_0x57b364(0x1de)]['error'](_0x350100,{'command':_0x4654b4,'details':_0x342900});}[a77_0x183510(0x1fe)](_0x4cdc84,_0x4ca757,_0x4b5574){const _0x1fee83=a77_0x183510;if(!this[_0x1fee83(0x203)]||!this[_0x1fee83(0x1de)])return;this[_0x1fee83(0x1de)][_0x1fee83(0x1fe)](_0x4ca757,{'command':_0x4cdc84,'details':_0x4b5574});}async[a77_0x183510(0x1ed)](_0x16a619,_0x284c5a,_0x1e278c){const _0x42eec0=a77_0x183510,_0x58bf34=Date[_0x42eec0(0x1ff)]();this['info'](_0x16a619,'开始执行:\x20'+_0x284c5a);try{const _0x47e609=await _0x1e278c(),_0x4465ef=Date['now']()-_0x58bf34;return this[_0x42eec0(0x1f3)](_0x16a619,'完成:\x20'+_0x284c5a,_0x4465ef),_0x47e609;}catch(_0x26e98b){const _0x168331=Date[_0x42eec0(0x1ff)]()-_0x58bf34;this[_0x42eec0(0x1f6)](_0x16a619,_0x42eec0(0x1fa)+_0x284c5a,{'error':_0x26e98b instanceof Error?_0x26e98b['message']:String(_0x26e98b),'duration':_0x168331});throw _0x26e98b;}}[a77_0x183510(0x1f0)](){const _0x425a66=a77_0x183510;try{if(!a77_0x2e90c7[_0x425a66(0x1f4)](this['logFilePath']))return[];const _0x582142=a77_0x2e90c7[_0x425a66(0x205)](this[_0x425a66(0x203)],_0x425a66(0x1fc));return _0x582142[_0x425a66(0x1eb)]('\x0a')['filter'](_0x16ad51=>_0x16ad51[_0x425a66(0x202)]())[_0x425a66(0x1db)](_0x1d1ebf=>JSON[_0x425a66(0x1e1)](_0x1d1ebf));}catch(_0x121396){return console[_0x425a66(0x1fe)](_0x425a66(0x1f2),_0x121396),[];}}[a77_0x183510(0x206)](){const _0x179b27=a77_0x183510;try{a77_0x2e90c7[_0x179b27(0x1f4)](this['logFilePath'])&&a77_0x2e90c7[_0x179b27(0x1da)](this[_0x179b27(0x203)],'','utf8');}catch(_0x2464ba){console[_0x179b27(0x1fe)](_0x179b27(0x1d9),_0x2464ba);}}[a77_0x183510(0x1f5)](){const _0x257317=a77_0x183510;return this[_0x257317(0x1de)];}}export const logger=new Logger();
|