@lovrabet/cli 1.2.5-beta.7 → 1.3.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/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/check-sdk-version.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 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +4 -3
- package/templates/skills/.cursorrules +0 -109
- package/templates/skills/.shared/README.md +0 -20
- package/templates/skills/.shared/SKILL.md.tpl +0 -119
- package/templates/skills/.shared/guides/01-typescript-sdk/guide.md +0 -382
- package/templates/skills/.shared/guides/02-mcp-sql-workflow/guide.md +0 -272
- package/templates/skills/.shared/guides/03-antd-style/guide.md +0 -282
- package/templates/skills/.shared/guides/04-troubleshooting/guide.md +0 -426
- package/templates/skills/.shared/guides/05-api-integration/guide.md +0 -329
- package/templates/skills/.shared/guides/06-menu-management/guide.md +0 -307
- package/templates/skills/.shared/guides/07-backend-function/guide.md +0 -600
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x16849f,_0x2da5a8){const _0xe2c5a6=a0_0x48bb,_0x36fd91=_0x16849f();while(!![]){try{const _0x2a5d23=parseInt(_0xe2c5a6(0x142))/0x1+parseInt(_0xe2c5a6(0x13a))/0x2*(-parseInt(_0xe2c5a6(0x128))/0x3)+-parseInt(_0xe2c5a6(0x139))/0x4*(parseInt(_0xe2c5a6(0x135))/0x5)+parseInt(_0xe2c5a6(0x129))/0x6+parseInt(_0xe2c5a6(0x13c))/0x7*(-parseInt(_0xe2c5a6(0x140))/0x8)+-parseInt(_0xe2c5a6(0x13f))/0x9+parseInt(_0xe2c5a6(0x12e))/0xa;if(_0x2a5d23===_0x2da5a8)break;else _0x36fd91['push'](_0x36fd91['shift']());}catch(_0x4a87f7){_0x36fd91['push'](_0x36fd91['shift']());}}}(a0_0x33f7,0xca9dd));function a0_0x48bb(_0x5434ef,_0x9c0f8a){_0x5434ef=_0x5434ef-0x11e;const _0x33f783=a0_0x33f7();let _0x48bb51=_0x33f783[_0x5434ef];return _0x48bb51;}import{jsx as a0_0xf3cf64,jsxs as a0_0x31ed51}from'react/jsx-runtime';function a0_0x33f7(){const _0x8fa45=['backspace','\x20←\x20','includes','13013090mLOCcP','\x20直接回车确认,或输入自定义路由地址','\x20已存在,请使用其他路径','green','startsWith','\x20Step2:\x20','split','30nCtQCm','页面路径\x20','my-page','trim','51200sRxfxe','6KaWGuh','路径不能包含连续的\x20/','77maJmSZ','gray','页面路径长度不能超过\x20100\x20个字符','11566035GfHOPE','609368bvpOPE','length','668676jPObIw','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','return','路径不能以\x20/\x20开头或结尾','existsSync','页面路径不合法','column','delete','slice','red','页面路由地址:\x20','27210pkBkFV','6521628HSkNbj','test'];a0_0x33f7=function(){return _0x8fa45;};return a0_0x33f7();}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x15b7af from'node:fs';export function InputProjectCode(_0x1f20bb){const _0x16f5e1=a0_0x48bb,{onSubmit:_0x47b1bc,pagePath:_0x368233}=_0x1f20bb,[_0x3600e,_0x1d29c4]=useState(''),[_0x4fbfc9,_0x40e6b2]=useState(''),_0x3d6bcc=_0x16f5e1(0x137);function _0x4d8cf4(_0x2c2256){const _0x7ebdd1=_0x16f5e1;if(_0x2c2256[_0x7ebdd1(0x141)]>0x64)return{'valid':![],'message':_0x7ebdd1(0x13e)};if(_0x2c2256[_0x7ebdd1(0x132)]('/')||_0x2c2256['endsWith']('/'))return{'valid':![],'message':_0x7ebdd1(0x120)};if(_0x2c2256[_0x7ebdd1(0x12d)]('//'))return{'valid':![],'message':_0x7ebdd1(0x13b)};const _0x5232a3=_0x2c2256[_0x7ebdd1(0x134)]('/');for(const _0x45667e of _0x5232a3){if(!_0x45667e)continue;const _0x409743=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x409743[_0x7ebdd1(0x12a)](_0x45667e))return{'valid':![],'message':_0x7ebdd1(0x11e)};}return{'valid':!![]};}return useInput((_0x6276b6,_0x4df9d3)=>{const _0x3aabda=_0x16f5e1;if(_0x4df9d3[_0x3aabda(0x11f)]){const _0x32da19=_0x3600e[_0x3aabda(0x138)]()||_0x3d6bcc;if(_0x4fbfc9)return;const _0x1ea785=_0x368233+'/'+_0x32da19;if(a0_0x15b7af[_0x3aabda(0x121)](_0x1ea785)){_0x40e6b2(_0x3aabda(0x136)+_0x32da19+_0x3aabda(0x130));return;}_0x47b1bc(_0x32da19),_0x1d29c4(''),_0x40e6b2('');}else _0x4df9d3[_0x3aabda(0x12b)]||_0x4df9d3[_0x3aabda(0x124)]?_0x1d29c4(_0x1cbf2c=>{const _0x3127de=_0x3aabda,_0x290071=_0x1cbf2c[_0x3127de(0x125)](0x0,-0x1),{valid:_0x298220,message:_0x49e6dd}=_0x4d8cf4(_0x290071);return _0x40e6b2(_0x298220?'':_0x49e6dd||_0x3127de(0x122)),_0x290071;}):_0x1d29c4(_0x3e2733=>{const _0x2a43a1=_0x3aabda,_0x182126=_0x3e2733+_0x6276b6,{valid:_0x1853cb,message:_0x732575}=_0x4d8cf4(_0x182126);return _0x40e6b2(_0x1853cb?'':_0x732575||_0x2a43a1(0x122)),_0x182126;});}),a0_0x31ed51(Box,{'flexDirection':_0x16f5e1(0x123),'children':[a0_0x31ed51(Box,{'children':[a0_0xf3cf64(Text,{'color':_0x16f5e1(0x13d),'children':_0x16f5e1(0x133)}),a0_0xf3cf64(Text,{'children':_0x16f5e1(0x127)}),_0x3600e?a0_0xf3cf64(Text,{'color':_0x16f5e1(0x131),'children':_0x3600e}):a0_0xf3cf64(Text,{'color':_0x16f5e1(0x13d),'children':_0x3d6bcc}),_0x4fbfc9&&a0_0x31ed51(Text,{'color':_0x16f5e1(0x126),'children':[_0x16f5e1(0x12c),_0x4fbfc9]})]}),!_0x4fbfc9&&!_0x3600e&&a0_0xf3cf64(Box,{'children':a0_0xf3cf64(Text,{'color':_0x16f5e1(0x13d),'children':_0x16f5e1(0x12f)})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x5e2bfb=a1_0x277e;(function(_0x19dcd2,_0x41a120){const _0x3234fb=a1_0x277e,_0x5708fa=_0x19dcd2();while(!![]){try{const _0x2ae544=-parseInt(_0x3234fb(0x1be))/0x1*(-parseInt(_0x3234fb(0x1c0))/0x2)+parseInt(_0x3234fb(0x1a6))/0x3*(-parseInt(_0x3234fb(0x1bd))/0x4)+-parseInt(_0x3234fb(0x1a4))/0x5*(-parseInt(_0x3234fb(0x1bf))/0x6)+parseInt(_0x3234fb(0x1a7))/0x7+-parseInt(_0x3234fb(0x1c3))/0x8+parseInt(_0x3234fb(0x1c7))/0x9+-parseInt(_0x3234fb(0x1b6))/0xa;if(_0x2ae544===_0x41a120)break;else _0x5708fa['push'](_0x5708fa['shift']());}catch(_0x25e0f9){_0x5708fa['push'](_0x5708fa['shift']());}}}(a1_0x9182,0x791ec));import{jsx as a1_0x43441c,jsxs as a1_0x58e780,Fragment as a1_0x539e63}from'react/jsx-runtime';function a1_0x9182(){const _0x1e7775=['4059512buIMVq','add-page','已选择页面模板\x20','正在创建页面,请稍候…','4266810PWbFvP','finally','\x20*\x20页面创建成功!','13815xKrukE','success','22635Imokrb','40208ZSqiyP','error','green','\x20*\x20路由地址:\x20','\x20*\x20页面文件已创建,可直接通过路由访问','dirname','join','then','../../templates/pages','catch','info','message','processTemplate','pages','已输入的页面路由\x20','398590NmrgDT','\x20*\x20页面路径:\x20','now','src','cwd','column','resolve','516Xxjcwl','38YaEfvs','2070uWgsFK','30718NVJyOp','gray','setLogPath'];a1_0x9182=function(){return _0x1e7775;};return a1_0x9182();}import{fileURLToPath}from'node:url';import a1_0x30d710 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0x277e(_0x1255bf,_0x43216e){_0x1255bf=_0x1255bf-0x1a4;const _0x9182e1=a1_0x9182();let _0x277ece=_0x9182e1[_0x1255bf];return _0x277ece;}import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x30d710[a1_0x5e2bfb(0x1ac)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x30d710['resolve'](__dirname,a1_0x5e2bfb(0x1af)),projectDir=process[a1_0x5e2bfb(0x1ba)]();export const AddPage=()=>{const _0x4982f2=a1_0x5e2bfb,{exit:_0x5b501a}=useApp(),[_0x50e6e5,_0x444d00]=useState(''),[_0x58e776,_0x35b254]=useState(''),[_0x4503ec,_0x35fe1d]=useState(![]),[_0x31004b,_0x3a918c]=useState(![]),_0x497c49=a1_0x30d710[_0x4982f2(0x1ad)](projectDir,_0x4982f2(0x1b9),_0x4982f2(0x1b4)),_0x3a9a6d=a1_0x30d710[_0x4982f2(0x1ad)](_0x497c49,_0x58e776),_0x2ac934=a1_0x30d710[_0x4982f2(0x1ad)](_0x4982f2(0x1b9),'pages',_0x58e776);useEffect(()=>{const _0x19aa7a=_0x4982f2,_0x32a9b9=a1_0x30d710[_0x19aa7a(0x1bc)](pageTemplateDir,_0x50e6e5);if(_0x50e6e5&&_0x58e776){_0x35fe1d(!![]),logger[_0x19aa7a(0x1c2)](process[_0x19aa7a(0x1ba)]());const _0x354615=Date[_0x19aa7a(0x1b8)]();logger[_0x19aa7a(0x1b1)](_0x19aa7a(0x1c4),'开始添加页面:\x20'+_0x58e776,{'template':_0x50e6e5,'targetPath':_0x2ac934}),TemplateReplacer[_0x19aa7a(0x1b3)](_0x32a9b9,a1_0x30d710['join'](_0x497c49,_0x58e776),_0x58e776,_0x50e6e5)[_0x19aa7a(0x1ae)](()=>{const _0x28af65=_0x19aa7a,_0x14103c=Date[_0x28af65(0x1b8)]()-_0x354615;logger[_0x28af65(0x1a5)](_0x28af65(0x1c4),'页面添加成功:\x20'+_0x58e776,_0x14103c,{'template':_0x50e6e5,'targetPath':_0x2ac934,'routePath':_0x58e776}),_0x3a918c(!![]);})[_0x19aa7a(0x1b0)](_0x2db374=>{const _0x2f602a=_0x19aa7a,_0x26d649=Date['now']()-_0x354615;logger[_0x2f602a(0x1a8)]('add-page','页面添加失败:\x20'+_0x58e776,{'template':_0x50e6e5,'targetPath':_0x2ac934,'error':_0x2db374 instanceof Error?_0x2db374[_0x2f602a(0x1b2)]:String(_0x2db374),'duration':_0x26d649});})[_0x19aa7a(0x1c8)](()=>{_0x35fe1d(![]);});}},[_0x50e6e5,_0x58e776]),useEffect(()=>{_0x31004b&&setTimeout(()=>{_0x5b501a();});},[_0x31004b]);if(_0x50e6e5)return a1_0x58e780(Box,{'flexDirection':_0x4982f2(0x1bb),'paddingY':0x1,'children':[a1_0x58e780(Box,{'children':[a1_0x43441c(Text,{'color':_0x4982f2(0x1c1),'children':'\x20Step1:\x20'}),a1_0x43441c(Text,{'children':_0x4982f2(0x1c5)}),a1_0x43441c(Text,{'color':_0x4982f2(0x1a9),'children':_0x50e6e5})]}),_0x58e776?a1_0x58e780(Box,{'children':[a1_0x43441c(Text,{'color':'gray','children':'\x20Step2:\x20'}),a1_0x43441c(Text,{'children':_0x4982f2(0x1b5)}),a1_0x43441c(Text,{'color':_0x4982f2(0x1a9),'children':_0x58e776})]}):a1_0x43441c(InputProjectCode,{'pagePath':_0x3a9a6d,'onSubmit':_0x35b254}),_0x58e776&&_0x4503ec?a1_0x58e780(Box,{'marginTop':0x1,'children':[a1_0x43441c(Box,{'width':'4'}),a1_0x43441c(Text,{'children':_0x4982f2(0x1c6)})]}):null,_0x31004b?a1_0x58e780(a1_0x539e63,{'children':[a1_0x43441c(Box,{'marginTop':0x1,'children':a1_0x43441c(Text,{'color':_0x4982f2(0x1c1),'children':_0x4982f2(0x1c9)})}),a1_0x58e780(Box,{'children':[a1_0x43441c(Text,{'color':_0x4982f2(0x1c1),'children':_0x4982f2(0x1b7)}),a1_0x43441c(Text,{'color':_0x4982f2(0x1a9),'children':_0x2ac934})]}),a1_0x58e780(Box,{'children':[a1_0x43441c(Text,{'color':'gray','children':_0x4982f2(0x1aa)}),a1_0x58e780(Text,{'color':_0x4982f2(0x1a9),'children':['/',_0x58e776]})]}),a1_0x43441c(Box,{'marginTop':0x1,'children':a1_0x43441c(Text,{'color':'cyan','children':_0x4982f2(0x1ab)})})]}):null]});return a1_0x43441c(SelectPageTemplate,{'onSelect':_0x444d00});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x245d45,_0x430d80){const _0x40aea4=a2_0x3ac2,_0x1a2f4e=_0x245d45();while(!![]){try{const _0x114fcf=-parseInt(_0x40aea4(0x143))/0x1+parseInt(_0x40aea4(0x12d))/0x2*(parseInt(_0x40aea4(0x149))/0x3)+-parseInt(_0x40aea4(0x14c))/0x4*(parseInt(_0x40aea4(0x136))/0x5)+-parseInt(_0x40aea4(0x13f))/0x6*(-parseInt(_0x40aea4(0x137))/0x7)+-parseInt(_0x40aea4(0x13c))/0x8+-parseInt(_0x40aea4(0x12e))/0x9+parseInt(_0x40aea4(0x132))/0xa;if(_0x114fcf===_0x430d80)break;else _0x1a2f4e['push'](_0x1a2f4e['shift']());}catch(_0x26bb0b){_0x1a2f4e['push'](_0x1a2f4e['shift']());}}}(a2_0x5ca1,0xba043));import{jsx as a2_0x2dadc6,jsxs as a2_0x15e7fb}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x3ac2(_0xaad4e3,_0x3ac4a8){_0xaad4e3=_0xaad4e3-0x12d;const _0x5ca1ed=a2_0x5ca1();let _0x3ac25d=_0x5ca1ed[_0xaad4e3];return _0x3ac25d;}function a2_0x5ca1(){const _0x3c506a=['localeCompare','dirname','969400YyklcQ','column','\x20Step1:\x20','resolve','templates/pages','获取模板列表失败:','2215689uGTbZh','正在加载页面模板...','blank','8ZjkkOt','name','green','2qwXyRM','6045462ASUcNB','isDirectory','map','sdk-fetch','22622220LDITsf','\x20\x20\x20\x20\x20\x20\x20\x20','filter','gray','2296850lmcHQA','133BFkKLb','length','return','请选择您要创建的页面模板','join','3004808sItsvM','label','downArrow','219978gDibyc','sort'];a2_0x5ca1=function(){return _0x3c506a;};return a2_0x5ca1();}import a2_0x46aa12 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x52c1f7=a2_0x3ac2;try{const _0x437fb1=fileURLToPath(import.meta.url),_0xf50bee=a2_0x46aa12[_0x52c1f7(0x146)](a2_0x46aa12[_0x52c1f7(0x142)](_0x437fb1),'../..'),_0x529c7f=a2_0x46aa12[_0x52c1f7(0x13b)](_0xf50bee,_0x52c1f7(0x147)),_0x50cbf1=await readdir(_0x529c7f,{'withFileTypes':!![]}),_0x3ab7b5=_0x50cbf1[_0x52c1f7(0x134)](_0x117439=>_0x117439[_0x52c1f7(0x12f)]())['map'](_0xc4fe41=>({'label':_0xc4fe41[_0x52c1f7(0x14d)]}))[_0x52c1f7(0x140)]((_0x3d5a8a,_0xe14c5c)=>_0x3d5a8a[_0x52c1f7(0x13d)][_0x52c1f7(0x141)](_0xe14c5c[_0x52c1f7(0x13d)]));return _0x3ab7b5;}catch(_0x471475){return console['error'](_0x52c1f7(0x148),_0x471475),[{'label':_0x52c1f7(0x14b)},{'label':_0x52c1f7(0x131)}];}}export function SelectPageTemplate(_0x15818b){const _0x3058dc=a2_0x3ac2,[_0x38c6b1,_0xe33809]=useState(0x0),[_0xc32722,_0x2b5201]=useState([]),[_0x42a112,_0x36e019]=useState(!![]);useEffect(()=>{async function _0x30266f(){const _0x36930a=await getTemplateList();_0x2b5201(_0x36930a),_0x36e019(![]);}_0x30266f();},[]),useInput((_0x4196be,_0x3ce929)=>{const _0xd1188b=a2_0x3ac2;if(_0x42a112)return;if(_0x3ce929[_0xd1188b(0x139)]){const _0x46acc4=_0xc32722[_0x38c6b1];_0x46acc4&&_0x15818b['onSelect'](_0x46acc4[_0xd1188b(0x13d)]);}_0x3ce929['upArrow']&&_0xe33809(_0x549b1f=>_0x549b1f===0x0?_0xc32722[_0xd1188b(0x138)]-0x1:_0x549b1f-0x1),_0x3ce929[_0xd1188b(0x13e)]&&_0xe33809(_0x5c9c4a=>_0x5c9c4a===_0xc32722['length']-0x1?0x0:_0x5c9c4a+0x1);});if(_0x42a112)return a2_0x2dadc6(Box,{'flexDirection':_0x3058dc(0x144),'paddingY':0x1,'children':a2_0x15e7fb(Box,{'children':[a2_0x2dadc6(Text,{'color':_0x3058dc(0x135),'children':_0x3058dc(0x145)}),a2_0x2dadc6(Text,{'children':_0x3058dc(0x14a)})]})});return a2_0x15e7fb(Box,{'flexDirection':_0x3058dc(0x144),'paddingY':0x1,'children':[a2_0x15e7fb(Box,{'children':[a2_0x2dadc6(Text,{'color':_0x3058dc(0x135),'children':_0x3058dc(0x145)}),a2_0x2dadc6(Text,{'children':_0x3058dc(0x13a)})]}),_0xc32722[_0x3058dc(0x130)]((_0x4fc169,_0x2ea892)=>{const _0x43fcce=_0x3058dc,_0x39991c=_0x2ea892===_0x38c6b1,_0x655219=_0x39991c?'\x20\x20\x20\x20\x20\x20>\x20'+_0x4fc169['label']:_0x43fcce(0x133)+_0x4fc169['label'];return a2_0x2dadc6(Box,{'children':a2_0x2dadc6(Text,{'color':_0x39991c?_0x43fcce(0x14e):undefined,'children':_0x655219})},_0x655219);})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x3c691e=a3_0x34fd;(function(_0x66926a,_0x402475){const _0x4d461e=a3_0x34fd,_0x33863a=_0x66926a();while(!![]){try{const _0x41244f=parseInt(_0x4d461e(0x167))/0x1*(-parseInt(_0x4d461e(0x15e))/0x2)+parseInt(_0x4d461e(0x174))/0x3*(-parseInt(_0x4d461e(0x13f))/0x4)+parseInt(_0x4d461e(0x178))/0x5*(parseInt(_0x4d461e(0x176))/0x6)+parseInt(_0x4d461e(0x140))/0x7*(-parseInt(_0x4d461e(0x15a))/0x8)+parseInt(_0x4d461e(0x16e))/0x9+parseInt(_0x4d461e(0x155))/0xa+parseInt(_0x4d461e(0x148))/0xb*(-parseInt(_0x4d461e(0x170))/0xc);if(_0x41244f===_0x402475)break;else _0x33863a['push'](_0x33863a['shift']());}catch(_0x3a0978){_0x33863a['push'](_0x33863a['shift']());}}}(a3_0x4486,0x4c819));import{jsx as a3_0x4da050,jsxs as a3_0xa8b700}from'react/jsx-runtime';function a3_0x34fd(_0x21be93,_0x5b5197){_0x21be93=_0x21be93-0x13b;const _0x448693=a3_0x4486();let _0x34fd23=_0x448693[_0x21be93];return _0x34fd23;}import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';function a3_0x4486(){const _0x2a9a50=['add','push','2NgGmhC','cursor','error','blue','column','appcode','codex','projectRoot','green','200465pNsYhw','ide','MCP\x20服务器\x20(AI\x20访问数据集)','white','[N]\x20跳过,稍后手动配置','claude','yellow','2392380VSNZqi','[\x20]','782376pJKqDJ','opencode','installing','agent','456903CyVilZ','done','18CgbEly','[Y]\x20是,配置\x20AI\x20助手','660765MIdFkp','trae','red','gray','是否同时配置\x20AI\x20助手?这将:','4PUuVRy','7BYFgYf','name','success','length','confirming','技能包\x20(研发规范指南)','codebuddy','map','11rkjNMv','downArrow','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','message','正在配置\x20AI\x20助手...','filter','skill-','dimColor','Claude\x20Code','has','qoder','delete','upArrow','4345320ePCTOl','Cursor','return','[✓]','size','2923824GTSIPB','selecting'];a3_0x4486=function(){return _0x2a9a50;};return a3_0x4486();}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x3c691e(0x15f),'claude'],SKILL_IDE_LIST=['antigravity',a3_0x3c691e(0x16c),a3_0x3c691e(0x146),a3_0x3c691e(0x164),'cursor',a3_0x3c691e(0x171),a3_0x3c691e(0x152),a3_0x3c691e(0x13b),'windsurf',a3_0x3c691e(0x173)];export function AISetupUI({config:_0x19dc08,onComplete:_0x46d5e6}){const _0x5ab42a=a3_0x3c691e,{exit:_0x448625}=useApp(),[_0x10cda9,_0x5af66b]=useState(_0x5ab42a(0x144)),[_0x4c2497,_0x573b48]=useState(0x0),[_0x29d035,_0xd4504c]=useState(new Set([0x0,0x1])),[_0x335bac,_0x3e7450]=useState(new Set(SKILL_IDE_LIST[_0x5ab42a(0x147)]((_0x370fad,_0x214879)=>_0x214879))),[_0xb1b857,_0xdc94ad]=useState('');useEffect(()=>{const _0x13c9b3=_0x5ab42a;!_0x19dc08[_0x13c9b3(0x163)]&&_0x46d5e6({'mcpResults':[],'skillResults':[]});},[_0x19dc08[_0x5ab42a(0x163)],_0x46d5e6]),useInput((_0x3addc2,_0x56f099)=>{const _0x550d8a=_0x5ab42a;if(_0x10cda9===_0x550d8a(0x144)){if(_0x3addc2==='y'||_0x3addc2==='Y'||_0x56f099['return']){_0x2882fb();return;}if(_0x3addc2==='n'||_0x3addc2==='N'){_0x46d5e6({'mcpResults':[],'skillResults':[]});return;}if(_0x56f099[_0x550d8a(0x157)]){_0x2882fb();return;}}if(_0x10cda9===_0x550d8a(0x15b)){if(_0x56f099[_0x550d8a(0x154)]){_0x573b48(_0x75e645=>_0x75e645>0x0?_0x75e645-0x1:SKILL_IDE_LIST[_0x550d8a(0x143)]-0x1);return;}if(_0x56f099[_0x550d8a(0x149)]){_0x573b48(_0x44f8e8=>_0x44f8e8<SKILL_IDE_LIST[_0x550d8a(0x143)]-0x1?_0x44f8e8+0x1:0x0);return;}if(_0x3addc2==='\x20'){const _0x205505=_0x4c2497<MCP_IDE_LIST[_0x550d8a(0x143)];if(_0x205505){const _0x451080=new Set(_0x29d035);_0x451080['has'](_0x4c2497)?_0x451080[_0x550d8a(0x153)](_0x4c2497):_0x451080[_0x550d8a(0x15c)](_0x4c2497),_0xd4504c(_0x451080);}else{const _0x1e7649=_0x4c2497-MCP_IDE_LIST[_0x550d8a(0x143)],_0xcd7d34=new Set(_0x335bac);_0xcd7d34['has'](_0x1e7649)?_0xcd7d34['delete'](_0x1e7649):_0xcd7d34[_0x550d8a(0x15c)](_0x1e7649),_0x3e7450(_0xcd7d34);}return;}if(_0x3addc2==='a'||_0x3addc2==='A'){_0xd4504c(new Set(MCP_IDE_LIST[_0x550d8a(0x147)]((_0x27092a,_0x547675)=>_0x547675))),_0x3e7450(new Set(SKILL_IDE_LIST[_0x550d8a(0x147)]((_0x44991e,_0x2f106c)=>_0x2f106c)));return;}if(_0x3addc2==='q'||_0x3addc2==='Q'){_0x448625();return;}if(_0x56f099['return']){if(_0x29d035[_0x550d8a(0x159)]===0x0&&_0x335bac['size']===0x0){_0xdc94ad('请至少选择一个配置项');return;}_0x2882fb();return;}}if(_0x10cda9===_0x550d8a(0x175)){_0x448625();return;}});async function _0x2882fb(){const _0x1d0eb2=_0x5ab42a;_0x5af66b(_0x1d0eb2(0x172));const _0x318b8a=[],_0xfc5a75=[];for(const _0x1d5b4e of _0x29d035){const _0x48f1e8=MCP_IDE_LIST[_0x1d5b4e];if(!_0x48f1e8)continue;try{const _0x598106=await configureMcp(_0x48f1e8,_0x19dc08[_0x1d0eb2(0x165)]);_0x318b8a[_0x1d0eb2(0x15d)](_0x598106);}catch(_0x405b44){_0x318b8a[_0x1d0eb2(0x15d)]({'ide':MCP_IDE_CONFIGS[_0x48f1e8]?.['name']||_0x48f1e8,'status':_0x1d0eb2(0x160),'message':_0x405b44 instanceof Error?_0x405b44[_0x1d0eb2(0x14b)]:String(_0x405b44)});}}await copySharedSkills(_0x19dc08[_0x1d0eb2(0x165)]);for(const _0x471234 of _0x335bac){const _0xd2c0ab=SKILL_IDE_LIST[_0x471234];if(!_0xd2c0ab)continue;try{const _0x3150d=await installSkill(_0xd2c0ab,_0x19dc08[_0x1d0eb2(0x165)]);_0xfc5a75[_0x1d0eb2(0x15d)](_0x3150d);}catch(_0x1ce2dc){_0xfc5a75['push']({'ide':SKILL_IDE_CONFIGS[_0xd2c0ab]?.[_0x1d0eb2(0x141)]||_0xd2c0ab,'status':_0x1d0eb2(0x160),'message':_0x1ce2dc instanceof Error?_0x1ce2dc['message']:String(_0x1ce2dc)});}}if(_0xfc5a75[_0x1d0eb2(0x143)]>0x0){const _0x4f45bc=_0xfc5a75[_0x1d0eb2(0x14d)](_0x42411e=>_0x42411e['status']===_0x1d0eb2(0x142))[_0x1d0eb2(0x147)](_0xdcf2bf=>_0xdcf2bf[_0x1d0eb2(0x168)]);_0x4f45bc['length']>0x0&&createSkillManifest(_0x19dc08[_0x1d0eb2(0x165)],_0x4f45bc);}_0x5af66b(_0x1d0eb2(0x175)),setTimeout(()=>{_0x46d5e6({'mcpResults':_0x318b8a,'skillResults':_0xfc5a75});},0xbb8);}if(_0x10cda9===_0x5ab42a(0x144))return a3_0xa8b700(Box,{'flexDirection':_0x5ab42a(0x162),'marginTop':0x1,'children':[a3_0x4da050(Box,{'marginTop':0x1,'children':a3_0x4da050(Text,{'color':'white','children':_0x5ab42a(0x13e)})}),a3_0x4da050(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x4da050(Text,{'color':'gray','children':_0x5ab42a(0x14a)})}),a3_0x4da050(Box,{'marginLeft':0x2,'children':a3_0x4da050(Text,{'color':'gray','children':'•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范'})}),a3_0xa8b700(Box,{'marginTop':0x1,'flexDirection':_0x5ab42a(0x162),'children':[a3_0x4da050(Box,{'children':a3_0x4da050(Text,{'color':_0x5ab42a(0x166),'children':_0x5ab42a(0x177)})}),a3_0x4da050(Box,{'children':a3_0x4da050(Text,{'color':_0x5ab42a(0x13d),'children':_0x5ab42a(0x16b)})}),a3_0x4da050(Box,{'children':a3_0x4da050(Text,{'color':_0x5ab42a(0x14f),'children':'Enter\x20默认:\x20是'})})]}),_0xb1b857&&a3_0x4da050(Box,{'marginTop':0x1,'children':a3_0xa8b700(Text,{'color':_0x5ab42a(0x13c),'children':['✗\x20',_0xb1b857]})})]});if(_0x10cda9===_0x5ab42a(0x15b))return a3_0xa8b700(Box,{'flexDirection':_0x5ab42a(0x162),'marginTop':0x1,'children':[a3_0x4da050(Box,{'children':a3_0x4da050(Text,{'color':'cyan','bold':!![],'children':'*\x20选择要配置的\x20IDE:'})}),_0xb1b857&&a3_0x4da050(Box,{'marginTop':0x1,'children':a3_0xa8b700(Text,{'color':_0x5ab42a(0x13c),'children':['✗\x20',_0xb1b857]})}),a3_0xa8b700(Box,{'marginTop':0x1,'flexDirection':_0x5ab42a(0x162),'children':[a3_0x4da050(Text,{'bold':!![],'color':_0x5ab42a(0x16d),'children':_0x5ab42a(0x169)}),MCP_IDE_LIST[_0x5ab42a(0x147)]((_0x340942,_0x2fa328)=>{const _0x1692e4=_0x5ab42a,_0x2ac21e=_0x4c2497===_0x2fa328,_0x1c1254=_0x29d035['has'](_0x2fa328);return a3_0x4da050(Box,{'children':a3_0xa8b700(Text,{'backgroundColor':_0x2ac21e?_0x1692e4(0x161):undefined,'color':_0x2ac21e?'white':undefined,'children':[_0x1c1254?_0x1692e4(0x158):_0x1692e4(0x16f),'\x20',_0x340942===_0x1692e4(0x15f)?_0x1692e4(0x156):_0x1692e4(0x150)]})},'mcp-'+_0x340942);}),a3_0x4da050(Box,{'marginTop':0x1,'children':a3_0x4da050(Text,{'bold':!![],'color':'yellow','children':_0x5ab42a(0x145)})}),SKILL_IDE_LIST[_0x5ab42a(0x147)]((_0x5d6674,_0x29bc3a)=>{const _0x332fbd=_0x5ab42a,_0x3d950d=_0x29bc3a+MCP_IDE_LIST['length'],_0x11e14f=_0x4c2497===_0x3d950d,_0xe2454e=_0x335bac[_0x332fbd(0x151)](_0x3d950d);return a3_0x4da050(Box,{'children':a3_0xa8b700(Text,{'backgroundColor':_0x11e14f?_0x332fbd(0x161):undefined,'color':_0x11e14f?_0x332fbd(0x16a):undefined,'children':[_0xe2454e?_0x332fbd(0x158):_0x332fbd(0x16f),'\x20',SKILL_IDE_CONFIGS[_0x5d6674][_0x332fbd(0x141)]]})},_0x332fbd(0x14e)+_0x5d6674);}),a3_0x4da050(Box,{'marginTop':0x1,'children':a3_0x4da050(Text,{'color':_0x5ab42a(0x13d),'children':'↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认'})})]})]});if(_0x10cda9===_0x5ab42a(0x172))return a3_0x4da050(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x4da050(Box,{'children':a3_0x4da050(Text,{'children':_0x5ab42a(0x14c)})})});if(_0x10cda9===_0x5ab42a(0x175))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x3c691e(0x156)},'claude':{'name':a3_0x3c691e(0x150)}};
|
package/lib/ai-setup/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x59c374=a4_0x4594;(function(_0x529ecc,_0x13a3ef){const _0x1b633b=a4_0x4594,_0x1e318d=_0x529ecc();while(!![]){try{const _0x2074f2=parseInt(_0x1b633b(0x1ed))/0x1+-parseInt(_0x1b633b(0x22b))/0x2*(-parseInt(_0x1b633b(0x1e8))/0x3)+parseInt(_0x1b633b(0x1e1))/0x4+parseInt(_0x1b633b(0x21d))/0x5*(-parseInt(_0x1b633b(0x1fe))/0x6)+parseInt(_0x1b633b(0x1e9))/0x7+parseInt(_0x1b633b(0x224))/0x8+parseInt(_0x1b633b(0x209))/0x9*(-parseInt(_0x1b633b(0x222))/0xa);if(_0x2074f2===_0x13a3ef)break;else _0x1e318d['push'](_0x1e318d['shift']());}catch(_0x595f45){_0x1e318d['push'](_0x1e318d['shift']());}}}(a4_0x4921,0x75601));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a4_0x59c374(0x20f),MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];function a4_0x4594(_0x584790,_0x463ab5){_0x584790=_0x584790-0x1de;const _0x4921fd=a4_0x4921();let _0x4594c8=_0x4921fd[_0x584790];return _0x4594c8;}function a4_0x4921(){const _0x1ca42e=['skill-install','复制\x20Cursor\x20Rules\x20文件失败','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','已写入\x20.cursor/mcp.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','../../templates/skills','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','35wQOTwC','\x20\x20\x22mcpServers\x22:\x20{','manual','app','未知的\x20IDE:\x20','30foWxdF','\x20\x20环境:\x20','1554216NjCmLG','log','node:fs','map','stringify','message','Claude\x20Code','1906646pYSnMz','需要先配置\x20appcode','../../templates/rules/lovrabet_rules.mdc.tpl','rules','\x20\x20\x20\x20}','2055420aQwfEF','error','env','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','2.0.0','success','.shared','3fhqLOn','5777814axgOPR','创建\x20Cursor\x20Rules\x20文件','\x22:\x20{','utf-8','740300eLiOPM','其他\x20IDE\x20配置指引已显示','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','创建\x20agents.md\x20文件','创建技能包\x20manifest','\x20\x20}','Claude\x20Code\x20MCP\x20命令已生成','.cursor','.lovrabet','mcpServers','object','Cursor','cursor','cwd','共享技能文件复制成功','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','\x20\x20AppCode:\x20','608862JjxdQa','不支持的\x20MCP\x20IDE:\x20','join','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','claude\x20mcp\x20add\x20','info','mcp.json','Cursor\x20MCP\x20配置失败','\x20技能包安装成功','.lovrabet/skill-manifest.json','复制\x20agents.md\x20文件失败','6108147qCzXhy','\x20技能包安装失败','lovrabet_rules.mdc','.lovrabet/skill/.shared','\x20\x20\x20\x20\x20\x20}','mcp-install','npx','\x20-e\x20LOVRABET_APP_CODE=','appcode','Cursor\x20MCP\x20配置成功','配置信息:','online','claude'];a4_0x4921=function(){return _0x1ca42e;};return a4_0x4921();}export function buildEnvConfig(_0x2f8650,_0x2d9e56){const _0x3aa0c6=a4_0x59c374,_0x789923={'LOVRABET_APP_CODE':String(_0x2f8650)};return _0x2d9e56!==_0x3aa0c6(0x214)&&(_0x789923['LOVRABET_ENV']=String(_0x2d9e56)),_0x789923;}export async function configureCursorMcp(_0x34ccc3){const _0x36cbe0=a4_0x59c374,_0x236969=_0x34ccc3||process[_0x36cbe0(0x1fa)](),_0x4af061=readConfig(_0x236969),_0x193044=_0x4af061[_0x36cbe0(0x211)]||_0x4af061['app'],_0x4e0899=_0x4af061[_0x36cbe0(0x1e3)]||_0x36cbe0(0x214);if(!_0x193044)return{'ide':'Cursor','status':_0x36cbe0(0x1e2),'message':'需要先配置\x20appcode'};const _0x1fc114=buildEnvConfig(_0x193044,_0x4e0899),_0x3f94a3={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x1fc114},_0x44a8aa=join(_0x236969,_0x36cbe0(0x1f4),_0x36cbe0(0x204)),_0x46a44e=join(_0x236969,_0x36cbe0(0x1f4));try{!existsSync(_0x46a44e)&&mkdirSync(_0x46a44e,{'recursive':!![]});let _0x2a6217={'mcpServers':{}};if(existsSync(_0x44a8aa)){const _0x556227=readFileSync(_0x44a8aa,_0x36cbe0(0x1ec));_0x2a6217=JSON['parse'](_0x556227);}return(!_0x2a6217[_0x36cbe0(0x1f6)]||typeof _0x2a6217['mcpServers']!==_0x36cbe0(0x1f7))&&(_0x2a6217[_0x36cbe0(0x1f6)]={}),_0x2a6217[_0x36cbe0(0x1f6)][MCP_SERVER_NAME]=_0x3f94a3,writeFileSync(_0x44a8aa,JSON[_0x36cbe0(0x228)](_0x2a6217,null,0x2),_0x36cbe0(0x1ec)),logger[_0x36cbe0(0x203)]('mcp-install',_0x36cbe0(0x212),{'appcode':_0x193044,'env':_0x4e0899,'path':_0x44a8aa}),await copyCursorRules(_0x46a44e),{'ide':_0x36cbe0(0x1f8),'status':_0x36cbe0(0x1e6),'message':_0x36cbe0(0x219)};}catch(_0x52f431){return logger[_0x36cbe0(0x1e2)](_0x36cbe0(0x20e),_0x36cbe0(0x205),{'error':_0x52f431 instanceof Error?_0x52f431[_0x36cbe0(0x229)]:String(_0x52f431)}),{'ide':'Cursor','status':'error','message':_0x52f431 instanceof Error?_0x52f431[_0x36cbe0(0x229)]:String(_0x52f431)};}}export async function configureClaudeMcp(_0x46f111){const _0x5206b5=a4_0x59c374,_0x110768=_0x46f111||process[_0x5206b5(0x1fa)](),_0x9c5036=readConfig(_0x110768),_0x4b62b6=_0x9c5036[_0x5206b5(0x211)]||_0x9c5036[_0x5206b5(0x220)],_0x5af3e0=_0x9c5036[_0x5206b5(0x1e3)]||_0x5206b5(0x214);if(!_0x4b62b6)return{'ide':_0x5206b5(0x22a),'status':_0x5206b5(0x1e2),'message':_0x5206b5(0x22c)};let _0x31a4cb=_0x5206b5(0x202)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x5206b5(0x200)]('\x20')+_0x5206b5(0x210)+_0x4b62b6;return _0x5af3e0!==_0x5206b5(0x214)&&(_0x31a4cb+='\x20-e\x20LOVRABET_ENV='+_0x5af3e0),await copyAgentsMd(_0x110768),logger[_0x5206b5(0x203)]('mcp-install',_0x5206b5(0x1f3),{'command':_0x31a4cb,'appcode':_0x4b62b6,'env':_0x5af3e0}),console[_0x5206b5(0x225)](_0x5206b5(0x1e4)),console[_0x5206b5(0x225)]('\x20\x20'+_0x31a4cb+'\x0a'),console[_0x5206b5(0x225)](_0x5206b5(0x213)),console[_0x5206b5(0x225)](_0x5206b5(0x1fd)+_0x4b62b6),_0x5af3e0!==_0x5206b5(0x214)&&console[_0x5206b5(0x225)](_0x5206b5(0x223)+_0x5af3e0),console['log'](_0x5206b5(0x218)),{'ide':'Claude\x20Code','status':_0x5206b5(0x21f),'message':'请手动执行:\x20'+_0x31a4cb};}export async function showOtherGuide(_0x2c5dc9){const _0x283be4=a4_0x59c374,_0x2b94cd=_0x2c5dc9||process[_0x283be4(0x1fa)](),_0x323873=readConfig(_0x2b94cd),_0x1ad954=_0x323873[_0x283be4(0x211)]||_0x323873['app'],_0x4c16f9=_0x323873['env']||_0x283be4(0x214);if(!_0x1ad954)return{'ide':'其他','status':'error','message':'需要先配置\x20appcode'};return console[_0x283be4(0x225)](_0x283be4(0x201)),console[_0x283be4(0x225)]('{'),console[_0x283be4(0x225)](_0x283be4(0x21e)),console[_0x283be4(0x225)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x283be4(0x1eb)),console[_0x283be4(0x225)]('\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22'+MCP_COMMAND+'\x22,'),console['log'](_0x283be4(0x1fc)+MCP_ARGS[_0x283be4(0x227)](_0x21f86b=>'\x22'+_0x21f86b+'\x22')[_0x283be4(0x200)](',\x20')+'],'),console[_0x283be4(0x225)](_0x283be4(0x1ef)),console[_0x283be4(0x225)](_0x283be4(0x21a)+_0x1ad954+'\x22,'),_0x4c16f9!==_0x283be4(0x214)&&console[_0x283be4(0x225)](_0x283be4(0x21c)+_0x4c16f9+'\x22,'),console['log'](_0x283be4(0x20d)),console[_0x283be4(0x225)](_0x283be4(0x1e0)),console['log'](_0x283be4(0x1f2)),console[_0x283be4(0x225)]('}\x0a'),logger[_0x283be4(0x203)](_0x283be4(0x20e),_0x283be4(0x1ee),{'appcode':_0x1ad954,'env':_0x4c16f9}),{'ide':'其他','status':_0x283be4(0x21f),'message':'配置指引已显示'};}export async function configureMcp(_0x4b7af5,_0x4a32f4){const _0x11529e=a4_0x59c374;switch(_0x4b7af5){case _0x11529e(0x1f9):return await configureCursorMcp(_0x4a32f4);case _0x11529e(0x215):return await configureClaudeMcp(_0x4a32f4);default:throw new Error(_0x11529e(0x1ff)+_0x4b7af5);}}async function copyCursorRules(_0x278d0f){const _0x465978=a4_0x59c374,_0x32d55c=join(_0x278d0f,_0x465978(0x1df)),_0xdd0c73=join(_0x32d55c,_0x465978(0x20b));if(existsSync(_0xdd0c73))return;try{!existsSync(_0x32d55c)&&mkdirSync(_0x32d55c,{'recursive':!![]});const _0x2f2c8f=resolve(__dirname,_0x465978(0x1de));existsSync(_0x2f2c8f)&&(copyFileSync(_0x2f2c8f,_0xdd0c73),logger['info'](_0x465978(0x20e),_0x465978(0x1ea),{'from':_0x2f2c8f,'to':_0xdd0c73}));}catch(_0x387c0b){logger[_0x465978(0x1e2)](_0x465978(0x20e),_0x465978(0x217),{'error':_0x387c0b instanceof Error?_0x387c0b[_0x465978(0x229)]:String(_0x387c0b)});}}async function copyAgentsMd(_0x5e53ff){const _0xe432bd=a4_0x59c374,_0x422806=join(_0x5e53ff,'agents.md');if(existsSync(_0x422806))return;try{const _0x3615a5=resolve(__dirname,_0xe432bd(0x1de));if(existsSync(_0x3615a5)){const _0xb645de=readFileSync(_0x3615a5,_0xe432bd(0x1ec));writeFileSync(_0x422806,_0xb645de,'utf-8'),logger[_0xe432bd(0x203)]('mcp-install',_0xe432bd(0x1f0),{'from':_0x3615a5,'to':_0x422806});}}catch(_0x17a0f0){logger[_0xe432bd(0x1e2)](_0xe432bd(0x20e),_0xe432bd(0x208),{'error':_0x17a0f0 instanceof Error?_0x17a0f0[_0xe432bd(0x229)]:String(_0x17a0f0)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x4951af,_0x33973a){const _0x46c6b5=a4_0x59c374,_0x4ee52b=_0x33973a||process['cwd'](),_0x5eaf07=resolve(__dirname,_0x46c6b5(0x21b)),_0x177f12=SKILL_IDE_CONFIGS[_0x4951af];if(!_0x177f12)return{'ide':_0x4951af,'status':_0x46c6b5(0x1e2),'message':_0x46c6b5(0x221)+_0x4951af};const _0x3e271d=_0x177f12['name'];try{const _0x5def32=await installSingleIDE(_0x4951af,_0x177f12,_0x4ee52b,_0x5eaf07);return logger[_0x46c6b5(0x203)](_0x46c6b5(0x216),_0x3e271d+_0x46c6b5(0x206),{'ide':_0x4951af,'filesCount':_0x5def32}),{'ide':_0x3e271d,'status':'success','message':'已创建\x20'+_0x5def32+'\x20项'};}catch(_0x55a7e3){return logger[_0x46c6b5(0x1e2)]('skill-install',_0x3e271d+_0x46c6b5(0x20a),{'error':_0x55a7e3 instanceof Error?_0x55a7e3[_0x46c6b5(0x229)]:String(_0x55a7e3)}),{'ide':_0x3e271d,'status':_0x46c6b5(0x1e2),'message':_0x55a7e3 instanceof Error?_0x55a7e3[_0x46c6b5(0x229)]:String(_0x55a7e3)};}}async function copyDir(_0x2e03ee,_0x3923da){const _0x48579c=a4_0x59c374,{statSync:_0x1c6506}=await import(_0x48579c(0x226)),{readdirSync:_0xc2f286}=await import('node:fs'),_0x10d76b=_0x1c6506(_0x2e03ee);if(_0x10d76b['isDirectory']()){!existsSync(_0x3923da)&&mkdirSync(_0x3923da,{'recursive':!![]});const _0x520e55=_0xc2f286(_0x2e03ee);for(const _0x37dae0 of _0x520e55){await copyDir(join(_0x2e03ee,_0x37dae0),join(_0x3923da,_0x37dae0));}}else copyFileSync(_0x2e03ee,_0x3923da);}export async function copySharedSkills(_0x22795a){const _0xe19dc1=a4_0x59c374,_0x49661b=_0x22795a||process['cwd'](),_0x3829df=resolve(__dirname,_0xe19dc1(0x21b)),_0xddfd4c=join(_0x3829df,_0xe19dc1(0x1e7)),_0x509340=join(_0x49661b,_0xe19dc1(0x20c));if(!existsSync(_0xddfd4c))return![];try{return await copyDir(_0xddfd4c,_0x509340),logger[_0xe19dc1(0x203)](_0xe19dc1(0x216),_0xe19dc1(0x1fb),{'path':_0x509340}),!![];}catch(_0x54fdb8){return logger[_0xe19dc1(0x1e2)](_0xe19dc1(0x216),'共享技能文件复制失败',{'error':_0x54fdb8 instanceof Error?_0x54fdb8[_0xe19dc1(0x229)]:String(_0x54fdb8)}),![];}}export function createSkillManifest(_0x4b2725,_0x45f9ac){const _0xcc9a74=a4_0x59c374,_0x4d8a2b={'version':_0xcc9a74(0x1e5),'installedAt':new Date()['toISOString'](),'platforms':_0x45f9ac},_0x36ef0b=join(_0x4b2725,_0xcc9a74(0x207)),_0x48298b=join(_0x4b2725,_0xcc9a74(0x1f5));!existsSync(_0x48298b)&&mkdirSync(_0x48298b,{'recursive':!![]}),writeFileSync(_0x36ef0b,JSON[_0xcc9a74(0x228)](_0x4d8a2b,null,0x2),_0xcc9a74(0x1ec)),logger[_0xcc9a74(0x203)](_0xcc9a74(0x216),_0xcc9a74(0x1f1),{'path':_0x36ef0b});}
|
|
1
|
+
const a4_0x567442=a4_0x5237;(function(_0xf873e9,_0x128278){const _0x2ba114=a4_0x5237,_0x37dc04=_0xf873e9();while(!![]){try{const _0x2939fe=-parseInt(_0x2ba114(0xaf))/0x1+-parseInt(_0x2ba114(0x73))/0x2*(-parseInt(_0x2ba114(0xaa))/0x3)+-parseInt(_0x2ba114(0x98))/0x4+parseInt(_0x2ba114(0x9d))/0x5+parseInt(_0x2ba114(0x99))/0x6*(-parseInt(_0x2ba114(0x8e))/0x7)+-parseInt(_0x2ba114(0x7e))/0x8+-parseInt(_0x2ba114(0x9c))/0x9*(-parseInt(_0x2ba114(0x8a))/0xa);if(_0x2939fe===_0x128278)break;else _0x37dc04['push'](_0x37dc04['shift']());}catch(_0x535476){_0x37dc04['push'](_0x37dc04['shift']());}}}(a4_0x4758,0x7f6b2));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';function a4_0x4758(){const _0xc64167=['\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','success','\x20-e\x20LOVRABET_APP_CODE=','配置信息:','1160RqhGlA','创建\x20agents.md\x20文件','共享技能文件复制成功','info','329tKZcEu','\x20\x20}','.lovrabet','\x22:\x20{','Cursor','online','message','app','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','object','1835148NXgHsL','66702xCkAOf','agents.md','配置指引已显示','167364CddLCk','1639740RSnskt','已创建\x20','共享技能文件复制失败','2.0.0','toISOString','appcode','\x20\x20AppCode:\x20','claude\x20mcp\x20add\x20','Claude\x20Code','.lovrabet/skill/.shared','env','error','已写入\x20.cursor/mcp.json','15OgPeYC','\x20技能包安装成功','join','复制\x20Cursor\x20Rules\x20文件失败','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','512073AWjYMc','Cursor\x20MCP\x20配置失败','\x20技能包安装失败','claude','.lovrabet/skill-manifest.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','lovrabet_rules.mdc','isDirectory','mcp.json','rules','\x20\x20\x20\x20\x20\x20}','请手动执行:\x20','utf-8','npx','.shared','创建技能包\x20manifest','mcpServers','mcp-install','parse','node:fs','\x20\x20\x20\x20}','cwd','skill-install','107788UJSNfn','name','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','.cursor','需要先配置\x20appcode','manual','map','\x20\x20\x22mcpServers\x22:\x20{','Cursor\x20MCP\x20配置成功','../../skills','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','5914312rpmDAG','不支持的\x20MCP\x20IDE:\x20','\x20-e\x20LOVRABET_ENV=','@lovrabet/dataset-mcp-server@latest','其他\x20IDE\x20配置指引已显示','log','stringify','../../templates/rules/lovrabet_rules.mdc.tpl'];a4_0x4758=function(){return _0xc64167;};return a4_0x4758();}const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a4_0x567442(0xbc),MCP_ARGS=[a4_0x567442(0x81)];function a4_0x5237(_0x4de52b,_0x1fd642){_0x4de52b=_0x4de52b-0x6e;const _0x4758d4=a4_0x4758();let _0x5237ae=_0x4758d4[_0x4de52b];return _0x5237ae;}export function buildEnvConfig(_0x506d08,_0x4cb254){const _0x4d743b=a4_0x567442,_0x343760={'LOVRABET_APP_CODE':String(_0x506d08)};return _0x4cb254!==_0x4d743b(0x93)&&(_0x343760['LOVRABET_ENV']=String(_0x4cb254)),_0x343760;}export async function configureCursorMcp(_0x3b5e46){const _0x7a1bb8=a4_0x567442,_0x44bcb0=_0x3b5e46||process[_0x7a1bb8(0x71)](),_0x49d540=readConfig(_0x44bcb0),_0x5469b4=_0x49d540[_0x7a1bb8(0xa2)]||_0x49d540[_0x7a1bb8(0x95)],_0x581e56=_0x49d540['env']||_0x7a1bb8(0x93);if(!_0x5469b4)return{'ide':_0x7a1bb8(0x92),'status':_0x7a1bb8(0xa8),'message':_0x7a1bb8(0x77)};const _0x5a8098=buildEnvConfig(_0x5469b4,_0x581e56),_0x214ab2={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x5a8098},_0x47ab8a=join(_0x44bcb0,_0x7a1bb8(0x76),_0x7a1bb8(0xb7)),_0x38ff55=join(_0x44bcb0,_0x7a1bb8(0x76));try{!existsSync(_0x38ff55)&&mkdirSync(_0x38ff55,{'recursive':!![]});let _0x460c3c={'mcpServers':{}};if(existsSync(_0x47ab8a)){const _0x1f7bee=readFileSync(_0x47ab8a,_0x7a1bb8(0xbb));_0x460c3c=JSON[_0x7a1bb8(0x6e)](_0x1f7bee);}return(!_0x460c3c[_0x7a1bb8(0xbf)]||typeof _0x460c3c[_0x7a1bb8(0xbf)]!==_0x7a1bb8(0x97))&&(_0x460c3c['mcpServers']={}),_0x460c3c[_0x7a1bb8(0xbf)][MCP_SERVER_NAME]=_0x214ab2,writeFileSync(_0x47ab8a,JSON[_0x7a1bb8(0x84)](_0x460c3c,null,0x2),_0x7a1bb8(0xbb)),logger[_0x7a1bb8(0x8d)](_0x7a1bb8(0xc0),_0x7a1bb8(0x7b),{'appcode':_0x5469b4,'env':_0x581e56,'path':_0x47ab8a}),await copyCursorRules(_0x38ff55),{'ide':_0x7a1bb8(0x92),'status':_0x7a1bb8(0x87),'message':_0x7a1bb8(0xa9)};}catch(_0x33c5da){return logger[_0x7a1bb8(0xa8)](_0x7a1bb8(0xc0),_0x7a1bb8(0xb0),{'error':_0x33c5da instanceof Error?_0x33c5da[_0x7a1bb8(0x94)]:String(_0x33c5da)}),{'ide':_0x7a1bb8(0x92),'status':_0x7a1bb8(0xa8),'message':_0x33c5da instanceof Error?_0x33c5da[_0x7a1bb8(0x94)]:String(_0x33c5da)};}}export async function configureClaudeMcp(_0x3c5df6){const _0x408c66=a4_0x567442,_0x4168a7=_0x3c5df6||process['cwd'](),_0x596056=readConfig(_0x4168a7),_0x3dcea1=_0x596056[_0x408c66(0xa2)]||_0x596056[_0x408c66(0x95)],_0x3eeeeb=_0x596056[_0x408c66(0xa7)]||_0x408c66(0x93);if(!_0x3dcea1)return{'ide':'Claude\x20Code','status':_0x408c66(0xa8),'message':_0x408c66(0x77)};let _0x549585=_0x408c66(0xa4)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x408c66(0xac)]('\x20')+_0x408c66(0x88)+_0x3dcea1;return _0x3eeeeb!==_0x408c66(0x93)&&(_0x549585+=_0x408c66(0x80)+_0x3eeeeb),await copyAgentsMd(_0x4168a7),logger[_0x408c66(0x8d)]('mcp-install','Claude\x20Code\x20MCP\x20命令已生成',{'command':_0x549585,'appcode':_0x3dcea1,'env':_0x3eeeeb}),console[_0x408c66(0x83)](_0x408c66(0x86)),console[_0x408c66(0x83)]('\x20\x20'+_0x549585+'\x0a'),console[_0x408c66(0x83)](_0x408c66(0x89)),console[_0x408c66(0x83)](_0x408c66(0xa3)+_0x3dcea1),_0x3eeeeb!==_0x408c66(0x93)&&console[_0x408c66(0x83)]('\x20\x20环境:\x20'+_0x3eeeeb),console[_0x408c66(0x83)]('\x20\x20重启\x20Claude\x20Code\x20后生效\x0a'),{'ide':_0x408c66(0xa5),'status':'manual','message':_0x408c66(0xba)+_0x549585};}export async function showOtherGuide(_0xdbf7a9){const _0x44bb9b=a4_0x567442,_0x15e9ae=_0xdbf7a9||process[_0x44bb9b(0x71)](),_0x19a736=readConfig(_0x15e9ae),_0xf7aebc=_0x19a736['appcode']||_0x19a736[_0x44bb9b(0x95)],_0x214556=_0x19a736[_0x44bb9b(0xa7)]||_0x44bb9b(0x93);if(!_0xf7aebc)return{'ide':'其他','status':_0x44bb9b(0xa8),'message':'需要先配置\x20appcode'};return console[_0x44bb9b(0x83)](_0x44bb9b(0xae)),console[_0x44bb9b(0x83)]('{'),console[_0x44bb9b(0x83)](_0x44bb9b(0x7a)),console[_0x44bb9b(0x83)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x44bb9b(0x91)),console[_0x44bb9b(0x83)](_0x44bb9b(0x75)+MCP_COMMAND+'\x22,'),console['log'](_0x44bb9b(0x7d)+MCP_ARGS[_0x44bb9b(0x79)](_0x4400fe=>'\x22'+_0x4400fe+'\x22')[_0x44bb9b(0xac)](',\x20')+'],'),console[_0x44bb9b(0x83)]('\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{'),console[_0x44bb9b(0x83)](_0x44bb9b(0x96)+_0xf7aebc+'\x22,'),_0x214556!==_0x44bb9b(0x93)&&console['log'](_0x44bb9b(0xb4)+_0x214556+'\x22,'),console[_0x44bb9b(0x83)](_0x44bb9b(0xb9)),console[_0x44bb9b(0x83)](_0x44bb9b(0x70)),console[_0x44bb9b(0x83)](_0x44bb9b(0x8f)),console[_0x44bb9b(0x83)]('}\x0a'),logger[_0x44bb9b(0x8d)]('mcp-install',_0x44bb9b(0x82),{'appcode':_0xf7aebc,'env':_0x214556}),{'ide':'其他','status':_0x44bb9b(0x78),'message':_0x44bb9b(0x9b)};}export async function configureMcp(_0x3ab4fd,_0x7bf3fe){const _0x16df19=a4_0x567442;switch(_0x3ab4fd){case'cursor':return await configureCursorMcp(_0x7bf3fe);case _0x16df19(0xb2):return await configureClaudeMcp(_0x7bf3fe);default:throw new Error(_0x16df19(0x7f)+_0x3ab4fd);}}async function copyCursorRules(_0x3bd544){const _0x2a4bbb=a4_0x567442,_0x1da004=join(_0x3bd544,_0x2a4bbb(0xb8)),_0x244771=join(_0x1da004,_0x2a4bbb(0xb5));if(existsSync(_0x244771))return;try{!existsSync(_0x1da004)&&mkdirSync(_0x1da004,{'recursive':!![]});const _0xaa3b93=resolve(__dirname,_0x2a4bbb(0x85));existsSync(_0xaa3b93)&&(copyFileSync(_0xaa3b93,_0x244771),logger['info'](_0x2a4bbb(0xc0),'创建\x20Cursor\x20Rules\x20文件',{'from':_0xaa3b93,'to':_0x244771}));}catch(_0x3dff52){logger[_0x2a4bbb(0xa8)](_0x2a4bbb(0xc0),_0x2a4bbb(0xad),{'error':_0x3dff52 instanceof Error?_0x3dff52[_0x2a4bbb(0x94)]:String(_0x3dff52)});}}async function copyAgentsMd(_0x26716b){const _0x3ef815=a4_0x567442,_0x55e8c5=join(_0x26716b,_0x3ef815(0x9a));if(existsSync(_0x55e8c5))return;try{const _0x2cee38=resolve(__dirname,_0x3ef815(0x85));if(existsSync(_0x2cee38)){const _0x179147=readFileSync(_0x2cee38,'utf-8');writeFileSync(_0x55e8c5,_0x179147,_0x3ef815(0xbb)),logger['info'](_0x3ef815(0xc0),_0x3ef815(0x8b),{'from':_0x2cee38,'to':_0x55e8c5});}}catch(_0x25b7e6){logger[_0x3ef815(0xa8)](_0x3ef815(0xc0),'复制\x20agents.md\x20文件失败',{'error':_0x25b7e6 instanceof Error?_0x25b7e6[_0x3ef815(0x94)]:String(_0x25b7e6)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x325ccb,_0x2e0390){const _0x134048=a4_0x567442,_0x44816f=_0x2e0390||process[_0x134048(0x71)](),_0x129cf2=resolve(__dirname,_0x134048(0x7c)),_0xf7b376=SKILL_IDE_CONFIGS[_0x325ccb];if(!_0xf7b376)return{'ide':_0x325ccb,'status':_0x134048(0xa8),'message':'未知的\x20IDE:\x20'+_0x325ccb};const _0x56f9af=_0xf7b376[_0x134048(0x74)];try{let _0x54f769;try{_0x54f769=await fetchGuidesFromCDN();}catch{}const _0xc6b911=await installSingleIDE(_0x325ccb,_0xf7b376,_0x44816f,_0x129cf2,_0x54f769);return _0x54f769&&writeGuidesToProject(_0x54f769,_0x44816f),logger[_0x134048(0x8d)](_0x134048(0x72),_0x56f9af+_0x134048(0xab),{'ide':_0x325ccb,'filesCount':_0xc6b911}),{'ide':_0x56f9af,'status':_0x134048(0x87),'message':_0x134048(0x9e)+_0xc6b911+'\x20项'};}catch(_0x17cce2){return logger[_0x134048(0xa8)](_0x134048(0x72),_0x56f9af+_0x134048(0xb1),{'error':_0x17cce2 instanceof Error?_0x17cce2['message']:String(_0x17cce2)}),{'ide':_0x56f9af,'status':_0x134048(0xa8),'message':_0x17cce2 instanceof Error?_0x17cce2[_0x134048(0x94)]:String(_0x17cce2)};}}async function copyDir(_0x577e2a,_0x3f5008){const _0x2c621d=a4_0x567442,{statSync:_0x1d16ce}=await import('node:fs'),{readdirSync:_0x17b9c7}=await import(_0x2c621d(0x6f)),_0x1adee6=_0x1d16ce(_0x577e2a);if(_0x1adee6[_0x2c621d(0xb6)]()){!existsSync(_0x3f5008)&&mkdirSync(_0x3f5008,{'recursive':!![]});const _0x4aafaf=_0x17b9c7(_0x577e2a);for(const _0x28c764 of _0x4aafaf){await copyDir(join(_0x577e2a,_0x28c764),join(_0x3f5008,_0x28c764));}}else copyFileSync(_0x577e2a,_0x3f5008);}export async function copySharedSkills(_0xb3c225){const _0x475f1a=a4_0x567442,_0x1ecbc0=_0xb3c225||process[_0x475f1a(0x71)](),_0x4b422d=resolve(__dirname,_0x475f1a(0x7c)),_0x1cc5d8=join(_0x4b422d,_0x475f1a(0xbd)),_0x33e970=join(_0x1ecbc0,_0x475f1a(0xa6));if(!existsSync(_0x1cc5d8))return![];try{return await copyDir(_0x1cc5d8,_0x33e970),logger[_0x475f1a(0x8d)](_0x475f1a(0x72),_0x475f1a(0x8c),{'path':_0x33e970}),!![];}catch(_0x5c5764){return logger['error'](_0x475f1a(0x72),_0x475f1a(0x9f),{'error':_0x5c5764 instanceof Error?_0x5c5764[_0x475f1a(0x94)]:String(_0x5c5764)}),![];}}export function createSkillManifest(_0x28e758,_0x19dd61){const _0x5fa09e=a4_0x567442,_0x1c731c={'version':_0x5fa09e(0xa0),'installedAt':new Date()[_0x5fa09e(0xa1)](),'platforms':_0x19dd61},_0x37d292=join(_0x28e758,_0x5fa09e(0xb3)),_0x222939=join(_0x28e758,_0x5fa09e(0x90));!existsSync(_0x222939)&&mkdirSync(_0x222939,{'recursive':!![]}),writeFileSync(_0x37d292,JSON['stringify'](_0x1c731c,null,0x2),'utf-8'),logger[_0x5fa09e(0x8d)](_0x5fa09e(0x72),_0x5fa09e(0xbe),{'path':_0x37d292});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a5_0x4e62(){const _0x26e837=['指定的数据集代码都不存在:\x20','*\x20输出目录:\x20','filter','正在生成\x20','env','\x1b[0m','*\x20生成的文档文件:','lovrabet\x20auth','log','white','yellow','string','383824qRGMgp','10516TPhSyA','cwd','map','filePath','column','datasetName','2176503YsEDaq','.md\x20(','gray','文档生成失败:\x20','cyan','使用配置的应用AppCode:\x20','error','red','\x1b[33m!\x20以下数据集代码不存在:\x20','join','\x1b[90m*\x20从\x20','\x20个数据集中筛选出\x20','includes','\x20个匹配的数据集\x1b[0m','setLogPath','427199FrxeyR','未找到任何数据集','\x20重新登录后再试','\x20(环境:\x20','\x20-\x20','\x20个数据集','message','dim','√\x20文档生成完成!成功\x20','*\x20共处理\x20','894490EKVXDU','datasetCode','9454104bCyvfP','success','🚀\x20','2089740cQdtWA','16MhUwHe','321jRXZNn','使用指定的应用AppCode:\x20','length','💡\x20请使用\x20','green','文档生成完成',',\x20失败\x20'];a5_0x4e62=function(){return _0x26e837;};return a5_0x4e62();}(function(_0x202e20,_0x34a3ec){const _0x8a61fc=a5_0x10a3,_0x18f6d0=_0x202e20();while(!![]){try{const _0x392923=parseInt(_0x8a61fc(0x81))/0x1+-parseInt(_0x8a61fc(0x6c))/0x2*(parseInt(_0x8a61fc(0x92))/0x3)+parseInt(_0x8a61fc(0x6b))/0x4+parseInt(_0x8a61fc(0x8b))/0x5+parseInt(_0x8a61fc(0x90))/0x6+parseInt(_0x8a61fc(0x72))/0x7*(-parseInt(_0x8a61fc(0x91))/0x8)+parseInt(_0x8a61fc(0x8d))/0x9;if(_0x392923===_0x34a3ec)break;else _0x18f6d0['push'](_0x18f6d0['shift']());}catch(_0x5ca0f3){_0x18f6d0['push'](_0x18f6d0['shift']());}}}(a5_0x4e62,0xdfb6f));import{jsx as a5_0x12e133,jsxs as a5_0x316794,Fragment as a5_0x363b2c}from'react/jsx-runtime';import{useEffect,useState}from'react';function a5_0x10a3(_0x70cdb7,_0xe55f3b){_0x70cdb7=_0x70cdb7-0x66;const _0x4e62da=a5_0x4e62();let _0x10a305=_0x4e62da[_0x70cdb7];return _0x10a305;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x446aed,env:_0x85316c,output:_0xb0b667,extraParams:_0x276741,datasetCodes:_0x81cfa})=>{const _0x60e42e=a5_0x10a3,{exit:_0x10d117}=useApp(),[_0xf39f2b,_0x590916]=useState(![]),[_0x4e3c91,_0xe04d82]=useState(''),[_0x5585ba,_0x4558d3]=useState(![]),[_0x38ee4b,_0x11697e]=useState(null),[_0x13b1db,_0x1e7217]=useState(null),[_0x14fff7,_0x517f14]=useState(0x0),_0x5c4e0e=readConfig(),_0x559001=getConfigAppCode(),_0x299fc2=_0x446aed||_0x559001,_0x5031d2=typeof _0x5c4e0e?.[_0x60e42e(0x9d)]===_0x60e42e(0x6a)?_0x5c4e0e[_0x60e42e(0x9d)]:undefined,_0x22ba9=_0x85316c||_0x5031d2||'online';initEnv(_0x22ba9);const _0x4dfc44=_0xb0b667||'./docs',_0x4323f7=_0x446aed?_0x60e42e(0x93)+_0x299fc2:_0x60e42e(0x77)+_0x299fc2;useEffect(()=>{_0x590916(!![]),_0x351a3d();},[]),useEffect(()=>{(_0x5585ba||_0x38ee4b)&&_0x10d117();},[_0x5585ba,_0x38ee4b,_0x10d117]);async function _0x351a3d(){const _0x287a05=_0x60e42e;if(!_0x299fc2){_0x11697e('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x287a05(0x80)](process[_0x287a05(0x6d)]()),_0xe04d82('正在获取数据集列表...');const {configArray:_0x20a098}=await fetchModelList(_0x299fc2);_0x517f14(_0x20a098[_0x287a05(0x94)]);if(_0x20a098[_0x287a05(0x94)]===0x0){_0x11697e(_0x287a05(0x82));return;}let _0x58f9a2=_0x20a098;if(_0x81cfa&&_0x81cfa[_0x287a05(0x94)]>0x0){_0x58f9a2=_0x20a098[_0x287a05(0x9b)](_0x1e4c28=>_0x81cfa[_0x287a05(0x7e)](_0x1e4c28[_0x287a05(0x8c)]));const _0x4f6a0f=_0x58f9a2[_0x287a05(0x6e)](_0x1fc376=>_0x1fc376[_0x287a05(0x8c)]),_0x352747=_0x81cfa[_0x287a05(0x9b)](_0x39a3f6=>!_0x4f6a0f[_0x287a05(0x7e)](_0x39a3f6));_0x352747[_0x287a05(0x94)]>0x0&&console[_0x287a05(0x67)](_0x287a05(0x7a)+_0x352747['join'](',\x20')+_0x287a05(0x9e));if(_0x58f9a2[_0x287a05(0x94)]===0x0){_0x11697e(_0x287a05(0x99)+_0x81cfa[_0x287a05(0x7b)](',\x20'));return;}console[_0x287a05(0x67)](_0x287a05(0x7c)+_0x20a098[_0x287a05(0x94)]+_0x287a05(0x7d)+_0x58f9a2['length']+_0x287a05(0x7f));}_0xe04d82(_0x287a05(0x9c)+_0x58f9a2['length']+'\x20个数据集的文档...');const _0x927ec3=await generateDatasetDocs(_0x58f9a2,_0x299fc2,_0x4dfc44,(_0x5f530b,_0x14cce3,_0x226f7d)=>{const _0x3fe3fc=_0x287a05;_0xe04d82(_0x3fe3fc(0x9c)+_0x226f7d+_0x3fe3fc(0x73)+_0x5f530b+'/'+_0x14cce3+')');},_0x276741);_0x1e7217(_0x927ec3),_0x4558d3(!![]);const _0x5d8a58=_0x927ec3['filter'](_0x1a2d23=>_0x1a2d23[_0x287a05(0x8e)])['length'],_0x521b2e=_0x927ec3['filter'](_0x3b93cb=>!_0x3b93cb[_0x287a05(0x8e)])['length'];logger[_0x287a05(0x8e)]('api-doc',_0x287a05(0x97),undefined,{'totalCount':_0x927ec3[_0x287a05(0x94)],'successCount':_0x5d8a58,'failCount':_0x521b2e,'outputDir':_0x4dfc44});}catch(_0x154e17){const _0x39946d=_0x154e17 instanceof Error?_0x154e17[_0x287a05(0x87)]:String(_0x154e17);logger[_0x287a05(0x78)]('api-doc',_0x287a05(0x75)+_0x39946d,{'appCode':_0x299fc2,'outputDir':_0x4dfc44}),_0x11697e('文档生成失败:\x20'+_0x39946d);}finally{_0x590916(![]);}}const _0x246e05=_0x13b1db?.[_0x60e42e(0x9b)](_0x24cec0=>_0x24cec0['success'])['length']||0x0,_0x1f278a=_0x13b1db?.['filter'](_0x9cdb3f=>!_0x9cdb3f[_0x60e42e(0x8e)])['length']||0x0;return a5_0x316794(Box,{'flexDirection':_0x60e42e(0x70),'children':[(_0xf39f2b||_0x5585ba)&&a5_0x316794(Box,{'children':[a5_0x12e133(Text,{'color':'gray','children':'*\x20'}),a5_0x12e133(Text,{'color':_0x446aed?_0x60e42e(0x68):'dim','children':_0x4323f7})]}),_0xf39f2b&&a5_0x12e133(Box,{'children':a5_0x316794(Text,{'children':[_0x60e42e(0x8f),_0x4e3c91,_0x60e42e(0x84),_0x22ba9,')']})}),_0x5585ba&&_0x13b1db&&a5_0x316794(Box,{'flexDirection':_0x60e42e(0x70),'children':[a5_0x12e133(Box,{'children':a5_0x316794(Text,{'color':_0x60e42e(0x96),'children':[_0x60e42e(0x89),_0x246e05,'\x20个',_0x1f278a>0x0&&_0x60e42e(0x98)+_0x1f278a+'\x20个']})}),a5_0x12e133(Box,{'marginTop':0x1,'children':a5_0x316794(Text,{'color':_0x60e42e(0x74),'children':[_0x60e42e(0x8a),_0x14fff7,_0x60e42e(0x86)]})}),a5_0x316794(Box,{'marginTop':0x1,'children':[a5_0x12e133(Text,{'color':_0x60e42e(0x74),'children':_0x60e42e(0x9a)}),a5_0x12e133(Text,{'color':_0x60e42e(0x76),'children':_0x4dfc44})]}),_0x246e05>0x0&&a5_0x316794(a5_0x363b2c,{'children':[a5_0x12e133(Box,{'marginTop':0x1,'children':a5_0x12e133(Text,{'color':_0x60e42e(0x74),'children':_0x60e42e(0x9f)})}),_0x13b1db[_0x60e42e(0x9b)](_0x216600=>_0x216600['success'])[_0x60e42e(0x6e)]((_0x45c4b1,_0x1ec463)=>a5_0x316794(Box,{'marginLeft':0x2,'children':[a5_0x316794(Text,{'color':_0x60e42e(0x76),'children':['•\x20',_0x45c4b1[_0x60e42e(0x6f)]]}),a5_0x316794(Text,{'color':'dim','children':[_0x60e42e(0x85),_0x45c4b1['datasetName']]})]},_0x1ec463))]}),_0x1f278a>0x0&&a5_0x316794(a5_0x363b2c,{'children':[a5_0x12e133(Box,{'marginTop':0x1,'children':a5_0x12e133(Text,{'color':_0x60e42e(0x69),'children':'⚠️\x20以下数据集生成失败:'})}),_0x13b1db[_0x60e42e(0x9b)](_0x726b8e=>!_0x726b8e[_0x60e42e(0x8e)])['map']((_0x57477e,_0x30f2f4)=>a5_0x316794(Box,{'marginLeft':0x2,'flexDirection':_0x60e42e(0x70),'children':[a5_0x316794(Text,{'color':'red','children':['•\x20',_0x57477e[_0x60e42e(0x71)],'\x20(',_0x57477e['datasetCode'],')']}),_0x57477e[_0x60e42e(0x78)]&&a5_0x12e133(Box,{'marginLeft':0x2,'children':a5_0x12e133(Text,{'color':_0x60e42e(0x88),'children':_0x57477e[_0x60e42e(0x78)]})})]},_0x30f2f4))]})]}),_0x38ee4b&&a5_0x316794(Box,{'flexDirection':'column','children':[a5_0x12e133(Box,{'children':a5_0x316794(Text,{'color':_0x60e42e(0x79),'children':['❌\x20',_0x38ee4b]})}),_0x38ee4b[_0x60e42e(0x7e)]('登录')&&a5_0x316794(Box,{'marginTop':0x1,'children':[a5_0x12e133(Text,{'color':'yellow','children':_0x60e42e(0x95)}),a5_0x12e133(Text,{'color':_0x60e42e(0x76),'children':_0x60e42e(0x66)}),a5_0x12e133(Text,{'color':_0x60e42e(0x69),'children':_0x60e42e(0x83)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a6_0x3227(){const _0x4b1bc8=['markdown','error','tableName','string','),HTTP状态码:\x20','生成文档失败:\x20','2507613xESoRP','join','):缺少\x20data.markdown\x20字段','json','message','6039719soSHqD','status','759192PHgaOl',']\x20正在生成:\x20','4076760zRNnom','响应数据格式错误\x20(','success','1048842mfsiwt','.md\x20-\x20','push','text','./docs','application/json','.md','3461328uAFiHQ','log','✓\x20成功生成:\x20','.md\x20(','data','stringify','获取文档失败\x20(','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2131865OCTBrS','POST','utf8','api-doc','datasetCode','length','生成文档成功:\x20','name','6gRpDzu','\x20个数据集需要生成文档\x0a'];a6_0x3227=function(){return _0x4b1bc8;};return a6_0x3227();}function a6_0x546a(_0x5cb617,_0x1d3368){_0x5cb617=_0x5cb617-0x72;const _0x3227c5=a6_0x3227();let _0x546a26=_0x3227c5[_0x5cb617];return _0x546a26;}const a6_0x54d188=a6_0x546a;(function(_0x5be4aa,_0x5c1645){const _0x282a7c=a6_0x546a,_0x51d9cf=_0x5be4aa();while(!![]){try{const _0x427d34=parseInt(_0x282a7c(0x85))/0x1+parseInt(_0x282a7c(0x8a))/0x2+-parseInt(_0x282a7c(0x7e))/0x3+parseInt(_0x282a7c(0x91))/0x4+-parseInt(_0x282a7c(0x99))/0x5+parseInt(_0x282a7c(0x76))/0x6*(-parseInt(_0x282a7c(0x83))/0x7)+parseInt(_0x282a7c(0x87))/0x8;if(_0x427d34===_0x5c1645)break;else _0x51d9cf['push'](_0x51d9cf['shift']());}catch(_0x1c0754){_0x51d9cf['push'](_0x51d9cf['shift']());}}}(a6_0x3227,0x823e7));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x1a3fb9 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x475f21){const _0x3b726a=a6_0x546a,{appCode:_0x38d17f,datasetCode:_0x11a1f6,datasetId:_0x30825b,extraParams:_0x143870}=_0x475f21,_0x3d7b80=getApiDomain(),_0x2f8814=_0x3d7b80+'/api/node-toolbox/api-doc-generator',_0x5b094e={'appCode':_0x38d17f,'datasetCode':_0x11a1f6,'datasetId':_0x30825b,..._0x143870||{}},_0x287465=await fetch(_0x2f8814,{'method':_0x3b726a(0x9a),'headers':{'Content-Type':_0x3b726a(0x8f),'Cookie':getCookie()},'body':JSON[_0x3b726a(0x96)](_0x5b094e)});if(!_0x287465['ok']){if(_0x287465[_0x3b726a(0x84)]===0x191)throw new Error(_0x3b726a(0x98));let _0x55439d='';try{_0x55439d=await _0x287465[_0x3b726a(0x8d)]();}catch(_0x3d192d){}throw new Error(_0x3b726a(0x97)+_0x11a1f6+_0x3b726a(0x7c)+_0x287465['status']+(_0x55439d?'\x0a'+_0x55439d:''));}const _0x179af1=await _0x287465[_0x3b726a(0x81)]();if(!_0x179af1[_0x3b726a(0x95)]||typeof _0x179af1[_0x3b726a(0x95)][_0x3b726a(0x78)]!==_0x3b726a(0x7b))throw new Error(_0x3b726a(0x88)+_0x11a1f6+_0x3b726a(0x80));return _0x179af1[_0x3b726a(0x95)]['markdown'];}function delay(_0x32c3ab){return new Promise(_0xafac40=>setTimeout(_0xafac40,_0x32c3ab));}export async function generateDatasetDocs(_0x110eea,_0x151ca7,_0x59634b=a6_0x54d188(0x8e),_0x275f1f,_0x4ade3a){const _0x7a76d2=a6_0x54d188;mkdirSync(_0x59634b,{'recursive':!![]});const _0xac211=[],_0x757ee5=_0x110eea[_0x7a76d2(0x73)];console[_0x7a76d2(0x92)]('\x0a共有\x20'+_0x757ee5+_0x7a76d2(0x77));for(let _0x534850=0x0;_0x534850<_0x110eea[_0x7a76d2(0x73)];_0x534850++){const _0x2d3c51=_0x110eea[_0x534850],_0x131a43=_0x534850+0x1,_0x573e0d=_0x2d3c51[_0x7a76d2(0x7a)];try{console[_0x7a76d2(0x92)]('['+_0x131a43+'/'+_0x757ee5+_0x7a76d2(0x86)+_0x573e0d+_0x7a76d2(0x94)+_0x2d3c51['name']+')');_0x275f1f&&_0x275f1f(_0x131a43,_0x757ee5,_0x573e0d);const _0x4c6ce4=await fetchDatasetDoc({'appCode':_0x151ca7,'datasetCode':_0x2d3c51[_0x7a76d2(0x72)],'datasetId':_0x2d3c51['id'],'enableAI':![],'extraParams':_0x4ade3a}),_0xab8ced=a6_0x1a3fb9[_0x7a76d2(0x7f)](_0x59634b,_0x573e0d+'.md');writeFileSync(_0xab8ced,_0x4c6ce4,{'encoding':_0x7a76d2(0x9b)}),console[_0x7a76d2(0x92)](_0x7a76d2(0x93)+_0x573e0d+_0x7a76d2(0x90)),logger[_0x7a76d2(0x89)](_0x7a76d2(0x9c),_0x7a76d2(0x74)+_0x573e0d,undefined,{'datasetCode':_0x2d3c51[_0x7a76d2(0x72)],'datasetName':_0x2d3c51[_0x7a76d2(0x75)],'filePath':_0xab8ced,'progress':_0x131a43+'/'+_0x757ee5}),_0xac211[_0x7a76d2(0x8c)]({'datasetCode':_0x2d3c51['datasetCode'],'datasetName':_0x2d3c51[_0x7a76d2(0x75)],'filePath':_0xab8ced,'success':!![]}),_0x131a43<_0x757ee5&&await delay(0x1388);}catch(_0x37c021){const _0x32c10a=_0x37c021 instanceof Error?_0x37c021[_0x7a76d2(0x82)]:String(_0x37c021);console[_0x7a76d2(0x92)]('✗\x20失败:\x20'+_0x573e0d+_0x7a76d2(0x8b)+_0x32c10a+'\x0a'),logger[_0x7a76d2(0x79)](_0x7a76d2(0x9c),_0x7a76d2(0x7d)+_0x2d3c51[_0x7a76d2(0x72)],{'datasetCode':_0x2d3c51[_0x7a76d2(0x72)],'datasetName':_0x2d3c51[_0x7a76d2(0x75)],'error':_0x32c10a,'progress':_0x131a43+'/'+_0x757ee5}),_0xac211[_0x7a76d2(0x8c)]({'datasetCode':_0x2d3c51[_0x7a76d2(0x72)],'datasetName':_0x2d3c51[_0x7a76d2(0x75)],'filePath':'','success':![],'error':_0x32c10a}),_0x131a43<_0x757ee5&&(console['log']('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0xac211;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a69b2,_0x1b5141){const _0x4654db=a7_0x2ef2,_0x1fb084=_0x1a69b2();while(!![]){try{const _0x1607cf=parseInt(_0x4654db(0xce))/0x1*(parseInt(_0x4654db(0xac))/0x2)+-parseInt(_0x4654db(0xd9))/0x3*(parseInt(_0x4654db(0xd7))/0x4)+parseInt(_0x4654db(0xb8))/0x5*(parseInt(_0x4654db(0xc5))/0x6)+parseInt(_0x4654db(0xcf))/0x7+parseInt(_0x4654db(0xcd))/0x8*(-parseInt(_0x4654db(0xd5))/0x9)+-parseInt(_0x4654db(0xab))/0xa+-parseInt(_0x4654db(0xd4))/0xb*(-parseInt(_0x4654db(0xd3))/0xc);if(_0x1607cf===_0x1b5141)break;else _0x1fb084['push'](_0x1fb084['shift']());}catch(_0x1749df){_0x1fb084['push'](_0x1fb084['shift']());}}}(a7_0x4990,0xac428));import{jsx as a7_0x3ad5e2,jsxs as a7_0x4c3dba}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a7_0x2ef2(_0x5ef8c5,_0x4924fa){_0x5ef8c5=_0x5ef8c5-0xa5;const _0x499038=a7_0x4990();let _0x2ef2bc=_0x499038[_0x5ef8c5];return _0x2ef2bc;}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a7_0x4990(){const _0x48dce5=['328NCnMTB','28752CycxmC','210819HwsmWo','length','join','duplicateCount','12fFzvNL','2006015MnQxUq','102285UkUNXk','split','36haSiWs','column','398103EBxVOV','拉取\x20API\x20配置失败:\x20','*\x20导入方式:','\x20个模型','cyan','originalCount','-api','使用配置的应用AppCode:\x20','import\x20','api','\x20个模型)','white','\x20个数据集,生成','328220vYTKeh','70rtHLnR','datasetCount','!\x20原始数据集\x20','endsWith','dim','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','.ts','使用指定的应用AppCode:\x20','client','yellow','green','slice','1005YqPsJf','env','-client','modelCount','-\x20模型配置文件\x20(','replace','setLogPath','💡\x20请使用\x20','includes','error','cwd','red','lovrabet\x20auth','35220YLRZVq','\x20重新登录后再试','√\x20成功拉取\x20','{\x20lovrabetClient\x20}','未提供应用AppCode,且配置中也没有默认值','api-pull','*\x20已生成文件:','gray'];a7_0x4990=function(){return _0x48dce5;};return a7_0x4990();}export const ApiPullUI=({appCode:_0xeeb031,env:_0x4aa4e6,output:_0x50832c})=>{const _0x47ccea=a7_0x2ef2,{exit:_0x25333a}=useApp(),[_0x4440d5,_0x1b43f2]=useState(![]),[_0x26e285,_0x152b8b]=useState(![]),[_0x182e6b,_0x222010]=useState(null),[_0x1efeb1,_0x1bd9e7]=useState(null),_0x9fe528=readConfig(),_0x92f23b=getConfigAppCode(),_0x212cc3=_0xeeb031||_0x92f23b,_0x5a5f27=typeof _0x9fe528?.[_0x47ccea(0xb9)]==='string'?_0x9fe528[_0x47ccea(0xb9)]:undefined,_0x2ac8c8=_0x4aa4e6||_0x5a5f27||'online';initEnv(_0x2ac8c8);const _0x108779=_0x50832c||'./src/api/',_0x23bb30=_0xeeb031&&_0xeeb031[_0x47ccea(0xc0)]('-')?_0xeeb031[_0x47ccea(0xd6)]('-')[_0x47ccea(0xb7)](0x1)[_0x47ccea(0xd1)]('-'):'',_0x3baa93=_0xeeb031?_0x47ccea(0xb3)+_0x212cc3:_0x47ccea(0xa5)+_0x212cc3,_0x3e9f23=_0x23bb30?_0x23bb30+_0x47ccea(0xdf):_0x47ccea(0xa7),_0xc85cdb=_0x23bb30?_0x23bb30+_0x47ccea(0xba):_0x47ccea(0xb4);useEffect(()=>{_0x1b43f2(!![]),_0x23bdf2();},[]),useEffect(()=>{(_0x26e285||_0x182e6b)&&_0x25333a();},[_0x26e285,_0x182e6b,_0x25333a]);async function _0x23bdf2(){const _0x465c6b=_0x47ccea;if(!_0x212cc3){_0x222010(_0x465c6b(0xc9));return;}try{logger[_0x465c6b(0xbe)](process[_0x465c6b(0xc2)]());const {configArray:_0x44e869}=await fetchModelList(_0x212cc3),_0x5c48a3=_0x44e869[_0x465c6b(0xd0)],_0x19477f=!_0xeeb031,_0x3960a3=await generateApiFile(_0x44e869,_0x23bb30,_0x212cc3,_0x19477f,_0x2ac8c8,_0x108779),_0x3fb553=_0x108779[_0x465c6b(0xaf)]('/')?_0x108779:_0x108779+'/';_0x1bd9e7({'api':''+_0x3fb553+_0x3e9f23+_0x465c6b(0xb2),'client':''+_0x3fb553+_0xc85cdb+'.ts','modelCount':_0x3960a3[_0x465c6b(0xbb)],'datasetCount':_0x5c48a3,'originalCount':_0x5c48a3,'duplicateCount':0x0}),_0x152b8b(!![]);}catch(_0x57cd40){const _0x415dcb=_0x57cd40 instanceof Error?_0x57cd40['message']:String(_0x57cd40);logger[_0x465c6b(0xc1)](_0x465c6b(0xca),_0x465c6b(0xda)+_0x415dcb,{'appCode':_0x212cc3,'error':_0x415dcb}),_0x222010(_0x465c6b(0xda)+_0x415dcb);}finally{_0x1b43f2(![]);}}return a7_0x4c3dba(Box,{'flexDirection':_0x47ccea(0xd8),'children':[(_0x4440d5||_0x26e285)&&a7_0x4c3dba(Box,{'children':[a7_0x3ad5e2(Text,{'color':_0x47ccea(0xcc),'children':'*\x20'}),a7_0x3ad5e2(Text,{'color':_0xeeb031?_0x47ccea(0xa9):'dim','children':_0x3baa93})]}),_0x4440d5&&a7_0x3ad5e2(Box,{'children':a7_0x4c3dba(Text,{'children':[_0x47ccea(0xb1),_0x2ac8c8,')']})}),_0x26e285&&_0x1efeb1&&a7_0x4c3dba(Box,{'flexDirection':_0x47ccea(0xd8),'children':[a7_0x3ad5e2(Box,{'children':a7_0x4c3dba(Text,{'color':_0x47ccea(0xb6),'children':[_0x47ccea(0xc7),_0x1efeb1[_0x47ccea(0xad)],_0x47ccea(0xaa),'\x20',_0x1efeb1[_0x47ccea(0xbb)],_0x47ccea(0xdc)]})}),_0x1efeb1['duplicateCount']>0x0&&a7_0x3ad5e2(Box,{'marginTop':0x1,'children':a7_0x4c3dba(Text,{'color':_0x47ccea(0xb5),'children':[_0x47ccea(0xae),_0x1efeb1[_0x47ccea(0xde)],'\x20个,过滤重复','\x20',_0x1efeb1[_0x47ccea(0xd2)],'\x20个']})}),a7_0x3ad5e2(Box,{'marginTop':0x1,'children':a7_0x3ad5e2(Text,{'color':_0x47ccea(0xcc),'children':_0x47ccea(0xcb)})}),a7_0x4c3dba(Box,{'marginLeft':0x2,'children':[a7_0x4c3dba(Text,{'color':'cyan','children':['•\x20',_0x1efeb1[_0x47ccea(0xa7)]]}),a7_0x4c3dba(Text,{'color':_0x47ccea(0xb0),'children':['\x20',_0x47ccea(0xbc),_0x1efeb1[_0x47ccea(0xbb)],_0x47ccea(0xa8)]})]}),a7_0x4c3dba(Box,{'marginLeft':0x2,'children':[a7_0x4c3dba(Text,{'color':_0x47ccea(0xdd),'children':['•\x20',_0x1efeb1['client']]}),a7_0x3ad5e2(Text,{'color':_0x47ccea(0xb0),'children':'\x20-\x20客户端实例文件'})]}),a7_0x3ad5e2(Box,{'marginTop':0x1,'children':a7_0x3ad5e2(Text,{'color':_0x47ccea(0xcc),'children':_0x47ccea(0xdb)})}),a7_0x3ad5e2(Box,{'marginLeft':0x2,'children':a7_0x4c3dba(Text,{'color':_0x47ccea(0xb5),'children':[_0x47ccea(0xa6),_0x47ccea(0xc8),'\x20from\x20\x27@/',_0x1efeb1[_0x47ccea(0xb4)]['replace'](/^\.\//,'')[_0x47ccea(0xbd)](_0x47ccea(0xb2),''),'\x27']})})]}),_0x182e6b&&a7_0x4c3dba(Box,{'flexDirection':'column','children':[a7_0x3ad5e2(Box,{'children':a7_0x4c3dba(Text,{'color':_0x47ccea(0xc3),'children':['❌\x20',_0x182e6b]})}),_0x182e6b[_0x47ccea(0xc0)]('登录')&&a7_0x4c3dba(Box,{'marginTop':0x1,'children':[a7_0x3ad5e2(Text,{'color':_0x47ccea(0xb5),'children':_0x47ccea(0xbf)}),a7_0x3ad5e2(Text,{'color':_0x47ccea(0xdd),'children':_0x47ccea(0xc4)}),a7_0x3ad5e2(Text,{'color':_0x47ccea(0xb5),'children':_0x47ccea(0xc6)})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c9608,_0x44f3d1){const _0x3e1c98=a8_0x2249,_0x27df5a=_0x1c9608();while(!![]){try{const _0x4c44aa=parseInt(_0x3e1c98(0x1a4))/0x1*(parseInt(_0x3e1c98(0x1ae))/0x2)+-parseInt(_0x3e1c98(0x199))/0x3+parseInt(_0x3e1c98(0x19d))/0x4+-parseInt(_0x3e1c98(0x1a5))/0x5+-parseInt(_0x3e1c98(0x1a7))/0x6*(-parseInt(_0x3e1c98(0x19b))/0x7)+parseInt(_0x3e1c98(0x193))/0x8+parseInt(_0x3e1c98(0x19c))/0x9*(-parseInt(_0x3e1c98(0x191))/0xa);if(_0x4c44aa===_0x44f3d1)break;else _0x27df5a['push'](_0x27df5a['shift']());}catch(_0x113a60){_0x27df5a['push'](_0x27df5a['shift']());}}}(a8_0x2fb2,0xdf426));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function a8_0x2249(_0x33444e,_0x5d5d2e){_0x33444e=_0x33444e-0x18f;const _0x2fb2c4=a8_0x2fb2();let _0x224961=_0x2fb2c4[_0x33444e];return _0x224961;}export async function fetchModelList(_0x4b232b){const _0x5d7283=a8_0x2249,_0x4d077e=getEnv(),_0x541c8d=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x4b232b+_0x5d7283(0x1ad);logger[_0x5d7283(0x1a2)](_0x5d7283(0x19f),_0x5d7283(0x1a9)+_0x4d077e+')',{'apiUrl':_0x541c8d});const _0xc3dd31=await fetch(_0x541c8d,{'headers':{'Cookie':getCookie()}});if(!_0xc3dd31['ok']){if(_0xc3dd31[_0x5d7283(0x18f)]===0x191)throw new Error(_0x5d7283(0x19e));throw new Error(_0x5d7283(0x1a3)+_0xc3dd31[_0x5d7283(0x18f)]);}const _0x4ee815=await _0xc3dd31[_0x5d7283(0x197)]();if(!_0x4ee815[_0x5d7283(0x198)]){const _0x686920=_0x4ee815[_0x5d7283(0x1a6)]||_0x4ee815['message']||_0x4ee815[_0x5d7283(0x1a0)]?.[_0x5d7283(0x1a1)]||_0x4ee815[_0x5d7283(0x19a)]||_0x4ee815[_0x5d7283(0x192)]||_0x5d7283(0x1ab);if(_0x686920[_0x5d7283(0x1a8)](_0x5d7283(0x190))||_0x686920['includes'](_0x5d7283(0x1aa))||_0x686920[_0x5d7283(0x1a8)]('登录')||_0x686920['includes']('认证')||_0x4ee815[_0x5d7283(0x195)]===_0x5d7283(0x1ac)||_0x4ee815['code']===0x191||_0x4ee815[_0x5d7283(0x194)]===_0x5d7283(0x190))throw new Error(_0x5d7283(0x19e));throw new Error(_0x5d7283(0x196)+_0x686920);}return{'configArray':_0x4ee815[_0x5d7283(0x1a0)]['configArray'],'count':_0x4ee815[_0x5d7283(0x1a0)]['count']};}function a8_0x2fb2(){const _0x3ed162=['data','message','info','获取数据集失败,HTTP状态码:\x20','10745YmwXQf','1492535gzrrBQ','errorMsg','6957636TMYjlx','includes','正在从服务器拉取模型列表...\x20(环境:\x20','Unauthorized','未知错误','UNAUTHORIZED','&otype=array','222vFqXwD','status','401','10LVuUBh','error','13246656jxnYOD','code','errorCode','获取数据集失败:\x20','json','success','3307977JalHbh','errorMessage','7MYRsuP','28622394ftNKYM','5951076pLBMux','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','fetch-model-list'];a8_0x2fb2=function(){return _0x3ed162;};return a8_0x2fb2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a9_0x337c(){const _0xa0125e=['api.ts.tpl','key','3567984YBbxtc','typescript','replaceApiContent','565WUZscY','1128312QtkcOn','templates/generate-api','format','1757LCYYjO','datasetCode','757648xGZSTE','name','env','api','app','\x22\x20}','length','712hiuCEh','130KeNNHA','success',',\x20env:\x20\x22','CONFIG_NAMES.DEFAULT','API\x20文件生成成功!','./src/api/','client','{\x20apiConfigName:\x20','utf8','string','alias','join','resolve','slice','client.ts.tpl','endsWith','init-api','-api','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','20856JWYFnX','dirname','1121448LmhqoP','-client','online','{\x20apiConfigName:\x20\x22','901656FonEdX'];a9_0x337c=function(){return _0xa0125e;};return a9_0x337c();}const a9_0x28a2a0=a9_0x453f;(function(_0xb554f7,_0x54bc8b){const _0xcf6376=a9_0x453f,_0x1b2617=_0xb554f7();while(!![]){try{const _0x26f5a8=-parseInt(_0xcf6376(0x1da))/0x1*(-parseInt(_0xcf6376(0x1e3))/0x2)+parseInt(_0xcf6376(0x1cc))/0x3+-parseInt(_0xcf6376(0x1d7))/0x4+-parseInt(_0xcf6376(0x1d6))/0x5*(-parseInt(_0xcf6376(0x1ca))/0x6)+parseInt(_0xcf6376(0x1d3))/0x7+parseInt(_0xcf6376(0x1dc))/0x8+-parseInt(_0xcf6376(0x1d0))/0x9*(parseInt(_0xcf6376(0x1e4))/0xa);if(_0x26f5a8===_0x54bc8b)break;else _0x1b2617['push'](_0x1b2617['shift']());}catch(_0xb13fb9){_0x1b2617['push'](_0x1b2617['shift']());}}}(a9_0x337c,0x6498c));import a9_0x1675ff from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a9_0x453f(_0xed8cad,_0x48756e){_0xed8cad=_0xed8cad-0x1bd;const _0x337c85=a9_0x337c();let _0x453fb3=_0x337c85[_0xed8cad];return _0x453fb3;}import a9_0x497d9e from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x19c920,_0x13c0c5='',_0x58c0a2,_0x4a9b27=![],_0x536432,_0x112e43=a9_0x28a2a0(0x1e9)){const _0x31c07e=a9_0x28a2a0,_0xf1f03f=readConfig(),_0x37c7f1=_0x58c0a2||_0xf1f03f?.[_0x31c07e(0x1e0)];if(typeof _0x37c7f1!==_0x31c07e(0x1c0)||!_0x37c7f1)throw new Error(_0x31c07e(0x1c9));const _0x243238=_0x4a9b27?_0x31c07e(0x1e7):'\x22'+_0x37c7f1+'\x22',_0x2909d2=typeof _0xf1f03f[_0x31c07e(0x1de)]===_0x31c07e(0x1c0)?_0xf1f03f[_0x31c07e(0x1de)]:undefined,_0x2bf168=_0x536432||_0x2909d2||_0x31c07e(0x1ce),_0x15091c=_0x2bf168!=='online';let _0x2b7eae;if(_0x4a9b27)_0x15091c?_0x2b7eae=_0x31c07e(0x1be)+_0x243238+_0x31c07e(0x1e6)+_0x2bf168+_0x31c07e(0x1e1):_0x2b7eae='';else{const _0x3f3db1=_0x15091c?_0x31c07e(0x1e6)+_0x2bf168+'\x22':'';_0x2b7eae=_0x31c07e(0x1cf)+_0x37c7f1+'\x22'+_0x3f3db1+'\x20}';}const _0x48057a=_0x13c0c5?_0x13c0c5+_0x31c07e(0x1c8):_0x31c07e(0x1df),_0x44d692=_0x13c0c5?_0x13c0c5+_0x31c07e(0x1cd):_0x31c07e(0x1bd),_0x27d9af=[];_0x19c920['forEach'](_0x4735e4=>{const _0x1d3e8a=_0x31c07e;_0x27d9af['push']({'datasetCode':_0x4735e4[_0x1d3e8a(0x1db)],'tableName':_0x4735e4['tableName'],'name':_0x4735e4[_0x1d3e8a(0x1dd)]||'','alias':_0x4735e4[_0x1d3e8a(0x1c1)]||_0x4735e4[_0x1d3e8a(0x1d2)]});});const _0x53c0e8=fileURLToPath(import.meta.url),_0x1ed921=a9_0x497d9e[_0x31c07e(0x1c3)](a9_0x497d9e[_0x31c07e(0x1cb)](_0x53c0e8),'../..'),_0x519fa8=a9_0x497d9e[_0x31c07e(0x1c2)](_0x1ed921,_0x31c07e(0x1d8)),_0x26c63e=a9_0x497d9e[_0x31c07e(0x1c2)](_0x519fa8,_0x31c07e(0x1d1)),_0x3ede82=a9_0x497d9e[_0x31c07e(0x1c2)](_0x519fa8,_0x31c07e(0x1c5)),_0x2767a3=_0x112e43[_0x31c07e(0x1c6)]('/')?_0x112e43[_0x31c07e(0x1c4)](0x0,-0x1):_0x112e43;mkdirSync(_0x2767a3,{'recursive':!![]});const _0x56d314=_0x27d9af[0x0]?.[_0x31c07e(0x1c1)],_0x4e109e=readFileSync(_0x26c63e,'utf8'),_0xe3c4d=TemplateReplacer[_0x31c07e(0x1d5)](_0x4e109e,_0x37c7f1,_0x27d9af,_0x56d314,_0x48057a,_0x243238),_0x5728a4=await a9_0x1675ff[_0x31c07e(0x1d9)](_0xe3c4d,{'parser':'typescript'}),_0x3fbc15=_0x2767a3+'/'+_0x48057a+'.ts';writeFileSync(_0x3fbc15,_0x5728a4,{'encoding':'utf8'});const _0x39fee6=readFileSync(_0x3ede82,_0x31c07e(0x1bf)),_0x4ec2a9=TemplateReplacer[_0x31c07e(0x1d5)](_0x39fee6,_0x37c7f1,_0x27d9af,_0x56d314,_0x48057a,_0x243238,_0x2b7eae),_0x4bf9b2=await a9_0x1675ff[_0x31c07e(0x1d9)](_0x4ec2a9,{'parser':_0x31c07e(0x1d4)}),_0x2ae4da=_0x2767a3+'/'+_0x44d692+'.ts';writeFileSync(_0x2ae4da,_0x4bf9b2,{'encoding':_0x31c07e(0x1bf)});const _0x42519d=_0x27d9af[_0x31c07e(0x1e2)];return logger[_0x31c07e(0x1e5)](_0x31c07e(0x1c7),_0x31c07e(0x1e8),undefined,{'apiFile':_0x3fbc15,'clientFile':_0x2ae4da,'modelCount':_0x42519d,'configName':_0x243238}),{'modelCount':_0x42519d,'apiFilePath':_0x3fbc15,'clientFilePath':_0x2ae4da,'configName':_0x243238};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x370ee9,_0x218bc9){const _0x5bca49=a10_0x1d9c,_0x274fdc=_0x370ee9();while(!![]){try{const _0x5d41e4=parseInt(_0x5bca49(0x1c0))/0x1+-parseInt(_0x5bca49(0x1c8))/0x2*(-parseInt(_0x5bca49(0x1ca))/0x3)+-parseInt(_0x5bca49(0x1cf))/0x4*(parseInt(_0x5bca49(0x1d4))/0x5)+-parseInt(_0x5bca49(0x1d0))/0x6*(-parseInt(_0x5bca49(0x1c4))/0x7)+parseInt(_0x5bca49(0x1c9))/0x8+parseInt(_0x5bca49(0x1f0))/0x9*(parseInt(_0x5bca49(0x1cc))/0xa)+-parseInt(_0x5bca49(0x1f6))/0xb;if(_0x5d41e4===_0x218bc9)break;else _0x274fdc['push'](_0x274fdc['shift']());}catch(_0x215105){_0x274fdc['push'](_0x274fdc['shift']());}}}(a10_0x44bc,0x6ba99));import{jsx as a10_0x409f34}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a10_0x1d9c(_0x442316,_0x31c6be){_0x442316=_0x442316-0x1c0;const _0x44bc5c=a10_0x44bc();let _0x1d9c41=_0x44bc5c[_0x442316];return _0x1d9c41;}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x2f2211){const _0x31bb41=a10_0x1d9c,_0x2f3607=_0x2f2211['input'][0x1];if(_0x2f2211[_0x31bb41(0x1db)]['help']){console[_0x31bb41(0x1c5)](_0x31bb41(0x1f7));return;}if(_0x2f3607===_0x31bb41(0x1e9)){_0x2f2211[_0x31bb41(0x1e4)][0x2]&&(console[_0x31bb41(0x1d2)](_0x31bb41(0x1eb)),console['log'](_0x31bb41(0x1c3)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1c6)+_0x2f2211['input'][0x2]),process[_0x31bb41(0x1f2)](0x1));const _0x25d04e=getConfigAppCode();let _0xa83c48=_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1e2)];const _0x43da57=typeof _0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1c1)]===_0x31bb41(0x1d1)?_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1c1)]:undefined,_0x10496c=_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1e0)];!_0xa83c48&&!_0x25d04e&&(console[_0x31bb41(0x1d2)](_0x31bb41(0x1ee)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1e7)),console['log'](_0x31bb41(0x1c7)),console['log'](_0x31bb41(0x1e1)),process[_0x31bb41(0x1f2)](0x1)),_0xa83c48&&_0x25d04e&&_0xa83c48===_0x25d04e&&(console[_0x31bb41(0x1c5)](_0x31bb41(0x1e5)+_0xa83c48+_0x31bb41(0x1c2)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1ea)),_0xa83c48=undefined),render(a10_0x409f34(ApiPullUI,{'appCode':_0xa83c48,'env':_0x43da57,'output':_0x10496c}));}else{if(_0x2f3607==='doc'){_0x2f2211['input'][0x2]&&(console[_0x31bb41(0x1d2)](_0x31bb41(0x1eb)),console['log'](_0x31bb41(0x1c3)),console[_0x31bb41(0x1c5)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x2f2211[_0x31bb41(0x1e4)][0x2]),process[_0x31bb41(0x1f2)](0x1));const _0x462beb=getConfigAppCode();let _0x77ce2f=_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1e2)];const _0x4029a1=typeof _0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1c1)]==='string'?_0x2f2211['flags'][_0x31bb41(0x1c1)]:undefined,_0x4b1d77=_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1e0)],_0x3546da=_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1f4)],_0xaaf374=_0x2f2211[_0x31bb41(0x1db)][_0x31bb41(0x1d7)];!_0x77ce2f&&!_0x462beb&&(console[_0x31bb41(0x1d2)](_0x31bb41(0x1ee)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1e7)),console['log'](_0x31bb41(0x1c7)),console[_0x31bb41(0x1c5)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process[_0x31bb41(0x1f2)](0x1));_0x77ce2f&&_0x462beb&&_0x77ce2f===_0x462beb&&(console['log'](_0x31bb41(0x1e5)+_0x77ce2f+_0x31bb41(0x1c2)),_0x77ce2f=undefined);let _0x2556af;if(_0x3546da)try{_0x2556af=JSON['parse'](_0x3546da),(typeof _0x2556af!==_0x31bb41(0x1de)||_0x2556af===null||Array[_0x31bb41(0x1e6)](_0x2556af))&&(console[_0x31bb41(0x1d2)](_0x31bb41(0x1cb)),process[_0x31bb41(0x1f2)](0x1));}catch(_0x3cb2ba){console['error'](_0x31bb41(0x1d9)),console['error'](_0x31bb41(0x1cd)+(_0x3cb2ba instanceof Error?_0x3cb2ba['message']:String(_0x3cb2ba))),process['exit'](0x1);}let _0x3e3010;_0xaaf374&&(_0x3e3010=_0xaaf374['split'](',')[_0x31bb41(0x1ce)](_0x21a571=>_0x21a571[_0x31bb41(0x1da)]())[_0x31bb41(0x1f5)](_0x5ecd98=>_0x5ecd98[_0x31bb41(0x1d5)]>0x0),_0x3e3010[_0x31bb41(0x1d5)]===0x0&&(console[_0x31bb41(0x1d2)](_0x31bb41(0x1ed)),process['exit'](0x1)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1d6)+_0x3e3010[_0x31bb41(0x1f1)](',\x20')+_0x31bb41(0x1c2))),render(a10_0x409f34(ApiDocUI,{'appCode':_0x77ce2f,'env':_0x4029a1,'output':_0x4b1d77,'extraParams':_0x2556af,'datasetCodes':_0x3e3010}));}else console[_0x31bb41(0x1d2)](_0x31bb41(0x1ef)+_0x2f3607),console[_0x31bb41(0x1c5)](_0x31bb41(0x1dc)),console['log'](_0x31bb41(0x1d3)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1e8)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1f3)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1d8)),console['log'](''),console['log'](_0x31bb41(0x1e3)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1ec)),console['log'](_0x31bb41(0x1df)),console[_0x31bb41(0x1c5)](_0x31bb41(0x1dd)),process[_0x31bb41(0x1f2)](0x1);}}function a10_0x44bc(){const _0x195917=['×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','8540pofysy','\x20\x20错误:\x20','map','876ozcjpd','210NsaADr','string','error','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','2895ATluVf','length','\x1b[90m*\x20仅生成指定数据集的文档:\x20','datasetcode','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','×\x20--params\x20参数不是有效的\x20JSON\x20格式','trim','flags','Available\x20commands:','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','output','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','appcode','\x20\x20lovrabet\x20api\x20doc\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生成\x20API\x20文档','input','\x1b[90m*\x20使用配置的应用AppCode:\x20','isArray','!\x20请使用以下方式之一:','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','pull','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','❌\x20错误:不再支持位置参数方式','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','×\x20--datasetcode\x20参数不能为空','×\x20未配置\x20AppCode','Unknown\x20api\x20command:\x20','9225PbfmIN','join','exit','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','params','filter','19735232mobjuq','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\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\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','513935UgZNzW','env','\x1b[0m','请使用\x20--appcode\x20参数,例如:','4592xMpRHx','log','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','132zZYFMx','6413448FSbPgl','6726gSfrFc'];a10_0x44bc=function(){return _0x195917;};return a10_0x44bc();}
|