@lovrabet/cli 1.3.0-beta.12 → 1.3.0-beta.14

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 (79) 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 -1
  5. package/lib/ai-setup/config.js +1 -1
  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/non-interactive.js +1 -1
  44. package/lib/create-app/task-finished.js +1 -1
  45. package/lib/create-app/task-loading.js +1 -1
  46. package/lib/create-app/task-running.js +1 -1
  47. package/lib/create-app/task-time.js +1 -1
  48. package/lib/create-app/use-copy-project-template.js +1 -1
  49. package/lib/create-app/use-format-code.js +1 -1
  50. package/lib/create-app/use-install-dependencies.js +1 -1
  51. package/lib/help.js +1 -1
  52. package/lib/init/main.js +1 -1
  53. package/lib/mcp/McpInstallUI.js +1 -1
  54. package/lib/mcp/claude.js +1 -1
  55. package/lib/mcp/cursor.js +1 -1
  56. package/lib/mcp/main.js +1 -1
  57. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  58. package/lib/mcp/mcp-installer.js +1 -1
  59. package/lib/skills/SkillInstallUI.js +1 -1
  60. package/lib/skills/main.js +1 -1
  61. package/lib/skills/skill-install-non-interactive.js +1 -1
  62. package/lib/skills/skill-installer.js +1 -1
  63. package/lib/ui/IDESelector.js +1 -1
  64. package/lib/ui/useIDESelection.js +1 -1
  65. package/lib/utils/ai_config.js +1 -1
  66. package/lib/utils/cdn-config.js +1 -0
  67. package/lib/utils/check-sdk-version.js +1 -1
  68. package/lib/utils/cli-version-check.js +1 -0
  69. package/lib/utils/config.js +1 -1
  70. package/lib/utils/copy-directory.js +1 -1
  71. package/lib/utils/file-utils.js +1 -1
  72. package/lib/utils/guides-cdn.js +1 -1
  73. package/lib/utils/http-client.js +1 -1
  74. package/lib/utils/logger.js +1 -1
  75. package/lib/utils/router-updater.js +1 -1
  76. package/lib/utils/rules-cdn.js +1 -1
  77. package/lib/utils/sleep.js +1 -1
  78. package/lib/utils/template-replacer.js +1 -1
  79. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x429f02,_0x40641d){const _0x444606=a0_0x3c65,_0x39ff1e=_0x429f02();while(!![]){try{const _0x3aa295=-parseInt(_0x444606(0x94))/0x1*(parseInt(_0x444606(0x7f))/0x2)+-parseInt(_0x444606(0x8a))/0x3*(parseInt(_0x444606(0x90))/0x4)+parseInt(_0x444606(0x8e))/0x5*(parseInt(_0x444606(0x81))/0x6)+-parseInt(_0x444606(0x86))/0x7*(parseInt(_0x444606(0x79))/0x8)+parseInt(_0x444606(0x7c))/0x9*(-parseInt(_0x444606(0x8f))/0xa)+parseInt(_0x444606(0x8b))/0xb+parseInt(_0x444606(0x83))/0xc*(parseInt(_0x444606(0x91))/0xd);if(_0x3aa295===_0x40641d)break;else _0x39ff1e['push'](_0x39ff1e['shift']());}catch(_0x4fa924){_0x39ff1e['push'](_0x39ff1e['shift']());}}}(a0_0x9bbf,0x9330d));import{jsx as a0_0x4a69cf,jsxs as a0_0x3dd217}from'react/jsx-runtime';import{useState}from'react';function a0_0x9bbf(){const _0x2cda84=['\x20Step2:\x20','backspace','2114325kIGZNJ','trim','\x20已存在,请使用其他路径','142HQlgVz','页面路由地址:\x20','7482oNZatp','column','48lwjxWU','页面路径\x20','endsWith','8330021JgTZcn','my-page','delete','length','9BIQyom','10010110XCJkJi','页面路径长度不能超过\x20100\x20个字符','路径不能以\x20/\x20开头或结尾','380XsYuzd','10sbxLou','1151252ZBTecN','7886138PAFURb','return','gray','7606RsWEYg','red','\x20←\x20','slice','页面路径不合法','existsSync','路径不能包含连续的\x20/','test','startsWith','8tOMJOH'];a0_0x9bbf=function(){return _0x2cda84;};return a0_0x9bbf();}import{Text,Box,useInput}from'ink';import a0_0x3a7a33 from'node:fs';function a0_0x3c65(_0x38a9bc,_0x144266){_0x38a9bc=_0x38a9bc-0x78;const _0x9bbfb7=a0_0x9bbf();let _0x3c654c=_0x9bbfb7[_0x38a9bc];return _0x3c654c;}export function InputProjectCode(_0x32a86d){const _0x44b0aa=a0_0x3c65,{onSubmit:_0x1be467,pagePath:_0x42c471}=_0x32a86d,[_0xa9650,_0x2e1496]=useState(''),[_0x337c8c,_0x30927d]=useState(''),_0x5605c3=_0x44b0aa(0x87);function _0x45bcb3(_0xf58828){const _0x9bdb0d=_0x44b0aa;if(_0xf58828[_0x9bdb0d(0x89)]>0x64)return{'valid':![],'message':_0x9bdb0d(0x8c)};if(_0xf58828[_0x9bdb0d(0x78)]('/')||_0xf58828[_0x9bdb0d(0x85)]('/'))return{'valid':![],'message':_0x9bdb0d(0x8d)};if(_0xf58828['includes']('//'))return{'valid':![],'message':_0x9bdb0d(0x9a)};const _0x1613cf=_0xf58828['split']('/');for(const _0xc8f87a of _0x1613cf){if(!_0xc8f87a)continue;const _0xc48913=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xc48913[_0x9bdb0d(0x9b)](_0xc8f87a))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x5ce6f0,_0x5ec759)=>{const _0x5f02e1=_0x44b0aa;if(_0x5ec759[_0x5f02e1(0x92)]){const _0x3b938f=_0xa9650[_0x5f02e1(0x7d)]()||_0x5605c3;if(_0x337c8c)return;const _0x2eb545=_0x42c471+'/'+_0x3b938f;if(a0_0x3a7a33[_0x5f02e1(0x99)](_0x2eb545)){_0x30927d(_0x5f02e1(0x84)+_0x3b938f+_0x5f02e1(0x7e));return;}_0x1be467(_0x3b938f),_0x2e1496(''),_0x30927d('');}else _0x5ec759[_0x5f02e1(0x7b)]||_0x5ec759[_0x5f02e1(0x88)]?_0x2e1496(_0x406dbc=>{const _0x22c183=_0x5f02e1,_0x38b86e=_0x406dbc[_0x22c183(0x97)](0x0,-0x1),{valid:_0x414688,message:_0x199494}=_0x45bcb3(_0x38b86e);return _0x30927d(_0x414688?'':_0x199494||_0x22c183(0x98)),_0x38b86e;}):_0x2e1496(_0x2663b5=>{const _0x2df372=_0x5f02e1,_0x371bdd=_0x2663b5+_0x5ce6f0,{valid:_0x3093d5,message:_0x9bbef7}=_0x45bcb3(_0x371bdd);return _0x30927d(_0x3093d5?'':_0x9bbef7||_0x2df372(0x98)),_0x371bdd;});}),a0_0x3dd217(Box,{'flexDirection':_0x44b0aa(0x82),'children':[a0_0x3dd217(Box,{'children':[a0_0x4a69cf(Text,{'color':_0x44b0aa(0x93),'children':_0x44b0aa(0x7a)}),a0_0x4a69cf(Text,{'children':_0x44b0aa(0x80)}),_0xa9650?a0_0x4a69cf(Text,{'color':'green','children':_0xa9650}):a0_0x4a69cf(Text,{'color':_0x44b0aa(0x93),'children':_0x5605c3}),_0x337c8c&&a0_0x3dd217(Text,{'color':_0x44b0aa(0x95),'children':[_0x44b0aa(0x96),_0x337c8c]})]}),!_0x337c8c&&!_0xa9650&&a0_0x4a69cf(Box,{'children':a0_0x4a69cf(Text,{'color':_0x44b0aa(0x93),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
1
+ function a0_0x599d(_0x252bec,_0x4d0f3f){_0x252bec=_0x252bec-0x1bb;const _0x4cbd68=a0_0x4cbd();let _0x599d86=_0x4cbd68[_0x252bec];return _0x599d86;}(function(_0x1295f0,_0x3e6554){const _0xd7010=a0_0x599d,_0x372cd7=_0x1295f0();while(!![]){try{const _0x4b4dd3=parseInt(_0xd7010(0x1c9))/0x1*(parseInt(_0xd7010(0x1c3))/0x2)+-parseInt(_0xd7010(0x1be))/0x3*(parseInt(_0xd7010(0x1c4))/0x4)+parseInt(_0xd7010(0x1d6))/0x5+-parseInt(_0xd7010(0x1db))/0x6*(-parseInt(_0xd7010(0x1da))/0x7)+-parseInt(_0xd7010(0x1cd))/0x8+-parseInt(_0xd7010(0x1cc))/0x9+parseInt(_0xd7010(0x1cf))/0xa;if(_0x4b4dd3===_0x3e6554)break;else _0x372cd7['push'](_0x372cd7['shift']());}catch(_0x459540){_0x372cd7['push'](_0x372cd7['shift']());}}}(a0_0x4cbd,0x90847));import{jsx as a0_0x35825f,jsxs as a0_0x4ba8d0}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0x4cbd(){const _0x3bdd96=['existsSync','页面路径长度不能超过\x20100\x20个字符','\x20←\x20','1296176MLOrPK','6CxocKj','includes','\x20已存在,请使用其他路径','页面路径\x20','my-page','6PTsXnC','\x20Step2:\x20','页面路径不合法','delete','gray','65544cLaGxw','2267120qIszqz','slice','column','\x20直接回车确认,或输入自定义路由地址','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','31iObdZV','length','路径不能包含连续的\x20/','3313449khaWUP','299848DoLzzo','split','4706640TulciU','return','green','endsWith','red','test','backspace','2296905ONXwIg'];a0_0x4cbd=function(){return _0x3bdd96;};return a0_0x4cbd();}import a0_0x1769cf from'node:fs';export function InputProjectCode(_0x567620){const _0xd619d6=a0_0x599d,{onSubmit:_0x5cb45b,pagePath:_0x1bbe06}=_0x567620,[_0x120ee1,_0x1cc84a]=useState(''),[_0x54e242,_0x22d871]=useState(''),_0x1dde98=_0xd619d6(0x1bd);function _0x493693(_0x4d3c01){const _0x4e4e89=_0xd619d6;if(_0x4d3c01[_0x4e4e89(0x1ca)]>0x64)return{'valid':![],'message':_0x4e4e89(0x1d8)};if(_0x4d3c01['startsWith']('/')||_0x4d3c01[_0x4e4e89(0x1d2)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x4d3c01[_0x4e4e89(0x1dc)]('//'))return{'valid':![],'message':_0x4e4e89(0x1cb)};const _0x3af7a4=_0x4d3c01[_0x4e4e89(0x1ce)]('/');for(const _0x10446e of _0x3af7a4){if(!_0x10446e)continue;const _0x1c9be9=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x1c9be9[_0x4e4e89(0x1d4)](_0x10446e))return{'valid':![],'message':_0x4e4e89(0x1c8)};}return{'valid':!![]};}return useInput((_0x29d4f7,_0x48b78b)=>{const _0x26fe90=_0xd619d6;if(_0x48b78b[_0x26fe90(0x1d0)]){const _0x3b2f9f=_0x120ee1['trim']()||_0x1dde98;if(_0x54e242)return;const _0x770802=_0x1bbe06+'/'+_0x3b2f9f;if(a0_0x1769cf[_0x26fe90(0x1d7)](_0x770802)){_0x22d871(_0x26fe90(0x1bc)+_0x3b2f9f+_0x26fe90(0x1bb));return;}_0x5cb45b(_0x3b2f9f),_0x1cc84a(''),_0x22d871('');}else _0x48b78b[_0x26fe90(0x1d5)]||_0x48b78b[_0x26fe90(0x1c1)]?_0x1cc84a(_0x5308f4=>{const _0x305c81=_0x26fe90,_0x2274b1=_0x5308f4[_0x305c81(0x1c5)](0x0,-0x1),{valid:_0x536ff8,message:_0x5cba35}=_0x493693(_0x2274b1);return _0x22d871(_0x536ff8?'':_0x5cba35||_0x305c81(0x1c0)),_0x2274b1;}):_0x1cc84a(_0x3456f8=>{const _0x4d3be3=_0x26fe90,_0x36a179=_0x3456f8+_0x29d4f7,{valid:_0x42c032,message:_0x30c6db}=_0x493693(_0x36a179);return _0x22d871(_0x42c032?'':_0x30c6db||_0x4d3be3(0x1c0)),_0x36a179;});}),a0_0x4ba8d0(Box,{'flexDirection':_0xd619d6(0x1c6),'children':[a0_0x4ba8d0(Box,{'children':[a0_0x35825f(Text,{'color':_0xd619d6(0x1c2),'children':_0xd619d6(0x1bf)}),a0_0x35825f(Text,{'children':'页面路由地址:\x20'}),_0x120ee1?a0_0x35825f(Text,{'color':_0xd619d6(0x1d1),'children':_0x120ee1}):a0_0x35825f(Text,{'color':_0xd619d6(0x1c2),'children':_0x1dde98}),_0x54e242&&a0_0x4ba8d0(Text,{'color':_0xd619d6(0x1d3),'children':[_0xd619d6(0x1d9),_0x54e242]})]}),!_0x54e242&&!_0x120ee1&&a0_0x35825f(Box,{'children':a0_0x35825f(Text,{'color':_0xd619d6(0x1c2),'children':_0xd619d6(0x1c7)})})]});}
@@ -1 +1 @@
1
- const a1_0x4d6fb3=a1_0x491d;(function(_0x265357,_0xa96ca){const _0x13df2f=a1_0x491d,_0x37ed83=_0x265357();while(!![]){try{const _0x11800d=parseInt(_0x13df2f(0x202))/0x1*(parseInt(_0x13df2f(0x1f4))/0x2)+parseInt(_0x13df2f(0x1f8))/0x3*(-parseInt(_0x13df2f(0x205))/0x4)+parseInt(_0x13df2f(0x1f7))/0x5+parseInt(_0x13df2f(0x201))/0x6+-parseInt(_0x13df2f(0x1ee))/0x7*(parseInt(_0x13df2f(0x200))/0x8)+parseInt(_0x13df2f(0x1ed))/0x9+parseInt(_0x13df2f(0x208))/0xa;if(_0x11800d===_0xa96ca)break;else _0x37ed83['push'](_0x37ed83['shift']());}catch(_0x1bc72b){_0x37ed83['push'](_0x37ed83['shift']());}}}(a1_0x1abc,0xab235));function a1_0x491d(_0x2b588a,_0x57dfa6){_0x2b588a=_0x2b588a-0x1ec;const _0x1abc99=a1_0x1abc();let _0x491d9f=_0x1abc99[_0x2b588a];return _0x491d9f;}import{jsx as a1_0xdea866,jsxs as a1_0xe54419,Fragment as a1_0x576a75}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x2d7e50 from'node:path';import{useEffect,useState}from'react';function a1_0x1abc(){const _0x5d6fa5=['已选择页面模板\x20','add-page','catch','\x20*\x20页面创建成功!','success','1832RjRjpH','362502JJEvbk','14475tOJxIv','../../templates/pages','dirname','5146052TFZTKt','\x20Step1:\x20','正在创建页面,请稍候…','6442080RNOuaK','开始添加页面:\x20','info','页面添加成功:\x20','error','then','\x20Step2:\x20','setLogPath','green','cyan','cwd','finally','8149905KyWUkJ','10409dbLkMb','join','页面添加失败:\x20','gray','column','now','74iITtsA','\x20*\x20页面文件已创建,可直接通过路由访问','resolve','911360IbGvSY','3hZtPUr','src','\x20*\x20路由地址:\x20'];a1_0x1abc=function(){return _0x5d6fa5;};return a1_0x1abc();}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x2d7e50[a1_0x4d6fb3(0x204)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x2d7e50[a1_0x4d6fb3(0x1f6)](__dirname,a1_0x4d6fb3(0x203)),projectDir=process['cwd']();export const AddPage=()=>{const _0x366bde=a1_0x4d6fb3,{exit:_0x409bcf}=useApp(),[_0x33cf09,_0x39cd89]=useState(''),[_0x3cec16,_0x13cb62]=useState(''),[_0x57a204,_0x503c97]=useState(![]),[_0x35e256,_0xb15fe1]=useState(![]),_0x5b763e=a1_0x2d7e50[_0x366bde(0x1ef)](projectDir,_0x366bde(0x1f9),'pages'),_0x251b9a=a1_0x2d7e50['join'](_0x5b763e,_0x3cec16),_0x2344ce=a1_0x2d7e50['join']('src','pages',_0x3cec16);useEffect(()=>{const _0xb8f1c1=_0x366bde,_0x39fea7=a1_0x2d7e50[_0xb8f1c1(0x1f6)](pageTemplateDir,_0x33cf09);if(_0x33cf09&&_0x3cec16){_0x503c97(!![]),logger[_0xb8f1c1(0x20f)](process[_0xb8f1c1(0x212)]());const _0x45589f=Date[_0xb8f1c1(0x1f3)]();logger[_0xb8f1c1(0x20a)](_0xb8f1c1(0x1fc),_0xb8f1c1(0x209)+_0x3cec16,{'template':_0x33cf09,'targetPath':_0x2344ce}),TemplateReplacer['processTemplate'](_0x39fea7,a1_0x2d7e50[_0xb8f1c1(0x1ef)](_0x5b763e,_0x3cec16),_0x3cec16,_0x33cf09)[_0xb8f1c1(0x20d)](()=>{const _0x15e60f=_0xb8f1c1,_0x5389c8=Date['now']()-_0x45589f;logger[_0x15e60f(0x1ff)](_0x15e60f(0x1fc),_0x15e60f(0x20b)+_0x3cec16,_0x5389c8,{'template':_0x33cf09,'targetPath':_0x2344ce,'routePath':_0x3cec16}),_0xb15fe1(!![]);})[_0xb8f1c1(0x1fd)](_0x19fd49=>{const _0x47422c=_0xb8f1c1,_0x2b6551=Date[_0x47422c(0x1f3)]()-_0x45589f;logger[_0x47422c(0x20c)]('add-page',_0x47422c(0x1f0)+_0x3cec16,{'template':_0x33cf09,'targetPath':_0x2344ce,'error':_0x19fd49 instanceof Error?_0x19fd49['message']:String(_0x19fd49),'duration':_0x2b6551});})[_0xb8f1c1(0x1ec)](()=>{_0x503c97(![]);});}},[_0x33cf09,_0x3cec16]),useEffect(()=>{_0x35e256&&setTimeout(()=>{_0x409bcf();});},[_0x35e256]);if(_0x33cf09)return a1_0xe54419(Box,{'flexDirection':_0x366bde(0x1f2),'paddingY':0x1,'children':[a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':_0x366bde(0x1f1),'children':_0x366bde(0x206)}),a1_0xdea866(Text,{'children':_0x366bde(0x1fb)}),a1_0xdea866(Text,{'color':_0x366bde(0x210),'children':_0x33cf09})]}),_0x3cec16?a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':'gray','children':_0x366bde(0x20e)}),a1_0xdea866(Text,{'children':'已输入的页面路由\x20'}),a1_0xdea866(Text,{'color':_0x366bde(0x210),'children':_0x3cec16})]}):a1_0xdea866(InputProjectCode,{'pagePath':_0x251b9a,'onSubmit':_0x13cb62}),_0x3cec16&&_0x57a204?a1_0xe54419(Box,{'marginTop':0x1,'children':[a1_0xdea866(Box,{'width':'4'}),a1_0xdea866(Text,{'children':_0x366bde(0x207)})]}):null,_0x35e256?a1_0xe54419(a1_0x576a75,{'children':[a1_0xdea866(Box,{'marginTop':0x1,'children':a1_0xdea866(Text,{'color':_0x366bde(0x1f1),'children':_0x366bde(0x1fe)})}),a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':'gray','children':'\x20*\x20页面路径:\x20'}),a1_0xdea866(Text,{'color':_0x366bde(0x210),'children':_0x2344ce})]}),a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':'gray','children':_0x366bde(0x1fa)}),a1_0xe54419(Text,{'color':_0x366bde(0x210),'children':['/',_0x3cec16]})]}),a1_0xdea866(Box,{'marginTop':0x1,'children':a1_0xdea866(Text,{'color':_0x366bde(0x211),'children':_0x366bde(0x1f5)})})]}):null]});return a1_0xdea866(SelectPageTemplate,{'onSelect':_0x39cd89});};
1
+ function a1_0x25fe(){const _0x13e187=['\x20*\x20页面创建成功!','319668mPcEJw','正在创建页面,请稍候…','69786lzJVhj','pages','add-page','catch','gray','resolve','2065491VYrYJg','green','315642igVlHy','已输入的页面路由\x20','32dxwmXN','join','297360XEbLDG','40OdPBjG','error','setLogPath','45MAxhEy','cwd','then','\x20*\x20页面路径:\x20','开始添加页面:\x20','processTemplate','success','info','16714rJmTCL','\x20*\x20路由地址:\x20','\x20Step1:\x20','src','115Tpkugl','now','已选择页面模板\x20','column','dirname','message','188650LcGhDt'];a1_0x25fe=function(){return _0x13e187;};return a1_0x25fe();}function a1_0x1ee8(_0x103a58,_0x1ab8cc){_0x103a58=_0x103a58-0xb8;const _0x25fef2=a1_0x25fe();let _0x1ee8a7=_0x25fef2[_0x103a58];return _0x1ee8a7;}const a1_0x3fc185=a1_0x1ee8;(function(_0x2afc46,_0x55aaf4){const _0x32c84b=a1_0x1ee8,_0x14a496=_0x2afc46();while(!![]){try{const _0x5dc3ce=parseInt(_0x32c84b(0xd1))/0x1+parseInt(_0x32c84b(0xbb))/0x2*(-parseInt(_0x32c84b(0xd9))/0x3)+-parseInt(_0x32c84b(0xc7))/0x4+-parseInt(_0x32c84b(0xbf))/0x5*(parseInt(_0x32c84b(0xc9))/0x6)+parseInt(_0x32c84b(0xd5))/0x7*(parseInt(_0x32c84b(0xd3))/0x8)+parseInt(_0x32c84b(0xcf))/0x9+parseInt(_0x32c84b(0xd6))/0xa*(-parseInt(_0x32c84b(0xc5))/0xb);if(_0x5dc3ce===_0x55aaf4)break;else _0x14a496['push'](_0x14a496['shift']());}catch(_0x3fe110){_0x14a496['push'](_0x14a496['shift']());}}}(a1_0x25fe,0x2a66c));import{jsx as a1_0x179856,jsxs as a1_0x276d2e,Fragment as a1_0x5ccaef}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x1938f2 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x1938f2[a1_0x3fc185(0xc3)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x1938f2[a1_0x3fc185(0xce)](__dirname,'../../templates/pages'),projectDir=process[a1_0x3fc185(0xda)]();export const AddPage=()=>{const _0x11e15a=a1_0x3fc185,{exit:_0x5a7065}=useApp(),[_0x51ab53,_0x430185]=useState(''),[_0x5c5f36,_0x532410]=useState(''),[_0x4afd76,_0x2c7747]=useState(![]),[_0x4c63f3,_0xed3dd0]=useState(![]),_0x51100b=a1_0x1938f2[_0x11e15a(0xd4)](projectDir,_0x11e15a(0xbe),_0x11e15a(0xca)),_0x1c3599=a1_0x1938f2[_0x11e15a(0xd4)](_0x51100b,_0x5c5f36),_0x5b1b76=a1_0x1938f2[_0x11e15a(0xd4)](_0x11e15a(0xbe),_0x11e15a(0xca),_0x5c5f36);useEffect(()=>{const _0x2d1735=_0x11e15a,_0xdecdd1=a1_0x1938f2[_0x2d1735(0xce)](pageTemplateDir,_0x51ab53);if(_0x51ab53&&_0x5c5f36){_0x2c7747(!![]),logger[_0x2d1735(0xd8)](process[_0x2d1735(0xda)]());const _0x210ff0=Date['now']();logger[_0x2d1735(0xba)](_0x2d1735(0xcb),_0x2d1735(0xdd)+_0x5c5f36,{'template':_0x51ab53,'targetPath':_0x5b1b76}),TemplateReplacer[_0x2d1735(0xb8)](_0xdecdd1,a1_0x1938f2[_0x2d1735(0xd4)](_0x51100b,_0x5c5f36),_0x5c5f36,_0x51ab53)[_0x2d1735(0xdb)](()=>{const _0x2929b1=_0x2d1735,_0x599a0b=Date[_0x2929b1(0xc0)]()-_0x210ff0;logger[_0x2929b1(0xb9)](_0x2929b1(0xcb),'页面添加成功:\x20'+_0x5c5f36,_0x599a0b,{'template':_0x51ab53,'targetPath':_0x5b1b76,'routePath':_0x5c5f36}),_0xed3dd0(!![]);})[_0x2d1735(0xcc)](_0x5e4f6c=>{const _0x322068=_0x2d1735,_0x393b69=Date[_0x322068(0xc0)]()-_0x210ff0;logger[_0x322068(0xd7)](_0x322068(0xcb),'页面添加失败:\x20'+_0x5c5f36,{'template':_0x51ab53,'targetPath':_0x5b1b76,'error':_0x5e4f6c instanceof Error?_0x5e4f6c[_0x322068(0xc4)]:String(_0x5e4f6c),'duration':_0x393b69});})['finally'](()=>{_0x2c7747(![]);});}},[_0x51ab53,_0x5c5f36]),useEffect(()=>{_0x4c63f3&&setTimeout(()=>{_0x5a7065();});},[_0x4c63f3]);if(_0x51ab53)return a1_0x276d2e(Box,{'flexDirection':_0x11e15a(0xc2),'paddingY':0x1,'children':[a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':_0x11e15a(0xbd)}),a1_0x179856(Text,{'children':_0x11e15a(0xc1)}),a1_0x179856(Text,{'color':'green','children':_0x51ab53})]}),_0x5c5f36?a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':'\x20Step2:\x20'}),a1_0x179856(Text,{'children':_0x11e15a(0xd2)}),a1_0x179856(Text,{'color':'green','children':_0x5c5f36})]}):a1_0x179856(InputProjectCode,{'pagePath':_0x1c3599,'onSubmit':_0x532410}),_0x5c5f36&&_0x4afd76?a1_0x276d2e(Box,{'marginTop':0x1,'children':[a1_0x179856(Box,{'width':'4'}),a1_0x179856(Text,{'children':_0x11e15a(0xc8)})]}):null,_0x4c63f3?a1_0x276d2e(a1_0x5ccaef,{'children':[a1_0x179856(Box,{'marginTop':0x1,'children':a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':_0x11e15a(0xc6)})}),a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':_0x11e15a(0xdc)}),a1_0x179856(Text,{'color':_0x11e15a(0xd0),'children':_0x5b1b76})]}),a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':'gray','children':_0x11e15a(0xbc)}),a1_0x276d2e(Text,{'color':_0x11e15a(0xd0),'children':['/',_0x5c5f36]})]}),a1_0x179856(Box,{'marginTop':0x1,'children':a1_0x179856(Text,{'color':'cyan','children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x179856(SelectPageTemplate,{'onSelect':_0x430185});};
@@ -1 +1 @@
1
- (function(_0x29c2b5,_0x48fe62){const _0x4ad78f=a2_0x334e,_0x5040a5=_0x29c2b5();while(!![]){try{const _0x1b1050=parseInt(_0x4ad78f(0xa6))/0x1+parseInt(_0x4ad78f(0xbb))/0x2+parseInt(_0x4ad78f(0x9f))/0x3*(parseInt(_0x4ad78f(0xa2))/0x4)+-parseInt(_0x4ad78f(0xa3))/0x5*(-parseInt(_0x4ad78f(0xb6))/0x6)+-parseInt(_0x4ad78f(0xa0))/0x7*(parseInt(_0x4ad78f(0xa1))/0x8)+-parseInt(_0x4ad78f(0xae))/0x9+-parseInt(_0x4ad78f(0x99))/0xa;if(_0x1b1050===_0x48fe62)break;else _0x5040a5['push'](_0x5040a5['shift']());}catch(_0x2757b6){_0x5040a5['push'](_0x5040a5['shift']());}}}(a2_0x3800,0xd7ad2));function a2_0x334e(_0x7ccb4b,_0x1cdaa9){_0x7ccb4b=_0x7ccb4b-0x99;const _0x3800d4=a2_0x3800();let _0x334e56=_0x3800d4[_0x7ccb4b];return _0x334e56;}import{jsx as a2_0xbc734d,jsxs as a2_0xbf692c}from'react/jsx-runtime';function a2_0x3800(){const _0x1c08cd=['1799522SkWedU','17834420cqeaqi','onSelect','filter','sdk-fetch','\x20Step1:\x20','templates/pages','6MqJQvM','7ktIrSu','10331800BAZMUK','2009076IkhKSJ','978570BTOxaE','dirname','error','1274363UyZidJ','gray','获取模板列表失败:','\x20\x20\x20\x20\x20\x20>\x20','column','map','localeCompare','downArrow','5312997TzLUgi','label','return','\x20\x20\x20\x20\x20\x20\x20\x20','../..','resolve','length','sort','42ZSiwIC','blank','isDirectory','upArrow','请选择您要创建的页面模板'];a2_0x3800=function(){return _0x1c08cd;};return a2_0x3800();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x14bb19 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x276f66=a2_0x334e;try{const _0x136d38=fileURLToPath(import.meta.url),_0x3c9149=a2_0x14bb19[_0x276f66(0xb3)](a2_0x14bb19[_0x276f66(0xa4)](_0x136d38),_0x276f66(0xb2)),_0x3285cb=a2_0x14bb19['join'](_0x3c9149,_0x276f66(0x9e)),_0x393a41=await readdir(_0x3285cb,{'withFileTypes':!![]}),_0x5307d9=_0x393a41[_0x276f66(0x9b)](_0x280f84=>_0x280f84[_0x276f66(0xb8)]())['map'](_0x21209f=>({'label':_0x21209f['name']}))[_0x276f66(0xb5)]((_0xed3140,_0x551686)=>_0xed3140[_0x276f66(0xaf)][_0x276f66(0xac)](_0x551686[_0x276f66(0xaf)]));return _0x5307d9;}catch(_0x51c981){return console[_0x276f66(0xa5)](_0x276f66(0xa8),_0x51c981),[{'label':_0x276f66(0xb7)},{'label':_0x276f66(0x9c)}];}}export function SelectPageTemplate(_0x54ff9d){const _0x55c354=a2_0x334e,[_0x3b139d,_0x3bf550]=useState(0x0),[_0x1f7ea6,_0x2287ad]=useState([]),[_0x3b4e7c,_0x5b9dc6]=useState(!![]);useEffect(()=>{async function _0x5a4bb8(){const _0x312eae=await getTemplateList();_0x2287ad(_0x312eae),_0x5b9dc6(![]);}_0x5a4bb8();},[]),useInput((_0x4b4eef,_0x5b1fd4)=>{const _0x347231=a2_0x334e;if(_0x3b4e7c)return;if(_0x5b1fd4[_0x347231(0xb0)]){const _0x5f696a=_0x1f7ea6[_0x3b139d];_0x5f696a&&_0x54ff9d[_0x347231(0x9a)](_0x5f696a[_0x347231(0xaf)]);}_0x5b1fd4[_0x347231(0xb9)]&&_0x3bf550(_0x3cbc8a=>_0x3cbc8a===0x0?_0x1f7ea6['length']-0x1:_0x3cbc8a-0x1),_0x5b1fd4[_0x347231(0xad)]&&_0x3bf550(_0xd04238=>_0xd04238===_0x1f7ea6[_0x347231(0xb4)]-0x1?0x0:_0xd04238+0x1);});if(_0x3b4e7c)return a2_0xbc734d(Box,{'flexDirection':_0x55c354(0xaa),'paddingY':0x1,'children':a2_0xbf692c(Box,{'children':[a2_0xbc734d(Text,{'color':_0x55c354(0xa7),'children':_0x55c354(0x9d)}),a2_0xbc734d(Text,{'children':'正在加载页面模板...'})]})});return a2_0xbf692c(Box,{'flexDirection':_0x55c354(0xaa),'paddingY':0x1,'children':[a2_0xbf692c(Box,{'children':[a2_0xbc734d(Text,{'color':_0x55c354(0xa7),'children':_0x55c354(0x9d)}),a2_0xbc734d(Text,{'children':_0x55c354(0xba)})]}),_0x1f7ea6[_0x55c354(0xab)]((_0xb0e867,_0x107188)=>{const _0x1e958d=_0x55c354,_0x2fca01=_0x107188===_0x3b139d,_0x563b3d=_0x2fca01?_0x1e958d(0xa9)+_0xb0e867['label']:_0x1e958d(0xb1)+_0xb0e867[_0x1e958d(0xaf)];return a2_0xbc734d(Box,{'children':a2_0xbc734d(Text,{'color':_0x2fca01?'green':undefined,'children':_0x563b3d})},_0x563b3d);})]});}
1
+ (function(_0x268d1c,_0x3af360){const _0x13837b=a2_0x110a,_0x8c6482=_0x268d1c();while(!![]){try{const _0x88aa60=parseInt(_0x13837b(0x1a0))/0x1+parseInt(_0x13837b(0x19a))/0x2+-parseInt(_0x13837b(0x19d))/0x3*(parseInt(_0x13837b(0x198))/0x4)+parseInt(_0x13837b(0x18b))/0x5+-parseInt(_0x13837b(0x18f))/0x6*(parseInt(_0x13837b(0x195))/0x7)+-parseInt(_0x13837b(0x190))/0x8+-parseInt(_0x13837b(0x1a4))/0x9*(-parseInt(_0x13837b(0x197))/0xa);if(_0x88aa60===_0x3af360)break;else _0x8c6482['push'](_0x8c6482['shift']());}catch(_0x4ce823){_0x8c6482['push'](_0x8c6482['shift']());}}}(a2_0x5083,0xea3bf));function a2_0x110a(_0x23ec26,_0x3390f7){_0x23ec26=_0x23ec26-0x188;const _0x50839d=a2_0x5083();let _0x110a35=_0x50839d[_0x23ec26];return _0x110a35;}import{jsx as a2_0x51c164,jsxs as a2_0x5dab53}from'react/jsx-runtime';function a2_0x5083(){const _0x229d41=['green','18Fvroku','downArrow','join','map','正在加载页面模板...','gray','length','sdk-fetch','1736795ZsVfme','upArrow','filter','localeCompare','1482DAwpor','10424880kjDQsL','../..','return','dirname','isDirectory','9793ZmPEAA','onSelect','8147860XzCwmP','39860dxkmGF','label','148780ZZGRLj','\x20\x20\x20\x20\x20\x20>\x20','获取模板列表失败:','342vYeUZL','column','name','1692775JIMvqv','resolve','\x20Step1:\x20'];a2_0x5083=function(){return _0x229d41;};return a2_0x5083();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x541af4 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2ebea9=a2_0x110a;try{const _0xb5cea=fileURLToPath(import.meta.url),_0x99227f=a2_0x541af4[_0x2ebea9(0x1a1)](a2_0x541af4[_0x2ebea9(0x193)](_0xb5cea),_0x2ebea9(0x191)),_0x438402=a2_0x541af4[_0x2ebea9(0x1a6)](_0x99227f,'templates/pages'),_0x17b1a4=await readdir(_0x438402,{'withFileTypes':!![]}),_0x480af0=_0x17b1a4[_0x2ebea9(0x18d)](_0x42064f=>_0x42064f[_0x2ebea9(0x194)]())['map'](_0x28c1db=>({'label':_0x28c1db[_0x2ebea9(0x19f)]}))['sort']((_0x41845c,_0x20ce21)=>_0x41845c[_0x2ebea9(0x199)][_0x2ebea9(0x18e)](_0x20ce21['label']));return _0x480af0;}catch(_0x378263){return console['error'](_0x2ebea9(0x19c),_0x378263),[{'label':'blank'},{'label':_0x2ebea9(0x18a)}];}}export function SelectPageTemplate(_0x198c1f){const _0x9f0bf2=a2_0x110a,[_0x206366,_0x360164]=useState(0x0),[_0x2f724d,_0xea5208]=useState([]),[_0x263859,_0x1c5e36]=useState(!![]);useEffect(()=>{async function _0x438e54(){const _0x1bb411=await getTemplateList();_0xea5208(_0x1bb411),_0x1c5e36(![]);}_0x438e54();},[]),useInput((_0x316011,_0x4d7cd6)=>{const _0x572be6=a2_0x110a;if(_0x263859)return;if(_0x4d7cd6[_0x572be6(0x192)]){const _0x3ed893=_0x2f724d[_0x206366];_0x3ed893&&_0x198c1f[_0x572be6(0x196)](_0x3ed893[_0x572be6(0x199)]);}_0x4d7cd6[_0x572be6(0x18c)]&&_0x360164(_0x26659c=>_0x26659c===0x0?_0x2f724d[_0x572be6(0x189)]-0x1:_0x26659c-0x1),_0x4d7cd6[_0x572be6(0x1a5)]&&_0x360164(_0x14e9ca=>_0x14e9ca===_0x2f724d['length']-0x1?0x0:_0x14e9ca+0x1);});if(_0x263859)return a2_0x51c164(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x5dab53(Box,{'children':[a2_0x51c164(Text,{'color':'gray','children':_0x9f0bf2(0x1a2)}),a2_0x51c164(Text,{'children':_0x9f0bf2(0x1a8)})]})});return a2_0x5dab53(Box,{'flexDirection':_0x9f0bf2(0x19e),'paddingY':0x1,'children':[a2_0x5dab53(Box,{'children':[a2_0x51c164(Text,{'color':_0x9f0bf2(0x188),'children':_0x9f0bf2(0x1a2)}),a2_0x51c164(Text,{'children':'请选择您要创建的页面模板'})]}),_0x2f724d[_0x9f0bf2(0x1a7)]((_0x13d54c,_0x5025be)=>{const _0x359c28=_0x9f0bf2,_0x197a81=_0x5025be===_0x206366,_0x3559c0=_0x197a81?_0x359c28(0x19b)+_0x13d54c[_0x359c28(0x199)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x13d54c[_0x359c28(0x199)];return a2_0x51c164(Box,{'children':a2_0x51c164(Text,{'color':_0x197a81?_0x359c28(0x1a3):undefined,'children':_0x3559c0})},_0x3559c0);})]});}
@@ -1 +1 @@
1
- function a3_0x3fe8(){const _0x433821=['done','skill-','opencode','push','success','[Y]\x20是,配置\x20AI\x20助手','技能包\x20(研发规范指南)','Cursor','[✓]','has','cursor','gray','error','23861qaUVbx','length','259032sdyrPh','appcode','1386160BKdPFu','MCP\x20服务器\x20(AI\x20访问数据集)','5934DwhTCA','Claude\x20Code','22AKsfmF','[\x20]','confirming','return','codex','mcp-','[N]\x20跳过,稍后手动配置','506871QJkDWs','green','915ELoBsJ','size','77MPkDoD','name','red','*\x20选择要配置的\x20IDE:','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','cyan','claude','add','upArrow','132544jMTmfO','filter','572526jEcmUp','trae','column','selecting','message','white','installing','projectRoot','delete','blue','map','请至少选择一个配置项','yellow','antigravity','downArrow','正在配置\x20AI\x20助手...','windsurf','9bnmpEV'];a3_0x3fe8=function(){return _0x433821;};return a3_0x3fe8();}const a3_0x3e245f=a3_0x3b04;(function(_0x2ca686,_0x421c59){const _0x4c4f1c=a3_0x3b04,_0x3351ee=_0x2ca686();while(!![]){try{const _0x221469=parseInt(_0x4c4f1c(0x114))/0x1+parseInt(_0x4c4f1c(0xf5))/0x2+parseInt(_0x4c4f1c(0x106))/0x3*(parseInt(_0x4c4f1c(0x116))/0x4)+parseInt(_0x4c4f1c(0x125))/0x5*(-parseInt(_0x4c4f1c(0x11a))/0x6)+parseInt(_0x4c4f1c(0x127))/0x7*(parseInt(_0x4c4f1c(0xf3))/0x8)+-parseInt(_0x4c4f1c(0x123))/0x9+parseInt(_0x4c4f1c(0x118))/0xa*(-parseInt(_0x4c4f1c(0x11c))/0xb);if(_0x221469===_0x421c59)break;else _0x3351ee['push'](_0x3351ee['shift']());}catch(_0x4f7f7d){_0x3351ee['push'](_0x3351ee['shift']());}}}(a3_0x3fe8,0x2a04c));import{jsx as a3_0x437e63,jsxs as a3_0x481274}from'react/jsx-runtime';import{useState,useEffect}from'react';function a3_0x3b04(_0x5aea4a,_0x5c616a){_0x5aea4a=_0x5aea4a-0xed;const _0x3fe8d1=a3_0x3fe8();let _0x3b04bc=_0x3fe8d1[_0x5aea4a];return _0x3b04bc;}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=[a3_0x3e245f(0x111),a3_0x3e245f(0xf0)],SKILL_IDE_LIST=[a3_0x3e245f(0x102),'claude','codebuddy',a3_0x3e245f(0x120),a3_0x3e245f(0x111),a3_0x3e245f(0x109),'qoder',a3_0x3e245f(0xf6),a3_0x3e245f(0x105),'agent'];export function AISetupUI({config:_0x181946,onComplete:_0x38c44b}){const _0x593640=a3_0x3e245f,{exit:_0x48a3d4}=useApp(),[_0xf3ace6,_0x25a7b1]=useState(_0x593640(0x11e)),[_0x33ce51,_0x3b7a94]=useState(0x0),[_0x5dcda8,_0x57963e]=useState(new Set([0x0,0x1])),[_0x4532c5,_0x230bef]=useState(new Set(SKILL_IDE_LIST[_0x593640(0xff)]((_0xbff63,_0x1713dc)=>_0x1713dc))),[_0x461165,_0x3e617e]=useState('');useEffect(()=>{!_0x181946['appcode']&&_0x38c44b({'mcpResults':[],'skillResults':[]});},[_0x181946[_0x593640(0x117)],_0x38c44b]),useInput((_0x577944,_0x31e4c7)=>{const _0x428643=_0x593640;if(_0xf3ace6===_0x428643(0x11e)){if(_0x577944==='y'||_0x577944==='Y'||_0x31e4c7['return']){_0x120439();return;}if(_0x577944==='n'||_0x577944==='N'){_0x38c44b({'mcpResults':[],'skillResults':[]});return;}if(_0x31e4c7[_0x428643(0x11f)]){_0x120439();return;}}if(_0xf3ace6==='selecting'){if(_0x31e4c7[_0x428643(0xf2)]){_0x3b7a94(_0x25bd77=>_0x25bd77>0x0?_0x25bd77-0x1:SKILL_IDE_LIST[_0x428643(0x115)]-0x1);return;}if(_0x31e4c7[_0x428643(0x103)]){_0x3b7a94(_0x1de1ec=>_0x1de1ec<SKILL_IDE_LIST[_0x428643(0x115)]-0x1?_0x1de1ec+0x1:0x0);return;}if(_0x577944==='\x20'){const _0x176379=_0x33ce51<MCP_IDE_LIST['length'];if(_0x176379){const _0x264d8c=new Set(_0x5dcda8);_0x264d8c[_0x428643(0x110)](_0x33ce51)?_0x264d8c['delete'](_0x33ce51):_0x264d8c['add'](_0x33ce51),_0x57963e(_0x264d8c);}else{const _0x9a2789=_0x33ce51-MCP_IDE_LIST[_0x428643(0x115)],_0x163ee8=new Set(_0x4532c5);_0x163ee8[_0x428643(0x110)](_0x9a2789)?_0x163ee8[_0x428643(0xfd)](_0x9a2789):_0x163ee8[_0x428643(0xf1)](_0x9a2789),_0x230bef(_0x163ee8);}return;}if(_0x577944==='a'||_0x577944==='A'){_0x57963e(new Set(MCP_IDE_LIST[_0x428643(0xff)]((_0x379bda,_0x13d0f4)=>_0x13d0f4))),_0x230bef(new Set(SKILL_IDE_LIST[_0x428643(0xff)]((_0x42d2b4,_0x47d555)=>_0x47d555)));return;}if(_0x577944==='q'||_0x577944==='Q'){_0x48a3d4();return;}if(_0x31e4c7[_0x428643(0x11f)]){if(_0x5dcda8[_0x428643(0x126)]===0x0&&_0x4532c5['size']===0x0){_0x3e617e(_0x428643(0x100));return;}_0x120439();return;}}if(_0xf3ace6===_0x428643(0x107)){_0x48a3d4();return;}});async function _0x120439(){const _0x18b1fb=_0x593640;_0x25a7b1(_0x18b1fb(0xfb));const _0x36f5b6=[],_0x2e46a2=[];for(const _0x4b98e9 of _0x5dcda8){const _0x4a88bb=MCP_IDE_LIST[_0x4b98e9];if(!_0x4a88bb)continue;try{const _0x2afdd8=await configureMcp(_0x4a88bb,_0x181946[_0x18b1fb(0xfc)]);_0x36f5b6[_0x18b1fb(0x10a)](_0x2afdd8);}catch(_0x5062ec){_0x36f5b6[_0x18b1fb(0x10a)]({'ide':MCP_IDE_CONFIGS[_0x4a88bb]?.[_0x18b1fb(0x128)]||_0x4a88bb,'status':_0x18b1fb(0x113),'message':_0x5062ec instanceof Error?_0x5062ec[_0x18b1fb(0xf9)]:String(_0x5062ec)});}}await copySharedSkills(_0x181946['projectRoot']);for(const _0x3bd2c9 of _0x4532c5){const _0x435725=SKILL_IDE_LIST[_0x3bd2c9];if(!_0x435725)continue;try{const _0x35930c=await installSkill(_0x435725,_0x181946[_0x18b1fb(0xfc)]);_0x2e46a2[_0x18b1fb(0x10a)](_0x35930c);}catch(_0x287a3f){_0x2e46a2['push']({'ide':SKILL_IDE_CONFIGS[_0x435725]?.[_0x18b1fb(0x128)]||_0x435725,'status':_0x18b1fb(0x113),'message':_0x287a3f instanceof Error?_0x287a3f['message']:String(_0x287a3f)});}}if(_0x2e46a2[_0x18b1fb(0x115)]>0x0){const _0xac2aec=_0x2e46a2[_0x18b1fb(0xf4)](_0x19300a=>_0x19300a['status']===_0x18b1fb(0x10b))[_0x18b1fb(0xff)](_0x8a3bf6=>_0x8a3bf6['ide']);_0xac2aec[_0x18b1fb(0x115)]>0x0&&createSkillManifest(_0x181946[_0x18b1fb(0xfc)],_0xac2aec);}_0x25a7b1(_0x18b1fb(0x107)),setTimeout(()=>{_0x38c44b({'mcpResults':_0x36f5b6,'skillResults':_0x2e46a2});},0xbb8);}if(_0xf3ace6===_0x593640(0x11e))return a3_0x481274(Box,{'flexDirection':_0x593640(0xf7),'marginTop':0x1,'children':[a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x437e63(Text,{'color':_0x593640(0xfa),'children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x437e63(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x437e63(Text,{'color':'gray','children':'•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集'})}),a3_0x437e63(Box,{'marginLeft':0x2,'children':a3_0x437e63(Text,{'color':_0x593640(0x112),'children':_0x593640(0xee)})}),a3_0x481274(Box,{'marginTop':0x1,'flexDirection':_0x593640(0xf7),'children':[a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':_0x593640(0x124),'children':_0x593640(0x10c)})}),a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':'gray','children':_0x593640(0x122)})}),a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':'dimColor','children':'Enter\x20默认:\x20是'})})]}),_0x461165&&a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x481274(Text,{'color':_0x593640(0x129),'children':['✗\x20',_0x461165]})})]});if(_0xf3ace6===_0x593640(0xf8))return a3_0x481274(Box,{'flexDirection':_0x593640(0xf7),'marginTop':0x1,'children':[a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':_0x593640(0xef),'bold':!![],'children':_0x593640(0xed)})}),_0x461165&&a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x481274(Text,{'color':_0x593640(0x129),'children':['✗\x20',_0x461165]})}),a3_0x481274(Box,{'marginTop':0x1,'flexDirection':_0x593640(0xf7),'children':[a3_0x437e63(Text,{'bold':!![],'color':_0x593640(0x101),'children':_0x593640(0x119)}),MCP_IDE_LIST['map']((_0x129945,_0x18145a)=>{const _0x2565b9=_0x593640,_0x1ae866=_0x33ce51===_0x18145a,_0xbd7f76=_0x5dcda8[_0x2565b9(0x110)](_0x18145a);return a3_0x437e63(Box,{'children':a3_0x481274(Text,{'backgroundColor':_0x1ae866?_0x2565b9(0xfe):undefined,'color':_0x1ae866?_0x2565b9(0xfa):undefined,'children':[_0xbd7f76?_0x2565b9(0x10f):'[\x20]','\x20',_0x129945===_0x2565b9(0x111)?'Cursor':_0x2565b9(0x11b)]})},_0x2565b9(0x121)+_0x129945);}),a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x437e63(Text,{'bold':!![],'color':_0x593640(0x101),'children':_0x593640(0x10d)})}),SKILL_IDE_LIST['map']((_0x37ff44,_0x2abcef)=>{const _0x369a0d=_0x593640,_0x27f08e=_0x2abcef+MCP_IDE_LIST[_0x369a0d(0x115)],_0x48d274=_0x33ce51===_0x27f08e,_0x3aac7f=_0x4532c5[_0x369a0d(0x110)](_0x27f08e);return a3_0x437e63(Box,{'children':a3_0x481274(Text,{'backgroundColor':_0x48d274?_0x369a0d(0xfe):undefined,'color':_0x48d274?'white':undefined,'children':[_0x3aac7f?_0x369a0d(0x10f):_0x369a0d(0x11d),'\x20',SKILL_IDE_CONFIGS[_0x37ff44]['name']]})},_0x369a0d(0x108)+_0x37ff44);}),a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x437e63(Text,{'color':_0x593640(0x112),'children':'↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认'})})]})]});if(_0xf3ace6===_0x593640(0xfb))return a3_0x437e63(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'children':_0x593640(0x104)})})});if(_0xf3ace6==='done')return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x3e245f(0x10e)},'claude':{'name':'Claude\x20Code'}};
1
+ const a3_0x2241ab=a3_0x277b;(function(_0x15e4e4,_0x487d5f){const _0x41a0b5=a3_0x277b,_0x503be9=_0x15e4e4();while(!![]){try{const _0x51df03=-parseInt(_0x41a0b5(0xa6))/0x1*(-parseInt(_0x41a0b5(0x8a))/0x2)+-parseInt(_0x41a0b5(0x7c))/0x3*(-parseInt(_0x41a0b5(0x99))/0x4)+-parseInt(_0x41a0b5(0x79))/0x5*(-parseInt(_0x41a0b5(0x95))/0x6)+parseInt(_0x41a0b5(0x92))/0x7*(parseInt(_0x41a0b5(0xaa))/0x8)+parseInt(_0x41a0b5(0x71))/0x9+parseInt(_0x41a0b5(0xa5))/0xa+-parseInt(_0x41a0b5(0xa3))/0xb;if(_0x51df03===_0x487d5f)break;else _0x503be9['push'](_0x503be9['shift']());}catch(_0x21cbc2){_0x503be9['push'](_0x503be9['shift']());}}}(a3_0x4037,0x71254));function a3_0x277b(_0x1f58e8,_0x1e664c){_0x1f58e8=_0x1f58e8-0x6f;const _0x40379a=a3_0x4037();let _0x277ba3=_0x40379a[_0x1f58e8];return _0x277ba3;}import{jsx as a3_0x1a4f88,jsxs as a3_0x325adf}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=[a3_0x2241ab(0x9f),a3_0x2241ab(0x97)],SKILL_IDE_LIST=[a3_0x2241ab(0xa7),a3_0x2241ab(0x97),a3_0x2241ab(0x9c),a3_0x2241ab(0xa1),'cursor',a3_0x2241ab(0x94),a3_0x2241ab(0xac),a3_0x2241ab(0xab),'windsurf',a3_0x2241ab(0x83)];function a3_0x4037(){const _0x5e8e3d=['cyan','delete','error','message','请至少选择一个配置项','confirming','length','57055wEHxhx','projectRoot','downArrow','2533686qawFmO','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','map','Claude\x20Code','gray','has','selecting','agent','Enter\x20默认:\x20是','size','[\x20]','是否同时配置\x20AI\x20助手?这将:','dimColor','upArrow','2pSVHsB','[N]\x20跳过,稍后手动配置','red','success','push','正在配置\x20AI\x20助手...','技能包\x20(研发规范指南)','appcode','91byRCSh','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','opencode','222jZpcZe','mcp-','claude','add','4Miptyk','return','installing','codebuddy','status','Cursor','cursor','column','codex','[✓]','31265498GjdPMX','name','5446080EmTWXi','701528vFTJmY','antigravity','done','MCP\x20服务器\x20(AI\x20访问数据集)','158024Hmxfkb','trae','qoder','white','yellow','blue','4824612JOOfxU'];a3_0x4037=function(){return _0x5e8e3d;};return a3_0x4037();}export function AISetupUI({config:_0x1ce80f,onComplete:_0xe78470}){const _0x30b0b3=a3_0x2241ab,{exit:_0xeee97e}=useApp(),[_0x3852f5,_0x39fac4]=useState(_0x30b0b3(0x77)),[_0x42f54d,_0x326871]=useState(0x0),[_0x18e892,_0x31393a]=useState(new Set([0x0,0x1])),[_0x3c4d88,_0x5229de]=useState(new Set(SKILL_IDE_LIST[_0x30b0b3(0x7e)]((_0xfd1f8a,_0x4275b1)=>_0x4275b1))),[_0x3ef242,_0x1f7636]=useState('');useEffect(()=>{const _0xc143ed=_0x30b0b3;!_0x1ce80f[_0xc143ed(0x91)]&&_0xe78470({'mcpResults':[],'skillResults':[]});},[_0x1ce80f[_0x30b0b3(0x91)],_0xe78470]),useInput((_0x5a96ae,_0xb5e8b4)=>{const _0x372493=_0x30b0b3;if(_0x3852f5==='confirming'){if(_0x5a96ae==='y'||_0x5a96ae==='Y'||_0xb5e8b4[_0x372493(0x9a)]){_0x43be42();return;}if(_0x5a96ae==='n'||_0x5a96ae==='N'){_0xe78470({'mcpResults':[],'skillResults':[]});return;}if(_0xb5e8b4['return']){_0x43be42();return;}}if(_0x3852f5===_0x372493(0x82)){if(_0xb5e8b4[_0x372493(0x89)]){_0x326871(_0x3fd91d=>_0x3fd91d>0x0?_0x3fd91d-0x1:SKILL_IDE_LIST[_0x372493(0x78)]-0x1);return;}if(_0xb5e8b4[_0x372493(0x7b)]){_0x326871(_0x381122=>_0x381122<SKILL_IDE_LIST[_0x372493(0x78)]-0x1?_0x381122+0x1:0x0);return;}if(_0x5a96ae==='\x20'){const _0x4c564a=_0x42f54d<MCP_IDE_LIST['length'];if(_0x4c564a){const _0x4830bb=new Set(_0x18e892);_0x4830bb[_0x372493(0x81)](_0x42f54d)?_0x4830bb[_0x372493(0x73)](_0x42f54d):_0x4830bb[_0x372493(0x98)](_0x42f54d),_0x31393a(_0x4830bb);}else{const _0x3ea063=_0x42f54d-MCP_IDE_LIST['length'],_0x12599e=new Set(_0x3c4d88);_0x12599e[_0x372493(0x81)](_0x3ea063)?_0x12599e[_0x372493(0x73)](_0x3ea063):_0x12599e[_0x372493(0x98)](_0x3ea063),_0x5229de(_0x12599e);}return;}if(_0x5a96ae==='a'||_0x5a96ae==='A'){_0x31393a(new Set(MCP_IDE_LIST[_0x372493(0x7e)]((_0x4d6e14,_0x5169b1)=>_0x5169b1))),_0x5229de(new Set(SKILL_IDE_LIST[_0x372493(0x7e)]((_0xcd864,_0x458b11)=>_0x458b11)));return;}if(_0x5a96ae==='q'||_0x5a96ae==='Q'){_0xeee97e();return;}if(_0xb5e8b4[_0x372493(0x9a)]){if(_0x18e892['size']===0x0&&_0x3c4d88[_0x372493(0x85)]===0x0){_0x1f7636(_0x372493(0x76));return;}_0x43be42();return;}}if(_0x3852f5==='done'){_0xeee97e();return;}});async function _0x43be42(){const _0x5962d1=_0x30b0b3;_0x39fac4('installing');const _0x445441=[],_0x244ace=[];for(const _0x4ef78f of _0x18e892){const _0x3c420d=MCP_IDE_LIST[_0x4ef78f];if(!_0x3c420d)continue;try{const _0x1194cb=await configureMcp(_0x3c420d,_0x1ce80f[_0x5962d1(0x7a)]);_0x445441[_0x5962d1(0x8e)](_0x1194cb);}catch(_0x58c202){_0x445441['push']({'ide':MCP_IDE_CONFIGS[_0x3c420d]?.[_0x5962d1(0xa4)]||_0x3c420d,'status':_0x5962d1(0x74),'message':_0x58c202 instanceof Error?_0x58c202[_0x5962d1(0x75)]:String(_0x58c202)});}}await copySharedSkills(_0x1ce80f[_0x5962d1(0x7a)]);for(const _0x22a308 of _0x3c4d88){const _0xef35a0=SKILL_IDE_LIST[_0x22a308];if(!_0xef35a0)continue;try{const _0xa731ba=await installSkill(_0xef35a0,_0x1ce80f[_0x5962d1(0x7a)]);_0x244ace[_0x5962d1(0x8e)](_0xa731ba);}catch(_0x1a0f93){_0x244ace['push']({'ide':SKILL_IDE_CONFIGS[_0xef35a0]?.[_0x5962d1(0xa4)]||_0xef35a0,'status':_0x5962d1(0x74),'message':_0x1a0f93 instanceof Error?_0x1a0f93[_0x5962d1(0x75)]:String(_0x1a0f93)});}}if(_0x244ace[_0x5962d1(0x78)]>0x0){const _0x4fa071=_0x244ace['filter'](_0x100ad4=>_0x100ad4[_0x5962d1(0x9d)]===_0x5962d1(0x8d))[_0x5962d1(0x7e)](_0x3dc5ab=>_0x3dc5ab['ide']);_0x4fa071[_0x5962d1(0x78)]>0x0&&createSkillManifest(_0x1ce80f[_0x5962d1(0x7a)],_0x4fa071);}_0x39fac4(_0x5962d1(0xa8)),setTimeout(()=>{_0xe78470({'mcpResults':_0x445441,'skillResults':_0x244ace});},0xbb8);}if(_0x3852f5===_0x30b0b3(0x77))return a3_0x325adf(Box,{'flexDirection':_0x30b0b3(0xa0),'marginTop':0x1,'children':[a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0xad),'children':_0x30b0b3(0x87)})}),a3_0x1a4f88(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':_0x30b0b3(0x7d)})}),a3_0x1a4f88(Box,{'marginLeft':0x2,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':_0x30b0b3(0x93)})}),a3_0x325adf(Box,{'marginTop':0x1,'flexDirection':_0x30b0b3(0xa0),'children':[a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':'green','children':'[Y]\x20是,配置\x20AI\x20助手'})}),a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':_0x30b0b3(0x8b)})}),a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x88),'children':_0x30b0b3(0x84)})})]}),_0x3ef242&&a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x325adf(Text,{'color':'red','children':['✗\x20',_0x3ef242]})})]});if(_0x3852f5===_0x30b0b3(0x82))return a3_0x325adf(Box,{'flexDirection':_0x30b0b3(0xa0),'marginTop':0x1,'children':[a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x72),'bold':!![],'children':'*\x20选择要配置的\x20IDE:'})}),_0x3ef242&&a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x325adf(Text,{'color':_0x30b0b3(0x8c),'children':['✗\x20',_0x3ef242]})}),a3_0x325adf(Box,{'marginTop':0x1,'flexDirection':_0x30b0b3(0xa0),'children':[a3_0x1a4f88(Text,{'bold':!![],'color':'yellow','children':_0x30b0b3(0xa9)}),MCP_IDE_LIST[_0x30b0b3(0x7e)]((_0xb8dba9,_0x1b7dc1)=>{const _0x2d7dee=_0x30b0b3,_0x549761=_0x42f54d===_0x1b7dc1,_0x280722=_0x18e892[_0x2d7dee(0x81)](_0x1b7dc1);return a3_0x1a4f88(Box,{'children':a3_0x325adf(Text,{'backgroundColor':_0x549761?_0x2d7dee(0x70):undefined,'color':_0x549761?_0x2d7dee(0xad):undefined,'children':[_0x280722?_0x2d7dee(0xa2):'[\x20]','\x20',_0xb8dba9===_0x2d7dee(0x9f)?_0x2d7dee(0x9e):_0x2d7dee(0x7f)]})},_0x2d7dee(0x96)+_0xb8dba9);}),a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x1a4f88(Text,{'bold':!![],'color':_0x30b0b3(0x6f),'children':_0x30b0b3(0x90)})}),SKILL_IDE_LIST[_0x30b0b3(0x7e)]((_0x4c7b16,_0x40157c)=>{const _0x39a5c8=_0x30b0b3,_0x4edcbd=_0x40157c+MCP_IDE_LIST[_0x39a5c8(0x78)],_0xc5a913=_0x42f54d===_0x4edcbd,_0x49e803=_0x3c4d88[_0x39a5c8(0x81)](_0x4edcbd);return a3_0x1a4f88(Box,{'children':a3_0x325adf(Text,{'backgroundColor':_0xc5a913?_0x39a5c8(0x70):undefined,'color':_0xc5a913?_0x39a5c8(0xad):undefined,'children':[_0x49e803?_0x39a5c8(0xa2):_0x39a5c8(0x86),'\x20',SKILL_IDE_CONFIGS[_0x4c7b16]['name']]})},'skill-'+_0x4c7b16);}),a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':'↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认'})})]})]});if(_0x3852f5===_0x30b0b3(0x9b))return a3_0x1a4f88(Box,{'flexDirection':_0x30b0b3(0xa0),'marginTop':0x1,'children':a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'children':_0x30b0b3(0x8f)})})});if(_0x3852f5===_0x30b0b3(0xa8))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x2241ab(0x9e)},'claude':{'name':a3_0x2241ab(0x7f)}};
@@ -1 +1 @@
1
- const a4_0x51f940=a4_0x3d57;(function(_0x718f79,_0x5aeb06){const _0x15752b=a4_0x3d57,_0x4bdfe8=_0x718f79();while(!![]){try{const _0x3773bb=-parseInt(_0x15752b(0x10c))/0x1*(parseInt(_0x15752b(0xef))/0x2)+-parseInt(_0x15752b(0x11b))/0x3*(parseInt(_0x15752b(0x10a))/0x4)+parseInt(_0x15752b(0xd7))/0x5*(-parseInt(_0x15752b(0xdf))/0x6)+parseInt(_0x15752b(0x121))/0x7*(parseInt(_0x15752b(0xe6))/0x8)+parseInt(_0x15752b(0xf5))/0x9*(parseInt(_0x15752b(0x10e))/0xa)+-parseInt(_0x15752b(0xed))/0xb*(parseInt(_0x15752b(0xde))/0xc)+parseInt(_0x15752b(0x105))/0xd;if(_0x3773bb===_0x5aeb06)break;else _0x4bdfe8['push'](_0x4bdfe8['shift']());}catch(_0x2c7ab5){_0x4bdfe8['push'](_0x4bdfe8['shift']());}}}(a4_0x2876,0x74bf9));function a4_0x2876(){const _0x272d52=['\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','请手动执行:\x20','2.0.0','.lovrabet','99yJWgAt','LOVRABET_ENV','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','env','创建\x20Cursor\x20Rules\x20文件','lovrabet-dataset','log','error','parse','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','复制\x20Cursor\x20Rules\x20文件失败','\x20\x20AppCode:\x20','不支持的\x20MCP\x20IDE:\x20','isDirectory','创建\x20agents.md\x20文件','15440568HYPVPw','utf-8','info','cwd','rules','12zWMThs','mcpServers','2WrBGHy','manual','580660jXTjhK','map','Cursor','mcp-install','共享技能文件复制成功','\x20\x20}','npx','已写入\x20.cursor/mcp.json','创建技能包\x20manifest','复制\x20agents.md\x20文件失败','Claude\x20Code\x20MCP\x20命令已生成','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20\x20\x20}','715389jNWGee','mcp.json','\x22:\x20{','agents.md','name','.cursor','88018aCVOug','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','app','join','共享技能文件复制失败','message','stringify','\x20\x20\x20\x20\x22','appcode','85795qjvcqO','Claude\x20Code','配置信息:','Cursor\x20MCP\x20配置失败','Cursor\x20MCP\x20配置成功','cursor','已创建\x20','348FuhPzI','150coyfQh','../../cdn-source/skills','配置指引已显示','\x20-e\x20LOVRABET_APP_CODE=','.lovrabet/skill/.shared','需要先配置\x20appcode','skill-install','136BUTJxp','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.lovrabet/skill-manifest.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','@lovrabet/dataset-mcp-server@latest','online','其他\x20IDE\x20配置指引已显示','18799ZrGbWd','success','368094FkLPOM','lovrabet_rules.mdc'];a4_0x2876=function(){return _0x272d52;};return a4_0x2876();}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';function a4_0x3d57(_0x2ebca1,_0x57d9a3){_0x2ebca1=_0x2ebca1-0xd1;const _0x287676=a4_0x2876();let _0x3d5780=_0x287676[_0x2ebca1];return _0x3d5780;}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x51f940(0xfa),MCP_COMMAND=a4_0x51f940(0x114),MCP_ARGS=[a4_0x51f940(0xea)];export function buildEnvConfig(_0x47aed3,_0x5708a6){const _0x2c1479=a4_0x51f940,_0x4f9742={'LOVRABET_APP_CODE':String(_0x47aed3)};return _0x5708a6!==_0x2c1479(0xeb)&&(_0x4f9742[_0x2c1479(0xf6)]=String(_0x5708a6)),_0x4f9742;}export async function configureCursorMcp(_0x1c5ab8){const _0x2c62f3=a4_0x51f940,_0x55d51a=_0x1c5ab8||process[_0x2c62f3(0x108)](),_0x4d149e=readConfig(_0x55d51a),_0x3efbd7=_0x4d149e['appcode']||_0x4d149e[_0x2c62f3(0x123)],_0xa58114=_0x4d149e[_0x2c62f3(0xf8)]||'online';if(!_0x3efbd7)return{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x2c62f3(0xe4)};const _0x14eeb5=buildEnvConfig(_0x3efbd7,_0xa58114),_0x2ad869={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x14eeb5},_0x43bdb5=join(_0x55d51a,_0x2c62f3(0x120),_0x2c62f3(0x11c)),_0x2c4d4c=join(_0x55d51a,_0x2c62f3(0x120));try{!existsSync(_0x2c4d4c)&&mkdirSync(_0x2c4d4c,{'recursive':!![]});let _0x5f1911={'mcpServers':{}};if(existsSync(_0x43bdb5)){const _0x5ab731=readFileSync(_0x43bdb5,_0x2c62f3(0x106));_0x5f1911=JSON[_0x2c62f3(0xfd)](_0x5ab731);}return(!_0x5f1911[_0x2c62f3(0x10b)]||typeof _0x5f1911[_0x2c62f3(0x10b)]!=='object')&&(_0x5f1911[_0x2c62f3(0x10b)]={}),_0x5f1911[_0x2c62f3(0x10b)][MCP_SERVER_NAME]=_0x2ad869,writeFileSync(_0x43bdb5,JSON['stringify'](_0x5f1911,null,0x2),_0x2c62f3(0x106)),logger[_0x2c62f3(0x107)](_0x2c62f3(0x111),_0x2c62f3(0xdb),{'appcode':_0x3efbd7,'env':_0xa58114,'path':_0x43bdb5}),await copyCursorRules(_0x2c4d4c),{'ide':'Cursor','status':'success','message':_0x2c62f3(0x115)};}catch(_0x1f3018){return logger[_0x2c62f3(0xfc)](_0x2c62f3(0x111),_0x2c62f3(0xda),{'error':_0x1f3018 instanceof Error?_0x1f3018['message']:String(_0x1f3018)}),{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x1f3018 instanceof Error?_0x1f3018[_0x2c62f3(0xd3)]:String(_0x1f3018)};}}export async function configureClaudeMcp(_0x16d406){const _0x4d452b=a4_0x51f940,_0x35da94=_0x16d406||process[_0x4d452b(0x108)](),_0x5f3ab2=readConfig(_0x35da94),_0x461f56=_0x5f3ab2[_0x4d452b(0xd6)]||_0x5f3ab2['app'],_0x5f3416=_0x5f3ab2[_0x4d452b(0xf8)]||_0x4d452b(0xeb);if(!_0x461f56)return{'ide':_0x4d452b(0xd8),'status':'error','message':'需要先配置\x20appcode'};let _0x19b8ae='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x4d452b(0xd1)]('\x20')+_0x4d452b(0xe2)+_0x461f56;return _0x5f3416!==_0x4d452b(0xeb)&&(_0x19b8ae+='\x20-e\x20LOVRABET_ENV='+_0x5f3416),await copyAgentsMd(_0x35da94),logger[_0x4d452b(0x107)](_0x4d452b(0x111),_0x4d452b(0x118),{'command':_0x19b8ae,'appcode':_0x461f56,'env':_0x5f3416}),console[_0x4d452b(0xfb)](_0x4d452b(0x119)),console[_0x4d452b(0xfb)]('\x20\x20'+_0x19b8ae+'\x0a'),console[_0x4d452b(0xfb)](_0x4d452b(0xd9)),console[_0x4d452b(0xfb)](_0x4d452b(0x101)+_0x461f56),_0x5f3416!=='online'&&console[_0x4d452b(0xfb)]('\x20\x20环境:\x20'+_0x5f3416),console[_0x4d452b(0xfb)](_0x4d452b(0xfe)),{'ide':'Claude\x20Code','status':_0x4d452b(0x10d),'message':_0x4d452b(0xf2)+_0x19b8ae};}export async function showOtherGuide(_0xb9889){const _0x1f5445=a4_0x51f940,_0x25b259=_0xb9889||process[_0x1f5445(0x108)](),_0x56b3c5=readConfig(_0x25b259),_0x1c368a=_0x56b3c5[_0x1f5445(0xd6)]||_0x56b3c5['app'],_0x4bafdd=_0x56b3c5[_0x1f5445(0xf8)]||_0x1f5445(0xeb);if(!_0x1c368a)return{'ide':'其他','status':_0x1f5445(0xfc),'message':_0x1f5445(0xe4)};return console['log'](_0x1f5445(0x122)),console[_0x1f5445(0xfb)]('{'),console[_0x1f5445(0xfb)]('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x1f5445(0xfb)](_0x1f5445(0xd5)+MCP_SERVER_NAME+_0x1f5445(0x11d)),console[_0x1f5445(0xfb)](_0x1f5445(0xf1)+MCP_COMMAND+'\x22,'),console[_0x1f5445(0xfb)](_0x1f5445(0xe7)+MCP_ARGS[_0x1f5445(0x10f)](_0x46a98b=>'\x22'+_0x46a98b+'\x22')['join'](',\x20')+'],'),console[_0x1f5445(0xfb)](_0x1f5445(0xf7)),console[_0x1f5445(0xfb)](_0x1f5445(0xe9)+_0x1c368a+'\x22,'),_0x4bafdd!=='online'&&console['log'](_0x1f5445(0xff)+_0x4bafdd+'\x22,'),console[_0x1f5445(0xfb)]('\x20\x20\x20\x20\x20\x20}'),console[_0x1f5445(0xfb)](_0x1f5445(0x11a)),console[_0x1f5445(0xfb)](_0x1f5445(0x113)),console[_0x1f5445(0xfb)]('}\x0a'),logger[_0x1f5445(0x107)]('mcp-install',_0x1f5445(0xec),{'appcode':_0x1c368a,'env':_0x4bafdd}),{'ide':'其他','status':_0x1f5445(0x10d),'message':_0x1f5445(0xe1)};}export async function configureMcp(_0x8586bf,_0x29e61f){const _0x1afbdd=a4_0x51f940;switch(_0x8586bf){case _0x1afbdd(0xdc):return await configureCursorMcp(_0x29e61f);case'claude':return await configureClaudeMcp(_0x29e61f);default:throw new Error(_0x1afbdd(0x102)+_0x8586bf);}}async function copyCursorRules(_0xf6cc8c){const _0x21a9f6=a4_0x51f940,_0x277b85=join(_0xf6cc8c,_0x21a9f6(0x109)),_0x38909f=join(_0x277b85,_0x21a9f6(0xf0));if(existsSync(_0x38909f))return;try{!existsSync(_0x277b85)&&mkdirSync(_0x277b85,{'recursive':!![]});const _0x206a18=await getRulesContent();writeFileSync(_0x38909f,_0x206a18,_0x21a9f6(0x106)),logger[_0x21a9f6(0x107)]('mcp-install',_0x21a9f6(0xf9),{'to':_0x38909f});}catch(_0x2a0c80){logger['error']('mcp-install',_0x21a9f6(0x100),{'error':_0x2a0c80 instanceof Error?_0x2a0c80[_0x21a9f6(0xd3)]:String(_0x2a0c80)});}}async function copyAgentsMd(_0x33315d){const _0x55f255=a4_0x51f940,_0x9b3048=join(_0x33315d,_0x55f255(0x11e));if(existsSync(_0x9b3048))return;try{const _0x1c6d1e=await getRulesContent();writeFileSync(_0x9b3048,_0x1c6d1e,_0x55f255(0x106)),logger[_0x55f255(0x107)]('mcp-install',_0x55f255(0x104),{'to':_0x9b3048});}catch(_0x70cbfc){logger[_0x55f255(0xfc)](_0x55f255(0x111),_0x55f255(0x117),{'error':_0x70cbfc instanceof Error?_0x70cbfc['message']:String(_0x70cbfc)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x169ccf,_0x1e77bc){const _0x4020f7=a4_0x51f940,_0x53a33f=_0x1e77bc||process[_0x4020f7(0x108)](),_0x35ae02=resolve(__dirname,_0x4020f7(0xe0)),_0x2d50fe=SKILL_IDE_CONFIGS[_0x169ccf];if(!_0x2d50fe)return{'ide':_0x169ccf,'status':_0x4020f7(0xfc),'message':'未知的\x20IDE:\x20'+_0x169ccf};const _0x5326f7=_0x2d50fe[_0x4020f7(0x11f)];try{let _0x186dca;try{_0x186dca=await fetchGuidesFromCDN();}catch{}const _0x4df3d8=await installSingleIDE(_0x169ccf,_0x2d50fe,_0x53a33f,_0x35ae02,_0x186dca);return _0x186dca&&writeGuidesToProject(_0x186dca,_0x53a33f),logger['info'](_0x4020f7(0xe5),_0x5326f7+'\x20技能包安装成功',{'ide':_0x169ccf,'filesCount':_0x4df3d8}),{'ide':_0x5326f7,'status':_0x4020f7(0xee),'message':_0x4020f7(0xdd)+_0x4df3d8+'\x20项'};}catch(_0x26b2c6){return logger['error']('skill-install',_0x5326f7+'\x20技能包安装失败',{'error':_0x26b2c6 instanceof Error?_0x26b2c6['message']:String(_0x26b2c6)}),{'ide':_0x5326f7,'status':_0x4020f7(0xfc),'message':_0x26b2c6 instanceof Error?_0x26b2c6[_0x4020f7(0xd3)]:String(_0x26b2c6)};}}async function copyDir(_0x96e42b,_0x30671a){const _0x335f25=a4_0x51f940,{statSync:_0x499c8b}=await import('node:fs'),{readdirSync:_0x2f4797}=await import('node:fs'),_0x36efc5=_0x499c8b(_0x96e42b);if(_0x36efc5[_0x335f25(0x103)]()){!existsSync(_0x30671a)&&mkdirSync(_0x30671a,{'recursive':!![]});const _0x352ea5=_0x2f4797(_0x96e42b);for(const _0x36c7c4 of _0x352ea5){await copyDir(join(_0x96e42b,_0x36c7c4),join(_0x30671a,_0x36c7c4));}}else copyFileSync(_0x96e42b,_0x30671a);}export async function copySharedSkills(_0x6a5c54){const _0x4a341c=a4_0x51f940,_0x1e9dbb=_0x6a5c54||process[_0x4a341c(0x108)](),_0x5462fb=resolve(__dirname,'../../cdn-source/skills'),_0x152d82=join(_0x5462fb,'.shared'),_0x3fd72f=join(_0x1e9dbb,_0x4a341c(0xe3));if(!existsSync(_0x152d82))return![];try{return await copyDir(_0x152d82,_0x3fd72f),logger['info']('skill-install',_0x4a341c(0x112),{'path':_0x3fd72f}),!![];}catch(_0x19ce65){return logger[_0x4a341c(0xfc)](_0x4a341c(0xe5),_0x4a341c(0xd2),{'error':_0x19ce65 instanceof Error?_0x19ce65[_0x4a341c(0xd3)]:String(_0x19ce65)}),![];}}export function createSkillManifest(_0x2c8f42,_0x1af344){const _0x35e7c8=a4_0x51f940,_0x506df5={'version':_0x35e7c8(0xf3),'installedAt':new Date()['toISOString'](),'platforms':_0x1af344},_0xd30a8=join(_0x2c8f42,_0x35e7c8(0xe8)),_0x43d993=join(_0x2c8f42,_0x35e7c8(0xf4));!existsSync(_0x43d993)&&mkdirSync(_0x43d993,{'recursive':!![]}),writeFileSync(_0xd30a8,JSON[_0x35e7c8(0xd4)](_0x506df5,null,0x2),'utf-8'),logger[_0x35e7c8(0x107)]('skill-install',_0x35e7c8(0x116),{'path':_0xd30a8});}
1
+ const a4_0x103241=a4_0x467f;(function(_0x5e5c56,_0x400f38){const _0xb5b7e5=a4_0x467f,_0x5d24c8=_0x5e5c56();while(!![]){try{const _0x378686=-parseInt(_0xb5b7e5(0xd7))/0x1*(-parseInt(_0xb5b7e5(0xc6))/0x2)+-parseInt(_0xb5b7e5(0xdb))/0x3*(-parseInt(_0xb5b7e5(0xff))/0x4)+-parseInt(_0xb5b7e5(0xc4))/0x5+-parseInt(_0xb5b7e5(0xfa))/0x6+-parseInt(_0xb5b7e5(0xd9))/0x7+-parseInt(_0xb5b7e5(0xcb))/0x8*(-parseInt(_0xb5b7e5(0x106))/0x9)+parseInt(_0xb5b7e5(0xfd))/0xa;if(_0x378686===_0x400f38)break;else _0x5d24c8['push'](_0x5d24c8['shift']());}catch(_0x3c09dd){_0x5d24c8['push'](_0x5d24c8['shift']());}}}(a4_0x3298,0x9949c));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x103241(0xc5),MCP_COMMAND='npx',MCP_ARGS=[a4_0x103241(0x104)];export function buildEnvConfig(_0x4fefc1,_0x4408ac){const _0x405e3=a4_0x103241,_0x20aa28={'LOVRABET_APP_CODE':String(_0x4fefc1)};return _0x4408ac!==_0x405e3(0xf3)&&(_0x20aa28[_0x405e3(0xeb)]=String(_0x4408ac)),_0x20aa28;}export async function configureCursorMcp(_0x540b3f){const _0x194b9e=a4_0x103241,_0x380815=_0x540b3f||process[_0x194b9e(0xea)](),_0x372c0b=readConfig(_0x380815),_0x142e8d=_0x372c0b[_0x194b9e(0xce)]||_0x372c0b[_0x194b9e(0xe4)],_0x3eba2e=_0x372c0b[_0x194b9e(0xf8)]||_0x194b9e(0xf3);if(!_0x142e8d)return{'ide':_0x194b9e(0x108),'status':_0x194b9e(0xda),'message':_0x194b9e(0xe9)};const _0x50d5be=buildEnvConfig(_0x142e8d,_0x3eba2e),_0x2f3545={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x50d5be},_0x496a4d=join(_0x380815,_0x194b9e(0xe1),_0x194b9e(0xe0)),_0x41ab8c=join(_0x380815,_0x194b9e(0xe1));try{!existsSync(_0x41ab8c)&&mkdirSync(_0x41ab8c,{'recursive':!![]});let _0x516d57={'mcpServers':{}};if(existsSync(_0x496a4d)){const _0x3886a0=readFileSync(_0x496a4d,'utf-8');_0x516d57=JSON[_0x194b9e(0xed)](_0x3886a0);}return(!_0x516d57[_0x194b9e(0xfb)]||typeof _0x516d57[_0x194b9e(0xfb)]!=='object')&&(_0x516d57['mcpServers']={}),_0x516d57[_0x194b9e(0xfb)][MCP_SERVER_NAME]=_0x2f3545,writeFileSync(_0x496a4d,JSON[_0x194b9e(0xe6)](_0x516d57,null,0x2),_0x194b9e(0xd3)),logger[_0x194b9e(0xf9)]('mcp-install',_0x194b9e(0x105),{'appcode':_0x142e8d,'env':_0x3eba2e,'path':_0x496a4d}),await copyCursorRules(_0x41ab8c),{'ide':'Cursor','status':_0x194b9e(0xca),'message':_0x194b9e(0xcc)};}catch(_0x46f791){return logger['error'](_0x194b9e(0x10a),_0x194b9e(0xc7),{'error':_0x46f791 instanceof Error?_0x46f791[_0x194b9e(0xd2)]:String(_0x46f791)}),{'ide':'Cursor','status':_0x194b9e(0xda),'message':_0x46f791 instanceof Error?_0x46f791[_0x194b9e(0xd2)]:String(_0x46f791)};}}export async function configureClaudeMcp(_0x5b24e2){const _0x1d41cf=a4_0x103241,_0x1f1c2e=_0x5b24e2||process[_0x1d41cf(0xea)](),_0x2134fa=readConfig(_0x1f1c2e),_0x16d51b=_0x2134fa[_0x1d41cf(0xce)]||_0x2134fa['app'],_0x26966d=_0x2134fa['env']||_0x1d41cf(0xf3);if(!_0x16d51b)return{'ide':'Claude\x20Code','status':'error','message':_0x1d41cf(0xe9)};let _0x1df26a=_0x1d41cf(0x107)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x1d41cf(0xe2)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x16d51b;return _0x26966d!==_0x1d41cf(0xf3)&&(_0x1df26a+=_0x1d41cf(0xf7)+_0x26966d),await copyAgentsMd(_0x1f1c2e),logger[_0x1d41cf(0xf9)](_0x1d41cf(0x10a),_0x1d41cf(0x109),{'command':_0x1df26a,'appcode':_0x16d51b,'env':_0x26966d}),console[_0x1d41cf(0xc9)](_0x1d41cf(0x100)),console[_0x1d41cf(0xc9)]('\x20\x20'+_0x1df26a+'\x0a'),console[_0x1d41cf(0xc9)]('配置信息:'),console[_0x1d41cf(0xc9)]('\x20\x20AppCode:\x20'+_0x16d51b),_0x26966d!==_0x1d41cf(0xf3)&&console[_0x1d41cf(0xc9)]('\x20\x20环境:\x20'+_0x26966d),console[_0x1d41cf(0xc9)](_0x1d41cf(0xee)),{'ide':_0x1d41cf(0xf2),'status':_0x1d41cf(0xe5),'message':_0x1d41cf(0xf6)+_0x1df26a};}function a4_0x3298(){const _0x5f2d86=['1464YFeKSL','已写入\x20.cursor/mcp.json','../../cdn-source/skills','appcode','cursor','node:fs','不支持的\x20MCP\x20IDE:\x20','message','utf-8','复制\x20agents.md\x20文件失败','\x20\x20}','toISOString','9287OHzJwJ','rules','3637662MKruJA','error','4965Rhettv','\x20技能包安装失败','\x20\x20\x20\x20}','其他\x20IDE\x20配置指引已显示','.lovrabet/skill/.shared','mcp.json','.cursor','join','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','app','manual','stringify','name','未知的\x20IDE:\x20','需要先配置\x20appcode','cwd','LOVRABET_ENV','skill-install','parse','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20技能包安装成功','\x20\x20\x20\x20\x22','Claude\x20Code','online','lovrabet_rules.mdc','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','请手动执行:\x20','\x20-e\x20LOVRABET_ENV=','env','info','1405056CerJjV','mcpServers','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','2613760pqSvPF','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','1708YPknaR','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','已创建\x20','创建技能包\x20manifest','复制\x20Cursor\x20Rules\x20文件失败','@lovrabet/dataset-mcp-server@latest','Cursor\x20MCP\x20配置成功','27225sPkmYU','claude\x20mcp\x20add\x20','Cursor','Claude\x20Code\x20MCP\x20命令已生成','mcp-install','isDirectory','2.0.0','.shared','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','\x20\x20\x20\x20\x20\x20}','2835640ZAPAhP','lovrabet-dataset','92wiNUSV','Cursor\x20MCP\x20配置失败','claude','log','success'];a4_0x3298=function(){return _0x5f2d86;};return a4_0x3298();}export async function showOtherGuide(_0x52944b){const _0x507da3=a4_0x103241,_0x176c34=_0x52944b||process[_0x507da3(0xea)](),_0x598085=readConfig(_0x176c34),_0x2f9457=_0x598085[_0x507da3(0xce)]||_0x598085[_0x507da3(0xe4)],_0x624a8f=_0x598085[_0x507da3(0xf8)]||'online';if(!_0x2f9457)return{'ide':'其他','status':_0x507da3(0xda),'message':_0x507da3(0xe9)};return console['log'](_0x507da3(0xf5)),console[_0x507da3(0xc9)]('{'),console['log']('\x20\x20\x22mcpServers\x22:\x20{'),console['log'](_0x507da3(0xf1)+MCP_SERVER_NAME+'\x22:\x20{'),console['log'](_0x507da3(0xc2)+MCP_COMMAND+'\x22,'),console[_0x507da3(0xc9)](_0x507da3(0xfc)+MCP_ARGS['map'](_0x5e786b=>'\x22'+_0x5e786b+'\x22')[_0x507da3(0xe2)](',\x20')+'],'),console[_0x507da3(0xc9)](_0x507da3(0xef)),console[_0x507da3(0xc9)](_0x507da3(0xe3)+_0x2f9457+'\x22,'),_0x624a8f!=='online'&&console['log'](_0x507da3(0xfe)+_0x624a8f+'\x22,'),console[_0x507da3(0xc9)](_0x507da3(0xc3)),console[_0x507da3(0xc9)](_0x507da3(0xdd)),console[_0x507da3(0xc9)](_0x507da3(0xd5)),console[_0x507da3(0xc9)]('}\x0a'),logger[_0x507da3(0xf9)]('mcp-install',_0x507da3(0xde),{'appcode':_0x2f9457,'env':_0x624a8f}),{'ide':'其他','status':_0x507da3(0xe5),'message':'配置指引已显示'};}function a4_0x467f(_0x1fac51,_0x21da78){_0x1fac51=_0x1fac51-0xc2;const _0x329832=a4_0x3298();let _0x467fc8=_0x329832[_0x1fac51];return _0x467fc8;}export async function configureMcp(_0x193836,_0x54f45b){const _0x7846b3=a4_0x103241;switch(_0x193836){case _0x7846b3(0xcf):return await configureCursorMcp(_0x54f45b);case _0x7846b3(0xc8):return await configureClaudeMcp(_0x54f45b);default:throw new Error(_0x7846b3(0xd1)+_0x193836);}}async function copyCursorRules(_0xfec8a5){const _0x31eb42=a4_0x103241,_0x16d81b=join(_0xfec8a5,_0x31eb42(0xd8)),_0x1fced1=join(_0x16d81b,_0x31eb42(0xf4));if(existsSync(_0x1fced1))return;try{!existsSync(_0x16d81b)&&mkdirSync(_0x16d81b,{'recursive':!![]});const _0x201a35=await getRulesContent();writeFileSync(_0x1fced1,_0x201a35,_0x31eb42(0xd3)),logger[_0x31eb42(0xf9)](_0x31eb42(0x10a),'创建\x20Cursor\x20Rules\x20文件',{'to':_0x1fced1});}catch(_0x26c977){logger[_0x31eb42(0xda)]('mcp-install',_0x31eb42(0x103),{'error':_0x26c977 instanceof Error?_0x26c977[_0x31eb42(0xd2)]:String(_0x26c977)});}}async function copyAgentsMd(_0x53f795){const _0xc5fac7=a4_0x103241,_0x49168f=join(_0x53f795,'agents.md');if(existsSync(_0x49168f))return;try{const _0x240324=await getRulesContent();writeFileSync(_0x49168f,_0x240324,_0xc5fac7(0xd3)),logger['info']('mcp-install','创建\x20agents.md\x20文件',{'to':_0x49168f});}catch(_0x279865){logger[_0xc5fac7(0xda)]('mcp-install',_0xc5fac7(0xd4),{'error':_0x279865 instanceof Error?_0x279865[_0xc5fac7(0xd2)]:String(_0x279865)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x55d274,_0x16a527){const _0x249b87=a4_0x103241,_0xe36e59=_0x16a527||process[_0x249b87(0xea)](),_0x5a426c=resolve(__dirname,'../../cdn-source/skills'),_0x4476e0=SKILL_IDE_CONFIGS[_0x55d274];if(!_0x4476e0)return{'ide':_0x55d274,'status':'error','message':_0x249b87(0xe8)+_0x55d274};const _0x3ad496=_0x4476e0[_0x249b87(0xe7)];try{let _0x2f062b;try{_0x2f062b=await fetchGuidesFromCDN();}catch{}const _0x750e32=await installSingleIDE(_0x55d274,_0x4476e0,_0xe36e59,_0x5a426c,_0x2f062b);return _0x2f062b&&writeGuidesToProject(_0x2f062b,_0xe36e59),logger[_0x249b87(0xf9)](_0x249b87(0xec),_0x3ad496+_0x249b87(0xf0),{'ide':_0x55d274,'filesCount':_0x750e32}),{'ide':_0x3ad496,'status':_0x249b87(0xca),'message':_0x249b87(0x101)+_0x750e32+'\x20项'};}catch(_0x1bf2cb){return logger[_0x249b87(0xda)](_0x249b87(0xec),_0x3ad496+_0x249b87(0xdc),{'error':_0x1bf2cb instanceof Error?_0x1bf2cb[_0x249b87(0xd2)]:String(_0x1bf2cb)}),{'ide':_0x3ad496,'status':_0x249b87(0xda),'message':_0x1bf2cb instanceof Error?_0x1bf2cb[_0x249b87(0xd2)]:String(_0x1bf2cb)};}}async function copyDir(_0xd5a210,_0x320bab){const _0x178d42=a4_0x103241,{statSync:_0x45af9a}=await import(_0x178d42(0xd0)),{readdirSync:_0x3f9fe8}=await import(_0x178d42(0xd0)),_0x4d32d5=_0x45af9a(_0xd5a210);if(_0x4d32d5[_0x178d42(0x10b)]()){!existsSync(_0x320bab)&&mkdirSync(_0x320bab,{'recursive':!![]});const _0x886fb0=_0x3f9fe8(_0xd5a210);for(const _0x5f3ed8 of _0x886fb0){await copyDir(join(_0xd5a210,_0x5f3ed8),join(_0x320bab,_0x5f3ed8));}}else copyFileSync(_0xd5a210,_0x320bab);}export async function copySharedSkills(_0x192c42){const _0x13c01a=a4_0x103241,_0x2a1d96=_0x192c42||process['cwd'](),_0x592954=resolve(__dirname,_0x13c01a(0xcd)),_0xdc98f2=join(_0x592954,_0x13c01a(0x10d)),_0x543399=join(_0x2a1d96,_0x13c01a(0xdf));if(!existsSync(_0xdc98f2))return![];try{return await copyDir(_0xdc98f2,_0x543399),logger[_0x13c01a(0xf9)]('skill-install','共享技能文件复制成功',{'path':_0x543399}),!![];}catch(_0x31d342){return logger[_0x13c01a(0xda)](_0x13c01a(0xec),'共享技能文件复制失败',{'error':_0x31d342 instanceof Error?_0x31d342[_0x13c01a(0xd2)]:String(_0x31d342)}),![];}}export function createSkillManifest(_0x5da0c8,_0x1fde78){const _0x5a936e=a4_0x103241,_0x3ae6fb={'version':_0x5a936e(0x10c),'installedAt':new Date()[_0x5a936e(0xd6)](),'platforms':_0x1fde78},_0x481897=join(_0x5da0c8,'.lovrabet/skill-manifest.json'),_0x5212f0=join(_0x5da0c8,'.lovrabet');!existsSync(_0x5212f0)&&mkdirSync(_0x5212f0,{'recursive':!![]}),writeFileSync(_0x481897,JSON[_0x5a936e(0xe6)](_0x3ae6fb,null,0x2),'utf-8'),logger['info'](_0x5a936e(0xec),_0x5a936e(0x102),{'path':_0x481897});}
@@ -1 +1 @@
1
- (function(_0x5065c2,_0x1f102e){const _0x3e41c3=a5_0x2e5b,_0x549985=_0x5065c2();while(!![]){try{const _0x12cdd1=parseInt(_0x3e41c3(0x170))/0x1*(-parseInt(_0x3e41c3(0x198))/0x2)+parseInt(_0x3e41c3(0x19b))/0x3+parseInt(_0x3e41c3(0x184))/0x4+-parseInt(_0x3e41c3(0x17a))/0x5+-parseInt(_0x3e41c3(0x191))/0x6+-parseInt(_0x3e41c3(0x179))/0x7+-parseInt(_0x3e41c3(0x194))/0x8*(-parseInt(_0x3e41c3(0x187))/0x9);if(_0x12cdd1===_0x1f102e)break;else _0x549985['push'](_0x549985['shift']());}catch(_0x5dfa4c){_0x549985['push'](_0x549985['shift']());}}}(a5_0x5278,0x9198e));import{jsx as a5_0x135684,jsxs as a5_0x4ddc64,Fragment as a5_0x38366a}from'react/jsx-runtime';function a5_0x2e5b(_0x4d4b6e,_0x3bc62f){_0x4d4b6e=_0x4d4b6e-0x163;const _0x527847=a5_0x5278();let _0x2e5b6d=_0x527847[_0x4d4b6e];return _0x2e5b6d;}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 a5_0x5278(){const _0x288283=['white','指定的数据集代码都不存在:\x20','.md\x20(','map','string','⚠️\x20以下数据集生成失败:','898336gjcoSQ','\x20-\x20','length','18vjJMLL','使用指定的应用AppCode:\x20','使用配置的应用AppCode:\x20','\x20个匹配的数据集\x1b[0m','文档生成失败:\x20','./docs','column','\x20重新登录后再试','\x20个数据集中筛选出\x20','cwd','397338EscvhR','includes','datasetName','10120960LdbuEJ','未找到任何数据集','error','*\x20输出目录:\x20','43606rntyMg','*\x20共处理\x20','\x20(环境:\x20','1508706ZMChwL','online','datasetCode','message','\x1b[0m','dim','cyan','api-doc','正在生成\x20','🚀\x20','\x20个数据集','env','lovrabet\x20auth',',\x20失败\x20','26owIQYn','success','green','\x1b[33m!\x20以下数据集代码不存在:\x20','log','yellow','gray','\x20个数据集的文档...','red','7616609JNPdAG','4700860uPJaRh','💡\x20请使用\x20','join','filter'];a5_0x5278=function(){return _0x288283;};return a5_0x5278();}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x47be60,env:_0x5f2add,output:_0x392663,extraParams:_0x1682c0,datasetCodes:_0x445989})=>{const _0x3f4c17=a5_0x2e5b,{exit:_0x3b355f}=useApp(),[_0x231657,_0x3ff818]=useState(![]),[_0x533fc8,_0x40f857]=useState(''),[_0x5b452f,_0x494f80]=useState(![]),[_0x573d92,_0x4df07b]=useState(null),[_0x22e5dc,_0x5a4f07]=useState(null),[_0x59427b,_0x5c04a3]=useState(0x0),_0x15f5a6=readConfig(),_0x1e82bb=getConfigAppCode(),_0x56a3db=_0x47be60||_0x1e82bb,_0x37ce30=typeof _0x15f5a6?.[_0x3f4c17(0x16d)]===_0x3f4c17(0x182)?_0x15f5a6[_0x3f4c17(0x16d)]:undefined,_0x31fa05=_0x5f2add||_0x37ce30||_0x3f4c17(0x163);initEnv(_0x31fa05);const _0x293a5b=_0x392663||_0x3f4c17(0x18c),_0x1da65d=_0x47be60?_0x3f4c17(0x188)+_0x56a3db:_0x3f4c17(0x189)+_0x56a3db;useEffect(()=>{_0x3ff818(!![]),_0x2254f6();},[]),useEffect(()=>{(_0x5b452f||_0x573d92)&&_0x3b355f();},[_0x5b452f,_0x573d92,_0x3b355f]);async function _0x2254f6(){const _0x335dd0=_0x3f4c17;if(!_0x56a3db){_0x4df07b('未提供应用AppCode,且配置中也没有默认值');return;}try{logger['setLogPath'](process[_0x335dd0(0x190)]()),_0x40f857('正在获取数据集列表...');const {configArray:_0x3cde50}=await fetchModelList(_0x56a3db);_0x5c04a3(_0x3cde50['length']);if(_0x3cde50[_0x335dd0(0x186)]===0x0){_0x4df07b(_0x335dd0(0x195));return;}let _0x193315=_0x3cde50;if(_0x445989&&_0x445989['length']>0x0){_0x193315=_0x3cde50[_0x335dd0(0x17d)](_0xa36906=>_0x445989[_0x335dd0(0x192)](_0xa36906[_0x335dd0(0x164)]));const _0x4ad33c=_0x193315[_0x335dd0(0x181)](_0x2f70f8=>_0x2f70f8[_0x335dd0(0x164)]),_0x542c37=_0x445989['filter'](_0x153065=>!_0x4ad33c['includes'](_0x153065));_0x542c37[_0x335dd0(0x186)]>0x0&&console[_0x335dd0(0x174)](_0x335dd0(0x173)+_0x542c37[_0x335dd0(0x17c)](',\x20')+_0x335dd0(0x166));if(_0x193315['length']===0x0){_0x4df07b(_0x335dd0(0x17f)+_0x445989['join'](',\x20'));return;}console[_0x335dd0(0x174)]('\x1b[90m*\x20从\x20'+_0x3cde50[_0x335dd0(0x186)]+_0x335dd0(0x18f)+_0x193315[_0x335dd0(0x186)]+_0x335dd0(0x18a));}_0x40f857(_0x335dd0(0x16a)+_0x193315['length']+_0x335dd0(0x177));const _0x1271f4=await generateDatasetDocs(_0x193315,_0x56a3db,_0x293a5b,(_0x3e5fa6,_0x1bee28,_0x51b10d)=>{const _0x8fa42e=_0x335dd0;_0x40f857(_0x8fa42e(0x16a)+_0x51b10d+_0x8fa42e(0x180)+_0x3e5fa6+'/'+_0x1bee28+')');},_0x1682c0);_0x5a4f07(_0x1271f4),_0x494f80(!![]);const _0x34394d=_0x1271f4[_0x335dd0(0x17d)](_0x1a0fe4=>_0x1a0fe4[_0x335dd0(0x171)])['length'],_0x587178=_0x1271f4[_0x335dd0(0x17d)](_0x2ea2e1=>!_0x2ea2e1[_0x335dd0(0x171)])['length'];logger[_0x335dd0(0x171)](_0x335dd0(0x169),'文档生成完成',undefined,{'totalCount':_0x1271f4['length'],'successCount':_0x34394d,'failCount':_0x587178,'outputDir':_0x293a5b});}catch(_0x2c900a){const _0x374309=_0x2c900a instanceof Error?_0x2c900a[_0x335dd0(0x165)]:String(_0x2c900a);logger['error'](_0x335dd0(0x169),_0x335dd0(0x18b)+_0x374309,{'appCode':_0x56a3db,'outputDir':_0x293a5b}),_0x4df07b('文档生成失败:\x20'+_0x374309);}finally{_0x3ff818(![]);}}const _0x9a71c5=_0x22e5dc?.['filter'](_0x20ea94=>_0x20ea94['success'])['length']||0x0,_0x571233=_0x22e5dc?.['filter'](_0x2c801=>!_0x2c801[_0x3f4c17(0x171)])['length']||0x0;return a5_0x4ddc64(Box,{'flexDirection':_0x3f4c17(0x18d),'children':[(_0x231657||_0x5b452f)&&a5_0x4ddc64(Box,{'children':[a5_0x135684(Text,{'color':'gray','children':'*\x20'}),a5_0x135684(Text,{'color':_0x47be60?_0x3f4c17(0x17e):_0x3f4c17(0x167),'children':_0x1da65d})]}),_0x231657&&a5_0x135684(Box,{'children':a5_0x4ddc64(Text,{'children':[_0x3f4c17(0x16b),_0x533fc8,_0x3f4c17(0x19a),_0x31fa05,')']})}),_0x5b452f&&_0x22e5dc&&a5_0x4ddc64(Box,{'flexDirection':_0x3f4c17(0x18d),'children':[a5_0x135684(Box,{'children':a5_0x4ddc64(Text,{'color':_0x3f4c17(0x172),'children':['√\x20文档生成完成!成功\x20',_0x9a71c5,'\x20个',_0x571233>0x0&&_0x3f4c17(0x16f)+_0x571233+'\x20个']})}),a5_0x135684(Box,{'marginTop':0x1,'children':a5_0x4ddc64(Text,{'color':'gray','children':[_0x3f4c17(0x199),_0x59427b,_0x3f4c17(0x16c)]})}),a5_0x4ddc64(Box,{'marginTop':0x1,'children':[a5_0x135684(Text,{'color':_0x3f4c17(0x176),'children':_0x3f4c17(0x197)}),a5_0x135684(Text,{'color':_0x3f4c17(0x168),'children':_0x293a5b})]}),_0x9a71c5>0x0&&a5_0x4ddc64(a5_0x38366a,{'children':[a5_0x135684(Box,{'marginTop':0x1,'children':a5_0x135684(Text,{'color':'gray','children':'*\x20生成的文档文件:'})}),_0x22e5dc[_0x3f4c17(0x17d)](_0x46b477=>_0x46b477['success'])[_0x3f4c17(0x181)]((_0x2f09ab,_0x5e0bd0)=>a5_0x4ddc64(Box,{'marginLeft':0x2,'children':[a5_0x4ddc64(Text,{'color':_0x3f4c17(0x168),'children':['•\x20',_0x2f09ab['filePath']]}),a5_0x4ddc64(Text,{'color':'dim','children':[_0x3f4c17(0x185),_0x2f09ab[_0x3f4c17(0x193)]]})]},_0x5e0bd0))]}),_0x571233>0x0&&a5_0x4ddc64(a5_0x38366a,{'children':[a5_0x135684(Box,{'marginTop':0x1,'children':a5_0x135684(Text,{'color':_0x3f4c17(0x175),'children':_0x3f4c17(0x183)})}),_0x22e5dc[_0x3f4c17(0x17d)](_0x252b53=>!_0x252b53[_0x3f4c17(0x171)])[_0x3f4c17(0x181)]((_0x5700dd,_0x2066ce)=>a5_0x4ddc64(Box,{'marginLeft':0x2,'flexDirection':_0x3f4c17(0x18d),'children':[a5_0x4ddc64(Text,{'color':_0x3f4c17(0x178),'children':['•\x20',_0x5700dd[_0x3f4c17(0x193)],'\x20(',_0x5700dd[_0x3f4c17(0x164)],')']}),_0x5700dd['error']&&a5_0x135684(Box,{'marginLeft':0x2,'children':a5_0x135684(Text,{'color':_0x3f4c17(0x167),'children':_0x5700dd[_0x3f4c17(0x196)]})})]},_0x2066ce))]})]}),_0x573d92&&a5_0x4ddc64(Box,{'flexDirection':'column','children':[a5_0x135684(Box,{'children':a5_0x4ddc64(Text,{'color':'red','children':['❌\x20',_0x573d92]})}),_0x573d92[_0x3f4c17(0x192)]('登录')&&a5_0x4ddc64(Box,{'marginTop':0x1,'children':[a5_0x135684(Text,{'color':'yellow','children':_0x3f4c17(0x17b)}),a5_0x135684(Text,{'color':_0x3f4c17(0x168),'children':_0x3f4c17(0x16e)}),a5_0x135684(Text,{'color':'yellow','children':_0x3f4c17(0x18e)})]})]})]});};
1
+ (function(_0x5b5277,_0x3d7be5){const _0x1c2dd5=a5_0x2834,_0x57b16a=_0x5b5277();while(!![]){try{const _0x5a58ac=-parseInt(_0x1c2dd5(0x126))/0x1+parseInt(_0x1c2dd5(0x14f))/0x2*(-parseInt(_0x1c2dd5(0x139))/0x3)+-parseInt(_0x1c2dd5(0x13c))/0x4*(parseInt(_0x1c2dd5(0x13d))/0x5)+-parseInt(_0x1c2dd5(0x120))/0x6*(parseInt(_0x1c2dd5(0x135))/0x7)+-parseInt(_0x1c2dd5(0x128))/0x8+-parseInt(_0x1c2dd5(0x14a))/0x9+parseInt(_0x1c2dd5(0x142))/0xa*(parseInt(_0x1c2dd5(0x136))/0xb);if(_0x5a58ac===_0x3d7be5)break;else _0x57b16a['push'](_0x57b16a['shift']());}catch(_0x5420e6){_0x57b16a['push'](_0x57b16a['shift']());}}}(a5_0x1993,0x856cb));import{jsx as a5_0x7cb958,jsxs as a5_0x15f24b,Fragment as a5_0x1bfa9f}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_0x2834(_0x493482,_0x348f0d){_0x493482=_0x493482-0x11a;const _0x19936f=a5_0x1993();let _0x283475=_0x19936f[_0x493482];return _0x283475;}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a5_0x1993(){const _0x307d63=['730wFwkYl','error','指定的数据集代码都不存在:\x20','dim','\x1b[33m!\x20以下数据集代码不存在:\x20','\x20-\x20','join','success','4495617aQlyac','文档生成失败:\x20','gray','log','red','3108mGGpdw','*\x20生成的文档文件:','string','white','map','online','使用指定的应用AppCode:\x20','env','\x20个匹配的数据集\x1b[0m','column','lovrabet\x20auth','🚀\x20','\x20个数据集','6OpmUqD','length','\x1b[0m','💡\x20请使用\x20','\x1b[90m*\x20从\x20','yellow','290920CxFgmR','api-doc','2758168CuoSnS','green','正在生成\x20',',\x20失败\x20','includes','\x20(环境:\x20','cyan','./docs','filter','\x20个数据集的文档...','datasetName','文档生成完成','√\x20文档生成完成!成功\x20','1535723bmDPVI','483868iQKbuK','cwd','setLogPath','744pcneTN','正在获取数据集列表...','使用配置的应用AppCode:\x20','45104KppmEV','410ZJkiiP','filePath','message','.md\x20(','\x20重新登录后再试'];a5_0x1993=function(){return _0x307d63;};return a5_0x1993();}export const ApiDocUI=({appCode:_0x5364a6,env:_0x38a635,output:_0x18764e,extraParams:_0x489911,datasetCodes:_0x1c5870})=>{const _0x3bb2ec=a5_0x2834,{exit:_0x145988}=useApp(),[_0x20ea1d,_0x237382]=useState(![]),[_0x59f601,_0x42cc22]=useState(''),[_0x2b3c3f,_0x246b3a]=useState(![]),[_0x4eb616,_0x365a8e]=useState(null),[_0x572bed,_0x4abaf1]=useState(null),[_0x1bcf1d,_0x309c19]=useState(0x0),_0x4d0f09=readConfig(),_0x7628dd=getConfigAppCode(),_0x58fd54=_0x5364a6||_0x7628dd,_0x2c9379=typeof _0x4d0f09?.[_0x3bb2ec(0x11a)]===_0x3bb2ec(0x151)?_0x4d0f09[_0x3bb2ec(0x11a)]:undefined,_0xcdff8c=_0x38a635||_0x2c9379||_0x3bb2ec(0x154);initEnv(_0xcdff8c);const _0x16a5ed=_0x18764e||_0x3bb2ec(0x12f),_0x15efb9=_0x5364a6?_0x3bb2ec(0x155)+_0x58fd54:_0x3bb2ec(0x13b)+_0x58fd54;useEffect(()=>{_0x237382(!![]),_0x4ae7a2();},[]),useEffect(()=>{(_0x2b3c3f||_0x4eb616)&&_0x145988();},[_0x2b3c3f,_0x4eb616,_0x145988]);async function _0x4ae7a2(){const _0x232c6b=_0x3bb2ec;if(!_0x58fd54){_0x365a8e('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x232c6b(0x138)](process[_0x232c6b(0x137)]()),_0x42cc22(_0x232c6b(0x13a));const {configArray:_0x279c53}=await fetchModelList(_0x58fd54);_0x309c19(_0x279c53[_0x232c6b(0x121)]);if(_0x279c53['length']===0x0){_0x365a8e('未找到任何数据集');return;}let _0x158190=_0x279c53;if(_0x1c5870&&_0x1c5870[_0x232c6b(0x121)]>0x0){_0x158190=_0x279c53[_0x232c6b(0x130)](_0x3d5cca=>_0x1c5870[_0x232c6b(0x12c)](_0x3d5cca['datasetCode']));const _0x47f767=_0x158190[_0x232c6b(0x153)](_0x426477=>_0x426477['datasetCode']),_0x453ab9=_0x1c5870[_0x232c6b(0x130)](_0x18a120=>!_0x47f767['includes'](_0x18a120));_0x453ab9['length']>0x0&&console[_0x232c6b(0x14d)](_0x232c6b(0x146)+_0x453ab9[_0x232c6b(0x148)](',\x20')+_0x232c6b(0x122));if(_0x158190[_0x232c6b(0x121)]===0x0){_0x365a8e(_0x232c6b(0x144)+_0x1c5870['join'](',\x20'));return;}console[_0x232c6b(0x14d)](_0x232c6b(0x124)+_0x279c53['length']+'\x20个数据集中筛选出\x20'+_0x158190[_0x232c6b(0x121)]+_0x232c6b(0x11b));}_0x42cc22(_0x232c6b(0x12a)+_0x158190[_0x232c6b(0x121)]+_0x232c6b(0x131));const _0x2ae7a6=await generateDatasetDocs(_0x158190,_0x58fd54,_0x16a5ed,(_0x17aac6,_0x92f5d0,_0x3ef2e8)=>{const _0x13f970=_0x232c6b;_0x42cc22(_0x13f970(0x12a)+_0x3ef2e8+_0x13f970(0x140)+_0x17aac6+'/'+_0x92f5d0+')');},_0x489911);_0x4abaf1(_0x2ae7a6),_0x246b3a(!![]);const _0x1cbaa7=_0x2ae7a6[_0x232c6b(0x130)](_0x19318b=>_0x19318b[_0x232c6b(0x149)])['length'],_0x55a8b1=_0x2ae7a6[_0x232c6b(0x130)](_0x538e2e=>!_0x538e2e['success'])[_0x232c6b(0x121)];logger['success'](_0x232c6b(0x127),_0x232c6b(0x133),undefined,{'totalCount':_0x2ae7a6['length'],'successCount':_0x1cbaa7,'failCount':_0x55a8b1,'outputDir':_0x16a5ed});}catch(_0x3b3858){const _0x53c85c=_0x3b3858 instanceof Error?_0x3b3858[_0x232c6b(0x13f)]:String(_0x3b3858);logger[_0x232c6b(0x143)](_0x232c6b(0x127),'文档生成失败:\x20'+_0x53c85c,{'appCode':_0x58fd54,'outputDir':_0x16a5ed}),_0x365a8e(_0x232c6b(0x14b)+_0x53c85c);}finally{_0x237382(![]);}}const _0x1cc1a8=_0x572bed?.['filter'](_0x2e2363=>_0x2e2363[_0x3bb2ec(0x149)])['length']||0x0,_0x47c4d4=_0x572bed?.[_0x3bb2ec(0x130)](_0xc74da0=>!_0xc74da0['success'])['length']||0x0;return a5_0x15f24b(Box,{'flexDirection':_0x3bb2ec(0x11c),'children':[(_0x20ea1d||_0x2b3c3f)&&a5_0x15f24b(Box,{'children':[a5_0x7cb958(Text,{'color':_0x3bb2ec(0x14c),'children':'*\x20'}),a5_0x7cb958(Text,{'color':_0x5364a6?_0x3bb2ec(0x152):_0x3bb2ec(0x145),'children':_0x15efb9})]}),_0x20ea1d&&a5_0x7cb958(Box,{'children':a5_0x15f24b(Text,{'children':[_0x3bb2ec(0x11e),_0x59f601,_0x3bb2ec(0x12d),_0xcdff8c,')']})}),_0x2b3c3f&&_0x572bed&&a5_0x15f24b(Box,{'flexDirection':'column','children':[a5_0x7cb958(Box,{'children':a5_0x15f24b(Text,{'color':_0x3bb2ec(0x129),'children':[_0x3bb2ec(0x134),_0x1cc1a8,'\x20个',_0x47c4d4>0x0&&_0x3bb2ec(0x12b)+_0x47c4d4+'\x20个']})}),a5_0x7cb958(Box,{'marginTop':0x1,'children':a5_0x15f24b(Text,{'color':_0x3bb2ec(0x14c),'children':['*\x20共处理\x20',_0x1bcf1d,_0x3bb2ec(0x11f)]})}),a5_0x15f24b(Box,{'marginTop':0x1,'children':[a5_0x7cb958(Text,{'color':_0x3bb2ec(0x14c),'children':'*\x20输出目录:\x20'}),a5_0x7cb958(Text,{'color':_0x3bb2ec(0x12e),'children':_0x16a5ed})]}),_0x1cc1a8>0x0&&a5_0x15f24b(a5_0x1bfa9f,{'children':[a5_0x7cb958(Box,{'marginTop':0x1,'children':a5_0x7cb958(Text,{'color':_0x3bb2ec(0x14c),'children':_0x3bb2ec(0x150)})}),_0x572bed[_0x3bb2ec(0x130)](_0x1d783e=>_0x1d783e['success'])['map']((_0x5aaa9a,_0xed11a7)=>a5_0x15f24b(Box,{'marginLeft':0x2,'children':[a5_0x15f24b(Text,{'color':_0x3bb2ec(0x12e),'children':['•\x20',_0x5aaa9a[_0x3bb2ec(0x13e)]]}),a5_0x15f24b(Text,{'color':_0x3bb2ec(0x145),'children':[_0x3bb2ec(0x147),_0x5aaa9a[_0x3bb2ec(0x132)]]})]},_0xed11a7))]}),_0x47c4d4>0x0&&a5_0x15f24b(a5_0x1bfa9f,{'children':[a5_0x7cb958(Box,{'marginTop':0x1,'children':a5_0x7cb958(Text,{'color':_0x3bb2ec(0x125),'children':'⚠️\x20以下数据集生成失败:'})}),_0x572bed[_0x3bb2ec(0x130)](_0x26e64a=>!_0x26e64a[_0x3bb2ec(0x149)])[_0x3bb2ec(0x153)]((_0x57c11c,_0x19cd18)=>a5_0x15f24b(Box,{'marginLeft':0x2,'flexDirection':_0x3bb2ec(0x11c),'children':[a5_0x15f24b(Text,{'color':'red','children':['•\x20',_0x57c11c['datasetName'],'\x20(',_0x57c11c['datasetCode'],')']}),_0x57c11c[_0x3bb2ec(0x143)]&&a5_0x7cb958(Box,{'marginLeft':0x2,'children':a5_0x7cb958(Text,{'color':_0x3bb2ec(0x145),'children':_0x57c11c[_0x3bb2ec(0x143)]})})]},_0x19cd18))]})]}),_0x4eb616&&a5_0x15f24b(Box,{'flexDirection':_0x3bb2ec(0x11c),'children':[a5_0x7cb958(Box,{'children':a5_0x15f24b(Text,{'color':_0x3bb2ec(0x14e),'children':['❌\x20',_0x4eb616]})}),_0x4eb616[_0x3bb2ec(0x12c)]('登录')&&a5_0x15f24b(Box,{'marginTop':0x1,'children':[a5_0x7cb958(Text,{'color':'yellow','children':_0x3bb2ec(0x123)}),a5_0x7cb958(Text,{'color':_0x3bb2ec(0x12e),'children':_0x3bb2ec(0x11d)}),a5_0x7cb958(Text,{'color':_0x3bb2ec(0x125),'children':_0x3bb2ec(0x141)})]})]})]});};
@@ -1 +1 @@
1
- const a6_0x25d4b4=a6_0x2c01;(function(_0x488ad7,_0x35cd65){const _0x44d4e5=a6_0x2c01,_0x192c3f=_0x488ad7();while(!![]){try{const _0x47f103=-parseInt(_0x44d4e5(0x12a))/0x1+-parseInt(_0x44d4e5(0x112))/0x2+parseInt(_0x44d4e5(0x11c))/0x3+parseInt(_0x44d4e5(0x133))/0x4+-parseInt(_0x44d4e5(0x10f))/0x5+parseInt(_0x44d4e5(0x125))/0x6+parseInt(_0x44d4e5(0x135))/0x7;if(_0x47f103===_0x35cd65)break;else _0x192c3f['push'](_0x192c3f['shift']());}catch(_0xa7dc8f){_0x192c3f['push'](_0x192c3f['shift']());}}}(a6_0x4ebd,0xeba96));function a6_0x4ebd(){const _0x5f160c=['datasetCode','6522870ymdKKq','等待\x203\x20秒...\x0a','message','生成文档失败:\x20','push','1656987SKcMpU','name','application/json','join','data','api-doc','success','utf8','./docs','5797852amlKCo','✗\x20失败:\x20','8813266XcsdVU','\x20个数据集需要生成文档\x0a','7680635olOPKQ','):缺少\x20data.markdown\x20字段','error','828122eNKFzS','POST','✓\x20成功生成:\x20','响应数据格式错误\x20(','status','.md\x20(','text','获取文档失败\x20(','.md','log','2330397ETxaVD','markdown','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','),HTTP状态码:\x20','stringify','生成文档成功:\x20','json','tableName'];a6_0x4ebd=function(){return _0x5f160c;};return a6_0x4ebd();}function a6_0x2c01(_0x44a1bd,_0x3a7b0e){_0x44a1bd=_0x44a1bd-0x10e;const _0x4ebdb3=a6_0x4ebd();let _0x2c011c=_0x4ebdb3[_0x44a1bd];return _0x2c011c;}import{mkdirSync,writeFileSync}from'node:fs';import a6_0x48c874 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(_0x29e1bc){const _0xf8adf6=a6_0x2c01,{appCode:_0x28d65d,datasetCode:_0x3daa63,datasetId:_0x578006,extraParams:_0x1212d9}=_0x29e1bc,_0x388080=getApiDomain(),_0x33c8b3=_0x388080+'/api/node-toolbox/api-doc-generator',_0xb1197={'appCode':_0x28d65d,'datasetCode':_0x3daa63,'datasetId':_0x578006,..._0x1212d9||{}},_0x325319=await fetch(_0x33c8b3,{'method':_0xf8adf6(0x113),'headers':{'Content-Type':_0xf8adf6(0x12c),'Cookie':getCookie()},'body':JSON[_0xf8adf6(0x120)](_0xb1197)});if(!_0x325319['ok']){if(_0x325319[_0xf8adf6(0x116)]===0x191)throw new Error(_0xf8adf6(0x11e));let _0x809084='';try{_0x809084=await _0x325319[_0xf8adf6(0x118)]();}catch(_0x83dd90){}throw new Error(_0xf8adf6(0x119)+_0x3daa63+_0xf8adf6(0x11f)+_0x325319['status']+(_0x809084?'\x0a'+_0x809084:''));}const _0xf1ca71=await _0x325319[_0xf8adf6(0x122)]();if(!_0xf1ca71[_0xf8adf6(0x12e)]||typeof _0xf1ca71[_0xf8adf6(0x12e)]['markdown']!=='string')throw new Error(_0xf8adf6(0x115)+_0x3daa63+_0xf8adf6(0x110));return _0xf1ca71[_0xf8adf6(0x12e)][_0xf8adf6(0x11d)];}function delay(_0x59014e){return new Promise(_0x1f5c2c=>setTimeout(_0x1f5c2c,_0x59014e));}export async function generateDatasetDocs(_0x3ae0cd,_0x386227,_0x255c1c=a6_0x25d4b4(0x132),_0x1ebf9a,_0x562d82){const _0x401a9e=a6_0x25d4b4;mkdirSync(_0x255c1c,{'recursive':!![]});const _0x625098=[],_0xb5c512=_0x3ae0cd['length'];console[_0x401a9e(0x11b)]('\x0a共有\x20'+_0xb5c512+_0x401a9e(0x10e));for(let _0x3251cd=0x0;_0x3251cd<_0x3ae0cd['length'];_0x3251cd++){const _0x1a3fec=_0x3ae0cd[_0x3251cd],_0x1f108c=_0x3251cd+0x1,_0x202585=_0x1a3fec[_0x401a9e(0x123)];try{console['log']('['+_0x1f108c+'/'+_0xb5c512+']\x20正在生成:\x20'+_0x202585+_0x401a9e(0x117)+_0x1a3fec['name']+')');_0x1ebf9a&&_0x1ebf9a(_0x1f108c,_0xb5c512,_0x202585);const _0x25cc86=await fetchDatasetDoc({'appCode':_0x386227,'datasetCode':_0x1a3fec['datasetCode'],'datasetId':_0x1a3fec['id'],'enableAI':![],'extraParams':_0x562d82}),_0x4a3925=a6_0x48c874[_0x401a9e(0x12d)](_0x255c1c,_0x202585+_0x401a9e(0x11a));writeFileSync(_0x4a3925,_0x25cc86,{'encoding':_0x401a9e(0x131)}),console[_0x401a9e(0x11b)](_0x401a9e(0x114)+_0x202585+'.md'),logger[_0x401a9e(0x130)]('api-doc',_0x401a9e(0x121)+_0x202585,undefined,{'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec[_0x401a9e(0x12b)],'filePath':_0x4a3925,'progress':_0x1f108c+'/'+_0xb5c512}),_0x625098[_0x401a9e(0x129)]({'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec[_0x401a9e(0x12b)],'filePath':_0x4a3925,'success':!![]}),_0x1f108c<_0xb5c512&&await delay(0x1388);}catch(_0x225d3a){const _0x568740=_0x225d3a instanceof Error?_0x225d3a[_0x401a9e(0x127)]:String(_0x225d3a);console[_0x401a9e(0x11b)](_0x401a9e(0x134)+_0x202585+'.md\x20-\x20'+_0x568740+'\x0a'),logger[_0x401a9e(0x111)](_0x401a9e(0x12f),_0x401a9e(0x128)+_0x1a3fec[_0x401a9e(0x124)],{'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec['name'],'error':_0x568740,'progress':_0x1f108c+'/'+_0xb5c512}),_0x625098[_0x401a9e(0x129)]({'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec[_0x401a9e(0x12b)],'filePath':'','success':![],'error':_0x568740}),_0x1f108c<_0xb5c512&&(console[_0x401a9e(0x11b)](_0x401a9e(0x126)),await delay(0xbb8));}}return _0x625098;}
1
+ const a6_0x5b3e2f=a6_0x5c1e;(function(_0x4e4a71,_0x24b9f0){const _0x58e90d=a6_0x5c1e,_0x314bb2=_0x4e4a71();while(!![]){try{const _0x3b5a0c=-parseInt(_0x58e90d(0x19e))/0x1+-parseInt(_0x58e90d(0x1bc))/0x2*(parseInt(_0x58e90d(0x1ac))/0x3)+-parseInt(_0x58e90d(0x1bf))/0x4*(-parseInt(_0x58e90d(0x1b5))/0x5)+-parseInt(_0x58e90d(0x1a0))/0x6*(-parseInt(_0x58e90d(0x1b6))/0x7)+-parseInt(_0x58e90d(0x1ab))/0x8+parseInt(_0x58e90d(0x1b1))/0x9*(-parseInt(_0x58e90d(0x19f))/0xa)+parseInt(_0x58e90d(0x19b))/0xb;if(_0x3b5a0c===_0x24b9f0)break;else _0x314bb2['push'](_0x314bb2['shift']());}catch(_0x43ccd0){_0x314bb2['push'](_0x314bb2['shift']());}}}(a6_0x7dc2,0x195f6));function a6_0x5c1e(_0x16a272,_0x3c9f24){_0x16a272=_0x16a272-0x199;const _0x7dc2a2=a6_0x7dc2();let _0x5c1ef0=_0x7dc2a2[_0x16a272];return _0x5c1ef0;}import{mkdirSync,writeFileSync}from'node:fs';import a6_0x1749ef 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(_0x21aa16){const _0x5dd7e8=a6_0x5c1e,{appCode:_0x15fe94,datasetCode:_0x424b02,datasetId:_0x451938,extraParams:_0x367f74}=_0x21aa16,_0x10a52d=getApiDomain(),_0x23e2c9=_0x10a52d+_0x5dd7e8(0x19a),_0x28f269={'appCode':_0x15fe94,'datasetCode':_0x424b02,'datasetId':_0x451938,..._0x367f74||{}},_0x2af802=await fetch(_0x23e2c9,{'method':_0x5dd7e8(0x1ad),'headers':{'Content-Type':_0x5dd7e8(0x1c2),'Cookie':getCookie()},'body':JSON[_0x5dd7e8(0x1af)](_0x28f269)});if(!_0x2af802['ok']){if(_0x2af802['status']===0x191)throw new Error(_0x5dd7e8(0x1a9));let _0x87ccbf='';try{_0x87ccbf=await _0x2af802[_0x5dd7e8(0x19d)]();}catch(_0x21756f){}throw new Error(_0x5dd7e8(0x1a3)+_0x424b02+_0x5dd7e8(0x1a7)+_0x2af802[_0x5dd7e8(0x1a6)]+(_0x87ccbf?'\x0a'+_0x87ccbf:''));}const _0x53a387=await _0x2af802[_0x5dd7e8(0x199)]();if(!_0x53a387[_0x5dd7e8(0x1b7)]||typeof _0x53a387[_0x5dd7e8(0x1b7)][_0x5dd7e8(0x1a1)]!==_0x5dd7e8(0x1c4))throw new Error(_0x5dd7e8(0x1a8)+_0x424b02+_0x5dd7e8(0x19c));return _0x53a387['data'][_0x5dd7e8(0x1a1)];}function a6_0x7dc2(){const _0x21f2b9=['datasetCode','name','361516UiNGny','✗\x20失败:\x20','\x20个数据集需要生成文档\x0a','88FYuVvv','join','./docs','application/json','error','string','json','/api/node-toolbox/api-doc-generator','4852210YpgoMt','):缺少\x20data.markdown\x20字段','text','206255SwAMzu','80zyPyMh','2322tOhvCz','markdown','生成文档成功:\x20','获取文档失败\x20(','api-doc','.md','status','),HTTP状态码:\x20','响应数据格式错误\x20(','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','utf8','660048JOjQEX','3DGXQLh','POST','log','stringify','length','90927wPGEso','push','等待\x203\x20秒...\x0a',']\x20正在生成:\x20','2445XvcBFj','3661fMenkn','data','✓\x20成功生成:\x20','生成文档失败:\x20'];a6_0x7dc2=function(){return _0x21f2b9;};return a6_0x7dc2();}function delay(_0x39b056){return new Promise(_0x375103=>setTimeout(_0x375103,_0x39b056));}export async function generateDatasetDocs(_0x548a18,_0xd12ed8,_0x28ea1d=a6_0x5b3e2f(0x1c1),_0x5fe523,_0x4e125a){const _0x17f729=a6_0x5b3e2f;mkdirSync(_0x28ea1d,{'recursive':!![]});const _0x140ff1=[],_0x49f2a1=_0x548a18['length'];console[_0x17f729(0x1ae)]('\x0a共有\x20'+_0x49f2a1+_0x17f729(0x1be));for(let _0x51d12a=0x0;_0x51d12a<_0x548a18[_0x17f729(0x1b0)];_0x51d12a++){const _0x5d50ba=_0x548a18[_0x51d12a],_0x109787=_0x51d12a+0x1,_0x200494=_0x5d50ba['tableName'];try{console['log']('['+_0x109787+'/'+_0x49f2a1+_0x17f729(0x1b4)+_0x200494+'.md\x20('+_0x5d50ba[_0x17f729(0x1bb)]+')');_0x5fe523&&_0x5fe523(_0x109787,_0x49f2a1,_0x200494);const _0x41e16e=await fetchDatasetDoc({'appCode':_0xd12ed8,'datasetCode':_0x5d50ba[_0x17f729(0x1ba)],'datasetId':_0x5d50ba['id'],'enableAI':![],'extraParams':_0x4e125a}),_0xc3d852=a6_0x1749ef[_0x17f729(0x1c0)](_0x28ea1d,_0x200494+'.md');writeFileSync(_0xc3d852,_0x41e16e,{'encoding':_0x17f729(0x1aa)}),console['log'](_0x17f729(0x1b8)+_0x200494+_0x17f729(0x1a5)),logger['success'](_0x17f729(0x1a4),_0x17f729(0x1a2)+_0x200494,undefined,{'datasetCode':_0x5d50ba['datasetCode'],'datasetName':_0x5d50ba['name'],'filePath':_0xc3d852,'progress':_0x109787+'/'+_0x49f2a1}),_0x140ff1['push']({'datasetCode':_0x5d50ba[_0x17f729(0x1ba)],'datasetName':_0x5d50ba['name'],'filePath':_0xc3d852,'success':!![]}),_0x109787<_0x49f2a1&&await delay(0x1388);}catch(_0x4ce940){const _0x8c567c=_0x4ce940 instanceof Error?_0x4ce940['message']:String(_0x4ce940);console[_0x17f729(0x1ae)](_0x17f729(0x1bd)+_0x200494+'.md\x20-\x20'+_0x8c567c+'\x0a'),logger[_0x17f729(0x1c3)]('api-doc',_0x17f729(0x1b9)+_0x5d50ba[_0x17f729(0x1ba)],{'datasetCode':_0x5d50ba[_0x17f729(0x1ba)],'datasetName':_0x5d50ba[_0x17f729(0x1bb)],'error':_0x8c567c,'progress':_0x109787+'/'+_0x49f2a1}),_0x140ff1[_0x17f729(0x1b2)]({'datasetCode':_0x5d50ba['datasetCode'],'datasetName':_0x5d50ba[_0x17f729(0x1bb)],'filePath':'','success':![],'error':_0x8c567c}),_0x109787<_0x49f2a1&&(console['log'](_0x17f729(0x1b3)),await delay(0xbb8));}}return _0x140ff1;}
@@ -1 +1 @@
1
- (function(_0x20a197,_0x2f51c9){const _0xb168f7=a7_0x188d,_0x430628=_0x20a197();while(!![]){try{const _0x56ae8d=-parseInt(_0xb168f7(0xa9))/0x1+-parseInt(_0xb168f7(0xaf))/0x2*(-parseInt(_0xb168f7(0xb4))/0x3)+parseInt(_0xb168f7(0x89))/0x4+parseInt(_0xb168f7(0x91))/0x5*(parseInt(_0xb168f7(0xa3))/0x6)+parseInt(_0xb168f7(0x8a))/0x7+parseInt(_0xb168f7(0xb1))/0x8*(parseInt(_0xb168f7(0x98))/0x9)+-parseInt(_0xb168f7(0xbc))/0xa*(parseInt(_0xb168f7(0x97))/0xb);if(_0x56ae8d===_0x2f51c9)break;else _0x430628['push'](_0x430628['shift']());}catch(_0x5b3186){_0x430628['push'](_0x430628['shift']());}}}(a7_0x3a75,0x1aed5));function a7_0x3a75(){const _0x571d29=['*\x20已生成文件:','api-pull','\x20个,过滤重复','gray','3846SosPKQ','setLogPath','\x20个模型','modelCount','\x20from\x20\x27@/','*\x20导入方式:','186986CVHLdw','cwd','./src/api/','message','duplicateCount','replace','72DaPMfU','datasetCount','56tQcbAl','includes','cyan','16590WELpzf','join','!\x20原始数据集\x20','column','length','💡\x20请使用\x20','使用指定的应用AppCode:\x20','originalCount','535540yTXJkn','green','split','\x20-\x20客户端实例文件','535080WAQCIw','855393WbSZbg','.ts','yellow','dim','white','slice','error','1180KSsHuJ','client','api','-\x20模型配置文件\x20(','string','\x20重新登录后再试','66pQryKH','15786QWiCmU','√\x20成功拉取\x20','\x20个数据集,生成','online','import\x20','-api','endsWith'];a7_0x3a75=function(){return _0x571d29;};return a7_0x3a75();}import{jsx as a7_0x33d91e,jsxs as a7_0x510311}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 a7_0x188d(_0x3a2400,_0x14c4b5){_0x3a2400=_0x3a2400-0x86;const _0x3a750d=a7_0x3a75();let _0x188dec=_0x3a750d[_0x3a2400];return _0x188dec;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x199669,env:_0x37afd1,output:_0x1fe53f})=>{const _0x7da044=a7_0x188d,{exit:_0x1c96f1}=useApp(),[_0x28c649,_0x4669a1]=useState(![]),[_0x251211,_0x1cdfef]=useState(![]),[_0x5af439,_0x5e097b]=useState(null),[_0x1b39ca,_0x52e9f2]=useState(null),_0x25ced9=readConfig(),_0x38aa27=getConfigAppCode(),_0x10b050=_0x199669||_0x38aa27,_0x5ac4e0=typeof _0x25ced9?.['env']===_0x7da044(0x95)?_0x25ced9['env']:undefined,_0x1b61d0=_0x37afd1||_0x5ac4e0||_0x7da044(0x9b);initEnv(_0x1b61d0);const _0x489758=_0x1fe53f||_0x7da044(0xab),_0x11a038=_0x199669&&_0x199669['includes']('-')?_0x199669[_0x7da044(0x87)]('-')[_0x7da044(0x8f)](0x1)[_0x7da044(0xb5)]('-'):'',_0x3779df=_0x199669?_0x7da044(0xba)+_0x10b050:'使用配置的应用AppCode:\x20'+_0x10b050,_0x366309=_0x11a038?_0x11a038+_0x7da044(0x9d):_0x7da044(0x93),_0x14b7b4=_0x11a038?_0x11a038+'-client':_0x7da044(0x92);useEffect(()=>{_0x4669a1(!![]),_0x1a0e97();},[]),useEffect(()=>{(_0x251211||_0x5af439)&&_0x1c96f1();},[_0x251211,_0x5af439,_0x1c96f1]);async function _0x1a0e97(){const _0x1ea022=_0x7da044;if(!_0x10b050){_0x5e097b('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x1ea022(0xa4)](process[_0x1ea022(0xaa)]());const {configArray:_0x503742}=await fetchModelList(_0x10b050),_0x4050ee=_0x503742[_0x1ea022(0xb8)],_0x4a2f4a=!_0x199669,_0x63c786=await generateApiFile(_0x503742,_0x11a038,_0x10b050,_0x4a2f4a,_0x1b61d0,_0x489758),_0x15af1e=_0x489758[_0x1ea022(0x9e)]('/')?_0x489758:_0x489758+'/';_0x52e9f2({'api':''+_0x15af1e+_0x366309+_0x1ea022(0x8b),'client':''+_0x15af1e+_0x14b7b4+_0x1ea022(0x8b),'modelCount':_0x63c786[_0x1ea022(0xa6)],'datasetCount':_0x4050ee,'originalCount':_0x4050ee,'duplicateCount':0x0}),_0x1cdfef(!![]);}catch(_0x10d140){const _0x481f44=_0x10d140 instanceof Error?_0x10d140[_0x1ea022(0xac)]:String(_0x10d140);logger[_0x1ea022(0x90)](_0x1ea022(0xa0),'拉取\x20API\x20配置失败:\x20'+_0x481f44,{'appCode':_0x10b050,'error':_0x481f44}),_0x5e097b('拉取\x20API\x20配置失败:\x20'+_0x481f44);}finally{_0x4669a1(![]);}}return a7_0x510311(Box,{'flexDirection':_0x7da044(0xb7),'children':[(_0x28c649||_0x251211)&&a7_0x510311(Box,{'children':[a7_0x33d91e(Text,{'color':_0x7da044(0xa2),'children':'*\x20'}),a7_0x33d91e(Text,{'color':_0x199669?_0x7da044(0x8e):'dim','children':_0x3779df})]}),_0x28c649&&a7_0x33d91e(Box,{'children':a7_0x510311(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x1b61d0,')']})}),_0x251211&&_0x1b39ca&&a7_0x510311(Box,{'flexDirection':_0x7da044(0xb7),'children':[a7_0x33d91e(Box,{'children':a7_0x510311(Text,{'color':_0x7da044(0x86),'children':[_0x7da044(0x99),_0x1b39ca[_0x7da044(0xb0)],_0x7da044(0x9a),'\x20',_0x1b39ca['modelCount'],_0x7da044(0xa5)]})}),_0x1b39ca[_0x7da044(0xad)]>0x0&&a7_0x33d91e(Box,{'marginTop':0x1,'children':a7_0x510311(Text,{'color':'yellow','children':[_0x7da044(0xb6),_0x1b39ca[_0x7da044(0xbb)],_0x7da044(0xa1),'\x20',_0x1b39ca['duplicateCount'],'\x20个']})}),a7_0x33d91e(Box,{'marginTop':0x1,'children':a7_0x33d91e(Text,{'color':_0x7da044(0xa2),'children':_0x7da044(0x9f)})}),a7_0x510311(Box,{'marginLeft':0x2,'children':[a7_0x510311(Text,{'color':_0x7da044(0xb3),'children':['•\x20',_0x1b39ca[_0x7da044(0x93)]]}),a7_0x510311(Text,{'color':_0x7da044(0x8d),'children':['\x20',_0x7da044(0x94),_0x1b39ca[_0x7da044(0xa6)],'\x20个模型)']})]}),a7_0x510311(Box,{'marginLeft':0x2,'children':[a7_0x510311(Text,{'color':_0x7da044(0xb3),'children':['•\x20',_0x1b39ca[_0x7da044(0x92)]]}),a7_0x33d91e(Text,{'color':'dim','children':_0x7da044(0x88)})]}),a7_0x33d91e(Box,{'marginTop':0x1,'children':a7_0x33d91e(Text,{'color':_0x7da044(0xa2),'children':_0x7da044(0xa8)})}),a7_0x33d91e(Box,{'marginLeft':0x2,'children':a7_0x510311(Text,{'color':_0x7da044(0x8c),'children':[_0x7da044(0x9c),'{\x20lovrabetClient\x20}',_0x7da044(0xa7),_0x1b39ca['client']['replace'](/^\.\//,'')[_0x7da044(0xae)](_0x7da044(0x8b),''),'\x27']})})]}),_0x5af439&&a7_0x510311(Box,{'flexDirection':_0x7da044(0xb7),'children':[a7_0x33d91e(Box,{'children':a7_0x510311(Text,{'color':'red','children':['❌\x20',_0x5af439]})}),_0x5af439[_0x7da044(0xb2)]('登录')&&a7_0x510311(Box,{'marginTop':0x1,'children':[a7_0x33d91e(Text,{'color':'yellow','children':_0x7da044(0xb9)}),a7_0x33d91e(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a7_0x33d91e(Text,{'color':'yellow','children':_0x7da044(0x96)})]})]})]});};
1
+ (function(_0xa9f60d,_0x582df7){const _0x2f5522=a7_0x4393,_0x6c8e=_0xa9f60d();while(!![]){try{const _0x9fed52=-parseInt(_0x2f5522(0x1fa))/0x1*(parseInt(_0x2f5522(0x21b))/0x2)+parseInt(_0x2f5522(0x1f9))/0x3*(parseInt(_0x2f5522(0x205))/0x4)+-parseInt(_0x2f5522(0x214))/0x5*(-parseInt(_0x2f5522(0x20c))/0x6)+-parseInt(_0x2f5522(0x1f1))/0x7+parseInt(_0x2f5522(0x1fc))/0x8+-parseInt(_0x2f5522(0x21a))/0x9*(parseInt(_0x2f5522(0x213))/0xa)+parseInt(_0x2f5522(0x216))/0xb;if(_0x9fed52===_0x582df7)break;else _0x6c8e['push'](_0x6c8e['shift']());}catch(_0x42e52c){_0x6c8e['push'](_0x6c8e['shift']());}}}(a7_0x28d9,0xecbbe));import{jsx as a7_0x23f2a0,jsxs as a7_0x956980}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x28d9(){const _0x7b2c27=['yellow','includes','√\x20成功拉取\x20','480093DFaXPb','7nlxRVd','-api','5710904mlJAjq','cwd','*\x20已生成文件:','cyan','string','.ts','client','使用指定的应用AppCode:\x20','setLogPath','16BxCWuF','modelCount','api-pull','\x20重新登录后再试','error','\x20个模型)','*\x20导入方式:','30510YnJwwx','column','\x20个,过滤重复','拉取\x20API\x20配置失败:\x20','api','\x20个数据集,生成','{\x20lovrabetClient\x20}','10uJwpqH','845IVxXkg','datasetCount','26170012XCTjqL','env','red','duplicateCount','8977068MXuKAm','290332dxcHhi','gray','replace','length','\x20-\x20客户端实例文件','import\x20','使用配置的应用AppCode:\x20','join','white','!\x20原始数据集\x20','slice','11264176zmwWcJ','online','未提供应用AppCode,且配置中也没有默认值','lovrabet\x20auth','-\x20模型配置文件\x20('];a7_0x28d9=function(){return _0x7b2c27;};return a7_0x28d9();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a7_0x4393(_0x2f4e60,_0x2daf13){_0x2f4e60=_0x2f4e60-0x1ed;const _0x28d901=a7_0x28d9();let _0x439398=_0x28d901[_0x2f4e60];return _0x439398;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x198dfc,env:_0xc4ae3e,output:_0x1e85d7})=>{const _0x27946e=a7_0x4393,{exit:_0x5d531c}=useApp(),[_0x4ee1c1,_0x13d478]=useState(![]),[_0x2003f9,_0x35469f]=useState(![]),[_0x330fca,_0x3bbbcf]=useState(null),[_0x466ac7,_0x11c9e4]=useState(null),_0x220163=readConfig(),_0x3e6314=getConfigAppCode(),_0x3de600=_0x198dfc||_0x3e6314,_0xbd2089=typeof _0x220163?.[_0x27946e(0x217)]===_0x27946e(0x200)?_0x220163[_0x27946e(0x217)]:undefined,_0x5172bc=_0xc4ae3e||_0xbd2089||_0x27946e(0x1f2);initEnv(_0x5172bc);const _0x2c5b90=_0x1e85d7||'./src/api/',_0xaab6ef=_0x198dfc&&_0x198dfc[_0x27946e(0x1f7)]('-')?_0x198dfc['split']('-')[_0x27946e(0x1f0)](0x1)[_0x27946e(0x1ed)]('-'):'',_0x4f48a8=_0x198dfc?_0x27946e(0x203)+_0x3de600:_0x27946e(0x221)+_0x3de600,_0x27116b=_0xaab6ef?_0xaab6ef+_0x27946e(0x1fb):_0x27946e(0x210),_0x6907fe=_0xaab6ef?_0xaab6ef+'-client':_0x27946e(0x202);useEffect(()=>{_0x13d478(!![]),_0x1c427e();},[]),useEffect(()=>{(_0x2003f9||_0x330fca)&&_0x5d531c();},[_0x2003f9,_0x330fca,_0x5d531c]);async function _0x1c427e(){const _0xac4c72=_0x27946e;if(!_0x3de600){_0x3bbbcf(_0xac4c72(0x1f3));return;}try{logger[_0xac4c72(0x204)](process[_0xac4c72(0x1fd)]());const {configArray:_0x407970}=await fetchModelList(_0x3de600),_0x434f85=_0x407970[_0xac4c72(0x21e)],_0x5c833c=!_0x198dfc,_0x356613=await generateApiFile(_0x407970,_0xaab6ef,_0x3de600,_0x5c833c,_0x5172bc,_0x2c5b90),_0x9b0b78=_0x2c5b90['endsWith']('/')?_0x2c5b90:_0x2c5b90+'/';_0x11c9e4({'api':''+_0x9b0b78+_0x27116b+_0xac4c72(0x201),'client':''+_0x9b0b78+_0x6907fe+_0xac4c72(0x201),'modelCount':_0x356613[_0xac4c72(0x206)],'datasetCount':_0x434f85,'originalCount':_0x434f85,'duplicateCount':0x0}),_0x35469f(!![]);}catch(_0x130a2b){const _0x28bc52=_0x130a2b instanceof Error?_0x130a2b['message']:String(_0x130a2b);logger[_0xac4c72(0x209)](_0xac4c72(0x207),_0xac4c72(0x20f)+_0x28bc52,{'appCode':_0x3de600,'error':_0x28bc52}),_0x3bbbcf(_0xac4c72(0x20f)+_0x28bc52);}finally{_0x13d478(![]);}}return a7_0x956980(Box,{'flexDirection':_0x27946e(0x20d),'children':[(_0x4ee1c1||_0x2003f9)&&a7_0x956980(Box,{'children':[a7_0x23f2a0(Text,{'color':_0x27946e(0x21c),'children':'*\x20'}),a7_0x23f2a0(Text,{'color':_0x198dfc?_0x27946e(0x1ee):'dim','children':_0x4f48a8})]}),_0x4ee1c1&&a7_0x23f2a0(Box,{'children':a7_0x956980(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x5172bc,')']})}),_0x2003f9&&_0x466ac7&&a7_0x956980(Box,{'flexDirection':_0x27946e(0x20d),'children':[a7_0x23f2a0(Box,{'children':a7_0x956980(Text,{'color':'green','children':[_0x27946e(0x1f8),_0x466ac7[_0x27946e(0x215)],_0x27946e(0x211),'\x20',_0x466ac7[_0x27946e(0x206)],'\x20个模型']})}),_0x466ac7['duplicateCount']>0x0&&a7_0x23f2a0(Box,{'marginTop':0x1,'children':a7_0x956980(Text,{'color':_0x27946e(0x1f6),'children':[_0x27946e(0x1ef),_0x466ac7['originalCount'],_0x27946e(0x20e),'\x20',_0x466ac7[_0x27946e(0x219)],'\x20个']})}),a7_0x23f2a0(Box,{'marginTop':0x1,'children':a7_0x23f2a0(Text,{'color':_0x27946e(0x21c),'children':_0x27946e(0x1fe)})}),a7_0x956980(Box,{'marginLeft':0x2,'children':[a7_0x956980(Text,{'color':_0x27946e(0x1ff),'children':['•\x20',_0x466ac7['api']]}),a7_0x956980(Text,{'color':'dim','children':['\x20',_0x27946e(0x1f5),_0x466ac7['modelCount'],_0x27946e(0x20a)]})]}),a7_0x956980(Box,{'marginLeft':0x2,'children':[a7_0x956980(Text,{'color':_0x27946e(0x1ff),'children':['•\x20',_0x466ac7['client']]}),a7_0x23f2a0(Text,{'color':'dim','children':_0x27946e(0x21f)})]}),a7_0x23f2a0(Box,{'marginTop':0x1,'children':a7_0x23f2a0(Text,{'color':'gray','children':_0x27946e(0x20b)})}),a7_0x23f2a0(Box,{'marginLeft':0x2,'children':a7_0x956980(Text,{'color':_0x27946e(0x1f6),'children':[_0x27946e(0x220),_0x27946e(0x212),'\x20from\x20\x27@/',_0x466ac7[_0x27946e(0x202)][_0x27946e(0x21d)](/^\.\//,'')[_0x27946e(0x21d)](_0x27946e(0x201),''),'\x27']})})]}),_0x330fca&&a7_0x956980(Box,{'flexDirection':'column','children':[a7_0x23f2a0(Box,{'children':a7_0x956980(Text,{'color':_0x27946e(0x218),'children':['❌\x20',_0x330fca]})}),_0x330fca[_0x27946e(0x1f7)]('登录')&&a7_0x956980(Box,{'marginTop':0x1,'children':[a7_0x23f2a0(Text,{'color':_0x27946e(0x1f6),'children':'💡\x20请使用\x20'}),a7_0x23f2a0(Text,{'color':_0x27946e(0x1ff),'children':_0x27946e(0x1f4)}),a7_0x23f2a0(Text,{'color':_0x27946e(0x1f6),'children':_0x27946e(0x208)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x248e97,_0x372600){const _0x5b0d32=a8_0x24a1,_0x4d3bf0=_0x248e97();while(!![]){try{const _0x198011=-parseInt(_0x5b0d32(0xb7))/0x1+parseInt(_0x5b0d32(0xae))/0x2*(-parseInt(_0x5b0d32(0xa8))/0x3)+parseInt(_0x5b0d32(0xa6))/0x4*(parseInt(_0x5b0d32(0xb5))/0x5)+parseInt(_0x5b0d32(0xc4))/0x6*(-parseInt(_0x5b0d32(0xa9))/0x7)+-parseInt(_0x5b0d32(0xa5))/0x8+-parseInt(_0x5b0d32(0xab))/0x9+parseInt(_0x5b0d32(0xbb))/0xa;if(_0x198011===_0x372600)break;else _0x4d3bf0['push'](_0x4d3bf0['shift']());}catch(_0x1d1e0f){_0x4d3bf0['push'](_0x4d3bf0['shift']());}}}(a8_0x234e,0x4b275));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0x24a1(_0x1af654,_0x146b0d){_0x1af654=_0x1af654-0xa4;const _0x234e8b=a8_0x234e();let _0x24a106=_0x234e8b[_0x1af654];return _0x24a106;}import{getEnv}from'../constant/env.js';function a8_0x234e(){const _0x4a670e=['264447sDWkCu','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','Unauthorized','status','16028660APXrRO','data','UNAUTHORIZED','message','fetch-model-list','未知错误','info','errorMsg','includes','114ZINhTw','json','4493656HnCTJj','12saYobs','获取数据集失败,HTTP状态码:\x20','12KjzNUN','17143SrUYTr','count','4283028DGFrAd','&otype=array','configArray','203156LgOqvR','code','获取数据集失败:\x20','401','/api/node-toolbox/dataset/model-list?appcode=','errorCode','errorMessage','766420xrKqfX','success'];a8_0x234e=function(){return _0x4a670e;};return a8_0x234e();}export async function fetchModelList(_0x33c461){const _0x39ee2f=a8_0x24a1,_0x451821=getEnv(),_0x3fc83b=getApiDomain()+_0x39ee2f(0xb2)+_0x33c461+_0x39ee2f(0xac);logger[_0x39ee2f(0xc1)](_0x39ee2f(0xbf),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x451821+')',{'apiUrl':_0x3fc83b});const _0x4f01f4=await fetch(_0x3fc83b,{'headers':{'Cookie':getCookie()}});if(!_0x4f01f4['ok']){if(_0x4f01f4[_0x39ee2f(0xba)]===0x191)throw new Error(_0x39ee2f(0xb8));throw new Error(_0x39ee2f(0xa7)+_0x4f01f4[_0x39ee2f(0xba)]);}const _0x1178d7=await _0x4f01f4[_0x39ee2f(0xa4)]();if(!_0x1178d7[_0x39ee2f(0xb6)]){const _0x346c42=_0x1178d7[_0x39ee2f(0xc2)]||_0x1178d7[_0x39ee2f(0xbe)]||_0x1178d7[_0x39ee2f(0xbc)]?.[_0x39ee2f(0xbe)]||_0x1178d7[_0x39ee2f(0xb4)]||_0x1178d7['error']||_0x39ee2f(0xc0);if(_0x346c42[_0x39ee2f(0xc3)](_0x39ee2f(0xb1))||_0x346c42[_0x39ee2f(0xc3)](_0x39ee2f(0xb9))||_0x346c42['includes']('登录')||_0x346c42['includes']('认证')||_0x1178d7[_0x39ee2f(0xb3)]===_0x39ee2f(0xbd)||_0x1178d7['code']===0x191||_0x1178d7[_0x39ee2f(0xaf)]===_0x39ee2f(0xb1))throw new Error(_0x39ee2f(0xb8));throw new Error(_0x39ee2f(0xb0)+_0x346c42);}return{'configArray':_0x1178d7[_0x39ee2f(0xbc)][_0x39ee2f(0xad)],'count':_0x1178d7[_0x39ee2f(0xbc)][_0x39ee2f(0xaa)]};}
1
+ function a8_0x35f1(_0x237504,_0x1af31b){_0x237504=_0x237504-0xe3;const _0x220b63=a8_0x220b();let _0x35f163=_0x220b63[_0x237504];return _0x35f163;}(function(_0x5cf7b0,_0x1cb634){const _0x19adb5=a8_0x35f1,_0x57f192=_0x5cf7b0();while(!![]){try{const _0x27710b=-parseInt(_0x19adb5(0xf6))/0x1*(parseInt(_0x19adb5(0xe8))/0x2)+-parseInt(_0x19adb5(0xe3))/0x3*(parseInt(_0x19adb5(0x103))/0x4)+parseInt(_0x19adb5(0xf0))/0x5+parseInt(_0x19adb5(0xf1))/0x6*(-parseInt(_0x19adb5(0xf5))/0x7)+-parseInt(_0x19adb5(0xec))/0x8*(parseInt(_0x19adb5(0xfa))/0x9)+-parseInt(_0x19adb5(0xf8))/0xa*(-parseInt(_0x19adb5(0xfc))/0xb)+parseInt(_0x19adb5(0xf7))/0xc;if(_0x27710b===_0x1cb634)break;else _0x57f192['push'](_0x57f192['shift']());}catch(_0x2b1e84){_0x57f192['push'](_0x57f192['shift']());}}}(a8_0x220b,0x7273a));function a8_0x220b(){const _0x41f938=['data','/api/node-toolbox/dataset/model-list?appcode=','7GrbPxi','225685xnEoTf','21203988KRVmlZ','20sgujVJ','status','19269oiySaX','获取数据集失败,HTTP状态码:\x20','4109941BkFwwW','errorMsg','code','configArray','UNAUTHORIZED','正在从服务器拉取模型列表...\x20(环境:\x20','includes','4DSygCp','1524657TJWIeC','&otype=array','count','Unauthorized','errorMessage','6UHyepS','fetch-model-list','未知错误','message','2976qCydmJ','json','获取数据集失败:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2207435dMSDiV','3031368XcSeOC','401'];a8_0x220b=function(){return _0x41f938;};return a8_0x220b();}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(_0x3f9b6e){const _0x117cdb=a8_0x35f1,_0x578fc3=getEnv(),_0x2417f8=getApiDomain()+_0x117cdb(0xf4)+_0x3f9b6e+_0x117cdb(0xe4);logger['info'](_0x117cdb(0xe9),_0x117cdb(0x101)+_0x578fc3+')',{'apiUrl':_0x2417f8});const _0x338eab=await fetch(_0x2417f8,{'headers':{'Cookie':getCookie()}});if(!_0x338eab['ok']){if(_0x338eab[_0x117cdb(0xf9)]===0x191)throw new Error(_0x117cdb(0xef));throw new Error(_0x117cdb(0xfb)+_0x338eab['status']);}const _0x15fce5=await _0x338eab[_0x117cdb(0xed)]();if(!_0x15fce5['success']){const _0x55626b=_0x15fce5[_0x117cdb(0xfd)]||_0x15fce5[_0x117cdb(0xeb)]||_0x15fce5['data']?.['message']||_0x15fce5[_0x117cdb(0xe7)]||_0x15fce5['error']||_0x117cdb(0xea);if(_0x55626b[_0x117cdb(0x102)](_0x117cdb(0xf2))||_0x55626b[_0x117cdb(0x102)](_0x117cdb(0xe6))||_0x55626b[_0x117cdb(0x102)]('登录')||_0x55626b[_0x117cdb(0x102)]('认证')||_0x15fce5['errorCode']===_0x117cdb(0x100)||_0x15fce5[_0x117cdb(0xfe)]===0x191||_0x15fce5['code']===_0x117cdb(0xf2))throw new Error(_0x117cdb(0xef));throw new Error(_0x117cdb(0xee)+_0x55626b);}return{'configArray':_0x15fce5['data'][_0x117cdb(0xff)],'count':_0x15fce5[_0x117cdb(0xf3)][_0x117cdb(0xe5)]};}
@@ -1 +1 @@
1
- const a9_0x4624ba=a9_0x183e;(function(_0x54bbc6,_0x396797){const _0x1d3d9b=a9_0x183e,_0x1a9a01=_0x54bbc6();while(!![]){try{const _0x14604e=parseInt(_0x1d3d9b(0x13d))/0x1*(parseInt(_0x1d3d9b(0x154))/0x2)+parseInt(_0x1d3d9b(0x13f))/0x3+parseInt(_0x1d3d9b(0x12f))/0x4+parseInt(_0x1d3d9b(0x14a))/0x5+parseInt(_0x1d3d9b(0x142))/0x6*(parseInt(_0x1d3d9b(0x149))/0x7)+parseInt(_0x1d3d9b(0x131))/0x8*(parseInt(_0x1d3d9b(0x13c))/0x9)+parseInt(_0x1d3d9b(0x143))/0xa*(-parseInt(_0x1d3d9b(0x146))/0xb);if(_0x14604e===_0x396797)break;else _0x1a9a01['push'](_0x1a9a01['shift']());}catch(_0x451ec5){_0x1a9a01['push'](_0x1a9a01['shift']());}}}(a9_0x369d,0x334f6));import a9_0x3b0a31 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x2d871c from'node:path';import{fileURLToPath}from'node:url';function a9_0x183e(_0x4befed,_0x337520){_0x4befed=_0x4befed-0x12f;const _0x369dba=a9_0x369d();let _0x183eda=_0x369dba[_0x4befed];return _0x183eda;}import{readConfig}from'../utils/config.js';function a9_0x369d(){const _0x439cb7=['467829keuOdF','templates/generate-api','forEach','235146OVxIBa','20460vITlwY','typescript','{\x20apiConfigName:\x20\x22','5269qVKkTZ','client','format','7sTXnVN','1363135IHRDNb',',\x20env:\x20\x22','length','env','.ts','join','CONFIG_NAMES.DEFAULT','API\x20文件生成成功!','online','string','1722mYDWHx','slice','955972ejebvd','api','16bertqo','init-api','\x22\x20}','utf8','replaceApiContent','datasetCode','tableName','../..','app','./src/api/','resolve','811683HamtcW','352YvpVyP','-client'];a9_0x369d=function(){return _0x439cb7;};return a9_0x369d();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x2487ff,_0x4c2a86='',_0x351e05,_0x4b9977=![],_0x2eb05d,_0x11b986=a9_0x4624ba(0x13a)){const _0x510401=a9_0x4624ba,_0x37b5b4=readConfig(),_0x40f92e=_0x351e05||_0x37b5b4?.[_0x510401(0x139)];if(typeof _0x40f92e!==_0x510401(0x153)||!_0x40f92e)throw new Error('请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code');const _0x3edaab=_0x4b9977?_0x510401(0x150):'\x22'+_0x40f92e+'\x22',_0xe0bcf9=typeof _0x37b5b4[_0x510401(0x14d)]===_0x510401(0x153)?_0x37b5b4[_0x510401(0x14d)]:undefined,_0x59688b=_0x2eb05d||_0xe0bcf9||_0x510401(0x152),_0x3ea8d1=_0x59688b!==_0x510401(0x152);let _0x569880;if(_0x4b9977)_0x3ea8d1?_0x569880='{\x20apiConfigName:\x20'+_0x3edaab+_0x510401(0x14b)+_0x59688b+_0x510401(0x133):_0x569880='';else{const _0x371602=_0x3ea8d1?',\x20env:\x20\x22'+_0x59688b+'\x22':'';_0x569880=_0x510401(0x145)+_0x40f92e+'\x22'+_0x371602+'\x20}';}const _0x51302b=_0x4c2a86?_0x4c2a86+'-api':_0x510401(0x130),_0x3eaabe=_0x4c2a86?_0x4c2a86+_0x510401(0x13e):_0x510401(0x147),_0x490b49=[];_0x2487ff[_0x510401(0x141)](_0x27aad3=>{const _0x2a4a9b=_0x510401;_0x490b49['push']({'datasetCode':_0x27aad3[_0x2a4a9b(0x136)],'tableName':_0x27aad3[_0x2a4a9b(0x137)],'name':_0x27aad3['name']||'','alias':_0x27aad3['alias']||_0x27aad3['key']});});const _0x579132=fileURLToPath(import.meta.url),_0x3177a2=a9_0x2d871c[_0x510401(0x13b)](a9_0x2d871c['dirname'](_0x579132),_0x510401(0x138)),_0x4880cd=a9_0x2d871c['join'](_0x3177a2,_0x510401(0x140)),_0x346df7=a9_0x2d871c[_0x510401(0x14f)](_0x4880cd,'api.ts.tpl'),_0xdf9d95=a9_0x2d871c[_0x510401(0x14f)](_0x4880cd,'client.ts.tpl'),_0x416241=_0x11b986['endsWith']('/')?_0x11b986[_0x510401(0x155)](0x0,-0x1):_0x11b986;mkdirSync(_0x416241,{'recursive':!![]});const _0xb137d2=_0x490b49[0x0]?.['alias'],_0x1a2a57=readFileSync(_0x346df7,_0x510401(0x134)),_0x3ce726=TemplateReplacer[_0x510401(0x135)](_0x1a2a57,_0x40f92e,_0x490b49,_0xb137d2,_0x51302b,_0x3edaab),_0x4e0eb2=await a9_0x3b0a31[_0x510401(0x148)](_0x3ce726,{'parser':_0x510401(0x144)}),_0x5a8443=_0x416241+'/'+_0x51302b+_0x510401(0x14e);writeFileSync(_0x5a8443,_0x4e0eb2,{'encoding':'utf8'});const _0x3e8d22=readFileSync(_0xdf9d95,_0x510401(0x134)),_0x4a2f8c=TemplateReplacer[_0x510401(0x135)](_0x3e8d22,_0x40f92e,_0x490b49,_0xb137d2,_0x51302b,_0x3edaab,_0x569880),_0x3b6796=await a9_0x3b0a31[_0x510401(0x148)](_0x4a2f8c,{'parser':_0x510401(0x144)}),_0x27bb38=_0x416241+'/'+_0x3eaabe+_0x510401(0x14e);writeFileSync(_0x27bb38,_0x3b6796,{'encoding':'utf8'});const _0x26c7f3=_0x490b49[_0x510401(0x14c)];return logger['success'](_0x510401(0x132),_0x510401(0x151),undefined,{'apiFile':_0x5a8443,'clientFile':_0x27bb38,'modelCount':_0x26c7f3,'configName':_0x3edaab}),{'modelCount':_0x26c7f3,'apiFilePath':_0x5a8443,'clientFilePath':_0x27bb38,'configName':_0x3edaab};}
1
+ function a9_0x2801(){const _0x339982=['alias','.ts','utf8','resolve','join','API\x20文件生成成功!',',\x20env:\x20\x22','-client','key','env','459604yXOFFn','21592lmjmZz','endsWith','{\x20apiConfigName:\x20','927hmzCJd','app','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','push','1382724QVLozr','7654050dkwOmj','333535pYUTKy','templates/generate-api','\x22\x20}','init-api','6KOYsvc','1HkwAup','../..','length','string','format','online','name','slice','1425648uARHeA','130070QOYUQJ','success','client.ts.tpl','datasetCode','CONFIG_NAMES.DEFAULT','typescript','tableName','replaceApiContent','-api','client'];a9_0x2801=function(){return _0x339982;};return a9_0x2801();}(function(_0xa60a2d,_0x1676fe){const _0x36b719=a9_0x48cb,_0x45793b=_0xa60a2d();while(!![]){try{const _0x518989=-parseInt(_0x36b719(0xae))/0x1*(-parseInt(_0x36b719(0xb7))/0x2)+parseInt(_0x36b719(0xad))/0x3*(-parseInt(_0x36b719(0xcb))/0x4)+-parseInt(_0x36b719(0xd5))/0x5+-parseInt(_0x36b719(0xb6))/0x6+parseInt(_0x36b719(0xd3))/0x7+-parseInt(_0x36b719(0xcc))/0x8*(parseInt(_0x36b719(0xcf))/0x9)+parseInt(_0x36b719(0xd4))/0xa;if(_0x518989===_0x1676fe)break;else _0x45793b['push'](_0x45793b['shift']());}catch(_0x6c6c1){_0x45793b['push'](_0x45793b['shift']());}}}(a9_0x2801,0x34b32));import a9_0x235b42 from'prettier';function a9_0x48cb(_0x56d746,_0x56f0da){_0x56d746=_0x56d746-0xad;const _0x280190=a9_0x2801();let _0x48cb7c=_0x280190[_0x56d746];return _0x48cb7c;}import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x5d669c from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x46a0d6,_0x2c2ae8='',_0x2664a4,_0x178614=![],_0x3c4c7a,_0x2fa089='./src/api/'){const _0xce2665=a9_0x48cb,_0xfa2977=readConfig(),_0x34d072=_0x2664a4||_0xfa2977?.[_0xce2665(0xd0)];if(typeof _0x34d072!==_0xce2665(0xb1)||!_0x34d072)throw new Error(_0xce2665(0xd1));const _0x3cfc28=_0x178614?_0xce2665(0xbb):'\x22'+_0x34d072+'\x22',_0x3be473=typeof _0xfa2977[_0xce2665(0xca)]===_0xce2665(0xb1)?_0xfa2977[_0xce2665(0xca)]:undefined,_0x590531=_0x3c4c7a||_0x3be473||'online',_0x3a55fd=_0x590531!==_0xce2665(0xb3);let _0x27b32d;if(_0x178614)_0x3a55fd?_0x27b32d=_0xce2665(0xce)+_0x3cfc28+',\x20env:\x20\x22'+_0x590531+_0xce2665(0xd7):_0x27b32d='';else{const _0x58d867=_0x3a55fd?_0xce2665(0xc7)+_0x590531+'\x22':'';_0x27b32d='{\x20apiConfigName:\x20\x22'+_0x34d072+'\x22'+_0x58d867+'\x20}';}const _0x3cefa5=_0x2c2ae8?_0x2c2ae8+_0xce2665(0xbf):'api',_0x366f4e=_0x2c2ae8?_0x2c2ae8+_0xce2665(0xc8):_0xce2665(0xc0),_0x4171a2=[];_0x46a0d6['forEach'](_0x5177a2=>{const _0x1fb5c0=_0xce2665;_0x4171a2[_0x1fb5c0(0xd2)]({'datasetCode':_0x5177a2[_0x1fb5c0(0xba)],'tableName':_0x5177a2[_0x1fb5c0(0xbd)],'name':_0x5177a2[_0x1fb5c0(0xb4)]||'','alias':_0x5177a2[_0x1fb5c0(0xc1)]||_0x5177a2[_0x1fb5c0(0xc9)]});});const _0x7c3244=fileURLToPath(import.meta.url),_0x45e403=a9_0x5d669c[_0xce2665(0xc4)](a9_0x5d669c['dirname'](_0x7c3244),_0xce2665(0xaf)),_0x3ff6d5=a9_0x5d669c[_0xce2665(0xc5)](_0x45e403,_0xce2665(0xd6)),_0x255822=a9_0x5d669c[_0xce2665(0xc5)](_0x3ff6d5,'api.ts.tpl'),_0x32b583=a9_0x5d669c[_0xce2665(0xc5)](_0x3ff6d5,_0xce2665(0xb9)),_0x442dc3=_0x2fa089[_0xce2665(0xcd)]('/')?_0x2fa089[_0xce2665(0xb5)](0x0,-0x1):_0x2fa089;mkdirSync(_0x442dc3,{'recursive':!![]});const _0x85f29d=_0x4171a2[0x0]?.[_0xce2665(0xc1)],_0x4ba7fa=readFileSync(_0x255822,_0xce2665(0xc3)),_0x16e2bc=TemplateReplacer[_0xce2665(0xbe)](_0x4ba7fa,_0x34d072,_0x4171a2,_0x85f29d,_0x3cefa5,_0x3cfc28),_0x446596=await a9_0x235b42['format'](_0x16e2bc,{'parser':_0xce2665(0xbc)}),_0x475058=_0x442dc3+'/'+_0x3cefa5+'.ts';writeFileSync(_0x475058,_0x446596,{'encoding':_0xce2665(0xc3)});const _0x45920a=readFileSync(_0x32b583,_0xce2665(0xc3)),_0x5347e0=TemplateReplacer[_0xce2665(0xbe)](_0x45920a,_0x34d072,_0x4171a2,_0x85f29d,_0x3cefa5,_0x3cfc28,_0x27b32d),_0x32fcfc=await a9_0x235b42[_0xce2665(0xb2)](_0x5347e0,{'parser':_0xce2665(0xbc)}),_0x476d83=_0x442dc3+'/'+_0x366f4e+_0xce2665(0xc2);writeFileSync(_0x476d83,_0x32fcfc,{'encoding':'utf8'});const _0x3b5ca5=_0x4171a2[_0xce2665(0xb0)];return logger[_0xce2665(0xb8)](_0xce2665(0xd8),_0xce2665(0xc6),undefined,{'apiFile':_0x475058,'clientFile':_0x476d83,'modelCount':_0x3b5ca5,'configName':_0x3cfc28}),{'modelCount':_0x3b5ca5,'apiFilePath':_0x475058,'clientFilePath':_0x476d83,'configName':_0x3cfc28};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5117a2,_0x528c71){const _0x5e2467=a10_0x4d2f,_0x28ee4f=_0x5117a2();while(!![]){try{const _0x428b77=parseInt(_0x5e2467(0x11a))/0x1*(-parseInt(_0x5e2467(0x121))/0x2)+-parseInt(_0x5e2467(0x10e))/0x3+-parseInt(_0x5e2467(0x10f))/0x4*(parseInt(_0x5e2467(0x124))/0x5)+parseInt(_0x5e2467(0x117))/0x6+parseInt(_0x5e2467(0x11f))/0x7*(-parseInt(_0x5e2467(0x134))/0x8)+-parseInt(_0x5e2467(0x126))/0x9+parseInt(_0x5e2467(0x10b))/0xa*(parseInt(_0x5e2467(0x118))/0xb);if(_0x428b77===_0x528c71)break;else _0x28ee4f['push'](_0x28ee4f['shift']());}catch(_0x3463c7){_0x28ee4f['push'](_0x28ee4f['shift']());}}}(a10_0x3e05,0x89067));function a10_0x4d2f(_0x2662b9,_0x5728af){_0x2662b9=_0x2662b9-0x104;const _0x3e0544=a10_0x3e05();let _0x4d2fb3=_0x3e0544[_0x2662b9];return _0x4d2fb3;}import{jsx as a10_0x2d8ee5}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a10_0x3e05(){const _0x47ccf1=['input','1517055mQVCUS','1551324PhjzTp','params','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','object','error','log','×\x20未配置\x20AppCode','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','2646588dcOYFX','66WuWpUT','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','1322pjveFZ','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x1b[0m','appcode','14VdSVyc','parse','978mcnxIX','join','\x1b[90m*\x20使用配置的应用AppCode:\x20','5mhGsQR','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','7243551vCLFRO','\x20\x20错误:\x20','filter','datasetcode','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','map','output','string','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','❌\x20错误:不再支持位置参数方式','doc','Unknown\x20api\x20command:\x20','Available\x20commands:','exit','786832OEHTCe','trim','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','flags','length','!\x20请使用以下方式之一:','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','pull','请使用\x20--appcode\x20参数,例如:','4436130uxsmuK','env'];a10_0x3e05=function(){return _0x47ccf1;};return a10_0x3e05();}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x4bfdde){const _0x4781e8=a10_0x4d2f,_0x2f8a84=_0x4bfdde[_0x4781e8(0x10d)][0x1];if(_0x4bfdde['flags']['help']){console[_0x4781e8(0x114)]('\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');return;}if(_0x2f8a84===_0x4781e8(0x109)){_0x4bfdde[_0x4781e8(0x10d)][0x2]&&(console[_0x4781e8(0x113)](_0x4781e8(0x12f)),console['log'](_0x4781e8(0x10a)),console[_0x4781e8(0x114)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x4bfdde[_0x4781e8(0x10d)][0x2]),process[_0x4781e8(0x133)](0x1));const _0x26ce09=getConfigAppCode();let _0x5a1670=_0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x11e)];const _0x2ec4f4=typeof _0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x10c)]===_0x4781e8(0x12d)?_0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x10c)]:undefined,_0x1352c0=_0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x12c)];!_0x5a1670&&!_0x26ce09&&(console[_0x4781e8(0x113)](_0x4781e8(0x115)),console[_0x4781e8(0x114)](_0x4781e8(0x107)),console['log'](_0x4781e8(0x119)),console[_0x4781e8(0x114)](_0x4781e8(0x12e)),process[_0x4781e8(0x133)](0x1)),_0x5a1670&&_0x26ce09&&_0x5a1670===_0x26ce09&&(console['log']('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x5a1670+_0x4781e8(0x11d)),console[_0x4781e8(0x114)](_0x4781e8(0x12a)),_0x5a1670=undefined),render(a10_0x2d8ee5(ApiPullUI,{'appCode':_0x5a1670,'env':_0x2ec4f4,'output':_0x1352c0}));}else{if(_0x2f8a84===_0x4781e8(0x130)){_0x4bfdde['input'][0x2]&&(console[_0x4781e8(0x113)](_0x4781e8(0x12f)),console[_0x4781e8(0x114)](_0x4781e8(0x10a)),console[_0x4781e8(0x114)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x4bfdde[_0x4781e8(0x10d)][0x2]),process['exit'](0x1));const _0x1638bc=getConfigAppCode();let _0x4943f9=_0x4bfdde['flags'][_0x4781e8(0x11e)];const _0x14f128=typeof _0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x10c)]===_0x4781e8(0x12d)?_0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x10c)]:undefined,_0xefb10c=_0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x12c)],_0x58f580=_0x4bfdde['flags'][_0x4781e8(0x110)],_0x47d354=_0x4bfdde[_0x4781e8(0x105)][_0x4781e8(0x129)];!_0x4943f9&&!_0x1638bc&&(console[_0x4781e8(0x113)](_0x4781e8(0x115)),console[_0x4781e8(0x114)](_0x4781e8(0x107)),console[_0x4781e8(0x114)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x4781e8(0x114)](_0x4781e8(0x111)),process[_0x4781e8(0x133)](0x1));_0x4943f9&&_0x1638bc&&_0x4943f9===_0x1638bc&&(console[_0x4781e8(0x114)](_0x4781e8(0x123)+_0x4943f9+_0x4781e8(0x11d)),_0x4943f9=undefined);let _0x3370c5;if(_0x58f580)try{_0x3370c5=JSON[_0x4781e8(0x120)](_0x58f580),(typeof _0x3370c5!==_0x4781e8(0x112)||_0x3370c5===null||Array['isArray'](_0x3370c5))&&(console[_0x4781e8(0x113)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x4781e8(0x133)](0x1));}catch(_0x549db9){console[_0x4781e8(0x113)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x4781e8(0x113)](_0x4781e8(0x127)+(_0x549db9 instanceof Error?_0x549db9['message']:String(_0x549db9))),process['exit'](0x1);}let _0xb2e7de;_0x47d354&&(_0xb2e7de=_0x47d354['split'](',')[_0x4781e8(0x12b)](_0x49c347=>_0x49c347[_0x4781e8(0x135)]())[_0x4781e8(0x128)](_0x44ad83=>_0x44ad83[_0x4781e8(0x106)]>0x0),_0xb2e7de[_0x4781e8(0x106)]===0x0&&(console['error']('×\x20--datasetcode\x20参数不能为空'),process['exit'](0x1)),console['log']('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0xb2e7de[_0x4781e8(0x122)](',\x20')+_0x4781e8(0x11d))),render(a10_0x2d8ee5(ApiDocUI,{'appCode':_0x4943f9,'env':_0x14f128,'output':_0xefb10c,'extraParams':_0x3370c5,'datasetCodes':_0xb2e7de}));}else console[_0x4781e8(0x113)](_0x4781e8(0x131)+_0x2f8a84),console['log'](_0x4781e8(0x132)),console[_0x4781e8(0x114)]('\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'](_0x4781e8(0x104)),console['log'](_0x4781e8(0x108)),console['log'](_0x4781e8(0x125)),console[_0x4781e8(0x114)](''),console[_0x4781e8(0x114)]('\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文档'),console[_0x4781e8(0x114)](_0x4781e8(0x11c)),console[_0x4781e8(0x114)](_0x4781e8(0x116)),console[_0x4781e8(0x114)](_0x4781e8(0x11b)),process[_0x4781e8(0x133)](0x1);}}
1
+ (function(_0x75d14c,_0x5af2e9){const _0x2248b9=a10_0x4ded,_0x27d176=_0x75d14c();while(!![]){try{const _0x4f72e5=parseInt(_0x2248b9(0x1e7))/0x1*(parseInt(_0x2248b9(0x202))/0x2)+-parseInt(_0x2248b9(0x204))/0x3*(-parseInt(_0x2248b9(0x1e1))/0x4)+parseInt(_0x2248b9(0x1d9))/0x5*(-parseInt(_0x2248b9(0x1df))/0x6)+parseInt(_0x2248b9(0x1f2))/0x7+-parseInt(_0x2248b9(0x1e4))/0x8+-parseInt(_0x2248b9(0x207))/0x9*(-parseInt(_0x2248b9(0x1fb))/0xa)+parseInt(_0x2248b9(0x206))/0xb;if(_0x4f72e5===_0x5af2e9)break;else _0x27d176['push'](_0x27d176['shift']());}catch(_0x3c7fa){_0x27d176['push'](_0x27d176['shift']());}}}(a10_0x5887,0x4bd0a));function a10_0x4ded(_0xc39eec,_0x567524){_0xc39eec=_0xc39eec-0x1d1;const _0x58873c=a10_0x5887();let _0x4dedc0=_0x58873c[_0xc39eec];return _0x4dedc0;}import{jsx as a10_0x28ff4e}from'react/jsx-runtime';function a10_0x5887(){const _0x46e32b=['string','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','❌\x20错误:不再支持位置参数方式','doc','622290LZrUHF','log','10072BKtPsR','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','trim','4329120VvmrqT','Unknown\x20api\x20command:\x20','message','4601iXeqbW','error','split','\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--datasetcode\x20参数不能为空','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','pull','help','flags','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','isArray','251118RBLlmG','\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','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','params','\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配置文件','!\x20请使用以下方式之一:','filter','10PJMSUa','exit','join','请使用\x20--appcode\x20参数,例如:','output','parse','×\x20未配置\x20AppCode','164CAgbLI','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','90BbCquI','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','5987410zortXk','1168353AmNWFq','×\x20--params\x20参数不是有效的\x20JSON\x20格式','length','\x20\x20错误:\x20','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x1b[0m','appcode','input','object','15biQdef','env'];a10_0x5887=function(){return _0x46e32b;};return a10_0x5887();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x3fc361){const _0x4c5815=a10_0x4ded,_0x4cd37a=_0x3fc361[_0x4c5815(0x1d7)][0x1];if(_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1ee)]){console['log'](_0x4c5815(0x1f3));return;}if(_0x4cd37a===_0x4c5815(0x1ed)){_0x3fc361['input'][0x2]&&(console['error'](_0x4c5815(0x1dd)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1fe)),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x3fc361[_0x4c5815(0x1d7)][0x2]),process[_0x4c5815(0x1fc)](0x1));const _0x5a0179=getConfigAppCode();let _0xb0fc86=_0x3fc361[_0x4c5815(0x1ef)]['appcode'];const _0x582465=typeof _0x3fc361[_0x4c5815(0x1ef)]['env']===_0x4c5815(0x1db)?_0x3fc361[_0x4c5815(0x1ef)]['env']:undefined,_0x162f89=_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1ff)];!_0xb0fc86&&!_0x5a0179&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x201)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f9)),console[_0x4c5815(0x1e0)](_0x4c5815(0x203)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1e2)),process[_0x4c5815(0x1fc)](0x1)),_0xb0fc86&&_0x5a0179&&_0xb0fc86===_0x5a0179&&(console[_0x4c5815(0x1e0)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0xb0fc86+_0x4c5815(0x1d5)),console['log'](_0x4c5815(0x1d4)),_0xb0fc86=undefined),render(a10_0x28ff4e(ApiPullUI,{'appCode':_0xb0fc86,'env':_0x582465,'output':_0x162f89}));}else{if(_0x4cd37a===_0x4c5815(0x1de)){_0x3fc361[_0x4c5815(0x1d7)][0x2]&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x1dd)),console['log'](_0x4c5815(0x1fe)),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x3fc361[_0x4c5815(0x1d7)][0x2]),process[_0x4c5815(0x1fc)](0x1));const _0x4c97e0=getConfigAppCode();let _0x3297d1=_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1d6)];const _0x3f3cd6=typeof _0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1da)]===_0x4c5815(0x1db)?_0x3fc361['flags']['env']:undefined,_0x5a9d63=_0x3fc361['flags']['output'],_0x4fd284=_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1f7)],_0x442d24=_0x3fc361[_0x4c5815(0x1ef)]['datasetcode'];!_0x3297d1&&!_0x4c97e0&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x201)),console['log'](_0x4c5815(0x1f9)),console['log'](_0x4c5815(0x203)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f0)),process[_0x4c5815(0x1fc)](0x1));_0x3297d1&&_0x4c97e0&&_0x3297d1===_0x4c97e0&&(console[_0x4c5815(0x1e0)](_0x4c5815(0x1f5)+_0x3297d1+_0x4c5815(0x1d5)),_0x3297d1=undefined);let _0x1efbe;if(_0x4fd284)try{_0x1efbe=JSON[_0x4c5815(0x200)](_0x4fd284),(typeof _0x1efbe!==_0x4c5815(0x1d8)||_0x1efbe===null||Array[_0x4c5815(0x1f1)](_0x1efbe))&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x1dc)),process[_0x4c5815(0x1fc)](0x1));}catch(_0x440cc4){console['error'](_0x4c5815(0x1d1)),console['error'](_0x4c5815(0x1d3)+(_0x440cc4 instanceof Error?_0x440cc4[_0x4c5815(0x1e6)]:String(_0x440cc4))),process['exit'](0x1);}let _0x3e2b37;_0x442d24&&(_0x3e2b37=_0x442d24[_0x4c5815(0x1e9)](',')['map'](_0x3aad0c=>_0x3aad0c[_0x4c5815(0x1e3)]())[_0x4c5815(0x1fa)](_0x55ae85=>_0x55ae85[_0x4c5815(0x1d2)]>0x0),_0x3e2b37[_0x4c5815(0x1d2)]===0x0&&(console['error'](_0x4c5815(0x1eb)),process[_0x4c5815(0x1fc)](0x1)),console[_0x4c5815(0x1e0)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x3e2b37[_0x4c5815(0x1fd)](',\x20')+_0x4c5815(0x1d5))),render(a10_0x28ff4e(ApiDocUI,{'appCode':_0x3297d1,'env':_0x3f3cd6,'output':_0x5a9d63,'extraParams':_0x1efbe,'datasetCodes':_0x3e2b37}));}else console[_0x4c5815(0x1e8)](_0x4c5815(0x1e5)+_0x4cd37a),console[_0x4c5815(0x1e0)]('Available\x20commands:'),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f8)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f6)),console['log'](_0x4c5815(0x1f4)),console['log'](_0x4c5815(0x1ec)),console[_0x4c5815(0x1e0)](''),console[_0x4c5815(0x1e0)](_0x4c5815(0x1ea)),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)'),console[_0x4c5815(0x1e0)](_0x4c5815(0x205)),process['exit'](0x1);}}