@lovrabet/cli 1.3.2 → 1.3.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-execa.js +1 -0
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -0
- package/lib/i18n/hooks.js +1 -0
- package/lib/i18n/index.js +1 -0
- package/lib/i18n/locales/en-US.js +1 -0
- package/lib/i18n/locales/zh-CN.js +1 -0
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +6 -1
- package/templates/README.md +10 -55
- package/lib/add-page/input-page-router.js +0 -1
- package/lib/add-page/main.js +0 -1
- package/lib/add-page/select-page-template.js +0 -1
- package/lib/utils/router-updater.js +0 -1
- package/templates/pages/blank/index.tsx.tpl +0 -13
- package/templates/pages/sdk-fetch/index.tsx.tpl +0 -80
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a32_0x271113=a32_0x15eb;(function(_0x1f9862,_0x573cc9){const _0x23f479=a32_0x15eb,_0x7f73f8=_0x1f9862();while(!![]){try{const _0x10575a=-parseInt(_0x23f479(0x15f))/0x1+parseInt(_0x23f479(0x184))/0x2+parseInt(_0x23f479(0x17b))/0x3*(parseInt(_0x23f479(0x175))/0x4)+-parseInt(_0x23f479(0x171))/0x5*(-parseInt(_0x23f479(0x15c))/0x6)+-parseInt(_0x23f479(0x18e))/0x7*(-parseInt(_0x23f479(0x153))/0x8)+-parseInt(_0x23f479(0x172))/0x9+-parseInt(_0x23f479(0x156))/0xa;if(_0x10575a===_0x573cc9)break;else _0x7f73f8['push'](_0x7f73f8['shift']());}catch(_0x4175f3){_0x7f73f8['push'](_0x7f73f8['shift']());}}}(a32_0x467e,0x6884c));import{jsx as a32_0x5dfcd7}from'react/jsx-runtime';import a32_0x52e7aa from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';import{Init}from'./init/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';function a32_0x15eb(_0xde451a,_0x567a19){_0xde451a=_0xde451a-0x140;const _0x467e95=a32_0x467e();let _0x15ebab=_0x467e95[_0xde451a];return _0x15ebab;}import{AppMenuSyncUI}from'./app-menu/app-menu-sync-ui.js';import{mcpCommand}from'./mcp/main.js';import{AppMenuUpdateCdn}from'./app-menu-update-cdn/main.js';import{skillsCommand}from'./skills/main.js';import{SkillInstallUI}from'./skills/SkillInstallUI.js';import{McpInstallUI}from'./mcp/McpInstallUI.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import(a32_0x271113(0x18b)))['dynamicCliFlags'];}catch{}const mergedFlags={...dynamicCliFlags||{}};function isNonInteractiveMode(_0xa712df){const _0x4f5a20=a32_0x271113;return!!(_0xa712df[_0x4f5a20(0x145)]||_0xa712df['ci']||process['env']['LOVRABET_CI']==='true'||process[_0x4f5a20(0x185)]['CI']===_0x4f5a20(0x181)||!process[_0x4f5a20(0x16a)][_0x4f5a20(0x16e)]);}const cli=a32_0x52e7aa(a32_0x271113(0x191),{'importMeta':import.meta,'flags':{'name':{'type':a32_0x271113(0x157)},'clear':{'type':'boolean'},'env':{'type':a32_0x271113(0x157)},'watch':{'type':a32_0x271113(0x143)},'help':{'type':a32_0x271113(0x143)},'appcode':{'type':a32_0x271113(0x157)},'output':{'type':a32_0x271113(0x157)},'params':{'type':'string'},'datasetcode':{'type':a32_0x271113(0x157)},'mcpCursor':{'type':a32_0x271113(0x143)},'mcpClaude':{'type':a32_0x271113(0x143)},'mcpOther':{'type':a32_0x271113(0x143)},'cursor':{'type':a32_0x271113(0x143)},'windsurf':{'type':a32_0x271113(0x143)},'claude':{'type':a32_0x271113(0x143)},'cline':{'type':a32_0x271113(0x143)},'codex':{'type':'boolean'},'opencode':{'type':a32_0x271113(0x143)},'qoder':{'type':'boolean'},'codebuddy':{'type':'boolean'},'trae':{'type':a32_0x271113(0x143)},'agent':{'type':a32_0x271113(0x143)},'antigravity':{'type':a32_0x271113(0x143)},'all':{'type':'boolean'},'nonInteractive':{'type':a32_0x271113(0x143)},'ci':{'type':a32_0x271113(0x143)},...mergedFlags},'autoVersion':!![]});function a32_0x467e(){const _0x14e7ef=['claude','执行预览命令','15035nhnOCZ','join','./create-app/non-interactive.js','input','mcpClaude','非交互模式创建项目:\x20','menu-update-cdn','执行配置\x20MCP\x20命令','preview','cline','qoder','stdout','\x20(监听模式)','start','./mcp/mcp-install-non-interactive.js','isTTY','info','opencode','1303465kynRSM','3189492iBOxui','执行启动命令','trim','7220gdHjzE','agent','setLogPath','trae','flags','mcpOther','1083mCdmuV','logs','cursor','setRawCommand','clear','push','true','appcode','all','37060CqMOUS','env','help','api','config','menu-sync','other','./cli-flags.js','./skills/skill-install-non-interactive.js','codex','7yiiXfc','create','menu','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20在现有项目中初始化\x20.lovrabetrc\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x20初始化配置文件\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20同步菜单\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20更新菜单\x20CDN\x20资源\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并配置\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接配置\x20Cursor\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并安装技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接安装\x20Cursor\x20技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20安装多个技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20安装所有技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--dangerously-bff-save\x20//\x20包含\x20Backend\x20Function\x20同步工作流\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','update','antigravity','slice','auth','boolean','执行添加页面命令','nonInteractive','同步菜单命令','--help','windsurf','add-page','install','lovrabet\x20','exit','build','logout','page','skill','mcp','cwd','1919032YQUnWU','add','执行更新菜单\x20CDN\x20资源命令','6338690KCzLRB','string','codebuddy','length','mcpCursor','error','12UatZlk'];a32_0x467e=function(){return _0x14e7ef;};return a32_0x467e();}await run();async function run(){const _0x40238f=a32_0x271113,_0x9288b3=cli[_0x40238f(0x162)][0x0],_0x373d39=cli[_0x40238f(0x162)][0x1],_0x138a6a=cli['input'][0x2],_0x494a84=(_0x40238f(0x14b)+process['argv'][_0x40238f(0x141)](0x2)[_0x40238f(0x160)]('\x20'))[_0x40238f(0x174)]();logger[_0x40238f(0x17e)](_0x494a84);switch(_0x9288b3){case'init':{const _0x5398c8=cli['flags'][_0x40238f(0x182)],_0x145b78=cli[_0x40238f(0x179)][_0x40238f(0x185)];logger[_0x40238f(0x177)](process[_0x40238f(0x152)]()),logger[_0x40238f(0x16f)]('init','执行初始化配置命令'),render(a32_0x5dfcd7(Init,{'appcode':_0x5398c8,'env':_0x145b78}));break;}case _0x40238f(0x18f):{const _0x3e77bd=cli[_0x40238f(0x162)][0x1]?.[_0x40238f(0x174)](),_0x24a330=cli[_0x40238f(0x179)][_0x40238f(0x185)],_0x2649c5=isNonInteractiveMode(cli[_0x40238f(0x179)]);if(_0x2649c5&&_0x3e77bd){logger['setLogPath'](process[_0x40238f(0x152)]()),logger[_0x40238f(0x16f)]('create',_0x40238f(0x164)+_0x3e77bd);const {createProjectNonInteractive:_0x1acbcd}=await import(_0x40238f(0x161));await _0x1acbcd(_0x3e77bd,_0x24a330);}else render(a32_0x5dfcd7(CreateApp,{'projectCode':_0x3e77bd,'env':_0x24a330}));break;}case _0x40238f(0x154):{cli[_0x40238f(0x162)][0x1]===_0x40238f(0x14f)&&(logger[_0x40238f(0x177)](process[_0x40238f(0x152)]()),logger[_0x40238f(0x16f)](_0x40238f(0x149),_0x40238f(0x144)),render(a32_0x5dfcd7(AddPage,{})));break;}case _0x40238f(0x16c):{try{logger[_0x40238f(0x177)](process['cwd']()),logger['info'](_0x40238f(0x16c),_0x40238f(0x173)),await runStart();}catch(_0x18be36){console[_0x40238f(0x15b)](_0x18be36),process['exit'](0x1);}break;}case _0x40238f(0x14d):{try{logger[_0x40238f(0x177)](process[_0x40238f(0x152)]()),logger['info'](_0x40238f(0x14d),'执行构建命令'),await runBuild();}catch(_0x10826a){console[_0x40238f(0x15b)](_0x10826a),process[_0x40238f(0x14c)](0x1);}break;}case _0x40238f(0x167):{const _0x2d5cb9=cli['flags']['watch'];logger[_0x40238f(0x177)](process[_0x40238f(0x152)]()),logger[_0x40238f(0x16f)](_0x40238f(0x167),_0x40238f(0x15e)+(_0x2d5cb9?_0x40238f(0x16b):''));if(_0x2d5cb9)try{await Promise[_0x40238f(0x183)]([runBuildWatch(),runPreview()]);}catch(_0x4173af){console[_0x40238f(0x15b)](_0x4173af),process[_0x40238f(0x14c)](0x1);}else try{await runPreview();}catch(_0x1ebe68){console['error'](_0x1ebe68),process[_0x40238f(0x14c)](0x1);}break;}case _0x40238f(0x188):{render(a32_0x5dfcd7(Config,{'cli':cli}));break;}case _0x40238f(0x187):{await apiCli(cli);break;}case _0x40238f(0x142):{render(a32_0x5dfcd7(AuthServer,{}));break;}case _0x40238f(0x190):{if(_0x373d39===_0x40238f(0x192)){logger[_0x40238f(0x177)](process['cwd']()),logger[_0x40238f(0x16f)](_0x40238f(0x165),_0x40238f(0x155)),render(a32_0x5dfcd7(AppMenuUpdateCdn,{}));break;}else logger[_0x40238f(0x177)](process['cwd']()),logger[_0x40238f(0x16f)](_0x40238f(0x189),_0x40238f(0x146)),render(a32_0x5dfcd7(AppMenuSyncUI,{}));break;}case _0x40238f(0x14e):{logout();break;}case _0x40238f(0x151):{const _0x2a8de8=cli[_0x40238f(0x162)][0x1];logger[_0x40238f(0x177)](process[_0x40238f(0x152)]());if(_0x2a8de8===_0x40238f(0x14a)){const _0x27caa6=[];if(cli[_0x40238f(0x179)][_0x40238f(0x15a)]||cli[_0x40238f(0x179)][_0x40238f(0x17d)])_0x27caa6[_0x40238f(0x180)](_0x40238f(0x17d));if(cli[_0x40238f(0x179)][_0x40238f(0x163)]||cli['flags']['claude'])_0x27caa6[_0x40238f(0x180)]('claude');if(cli[_0x40238f(0x179)][_0x40238f(0x17a)])_0x27caa6[_0x40238f(0x180)](_0x40238f(0x18a));logger[_0x40238f(0x16f)]('mcp-install',_0x40238f(0x166),{'preselected':_0x27caa6});if(isNonInteractiveMode(cli['flags'])&&_0x27caa6[_0x40238f(0x159)]>0x0){const {installMcpNonInteractive:_0x1b9b71}=await import(_0x40238f(0x16d));await _0x1b9b71(_0x27caa6);}else render(a32_0x5dfcd7(McpInstallUI,{'preselectedIDEs':_0x27caa6}));}else _0x2a8de8===_0x40238f(0x147)||cli[_0x40238f(0x179)][_0x40238f(0x186)]?await mcpCommand(_0x2a8de8,[],{'help':!![]}):await mcpCommand(_0x2a8de8,[],cli[_0x40238f(0x179)]);break;}case _0x40238f(0x150):{const _0x4e041d=cli['input'][0x1];logger[_0x40238f(0x177)](process[_0x40238f(0x152)]());if(_0x4e041d==='install'){const _0x2f9767=[];if(cli[_0x40238f(0x179)]['all'])_0x2f9767['push'](_0x40238f(0x17d),_0x40238f(0x148),_0x40238f(0x15d),_0x40238f(0x168),'codex',_0x40238f(0x170),_0x40238f(0x169),_0x40238f(0x158),_0x40238f(0x178),_0x40238f(0x176),_0x40238f(0x140));else{if(cli['flags'][_0x40238f(0x17d)])_0x2f9767['push']('cursor');if(cli[_0x40238f(0x179)][_0x40238f(0x148)])_0x2f9767[_0x40238f(0x180)]('windsurf');if(cli['flags'][_0x40238f(0x15d)])_0x2f9767['push'](_0x40238f(0x15d));if(cli[_0x40238f(0x179)]['cline'])_0x2f9767[_0x40238f(0x180)](_0x40238f(0x168));if(cli[_0x40238f(0x179)][_0x40238f(0x18d)])_0x2f9767['push'](_0x40238f(0x18d));if(cli['flags'][_0x40238f(0x170)])_0x2f9767[_0x40238f(0x180)](_0x40238f(0x170));if(cli['flags']['qoder'])_0x2f9767['push'](_0x40238f(0x169));if(cli['flags'][_0x40238f(0x158)])_0x2f9767[_0x40238f(0x180)](_0x40238f(0x158));if(cli[_0x40238f(0x179)][_0x40238f(0x178)])_0x2f9767['push'](_0x40238f(0x178));if(cli[_0x40238f(0x179)]['agent'])_0x2f9767[_0x40238f(0x180)](_0x40238f(0x176));if(cli[_0x40238f(0x179)][_0x40238f(0x140)])_0x2f9767[_0x40238f(0x180)](_0x40238f(0x140));}const {getAllProvidedFlags:_0x1a2b2d}=await import('./skills/main.js'),_0x3ef788=_0x1a2b2d(cli['flags']);logger[_0x40238f(0x16f)]('skill-install','执行安装技能包命令',{'preselected':_0x2f9767,'providedFlags':_0x3ef788});if(isNonInteractiveMode(cli[_0x40238f(0x179)])&&_0x2f9767[_0x40238f(0x159)]>0x0){const {installSkillsNonInteractive:_0x17d09a}=await import(_0x40238f(0x18c));await _0x17d09a(_0x2f9767,_0x3ef788);}else render(a32_0x5dfcd7(SkillInstallUI,{'preselectedIDEs':_0x2f9767,'providedFlags':_0x3ef788}));}else _0x4e041d===_0x40238f(0x147)||cli[_0x40238f(0x179)][_0x40238f(0x186)]?await skillsCommand(_0x4e041d,[],{'help':!![]}):await skillsCommand(_0x4e041d,[],cli[_0x40238f(0x179)]);break;}case _0x40238f(0x17c):{cli[_0x40238f(0x179)][_0x40238f(0x17f)]?clearLogs():showLogs();break;}default:render(a32_0x5dfcd7(Help,{}));break;}}
|
|
2
|
+
const a29_0x7977e1=a29_0x4803;(function(_0x462423,_0x47cfa7){const _0xecf652=a29_0x4803,_0x5b515d=_0x462423();while(!![]){try{const _0x589e62=parseInt(_0xecf652(0xc9))/0x1+parseInt(_0xecf652(0xd7))/0x2+parseInt(_0xecf652(0xe4))/0x3*(parseInt(_0xecf652(0xed))/0x4)+-parseInt(_0xecf652(0xca))/0x5+parseInt(_0xecf652(0xc3))/0x6+parseInt(_0xecf652(0xc2))/0x7*(parseInt(_0xecf652(0xab))/0x8)+parseInt(_0xecf652(0xb7))/0x9*(-parseInt(_0xecf652(0xc8))/0xa);if(_0x589e62===_0x47cfa7)break;else _0x5b515d['push'](_0x5b515d['shift']());}catch(_0x1dd1aa){_0x5b515d['push'](_0x5b515d['shift']());}}}(a29_0x276c,0xcc9f1));import{jsx as a29_0x25be93}from'react/jsx-runtime';import a29_0x7461ac from'meow';import{render}from'ink';function a29_0x4803(_0x5369c6,_0x2a4910){_0x5369c6=_0x5369c6-0xa8;const _0x276cdb=a29_0x276c();let _0x48036d=_0x276cdb[_0x5369c6];return _0x48036d;}import{CreateApp}from'./create-app/main.js';function a29_0x276c(){const _0x254951=['other','\x20(监听模式)','api','skill-install','logout','antigravity','826HZNwgl','3757500NEIRGT','appcode','./create-app/non-interactive.js','mcp-install','init','10SYEgsx','1278237jPpXaO','7317325CtcodQ','setLogPath','stdin','qoder','help','cline','env','同步菜单命令','error','watch','opencode','mcp','windsurf','2045616FrwsXo','lovrabet\x20','isTTY','cursor','input','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Authentication\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Logout\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Initialize\x20.lovrabetrc\x20config\x20in\x20existing\x20project\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Initialize\x20with\x20specified\x20appcode\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Create\x20a\x20new\x20project\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Start\x20project\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Build\x20project\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Sync\x20menu\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Update\x20menu\x20CDN\x20resources\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Preview\x20project\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Watch\x20mode\x20for\x20preview\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Project\x20configuration\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20and\x20generate\x20API\x20config\x20(see:\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20API\x20documentation\x20(see:\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Interactive\x20MCP\x20configuration\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Configure\x20Cursor\x20MCP\x20directly\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Interactive\x20skill\x20installation\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Install\x20Cursor\x20skill\x20directly\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20Install\x20multiple\x20skills\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Install\x20all\x20skills\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20View\x20logs\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Clear\x20logs\x0a','setRawMode','×\x20Interactive\x20mode\x20is\x20not\x20supported.\x20Please\x20specify\x20a\x20project\x20name:\x0a\x20\x20lovrabet\x20create\x20<project-name>\x0a\x20\x20lovrabet\x20create\x20<project-name>\x20--ci','trae','--help','push','exit','cwd','3RQavWQ','flags','trim','install','×\x20Interactive\x20mode\x20is\x20not\x20supported\x20in\x20this\x20terminal\x20(stdin\x20raw\x20mode\x20unavailable).\x0a\x20\x20Please\x20use\x20a\x20terminal\x20that\x20supports\x20interactive\x20input\x20(e.g.\x20Windows\x20Terminal,\x20PowerShell),\x0a\x20\x20or\x20use\x20non-interactive\x20mode:\x20lovrabet\x20<command>\x20--ci','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20在现有项目中初始化\x20.lovrabetrc\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x20初始化配置文件\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20同步菜单\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20更新菜单\x20CDN\x20资源\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并配置\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接配置\x20Cursor\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20交互式选择并安装技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20直接安装\x20Cursor\x20技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--cursor\x20--claude\x20//\x20安装多个技能包\x0a\x09\x20\x20$\x20lovrabet\x20skill\x20install\x20--all\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20安装所有技能包\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','boolean','LOVRABET_CI','执行初始化配置命令','6584128ricBYi','isRaw','create','clear','all','mcpCursor','setRawCommand','preview','build','×\x20当前终端不支持交互模式,请指定项目名创建:\x0a\x20\x20lovrabet\x20create\x20<项目名>\x0a\x20\x20lovrabet\x20create\x20<项目名>\x20--ci','auth','info','true','menu-update-cdn','./mcp/mcp-install-non-interactive.js','50632epYBDo','startsWith','×\x20当前终端不支持交互模式(stdin\x20raw\x20mode\x20不可用)。\x0a\x20\x20请使用支持交互的终端(如\x20Windows\x20Terminal、PowerShell),\x0a\x20\x20或使用非交互模式:lovrabet\x20<command>\x20--ci','./skills/main.js','slice','执行预览命令','nonInteractive','codebuddy','执行更新菜单\x20CDN\x20资源命令','mcpClaude','menu','string','27166995LEcFVe','codex','claude','join','执行安装技能包命令'];a29_0x276c=function(){return _0x254951;};return a29_0x276c();}import{Init}from'./init/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';import{AppMenuSyncUI}from'./app-menu/app-menu-sync-ui.js';import{mcpCommand}from'./mcp/main.js';import{AppMenuUpdateCdn}from'./app-menu-update-cdn/main.js';import{skillsCommand}from'./skills/main.js';import{SkillInstallUI}from'./skills/SkillInstallUI.js';import{McpInstallUI}from'./mcp/McpInstallUI.js';import{I18nProvider}from'./i18n/I18nProvider.js';import{detectSystemLanguage,getLanguageFromFlags}from'./i18n/index.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import('./cli-flags.js'))['dynamicCliFlags'];}catch{}const mergedFlags={...dynamicCliFlags||{}},helpTexts={'zh-CN':a29_0x7977e1(0xe9),'en-US':a29_0x7977e1(0xdc)},systemLanguage=detectSystemLanguage();function isStdinRawModeSupported(){const _0x2b42d0=a29_0x7977e1;if(!process[_0x2b42d0(0xcc)][_0x2b42d0(0xd9)])return![];try{const _0x1af864=process[_0x2b42d0(0xcc)][_0x2b42d0(0xee)];return process[_0x2b42d0(0xcc)]['setRawMode'](!![]),process[_0x2b42d0(0xcc)][_0x2b42d0(0xdd)](_0x1af864??![]),!![];}catch{return![];}}function isNonInteractiveMode(_0x18ab63){const _0x12dcf3=a29_0x7977e1;return!!(_0x18ab63[_0x12dcf3(0xb1)]||_0x18ab63['ci']||process['env'][_0x12dcf3(0xeb)]===_0x12dcf3(0xa8)||process[_0x12dcf3(0xd0)]['CI']===_0x12dcf3(0xa8)||!process['stdout'][_0x12dcf3(0xd9)]||!isStdinRawModeSupported());}function getLanguage(_0x6a9603){const _0x2c586e=getLanguageFromFlags(_0x6a9603);return _0x2c586e||undefined;}function renderWithI18n(_0x4d588c,_0x434d61){const _0xc6e73c=a29_0x7977e1;return!isStdinRawModeSupported()&&(console['error'](_0x434d61?.[_0xc6e73c(0xac)]('zh')?_0xc6e73c(0xad):_0xc6e73c(0xe8)),process[_0xc6e73c(0xe2)](0x1)),render(a29_0x25be93(I18nProvider,{'language':_0x434d61,'children':_0x4d588c}));}const cli=a29_0x7461ac(helpTexts[systemLanguage],{'importMeta':import.meta,'flags':{'name':{'type':'string'},'clear':{'type':a29_0x7977e1(0xea)},'env':{'type':'string'},'watch':{'type':a29_0x7977e1(0xea)},'help':{'type':a29_0x7977e1(0xea)},'appcode':{'type':'string'},'output':{'type':a29_0x7977e1(0xb6)},'params':{'type':a29_0x7977e1(0xb6)},'datasetcode':{'type':a29_0x7977e1(0xb6)},'mcpCursor':{'type':a29_0x7977e1(0xea)},'mcpClaude':{'type':a29_0x7977e1(0xea)},'mcpOther':{'type':a29_0x7977e1(0xea)},'cursor':{'type':'boolean'},'windsurf':{'type':a29_0x7977e1(0xea)},'claude':{'type':a29_0x7977e1(0xea)},'cline':{'type':a29_0x7977e1(0xea)},'codex':{'type':'boolean'},'opencode':{'type':a29_0x7977e1(0xea)},'qoder':{'type':a29_0x7977e1(0xea)},'codebuddy':{'type':a29_0x7977e1(0xea)},'trae':{'type':a29_0x7977e1(0xea)},'agent':{'type':a29_0x7977e1(0xea)},'antigravity':{'type':a29_0x7977e1(0xea)},'all':{'type':'boolean'},'nonInteractive':{'type':'boolean'},'ci':{'type':a29_0x7977e1(0xea)},'lang':{'type':a29_0x7977e1(0xb6)},...mergedFlags},'autoVersion':!![]});await run();async function run(){const _0x3e0a3c=a29_0x7977e1,_0x2b7ecd=cli[_0x3e0a3c(0xdb)][0x0],_0x2e5100=cli[_0x3e0a3c(0xdb)][0x1],_0xabefb6=cli[_0x3e0a3c(0xdb)][0x2],_0x453d5b=getLanguage(cli[_0x3e0a3c(0xe5)]),_0x368dd6=(_0x3e0a3c(0xd8)+process['argv'][_0x3e0a3c(0xaf)](0x2)[_0x3e0a3c(0xba)]('\x20'))[_0x3e0a3c(0xe6)]();logger[_0x3e0a3c(0xf3)](_0x368dd6);switch(_0x2b7ecd){case _0x3e0a3c(0xc7):{const _0x6ef8e9=cli['flags'][_0x3e0a3c(0xc4)],_0x2f569d=cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xd0)];logger['setLogPath'](process[_0x3e0a3c(0xe3)]()),logger[_0x3e0a3c(0xf8)](_0x3e0a3c(0xc7),_0x3e0a3c(0xec)),renderWithI18n(a29_0x25be93(Init,{'appcode':_0x6ef8e9,'env':_0x2f569d}),_0x453d5b);break;}case _0x3e0a3c(0xef):{const _0x551b82=cli[_0x3e0a3c(0xdb)][0x1]?.[_0x3e0a3c(0xe6)](),_0x11acbc=cli[_0x3e0a3c(0xe5)]['env'],_0x2a4d3e=isNonInteractiveMode(cli[_0x3e0a3c(0xe5)]);if(_0x2a4d3e&&_0x551b82){logger['setLogPath'](process[_0x3e0a3c(0xe3)]()),logger[_0x3e0a3c(0xf8)](_0x3e0a3c(0xef),'非交互模式创建项目:\x20'+_0x551b82);const {createProjectNonInteractive:_0x42c5f8}=await import(_0x3e0a3c(0xc5));await _0x42c5f8(_0x551b82,_0x11acbc);}else _0x2a4d3e&&!_0x551b82?(console[_0x3e0a3c(0xd2)](_0x453d5b?.['startsWith']('zh')?_0x3e0a3c(0xf6):_0x3e0a3c(0xde)),process[_0x3e0a3c(0xe2)](0x1)):renderWithI18n(a29_0x25be93(CreateApp,{'projectCode':_0x551b82,'env':_0x11acbc}),_0x453d5b);break;}case'start':{try{logger['setLogPath'](process['cwd']()),logger[_0x3e0a3c(0xf8)]('start','执行启动命令'),await runStart();}catch(_0x5cdaa4){console[_0x3e0a3c(0xd2)](_0x5cdaa4),process[_0x3e0a3c(0xe2)](0x1);}break;}case'build':{try{logger[_0x3e0a3c(0xcb)](process['cwd']()),logger['info'](_0x3e0a3c(0xf5),'执行构建命令'),await runBuild();}catch(_0x5d4ebc){console[_0x3e0a3c(0xd2)](_0x5d4ebc),process[_0x3e0a3c(0xe2)](0x1);}break;}case _0x3e0a3c(0xf4):{const _0x155724=cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xd3)];logger[_0x3e0a3c(0xcb)](process['cwd']()),logger[_0x3e0a3c(0xf8)](_0x3e0a3c(0xf4),_0x3e0a3c(0xb0)+(_0x155724?_0x3e0a3c(0xbd):''));if(_0x155724)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x1f3d39){console[_0x3e0a3c(0xd2)](_0x1f3d39),process[_0x3e0a3c(0xe2)](0x1);}else try{await runPreview();}catch(_0x2a725d){console['error'](_0x2a725d),process['exit'](0x1);}break;}case'config':{renderWithI18n(a29_0x25be93(Config,{'cli':cli}),_0x453d5b);break;}case _0x3e0a3c(0xbe):{await apiCli(cli);break;}case _0x3e0a3c(0xf7):{renderWithI18n(a29_0x25be93(AuthServer,{}),_0x453d5b);break;}case _0x3e0a3c(0xb5):{if(_0x2e5100==='update'){logger[_0x3e0a3c(0xcb)](process[_0x3e0a3c(0xe3)]()),logger[_0x3e0a3c(0xf8)](_0x3e0a3c(0xa9),_0x3e0a3c(0xb3)),renderWithI18n(a29_0x25be93(AppMenuUpdateCdn,{}),_0x453d5b);break;}else logger[_0x3e0a3c(0xcb)](process['cwd']()),logger[_0x3e0a3c(0xf8)]('menu-sync',_0x3e0a3c(0xd1)),renderWithI18n(a29_0x25be93(AppMenuSyncUI,{}),_0x453d5b);break;}case _0x3e0a3c(0xc0):{logout();break;}case _0x3e0a3c(0xd5):{const _0xe8ba88=cli[_0x3e0a3c(0xdb)][0x1];logger['setLogPath'](process[_0x3e0a3c(0xe3)]());if(_0xe8ba88==='install'){const _0x469998=[];if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xf2)]||cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xda)])_0x469998[_0x3e0a3c(0xe1)]('cursor');if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xb4)]||cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xb9)])_0x469998[_0x3e0a3c(0xe1)]('claude');if(cli[_0x3e0a3c(0xe5)]['mcpOther'])_0x469998[_0x3e0a3c(0xe1)](_0x3e0a3c(0xbc));logger['info'](_0x3e0a3c(0xc6),'执行配置\x20MCP\x20命令',{'preselected':_0x469998});if(isNonInteractiveMode(cli[_0x3e0a3c(0xe5)])&&_0x469998['length']>0x0){const {installMcpNonInteractive:_0x301b87}=await import(_0x3e0a3c(0xaa));await _0x301b87(_0x469998);}else renderWithI18n(a29_0x25be93(McpInstallUI,{'preselectedIDEs':_0x469998}),_0x453d5b);}else _0xe8ba88===_0x3e0a3c(0xe0)||cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xce)]?await mcpCommand(_0xe8ba88,[],{'help':!![]}):await mcpCommand(_0xe8ba88,[],cli[_0x3e0a3c(0xe5)]);break;}case'skill':{const _0x54c973=cli[_0x3e0a3c(0xdb)][0x1];logger[_0x3e0a3c(0xcb)](process[_0x3e0a3c(0xe3)]());if(_0x54c973===_0x3e0a3c(0xe7)){const _0x41d9fe=[];if(cli['flags'][_0x3e0a3c(0xf1)])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xda),'windsurf','claude','cline',_0x3e0a3c(0xb8),_0x3e0a3c(0xd4),_0x3e0a3c(0xcd),'codebuddy',_0x3e0a3c(0xdf),'agent',_0x3e0a3c(0xc1));else{if(cli['flags'][_0x3e0a3c(0xda)])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xda));if(cli['flags'][_0x3e0a3c(0xd6)])_0x41d9fe[_0x3e0a3c(0xe1)]('windsurf');if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xb9)])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xb9));if(cli['flags']['cline'])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xcf));if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xb8)])_0x41d9fe['push']('codex');if(cli['flags']['opencode'])_0x41d9fe['push'](_0x3e0a3c(0xd4));if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xcd)])_0x41d9fe['push']('qoder');if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xb2)])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xb2));if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xdf)])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xdf));if(cli['flags']['agent'])_0x41d9fe[_0x3e0a3c(0xe1)]('agent');if(cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xc1)])_0x41d9fe[_0x3e0a3c(0xe1)](_0x3e0a3c(0xc1));}const {getAllProvidedFlags:_0x33745a}=await import(_0x3e0a3c(0xae)),_0x33d7e5=_0x33745a(cli[_0x3e0a3c(0xe5)]);logger[_0x3e0a3c(0xf8)](_0x3e0a3c(0xbf),_0x3e0a3c(0xbb),{'preselected':_0x41d9fe,'providedFlags':_0x33d7e5});if(isNonInteractiveMode(cli[_0x3e0a3c(0xe5)])&&_0x41d9fe['length']>0x0){const {installSkillsNonInteractive:_0x47cbb9}=await import('./skills/skill-install-non-interactive.js');await _0x47cbb9(_0x41d9fe,_0x33d7e5);}else renderWithI18n(a29_0x25be93(SkillInstallUI,{'preselectedIDEs':_0x41d9fe,'providedFlags':_0x33d7e5}),_0x453d5b);}else _0x54c973===_0x3e0a3c(0xe0)||cli[_0x3e0a3c(0xe5)][_0x3e0a3c(0xce)]?await skillsCommand(_0x54c973,[],{'help':!![]}):await skillsCommand(_0x54c973,[],cli[_0x3e0a3c(0xe5)]);break;}case'logs':{cli['flags'][_0x3e0a3c(0xf0)]?clearLogs():showLogs();break;}default:renderWithI18n(a29_0x25be93(Help,{}),_0x453d5b);break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3dab1e,_0x5a1009){const _0x36666c=a30_0x180a,_0x386147=_0x3dab1e();while(!![]){try{const _0x422cbb=-parseInt(_0x36666c(0x167))/0x1+parseInt(_0x36666c(0x162))/0x2*(parseInt(_0x36666c(0x16a))/0x3)+-parseInt(_0x36666c(0x164))/0x4+-parseInt(_0x36666c(0x165))/0x5*(-parseInt(_0x36666c(0x166))/0x6)+-parseInt(_0x36666c(0x16c))/0x7+-parseInt(_0x36666c(0x161))/0x8+-parseInt(_0x36666c(0x170))/0x9*(-parseInt(_0x36666c(0x16f))/0xa);if(_0x422cbb===_0x5a1009)break;else _0x386147['push'](_0x386147['shift']());}catch(_0x5194bc){_0x386147['push'](_0x386147['shift']());}}}(a30_0x55e4,0xf1ba3));import{spawn}from'node:child_process';import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x1ab38a,_0x38e7c7)=>{const _0x4cfc60=a30_0x180a,_0x5b5967=spawn('vite',[_0x4cfc60(0x169),_0x4cfc60(0x16d)],{'stdio':_0x4cfc60(0x172),'shell':!![],'env':{...process['env'],'PATH':''+join(process['cwd'](),_0x4cfc60(0x16e),_0x4cfc60(0x171))+delimiter+process[_0x4cfc60(0x168)][_0x4cfc60(0x16b)]}});_0x5b5967['on'](_0x4cfc60(0x160),_0x3e034d=>{if(_0x3e034d===0x0||_0x3e034d===null)_0x1ab38a();else _0x38e7c7(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x3e034d));}),_0x5b5967['on'](_0x4cfc60(0x163),_0x38e7c7);});}function a30_0x180a(_0x4b6d6b,_0x38f87b){_0x4b6d6b=_0x4b6d6b-0x160;const _0x55e4cf=a30_0x55e4();let _0x180a3f=_0x55e4cf[_0x4b6d6b];return _0x180a3f;}function a30_0x55e4(){const _0x43c539=['node_modules','8585550SjifvD','18BmUNvy','.bin','inherit','close','426984TXejCm','54olwlKo','error','3647076GFQqLi','315niMPHH','164388pRCGuA','1633923iZIOwl','env','build','23466sWuBiU','PATH','456386QhKNpK','--watch'];a30_0x55e4=function(){return _0x43c539;};return a30_0x55e4();}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a31_0x494c(){const _0xe1054c=['开始构建项目','success','toString','node_modules','npm\x20run\x20build\x20exited\x20with\x20code\x20','99464hTPDxt','8042YGuTgk','error','message','data','756YLCsqT','cwd','trim','now','info','inherit','.bin','stderr','npm','5109888UkyBbJ','close','126192SZBkva','build','项目构建出错','env','2224248UzyUmj','3741504psueIu','9mGCqdu','4506670tVoBgp'];a31_0x494c=function(){return _0xe1054c;};return a31_0x494c();}function a31_0xf09d(_0x4784eb,_0x44810e){_0x4784eb=_0x4784eb-0xcb;const _0x494ca5=a31_0x494c();let _0xf09d11=_0x494ca5[_0x4784eb];return _0xf09d11;}(function(_0x777765,_0x2b9249){const _0x50e5e4=a31_0xf09d,_0x3bf73b=_0x777765();while(!![]){try{const _0x223450=-parseInt(_0x50e5e4(0xe0))/0x1+parseInt(_0x50e5e4(0xd1))/0x2*(-parseInt(_0x50e5e4(0xe6))/0x3)+-parseInt(_0x50e5e4(0xe4))/0x4+parseInt(_0x50e5e4(0xe7))/0x5+parseInt(_0x50e5e4(0xe5))/0x6+parseInt(_0x50e5e4(0xde))/0x7+parseInt(_0x50e5e4(0xd0))/0x8*(-parseInt(_0x50e5e4(0xd5))/0x9);if(_0x223450===_0x2b9249)break;else _0x3bf73b['push'](_0x3bf73b['shift']());}catch(_0x595eb7){_0x3bf73b['push'](_0x3bf73b['shift']());}}}(a31_0x494c,0x7e075));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x484a44,_0x4e5337)=>{const _0x4f17dc=a31_0xf09d,_0x1b4af0=Date[_0x4f17dc(0xd8)]();logger[_0x4f17dc(0xd9)](_0x4f17dc(0xe1),_0x4f17dc(0xcb),{'command':'npm\x20run\x20build'});let _0xe685ba='';const _0x2cfb49=spawn(_0x4f17dc(0xdd),['run',_0x4f17dc(0xe1)],{'stdio':[_0x4f17dc(0xda),_0x4f17dc(0xda),'pipe'],'shell':!![],'env':{...process[_0x4f17dc(0xe3)],'PATH':''+join(process[_0x4f17dc(0xd6)](),_0x4f17dc(0xce),_0x4f17dc(0xdb))+delimiter+process[_0x4f17dc(0xe3)]['PATH']}});_0x2cfb49[_0x4f17dc(0xdc)]?.['on'](_0x4f17dc(0xd4),_0x2520d0=>{const _0x43a53f=_0x4f17dc;_0xe685ba+=_0x2520d0[_0x43a53f(0xcd)]();}),_0x2cfb49['on'](_0x4f17dc(0xdf),_0x30932a=>{const _0x30aca1=_0x4f17dc,_0x18e64f=Date[_0x30aca1(0xd8)]()-_0x1b4af0;if(_0x30932a===0x0||_0x30932a===null)logger[_0x30aca1(0xcc)](_0x30aca1(0xe1),'项目构建成功',_0x18e64f),_0x484a44();else{const _0x4a1e6d={'exitCode':_0x30932a,'duration':_0x18e64f,'command':'npm\x20run\x20build','cwd':process[_0x30aca1(0xd6)]()};_0xe685ba['trim']()&&(_0x4a1e6d[_0x30aca1(0xdc)]=_0xe685ba['trim']()),logger['error'](_0x30aca1(0xe1),'项目构建失败',_0x4a1e6d),_0x4e5337(new Error(_0x30aca1(0xcf)+_0x30932a));}}),_0x2cfb49['on'](_0x4f17dc(0xd2),_0x49099a=>{const _0x103cf2=_0x4f17dc,_0x443779=Date[_0x103cf2(0xd8)]()-_0x1b4af0;logger['error'](_0x103cf2(0xe1),_0x103cf2(0xe2),{'error':_0x49099a[_0x103cf2(0xd3)],'duration':_0x443779,'stderr':_0xe685ba[_0x103cf2(0xd7)]()||undefined}),_0x4e5337(_0x49099a);});});}
|
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a32_0x1152fc=a32_0x31a3;function a32_0x4480(){const _0x4ce54c=['level','440572NmnFJX','38YPWMHa','keys','327421vYRVnA','logs.cleared','6080PAAgxY','timestamp','bind','language','logs.time','8EjnWmI','zh-CN','cwd','success','length','duration','logs.noLogs','8659510ORgpYs','127519ERctiY','870eIGtPP','log','error','warn','153ttylgO','logs.header','details','11jTpPgv','command','logs.details','setLogPath','11439xpwphf','forEach','message','readLogs','toLocaleString','stringify','logs.duration'];a32_0x4480=function(){return _0x4ce54c;};return a32_0x4480();}(function(_0x56c7ee,_0x417687){const _0x1d58a3=a32_0x31a3,_0x302382=_0x56c7ee();while(!![]){try{const _0x1dfd87=-parseInt(_0x1d58a3(0xc4))/0x1+-parseInt(_0x1d58a3(0xc2))/0x2*(-parseInt(_0x1d58a3(0xb2))/0x3)+-parseInt(_0x1d58a3(0xc1))/0x4+parseInt(_0x1d58a3(0xc6))/0x5*(-parseInt(_0x1d58a3(0xd4))/0x6)+parseInt(_0x1d58a3(0xd3))/0x7*(-parseInt(_0x1d58a3(0xcb))/0x8)+-parseInt(_0x1d58a3(0xb9))/0x9+parseInt(_0x1d58a3(0xd2))/0xa*(parseInt(_0x1d58a3(0xb5))/0xb);if(_0x1dfd87===_0x417687)break;else _0x302382['push'](_0x302382['shift']());}catch(_0x551cc2){_0x302382['push'](_0x302382['shift']());}}}(a32_0x4480,0x3904c));import{logger}from'../utils/logger.js';import a32_0x4f7ab8 from'../i18n/index.js';const t=a32_0x4f7ab8['t'][a32_0x1152fc(0xc8)](a32_0x4f7ab8);export function showLogs(){const _0x36b8ae=a32_0x1152fc;logger[_0x36b8ae(0xb8)](process['cwd']());const _0x15c266=logger[_0x36b8ae(0xbc)]();if(_0x15c266[_0x36b8ae(0xcf)]===0x0){console[_0x36b8ae(0xd5)](t(_0x36b8ae(0xd1)));return;}console[_0x36b8ae(0xd5)](t(_0x36b8ae(0xb3))),_0x15c266[_0x36b8ae(0xba)]((_0x89a5f2,_0x409b6a)=>{const _0x2f925e=_0x36b8ae,_0x2d563c=a32_0x4f7ab8[_0x2f925e(0xc9)]===_0x2f925e(0xcc)?'zh-CN':'en-US',_0x2d16c1=new Date(_0x89a5f2[_0x2f925e(0xc7)])[_0x2f925e(0xbd)](_0x2d563c),_0x493e4f=_0x89a5f2[_0x2f925e(0xc0)]===_0x2f925e(0xce)?'√':_0x89a5f2[_0x2f925e(0xc0)]===_0x2f925e(0xd6)?'×':_0x89a5f2[_0x2f925e(0xc0)]===_0x2f925e(0xd7)?'!':'i';console[_0x2f925e(0xd5)](_0x409b6a+0x1+'.\x20'+_0x493e4f+'\x20['+_0x89a5f2[_0x2f925e(0xb6)]+']\x20'+_0x89a5f2[_0x2f925e(0xbb)]),console[_0x2f925e(0xd5)](t(_0x2f925e(0xca),{'time':_0x2d16c1})),_0x89a5f2[_0x2f925e(0xd0)]&&console['log'](t(_0x2f925e(0xbf),{'duration':_0x89a5f2[_0x2f925e(0xd0)]})),_0x89a5f2['details']&&Object[_0x2f925e(0xc3)](_0x89a5f2[_0x2f925e(0xb4)])['length']>0x0&&console[_0x2f925e(0xd5)](t(_0x2f925e(0xb7),{'details':JSON[_0x2f925e(0xbe)](_0x89a5f2['details'],null,0x2)})),console[_0x2f925e(0xd5)]('');});}function a32_0x31a3(_0x44d66c,_0x401b4a){_0x44d66c=_0x44d66c-0xb2;const _0x448022=a32_0x4480();let _0x31a39e=_0x448022[_0x44d66c];return _0x31a39e;}export function clearLogs(){const _0xc006da=a32_0x1152fc;logger[_0xc006da(0xb8)](process[_0xc006da(0xcd)]()),logger['clearLogs'](),console[_0xc006da(0xd5)](t(_0xc006da(0xc5)));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a33_0x12db(_0xba1d27,_0x3349a1){_0xba1d27=_0xba1d27-0x1c9;const _0x46b2a7=a33_0x46b2();let _0x12db5b=_0x46b2a7[_0xba1d27];return _0x12db5b;}(function(_0x45ec78,_0x26dfd5){const _0x5f2629=a33_0x12db,_0x3e9f49=_0x45ec78();while(!![]){try{const _0x5d45a4=parseInt(_0x5f2629(0x1e3))/0x1+parseInt(_0x5f2629(0x1e5))/0x2*(parseInt(_0x5f2629(0x1cb))/0x3)+parseInt(_0x5f2629(0x1c9))/0x4+-parseInt(_0x5f2629(0x1e2))/0x5+-parseInt(_0x5f2629(0x1db))/0x6*(-parseInt(_0x5f2629(0x1d7))/0x7)+-parseInt(_0x5f2629(0x1e0))/0x8*(parseInt(_0x5f2629(0x1d9))/0x9)+-parseInt(_0x5f2629(0x1cd))/0xa*(parseInt(_0x5f2629(0x1de))/0xb);if(_0x5d45a4===_0x26dfd5)break;else _0x3e9f49['push'](_0x3e9f49['shift']());}catch(_0x486ca2){_0x3e9f49['push'](_0x3e9f49['shift']());}}}(a33_0x46b2,0xbd02e));function a33_0x46b2(){const _0x41d27a=['20304lhorOi','vite\x20preview','5892690GeBoPF','809452BCCenu','.bin','5808aDQouu','4846216oUjSqK','close','546JugPKb','预览服务器启动成功','423350yuMVUs','预览服务器启动出错','预览服务器启动失败','trim','preview','vite','inherit','PATH','success','now','168hJpcnX','node_modules','4374oHbFcf','info','307338oXerhF','error','env','154IdvRvG','cwd'];a33_0x46b2=function(){return _0x41d27a;};return a33_0x46b2();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x324532,_0x4c29f2)=>{const _0x38da9b=a33_0x12db,_0x1c14a5=Date['now']();logger[_0x38da9b(0x1da)]('preview','启动预览服务器',{'command':_0x38da9b(0x1e1)});let _0x5a34ca='';const _0x44bdde=spawn(_0x38da9b(0x1d2),['preview'],{'stdio':[_0x38da9b(0x1d3),_0x38da9b(0x1d3),'pipe'],'shell':!![],'env':{...process[_0x38da9b(0x1dd)],'PATH':''+join(process[_0x38da9b(0x1df)](),_0x38da9b(0x1d8),_0x38da9b(0x1e4))+delimiter+process[_0x38da9b(0x1dd)][_0x38da9b(0x1d4)]}});_0x44bdde['stderr']?.['on']('data',_0x5b864e=>{_0x5a34ca+=_0x5b864e['toString']();}),_0x44bdde['on'](_0x38da9b(0x1ca),_0xb17db8=>{const _0x1dfb24=_0x38da9b,_0x30ce03=Date[_0x1dfb24(0x1d6)]()-_0x1c14a5;if(_0xb17db8===0x0||_0xb17db8===null)logger[_0x1dfb24(0x1d5)](_0x1dfb24(0x1d1),_0x1dfb24(0x1cc),_0x30ce03),_0x324532();else{const _0x744ab4={'exitCode':_0xb17db8,'duration':_0x30ce03,'command':_0x1dfb24(0x1e1),'cwd':process[_0x1dfb24(0x1df)]()};_0x5a34ca[_0x1dfb24(0x1d0)]()&&(_0x744ab4['stderr']=_0x5a34ca[_0x1dfb24(0x1d0)]()),logger[_0x1dfb24(0x1dc)](_0x1dfb24(0x1d1),_0x1dfb24(0x1cf),_0x744ab4),_0x4c29f2(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0xb17db8));}}),_0x44bdde['on'](_0x38da9b(0x1dc),_0x38b7ad=>{const _0x3bca9c=_0x38da9b,_0x307d92=Date[_0x3bca9c(0x1d6)]()-_0x1c14a5;logger[_0x3bca9c(0x1dc)](_0x3bca9c(0x1d1),_0x3bca9c(0x1ce),{'error':_0x38b7ad['message'],'duration':_0x307d92,'stderr':_0x5a34ca[_0x3bca9c(0x1d0)]()||undefined}),_0x4c29f2(_0x38b7ad);});});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x20b3bb,_0x368796){const _0x2c00c0=a34_0x524b,_0x3e03b5=_0x20b3bb();while(!![]){try{const _0x59dcb2=-parseInt(_0x2c00c0(0x1d3))/0x1+-parseInt(_0x2c00c0(0x1c4))/0x2+-parseInt(_0x2c00c0(0x1dd))/0x3*(-parseInt(_0x2c00c0(0x1cf))/0x4)+-parseInt(_0x2c00c0(0x1ce))/0x5*(-parseInt(_0x2c00c0(0x1cd))/0x6)+-parseInt(_0x2c00c0(0x1c7))/0x7+parseInt(_0x2c00c0(0x1d0))/0x8*(parseInt(_0x2c00c0(0x1d2))/0x9)+parseInt(_0x2c00c0(0x1c1))/0xa;if(_0x59dcb2===_0x368796)break;else _0x3e03b5['push'](_0x3e03b5['shift']());}catch(_0x43c54a){_0x3e03b5['push'](_0x3e03b5['shift']());}}}(a34_0x11e3,0xf3392));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';function a34_0x11e3(){const _0x9f2f85=['version','timedOut','object','1103247Kanypo','env','开发服务器启动失败','now','22420680MOcKJT','needsUpgrade','inherit','3001598ndZQsm','stderr','CLI\x20版本有更新','7970718PvrrSU','message','exitCode','cwd','vite','stableVersion','24GeZEmW','528545zMiKvB','16TcAkpM','94104aCcYEa','error','1017CiBsDq','1829404NBAuCK','warn','start','success','currentVersion','开发服务器启动成功','timeout'];a34_0x11e3=function(){return _0x9f2f85;};return a34_0x11e3();}function a34_0x524b(_0x1e4761,_0x163c82){_0x1e4761=_0x1e4761-0x1c0;const _0x11e341=a34_0x11e3();let _0x524b8e=_0x11e341[_0x1e4761];return _0x524b8e;}export async function runStart(_0x5daf25){const _0x4dee1a=a34_0x524b,_0xfe930d=Date[_0x4dee1a(0x1c0)](),_0x31bafa=_0x5daf25||process[_0x4dee1a(0x1ca)](),_0x5eb958=await checkCliVersion();_0x5eb958[_0x4dee1a(0x1c2)]&&(printCliUpgradeWarning(_0x5eb958),logger[_0x4dee1a(0x1d4)]('start',_0x4dee1a(0x1c6),{'currentVersion':_0x5eb958[_0x4dee1a(0x1d7)],'stableVersion':_0x5eb958[_0x4dee1a(0x1cc)]}));const _0x23486f=await checkSdkVersion(_0x31bafa);_0x23486f['needsUpgrade']&&(printSdkUpgradeWarning(_0x23486f),logger[_0x4dee1a(0x1d4)](_0x4dee1a(0x1d5),'SDK\x20版本有更新',{'currentVersion':_0x23486f[_0x4dee1a(0x1da)],'stableVersion':_0x23486f['stableVersion']}));logger['info']('start','启动开发服务器',{'command':_0x4dee1a(0x1cb),'cwd':_0x31bafa});try{await execa(_0x4dee1a(0x1cb),[],{'cwd':_0x31bafa,'stdio':_0x4dee1a(0x1c3),'preferLocal':!![],'localDir':_0x31bafa,'env':{...process[_0x4dee1a(0x1de)]}});const _0x54b802=Date[_0x4dee1a(0x1c0)]()-_0xfe930d;logger[_0x4dee1a(0x1d6)](_0x4dee1a(0x1d5),_0x4dee1a(0x1d8),_0x54b802);}catch(_0x344b57){const _0x3e3190=Date[_0x4dee1a(0x1c0)]()-_0xfe930d,_0xd17458={'duration':_0x3e3190,'command':_0x4dee1a(0x1cb),'cwd':_0x31bafa};if(_0x344b57&&typeof _0x344b57===_0x4dee1a(0x1dc)){const _0x1f074d=_0x344b57;_0x1f074d[_0x4dee1a(0x1c9)]!==undefined&&(_0xd17458[_0x4dee1a(0x1c9)]=_0x1f074d[_0x4dee1a(0x1c9)]),_0x1f074d[_0x4dee1a(0x1c5)]&&(_0xd17458[_0x4dee1a(0x1c5)]=_0x1f074d['stderr']),_0x1f074d[_0x4dee1a(0x1db)]&&(_0xd17458[_0x4dee1a(0x1d9)]=!![]),_0x1f074d[_0x4dee1a(0x1c8)]&&(_0xd17458[_0x4dee1a(0x1d1)]=_0x1f074d[_0x4dee1a(0x1c8)]);}logger[_0x4dee1a(0x1d1)](_0x4dee1a(0x1d5),_0x4dee1a(0x1df),_0xd17458);throw _0x344b57;}}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x579ca5,_0x511803){const _0x2e4ea5=a35_0x3a3d,_0x36404f=_0x579ca5();while(!![]){try{const _0x184ea0=-parseInt(_0x2e4ea5(0xa2))/0x1+-parseInt(_0x2e4ea5(0x8d))/0x2+parseInt(_0x2e4ea5(0x91))/0x3+parseInt(_0x2e4ea5(0x9e))/0x4+-parseInt(_0x2e4ea5(0x8a))/0x5*(parseInt(_0x2e4ea5(0x92))/0x6)+parseInt(_0x2e4ea5(0x96))/0x7+-parseInt(_0x2e4ea5(0x8e))/0x8*(-parseInt(_0x2e4ea5(0x99))/0x9);if(_0x184ea0===_0x511803)break;else _0x36404f['push'](_0x36404f['shift']());}catch(_0x26ba77){_0x36404f['push'](_0x36404f['shift']());}}}(a35_0x22a9,0xf3f93));import{logger}from'../utils/logger.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a35_0x22a9(){const _0x22421c=['16kvcNTj','开发服务器启动成功','stderr','2543253RMyPyA','12OdKCSM','version','currentVersion','stableVersion','13343827qXfeiu','timeout','warn','1702926PVtkZs','start','message','vite','needsUpgrade','4356124puHPhe','info','now','CLI\x20版本有更新','367542beXMDe','success','env','exitCode','object','timedOut','开发服务器启动失败','error','4134635ScvCeI','inherit','启动开发服务器','2401520SSGFdP'];a35_0x22a9=function(){return _0x22421c;};return a35_0x22a9();}import{execa}from'execa';function a35_0x3a3d(_0x8880e4,_0x54db36){_0x8880e4=_0x8880e4-0x88;const _0x22a98f=a35_0x22a9();let _0x3a3d6f=_0x22a98f[_0x8880e4];return _0x3a3d6f;}export async function runStart(_0x4efed2){const _0x83d77=a35_0x3a3d,_0x538bd1=Date[_0x83d77(0xa0)](),_0x325ba1=_0x4efed2||process['cwd'](),_0x4a2da9=await checkCliVersion();_0x4a2da9[_0x83d77(0x9d)]&&(printCliUpgradeWarning(_0x4a2da9),logger[_0x83d77(0x98)](_0x83d77(0x9a),_0x83d77(0xa1),{'currentVersion':_0x4a2da9[_0x83d77(0x94)],'stableVersion':_0x4a2da9[_0x83d77(0x95)]}));const _0x122932=await checkSdkVersion(_0x325ba1);_0x122932[_0x83d77(0x9d)]&&(printSdkUpgradeWarning(_0x122932),logger[_0x83d77(0x98)]('start','SDK\x20版本有更新',{'currentVersion':_0x122932[_0x83d77(0x93)],'stableVersion':_0x122932[_0x83d77(0x95)]}));logger[_0x83d77(0x9f)](_0x83d77(0x9a),_0x83d77(0x8c),{'command':_0x83d77(0x9c),'cwd':_0x325ba1});try{await execa('vite',[],{'cwd':_0x325ba1,'stdio':_0x83d77(0x8b),'preferLocal':!![],'localDir':_0x325ba1,'env':{...process[_0x83d77(0xa4)]}});const _0x4a5a75=Date[_0x83d77(0xa0)]()-_0x538bd1;logger[_0x83d77(0xa3)](_0x83d77(0x9a),_0x83d77(0x8f),_0x4a5a75);}catch(_0x330a1c){const _0x2dd47f=Date[_0x83d77(0xa0)]()-_0x538bd1,_0xbe4892={'duration':_0x2dd47f,'command':_0x83d77(0x9c),'cwd':_0x325ba1};if(_0x330a1c&&typeof _0x330a1c===_0x83d77(0xa6)){const _0x5c75c0=_0x330a1c;_0x5c75c0[_0x83d77(0xa5)]!==undefined&&(_0xbe4892[_0x83d77(0xa5)]=_0x5c75c0[_0x83d77(0xa5)]),_0x5c75c0[_0x83d77(0x90)]&&(_0xbe4892[_0x83d77(0x90)]=_0x5c75c0[_0x83d77(0x90)]),_0x5c75c0[_0x83d77(0xa7)]&&(_0xbe4892[_0x83d77(0x97)]=!![]),_0x5c75c0[_0x83d77(0x9b)]&&(_0xbe4892['error']=_0x5c75c0['message']);}logger[_0x83d77(0x89)]('start',_0x83d77(0x88),_0xbe4892);throw _0x330a1c;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xae5d40,_0x1a3bdb){const _0x36b0f0=a36_0x168f,_0x53b66a=_0xae5d40();while(!![]){try{const _0x5a52db=parseInt(_0x36b0f0(0xae))/0x1+parseInt(_0x36b0f0(0xb2))/0x2+parseInt(_0x36b0f0(0xb1))/0x3+parseInt(_0x36b0f0(0xa9))/0x4+-parseInt(_0x36b0f0(0xb0))/0x5+-parseInt(_0x36b0f0(0xa8))/0x6+-parseInt(_0x36b0f0(0xb6))/0x7;if(_0x5a52db===_0x1a3bdb)break;else _0x53b66a['push'](_0x53b66a['shift']());}catch(_0x4adc4d){_0x53b66a['push'](_0x53b66a['shift']());}}}(a36_0x42fe,0x68ecc));import{jsxs as a36_0x50130f,jsx as a36_0x32ca4a}from'react/jsx-runtime';function a36_0x42fe(){const _0x4175a0=['config.help.examples','config.help.exampleLocale','177001GYTnAN','map','1621650xrRTmE','1800189DPOqoM','1221560kKHJUf','config.help.set','command','lovrabet\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','1696548lxaZLn','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','config.help.get','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','gray','\x20\x20\x20\x20','column','3629658OYnmvV','854260amQWdC','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','description'];a36_0x42fe=function(){return _0x4175a0;};return a36_0x42fe();}function a36_0x168f(_0x3e1724,_0x5babbf){_0x3e1724=_0x3e1724-0xa8;const _0x42fe80=a36_0x42fe();let _0x168f2c=_0x42fe80[_0x3e1724];return _0x168f2c;}import{Box,Text}from'ink';import{useI18n}from'../i18n/hooks.js';export function ConfigHelp(){const _0x150c56=a36_0x168f,{t:_0x521b96}=useI18n(),_0x2f9071=[{'command':_0x150c56(0xb9),'description':_0x521b96(_0x150c56(0xb3))},{'command':'lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':_0x521b96(_0x150c56(0xb8))},{'command':_0x150c56(0xb7),'description':_0x521b96('config.help.list')}],_0x544dd7=[{'command':_0x150c56(0xaa),'description':_0x521b96('config.help.exampleApp')},{'command':'lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','description':_0x521b96('config.help.exampleEnv')},{'command':_0x150c56(0xb5),'description':_0x521b96(_0x150c56(0xad))}];return a36_0x50130f(Box,{'flexDirection':_0x150c56(0xbc),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0x32ca4a(Box,{'marginBottom':0x1,'children':a36_0x50130f(Text,{'color':_0x150c56(0xba),'children':['\x20','!','\x20\x20',_0x521b96('config.help.invalidCommand')]})}),_0x2f9071[_0x150c56(0xaf)](_0x502b17=>a36_0x50130f(Box,{'children':[a36_0x50130f(Text,{'children':[_0x150c56(0xbb),_0x502b17['command']]}),a36_0x32ca4a(Text,{'color':'gray','children':_0x502b17[_0x150c56(0xab)]})]},_0x502b17[_0x150c56(0xb4)])),a36_0x32ca4a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a36_0x50130f(Text,{'color':_0x150c56(0xba),'children':['\x20*\x20',_0x521b96(_0x150c56(0xac))]})}),_0x544dd7['map'](_0x56fb96=>a36_0x50130f(Box,{'children':[a36_0x50130f(Text,{'children':[_0x150c56(0xbb),_0x56fb96['command']]}),a36_0x32ca4a(Text,{'color':'gray','children':_0x56fb96['description']})]},_0x56fb96[_0x150c56(0xb4)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x316bcf,_0x23327c){const _0x191e5e=a37_0x2252,_0x4c24c4=_0x316bcf();while(!![]){try{const _0xa5111a=-parseInt(_0x191e5e(0x86))/0x1+-parseInt(_0x191e5e(0x8b))/0x2+-parseInt(_0x191e5e(0x75))/0x3*(-parseInt(_0x191e5e(0x81))/0x4)+-parseInt(_0x191e5e(0x66))/0x5+-parseInt(_0x191e5e(0x7b))/0x6+parseInt(_0x191e5e(0x74))/0x7*(-parseInt(_0x191e5e(0x80))/0x8)+-parseInt(_0x191e5e(0x6c))/0x9*(-parseInt(_0x191e5e(0x64))/0xa);if(_0xa5111a===_0x23327c)break;else _0x4c24c4['push'](_0x4c24c4['shift']());}catch(_0x3a6f87){_0x4c24c4['push'](_0x4c24c4['shift']());}}}(a37_0x33f7,0x4abd9));import{jsx as a37_0x5c9af5,jsxs as a37_0x3c02fc}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a37_0x211728 from'node:fs';import a37_0x271f1a from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';function a37_0x33f7(){const _0x11768a=['set','app','config.scope.project','1750254DomBkn','get','config.scope.global','includes','red','37736jaAMYN','67296mMWdnG','locale','log','help','.tmp','572968gelTrl','list','appcode','config.success.localeSet','online','914638QJGjXU','config.validation.valueInvalid','flags','config','daily','unlinkSync','10hwyBrm','length','1836120aObyTV','env','error','config.validation.localeInvalid','parse','config.validation.envInvalid','14743098miNHjn','stringify','保存配置失败','undefined','config.success.envSet','input','utf8','message','119dSivat','78aluyeJ','config.validation.saveFailed','mkdirSync'];a37_0x33f7=function(){return _0x11768a;};return a37_0x33f7();}import{normalizeLocale}from'../i18n/index.js';import{useI18n}from'../i18n/hooks.js';function a37_0x2252(_0x40ee61,_0x508091){_0x40ee61=_0x40ee61-0x64;const _0x33f7d6=a37_0x33f7();let _0x225288=_0x33f7d6[_0x40ee61];return _0x225288;}export function Config(_0x20ba9){const _0x2cd33c=a37_0x2252,{cli:_0x3a50f4}=_0x20ba9,{t:_0x1fdfb5}=useI18n(),_0x5942ed=_0x3a50f4[_0x2cd33c(0x71)][0x1],_0x3d8ac9=_0x3a50f4[_0x2cd33c(0x71)][0x2],_0x1a5c3b=[_0x2cd33c(0x78),_0x2cd33c(0x7c)]['includes'](_0x5942ed||''),_0x40f78d=_0x3a50f4['input'][_0x2cd33c(0x65)]>=0x3;if(_0x3d8ac9==='--help'||_0x3a50f4[_0x2cd33c(0x8d)][_0x2cd33c(0x84)])return a37_0x5c9af5(ConfigHelp,{});const _0x268155=readConfig();if(_0x5942ed===_0x2cd33c(0x78)){if(_0x3d8ac9){const _0x5cb23a=_0x3a50f4[_0x2cd33c(0x71)][0x3];if(typeof _0x5cb23a!==_0x2cd33c(0x6f)){if(_0x3d8ac9===_0x2cd33c(0x67)&&![_0x2cd33c(0x8a),_0x2cd33c(0x8f)][_0x2cd33c(0x7e)](_0x5cb23a))return a37_0x5c9af5(Box,{'children':a37_0x5c9af5(Text,{'color':'red','children':_0x1fdfb5(_0x2cd33c(0x6b))})});if(_0x3d8ac9===_0x2cd33c(0x82)&&!normalizeLocale(_0x5cb23a))return a37_0x5c9af5(Box,{'flexDirection':'column','children':a37_0x5c9af5(Text,{'color':_0x2cd33c(0x7f),'children':_0x1fdfb5(_0x2cd33c(0x69))})});const _0x5afe4a=isInProject(),_0x47b2ef=_0x5afe4a?projectConfigPath:globalConfigPath;let _0x7c32e={};try{if(existsSync(_0x47b2ef)){const _0x2b95ca=readFileSync(_0x47b2ef,{'encoding':_0x2cd33c(0x72)});_0x2b95ca&&(_0x7c32e=JSON[_0x2cd33c(0x6a)](_0x2b95ca));}}catch(_0x2af890){}if(typeof _0x5cb23a!=='string'||_0x5cb23a['length']>0x1f4)return a37_0x5c9af5(Box,{'children':a37_0x5c9af5(Text,{'color':'red','children':_0x1fdfb5(_0x2cd33c(0x8c))})});let _0x5a2f57=_0x3d8ac9,_0x332656=_0x5cb23a;_0x3d8ac9==='app'&&(_0x5a2f57=_0x2cd33c(0x88),delete _0x7c32e[_0x2cd33c(0x79)]);_0x3d8ac9===_0x2cd33c(0x88)&&delete _0x7c32e[_0x2cd33c(0x79)];_0x3d8ac9===_0x2cd33c(0x82)&&(_0x332656=normalizeLocale(_0x5cb23a));_0x7c32e[_0x5a2f57]=_0x332656;try{const _0x4c079d=a37_0x271f1a['dirname'](_0x47b2ef);!existsSync(_0x4c079d)&&a37_0x211728[_0x2cd33c(0x77)](_0x4c079d,{'recursive':!![]});const _0x3c9c32=_0x47b2ef+_0x2cd33c(0x85);writeFileSync(_0x3c9c32,JSON[_0x2cd33c(0x6d)](_0x7c32e,null,0x2),{'encoding':_0x2cd33c(0x72),'mode':0x180}),a37_0x211728['renameSync'](_0x3c9c32,_0x47b2ef);const _0x392fea=_0x1fdfb5(_0x5afe4a?_0x2cd33c(0x7a):_0x2cd33c(0x7d));_0x3d8ac9==='env'&&console[_0x2cd33c(0x83)](_0x1fdfb5(_0x2cd33c(0x70),{'scope':_0x392fea,'value':_0x5cb23a}));if(_0x3d8ac9===_0x2cd33c(0x82)){const _0x248b5b=normalizeLocale(_0x5cb23a);console[_0x2cd33c(0x83)](_0x1fdfb5(_0x2cd33c(0x89),{'scope':_0x392fea,'value':_0x248b5b}));}}catch(_0x3e87f0){const _0xdd981e=_0x47b2ef+'.tmp';try{existsSync(_0xdd981e)&&a37_0x211728[_0x2cd33c(0x90)](_0xdd981e);}catch(_0x5005be){}return logger[_0x2cd33c(0x68)](_0x2cd33c(0x8e),_0x2cd33c(0x6e),{'error':_0x3e87f0 instanceof Error?_0x3e87f0[_0x2cd33c(0x73)]:String(_0x3e87f0),'configKey':_0x3d8ac9,'configValue':_0x5cb23a,'targetConfigPath':_0x47b2ef}),a37_0x5c9af5(Box,{'children':a37_0x3c02fc(Text,{'color':'red','children':[_0x1fdfb5(_0x2cd33c(0x76)),':','\x20',_0x3e87f0 instanceof Error?_0x3e87f0[_0x2cd33c(0x73)]:String(_0x3e87f0)]})});}return null;}return a37_0x5c9af5(Box,{'children':a37_0x5c9af5(Text,{'color':_0x2cd33c(0x7f),'children':_0x1fdfb5('config.validation.noValue')})});}}if(_0x5942ed==='get'){if(_0x3d8ac9){let _0x2f04a3=_0x3d8ac9;return _0x3d8ac9===_0x2cd33c(0x79)&&(_0x2f04a3='appcode'),console[_0x2cd33c(0x83)](_0x268155[_0x2f04a3]||_0x2cd33c(0x6f)),null;}return null;}if(_0x5942ed===_0x2cd33c(0x87))return console['log'](JSON[_0x2cd33c(0x6d)](_0x268155,null,0x2)),null;if(!_0x1a5c3b||!_0x40f78d)return a37_0x5c9af5(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a38_0x144ece=a38_0x3a5a;function a38_0x3a5a(_0x420812,_0x3a299f){_0x420812=_0x420812-0xf8;const _0x319c34=a38_0x319c();let _0x3a5a0a=_0x319c34[_0x420812];return _0x3a5a0a;}(function(_0x105a4e,_0x1f20c9){const _0x5851e4=a38_0x3a5a,_0x828ea3=_0x105a4e();while(!![]){try{const _0x4cf0fd=parseInt(_0x5851e4(0xfd))/0x1+-parseInt(_0x5851e4(0xf9))/0x2*(parseInt(_0x5851e4(0xfc))/0x3)+-parseInt(_0x5851e4(0xff))/0x4+-parseInt(_0x5851e4(0x102))/0x5+-parseInt(_0x5851e4(0x103))/0x6*(-parseInt(_0x5851e4(0xfb))/0x7)+-parseInt(_0x5851e4(0x100))/0x8+parseInt(_0x5851e4(0xfa))/0x9;if(_0x4cf0fd===_0x1f20c9)break;else _0x828ea3['push'](_0x828ea3['shift']());}catch(_0xf499b6){_0x828ea3['push'](_0x828ea3['shift']());}}}(a38_0x319c,0xe5c0a));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a38_0x144ece(0x101)?a38_0x144ece(0xfe):a38_0x144ece(0x104);export const getApiDomain=()=>getEnv()==='online'?a38_0x144ece(0xf8):'https://daily-api.lovrabet.com';function a38_0x319c(){const _0x5d4976=['https://api.lovrabet.com','8598rFtqTY','10684134VNcirB','85414vBUJPz','687RRFwMk','1510907gNTyyS','https://user.lovrabet.com','4584332mcHjpX','10975424IqvoEW','online','240895sMCjRe','882yuzrwk','https://user-daily.lovrabet.com'];a38_0x319c=function(){return _0x5d4976;};return a38_0x319c();}
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0xa08c0f=a39_0x351d;function a39_0x23f3(){const _0x10541e=['13316256zUBKwe','5pUvzAF','56532qvsxQJ','54651jbcPAb','10DERphK','18YoeAxB','969038mAkkEg','LOVRABET_ENV','2319796FZCXth','env','5898954OlzhRm','6821568oGsvHI'];a39_0x23f3=function(){return _0x10541e;};return a39_0x23f3();}(function(_0x58362f,_0x25e35f){const _0x37049b=a39_0x351d,_0x27ef41=_0x58362f();while(!![]){try{const _0x37d53b=parseInt(_0x37049b(0x171))/0x1+-parseInt(_0x37049b(0x174))/0x2*(parseInt(_0x37049b(0x172))/0x3)+-parseInt(_0x37049b(0x177))/0x4+parseInt(_0x37049b(0x170))/0x5*(-parseInt(_0x37049b(0x16d))/0x6)+-parseInt(_0x37049b(0x175))/0x7+parseInt(_0x37049b(0x16e))/0x8+parseInt(_0x37049b(0x16f))/0x9*(parseInt(_0x37049b(0x173))/0xa);if(_0x37d53b===_0x25e35f)break;else _0x27ef41['push'](_0x27ef41['shift']());}catch(_0x2e85b6){_0x27ef41['push'](_0x27ef41['shift']());}}}(a39_0x23f3,0x7fc35));let env=process[a39_0xa08c0f(0x178)][a39_0xa08c0f(0x176)]||'online';function a39_0x351d(_0x2a040c,_0x3bee93){_0x2a040c=_0x2a040c-0x16d;const _0x23f328=a39_0x23f3();let _0x351d0d=_0x23f328[_0x2a040c];return _0x351d0d;}export function getEnv(){return env;}export function initEnv(_0x340925){env=_0x340925;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x5423e9=a42_0x1814;(function(_0x37b59f,_0x171d97){const _0x2f42d7=a42_0x1814,_0x5585f0=_0x37b59f();while(!![]){try{const _0x4856bf=parseInt(_0x2f42d7(0x1bf))/0x1+-parseInt(_0x2f42d7(0x189))/0x2*(parseInt(_0x2f42d7(0x1d2))/0x3)+parseInt(_0x2f42d7(0x191))/0x4+parseInt(_0x2f42d7(0x1ad))/0x5*(-parseInt(_0x2f42d7(0x1d3))/0x6)+-parseInt(_0x2f42d7(0x1e0))/0x7+-parseInt(_0x2f42d7(0x1ca))/0x8+parseInt(_0x2f42d7(0x1c0))/0x9;if(_0x4856bf===_0x171d97)break;else _0x5585f0['push'](_0x5585f0['shift']());}catch(_0x1b4c06){_0x5585f0['push'](_0x5585f0['shift']());}}}(a42_0x110e,0x428f5));import{jsx as a42_0x39a007,jsxs as a42_0x106683,Fragment as a42_0x38992f}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a42_0x110e(){const _0x339c40=['应用AppCode不合法','*\x20是否要自动拉取\x20API\x20配置?','filter','lovrabet-setup','trim','cursor','add','leftArrow','gray','1716896yGQPza','login-prompt','test','项目名长度不能超过\x2050\x20个字符','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','project-name','from','green','3jpxJDP','22482VbgOMS','*\x20创建新项目','应用AppCode长度不能超过\x20100\x20个字符','cwd','跳过登录','[\x20]','slice','blue','my-app','value','opencode','\x20←\x20','登录失败','650979bficnO','*\x20是否要先登录以便拉取\x20API\x20配置?','\x22\x20已存在,请使用其他名称','description','online','codebuddy','login','*\x20正在检查登录状态...','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','*\x20是否配置\x20Lovrabet\x20MCP\x20和\x20Skill?','1056722rXGIQU','env','[✓]','login-process','codex','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','登录状态','length','177584HTuNLr','*\x20应用AppCode\x20','MCP\x20和\x20Skill','cyan','\x20\x20使用\x20←→\x20选择,回车确认','confirm-api-pull','red','app-code','*\x20项目名:\x20','has','选择要配置的\x20IDE:','backspace','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','antigravity','agent','api-pull','delete','\x22\x20已存在','login-check','rightArrow','creating','*\x20正在登录,请前往浏览器完成登录...','已登录','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','\x20检查中...','!\x20未检测到有效登录','windsurf','lovrabet-setup-selection','460bOiQss','downArrow','[可选]:\x20','*\x20正在创建项目...','includes','yellow','string','目录\x20\x22','upArrow','map','请至少选择一个\x20IDE','Yes','claude','column','\x20+MCP','拉取API配置','resolve','white','39472rXVGaW','12325095xXDopt'];a42_0x110e=function(){return _0x339c40;};return a42_0x110e();}import{existsSync}from'node:fs';import a42_0x17034e from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a42_0x1814(_0x3b4ba5,_0x4893aa){_0x3b4ba5=_0x3b4ba5-0x181;const _0x110eec=a42_0x110e();let _0x18149c=_0x110eec[_0x3b4ba5];return _0x18149c;}import{readConfig}from'../utils/config.js';import{IDE_CONFIGS,MCP_IDES}from'../utils/ai_config.js';const UI_IDE_CONFIGS=IDE_CONFIGS,UI_IDE_LIST=[a42_0x5423e9(0x19e),a42_0x5423e9(0x1b9),'cline',a42_0x5423e9(0x184),a42_0x5423e9(0x18d),a42_0x5423e9(0x1c6),a42_0x5423e9(0x1dd),'qoder','trae',a42_0x5423e9(0x1ab),a42_0x5423e9(0x19f)],UI_MCP_IDES=new Set(Array[a42_0x5423e9(0x1d0)](MCP_IDES));export function EnhancedGuidedCreate(_0x540ceb){const _0x12b557=a42_0x5423e9,{onCreate:_0x951e1e,env:_0x50dcbd}=_0x540ceb,[_0x2a8a9b,_0x5d3d98]=useState('project-name'),[_0x4f7273,_0x2e880a]=useState(''),[_0x291920,_0x360dd5]=useState(''),[_0x437744,_0x91b738]=useState(''),[_0x3a327a,_0x5dec5f]=useState(''),[_0x361e83,_0x5dcc3a]=useState([]),[_0x27d580,_0x2ffe87]=useState(null),[_0x1a547d,_0x37443b]=useState(![]),[_0x319e0a,_0x57c83b]=useState(![]),[_0x14bd3a,_0x5261f5]=useState(![]),[_0x3e121d,_0x57f607]=useState(0x0),[_0x396b7b,_0x18e727]=useState(0x0),[_0x48ce36,_0x3396f4]=useState(0x0),[_0x132f79,_0x55ac2b]=useState(![]),[_0x39d907,_0x4b7864]=useState(new Set()),[_0x5bf870,_0x23cfd4]=useState(0x0),[_0x5046a7,_0x5976ff]=useState(''),_0x2947ea=_0x12b557(0x1db),_0x5cfa10=readConfig(),_0x1f73d9=typeof _0x5cfa10[_0x12b557(0x18a)]===_0x12b557(0x1b3)?_0x5cfa10[_0x12b557(0x18a)]:undefined;function _0xe4a9de(_0xf6b8d0){const _0xa67f7e=_0x12b557,_0x3acd69=_0xf6b8d0||_0x2947ea,_0x49f24f=a42_0x17034e[_0xa67f7e(0x1bd)](process[_0xa67f7e(0x1d6)](),_0x3acd69);return existsSync(_0x49f24f);}function _0x535b00(_0x450af7){const _0x4e5d9f=_0x12b557;if(_0x450af7[_0x4e5d9f(0x190)]>0x32)return{'valid':![],'message':_0x4e5d9f(0x1cd)};const _0x26d28b=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x450af7?.[_0x4e5d9f(0x1c5)]()&&!_0x26d28b[_0x4e5d9f(0x1cc)](_0x450af7))return{'valid':![],'message':_0x4e5d9f(0x19d)};return{'valid':!![]};}function _0x1c0e58(_0x280be7){const _0x5e9b02=_0x12b557;if(!_0x280be7['trim']())return{'valid':!![]};if(_0x280be7[_0x5e9b02(0x190)]>0x64)return{'valid':![],'message':_0x5e9b02(0x1d5)};const _0x20022e=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x20022e[_0x5e9b02(0x1cc)](_0x280be7))return{'valid':![],'message':_0x5e9b02(0x1ce)};return{'valid':!![]};}async function _0x2829fe(){_0x37443b(!![]);try{const _0xb1e03f=await getIsSessionValid();return _0x2ffe87(_0xb1e03f),_0xb1e03f;}catch(_0x5c9dee){return _0x2ffe87(![]),![];}finally{_0x37443b(![]);}}async function _0x36f8e2(){_0x57c83b(!![]);try{const _0x46c183=await authServer({'silent':!![]});return _0x2ffe87(_0x46c183),_0x46c183;}catch(_0x37cdd5){return _0x2ffe87(![]),![];}finally{_0x57c83b(![]);}}return useInput(async(_0x3ca42d,_0x18b796)=>{const _0x2bea9e=_0x12b557;if(_0x18b796[_0x2bea9e(0x1c8)]||_0x18b796[_0x2bea9e(0x1a4)]){if(_0x2a8a9b===_0x2bea9e(0x196)){_0x57f607(_0x2f0429=>_0x2f0429===0x0?0x1:0x0);return;}if(_0x2a8a9b==='lovrabet-setup-selection'){if(!_0x132f79){_0x3396f4(_0x217c55=>_0x217c55===0x0?0x1:0x0);return;}_0x55ac2b(![]);return;}if(_0x2a8a9b===_0x2bea9e(0x1cb)){_0x18e727(_0x398561=>_0x398561===0x0?0x1:0x0);return;}}if(_0x2a8a9b===_0x2bea9e(0x1ac)&&_0x132f79&&_0x48ce36===0x0){if(_0x18b796[_0x2bea9e(0x1b5)]){_0x23cfd4(_0x5ed403=>_0x5ed403>0x0?_0x5ed403-0x1:UI_IDE_LIST['length']-0x1);return;}if(_0x18b796[_0x2bea9e(0x1ae)]){_0x23cfd4(_0x5f0956=>_0x5f0956<UI_IDE_LIST[_0x2bea9e(0x190)]-0x1?_0x5f0956+0x1:0x0);return;}}if(_0x3ca42d==='\x20'&&_0x2a8a9b===_0x2bea9e(0x1ac)&&_0x132f79&&_0x48ce36===0x0){_0x4b7864(_0x2c7432=>{const _0x529efe=_0x2bea9e,_0x50f14d=new Set(_0x2c7432);return _0x50f14d[_0x529efe(0x19a)](_0x5bf870)?_0x50f14d[_0x529efe(0x1a1)](_0x5bf870):_0x50f14d['add'](_0x5bf870),_0x50f14d;}),_0x5dec5f('');return;}if((_0x3ca42d==='a'||_0x3ca42d==='A')&&_0x2a8a9b===_0x2bea9e(0x1ac)&&_0x132f79&&_0x48ce36===0x0){_0x4b7864(new Set(UI_IDE_LIST['map']((_0x34b166,_0x250fd5)=>_0x250fd5))),_0x5dec5f('');return;}if((_0x3ca42d==='i'||_0x3ca42d==='I'||_0x3ca42d==='r'||_0x3ca42d==='R')&&_0x2a8a9b===_0x2bea9e(0x1ac)&&_0x132f79&&_0x48ce36===0x0){_0x4b7864(_0x3c353c=>{const _0x1ef159=_0x2bea9e,_0x2b8640=new Set();for(let _0x582089=0x0;_0x582089<UI_IDE_LIST[_0x1ef159(0x190)];_0x582089++){!_0x3c353c['has'](_0x582089)&&_0x2b8640[_0x1ef159(0x1c7)](_0x582089);}return _0x2b8640;});return;}if(_0x18b796['return']){if(_0x2a8a9b===_0x2bea9e(0x1cf)){const _0x530ad3=_0x437744[_0x2bea9e(0x1c5)]()||_0x2947ea;if(_0x3a327a)return;if(_0xe4a9de(_0x530ad3)){_0x5976ff(_0x2bea9e(0x1b4)+_0x530ad3+_0x2bea9e(0x181));return;}_0x2e880a(_0x530ad3),_0x5dcc3a([{'step':_0x2bea9e(0x1cf),'label':'项目名','value':_0x530ad3}]),_0x91b738(''),_0x5dec5f(''),_0x5976ff(''),_0x5d3d98(_0x2bea9e(0x198));return;}if(_0x2a8a9b===_0x2bea9e(0x198)){if(_0x3a327a)return;const _0x4087a0=_0x437744[_0x2bea9e(0x1c5)]();_0x360dd5(_0x4087a0),_0x5dcc3a(_0x495729=>[..._0x495729,{'step':_0x2bea9e(0x198),'label':'应用AppCode','value':_0x4087a0||'未设置'}]),_0x91b738(''),_0x5dec5f('');if(_0x4087a0){_0x5d3d98(_0x2bea9e(0x1a3));const _0x5aced8=await _0x2829fe();_0x5aced8?_0x5d3d98(_0x2bea9e(0x196)):_0x5d3d98('login-prompt');}else{const _0x49be4f=_0x50dcbd||_0x1f73d9||_0x2bea9e(0x183);_0x951e1e({'projectName':_0x4f7273,'appCode':undefined,'pullApi':![],'aiSetup':![],'selectedIDEs':[],'env':_0x49be4f}),_0x5d3d98('creating');}return;}if(_0x2a8a9b===_0x2bea9e(0x196)){const _0x137eb0=_0x3e121d===0x0;_0x5261f5(_0x137eb0),_0x5dcc3a(_0x4effc5=>[..._0x4effc5,{'step':_0x2bea9e(0x1a0),'label':_0x2bea9e(0x1bc),'value':_0x137eb0?'是':'否'}]),_0x5d3d98(_0x2bea9e(0x1ac));return;}if(_0x2a8a9b===_0x2bea9e(0x1ac)){if(!_0x132f79){_0x55ac2b(!![]);if(_0x48ce36===0x1){_0x5dcc3a(_0x222c65=>[..._0x222c65,{'step':'lovrabet-setup','label':_0x2bea9e(0x193),'value':'否'}]);const _0x42c901=_0x50dcbd||_0x1f73d9||_0x2bea9e(0x183);_0x951e1e({'projectName':_0x4f7273,'appCode':_0x291920,'pullApi':_0x14bd3a,'aiSetup':![],'selectedIDEs':[],'env':_0x42c901}),_0x5d3d98(_0x2bea9e(0x1a5));}return;}if(_0x39d907['size']===0x0){_0x5dec5f(_0x2bea9e(0x1b7));return;}const _0x14b94b=Array['from'](_0x39d907)['map'](_0x366075=>UI_IDE_LIST[_0x366075])[_0x2bea9e(0x1c3)](_0x1a4b13=>_0x1a4b13!==undefined);_0x5dcc3a(_0x1aab17=>[..._0x1aab17,{'step':_0x2bea9e(0x1c4),'label':_0x2bea9e(0x193),'value':_0x14b94b[_0x2bea9e(0x190)]+'\x20个\x20IDE'}]);const _0x2ea6fe=_0x50dcbd||_0x1f73d9||'online';_0x951e1e({'projectName':_0x4f7273,'appCode':_0x291920,'pullApi':_0x14bd3a,'aiSetup':!![],'selectedIDEs':_0x14b94b,'env':_0x2ea6fe}),_0x5d3d98('creating');return;}if(_0x2a8a9b===_0x2bea9e(0x1cb)){const _0x18ffb1=_0x396b7b===0x0;if(_0x18ffb1){_0x5d3d98(_0x2bea9e(0x18c));const _0x4979c4=await _0x36f8e2();_0x4979c4?(_0x5dcc3a(_0xce0208=>[..._0xce0208,{'step':_0x2bea9e(0x185),'label':_0x2bea9e(0x18f),'value':_0x2bea9e(0x1a7)}]),_0x5d3d98(_0x2bea9e(0x196))):(_0x5dcc3a(_0x358cc0=>[..._0x358cc0,{'step':_0x2bea9e(0x185),'label':_0x2bea9e(0x18f),'value':_0x2bea9e(0x1df)}]),_0x5d3d98(_0x2bea9e(0x1ac)));}else _0x5dcc3a(_0x28dc17=>[..._0x28dc17,{'step':_0x2bea9e(0x185),'label':'登录状态','value':_0x2bea9e(0x1d7)}]),_0x5d3d98('lovrabet-setup-selection');return;}}if(_0x18b796[_0x2bea9e(0x19c)]||_0x18b796[_0x2bea9e(0x1a1)]){_0x91b738(_0x2974d0=>{const _0x257990=_0x2bea9e,_0x293acc=_0x2974d0[_0x257990(0x1d9)](0x0,-0x1);if(_0x2a8a9b===_0x257990(0x1cf)){const {valid:_0x5dcb20,message:_0x27c61b}=_0x535b00(_0x293acc);_0x5dec5f(_0x5dcb20?'':_0x27c61b||'项目名不合法');if(_0x5dcb20&&!_0x3a327a){const _0x1f7da0=_0x293acc||_0x2947ea;_0xe4a9de(_0x1f7da0)?_0x5976ff(_0x257990(0x1b4)+_0x1f7da0+'\x22\x20已存在'):_0x5976ff('');}}else{if(_0x2a8a9b===_0x257990(0x198)){const {valid:_0x498274,message:_0x253568}=_0x1c0e58(_0x293acc);_0x5dec5f(_0x498274?'':_0x253568||'应用AppCode不合法');}}return _0x293acc;});return;}if([_0x2bea9e(0x1a5),_0x2bea9e(0x1a3),'login-process'][_0x2bea9e(0x1b1)](_0x2a8a9b))return;if(_0x2a8a9b===_0x2bea9e(0x196)||_0x2a8a9b===_0x2bea9e(0x1cb)||_0x2a8a9b===_0x2bea9e(0x1ac))return;_0x91b738(_0x1f6b16=>{const _0x484b7d=_0x2bea9e,_0x1c39a4=_0x1f6b16+_0x3ca42d;if(_0x2a8a9b==='project-name'){const {valid:_0x24daf0,message:_0x1a22bd}=_0x535b00(_0x1c39a4);_0x5dec5f(_0x24daf0?'':_0x1a22bd||'项目名不合法');if(_0x24daf0&&!_0x3a327a){const _0x494e56=_0x1c39a4||_0x2947ea;_0xe4a9de(_0x494e56)?_0x5976ff(_0x484b7d(0x1b4)+_0x494e56+_0x484b7d(0x1a2)):_0x5976ff('');}}else{if(_0x2a8a9b==='app-code'){const {valid:_0xfe3306,message:_0x5814c5}=_0x1c0e58(_0x1c39a4);_0x5dec5f(_0xfe3306?'':_0x5814c5||_0x484b7d(0x1c1));}}return _0x1c39a4;});}),a42_0x106683(Box,{'flexDirection':_0x12b557(0x1ba),'marginTop':0x1,'children':[_0x361e83[_0x12b557(0x190)]===0x0&&a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x194),'children':_0x12b557(0x1d4)})}),_0x361e83[_0x12b557(0x1b6)](_0x57be14=>a42_0x106683(Box,{'children':[a42_0x106683(Text,{'color':'green','children':['√\x20',_0x57be14['label'],':\x20']}),a42_0x39a007(Text,{'color':_0x12b557(0x194),'children':_0x57be14[_0x12b557(0x1dc)]})]},_0x57be14['step'])),_0x2a8a9b===_0x12b557(0x1cf)&&a42_0x106683(a42_0x38992f,{'children':[a42_0x106683(Box,{'children':[a42_0x39a007(Text,{'children':_0x12b557(0x199)}),_0x437744?a42_0x39a007(Text,{'color':'green','children':_0x437744}):a42_0x39a007(Text,{'color':'gray','children':_0x2947ea}),_0x3a327a&&a42_0x106683(Text,{'color':_0x12b557(0x197),'children':[_0x12b557(0x1de),_0x3a327a]}),_0x5046a7&&a42_0x106683(Text,{'color':_0x12b557(0x197),'children':[_0x12b557(0x1de),_0x5046a7]})]}),!_0x3a327a&&!_0x5046a7&&!_0x437744&&a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x1c9),'children':'\x20直接回车确认,或输入自定义名称'})})]}),_0x2a8a9b===_0x12b557(0x198)&&a42_0x106683(a42_0x38992f,{'children':[a42_0x106683(Box,{'children':[a42_0x39a007(Text,{'children':_0x12b557(0x192)}),a42_0x39a007(Text,{'color':_0x12b557(0x1c9),'children':_0x12b557(0x1af)}),a42_0x39a007(Text,{'color':_0x12b557(0x1d1),'children':_0x437744}),_0x3a327a&&a42_0x106683(Text,{'color':_0x12b557(0x197),'children':[_0x12b557(0x1de),_0x3a327a]})]}),!_0x3a327a&&a42_0x39a007(Box,{'children':a42_0x106683(Text,{'color':'gray','children':['\x20',_0x12b557(0x18e)]})})]}),_0x2a8a9b===_0x12b557(0x1a3)&&a42_0x106683(Box,{'children':[a42_0x39a007(Text,{'children':_0x12b557(0x186)}),_0x1a547d&&a42_0x39a007(Text,{'color':_0x12b557(0x1c9),'children':_0x12b557(0x1a9)})]}),_0x2a8a9b===_0x12b557(0x196)&&a42_0x106683(a42_0x38992f,{'children':[a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x1d1),'children':'√\x20检测到有效登录状态'})}),a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x39a007(Text,{'children':_0x12b557(0x1c2)})}),a42_0x106683(Box,{'marginLeft':0x2,'children':[a42_0x106683(Text,{'color':_0x3e121d===0x0?_0x12b557(0x1d1):_0x12b557(0x1c9),'children':[_0x3e121d===0x0?'▶\x20':'\x20\x20',_0x12b557(0x1b8)]}),a42_0x39a007(Text,{'children':'\x20'}),a42_0x106683(Text,{'color':_0x3e121d===0x1?_0x12b557(0x1d1):'gray','children':[_0x3e121d===0x1?'▶\x20':'\x20\x20','No']})]}),a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x1b2),'children':_0x12b557(0x1a8)})})]}),_0x2a8a9b===_0x12b557(0x1ac)&&a42_0x106683(a42_0x38992f,{'children':[a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x1d1),'children':'√'})}),a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x39a007(Text,{'children':_0x12b557(0x188)})}),a42_0x106683(Box,{'marginLeft':0x2,'children':[a42_0x106683(Text,{'color':_0x48ce36===0x0?_0x12b557(0x1d1):_0x12b557(0x1c9),'children':[_0x48ce36===0x0?'▶\x20':'\x20\x20',_0x12b557(0x1b8)]}),a42_0x39a007(Text,{'children':'\x20'}),a42_0x106683(Text,{'color':_0x48ce36===0x1?_0x12b557(0x1d1):_0x12b557(0x1c9),'children':[_0x48ce36===0x1?'▶\x20':'\x20\x20','No']})]}),_0x132f79&&_0x48ce36===0x0&&a42_0x106683(a42_0x38992f,{'children':[a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x39a007(Text,{'color':_0x12b557(0x1c9),'children':'\x20\x20使用\x20←→\x20返回修改选择,回车确认\x20IDE'})}),a42_0x106683(Box,{'marginTop':0x1,'flexDirection':_0x12b557(0x1ba),'children':[a42_0x39a007(Text,{'bold':!![],'color':_0x12b557(0x1b2),'children':_0x12b557(0x19b)}),UI_IDE_LIST[_0x12b557(0x1b6)]((_0x169a88,_0x19e000)=>{const _0x378aad=_0x12b557,_0x130432=_0x5bf870===_0x19e000,_0x3f759e=_0x39d907['has'](_0x19e000),_0x3207b9=UI_MCP_IDES[_0x378aad(0x19a)](_0x169a88);return a42_0x39a007(Box,{'children':a42_0x106683(Text,{'backgroundColor':_0x130432?_0x378aad(0x1da):undefined,'color':_0x130432?'white':undefined,'children':['\x20\x20',_0x3f759e?_0x378aad(0x18b):_0x378aad(0x1d8),'\x20',UI_IDE_CONFIGS[_0x169a88]['name'],_0x3207b9&&a42_0x39a007(Text,{'color':_0x130432?_0x378aad(0x1be):_0x378aad(0x194),'children':_0x378aad(0x1bb)}),'\x20',a42_0x106683(Text,{'color':_0x130432?_0x378aad(0x1be):_0x378aad(0x1c9),'dimColor':!_0x130432,'children':['-\x20',UI_IDE_CONFIGS[_0x169a88][_0x378aad(0x182)]]})]})},_0x169a88);}),a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x106683(Text,{'color':_0x12b557(0x1c9),'children':['\x20',_0x12b557(0x187)]})})]})]}),!_0x132f79&&a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x39a007(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),_0x3a327a&&a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x106683(Text,{'color':_0x12b557(0x197),'children':['✗\x20',_0x3a327a]})})]}),_0x2a8a9b===_0x12b557(0x1cb)&&a42_0x106683(a42_0x38992f,{'children':[a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x1b2),'children':_0x12b557(0x1aa)})}),a42_0x39a007(Box,{'marginTop':0x1,'children':a42_0x39a007(Text,{'children':_0x12b557(0x1e1)})}),a42_0x106683(Box,{'marginLeft':0x2,'children':[a42_0x106683(Text,{'color':_0x396b7b===0x0?'green':'gray','children':[_0x396b7b===0x0?'▶\x20':'\x20\x20','Yes']}),a42_0x39a007(Text,{'children':'\x20'}),a42_0x106683(Text,{'color':_0x396b7b===0x1?_0x12b557(0x1d1):_0x12b557(0x1c9),'children':[_0x396b7b===0x1?'▶\x20':'\x20\x20','No']})]}),a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':_0x12b557(0x1c9),'children':_0x12b557(0x195)})})]}),_0x2a8a9b==='login-process'&&a42_0x106683(Box,{'children':[a42_0x39a007(Text,{'children':_0x12b557(0x1a6)}),_0x319e0a&&a42_0x39a007(Text,{'color':'gray','children':'\x20登录中...'})]}),_0x2a8a9b==='creating'&&a42_0x39a007(Box,{'children':a42_0x39a007(Text,{'color':'green','children':_0x12b557(0x1b0)})})]});}
|
|
1
|
+
const a40_0x3b9849=a40_0x35ea;(function(_0x299491,_0x3c9099){const _0x41bbf7=a40_0x35ea,_0x4ac2d5=_0x299491();while(!![]){try{const _0xc5aeb7=parseInt(_0x41bbf7(0x202))/0x1+parseInt(_0x41bbf7(0x1f0))/0x2+parseInt(_0x41bbf7(0x207))/0x3+parseInt(_0x41bbf7(0x1cf))/0x4*(parseInt(_0x41bbf7(0x1d8))/0x5)+parseInt(_0x41bbf7(0x208))/0x6*(parseInt(_0x41bbf7(0x213))/0x7)+-parseInt(_0x41bbf7(0x1d3))/0x8+-parseInt(_0x41bbf7(0x1d2))/0x9;if(_0xc5aeb7===_0x3c9099)break;else _0x4ac2d5['push'](_0x4ac2d5['shift']());}catch(_0xd34edc){_0x4ac2d5['push'](_0x4ac2d5['shift']());}}}(a40_0x5697,0x97e98));function a40_0x5697(){const _0x41f167=['create.steps.login.failed','description','17049555KNcvTb','6035656EIlVMR','create.validation.projectName.dirExistsShort','env','\x20←\x20','create.steps.appCode.label','685BktJEM','trim','login-process','online','column','green','create.steps.login.loggedIn','create.validation.appCode.invalid','length','create.validation.ide.required','create.lovrabetSetup.keyboardShortcuts','create.common.selectHint','create.steps.apiPull.label','create.login.valid','create.validation.projectName.tooLong','create.validation.projectName.invalidFormat','create.steps.lovrabetSetup.label','string','create.input.projectName.hint','create.steps.appCode.notSet','qoder','map','white','step','1515738aEoDaG','create.login.inProgress','resolve','lovrabet-setup','rightArrow','from','label','create.input.appCode.optional','leftArrow','create.input.appCode.label','create.lovrabetSetup.selectIdeTitle','create.input.projectName.label','login','[✓]','codebuddy','create.steps.login.label','create.creating','lovrabet-setup-selection','671460dSOEer','create.steps.lovrabetSetup.ideCount','cline','project-name','confirm-api-pull','1728492dTSKVn','1452yNwCHh','create.apiPull.recommendation','login-prompt','add','[\x20]','return','name','test','includes','agent','cwd','19453sQlARp','creating','Yes','opencode','downArrow','has','create.validation.projectName.dirExists','size','login-check','gray','yellow','create.lovrabetSetup.selectIdeHint','filter','value','create.login.inProgressStatus','cyan','app-code','create.common.yes','create.completedStep','codex','red','create.login.notDetected','antigravity','delete','upArrow','create.lovrabetSetup.confirm','blue','create.validation.projectName.invalid','create.apiPull.confirm','create.common.no','17316qIMryJ'];a40_0x5697=function(){return _0x41f167;};return a40_0x5697();}import{jsx as a40_0x49df4c,jsxs as a40_0x5b897b,Fragment as a40_0x33cf3a}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{existsSync}from'node:fs';import a40_0x561718 from'node:path';function a40_0x35ea(_0x1f1ba7,_0x11dae1){_0x1f1ba7=_0x1f1ba7-0x1cc;const _0x5697df=a40_0x5697();let _0x35ea0a=_0x5697df[_0x1f1ba7];return _0x35ea0a;}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_0x3b9849(0x229),'claude',a40_0x3b9849(0x204),a40_0x3b9849(0x1fe),a40_0x3b9849(0x226),'cursor',a40_0x3b9849(0x216),a40_0x3b9849(0x1ec),'trae','windsurf',a40_0x3b9849(0x211)],UI_MCP_IDES=new Set(Array[a40_0x3b9849(0x1f5)](MCP_IDES));export function EnhancedGuidedCreate(_0x571161){const _0x33502d=a40_0x3b9849,{onCreate:_0x4a05b3,env:_0x17e97f}=_0x571161,{t:_0x54e27c}=useI18n(),[_0x2026c5,_0x34b838]=useState(_0x33502d(0x205)),[_0x36a1e9,_0x1127df]=useState(''),[_0x373e90,_0x2639e7]=useState(''),[_0x1babf2,_0xdf3492]=useState(''),[_0x3000e8,_0x4b2902]=useState(''),[_0x1fc4c0,_0x5b234e]=useState([]),[_0x1e83d3,_0x157fa9]=useState(null),[_0x1c81f4,_0x5c2ded]=useState(![]),[_0x96a14,_0xf8f73c]=useState(![]),[_0x372ed9,_0x162a3c]=useState(![]),[_0x111d2c,_0x2cc160]=useState(0x0),[_0x5d4273,_0x5f1a7c]=useState(0x0),[_0x492990,_0x5ed692]=useState(0x0),[_0x51a74c,_0x4a9c09]=useState(![]),[_0x2c2258,_0x27edbf]=useState(new Set()),[_0xfbc290,_0x154e4b]=useState(0x0),[_0x5865a6,_0xa6b8d5]=useState(''),_0x59aca9='my-app',_0x592923=readConfig(),_0x2ac146=typeof _0x592923[_0x33502d(0x1d5)]===_0x33502d(0x1e9)?_0x592923[_0x33502d(0x1d5)]:undefined;function _0x39b892(_0x3e2d0e){const _0x434d09=_0x33502d,_0x537876=_0x3e2d0e||_0x59aca9,_0x2025ae=a40_0x561718[_0x434d09(0x1f2)](process[_0x434d09(0x212)](),_0x537876);return existsSync(_0x2025ae);}function _0x50ca12(_0x2b0b02){const _0x42bdf7=_0x33502d;if(_0x2b0b02[_0x42bdf7(0x1e0)]>0x32)return{'valid':![],'message':_0x54e27c(_0x42bdf7(0x1e6))};const _0x4d14f2=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x2b0b02?.[_0x42bdf7(0x1d9)]()&&!_0x4d14f2[_0x42bdf7(0x20f)](_0x2b0b02))return{'valid':![],'message':_0x54e27c(_0x42bdf7(0x1e7))};return{'valid':!![]};}function _0x310414(_0x29d3ec){const _0x1fe35c=_0x33502d;if(!_0x29d3ec[_0x1fe35c(0x1d9)]())return{'valid':!![]};if(_0x29d3ec['length']>0x64)return{'valid':![],'message':_0x54e27c('create.validation.appCode.tooLong')};const _0x5b408b=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x5b408b['test'](_0x29d3ec))return{'valid':![],'message':_0x54e27c('create.validation.appCode.invalidFormat')};return{'valid':!![]};}async function _0x46abcd(){_0x5c2ded(!![]);try{const _0x3c0d2f=await getIsSessionValid();return _0x157fa9(_0x3c0d2f),_0x3c0d2f;}catch(_0x51b92b){return _0x157fa9(![]),![];}finally{_0x5c2ded(![]);}}async function _0x356083(){_0xf8f73c(!![]);try{const _0x4e9bc3=await authServer({'silent':!![]});return _0x157fa9(_0x4e9bc3),_0x4e9bc3;}catch(_0x26fad5){return _0x157fa9(![]),![];}finally{_0xf8f73c(![]);}}return useInput(async(_0x34b89e,_0x1c37e1)=>{const _0x428ae3=_0x33502d;if(_0x1c37e1[_0x428ae3(0x1f8)]||_0x1c37e1[_0x428ae3(0x1f4)]){if(_0x2026c5===_0x428ae3(0x206)){_0x2cc160(_0x2274fe=>_0x2274fe===0x0?0x1:0x0);return;}if(_0x2026c5===_0x428ae3(0x201)){if(!_0x51a74c){_0x5ed692(_0x3db158=>_0x3db158===0x0?0x1:0x0);return;}_0x4a9c09(![]);return;}if(_0x2026c5===_0x428ae3(0x20a)){_0x5f1a7c(_0x28f6ed=>_0x28f6ed===0x0?0x1:0x0);return;}}if(_0x2026c5==='lovrabet-setup-selection'&&_0x51a74c&&_0x492990===0x0){if(_0x1c37e1[_0x428ae3(0x22b)]){_0x154e4b(_0x52caa0=>_0x52caa0>0x0?_0x52caa0-0x1:UI_IDE_LIST[_0x428ae3(0x1e0)]-0x1);return;}if(_0x1c37e1[_0x428ae3(0x217)]){_0x154e4b(_0x5c30ce=>_0x5c30ce<UI_IDE_LIST[_0x428ae3(0x1e0)]-0x1?_0x5c30ce+0x1:0x0);return;}}if(_0x34b89e==='\x20'&&_0x2026c5===_0x428ae3(0x201)&&_0x51a74c&&_0x492990===0x0){_0x27edbf(_0x5ba147=>{const _0xaa055=new Set(_0x5ba147);return _0xaa055['has'](_0xfbc290)?_0xaa055['delete'](_0xfbc290):_0xaa055['add'](_0xfbc290),_0xaa055;}),_0x4b2902('');return;}if((_0x34b89e==='a'||_0x34b89e==='A')&&_0x2026c5===_0x428ae3(0x201)&&_0x51a74c&&_0x492990===0x0){_0x27edbf(new Set(UI_IDE_LIST[_0x428ae3(0x1ed)]((_0x5c212f,_0x59971a)=>_0x59971a))),_0x4b2902('');return;}if((_0x34b89e==='i'||_0x34b89e==='I'||_0x34b89e==='r'||_0x34b89e==='R')&&_0x2026c5===_0x428ae3(0x201)&&_0x51a74c&&_0x492990===0x0){_0x27edbf(_0x4d5bf6=>{const _0x12fa8b=_0x428ae3,_0x1da73d=new Set();for(let _0x520532=0x0;_0x520532<UI_IDE_LIST[_0x12fa8b(0x1e0)];_0x520532++){!_0x4d5bf6['has'](_0x520532)&&_0x1da73d[_0x12fa8b(0x20b)](_0x520532);}return _0x1da73d;});return;}if(_0x1c37e1[_0x428ae3(0x20d)]){if(_0x2026c5==='project-name'){const _0x30171e=_0x1babf2['trim']()||_0x59aca9;if(_0x3000e8)return;if(_0x39b892(_0x30171e)){_0xa6b8d5(_0x54e27c(_0x428ae3(0x219),{'name':_0x30171e}));return;}_0x1127df(_0x30171e),_0x5b234e([{'step':_0x428ae3(0x205),'label':_0x54e27c('create.steps.projectName.label'),'value':_0x30171e}]),_0xdf3492(''),_0x4b2902(''),_0xa6b8d5(''),_0x34b838('app-code');return;}if(_0x2026c5===_0x428ae3(0x223)){if(_0x3000e8)return;const _0x51eede=_0x1babf2[_0x428ae3(0x1d9)]();_0x2639e7(_0x51eede),_0x5b234e(_0x3a8b35=>[..._0x3a8b35,{'step':_0x428ae3(0x223),'label':_0x54e27c(_0x428ae3(0x1d7)),'value':_0x51eede||_0x54e27c(_0x428ae3(0x1eb))}]),_0xdf3492(''),_0x4b2902('');if(_0x51eede){_0x34b838(_0x428ae3(0x21b));const _0x1f1661=await _0x46abcd();_0x1f1661?_0x34b838(_0x428ae3(0x206)):_0x34b838(_0x428ae3(0x20a));}else{const _0x510b0b=_0x17e97f||_0x2ac146||_0x428ae3(0x1db);_0x4a05b3({'projectName':_0x36a1e9,'appCode':undefined,'pullApi':![],'aiSetup':![],'selectedIDEs':[],'env':_0x510b0b}),_0x34b838(_0x428ae3(0x214));}return;}if(_0x2026c5===_0x428ae3(0x206)){const _0x1b6cf0=_0x111d2c===0x0;_0x162a3c(_0x1b6cf0),_0x5b234e(_0x48611a=>[..._0x48611a,{'step':'api-pull','label':_0x54e27c(_0x428ae3(0x1e4)),'value':_0x1b6cf0?_0x54e27c(_0x428ae3(0x224)):_0x54e27c(_0x428ae3(0x1ce))}]),_0x34b838(_0x428ae3(0x201));return;}if(_0x2026c5==='lovrabet-setup-selection'){if(!_0x51a74c){_0x4a9c09(!![]);if(_0x492990===0x1){_0x5b234e(_0xbe4e5=>[..._0xbe4e5,{'step':_0x428ae3(0x1f3),'label':_0x54e27c(_0x428ae3(0x1e8)),'value':_0x54e27c('create.common.no')}]);const _0x5a9ca1=_0x17e97f||_0x2ac146||_0x428ae3(0x1db);_0x4a05b3({'projectName':_0x36a1e9,'appCode':_0x373e90,'pullApi':_0x372ed9,'aiSetup':![],'selectedIDEs':[],'env':_0x5a9ca1}),_0x34b838(_0x428ae3(0x214));}return;}if(_0x2c2258[_0x428ae3(0x21a)]===0x0){_0x4b2902(_0x54e27c(_0x428ae3(0x1e1)));return;}const _0x1fe798=Array[_0x428ae3(0x1f5)](_0x2c2258)[_0x428ae3(0x1ed)](_0x52ffd5=>UI_IDE_LIST[_0x52ffd5])[_0x428ae3(0x21f)](_0x24c1ce=>_0x24c1ce!==undefined);_0x5b234e(_0x4804c5=>[..._0x4804c5,{'step':_0x428ae3(0x1f3),'label':_0x54e27c('create.steps.lovrabetSetup.label'),'value':_0x54e27c(_0x428ae3(0x203),{'count':_0x1fe798[_0x428ae3(0x1e0)]})}]);const _0x17d603=_0x17e97f||_0x2ac146||_0x428ae3(0x1db);_0x4a05b3({'projectName':_0x36a1e9,'appCode':_0x373e90,'pullApi':_0x372ed9,'aiSetup':!![],'selectedIDEs':_0x1fe798,'env':_0x17d603}),_0x34b838(_0x428ae3(0x214));return;}if(_0x2026c5===_0x428ae3(0x20a)){const _0x3b8ced=_0x5d4273===0x0;if(_0x3b8ced){_0x34b838(_0x428ae3(0x1da));const _0x484395=await _0x356083();_0x484395?(_0x5b234e(_0x1165df=>[..._0x1165df,{'step':_0x428ae3(0x1fc),'label':_0x54e27c(_0x428ae3(0x1ff)),'value':_0x54e27c(_0x428ae3(0x1de))}]),_0x34b838('confirm-api-pull')):(_0x5b234e(_0x4b8691=>[..._0x4b8691,{'step':_0x428ae3(0x1fc),'label':_0x54e27c('create.steps.login.label'),'value':_0x54e27c(_0x428ae3(0x1d0))}]),_0x34b838(_0x428ae3(0x201)));}else _0x5b234e(_0x2cbc75=>[..._0x2cbc75,{'step':'login','label':_0x54e27c(_0x428ae3(0x1ff)),'value':_0x54e27c('create.steps.login.skipped')}]),_0x34b838('lovrabet-setup-selection');return;}}if(_0x1c37e1['backspace']||_0x1c37e1[_0x428ae3(0x22a)]){_0xdf3492(_0x424430=>{const _0x801896=_0x428ae3,_0x48380e=_0x424430['slice'](0x0,-0x1);if(_0x2026c5===_0x801896(0x205)){const {valid:_0x8a8b62,message:_0xfc8041}=_0x50ca12(_0x48380e);_0x4b2902(_0x8a8b62?'':_0xfc8041||_0x54e27c(_0x801896(0x1cc)));if(_0x8a8b62&&!_0x3000e8){const _0x3d9808=_0x48380e||_0x59aca9;_0x39b892(_0x3d9808)?_0xa6b8d5(_0x54e27c(_0x801896(0x1d4),{'name':_0x3d9808})):_0xa6b8d5('');}}else{if(_0x2026c5==='app-code'){const {valid:_0x411e7f,message:_0x41b46d}=_0x310414(_0x48380e);_0x4b2902(_0x411e7f?'':_0x41b46d||_0x54e27c(_0x801896(0x1df)));}}return _0x48380e;});return;}if([_0x428ae3(0x214),_0x428ae3(0x21b),_0x428ae3(0x1da)][_0x428ae3(0x210)](_0x2026c5))return;if(_0x2026c5===_0x428ae3(0x206)||_0x2026c5===_0x428ae3(0x20a)||_0x2026c5===_0x428ae3(0x201))return;_0xdf3492(_0x20e384=>{const _0x4f875c=_0x428ae3,_0x2de2be=_0x20e384+_0x34b89e;if(_0x2026c5===_0x4f875c(0x205)){const {valid:_0x1f5b1f,message:_0x58d7f6}=_0x50ca12(_0x2de2be);_0x4b2902(_0x1f5b1f?'':_0x58d7f6||_0x54e27c(_0x4f875c(0x1cc)));if(_0x1f5b1f&&!_0x3000e8){const _0x5a44e5=_0x2de2be||_0x59aca9;_0x39b892(_0x5a44e5)?_0xa6b8d5(_0x54e27c(_0x4f875c(0x1d4),{'name':_0x5a44e5})):_0xa6b8d5('');}}else{if(_0x2026c5===_0x4f875c(0x223)){const {valid:_0x13eaba,message:_0x37b613}=_0x310414(_0x2de2be);_0x4b2902(_0x13eaba?'':_0x37b613||_0x54e27c(_0x4f875c(0x1df)));}}return _0x2de2be;});}),a40_0x5b897b(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x1fc4c0[_0x33502d(0x1e0)]===0x0&&a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x222),'children':_0x54e27c('create.title')})}),_0x1fc4c0[_0x33502d(0x1ed)](_0x50cacc=>a40_0x5b897b(Box,{'children':[a40_0x49df4c(Text,{'color':_0x33502d(0x1dd),'children':_0x54e27c(_0x33502d(0x225),{'label':_0x50cacc[_0x33502d(0x1f6)]})}),a40_0x49df4c(Text,{'color':_0x33502d(0x222),'children':_0x50cacc[_0x33502d(0x220)]})]},_0x50cacc[_0x33502d(0x1ef)])),_0x2026c5===_0x33502d(0x205)&&a40_0x5b897b(a40_0x33cf3a,{'children':[a40_0x5b897b(Box,{'children':[a40_0x49df4c(Text,{'children':_0x54e27c(_0x33502d(0x1fb))}),_0x1babf2?a40_0x49df4c(Text,{'color':_0x33502d(0x1dd),'children':_0x1babf2}):a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x59aca9}),_0x3000e8&&a40_0x5b897b(Text,{'color':_0x33502d(0x227),'children':[_0x33502d(0x1d6),_0x3000e8]}),_0x5865a6&&a40_0x5b897b(Text,{'color':_0x33502d(0x227),'children':[_0x33502d(0x1d6),_0x5865a6]})]}),!_0x3000e8&&!_0x5865a6&&!_0x1babf2&&a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x1ea))})})]}),_0x2026c5===_0x33502d(0x223)&&a40_0x5b897b(a40_0x33cf3a,{'children':[a40_0x5b897b(Box,{'children':[a40_0x49df4c(Text,{'children':_0x54e27c(_0x33502d(0x1f9))}),a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x1f7))}),a40_0x49df4c(Text,{'color':'green','children':_0x1babf2}),_0x3000e8&&a40_0x5b897b(Text,{'color':'red','children':[_0x33502d(0x1d6),_0x3000e8]})]}),!_0x3000e8&&a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':'gray','children':_0x54e27c('create.input.appCode.hint')})})]}),_0x2026c5===_0x33502d(0x21b)&&a40_0x5b897b(Box,{'children':[a40_0x49df4c(Text,{'children':_0x54e27c('create.login.checking')}),_0x1c81f4&&a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c('create.login.checkingStatus')})]}),_0x2026c5===_0x33502d(0x206)&&a40_0x5b897b(a40_0x33cf3a,{'children':[a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x1dd),'children':_0x54e27c(_0x33502d(0x1e5))})}),a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x49df4c(Text,{'children':_0x54e27c(_0x33502d(0x1cd))})}),a40_0x5b897b(Box,{'marginLeft':0x2,'children':[a40_0x5b897b(Text,{'color':_0x111d2c===0x0?'green':_0x33502d(0x21c),'children':[_0x111d2c===0x0?'▶\x20':'\x20\x20',_0x33502d(0x215)]}),a40_0x49df4c(Text,{'children':'\x20'}),a40_0x5b897b(Text,{'color':_0x111d2c===0x1?'green':'gray','children':[_0x111d2c===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x1e3))})}),a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':'yellow','children':_0x54e27c(_0x33502d(0x209))})})]}),_0x2026c5===_0x33502d(0x201)&&a40_0x5b897b(a40_0x33cf3a,{'children':[a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x1dd),'children':'√'})}),a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x49df4c(Text,{'children':_0x54e27c(_0x33502d(0x22c))})}),a40_0x5b897b(Box,{'marginLeft':0x2,'children':[a40_0x5b897b(Text,{'color':_0x492990===0x0?_0x33502d(0x1dd):_0x33502d(0x21c),'children':[_0x492990===0x0?'▶\x20':'\x20\x20',_0x33502d(0x215)]}),a40_0x49df4c(Text,{'children':'\x20'}),a40_0x5b897b(Text,{'color':_0x492990===0x1?_0x33502d(0x1dd):_0x33502d(0x21c),'children':[_0x492990===0x1?'▶\x20':'\x20\x20','No']})]}),_0x51a74c&&_0x492990===0x0&&a40_0x5b897b(a40_0x33cf3a,{'children':[a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x21e))})}),a40_0x5b897b(Box,{'marginTop':0x1,'flexDirection':_0x33502d(0x1dc),'children':[a40_0x49df4c(Text,{'bold':!![],'color':_0x33502d(0x21d),'children':_0x54e27c(_0x33502d(0x1fa))}),UI_IDE_LIST[_0x33502d(0x1ed)]((_0x489dfa,_0x509fbf)=>{const _0x3b3edb=_0x33502d,_0x3087e7=_0xfbc290===_0x509fbf,_0x3a2f82=_0x2c2258[_0x3b3edb(0x218)](_0x509fbf),_0x3c84ca=UI_MCP_IDES[_0x3b3edb(0x218)](_0x489dfa);return a40_0x49df4c(Box,{'children':a40_0x5b897b(Text,{'backgroundColor':_0x3087e7?_0x3b3edb(0x22d):undefined,'color':_0x3087e7?'white':undefined,'children':['\x20\x20',_0x3a2f82?_0x3b3edb(0x1fd):_0x3b3edb(0x20c),'\x20',UI_IDE_CONFIGS[_0x489dfa][_0x3b3edb(0x20e)],_0x3c84ca&&a40_0x49df4c(Text,{'color':_0x3087e7?_0x3b3edb(0x1ee):_0x3b3edb(0x222),'children':'\x20+MCP'}),'\x20',a40_0x5b897b(Text,{'color':_0x3087e7?_0x3b3edb(0x1ee):_0x3b3edb(0x21c),'dimColor':!_0x3087e7,'children':['-\x20',UI_IDE_CONFIGS[_0x489dfa][_0x3b3edb(0x1d1)]]})]})},_0x489dfa);}),a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x1e2))})})]})]}),!_0x51a74c&&a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x1e3))})}),_0x3000e8&&a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x5b897b(Text,{'color':_0x33502d(0x227),'children':['✗\x20',_0x3000e8]})})]}),_0x2026c5===_0x33502d(0x20a)&&a40_0x5b897b(a40_0x33cf3a,{'children':[a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21d),'children':_0x54e27c(_0x33502d(0x228))})}),a40_0x49df4c(Box,{'marginTop':0x1,'children':a40_0x49df4c(Text,{'children':_0x54e27c('create.login.prompt')})}),a40_0x5b897b(Box,{'marginLeft':0x2,'children':[a40_0x5b897b(Text,{'color':_0x5d4273===0x0?_0x33502d(0x1dd):_0x33502d(0x21c),'children':[_0x5d4273===0x0?'▶\x20':'\x20\x20',_0x33502d(0x215)]}),a40_0x49df4c(Text,{'children':'\x20'}),a40_0x5b897b(Text,{'color':_0x5d4273===0x1?_0x33502d(0x1dd):_0x33502d(0x21c),'children':[_0x5d4273===0x1?'▶\x20':'\x20\x20','No']})]}),a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x1e3))})})]}),_0x2026c5===_0x33502d(0x1da)&&a40_0x5b897b(Box,{'children':[a40_0x49df4c(Text,{'children':_0x54e27c(_0x33502d(0x1f1))}),_0x96a14&&a40_0x49df4c(Text,{'color':_0x33502d(0x21c),'children':_0x54e27c(_0x33502d(0x221))})]}),_0x2026c5===_0x33502d(0x214)&&a40_0x49df4c(Box,{'children':a40_0x49df4c(Text,{'color':_0x33502d(0x1dd),'children':_0x54e27c(_0x33502d(0x200))})})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3400b1,_0x4edd8b){const _0x12e179=a41_0xf161,_0x4324c2=_0x3400b1();while(!![]){try{const _0x25a84b=parseInt(_0x12e179(0x1c7))/0x1+-parseInt(_0x12e179(0x1cb))/0x2+parseInt(_0x12e179(0x1c9))/0x3+parseInt(_0x12e179(0x1c8))/0x4+parseInt(_0x12e179(0x1cc))/0x5+-parseInt(_0x12e179(0x1c5))/0x6+-parseInt(_0x12e179(0x1c6))/0x7;if(_0x25a84b===_0x4edd8b)break;else _0x4324c2['push'](_0x4324c2['shift']());}catch(_0xf4af29){_0x4324c2['push'](_0x4324c2['shift']());}}}(a41_0x120d,0x3bc40));export function formatElapsed(_0x6515bf){const _0x22a56d=a41_0xf161,_0x223257=Date[_0x22a56d(0x1c4)]()-_0x6515bf;if(_0x223257<0x3e8)return _0x223257+'ms';const _0x2346cf=(_0x223257/0x3e8)[_0x22a56d(0x1ca)](0x2),_0x558443=_0x2346cf[_0x22a56d(0x1cd)](/\.?0+$/u,'');return _0x558443+'s';}function a41_0xf161(_0x5c4659,_0x4b42d){_0x5c4659=_0x5c4659-0x1c4;const _0x120d2a=a41_0x120d();let _0xf1615=_0x120d2a[_0x5c4659];return _0xf1615;}function a41_0x120d(){const _0x57ebd7=['1601095ztTHWY','replace','now','524580NCxfPd','6130250PJkXwj','263028AkYsGo','1853512BLhTzp','1354554ZSbtgY','toFixed','580326dlDLek'];a41_0x120d=function(){return _0x57ebd7;};return a41_0x120d();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x556f76,_0x581e98){const _0x48b0d0=a44_0x3c97,_0x18301e=_0x556f76();while(!![]){try{const _0x1d4303=parseInt(_0x48b0d0(0x132))/0x1+parseInt(_0x48b0d0(0x13e))/0x2+-parseInt(_0x48b0d0(0x143))/0x3+-parseInt(_0x48b0d0(0x151))/0x4+-parseInt(_0x48b0d0(0x13d))/0x5*(parseInt(_0x48b0d0(0x17e))/0x6)+-parseInt(_0x48b0d0(0x170))/0x7*(parseInt(_0x48b0d0(0x172))/0x8)+parseInt(_0x48b0d0(0x12f))/0x9;if(_0x1d4303===_0x581e98)break;else _0x18301e['push'](_0x18301e['shift']());}catch(_0x2616ba){_0x18301e['push'](_0x18301e['shift']());}}}(a44_0x4dee,0xeba14));import{jsx as a44_0x47b470,Fragment as a44_0x5e98d8,jsxs as a44_0x28b5d1}from'react/jsx-runtime';import a44_0x2f616d from'path';import a44_0x18f95e from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a44_0x3c97(_0x67306f,_0x40e2c3){_0x67306f=_0x67306f-0x112;const _0x4dee99=a44_0x4dee();let _0x3c97c7=_0x4dee99[_0x67306f];return _0x3c97c7;}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';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';function a44_0x4dee(){const _0x3b1adc=['更新\x20package.json\x20失败','Claude\x20Code','warn','needsUpgrade','map','API\x20配置拉取成功:\x20','../..','push','*\x20清理失败的项目目录:\x20','projectName','配置AppCode:\x20','online','cyan','\x20\x20✗\x20Skill\x20','\x20\x20•\x20Skill:\x20','lovrabet\x20skill\x20install','currentVersion','\x20&&\x20lovrabet\x20start','\x20MCP\x20','√\x20API\x20配置拉取完成','stableVersion','√\x20package.json\x20已更新:\x20name=','description','\x20已存在,请使用其他项目名','21729789eyERoR','yellow','W_OK','1438471qvAIJN','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','cd\x20','CLI\x20版本检查','*\x20正在为项目\x20','name','manual','\x20|\x20应用AppCode:\x20','doTask','gray','create','5777405TEVfhL','3074758YJxbgw','1.\x20配置\x20Lovrabet\x20MCP\x20和\x20Skill','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','\x20Generated\x20by\x20lovrabet\x20cli\x20','toLocaleString','2425569VuJxLu','writeFileSync','cursor','更新\x20package.json\x20name','projectCode','项目创建失败:\x20','trim','开始创建项目:\x20','skill-','utf8','status','log','join','×\x20项目创建失败:\x20','6387236nfIBEH','拉取API配置:\x20','✓\x20MCP\x20服务器配置完成:','API\x20配置拉取失败:\x20','green','×\x20项目名不能为空','启动项目:\x20','version','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','dirname','message','appCode','1.0.0','cwd','selectedIDEs','error','repeat','parse','\x20√\x20','ide','red','mcp','env','2.\x20','√\x20配置文件已创建,应用AppCode:\x20','\x20Skill\x20','skill','white','配置应用AppCode失败','\x20\x20✗\x20MCP\x20','info','42nNxLXE','existsSync','1152424OesSMq','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','lovrabet\x20config\x20set\x20appcode\x20[app-code]','stringify','*\x20正在配置\x20Lovrabet\x20MCP\x20和\x20Skill...','\x20配置应用AppCode:\x20','🚀\x20接下来:','Cursor','then','lovrabet\x20mcp\x20install','length','lovrabet\x20api\x20pull','6YGboiL','resolve','*\x20正在拉取\x20API\x20配置...','×\x20无法在当前目录创建项目,请检查目录权限','readFileSync','package.json','清理项目目录失败:\x20','pullApi','filter','\x20创建配置文件','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','setLogPath','项目名称:\x20','\x20\x20•\x20MCP\x20服务器:\x20','success','3.\x20','×\x20项目名过长,最多支持\x20100\x20个字符','.lovrabetrc'];a44_0x4dee=function(){return _0x3b1adc;};return a44_0x4dee();}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';export function CreateApp(_0x2c38c8){const _0x1b4b59=a44_0x3c97,[_0x4079cb,_0x5edd57]=useState(![]),[_0x5bc5df,_0x3f332c]=useState(![]),[_0x44113c,_0x2417c1]=useState(null),[_0x585443,_0x53b016]=useState(null),_0x216194=useCopyProjectTemplate(),_0x273e90=useInstallDependencies(),_0x4a4446=useFormatCode();useEffect(()=>{const _0x4b7b33=a44_0x3c97;checkCliVersion()[_0x4b7b33(0x17a)](_0x57e9c6=>{const _0x11fd71=_0x4b7b33;_0x57e9c6[_0x11fd71(0x11a)]&&(printCliUpgradeWarning(_0x57e9c6),logger[_0x11fd71(0x16f)](_0x11fd71(0x13c),_0x11fd71(0x135),{'currentVersion':_0x57e9c6[_0x11fd71(0x127)],'stableVersion':_0x57e9c6[_0x11fd71(0x12b)],'needsUpgrade':_0x57e9c6[_0x11fd71(0x11a)]}));});},[]);const _0xe31ece=async _0x153e74=>{const _0x3d016f=a44_0x3c97;if(!_0x153e74[_0x3d016f(0x120)]||_0x153e74['projectName'][_0x3d016f(0x149)]()===''){console[_0x3d016f(0x160)](_0x3d016f(0x156));return;}const _0x34f591=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x34f591['test'](_0x153e74['projectName'])){console[_0x3d016f(0x160)](_0x3d016f(0x173));return;}if(_0x153e74[_0x3d016f(0x120)][_0x3d016f(0x17c)]>0x64){console[_0x3d016f(0x160)](_0x3d016f(0x115));return;}const _0x4d45a6=a44_0x2f616d[_0x3d016f(0x17f)](process['cwd'](),_0x153e74[_0x3d016f(0x120)]);if(a44_0x18f95e[_0x3d016f(0x171)](_0x4d45a6)){console[_0x3d016f(0x160)]('×\x20项目目录\x20'+_0x153e74[_0x3d016f(0x120)]+_0x3d016f(0x12e));return;}try{const _0x250248=a44_0x2f616d[_0x3d016f(0x15a)](_0x4d45a6);a44_0x18f95e['accessSync'](_0x250248,a44_0x18f95e['constants'][_0x3d016f(0x131)]);}catch(_0x3cb1ba){console['error'](_0x3d016f(0x181));return;}_0x2417c1(_0x153e74),_0x5edd57(!![]),logger[_0x3d016f(0x18a)](_0x4d45a6),logger['info'](_0x3d016f(0x13c),_0x3d016f(0x14a)+_0x153e74[_0x3d016f(0x120)],{'projectDir':_0x4d45a6,'appCode':_0x153e74[_0x3d016f(0x15c)]});try{await _0x216194['doTask'](_0x153e74[_0x3d016f(0x120)]),await _0x13f58d(_0x153e74[_0x3d016f(0x120)]),await _0x273e90[_0x3d016f(0x13a)](_0x153e74[_0x3d016f(0x120)]),await _0x4a4446[_0x3d016f(0x13a)](_0x153e74['projectName']),await _0x3e9432(_0x153e74['projectName'],_0x153e74[_0x3d016f(0x15c)]||'',_0x153e74[_0x3d016f(0x167)]);if(_0x153e74['pullApi']&&_0x153e74['appCode']){console[_0x3d016f(0x14e)](_0x3d016f(0x180));try{const _0x3d4fd4=await pullApiSilent(_0x153e74[_0x3d016f(0x15c)],undefined,_0x4d45a6,_0x153e74[_0x3d016f(0x167)]);_0x3d4fd4?(console[_0x3d016f(0x14e)](_0x3d016f(0x12a)),logger['info']('create',_0x3d016f(0x11c)+_0x153e74[_0x3d016f(0x15c)])):(console['log'](_0x3d016f(0x159)),logger[_0x3d016f(0x119)](_0x3d016f(0x13c),_0x3d016f(0x154)+_0x153e74[_0x3d016f(0x15c)]));}catch(_0x2e45df){console['log'](_0x3d016f(0x188)),logger[_0x3d016f(0x119)](_0x3d016f(0x13c),'API\x20配置拉取异常',{'error':_0x2e45df instanceof Error?_0x2e45df[_0x3d016f(0x15b)]:String(_0x2e45df)});}}if(_0x153e74['aiSetup']&&_0x153e74[_0x3d016f(0x15f)]&&_0x153e74[_0x3d016f(0x15f)][_0x3d016f(0x17c)]>0x0&&_0x153e74['appCode']){console[_0x3d016f(0x14e)](_0x3d016f(0x176));const _0x31db9e=[],_0x242b9d=[],_0x51311a=_0x153e74[_0x3d016f(0x15f)][_0x3d016f(0x186)](_0x201596=>MCP_IDES['has'](_0x201596)),_0xbf32bd=_0x153e74[_0x3d016f(0x15f)];for(const _0x5789b8 of _0x51311a){try{const _0x5ed53f=await configureMcp(_0x5789b8,_0x4d45a6);_0x31db9e[_0x3d016f(0x11e)]({'ide':_0x5789b8===_0x3d016f(0x145)?_0x3d016f(0x179):'Claude\x20Code','status':_0x5ed53f['status'],'message':_0x5ed53f['message']}),console[_0x3d016f(0x14e)]('\x20\x20'+(_0x5ed53f[_0x3d016f(0x14d)]===_0x3d016f(0x113)?'✓':_0x5ed53f[_0x3d016f(0x14d)]===_0x3d016f(0x138)?'⚠️':'✗')+_0x3d016f(0x129)+_0x5789b8+':\x20'+_0x5ed53f[_0x3d016f(0x15b)]);}catch(_0x298156){_0x31db9e['push']({'ide':_0x5789b8===_0x3d016f(0x145)?'Cursor':_0x3d016f(0x118),'status':_0x3d016f(0x160),'message':_0x298156 instanceof Error?_0x298156[_0x3d016f(0x15b)]:String(_0x298156)}),console[_0x3d016f(0x14e)](_0x3d016f(0x16e)+_0x5789b8+':\x20'+(_0x298156 instanceof Error?_0x298156[_0x3d016f(0x15b)]:String(_0x298156)));}}await copySharedSkills(_0x4d45a6);for(const _0x29b629 of _0xbf32bd){try{const _0x5c10d0=await installSkill(_0x29b629,_0x4d45a6);_0x242b9d['push']({'ide':_0x5c10d0[_0x3d016f(0x164)],'status':_0x5c10d0[_0x3d016f(0x14d)],'message':_0x5c10d0[_0x3d016f(0x15b)]}),console[_0x3d016f(0x14e)]('\x20\x20'+(_0x5c10d0[_0x3d016f(0x14d)]===_0x3d016f(0x113)?'✓':'✗')+_0x3d016f(0x16a)+_0x5c10d0[_0x3d016f(0x164)]+':\x20'+_0x5c10d0[_0x3d016f(0x15b)]);}catch(_0xefabf0){_0x242b9d['push']({'ide':_0x29b629,'status':_0x3d016f(0x160),'message':_0xefabf0 instanceof Error?_0xefabf0['message']:String(_0xefabf0)}),console['log'](_0x3d016f(0x124)+_0x29b629+':\x20'+(_0xefabf0 instanceof Error?_0xefabf0[_0x3d016f(0x15b)]:String(_0xefabf0)));}}if(_0x242b9d[_0x3d016f(0x17c)]>0x0){const _0x3e764d=_0x242b9d[_0x3d016f(0x186)](_0x770db9=>_0x770db9[_0x3d016f(0x14d)]===_0x3d016f(0x113))[_0x3d016f(0x11b)](_0x334f4f=>_0x334f4f[_0x3d016f(0x164)]);_0x3e764d[_0x3d016f(0x17c)]>0x0&&createSkillManifest(_0x4d45a6,_0x3e764d);}_0x53b016({'mcp':_0x31db9e,'skill':_0x242b9d}),console[_0x3d016f(0x14e)]('√\x20Lovrabet\x20MCP\x20和\x20Skill\x20配置完成');}logger['success'](_0x3d016f(0x13c),'项目创建完成:\x20'+_0x153e74[_0x3d016f(0x120)]),_0x3f332c(!![]),_0x5edd57(![]);}catch(_0x1d535b){logger['error'](_0x3d016f(0x13c),_0x3d016f(0x148)+_0x153e74[_0x3d016f(0x120)],{'error':_0x1d535b instanceof Error?_0x1d535b['message']:String(_0x1d535b)});try{a44_0x18f95e[_0x3d016f(0x171)](_0x4d45a6)&&(console[_0x3d016f(0x14e)](_0x3d016f(0x11f)+_0x4d45a6),a44_0x18f95e['rmSync'](_0x4d45a6,{'recursive':!![],'force':!![]}));}catch(_0x577955){logger[_0x3d016f(0x119)](_0x3d016f(0x13c),_0x3d016f(0x184)+_0x4d45a6);}_0x5edd57(![]),console[_0x3d016f(0x160)](_0x3d016f(0x150)+(_0x1d535b instanceof Error?_0x1d535b[_0x3d016f(0x15b)]:String(_0x1d535b)));}},_0x5c241a=async _0xb365e9=>{const _0x1667db=a44_0x3c97;await _0xe31ece({'projectName':_0xb365e9,'env':_0x2c38c8[_0x1667db(0x167)]});},_0x13f58d=async _0x1753f3=>{const _0x3860c=a44_0x3c97,_0x1bfa1b=a44_0x2f616d['resolve'](process[_0x3860c(0x15e)](),_0x1753f3),_0x44309b=a44_0x2f616d[_0x3860c(0x14f)](_0x1bfa1b,_0x3860c(0x183));try{console[_0x3860c(0x14e)](_0x3860c(0x189));const _0x172a4e=fileURLToPath(import.meta.url),_0x25de95=a44_0x2f616d['resolve'](a44_0x2f616d['dirname'](_0x172a4e),_0x3860c(0x11d)),_0x14eac9=a44_0x2f616d['join'](_0x25de95,'package.json');let _0x551cf3='1.0.0';try{const _0x3aaaa8=JSON[_0x3860c(0x162)](a44_0x18f95e[_0x3860c(0x182)](_0x14eac9,'utf8'));_0x551cf3=_0x3aaaa8[_0x3860c(0x158)]||_0x3860c(0x15d);}catch(_0x1e7079){}const _0x26fd25=a44_0x18f95e[_0x3860c(0x182)](_0x44309b,'utf8'),_0x14b1d8=JSON[_0x3860c(0x162)](_0x26fd25);_0x14b1d8[_0x3860c(0x137)]=_0x1753f3,_0x14b1d8[_0x3860c(0x12d)]=_0x1753f3+_0x3860c(0x141)+_0x551cf3,a44_0x18f95e[_0x3860c(0x144)](_0x44309b,JSON[_0x3860c(0x175)](_0x14b1d8,null,0x2)+'\x0a',_0x3860c(0x14c)),console[_0x3860c(0x14e)](_0x3860c(0x12c)+_0x1753f3),logger[_0x3860c(0x16f)]('create',_0x3860c(0x146));}catch(_0x3ad5c2){logger['error'](_0x3860c(0x13c),_0x3860c(0x117));throw _0x3ad5c2;}},_0x3e9432=async(_0x2a2646,_0x5c54a0,_0x33a3cf)=>{const _0x25e493=a44_0x3c97,_0x454ba9=a44_0x2f616d['resolve'](process[_0x25e493(0x15e)](),_0x2a2646),_0x1ae573=a44_0x2f616d[_0x25e493(0x14f)](_0x454ba9,_0x25e493(0x116));try{_0x5c54a0?console[_0x25e493(0x14e)]('*\x20正在为项目\x20'+_0x2a2646+_0x25e493(0x177)+_0x5c54a0):console[_0x25e493(0x14e)](_0x25e493(0x136)+_0x2a2646+_0x25e493(0x187));const _0x517044=fileURLToPath(import.meta.url),_0x40a2b0=a44_0x2f616d[_0x25e493(0x17f)](a44_0x2f616d[_0x25e493(0x15a)](_0x517044),_0x25e493(0x11d)),_0x33a33f=a44_0x2f616d[_0x25e493(0x14f)](_0x40a2b0,_0x25e493(0x183));let _0x4a0f5a='1.0.0';try{const _0x327153=JSON['parse'](a44_0x18f95e[_0x25e493(0x182)](_0x33a33f,_0x25e493(0x14c)));_0x4a0f5a=_0x327153[_0x25e493(0x158)]||_0x25e493(0x15d);}catch(_0x3dc150){}const _0x193cd6=readConfig(),_0x1780f4=typeof _0x193cd6[_0x25e493(0x167)]==='string'?_0x193cd6[_0x25e493(0x167)]:undefined,{app:_0x3ff52b,appcode:_0x22d1de,..._0x12778a}=_0x193cd6,_0x45c576={..._0x12778a,'appcode':_0x5c54a0||'','env':_0x33a3cf||_0x1780f4||_0x25e493(0x122),'createdAt':new Date()[_0x25e493(0x142)](),'version':_0x4a0f5a};a44_0x18f95e[_0x25e493(0x144)](_0x1ae573,JSON[_0x25e493(0x175)](_0x45c576,null,0x2),'utf8'),_0x5c54a0?console[_0x25e493(0x14e)](_0x25e493(0x169)+_0x5c54a0):console['log'](_0x25e493(0x140)),logger['info'](_0x25e493(0x13c),'配置应用AppCode:\x20'+_0x5c54a0);}catch(_0x5752e2){logger[_0x25e493(0x160)](_0x25e493(0x13c),_0x25e493(0x16d));}};useEffect(()=>{const _0x2a7ddc=a44_0x3c97;_0x2c38c8[_0x2a7ddc(0x147)]&&_0x5c241a(_0x2c38c8[_0x2a7ddc(0x147)]);},[_0x2c38c8[_0x1b4b59(0x147)]]);if(!_0x4079cb&&!_0x5bc5df&&!_0x2c38c8[_0x1b4b59(0x147)])return a44_0x47b470(EnhancedGuidedCreate,{'onCreate':_0xe31ece,'env':_0x2c38c8['env']});if(_0x4079cb)return a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'marginTop':0x1,'children':[a44_0x47b470(Box,{'width':'1'}),a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':'\x20√\x20'}),a44_0x47b470(Text,{'children':_0x1b4b59(0x18b)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':_0x44113c?.['projectName']}),_0x44113c?.['appCode']&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Text,{'children':_0x1b4b59(0x139)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'children':_0x44113c[_0x1b4b59(0x15c)]})]})]}),a44_0x47b470(TaskRunning,{..._0x216194}),a44_0x47b470(TaskRunning,{..._0x273e90}),a44_0x47b470(TaskRunning,{..._0x4a4446})]});if(_0x5bc5df){const _0x1d883b=_0x585443&&(_0x585443[_0x1b4b59(0x166)][_0x1b4b59(0x17c)]>0x0||_0x585443[_0x1b4b59(0x16b)][_0x1b4b59(0x17c)]>0x0);return a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'marginTop':0x1,'children':[a44_0x47b470(Box,{'width':'1'}),a44_0x47b470(Text,{'color':'green','children':_0x1b4b59(0x163)}),a44_0x47b470(Text,{'children':_0x1b4b59(0x18b)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':_0x44113c?.['projectName']}),_0x44113c?.[_0x1b4b59(0x15c)]&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Text,{'children':_0x1b4b59(0x139)}),a44_0x47b470(Text,{'color':'cyan','children':_0x44113c['appCode']})]})]}),a44_0x47b470(TaskFinished,{..._0x216194}),a44_0x47b470(TaskFinished,{..._0x273e90}),a44_0x47b470(TaskFinished,{..._0x4a4446}),a44_0x47b470(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x47b470(Text,{'color':'green','children':'─'[_0x1b4b59(0x161)](0x3c)})}),_0x1d883b&&a44_0x28b5d1(a44_0x5e98d8,{'children':[_0x585443['mcp'][_0x1b4b59(0x17c)]>0x0&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Box,{'marginTop':0x1,'children':a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'bold':!![],'children':_0x1b4b59(0x153)})}),_0x585443[_0x1b4b59(0x166)][_0x1b4b59(0x11b)]((_0x4922c2,_0x1e3c50)=>a44_0x47b470(Box,{'marginLeft':0x2,'children':a44_0x28b5d1(Text,{'color':_0x4922c2[_0x1b4b59(0x14d)]===_0x1b4b59(0x113)?_0x1b4b59(0x16c):_0x4922c2[_0x1b4b59(0x14d)]===_0x1b4b59(0x138)?_0x1b4b59(0x130):_0x1b4b59(0x165),'children':[_0x4922c2[_0x1b4b59(0x164)],':\x20',_0x4922c2[_0x1b4b59(0x15b)]]})},'mcp-'+_0x1e3c50))]}),_0x585443['skill']['length']>0x0&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Box,{'marginTop':_0x585443[_0x1b4b59(0x166)][_0x1b4b59(0x17c)]>0x0?0x1:0x0,'children':a44_0x47b470(Text,{'color':'green','bold':!![],'children':'✓\x20Skill\x20安装完成:'})}),_0x585443['skill']['map']((_0x1ca311,_0x14f59d)=>a44_0x47b470(Box,{'marginLeft':0x2,'children':a44_0x28b5d1(Text,{'color':_0x1ca311[_0x1b4b59(0x14d)]===_0x1b4b59(0x113)?_0x1b4b59(0x16c):'red','children':[_0x1ca311[_0x1b4b59(0x164)],':\x20',_0x1ca311[_0x1b4b59(0x15b)]]})},_0x1b4b59(0x14b)+_0x14f59d))]}),a44_0x47b470(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x47b470(Text,{'color':'green','children':'─'[_0x1b4b59(0x161)](0x3c)})})]}),a44_0x47b470(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x178)})}),a44_0x28b5d1(Box,{'marginLeft':0x2,'flexDirection':'column','children':[_0x1d883b?a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':'1.\x20'}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x157)}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':'cd\x20'+_0x44113c?.[_0x1b4b59(0x120)]+_0x1b4b59(0x128)})]}),_0x44113c?.[_0x1b4b59(0x15c)]&&!_0x44113c?.[_0x1b4b59(0x185)]&&a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x130),'children':_0x1b4b59(0x168)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x152)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x17d)})]})]}):a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x47b470(Box,{'children':a44_0x47b470(Text,{'color':'yellow','bold':!![],'children':_0x1b4b59(0x13f)})}),a44_0x28b5d1(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x125)}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':_0x1b4b59(0x126)})]}),a44_0x28b5d1(Box,{'marginLeft':0x2,'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x112)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x17b)})]}),a44_0x28b5d1(Box,{'marginTop':0x1,'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':_0x1b4b59(0x168)}),a44_0x47b470(Text,{'color':'white','children':'启动项目:\x20'}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':_0x1b4b59(0x134)+_0x44113c?.[_0x1b4b59(0x120)]+_0x1b4b59(0x128)})]}),_0x44113c?.[_0x1b4b59(0x15c)]&&!_0x44113c?.[_0x1b4b59(0x185)]&&a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x130),'children':_0x1b4b59(0x114)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x152)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x17d)})]})]}),!_0x44113c?.[_0x1b4b59(0x15c)]&&a44_0x28b5d1(a44_0x5e98d8,{'children':[a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x13b),'children':_0x1b4b59(0x168)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x121)}),a44_0x47b470(Text,{'color':'cyan','bold':!![],'children':_0x1b4b59(0x174)})]}),a44_0x28b5d1(Box,{'children':[a44_0x47b470(Text,{'color':_0x1b4b59(0x13b),'children':_0x1b4b59(0x114)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x16c),'children':_0x1b4b59(0x152)}),a44_0x47b470(Text,{'color':_0x1b4b59(0x123),'bold':!![],'children':_0x1b4b59(0x133)})]})]})]}),a44_0x47b470(Box,{'marginTop':0x1,'children':a44_0x47b470(Text,{'color':_0x1b4b59(0x155),'children':'─'[_0x1b4b59(0x161)](0x3c)})})]});}return null;}
|
|
1
|
+
(function(_0x3090f1,_0x39ada9){const _0x46a475=a42_0x4017,_0x1ea9ab=_0x3090f1();while(!![]){try{const _0x3cd5b1=parseInt(_0x46a475(0x1f0))/0x1+parseInt(_0x46a475(0x21a))/0x2*(-parseInt(_0x46a475(0x203))/0x3)+parseInt(_0x46a475(0x248))/0x4+parseInt(_0x46a475(0x22a))/0x5+-parseInt(_0x46a475(0x1f8))/0x6*(parseInt(_0x46a475(0x246))/0x7)+-parseInt(_0x46a475(0x211))/0x8*(parseInt(_0x46a475(0x201))/0x9)+parseInt(_0x46a475(0x214))/0xa*(parseInt(_0x46a475(0x23d))/0xb);if(_0x3cd5b1===_0x39ada9)break;else _0x1ea9ab['push'](_0x1ea9ab['shift']());}catch(_0x18813c){_0x1ea9ab['push'](_0x1ea9ab['shift']());}}}(a42_0x24ae,0x5d639));import{jsx as a42_0x17f82a,Fragment as a42_0x279e8e,jsxs as a42_0x152e37}from'react/jsx-runtime';import a42_0x1c17f5 from'path';import a42_0x3c4f61 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';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';function a42_0x4017(_0x327b59,_0x400678){_0x327b59=_0x327b59-0x1eb;const _0x24ae95=a42_0x24ae();let _0x4017d3=_0x24ae95[_0x327b59];return _0x4017d3;}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';export function CreateApp(_0x4a033f){const _0x20858a=a42_0x4017,{t:_0x52ff7d}=useI18n(),[_0xd51676,_0x358ec3]=useState(![]),[_0x5a5800,_0x5907cb]=useState(![]),[_0x2bd3a5,_0x3c088c]=useState(null),[_0x368755,_0x22fb45]=useState(null),_0x4e7a4e=useCopyProjectTemplate(),_0x141019=useInstallDependencies(),_0x702284=useFormatCode();useEffect(()=>{const _0x3fc60a=a42_0x4017;checkCliVersion()[_0x3fc60a(0x1fd)](_0x1476bf=>{const _0x19bf51=_0x3fc60a;_0x1476bf['needsUpgrade']&&(printCliUpgradeWarning(_0x1476bf),logger[_0x19bf51(0x222)](_0x19bf51(0x24d),_0x19bf51(0x23f),{'currentVersion':_0x1476bf['currentVersion'],'stableVersion':_0x1476bf[_0x19bf51(0x1fc)],'needsUpgrade':_0x1476bf['needsUpgrade']}));});},[]);const _0x92f888=async _0x1a159b=>{const _0x296f09=a42_0x4017;if(!_0x1a159b[_0x296f09(0x219)]||_0x1a159b[_0x296f09(0x219)][_0x296f09(0x233)]()===''){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x237)));return;}const _0xa87853=/[<>:"|?*\x00-\x1f\x7f]/;if(_0xa87853[_0x296f09(0x234)](_0x1a159b[_0x296f09(0x219)])){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x206)));return;}if(_0x1a159b[_0x296f09(0x219)][_0x296f09(0x24b)]>0x64){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x221)));return;}const _0x77cee6=a42_0x1c17f5['resolve'](process['cwd'](),_0x1a159b['projectName']);if(a42_0x3c4f61[_0x296f09(0x256)](_0x77cee6)){console['error'](_0x52ff7d(_0x296f09(0x210),{'name':_0x1a159b['projectName']}));return;}try{const _0x2e9b1d=a42_0x1c17f5[_0x296f09(0x255)](_0x77cee6);a42_0x3c4f61[_0x296f09(0x20d)](_0x2e9b1d,a42_0x3c4f61[_0x296f09(0x227)][_0x296f09(0x231)]);}catch(_0x12c76a){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x250)));return;}_0x3c088c(_0x1a159b),_0x358ec3(!![]),logger[_0x296f09(0x1f4)](_0x77cee6),logger[_0x296f09(0x222)](_0x296f09(0x24d),_0x296f09(0x25c)+_0x1a159b[_0x296f09(0x219)],{'projectDir':_0x77cee6,'appCode':_0x1a159b['appCode']});try{await _0x4e7a4e['doTask'](_0x1a159b[_0x296f09(0x219)]),await _0x4d37f7(_0x1a159b[_0x296f09(0x219)]),await _0x141019[_0x296f09(0x213)](_0x1a159b[_0x296f09(0x219)]),await _0x702284[_0x296f09(0x213)](_0x1a159b[_0x296f09(0x219)]),await _0x5db5aa(_0x1a159b[_0x296f09(0x219)],_0x1a159b['appCode']||'',_0x1a159b[_0x296f09(0x244)]);if(_0x1a159b['pullApi']&&_0x1a159b[_0x296f09(0x202)]){console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x218)));try{const _0x4a062a=await pullApiSilent(_0x1a159b[_0x296f09(0x202)],undefined,_0x77cee6,_0x1a159b[_0x296f09(0x244)]);_0x4a062a?(console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x1fa))),logger[_0x296f09(0x222)](_0x296f09(0x24d),_0x296f09(0x22c)+_0x1a159b[_0x296f09(0x202)])):(console[_0x296f09(0x212)](_0x52ff7d('create.steps.apiPullFailed')),logger[_0x296f09(0x235)](_0x296f09(0x24d),_0x296f09(0x207)+_0x1a159b[_0x296f09(0x202)]));}catch(_0x4e4ed2){console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x1f3))),logger[_0x296f09(0x235)](_0x296f09(0x24d),_0x296f09(0x239),{'error':_0x4e4ed2 instanceof Error?_0x4e4ed2['message']:String(_0x4e4ed2)});}}if(_0x1a159b[_0x296f09(0x236)]&&_0x1a159b[_0x296f09(0x1ec)]&&_0x1a159b[_0x296f09(0x1ec)][_0x296f09(0x24b)]>0x0&&_0x1a159b['appCode']){console[_0x296f09(0x212)](_0x52ff7d('create.lovrabetSetup.inProgress'));const _0x74bfe3=[],_0x41b555=[],_0x674544=_0x1a159b[_0x296f09(0x1ec)][_0x296f09(0x21b)](_0x50365f=>MCP_IDES['has'](_0x50365f)),_0x16cb83=_0x1a159b[_0x296f09(0x1ec)];for(const _0x59c2e2 of _0x674544){try{const _0x1d91f4=await configureMcp(_0x59c2e2,_0x77cee6);_0x74bfe3[_0x296f09(0x216)]({'ide':_0x59c2e2===_0x296f09(0x23b)?'Cursor':_0x296f09(0x1f5),'status':_0x1d91f4['status'],'message':_0x1d91f4[_0x296f09(0x200)]}),console[_0x296f09(0x212)]('\x20\x20'+(_0x1d91f4['status']===_0x296f09(0x249)?'✓':_0x1d91f4[_0x296f09(0x208)]==='manual'?'⚠️':'✗')+_0x296f09(0x1ee)+_0x59c2e2+':\x20'+_0x1d91f4['message']);}catch(_0x3d8824){_0x74bfe3[_0x296f09(0x216)]({'ide':_0x59c2e2===_0x296f09(0x23b)?_0x296f09(0x21d):_0x296f09(0x1f5),'status':_0x296f09(0x1fb),'message':_0x3d8824 instanceof Error?_0x3d8824[_0x296f09(0x200)]:String(_0x3d8824)}),console[_0x296f09(0x212)](_0x296f09(0x25a)+_0x59c2e2+':\x20'+(_0x3d8824 instanceof Error?_0x3d8824[_0x296f09(0x200)]:String(_0x3d8824)));}}await copySharedSkills(_0x77cee6);for(const _0x1b2527 of _0x16cb83){try{const _0x3b8df6=await installSkill(_0x1b2527,_0x77cee6);_0x41b555[_0x296f09(0x216)]({'ide':_0x3b8df6[_0x296f09(0x23a)],'status':_0x3b8df6[_0x296f09(0x208)],'message':_0x3b8df6[_0x296f09(0x200)]}),console[_0x296f09(0x212)]('\x20\x20'+(_0x3b8df6['status']===_0x296f09(0x249)?'✓':'✗')+_0x296f09(0x261)+_0x3b8df6[_0x296f09(0x23a)]+':\x20'+_0x3b8df6[_0x296f09(0x200)]);}catch(_0x80660e){_0x41b555[_0x296f09(0x216)]({'ide':_0x1b2527,'status':_0x296f09(0x1fb),'message':_0x80660e instanceof Error?_0x80660e[_0x296f09(0x200)]:String(_0x80660e)}),console[_0x296f09(0x212)](_0x296f09(0x240)+_0x1b2527+':\x20'+(_0x80660e instanceof Error?_0x80660e[_0x296f09(0x200)]:String(_0x80660e)));}}if(_0x41b555[_0x296f09(0x24b)]>0x0){const _0x3acb7c=_0x41b555[_0x296f09(0x21b)](_0xc67a6a=>_0xc67a6a[_0x296f09(0x208)]===_0x296f09(0x249))[_0x296f09(0x252)](_0x5c13e9=>_0x5c13e9[_0x296f09(0x23a)]);_0x3acb7c['length']>0x0&&createSkillManifest(_0x77cee6,_0x3acb7c);}_0x22fb45({'mcp':_0x74bfe3,'skill':_0x41b555}),console[_0x296f09(0x212)](_0x52ff7d('create.steps.mcpConfigComplete'));}logger[_0x296f09(0x249)]('create',_0x296f09(0x23e)+_0x1a159b[_0x296f09(0x219)]),_0x5907cb(!![]),_0x358ec3(![]);}catch(_0x4fcdfa){logger[_0x296f09(0x1fb)](_0x296f09(0x24d),_0x296f09(0x1eb)+_0x1a159b['projectName'],{'error':_0x4fcdfa instanceof Error?_0x4fcdfa['message']:String(_0x4fcdfa)});try{a42_0x3c4f61[_0x296f09(0x256)](_0x77cee6)&&(console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x24a),{'dir':_0x77cee6})),a42_0x3c4f61[_0x296f09(0x20e)](_0x77cee6,{'recursive':!![],'force':!![]}));}catch(_0x5dcefa){logger[_0x296f09(0x235)](_0x296f09(0x24d),_0x296f09(0x20c)+_0x77cee6);}_0x358ec3(![]),console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x259),{'error':_0x4fcdfa instanceof Error?_0x4fcdfa[_0x296f09(0x200)]:String(_0x4fcdfa)}));}},_0x3c59a1=async _0x487f23=>{await _0x92f888({'projectName':_0x487f23,'env':_0x4a033f['env']});},_0x4d37f7=async _0x2d4a51=>{const _0x18d2c7=a42_0x4017,_0x27b1fe=a42_0x1c17f5[_0x18d2c7(0x1ef)](process[_0x18d2c7(0x24c)](),_0x2d4a51),_0x9ed09c=a42_0x1c17f5[_0x18d2c7(0x241)](_0x27b1fe,_0x18d2c7(0x220));try{console[_0x18d2c7(0x212)](_0x52ff7d('create.packageJson.updating'));const _0x2e481b=fileURLToPath(import.meta.url),_0x35964a=a42_0x1c17f5[_0x18d2c7(0x1ef)](a42_0x1c17f5[_0x18d2c7(0x255)](_0x2e481b),_0x18d2c7(0x23c)),_0x4681bb=a42_0x1c17f5[_0x18d2c7(0x241)](_0x35964a,'package.json');let _0x4a1519='1.0.0';try{const _0x58bd3f=JSON[_0x18d2c7(0x254)](a42_0x3c4f61[_0x18d2c7(0x1f9)](_0x4681bb,_0x18d2c7(0x229)));_0x4a1519=_0x58bd3f[_0x18d2c7(0x22f)]||'1.0.0';}catch(_0x33d4bc){}const _0x50dd64=a42_0x3c4f61[_0x18d2c7(0x1f9)](_0x9ed09c,'utf8'),_0x15a77f=JSON[_0x18d2c7(0x254)](_0x50dd64);_0x15a77f[_0x18d2c7(0x215)]=_0x2d4a51,_0x15a77f[_0x18d2c7(0x238)]=_0x2d4a51+_0x18d2c7(0x25d)+_0x4a1519,a42_0x3c4f61['writeFileSync'](_0x9ed09c,JSON['stringify'](_0x15a77f,null,0x2)+'\x0a',_0x18d2c7(0x229)),console[_0x18d2c7(0x212)](_0x52ff7d(_0x18d2c7(0x228),{'name':_0x2d4a51})),logger['info'](_0x18d2c7(0x24d),_0x18d2c7(0x24f));}catch(_0x99d36d){logger['error'](_0x18d2c7(0x24d),'更新\x20package.json\x20失败');throw _0x99d36d;}},_0x5db5aa=async(_0x534665,_0x2519ab,_0x4f875d)=>{const _0x4cdcc9=a42_0x4017,_0x483b27=a42_0x1c17f5[_0x4cdcc9(0x1ef)](process[_0x4cdcc9(0x24c)](),_0x534665),_0xce61f9=a42_0x1c17f5['join'](_0x483b27,_0x4cdcc9(0x224));try{_0x2519ab?console[_0x4cdcc9(0x212)](_0x52ff7d('create.config.configuringAppCode',{'name':_0x534665,'appCode':_0x2519ab})):console[_0x4cdcc9(0x212)](_0x52ff7d(_0x4cdcc9(0x204),{'name':_0x534665}));const _0x1e856a=fileURLToPath(import.meta.url),_0x4ecdd6=a42_0x1c17f5[_0x4cdcc9(0x1ef)](a42_0x1c17f5[_0x4cdcc9(0x255)](_0x1e856a),_0x4cdcc9(0x23c)),_0x4c1a91=a42_0x1c17f5['join'](_0x4ecdd6,_0x4cdcc9(0x220));let _0x598f0d=_0x4cdcc9(0x1f2);try{const _0x46303c=JSON[_0x4cdcc9(0x254)](a42_0x3c4f61[_0x4cdcc9(0x1f9)](_0x4c1a91,_0x4cdcc9(0x229)));_0x598f0d=_0x46303c[_0x4cdcc9(0x22f)]||_0x4cdcc9(0x1f2);}catch(_0x2af892){}const _0x3141ae=readConfig(),_0x52f0da=typeof _0x3141ae[_0x4cdcc9(0x244)]===_0x4cdcc9(0x257)?_0x3141ae[_0x4cdcc9(0x244)]:undefined,{app:_0x21a85e,appcode:_0x361413,..._0x4b6468}=_0x3141ae,_0x2af2a8={..._0x4b6468,'appcode':_0x2519ab||'','env':_0x4f875d||_0x52f0da||_0x4cdcc9(0x20b),'createdAt':new Date()['toLocaleString'](),'version':_0x598f0d};a42_0x3c4f61['writeFileSync'](_0xce61f9,JSON[_0x4cdcc9(0x226)](_0x2af2a8,null,0x2),'utf8'),_0x2519ab?console[_0x4cdcc9(0x212)](_0x52ff7d(_0x4cdcc9(0x1ff),{'appCode':_0x2519ab})):console['log'](_0x52ff7d('create.config.createdWithoutAppCode')),logger[_0x4cdcc9(0x222)]('create','配置应用AppCode:\x20'+_0x2519ab);}catch(_0x322ff0){logger['error'](_0x4cdcc9(0x24d),_0x4cdcc9(0x242));}};useEffect(()=>{_0x4a033f['projectCode']&&_0x3c59a1(_0x4a033f['projectCode']);},[_0x4a033f[_0x20858a(0x20f)]]);if(!_0xd51676&&!_0x5a5800&&!_0x4a033f[_0x20858a(0x20f)])return a42_0x17f82a(EnhancedGuidedCreate,{'onCreate':_0x92f888,'env':_0x4a033f[_0x20858a(0x244)]});if(_0xd51676)return a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'marginTop':0x1,'children':[a42_0x17f82a(Box,{'width':'1'}),a42_0x17f82a(Text,{'color':'green','children':'\x20√\x20'}),a42_0x17f82a(Text,{'children':_0x52ff7d(_0x20858a(0x217))}),a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':_0x2bd3a5?.['projectName']}),_0x2bd3a5?.[_0x20858a(0x202)]&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Text,{'children':_0x52ff7d('create.display.appCode')}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'children':_0x2bd3a5[_0x20858a(0x202)]})]})]}),a42_0x17f82a(TaskRunning,{..._0x4e7a4e}),a42_0x17f82a(TaskRunning,{..._0x141019}),a42_0x17f82a(TaskRunning,{..._0x702284})]});if(_0x5a5800){const _0xd6fc9b=_0x368755&&(_0x368755[_0x20858a(0x205)][_0x20858a(0x24b)]>0x0||_0x368755[_0x20858a(0x25f)]['length']>0x0);return a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'marginTop':0x1,'children':[a42_0x17f82a(Box,{'width':'1'}),a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':_0x20858a(0x232)}),a42_0x17f82a(Text,{'children':_0x52ff7d(_0x20858a(0x217))}),a42_0x17f82a(Text,{'color':'green','children':_0x2bd3a5?.[_0x20858a(0x219)]}),_0x2bd3a5?.['appCode']&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Text,{'children':_0x52ff7d('create.display.appCode')}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'children':_0x2bd3a5[_0x20858a(0x202)]})]})]}),a42_0x17f82a(TaskFinished,{..._0x4e7a4e}),a42_0x17f82a(TaskFinished,{..._0x141019}),a42_0x17f82a(TaskFinished,{..._0x702284}),a42_0x17f82a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'─'[_0x20858a(0x21f)](0x3c)})}),_0xd6fc9b&&a42_0x152e37(a42_0x279e8e,{'children':[_0x368755[_0x20858a(0x205)]['length']>0x0&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Box,{'marginTop':0x1,'children':a42_0x17f82a(Text,{'color':'green','bold':!![],'children':_0x52ff7d('create.lovrabetSetup.mcpCompleted')})}),_0x368755[_0x20858a(0x205)][_0x20858a(0x252)]((_0x4bf4bf,_0x22db75)=>a42_0x17f82a(Box,{'marginLeft':0x2,'children':a42_0x152e37(Text,{'color':_0x4bf4bf[_0x20858a(0x208)]===_0x20858a(0x249)?_0x20858a(0x230):_0x4bf4bf[_0x20858a(0x208)]==='manual'?_0x20858a(0x253):_0x20858a(0x20a),'children':[_0x4bf4bf[_0x20858a(0x23a)],':\x20',_0x4bf4bf[_0x20858a(0x200)]]})},_0x20858a(0x258)+_0x22db75))]}),_0x368755[_0x20858a(0x25f)][_0x20858a(0x24b)]>0x0&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Box,{'marginTop':_0x368755[_0x20858a(0x205)][_0x20858a(0x24b)]>0x0?0x1:0x0,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'bold':!![],'children':_0x52ff7d('create.lovrabetSetup.skillCompleted')})}),_0x368755[_0x20858a(0x25f)]['map']((_0x5b400a,_0x1f452f)=>a42_0x17f82a(Box,{'marginLeft':0x2,'children':a42_0x152e37(Text,{'color':_0x5b400a['status']===_0x20858a(0x249)?_0x20858a(0x230):_0x20858a(0x20a),'children':[_0x5b400a[_0x20858a(0x23a)],':\x20',_0x5b400a[_0x20858a(0x200)]]})},_0x20858a(0x22b)+_0x1f452f))]}),a42_0x17f82a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'─'[_0x20858a(0x21f)](0x3c)})})]}),a42_0x17f82a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x52ff7d('create.results.nextSteps')})}),a42_0x152e37(Box,{'marginLeft':0x2,'flexDirection':_0x20858a(0x223),'children':[_0xd6fc9b?a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':_0x20858a(0x260)}),a42_0x17f82a(Text,{'color':'white','children':_0x52ff7d(_0x20858a(0x251))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x20858a(0x209)+_0x2bd3a5?.['projectName']+_0x20858a(0x25b)})]}),_0x2bd3a5?.['appCode']&&!_0x2bd3a5?.[_0x20858a(0x1f1)]&&a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x253),'children':_0x20858a(0x21c)}),a42_0x17f82a(Text,{'color':'white','children':_0x52ff7d(_0x20858a(0x225))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x247)})]})]}):a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Box,{'children':a42_0x17f82a(Text,{'color':_0x20858a(0x253),'bold':!![],'children':_0x52ff7d(_0x20858a(0x24e))})}),a42_0x152e37(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x245))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':'lovrabet\x20skill\x20install'})]}),a42_0x152e37(Box,{'marginLeft':0x2,'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x1f7))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x22e)})]}),a42_0x152e37(Box,{'marginTop':0x1,'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'2.\x20'}),a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x251))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x20858a(0x209)+_0x2bd3a5?.[_0x20858a(0x219)]+_0x20858a(0x25b)})]}),_0x2bd3a5?.[_0x20858a(0x202)]&&!_0x2bd3a5?.['pullApi']&&a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x253),'children':_0x20858a(0x1fe)}),a42_0x17f82a(Text,{'color':'white','children':_0x52ff7d(_0x20858a(0x225))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x247)})]})]}),!_0x2bd3a5?.['appCode']&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x21e),'children':_0x20858a(0x21c)}),a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x1f6))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x243)})]}),a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x21e),'children':_0x20858a(0x1fe)}),a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x225))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x20858a(0x22d)})]})]})]}),a42_0x17f82a(Box,{'marginTop':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'─'[_0x20858a(0x21f)](0x3c)})})]});}return null;}function a42_0x24ae(){const _0x53bcd4=['setLogPath','Claude\x20Code','create.nextSteps.configAppCode','create.nextSteps.mcp','152634LQygbq','readFileSync','create.steps.apiPullSuccess','error','stableVersion','then','3.\x20','create.config.createdWithAppCode','message','234lFiRYJ','appCode','30IxKQPz','create.config.creating','mcp','create.validation.invalidChars','API\x20配置拉取失败:\x20','status','cd\x20','red','online','清理项目目录失败:\x20','accessSync','rmSync','projectCode','create.validation.dirExists','95448bvxPCO','log','doTask','231910WxJrLv','name','push','create.display.projectName','create.steps.pullingApi','projectName','118702NGAHPL','filter','2.\x20','Cursor','gray','repeat','package.json','create.validation.tooLong','info','column','.lovrabetrc','create.nextSteps.pullApi','stringify','constants','create.packageJson.updated','utf8','3549045qAEvwM','skill-','API\x20配置拉取成功:\x20','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','lovrabet\x20mcp\x20install','version','white','W_OK','\x20√\x20','trim','test','warn','aiSetup','create.validation.required','description','API\x20配置拉取异常','ide','cursor','../..','319VLpfix','项目创建完成:\x20','CLI\x20版本检查','\x20\x20✗\x20Skill\x20','join','配置应用AppCode失败','lovrabet\x20config\x20set\x20appcode\x20[app-code]','env','create.nextSteps.skill','161woPHgl','lovrabet\x20api\x20pull','118892FHEErB','success','create.cleanup.inProgress','length','cwd','create','create.nextSteps.configureMcpAndSkill','更新\x20package.json\x20name','create.validation.noPermission','create.nextSteps.startProject','map','yellow','parse','dirname','existsSync','string','mcp-','create.errors.createFailed','\x20\x20✗\x20MCP\x20','\x20&&\x20lovrabet\x20start','开始创建项目:\x20','\x20Generated\x20by\x20lovrabet\x20cli\x20','green','skill','1.\x20','\x20Skill\x20','项目创建失败:\x20','selectedIDEs','cyan','\x20MCP\x20','resolve','459263BANbNE','pullApi','1.0.0','create.steps.apiPullError'];a42_0x24ae=function(){return _0x53bcd4;};return a42_0x24ae();}
|