@lovrabet/cli 1.3.4 → 1.4.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/update-menu.js +1 -0
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-execa.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -1
- package/lib/i18n/hooks.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/i18n/locales/en-US.js +1 -1
- package/lib/i18n/locales/zh-CN.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -0
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +5 -5
- package/sidecar/flags.json +10 -0
- package/templates/rules/lovrabet_rules.mdc.tpl +891 -0
- package/templates/skill/SKILL.md.tpl +120 -0
- package/lib/ai-setup/AISetupUI.js +0 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
- package/lib/skills/SkillInstallUI.js +0 -1
- package/lib/skills/skill-install-non-interactive.js +0 -1
- package/lib/skills/skill-installer.js +0 -1
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a32_0x52fa(_0xa273ec,_0x41a51d){_0xa273ec=_0xa273ec-0x123;const _0x20bc8d=a32_0x20bc();let _0x52faa4=_0x20bc8d[_0xa273ec];return _0x52faa4;}const a32_0x29041e=a32_0x52fa;(function(_0x3cc93b,_0x25015e){const _0x44f2f2=a32_0x52fa,_0x4c92f5=_0x3cc93b();while(!![]){try{const _0x29f98c=parseInt(_0x44f2f2(0x136))/0x1*(-parseInt(_0x44f2f2(0x143))/0x2)+-parseInt(_0x44f2f2(0x144))/0x3*(-parseInt(_0x44f2f2(0x13f))/0x4)+parseInt(_0x44f2f2(0x12a))/0x5+parseInt(_0x44f2f2(0x141))/0x6+parseInt(_0x44f2f2(0x128))/0x7*(-parseInt(_0x44f2f2(0x126))/0x8)+parseInt(_0x44f2f2(0x132))/0x9*(-parseInt(_0x44f2f2(0x135))/0xa)+parseInt(_0x44f2f2(0x127))/0xb*(parseInt(_0x44f2f2(0x134))/0xc);if(_0x29f98c===_0x25015e)break;else _0x4c92f5['push'](_0x4c92f5['shift']());}catch(_0x595ed7){_0x4c92f5['push'](_0x4c92f5['shift']());}}}(a32_0x20bc,0xd8924));import{logger}from'../utils/logger.js';import a32_0x280ea0 from'../i18n/index.js';const t=a32_0x280ea0['t'][a32_0x29041e(0x125)](a32_0x280ea0);export function showLogs(){const _0x16df0d=a32_0x29041e;logger[_0x16df0d(0x146)](process['cwd']());const _0x26277b=logger[_0x16df0d(0x142)]();if(_0x26277b[_0x16df0d(0x12b)]===0x0){console[_0x16df0d(0x145)](t('logs.noLogs'));return;}console['log'](t(_0x16df0d(0x13d))),_0x26277b[_0x16df0d(0x13a)]((_0x1e80a2,_0x5e4cb2)=>{const _0x1df8b9=_0x16df0d,_0x3d9433=a32_0x280ea0[_0x1df8b9(0x12f)]===_0x1df8b9(0x133)?_0x1df8b9(0x133):_0x1df8b9(0x130),_0x314938=new Date(_0x1e80a2[_0x1df8b9(0x139)])['toLocaleString'](_0x3d9433),_0x44a1c6=_0x1e80a2[_0x1df8b9(0x123)]===_0x1df8b9(0x124)?'√':_0x1e80a2[_0x1df8b9(0x123)]===_0x1df8b9(0x12d)?'×':_0x1e80a2[_0x1df8b9(0x123)]===_0x1df8b9(0x12c)?'!':'i';console[_0x1df8b9(0x145)](_0x5e4cb2+0x1+'.\x20'+_0x44a1c6+'\x20['+_0x1e80a2[_0x1df8b9(0x131)]+']\x20'+_0x1e80a2['message']),console[_0x1df8b9(0x145)](t(_0x1df8b9(0x13e),{'time':_0x314938})),_0x1e80a2[_0x1df8b9(0x12e)]&&console['log'](t(_0x1df8b9(0x129),{'duration':_0x1e80a2[_0x1df8b9(0x12e)]})),_0x1e80a2[_0x1df8b9(0x13b)]&&Object[_0x1df8b9(0x138)](_0x1e80a2[_0x1df8b9(0x13b)])[_0x1df8b9(0x12b)]>0x0&&console[_0x1df8b9(0x145)](t(_0x1df8b9(0x13c),{'details':JSON[_0x1df8b9(0x140)](_0x1e80a2[_0x1df8b9(0x13b)],null,0x2)})),console['log']('');});}export function clearLogs(){const _0x96f2cf=a32_0x29041e;logger[_0x96f2cf(0x146)](process[_0x96f2cf(0x137)]()),logger['clearLogs'](),console['log'](t('logs.cleared'));}function a32_0x20bc(){const _0x2e7b04=['stringify','6283020jtcaGW','readLogs','3075308zzjtzn','3925431hgbxkG','log','setLogPath','level','success','bind','32ZqAgco','605231ooxYVs','1896769lfcMgK','logs.duration','2574225rSCxfG','length','warn','error','duration','language','en-US','command','3222XSrOkx','zh-CN','216BaRmTQ','9840HBBgeg','1GHtKsl','cwd','keys','timestamp','forEach','details','logs.details','logs.header','logs.time','4XnhMoU'];a32_0x20bc=function(){return _0x2e7b04;};return a32_0x20bc();}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x18166c,_0x5644ce){const _0x127bf7=a33_0x447a,_0x1744a1=_0x18166c();while(!![]){try{const _0x4451de=parseInt(_0x127bf7(0xa0))/0x1*(parseInt(_0x127bf7(0x93))/0x2)+-parseInt(_0x127bf7(0x95))/0x3*(-parseInt(_0x127bf7(0x89))/0x4)+parseInt(_0x127bf7(0x9b))/0x5*(parseInt(_0x127bf7(0x99))/0x6)+-parseInt(_0x127bf7(0x85))/0x7+-parseInt(_0x127bf7(0x91))/0x8*(-parseInt(_0x127bf7(0x9f))/0x9)+-parseInt(_0x127bf7(0xa2))/0xa+-parseInt(_0x127bf7(0x9e))/0xb;if(_0x4451de===_0x5644ce)break;else _0x1744a1['push'](_0x1744a1['shift']());}catch(_0x1bbf21){_0x1744a1['push'](_0x1744a1['shift']());}}}(a33_0x16fa,0xb3844));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';function a33_0x16fa(){const _0x3f1e85=['518wAGFdY','now','65961NDJejn','success','env','.bin','6sVePpz','stderr','2190625hnxvwK','close','inherit','13726548iAMWZQ','6095907lZPEPb','4962rQVZsD','data','4465620mlAVIq','8876763AdDuTF','vite\x20preview','preview','toString','236OJpbDG','info','预览服务器启动出错','error','预览服务器启动成功','vite\x20preview\x20exited\x20with\x20code\x20','trim','cwd','8AegtaO','启动预览服务器'];a33_0x16fa=function(){return _0x3f1e85;};return a33_0x16fa();}function a33_0x447a(_0x58e20e,_0x3224e2){_0x58e20e=_0x58e20e-0x85;const _0x16faf4=a33_0x16fa();let _0x447a82=_0x16faf4[_0x58e20e];return _0x447a82;}export function runPreview(){return new Promise((_0x215f71,_0x8581cf)=>{const _0x56f40b=a33_0x447a,_0x156602=Date[_0x56f40b(0x94)]();logger[_0x56f40b(0x8a)](_0x56f40b(0x87),_0x56f40b(0x92),{'command':_0x56f40b(0x86)});let _0x197bd3='';const _0x36d69f=spawn('vite',[_0x56f40b(0x87)],{'stdio':[_0x56f40b(0x9d),_0x56f40b(0x9d),'pipe'],'shell':!![],'env':{...process[_0x56f40b(0x97)],'PATH':''+join(process['cwd'](),'node_modules',_0x56f40b(0x98))+delimiter+process[_0x56f40b(0x97)]['PATH']}});_0x36d69f[_0x56f40b(0x9a)]?.['on'](_0x56f40b(0xa1),_0x2c38ef=>{const _0x628405=_0x56f40b;_0x197bd3+=_0x2c38ef[_0x628405(0x88)]();}),_0x36d69f['on'](_0x56f40b(0x9c),_0x535e4a=>{const _0x2da0b7=_0x56f40b,_0x43c5b0=Date[_0x2da0b7(0x94)]()-_0x156602;if(_0x535e4a===0x0||_0x535e4a===null)logger[_0x2da0b7(0x96)](_0x2da0b7(0x87),_0x2da0b7(0x8d),_0x43c5b0),_0x215f71();else{const _0x487d9b={'exitCode':_0x535e4a,'duration':_0x43c5b0,'command':_0x2da0b7(0x86),'cwd':process[_0x2da0b7(0x90)]()};_0x197bd3[_0x2da0b7(0x8f)]()&&(_0x487d9b[_0x2da0b7(0x9a)]=_0x197bd3[_0x2da0b7(0x8f)]()),logger[_0x2da0b7(0x8c)](_0x2da0b7(0x87),'预览服务器启动失败',_0x487d9b),_0x8581cf(new Error(_0x2da0b7(0x8e)+_0x535e4a));}}),_0x36d69f['on'](_0x56f40b(0x8c),_0x1dc1f5=>{const _0x3c1497=_0x56f40b,_0x53dc34=Date['now']()-_0x156602;logger[_0x3c1497(0x8c)](_0x3c1497(0x87),_0x3c1497(0x8b),{'error':_0x1dc1f5['message'],'duration':_0x53dc34,'stderr':_0x197bd3[_0x3c1497(0x8f)]()||undefined}),_0x8581cf(_0x1dc1f5);});});}
|
package/lib/cmd/start-execa.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30d0e5,_0x285ff8){const _0xcaed68=a34_0x25b1,_0x8655bd=_0x30d0e5();while(!![]){try{const _0x2aeda8=-parseInt(_0xcaed68(0xee))/0x1+-parseInt(_0xcaed68(0xfe))/0x2*(-parseInt(_0xcaed68(0xfa))/0x3)+-parseInt(_0xcaed68(0x10b))/0x4+-parseInt(_0xcaed68(0xfd))/0x5*(parseInt(_0xcaed68(0xf2))/0x6)+-parseInt(_0xcaed68(0xf8))/0x7*(-parseInt(_0xcaed68(0xf3))/0x8)+-parseInt(_0xcaed68(0xef))/0x9+-parseInt(_0xcaed68(0xf5))/0xa*(-parseInt(_0xcaed68(0x10a))/0xb);if(_0x2aeda8===_0x285ff8)break;else _0x8655bd['push'](_0x8655bd['shift']());}catch(_0x3d5cbe){_0x8655bd['push'](_0x8655bd['shift']());}}}(a34_0xcd0d,0x2ddfd));import{logger}from'../utils/logger.js';function a34_0x25b1(_0x27f796,_0x11b4e6){_0x27f796=_0x27f796-0xeb;const _0xcd0dd=a34_0xcd0d();let _0x25b16e=_0xcd0dd[_0x27f796];return _0x25b16e;}function a34_0xcd0d(){const _0xf1ddfe=['5fLNSmS','6IodvZa','error','currentVersion','object','version','exitCode','stableVersion','开发服务器启动失败','now','CLI\x20版本有更新','vite','inherit','9207TcYPca','129148AbnSWZ','message','info','start','env','1667WeQzZE','1629621AbAJVY','warn','cwd','190194LeqIMt','32NGBAET','needsUpgrade','160ibWtvH','SDK\x20版本有更新','success','319606EPJNsh','开发服务器启动成功','238599YOPurZ','timedOut','stderr'];a34_0xcd0d=function(){return _0xf1ddfe;};return a34_0xcd0d();}import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{execa}from'execa';export async function runStart(_0x43de4e){const _0x11a652=a34_0x25b1,_0x22f719=Date[_0x11a652(0x106)](),_0x314fcf=_0x43de4e||process[_0x11a652(0xf1)](),_0x20525b=await checkCliVersion();_0x20525b['needsUpgrade']&&(printCliUpgradeWarning(_0x20525b),logger[_0x11a652(0xf0)](_0x11a652(0xec),_0x11a652(0x107),{'currentVersion':_0x20525b[_0x11a652(0x100)],'stableVersion':_0x20525b[_0x11a652(0x104)]}));const _0x5a8952=await checkSdkVersion(_0x314fcf);_0x5a8952[_0x11a652(0xf4)]&&(printSdkUpgradeWarning(_0x5a8952),logger[_0x11a652(0xf0)](_0x11a652(0xec),_0x11a652(0xf6),{'currentVersion':_0x5a8952[_0x11a652(0x102)],'stableVersion':_0x5a8952[_0x11a652(0x104)]}));logger[_0x11a652(0xeb)](_0x11a652(0xec),'启动开发服务器',{'command':'vite','cwd':_0x314fcf});try{await execa(_0x11a652(0x108),[],{'cwd':_0x314fcf,'stdio':_0x11a652(0x109),'preferLocal':!![],'localDir':_0x314fcf,'env':{...process[_0x11a652(0xed)]}});const _0x24c890=Date[_0x11a652(0x106)]()-_0x22f719;logger[_0x11a652(0xf7)](_0x11a652(0xec),_0x11a652(0xf9),_0x24c890);}catch(_0x2b89f2){const _0x3dd08a=Date[_0x11a652(0x106)]()-_0x22f719,_0x1bb0db={'duration':_0x3dd08a,'command':_0x11a652(0x108),'cwd':_0x314fcf};if(_0x2b89f2&&typeof _0x2b89f2===_0x11a652(0x101)){const _0x197a8e=_0x2b89f2;_0x197a8e[_0x11a652(0x103)]!==undefined&&(_0x1bb0db[_0x11a652(0x103)]=_0x197a8e[_0x11a652(0x103)]),_0x197a8e['stderr']&&(_0x1bb0db[_0x11a652(0xfc)]=_0x197a8e['stderr']),_0x197a8e[_0x11a652(0xfb)]&&(_0x1bb0db['timeout']=!![]),_0x197a8e['message']&&(_0x1bb0db[_0x11a652(0xff)]=_0x197a8e[_0x11a652(0x10c)]);}logger[_0x11a652(0xff)]('start',_0x11a652(0x105),_0x1bb0db);throw _0x2b89f2;}}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a35_0x1a84(){const _0x46bbc9=['1694334rbmNkO','CLI\x20版本有更新','14845127SpmzUj','185794rYPSxG','now','success','inherit','needsUpgrade','timeout','env','object','12Vwdtjr','160dvktYe','warn','开发服务器启动成功','cwd','44060uhkrii','启动开发服务器','5eevpIB','908340OJhJPE','260TDkHao','SDK\x20版本有更新','vite','531ZSyxCd','start','1157262FsocaJ','443773ntUGdA','message','timedOut','stableVersion','version','stderr','exitCode','4rupqJq','error'];a35_0x1a84=function(){return _0x46bbc9;};return a35_0x1a84();}function a35_0x30a6(_0x193d15,_0x53d20a){_0x193d15=_0x193d15-0x1ca;const _0x1a8465=a35_0x1a84();let _0x30a666=_0x1a8465[_0x193d15];return _0x30a666;}(function(_0x53acc8,_0x45cc76){const _0xc7c3f=a35_0x30a6,_0x515d6c=_0x53acc8();while(!![]){try{const _0x17b004=parseInt(_0xc7c3f(0x1d0))/0x1*(-parseInt(_0xc7c3f(0x1d7))/0x2)+-parseInt(_0xc7c3f(0x1d9))/0x3*(parseInt(_0xc7c3f(0x1e4))/0x4)+parseInt(_0xc7c3f(0x1eb))/0x5*(-parseInt(_0xc7c3f(0x1cf))/0x6)+-parseInt(_0xc7c3f(0x1dc))/0x7*(-parseInt(_0xc7c3f(0x1e5))/0x8)+-parseInt(_0xc7c3f(0x1cd))/0x9*(-parseInt(_0xc7c3f(0x1e9))/0xa)+parseInt(_0xc7c3f(0x1db))/0xb+-parseInt(_0xc7c3f(0x1ec))/0xc*(-parseInt(_0xc7c3f(0x1ca))/0xd);if(_0x17b004===_0x45cc76)break;else _0x515d6c['push'](_0x515d6c['shift']());}catch(_0x32eafa){_0x515d6c['push'](_0x515d6c['shift']());}}}(a35_0x1a84,0xd6b86));import{logger}from'../utils/logger.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{execa}from'execa';export async function runStart(_0x3e63fa){const _0x1a6b55=a35_0x30a6,_0x1cb67=Date['now'](),_0x1508c4=_0x3e63fa||process[_0x1a6b55(0x1e8)](),_0xbc6413=await checkCliVersion();_0xbc6413[_0x1a6b55(0x1e0)]&&(printCliUpgradeWarning(_0xbc6413),logger[_0x1a6b55(0x1e6)](_0x1a6b55(0x1ce),_0x1a6b55(0x1da),{'currentVersion':_0xbc6413['currentVersion'],'stableVersion':_0xbc6413['stableVersion']}));const _0x9c3045=await checkSdkVersion(_0x1508c4);_0x9c3045[_0x1a6b55(0x1e0)]&&(printSdkUpgradeWarning(_0x9c3045),logger[_0x1a6b55(0x1e6)](_0x1a6b55(0x1ce),_0x1a6b55(0x1cb),{'currentVersion':_0x9c3045[_0x1a6b55(0x1d4)],'stableVersion':_0x9c3045[_0x1a6b55(0x1d3)]}));logger['info'](_0x1a6b55(0x1ce),_0x1a6b55(0x1ea),{'command':_0x1a6b55(0x1cc),'cwd':_0x1508c4});try{await execa(_0x1a6b55(0x1cc),[],{'cwd':_0x1508c4,'stdio':_0x1a6b55(0x1df),'preferLocal':!![],'localDir':_0x1508c4,'env':{...process[_0x1a6b55(0x1e2)]}});const _0x445ef3=Date[_0x1a6b55(0x1dd)]()-_0x1cb67;logger[_0x1a6b55(0x1de)]('start',_0x1a6b55(0x1e7),_0x445ef3);}catch(_0x5cb7e1){const _0x2f40fa=Date[_0x1a6b55(0x1dd)]()-_0x1cb67,_0x137923={'duration':_0x2f40fa,'command':'vite','cwd':_0x1508c4};if(_0x5cb7e1&&typeof _0x5cb7e1===_0x1a6b55(0x1e3)){const _0x1b831b=_0x5cb7e1;_0x1b831b['exitCode']!==undefined&&(_0x137923[_0x1a6b55(0x1d6)]=_0x1b831b[_0x1a6b55(0x1d6)]),_0x1b831b['stderr']&&(_0x137923[_0x1a6b55(0x1d5)]=_0x1b831b[_0x1a6b55(0x1d5)]),_0x1b831b[_0x1a6b55(0x1d2)]&&(_0x137923[_0x1a6b55(0x1e1)]=!![]),_0x1b831b[_0x1a6b55(0x1d1)]&&(_0x137923[_0x1a6b55(0x1d8)]=_0x1b831b[_0x1a6b55(0x1d1)]);}logger[_0x1a6b55(0x1d8)](_0x1a6b55(0x1ce),'开发服务器启动失败',_0x137923);throw _0x5cb7e1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d0e57,_0xd63ba){const _0x2e0db6=a36_0x2ab7,_0x520dbb=_0x3d0e57();while(!![]){try{const _0x4ea420=parseInt(_0x2e0db6(0x17e))/0x1*(-parseInt(_0x2e0db6(0x185))/0x2)+parseInt(_0x2e0db6(0x17d))/0x3*(-parseInt(_0x2e0db6(0x181))/0x4)+parseInt(_0x2e0db6(0x17b))/0x5*(-parseInt(_0x2e0db6(0x18c))/0x6)+-parseInt(_0x2e0db6(0x189))/0x7*(-parseInt(_0x2e0db6(0x188))/0x8)+parseInt(_0x2e0db6(0x178))/0x9+parseInt(_0x2e0db6(0x18f))/0xa+-parseInt(_0x2e0db6(0x17c))/0xb*(-parseInt(_0x2e0db6(0x17a))/0xc);if(_0x4ea420===_0xd63ba)break;else _0x520dbb['push'](_0x520dbb['shift']());}catch(_0x65f218){_0x520dbb['push'](_0x520dbb['shift']());}}}(a36_0x1427,0xd6eb8));import{jsxs as a36_0x357d26,jsx as a36_0x119d96}from'react/jsx-runtime';function a36_0x1427(){const _0x15e0bd=['column','8184XsxQnS','config.help.exampleApp','map','command','2hVqWrt','description','config.help.get','6029368DTWByE','7dOARwz','config.help.invalidCommand','config.help.examples','12AaDvdX','config.help.set','config.help.exampleLocale','17034670PvBeGt','\x20\x20\x20\x20','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','config.help.exampleEnv','lovrabet\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','1267281vRvUbE','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','19441896pvJoSo','755595CrEckR','11UJamtq','2193jVMyFX','1539929aYGDVF','gray'];a36_0x1427=function(){return _0x15e0bd;};return a36_0x1427();}import{Box,Text}from'ink';import{useI18n}from'../i18n/hooks.js';function a36_0x2ab7(_0x12662d,_0x178996){_0x12662d=_0x12662d-0x176;const _0x1427de=a36_0x1427();let _0x2ab7bd=_0x1427de[_0x12662d];return _0x2ab7bd;}export function ConfigHelp(){const _0x69b81a=a36_0x2ab7,{t:_0x4a6d0d}=useI18n(),_0x58c8d8=[{'command':_0x69b81a(0x192),'description':_0x4a6d0d(_0x69b81a(0x18d))},{'command':_0x69b81a(0x179),'description':_0x4a6d0d(_0x69b81a(0x187))},{'command':_0x69b81a(0x191),'description':_0x4a6d0d('config.help.list')}],_0x25552d=[{'command':'lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','description':_0x4a6d0d(_0x69b81a(0x182))},{'command':_0x69b81a(0x193),'description':_0x4a6d0d(_0x69b81a(0x176))},{'command':_0x69b81a(0x177),'description':_0x4a6d0d(_0x69b81a(0x18e))}];return a36_0x357d26(Box,{'flexDirection':_0x69b81a(0x180),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0x119d96(Box,{'marginBottom':0x1,'children':a36_0x357d26(Text,{'color':'gray','children':['\x20','!','\x20\x20',_0x4a6d0d(_0x69b81a(0x18a))]})}),_0x58c8d8[_0x69b81a(0x183)](_0x4cc2f1=>a36_0x357d26(Box,{'children':[a36_0x357d26(Text,{'children':[_0x69b81a(0x190),_0x4cc2f1[_0x69b81a(0x184)]]}),a36_0x119d96(Text,{'color':_0x69b81a(0x17f),'children':_0x4cc2f1[_0x69b81a(0x186)]})]},_0x4cc2f1[_0x69b81a(0x184)])),a36_0x119d96(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a36_0x357d26(Text,{'color':_0x69b81a(0x17f),'children':['\x20*\x20',_0x4a6d0d(_0x69b81a(0x18b))]})}),_0x25552d[_0x69b81a(0x183)](_0x4f4611=>a36_0x357d26(Box,{'children':[a36_0x357d26(Text,{'children':[_0x69b81a(0x190),_0x4f4611[_0x69b81a(0x184)]]}),a36_0x119d96(Text,{'color':_0x69b81a(0x17f),'children':_0x4f4611['description']})]},_0x4f4611['command']))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15edd5,_0x1698cd){const _0x401a21=a37_0x2958,_0x462801=_0x15edd5();while(!![]){try{const _0x2ebffb=parseInt(_0x401a21(0x133))/0x1*(-parseInt(_0x401a21(0x146))/0x2)+parseInt(_0x401a21(0x15d))/0x3*(-parseInt(_0x401a21(0x14e))/0x4)+-parseInt(_0x401a21(0x14d))/0x5*(-parseInt(_0x401a21(0x138))/0x6)+-parseInt(_0x401a21(0x135))/0x7*(parseInt(_0x401a21(0x136))/0x8)+parseInt(_0x401a21(0x156))/0x9+parseInt(_0x401a21(0x155))/0xa+parseInt(_0x401a21(0x149))/0xb;if(_0x2ebffb===_0x1698cd)break;else _0x462801['push'](_0x462801['shift']());}catch(_0x391a3c){_0x462801['push'](_0x462801['shift']());}}}(a37_0x25f6,0xd03ef));import{jsx as a37_0x3d9e58,jsxs as a37_0x330054}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a37_0x24b5ab from'node:fs';import a37_0x46bbd9 from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';function a37_0x25f6(){const _0x3d79b8=['string','30782jJIRZM','config.validation.valueInvalid','dirname','953678CmXGdy','config.scope.project','length','config.validation.envInvalid','4129445hmWLWs','916WWwHnH','log','get','red','--help','.tmp','stringify','5851600dUZjEr','12788865vobeGL','env','config.success.localeSet','renameSync','unlinkSync','config.success.envSet','flags','15777JIVKSx','config.scope.global','undefined','set','29zTovJw','error','3899csQyFJ','17824HXreYm','list','12lBiAMv','appcode','app','message','utf8','locale','column','mkdirSync','help','daily','includes','input','config'];a37_0x25f6=function(){return _0x3d79b8;};return a37_0x25f6();}import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';import{normalizeLocale}from'../i18n/index.js';import{useI18n}from'../i18n/hooks.js';function a37_0x2958(_0x20eea5,_0x4fa31b){_0x20eea5=_0x20eea5-0x130;const _0x25f6fe=a37_0x25f6();let _0x29588f=_0x25f6fe[_0x20eea5];return _0x29588f;}export function Config(_0x5262ce){const _0x19db1a=a37_0x2958,{cli:_0x955ab7}=_0x5262ce,{t:_0x3b80be}=useI18n(),_0x4b0db6=_0x955ab7[_0x19db1a(0x143)][0x1],_0x1ab199=_0x955ab7[_0x19db1a(0x143)][0x2],_0x579999=[_0x19db1a(0x132),_0x19db1a(0x150)]['includes'](_0x4b0db6||''),_0x339608=_0x955ab7[_0x19db1a(0x143)][_0x19db1a(0x14b)]>=0x3;if(_0x1ab199===_0x19db1a(0x152)||_0x955ab7[_0x19db1a(0x15c)][_0x19db1a(0x140)])return a37_0x3d9e58(ConfigHelp,{});const _0x60741f=readConfig();if(_0x4b0db6===_0x19db1a(0x132)){if(_0x1ab199){const _0x95e3f9=_0x955ab7[_0x19db1a(0x143)][0x3];if(typeof _0x95e3f9!=='undefined'){if(_0x1ab199==='env'&&!['online','production',_0x19db1a(0x141)][_0x19db1a(0x142)](_0x95e3f9))return a37_0x3d9e58(Box,{'children':a37_0x3d9e58(Text,{'color':_0x19db1a(0x151),'children':_0x3b80be(_0x19db1a(0x14c))})});if(_0x1ab199===_0x19db1a(0x13d)&&!normalizeLocale(_0x95e3f9))return a37_0x3d9e58(Box,{'flexDirection':_0x19db1a(0x13e),'children':a37_0x3d9e58(Text,{'color':'red','children':_0x3b80be('config.validation.localeInvalid')})});const _0x2a79e4=isInProject(),_0x3753b6=_0x2a79e4?projectConfigPath:globalConfigPath;let _0x22ff7a={};try{if(existsSync(_0x3753b6)){const _0x4c1fad=readFileSync(_0x3753b6,{'encoding':_0x19db1a(0x13c)});_0x4c1fad&&(_0x22ff7a=JSON['parse'](_0x4c1fad));}}catch(_0x1ce154){}if(typeof _0x95e3f9!==_0x19db1a(0x145)||_0x95e3f9[_0x19db1a(0x14b)]>0x1f4)return a37_0x3d9e58(Box,{'children':a37_0x3d9e58(Text,{'color':'red','children':_0x3b80be(_0x19db1a(0x147))})});let _0x18cea3=_0x1ab199,_0x585ce7=_0x95e3f9;_0x1ab199===_0x19db1a(0x13a)&&(_0x18cea3=_0x19db1a(0x139),delete _0x22ff7a['app']);_0x1ab199===_0x19db1a(0x139)&&delete _0x22ff7a[_0x19db1a(0x13a)];_0x1ab199===_0x19db1a(0x13d)&&(_0x585ce7=normalizeLocale(_0x95e3f9));_0x22ff7a[_0x18cea3]=_0x585ce7;try{const _0x5d52b3=a37_0x46bbd9[_0x19db1a(0x148)](_0x3753b6);!existsSync(_0x5d52b3)&&a37_0x24b5ab[_0x19db1a(0x13f)](_0x5d52b3,{'recursive':!![]});const _0x27b467=_0x3753b6+_0x19db1a(0x153);writeFileSync(_0x27b467,JSON['stringify'](_0x22ff7a,null,0x2),{'encoding':'utf8','mode':0x180}),a37_0x24b5ab[_0x19db1a(0x159)](_0x27b467,_0x3753b6);const _0x2df20f=_0x3b80be(_0x2a79e4?_0x19db1a(0x14a):_0x19db1a(0x130));_0x1ab199===_0x19db1a(0x157)&&console[_0x19db1a(0x14f)](_0x3b80be(_0x19db1a(0x15b),{'scope':_0x2df20f,'value':_0x95e3f9}));if(_0x1ab199===_0x19db1a(0x13d)){const _0x3ce46e=normalizeLocale(_0x95e3f9);console[_0x19db1a(0x14f)](_0x3b80be(_0x19db1a(0x158),{'scope':_0x2df20f,'value':_0x3ce46e}));}}catch(_0x69c47d){const _0x412865=_0x3753b6+_0x19db1a(0x153);try{existsSync(_0x412865)&&a37_0x24b5ab[_0x19db1a(0x15a)](_0x412865);}catch(_0x1dda44){}return logger[_0x19db1a(0x134)](_0x19db1a(0x144),'保存配置失败',{'error':_0x69c47d instanceof Error?_0x69c47d[_0x19db1a(0x13b)]:String(_0x69c47d),'configKey':_0x1ab199,'configValue':_0x95e3f9,'targetConfigPath':_0x3753b6}),a37_0x3d9e58(Box,{'children':a37_0x330054(Text,{'color':_0x19db1a(0x151),'children':[_0x3b80be('config.validation.saveFailed'),':','\x20',_0x69c47d instanceof Error?_0x69c47d['message']:String(_0x69c47d)]})});}return null;}return a37_0x3d9e58(Box,{'children':a37_0x3d9e58(Text,{'color':_0x19db1a(0x151),'children':_0x3b80be('config.validation.noValue')})});}}if(_0x4b0db6===_0x19db1a(0x150)){if(_0x1ab199){let _0x4d59b1=_0x1ab199;return _0x1ab199==='app'&&(_0x4d59b1='appcode'),console[_0x19db1a(0x14f)](_0x60741f[_0x4d59b1]||_0x19db1a(0x131)),null;}return null;}if(_0x4b0db6===_0x19db1a(0x137))return console[_0x19db1a(0x14f)](JSON[_0x19db1a(0x154)](_0x60741f,null,0x2)),null;if(!_0x579999||!_0x339608)return a37_0x3d9e58(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a38_0x5e90(_0x568884,_0xe90aad){_0x568884=_0x568884-0x75;const _0x4c0374=a38_0x4c03();let _0x5e90ac=_0x4c0374[_0x568884];return _0x5e90ac;}function a38_0x4c03(){const _0x244207=['https://user-daily.lovrabet.com','production','9090AIoxBm','808860vTiyCT','https://daily-api.lovrabet.com','1555122CHJJge','5204URNHis','556963lyWDOV','https://user.lovrabet.com','35aHrPmM','1315ZzAnVO','10557xBgaQR','606840kMeutT','3222136ivkXtV'];a38_0x4c03=function(){return _0x244207;};return a38_0x4c03();}const a38_0x274093=a38_0x5e90;(function(_0x4ec3a5,_0x53aa50){const _0x2a28a9=a38_0x5e90,_0xf02062=_0x4ec3a5();while(!![]){try{const _0x4af1c1=parseInt(_0x2a28a9(0x7f))/0x1+parseInt(_0x2a28a9(0x7d))/0x2+parseInt(_0x2a28a9(0x76))/0x3+-parseInt(_0x2a28a9(0x7e))/0x4*(parseInt(_0x2a28a9(0x82))/0x5)+parseInt(_0x2a28a9(0x7b))/0x6*(parseInt(_0x2a28a9(0x81))/0x7)+-parseInt(_0x2a28a9(0x77))/0x8+-parseInt(_0x2a28a9(0x75))/0x9*(parseInt(_0x2a28a9(0x7a))/0xa);if(_0x4af1c1===_0x53aa50)break;else _0xf02062['push'](_0xf02062['shift']());}catch(_0x478275){_0xf02062['push'](_0xf02062['shift']());}}}(a38_0x4c03,0x61933));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a38_0x274093(0x79)?a38_0x274093(0x80):a38_0x274093(0x78);export const getApiDomain=()=>getEnv()===a38_0x274093(0x79)?'https://api.lovrabet.com':a38_0x274093(0x7c);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a39_0x4fad(_0x11778c,_0x2e7483){_0x11778c=_0x11778c-0x9d;const _0x52f3ad=a39_0x52f3();let _0x4fadf6=_0x52f3ad[_0x11778c];return _0x4fadf6;}function a39_0x52f3(){const _0x200b85=['6hBhGPV','234487ViBRLg','211592tMYXbj','2375028eVqZIx','147088nLGJGB','online','10vXXsSD','5lNtvzx','4xKPeKu','production','8VINJba','55974BgiYQK','13ccyESr','33418HSngNp','291474YsbHjX'];a39_0x52f3=function(){return _0x200b85;};return a39_0x52f3();}const a39_0x476363=a39_0x4fad;(function(_0x1859b1,_0x1c12e5){const _0xa93f7a=a39_0x4fad,_0x396c0f=_0x1859b1();while(!![]){try{const _0xbb43d6=parseInt(_0xa93f7a(0x9f))/0x1*(parseInt(_0xa93f7a(0xa3))/0x2)+-parseInt(_0xa93f7a(0xaa))/0x3*(-parseInt(_0xa93f7a(0x9d))/0x4)+-parseInt(_0xa93f7a(0xa2))/0x5*(-parseInt(_0xa93f7a(0xa6))/0x6)+-parseInt(_0xa93f7a(0xa8))/0x7+parseInt(_0xa93f7a(0xa5))/0x8*(-parseInt(_0xa93f7a(0xa9))/0x9)+-parseInt(_0xa93f7a(0xa1))/0xa*(parseInt(_0xa93f7a(0xab))/0xb)+-parseInt(_0xa93f7a(0x9e))/0xc*(parseInt(_0xa93f7a(0xa7))/0xd);if(_0xbb43d6===_0x1c12e5)break;else _0x396c0f['push'](_0x396c0f['shift']());}catch(_0x6b1cc1){_0x396c0f['push'](_0x396c0f['shift']());}}}(a39_0x52f3,0x25549));export function normalizeEnv(_0x2e0f19){const _0x5d7b77=a39_0x4fad;return _0x2e0f19===_0x5d7b77(0xa0)?'production':_0x2e0f19;}let env=normalizeEnv(process['env']['LOVRABET_ENV']||a39_0x476363(0xa4));export function getEnv(){return env;}export function initEnv(_0x24a202){env=normalizeEnv(_0x24a202);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x177195=a40_0x1b30;function a40_0x1b30(_0xd22d62,_0x2dcea2){_0xd22d62=_0xd22d62-0x1af;const _0x115d33=a40_0x115d();let _0x1b30bf=_0x115d33[_0xd22d62];return _0x1b30bf;}(function(_0x57a1c5,_0x496642){const _0x7c44ec=a40_0x1b30,_0x20c7c6=_0x57a1c5();while(!![]){try{const _0x3b7b32=parseInt(_0x7c44ec(0x1ec))/0x1+-parseInt(_0x7c44ec(0x20a))/0x2+parseInt(_0x7c44ec(0x208))/0x3+-parseInt(_0x7c44ec(0x1d6))/0x4*(parseInt(_0x7c44ec(0x1c2))/0x5)+-parseInt(_0x7c44ec(0x1cb))/0x6+parseInt(_0x7c44ec(0x211))/0x7+-parseInt(_0x7c44ec(0x20d))/0x8*(parseInt(_0x7c44ec(0x1c5))/0x9);if(_0x3b7b32===_0x496642)break;else _0x20c7c6['push'](_0x20c7c6['shift']());}catch(_0x57d419){_0x20c7c6['push'](_0x20c7c6['shift']());}}}(a40_0x115d,0x7cb72));import{jsx as a40_0x3bd58b,jsxs as a40_0xc18d13,Fragment as a40_0x186fa2}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{existsSync}from'node:fs';import a40_0x18d249 from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';import{useI18n}from'../i18n/hooks.js';import{IDE_CONFIGS,MCP_IDES}from'../utils/ai_config.js';const UI_IDE_CONFIGS=IDE_CONFIGS,UI_IDE_LIST=[a40_0x177195(0x1f5),a40_0x177195(0x1b7),a40_0x177195(0x1af),a40_0x177195(0x1ef),a40_0x177195(0x1c6),a40_0x177195(0x20e),a40_0x177195(0x1ce),a40_0x177195(0x1d4),a40_0x177195(0x1ee),a40_0x177195(0x1cf),a40_0x177195(0x1f4)],UI_MCP_IDES=new Set(Array[a40_0x177195(0x1b0)](MCP_IDES));function a40_0x115d(){const _0x51cb4b=['env','login-process','downArrow','create.lovrabetSetup.selectIdeTitle','claude','create.input.appCode.label','create.input.appCode.hint','label','return','create.validation.appCode.invalid','create.login.notDetected','create.creating','app-code','create.validation.projectName.invalid','create.steps.projectName.label','17795NvZjYK','create.common.yes','project-name','954fQbeCJ','codex','create.login.checkingStatus','has','create.steps.login.loggedIn','lovrabet-setup-selection','2435730uMTWMn','create.apiPull.confirm','includes','opencode','windsurf','step','create.apiPull.recommendation','login-check','leftArrow','qoder','length','204HUNXHx','create.common.no','\x20←\x20','green','Yes','name','create.validation.projectName.dirExistsShort','confirm-api-pull','create.login.valid','create.login.inProgress','upArrow','string','resolve','create.validation.projectName.dirExists','delete','white','map','create.steps.login.skipped','cyan','create.login.inProgressStatus','create.title','create.steps.apiPull.label','469910BObvpf','red','trae','codebuddy','api-pull','create.steps.login.label','filter','gray','agent','antigravity','lovrabet-setup','create.login.prompt','create.lovrabetSetup.selectIdeHint','add','test','my-app','online','yellow','backspace','create.steps.lovrabetSetup.label','create.validation.projectName.tooLong','login-prompt','create.validation.appCode.invalidFormat','create.validation.ide.required','creating','create.steps.login.failed','blue','create.common.selectHint','443652rBlWXp','create.login.checking','734204IUGdJz','column','create.input.projectName.label','9136ZCsXIe','cursor','rightArrow','login','6780606FlrWFu','create.validation.appCode.tooLong','cline','from','slice','trim'];a40_0x115d=function(){return _0x51cb4b;};return a40_0x115d();}export function EnhancedGuidedCreate(_0x22087a){const _0x2ec0b3=a40_0x177195,{onCreate:_0x21c016,env:_0x2dc363}=_0x22087a,{t:_0x70d347}=useI18n(),[_0xa632eb,_0x13c30f]=useState(_0x2ec0b3(0x1c4)),[_0xee178a,_0x26a1aa]=useState(''),[_0x482e4c,_0x1c1e04]=useState(''),[_0x2275fa,_0x53301f]=useState(''),[_0xbfc5de,_0x494f94]=useState(''),[_0x89885a,_0x152f54]=useState([]),[_0x5aa23a,_0xb5e4e1]=useState(null),[_0x12f148,_0x27b468]=useState(![]),[_0x5ba53f,_0x558ab]=useState(![]),[_0x32759c,_0x14aca1]=useState(![]),[_0x32374a,_0x32e199]=useState(0x0),[_0x471344,_0x4bcb3e]=useState(0x0),[_0x50f011,_0x428837]=useState(0x0),[_0x316639,_0xcc1b67]=useState(![]),[_0x2c8c43,_0x3a6a2b]=useState(new Set()),[_0x3c35b1,_0x4f1f58]=useState(0x0),[_0x423934,_0x46d616]=useState(''),_0x33cd4a=_0x2ec0b3(0x1fb),_0x536c8b=readConfig(),_0x4b12e1=typeof _0x536c8b[_0x2ec0b3(0x1b3)]===_0x2ec0b3(0x1e1)?_0x536c8b[_0x2ec0b3(0x1b3)]:undefined;function _0x33d070(_0x2a79fc){const _0x1fe87a=_0x2ec0b3,_0x5d37ce=_0x2a79fc||_0x33cd4a,_0xb0a8a5=a40_0x18d249[_0x1fe87a(0x1e2)](process['cwd'](),_0x5d37ce);return existsSync(_0xb0a8a5);}function _0x32a923(_0x308545){const _0x37728a=_0x2ec0b3;if(_0x308545['length']>0x32)return{'valid':![],'message':_0x70d347(_0x37728a(0x200))};const _0x131663=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x308545?.[_0x37728a(0x1b2)]()&&!_0x131663[_0x37728a(0x1fa)](_0x308545))return{'valid':![],'message':_0x70d347('create.validation.projectName.invalidFormat')};return{'valid':!![]};}function _0x3ac5a2(_0x3a1633){const _0x560424=_0x2ec0b3;if(!_0x3a1633[_0x560424(0x1b2)]())return{'valid':!![]};if(_0x3a1633[_0x560424(0x1d5)]>0x64)return{'valid':![],'message':_0x70d347(_0x560424(0x212))};const _0x48eeff=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x48eeff['test'](_0x3a1633))return{'valid':![],'message':_0x70d347(_0x560424(0x202))};return{'valid':!![]};}async function _0x39d517(){_0x27b468(!![]);try{const _0x2c8702=await getIsSessionValid();return _0xb5e4e1(_0x2c8702),_0x2c8702;}catch(_0x31095d){return _0xb5e4e1(![]),![];}finally{_0x27b468(![]);}}async function _0x11e014(){_0x558ab(!![]);try{const _0x297f26=await authServer({'silent':!![]});return _0xb5e4e1(_0x297f26),_0x297f26;}catch(_0x93e5c4){return _0xb5e4e1(![]),![];}finally{_0x558ab(![]);}}return useInput(async(_0x46fc3d,_0x4ec806)=>{const _0x1adb9b=_0x2ec0b3;if(_0x4ec806[_0x1adb9b(0x1d3)]||_0x4ec806[_0x1adb9b(0x20f)]){if(_0xa632eb==='confirm-api-pull'){_0x32e199(_0x4578e9=>_0x4578e9===0x0?0x1:0x0);return;}if(_0xa632eb===_0x1adb9b(0x1ca)){if(!_0x316639){_0x428837(_0x3d4526=>_0x3d4526===0x0?0x1:0x0);return;}_0xcc1b67(![]);return;}if(_0xa632eb===_0x1adb9b(0x201)){_0x4bcb3e(_0x240bfb=>_0x240bfb===0x0?0x1:0x0);return;}}if(_0xa632eb==='lovrabet-setup-selection'&&_0x316639&&_0x50f011===0x0){if(_0x4ec806[_0x1adb9b(0x1e0)]){_0x4f1f58(_0x43c6a4=>_0x43c6a4>0x0?_0x43c6a4-0x1:UI_IDE_LIST[_0x1adb9b(0x1d5)]-0x1);return;}if(_0x4ec806[_0x1adb9b(0x1b5)]){_0x4f1f58(_0x106d3e=>_0x106d3e<UI_IDE_LIST[_0x1adb9b(0x1d5)]-0x1?_0x106d3e+0x1:0x0);return;}}if(_0x46fc3d==='\x20'&&_0xa632eb===_0x1adb9b(0x1ca)&&_0x316639&&_0x50f011===0x0){_0x3a6a2b(_0x37031f=>{const _0x39476d=_0x1adb9b,_0x204dd7=new Set(_0x37031f);return _0x204dd7[_0x39476d(0x1c8)](_0x3c35b1)?_0x204dd7['delete'](_0x3c35b1):_0x204dd7[_0x39476d(0x1f9)](_0x3c35b1),_0x204dd7;}),_0x494f94('');return;}if((_0x46fc3d==='a'||_0x46fc3d==='A')&&_0xa632eb===_0x1adb9b(0x1ca)&&_0x316639&&_0x50f011===0x0){_0x3a6a2b(new Set(UI_IDE_LIST[_0x1adb9b(0x1e6)]((_0x3fd9dd,_0xaf9913)=>_0xaf9913))),_0x494f94('');return;}if((_0x46fc3d==='i'||_0x46fc3d==='I'||_0x46fc3d==='r'||_0x46fc3d==='R')&&_0xa632eb===_0x1adb9b(0x1ca)&&_0x316639&&_0x50f011===0x0){_0x3a6a2b(_0x4565b4=>{const _0x3bf2d3=_0x1adb9b,_0x5eedae=new Set();for(let _0x2f45a6=0x0;_0x2f45a6<UI_IDE_LIST[_0x3bf2d3(0x1d5)];_0x2f45a6++){!_0x4565b4[_0x3bf2d3(0x1c8)](_0x2f45a6)&&_0x5eedae[_0x3bf2d3(0x1f9)](_0x2f45a6);}return _0x5eedae;});return;}if(_0x4ec806[_0x1adb9b(0x1bb)]){if(_0xa632eb===_0x1adb9b(0x1c4)){const _0x64dac3=_0x2275fa[_0x1adb9b(0x1b2)]()||_0x33cd4a;if(_0xbfc5de)return;if(_0x33d070(_0x64dac3)){_0x46d616(_0x70d347(_0x1adb9b(0x1e3),{'name':_0x64dac3}));return;}_0x26a1aa(_0x64dac3),_0x152f54([{'step':_0x1adb9b(0x1c4),'label':_0x70d347(_0x1adb9b(0x1c1)),'value':_0x64dac3}]),_0x53301f(''),_0x494f94(''),_0x46d616(''),_0x13c30f('app-code');return;}if(_0xa632eb===_0x1adb9b(0x1bf)){if(_0xbfc5de)return;const _0x5ba286=_0x2275fa[_0x1adb9b(0x1b2)]();_0x1c1e04(_0x5ba286),_0x152f54(_0x39fd0b=>[..._0x39fd0b,{'step':_0x1adb9b(0x1bf),'label':_0x70d347('create.steps.appCode.label'),'value':_0x5ba286||_0x70d347('create.steps.appCode.notSet')}]),_0x53301f(''),_0x494f94('');if(_0x5ba286){_0x13c30f('login-check');const _0x1a980c=await _0x39d517();_0x1a980c?_0x13c30f(_0x1adb9b(0x1dd)):_0x13c30f('login-prompt');}else{const _0x42dde7=_0x2dc363||_0x4b12e1||_0x1adb9b(0x1fc);_0x21c016({'projectName':_0xee178a,'appCode':undefined,'pullApi':![],'aiSetup':![],'selectedIDEs':[],'env':_0x42dde7}),_0x13c30f(_0x1adb9b(0x204));}return;}if(_0xa632eb==='confirm-api-pull'){const _0x128d51=_0x32374a===0x0;_0x14aca1(_0x128d51),_0x152f54(_0x347f4c=>[..._0x347f4c,{'step':_0x1adb9b(0x1f0),'label':_0x70d347(_0x1adb9b(0x1eb)),'value':_0x128d51?_0x70d347(_0x1adb9b(0x1c3)):_0x70d347('create.common.no')}]),_0x13c30f('lovrabet-setup-selection');return;}if(_0xa632eb===_0x1adb9b(0x1ca)){if(!_0x316639){_0xcc1b67(!![]);if(_0x50f011===0x1){_0x152f54(_0x29f530=>[..._0x29f530,{'step':_0x1adb9b(0x1f6),'label':_0x70d347(_0x1adb9b(0x1ff)),'value':_0x70d347(_0x1adb9b(0x1d7))}]);const _0x2f1673=_0x2dc363||_0x4b12e1||_0x1adb9b(0x1fc);_0x21c016({'projectName':_0xee178a,'appCode':_0x482e4c,'pullApi':_0x32759c,'aiSetup':![],'selectedIDEs':[],'env':_0x2f1673}),_0x13c30f(_0x1adb9b(0x204));}return;}if(_0x2c8c43['size']===0x0){_0x494f94(_0x70d347(_0x1adb9b(0x203)));return;}const _0x483da7=Array[_0x1adb9b(0x1b0)](_0x2c8c43)[_0x1adb9b(0x1e6)](_0x2ced38=>UI_IDE_LIST[_0x2ced38])[_0x1adb9b(0x1f2)](_0x300b2b=>_0x300b2b!==undefined);_0x152f54(_0x1d4df0=>[..._0x1d4df0,{'step':'lovrabet-setup','label':_0x70d347(_0x1adb9b(0x1ff)),'value':_0x70d347('create.steps.lovrabetSetup.ideCount',{'count':_0x483da7['length']})}]);const _0x3094ee=_0x2dc363||_0x4b12e1||_0x1adb9b(0x1fc);_0x21c016({'projectName':_0xee178a,'appCode':_0x482e4c,'pullApi':_0x32759c,'aiSetup':!![],'selectedIDEs':_0x483da7,'env':_0x3094ee}),_0x13c30f(_0x1adb9b(0x204));return;}if(_0xa632eb===_0x1adb9b(0x201)){const _0x4b7548=_0x471344===0x0;if(_0x4b7548){_0x13c30f(_0x1adb9b(0x1b4));const _0x5ae4dd=await _0x11e014();_0x5ae4dd?(_0x152f54(_0x5441ac=>[..._0x5441ac,{'step':_0x1adb9b(0x210),'label':_0x70d347(_0x1adb9b(0x1f1)),'value':_0x70d347(_0x1adb9b(0x1c9))}]),_0x13c30f(_0x1adb9b(0x1dd))):(_0x152f54(_0x30bc92=>[..._0x30bc92,{'step':_0x1adb9b(0x210),'label':_0x70d347('create.steps.login.label'),'value':_0x70d347(_0x1adb9b(0x205))}]),_0x13c30f(_0x1adb9b(0x1ca)));}else _0x152f54(_0x372548=>[..._0x372548,{'step':_0x1adb9b(0x210),'label':_0x70d347(_0x1adb9b(0x1f1)),'value':_0x70d347(_0x1adb9b(0x1e7))}]),_0x13c30f(_0x1adb9b(0x1ca));return;}}if(_0x4ec806[_0x1adb9b(0x1fe)]||_0x4ec806[_0x1adb9b(0x1e4)]){_0x53301f(_0x5eec48=>{const _0x5ed4f2=_0x1adb9b,_0x19065c=_0x5eec48[_0x5ed4f2(0x1b1)](0x0,-0x1);if(_0xa632eb===_0x5ed4f2(0x1c4)){const {valid:_0x3182b2,message:_0xc6193c}=_0x32a923(_0x19065c);_0x494f94(_0x3182b2?'':_0xc6193c||_0x70d347(_0x5ed4f2(0x1c0)));if(_0x3182b2&&!_0xbfc5de){const _0x421461=_0x19065c||_0x33cd4a;_0x33d070(_0x421461)?_0x46d616(_0x70d347(_0x5ed4f2(0x1dc),{'name':_0x421461})):_0x46d616('');}}else{if(_0xa632eb===_0x5ed4f2(0x1bf)){const {valid:_0x1e1ad8,message:_0x3dc0e3}=_0x3ac5a2(_0x19065c);_0x494f94(_0x1e1ad8?'':_0x3dc0e3||_0x70d347(_0x5ed4f2(0x1bc)));}}return _0x19065c;});return;}if([_0x1adb9b(0x204),_0x1adb9b(0x1d2),'login-process'][_0x1adb9b(0x1cd)](_0xa632eb))return;if(_0xa632eb===_0x1adb9b(0x1dd)||_0xa632eb==='login-prompt'||_0xa632eb===_0x1adb9b(0x1ca))return;_0x53301f(_0x1e3928=>{const _0x7884e8=_0x1adb9b,_0x44dcd1=_0x1e3928+_0x46fc3d;if(_0xa632eb==='project-name'){const {valid:_0x2837a3,message:_0x38ba8c}=_0x32a923(_0x44dcd1);_0x494f94(_0x2837a3?'':_0x38ba8c||_0x70d347(_0x7884e8(0x1c0)));if(_0x2837a3&&!_0xbfc5de){const _0x2a3db5=_0x44dcd1||_0x33cd4a;_0x33d070(_0x2a3db5)?_0x46d616(_0x70d347(_0x7884e8(0x1dc),{'name':_0x2a3db5})):_0x46d616('');}}else{if(_0xa632eb===_0x7884e8(0x1bf)){const {valid:_0x3ab962,message:_0x3101bf}=_0x3ac5a2(_0x44dcd1);_0x494f94(_0x3ab962?'':_0x3101bf||_0x70d347(_0x7884e8(0x1bc)));}}return _0x44dcd1;});}),a40_0xc18d13(Box,{'flexDirection':_0x2ec0b3(0x20b),'marginTop':0x1,'children':[_0x89885a['length']===0x0&&a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':'cyan','children':_0x70d347(_0x2ec0b3(0x1ea))})}),_0x89885a[_0x2ec0b3(0x1e6)](_0x2be57d=>a40_0xc18d13(Box,{'children':[a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1d9),'children':_0x70d347('create.completedStep',{'label':_0x2be57d[_0x2ec0b3(0x1ba)]})}),a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1e8),'children':_0x2be57d['value']})]},_0x2be57d[_0x2ec0b3(0x1d0)])),_0xa632eb==='project-name'&&a40_0xc18d13(a40_0x186fa2,{'children':[a40_0xc18d13(Box,{'children':[a40_0x3bd58b(Text,{'children':_0x70d347(_0x2ec0b3(0x20c))}),_0x2275fa?a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1d9),'children':_0x2275fa}):a40_0x3bd58b(Text,{'color':'gray','children':_0x33cd4a}),_0xbfc5de&&a40_0xc18d13(Text,{'color':_0x2ec0b3(0x1ed),'children':[_0x2ec0b3(0x1d8),_0xbfc5de]}),_0x423934&&a40_0xc18d13(Text,{'color':_0x2ec0b3(0x1ed),'children':[_0x2ec0b3(0x1d8),_0x423934]})]}),!_0xbfc5de&&!_0x423934&&!_0x2275fa&&a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347('create.input.projectName.hint')})})]}),_0xa632eb===_0x2ec0b3(0x1bf)&&a40_0xc18d13(a40_0x186fa2,{'children':[a40_0xc18d13(Box,{'children':[a40_0x3bd58b(Text,{'children':_0x70d347(_0x2ec0b3(0x1b8))}),a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347('create.input.appCode.optional')}),a40_0x3bd58b(Text,{'color':'green','children':_0x2275fa}),_0xbfc5de&&a40_0xc18d13(Text,{'color':'red','children':[_0x2ec0b3(0x1d8),_0xbfc5de]})]}),!_0xbfc5de&&a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347(_0x2ec0b3(0x1b9))})})]}),_0xa632eb===_0x2ec0b3(0x1d2)&&a40_0xc18d13(Box,{'children':[a40_0x3bd58b(Text,{'children':_0x70d347(_0x2ec0b3(0x209))}),_0x12f148&&a40_0x3bd58b(Text,{'color':'gray','children':_0x70d347(_0x2ec0b3(0x1c7))})]}),_0xa632eb==='confirm-api-pull'&&a40_0xc18d13(a40_0x186fa2,{'children':[a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1d9),'children':_0x70d347(_0x2ec0b3(0x1de))})}),a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0x3bd58b(Text,{'children':_0x70d347(_0x2ec0b3(0x1cc))})}),a40_0xc18d13(Box,{'marginLeft':0x2,'children':[a40_0xc18d13(Text,{'color':_0x32374a===0x0?_0x2ec0b3(0x1d9):'gray','children':[_0x32374a===0x0?'▶\x20':'\x20\x20',_0x2ec0b3(0x1da)]}),a40_0x3bd58b(Text,{'children':'\x20'}),a40_0xc18d13(Text,{'color':_0x32374a===0x1?_0x2ec0b3(0x1d9):_0x2ec0b3(0x1f3),'children':[_0x32374a===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347(_0x2ec0b3(0x207))})}),a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1fd),'children':_0x70d347(_0x2ec0b3(0x1d1))})})]}),_0xa632eb===_0x2ec0b3(0x1ca)&&a40_0xc18d13(a40_0x186fa2,{'children':[a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':'green','children':'√'})}),a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0x3bd58b(Text,{'children':_0x70d347('create.lovrabetSetup.confirm')})}),a40_0xc18d13(Box,{'marginLeft':0x2,'children':[a40_0xc18d13(Text,{'color':_0x50f011===0x0?_0x2ec0b3(0x1d9):'gray','children':[_0x50f011===0x0?'▶\x20':'\x20\x20',_0x2ec0b3(0x1da)]}),a40_0x3bd58b(Text,{'children':'\x20'}),a40_0xc18d13(Text,{'color':_0x50f011===0x1?_0x2ec0b3(0x1d9):_0x2ec0b3(0x1f3),'children':[_0x50f011===0x1?'▶\x20':'\x20\x20','No']})]}),_0x316639&&_0x50f011===0x0&&a40_0xc18d13(a40_0x186fa2,{'children':[a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347(_0x2ec0b3(0x1f8))})}),a40_0xc18d13(Box,{'marginTop':0x1,'flexDirection':_0x2ec0b3(0x20b),'children':[a40_0x3bd58b(Text,{'bold':!![],'color':'yellow','children':_0x70d347(_0x2ec0b3(0x1b6))}),UI_IDE_LIST[_0x2ec0b3(0x1e6)]((_0x142df8,_0x3c6de5)=>{const _0x35a251=_0x2ec0b3,_0x121088=_0x3c35b1===_0x3c6de5,_0x116fca=_0x2c8c43['has'](_0x3c6de5),_0x263332=UI_MCP_IDES[_0x35a251(0x1c8)](_0x142df8);return a40_0x3bd58b(Box,{'children':a40_0xc18d13(Text,{'backgroundColor':_0x121088?_0x35a251(0x206):undefined,'color':_0x121088?_0x35a251(0x1e5):undefined,'children':['\x20\x20',_0x116fca?'[✓]':'[\x20]','\x20',UI_IDE_CONFIGS[_0x142df8][_0x35a251(0x1db)],_0x263332&&a40_0x3bd58b(Text,{'color':_0x121088?'white':_0x35a251(0x1e8),'children':'\x20+MCP'}),'\x20',a40_0xc18d13(Text,{'color':_0x121088?'white':_0x35a251(0x1f3),'dimColor':!_0x121088,'children':['-\x20',UI_IDE_CONFIGS[_0x142df8]['description']]})]})},_0x142df8);}),a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347('create.lovrabetSetup.keyboardShortcuts')})})]})]}),!_0x316639&&a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347(_0x2ec0b3(0x207))})}),_0xbfc5de&&a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0xc18d13(Text,{'color':_0x2ec0b3(0x1ed),'children':['✗\x20',_0xbfc5de]})})]}),_0xa632eb==='login-prompt'&&a40_0xc18d13(a40_0x186fa2,{'children':[a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':'yellow','children':_0x70d347(_0x2ec0b3(0x1bd))})}),a40_0x3bd58b(Box,{'marginTop':0x1,'children':a40_0x3bd58b(Text,{'children':_0x70d347(_0x2ec0b3(0x1f7))})}),a40_0xc18d13(Box,{'marginLeft':0x2,'children':[a40_0xc18d13(Text,{'color':_0x471344===0x0?_0x2ec0b3(0x1d9):'gray','children':[_0x471344===0x0?'▶\x20':'\x20\x20',_0x2ec0b3(0x1da)]}),a40_0x3bd58b(Text,{'children':'\x20'}),a40_0xc18d13(Text,{'color':_0x471344===0x1?_0x2ec0b3(0x1d9):_0x2ec0b3(0x1f3),'children':[_0x471344===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1f3),'children':_0x70d347(_0x2ec0b3(0x207))})})]}),_0xa632eb==='login-process'&&a40_0xc18d13(Box,{'children':[a40_0x3bd58b(Text,{'children':_0x70d347(_0x2ec0b3(0x1df))}),_0x5ba53f&&a40_0x3bd58b(Text,{'color':'gray','children':_0x70d347(_0x2ec0b3(0x1e9))})]}),_0xa632eb===_0x2ec0b3(0x204)&&a40_0x3bd58b(Box,{'children':a40_0x3bd58b(Text,{'color':_0x2ec0b3(0x1d9),'children':_0x70d347(_0x2ec0b3(0x1be))})})]});}
|
|
1
|
+
(function(_0x32a245,_0x2a2070){const _0x4fb382=a40_0x4d9f,_0x5e6dd1=_0x32a245();while(!![]){try{const _0xd7b5e1=parseInt(_0x4fb382(0x14a))/0x1+parseInt(_0x4fb382(0x148))/0x2+parseInt(_0x4fb382(0x129))/0x3+parseInt(_0x4fb382(0x12e))/0x4+-parseInt(_0x4fb382(0x14e))/0x5*(-parseInt(_0x4fb382(0x126))/0x6)+parseInt(_0x4fb382(0x141))/0x7+-parseInt(_0x4fb382(0x14f))/0x8;if(_0xd7b5e1===_0x2a2070)break;else _0x5e6dd1['push'](_0x5e6dd1['shift']());}catch(_0xc0b968){_0x5e6dd1['push'](_0x5e6dd1['shift']());}}}(a40_0x570b,0xee38d));import{jsx as a40_0x45ce24,jsxs as a40_0xb2d0f5,Fragment as a40_0x423d9f}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a40_0x570b(){const _0x504771=['login-check','column','confirm-api-pull','create.validation.appCode.invalidFormat','rightArrow','project-name','gray','create.common.no','create.login.prompt','2222276xouLbz','length','env','skills-mcp-setup','creating','leftArrow','red','2801466EJjJku','includes','1268834krlCdX','create.steps.login.loggedIn','\x20←\x20','create.validation.projectName.dirExistsShort','5dbiRlf','49830696wPoVgF','value','create.login.notDetected','login','create.validation.projectName.tooLong','create.input.appCode.label','confirm-mcp-setup','create.steps.projectName.label','yellow','step','create.validation.projectName.invalid','create.input.appCode.hint','create.steps.login.failed','create.login.inProgressStatus','test','create.steps.login.label','production','create.creating','backspace','create.title','map','create.steps.appCode.label','create.skillsMcpSetup.confirm','cyan','app-code','login-prompt','create.validation.appCode.tooLong','create.steps.apiPull.label','10148106qtBwkC','create.input.projectName.label','create.steps.appCode.notSet','1735050BsxiGj','login-process','create.input.appCode.optional','Yes','create.skillsMcpSetup.hint','7791432oochtc','create.common.selectHint','create.login.valid','create.steps.skillsMcpSetup.label','green','create.validation.projectName.invalidFormat','trim','create.common.yes','label','create.apiPull.confirm'];a40_0x570b=function(){return _0x504771;};return a40_0x570b();}import{existsSync}from'node:fs';import a40_0x4acf1c from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';function a40_0x4d9f(_0x1818f8,_0x46907e){_0x1818f8=_0x1818f8-0x119;const _0x570bb6=a40_0x570b();let _0x4d9fb0=_0x570bb6[_0x1818f8];return _0x4d9fb0;}import{useI18n}from'../i18n/hooks.js';export function EnhancedGuidedCreate(_0x19ce25){const _0xe5a73e=a40_0x4d9f,{onCreate:_0x1f0d47,env:_0x207137}=_0x19ce25,{t:_0x292e36}=useI18n(),[_0x4c93bf,_0xcd519f]=useState(_0xe5a73e(0x13d)),[_0x287781,_0x26c499]=useState(''),[_0x30dd88,_0xa96076]=useState(''),[_0x2fdb40,_0x246797]=useState(''),[_0x461e66,_0x15afc5]=useState(''),[_0x4f1c1,_0x5628d9]=useState([]),[_0x4c5120,_0x41ab81]=useState(null),[_0x19f761,_0x158a56]=useState(![]),[_0x5052e0,_0x292df8]=useState(![]),[_0x469773,_0x1c5cac]=useState(![]),[_0x284716,_0x122533]=useState(0x0),[_0x5c1958,_0x215997]=useState(0x0),[_0x3c10cc,_0x44378e]=useState(0x0),[_0x379972,_0x448b81]=useState(''),_0x4a47ae='my-app',_0xd6a64d=readConfig(),_0x1b13db=typeof _0xd6a64d[_0xe5a73e(0x143)]==='string'?_0xd6a64d[_0xe5a73e(0x143)]:undefined;function _0x331098(_0x1599f1){const _0x5c830f=_0x1599f1||_0x4a47ae,_0x3892b2=a40_0x4acf1c['resolve'](process['cwd'](),_0x5c830f);return existsSync(_0x3892b2);}function _0x5ed480(_0x2746ea){const _0x3b7146=_0xe5a73e;if(_0x2746ea[_0x3b7146(0x142)]>0x32)return{'valid':![],'message':_0x292e36(_0x3b7146(0x153))};const _0x75a574=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x2746ea?.[_0x3b7146(0x134)]()&&!_0x75a574['test'](_0x2746ea))return{'valid':![],'message':_0x292e36(_0x3b7146(0x133))};return{'valid':!![]};}function _0x22a115(_0x192c04){const _0x1682a1=_0xe5a73e;if(!_0x192c04[_0x1682a1(0x134)]())return{'valid':!![]};if(_0x192c04[_0x1682a1(0x142)]>0x64)return{'valid':![],'message':_0x292e36(_0x1682a1(0x124))};const _0x46b35b=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x46b35b[_0x1682a1(0x15d)](_0x192c04))return{'valid':![],'message':_0x292e36(_0x1682a1(0x13b))};return{'valid':!![]};}async function _0x2a6a1b(){_0x158a56(!![]);try{const _0x42ec74=await getIsSessionValid();return _0x41ab81(_0x42ec74),_0x42ec74;}catch(_0x12b555){return _0x41ab81(![]),![];}finally{_0x158a56(![]);}}async function _0x26e1e5(){_0x292df8(!![]);try{const _0xe9a2a7=await authServer({'silent':!![]});return _0x41ab81(_0xe9a2a7),_0xe9a2a7;}catch(_0x5349fe){return _0x41ab81(![]),![];}finally{_0x292df8(![]);}}return useInput(async(_0x1f9a6c,_0x4183bd)=>{const _0x361867=_0xe5a73e;if(_0x4183bd[_0x361867(0x146)]||_0x4183bd[_0x361867(0x13c)]){if(_0x4c93bf===_0x361867(0x13a)){_0x122533(_0x3b2641=>_0x3b2641===0x0?0x1:0x0);return;}if(_0x4c93bf===_0x361867(0x155)){_0x215997(_0x34af28=>_0x34af28===0x0?0x1:0x0);return;}if(_0x4c93bf===_0x361867(0x123)){_0x44378e(_0x2cfcdc=>_0x2cfcdc===0x0?0x1:0x0);return;}}if(_0x4183bd['return']){if(_0x4c93bf==='project-name'){const _0x3270bb=_0x2fdb40[_0x361867(0x134)]()||_0x4a47ae;if(_0x461e66)return;if(_0x331098(_0x3270bb)){_0x448b81(_0x292e36('create.validation.projectName.dirExists',{'name':_0x3270bb}));return;}_0x26c499(_0x3270bb),_0x5628d9([{'step':_0x361867(0x13d),'label':_0x292e36(_0x361867(0x156)),'value':_0x3270bb}]),_0x246797(''),_0x15afc5(''),_0x448b81(''),_0xcd519f(_0x361867(0x122));return;}if(_0x4c93bf===_0x361867(0x122)){if(_0x461e66)return;const _0x311666=_0x2fdb40[_0x361867(0x134)]();_0xa96076(_0x311666),_0x5628d9(_0x397987=>[..._0x397987,{'step':_0x361867(0x122),'label':_0x292e36(_0x361867(0x11f)),'value':_0x311666||_0x292e36(_0x361867(0x128))}]),_0x246797(''),_0x15afc5('');if(_0x311666){_0xcd519f(_0x361867(0x138));const _0x201c3c=await _0x2a6a1b();_0x201c3c?_0xcd519f(_0x361867(0x13a)):_0xcd519f(_0x361867(0x123));}else{const _0x15eef0=_0x207137||_0x1b13db||'production';_0x1f0d47({'projectName':_0x287781,'appCode':undefined,'pullApi':![],'setupMcp':![],'env':_0x15eef0}),_0xcd519f(_0x361867(0x145));}return;}if(_0x4c93bf==='confirm-api-pull'){const _0xef1bc7=_0x284716===0x0;_0x1c5cac(_0xef1bc7),_0x5628d9(_0x29a6d2=>[..._0x29a6d2,{'step':'api-pull','label':_0x292e36(_0x361867(0x125)),'value':_0xef1bc7?_0x292e36('create.common.yes'):_0x292e36(_0x361867(0x13f))}]),_0xcd519f('confirm-mcp-setup');return;}if(_0x4c93bf===_0x361867(0x155)){const _0x217507=_0x5c1958===0x0;_0x5628d9(_0x560f2c=>[..._0x560f2c,{'step':_0x361867(0x144),'label':_0x292e36(_0x361867(0x131)),'value':_0x217507?_0x292e36(_0x361867(0x135)):_0x292e36('create.common.no')}]);const _0x512683=_0x207137||_0x1b13db||_0x361867(0x11a);_0x1f0d47({'projectName':_0x287781,'appCode':_0x30dd88,'pullApi':_0x469773,'setupMcp':_0x217507,'env':_0x512683}),_0xcd519f(_0x361867(0x145));return;}if(_0x4c93bf==='login-prompt'){const _0x47e756=_0x3c10cc===0x0;if(_0x47e756){_0xcd519f(_0x361867(0x12a));const _0x146b05=await _0x26e1e5();_0x146b05?(_0x5628d9(_0x2d96f9=>[..._0x2d96f9,{'step':'login','label':_0x292e36('create.steps.login.label'),'value':_0x292e36(_0x361867(0x14b))}]),_0xcd519f('confirm-api-pull')):(_0x5628d9(_0xccf284=>[..._0xccf284,{'step':_0x361867(0x152),'label':_0x292e36(_0x361867(0x119)),'value':_0x292e36(_0x361867(0x15b))}]),_0xcd519f(_0x361867(0x155)));}else _0x5628d9(_0x14ecec=>[..._0x14ecec,{'step':_0x361867(0x152),'label':_0x292e36(_0x361867(0x119)),'value':_0x292e36('create.steps.login.skipped')}]),_0xcd519f('confirm-mcp-setup');return;}}if(_0x4183bd[_0x361867(0x11c)]||_0x4183bd['delete']){_0x246797(_0x46074b=>{const _0x536f57=_0x361867,_0x275f58=_0x46074b['slice'](0x0,-0x1);if(_0x4c93bf==='project-name'){const {valid:_0x1b51aa,message:_0x54131f}=_0x5ed480(_0x275f58);_0x15afc5(_0x1b51aa?'':_0x54131f||_0x292e36('create.validation.projectName.invalid'));if(_0x1b51aa&&!_0x461e66){const _0x14746c=_0x275f58||_0x4a47ae;_0x331098(_0x14746c)?_0x448b81(_0x292e36(_0x536f57(0x14d),{'name':_0x14746c})):_0x448b81('');}}else{if(_0x4c93bf===_0x536f57(0x122)){const {valid:_0x150a53,message:_0x66971b}=_0x22a115(_0x275f58);_0x15afc5(_0x150a53?'':_0x66971b||_0x292e36('create.validation.appCode.invalid'));}}return _0x275f58;});return;}if([_0x361867(0x145),'login-check','login-process','confirm-api-pull',_0x361867(0x155),_0x361867(0x123)][_0x361867(0x149)](_0x4c93bf))return;_0x246797(_0x1a103c=>{const _0xd7bf4c=_0x361867,_0x4ff129=_0x1a103c+_0x1f9a6c;if(_0x4c93bf==='project-name'){const {valid:_0x444618,message:_0x33840c}=_0x5ed480(_0x4ff129);_0x15afc5(_0x444618?'':_0x33840c||_0x292e36(_0xd7bf4c(0x159)));if(_0x444618&&!_0x461e66){const _0x42e55e=_0x4ff129||_0x4a47ae;_0x331098(_0x42e55e)?_0x448b81(_0x292e36('create.validation.projectName.dirExistsShort',{'name':_0x42e55e})):_0x448b81('');}}else{if(_0x4c93bf===_0xd7bf4c(0x122)){const {valid:_0x3444a7,message:_0x21b24e}=_0x22a115(_0x4ff129);_0x15afc5(_0x3444a7?'':_0x21b24e||_0x292e36('create.validation.appCode.invalid'));}}return _0x4ff129;});}),a40_0xb2d0f5(Box,{'flexDirection':_0xe5a73e(0x139),'marginTop':0x1,'children':[_0x4f1c1[_0xe5a73e(0x142)]===0x0&&a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x121),'children':_0x292e36(_0xe5a73e(0x11d))})}),_0x4f1c1[_0xe5a73e(0x11e)](_0x312794=>a40_0xb2d0f5(Box,{'children':[a40_0x45ce24(Text,{'color':_0xe5a73e(0x132),'children':_0x292e36('create.completedStep',{'label':_0x312794[_0xe5a73e(0x136)]})}),a40_0x45ce24(Text,{'color':_0xe5a73e(0x121),'children':_0x312794[_0xe5a73e(0x150)]})]},_0x312794[_0xe5a73e(0x158)])),_0x4c93bf===_0xe5a73e(0x13d)&&a40_0xb2d0f5(a40_0x423d9f,{'children':[a40_0xb2d0f5(Box,{'children':[a40_0x45ce24(Text,{'children':_0x292e36(_0xe5a73e(0x127))}),_0x2fdb40?a40_0x45ce24(Text,{'color':_0xe5a73e(0x132),'children':_0x2fdb40}):a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x4a47ae}),_0x461e66&&a40_0xb2d0f5(Text,{'color':_0xe5a73e(0x147),'children':['\x20←\x20',_0x461e66]}),_0x379972&&a40_0xb2d0f5(Text,{'color':'red','children':[_0xe5a73e(0x14c),_0x379972]})]}),!_0x461e66&&!_0x379972&&!_0x2fdb40&&a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36('create.input.projectName.hint')})})]}),_0x4c93bf==='app-code'&&a40_0xb2d0f5(a40_0x423d9f,{'children':[a40_0xb2d0f5(Box,{'children':[a40_0x45ce24(Text,{'children':_0x292e36(_0xe5a73e(0x154))}),a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36(_0xe5a73e(0x12b))}),a40_0x45ce24(Text,{'color':_0xe5a73e(0x132),'children':_0x2fdb40}),_0x461e66&&a40_0xb2d0f5(Text,{'color':_0xe5a73e(0x147),'children':[_0xe5a73e(0x14c),_0x461e66]})]}),!_0x461e66&&a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36(_0xe5a73e(0x15a))})})]}),_0x4c93bf==='login-check'&&a40_0xb2d0f5(Box,{'children':[a40_0x45ce24(Text,{'children':_0x292e36('create.login.checking')}),_0x19f761&&a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36('create.login.checkingStatus')})]}),_0x4c93bf===_0xe5a73e(0x13a)&&a40_0xb2d0f5(a40_0x423d9f,{'children':[a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x132),'children':_0x292e36(_0xe5a73e(0x130))})}),a40_0x45ce24(Box,{'marginTop':0x1,'children':a40_0x45ce24(Text,{'children':_0x292e36(_0xe5a73e(0x137))})}),a40_0xb2d0f5(Box,{'marginLeft':0x2,'children':[a40_0xb2d0f5(Text,{'color':_0x284716===0x0?_0xe5a73e(0x132):_0xe5a73e(0x13e),'children':[_0x284716===0x0?'▶\x20':'\x20\x20',_0xe5a73e(0x12c)]}),a40_0x45ce24(Text,{'children':'\x20'}),a40_0xb2d0f5(Text,{'color':_0x284716===0x1?_0xe5a73e(0x132):_0xe5a73e(0x13e),'children':[_0x284716===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':'gray','children':_0x292e36(_0xe5a73e(0x12f))})}),a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x157),'children':_0x292e36('create.apiPull.recommendation')})})]}),_0x4c93bf===_0xe5a73e(0x155)&&a40_0xb2d0f5(a40_0x423d9f,{'children':[a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x132),'children':'√'})}),a40_0x45ce24(Box,{'marginTop':0x1,'children':a40_0x45ce24(Text,{'children':_0x292e36(_0xe5a73e(0x120))})}),a40_0xb2d0f5(Box,{'marginLeft':0x2,'children':[a40_0xb2d0f5(Text,{'color':_0x5c1958===0x0?_0xe5a73e(0x132):_0xe5a73e(0x13e),'children':[_0x5c1958===0x0?'▶\x20':'\x20\x20',_0xe5a73e(0x12c)]}),a40_0x45ce24(Text,{'children':'\x20'}),a40_0xb2d0f5(Text,{'color':_0x5c1958===0x1?_0xe5a73e(0x132):_0xe5a73e(0x13e),'children':[_0x5c1958===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36('create.common.selectHint')})}),a40_0x45ce24(Box,{'marginTop':0x1,'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36(_0xe5a73e(0x12d))})})]}),_0x4c93bf===_0xe5a73e(0x123)&&a40_0xb2d0f5(a40_0x423d9f,{'children':[a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x157),'children':_0x292e36(_0xe5a73e(0x151))})}),a40_0x45ce24(Box,{'marginTop':0x1,'children':a40_0x45ce24(Text,{'children':_0x292e36(_0xe5a73e(0x140))})}),a40_0xb2d0f5(Box,{'marginLeft':0x2,'children':[a40_0xb2d0f5(Text,{'color':_0x3c10cc===0x0?'green':_0xe5a73e(0x13e),'children':[_0x3c10cc===0x0?'▶\x20':'\x20\x20',_0xe5a73e(0x12c)]}),a40_0x45ce24(Text,{'children':'\x20'}),a40_0xb2d0f5(Text,{'color':_0x3c10cc===0x1?'green':_0xe5a73e(0x13e),'children':[_0x3c10cc===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36(_0xe5a73e(0x12f))})})]}),_0x4c93bf===_0xe5a73e(0x12a)&&a40_0xb2d0f5(Box,{'children':[a40_0x45ce24(Text,{'children':_0x292e36('create.login.inProgress')}),_0x5052e0&&a40_0x45ce24(Text,{'color':_0xe5a73e(0x13e),'children':_0x292e36(_0xe5a73e(0x15c))})]}),_0x4c93bf===_0xe5a73e(0x145)&&a40_0x45ce24(Box,{'children':a40_0x45ce24(Text,{'color':_0xe5a73e(0x132),'children':_0x292e36(_0xe5a73e(0x11b))})})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x575dae,_0x519150){const _0xfb1c8b=a41_0x8fd0,_0x121d30=_0x575dae();while(!![]){try{const _0x3a55dd=parseInt(_0xfb1c8b(0xf7))/0x1*(parseInt(_0xfb1c8b(0xf6))/0x2)+-parseInt(_0xfb1c8b(0xf4))/0x3+-parseInt(_0xfb1c8b(0xf9))/0x4+-parseInt(_0xfb1c8b(0xfe))/0x5*(-parseInt(_0xfb1c8b(0xfc))/0x6)+parseInt(_0xfb1c8b(0xf3))/0x7+parseInt(_0xfb1c8b(0xfd))/0x8+parseInt(_0xfb1c8b(0xf5))/0x9*(-parseInt(_0xfb1c8b(0xfa))/0xa);if(_0x3a55dd===_0x519150)break;else _0x121d30['push'](_0x121d30['shift']());}catch(_0x10b42b){_0x121d30['push'](_0x121d30['shift']());}}}(a41_0x2e59,0x599dd));function a41_0x8fd0(_0x32726b,_0x43a51e){_0x32726b=_0x32726b-0xf3;const _0x2e59b4=a41_0x2e59();let _0x8fd0e8=_0x2e59b4[_0x32726b];return _0x8fd0e8;}function a41_0x2e59(){const _0x5d6a07=['1442532qXbymE','10QHUtvf','replace','3820314IZYUXV','525840frcCVi','5PWsViA','4989817rVsRkK','2182998kveHrb','5262183JgOKfr','49982sYJByt','25CGRbun','toFixed'];a41_0x2e59=function(){return _0x5d6a07;};return a41_0x2e59();}export function formatElapsed(_0x1d628e){const _0xb598f7=a41_0x8fd0,_0x15a6b9=Date['now']()-_0x1d628e;if(_0x15a6b9<0x3e8)return _0x15a6b9+'ms';const _0x5df067=(_0x15a6b9/0x3e8)[_0xb598f7(0xf8)](0x2),_0x5e0d76=_0x5df067[_0xb598f7(0xfb)](/\.?0+$/u,'');return _0x5e0d76+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x321138,_0x6555a7){const _0x2df851=a42_0x3cb6,_0x174d07=_0x321138();while(!![]){try{const _0x3146f3=parseInt(_0x2df851(0x1b5))/0x1*(-parseInt(_0x2df851(0x162))/0x2)+-parseInt(_0x2df851(0x1b4))/0x3+-parseInt(_0x2df851(0x1a1))/0x4+-parseInt(_0x2df851(0x14d))/0x5*(parseInt(_0x2df851(0x1b2))/0x6)+parseInt(_0x2df851(0x1b7))/0x7+-parseInt(_0x2df851(0x16e))/0x8+parseInt(_0x2df851(0x19e))/0x9;if(_0x3146f3===_0x6555a7)break;else _0x174d07['push'](_0x174d07['shift']());}catch(_0x19be98){_0x174d07['push'](_0x174d07['shift']());}}}(a42_0x45dd,0xf38f6));import{jsx as a42_0x1ae0cc,Fragment as a42_0x1b0a09,jsxs as a42_0x41021b}from'react/jsx-runtime';import a42_0x1200e4 from'path';import a42_0x33fcb1 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';function a42_0x3cb6(_0x5bd4b3,_0x234ec0){_0x5bd4b3=_0x5bd4b3-0x144;const _0x45dda0=a42_0x45dd();let _0x3cb6f0=_0x45dda0[_0x5bd4b3];return _0x3cb6f0;}import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{configureMcp,copySharedSkills,installSkill,createSkillManifest}from'../ai-setup/config.js';import{MCP_IDES}from'../utils/ai_config.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{useI18n}from'../i18n/hooks.js';function a42_0x45dd(){const _0x80cd13=['create.nextSteps.skill','.lovrabetrc','needsUpgrade','has','create.packageJson.updating','white','create.display.appCode','create.lovrabetSetup.mcpCompleted','writeFileSync','create.packageJson.updated','cd\x20','清理项目目录失败:\x20','then','doTask','utf8','map','env','currentVersion','20078PwBhca','constants','2.\x20','create','gray','create.nextSteps.pullApi','parse','create.results.nextSteps','message','\x20√\x20','../..','1.\x20','9495024gmphMv','setLogPath','cwd','create.validation.noPermission','项目创建失败:\x20','toLocaleString','yellow','create.config.createdWithAppCode','info','version','pullApi','\x20Skill\x20','red','create.errors.createFailed','error','resolve','string','existsSync','lovrabet\x20mcp\x20install','accessSync','trim','create.validation.required','push','rmSync','ide','\x20MCP\x20','Cursor','projectName','projectCode','create.steps.apiPullError','create.lovrabetSetup.skillCompleted','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','skill','mcp-','API\x20配置拉取成功:\x20','create.config.creating','warn','lovrabet\x20skill\x20install','column','Claude\x20Code','create.steps.mcpConfigComplete','filter','create.steps.apiPullFailed','3.\x20','create.validation.tooLong','项目创建完成:\x20','create.nextSteps.startProject','success','45238428NonuJO','stableVersion','length','3086060cAgzWJ','create.nextSteps.mcp','join','API\x20配置拉取异常','1.0.0','log','manual','description','selectedIDEs','配置应用AppCode:\x20','dirname','更新\x20package.json\x20name','配置应用AppCode失败','cursor','green','package.json','test','23514MKRsPi','cyan','4607982rWmwQS','60fHTxhK','appCode','502432OVKLDG','stringify','\x20\x20✗\x20Skill\x20','aiSetup','\x20\x20✗\x20MCP\x20','create.nextSteps.configureMcpAndSkill','CLI\x20版本检查','\x20&&\x20lovrabet\x20start','mcp','status','readFileSync','lovrabet\x20config\x20set\x20appcode\x20[app-code]','API\x20配置拉取失败:\x20','lovrabet\x20api\x20pull','repeat','5PFGodN','W_OK','create.display.projectName'];a42_0x45dd=function(){return _0x80cd13;};return a42_0x45dd();}export function CreateApp(_0x489e03){const _0x26f9cf=a42_0x3cb6,{t:_0x137f52}=useI18n(),[_0x3d9bd5,_0x5a1ea7]=useState(![]),[_0x508208,_0x750ace]=useState(![]),[_0x14eed0,_0x50a470]=useState(null),[_0x103c30,_0x54d0c5]=useState(null),_0x28f7cb=useCopyProjectTemplate(),_0xd02066=useInstallDependencies(),_0xe55902=useFormatCode();useEffect(()=>{const _0x4ee0b2=a42_0x3cb6;checkCliVersion()[_0x4ee0b2(0x15c)](_0xbacd9f=>{const _0x33a9f7=_0x4ee0b2;_0xbacd9f[_0x33a9f7(0x152)]&&(printCliUpgradeWarning(_0xbacd9f),logger[_0x33a9f7(0x176)]('create',_0x33a9f7(0x144),{'currentVersion':_0xbacd9f[_0x33a9f7(0x161)],'stableVersion':_0xbacd9f[_0x33a9f7(0x19f)],'needsUpgrade':_0xbacd9f[_0x33a9f7(0x152)]}));});},[]);const _0x9fade6=async _0x12390e=>{const _0x4026d2=a42_0x3cb6;if(!_0x12390e[_0x4026d2(0x189)]||_0x12390e['projectName'][_0x4026d2(0x182)]()===''){console[_0x4026d2(0x17c)](_0x137f52(_0x4026d2(0x183)));return;}const _0x9bd003=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x9bd003[_0x4026d2(0x1b1)](_0x12390e[_0x4026d2(0x189)])){console['error'](_0x137f52('create.validation.invalidChars'));return;}if(_0x12390e['projectName']['length']>0x64){console[_0x4026d2(0x17c)](_0x137f52(_0x4026d2(0x19a)));return;}const _0x4ab81=a42_0x1200e4[_0x4026d2(0x17d)](process['cwd'](),_0x12390e[_0x4026d2(0x189)]);if(a42_0x33fcb1[_0x4026d2(0x17f)](_0x4ab81)){console['error'](_0x137f52('create.validation.dirExists',{'name':_0x12390e[_0x4026d2(0x189)]}));return;}try{const _0x181943=a42_0x1200e4[_0x4026d2(0x1ab)](_0x4ab81);a42_0x33fcb1[_0x4026d2(0x181)](_0x181943,a42_0x33fcb1[_0x4026d2(0x163)][_0x4026d2(0x14e)]);}catch(_0x34e624){console[_0x4026d2(0x17c)](_0x137f52(_0x4026d2(0x171)));return;}_0x50a470(_0x12390e),_0x5a1ea7(!![]),logger[_0x4026d2(0x16f)](_0x4ab81),logger['info'](_0x4026d2(0x165),'开始创建项目:\x20'+_0x12390e[_0x4026d2(0x189)],{'projectDir':_0x4ab81,'appCode':_0x12390e[_0x4026d2(0x1b6)]});try{await _0x28f7cb[_0x4026d2(0x15d)](_0x12390e[_0x4026d2(0x189)]),await _0x22561b(_0x12390e[_0x4026d2(0x189)]),await _0xd02066[_0x4026d2(0x15d)](_0x12390e[_0x4026d2(0x189)]),await _0xe55902[_0x4026d2(0x15d)](_0x12390e[_0x4026d2(0x189)]),await _0x1649a(_0x12390e[_0x4026d2(0x189)],_0x12390e[_0x4026d2(0x1b6)]||'',_0x12390e[_0x4026d2(0x160)]);if(_0x12390e[_0x4026d2(0x178)]&&_0x12390e['appCode']){console['log'](_0x137f52('create.steps.pullingApi'));try{const _0x534e33=await pullApiSilent(_0x12390e[_0x4026d2(0x1b6)],undefined,_0x4ab81,_0x12390e['env']);_0x534e33?(console[_0x4026d2(0x1a6)](_0x137f52('create.steps.apiPullSuccess')),logger[_0x4026d2(0x176)](_0x4026d2(0x165),_0x4026d2(0x190)+_0x12390e[_0x4026d2(0x1b6)])):(console[_0x4026d2(0x1a6)](_0x137f52(_0x4026d2(0x198))),logger[_0x4026d2(0x192)](_0x4026d2(0x165),_0x4026d2(0x14a)+_0x12390e[_0x4026d2(0x1b6)]));}catch(_0xbc1240){console[_0x4026d2(0x1a6)](_0x137f52(_0x4026d2(0x18b))),logger[_0x4026d2(0x192)](_0x4026d2(0x165),_0x4026d2(0x1a4),{'error':_0xbc1240 instanceof Error?_0xbc1240[_0x4026d2(0x16a)]:String(_0xbc1240)});}}if(_0x12390e[_0x4026d2(0x1ba)]&&_0x12390e['selectedIDEs']&&_0x12390e[_0x4026d2(0x1a9)][_0x4026d2(0x1a0)]>0x0&&_0x12390e['appCode']){console[_0x4026d2(0x1a6)](_0x137f52('create.lovrabetSetup.inProgress'));const _0x538524=[],_0x12db85=[],_0x48f20b=_0x12390e['selectedIDEs'][_0x4026d2(0x197)](_0x14c7e4=>MCP_IDES[_0x4026d2(0x153)](_0x14c7e4)),_0x37343b=_0x12390e[_0x4026d2(0x1a9)];for(const _0x5521ca of _0x48f20b){try{const _0x8ae11b=await configureMcp(_0x5521ca,_0x4ab81);_0x538524[_0x4026d2(0x184)]({'ide':_0x5521ca==='cursor'?_0x4026d2(0x188):_0x4026d2(0x195),'status':_0x8ae11b[_0x4026d2(0x147)],'message':_0x8ae11b[_0x4026d2(0x16a)]}),console[_0x4026d2(0x1a6)]('\x20\x20'+(_0x8ae11b[_0x4026d2(0x147)]===_0x4026d2(0x19d)?'✓':_0x8ae11b['status']===_0x4026d2(0x1a7)?'⚠️':'✗')+_0x4026d2(0x187)+_0x5521ca+':\x20'+_0x8ae11b[_0x4026d2(0x16a)]);}catch(_0x1a897c){_0x538524[_0x4026d2(0x184)]({'ide':_0x5521ca===_0x4026d2(0x1ae)?'Cursor':'Claude\x20Code','status':_0x4026d2(0x17c),'message':_0x1a897c instanceof Error?_0x1a897c[_0x4026d2(0x16a)]:String(_0x1a897c)}),console[_0x4026d2(0x1a6)](_0x4026d2(0x1bb)+_0x5521ca+':\x20'+(_0x1a897c instanceof Error?_0x1a897c[_0x4026d2(0x16a)]:String(_0x1a897c)));}}await copySharedSkills(_0x4ab81);for(const _0x30ca89 of _0x37343b){try{const _0x4e9c75=await installSkill(_0x30ca89,_0x4ab81);_0x12db85[_0x4026d2(0x184)]({'ide':_0x4e9c75[_0x4026d2(0x186)],'status':_0x4e9c75[_0x4026d2(0x147)],'message':_0x4e9c75[_0x4026d2(0x16a)]}),console[_0x4026d2(0x1a6)]('\x20\x20'+(_0x4e9c75[_0x4026d2(0x147)]===_0x4026d2(0x19d)?'✓':'✗')+_0x4026d2(0x179)+_0x4e9c75['ide']+':\x20'+_0x4e9c75[_0x4026d2(0x16a)]);}catch(_0x440e46){_0x12db85[_0x4026d2(0x184)]({'ide':_0x30ca89,'status':'error','message':_0x440e46 instanceof Error?_0x440e46[_0x4026d2(0x16a)]:String(_0x440e46)}),console[_0x4026d2(0x1a6)](_0x4026d2(0x1b9)+_0x30ca89+':\x20'+(_0x440e46 instanceof Error?_0x440e46[_0x4026d2(0x16a)]:String(_0x440e46)));}}if(_0x12db85['length']>0x0){const _0x9db4b7=_0x12db85[_0x4026d2(0x197)](_0x1081ba=>_0x1081ba[_0x4026d2(0x147)]===_0x4026d2(0x19d))[_0x4026d2(0x15f)](_0x3f471f=>_0x3f471f[_0x4026d2(0x186)]);_0x9db4b7[_0x4026d2(0x1a0)]>0x0&&createSkillManifest(_0x4ab81,_0x9db4b7);}_0x54d0c5({'mcp':_0x538524,'skill':_0x12db85}),console['log'](_0x137f52(_0x4026d2(0x196)));}logger[_0x4026d2(0x19d)](_0x4026d2(0x165),_0x4026d2(0x19b)+_0x12390e['projectName']),_0x750ace(!![]),_0x5a1ea7(![]);}catch(_0x56e2e2){logger[_0x4026d2(0x17c)](_0x4026d2(0x165),_0x4026d2(0x172)+_0x12390e[_0x4026d2(0x189)],{'error':_0x56e2e2 instanceof Error?_0x56e2e2['message']:String(_0x56e2e2)});try{a42_0x33fcb1[_0x4026d2(0x17f)](_0x4ab81)&&(console[_0x4026d2(0x1a6)](_0x137f52('create.cleanup.inProgress',{'dir':_0x4ab81})),a42_0x33fcb1[_0x4026d2(0x185)](_0x4ab81,{'recursive':!![],'force':!![]}));}catch(_0x2dbc36){logger['warn']('create',_0x4026d2(0x15b)+_0x4ab81);}_0x5a1ea7(![]),console[_0x4026d2(0x17c)](_0x137f52(_0x4026d2(0x17b),{'error':_0x56e2e2 instanceof Error?_0x56e2e2[_0x4026d2(0x16a)]:String(_0x56e2e2)}));}},_0x5976cb=async _0x26b2d2=>{const _0x1fe30d=a42_0x3cb6;await _0x9fade6({'projectName':_0x26b2d2,'env':_0x489e03[_0x1fe30d(0x160)]});},_0x22561b=async _0x2d7132=>{const _0x2046c2=a42_0x3cb6,_0x3dc4e3=a42_0x1200e4[_0x2046c2(0x17d)](process[_0x2046c2(0x170)](),_0x2d7132),_0x554a5b=a42_0x1200e4[_0x2046c2(0x1a3)](_0x3dc4e3,'package.json');try{console[_0x2046c2(0x1a6)](_0x137f52(_0x2046c2(0x154)));const _0x106d5b=fileURLToPath(import.meta.url),_0x26e5c1=a42_0x1200e4[_0x2046c2(0x17d)](a42_0x1200e4[_0x2046c2(0x1ab)](_0x106d5b),'../..'),_0x33343f=a42_0x1200e4[_0x2046c2(0x1a3)](_0x26e5c1,_0x2046c2(0x1b0));let _0x39bf86=_0x2046c2(0x1a5);try{const _0x4ed4ca=JSON[_0x2046c2(0x168)](a42_0x33fcb1['readFileSync'](_0x33343f,_0x2046c2(0x15e)));_0x39bf86=_0x4ed4ca['version']||_0x2046c2(0x1a5);}catch(_0x2b52db){}const _0x1b86c4=a42_0x33fcb1[_0x2046c2(0x148)](_0x554a5b,_0x2046c2(0x15e)),_0x4df5b0=JSON[_0x2046c2(0x168)](_0x1b86c4);_0x4df5b0['name']=_0x2d7132,_0x4df5b0[_0x2046c2(0x1a8)]=_0x2d7132+'\x20Generated\x20by\x20lovrabet\x20cli\x20'+_0x39bf86,a42_0x33fcb1['writeFileSync'](_0x554a5b,JSON[_0x2046c2(0x1b8)](_0x4df5b0,null,0x2)+'\x0a',_0x2046c2(0x15e)),console[_0x2046c2(0x1a6)](_0x137f52(_0x2046c2(0x159),{'name':_0x2d7132})),logger['info']('create',_0x2046c2(0x1ac));}catch(_0x22930e){logger[_0x2046c2(0x17c)](_0x2046c2(0x165),'更新\x20package.json\x20失败');throw _0x22930e;}},_0x1649a=async(_0x1baf69,_0x46a54a,_0x2b1831)=>{const _0x53129a=a42_0x3cb6,_0x26755c=a42_0x1200e4[_0x53129a(0x17d)](process[_0x53129a(0x170)](),_0x1baf69),_0x1bbbf6=a42_0x1200e4[_0x53129a(0x1a3)](_0x26755c,_0x53129a(0x151));try{_0x46a54a?console[_0x53129a(0x1a6)](_0x137f52('create.config.configuringAppCode',{'name':_0x1baf69,'appCode':_0x46a54a})):console[_0x53129a(0x1a6)](_0x137f52(_0x53129a(0x191),{'name':_0x1baf69}));const _0x5525ea=fileURLToPath(import.meta.url),_0x16c557=a42_0x1200e4[_0x53129a(0x17d)](a42_0x1200e4['dirname'](_0x5525ea),_0x53129a(0x16c)),_0x54c7b3=a42_0x1200e4[_0x53129a(0x1a3)](_0x16c557,'package.json');let _0x3c1a71=_0x53129a(0x1a5);try{const _0x34950e=JSON[_0x53129a(0x168)](a42_0x33fcb1[_0x53129a(0x148)](_0x54c7b3,_0x53129a(0x15e)));_0x3c1a71=_0x34950e[_0x53129a(0x177)]||_0x53129a(0x1a5);}catch(_0x1ab0b6){}const _0x1ec75c=readConfig(),_0x5d737c=typeof _0x1ec75c[_0x53129a(0x160)]===_0x53129a(0x17e)?_0x1ec75c[_0x53129a(0x160)]:undefined,{app:_0x132702,appcode:_0x52ec71,..._0x56e583}=_0x1ec75c,_0x2873a6={..._0x56e583,'appcode':_0x46a54a||'','env':_0x2b1831||_0x5d737c||'online','createdAt':new Date()[_0x53129a(0x173)](),'version':_0x3c1a71};a42_0x33fcb1[_0x53129a(0x158)](_0x1bbbf6,JSON[_0x53129a(0x1b8)](_0x2873a6,null,0x2),'utf8'),_0x46a54a?console[_0x53129a(0x1a6)](_0x137f52(_0x53129a(0x175),{'appCode':_0x46a54a})):console[_0x53129a(0x1a6)](_0x137f52('create.config.createdWithoutAppCode')),logger['info'](_0x53129a(0x165),_0x53129a(0x1aa)+_0x46a54a);}catch(_0x18b4c8){logger[_0x53129a(0x17c)](_0x53129a(0x165),_0x53129a(0x1ad));}};useEffect(()=>{const _0x453731=a42_0x3cb6;_0x489e03[_0x453731(0x18a)]&&_0x5976cb(_0x489e03[_0x453731(0x18a)]);},[_0x489e03[_0x26f9cf(0x18a)]]);if(!_0x3d9bd5&&!_0x508208&&!_0x489e03['projectCode'])return a42_0x1ae0cc(EnhancedGuidedCreate,{'onCreate':_0x9fade6,'env':_0x489e03[_0x26f9cf(0x160)]});if(_0x3d9bd5)return a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x41021b(Box,{'marginTop':0x1,'children':[a42_0x1ae0cc(Box,{'width':'1'}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':'\x20√\x20'}),a42_0x1ae0cc(Text,{'children':_0x137f52(_0x26f9cf(0x14f))}),a42_0x1ae0cc(Text,{'color':'green','children':_0x14eed0?.[_0x26f9cf(0x189)]}),_0x14eed0?.[_0x26f9cf(0x1b6)]&&a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x1ae0cc(Text,{'children':_0x137f52(_0x26f9cf(0x156))}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1b3),'children':_0x14eed0['appCode']})]})]}),a42_0x1ae0cc(TaskRunning,{..._0x28f7cb}),a42_0x1ae0cc(TaskRunning,{..._0xd02066}),a42_0x1ae0cc(TaskRunning,{..._0xe55902})]});if(_0x508208){const _0x3e1731=_0x103c30&&(_0x103c30[_0x26f9cf(0x146)][_0x26f9cf(0x1a0)]>0x0||_0x103c30[_0x26f9cf(0x18e)]['length']>0x0);return a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x41021b(Box,{'marginTop':0x1,'children':[a42_0x1ae0cc(Box,{'width':'1'}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':_0x26f9cf(0x16b)}),a42_0x1ae0cc(Text,{'children':_0x137f52(_0x26f9cf(0x14f))}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':_0x14eed0?.[_0x26f9cf(0x189)]}),_0x14eed0?.[_0x26f9cf(0x1b6)]&&a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x1ae0cc(Text,{'children':_0x137f52(_0x26f9cf(0x156))}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1b3),'children':_0x14eed0['appCode']})]})]}),a42_0x1ae0cc(TaskFinished,{..._0x28f7cb}),a42_0x1ae0cc(TaskFinished,{..._0xd02066}),a42_0x1ae0cc(TaskFinished,{..._0xe55902}),a42_0x1ae0cc(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':'─'[_0x26f9cf(0x14c)](0x3c)})}),_0x3e1731&&a42_0x41021b(a42_0x1b0a09,{'children':[_0x103c30[_0x26f9cf(0x146)]['length']>0x0&&a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x1ae0cc(Box,{'marginTop':0x1,'children':a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'bold':!![],'children':_0x137f52(_0x26f9cf(0x157))})}),_0x103c30[_0x26f9cf(0x146)][_0x26f9cf(0x15f)]((_0x24405f,_0x5d4148)=>a42_0x1ae0cc(Box,{'marginLeft':0x2,'children':a42_0x41021b(Text,{'color':_0x24405f[_0x26f9cf(0x147)]===_0x26f9cf(0x19d)?_0x26f9cf(0x155):_0x24405f['status']===_0x26f9cf(0x1a7)?_0x26f9cf(0x174):_0x26f9cf(0x17a),'children':[_0x24405f[_0x26f9cf(0x186)],':\x20',_0x24405f[_0x26f9cf(0x16a)]]})},_0x26f9cf(0x18f)+_0x5d4148))]}),_0x103c30[_0x26f9cf(0x18e)][_0x26f9cf(0x1a0)]>0x0&&a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x1ae0cc(Box,{'marginTop':_0x103c30[_0x26f9cf(0x146)][_0x26f9cf(0x1a0)]>0x0?0x1:0x0,'children':a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'bold':!![],'children':_0x137f52(_0x26f9cf(0x18c))})}),_0x103c30[_0x26f9cf(0x18e)][_0x26f9cf(0x15f)]((_0x2683dc,_0x5ee25d)=>a42_0x1ae0cc(Box,{'marginLeft':0x2,'children':a42_0x41021b(Text,{'color':_0x2683dc[_0x26f9cf(0x147)]===_0x26f9cf(0x19d)?_0x26f9cf(0x155):_0x26f9cf(0x17a),'children':[_0x2683dc[_0x26f9cf(0x186)],':\x20',_0x2683dc[_0x26f9cf(0x16a)]]})},'skill-'+_0x5ee25d))]}),a42_0x1ae0cc(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':'─'['repeat'](0x3c)})})]}),a42_0x1ae0cc(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1b3),'bold':!![],'children':_0x137f52(_0x26f9cf(0x169))})}),a42_0x41021b(Box,{'marginLeft':0x2,'flexDirection':_0x26f9cf(0x194),'children':[_0x3e1731?a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x41021b(Box,{'children':[a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':_0x26f9cf(0x16d)}),a42_0x1ae0cc(Text,{'color':'white','children':_0x137f52(_0x26f9cf(0x19c))}),a42_0x1ae0cc(Text,{'color':'cyan','bold':!![],'children':_0x26f9cf(0x15a)+_0x14eed0?.[_0x26f9cf(0x189)]+_0x26f9cf(0x145)})]}),_0x14eed0?.[_0x26f9cf(0x1b6)]&&!_0x14eed0?.['pullApi']&&a42_0x41021b(Box,{'children':[a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x174),'children':_0x26f9cf(0x164)}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x155),'children':_0x137f52('create.nextSteps.pullApi')}),a42_0x1ae0cc(Text,{'color':'cyan','bold':!![],'children':_0x26f9cf(0x14b)})]})]}):a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x1ae0cc(Box,{'children':a42_0x1ae0cc(Text,{'color':'yellow','bold':!![],'children':_0x137f52(_0x26f9cf(0x1bc))})}),a42_0x41021b(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x155),'children':_0x137f52(_0x26f9cf(0x150))}),a42_0x1ae0cc(Text,{'color':'cyan','bold':!![],'children':_0x26f9cf(0x193)})]}),a42_0x41021b(Box,{'marginLeft':0x2,'children':[a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x155),'children':_0x137f52(_0x26f9cf(0x1a2))}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1b3),'bold':!![],'children':_0x26f9cf(0x180)})]}),a42_0x41021b(Box,{'marginTop':0x1,'children':[a42_0x1ae0cc(Text,{'color':'green','children':_0x26f9cf(0x164)}),a42_0x1ae0cc(Text,{'color':'white','children':_0x137f52(_0x26f9cf(0x19c))}),a42_0x1ae0cc(Text,{'color':'cyan','bold':!![],'children':_0x26f9cf(0x15a)+_0x14eed0?.[_0x26f9cf(0x189)]+_0x26f9cf(0x145)})]}),_0x14eed0?.[_0x26f9cf(0x1b6)]&&!_0x14eed0?.['pullApi']&&a42_0x41021b(Box,{'children':[a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x174),'children':'3.\x20'}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x155),'children':_0x137f52(_0x26f9cf(0x167))}),a42_0x1ae0cc(Text,{'color':'cyan','bold':!![],'children':_0x26f9cf(0x14b)})]})]}),!_0x14eed0?.[_0x26f9cf(0x1b6)]&&a42_0x41021b(a42_0x1b0a09,{'children':[a42_0x41021b(Box,{'children':[a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x166),'children':'2.\x20'}),a42_0x1ae0cc(Text,{'color':'white','children':_0x137f52('create.nextSteps.configAppCode')}),a42_0x1ae0cc(Text,{'color':'cyan','bold':!![],'children':_0x26f9cf(0x149)})]}),a42_0x41021b(Box,{'children':[a42_0x1ae0cc(Text,{'color':'gray','children':_0x26f9cf(0x199)}),a42_0x1ae0cc(Text,{'color':'white','children':_0x137f52(_0x26f9cf(0x167))}),a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1b3),'bold':!![],'children':_0x26f9cf(0x18d)})]})]})]}),a42_0x1ae0cc(Box,{'marginTop':0x1,'children':a42_0x1ae0cc(Text,{'color':_0x26f9cf(0x1af),'children':'─'[_0x26f9cf(0x14c)](0x3c)})})]});}return null;}
|
|
1
|
+
(function(_0x259fc6,_0xb1e32f){const _0x1e6a5b=a42_0x33fc,_0x44ee2e=_0x259fc6();while(!![]){try{const _0x42f2c9=parseInt(_0x1e6a5b(0xd6))/0x1*(parseInt(_0x1e6a5b(0xf3))/0x2)+-parseInt(_0x1e6a5b(0xdc))/0x3+parseInt(_0x1e6a5b(0xb8))/0x4+-parseInt(_0x1e6a5b(0xd5))/0x5+parseInt(_0x1e6a5b(0xe1))/0x6*(-parseInt(_0x1e6a5b(0xdd))/0x7)+parseInt(_0x1e6a5b(0xf4))/0x8+-parseInt(_0x1e6a5b(0x11c))/0x9;if(_0x42f2c9===_0xb1e32f)break;else _0x44ee2e['push'](_0x44ee2e['shift']());}catch(_0x4554a4){_0x44ee2e['push'](_0x44ee2e['shift']());}}}(a42_0x1939,0x678c6));import{jsx as a42_0x53b6cb,Fragment as a42_0x183490,jsxs as a42_0x2b2174}from'react/jsx-runtime';import a42_0x5e07d6 from'path';import a42_0x45f5e0 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';function a42_0x1939(){const _0x4e4f3f=['3jdDUZC','dirname','2.\x20','push','create.config.creating','mcp-','298581JecIIm','70oLSmOM','lovrabet\x20api\x20pull','Cursor','string','197808YjoknH','existsSync','cd\x20','white','create.validation.noPermission','create.results.nextSteps','skipped','package.json','项目创建完成:\x20','projectCode','name','log','create.packageJson.updated','\x20&&\x20lovrabet\x20start','1.0.0','version','column','stringify','440294idjUgn','5338320TqNxYM','create.steps.apiPullSuccess','setLogPath','toLocaleString','create.nextSteps.installMcp','readFileSync','error','create.skillsMcpSetup.mcpInProgress','utf8','resolve','create.display.appCode','create.config.createdWithoutAppCode','CLI\x20版本检查','Skills\x20安装异常,继续配置\x20MCP','stableVersion','rmSync','ide','\x20\x20✗\x20MCP\x20Cursor:\x20','appCode','length','create.validation.invalidChars','API\x20配置拉取成功:\x20','yellow','accessSync','projectName','create.nextSteps.startProject','parse','更新\x20package.json\x20name','\x20√\x20','create.skillsMcpSetup.completed','needsUpgrade','join','info','env','create','cwd','green','test','create.packageJson.updating','cyan','4748643CjrvGr','trim','cursor','create.nextSteps.pullApi','1469656scFQzl','constants','warn','W_OK','create.config.createdWithAppCode','开始创建项目:\x20','lovrabet\x20mcp\x20install','then','API\x20配置拉取失败:\x20','pullApi','.lovrabetrc','\x20Generated\x20by\x20lovrabet\x20cli\x20','配置应用AppCode:\x20','\x20MCP\x20Cursor:\x20','create.validation.required','create.nextSteps.installSkill','description','create.display.projectName','create.errors.createFailed','message','doTask','API\x20配置拉取异常','map','create.steps.mcpConfigComplete','repeat','success','status','writeFileSync','create.steps.pullingApi','1570885ZOKTLc'];a42_0x1939=function(){return _0x4e4f3f;};return a42_0x1939();}import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{configureMcp}from'../ai-setup/config.js';import{runNpxSkillsAdd,NPX_SKILLS_ADD_COMMAND_LINE}from'../skills/npx-skills-add.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a42_0x33fc(_0x196faf,_0x27a7cd){_0x196faf=_0x196faf-0xb6;const _0x193901=a42_0x1939();let _0x33fc34=_0x193901[_0x196faf];return _0x33fc34;}import{useI18n}from'../i18n/hooks.js';export function CreateApp(_0x103ba8){const _0x4712a3=a42_0x33fc,{t:_0x3df92d}=useI18n(),[_0x15d2eb,_0x2772a2]=useState(![]),[_0x14d0f3,_0x27c6fc]=useState(![]),[_0x4d970,_0x25e741]=useState(null),[_0x532804,_0xfaf3a7]=useState(null),[_0xb73303,_0x208f74]=useState(![]),_0x474472=useCopyProjectTemplate(),_0x5d4500=useInstallDependencies(),_0x5b5818=useFormatCode();useEffect(()=>{const _0x1ba40f=a42_0x33fc;checkCliVersion()[_0x1ba40f(0xbf)](_0x4f7982=>{const _0x3430c3=_0x1ba40f;_0x4f7982['needsUpgrade']&&(printCliUpgradeWarning(_0x4f7982),logger[_0x3430c3(0x114)](_0x3430c3(0x116),_0x3430c3(0x100),{'currentVersion':_0x4f7982['currentVersion'],'stableVersion':_0x4f7982[_0x3430c3(0x102)],'needsUpgrade':_0x4f7982[_0x3430c3(0x112)]}));});},[]);const _0x4a7a53=async _0x2bce52=>{const _0x124ac8=a42_0x33fc;if(!_0x2bce52[_0x124ac8(0x10c)]||_0x2bce52[_0x124ac8(0x10c)][_0x124ac8(0x11d)]()===''){console[_0x124ac8(0xfa)](_0x3df92d(_0x124ac8(0xc6)));return;}const _0x2f519e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2f519e[_0x124ac8(0x119)](_0x2bce52['projectName'])){console['error'](_0x3df92d(_0x124ac8(0x108)));return;}if(_0x2bce52[_0x124ac8(0x10c)][_0x124ac8(0x107)]>0x64){console[_0x124ac8(0xfa)](_0x3df92d('create.validation.tooLong'));return;}const _0x29b635=a42_0x5e07d6[_0x124ac8(0xfd)](process[_0x124ac8(0x117)](),_0x2bce52[_0x124ac8(0x10c)]);if(a42_0x45f5e0[_0x124ac8(0xe2)](_0x29b635)){console[_0x124ac8(0xfa)](_0x3df92d('create.validation.dirExists',{'name':_0x2bce52[_0x124ac8(0x10c)]}));return;}try{const _0x1c2ace=a42_0x5e07d6[_0x124ac8(0xd7)](_0x29b635);a42_0x45f5e0[_0x124ac8(0x10b)](_0x1c2ace,a42_0x45f5e0[_0x124ac8(0xb9)][_0x124ac8(0xbb)]);}catch(_0x597dc3){console[_0x124ac8(0xfa)](_0x3df92d(_0x124ac8(0xe5)));return;}_0x25e741(_0x2bce52),_0x2772a2(!![]),logger[_0x124ac8(0xf6)](_0x29b635),logger['info']('create',_0x124ac8(0xbd)+_0x2bce52[_0x124ac8(0x10c)],{'projectDir':_0x29b635,'appCode':_0x2bce52[_0x124ac8(0x106)]});try{await _0x474472[_0x124ac8(0xcc)](_0x2bce52[_0x124ac8(0x10c)]),await _0x4a3c4e(_0x2bce52[_0x124ac8(0x10c)]),await _0x5d4500[_0x124ac8(0xcc)](_0x2bce52['projectName']),await _0x5b5818[_0x124ac8(0xcc)](_0x2bce52[_0x124ac8(0x10c)]),await _0x297a28(_0x2bce52[_0x124ac8(0x10c)],_0x2bce52[_0x124ac8(0x106)]||'',_0x2bce52[_0x124ac8(0x115)]);if(_0x2bce52[_0x124ac8(0xc1)]&&_0x2bce52['appCode']){console[_0x124ac8(0xec)](_0x3df92d(_0x124ac8(0xd4)));try{const _0x5e6a60=await pullApiSilent(_0x2bce52[_0x124ac8(0x106)],undefined,_0x29b635,_0x2bce52[_0x124ac8(0x115)]);_0x5e6a60?(console[_0x124ac8(0xec)](_0x3df92d(_0x124ac8(0xf5))),logger[_0x124ac8(0x114)](_0x124ac8(0x116),_0x124ac8(0x109)+_0x2bce52['appCode'])):(console[_0x124ac8(0xec)](_0x3df92d('create.steps.apiPullFailed')),logger[_0x124ac8(0xba)](_0x124ac8(0x116),_0x124ac8(0xc0)+_0x2bce52['appCode']));}catch(_0x1bd50d){console['log'](_0x3df92d('create.steps.apiPullError')),logger[_0x124ac8(0xba)](_0x124ac8(0x116),_0x124ac8(0xcd),{'error':_0x1bd50d instanceof Error?_0x1bd50d[_0x124ac8(0xcb)]:String(_0x1bd50d)});}}const _0xbe63f3=[];let _0x4a67a2=![];if(_0x2bce52['setupMcp']&&_0x2bce52[_0x124ac8(0x106)]){console[_0x124ac8(0xec)](_0x3df92d('create.skillsMcpSetup.skillsInProgress'));try{const _0x55965e=runNpxSkillsAdd(_0x29b635,{'stdio':'inherit'});_0x4a67a2=_0x55965e['ok'],_0x55965e[_0x124ac8(0xe7)]&&console['log'](_0x3df92d('create.skillsMcpSetup.skillsSkipped'));}catch(_0xe87467){logger['warn']('create',_0x124ac8(0x101),{'error':_0xe87467 instanceof Error?_0xe87467[_0x124ac8(0xcb)]:String(_0xe87467)});}console[_0x124ac8(0xec)](_0x3df92d(_0x124ac8(0xfb)));const _0x46dd98=_0x124ac8(0xb6);try{const _0x4932ac=await configureMcp(_0x46dd98,_0x29b635);_0xbe63f3[_0x124ac8(0xd9)]({'ide':_0x124ac8(0xdf),'status':_0x4932ac[_0x124ac8(0xd2)],'message':_0x4932ac[_0x124ac8(0xcb)]}),console['log']('\x20\x20'+(_0x4932ac[_0x124ac8(0xd2)]===_0x124ac8(0xd1)?'✓':_0x4932ac['status']==='manual'?'⚠️':'✗')+_0x124ac8(0xc5)+_0x4932ac[_0x124ac8(0xcb)]);}catch(_0x2901bb){_0xbe63f3[_0x124ac8(0xd9)]({'ide':_0x124ac8(0xdf),'status':_0x124ac8(0xfa),'message':_0x2901bb instanceof Error?_0x2901bb['message']:String(_0x2901bb)}),console['log'](_0x124ac8(0x105)+(_0x2901bb instanceof Error?_0x2901bb[_0x124ac8(0xcb)]:String(_0x2901bb)));}}_0x208f74(_0x4a67a2),_0xfaf3a7(_0xbe63f3[_0x124ac8(0x107)]>0x0?_0xbe63f3:null),console[_0x124ac8(0xec)](_0x3df92d(_0x124ac8(0xcf))),logger['success'](_0x124ac8(0x116),_0x124ac8(0xe9)+_0x2bce52[_0x124ac8(0x10c)]),_0x27c6fc(!![]),_0x2772a2(![]);}catch(_0x2f25f9){logger[_0x124ac8(0xfa)](_0x124ac8(0x116),'项目创建失败:\x20'+_0x2bce52[_0x124ac8(0x10c)],{'error':_0x2f25f9 instanceof Error?_0x2f25f9['message']:String(_0x2f25f9)});try{a42_0x45f5e0['existsSync'](_0x29b635)&&(console['log'](_0x3df92d('create.cleanup.inProgress',{'dir':_0x29b635})),a42_0x45f5e0[_0x124ac8(0x103)](_0x29b635,{'recursive':!![],'force':!![]}));}catch(_0x1bacb8){logger[_0x124ac8(0xba)]('create','清理项目目录失败:\x20'+_0x29b635);}_0x2772a2(![]),console[_0x124ac8(0xfa)](_0x3df92d(_0x124ac8(0xca),{'error':_0x2f25f9 instanceof Error?_0x2f25f9[_0x124ac8(0xcb)]:String(_0x2f25f9)}));}},_0xa7e235=async _0x11d52c=>{const _0x57ab72=a42_0x33fc;await _0x4a7a53({'projectName':_0x11d52c,'env':_0x103ba8[_0x57ab72(0x115)]});},_0x4a3c4e=async _0x4e7c2b=>{const _0x34becc=a42_0x33fc,_0x1a90d5=a42_0x5e07d6[_0x34becc(0xfd)](process[_0x34becc(0x117)](),_0x4e7c2b),_0x3479ac=a42_0x5e07d6['join'](_0x1a90d5,_0x34becc(0xe8));try{console[_0x34becc(0xec)](_0x3df92d(_0x34becc(0x11a)));const _0x3e44cd=fileURLToPath(import.meta.url),_0x4a6a4b=a42_0x5e07d6[_0x34becc(0xfd)](a42_0x5e07d6[_0x34becc(0xd7)](_0x3e44cd),'../..'),_0x3daad5=a42_0x5e07d6[_0x34becc(0x113)](_0x4a6a4b,_0x34becc(0xe8));let _0x384ebd='1.0.0';try{const _0x2dd138=JSON[_0x34becc(0x10e)](a42_0x45f5e0[_0x34becc(0xf9)](_0x3daad5,_0x34becc(0xfc)));_0x384ebd=_0x2dd138[_0x34becc(0xf0)]||_0x34becc(0xef);}catch(_0x3285c4){}const _0x470295=a42_0x45f5e0[_0x34becc(0xf9)](_0x3479ac,_0x34becc(0xfc)),_0x4246d3=JSON['parse'](_0x470295);_0x4246d3[_0x34becc(0xeb)]=_0x4e7c2b,_0x4246d3[_0x34becc(0xc8)]=_0x4e7c2b+_0x34becc(0xc3)+_0x384ebd,a42_0x45f5e0['writeFileSync'](_0x3479ac,JSON[_0x34becc(0xf2)](_0x4246d3,null,0x2)+'\x0a',_0x34becc(0xfc)),console[_0x34becc(0xec)](_0x3df92d(_0x34becc(0xed),{'name':_0x4e7c2b})),logger[_0x34becc(0x114)]('create',_0x34becc(0x10f));}catch(_0xed6df9){logger[_0x34becc(0xfa)](_0x34becc(0x116),'更新\x20package.json\x20失败');throw _0xed6df9;}},_0x297a28=async(_0x2f789e,_0x1e7e26,_0x414285)=>{const _0x10ae3=a42_0x33fc,_0x189cfa=a42_0x5e07d6[_0x10ae3(0xfd)](process[_0x10ae3(0x117)](),_0x2f789e),_0x3eb76f=a42_0x5e07d6[_0x10ae3(0x113)](_0x189cfa,_0x10ae3(0xc2));try{_0x1e7e26?console['log'](_0x3df92d('create.config.configuringAppCode',{'name':_0x2f789e,'appCode':_0x1e7e26})):console['log'](_0x3df92d(_0x10ae3(0xda),{'name':_0x2f789e}));const _0x2b72f1=fileURLToPath(import.meta.url),_0x24cc27=a42_0x5e07d6[_0x10ae3(0xfd)](a42_0x5e07d6[_0x10ae3(0xd7)](_0x2b72f1),'../..'),_0x1fed42=a42_0x5e07d6['join'](_0x24cc27,'package.json');let _0x1c202c=_0x10ae3(0xef);try{const _0xa99d58=JSON[_0x10ae3(0x10e)](a42_0x45f5e0[_0x10ae3(0xf9)](_0x1fed42,'utf8'));_0x1c202c=_0xa99d58[_0x10ae3(0xf0)]||_0x10ae3(0xef);}catch(_0x2c7348){}const _0x195df5=readConfig(),_0x3b3519=typeof _0x195df5['env']===_0x10ae3(0xe0)?_0x195df5[_0x10ae3(0x115)]:undefined,{app:_0x15c7b4,appcode:_0x49816e,..._0x3c0731}=_0x195df5,_0x3795e3={..._0x3c0731,'appcode':_0x1e7e26||'','env':_0x414285||_0x3b3519||'production','createdAt':new Date()[_0x10ae3(0xf7)](),'version':_0x1c202c};a42_0x45f5e0[_0x10ae3(0xd3)](_0x3eb76f,JSON[_0x10ae3(0xf2)](_0x3795e3,null,0x2),'utf8'),_0x1e7e26?console[_0x10ae3(0xec)](_0x3df92d(_0x10ae3(0xbc),{'appCode':_0x1e7e26})):console['log'](_0x3df92d(_0x10ae3(0xff))),logger['info'](_0x10ae3(0x116),_0x10ae3(0xc4)+_0x1e7e26);}catch(_0x22aeac){logger[_0x10ae3(0xfa)]('create','配置应用AppCode失败');}};useEffect(()=>{const _0x29e815=a42_0x33fc;_0x103ba8[_0x29e815(0xea)]&&_0xa7e235(_0x103ba8[_0x29e815(0xea)]);},[_0x103ba8['projectCode']]);if(!_0x15d2eb&&!_0x14d0f3&&!_0x103ba8['projectCode'])return a42_0x53b6cb(EnhancedGuidedCreate,{'onCreate':_0x4a7a53,'env':_0x103ba8[_0x4712a3(0x115)]});if(_0x15d2eb)return a42_0x2b2174(a42_0x183490,{'children':[a42_0x2b2174(Box,{'marginTop':0x1,'children':[a42_0x53b6cb(Box,{'width':'1'}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x118),'children':_0x4712a3(0x110)}),a42_0x53b6cb(Text,{'children':_0x3df92d(_0x4712a3(0xc9))}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x118),'children':_0x4d970?.[_0x4712a3(0x10c)]}),_0x4d970?.[_0x4712a3(0x106)]&&a42_0x2b2174(a42_0x183490,{'children':[a42_0x53b6cb(Text,{'children':_0x3df92d(_0x4712a3(0xfe))}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x11b),'children':_0x4d970[_0x4712a3(0x106)]})]})]}),a42_0x53b6cb(TaskRunning,{..._0x474472}),a42_0x53b6cb(TaskRunning,{..._0x5d4500}),a42_0x53b6cb(TaskRunning,{..._0x5b5818})]});if(_0x14d0f3){const _0x18a822=_0x532804&&_0x532804[_0x4712a3(0x107)]>0x0,_0x33cefe=_0x18a822||_0xb73303;let _0x4073d2=0x1;const _0x380c11=_0x33cefe?_0x4073d2++:_0x4073d2+0x2,_0x46243d=_0x33cefe?_0x4073d2:_0x4073d2+0x3;return a42_0x2b2174(a42_0x183490,{'children':[a42_0x2b2174(Box,{'marginTop':0x1,'children':[a42_0x53b6cb(Box,{'width':'1'}),a42_0x53b6cb(Text,{'color':'green','children':_0x4712a3(0x110)}),a42_0x53b6cb(Text,{'children':_0x3df92d('create.display.projectName')}),a42_0x53b6cb(Text,{'color':'green','children':_0x4d970?.[_0x4712a3(0x10c)]}),_0x4d970?.[_0x4712a3(0x106)]&&a42_0x2b2174(a42_0x183490,{'children':[a42_0x53b6cb(Text,{'children':_0x3df92d('create.display.appCode')}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x11b),'children':_0x4d970[_0x4712a3(0x106)]})]})]}),a42_0x53b6cb(TaskFinished,{..._0x474472}),a42_0x53b6cb(TaskFinished,{..._0x5d4500}),a42_0x53b6cb(TaskFinished,{..._0x5b5818}),_0x18a822&&a42_0x2b2174(a42_0x183490,{'children':[a42_0x53b6cb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x53b6cb(Text,{'color':_0x4712a3(0x118),'children':'─'[_0x4712a3(0xd0)](0x3c)})}),a42_0x53b6cb(Box,{'marginTop':0x1,'children':a42_0x53b6cb(Text,{'color':_0x4712a3(0x118),'bold':!![],'children':_0x3df92d(_0x4712a3(0x111))})}),_0x532804[_0x4712a3(0xce)]((_0x5e5721,_0x244d8e)=>a42_0x53b6cb(Box,{'marginLeft':0x2,'children':a42_0x2b2174(Text,{'color':_0x5e5721[_0x4712a3(0xd2)]===_0x4712a3(0xd1)?'white':_0x5e5721['status']==='manual'?'yellow':'red','children':[_0x5e5721[_0x4712a3(0x104)],':\x20',_0x5e5721[_0x4712a3(0xcb)]]})},_0x4712a3(0xdb)+_0x244d8e))]}),a42_0x53b6cb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x53b6cb(Text,{'color':_0x4712a3(0x118),'children':'─'[_0x4712a3(0xd0)](0x3c)})}),a42_0x53b6cb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x53b6cb(Text,{'color':'cyan','bold':!![],'children':_0x3df92d(_0x4712a3(0xe6))})}),a42_0x2b2174(Box,{'marginLeft':0x2,'flexDirection':_0x4712a3(0xf1),'children':[!_0x33cefe&&a42_0x2b2174(a42_0x183490,{'children':[a42_0x2b2174(Box,{'children':[a42_0x53b6cb(Text,{'color':'green','children':'1.\x20'}),a42_0x53b6cb(Text,{'color':_0x4712a3(0xe4),'children':_0x3df92d(_0x4712a3(0xc7))}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x11b),'bold':!![],'children':NPX_SKILLS_ADD_COMMAND_LINE})]}),_0x4d970?.[_0x4712a3(0x106)]&&a42_0x2b2174(Box,{'marginTop':0x1,'children':[a42_0x53b6cb(Text,{'color':_0x4712a3(0x10a),'children':_0x4712a3(0xd8)}),a42_0x53b6cb(Text,{'color':_0x4712a3(0xe4),'children':_0x3df92d(_0x4712a3(0xf8))}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x11b),'bold':!![],'children':_0x4712a3(0xbe)})]})]}),a42_0x2b2174(Box,{'marginTop':_0x33cefe?0x0:0x1,'children':[a42_0x2b2174(Text,{'color':_0x33cefe?_0x4712a3(0x118):'yellow','children':[_0x33cefe?'1':_0x4d970?.[_0x4712a3(0x106)]?'3':'2','.','\x20']}),a42_0x53b6cb(Text,{'color':_0x4712a3(0xe4),'children':_0x3df92d(_0x4712a3(0x10d))}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x11b),'bold':!![],'children':_0x4712a3(0xe3)+_0x4d970?.['projectName']+_0x4712a3(0xee)})]}),_0x4d970?.[_0x4712a3(0x106)]&&!_0x4d970?.[_0x4712a3(0xc1)]&&a42_0x2b2174(Box,{'children':[a42_0x2b2174(Text,{'color':_0x33cefe?_0x4712a3(0x118):_0x4712a3(0x10a),'children':[_0x33cefe?'2':'4','.','\x20']}),a42_0x53b6cb(Text,{'color':_0x4712a3(0xe4),'children':_0x3df92d(_0x4712a3(0xb7))}),a42_0x53b6cb(Text,{'color':_0x4712a3(0x11b),'bold':!![],'children':_0x4712a3(0xde)})]})]}),a42_0x53b6cb(Box,{'marginTop':0x1,'children':a42_0x53b6cb(Text,{'color':'green','children':'─'[_0x4712a3(0xd0)](0x3c)})})]});}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x40200b=a43_0xa75a;(function(_0x1eb093,_0xd26000){const _0x30fd47=a43_0xa75a,_0x1327c8=_0x1eb093();while(!![]){try{const _0x19e5ed=-parseInt(_0x30fd47(0x1e6))/0x1+parseInt(_0x30fd47(0x1eb))/0x2*(parseInt(_0x30fd47(0x1e4))/0x3)+parseInt(_0x30fd47(0x1e5))/0x4*(parseInt(_0x30fd47(0x1e3))/0x5)+parseInt(_0x30fd47(0x1ed))/0x6+parseInt(_0x30fd47(0x1dc))/0x7+-parseInt(_0x30fd47(0x1d9))/0x8*(-parseInt(_0x30fd47(0x1f5))/0x9)+-parseInt(_0x30fd47(0x1cf))/0xa;if(_0x19e5ed===_0xd26000)break;else _0x1327c8['push'](_0x1327c8['shift']());}catch(_0x131847){_0x1327c8['push'](_0x1327c8['shift']());}}}(a43_0x1ff4,0x62538));import a43_0x2e3df5 from'path';import{fileURLToPath}from'url';import a43_0x3b0a95 from'fs/promises';function a43_0xa75a(_0x2b1ccf,_0x94135a){_0x2b1ccf=_0x2b1ccf-0x1ca;const _0x1ff49d=a43_0x1ff4();let _0xa75ae=_0x1ff49d[_0x2b1ccf];return _0xa75ae;}import{existsSync}from'fs';import{copyDirectory}from'../utils/copy-directory.js';function a43_0x1ff4(){const _0x493c21=['create.validation.invalidChars','\x20\x20lovrabet\x20start\x0a','lovrabet.config.json','bun','message','name','1677550NCNXPj','12QOycch','4YzWZLn','426034ijVMTi','resolve','error','writeFile','test','369226TeQycS','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','1057008OBWTHp','exit','dirname','length','description','create.errors.createFailed','trim','bun\x20run\x20format','63JmHili','readFile','../../templates/projects/sub-app-react-demo','create.nonInteractive.creating','join','依赖安装失败:\x20','bind','env','17959220bhgoyC','create.validation.dirExists','utf-8','log','create.nonInteractive.templateCreated','create.validation.required','cwd','create.nonInteractive.packageJsonUpdated','npm','parse','694248zbAhzT','bun\x20--version','access','5369721ophmKy'];a43_0x1ff4=function(){return _0x493c21;};return a43_0x1ff4();}import{exec}from'child_process';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import a43_0x399a86 from'../i18n/index.js';const t=a43_0x399a86['t'][a43_0x40200b(0x1cd)](a43_0x399a86),execAsync=promisify(exec);function getTemplateDir(){const _0x2814e0=a43_0x40200b,_0xf42a4c=fileURLToPath(import.meta.url),_0x3d6be0=a43_0x2e3df5[_0x2814e0(0x1ef)](_0xf42a4c);return a43_0x2e3df5['resolve'](_0x3d6be0,_0x2814e0(0x1f7));}export async function createProjectNonInteractive(_0x28b826,_0x18a739){const _0x562c4f=a43_0x40200b,_0x1bb063=await checkCliVersion();_0x1bb063['needsUpgrade']&&printCliUpgradeWarning(_0x1bb063);(!_0x28b826||_0x28b826[_0x562c4f(0x1f3)]()==='')&&(console[_0x562c4f(0x1e8)](t(_0x562c4f(0x1d4))),process[_0x562c4f(0x1ee)](0x1));const _0x5dd84d=/[<>:"|?*\x00-\x1f\x7f]/;_0x5dd84d[_0x562c4f(0x1ea)](_0x28b826)&&(console[_0x562c4f(0x1e8)](t(_0x562c4f(0x1dd))),process[_0x562c4f(0x1ee)](0x1));_0x28b826[_0x562c4f(0x1f0)]>0x64&&(console[_0x562c4f(0x1e8)](t('create.validation.tooLong')),process[_0x562c4f(0x1ee)](0x1));const _0x16a293=a43_0x2e3df5[_0x562c4f(0x1e7)](process['cwd'](),_0x28b826);existsSync(_0x16a293)&&(console[_0x562c4f(0x1e8)](t(_0x562c4f(0x1d0),{'name':_0x28b826})),process[_0x562c4f(0x1ee)](0x1));try{const _0x483e78=a43_0x2e3df5[_0x562c4f(0x1ef)](_0x16a293);await a43_0x3b0a95[_0x562c4f(0x1db)](_0x483e78,a43_0x3b0a95['constants']['W_OK']);}catch(_0x500295){console[_0x562c4f(0x1e8)](t('create.validation.noPermission')),process['exit'](0x1);}try{console[_0x562c4f(0x1d2)](t(_0x562c4f(0x1ca),{'name':_0x28b826}));const _0x16a9b6=getTemplateDir();await copyDirectory(_0x16a9b6,_0x16a293),console[_0x562c4f(0x1d2)](t(_0x562c4f(0x1d3))),await updatePackageJsonName(_0x28b826),console[_0x562c4f(0x1d2)](t(_0x562c4f(0x1d6))),console[_0x562c4f(0x1d2)](t('create.nonInteractive.installingDeps')),console['log'](t('create.nonInteractive.depsSkipped')),await formatCode(_0x16a293),console[_0x562c4f(0x1d2)](t('create.nonInteractive.codeFormatted')),await configureAppEnv(_0x28b826,_0x18a739),console[_0x562c4f(0x1d2)](t('create.nonInteractive.envConfigured')),console['log'](t('create.nonInteractive.success',{'name':_0x28b826})),console[_0x562c4f(0x1d2)]('\x0a\x20\x20cd\x20'+_0x28b826),console[_0x562c4f(0x1d2)](_0x562c4f(0x1de));}catch(_0x568bec){const _0x273c6f=_0x568bec instanceof Error?_0x568bec[_0x562c4f(0x1e1)]:String(_0x568bec);try{existsSync(_0x16a293)&&await a43_0x3b0a95['rm'](_0x16a293,{'recursive':!![],'force':!![]});}catch{}console['error'](t(_0x562c4f(0x1f2),{'error':_0x273c6f})),process[_0x562c4f(0x1ee)](0x1);}}async function updatePackageJsonName(_0x3688f4){const _0x36e7be=a43_0x40200b,_0x74cda2=a43_0x2e3df5[_0x36e7be(0x1e7)](process[_0x36e7be(0x1d5)](),_0x3688f4),_0x5bf752=a43_0x2e3df5[_0x36e7be(0x1cb)](_0x74cda2,'package.json'),_0x1c25ef=await a43_0x3b0a95[_0x36e7be(0x1f6)](_0x5bf752,_0x36e7be(0x1d1)),_0x631114=JSON['parse'](_0x1c25ef);_0x631114[_0x36e7be(0x1e2)]=_0x3688f4,_0x631114[_0x36e7be(0x1f1)]=_0x36e7be(0x1ec),await a43_0x3b0a95[_0x36e7be(0x1e9)](_0x5bf752,JSON['stringify'](_0x631114,null,0x2)+'\x0a');}async function installDependencies(_0x697475){const _0x576768=a43_0x40200b,_0xcc5ce0=detectPackageManager(),_0x16f889=_0xcc5ce0+'\x20install';try{await execAsync(_0x16f889,{'cwd':_0x697475});}catch(_0x37b1ea){throw new Error(_0x576768(0x1cc)+_0x37b1ea);}}function detectPackageManager(){const _0x7be54f=a43_0x40200b;try{return execAsync(_0x7be54f(0x1da),{}),_0x7be54f(0x1e0);}catch{return _0x7be54f(0x1d7);}}async function formatCode(_0x197d4b){const _0x2e35f4=a43_0x40200b;try{await execAsync(_0x2e35f4(0x1f4),{'cwd':_0x197d4b});}catch{}}async function configureAppEnv(_0x269bd7,_0x6a1cfb){const _0x2c2d3d=a43_0x40200b,_0x56c121=a43_0x2e3df5['resolve'](process['cwd'](),_0x269bd7),_0x5f2c18=a43_0x2e3df5[_0x2c2d3d(0x1cb)](_0x56c121,_0x2c2d3d(0x1df));let _0x587a29={};if(existsSync(_0x5f2c18)){const _0x40e5dd=await a43_0x3b0a95[_0x2c2d3d(0x1f6)](_0x5f2c18,_0x2c2d3d(0x1d1));_0x587a29=JSON[_0x2c2d3d(0x1d8)](_0x40e5dd);}_0x6a1cfb&&(_0x587a29[_0x2c2d3d(0x1ce)]=_0x6a1cfb),await a43_0x3b0a95[_0x2c2d3d(0x1e9)](_0x5f2c18,JSON['stringify'](_0x587a29,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a44_0x5d04(){var _0x2d5f87=['11254304EZerzw','6gcgEYc','4138188FIUqWJ','4hwEZxq','59391xWZUsS','\x20√\x20','9628572vNOTRA','7Pjtisz','1890ThwufE','taskName','4577760hgamIH','green','3938RkheTn','278969ItQPgG','69480dotiDk'];a44_0x5d04=function(){return _0x2d5f87;};return a44_0x5d04();}(function(_0x55f20e,_0x53893c){var _0x1b3b4a=a44_0x2d49,_0x16ddce=_0x55f20e();while(!![]){try{var _0x3a1038=-parseInt(_0x1b3b4a(0x177))/0x1*(parseInt(_0x1b3b4a(0x17a))/0x2)+parseInt(_0x1b3b4a(0x16c))/0x3*(parseInt(_0x1b3b4a(0x16d))/0x4)+parseInt(_0x1b3b4a(0x174))/0x5+parseInt(_0x1b3b4a(0x170))/0x6*(parseInt(_0x1b3b4a(0x171))/0x7)+-parseInt(_0x1b3b4a(0x179))/0x8+-parseInt(_0x1b3b4a(0x16e))/0x9*(-parseInt(_0x1b3b4a(0x172))/0xa)+parseInt(_0x1b3b4a(0x176))/0xb*(-parseInt(_0x1b3b4a(0x178))/0xc);if(_0x3a1038===_0x53893c)break;else _0x16ddce['push'](_0x16ddce['shift']());}catch(_0x459d4f){_0x16ddce['push'](_0x16ddce['shift']());}}}(a44_0x5d04,0xcabc6));import{jsx as a44_0x58104b,jsxs as a44_0x5d78cc}from'react/jsx-runtime';function a44_0x2d49(_0x228038,_0x38e74d){_0x228038=_0x228038-0x16c;var _0x5d0470=a44_0x5d04();var _0x2d494a=_0x5d0470[_0x228038];return _0x2d494a;}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x1c9556){var _0x1807eb=a44_0x2d49;return a44_0x5d78cc(Box,{'children':[a44_0x58104b(Box,{'width':'1'}),a44_0x58104b(Text,{'color':_0x1807eb(0x175),'children':_0x1807eb(0x16f)}),a44_0x58104b(Text,{'children':_0x1c9556[_0x1807eb(0x173)]}),a44_0x58104b(TaskTime,{'elapsed':_0x1c9556['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4c589b,_0x3c5685){var _0x1b464c=a45_0x16c4,_0x430d9a=_0x4c589b();while(!![]){try{var _0xa649da=-parseInt(_0x1b464c(0xda))/0x1*(parseInt(_0x1b464c(0xdb))/0x2)+parseInt(_0x1b464c(0xdd))/0x3+-parseInt(_0x1b464c(0xd6))/0x4*(-parseInt(_0x1b464c(0xd9))/0x5)+parseInt(_0x1b464c(0xd3))/0x6+parseInt(_0x1b464c(0xdc))/0x7+-parseInt(_0x1b464c(0xd8))/0x8+parseInt(_0x1b464c(0xd2))/0x9*(-parseInt(_0x1b464c(0xe0))/0xa);if(_0xa649da===_0x3c5685)break;else _0x430d9a['push'](_0x430d9a['shift']());}catch(_0x288790){_0x430d9a['push'](_0x430d9a['shift']());}}}(a45_0x4aca,0xbe724));function a45_0x16c4(_0x252378,_0x8dcf53){_0x252378=_0x252378-0xd1;var _0x4aca99=a45_0x4aca();var _0x16c424=_0x4aca99[_0x252378];return _0x16c424;}function a45_0x4aca(){var _0x5db4c7=['\x20\x20\x20','3657360oZVIBd','10HdkEgw','136911Eqdhfr','10LuLUXy','2380266DIgxTp','2555481jXsosu','green','finished','191140thZFRP','loading','639SoZFQr','5003832vTulBi','\x20√\x20','dots','2506100OhddUi'];a45_0x4aca=function(){return _0x5db4c7;};return a45_0x4aca();}import{jsx as a45_0x1a73be,jsxs as a45_0x54d553}from'react/jsx-runtime';import{Text}from'ink';import a45_0x32f1a3 from'ink-spinner';export function TaskLoading(_0x5e4f6f){var _0x4145dd=a45_0x16c4;if(_0x5e4f6f[_0x4145dd(0xdf)])return a45_0x1a73be(Text,{'color':_0x4145dd(0xde),'children':_0x4145dd(0xd4)});if(_0x5e4f6f[_0x4145dd(0xd1)])return a45_0x54d553(Text,{'color':_0x4145dd(0xde),'children':['\x20',a45_0x1a73be(a45_0x32f1a3,{'type':_0x4145dd(0xd5)}),'\x20']});return a45_0x1a73be(Text,{'children':_0x4145dd(0xd7)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1aa1c1,_0x2381c5){var _0x2f4c72=a46_0x51cb,_0x20db14=_0x1aa1c1();while(!![]){try{var _0x16b987=-parseInt(_0x2f4c72(0x81))/0x1*(parseInt(_0x2f4c72(0x80))/0x2)+-parseInt(_0x2f4c72(0x7e))/0x3+parseInt(_0x2f4c72(0x84))/0x4*(parseInt(_0x2f4c72(0x7b))/0x5)+parseInt(_0x2f4c72(0x7d))/0x6*(-parseInt(_0x2f4c72(0x83))/0x7)+parseInt(_0x2f4c72(0x7f))/0x8*(parseInt(_0x2f4c72(0x7c))/0x9)+parseInt(_0x2f4c72(0x86))/0xa+-parseInt(_0x2f4c72(0x82))/0xb;if(_0x16b987===_0x2381c5)break;else _0x20db14['push'](_0x20db14['shift']());}catch(_0x19841b){_0x20db14['push'](_0x20db14['shift']());}}}(a46_0x5f12,0x603a2));function a46_0x5f12(){var _0x3c6b9f=['583368Svzlhx','9692OcPNYo','47AfRclf','2483041LLGqFc','10143gxKgDI','652QVXofR','elapsed','4551870VSCvDI','16670piVzXw','9bRPYtN','90kNRuSN','606528HxwXib'];a46_0x5f12=function(){return _0x3c6b9f;};return a46_0x5f12();}import{jsx as a46_0x153978,jsxs as a46_0x18d0e3}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';function a46_0x51cb(_0xd71a3d,_0x4ec2e1){_0xd71a3d=_0xd71a3d-0x7b;var _0x5f12d5=a46_0x5f12();var _0x51cb1f=_0x5f12d5[_0xd71a3d];return _0x51cb1f;}import{TaskTime}from'./task-time.js';export function TaskRunning(_0xbf4757){var _0x4720a2=a46_0x51cb;return a46_0x18d0e3(Box,{'children':[a46_0x153978(Box,{'width':'1'}),a46_0x153978(TaskLoading,{..._0xbf4757}),a46_0x153978(Text,{'children':_0xbf4757['taskName']}),a46_0x153978(TaskTime,{'elapsed':_0xbf4757[_0x4720a2(0x85)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x2bf9(){var _0x1c13a6=['269848WTwWWq','1756794OhApxO','elapsed','10ePPmmC','4451265Pksrpd','24URUHpR','gray','36350061FddooN','5YckVlT','9873YwcFLP','2ZVaZDb','1401956XGSFrP','21868KEEkEh'];a47_0x2bf9=function(){return _0x1c13a6;};return a47_0x2bf9();}function a47_0x5008(_0x34d932,_0x1ac2a4){_0x34d932=_0x34d932-0x174;var _0x2bf954=a47_0x2bf9();var _0x500893=_0x2bf954[_0x34d932];return _0x500893;}(function(_0x3f24da,_0x19f46b){var _0x40c234=a47_0x5008,_0x445791=_0x3f24da();while(!![]){try{var _0x57821f=-parseInt(_0x40c234(0x180))/0x1+-parseInt(_0x40c234(0x17f))/0x2*(parseInt(_0x40c234(0x179))/0x3)+-parseInt(_0x40c234(0x175))/0x4*(-parseInt(_0x40c234(0x17d))/0x5)+parseInt(_0x40c234(0x176))/0x6+parseInt(_0x40c234(0x174))/0x7*(parseInt(_0x40c234(0x17a))/0x8)+-parseInt(_0x40c234(0x17e))/0x9+parseInt(_0x40c234(0x178))/0xa*(parseInt(_0x40c234(0x17c))/0xb);if(_0x57821f===_0x19f46b)break;else _0x445791['push'](_0x445791['shift']());}catch(_0x4c2bce){_0x445791['push'](_0x445791['shift']());}}}(a47_0x2bf9,0xc03b0));import{jsx as a47_0x3f9f72,Fragment as a47_0x4333db,jsxs as a47_0x5f31bd}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x433653){var _0x166fb5=a47_0x5008;if(_0x433653['elapsed'])return a47_0x5f31bd(a47_0x4333db,{'children':[a47_0x3f9f72(Text,{'color':_0x166fb5(0x17b),'children':'\x20['}),a47_0x3f9f72(Text,{'color':'gray','bold':!![],'children':_0x433653[_0x166fb5(0x177)]}),a47_0x3f9f72(Text,{'color':_0x166fb5(0x17b),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x1331(_0x66fc47,_0xd51f3b){_0x66fc47=_0x66fc47-0x7b;const _0x51d837=a48_0x51d8();let _0x13311a=_0x51d837[_0x66fc47];return _0x13311a;}const a48_0x172b6a=a48_0x1331;(function(_0x277902,_0x412d36){const _0x5df83e=a48_0x1331,_0xf7fb0c=_0x277902();while(!![]){try{const _0x7be900=parseInt(_0x5df83e(0x81))/0x1+parseInt(_0x5df83e(0x83))/0x2*(parseInt(_0x5df83e(0x87))/0x3)+parseInt(_0x5df83e(0x7b))/0x4+parseInt(_0x5df83e(0x8b))/0x5*(-parseInt(_0x5df83e(0x88))/0x6)+parseInt(_0x5df83e(0x84))/0x7+parseInt(_0x5df83e(0x7e))/0x8+-parseInt(_0x5df83e(0x8e))/0x9*(parseInt(_0x5df83e(0x89))/0xa);if(_0x7be900===_0x412d36)break;else _0xf7fb0c['push'](_0xf7fb0c['shift']());}catch(_0x144486){_0xf7fb0c['push'](_0xf7fb0c['shift']());}}}(a48_0x51d8,0x58d5f));import a48_0x4e4f7f from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';function a48_0x51d8(){const _0x585c93=['712070MDQbCu','resolve','18uGLfJp','4286072dfAwkX','error','success','92835fsIORJ','450TgWBgD','3301570nPHQOU','../../templates/projects/sub-app-react-demo','7005ydArNo','项目模板复制失败','message','63XqFtmC','info','项目模板复制完成','2865368ensxXo','copy','cwd','3686656LKsftb','now','create.tasks.copyFiles'];a48_0x51d8=function(){return _0x585c93;};return a48_0x51d8();}import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';const __dirname=a48_0x4e4f7f['dirname'](fileURLToPath(import.meta.url)),templateDir=a48_0x4e4f7f[a48_0x172b6a(0x82)](__dirname,a48_0x172b6a(0x8a));export function useCopyProjectTemplate(){const _0x187d3e=a48_0x172b6a,{t:_0x1f2211}=useI18n(),[_0x494164,_0xd4d4b]=useState(![]),[_0x2974e8,_0x39ebaf]=useState(![]),[_0x401dde,_0x2f55d9]=useState(''),_0x55d864=useCallback(async _0x541a29=>{const _0x24ca80=a48_0x1331,_0x3248fc=Date[_0x24ca80(0x7f)](),_0x224aae=a48_0x4e4f7f[_0x24ca80(0x82)](process[_0x24ca80(0x7d)](),_0x541a29);_0xd4d4b(!![]);try{logger[_0x24ca80(0x8f)](_0x24ca80(0x7c),'开始复制项目模板',{'projectCode':_0x541a29,'templateDir':templateDir}),await copyDirectory(templateDir,_0x224aae);const _0x71b3ed=Date[_0x24ca80(0x7f)]()-_0x3248fc;logger[_0x24ca80(0x86)](_0x24ca80(0x7c),_0x24ca80(0x90),_0x71b3ed,{'projectCode':_0x541a29});}catch(_0x4a1035){const _0x344cdf=Date[_0x24ca80(0x7f)]()-_0x3248fc;logger[_0x24ca80(0x85)](_0x24ca80(0x7c),_0x24ca80(0x8c),{'projectCode':_0x541a29,'error':_0x4a1035 instanceof Error?_0x4a1035[_0x24ca80(0x8d)]:String(_0x4a1035),'duration':_0x344cdf});throw _0x4a1035;}finally{_0xd4d4b(![]),_0x39ebaf(!![]),_0x2f55d9(formatElapsed(_0x3248fc));}},[]);return{'taskName':_0x1f2211(_0x187d3e(0x80)),'finished':_0x2974e8,'loading':_0x494164,'elapsed':_0x401dde,'doTask':_0x55d864};}
|