@lovrabet/cli 1.3.2-beta.1 → 1.3.3
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 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -0
- package/lib/i18n/hooks.js +1 -0
- package/lib/i18n/index.js +1 -0
- package/lib/i18n/locales/en-US.js +1 -0
- package/lib/i18n/locales/zh-CN.js +1 -0
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/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 +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a68_0x14b76b=a68_0x2ee9;(function(_0x1e1f0b,_0x260229){const _0x14bc51=a68_0x2ee9,_0x181c3c=_0x1e1f0b();while(!![]){try{const _0x4a10=-parseInt(_0x14bc51(0x97))/0x1+-parseInt(_0x14bc51(0x91))/0x2*(-parseInt(_0x14bc51(0x8d))/0x3)+-parseInt(_0x14bc51(0x8a))/0x4*(parseInt(_0x14bc51(0x8b))/0x5)+parseInt(_0x14bc51(0x99))/0x6*(parseInt(_0x14bc51(0x7d))/0x7)+-parseInt(_0x14bc51(0x7f))/0x8*(-parseInt(_0x14bc51(0x81))/0x9)+-parseInt(_0x14bc51(0x77))/0xa*(-parseInt(_0x14bc51(0x98))/0xb)+-parseInt(_0x14bc51(0x89))/0xc;if(_0x4a10===_0x260229)break;else _0x181c3c['push'](_0x181c3c['shift']());}catch(_0x5138cf){_0x181c3c['push'](_0x181c3c['shift']());}}}(a68_0xc2f6,0x45905));import{writeFileSync,existsSync,mkdirSync}from'node:fs';import{resolve,join}from'node:path';import{fileURLToPath}from'node:url';import{dirname}from'node:path';function a68_0xc2f6(){const _0x3c2cf8=['../../cdn-source/skills','skill.cdn.fetchFailed','keys','guides','.lovrabet/skill-manifest.json','191290LtFmqV','3043931kyAFlI','202854hhdNmX','toISOString','log','setLogPath','2.0.0','10ZYotdn','skill.cdn.fetchSuccess','length','开始安装技能包','安装成功','info','14lBaVFE','skill.error.unknownIDE','1950632cIuvVd','error','18rzATSI','skill-install-non-interactive','name','skill.done.guidesPathInline','.lovrabet/skill/.shared/guides','\x20\x20✓\x20','.lovrabet','bind','9119484zAojoy','463724lnbhwO','5dgPcja','skill.cdn.fetchingExtend','4074jkFvhb','utf-8','stringify','skill.error.installFailed','766YGRLee'];a68_0xc2f6=function(){return _0x3c2cf8;};return a68_0xc2f6();}import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';function a68_0x2ee9(_0x5846bf,_0x55400e){_0x5846bf=_0x5846bf-0x76;const _0xc2f611=a68_0xc2f6();let _0x2ee9ca=_0xc2f611[_0x5846bf];return _0x2ee9ca;}import{installSingleIDE}from'./skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import a68_0x1a3fc4 from'../i18n/index.js';const t=a68_0x1a3fc4['t'][a68_0x14b76b(0x88)](a68_0x1a3fc4),__dirname=dirname(fileURLToPath(import.meta.url));export async function installSkillsNonInteractive(_0x29f00d,_0x19b87f,_0x5a1fa3=process['cwd']()){const _0x581c75=a68_0x14b76b,_0x4c8fac=resolve(__dirname,_0x581c75(0x92));logger[_0x581c75(0x9c)](_0x5a1fa3),logger[_0x581c75(0x7c)](_0x581c75(0x82),_0x581c75(0x7a),{'ides':_0x29f00d});const _0x5b34a0=join(_0x5a1fa3,_0x581c75(0x87));!existsSync(_0x5b34a0)&&mkdirSync(_0x5b34a0,{'recursive':!![]});const _0x1c8ab7=_0x19b87f&&_0x19b87f[_0x581c75(0x79)]>0x0;console[_0x581c75(0x9b)](_0x1c8ab7?t(_0x581c75(0x8c)):t('skill.cdn.fetching'));let _0x54788f;try{_0x54788f=await fetchGuidesFromCDN(_0x1c8ab7),console['log'](t(_0x581c75(0x78),{'count':Object[_0x581c75(0x94)](_0x54788f[_0x581c75(0x95)])[_0x581c75(0x79)]}));}catch(_0x5b1eae){console['warn'](t(_0x581c75(0x93),{'error':_0x5b1eae instanceof Error?_0x5b1eae['message']:String(_0x5b1eae)}));}let _0xde99e2=0x0;for(const _0xb955a2 of _0x29f00d){try{const _0x454de9=IDE_CONFIGS[_0xb955a2];if(!_0x454de9){console['warn'](t(_0x581c75(0x7e),{'ide':_0xb955a2}));continue;}const _0x38041d=await installSingleIDE(_0xb955a2,_0x454de9,_0x5a1fa3,_0x4c8fac,_0x54788f,_0x19b87f);_0xde99e2+=_0x38041d,console[_0x581c75(0x9b)](_0x581c75(0x86)+(_0x454de9[_0x581c75(0x83)]||_0xb955a2));}catch(_0x3d6f63){console[_0x581c75(0x80)](t(_0x581c75(0x90),{'ide':_0xb955a2,'error':_0x3d6f63 instanceof Error?_0x3d6f63['message']:String(_0x3d6f63)}));}}_0x54788f&&writeGuidesToProject(_0x54788f,_0x5a1fa3,_0x581c75(0x85),_0x19b87f);const _0x4c65ca={'version':_0x581c75(0x76),'installedAt':new Date()[_0x581c75(0x9a)](),'platforms':_0x29f00d},_0x179005=join(_0x5a1fa3,_0x581c75(0x96));writeFileSync(_0x179005,JSON[_0x581c75(0x8f)](_0x4c65ca,null,0x2),_0x581c75(0x8e)),logger[_0x581c75(0x7c)]('skill-install-non-interactive',_0x581c75(0x7b),{'projectRoot':_0x5a1fa3,'ides':_0x29f00d,'foldersCount':_0xde99e2}),console[_0x581c75(0x9b)](t('skill.done.success',{'count':_0xde99e2})),console[_0x581c75(0x9b)](t(_0x581c75(0x84)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x24bb5a,_0x21570f){const _0x7b6e72=a69_0x3127,_0x16e877=_0x24bb5a();while(!![]){try{const _0x4c2e29=-parseInt(_0x7b6e72(0x96))/0x1+-parseInt(_0x7b6e72(0x94))/0x2*(parseInt(_0x7b6e72(0x95))/0x3)+-parseInt(_0x7b6e72(0xa6))/0x4+parseInt(_0x7b6e72(0x9e))/0x5*(-parseInt(_0x7b6e72(0xa8))/0x6)+-parseInt(_0x7b6e72(0x8d))/0x7+parseInt(_0x7b6e72(0x99))/0x8*(parseInt(_0x7b6e72(0x9d))/0x9)+parseInt(_0x7b6e72(0x9a))/0xa;if(_0x4c2e29===_0x21570f)break;else _0x16e877['push'](_0x16e877['shift']());}catch(_0x53566c){_0x16e877['push'](_0x16e877['shift']());}}}(a69_0x4969,0x37d7b));function a69_0x3127(_0x3ef171,_0x16077f){_0x3ef171=_0x3ef171-0x8d;const _0x496929=a69_0x4969();let _0x312796=_0x496929[_0x3ef171];return _0x312796;}import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{dirname,join}from'node:path';function a69_0x4969(){const _0x59993b=['keys','<!--\x20GUIDES_APPEND\x20-->','guides','path','1739048jFdndk','requireFlags','6rNiHuW','name','1647933JkShmA','length','utf-8','push','template','|\x20`','`\x20|\x20','2XHMRfp','1015743woCSeH','263560gVVSit','some','join','270304WAeWdF','18019480gcIxsp','files','folders','18xlBHVI','1842355AgkPyn','sort','title','replace'];a69_0x4969=function(){return _0x59993b;};return a69_0x4969();}import{writeSkillFile,appendExtendContents}from'../utils/guides-cdn.js';export async function installSingleIDE(_0x488cb8,_0xb1c6e6,_0x46b8ac,_0x3696e7,_0x5b02f1,_0x3d192f){const _0x54fdfc=a69_0x3127;let _0x2d254f=0x0;const _0x3e6bec=_0xb1c6e6?.[_0x54fdfc(0x9c)]??['.'+_0x488cb8];for(const _0x392cc8 of _0x3e6bec){const _0x45bb5e=join(_0x46b8ac,_0x392cc8),_0x298f51=_0xb1c6e6?.['files']?.[_0x54fdfc(0x97)](_0x5e21a6=>_0x5e21a6[_0x54fdfc(0xa5)]['startsWith'](_0x392cc8+'/'))??![];_0x298f51?!existsSync(_0x45bb5e)&&(mkdirSync(_0x45bb5e,{'recursive':!![]}),_0x2d254f++):!existsSync(_0x45bb5e)&&(writeFileSync(_0x45bb5e,'',_0x54fdfc(0x8f)),_0x2d254f++);}if(_0xb1c6e6?.[_0x54fdfc(0x9b)]){const _0x16704d=_0xb1c6e6[_0x54fdfc(0xa9)]||_0x488cb8;for(const _0x18873b of _0xb1c6e6[_0x54fdfc(0x9b)]){const _0x209550=join(_0x46b8ac,_0x18873b[_0x54fdfc(0xa5)]);await createFileFromTemplate(_0x18873b,_0x209550,_0x16704d,_0x3696e7,_0x5b02f1,_0x3d192f),_0x2d254f++;}}return _0x2d254f;}export async function createFileFromTemplate(_0xd78de5,_0xf87701,_0x28c63e,_0x27ec15,_0x56dfd2,_0x796b8f){const _0x527bf4=a69_0x3127,_0x1549f3=dirname(_0xf87701);!existsSync(_0x1549f3)&&mkdirSync(_0x1549f3,{'recursive':!![]});const _0x503895=_0xd78de5['template']==='SKILL.md.tpl';if(existsSync(_0xf87701)&&!_0x503895)return;if(_0xd78de5[_0x527bf4(0x91)]){const _0x272206=join(_0x27ec15,_0xd78de5[_0x527bf4(0x91)]);if(existsSync(_0x272206)){let _0x2e2a36=readFileSync(_0x272206,_0x527bf4(0x8f));_0x2e2a36=_0x2e2a36['replace'](/\{\{IDE_NAME\}\}/g,_0x28c63e);_0x56dfd2&&_0x503895&&(_0x2e2a36=insertGuidesSection(_0x2e2a36,_0x56dfd2,_0x796b8f),_0x2e2a36=appendExtendContents(_0x2e2a36,_0x56dfd2,_0x796b8f));writeFileSync(_0xf87701,_0x2e2a36,_0x527bf4(0x8f));return;}if(_0x56dfd2&&_0x503895)try{writeSkillFile(_0x56dfd2,_0xf87701,_0x28c63e,_0x796b8f);return;}catch{}}writeFileSync(_0xf87701,'',_0x527bf4(0x8f));}function insertGuidesSection(_0x167e2f,_0x35d970,_0x31a288){const _0x31e186=a69_0x3127,_0x5ad7d2=_0x31e186(0xa3),_0x4c88d4=_0x167e2f['indexOf'](_0x5ad7d2);if(_0x4c88d4===-0x1)return _0x167e2f;const _0x2cf774=[],_0x6e4c3c=Object[_0x31e186(0xa2)](_0x35d970[_0x31e186(0xa4)])[_0x31e186(0x9f)]();for(const _0x1c7e45 of _0x6e4c3c){const _0x1c2dda=_0x35d970['guides'][_0x1c7e45];if(!_0x1c2dda)continue;if(/^0[1-6]-/['test'](_0x1c7e45))continue;if(_0x1c2dda[_0x31e186(0xa7)]&&_0x1c2dda[_0x31e186(0xa7)][_0x31e186(0x8e)]>0x0){const _0x36c60a=_0x1c2dda[_0x31e186(0xa7)][_0x31e186(0x97)](_0x428dee=>_0x31a288?.['includes'](_0x428dee));if(!_0x36c60a)continue;}const _0x4ece2a=_0x1c2dda['path'][_0x31e186(0xa1)](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x2cf774[_0x31e186(0x90)](_0x31e186(0x92)+_0x4ece2a+_0x31e186(0x93)+_0x1c2dda[_0x31e186(0xa0)]+'\x20|');}if(_0x2cf774[_0x31e186(0x8e)]===0x0)return _0x167e2f[_0x31e186(0xa1)](_0x5ad7d2,_0x31e186(0xa3));const _0x59e61b=_0x2cf774[_0x31e186(0x98)]('\x0a');return _0x167e2f[_0x31e186(0xa1)](_0x5ad7d2,_0x59e61b+'\x0a<!--\x20GUIDES_APPEND\x20-->');}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5bb3,_0x3e4266){const _0x459e94=a71_0x422e,_0x4b3e4e=_0x5bb3();while(!![]){try{const _0x145208=-parseInt(_0x459e94(0x1a5))/0x1+-parseInt(_0x459e94(0x1a8))/0x2*(parseInt(_0x459e94(0x19b))/0x3)+parseInt(_0x459e94(0x1a1))/0x4*(parseInt(_0x459e94(0x1a4))/0x5)+parseInt(_0x459e94(0x19f))/0x6*(parseInt(_0x459e94(0x19e))/0x7)+-parseInt(_0x459e94(0x1a6))/0x8*(parseInt(_0x459e94(0x1a0))/0x9)+parseInt(_0x459e94(0x1aa))/0xa+parseInt(_0x459e94(0x19d))/0xb*(parseInt(_0x459e94(0x196))/0xc);if(_0x145208===_0x3e4266)break;else _0x4b3e4e['push'](_0x4b3e4e['shift']());}catch(_0x302d30){_0x4b3e4e['push'](_0x4b3e4e['shift']());}}}(a71_0x17d4,0x80452));function a71_0x422e(_0x5b66ec,_0x22e597){_0x5b66ec=_0x5b66ec-0x194;const _0x17d476=a71_0x17d4();let _0x422e64=_0x17d476[_0x5b66ec];return _0x422e64;}import{jsxs as a71_0x119afc,jsx as a71_0x55780e}from'react/jsx-runtime';import{Text,Box}from'ink';function a71_0x17d4(){const _0x1be828=['column','[✓]','red','ui.ideSelector.hotkeys','864192qaemid','name','gray','white','has','33CzbaHa','ui.ideSelector.title','22mLPwqc','13118THEPNg','3174aGMLoc','45BBeluH','4pviLoe','[\x20]','description','3035735zADHpO','461077GyMEDO','1157960itUyMd','blue','181282jgbEGM','cyan','9647220dAccdL'];a71_0x17d4=function(){return _0x1be828;};return a71_0x17d4();}import{useI18n}from'../i18n/hooks.js';export function IDESelector({ideList:_0x378a11,title:_0x1d2096,selection:_0x247f1d}){const _0x51ceeb=a71_0x422e,{t:_0x30ebf9}=useI18n(),{selectedIndexes:_0x1d3860,highlightIndex:_0x2ea2da,errorMsg:_0x26b069}=_0x247f1d;return a71_0x119afc(Box,{'flexDirection':_0x51ceeb(0x1ab),'marginTop':0x1,'children':[a71_0x55780e(Box,{'children':a71_0x119afc(Text,{'color':_0x51ceeb(0x1a9),'children':['*\x20',_0x1d2096]})}),_0x26b069&&a71_0x55780e(Box,{'marginTop':0x1,'children':a71_0x119afc(Text,{'color':_0x51ceeb(0x194),'children':['✗\x20',_0x26b069]})}),a71_0x119afc(Box,{'marginTop':0x1,'flexDirection':_0x51ceeb(0x1ab),'children':[a71_0x119afc(Text,{'bold':!![],'children':['*\x20',_0x30ebf9(_0x51ceeb(0x19c))]}),_0x378a11['map']((_0x4caf54,_0x2649eb)=>{const _0xff9ae=_0x51ceeb,_0x35d66f=_0x2ea2da===_0x2649eb,_0x2ab22f=_0x1d3860[_0xff9ae(0x19a)](_0x2649eb);return a71_0x55780e(Box,{'children':a71_0x119afc(Text,{'backgroundColor':_0x35d66f?_0xff9ae(0x1a7):undefined,'color':_0x35d66f?_0xff9ae(0x199):undefined,'children':['\x20\x20',_0x2ab22f?_0xff9ae(0x1ac):_0xff9ae(0x1a2),'\x20',_0x4caf54[_0xff9ae(0x197)],'\x20',a71_0x119afc(Text,{'color':_0x35d66f?'white':_0xff9ae(0x198),'dimColor':!_0x35d66f,'children':['-\x20',_0x4caf54[_0xff9ae(0x1a3)]]})]})},_0x4caf54['key']);}),a71_0x55780e(Box,{'marginTop':0x1,'children':a71_0x119afc(Text,{'color':_0x51ceeb(0x198),'children':['\x20',_0x30ebf9(_0x51ceeb(0x195))]})})]})]});}export{useIDESelection}from'./useIDESelection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x350e3b,_0x15e4c1){const _0x574642=a72_0x274a,_0x22b2f0=_0x350e3b();while(!![]){try{const _0x1341d5=parseInt(_0x574642(0x16d))/0x1+-parseInt(_0x574642(0x16b))/0x2+parseInt(_0x574642(0x170))/0x3+parseInt(_0x574642(0x179))/0x4*(parseInt(_0x574642(0x16e))/0x5)+parseInt(_0x574642(0x16f))/0x6*(-parseInt(_0x574642(0x16a))/0x7)+-parseInt(_0x574642(0x17d))/0x8*(-parseInt(_0x574642(0x174))/0x9)+-parseInt(_0x574642(0x177))/0xa*(parseInt(_0x574642(0x175))/0xb);if(_0x1341d5===_0x15e4c1)break;else _0x22b2f0['push'](_0x22b2f0['shift']());}catch(_0x3815d6){_0x22b2f0['push'](_0x22b2f0['shift']());}}}(a72_0x30af,0x3962a));function a72_0x274a(_0x9872ac,_0x3a7582){_0x9872ac=_0x9872ac-0x16a;const _0x30af4b=a72_0x30af();let _0x274a34=_0x30af4b[_0x9872ac];return _0x274a34;}function a72_0x30af(){const _0x182cd9=['42XqzaRx','752892ZeQcjO','delete','length','downArrow','9HEiqBb','97130ktDHCv','map','590AcZdRA','key','148MzfaNe','filter','findIndex','from','3743848ghTgwe','35196mrAUnD','505914eXmaDO','has','155620GEdvhf','22920VOIiqF'];a72_0x30af=function(){return _0x182cd9;};return a72_0x30af();}import{useState,useCallback}from'react';export function useIDESelection({ideList:_0x4a7c8c,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0xbce404=a72_0x274a,[_0x13e887,_0x516aa7]=useState(new Set(preselectedIDEs[_0xbce404(0x176)](_0x3daeb3=>_0x4a7c8c[_0xbce404(0x17b)](_0x164d1d=>_0x164d1d[_0xbce404(0x178)]===_0x3daeb3))[_0xbce404(0x17a)](_0x324200=>_0x324200>=0x0))),[_0x576b88,_0x253568]=useState(0x0),[_0x26e112,_0x560027]=useState(''),_0x5115af=useCallback(()=>{const _0x1d8b26=_0xbce404;_0x253568(_0x4fb5ea=>_0x4fb5ea>0x0?_0x4fb5ea-0x1:_0x4a7c8c[_0x1d8b26(0x172)]-0x1);},[_0x4a7c8c[_0xbce404(0x172)]]),_0x1396c6=useCallback(()=>{const _0x97b1aa=_0xbce404;_0x253568(_0x14d1c7=>_0x14d1c7<_0x4a7c8c[_0x97b1aa(0x172)]-0x1?_0x14d1c7+0x1:0x0);},[_0x4a7c8c['length']]),_0x3a214d=useCallback(()=>{if(!multiSelect){_0x516aa7(new Set([_0x576b88]));return;}_0x516aa7(_0x1b7785=>{const _0x4d2f2b=a72_0x274a,_0x1174a5=new Set(_0x1b7785);return _0x1174a5['has'](_0x576b88)?_0x1174a5[_0x4d2f2b(0x171)](_0x576b88):_0x1174a5['add'](_0x576b88),_0x1174a5;});},[_0x576b88,multiSelect]),_0x1c6cb7=useCallback(()=>{const _0x2b1394=_0xbce404;_0x516aa7(new Set(_0x4a7c8c[_0x2b1394(0x176)]((_0x2a6046,_0x527c10)=>_0x527c10)));},[_0x4a7c8c]),_0x1e0581=useCallback(()=>{_0x516aa7(_0x5240c4=>{const _0x2e2dc7=a72_0x274a,_0x4b9a6e=new Set();for(let _0x495c1a=0x0;_0x495c1a<_0x4a7c8c[_0x2e2dc7(0x172)];_0x495c1a++){!_0x5240c4[_0x2e2dc7(0x16c)](_0x495c1a)&&_0x4b9a6e['add'](_0x495c1a);}return _0x4b9a6e;});},[_0x4a7c8c]),_0x2590df=useCallback(()=>{const _0x2b0994=_0xbce404;return Array[_0x2b0994(0x17c)](_0x13e887)[_0x2b0994(0x176)](_0x293075=>_0x4a7c8c[_0x293075]?.['key'])[_0x2b0994(0x17a)](_0x52f800=>_0x52f800!==undefined);},[_0x13e887,_0x4a7c8c]),_0x5033d4=useCallback(()=>{return _0x13e887['size']===_0x4a7c8c['length'];},[_0x13e887,_0x4a7c8c]),_0x12297c=useCallback((_0x20b890,_0x3c165a)=>{const _0x11837c=_0xbce404;if(_0x3c165a['upArrow'])return _0x5115af(),!![];if(_0x3c165a[_0x11837c(0x173)])return _0x1396c6(),!![];if(_0x20b890==='\x20')return _0x3a214d(),!![];if(_0x20b890==='a'||_0x20b890==='A')return _0x1c6cb7(),!![];if(_0x20b890==='i'||_0x20b890==='I'||_0x20b890==='r'||_0x20b890==='R')return _0x1e0581(),!![];return![];},[_0x5115af,_0x1396c6,_0x3a214d,_0x1c6cb7,_0x1e0581]);return{'selectedIndexes':_0x13e887,'highlightIndex':_0x576b88,'errorMsg':_0x26e112,'setErrorMsg':_0x560027,'handleKeyDown':_0x12297c,'getSelectedIDEs':_0x2590df,'isAllSelected':_0x5033d4,'toggleSelection':_0x3a214d,'selectAll':_0x1c6cb7,'invertSelection':_0x1e0581,'moveHighlightUp':_0x5115af,'moveHighlightDown':_0x1396c6};}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a73_0x17d7(_0x5064fb,_0x264b6b){_0x5064fb=_0x5064fb-0x10c;const _0x1a8e6b=a73_0x1a8e();let _0x17d796=_0x1a8e6b[_0x5064fb];return _0x17d796;}const a73_0x2f2c9c=a73_0x17d7;(function(_0x490ee8,_0x18ee7f){const _0xc3ebe=a73_0x17d7,_0xfcfd9f=_0x490ee8();while(!![]){try{const _0x21198e=parseInt(_0xc3ebe(0x129))/0x1*(parseInt(_0xc3ebe(0x134))/0x2)+parseInt(_0xc3ebe(0x118))/0x3*(parseInt(_0xc3ebe(0x12e))/0x4)+-parseInt(_0xc3ebe(0x13d))/0x5*(-parseInt(_0xc3ebe(0x123))/0x6)+parseInt(_0xc3ebe(0x126))/0x7+-parseInt(_0xc3ebe(0x114))/0x8+parseInt(_0xc3ebe(0x112))/0x9*(-parseInt(_0xc3ebe(0x13c))/0xa)+parseInt(_0xc3ebe(0x125))/0xb*(-parseInt(_0xc3ebe(0x11f))/0xc);if(_0x21198e===_0x18ee7f)break;else _0xfcfd9f['push'](_0xfcfd9f['shift']());}catch(_0x1c322c){_0xfcfd9f['push'](_0xfcfd9f['shift']());}}}(a73_0x1a8e,0x42379));export const CORE_IDE_CONFIGS={'cursor':{'name':'Cursor','description':'Cursor\x20IDE','folders':[a73_0x2f2c9c(0x11c),a73_0x2f2c9c(0x13f)],'files':[{'type':'file','path':'.cursor/skills/lovrabet.md','template':a73_0x2f2c9c(0x122)}]},'windsurf':{'name':a73_0x2f2c9c(0x13e),'description':'Windsurf\x20IDE','folders':[a73_0x2f2c9c(0x117)],'files':[{'type':a73_0x2f2c9c(0x13b),'path':'.windsurf/workflows/lovrabet.md','template':a73_0x2f2c9c(0x122)}]},'claude':{'name':a73_0x2f2c9c(0x121),'description':a73_0x2f2c9c(0x121),'folders':[a73_0x2f2c9c(0x139)],'files':[{'type':'file','path':'.claude/skills/lovrabet/SKILL.md','template':a73_0x2f2c9c(0x122)}]},'cline':{'name':'Cline','description':a73_0x2f2c9c(0x111),'folders':[a73_0x2f2c9c(0x133)],'files':[{'type':a73_0x2f2c9c(0x13b),'path':a73_0x2f2c9c(0x12a),'template':a73_0x2f2c9c(0x122)}]},'codex':{'name':'Codex','description':'Codex\x20IDE','folders':['.codex'],'files':[{'type':a73_0x2f2c9c(0x13b),'path':a73_0x2f2c9c(0x12b),'template':a73_0x2f2c9c(0x122)}]},'opencode':{'name':a73_0x2f2c9c(0x12d),'description':a73_0x2f2c9c(0x130),'folders':[a73_0x2f2c9c(0x115)],'files':[{'type':'file','path':'.opencode/skills/lovrabet/SKILL.md','template':a73_0x2f2c9c(0x122)}]},'qoder':{'name':a73_0x2f2c9c(0x12c),'description':a73_0x2f2c9c(0x128),'folders':['.qoder'],'files':[{'type':a73_0x2f2c9c(0x13b),'path':a73_0x2f2c9c(0x11a),'template':'SKILL.md.tpl'},{'type':'file','path':'.qoder/skills/lovrabet/SKILL.md','template':a73_0x2f2c9c(0x122)}]},'codebuddy':{'name':'CodeBuddy','description':a73_0x2f2c9c(0x138),'folders':[a73_0x2f2c9c(0x135)],'files':[{'type':'file','path':a73_0x2f2c9c(0x12f),'template':a73_0x2f2c9c(0x122)}]},'trae':{'name':a73_0x2f2c9c(0x131),'description':a73_0x2f2c9c(0x11d),'folders':[a73_0x2f2c9c(0x137)],'files':[{'type':'file','path':'.trae/skills/lovrabet/SKILL.md','template':a73_0x2f2c9c(0x122)}]}};export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a73_0x2f2c9c(0x120),'description':a73_0x2f2c9c(0x11b),'folders':[a73_0x2f2c9c(0x11e)],'files':[{'type':a73_0x2f2c9c(0x13b),'path':a73_0x2f2c9c(0x132),'template':'SKILL.md.tpl'}]},'antigravity':{'name':'Antigravity','description':a73_0x2f2c9c(0x10e),'folders':[a73_0x2f2c9c(0x11e)],'files':[{'type':a73_0x2f2c9c(0x13b),'path':a73_0x2f2c9c(0x132),'template':'SKILL.md.tpl'}]}};export const CORE_IDE_LIST=[a73_0x2f2c9c(0x113),'cline',a73_0x2f2c9c(0x10c),a73_0x2f2c9c(0x116),a73_0x2f2c9c(0x10d),a73_0x2f2c9c(0x127),a73_0x2f2c9c(0x119),a73_0x2f2c9c(0x110),a73_0x2f2c9c(0x13a)];export const IDE_LIST=[a73_0x2f2c9c(0x136),a73_0x2f2c9c(0x113),a73_0x2f2c9c(0x10f),a73_0x2f2c9c(0x10c),'codex',a73_0x2f2c9c(0x10d),a73_0x2f2c9c(0x127),a73_0x2f2c9c(0x119),a73_0x2f2c9c(0x110),a73_0x2f2c9c(0x13a),a73_0x2f2c9c(0x124)];export const ALL_CORE_IDES=[a73_0x2f2c9c(0x10d),a73_0x2f2c9c(0x13a),'claude',a73_0x2f2c9c(0x10f),a73_0x2f2c9c(0x116),'opencode',a73_0x2f2c9c(0x119),'codebuddy',a73_0x2f2c9c(0x110)];function a73_0x1a8e(){const _0x2b3caa=['Antigravity\x20IDE','cline','trae','Cline\x20IDE','1827qENQPZ','claude','2153488tJVTkV','.opencode','codex','.windsurf','6cBzErH','qoder','.qoder/rules/lovrabet.md','通用模板\x20-\x20兜底方案','.cursorrules','Trae\x20IDE','.agent','36hgdRey','其他\x20(通用模板)','Claude\x20Code','SKILL.md.tpl','319704nOzSVL','agent','1623127dnrNfv','3631600XkAfBf','opencode','Qoder\x20IDE','1uJrgyJ','.cline/skills/lovrabet/SKILL.md','.codex/skills/lovrabet/SKILL.md','Qoder','OpenCode','603656HweIhp','.codebuddy/skills/lovrabet/SKILL.md','OpenCode\x20IDE','Trae','.agent/skills/lovrabet/SKILL.md','.cline','114446iEcKOu','.codebuddy','antigravity','.trae','CodeBuddy\x20IDE','.claude','windsurf','file','13190ubbHdR','35dyPNnm','Windsurf','.cursor','codebuddy','cursor'];a73_0x1a8e=function(){return _0x2b3caa;};return a73_0x1a8e();}export const MCP_IDES=new Set([a73_0x2f2c9c(0x10d),a73_0x2f2c9c(0x113)]);
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e65a0,_0x28a795){const _0x8b7961=a74_0x903f,_0x2de9f2=_0x1e65a0();while(!![]){try{const _0x4184b1=-parseInt(_0x8b7961(0x13e))/0x1+-parseInt(_0x8b7961(0x13b))/0x2+-parseInt(_0x8b7961(0x139))/0x3+parseInt(_0x8b7961(0x13c))/0x4*(parseInt(_0x8b7961(0x140))/0x5)+parseInt(_0x8b7961(0x13d))/0x6+parseInt(_0x8b7961(0x145))/0x7+-parseInt(_0x8b7961(0x143))/0x8*(-parseInt(_0x8b7961(0x141))/0x9);if(_0x4184b1===_0x28a795)break;else _0x2de9f2['push'](_0x2de9f2['shift']());}catch(_0x27758b){_0x2de9f2['push'](_0x2de9f2['shift']());}}}(a74_0x2db3,0x753f8));import{getTemplateBaseUrl}from'./config.js';export async function fetchCdnConfig(){const _0x39451a=a74_0x903f;try{const _0x3972fc=getTemplateBaseUrl(),_0x4fc9aa=_0x3972fc+_0x39451a(0x147),_0x29c62b=await fetch(_0x4fc9aa,{'headers':{'Accept':_0x39451a(0x146)}});if(!_0x29c62b['ok'])return null;const _0x27083a=await _0x29c62b[_0x39451a(0x144)]();if(!_0x27083a[_0x39451a(0x142)]?.['stableVersion']||!_0x27083a['sdk']?.[_0x39451a(0x13a)]?.[_0x39451a(0x13f)])return null;return _0x27083a;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8;export async function getCdnConfig(){const _0x3b664=Date['now']();if(cachedConfig&&_0x3b664-cacheTime<CACHE_TTL)return cachedConfig;const _0x3e56a2=await fetchCdnConfig();return _0x3e56a2&&(cachedConfig=_0x3e56a2,cacheTime=_0x3b664),_0x3e56a2;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}function a74_0x903f(_0x2a838b,_0x2f58c3){_0x2a838b=_0x2a838b-0x139;const _0x2db336=a74_0x2db3();let _0x903f23=_0x2db336[_0x2a838b];return _0x903f23;}function a74_0x2db3(){const _0x210ef5=['9WbNwcC','cli','3819176ZQbDxB','json','5853904clzzNn','application/json','/config.json','1089243cqUPBA','node','596404CUgoTe','4GeKIye','1881708fBBtsa','890081hNBqPr','stableVersion','2021625JVaqxD'];a74_0x2db3=function(){return _0x210ef5;};return a74_0x2db3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a75_0xfbf196=a75_0x4b97;(function(_0x565e6c,_0x463f7a){const _0x2fc10d=a75_0x4b97,_0x65ada8=_0x565e6c();while(!![]){try{const _0x18d402=parseInt(_0x2fc10d(0x1f9))/0x1+-parseInt(_0x2fc10d(0x1e4))/0x2*(parseInt(_0x2fc10d(0x1f1))/0x3)+parseInt(_0x2fc10d(0x1f2))/0x4+parseInt(_0x2fc10d(0x1df))/0x5+parseInt(_0x2fc10d(0x1e6))/0x6+-parseInt(_0x2fc10d(0x1d7))/0x7+-parseInt(_0x2fc10d(0x1eb))/0x8;if(_0x18d402===_0x463f7a)break;else _0x65ada8['push'](_0x65ada8['shift']());}catch(_0x256fdb){_0x65ada8['push'](_0x65ada8['shift']());}}}(a75_0x5a9f,0x9262d));import a75_0x3bcca7 from'node:fs';import a75_0xf08880 from'node:path';import a75_0x13cfd4 from'semver';import{getCdnConfig}from'./cdn-config.js';import a75_0x5ddd90 from'../i18n/index.js';const t=a75_0x5ddd90['t'][a75_0xfbf196(0x1e8)](a75_0x5ddd90),FALLBACK_MIN_SDK_VERSION=a75_0xfbf196(0x1ef);function isNonNumericVersion(_0x468d44){const _0x1f9d4e=a75_0xfbf196,_0x2a7d3a=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x2a7d3a[_0x1f9d4e(0x1ee)](_0x3bfd49=>_0x3bfd49[_0x1f9d4e(0x1f6)](_0x468d44));}function getInstalledVersion(_0x2db0bf,_0x337fa7){const _0x443e6c=a75_0xfbf196;try{const _0x3a3d5b=a75_0xf08880[_0x443e6c(0x1d8)](_0x2db0bf,_0x443e6c(0x1f7),_0x337fa7,_0x443e6c(0x1f4));if(a75_0x3bcca7['existsSync'](_0x3a3d5b)){const _0x16eb6c=JSON[_0x443e6c(0x1ea)](a75_0x3bcca7['readFileSync'](_0x3a3d5b,_0x443e6c(0x1f5)));return _0x16eb6c[_0x443e6c(0x1f3)]||null;}}catch{}return null;}function a75_0x4b97(_0xd4d654,_0x446117){_0xd4d654=_0xd4d654-0x1d4;const _0x5a9f5e=a75_0x5a9f();let _0x4b9790=_0x5a9f5e[_0xd4d654];return _0x4b9790;}function a75_0x5a9f(){const _0x5b8f35=['stableVersion','4448955SXaGSj','join','upgrade.sdk.current','coerce','existsSync','devDependencies','minVersion','needsUpgrade','4428485IpkJFa','@lovrabet/sdk','\x1b[0m','readFileSync','utf8','6HMLaKJ','upgrade.sdk.command','3684396TkDBKt','sdk','bind','log','parse','13381144byvRgg','dependencies','all','some','1.2.0','\x1b[33m','71601byCwoq','3230720KxmxlY','version','package.json','utf-8','test','node_modules','\x1b[1m','671963kAXJkY','upgrade.sdk.stable','latest','node'];a75_0x5a9f=function(){return _0x5b8f35;};return a75_0x5a9f();}async function getSdkStableVersion(){const _0x2e02f4=a75_0xfbf196;try{const _0xa167b3=await getCdnConfig();return _0xa167b3?.[_0x2e02f4(0x1e7)]?.[_0x2e02f4(0x1d5)]?.[_0x2e02f4(0x1d6)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x3fcb80=a75_0xfbf196;try{const _0x57102b=await getCdnConfig();return _0x57102b?.[_0x3fcb80(0x1e7)]?.['node']?.['packageName']||'@lovrabet/sdk';}catch{return _0x3fcb80(0x1e0);}}export async function checkSdkVersion(_0x4eaf02){const _0x396d16=a75_0xfbf196,_0x2dcd0f=a75_0xf08880[_0x396d16(0x1d8)](_0x4eaf02,'package.json'),[_0x56e1a2,_0x408974]=await Promise[_0x396d16(0x1ed)]([getSdkStableVersion(),getSdkPackageName()]),_0x291461=_0x56e1a2||FALLBACK_MIN_SDK_VERSION;if(!a75_0x3bcca7[_0x396d16(0x1db)](_0x2dcd0f))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x291461,'packageName':_0x408974,'stableVersion':_0x56e1a2};try{const _0xecb045=JSON[_0x396d16(0x1ea)](a75_0x3bcca7[_0x396d16(0x1e2)](_0x2dcd0f,_0x396d16(0x1e3))),_0x528369=_0xecb045[_0x396d16(0x1ec)]||{},_0x5afd25=_0xecb045[_0x396d16(0x1dc)]||{},_0x499385=_0x528369[_0x408974]||_0x5afd25[_0x408974];if(!_0x499385)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x291461,'packageName':_0x408974,'stableVersion':_0x56e1a2};let _0x5dbc68=getInstalledVersion(_0x4eaf02,_0x408974);!_0x5dbc68&&(_0x5dbc68=_0x499385);if(isNonNumericVersion(_0x499385))return{'installed':!![],'version':_0x5dbc68,'needsUpgrade':![],'minVersion':_0x291461,'packageName':_0x408974,'stableVersion':_0x56e1a2};const _0x371c45=a75_0x13cfd4['coerce'](_0x5dbc68),_0x23e9a7=a75_0x13cfd4['coerce'](_0x291461),_0x1bb01f=_0x371c45&&_0x23e9a7?a75_0x13cfd4['lt'](_0x371c45,_0x23e9a7):![];return{'installed':!![],'version':_0x5dbc68,'needsUpgrade':_0x1bb01f,'minVersion':_0x291461,'packageName':_0x408974,'stableVersion':_0x56e1a2};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x291461,'packageName':_0x408974,'stableVersion':_0x56e1a2};}}export function checkSdkVersionSync(_0x1528cc){const _0x156177=a75_0xfbf196,_0x3499ae=a75_0xf08880['join'](_0x1528cc,_0x156177(0x1f4)),_0x5426fa='@lovrabet/sdk';if(!a75_0x3bcca7['existsSync'](_0x3499ae))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5426fa,'stableVersion':null};try{const _0x1dd20c=JSON['parse'](a75_0x3bcca7[_0x156177(0x1e2)](_0x3499ae,'utf8')),_0x222592=_0x1dd20c['dependencies']||{},_0x112349=_0x1dd20c[_0x156177(0x1dc)]||{},_0x2d8b6e=_0x222592[_0x5426fa]||_0x112349[_0x5426fa];if(!_0x2d8b6e)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5426fa,'stableVersion':null};let _0x4e50b2=getInstalledVersion(_0x1528cc,_0x5426fa);!_0x4e50b2&&(_0x4e50b2=_0x2d8b6e);if(isNonNumericVersion(_0x2d8b6e))return{'installed':!![],'version':_0x4e50b2,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5426fa,'stableVersion':null};const _0x442ac0=a75_0x13cfd4[_0x156177(0x1da)](_0x4e50b2),_0x427f50=_0x442ac0?a75_0x13cfd4['lt'](_0x442ac0,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x4e50b2,'needsUpgrade':_0x427f50,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5426fa,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x5426fa,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x52b26c){const _0x5d35b4=a75_0xfbf196;if(!_0x52b26c[_0x5d35b4(0x1de)])return;const _0x4b78f7=_0x5d35b4(0x1f0),_0x142132=_0x5d35b4(0x1e1),_0x583e77=_0x5d35b4(0x1f8),_0x14ae3d=_0x52b26c['packageName']||_0x5d35b4(0x1e0),_0x3680b0=_0x52b26c[_0x5d35b4(0x1d6)]||_0x52b26c[_0x5d35b4(0x1dd)],_0x50ef09='npm\x20install\x20'+_0x14ae3d+'@'+(_0x3680b0||_0x5d35b4(0x1d4));console['log'](),console[_0x5d35b4(0x1e9)](''+_0x4b78f7+_0x583e77+t('upgrade.sdk.title')+_0x142132),console[_0x5d35b4(0x1e9)](''+_0x4b78f7+t(_0x5d35b4(0x1d9),{'package':_0x14ae3d,'version':_0x52b26c[_0x5d35b4(0x1f3)]})+_0x142132),console[_0x5d35b4(0x1e9)](''+_0x4b78f7+t(_0x5d35b4(0x1fa),{'version':_0x3680b0})+_0x142132),console[_0x5d35b4(0x1e9)](''+_0x4b78f7+t(_0x5d35b4(0x1e5),{'command':_0x50ef09})+_0x142132),console[_0x5d35b4(0x1e9)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x540768,_0x1a3013){const _0x1dd41e=a76_0x25d2,_0x59a401=_0x540768();while(!![]){try{const _0x5d6c29=-parseInt(_0x1dd41e(0x12c))/0x1*(-parseInt(_0x1dd41e(0x129))/0x2)+parseInt(_0x1dd41e(0x131))/0x3+-parseInt(_0x1dd41e(0x140))/0x4+parseInt(_0x1dd41e(0x130))/0x5+-parseInt(_0x1dd41e(0x12b))/0x6*(-parseInt(_0x1dd41e(0x142))/0x7)+parseInt(_0x1dd41e(0x138))/0x8*(-parseInt(_0x1dd41e(0x13b))/0x9)+-parseInt(_0x1dd41e(0x12f))/0xa;if(_0x5d6c29===_0x1a3013)break;else _0x59a401['push'](_0x59a401['shift']());}catch(_0x488e3f){_0x59a401['push'](_0x59a401['shift']());}}}(a76_0x240b,0xb7b6e));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a76_0x412a24 from'semver';import{getCdnConfig}from'./cdn-config.js';function a76_0x240b(){const _0x1ed876=['test','1515474vFpzid','\x1b[33m','upgrade.cli.command','utf-8','\x1b[0m','3181716AAlFgf','version','49qnpolq','some','cli','52XrLPbn','stableVersion','870540BzDdFY','7988Vrbtuc','1.0.0','../..','10202460AKaqXz','5031015jxcjZX','2531418uPgcwx','package.json','coerce','parse','upgrade.cli.title','upgrade.cli.current','\x1b[1m','24hPJpRI','log'];a76_0x240b=function(){return _0x1ed876;};return a76_0x240b();}import a76_0x156c0f from'../i18n/index.js';const t=a76_0x156c0f['t']['bind'](a76_0x156c0f);function getCurrentCliVersion(){const _0x348ac7=a76_0x25d2;try{const _0x383571=fileURLToPath(import.meta.url),_0x2fe086=resolve(dirname(_0x383571),_0x348ac7(0x12e)),_0x5a643b=resolve(_0x2fe086,_0x348ac7(0x132)),_0x1572a5=JSON[_0x348ac7(0x134)](readFileSync(_0x5a643b,_0x348ac7(0x13e)));return _0x1572a5[_0x348ac7(0x141)]||_0x348ac7(0x12d);}catch{return _0x348ac7(0x12d);}}function isNonNumericVersion(_0x4962dc){const _0x511624=a76_0x25d2,_0x32e936=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x32e936[_0x511624(0x143)](_0x4d531e=>_0x4d531e[_0x511624(0x13a)](_0x4962dc));}export async function checkCliVersion(){const _0x4423ab=a76_0x25d2,_0x46cd7a=getCurrentCliVersion(),_0xfaa7b3=await getCdnConfig(),_0x5c9979=_0xfaa7b3?.[_0x4423ab(0x144)]?.[_0x4423ab(0x12a)]||null;let _0x4bdc6f=![];if(_0x5c9979)try{const _0x31dd00=a76_0x412a24[_0x4423ab(0x133)](_0x46cd7a),_0x292bee=a76_0x412a24['coerce'](_0x5c9979);_0x31dd00&&_0x292bee&&(_0x4bdc6f=a76_0x412a24['lt'](_0x31dd00,_0x292bee));}catch{_0x4bdc6f=![];}return{'currentVersion':_0x46cd7a,'stableVersion':_0x5c9979,'needsUpgrade':_0x4bdc6f,'isPreRelease':![]};}function a76_0x25d2(_0x1d04ce,_0x497036){_0x1d04ce=_0x1d04ce-0x129;const _0x240ba6=a76_0x240b();let _0x25d293=_0x240ba6[_0x1d04ce];return _0x25d293;}export function printCliUpgradeWarning(_0x339c49){const _0x15ed9f=a76_0x25d2;if(!_0x339c49['needsUpgrade'])return;const _0x5ee00d=_0x15ed9f(0x13c),_0x55e918=_0x15ed9f(0x13f),_0x57feea=_0x15ed9f(0x137),_0x299b04='npm\x20install\x20-g\x20@lovrabet/cli@latest';console[_0x15ed9f(0x139)](),console[_0x15ed9f(0x139)](''+_0x5ee00d+_0x57feea+t(_0x15ed9f(0x135))+_0x55e918),console['log'](''+_0x5ee00d+t(_0x15ed9f(0x136),{'version':_0x339c49['currentVersion']})+_0x55e918),console[_0x15ed9f(0x139)](''+_0x5ee00d+t('upgrade.cli.stable',{'version':_0x339c49[_0x15ed9f(0x12a)]})+_0x55e918),console[_0x15ed9f(0x139)](''+_0x5ee00d+t(_0x15ed9f(0x13d),{'command':_0x299b04})+_0x55e918),console[_0x15ed9f(0x139)]();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a77_0x196d33=a77_0x40cc;(function(_0x34e758,_0x5818bb){const _0x571528=a77_0x40cc,_0x1d7a41=_0x34e758();while(!![]){try{const _0x323d24=-parseInt(_0x571528(0x13a))/0x1+parseInt(_0x571528(0x139))/0x2+parseInt(_0x571528(0x13f))/0x3+-parseInt(_0x571528(0x143))/0x4*(parseInt(_0x571528(0x14a))/0x5)+-parseInt(_0x571528(0x144))/0x6*(-parseInt(_0x571528(0x137))/0x7)+parseInt(_0x571528(0x141))/0x8+-parseInt(_0x571528(0x140))/0x9;if(_0x323d24===_0x5818bb)break;else _0x1d7a41['push'](_0x1d7a41['shift']());}catch(_0x4f2c83){_0x1d7a41['push'](_0x1d7a41['shift']());}}}(a77_0x55a0,0x8eaaf));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';import{initEnv}from'../constant/env.js';function a77_0x55a0(){const _0xd7d188=['app','8gmBdGp','188022HiqFvs','utf8','env','template_base_url','.lovrabetrc','cwd','308090xTiDXz','7HWqdGo','parse','1098602gbpEKp','1050726nQFsyp','appcode','string','replace','https://g.lovrabet.com/dist/lovrabet-cli','1140840qciptD','348696DkzZXT','6689240BJQPBJ'];a77_0x55a0=function(){return _0xd7d188;};return a77_0x55a0();}export const projectConfigPath=resolve(process[a77_0x196d33(0x149)](),a77_0x196d33(0x148));export const globalConfigPath=resolve(homedir(),'.lovrabetrc');export function readConfig(_0x4566ef){const _0x4093a8=a77_0x196d33;let _0x2c045b={};try{if(existsSync(globalConfigPath)){const _0x1dfcb4=readFileSync(globalConfigPath,{'encoding':_0x4093a8(0x145)});_0x1dfcb4&&(_0x2c045b=JSON[_0x4093a8(0x138)](_0x1dfcb4));}}catch(_0x260098){}try{const _0xfcff72=_0x4566ef?resolve(_0x4566ef,_0x4093a8(0x148)):projectConfigPath;if(existsSync(_0xfcff72)){const _0x1f9fea=readFileSync(_0xfcff72,{'encoding':_0x4093a8(0x145)});if(_0x1f9fea){const _0x5b63a8=JSON[_0x4093a8(0x138)](_0x1f9fea);_0x2c045b={..._0x2c045b,..._0x5b63a8};}}}catch(_0x1cb832){}return _0x2c045b[_0x4093a8(0x146)]&&typeof _0x2c045b[_0x4093a8(0x146)]==='string'&&initEnv(_0x2c045b[_0x4093a8(0x146)]),_0x2c045b;}function a77_0x40cc(_0x421cf9,_0x55d53e){_0x421cf9=_0x421cf9-0x137;const _0x55a0df=a77_0x55a0();let _0x40ccc6=_0x55a0df[_0x421cf9];return _0x40ccc6;}export function getConfigAppCode(){const _0x35b7ec=a77_0x196d33;let _0x24a210={},_0x2ddd3f={};try{if(existsSync(globalConfigPath)){const _0x5dc822=readFileSync(globalConfigPath,{'encoding':_0x35b7ec(0x145)});_0x5dc822&&(_0x2ddd3f=JSON[_0x35b7ec(0x138)](_0x5dc822));}}catch(_0x2f69fc){}try{if(existsSync(projectConfigPath)){const _0x938c08=readFileSync(projectConfigPath,{'encoding':_0x35b7ec(0x145)});_0x938c08&&(_0x24a210=JSON[_0x35b7ec(0x138)](_0x938c08));}}catch(_0x162a96){}let _0x5b1a3d;if(_0x35b7ec(0x13b)in _0x24a210)_0x5b1a3d=_0x24a210[_0x35b7ec(0x13b)];else{if('app'in _0x24a210)_0x5b1a3d=_0x24a210['app'];else{if(_0x35b7ec(0x13b)in _0x2ddd3f)_0x5b1a3d=_0x2ddd3f[_0x35b7ec(0x13b)];else _0x35b7ec(0x142)in _0x2ddd3f&&(_0x5b1a3d=_0x2ddd3f['app']);}}if(typeof _0x5b1a3d!==_0x35b7ec(0x13c)||_0x5b1a3d['trim']()==='')return undefined;return _0x5b1a3d;}export function isInProject(){return existsSync(projectConfigPath);}export function getTemplateBaseUrl(){const _0x5e9fcf=a77_0x196d33,_0x393e4d=readConfig();if(_0x393e4d[_0x5e9fcf(0x147)]&&typeof _0x393e4d['template_base_url']==='string')return _0x393e4d['template_base_url'][_0x5e9fcf(0x13d)](/\/$/,'');return _0x5e9fcf(0x13e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12d370,_0x20e015){const _0x2d1b53=a78_0x185a,_0x18aa19=_0x12d370();while(!![]){try{const _0x34d3d0=parseInt(_0x2d1b53(0x6b))/0x1+parseInt(_0x2d1b53(0x6a))/0x2*(parseInt(_0x2d1b53(0x76))/0x3)+-parseInt(_0x2d1b53(0x6f))/0x4+-parseInt(_0x2d1b53(0x6d))/0x5+parseInt(_0x2d1b53(0x70))/0x6*(parseInt(_0x2d1b53(0x68))/0x7)+-parseInt(_0x2d1b53(0x69))/0x8*(parseInt(_0x2d1b53(0x66))/0x9)+parseInt(_0x2d1b53(0x74))/0xa*(parseInt(_0x2d1b53(0x6c))/0xb);if(_0x34d3d0===_0x20e015)break;else _0x18aa19['push'](_0x18aa19['shift']());}catch(_0x39deb0){_0x18aa19['push'](_0x18aa19['shift']());}}}(a78_0x5b12,0xdbdc4));import a78_0x19d6ac from'node:path';import a78_0x39b540 from'node:fs';function a78_0x185a(_0x1553aa,_0x5e57b9){_0x1553aa=_0x1553aa-0x66;const _0x5b1281=a78_0x5b12();let _0x185a0f=_0x5b1281[_0x1553aa];return _0x185a0f;}export async function copyDirectory(_0x449e66,_0x3e0acc){const _0x26f6fa=a78_0x185a;try{const _0x2132cb=a78_0x39b540['readdirSync'](_0x449e66,{'withFileTypes':!![]});a78_0x39b540[_0x26f6fa(0x71)](_0x3e0acc,{'recursive':!![]});for(const _0xeb3733 of _0x2132cb){const _0x26d4c0=a78_0x19d6ac[_0x26f6fa(0x72)](_0x449e66,_0xeb3733[_0x26f6fa(0x75)]),_0x10137a=a78_0x19d6ac[_0x26f6fa(0x72)](_0x3e0acc,_0xeb3733[_0x26f6fa(0x75)]);_0xeb3733[_0x26f6fa(0x73)]()?await copyDirectory(_0x26d4c0,_0x10137a):a78_0x39b540['copyFileSync'](_0x26d4c0,_0x10137a);}}catch(_0x511236){console[_0x26f6fa(0x6e)](_0x26f6fa(0x67),_0x511236);}}function a78_0x5b12(){const _0x251bc6=['1560611SZPnAY','3817kBlJrS','5279260FzcwCT','error','5835848aPQGrD','897090ZojFfy','mkdirSync','join','isDirectory','3290ZGdLXg','name','1299GPCPLc','3870zwtZFs','复制目录时出错:','77yunPoQ','1768dYkVFY','882pcbvRB'];a78_0x5b12=function(){return _0x251bc6;};return a78_0x5b12();}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x305102,_0x4dd41f){const _0x13ec54=a79_0xc883,_0x3eb9e7=_0x305102();while(!![]){try{const _0x30f07c=parseInt(_0x13ec54(0x1a6))/0x1*(parseInt(_0x13ec54(0x1a7))/0x2)+-parseInt(_0x13ec54(0x1a3))/0x3*(-parseInt(_0x13ec54(0x1ab))/0x4)+-parseInt(_0x13ec54(0x1a0))/0x5*(-parseInt(_0x13ec54(0x1aa))/0x6)+parseInt(_0x13ec54(0x1a5))/0x7*(-parseInt(_0x13ec54(0x1a4))/0x8)+parseInt(_0x13ec54(0x1a8))/0x9*(-parseInt(_0x13ec54(0x19e))/0xa)+-parseInt(_0x13ec54(0x1a9))/0xb*(parseInt(_0x13ec54(0x1a2))/0xc)+-parseInt(_0x13ec54(0x19f))/0xd;if(_0x30f07c===_0x4dd41f)break;else _0x3eb9e7['push'](_0x3eb9e7['shift']());}catch(_0x589584){_0x3eb9e7['push'](_0x3eb9e7['shift']());}}}(a79_0x4cbb,0x1d348));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';function a79_0x4cbb(){const _0x35d2f9=['692135QufyRw','isDirectory','60ZIpZCP','6LxWnpd','1048mcwqUa','1337saDNHc','2074WGuZgQ','102DMQoKr','9EfFCLR','420926jPNgaZ','6pQHxWF','379856AswVFI','885140vfVjaX','125320IMRPlu'];a79_0x4cbb=function(){return _0x35d2f9;};return a79_0x4cbb();}export async function copyDir(_0x5d82fd,_0xe02d22){const _0x419d73=a79_0xc883,_0x5c35f5=statSync(_0x5d82fd);if(_0x5c35f5[_0x419d73(0x1a1)]()){!existsSync(_0xe02d22)&&mkdirSync(_0xe02d22,{'recursive':!![]});const _0x25d41c=readdirSync(_0x5d82fd);for(const _0x293f45 of _0x25d41c){await copyDir(join(_0x5d82fd,_0x293f45),join(_0xe02d22,_0x293f45));}}else copyFileSync(_0x5d82fd,_0xe02d22);}export function ensureDir(_0x4c19bd){!existsSync(_0x4c19bd)&&mkdirSync(_0x4c19bd,{'recursive':!![]});}function a79_0xc883(_0x12f241,_0xe0aefe){_0x12f241=_0x12f241-0x19e;const _0x4cbbec=a79_0x4cbb();let _0xc883a3=_0x4cbbec[_0x12f241];return _0xc883a3;}export function pathExists(_0x5a9422){return existsSync(_0x5a9422);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a80_0x4f4b6b=a80_0x5d4f;(function(_0xd6fc92,_0x28d56){const _0x251189=a80_0x5d4f,_0x189ca8=_0xd6fc92();while(!![]){try{const _0x4d0db9=parseInt(_0x251189(0x11c))/0x1*(parseInt(_0x251189(0x124))/0x2)+-parseInt(_0x251189(0x109))/0x3+-parseInt(_0x251189(0x119))/0x4+-parseInt(_0x251189(0x110))/0x5+-parseInt(_0x251189(0x121))/0x6+parseInt(_0x251189(0x11b))/0x7*(-parseInt(_0x251189(0x11e))/0x8)+-parseInt(_0x251189(0x10b))/0x9*(-parseInt(_0x251189(0x116))/0xa);if(_0x4d0db9===_0x28d56)break;else _0x189ca8['push'](_0x189ca8['shift']());}catch(_0x1ee36d){_0x189ca8['push'](_0x189ca8['shift']());}}}(a80_0xfbc4,0xc57ba));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{getTemplateBaseUrl}from'./config.js';function a80_0xfbc4(){const _0xa6a4bc=['trimEnd','1233174gqjqPO','push','171pAJcwe','utf-8','\x0a<!--\x20GUIDES_APPEND\x20-->','env','length','110395hETeLo','CDN\x20请求失败:\x20','entries','CDN\x20数据中缺少\x20skillTemplate','|\x20`','lastUpdated','757970zCWhfp','skillTemplate','join','1731716srBAYj','application/json','21wCJEQV','1409127aFFlyh','path','1332824DumsfV','\x0a\x0a>更新时间:','extendContent','4047030Gjrdnr','map','object','2nnaJIE','includes','.lovrabet','requireFlags','json','/skills/guides.json','test','<!--\x20GUIDES_APPEND\x20-->','some','.lovrabet/skill/.shared/guides','replace','guides','keys','status','statusText','guide.md','title','`\x20|\x20','USERPROFILE','HOME'];a80_0xfbc4=function(){return _0xa6a4bc;};return a80_0xfbc4();}function getGuidesCdnUrl(){const _0x3ddcca=a80_0x5d4f,_0x539806=getTemplateBaseUrl();return _0x539806+_0x3ddcca(0xf9);}function getGuidesExtendCdnUrl(){const _0x42bfa8=getTemplateBaseUrl();return _0x42bfa8+'/skills/guides-extend.json';}const CACHE_DIR=join(process[a80_0x4f4b6b(0x10e)][a80_0x4f4b6b(0x107)]||process['env'][a80_0x4f4b6b(0x106)]||'',a80_0x4f4b6b(0x126),'cache');export async function fetchGuidesFromCDN(_0x5be83c=![]){const _0x304134=a80_0x4f4b6b,_0x301d9f=getGuidesCdnUrl(),_0x44087c=await fetch(_0x301d9f,{'headers':{'Accept':_0x304134(0x11a)}});if(!_0x44087c['ok'])throw new Error(_0x304134(0x111)+_0x44087c[_0x304134(0x101)]+'\x20'+_0x44087c[_0x304134(0x102)]);const _0x57fcd5=await _0x44087c[_0x304134(0xf8)]();if(!_0x57fcd5[_0x304134(0xff)]||typeof _0x57fcd5[_0x304134(0xff)]!==_0x304134(0x123))throw new Error('CDN\x20返回数据格式错误');if(!_0x5be83c)return _0x57fcd5;try{const _0x51c915=getGuidesExtendCdnUrl(),_0x476c6d=await fetch(_0x51c915,{'headers':{'Accept':_0x304134(0x11a)}});if(_0x476c6d['ok']){const _0x52681b=await _0x476c6d['json']();_0x52681b[_0x304134(0xff)]&&typeof _0x52681b['guides']===_0x304134(0x123)&&(_0x57fcd5[_0x304134(0xff)]={..._0x57fcd5[_0x304134(0xff)],..._0x52681b[_0x304134(0xff)]});}}catch{}return _0x57fcd5;}export function writeGuidesToProject(_0x25d880,_0x5d44ac,_0x3f2559=a80_0x4f4b6b(0xfd),_0x175ef1){const _0x225749=a80_0x4f4b6b,_0x2418ec=join(_0x5d44ac,_0x3f2559);for(const [_0x125ad8,_0x2e8e87]of Object[_0x225749(0x112)](_0x25d880[_0x225749(0xff)])){if(_0x2e8e87[_0x225749(0xf7)]&&_0x2e8e87[_0x225749(0xf7)][_0x225749(0x10f)]>0x0){const _0x47f3af=_0x2e8e87[_0x225749(0xf7)][_0x225749(0xfc)](_0x2ecd1a=>_0x175ef1?.[_0x225749(0x125)](_0x2ecd1a));if(!_0x47f3af)continue;}const _0xd18a54=join(_0x2418ec,_0x125ad8);mkdirSync(_0xd18a54,{'recursive':!![]});let _0x3b6633=_0x2e8e87['content'];_0x2e8e87[_0x225749(0x115)]&&(_0x3b6633=appendUpdateTime(_0x3b6633,_0x2e8e87['lastUpdated'])),writeFileSync(join(_0xd18a54,_0x225749(0x103)),_0x3b6633,_0x225749(0x10c));}}export function appendUpdateTime(_0xa12182,_0xba4429){const _0x568932=a80_0x4f4b6b;return _0xa12182=_0xa12182[_0x568932(0xfe)](/\n*>更新时间:.*$/m,''),_0xa12182[_0x568932(0x108)]()+(_0x568932(0x11f)+_0xba4429);}export function getSkillTemplate(_0x212d04){const _0x4b1a2c=a80_0x4f4b6b;return _0x212d04[_0x4b1a2c(0x117)]?.['content']||'';}export function appendExtendContents(_0x13173c,_0x1c58e2,_0x408c83){const _0x4cdf38=a80_0x4f4b6b,_0xf094a2=[];for(const [_0x376d1d,_0x55ef94]of Object[_0x4cdf38(0x112)](_0x1c58e2['guides'])){if(_0x55ef94[_0x4cdf38(0xf7)]&&_0x55ef94[_0x4cdf38(0xf7)][_0x4cdf38(0x10f)]>0x0){const _0x9723de=_0x55ef94[_0x4cdf38(0xf7)][_0x4cdf38(0xfc)](_0x112272=>_0x408c83?.['includes'](_0x112272));if(!_0x9723de)continue;}_0x55ef94[_0x4cdf38(0x120)]&&_0xf094a2[_0x4cdf38(0x10a)](_0x55ef94[_0x4cdf38(0x120)][_0x4cdf38(0x108)]());}if(_0xf094a2[_0x4cdf38(0x10f)]===0x0)return _0x13173c;return _0x13173c[_0x4cdf38(0x108)]()+'\x0a\x0a'+_0xf094a2[_0x4cdf38(0x118)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x2e76c8,_0x3c502a,_0x1d729d,_0x58120c){const _0x46d2c3=a80_0x4f4b6b,_0x302fb3=getSkillTemplate(_0x2e76c8);if(!_0x302fb3)throw new Error(_0x46d2c3(0x113));const _0x173701=dirname(_0x3c502a);mkdirSync(_0x173701,{'recursive':!![]});let _0x35706e=_0x302fb3[_0x46d2c3(0xfe)](/\{\{IDE_NAME\}\}/g,_0x1d729d);_0x35706e=insertGuidesSection(_0x35706e,_0x2e76c8,_0x58120c),_0x35706e=appendExtendContents(_0x35706e,_0x2e76c8,_0x58120c),_0x2e76c8[_0x46d2c3(0x117)][_0x46d2c3(0x115)]&&(_0x35706e=appendUpdateTime(_0x35706e,_0x2e76c8[_0x46d2c3(0x117)][_0x46d2c3(0x115)])),writeFileSync(_0x3c502a,_0x35706e,_0x46d2c3(0x10c));}function a80_0x5d4f(_0x29f898,_0x20d3a3){_0x29f898=_0x29f898-0xf7;const _0xfbc46e=a80_0xfbc4();let _0x5d4f6f=_0xfbc46e[_0x29f898];return _0x5d4f6f;}export function insertGuidesSection(_0x4e68fd,_0x22bb4e,_0x15d101){const _0x3c6bd6=a80_0x4f4b6b,_0x29d1f4='<!--\x20GUIDES_APPEND\x20-->',_0x4622fc=_0x4e68fd['indexOf'](_0x29d1f4);if(_0x4622fc===-0x1)return _0x4e68fd;const _0x1944e6=[],_0x51301f=Object[_0x3c6bd6(0x100)](_0x22bb4e[_0x3c6bd6(0xff)])['sort']();for(const _0x1b969d of _0x51301f){const _0x17045c=_0x22bb4e[_0x3c6bd6(0xff)][_0x1b969d];if(!_0x17045c)continue;if(/^0[1-6]-/[_0x3c6bd6(0xfa)](_0x1b969d))continue;if(_0x17045c[_0x3c6bd6(0xf7)]&&_0x17045c[_0x3c6bd6(0xf7)][_0x3c6bd6(0x10f)]>0x0){const _0x152c54=_0x17045c[_0x3c6bd6(0xf7)]['some'](_0x28eb16=>_0x15d101?.['includes'](_0x28eb16));if(!_0x152c54)continue;}const _0x58f903=_0x17045c[_0x3c6bd6(0x11d)][_0x3c6bd6(0xfe)](/^\.lovrabet\/skill\/\.shared\/guides\//,'');_0x1944e6[_0x3c6bd6(0x10a)](_0x3c6bd6(0x114)+_0x58f903+_0x3c6bd6(0x105)+_0x17045c[_0x3c6bd6(0x104)]+'\x20|');}if(_0x1944e6[_0x3c6bd6(0x10f)]===0x0)return _0x4e68fd[_0x3c6bd6(0xfe)](_0x29d1f4,_0x3c6bd6(0xfb));const _0x5150a7=_0x1944e6[_0x3c6bd6(0x118)]('\x0a');return _0x4e68fd[_0x3c6bd6(0xfe)](_0x29d1f4,_0x5150a7+_0x3c6bd6(0x10d));}export async function installGuides(_0x170018){const _0x313434=a80_0x4f4b6b,_0x559129=await fetchGuidesFromCDN();return writeGuidesToProject(_0x559129,_0x170018),Object[_0x313434(0x100)](_0x559129[_0x313434(0xff)])[_0x313434(0x10f)];}export function getGuidesSummary(_0x5de4e4){const _0x340847=a80_0x4f4b6b;return Object[_0x340847(0x112)](_0x5de4e4[_0x340847(0xff)])[_0x340847(0x122)](([_0x4e8b8b,_0x534c72])=>({'key':_0x4e8b8b,'title':_0x534c72[_0x340847(0x104)],'path':_0x534c72[_0x340847(0x11d)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x481a0b,_0xe02777){const _0x1e1527=a81_0x45ac,_0x5b8b34=_0x481a0b();while(!![]){try{const _0x2bfc08=-parseInt(_0x1e1527(0x17a))/0x1*(-parseInt(_0x1e1527(0x192))/0x2)+-parseInt(_0x1e1527(0x191))/0x3+-parseInt(_0x1e1527(0x185))/0x4*(parseInt(_0x1e1527(0x180))/0x5)+parseInt(_0x1e1527(0x197))/0x6+parseInt(_0x1e1527(0x182))/0x7*(parseInt(_0x1e1527(0x184))/0x8)+parseInt(_0x1e1527(0x17c))/0x9*(parseInt(_0x1e1527(0x18c))/0xa)+parseInt(_0x1e1527(0x186))/0xb;if(_0x2bfc08===_0xe02777)break;else _0x5b8b34['push'](_0x5b8b34['shift']());}catch(_0x5a4fcc){_0x5b8b34['push'](_0x5b8b34['shift']());}}}(a81_0x32a9,0x6a46c));export async function httpRequest(_0x35293d,_0x530290={}){const _0x4c1150=a81_0x45ac,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x530290;let _0xbf7d11=null;for(let _0x24e72e=0x0;_0x24e72e<=retries;_0x24e72e++){try{const _0x13b904=new AbortController(),_0x1b3e14=setTimeout(()=>_0x13b904['abort'](),timeout),_0x469920=await fetch(_0x35293d,{'headers':headers,'signal':_0x13b904['signal']});clearTimeout(_0x1b3e14);let _0x1ace56;const _0x54c015=_0x469920[_0x4c1150(0x194)][_0x4c1150(0x18e)](_0x4c1150(0x188));return _0x54c015?.['includes']('application/json')?_0x1ace56=await _0x469920['json']():_0x1ace56=await _0x469920[_0x4c1150(0x18d)](),{'ok':_0x469920['ok'],'status':_0x469920[_0x4c1150(0x17e)],'statusText':_0x469920[_0x4c1150(0x17f)],'data':_0x1ace56,'headers':_0x469920[_0x4c1150(0x194)],'url':_0x469920[_0x4c1150(0x189)],'text':()=>_0x469920['text']()};}catch(_0x10f577){_0xbf7d11=_0x10f577 instanceof Error?_0x10f577:new Error(String(_0x10f577));if(_0x24e72e===retries)break;if(shouldRetry(_0x10f577)){console[_0x4c1150(0x18b)](_0x4c1150(0x18f)+retryDelay+_0x4c1150(0x179)+(_0x24e72e+0x1)+_0x4c1150(0x17b)),await sleep(retryDelay);continue;}else break;}}throw _0xbf7d11||new Error(_0x4c1150(0x190));}function shouldRetry(_0x22374f){const _0x4e540c=a81_0x45ac;if(_0x22374f instanceof Error){if(_0x22374f['name']===_0x4e540c(0x187))return![];if(_0x22374f[_0x4e540c(0x181)]===_0x4e540c(0x183)&&_0x22374f[_0x4e540c(0x18a)][_0x4e540c(0x193)](_0x4e540c(0x195)))return!![];if(_0x22374f[_0x4e540c(0x18a)][_0x4e540c(0x193)](_0x4e540c(0x196)))return!![];if(_0x22374f[_0x4e540c(0x18a)][_0x4e540c(0x193)](_0x4e540c(0x17d)))return![];}return![];}function a81_0x32a9(){const _0x321aee=['40623goIXcq','\x20次重试...','54QhHmpF','ENOTFOUND','status','statusText','40lqbMxM','name','30842LlzOsD','TypeError','424gQDZDC','20324uCeNsj','3299296flvqiD','AbortError','content-type','url','message','log','235110fNobMk','text','get','*\x20请求失败,','Request\x20failed','2191455mHPJod','10LTZbBz','includes','headers','fetch','ECONNRESET','1972836yZXWyY','ms\x20后进行第\x20'];a81_0x32a9=function(){return _0x321aee;};return a81_0x32a9();}function a81_0x45ac(_0x282f2d,_0x342818){_0x282f2d=_0x282f2d-0x179;const _0x32a94c=a81_0x32a9();let _0x45ac69=_0x32a94c[_0x282f2d];return _0x45ac69;}function sleep(_0x50d9fb){return new Promise(_0x5d7aac=>setTimeout(_0x5d7aac,_0x50d9fb));}export function validateUrl(_0x48ce14){try{return new URL(_0x48ce14),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a82_0x526f42=a82_0x11c5;(function(_0x52619f,_0x2451b6){const _0x5b87ba=a82_0x11c5,_0x333935=_0x52619f();while(!![]){try{const _0x1125f8=parseInt(_0x5b87ba(0xbb))/0x1*(-parseInt(_0x5b87ba(0xe2))/0x2)+-parseInt(_0x5b87ba(0xcd))/0x3*(parseInt(_0x5b87ba(0xe7))/0x4)+-parseInt(_0x5b87ba(0xb0))/0x5*(-parseInt(_0x5b87ba(0xc5))/0x6)+parseInt(_0x5b87ba(0xc6))/0x7*(parseInt(_0x5b87ba(0xdf))/0x8)+parseInt(_0x5b87ba(0xd6))/0x9*(-parseInt(_0x5b87ba(0xcf))/0xa)+parseInt(_0x5b87ba(0xd3))/0xb+-parseInt(_0x5b87ba(0xe8))/0xc*(parseInt(_0x5b87ba(0xeb))/0xd);if(_0x1125f8===_0x2451b6)break;else _0x333935['push'](_0x333935['shift']());}catch(_0x15f326){_0x333935['push'](_0x333935['shift']());}}}(a82_0xc3dc,0x91dbd));function a82_0x11c5(_0x1c567d,_0x7091d3){_0x1c567d=_0x1c567d-0xaf;const _0xc3dcf7=a82_0xc3dc();let _0x11c5d8=_0xc3dcf7[_0x1c567d];return _0x11c5d8;}function a82_0xc3dc(){const _0x3e8636=['1491108MjMnDH','split','map','13vfoZhh','now','3070575DOzXMI','setRawCommand','logFilePath','filter','existsSync','join','dirname','getWinstonInstance','winstonLogger','currentRawCommand','blue','15934mIyekk','rawCommand','writeFileSync','warn','Failed\x20to\x20clear\x20logs:','mkdirSync','errors','duration','parse','timestamp','6Manxpi','2555917dLakTa','.lovrabet.log','readFileSync','stringify','details','command','format','79107htiwzS','Failed\x20to\x20read\x20logs:','4290gcTUQu','readLogs','setLogPath','message','4391552PNTXtn','完成:\x20','success','9459iwWqqM','error','initWinstonLogger','unknown','yellow','level','开始执行:\x20','toISOString','clearLogs','24ciZmOU','logTask','clear','48RQzEyz','transports','info','trim','失败:\x20','84lqrFoP'];a82_0xc3dc=function(){return _0x3e8636;};return a82_0xc3dc();}import a82_0x51bdaf from'winston';import a82_0xd3f0f3 from'node:fs';import a82_0x1923a4 from'node:path';class Logger{['winstonLogger'];[a82_0x526f42(0xb2)];[a82_0x526f42(0xb9)]='';constructor(){const _0x1afada=a82_0x526f42;this[_0x1afada(0xb2)]='';}[a82_0x526f42(0xb1)](_0x491b4c){const _0x456de3=a82_0x526f42;this[_0x456de3(0xb9)]=_0x491b4c;}[a82_0x526f42(0xd8)](){const _0xe8e725=a82_0x526f42,_0x27fcd3=a82_0x1923a4[_0xe8e725(0xb6)](this[_0xe8e725(0xb2)]);!a82_0xd3f0f3[_0xe8e725(0xb4)](_0x27fcd3)&&a82_0xd3f0f3[_0xe8e725(0xc0)](_0x27fcd3,{'recursive':!![]});const _0x273eb9=a82_0x51bdaf['format']['combine'](a82_0x51bdaf[_0xe8e725(0xcc)]['timestamp'](),a82_0x51bdaf[_0xe8e725(0xcc)][_0xe8e725(0xc1)]({'stack':!![]}),a82_0x51bdaf['format']['printf'](_0x4da083=>{const _0x16171e=_0xe8e725,_0x56be69={'timestamp':_0x4da083[_0x16171e(0xc4)]||new Date()[_0x16171e(0xdd)](),'level':_0x4da083[_0x16171e(0xdb)]||_0x16171e(0xe4),'command':_0x4da083[_0x16171e(0xcb)]||_0x16171e(0xd9),'rawCommand':_0x4da083[_0x16171e(0xbc)]||this[_0x16171e(0xb9)]||undefined,'message':_0x4da083[_0x16171e(0xd2)]||'','duration':_0x4da083[_0x16171e(0xc2)]||undefined,'details':_0x4da083[_0x16171e(0xca)]||undefined};return JSON[_0x16171e(0xc9)](_0x56be69);}));this[_0xe8e725(0xb8)]=a82_0x51bdaf['createLogger']({'level':'info','format':_0x273eb9,'transports':[new a82_0x51bdaf[(_0xe8e725(0xe3))]['File']({'filename':this['logFilePath'],'level':_0xe8e725(0xe4)})],'silent':![]}),a82_0x51bdaf['addColors']({'success':'green','error':'red','warn':_0xe8e725(0xda),'info':_0xe8e725(0xba)});}[a82_0x526f42(0xd1)](_0xa0bb96){const _0x1d06e2=a82_0x526f42;this[_0x1d06e2(0xb2)]=a82_0x1923a4[_0x1d06e2(0xb5)](_0xa0bb96,_0x1d06e2(0xc7)),this[_0x1d06e2(0xb8)]&&this[_0x1d06e2(0xb8)][_0x1d06e2(0xe1)](),this[_0x1d06e2(0xd8)]();}['info'](_0x1477fa,_0x1a944a,_0x496be4){const _0x32cca0=a82_0x526f42;if(!this[_0x32cca0(0xb2)]||!this[_0x32cca0(0xb8)])return;this['winstonLogger'][_0x32cca0(0xe4)](_0x1a944a,{'command':_0x1477fa,'details':_0x496be4});}['success'](_0x4a787d,_0x1d8960,_0x4c750b,_0x369147){const _0x4f603e=a82_0x526f42;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x4f603e(0xb8)]['log'](_0x4f603e(0xe4),_0x1d8960,{'level':_0x4f603e(0xd5),'command':_0x4a787d,'duration':_0x4c750b,'details':_0x369147});}['error'](_0x3b44c4,_0x514406,_0x1aa2fa){const _0x563168=a82_0x526f42;if(!this['logFilePath']||!this[_0x563168(0xb8)])return;this[_0x563168(0xb8)][_0x563168(0xd7)](_0x514406,{'command':_0x3b44c4,'details':_0x1aa2fa});}[a82_0x526f42(0xbe)](_0xb61651,_0x1da249,_0x44e38f){const _0x4f83f7=a82_0x526f42;if(!this[_0x4f83f7(0xb2)]||!this[_0x4f83f7(0xb8)])return;this['winstonLogger'][_0x4f83f7(0xbe)](_0x1da249,{'command':_0xb61651,'details':_0x44e38f});}async[a82_0x526f42(0xe0)](_0x35df5e,_0x457d14,_0x2aad8d){const _0x370269=a82_0x526f42,_0x2f4713=Date[_0x370269(0xaf)]();this[_0x370269(0xe4)](_0x35df5e,_0x370269(0xdc)+_0x457d14);try{const _0xacb295=await _0x2aad8d(),_0x5c7f27=Date[_0x370269(0xaf)]()-_0x2f4713;return this[_0x370269(0xd5)](_0x35df5e,_0x370269(0xd4)+_0x457d14,_0x5c7f27),_0xacb295;}catch(_0x1da726){const _0x41f330=Date[_0x370269(0xaf)]()-_0x2f4713;this['error'](_0x35df5e,_0x370269(0xe6)+_0x457d14,{'error':_0x1da726 instanceof Error?_0x1da726[_0x370269(0xd2)]:String(_0x1da726),'duration':_0x41f330});throw _0x1da726;}}[a82_0x526f42(0xd0)](){const _0x1a671b=a82_0x526f42;try{if(!a82_0xd3f0f3['existsSync'](this['logFilePath']))return[];const _0x464608=a82_0xd3f0f3[_0x1a671b(0xc8)](this['logFilePath'],'utf8');return _0x464608[_0x1a671b(0xe9)]('\x0a')[_0x1a671b(0xb3)](_0x1c7cdf=>_0x1c7cdf[_0x1a671b(0xe5)]())[_0x1a671b(0xea)](_0x1f510a=>JSON[_0x1a671b(0xc3)](_0x1f510a));}catch(_0x8f7584){return console[_0x1a671b(0xbe)](_0x1a671b(0xce),_0x8f7584),[];}}[a82_0x526f42(0xde)](){const _0x2bf3ca=a82_0x526f42;try{a82_0xd3f0f3[_0x2bf3ca(0xb4)](this[_0x2bf3ca(0xb2)])&&a82_0xd3f0f3[_0x2bf3ca(0xbd)](this[_0x2bf3ca(0xb2)],'','utf8');}catch(_0x16d3da){console['warn'](_0x2bf3ca(0xbf),_0x16d3da);}}[a82_0x526f42(0xb7)](){const _0x445cc4=a82_0x526f42;return this[_0x445cc4(0xb8)];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a83_0x56eb(_0x212c13,_0x1e816d){_0x212c13=_0x212c13-0x1ec;const _0x2f0ba4=a83_0x2f0b();let _0x56eb4f=_0x2f0ba4[_0x212c13];return _0x56eb4f;}function a83_0x2f0b(){const _0x3bf121=['addPageRoute','path:\x20\x22','4514496UKUkXI','success','split','indexOf','map','index','lastIndexOf','\x20from\x20\x22../pages/','3qFvGiG','writeFile','4951062vRbtlp','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','match','路由文件不存在:\x20','25022630VyWjLP','router','includes','路由配置更新完成','charAt','error','info','previewChanges','toComponentName','src','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','771146BzfZEm','开始更新路由配置','3553890kExsBv','addRoute','length','routerFilePath','4mpKKqL','join','readFile','143507TyyXlL','now','existsSync','371889hxlOMj','import\x20','slice','路由配置更新失败','6GKXpbY','toLowerCase','toUpperCase','message','utf8','addImport'];a83_0x2f0b=function(){return _0x3bf121;};return a83_0x2f0b();}const a83_0x2680c8=a83_0x56eb;(function(_0x1d3f46,_0x5cc71c){const _0x4a862c=a83_0x56eb,_0x42348f=_0x1d3f46();while(!![]){try{const _0x4c235e=parseInt(_0x4a862c(0x1fd))/0x1+parseInt(_0x4a862c(0x1f4))/0x2*(-parseInt(_0x4a862c(0x214))/0x3)+parseInt(_0x4a862c(0x1fa))/0x4*(-parseInt(_0x4a862c(0x1f6))/0x5)+-parseInt(_0x4a862c(0x204))/0x6*(-parseInt(_0x4a862c(0x200))/0x7)+-parseInt(_0x4a862c(0x20c))/0x8+-parseInt(_0x4a862c(0x216))/0x9+parseInt(_0x4a862c(0x21a))/0xa;if(_0x4c235e===_0x5cc71c)break;else _0x42348f['push'](_0x42348f['shift']());}catch(_0x4957f7){_0x42348f['push'](_0x42348f['shift']());}}}(a83_0x2f0b,0x772b4));import a83_0x288469 from'node:fs';import a83_0x34e871 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a83_0x2680c8(0x1f9)];constructor(_0x347441){const _0x1a5b75=a83_0x2680c8;this[_0x1a5b75(0x1f9)]=a83_0x34e871[_0x1a5b75(0x1fb)](_0x347441,_0x1a5b75(0x1f2),_0x1a5b75(0x21b),'index.tsx');}async[a83_0x2680c8(0x20a)](_0x4bc333,_0x5aa689){const _0x28efb7=a83_0x2680c8;if(!a83_0x288469[_0x28efb7(0x1ff)](this[_0x28efb7(0x1f9)]))throw new Error('路由文件不存在:\x20'+this[_0x28efb7(0x1f9)]);const _0x332d04=Date[_0x28efb7(0x1fe)]();logger[_0x28efb7(0x1ef)](_0x28efb7(0x21b),_0x28efb7(0x1f5),{'pageName':_0x4bc333,'routePath':_0x5aa689,'file':this[_0x28efb7(0x1f9)]});try{const _0xe6f719=await a83_0x288469['promises'][_0x28efb7(0x1fc)](this[_0x28efb7(0x1f9)],_0x28efb7(0x208)),_0x334f3f=this[_0x28efb7(0x1f1)](_0x4bc333),_0x5b90b1=this[_0x28efb7(0x209)](_0xe6f719,_0x334f3f,_0x4bc333),_0x1a3be8=this[_0x28efb7(0x1f7)](_0x5b90b1,_0x5aa689,_0x334f3f);await a83_0x288469['promises'][_0x28efb7(0x215)](this[_0x28efb7(0x1f9)],_0x1a3be8,_0x28efb7(0x208));const _0x3becb7=Date[_0x28efb7(0x1fe)]()-_0x332d04;logger[_0x28efb7(0x20d)](_0x28efb7(0x21b),_0x28efb7(0x1ec),_0x3becb7,{'pageName':_0x4bc333,'routePath':_0x5aa689,'componentName':_0x334f3f});}catch(_0x572655){const _0x3aab99=Date[_0x28efb7(0x1fe)]()-_0x332d04;logger[_0x28efb7(0x1ee)](_0x28efb7(0x21b),_0x28efb7(0x203),{'pageName':_0x4bc333,'routePath':_0x5aa689,'error':_0x572655 instanceof Error?_0x572655[_0x28efb7(0x207)]:String(_0x572655),'duration':_0x3aab99});throw _0x572655;}}['toComponentName'](_0xb145de){const _0x33e1e6=a83_0x2680c8;return _0xb145de[_0x33e1e6(0x20e)]('-')[_0x33e1e6(0x210)](_0x3d3e42=>_0x3d3e42[_0x33e1e6(0x1ed)](0x0)[_0x33e1e6(0x206)]()+_0x3d3e42['slice'](0x1)[_0x33e1e6(0x205)]())[_0x33e1e6(0x1fb)]('');}[a83_0x2680c8(0x209)](_0x4cd345,_0x270b3d,_0x144499){const _0x2e2ebf=a83_0x2680c8,_0x3c6297=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x32179a=_0x4cd345[_0x2e2ebf(0x218)](_0x3c6297)||[],_0x2b8c96=_0x2e2ebf(0x201)+_0x270b3d+_0x2e2ebf(0x213)+_0x144499+'\x22;';if(_0x4cd345[_0x2e2ebf(0x21c)](_0x2b8c96))return _0x4cd345;if(_0x32179a[_0x2e2ebf(0x1f8)]>0x0){const _0x1e375d=_0x32179a[_0x32179a[_0x2e2ebf(0x1f8)]-0x1];if(_0x1e375d){const _0x5eabef=_0x4cd345['lastIndexOf'](_0x1e375d),_0x52b36c=_0x5eabef+_0x1e375d[_0x2e2ebf(0x1f8)];return _0x4cd345['slice'](0x0,_0x52b36c)+_0x2b8c96+'\x0a'+_0x4cd345[_0x2e2ebf(0x202)](_0x52b36c);}}const _0x3b8cf2=_0x4cd345[_0x2e2ebf(0x218)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x3b8cf2&&_0x3b8cf2['index']!==undefined){const _0x33c653=_0x3b8cf2['index']+_0x3b8cf2[0x0][_0x2e2ebf(0x1f8)];return _0x4cd345['slice'](0x0,_0x33c653)+_0x2b8c96+'\x0a'+_0x4cd345['slice'](_0x33c653);}return _0x4cd345;}['addRoute'](_0x4d48a3,_0x4ddea2,_0x18bd85){const _0x56240b=a83_0x2680c8,_0x471fe1=_0x56240b(0x1f3)+_0x4ddea2+_0x56240b(0x217)+_0x18bd85+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x4d48a3[_0x56240b(0x21c)](_0x56240b(0x20b)+_0x4ddea2+'\x22'))return _0x4d48a3;const _0x5d3449=/children:\s*\[([\s\S]*?)\]/,_0x870d86=_0x4d48a3[_0x56240b(0x218)](_0x5d3449);if(!_0x870d86||_0x870d86['index']===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x23b177=_0x870d86[0x1],_0x516bd0=_0x870d86[_0x56240b(0x211)]+_0x870d86[0x0][_0x56240b(0x20f)]('[')+0x1,_0x15dd83=_0x23b177?.[_0x56240b(0x218)](/\{[\s\S]*?\},/g)||[];if(_0x15dd83[_0x56240b(0x1f8)]>0x0){const _0x20d6e4=_0x15dd83[_0x15dd83[_0x56240b(0x1f8)]-0x1];if(_0x20d6e4){const _0x53fafa=_0x4d48a3[_0x56240b(0x212)](_0x20d6e4),_0x9e22fa=_0x53fafa+_0x20d6e4[_0x56240b(0x1f8)];return _0x4d48a3['slice'](0x0,_0x9e22fa)+'\x0a'+_0x471fe1+_0x4d48a3['slice'](_0x9e22fa);}}return _0x4d48a3[_0x56240b(0x202)](0x0,_0x516bd0)+'\x0a'+_0x471fe1+_0x4d48a3[_0x56240b(0x202)](_0x516bd0);}async[a83_0x2680c8(0x1f0)](_0x3e8167,_0x4f3314){const _0x20ccd6=a83_0x2680c8;if(!a83_0x288469[_0x20ccd6(0x1ff)](this[_0x20ccd6(0x1f9)]))throw new Error(_0x20ccd6(0x219)+this['routerFilePath']);const _0x342282=await a83_0x288469['promises'][_0x20ccd6(0x1fc)](this[_0x20ccd6(0x1f9)],_0x20ccd6(0x208)),_0x746d90=this[_0x20ccd6(0x1f1)](_0x3e8167);let _0x4da995=this[_0x20ccd6(0x209)](_0x342282,_0x746d90,_0x3e8167);return _0x4da995=this[_0x20ccd6(0x1f7)](_0x4da995,_0x4f3314,_0x746d90),_0x4da995;}}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a84_0x4765d5=a84_0x312e;(function(_0xba1f3e,_0xb4e45f){const _0x24b25c=a84_0x312e,_0x153b42=_0xba1f3e();while(!![]){try{const _0x4e3e17=parseInt(_0x24b25c(0x1f8))/0x1+-parseInt(_0x24b25c(0x1ef))/0x2*(-parseInt(_0x24b25c(0x1f7))/0x3)+-parseInt(_0x24b25c(0x1ea))/0x4+-parseInt(_0x24b25c(0x1f2))/0x5+parseInt(_0x24b25c(0x1e7))/0x6+parseInt(_0x24b25c(0x1f5))/0x7+-parseInt(_0x24b25c(0x1ee))/0x8;if(_0x4e3e17===_0xb4e45f)break;else _0x153b42['push'](_0x153b42['shift']());}catch(_0x42a2f8){_0x153b42['push'](_0x153b42['shift']());}}}(a84_0x34cb,0xceec5));function a84_0x34cb(){const _0x2a1fc8=['lastUpdated','.cursor/rules','../../cdn-source/rules/lovrabet_rules.mdc.tpl','utf-8','json','8570562SOcmla','catch','application/json','6640200MpTtUX','content','CDN\x20请求失败:\x20','/rules/rules.json','3271504UlPkIG','1920862sQbivx','lovrabet_rules.mdc','CDN\x20返回数据格式错误','4807385tiTPBc','本地模板文件不存在:\x20','statusText','7782467cKUQrV','string','3orgUAA','377383rQTIuw'];a84_0x34cb=function(){return _0x2a1fc8;};return a84_0x34cb();}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';function a84_0x312e(_0x2c8c9d,_0x492401){_0x2c8c9d=_0x2c8c9d-0x1e4;const _0x34cb98=a84_0x34cb();let _0x312e24=_0x34cb98[_0x2c8c9d];return _0x312e24;}import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x56861f=a84_0x312e,_0x4098a8=getTemplateBaseUrl();return _0x4098a8+_0x56861f(0x1ed);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a84_0x4765d5(0x1e4));export async function fetchRulesFromCDN(){const _0x1a9557=a84_0x4765d5,_0x3495c7=getRulesCdnUrl(),_0x55b2a1=await fetch(_0x3495c7,{'headers':{'Accept':_0x1a9557(0x1e9)}});if(!_0x55b2a1['ok'])throw new Error(_0x1a9557(0x1ec)+_0x55b2a1['status']+'\x20'+_0x55b2a1[_0x1a9557(0x1f4)]);const _0x48a43d=await _0x55b2a1[_0x1a9557(0x1e6)]();if(!_0x48a43d[_0x1a9557(0x1eb)]||typeof _0x48a43d[_0x1a9557(0x1eb)]!==_0x1a9557(0x1f6))throw new Error(_0x1a9557(0x1f1));return _0x48a43d;}export async function getRulesContent(){const _0x5d8703=a84_0x4765d5;try{const _0x7ab910=await fetchRulesFromCDN();return _0x7ab910[_0x5d8703(0x1eb)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x374f02=a84_0x4765d5;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x374f02(0x1e5));throw new Error(_0x374f02(0x1f3)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x51594f){const _0x47e525=a84_0x4765d5,_0x338643=await fetchRulesFromCDN()[_0x47e525(0x1e8)](()=>null);let _0x4148c6;_0x338643?(_0x4148c6=_0x338643['content'],_0x338643['lastUpdated']&&(_0x4148c6=appendUpdateTime(_0x4148c6,_0x338643[_0x47e525(0x1f9)]))):_0x4148c6=readLocalTemplate();const _0x535989=dirname(_0x51594f);!existsSync(_0x535989)&&mkdirSync(_0x535989,{'recursive':!![]}),writeFileSync(_0x51594f,_0x4148c6,_0x47e525(0x1e5));}export async function copyRulesToCursor(_0x22e3c1){const _0x322773=a84_0x4765d5,_0x3f65bb=join(_0x22e3c1,_0x322773(0x1fa)),_0x25846b=join(_0x3f65bb,_0x322773(0x1f0));if(existsSync(_0x25846b))return![];return await writeRulesFile(_0x25846b),!![];}export async function copyRulesToAgentsMd(_0x2acc20){const _0x2e53d4=join(_0x2acc20,'agents.md');if(existsSync(_0x2e53d4))return![];return await writeRulesFile(_0x2e53d4),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x234a73){return new Promise(_0x260e97=>setTimeout(_0x260e97,_0x234a73));}
|