@lovrabet/cli 1.3.4 → 1.4.1-beta.0
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/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-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/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_0x403edb=a10_0x511e;(function(_0x5ab3c4,_0x490c94){const _0x2f4086=a10_0x511e,_0x33427e=_0x5ab3c4();while(!![]){try{const _0x42ec7a=parseInt(_0x2f4086(0x129))/0x1*(-parseInt(_0x2f4086(0x12a))/0x2)+-parseInt(_0x2f4086(0x12f))/0x3+parseInt(_0x2f4086(0x123))/0x4*(-parseInt(_0x2f4086(0x131))/0x5)+-parseInt(_0x2f4086(0x12e))/0x6*(-parseInt(_0x2f4086(0x120))/0x7)+parseInt(_0x2f4086(0x11c))/0x8*(-parseInt(_0x2f4086(0x12d))/0x9)+parseInt(_0x2f4086(0x127))/0xa+-parseInt(_0x2f4086(0x130))/0xb*(-parseInt(_0x2f4086(0x132))/0xc);if(_0x42ec7a===_0x490c94)break;else _0x33427e['push'](_0x33427e['shift']());}catch(_0x34dcc8){_0x33427e['push'](_0x33427e['shift']());}}}(a10_0x1634,0x9be5c));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';function a10_0x511e(_0x43d47b,_0x31c08e){_0x43d47b=_0x43d47b-0x11a;const _0x163484=a10_0x1634();let _0x511e48=_0x163484[_0x43d47b];return _0x511e48;}function a10_0x1634(){const _0x59908e=['378660QYcQGQ','.tsx','67luwfCq','20778pzBGoG','utf-8','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','56142xUbPsq','3400428cVgYdl','1939779sAGDKG','4032765RPcoxb','10jkSqXv','48jsPYlk','concat','forEach','isDirectory','448OgPRhA','match','endsWith','src/pages','14HZYtUY','filter','replaceAll','614524HIXJjJ','slice','push','replace'];a10_0x1634=function(){return _0x59908e;};return a10_0x1634();}const pagesDir=resolve(process['cwd'](),a10_0x403edb(0x11f));export function extractTitleFromComment(_0x38c72b){const _0x415360=a10_0x403edb;try{const _0x3508e9=readFileSync(_0x38c72b,_0x415360(0x12b)),_0x1296e7=_0x3508e9['match'](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x1296e7&&_0x1296e7[0x1]){const _0x25645e=_0x1296e7[0x1],_0x53500a=_0x25645e[_0x415360(0x11d)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x53500a&&_0x53500a[0x1])return _0x53500a[0x1]['trim']();}let _0x70b16=null;const _0x5cde12=_0x3508e9['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x5cde12&&_0x5cde12[0x1]&&(_0x70b16=_0x5cde12[0x1]);if(!_0x70b16){const _0x21d93b=_0x3508e9[_0x415360(0x11d)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x21d93b&&_0x21d93b[0x1]&&(_0x70b16=_0x21d93b[0x1]);}if(_0x70b16){const _0x3fc56f=new RegExp('\x5cb'+_0x70b16+_0x415360(0x12c)),_0x5cc170=_0x3508e9['match'](_0x3fc56f);if(_0x5cc170&&_0x5cc170[0x1])return _0x5cc170[0x1];return _0x70b16;}return null;}catch(_0x195d8e){return null;}}export function getLocalPages(_0x37f75e=pagesDir,_0x2fad64=pagesDir){const _0x3a3125=a10_0x403edb;let _0x4258fb=[];const _0x3f3997=readdirSync(_0x37f75e);return _0x3f3997[_0x3a3125(0x11a)](_0x206426=>{const _0x5f7f7c=_0x3a3125,_0xb0db72=join(_0x37f75e,_0x206426),_0x5be80e=statSync(_0xb0db72);if(_0x5be80e&&_0x5be80e[_0x5f7f7c(0x11b)]())_0x4258fb=_0x4258fb[_0x5f7f7c(0x133)](getLocalPages(_0xb0db72,_0x2fad64));else{if(_0x206426[_0x5f7f7c(0x11e)](_0x5f7f7c(0x128))){let _0x1ee89a=relative(_0x2fad64,_0xb0db72);_0x1ee89a[_0x5f7f7c(0x11e)]('index.tsx')?_0x1ee89a=_0x1ee89a[_0x5f7f7c(0x126)](/index\.tsx$/,''):_0x1ee89a=_0x1ee89a[_0x5f7f7c(0x126)](/\.tsx$/,'');_0x1ee89a[_0x5f7f7c(0x11e)]('/')&&(_0x1ee89a=_0x1ee89a[_0x5f7f7c(0x124)](0x0,-0x1));const _0x26a44e=extractTitleFromComment(_0xb0db72),_0x45832c=_0x26a44e||_0x1ee89a;_0x4258fb[_0x5f7f7c(0x125)]({'path':_0x1ee89a[_0x5f7f7c(0x122)]('$',':'),'label':_0x45832c});}}}),_0x4258fb[_0x3a3125(0x121)](_0x5b1ddb=>_0x5b1ddb['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a11_0xadd3f2=a11_0x4245;(function(_0x4b1972,_0x18cdcc){const _0x4510de=a11_0x4245,_0x22afcb=_0x4b1972();while(!![]){try{const _0xcc3626=parseInt(_0x4510de(0x1c8))/0x1*(-parseInt(_0x4510de(0x1b4))/0x2)+parseInt(_0x4510de(0x1bf))/0x3+parseInt(_0x4510de(0x1c9))/0x4+-parseInt(_0x4510de(0x1a8))/0x5+parseInt(_0x4510de(0x1b2))/0x6*(-parseInt(_0x4510de(0x1a5))/0x7)+parseInt(_0x4510de(0x1b7))/0x8*(parseInt(_0x4510de(0x1b9))/0x9)+parseInt(_0x4510de(0x1c0))/0xa*(parseInt(_0x4510de(0x1bb))/0xb);if(_0xcc3626===_0x18cdcc)break;else _0x22afcb['push'](_0x22afcb['shift']());}catch(_0x512c5b){_0x22afcb['push'](_0x22afcb['shift']());}}}(a11_0x14c0,0x4c37d));function a11_0x14c0(){const _0x4cd170=['2349770iCILaU','push','application/json','flat','appMenu.error.appCodeHint.option1','appMenu.error.appCodeHint.title','/smartapi/menu/find?appCode=','isArray','map','children','402ctWBJe','info','13106IrOUNZ','parse','length','88iHOmMF','errorMsg','340839MKvZYO','json','8214481gWQrzT','data','log','extend','1411311HOtMqA','10nHLqSO','resources','status','error','appMenu.fetching.online','errorCode','get-online-menu-list','bind','57YpbvET','304664SYgiSt','success','appMenu.error.appCodeHint.option2','57911RimioQ','appMenu.success.fetched','common.error'];a11_0x14c0=function(){return _0x4cd170;};return a11_0x14c0();}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_0x4245(_0x4c032f,_0x3abb1a){_0x4c032f=_0x4c032f-0x1a5;const _0x14c0f1=a11_0x14c0();let _0x424570=_0x14c0f1[_0x4c032f];return _0x424570;}import{getEnv}from'../constant/env.js';import a11_0x2b1d42 from'../i18n/index.js';const config=readConfig(),t=a11_0x2b1d42['t'][a11_0xadd3f2(0x1c7)](a11_0x2b1d42);export async function getOnlineMenuList(){const _0x800e=a11_0xadd3f2,_0x2012bb=config?.['appcode'];if(!_0x2012bb){const _0x487a35=t('appMenu.error.missingAppCode');return logger[_0x800e(0x1c3)](_0x800e(0x1c6),_0x487a35),console[_0x800e(0x1c3)]('×\x20'+_0x487a35),console['log'](t(_0x800e(0x1ad))),console[_0x800e(0x1bd)](t(_0x800e(0x1ac))),console[_0x800e(0x1bd)](t(_0x800e(0x1cb))),[];}const _0x30d7cc=getEnv();logger[_0x800e(0x1b3)](_0x800e(0x1c6),_0x30d7cc==='online'?t(_0x800e(0x1c4),{'appCode':_0x2012bb}):t('appMenu.fetching.daily',{'appCode':_0x2012bb}));const _0x3633eb=await fetch(getApiDomain()+_0x800e(0x1ae)+_0x2012bb,{'method':'GET','headers':{'Content-Type':_0x800e(0x1aa),'Cookie':getCookie()}});if(!_0x3633eb['ok']){if(_0x3633eb[_0x800e(0x1c2)]===0x191){const _0x16eff6=t('appMenu.error.authExpired');logger[_0x800e(0x1c3)](_0x800e(0x1c6),_0x16eff6,{'status':_0x3633eb[_0x800e(0x1c2)]});throw new Error(_0x16eff6);}const _0x1e1f47=t('appMenu.error.httpStatus',{'status':_0x3633eb[_0x800e(0x1c2)]});logger[_0x800e(0x1c3)](_0x800e(0x1c6),_0x1e1f47);throw new Error(_0x1e1f47);}const _0x38d174=await _0x3633eb[_0x800e(0x1ba)]();if(!_0x38d174[_0x800e(0x1ca)]){const _0x3ba1e5=t('appMenu.error.fetchFailed',{'error':_0x38d174[_0x800e(0x1b8)]||t(_0x800e(0x1a7))});logger[_0x800e(0x1c3)](_0x800e(0x1c6),_0x3ba1e5,{'errorCode':_0x38d174[_0x800e(0x1c5)],'errorMsg':_0x38d174[_0x800e(0x1b8)]});throw new Error(_0x3ba1e5);}if(!_0x38d174[_0x800e(0x1bc)])return logger[_0x800e(0x1b3)]('get-online-menu-list',t('appMenu.info.emptyMenuList')),[];return logger[_0x800e(0x1b3)](_0x800e(0x1c6),t(_0x800e(0x1a6),{'count':_0x38d174[_0x800e(0x1bc)][_0x800e(0x1b6)]})),_0x38d174[_0x800e(0x1bc)][_0x800e(0x1b0)](formatMenuList)[_0x800e(0x1ab)]();}function formatMenuList(_0x427d11){const _0x5951ce=a11_0xadd3f2;let _0x3a4d48=[];try{if(_0x427d11['extend']?.[_0x5951ce(0x1c1)]){const _0x103cb5=JSON[_0x5951ce(0x1b5)](_0x427d11[_0x5951ce(0x1be)][_0x5951ce(0x1c1)]);Array[_0x5951ce(0x1af)](_0x103cb5)&&(_0x3a4d48=_0x103cb5);}}catch(_0x26d2a5){}const _0x317216=[{'id':_0x427d11['id'],'path':_0x427d11['path'],'label':_0x427d11['label'],'resources':_0x3a4d48}];if(_0x427d11[_0x5951ce(0x1b1)]&&_0x427d11[_0x5951ce(0x1b1)]['length']>0x0)for(const _0xda1b3d of _0x427d11[_0x5951ce(0x1b1)]){_0x317216[_0x5951ce(0x1a9)](...formatMenuList(_0xda1b3d));}return _0x317216;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a13_0x2cf0(){const _0x1c2e41=['144661qSYUwA','9JvdToy','appMenu.error.fetchFailed','message','779883AEFjMM','204ZIRSOD','2140KNKdgO','common.error','5769472NvfPXd','26043ctkWbS','192KLlgxh','then','118130cUBWuG','8677361AFBJzz','bind','catch','finally','2143280aCfIgD'];a13_0x2cf0=function(){return _0x1c2e41;};return a13_0x2cf0();}const a13_0x1e2956=a13_0xe141;(function(_0x266109,_0x408dd1){const _0x5639f1=a13_0xe141,_0x454165=_0x266109();while(!![]){try{const _0x448cab=-parseInt(_0x5639f1(0xd0))/0x1+parseInt(_0x5639f1(0xcb))/0x2+-parseInt(_0x5639f1(0xd5))/0x3*(-parseInt(_0x5639f1(0xd1))/0x4)+parseInt(_0x5639f1(0xc6))/0x5*(parseInt(_0x5639f1(0xd6))/0x6)+parseInt(_0x5639f1(0xc7))/0x7+parseInt(_0x5639f1(0xd4))/0x8*(parseInt(_0x5639f1(0xcd))/0x9)+parseInt(_0x5639f1(0xd2))/0xa*(-parseInt(_0x5639f1(0xcc))/0xb);if(_0x448cab===_0x408dd1)break;else _0x454165['push'](_0x454165['shift']());}catch(_0x36baa8){_0x454165['push'](_0x454165['shift']());}}}(a13_0x2cf0,0x9b855));import{useEffect,useState}from'react';function a13_0xe141(_0xdc8107,_0x522164){_0xdc8107=_0xdc8107-0xc6;const _0x2cf08a=a13_0x2cf0();let _0xe141e7=_0x2cf08a[_0xdc8107];return _0xe141e7;}import{getOnlineMenuList}from'./get-online-menu-list.js';import a13_0x42c1db from'../i18n/index.js';const t=a13_0x42c1db['t'][a13_0x1e2956(0xc8)](a13_0x42c1db);export function useGetOnlineMenuList(){const [_0x5582e0,_0x2705d3]=useState([]),[_0x3a6285,_0x55357b]=useState(!![]),[_0xe0da96,_0x2fafcb]=useState('');return useEffect(()=>{const _0xe8efd3=a13_0xe141;_0x55357b(!![]),_0x2fafcb(''),getOnlineMenuList()[_0xe8efd3(0xd7)](_0x2705d3)[_0xe8efd3(0xc9)](_0x9fa34a=>{const _0x14b775=_0xe8efd3;_0x2fafcb(_0x9fa34a[_0x14b775(0xcf)]||t(_0x14b775(0xce),{'error':t(_0x14b775(0xd3))}));})[_0xe8efd3(0xca)](()=>_0x55357b(![]));},[]),{'menuList':_0x5582e0,'loading':_0x3a6285,'error':_0xe0da96};}
|
package/lib/app-menu/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x124238,_0x341137){const _0x1c2e49=a14_0x232d,_0x10146c=_0x124238();while(!![]){try{const _0x4c48e2=parseInt(_0x1c2e49(0xdb))/0x1*(-parseInt(_0x1c2e49(0xe5))/0x2)+parseInt(_0x1c2e49(0xe2))/0x3+parseInt(_0x1c2e49(0xd8))/0x4*(parseInt(_0x1c2e49(0xda))/0x5)+-parseInt(_0x1c2e49(0xd7))/0x6*(-parseInt(_0x1c2e49(0xde))/0x7)+-parseInt(_0x1c2e49(0xe3))/0x8+parseInt(_0x1c2e49(0xd9))/0x9*(parseInt(_0x1c2e49(0xd6))/0xa)+parseInt(_0x1c2e49(0xe1))/0xb*(-parseInt(_0x1c2e49(0xe0))/0xc);if(_0x4c48e2===_0x341137)break;else _0x10146c['push'](_0x10146c['shift']());}catch(_0x10e039){_0x10146c['push'](_0x10146c['shift']());}}}(a14_0x51f1,0x2f972));function a14_0x232d(_0x245941,_0x219349){_0x245941=_0x245941-0xd6;const _0x51f1b2=a14_0x51f1();let _0x232d0c=_0x51f1b2[_0x245941];return _0x232d0c;}export function getRemainingSpaces(_0x5f3c75,_0xc10b73){const _0x3832c6=a14_0x232d,_0x425d9a=getStringWidth(_0xc10b73);return Array(Math[_0x3832c6(0xe4)](0x0,_0x5f3c75-_0x425d9a))[_0x3832c6(0xdd)]('\x20')[_0x3832c6(0xdc)]('');}export function getMaxWidth(_0xedc5c7,_0x54b273=0x2){const _0x5d3e0f=a14_0x232d;let _0x51ab3a='',_0x1c7db1=0x0;for(const _0x25ccc3 of _0xedc5c7){const _0xc174a0=getStringWidth(_0x25ccc3);_0xc174a0>_0x1c7db1&&(_0x1c7db1=_0xc174a0,_0x51ab3a=_0x25ccc3);}return _0x51ab3a+'\x20'[_0x5d3e0f(0xe6)](_0x54b273);}export function getStringWidth(_0x20b94e){const _0x3a06c3=a14_0x232d;let _0x526a83=0x0;for(const _0xb661b7 of _0x20b94e){/[\u4e00-\u9fa5]/[_0x3a06c3(0xdf)](_0xb661b7)?_0x526a83+=0x2:_0x526a83+=0x1;}return _0x526a83;}function a14_0x51f1(){const _0x5d0d93=['1661616ukeinU','11auBQWa','360162YfEvxd','2398224nzeuUX','max','46aBaGPS','repeat','265830aNDSFh','6vCxidi','35396VXEvED','81ThEIpq','145ungrGJ','2164ujOdZp','join','fill','469182CIpBfd','test'];a14_0x51f1=function(){return _0x5d0d93;};return a14_0x51f1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40faa5,_0x278eeb){const _0x5c367a=a15_0x24c3,_0x1f893f=_0x40faa5();while(!![]){try{const _0x50d3d7=parseInt(_0x5c367a(0x113))/0x1+-parseInt(_0x5c367a(0x117))/0x2+parseInt(_0x5c367a(0x116))/0x3*(parseInt(_0x5c367a(0x112))/0x4)+-parseInt(_0x5c367a(0x111))/0x5+parseInt(_0x5c367a(0x118))/0x6+-parseInt(_0x5c367a(0x110))/0x7*(parseInt(_0x5c367a(0x114))/0x8)+-parseInt(_0x5c367a(0x115))/0x9*(-parseInt(_0x5c367a(0x119))/0xa);if(_0x50d3d7===_0x278eeb)break;else _0x1f893f['push'](_0x1f893f['shift']());}catch(_0x9c33d1){_0x1f893f['push'](_0x1f893f['shift']());}}}(a15_0x42d4,0xcdefc));export function isValidJsHttpsUrl(_0x121a1f){const _0x4920fb=a15_0x24c3;return/^https:\/\/.+\.js(\?.*)?$/[_0x4920fb(0x11c)](_0x121a1f[_0x4920fb(0x11b)]());}function a15_0x24c3(_0x334824,_0x5db2f8){_0x334824=_0x334824-0x110;const _0x42d47d=a15_0x42d4();let _0x24c3b3=_0x42d47d[_0x334824];return _0x24c3b3;}function a15_0x42d4(){const _0xa8438e=['367436idBQQP','944196BjGeiK','961864pAXkxh','18oHOouP','42EnJUgQ','1645640BBLgLZ','97470gumdWQ','11036630RaGWBa','HEAD','trim','test','91GuEkWJ','6122140Fftwbx'];a15_0x42d4=function(){return _0xa8438e;};return a15_0x42d4();}export function isValidCssHttpsUrl(_0x472a10){const _0xc161f=a15_0x24c3;return/^https:\/\/.+\.css(\?.*)?$/[_0xc161f(0x11c)](_0x472a10[_0xc161f(0x11b)]());}export async function isUrlReachable(_0x2f8c8a){const _0x83c076=a15_0x24c3;try{const _0x2499be=await fetch(_0x2f8c8a,{'method':_0x83c076(0x11a)});return _0x2499be['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b2e2c,_0x5a888b){const _0x2b9054=a16_0x50fa,_0x387e38=_0x4b2e2c();while(!![]){try{const _0xacff5e=parseInt(_0x2b9054(0xe2))/0x1+parseInt(_0x2b9054(0xde))/0x2*(-parseInt(_0x2b9054(0xdb))/0x3)+parseInt(_0x2b9054(0xd4))/0x4*(parseInt(_0x2b9054(0xe1))/0x5)+-parseInt(_0x2b9054(0xd9))/0x6+parseInt(_0x2b9054(0xdd))/0x7+-parseInt(_0x2b9054(0xe9))/0x8*(-parseInt(_0x2b9054(0xe5))/0x9)+parseInt(_0x2b9054(0xdf))/0xa*(-parseInt(_0x2b9054(0xdc))/0xb);if(_0xacff5e===_0x5a888b)break;else _0x387e38['push'](_0x387e38['shift']());}catch(_0xe877c5){_0x387e38['push'](_0x387e38['shift']());}}}(a16_0x160b,0xa414e));import{jsx as a16_0x2df92a,jsxs as a16_0x19ba37}from'react/jsx-runtime';function a16_0x50fa(_0x18e098,_0x1fb8b3){_0x18e098=_0x18e098-0xd3;const _0x160b49=a16_0x160b();let _0x50faa9=_0x160b49[_0x18e098];return _0x50faa9;}import{Text,Box}from'ink';function a16_0x160b(){const _0x44ef17=['1950Stamxg','map','5ZmOGES','828103fPJJXa','filter','column','18MDZfjv','appMenu.updateCdn.preview.title','cyan','flat','1939144rfSSIg','appMenu.updateCdn.preview.menuList','1003876YtQsyN','join','resources','appMenu.updateCdn.preview.resourceLinks','label','1339554wpPJsL','length','1989BJYRvD','33308JGnQKy','1518818AbAfSY','890lFLyOd'];a16_0x160b=function(){return _0x44ef17;};return a16_0x160b();}import{useI18n}from'../i18n/hooks.js';export function CurrentMenuCdnContent(_0x45b97c){const _0xdd624b=a16_0x50fa,{t:_0x5afdde}=useI18n(),{menuList:_0x5c5891}=_0x45b97c,_0x1e13a2=_0x5c5891[_0xdd624b(0xe3)](_0x1ef1e5=>_0x1ef1e5[_0xdd624b(0xd6)][_0xdd624b(0xda)]),_0x124f48=Array['from'](new Set(_0x5c5891[_0xdd624b(0xe0)](_0x44b59c=>_0x44b59c['resources'])[_0xdd624b(0xe8)]()));return a16_0x19ba37(Box,{'flexDirection':_0xdd624b(0xe4),'children':[a16_0x2df92a(Text,{'color':_0xdd624b(0xe7),'children':_0x5afdde(_0xdd624b(0xe6))}),a16_0x19ba37(Box,{'marginTop':0x1,'flexDirection':_0xdd624b(0xe4),'children':[a16_0x19ba37(Text,{'bold':!![],'children':['\x20\x20',_0x5afdde(_0xdd624b(0xd3))]}),a16_0x19ba37(Text,{'children':['\x20\x20',_0x1e13a2[_0xdd624b(0xe0)](_0x5ac332=>_0x5ac332[_0xdd624b(0xd8)])[_0xdd624b(0xd5)](',\x20')]})]}),a16_0x2df92a(Box,{'marginTop':0x1,'children':a16_0x19ba37(Text,{'bold':!![],'children':['\x20\x20',_0x5afdde(_0xdd624b(0xd7))]})}),_0x124f48[_0xdd624b(0xe0)](_0x2f15cb=>a16_0x2df92a(Box,{'children':a16_0x19ba37(Text,{'children':['\x20\x20',_0x2f15cb]})},_0x2f15cb))]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38c96b,_0x98c511){const _0x36a59b=a17_0x410f,_0x35c29e=_0x38c96b();while(!![]){try{const _0x487d0e=-parseInt(_0x36a59b(0x110))/0x1*(parseInt(_0x36a59b(0x106))/0x2)+parseInt(_0x36a59b(0x104))/0x3*(parseInt(_0x36a59b(0x10c))/0x4)+-parseInt(_0x36a59b(0x102))/0x5*(parseInt(_0x36a59b(0x10b))/0x6)+parseInt(_0x36a59b(0x108))/0x7+-parseInt(_0x36a59b(0x10d))/0x8+parseInt(_0x36a59b(0x101))/0x9*(-parseInt(_0x36a59b(0x10f))/0xa)+parseInt(_0x36a59b(0x10e))/0xb*(parseInt(_0x36a59b(0x10a))/0xc);if(_0x487d0e===_0x98c511)break;else _0x35c29e['push'](_0x35c29e['shift']());}catch(_0x4dc9c0){_0x35c29e['push'](_0x35c29e['shift']());}}}(a17_0x42b5,0xdfa21));import{jsx as a17_0x7e09f2,jsxs as a17_0xbd7400}from'react/jsx-runtime';import{Text,Box}from'ink';function a17_0x42b5(){const _0x1d4035=['152155aZadbc','column','1864071cPpUxo','cyan','453982DKInvj','appMenu.updateCdn.input.cssUrl.label','8142127ppBifh','green','84jbXAVR','36oEYHQZ','8cuRhHS','5099456mBTtAm','1124596XtMzSC','11585170XesFbE','1ncZHGE','9luSfOS'];a17_0x42b5=function(){return _0x1d4035;};return a17_0x42b5();}import{useI18n}from'../i18n/hooks.js';function a17_0x410f(_0x3a1f7c,_0x19fcee){_0x3a1f7c=_0x3a1f7c-0x101;const _0x42b56a=a17_0x42b5();let _0x410f0d=_0x42b56a[_0x3a1f7c];return _0x410f0d;}export function InputCdnAsset(_0x1d82fd){const _0x15be2d=a17_0x410f,{t:_0x1aa634}=useI18n(),{jsCdnUrl:_0x59c21e,cssCdnUrl:_0x283c82}=_0x1d82fd;return a17_0xbd7400(Box,{'flexDirection':_0x15be2d(0x103),'marginTop':0x1,'children':[a17_0x7e09f2(Text,{'color':_0x15be2d(0x105),'children':_0x1aa634('appMenu.updateCdn.input.title')}),a17_0xbd7400(Box,{'children':[a17_0xbd7400(Text,{'children':['\x20\x20',_0x1aa634('appMenu.updateCdn.input.jsUrl.label')]}),a17_0x7e09f2(Text,{'color':_0x15be2d(0x109),'children':_0x59c21e})]}),a17_0xbd7400(Box,{'children':[a17_0xbd7400(Text,{'children':['\x20\x20',_0x1aa634(_0x15be2d(0x107))]}),a17_0x7e09f2(Text,{'color':'green','children':_0x283c82})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f2e9c,_0x50e781){const _0x13c7b3=a18_0x426b,_0x8ab962=_0x3f2e9c();while(!![]){try{const _0x244d0e=-parseInt(_0x13c7b3(0x132))/0x1*(-parseInt(_0x13c7b3(0x125))/0x2)+parseInt(_0x13c7b3(0x122))/0x3+parseInt(_0x13c7b3(0x139))/0x4*(-parseInt(_0x13c7b3(0x11c))/0x5)+-parseInt(_0x13c7b3(0x11d))/0x6+parseInt(_0x13c7b3(0x129))/0x7+-parseInt(_0x13c7b3(0x130))/0x8+-parseInt(_0x13c7b3(0x141))/0x9;if(_0x244d0e===_0x50e781)break;else _0x8ab962['push'](_0x8ab962['shift']());}catch(_0x43c72e){_0x8ab962['push'](_0x8ab962['shift']());}}}(a18_0x4dbe,0xbe6fe));import{jsx as a18_0x3966e9,jsxs as a18_0x228090,Fragment as a18_0x169c5f}from'react/jsx-runtime';function a18_0x426b(_0x4467a1,_0x3d86cc){_0x4467a1=_0x4467a1-0x10e;const _0x4dbe34=a18_0x4dbe();let _0x426b1e=_0x4dbe34[_0x4467a1];return _0x426b1e;}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a18_0x39fbb0 from'ink-spinner';function a18_0x4dbe(){const _0x350ce8=['label','appMenu.updateCdn.title','appMenu.updateCdn.success.updated','158679uVsLKR','return','lovrabet\x20auth','appMenu.updateCdn.error.noCdnLinks','red','\x20←\x20','green','delete','cancel','appMenu.updateCdn.input.cssUrl.label','cyan','updated','dots','appMenu.updateCdn.input.jsUrl.placeholder','map','975335grfSUx','7310742qKuZCb','need-confirm','value','appMenu.updateCdn.loading.fetching','downArrow','4421994YiXnMA','leftArrow','slice','336236gikUiM','appMenu.updateCdn.error.jsUrlUnreachable','input-css','appMenu.updateCdn.error.authHint.suffix','2653532LRQHNI','from','appMenu.updateCdn.loading.syncing','length','resolve','backspace','appMenu.updateCdn.action.continue','5204776QpTmRb','trim','6SiSaDq','all','appMenu.updateCdn.input.cssUrl.placeholder','creating','upArrow','appMenu.updateCdn.error.invalidJsUrl','gray','4qBcgWH','yellow','path','column','resources'];a18_0x4dbe=function(){return _0x350ce8;};return a18_0x4dbe();}import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a18_0x3966e9(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x20f058=a18_0x426b,{exit:_0x19f6d6}=useApp(),{t:_0x34e5f1}=useI18n(),{loading:_0x5a0ed2,menuList:_0x9f2830,error:_0x3336f5}=useGetOnlineMenuList(),[_0x34deb1,_0x4c2073]=useState('ok'),[_0x47ae66,_0x56b0a9]=useState('input-js'),[_0x2f629d,_0x7c5346]=useState(''),[_0x1f70fa,_0x1b5b06]=useState(''),[_0x27ba56,_0x2d79be]=useState(''),[_0x455e9c,_0x260ac4]=useState(''),_0x1ea59c=Array[_0x20f058(0x12a)](new Set(_0x9f2830['map'](_0x5e473f=>_0x5e473f[_0x20f058(0x13d)])['flat']()));useEffect(()=>{const _0x4f6bed=_0x20f058;_0x47ae66===_0x4f6bed(0x118)&&setTimeout(_0x19f6d6,0x32);},[_0x47ae66]),useInput(async(_0x26ddac,_0xed1c5f)=>{const _0xa8aab7=_0x20f058;if(_0x47ae66==='input-js'){if(_0xed1c5f[_0xa8aab7(0x10e)]){const _0x189cca=_0x27ba56[_0xa8aab7(0x131)]();if(_0x189cca==='')return;if(!isValidJsHttpsUrl(_0x189cca)){_0x260ac4(_0x34e5f1(_0xa8aab7(0x137)));return;}if(!await isUrlReachable(_0x189cca)){_0x260ac4(_0x34e5f1(_0xa8aab7(0x126)));return;}_0x7c5346(_0x189cca),_0x2d79be(''),_0x260ac4(''),_0x56b0a9('input-css');return;}if(_0xed1c5f[_0xa8aab7(0x12e)]||_0xed1c5f[_0xa8aab7(0x114)]){_0x2d79be(_0x31a0e2=>_0x31a0e2['slice'](0x0,-0x1)),_0x260ac4('');return;}_0x2d79be(_0x53a1f6=>_0x53a1f6+_0x26ddac);return;}if(_0x47ae66===_0xa8aab7(0x127)){if(_0xed1c5f[_0xa8aab7(0x10e)]){const _0x22cd8e=_0x27ba56[_0xa8aab7(0x131)]();if(_0x22cd8e==='')return;if(!isValidCssHttpsUrl(_0x22cd8e)){_0x260ac4(_0x34e5f1('appMenu.updateCdn.error.invalidCssUrl'));return;}if(!await isUrlReachable(_0x22cd8e)){_0x260ac4(_0x34e5f1('appMenu.updateCdn.error.cssUrlUnreachable'));return;}_0x1b5b06(_0x22cd8e),_0x2d79be(''),_0x260ac4(''),_0x56b0a9('need-confirm');return;}if(_0xed1c5f[_0xa8aab7(0x12e)]||_0xed1c5f['delete']){_0x2d79be(_0x3a1180=>_0x3a1180[_0xa8aab7(0x124)](0x0,-0x1)),_0x260ac4('');return;}_0x2d79be(_0x35b50d=>_0x35b50d+_0x26ddac);return;}if(_0x47ae66===_0xa8aab7(0x11e)){(_0xed1c5f[_0xa8aab7(0x136)]||_0xed1c5f[_0xa8aab7(0x121)]||_0xed1c5f[_0xa8aab7(0x123)]||_0xed1c5f['rightArrow'])&&_0x4c2073(_0x5b579b=>_0x5b579b==='ok'?'cancel':'ok');if(_0xed1c5f[_0xa8aab7(0x10e)]){_0x56b0a9(_0xa8aab7(0x135));if(_0x34deb1==='ok')await Promise[_0xa8aab7(0x133)](_0x9f2830['map'](_0x40c4b7=>{const _0x30d8e2=_0xa8aab7,_0xd75e21={'id':_0x40c4b7['id'],'label':_0x40c4b7[_0x30d8e2(0x13e)],'path':_0x40c4b7[_0x30d8e2(0x13b)],'resources':[_0x2f629d,_0x1f70fa]};if(_0x40c4b7[_0x30d8e2(0x13d)][_0x30d8e2(0x12c)]===0x0)return Promise[_0x30d8e2(0x12d)]();return updateMenuCdnUrl(_0xd75e21);})),await new Promise(_0x2bba5f=>setTimeout(_0x2bba5f,0x3e8)),_0x56b0a9(_0xa8aab7(0x118));else _0x34deb1===_0xa8aab7(0x115)&&_0x19f6d6();}}});if(_0x5a0ed2)return a18_0x228090(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x3966e9(Text,{}),a18_0x3966e9(a18_0x39fbb0,{'type':_0x20f058(0x119)}),a18_0x3966e9(Text,{'children':_0x34e5f1(_0x20f058(0x120))})]});if(_0x3336f5)return a18_0x228090(Box,{'flexDirection':_0x20f058(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x228090(Text,{'color':_0x20f058(0x111),'children':['✗\x20',_0x3336f5]}),a18_0x228090(Box,{'marginTop':0x1,'children':[a18_0x3966e9(Text,{'color':'gray','children':_0x34e5f1('appMenu.updateCdn.error.authHint.prefix')}),a18_0x3966e9(Text,{'color':_0x20f058(0x117),'children':_0x20f058(0x10f)}),a18_0x3966e9(Text,{'color':'gray','children':_0x34e5f1(_0x20f058(0x128))})]})]});if(_0x1ea59c[_0x20f058(0x12c)]===0x0)return a18_0x3966e9(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a18_0x3966e9(Text,{'color':_0x20f058(0x13a),'children':_0x34e5f1(_0x20f058(0x110))})});if(_0x47ae66===_0x20f058(0x11e))return a18_0x228090(Box,{'flexDirection':_0x20f058(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x3966e9(CurrentMenuCdnContent,{'menuList':_0x9f2830}),a18_0x3966e9(InputCdnAsset,{'jsCdnUrl':_0x2f629d,'cssCdnUrl':_0x1f70fa}),a18_0x3966e9(Box,{'marginTop':0x1,'flexDirection':_0x20f058(0x13c),'children':[{'label':_0x34e5f1(_0x20f058(0x12f)),'value':'ok'},{'label':_0x34e5f1('appMenu.updateCdn.action.cancel'),'value':_0x20f058(0x115)}][_0x20f058(0x11b)](_0x56f682=>a18_0x228090(Text,{'color':_0x34deb1===_0x56f682[_0x20f058(0x11f)]?_0x20f058(0x13a):undefined,'children':[_0x34deb1===_0x56f682[_0x20f058(0x11f)]?'>\x20':'\x20\x20',_0x56f682[_0x20f058(0x13e)]]},_0x56f682['value']))})]});if(_0x47ae66===_0x20f058(0x135))return a18_0x228090(Box,{'flexDirection':_0x20f058(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x3966e9(CurrentMenuCdnContent,{'menuList':_0x9f2830}),a18_0x3966e9(InputCdnAsset,{'jsCdnUrl':_0x2f629d,'cssCdnUrl':_0x1f70fa}),a18_0x228090(Box,{'marginTop':0x1,'children':[a18_0x3966e9(a18_0x39fbb0,{'type':_0x20f058(0x119)}),a18_0x3966e9(Text,{'children':_0x34e5f1(_0x20f058(0x12b))})]})]});if(_0x47ae66==='updated')return a18_0x228090(Box,{'flexDirection':_0x20f058(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x3966e9(CurrentMenuCdnContent,{'menuList':_0x9f2830}),a18_0x3966e9(InputCdnAsset,{'jsCdnUrl':_0x2f629d,'cssCdnUrl':_0x1f70fa}),a18_0x3966e9(Box,{'marginTop':0x1,'children':a18_0x3966e9(Text,{'color':'green','children':_0x34e5f1(_0x20f058(0x140))})})]});return a18_0x228090(Box,{'flexDirection':_0x20f058(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x3966e9(CurrentMenuCdnContent,{'menuList':_0x9f2830}),a18_0x228090(Box,{'marginTop':0x1,'flexDirection':_0x20f058(0x13c),'children':[a18_0x3966e9(Text,{'color':'cyan','children':_0x34e5f1(_0x20f058(0x13f))}),_0x2f629d?a18_0x228090(Box,{'children':[a18_0x228090(Text,{'color':_0x20f058(0x138),'children':['\x20\x20',_0x34e5f1('appMenu.updateCdn.input.jsUrl.label')]}),a18_0x3966e9(Text,{'color':'green','children':_0x2f629d})]}):_0x47ae66==='input-js'&&a18_0x228090(a18_0x169c5f,{'children':[a18_0x228090(Box,{'children':[a18_0x228090(Text,{'children':['\x20\x20',_0x34e5f1('appMenu.updateCdn.input.jsUrl.label')]}),a18_0x3966e9(Text,{'color':_0x20f058(0x113),'children':_0x27ba56}),_0x455e9c&&a18_0x228090(Text,{'color':_0x20f058(0x111),'children':[_0x20f058(0x112),_0x455e9c]})]}),!_0x455e9c&&a18_0x3966e9(Box,{'children':a18_0x228090(Text,{'color':_0x20f058(0x138),'children':['\x20\x20',_0x34e5f1(_0x20f058(0x11a))]})})]}),_0x1f70fa?a18_0x228090(Box,{'children':[a18_0x228090(Text,{'children':['\x20\x20',_0x34e5f1(_0x20f058(0x116))]}),a18_0x3966e9(Text,{'color':_0x20f058(0x113),'children':_0x1f70fa})]}):_0x47ae66===_0x20f058(0x127)&&a18_0x228090(a18_0x169c5f,{'children':[a18_0x228090(Box,{'children':[a18_0x228090(Text,{'children':['\x20\x20',_0x34e5f1(_0x20f058(0x116))]}),a18_0x3966e9(Text,{'color':'green','children':_0x27ba56}),_0x455e9c&&a18_0x228090(Text,{'color':_0x20f058(0x111),'children':['\x20←\x20',_0x455e9c]})]}),!_0x455e9c&&a18_0x3966e9(Box,{'children':a18_0x228090(Text,{'color':_0x20f058(0x138),'children':['\x20\x20',_0x34e5f1(_0x20f058(0x134))]})})]})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a20_0x58db(_0x564d96,_0x522b6e){_0x564d96=_0x564d96-0x159;const _0x10e666=a20_0x10e6();let _0x58db4a=_0x10e666[_0x564d96];return _0x58db4a;}const a20_0x2ef0c7=a20_0x58db;(function(_0x1b7284,_0x428218){const _0xa29933=a20_0x58db,_0x16dec8=_0x1b7284();while(!![]){try{const _0x233d58=parseInt(_0xa29933(0x16d))/0x1*(parseInt(_0xa29933(0x161))/0x2)+parseInt(_0xa29933(0x15d))/0x3*(-parseInt(_0xa29933(0x171))/0x4)+parseInt(_0xa29933(0x174))/0x5+parseInt(_0xa29933(0x15f))/0x6+parseInt(_0xa29933(0x176))/0x7+-parseInt(_0xa29933(0x15c))/0x8+-parseInt(_0xa29933(0x168))/0x9;if(_0x233d58===_0x428218)break;else _0x16dec8['push'](_0x16dec8['shift']());}catch(_0x2c9c09){_0x16dec8['push'](_0x16dec8['shift']());}}}(a20_0x10e6,0xd16aa));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a20_0x10e6(){const _0x4de711=['update-menu-cdn-url','appMenu.updateCdn.error.updateFailed','application/json','log','2856720ZMDaGv','411438Gpwtxe','json','3490440MOMbSt','common.error','23458BbkJcf','data','SdkDemo1','status','resources','success','appMenu.error.appCodeHint.title','17299449qLERWB','error','label','info','sdk-demo','96JpDMis','stringify','POST','/smartapi/menu/update','24oKdylp','bind','path','4057785tfEJhI','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','10084312rKRYEn','appMenu.updateCdn.success.synced','appMenu.error.missingAppCode','errorCode','appMenu.updateCdn.updating','errorMsg','appcode','appMenu.error.appCodeHint.option1'];a20_0x10e6=function(){return _0x4de711;};return a20_0x10e6();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import a20_0x4a5475 from'../i18n/index.js';const config=readConfig(),logLabel=a20_0x2ef0c7(0x17e),t=a20_0x4a5475['t'][a20_0x2ef0c7(0x172)](a20_0x4a5475);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a20_0x2ef0c7(0x163),'path':a20_0x2ef0c7(0x16c),'resources':[a20_0x2ef0c7(0x175),'https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css']});export async function updateMenuCdnUrl(_0x29d6a7){const _0x2457d2=a20_0x2ef0c7,_0x3b4d66=config?.[_0x2457d2(0x17c)];if(!_0x3b4d66){const _0x4abf59=t(_0x2457d2(0x178));logger[_0x2457d2(0x169)](logLabel,_0x4abf59),console[_0x2457d2(0x169)]('×\x20'+_0x4abf59),console[_0x2457d2(0x15b)](t(_0x2457d2(0x167))),console[_0x2457d2(0x15b)](t(_0x2457d2(0x17d))),console[_0x2457d2(0x15b)](t('appMenu.error.appCodeHint.option2'));return;}logger[_0x2457d2(0x16b)](logLabel,t(_0x2457d2(0x17a),{'label':_0x29d6a7[_0x2457d2(0x16a)],'path':_0x29d6a7[_0x2457d2(0x173)]}));const _0x1998e1={'id':_0x29d6a7['id'],'appCode':_0x3b4d66,'extend':{'loadScriptMode':'import','resources':_0x29d6a7[_0x2457d2(0x165)]?JSON[_0x2457d2(0x16e)](_0x29d6a7[_0x2457d2(0x165)]):undefined}},_0x24e91b=await fetch(getApiDomain()+_0x2457d2(0x170),{'method':_0x2457d2(0x16f),'body':JSON[_0x2457d2(0x16e)](_0x1998e1),'headers':{'Content-Type':_0x2457d2(0x15a),'Cookie':getCookie()}});if(!_0x24e91b['ok']){if(_0x24e91b[_0x2457d2(0x164)]===0x191){const _0x61299=t('appMenu.error.authExpired');logger['error'](logLabel,_0x61299,{'status':_0x24e91b[_0x2457d2(0x164)],'menu':_0x29d6a7['label']});throw new Error(_0x61299);}const _0x453cf6=t(_0x2457d2(0x159),{'error':_0x24e91b[_0x2457d2(0x164)]});logger[_0x2457d2(0x169)](logLabel,_0x453cf6,{'menu':_0x29d6a7[_0x2457d2(0x16a)]});throw new Error(_0x453cf6);}const _0x282b60=await _0x24e91b[_0x2457d2(0x15e)]();if(!_0x282b60[_0x2457d2(0x166)]){const _0x2286c5=t(_0x2457d2(0x159),{'error':_0x282b60['errorMsg']||t(_0x2457d2(0x160))});logger[_0x2457d2(0x169)](logLabel,_0x2286c5,{'errorCode':_0x282b60[_0x2457d2(0x179)],'errorMsg':_0x282b60[_0x2457d2(0x17b)],'menu':_0x29d6a7['label']});throw new Error(_0x2286c5);}logger[_0x2457d2(0x16b)](logLabel,t(_0x2457d2(0x177),{'label':_0x29d6a7[_0x2457d2(0x16a)]}),_0x282b60[_0x2457d2(0x162)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x566dd8,_0x340b2e){const _0x3fbdfd=a21_0x3123,_0xcf6bbb=_0x566dd8();while(!![]){try{const _0x2ecb92=parseInt(_0x3fbdfd(0x120))/0x1*(-parseInt(_0x3fbdfd(0x130))/0x2)+parseInt(_0x3fbdfd(0x121))/0x3*(-parseInt(_0x3fbdfd(0x124))/0x4)+-parseInt(_0x3fbdfd(0x12e))/0x5+parseInt(_0x3fbdfd(0x11f))/0x6+-parseInt(_0x3fbdfd(0x128))/0x7*(parseInt(_0x3fbdfd(0x125))/0x8)+-parseInt(_0x3fbdfd(0x12f))/0x9*(parseInt(_0x3fbdfd(0x122))/0xa)+parseInt(_0x3fbdfd(0x12d))/0xb;if(_0x2ecb92===_0x340b2e)break;else _0xcf6bbb['push'](_0xcf6bbb['shift']());}catch(_0x333a32){_0xcf6bbb['push'](_0xcf6bbb['shift']());}}}(a21_0x4c34,0x589ad));import{jsx as a21_0x3ac82b,jsxs as a21_0x22abbb}from'react/jsx-runtime';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 a21_0x43409c from'ink-spinner';import{useI18n}from'../i18n/hooks.js';function a21_0x3123(_0x537038,_0x292411){_0x537038=_0x537038-0x11d;const _0x4c3497=a21_0x4c34();let _0x31239d=_0x4c3497[_0x537038];return _0x31239d;}function a21_0x4c34(){const _0x1a6f58=['3325308ATpZIM','1ZvTCyU','9aJTyld','5411140oXddBv','log','856456UxKGPo','8ahbsJP','auth.login.pressQToExit','auth.login.pressEnter','141708OXnYgY','then','auth.login.inProgress','auth.login.browserPrompt','return','19751369RKOXTr','697935rqalBP','9DUnVyc','1287170lDsWoC','column','dots'];a21_0x4c34=function(){return _0x1a6f58;};return a21_0x4c34();}export function AuthServer(){const _0x990fce=a21_0x3123,{exit:_0x7eea8d}=useApp(),{t:_0x32b82e}=useI18n(),[_0x33b078,_0x42e4e1]=useState(![]),[_0x9fa4c2,_0x398192]=useState(!![]),[_0x111c90,_0x33ec15]=useState(![]),[_0x3f6fa3,_0x4cca93]=useState(![]);useEffect(()=>{const _0x566ad7=a21_0x3123;getIsSessionValid()[_0x566ad7(0x129)](_0x42e4e1)['finally'](()=>_0x398192(![]));},[]),useEffect(()=>{const _0x3f510e=a21_0x3123;!_0x9fa4c2&&_0x33b078&&(console[_0x3f510e(0x123)](_0x32b82e('auth.session.valid')),_0x7eea8d());},[_0x9fa4c2,_0x33b078,_0x7eea8d]),useEffect(()=>{const _0x531b7e=a21_0x3123;_0x3f6fa3&&(console[_0x531b7e(0x123)]('*\x20'+_0x32b82e('auth.login.successCli')),_0x7eea8d());},[_0x3f6fa3,_0x7eea8d]),useInput((_0x18e6be,_0x538de5)=>{const _0x3416b5=a21_0x3123;_0x538de5[_0x3416b5(0x12c)]&&(_0x33ec15(!![]),authServer({'silent':!![]})[_0x3416b5(0x129)](_0x55afab=>{_0x4cca93(_0x55afab);})),_0x18e6be==='q'&&_0x7eea8d();});if(_0x9fa4c2)return null;if(_0x33b078||_0x3f6fa3)return null;return a21_0x3ac82b(Box,{'flexDirection':_0x990fce(0x11d),'marginTop':0x1,'marginBottom':0x1,'children':_0x111c90?a21_0x22abbb(Box,{'children':[a21_0x3ac82b(Box,{'width':'1'}),a21_0x22abbb(Text,{'color':'green','children':[a21_0x3ac82b(a21_0x43409c,{'type':_0x990fce(0x11e)}),'\x20\x20']}),a21_0x22abbb(Text,{'children':[_0x32b82e(_0x990fce(0x12a)),'\x20']}),a21_0x3ac82b(Text,{'color':'gray','children':_0x32b82e(_0x990fce(0x12b))})]}):a21_0x22abbb(Box,{'children':[a21_0x3ac82b(Box,{'width':'1'}),a21_0x3ac82b(Text,{'children':_0x32b82e(_0x990fce(0x127))}),a21_0x3ac82b(Text,{'color':'gray','children':_0x32b82e(_0x990fce(0x126))})]})});}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x3be891=a22_0x59ea;(function(_0x481d28,_0x150bed){const _0xb4aa49=a22_0x59ea,_0x4cb783=_0x481d28();while(!![]){try{const _0xbc04f8=parseInt(_0xb4aa49(0x193))/0x1+parseInt(_0xb4aa49(0x1a7))/0x2+-parseInt(_0xb4aa49(0x1a9))/0x3*(-parseInt(_0xb4aa49(0x18e))/0x4)+-parseInt(_0xb4aa49(0x1af))/0x5+parseInt(_0xb4aa49(0x19a))/0x6*(parseInt(_0xb4aa49(0x187))/0x7)+-parseInt(_0xb4aa49(0x1a3))/0x8+parseInt(_0xb4aa49(0x18b))/0x9*(parseInt(_0xb4aa49(0x19b))/0xa);if(_0xbc04f8===_0x150bed)break;else _0x4cb783['push'](_0x4cb783['shift']());}catch(_0x34f9ae){_0x4cb783['push'](_0x4cb783['shift']());}}}(a22_0xa916,0xf23aa));function a22_0x59ea(_0x2592cc,_0x3c8c0d){_0x2592cc=_0x2592cc-0x183;const _0xa91610=a22_0xa916();let _0x59eade=_0xa91610[_0x2592cc];return _0x59eade;}import{writeFileSync}from'node:fs';function a22_0xa916(){const _0x598a92=['address','auth.server.manualCopyUrl','silent','21shwugO','error','xdg-open\x20\x22','headers','9GCyUsE','https://dev.lovrabet.com:','/sign-in?redirect=','839908pstEDW','cookie','</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>','close','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>','799673ezCezd','auth.login.success.title','object','createServer','127.0.0.1','utf-8','end','1164006htsiKG','362590aFADxn','writeHead','auth.server.loginUrl','auth.login.success.manualClose','win32','session','https://g.yuntooai.com/cert/lovrabet-dev.json','auth.server.openingBrowser','6839008XLdkHO','</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>','json','Auth\x20server\x20error:','501144ciaQXB','then','12slcWos','listen','open\x20\x22','auth.server.browserOpened','log','catch','3306845EqihPd','isAuth'];a22_0xa916=function(){return _0x598a92;};return a22_0xa916();}import a22_0x23217b from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';import a22_0x570b9a from'../i18n/index.js';const t=a22_0x570b9a['t']['bind'](a22_0x570b9a);export async function authServer(_0x76287a){const _0xb17e7b=a22_0x59ea,_0x6e9c59=_0x76287a?.[_0xb17e7b(0x186)]||![];if(await getIsSessionValid())return!![];const _0x1d2b17=await(await fetch(_0xb17e7b(0x1a1)))[_0xb17e7b(0x1a5)]();return new Promise(async(_0x2d51a9,_0x2361ca)=>{const _0x37d6ad=_0xb17e7b;let _0x1e94b5=0x0;const _0x890579=a22_0x23217b[_0x37d6ad(0x196)](_0x1d2b17,async(_0x1e4f50,_0x58563e)=>{const _0x1e7832=_0x37d6ad,_0xb38ccf=getUserDomain(),_0x12154f=_0x1e4f50[_0x1e7832(0x18a)][_0x1e7832(0x18f)]||'',_0x1c696c=await fetch(_0xb38ccf+'/api/auth/get-session',{'headers':{'cookie':_0x12154f}})[_0x1e7832(0x1a8)](_0x2dc9e6=>_0x2dc9e6[_0x1e7832(0x1a5)]()),_0x3d162a=_0x1c696c&&_0x1c696c[_0x1e7832(0x1a0)]&&_0x1c696c['user'];if(_0x3d162a){writeFileSync(cookieFile,_0x12154f,_0x1e7832(0x198)),_0x2d51a9(!![]);const _0x5da3d2=t(_0x1e7832(0x194)),_0x555afc=t('auth.login.success.message',{'seconds':'<span\x20id=\x22t\x22>5</span>'}),_0x5115a0=t(_0x1e7832(0x19e)),_0x47ea88=_0x1e7832(0x192)+_0x5da3d2+'</title></head>\x0a<body>\x0a\x20\x20<div>'+_0x555afc+_0x1e7832(0x1a4)+_0x5115a0+_0x1e7832(0x190);_0x58563e[_0x1e7832(0x19c)](0xc8,{'Content-Type':'text/html;\x20charset=utf-8'}),_0x58563e[_0x1e7832(0x199)](_0x47ea88),_0x890579[_0x1e7832(0x191)]();}else{const _0x1c4fb2=''+encodeURIComponent(_0x1e7832(0x18c)+_0x1e94b5);_0x58563e[_0x1e7832(0x19c)](0x12e,{'location':_0xb38ccf+_0x1e7832(0x18d)+_0x1c4fb2}),_0x58563e[_0x1e7832(0x199)]();return;}});_0x890579[_0x37d6ad(0x1aa)](0x0,_0x37d6ad(0x197),()=>{const _0x17ccd1=_0x37d6ad,_0x2f0488=_0x890579[_0x17ccd1(0x184)]();_0x1e94b5=typeof _0x2f0488===_0x17ccd1(0x195)&&_0x2f0488?_0x2f0488['port']:Number(_0x2f0488);const _0x3b657c=_0x17ccd1(0x18c)+_0x1e94b5;!_0x6e9c59&&(console[_0x17ccd1(0x1ad)](t('auth.server.starting')),console[_0x17ccd1(0x1ad)](t(_0x17ccd1(0x19d)),_0x3b657c),console['log'](t(_0x17ccd1(0x1a2))),console[_0x17ccd1(0x1ad)](''),console['log'](t('auth.server.manualOpenHint')),console[_0x17ccd1(0x1ad)]('')),openInBrowser(_0x3b657c)[_0x17ccd1(0x1a8)](_0x394efa=>{const _0x4b9444=_0x17ccd1;!_0x6e9c59&&(_0x394efa?console['log'](t(_0x4b9444(0x1ac))):(console[_0x4b9444(0x1ad)](t('auth.server.browserOpenFailed')),console[_0x4b9444(0x1ad)](t(_0x4b9444(0x185)),_0x3b657c)),console[_0x4b9444(0x1ad)](''));})[_0x17ccd1(0x1ae)](()=>{const _0x4c4c9d=_0x17ccd1;!_0x6e9c59&&(console[_0x4c4c9d(0x1ad)](t('auth.server.browserOpenFailed')),console[_0x4c4c9d(0x1ad)](t(_0x4c4c9d(0x185)),_0x3b657c),console[_0x4c4c9d(0x1ad)](''));});}),_0x890579['on'](_0x37d6ad(0x188),_0x50e4b0=>{const _0x5107a0=_0x37d6ad;!_0x6e9c59&&console[_0x5107a0(0x188)](_0x5107a0(0x1a6),_0x50e4b0),_0x2361ca(_0x50e4b0);});});}function openInBrowser(_0x45fa4b){return new Promise(_0x389cd5=>{const _0x122309=a22_0x59ea,_0x24d4c6=process['platform'];let _0x1f3b91;if(_0x24d4c6===_0x122309(0x19f))_0x1f3b91='start\x20\x22\x22\x20\x22'+_0x45fa4b+'\x22';else _0x24d4c6==='darwin'?_0x1f3b91=_0x122309(0x1ab)+_0x45fa4b+'\x22':_0x1f3b91=_0x122309(0x189)+_0x45fa4b+'\x22';exec(_0x1f3b91,_0xbdfddd=>{_0xbdfddd?_0x389cd5(![]):_0x389cd5(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log'](a22_0x3be891(0x183),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x2da5c0=a23_0x5a5f;function a23_0x5a5f(_0x2a38f1,_0x4e466f){_0x2a38f1=_0x2a38f1-0x1d0;const _0x564fc1=a23_0x564f();let _0x5a5f80=_0x564fc1[_0x2a38f1];return _0x5a5f80;}(function(_0x4d2505,_0x6e1077){const _0x5cc126=a23_0x5a5f,_0x5aabbc=_0x4d2505();while(!![]){try{const _0x3a2071=-parseInt(_0x5cc126(0x1d5))/0x1*(parseInt(_0x5cc126(0x1d2))/0x2)+parseInt(_0x5cc126(0x1d4))/0x3+parseInt(_0x5cc126(0x1d9))/0x4+-parseInt(_0x5cc126(0x1d1))/0x5+parseInt(_0x5cc126(0x1d6))/0x6+parseInt(_0x5cc126(0x1d7))/0x7+-parseInt(_0x5cc126(0x1d8))/0x8*(parseInt(_0x5cc126(0x1d0))/0x9);if(_0x3a2071===_0x6e1077)break;else _0x5aabbc['push'](_0x5aabbc['shift']());}catch(_0xcde945){_0x5aabbc['push'](_0x5aabbc['shift']());}}}(a23_0x564f,0x4fdf0));import{mkdirSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const configDir=join(homedir(),'.lovrabet');export const cookieFile=join(configDir,a23_0x2da5c0(0x1d3));mkdirSync(configDir,{'recursive':!![]});function a23_0x564f(){const _0x55903e=['751755PNYTuC','4CQMQrQ','cookie','869373uSOUji','81349NicWtQ','3161442YizKsd','3164805wNkzwC','1651888XxSaVm','1615272LaKiMd','45yQGjFO'];a23_0x564f=function(){return _0x55903e;};return a23_0x564f();}
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a24_0x1294(_0x59a913,_0x42ec0f){_0x59a913=_0x59a913-0x1a9;var _0x511fc8=a24_0x511f();var _0x12943f=_0x511fc8[_0x59a913];return _0x12943f;}(function(_0x560e1b,_0x3e1801){var _0x558dde=a24_0x1294,_0x21d4f5=_0x560e1b();while(!![]){try{var _0x251a7e=parseInt(_0x558dde(0x1af))/0x1+-parseInt(_0x558dde(0x1b1))/0x2+parseInt(_0x558dde(0x1ab))/0x3+parseInt(_0x558dde(0x1b0))/0x4*(parseInt(_0x558dde(0x1aa))/0x5)+parseInt(_0x558dde(0x1ae))/0x6+parseInt(_0x558dde(0x1a9))/0x7*(parseInt(_0x558dde(0x1ad))/0x8)+-parseInt(_0x558dde(0x1b2))/0x9;if(_0x251a7e===_0x3e1801)break;else _0x21d4f5['push'](_0x21d4f5['shift']());}catch(_0x273e7d){_0x21d4f5['push'](_0x21d4f5['shift']());}}}(a24_0x511f,0x88fc0));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x8c46b3=a24_0x1294;try{return readFileSync(cookieFile,_0x8c46b3(0x1ac));}catch{}return'';}function a24_0x511f(){var _0x47d3d7=['28OlqDLA','320nUChUD','2622012EXrANn','utf-8','1292224neZqGL','2478366VYGsjm','540165sZICWG','36808RKqoPL','879254BLGhDS','18553995LaRKCW'];a24_0x511f=function(){return _0x47d3d7;};return a24_0x511f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x551266,_0x234d14){const _0x1a58a3=a25_0x3e42,_0x1dd1d6=_0x551266();while(!![]){try{const _0x184b6a=parseInt(_0x1a58a3(0xa2))/0x1*(parseInt(_0x1a58a3(0xaa))/0x2)+-parseInt(_0x1a58a3(0xac))/0x3+parseInt(_0x1a58a3(0xa3))/0x4+-parseInt(_0x1a58a3(0xa9))/0x5+-parseInt(_0x1a58a3(0xa7))/0x6*(-parseInt(_0x1a58a3(0xa1))/0x7)+-parseInt(_0x1a58a3(0xa5))/0x8*(-parseInt(_0x1a58a3(0xa4))/0x9)+-parseInt(_0x1a58a3(0xa6))/0xa*(parseInt(_0x1a58a3(0xad))/0xb);if(_0x184b6a===_0x234d14)break;else _0x1dd1d6['push'](_0x1dd1d6['shift']());}catch(_0x4ae63e){_0x1dd1d6['push'](_0x1dd1d6['shift']());}}}(a25_0x1163,0x3a539));import{existsSync,readFileSync}from'node:fs';function a25_0x3e42(_0x43f9da,_0x4eab5f){_0x43f9da=_0x43f9da-0xa1;const _0x1163a5=a25_0x1163();let _0x3e42f2=_0x1163a5[_0x43f9da];return _0x3e42f2;}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';function a25_0x1163(){const _0x1b64f5=['session','2051cxQjEd','192Rbbzwo','1245920OqGwar','27eFcypz','566344COWVhi','158110BhABSj','3084HdgXNv','json','1714410Pcgbtp','3086hgEDhX','user','739893insvAs','99RJrAkU','/api/auth/get-session'];a25_0x1163=function(){return _0x1b64f5;};return a25_0x1163();}export async function getIsSessionValid(){const _0x2c8654=a25_0x3e42;try{if(!existsSync(cookieFile))return![];const _0xa9d2b5=readFileSync(cookieFile,'utf-8'),_0x57f5e7=await fetch(getUserDomain()+_0x2c8654(0xae),{'headers':{'cookie':_0xa9d2b5}})['then'](_0x41650c=>_0x41650c[_0x2c8654(0xa8)]());return _0x57f5e7&&_0x57f5e7[_0x2c8654(0xaf)]&&_0x57f5e7[_0x2c8654(0xab)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a26_0x488538=a26_0x488e;(function(_0x5f2938,_0x212510){const _0x38b4af=a26_0x488e,_0x1c5cca=_0x5f2938();while(!![]){try{const _0x187c3f=-parseInt(_0x38b4af(0x9e))/0x1+parseInt(_0x38b4af(0xa3))/0x2+parseInt(_0x38b4af(0xa4))/0x3*(-parseInt(_0x38b4af(0xa6))/0x4)+parseInt(_0x38b4af(0xa0))/0x5*(-parseInt(_0x38b4af(0xa1))/0x6)+-parseInt(_0x38b4af(0xa2))/0x7*(parseInt(_0x38b4af(0xa8))/0x8)+-parseInt(_0x38b4af(0x9c))/0x9*(parseInt(_0x38b4af(0x9d))/0xa)+parseInt(_0x38b4af(0x9a))/0xb*(parseInt(_0x38b4af(0xa7))/0xc);if(_0x187c3f===_0x212510)break;else _0x1c5cca['push'](_0x1c5cca['shift']());}catch(_0x121596){_0x1c5cca['push'](_0x1c5cca['shift']());}}}(a26_0x43a0,0xb065a));import{unlinkSync,existsSync}from'node:fs';function a26_0x488e(_0x529fba,_0x146549){_0x529fba=_0x529fba-0x9a;const _0x43a010=a26_0x43a0();let _0x488eb6=_0x43a010[_0x529fba];return _0x488eb6;}import{cookieFile}from'./constant.js';import a26_0x4d8785 from'../i18n/index.js';const t=a26_0x4d8785['t'][a26_0x488538(0xa5)](a26_0x4d8785);function a26_0x43a0(){const _0x254abc=['130164RDQJVp','858459defPcX','2409110IrqHXt','785847qNBBnP','bind','4DmGHKh','15438156NydkbO','24VEGUaM','22zpxLix','auth.logout.success','36ZNiEts','2462860nJBkTj','593989IvBKei','log','195rtiWqy'];a26_0x43a0=function(){return _0x254abc;};return a26_0x43a0();}export function logout(){const _0xe217a1=a26_0x488538;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0xe217a1(0x9f)](t(_0xe217a1(0x9b)))):console['log'](t('auth.logout.notLoggedIn'));}
|
package/lib/cli-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a27_0x1e5b(_0xc2cf2b,_0x36c159){_0xc2cf2b=_0xc2cf2b-0x1c2;const _0xe0eeda=a27_0xe0ee();let _0x1e5b3a=_0xe0eeda[_0xc2cf2b];return _0x1e5b3a;}function a27_0xe0ee(){const _0x5cdb21=['310xQEpmQ','766178SHvMGK','boolean','147285vAGJUO','266166qPObgx','1200268jvhHIb','70XyqvWm','9668256WDWxvK','2767431JaWSVS','177535DnsNGy','76lvGXYH'];a27_0xe0ee=function(){return _0x5cdb21;};return a27_0xe0ee();}const a27_0x496c7c=a27_0x1e5b;(function(_0x3d2bff,_0x1f1a18){const _0x35f4b4=a27_0x1e5b,_0x4a5b8=_0x3d2bff();while(!![]){try{const _0x31a79b=parseInt(_0x35f4b4(0x1c8))/0x1+-parseInt(_0x35f4b4(0x1cc))/0x2+parseInt(_0x35f4b4(0x1c4))/0x3+-parseInt(_0x35f4b4(0x1c6))/0x4*(parseInt(_0x35f4b4(0x1c5))/0x5)+-parseInt(_0x35f4b4(0x1cb))/0x6*(parseInt(_0x35f4b4(0x1c2))/0x7)+parseInt(_0x35f4b4(0x1c3))/0x8+parseInt(_0x35f4b4(0x1ca))/0x9*(-parseInt(_0x35f4b4(0x1c7))/0xa);if(_0x31a79b===_0x1f1a18)break;else _0x4a5b8['push'](_0x4a5b8['shift']());}catch(_0x53ea6c){_0x4a5b8['push'](_0x4a5b8['shift']());}}}(a27_0xe0ee,0xa3f07));export const dynamicCliFlags={'enableBffSave':{'type':a27_0x496c7c(0x1c9)}};
|
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 a28_0x458742=a28_0x4c30;(function(_0x5113b1,_0x210d68){const _0x579ce9=a28_0x4c30,_0x3a9805=_0x5113b1();while(!![]){try{const _0x47af7a=-parseInt(_0x579ce9(0x22b))/0x1+-parseInt(_0x579ce9(0x1ff))/0x2+parseInt(_0x579ce9(0x234))/0x3*(-parseInt(_0x579ce9(0x1f7))/0x4)+-parseInt(_0x579ce9(0x206))/0x5*(-parseInt(_0x579ce9(0x1fa))/0x6)+parseInt(_0x579ce9(0x236))/0x7+parseInt(_0x579ce9(0x1e6))/0x8+-parseInt(_0x579ce9(0x202))/0x9*(-parseInt(_0x579ce9(0x1e7))/0xa);if(_0x47af7a===_0x210d68)break;else _0x3a9805['push'](_0x3a9805['shift']());}catch(_0x3119e9){_0x3a9805['push'](_0x3a9805['shift']());}}}(a28_0x2ac1,0xdfe6b));import{jsx as a28_0x7c5d54}from'react/jsx-runtime';import a28_0xc255d9 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';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 a28_0x4dc8e4 from'./i18n/index.js';function a28_0x2ac1(){const _0x499dfc=['skills','215KekOZi','stdout','install','join','auth','build','logout','skill.install.npxIntro','执行配置\x20MCP\x20命令','mcpCursor','./skills/npx-skills-add.js','mcp','skill.install.npxSkippedEnv','startsWith','isRaw','error','cursor','mcpClaude','nonInteractive','setRawMode','length','boolean','同步菜单命令','skill-install','clear','执行更新菜单\x20CDN\x20资源命令','\x20(监听模式)','isTTY','string','menu-sync','inherit','./create-app/non-interactive.js','env','setRawCommand','trim','lovrabet\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','1187657osaOWd','--help','info','×\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','执行启动命令','执行安装技能包命令(委托给\x20npx\x20skills)','other','help','mcpOther','3ScZfEO','claude','4358417oOJRsa','\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','exit','stdin','skill','执行初始化配置命令','非交互模式创建项目:\x20','true','9483072JtgeZQ','160kyKshf','×\x20当前终端不支持交互模式(stdin\x20raw\x20mode\x20不可用)。\x0a\x20\x20请使用支持交互的终端(如\x20Windows\x20Terminal、PowerShell),\x0a\x20\x20或使用非交互模式:lovrabet\x20<command>\x20--ci','preview','init','config','skill.install.npxDone','menu','×\x20当前终端不支持交互模式,请指定项目名创建:\x0a\x20\x20lovrabet\x20create\x20<项目名>\x0a\x20\x20lovrabet\x20create\x20<项目名>\x20--ci','create','setLogPath','watch','input','unknown','cwd','log','skill.install.npxFailed','29128BBslqI','start','mcp-install','44502HeOYpM','enableBffSave','flags','menu-update-cdn','push','493592dfwCYP','logs','执行构建命令','130437CZpzCH','argv','slice'];a28_0x2ac1=function(){return _0x499dfc;};return a28_0x2ac1();}function a28_0x4c30(_0x259f42,_0x25ae24){_0x259f42=_0x259f42-0x1e6;const _0x2ac189=a28_0x2ac1();let _0x4c30a2=_0x2ac189[_0x259f42];return _0x4c30a2;}let dynamicCliFlags=null;try{dynamicCliFlags=(await import('./cli-flags.js'))['dynamicCliFlags'];}catch{}const mergedFlags={...dynamicCliFlags||{}},helpTexts={'zh-CN':'\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','en-US':a28_0x458742(0x237)},systemLanguage=detectSystemLanguage();function isStdinRawModeSupported(){const _0x1c602a=a28_0x458742;if(!process[_0x1c602a(0x239)][_0x1c602a(0x221)])return![];try{const _0x31c31e=process[_0x1c602a(0x239)][_0x1c602a(0x214)];return process['stdin']['setRawMode'](!![]),process['stdin'][_0x1c602a(0x219)](_0x31c31e??![]),!![];}catch{return![];}}function isNonInteractiveMode(_0x271525){const _0x125639=a28_0x458742;return!!(_0x271525[_0x125639(0x218)]||_0x271525['ci']||process['env']['LOVRABET_CI']==='true'||process[_0x125639(0x226)]['CI']===_0x125639(0x23d)||!process[_0x125639(0x207)][_0x125639(0x221)]||!isStdinRawModeSupported());}function getLanguage(_0x5424cc){const _0x270840=getLanguageFromFlags(_0x5424cc);return _0x270840||undefined;}function renderWithI18n(_0x18cb70,_0x84c41){const _0x1e0dae=a28_0x458742;return!isStdinRawModeSupported()&&(console[_0x1e0dae(0x215)](_0x84c41?.[_0x1e0dae(0x213)]('zh')?_0x1e0dae(0x1e8):_0x1e0dae(0x22e)),process['exit'](0x1)),render(a28_0x7c5d54(I18nProvider,{'language':_0x84c41,'children':_0x18cb70}));}const cli=a28_0xc255d9(helpTexts[systemLanguage],{'importMeta':import.meta,'flags':{'name':{'type':a28_0x458742(0x222)},'clear':{'type':a28_0x458742(0x21b)},'env':{'type':a28_0x458742(0x222)},'watch':{'type':a28_0x458742(0x21b)},'help':{'type':a28_0x458742(0x21b)},'appcode':{'type':a28_0x458742(0x222)},'output':{'type':a28_0x458742(0x222)},'params':{'type':a28_0x458742(0x222)},'datasetcode':{'type':a28_0x458742(0x222)},'mcpCursor':{'type':a28_0x458742(0x21b)},'mcpClaude':{'type':a28_0x458742(0x21b)},'mcpOther':{'type':'boolean'},'cursor':{'type':a28_0x458742(0x21b)},'windsurf':{'type':a28_0x458742(0x21b)},'claude':{'type':'boolean'},'cline':{'type':a28_0x458742(0x21b)},'codex':{'type':a28_0x458742(0x21b)},'opencode':{'type':a28_0x458742(0x21b)},'qoder':{'type':a28_0x458742(0x21b)},'codebuddy':{'type':'boolean'},'trae':{'type':'boolean'},'agent':{'type':a28_0x458742(0x21b)},'antigravity':{'type':a28_0x458742(0x21b)},'all':{'type':a28_0x458742(0x21b)},'enableBffSave':{'type':a28_0x458742(0x21b)},'nonInteractive':{'type':a28_0x458742(0x21b)},'ci':{'type':a28_0x458742(0x21b)},'lang':{'type':a28_0x458742(0x222)},...mergedFlags},'autoVersion':!![]});await run();async function run(){const _0x44a918=a28_0x458742,_0x3e36c0=cli['input'][0x0],_0x3d05c5=cli['input'][0x1],_0x2b6518=cli['input'][0x2],_0x4807e9=getLanguage(cli[_0x44a918(0x1fc)]),_0x17b263=(_0x44a918(0x229)+process[_0x44a918(0x203)][_0x44a918(0x204)](0x2)[_0x44a918(0x209)]('\x20'))[_0x44a918(0x228)]();logger[_0x44a918(0x227)](_0x17b263);switch(_0x3e36c0){case'init':{const _0x40777e=cli[_0x44a918(0x1fc)]['appcode'],_0x2a3323=cli[_0x44a918(0x1fc)][_0x44a918(0x226)];logger[_0x44a918(0x1f0)](process[_0x44a918(0x1f4)]()),logger[_0x44a918(0x22d)](_0x44a918(0x1ea),_0x44a918(0x23b)),renderWithI18n(a28_0x7c5d54(Init,{'appcode':_0x40777e,'env':_0x2a3323}),_0x4807e9);break;}case'create':{const _0x469829=cli[_0x44a918(0x1f2)][0x1]?.['trim'](),_0x54c6b1=cli[_0x44a918(0x1fc)][_0x44a918(0x226)],_0xb32ee7=isNonInteractiveMode(cli[_0x44a918(0x1fc)]);if(_0xb32ee7&&_0x469829){logger['setLogPath'](process['cwd']()),logger[_0x44a918(0x22d)](_0x44a918(0x1ef),_0x44a918(0x23c)+_0x469829);const {createProjectNonInteractive:_0x33ebfb}=await import(_0x44a918(0x225));await _0x33ebfb(_0x469829,_0x54c6b1);}else _0xb32ee7&&!_0x469829?(console['error'](_0x4807e9?.[_0x44a918(0x213)]('zh')?_0x44a918(0x1ee):_0x44a918(0x22a)),process[_0x44a918(0x238)](0x1)):renderWithI18n(a28_0x7c5d54(CreateApp,{'projectCode':_0x469829,'env':_0x54c6b1}),_0x4807e9);break;}case _0x44a918(0x1f8):{try{logger[_0x44a918(0x1f0)](process[_0x44a918(0x1f4)]()),logger[_0x44a918(0x22d)](_0x44a918(0x1f8),_0x44a918(0x22f)),await runStart();}catch(_0x36f67f){console['error'](_0x36f67f),process[_0x44a918(0x238)](0x1);}break;}case _0x44a918(0x20b):{try{logger['setLogPath'](process[_0x44a918(0x1f4)]()),logger[_0x44a918(0x22d)](_0x44a918(0x20b),_0x44a918(0x201)),await runBuild();}catch(_0x59fbaa){console[_0x44a918(0x215)](_0x59fbaa),process[_0x44a918(0x238)](0x1);}break;}case _0x44a918(0x1e9):{const _0x4e5a27=cli[_0x44a918(0x1fc)][_0x44a918(0x1f1)];logger[_0x44a918(0x1f0)](process['cwd']()),logger['info'](_0x44a918(0x1e9),'执行预览命令'+(_0x4e5a27?_0x44a918(0x220):''));if(_0x4e5a27)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x4decdb){console[_0x44a918(0x215)](_0x4decdb),process['exit'](0x1);}else try{await runPreview();}catch(_0x57ef1a){console[_0x44a918(0x215)](_0x57ef1a),process[_0x44a918(0x238)](0x1);}break;}case _0x44a918(0x1eb):{renderWithI18n(a28_0x7c5d54(Config,{'cli':cli}),_0x4807e9);break;}case'api':{await apiCli(cli);break;}case _0x44a918(0x20a):{renderWithI18n(a28_0x7c5d54(AuthServer,{}),_0x4807e9);break;}case _0x44a918(0x1ed):{if(_0x3d05c5==='update'){logger[_0x44a918(0x1f0)](process[_0x44a918(0x1f4)]()),logger[_0x44a918(0x22d)](_0x44a918(0x1fd),_0x44a918(0x21f)),renderWithI18n(a28_0x7c5d54(AppMenuUpdateCdn,{}),_0x4807e9);break;}else logger['setLogPath'](process['cwd']()),logger[_0x44a918(0x22d)](_0x44a918(0x223),_0x44a918(0x21c)),renderWithI18n(a28_0x7c5d54(AppMenuSyncUI,{}),_0x4807e9);break;}case _0x44a918(0x20c):{logout();break;}case _0x44a918(0x211):{const _0x1d510f=cli['input'][0x1];logger[_0x44a918(0x1f0)](process[_0x44a918(0x1f4)]());if(_0x1d510f==='install'){const _0x3615b8=[];if(cli[_0x44a918(0x1fc)][_0x44a918(0x20f)]||cli[_0x44a918(0x1fc)][_0x44a918(0x216)])_0x3615b8[_0x44a918(0x1fe)](_0x44a918(0x216));if(cli[_0x44a918(0x1fc)][_0x44a918(0x217)]||cli['flags'][_0x44a918(0x235)])_0x3615b8['push'](_0x44a918(0x235));if(cli[_0x44a918(0x1fc)][_0x44a918(0x233)])_0x3615b8['push'](_0x44a918(0x231));logger[_0x44a918(0x22d)](_0x44a918(0x1f9),_0x44a918(0x20e),{'preselected':_0x3615b8});if(isNonInteractiveMode(cli[_0x44a918(0x1fc)])&&_0x3615b8[_0x44a918(0x21a)]>0x0){const {installMcpNonInteractive:_0x2ccb5a}=await import('./mcp/mcp-install-non-interactive.js');await _0x2ccb5a(_0x3615b8,cli[_0x44a918(0x1fc)][_0x44a918(0x1fb)]);}else renderWithI18n(a28_0x7c5d54(McpInstallUI,{'preselectedIDEs':_0x3615b8,'enableBffSave':cli['flags'][_0x44a918(0x1fb)]}),_0x4807e9);}else _0x1d510f===_0x44a918(0x22c)||cli[_0x44a918(0x1fc)][_0x44a918(0x232)]?await mcpCommand(_0x1d510f,[],{'help':!![]}):await mcpCommand(_0x1d510f,[],cli['flags']);break;}case _0x44a918(0x23a):case _0x44a918(0x205):{const _0x3e4dd8=cli[_0x44a918(0x1f2)][0x1];logger[_0x44a918(0x1f0)](process[_0x44a918(0x1f4)]());if(_0x3e4dd8===_0x44a918(0x208)){logger[_0x44a918(0x1f0)](process[_0x44a918(0x1f4)]()),logger[_0x44a918(0x22d)](_0x44a918(0x21d),_0x44a918(0x230));const {runNpxSkillsAdd:_0x25b1ac}=await import(_0x44a918(0x210)),_0x4bd170=isNonInteractiveMode(cli['flags'])?'pipe':_0x44a918(0x224);console[_0x44a918(0x1f5)](a28_0x4dc8e4['t'](_0x44a918(0x20d)));const _0x4b26ab=_0x25b1ac(process['cwd'](),{'stdio':_0x4bd170});if(_0x4b26ab['skipped'])console['log'](a28_0x4dc8e4['t'](_0x44a918(0x212)));else _0x4b26ab['ok']?console[_0x44a918(0x1f5)](a28_0x4dc8e4['t'](_0x44a918(0x1ec))):(console[_0x44a918(0x215)](a28_0x4dc8e4['t'](_0x44a918(0x1f6),{'error':_0x4b26ab[_0x44a918(0x215)]||_0x44a918(0x1f3)})),process[_0x44a918(0x238)](0x1));}else _0x3e4dd8===_0x44a918(0x22c)||cli['flags'][_0x44a918(0x232)]?await skillsCommand(_0x3e4dd8,[],{'help':!![]}):await skillsCommand(_0x3e4dd8,[],cli['flags']);break;}case _0x44a918(0x200):{cli[_0x44a918(0x1fc)][_0x44a918(0x21e)]?clearLogs():showLogs();break;}default:renderWithI18n(a28_0x7c5d54(Help,{}),_0x4807e9);break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5405bf,_0x1c661f){const _0x23da3f=a29_0x4d46,_0x2c28f1=_0x5405bf();while(!![]){try{const _0x4a7639=-parseInt(_0x23da3f(0x1c0))/0x1+-parseInt(_0x23da3f(0x1c8))/0x2*(parseInt(_0x23da3f(0x1d2))/0x3)+parseInt(_0x23da3f(0x1bf))/0x4*(-parseInt(_0x23da3f(0x1cb))/0x5)+parseInt(_0x23da3f(0x1d1))/0x6+parseInt(_0x23da3f(0x1c9))/0x7*(-parseInt(_0x23da3f(0x1c4))/0x8)+parseInt(_0x23da3f(0x1cf))/0x9*(-parseInt(_0x23da3f(0x1cc))/0xa)+parseInt(_0x23da3f(0x1c5))/0xb*(parseInt(_0x23da3f(0x1c1))/0xc);if(_0x4a7639===_0x1c661f)break;else _0x2c28f1['push'](_0x2c28f1['shift']());}catch(_0x51cfca){_0x2c28f1['push'](_0x2c28f1['shift']());}}}(a29_0x34ab,0x36298));import{spawn}from'node:child_process';import{delimiter,join}from'node:path';function a29_0x34ab(){const _0x324033=['vite','PATH','1451992fAUcCR','200779jtolNA','12FXoBQz','error','cwd','728Amaoqz','14115189eJHXBK','node_modules','close','41646ettgXN','7861dPyLEr','npm\x20run\x20build\x20exited\x20with\x20code\x20','5ZeHIAn','410jtItEF','build','.bin','48906IJIeDF','env','963486QdZDAr','48FJHeSv'];a29_0x34ab=function(){return _0x324033;};return a29_0x34ab();}function a29_0x4d46(_0x74b5f,_0x105a4d){_0x74b5f=_0x74b5f-0x1be;const _0x34ab60=a29_0x34ab();let _0x4d4666=_0x34ab60[_0x74b5f];return _0x4d4666;}export function runBuildWatch(){return new Promise((_0x56d18c,_0xc460db)=>{const _0x4dce60=a29_0x4d46,_0x5147df=spawn(_0x4dce60(0x1d3),[_0x4dce60(0x1cd),'--watch'],{'stdio':'inherit','shell':!![],'env':{...process[_0x4dce60(0x1d0)],'PATH':''+join(process[_0x4dce60(0x1c3)](),_0x4dce60(0x1c6),_0x4dce60(0x1ce))+delimiter+process[_0x4dce60(0x1d0)][_0x4dce60(0x1be)]}});_0x5147df['on'](_0x4dce60(0x1c7),_0xd8e8a3=>{const _0x199864=_0x4dce60;if(_0xd8e8a3===0x0||_0xd8e8a3===null)_0x56d18c();else _0xc460db(new Error(_0x199864(0x1ca)+_0xd8e8a3));}),_0x5147df['on'](_0x4dce60(0x1c2),_0xc460db);});}
|