@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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x1052e2=a10_0x528f;(function(_0x58cc01,_0x238dbf){const _0x2f50f4=a10_0x528f,_0x330b1c=_0x58cc01();while(!![]){try{const _0x412d98=-parseInt(_0x2f50f4(0xf9))/0x1+-parseInt(_0x2f50f4(0xf0))/0x2*(parseInt(_0x2f50f4(0xed))/0x3)+-parseInt(_0x2f50f4(0xf7))/0x4*(parseInt(_0x2f50f4(0xf5))/0x5)+parseInt(_0x2f50f4(0xf1))/0x6+-parseInt(_0x2f50f4(0xea))/0x7+parseInt(_0x2f50f4(0xee))/0x8*(parseInt(_0x2f50f4(0xeb))/0x9)+-parseInt(_0x2f50f4(0xf4))/0xa*(-parseInt(_0x2f50f4(0xfa))/0xb);if(_0x412d98===_0x238dbf)break;else _0x330b1c['push'](_0x330b1c['shift']());}catch(_0x4c7595){_0x330b1c['push'](_0x330b1c['shift']());}}}(a10_0x36a6,0x7e52a));import{readdirSync,statSync,readFileSync}from'fs';function a10_0x36a6(){const _0x28504e=['410EsKtNp','88210Sorfyg','src/pages','32zdtHwx','slice','417039KtGzin','130889MlEzHI','replace','concat','match','trim','cwd','.tsx','replaceAll','index.tsx','2516262ugNLkX','117BhkROk','utf-8','789303qmJvhw','157368YnVKtE','forEach','2fbxkcA','5727468NbXngv','push','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'];a10_0x36a6=function(){return _0x28504e;};return a10_0x36a6();}import{join,relative,resolve}from'path';const pagesDir=resolve(process[a10_0x1052e2(0xe6)](),a10_0x1052e2(0xf6));export function extractTitleFromComment(_0x4120d8){const _0x4fec08=a10_0x1052e2;try{const _0x1015b7=readFileSync(_0x4120d8,_0x4fec08(0xec)),_0x3bb09c=_0x1015b7[_0x4fec08(0xe4)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x3bb09c&&_0x3bb09c[0x1]){const _0x186764=_0x3bb09c[0x1],_0x2f4bc0=_0x186764['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x2f4bc0&&_0x2f4bc0[0x1])return _0x2f4bc0[0x1][_0x4fec08(0xe5)]();}let _0xd90579=null;const _0x4c1f36=_0x1015b7[_0x4fec08(0xe4)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x4c1f36&&_0x4c1f36[0x1]&&(_0xd90579=_0x4c1f36[0x1]);if(!_0xd90579){const _0xcd0a01=_0x1015b7['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0xcd0a01&&_0xcd0a01[0x1]&&(_0xd90579=_0xcd0a01[0x1]);}if(_0xd90579){const _0x22d4d0=new RegExp('\x5cb'+_0xd90579+_0x4fec08(0xf3)),_0x231524=_0x1015b7[_0x4fec08(0xe4)](_0x22d4d0);if(_0x231524&&_0x231524[0x1])return _0x231524[0x1];return _0xd90579;}return null;}catch(_0x207ad9){return null;}}function a10_0x528f(_0x490b5b,_0x1f2e43){_0x490b5b=_0x490b5b-0xe2;const _0x36a68f=a10_0x36a6();let _0x528f65=_0x36a68f[_0x490b5b];return _0x528f65;}export function getLocalPages(_0x270453=pagesDir,_0x42fd12=pagesDir){const _0x584906=a10_0x1052e2;let _0x5b7a6b=[];const _0x7b774c=readdirSync(_0x270453);return _0x7b774c[_0x584906(0xef)](_0x181292=>{const _0x37c5b2=_0x584906,_0x2462dd=join(_0x270453,_0x181292),_0x3065a4=statSync(_0x2462dd);if(_0x3065a4&&_0x3065a4['isDirectory']())_0x5b7a6b=_0x5b7a6b[_0x37c5b2(0xe3)](getLocalPages(_0x2462dd,_0x42fd12));else{if(_0x181292['endsWith'](_0x37c5b2(0xe7))){let _0x45f7e7=relative(_0x42fd12,_0x2462dd);_0x45f7e7['endsWith'](_0x37c5b2(0xe9))?_0x45f7e7=_0x45f7e7[_0x37c5b2(0xe2)](/index\.tsx$/,''):_0x45f7e7=_0x45f7e7[_0x37c5b2(0xe2)](/\.tsx$/,'');_0x45f7e7['endsWith']('/')&&(_0x45f7e7=_0x45f7e7[_0x37c5b2(0xf8)](0x0,-0x1));const _0x2f5cec=extractTitleFromComment(_0x2462dd),_0x2c2701=_0x2f5cec||_0x45f7e7;_0x5b7a6b[_0x37c5b2(0xf2)]({'path':_0x45f7e7[_0x37c5b2(0xe8)]('$',':'),'label':_0x2c2701});}}}),_0x5b7a6b['filter'](_0x37d215=>_0x37d215['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a11_0x45f136=a11_0x1c68;(function(_0x152054,_0x50e94d){const _0x1ac3df=a11_0x1c68,_0xca0138=_0x152054();while(!![]){try{const _0x301510=parseInt(_0x1ac3df(0x123))/0x1+-parseInt(_0x1ac3df(0x12a))/0x2+-parseInt(_0x1ac3df(0x117))/0x3+-parseInt(_0x1ac3df(0x121))/0x4*(parseInt(_0x1ac3df(0x128))/0x5)+-parseInt(_0x1ac3df(0x130))/0x6+-parseInt(_0x1ac3df(0x126))/0x7+parseInt(_0x1ac3df(0x12c))/0x8;if(_0x301510===_0x50e94d)break;else _0xca0138['push'](_0xca0138['shift']());}catch(_0x1ea60f){_0xca0138['push'](_0xca0138['shift']());}}}(a11_0x23c1,0xd149f));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a11_0x1c68(_0x598cfd,_0x218bce){_0x598cfd=_0x598cfd-0x108;const _0x23c1d9=a11_0x23c1();let _0x1c68a1=_0x23c1d9[_0x598cfd];return _0x1c68a1;}import{getEnv}from'../constant/env.js';import a11_0x57ba94 from'../i18n/index.js';function a11_0x23c1(){const _0x1356be=['get-online-menu-list','13916DMjcss','appMenu.fetching.online','488455AVZeNM','flat','children','1209915ZsUrKl','info','1435XfXoAr','appMenu.fetching.daily','3020036cRjuBL','error','39840728YsWwFG','GET','appMenu.info.emptyMenuList','appMenu.error.appCodeHint.title','8383524xfxRBf','label','length','push','resources','/smartapi/menu/find?appCode=','errorMsg','bind','appMenu.success.fetched','appMenu.error.missingAppCode','json','data','errorCode','path','extend','isArray','appMenu.error.appCodeHint.option1','appcode','1598127EczGDP','common.error','appMenu.error.httpStatus','status','appMenu.error.authExpired','success','parse','application/json','appMenu.error.fetchFailed'];a11_0x23c1=function(){return _0x1356be;};return a11_0x23c1();}const config=readConfig(),t=a11_0x57ba94['t'][a11_0x45f136(0x10c)](a11_0x57ba94);export async function getOnlineMenuList(){const _0xd43764=a11_0x45f136,_0x1564b1=config?.[_0xd43764(0x116)];if(!_0x1564b1){const _0x2bf333=t(_0xd43764(0x10e));return logger['error']('get-online-menu-list',_0x2bf333),console[_0xd43764(0x12b)]('×\x20'+_0x2bf333),console['log'](t(_0xd43764(0x12f))),console['log'](t(_0xd43764(0x115))),console['log'](t('appMenu.error.appCodeHint.option2')),[];}const _0x5beb2b=getEnv();logger['info'](_0xd43764(0x120),_0x5beb2b==='online'?t(_0xd43764(0x122),{'appCode':_0x1564b1}):t(_0xd43764(0x129),{'appCode':_0x1564b1}));const _0x336711=await fetch(getApiDomain()+_0xd43764(0x10a)+_0x1564b1,{'method':_0xd43764(0x12d),'headers':{'Content-Type':_0xd43764(0x11e),'Cookie':getCookie()}});if(!_0x336711['ok']){if(_0x336711['status']===0x191){const _0x562e79=t(_0xd43764(0x11b));logger[_0xd43764(0x12b)](_0xd43764(0x120),_0x562e79,{'status':_0x336711['status']});throw new Error(_0x562e79);}const _0xa139be=t(_0xd43764(0x119),{'status':_0x336711[_0xd43764(0x11a)]});logger['error'](_0xd43764(0x120),_0xa139be);throw new Error(_0xa139be);}const _0x2df213=await _0x336711[_0xd43764(0x10f)]();if(!_0x2df213[_0xd43764(0x11c)]){const _0x166f2f=t(_0xd43764(0x11f),{'error':_0x2df213[_0xd43764(0x10b)]||t(_0xd43764(0x118))});logger[_0xd43764(0x12b)](_0xd43764(0x120),_0x166f2f,{'errorCode':_0x2df213[_0xd43764(0x111)],'errorMsg':_0x2df213[_0xd43764(0x10b)]});throw new Error(_0x166f2f);}if(!_0x2df213[_0xd43764(0x110)])return logger[_0xd43764(0x127)](_0xd43764(0x120),t(_0xd43764(0x12e))),[];return logger['info'](_0xd43764(0x120),t(_0xd43764(0x10d),{'count':_0x2df213[_0xd43764(0x110)]['length']})),_0x2df213[_0xd43764(0x110)]['map'](formatMenuList)[_0xd43764(0x124)]();}function formatMenuList(_0x50bee0){const _0x35b809=a11_0x45f136;let _0x411a9b=[];try{if(_0x50bee0[_0x35b809(0x113)]?.['resources']){const _0xffc13b=JSON[_0x35b809(0x11d)](_0x50bee0['extend'][_0x35b809(0x109)]);Array[_0x35b809(0x114)](_0xffc13b)&&(_0x411a9b=_0xffc13b);}}catch(_0x2d0bab){}const _0x4af003=[{'id':_0x50bee0['id'],'path':_0x50bee0[_0x35b809(0x112)],'label':_0x50bee0[_0x35b809(0x131)],'resources':_0x411a9b}];if(_0x50bee0[_0x35b809(0x125)]&&_0x50bee0['children'][_0x35b809(0x132)]>0x0)for(const _0x553d95 of _0x50bee0[_0x35b809(0x125)]){_0x4af003[_0x35b809(0x108)](...formatMenuList(_0x553d95));}return _0x4af003;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a13_0x5e47cb=a13_0x17e7;function a13_0x36b7(){var _0x952212=['96vfkmrD','random','10980TSdaKh','1832721WehAYZ','1255IuNEYr','3446120EqLgzY','https://g.lovrabet.com/dist/cowork-qzyt-web/1.1.0/assets/main.css','43624526NPwCrq','Prompt管理列表页','4ysqnAx','381977maDVlA','9OqfVRs','https://g.lovrabet.com/dist/cowork-qzyt-web/1.1.0/assets/main.js','262857rMcnGV','substring','3857112wKgHET'];a13_0x36b7=function(){return _0x952212;};return a13_0x36b7();}function a13_0x17e7(_0x1a53e,_0x172052){_0x1a53e=_0x1a53e-0x71;var _0x36b773=a13_0x36b7();var _0x17e743=_0x36b773[_0x1a53e];return _0x17e743;}(function(_0x3791d5,_0x5b69cd){var _0x1c2087=a13_0x17e7,_0x16b11a=_0x3791d5();while(!![]){try{var _0x45e66b=parseInt(_0x1c2087(0x74))/0x1*(-parseInt(_0x1c2087(0x73))/0x2)+-parseInt(_0x1c2087(0x7d))/0x3+-parseInt(_0x1c2087(0x7c))/0x4*(parseInt(_0x1c2087(0x7e))/0x5)+-parseInt(_0x1c2087(0x79))/0x6+-parseInt(_0x1c2087(0x77))/0x7*(parseInt(_0x1c2087(0x7a))/0x8)+parseInt(_0x1c2087(0x75))/0x9*(-parseInt(_0x1c2087(0x7f))/0xa)+parseInt(_0x1c2087(0x71))/0xb;if(_0x45e66b===_0x5b69cd)break;else _0x16b11a['push'](_0x16b11a['shift']());}catch(_0x491527){_0x16b11a['push'](_0x16b11a['shift']());}}}(a13_0x36b7,0x7143e));import{updateMenu}from'../app-menu-update-cdn/update-menu.js';import.meta.main&&updateMenu({'id':0x11b8a,'label':a13_0x5e47cb(0x72)+Math[a13_0x5e47cb(0x7b)]()['toString'](0x24)[a13_0x5e47cb(0x78)](0x2,0xf),'resources':[a13_0x5e47cb(0x76),a13_0x5e47cb(0x80)]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a14_0x1a27(){const _0x11776f=['catch','then','56hLueOH','1767500YFhKwd','1369380WAUkGX','appMenu.error.fetchFailed','bind','message','555359nQoDDm','8TCTvcZ','14374665zRrabI','919092eqsknJ','2545596cdzwPl','100148ZhGZaS'];a14_0x1a27=function(){return _0x11776f;};return a14_0x1a27();}const a14_0x1904a8=a14_0x5454;(function(_0x456c13,_0x5e550d){const _0x15e5a2=a14_0x5454,_0x2ec856=_0x456c13();while(!![]){try{const _0x1e5499=-parseInt(_0x15e5a2(0x126))/0x1*(parseInt(_0x15e5a2(0x122))/0x2)+-parseInt(_0x15e5a2(0x12b))/0x3+-parseInt(_0x15e5a2(0x124))/0x4+-parseInt(_0x15e5a2(0x12a))/0x5+-parseInt(_0x15e5a2(0x125))/0x6+-parseInt(_0x15e5a2(0x121))/0x7*(-parseInt(_0x15e5a2(0x129))/0x8)+parseInt(_0x15e5a2(0x123))/0x9;if(_0x1e5499===_0x5e550d)break;else _0x2ec856['push'](_0x2ec856['shift']());}catch(_0x3399a6){_0x2ec856['push'](_0x2ec856['shift']());}}}(a14_0x1a27,0x464d1));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';import a14_0x28c8fd from'../i18n/index.js';function a14_0x5454(_0x5e5b6d,_0x3fbf90){_0x5e5b6d=_0x5e5b6d-0x120;const _0x1a270f=a14_0x1a27();let _0x54541a=_0x1a270f[_0x5e5b6d];return _0x54541a;}const t=a14_0x28c8fd['t'][a14_0x1904a8(0x12d)](a14_0x28c8fd);export function useGetOnlineMenuList(){const [_0x10d47f,_0x74c49b]=useState([]),[_0xf6d9a8,_0x3e232b]=useState(!![]),[_0x42873c,_0x3030de]=useState('');return useEffect(()=>{const _0xe1a5d9=a14_0x5454;_0x3e232b(!![]),_0x3030de(''),getOnlineMenuList()[_0xe1a5d9(0x128)](_0x74c49b)[_0xe1a5d9(0x127)](_0xbab81d=>{const _0x3a34a1=_0xe1a5d9;_0x3030de(_0xbab81d[_0x3a34a1(0x120)]||t(_0x3a34a1(0x12c),{'error':t('common.error')}));})['finally'](()=>_0x3e232b(![]));},[]),{'menuList':_0x10d47f,'loading':_0xf6d9a8,'error':_0x42873c};}
|
package/lib/app-menu/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44cb2b,_0x70fc2b){const _0x1954ad=a15_0x12f6,_0x531fe3=_0x44cb2b();while(!![]){try{const _0x4ae60b=-parseInt(_0x1954ad(0x110))/0x1+parseInt(_0x1954ad(0x115))/0x2+parseInt(_0x1954ad(0x10f))/0x3+-parseInt(_0x1954ad(0x116))/0x4+parseInt(_0x1954ad(0x113))/0x5*(parseInt(_0x1954ad(0x118))/0x6)+-parseInt(_0x1954ad(0x119))/0x7+parseInt(_0x1954ad(0x111))/0x8;if(_0x4ae60b===_0x70fc2b)break;else _0x531fe3['push'](_0x531fe3['shift']());}catch(_0x2d31a3){_0x531fe3['push'](_0x531fe3['shift']());}}}(a15_0x55f9,0xe54c8));export function getRemainingSpaces(_0x2b9b4d,_0x257974){const _0x351f51=a15_0x12f6,_0x2d4721=getStringWidth(_0x257974);return Array(Math[_0x351f51(0x117)](0x0,_0x2b9b4d-_0x2d4721))[_0x351f51(0x112)]('\x20')[_0x351f51(0x114)]('');}export function getMaxWidth(_0x36ed87,_0x586d27=0x2){const _0x20f8a6=a15_0x12f6;let _0x437061='',_0x233383=0x0;for(const _0x38bdaf of _0x36ed87){const _0x258284=getStringWidth(_0x38bdaf);_0x258284>_0x233383&&(_0x233383=_0x258284,_0x437061=_0x38bdaf);}return _0x437061+'\x20'[_0x20f8a6(0x11a)](_0x586d27);}function a15_0x12f6(_0x549e96,_0x57081e){_0x549e96=_0x549e96-0x10f;const _0x55f98c=a15_0x55f9();let _0x12f6f2=_0x55f98c[_0x549e96];return _0x12f6f2;}function a15_0x55f9(){const _0x195da8=['max','6dxiFej','6778660pGuXDt','repeat','198918LniONr','429241RnZcfr','15437616xADEfb','fill','109265osiYNg','join','2311858WkQPYj','3347844VgDiRR'];a15_0x55f9=function(){return _0x195da8;};return a15_0x55f9();}export function getStringWidth(_0x599ac8){let _0x273a3c=0x0;for(const _0x3d450b of _0x599ac8){/[\u4e00-\u9fa5]/['test'](_0x3d450b)?_0x273a3c+=0x2:_0x273a3c+=0x1;}return _0x273a3c;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39aa40,_0x4226f4){const _0x594e5e=a16_0x179a,_0x13453d=_0x39aa40();while(!![]){try{const _0x4869af=parseInt(_0x594e5e(0x13d))/0x1*(parseInt(_0x594e5e(0x145))/0x2)+parseInt(_0x594e5e(0x13f))/0x3*(parseInt(_0x594e5e(0x142))/0x4)+parseInt(_0x594e5e(0x13e))/0x5*(-parseInt(_0x594e5e(0x141))/0x6)+-parseInt(_0x594e5e(0x148))/0x7+parseInt(_0x594e5e(0x144))/0x8+-parseInt(_0x594e5e(0x13c))/0x9+parseInt(_0x594e5e(0x146))/0xa*(parseInt(_0x594e5e(0x140))/0xb);if(_0x4869af===_0x4226f4)break;else _0x13453d['push'](_0x13453d['shift']());}catch(_0x5ac826){_0x13453d['push'](_0x13453d['shift']());}}}(a16_0x2bfc,0x253de));export function isValidJsHttpsUrl(_0x2736b3){const _0x476f73=a16_0x179a;return/^https:\/\/.+\.js(\?.*)?$/[_0x476f73(0x147)](_0x2736b3[_0x476f73(0x149)]());}function a16_0x2bfc(){const _0x5999f4=['6KPBpJf','244bdQUJt','HEAD','871352EPjTJy','2IIXURv','7110UbXzzG','test','971138czHtPs','trim','1639917aVnAQB','218049BaWrry','434675edpDfo','6621DKgbHm','1529NeutTo'];a16_0x2bfc=function(){return _0x5999f4;};return a16_0x2bfc();}export function isValidCssHttpsUrl(_0x29c0bb){const _0x2c82b6=a16_0x179a;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x29c0bb[_0x2c82b6(0x149)]());}function a16_0x179a(_0xed83e2,_0x561d7c){_0xed83e2=_0xed83e2-0x13c;const _0x2bfcd3=a16_0x2bfc();let _0x179a62=_0x2bfcd3[_0xed83e2];return _0x179a62;}export async function isUrlReachable(_0x3741f7){const _0x2cc3e2=a16_0x179a;try{const _0x150821=await fetch(_0x3741f7,{'method':_0x2cc3e2(0x143)});return _0x150821['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a17_0xa35b(_0x14c04d,_0x54155f){_0x14c04d=_0x14c04d-0xd4;const _0x3bb887=a17_0x3bb8();let _0xa35b9b=_0x3bb887[_0x14c04d];return _0xa35b9b;}(function(_0x18dd84,_0x16dc65){const _0x5e5013=a17_0xa35b,_0x157a6a=_0x18dd84();while(!![]){try{const _0x322ac8=parseInt(_0x5e5013(0xe4))/0x1+parseInt(_0x5e5013(0xde))/0x2+parseInt(_0x5e5013(0xe1))/0x3*(parseInt(_0x5e5013(0xd9))/0x4)+parseInt(_0x5e5013(0xe8))/0x5*(-parseInt(_0x5e5013(0xe7))/0x6)+parseInt(_0x5e5013(0xe9))/0x7*(-parseInt(_0x5e5013(0xda))/0x8)+-parseInt(_0x5e5013(0xd5))/0x9*(-parseInt(_0x5e5013(0xe5))/0xa)+-parseInt(_0x5e5013(0xe2))/0xb*(parseInt(_0x5e5013(0xe6))/0xc);if(_0x322ac8===_0x16dc65)break;else _0x157a6a['push'](_0x157a6a['shift']());}catch(_0x35f228){_0x157a6a['push'](_0x157a6a['shift']());}}}(a17_0x3bb8,0x4423b));function a17_0x3bb8(){const _0x3fbab0=['label','8ipDGzc','695864ocxKiD','join','appMenu.updateCdn.preview.resourceLinks','resources','980114wtjSjG','length','appMenu.updateCdn.preview.menuList','386907TiLPaz','55HSxVSu','cyan','405249VNcjfP','1060YaWORm','1763052zbxqBV','6VAzvxn','1864975SGZord','7OSmJJt','flat','filter','27207Xhylfx','map','column'];a17_0x3bb8=function(){return _0x3fbab0;};return a17_0x3bb8();}import{jsx as a17_0x4ef498,jsxs as a17_0x580757}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';export function CurrentMenuCdnContent(_0x1692b8){const _0x39c30c=a17_0xa35b,{t:_0x27b648}=useI18n(),{menuList:_0x220c14}=_0x1692b8,_0x13c01c=_0x220c14[_0x39c30c(0xd4)](_0x3e8928=>_0x3e8928[_0x39c30c(0xdd)][_0x39c30c(0xdf)]),_0x3c2120=Array['from'](new Set(_0x220c14[_0x39c30c(0xd6)](_0x461d2f=>_0x461d2f[_0x39c30c(0xdd)])[_0x39c30c(0xea)]()));return a17_0x580757(Box,{'flexDirection':_0x39c30c(0xd7),'children':[a17_0x4ef498(Text,{'color':_0x39c30c(0xe3),'children':_0x27b648('appMenu.updateCdn.preview.title')}),a17_0x580757(Box,{'marginTop':0x1,'flexDirection':_0x39c30c(0xd7),'children':[a17_0x580757(Text,{'bold':!![],'children':['\x20\x20',_0x27b648(_0x39c30c(0xe0))]}),a17_0x580757(Text,{'children':['\x20\x20',_0x13c01c['map'](_0x173773=>_0x173773[_0x39c30c(0xd8)])[_0x39c30c(0xdb)](',\x20')]})]}),a17_0x4ef498(Box,{'marginTop':0x1,'children':a17_0x580757(Text,{'bold':!![],'children':['\x20\x20',_0x27b648(_0x39c30c(0xdc))]})}),_0x3c2120[_0x39c30c(0xd6)](_0x425be0=>a17_0x4ef498(Box,{'children':a17_0x580757(Text,{'children':['\x20\x20',_0x425be0]})},_0x425be0))]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a18_0x4fea(){const _0x2aa274=['2886968dxwUrm','3fqXKOd','1857624dkUtLR','447151BZZlCG','column','16SHSZjx','117eZUhkA','appMenu.updateCdn.input.jsUrl.label','602720dRyrJc','green','1672644ruvvsm','appMenu.updateCdn.input.cssUrl.label','44834CiuqIE','appMenu.updateCdn.input.title','664450hUGRUC'];a18_0x4fea=function(){return _0x2aa274;};return a18_0x4fea();}(function(_0x32375d,_0x3749fa){const _0x29d8f6=a18_0x41ec,_0x48e0ed=_0x32375d();while(!![]){try{const _0x570a53=parseInt(_0x29d8f6(0x162))/0x1+-parseInt(_0x29d8f6(0x15c))/0x2*(parseInt(_0x29d8f6(0x160))/0x3)+-parseInt(_0x29d8f6(0x164))/0x4*(parseInt(_0x29d8f6(0x167))/0x5)+-parseInt(_0x29d8f6(0x169))/0x6+-parseInt(_0x29d8f6(0x15f))/0x7+parseInt(_0x29d8f6(0x161))/0x8+parseInt(_0x29d8f6(0x165))/0x9*(parseInt(_0x29d8f6(0x15e))/0xa);if(_0x570a53===_0x3749fa)break;else _0x48e0ed['push'](_0x48e0ed['shift']());}catch(_0x506b1a){_0x48e0ed['push'](_0x48e0ed['shift']());}}}(a18_0x4fea,0x54cd4));import{jsx as a18_0x152d7f,jsxs as a18_0x1259a2}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';function a18_0x41ec(_0xc2bbae,_0x4e8434){_0xc2bbae=_0xc2bbae-0x15c;const _0x4fea49=a18_0x4fea();let _0x41ec2c=_0x4fea49[_0xc2bbae];return _0x41ec2c;}export function InputCdnAsset(_0x53d987){const _0x48cd19=a18_0x41ec,{t:_0x2dd15b}=useI18n(),{jsCdnUrl:_0x217acd,cssCdnUrl:_0x41d708}=_0x53d987;return a18_0x1259a2(Box,{'flexDirection':_0x48cd19(0x163),'marginTop':0x1,'children':[a18_0x152d7f(Text,{'color':'cyan','children':_0x2dd15b(_0x48cd19(0x15d))}),a18_0x1259a2(Box,{'children':[a18_0x1259a2(Text,{'children':['\x20\x20',_0x2dd15b(_0x48cd19(0x166))]}),a18_0x152d7f(Text,{'color':_0x48cd19(0x168),'children':_0x217acd})]}),a18_0x1259a2(Box,{'children':[a18_0x1259a2(Text,{'children':['\x20\x20',_0x2dd15b(_0x48cd19(0x16a))]}),a18_0x152d7f(Text,{'color':_0x48cd19(0x168),'children':_0x41d708})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28c7f1,_0x418249){const _0x59392a=a19_0x4b2e,_0x14a94b=_0x28c7f1();while(!![]){try{const _0x559f7f=parseInt(_0x59392a(0x128))/0x1+-parseInt(_0x59392a(0x149))/0x2*(parseInt(_0x59392a(0x14f))/0x3)+-parseInt(_0x59392a(0x13f))/0x4+-parseInt(_0x59392a(0x151))/0x5+-parseInt(_0x59392a(0x144))/0x6+-parseInt(_0x59392a(0x12d))/0x7*(-parseInt(_0x59392a(0x137))/0x8)+parseInt(_0x59392a(0x134))/0x9;if(_0x559f7f===_0x418249)break;else _0x14a94b['push'](_0x14a94b['shift']());}catch(_0x515cbc){_0x14a94b['push'](_0x14a94b['shift']());}}}(a19_0x1156,0x58ec6));function a19_0x1156(){const _0x4763d7=['need-confirm','label','11515248cqWsmQ','input-css','rightArrow','104816XmLWkF','dots','appMenu.updateCdn.action.continue','downArrow','appMenu.updateCdn.error.noCdnLinks','appMenu.updateCdn.input.jsUrl.placeholder','delete','appMenu.updateCdn.error.invalidCssUrl','2706980bkpixR','lovrabet\x20auth','value','green','appMenu.updateCdn.action.cancel','1937250RrMELc','all','flat','leftArrow','return','56SGrMJO','backspace','red','yellow','appMenu.updateCdn.loading.syncing','appMenu.updateCdn.error.authHint.prefix','37992TznTKa','creating','2243040QEEdVv','trim','\x20←\x20','map','gray','resolve','appMenu.updateCdn.error.cssUrlUnreachable','upArrow','appMenu.updateCdn.success.updated','from','cancel','resources','677946kisXUB','appMenu.updateCdn.input.cssUrl.label','appMenu.updateCdn.input.jsUrl.label','length','input-js','112oAFXLB','path','slice','column','cyan'];a19_0x1156=function(){return _0x4763d7;};return a19_0x1156();}import{jsx as a19_0xefa03f,jsxs as a19_0x46ba66,Fragment as a19_0x232936}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a19_0x306f2f from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';function a19_0x4b2e(_0x2a7161,_0x2be58f){_0x2a7161=_0x2a7161-0x122;const _0x115666=a19_0x1156();let _0x4b2e7a=_0x115666[_0x2a7161];return _0x4b2e7a;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenu}from'./update-menu.js';import{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a19_0xefa03f(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x27a64c=a19_0x4b2e,{exit:_0x49ed00}=useApp(),{t:_0x16cc12}=useI18n(),{loading:_0x5389db,menuList:_0x445119,error:_0x2d68bf}=useGetOnlineMenuList(),[_0x3cbbed,_0xbf33c4]=useState('ok'),[_0x12b4c4,_0x114931]=useState(_0x27a64c(0x12c)),[_0x6e5aee,_0x38f631]=useState(''),[_0x342dae,_0x152e10]=useState(''),[_0x152c7e,_0x5483df]=useState(''),[_0x24ab4e,_0x3d462f]=useState(''),_0x2deece=Array[_0x27a64c(0x125)](new Set(_0x445119[_0x27a64c(0x154)](_0x3594ef=>_0x3594ef[_0x27a64c(0x127)])[_0x27a64c(0x146)]()));useEffect(()=>{_0x12b4c4==='updated'&&setTimeout(_0x49ed00,0x32);},[_0x12b4c4]),useInput(async(_0xc03347,_0x5b13f8)=>{const _0x260344=_0x27a64c;if(_0x12b4c4===_0x260344(0x12c)){if(_0x5b13f8['return']){const _0x3a17d0=_0x152c7e[_0x260344(0x152)]();if(_0x3a17d0==='')return;if(!isValidJsHttpsUrl(_0x3a17d0)){_0x3d462f(_0x16cc12('appMenu.updateCdn.error.invalidJsUrl'));return;}if(!await isUrlReachable(_0x3a17d0)){_0x3d462f(_0x16cc12('appMenu.updateCdn.error.jsUrlUnreachable'));return;}_0x38f631(_0x3a17d0),_0x5483df(''),_0x3d462f(''),_0x114931(_0x260344(0x135));return;}if(_0x5b13f8[_0x260344(0x14a)]||_0x5b13f8[_0x260344(0x13d)]){_0x5483df(_0x37d22b=>_0x37d22b[_0x260344(0x12f)](0x0,-0x1)),_0x3d462f('');return;}_0x5483df(_0x5c4565=>_0x5c4565+_0xc03347);return;}if(_0x12b4c4===_0x260344(0x135)){if(_0x5b13f8[_0x260344(0x148)]){const _0x2e9e4f=_0x152c7e[_0x260344(0x152)]();if(_0x2e9e4f==='')return;if(!isValidCssHttpsUrl(_0x2e9e4f)){_0x3d462f(_0x16cc12(_0x260344(0x13e)));return;}if(!await isUrlReachable(_0x2e9e4f)){_0x3d462f(_0x16cc12(_0x260344(0x122)));return;}_0x152e10(_0x2e9e4f),_0x5483df(''),_0x3d462f(''),_0x114931(_0x260344(0x132));return;}if(_0x5b13f8['backspace']||_0x5b13f8[_0x260344(0x13d)]){_0x5483df(_0x5e81cd=>_0x5e81cd[_0x260344(0x12f)](0x0,-0x1)),_0x3d462f('');return;}_0x5483df(_0x3db0ee=>_0x3db0ee+_0xc03347);return;}if(_0x12b4c4==='need-confirm'){(_0x5b13f8[_0x260344(0x123)]||_0x5b13f8[_0x260344(0x13a)]||_0x5b13f8[_0x260344(0x147)]||_0x5b13f8[_0x260344(0x136)])&&_0xbf33c4(_0x58211f=>_0x58211f==='ok'?_0x260344(0x126):'ok');if(_0x5b13f8[_0x260344(0x148)]){_0x114931(_0x260344(0x150));if(_0x3cbbed==='ok')await Promise[_0x260344(0x145)](_0x445119[_0x260344(0x154)](_0x3cf6dd=>{const _0x21e589=_0x260344,_0x3d54bd={'id':_0x3cf6dd['id'],'label':_0x3cf6dd[_0x21e589(0x133)],'path':_0x3cf6dd[_0x21e589(0x12e)],'resources':[_0x6e5aee,_0x342dae]};if(_0x3cf6dd['resources'][_0x21e589(0x12b)]===0x0)return Promise[_0x21e589(0x156)]();return updateMenu(_0x3d54bd);})),await new Promise(_0x98ed5d=>setTimeout(_0x98ed5d,0x3e8)),_0x114931('updated');else _0x3cbbed===_0x260344(0x126)&&_0x49ed00();}}});if(_0x5389db)return a19_0x46ba66(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a19_0xefa03f(Text,{}),a19_0xefa03f(a19_0x306f2f,{'type':'dots'}),a19_0xefa03f(Text,{'children':_0x16cc12('appMenu.updateCdn.loading.fetching')})]});if(_0x2d68bf)return a19_0x46ba66(Box,{'flexDirection':_0x27a64c(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0x46ba66(Text,{'color':'red','children':['✗\x20',_0x2d68bf]}),a19_0x46ba66(Box,{'marginTop':0x1,'children':[a19_0xefa03f(Text,{'color':_0x27a64c(0x155),'children':_0x16cc12(_0x27a64c(0x14e))}),a19_0xefa03f(Text,{'color':_0x27a64c(0x131),'children':_0x27a64c(0x140)}),a19_0xefa03f(Text,{'color':_0x27a64c(0x155),'children':_0x16cc12('appMenu.updateCdn.error.authHint.suffix')})]})]});if(_0x2deece['length']===0x0)return a19_0xefa03f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a19_0xefa03f(Text,{'color':_0x27a64c(0x14c),'children':_0x16cc12(_0x27a64c(0x13b))})});if(_0x12b4c4==='need-confirm')return a19_0x46ba66(Box,{'flexDirection':_0x27a64c(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0xefa03f(CurrentMenuCdnContent,{'menuList':_0x445119}),a19_0xefa03f(InputCdnAsset,{'jsCdnUrl':_0x6e5aee,'cssCdnUrl':_0x342dae}),a19_0xefa03f(Box,{'marginTop':0x1,'flexDirection':_0x27a64c(0x130),'children':[{'label':_0x16cc12(_0x27a64c(0x139)),'value':'ok'},{'label':_0x16cc12(_0x27a64c(0x143)),'value':_0x27a64c(0x126)}]['map'](_0xc6cd40=>a19_0x46ba66(Text,{'color':_0x3cbbed===_0xc6cd40[_0x27a64c(0x141)]?'yellow':undefined,'children':[_0x3cbbed===_0xc6cd40[_0x27a64c(0x141)]?'>\x20':'\x20\x20',_0xc6cd40[_0x27a64c(0x133)]]},_0xc6cd40['value']))})]});if(_0x12b4c4===_0x27a64c(0x150))return a19_0x46ba66(Box,{'flexDirection':_0x27a64c(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0xefa03f(CurrentMenuCdnContent,{'menuList':_0x445119}),a19_0xefa03f(InputCdnAsset,{'jsCdnUrl':_0x6e5aee,'cssCdnUrl':_0x342dae}),a19_0x46ba66(Box,{'marginTop':0x1,'children':[a19_0xefa03f(a19_0x306f2f,{'type':_0x27a64c(0x138)}),a19_0xefa03f(Text,{'children':_0x16cc12(_0x27a64c(0x14d))})]})]});if(_0x12b4c4==='updated')return a19_0x46ba66(Box,{'flexDirection':_0x27a64c(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0xefa03f(CurrentMenuCdnContent,{'menuList':_0x445119}),a19_0xefa03f(InputCdnAsset,{'jsCdnUrl':_0x6e5aee,'cssCdnUrl':_0x342dae}),a19_0xefa03f(Box,{'marginTop':0x1,'children':a19_0xefa03f(Text,{'color':_0x27a64c(0x142),'children':_0x16cc12(_0x27a64c(0x124))})})]});return a19_0x46ba66(Box,{'flexDirection':_0x27a64c(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0xefa03f(CurrentMenuCdnContent,{'menuList':_0x445119}),a19_0x46ba66(Box,{'marginTop':0x1,'flexDirection':'column','children':[a19_0xefa03f(Text,{'color':'cyan','children':_0x16cc12('appMenu.updateCdn.title')}),_0x6e5aee?a19_0x46ba66(Box,{'children':[a19_0x46ba66(Text,{'color':_0x27a64c(0x155),'children':['\x20\x20',_0x16cc12(_0x27a64c(0x12a))]}),a19_0xefa03f(Text,{'color':'green','children':_0x6e5aee})]}):_0x12b4c4===_0x27a64c(0x12c)&&a19_0x46ba66(a19_0x232936,{'children':[a19_0x46ba66(Box,{'children':[a19_0x46ba66(Text,{'children':['\x20\x20',_0x16cc12(_0x27a64c(0x12a))]}),a19_0xefa03f(Text,{'color':_0x27a64c(0x142),'children':_0x152c7e}),_0x24ab4e&&a19_0x46ba66(Text,{'color':_0x27a64c(0x14b),'children':[_0x27a64c(0x153),_0x24ab4e]})]}),!_0x24ab4e&&a19_0xefa03f(Box,{'children':a19_0x46ba66(Text,{'color':_0x27a64c(0x155),'children':['\x20\x20',_0x16cc12(_0x27a64c(0x13c))]})})]}),_0x342dae?a19_0x46ba66(Box,{'children':[a19_0x46ba66(Text,{'children':['\x20\x20',_0x16cc12(_0x27a64c(0x129))]}),a19_0xefa03f(Text,{'color':_0x27a64c(0x142),'children':_0x342dae})]}):_0x12b4c4===_0x27a64c(0x135)&&a19_0x46ba66(a19_0x232936,{'children':[a19_0x46ba66(Box,{'children':[a19_0x46ba66(Text,{'children':['\x20\x20',_0x16cc12('appMenu.updateCdn.input.cssUrl.label')]}),a19_0xefa03f(Text,{'color':_0x27a64c(0x142),'children':_0x152c7e}),_0x24ab4e&&a19_0x46ba66(Text,{'color':_0x27a64c(0x14b),'children':[_0x27a64c(0x153),_0x24ab4e]})]}),!_0x24ab4e&&a19_0xefa03f(Box,{'children':a19_0x46ba66(Text,{'color':_0x27a64c(0x155),'children':['\x20\x20',_0x16cc12('appMenu.updateCdn.input.cssUrl.placeholder')]})})]})]})]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a21_0x50bf47=a21_0x5dfb;(function(_0xab5f36,_0x52b5ce){const _0x52bdd3=a21_0x5dfb,_0x4ef891=_0xab5f36();while(!![]){try{const _0x397357=-parseInt(_0x52bdd3(0x184))/0x1+parseInt(_0x52bdd3(0x1a3))/0x2+-parseInt(_0x52bdd3(0x1a1))/0x3*(-parseInt(_0x52bdd3(0x19b))/0x4)+parseInt(_0x52bdd3(0x187))/0x5*(parseInt(_0x52bdd3(0x18f))/0x6)+parseInt(_0x52bdd3(0x196))/0x7+-parseInt(_0x52bdd3(0x194))/0x8+parseInt(_0x52bdd3(0x185))/0x9;if(_0x397357===_0x52b5ce)break;else _0x4ef891['push'](_0x4ef891['shift']());}catch(_0x5413ba){_0x4ef891['push'](_0x4ef891['shift']());}}}(a21_0x423f,0xc19ec));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import a21_0x49e421 from'../i18n/index.js';function a21_0x5dfb(_0x3f7995,_0x5b04be){_0x3f7995=_0x3f7995-0x180;const _0x423f55=a21_0x423f();let _0x5dfbc3=_0x423f55[_0x3f7995];return _0x5dfbc3;}const config=readConfig(),logLabel=a21_0x50bf47(0x182),t=a21_0x49e421['t']['bind'](a21_0x49e421);function a21_0x423f(){const _0x2a15cd=['data','appMenu.updateCdn.error.updateFailed','appcode','path','12kUEKNs','info','label','errorMsg','length','8597328euuxpa','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','2686159qhXYwr','appMenu.error.appCodeHint.option2','sdk-demo','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','appMenu.error.appCodeHint.option1','124nWLlYD','appMenu.updateCdn.updating','appMenu.error.appCodeHint.title','error','application/json','appMenu.error.authExpired','35985NikcNA','appMenu.error.missingAppCode','1597878SQoqxJ','resources','import','success','json','status','update-menu-cdn-url','common.error','474131BVIMyb','5032638SnqBqN','/smartapi/menu/update','570405seIrhh','log','errorCode','SdkDemo1'];a21_0x423f=function(){return _0x2a15cd;};return a21_0x423f();}import.meta.main&&updateMenu({'id':0xf41e,'label':a21_0x50bf47(0x18a),'path':a21_0x50bf47(0x198),'resources':[a21_0x50bf47(0x195),a21_0x50bf47(0x199)]});export async function updateMenu(_0x574d57){const _0x53862b=a21_0x50bf47,_0x900d9a=config?.[_0x53862b(0x18d)];if(!_0x900d9a){const _0x12877d=t(_0x53862b(0x1a2));logger[_0x53862b(0x19e)](logLabel,_0x12877d),console[_0x53862b(0x19e)]('×\x20'+_0x12877d),console[_0x53862b(0x188)](t(_0x53862b(0x19d))),console[_0x53862b(0x188)](t(_0x53862b(0x19a))),console['log'](t(_0x53862b(0x197)));return;}logger[_0x53862b(0x190)](logLabel,t(_0x53862b(0x19c),{'label':_0x574d57[_0x53862b(0x191)],'path':_0x574d57[_0x53862b(0x18e)]}));const _0x50ffbc={'id':_0x574d57['id'],'appCode':_0x900d9a,'extend':{'loadScriptMode':_0x53862b(0x1a5),..._0x574d57[_0x53862b(0x1a4)]?.[_0x53862b(0x193)]?{'resources':JSON['stringify'](_0x574d57[_0x53862b(0x1a4)])}:{}}};_0x574d57[_0x53862b(0x191)]&&(_0x50ffbc[_0x53862b(0x191)]=_0x574d57[_0x53862b(0x191)]);const _0x167d75=await fetch(getApiDomain()+_0x53862b(0x186),{'method':'POST','body':JSON['stringify'](_0x50ffbc),'headers':{'Content-Type':_0x53862b(0x19f),'Cookie':getCookie()}});if(!_0x167d75['ok']){if(_0x167d75[_0x53862b(0x181)]===0x191){const _0x539c34=t(_0x53862b(0x1a0));logger['error'](logLabel,_0x539c34,{'status':_0x167d75[_0x53862b(0x181)],'menu':_0x574d57[_0x53862b(0x191)]});throw new Error(_0x539c34);}const _0x113d72=t('appMenu.updateCdn.error.updateFailed',{'error':_0x167d75[_0x53862b(0x181)]});logger[_0x53862b(0x19e)](logLabel,_0x113d72,{'menu':_0x574d57[_0x53862b(0x191)]});throw new Error(_0x113d72);}const _0x47fe62=await _0x167d75[_0x53862b(0x180)]();if(!_0x47fe62[_0x53862b(0x1a6)]){const _0x57079d=t(_0x53862b(0x18c),{'error':_0x47fe62[_0x53862b(0x192)]||t(_0x53862b(0x183))});logger['error'](logLabel,_0x57079d,{'errorCode':_0x47fe62[_0x53862b(0x189)],'errorMsg':_0x47fe62[_0x53862b(0x192)],'menu':_0x574d57[_0x53862b(0x191)]});throw new Error(_0x57079d);}logger[_0x53862b(0x190)](logLabel,t('appMenu.updateCdn.success.synced',{'label':_0x574d57[_0x53862b(0x191)]}),_0x47fe62[_0x53862b(0x18b)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x197f(_0x29ecd7,_0x44bd59){_0x29ecd7=_0x29ecd7-0xc7;const _0x4f1529=a22_0x4f15();let _0x197f16=_0x4f1529[_0x29ecd7];return _0x197f16;}(function(_0x305aa7,_0x28dade){const _0x5c8ba2=a22_0x197f,_0x377a13=_0x305aa7();while(!![]){try{const _0x167464=parseInt(_0x5c8ba2(0xc7))/0x1+parseInt(_0x5c8ba2(0xce))/0x2+-parseInt(_0x5c8ba2(0xd2))/0x3+-parseInt(_0x5c8ba2(0xd5))/0x4+parseInt(_0x5c8ba2(0xcf))/0x5*(parseInt(_0x5c8ba2(0xcc))/0x6)+-parseInt(_0x5c8ba2(0xd4))/0x7*(-parseInt(_0x5c8ba2(0xd1))/0x8)+-parseInt(_0x5c8ba2(0xcb))/0x9;if(_0x167464===_0x28dade)break;else _0x377a13['push'](_0x377a13['shift']());}catch(_0x36d5a0){_0x377a13['push'](_0x377a13['shift']());}}}(a22_0x4f15,0x6e1df));import{jsx as a22_0x5172a8,jsxs as a22_0x327c6d}from'react/jsx-runtime';function a22_0x4f15(){const _0x53997d=['801597zeSBpK','then','log','dots','3568383xtrTqH','354QdnXaT','gray','329278FPmbHw','58235JyIady','green','4568zGApST','1563564QaXmCf','column','1519LBrHcb','1634408yNQhWz','return','auth.login.pressEnter'];a22_0x4f15=function(){return _0x53997d;};return a22_0x4f15();}import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a22_0x31da4f from'ink-spinner';import{useI18n}from'../i18n/hooks.js';export function AuthServer(){const _0x3e0d31=a22_0x197f,{exit:_0x23161b}=useApp(),{t:_0x3ab260}=useI18n(),[_0x40f9ee,_0x11d754]=useState(![]),[_0x35489a,_0x3e0eb6]=useState(!![]),[_0xe1f1ab,_0x4bfffe]=useState(![]),[_0x2913cf,_0x233f89]=useState(![]);useEffect(()=>{const _0x52ac83=a22_0x197f;getIsSessionValid()[_0x52ac83(0xc8)](_0x11d754)['finally'](()=>_0x3e0eb6(![]));},[]),useEffect(()=>{const _0xd0aec4=a22_0x197f;!_0x35489a&&_0x40f9ee&&(console[_0xd0aec4(0xc9)](_0x3ab260('auth.session.valid')),_0x23161b());},[_0x35489a,_0x40f9ee,_0x23161b]),useEffect(()=>{const _0x2eed19=a22_0x197f;_0x2913cf&&(console[_0x2eed19(0xc9)]('*\x20'+_0x3ab260('auth.login.successCli')),_0x23161b());},[_0x2913cf,_0x23161b]),useInput((_0x3fb445,_0x472c01)=>{const _0x4c2447=a22_0x197f;_0x472c01[_0x4c2447(0xd6)]&&(_0x4bfffe(!![]),authServer({'silent':!![]})['then'](_0x423eec=>{_0x233f89(_0x423eec);})),_0x3fb445==='q'&&_0x23161b();});if(_0x35489a)return null;if(_0x40f9ee||_0x2913cf)return null;return a22_0x5172a8(Box,{'flexDirection':_0x3e0d31(0xd3),'marginTop':0x1,'marginBottom':0x1,'children':_0xe1f1ab?a22_0x327c6d(Box,{'children':[a22_0x5172a8(Box,{'width':'1'}),a22_0x327c6d(Text,{'color':_0x3e0d31(0xd0),'children':[a22_0x5172a8(a22_0x31da4f,{'type':_0x3e0d31(0xca)}),'\x20\x20']}),a22_0x327c6d(Text,{'children':[_0x3ab260('auth.login.inProgress'),'\x20']}),a22_0x5172a8(Text,{'color':_0x3e0d31(0xcd),'children':_0x3ab260('auth.login.browserPrompt')})]}):a22_0x327c6d(Box,{'children':[a22_0x5172a8(Box,{'width':'1'}),a22_0x5172a8(Text,{'children':_0x3ab260(_0x3e0d31(0xd7))}),a22_0x5172a8(Text,{'color':_0x3e0d31(0xcd),'children':_0x3ab260('auth.login.pressQToExit')})]})});}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x1fcc04=a23_0x14cc;(function(_0x4a93c1,_0x17098e){const _0x144c69=a23_0x14cc,_0x5102e8=_0x4a93c1();while(!![]){try{const _0x1e313c=-parseInt(_0x144c69(0xfd))/0x1+parseInt(_0x144c69(0xde))/0x2+parseInt(_0x144c69(0xf3))/0x3*(-parseInt(_0x144c69(0x100))/0x4)+parseInt(_0x144c69(0xf6))/0x5+parseInt(_0x144c69(0xf8))/0x6*(-parseInt(_0x144c69(0x102))/0x7)+-parseInt(_0x144c69(0x105))/0x8*(parseInt(_0x144c69(0xdd))/0x9)+parseInt(_0x144c69(0xf0))/0xa;if(_0x1e313c===_0x17098e)break;else _0x5102e8['push'](_0x5102e8['shift']());}catch(_0x3191c0){_0x5102e8['push'](_0x5102e8['shift']());}}}(a23_0x21b7,0xb79ee));import{writeFileSync}from'node:fs';import a23_0x1ff2b7 from'node:https';import{getUserDomain}from'../constant/domain.js';function a23_0x14cc(_0x4499a3,_0xcbf4b8){_0x4499a3=_0x4499a3-0xdd;const _0x21b76e=a23_0x21b7();let _0x14cc48=_0x21b76e[_0x4499a3];return _0x14cc48;}import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';import a23_0x649d5f from'../i18n/index.js';const t=a23_0x649d5f['t'][a23_0x1fcc04(0x104)](a23_0x649d5f);function a23_0x21b7(){const _0x2c554e=['auth.server.openingBrowser','https://dev.lovrabet.com:','2190880QagAby','silent','485292hDQXLe','log','headers','cookie','json','1479202tZcfFq','open\x20\x22','port','5962172sUARpM','close','49kHSBXM','auth.server.starting','bind','1240264kEQGfJ','address','auth.server.browserOpened','object','18qFIWep','1402482IELfML','auth.server.browserOpenFailed','end','auth.login.success.title','</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','<span\x20id=\x22t\x22>5</span>','auth.login.success.manualClose','darwin','https://g.yuntooai.com/cert/lovrabet-dev.json','isAuth','listen','/api/auth/get-session','/sign-in?redirect=','user','writeHead','utf-8','Auth\x20server\x20error:','auth.server.manualCopyUrl','34586780Cddnwt','error','then','3cYiJmw'];a23_0x21b7=function(){return _0x2c554e;};return a23_0x21b7();}export async function authServer(_0x2872d0){const _0x4fb5d6=a23_0x1fcc04,_0xbf50f1=_0x2872d0?.[_0x4fb5d6(0xf7)]||![];if(await getIsSessionValid())return!![];const _0x2f2997=await(await fetch(_0x4fb5d6(0xe6)))[_0x4fb5d6(0xfc)]();return new Promise(async(_0x737d3b,_0x204274)=>{const _0xc40e38=_0x4fb5d6;let _0x2bae8c=0x0;const _0x3fd0a8=a23_0x1ff2b7['createServer'](_0x2f2997,async(_0x2a3917,_0xd29b3d)=>{const _0x131eb5=a23_0x14cc,_0x54027b=getUserDomain(),_0xc900fb=_0x2a3917[_0x131eb5(0xfa)][_0x131eb5(0xfb)]||'',_0x36568c=await fetch(_0x54027b+_0x131eb5(0xe9),{'headers':{'cookie':_0xc900fb}})[_0x131eb5(0xf2)](_0x468738=>_0x468738[_0x131eb5(0xfc)]()),_0x40ed64=_0x36568c&&_0x36568c['session']&&_0x36568c[_0x131eb5(0xeb)];if(_0x40ed64){writeFileSync(cookieFile,_0xc900fb,_0x131eb5(0xed)),_0x737d3b(!![]);const _0x4e2d80=t(_0x131eb5(0xe1)),_0x408a1c=t('auth.login.success.message',{'seconds':_0x131eb5(0xe3)}),_0x300646=t(_0x131eb5(0xe4)),_0x3e100d='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>'+_0x4e2d80+'</title></head>\x0a<body>\x0a\x20\x20<div>'+_0x408a1c+'</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>'+_0x300646+_0x131eb5(0xe2);_0xd29b3d[_0x131eb5(0xec)](0xc8,{'Content-Type':'text/html;\x20charset=utf-8'}),_0xd29b3d[_0x131eb5(0xe0)](_0x3e100d),_0x3fd0a8[_0x131eb5(0x101)]();}else{const _0x2eab5a=''+encodeURIComponent(_0x131eb5(0xf5)+_0x2bae8c);_0xd29b3d[_0x131eb5(0xec)](0x12e,{'location':_0x54027b+_0x131eb5(0xea)+_0x2eab5a}),_0xd29b3d[_0x131eb5(0xe0)]();return;}});_0x3fd0a8[_0xc40e38(0xe8)](0x0,'127.0.0.1',()=>{const _0x4dc9fc=_0xc40e38,_0x225d7a=_0x3fd0a8[_0x4dc9fc(0x106)]();_0x2bae8c=typeof _0x225d7a===_0x4dc9fc(0x108)&&_0x225d7a?_0x225d7a[_0x4dc9fc(0xff)]:Number(_0x225d7a);const _0x4114cc=_0x4dc9fc(0xf5)+_0x2bae8c;!_0xbf50f1&&(console[_0x4dc9fc(0xf9)](t(_0x4dc9fc(0x103))),console[_0x4dc9fc(0xf9)](t('auth.server.loginUrl'),_0x4114cc),console[_0x4dc9fc(0xf9)](t(_0x4dc9fc(0xf4))),console['log'](''),console[_0x4dc9fc(0xf9)](t('auth.server.manualOpenHint')),console[_0x4dc9fc(0xf9)]('')),openInBrowser(_0x4114cc)[_0x4dc9fc(0xf2)](_0x35defb=>{const _0x571dea=_0x4dc9fc;!_0xbf50f1&&(_0x35defb?console[_0x571dea(0xf9)](t(_0x571dea(0x107))):(console[_0x571dea(0xf9)](t(_0x571dea(0xdf))),console[_0x571dea(0xf9)](t(_0x571dea(0xef)),_0x4114cc)),console[_0x571dea(0xf9)](''));})['catch'](()=>{const _0x207680=_0x4dc9fc;!_0xbf50f1&&(console[_0x207680(0xf9)](t('auth.server.browserOpenFailed')),console['log'](t(_0x207680(0xef)),_0x4114cc),console[_0x207680(0xf9)](''));});}),_0x3fd0a8['on'](_0xc40e38(0xf1),_0x278221=>{const _0x125db5=_0xc40e38;!_0xbf50f1&&console['error'](_0x125db5(0xee),_0x278221),_0x204274(_0x278221);});});}function openInBrowser(_0x444e35){return new Promise(_0xd52b73=>{const _0xdca601=a23_0x14cc,_0x5adb01=process['platform'];let _0x1e761e;if(_0x5adb01==='win32')_0x1e761e='start\x20\x22\x22\x20\x22'+_0x444e35+'\x22';else _0x5adb01===_0xdca601(0xe5)?_0x1e761e=_0xdca601(0xfe)+_0x444e35+'\x22':_0x1e761e='xdg-open\x20\x22'+_0x444e35+'\x22';exec(_0x1e761e,_0x3f7428=>{_0x3f7428?_0xd52b73(![]):_0xd52b73(!![]);});});}if(import.meta.main){const isAuth=await authServer();console[a23_0x1fcc04(0xf9)](a23_0x1fcc04(0xe7),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x2998f9=a24_0x156b;(function(_0x213e3f,_0xc7dcf6){const _0x4c4dce=a24_0x156b,_0x4061bd=_0x213e3f();while(!![]){try{const _0x349694=parseInt(_0x4c4dce(0x7a))/0x1+-parseInt(_0x4c4dce(0x7b))/0x2+parseInt(_0x4c4dce(0x79))/0x3*(parseInt(_0x4c4dce(0x7c))/0x4)+-parseInt(_0x4c4dce(0x78))/0x5*(-parseInt(_0x4c4dce(0x81))/0x6)+-parseInt(_0x4c4dce(0x7e))/0x7+parseInt(_0x4c4dce(0x80))/0x8+-parseInt(_0x4c4dce(0x7d))/0x9*(-parseInt(_0x4c4dce(0x7f))/0xa);if(_0x349694===_0xc7dcf6)break;else _0x4061bd['push'](_0x4061bd['shift']());}catch(_0xd86c57){_0x4061bd['push'](_0x4061bd['shift']());}}}(a24_0x2eb2,0xb7486));import{mkdirSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const configDir=join(homedir(),a24_0x2998f9(0x77));function a24_0x156b(_0x5267f7,_0x2ee1b7){_0x5267f7=_0x5267f7-0x76;const _0x2eb290=a24_0x2eb2();let _0x156bc7=_0x2eb290[_0x5267f7];return _0x156bc7;}export const cookieFile=join(configDir,a24_0x2998f9(0x76));function a24_0x2eb2(){const _0x1559e7=['1871466qNPzln','256198rSUcKp','2258794jtptql','4gzyxBj','774QONbrG','791399WRTkpL','3340hdTBMy','342512zQTTXh','348otMBol','cookie','.lovrabet','89795MBbMEu'];a24_0x2eb2=function(){return _0x1559e7;};return a24_0x2eb2();}mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x8ed3(){var _0x130884=['5639155YJouRc','46490510wrkkmO','2865120qzXVZd','4175184oEoUSG','40159DaqfFc','942UsQqIw','232038gBHPZh','256azMeLj','455032bXQPEh','2eqldFR'];a25_0x8ed3=function(){return _0x130884;};return a25_0x8ed3();}(function(_0x4d0c3e,_0x4d0b20){var _0x72f35d=a25_0x3e29,_0x565de2=_0x4d0c3e();while(!![]){try{var _0x472d74=parseInt(_0x72f35d(0x75))/0x1+-parseInt(_0x72f35d(0x76))/0x2*(-parseInt(_0x72f35d(0x7a))/0x3)+parseInt(_0x72f35d(0x79))/0x4+parseInt(_0x72f35d(0x77))/0x5+parseInt(_0x72f35d(0x72))/0x6*(parseInt(_0x72f35d(0x71))/0x7)+-parseInt(_0x72f35d(0x74))/0x8*(-parseInt(_0x72f35d(0x73))/0x9)+-parseInt(_0x72f35d(0x78))/0xa;if(_0x472d74===_0x4d0b20)break;else _0x565de2['push'](_0x565de2['shift']());}catch(_0x372a34){_0x565de2['push'](_0x565de2['shift']());}}}(a25_0x8ed3,0xbb641));import{readFileSync}from'node:fs';function a25_0x3e29(_0x5468dd,_0x4c782b){_0x5468dd=_0x5468dd-0x71;var _0x8ed392=a25_0x8ed3();var _0x3e29fc=_0x8ed392[_0x5468dd];return _0x3e29fc;}import{cookieFile}from'./constant.js';export function getCookie(){try{return readFileSync(cookieFile,'utf-8');}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x573fca,_0x1f4ff8){const _0x2f030e=a26_0x1c15,_0x1a7d2d=_0x573fca();while(!![]){try{const _0x2c1c09=parseInt(_0x2f030e(0xbe))/0x1*(-parseInt(_0x2f030e(0xbb))/0x2)+parseInt(_0x2f030e(0xc5))/0x3+parseInt(_0x2f030e(0xc4))/0x4+parseInt(_0x2f030e(0xc7))/0x5*(parseInt(_0x2f030e(0xc6))/0x6)+-parseInt(_0x2f030e(0xc3))/0x7*(-parseInt(_0x2f030e(0xbc))/0x8)+-parseInt(_0x2f030e(0xba))/0x9*(-parseInt(_0x2f030e(0xc2))/0xa)+-parseInt(_0x2f030e(0xbf))/0xb;if(_0x2c1c09===_0x1f4ff8)break;else _0x1a7d2d['push'](_0x1a7d2d['shift']());}catch(_0x5dd2bf){_0x1a7d2d['push'](_0x1a7d2d['shift']());}}}(a26_0x3d70,0xc3b05));function a26_0x1c15(_0x80ccd9,_0x417778){_0x80ccd9=_0x80ccd9-0xb9;const _0x3d7089=a26_0x3d70();let _0x1c157b=_0x3d7089[_0x80ccd9];return _0x1c157b;}function a26_0x3d70(){const _0x14e632=['user','117WwLmBM','12LBcUSH','2138768RDoTmf','json','106598YqpGHq','27293574NUPjFg','/api/auth/get-session','utf-8','1121860UGEWfJ','7QYxLnh','3376272XELfNC','452169qRXyMq','96PiFmgA','375565sTXWWq'];a26_0x3d70=function(){return _0x14e632;};return a26_0x3d70();}import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x19c1d5=a26_0x1c15;try{if(!existsSync(cookieFile))return![];const _0x3f773e=readFileSync(cookieFile,_0x19c1d5(0xc1)),_0x2f92da=await fetch(getUserDomain()+_0x19c1d5(0xc0),{'headers':{'cookie':_0x3f773e}})['then'](_0x1f348d=>_0x1f348d[_0x19c1d5(0xbd)]());return _0x2f92da&&_0x2f92da['session']&&_0x2f92da[_0x19c1d5(0xb9)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5361e8,_0x533671){const _0x11f511=a27_0x3d7d,_0x2f13cf=_0x5361e8();while(!![]){try{const _0x28d752=-parseInt(_0x11f511(0x1bd))/0x1*(parseInt(_0x11f511(0x1ba))/0x2)+parseInt(_0x11f511(0x1b9))/0x3*(-parseInt(_0x11f511(0x1b7))/0x4)+-parseInt(_0x11f511(0x1b6))/0x5+parseInt(_0x11f511(0x1b5))/0x6+parseInt(_0x11f511(0x1be))/0x7+parseInt(_0x11f511(0x1bb))/0x8+-parseInt(_0x11f511(0x1b3))/0x9*(-parseInt(_0x11f511(0x1b4))/0xa);if(_0x28d752===_0x533671)break;else _0x2f13cf['push'](_0x2f13cf['shift']());}catch(_0x254aa8){_0x2f13cf['push'](_0x2f13cf['shift']());}}}(a27_0x59b1,0xc9886));function a27_0x59b1(){const _0x72e405=['2Lfsote','7666536GfwhCI','log','1046399xXpxrO','2860564XYfSqO','1773ddefca','30770xqyVab','9344460IlNhfS','4789005mrTtgm','25720mYNphd','auth.logout.notLoggedIn','327jrkuWH'];a27_0x59b1=function(){return _0x72e405;};return a27_0x59b1();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';import a27_0x2f33e6 from'../i18n/index.js';function a27_0x3d7d(_0x5ed97c,_0x19fd48){_0x5ed97c=_0x5ed97c-0x1b3;const _0x59b1a5=a27_0x59b1();let _0x3d7d7b=_0x59b1a5[_0x5ed97c];return _0x3d7d7b;}const t=a27_0x2f33e6['t']['bind'](a27_0x2f33e6);export function logout(){const _0x33091b=a27_0x3d7d;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x33091b(0x1bc)](t('auth.logout.success'))):console[_0x33091b(0x1bc)](t(_0x33091b(0x1b8)));}
|
package/lib/cli-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x14c8(){const _0x191412=['7931hdZzHY','136qfLmVt','6199074hLzeLQ','36066rjUVBk','27108dMsFqM','68CRfZXQ','11380YwOPul','625360VnuuJe','boolean','1130BWaYcq','17454RqtQVn','532356jIoKiJ'];a28_0x14c8=function(){return _0x191412;};return a28_0x14c8();}const a28_0xde0e8=a28_0x35e3;function a28_0x35e3(_0x3fa726,_0x2d5c04){_0x3fa726=_0x3fa726-0xa7;const _0x14c816=a28_0x14c8();let _0x35e3d3=_0x14c816[_0x3fa726];return _0x35e3d3;}(function(_0x29c4e0,_0x479674){const _0x537f3a=a28_0x35e3,_0x4dcb74=_0x29c4e0();while(!![]){try{const _0x55aa19=-parseInt(_0x537f3a(0xb2))/0x1+-parseInt(_0x537f3a(0xac))/0x2*(-parseInt(_0x537f3a(0xaa))/0x3)+-parseInt(_0x537f3a(0xae))/0x4+parseInt(_0x537f3a(0xb0))/0x5*(parseInt(_0x537f3a(0xb1))/0x6)+parseInt(_0x537f3a(0xa9))/0x7+-parseInt(_0x537f3a(0xa8))/0x8*(-parseInt(_0x537f3a(0xab))/0x9)+parseInt(_0x537f3a(0xad))/0xa*(-parseInt(_0x537f3a(0xa7))/0xb);if(_0x55aa19===_0x479674)break;else _0x4dcb74['push'](_0x4dcb74['shift']());}catch(_0x2c0aa0){_0x4dcb74['push'](_0x4dcb74['shift']());}}}(a28_0x14c8,0x788ce));export const dynamicCliFlags={'enableBffSave':{'type':a28_0xde0e8(0xaf)}};
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a29_0x5e1142=a29_0x5288;(function(_0x54114a,_0x52a9dc){const _0x4a5230=a29_0x5288,_0x499c37=_0x54114a();while(!![]){try{const _0xa11c46=-parseInt(_0x4a5230(0x1e6))/0x1*(-parseInt(_0x4a5230(0x210))/0x2)+-parseInt(_0x4a5230(0x1cb))/0x3+-parseInt(_0x4a5230(0x1e8))/0x4*(parseInt(_0x4a5230(0x1c4))/0x5)+-parseInt(_0x4a5230(0x1d5))/0x6+-parseInt(_0x4a5230(0x1e1))/0x7*(-parseInt(_0x4a5230(0x1d3))/0x8)+-parseInt(_0x4a5230(0x1f7))/0x9*(-parseInt(_0x4a5230(0x207))/0xa)+-parseInt(_0x4a5230(0x1d8))/0xb;if(_0xa11c46===_0x52a9dc)break;else _0x499c37['push'](_0x499c37['shift']());}catch(_0x3f57d0){_0x499c37['push'](_0x499c37['shift']());}}}(a29_0x5ce1,0xf1ed1));import{jsx as a29_0x267aa3}from'react/jsx-runtime';import a29_0x159f91 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{Init}from'./init/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';function a29_0x5ce1(){const _0x4f1da9=['mcp','error','create','skill-install','./cli-flags.js','menu-sync','start','logs','9758lpUNvq','执行更新菜单\x20CDN\x20资源命令','×\x20Interactive\x20mode\x20is\x20not\x20supported.\x20Please\x20specify\x20a\x20project\x20name:\x0a\x20\x20lovrabet\x20create\x20<project-name>\x0a\x20\x20lovrabet\x20create\x20<project-name>\x20--ci','setRawCommand','argv','37405gtlcOr','update','1948EOjQRM','join','help','env','startsWith','init','./create-app/non-interactive.js','logout','\x20(监听模式)','mcpCursor','skill','true','watch','isTTY','执行配置\x20MCP\x20命令','639FGYlHX','./mcp/mcp-install-non-interactive.js','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20在现有项目中初始化\x20.lovrabetrc\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x20初始化配置文件\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20同步菜单\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20更新菜单\x20CDN\x20资源\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并配置\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接配置\x20Cursor\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并安装技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接安装\x20Cursor\x20技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20安装多个技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20安装所有技能包\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','执行构建命令','isRaw','mcpClaude','stdout','mcpOther','codebuddy','cursor','flags','×\x20当前终端不支持交互模式,请指定项目名创建:\x0a\x20\x20lovrabet\x20create\x20<项目名>\x0a\x20\x20lovrabet\x20create\x20<项目名>\x20--ci','antigravity','length','setRawMode','×\x20当前终端不支持交互模式(stdin\x20raw\x20mode\x20不可用)。\x0a\x20\x20请使用支持交互的终端(如\x20Windows\x20Terminal、PowerShell),\x0a\x20\x20或使用非交互模式:lovrabet\x20<command>\x20--ci','266710MKyWeY','stdin','opencode','./skills/skill-install-non-interactive.js','boolean','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Authentication\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Logout\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Initialize\x20.lovrabetrc\x20config\x20in\x20existing\x20project\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Initialize\x20with\x20specified\x20appcode\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Create\x20a\x20new\x20project\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Start\x20project\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Build\x20project\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Sync\x20menu\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Update\x20menu\x20CDN\x20resources\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Preview\x20project\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Watch\x20mode\x20for\x20preview\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Project\x20configuration\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20and\x20generate\x20API\x20config\x20(see:\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20API\x20documentation\x20(see:\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Interactive\x20MCP\x20configuration\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Configure\x20Cursor\x20MCP\x20directly\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Interactive\x20skill\x20installation\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Install\x20Cursor\x20skill\x20directly\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20Install\x20multiple\x20skills\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Install\x20all\x20skills\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20View\x20logs\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Clear\x20logs\x0a','cline','qoder','setLogPath','82wEjrzB','windsurf','×\x20Interactive\x20mode\x20is\x20not\x20supported\x20in\x20this\x20terminal\x20(stdin\x20raw\x20mode\x20unavailable).\x0a\x20\x20Please\x20use\x20a\x20terminal\x20that\x20supports\x20interactive\x20input\x20(e.g.\x20Windows\x20Terminal,\x20PowerShell),\x0a\x20\x20or\x20use\x20non-interactive\x20mode:\x20lovrabet\x20<command>\x20--ci','cwd','exit','trim','执行初始化配置命令','执行安装技能包命令','./skills/main.js','执行启动命令','slice','7915aePZOd','push','string','mcp-install','appcode','agent','build','4485987ZQUngg','claude','input','info','menu-update-cdn','codex','执行预览命令','preview','11064bhYbuN','all','8968134wQIpsn','other','--help','6636080HCMXFU'];a29_0x5ce1=function(){return _0x4f1da9;};return a29_0x5ce1();}import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';import{AppMenuSyncUI}from'./app-menu/app-menu-sync-ui.js';function a29_0x5288(_0x1f7692,_0x5d27d4){_0x1f7692=_0x1f7692-0x1c1;const _0x5ce11b=a29_0x5ce1();let _0x528876=_0x5ce11b[_0x1f7692];return _0x528876;}import{mcpCommand}from'./mcp/main.js';import{AppMenuUpdateCdn}from'./app-menu-update-cdn/main.js';import{skillsCommand}from'./skills/main.js';import{SkillInstallUI}from'./skills/SkillInstallUI.js';import{McpInstallUI}from'./mcp/McpInstallUI.js';import{I18nProvider}from'./i18n/I18nProvider.js';import{detectSystemLanguage,getLanguageFromFlags}from'./i18n/index.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import(a29_0x5e1142(0x1dd)))['dynamicCliFlags'];}catch{}const mergedFlags={...dynamicCliFlags||{}},helpTexts={'zh-CN':a29_0x5e1142(0x1f9),'en-US':a29_0x5e1142(0x20c)},systemLanguage=detectSystemLanguage();function isStdinRawModeSupported(){const _0x9a1a56=a29_0x5e1142;if(!process['stdin']['isTTY'])return![];try{const _0x5cd25d=process[_0x9a1a56(0x208)][_0x9a1a56(0x1fb)];return process[_0x9a1a56(0x208)][_0x9a1a56(0x205)](!![]),process['stdin'][_0x9a1a56(0x205)](_0x5cd25d??![]),!![];}catch{return![];}}function isNonInteractiveMode(_0x356a1f){const _0x545770=a29_0x5e1142;return!!(_0x356a1f['nonInteractive']||_0x356a1f['ci']||process[_0x545770(0x1eb)]['LOVRABET_CI']===_0x545770(0x1f3)||process[_0x545770(0x1eb)]['CI']==='true'||!process[_0x545770(0x1fd)][_0x545770(0x1f5)]||!isStdinRawModeSupported());}function getLanguage(_0x30056f){const _0x49861b=getLanguageFromFlags(_0x30056f);return _0x49861b||undefined;}function renderWithI18n(_0x445eef,_0x143de6){const _0x4e399b=a29_0x5e1142;return!isStdinRawModeSupported()&&(console[_0x4e399b(0x1da)](_0x143de6?.[_0x4e399b(0x1ec)]('zh')?_0x4e399b(0x206):_0x4e399b(0x212)),process['exit'](0x1)),render(a29_0x267aa3(I18nProvider,{'language':_0x143de6,'children':_0x445eef}));}const cli=a29_0x159f91(helpTexts[systemLanguage],{'importMeta':import.meta,'flags':{'name':{'type':a29_0x5e1142(0x1c6)},'clear':{'type':a29_0x5e1142(0x20b)},'env':{'type':a29_0x5e1142(0x1c6)},'watch':{'type':a29_0x5e1142(0x20b)},'help':{'type':'boolean'},'appcode':{'type':a29_0x5e1142(0x1c6)},'output':{'type':a29_0x5e1142(0x1c6)},'params':{'type':a29_0x5e1142(0x1c6)},'datasetcode':{'type':a29_0x5e1142(0x1c6)},'mcpCursor':{'type':'boolean'},'mcpClaude':{'type':a29_0x5e1142(0x20b)},'mcpOther':{'type':a29_0x5e1142(0x20b)},'cursor':{'type':'boolean'},'windsurf':{'type':'boolean'},'claude':{'type':a29_0x5e1142(0x20b)},'cline':{'type':a29_0x5e1142(0x20b)},'codex':{'type':'boolean'},'opencode':{'type':a29_0x5e1142(0x20b)},'qoder':{'type':'boolean'},'codebuddy':{'type':a29_0x5e1142(0x20b)},'trae':{'type':a29_0x5e1142(0x20b)},'agent':{'type':a29_0x5e1142(0x20b)},'antigravity':{'type':a29_0x5e1142(0x20b)},'all':{'type':a29_0x5e1142(0x20b)},'nonInteractive':{'type':a29_0x5e1142(0x20b)},'ci':{'type':a29_0x5e1142(0x20b)},'lang':{'type':a29_0x5e1142(0x1c6)},...mergedFlags},'autoVersion':!![]});await run();async function run(){const _0x1df44c=a29_0x5e1142,_0x1c01ff=cli[_0x1df44c(0x1cd)][0x0],_0x59e500=cli[_0x1df44c(0x1cd)][0x1],_0x30af5e=cli['input'][0x2],_0x14754a=getLanguage(cli[_0x1df44c(0x201)]),_0x4490f7=('lovrabet\x20'+process[_0x1df44c(0x1e5)][_0x1df44c(0x1c3)](0x2)[_0x1df44c(0x1e9)]('\x20'))[_0x1df44c(0x215)]();logger[_0x1df44c(0x1e4)](_0x4490f7);switch(_0x1c01ff){case _0x1df44c(0x1ed):{const _0x5ba717=cli['flags'][_0x1df44c(0x1c8)],_0x2fd8a0=cli[_0x1df44c(0x201)][_0x1df44c(0x1eb)];logger[_0x1df44c(0x20f)](process[_0x1df44c(0x213)]()),logger[_0x1df44c(0x1ce)]('init',_0x1df44c(0x216)),renderWithI18n(a29_0x267aa3(Init,{'appcode':_0x5ba717,'env':_0x2fd8a0}),_0x14754a);break;}case'create':{const _0x343594=cli[_0x1df44c(0x1cd)][0x1]?.[_0x1df44c(0x215)](),_0xc5675c=cli['flags'][_0x1df44c(0x1eb)],_0x2a2ebd=isNonInteractiveMode(cli[_0x1df44c(0x201)]);if(_0x2a2ebd&&_0x343594){logger[_0x1df44c(0x20f)](process[_0x1df44c(0x213)]()),logger[_0x1df44c(0x1ce)](_0x1df44c(0x1db),'非交互模式创建项目:\x20'+_0x343594);const {createProjectNonInteractive:_0x48a1e4}=await import(_0x1df44c(0x1ee));await _0x48a1e4(_0x343594,_0xc5675c);}else _0x2a2ebd&&!_0x343594?(console[_0x1df44c(0x1da)](_0x14754a?.[_0x1df44c(0x1ec)]('zh')?_0x1df44c(0x202):_0x1df44c(0x1e3)),process[_0x1df44c(0x214)](0x1)):renderWithI18n(a29_0x267aa3(CreateApp,{'projectCode':_0x343594,'env':_0xc5675c}),_0x14754a);break;}case _0x1df44c(0x1df):{try{logger[_0x1df44c(0x20f)](process['cwd']()),logger[_0x1df44c(0x1ce)](_0x1df44c(0x1df),_0x1df44c(0x1c2)),await runStart();}catch(_0x2408c3){console[_0x1df44c(0x1da)](_0x2408c3),process[_0x1df44c(0x214)](0x1);}break;}case _0x1df44c(0x1ca):{try{logger['setLogPath'](process[_0x1df44c(0x213)]()),logger[_0x1df44c(0x1ce)](_0x1df44c(0x1ca),_0x1df44c(0x1fa)),await runBuild();}catch(_0x22cd42){console['error'](_0x22cd42),process[_0x1df44c(0x214)](0x1);}break;}case _0x1df44c(0x1d2):{const _0x582c9c=cli[_0x1df44c(0x201)][_0x1df44c(0x1f4)];logger[_0x1df44c(0x20f)](process['cwd']()),logger[_0x1df44c(0x1ce)](_0x1df44c(0x1d2),_0x1df44c(0x1d1)+(_0x582c9c?_0x1df44c(0x1f0):''));if(_0x582c9c)try{await Promise[_0x1df44c(0x1d4)]([runBuildWatch(),runPreview()]);}catch(_0x423617){console[_0x1df44c(0x1da)](_0x423617),process['exit'](0x1);}else try{await runPreview();}catch(_0x4747ee){console[_0x1df44c(0x1da)](_0x4747ee),process[_0x1df44c(0x214)](0x1);}break;}case'config':{renderWithI18n(a29_0x267aa3(Config,{'cli':cli}),_0x14754a);break;}case'api':{await apiCli(cli);break;}case'auth':{renderWithI18n(a29_0x267aa3(AuthServer,{}),_0x14754a);break;}case'menu':{if(_0x59e500===_0x1df44c(0x1e7)){logger['setLogPath'](process[_0x1df44c(0x213)]()),logger[_0x1df44c(0x1ce)](_0x1df44c(0x1cf),_0x1df44c(0x1e2)),renderWithI18n(a29_0x267aa3(AppMenuUpdateCdn,{}),_0x14754a);break;}else logger[_0x1df44c(0x20f)](process[_0x1df44c(0x213)]()),logger['info'](_0x1df44c(0x1de),'同步菜单命令'),renderWithI18n(a29_0x267aa3(AppMenuSyncUI,{}),_0x14754a);break;}case _0x1df44c(0x1ef):{logout();break;}case _0x1df44c(0x1d9):{const _0x1ed886=cli[_0x1df44c(0x1cd)][0x1];logger[_0x1df44c(0x20f)](process[_0x1df44c(0x213)]());if(_0x1ed886==='install'){const _0x31ccab=[];if(cli['flags'][_0x1df44c(0x1f1)]||cli[_0x1df44c(0x201)][_0x1df44c(0x200)])_0x31ccab[_0x1df44c(0x1c5)]('cursor');if(cli[_0x1df44c(0x201)][_0x1df44c(0x1fc)]||cli[_0x1df44c(0x201)][_0x1df44c(0x1cc)])_0x31ccab[_0x1df44c(0x1c5)](_0x1df44c(0x1cc));if(cli['flags'][_0x1df44c(0x1fe)])_0x31ccab[_0x1df44c(0x1c5)](_0x1df44c(0x1d6));logger[_0x1df44c(0x1ce)](_0x1df44c(0x1c7),_0x1df44c(0x1f6),{'preselected':_0x31ccab});if(isNonInteractiveMode(cli[_0x1df44c(0x201)])&&_0x31ccab[_0x1df44c(0x204)]>0x0){const {installMcpNonInteractive:_0x3c6314}=await import(_0x1df44c(0x1f8));await _0x3c6314(_0x31ccab);}else renderWithI18n(a29_0x267aa3(McpInstallUI,{'preselectedIDEs':_0x31ccab}),_0x14754a);}else _0x1ed886===_0x1df44c(0x1d7)||cli[_0x1df44c(0x201)][_0x1df44c(0x1ea)]?await mcpCommand(_0x1ed886,[],{'help':!![]}):await mcpCommand(_0x1ed886,[],cli[_0x1df44c(0x201)]);break;}case _0x1df44c(0x1f2):{const _0x2e125a=cli[_0x1df44c(0x1cd)][0x1];logger[_0x1df44c(0x20f)](process[_0x1df44c(0x213)]());if(_0x2e125a==='install'){const _0x3cfb50=[];if(cli[_0x1df44c(0x201)][_0x1df44c(0x1d4)])_0x3cfb50['push'](_0x1df44c(0x200),_0x1df44c(0x211),_0x1df44c(0x1cc),_0x1df44c(0x20d),_0x1df44c(0x1d0),_0x1df44c(0x209),_0x1df44c(0x20e),_0x1df44c(0x1ff),'trae',_0x1df44c(0x1c9),_0x1df44c(0x203));else{if(cli[_0x1df44c(0x201)][_0x1df44c(0x200)])_0x3cfb50[_0x1df44c(0x1c5)](_0x1df44c(0x200));if(cli['flags'][_0x1df44c(0x211)])_0x3cfb50['push'](_0x1df44c(0x211));if(cli[_0x1df44c(0x201)][_0x1df44c(0x1cc)])_0x3cfb50['push'](_0x1df44c(0x1cc));if(cli[_0x1df44c(0x201)][_0x1df44c(0x20d)])_0x3cfb50[_0x1df44c(0x1c5)]('cline');if(cli[_0x1df44c(0x201)][_0x1df44c(0x1d0)])_0x3cfb50[_0x1df44c(0x1c5)](_0x1df44c(0x1d0));if(cli['flags'][_0x1df44c(0x209)])_0x3cfb50[_0x1df44c(0x1c5)]('opencode');if(cli[_0x1df44c(0x201)][_0x1df44c(0x20e)])_0x3cfb50[_0x1df44c(0x1c5)]('qoder');if(cli[_0x1df44c(0x201)]['codebuddy'])_0x3cfb50[_0x1df44c(0x1c5)]('codebuddy');if(cli[_0x1df44c(0x201)]['trae'])_0x3cfb50['push']('trae');if(cli[_0x1df44c(0x201)][_0x1df44c(0x1c9)])_0x3cfb50['push'](_0x1df44c(0x1c9));if(cli[_0x1df44c(0x201)]['antigravity'])_0x3cfb50[_0x1df44c(0x1c5)]('antigravity');}const {getAllProvidedFlags:_0x18cddf}=await import(_0x1df44c(0x1c1)),_0x408746=_0x18cddf(cli[_0x1df44c(0x201)]);logger[_0x1df44c(0x1ce)](_0x1df44c(0x1dc),_0x1df44c(0x217),{'preselected':_0x3cfb50,'providedFlags':_0x408746});if(isNonInteractiveMode(cli[_0x1df44c(0x201)])&&_0x3cfb50['length']>0x0){const {installSkillsNonInteractive:_0x25e772}=await import(_0x1df44c(0x20a));await _0x25e772(_0x3cfb50,_0x408746);}else renderWithI18n(a29_0x267aa3(SkillInstallUI,{'preselectedIDEs':_0x3cfb50,'providedFlags':_0x408746}),_0x14754a);}else _0x2e125a===_0x1df44c(0x1d7)||cli[_0x1df44c(0x201)][_0x1df44c(0x1ea)]?await skillsCommand(_0x2e125a,[],{'help':!![]}):await skillsCommand(_0x2e125a,[],cli[_0x1df44c(0x201)]);break;}case _0x1df44c(0x1e0):{cli[_0x1df44c(0x201)]['clear']?clearLogs():showLogs();break;}default:renderWithI18n(a29_0x267aa3(Help,{}),_0x14754a);break;}}
|
|
2
|
+
const a29_0x481cb8=a29_0x1e4a;(function(_0x5b690d,_0xd34685){const _0x43ceed=a29_0x1e4a,_0x2dbbb2=_0x5b690d();while(!![]){try{const _0x5f1140=parseInt(_0x43ceed(0xc0))/0x1*(-parseInt(_0x43ceed(0xc1))/0x2)+parseInt(_0x43ceed(0xb0))/0x3*(-parseInt(_0x43ceed(0xbc))/0x4)+-parseInt(_0x43ceed(0xec))/0x5*(-parseInt(_0x43ceed(0xad))/0x6)+-parseInt(_0x43ceed(0xce))/0x7+-parseInt(_0x43ceed(0xed))/0x8*(-parseInt(_0x43ceed(0xde))/0x9)+parseInt(_0x43ceed(0xc4))/0xa+-parseInt(_0x43ceed(0xe0))/0xb*(-parseInt(_0x43ceed(0xc7))/0xc);if(_0x5f1140===_0xd34685)break;else _0x2dbbb2['push'](_0x2dbbb2['shift']());}catch(_0xd1eee4){_0x2dbbb2['push'](_0x2dbbb2['shift']());}}}(a29_0x4593,0xded85));import{jsx as a29_0x776b4c}from'react/jsx-runtime';import a29_0x161c8c from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{Init}from'./init/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';function a29_0x4593(){const _0x280ed5=['skill.install.npxFailed','trim','44576AREYkf','setRawCommand','skill','nonInteractive','5OVKiLi','83550xSwdfg','./skills/npx-skills-add.js','init','6391960yLbkcm','preview','skill.install.npxSkippedEnv','96CQYEJA','skill.install.npxIntro','isRaw','stdin','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20在现有项目中初始化\x20.lovrabetrc\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x20初始化配置文件\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20同步菜单\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20更新菜单\x20CDN\x20资源\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并配置\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接配置\x20Cursor\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并安装技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接安装\x20Cursor\x20技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20安装多个技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20安装所有技能包\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','input','执行安装技能包命令(委托给\x20npx\x20skills)','4788315FpzVKX','inherit','config','claude','mcp-install','create','enableBffSave','start','push','cwd','setLogPath','lovrabet\x20','join','dynamicCliFlags','./create-app/non-interactive.js','watch','225999rVVYMD','执行更新菜单\x20CDN\x20资源命令','1065592PTCGbX','logout','help','auth','log','env','update','flags','同步菜单命令','install','appcode','mcpCursor','625ExChWD','272aehgHS','string','startsWith','./cli-flags.js','\x20(监听模式)','mcpOther','error','boolean','true','build','logs','menu-sync','argv','LOVRABET_CI','exit','skill.install.npxDone','执行预览命令','37722ttdMYS','info','setRawMode','336WStbsO','执行初始化配置命令','./mcp/mcp-install-non-interactive.js','×\x20Interactive\x20mode\x20is\x20not\x20supported.\x20Please\x20specify\x20a\x20project\x20name:\x0a\x20\x20lovrabet\x20create\x20<project-name>\x0a\x20\x20lovrabet\x20create\x20<project-name>\x20--ci','mcpClaude','pipe','isTTY','mcp','length','--help'];a29_0x4593=function(){return _0x280ed5;};return a29_0x4593();}import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';import{AppMenuSyncUI}from'./app-menu/app-menu-sync-ui.js';import{mcpCommand}from'./mcp/main.js';import{AppMenuUpdateCdn}from'./app-menu-update-cdn/main.js';import{skillsCommand}from'./skills/main.js';import{McpInstallUI}from'./mcp/McpInstallUI.js';import{I18nProvider}from'./i18n/I18nProvider.js';import{detectSystemLanguage,getLanguageFromFlags}from'./i18n/index.js';import a29_0x16bc3c from'./i18n/index.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import(a29_0x481cb8(0xf0)))[a29_0x481cb8(0xdb)];}catch{}const mergedFlags={...dynamicCliFlags||{}},helpTexts={'zh-CN':a29_0x481cb8(0xcb),'en-US':'\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Authentication\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Logout\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Initialize\x20.lovrabetrc\x20config\x20in\x20existing\x20project\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Initialize\x20with\x20specified\x20appcode\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Create\x20a\x20new\x20project\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Start\x20project\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Build\x20project\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Sync\x20menu\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Update\x20menu\x20CDN\x20resources\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Preview\x20project\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Watch\x20mode\x20for\x20preview\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Project\x20configuration\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20and\x20generate\x20API\x20config\x20(see:\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20API\x20documentation\x20(see:\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Interactive\x20MCP\x20configuration\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Configure\x20Cursor\x20MCP\x20directly\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Interactive\x20skill\x20installation\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Install\x20Cursor\x20skill\x20directly\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20Install\x20multiple\x20skills\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Install\x20all\x20skills\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20View\x20logs\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Clear\x20logs\x0a'},systemLanguage=detectSystemLanguage();function isStdinRawModeSupported(){const _0x24b04d=a29_0x481cb8;if(!process['stdin'][_0x24b04d(0xb6)])return![];try{const _0x24546e=process[_0x24b04d(0xca)][_0x24b04d(0xc9)];return process[_0x24b04d(0xca)][_0x24b04d(0xaf)](!![]),process[_0x24b04d(0xca)][_0x24b04d(0xaf)](_0x24546e??![]),!![];}catch{return![];}}function isNonInteractiveMode(_0x53c842){const _0x4addb4=a29_0x481cb8;return!!(_0x53c842[_0x4addb4(0xbf)]||_0x53c842['ci']||process[_0x4addb4(0xe5)][_0x4addb4(0xa9)]===_0x4addb4(0xf5)||process[_0x4addb4(0xe5)]['CI']==='true'||!process['stdout'][_0x4addb4(0xb6)]||!isStdinRawModeSupported());}function getLanguage(_0x4166b4){const _0x4c40d4=getLanguageFromFlags(_0x4166b4);return _0x4c40d4||undefined;}function renderWithI18n(_0xa1cb0e,_0xcf7044){const _0x191d70=a29_0x481cb8;return!isStdinRawModeSupported()&&(console[_0x191d70(0xf3)](_0xcf7044?.['startsWith']('zh')?'×\x20当前终端不支持交互模式(stdin\x20raw\x20mode\x20不可用)。\x0a\x20\x20请使用支持交互的终端(如\x20Windows\x20Terminal、PowerShell),\x0a\x20\x20或使用非交互模式:lovrabet\x20<command>\x20--ci':'×\x20Interactive\x20mode\x20is\x20not\x20supported\x20in\x20this\x20terminal\x20(stdin\x20raw\x20mode\x20unavailable).\x0a\x20\x20Please\x20use\x20a\x20terminal\x20that\x20supports\x20interactive\x20input\x20(e.g.\x20Windows\x20Terminal,\x20PowerShell),\x0a\x20\x20or\x20use\x20non-interactive\x20mode:\x20lovrabet\x20<command>\x20--ci'),process['exit'](0x1)),render(a29_0x776b4c(I18nProvider,{'language':_0xcf7044,'children':_0xa1cb0e}));}const cli=a29_0x161c8c(helpTexts[systemLanguage],{'importMeta':import.meta,'flags':{'name':{'type':a29_0x481cb8(0xee)},'clear':{'type':a29_0x481cb8(0xf4)},'env':{'type':a29_0x481cb8(0xee)},'watch':{'type':a29_0x481cb8(0xf4)},'help':{'type':a29_0x481cb8(0xf4)},'appcode':{'type':a29_0x481cb8(0xee)},'output':{'type':a29_0x481cb8(0xee)},'params':{'type':'string'},'datasetcode':{'type':a29_0x481cb8(0xee)},'mcpCursor':{'type':'boolean'},'mcpClaude':{'type':a29_0x481cb8(0xf4)},'mcpOther':{'type':a29_0x481cb8(0xf4)},'cursor':{'type':a29_0x481cb8(0xf4)},'windsurf':{'type':a29_0x481cb8(0xf4)},'claude':{'type':a29_0x481cb8(0xf4)},'cline':{'type':'boolean'},'codex':{'type':'boolean'},'opencode':{'type':a29_0x481cb8(0xf4)},'qoder':{'type':a29_0x481cb8(0xf4)},'codebuddy':{'type':'boolean'},'trae':{'type':a29_0x481cb8(0xf4)},'agent':{'type':'boolean'},'antigravity':{'type':a29_0x481cb8(0xf4)},'all':{'type':a29_0x481cb8(0xf4)},'enableBffSave':{'type':a29_0x481cb8(0xf4)},'nonInteractive':{'type':a29_0x481cb8(0xf4)},'ci':{'type':a29_0x481cb8(0xf4)},'lang':{'type':a29_0x481cb8(0xee)},...mergedFlags},'autoVersion':!![]});await run();function a29_0x1e4a(_0x29e979,_0x4e94b8){_0x29e979=_0x29e979-0xa8;const _0x4593bc=a29_0x4593();let _0x1e4aca=_0x4593bc[_0x29e979];return _0x1e4aca;}async function run(){const _0x40a0f5=a29_0x481cb8,_0x15096f=cli[_0x40a0f5(0xcc)][0x0],_0x118ab6=cli[_0x40a0f5(0xcc)][0x1],_0x23896c=cli[_0x40a0f5(0xcc)][0x2],_0x311c8b=getLanguage(cli[_0x40a0f5(0xe7)]),_0x5e5c62=(_0x40a0f5(0xd9)+process[_0x40a0f5(0xa8)]['slice'](0x2)[_0x40a0f5(0xda)]('\x20'))[_0x40a0f5(0xbb)]();logger[_0x40a0f5(0xbd)](_0x5e5c62);switch(_0x15096f){case _0x40a0f5(0xc3):{const _0x1df901=cli[_0x40a0f5(0xe7)][_0x40a0f5(0xea)],_0x9406a9=cli[_0x40a0f5(0xe7)][_0x40a0f5(0xe5)];logger[_0x40a0f5(0xd8)](process[_0x40a0f5(0xd7)]()),logger[_0x40a0f5(0xae)]('init',_0x40a0f5(0xb1)),renderWithI18n(a29_0x776b4c(Init,{'appcode':_0x1df901,'env':_0x9406a9}),_0x311c8b);break;}case _0x40a0f5(0xd3):{const _0x5a146d=cli[_0x40a0f5(0xcc)][0x1]?.[_0x40a0f5(0xbb)](),_0x639c44=cli['flags']['env'],_0x4d1d84=isNonInteractiveMode(cli[_0x40a0f5(0xe7)]);if(_0x4d1d84&&_0x5a146d){logger[_0x40a0f5(0xd8)](process[_0x40a0f5(0xd7)]()),logger['info'](_0x40a0f5(0xd3),'非交互模式创建项目:\x20'+_0x5a146d);const {createProjectNonInteractive:_0x44607c}=await import(_0x40a0f5(0xdc));await _0x44607c(_0x5a146d,_0x639c44);}else _0x4d1d84&&!_0x5a146d?(console[_0x40a0f5(0xf3)](_0x311c8b?.[_0x40a0f5(0xef)]('zh')?'×\x20当前终端不支持交互模式,请指定项目名创建:\x0a\x20\x20lovrabet\x20create\x20<项目名>\x0a\x20\x20lovrabet\x20create\x20<项目名>\x20--ci':_0x40a0f5(0xb3)),process[_0x40a0f5(0xaa)](0x1)):renderWithI18n(a29_0x776b4c(CreateApp,{'projectCode':_0x5a146d,'env':_0x639c44}),_0x311c8b);break;}case _0x40a0f5(0xd5):{try{logger['setLogPath'](process[_0x40a0f5(0xd7)]()),logger[_0x40a0f5(0xae)](_0x40a0f5(0xd5),'执行启动命令'),await runStart();}catch(_0x3263a2){console[_0x40a0f5(0xf3)](_0x3263a2),process['exit'](0x1);}break;}case _0x40a0f5(0xf6):{try{logger['setLogPath'](process[_0x40a0f5(0xd7)]()),logger['info'](_0x40a0f5(0xf6),'执行构建命令'),await runBuild();}catch(_0x194669){console[_0x40a0f5(0xf3)](_0x194669),process['exit'](0x1);}break;}case _0x40a0f5(0xc5):{const _0x53b066=cli[_0x40a0f5(0xe7)][_0x40a0f5(0xdd)];logger['setLogPath'](process['cwd']()),logger[_0x40a0f5(0xae)](_0x40a0f5(0xc5),_0x40a0f5(0xac)+(_0x53b066?_0x40a0f5(0xf1):''));if(_0x53b066)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x542875){console[_0x40a0f5(0xf3)](_0x542875),process['exit'](0x1);}else try{await runPreview();}catch(_0x38693a){console[_0x40a0f5(0xf3)](_0x38693a),process[_0x40a0f5(0xaa)](0x1);}break;}case _0x40a0f5(0xd0):{renderWithI18n(a29_0x776b4c(Config,{'cli':cli}),_0x311c8b);break;}case'api':{await apiCli(cli);break;}case _0x40a0f5(0xe3):{renderWithI18n(a29_0x776b4c(AuthServer,{}),_0x311c8b);break;}case'menu':{if(_0x118ab6===_0x40a0f5(0xe6)){logger[_0x40a0f5(0xd8)](process[_0x40a0f5(0xd7)]()),logger['info']('menu-update-cdn',_0x40a0f5(0xdf)),renderWithI18n(a29_0x776b4c(AppMenuUpdateCdn,{}),_0x311c8b);break;}else logger[_0x40a0f5(0xd8)](process[_0x40a0f5(0xd7)]()),logger[_0x40a0f5(0xae)](_0x40a0f5(0xf8),_0x40a0f5(0xe8)),renderWithI18n(a29_0x776b4c(AppMenuSyncUI,{}),_0x311c8b);break;}case _0x40a0f5(0xe1):{logout();break;}case _0x40a0f5(0xb7):{const _0x4eaf18=cli[_0x40a0f5(0xcc)][0x1];logger[_0x40a0f5(0xd8)](process[_0x40a0f5(0xd7)]());if(_0x4eaf18==='install'){const _0x56cb67=[];if(cli[_0x40a0f5(0xe7)][_0x40a0f5(0xeb)]||cli[_0x40a0f5(0xe7)]['cursor'])_0x56cb67[_0x40a0f5(0xd6)]('cursor');if(cli['flags'][_0x40a0f5(0xb4)]||cli['flags'][_0x40a0f5(0xd1)])_0x56cb67[_0x40a0f5(0xd6)]('claude');if(cli[_0x40a0f5(0xe7)][_0x40a0f5(0xf2)])_0x56cb67[_0x40a0f5(0xd6)]('other');logger[_0x40a0f5(0xae)](_0x40a0f5(0xd2),'执行配置\x20MCP\x20命令',{'preselected':_0x56cb67});if(isNonInteractiveMode(cli['flags'])&&_0x56cb67[_0x40a0f5(0xb8)]>0x0){const {installMcpNonInteractive:_0x19e73c}=await import(_0x40a0f5(0xb2));await _0x19e73c(_0x56cb67,cli['flags'][_0x40a0f5(0xd4)]);}else renderWithI18n(a29_0x776b4c(McpInstallUI,{'preselectedIDEs':_0x56cb67,'enableBffSave':cli['flags'][_0x40a0f5(0xd4)]}),_0x311c8b);}else _0x4eaf18===_0x40a0f5(0xb9)||cli['flags'][_0x40a0f5(0xe2)]?await mcpCommand(_0x4eaf18,[],{'help':!![]}):await mcpCommand(_0x4eaf18,[],cli[_0x40a0f5(0xe7)]);break;}case _0x40a0f5(0xbe):case'skills':{const _0x375e30=cli['input'][0x1];logger[_0x40a0f5(0xd8)](process[_0x40a0f5(0xd7)]());if(_0x375e30===_0x40a0f5(0xe9)){logger[_0x40a0f5(0xd8)](process['cwd']()),logger[_0x40a0f5(0xae)]('skill-install',_0x40a0f5(0xcd));const {runNpxSkillsAdd:_0x3ee0a8}=await import(_0x40a0f5(0xc2)),_0x3a05ba=isNonInteractiveMode(cli[_0x40a0f5(0xe7)])?_0x40a0f5(0xb5):_0x40a0f5(0xcf);console['log'](a29_0x16bc3c['t'](_0x40a0f5(0xc8)));const _0x17dd1e=_0x3ee0a8(process[_0x40a0f5(0xd7)](),{'stdio':_0x3a05ba});if(_0x17dd1e['skipped'])console[_0x40a0f5(0xe4)](a29_0x16bc3c['t'](_0x40a0f5(0xc6)));else _0x17dd1e['ok']?console[_0x40a0f5(0xe4)](a29_0x16bc3c['t'](_0x40a0f5(0xab))):(console[_0x40a0f5(0xf3)](a29_0x16bc3c['t'](_0x40a0f5(0xba),{'error':_0x17dd1e[_0x40a0f5(0xf3)]||'unknown'})),process['exit'](0x1));}else _0x375e30===_0x40a0f5(0xb9)||cli[_0x40a0f5(0xe7)][_0x40a0f5(0xe2)]?await skillsCommand(_0x375e30,[],{'help':!![]}):await skillsCommand(_0x375e30,[],cli[_0x40a0f5(0xe7)]);break;}case _0x40a0f5(0xf7):{cli[_0x40a0f5(0xe7)]['clear']?clearLogs():showLogs();break;}default:renderWithI18n(a29_0x776b4c(Help,{}),_0x311c8b);break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x57dc90,_0x5a3c4d){const _0xf676d2=a30_0x2863,_0x30c341=_0x57dc90();while(!![]){try{const _0x1cbd5c=parseInt(_0xf676d2(0x1b5))/0x1+parseInt(_0xf676d2(0x1b4))/0x2+-parseInt(_0xf676d2(0x1bb))/0x3+-parseInt(_0xf676d2(0x1b0))/0x4*(-parseInt(_0xf676d2(0x1ae))/0x5)+-parseInt(_0xf676d2(0x1be))/0x6*(parseInt(_0xf676d2(0x1b2))/0x7)+-parseInt(_0xf676d2(0x1b8))/0x8*(-parseInt(_0xf676d2(0x1af))/0x9)+-parseInt(_0xf676d2(0x1ad))/0xa;if(_0x1cbd5c===_0x5a3c4d)break;else _0x30c341['push'](_0x30c341['shift']());}catch(_0xae2ad4){_0x30c341['push'](_0x30c341['shift']());}}}(a30_0x539b,0xa519c));function a30_0x539b(){const _0x3f9bd0=['error','610561WxpWay','build','1927078KabrKr','523974OELQud','env','PATH','563144hQMzRR','npm\x20run\x20build\x20exited\x20with\x20code\x20','node_modules','1977060nMlEln','close','.bin','60UbZvRt','vite','inherit','13109530jkIrBz','4320vqtvpn','126QVFZRH','4840XEZXNA'];a30_0x539b=function(){return _0x3f9bd0;};return a30_0x539b();}import{spawn}from'node:child_process';import{delimiter,join}from'node:path';function a30_0x2863(_0x2a0159,_0xd6eb30){_0x2a0159=_0x2a0159-0x1ad;const _0x539bbe=a30_0x539b();let _0x28630d=_0x539bbe[_0x2a0159];return _0x28630d;}export function runBuildWatch(){return new Promise((_0x58346c,_0x5acc1c)=>{const _0x2e799d=a30_0x2863,_0x2b12c7=spawn(_0x2e799d(0x1bf),[_0x2e799d(0x1b3),'--watch'],{'stdio':_0x2e799d(0x1c0),'shell':!![],'env':{...process[_0x2e799d(0x1b6)],'PATH':''+join(process['cwd'](),_0x2e799d(0x1ba),_0x2e799d(0x1bd))+delimiter+process[_0x2e799d(0x1b6)][_0x2e799d(0x1b7)]}});_0x2b12c7['on'](_0x2e799d(0x1bc),_0x3d8508=>{const _0x7a3a26=_0x2e799d;if(_0x3d8508===0x0||_0x3d8508===null)_0x58346c();else _0x5acc1c(new Error(_0x7a3a26(0x1b9)+_0x3d8508));}),_0x2b12c7['on'](_0x2e799d(0x1b1),_0x5acc1c);});}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a31_0x380c(){const _0x1f5c2b=['1236732VmcUMs','npm\x20run\x20build','npm','30dfjEDu','988236Kpjalo','63sbmabc','项目构建出错','5858310pFSHPV','message','cwd','toString','trim','1974952bAuIhK','data','success','node_modules','error','npm\x20run\x20build\x20exited\x20with\x20code\x20','开始构建项目','8723728LJIRQL','6vFGkvF','inherit','33ounuzx','now','build','1209550eMWJKg','env','183559LSrTYN','stderr','项目构建成功','.bin','63NrtThf','48aVuQwS'];a31_0x380c=function(){return _0x1f5c2b;};return a31_0x380c();}(function(_0x12ef6c,_0x803486){const _0x212818=a31_0x32c1,_0x37609c=_0x12ef6c();while(!![]){try{const _0x5b75ec=parseInt(_0x212818(0x1b4))/0x1+-parseInt(_0x212818(0x1b2))/0x2*(-parseInt(_0x212818(0x1ad))/0x3)+parseInt(_0x212818(0x19d))/0x4*(-parseInt(_0x212818(0x19c))/0x5)+parseInt(_0x212818(0x199))/0x6*(parseInt(_0x212818(0x197))/0x7)+parseInt(_0x212818(0x1a5))/0x8*(-parseInt(_0x212818(0x19e))/0x9)+parseInt(_0x212818(0x1a0))/0xa*(-parseInt(_0x212818(0x1af))/0xb)+parseInt(_0x212818(0x198))/0xc*(parseInt(_0x212818(0x1ac))/0xd);if(_0x5b75ec===_0x803486)break;else _0x37609c['push'](_0x37609c['shift']());}catch(_0x52a099){_0x37609c['push'](_0x37609c['shift']());}}}(a31_0x380c,0xeb795));function a31_0x32c1(_0x3cb7f8,_0x188fe1){_0x3cb7f8=_0x3cb7f8-0x194;const _0x380c5f=a31_0x380c();let _0x32c163=_0x380c5f[_0x3cb7f8];return _0x32c163;}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x3b505d,_0x490764)=>{const _0x2824a0=a31_0x32c1,_0xdaf447=Date[_0x2824a0(0x1b0)]();logger['info'](_0x2824a0(0x1b1),_0x2824a0(0x1ab),{'command':'npm\x20run\x20build'});let _0x199c2a='';const _0x53096a=spawn(_0x2824a0(0x19b),['run',_0x2824a0(0x1b1)],{'stdio':['inherit',_0x2824a0(0x1ae),'pipe'],'shell':!![],'env':{...process[_0x2824a0(0x1b3)],'PATH':''+join(process[_0x2824a0(0x1a2)](),_0x2824a0(0x1a8),_0x2824a0(0x196))+delimiter+process[_0x2824a0(0x1b3)]['PATH']}});_0x53096a[_0x2824a0(0x194)]?.['on'](_0x2824a0(0x1a6),_0xa1ef9d=>{const _0x2f5e85=_0x2824a0;_0x199c2a+=_0xa1ef9d[_0x2f5e85(0x1a3)]();}),_0x53096a['on']('close',_0x280e3b=>{const _0x44198a=_0x2824a0,_0x3001d3=Date[_0x44198a(0x1b0)]()-_0xdaf447;if(_0x280e3b===0x0||_0x280e3b===null)logger[_0x44198a(0x1a7)](_0x44198a(0x1b1),_0x44198a(0x195),_0x3001d3),_0x3b505d();else{const _0x3b7d04={'exitCode':_0x280e3b,'duration':_0x3001d3,'command':_0x44198a(0x19a),'cwd':process[_0x44198a(0x1a2)]()};_0x199c2a['trim']()&&(_0x3b7d04[_0x44198a(0x194)]=_0x199c2a[_0x44198a(0x1a4)]()),logger[_0x44198a(0x1a9)](_0x44198a(0x1b1),'项目构建失败',_0x3b7d04),_0x490764(new Error(_0x44198a(0x1aa)+_0x280e3b));}}),_0x53096a['on'](_0x2824a0(0x1a9),_0x83a5d0=>{const _0x44ebee=_0x2824a0,_0x1246ad=Date[_0x44ebee(0x1b0)]()-_0xdaf447;logger[_0x44ebee(0x1a9)](_0x44ebee(0x1b1),_0x44ebee(0x19f),{'error':_0x83a5d0[_0x44ebee(0x1a1)],'duration':_0x1246ad,'stderr':_0x199c2a['trim']()||undefined}),_0x490764(_0x83a5d0);});});}
|