@lovrabet/cli 1.3.4 → 1.4.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ai-setup/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/update-menu.js +1 -0
- 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.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-execa.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -1
- package/lib/i18n/hooks.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/i18n/locales/en-US.js +1 -1
- package/lib/i18n/locales/zh-CN.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -0
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +5 -5
- package/sidecar/flags.json +10 -0
- package/templates/rules/lovrabet_rules.mdc.tpl +891 -0
- package/templates/skill/SKILL.md.tpl +120 -0
- package/lib/ai-setup/AISetupUI.js +0 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
- package/lib/skills/SkillInstallUI.js +0 -1
- package/lib/skills/skill-install-non-interactive.js +0 -1
- package/lib/skills/skill-installer.js +0 -1
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a65_0x458c(_0x399e5e,_0x2274d8){_0x399e5e=_0x399e5e-0xcc;const _0x20160f=a65_0x2016();let _0x458c18=_0x20160f[_0x399e5e];return _0x458c18;}const a65_0x252c0b=a65_0x458c;(function(_0x54d9bf,_0x8d6c0b){const _0xa852d9=a65_0x458c,_0x368c09=_0x54d9bf();while(!![]){try{const _0x401b3b=-parseInt(_0xa852d9(0xf1))/0x1+-parseInt(_0xa852d9(0xd5))/0x2*(parseInt(_0xa852d9(0x11a))/0x3)+parseInt(_0xa852d9(0xd4))/0x4*(parseInt(_0xa852d9(0x13a))/0x5)+-parseInt(_0xa852d9(0x133))/0x6+parseInt(_0xa852d9(0x11b))/0x7+-parseInt(_0xa852d9(0x10a))/0x8*(-parseInt(_0xa852d9(0x127))/0x9)+-parseInt(_0xa852d9(0x13e))/0xa*(-parseInt(_0xa852d9(0xdc))/0xb);if(_0x401b3b===_0x8d6c0b)break;else _0x368c09['push'](_0x368c09['shift']());}catch(_0x10a9c2){_0x368c09['push'](_0x368c09['shift']());}}}(a65_0x2016,0xcf84a));import{writeFileSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';import{createInterface}from'node:readline';import{logger}from'../utils/logger.js';import{copyDir}from'../utils/file-utils.js';import{IDE_CONFIGS,CORE_IDE_LIST,ALL_CORE_IDES}from'../utils/ai_config.js';import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a65_0x3aefc9 from'../i18n/index.js';const t=a65_0x3aefc9['t'][a65_0x252c0b(0xe8)](a65_0x3aefc9),__dirname=dirname(fileURLToPath(import.meta.url));export function camelCaseFlagsToKebab(_0x304a24){const _0x46419a=a65_0x252c0b,_0x42e88f=[];for(const [_0x1b1ef5,_0x582dbb]of Object[_0x46419a(0x138)](_0x304a24)){if(_0x582dbb===!![]){const _0x16388e=_0x1b1ef5[_0x46419a(0x13f)](/([A-Z])/g,'-$1')[_0x46419a(0x105)]();_0x42e88f['push'](_0x16388e);}}return _0x42e88f;}export function parseDynamicFlags(){const _0x3a533c=a65_0x252c0b,_0x54fca8=[];for(let _0x2bf905=0x3;_0x2bf905<process[_0x3a533c(0x118)][_0x3a533c(0xf0)];_0x2bf905++){const _0x247af6=process[_0x3a533c(0x118)][_0x2bf905];if(_0x247af6&&_0x247af6[_0x3a533c(0xd1)]('--')){const _0x44e77a=_0x247af6[_0x3a533c(0x137)](0x2);_0x44e77a&&!_0x44e77a['includes']('=')&&_0x54fca8['push'](_0x44e77a);}}return _0x54fca8;}export function getAllProvidedFlags(_0x57d693){const _0x1c292d=a65_0x252c0b,_0x442dfb=camelCaseFlagsToKebab(_0x57d693),_0x6fa608=parseDynamicFlags(),_0x25fe53=new Set([..._0x442dfb,..._0x6fa608]);return Array[_0x1c292d(0x126)](_0x25fe53);}export async function skillsCommand(_0x5be5d2,_0x170ade,_0x535ec2){const _0x55d55f=a65_0x252c0b;logger['setLogPath'](process[_0x55d55f(0x11f)]());if(_0x535ec2?.['help']||_0x5be5d2===_0x55d55f(0xd3)){showHelp();return;}_0x5be5d2!==_0x55d55f(0x101)&&(console[_0x55d55f(0xcd)](t(_0x55d55f(0xdb),{'cmd':_0x5be5d2||_0x55d55f(0xec)})),console[_0x55d55f(0xd2)](t(_0x55d55f(0xe6))),console[_0x55d55f(0xd2)](t('skill.errorHint.installInteractive')),console[_0x55d55f(0xd2)](t(_0x55d55f(0xfc))),console[_0x55d55f(0xd2)](t(_0x55d55f(0xf5))),console[_0x55d55f(0xd2)](t(_0x55d55f(0x131))),console[_0x55d55f(0xd2)](t(_0x55d55f(0xf3))),console[_0x55d55f(0xd2)](t('skill.errorHint.exampleDirect')),logger[_0x55d55f(0xcd)]('skill','不支持的命令:\x20'+_0x5be5d2),process[_0x55d55f(0x128)](0x1));let _0x5c2053=_0x170ade?.[0x0];const _0x46230c=getAllProvidedFlags(_0x535ec2??{});_0x5c2053?.[_0x55d55f(0xd1)]('--')&&(_0x5c2053=undefined),await installSkill(_0x5c2053??_0x55d55f(0x13b),_0x46230c);}function a65_0x2016(){const _0x210a9f=['.lovrabet/skill-manifest.json','16504fHXtWk','skill.help.installWithBff','close','skill.select.inputFormat','name','question','skill.done.success','toISOString','skill.help.supportedIDEs','skill.help.installInteractive','trim','skill.help.installDirect','skill.help.title','folders','argv','skill.cdn.fetchSuccess','5283WuVFNO','1736903ilurdb','skill.help.installMethods','skill.help.afterInstall','skill.help.guidesLocationTitle','cwd','安装成功','split','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20cursor\x20--dangerously-bff-save\x0a\x0a','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x0a','skill.help.skillContents','skill.help.afterInstallList','from','5760ShKMfP','exit','skill.cdn.fetchingExtend','skill.generic','skill.help.bffOption','keys','stringify','\x0a\x20\x20.lovrabet/skill/.shared/guides/01-typescript-sdk/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/02-mcp-sql-workflow/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/03-antd-style/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/04-troubleshooting/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/05-api-integration/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/06-menu-management/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/07-backend-function/guide.md\x0a\x20\x20','\x0a\x20\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20\x20','\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','skill.errorHint.usageExamples','skill.help.interactiveKeys','9998082DsFRkS','files','includes','../../cdn-source/skills','slice','entries','skill.installing.createdDir','5tJhyYt','agent','skill.select.inputHint','skill.cdn.fetchFailed','40VOCgKM','replace','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20\x20#\x20','error','\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x0a','all','.lovrabet','startsWith','log','--help','4151276KDEkCj','566nOtWqd','skill.help.installAll','skill.help.exampleBffDesc','skill.select.prompt','skill.installing.created','stdout','skill.error.unsupportedCommand','4347101dWCbpo','message','skill.help.showHelp','2.0.0','\x0a\x20\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','filter','skill.help.exampleDirectDesc','path','skill.done.guidesLocation','skill-install','skill.errorHint.availableCommands','skill.help.directInstall','bind','skill.help.examples','description','\x0a\x20\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(empty)','guides','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20','skill.error.noValidIDE','length','1172328QnsjXx','skill.help.exampleInteractive','skill.errorHint.exampleInteractive','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x0a','skill.errorHint.showHelp','some','skill.select.noneSelected','skill.select.cancel','skill.done.guidesPath','\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x0a','skill.error.unknownPlatform','skill.errorHint.installDirect','skill.cdn.fetching','skill.help.agentDesc','skill.error.installFailed','\x0a\x20\x20\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20','install','\x20\x20q.\x20','skill.select.installAll','push','toLowerCase','warn','skill.help.bffWorkflow','skill.select.cancelled'];a65_0x2016=function(){return _0x210a9f;};return a65_0x2016();}async function selectIDEs(){const _0x399590=a65_0x252c0b;return console[_0x399590(0xd2)](t('skill.select.title')),CORE_IDE_LIST['forEach']((_0x2d33e8,_0xb08512)=>{const _0x59ebd6=_0x399590;console['log']('\x20\x20'+(_0xb08512+0x1)+'.\x20'+IDE_CONFIGS[_0x2d33e8][_0x59ebd6(0x10e)]+'\x20-\x20'+IDE_CONFIGS[_0x2d33e8][_0x59ebd6(0xea)]);}),console[_0x399590(0xd2)]('\x20\x200.\x20'+t(_0x399590(0x103))),console['log'](_0x399590(0x102)+t(_0x399590(0xf8))+'\x0a'),console[_0x399590(0xd2)](t(_0x399590(0x10d))),console[_0x399590(0xd2)](t(_0x399590(0x13c))),new Promise(_0x454123=>{const _0x1e7f8c=_0x399590,_0xb75891=createInterface({'input':process['stdin'],'output':process[_0x1e7f8c(0xda)]});_0xb75891[_0x1e7f8c(0x10f)](t(_0x1e7f8c(0xd8)),_0x4eb30b=>{const _0x56f10c=_0x1e7f8c;_0xb75891[_0x56f10c(0x10c)]();const _0x501279=_0x4eb30b[_0x56f10c(0x114)]()[_0x56f10c(0x105)]();(_0x501279==='q'||_0x501279==='quit'||_0x501279===_0x56f10c(0x128))&&(console[_0x56f10c(0xd2)](t(_0x56f10c(0x108))),process['exit'](0x0));if(_0x501279==='0'||_0x501279==='all'){_0x454123(['all']);return;}const _0x558a01=_0x501279[_0x56f10c(0x121)](/\s+/)[_0x56f10c(0xe1)](Boolean),_0x12d5d7=[];for(const _0x1b6749 of _0x558a01){const _0xfb3230=parseInt(_0x1b6749,0xa);if(!isNaN(_0xfb3230)&&_0xfb3230>=0x1&&_0xfb3230<=CORE_IDE_LIST[_0x56f10c(0xf0)]){const _0x19c468=CORE_IDE_LIST[_0xfb3230-0x1];_0x19c468&&!_0x12d5d7[_0x56f10c(0x135)](_0x19c468)&&_0x12d5d7[_0x56f10c(0x104)](_0x19c468);}}_0x12d5d7[_0x56f10c(0xf0)]===0x0&&(console[_0x56f10c(0xd2)](t(_0x56f10c(0xf7))),process[_0x56f10c(0x128)](0x0)),_0x454123(_0x12d5d7);});});}function showHelp(){const _0x1229da=a65_0x252c0b;console[_0x1229da(0xd2)]('\x0a'+t(_0x1229da(0x116))+'\x0a\x0a'+t('skill.help.usage')+_0x1229da(0x130)+t(_0x1229da(0xde))+_0x1229da(0xeb)+t(_0x1229da(0x113))+_0x1229da(0xe0)+t(_0x1229da(0x115))+'\x0a\x20\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t('skill.help.installAll')+_0x1229da(0x12f)+t(_0x1229da(0x10b))+'\x0a\x0a'+t(_0x1229da(0x11c))+'\x0a'+t('skill.help.interactiveSelect')+_0x1229da(0x123)+t(_0x1229da(0x132))+'\x0a\x0a'+t(_0x1229da(0xe7))+_0x1229da(0xee)+t(_0x1229da(0x115))+_0x1229da(0xcc)+t(_0x1229da(0xd6))+_0x1229da(0x100)+t(_0x1229da(0xd6))+'\x0a\x0a'+t(_0x1229da(0x107))+_0x1229da(0x122)+t(_0x1229da(0x112))+'\x0a\x20\x20--cursor\x20\x20\x20\x20\x20\x20\x20Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)\x0a\x20\x20--windsurf\x20\x20\x20\x20\x20Windsurf\x20IDE\x20(.windsurf/workflows/)\x0a\x20\x20--claude\x20\x20\x20\x20\x20\x20\x20Claude\x20Code\x20(.claude/skills/)\x0a\x20\x20--cline\x20\x20\x20\x20\x20\x20\x20\x20Cline\x20IDE\x20(.cline/skills/)\x0a\x20\x20--codex\x20\x20\x20\x20\x20\x20\x20\x20Codex\x20IDE\x20(.codex/skills/)\x0a\x20\x20--opencode\x20\x20\x20\x20\x20OpenCode\x20IDE\x20(.opencode/skills/)\x0a\x20\x20--qoder\x20\x20\x20\x20\x20\x20\x20\x20Qoder\x20IDE\x20(.qoder/rules/\x20+\x20.qoder/skills/)\x0a\x20\x20--codebuddy\x20\x20\x20\x20CodeBuddy\x20IDE\x20(.codebuddy/skills/)\x0a\x20\x20--trae\x20\x20\x20\x20\x20\x20\x20\x20\x20Trae\x20IDE\x20(.trae/skills/)\x0a\x20\x20--agent\x20\x20\x20\x20\x20\x20\x20\x20'+t(_0x1229da(0xfe))+'\x0a\x20\x20--antigravity\x20\x20Antigravity\x20IDE\x20(.agent/skills/)\x0a\x20\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t('skill.help.allDesc')+'\x0a\x0a'+t('skill.help.options')+'\x0a'+t(_0x1229da(0x12b))+'\x0a\x0a'+t(_0x1229da(0x124))+'\x0a'+t('skill.help.skillContentsList')+'\x0a\x0a'+t(_0x1229da(0xe9))+_0x1229da(0xce)+t(_0x1229da(0xf2))+_0x1229da(0xfa)+t(_0x1229da(0xe2))+_0x1229da(0xf4)+t(_0x1229da(0xd7))+'\x0a\x0a\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x0a'+t('skill.help.exampleAllDesc')+'\x0a\x0a'+t(_0x1229da(0x11d))+'\x0a'+t(_0x1229da(0x125))+'\x0a\x0a'+t(_0x1229da(0x11e))+_0x1229da(0x12e));}async function installSkill(_0x17d1dc,_0x485a42){const _0x1a9224=a65_0x252c0b,_0x59a894=process[_0x1a9224(0x11f)](),_0x1cad86=resolve(__dirname,_0x1a9224(0x136));let _0x2b8cfe=[];!_0x17d1dc?_0x2b8cfe=await selectIDEs():_0x2b8cfe=[_0x17d1dc];_0x2b8cfe[_0x1a9224(0x135)](_0x1a9224(0xcf))&&(_0x2b8cfe=[...ALL_CORE_IDES,'agent']);const _0xf4e21b=[];for(const _0x4b3dbd of _0x2b8cfe){if(_0x4b3dbd===_0x1a9224(0x13b))_0xf4e21b['push'](_0x1a9224(0x13b));else{if(_0x4b3dbd===_0x1a9224(0xcf))continue;else IDE_CONFIGS[_0x4b3dbd]?_0xf4e21b['push'](_0x4b3dbd):(console['log'](t(_0x1a9224(0xfb),{'ide':_0x4b3dbd})),_0xf4e21b[_0x1a9224(0x104)](_0x1a9224(0x13b)));}}_0xf4e21b[_0x1a9224(0xf0)]===0x0&&(console[_0x1a9224(0xd2)](t(_0x1a9224(0xef))),process[_0x1a9224(0x128)](0x0));const _0x22c4d6=_0x485a42&&_0x485a42[_0x1a9224(0xf0)]>0x0;console[_0x1a9224(0xd2)](_0x22c4d6?t(_0x1a9224(0x129)):t(_0x1a9224(0xfd)));let _0x16cf83;try{_0x16cf83=await fetchGuidesFromCDN(_0x22c4d6),console[_0x1a9224(0xd2)](t(_0x1a9224(0x119),{'count':Object[_0x1a9224(0x12c)](_0x16cf83[_0x1a9224(0xed)])[_0x1a9224(0xf0)]}));}catch(_0x48b8e0){console[_0x1a9224(0x106)](t(_0x1a9224(0x13d),{'error':_0x48b8e0 instanceof Error?_0x48b8e0[_0x1a9224(0xdd)]:String(_0x48b8e0)}));}let _0x1ad78f=0x0;for(const _0x28e468 of _0xf4e21b){try{const _0x37da53=_0x28e468===_0x1a9224(0x13b)?t(_0x1a9224(0x12a)):IDE_CONFIGS[_0x28e468]?.[_0x1a9224(0x10e)]||_0x28e468;console[_0x1a9224(0xd2)](t('skill.installing.ide',{'name':_0x37da53}));const _0x332d03=_0x28e468==='agent'?undefined:IDE_CONFIGS[_0x28e468],_0x2015b2=await installSingleIDE(_0x28e468,_0x332d03,_0x59a894,_0x1cad86,_0x16cf83,_0x485a42);_0x1ad78f+=_0x2015b2;if(_0x332d03?.[_0x1a9224(0x117)])for(const _0x22985d of _0x332d03[_0x1a9224(0x117)]){const _0x34606a=_0x332d03['files']?.[_0x1a9224(0xf6)](_0x33864d=>_0x33864d['path']['startsWith'](_0x22985d+'/'))??![];_0x34606a?console[_0x1a9224(0xd2)](t(_0x1a9224(0x139),{'path':_0x22985d})):console[_0x1a9224(0xd2)](t(_0x1a9224(0xd9),{'path':_0x22985d}));}if(_0x332d03?.[_0x1a9224(0x134)])for(const _0x52e3fb of _0x332d03[_0x1a9224(0x134)]){console[_0x1a9224(0xd2)](t(_0x1a9224(0xd9),{'path':_0x52e3fb[_0x1a9224(0xe3)]}));}}catch(_0x3b7a37){console['error'](t(_0x1a9224(0xff),{'ide':_0x28e468,'error':_0x3b7a37 instanceof Error?_0x3b7a37[_0x1a9224(0xdd)]:String(_0x3b7a37)}));}}_0x16cf83&&writeGuidesToProject(_0x16cf83,_0x59a894,'.lovrabet/skill/.shared/guides',_0x485a42);const _0x58f30c={'version':_0x1a9224(0xdf),'installedAt':new Date()[_0x1a9224(0x111)](),'platforms':_0xf4e21b},_0x185961=join(_0x59a894,_0x1a9224(0x109)),_0x38a554=join(_0x59a894,_0x1a9224(0xd0));await copyDir(_0x38a554,_0x38a554),writeFileSync(_0x185961,JSON[_0x1a9224(0x12d)](_0x58f30c,null,0x2),'utf-8'),console[_0x1a9224(0xd2)](t('skill.installing.createdManifest')),console[_0x1a9224(0xd2)](t(_0x1a9224(0x110),{'count':_0x1ad78f})),console[_0x1a9224(0xd2)](t(_0x1a9224(0xe4))),console[_0x1a9224(0xd2)](t(_0x1a9224(0xf9))),logger['info'](_0x1a9224(0xe5),_0x1a9224(0x120),{'projectRoot':_0x59a894,'ides':_0xf4e21b,'foldersCount':_0x1ad78f});}
|
|
1
|
+
(function(_0x2c383c,_0x2b0c3e){const _0x52e63d=a64_0x4e4f,_0x568ebd=_0x2c383c();while(!![]){try{const _0x31f7fc=-parseInt(_0x52e63d(0x16b))/0x1+-parseInt(_0x52e63d(0x177))/0x2+-parseInt(_0x52e63d(0x178))/0x3+parseInt(_0x52e63d(0x18a))/0x4+-parseInt(_0x52e63d(0x173))/0x5+-parseInt(_0x52e63d(0x17d))/0x6*(parseInt(_0x52e63d(0x17c))/0x7)+-parseInt(_0x52e63d(0x18c))/0x8*(-parseInt(_0x52e63d(0x183))/0x9);if(_0x31f7fc===_0x2b0c3e)break;else _0x568ebd['push'](_0x568ebd['shift']());}catch(_0x5ddf18){_0x568ebd['push'](_0x568ebd['shift']());}}}(a64_0x1c5e,0x29e4d));import{logger}from'../utils/logger.js';import{NPX_SKILLS_ADD_COMMAND_LINE}from'./npx-skills-add.js';import a64_0x5b5736 from'../i18n/index.js';function a64_0x4e4f(_0x15f3f9,_0x2d53c0){_0x15f3f9=_0x15f3f9-0x16b;const _0x1c5e6e=a64_0x1c5e();let _0x4e4fde=_0x1c5e6e[_0x15f3f9];return _0x4e4fde;}const t=a64_0x5b5736['t']['bind'](a64_0x5b5736);export function camelCaseFlagsToKebab(_0x7de442){const _0x31cdb8=a64_0x4e4f,_0x2ea9be=[];for(const [_0x50abb8,_0x51e947]of Object[_0x31cdb8(0x17b)](_0x7de442)){if(_0x51e947===!![]){const _0x37a4f8=_0x50abb8['replace'](/([A-Z])/g,_0x31cdb8(0x18f))[_0x31cdb8(0x174)]();_0x2ea9be['push'](_0x37a4f8);}}return _0x2ea9be;}function a64_0x1c5e(){const _0x52fdd8=['argv','364540dMdVbo','572148YXzMYH','skill.errorHint.availableCommands','skill.errorHint.installInteractive','entries','7WfRzUt','486654WtumPx','不支持的命令:\x20','skill.help.compactNote','log','skill','dangerously-bff-save','286479xqNwuv','startsWith','\x0a\x20\x20lovrabet\x20skill\x20--help\x0a\x20\x20lovrabet\x20skill\x20install\x0a\x0a','skill.help.title','help','setLogPath','skill.help.equivCommand','1091736PyWdRY','skill.help.usage','224VlIEfM','(empty)','enable-bff-save','-$1','285522mTkMfR','includes','error','skill.error.unsupportedCommand','length','skill.errorHint.showHelp','--help','from','1264940roIzzU','toLowerCase','exit'];a64_0x1c5e=function(){return _0x52fdd8;};return a64_0x1c5e();}export function parseDynamicFlags(){const _0x19dd21=a64_0x4e4f,_0x4faa99=[];for(let _0x201033=0x3;_0x201033<process[_0x19dd21(0x176)][_0x19dd21(0x16f)];_0x201033++){const _0x25c15b=process[_0x19dd21(0x176)][_0x201033];if(_0x25c15b&&_0x25c15b[_0x19dd21(0x184)]('--')){const _0x7148c3=_0x25c15b['slice'](0x2);_0x7148c3&&!_0x7148c3[_0x19dd21(0x16c)]('=')&&_0x4faa99['push'](_0x7148c3);}}return _0x4faa99;}export function getAllProvidedFlags(_0x953608){const _0x2eda7b=a64_0x4e4f,_0x1be602=camelCaseFlagsToKebab(_0x953608),_0xcb64f7=parseDynamicFlags(),_0x3884f1=new Set([..._0x1be602,..._0xcb64f7]);return Array[_0x2eda7b(0x172)](_0x3884f1);}export function normalizeLegacyBffSaveFlags(_0x17b4aa){const _0x2c1fd2=a64_0x4e4f,_0x2cb4d2=new Set(_0x17b4aa);return _0x2cb4d2['has'](_0x2c1fd2(0x182))&&_0x2cb4d2['add'](_0x2c1fd2(0x18e)),Array[_0x2c1fd2(0x172)](_0x2cb4d2);}export async function skillsCommand(_0x110aa1,_0x4a9e0e,_0x237150){const _0x1acaa7=a64_0x4e4f;logger[_0x1acaa7(0x188)](process['cwd']());if(_0x237150?.[_0x1acaa7(0x187)]||_0x110aa1===_0x1acaa7(0x171)){showHelp();return;}console[_0x1acaa7(0x16d)](t(_0x1acaa7(0x16e),{'cmd':_0x110aa1||_0x1acaa7(0x18d)})),console[_0x1acaa7(0x180)](t(_0x1acaa7(0x179))),console['log'](t(_0x1acaa7(0x17a))),console[_0x1acaa7(0x180)](t(_0x1acaa7(0x170))),console[_0x1acaa7(0x180)](''),console['log'](t(_0x1acaa7(0x189),{'command':NPX_SKILLS_ADD_COMMAND_LINE})),logger['error'](_0x1acaa7(0x181),_0x1acaa7(0x17e)+_0x110aa1),process[_0x1acaa7(0x175)](0x1);}function showHelp(){const _0x3c3b35=a64_0x4e4f;console['log']('\x0a'+t(_0x3c3b35(0x186))+'\x0a\x0a'+t(_0x3c3b35(0x18b))+_0x3c3b35(0x185)+t(_0x3c3b35(0x189),{'command':NPX_SKILLS_ADD_COMMAND_LINE})+'\x0a\x0a'+t(_0x3c3b35(0x17f))+'\x0a');}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a65_0x5b8be5=a65_0x7e21;(function(_0x342692,_0x14cc4a){const _0x2a65d6=a65_0x7e21,_0x2fe174=_0x342692();while(!![]){try{const _0x45eebe=parseInt(_0x2a65d6(0x117))/0x1*(-parseInt(_0x2a65d6(0x110))/0x2)+parseInt(_0x2a65d6(0x120))/0x3+-parseInt(_0x2a65d6(0x11e))/0x4*(-parseInt(_0x2a65d6(0x127))/0x5)+-parseInt(_0x2a65d6(0x122))/0x6+parseInt(_0x2a65d6(0x125))/0x7+parseInt(_0x2a65d6(0x112))/0x8*(parseInt(_0x2a65d6(0x11b))/0x9)+-parseInt(_0x2a65d6(0x118))/0xa;if(_0x45eebe===_0x14cc4a)break;else _0x2fe174['push'](_0x2fe174['shift']());}catch(_0x51a92e){_0x2fe174['push'](_0x2fe174['shift']());}}}(a65_0x38cf,0x57d24));import{spawnSync}from'node:child_process';export const NPX_FLAG_YES='-y';export const NPX_SKILLS_CLI=a65_0x5b8be5(0x10e);export const NPX_SKILLS_SUBCOMMAND_ADD='add';function a65_0x7e21(_0x3f8916,_0x3600e3){_0x3f8916=_0x3f8916-0x10d;const _0x38cf8f=a65_0x38cf();let _0x7e21a3=_0x38cf8f[_0x3f8916];return _0x7e21a3;}export const NPX_SKILLS_FLAG_SKILL=a65_0x5b8be5(0x128);export const LOVRABET_SKILL_SOURCE=a65_0x5b8be5(0x116);export const DEFAULT_LOVRABET_SKILL_NAME='Lovrabet';export function buildNpxSkillsAddArgv(_0x474cc2=DEFAULT_LOVRABET_SKILL_NAME){return[NPX_FLAG_YES,NPX_SKILLS_CLI,NPX_SKILLS_SUBCOMMAND_ADD,LOVRABET_SKILL_SOURCE,NPX_SKILLS_FLAG_SKILL,_0x474cc2];}function a65_0x38cf(){const _0x568b95=['pipe','skills','join','76FIeQYR','stdio','8SovTJF','platform','stdout','unknown','lovrabet/lovrabet-skill','6949vVXZLI','5101370mlPIAz','trim','LOVRABET_SKIP_NPX_SKILLS','4438620fmQLZA','status','exit\x20','190708bdzerh','stderr','1076832rNlJSV','toString','3363474sOULpq','env','npx.cmd','1557983FduiBe','npx','65FySONY','--skill'];a65_0x38cf=function(){return _0x568b95;};return a65_0x38cf();}export const NPX_SKILLS_ADD_COMMAND_LINE=[a65_0x5b8be5(0x126),...buildNpxSkillsAddArgv()][a65_0x5b8be5(0x10f)]('\x20');export function shouldSkipNpxSkillsAdd(){const _0x44ef18=a65_0x5b8be5;return process[_0x44ef18(0x123)][_0x44ef18(0x11a)]==='1';}export function runNpxSkillsAdd(_0x25e4a2,_0x1da89a){const _0x55fc63=a65_0x5b8be5;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x3ec82b=_0x1da89a?.[_0x55fc63(0x111)]??'inherit',_0x407b4a=process[_0x55fc63(0x113)]==='win32'?_0x55fc63(0x124):_0x55fc63(0x126),_0x54bb20=buildNpxSkillsAddArgv(_0x1da89a?.['skill']??DEFAULT_LOVRABET_SKILL_NAME),_0x116449=[_0x407b4a,..._0x54bb20][_0x55fc63(0x10f)]('\x20');console['log']('*\x20'+_0x116449);const _0x3cda7e=spawnSync(_0x407b4a,_0x54bb20,{'cwd':_0x25e4a2,'stdio':_0x3ec82b,'env':process['env'],'shell':![]}),_0x56b8e2=_0x3cda7e[_0x55fc63(0x11c)];if(_0x56b8e2===0x0)return{'ok':!![],'status':0x0};let _0x513314=_0x55fc63(0x11d)+(_0x56b8e2??_0x55fc63(0x115));if(_0x3ec82b===_0x55fc63(0x10d)){const _0x3583eb=_0x3cda7e[_0x55fc63(0x11f)]?_0x3cda7e[_0x55fc63(0x11f)][_0x55fc63(0x121)]()[_0x55fc63(0x119)]():'',_0x44d096=_0x3cda7e[_0x55fc63(0x114)]?_0x3cda7e['stdout'][_0x55fc63(0x121)]()['trim']():'';if(_0x3583eb)_0x513314=_0x3583eb;else{if(_0x44d096)_0x513314=_0x44d096;}}return{'ok':![],'status':_0x56b8e2??null,'error':_0x513314};}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fe846,_0x2b7123){const _0x38bedf=a67_0x54cd,_0x11541b=_0x1fe846();while(!![]){try{const _0x5d0040=parseInt(_0x38bedf(0x16a))/0x1+parseInt(_0x38bedf(0x173))/0x2+-parseInt(_0x38bedf(0x17c))/0x3*(-parseInt(_0x38bedf(0x172))/0x4)+parseInt(_0x38bedf(0x175))/0x5+-parseInt(_0x38bedf(0x16e))/0x6+parseInt(_0x38bedf(0x178))/0x7+parseInt(_0x38bedf(0x17d))/0x8*(-parseInt(_0x38bedf(0x179))/0x9);if(_0x5d0040===_0x2b7123)break;else _0x11541b['push'](_0x11541b['shift']());}catch(_0x4dc361){_0x11541b['push'](_0x11541b['shift']());}}}(a67_0x523b,0xaa842));import{jsxs as a67_0xae5608,jsx as a67_0x7b60e1}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';function a67_0x54cd(_0x67f52d,_0x5e6895){_0x67f52d=_0x67f52d-0x168;const _0x523b82=a67_0x523b();let _0x54cdb2=_0x523b82[_0x67f52d];return _0x54cdb2;}function a67_0x523b(){const _0x1a3b54=['description','1967485TvvHEm','red','has','8170827tYnYlY','63aIPEyF','column','[✓]','9VBzaJk','2585624cmAgSk','ui.ideSelector.title','key','357676OGzGne','map','ui.ideSelector.hotkeys','gray','39210ltxrsF','name','[\x20]','blue','661872ROePMD','1105104EPGQrS'];a67_0x523b=function(){return _0x1a3b54;};return a67_0x523b();}export function IDESelector({ideList:_0x45ffde,title:_0x1f0139,selection:_0x4fb11d}){const _0x5536b7=a67_0x54cd,{t:_0x6a9c53}=useI18n(),{selectedIndexes:_0x32c3ab,highlightIndex:_0x45a68d,errorMsg:_0x594512}=_0x4fb11d;return a67_0xae5608(Box,{'flexDirection':_0x5536b7(0x17a),'marginTop':0x1,'children':[a67_0x7b60e1(Box,{'children':a67_0xae5608(Text,{'color':'cyan','children':['*\x20',_0x1f0139]})}),_0x594512&&a67_0x7b60e1(Box,{'marginTop':0x1,'children':a67_0xae5608(Text,{'color':_0x5536b7(0x176),'children':['✗\x20',_0x594512]})}),a67_0xae5608(Box,{'marginTop':0x1,'flexDirection':_0x5536b7(0x17a),'children':[a67_0xae5608(Text,{'bold':!![],'children':['*\x20',_0x6a9c53(_0x5536b7(0x168))]}),_0x45ffde[_0x5536b7(0x16b)]((_0x1064d9,_0x57d834)=>{const _0x5038d1=_0x5536b7,_0x1ca378=_0x45a68d===_0x57d834,_0x59fe33=_0x32c3ab[_0x5038d1(0x177)](_0x57d834);return a67_0x7b60e1(Box,{'children':a67_0xae5608(Text,{'backgroundColor':_0x1ca378?_0x5038d1(0x171):undefined,'color':_0x1ca378?'white':undefined,'children':['\x20\x20',_0x59fe33?_0x5038d1(0x17b):_0x5038d1(0x170),'\x20',_0x1064d9[_0x5038d1(0x16f)],'\x20',a67_0xae5608(Text,{'color':_0x1ca378?'white':_0x5038d1(0x16d),'dimColor':!_0x1ca378,'children':['-\x20',_0x1064d9[_0x5038d1(0x174)]]})]})},_0x1064d9[_0x5038d1(0x169)]);}),a67_0x7b60e1(Box,{'marginTop':0x1,'children':a67_0xae5608(Text,{'color':_0x5536b7(0x16d),'children':['\x20',_0x6a9c53(_0x5536b7(0x16c))]})})]})]});}export{useIDESelection}from'./useIDESelection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5e4fdd,_0x2839b5){const _0x2a1650=a68_0x3a33,_0x4f6ddc=_0x5e4fdd();while(!![]){try{const _0x24d541=-parseInt(_0x2a1650(0x1cd))/0x1+-parseInt(_0x2a1650(0x1c8))/0x2*(-parseInt(_0x2a1650(0x1cb))/0x3)+-parseInt(_0x2a1650(0x1c4))/0x4+parseInt(_0x2a1650(0x1c0))/0x5*(-parseInt(_0x2a1650(0x1c2))/0x6)+-parseInt(_0x2a1650(0x1ce))/0x7+parseInt(_0x2a1650(0x1c3))/0x8*(-parseInt(_0x2a1650(0x1c5))/0x9)+parseInt(_0x2a1650(0x1c6))/0xa*(parseInt(_0x2a1650(0x1bb))/0xb);if(_0x24d541===_0x2839b5)break;else _0x4f6ddc['push'](_0x4f6ddc['shift']());}catch(_0x18a568){_0x4f6ddc['push'](_0x4f6ddc['shift']());}}}(a68_0x433a,0x5f957));import{useState,useCallback}from'react';function a68_0x433a(){const _0xb54166=['size','6SHqtTT','16jCKfPG','2804780vkXZqo','3099258PcGFbu','900cTYnqn','add','8byyrPq','map','length','10683galjOl','has','606771ENcBIU','3197194skZXpG','415657clHJWo','upArrow','key','filter','from','2850655FwOmAr'];a68_0x433a=function(){return _0xb54166;};return a68_0x433a();}function a68_0x3a33(_0x3a8a55,_0x254623){_0x3a8a55=_0x3a8a55-0x1bb;const _0x433a3e=a68_0x433a();let _0x3a33d9=_0x433a3e[_0x3a8a55];return _0x3a33d9;}export function useIDESelection({ideList:_0x16034c,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x1b19c6=a68_0x3a33,[_0x15647b,_0x270583]=useState(new Set(preselectedIDEs[_0x1b19c6(0x1c9)](_0x484b42=>_0x16034c['findIndex'](_0xc37497=>_0xc37497['key']===_0x484b42))[_0x1b19c6(0x1be)](_0x4c2ba5=>_0x4c2ba5>=0x0))),[_0x144aa9,_0x47c7fb]=useState(0x0),[_0x39abb4,_0x53017b]=useState(''),_0x331625=useCallback(()=>{_0x47c7fb(_0x2b0623=>_0x2b0623>0x0?_0x2b0623-0x1:_0x16034c['length']-0x1);},[_0x16034c['length']]),_0x134a05=useCallback(()=>{const _0x3c10bd=_0x1b19c6;_0x47c7fb(_0x55cf82=>_0x55cf82<_0x16034c[_0x3c10bd(0x1ca)]-0x1?_0x55cf82+0x1:0x0);},[_0x16034c[_0x1b19c6(0x1ca)]]),_0xbc5b00=useCallback(()=>{if(!multiSelect){_0x270583(new Set([_0x144aa9]));return;}_0x270583(_0x4e434c=>{const _0x1de015=a68_0x3a33,_0xcda664=new Set(_0x4e434c);return _0xcda664[_0x1de015(0x1cc)](_0x144aa9)?_0xcda664['delete'](_0x144aa9):_0xcda664[_0x1de015(0x1c7)](_0x144aa9),_0xcda664;});},[_0x144aa9,multiSelect]),_0x24d4a9=useCallback(()=>{_0x270583(new Set(_0x16034c['map']((_0x172564,_0x5dfbd5)=>_0x5dfbd5)));},[_0x16034c]),_0x10841a=useCallback(()=>{_0x270583(_0x3867be=>{const _0x2e217c=a68_0x3a33,_0x373425=new Set();for(let _0x5cb95d=0x0;_0x5cb95d<_0x16034c[_0x2e217c(0x1ca)];_0x5cb95d++){!_0x3867be[_0x2e217c(0x1cc)](_0x5cb95d)&&_0x373425[_0x2e217c(0x1c7)](_0x5cb95d);}return _0x373425;});},[_0x16034c]),_0x6dcc1c=useCallback(()=>{const _0x43303c=_0x1b19c6;return Array[_0x43303c(0x1bf)](_0x15647b)[_0x43303c(0x1c9)](_0x2a25fb=>_0x16034c[_0x2a25fb]?.[_0x43303c(0x1bd)])['filter'](_0xa8b408=>_0xa8b408!==undefined);},[_0x15647b,_0x16034c]),_0x235352=useCallback(()=>{const _0x57cd99=_0x1b19c6;return _0x15647b[_0x57cd99(0x1c1)]===_0x16034c[_0x57cd99(0x1ca)];},[_0x15647b,_0x16034c]),_0x58fd34=useCallback((_0x4f09d4,_0x52eb17)=>{const _0x92493c=_0x1b19c6;if(_0x52eb17[_0x92493c(0x1bc)])return _0x331625(),!![];if(_0x52eb17['downArrow'])return _0x134a05(),!![];if(_0x4f09d4==='\x20')return _0xbc5b00(),!![];if(_0x4f09d4==='a'||_0x4f09d4==='A')return _0x24d4a9(),!![];if(_0x4f09d4==='i'||_0x4f09d4==='I'||_0x4f09d4==='r'||_0x4f09d4==='R')return _0x10841a(),!![];return![];},[_0x331625,_0x134a05,_0xbc5b00,_0x24d4a9,_0x10841a]);return{'selectedIndexes':_0x15647b,'highlightIndex':_0x144aa9,'errorMsg':_0x39abb4,'setErrorMsg':_0x53017b,'handleKeyDown':_0x58fd34,'getSelectedIDEs':_0x6dcc1c,'isAllSelected':_0x235352,'toggleSelection':_0xbc5b00,'selectAll':_0x24d4a9,'invertSelection':_0x10841a,'moveHighlightUp':_0x331625,'moveHighlightDown':_0x134a05};}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a69_0x29b531=a69_0x151f;(function(_0x49f7b4,_0x4a74c5){const _0x4dab7e=a69_0x151f,_0x13f319=_0x49f7b4();while(!![]){try{const _0x2e0ae6=parseInt(_0x4dab7e(0x15d))/0x1+-parseInt(_0x4dab7e(0x167))/0x2+parseInt(_0x4dab7e(0x174))/0x3+-parseInt(_0x4dab7e(0x16f))/0x4+parseInt(_0x4dab7e(0x176))/0x5+parseInt(_0x4dab7e(0x15c))/0x6*(parseInt(_0x4dab7e(0x15b))/0x7)+parseInt(_0x4dab7e(0x175))/0x8*(parseInt(_0x4dab7e(0x16c))/0x9);if(_0x2e0ae6===_0x4a74c5)break;else _0x13f319['push'](_0x13f319['shift']());}catch(_0x3ccd7a){_0x13f319['push'](_0x13f319['shift']());}}}(a69_0x4c57,0xa263e));export const CORE_IDE_CONFIGS={'cursor':{'name':a69_0x29b531(0x177),'description':a69_0x29b531(0x161),'folders':[a69_0x29b531(0x17d),a69_0x29b531(0x160)],'files':[{'type':a69_0x29b531(0x17f),'path':a69_0x29b531(0x151),'template':'SKILL.md.tpl'}]},'windsurf':{'name':a69_0x29b531(0x14f),'description':a69_0x29b531(0x163),'folders':[a69_0x29b531(0x173)],'files':[{'type':'file','path':a69_0x29b531(0x165),'template':'SKILL.md.tpl'}]},'claude':{'name':a69_0x29b531(0x182),'description':'Claude\x20Code','folders':[a69_0x29b531(0x171)],'files':[{'type':a69_0x29b531(0x17f),'path':a69_0x29b531(0x17b),'template':a69_0x29b531(0x155)}]},'cline':{'name':'Cline','description':'Cline\x20IDE','folders':[a69_0x29b531(0x166)],'files':[{'type':a69_0x29b531(0x17f),'path':a69_0x29b531(0x154),'template':a69_0x29b531(0x155)}]},'codex':{'name':a69_0x29b531(0x183),'description':a69_0x29b531(0x15a),'folders':[a69_0x29b531(0x180)],'files':[{'type':a69_0x29b531(0x17f),'path':a69_0x29b531(0x16a),'template':a69_0x29b531(0x155)}]},'opencode':{'name':a69_0x29b531(0x156),'description':a69_0x29b531(0x162),'folders':[a69_0x29b531(0x181)],'files':[{'type':'file','path':a69_0x29b531(0x178),'template':a69_0x29b531(0x155)}]},'qoder':{'name':a69_0x29b531(0x170),'description':a69_0x29b531(0x179),'folders':['.qoder'],'files':[{'type':'file','path':'.qoder/rules/lovrabet.md','template':a69_0x29b531(0x155)},{'type':a69_0x29b531(0x17f),'path':'.qoder/skills/lovrabet/SKILL.md','template':a69_0x29b531(0x155)}]},'codebuddy':{'name':a69_0x29b531(0x15e),'description':'CodeBuddy\x20IDE','folders':['.codebuddy'],'files':[{'type':a69_0x29b531(0x17f),'path':a69_0x29b531(0x152),'template':a69_0x29b531(0x155)}]},'trae':{'name':'Trae','description':a69_0x29b531(0x164),'folders':[a69_0x29b531(0x158)],'files':[{'type':'file','path':a69_0x29b531(0x16e),'template':a69_0x29b531(0x155)}]}};export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a69_0x29b531(0x16d),'description':a69_0x29b531(0x172),'folders':[a69_0x29b531(0x17a)],'files':[{'type':a69_0x29b531(0x17f),'path':'.agent/skills/lovrabet/SKILL.md','template':a69_0x29b531(0x155)}]},'antigravity':{'name':a69_0x29b531(0x157),'description':'Antigravity\x20IDE','folders':['.agent'],'files':[{'type':'file','path':'.agent/skills/lovrabet/SKILL.md','template':'SKILL.md.tpl'}]}};function a69_0x151f(_0x27ae63,_0x3e4eca){_0x27ae63=_0x27ae63-0x14f;const _0x4c5771=a69_0x4c57();let _0x151f2d=_0x4c5771[_0x27ae63];return _0x151f2d;}export const CORE_IDE_LIST=[a69_0x29b531(0x168),a69_0x29b531(0x159),'codebuddy',a69_0x29b531(0x153),a69_0x29b531(0x17c),'opencode',a69_0x29b531(0x16b),a69_0x29b531(0x150),a69_0x29b531(0x169)];export const IDE_LIST=['antigravity','claude',a69_0x29b531(0x159),a69_0x29b531(0x17e),a69_0x29b531(0x153),'cursor',a69_0x29b531(0x15f),a69_0x29b531(0x16b),a69_0x29b531(0x150),'windsurf','agent'];function a69_0x4c57(){const _0xc33dc5=['.claude/skills/lovrabet/SKILL.md','cursor','.cursorrules','codebuddy','file','.codex','.opencode','Claude\x20Code','Codex','Windsurf','trae','.cursor/skills/lovrabet.md','.codebuddy/skills/lovrabet/SKILL.md','codex','.cline/skills/lovrabet/SKILL.md','SKILL.md.tpl','OpenCode','Antigravity','.trae','cline','Codex\x20IDE','39305BIOdxB','510HCGnRS','97559moCJBm','CodeBuddy','opencode','.cursor','Cursor\x20IDE','OpenCode\x20IDE','Windsurf\x20IDE','Trae\x20IDE','.windsurf/workflows/lovrabet.md','.cline','2008036wtrYyP','claude','windsurf','.codex/skills/lovrabet/SKILL.md','qoder','243cOStkn','其他\x20(通用模板)','.trae/skills/lovrabet/SKILL.md','5280200dvzJlY','Qoder','.claude','通用模板\x20-\x20兜底方案','.windsurf','847896CnglRL','573848JMXUgy','975075qaxONW','Cursor','.opencode/skills/lovrabet/SKILL.md','Qoder\x20IDE','.agent'];a69_0x4c57=function(){return _0xc33dc5;};return a69_0x4c57();}export const ALL_CORE_IDES=['cursor',a69_0x29b531(0x169),a69_0x29b531(0x168),a69_0x29b531(0x159),a69_0x29b531(0x153),a69_0x29b531(0x15f),a69_0x29b531(0x16b),'codebuddy',a69_0x29b531(0x150)];export const MCP_IDES=new Set([a69_0x29b531(0x17c),a69_0x29b531(0x168)]);
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d3e29,_0xd79c8e){const _0x1fa188=a70_0xe618,_0xec240=_0x3d3e29();while(!![]){try{const _0x404d6b=parseInt(_0x1fa188(0x1c8))/0x1*(parseInt(_0x1fa188(0x1d4))/0x2)+parseInt(_0x1fa188(0x1c6))/0x3*(parseInt(_0x1fa188(0x1d6))/0x4)+parseInt(_0x1fa188(0x1cb))/0x5+parseInt(_0x1fa188(0x1cf))/0x6*(parseInt(_0x1fa188(0x1c5))/0x7)+-parseInt(_0x1fa188(0x1c4))/0x8*(parseInt(_0x1fa188(0x1d3))/0x9)+parseInt(_0x1fa188(0x1d8))/0xa*(-parseInt(_0x1fa188(0x1d2))/0xb)+parseInt(_0x1fa188(0x1cc))/0xc*(-parseInt(_0x1fa188(0x1d5))/0xd);if(_0x404d6b===_0xd79c8e)break;else _0xec240['push'](_0xec240['shift']());}catch(_0x270475){_0xec240['push'](_0xec240['shift']());}}}(a70_0x5089,0xd52ea));import{getTemplateBaseUrl}from'./config.js';export async function fetchCdnConfig(){const _0x1f113a=a70_0xe618;try{const _0x5371b1=getTemplateBaseUrl(),_0xff899e=_0x5371b1+_0x1f113a(0x1ce),_0x3872a3=await fetch(_0xff899e,{'headers':{'Accept':_0x1f113a(0x1ca)}});if(!_0x3872a3['ok'])return null;const _0x3810a8=await _0x3872a3[_0x1f113a(0x1d1)]();if(!_0x3810a8[_0x1f113a(0x1d7)]?.[_0x1f113a(0x1c7)]||!_0x3810a8[_0x1f113a(0x1cd)]?.[_0x1f113a(0x1d0)]?.[_0x1f113a(0x1c7)])return null;return _0x3810a8;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8;function a70_0xe618(_0x545e51,_0x187ec9){_0x545e51=_0x545e51-0x1c4;const _0x508977=a70_0x5089();let _0xe6184e=_0x508977[_0x545e51];return _0xe6184e;}function a70_0x5089(){const _0x492e3a=['3024170XGTbBE','4032DtChvK','7YxeRoF','1577283MCMEEz','stableVersion','626429LgnYXh','now','application/json','306080tYhLlN','12wVaDyu','sdk','/config.json','7603962szgoHe','node','json','11LNdmpr','8910PqolhW','2LYpyje','17314999slkKrN','8iaQISb','cli'];a70_0x5089=function(){return _0x492e3a;};return a70_0x5089();}export async function getCdnConfig(){const _0x13e72e=a70_0xe618,_0x558d6a=Date[_0x13e72e(0x1c9)]();if(cachedConfig&&_0x558d6a-cacheTime<CACHE_TTL)return cachedConfig;const _0xc11b01=await fetchCdnConfig();return _0xc11b01&&(cachedConfig=_0xc11b01,cacheTime=_0x558d6a),_0xc11b01;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71_0x131b4b=a71_0x5078;(function(_0x2f9eb4,_0x4a4fc6){const _0x39b086=a71_0x5078,_0x473e77=_0x2f9eb4();while(!![]){try{const _0x4718cd=-parseInt(_0x39b086(0x196))/0x1*(-parseInt(_0x39b086(0x184))/0x2)+parseInt(_0x39b086(0x180))/0x3+-parseInt(_0x39b086(0x18d))/0x4+-parseInt(_0x39b086(0x17e))/0x5+parseInt(_0x39b086(0x185))/0x6*(parseInt(_0x39b086(0x195))/0x7)+parseInt(_0x39b086(0x173))/0x8+-parseInt(_0x39b086(0x18f))/0x9;if(_0x4718cd===_0x4a4fc6)break;else _0x473e77['push'](_0x473e77['shift']());}catch(_0x6363e){_0x473e77['push'](_0x473e77['shift']());}}}(a71_0x2f01,0x8c986));import a71_0x186089 from'node:fs';import a71_0x58c9d0 from'node:path';import a71_0x9ceb76 from'semver';function a71_0x5078(_0x1d6dc3,_0x49e04c){_0x1d6dc3=_0x1d6dc3-0x173;const _0x2f0127=a71_0x2f01();let _0x5078ca=_0x2f0127[_0x1d6dc3];return _0x5078ca;}import{getCdnConfig}from'./cdn-config.js';import a71_0x3b7713 from'../i18n/index.js';const t=a71_0x3b7713['t'][a71_0x131b4b(0x193)](a71_0x3b7713),FALLBACK_MIN_SDK_VERSION=a71_0x131b4b(0x188);function a71_0x2f01(){const _0x20b5bb=['node_modules','\x1b[1m','upgrade.sdk.stable','bind','package.json','3836SGBsib','10210QKQivc','dependencies','version','3359648daXpmR','all','parse','join','stableVersion','utf-8','utf8','minVersion','upgrade.sdk.command','\x1b[0m','@lovrabet/sdk','2907980sEXTIF','needsUpgrade','2843877bIuIsN','some','devDependencies','existsSync','76RFnqBo','10782MDvdoS','readFileSync','coerce','1.2.0','sdk','node','latest','log','4296892jONlLg','upgrade.sdk.current','4580586JRNJgt'];a71_0x2f01=function(){return _0x20b5bb;};return a71_0x2f01();}function isNonNumericVersion(_0x480dfc){const _0x2b7d21=a71_0x131b4b,_0x457870=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x457870[_0x2b7d21(0x181)](_0x58a567=>_0x58a567['test'](_0x480dfc));}function getInstalledVersion(_0x58f3c8,_0x24c37f){const _0x7f6441=a71_0x131b4b;try{const _0x51c65b=a71_0x58c9d0[_0x7f6441(0x176)](_0x58f3c8,_0x7f6441(0x190),_0x24c37f,_0x7f6441(0x194));if(a71_0x186089['existsSync'](_0x51c65b)){const _0x7be846=JSON[_0x7f6441(0x175)](a71_0x186089[_0x7f6441(0x186)](_0x51c65b,_0x7f6441(0x178)));return _0x7be846[_0x7f6441(0x198)]||null;}}catch{}return null;}async function getSdkStableVersion(){const _0x418a7e=a71_0x131b4b;try{const _0x32ec32=await getCdnConfig();return _0x32ec32?.[_0x418a7e(0x189)]?.[_0x418a7e(0x18a)]?.[_0x418a7e(0x177)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x2ee0b4=a71_0x131b4b;try{const _0x312849=await getCdnConfig();return _0x312849?.['sdk']?.[_0x2ee0b4(0x18a)]?.['packageName']||_0x2ee0b4(0x17d);}catch{return'@lovrabet/sdk';}}export async function checkSdkVersion(_0x578686){const _0x75d0d=a71_0x131b4b,_0x33dd1b=a71_0x58c9d0['join'](_0x578686,_0x75d0d(0x194)),[_0x57c936,_0x19f0ca]=await Promise[_0x75d0d(0x174)]([getSdkStableVersion(),getSdkPackageName()]),_0x1aaf8c=_0x57c936||FALLBACK_MIN_SDK_VERSION;if(!a71_0x186089[_0x75d0d(0x183)](_0x33dd1b))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x1aaf8c,'packageName':_0x19f0ca,'stableVersion':_0x57c936};try{const _0x2c5b23=JSON['parse'](a71_0x186089[_0x75d0d(0x186)](_0x33dd1b,_0x75d0d(0x179))),_0x12e8a5=_0x2c5b23[_0x75d0d(0x197)]||{},_0x4239a3=_0x2c5b23[_0x75d0d(0x182)]||{},_0x3ff472=_0x12e8a5[_0x19f0ca]||_0x4239a3[_0x19f0ca];if(!_0x3ff472)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x1aaf8c,'packageName':_0x19f0ca,'stableVersion':_0x57c936};let _0x1e20da=getInstalledVersion(_0x578686,_0x19f0ca);!_0x1e20da&&(_0x1e20da=_0x3ff472);if(isNonNumericVersion(_0x3ff472))return{'installed':!![],'version':_0x1e20da,'needsUpgrade':![],'minVersion':_0x1aaf8c,'packageName':_0x19f0ca,'stableVersion':_0x57c936};const _0x181433=a71_0x9ceb76[_0x75d0d(0x187)](_0x1e20da),_0x169992=a71_0x9ceb76['coerce'](_0x1aaf8c),_0x522087=_0x181433&&_0x169992?a71_0x9ceb76['lt'](_0x181433,_0x169992):![];return{'installed':!![],'version':_0x1e20da,'needsUpgrade':_0x522087,'minVersion':_0x1aaf8c,'packageName':_0x19f0ca,'stableVersion':_0x57c936};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x1aaf8c,'packageName':_0x19f0ca,'stableVersion':_0x57c936};}}export function checkSdkVersionSync(_0x2786ee){const _0x411c7f=a71_0x131b4b,_0xb45187=a71_0x58c9d0[_0x411c7f(0x176)](_0x2786ee,_0x411c7f(0x194)),_0x5778d1=_0x411c7f(0x17d);if(!a71_0x186089[_0x411c7f(0x183)](_0xb45187))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5778d1,'stableVersion':null};try{const _0x55cb6e=JSON['parse'](a71_0x186089['readFileSync'](_0xb45187,'utf8')),_0x5b12d4=_0x55cb6e[_0x411c7f(0x197)]||{},_0x343030=_0x55cb6e[_0x411c7f(0x182)]||{},_0x50da6e=_0x5b12d4[_0x5778d1]||_0x343030[_0x5778d1];if(!_0x50da6e)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5778d1,'stableVersion':null};let _0x16468a=getInstalledVersion(_0x2786ee,_0x5778d1);!_0x16468a&&(_0x16468a=_0x50da6e);if(isNonNumericVersion(_0x50da6e))return{'installed':!![],'version':_0x16468a,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5778d1,'stableVersion':null};const _0x5b2e2d=a71_0x9ceb76[_0x411c7f(0x187)](_0x16468a),_0x57df66=_0x5b2e2d?a71_0x9ceb76['lt'](_0x5b2e2d,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x16468a,'needsUpgrade':_0x57df66,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5778d1,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5778d1,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x2ca0a8){const _0x24884c=a71_0x131b4b;if(!_0x2ca0a8[_0x24884c(0x17f)])return;const _0x30680b='\x1b[33m',_0x201ba1=_0x24884c(0x17c),_0x4e81cd=_0x24884c(0x191),_0x4d03c5=_0x2ca0a8['packageName']||_0x24884c(0x17d),_0x1eb14a=_0x2ca0a8[_0x24884c(0x177)]||_0x2ca0a8[_0x24884c(0x17a)],_0x1275c7='npm\x20install\x20'+_0x4d03c5+'@'+(_0x1eb14a||_0x24884c(0x18b));console['log'](),console[_0x24884c(0x18c)](''+_0x30680b+_0x4e81cd+t('upgrade.sdk.title')+_0x201ba1),console['log'](''+_0x30680b+t(_0x24884c(0x18e),{'package':_0x4d03c5,'version':_0x2ca0a8[_0x24884c(0x198)]})+_0x201ba1),console[_0x24884c(0x18c)](''+_0x30680b+t(_0x24884c(0x192),{'version':_0x1eb14a})+_0x201ba1),console[_0x24884c(0x18c)](''+_0x30680b+t(_0x24884c(0x17b),{'command':_0x1275c7})+_0x201ba1),console['log']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x3c0a51=a72_0x18bd;(function(_0xd7d271,_0x2543e0){const _0x3240d4=a72_0x18bd,_0x291da0=_0xd7d271();while(!![]){try{const _0x5712c1=-parseInt(_0x3240d4(0x108))/0x1+-parseInt(_0x3240d4(0xfb))/0x2+-parseInt(_0x3240d4(0x107))/0x3+-parseInt(_0x3240d4(0x109))/0x4+parseInt(_0x3240d4(0x103))/0x5+-parseInt(_0x3240d4(0xff))/0x6*(-parseInt(_0x3240d4(0xf1))/0x7)+parseInt(_0x3240d4(0xf8))/0x8;if(_0x5712c1===_0x2543e0)break;else _0x291da0['push'](_0x291da0['shift']());}catch(_0x34b985){_0x291da0['push'](_0x291da0['shift']());}}}(a72_0x415a,0x5393b));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a72_0x15270e from'semver';function a72_0x18bd(_0x1863ea,_0x27322b){_0x1863ea=_0x1863ea-0xf0;const _0x415acc=a72_0x415a();let _0x18bded=_0x415acc[_0x1863ea];return _0x18bded;}import{getCdnConfig}from'./cdn-config.js';import a72_0x1a20ab from'../i18n/index.js';const t=a72_0x1a20ab['t'][a72_0x3c0a51(0xf6)](a72_0x1a20ab);function getCurrentCliVersion(){const _0xab7715=a72_0x3c0a51;try{const _0x5bed74=fileURLToPath(import.meta.url),_0x4afc6c=resolve(dirname(_0x5bed74),_0xab7715(0xf3)),_0x5d7c9f=resolve(_0x4afc6c,_0xab7715(0xf9)),_0x271f80=JSON[_0xab7715(0xf4)](readFileSync(_0x5d7c9f,_0xab7715(0xf7)));return _0x271f80[_0xab7715(0xfc)]||_0xab7715(0xfd);}catch{return _0xab7715(0xfd);}}function isNonNumericVersion(_0x54518f){const _0xe24107=a72_0x3c0a51,_0x421d7a=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x421d7a[_0xe24107(0x106)](_0xbbd113=>_0xbbd113['test'](_0x54518f));}function a72_0x415a(){const _0x26659c=['package.json','stableVersion','814400JWQmKs','version','1.0.0','\x1b[1m','1866AaGdyF','upgrade.cli.command','log','upgrade.cli.title','2511655vlfqrd','cli','needsUpgrade','some','578454pyrPWU','131241YhYUDu','2497740rwqpPn','currentVersion','4431teUfow','coerce','../..','parse','upgrade.cli.stable','bind','utf-8','7990648OQlWKS'];a72_0x415a=function(){return _0x26659c;};return a72_0x415a();}export async function checkCliVersion(){const _0x5b322b=a72_0x3c0a51,_0x2d2835=getCurrentCliVersion(),_0x7a1fa1=await getCdnConfig(),_0x50d946=_0x7a1fa1?.[_0x5b322b(0x104)]?.[_0x5b322b(0xfa)]||null;let _0x5bdc24=![];if(_0x50d946)try{const _0x54b481=a72_0x15270e[_0x5b322b(0xf2)](_0x2d2835),_0x51a80e=a72_0x15270e[_0x5b322b(0xf2)](_0x50d946);_0x54b481&&_0x51a80e&&(_0x5bdc24=a72_0x15270e['lt'](_0x54b481,_0x51a80e));}catch{_0x5bdc24=![];}return{'currentVersion':_0x2d2835,'stableVersion':_0x50d946,'needsUpgrade':_0x5bdc24,'isPreRelease':![]};}export function printCliUpgradeWarning(_0x55fc0a){const _0x2934ee=a72_0x3c0a51;if(!_0x55fc0a[_0x2934ee(0x105)])return;const _0x392935='\x1b[33m',_0x442ddc='\x1b[0m',_0x351fd9=_0x2934ee(0xfe),_0x3d0013='npm\x20install\x20-g\x20@lovrabet/cli@latest';console['log'](),console[_0x2934ee(0x101)](''+_0x392935+_0x351fd9+t(_0x2934ee(0x102))+_0x442ddc),console[_0x2934ee(0x101)](''+_0x392935+t('upgrade.cli.current',{'version':_0x55fc0a[_0x2934ee(0xf0)]})+_0x442ddc),console[_0x2934ee(0x101)](''+_0x392935+t(_0x2934ee(0xf5),{'version':_0x55fc0a[_0x2934ee(0xfa)]})+_0x442ddc),console[_0x2934ee(0x101)](''+_0x392935+t(_0x2934ee(0x100),{'command':_0x3d0013})+_0x442ddc),console['log']();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a73_0x2cbb36=a73_0x3397;(function(_0x1f649f,_0x388bc4){const _0x145271=a73_0x3397,_0x5bea8d=_0x1f649f();while(!![]){try{const _0x541b52=parseInt(_0x145271(0xf7))/0x1+parseInt(_0x145271(0xf0))/0x2+-parseInt(_0x145271(0xf6))/0x3*(parseInt(_0x145271(0xe6))/0x4)+-parseInt(_0x145271(0xed))/0x5*(parseInt(_0x145271(0xf5))/0x6)+-parseInt(_0x145271(0xee))/0x7+parseInt(_0x145271(0xf4))/0x8+parseInt(_0x145271(0xe7))/0x9;if(_0x541b52===_0x388bc4)break;else _0x5bea8d['push'](_0x5bea8d['shift']());}catch(_0xc28e02){_0x5bea8d['push'](_0x5bea8d['shift']());}}}(a73_0x6ecf,0x33635));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a73_0x3397(_0x1c435e,_0x30bbd7){_0x1c435e=_0x1c435e-0xe6;const _0x6ecf64=a73_0x6ecf();let _0x3397aa=_0x6ecf64[_0x1c435e];return _0x3397aa;}import{homedir}from'node:os';function a73_0x6ecf(){const _0x1643ff=['108408zksNxD','57QTKYaO','414396tjXFYy','parse','appcode','16196xTXyyi','727803rztSWU','https://g.lovrabet.com/dist/lovrabet-skill','trim','utf8','app','cwd','70RYXiPr','153755OqxEvG','.lovrabetrc','13832BZkVlu','string','template_base_url','env','481232mpqIhe'];a73_0x6ecf=function(){return _0x1643ff;};return a73_0x6ecf();}import{initEnv}from'../constant/env.js';export const projectConfigPath=resolve(process[a73_0x2cbb36(0xec)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a73_0x2cbb36(0xef));export function readConfig(_0x5ec01f){const _0x118d3d=a73_0x2cbb36;let _0x17e72d={};try{if(existsSync(globalConfigPath)){const _0x83a1bb=readFileSync(globalConfigPath,{'encoding':_0x118d3d(0xea)});_0x83a1bb&&(_0x17e72d=JSON['parse'](_0x83a1bb));}}catch(_0x5ab9be){}try{const _0x59be6d=_0x5ec01f?resolve(_0x5ec01f,_0x118d3d(0xef)):projectConfigPath;if(existsSync(_0x59be6d)){const _0x184701=readFileSync(_0x59be6d,{'encoding':_0x118d3d(0xea)});if(_0x184701){const _0x10ba83=JSON[_0x118d3d(0xf8)](_0x184701);_0x17e72d={..._0x17e72d,..._0x10ba83};}}}catch(_0xf82206){}return _0x17e72d[_0x118d3d(0xf3)]&&typeof _0x17e72d[_0x118d3d(0xf3)]===_0x118d3d(0xf1)&&initEnv(_0x17e72d[_0x118d3d(0xf3)]),_0x17e72d;}export function getConfigAppCode(){const _0xa2242a=a73_0x2cbb36;let _0x1a873d={},_0x1075b7={};try{if(existsSync(globalConfigPath)){const _0x4745de=readFileSync(globalConfigPath,{'encoding':_0xa2242a(0xea)});_0x4745de&&(_0x1075b7=JSON[_0xa2242a(0xf8)](_0x4745de));}}catch(_0x227b0f){}try{if(existsSync(projectConfigPath)){const _0x522de1=readFileSync(projectConfigPath,{'encoding':_0xa2242a(0xea)});_0x522de1&&(_0x1a873d=JSON[_0xa2242a(0xf8)](_0x522de1));}}catch(_0x261512){}let _0x292052;if(_0xa2242a(0xf9)in _0x1a873d)_0x292052=_0x1a873d[_0xa2242a(0xf9)];else{if('app'in _0x1a873d)_0x292052=_0x1a873d['app'];else{if(_0xa2242a(0xf9)in _0x1075b7)_0x292052=_0x1075b7[_0xa2242a(0xf9)];else _0xa2242a(0xeb)in _0x1075b7&&(_0x292052=_0x1075b7[_0xa2242a(0xeb)]);}}if(typeof _0x292052!==_0xa2242a(0xf1)||_0x292052[_0xa2242a(0xe9)]()==='')return undefined;return _0x292052;}export function isInProject(){return existsSync(projectConfigPath);}export function getTemplateBaseUrl(){const _0x1fa69e=a73_0x2cbb36,_0x3654b9=readConfig();if(_0x3654b9[_0x1fa69e(0xf2)]&&typeof _0x3654b9[_0x1fa69e(0xf2)]==='string')return _0x3654b9[_0x1fa69e(0xf2)]['replace'](/\/$/,'');return _0x1fa69e(0xe8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x573b7f,_0x2836c1){const _0x57936a=a74_0xae2e,_0x1eb86d=_0x573b7f();while(!![]){try{const _0x5b7f93=-parseInt(_0x57936a(0x126))/0x1*(parseInt(_0x57936a(0x128))/0x2)+-parseInt(_0x57936a(0x11d))/0x3+-parseInt(_0x57936a(0x11e))/0x4*(-parseInt(_0x57936a(0x121))/0x5)+parseInt(_0x57936a(0x122))/0x6*(parseInt(_0x57936a(0x123))/0x7)+-parseInt(_0x57936a(0x11f))/0x8+parseInt(_0x57936a(0x129))/0x9+parseInt(_0x57936a(0x127))/0xa;if(_0x5b7f93===_0x2836c1)break;else _0x1eb86d['push'](_0x1eb86d['shift']());}catch(_0x427da5){_0x1eb86d['push'](_0x1eb86d['shift']());}}}(a74_0x4906,0xd6460));function a74_0x4906(){const _0x2ee1c4=['8059293QLXVzQ','mkdirSync','join','1851864VuyuPK','2687596sCBUCs','6527864TzvTZB','isDirectory','10SHRQbu','1372548jmGwhl','35yBJeCZ','name','copyFileSync','1dfWNDF','3247640BYMkCv','2793788hdHlRN'];a74_0x4906=function(){return _0x2ee1c4;};return a74_0x4906();}import a74_0x3cd3bf from'node:path';import a74_0x287573 from'node:fs';function a74_0xae2e(_0x476791,_0x4685cc){_0x476791=_0x476791-0x11d;const _0x4906be=a74_0x4906();let _0xae2e8=_0x4906be[_0x476791];return _0xae2e8;}export async function copyDirectory(_0x55f9a3,_0x2f8d67){const _0x3beefd=a74_0xae2e;try{const _0x55a316=a74_0x287573['readdirSync'](_0x55f9a3,{'withFileTypes':!![]});a74_0x287573[_0x3beefd(0x12a)](_0x2f8d67,{'recursive':!![]});for(const _0x56e4d8 of _0x55a316){const _0x4c6ffe=a74_0x3cd3bf['join'](_0x55f9a3,_0x56e4d8[_0x3beefd(0x124)]),_0x2b47c5=a74_0x3cd3bf[_0x3beefd(0x12b)](_0x2f8d67,_0x56e4d8[_0x3beefd(0x124)]);_0x56e4d8[_0x3beefd(0x120)]()?await copyDirectory(_0x4c6ffe,_0x2b47c5):a74_0x287573[_0x3beefd(0x125)](_0x4c6ffe,_0x2b47c5);}}catch(_0x2cce2a){console['error']('复制目录时出错:',_0x2cce2a);}}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c0653,_0x4a027e){const _0x4819b6=a75_0x2a9e,_0x480645=_0x2c0653();while(!![]){try{const _0x324017=parseInt(_0x4819b6(0x84))/0x1*(-parseInt(_0x4819b6(0x83))/0x2)+parseInt(_0x4819b6(0x89))/0x3*(-parseInt(_0x4819b6(0x85))/0x4)+parseInt(_0x4819b6(0x86))/0x5+parseInt(_0x4819b6(0x8b))/0x6+-parseInt(_0x4819b6(0x8a))/0x7+parseInt(_0x4819b6(0x88))/0x8*(-parseInt(_0x4819b6(0x87))/0x9)+parseInt(_0x4819b6(0x8d))/0xa*(parseInt(_0x4819b6(0x8e))/0xb);if(_0x324017===_0x4a027e)break;else _0x480645['push'](_0x480645['shift']());}catch(_0x391525){_0x480645['push'](_0x480645['shift']());}}}(a75_0x30ca,0x51953));function a75_0x30ca(){const _0x2fb195=['14091670dsZliG','11aCDDcc','250rVBBsb','49AByKzE','16YXIfWu','588410wEcElm','5525433WalsLp','8GTnbeT','336033mKjZJL','1772463DfpdXt','771774oYElPZ','isDirectory'];a75_0x30ca=function(){return _0x2fb195;};return a75_0x30ca();}import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x41b595,_0xfb63d1){const _0x38f155=a75_0x2a9e,_0x31af88=statSync(_0x41b595);if(_0x31af88[_0x38f155(0x8c)]()){!existsSync(_0xfb63d1)&&mkdirSync(_0xfb63d1,{'recursive':!![]});const _0xb3db8e=readdirSync(_0x41b595);for(const _0x51225a of _0xb3db8e){await copyDir(join(_0x41b595,_0x51225a),join(_0xfb63d1,_0x51225a));}}else copyFileSync(_0x41b595,_0xfb63d1);}export function ensureDir(_0x5b9573){!existsSync(_0x5b9573)&&mkdirSync(_0x5b9573,{'recursive':!![]});}function a75_0x2a9e(_0x69407,_0x3edc92){_0x69407=_0x69407-0x83;const _0x30caec=a75_0x30ca();let _0x2a9e73=_0x30caec[_0x69407];return _0x2a9e73;}export function pathExists(_0x3318fa){return existsSync(_0x3318fa);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a76_0x28da10=a76_0x1543;(function(_0x5acfcb,_0x4d4a04){const _0x326ebe=a76_0x1543,_0x16748e=_0x5acfcb();while(!![]){try{const _0x475cee=-parseInt(_0x326ebe(0x85))/0x1*(parseInt(_0x326ebe(0x93))/0x2)+-parseInt(_0x326ebe(0x95))/0x3+-parseInt(_0x326ebe(0x86))/0x4*(parseInt(_0x326ebe(0x8d))/0x5)+-parseInt(_0x326ebe(0x8b))/0x6+parseInt(_0x326ebe(0x81))/0x7+-parseInt(_0x326ebe(0x8c))/0x8+parseInt(_0x326ebe(0x9b))/0x9;if(_0x475cee===_0x4d4a04)break;else _0x16748e['push'](_0x16748e['shift']());}catch(_0x3b0497){_0x16748e['push'](_0x16748e['shift']());}}}(a76_0x45bf,0x7cb7b));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x2dd7b6=a76_0x1543,_0x3cbb4a=getTemplateBaseUrl();return _0x3cbb4a+_0x2dd7b6(0x96);}const CACHE_DIR=join(process[a76_0x28da10(0x83)][a76_0x28da10(0x7e)]||process['env'][a76_0x28da10(0x9c)]||'',a76_0x28da10(0xa0),a76_0x28da10(0x8a));function a76_0x1543(_0x442c10,_0x1a0718){_0x442c10=_0x442c10-0x7c;const _0x45bfba=a76_0x45bf();let _0x15433b=_0x45bfba[_0x442c10];return _0x15433b;}export async function fetchGuidesFromCDN(){const _0x3381eb=a76_0x28da10,_0x1ce34f=getGuidesCdnUrl(),_0x25db24=await fetch(_0x1ce34f,{'headers':{'Accept':_0x3381eb(0x7f)}});if(!_0x25db24['ok'])throw new Error(_0x3381eb(0x98)+_0x25db24['status']+'\x20'+_0x25db24[_0x3381eb(0x89)]);const _0x3c3082=await _0x25db24[_0x3381eb(0x9d)]();if(!_0x3c3082[_0x3381eb(0x99)]||typeof _0x3c3082['guides']!==_0x3381eb(0x9f))throw new Error('CDN\x20返回数据格式错误');return _0x3c3082;}export function writeGuidesToProject(_0x414dba,_0x4299e0,_0x1b6b0a=a76_0x28da10(0x80),_0x3434be){const _0x386084=a76_0x28da10,_0x2eb86d=join(_0x4299e0,_0x1b6b0a);mkdirSync(_0x2eb86d,{'recursive':!![]});for(const [_0x485634,_0x3a75d6]of Object[_0x386084(0x8e)](_0x414dba[_0x386084(0x99)])){let _0xe549cb=_0x3a75d6['content'];_0x3a75d6[_0x386084(0x7d)]&&(_0xe549cb=appendUpdateTime(_0xe549cb,_0x3a75d6['lastUpdated'])),writeFileSync(join(_0x2eb86d,_0x485634+_0x386084(0x9e)),_0xe549cb,_0x386084(0x87));}}function a76_0x45bf(){const _0x35fca6=['replace','length','push','1869342FZBWdy','CDN\x20数据中缺少\x20skillTemplate','307500jgyMYE','/skills/guides.json','extendContent','CDN\x20请求失败:\x20','guides','skillTemplate','21428289oNoVig','USERPROFILE','json','.md','object','.lovrabet','trimEnd','\x0a\x0a>更新时间:','lastUpdated','HOME','application/json','.lovrabet/skill/guides','6944665YjrtDq','path','env','title','1ZdDAHG','169552AzmbeE','utf-8','keys','statusText','cache','2792688MavSUA','7146288WueoTI','55RWjwss','entries','content'];a76_0x45bf=function(){return _0x35fca6;};return a76_0x45bf();}export function appendUpdateTime(_0x10cd58,_0x5c3834){const _0xb6bdbd=a76_0x28da10;return _0x10cd58=_0x10cd58[_0xb6bdbd(0x90)](/\n*>更新时间:.*$/m,''),_0x10cd58[_0xb6bdbd(0xa1)]()+(_0xb6bdbd(0x7c)+_0x5c3834);}export function getSkillTemplate(_0x243326){const _0x1cca1e=a76_0x28da10;return _0x243326[_0x1cca1e(0x9a)]?.[_0x1cca1e(0x8f)]||'';}export function appendExtendContents(_0x484fbf,_0x55cf2b,_0x227758){const _0x1336e6=a76_0x28da10,_0x2e125f=[];for(const [,_0x432f47]of Object['entries'](_0x55cf2b[_0x1336e6(0x99)])){_0x432f47[_0x1336e6(0x97)]&&_0x2e125f[_0x1336e6(0x92)](_0x432f47[_0x1336e6(0x97)][_0x1336e6(0xa1)]());}if(_0x2e125f[_0x1336e6(0x91)]===0x0)return _0x484fbf;return _0x484fbf[_0x1336e6(0xa1)]()+'\x0a\x0a'+_0x2e125f['join']('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0xe19c30,_0x561d96,_0x534b65){const _0x3f22c4=a76_0x28da10,_0xbd8762=getSkillTemplate(_0xe19c30);if(!_0xbd8762)throw new Error(_0x3f22c4(0x94));const _0x394ba2=dirname(_0x561d96);mkdirSync(_0x394ba2,{'recursive':!![]});let _0x563596=_0xbd8762['replace'](/\{\{IDE_NAME\}\}/g,_0x534b65);_0x563596=appendExtendContents(_0x563596,_0xe19c30),_0xe19c30['skillTemplate'][_0x3f22c4(0x7d)]&&(_0x563596=appendUpdateTime(_0x563596,_0xe19c30['skillTemplate'][_0x3f22c4(0x7d)])),writeFileSync(_0x561d96,_0x563596,'utf-8');}export async function installGuides(_0x48037f){const _0x3784f6=a76_0x28da10,_0x536a40=await fetchGuidesFromCDN();return writeGuidesToProject(_0x536a40,_0x48037f),Object[_0x3784f6(0x88)](_0x536a40['guides'])[_0x3784f6(0x91)];}export function getGuidesSummary(_0x322db8){const _0x3e376b=a76_0x28da10;return Object['entries'](_0x322db8['guides'])['map'](([_0x528ddf,_0x463c69])=>({'key':_0x528ddf,'title':_0x463c69[_0x3e376b(0x84)],'path':_0x463c69[_0x3e376b(0x82)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16e14b,_0x1491d8){const _0x51b48c=a77_0x4d6c,_0x265c1d=_0x16e14b();while(!![]){try{const _0x493d5b=parseInt(_0x51b48c(0x10e))/0x1*(-parseInt(_0x51b48c(0x121))/0x2)+-parseInt(_0x51b48c(0x118))/0x3*(parseInt(_0x51b48c(0x11a))/0x4)+parseInt(_0x51b48c(0x113))/0x5*(-parseInt(_0x51b48c(0x10f))/0x6)+parseInt(_0x51b48c(0x115))/0x7*(-parseInt(_0x51b48c(0x110))/0x8)+-parseInt(_0x51b48c(0x128))/0x9*(parseInt(_0x51b48c(0x119))/0xa)+parseInt(_0x51b48c(0x11d))/0xb*(parseInt(_0x51b48c(0x114))/0xc)+parseInt(_0x51b48c(0x11f))/0xd;if(_0x493d5b===_0x1491d8)break;else _0x265c1d['push'](_0x265c1d['shift']());}catch(_0x1caffc){_0x265c1d['push'](_0x265c1d['shift']());}}}(a77_0x5718,0xe404b));export async function httpRequest(_0x54f956,_0x3e6b36={}){const _0x43baba=a77_0x4d6c,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x3e6b36;let _0x2f735b=null;for(let _0x8e1b27=0x0;_0x8e1b27<=retries;_0x8e1b27++){try{const _0x53fa87=new AbortController(),_0x56484a=setTimeout(()=>_0x53fa87[_0x43baba(0x11c)](),timeout),_0x3f9c86=await fetch(_0x54f956,{'headers':headers,'signal':_0x53fa87[_0x43baba(0x11e)]});clearTimeout(_0x56484a);let _0x11604b;const _0x260298=_0x3f9c86[_0x43baba(0x126)][_0x43baba(0x120)](_0x43baba(0x125));return _0x260298?.[_0x43baba(0x11b)](_0x43baba(0x117))?_0x11604b=await _0x3f9c86[_0x43baba(0x124)]():_0x11604b=await _0x3f9c86[_0x43baba(0x12b)](),{'ok':_0x3f9c86['ok'],'status':_0x3f9c86[_0x43baba(0x111)],'statusText':_0x3f9c86['statusText'],'data':_0x11604b,'headers':_0x3f9c86[_0x43baba(0x126)],'url':_0x3f9c86['url'],'text':()=>_0x3f9c86[_0x43baba(0x12b)]()};}catch(_0xc2c49b){_0x2f735b=_0xc2c49b instanceof Error?_0xc2c49b:new Error(String(_0xc2c49b));if(_0x8e1b27===retries)break;if(shouldRetry(_0xc2c49b)){console['log'](_0x43baba(0x116)+retryDelay+_0x43baba(0x12a)+(_0x8e1b27+0x1)+_0x43baba(0x129)),await sleep(retryDelay);continue;}else break;}}throw _0x2f735b||new Error(_0x43baba(0x122));}function shouldRetry(_0x2d7f03){const _0xbc41df=a77_0x4d6c;if(_0x2d7f03 instanceof Error){if(_0x2d7f03[_0xbc41df(0x10d)]==='AbortError')return![];if(_0x2d7f03[_0xbc41df(0x10d)]==='TypeError'&&_0x2d7f03[_0xbc41df(0x112)][_0xbc41df(0x11b)](_0xbc41df(0x123)))return!![];if(_0x2d7f03['message'][_0xbc41df(0x11b)](_0xbc41df(0x127)))return!![];if(_0x2d7f03['message'][_0xbc41df(0x11b)]('ENOTFOUND'))return![];}return![];}function a77_0x5718(){const _0x3bb784=['6910BggRZj','4aKBrro','includes','abort','3124AsAloD','signal','58359470nFONFk','get','2ytyeIq','Request\x20failed','fetch','json','content-type','headers','ECONNRESET','2421baRIld','\x20次重试...','ms\x20后进行第\x20','text','name','728758ByuWyO','12cfElzl','4040WANXEO','status','message','3684395igKYUW','58332tLRfmi','21483gyDYgD','*\x20请求失败,','application/json','2992533nNHtMZ'];a77_0x5718=function(){return _0x3bb784;};return a77_0x5718();}function a77_0x4d6c(_0x19ea9e,_0xeb9f5d){_0x19ea9e=_0x19ea9e-0x10d;const _0x571810=a77_0x5718();let _0x4d6c93=_0x571810[_0x19ea9e];return _0x4d6c93;}function sleep(_0x2997e9){return new Promise(_0x3f2bed=>setTimeout(_0x3f2bed,_0x2997e9));}export function validateUrl(_0x3d4f6c){try{return new URL(_0x3d4f6c),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a78_0x6c73f1=a78_0x284d;function a78_0x284d(_0x13be35,_0x594760){_0x13be35=_0x13be35-0x1d8;const _0x2681dd=a78_0x2681();let _0x284d60=_0x2681dd[_0x13be35];return _0x284d60;}(function(_0x6daba7,_0x32c73f){const _0x597cf7=a78_0x284d,_0x17b309=_0x6daba7();while(!![]){try{const _0x312680=parseInt(_0x597cf7(0x1f4))/0x1*(parseInt(_0x597cf7(0x1e2))/0x2)+parseInt(_0x597cf7(0x1e9))/0x3*(parseInt(_0x597cf7(0x1f0))/0x4)+parseInt(_0x597cf7(0x1ea))/0x5*(parseInt(_0x597cf7(0x1f7))/0x6)+parseInt(_0x597cf7(0x1df))/0x7+parseInt(_0x597cf7(0x1ee))/0x8+parseInt(_0x597cf7(0x1eb))/0x9+parseInt(_0x597cf7(0x1fa))/0xa*(-parseInt(_0x597cf7(0x1e5))/0xb);if(_0x312680===_0x32c73f)break;else _0x17b309['push'](_0x17b309['shift']());}catch(_0x26a415){_0x17b309['push'](_0x17b309['shift']());}}}(a78_0x2681,0xcd098));import a78_0x1a9270 from'winston';function a78_0x2681(){const _0x3d9d19=['8719944VlmLke','parse','576cdgKdR','success','clearLogs','失败:\x20','9mFSgiu','rawCommand','开始执行:\x20','148488HTExPi','red','message','52102700oqTbmQ','toISOString','readFileSync','Failed\x20to\x20clear\x20logs:','filter','command','log','initWinstonLogger','trim','join','map','yellow','utf8','duration','existsSync','info','split','writeFileSync','warn','winstonLogger','format','stringify','addColors','getWinstonInstance','error','8702918rzeFOV','transports','currentRawCommand','222086tQRXoK','combine','logFilePath','11RtHOPn','level','now','createLogger','28908zWlKYE','235IRcfDT','1500372MIlIkw','printf','完成:\x20'];a78_0x2681=function(){return _0x3d9d19;};return a78_0x2681();}import a78_0xf069a7 from'node:fs';import a78_0x53aff7 from'node:path';class Logger{[a78_0x6c73f1(0x1d9)];[a78_0x6c73f1(0x1e4)];[a78_0x6c73f1(0x1e1)]='';constructor(){const _0xe10b3f=a78_0x6c73f1;this[_0xe10b3f(0x1e4)]='';}['setRawCommand'](_0x1f1126){const _0xe4626=a78_0x6c73f1;this[_0xe4626(0x1e1)]=_0x1f1126;}[a78_0x6c73f1(0x201)](){const _0x225148=a78_0x6c73f1,_0x8d62e7=a78_0x53aff7['dirname'](this[_0x225148(0x1e4)]);!a78_0xf069a7[_0x225148(0x208)](_0x8d62e7)&&a78_0xf069a7['mkdirSync'](_0x8d62e7,{'recursive':!![]});const _0x1a8ec4=a78_0x1a9270[_0x225148(0x1da)][_0x225148(0x1e3)](a78_0x1a9270[_0x225148(0x1da)]['timestamp'](),a78_0x1a9270[_0x225148(0x1da)]['errors']({'stack':!![]}),a78_0x1a9270[_0x225148(0x1da)][_0x225148(0x1ec)](_0x5c9ddc=>{const _0x5435e4=_0x225148,_0x432061={'timestamp':_0x5c9ddc['timestamp']||new Date()[_0x5435e4(0x1fb)](),'level':_0x5c9ddc[_0x5435e4(0x1e6)]||_0x5435e4(0x209),'command':_0x5c9ddc[_0x5435e4(0x1ff)]||'unknown','rawCommand':_0x5c9ddc[_0x5435e4(0x1f5)]||this[_0x5435e4(0x1e1)]||undefined,'message':_0x5c9ddc[_0x5435e4(0x1f9)]||'','duration':_0x5c9ddc[_0x5435e4(0x207)]||undefined,'details':_0x5c9ddc['details']||undefined};return JSON[_0x5435e4(0x1db)](_0x432061);}));this[_0x225148(0x1d9)]=a78_0x1a9270[_0x225148(0x1e8)]({'level':_0x225148(0x209),'format':_0x1a8ec4,'transports':[new a78_0x1a9270[(_0x225148(0x1e0))]['File']({'filename':this['logFilePath'],'level':_0x225148(0x209)})],'silent':![]}),a78_0x1a9270[_0x225148(0x1dc)]({'success':'green','error':_0x225148(0x1f8),'warn':_0x225148(0x205),'info':'blue'});}['setLogPath'](_0x296bdb){const _0xdade4a=a78_0x6c73f1;this['logFilePath']=a78_0x53aff7[_0xdade4a(0x203)](_0x296bdb,'.lovrabet.log'),this['winstonLogger']&&this[_0xdade4a(0x1d9)]['clear'](),this['initWinstonLogger']();}[a78_0x6c73f1(0x209)](_0x3435a8,_0x48aed5,_0x480f6d){const _0x23f1e3=a78_0x6c73f1;if(!this[_0x23f1e3(0x1e4)]||!this[_0x23f1e3(0x1d9)])return;this['winstonLogger'][_0x23f1e3(0x209)](_0x48aed5,{'command':_0x3435a8,'details':_0x480f6d});}[a78_0x6c73f1(0x1f1)](_0x5e7827,_0x406891,_0x118017,_0x10629f){const _0x202bd5=a78_0x6c73f1;if(!this['logFilePath']||!this[_0x202bd5(0x1d9)])return;this[_0x202bd5(0x1d9)][_0x202bd5(0x200)](_0x202bd5(0x209),_0x406891,{'level':_0x202bd5(0x1f1),'command':_0x5e7827,'duration':_0x118017,'details':_0x10629f});}['error'](_0x274983,_0x158dc3,_0x4871ba){const _0x1c05fa=a78_0x6c73f1;if(!this['logFilePath']||!this[_0x1c05fa(0x1d9)])return;this[_0x1c05fa(0x1d9)][_0x1c05fa(0x1de)](_0x158dc3,{'command':_0x274983,'details':_0x4871ba});}[a78_0x6c73f1(0x1d8)](_0x49c5e5,_0x4e517f,_0x48f761){const _0x27ccc9=a78_0x6c73f1;if(!this[_0x27ccc9(0x1e4)]||!this[_0x27ccc9(0x1d9)])return;this['winstonLogger'][_0x27ccc9(0x1d8)](_0x4e517f,{'command':_0x49c5e5,'details':_0x48f761});}async['logTask'](_0x5d284b,_0x5750c2,_0x5b75a4){const _0x25b411=a78_0x6c73f1,_0x3c2bb4=Date[_0x25b411(0x1e7)]();this[_0x25b411(0x209)](_0x5d284b,_0x25b411(0x1f6)+_0x5750c2);try{const _0x503bac=await _0x5b75a4(),_0x580e30=Date[_0x25b411(0x1e7)]()-_0x3c2bb4;return this[_0x25b411(0x1f1)](_0x5d284b,_0x25b411(0x1ed)+_0x5750c2,_0x580e30),_0x503bac;}catch(_0x53d47f){const _0x46819d=Date['now']()-_0x3c2bb4;this['error'](_0x5d284b,_0x25b411(0x1f3)+_0x5750c2,{'error':_0x53d47f instanceof Error?_0x53d47f[_0x25b411(0x1f9)]:String(_0x53d47f),'duration':_0x46819d});throw _0x53d47f;}}['readLogs'](){const _0x1428f4=a78_0x6c73f1;try{if(!a78_0xf069a7[_0x1428f4(0x208)](this[_0x1428f4(0x1e4)]))return[];const _0x49b550=a78_0xf069a7[_0x1428f4(0x1fc)](this[_0x1428f4(0x1e4)],_0x1428f4(0x206));return _0x49b550[_0x1428f4(0x20a)]('\x0a')[_0x1428f4(0x1fe)](_0x3000e3=>_0x3000e3[_0x1428f4(0x202)]())[_0x1428f4(0x204)](_0xc7ca58=>JSON[_0x1428f4(0x1ef)](_0xc7ca58));}catch(_0x37285a){return console['warn']('Failed\x20to\x20read\x20logs:',_0x37285a),[];}}[a78_0x6c73f1(0x1f2)](){const _0xd21469=a78_0x6c73f1;try{a78_0xf069a7['existsSync'](this[_0xd21469(0x1e4)])&&a78_0xf069a7[_0xd21469(0x20b)](this[_0xd21469(0x1e4)],'',_0xd21469(0x206));}catch(_0x34b060){console[_0xd21469(0x1d8)](_0xd21469(0x1fd),_0x34b060);}}[a78_0x6c73f1(0x1dd)](){const _0x25766f=a78_0x6c73f1;return this[_0x25766f(0x1d9)];}}export const logger=new Logger();
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a79_0x26fc59=a79_0xff9a;(function(_0x24cb51,_0x4e1d5b){const _0x46c8dc=a79_0xff9a,_0x12cbd2=_0x24cb51();while(!![]){try{const _0x52a5a2=-parseInt(_0x46c8dc(0xff))/0x1*(parseInt(_0x46c8dc(0x105))/0x2)+-parseInt(_0x46c8dc(0xfe))/0x3+-parseInt(_0x46c8dc(0xf6))/0x4*(-parseInt(_0x46c8dc(0x100))/0x5)+parseInt(_0x46c8dc(0x104))/0x6+-parseInt(_0x46c8dc(0xf5))/0x7+parseInt(_0x46c8dc(0xf9))/0x8*(parseInt(_0x46c8dc(0x10b))/0x9)+parseInt(_0x46c8dc(0x10a))/0xa*(-parseInt(_0x46c8dc(0x102))/0xb);if(_0x52a5a2===_0x4e1d5b)break;else _0x12cbd2['push'](_0x12cbd2['shift']());}catch(_0x84213){_0x12cbd2['push'](_0x12cbd2['shift']());}}}(a79_0x1f8f,0x347f6));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x151f73=a79_0xff9a,_0x4e7172=getTemplateBaseUrl();return _0x4e7172+_0x151f73(0xfa);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a79_0x26fc59(0x103));export async function fetchRulesFromCDN(){const _0x3e399c=a79_0x26fc59,_0x5093c0=getRulesCdnUrl(),_0x452498=await fetch(_0x5093c0,{'headers':{'Accept':_0x3e399c(0x107)}});if(!_0x452498['ok'])throw new Error(_0x3e399c(0xf3)+_0x452498[_0x3e399c(0x109)]+'\x20'+_0x452498['statusText']);const _0x42bf2b=await _0x452498[_0x3e399c(0xfc)]();if(!_0x42bf2b['content']||typeof _0x42bf2b[_0x3e399c(0x106)]!=='string')throw new Error(_0x3e399c(0xf7));return _0x42bf2b;}export async function getRulesContent(){const _0x57c5de=a79_0x26fc59;try{const _0x5255bd=await fetchRulesFromCDN();return _0x5255bd[_0x57c5de(0x106)];}catch{return readLocalTemplate();}}function a79_0x1f8f(){const _0x24ae70=['129690dyvyXE','9LCDuLT','CDN\x20请求失败:\x20','lastUpdated','466858tOlDiD','44pqOsbk','CDN\x20返回数据格式错误','lovrabet_rules.mdc','994088hRHygw','/rules/rules.json','utf-8','json','本地模板文件不存在:\x20','286329vAvvqR','209OUSeev','124935CUHpoY','agents.md','22CBiwxD','../../templates/rules/lovrabet_rules.mdc.tpl','2530668cLRsnZ','3998VAfLoR','content','application/json','catch','status'];a79_0x1f8f=function(){return _0x24ae70;};return a79_0x1f8f();}export function readLocalTemplate(){const _0xc0d91d=a79_0x26fc59;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0xc0d91d(0xfb));throw new Error(_0xc0d91d(0xfd)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x56e844){const _0xe8ce69=a79_0x26fc59,_0x14a67b=await fetchRulesFromCDN()[_0xe8ce69(0x108)](()=>null);let _0xd97034;_0x14a67b?(_0xd97034=_0x14a67b[_0xe8ce69(0x106)],_0x14a67b[_0xe8ce69(0xf4)]&&(_0xd97034=appendUpdateTime(_0xd97034,_0x14a67b[_0xe8ce69(0xf4)]))):_0xd97034=readLocalTemplate();const _0x1e81f5=dirname(_0x56e844);!existsSync(_0x1e81f5)&&mkdirSync(_0x1e81f5,{'recursive':!![]}),writeFileSync(_0x56e844,_0xd97034,'utf-8');}export async function copyRulesToCursor(_0x1f382f){const _0x20f94f=a79_0x26fc59,_0x1bbc09=join(_0x1f382f,'.cursor/rules'),_0x34c698=join(_0x1bbc09,_0x20f94f(0xf8));if(existsSync(_0x34c698))return![];return await writeRulesFile(_0x34c698),!![];}function a79_0xff9a(_0x486db5,_0x3a6852){_0x486db5=_0x486db5-0xf3;const _0x1f8f28=a79_0x1f8f();let _0xff9a18=_0x1f8f28[_0x486db5];return _0xff9a18;}export async function copyRulesToAgentsMd(_0x5dd039){const _0x59825d=a79_0x26fc59,_0x83ca7a=join(_0x5dd039,_0x59825d(0x101));if(existsSync(_0x83ca7a))return![];return await writeRulesFile(_0x83ca7a),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x4a7bc9){return new Promise(_0x4e725b=>setTimeout(_0x4e725b,_0x4a7bc9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a81_0x195414=a81_0x46a6;function a81_0x315c(){const _0x3147f8=['success','includes','now','toISOString','模板内容替换完成','map','3487955IMdeLl','../../package.json','toLocaleTimeString','processFile','alias','replace','push','default','38184fwysCE','toUpperCase','toLocaleDateString','22779099sJRLmo','replaceApiContent','endsWith','toComponentName','charAt','tableName:\x20\x22','readdir','1502683cfaiuK','name','processTemplate','YourModel','datasetCode','pop','2-digit','template','api','isDirectory','\x0a\x20\x20\x20\x20{\x20','processDirectory','.css','3196276ctWdGE','.jsx','.md','promises','join','slice','开始处理模板内容替换','writeFile','.tpl','readFile','toDisplayTitle','tableName','.ts','6JmImhT','2611400TWQlJg','split','copyFile','toLowerCase','1vCiNvi','alias:\x20\x22','2197682Uhdffc','mkdir','numeric','utf8','extname'];a81_0x315c=function(){return _0x3147f8;};return a81_0x315c();}(function(_0xa3602b,_0x3e9223){const _0x177ba3=a81_0x46a6,_0x1e3533=_0xa3602b();while(!![]){try{const _0x508665=parseInt(_0x177ba3(0x1e5))/0x1*(-parseInt(_0x177ba3(0x1e7))/0x2)+-parseInt(_0x177ba3(0x1bc))/0x3+-parseInt(_0x177ba3(0x1d3))/0x4+parseInt(_0x177ba3(0x1b4))/0x5*(parseInt(_0x177ba3(0x1e0))/0x6)+-parseInt(_0x177ba3(0x1c6))/0x7+-parseInt(_0x177ba3(0x1e1))/0x8+parseInt(_0x177ba3(0x1bf))/0x9;if(_0x508665===_0x3e9223)break;else _0x1e3533['push'](_0x1e3533['shift']());}catch(_0x1a73f6){_0x1e3533['push'](_0x1e3533['shift']());}}}(a81_0x315c,0xbdaa6));import a81_0x285243 from'node:fs';import a81_0x313551 from'node:path';function a81_0x46a6(_0x5cfc18,_0x426462){_0x5cfc18=_0x5cfc18-0x1af;const _0x315c6f=a81_0x315c();let _0x46a63d=_0x315c6f[_0x5cfc18];return _0x46a63d;}import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a81_0x195414(0x1b5))['version'];export class TemplateReplacer{static[a81_0x195414(0x1c2)](_0x5b8847){const _0x31a7ba=a81_0x195414,_0xa14992=_0x5b8847[_0x31a7ba(0x1e2)]('/')[_0x31a7ba(0x1cb)]()||_0x5b8847;return _0xa14992[_0x31a7ba(0x1e2)]('-')[_0x31a7ba(0x1b3)](_0x8b1f36=>_0x8b1f36['charAt'](0x0)[_0x31a7ba(0x1bd)]()+_0x8b1f36[_0x31a7ba(0x1d8)](0x1)[_0x31a7ba(0x1e4)]())['join']('');}static['toDisplayTitle'](_0x1973aa){const _0x4a5a36=a81_0x195414,_0xaacc6a=_0x1973aa[_0x4a5a36(0x1e2)]('/')[_0x4a5a36(0x1cb)]()||_0x1973aa;return _0xaacc6a[_0x4a5a36(0x1e2)]('-')['map'](_0x38a8fc=>_0x38a8fc[_0x4a5a36(0x1c3)](0x0)['toUpperCase']()+_0x38a8fc[_0x4a5a36(0x1d8)](0x1)[_0x4a5a36(0x1e4)]())[_0x4a5a36(0x1d7)]('\x20');}static['replaceContent'](_0x102c93,_0x6f69a4,_0x3f8b5c){const _0x5668ee=a81_0x195414,_0x23a67e=this[_0x5668ee(0x1c2)](_0x6f69a4),_0x277036=this[_0x5668ee(0x1dd)](_0x6f69a4),_0x42b8a9=new Date(),_0x2f2a05=_0x42b8a9['toLocaleString'](undefined,{'year':_0x5668ee(0x1e9),'month':_0x5668ee(0x1cc),'day':'2-digit','hour':_0x5668ee(0x1cc),'minute':_0x5668ee(0x1cc),'second':_0x5668ee(0x1cc),'hour12':![]})[_0x5668ee(0x1b9)](/\//g,'-'),_0x5019c8=_0x42b8a9[_0x5668ee(0x1be)](undefined,{'year':_0x5668ee(0x1e9),'month':'2-digit','day':'2-digit'})[_0x5668ee(0x1b9)](/\//g,'-'),_0x22438e=_0x42b8a9[_0x5668ee(0x1b6)](undefined,{'hour12':![]});let _0x208480=_0x102c93['replace'](/\{CliVersion\}/g,CLI_VERSION)[_0x5668ee(0x1b9)](/\{ComponentName\}/g,_0x23a67e)[_0x5668ee(0x1b9)](/\{DisplayTitle\}/g,_0x277036)['replace'](/\{PageName\}/g,_0x6f69a4)['replace'](/\{TemplateName\}/g,_0x3f8b5c)['replace'](/\{CreatedAt\}/g,_0x2f2a05)['replace'](/\{CreatedDate\}/g,_0x5019c8)['replace'](/\{CreatedTime\}/g,_0x22438e);return _0x208480;}static[a81_0x195414(0x1c0)](_0x42e8ab,_0x1c140c,_0x3d464b,_0x3067e4,_0x135ad5,_0x8f5d08,_0x5d5ca4){const _0x338380=a81_0x195414,_0x23ab98=new Date(),_0x27a020=_0x23ab98[_0x338380(0x1b1)](),_0x465668=_0x3d464b[_0x338380(0x1b3)](_0x10d17d=>{const _0x3edf34=_0x338380,_0x314dc1=['datasetCode:\x20\x22'+_0x10d17d[_0x3edf34(0x1ca)]+'\x22',_0x3edf34(0x1c4)+_0x10d17d[_0x3edf34(0x1de)]+'\x22','name:\x20\x22'+_0x10d17d[_0x3edf34(0x1c7)]+'\x22'];return _0x10d17d[_0x3edf34(0x1b8)]&&_0x314dc1[_0x3edf34(0x1ba)](_0x3edf34(0x1e6)+_0x10d17d[_0x3edf34(0x1b8)]+'\x22'),_0x3edf34(0x1d0)+_0x314dc1['join'](',\x20')+'\x20},';})[_0x338380(0x1d7)](''),_0x52370b=_0x3067e4||_0x3d464b[0x0]?.[_0x338380(0x1b8)]||_0x338380(0x1c9);let _0x5be3c2=_0x42e8ab['replace'](/\{AppCode\}/g,_0x1c140c)[_0x338380(0x1b9)](/\{ModelConfigs\}/g,_0x465668)[_0x338380(0x1b9)](/\{ExampleModelName\}/g,_0x52370b)['replace'](/\{ApiFileName\}/g,_0x135ad5||_0x338380(0x1ce))[_0x338380(0x1b9)](/\{ConfigName\}/g,_0x8f5d08||_0x338380(0x1bb))[_0x338380(0x1b9)](/\{ClientConfigParam\}/g,_0x5d5ca4||'')[_0x338380(0x1b9)](/\{CreatedAt\}/g,_0x27a020);return _0x5be3c2;}static async[a81_0x195414(0x1c8)](_0x4fcfc9,_0x60585e,_0x25e556,_0x56da21,_0x545621=!![]){const _0x2ff1bd=a81_0x195414,_0x26dad2=Date[_0x2ff1bd(0x1b0)]();try{_0x545621&&logger['info'](_0x2ff1bd(0x1cd),_0x2ff1bd(0x1d9),{'templatePath':_0x4fcfc9,'targetPath':_0x60585e,'pageName':_0x25e556,'templateName':_0x56da21});await a81_0x285243[_0x2ff1bd(0x1d6)][_0x2ff1bd(0x1e8)](_0x60585e,{'recursive':!![]}),await this[_0x2ff1bd(0x1d1)](_0x4fcfc9,_0x60585e,_0x25e556,_0x56da21);if(_0x545621){const _0x37ab07=Date[_0x2ff1bd(0x1b0)]()-_0x26dad2;logger[_0x2ff1bd(0x1ec)]('template',_0x2ff1bd(0x1b2),_0x37ab07,{'pageName':_0x25e556,'templateName':_0x56da21});}}catch(_0x2ec547){if(_0x545621){const _0x574a1d=Date[_0x2ff1bd(0x1b0)]()-_0x26dad2;logger['error']('template','模板内容替换失败',{'templatePath':_0x4fcfc9,'targetPath':_0x60585e,'pageName':_0x25e556,'templateName':_0x56da21,'error':_0x2ec547 instanceof Error?_0x2ec547['message']:String(_0x2ec547),'duration':_0x574a1d});}throw _0x2ec547;}}static async['processDirectory'](_0x339719,_0x1a04ca,_0x41ecdd,_0x2cd1ea){const _0x2e937a=a81_0x195414,_0xd67f9c=await a81_0x285243[_0x2e937a(0x1d6)][_0x2e937a(0x1c5)](_0x339719,{'withFileTypes':!![]});for(const _0x38e2b5 of _0xd67f9c){const _0x34e3cf=a81_0x313551[_0x2e937a(0x1d7)](_0x339719,_0x38e2b5['name']);let _0x5555bc=a81_0x313551[_0x2e937a(0x1d7)](_0x1a04ca,_0x38e2b5['name']);_0x38e2b5[_0x2e937a(0x1c7)][_0x2e937a(0x1c1)]('.tpl')&&(_0x5555bc=a81_0x313551['join'](_0x1a04ca,_0x38e2b5['name']['replace'](/\.tpl$/,'')));if(_0x38e2b5[_0x2e937a(0x1cf)]())await a81_0x285243['promises'][_0x2e937a(0x1e8)](_0x5555bc,{'recursive':!![]}),await this[_0x2e937a(0x1d1)](_0x34e3cf,_0x5555bc,_0x41ecdd,_0x2cd1ea);else _0x38e2b5['isFile']()&&await this[_0x2e937a(0x1b7)](_0x34e3cf,_0x5555bc,_0x41ecdd,_0x2cd1ea);}}static async[a81_0x195414(0x1b7)](_0x322fd7,_0x2d322f,_0x1975a5,_0x42ab47){const _0x106a24=a81_0x195414,_0x330fd6=a81_0x313551[_0x106a24(0x1eb)](_0x322fd7)[_0x106a24(0x1e4)]();_0x322fd7[_0x106a24(0x1c1)]('.tpl')&&(_0x2d322f=_0x2d322f[_0x106a24(0x1b9)](/\.tpl$/,''));const _0x252944=['.tsx',_0x106a24(0x1df),_0x106a24(0x1d4),'.js','.json',_0x106a24(0x1d5),_0x106a24(0x1d2),'.scss','.tpl'];if(_0x252944[_0x106a24(0x1af)](_0x330fd6)||_0x322fd7[_0x106a24(0x1c1)](_0x106a24(0x1db))){const _0xe4b7cb=await a81_0x285243[_0x106a24(0x1d6)][_0x106a24(0x1dc)](_0x322fd7,_0x106a24(0x1ea)),_0x5913b7=this['replaceContent'](_0xe4b7cb,_0x1975a5,_0x42ab47);await a81_0x285243[_0x106a24(0x1d6)][_0x106a24(0x1da)](_0x2d322f,_0x5913b7,_0x106a24(0x1ea));}else await a81_0x285243[_0x106a24(0x1d6)][_0x106a24(0x1e3)](_0x322fd7,_0x2d322f);}}
|