@lovrabet/cli 1.2.5-beta.1 → 1.2.5-beta.3

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.
Files changed (81) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -0
  5. package/lib/ai-setup/config.js +1 -0
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/McpInstallUI.js +1 -0
  53. package/lib/mcp/claude.js +1 -1
  54. package/lib/mcp/cursor.js +1 -1
  55. package/lib/mcp/main.js +1 -1
  56. package/lib/skills/SkillInstallUI.js +1 -0
  57. package/lib/skills/main.js +1 -1
  58. package/lib/utils/check-sdk-version.js +1 -1
  59. package/lib/utils/config.js +1 -1
  60. package/lib/utils/copy-directory.js +1 -1
  61. package/lib/utils/http-client.js +1 -1
  62. package/lib/utils/logger.js +1 -1
  63. package/lib/utils/router-updater.js +1 -1
  64. package/lib/utils/sleep.js +1 -1
  65. package/lib/utils/template-replacer.js +1 -1
  66. package/package.json +1 -1
  67. package/templates/pages/blank/index.tsx.tpl +1 -2
  68. package/templates/pages/sdk-fetch/index.tsx.tpl +1 -2
  69. package/templates/rules/lovrabet_rules.mdc.tpl +109 -0
  70. package/templates/skills/.agent/skills/lovrabet/SKILL.md +258 -0
  71. package/templates/skills/.claude/skills/lovrabet/SKILL.md +1 -0
  72. package/templates/skills/.codebuddy/skills/lovrabet/SKILL.md +258 -0
  73. package/templates/skills/.codex/skills/lovrabet/SKILL.md +258 -0
  74. package/templates/skills/.cursor/commands/lovrabet.md +1 -0
  75. package/templates/skills/.opencode/skills/lovrabet/SKILL.md +258 -0
  76. package/templates/skills/.qoder/rules/lovrabet.md +258 -0
  77. package/templates/skills/.qoder/skills/lovrabet.md +258 -0
  78. package/templates/skills/.shared/guides/03-antd-style/guide.md +42 -0
  79. package/templates/skills/.shared/guides/07-backend-function/guide.md +679 -0
  80. package/templates/skills/.trae/skills/lovrabet/SKILL.md +258 -0
  81. package/templates/skills/.windsurf/workflows/lovrabet.md +1 -0
@@ -1 +1 @@
1
- (function(_0x31c52c,_0x442cb2){const _0x15f8ef=a0_0x2d5f,_0x568e80=_0x31c52c();while(!![]){try{const _0x1c78ea=-parseInt(_0x15f8ef(0x99))/0x1*(parseInt(_0x15f8ef(0x91))/0x2)+parseInt(_0x15f8ef(0x90))/0x3+-parseInt(_0x15f8ef(0xa4))/0x4+-parseInt(_0x15f8ef(0xa1))/0x5+parseInt(_0x15f8ef(0x8e))/0x6+-parseInt(_0x15f8ef(0x8a))/0x7+-parseInt(_0x15f8ef(0xa7))/0x8*(-parseInt(_0x15f8ef(0x98))/0x9);if(_0x1c78ea===_0x442cb2)break;else _0x568e80['push'](_0x568e80['shift']());}catch(_0x481d04){_0x568e80['push'](_0x568e80['shift']());}}}(a0_0x39c9,0x350ce));function a0_0x2d5f(_0x1bfd4b,_0x57ee8b){_0x1bfd4b=_0x1bfd4b-0x89;const _0x39c9f6=a0_0x39c9();let _0x2d5f2a=_0x39c9f6[_0x1bfd4b];return _0x2d5f2a;}import{jsx as a0_0x43e64f,jsxs as a0_0x1813ed}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x1711aa from'node:fs';export function InputProjectCode(_0x19aba4){const _0xd80925=a0_0x2d5f,{onSubmit:_0x23143f,pagePath:_0x604d00}=_0x19aba4,[_0x9767fc,_0x567b1c]=useState(''),[_0x280996,_0xf78fd]=useState(''),_0x1b9289=_0xd80925(0x9b);function _0x17be88(_0x4ed20f){const _0x4bb894=_0xd80925;if(_0x4ed20f[_0x4bb894(0x8f)]>0x64)return{'valid':![],'message':_0x4bb894(0xa0)};if(_0x4ed20f[_0x4bb894(0x97)]('/')||_0x4ed20f[_0x4bb894(0xa5)]('/'))return{'valid':![],'message':_0x4bb894(0xa2)};if(_0x4ed20f[_0x4bb894(0x8c)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x150475=_0x4ed20f[_0x4bb894(0x93)]('/');for(const _0x3dc8de of _0x150475){if(!_0x3dc8de)continue;const _0x5360cf=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5360cf[_0x4bb894(0x8d)](_0x3dc8de))return{'valid':![],'message':_0x4bb894(0x96)};}return{'valid':!![]};}return useInput((_0x28e5e8,_0xd6db44)=>{const _0x2e6e8e=_0xd80925;if(_0xd6db44['return']){const _0x201156=_0x9767fc['trim']()||_0x1b9289;if(_0x280996)return;const _0x371598=_0x604d00+'/'+_0x201156;if(a0_0x1711aa[_0x2e6e8e(0x89)](_0x371598)){_0xf78fd(_0x2e6e8e(0x9f)+_0x201156+'\x20已存在,请使用其他路径');return;}_0x23143f(_0x201156),_0x567b1c(''),_0xf78fd('');}else _0xd6db44['backspace']||_0xd6db44[_0x2e6e8e(0x9e)]?_0x567b1c(_0x3795a5=>{const _0x4e9885=_0x2e6e8e,_0xde7b=_0x3795a5[_0x4e9885(0x9a)](0x0,-0x1),{valid:_0x3a956b,message:_0x5752e6}=_0x17be88(_0xde7b);return _0xf78fd(_0x3a956b?'':_0x5752e6||_0x4e9885(0xa6)),_0xde7b;}):_0x567b1c(_0x44cd94=>{const _0x293d26=_0x44cd94+_0x28e5e8,{valid:_0x29d66f,message:_0x5a617b}=_0x17be88(_0x293d26);return _0xf78fd(_0x29d66f?'':_0x5a617b||'页面路径不合法'),_0x293d26;});}),a0_0x1813ed(Box,{'flexDirection':_0xd80925(0x9c),'children':[a0_0x1813ed(Box,{'children':[a0_0x43e64f(Text,{'color':'gray','children':_0xd80925(0x92)}),a0_0x43e64f(Text,{'children':_0xd80925(0x8b)}),_0x9767fc?a0_0x43e64f(Text,{'color':_0xd80925(0x95),'children':_0x9767fc}):a0_0x43e64f(Text,{'color':_0xd80925(0xa3),'children':_0x1b9289}),_0x280996&&a0_0x1813ed(Text,{'color':_0xd80925(0x94),'children':[_0xd80925(0x9d),_0x280996]})]}),!_0x280996&&!_0x9767fc&&a0_0x43e64f(Box,{'children':a0_0x43e64f(Text,{'color':'gray','children':'\x20直接回车确认,或输入自定义路由地址'})})]});}function a0_0x39c9(){const _0x4070e5=['existsSync','1129065auZnLX','页面路由地址:\x20','includes','test','1034004OvOkwq','length','1001460VlkUci','10MvFaep','\x20Step2:\x20','split','red','green','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','startsWith','531ySBRND','67323rXASfi','slice','my-page','column','\x20←\x20','delete','页面路径\x20','页面路径长度不能超过\x20100\x20个字符','1069240BrnBJx','路径不能以\x20/\x20开头或结尾','gray','631592BaWjNZ','endsWith','页面路径不合法','78752qjFerQ'];a0_0x39c9=function(){return _0x4070e5;};return a0_0x39c9();}
1
+ function a0_0x1e39(_0x58216e,_0x258475){_0x58216e=_0x58216e-0x1c6;const _0x39c623=a0_0x39c6();let _0x1e3934=_0x39c623[_0x58216e];return _0x1e3934;}(function(_0x2afa61,_0xdc3c2a){const _0x2b9115=a0_0x1e39,_0x70e790=_0x2afa61();while(!![]){try{const _0x142fbf=-parseInt(_0x2b9115(0x1d4))/0x1+parseInt(_0x2b9115(0x1d1))/0x2+parseInt(_0x2b9115(0x1c9))/0x3+-parseInt(_0x2b9115(0x1e0))/0x4*(-parseInt(_0x2b9115(0x1cc))/0x5)+parseInt(_0x2b9115(0x1db))/0x6+-parseInt(_0x2b9115(0x1c7))/0x7*(-parseInt(_0x2b9115(0x1e2))/0x8)+-parseInt(_0x2b9115(0x1e5))/0x9*(parseInt(_0x2b9115(0x1e1))/0xa);if(_0x142fbf===_0xdc3c2a)break;else _0x70e790['push'](_0x70e790['shift']());}catch(_0x1b3523){_0x70e790['push'](_0x70e790['shift']());}}}(a0_0x39c6,0xd3f4f));import{jsx as a0_0x555910,jsxs as a0_0x3ddfff}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0x39c6(){const _0x5cda5b=['column','1087182auBoxF','gray','green','764359CInvju','slice','split','return','\x20Step2:\x20','页面路径\x20','my-page','7146876YTeIzf','red','test','existsSync','includes','3491836pTkXLd','32620670QNTNeD','4411768hlIMSY','页面路径长度不能超过\x20100\x20个字符','路径不能以\x20/\x20开头或结尾','9uqYFeW','delete','7cGbaMD','页面路径不合法','5206302szfoQZ','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','startsWith','5jfApoX','\x20已存在,请使用其他路径','backspace','页面路由地址:\x20'];a0_0x39c6=function(){return _0x5cda5b;};return a0_0x39c6();}import a0_0x2f127f from'node:fs';export function InputProjectCode(_0x31b9e2){const _0x2cd9a9=a0_0x1e39,{onSubmit:_0x1da9c6,pagePath:_0x441afb}=_0x31b9e2,[_0x5a69c9,_0x104d96]=useState(''),[_0x5a1963,_0x4c9929]=useState(''),_0x633387=_0x2cd9a9(0x1da);function _0xfb33f(_0x12fba3){const _0x4013ed=_0x2cd9a9;if(_0x12fba3['length']>0x64)return{'valid':![],'message':_0x4013ed(0x1e3)};if(_0x12fba3[_0x4013ed(0x1cb)]('/')||_0x12fba3['endsWith']('/'))return{'valid':![],'message':_0x4013ed(0x1e4)};if(_0x12fba3[_0x4013ed(0x1df)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x2e153e=_0x12fba3[_0x4013ed(0x1d6)]('/');for(const _0x1c2f88 of _0x2e153e){if(!_0x1c2f88)continue;const _0x425c79=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x425c79[_0x4013ed(0x1dd)](_0x1c2f88))return{'valid':![],'message':_0x4013ed(0x1ca)};}return{'valid':!![]};}return useInput((_0x52a066,_0x4a232b)=>{const _0x118a7d=_0x2cd9a9;if(_0x4a232b[_0x118a7d(0x1d7)]){const _0x35daae=_0x5a69c9['trim']()||_0x633387;if(_0x5a1963)return;const _0x49a7ec=_0x441afb+'/'+_0x35daae;if(a0_0x2f127f[_0x118a7d(0x1de)](_0x49a7ec)){_0x4c9929(_0x118a7d(0x1d9)+_0x35daae+_0x118a7d(0x1cd));return;}_0x1da9c6(_0x35daae),_0x104d96(''),_0x4c9929('');}else _0x4a232b[_0x118a7d(0x1ce)]||_0x4a232b[_0x118a7d(0x1c6)]?_0x104d96(_0x40e400=>{const _0x5f5c74=_0x118a7d,_0x4dad29=_0x40e400[_0x5f5c74(0x1d5)](0x0,-0x1),{valid:_0x4f464c,message:_0x4fd5cb}=_0xfb33f(_0x4dad29);return _0x4c9929(_0x4f464c?'':_0x4fd5cb||_0x5f5c74(0x1c8)),_0x4dad29;}):_0x104d96(_0x3dc694=>{const _0x1d60b5=_0x118a7d,_0x4456d0=_0x3dc694+_0x52a066,{valid:_0x3bfb4d,message:_0x451235}=_0xfb33f(_0x4456d0);return _0x4c9929(_0x3bfb4d?'':_0x451235||_0x1d60b5(0x1c8)),_0x4456d0;});}),a0_0x3ddfff(Box,{'flexDirection':_0x2cd9a9(0x1d0),'children':[a0_0x3ddfff(Box,{'children':[a0_0x555910(Text,{'color':'gray','children':_0x2cd9a9(0x1d8)}),a0_0x555910(Text,{'children':_0x2cd9a9(0x1cf)}),_0x5a69c9?a0_0x555910(Text,{'color':_0x2cd9a9(0x1d3),'children':_0x5a69c9}):a0_0x555910(Text,{'color':_0x2cd9a9(0x1d2),'children':_0x633387}),_0x5a1963&&a0_0x3ddfff(Text,{'color':_0x2cd9a9(0x1dc),'children':['\x20←\x20',_0x5a1963]})]}),!_0x5a1963&&!_0x5a69c9&&a0_0x555910(Box,{'children':a0_0x555910(Text,{'color':_0x2cd9a9(0x1d2),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x37681e=a1_0x3eab;(function(_0x52b606,_0x164e64){const _0x3be899=a1_0x3eab,_0x2381bc=_0x52b606();while(!![]){try{const _0xa8df6=parseInt(_0x3be899(0x8b))/0x1*(parseInt(_0x3be899(0x9a))/0x2)+parseInt(_0x3be899(0x82))/0x3*(parseInt(_0x3be899(0x8e))/0x4)+-parseInt(_0x3be899(0xa7))/0x5+-parseInt(_0x3be899(0x91))/0x6*(parseInt(_0x3be899(0x8f))/0x7)+parseInt(_0x3be899(0x8a))/0x8*(-parseInt(_0x3be899(0x88))/0x9)+parseInt(_0x3be899(0xa0))/0xa*(-parseInt(_0x3be899(0x98))/0xb)+parseInt(_0x3be899(0x96))/0xc;if(_0xa8df6===_0x164e64)break;else _0x2381bc['push'](_0x2381bc['shift']());}catch(_0x1c677a){_0x2381bc['push'](_0x2381bc['shift']());}}}(a1_0x5b0a,0x45dce));function a1_0x3eab(_0x4e6bc2,_0x40fb70){_0x4e6bc2=_0x4e6bc2-0x7f;const _0x5b0a8e=a1_0x5b0a();let _0x3eab71=_0x5b0a8e[_0x4e6bc2];return _0x3eab71;}import{jsx as a1_0x6fc5a4,jsxs as a1_0x9e3676,Fragment as a1_0x355342}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x490b78 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x5b0a(){const _0x4e6425=['../../templates/pages','resolve','\x20Step2:\x20','10rjRPcv','now','pages','cwd','catch','join','src','123635ztwwzT','dirname','\x20*\x20路由地址:\x20','已选择页面模板\x20','178284xRJaRV','cyan','green','已输入的页面路由\x20','gray','message','2484dGqzeA','finally','1568LFykMS','8kPUdxx','error','\x20*\x20页面文件已创建,可直接通过路由访问','32ZFzzKr','14EnQipk','setLogPath','597078PYxIwb','页面添加失败:\x20','开始添加页面:\x20','\x20Step1:\x20','页面添加成功:\x20','2304660ENeUFP','正在创建页面,请稍候…','5082088AooCnf','\x20*\x20页面创建成功!','89634rkIHmt','processTemplate','add-page'];a1_0x5b0a=function(){return _0x4e6425;};return a1_0x5b0a();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x490b78[a1_0x37681e(0x7f)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x490b78[a1_0x37681e(0x9e)](__dirname,a1_0x37681e(0x9d)),projectDir=process[a1_0x37681e(0xa3)]();export const AddPage=()=>{const _0x2b5cf0=a1_0x37681e,{exit:_0x31816d}=useApp(),[_0x10ca6d,_0x370907]=useState(''),[_0x10b8ab,_0x137a61]=useState(''),[_0x18b765,_0x998fb]=useState(![]),[_0x2b30fb,_0x5cb46b]=useState(![]),_0x3d22d6=a1_0x490b78[_0x2b5cf0(0xa5)](projectDir,_0x2b5cf0(0xa6),_0x2b5cf0(0xa2)),_0x55ef22=a1_0x490b78['join'](_0x3d22d6,_0x10b8ab),_0x3d2fd3=a1_0x490b78[_0x2b5cf0(0xa5)](_0x2b5cf0(0xa6),_0x2b5cf0(0xa2),_0x10b8ab);useEffect(()=>{const _0x48cca1=_0x2b5cf0,_0x8c74c=a1_0x490b78[_0x48cca1(0x9e)](pageTemplateDir,_0x10ca6d);if(_0x10ca6d&&_0x10b8ab){_0x998fb(!![]),logger[_0x48cca1(0x90)](process[_0x48cca1(0xa3)]());const _0x64bada=Date[_0x48cca1(0xa1)]();logger['info'](_0x48cca1(0x9c),_0x48cca1(0x93)+_0x10b8ab,{'template':_0x10ca6d,'targetPath':_0x3d2fd3}),TemplateReplacer[_0x48cca1(0x9b)](_0x8c74c,a1_0x490b78[_0x48cca1(0xa5)](_0x3d22d6,_0x10b8ab),_0x10b8ab,_0x10ca6d)['then'](()=>{const _0x36200f=_0x48cca1,_0x113136=Date[_0x36200f(0xa1)]()-_0x64bada;logger['success'](_0x36200f(0x9c),_0x36200f(0x95)+_0x10b8ab,_0x113136,{'template':_0x10ca6d,'targetPath':_0x3d2fd3,'routePath':_0x10b8ab}),_0x5cb46b(!![]);})[_0x48cca1(0xa4)](_0x14499b=>{const _0x51f5ec=_0x48cca1,_0x19ce7e=Date['now']()-_0x64bada;logger[_0x51f5ec(0x8c)](_0x51f5ec(0x9c),_0x51f5ec(0x92)+_0x10b8ab,{'template':_0x10ca6d,'targetPath':_0x3d2fd3,'error':_0x14499b instanceof Error?_0x14499b[_0x51f5ec(0x87)]:String(_0x14499b),'duration':_0x19ce7e});})[_0x48cca1(0x89)](()=>{_0x998fb(![]);});}},[_0x10ca6d,_0x10b8ab]),useEffect(()=>{_0x2b30fb&&setTimeout(()=>{_0x31816d();});},[_0x2b30fb]);if(_0x10ca6d)return a1_0x9e3676(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x94)}),a1_0x6fc5a4(Text,{'children':_0x2b5cf0(0x81)}),a1_0x6fc5a4(Text,{'color':'green','children':_0x10ca6d})]}),_0x10b8ab?a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x9f)}),a1_0x6fc5a4(Text,{'children':_0x2b5cf0(0x85)}),a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x84),'children':_0x10b8ab})]}):a1_0x6fc5a4(InputProjectCode,{'pagePath':_0x55ef22,'onSubmit':_0x137a61}),_0x10b8ab&&_0x18b765?a1_0x9e3676(Box,{'marginTop':0x1,'children':[a1_0x6fc5a4(Box,{'width':'4'}),a1_0x6fc5a4(Text,{'children':_0x2b5cf0(0x97)})]}):null,_0x2b30fb?a1_0x9e3676(a1_0x355342,{'children':[a1_0x6fc5a4(Box,{'marginTop':0x1,'children':a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x99)})}),a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':'\x20*\x20页面路径:\x20'}),a1_0x6fc5a4(Text,{'color':'green','children':_0x3d2fd3})]}),a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x80)}),a1_0x9e3676(Text,{'color':_0x2b5cf0(0x84),'children':['/',_0x10b8ab]})]}),a1_0x6fc5a4(Box,{'marginTop':0x1,'children':a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x83),'children':_0x2b5cf0(0x8d)})})]}):null]});return a1_0x6fc5a4(SelectPageTemplate,{'onSelect':_0x370907});};
1
+ const a1_0x48fbe6=a1_0x463d;(function(_0xe62f3c,_0x2349bb){const _0x32edef=a1_0x463d,_0x1cff1d=_0xe62f3c();while(!![]){try{const _0x4d93d0=parseInt(_0x32edef(0x128))/0x1*(-parseInt(_0x32edef(0x135))/0x2)+-parseInt(_0x32edef(0x124))/0x3*(-parseInt(_0x32edef(0x114))/0x4)+parseInt(_0x32edef(0x132))/0x5+parseInt(_0x32edef(0x131))/0x6+-parseInt(_0x32edef(0x117))/0x7*(-parseInt(_0x32edef(0x134))/0x8)+-parseInt(_0x32edef(0x120))/0x9+parseInt(_0x32edef(0x118))/0xa;if(_0x4d93d0===_0x2349bb)break;else _0x1cff1d['push'](_0x1cff1d['shift']());}catch(_0xe70ba2){_0x1cff1d['push'](_0x1cff1d['shift']());}}}(a1_0x12e2,0xe1fc9));import{jsx as a1_0x550a77,jsxs as a1_0xec01c6,Fragment as a1_0x13962a}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x9c26e0 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0x463d(_0xd9a31d,_0x5ef613){_0xd9a31d=_0xd9a31d-0x114;const _0x12e24f=a1_0x12e2();let _0x463def=_0x12e24f[_0xd9a31d];return _0x463def;}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_0x9c26e0['dirname'](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x9c26e0['resolve'](__dirname,'../../templates/pages'),projectDir=process[a1_0x48fbe6(0x12a)]();function a1_0x12e2(){const _0x2f2227=['页面添加失败:\x20','3106152VwvwdC','1774ySbEWn','setLogPath','18492itCuam','\x20*\x20页面创建成功!','now','7IkeKFu','16143130RPVRhJ','\x20*\x20页面路径:\x20','src','then','add-page','已输入的页面路由\x20','gray','column','13507722yXGwhv','\x20*\x20页面文件已创建,可直接通过路由访问','cyan','pages','186FCXUid','resolve','\x20Step2:\x20','info','1553FORyFY','green','cwd','已选择页面模板\x20','页面添加成功:\x20','\x20Step1:\x20','processTemplate','success','\x20*\x20路由地址:\x20','469362HbvKgA','7182875IxwaRy'];a1_0x12e2=function(){return _0x2f2227;};return a1_0x12e2();}export const AddPage=()=>{const _0x373679=a1_0x48fbe6,{exit:_0x7549ab}=useApp(),[_0x4b8d31,_0x431a14]=useState(''),[_0x319e9a,_0x3241ed]=useState(''),[_0x170355,_0x5a2370]=useState(![]),[_0x119684,_0x51ebef]=useState(![]),_0x2e434e=a1_0x9c26e0['join'](projectDir,_0x373679(0x11a),_0x373679(0x123)),_0x330510=a1_0x9c26e0['join'](_0x2e434e,_0x319e9a),_0x4e2ac5=a1_0x9c26e0['join'](_0x373679(0x11a),_0x373679(0x123),_0x319e9a);useEffect(()=>{const _0x482fa3=_0x373679,_0x51ed28=a1_0x9c26e0[_0x482fa3(0x125)](pageTemplateDir,_0x4b8d31);if(_0x4b8d31&&_0x319e9a){_0x5a2370(!![]),logger[_0x482fa3(0x136)](process['cwd']());const _0x59975a=Date[_0x482fa3(0x116)]();logger[_0x482fa3(0x127)](_0x482fa3(0x11c),'开始添加页面:\x20'+_0x319e9a,{'template':_0x4b8d31,'targetPath':_0x4e2ac5}),TemplateReplacer[_0x482fa3(0x12e)](_0x51ed28,a1_0x9c26e0['join'](_0x2e434e,_0x319e9a),_0x319e9a,_0x4b8d31)[_0x482fa3(0x11b)](()=>{const _0x37fce6=_0x482fa3,_0x30de33=Date[_0x37fce6(0x116)]()-_0x59975a;logger[_0x37fce6(0x12f)](_0x37fce6(0x11c),_0x37fce6(0x12c)+_0x319e9a,_0x30de33,{'template':_0x4b8d31,'targetPath':_0x4e2ac5,'routePath':_0x319e9a}),_0x51ebef(!![]);})['catch'](_0x34e866=>{const _0x23e158=_0x482fa3,_0x8449bc=Date[_0x23e158(0x116)]()-_0x59975a;logger['error'](_0x23e158(0x11c),_0x23e158(0x133)+_0x319e9a,{'template':_0x4b8d31,'targetPath':_0x4e2ac5,'error':_0x34e866 instanceof Error?_0x34e866['message']:String(_0x34e866),'duration':_0x8449bc});})['finally'](()=>{_0x5a2370(![]);});}},[_0x4b8d31,_0x319e9a]),useEffect(()=>{_0x119684&&setTimeout(()=>{_0x7549ab();});},[_0x119684]);if(_0x4b8d31)return a1_0xec01c6(Box,{'flexDirection':_0x373679(0x11f),'paddingY':0x1,'children':[a1_0xec01c6(Box,{'children':[a1_0x550a77(Text,{'color':_0x373679(0x11e),'children':_0x373679(0x12d)}),a1_0x550a77(Text,{'children':_0x373679(0x12b)}),a1_0x550a77(Text,{'color':_0x373679(0x129),'children':_0x4b8d31})]}),_0x319e9a?a1_0xec01c6(Box,{'children':[a1_0x550a77(Text,{'color':'gray','children':_0x373679(0x126)}),a1_0x550a77(Text,{'children':_0x373679(0x11d)}),a1_0x550a77(Text,{'color':'green','children':_0x319e9a})]}):a1_0x550a77(InputProjectCode,{'pagePath':_0x330510,'onSubmit':_0x3241ed}),_0x319e9a&&_0x170355?a1_0xec01c6(Box,{'marginTop':0x1,'children':[a1_0x550a77(Box,{'width':'4'}),a1_0x550a77(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x119684?a1_0xec01c6(a1_0x13962a,{'children':[a1_0x550a77(Box,{'marginTop':0x1,'children':a1_0x550a77(Text,{'color':_0x373679(0x11e),'children':_0x373679(0x115)})}),a1_0xec01c6(Box,{'children':[a1_0x550a77(Text,{'color':_0x373679(0x11e),'children':_0x373679(0x119)}),a1_0x550a77(Text,{'color':'green','children':_0x4e2ac5})]}),a1_0xec01c6(Box,{'children':[a1_0x550a77(Text,{'color':_0x373679(0x11e),'children':_0x373679(0x130)}),a1_0xec01c6(Text,{'color':_0x373679(0x129),'children':['/',_0x319e9a]})]}),a1_0x550a77(Box,{'marginTop':0x1,'children':a1_0x550a77(Text,{'color':_0x373679(0x122),'children':_0x373679(0x121)})})]}):null]});return a1_0x550a77(SelectPageTemplate,{'onSelect':_0x431a14});};
@@ -1 +1 @@
1
- function a2_0x59dd(){const _0x3a48ec=['2774456iksrEf','upArrow','column','localeCompare','resolve','map','12cTqugY','正在加载页面模板...','\x20Step1:\x20','isDirectory','dirname','filter','236RoObIS','12frasTS','9BZkHkv','6834560EeNlqT','sort','blank','gray','13428eNdmYY','59628qeaPKH','18012423fHQNCw','name','length','238PqzMrw','error','green','label','获取模板列表失败:','1038280ChlagA','111927OSIhIw','return','downArrow','../..'];a2_0x59dd=function(){return _0x3a48ec;};return a2_0x59dd();}(function(_0x3ae0fe,_0x183f6d){const _0x3b3cd2=a2_0x2082,_0x3d7ee4=_0x3ae0fe();while(!![]){try{const _0x375e91=parseInt(_0x3b3cd2(0xd5))/0x1*(parseInt(_0x3b3cd2(0xf0))/0x2)+-parseInt(_0x3b3cd2(0xe0))/0x3*(-parseInt(_0x3b3cd2(0xea))/0x4)+parseInt(_0x3b3cd2(0xf3))/0x5+parseInt(_0x3b3cd2(0xd6))/0x6*(-parseInt(_0x3b3cd2(0xda))/0x7)+parseInt(_0x3b3cd2(0xe4))/0x8*(-parseInt(_0x3b3cd2(0xf2))/0x9)+parseInt(_0x3b3cd2(0xdf))/0xa+parseInt(_0x3b3cd2(0xd7))/0xb*(-parseInt(_0x3b3cd2(0xf1))/0xc);if(_0x375e91===_0x183f6d)break;else _0x3d7ee4['push'](_0x3d7ee4['shift']());}catch(_0x2998bb){_0x3d7ee4['push'](_0x3d7ee4['shift']());}}}(a2_0x59dd,0xce4b3));import{jsx as a2_0xd8dedf,jsxs as a2_0x50eaff}from'react/jsx-runtime';function a2_0x2082(_0x218799,_0x207107){_0x218799=_0x218799-0xd2;const _0x59dd5c=a2_0x59dd();let _0x208204=_0x59dd5c[_0x218799];return _0x208204;}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x120169 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x18bca0=a2_0x2082;try{const _0x45d9d6=fileURLToPath(import.meta.url),_0x348240=a2_0x120169[_0x18bca0(0xe8)](a2_0x120169[_0x18bca0(0xee)](_0x45d9d6),_0x18bca0(0xe3)),_0x1e08f6=a2_0x120169['join'](_0x348240,'templates/pages'),_0x43e9be=await readdir(_0x1e08f6,{'withFileTypes':!![]}),_0x564ea6=_0x43e9be[_0x18bca0(0xef)](_0x101293=>_0x101293[_0x18bca0(0xed)]())[_0x18bca0(0xe9)](_0x45eec4=>({'label':_0x45eec4[_0x18bca0(0xd8)]}))[_0x18bca0(0xd2)]((_0x215583,_0x150227)=>_0x215583['label'][_0x18bca0(0xe7)](_0x150227[_0x18bca0(0xdd)]));return _0x564ea6;}catch(_0x4b3130){return console[_0x18bca0(0xdb)](_0x18bca0(0xde),_0x4b3130),[{'label':_0x18bca0(0xd3)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x194b3e){const _0x2c2274=a2_0x2082,[_0x19c8fe,_0x51f894]=useState(0x0),[_0x5bc2b9,_0x3659bc]=useState([]),[_0x52fa17,_0x56dd6f]=useState(!![]);useEffect(()=>{async function _0x1b19de(){const _0x2211c6=await getTemplateList();_0x3659bc(_0x2211c6),_0x56dd6f(![]);}_0x1b19de();},[]),useInput((_0x2fab33,_0x3ebda5)=>{const _0x3183f0=a2_0x2082;if(_0x52fa17)return;if(_0x3ebda5[_0x3183f0(0xe1)]){const _0xe44361=_0x5bc2b9[_0x19c8fe];_0xe44361&&_0x194b3e['onSelect'](_0xe44361['label']);}_0x3ebda5[_0x3183f0(0xe5)]&&_0x51f894(_0x32de82=>_0x32de82===0x0?_0x5bc2b9[_0x3183f0(0xd9)]-0x1:_0x32de82-0x1),_0x3ebda5[_0x3183f0(0xe2)]&&_0x51f894(_0x2a0a1e=>_0x2a0a1e===_0x5bc2b9[_0x3183f0(0xd9)]-0x1?0x0:_0x2a0a1e+0x1);});if(_0x52fa17)return a2_0xd8dedf(Box,{'flexDirection':_0x2c2274(0xe6),'paddingY':0x1,'children':a2_0x50eaff(Box,{'children':[a2_0xd8dedf(Text,{'color':_0x2c2274(0xd4),'children':_0x2c2274(0xec)}),a2_0xd8dedf(Text,{'children':_0x2c2274(0xeb)})]})});return a2_0x50eaff(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x50eaff(Box,{'children':[a2_0xd8dedf(Text,{'color':'gray','children':_0x2c2274(0xec)}),a2_0xd8dedf(Text,{'children':'请选择您要创建的页面模板'})]}),_0x5bc2b9[_0x2c2274(0xe9)]((_0x559ec1,_0x1697fd)=>{const _0x24cb1a=_0x2c2274,_0x1c7d89=_0x1697fd===_0x19c8fe,_0x467907=_0x1c7d89?'\x20\x20\x20\x20\x20\x20>\x20'+_0x559ec1['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x559ec1[_0x24cb1a(0xdd)];return a2_0xd8dedf(Box,{'children':a2_0xd8dedf(Text,{'color':_0x1c7d89?_0x24cb1a(0xdc):undefined,'children':_0x467907})},_0x467907);})]});}
1
+ function a2_0x29e9(){const _0x130c37=['931133FTeobJ','filter','column','正在加载页面模板...','map','name','return','20798ffPybm','\x20\x20\x20\x20\x20\x20\x20\x20','3163110zqHFgo','9aqalbS','6028760rzRODM','279BFfBPs','localeCompare','downArrow','error','48KhtPvn','length','gray','8618630KztUlL','green','../..','1466084OpjeoV','label','join','blank','sort','请选择您要创建的页面模板','upArrow','isDirectory','dirname','47349UFsMtM'];a2_0x29e9=function(){return _0x130c37;};return a2_0x29e9();}function a2_0x3fe5(_0xf171fe,_0x5a3c9f){_0xf171fe=_0xf171fe-0x185;const _0x29e974=a2_0x29e9();let _0x3fe503=_0x29e974[_0xf171fe];return _0x3fe503;}(function(_0x2084a9,_0x199954){const _0x3ac2bf=a2_0x3fe5,_0x5d1982=_0x2084a9();while(!![]){try{const _0x54262f=-parseInt(_0x3ac2bf(0x197))/0x1+parseInt(_0x3ac2bf(0x19f))/0x2*(-parseInt(_0x3ac2bf(0x1a4))/0x3)+parseInt(_0x3ac2bf(0x18e))/0x4+parseInt(_0x3ac2bf(0x1a1))/0x5+parseInt(_0x3ac2bf(0x188))/0x6*(-parseInt(_0x3ac2bf(0x198))/0x7)+parseInt(_0x3ac2bf(0x1a3))/0x8+parseInt(_0x3ac2bf(0x1a2))/0x9*(parseInt(_0x3ac2bf(0x18b))/0xa);if(_0x54262f===_0x199954)break;else _0x5d1982['push'](_0x5d1982['shift']());}catch(_0x278e72){_0x5d1982['push'](_0x5d1982['shift']());}}}(a2_0x29e9,0x82db9));import{jsx as a2_0x28c5a4,jsxs as a2_0x183bb5}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x10853e from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x364bbe=a2_0x3fe5;try{const _0x1f26b5=fileURLToPath(import.meta.url),_0x2a8a82=a2_0x10853e['resolve'](a2_0x10853e[_0x364bbe(0x196)](_0x1f26b5),_0x364bbe(0x18d)),_0xccf67=a2_0x10853e[_0x364bbe(0x190)](_0x2a8a82,'templates/pages'),_0x2989e6=await readdir(_0xccf67,{'withFileTypes':!![]}),_0x1e0a1b=_0x2989e6[_0x364bbe(0x199)](_0x1fb736=>_0x1fb736[_0x364bbe(0x195)]())[_0x364bbe(0x19c)](_0x334ec4=>({'label':_0x334ec4[_0x364bbe(0x19d)]}))[_0x364bbe(0x192)]((_0x16c245,_0x642df9)=>_0x16c245[_0x364bbe(0x18f)][_0x364bbe(0x185)](_0x642df9[_0x364bbe(0x18f)]));return _0x1e0a1b;}catch(_0x2cc686){return console[_0x364bbe(0x187)]('获取模板列表失败:',_0x2cc686),[{'label':_0x364bbe(0x191)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x5fb0a5){const _0x251065=a2_0x3fe5,[_0xaa6663,_0x5aed21]=useState(0x0),[_0x3e129c,_0x55ec]=useState([]),[_0x321b66,_0x1b3e31]=useState(!![]);useEffect(()=>{async function _0x37f1b7(){const _0x2e7e19=await getTemplateList();_0x55ec(_0x2e7e19),_0x1b3e31(![]);}_0x37f1b7();},[]),useInput((_0x3cbe5c,_0x1a66ab)=>{const _0x443dcf=a2_0x3fe5;if(_0x321b66)return;if(_0x1a66ab[_0x443dcf(0x19e)]){const _0x4cae19=_0x3e129c[_0xaa6663];_0x4cae19&&_0x5fb0a5['onSelect'](_0x4cae19['label']);}_0x1a66ab[_0x443dcf(0x194)]&&_0x5aed21(_0x424dbf=>_0x424dbf===0x0?_0x3e129c[_0x443dcf(0x189)]-0x1:_0x424dbf-0x1),_0x1a66ab[_0x443dcf(0x186)]&&_0x5aed21(_0x2ad9b9=>_0x2ad9b9===_0x3e129c[_0x443dcf(0x189)]-0x1?0x0:_0x2ad9b9+0x1);});if(_0x321b66)return a2_0x28c5a4(Box,{'flexDirection':_0x251065(0x19a),'paddingY':0x1,'children':a2_0x183bb5(Box,{'children':[a2_0x28c5a4(Text,{'color':_0x251065(0x18a),'children':'\x20Step1:\x20'}),a2_0x28c5a4(Text,{'children':_0x251065(0x19b)})]})});return a2_0x183bb5(Box,{'flexDirection':_0x251065(0x19a),'paddingY':0x1,'children':[a2_0x183bb5(Box,{'children':[a2_0x28c5a4(Text,{'color':_0x251065(0x18a),'children':'\x20Step1:\x20'}),a2_0x28c5a4(Text,{'children':_0x251065(0x193)})]}),_0x3e129c['map']((_0x43ae8a,_0x3a3523)=>{const _0x233d96=_0x251065,_0x588eb1=_0x3a3523===_0xaa6663,_0x1ec49b=_0x588eb1?'\x20\x20\x20\x20\x20\x20>\x20'+_0x43ae8a[_0x233d96(0x18f)]:_0x233d96(0x1a0)+_0x43ae8a[_0x233d96(0x18f)];return a2_0x28c5a4(Box,{'children':a2_0x28c5a4(Text,{'color':_0x588eb1?_0x233d96(0x18c):undefined,'children':_0x1ec49b})},_0x1ec49b);})]});}
@@ -0,0 +1 @@
1
+ const a3_0x54c73e=a3_0x21ff;function a3_0x21ff(_0xd7cc77,_0x32c32a){_0xd7cc77=_0xd7cc77-0x82;const _0x1530dd=a3_0x1530();let _0x21ff58=_0x1530dd[_0xd7cc77];return _0x21ff58;}(function(_0x4125fe,_0x39d051){const _0x300414=a3_0x21ff,_0x5de6af=_0x4125fe();while(!![]){try{const _0x5b62c0=-parseInt(_0x300414(0x94))/0x1+-parseInt(_0x300414(0x8b))/0x2*(-parseInt(_0x300414(0x9a))/0x3)+parseInt(_0x300414(0x93))/0x4+-parseInt(_0x300414(0x9b))/0x5*(parseInt(_0x300414(0xb2))/0x6)+-parseInt(_0x300414(0xbe))/0x7*(-parseInt(_0x300414(0x96))/0x8)+-parseInt(_0x300414(0xaa))/0x9+-parseInt(_0x300414(0xb3))/0xa*(parseInt(_0x300414(0x84))/0xb);if(_0x5b62c0===_0x39d051)break;else _0x5de6af['push'](_0x5de6af['shift']());}catch(_0xfd2660){_0x5de6af['push'](_0x5de6af['shift']());}}}(a3_0x1530,0x8af07));import{jsx as a3_0x534d59,jsxs as a3_0x153b79}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=['cursor',a3_0x54c73e(0x92)],SKILL_IDE_LIST=[a3_0x54c73e(0x91),a3_0x54c73e(0x92),a3_0x54c73e(0x8d),a3_0x54c73e(0xbf),'cursor','opencode',a3_0x54c73e(0xa6),a3_0x54c73e(0x89),'windsurf',a3_0x54c73e(0xa0)];export function AISetupUI({config:_0x3fb68c,onComplete:_0x5b196c}){const _0x1cce76=a3_0x54c73e,{exit:_0x420db6}=useApp(),[_0x56920a,_0x4b37ca]=useState(_0x1cce76(0xab)),[_0x1b7d04,_0x56dd08]=useState(0x0),[_0x3eb524,_0xeed122]=useState(new Set([0x0,0x1])),[_0x1f3f83,_0x131a38]=useState(new Set(SKILL_IDE_LIST[_0x1cce76(0xb7)]((_0x3a48b5,_0x2943dd)=>_0x2943dd))),[_0x116939,_0x183469]=useState('');useEffect(()=>{!_0x3fb68c['appcode']&&_0x5b196c({'mcpResults':[],'skillResults':[]});},[_0x3fb68c[_0x1cce76(0xac)],_0x5b196c]),useInput((_0x4353a1,_0x3b16bd)=>{const _0x3fb264=_0x1cce76;if(_0x56920a==='confirming'){if(_0x4353a1==='y'||_0x4353a1==='Y'||_0x3b16bd[_0x3fb264(0xa4)]){_0x139558();return;}if(_0x4353a1==='n'||_0x4353a1==='N'){_0x5b196c({'mcpResults':[],'skillResults':[]});return;}if(_0x3b16bd[_0x3fb264(0xa4)]){_0x139558();return;}}if(_0x56920a==='selecting'){if(_0x3b16bd['upArrow']){_0x56dd08(_0x3a46e4=>_0x3a46e4>0x0?_0x3a46e4-0x1:SKILL_IDE_LIST[_0x3fb264(0xb9)]-0x1);return;}if(_0x3b16bd['downArrow']){_0x56dd08(_0x2a3092=>_0x2a3092<SKILL_IDE_LIST[_0x3fb264(0xb9)]-0x1?_0x2a3092+0x1:0x0);return;}if(_0x4353a1==='\x20'){const _0x3231a4=_0x1b7d04<MCP_IDE_LIST['length'];if(_0x3231a4){const _0x2dd96d=new Set(_0x3eb524);_0x2dd96d['has'](_0x1b7d04)?_0x2dd96d[_0x3fb264(0xbd)](_0x1b7d04):_0x2dd96d[_0x3fb264(0xbb)](_0x1b7d04),_0xeed122(_0x2dd96d);}else{const _0x3c220e=_0x1b7d04-MCP_IDE_LIST[_0x3fb264(0xb9)],_0x537a55=new Set(_0x1f3f83);_0x537a55['has'](_0x3c220e)?_0x537a55[_0x3fb264(0xbd)](_0x3c220e):_0x537a55[_0x3fb264(0xbb)](_0x3c220e),_0x131a38(_0x537a55);}return;}if(_0x4353a1==='a'||_0x4353a1==='A'){_0xeed122(new Set(MCP_IDE_LIST[_0x3fb264(0xb7)]((_0x4c7e8b,_0x2fc7b4)=>_0x2fc7b4))),_0x131a38(new Set(SKILL_IDE_LIST[_0x3fb264(0xb7)]((_0x3b66f5,_0x460289)=>_0x460289)));return;}if(_0x4353a1==='q'||_0x4353a1==='Q'){_0x420db6();return;}if(_0x3b16bd[_0x3fb264(0xa4)]){if(_0x3eb524[_0x3fb264(0x8f)]===0x0&&_0x1f3f83[_0x3fb264(0x8f)]===0x0){_0x183469('请至少选择一个配置项');return;}_0x139558();return;}}if(_0x56920a===_0x3fb264(0xa5)){_0x420db6();return;}});async function _0x139558(){const _0x10ab0c=_0x1cce76;_0x4b37ca(_0x10ab0c(0x87));const _0x3c13fe=[],_0xd4663c=[];for(const _0x19f4b5 of _0x3eb524){const _0x13a963=MCP_IDE_LIST[_0x19f4b5];if(!_0x13a963)continue;try{const _0x4f34cf=await configureMcp(_0x13a963,_0x3fb68c[_0x10ab0c(0x83)]);_0x3c13fe['push'](_0x4f34cf);}catch(_0x1fbd78){_0x3c13fe[_0x10ab0c(0xb0)]({'ide':MCP_IDE_CONFIGS[_0x13a963]?.[_0x10ab0c(0x85)]||_0x13a963,'status':_0x10ab0c(0x9c),'message':_0x1fbd78 instanceof Error?_0x1fbd78[_0x10ab0c(0xa7)]:String(_0x1fbd78)});}}await copySharedSkills(_0x3fb68c[_0x10ab0c(0x83)]);for(const _0x6a4a78 of _0x1f3f83){const _0x3be573=SKILL_IDE_LIST[_0x6a4a78];if(!_0x3be573)continue;try{const _0x4ecc7c=await installSkill(_0x3be573,_0x3fb68c['projectRoot']);_0xd4663c['push'](_0x4ecc7c);}catch(_0x256b85){_0xd4663c[_0x10ab0c(0xb0)]({'ide':SKILL_IDE_CONFIGS[_0x3be573]?.[_0x10ab0c(0x85)]||_0x3be573,'status':_0x10ab0c(0x9c),'message':_0x256b85 instanceof Error?_0x256b85['message']:String(_0x256b85)});}}if(_0xd4663c[_0x10ab0c(0xb9)]>0x0){const _0x39ef2d=_0xd4663c[_0x10ab0c(0x86)](_0x1c315e=>_0x1c315e[_0x10ab0c(0xb1)]===_0x10ab0c(0x95))['map'](_0x2601ff=>_0x2601ff[_0x10ab0c(0x8c)]);_0x39ef2d[_0x10ab0c(0xb9)]>0x0&&createSkillManifest(_0x3fb68c[_0x10ab0c(0x83)],_0x39ef2d);}_0x4b37ca(_0x10ab0c(0xa5)),setTimeout(()=>{_0x5b196c({'mcpResults':_0x3c13fe,'skillResults':_0xd4663c});},0xbb8);}if(_0x56920a===_0x1cce76(0xab))return a3_0x153b79(Box,{'flexDirection':_0x1cce76(0xaf),'marginTop':0x1,'children':[a3_0x534d59(Box,{'children':a3_0x534d59(Text,{'color':_0x1cce76(0xb4),'bold':!![],'children':_0x1cce76(0x99)})}),a3_0x534d59(Box,{'marginTop':0x1,'children':a3_0x534d59(Text,{'color':'white','children':_0x1cce76(0xb6)})}),a3_0x534d59(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x534d59(Text,{'color':_0x1cce76(0xba),'children':_0x1cce76(0x88)})}),a3_0x534d59(Box,{'marginLeft':0x2,'children':a3_0x534d59(Text,{'color':_0x1cce76(0xba),'children':_0x1cce76(0xa8)})}),a3_0x153b79(Box,{'marginTop':0x1,'flexDirection':_0x1cce76(0xaf),'children':[a3_0x534d59(Box,{'children':a3_0x534d59(Text,{'color':_0x1cce76(0xb8),'children':_0x1cce76(0x90)})}),a3_0x534d59(Box,{'children':a3_0x534d59(Text,{'color':'gray','children':_0x1cce76(0x8e)})}),a3_0x534d59(Box,{'children':a3_0x534d59(Text,{'color':_0x1cce76(0xad),'children':_0x1cce76(0xb5)})})]}),_0x116939&&a3_0x534d59(Box,{'marginTop':0x1,'children':a3_0x153b79(Text,{'color':'red','children':['✗\x20',_0x116939]})})]});if(_0x56920a==='selecting')return a3_0x153b79(Box,{'flexDirection':_0x1cce76(0xaf),'marginTop':0x1,'children':[a3_0x534d59(Box,{'children':a3_0x534d59(Text,{'color':_0x1cce76(0xae),'bold':!![],'children':_0x1cce76(0x98)})}),_0x116939&&a3_0x534d59(Box,{'marginTop':0x1,'children':a3_0x153b79(Text,{'color':_0x1cce76(0x8a),'children':['✗\x20',_0x116939]})}),a3_0x153b79(Box,{'marginTop':0x1,'flexDirection':_0x1cce76(0xaf),'children':[a3_0x534d59(Text,{'bold':!![],'color':_0x1cce76(0xb4),'children':_0x1cce76(0x97)}),MCP_IDE_LIST[_0x1cce76(0xb7)]((_0x34ce9f,_0x248202)=>{const _0x37782f=_0x1cce76,_0x547f90=_0x1b7d04===_0x248202,_0x146329=_0x3eb524[_0x37782f(0x9f)](_0x248202);return a3_0x534d59(Box,{'children':a3_0x153b79(Text,{'backgroundColor':_0x547f90?'blue':undefined,'color':_0x547f90?'white':undefined,'children':[_0x146329?'[✓]':_0x37782f(0x9d),'\x20',_0x34ce9f==='cursor'?_0x37782f(0xa2):_0x37782f(0x9e)]})},'mcp-'+_0x34ce9f);}),a3_0x534d59(Box,{'marginTop':0x1,'children':a3_0x534d59(Text,{'bold':!![],'color':'yellow','children':_0x1cce76(0xa9)})}),SKILL_IDE_LIST[_0x1cce76(0xb7)]((_0x53c424,_0x140787)=>{const _0x2bae11=_0x1cce76,_0x519693=_0x140787+MCP_IDE_LIST[_0x2bae11(0xb9)],_0x2fbf7c=_0x1b7d04===_0x519693,_0x5474db=_0x1f3f83[_0x2bae11(0x9f)](_0x519693);return a3_0x534d59(Box,{'children':a3_0x153b79(Text,{'backgroundColor':_0x2fbf7c?_0x2bae11(0xbc):undefined,'color':_0x2fbf7c?_0x2bae11(0x82):undefined,'children':[_0x5474db?_0x2bae11(0xa3):_0x2bae11(0x9d),'\x20',SKILL_IDE_CONFIGS[_0x53c424]['name']]})},'skill-'+_0x53c424);}),a3_0x534d59(Box,{'marginTop':0x1,'children':a3_0x534d59(Text,{'color':'gray','children':_0x1cce76(0xa1)})})]})]});if(_0x56920a===_0x1cce76(0x87))return a3_0x534d59(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x534d59(Box,{'children':a3_0x534d59(Text,{'children':'正在配置\x20AI\x20助手...'})})});if(_0x56920a==='done')return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x54c73e(0xa2)},'claude':{'name':a3_0x54c73e(0x9e)}};function a3_0x1530(){const _0x317fc9=['add','blue','delete','42CEevvW','codex','white','projectRoot','8698855LbFVgE','name','filter','installing','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','trae','red','1486614YcidrL','ide','codebuddy','[N]\x20跳过,稍后手动配置','size','[Y]\x20是,配置\x20AI\x20助手','antigravity','claude','3878576KOuYYW','852042KvLHVc','success','1186808RblUDB','MCP\x20服务器\x20(AI\x20访问数据集)','*\x20选择要配置的\x20IDE:','⭐\x20配置\x20AI\x20助手\x20(研发效率提升\x2010x)','3RiTmgw','10xlDhJQ','error','[\x20]','Claude\x20Code','has','agent','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','Cursor','[✓]','return','done','qoder','message','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','技能包\x20(研发规范指南)','894393dKbHuk','confirming','appcode','dimColor','cyan','column','push','status','875214pixQyF','10KQwpIJ','yellow','Enter\x20默认:\x20是','是否同时配置\x20AI\x20助手?这将:','map','green','length','gray'];a3_0x1530=function(){return _0x317fc9;};return a3_0x1530();}
@@ -0,0 +1 @@
1
+ const a4_0x20870d=a4_0x3324;(function(_0x47d2ca,_0xbfd19c){const _0x2fd047=a4_0x3324,_0x5e3330=_0x47d2ca();while(!![]){try{const _0x262d4d=-parseInt(_0x2fd047(0xb5))/0x1+parseInt(_0x2fd047(0xcd))/0x2*(-parseInt(_0x2fd047(0xf2))/0x3)+-parseInt(_0x2fd047(0x105))/0x4*(parseInt(_0x2fd047(0xb3))/0x5)+-parseInt(_0x2fd047(0xd4))/0x6+parseInt(_0x2fd047(0xdf))/0x7*(-parseInt(_0x2fd047(0xaf))/0x8)+-parseInt(_0x2fd047(0x109))/0x9+parseInt(_0x2fd047(0x100))/0xa;if(_0x262d4d===_0xbfd19c)break;else _0x5e3330['push'](_0x5e3330['shift']());}catch(_0xfcd45a){_0x5e3330['push'](_0x5e3330['shift']());}}}(a4_0x1f2d,0x5699e));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';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a4_0x20870d(0xdd),MCP_ARGS=[a4_0x20870d(0xae)];export function buildEnvConfig(_0x39b413,_0x216674){const _0x595ab2=a4_0x20870d,_0x299394={'LOVRABET_APP_CODE':String(_0x39b413)};return _0x216674!==_0x595ab2(0xe1)&&(_0x299394[_0x595ab2(0xd5)]=String(_0x216674)),_0x299394;}function a4_0x1f2d(){const _0x47ed91=['Claude\x20Code\x20MCP\x20命令已生成','.shared','\x20\x20\x20\x20}','rules','CodeBuddy\x20IDE','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','isDirectory','node:fs','message','.cursor','24053460yRNrpE','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','success','mcpServers','name','24BKTjxU','info','模板不存在:\x20','Cursor\x20MCP\x20配置失败','2395665uaxyAa','.claude','../../templates/rules/lovrabet_rules.mdc.tpl','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','claude\x20mcp\x20add\x20','claude','log','map','共享技能文件复制失败','@lovrabet/dataset-mcp-server@latest','35416LmoofA','Claude\x20Code','\x20\x20\x20\x20\x20\x20}','已复制\x20','435135LHenYx','\x20技能包安装失败','411218cqdyuk','OpenCode','Cursor\x20MCP\x20配置成功','app','Windsurf\x20IDE','utf-8','cursor','.agent','appcode','Codex','.opencode','请手动执行:\x20','Antigravity\x20IDE','Trae\x20IDE','\x20\x20环境:\x20','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','OpenCode\x20IDE','Trae','创建技能包\x20manifest','2.0.0','manual','stringify','error','object','18586TVHCWT','复制\x20Cursor\x20Rules\x20文件失败','Cursor','\x20-e\x20LOVRABET_ENV=','Qoder\x20IDE','lovrabet_rules.mdc','.lovrabet','384276tKOjSV','LOVRABET_ENV','\x20技能包安装成功','mcp-install','需要先配置\x20appcode','.codebuddy','Cursor\x20IDE','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','env','npx','共享技能文件复制成功','833CCbPfS','其他\x20IDE','online','warn','\x20\x20}','创建\x20agents.md\x20文件','.qoder','skill-install','Qoder','parse','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','配置指引已显示','其他\x20IDE\x20配置指引已显示','../../templates/skills','不支持的\x20MCP\x20IDE:\x20','.trae','已写入\x20.cursor/mcp.json','folders','\x20-e\x20LOVRABET_APP_CODE=','84fMNgLa','join','cwd','通用模板'];a4_0x1f2d=function(){return _0x47ed91;};return a4_0x1f2d();}export async function configureCursorMcp(_0x55104b){const _0xfad9b3=a4_0x20870d,_0x51e823=_0x55104b||process[_0xfad9b3(0xf4)](),_0x57ab4c=readConfig(_0x51e823),_0xee81bd=_0x57ab4c[_0xfad9b3(0xbd)]||_0x57ab4c['app'],_0x40bb45=_0x57ab4c[_0xfad9b3(0xdc)]||_0xfad9b3(0xe1);if(!_0xee81bd)return{'ide':_0xfad9b3(0xcf),'status':_0xfad9b3(0xcb),'message':_0xfad9b3(0xd8)};const _0x2235b9=buildEnvConfig(_0xee81bd,_0x40bb45),_0x39baf6={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x2235b9},_0x489768=join(_0x51e823,_0xfad9b3(0xff),'mcp.json'),_0x56caa4=join(_0x51e823,_0xfad9b3(0xff));try{!existsSync(_0x56caa4)&&mkdirSync(_0x56caa4,{'recursive':!![]});let _0x212643={'mcpServers':{}};if(existsSync(_0x489768)){const _0x1f796f=readFileSync(_0x489768,_0xfad9b3(0xba));_0x212643=JSON[_0xfad9b3(0xe8)](_0x1f796f);}return(!_0x212643[_0xfad9b3(0x103)]||typeof _0x212643['mcpServers']!==_0xfad9b3(0xcc))&&(_0x212643[_0xfad9b3(0x103)]={}),_0x212643[_0xfad9b3(0x103)][MCP_SERVER_NAME]=_0x39baf6,writeFileSync(_0x489768,JSON[_0xfad9b3(0xca)](_0x212643,null,0x2),_0xfad9b3(0xba)),logger[_0xfad9b3(0x106)](_0xfad9b3(0xd7),_0xfad9b3(0xb7),{'appcode':_0xee81bd,'env':_0x40bb45,'path':_0x489768}),await copyCursorRules(_0x56caa4),{'ide':'Cursor','status':_0xfad9b3(0x102),'message':_0xfad9b3(0xef)};}catch(_0x5c7578){return logger[_0xfad9b3(0xcb)](_0xfad9b3(0xd7),_0xfad9b3(0x108),{'error':_0x5c7578 instanceof Error?_0x5c7578[_0xfad9b3(0xfe)]:String(_0x5c7578)}),{'ide':_0xfad9b3(0xcf),'status':_0xfad9b3(0xcb),'message':_0x5c7578 instanceof Error?_0x5c7578[_0xfad9b3(0xfe)]:String(_0x5c7578)};}}export async function configureClaudeMcp(_0x2c9662){const _0x4f13c2=a4_0x20870d,_0x460851=_0x2c9662||process[_0x4f13c2(0xf4)](),_0x52ae3d=readConfig(_0x460851),_0x44d381=_0x52ae3d[_0x4f13c2(0xbd)]||_0x52ae3d[_0x4f13c2(0xb8)],_0x1efee2=_0x52ae3d[_0x4f13c2(0xdc)]||'online';if(!_0x44d381)return{'ide':'Claude\x20Code','status':_0x4f13c2(0xcb),'message':_0x4f13c2(0xd8)};let _0x2b691f=_0x4f13c2(0x10d)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x4f13c2(0xf3)]('\x20')+_0x4f13c2(0xf1)+_0x44d381;return _0x1efee2!=='online'&&(_0x2b691f+=_0x4f13c2(0xd0)+_0x1efee2),await copyAgentsMd(_0x460851),logger['info']('mcp-install',_0x4f13c2(0xf6),{'command':_0x2b691f,'appcode':_0x44d381,'env':_0x1efee2}),console[_0x4f13c2(0x10f)](_0x4f13c2(0xe9)),console['log']('\x20\x20'+_0x2b691f+'\x0a'),console[_0x4f13c2(0x10f)]('配置信息:'),console[_0x4f13c2(0x10f)]('\x20\x20AppCode:\x20'+_0x44d381),_0x1efee2!==_0x4f13c2(0xe1)&&console[_0x4f13c2(0x10f)](_0x4f13c2(0xc3)+_0x1efee2),console[_0x4f13c2(0x10f)](_0x4f13c2(0xdb)),{'ide':_0x4f13c2(0xb0),'status':_0x4f13c2(0xc9),'message':_0x4f13c2(0xc0)+_0x2b691f};}export async function showOtherGuide(_0x3ae86f){const _0x11aadb=a4_0x20870d,_0x8cff49=_0x3ae86f||process[_0x11aadb(0xf4)](),_0x594165=readConfig(_0x8cff49),_0x29980b=_0x594165['appcode']||_0x594165[_0x11aadb(0xb8)],_0x2f398e=_0x594165['env']||'online';if(!_0x29980b)return{'ide':'其他','status':_0x11aadb(0xcb),'message':_0x11aadb(0xd8)};return console[_0x11aadb(0x10f)](_0x11aadb(0x10c)),console[_0x11aadb(0x10f)]('{'),console['log']('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x11aadb(0x10f)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+'\x22:\x20{'),console['log'](_0x11aadb(0xc4)+MCP_COMMAND+'\x22,'),console[_0x11aadb(0x10f)]('\x20\x20\x20\x20\x20\x20\x22args\x22:\x20['+MCP_ARGS[_0x11aadb(0x110)](_0x3c3d25=>'\x22'+_0x3c3d25+'\x22')[_0x11aadb(0xf3)](',\x20')+'],'),console[_0x11aadb(0x10f)]('\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{'),console[_0x11aadb(0x10f)](_0x11aadb(0xfb)+_0x29980b+'\x22,'),_0x2f398e!==_0x11aadb(0xe1)&&console[_0x11aadb(0x10f)](_0x11aadb(0x101)+_0x2f398e+'\x22,'),console[_0x11aadb(0x10f)](_0x11aadb(0xb1)),console[_0x11aadb(0x10f)](_0x11aadb(0xf8)),console['log'](_0x11aadb(0xe3)),console[_0x11aadb(0x10f)]('}\x0a'),logger[_0x11aadb(0x106)]('mcp-install',_0x11aadb(0xeb),{'appcode':_0x29980b,'env':_0x2f398e}),{'ide':'其他','status':'manual','message':_0x11aadb(0xea)};}export async function configureMcp(_0x315ef4,_0x4c3c41){const _0x6a9a76=a4_0x20870d;switch(_0x315ef4){case _0x6a9a76(0xbb):return await configureCursorMcp(_0x4c3c41);case _0x6a9a76(0x10e):return await configureClaudeMcp(_0x4c3c41);default:throw new Error(_0x6a9a76(0xed)+_0x315ef4);}}function a4_0x3324(_0x6459fe,_0x18b3f9){_0x6459fe=_0x6459fe-0xad;const _0x1f2dfb=a4_0x1f2d();let _0x33244b=_0x1f2dfb[_0x6459fe];return _0x33244b;}async function copyCursorRules(_0x5888f6){const _0x3f9e70=a4_0x20870d,_0x251f91=join(_0x5888f6,_0x3f9e70(0xf9)),_0x146e3c=join(_0x251f91,_0x3f9e70(0xd2));if(existsSync(_0x146e3c))return;try{!existsSync(_0x251f91)&&mkdirSync(_0x251f91,{'recursive':!![]});const _0x166186=resolve(__dirname,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x166186)&&(copyFileSync(_0x166186,_0x146e3c),logger[_0x3f9e70(0x106)]('mcp-install','创建\x20Cursor\x20Rules\x20文件',{'from':_0x166186,'to':_0x146e3c}));}catch(_0x301349){logger[_0x3f9e70(0xcb)](_0x3f9e70(0xd7),_0x3f9e70(0xce),{'error':_0x301349 instanceof Error?_0x301349[_0x3f9e70(0xfe)]:String(_0x301349)});}}async function copyAgentsMd(_0x32897d){const _0x322697=a4_0x20870d,_0x2e71b3=join(_0x32897d,'agents.md');if(existsSync(_0x2e71b3))return;try{const _0x17c56c=resolve(__dirname,_0x322697(0x10b));if(existsSync(_0x17c56c)){const _0x5efcf4=readFileSync(_0x17c56c,_0x322697(0xba));writeFileSync(_0x2e71b3,_0x5efcf4,_0x322697(0xba)),logger[_0x322697(0x106)](_0x322697(0xd7),_0x322697(0xe4),{'from':_0x17c56c,'to':_0x2e71b3});}}catch(_0x6f2573){logger[_0x322697(0xcb)]('mcp-install','复制\x20agents.md\x20文件失败',{'error':_0x6f2573 instanceof Error?_0x6f2573[_0x322697(0xfe)]:String(_0x6f2573)});}}export const SKILL_IDE_CONFIGS={'cursor':{'name':a4_0x20870d(0xcf),'description':a4_0x20870d(0xda),'folders':['.cursorrules',a4_0x20870d(0xff)]},'windsurf':{'name':'Windsurf','description':a4_0x20870d(0xb9),'folders':['.windsurf']},'claude':{'name':a4_0x20870d(0xb0),'description':'Claude\x20Code','folders':[a4_0x20870d(0x10a)]},'codex':{'name':a4_0x20870d(0xbe),'description':'Codex\x20IDE','folders':['.codex']},'opencode':{'name':a4_0x20870d(0xb6),'description':a4_0x20870d(0xc5),'folders':[a4_0x20870d(0xbf)]},'qoder':{'name':a4_0x20870d(0xe7),'description':a4_0x20870d(0xd1),'folders':[a4_0x20870d(0xe5)]},'codebuddy':{'name':'CodeBuddy','description':a4_0x20870d(0xfa),'folders':[a4_0x20870d(0xd9)]},'trae':{'name':a4_0x20870d(0xc6),'description':a4_0x20870d(0xc2),'folders':[a4_0x20870d(0xee)]},'antigravity':{'name':'Antigravity','description':a4_0x20870d(0xc1),'folders':[a4_0x20870d(0xbc)]},'agent':{'name':a4_0x20870d(0xf5),'description':a4_0x20870d(0xe0),'folders':[a4_0x20870d(0xbc)]}};async function copyDir(_0x103db1,_0x228ff5){const _0x34bb96=a4_0x20870d,{statSync:_0x2b4126}=await import(_0x34bb96(0xfd)),{readdirSync:_0x5b062a}=await import(_0x34bb96(0xfd)),_0x10c9fb=_0x2b4126(_0x103db1);if(_0x10c9fb[_0x34bb96(0xfc)]()){!existsSync(_0x228ff5)&&mkdirSync(_0x228ff5,{'recursive':!![]});const _0x112f72=_0x5b062a(_0x103db1);for(const _0x4a347c of _0x112f72){await copyDir(join(_0x103db1,_0x4a347c),join(_0x228ff5,_0x4a347c));}}else copyFileSync(_0x103db1,_0x228ff5);}export async function installSkill(_0x10ba92,_0x41d50e){const _0x52b384=a4_0x20870d,_0x3b41ae=_0x41d50e||process[_0x52b384(0xf4)](),_0x4e07bf=resolve(__dirname,_0x52b384(0xec)),_0x5839fc=_0x10ba92==='agent',_0x545876=SKILL_IDE_CONFIGS[_0x10ba92],_0x525ac6=_0x5839fc?'通用模板':_0x545876[_0x52b384(0x104)];try{let _0x2db5d6=0x0;const _0x3d908b=_0x5839fc?[_0x52b384(0xbc)]:_0x545876[_0x52b384(0xf0)];for(const _0x2df366 of _0x3d908b){const _0x47f807=join(_0x4e07bf,_0x2df366),_0xb16104=join(_0x3b41ae,_0x2df366);if(!existsSync(_0x47f807)){logger[_0x52b384(0xe2)](_0x52b384(0xe6),_0x52b384(0x107)+_0x47f807);continue;}await copyDir(_0x47f807,_0xb16104),_0x2db5d6++;}return logger['info'](_0x52b384(0xe6),_0x525ac6+_0x52b384(0xd6),{'ide':_0x10ba92,'foldersCount':_0x2db5d6}),{'ide':_0x525ac6,'status':_0x52b384(0x102),'message':_0x52b384(0xb2)+_0x2db5d6+'\x20个目录'};}catch(_0x191b0b){return logger[_0x52b384(0xcb)](_0x52b384(0xe6),_0x525ac6+_0x52b384(0xb4),{'error':_0x191b0b instanceof Error?_0x191b0b['message']:String(_0x191b0b)}),{'ide':_0x525ac6,'status':_0x52b384(0xcb),'message':_0x191b0b instanceof Error?_0x191b0b[_0x52b384(0xfe)]:String(_0x191b0b)};}}export async function copySharedSkills(_0x13c7e6){const _0x162402=a4_0x20870d,_0x1e097d=_0x13c7e6||process['cwd'](),_0x12aa96=resolve(__dirname,_0x162402(0xec)),_0x4b3258=join(_0x12aa96,_0x162402(0xf7)),_0x40abc4=join(_0x1e097d,'.lovrabet/skill/.shared');if(!existsSync(_0x4b3258))return![];try{return await copyDir(_0x4b3258,_0x40abc4),logger[_0x162402(0x106)](_0x162402(0xe6),_0x162402(0xde),{'path':_0x40abc4}),!![];}catch(_0x58835f){return logger[_0x162402(0xcb)](_0x162402(0xe6),_0x162402(0xad),{'error':_0x58835f instanceof Error?_0x58835f[_0x162402(0xfe)]:String(_0x58835f)}),![];}}export function createSkillManifest(_0x1125bc,_0x2a5727){const _0xa46cc4=a4_0x20870d,_0x28cd97={'version':_0xa46cc4(0xc8),'installedAt':new Date()['toISOString'](),'platforms':_0x2a5727},_0xca58e9=join(_0x1125bc,'.lovrabet/skill-manifest.json'),_0x1fb50e=join(_0x1125bc,_0xa46cc4(0xd3));!existsSync(_0x1fb50e)&&mkdirSync(_0x1fb50e,{'recursive':!![]}),writeFileSync(_0xca58e9,JSON['stringify'](_0x28cd97,null,0x2),'utf-8'),logger['info'](_0xa46cc4(0xe6),_0xa46cc4(0xc7),{'path':_0xca58e9});}
@@ -1 +1 @@
1
- (function(_0x362ab4,_0x66b0e9){const _0x26a547=a3_0x3380,_0x5d24c7=_0x362ab4();while(!![]){try{const _0x54e893=-parseInt(_0x26a547(0x19a))/0x1*(-parseInt(_0x26a547(0x1a1))/0x2)+-parseInt(_0x26a547(0x1b3))/0x3+parseInt(_0x26a547(0x191))/0x4*(parseInt(_0x26a547(0x194))/0x5)+parseInt(_0x26a547(0x1a7))/0x6+parseInt(_0x26a547(0x1a3))/0x7+parseInt(_0x26a547(0x1ae))/0x8*(parseInt(_0x26a547(0x1ad))/0x9)+-parseInt(_0x26a547(0x1c0))/0xa;if(_0x54e893===_0x66b0e9)break;else _0x5d24c7['push'](_0x5d24c7['shift']());}catch(_0x2ebc48){_0x5d24c7['push'](_0x5d24c7['shift']());}}}(a3_0x3ec5,0x22daf));function a3_0x3ec5(){const _0x19630f=['💡\x20请使用\x20','\x20(环境:\x20','column','\x20重新登录后再试','52coRJJE','\x20-\x20','891786XmRclw','*\x20生成的文档文件:','red','api-doc','653148KLwEBj','log','length','\x1b[0m','指定的数据集代码都不存在:\x20','\x20个匹配的数据集\x1b[0m','9HWdDsn','80048yCkQAr','⚠️\x20以下数据集生成失败:','\x20个数据集中筛选出\x20','map','\x1b[90m*\x20从\x20','342768ZGIlny','gray','message','green','error','\x20个数据集','filter','正在获取数据集列表...','cyan','includes','.md\x20(','white','使用指定的应用AppCode:\x20','4373140fEBakm','yellow','正在生成\x20','join','dim','lovrabet\x20auth','setLogPath','12JAadtc','未找到任何数据集','env','434965tDVEaJ','./docs',',\x20失败\x20','datasetName','filePath','success','7196iUfJJP','使用配置的应用AppCode:\x20','datasetCode'];a3_0x3ec5=function(){return _0x19630f;};return a3_0x3ec5();}import{jsx as a3_0x311a75,jsxs as a3_0x382f83,Fragment as a3_0x5f3d96}from'react/jsx-runtime';import{useEffect,useState}from'react';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';function a3_0x3380(_0x4bd6f6,_0x31f309){_0x4bd6f6=_0x4bd6f6-0x18e;const _0x3ec5ba=a3_0x3ec5();let _0x33806d=_0x3ec5ba[_0x4bd6f6];return _0x33806d;}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x426e51,env:_0x1733cd,output:_0x3a3fea,extraParams:_0x5a4bb6,datasetCodes:_0x5f3466})=>{const _0x2564ab=a3_0x3380,{exit:_0x2e423d}=useApp(),[_0x5d6e93,_0x2aef52]=useState(![]),[_0xbce765,_0x8b4b25]=useState(''),[_0x401f49,_0x2b0ca0]=useState(![]),[_0x54d2c4,_0x1f40fa]=useState(null),[_0x553d2f,_0x570e1a]=useState(null),[_0x26211c,_0x457a2c]=useState(0x0),_0x52e065=readConfig(),_0x4ec53a=getConfigAppCode(),_0x179374=_0x426e51||_0x4ec53a,_0x38539f=typeof _0x52e065?.[_0x2564ab(0x193)]==='string'?_0x52e065[_0x2564ab(0x193)]:undefined,_0x15affe=_0x1733cd||_0x38539f||'online';initEnv(_0x15affe);const _0x443c40=_0x3a3fea||_0x2564ab(0x195),_0x5206b5=_0x426e51?_0x2564ab(0x1bf)+_0x179374:_0x2564ab(0x19b)+_0x179374;useEffect(()=>{_0x2aef52(!![]),_0xf75901();},[]),useEffect(()=>{(_0x401f49||_0x54d2c4)&&_0x2e423d();},[_0x401f49,_0x54d2c4,_0x2e423d]);async function _0xf75901(){const _0xe5b147=_0x2564ab;if(!_0x179374){_0x1f40fa('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0xe5b147(0x190)](process['cwd']()),_0x8b4b25(_0xe5b147(0x1ba));const {configArray:_0x377d7c}=await fetchModelList(_0x179374);_0x457a2c(_0x377d7c[_0xe5b147(0x1a9)]);if(_0x377d7c[_0xe5b147(0x1a9)]===0x0){_0x1f40fa(_0xe5b147(0x192));return;}let _0x418920=_0x377d7c;if(_0x5f3466&&_0x5f3466[_0xe5b147(0x1a9)]>0x0){_0x418920=_0x377d7c[_0xe5b147(0x1b9)](_0x228e3b=>_0x5f3466[_0xe5b147(0x1bc)](_0x228e3b[_0xe5b147(0x19c)]));const _0x2119fd=_0x418920[_0xe5b147(0x1b1)](_0x3d0c2e=>_0x3d0c2e[_0xe5b147(0x19c)]),_0x265a32=_0x5f3466[_0xe5b147(0x1b9)](_0x2e418f=>!_0x2119fd[_0xe5b147(0x1bc)](_0x2e418f));_0x265a32[_0xe5b147(0x1a9)]>0x0&&console[_0xe5b147(0x1a8)]('\x1b[33m!\x20以下数据集代码不存在:\x20'+_0x265a32[_0xe5b147(0x1c3)](',\x20')+_0xe5b147(0x1aa));if(_0x418920[_0xe5b147(0x1a9)]===0x0){_0x1f40fa(_0xe5b147(0x1ab)+_0x5f3466[_0xe5b147(0x1c3)](',\x20'));return;}console[_0xe5b147(0x1a8)](_0xe5b147(0x1b2)+_0x377d7c[_0xe5b147(0x1a9)]+_0xe5b147(0x1b0)+_0x418920[_0xe5b147(0x1a9)]+_0xe5b147(0x1ac));}_0x8b4b25(_0xe5b147(0x1c2)+_0x418920[_0xe5b147(0x1a9)]+'\x20个数据集的文档...');const _0x499a75=await generateDatasetDocs(_0x418920,_0x179374,_0x443c40,(_0x3721ef,_0x3ca4f4,_0x13b9c4)=>{const _0x252764=_0xe5b147;_0x8b4b25('正在生成\x20'+_0x13b9c4+_0x252764(0x1bd)+_0x3721ef+'/'+_0x3ca4f4+')');},_0x5a4bb6);_0x570e1a(_0x499a75),_0x2b0ca0(!![]);const _0x254f5d=_0x499a75[_0xe5b147(0x1b9)](_0x5d61b7=>_0x5d61b7[_0xe5b147(0x199)])['length'],_0x28661e=_0x499a75[_0xe5b147(0x1b9)](_0x4ad1db=>!_0x4ad1db[_0xe5b147(0x199)])[_0xe5b147(0x1a9)];logger[_0xe5b147(0x199)]('api-doc','文档生成完成',undefined,{'totalCount':_0x499a75['length'],'successCount':_0x254f5d,'failCount':_0x28661e,'outputDir':_0x443c40});}catch(_0x2d4a1b){const _0x10abb1=_0x2d4a1b instanceof Error?_0x2d4a1b[_0xe5b147(0x1b5)]:String(_0x2d4a1b);logger[_0xe5b147(0x1b7)](_0xe5b147(0x1a6),'文档生成失败:\x20'+_0x10abb1,{'appCode':_0x179374,'outputDir':_0x443c40}),_0x1f40fa('文档生成失败:\x20'+_0x10abb1);}finally{_0x2aef52(![]);}}const _0x2bde7a=_0x553d2f?.['filter'](_0x25fa23=>_0x25fa23[_0x2564ab(0x199)])[_0x2564ab(0x1a9)]||0x0,_0x53b3f4=_0x553d2f?.[_0x2564ab(0x1b9)](_0x3415fb=>!_0x3415fb[_0x2564ab(0x199)])['length']||0x0;return a3_0x382f83(Box,{'flexDirection':_0x2564ab(0x19f),'children':[(_0x5d6e93||_0x401f49)&&a3_0x382f83(Box,{'children':[a3_0x311a75(Text,{'color':_0x2564ab(0x1b4),'children':'*\x20'}),a3_0x311a75(Text,{'color':_0x426e51?_0x2564ab(0x1be):'dim','children':_0x5206b5})]}),_0x5d6e93&&a3_0x311a75(Box,{'children':a3_0x382f83(Text,{'children':['🚀\x20',_0xbce765,_0x2564ab(0x19e),_0x15affe,')']})}),_0x401f49&&_0x553d2f&&a3_0x382f83(Box,{'flexDirection':_0x2564ab(0x19f),'children':[a3_0x311a75(Box,{'children':a3_0x382f83(Text,{'color':_0x2564ab(0x1b6),'children':['√\x20文档生成完成!成功\x20',_0x2bde7a,'\x20个',_0x53b3f4>0x0&&_0x2564ab(0x196)+_0x53b3f4+'\x20个']})}),a3_0x311a75(Box,{'marginTop':0x1,'children':a3_0x382f83(Text,{'color':_0x2564ab(0x1b4),'children':['*\x20共处理\x20',_0x26211c,_0x2564ab(0x1b8)]})}),a3_0x382f83(Box,{'marginTop':0x1,'children':[a3_0x311a75(Text,{'color':_0x2564ab(0x1b4),'children':'*\x20输出目录:\x20'}),a3_0x311a75(Text,{'color':_0x2564ab(0x1bb),'children':_0x443c40})]}),_0x2bde7a>0x0&&a3_0x382f83(a3_0x5f3d96,{'children':[a3_0x311a75(Box,{'marginTop':0x1,'children':a3_0x311a75(Text,{'color':_0x2564ab(0x1b4),'children':_0x2564ab(0x1a4)})}),_0x553d2f[_0x2564ab(0x1b9)](_0x345045=>_0x345045[_0x2564ab(0x199)])['map']((_0x25ce33,_0x4a3f3e)=>a3_0x382f83(Box,{'marginLeft':0x2,'children':[a3_0x382f83(Text,{'color':_0x2564ab(0x1bb),'children':['•\x20',_0x25ce33[_0x2564ab(0x198)]]}),a3_0x382f83(Text,{'color':'dim','children':[_0x2564ab(0x1a2),_0x25ce33[_0x2564ab(0x197)]]})]},_0x4a3f3e))]}),_0x53b3f4>0x0&&a3_0x382f83(a3_0x5f3d96,{'children':[a3_0x311a75(Box,{'marginTop':0x1,'children':a3_0x311a75(Text,{'color':_0x2564ab(0x1c1),'children':_0x2564ab(0x1af)})}),_0x553d2f[_0x2564ab(0x1b9)](_0x50b2cc=>!_0x50b2cc[_0x2564ab(0x199)])['map']((_0x4f3245,_0x37014b)=>a3_0x382f83(Box,{'marginLeft':0x2,'flexDirection':_0x2564ab(0x19f),'children':[a3_0x382f83(Text,{'color':_0x2564ab(0x1a5),'children':['•\x20',_0x4f3245[_0x2564ab(0x197)],'\x20(',_0x4f3245[_0x2564ab(0x19c)],')']}),_0x4f3245[_0x2564ab(0x1b7)]&&a3_0x311a75(Box,{'marginLeft':0x2,'children':a3_0x311a75(Text,{'color':_0x2564ab(0x18e),'children':_0x4f3245[_0x2564ab(0x1b7)]})})]},_0x37014b))]})]}),_0x54d2c4&&a3_0x382f83(Box,{'flexDirection':'column','children':[a3_0x311a75(Box,{'children':a3_0x382f83(Text,{'color':_0x2564ab(0x1a5),'children':['❌\x20',_0x54d2c4]})}),_0x54d2c4[_0x2564ab(0x1bc)]('登录')&&a3_0x382f83(Box,{'marginTop':0x1,'children':[a3_0x311a75(Text,{'color':'yellow','children':_0x2564ab(0x19d)}),a3_0x311a75(Text,{'color':'cyan','children':_0x2564ab(0x18f)}),a3_0x311a75(Text,{'color':_0x2564ab(0x1c1),'children':_0x2564ab(0x1a0)})]})]})]});};
1
+ (function(_0x261459,_0x578466){const _0x4abe2f=a5_0x2df0,_0x48d21e=_0x261459();while(!![]){try{const _0x14d6b5=-parseInt(_0x4abe2f(0x172))/0x1*(-parseInt(_0x4abe2f(0x176))/0x2)+-parseInt(_0x4abe2f(0x151))/0x3*(-parseInt(_0x4abe2f(0x148))/0x4)+-parseInt(_0x4abe2f(0x160))/0x5*(parseInt(_0x4abe2f(0x154))/0x6)+-parseInt(_0x4abe2f(0x16b))/0x7*(parseInt(_0x4abe2f(0x175))/0x8)+parseInt(_0x4abe2f(0x150))/0x9+parseInt(_0x4abe2f(0x17d))/0xa*(parseInt(_0x4abe2f(0x14b))/0xb)+-parseInt(_0x4abe2f(0x167))/0xc;if(_0x14d6b5===_0x578466)break;else _0x48d21e['push'](_0x48d21e['shift']());}catch(_0xd2f2ad){_0x48d21e['push'](_0x48d21e['shift']());}}}(a5_0x5ab3,0x5fbe0));import{jsx as a5_0x35571a,jsxs as a5_0x4dd29d,Fragment as a5_0x181daa}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a5_0x2df0(_0x113381,_0x79c96d){_0x113381=_0x113381-0x146;const _0x5ab3bd=a5_0x5ab3();let _0x2df02d=_0x5ab3bd[_0x113381];return _0x2df02d;}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a5_0x5ab3(){const _0x2b18ec=['121QmhZsY','*\x20输出目录:\x20','column','指定的数据集代码都不存在:\x20','未提供应用AppCode,且配置中也没有默认值','5457285ksgRtt','40542TabQwe','cyan','filePath','6iOSQOg','文档生成失败:\x20','💡\x20请使用\x20','env','green','正在获取数据集列表...','\x20个匹配的数据集\x1b[0m','length','map','gray','api-doc','.md\x20(','3451705wBqKOD','\x1b[90m*\x20从\x20','log','success',',\x20失败\x20','datasetCode','\x20个数据集','5945148dVqagE','yellow','*\x20共处理\x20','online','959aRoWVX','join','🚀\x20','\x20(环境:\x20','\x20重新登录后再试','\x1b[0m','\x20-\x20','183697JIiGSF','dim','./docs','8392YoxtJB','8XPvnyO','使用配置的应用AppCode:\x20','message','filter','cwd','文档生成完成','includes','210760kOeJPR','未找到任何数据集','正在生成\x20','setLogPath','44ccLKny','datasetName','error'];a5_0x5ab3=function(){return _0x2b18ec;};return a5_0x5ab3();}export const ApiDocUI=({appCode:_0x3412c6,env:_0x10bc6d,output:_0x433d34,extraParams:_0x4a4670,datasetCodes:_0x4bdb54})=>{const _0x491470=a5_0x2df0,{exit:_0x9354d3}=useApp(),[_0x3fd4e3,_0x22cb78]=useState(![]),[_0x26b321,_0x21f20a]=useState(''),[_0x34f034,_0x544738]=useState(![]),[_0x42d062,_0x397673]=useState(null),[_0x4b9238,_0x30d392]=useState(null),[_0x20357f,_0x20b954]=useState(0x0),_0x2379ac=readConfig(),_0x62ea2e=getConfigAppCode(),_0x54d751=_0x3412c6||_0x62ea2e,_0x19af85=typeof _0x2379ac?.['env']==='string'?_0x2379ac[_0x491470(0x157)]:undefined,_0x16aa6d=_0x10bc6d||_0x19af85||_0x491470(0x16a);initEnv(_0x16aa6d);const _0xca8ec2=_0x433d34||_0x491470(0x174),_0x2104c3=_0x3412c6?'使用指定的应用AppCode:\x20'+_0x54d751:_0x491470(0x177)+_0x54d751;useEffect(()=>{_0x22cb78(!![]),_0x1cda7a();},[]),useEffect(()=>{(_0x34f034||_0x42d062)&&_0x9354d3();},[_0x34f034,_0x42d062,_0x9354d3]);async function _0x1cda7a(){const _0x51005e=_0x491470;if(!_0x54d751){_0x397673(_0x51005e(0x14f));return;}try{logger[_0x51005e(0x147)](process[_0x51005e(0x17a)]()),_0x21f20a(_0x51005e(0x159));const {configArray:_0x3b66dc}=await fetchModelList(_0x54d751);_0x20b954(_0x3b66dc[_0x51005e(0x15b)]);if(_0x3b66dc[_0x51005e(0x15b)]===0x0){_0x397673(_0x51005e(0x17e));return;}let _0x2b468f=_0x3b66dc;if(_0x4bdb54&&_0x4bdb54[_0x51005e(0x15b)]>0x0){_0x2b468f=_0x3b66dc[_0x51005e(0x179)](_0x949a0e=>_0x4bdb54[_0x51005e(0x17c)](_0x949a0e[_0x51005e(0x165)]));const _0x34c9c9=_0x2b468f[_0x51005e(0x15c)](_0x435802=>_0x435802[_0x51005e(0x165)]),_0x3e3d90=_0x4bdb54['filter'](_0x1c19e4=>!_0x34c9c9['includes'](_0x1c19e4));_0x3e3d90[_0x51005e(0x15b)]>0x0&&console[_0x51005e(0x162)]('\x1b[33m!\x20以下数据集代码不存在:\x20'+_0x3e3d90[_0x51005e(0x16c)](',\x20')+_0x51005e(0x170));if(_0x2b468f['length']===0x0){_0x397673(_0x51005e(0x14e)+_0x4bdb54[_0x51005e(0x16c)](',\x20'));return;}console[_0x51005e(0x162)](_0x51005e(0x161)+_0x3b66dc[_0x51005e(0x15b)]+'\x20个数据集中筛选出\x20'+_0x2b468f[_0x51005e(0x15b)]+_0x51005e(0x15a));}_0x21f20a(_0x51005e(0x146)+_0x2b468f[_0x51005e(0x15b)]+'\x20个数据集的文档...');const _0x1c7b8e=await generateDatasetDocs(_0x2b468f,_0x54d751,_0xca8ec2,(_0x3cb692,_0x5d088d,_0x2b8d0d)=>{const _0xfd5ec0=_0x51005e;_0x21f20a(_0xfd5ec0(0x146)+_0x2b8d0d+_0xfd5ec0(0x15f)+_0x3cb692+'/'+_0x5d088d+')');},_0x4a4670);_0x30d392(_0x1c7b8e),_0x544738(!![]);const _0xbf919d=_0x1c7b8e[_0x51005e(0x179)](_0x5c26bd=>_0x5c26bd[_0x51005e(0x163)])[_0x51005e(0x15b)],_0x1865e1=_0x1c7b8e[_0x51005e(0x179)](_0x2c7128=>!_0x2c7128[_0x51005e(0x163)])['length'];logger[_0x51005e(0x163)](_0x51005e(0x15e),_0x51005e(0x17b),undefined,{'totalCount':_0x1c7b8e['length'],'successCount':_0xbf919d,'failCount':_0x1865e1,'outputDir':_0xca8ec2});}catch(_0x5bc18d){const _0x394ec1=_0x5bc18d instanceof Error?_0x5bc18d[_0x51005e(0x178)]:String(_0x5bc18d);logger[_0x51005e(0x14a)](_0x51005e(0x15e),_0x51005e(0x155)+_0x394ec1,{'appCode':_0x54d751,'outputDir':_0xca8ec2}),_0x397673(_0x51005e(0x155)+_0x394ec1);}finally{_0x22cb78(![]);}}const _0x16e015=_0x4b9238?.[_0x491470(0x179)](_0x46fe11=>_0x46fe11[_0x491470(0x163)])[_0x491470(0x15b)]||0x0,_0x55de1f=_0x4b9238?.[_0x491470(0x179)](_0x510415=>!_0x510415['success'])[_0x491470(0x15b)]||0x0;return a5_0x4dd29d(Box,{'flexDirection':_0x491470(0x14d),'children':[(_0x3fd4e3||_0x34f034)&&a5_0x4dd29d(Box,{'children':[a5_0x35571a(Text,{'color':_0x491470(0x15d),'children':'*\x20'}),a5_0x35571a(Text,{'color':_0x3412c6?'white':_0x491470(0x173),'children':_0x2104c3})]}),_0x3fd4e3&&a5_0x35571a(Box,{'children':a5_0x4dd29d(Text,{'children':[_0x491470(0x16d),_0x26b321,_0x491470(0x16e),_0x16aa6d,')']})}),_0x34f034&&_0x4b9238&&a5_0x4dd29d(Box,{'flexDirection':_0x491470(0x14d),'children':[a5_0x35571a(Box,{'children':a5_0x4dd29d(Text,{'color':_0x491470(0x158),'children':['√\x20文档生成完成!成功\x20',_0x16e015,'\x20个',_0x55de1f>0x0&&_0x491470(0x164)+_0x55de1f+'\x20个']})}),a5_0x35571a(Box,{'marginTop':0x1,'children':a5_0x4dd29d(Text,{'color':_0x491470(0x15d),'children':[_0x491470(0x169),_0x20357f,_0x491470(0x166)]})}),a5_0x4dd29d(Box,{'marginTop':0x1,'children':[a5_0x35571a(Text,{'color':_0x491470(0x15d),'children':_0x491470(0x14c)}),a5_0x35571a(Text,{'color':_0x491470(0x152),'children':_0xca8ec2})]}),_0x16e015>0x0&&a5_0x4dd29d(a5_0x181daa,{'children':[a5_0x35571a(Box,{'marginTop':0x1,'children':a5_0x35571a(Text,{'color':_0x491470(0x15d),'children':'*\x20生成的文档文件:'})}),_0x4b9238[_0x491470(0x179)](_0x1194a7=>_0x1194a7[_0x491470(0x163)])[_0x491470(0x15c)]((_0x346f56,_0x56243e)=>a5_0x4dd29d(Box,{'marginLeft':0x2,'children':[a5_0x4dd29d(Text,{'color':_0x491470(0x152),'children':['•\x20',_0x346f56[_0x491470(0x153)]]}),a5_0x4dd29d(Text,{'color':_0x491470(0x173),'children':[_0x491470(0x171),_0x346f56[_0x491470(0x149)]]})]},_0x56243e))]}),_0x55de1f>0x0&&a5_0x4dd29d(a5_0x181daa,{'children':[a5_0x35571a(Box,{'marginTop':0x1,'children':a5_0x35571a(Text,{'color':_0x491470(0x168),'children':'⚠️\x20以下数据集生成失败:'})}),_0x4b9238['filter'](_0x3e5124=>!_0x3e5124['success'])[_0x491470(0x15c)]((_0x3e02f0,_0x3dfa0b)=>a5_0x4dd29d(Box,{'marginLeft':0x2,'flexDirection':_0x491470(0x14d),'children':[a5_0x4dd29d(Text,{'color':'red','children':['•\x20',_0x3e02f0[_0x491470(0x149)],'\x20(',_0x3e02f0[_0x491470(0x165)],')']}),_0x3e02f0[_0x491470(0x14a)]&&a5_0x35571a(Box,{'marginLeft':0x2,'children':a5_0x35571a(Text,{'color':_0x491470(0x173),'children':_0x3e02f0[_0x491470(0x14a)]})})]},_0x3dfa0b))]})]}),_0x42d062&&a5_0x4dd29d(Box,{'flexDirection':'column','children':[a5_0x35571a(Box,{'children':a5_0x4dd29d(Text,{'color':'red','children':['❌\x20',_0x42d062]})}),_0x42d062[_0x491470(0x17c)]('登录')&&a5_0x4dd29d(Box,{'marginTop':0x1,'children':[a5_0x35571a(Text,{'color':_0x491470(0x168),'children':_0x491470(0x156)}),a5_0x35571a(Text,{'color':_0x491470(0x152),'children':'lovrabet\x20auth'}),a5_0x35571a(Text,{'color':'yellow','children':_0x491470(0x16f)})]})]})]});};
@@ -1 +1 @@
1
- const a4_0x4ed629=a4_0x2928;(function(_0x16c8c5,_0xa9b347){const _0x33ee57=a4_0x2928,_0x15ffd0=_0x16c8c5();while(!![]){try{const _0x4f8654=parseInt(_0x33ee57(0x19e))/0x1+parseInt(_0x33ee57(0x18b))/0x2*(parseInt(_0x33ee57(0x199))/0x3)+-parseInt(_0x33ee57(0x1a4))/0x4+parseInt(_0x33ee57(0x19f))/0x5*(parseInt(_0x33ee57(0x18e))/0x6)+-parseInt(_0x33ee57(0x192))/0x7+-parseInt(_0x33ee57(0x19b))/0x8+parseInt(_0x33ee57(0x19a))/0x9;if(_0x4f8654===_0xa9b347)break;else _0x15ffd0['push'](_0x15ffd0['shift']());}catch(_0x34fb82){_0x15ffd0['push'](_0x15ffd0['shift']());}}}(a4_0x4aaf,0xd7e7b));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x54501a from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x4aaf(){const _0x26713c=['),HTTP状态码:\x20','tableName','4277294nkrfbC','application/json','获取文档失败\x20(','.md\x20(','stringify','✗\x20失败:\x20','status','177FDalYL','12627063HqZJmQ','11750120XkngcG','name','success','1508255otMusM','10mLmQMs','./docs','json','生成文档失败:\x20','):缺少\x20data.markdown\x20字段','3099580DAlOMi','length','log','datasetCode','message','push','join','data','api-doc','text','/api/node-toolbox/api-doc-generator','等待\x203\x20秒...\x0a','error','markdown','utf8','响应数据格式错误\x20(','生成文档成功:\x20','POST','3490HuMxoz',']\x20正在生成:\x20','string','2174496AJtsRm','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录'];a4_0x4aaf=function(){return _0x26713c;};return a4_0x4aaf();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x389bb7){const _0xe43d80=a4_0x2928,{appCode:_0x57223f,datasetCode:_0x309454,datasetId:_0x249edd,extraParams:_0x4fa99e}=_0x389bb7,_0x5f0d7b=getApiDomain(),_0x36ab37=_0x5f0d7b+_0xe43d80(0x1ae),_0x160b53={'appCode':_0x57223f,'datasetCode':_0x309454,'datasetId':_0x249edd,..._0x4fa99e||{}},_0x50eee0=await fetch(_0x36ab37,{'method':_0xe43d80(0x18a),'headers':{'Content-Type':_0xe43d80(0x193),'Cookie':getCookie()},'body':JSON[_0xe43d80(0x196)](_0x160b53)});if(!_0x50eee0['ok']){if(_0x50eee0[_0xe43d80(0x198)]===0x191)throw new Error(_0xe43d80(0x18f));let _0x26491b='';try{_0x26491b=await _0x50eee0[_0xe43d80(0x1ad)]();}catch(_0x4ee100){}throw new Error(_0xe43d80(0x194)+_0x309454+_0xe43d80(0x190)+_0x50eee0[_0xe43d80(0x198)]+(_0x26491b?'\x0a'+_0x26491b:''));}const _0x49586d=await _0x50eee0[_0xe43d80(0x1a1)]();if(!_0x49586d[_0xe43d80(0x1ab)]||typeof _0x49586d[_0xe43d80(0x1ab)][_0xe43d80(0x186)]!==_0xe43d80(0x18d))throw new Error(_0xe43d80(0x188)+_0x309454+_0xe43d80(0x1a3));return _0x49586d['data'][_0xe43d80(0x186)];}function a4_0x2928(_0x264f10,_0x360c36){_0x264f10=_0x264f10-0x185;const _0x4aaf6c=a4_0x4aaf();let _0x29287f=_0x4aaf6c[_0x264f10];return _0x29287f;}function delay(_0x1bb178){return new Promise(_0x49c127=>setTimeout(_0x49c127,_0x1bb178));}export async function generateDatasetDocs(_0x566b2b,_0x15553e,_0x58b2e3=a4_0x4ed629(0x1a0),_0x4c4785,_0x3171d1){const _0x282d18=a4_0x4ed629;mkdirSync(_0x58b2e3,{'recursive':!![]});const _0x107eb7=[],_0x671ba0=_0x566b2b[_0x282d18(0x1a5)];console[_0x282d18(0x1a6)]('\x0a共有\x20'+_0x671ba0+'\x20个数据集需要生成文档\x0a');for(let _0xbe3395=0x0;_0xbe3395<_0x566b2b[_0x282d18(0x1a5)];_0xbe3395++){const _0x16d72b=_0x566b2b[_0xbe3395],_0x4d67bc=_0xbe3395+0x1,_0x4205e0=_0x16d72b[_0x282d18(0x191)];try{console[_0x282d18(0x1a6)]('['+_0x4d67bc+'/'+_0x671ba0+_0x282d18(0x18c)+_0x4205e0+_0x282d18(0x195)+_0x16d72b[_0x282d18(0x19c)]+')');_0x4c4785&&_0x4c4785(_0x4d67bc,_0x671ba0,_0x4205e0);const _0x3c0ebb=await fetchDatasetDoc({'appCode':_0x15553e,'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetId':_0x16d72b['id'],'enableAI':![],'extraParams':_0x3171d1}),_0x51c3f6=a4_0x54501a[_0x282d18(0x1aa)](_0x58b2e3,_0x4205e0+'.md');writeFileSync(_0x51c3f6,_0x3c0ebb,{'encoding':_0x282d18(0x187)}),console[_0x282d18(0x1a6)]('✓\x20成功生成:\x20'+_0x4205e0+'.md'),logger[_0x282d18(0x19d)]('api-doc',_0x282d18(0x189)+_0x4205e0,undefined,{'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetName':_0x16d72b[_0x282d18(0x19c)],'filePath':_0x51c3f6,'progress':_0x4d67bc+'/'+_0x671ba0}),_0x107eb7[_0x282d18(0x1a9)]({'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetName':_0x16d72b['name'],'filePath':_0x51c3f6,'success':!![]}),_0x4d67bc<_0x671ba0&&await delay(0x1388);}catch(_0x1c109a){const _0x455c07=_0x1c109a instanceof Error?_0x1c109a[_0x282d18(0x1a8)]:String(_0x1c109a);console[_0x282d18(0x1a6)](_0x282d18(0x197)+_0x4205e0+'.md\x20-\x20'+_0x455c07+'\x0a'),logger[_0x282d18(0x185)](_0x282d18(0x1ac),_0x282d18(0x1a2)+_0x16d72b['datasetCode'],{'datasetCode':_0x16d72b['datasetCode'],'datasetName':_0x16d72b[_0x282d18(0x19c)],'error':_0x455c07,'progress':_0x4d67bc+'/'+_0x671ba0}),_0x107eb7[_0x282d18(0x1a9)]({'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetName':_0x16d72b[_0x282d18(0x19c)],'filePath':'','success':![],'error':_0x455c07}),_0x4d67bc<_0x671ba0&&(console['log'](_0x282d18(0x1af)),await delay(0xbb8));}}return _0x107eb7;}
1
+ const a6_0x3fe50c=a6_0x22f0;(function(_0x1055c4,_0x2698f3){const _0x3651b3=a6_0x22f0,_0xcf82fd=_0x1055c4();while(!![]){try{const _0x586b04=parseInt(_0x3651b3(0x1e3))/0x1*(parseInt(_0x3651b3(0x1ef))/0x2)+parseInt(_0x3651b3(0x1e2))/0x3+-parseInt(_0x3651b3(0x1e0))/0x4+-parseInt(_0x3651b3(0x1fc))/0x5*(-parseInt(_0x3651b3(0x200))/0x6)+parseInt(_0x3651b3(0x205))/0x7+parseInt(_0x3651b3(0x1f1))/0x8+parseInt(_0x3651b3(0x1e9))/0x9;if(_0x586b04===_0x2698f3)break;else _0xcf82fd['push'](_0xcf82fd['shift']());}catch(_0x2545c7){_0xcf82fd['push'](_0xcf82fd['shift']());}}}(a6_0x6825,0xb2ed0));import{mkdirSync,writeFileSync}from'node:fs';function a6_0x6825(){const _0x361740=['data',']\x20正在生成:\x20','tableName','datasetCode','10njJhDE','生成文档失败:\x20','success','text','1887486HEPIGa','json','.md\x20-\x20','api-doc','./docs','518511DbvSLG','push','4148544BKkwLB','):缺少\x20data.markdown\x20字段','1752342sHFrVB','7163RzarPn','\x0a共有\x20','\x20个数据集需要生成文档\x0a','响应数据格式错误\x20(','markdown','stringify','4698zZgfly','等待\x203\x20秒...\x0a','),HTTP状态码:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','error','name','14yWsJvR','status','3456032tLfKYs','log','生成文档成功:\x20','message','application/json','.md','/api/node-toolbox/api-doc-generator'];a6_0x6825=function(){return _0x361740;};return a6_0x6825();}function a6_0x22f0(_0x435f7b,_0x49cdb4){_0x435f7b=_0x435f7b-0x1e0;const _0x6825e=a6_0x6825();let _0x22f073=_0x6825e[_0x435f7b];return _0x22f073;}import a6_0x4b0701 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(_0x5b95f7){const _0x182d79=a6_0x22f0,{appCode:_0x1b22fb,datasetCode:_0x5279f3,datasetId:_0x5b5a81,extraParams:_0x453e93}=_0x5b95f7,_0xd3a77c=getApiDomain(),_0x5adc53=_0xd3a77c+_0x182d79(0x1f7),_0x4ffe2d={'appCode':_0x1b22fb,'datasetCode':_0x5279f3,'datasetId':_0x5b5a81,..._0x453e93||{}},_0x22e7d7=await fetch(_0x5adc53,{'method':'POST','headers':{'Content-Type':_0x182d79(0x1f5),'Cookie':getCookie()},'body':JSON[_0x182d79(0x1e8)](_0x4ffe2d)});if(!_0x22e7d7['ok']){if(_0x22e7d7[_0x182d79(0x1f0)]===0x191)throw new Error(_0x182d79(0x1ec));let _0x1d4811='';try{_0x1d4811=await _0x22e7d7[_0x182d79(0x1ff)]();}catch(_0x1b0d39){}throw new Error('获取文档失败\x20('+_0x5279f3+_0x182d79(0x1eb)+_0x22e7d7['status']+(_0x1d4811?'\x0a'+_0x1d4811:''));}const _0x98f9c9=await _0x22e7d7[_0x182d79(0x201)]();if(!_0x98f9c9['data']||typeof _0x98f9c9[_0x182d79(0x1f8)][_0x182d79(0x1e7)]!=='string')throw new Error(_0x182d79(0x1e6)+_0x5279f3+_0x182d79(0x1e1));return _0x98f9c9[_0x182d79(0x1f8)][_0x182d79(0x1e7)];}function delay(_0x4b64d5){return new Promise(_0x2ae5fe=>setTimeout(_0x2ae5fe,_0x4b64d5));}export async function generateDatasetDocs(_0x3db0d6,_0x533213,_0x56f096=a6_0x3fe50c(0x204),_0x3c352f,_0x3c1b7f){const _0x4bc0a3=a6_0x3fe50c;mkdirSync(_0x56f096,{'recursive':!![]});const _0x4a2612=[],_0x27d7ae=_0x3db0d6['length'];console[_0x4bc0a3(0x1f2)](_0x4bc0a3(0x1e4)+_0x27d7ae+_0x4bc0a3(0x1e5));for(let _0x3ba79e=0x0;_0x3ba79e<_0x3db0d6['length'];_0x3ba79e++){const _0x26d685=_0x3db0d6[_0x3ba79e],_0x16c567=_0x3ba79e+0x1,_0x5863c3=_0x26d685[_0x4bc0a3(0x1fa)];try{console[_0x4bc0a3(0x1f2)]('['+_0x16c567+'/'+_0x27d7ae+_0x4bc0a3(0x1f9)+_0x5863c3+'.md\x20('+_0x26d685[_0x4bc0a3(0x1ee)]+')');_0x3c352f&&_0x3c352f(_0x16c567,_0x27d7ae,_0x5863c3);const _0x4c65b3=await fetchDatasetDoc({'appCode':_0x533213,'datasetCode':_0x26d685[_0x4bc0a3(0x1fb)],'datasetId':_0x26d685['id'],'enableAI':![],'extraParams':_0x3c1b7f}),_0x82ae3a=a6_0x4b0701['join'](_0x56f096,_0x5863c3+'.md');writeFileSync(_0x82ae3a,_0x4c65b3,{'encoding':'utf8'}),console[_0x4bc0a3(0x1f2)]('✓\x20成功生成:\x20'+_0x5863c3+_0x4bc0a3(0x1f6)),logger[_0x4bc0a3(0x1fe)](_0x4bc0a3(0x203),_0x4bc0a3(0x1f3)+_0x5863c3,undefined,{'datasetCode':_0x26d685['datasetCode'],'datasetName':_0x26d685[_0x4bc0a3(0x1ee)],'filePath':_0x82ae3a,'progress':_0x16c567+'/'+_0x27d7ae}),_0x4a2612['push']({'datasetCode':_0x26d685[_0x4bc0a3(0x1fb)],'datasetName':_0x26d685[_0x4bc0a3(0x1ee)],'filePath':_0x82ae3a,'success':!![]}),_0x16c567<_0x27d7ae&&await delay(0x1388);}catch(_0x5f56de){const _0x3c384b=_0x5f56de instanceof Error?_0x5f56de[_0x4bc0a3(0x1f4)]:String(_0x5f56de);console['log']('✗\x20失败:\x20'+_0x5863c3+_0x4bc0a3(0x202)+_0x3c384b+'\x0a'),logger[_0x4bc0a3(0x1ed)](_0x4bc0a3(0x203),_0x4bc0a3(0x1fd)+_0x26d685[_0x4bc0a3(0x1fb)],{'datasetCode':_0x26d685['datasetCode'],'datasetName':_0x26d685['name'],'error':_0x3c384b,'progress':_0x16c567+'/'+_0x27d7ae}),_0x4a2612[_0x4bc0a3(0x206)]({'datasetCode':_0x26d685[_0x4bc0a3(0x1fb)],'datasetName':_0x26d685[_0x4bc0a3(0x1ee)],'filePath':'','success':![],'error':_0x3c384b}),_0x16c567<_0x27d7ae&&(console[_0x4bc0a3(0x1f2)](_0x4bc0a3(0x1ea)),await delay(0xbb8));}}return _0x4a2612;}
@@ -1 +1 @@
1
- (function(_0x58f5e4,_0x34f2fc){const _0x65823b=a5_0x3d65,_0x5d9f52=_0x58f5e4();while(!![]){try{const _0x1c3bd9=-parseInt(_0x65823b(0x164))/0x1+-parseInt(_0x65823b(0x13e))/0x2+-parseInt(_0x65823b(0x162))/0x3+-parseInt(_0x65823b(0x146))/0x4*(parseInt(_0x65823b(0x142))/0x5)+parseInt(_0x65823b(0x148))/0x6*(parseInt(_0x65823b(0x158))/0x7)+parseInt(_0x65823b(0x149))/0x8*(-parseInt(_0x65823b(0x156))/0x9)+parseInt(_0x65823b(0x165))/0xa;if(_0x1c3bd9===_0x34f2fc)break;else _0x5d9f52['push'](_0x5d9f52['shift']());}catch(_0x1275ee){_0x5d9f52['push'](_0x5d9f52['shift']());}}}(a5_0x26c5,0xb88e5));import{jsx as a5_0x59013c,jsxs as a5_0xe5e94a}from'react/jsx-runtime';function a5_0x26c5(){const _0x5b3dfd=['-api','lovrabet\x20auth','split','online','cwd','-client','gray','💡\x20请使用\x20','replace','endsWith','557116WVqZZT','white','未提供应用AppCode,且配置中也没有默认值','使用指定的应用AppCode:\x20','10GbqjCZ','\x20个模型)','拉取\x20API\x20配置失败:\x20','api','560440caBgXK','{\x20lovrabetClient\x20}','6daiEVU','20872KXjRHH','green','yellow','\x20-\x20客户端实例文件','includes','-\x20模型配置文件\x20(','setLogPath','dim','api-pull','\x20个模型','cyan','modelCount','\x20个,过滤重复','2853msIwZI','*\x20导入方式:','1336055reVvVA','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','env','import\x20','column','join','red','client','\x20重新登录后再试','duplicateCount','1050228olZqJh','message','968344FfMIeO','32693270UYfuWT','.ts','*\x20已生成文件:','datasetCount','slice','\x20个数据集,生成','√\x20成功拉取\x20'];a5_0x26c5=function(){return _0x5b3dfd;};return a5_0x26c5();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a5_0x3d65(_0x2176c9,_0x5bc510){_0x2176c9=_0x2176c9-0x13b;const _0x26c5b1=a5_0x26c5();let _0x3d650e=_0x26c5b1[_0x2176c9];return _0x3d650e;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x41c458,env:_0x267722,output:_0x3a6c83})=>{const _0x3aa4a2=a5_0x3d65,{exit:_0x2e1b93}=useApp(),[_0x96d232,_0x368317]=useState(![]),[_0x5e400e,_0x17eb5d]=useState(![]),[_0x594458,_0x3530ec]=useState(null),[_0x2deea0,_0x3abf16]=useState(null),_0x139eff=readConfig(),_0x3fb1e4=getConfigAppCode(),_0x3a4adb=_0x41c458||_0x3fb1e4,_0x4469d7=typeof _0x139eff?.[_0x3aa4a2(0x15a)]==='string'?_0x139eff[_0x3aa4a2(0x15a)]:undefined,_0x4b74b9=_0x267722||_0x4469d7||_0x3aa4a2(0x16f);initEnv(_0x4b74b9);const _0x4846f7=_0x3a6c83||'./src/api/',_0x50e351=_0x41c458&&_0x41c458[_0x3aa4a2(0x14d)]('-')?_0x41c458[_0x3aa4a2(0x16e)]('-')[_0x3aa4a2(0x169)](0x1)[_0x3aa4a2(0x15d)]('-'):'',_0x3dfae5=_0x41c458?_0x3aa4a2(0x141)+_0x3a4adb:'使用配置的应用AppCode:\x20'+_0x3a4adb,_0x44b7b8=_0x50e351?_0x50e351+_0x3aa4a2(0x16c):_0x3aa4a2(0x145),_0x453c51=_0x50e351?_0x50e351+_0x3aa4a2(0x171):_0x3aa4a2(0x15f);useEffect(()=>{_0x368317(!![]),_0x4f7d1d();},[]),useEffect(()=>{(_0x5e400e||_0x594458)&&_0x2e1b93();},[_0x5e400e,_0x594458,_0x2e1b93]);async function _0x4f7d1d(){const _0x4200f0=_0x3aa4a2;if(!_0x3a4adb){_0x3530ec(_0x4200f0(0x140));return;}try{logger[_0x4200f0(0x14f)](process[_0x4200f0(0x170)]());const {configArray:_0x877f35}=await fetchModelList(_0x3a4adb),_0x5984df=_0x877f35['length'],_0x4087f4=!_0x41c458,_0x361a5b=await generateApiFile(_0x877f35,_0x50e351,_0x3a4adb,_0x4087f4,_0x4b74b9,_0x4846f7),_0x26a10d=_0x4846f7[_0x4200f0(0x13d)]('/')?_0x4846f7:_0x4846f7+'/';_0x3abf16({'api':''+_0x26a10d+_0x44b7b8+_0x4200f0(0x166),'client':''+_0x26a10d+_0x453c51+_0x4200f0(0x166),'modelCount':_0x361a5b['modelCount'],'datasetCount':_0x5984df,'originalCount':_0x5984df,'duplicateCount':0x0}),_0x17eb5d(!![]);}catch(_0x43e577){const _0x1c4102=_0x43e577 instanceof Error?_0x43e577[_0x4200f0(0x163)]:String(_0x43e577);logger['error'](_0x4200f0(0x151),'拉取\x20API\x20配置失败:\x20'+_0x1c4102,{'appCode':_0x3a4adb,'error':_0x1c4102}),_0x3530ec(_0x4200f0(0x144)+_0x1c4102);}finally{_0x368317(![]);}}return a5_0xe5e94a(Box,{'flexDirection':_0x3aa4a2(0x15c),'children':[(_0x96d232||_0x5e400e)&&a5_0xe5e94a(Box,{'children':[a5_0x59013c(Text,{'color':_0x3aa4a2(0x172),'children':'*\x20'}),a5_0x59013c(Text,{'color':_0x41c458?_0x3aa4a2(0x13f):'dim','children':_0x3dfae5})]}),_0x96d232&&a5_0x59013c(Box,{'children':a5_0xe5e94a(Text,{'children':[_0x3aa4a2(0x159),_0x4b74b9,')']})}),_0x5e400e&&_0x2deea0&&a5_0xe5e94a(Box,{'flexDirection':_0x3aa4a2(0x15c),'children':[a5_0x59013c(Box,{'children':a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x14a),'children':[_0x3aa4a2(0x16b),_0x2deea0[_0x3aa4a2(0x168)],_0x3aa4a2(0x16a),'\x20',_0x2deea0[_0x3aa4a2(0x154)],_0x3aa4a2(0x152)]})}),_0x2deea0['duplicateCount']>0x0&&a5_0x59013c(Box,{'marginTop':0x1,'children':a5_0xe5e94a(Text,{'color':'yellow','children':['!\x20原始数据集\x20',_0x2deea0['originalCount'],_0x3aa4a2(0x155),'\x20',_0x2deea0[_0x3aa4a2(0x161)],'\x20个']})}),a5_0x59013c(Box,{'marginTop':0x1,'children':a5_0x59013c(Text,{'color':_0x3aa4a2(0x172),'children':_0x3aa4a2(0x167)})}),a5_0xe5e94a(Box,{'marginLeft':0x2,'children':[a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x153),'children':['•\x20',_0x2deea0[_0x3aa4a2(0x145)]]}),a5_0xe5e94a(Text,{'color':'dim','children':['\x20',_0x3aa4a2(0x14e),_0x2deea0['modelCount'],_0x3aa4a2(0x143)]})]}),a5_0xe5e94a(Box,{'marginLeft':0x2,'children':[a5_0xe5e94a(Text,{'color':'cyan','children':['•\x20',_0x2deea0['client']]}),a5_0x59013c(Text,{'color':_0x3aa4a2(0x150),'children':_0x3aa4a2(0x14c)})]}),a5_0x59013c(Box,{'marginTop':0x1,'children':a5_0x59013c(Text,{'color':_0x3aa4a2(0x172),'children':_0x3aa4a2(0x157)})}),a5_0x59013c(Box,{'marginLeft':0x2,'children':a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x14b),'children':[_0x3aa4a2(0x15b),_0x3aa4a2(0x147),'\x20from\x20\x27@/',_0x2deea0['client'][_0x3aa4a2(0x13c)](/^\.\//,'')[_0x3aa4a2(0x13c)](_0x3aa4a2(0x166),''),'\x27']})})]}),_0x594458&&a5_0xe5e94a(Box,{'flexDirection':_0x3aa4a2(0x15c),'children':[a5_0x59013c(Box,{'children':a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x15e),'children':['❌\x20',_0x594458]})}),_0x594458['includes']('登录')&&a5_0xe5e94a(Box,{'marginTop':0x1,'children':[a5_0x59013c(Text,{'color':_0x3aa4a2(0x14b),'children':_0x3aa4a2(0x13b)}),a5_0x59013c(Text,{'color':_0x3aa4a2(0x153),'children':_0x3aa4a2(0x16d)}),a5_0x59013c(Text,{'color':_0x3aa4a2(0x14b),'children':_0x3aa4a2(0x160)})]})]})]});};
1
+ (function(_0x3e0ea4,_0x57170d){const _0x453f6d=a7_0xc50d,_0x1c36fb=_0x3e0ea4();while(!![]){try{const _0x4de591=parseInt(_0x453f6d(0x139))/0x1+parseInt(_0x453f6d(0x135))/0x2*(parseInt(_0x453f6d(0x11a))/0x3)+parseInt(_0x453f6d(0x13a))/0x4+parseInt(_0x453f6d(0x136))/0x5+parseInt(_0x453f6d(0x123))/0x6*(-parseInt(_0x453f6d(0x124))/0x7)+-parseInt(_0x453f6d(0x128))/0x8*(-parseInt(_0x453f6d(0x137))/0x9)+-parseInt(_0x453f6d(0x12e))/0xa;if(_0x4de591===_0x57170d)break;else _0x1c36fb['push'](_0x1c36fb['shift']());}catch(_0x249eb9){_0x1c36fb['push'](_0x1c36fb['shift']());}}}(a7_0x2f36,0x8e9a6));import{jsx as a7_0x4bea94,jsxs as a7_0x1cfe8f}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a7_0x2f36(){const _0x29f184=['1362690HiFYZl','9dDgIeP','cyan','311421ROUCpb','506384tQvDBj','./src/api/','string','\x20重新登录后再试','duplicateCount','\x20个数据集,生成','datasetCount','yellow','-api','api','!\x20原始数据集\x20','{\x20lovrabetClient\x20}','\x20个模型)','\x20个,过滤重复','-\x20模型配置文件\x20(','使用配置的应用AppCode:\x20','*\x20导入方式:','red','448185FKGJlo','未提供应用AppCode,且配置中也没有默认值','includes','gray','\x20个模型','green','originalCount','dim','lovrabet\x20auth','6GYHLrn','6683145IHSVsG','length','message','setLogPath','9094936TIuPcG','env','.ts','cwd','拉取\x20API\x20配置失败:\x20','column','4579800HypbMr','client','modelCount','api-pull','error','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','replace','2WugVaX'];a7_0x2f36=function(){return _0x29f184;};return a7_0x2f36();}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';function a7_0xc50d(_0x32487f,_0x4ae3aa){_0x32487f=_0x32487f-0x112;const _0x2f36bb=a7_0x2f36();let _0xc50d95=_0x2f36bb[_0x32487f];return _0xc50d95;}import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x3946a0,env:_0x499723,output:_0xa0339f})=>{const _0x87877c=a7_0xc50d,{exit:_0xf9b707}=useApp(),[_0x38b498,_0x37b1a0]=useState(![]),[_0x35c5fd,_0x3721d4]=useState(![]),[_0x381ffb,_0x394d26]=useState(null),[_0x306fab,_0x297a69]=useState(null),_0xbe4a7=readConfig(),_0x322758=getConfigAppCode(),_0x2eecda=_0x3946a0||_0x322758,_0x5ccd58=typeof _0xbe4a7?.['env']===_0x87877c(0x13c)?_0xbe4a7[_0x87877c(0x129)]:undefined,_0x113e11=_0x499723||_0x5ccd58||'online';initEnv(_0x113e11);const _0x3ec41c=_0xa0339f||_0x87877c(0x13b),_0x1a9a84=_0x3946a0&&_0x3946a0[_0x87877c(0x11c)]('-')?_0x3946a0['split']('-')['slice'](0x1)['join']('-'):'',_0x751d97=_0x3946a0?'使用指定的应用AppCode:\x20'+_0x2eecda:_0x87877c(0x117)+_0x2eecda,_0x4c35f5=_0x1a9a84?_0x1a9a84+_0x87877c(0x142):_0x87877c(0x143),_0x3bc700=_0x1a9a84?_0x1a9a84+'-client':_0x87877c(0x12f);useEffect(()=>{_0x37b1a0(!![]),_0x24736a();},[]),useEffect(()=>{(_0x35c5fd||_0x381ffb)&&_0xf9b707();},[_0x35c5fd,_0x381ffb,_0xf9b707]);async function _0x24736a(){const _0x4f5e9f=_0x87877c;if(!_0x2eecda){_0x394d26(_0x4f5e9f(0x11b));return;}try{logger[_0x4f5e9f(0x127)](process[_0x4f5e9f(0x12b)]());const {configArray:_0x27971e}=await fetchModelList(_0x2eecda),_0x48228a=_0x27971e[_0x4f5e9f(0x125)],_0x31a176=!_0x3946a0,_0x1d1f7c=await generateApiFile(_0x27971e,_0x1a9a84,_0x2eecda,_0x31a176,_0x113e11,_0x3ec41c),_0x4d3b54=_0x3ec41c['endsWith']('/')?_0x3ec41c:_0x3ec41c+'/';_0x297a69({'api':''+_0x4d3b54+_0x4c35f5+'.ts','client':''+_0x4d3b54+_0x3bc700+'.ts','modelCount':_0x1d1f7c[_0x4f5e9f(0x130)],'datasetCount':_0x48228a,'originalCount':_0x48228a,'duplicateCount':0x0}),_0x3721d4(!![]);}catch(_0xbc7765){const _0xa090c4=_0xbc7765 instanceof Error?_0xbc7765[_0x4f5e9f(0x126)]:String(_0xbc7765);logger[_0x4f5e9f(0x132)](_0x4f5e9f(0x131),_0x4f5e9f(0x12c)+_0xa090c4,{'appCode':_0x2eecda,'error':_0xa090c4}),_0x394d26('拉取\x20API\x20配置失败:\x20'+_0xa090c4);}finally{_0x37b1a0(![]);}}return a7_0x1cfe8f(Box,{'flexDirection':_0x87877c(0x12d),'children':[(_0x38b498||_0x35c5fd)&&a7_0x1cfe8f(Box,{'children':[a7_0x4bea94(Text,{'color':_0x87877c(0x11d),'children':'*\x20'}),a7_0x4bea94(Text,{'color':_0x3946a0?'white':_0x87877c(0x121),'children':_0x751d97})]}),_0x38b498&&a7_0x4bea94(Box,{'children':a7_0x1cfe8f(Text,{'children':[_0x87877c(0x133),_0x113e11,')']})}),_0x35c5fd&&_0x306fab&&a7_0x1cfe8f(Box,{'flexDirection':_0x87877c(0x12d),'children':[a7_0x4bea94(Box,{'children':a7_0x1cfe8f(Text,{'color':_0x87877c(0x11f),'children':['√\x20成功拉取\x20',_0x306fab[_0x87877c(0x140)],_0x87877c(0x13f),'\x20',_0x306fab[_0x87877c(0x130)],_0x87877c(0x11e)]})}),_0x306fab[_0x87877c(0x13e)]>0x0&&a7_0x4bea94(Box,{'marginTop':0x1,'children':a7_0x1cfe8f(Text,{'color':_0x87877c(0x141),'children':[_0x87877c(0x112),_0x306fab[_0x87877c(0x120)],_0x87877c(0x115),'\x20',_0x306fab[_0x87877c(0x13e)],'\x20个']})}),a7_0x4bea94(Box,{'marginTop':0x1,'children':a7_0x4bea94(Text,{'color':_0x87877c(0x11d),'children':'*\x20已生成文件:'})}),a7_0x1cfe8f(Box,{'marginLeft':0x2,'children':[a7_0x1cfe8f(Text,{'color':_0x87877c(0x138),'children':['•\x20',_0x306fab[_0x87877c(0x143)]]}),a7_0x1cfe8f(Text,{'color':'dim','children':['\x20',_0x87877c(0x116),_0x306fab[_0x87877c(0x130)],_0x87877c(0x114)]})]}),a7_0x1cfe8f(Box,{'marginLeft':0x2,'children':[a7_0x1cfe8f(Text,{'color':_0x87877c(0x138),'children':['•\x20',_0x306fab['client']]}),a7_0x4bea94(Text,{'color':_0x87877c(0x121),'children':'\x20-\x20客户端实例文件'})]}),a7_0x4bea94(Box,{'marginTop':0x1,'children':a7_0x4bea94(Text,{'color':_0x87877c(0x11d),'children':_0x87877c(0x118)})}),a7_0x4bea94(Box,{'marginLeft':0x2,'children':a7_0x1cfe8f(Text,{'color':_0x87877c(0x141),'children':['import\x20',_0x87877c(0x113),'\x20from\x20\x27@/',_0x306fab[_0x87877c(0x12f)][_0x87877c(0x134)](/^\.\//,'')[_0x87877c(0x134)](_0x87877c(0x12a),''),'\x27']})})]}),_0x381ffb&&a7_0x1cfe8f(Box,{'flexDirection':'column','children':[a7_0x4bea94(Box,{'children':a7_0x1cfe8f(Text,{'color':_0x87877c(0x119),'children':['❌\x20',_0x381ffb]})}),_0x381ffb[_0x87877c(0x11c)]('登录')&&a7_0x1cfe8f(Box,{'marginTop':0x1,'children':[a7_0x4bea94(Text,{'color':_0x87877c(0x141),'children':'💡\x20请使用\x20'}),a7_0x4bea94(Text,{'color':_0x87877c(0x138),'children':_0x87877c(0x122)}),a7_0x4bea94(Text,{'color':_0x87877c(0x141),'children':_0x87877c(0x13d)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x1056a0,_0x2f5f4e){const _0x4ef780=a6_0x2ec2,_0x1024ee=_0x1056a0();while(!![]){try{const _0x2b4200=-parseInt(_0x4ef780(0x154))/0x1+parseInt(_0x4ef780(0x148))/0x2*(parseInt(_0x4ef780(0x15b))/0x3)+parseInt(_0x4ef780(0x157))/0x4+parseInt(_0x4ef780(0x14a))/0x5+parseInt(_0x4ef780(0x14d))/0x6+parseInt(_0x4ef780(0x151))/0x7*(-parseInt(_0x4ef780(0x159))/0x8)+parseInt(_0x4ef780(0x140))/0x9*(parseInt(_0x4ef780(0x13f))/0xa);if(_0x2b4200===_0x2f5f4e)break;else _0x1024ee['push'](_0x1024ee['shift']());}catch(_0x3c9bcf){_0x1024ee['push'](_0x1024ee['shift']());}}}(a6_0xb495,0x4e71e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x2ec2(_0x30e03a,_0x7c561f){_0x30e03a=_0x30e03a-0x13f;const _0xb4953e=a6_0xb495();let _0x2ec201=_0xb4953e[_0x30e03a];return _0x2ec201;}function a6_0xb495(){const _0x482ff9=['fetch-model-list','errorMsg','1451412vEeueH','获取数据集失败,HTTP状态码:\x20','code','info','8911dalyjU','count','configArray','313329iLIlwW','includes','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','444244vVtefk','error','2800NdGnYq','success','3rkSAJw','UNAUTHORIZED','190jRgOpW','248895ShdkDN','status','正在从服务器拉取模型列表...\x20(环境:\x20','/api/node-toolbox/dataset/model-list?appcode=','401','data','Unauthorized','errorMessage','186812oKEzgd','message','541875pHTNxo'];a6_0xb495=function(){return _0x482ff9;};return a6_0xb495();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x49cf2a){const _0x4ba4db=a6_0x2ec2,_0x652287=getEnv(),_0x384dc2=getApiDomain()+_0x4ba4db(0x143)+_0x49cf2a+'&otype=array';logger[_0x4ba4db(0x150)](_0x4ba4db(0x14b),_0x4ba4db(0x142)+_0x652287+')',{'apiUrl':_0x384dc2});const _0x43a007=await fetch(_0x384dc2,{'headers':{'Cookie':getCookie()}});if(!_0x43a007['ok']){if(_0x43a007['status']===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error(_0x4ba4db(0x14e)+_0x43a007[_0x4ba4db(0x141)]);}const _0x2bb6ac=await _0x43a007['json']();if(!_0x2bb6ac[_0x4ba4db(0x15a)]){const _0x32f00c=_0x2bb6ac[_0x4ba4db(0x14c)]||_0x2bb6ac['message']||_0x2bb6ac[_0x4ba4db(0x145)]?.[_0x4ba4db(0x149)]||_0x2bb6ac[_0x4ba4db(0x147)]||_0x2bb6ac[_0x4ba4db(0x158)]||'未知错误';if(_0x32f00c[_0x4ba4db(0x155)](_0x4ba4db(0x144))||_0x32f00c[_0x4ba4db(0x155)](_0x4ba4db(0x146))||_0x32f00c[_0x4ba4db(0x155)]('登录')||_0x32f00c[_0x4ba4db(0x155)]('认证')||_0x2bb6ac['errorCode']===_0x4ba4db(0x15c)||_0x2bb6ac[_0x4ba4db(0x14f)]===0x191||_0x2bb6ac['code']===_0x4ba4db(0x144))throw new Error(_0x4ba4db(0x156));throw new Error('获取数据集失败:\x20'+_0x32f00c);}return{'configArray':_0x2bb6ac[_0x4ba4db(0x145)][_0x4ba4db(0x153)],'count':_0x2bb6ac[_0x4ba4db(0x145)][_0x4ba4db(0x152)]};}
1
+ function a8_0x4230(){const _0x2d655c=['error','code','31199652Anzael','configArray','正在从服务器拉取模型列表...\x20(环境:\x20','success','Unauthorized','4MlMApa','count','401','&otype=array','errorCode','includes','2npMwon','1616523mMmikb','未知错误','360ffMYGo','11OgQMPx','errorMessage','message','423475OlKdGF','263496YhNroW','data','json','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','56TyoKVS','status','7933480HOYDGt','获取数据集失败,HTTP状态码:\x20','232236kijOTk','errorMsg','fetch-model-list','获取数据集失败:\x20','957845ckldEq'];a8_0x4230=function(){return _0x2d655c;};return a8_0x4230();}(function(_0x846dac,_0x2cf1d7){const _0x1cb61c=a8_0x3714,_0xdf20b4=_0x846dac();while(!![]){try{const _0x332bf1=parseInt(_0x1cb61c(0x1cd))/0x1*(parseInt(_0x1cb61c(0x1b9))/0x2)+-parseInt(_0x1cb61c(0x1ba))/0x3+parseInt(_0x1cb61c(0x1b3))/0x4*(parseInt(_0x1cb61c(0x1c0))/0x5)+-parseInt(_0x1cb61c(0x1c9))/0x6*(parseInt(_0x1cb61c(0x1c5))/0x7)+-parseInt(_0x1cb61c(0x1c1))/0x8*(parseInt(_0x1cb61c(0x1bc))/0x9)+-parseInt(_0x1cb61c(0x1c7))/0xa+-parseInt(_0x1cb61c(0x1bd))/0xb*(-parseInt(_0x1cb61c(0x1d0))/0xc);if(_0x332bf1===_0x2cf1d7)break;else _0xdf20b4['push'](_0xdf20b4['shift']());}catch(_0x469f11){_0xdf20b4['push'](_0xdf20b4['shift']());}}}(a8_0x4230,0xa6cba));function a8_0x3714(_0x816f14,_0x54d3a8){_0x816f14=_0x816f14-0x1b1;const _0x42309f=a8_0x4230();let _0x371443=_0x42309f[_0x816f14];return _0x371443;}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(_0x2fb883){const _0x4b43b0=a8_0x3714,_0x287347=getEnv(),_0x26a555=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x2fb883+_0x4b43b0(0x1b6);logger['info'](_0x4b43b0(0x1cb),_0x4b43b0(0x1d2)+_0x287347+')',{'apiUrl':_0x26a555});const _0x6082b1=await fetch(_0x26a555,{'headers':{'Cookie':getCookie()}});if(!_0x6082b1['ok']){if(_0x6082b1[_0x4b43b0(0x1c6)]===0x191)throw new Error(_0x4b43b0(0x1c4));throw new Error(_0x4b43b0(0x1c8)+_0x6082b1[_0x4b43b0(0x1c6)]);}const _0x5595b4=await _0x6082b1[_0x4b43b0(0x1c3)]();if(!_0x5595b4[_0x4b43b0(0x1b1)]){const _0x103520=_0x5595b4[_0x4b43b0(0x1ca)]||_0x5595b4[_0x4b43b0(0x1bf)]||_0x5595b4[_0x4b43b0(0x1c2)]?.[_0x4b43b0(0x1bf)]||_0x5595b4[_0x4b43b0(0x1be)]||_0x5595b4[_0x4b43b0(0x1ce)]||_0x4b43b0(0x1bb);if(_0x103520[_0x4b43b0(0x1b8)](_0x4b43b0(0x1b5))||_0x103520[_0x4b43b0(0x1b8)](_0x4b43b0(0x1b2))||_0x103520[_0x4b43b0(0x1b8)]('登录')||_0x103520[_0x4b43b0(0x1b8)]('认证')||_0x5595b4[_0x4b43b0(0x1b7)]==='UNAUTHORIZED'||_0x5595b4[_0x4b43b0(0x1cf)]===0x191||_0x5595b4['code']==='401')throw new Error(_0x4b43b0(0x1c4));throw new Error(_0x4b43b0(0x1cc)+_0x103520);}return{'configArray':_0x5595b4['data'][_0x4b43b0(0x1d1)],'count':_0x5595b4[_0x4b43b0(0x1c2)][_0x4b43b0(0x1b4)]};}
@@ -1 +1 @@
1
- const a7_0xf613ee=a7_0x3824;(function(_0xc0b040,_0xa1930a){const _0x9cc191=a7_0x3824,_0x4f8c0d=_0xc0b040();while(!![]){try{const _0x4f8f08=parseInt(_0x9cc191(0x149))/0x1*(-parseInt(_0x9cc191(0x138))/0x2)+-parseInt(_0x9cc191(0x151))/0x3*(parseInt(_0x9cc191(0x133))/0x4)+parseInt(_0x9cc191(0x148))/0x5+-parseInt(_0x9cc191(0x12f))/0x6+-parseInt(_0x9cc191(0x14a))/0x7+parseInt(_0x9cc191(0x141))/0x8+parseInt(_0x9cc191(0x145))/0x9;if(_0x4f8f08===_0xa1930a)break;else _0x4f8c0d['push'](_0x4f8c0d['shift']());}catch(_0x2c3aca){_0x4f8c0d['push'](_0x4f8c0d['shift']());}}}(a7_0x2039,0x24a02));import a7_0x9f1c77 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x4ea615 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x2039(){const _0x11e3ec=['client.ts.tpl','client','dirname','utf8','\x22\x20}','794856RuYqpK','./src/api/','app','join','6460137iiiCst','init-api','format','310155vSVUYH','58513IDTYyo','741048heLyVp','length','key','alias','forEach','{\x20apiConfigName:\x20','online','27CfUCFf','resolve','-api','typescript','templates/generate-api','name','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','1436700XJtQIB','.ts','push','tableName','118588fNTpKR','endsWith','success','replaceApiContent','slice','4MSvMlF','string',',\x20env:\x20\x22','env'];a7_0x2039=function(){return _0x11e3ec;};return a7_0x2039();}import{TemplateReplacer}from'../utils/template-replacer.js';function a7_0x3824(_0x505222,_0x291fde){_0x505222=_0x505222-0x12d;const _0x203962=a7_0x2039();let _0x38242f=_0x203962[_0x505222];return _0x38242f;}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x5edc0d,_0x69b61='',_0x2e4b18,_0x104c19=![],_0x58cb78,_0x321f91=a7_0xf613ee(0x142)){const _0x19c277=a7_0xf613ee,_0x431499=readConfig(),_0x167bae=_0x2e4b18||_0x431499?.[_0x19c277(0x143)];if(typeof _0x167bae!==_0x19c277(0x139)||!_0x167bae)throw new Error(_0x19c277(0x12e));const _0x425376=_0x104c19?'CONFIG_NAMES.DEFAULT':'\x22'+_0x167bae+'\x22',_0x28bae3=typeof _0x431499['env']===_0x19c277(0x139)?_0x431499[_0x19c277(0x13b)]:undefined,_0x28ee81=_0x58cb78||_0x28bae3||_0x19c277(0x150),_0x42a703=_0x28ee81!=='online';let _0x308e66;if(_0x104c19)_0x42a703?_0x308e66=_0x19c277(0x14f)+_0x425376+_0x19c277(0x13a)+_0x28ee81+_0x19c277(0x140):_0x308e66='';else{const _0x1211fe=_0x42a703?_0x19c277(0x13a)+_0x28ee81+'\x22':'';_0x308e66='{\x20apiConfigName:\x20\x22'+_0x167bae+'\x22'+_0x1211fe+'\x20}';}const _0x3e636a=_0x69b61?_0x69b61+_0x19c277(0x153):'api',_0x3c03c6=_0x69b61?_0x69b61+'-client':_0x19c277(0x13d),_0x112409=[];_0x5edc0d[_0x19c277(0x14e)](_0x45adb4=>{const _0x5dbec5=_0x19c277;_0x112409[_0x5dbec5(0x131)]({'datasetCode':_0x45adb4['datasetCode'],'tableName':_0x45adb4[_0x5dbec5(0x132)],'name':_0x45adb4[_0x5dbec5(0x12d)]||'','alias':_0x45adb4[_0x5dbec5(0x14d)]||_0x45adb4[_0x5dbec5(0x14c)]});});const _0x440ca1=fileURLToPath(import.meta.url),_0x1c6d73=a7_0x4ea615[_0x19c277(0x152)](a7_0x4ea615[_0x19c277(0x13e)](_0x440ca1),'../..'),_0x4d58b8=a7_0x4ea615[_0x19c277(0x144)](_0x1c6d73,_0x19c277(0x155)),_0x2de126=a7_0x4ea615['join'](_0x4d58b8,'api.ts.tpl'),_0x4021a4=a7_0x4ea615['join'](_0x4d58b8,_0x19c277(0x13c)),_0x5c05b3=_0x321f91[_0x19c277(0x134)]('/')?_0x321f91[_0x19c277(0x137)](0x0,-0x1):_0x321f91;mkdirSync(_0x5c05b3,{'recursive':!![]});const _0x18e920=_0x112409[0x0]?.['alias'],_0x1bed9d=readFileSync(_0x2de126,_0x19c277(0x13f)),_0x495759=TemplateReplacer[_0x19c277(0x136)](_0x1bed9d,_0x167bae,_0x112409,_0x18e920,_0x3e636a,_0x425376),_0x55a6e6=await a7_0x9f1c77[_0x19c277(0x147)](_0x495759,{'parser':_0x19c277(0x154)}),_0x52bb37=_0x5c05b3+'/'+_0x3e636a+_0x19c277(0x130);writeFileSync(_0x52bb37,_0x55a6e6,{'encoding':_0x19c277(0x13f)});const _0x257c1f=readFileSync(_0x4021a4,_0x19c277(0x13f)),_0x5a3e19=TemplateReplacer[_0x19c277(0x136)](_0x257c1f,_0x167bae,_0x112409,_0x18e920,_0x3e636a,_0x425376,_0x308e66),_0x1a8a60=await a7_0x9f1c77[_0x19c277(0x147)](_0x5a3e19,{'parser':_0x19c277(0x154)}),_0x5077b4=_0x5c05b3+'/'+_0x3c03c6+_0x19c277(0x130);writeFileSync(_0x5077b4,_0x1a8a60,{'encoding':'utf8'});const _0x3cddb3=_0x112409[_0x19c277(0x14b)];return logger[_0x19c277(0x135)](_0x19c277(0x146),'API\x20文件生成成功!',undefined,{'apiFile':_0x52bb37,'clientFile':_0x5077b4,'modelCount':_0x3cddb3,'configName':_0x425376}),{'modelCount':_0x3cddb3,'apiFilePath':_0x52bb37,'clientFilePath':_0x5077b4,'configName':_0x425376};}
1
+ const a9_0x229a84=a9_0xf39a;(function(_0x131aed,_0x4051da){const _0x2d2253=a9_0xf39a,_0xf518=_0x131aed();while(!![]){try{const _0x296882=parseInt(_0x2d2253(0x113))/0x1*(-parseInt(_0x2d2253(0x12c))/0x2)+-parseInt(_0x2d2253(0x12d))/0x3*(parseInt(_0x2d2253(0x109))/0x4)+-parseInt(_0x2d2253(0x130))/0x5+-parseInt(_0x2d2253(0x131))/0x6+-parseInt(_0x2d2253(0x119))/0x7+parseInt(_0x2d2253(0x124))/0x8*(-parseInt(_0x2d2253(0x135))/0x9)+parseInt(_0x2d2253(0x110))/0xa;if(_0x296882===_0x4051da)break;else _0xf518['push'](_0xf518['shift']());}catch(_0x46ccc4){_0xf518['push'](_0xf518['shift']());}}}(a9_0x55d7,0x22852));import a9_0x55acf3 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x10392a from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a9_0x55d7(){const _0xfef14f=['format','client.ts.tpl',',\x20env:\x20\x22','\x22\x20}','-api','94248BZraSc','CONFIG_NAMES.DEFAULT','{\x20apiConfigName:\x20','online','string','app','utf8','api','2tyTKFM','535611RBdUNH','api.ts.tpl','push','195005UGLrqL','385212lkVaiK','datasetCode','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','replaceApiContent','63MHivJy','../..','4qleuuP','endsWith','./src/api/','-client','dirname','typescript','.ts','6823770CMcAwv','templates/generate-api','alias','160435hQMBWs','forEach','client','env','init-api','resolve','114387esvkoH','join','tableName','name','slice','key'];a9_0x55d7=function(){return _0xfef14f;};return a9_0x55d7();}function a9_0xf39a(_0x1a8316,_0x2f52dc){_0x1a8316=_0x1a8316-0x109;const _0x55d715=a9_0x55d7();let _0xf39a95=_0x55d715[_0x1a8316];return _0xf39a95;}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x268b30,_0x28f988='',_0x3149a8,_0x13ac33=![],_0x3396ea,_0xebaa8c=a9_0x229a84(0x10b)){const _0x15d79b=a9_0x229a84,_0x39cda1=readConfig(),_0x1cea82=_0x3149a8||_0x39cda1?.[_0x15d79b(0x129)];if(typeof _0x1cea82!==_0x15d79b(0x128)||!_0x1cea82)throw new Error(_0x15d79b(0x133));const _0x14f545=_0x13ac33?_0x15d79b(0x125):'\x22'+_0x1cea82+'\x22',_0x559df1=typeof _0x39cda1[_0x15d79b(0x116)]===_0x15d79b(0x128)?_0x39cda1[_0x15d79b(0x116)]:undefined,_0xb6779c=_0x3396ea||_0x559df1||_0x15d79b(0x127),_0x83852a=_0xb6779c!=='online';let _0x3734b2;if(_0x13ac33)_0x83852a?_0x3734b2=_0x15d79b(0x126)+_0x14f545+_0x15d79b(0x121)+_0xb6779c+_0x15d79b(0x122):_0x3734b2='';else{const _0x1d4071=_0x83852a?_0x15d79b(0x121)+_0xb6779c+'\x22':'';_0x3734b2='{\x20apiConfigName:\x20\x22'+_0x1cea82+'\x22'+_0x1d4071+'\x20}';}const _0x45121a=_0x28f988?_0x28f988+_0x15d79b(0x123):_0x15d79b(0x12b),_0xa7016e=_0x28f988?_0x28f988+_0x15d79b(0x10c):_0x15d79b(0x115),_0x37a7c7=[];_0x268b30[_0x15d79b(0x114)](_0x17bb64=>{const _0x41d9ef=_0x15d79b;_0x37a7c7[_0x41d9ef(0x12f)]({'datasetCode':_0x17bb64[_0x41d9ef(0x132)],'tableName':_0x17bb64[_0x41d9ef(0x11b)],'name':_0x17bb64[_0x41d9ef(0x11c)]||'','alias':_0x17bb64[_0x41d9ef(0x112)]||_0x17bb64[_0x41d9ef(0x11e)]});});const _0x590055=fileURLToPath(import.meta.url),_0x2bf8dd=a9_0x10392a[_0x15d79b(0x118)](a9_0x10392a[_0x15d79b(0x10d)](_0x590055),_0x15d79b(0x136)),_0x276931=a9_0x10392a[_0x15d79b(0x11a)](_0x2bf8dd,_0x15d79b(0x111)),_0x3f3a49=a9_0x10392a[_0x15d79b(0x11a)](_0x276931,_0x15d79b(0x12e)),_0x2bc786=a9_0x10392a[_0x15d79b(0x11a)](_0x276931,_0x15d79b(0x120)),_0x1aaa03=_0xebaa8c[_0x15d79b(0x10a)]('/')?_0xebaa8c[_0x15d79b(0x11d)](0x0,-0x1):_0xebaa8c;mkdirSync(_0x1aaa03,{'recursive':!![]});const _0x340732=_0x37a7c7[0x0]?.['alias'],_0x276f7b=readFileSync(_0x3f3a49,'utf8'),_0x175e00=TemplateReplacer[_0x15d79b(0x134)](_0x276f7b,_0x1cea82,_0x37a7c7,_0x340732,_0x45121a,_0x14f545),_0x5ef34e=await a9_0x55acf3[_0x15d79b(0x11f)](_0x175e00,{'parser':_0x15d79b(0x10e)}),_0x508442=_0x1aaa03+'/'+_0x45121a+_0x15d79b(0x10f);writeFileSync(_0x508442,_0x5ef34e,{'encoding':'utf8'});const _0xeaa055=readFileSync(_0x2bc786,_0x15d79b(0x12a)),_0x266213=TemplateReplacer[_0x15d79b(0x134)](_0xeaa055,_0x1cea82,_0x37a7c7,_0x340732,_0x45121a,_0x14f545,_0x3734b2),_0x3af9a9=await a9_0x55acf3[_0x15d79b(0x11f)](_0x266213,{'parser':_0x15d79b(0x10e)}),_0x36ac97=_0x1aaa03+'/'+_0xa7016e+_0x15d79b(0x10f);writeFileSync(_0x36ac97,_0x3af9a9,{'encoding':_0x15d79b(0x12a)});const _0x1f0dc7=_0x37a7c7['length'];return logger['success'](_0x15d79b(0x117),'API\x20文件生成成功!',undefined,{'apiFile':_0x508442,'clientFile':_0x36ac97,'modelCount':_0x1f0dc7,'configName':_0x14f545}),{'modelCount':_0x1f0dc7,'apiFilePath':_0x508442,'clientFilePath':_0x36ac97,'configName':_0x14f545};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- function a8_0x5d35(_0x49c680,_0x140c73){_0x49c680=_0x49c680-0x182;const _0x12ff4d=a8_0x12ff();let _0x5d354b=_0x12ff4d[_0x49c680];return _0x5d354b;}(function(_0x3ac2a0,_0x4d6ac1){const _0x4a9bf3=a8_0x5d35,_0x45cf68=_0x3ac2a0();while(!![]){try{const _0x583f93=-parseInt(_0x4a9bf3(0x199))/0x1+-parseInt(_0x4a9bf3(0x1ac))/0x2+-parseInt(_0x4a9bf3(0x19b))/0x3+-parseInt(_0x4a9bf3(0x1ae))/0x4*(parseInt(_0x4a9bf3(0x1a9))/0x5)+parseInt(_0x4a9bf3(0x194))/0x6*(-parseInt(_0x4a9bf3(0x1a8))/0x7)+-parseInt(_0x4a9bf3(0x191))/0x8+parseInt(_0x4a9bf3(0x19c))/0x9*(parseInt(_0x4a9bf3(0x195))/0xa);if(_0x583f93===_0x4d6ac1)break;else _0x45cf68['push'](_0x45cf68['shift']());}catch(_0x3693eb){_0x45cf68['push'](_0x45cf68['shift']());}}}(a8_0x12ff,0x4ab30));import{jsx as a8_0x475a5d}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x12ff(){const _0x44432c=['output','!\x20请使用以下方式之一:','map','filter','请使用\x20--appcode\x20参数,例如:','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','object','flags','params','input','\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','log','isArray','env','2583352FUUXFn','Unknown\x20api\x20command:\x20','string','2043354ABejUh','130SyEnYu','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','split','86581SUpzLR','error','336216IjgPli','1522629mLEbTu','\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配置文件','datasetcode','×\x20--params\x20参数不是有效的\x20JSON\x20格式','parse','appcode','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x1b[0m','doc','trim','×\x20--datasetcode\x20参数不能为空','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','7vHXpTH','5CbAgTl','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','996580AoLSgQ','help','2131856qinjcB','length','❌\x20错误:不再支持位置参数方式','exit','\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文档','\x1b[90m*\x20使用配置的应用AppCode:\x20','message','join'];a8_0x12ff=function(){return _0x44432c;};return a8_0x12ff();}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x36670c){const _0x18a53c=a8_0x5d35,_0x46d58b=_0x36670c[_0x18a53c(0x18c)][0x1];if(_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x1ad)]){console[_0x18a53c(0x18e)](_0x18a53c(0x18d));return;}if(_0x46d58b==='pull'){_0x36670c[_0x18a53c(0x18c)][0x2]&&(console['error'](_0x18a53c(0x1b0)),console['log'](_0x18a53c(0x186)),console[_0x18a53c(0x18e)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x36670c['input'][0x2]),process[_0x18a53c(0x1b1)](0x1));const _0x277e2b=getConfigAppCode();let _0x4abf91=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x1a1)];const _0xc477ba=typeof _0x36670c[_0x18a53c(0x18a)]['env']===_0x18a53c(0x193)?_0x36670c['flags'][_0x18a53c(0x190)]:undefined,_0x120348=_0x36670c['flags']['output'];!_0x4abf91&&!_0x277e2b&&(console['error']('×\x20未配置\x20AppCode'),console['log'](_0x18a53c(0x183)),console[_0x18a53c(0x18e)](_0x18a53c(0x187)),console[_0x18a53c(0x18e)](_0x18a53c(0x196)),process[_0x18a53c(0x1b1)](0x1)),_0x4abf91&&_0x277e2b&&_0x4abf91===_0x277e2b&&(console[_0x18a53c(0x18e)](_0x18a53c(0x1b3)+_0x4abf91+'\x1b[0m'),console[_0x18a53c(0x18e)](_0x18a53c(0x197)),_0x4abf91=undefined),render(a8_0x475a5d(ApiPullUI,{'appCode':_0x4abf91,'env':_0xc477ba,'output':_0x120348}));}else{if(_0x46d58b===_0x18a53c(0x1a4)){_0x36670c[_0x18a53c(0x18c)][0x2]&&(console[_0x18a53c(0x19a)](_0x18a53c(0x1b0)),console['log'](_0x18a53c(0x186)),console['log'](_0x18a53c(0x1a2)+_0x36670c['input'][0x2]),process[_0x18a53c(0x1b1)](0x1));const _0x59f253=getConfigAppCode();let _0x586794=_0x36670c[_0x18a53c(0x18a)]['appcode'];const _0x3634e8=typeof _0x36670c['flags']['env']===_0x18a53c(0x193)?_0x36670c['flags'][_0x18a53c(0x190)]:undefined,_0x313b86=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x182)],_0xa8088e=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x18b)],_0x1e023a=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x19e)];!_0x586794&&!_0x59f253&&(console[_0x18a53c(0x19a)]('×\x20未配置\x20AppCode'),console[_0x18a53c(0x18e)](_0x18a53c(0x183)),console[_0x18a53c(0x18e)](_0x18a53c(0x187)),console[_0x18a53c(0x18e)](_0x18a53c(0x188)),process['exit'](0x1));_0x586794&&_0x59f253&&_0x586794===_0x59f253&&(console[_0x18a53c(0x18e)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x586794+_0x18a53c(0x1a3)),_0x586794=undefined);let _0x255433;if(_0xa8088e)try{_0x255433=JSON[_0x18a53c(0x1a0)](_0xa8088e),(typeof _0x255433!==_0x18a53c(0x189)||_0x255433===null||Array[_0x18a53c(0x18f)](_0x255433))&&(console[_0x18a53c(0x19a)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process['exit'](0x1));}catch(_0x229f2c){console[_0x18a53c(0x19a)](_0x18a53c(0x19f)),console[_0x18a53c(0x19a)]('\x20\x20错误:\x20'+(_0x229f2c instanceof Error?_0x229f2c[_0x18a53c(0x1b4)]:String(_0x229f2c))),process[_0x18a53c(0x1b1)](0x1);}let _0x531f33;_0x1e023a&&(_0x531f33=_0x1e023a[_0x18a53c(0x198)](',')[_0x18a53c(0x184)](_0x19f95f=>_0x19f95f[_0x18a53c(0x1a5)]())[_0x18a53c(0x185)](_0x58ebb9=>_0x58ebb9[_0x18a53c(0x1af)]>0x0),_0x531f33[_0x18a53c(0x1af)]===0x0&&(console[_0x18a53c(0x19a)](_0x18a53c(0x1a6)),process[_0x18a53c(0x1b1)](0x1)),console['log']('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x531f33[_0x18a53c(0x1b5)](',\x20')+'\x1b[0m')),render(a8_0x475a5d(ApiDocUI,{'appCode':_0x586794,'env':_0x3634e8,'output':_0x313b86,'extraParams':_0x255433,'datasetCodes':_0x531f33}));}else console['error'](_0x18a53c(0x192)+_0x46d58b),console[_0x18a53c(0x18e)]('Available\x20commands:'),console['log'](_0x18a53c(0x19d)),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0x18a53c(0x18e)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console['log'](''),console[_0x18a53c(0x18e)](_0x18a53c(0x1b2)),console[_0x18a53c(0x18e)](_0x18a53c(0x1ab)),console[_0x18a53c(0x18e)](_0x18a53c(0x1aa)),console[_0x18a53c(0x18e)](_0x18a53c(0x1a7)),process['exit'](0x1);}}
1
+ (function(_0x2235e4,_0x5d4767){const _0x21024f=a10_0x3fdf,_0x26c81=_0x2235e4();while(!![]){try{const _0x3965e1=parseInt(_0x21024f(0x145))/0x1*(parseInt(_0x21024f(0x163))/0x2)+-parseInt(_0x21024f(0x153))/0x3+parseInt(_0x21024f(0x146))/0x4+parseInt(_0x21024f(0x138))/0x5+parseInt(_0x21024f(0x13d))/0x6*(parseInt(_0x21024f(0x15c))/0x7)+parseInt(_0x21024f(0x15b))/0x8+-parseInt(_0x21024f(0x15f))/0x9*(parseInt(_0x21024f(0x167))/0xa);if(_0x3965e1===_0x5d4767)break;else _0x26c81['push'](_0x26c81['shift']());}catch(_0x515b53){_0x26c81['push'](_0x26c81['shift']());}}}(a10_0x255b,0xe12b5));import{jsx as a10_0x4c4d5c}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a10_0x3fdf(_0x1a2493,_0x345ae8){_0x1a2493=_0x1a2493-0x138;const _0x255b18=a10_0x255b();let _0x3fdf03=_0x255b18[_0x1a2493];return _0x3fdf03;}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x2fbeff){const _0x2ba6f7=a10_0x3fdf,_0x2152ed=_0x2fbeff[_0x2ba6f7(0x13b)][0x1];if(_0x2fbeff['flags'][_0x2ba6f7(0x16f)]){console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x139));return;}if(_0x2152ed===_0x2ba6f7(0x16c)){_0x2fbeff[_0x2ba6f7(0x13b)][0x2]&&(console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x142)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x166)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x150)+_0x2fbeff[_0x2ba6f7(0x13b)][0x2]),process[_0x2ba6f7(0x14b)](0x1));const _0x82e85d=getConfigAppCode();let _0x279bb4=_0x2fbeff[_0x2ba6f7(0x168)][_0x2ba6f7(0x141)];const _0x561d1a=typeof _0x2fbeff['flags'][_0x2ba6f7(0x14c)]===_0x2ba6f7(0x158)?_0x2fbeff['flags'][_0x2ba6f7(0x14c)]:undefined,_0x3dcd53=_0x2fbeff[_0x2ba6f7(0x168)][_0x2ba6f7(0x160)];!_0x279bb4&&!_0x82e85d&&(console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x143)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x162)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x15d)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x164)),process[_0x2ba6f7(0x14b)](0x1)),_0x279bb4&&_0x82e85d&&_0x279bb4===_0x82e85d&&(console['log'](_0x2ba6f7(0x144)+_0x279bb4+_0x2ba6f7(0x15e)),console[_0x2ba6f7(0x13a)]('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x279bb4=undefined),render(a10_0x4c4d5c(ApiPullUI,{'appCode':_0x279bb4,'env':_0x561d1a,'output':_0x3dcd53}));}else{if(_0x2152ed===_0x2ba6f7(0x14f)){_0x2fbeff[_0x2ba6f7(0x13b)][0x2]&&(console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x142)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x166)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x156)+_0x2fbeff[_0x2ba6f7(0x13b)][0x2]),process[_0x2ba6f7(0x14b)](0x1));const _0x5c0a68=getConfigAppCode();let _0x478782=_0x2fbeff[_0x2ba6f7(0x168)][_0x2ba6f7(0x141)];const _0x59a080=typeof _0x2fbeff['flags'][_0x2ba6f7(0x14c)]==='string'?_0x2fbeff[_0x2ba6f7(0x168)][_0x2ba6f7(0x14c)]:undefined,_0x4daedd=_0x2fbeff[_0x2ba6f7(0x168)][_0x2ba6f7(0x160)],_0x47b09a=_0x2fbeff[_0x2ba6f7(0x168)][_0x2ba6f7(0x149)],_0x297cf5=_0x2fbeff['flags'][_0x2ba6f7(0x14a)];!_0x478782&&!_0x5c0a68&&(console['error'](_0x2ba6f7(0x143)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x162)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x15d)),console['log'](_0x2ba6f7(0x16b)),process[_0x2ba6f7(0x14b)](0x1));_0x478782&&_0x5c0a68&&_0x478782===_0x5c0a68&&(console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x144)+_0x478782+_0x2ba6f7(0x15e)),_0x478782=undefined);let _0x95128e;if(_0x47b09a)try{_0x95128e=JSON[_0x2ba6f7(0x152)](_0x47b09a),(typeof _0x95128e!==_0x2ba6f7(0x13c)||_0x95128e===null||Array[_0x2ba6f7(0x16a)](_0x95128e))&&(console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x169)),process['exit'](0x1));}catch(_0x32ebfd){console[_0x2ba6f7(0x14d)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x15a)+(_0x32ebfd instanceof Error?_0x32ebfd[_0x2ba6f7(0x151)]:String(_0x32ebfd))),process['exit'](0x1);}let _0x2bee08;_0x297cf5&&(_0x2bee08=_0x297cf5[_0x2ba6f7(0x13f)](',')['map'](_0x2be37=>_0x2be37[_0x2ba6f7(0x165)]())[_0x2ba6f7(0x13e)](_0x892069=>_0x892069[_0x2ba6f7(0x154)]>0x0),_0x2bee08['length']===0x0&&(console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x14e)),process[_0x2ba6f7(0x14b)](0x1)),console['log'](_0x2ba6f7(0x140)+_0x2bee08[_0x2ba6f7(0x157)](',\x20')+_0x2ba6f7(0x15e))),render(a10_0x4c4d5c(ApiDocUI,{'appCode':_0x478782,'env':_0x59a080,'output':_0x4daedd,'extraParams':_0x95128e,'datasetCodes':_0x2bee08}));}else console[_0x2ba6f7(0x14d)](_0x2ba6f7(0x159)+_0x2152ed),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x16e)),console[_0x2ba6f7(0x13a)]('\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'](_0x2ba6f7(0x16d)),console[_0x2ba6f7(0x13a)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x147)),console[_0x2ba6f7(0x13a)](''),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x161)),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x155)),console[_0x2ba6f7(0x13a)]('\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)'),console[_0x2ba6f7(0x13a)](_0x2ba6f7(0x148)),process[_0x2ba6f7(0x14b)](0x1);}}function a10_0x255b(){const _0x2d1190=['请使用\x20--appcode\x20参数,例如:','10avkzEy','flags','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','isArray','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','pull','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','Available\x20commands:','help','4654335PxEdJt','\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','log','input','object','30fEUEVP','filter','split','\x1b[90m*\x20仅生成指定数据集的文档:\x20','appcode','❌\x20错误:不再支持位置参数方式','×\x20未配置\x20AppCode','\x1b[90m*\x20使用配置的应用AppCode:\x20','53JxaQLJ','8676LQXjlW','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','params','datasetcode','exit','env','error','×\x20--datasetcode\x20参数不能为空','doc','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','message','parse','573453wGJOLw','length','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','join','string','Unknown\x20api\x20command:\x20','\x20\x20错误:\x20','11797104xYAJWy','2510459YYTmAt','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x1b[0m','40791186XodJHZ','output','\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文档','!\x20请使用以下方式之一:','54526hkWnwK','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','trim'];a10_0x255b=function(){return _0x2d1190;};return a10_0x255b();}
@@ -1 +1 @@
1
- (function(_0x19ddbe,_0x4e8227){const _0x48ba45=a9_0x5dfb,_0x54c0ae=_0x19ddbe();while(!![]){try{const _0x464869=-parseInt(_0x48ba45(0x1d0))/0x1*(parseInt(_0x48ba45(0x1cb))/0x2)+-parseInt(_0x48ba45(0x1cc))/0x3+parseInt(_0x48ba45(0x1c3))/0x4*(parseInt(_0x48ba45(0x1d5))/0x5)+parseInt(_0x48ba45(0x1d3))/0x6+parseInt(_0x48ba45(0x1db))/0x7+-parseInt(_0x48ba45(0x1c8))/0x8+parseInt(_0x48ba45(0x1c6))/0x9;if(_0x464869===_0x4e8227)break;else _0x54c0ae['push'](_0x54c0ae['shift']());}catch(_0x9eedb0){_0x54c0ae['push'](_0x54c0ae['shift']());}}}(a9_0x338b,0x9e08b));function a9_0x338b(){const _0x6f5f22=['*\x20正在处理\x20','length','7136379rybSej','API\x20配置拉取成功:\x20','9736184mZzMrl','-api','.ts\x20-\x20模型配置文件','2JBndop','1020648gMLlgo','\x20\x20\x20•\x20','env','api','82139VFwVNS','create-api-pull','\x20个数据集,生成\x20','7643142nLjjnh','message','50YPWsnX','-client','trim','API\x20配置拉取异常:\x20','\x20个数据集...','log','98119AumXPn','*\x20开始生成\x20API\x20配置文件:','error','client','test','×\x20API\x20配置拉取异常:','string','√\x20成功拉取\x20','\x20个模型','82352dhnxKL'];a9_0x338b=function(){return _0x6f5f22;};return a9_0x338b();}function a9_0x5dfb(_0x11a9ce,_0x530b39){_0x11a9ce=_0x11a9ce-0x1c0;const _0x338baf=a9_0x338b();let _0x5dfbf1=_0x338baf[_0x11a9ce];return _0x5dfbf1;}import{readConfig}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 async function pullApiSilent(_0x665b97,_0x4002ee,_0x452fa3,_0x6258bc){const _0x4c7fc6=a9_0x5dfb;let _0xee62c4;try{const _0x885fec=_0x4002ee?.[_0x4c7fc6(0x1d7)]()||'';if(_0x885fec){const _0x5ef045=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5ef045[_0x4c7fc6(0x1df)](_0x885fec))return console[_0x4c7fc6(0x1dd)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x452fa3&&(_0xee62c4=process['cwd'](),process['chdir'](_0x452fa3));const _0x69bf6=readConfig(),_0x8ab2a1=typeof _0x69bf6['env']===_0x4c7fc6(0x1c0)?_0x69bf6[_0x4c7fc6(0x1ce)]:undefined,_0x106a8b=_0x6258bc||_0x8ab2a1||'online';initEnv(_0x106a8b),console['log']('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x106a8b+')');const {configArray:_0x5dc474}=await fetchModelList(_0x665b97),_0x3f27f6=_0x885fec?_0x885fec+_0x4c7fc6(0x1c9):_0x4c7fc6(0x1cf),_0x9d75fc=_0x885fec?_0x885fec+_0x4c7fc6(0x1d6):_0x4c7fc6(0x1de);console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1dc)),console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1cd)+_0x3f27f6+_0x4c7fc6(0x1ca)),console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1cd)+_0x9d75fc+'.ts\x20-\x20客户端实例文件'),console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1c4)+_0x5dc474[_0x4c7fc6(0x1c5)]+_0x4c7fc6(0x1d9));const _0x5e6476=await generateApiFile(_0x5dc474,_0x885fec,_0x665b97,!![],_0x106a8b);return console['log'](_0x4c7fc6(0x1c1)+_0x5dc474[_0x4c7fc6(0x1c5)]+_0x4c7fc6(0x1d2)+_0x5e6476['modelCount']+_0x4c7fc6(0x1c2)),_0x452fa3&&logger['info']('create-api-pull',_0x4c7fc6(0x1c7)+_0x665b97,{'projectPath':_0x452fa3,'appCode':_0x665b97,'datasetCount':_0x5dc474[_0x4c7fc6(0x1c5)],'filePrefix':_0x885fec}),!![];}catch(_0x25ecb6){const _0x30715a=_0x25ecb6 instanceof Error?_0x25ecb6[_0x4c7fc6(0x1d4)]:String(_0x25ecb6);return console[_0x4c7fc6(0x1dd)](_0x4c7fc6(0x1e0),_0x30715a),_0x452fa3&&logger[_0x4c7fc6(0x1dd)](_0x4c7fc6(0x1d1),_0x4c7fc6(0x1d8)+_0x30715a,{'appCode':_0x665b97,'projectPath':_0x452fa3}),![];}finally{_0xee62c4&&process['chdir'](_0xee62c4);}}
1
+ (function(_0x168da6,_0x28ff9d){const _0xe11cc5=a11_0x38c5,_0x184fde=_0x168da6();while(!![]){try{const _0xd1b43d=parseInt(_0xe11cc5(0x153))/0x1*(parseInt(_0xe11cc5(0x151))/0x2)+-parseInt(_0xe11cc5(0x150))/0x3*(-parseInt(_0xe11cc5(0x143))/0x4)+parseInt(_0xe11cc5(0x14f))/0x5*(parseInt(_0xe11cc5(0x168))/0x6)+-parseInt(_0xe11cc5(0x14e))/0x7+parseInt(_0xe11cc5(0x15b))/0x8*(-parseInt(_0xe11cc5(0x154))/0x9)+-parseInt(_0xe11cc5(0x14b))/0xa*(-parseInt(_0xe11cc5(0x165))/0xb)+-parseInt(_0xe11cc5(0x161))/0xc*(-parseInt(_0xe11cc5(0x167))/0xd);if(_0xd1b43d===_0x28ff9d)break;else _0x184fde['push'](_0x184fde['shift']());}catch(_0x17275b){_0x184fde['push'](_0x184fde['shift']());}}}(a11_0x13ba,0x4204d));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a11_0x13ba(){const _0x1c0f08=['17048khAXay','string','8bOQXoR','234uxvBGu','length','error','\x20\x20\x20•\x20','log','chdir','api','93848pGtARs','*\x20开始生成\x20API\x20配置文件:','-api','*\x20正在处理\x20','\x20个模型','trim','3968604ZCHucF','API\x20配置拉取异常:\x20','.ts\x20-\x20模型配置文件','test','836mrsTeb','create-api-pull','13hKkEig','348054iaojYO','online','136zBYGvS','client','√\x20成功拉取\x20','×\x20API\x20配置拉取异常:','.ts\x20-\x20客户端实例文件','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','info','env','3190dLJnYX','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cwd','757729qRtWgI','5CcXvcn','17868mKehGD'];a11_0x13ba=function(){return _0x1c0f08;};return a11_0x13ba();}import{fetchModelList}from'./fetch-model-list.js';function a11_0x38c5(_0x2850b3,_0x46fad0){_0x2850b3=_0x2850b3-0x142;const _0x13ba14=a11_0x13ba();let _0x38c5bf=_0x13ba14[_0x2850b3];return _0x38c5bf;}export async function pullApiSilent(_0x433892,_0x43e7f4,_0x4aa6d3,_0x24487e){const _0x54d012=a11_0x38c5;let _0x34662f;try{const _0x1ec345=_0x43e7f4?.[_0x54d012(0x160)]()||'';if(_0x1ec345){const _0x2bec3f=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x2bec3f[_0x54d012(0x164)](_0x1ec345))return console[_0x54d012(0x156)](_0x54d012(0x148)),![];}_0x4aa6d3&&(_0x34662f=process[_0x54d012(0x14d)](),process[_0x54d012(0x159)](_0x4aa6d3));const _0x1d84e1=readConfig(),_0x4b4cb7=typeof _0x1d84e1[_0x54d012(0x14a)]===_0x54d012(0x152)?_0x1d84e1['env']:undefined,_0x4989dd=_0x24487e||_0x4b4cb7||_0x54d012(0x142);initEnv(_0x4989dd),console[_0x54d012(0x158)](_0x54d012(0x14c)+_0x4989dd+')');const {configArray:_0x53d4fc}=await fetchModelList(_0x433892),_0x41a9e3=_0x1ec345?_0x1ec345+_0x54d012(0x15d):_0x54d012(0x15a),_0x32b275=_0x1ec345?_0x1ec345+'-client':_0x54d012(0x144);console[_0x54d012(0x158)](_0x54d012(0x15c)),console[_0x54d012(0x158)](_0x54d012(0x157)+_0x41a9e3+_0x54d012(0x163)),console[_0x54d012(0x158)]('\x20\x20\x20•\x20'+_0x32b275+_0x54d012(0x147)),console[_0x54d012(0x158)](_0x54d012(0x15e)+_0x53d4fc['length']+'\x20个数据集...');const _0x3218d5=await generateApiFile(_0x53d4fc,_0x1ec345,_0x433892,!![],_0x4989dd);return console[_0x54d012(0x158)](_0x54d012(0x145)+_0x53d4fc[_0x54d012(0x155)]+'\x20个数据集,生成\x20'+_0x3218d5['modelCount']+_0x54d012(0x15f)),_0x4aa6d3&&logger[_0x54d012(0x149)](_0x54d012(0x166),'API\x20配置拉取成功:\x20'+_0x433892,{'projectPath':_0x4aa6d3,'appCode':_0x433892,'datasetCount':_0x53d4fc[_0x54d012(0x155)],'filePrefix':_0x1ec345}),!![];}catch(_0x379fc2){const _0x3b05ca=_0x379fc2 instanceof Error?_0x379fc2['message']:String(_0x379fc2);return console[_0x54d012(0x156)](_0x54d012(0x146),_0x3b05ca),_0x4aa6d3&&logger[_0x54d012(0x156)](_0x54d012(0x166),_0x54d012(0x162)+_0x3b05ca,{'appCode':_0x433892,'projectPath':_0x4aa6d3}),![];}finally{_0x34662f&&process[_0x54d012(0x159)](_0x34662f);}}