@lovrabet/cli 1.3.0-beta.12 → 1.3.0-beta.13
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/cdn-config.js +1 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -0
- 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/router-updater.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ceedc,_0x49050e){const _0x50bdf8=a0_0x3703,_0x2cc238=_0x3ceedc();while(!![]){try{const _0x2f2dd3=-parseInt(_0x50bdf8(0x80))/0x1*(-parseInt(_0x50bdf8(0x79))/0x2)+-parseInt(_0x50bdf8(0x85))/0x3+parseInt(_0x50bdf8(0x88))/0x4+-parseInt(_0x50bdf8(0x81))/0x5+-parseInt(_0x50bdf8(0x8f))/0x6+-parseInt(_0x50bdf8(0x87))/0x7+parseInt(_0x50bdf8(0x78))/0x8*(parseInt(_0x50bdf8(0x84))/0x9);if(_0x2f2dd3===_0x49050e)break;else _0x2cc238['push'](_0x2cc238['shift']());}catch(_0x8a83e5){_0x2cc238['push'](_0x2cc238['shift']());}}}(a0_0x244b,0xdb11e));import{jsx as a0_0xb2775c,jsxs as a0_0x339fef}from'react/jsx-runtime';import{useState}from'react';function a0_0x3703(_0x389eb0,_0x1531e4){_0x389eb0=_0x389eb0-0x78;const _0x244bc6=a0_0x244b();let _0x37032e=_0x244bc6[_0x389eb0];return _0x37032e;}import{Text,Box,useInput}from'ink';import a0_0x57e145 from'node:fs';function a0_0x244b(){const _0x1becc2=['delete','includes','test','7PouKXJ','6878160wwVuRk','red','gray','17349786AyIkVs','4182897eSfPjj','页面路径不合法','2509255wugSdk','2425256gYRkJH','return','startsWith','existsSync','column','length','\x20←\x20','3514236yiXwPS','green','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','16vAbZjh','42740SCLmaV','路径不能包含连续的\x20/','slice','trim'];a0_0x244b=function(){return _0x1becc2;};return a0_0x244b();}export function InputProjectCode(_0x4a6800){const _0x100a75=a0_0x3703,{onSubmit:_0x2904d9,pagePath:_0x5640ef}=_0x4a6800,[_0x57ea26,_0xcbd60c]=useState(''),[_0x247a73,_0x493956]=useState(''),_0x5778d9='my-page';function _0x4896f4(_0x500b5f){const _0x247c62=a0_0x3703;if(_0x500b5f[_0x247c62(0x8d)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x500b5f[_0x247c62(0x8a)]('/')||_0x500b5f['endsWith']('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x500b5f[_0x247c62(0x7e)]('//'))return{'valid':![],'message':_0x247c62(0x7a)};const _0x3a4dfd=_0x500b5f['split']('/');for(const _0x302c8a of _0x3a4dfd){if(!_0x302c8a)continue;const _0x54891f=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x54891f[_0x247c62(0x7f)](_0x302c8a))return{'valid':![],'message':_0x247c62(0x91)};}return{'valid':!![]};}return useInput((_0x453700,_0x58bc5a)=>{const _0x2ea915=a0_0x3703;if(_0x58bc5a[_0x2ea915(0x89)]){const _0x519bcd=_0x57ea26[_0x2ea915(0x7c)]()||_0x5778d9;if(_0x247a73)return;const _0x55b723=_0x5640ef+'/'+_0x519bcd;if(a0_0x57e145[_0x2ea915(0x8b)](_0x55b723)){_0x493956('页面路径\x20'+_0x519bcd+'\x20已存在,请使用其他路径');return;}_0x2904d9(_0x519bcd),_0xcbd60c(''),_0x493956('');}else _0x58bc5a['backspace']||_0x58bc5a[_0x2ea915(0x7d)]?_0xcbd60c(_0x32b99a=>{const _0x487643=_0x2ea915,_0x1daa03=_0x32b99a[_0x487643(0x7b)](0x0,-0x1),{valid:_0x58989f,message:_0x9cc167}=_0x4896f4(_0x1daa03);return _0x493956(_0x58989f?'':_0x9cc167||_0x487643(0x86)),_0x1daa03;}):_0xcbd60c(_0x2e426b=>{const _0x32324e=_0x2ea915,_0x759a98=_0x2e426b+_0x453700,{valid:_0x1acb4d,message:_0x37a5d5}=_0x4896f4(_0x759a98);return _0x493956(_0x1acb4d?'':_0x37a5d5||_0x32324e(0x86)),_0x759a98;});}),a0_0x339fef(Box,{'flexDirection':_0x100a75(0x8c),'children':[a0_0x339fef(Box,{'children':[a0_0xb2775c(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0xb2775c(Text,{'children':'页面路由地址:\x20'}),_0x57ea26?a0_0xb2775c(Text,{'color':_0x100a75(0x90),'children':_0x57ea26}):a0_0xb2775c(Text,{'color':_0x100a75(0x83),'children':_0x5778d9}),_0x247a73&&a0_0x339fef(Text,{'color':_0x100a75(0x82),'children':[_0x100a75(0x8e),_0x247a73]})]}),!_0x247a73&&!_0x57ea26&&a0_0xb2775c(Box,{'children':a0_0xb2775c(Text,{'color':_0x100a75(0x83),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a1_0x2d9a(_0x10987d,_0x39c5bc){_0x10987d=_0x10987d-0x126;const _0x65325b=a1_0x6532();let _0x2d9a4f=_0x65325b[_0x10987d];return _0x2d9a4f;}const a1_0x5ccf01=a1_0x2d9a;(function(_0x2f86a7,_0x352aad){const _0x48f7d1=a1_0x2d9a,_0x4a930b=_0x2f86a7();while(!![]){try{const _0x583172=parseInt(_0x48f7d1(0x145))/0x1*(parseInt(_0x48f7d1(0x127))/0x2)+parseInt(_0x48f7d1(0x136))/0x3*(parseInt(_0x48f7d1(0x132))/0x4)+-parseInt(_0x48f7d1(0x149))/0x5+parseInt(_0x48f7d1(0x130))/0x6+parseInt(_0x48f7d1(0x13a))/0x7*(-parseInt(_0x48f7d1(0x141))/0x8)+-parseInt(_0x48f7d1(0x146))/0x9*(parseInt(_0x48f7d1(0x12f))/0xa)+-parseInt(_0x48f7d1(0x134))/0xb;if(_0x583172===_0x352aad)break;else _0x4a930b['push'](_0x4a930b['shift']());}catch(_0x5c3941){_0x4a930b['push'](_0x4a930b['shift']());}}}(a1_0x6532,0xc138d));import{jsx as a1_0x2815fa,jsxs as a1_0x12004a,Fragment as a1_0x2bbaeb}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x4dba54 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';function a1_0x6532(){const _0x1692dc=['210763pTiBDl','finally','processTemplate','join','页面添加成功:\x20','add-page','setLogPath','88vJShZt','green','开始添加页面:\x20','cwd','1ZteoaM','16596OPjwzz','pages','\x20Step2:\x20','3479945zscBwV','success','已输入的页面路由\x20','\x20*\x20页面路径:\x20','2695786wtOYAB','error','\x20Step1:\x20','resolve','\x20*\x20页面创建成功!','gray','column','dirname','3350plairr','8091084fodNYG','\x20*\x20路由地址:\x20','2418224cfliIg','catch','9510578SqtHpk','now','3DQIpnq','../../templates/pages','info','已选择页面模板\x20'];a1_0x6532=function(){return _0x1692dc;};return a1_0x6532();}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x4dba54[a1_0x5ccf01(0x12e)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x4dba54[a1_0x5ccf01(0x12a)](__dirname,a1_0x5ccf01(0x137)),projectDir=process[a1_0x5ccf01(0x144)]();export const AddPage=()=>{const _0x1e5555=a1_0x5ccf01,{exit:_0x5ae780}=useApp(),[_0x83e8ab,_0x44ca3b]=useState(''),[_0x52a78b,_0x166a36]=useState(''),[_0x5f3f04,_0x50a296]=useState(![]),[_0x382a79,_0x47c84f]=useState(![]),_0x49a450=a1_0x4dba54[_0x1e5555(0x13d)](projectDir,'src',_0x1e5555(0x147)),_0x28d6b3=a1_0x4dba54[_0x1e5555(0x13d)](_0x49a450,_0x52a78b),_0x5bd0ad=a1_0x4dba54[_0x1e5555(0x13d)]('src','pages',_0x52a78b);useEffect(()=>{const _0x2b7dcc=_0x1e5555,_0x37339f=a1_0x4dba54[_0x2b7dcc(0x12a)](pageTemplateDir,_0x83e8ab);if(_0x83e8ab&&_0x52a78b){_0x50a296(!![]),logger[_0x2b7dcc(0x140)](process[_0x2b7dcc(0x144)]());const _0x15a329=Date[_0x2b7dcc(0x135)]();logger[_0x2b7dcc(0x138)](_0x2b7dcc(0x13f),_0x2b7dcc(0x143)+_0x52a78b,{'template':_0x83e8ab,'targetPath':_0x5bd0ad}),TemplateReplacer[_0x2b7dcc(0x13c)](_0x37339f,a1_0x4dba54['join'](_0x49a450,_0x52a78b),_0x52a78b,_0x83e8ab)['then'](()=>{const _0x1c4ad6=_0x2b7dcc,_0xc1f838=Date[_0x1c4ad6(0x135)]()-_0x15a329;logger[_0x1c4ad6(0x14a)](_0x1c4ad6(0x13f),_0x1c4ad6(0x13e)+_0x52a78b,_0xc1f838,{'template':_0x83e8ab,'targetPath':_0x5bd0ad,'routePath':_0x52a78b}),_0x47c84f(!![]);})[_0x2b7dcc(0x133)](_0x11abf2=>{const _0x18a24a=_0x2b7dcc,_0x3f2152=Date[_0x18a24a(0x135)]()-_0x15a329;logger[_0x18a24a(0x128)](_0x18a24a(0x13f),'页面添加失败:\x20'+_0x52a78b,{'template':_0x83e8ab,'targetPath':_0x5bd0ad,'error':_0x11abf2 instanceof Error?_0x11abf2['message']:String(_0x11abf2),'duration':_0x3f2152});})[_0x2b7dcc(0x13b)](()=>{_0x50a296(![]);});}},[_0x83e8ab,_0x52a78b]),useEffect(()=>{_0x382a79&&setTimeout(()=>{_0x5ae780();});},[_0x382a79]);if(_0x83e8ab)return a1_0x12004a(Box,{'flexDirection':_0x1e5555(0x12d),'paddingY':0x1,'children':[a1_0x12004a(Box,{'children':[a1_0x2815fa(Text,{'color':_0x1e5555(0x12c),'children':_0x1e5555(0x129)}),a1_0x2815fa(Text,{'children':_0x1e5555(0x139)}),a1_0x2815fa(Text,{'color':_0x1e5555(0x142),'children':_0x83e8ab})]}),_0x52a78b?a1_0x12004a(Box,{'children':[a1_0x2815fa(Text,{'color':_0x1e5555(0x12c),'children':_0x1e5555(0x148)}),a1_0x2815fa(Text,{'children':_0x1e5555(0x14b)}),a1_0x2815fa(Text,{'color':_0x1e5555(0x142),'children':_0x52a78b})]}):a1_0x2815fa(InputProjectCode,{'pagePath':_0x28d6b3,'onSubmit':_0x166a36}),_0x52a78b&&_0x5f3f04?a1_0x12004a(Box,{'marginTop':0x1,'children':[a1_0x2815fa(Box,{'width':'4'}),a1_0x2815fa(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x382a79?a1_0x12004a(a1_0x2bbaeb,{'children':[a1_0x2815fa(Box,{'marginTop':0x1,'children':a1_0x2815fa(Text,{'color':_0x1e5555(0x12c),'children':_0x1e5555(0x12b)})}),a1_0x12004a(Box,{'children':[a1_0x2815fa(Text,{'color':'gray','children':_0x1e5555(0x126)}),a1_0x2815fa(Text,{'color':'green','children':_0x5bd0ad})]}),a1_0x12004a(Box,{'children':[a1_0x2815fa(Text,{'color':'gray','children':_0x1e5555(0x131)}),a1_0x12004a(Text,{'color':_0x1e5555(0x142),'children':['/',_0x52a78b]})]}),a1_0x2815fa(Box,{'marginTop':0x1,'children':a1_0x2815fa(Text,{'color':'cyan','children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x2815fa(SelectPageTemplate,{'onSelect':_0x44ca3b});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f0d48,_0x2d0239){const _0x483fad=a2_0x5748,_0x23b283=_0x4f0d48();while(!![]){try{const _0x527819=-parseInt(_0x483fad(0x1c8))/0x1+-parseInt(_0x483fad(0x1bd))/0x2*(parseInt(_0x483fad(0x1be))/0x3)+parseInt(_0x483fad(0x1c7))/0x4*(-parseInt(_0x483fad(0x1cb))/0x5)+-parseInt(_0x483fad(0x1c3))/0x6*(parseInt(_0x483fad(0x1bc))/0x7)+-parseInt(_0x483fad(0x1ae))/0x8*(-parseInt(_0x483fad(0x1b3))/0x9)+parseInt(_0x483fad(0x1c5))/0xa+parseInt(_0x483fad(0x1b8))/0xb;if(_0x527819===_0x2d0239)break;else _0x23b283['push'](_0x23b283['shift']());}catch(_0x230763){_0x23b283['push'](_0x23b283['shift']());}}}(a2_0x5d56,0x87c4b));import{jsx as a2_0x7a0380,jsxs as a2_0x21fe54}from'react/jsx-runtime';function a2_0x5d56(){const _0x4778f5=['661238cxIGmW','localeCompare','sort','2706195EGpNCj','dirname','15144fQkxOY','../..','sdk-fetch','filter','gray','2637yfqRaO','length','name','templates/pages','label','40221071jcDDDI','获取模板列表失败:','\x20Step1:\x20','isDirectory','3400831kLlXFo','2174608JmDZBl','3mrPwlE','column','blank','\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20>\x20','12qkQULO','join','1476830EMDreI','downArrow','8MHvTbQ'];a2_0x5d56=function(){return _0x4778f5;};return a2_0x5d56();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x36c249 from'node:path';import{fileURLToPath}from'node:url';function a2_0x5748(_0x53b9f4,_0x4962b2){_0x53b9f4=_0x53b9f4-0x1ad;const _0x5d56f9=a2_0x5d56();let _0x5748a0=_0x5d56f9[_0x53b9f4];return _0x5748a0;}async function getTemplateList(){const _0x2e6803=a2_0x5748;try{const _0x4b95f7=fileURLToPath(import.meta.url),_0x4e9aef=a2_0x36c249['resolve'](a2_0x36c249[_0x2e6803(0x1ad)](_0x4b95f7),_0x2e6803(0x1af)),_0x2d1c5d=a2_0x36c249[_0x2e6803(0x1c4)](_0x4e9aef,_0x2e6803(0x1b6)),_0x1ebc9c=await readdir(_0x2d1c5d,{'withFileTypes':!![]}),_0x2f5507=_0x1ebc9c[_0x2e6803(0x1b1)](_0x39d75d=>_0x39d75d[_0x2e6803(0x1bb)]())['map'](_0x781dd4=>({'label':_0x781dd4[_0x2e6803(0x1b5)]}))[_0x2e6803(0x1ca)]((_0x25ed41,_0x5a97cc)=>_0x25ed41[_0x2e6803(0x1b7)][_0x2e6803(0x1c9)](_0x5a97cc['label']));return _0x2f5507;}catch(_0x196316){return console['error'](_0x2e6803(0x1b9),_0x196316),[{'label':_0x2e6803(0x1c0)},{'label':_0x2e6803(0x1b0)}];}}export function SelectPageTemplate(_0x5edfd9){const _0x22828a=a2_0x5748,[_0x4bb2ae,_0x2e429e]=useState(0x0),[_0x36fb1b,_0x2805fd]=useState([]),[_0x42dbe7,_0x31af08]=useState(!![]);useEffect(()=>{async function _0x20b08a(){const _0x5e0fa6=await getTemplateList();_0x2805fd(_0x5e0fa6),_0x31af08(![]);}_0x20b08a();},[]),useInput((_0x430441,_0x35eb63)=>{const _0x3963ee=a2_0x5748;if(_0x42dbe7)return;if(_0x35eb63['return']){const _0x715ffa=_0x36fb1b[_0x4bb2ae];_0x715ffa&&_0x5edfd9['onSelect'](_0x715ffa[_0x3963ee(0x1b7)]);}_0x35eb63['upArrow']&&_0x2e429e(_0x2ff1b0=>_0x2ff1b0===0x0?_0x36fb1b[_0x3963ee(0x1b4)]-0x1:_0x2ff1b0-0x1),_0x35eb63[_0x3963ee(0x1c6)]&&_0x2e429e(_0x1c6b46=>_0x1c6b46===_0x36fb1b[_0x3963ee(0x1b4)]-0x1?0x0:_0x1c6b46+0x1);});if(_0x42dbe7)return a2_0x7a0380(Box,{'flexDirection':_0x22828a(0x1bf),'paddingY':0x1,'children':a2_0x21fe54(Box,{'children':[a2_0x7a0380(Text,{'color':_0x22828a(0x1b2),'children':_0x22828a(0x1ba)}),a2_0x7a0380(Text,{'children':'正在加载页面模板...'})]})});return a2_0x21fe54(Box,{'flexDirection':_0x22828a(0x1bf),'paddingY':0x1,'children':[a2_0x21fe54(Box,{'children':[a2_0x7a0380(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x7a0380(Text,{'children':'请选择您要创建的页面模板'})]}),_0x36fb1b['map']((_0x2e958f,_0x258093)=>{const _0x4a46bc=_0x22828a,_0x52540d=_0x258093===_0x4bb2ae,_0x1d2ba2=_0x52540d?_0x4a46bc(0x1c2)+_0x2e958f[_0x4a46bc(0x1b7)]:_0x4a46bc(0x1c1)+_0x2e958f[_0x4a46bc(0x1b7)];return a2_0x7a0380(Box,{'children':a2_0x7a0380(Text,{'color':_0x52540d?'green':undefined,'children':_0x1d2ba2})},_0x1d2ba2);})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x542424=a3_0x5353;(function(_0x48a362,_0x25119f){const _0x13fd7a=a3_0x5353,_0x23b824=_0x48a362();while(!![]){try{const _0x1b7836=-parseInt(_0x13fd7a(0x1fc))/0x1+parseInt(_0x13fd7a(0x1ec))/0x2+parseInt(_0x13fd7a(0x21f))/0x3*(parseInt(_0x13fd7a(0x207))/0x4)+parseInt(_0x13fd7a(0x1f4))/0x5*(-parseInt(_0x13fd7a(0x205))/0x6)+parseInt(_0x13fd7a(0x1fa))/0x7*(parseInt(_0x13fd7a(0x1f9))/0x8)+-parseInt(_0x13fd7a(0x1f1))/0x9+parseInt(_0x13fd7a(0x1ea))/0xa;if(_0x1b7836===_0x25119f)break;else _0x23b824['push'](_0x23b824['shift']());}catch(_0x11eb20){_0x23b824['push'](_0x23b824['shift']());}}}(a3_0x4ce7,0x747d5));import{jsx as a3_0x122647,jsxs as a3_0xab9355}from'react/jsx-runtime';import{useState,useEffect}from'react';function a3_0x4ce7(){const _0x4f5e62=['has','appcode','cursor','return','gray','694797daHHqA','正在配置\x20AI\x20助手...','agent','mcp-','yellow','技能包\x20(研发规范指南)','Claude\x20Code','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','windsurf','claude','6015700IbwoDj','filter','1718878bMXjKj','confirming','name','column','请至少选择一个配置项','1337481rCSScj','red','push','328285xhuSNR','*\x20选择要配置的\x20IDE:','installing','size','ide','8488OMxZWK','959HJrVBc','selecting','721587IpNyFq','upArrow','opencode','blue','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','green','codex','[\x20]','add','66wNOqYP','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','8yjMkry','projectRoot','dimColor','[Y]\x20是,配置\x20AI\x20助手','error','done','Cursor','qoder','map','delete','trae','white','success','cyan','antigravity','length','message','[✓]','status'];a3_0x4ce7=function(){return _0x4f5e62;};return a3_0x4ce7();}import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';function a3_0x5353(_0x3e1723,_0x4ec607){_0x3e1723=_0x3e1723-0x1e8;const _0x4ce7aa=a3_0x4ce7();let _0x535317=_0x4ce7aa[_0x3e1723];return _0x535317;}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x542424(0x21c),a3_0x542424(0x1e9)],SKILL_IDE_LIST=[a3_0x542424(0x215),a3_0x542424(0x1e9),'codebuddy',a3_0x542424(0x202),a3_0x542424(0x21c),a3_0x542424(0x1fe),a3_0x542424(0x20e),a3_0x542424(0x211),a3_0x542424(0x1e8),a3_0x542424(0x221)];export function AISetupUI({config:_0x2607f7,onComplete:_0x155f26}){const _0x15b579=a3_0x542424,{exit:_0x3dabf0}=useApp(),[_0x2f3640,_0x17252d]=useState(_0x15b579(0x1ed)),[_0x20868a,_0x2193b9]=useState(0x0),[_0x217cd4,_0x3fbd47]=useState(new Set([0x0,0x1])),[_0x3f119f,_0x4629b5]=useState(new Set(SKILL_IDE_LIST[_0x15b579(0x20f)]((_0x11558f,_0x1cd9b5)=>_0x1cd9b5))),[_0x448ae0,_0x4e5762]=useState('');useEffect(()=>{const _0x4d4420=_0x15b579;!_0x2607f7[_0x4d4420(0x21b)]&&_0x155f26({'mcpResults':[],'skillResults':[]});},[_0x2607f7['appcode'],_0x155f26]),useInput((_0x13bc36,_0x26068e)=>{const _0x550c03=_0x15b579;if(_0x2f3640===_0x550c03(0x1ed)){if(_0x13bc36==='y'||_0x13bc36==='Y'||_0x26068e['return']){_0x33476f();return;}if(_0x13bc36==='n'||_0x13bc36==='N'){_0x155f26({'mcpResults':[],'skillResults':[]});return;}if(_0x26068e[_0x550c03(0x21d)]){_0x33476f();return;}}if(_0x2f3640===_0x550c03(0x1fb)){if(_0x26068e[_0x550c03(0x1fd)]){_0x2193b9(_0x44a643=>_0x44a643>0x0?_0x44a643-0x1:SKILL_IDE_LIST['length']-0x1);return;}if(_0x26068e['downArrow']){_0x2193b9(_0x21798f=>_0x21798f<SKILL_IDE_LIST[_0x550c03(0x216)]-0x1?_0x21798f+0x1:0x0);return;}if(_0x13bc36==='\x20'){const _0x270cf8=_0x20868a<MCP_IDE_LIST['length'];if(_0x270cf8){const _0xa69e0a=new Set(_0x217cd4);_0xa69e0a[_0x550c03(0x21a)](_0x20868a)?_0xa69e0a[_0x550c03(0x210)](_0x20868a):_0xa69e0a[_0x550c03(0x204)](_0x20868a),_0x3fbd47(_0xa69e0a);}else{const _0x2837e0=_0x20868a-MCP_IDE_LIST[_0x550c03(0x216)],_0x2a4ea2=new Set(_0x3f119f);_0x2a4ea2[_0x550c03(0x21a)](_0x2837e0)?_0x2a4ea2[_0x550c03(0x210)](_0x2837e0):_0x2a4ea2['add'](_0x2837e0),_0x4629b5(_0x2a4ea2);}return;}if(_0x13bc36==='a'||_0x13bc36==='A'){_0x3fbd47(new Set(MCP_IDE_LIST[_0x550c03(0x20f)]((_0xa16a96,_0x8c5606)=>_0x8c5606))),_0x4629b5(new Set(SKILL_IDE_LIST['map']((_0x38b77f,_0x12c825)=>_0x12c825)));return;}if(_0x13bc36==='q'||_0x13bc36==='Q'){_0x3dabf0();return;}if(_0x26068e['return']){if(_0x217cd4['size']===0x0&&_0x3f119f[_0x550c03(0x1f7)]===0x0){_0x4e5762(_0x550c03(0x1f0));return;}_0x33476f();return;}}if(_0x2f3640==='done'){_0x3dabf0();return;}});async function _0x33476f(){const _0x146a06=_0x15b579;_0x17252d(_0x146a06(0x1f6));const _0x5ce478=[],_0x295738=[];for(const _0x2f8f0d of _0x217cd4){const _0x2c337d=MCP_IDE_LIST[_0x2f8f0d];if(!_0x2c337d)continue;try{const _0x2b01e5=await configureMcp(_0x2c337d,_0x2607f7[_0x146a06(0x208)]);_0x5ce478[_0x146a06(0x1f3)](_0x2b01e5);}catch(_0x92ebb){_0x5ce478[_0x146a06(0x1f3)]({'ide':MCP_IDE_CONFIGS[_0x2c337d]?.[_0x146a06(0x1ee)]||_0x2c337d,'status':_0x146a06(0x20b),'message':_0x92ebb instanceof Error?_0x92ebb[_0x146a06(0x217)]:String(_0x92ebb)});}}await copySharedSkills(_0x2607f7[_0x146a06(0x208)]);for(const _0x59ccaf of _0x3f119f){const _0x1843d0=SKILL_IDE_LIST[_0x59ccaf];if(!_0x1843d0)continue;try{const _0x351ab5=await installSkill(_0x1843d0,_0x2607f7[_0x146a06(0x208)]);_0x295738[_0x146a06(0x1f3)](_0x351ab5);}catch(_0x236aaf){_0x295738[_0x146a06(0x1f3)]({'ide':SKILL_IDE_CONFIGS[_0x1843d0]?.[_0x146a06(0x1ee)]||_0x1843d0,'status':'error','message':_0x236aaf instanceof Error?_0x236aaf[_0x146a06(0x217)]:String(_0x236aaf)});}}if(_0x295738['length']>0x0){const _0x5078df=_0x295738[_0x146a06(0x1eb)](_0x11d0e4=>_0x11d0e4[_0x146a06(0x219)]===_0x146a06(0x213))[_0x146a06(0x20f)](_0x1b4091=>_0x1b4091[_0x146a06(0x1f8)]);_0x5078df[_0x146a06(0x216)]>0x0&&createSkillManifest(_0x2607f7[_0x146a06(0x208)],_0x5078df);}_0x17252d(_0x146a06(0x20c)),setTimeout(()=>{_0x155f26({'mcpResults':_0x5ce478,'skillResults':_0x295738});},0xbb8);}if(_0x2f3640==='confirming')return a3_0xab9355(Box,{'flexDirection':_0x15b579(0x1ef),'marginTop':0x1,'children':[a3_0x122647(Box,{'marginTop':0x1,'children':a3_0x122647(Text,{'color':'white','children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x122647(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x122647(Text,{'color':_0x15b579(0x21e),'children':_0x15b579(0x200)})}),a3_0x122647(Box,{'marginLeft':0x2,'children':a3_0x122647(Text,{'color':_0x15b579(0x21e),'children':_0x15b579(0x226)})}),a3_0xab9355(Box,{'marginTop':0x1,'flexDirection':'column','children':[a3_0x122647(Box,{'children':a3_0x122647(Text,{'color':_0x15b579(0x201),'children':_0x15b579(0x20a)})}),a3_0x122647(Box,{'children':a3_0x122647(Text,{'color':_0x15b579(0x21e),'children':'[N]\x20跳过,稍后手动配置'})}),a3_0x122647(Box,{'children':a3_0x122647(Text,{'color':_0x15b579(0x209),'children':'Enter\x20默认:\x20是'})})]}),_0x448ae0&&a3_0x122647(Box,{'marginTop':0x1,'children':a3_0xab9355(Text,{'color':_0x15b579(0x1f2),'children':['✗\x20',_0x448ae0]})})]});if(_0x2f3640===_0x15b579(0x1fb))return a3_0xab9355(Box,{'flexDirection':'column','marginTop':0x1,'children':[a3_0x122647(Box,{'children':a3_0x122647(Text,{'color':_0x15b579(0x214),'bold':!![],'children':_0x15b579(0x1f5)})}),_0x448ae0&&a3_0x122647(Box,{'marginTop':0x1,'children':a3_0xab9355(Text,{'color':_0x15b579(0x1f2),'children':['✗\x20',_0x448ae0]})}),a3_0xab9355(Box,{'marginTop':0x1,'flexDirection':'column','children':[a3_0x122647(Text,{'bold':!![],'color':_0x15b579(0x223),'children':'MCP\x20服务器\x20(AI\x20访问数据集)'}),MCP_IDE_LIST[_0x15b579(0x20f)]((_0x4b1c50,_0x6dd388)=>{const _0x28dfa9=_0x15b579,_0x1beafc=_0x20868a===_0x6dd388,_0x2a8158=_0x217cd4[_0x28dfa9(0x21a)](_0x6dd388);return a3_0x122647(Box,{'children':a3_0xab9355(Text,{'backgroundColor':_0x1beafc?'blue':undefined,'color':_0x1beafc?_0x28dfa9(0x212):undefined,'children':[_0x2a8158?_0x28dfa9(0x218):'[\x20]','\x20',_0x4b1c50===_0x28dfa9(0x21c)?_0x28dfa9(0x20d):_0x28dfa9(0x225)]})},_0x28dfa9(0x222)+_0x4b1c50);}),a3_0x122647(Box,{'marginTop':0x1,'children':a3_0x122647(Text,{'bold':!![],'color':_0x15b579(0x223),'children':_0x15b579(0x224)})}),SKILL_IDE_LIST[_0x15b579(0x20f)]((_0x2f8600,_0x59862a)=>{const _0x416a0f=_0x15b579,_0x3aa132=_0x59862a+MCP_IDE_LIST['length'],_0x1ff247=_0x20868a===_0x3aa132,_0x349874=_0x3f119f[_0x416a0f(0x21a)](_0x3aa132);return a3_0x122647(Box,{'children':a3_0xab9355(Text,{'backgroundColor':_0x1ff247?_0x416a0f(0x1ff):undefined,'color':_0x1ff247?_0x416a0f(0x212):undefined,'children':[_0x349874?_0x416a0f(0x218):_0x416a0f(0x203),'\x20',SKILL_IDE_CONFIGS[_0x2f8600][_0x416a0f(0x1ee)]]})},'skill-'+_0x2f8600);}),a3_0x122647(Box,{'marginTop':0x1,'children':a3_0x122647(Text,{'color':_0x15b579(0x21e),'children':_0x15b579(0x206)})})]})]});if(_0x2f3640===_0x15b579(0x1f6))return a3_0x122647(Box,{'flexDirection':_0x15b579(0x1ef),'marginTop':0x1,'children':a3_0x122647(Box,{'children':a3_0x122647(Text,{'children':_0x15b579(0x220)})})});if(_0x2f3640===_0x15b579(0x20c))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x542424(0x20d)},'claude':{'name':a3_0x542424(0x225)}};
|
package/lib/ai-setup/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x51f940=a4_0x3d57;(function(_0x718f79,_0x5aeb06){const _0x15752b=a4_0x3d57,_0x4bdfe8=_0x718f79();while(!![]){try{const _0x3773bb=-parseInt(_0x15752b(0x10c))/0x1*(parseInt(_0x15752b(0xef))/0x2)+-parseInt(_0x15752b(0x11b))/0x3*(parseInt(_0x15752b(0x10a))/0x4)+parseInt(_0x15752b(0xd7))/0x5*(-parseInt(_0x15752b(0xdf))/0x6)+parseInt(_0x15752b(0x121))/0x7*(parseInt(_0x15752b(0xe6))/0x8)+parseInt(_0x15752b(0xf5))/0x9*(parseInt(_0x15752b(0x10e))/0xa)+-parseInt(_0x15752b(0xed))/0xb*(parseInt(_0x15752b(0xde))/0xc)+parseInt(_0x15752b(0x105))/0xd;if(_0x3773bb===_0x5aeb06)break;else _0x4bdfe8['push'](_0x4bdfe8['shift']());}catch(_0x2c7ab5){_0x4bdfe8['push'](_0x4bdfe8['shift']());}}}(a4_0x2876,0x74bf9));function a4_0x2876(){const _0x272d52=['\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','请手动执行:\x20','2.0.0','.lovrabet','99yJWgAt','LOVRABET_ENV','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','env','创建\x20Cursor\x20Rules\x20文件','lovrabet-dataset','log','error','parse','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','复制\x20Cursor\x20Rules\x20文件失败','\x20\x20AppCode:\x20','不支持的\x20MCP\x20IDE:\x20','isDirectory','创建\x20agents.md\x20文件','15440568HYPVPw','utf-8','info','cwd','rules','12zWMThs','mcpServers','2WrBGHy','manual','580660jXTjhK','map','Cursor','mcp-install','共享技能文件复制成功','\x20\x20}','npx','已写入\x20.cursor/mcp.json','创建技能包\x20manifest','复制\x20agents.md\x20文件失败','Claude\x20Code\x20MCP\x20命令已生成','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20\x20\x20}','715389jNWGee','mcp.json','\x22:\x20{','agents.md','name','.cursor','88018aCVOug','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','app','join','共享技能文件复制失败','message','stringify','\x20\x20\x20\x20\x22','appcode','85795qjvcqO','Claude\x20Code','配置信息:','Cursor\x20MCP\x20配置失败','Cursor\x20MCP\x20配置成功','cursor','已创建\x20','348FuhPzI','150coyfQh','../../cdn-source/skills','配置指引已显示','\x20-e\x20LOVRABET_APP_CODE=','.lovrabet/skill/.shared','需要先配置\x20appcode','skill-install','136BUTJxp','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.lovrabet/skill-manifest.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','@lovrabet/dataset-mcp-server@latest','online','其他\x20IDE\x20配置指引已显示','18799ZrGbWd','success','368094FkLPOM','lovrabet_rules.mdc'];a4_0x2876=function(){return _0x272d52;};return a4_0x2876();}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';function a4_0x3d57(_0x2ebca1,_0x57d9a3){_0x2ebca1=_0x2ebca1-0xd1;const _0x287676=a4_0x2876();let _0x3d5780=_0x287676[_0x2ebca1];return _0x3d5780;}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x51f940(0xfa),MCP_COMMAND=a4_0x51f940(0x114),MCP_ARGS=[a4_0x51f940(0xea)];export function buildEnvConfig(_0x47aed3,_0x5708a6){const _0x2c1479=a4_0x51f940,_0x4f9742={'LOVRABET_APP_CODE':String(_0x47aed3)};return _0x5708a6!==_0x2c1479(0xeb)&&(_0x4f9742[_0x2c1479(0xf6)]=String(_0x5708a6)),_0x4f9742;}export async function configureCursorMcp(_0x1c5ab8){const _0x2c62f3=a4_0x51f940,_0x55d51a=_0x1c5ab8||process[_0x2c62f3(0x108)](),_0x4d149e=readConfig(_0x55d51a),_0x3efbd7=_0x4d149e['appcode']||_0x4d149e[_0x2c62f3(0x123)],_0xa58114=_0x4d149e[_0x2c62f3(0xf8)]||'online';if(!_0x3efbd7)return{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x2c62f3(0xe4)};const _0x14eeb5=buildEnvConfig(_0x3efbd7,_0xa58114),_0x2ad869={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x14eeb5},_0x43bdb5=join(_0x55d51a,_0x2c62f3(0x120),_0x2c62f3(0x11c)),_0x2c4d4c=join(_0x55d51a,_0x2c62f3(0x120));try{!existsSync(_0x2c4d4c)&&mkdirSync(_0x2c4d4c,{'recursive':!![]});let _0x5f1911={'mcpServers':{}};if(existsSync(_0x43bdb5)){const _0x5ab731=readFileSync(_0x43bdb5,_0x2c62f3(0x106));_0x5f1911=JSON[_0x2c62f3(0xfd)](_0x5ab731);}return(!_0x5f1911[_0x2c62f3(0x10b)]||typeof _0x5f1911[_0x2c62f3(0x10b)]!=='object')&&(_0x5f1911[_0x2c62f3(0x10b)]={}),_0x5f1911[_0x2c62f3(0x10b)][MCP_SERVER_NAME]=_0x2ad869,writeFileSync(_0x43bdb5,JSON['stringify'](_0x5f1911,null,0x2),_0x2c62f3(0x106)),logger[_0x2c62f3(0x107)](_0x2c62f3(0x111),_0x2c62f3(0xdb),{'appcode':_0x3efbd7,'env':_0xa58114,'path':_0x43bdb5}),await copyCursorRules(_0x2c4d4c),{'ide':'Cursor','status':'success','message':_0x2c62f3(0x115)};}catch(_0x1f3018){return logger[_0x2c62f3(0xfc)](_0x2c62f3(0x111),_0x2c62f3(0xda),{'error':_0x1f3018 instanceof Error?_0x1f3018['message']:String(_0x1f3018)}),{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x1f3018 instanceof Error?_0x1f3018[_0x2c62f3(0xd3)]:String(_0x1f3018)};}}export async function configureClaudeMcp(_0x16d406){const _0x4d452b=a4_0x51f940,_0x35da94=_0x16d406||process[_0x4d452b(0x108)](),_0x5f3ab2=readConfig(_0x35da94),_0x461f56=_0x5f3ab2[_0x4d452b(0xd6)]||_0x5f3ab2['app'],_0x5f3416=_0x5f3ab2[_0x4d452b(0xf8)]||_0x4d452b(0xeb);if(!_0x461f56)return{'ide':_0x4d452b(0xd8),'status':'error','message':'需要先配置\x20appcode'};let _0x19b8ae='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x4d452b(0xd1)]('\x20')+_0x4d452b(0xe2)+_0x461f56;return _0x5f3416!==_0x4d452b(0xeb)&&(_0x19b8ae+='\x20-e\x20LOVRABET_ENV='+_0x5f3416),await copyAgentsMd(_0x35da94),logger[_0x4d452b(0x107)](_0x4d452b(0x111),_0x4d452b(0x118),{'command':_0x19b8ae,'appcode':_0x461f56,'env':_0x5f3416}),console[_0x4d452b(0xfb)](_0x4d452b(0x119)),console[_0x4d452b(0xfb)]('\x20\x20'+_0x19b8ae+'\x0a'),console[_0x4d452b(0xfb)](_0x4d452b(0xd9)),console[_0x4d452b(0xfb)](_0x4d452b(0x101)+_0x461f56),_0x5f3416!=='online'&&console[_0x4d452b(0xfb)]('\x20\x20环境:\x20'+_0x5f3416),console[_0x4d452b(0xfb)](_0x4d452b(0xfe)),{'ide':'Claude\x20Code','status':_0x4d452b(0x10d),'message':_0x4d452b(0xf2)+_0x19b8ae};}export async function showOtherGuide(_0xb9889){const _0x1f5445=a4_0x51f940,_0x25b259=_0xb9889||process[_0x1f5445(0x108)](),_0x56b3c5=readConfig(_0x25b259),_0x1c368a=_0x56b3c5[_0x1f5445(0xd6)]||_0x56b3c5['app'],_0x4bafdd=_0x56b3c5[_0x1f5445(0xf8)]||_0x1f5445(0xeb);if(!_0x1c368a)return{'ide':'其他','status':_0x1f5445(0xfc),'message':_0x1f5445(0xe4)};return console['log'](_0x1f5445(0x122)),console[_0x1f5445(0xfb)]('{'),console[_0x1f5445(0xfb)]('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x1f5445(0xfb)](_0x1f5445(0xd5)+MCP_SERVER_NAME+_0x1f5445(0x11d)),console[_0x1f5445(0xfb)](_0x1f5445(0xf1)+MCP_COMMAND+'\x22,'),console[_0x1f5445(0xfb)](_0x1f5445(0xe7)+MCP_ARGS[_0x1f5445(0x10f)](_0x46a98b=>'\x22'+_0x46a98b+'\x22')['join'](',\x20')+'],'),console[_0x1f5445(0xfb)](_0x1f5445(0xf7)),console[_0x1f5445(0xfb)](_0x1f5445(0xe9)+_0x1c368a+'\x22,'),_0x4bafdd!=='online'&&console['log'](_0x1f5445(0xff)+_0x4bafdd+'\x22,'),console[_0x1f5445(0xfb)]('\x20\x20\x20\x20\x20\x20}'),console[_0x1f5445(0xfb)](_0x1f5445(0x11a)),console[_0x1f5445(0xfb)](_0x1f5445(0x113)),console[_0x1f5445(0xfb)]('}\x0a'),logger[_0x1f5445(0x107)]('mcp-install',_0x1f5445(0xec),{'appcode':_0x1c368a,'env':_0x4bafdd}),{'ide':'其他','status':_0x1f5445(0x10d),'message':_0x1f5445(0xe1)};}export async function configureMcp(_0x8586bf,_0x29e61f){const _0x1afbdd=a4_0x51f940;switch(_0x8586bf){case _0x1afbdd(0xdc):return await configureCursorMcp(_0x29e61f);case'claude':return await configureClaudeMcp(_0x29e61f);default:throw new Error(_0x1afbdd(0x102)+_0x8586bf);}}async function copyCursorRules(_0xf6cc8c){const _0x21a9f6=a4_0x51f940,_0x277b85=join(_0xf6cc8c,_0x21a9f6(0x109)),_0x38909f=join(_0x277b85,_0x21a9f6(0xf0));if(existsSync(_0x38909f))return;try{!existsSync(_0x277b85)&&mkdirSync(_0x277b85,{'recursive':!![]});const _0x206a18=await getRulesContent();writeFileSync(_0x38909f,_0x206a18,_0x21a9f6(0x106)),logger[_0x21a9f6(0x107)]('mcp-install',_0x21a9f6(0xf9),{'to':_0x38909f});}catch(_0x2a0c80){logger['error']('mcp-install',_0x21a9f6(0x100),{'error':_0x2a0c80 instanceof Error?_0x2a0c80[_0x21a9f6(0xd3)]:String(_0x2a0c80)});}}async function copyAgentsMd(_0x33315d){const _0x55f255=a4_0x51f940,_0x9b3048=join(_0x33315d,_0x55f255(0x11e));if(existsSync(_0x9b3048))return;try{const _0x1c6d1e=await getRulesContent();writeFileSync(_0x9b3048,_0x1c6d1e,_0x55f255(0x106)),logger[_0x55f255(0x107)]('mcp-install',_0x55f255(0x104),{'to':_0x9b3048});}catch(_0x70cbfc){logger[_0x55f255(0xfc)](_0x55f255(0x111),_0x55f255(0x117),{'error':_0x70cbfc instanceof Error?_0x70cbfc['message']:String(_0x70cbfc)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x169ccf,_0x1e77bc){const _0x4020f7=a4_0x51f940,_0x53a33f=_0x1e77bc||process[_0x4020f7(0x108)](),_0x35ae02=resolve(__dirname,_0x4020f7(0xe0)),_0x2d50fe=SKILL_IDE_CONFIGS[_0x169ccf];if(!_0x2d50fe)return{'ide':_0x169ccf,'status':_0x4020f7(0xfc),'message':'未知的\x20IDE:\x20'+_0x169ccf};const _0x5326f7=_0x2d50fe[_0x4020f7(0x11f)];try{let _0x186dca;try{_0x186dca=await fetchGuidesFromCDN();}catch{}const _0x4df3d8=await installSingleIDE(_0x169ccf,_0x2d50fe,_0x53a33f,_0x35ae02,_0x186dca);return _0x186dca&&writeGuidesToProject(_0x186dca,_0x53a33f),logger['info'](_0x4020f7(0xe5),_0x5326f7+'\x20技能包安装成功',{'ide':_0x169ccf,'filesCount':_0x4df3d8}),{'ide':_0x5326f7,'status':_0x4020f7(0xee),'message':_0x4020f7(0xdd)+_0x4df3d8+'\x20项'};}catch(_0x26b2c6){return logger['error']('skill-install',_0x5326f7+'\x20技能包安装失败',{'error':_0x26b2c6 instanceof Error?_0x26b2c6['message']:String(_0x26b2c6)}),{'ide':_0x5326f7,'status':_0x4020f7(0xfc),'message':_0x26b2c6 instanceof Error?_0x26b2c6[_0x4020f7(0xd3)]:String(_0x26b2c6)};}}async function copyDir(_0x96e42b,_0x30671a){const _0x335f25=a4_0x51f940,{statSync:_0x499c8b}=await import('node:fs'),{readdirSync:_0x2f4797}=await import('node:fs'),_0x36efc5=_0x499c8b(_0x96e42b);if(_0x36efc5[_0x335f25(0x103)]()){!existsSync(_0x30671a)&&mkdirSync(_0x30671a,{'recursive':!![]});const _0x352ea5=_0x2f4797(_0x96e42b);for(const _0x36c7c4 of _0x352ea5){await copyDir(join(_0x96e42b,_0x36c7c4),join(_0x30671a,_0x36c7c4));}}else copyFileSync(_0x96e42b,_0x30671a);}export async function copySharedSkills(_0x6a5c54){const _0x4a341c=a4_0x51f940,_0x1e9dbb=_0x6a5c54||process[_0x4a341c(0x108)](),_0x5462fb=resolve(__dirname,'../../cdn-source/skills'),_0x152d82=join(_0x5462fb,'.shared'),_0x3fd72f=join(_0x1e9dbb,_0x4a341c(0xe3));if(!existsSync(_0x152d82))return![];try{return await copyDir(_0x152d82,_0x3fd72f),logger['info']('skill-install',_0x4a341c(0x112),{'path':_0x3fd72f}),!![];}catch(_0x19ce65){return logger[_0x4a341c(0xfc)](_0x4a341c(0xe5),_0x4a341c(0xd2),{'error':_0x19ce65 instanceof Error?_0x19ce65[_0x4a341c(0xd3)]:String(_0x19ce65)}),![];}}export function createSkillManifest(_0x2c8f42,_0x1af344){const _0x35e7c8=a4_0x51f940,_0x506df5={'version':_0x35e7c8(0xf3),'installedAt':new Date()['toISOString'](),'platforms':_0x1af344},_0xd30a8=join(_0x2c8f42,_0x35e7c8(0xe8)),_0x43d993=join(_0x2c8f42,_0x35e7c8(0xf4));!existsSync(_0x43d993)&&mkdirSync(_0x43d993,{'recursive':!![]}),writeFileSync(_0xd30a8,JSON[_0x35e7c8(0xd4)](_0x506df5,null,0x2),'utf-8'),logger[_0x35e7c8(0x107)]('skill-install',_0x35e7c8(0x116),{'path':_0xd30a8});}
|
|
1
|
+
const a4_0x2e4f7e=a4_0x4db3;(function(_0x261084,_0xd68b81){const _0x3ccc68=a4_0x4db3,_0x3d86d5=_0x261084();while(!![]){try{const _0x2a6e53=-parseInt(_0x3ccc68(0x70))/0x1+-parseInt(_0x3ccc68(0x96))/0x2*(-parseInt(_0x3ccc68(0xb0))/0x3)+-parseInt(_0x3ccc68(0x85))/0x4+parseInt(_0x3ccc68(0x93))/0x5+-parseInt(_0x3ccc68(0x7e))/0x6+parseInt(_0x3ccc68(0x87))/0x7*(-parseInt(_0x3ccc68(0x8d))/0x8)+-parseInt(_0x3ccc68(0x89))/0x9*(-parseInt(_0x3ccc68(0x66))/0xa);if(_0x2a6e53===_0xd68b81)break;else _0x3d86d5['push'](_0x3d86d5['shift']());}catch(_0x2183f8){_0x3d86d5['push'](_0x3d86d5['shift']());}}}(a4_0x3c96,0x97142));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';function a4_0x3c96(){const _0x98dc9=['\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','1127820iWfYvm','lovrabet-dataset','.shared','.lovrabet','创建\x20agents.md\x20文件','log','.lovrabet/skill/.shared','mcp-install','env','npx','info','配置信息:','lovrabet_rules.mdc','claude\x20mcp\x20add\x20','5349882IdeIoc','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','其他\x20IDE\x20配置指引已显示','cwd','\x20-e\x20LOVRABET_APP_CODE=','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','\x20\x20\x20\x20\x22','1143496UlMAtq','\x20技能包安装失败','7aRIBiH','已创建\x20','9iEptIC','object','parse','app','2644088uGETzG','claude','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','rules','\x20\x20\x22mcpServers\x22:\x20{','复制\x20agents.md\x20文件失败','2973860WtRojT','node:fs','mcp.json','50fljAof','error','LOVRABET_ENV','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x22:\x20{','Cursor\x20MCP\x20配置失败','需要先配置\x20appcode','utf-8','创建\x20Cursor\x20Rules\x20文件','Cursor','不支持的\x20MCP\x20IDE:\x20','success','mcpServers','message','manual','\x20\x20环境:\x20','appcode','online','\x20\x20\x20\x20}','../../cdn-source/skills','cursor','stringify','join','请手动执行:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','toISOString','94053ESIXUP','配置指引已显示','18761230aMvUvM','Claude\x20Code','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.cursor','2.0.0','map','skill-install','Claude\x20Code\x20MCP\x20命令已生成','创建技能包\x20manifest'];a4_0x3c96=function(){return _0x98dc9;};return a4_0x3c96();}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_0x4db3(_0x502fda,_0x5b387b){_0x502fda=_0x502fda-0x66;const _0x3c9606=a4_0x3c96();let _0x4db334=_0x3c9606[_0x502fda];return _0x4db334;}import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x2e4f7e(0x71),MCP_COMMAND=a4_0x2e4f7e(0x79),MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];export function buildEnvConfig(_0xf13997,_0x2a78a4){const _0x136cd9=a4_0x2e4f7e,_0x3b0f4b={'LOVRABET_APP_CODE':String(_0xf13997)};return _0x2a78a4!==_0x136cd9(0xa7)&&(_0x3b0f4b[_0x136cd9(0x98)]=String(_0x2a78a4)),_0x3b0f4b;}export async function configureCursorMcp(_0x296c1c){const _0x49a7d0=a4_0x2e4f7e,_0x49f926=_0x296c1c||process['cwd'](),_0x326609=readConfig(_0x49f926),_0x60877f=_0x326609['appcode']||_0x326609[_0x49a7d0(0x8c)],_0xa4d49e=_0x326609[_0x49a7d0(0x78)]||_0x49a7d0(0xa7);if(!_0x60877f)return{'ide':_0x49a7d0(0x9f),'status':_0x49a7d0(0x97),'message':_0x49a7d0(0x9c)};const _0x2dd8c1=buildEnvConfig(_0x60877f,_0xa4d49e),_0x5a5b3c={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x2dd8c1},_0x431e18=join(_0x49f926,_0x49a7d0(0x69),_0x49a7d0(0x95)),_0x292f9c=join(_0x49f926,_0x49a7d0(0x69));try{!existsSync(_0x292f9c)&&mkdirSync(_0x292f9c,{'recursive':!![]});let _0x29dc95={'mcpServers':{}};if(existsSync(_0x431e18)){const _0x539bfc=readFileSync(_0x431e18,'utf-8');_0x29dc95=JSON[_0x49a7d0(0x8b)](_0x539bfc);}return(!_0x29dc95[_0x49a7d0(0xa2)]||typeof _0x29dc95[_0x49a7d0(0xa2)]!==_0x49a7d0(0x8a))&&(_0x29dc95[_0x49a7d0(0xa2)]={}),_0x29dc95[_0x49a7d0(0xa2)][MCP_SERVER_NAME]=_0x5a5b3c,writeFileSync(_0x431e18,JSON[_0x49a7d0(0xab)](_0x29dc95,null,0x2),_0x49a7d0(0x9d)),logger[_0x49a7d0(0x7a)](_0x49a7d0(0x77),'Cursor\x20MCP\x20配置成功',{'appcode':_0x60877f,'env':_0xa4d49e,'path':_0x431e18}),await copyCursorRules(_0x292f9c),{'ide':_0x49a7d0(0x9f),'status':_0x49a7d0(0xa1),'message':'已写入\x20.cursor/mcp.json'};}catch(_0x26739d){return logger[_0x49a7d0(0x97)](_0x49a7d0(0x77),_0x49a7d0(0x9b),{'error':_0x26739d instanceof Error?_0x26739d[_0x49a7d0(0xa3)]:String(_0x26739d)}),{'ide':'Cursor','status':_0x49a7d0(0x97),'message':_0x26739d instanceof Error?_0x26739d[_0x49a7d0(0xa3)]:String(_0x26739d)};}}export async function configureClaudeMcp(_0x513cc4){const _0x544884=a4_0x2e4f7e,_0x251402=_0x513cc4||process[_0x544884(0x81)](),_0x1bd612=readConfig(_0x251402),_0x3cc029=_0x1bd612[_0x544884(0xa6)]||_0x1bd612[_0x544884(0x8c)],_0x5b4d83=_0x1bd612[_0x544884(0x78)]||_0x544884(0xa7);if(!_0x3cc029)return{'ide':_0x544884(0x67),'status':_0x544884(0x97),'message':_0x544884(0x9c)};let _0x31f121=_0x544884(0x7d)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x544884(0xac)]('\x20')+_0x544884(0x82)+_0x3cc029;return _0x5b4d83!==_0x544884(0xa7)&&(_0x31f121+='\x20-e\x20LOVRABET_ENV='+_0x5b4d83),await copyAgentsMd(_0x251402),logger[_0x544884(0x7a)](_0x544884(0x77),_0x544884(0x6d),{'command':_0x31f121,'appcode':_0x3cc029,'env':_0x5b4d83}),console['log'](_0x544884(0x99)),console[_0x544884(0x75)]('\x20\x20'+_0x31f121+'\x0a'),console[_0x544884(0x75)](_0x544884(0x7b)),console[_0x544884(0x75)]('\x20\x20AppCode:\x20'+_0x3cc029),_0x5b4d83!==_0x544884(0xa7)&&console['log'](_0x544884(0xa5)+_0x5b4d83),console[_0x544884(0x75)]('\x20\x20重启\x20Claude\x20Code\x20后生效\x0a'),{'ide':_0x544884(0x67),'status':_0x544884(0xa4),'message':_0x544884(0xad)+_0x31f121};}export async function showOtherGuide(_0x1e783d){const _0x51dc1e=a4_0x2e4f7e,_0x10455b=_0x1e783d||process[_0x51dc1e(0x81)](),_0x1eb311=readConfig(_0x10455b),_0x28d902=_0x1eb311['appcode']||_0x1eb311[_0x51dc1e(0x8c)],_0xa9cc8c=_0x1eb311[_0x51dc1e(0x78)]||_0x51dc1e(0xa7);if(!_0x28d902)return{'ide':'其他','status':_0x51dc1e(0x97),'message':'需要先配置\x20appcode'};return console[_0x51dc1e(0x75)](_0x51dc1e(0x6f)),console[_0x51dc1e(0x75)]('{'),console[_0x51dc1e(0x75)](_0x51dc1e(0x91)),console[_0x51dc1e(0x75)](_0x51dc1e(0x84)+MCP_SERVER_NAME+_0x51dc1e(0x9a)),console[_0x51dc1e(0x75)](_0x51dc1e(0x7f)+MCP_COMMAND+'\x22,'),console[_0x51dc1e(0x75)](_0x51dc1e(0x68)+MCP_ARGS[_0x51dc1e(0x6b)](_0x5569ba=>'\x22'+_0x5569ba+'\x22')[_0x51dc1e(0xac)](',\x20')+'],'),console['log'](_0x51dc1e(0x8f)),console[_0x51dc1e(0x75)](_0x51dc1e(0xae)+_0x28d902+'\x22,'),_0xa9cc8c!==_0x51dc1e(0xa7)&&console['log'](_0x51dc1e(0x83)+_0xa9cc8c+'\x22,'),console[_0x51dc1e(0x75)]('\x20\x20\x20\x20\x20\x20}'),console[_0x51dc1e(0x75)](_0x51dc1e(0xa8)),console[_0x51dc1e(0x75)]('\x20\x20}'),console[_0x51dc1e(0x75)]('}\x0a'),logger[_0x51dc1e(0x7a)](_0x51dc1e(0x77),_0x51dc1e(0x80),{'appcode':_0x28d902,'env':_0xa9cc8c}),{'ide':'其他','status':_0x51dc1e(0xa4),'message':_0x51dc1e(0xb1)};}export async function configureMcp(_0x315e55,_0x385932){const _0x24e466=a4_0x2e4f7e;switch(_0x315e55){case _0x24e466(0xaa):return await configureCursorMcp(_0x385932);case _0x24e466(0x8e):return await configureClaudeMcp(_0x385932);default:throw new Error(_0x24e466(0xa0)+_0x315e55);}}async function copyCursorRules(_0x3024d8){const _0x4453aa=a4_0x2e4f7e,_0x134a21=join(_0x3024d8,_0x4453aa(0x90)),_0x4ea469=join(_0x134a21,_0x4453aa(0x7c));if(existsSync(_0x4ea469))return;try{!existsSync(_0x134a21)&&mkdirSync(_0x134a21,{'recursive':!![]});const _0xb0ede0=await getRulesContent();writeFileSync(_0x4ea469,_0xb0ede0,_0x4453aa(0x9d)),logger[_0x4453aa(0x7a)]('mcp-install',_0x4453aa(0x9e),{'to':_0x4ea469});}catch(_0x3cd39f){logger[_0x4453aa(0x97)](_0x4453aa(0x77),'复制\x20Cursor\x20Rules\x20文件失败',{'error':_0x3cd39f instanceof Error?_0x3cd39f['message']:String(_0x3cd39f)});}}async function copyAgentsMd(_0x1ba921){const _0x4d0caf=a4_0x2e4f7e,_0x31285f=join(_0x1ba921,'agents.md');if(existsSync(_0x31285f))return;try{const _0x30bfd2=await getRulesContent();writeFileSync(_0x31285f,_0x30bfd2,_0x4d0caf(0x9d)),logger[_0x4d0caf(0x7a)](_0x4d0caf(0x77),_0x4d0caf(0x74),{'to':_0x31285f});}catch(_0x4e8fcc){logger[_0x4d0caf(0x97)](_0x4d0caf(0x77),_0x4d0caf(0x92),{'error':_0x4e8fcc instanceof Error?_0x4e8fcc['message']:String(_0x4e8fcc)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x5baea8,_0x46f5f3){const _0x1d3b43=a4_0x2e4f7e,_0x37e6af=_0x46f5f3||process[_0x1d3b43(0x81)](),_0x415f84=resolve(__dirname,_0x1d3b43(0xa9)),_0x1b0793=SKILL_IDE_CONFIGS[_0x5baea8];if(!_0x1b0793)return{'ide':_0x5baea8,'status':_0x1d3b43(0x97),'message':'未知的\x20IDE:\x20'+_0x5baea8};const _0x4142f3=_0x1b0793['name'];try{let _0x5828ec;try{_0x5828ec=await fetchGuidesFromCDN();}catch{}const _0x491c55=await installSingleIDE(_0x5baea8,_0x1b0793,_0x37e6af,_0x415f84,_0x5828ec);return _0x5828ec&&writeGuidesToProject(_0x5828ec,_0x37e6af),logger[_0x1d3b43(0x7a)](_0x1d3b43(0x6c),_0x4142f3+'\x20技能包安装成功',{'ide':_0x5baea8,'filesCount':_0x491c55}),{'ide':_0x4142f3,'status':_0x1d3b43(0xa1),'message':_0x1d3b43(0x88)+_0x491c55+'\x20项'};}catch(_0xf9837d){return logger[_0x1d3b43(0x97)](_0x1d3b43(0x6c),_0x4142f3+_0x1d3b43(0x86),{'error':_0xf9837d instanceof Error?_0xf9837d['message']:String(_0xf9837d)}),{'ide':_0x4142f3,'status':'error','message':_0xf9837d instanceof Error?_0xf9837d[_0x1d3b43(0xa3)]:String(_0xf9837d)};}}async function copyDir(_0x15a92,_0x382767){const _0x215e91=a4_0x2e4f7e,{statSync:_0x22c21}=await import(_0x215e91(0x94)),{readdirSync:_0x2082cd}=await import(_0x215e91(0x94)),_0x24b3f3=_0x22c21(_0x15a92);if(_0x24b3f3['isDirectory']()){!existsSync(_0x382767)&&mkdirSync(_0x382767,{'recursive':!![]});const _0x12fa73=_0x2082cd(_0x15a92);for(const _0xc46982 of _0x12fa73){await copyDir(join(_0x15a92,_0xc46982),join(_0x382767,_0xc46982));}}else copyFileSync(_0x15a92,_0x382767);}export async function copySharedSkills(_0x1b9300){const _0x54b015=a4_0x2e4f7e,_0x21baf7=_0x1b9300||process['cwd'](),_0x39b67a=resolve(__dirname,_0x54b015(0xa9)),_0x9e6e9c=join(_0x39b67a,_0x54b015(0x72)),_0x5d1718=join(_0x21baf7,_0x54b015(0x76));if(!existsSync(_0x9e6e9c))return![];try{return await copyDir(_0x9e6e9c,_0x5d1718),logger['info'](_0x54b015(0x6c),'共享技能文件复制成功',{'path':_0x5d1718}),!![];}catch(_0x4086f1){return logger[_0x54b015(0x97)](_0x54b015(0x6c),'共享技能文件复制失败',{'error':_0x4086f1 instanceof Error?_0x4086f1[_0x54b015(0xa3)]:String(_0x4086f1)}),![];}}export function createSkillManifest(_0x5566d5,_0x42a0b9){const _0x443497=a4_0x2e4f7e,_0x199e35={'version':_0x443497(0x6a),'installedAt':new Date()[_0x443497(0xaf)](),'platforms':_0x42a0b9},_0x349bc4=join(_0x5566d5,'.lovrabet/skill-manifest.json'),_0x26b50a=join(_0x5566d5,_0x443497(0x73));!existsSync(_0x26b50a)&&mkdirSync(_0x26b50a,{'recursive':!![]}),writeFileSync(_0x349bc4,JSON[_0x443497(0xab)](_0x199e35,null,0x2),_0x443497(0x9d)),logger[_0x443497(0x7a)](_0x443497(0x6c),_0x443497(0x6e),{'path':_0x349bc4});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cd551,_0x2534c5){const _0xfee349=a5_0x241a,_0x498169=_0x1cd551();while(!![]){try{const _0x1fad66=parseInt(_0xfee349(0x16a))/0x1+parseInt(_0xfee349(0x15e))/0x2+-parseInt(_0xfee349(0x179))/0x3+-parseInt(_0xfee349(0x14e))/0x4+parseInt(_0xfee349(0x16f))/0x5*(parseInt(_0xfee349(0x175))/0x6)+-parseInt(_0xfee349(0x178))/0x7+parseInt(_0xfee349(0x17c))/0x8*(parseInt(_0xfee349(0x15a))/0x9);if(_0x1fad66===_0x2534c5)break;else _0x498169['push'](_0x498169['shift']());}catch(_0x216e81){_0x498169['push'](_0x498169['shift']());}}}(a5_0x5103,0x45588));import{jsx as a5_0x50210b,jsxs as a5_0x16e821,Fragment as a5_0x2b9126}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0x241a(_0x3fc7b7,_0x368aea){_0x3fc7b7=_0x3fc7b7-0x146;const _0x51038f=a5_0x5103();let _0x241a3d=_0x51038f[_0x3fc7b7];return _0x241a3d;}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';function a5_0x5103(){const _0x31f056=['\x20重新登录后再试','includes','未找到任何数据集','lovrabet\x20auth','321445XRdUTl','\x1b[90m*\x20从\x20','log','\x20个数据集中筛选出\x20','*\x20生成的文档文件:','4890TmyjYb','\x20个匹配的数据集\x1b[0m','未提供应用AppCode,且配置中也没有默认值','yellow','💡\x20请使用\x20','message','576eKEbBy','success','white','881965gCVFeF','1008219AjywTk','使用指定的应用AppCode:\x20','datasetCode','1108664ilygsh','string','*\x20共处理\x20','\x1b[0m','*\x20输出目录:\x20','\x20个数据集','cwd','使用配置的应用AppCode:\x20','column','√\x20文档生成完成!成功\x20','正在生成\x20','\x20-\x20','red','1169908YUbDIV','datasetName','map','文档生成完成','length','join','env','setLogPath','文档生成失败:\x20','error','filePath','\x1b[33m!\x20以下数据集代码不存在:\x20','9pJdgZq','cyan','green','gray','969338GqjXnK','指定的数据集代码都不存在:\x20','dim','🚀\x20','filter','.md\x20(',',\x20失败\x20','api-doc'];a5_0x5103=function(){return _0x31f056;};return a5_0x5103();}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x5520b1,env:_0x491db9,output:_0x1d6223,extraParams:_0x1fa3ef,datasetCodes:_0x5c3b73})=>{const _0x21dcb9=a5_0x241a,{exit:_0x23ee77}=useApp(),[_0x2876de,_0x145da3]=useState(![]),[_0x58709e,_0x143bf4]=useState(''),[_0x25861a,_0x2b266f]=useState(![]),[_0x49accc,_0x1477bc]=useState(null),[_0x42248b,_0x146e01]=useState(null),[_0x19b861,_0x9d8091]=useState(0x0),_0x1b50ec=readConfig(),_0x33e9c=getConfigAppCode(),_0x3c690b=_0x5520b1||_0x33e9c,_0x47d4c3=typeof _0x1b50ec?.[_0x21dcb9(0x154)]===_0x21dcb9(0x17d)?_0x1b50ec['env']:undefined,_0xfe117d=_0x491db9||_0x47d4c3||'online';initEnv(_0xfe117d);const _0x839c8d=_0x1d6223||'./docs',_0x4afba6=_0x5520b1?_0x21dcb9(0x17a)+_0x3c690b:_0x21dcb9(0x148)+_0x3c690b;useEffect(()=>{_0x145da3(!![]),_0x51eb0b();},[]),useEffect(()=>{(_0x25861a||_0x49accc)&&_0x23ee77();},[_0x25861a,_0x49accc,_0x23ee77]);async function _0x51eb0b(){const _0x318681=_0x21dcb9;if(!_0x3c690b){_0x1477bc(_0x318681(0x171));return;}try{logger[_0x318681(0x155)](process[_0x318681(0x147)]()),_0x143bf4('正在获取数据集列表...');const {configArray:_0x5b485f}=await fetchModelList(_0x3c690b);_0x9d8091(_0x5b485f[_0x318681(0x152)]);if(_0x5b485f['length']===0x0){_0x1477bc(_0x318681(0x168));return;}let _0x4835fc=_0x5b485f;if(_0x5c3b73&&_0x5c3b73[_0x318681(0x152)]>0x0){_0x4835fc=_0x5b485f[_0x318681(0x162)](_0x580f15=>_0x5c3b73[_0x318681(0x167)](_0x580f15[_0x318681(0x17b)]));const _0x170f9=_0x4835fc['map'](_0x35519e=>_0x35519e[_0x318681(0x17b)]),_0x135460=_0x5c3b73['filter'](_0x36ee24=>!_0x170f9[_0x318681(0x167)](_0x36ee24));_0x135460[_0x318681(0x152)]>0x0&&console[_0x318681(0x16c)](_0x318681(0x159)+_0x135460[_0x318681(0x153)](',\x20')+_0x318681(0x17f));if(_0x4835fc['length']===0x0){_0x1477bc(_0x318681(0x15f)+_0x5c3b73[_0x318681(0x153)](',\x20'));return;}console[_0x318681(0x16c)](_0x318681(0x16b)+_0x5b485f[_0x318681(0x152)]+_0x318681(0x16d)+_0x4835fc['length']+_0x318681(0x170));}_0x143bf4(_0x318681(0x14b)+_0x4835fc[_0x318681(0x152)]+'\x20个数据集的文档...');const _0x572fff=await generateDatasetDocs(_0x4835fc,_0x3c690b,_0x839c8d,(_0x11f226,_0x3a290f,_0x400f2d)=>{const _0x584743=_0x318681;_0x143bf4('正在生成\x20'+_0x400f2d+_0x584743(0x163)+_0x11f226+'/'+_0x3a290f+')');},_0x1fa3ef);_0x146e01(_0x572fff),_0x2b266f(!![]);const _0x1c25f5=_0x572fff[_0x318681(0x162)](_0x57b8fb=>_0x57b8fb['success'])[_0x318681(0x152)],_0x48b450=_0x572fff[_0x318681(0x162)](_0x1bfbce=>!_0x1bfbce[_0x318681(0x176)])[_0x318681(0x152)];logger['success'](_0x318681(0x165),_0x318681(0x151),undefined,{'totalCount':_0x572fff[_0x318681(0x152)],'successCount':_0x1c25f5,'failCount':_0x48b450,'outputDir':_0x839c8d});}catch(_0x3d4563){const _0x1e1bbe=_0x3d4563 instanceof Error?_0x3d4563[_0x318681(0x174)]:String(_0x3d4563);logger[_0x318681(0x157)](_0x318681(0x165),_0x318681(0x156)+_0x1e1bbe,{'appCode':_0x3c690b,'outputDir':_0x839c8d}),_0x1477bc('文档生成失败:\x20'+_0x1e1bbe);}finally{_0x145da3(![]);}}const _0x449fda=_0x42248b?.[_0x21dcb9(0x162)](_0x53a880=>_0x53a880[_0x21dcb9(0x176)])[_0x21dcb9(0x152)]||0x0,_0x1bd254=_0x42248b?.[_0x21dcb9(0x162)](_0x595550=>!_0x595550['success'])[_0x21dcb9(0x152)]||0x0;return a5_0x16e821(Box,{'flexDirection':_0x21dcb9(0x149),'children':[(_0x2876de||_0x25861a)&&a5_0x16e821(Box,{'children':[a5_0x50210b(Text,{'color':'gray','children':'*\x20'}),a5_0x50210b(Text,{'color':_0x5520b1?_0x21dcb9(0x177):'dim','children':_0x4afba6})]}),_0x2876de&&a5_0x50210b(Box,{'children':a5_0x16e821(Text,{'children':[_0x21dcb9(0x161),_0x58709e,'\x20(环境:\x20',_0xfe117d,')']})}),_0x25861a&&_0x42248b&&a5_0x16e821(Box,{'flexDirection':_0x21dcb9(0x149),'children':[a5_0x50210b(Box,{'children':a5_0x16e821(Text,{'color':_0x21dcb9(0x15c),'children':[_0x21dcb9(0x14a),_0x449fda,'\x20个',_0x1bd254>0x0&&_0x21dcb9(0x164)+_0x1bd254+'\x20个']})}),a5_0x50210b(Box,{'marginTop':0x1,'children':a5_0x16e821(Text,{'color':_0x21dcb9(0x15d),'children':[_0x21dcb9(0x17e),_0x19b861,_0x21dcb9(0x146)]})}),a5_0x16e821(Box,{'marginTop':0x1,'children':[a5_0x50210b(Text,{'color':_0x21dcb9(0x15d),'children':_0x21dcb9(0x180)}),a5_0x50210b(Text,{'color':_0x21dcb9(0x15b),'children':_0x839c8d})]}),_0x449fda>0x0&&a5_0x16e821(a5_0x2b9126,{'children':[a5_0x50210b(Box,{'marginTop':0x1,'children':a5_0x50210b(Text,{'color':_0x21dcb9(0x15d),'children':_0x21dcb9(0x16e)})}),_0x42248b[_0x21dcb9(0x162)](_0x5c6169=>_0x5c6169['success'])['map']((_0x3f9475,_0x5b0707)=>a5_0x16e821(Box,{'marginLeft':0x2,'children':[a5_0x16e821(Text,{'color':_0x21dcb9(0x15b),'children':['•\x20',_0x3f9475[_0x21dcb9(0x158)]]}),a5_0x16e821(Text,{'color':'dim','children':[_0x21dcb9(0x14c),_0x3f9475[_0x21dcb9(0x14f)]]})]},_0x5b0707))]}),_0x1bd254>0x0&&a5_0x16e821(a5_0x2b9126,{'children':[a5_0x50210b(Box,{'marginTop':0x1,'children':a5_0x50210b(Text,{'color':_0x21dcb9(0x172),'children':'⚠️\x20以下数据集生成失败:'})}),_0x42248b[_0x21dcb9(0x162)](_0x15f662=>!_0x15f662[_0x21dcb9(0x176)])[_0x21dcb9(0x150)]((_0x18858e,_0x58e4a8)=>a5_0x16e821(Box,{'marginLeft':0x2,'flexDirection':_0x21dcb9(0x149),'children':[a5_0x16e821(Text,{'color':'red','children':['•\x20',_0x18858e['datasetName'],'\x20(',_0x18858e[_0x21dcb9(0x17b)],')']}),_0x18858e[_0x21dcb9(0x157)]&&a5_0x50210b(Box,{'marginLeft':0x2,'children':a5_0x50210b(Text,{'color':_0x21dcb9(0x160),'children':_0x18858e[_0x21dcb9(0x157)]})})]},_0x58e4a8))]})]}),_0x49accc&&a5_0x16e821(Box,{'flexDirection':_0x21dcb9(0x149),'children':[a5_0x50210b(Box,{'children':a5_0x16e821(Text,{'color':_0x21dcb9(0x14d),'children':['❌\x20',_0x49accc]})}),_0x49accc[_0x21dcb9(0x167)]('登录')&&a5_0x16e821(Box,{'marginTop':0x1,'children':[a5_0x50210b(Text,{'color':_0x21dcb9(0x172),'children':_0x21dcb9(0x173)}),a5_0x50210b(Text,{'color':_0x21dcb9(0x15b),'children':_0x21dcb9(0x169)}),a5_0x50210b(Text,{'color':'yellow','children':_0x21dcb9(0x166)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x57a4fd=a6_0x12d4;(function(_0x41269e,_0x540cdb){const _0x36af1e=a6_0x12d4,_0x51fe60=_0x41269e();while(!![]){try{const _0x45139b=-parseInt(_0x36af1e(0x143))/0x1*(parseInt(_0x36af1e(0x132))/0x2)+parseInt(_0x36af1e(0x12c))/0x3*(parseInt(_0x36af1e(0x150))/0x4)+parseInt(_0x36af1e(0x138))/0x5*(-parseInt(_0x36af1e(0x157))/0x6)+parseInt(_0x36af1e(0x13c))/0x7*(-parseInt(_0x36af1e(0x149))/0x8)+-parseInt(_0x36af1e(0x144))/0x9*(parseInt(_0x36af1e(0x134))/0xa)+parseInt(_0x36af1e(0x12a))/0xb*(-parseInt(_0x36af1e(0x146))/0xc)+parseInt(_0x36af1e(0x13a))/0xd;if(_0x45139b===_0x540cdb)break;else _0x51fe60['push'](_0x51fe60['shift']());}catch(_0x43a7a3){_0x51fe60['push'](_0x51fe60['shift']());}}}(a6_0x5265,0xf22a4));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x5ac8ad from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0x12d4(_0x31fb80,_0x39a564){_0x31fb80=_0x31fb80-0x129;const _0x5265d1=a6_0x5265();let _0x12d44d=_0x5265d1[_0x31fb80];return _0x12d44d;}export async function fetchDatasetDoc(_0x45303e){const _0x261bd9=a6_0x12d4,{appCode:_0x1bb6fe,datasetCode:_0x30a87d,datasetId:_0x449921,extraParams:_0x5127ad}=_0x45303e,_0x57e2eb=getApiDomain(),_0x5f3a4d=_0x57e2eb+_0x261bd9(0x13d),_0x1be701={'appCode':_0x1bb6fe,'datasetCode':_0x30a87d,'datasetId':_0x449921,..._0x5127ad||{}},_0x237e9a=await fetch(_0x5f3a4d,{'method':_0x261bd9(0x12d),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x261bd9(0x141)](_0x1be701)});if(!_0x237e9a['ok']){if(_0x237e9a['status']===0x191)throw new Error(_0x261bd9(0x13e));let _0x453783='';try{_0x453783=await _0x237e9a['text']();}catch(_0x35aacc){}throw new Error(_0x261bd9(0x12e)+_0x30a87d+_0x261bd9(0x131)+_0x237e9a[_0x261bd9(0x156)]+(_0x453783?'\x0a'+_0x453783:''));}const _0x47357a=await _0x237e9a[_0x261bd9(0x14b)]();if(!_0x47357a[_0x261bd9(0x142)]||typeof _0x47357a[_0x261bd9(0x142)][_0x261bd9(0x135)]!==_0x261bd9(0x151))throw new Error('响应数据格式错误\x20('+_0x30a87d+'):缺少\x20data.markdown\x20字段');return _0x47357a['data'][_0x261bd9(0x135)];}function delay(_0x420c1d){return new Promise(_0x178f9c=>setTimeout(_0x178f9c,_0x420c1d));}export async function generateDatasetDocs(_0x2c1b2c,_0x4a198a,_0x17bad0=a6_0x57a4fd(0x140),_0x44a6ae,_0x4cd619){const _0x5abab8=a6_0x57a4fd;mkdirSync(_0x17bad0,{'recursive':!![]});const _0x1d08da=[],_0x4a05fc=_0x2c1b2c[_0x5abab8(0x14a)];console[_0x5abab8(0x14d)](_0x5abab8(0x13b)+_0x4a05fc+_0x5abab8(0x13f));for(let _0x4256b6=0x0;_0x4256b6<_0x2c1b2c['length'];_0x4256b6++){const _0x20a977=_0x2c1b2c[_0x4256b6],_0x561ef2=_0x4256b6+0x1,_0xd102d=_0x20a977['tableName'];try{console[_0x5abab8(0x14d)]('['+_0x561ef2+'/'+_0x4a05fc+_0x5abab8(0x12f)+_0xd102d+_0x5abab8(0x129)+_0x20a977[_0x5abab8(0x130)]+')');_0x44a6ae&&_0x44a6ae(_0x561ef2,_0x4a05fc,_0xd102d);const _0x180d57=await fetchDatasetDoc({'appCode':_0x4a198a,'datasetCode':_0x20a977[_0x5abab8(0x153)],'datasetId':_0x20a977['id'],'enableAI':![],'extraParams':_0x4cd619}),_0x80541d=a6_0x5ac8ad[_0x5abab8(0x154)](_0x17bad0,_0xd102d+'.md');writeFileSync(_0x80541d,_0x180d57,{'encoding':_0x5abab8(0x137)}),console[_0x5abab8(0x14d)](_0x5abab8(0x12b)+_0xd102d+_0x5abab8(0x152)),logger[_0x5abab8(0x14e)](_0x5abab8(0x136),_0x5abab8(0x155)+_0xd102d,undefined,{'datasetCode':_0x20a977['datasetCode'],'datasetName':_0x20a977['name'],'filePath':_0x80541d,'progress':_0x561ef2+'/'+_0x4a05fc}),_0x1d08da[_0x5abab8(0x14f)]({'datasetCode':_0x20a977[_0x5abab8(0x153)],'datasetName':_0x20a977[_0x5abab8(0x130)],'filePath':_0x80541d,'success':!![]}),_0x561ef2<_0x4a05fc&&await delay(0x1388);}catch(_0x116dc1){const _0x3f0873=_0x116dc1 instanceof Error?_0x116dc1[_0x5abab8(0x139)]:String(_0x116dc1);console[_0x5abab8(0x14d)](_0x5abab8(0x14c)+_0xd102d+_0x5abab8(0x133)+_0x3f0873+'\x0a'),logger[_0x5abab8(0x147)](_0x5abab8(0x136),_0x5abab8(0x145)+_0x20a977['datasetCode'],{'datasetCode':_0x20a977[_0x5abab8(0x153)],'datasetName':_0x20a977[_0x5abab8(0x130)],'error':_0x3f0873,'progress':_0x561ef2+'/'+_0x4a05fc}),_0x1d08da['push']({'datasetCode':_0x20a977[_0x5abab8(0x153)],'datasetName':_0x20a977[_0x5abab8(0x130)],'filePath':'','success':![],'error':_0x3f0873}),_0x561ef2<_0x4a05fc&&(console[_0x5abab8(0x14d)](_0x5abab8(0x148)),await delay(0xbb8));}}return _0x1d08da;}function a6_0x5265(){const _0x3cb150=['6pSjPhT','POST','获取文档失败\x20(',']\x20正在生成:\x20','name','),HTTP状态码:\x20','4340czloQQ','.md\x20-\x20','1534900gsCZco','markdown','api-doc','utf8','1397245TRcHhA','message','68019796SZyaui','\x0a共有\x20','7etvduQ','/api/node-toolbox/api-doc-generator','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','\x20个数据集需要生成文档\x0a','./docs','stringify','data','406OldjgP','27jgoIxJ','生成文档失败:\x20','11580804UvgQTm','error','等待\x203\x20秒...\x0a','9691352UTORmr','length','json','✗\x20失败:\x20','log','success','push','2162012sSBrWi','string','.md','datasetCode','join','生成文档成功:\x20','status','18yRjIsK','.md\x20(','22hyYemq','✓\x20成功生成:\x20'];a6_0x5265=function(){return _0x3cb150;};return a6_0x5265();}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a7_0x9d58(_0x5b20b3,_0x501b4f){_0x5b20b3=_0x5b20b3-0xba;const _0x2e4c91=a7_0x2e4c();let _0x9d580e=_0x2e4c91[_0x5b20b3];return _0x9d580e;}(function(_0x302506,_0xa450d1){const _0x3db0ab=a7_0x9d58,_0x2d8398=_0x302506();while(!![]){try{const _0x5e6428=parseInt(_0x3db0ab(0xd8))/0x1*(parseInt(_0x3db0ab(0xd6))/0x2)+parseInt(_0x3db0ab(0xbd))/0x3+-parseInt(_0x3db0ab(0xd1))/0x4*(-parseInt(_0x3db0ab(0xe8))/0x5)+-parseInt(_0x3db0ab(0xbf))/0x6*(parseInt(_0x3db0ab(0xdf))/0x7)+-parseInt(_0x3db0ab(0xe4))/0x8+parseInt(_0x3db0ab(0xc3))/0x9+parseInt(_0x3db0ab(0xc7))/0xa;if(_0x5e6428===_0xa450d1)break;else _0x2d8398['push'](_0x2d8398['shift']());}catch(_0x40373f){_0x2d8398['push'](_0x2d8398['shift']());}}}(a7_0x2e4c,0xda17f));import{jsx as a7_0x564f87,jsxs as a7_0x347ba7}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a7_0x2e4c(){const _0x2a2da9=['red','\x20个模型','error','3097420OpYsZH','\x20个,过滤重复','env','-client','\x20重新登录后再试','76OTxQYm','column','4168qeNErJ','dim','{\x20lovrabetClient\x20}','white','api-pull','client','√\x20成功拉取\x20','1071QkxdNj','duplicateCount','\x20from\x20\x27@/','未提供应用AppCode,且配置中也没有默认值','datasetCount','354632sjhxgt','yellow','.ts','endsWith','5NeTYTO','import\x20','modelCount','cwd','replace','originalCount','!\x20原始数据集\x20','cyan','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','api','string','1780788yRYVjQ','\x20个数据集,生成','39534EykELS','使用配置的应用AppCode:\x20','\x20-\x20客户端实例文件','online','2187513akpYjL','slice','*\x20导入方式:','includes','1763650TmNdmA','-\x20模型配置文件\x20(','./src/api/','gray','green','\x20个模型)','拉取\x20API\x20配置失败:\x20'];a7_0x2e4c=function(){return _0x2a2da9;};return a7_0x2e4c();}import{readConfig,getConfigAppCode}from'../utils/config.js';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';export const ApiPullUI=({appCode:_0x5d8eb3,env:_0x423b67,output:_0x4de61f})=>{const _0x2690ad=a7_0x9d58,{exit:_0x572b7f}=useApp(),[_0x5da6c7,_0x677dec]=useState(![]),[_0x5eb1d1,_0x180122]=useState(![]),[_0x5e991d,_0x2545ce]=useState(null),[_0x361c16,_0x233483]=useState(null),_0x5bc23f=readConfig(),_0x29048d=getConfigAppCode(),_0x10e863=_0x5d8eb3||_0x29048d,_0x7fe240=typeof _0x5bc23f?.[_0x2690ad(0xd3)]===_0x2690ad(0xbc)?_0x5bc23f[_0x2690ad(0xd3)]:undefined,_0x682a35=_0x423b67||_0x7fe240||_0x2690ad(0xc2);initEnv(_0x682a35);const _0x1b4531=_0x4de61f||_0x2690ad(0xc9),_0x1bb557=_0x5d8eb3&&_0x5d8eb3[_0x2690ad(0xc6)]('-')?_0x5d8eb3['split']('-')[_0x2690ad(0xc4)](0x1)['join']('-'):'',_0x9106de=_0x5d8eb3?'使用指定的应用AppCode:\x20'+_0x10e863:_0x2690ad(0xc0)+_0x10e863,_0x2cb6a0=_0x1bb557?_0x1bb557+'-api':_0x2690ad(0xbb),_0x880dd4=_0x1bb557?_0x1bb557+_0x2690ad(0xd4):_0x2690ad(0xdd);useEffect(()=>{_0x677dec(!![]),_0x57862f();},[]),useEffect(()=>{(_0x5eb1d1||_0x5e991d)&&_0x572b7f();},[_0x5eb1d1,_0x5e991d,_0x572b7f]);async function _0x57862f(){const _0x411934=_0x2690ad;if(!_0x10e863){_0x2545ce(_0x411934(0xe2));return;}try{logger['setLogPath'](process[_0x411934(0xeb)]());const {configArray:_0x37d3a2}=await fetchModelList(_0x10e863),_0x1cb8d8=_0x37d3a2['length'],_0x412d9d=!_0x5d8eb3,_0x1c0915=await generateApiFile(_0x37d3a2,_0x1bb557,_0x10e863,_0x412d9d,_0x682a35,_0x1b4531),_0x1db002=_0x1b4531[_0x411934(0xe7)]('/')?_0x1b4531:_0x1b4531+'/';_0x233483({'api':''+_0x1db002+_0x2cb6a0+_0x411934(0xe6),'client':''+_0x1db002+_0x880dd4+'.ts','modelCount':_0x1c0915['modelCount'],'datasetCount':_0x1cb8d8,'originalCount':_0x1cb8d8,'duplicateCount':0x0}),_0x180122(!![]);}catch(_0x1ef5ce){const _0x4a8d44=_0x1ef5ce instanceof Error?_0x1ef5ce['message']:String(_0x1ef5ce);logger[_0x411934(0xd0)](_0x411934(0xdc),_0x411934(0xcd)+_0x4a8d44,{'appCode':_0x10e863,'error':_0x4a8d44}),_0x2545ce(_0x411934(0xcd)+_0x4a8d44);}finally{_0x677dec(![]);}}return a7_0x347ba7(Box,{'flexDirection':'column','children':[(_0x5da6c7||_0x5eb1d1)&&a7_0x347ba7(Box,{'children':[a7_0x564f87(Text,{'color':_0x2690ad(0xca),'children':'*\x20'}),a7_0x564f87(Text,{'color':_0x5d8eb3?_0x2690ad(0xdb):_0x2690ad(0xd9),'children':_0x9106de})]}),_0x5da6c7&&a7_0x564f87(Box,{'children':a7_0x347ba7(Text,{'children':[_0x2690ad(0xba),_0x682a35,')']})}),_0x5eb1d1&&_0x361c16&&a7_0x347ba7(Box,{'flexDirection':_0x2690ad(0xd7),'children':[a7_0x564f87(Box,{'children':a7_0x347ba7(Text,{'color':_0x2690ad(0xcb),'children':[_0x2690ad(0xde),_0x361c16[_0x2690ad(0xe3)],_0x2690ad(0xbe),'\x20',_0x361c16[_0x2690ad(0xea)],_0x2690ad(0xcf)]})}),_0x361c16[_0x2690ad(0xe0)]>0x0&&a7_0x564f87(Box,{'marginTop':0x1,'children':a7_0x347ba7(Text,{'color':_0x2690ad(0xe5),'children':[_0x2690ad(0xee),_0x361c16[_0x2690ad(0xed)],_0x2690ad(0xd2),'\x20',_0x361c16['duplicateCount'],'\x20个']})}),a7_0x564f87(Box,{'marginTop':0x1,'children':a7_0x564f87(Text,{'color':_0x2690ad(0xca),'children':'*\x20已生成文件:'})}),a7_0x347ba7(Box,{'marginLeft':0x2,'children':[a7_0x347ba7(Text,{'color':_0x2690ad(0xef),'children':['•\x20',_0x361c16[_0x2690ad(0xbb)]]}),a7_0x347ba7(Text,{'color':_0x2690ad(0xd9),'children':['\x20',_0x2690ad(0xc8),_0x361c16['modelCount'],_0x2690ad(0xcc)]})]}),a7_0x347ba7(Box,{'marginLeft':0x2,'children':[a7_0x347ba7(Text,{'color':'cyan','children':['•\x20',_0x361c16['client']]}),a7_0x564f87(Text,{'color':_0x2690ad(0xd9),'children':_0x2690ad(0xc1)})]}),a7_0x564f87(Box,{'marginTop':0x1,'children':a7_0x564f87(Text,{'color':_0x2690ad(0xca),'children':_0x2690ad(0xc5)})}),a7_0x564f87(Box,{'marginLeft':0x2,'children':a7_0x347ba7(Text,{'color':_0x2690ad(0xe5),'children':[_0x2690ad(0xe9),_0x2690ad(0xda),_0x2690ad(0xe1),_0x361c16[_0x2690ad(0xdd)][_0x2690ad(0xec)](/^\.\//,'')[_0x2690ad(0xec)](_0x2690ad(0xe6),''),'\x27']})})]}),_0x5e991d&&a7_0x347ba7(Box,{'flexDirection':_0x2690ad(0xd7),'children':[a7_0x564f87(Box,{'children':a7_0x347ba7(Text,{'color':_0x2690ad(0xce),'children':['❌\x20',_0x5e991d]})}),_0x5e991d[_0x2690ad(0xc6)]('登录')&&a7_0x347ba7(Box,{'marginTop':0x1,'children':[a7_0x564f87(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a7_0x564f87(Text,{'color':_0x2690ad(0xef),'children':'lovrabet\x20auth'}),a7_0x564f87(Text,{'color':_0x2690ad(0xe5),'children':_0x2690ad(0xd5)})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x294f2a,_0x2367fb){const _0x1bcb17=a8_0x11ca,_0x4c5261=_0x294f2a();while(!![]){try{const _0x5e5482=-parseInt(_0x1bcb17(0x122))/0x1*(-parseInt(_0x1bcb17(0x131))/0x2)+parseInt(_0x1bcb17(0x13a))/0x3*(parseInt(_0x1bcb17(0x127))/0x4)+parseInt(_0x1bcb17(0x13d))/0x5*(-parseInt(_0x1bcb17(0x13b))/0x6)+-parseInt(_0x1bcb17(0x13c))/0x7+-parseInt(_0x1bcb17(0x128))/0x8*(-parseInt(_0x1bcb17(0x124))/0x9)+parseInt(_0x1bcb17(0x125))/0xa+-parseInt(_0x1bcb17(0x136))/0xb;if(_0x5e5482===_0x2367fb)break;else _0x4c5261['push'](_0x4c5261['shift']());}catch(_0xb7b50d){_0x4c5261['push'](_0x4c5261['shift']());}}}(a8_0x4586,0x79d74));function a8_0x11ca(_0x4d1e66,_0x43439e){_0x4d1e66=_0x4d1e66-0x121;const _0x458600=a8_0x4586();let _0x11ca63=_0x458600[_0x4d1e66];return _0x11ca63;}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';export async function fetchModelList(_0x3c0f06){const _0x3c5c78=a8_0x11ca,_0x7643b0=getEnv(),_0x24b56d=getApiDomain()+_0x3c5c78(0x130)+_0x3c0f06+'&otype=array';logger['info']('fetch-model-list',_0x3c5c78(0x12e)+_0x7643b0+')',{'apiUrl':_0x24b56d});const _0x9a6864=await fetch(_0x24b56d,{'headers':{'Cookie':getCookie()}});if(!_0x9a6864['ok']){if(_0x9a6864[_0x3c5c78(0x126)]===0x191)throw new Error(_0x3c5c78(0x12d));throw new Error(_0x3c5c78(0x129)+_0x9a6864['status']);}const _0x44da07=await _0x9a6864['json']();if(!_0x44da07[_0x3c5c78(0x12c)]){const _0x52479b=_0x44da07[_0x3c5c78(0x121)]||_0x44da07[_0x3c5c78(0x123)]||_0x44da07[_0x3c5c78(0x132)]?.[_0x3c5c78(0x123)]||_0x44da07[_0x3c5c78(0x135)]||_0x44da07[_0x3c5c78(0x134)]||_0x3c5c78(0x12a);if(_0x52479b[_0x3c5c78(0x133)]('401')||_0x52479b[_0x3c5c78(0x133)]('Unauthorized')||_0x52479b['includes']('登录')||_0x52479b[_0x3c5c78(0x133)]('认证')||_0x44da07[_0x3c5c78(0x137)]===_0x3c5c78(0x138)||_0x44da07[_0x3c5c78(0x12f)]===0x191||_0x44da07[_0x3c5c78(0x12f)]==='401')throw new Error(_0x3c5c78(0x12d));throw new Error('获取数据集失败:\x20'+_0x52479b);}return{'configArray':_0x44da07[_0x3c5c78(0x132)][_0x3c5c78(0x139)],'count':_0x44da07[_0x3c5c78(0x132)][_0x3c5c78(0x12b)]};}function a8_0x4586(){const _0xff1784=['登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','正在从服务器拉取模型列表...\x20(环境:\x20','code','/api/node-toolbox/dataset/model-list?appcode=','691928CZdMav','data','includes','error','errorMessage','4906671CNPzYb','errorCode','UNAUTHORIZED','configArray','1240461BoxxVa','12bTXRXK','1733389ETVtxw','1861465PAWFZX','errorMsg','1kCDbzR','message','11484eRdtAe','2042320wQJkvP','status','8BNemJX','3512MCcRqG','获取数据集失败,HTTP状态码:\x20','未知错误','count','success'];a8_0x4586=function(){return _0xff1784;};return a8_0x4586();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a9_0x11f8d5=a9_0x3ea8;function a9_0x3ea8(_0x1300d9,_0x3d8bd3){_0x1300d9=_0x1300d9-0xaa;const _0x5f4cf2=a9_0x5f4c();let _0x3ea86c=_0x5f4cf2[_0x1300d9];return _0x3ea86c;}function a9_0x5f4c(){const _0x53e3a6=['.ts','env','format','api.ts.tpl','1522575RGpwah','../..','1290276KQryRl','./src/api/','dirname','API\x20文件生成成功!','init-api','utf8','slice','push','1089614QNgdwT','{\x20apiConfigName:\x20','\x22\x20}','datasetCode','typescript','join','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','3240188IdvhFC','success','tableName','30VqfEUs','key','online','string','33944tRiXMT','client','-api','length','1hSnYcP','app','forEach','replaceApiContent','-client','4WmWRaz','2226804HytKZv','name','648606DFcXhV','CONFIG_NAMES.DEFAULT',',\x20env:\x20\x22','alias','resolve'];a9_0x5f4c=function(){return _0x53e3a6;};return a9_0x5f4c();}(function(_0xc31df8,_0x4b5601){const _0xea6744=a9_0x3ea8,_0x25a638=_0xc31df8();while(!![]){try{const _0x45f61c=parseInt(_0xea6744(0xd3))/0x1*(-parseInt(_0xea6744(0xc1))/0x2)+parseInt(_0xea6744(0xac))/0x3*(parseInt(_0xea6744(0xab))/0x4)+parseInt(_0xea6744(0xb7))/0x5+-parseInt(_0xea6744(0xae))/0x6+parseInt(_0xea6744(0xc8))/0x7+parseInt(_0xea6744(0xcf))/0x8+parseInt(_0xea6744(0xb9))/0x9*(-parseInt(_0xea6744(0xcb))/0xa);if(_0x45f61c===_0x4b5601)break;else _0x25a638['push'](_0x25a638['shift']());}catch(_0x4cf150){_0x25a638['push'](_0x25a638['shift']());}}}(a9_0x5f4c,0x6933e));import a9_0x2d5ce9 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x1d5231 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(_0x138c7e,_0x261e56='',_0x2f7fb4,_0x548fca=![],_0x60a2ef,_0x397bf5=a9_0x11f8d5(0xba)){const _0x4cf114=a9_0x11f8d5,_0x1f1166=readConfig(),_0x2155e9=_0x2f7fb4||_0x1f1166?.[_0x4cf114(0xd4)];if(typeof _0x2155e9!==_0x4cf114(0xce)||!_0x2155e9)throw new Error(_0x4cf114(0xc7));const _0xf8c811=_0x548fca?_0x4cf114(0xaf):'\x22'+_0x2155e9+'\x22',_0xe53df2=typeof _0x1f1166[_0x4cf114(0xb4)]===_0x4cf114(0xce)?_0x1f1166[_0x4cf114(0xb4)]:undefined,_0x383b61=_0x60a2ef||_0xe53df2||_0x4cf114(0xcd),_0x51eed1=_0x383b61!==_0x4cf114(0xcd);let _0x36b44b;if(_0x548fca)_0x51eed1?_0x36b44b=_0x4cf114(0xc2)+_0xf8c811+_0x4cf114(0xb0)+_0x383b61+_0x4cf114(0xc3):_0x36b44b='';else{const _0x1b789e=_0x51eed1?_0x4cf114(0xb0)+_0x383b61+'\x22':'';_0x36b44b='{\x20apiConfigName:\x20\x22'+_0x2155e9+'\x22'+_0x1b789e+'\x20}';}const _0x24fcdd=_0x261e56?_0x261e56+_0x4cf114(0xd1):'api',_0x2a58ab=_0x261e56?_0x261e56+_0x4cf114(0xaa):_0x4cf114(0xd0),_0x389c96=[];_0x138c7e[_0x4cf114(0xd5)](_0x5cbcf0=>{const _0x18bff2=_0x4cf114;_0x389c96[_0x18bff2(0xc0)]({'datasetCode':_0x5cbcf0[_0x18bff2(0xc4)],'tableName':_0x5cbcf0[_0x18bff2(0xca)],'name':_0x5cbcf0[_0x18bff2(0xad)]||'','alias':_0x5cbcf0[_0x18bff2(0xb1)]||_0x5cbcf0[_0x18bff2(0xcc)]});});const _0x11dc52=fileURLToPath(import.meta.url),_0x5c589b=a9_0x1d5231[_0x4cf114(0xb2)](a9_0x1d5231[_0x4cf114(0xbb)](_0x11dc52),_0x4cf114(0xb8)),_0x46fe2f=a9_0x1d5231[_0x4cf114(0xc6)](_0x5c589b,'templates/generate-api'),_0x3ecb66=a9_0x1d5231[_0x4cf114(0xc6)](_0x46fe2f,_0x4cf114(0xb6)),_0x5270ef=a9_0x1d5231['join'](_0x46fe2f,'client.ts.tpl'),_0x2f0c8a=_0x397bf5['endsWith']('/')?_0x397bf5[_0x4cf114(0xbf)](0x0,-0x1):_0x397bf5;mkdirSync(_0x2f0c8a,{'recursive':!![]});const _0x32eb2b=_0x389c96[0x0]?.['alias'],_0x4ee041=readFileSync(_0x3ecb66,_0x4cf114(0xbe)),_0x4875e8=TemplateReplacer[_0x4cf114(0xd6)](_0x4ee041,_0x2155e9,_0x389c96,_0x32eb2b,_0x24fcdd,_0xf8c811),_0x638b2b=await a9_0x2d5ce9['format'](_0x4875e8,{'parser':_0x4cf114(0xc5)}),_0x3a3b4e=_0x2f0c8a+'/'+_0x24fcdd+_0x4cf114(0xb3);writeFileSync(_0x3a3b4e,_0x638b2b,{'encoding':'utf8'});const _0x199e4d=readFileSync(_0x5270ef,_0x4cf114(0xbe)),_0x4c9a4c=TemplateReplacer['replaceApiContent'](_0x199e4d,_0x2155e9,_0x389c96,_0x32eb2b,_0x24fcdd,_0xf8c811,_0x36b44b),_0x4be414=await a9_0x2d5ce9[_0x4cf114(0xb5)](_0x4c9a4c,{'parser':'typescript'}),_0x2a168d=_0x2f0c8a+'/'+_0x2a58ab+_0x4cf114(0xb3);writeFileSync(_0x2a168d,_0x4be414,{'encoding':_0x4cf114(0xbe)});const _0x25fbca=_0x389c96[_0x4cf114(0xd2)];return logger[_0x4cf114(0xc9)](_0x4cf114(0xbd),_0x4cf114(0xbc),undefined,{'apiFile':_0x3a3b4e,'clientFile':_0x2a168d,'modelCount':_0x25fbca,'configName':_0xf8c811}),{'modelCount':_0x25fbca,'apiFilePath':_0x3a3b4e,'clientFilePath':_0x2a168d,'configName':_0xf8c811};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a10_0x2354(_0x28ab0d,_0x18ce3f){_0x28ab0d=_0x28ab0d-0x179;const _0x4a5908=a10_0x4a59();let _0x2354e7=_0x4a5908[_0x28ab0d];return _0x2354e7;}(function(_0x196eb6,_0x3c6195){const _0x599824=a10_0x2354,_0x4dc693=_0x196eb6();while(!![]){try{const _0x41fec8=parseInt(_0x599824(0x180))/0x1*(parseInt(_0x599824(0x189))/0x2)+-parseInt(_0x599824(0x1af))/0x3+parseInt(_0x599824(0x1ae))/0x4+-parseInt(_0x599824(0x193))/0x5+parseInt(_0x599824(0x184))/0x6+-parseInt(_0x599824(0x1a4))/0x7*(-parseInt(_0x599824(0x196))/0x8)+parseInt(_0x599824(0x199))/0x9*(-parseInt(_0x599824(0x18c))/0xa);if(_0x41fec8===_0x3c6195)break;else _0x4dc693['push'](_0x4dc693['shift']());}catch(_0x3f59f5){_0x4dc693['push'](_0x4dc693['shift']());}}}(a10_0x4a59,0x9c340));import{jsx as a10_0x4796ab}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a10_0x4a59(){const _0x3351d4=['isArray','\x1b[90m*\x20仅生成指定数据集的文档:\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','14821UoCOtv','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','error','4006902fLIYjf','trim','filter','join','split','10nqCMgm','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','exit','4710dcIeiV','\x1b[90m*\x20使用配置的应用AppCode:\x20','params','length','flags','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','message','1394040vtcRTx','doc','string','47688KYGZRH','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','\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','22266EPpGKe','pull','appcode','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','!\x20请使用以下方式之一:','output','❌\x20错误:不再支持位置参数方式','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','input','datasetcode','×\x20未配置\x20AppCode','1491ygrxmV','parse','Unknown\x20api\x20command:\x20','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','×\x20--datasetcode\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生成\x20API\x20文档','object','\x1b[0m','log','3432060OVCBLK','2357280QwXlGT','×\x20--params\x20参数不是有效的\x20JSON\x20格式','env','map','Available\x20commands:'];a10_0x4a59=function(){return _0x3351d4;};return a10_0x4a59();}export async function apiCli(_0xddb363){const _0x27a219=a10_0x2354,_0x2fbf3f=_0xddb363[_0x27a219(0x1a1)][0x1];if(_0xddb363['flags']['help']){console[_0x27a219(0x1ad)](_0x27a219(0x198));return;}if(_0x2fbf3f===_0x27a219(0x19a)){_0xddb363[_0x27a219(0x1a1)][0x2]&&(console[_0x27a219(0x183)](_0x27a219(0x19f)),console[_0x27a219(0x1ad)]('请使用\x20--appcode\x20参数,例如:'),console[_0x27a219(0x1ad)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0xddb363[_0x27a219(0x1a1)][0x2]),process[_0x27a219(0x18b)](0x1));const _0x302e2a=getConfigAppCode();let _0x5e02e9=_0xddb363[_0x27a219(0x190)][_0x27a219(0x19b)];const _0x2aee4a=typeof _0xddb363[_0x27a219(0x190)][_0x27a219(0x17a)]===_0x27a219(0x195)?_0xddb363['flags'][_0x27a219(0x17a)]:undefined,_0x232dd7=_0xddb363[_0x27a219(0x190)][_0x27a219(0x19e)];!_0x5e02e9&&!_0x302e2a&&(console[_0x27a219(0x183)](_0x27a219(0x1a3)),console[_0x27a219(0x1ad)](_0x27a219(0x19d)),console[_0x27a219(0x1ad)](_0x27a219(0x19c)),console['log'](_0x27a219(0x1a7)),process[_0x27a219(0x18b)](0x1)),_0x5e02e9&&_0x302e2a&&_0x5e02e9===_0x302e2a&&(console[_0x27a219(0x1ad)](_0x27a219(0x18d)+_0x5e02e9+_0x27a219(0x1ac)),console[_0x27a219(0x1ad)](_0x27a219(0x1a0)),_0x5e02e9=undefined),render(a10_0x4796ab(ApiPullUI,{'appCode':_0x5e02e9,'env':_0x2aee4a,'output':_0x232dd7}));}else{if(_0x2fbf3f===_0x27a219(0x194)){_0xddb363[_0x27a219(0x1a1)][0x2]&&(console[_0x27a219(0x183)](_0x27a219(0x19f)),console[_0x27a219(0x1ad)]('请使用\x20--appcode\x20参数,例如:'),console[_0x27a219(0x1ad)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0xddb363[_0x27a219(0x1a1)][0x2]),process[_0x27a219(0x18b)](0x1));const _0x34a044=getConfigAppCode();let _0xd733b=_0xddb363[_0x27a219(0x190)][_0x27a219(0x19b)];const _0x49d0be=typeof _0xddb363[_0x27a219(0x190)][_0x27a219(0x17a)]===_0x27a219(0x195)?_0xddb363['flags'][_0x27a219(0x17a)]:undefined,_0x2d2c42=_0xddb363[_0x27a219(0x190)]['output'],_0x113af8=_0xddb363['flags'][_0x27a219(0x18e)],_0x411902=_0xddb363[_0x27a219(0x190)][_0x27a219(0x1a2)];!_0xd733b&&!_0x34a044&&(console[_0x27a219(0x183)](_0x27a219(0x1a3)),console[_0x27a219(0x1ad)](_0x27a219(0x19d)),console[_0x27a219(0x1ad)](_0x27a219(0x19c)),console[_0x27a219(0x1ad)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process[_0x27a219(0x18b)](0x1));_0xd733b&&_0x34a044&&_0xd733b===_0x34a044&&(console[_0x27a219(0x1ad)](_0x27a219(0x18d)+_0xd733b+_0x27a219(0x1ac)),_0xd733b=undefined);let _0x35d978;if(_0x113af8)try{_0x35d978=JSON[_0x27a219(0x1a5)](_0x113af8),(typeof _0x35d978!==_0x27a219(0x1ab)||_0x35d978===null||Array[_0x27a219(0x17d)](_0x35d978))&&(console[_0x27a219(0x183)](_0x27a219(0x197)),process[_0x27a219(0x18b)](0x1));}catch(_0x200aee){console[_0x27a219(0x183)](_0x27a219(0x179)),console[_0x27a219(0x183)]('\x20\x20错误:\x20'+(_0x200aee instanceof Error?_0x200aee[_0x27a219(0x192)]:String(_0x200aee))),process[_0x27a219(0x18b)](0x1);}let _0x3e6260;_0x411902&&(_0x3e6260=_0x411902[_0x27a219(0x188)](',')[_0x27a219(0x17b)](_0x563880=>_0x563880[_0x27a219(0x185)]())[_0x27a219(0x186)](_0x509898=>_0x509898[_0x27a219(0x18f)]>0x0),_0x3e6260[_0x27a219(0x18f)]===0x0&&(console[_0x27a219(0x183)](_0x27a219(0x1a9)),process['exit'](0x1)),console[_0x27a219(0x1ad)](_0x27a219(0x17e)+_0x3e6260[_0x27a219(0x187)](',\x20')+'\x1b[0m')),render(a10_0x4796ab(ApiDocUI,{'appCode':_0xd733b,'env':_0x49d0be,'output':_0x2d2c42,'extraParams':_0x35d978,'datasetCodes':_0x3e6260}));}else console[_0x27a219(0x183)](_0x27a219(0x1a6)+_0x2fbf3f),console[_0x27a219(0x1ad)](_0x27a219(0x17c)),console['log']('\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配置文件'),console['log'](_0x27a219(0x181)),console[_0x27a219(0x1ad)](_0x27a219(0x1a8)),console['log'](_0x27a219(0x17f)),console[_0x27a219(0x1ad)](''),console[_0x27a219(0x1ad)](_0x27a219(0x1aa)),console['log'](_0x27a219(0x191)),console['log'](_0x27a219(0x182)),console[_0x27a219(0x1ad)](_0x27a219(0x18a)),process[_0x27a219(0x18b)](0x1);}}
|